@treasuredata/tdx 2026.6.0 → 2026.6.1
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/cas-command.js +1 -1
- package/dist/commands/cas-segment-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/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-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/policy-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.js +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/table-deleted.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/work-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/oauth-keychain.js +1 -1
- package/dist/core/oauth.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/tools/work-create-item.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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +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/oauth-refresh.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.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +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/types/template-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.d.ts +8 -4
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.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.js +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.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +4 -3
- 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/types/workspace.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/paginate.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/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.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/github-releases.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
|
-
function a31_0x5995(_0xb8d132,_0x4b64f1){_0xb8d132=_0xb8d132-0x1e9;const _0x3f6fd2=a31_0x3f6f();let _0x5995b3=_0x3f6fd2[_0xb8d132];return _0x5995b3;}const a31_0x461edb=a31_0x5995;(function(_0x509e95,_0x538dae){const _0x40dadc=a31_0x5995,_0x380442=_0x509e95();while(!![]){try{const _0x475c4b=parseInt(_0x40dadc(0x1f0))/0x1*(parseInt(_0x40dadc(0x2fa))/0x2)+-parseInt(_0x40dadc(0x218))/0x3*(parseInt(_0x40dadc(0x204))/0x4)+-parseInt(_0x40dadc(0x21a))/0x5+-parseInt(_0x40dadc(0x1ff))/0x6*(parseInt(_0x40dadc(0x311))/0x7)+-parseInt(_0x40dadc(0x1f5))/0x8*(parseInt(_0x40dadc(0x295))/0x9)+parseInt(_0x40dadc(0x3cc))/0xa+parseInt(_0x40dadc(0x242))/0xb;if(_0x475c4b===_0x538dae)break;else _0x380442['push'](_0x380442['shift']());}catch(_0x1d23cc){_0x380442['push'](_0x380442['shift']());}}}(a31_0x3f6f,0x4b718));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0xccace1 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x4004bd from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x461edb(0x364),LEGACY_PARENT_SEGMENT_DIR=a31_0x461edb(0x266);function openBrowser(_0x2dc45c){const _0x44a136=a31_0x461edb,_0x5bfc05=process[_0x44a136(0x200)],_0x3c6287=_0x5bfc05===_0x44a136(0x2dc)?'open':_0x5bfc05===_0x44a136(0x33d)?_0x44a136(0x283):_0x44a136(0x2e6);spawn(_0x3c6287,[_0x2dc45c],{'detached':!![],'stdio':_0x44a136(0x370)})[_0x44a136(0x30d)]();}function migrateLegacyDirectory(){const _0x49455d=a31_0x461edb;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x89fb8a=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x89fb8a[_0x49455d(0x2da)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a31_0x4004bd['yellow'](_0x49455d(0x3b5)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x49455d(0x3c8))),console[_0x49455d(0x21e)](a31_0x4004bd['dim']('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x49455d(0x35c))),![];console[_0x49455d(0x21e)](a31_0x4004bd[_0x49455d(0x3c6)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x49455d(0x2fb)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x49455d(0x21e)](a31_0x4004bd[_0x49455d(0x224)](_0x49455d(0x26f)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2737fc){const _0x1bf5cb=_0x2737fc instanceof Error?_0x2737fc['message']:String(_0x2737fc);return console[_0x49455d(0x21e)](a31_0x4004bd[_0x49455d(0x328)](_0x49455d(0x2d5)+_0x1bf5cb+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x461edb(0x1f9)](_0x344aff){const _0xefafbd=a31_0x461edb;return migrateLegacyDirectory(),super[_0xefafbd(0x1f9)](_0x344aff);}}function resolveYamlFile(_0x4f74ee){const _0x1513b6=a31_0x461edb;if(_0x4f74ee[_0x1513b6(0x335)]('.yml')||_0x4f74ee[_0x1513b6(0x335)]('.yaml'))return _0x4f74ee;return a31_0xccace1[_0x1513b6(0x375)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4f74ee)+_0x1513b6(0x36d));}function formatProgressMessage(_0x6438db){const _0x597112=a31_0x461edb,_0x5b8681=_0x6438db[_0x597112(0x27b)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5b8681){const [,_0x588201,_0x9bfd49,_0x22022b='']=_0x5b8681;return a31_0x4004bd[_0x597112(0x32a)](_0x588201+':')+'\x20'+_0x9bfd49+a31_0x4004bd['dim'](_0x22022b);}return a31_0x4004bd[_0x597112(0x32a)](_0x6438db);}function showFileNotFoundError(_0x36c745,_0x55668d){const _0x14c025=a31_0x461edb;console[_0x14c025(0x21e)](a31_0x4004bd[_0x14c025(0x328)](_0x14c025(0x3a0)+_0x36c745+'\x0a')),console[_0x14c025(0x21e)](a31_0x4004bd['cyan']('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x55668d+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x4442ab){const _0x480c14=a31_0x461edb;if(!_0x4442ab[_0x480c14(0x27a)])return;const _0x2258c1=_0x4442ab['realtime'],_0x443b16=_0x2258c1[_0x480c14(0x318)]?a31_0x4004bd[_0x480c14(0x224)](_0x480c14(0x2db)):a31_0x4004bd['yellow'](_0x480c14(0x3de));console[_0x480c14(0x21e)]('\x0a'+a31_0x4004bd[_0x480c14(0x32a)]('RT\x202.0:')+'\x20'+_0x443b16);if(_0x2258c1['events']&&_0x2258c1['events'][_0x480c14(0x248)]>0x0){console['error']('\x20\x20'+a31_0x4004bd[_0x480c14(0x32a)](_0x480c14(0x26d))+'\x20'+_0x2258c1['events'][_0x480c14(0x248)]+_0x480c14(0x253));for(const _0x10f86e of _0x2258c1['events']){const _0x3aedd1=_0x10f86e[_0x480c14(0x2f3)]===![]?a31_0x4004bd[_0x480c14(0x328)]('✘'):a31_0x4004bd[_0x480c14(0x224)]('✔');console[_0x480c14(0x21e)](_0x480c14(0x2aa)+_0x3aedd1+'\x20'+_0x10f86e['name']),_0x10f86e[_0x480c14(0x38e)]&&console['error'](_0x480c14(0x332)+a31_0x4004bd[_0x480c14(0x328)](_0x10f86e[_0x480c14(0x38e)]));}}if(_0x2258c1[_0x480c14(0x3bc)]&&_0x2258c1[_0x480c14(0x3bc)][_0x480c14(0x248)]>0x0){console[_0x480c14(0x21e)]('\x20\x20'+a31_0x4004bd['dim'](_0x480c14(0x2b3))+'\x20'+_0x2258c1[_0x480c14(0x3bc)][_0x480c14(0x248)]+'\x20configured');for(const _0x63918b of _0x2258c1[_0x480c14(0x3bc)]){const _0x4d6e8e=_0x63918b[_0x480c14(0x2f9)]?a31_0x4004bd['green']('✔'):a31_0x4004bd['red']('✘');console['error'](_0x480c14(0x2aa)+_0x4d6e8e+'\x20'+_0x63918b['name']+'\x20'+a31_0x4004bd[_0x480c14(0x32a)]('('+_0x63918b['type']+')'));}}if(_0x2258c1[_0x480c14(0x361)]){const _0x5131a0=_0x2258c1[_0x480c14(0x361)][_0x480c14(0x250)]?.[_0x480c14(0x248)]?_0x480c14(0x2bb)+_0x2258c1['idStitching'][_0x480c14(0x250)][_0x480c14(0x375)](',\x20')+']':'';console['error']('\x20\x20'+a31_0x4004bd['dim']('ID\x20Stitching:')+'\x20'+_0x2258c1[_0x480c14(0x361)][_0x480c14(0x1fa)]+_0x5131a0);}if(_0x2258c1[_0x480c14(0x2d2)]&&_0x2258c1[_0x480c14(0x2d2)]['length']>0x0){console[_0x480c14(0x21e)]('\x20\x20'+a31_0x4004bd[_0x480c14(0x32a)](_0x480c14(0x38a))+'\x20'+_0x2258c1[_0x480c14(0x2d2)][_0x480c14(0x248)]+_0x480c14(0x267)+(_0x2258c1[_0x480c14(0x2d2)]['length']!==0x1?'s':''));for(const _0x3a2694 of _0x2258c1[_0x480c14(0x2d2)]){console['error']('\x20\x20\x20\x20-\x20'+_0x3a2694[_0x480c14(0x3f3)]);}}}function showParentSegmentNotSetError(_0xf84187){const _0x4a7127=a31_0x461edb;console[_0x4a7127(0x21e)](a31_0x4004bd[_0x4a7127(0x3c6)](_0x4a7127(0x3a6))),console[_0x4a7127(0x21e)](_0xf84187);}export class ParentSegmentListCommand extends BaseCommand{['name']=a31_0x461edb(0x32c);[a31_0x461edb(0x395)]=a31_0x461edb(0x2ee);async[a31_0x461edb(0x1f4)](_0x3469cc){const _0x8f4d42=a31_0x461edb,{options:_0x1fc3f8,args:_0x296917,tdx:_0x3b6816}=_0x3469cc,_0x29f90a=_0x296917[0x0];_0x1fc3f8[_0x8f4d42(0x207)]&&(console[_0x8f4d42(0x21e)](_0x8f4d42(0x377)+_0x1fc3f8[_0x8f4d42(0x2ba)]),_0x29f90a&&console['error'](_0x8f4d42(0x297)+_0x29f90a));const _0x2042ac=await withSpinner(_0x29f90a?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x29f90a+'\x27...':_0x8f4d42(0x346),()=>_0x3b6816[_0x8f4d42(0x33f)][_0x8f4d42(0x2b4)](),{'verbose':_0x1fc3f8['verbose']});let _0x2a38e6=_0x2042ac[_0x8f4d42(0x3e3)];if(_0x29f90a){const _0xf4ef7c=_0x29f90a['replace'](/[.+^${}()|[\]\\]/g,_0x8f4d42(0x302))[_0x8f4d42(0x3fb)](/\*/g,'.*')['replace'](/\?/g,'.'),_0xbae803=new RegExp('^'+_0xf4ef7c+'$','i');_0x2a38e6=_0x2a38e6[_0x8f4d42(0x225)](_0x26c2c3=>_0xbae803[_0x8f4d42(0x280)](_0x26c2c3['attributes'][_0x8f4d42(0x3f3)]));}_0x2a38e6[_0x8f4d42(0x2cb)]((_0x2a63fd,_0x594c87)=>_0x2a63fd[_0x8f4d42(0x3bc)][_0x8f4d42(0x3f3)][_0x8f4d42(0x313)](_0x594c87[_0x8f4d42(0x3bc)][_0x8f4d42(0x3f3)])),console[_0x8f4d42(0x21e)]('✔\x20Found\x20'+_0x2a38e6[_0x8f4d42(0x248)]+_0x8f4d42(0x2c5)+(_0x2a38e6[_0x8f4d42(0x248)]!==0x1?'s':''));const _0x41b176=_0x5dbec0=>{const _0x7e4aa2=_0x8f4d42;return getConsoleNextUrl(_0x1fc3f8[_0x7e4aa2(0x2ba)],_0x7e4aa2(0x23a)+_0x5dbec0);};if(_0x1fc3f8[_0x8f4d42(0x215)]==='json'||_0x1fc3f8['format']==='jsonl'){const _0x76a7b6=_0x2a38e6['map'](_0x42e9ec=>({..._0x42e9ec,'url':_0x41b176(_0x42e9ec['id'])}));await handleSDKOutput(_0x76a7b6,_0x1fc3f8);}else{if(_0x2a38e6[_0x8f4d42(0x248)]===0x0)_0x29f90a?console['log'](_0x8f4d42(0x319)+_0x29f90a):console[_0x8f4d42(0x220)](_0x8f4d42(0x245));else for(const _0x5c2b03 of _0x2a38e6){const _0x5680fc=_0x5c2b03[_0x8f4d42(0x3bc)][_0x8f4d42(0x3ed)]?a31_0x4004bd[_0x8f4d42(0x32a)]('\x20('+formatRows(_0x5c2b03[_0x8f4d42(0x3bc)][_0x8f4d42(0x3ed)])+')'):'',_0x378bb3=hyperlink(_0x5c2b03[_0x8f4d42(0x3bc)][_0x8f4d42(0x3f3)],_0x41b176(_0x5c2b03['id']));console['log'](_0x8f4d42(0x31c)+_0x378bb3+_0x5680fc);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a31_0x461edb(0x22b);[a31_0x461edb(0x395)]=a31_0x461edb(0x345);async['execute'](_0x173de4){const _0x2bec70=a31_0x461edb,{options:_0x305aea,args:_0x4607b6,tdx:_0xc87f84}=_0x173de4;console[_0x2bec70(0x21e)](_0x2bec70(0x254)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2bec70(0x3a8));const _0x252208=_0x305aea;if(_0x4607b6[_0x2bec70(0x248)]===0x0)return console[_0x2bec70(0x21e)](a31_0x4004bd['red'](_0x2bec70(0x3d5))),console['error'](_0x2bec70(0x3ad)),0x1;const _0x2f788c=_0x4607b6[0x0];if(!_0x252208[_0x2bec70(0x269)]||!_0x252208[_0x2bec70(0x1eb)])return console['error']('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x2bec70(0x21e)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x252208[_0x2bec70(0x207)]&&(console[_0x2bec70(0x21e)](_0x2bec70(0x377)+_0x252208[_0x2bec70(0x2ba)]),console[_0x2bec70(0x21e)](_0x2bec70(0x396)+_0x2f788c),console['error']('Database:\x20'+_0x252208['database']),console['error'](_0x2bec70(0x238)+_0x252208['table']));const _0x10009d=await loadJSONFromOptions(_0x252208[_0x2bec70(0x3bc)],_0x252208['attributesFile']),_0x9622bb=await loadJSONFromOptions(_0x252208['behaviors'],_0x252208[_0x2bec70(0x31e)]),_0x1f968d=await loadJSONFromOptions(_0x252208[_0x2bec70(0x292)],_0x252208[_0x2bec70(0x2ec)]),_0x3c0912={'name':_0x2f788c,'description':_0x252208[_0x2bec70(0x395)],'scheduleType':_0x252208[_0x2bec70(0x210)],'scheduleOption':_0x252208[_0x2bec70(0x3eb)],'timezone':_0x252208[_0x2bec70(0x2ab)],'master':{'parentDatabaseName':_0x252208[_0x2bec70(0x269)],'parentTableName':_0x252208[_0x2bec70(0x1eb)]},'attributes':_0x10009d,'behaviors':_0x9622bb,'customerGroup':_0x1f968d},_0x467ec9=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x2f788c+_0x2bec70(0x3a7),()=>_0xc87f84[_0x2bec70(0x33f)][_0x2bec70(0x3d3)](_0x3c0912),{'verbose':_0x305aea[_0x2bec70(0x207)]}),_0x40d9d4=_0x467ec9[_0x2bec70(0x3e3)];return console['error'](_0x2bec70(0x2b2)+_0x40d9d4[_0x2bec70(0x3f3)]+_0x2bec70(0x382)+_0x40d9d4['id']),await handleSDKOutput([_0x40d9d4],_0x305aea),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a31_0x461edb(0x2e2);['description']=a31_0x461edb(0x374);async['execute'](_0x298b9c){const _0xb2ab06=a31_0x461edb,{options:_0x1679b5,args:_0x363134,tdx:_0x535a7e}=_0x298b9c;console[_0xb2ab06(0x21e)](_0xb2ab06(0x36e)+_0xb2ab06(0x271)+_0xb2ab06(0x3a8));const _0x61110c=_0x1679b5;if(_0x363134[_0xb2ab06(0x248)]===0x0)return console[_0xb2ab06(0x21e)](a31_0x4004bd[_0xb2ab06(0x328)](_0xb2ab06(0x3d5))),console[_0xb2ab06(0x21e)](_0xb2ab06(0x30a)),0x1;const _0x31fdfe=_0x363134[0x0];_0x61110c[_0xb2ab06(0x207)]&&(console[_0xb2ab06(0x21e)]('Site:\x20'+_0x61110c[_0xb2ab06(0x2ba)]),console[_0xb2ab06(0x21e)](_0xb2ab06(0x3e7)+_0x31fdfe));const _0x286abc=await withSpinner(_0xb2ab06(0x30f)+_0x31fdfe+_0xb2ab06(0x3a7),()=>_0x535a7e[_0xb2ab06(0x33f)][_0xb2ab06(0x3b8)](_0x31fdfe),{'verbose':_0x61110c[_0xb2ab06(0x207)]}),_0x34b6bf=_0x286abc[_0xb2ab06(0x3e3)],_0x3e1b31=await loadJSONFromOptions(_0x61110c[_0xb2ab06(0x25e)],_0x61110c[_0xb2ab06(0x3d1)]),_0x510613=await loadJSONFromOptions(_0x61110c['addBehaviors'],_0x61110c[_0xb2ab06(0x303)]),_0x128272={'name':_0x34b6bf[_0xb2ab06(0x3f3)],'description':_0x61110c[_0xb2ab06(0x395)]!==undefined?_0x61110c[_0xb2ab06(0x395)]:_0x34b6bf[_0xb2ab06(0x395)],'scheduleType':_0x61110c[_0xb2ab06(0x210)]!==undefined?_0x61110c[_0xb2ab06(0x210)]:_0x34b6bf[_0xb2ab06(0x210)],'scheduleOption':_0x61110c[_0xb2ab06(0x3eb)]!==undefined?_0x61110c[_0xb2ab06(0x3eb)]:_0x34b6bf[_0xb2ab06(0x3eb)],'timezone':_0x61110c[_0xb2ab06(0x2ab)]!==undefined?_0x61110c[_0xb2ab06(0x2ab)]:_0x34b6bf[_0xb2ab06(0x2ab)],'master':_0x34b6bf[_0xb2ab06(0x286)],'attributes':_0x3e1b31?[..._0x34b6bf[_0xb2ab06(0x3bc)]||[],..._0x3e1b31]:_0x34b6bf[_0xb2ab06(0x3bc)],'behaviors':_0x510613?[..._0x34b6bf[_0xb2ab06(0x39b)]||[],..._0x510613]:_0x34b6bf[_0xb2ab06(0x39b)],'customerGroup':_0x34b6bf['customerGroup']},_0x59456d=await withSpinner(_0xb2ab06(0x23d)+_0x31fdfe+'\x27...',()=>_0x535a7e[_0xb2ab06(0x33f)][_0xb2ab06(0x260)](_0x31fdfe,_0x128272),{'verbose':_0x61110c[_0xb2ab06(0x207)]}),_0x20857f=_0x59456d[_0xb2ab06(0x3e3)];return console[_0xb2ab06(0x21e)](_0xb2ab06(0x2e7)+_0x20857f[_0xb2ab06(0x3f3)]+'\x27'),await handleSDKOutput([_0x20857f],_0x61110c),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x29d);['description']=a31_0x461edb(0x35f);async[a31_0x461edb(0x1f4)](_0x3f66c4){const _0x36a438=a31_0x461edb,{options:_0x3aaf31,args:_0x3de8f9,tdx:_0x57f419}=_0x3f66c4,_0x1f3880=_0x3aaf31,_0x59d832=_0x3de8f9[0x0]||_0x3aaf31['parentSegment'];if(!_0x59d832)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x36a438(0x37c)),0x1;if(_0x1f3880[_0x36a438(0x341)]&&_0x1f3880['output'])return console[_0x36a438(0x21e)](a31_0x4004bd[_0x36a438(0x328)](_0x36a438(0x3db))),console[_0x36a438(0x21e)](a31_0x4004bd[_0x36a438(0x32a)](_0x36a438(0x350))),console[_0x36a438(0x21e)](a31_0x4004bd['dim']('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x36a438(0x279))),console[_0x36a438(0x21e)](a31_0x4004bd[_0x36a438(0x20e)](_0x36a438(0x368))),0x1;const _0x1913dd=_0x1f3880[_0x36a438(0x373)]||a31_0xccace1['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x59d832)+'.yml');_0x1f3880['verbose']&&(console[_0x36a438(0x21e)](_0x36a438(0x377)+_0x1f3880[_0x36a438(0x2ba)]),console[_0x36a438(0x21e)]('Parent\x20segment:\x20'+_0x59d832),console[_0x36a438(0x21e)]('Output\x20file:\x20'+_0x1913dd));const _0x43f092=await withSpinner(_0x36a438(0x234)+_0x59d832+_0x36a438(0x3a7),()=>_0x57f419[_0x36a438(0x33f)][_0x36a438(0x371)](_0x59d832),{'verbose':_0x1f3880[_0x36a438(0x207)]}),_0x58fb70=_0x43f092[_0x36a438(0x3e3)];if(existsSync(_0x1913dd)){const _0x3d231c=readFileSync(_0x1913dd,_0x36a438(0x2c4)),_0x2bd33a=generateDiff(_0x3d231c,_0x58fb70);if(!hasChanges(_0x2bd33a))console[_0x36a438(0x21e)](a31_0x4004bd['green']('✔')+'\x20No\x20changes\x20-\x20'+a31_0x4004bd[_0x36a438(0x20e)](_0x1913dd)+_0x36a438(0x232));else{console[_0x36a438(0x21e)](_0x36a438(0x233)+_0x1913dd+'\x27:'),console[_0x36a438(0x21e)]('─'[_0x36a438(0x401)](0x3c)),console[_0x36a438(0x21e)](formatDiffWithColors(_0x2bd33a)),console[_0x36a438(0x21e)]('─'[_0x36a438(0x401)](0x3c));if(!_0x1f3880[_0x36a438(0x272)]){if(!isInteractive())return console[_0x36a438(0x21e)](a31_0x4004bd[_0x36a438(0x328)]('\x0aError:'),_0x36a438(0x358)),console[_0x36a438(0x21e)](a31_0x4004bd[_0x36a438(0x32a)](_0x36a438(0x252))),0x1;const _0x11590d=await confirmKey(_0x36a438(0x389)+_0x1913dd+'\x27?');if(!_0x11590d)return console['error'](a31_0x4004bd['yellow']('Aborted.')),0x1;}writeFileSync(_0x1913dd,_0x58fb70,_0x36a438(0x2c4)),console['error'](a31_0x4004bd[_0x36a438(0x224)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x4004bd[_0x36a438(0x20e)](_0x1913dd));}}else{const _0x74bf61=a31_0xccace1[_0x36a438(0x20a)](_0x1913dd);!existsSync(_0x74bf61)&&mkdirSync(_0x74bf61,{'recursive':!![]}),writeFileSync(_0x1913dd,_0x58fb70,_0x36a438(0x2c4)),console[_0x36a438(0x21e)](a31_0x4004bd['green']('✔')+_0x36a438(0x3ab)+a31_0x4004bd[_0x36a438(0x20e)](_0x1913dd));}return saveSessionContext({'parent_segment':_0x59d832},_0x1f3880[_0x36a438(0x2f0)]),console[_0x36a438(0x21e)](a31_0x4004bd[_0x36a438(0x224)]('✔')+_0x36a438(0x25c)+a31_0x4004bd[_0x36a438(0x32a)](_0x36a438(0x266))+_0x36a438(0x2ce)+a31_0x4004bd['cyan'](_0x59d832)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']='segment:parent:push';[a31_0x461edb(0x395)]=a31_0x461edb(0x26e);async['execute'](_0x414ddc){const _0x1d049c=a31_0x461edb,{options:_0x212fe7,args:_0x22889a,tdx:_0x49b24b}=_0x414ddc,_0x1101ae=_0x212fe7,_0x41d377=_0x22889a[0x0]||_0x212fe7['parentSegment'];if(!_0x41d377)return showParentSegmentNotSetError(_0x1d049c(0x35a)+_0x1d049c(0x2ff)),0x1;const _0x171d39=resolveYamlFile(_0x41d377);if(!existsSync(_0x171d39))return showFileNotFoundError(_0x171d39,_0x41d377),0x1;_0x1101ae[_0x1d049c(0x207)]&&(console[_0x1d049c(0x21e)](_0x1d049c(0x377)+_0x1101ae[_0x1d049c(0x2ba)]),console[_0x1d049c(0x21e)](_0x1d049c(0x304)+_0x171d39));let _0x48540a;try{_0x48540a=readFileSync(_0x171d39,'utf-8');}catch(_0x4ef589){const _0x5d14c7=_0x4ef589 instanceof Error?_0x4ef589[_0x1d049c(0x265)]:String(_0x4ef589);return console[_0x1d049c(0x21e)]('Error\x20reading\x20file:\x20'+_0x5d14c7),0x1;}const _0x385242=await withSpinner(_0x1d049c(0x2a7),()=>_0x49b24b[_0x1d049c(0x33f)][_0x1d049c(0x333)](_0x48540a),{'verbose':_0x1101ae[_0x1d049c(0x207)]}),_0x3a03d4=_0x385242['data'],{isNew:_0x35a3ec,name:_0x4b43a5,hasChanges:_0x32b6c1,diffFormatted:_0x55df1e}=_0x3a03d4;if(!_0x32b6c1)return console[_0x1d049c(0x21e)]('✔\x20No\x20changes\x20-\x20\x27'+_0x4b43a5+_0x1d049c(0x30b)),0x0;_0x35a3ec?console[_0x1d049c(0x21e)](_0x1d049c(0x24e)+_0x4b43a5+'\x27:'):console[_0x1d049c(0x21e)](_0x1d049c(0x3b9)+_0x4b43a5+'\x27:');console[_0x1d049c(0x21e)]('─'[_0x1d049c(0x401)](0x3c)),console['error'](_0x55df1e),console[_0x1d049c(0x21e)]('─'['repeat'](0x3c));const _0x4da6e4=_0x35a3ec?_0x1d049c(0x1ee)+_0x4b43a5+'\x27?':_0x1d049c(0x337)+_0x4b43a5+'\x27?';if(!_0x1101ae[_0x1d049c(0x272)]){if(!isInteractive())return console[_0x1d049c(0x21e)](a31_0x4004bd[_0x1d049c(0x328)](_0x1d049c(0x2c1)),_0x1d049c(0x358)),console['error'](a31_0x4004bd[_0x1d049c(0x32a)](_0x1d049c(0x252))),0x1;const _0x4c2954=await confirmKey(_0x4da6e4);if(!_0x4c2954)return console[_0x1d049c(0x21e)](a31_0x4004bd[_0x1d049c(0x3c6)](_0x1d049c(0x219))),0x1;}const _0x1e10c5=_0x35a3ec?'Creating':_0x1d049c(0x231),_0x2f8dc3=await withSpinner(_0x1e10c5+_0x1d049c(0x243)+_0x4b43a5+_0x1d049c(0x3a7),()=>_0x3a03d4[_0x1d049c(0x226)](),{'verbose':_0x1101ae[_0x1d049c(0x207)]}),_0x39a611=_0x2f8dc3[_0x1d049c(0x3e3)],_0x16e9b3=getConsoleNextUrl(_0x1101ae[_0x1d049c(0x2ba)],_0x1d049c(0x23a)+_0x39a611['id']),_0x113953=_0x35a3ec?'Created':_0x1d049c(0x2e4);return console[_0x1d049c(0x21e)]('✔\x20'+_0x113953+_0x1d049c(0x243)+_0x39a611[_0x1d049c(0x3f3)]+'\x27'),console[_0x1d049c(0x21e)]('\x20\x20'+_0x16e9b3),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x3f6);[a31_0x461edb(0x395)]=a31_0x461edb(0x388);async[a31_0x461edb(0x1f4)](_0x532fc4){const _0x331fd4=a31_0x461edb,{options:_0x4015d4,args:_0x2cd496,tdx:_0x54dec4}=_0x532fc4,_0x3cd5fa=_0x4015d4,_0x4476d8=_0x2cd496[0x0]||_0x4015d4[_0x331fd4(0x2f7)];if(!_0x4476d8)return showParentSegmentNotSetError(_0x331fd4(0x2c9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x331fd4(0x244)+_0x331fd4(0x3f5)+_0x331fd4(0x3a1)),0x1;const _0x52ad96=resolveYamlFile(_0x4476d8);if(!existsSync(_0x52ad96))return showFileNotFoundError(_0x52ad96,_0x4476d8),0x1;_0x3cd5fa[_0x331fd4(0x207)]&&(console[_0x331fd4(0x21e)](_0x331fd4(0x377)+_0x3cd5fa[_0x331fd4(0x2ba)]),console['error']('YAML\x20file:\x20'+_0x52ad96));let _0x579191;try{_0x579191=readFileSync(_0x52ad96,_0x331fd4(0x2c4));}catch(_0x3b5639){const _0x117c55=_0x3b5639 instanceof Error?_0x3b5639[_0x331fd4(0x265)]:String(_0x3b5639);return console[_0x331fd4(0x21e)](_0x331fd4(0x36f)+_0x117c55),0x1;}const _0x13683e=createCommandSpinner(a31_0x4004bd[_0x331fd4(0x32a)](_0x331fd4(0x334)),{'verbose':_0x3cd5fa['verbose']});_0x13683e[_0x331fd4(0x283)]();const _0x24af40={'onProgress':_0x32f065=>{const _0x1aea35=_0x331fd4;_0x13683e[_0x1aea35(0x264)]=formatProgressMessage(_0x32f065);}};if(_0x3cd5fa['master'])_0x24af40[_0x331fd4(0x286)]=!![];if(_0x3cd5fa['enriched'])_0x24af40['enriched']=!![];_0x3cd5fa[_0x331fd4(0x353)]&&(_0x24af40['attribute']=_0x3cd5fa['attribute']);_0x3cd5fa['behavior']&&(_0x24af40['behavior']=_0x3cd5fa[_0x331fd4(0x367)]);if(_0x3cd5fa[_0x331fd4(0x355)])_0x24af40[_0x331fd4(0x355)]=_0x3cd5fa[_0x331fd4(0x355)];let _0x101483;try{_0x101483=await _0x54dec4[_0x331fd4(0x33f)][_0x331fd4(0x262)](_0x579191,_0x24af40),_0x13683e[_0x331fd4(0x3c0)]();}catch(_0x405686){_0x13683e[_0x331fd4(0x3c0)]();throw _0x405686;}const _0xa58ede=_0x3cd5fa['interval']||'-1d';return this[_0x331fd4(0x2bd)](_0x101483,_0x24af40,_0x52ad96,_0xa58ede),_0x101483[_0x331fd4(0x404)]?0x0:0x1;}[a31_0x461edb(0x2bd)](_0x22c11a,_0x45b01a,_0x8e352c,_0x291599){const _0x4e62f2=a31_0x461edb;console[_0x4e62f2(0x21e)]('\x0a'+a31_0x4004bd[_0x4e62f2(0x316)](_0x4e62f2(0x390))+'\x20'+_0x22c11a[_0x4e62f2(0x3f3)]),console[_0x4e62f2(0x21e)]('═'[_0x4e62f2(0x401)](0x3c)),this['displayMasterInfo'](_0x22c11a);if(typeof _0x45b01a[_0x4e62f2(0x353)]==='string'){this[_0x4e62f2(0x34c)](_0x22c11a),this[_0x4e62f2(0x2f4)](_0x22c11a),this[_0x4e62f2(0x23c)](_0x8e352c,_0x291599,_0x4e62f2(0x353),_0x45b01a[_0x4e62f2(0x353)]);return;}if(_0x45b01a[_0x4e62f2(0x353)]===!![]){this[_0x4e62f2(0x34c)](_0x22c11a),this[_0x4e62f2(0x2f4)](_0x22c11a),this['displayPreviewHints'](_0x8e352c,_0x291599,_0x4e62f2(0x3bc));return;}if(typeof _0x45b01a[_0x4e62f2(0x367)]===_0x4e62f2(0x3d8)){this[_0x4e62f2(0x2df)](_0x22c11a,_0x291599),this['displaySummary'](_0x22c11a),this[_0x4e62f2(0x23c)](_0x8e352c,_0x291599,_0x4e62f2(0x367),_0x45b01a[_0x4e62f2(0x367)]);return;}if(_0x45b01a[_0x4e62f2(0x367)]===!![]){this[_0x4e62f2(0x2df)](_0x22c11a,_0x291599),this[_0x4e62f2(0x2f4)](_0x22c11a),this[_0x4e62f2(0x23c)](_0x8e352c,_0x291599,_0x4e62f2(0x39b));return;}this['displayAttributesStats'](_0x22c11a),this[_0x4e62f2(0x2df)](_0x22c11a,_0x291599),this[_0x4e62f2(0x2d9)](_0x22c11a),this[_0x4e62f2(0x2f4)](_0x22c11a),this[_0x4e62f2(0x23c)](_0x8e352c,_0x291599,'all');}['displayRealtimeInfo'](_0x1a82f6){displayRealtimeValidation(_0x1a82f6);}[a31_0x461edb(0x23c)](_0x1fd4b3,_0x3cde34,_0x4eaee3,_0x20f283){const _0x42a094=a31_0x461edb;console['error']('\x0a'+a31_0x4004bd[_0x42a094(0x32a)](_0x42a094(0x3a5)));const _0x46d374=_0x3cde34!==_0x42a094(0x380)?_0x42a094(0x312)+_0x3cde34:'';if(_0x4eaee3==='attribute'&&_0x20f283)console[_0x42a094(0x21e)]('\x20\x20'+a31_0x4004bd[_0x42a094(0x32a)](_0x42a094(0x1ea)+_0x1fd4b3+'\x20--attribute\x20\x22'+_0x20f283+'\x22'+_0x46d374));else{if(_0x4eaee3===_0x42a094(0x367)&&_0x20f283)console[_0x42a094(0x21e)]('\x20\x20'+a31_0x4004bd[_0x42a094(0x32a)](_0x42a094(0x1ea)+_0x1fd4b3+'\x20--behavior\x20\x22'+_0x20f283+'\x22'+_0x46d374));else(_0x4eaee3==='attributes'||_0x4eaee3===_0x42a094(0x2eb))&&console[_0x42a094(0x21e)]('\x20\x20'+a31_0x4004bd[_0x42a094(0x32a)](_0x42a094(0x1ea)+_0x1fd4b3+_0x42a094(0x35d)+_0x46d374));}(_0x4eaee3===_0x42a094(0x39b)||_0x4eaee3===_0x42a094(0x2eb))&&console[_0x42a094(0x21e)]('\x20\x20'+a31_0x4004bd[_0x42a094(0x32a)](_0x42a094(0x1ea)+_0x1fd4b3+_0x42a094(0x275)+_0x46d374)),_0x4eaee3===_0x42a094(0x2eb)&&console['error']('\x20\x20'+a31_0x4004bd[_0x42a094(0x32a)]('tdx\x20ps\x20preview\x20'+_0x1fd4b3+'\x20--enriched'+_0x46d374));}['displayMasterInfo'](_0x832824){const _0x4a4210=a31_0x461edb,{master:_0x474011}=_0x832824,_0x43e401=_0x474011[_0x4a4210(0x228)]?a31_0x4004bd[_0x4a4210(0x224)]('✔'):a31_0x4004bd[_0x4a4210(0x328)]('✘');console[_0x4a4210(0x21e)]('\x0a'+a31_0x4004bd[_0x4a4210(0x32a)](_0x4a4210(0x3b3))),console[_0x4a4210(0x21e)](_0x43e401+'\x20'+a31_0x4004bd['bold'](_0x474011[_0x4a4210(0x269)]+'.'+_0x474011[_0x4a4210(0x1eb)])),_0x474011[_0x4a4210(0x228)]?_0x474011[_0x4a4210(0x349)]!==undefined&&console[_0x4a4210(0x21e)]('\x20\x20'+a31_0x4004bd[_0x4a4210(0x32a)](_0x4a4210(0x3aa))+'\x20'+a31_0x4004bd['cyan'](formatRows(_0x474011[_0x4a4210(0x349)]))):console[_0x4a4210(0x21e)]('\x20\x20'+a31_0x4004bd[_0x4a4210(0x328)](_0x4a4210(0x25b))+'\x20'+_0x474011[_0x4a4210(0x29e)]);}[a31_0x461edb(0x34c)](_0x527d19){const _0x11283e=a31_0x461edb;if(_0x527d19[_0x11283e(0x3bc)][_0x11283e(0x248)]===0x0)return;console[_0x11283e(0x21e)]('\x0a'+a31_0x4004bd['dim'](_0x11283e(0x320)));for(const _0x206b83 of _0x527d19[_0x11283e(0x3bc)]){const _0x4a4d4b=_0x206b83[_0x11283e(0x228)]?a31_0x4004bd[_0x11283e(0x224)]('✔'):a31_0x4004bd[_0x11283e(0x328)]('✘');let _0x47cce5='';if(_0x206b83['schemaValid']&&_0x206b83[_0x11283e(0x3f2)]!==undefined&&_0x206b83[_0x11283e(0x288)]!==undefined){const _0x3148d6=_0x206b83[_0x11283e(0x288)][_0x11283e(0x36b)](0x1),_0x20012d=_0x206b83[_0x11283e(0x288)]>=0x50?a31_0x4004bd[_0x11283e(0x224)]:_0x206b83[_0x11283e(0x288)]>=0x32?a31_0x4004bd['yellow']:a31_0x4004bd[_0x11283e(0x328)];_0x47cce5='\x20'+a31_0x4004bd[_0x11283e(0x32a)]('Coverage:')+'\x20'+_0x20012d(_0x3148d6+'%')+'\x20('+formatRows(_0x206b83[_0x11283e(0x3f2)])+_0x11283e(0x30c);}console['error'](_0x4a4d4b+'\x20'+a31_0x4004bd[_0x11283e(0x316)](_0x206b83[_0x11283e(0x3f3)])+_0x47cce5),console[_0x11283e(0x21e)]('\x20\x20'+a31_0x4004bd[_0x11283e(0x32a)](_0x11283e(0x306))+'\x20'+a31_0x4004bd[_0x11283e(0x316)](_0x206b83[_0x11283e(0x269)]+'.'+_0x206b83[_0x11283e(0x1eb)]));const _0x425ea1=_0x206b83[_0x11283e(0x2c7)]===_0x206b83['foreignKey']?a31_0x4004bd[_0x11283e(0x32a)](_0x11283e(0x33b))+'\x20'+_0x206b83[_0x11283e(0x2c7)]:a31_0x4004bd[_0x11283e(0x32a)]('Join:')+'\x20'+_0x206b83[_0x11283e(0x2c7)]+_0x11283e(0x2ce)+_0x206b83[_0x11283e(0x2bf)];console[_0x11283e(0x21e)]('\x20\x20'+_0x425ea1),console[_0x11283e(0x21e)]('\x20\x20'+a31_0x4004bd[_0x11283e(0x32a)]('Columns:')),this[_0x11283e(0x379)](_0x206b83[_0x11283e(0x3e5)]),!_0x206b83[_0x11283e(0x228)]&&console['error']('\x20\x20'+a31_0x4004bd[_0x11283e(0x328)]('Error:')+'\x20'+_0x206b83[_0x11283e(0x29e)]);}}[a31_0x461edb(0x2df)](_0x8f7db,_0x2fd361){const _0x4bf1c1=a31_0x461edb;if(_0x8f7db['behaviors'][_0x4bf1c1(0x248)]===0x0)return;console[_0x4bf1c1(0x21e)]('\x0a'+a31_0x4004bd['dim'](_0x4bf1c1(0x2b9))+'\x20'+a31_0x4004bd['dim']('('+_0x2fd361+')'));for(const _0x2dbaf1 of _0x8f7db[_0x4bf1c1(0x39b)]){const _0x1b84a2=_0x2dbaf1[_0x4bf1c1(0x228)]?a31_0x4004bd[_0x4bf1c1(0x224)]('✔'):a31_0x4004bd[_0x4bf1c1(0x328)]('✘');let _0x395cda='';if(_0x2dbaf1[_0x4bf1c1(0x228)]&&_0x2dbaf1[_0x4bf1c1(0x25d)]!==undefined&&_0x2dbaf1[_0x4bf1c1(0x24d)]!==undefined){const _0x5332fb=_0x2dbaf1[_0x4bf1c1(0x3c2)]?.[_0x4bf1c1(0x36b)](0x1)||'?',_0x4493e1=(_0x2dbaf1[_0x4bf1c1(0x3c2)]??0x0)>=0x32?a31_0x4004bd[_0x4bf1c1(0x224)]:(_0x2dbaf1[_0x4bf1c1(0x3c2)]??0x0)>=0x14?a31_0x4004bd['yellow']:a31_0x4004bd[_0x4bf1c1(0x328)];_0x395cda='\x20'+a31_0x4004bd[_0x4bf1c1(0x32a)](_0x4bf1c1(0x3dd))+'\x20'+_0x4493e1(formatRows(_0x2dbaf1[_0x4bf1c1(0x25d)]))+'\x20('+_0x5332fb+_0x4bf1c1(0x30e)+a31_0x4004bd['dim'](_0x4bf1c1(0x26d))+'\x20'+a31_0x4004bd['cyan'](formatRows(_0x2dbaf1[_0x4bf1c1(0x24d)]));}console[_0x4bf1c1(0x21e)](_0x1b84a2+'\x20'+a31_0x4004bd[_0x4bf1c1(0x316)](_0x2dbaf1[_0x4bf1c1(0x3f3)])+_0x395cda),console[_0x4bf1c1(0x21e)]('\x20\x20'+a31_0x4004bd[_0x4bf1c1(0x32a)](_0x4bf1c1(0x306))+'\x20'+a31_0x4004bd[_0x4bf1c1(0x316)](_0x2dbaf1[_0x4bf1c1(0x269)]+'.'+_0x2dbaf1['table']));const _0x3b9922=_0x2dbaf1[_0x4bf1c1(0x2c7)]===_0x2dbaf1[_0x4bf1c1(0x2bf)]?a31_0x4004bd[_0x4bf1c1(0x32a)](_0x4bf1c1(0x33b))+'\x20'+_0x2dbaf1['joinKey']:a31_0x4004bd['dim'](_0x4bf1c1(0x255))+'\x20'+_0x2dbaf1[_0x4bf1c1(0x2c7)]+_0x4bf1c1(0x2ce)+_0x2dbaf1[_0x4bf1c1(0x2bf)];console[_0x4bf1c1(0x21e)]('\x20\x20'+_0x3b9922),console[_0x4bf1c1(0x21e)]('\x20\x20'+a31_0x4004bd[_0x4bf1c1(0x32a)]('Columns:')),this[_0x4bf1c1(0x379)](_0x2dbaf1['columns']),!_0x2dbaf1[_0x4bf1c1(0x228)]&&console[_0x4bf1c1(0x21e)]('\x20\x20'+a31_0x4004bd[_0x4bf1c1(0x328)](_0x4bf1c1(0x25b))+'\x20'+_0x2dbaf1[_0x4bf1c1(0x29e)]);}}[a31_0x461edb(0x379)](_0x2bece1){const _0x2d5d=a31_0x461edb;for(const _0x2d806a of _0x2bece1){_0x2d806a[_0x2d5d(0x38f)]===_0x2d806a[_0x2d5d(0x20f)]||_0x2d806a[_0x2d5d(0x20f)]==='*'?console['error'](_0x2d5d(0x1f2)+_0x2d806a[_0x2d5d(0x38f)]):console['error'](_0x2d5d(0x1f2)+_0x2d806a[_0x2d5d(0x38f)]+'\x20'+a31_0x4004bd[_0x2d5d(0x32a)]('('+_0x2d806a[_0x2d5d(0x20f)]+')'));}}[a31_0x461edb(0x2f4)](_0x4671d4){const _0x2c25df=a31_0x461edb;console[_0x2c25df(0x21e)]('─'[_0x2c25df(0x401)](0x3c));if(_0x4671d4[_0x2c25df(0x28b)][_0x2c25df(0x248)]>0x0){console[_0x2c25df(0x21e)]('\x0a'+a31_0x4004bd['red'](_0x2c25df(0x301)));for(const _0x48c2f5 of _0x4671d4[_0x2c25df(0x28b)]){console[_0x2c25df(0x21e)]('\x20\x20'+a31_0x4004bd['red']('•')+'\x20'+_0x48c2f5);}}_0x4671d4['allValid']&&console[_0x2c25df(0x21e)]('\x0a'+a31_0x4004bd[_0x2c25df(0x224)]('✔')+_0x2c25df(0x359));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a31_0x461edb(0x36a);[a31_0x461edb(0x395)]=a31_0x461edb(0x3ea);async[a31_0x461edb(0x1f4)](_0x3f9b99){const _0x19b633=a31_0x461edb,{options:_0x601b39,args:_0x1b3cfb,tdx:_0x4df0ec}=_0x3f9b99,_0x171cce=_0x601b39,_0x3120be=_0x1b3cfb[0x0]||_0x601b39['parentSegment'];if(!_0x3120be)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x19b633(0x2a6)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x19b633(0x3f8)+_0x19b633(0x2d0)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x171cce['master']&&!_0x171cce[_0x19b633(0x353)]&&!_0x171cce[_0x19b633(0x367)]&&!_0x171cce[_0x19b633(0x273)])return console[_0x19b633(0x21e)](a31_0x4004bd[_0x19b633(0x328)](_0x19b633(0x240))),console[_0x19b633(0x21e)](_0x19b633(0x3d9)),console[_0x19b633(0x21e)]('Options:'),console[_0x19b633(0x21e)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x19b633(0x21e)](_0x19b633(0x322)),console[_0x19b633(0x21e)](_0x19b633(0x2fe)),console[_0x19b633(0x21e)](_0x19b633(0x37a)),0x1;const _0x87b281=resolveYamlFile(_0x3120be);if(!existsSync(_0x87b281))return showFileNotFoundError(_0x87b281,_0x3120be),0x1;_0x171cce[_0x19b633(0x207)]&&(console[_0x19b633(0x21e)]('Site:\x20'+_0x171cce[_0x19b633(0x2ba)]),console['error']('YAML\x20file:\x20'+_0x87b281));let _0x32314d;try{_0x32314d=readFileSync(_0x87b281,'utf-8');}catch(_0x54247a){const _0x909469=_0x54247a instanceof Error?_0x54247a[_0x19b633(0x265)]:String(_0x54247a);return console[_0x19b633(0x21e)](_0x19b633(0x36f)+_0x909469),0x1;}let _0x3660fc;try{_0x3660fc=parseDef(_0x32314d);}catch(_0x363083){const _0x378e24=_0x363083 instanceof Error?_0x363083[_0x19b633(0x265)]:String(_0x363083);return console[_0x19b633(0x21e)](a31_0x4004bd['red'](_0x19b633(0x352)+_0x378e24)),0x1;}if(_0x171cce[_0x19b633(0x353)]===!![]||_0x171cce[_0x19b633(0x353)]===''){const _0x5cdfb8=_0x3660fc[_0x19b633(0x3bc)]?.[_0x19b633(0x3cf)](_0x251bbe=>_0x251bbe[_0x19b633(0x3f3)])||[];if(_0x5cdfb8[_0x19b633(0x248)]===0x0)console[_0x19b633(0x21e)](a31_0x4004bd[_0x19b633(0x328)](_0x19b633(0x274)));else{console[_0x19b633(0x21e)](a31_0x4004bd[_0x19b633(0x328)](_0x19b633(0x2c2))),console['error'](_0x19b633(0x2be));for(const _0x575be9 of _0x5cdfb8){console[_0x19b633(0x21e)]('\x20\x20'+a31_0x4004bd[_0x19b633(0x20e)](_0x575be9));}console['error'](_0x19b633(0x21d)+_0x3120be+_0x19b633(0x38c)+_0x5cdfb8[0x0]+'\x22');}return 0x1;}if(_0x171cce[_0x19b633(0x367)]===!![]||_0x171cce[_0x19b633(0x367)]===''){const _0x5515ea=_0x3660fc['behaviors']?.[_0x19b633(0x3cf)](_0x3fb2d7=>_0x3fb2d7['name'])||[];if(_0x5515ea[_0x19b633(0x248)]===0x0)console[_0x19b633(0x21e)](a31_0x4004bd[_0x19b633(0x328)](_0x19b633(0x33c)));else{console[_0x19b633(0x21e)](a31_0x4004bd[_0x19b633(0x328)](_0x19b633(0x3f7))),console[_0x19b633(0x21e)](_0x19b633(0x28f));for(const _0x17d4ed of _0x5515ea){console[_0x19b633(0x21e)]('\x20\x20'+a31_0x4004bd[_0x19b633(0x20e)](_0x17d4ed));}console[_0x19b633(0x21e)](_0x19b633(0x21d)+_0x3120be+'\x20--behavior\x20\x22'+_0x5515ea[0x0]+'\x22');}return 0x1;}const _0x379c17=createCommandSpinner(a31_0x4004bd[_0x19b633(0x32a)]('Fetching\x20sample\x20data...'),{'verbose':_0x171cce[_0x19b633(0x207)]});_0x379c17[_0x19b633(0x283)]();const _0x193a89={'onProgress':_0x30a3f0=>{_0x379c17['text']=formatProgressMessage(_0x30a3f0);}};if(_0x171cce[_0x19b633(0x286)])_0x193a89[_0x19b633(0x286)]=!![];if(_0x171cce[_0x19b633(0x353)]&&typeof _0x171cce[_0x19b633(0x353)]===_0x19b633(0x3d8))_0x193a89[_0x19b633(0x353)]=_0x171cce[_0x19b633(0x353)];if(_0x171cce[_0x19b633(0x367)]&&typeof _0x171cce[_0x19b633(0x367)]==='string')_0x193a89[_0x19b633(0x367)]=_0x171cce[_0x19b633(0x367)];if(_0x171cce[_0x19b633(0x273)])_0x193a89[_0x19b633(0x273)]=!![];if(_0x171cce[_0x19b633(0x355)])_0x193a89[_0x19b633(0x355)]=_0x171cce[_0x19b633(0x355)];let _0x170197;try{_0x170197=await _0x4df0ec[_0x19b633(0x33f)][_0x19b633(0x1e9)](_0x32314d,_0x193a89),_0x379c17[_0x19b633(0x3c0)]();}catch(_0x599247){_0x379c17[_0x19b633(0x3c0)]();throw _0x599247;}return await this[_0x19b633(0x2a9)](_0x170197,{'master':_0x171cce[_0x19b633(0x286)],'attribute':typeof _0x171cce[_0x19b633(0x353)]===_0x19b633(0x3d8)?_0x171cce[_0x19b633(0x353)]:undefined,'behavior':typeof _0x171cce['behavior']===_0x19b633(0x3d8)?_0x171cce[_0x19b633(0x367)]:undefined,'enriched':_0x171cce['enriched']}),_0x170197[_0x19b633(0x404)]?0x0:0x1;}async['displayPreviewResults'](_0x57d9e9,_0x9a07bc){const _0x2b5413=a31_0x461edb;console[_0x2b5413(0x21e)]('\x0a'+a31_0x4004bd[_0x2b5413(0x316)]('Preview:')+'\x20'+_0x57d9e9['name']),console[_0x2b5413(0x21e)]('═'[_0x2b5413(0x401)](0x3c));if(_0x9a07bc[_0x2b5413(0x286)]&&_0x57d9e9['sampleData']){const _0x25219c=a31_0x4004bd[_0x2b5413(0x32a)]('Master:')+'\x20'+a31_0x4004bd[_0x2b5413(0x316)](_0x57d9e9[_0x2b5413(0x286)][_0x2b5413(0x269)]+'.'+_0x57d9e9['master']['table']);await this[_0x2b5413(0x20d)](_0x25219c,_0x57d9e9[_0x2b5413(0x27f)]);}else{if(_0x9a07bc['attribute']&&_0x57d9e9[_0x2b5413(0x27f)]){const _0x617cd4=a31_0x4004bd['dim'](_0x2b5413(0x327))+'\x20'+a31_0x4004bd[_0x2b5413(0x316)](_0x9a07bc[_0x2b5413(0x353)]);await this['displaySampleData'](_0x617cd4,_0x57d9e9[_0x2b5413(0x27f)]);}else{if(_0x9a07bc['behavior']&&_0x57d9e9[_0x2b5413(0x27f)]){const _0x44a547=a31_0x4004bd[_0x2b5413(0x32a)](_0x2b5413(0x2c8))+'\x20'+a31_0x4004bd[_0x2b5413(0x316)](_0x9a07bc[_0x2b5413(0x367)]);await this[_0x2b5413(0x20d)](_0x44a547,_0x57d9e9[_0x2b5413(0x27f)]);}else{if(_0x9a07bc[_0x2b5413(0x273)]&&_0x57d9e9[_0x2b5413(0x27f)]){const _0x234f67=a31_0x4004bd['dim'](_0x2b5413(0x257))+'\x20'+a31_0x4004bd[_0x2b5413(0x316)](_0x2b5413(0x2af));await this['displaySampleData'](_0x234f67,_0x57d9e9[_0x2b5413(0x27f)]);}else!_0x57d9e9[_0x2b5413(0x27f)]&&console[_0x2b5413(0x21e)](_0x2b5413(0x2fc));}}}if(_0x57d9e9[_0x2b5413(0x28b)]['length']>0x0){console[_0x2b5413(0x21e)]('─'['repeat'](0x3c)),console['error']('\x0a'+a31_0x4004bd[_0x2b5413(0x328)](_0x2b5413(0x301)));for(const _0x4482cf of _0x57d9e9[_0x2b5413(0x28b)]){console[_0x2b5413(0x21e)]('\x20\x20'+a31_0x4004bd['red']('•')+'\x20'+_0x4482cf);}}}async['displaySampleData'](_0xd759a3,_0x37679e){const _0x3cf09e=a31_0x461edb;if(_0x37679e['length']===0x0){console[_0x3cf09e(0x21e)]('\x0a'+_0xd759a3),console['error'](_0x3cf09e(0x3d6));return;}console[_0x3cf09e(0x21e)]('\x0a'+_0xd759a3);const _0x722019=Object[_0x3cf09e(0x2e0)](_0x37679e[0x0])['map'](_0x2b3d45=>({'name':_0x2b3d45,'type':typeof _0x37679e[0x0][_0x2b3d45]===_0x3cf09e(0x315)?'double':'varchar'})),_0xe43d81={'queryId':_0x3cf09e(0x2fd),'columns':_0x722019,'data':_0x37679e,'stats':{'state':_0x3cf09e(0x2b1),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x37679e[_0x3cf09e(0x248)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x169da5=formatAsTable(_0xe43d81,_0x37679e[_0x3cf09e(0x248)],!![]);await writeOutput(_0x169da5,undefined,_0x3cf09e(0x1eb));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x351);[a31_0x461edb(0x395)]=a31_0x461edb(0x397);async[a31_0x461edb(0x1f4)](_0x56e999){const _0x3efa2e=a31_0x461edb,{options:_0x412c7c,args:_0x50ad3e,tdx:_0x35647b}=_0x56e999,_0x331f93=_0x412c7c,_0x87d0fa=_0x50ad3e[0x0]||_0x412c7c['parentSegment'];if(!_0x87d0fa)return showParentSegmentNotSetError(_0x3efa2e(0x24c)+_0x3efa2e(0x39a)),0x1;const _0x32fe1c=resolveYamlFile(_0x87d0fa);if(existsSync(_0x32fe1c)){_0x331f93['verbose']&&console[_0x3efa2e(0x21e)](_0x3efa2e(0x21f)+_0x32fe1c);let _0x151acd;try{_0x151acd=readFileSync(_0x32fe1c,_0x3efa2e(0x2c4));}catch(_0x1c8555){const _0x35589d=_0x1c8555 instanceof Error?_0x1c8555[_0x3efa2e(0x265)]:String(_0x1c8555);return console[_0x3efa2e(0x21e)](_0x3efa2e(0x36f)+_0x35589d),0x1;}const _0x2609a4=await withSpinner(_0x3efa2e(0x2a7),()=>_0x35647b[_0x3efa2e(0x33f)][_0x3efa2e(0x333)](_0x151acd),{'verbose':_0x331f93[_0x3efa2e(0x207)]}),_0x12527c=_0x2609a4['data'],{isNew:_0x523917,name:_0x594243,hasChanges:_0x1312f5,diffFormatted:_0x568878}=_0x12527c;if(_0x1312f5){_0x523917?console[_0x3efa2e(0x21e)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x594243+'\x27:'):console[_0x3efa2e(0x21e)](_0x3efa2e(0x3b9)+_0x594243+'\x27:');console[_0x3efa2e(0x21e)]('─'[_0x3efa2e(0x401)](0x3c)),console[_0x3efa2e(0x21e)](_0x568878),console[_0x3efa2e(0x21e)]('─'['repeat'](0x3c));const _0x5d0ff1=_0x523917?_0x3efa2e(0x1ee)+_0x594243+_0x3efa2e(0x3df):_0x3efa2e(0x337)+_0x594243+'\x27\x20and\x20run\x20workflow?';if(!_0x331f93[_0x3efa2e(0x272)]){if(!isInteractive())return console['error'](a31_0x4004bd[_0x3efa2e(0x328)](_0x3efa2e(0x2c1)),_0x3efa2e(0x358)),console[_0x3efa2e(0x21e)](a31_0x4004bd[_0x3efa2e(0x32a)](_0x3efa2e(0x252))),0x1;const _0x389363=await confirmKey(_0x5d0ff1);if(!_0x389363)return console['error'](a31_0x4004bd[_0x3efa2e(0x3c6)](_0x3efa2e(0x219))),0x1;}const _0x5dd011=_0x523917?_0x3efa2e(0x3ff):'Updating';await withSpinner(_0x5dd011+_0x3efa2e(0x243)+_0x594243+_0x3efa2e(0x3a7),()=>_0x12527c[_0x3efa2e(0x226)](),{'verbose':_0x331f93[_0x3efa2e(0x207)]});const _0x247119=_0x523917?'Created':'Updated';console['error']('✔\x20'+_0x247119+_0x3efa2e(0x243)+_0x594243+'\x27');}else console[_0x3efa2e(0x21e)](_0x3efa2e(0x3ca)+_0x594243+_0x3efa2e(0x3fa));}const _0x33954a=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x87d0fa+_0x3efa2e(0x3a7),()=>_0x35647b['segment']['runParent'](_0x87d0fa),{'verbose':_0x331f93[_0x3efa2e(0x207)]}),_0x532c3b=_0x33954a['data'],_0x4404a2=getConsoleUrl(_0x331f93[_0x3efa2e(0x2ba)],_0x3efa2e(0x3e2)+_0x532c3b['workflowId']+'/sessions/'+_0x532c3b[_0x3efa2e(0x21b)]+_0x3efa2e(0x307)+_0x532c3b['workflowAttemptId']);return console[_0x3efa2e(0x21e)](_0x3efa2e(0x376)),console['error']('\x20\x20'+a31_0x4004bd['dim']('Audience\x20ID:')+'\x20'+_0x532c3b[_0x3efa2e(0x2d8)]),console[_0x3efa2e(0x21e)]('\x20\x20'+a31_0x4004bd[_0x3efa2e(0x32a)](_0x3efa2e(0x37b))+'\x20'+_0x532c3b[_0x3efa2e(0x317)]),console[_0x3efa2e(0x21e)]('\x20\x20'+a31_0x4004bd[_0x3efa2e(0x32a)](_0x3efa2e(0x1f7))+'\x20'+_0x532c3b[_0x3efa2e(0x21b)]),console[_0x3efa2e(0x21e)]('\x20\x20'+a31_0x4004bd[_0x3efa2e(0x32a)]('Attempt:')+'\x20'+_0x532c3b[_0x3efa2e(0x3e9)]),console[_0x3efa2e(0x21e)]('\x20\x20'+_0x4404a2),console[_0x3efa2e(0x21e)]('\x0a'+a31_0x4004bd[_0x3efa2e(0x32a)](_0x3efa2e(0x2c0))+_0x3efa2e(0x229)+_0x532c3b[_0x3efa2e(0x3e9)]+_0x3efa2e(0x3c9)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x2a3);['description']='List\x20available\x20fields\x20for\x20segmentation';async[a31_0x461edb(0x1f4)](_0x51fcb5){const _0x250124=a31_0x461edb,{options:_0x68be49,args:_0x4febd1,tdx:_0x42c1ea}=_0x51fcb5,_0x50b60e=_0x4febd1[0x0]||_0x68be49[_0x250124(0x2f7)];if(!_0x50b60e)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+_0x250124(0x3e6)),0x1;_0x68be49[_0x250124(0x207)]&&(console[_0x250124(0x21e)](_0x250124(0x377)+_0x68be49[_0x250124(0x2ba)]),console[_0x250124(0x21e)](_0x250124(0x3e7)+_0x50b60e));const _0x5e9b4c=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x50b60e+_0x250124(0x3a7),()=>_0x42c1ea[_0x250124(0x33f)][_0x250124(0x28e)](_0x50b60e),{'verbose':_0x68be49[_0x250124(0x207)]}),_0x15df4d=_0x5e9b4c['data'];console[_0x250124(0x21e)](_0x250124(0x214)+_0x15df4d['length']+_0x250124(0x386)+(_0x15df4d[_0x250124(0x248)]!==0x1?'s':''));if(_0x68be49['json']||_0x68be49[_0x250124(0x37d)])return await handleSDKOutput(_0x15df4d,_0x68be49),0x0;return displayFieldsHumanReadable(_0x15df4d,_0x50b60e),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x261);['description']=a31_0x461edb(0x211);async[a31_0x461edb(0x1f4)](_0x174fae){const _0x50fdd9=a31_0x461edb,{options:_0x4193f7,args:_0x5976bc,tdx:_0x183f77}=_0x174fae,_0x289b79=_0x4193f7,_0x3b81ff=_0x5976bc[0x0]||_0x4193f7[_0x50fdd9(0x2f7)];if(!_0x3b81ff)return showParentSegmentNotSetError(_0x50fdd9(0x37e)+_0x50fdd9(0x20c)+'Options:\x0a'+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x4193f7['verbose']&&(console[_0x50fdd9(0x21e)](_0x50fdd9(0x377)+_0x4193f7[_0x50fdd9(0x2ba)]),console[_0x50fdd9(0x21e)](_0x50fdd9(0x3e7)+_0x3b81ff));const _0x1d24d=await withSpinner(_0x50fdd9(0x234)+_0x3b81ff+_0x50fdd9(0x3a7),()=>_0x183f77[_0x50fdd9(0x33f)]['getParentFull'](_0x3b81ff),{'verbose':_0x4193f7[_0x50fdd9(0x207)]}),_0xb4aa6=_0x1d24d[_0x50fdd9(0x3e3)];if(_0x289b79[_0x50fdd9(0x2b6)]){const _0x3ed5d7=getConsoleNextUrl(_0x289b79[_0x50fdd9(0x2ba)],_0x50fdd9(0x23a)+_0xb4aa6['id']);return console[_0x50fdd9(0x21e)](a31_0x4004bd[_0x50fdd9(0x224)]('✔')+_0x50fdd9(0x277)+a31_0x4004bd[_0x50fdd9(0x20e)](_0x3ed5d7)),openBrowser(_0x3ed5d7),0x0;}return await handleSingleObjectOutput(_0xb4aa6,_0x4193f7),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x1f6);[a31_0x461edb(0x395)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a31_0x461edb(0x1f4)](_0xa6408){const _0x513a7c=a31_0x461edb,{options:_0x10b1f9,args:_0x132126,tdx:_0xa9bc50}=_0xa6408,_0x51e55f=_0x10b1f9,_0x2c6879=_0x132126[0x0]||_0x10b1f9['parentSegment'];if(!_0x2c6879)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a'+_0x513a7c(0x356)+_0x513a7c(0x27d)),0x1;_0x10b1f9['verbose']&&(console[_0x513a7c(0x21e)](_0x513a7c(0x377)+_0x10b1f9[_0x513a7c(0x2ba)]),console[_0x513a7c(0x21e)]('Parent\x20segment:\x20'+_0x2c6879));const _0x312c26=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2c6879+_0x513a7c(0x3a7),()=>_0xa9bc50[_0x513a7c(0x33f)][_0x513a7c(0x398)](_0x2c6879),{'verbose':_0x10b1f9[_0x513a7c(0x207)]}),_0x571c6a=_0x312c26[_0x513a7c(0x3e3)],_0x13661e=_0xa9bc50[_0x513a7c(0x33f)][_0x513a7c(0x282)](_0x571c6a);if(_0x51e55f[_0x513a7c(0x373)]){const _0x361824=await this[_0x513a7c(0x343)](_0xa6408,_0x2c6879,_0x571c6a,_0x13661e),_0xcfc003=this[_0x513a7c(0x384)](_0x361824);writeFileSync(_0x51e55f['output'],_0xcfc003);const _0x582ef1=_0x361824['customers'][_0x513a7c(0x3e5)][_0x513a7c(0x248)]+_0x361824[_0x513a7c(0x39b)][_0x513a7c(0x29f)]((_0x2dcd44,_0x49f6d0)=>_0x2dcd44+_0x49f6d0[_0x513a7c(0x3e5)][_0x513a7c(0x248)],0x0),_0x2b21e8=_0x361824[_0x513a7c(0x39b)][_0x513a7c(0x225)](_0x37ce78=>_0x37ce78[_0x513a7c(0x3e5)][_0x513a7c(0x248)]===0x0)[_0x513a7c(0x248)];return console[_0x513a7c(0x220)](_0x513a7c(0x22e)+_0x51e55f[_0x513a7c(0x373)]),console[_0x513a7c(0x220)](_0x513a7c(0x31d)+_0x13661e),console[_0x513a7c(0x220)](_0x513a7c(0x360)+_0x361824[_0x513a7c(0x39b)]['length']+_0x513a7c(0x3c1)),console[_0x513a7c(0x220)](_0x513a7c(0x213)+_0x582ef1+_0x513a7c(0x2d6)),_0x2b21e8>0x0&&console['log'](_0x513a7c(0x394)+_0x2b21e8+_0x513a7c(0x23b)),0x0;}console['error']('\x0a'+a31_0x4004bd['bold'](_0x513a7c(0x2ca))+'\x20'+a31_0x4004bd[_0x513a7c(0x20e)](_0x13661e));const _0x4d36f5=await withSpinner(_0x513a7c(0x259),()=>_0xa9bc50[_0x513a7c(0x33f)][_0x513a7c(0x2a1)](_0x571c6a),{'verbose':_0x10b1f9['verbose']});console[_0x513a7c(0x21e)]('\x0a'+a31_0x4004bd[_0x513a7c(0x316)](_0x513a7c(0x1f8))+'\x20'+a31_0x4004bd['dim']('('+_0x13661e+_0x513a7c(0x32e)));const _0x403ac9=await executeSchemaQuery(_0x4d36f5[_0x513a7c(0x3e3)],_0xa9bc50,_0x10b1f9);await handleQueryOutput(_0x403ac9,_0x10b1f9);const _0x369063=await withSpinner(_0x513a7c(0x3dc),()=>_0xa9bc50[_0x513a7c(0x33f)][_0x513a7c(0x363)](_0x571c6a),{'verbose':_0x10b1f9['verbose']});for(const _0x1cc8dd of _0x369063[_0x513a7c(0x3e3)]){const _0x58dce6='behavior_'+_0x1cc8dd[_0x513a7c(0x309)]()[_0x513a7c(0x3fb)](/\s+/g,'_'),_0x50dd9a=_0x513a7c(0x344)+_0x13661e+'.'+_0x58dce6;console[_0x513a7c(0x21e)]('\x0a'+a31_0x4004bd[_0x513a7c(0x316)](_0x1cc8dd)+'\x20'+a31_0x4004bd[_0x513a7c(0x32a)]('('+_0x13661e+'.'+_0x58dce6+')'));try{const _0x3ee8d7=await executeSchemaQuery(_0x50dd9a,_0xa9bc50,_0x10b1f9);await handleQueryOutput(_0x3ee8d7,_0x10b1f9);}catch{console[_0x513a7c(0x21e)](a31_0x4004bd[_0x513a7c(0x3c6)](_0x513a7c(0x2f6)));}}return 0x0;}async[a31_0x461edb(0x343)](_0x59d97e,_0x49383d,_0x5f3308,_0x5026a0){const _0x3f4e80=a31_0x461edb,{options:_0x3c9fb9,tdx:_0x2e39e7}=_0x59d97e,_0x2d71ed=await withSpinner(_0x3f4e80(0x259),()=>_0x2e39e7['segment'][_0x3f4e80(0x2a1)](_0x5f3308),{'verbose':_0x3c9fb9[_0x3f4e80(0x207)]}),_0x1680ef=await executeSchemaQuery(_0x2d71ed[_0x3f4e80(0x3e3)],_0x2e39e7,_0x3c9fb9),_0x248090=_0x1680ef[_0x3f4e80(0x3e3)]['map'](_0x2e8ef6=>({'name':_0x2e8ef6[_0x3f4e80(0x20b)],'type':_0x2e8ef6['column_type']})),_0x98bb17=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x2e39e7[_0x3f4e80(0x33f)]['getBehaviorNames'](_0x5f3308),{'verbose':_0x3c9fb9[_0x3f4e80(0x207)]}),_0x259718=[];for(const _0x2a1301 of _0x98bb17['data']){const _0x3a1981='behavior_'+_0x2a1301[_0x3f4e80(0x309)]()[_0x3f4e80(0x3fb)](/\s+/g,'_'),_0x202fca=_0x3f4e80(0x344)+_0x5026a0+'.'+_0x3a1981;let _0x381ec0=[];try{const _0x49b3ba=await executeSchemaQuery(_0x202fca,_0x2e39e7,_0x3c9fb9);_0x381ec0=_0x49b3ba[_0x3f4e80(0x3e3)][_0x3f4e80(0x3cf)](_0x3017bd=>({'name':_0x3017bd['column_name'],'type':_0x3017bd[_0x3f4e80(0x3fe)]}));}catch{}_0x259718['push']({'table':_0x3a1981,'columns':_0x381ec0});}return{'database':_0x5026a0,'parent_segment':_0x49383d,'parent_id':_0x5f3308,'customers':{'table':'customers','columns':_0x248090},'behaviors':_0x259718};}[a31_0x461edb(0x384)](_0x248cfb){const _0x2b333a=a31_0x461edb,_0x3b96e0=_0x2e358c=>{const _0x5a2e2a=a31_0x5995;if(_0x2e358c[_0x5a2e2a(0x248)]===0x0)return'[]';const _0x11b981=_0x2e358c[_0x5a2e2a(0x3cf)](_0xcf8fa8=>_0x5a2e2a(0x3a4)+_0xcf8fa8[_0x5a2e2a(0x3f3)]+_0x5a2e2a(0x3f9)+_0xcf8fa8[_0x5a2e2a(0x2ae)]+_0x5a2e2a(0x38d));return'[\x0a'+_0x11b981['join'](',\x0a')+_0x5a2e2a(0x391);},_0x22f893=_0x248cfb['behaviors'][_0x2b333a(0x3cf)](_0x4c09fb=>{const _0x2dac88=_0x2b333a;return _0x2dac88(0x3e4)+_0x4c09fb['table']+_0x2dac88(0x256)+_0x3b96e0(_0x4c09fb['columns'])[_0x2dac88(0x3fb)](/^/gm,'\x20\x20')[_0x2dac88(0x378)]()+_0x2dac88(0x3ec);})[_0x2b333a(0x375)](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x248cfb['database']+_0x2b333a(0x3ac)+_0x248cfb[_0x2b333a(0x266)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x248cfb['parent_id']+_0x2b333a(0x1ec)+_0x248cfb[_0x2b333a(0x1f8)][_0x2b333a(0x1eb)]+_0x2b333a(0x36c)+_0x3b96e0(_0x248cfb['customers'][_0x2b333a(0x3e5)])[_0x2b333a(0x3fb)](/^/gm,'\x20\x20')[_0x2b333a(0x378)]()+_0x2b333a(0x3bf)+_0x22f893+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x2c3);['description']=a31_0x461edb(0x1ef);async[a31_0x461edb(0x1f4)](_0x5a7e1f){const _0x517074=a31_0x461edb,{options:_0x5ec092,args:_0x19789d,tdx:_0xdc7a23}=_0x5a7e1f,_0x3dae6a=_0x19789d[0x0]||_0x5ec092[_0x517074(0x2f7)];if(!_0x3dae6a)return showParentSegmentNotSetError(_0x517074(0x2f1)+_0x517074(0x263)),0x1;_0x5ec092[_0x517074(0x207)]&&(console[_0x517074(0x21e)](_0x517074(0x377)+_0x5ec092['site']),console[_0x517074(0x21e)]('Parent\x20segment:\x20'+_0x3dae6a));const _0x4a0a4b=await withSpinner(_0x517074(0x296)+_0x3dae6a+_0x517074(0x3a7),()=>_0xdc7a23['segment']['resolveParentId'](_0x3dae6a),{'verbose':_0x5ec092[_0x517074(0x207)]}),_0x4deb8f=_0x4a0a4b[_0x517074(0x3e3)],_0x4eb946=await withSpinner(_0x517074(0x208)+_0x3dae6a+_0x517074(0x3a7),()=>_0xdc7a23[_0x517074(0x33f)]['getParentSQL'](_0x4deb8f),{'verbose':_0x5ec092[_0x517074(0x207)]}),_0x1114d5=_0x4eb946['data'];return _0x5ec092[_0x517074(0x215)]===_0x517074(0x2cd)||_0x5ec092[_0x517074(0x215)]==='jsonl'?await handleSDKOutput([{'sql':_0x1114d5}],_0x5ec092):console[_0x517074(0x220)](_0x1114d5),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']='segment:parent:show';['description']=a31_0x461edb(0x294);async[a31_0x461edb(0x1f4)](_0x358e3a){const _0xe7236c=a31_0x461edb,{options:_0x1da89e,args:_0xe503f2,tdx:_0xbc9f4c}=_0x358e3a,_0x305eba=_0xe503f2[0x0]||_0x1da89e[_0xe7236c(0x2f7)];if(!_0x305eba)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0xe7236c(0x23e)),0x1;_0x1da89e[_0xe7236c(0x207)]&&(console[_0xe7236c(0x21e)](_0xe7236c(0x377)+_0x1da89e[_0xe7236c(0x2ba)]),console[_0xe7236c(0x21e)](_0xe7236c(0x3e7)+_0x305eba));const _0x493351=await withSpinner(_0xe7236c(0x296)+_0x305eba+_0xe7236c(0x3a7),()=>_0xbc9f4c[_0xe7236c(0x33f)][_0xe7236c(0x398)](_0x305eba),{'verbose':_0x1da89e[_0xe7236c(0x207)]}),_0x5f5405=_0x493351[_0xe7236c(0x3e3)],_0xd1773b=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x305eba+'\x27...',()=>_0xbc9f4c[_0xe7236c(0x33f)]['getParentSQL'](_0x5f5405),{'verbose':_0x1da89e[_0xe7236c(0x207)]});let _0x28070f=_0xd1773b[_0xe7236c(0x3e3)];const _0x3dd498=resolveLimit(_0x1da89e['limit'],DEFAULT_DISPLAY_LIMIT),_0x17023c=/\bLIMIT\s+\d+/i[_0xe7236c(0x280)](_0x28070f);!_0x17023c&&(_0x28070f=_0x28070f[_0xe7236c(0x378)]()[_0xe7236c(0x3fb)](/;+$/,''),_0x28070f='SELECT\x20*\x20FROM\x20(\x0a'+_0x28070f+_0xe7236c(0x34d)+_0x3dd498);_0x1da89e['verbose']&&console[_0xe7236c(0x21e)](_0xe7236c(0x32f)+_0x28070f);const _0x4e9215=await withProgressSpinner(_0xe7236c(0x227),async _0x1d9c7c=>{const _0x12d43f=_0xe7236c,_0x498268=await _0xbc9f4c[_0x12d43f(0x326)][_0x12d43f(0x1f4)](_0x28070f,{'catalog':'td','schema':_0x12d43f(0x24b),'onJobId':_0x472aff=>{const _0x4e2e0a=_0x12d43f;_0x1d9c7c[_0x4e2e0a(0x26a)](_0x472aff);}});return _0x498268;},{'verbose':_0x1da89e['verbose']}),_0x5d1649=_0x4e9215[_0xe7236c(0x3e3)],_0x1cd862=_0x5d1649[_0xe7236c(0x249)]?_0xe7236c(0x3cb)+_0x5d1649[_0xe7236c(0x249)]+']':'';return console[_0xe7236c(0x21e)](_0xe7236c(0x217)+_0x5d1649[_0xe7236c(0x24a)][_0xe7236c(0x3da)]['toLocaleString']()+_0xe7236c(0x221)+('in\x20'+formatElapsed(_0x5d1649[_0xe7236c(0x24a)]['elapsedTimeMillis'])+_0x1cd862)),await handleQueryOutput(_0x5d1649,_0x1da89e),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x347);[a31_0x461edb(0x395)]=a31_0x461edb(0x29a);async['execute'](_0x5ae6c6){const _0x3861b8=a31_0x461edb,{options:_0x2c2e82,args:_0xd00ec1,tdx:_0x3fac45}=_0x5ae6c6,_0x434780=_0xd00ec1[0x0],_0x9dc60f=await withSpinner(_0x434780?_0x3861b8(0x1fc)+_0x434780+_0x3861b8(0x3a7):_0x3861b8(0x3b2),()=>_0x3fac45['realtime']['list'](),{'verbose':_0x2c2e82[_0x3861b8(0x207)]});let _0x40d7f5=_0x9dc60f[_0x3861b8(0x3e3)][_0x3861b8(0x225)](_0x22c054=>_0x22c054[_0x3861b8(0x400)]);if(_0x434780){const _0x145fa3=_0x434780[_0x3861b8(0x3fb)](/[.+^${}()|[\]\\]/g,_0x3861b8(0x302))[_0x3861b8(0x3fb)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x406a8a=new RegExp('^'+_0x145fa3+'$','i');_0x40d7f5=_0x40d7f5[_0x3861b8(0x225)](_0xbdf53a=>_0x406a8a[_0x3861b8(0x280)](_0xbdf53a[_0x3861b8(0x3f3)]));}_0x40d7f5[_0x3861b8(0x2cb)]((_0x5c27ff,_0x5199a1)=>_0x5c27ff[_0x3861b8(0x3f3)][_0x3861b8(0x313)](_0x5199a1['name'])),console[_0x3861b8(0x21e)](_0x3861b8(0x214)+_0x40d7f5[_0x3861b8(0x248)]+_0x3861b8(0x222)+(_0x40d7f5['length']!==0x1?'s':''));const _0x4876a1=_0x2ee59b=>{const _0x14aa08=_0x3861b8;return getConsoleNextUrl(_0x2c2e82[_0x14aa08(0x2ba)],'/app/dw/parentSegments/'+_0x2ee59b);};if(_0x2c2e82[_0x3861b8(0x215)]===_0x3861b8(0x2cd)||_0x2c2e82[_0x3861b8(0x215)]==='jsonl'){const _0x28b7ee=_0x40d7f5[_0x3861b8(0x3cf)](_0x5a36f7=>({..._0x5a36f7,'url':_0x4876a1(_0x5a36f7['id'])}));await handleSDKOutput(_0x28b7ee,_0x2c2e82);}else{if(_0x40d7f5[_0x3861b8(0x248)]===0x0)console[_0x3861b8(0x220)](_0x3861b8(0x33a));else for(const _0x316547 of _0x40d7f5){const _0x3079b9=_0x316547[_0x3861b8(0x3ed)]?a31_0x4004bd[_0x3861b8(0x32a)]('\x20('+formatRows(_0x316547[_0x3861b8(0x3ed)])+')'):'',_0x54fb81=hyperlink(_0x316547[_0x3861b8(0x3f3)],_0x4876a1(_0x316547['id']));console[_0x3861b8(0x220)]('⚡\x20'+_0x54fb81+_0x3079b9);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x461edb(0x3f3)]='ps:rt:validate';['description']=a31_0x461edb(0x3a2);async[a31_0x461edb(0x1f4)](_0x24a39c){const _0x441a47=a31_0x461edb,{options:_0x4e3e61,args:_0x525441,tdx:_0xbc0b6c}=_0x24a39c,_0x25cfe7=_0x525441[0x0]||_0x4e3e61['parentSegment'];if(!_0x25cfe7)return showParentSegmentNotSetError(_0x441a47(0x258)+_0x441a47(0x336)),0x1;const _0x19c256=resolveYamlFile(_0x25cfe7);if(!existsSync(_0x19c256))return showFileNotFoundError(_0x19c256,_0x25cfe7),0x1;let _0x5cb5e9;try{_0x5cb5e9=readFileSync(_0x19c256,_0x441a47(0x2c4));}catch(_0xcff7b8){const _0x8ee95c=_0xcff7b8 instanceof Error?_0xcff7b8['message']:String(_0xcff7b8);return console[_0x441a47(0x21e)](_0x441a47(0x36f)+_0x8ee95c),0x1;}const _0xe3c5bb=createCommandSpinner(a31_0x4004bd['dim'](_0x441a47(0x366)),{'verbose':_0x4e3e61[_0x441a47(0x207)]});_0xe3c5bb['start']();const _0x4ad0bf={'realtime':!![],'onProgress':_0x485b7a=>{const _0x4f21ea=_0x441a47;_0xe3c5bb[_0x4f21ea(0x264)]=formatProgressMessage(_0x485b7a);}};let _0x5b9487;try{_0x5b9487=await _0xbc0b6c[_0x441a47(0x33f)]['validateParentYaml'](_0x5cb5e9,_0x4ad0bf),_0xe3c5bb[_0x441a47(0x3c0)]();}catch(_0x5a1074){_0xe3c5bb[_0x441a47(0x3c0)]();throw _0x5a1074;}console[_0x441a47(0x21e)]('\x0a'+a31_0x4004bd[_0x441a47(0x316)](_0x441a47(0x330))+'\x20'+_0x5b9487[_0x441a47(0x3f3)]),console['error']('═'[_0x441a47(0x401)](0x3c)),displayRealtimeValidation(_0x5b9487),console[_0x441a47(0x21e)]('─'[_0x441a47(0x401)](0x3c));if(_0x5b9487[_0x441a47(0x28b)][_0x441a47(0x248)]>0x0){console[_0x441a47(0x21e)]('\x0a'+a31_0x4004bd[_0x441a47(0x328)](_0x441a47(0x301)));for(const _0x2eb575 of _0x5b9487[_0x441a47(0x28b)]){console[_0x441a47(0x21e)]('\x20\x20'+a31_0x4004bd[_0x441a47(0x328)]('•')+'\x20'+_0x2eb575);}}return _0x5b9487['allValid']&&console[_0x441a47(0x21e)]('\x0a'+a31_0x4004bd[_0x441a47(0x224)]('✔')+_0x441a47(0x35e)),_0x5b9487['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x2a8);[a31_0x461edb(0x395)]=a31_0x461edb(0x239);async[a31_0x461edb(0x1f4)](_0x221e0c){const _0x1cf9c4=a31_0x461edb,{options:_0x4d5553,args:_0x51cd38,tdx:_0x1edb7f}=_0x221e0c,_0x5c55cd=_0x51cd38[0x0]||_0x4d5553[_0x1cf9c4(0x2f7)];if(!_0x5c55cd)return showParentSegmentNotSetError(_0x1cf9c4(0x34e)+_0x1cf9c4(0x3e1)),0x1;_0x4d5553[_0x1cf9c4(0x207)]&&(console[_0x1cf9c4(0x21e)](_0x1cf9c4(0x377)+_0x4d5553['site']),console[_0x1cf9c4(0x21e)](_0x1cf9c4(0x3e7)+_0x5c55cd));const _0x3c6ab8=await withSpinner(_0x1cf9c4(0x296)+_0x5c55cd+_0x1cf9c4(0x3a7),()=>_0x1edb7f[_0x1cf9c4(0x33f)][_0x1cf9c4(0x398)](_0x5c55cd),{'verbose':_0x4d5553[_0x1cf9c4(0x207)]}),_0x5ea7ce=_0x3c6ab8[_0x1cf9c4(0x3e3)],_0x35e346=await withSpinner('Listing\x20RT\x20journeys\x20for\x20\x27'+_0x5c55cd+_0x1cf9c4(0x3a7),()=>_0x1edb7f[_0x1cf9c4(0x27a)][_0x1cf9c4(0x28c)](_0x5ea7ce),{'verbose':_0x4d5553['verbose']}),_0x168e3f=_0x35e346['data'];console[_0x1cf9c4(0x21e)](_0x1cf9c4(0x214)+_0x168e3f[_0x1cf9c4(0x248)]+'\x20RT\x20journey'+(_0x168e3f['length']!==0x1?'s':''));if(_0x4d5553[_0x1cf9c4(0x215)]===_0x1cf9c4(0x2cd)||_0x4d5553[_0x1cf9c4(0x215)]===_0x1cf9c4(0x37d))await handleSDKOutput(_0x168e3f,_0x4d5553);else{if(_0x168e3f['length']===0x0)console['log'](_0x1cf9c4(0x203));else for(const _0x183f8e of _0x168e3f){const _0x29b571=_0x183f8e[_0x1cf9c4(0x3bd)]===_0x1cf9c4(0x3b4)?'🚀':'📝',_0x5d3d5f=_0x183f8e[_0x1cf9c4(0x1f1)]?a31_0x4004bd[_0x1cf9c4(0x3c6)](_0x1cf9c4(0x381)):'',_0x3e44cb=a31_0x4004bd[_0x1cf9c4(0x32a)]('\x20('+_0x183f8e['stageCount']+'\x20stage'+(_0x183f8e[_0x1cf9c4(0x3d4)]!==0x1?'s':'')+')');console[_0x1cf9c4(0x220)](_0x29b571+'\x20'+_0x183f8e['name']+_0x5d3d5f+_0x3e44cb);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x2ed);[a31_0x461edb(0x395)]=a31_0x461edb(0x3d2);async[a31_0x461edb(0x1f4)](_0x1f2c6c){const _0x153e73=a31_0x461edb,{options:_0x11366e,args:_0x2487e8,tdx:_0x12476a}=_0x1f2c6c,_0x241739=_0x2487e8[0x0];if(!_0x241739)return console[_0x153e73(0x21e)](a31_0x4004bd['red'](_0x153e73(0x3be))),console[_0x153e73(0x21e)](_0x153e73(0x403)),console[_0x153e73(0x21e)](a31_0x4004bd[_0x153e73(0x32a)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x11366e[_0x153e73(0x207)]&&(console[_0x153e73(0x21e)](_0x153e73(0x377)+_0x11366e[_0x153e73(0x2ba)]),console[_0x153e73(0x21e)](_0x153e73(0x392)+_0x241739));const _0x52d3d1=await withSpinner(_0x153e73(0x2b5)+_0x241739+_0x153e73(0x3a7),()=>_0x12476a[_0x153e73(0x27a)][_0x153e73(0x3b1)](_0x241739),{'verbose':_0x11366e['verbose']}),_0x451b47=_0x52d3d1['data'];console['error'](_0x153e73(0x202)+_0x451b47[_0x153e73(0x3f3)]+'\x27');if(_0x11366e[_0x153e73(0x215)]===_0x153e73(0x2cd)||_0x11366e[_0x153e73(0x215)]===_0x153e73(0x37d))await handleSDKOutput([_0x451b47],_0x11366e);else{const _0xc95a6d=_0x451b47[_0x153e73(0x3bd)]===_0x153e73(0x3b4)?'🚀':'📝',_0x4ef765=_0x451b47[_0x153e73(0x1f1)]?a31_0x4004bd[_0x153e73(0x3c6)]('\x20(paused)'):'';console[_0x153e73(0x220)](_0xc95a6d+'\x20'+_0x451b47[_0x153e73(0x3f3)]+_0x4ef765);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x293);[a31_0x461edb(0x395)]=a31_0x461edb(0x2ef);async[a31_0x461edb(0x1f4)](_0x46dfc4){const _0x38e0c7=a31_0x461edb,{options:_0x2ee31b,args:_0x260080,tdx:_0x349391}=_0x46dfc4,_0x565c94=_0x260080[0x0];if(!_0x565c94)return console[_0x38e0c7(0x21e)](a31_0x4004bd[_0x38e0c7(0x328)](_0x38e0c7(0x3be))),console[_0x38e0c7(0x21e)](_0x38e0c7(0x32b)),console[_0x38e0c7(0x21e)](a31_0x4004bd['dim']('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x2ee31b[_0x38e0c7(0x207)]&&(console[_0x38e0c7(0x21e)](_0x38e0c7(0x377)+_0x2ee31b['site']),console[_0x38e0c7(0x21e)](_0x38e0c7(0x392)+_0x565c94));const _0x8c3e36=await withSpinner(_0x38e0c7(0x402)+_0x565c94+_0x38e0c7(0x3a7),()=>_0x349391['realtime']['resumeJourney'](_0x565c94),{'verbose':_0x2ee31b[_0x38e0c7(0x207)]}),_0x3016f=_0x8c3e36[_0x38e0c7(0x3e3)];console['error'](_0x38e0c7(0x3f4)+_0x3016f[_0x38e0c7(0x3f3)]+'\x27');if(_0x2ee31b[_0x38e0c7(0x215)]===_0x38e0c7(0x2cd)||_0x2ee31b[_0x38e0c7(0x215)]==='jsonl')await handleSDKOutput([_0x3016f],_0x2ee31b);else{const _0x1b4652=_0x3016f[_0x38e0c7(0x3bd)]===_0x38e0c7(0x3b4)?'🚀':'📝',_0x442e6a=_0x3016f['paused']?a31_0x4004bd[_0x38e0c7(0x3c6)](_0x38e0c7(0x381)):'';console[_0x38e0c7(0x220)](_0x1b4652+'\x20'+_0x3016f[_0x38e0c7(0x3f3)]+_0x442e6a);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']=a31_0x461edb(0x39c);['description']=a31_0x461edb(0x3d7);async['execute'](_0x278dc4){const _0x321fad=a31_0x461edb,{options:_0x66d5e7,args:_0x352f09,tdx:_0x3545b3}=_0x278dc4,_0x302ced=_0x352f09[0x0]||_0x66d5e7[_0x321fad(0x2f7)];if(!_0x302ced)return showParentSegmentNotSetError(_0x321fad(0x23f)+_0x321fad(0x2b8)),0x1;_0x66d5e7['verbose']&&(console[_0x321fad(0x21e)]('Site:\x20'+_0x66d5e7['site']),console[_0x321fad(0x21e)]('Parent\x20segment:\x20'+_0x302ced));const _0x2ac09e=await withSpinner(_0x321fad(0x296)+_0x302ced+_0x321fad(0x3a7),()=>_0x3545b3[_0x321fad(0x33f)][_0x321fad(0x398)](_0x302ced),{'verbose':_0x66d5e7[_0x321fad(0x207)]}),_0x1cdced=_0x2ac09e[_0x321fad(0x3e3)],_0x665330=await withSpinner(_0x321fad(0x216)+_0x302ced+_0x321fad(0x3a7),()=>_0x3545b3[_0x321fad(0x27a)][_0x321fad(0x3c5)](_0x1cdced),{'verbose':_0x66d5e7['verbose']}),_0x79eae8=_0x665330[_0x321fad(0x3e3)];return console[_0x321fad(0x21e)](_0x321fad(0x34f)),_0x66d5e7['format']===_0x321fad(0x2cd)||_0x66d5e7[_0x321fad(0x215)]===_0x321fad(0x37d)?await handleSDKOutput([_0x79eae8],_0x66d5e7):(console[_0x321fad(0x220)](_0x321fad(0x348)+_0x79eae8['id']),console[_0x321fad(0x220)](_0x321fad(0x28a)+_0x79eae8[_0x321fad(0x2d8)]),console[_0x321fad(0x220)]('identifier:\x20'+_0x79eae8[_0x321fad(0x29b)]),console['log'](_0x321fad(0x321)+_0x79eae8[_0x321fad(0x247)]),console['log'](_0x321fad(0x339)+_0x79eae8[_0x321fad(0x317)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{['name']='ps:pz:service:list';['description']=a31_0x461edb(0x3c4);async['execute'](_0x20b8ad){const _0x23c166=a31_0x461edb,{options:_0x7de3f4,args:_0x23aa4a,tdx:_0x42cbd9}=_0x20b8ad,_0x48edd2=_0x23aa4a[0x0]||_0x7de3f4[_0x23c166(0x2f7)];if(!_0x48edd2)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+_0x23c166(0x205)),0x1;const _0x460269=await withSpinner(_0x23c166(0x296)+_0x48edd2+'\x27...',()=>_0x42cbd9[_0x23c166(0x33f)][_0x23c166(0x398)](_0x48edd2),{'verbose':_0x7de3f4[_0x23c166(0x207)]}),_0x2c974e=_0x460269[_0x23c166(0x3e3)],_0x5659f7=await withSpinner(_0x23c166(0x3c7)+_0x48edd2+_0x23c166(0x3a7),()=>_0x42cbd9[_0x23c166(0x399)][_0x23c166(0x290)](_0x2c974e),{'verbose':_0x7de3f4[_0x23c166(0x207)]}),_0x233564=_0x5659f7[_0x23c166(0x3e3)];console[_0x23c166(0x21e)](_0x23c166(0x214)+_0x233564[_0x23c166(0x248)]+'\x20personalization\x20service'+(_0x233564['length']!==0x1?'s':''));if(_0x7de3f4[_0x23c166(0x215)]==='json'||_0x7de3f4[_0x23c166(0x215)]==='jsonl')await handleSDKOutput(_0x233564,_0x7de3f4);else{if(_0x233564[_0x23c166(0x248)]===0x0)console[_0x23c166(0x220)]('No\x20personalization\x20services\x20configured'),console[_0x23c166(0x21e)](a31_0x4004bd[_0x23c166(0x20e)](_0x23c166(0x3d0)));else for(const _0x5f3d67 of _0x233564){console[_0x23c166(0x220)](a31_0x4004bd[_0x23c166(0x316)](_0x5f3d67[_0x23c166(0x3f3)])+'\x20'+a31_0x4004bd[_0x23c166(0x32a)](_0x23c166(0x39f)+_0x5f3d67['id']+')'));_0x5f3d67[_0x23c166(0x395)]&&console[_0x23c166(0x220)]('\x20\x20'+a31_0x4004bd[_0x23c166(0x32a)](_0x5f3d67[_0x23c166(0x395)]));if(_0x5f3d67[_0x23c166(0x3f1)]&&_0x5f3d67['tokens'][_0x23c166(0x248)]>0x0)for(const _0x162364 of _0x5f3d67['tokens']){const _0x22bcd2=_0x162364[_0x23c166(0x365)]?.[_0x23c166(0x248)]?_0x162364[_0x23c166(0x365)][_0x23c166(0x375)](',\x20'):_0x23c166(0x209);console[_0x23c166(0x220)]('\x20\x20'+a31_0x4004bd[_0x23c166(0x20e)](_0x23c166(0x2a4))+'\x20'+_0x162364[_0x23c166(0x3f3)]+'\x20'+a31_0x4004bd[_0x23c166(0x32a)]('(id:\x20'+_0x162364['id']+')')),console[_0x23c166(0x220)](_0x23c166(0x2aa)+a31_0x4004bd[_0x23c166(0x32a)](_0x23c166(0x27c))+'\x20'+_0x22bcd2);}else console[_0x23c166(0x220)]('\x20\x20'+a31_0x4004bd[_0x23c166(0x32a)](_0x23c166(0x2a5)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x461edb(0x3f3)]='ps:pz:service:create';['description']=a31_0x461edb(0x24f);async[a31_0x461edb(0x1f4)](_0x8ee65f){const _0x1d8616=a31_0x461edb,{options:_0x4945b8,args:_0x1e28ab,tdx:_0x101f9f}=_0x8ee65f,_0x438533=_0x4945b8,_0x283e78=_0x1e28ab[0x0],_0x1e0216=_0x1e28ab[0x1]||_0x4945b8[_0x1d8616(0x2f7)];if(!_0x283e78)return console[_0x1d8616(0x21e)]('Error:\x20Service\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]'),console[_0x1d8616(0x21e)](_0x1d8616(0x3ef)),0x1;if(!_0x1e0216)return showParentSegmentNotSetError(_0x1d8616(0x285)+_0x1d8616(0x3ef)),0x1;const _0x2e6d54=await withSpinner(_0x1d8616(0x296)+_0x1e0216+_0x1d8616(0x3a7),()=>_0x101f9f[_0x1d8616(0x33f)]['resolveParentId'](_0x1e0216),{'verbose':_0x4945b8[_0x1d8616(0x207)]}),_0x4ae2b0=_0x2e6d54[_0x1d8616(0x3e3)],_0x22157d={'name':_0x283e78,'description':_0x438533[_0x1d8616(0x395)],'public':_0x438533[_0x1d8616(0x324)]},_0x51ffa8=await withSpinner(_0x1d8616(0x1fb)+_0x283e78+_0x1d8616(0x3a7),()=>_0x101f9f[_0x1d8616(0x399)][_0x1d8616(0x2a2)](_0x4ae2b0,_0x22157d),{'verbose':_0x4945b8['verbose']}),_0x1ed231=_0x51ffa8['data'];return console['error'](_0x1d8616(0x331)+_0x1ed231['name']+'\x27\x20with\x20ID:\x20'+_0x1ed231['id']),await handleSDKOutput([_0x1ed231],_0x4945b8),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x3b0);[a31_0x461edb(0x395)]=a31_0x461edb(0x329);async['execute'](_0x46736e){const _0x2e6465=a31_0x461edb,{options:_0x43a00b,args:_0x24d715,tdx:_0x5ba6a5}=_0x46736e,_0x5b75a2=_0x24d715[0x0],_0xa8eded=_0x24d715[0x1]||_0x43a00b[_0x2e6465(0x2f7)];if(!_0x5b75a2)return console['error'](_0x2e6465(0x2f8)),console[_0x2e6465(0x21e)](_0x2e6465(0x287)),console['error'](_0x2e6465(0x2b0)),0x1;if(!_0xa8eded)return showParentSegmentNotSetError(_0x2e6465(0x387)+_0x2e6465(0x2b0)),0x1;const _0x51cd12=await withSpinner(_0x2e6465(0x296)+_0xa8eded+_0x2e6465(0x3a7),()=>_0x5ba6a5['segment']['resolveParentId'](_0xa8eded),{'verbose':_0x43a00b['verbose']}),_0x4db57f=_0x51cd12[_0x2e6465(0x3e3)],_0x48f519=await withSpinner(_0x2e6465(0x38b)+_0x5b75a2+'\x27...',()=>_0x5ba6a5[_0x2e6465(0x399)]['get'](_0x4db57f,_0x5b75a2),{'verbose':_0x43a00b[_0x2e6465(0x207)]}),_0x2fbd47=_0x48f519[_0x2e6465(0x3e3)];if(_0x43a00b[_0x2e6465(0x2cd)]||_0x43a00b[_0x2e6465(0x37d)])await handleSDKOutput([_0x2fbd47],_0x43a00b);else{console['log'](a31_0x4004bd[_0x2e6465(0x316)](_0x2fbd47[_0x2e6465(0x3f3)])+'\x20'+a31_0x4004bd[_0x2e6465(0x32a)](_0x2e6465(0x39f)+_0x2fbd47['id']+')'));_0x2fbd47['description']&&console['log']('\x20\x20'+a31_0x4004bd[_0x2e6465(0x32a)](_0x2fbd47['description']));console[_0x2e6465(0x220)]('\x20\x20'+a31_0x4004bd[_0x2e6465(0x20e)](_0x2e6465(0x201))+'\x20'+(_0x2fbd47[_0x2e6465(0x324)]?'yes':'no'));if(_0x2fbd47['tokens']&&_0x2fbd47[_0x2e6465(0x3f1)]['length']>0x0)for(const _0xb7a6a of _0x2fbd47['tokens']){const _0x30f57a=_0xb7a6a[_0x2e6465(0x365)]?.['length']?_0xb7a6a[_0x2e6465(0x365)][_0x2e6465(0x375)](',\x20'):_0x2e6465(0x209);console[_0x2e6465(0x220)]('\x20\x20'+a31_0x4004bd[_0x2e6465(0x20e)](_0x2e6465(0x2a4))+'\x20'+_0xb7a6a[_0x2e6465(0x3f3)]+'\x20'+a31_0x4004bd['dim'](_0x2e6465(0x39f)+_0xb7a6a['id']+')')),console[_0x2e6465(0x220)](_0x2e6465(0x2aa)+a31_0x4004bd[_0x2e6465(0x32a)](_0x2e6465(0x27c))+'\x20'+_0x30f57a);}else console[_0x2e6465(0x220)]('\x20\x20'+a31_0x4004bd[_0x2e6465(0x32a)]('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x3af);[a31_0x461edb(0x395)]=a31_0x461edb(0x1f3);async['execute'](_0x1c2cdf){const _0x50b613=a31_0x461edb,{options:_0x15473b,args:_0x4c6cda,tdx:_0xab82c4}=_0x1c2cdf,_0x9386de=_0x4c6cda[0x0],_0x2fb48b=_0x4c6cda[0x1]||_0x15473b[_0x50b613(0x2f7)];if(!_0x9386de)return console[_0x50b613(0x21e)](_0x50b613(0x2f8)),console['error'](_0x50b613(0x3bb)),console[_0x50b613(0x21e)](_0x50b613(0x369)),0x1;if(!_0x2fb48b)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x50b613(0x369)),0x1;const _0x3e6f97=await withSpinner(_0x50b613(0x296)+_0x2fb48b+_0x50b613(0x3a7),()=>_0xab82c4[_0x50b613(0x33f)]['resolveParentId'](_0x2fb48b),{'verbose':_0x15473b[_0x50b613(0x207)]}),_0x2c15a0=_0x3e6f97[_0x50b613(0x3e3)];return await withSpinner(_0x50b613(0x2b7)+_0x9386de+_0x50b613(0x3a7),()=>_0xab82c4[_0x50b613(0x399)]['delete'](_0x2c15a0,_0x9386de),{'verbose':_0x15473b[_0x50b613(0x207)]}),console[_0x50b613(0x21e)]('✔\x20Deleted\x20personalization\x20service\x20\x27'+_0x9386de+'\x27'),0x0;}}function a31_0x3f6f(){const _0x4d559f=['\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','Behaviors','site','\x20+\x20[','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','displayValidateResults','Available\x20attributes:','foreignKey','To\x20cancel:','\x0aError:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','segment:parent:sql','utf-8','\x20parent\x20segment','sections:','joinKey','Behavior:','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Output\x20Database:','sort','Delete\x20a\x20realtime\x20personalization','json','\x20=\x20','split','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20personalization','personalizationServices','Deleting\x20token\x20\x27','No\x20personalizations\x20configured','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20total','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','audienceId','displayRealtimeInfo','isDirectory','⚡\x20Enabled','darwin','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','displayBehaviorsStats','keys','\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}','segment:parent:update','last_page_viewed','Updated','listPersonalizations','xdg-open','✔\x20Updated\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','✔\x20Deleted\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','all','customerGroupFile','ps:rt:jn:pause','List\x20parent\x20segments','Resume\x20activations\x20in\x20an\x20RT\x20journey','session','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','payload:','sourceTableValid','displaySummary','includeSensitive','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','parentSegment','Error:\x20Service\x20ID\x20is\x20required','valid','2ApLfcq','/\x20→\x20','\x0aNo\x20sample\x20data\x20available','preview','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Error:\x20Token\x20\x27','Errors:','\x5c$&','addBehaviorsFile','YAML\x20file:\x20','folderId','Source:','/attempt/','entryCriteria','toLowerCase','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x27\x20is\x20already\x20up\x20to\x20date','\x20rows)','unref','%)\x20','Fetching\x20current\x20configuration\x20for\x20\x27','file','1589HOwrGS','\x20--interval\x20','localeCompare','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','number','bold','status','enabled','No\x20parent\x20segments\x20match\x20pattern:\x20','Show\x20a\x20specific\x20realtime\x20personalization','ps:pz:show','👥\x20','\x20\x20Database:\x20','behaviorsFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Attributes','eventKind:\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','true','public','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','query','Attribute:','red','Show\x20personalization\x20service\x20details','dim','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','segment:parent:list','page_view','.customers)','SQL\x20query:\x0a','RT\x202.0\x20Validate:','✔\x20Created\x20personalization\x20service\x20\x27','\x20\x20\x20\x20\x20\x20','pushParentYaml','Validating\x20configuration...','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','Apply\x20changes\x20to\x20\x27','personalization_services','status:\x20','No\x20RT-enabled\x20parent\x20segments\x20found','Join\x20on:','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','win32','updated:','segment','some','use','includeSensitive:','collectSchema','SELECT\x20*\x20FROM\x20','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Listing\x20parent\x20segments...','ps:rt:list','id:\x20','rowCount','tdx\x20ps\x20push\x20','ps:pz:service:token:delete','displayAttributesStats','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a','✔\x20Retrieved\x20RT\x20configuration\x20version','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','segment:parent:run','Error\x20parsing\x20YAML:\x20','attribute','✔\x20Created\x20token\x20\x27','interval','Options:\x0a','✔\x20Updated\x20personalization\x20service\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20Configuration\x20is\x20valid','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','✔\x20Updated\x20personalization\x20\x27','/\x20directory.\x0a','\x20--attribute\x20\x22<name>\x22','\x20RT\x20configuration\x20is\x20valid','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20\x20Tables:\x201\x20customers\x20+\x20','idStitching','payload','getBehaviorNames','parent_segments','allowedIps','Validating\x20RT\x20configuration...','behavior','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','segment:parent:preview','toFixed','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','.yml','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Error\x20reading\x20file:\x20','ignore','pullParentYaml','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','output','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','join','\x0a✔\x20Workflow\x20started','Site:\x20','trim','displayColumns','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Status:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','jsonl','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','value','-1d','\x20(paused)','\x27\x20with\x20ID:\x20','Finding\x20service\x20for\x20token...','formatSchemaJson','single','\x20field','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Overwrite\x20\x27','Personalization:','Fetching\x20personalization\x20service\x20\x27','\x20--attribute\x20\x22','\x22\x20}','sourceTableError','label','Validate:','\x0a\x20\x20\x20\x20]','RT\x20Journey\x20ID:\x20','keyEventId','\x20\x20Note:\x20','description','Name:\x20','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','resolveParentId','personalization','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','behaviors','ps:rt:configuration_versions','patchPersonalization','\x20\x202.\x20Run\x20','(id:\x20','Error:\x20File\x20not\x20found:\x20','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','null','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','To\x20view\x20sample\x20data:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x27...','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','Rows:','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','ps:pz:init','ps:pz:service:delete','ps:pz:service:show','pauseJourney','Listing\x20RT-enabled\x20parent\x20segments...','Master\x20Table','launched','\x0a⚠️\x20\x20Both\x20','\x20to\x20push\x20the\x20configuration','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','getParentFull','\x0aChanges\x20to\x20apply\x20to\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','attributes','state','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','stop','\x20behaviors','customerPercent','ps:pz:patch','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','getCurrentConfigVersion','yellow','Listing\x20personalization\x20services\x20for\x20\x27','/\x20directories\x20exist.','\x20kill','✔\x20No\x20changes\x20-\x20\x27','\x20[Job\x20ID:\x20','3121490dOQlLZ','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','ps:pz:list','map','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','addAttributesFile','Pause\x20activations\x20in\x20an\x20RT\x20journey','createParent','stageCount','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20No\x20sample\x20data\x20available','Get\x20current\x20RT\x20configuration\x20version\x20status','string','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','processedRows','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Fetching\x20behavior\x20list...','Customers:','⚡\x20Not\x20enabled','\x27\x20and\x20run\x20workflow?','Next\x20steps:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment','/app/workflows/','data','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','columns','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Parent\x20segment:\x20','keyEventCriteria','workflowAttemptId','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','scheduleOption','\x0a\x20\x20\x20\x20}','population','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','tokens','matchedCount','name','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','segment:parent:validate','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x22,\x20\x22type\x22:\x20\x22','\x27\x20is\x20up\x20to\x20date','replace','ps:pz:create','Creating\x20token\x20\x27','column_type','Creating','realtime_enabled','repeat','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','allValid','previewParentYaml','tdx\x20ps\x20preview\x20','table','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','Create\x20parent\x20segment\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','495241TePtUt','paused','\x20\x20\x20\x20-\x20','Delete\x20a\x20personalization\x20service','execute','15816qbhAYC','segment:parent:desc','Session:','customers','run','primaryKey','Creating\x20personalization\x20service\x20\x27','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','sections','createdAt','9186iqjmaU','platform','public:','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','No\x20RT\x20journeys\x20found','19340zZizPK','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','ps:pz:service:update','verbose','Fetching\x20SQL\x20for\x20\x27','any','dirname','column_name','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','displaySampleData','cyan','column','scheduleType','Show\x20parent\x20segment\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20\x20Columns:\x20','✔\x20Found\x20','format','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','147EHTFGd','Aborted.','1894845SOmapl','workflowSessionId','Error:\x20Personalization\x20ID\x20is\x20required','\x0aUsage:\x20tdx\x20ps\x20preview\x20','error','Found\x20YAML\x20file:\x20','log','\x20rows\x20','\x20RT-enabled\x20parent\x20segment','created:','green','filter','apply','Executing\x20parent\x20segment\x20query...','schemaValid','\x20tdx\x20wf\x20attempt\x20','Creating\x20personalization\x20\x27','segment:parent:create','indexOf','td_client_id','Schema\x20saved\x20to\x20','<database>.<table>','My\x20Service','Updating','\x20is\x20already\x20up\x20to\x20date','\x0aChanges\x20to\x20\x27','Fetching\x20parent\x20segment\x20\x27','deletePersonalization','\x20\x201.\x20Edit\x20','ps:pz:service:token:create','Table:\x20','List\x20RT\x20journeys','/app/dw/parentSegments/','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','displayPreviewHints','Updating\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Getting\x20personalization\x20\x27','9182206SOoVbg','\x20parent\x20segment\x20\x27','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','No\x20parent\x20segments\x20found','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','eventKind','length','jobId','stats','information_schema','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','totalEvents','\x0aNew\x20parent\x20segment\x20\x27','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','stitchingKeys','Deleting\x20personalization\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20configured','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Join:','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','Enriched:','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','Fetching\x20customers\x20schema...','patch','Error:','\x20Context\x20set:\x20','customersWithEvents','addAttributes','\x27\x20(id:\x20','updateParent','segment:parent:view','validateParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','text','message','parent_segment','\x20service','\x20\x20\x20','database','setJobId','entryCriteria:','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Events:','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','✔\x20Renamed\x20directory\x20to\x20','Listing\x20personalizations\x20for\x20\x27','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','yes','enriched','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20--behavior\x20\x22<name>\x22','Update\x20a\x20realtime\x20personalization\x20entity','\x20Opening\x20','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','/{name}.yml\x0a','realtime','match','allowed\x20IPs:','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment','sampleData','test','Create\x20a\x20realtime\x20personalization\x20entity','getOutputDatabaseName','start','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','master','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','coveragePercent','\x20service(s)\x20configured','audienceId:\x20','errors','listJourneys','parentFolder','listFields','Available\x20behaviors:','list','user_id','customerGroup','ps:rt:jn:resume','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','1683iMMVgj','Resolving\x20parent\x20segment\x20\x27','Pattern:\x20','\x20to\x20configure\x20your\x20personalization\x20service','Error:\x20--name\x20is\x20required','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','identifier','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','segment:parent:pull','schemaError','reduce','Error:\x20Token\x20name\x20is\x20required','getParentSQL','create','segment:parent:fields','token:','no\x20tokens\x20configured','Options\x20(one\x20required):\x0a','Analyzing\x20changes...','ps:rt:jn:list','displayPreviewResults','\x20\x20\x20\x20','timezone','folder-segment','relationships','type','Master\x20+\x20Attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','FINISHED','✔\x20Created\x20parent\x20segment\x20\x27','Attributes:','listParents','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','web','Deleting\x20personalization\x20service\x20\x27'];a31_0x3f6f=function(){return _0x4d559f;};return a31_0x3f6f();}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x206);['description']='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x461edb(0x1f4)](_0x2b66c7){const _0x28aa40=a31_0x461edb,{options:_0x1a942c,args:_0x225fb4,tdx:_0x27dcab}=_0x2b66c7,_0x2c6edf=_0x1a942c,_0x8f214d=_0x225fb4[0x0],_0x46fc5c=_0x225fb4[0x1]||_0x1a942c['parentSegment'];if(!_0x8f214d)return console[_0x28aa40(0x21e)](_0x28aa40(0x2f8)),console['error'](_0x28aa40(0x2dd)),console[_0x28aa40(0x21e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x2c6edf[_0x28aa40(0x3f3)])return console[_0x28aa40(0x21e)](_0x28aa40(0x299)),console[_0x28aa40(0x21e)](_0x28aa40(0x2dd)),0x1;if(!_0x46fc5c)return showParentSegmentNotSetError(_0x28aa40(0x314)+_0x28aa40(0x31f)),0x1;const _0x582778=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x46fc5c+_0x28aa40(0x3a7),()=>_0x27dcab['segment'][_0x28aa40(0x398)](_0x46fc5c),{'verbose':_0x1a942c['verbose']}),_0x857818=_0x582778['data'],_0x543d55={'name':_0x2c6edf[_0x28aa40(0x3f3)]};_0x2c6edf['description']!==undefined&&(_0x543d55[_0x28aa40(0x395)]=_0x2c6edf[_0x28aa40(0x395)]);const _0x26d090=await withSpinner('Updating\x20personalization\x20service\x20\x27'+_0x8f214d+_0x28aa40(0x3a7),()=>_0x27dcab[_0x28aa40(0x399)][_0x28aa40(0x25a)](_0x857818,_0x8f214d,_0x543d55),{'verbose':_0x1a942c['verbose']}),_0x58b988=_0x26d090[_0x28aa40(0x3e3)];return console[_0x28aa40(0x21e)](_0x28aa40(0x357)+_0x58b988[_0x28aa40(0x3f3)]+'\x27'),await handleSDKOutput([_0x58b988],_0x1a942c),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']=a31_0x461edb(0x237);[a31_0x461edb(0x395)]=a31_0x461edb(0x26c);async[a31_0x461edb(0x1f4)](_0x4f0309){const _0x14c338=a31_0x461edb,{options:_0x108429,args:_0x12ff74,tdx:_0x3486a7}=_0x4f0309,_0x92345d=_0x108429,_0x1333eb=_0x12ff74[0x0],_0x45c8a7=_0x12ff74[0x1],_0x110f83=_0x12ff74[0x2]||_0x108429[_0x14c338(0x2f7)];if(!_0x1333eb)return console[_0x14c338(0x21e)](_0x14c338(0x2a0)),console[_0x14c338(0x21e)](_0x14c338(0x2e8)),console[_0x14c338(0x21e)](_0x14c338(0x325)),0x1;if(!_0x45c8a7)return console['error'](_0x14c338(0x2f8)),console[_0x14c338(0x21e)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x14c338(0x21e)](_0x14c338(0x325)),0x1;if(!_0x110f83)return showParentSegmentNotSetError(_0x14c338(0x29c)+_0x14c338(0x325)),0x1;const _0x59a5ed=await withSpinner(_0x14c338(0x296)+_0x110f83+_0x14c338(0x3a7),()=>_0x3486a7['segment'][_0x14c338(0x398)](_0x110f83),{'verbose':_0x108429[_0x14c338(0x207)]}),_0x55b8cc=_0x59a5ed[_0x14c338(0x3e3)],_0x397f7e={'name':_0x1333eb};_0x92345d[_0x14c338(0x365)]&&(_0x397f7e[_0x14c338(0x365)]=_0x92345d[_0x14c338(0x365)][_0x14c338(0x2cf)](',')[_0x14c338(0x3cf)](_0x26aba1=>_0x26aba1[_0x14c338(0x378)]()));_0x92345d[_0x14c338(0x395)]&&(_0x397f7e[_0x14c338(0x395)]=_0x92345d[_0x14c338(0x395)]);const _0x26c5b6=await withSpinner(_0x14c338(0x3fd)+_0x1333eb+'\x27\x20for\x20service\x20\x27'+_0x45c8a7+_0x14c338(0x3a7),()=>_0x3486a7['personalization']['createToken'](_0x55b8cc,_0x45c8a7,_0x397f7e),{'verbose':_0x108429['verbose']}),_0x5b04d0=_0x26c5b6['data'];return console[_0x14c338(0x21e)](_0x14c338(0x354)+_0x5b04d0[_0x14c338(0x3f3)]+_0x14c338(0x382)+_0x5b04d0['id']),_0x5b04d0[_0x14c338(0x37f)]&&(console['error'](a31_0x4004bd[_0x14c338(0x3c6)](_0x14c338(0x3a9))),console['error'](a31_0x4004bd['cyan'](_0x5b04d0[_0x14c338(0x37f)])),console[_0x14c338(0x21e)]('')),await handleSDKOutput([_0x5b04d0],_0x108429),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x34b);[a31_0x461edb(0x395)]=a31_0x461edb(0x3ee);async[a31_0x461edb(0x1f4)](_0x487d9a){const _0x891607=a31_0x461edb,{options:_0x48a4b2,args:_0x4485df,tdx:_0x40fecf}=_0x487d9a,_0x15dc9e=_0x4485df[0x0],_0x55e5b4=_0x4485df[0x1]||_0x48a4b2[_0x891607(0x2f7)];if(!_0x15dc9e)return console[_0x891607(0x21e)]('Error:\x20Token\x20ID\x20is\x20required'),console[_0x891607(0x21e)](_0x891607(0x1ed)),console[_0x891607(0x21e)](_0x891607(0x2bc)),0x1;if(!_0x55e5b4)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a'+_0x891607(0x2bc)),0x1;const _0x42b4b5=await withSpinner(_0x891607(0x296)+_0x55e5b4+'\x27...',()=>_0x40fecf[_0x891607(0x33f)][_0x891607(0x398)](_0x55e5b4),{'verbose':_0x48a4b2['verbose']}),_0x154394=_0x42b4b5[_0x891607(0x3e3)],_0x465bab=await withSpinner(_0x891607(0x383),()=>_0x40fecf[_0x891607(0x399)][_0x891607(0x290)](_0x154394),{'verbose':_0x48a4b2[_0x891607(0x207)]}),_0x2c23b4=_0x465bab[_0x891607(0x3e3)];let _0x3b97dd;for(const _0xce45be of _0x2c23b4){if(_0xce45be['tokens']?.[_0x891607(0x340)](_0x70dfeb=>_0x70dfeb['id']===_0x15dc9e)){_0x3b97dd=_0xce45be['id'];break;}}if(!_0x3b97dd)return console[_0x891607(0x21e)](_0x891607(0x300)+_0x15dc9e+'\x27\x20not\x20found\x20in\x20any\x20personalization\x20service'),0x1;const _0x372e2d=await withSpinner(_0x891607(0x2d3)+_0x15dc9e+_0x891607(0x3a7),()=>_0x40fecf[_0x891607(0x399)]['deleteToken'](_0x154394,_0x3b97dd,_0x15dc9e),{'verbose':_0x48a4b2[_0x891607(0x207)]}),_0x2ce878=_0x372e2d[_0x891607(0x3e3)];return console[_0x891607(0x21e)]('✔\x20Deleted\x20token\x20\x27'+(_0x2ce878[_0x891607(0x3f3)]||_0x15dc9e)+'\x27'),await handleSDKOutput([_0x2ce878],_0x48a4b2),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x3ce);['description']='List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment';async['execute'](_0x1a0174){const _0x3e6a2f=a31_0x461edb,{options:_0xb704b1,args:_0x5b248e,tdx:_0x528686}=_0x1a0174,_0x421298=_0x5b248e[0x0]||_0xb704b1[_0x3e6a2f(0x2f7)];if(!_0x421298)return showParentSegmentNotSetError(_0x3e6a2f(0x246)+_0x3e6a2f(0x27e)),0x1;const _0x2909e5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x421298+_0x3e6a2f(0x3a7),()=>_0x528686[_0x3e6a2f(0x33f)][_0x3e6a2f(0x398)](_0x421298),{'verbose':_0xb704b1['verbose']}),_0x3c1cae=_0x2909e5['data'],_0x49c0c5=await withSpinner(_0x3e6a2f(0x270)+_0x421298+'\x27...',()=>_0x528686['personalization'][_0x3e6a2f(0x2e5)](_0x3c1cae),{'verbose':_0xb704b1[_0x3e6a2f(0x207)]}),_0x1b4bd8=_0x49c0c5['data'];console['error'](_0x3e6a2f(0x214)+_0x1b4bd8[_0x3e6a2f(0x248)]+_0x3e6a2f(0x2d1)+(_0x1b4bd8['length']!==0x1?'s':''));if(_0xb704b1[_0x3e6a2f(0x215)]===_0x3e6a2f(0x2cd)||_0xb704b1[_0x3e6a2f(0x215)]===_0x3e6a2f(0x37d))await handleSDKOutput(_0x1b4bd8,_0xb704b1);else{if(_0x1b4bd8[_0x3e6a2f(0x248)]===0x0)console[_0x3e6a2f(0x220)](_0x3e6a2f(0x2d4));else for(const _0x591eea of _0x1b4bd8){console[_0x3e6a2f(0x220)](a31_0x4004bd[_0x3e6a2f(0x316)](_0x591eea[_0x3e6a2f(0x3f3)])+'\x20'+a31_0x4004bd[_0x3e6a2f(0x32a)](_0x3e6a2f(0x39f)+_0x591eea['id']+')'));_0x591eea[_0x3e6a2f(0x395)]&&console[_0x3e6a2f(0x220)]('\x20\x20'+a31_0x4004bd['dim'](_0x591eea['description']));const _0x5dae47=_0x591eea[_0x3e6a2f(0x1fd)]?.[_0x3e6a2f(0x248)]||0x0;console[_0x3e6a2f(0x220)]('\x20\x20'+a31_0x4004bd[_0x3e6a2f(0x20e)](_0x3e6a2f(0x2c6))+'\x20'+_0x5dae47);if(_0x591eea['sections']&&_0x591eea[_0x3e6a2f(0x1fd)][_0x3e6a2f(0x248)]>0x0)for(const _0x43a89c of _0x591eea['sections']){console['log'](_0x3e6a2f(0x1f2)+_0x43a89c[_0x3e6a2f(0x3f3)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x31b);[a31_0x461edb(0x395)]=a31_0x461edb(0x31a);async['execute'](_0x1f18e6){const _0x36f2b8=a31_0x461edb,{options:_0x14057d,args:_0x2c0c39,tdx:_0x1816e5}=_0x1f18e6,_0x144ff2=_0x2c0c39[0x0];if(!_0x144ff2)return console['error'](_0x36f2b8(0x21c)),console[_0x36f2b8(0x21e)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x4e1a87=await withSpinner(_0x36f2b8(0x241)+_0x144ff2+_0x36f2b8(0x3a7),()=>_0x1816e5[_0x36f2b8(0x399)]['getPersonalization'](_0x144ff2),{'verbose':_0x14057d[_0x36f2b8(0x207)]}),_0x6f36d4=_0x4e1a87[_0x36f2b8(0x3e3)];console['error']('✔\x20Found\x20personalization\x20\x27'+_0x6f36d4[_0x36f2b8(0x3f3)]+'\x27');if(_0x14057d[_0x36f2b8(0x215)]===_0x36f2b8(0x2cd)||_0x14057d[_0x36f2b8(0x215)]===_0x36f2b8(0x37d))await handleSDKOutput([_0x6f36d4],_0x14057d);else{console['log'](a31_0x4004bd['bold'](_0x6f36d4[_0x36f2b8(0x3f3)])+'\x20'+a31_0x4004bd[_0x36f2b8(0x32a)](_0x36f2b8(0x39f)+_0x6f36d4['id']+')'));_0x6f36d4[_0x36f2b8(0x395)]&&console[_0x36f2b8(0x220)]('\x20\x20'+a31_0x4004bd[_0x36f2b8(0x32a)](_0x6f36d4['description']));_0x6f36d4[_0x36f2b8(0x2d8)]&&console[_0x36f2b8(0x220)]('\x20\x20'+a31_0x4004bd['cyan']('audienceId:')+'\x20'+_0x6f36d4[_0x36f2b8(0x2d8)]);console[_0x36f2b8(0x220)]('\x20\x20'+a31_0x4004bd[_0x36f2b8(0x20e)](_0x36f2b8(0x223))+'\x20'+_0x6f36d4[_0x36f2b8(0x1fe)]),console[_0x36f2b8(0x220)]('\x20\x20'+a31_0x4004bd[_0x36f2b8(0x20e)](_0x36f2b8(0x33e))+'\x20'+_0x6f36d4['updatedAt']);const _0x43cc3b=_0x6f36d4[_0x36f2b8(0x1fd)]?.['length']||0x0;console[_0x36f2b8(0x220)]('\x20\x20'+a31_0x4004bd[_0x36f2b8(0x20e)]('sections:')+'\x20'+_0x43cc3b);if(_0x6f36d4[_0x36f2b8(0x1fd)]&&_0x6f36d4[_0x36f2b8(0x1fd)]['length']>0x0)for(const _0x5e624e of _0x6f36d4[_0x36f2b8(0x1fd)]){console[_0x36f2b8(0x220)](_0x36f2b8(0x2aa)+a31_0x4004bd[_0x36f2b8(0x316)](_0x5e624e['name'])+'\x20'+a31_0x4004bd['dim'](_0x36f2b8(0x39f)+_0x5e624e['id']+')')),_0x5e624e[_0x36f2b8(0x308)]&&(console[_0x36f2b8(0x220)]('\x20\x20\x20\x20\x20\x20'+a31_0x4004bd[_0x36f2b8(0x20e)](_0x36f2b8(0x26b))+'\x20'+_0x5e624e['entryCriteria']['name']),_0x5e624e[_0x36f2b8(0x308)][_0x36f2b8(0x3e8)]?.[_0x36f2b8(0x393)]&&console['log']('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x4004bd[_0x36f2b8(0x20e)]('keyEventId:')+'\x20'+_0x5e624e['entryCriteria']['keyEventCriteria']['keyEventId'])),_0x5e624e['payload']&&console['log']('\x20\x20\x20\x20\x20\x20'+a31_0x4004bd[_0x36f2b8(0x20e)](_0x36f2b8(0x2f2))+'\x20'+JSON['stringify'](_0x5e624e[_0x36f2b8(0x362)])),_0x5e624e[_0x36f2b8(0x2f5)]&&console['log'](_0x36f2b8(0x332)+a31_0x4004bd['cyan'](_0x36f2b8(0x342))+'\x20true');}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x461edb(0x3f3)]='ps:pz:delete';[a31_0x461edb(0x395)]=a31_0x461edb(0x2cc);async[a31_0x461edb(0x1f4)](_0x8a6011){const _0x1a8ff1=a31_0x461edb,{options:_0x2573cd,args:_0x537727,tdx:_0x29a876}=_0x8a6011,_0x23c420=_0x537727[0x0];if(!_0x23c420)return console['error'](_0x1a8ff1(0x21c)),console[_0x1a8ff1(0x21e)](_0x1a8ff1(0x3ba)),0x1;return await withSpinner(_0x1a8ff1(0x251)+_0x23c420+_0x1a8ff1(0x3a7),()=>_0x29a876[_0x1a8ff1(0x399)][_0x1a8ff1(0x235)](_0x23c420),{'verbose':_0x2573cd['verbose']}),console['error'](_0x1a8ff1(0x2e9)+_0x23c420+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']=a31_0x461edb(0x3fc);[a31_0x461edb(0x395)]=a31_0x461edb(0x281);async['execute'](_0x4434fc){const _0x378d11=a31_0x461edb,{options:_0x3060aa,tdx:_0x2da644}=_0x4434fc,_0x317b11=_0x3060aa;let _0x3ca196;if(_0x317b11[_0x378d11(0x310)]){_0x3ca196=await loadJSON(_0x317b11[_0x378d11(0x310)],!![]);if(!_0x3ca196[_0x378d11(0x2ad)]?.[_0x378d11(0x28d)])return console['error']('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x378d11(0x21e)]('Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:'),console['error'](_0x378d11(0x2e1)),0x1;}else{if(!_0x317b11[_0x378d11(0x3f3)])return console[_0x378d11(0x21e)](_0x378d11(0x3b7)),console[_0x378d11(0x21e)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console['error'](_0x378d11(0x212)),0x1;if(_0x317b11[_0x378d11(0x395)]===undefined)return console[_0x378d11(0x21e)](_0x378d11(0x284)),console[_0x378d11(0x21e)](_0x378d11(0x278)),console[_0x378d11(0x21e)](_0x378d11(0x212)),0x1;if(_0x317b11[_0x378d11(0x305)]===undefined)return console[_0x378d11(0x21e)]('Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.'),console['error'](_0x378d11(0x2d7)),0x1;let _0x57f8c5=_0x317b11[_0x378d11(0x2d8)];if(!_0x57f8c5&&_0x3060aa[_0x378d11(0x2f7)]){const _0x5638a9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3060aa[_0x378d11(0x2f7)]+_0x378d11(0x3a7),()=>_0x2da644[_0x378d11(0x33f)][_0x378d11(0x398)](_0x3060aa['parentSegment']),{'verbose':_0x3060aa[_0x378d11(0x207)]});_0x57f8c5=_0x5638a9[_0x378d11(0x3e3)];}let _0x58bd5c;_0x317b11['sections']&&(_0x58bd5c=await loadJSON(_0x317b11[_0x378d11(0x1fd)],![]));const _0x17a684=_0x317b11[_0x378d11(0x305)]===_0x378d11(0x3a3)?null:{'id':_0x317b11[_0x378d11(0x305)],'type':_0x378d11(0x2ac)};_0x3ca196={'attributes':{'name':_0x317b11['name'],'description':_0x317b11['description']||null,..._0x57f8c5!==undefined&&{'audienceId':_0x57f8c5},..._0x58bd5c!==undefined&&{'sections':_0x58bd5c}},'relationships':{'parentFolder':{'data':_0x17a684}}};}const _0x22537a=await withSpinner(_0x378d11(0x22a)+(_0x3ca196[_0x378d11(0x3bc)]?.['name']??'')+_0x378d11(0x3a7),()=>_0x2da644['personalization']['createPersonalization'](_0x3ca196),{'verbose':_0x3060aa[_0x378d11(0x207)]}),_0x34b8b5=_0x22537a['data'];return console['error']('✔\x20Created\x20personalization\x20\x27'+_0x34b8b5[_0x378d11(0x3f3)]+_0x378d11(0x382)+_0x34b8b5['id']),await handleSDKOutput([_0x34b8b5],_0x3060aa),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x3c3);[a31_0x461edb(0x395)]=a31_0x461edb(0x276);async[a31_0x461edb(0x1f4)](_0x358e41){const _0x36671c=a31_0x461edb,{options:_0xb7709a,args:_0x5d9cf5}=_0x358e41,_0x341f9c=_0xb7709a,_0x2faa4c=_0x5d9cf5[0x0];if(!_0x2faa4c)return console[_0x36671c(0x21e)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x36671c(0x21e)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0x36671c(0x21e)](_0x36671c(0x3f0)),0x1;let _0x3ce648;if(_0x341f9c[_0x36671c(0x310)])_0x3ce648=await loadJSON(_0x341f9c[_0x36671c(0x310)],!![]);else{if(!_0x341f9c['name'])return console[_0x36671c(0x21e)](_0x36671c(0x3b7)),console[_0x36671c(0x21e)](_0x36671c(0x2de)),0x1;if(_0x341f9c[_0x36671c(0x395)]===undefined)return console['error'](_0x36671c(0x284)),console['error'](_0x36671c(0x2de)),0x1;let _0x42b59a;_0x341f9c[_0x36671c(0x1fd)]&&(_0x42b59a=await loadJSON(_0x341f9c[_0x36671c(0x1fd)],![])),_0x3ce648={'attributes':{'name':_0x341f9c[_0x36671c(0x3f3)],'description':_0x341f9c[_0x36671c(0x395)]||null,..._0x42b59a!==undefined&&{'sections':_0x42b59a}}};}const {tdx:_0x45ae95}=_0x358e41,_0x34b559=await withSpinner('Patching\x20personalization\x20\x27'+_0x2faa4c+_0x36671c(0x3a7),()=>_0x45ae95[_0x36671c(0x399)][_0x36671c(0x39d)](_0x2faa4c,_0x3ce648),{'verbose':_0xb7709a[_0x36671c(0x207)]}),_0x2df49e=_0x34b559[_0x36671c(0x3e3)];return console[_0x36671c(0x21e)](_0x36671c(0x35b)+_0x2df49e[_0x36671c(0x3f3)]+_0x36671c(0x25f)+_0x2df49e['id']+')'),await handleSDKOutput([_0x2df49e],_0xb7709a),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x461edb(0x3f3)]=a31_0x461edb(0x3ae);[a31_0x461edb(0x395)]=a31_0x461edb(0x372);async['execute'](_0x3b51d6){const _0x2e1233=a31_0x461edb,{options:_0x5580ef,args:_0x34190b}=_0x3b51d6,_0x36c6be=_0x34190b[0x0]||_0x5580ef[_0x2e1233(0x2f7)];if(!_0x36c6be)return showParentSegmentNotSetError(_0x2e1233(0x3cd)+_0x2e1233(0x2ea)),0x1;const _0x1945e2=resolveYamlFile(_0x36c6be);if(!existsSync(_0x1945e2))return showFileNotFoundError(_0x1945e2,_0x36c6be),0x1;let _0x361b5d;try{_0x361b5d=readFileSync(_0x1945e2,'utf-8');}catch(_0x3b7073){const _0x51f75b=_0x3b7073 instanceof Error?_0x3b7073[_0x2e1233(0x265)]:String(_0x3b7073);return console[_0x2e1233(0x21e)](_0x2e1233(0x36f)+_0x51f75b),0x1;}let _0x3391a5;try{_0x3391a5=parseDef(_0x361b5d);}catch(_0x1e8e57){const _0x1583c9=_0x1e8e57 instanceof Error?_0x1e8e57[_0x2e1233(0x265)]:String(_0x1e8e57);return console[_0x2e1233(0x21e)](a31_0x4004bd['red'](_0x2e1233(0x352)+_0x1583c9)),0x1;}if(_0x3391a5['personalization_services']&&_0x3391a5[_0x2e1233(0x338)][_0x2e1233(0x248)]>0x0)return console[_0x2e1233(0x21e)](a31_0x4004bd['yellow']('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0x1945e2)),console['error'](a31_0x4004bd[_0x2e1233(0x32a)](_0x2e1233(0x268)+_0x3391a5[_0x2e1233(0x338)][_0x2e1233(0x248)]+_0x2e1233(0x289))),0x1;!_0x3391a5[_0x2e1233(0x27a)]&&(_0x3391a5[_0x2e1233(0x27a)]={'events':[{'name':_0x2e1233(0x32d),'source_table':_0x2e1233(0x22f)}],'attributes':[{'name':_0x2e1233(0x2e3),'type':_0x2e1233(0x385)}],'id_stitching':{'primary_key':_0x3391a5[_0x2e1233(0x286)]['table']===_0x2e1233(0x1f8)?_0x2e1233(0x22d):_0x2e1233(0x291)}});_0x3391a5[_0x2e1233(0x338)]=[{'name':_0x2e1233(0x230),'description':'Personalization\x20service\x20description','trigger_event':_0x2e1233(0x32d),'sections':[{'name':'Default','criteria':_0x2e1233(0x323),'attributes':['last_page_viewed']}]}];const _0x2c47ce=serializeDef(_0x3391a5);return writeFileSync(_0x1945e2,_0x2c47ce,_0x2e1233(0x2c4)),console[_0x2e1233(0x21e)](a31_0x4004bd[_0x2e1233(0x224)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x4004bd[_0x2e1233(0x20e)](_0x1945e2)),(!_0x3391a5['realtime']||_0x361b5d[_0x2e1233(0x22c)]('realtime:')===-0x1)&&console['error'](a31_0x4004bd[_0x2e1233(0x224)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console['error']('\x0a'+a31_0x4004bd['dim'](_0x2e1233(0x3e0))),console[_0x2e1233(0x21e)](_0x2e1233(0x236)+_0x1945e2+_0x2e1233(0x298)),console['error'](_0x2e1233(0x39e)+a31_0x4004bd[_0x2e1233(0x32a)](_0x2e1233(0x34a)+_0x36c6be)+_0x2e1233(0x3b6)),0x0;}}
|
|
1
|
+
const a31_0x164fd9=a31_0x3973;(function(_0x4742f3,_0x2678ef){const _0x18f76a=a31_0x3973,_0x3093d1=_0x4742f3();while(!![]){try{const _0x4e6746=-parseInt(_0x18f76a(0x303))/0x1+parseInt(_0x18f76a(0x3c1))/0x2+-parseInt(_0x18f76a(0x373))/0x3*(parseInt(_0x18f76a(0x2a7))/0x4)+parseInt(_0x18f76a(0x3dd))/0x5+-parseInt(_0x18f76a(0x258))/0x6*(-parseInt(_0x18f76a(0x2a3))/0x7)+-parseInt(_0x18f76a(0x2a9))/0x8+-parseInt(_0x18f76a(0x3df))/0x9;if(_0x4e6746===_0x2678ef)break;else _0x3093d1['push'](_0x3093d1['shift']());}catch(_0x447a7a){_0x3093d1['push'](_0x3093d1['shift']());}}}(a31_0x3713,0x4c606));function a31_0x3973(_0x1dbed6,_0x41c585){_0x1dbed6=_0x1dbed6-0x1ce;const _0x37139d=a31_0x3713();let _0x397345=_0x37139d[_0x1dbed6];return _0x397345;}import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x1a2c9e from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x1c9df2 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x164fd9(0x382),LEGACY_PARENT_SEGMENT_DIR=a31_0x164fd9(0x262);function openBrowser(_0x1aa5e3){const _0x3b7e80=a31_0x164fd9,_0x4749d8=process['platform'],_0x26d10f=_0x4749d8==='darwin'?_0x3b7e80(0x1e5):_0x4749d8===_0x3b7e80(0x2f7)?_0x3b7e80(0x340):_0x3b7e80(0x2bc);spawn(_0x26d10f,[_0x1aa5e3],{'detached':!![],'stdio':_0x3b7e80(0x2e0)})[_0x3b7e80(0x1f9)]();}function migrateLegacyDirectory(){const _0x331236=a31_0x164fd9;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x454bd4=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x454bd4[_0x331236(0x35f)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x331236(0x392)](a31_0x1c9df2['yellow']('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x331236(0x1fe)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console['error'](a31_0x1c9df2[_0x331236(0x256)](_0x331236(0x275)+LEGACY_PARENT_SEGMENT_DIR+_0x331236(0x243))),![];console[_0x331236(0x392)](a31_0x1c9df2[_0x331236(0x216)](_0x331236(0x311)+LEGACY_PARENT_SEGMENT_DIR+_0x331236(0x215)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x331236(0x392)](a31_0x1c9df2['green'](_0x331236(0x1fd)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x52a69b){const _0x3b3d7=_0x52a69b instanceof Error?_0x52a69b[_0x331236(0x2bf)]:String(_0x52a69b);return console[_0x331236(0x392)](a31_0x1c9df2[_0x331236(0x338)](_0x331236(0x1e1)+_0x3b3d7+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x164fd9(0x274)](_0x342a1a){return migrateLegacyDirectory(),super['run'](_0x342a1a);}}function resolveYamlFile(_0x376478){const _0x2573c0=a31_0x164fd9;if(_0x376478[_0x2573c0(0x1fa)](_0x2573c0(0x30c))||_0x376478[_0x2573c0(0x1fa)](_0x2573c0(0x315)))return _0x376478;return a31_0x1a2c9e['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x376478)+_0x2573c0(0x30c));}function formatProgressMessage(_0x271b76){const _0x51bdbc=a31_0x164fd9,_0x531371=_0x271b76[_0x51bdbc(0x37b)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x531371){const [,_0x122b02,_0x41aa50,_0x50bf57='']=_0x531371;return a31_0x1c9df2['dim'](_0x122b02+':')+'\x20'+_0x41aa50+a31_0x1c9df2[_0x51bdbc(0x256)](_0x50bf57);}return a31_0x1c9df2[_0x51bdbc(0x256)](_0x271b76);}function showFileNotFoundError(_0x4052ff,_0x40ddf2){const _0x4332e1=a31_0x164fd9;console[_0x4332e1(0x392)](a31_0x1c9df2[_0x4332e1(0x338)](_0x4332e1(0x317)+_0x4052ff+'\x0a')),console[_0x4332e1(0x392)](a31_0x1c9df2[_0x4332e1(0x250)](_0x4332e1(0x33b)+_0x40ddf2+_0x4332e1(0x37d)));}function displayRealtimeValidation(_0x288903){const _0x44ab8e=a31_0x164fd9;if(!_0x288903[_0x44ab8e(0x21d)])return;const _0x4b5eab=_0x288903[_0x44ab8e(0x21d)],_0x48f827=_0x4b5eab['enabled']?a31_0x1c9df2[_0x44ab8e(0x31e)](_0x44ab8e(0x2a0)):a31_0x1c9df2[_0x44ab8e(0x216)](_0x44ab8e(0x205));console[_0x44ab8e(0x392)]('\x0a'+a31_0x1c9df2['dim'](_0x44ab8e(0x326))+'\x20'+_0x48f827);if(_0x4b5eab[_0x44ab8e(0x226)]&&_0x4b5eab[_0x44ab8e(0x226)][_0x44ab8e(0x2dc)]>0x0){console[_0x44ab8e(0x392)]('\x20\x20'+a31_0x1c9df2[_0x44ab8e(0x256)]('Events:')+'\x20'+_0x4b5eab[_0x44ab8e(0x226)][_0x44ab8e(0x2dc)]+_0x44ab8e(0x269));for(const _0xc30048 of _0x4b5eab[_0x44ab8e(0x226)]){const _0x35bdf0=_0xc30048[_0x44ab8e(0x2f5)]===![]?a31_0x1c9df2[_0x44ab8e(0x338)]('✘'):a31_0x1c9df2['green']('✔');console['error'](_0x44ab8e(0x3b1)+_0x35bdf0+'\x20'+_0xc30048[_0x44ab8e(0x219)]),_0xc30048[_0x44ab8e(0x3b9)]&&console[_0x44ab8e(0x392)](_0x44ab8e(0x208)+a31_0x1c9df2['red'](_0xc30048[_0x44ab8e(0x3b9)]));}}if(_0x4b5eab[_0x44ab8e(0x218)]&&_0x4b5eab[_0x44ab8e(0x218)][_0x44ab8e(0x2dc)]>0x0){console['error']('\x20\x20'+a31_0x1c9df2[_0x44ab8e(0x256)](_0x44ab8e(0x232))+'\x20'+_0x4b5eab[_0x44ab8e(0x218)][_0x44ab8e(0x2dc)]+_0x44ab8e(0x269));for(const _0x277f0b of _0x4b5eab[_0x44ab8e(0x218)]){const _0xf106e0=_0x277f0b[_0x44ab8e(0x24a)]?a31_0x1c9df2[_0x44ab8e(0x31e)]('✔'):a31_0x1c9df2[_0x44ab8e(0x338)]('✘');console[_0x44ab8e(0x392)](_0x44ab8e(0x3b1)+_0xf106e0+'\x20'+_0x277f0b[_0x44ab8e(0x219)]+'\x20'+a31_0x1c9df2[_0x44ab8e(0x256)]('('+_0x277f0b[_0x44ab8e(0x22c)]+')'));}}if(_0x4b5eab[_0x44ab8e(0x37f)]){const _0x4fc68d=_0x4b5eab[_0x44ab8e(0x37f)][_0x44ab8e(0x39c)]?.[_0x44ab8e(0x2dc)]?_0x44ab8e(0x32b)+_0x4b5eab[_0x44ab8e(0x37f)][_0x44ab8e(0x39c)][_0x44ab8e(0x35e)](',\x20')+']':'';console['error']('\x20\x20'+a31_0x1c9df2['dim'](_0x44ab8e(0x266))+'\x20'+_0x4b5eab[_0x44ab8e(0x37f)][_0x44ab8e(0x20c)]+_0x4fc68d);}if(_0x4b5eab[_0x44ab8e(0x318)]&&_0x4b5eab[_0x44ab8e(0x318)][_0x44ab8e(0x2dc)]>0x0){console['error']('\x20\x20'+a31_0x1c9df2['dim']('Personalization:')+'\x20'+_0x4b5eab['personalizationServices'][_0x44ab8e(0x2dc)]+_0x44ab8e(0x342)+(_0x4b5eab[_0x44ab8e(0x318)][_0x44ab8e(0x2dc)]!==0x1?'s':''));for(const _0x922d5c of _0x4b5eab['personalizationServices']){console[_0x44ab8e(0x392)](_0x44ab8e(0x268)+_0x922d5c[_0x44ab8e(0x219)]);}}}function showParentSegmentNotSetError(_0x34d93d){const _0x796b06=a31_0x164fd9;console[_0x796b06(0x392)](a31_0x1c9df2[_0x796b06(0x216)](_0x796b06(0x1f8))),console['error'](_0x34d93d);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x1dd);['description']=a31_0x164fd9(0x38f);async[a31_0x164fd9(0x29d)](_0x502f8b){const _0x2aaa71=a31_0x164fd9,{options:_0x357a72,args:_0x3a1632,tdx:_0x35f45e}=_0x502f8b,_0x2cc35d=_0x3a1632[0x0];_0x357a72[_0x2aaa71(0x3d7)]&&(console[_0x2aaa71(0x392)]('Site:\x20'+_0x357a72[_0x2aaa71(0x1df)]),_0x2cc35d&&console[_0x2aaa71(0x392)](_0x2aaa71(0x2be)+_0x2cc35d));const _0x1fac92=await withSpinner(_0x2cc35d?_0x2aaa71(0x3de)+_0x2cc35d+_0x2aaa71(0x3e1):_0x2aaa71(0x292),()=>_0x35f45e['segment'][_0x2aaa71(0x333)](),{'verbose':_0x357a72['verbose']});let _0x5126cf=_0x1fac92[_0x2aaa71(0x27d)];if(_0x2cc35d){const _0x4e95d8=_0x2cc35d[_0x2aaa71(0x395)](/[.+^${}()|[\]\\]/g,_0x2aaa71(0x344))[_0x2aaa71(0x395)](/\*/g,'.*')[_0x2aaa71(0x395)](/\?/g,'.'),_0x5e6ea0=new RegExp('^'+_0x4e95d8+'$','i');_0x5126cf=_0x5126cf['filter'](_0x227065=>_0x5e6ea0['test'](_0x227065[_0x2aaa71(0x218)]['name']));}_0x5126cf['sort']((_0x2c9811,_0x2a2030)=>_0x2c9811[_0x2aaa71(0x218)][_0x2aaa71(0x219)]['localeCompare'](_0x2a2030[_0x2aaa71(0x218)][_0x2aaa71(0x219)])),console[_0x2aaa71(0x392)](_0x2aaa71(0x3dc)+_0x5126cf[_0x2aaa71(0x2dc)]+_0x2aaa71(0x398)+(_0x5126cf[_0x2aaa71(0x2dc)]!==0x1?'s':''));const _0x592ecd=_0x5d15b0=>{const _0x460978=_0x2aaa71;return getConsoleNextUrl(_0x357a72['site'],_0x460978(0x1f3)+_0x5d15b0);};if(_0x357a72[_0x2aaa71(0x30f)]===_0x2aaa71(0x3c4)||_0x357a72[_0x2aaa71(0x30f)]==='jsonl'){const _0x43c4fb=_0x5126cf[_0x2aaa71(0x280)](_0x255955=>({..._0x255955,'url':_0x592ecd(_0x255955['id'])}));await handleSDKOutput(_0x43c4fb,_0x357a72);}else{if(_0x5126cf[_0x2aaa71(0x2dc)]===0x0)_0x2cc35d?console[_0x2aaa71(0x300)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x2cc35d):console['log'](_0x2aaa71(0x314));else for(const _0x4fd77c of _0x5126cf){const _0x3c161d=_0x4fd77c[_0x2aaa71(0x218)][_0x2aaa71(0x34d)]?a31_0x1c9df2['dim']('\x20('+formatRows(_0x4fd77c[_0x2aaa71(0x218)]['population'])+')'):'',_0x1a385a=hyperlink(_0x4fd77c[_0x2aaa71(0x218)]['name'],_0x592ecd(_0x4fd77c['id']));console[_0x2aaa71(0x300)](_0x2aaa71(0x358)+_0x1a385a+_0x3c161d);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x164fd9(0x219)]='segment:parent:create';[a31_0x164fd9(0x323)]=a31_0x164fd9(0x3c5);async[a31_0x164fd9(0x29d)](_0x491608){const _0x549255=a31_0x164fd9,{options:_0x5ccbe1,args:_0xd55f6d,tdx:_0x35b07f}=_0x491608;console[_0x549255(0x392)](_0x549255(0x33a)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x549255(0x214));const _0x34d0d9=_0x5ccbe1;if(_0xd55f6d[_0x549255(0x2dc)]===0x0)return console['error'](a31_0x1c9df2['red'](_0x549255(0x2ae))),console[_0x549255(0x392)](_0x549255(0x313)),0x1;const _0x39bac1=_0xd55f6d[0x0];if(!_0x34d0d9[_0x549255(0x381)]||!_0x34d0d9[_0x549255(0x366)])return console[_0x549255(0x392)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x549255(0x392)](_0x549255(0x313)),0x1;_0x34d0d9[_0x549255(0x3d7)]&&(console['error'](_0x549255(0x290)+_0x34d0d9[_0x549255(0x1df)]),console[_0x549255(0x392)]('Name:\x20'+_0x39bac1),console['error'](_0x549255(0x3d0)+_0x34d0d9['database']),console[_0x549255(0x392)](_0x549255(0x35a)+_0x34d0d9['table']));const _0x5f2746=await loadJSONFromOptions(_0x34d0d9[_0x549255(0x218)],_0x34d0d9[_0x549255(0x36b)]),_0x5f0f8f=await loadJSONFromOptions(_0x34d0d9['behaviors'],_0x34d0d9[_0x549255(0x201)]),_0x6b3f68=await loadJSONFromOptions(_0x34d0d9['customerGroup'],_0x34d0d9[_0x549255(0x3e9)]),_0xe16b={'name':_0x39bac1,'description':_0x34d0d9['description'],'scheduleType':_0x34d0d9[_0x549255(0x1d5)],'scheduleOption':_0x34d0d9['scheduleOption'],'timezone':_0x34d0d9[_0x549255(0x39e)],'master':{'parentDatabaseName':_0x34d0d9[_0x549255(0x381)],'parentTableName':_0x34d0d9[_0x549255(0x366)]},'attributes':_0x5f2746,'behaviors':_0x5f0f8f,'customerGroup':_0x6b3f68},_0x42064c=await withSpinner(_0x549255(0x2eb)+_0x39bac1+_0x549255(0x3e1),()=>_0x35b07f['segment'][_0x549255(0x36a)](_0xe16b),{'verbose':_0x5ccbe1['verbose']}),_0x5e36b6=_0x42064c[_0x549255(0x27d)];return console[_0x549255(0x392)](_0x549255(0x2c0)+_0x5e36b6[_0x549255(0x219)]+_0x549255(0x221)+_0x5e36b6['id']),await handleSDKOutput([_0x5e36b6],_0x5ccbe1),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x2a5);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x1e6);async[a31_0x164fd9(0x29d)](_0x27cb98){const _0x38626a=a31_0x164fd9,{options:_0x154bee,args:_0x306fea,tdx:_0x234abc}=_0x27cb98;console['error'](_0x38626a(0x253)+_0x38626a(0x332)+_0x38626a(0x214));const _0x37d8c4=_0x154bee;if(_0x306fea[_0x38626a(0x2dc)]===0x0)return console[_0x38626a(0x392)](a31_0x1c9df2[_0x38626a(0x338)](_0x38626a(0x2ae))),console[_0x38626a(0x392)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x406545=_0x306fea[0x0];_0x37d8c4[_0x38626a(0x3d7)]&&(console[_0x38626a(0x392)]('Site:\x20'+_0x37d8c4[_0x38626a(0x1df)]),console[_0x38626a(0x392)](_0x38626a(0x21b)+_0x406545));const _0x15625d=await withSpinner(_0x38626a(0x2d9)+_0x406545+'\x27...',()=>_0x234abc[_0x38626a(0x30b)][_0x38626a(0x254)](_0x406545),{'verbose':_0x37d8c4[_0x38626a(0x3d7)]}),_0x4f951b=_0x15625d[_0x38626a(0x27d)],_0x4e3304=await loadJSONFromOptions(_0x37d8c4[_0x38626a(0x3f1)],_0x37d8c4['addAttributesFile']),_0xd4ef9=await loadJSONFromOptions(_0x37d8c4[_0x38626a(0x38c)],_0x37d8c4['addBehaviorsFile']),_0x4347a={'name':_0x4f951b[_0x38626a(0x219)],'description':_0x37d8c4[_0x38626a(0x323)]!==undefined?_0x37d8c4[_0x38626a(0x323)]:_0x4f951b[_0x38626a(0x323)],'scheduleType':_0x37d8c4[_0x38626a(0x1d5)]!==undefined?_0x37d8c4[_0x38626a(0x1d5)]:_0x4f951b['scheduleType'],'scheduleOption':_0x37d8c4[_0x38626a(0x391)]!==undefined?_0x37d8c4[_0x38626a(0x391)]:_0x4f951b[_0x38626a(0x391)],'timezone':_0x37d8c4[_0x38626a(0x39e)]!==undefined?_0x37d8c4[_0x38626a(0x39e)]:_0x4f951b[_0x38626a(0x39e)],'master':_0x4f951b['master'],'attributes':_0x4e3304?[..._0x4f951b[_0x38626a(0x218)]||[],..._0x4e3304]:_0x4f951b[_0x38626a(0x218)],'behaviors':_0xd4ef9?[..._0x4f951b[_0x38626a(0x3c3)]||[],..._0xd4ef9]:_0x4f951b['behaviors'],'customerGroup':_0x4f951b[_0x38626a(0x2b2)]},_0x386a1a=await withSpinner(_0x38626a(0x1d2)+_0x406545+_0x38626a(0x3e1),()=>_0x234abc[_0x38626a(0x30b)][_0x38626a(0x1db)](_0x406545,_0x4347a),{'verbose':_0x37d8c4[_0x38626a(0x3d7)]}),_0x3d22a6=_0x386a1a[_0x38626a(0x27d)];return console[_0x38626a(0x392)](_0x38626a(0x1f5)+_0x3d22a6['name']+'\x27'),await handleSDKOutput([_0x3d22a6],_0x37d8c4),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x320);['description']=a31_0x164fd9(0x1e7);async['execute'](_0x3ad4c0){const _0x42af2f=a31_0x164fd9,{options:_0x58ec62,args:_0x3123de,tdx:_0x3ffcfe}=_0x3ad4c0,_0x13de5a=_0x58ec62,_0x18ae61=_0x3123de[0x0]||_0x58ec62[_0x42af2f(0x3ec)];if(!_0x18ae61)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x42af2f(0x1ee)),0x1;if(_0x13de5a['use']&&_0x13de5a[_0x42af2f(0x2fc)])return console[_0x42af2f(0x392)](a31_0x1c9df2['red'](_0x42af2f(0x1ef))),console[_0x42af2f(0x392)](a31_0x1c9df2['dim'](_0x42af2f(0x2b7))),console[_0x42af2f(0x392)](a31_0x1c9df2['dim']('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x42af2f(0x1d0))),console[_0x42af2f(0x392)](a31_0x1c9df2[_0x42af2f(0x250)](_0x42af2f(0x365))),0x1;const _0x539baf=_0x13de5a[_0x42af2f(0x2fc)]||a31_0x1a2c9e[_0x42af2f(0x35e)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x18ae61)+'.yml');_0x13de5a[_0x42af2f(0x3d7)]&&(console['error'](_0x42af2f(0x290)+_0x13de5a[_0x42af2f(0x1df)]),console['error'](_0x42af2f(0x21b)+_0x18ae61),console['error'](_0x42af2f(0x2ac)+_0x539baf));const _0x5974ff=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x18ae61+_0x42af2f(0x3e1),()=>_0x3ffcfe['segment']['pullParentYaml'](_0x18ae61),{'verbose':_0x13de5a['verbose']}),_0x55fd78=_0x5974ff[_0x42af2f(0x27d)];if(existsSync(_0x539baf)){const _0x21c5b6=readFileSync(_0x539baf,_0x42af2f(0x29a)),_0x10bd7f=generateDiff(_0x21c5b6,_0x55fd78);if(!hasChanges(_0x10bd7f))console['error'](a31_0x1c9df2[_0x42af2f(0x31e)]('✔')+_0x42af2f(0x28a)+a31_0x1c9df2[_0x42af2f(0x250)](_0x539baf)+_0x42af2f(0x2b8));else{console[_0x42af2f(0x392)](_0x42af2f(0x308)+_0x539baf+'\x27:'),console[_0x42af2f(0x392)]('─'[_0x42af2f(0x1ed)](0x3c)),console[_0x42af2f(0x392)](formatDiffWithColors(_0x10bd7f)),console['error']('─'[_0x42af2f(0x1ed)](0x3c));if(!_0x13de5a[_0x42af2f(0x200)]){if(!isInteractive())return console['error'](a31_0x1c9df2[_0x42af2f(0x338)]('\x0aError:'),_0x42af2f(0x3d9)),console[_0x42af2f(0x392)](a31_0x1c9df2[_0x42af2f(0x256)](_0x42af2f(0x1d4))),0x1;const _0x1f8d8=await confirmKey(_0x42af2f(0x273)+_0x539baf+'\x27?');if(!_0x1f8d8)return console[_0x42af2f(0x392)](a31_0x1c9df2['yellow']('Aborted.')),0x1;}writeFileSync(_0x539baf,_0x55fd78,'utf-8'),console[_0x42af2f(0x392)](a31_0x1c9df2[_0x42af2f(0x31e)]('✔')+_0x42af2f(0x3b5)+a31_0x1c9df2[_0x42af2f(0x250)](_0x539baf));}}else{const _0x14303f=a31_0x1a2c9e[_0x42af2f(0x1e2)](_0x539baf);!existsSync(_0x14303f)&&mkdirSync(_0x14303f,{'recursive':!![]}),writeFileSync(_0x539baf,_0x55fd78,_0x42af2f(0x29a)),console['error'](a31_0x1c9df2[_0x42af2f(0x31e)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x1c9df2[_0x42af2f(0x250)](_0x539baf));}return saveSessionContext({'parent_segment':_0x18ae61},_0x13de5a[_0x42af2f(0x3ef)]),console[_0x42af2f(0x392)](a31_0x1c9df2['green']('✔')+_0x42af2f(0x36d)+a31_0x1c9df2[_0x42af2f(0x256)]('parent_segment')+_0x42af2f(0x2aa)+a31_0x1c9df2[_0x42af2f(0x250)](_0x18ae61)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']='segment:parent:push';[a31_0x164fd9(0x323)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0x2689d1){const _0x1f35a0=a31_0x164fd9,{options:_0x5afe63,args:_0x10e198,tdx:_0x2679e1}=_0x2689d1,_0x304c83=_0x5afe63,_0x4f2140=_0x10e198[0x0]||_0x5afe63[_0x1f35a0(0x3ec)];if(!_0x4f2140)return showParentSegmentNotSetError(_0x1f35a0(0x377)+_0x1f35a0(0x28c)),0x1;const _0x18cea9=resolveYamlFile(_0x4f2140);if(!existsSync(_0x18cea9))return showFileNotFoundError(_0x18cea9,_0x4f2140),0x1;_0x304c83[_0x1f35a0(0x3d7)]&&(console['error'](_0x1f35a0(0x290)+_0x304c83[_0x1f35a0(0x1df)]),console[_0x1f35a0(0x392)](_0x1f35a0(0x330)+_0x18cea9));let _0x620fea;try{_0x620fea=readFileSync(_0x18cea9,_0x1f35a0(0x29a));}catch(_0x41715a){const _0x32c79b=_0x41715a instanceof Error?_0x41715a[_0x1f35a0(0x2bf)]:String(_0x41715a);return console[_0x1f35a0(0x392)](_0x1f35a0(0x364)+_0x32c79b),0x1;}const _0xd250a=await withSpinner('Analyzing\x20changes...',()=>_0x2679e1[_0x1f35a0(0x30b)][_0x1f35a0(0x2d3)](_0x620fea),{'verbose':_0x304c83[_0x1f35a0(0x3d7)]}),_0x16d892=_0xd250a[_0x1f35a0(0x27d)],{isNew:_0x1d69a4,name:_0x67e901,hasChanges:_0xce3d79,diffFormatted:_0x5798ea}=_0x16d892;if(!_0xce3d79)return console[_0x1f35a0(0x392)](_0x1f35a0(0x257)+_0x67e901+_0x1f35a0(0x3d3)),0x0;_0x1d69a4?console['error'](_0x1f35a0(0x3ce)+_0x67e901+'\x27:'):console[_0x1f35a0(0x392)](_0x1f35a0(0x399)+_0x67e901+'\x27:');console[_0x1f35a0(0x392)]('─'[_0x1f35a0(0x1ed)](0x3c)),console[_0x1f35a0(0x392)](_0x5798ea),console[_0x1f35a0(0x392)]('─'['repeat'](0x3c));const _0x55ad53=_0x1d69a4?_0x1f35a0(0x28e)+_0x67e901+'\x27?':_0x1f35a0(0x3a7)+_0x67e901+'\x27?';if(!_0x304c83[_0x1f35a0(0x200)]){if(!isInteractive())return console['error'](a31_0x1c9df2[_0x1f35a0(0x338)](_0x1f35a0(0x26f)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1f35a0(0x392)](a31_0x1c9df2['dim'](_0x1f35a0(0x1d4))),0x1;const _0x175ea2=await confirmKey(_0x55ad53);if(!_0x175ea2)return console['error'](a31_0x1c9df2['yellow']('Aborted.')),0x1;}const _0x5331a0=_0x1d69a4?_0x1f35a0(0x34b):_0x1f35a0(0x30a),_0x8da7ff=await withSpinner(_0x5331a0+_0x1f35a0(0x1da)+_0x67e901+_0x1f35a0(0x3e1),()=>_0x16d892[_0x1f35a0(0x1eb)](),{'verbose':_0x304c83[_0x1f35a0(0x3d7)]}),_0x36603a=_0x8da7ff[_0x1f35a0(0x27d)],_0x4ccf21=getConsoleNextUrl(_0x304c83[_0x1f35a0(0x1df)],'/app/dw/parentSegments/'+_0x36603a['id']),_0x19180d=_0x1d69a4?_0x1f35a0(0x3f0):_0x1f35a0(0x20d);return console[_0x1f35a0(0x392)]('✔\x20'+_0x19180d+_0x1f35a0(0x1da)+_0x36603a[_0x1f35a0(0x219)]+'\x27'),console[_0x1f35a0(0x392)]('\x20\x20'+_0x4ccf21),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x23e);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x2fe);async[a31_0x164fd9(0x29d)](_0x1f6ce4){const _0x4f8cba=a31_0x164fd9,{options:_0xfb2fcf,args:_0x3f20dd,tdx:_0x4a8e67}=_0x1f6ce4,_0x2aad1e=_0xfb2fcf,_0x1ad739=_0x3f20dd[0x0]||_0xfb2fcf[_0x4f8cba(0x3ec)];if(!_0x1ad739)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x4f8cba(0x1f6)+_0x4f8cba(0x341)+_0x4f8cba(0x3e8)+_0x4f8cba(0x3ac)+_0x4f8cba(0x304)),0x1;const _0xbc46b4=resolveYamlFile(_0x1ad739);if(!existsSync(_0xbc46b4))return showFileNotFoundError(_0xbc46b4,_0x1ad739),0x1;_0x2aad1e['verbose']&&(console[_0x4f8cba(0x392)](_0x4f8cba(0x290)+_0x2aad1e[_0x4f8cba(0x1df)]),console[_0x4f8cba(0x392)](_0x4f8cba(0x330)+_0xbc46b4));let _0x2722f4;try{_0x2722f4=readFileSync(_0xbc46b4,_0x4f8cba(0x29a));}catch(_0x1583a9){const _0x475fe6=_0x1583a9 instanceof Error?_0x1583a9['message']:String(_0x1583a9);return console[_0x4f8cba(0x392)](_0x4f8cba(0x364)+_0x475fe6),0x1;}const _0x4ca7f2=createCommandSpinner(a31_0x1c9df2[_0x4f8cba(0x256)]('Validating\x20configuration...'),{'verbose':_0x2aad1e[_0x4f8cba(0x3d7)]});_0x4ca7f2['start']();const _0x45f133={'onProgress':_0x46fd1e=>{const _0x24d72f=_0x4f8cba;_0x4ca7f2[_0x24d72f(0x2c6)]=formatProgressMessage(_0x46fd1e);}};if(_0x2aad1e['master'])_0x45f133[_0x4f8cba(0x3ea)]=!![];if(_0x2aad1e[_0x4f8cba(0x355)])_0x45f133[_0x4f8cba(0x355)]=!![];_0x2aad1e[_0x4f8cba(0x29b)]&&(_0x45f133[_0x4f8cba(0x29b)]=_0x2aad1e['attribute']);_0x2aad1e[_0x4f8cba(0x1d7)]&&(_0x45f133[_0x4f8cba(0x1d7)]=_0x2aad1e[_0x4f8cba(0x1d7)]);if(_0x2aad1e[_0x4f8cba(0x30e)])_0x45f133[_0x4f8cba(0x30e)]=_0x2aad1e['interval'];let _0x15bdfa;try{_0x15bdfa=await _0x4a8e67[_0x4f8cba(0x30b)]['validateParentYaml'](_0x2722f4,_0x45f133),_0x4ca7f2[_0x4f8cba(0x31d)]();}catch(_0x3e21b8){_0x4ca7f2[_0x4f8cba(0x31d)]();throw _0x3e21b8;}const _0x497b51=_0x2aad1e[_0x4f8cba(0x30e)]||'-1d';return this['displayValidateResults'](_0x15bdfa,_0x45f133,_0xbc46b4,_0x497b51),_0x15bdfa['allValid']?0x0:0x1;}['displayValidateResults'](_0x43d789,_0x233852,_0x554c0c,_0x175f2f){const _0x172983=a31_0x164fd9;console[_0x172983(0x392)]('\x0a'+a31_0x1c9df2[_0x172983(0x2ea)](_0x172983(0x2f6))+'\x20'+_0x43d789[_0x172983(0x219)]),console[_0x172983(0x392)]('═'[_0x172983(0x1ed)](0x3c)),this[_0x172983(0x1ff)](_0x43d789);if(typeof _0x233852[_0x172983(0x29b)]===_0x172983(0x20e)){this[_0x172983(0x252)](_0x43d789),this[_0x172983(0x2d7)](_0x43d789),this[_0x172983(0x212)](_0x554c0c,_0x175f2f,_0x172983(0x29b),_0x233852['attribute']);return;}if(_0x233852[_0x172983(0x29b)]===!![]){this[_0x172983(0x252)](_0x43d789),this['displaySummary'](_0x43d789),this[_0x172983(0x212)](_0x554c0c,_0x175f2f,_0x172983(0x218));return;}if(typeof _0x233852[_0x172983(0x1d7)]===_0x172983(0x20e)){this[_0x172983(0x2e4)](_0x43d789,_0x175f2f),this[_0x172983(0x2d7)](_0x43d789),this[_0x172983(0x212)](_0x554c0c,_0x175f2f,_0x172983(0x1d7),_0x233852[_0x172983(0x1d7)]);return;}if(_0x233852[_0x172983(0x1d7)]===!![]){this[_0x172983(0x2e4)](_0x43d789,_0x175f2f),this[_0x172983(0x2d7)](_0x43d789),this[_0x172983(0x212)](_0x554c0c,_0x175f2f,_0x172983(0x3c3));return;}this['displayAttributesStats'](_0x43d789),this[_0x172983(0x2e4)](_0x43d789,_0x175f2f),this['displayRealtimeInfo'](_0x43d789),this[_0x172983(0x2d7)](_0x43d789),this['displayPreviewHints'](_0x554c0c,_0x175f2f,_0x172983(0x38e));}[a31_0x164fd9(0x35c)](_0x2d9c60){displayRealtimeValidation(_0x2d9c60);}[a31_0x164fd9(0x212)](_0x822492,_0x12da6e,_0x4b2e0a,_0x27bd42){const _0x365e5a=a31_0x164fd9;console[_0x365e5a(0x392)]('\x0a'+a31_0x1c9df2[_0x365e5a(0x256)]('To\x20view\x20sample\x20data:'));const _0x3ea5b3=_0x12da6e!==_0x365e5a(0x3c6)?_0x365e5a(0x1e9)+_0x12da6e:'';if(_0x4b2e0a===_0x365e5a(0x29b)&&_0x27bd42)console['error']('\x20\x20'+a31_0x1c9df2[_0x365e5a(0x256)](_0x365e5a(0x25b)+_0x822492+'\x20--attribute\x20\x22'+_0x27bd42+'\x22'+_0x3ea5b3));else{if(_0x4b2e0a===_0x365e5a(0x1d7)&&_0x27bd42)console[_0x365e5a(0x392)]('\x20\x20'+a31_0x1c9df2['dim'](_0x365e5a(0x25b)+_0x822492+_0x365e5a(0x1fc)+_0x27bd42+'\x22'+_0x3ea5b3));else(_0x4b2e0a===_0x365e5a(0x218)||_0x4b2e0a===_0x365e5a(0x38e))&&console[_0x365e5a(0x392)]('\x20\x20'+a31_0x1c9df2[_0x365e5a(0x256)](_0x365e5a(0x25b)+_0x822492+'\x20--attribute\x20\x22<name>\x22'+_0x3ea5b3));}(_0x4b2e0a===_0x365e5a(0x3c3)||_0x4b2e0a===_0x365e5a(0x38e))&&console[_0x365e5a(0x392)]('\x20\x20'+a31_0x1c9df2[_0x365e5a(0x256)](_0x365e5a(0x25b)+_0x822492+'\x20--behavior\x20\x22<name>\x22'+_0x3ea5b3)),_0x4b2e0a==='all'&&console[_0x365e5a(0x392)]('\x20\x20'+a31_0x1c9df2[_0x365e5a(0x256)](_0x365e5a(0x25b)+_0x822492+'\x20--enriched'+_0x3ea5b3));}[a31_0x164fd9(0x1ff)](_0x3883c5){const _0x4f0e1a=a31_0x164fd9,{master:_0x206154}=_0x3883c5,_0x593500=_0x206154[_0x4f0e1a(0x3f5)]?a31_0x1c9df2['green']('✔'):a31_0x1c9df2[_0x4f0e1a(0x338)]('✘');console['error']('\x0a'+a31_0x1c9df2['dim']('Master\x20Table')),console[_0x4f0e1a(0x392)](_0x593500+'\x20'+a31_0x1c9df2[_0x4f0e1a(0x2ea)](_0x206154[_0x4f0e1a(0x381)]+'.'+_0x206154['table'])),_0x206154[_0x4f0e1a(0x3f5)]?_0x206154[_0x4f0e1a(0x302)]!==undefined&&console[_0x4f0e1a(0x392)]('\x20\x20'+a31_0x1c9df2['dim']('Rows:')+'\x20'+a31_0x1c9df2[_0x4f0e1a(0x250)](formatRows(_0x206154[_0x4f0e1a(0x302)]))):console[_0x4f0e1a(0x392)]('\x20\x20'+a31_0x1c9df2[_0x4f0e1a(0x338)]('Error:')+'\x20'+_0x206154['schemaError']);}[a31_0x164fd9(0x252)](_0x2b4f56){const _0x2dd3f2=a31_0x164fd9;if(_0x2b4f56[_0x2dd3f2(0x218)][_0x2dd3f2(0x2dc)]===0x0)return;console['error']('\x0a'+a31_0x1c9df2['dim'](_0x2dd3f2(0x36c)));for(const _0x240fa9 of _0x2b4f56['attributes']){const _0xa9259e=_0x240fa9['schemaValid']?a31_0x1c9df2[_0x2dd3f2(0x31e)]('✔'):a31_0x1c9df2[_0x2dd3f2(0x338)]('✘');let _0x1f0e10='';if(_0x240fa9['schemaValid']&&_0x240fa9[_0x2dd3f2(0x263)]!==undefined&&_0x240fa9['coveragePercent']!==undefined){const _0x55cf34=_0x240fa9['coveragePercent']['toFixed'](0x1),_0x2e1590=_0x240fa9[_0x2dd3f2(0x28b)]>=0x50?a31_0x1c9df2[_0x2dd3f2(0x31e)]:_0x240fa9[_0x2dd3f2(0x28b)]>=0x32?a31_0x1c9df2[_0x2dd3f2(0x216)]:a31_0x1c9df2[_0x2dd3f2(0x338)];_0x1f0e10='\x20'+a31_0x1c9df2['dim'](_0x2dd3f2(0x23f))+'\x20'+_0x2e1590(_0x55cf34+'%')+'\x20('+formatRows(_0x240fa9['matchedCount'])+_0x2dd3f2(0x390);}console[_0x2dd3f2(0x392)](_0xa9259e+'\x20'+a31_0x1c9df2[_0x2dd3f2(0x2ea)](_0x240fa9['name'])+_0x1f0e10),console[_0x2dd3f2(0x392)]('\x20\x20'+a31_0x1c9df2[_0x2dd3f2(0x256)](_0x2dd3f2(0x2a4))+'\x20'+a31_0x1c9df2[_0x2dd3f2(0x2ea)](_0x240fa9[_0x2dd3f2(0x381)]+'.'+_0x240fa9[_0x2dd3f2(0x366)]));const _0x2582be=_0x240fa9[_0x2dd3f2(0x2d1)]===_0x240fa9[_0x2dd3f2(0x24c)]?a31_0x1c9df2[_0x2dd3f2(0x256)]('Join\x20on:')+'\x20'+_0x240fa9[_0x2dd3f2(0x2d1)]:a31_0x1c9df2[_0x2dd3f2(0x256)]('Join:')+'\x20'+_0x240fa9['joinKey']+_0x2dd3f2(0x2aa)+_0x240fa9[_0x2dd3f2(0x24c)];console['error']('\x20\x20'+_0x2582be),console[_0x2dd3f2(0x392)]('\x20\x20'+a31_0x1c9df2[_0x2dd3f2(0x256)](_0x2dd3f2(0x2dd))),this['displayColumns'](_0x240fa9[_0x2dd3f2(0x217)]),!_0x240fa9['schemaValid']&&console[_0x2dd3f2(0x392)]('\x20\x20'+a31_0x1c9df2[_0x2dd3f2(0x338)]('Error:')+'\x20'+_0x240fa9[_0x2dd3f2(0x2d8)]);}}[a31_0x164fd9(0x2e4)](_0x31dd12,_0x16d5a5){const _0x405932=a31_0x164fd9;if(_0x31dd12[_0x405932(0x3c3)]['length']===0x0)return;console[_0x405932(0x392)]('\x0a'+a31_0x1c9df2[_0x405932(0x256)]('Behaviors')+'\x20'+a31_0x1c9df2['dim']('('+_0x16d5a5+')'));for(const _0x42e6a6 of _0x31dd12['behaviors']){const _0x1009cb=_0x42e6a6[_0x405932(0x3f5)]?a31_0x1c9df2['green']('✔'):a31_0x1c9df2[_0x405932(0x338)]('✘');let _0x417bc7='';if(_0x42e6a6[_0x405932(0x3f5)]&&_0x42e6a6[_0x405932(0x306)]!==undefined&&_0x42e6a6[_0x405932(0x322)]!==undefined){const _0x42952b=_0x42e6a6[_0x405932(0x374)]?.[_0x405932(0x27f)](0x1)||'?',_0x38f459=(_0x42e6a6[_0x405932(0x374)]??0x0)>=0x32?a31_0x1c9df2['green']:(_0x42e6a6[_0x405932(0x374)]??0x0)>=0x14?a31_0x1c9df2[_0x405932(0x216)]:a31_0x1c9df2['red'];_0x417bc7='\x20'+a31_0x1c9df2[_0x405932(0x256)](_0x405932(0x372))+'\x20'+_0x38f459(formatRows(_0x42e6a6['customersWithEvents']))+'\x20('+_0x42952b+_0x405932(0x3b3)+a31_0x1c9df2['dim'](_0x405932(0x3e7))+'\x20'+a31_0x1c9df2[_0x405932(0x250)](formatRows(_0x42e6a6[_0x405932(0x322)]));}console[_0x405932(0x392)](_0x1009cb+'\x20'+a31_0x1c9df2[_0x405932(0x2ea)](_0x42e6a6['name'])+_0x417bc7),console[_0x405932(0x392)]('\x20\x20'+a31_0x1c9df2['dim'](_0x405932(0x2a4))+'\x20'+a31_0x1c9df2[_0x405932(0x2ea)](_0x42e6a6[_0x405932(0x381)]+'.'+_0x42e6a6['table']));const _0x513724=_0x42e6a6['joinKey']===_0x42e6a6[_0x405932(0x24c)]?a31_0x1c9df2[_0x405932(0x256)](_0x405932(0x278))+'\x20'+_0x42e6a6[_0x405932(0x2d1)]:a31_0x1c9df2['dim'](_0x405932(0x2d2))+'\x20'+_0x42e6a6['joinKey']+_0x405932(0x2aa)+_0x42e6a6[_0x405932(0x24c)];console[_0x405932(0x392)]('\x20\x20'+_0x513724),console['error']('\x20\x20'+a31_0x1c9df2[_0x405932(0x256)](_0x405932(0x2dd))),this[_0x405932(0x287)](_0x42e6a6['columns']),!_0x42e6a6[_0x405932(0x3f5)]&&console['error']('\x20\x20'+a31_0x1c9df2['red'](_0x405932(0x230))+'\x20'+_0x42e6a6['schemaError']);}}[a31_0x164fd9(0x287)](_0x5a6d80){const _0x59255b=a31_0x164fd9;for(const _0x17284f of _0x5a6d80){_0x17284f['label']===_0x17284f[_0x59255b(0x3b4)]||_0x17284f[_0x59255b(0x3b4)]==='*'?console[_0x59255b(0x392)](_0x59255b(0x268)+_0x17284f['label']):console[_0x59255b(0x392)]('\x20\x20\x20\x20-\x20'+_0x17284f['label']+'\x20'+a31_0x1c9df2[_0x59255b(0x256)]('('+_0x17284f['column']+')'));}}[a31_0x164fd9(0x2d7)](_0x433432){const _0x5a9d3e=a31_0x164fd9;console[_0x5a9d3e(0x392)]('─'[_0x5a9d3e(0x1ed)](0x3c));if(_0x433432['errors'][_0x5a9d3e(0x2dc)]>0x0){console['error']('\x0a'+a31_0x1c9df2[_0x5a9d3e(0x338)]('Errors:'));for(const _0x1f8944 of _0x433432['errors']){console['error']('\x20\x20'+a31_0x1c9df2[_0x5a9d3e(0x338)]('•')+'\x20'+_0x1f8944);}}_0x433432[_0x5a9d3e(0x307)]&&console[_0x5a9d3e(0x392)]('\x0a'+a31_0x1c9df2[_0x5a9d3e(0x31e)]('✔')+_0x5a9d3e(0x2ee));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x3d6);['description']=a31_0x164fd9(0x3eb);async['execute'](_0x54ed76){const _0x3d405f=a31_0x164fd9,{options:_0x658d03,args:_0x379d09,tdx:_0xc66fda}=_0x54ed76,_0x491616=_0x658d03,_0xa81eb6=_0x379d09[0x0]||_0x658d03[_0x3d405f(0x3ec)];if(!_0xa81eb6)return showParentSegmentNotSetError(_0x3d405f(0x2c3)+_0x3d405f(0x3da)+'Options\x20(one\x20required):\x0a'+_0x3d405f(0x3e5)+_0x3d405f(0x360)+_0x3d405f(0x3ab)+_0x3d405f(0x30d)+_0x3d405f(0x304)),0x1;if(!_0x491616[_0x3d405f(0x3ea)]&&!_0x491616[_0x3d405f(0x29b)]&&!_0x491616['behavior']&&!_0x491616[_0x3d405f(0x355)])return console['error'](a31_0x1c9df2[_0x3d405f(0x338)](_0x3d405f(0x298))),console[_0x3d405f(0x392)](_0x3d405f(0x39d)),console[_0x3d405f(0x392)](_0x3d405f(0x297)),console[_0x3d405f(0x392)](_0x3d405f(0x238)),console['error'](_0x3d405f(0x1fb)),console[_0x3d405f(0x392)](_0x3d405f(0x3b8)),console['error'](_0x3d405f(0x3c9)),0x1;const _0x10b87f=resolveYamlFile(_0xa81eb6);if(!existsSync(_0x10b87f))return showFileNotFoundError(_0x10b87f,_0xa81eb6),0x1;_0x491616[_0x3d405f(0x3d7)]&&(console['error'](_0x3d405f(0x290)+_0x491616[_0x3d405f(0x1df)]),console['error'](_0x3d405f(0x330)+_0x10b87f));let _0x275fb2;try{_0x275fb2=readFileSync(_0x10b87f,_0x3d405f(0x29a));}catch(_0x4e1053){const _0x47e418=_0x4e1053 instanceof Error?_0x4e1053[_0x3d405f(0x2bf)]:String(_0x4e1053);return console[_0x3d405f(0x392)](_0x3d405f(0x364)+_0x47e418),0x1;}let _0x3d2601;try{_0x3d2601=parseDef(_0x275fb2);}catch(_0x44be4d){const _0x53fdc2=_0x44be4d instanceof Error?_0x44be4d[_0x3d405f(0x2bf)]:String(_0x44be4d);return console[_0x3d405f(0x392)](a31_0x1c9df2[_0x3d405f(0x338)](_0x3d405f(0x2f9)+_0x53fdc2)),0x1;}if(_0x491616[_0x3d405f(0x29b)]===!![]||_0x491616[_0x3d405f(0x29b)]===''){const _0x3f48eb=_0x3d2601[_0x3d405f(0x218)]?.[_0x3d405f(0x280)](_0x2e0e0c=>_0x2e0e0c['name'])||[];if(_0x3f48eb[_0x3d405f(0x2dc)]===0x0)console['error'](a31_0x1c9df2[_0x3d405f(0x338)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x3d405f(0x392)](a31_0x1c9df2['red'](_0x3d405f(0x291))),console[_0x3d405f(0x392)](_0x3d405f(0x210));for(const _0xca38b1 of _0x3f48eb){console[_0x3d405f(0x392)]('\x20\x20'+a31_0x1c9df2['cyan'](_0xca38b1));}console['error'](_0x3d405f(0x235)+_0xa81eb6+_0x3d405f(0x361)+_0x3f48eb[0x0]+'\x22');}return 0x1;}if(_0x491616['behavior']===!![]||_0x491616[_0x3d405f(0x1d7)]===''){const _0x53b1bc=_0x3d2601[_0x3d405f(0x3c3)]?.[_0x3d405f(0x280)](_0x3982c7=>_0x3982c7[_0x3d405f(0x219)])||[];if(_0x53b1bc['length']===0x0)console[_0x3d405f(0x392)](a31_0x1c9df2[_0x3d405f(0x338)](_0x3d405f(0x343)));else{console['error'](a31_0x1c9df2['red'](_0x3d405f(0x242))),console[_0x3d405f(0x392)]('Available\x20behaviors:');for(const _0x5ec255 of _0x53b1bc){console[_0x3d405f(0x392)]('\x20\x20'+a31_0x1c9df2[_0x3d405f(0x250)](_0x5ec255));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0xa81eb6+_0x3d405f(0x1fc)+_0x53b1bc[0x0]+'\x22');}return 0x1;}const _0x30e3de=createCommandSpinner(a31_0x1c9df2['dim'](_0x3d405f(0x384)),{'verbose':_0x491616[_0x3d405f(0x3d7)]});_0x30e3de[_0x3d405f(0x340)]();const _0x146fe0={'onProgress':_0x177d57=>{_0x30e3de['text']=formatProgressMessage(_0x177d57);}};if(_0x491616[_0x3d405f(0x3ea)])_0x146fe0[_0x3d405f(0x3ea)]=!![];if(_0x491616[_0x3d405f(0x29b)]&&typeof _0x491616[_0x3d405f(0x29b)]===_0x3d405f(0x20e))_0x146fe0[_0x3d405f(0x29b)]=_0x491616[_0x3d405f(0x29b)];if(_0x491616['behavior']&&typeof _0x491616[_0x3d405f(0x1d7)]===_0x3d405f(0x20e))_0x146fe0[_0x3d405f(0x1d7)]=_0x491616['behavior'];if(_0x491616['enriched'])_0x146fe0['enriched']=!![];if(_0x491616[_0x3d405f(0x30e)])_0x146fe0['interval']=_0x491616['interval'];let _0x468c93;try{_0x468c93=await _0xc66fda[_0x3d405f(0x30b)][_0x3d405f(0x23c)](_0x275fb2,_0x146fe0),_0x30e3de[_0x3d405f(0x31d)]();}catch(_0x22be61){_0x30e3de['stop']();throw _0x22be61;}return await this[_0x3d405f(0x23d)](_0x468c93,{'master':_0x491616[_0x3d405f(0x3ea)],'attribute':typeof _0x491616[_0x3d405f(0x29b)]===_0x3d405f(0x20e)?_0x491616[_0x3d405f(0x29b)]:undefined,'behavior':typeof _0x491616[_0x3d405f(0x1d7)]===_0x3d405f(0x20e)?_0x491616[_0x3d405f(0x1d7)]:undefined,'enriched':_0x491616[_0x3d405f(0x355)]}),_0x468c93[_0x3d405f(0x307)]?0x0:0x1;}async[a31_0x164fd9(0x23d)](_0x5d06d2,_0x49f87a){const _0x42d7b7=a31_0x164fd9;console[_0x42d7b7(0x392)]('\x0a'+a31_0x1c9df2[_0x42d7b7(0x2ea)](_0x42d7b7(0x3af))+'\x20'+_0x5d06d2[_0x42d7b7(0x219)]),console[_0x42d7b7(0x392)]('═'[_0x42d7b7(0x1ed)](0x3c));if(_0x49f87a[_0x42d7b7(0x3ea)]&&_0x5d06d2[_0x42d7b7(0x357)]){const _0x327cd5=a31_0x1c9df2[_0x42d7b7(0x256)](_0x42d7b7(0x211))+'\x20'+a31_0x1c9df2['bold'](_0x5d06d2[_0x42d7b7(0x3ea)]['database']+'.'+_0x5d06d2['master']['table']);await this[_0x42d7b7(0x272)](_0x327cd5,_0x5d06d2['sampleData']);}else{if(_0x49f87a[_0x42d7b7(0x29b)]&&_0x5d06d2[_0x42d7b7(0x357)]){const _0x1d7e05=a31_0x1c9df2[_0x42d7b7(0x256)]('Attribute:')+'\x20'+a31_0x1c9df2[_0x42d7b7(0x2ea)](_0x49f87a[_0x42d7b7(0x29b)]);await this['displaySampleData'](_0x1d7e05,_0x5d06d2[_0x42d7b7(0x357)]);}else{if(_0x49f87a['behavior']&&_0x5d06d2[_0x42d7b7(0x357)]){const _0x3c84d2=a31_0x1c9df2['dim'](_0x42d7b7(0x39a))+'\x20'+a31_0x1c9df2[_0x42d7b7(0x2ea)](_0x49f87a[_0x42d7b7(0x1d7)]);await this[_0x42d7b7(0x272)](_0x3c84d2,_0x5d06d2[_0x42d7b7(0x357)]);}else{if(_0x49f87a['enriched']&&_0x5d06d2[_0x42d7b7(0x357)]){const _0x44816e=a31_0x1c9df2[_0x42d7b7(0x256)](_0x42d7b7(0x2cb))+'\x20'+a31_0x1c9df2[_0x42d7b7(0x2ea)](_0x42d7b7(0x32e));await this['displaySampleData'](_0x44816e,_0x5d06d2[_0x42d7b7(0x357)]);}else!_0x5d06d2[_0x42d7b7(0x357)]&&console['error']('\x0aNo\x20sample\x20data\x20available');}}}if(_0x5d06d2[_0x42d7b7(0x339)][_0x42d7b7(0x2dc)]>0x0){console[_0x42d7b7(0x392)]('─'[_0x42d7b7(0x1ed)](0x3c)),console[_0x42d7b7(0x392)]('\x0a'+a31_0x1c9df2[_0x42d7b7(0x338)](_0x42d7b7(0x24e)));for(const _0x22b4fe of _0x5d06d2[_0x42d7b7(0x339)]){console[_0x42d7b7(0x392)]('\x20\x20'+a31_0x1c9df2[_0x42d7b7(0x338)]('•')+'\x20'+_0x22b4fe);}}}async[a31_0x164fd9(0x272)](_0x16179a,_0x56bdc2){const _0x163a30=a31_0x164fd9;if(_0x56bdc2[_0x163a30(0x2dc)]===0x0){console[_0x163a30(0x392)]('\x0a'+_0x16179a),console[_0x163a30(0x392)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x163a30(0x392)]('\x0a'+_0x16179a);const _0x3ee908=Object['keys'](_0x56bdc2[0x0])[_0x163a30(0x280)](_0x35e48b=>({'name':_0x35e48b,'type':typeof _0x56bdc2[0x0][_0x35e48b]===_0x163a30(0x31b)?_0x163a30(0x225):_0x163a30(0x29f)})),_0x40f7c4={'queryId':'preview','columns':_0x3ee908,'data':_0x56bdc2,'stats':{'state':_0x163a30(0x24d),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x56bdc2['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0xc8ec01=formatAsTable(_0x40f7c4,_0x56bdc2[_0x163a30(0x2dc)],!![]);await writeOutput(_0xc8ec01,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x206);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x3e0);async[a31_0x164fd9(0x29d)](_0x5543d2){const _0x306d77=a31_0x164fd9,{options:_0x25ddf0,args:_0x1bc7e4,tdx:_0x93d672}=_0x5543d2,_0x15ed66=_0x25ddf0,_0xbd7dfe=_0x1bc7e4[0x0]||_0x25ddf0[_0x306d77(0x3ec)];if(!_0xbd7dfe)return showParentSegmentNotSetError(_0x306d77(0x1dc)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x1ec994=resolveYamlFile(_0xbd7dfe);if(existsSync(_0x1ec994)){_0x15ed66[_0x306d77(0x3d7)]&&console[_0x306d77(0x392)](_0x306d77(0x393)+_0x1ec994);let _0x4aa5c1;try{_0x4aa5c1=readFileSync(_0x1ec994,_0x306d77(0x29a));}catch(_0x557c7c){const _0x4929a4=_0x557c7c instanceof Error?_0x557c7c[_0x306d77(0x2bf)]:String(_0x557c7c);return console['error']('Error\x20reading\x20file:\x20'+_0x4929a4),0x1;}const _0x3e06e6=await withSpinner(_0x306d77(0x1de),()=>_0x93d672[_0x306d77(0x30b)][_0x306d77(0x2d3)](_0x4aa5c1),{'verbose':_0x15ed66[_0x306d77(0x3d7)]}),_0x35b6b8=_0x3e06e6[_0x306d77(0x27d)],{isNew:_0x58c0f9,name:_0x5ee6d9,hasChanges:_0x50a080,diffFormatted:_0x12095f}=_0x35b6b8;if(_0x50a080){_0x58c0f9?console['error'](_0x306d77(0x3ce)+_0x5ee6d9+'\x27:'):console[_0x306d77(0x392)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x5ee6d9+'\x27:');console[_0x306d77(0x392)]('─'[_0x306d77(0x1ed)](0x3c)),console[_0x306d77(0x392)](_0x12095f),console[_0x306d77(0x392)]('─'['repeat'](0x3c));const _0x44c90c=_0x58c0f9?'Create\x20parent\x20segment\x20\x27'+_0x5ee6d9+_0x306d77(0x1e8):'Apply\x20changes\x20to\x20\x27'+_0x5ee6d9+_0x306d77(0x1e8);if(!_0x15ed66['yes']){if(!isInteractive())return console['error'](a31_0x1c9df2[_0x306d77(0x338)](_0x306d77(0x26f)),_0x306d77(0x3d9)),console[_0x306d77(0x392)](a31_0x1c9df2['dim'](_0x306d77(0x1d4))),0x1;const _0x4516f5=await confirmKey(_0x44c90c);if(!_0x4516f5)return console[_0x306d77(0x392)](a31_0x1c9df2[_0x306d77(0x216)](_0x306d77(0x35b))),0x1;}const _0x464884=_0x58c0f9?_0x306d77(0x34b):_0x306d77(0x30a);await withSpinner(_0x464884+_0x306d77(0x1da)+_0x5ee6d9+_0x306d77(0x3e1),()=>_0x35b6b8[_0x306d77(0x1eb)](),{'verbose':_0x15ed66[_0x306d77(0x3d7)]});const _0x20fecc=_0x58c0f9?_0x306d77(0x3f0):_0x306d77(0x20d);console[_0x306d77(0x392)]('✔\x20'+_0x20fecc+_0x306d77(0x1da)+_0x5ee6d9+'\x27');}else console[_0x306d77(0x392)]('✔\x20No\x20changes\x20-\x20\x27'+_0x5ee6d9+_0x306d77(0x241));}const _0x581dd8=await withSpinner(_0x306d77(0x3e4)+_0xbd7dfe+_0x306d77(0x3e1),()=>_0x93d672[_0x306d77(0x30b)][_0x306d77(0x3a9)](_0xbd7dfe),{'verbose':_0x15ed66['verbose']}),_0x4d5bb6=_0x581dd8['data'],_0x213089=getConsoleUrl(_0x15ed66[_0x306d77(0x1df)],'/app/workflows/'+_0x4d5bb6[_0x306d77(0x281)]+'/sessions/'+_0x4d5bb6[_0x306d77(0x1d3)]+_0x306d77(0x22f)+_0x4d5bb6[_0x306d77(0x3cc)]);return console[_0x306d77(0x392)](_0x306d77(0x2ba)),console[_0x306d77(0x392)]('\x20\x20'+a31_0x1c9df2[_0x306d77(0x256)](_0x306d77(0x2a2))+'\x20'+_0x4d5bb6[_0x306d77(0x2ca)]),console[_0x306d77(0x392)]('\x20\x20'+a31_0x1c9df2[_0x306d77(0x256)](_0x306d77(0x299))+'\x20'+_0x4d5bb6[_0x306d77(0x383)]),console[_0x306d77(0x392)]('\x20\x20'+a31_0x1c9df2[_0x306d77(0x256)](_0x306d77(0x20b))+'\x20'+_0x4d5bb6[_0x306d77(0x1d3)]),console[_0x306d77(0x392)]('\x20\x20'+a31_0x1c9df2[_0x306d77(0x256)](_0x306d77(0x1ce))+'\x20'+_0x4d5bb6[_0x306d77(0x3cc)]),console[_0x306d77(0x392)]('\x20\x20'+_0x213089),console['error']('\x0a'+a31_0x1c9df2[_0x306d77(0x256)](_0x306d77(0x325))+_0x306d77(0x2ff)+_0x4d5bb6[_0x306d77(0x3cc)]+_0x306d77(0x319)),0x0;}}function a31_0x3713(){const _0x583b45=['keyEventCriteria','displayColumns','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x20Columns:\x20','\x20No\x20changes\x20-\x20','coveragePercent','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a','Create\x20parent\x20segment\x20\x27','Getting\x20personalization\x20\x27','Site:\x20','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Listing\x20parent\x20segments...','ps:rt:jn:resume','delete','ps:pz:service:delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Options:','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Status:','utf-8','attribute','✔\x20Updated\x20personalization\x20\x27','execute','ps:pz:service:update','varchar','⚡\x20Enabled','ps:rt:validate','Audience\x20ID:','7yRTaWQ','Source:','segment:parent:update','Default','534924itwPMc','jobId','2501088nsHPPS','\x20=\x20','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Output\x20file:\x20','Error:\x20Token\x20ID\x20is\x20required','Error:\x20Parent\x20segment\x20name\x20is\x20required','Personalization\x20service\x20description','paused','\x20personalization\x20service','customerGroup','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','\x20Opening\x20','ps:rt:configuration_versions','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','\x20is\x20already\x20up\x20to\x20date','folder-segment','\x0a✔\x20Workflow\x20started','createToken','xdg-open','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','Pattern:\x20','message','✔\x20Created\x20parent\x20segment\x20\x27','createPersonalization','\x27\x20for\x20service\x20\x27','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','text','Resolving\x20parent\x20segment\x20\x27','Create\x20a\x20realtime\x20personalization\x20entity','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','audienceId','Enriched:','listPersonalizations','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','launched','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','joinKey','Join:','pushParentYaml','Pause\x20activations\x20in\x20an\x20RT\x20journey','toLowerCase','created:','displaySummary','schemaError','Fetching\x20current\x20configuration\x20for\x20\x27','ps:pz:service:token:delete','file','length','Columns:','✔\x20Created\x20personalization\x20\x27','allowed\x20IPs:','ignore','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','single','Fetching\x20SQL\x20for\x20\x27','displayBehaviorsStats','information_schema','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','id:\x20','parent_id','listFields','bold','Creating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','SELECT\x20*\x20FROM\x20','\x20Configuration\x20is\x20valid','pauseJourney','\x22\x20}','web','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','true','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','sourceTableValid','Validate:','win32','<database>.<table>','Error\x20parsing\x20YAML:\x20','\x20\x20Note:\x20','segment:parent:show','output','segment:parent:desc','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x20tdx\x20wf\x20attempt\x20','log','customers','rowCount','97879xZbXvO','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','keyEventId:','customersWithEvents','allValid','\x0aChanges\x20to\x20\x27','public','Updating','segment','.yml','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','interval','format','Fetching\x20parent\x20segment\x20\x27','\x0a⚠️\x20\x20Migrating:\x20','\x20service(s)\x20configured','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','No\x20parent\x20segments\x20found','.yaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','Error:\x20File\x20not\x20found:\x20','personalizationServices','\x20kill','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','number','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','stop','green','getOutputDatabaseName','segment:parent:pull','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','totalEvents','description','split','To\x20cancel:','RT\x202.0:','ps:pz:init','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','ps:rt:list','\x20RT-enabled\x20parent\x20segment','\x20+\x20[','Fetching\x20personalization\x20service\x20\x27','identifier','Master\x20+\x20Attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','YAML\x20file:\x20','Update\x20a\x20realtime\x20personalization\x20entity','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','listParents','Next\x20steps:','resolveParentId','collectSchema','ps:pz:service:create','red','errors','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','includeSensitive:','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Listing\x20personalizations\x20for\x20\x27','\x20to\x20configure\x20your\x20personalization\x20service','start','Options:\x0a','\x20service','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x5c$&','payload:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','stageCount','No\x20RT-enabled\x20parent\x20segments\x20found','Creating\x20personalization\x20service\x20\x27','✔\x20Created\x20token\x20\x27','Creating','Patching\x20personalization\x20\x27','population','indexOf','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','\x20personalization','tokens','\x20stage','entryCriteria:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','enriched','patchPersonalization','sampleData','👥\x20','deleteToken','Table:\x20','Aborted.','displayRealtimeInfo','list','join','isDirectory','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20--attribute\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','getPersonalization','Error\x20reading\x20file:\x20','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','table','createdAt','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','in\x20','createParent','attributesFile','Attributes','\x20Context\x20set:\x20','(id:\x20','realtime_enabled','folderId','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Customers:','3srycyP','customerPercent','\x27\x20(id:\x20','Output\x20Database:','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','toLocaleString','filter','Listing\x20personalization\x20services\x20for\x20\x27','match','get','`\x20to\x20download\x20the\x20configuration\x20first','Get\x20current\x20RT\x20configuration\x20version\x20status','idStitching','\x20to\x20push\x20the\x20configuration','database','parent_segments','status','Fetching\x20sample\x20data...','\x20Added\x20personalization\x20template\x20to\x20','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','My\x20Service','payload','Show\x20personalization\x20service\x20details','includeSensitive','entryCriteria','addBehaviors','setJobId','all','List\x20parent\x20segments','\x20rows)','scheduleOption','error','Found\x20YAML\x20file:\x20','No\x20personalizations\x20configured','replace','Updating\x20personalization\x20service\x20\x27','ps:pz:show','\x20parent\x20segment','\x0aChanges\x20to\x20apply\x20to\x20\x27','Behavior:','reduce','stitchingKeys','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','timezone','Show\x20parent\x20segment\x20details','column_type','\x20total','RT\x202.0\x20Validate:','List\x20RT\x20journeys','✔\x20Deleted\x20personalization\x20service\x20\x27','resumeJourney','segment:parent:sql','Apply\x20changes\x20to\x20\x27','Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a','runParent','keyEventId','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Executing\x20parent\x20segment\x20query...','\x20\x20\x20','Preview:','parentFolder','\x20\x20\x20\x20','Show\x20parent\x20segment\x20schema\x20(column\x20types)','%)\x20','column','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','sourceTableError','getCurrentConfigVersion','\x20rows\x20','ps:pz:delete','Creating\x20personalization\x20\x27','Listing\x20RT-enabled\x20parent\x20segments...','\x20Added\x20RT\x202.0\x20template\x20section','any','657538MqIwIo','\x20\x20\x20\x20\x20\x20\x20\x20','behaviors','json','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','-1d','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','ps:pz:service:token:create','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20--name\x20is\x20required','workflowAttemptId','ps:rt:jn:list','\x0aNew\x20parent\x20segment\x20\x27','segment:parent:fields','Database:\x20','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','No\x20personalization\x20services\x20configured','\x27\x20is\x20already\x20up\x20to\x20date','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','status:\x20','segment:parent:preview','verbose','sections:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','state','✔\x20Found\x20','2591000RONKbZ','Listing\x20parent\x20segments\x20matching\x20\x27','3250764bEwPZd','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x27...','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','public:','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Error:\x20Service\x20name\x20is\x20required','Events:','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','customerGroupFile','master','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','parentSegment','\x20true','page_view','session','Created','addAttributes','listJourneys','{\x0a\x20\x20\x22database\x22:\x20\x22','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','schemaValid','Attempt:','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','/{name}.yml\x0a','ps:pz:patch','Updating\x20parent\x20segment\x20\x27','workflowSessionId','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','scheduleType','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','behavior','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x20parent\x20segment\x20\x27','updateParent','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','segment:parent:list','Analyzing\x20changes...','site','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','✘\x20Failed\x20to\x20rename\x20directory:\x20','dirname','\x20\x201.\x20Edit\x20','trim','open','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x27\x20and\x20run\x20workflow?','\x20--interval\x20','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','apply','push','repeat','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20field','test','\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}','/app/dw/parentSegments/','Error:\x20Token\x20name\x20is\x20required','✔\x20Updated\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','formatSchemaJson','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','unref','endsWith','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x20--behavior\x20\x22','✔\x20Renamed\x20directory\x20to\x20','/\x20and\x20','displayMasterInfo','yes','behaviorsFile','behavior_','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','\x0a\x20\x20\x20\x20}','⚡\x20Not\x20enabled','segment:parent:run','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','\x20\x20\x20\x20\x20\x20','Show\x20a\x20specific\x20realtime\x20personalization','allowedIps','Session:','primaryKey','Updated','string','✔\x20Deleted\x20personalization\x20\x27','Available\x20attributes:','Master:','displayPreviewHints','✔\x20Created\x20personalization\x20service\x20\x27','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','/\x20→\x20','yellow','columns','attributes','name','audienceId:','Parent\x20segment:\x20','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','realtime','stats','ps:rt:jn:pause','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','\x27\x20with\x20ID:\x20','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Deleting\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment','double','events','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','user_id','personalization_services','Get\x20SQL\x20query\x20for\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','type','ps:pz:create','\x20\x20Database:\x20','/attempt/','Error:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','Attributes:','✔\x20Found\x20personalization\x20\x27','✔\x20Deleted\x20token\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','value','Creating\x20token\x20\x27','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','previewParentYaml','displayPreviewResults','segment:parent:validate','Coverage:','Error:\x20Service\x20ID\x20is\x20required','\x27\x20is\x20up\x20to\x20date','Error:\x20--behavior\x20requires\x20a\x20name\x0a','/\x20directory.\x0a','jsonl','last_page_viewed','column_name','null','td_client_id','getBehaviorNames','valid','\x20\x202.\x20Run\x20','foreignKey','FINISHED','Errors:','processedRows','cyan','RT\x20Journey\x20ID:\x20','displayAttributesStats','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','getParentFull','\x20(paused)','dim','✔\x20No\x20changes\x20-\x20\x27','2227866KqgEwx','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','tdx\x20ps\x20preview\x20','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','personalization','\x22,\x20\x22type\x22:\x20\x22','audienceId:\x20','\x20behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','parent_segment','matchedCount','\x20[Job\x20ID:\x20','ps:pz:service:list','ID\x20Stitching:','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x20\x20\x20\x20-\x20','\x20configured','localeCompare','no\x20tokens\x20configured','Error:\x20Personalization\x20ID\x20is\x20required','.customers)','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x0aError:','SQL\x20query:\x0a','updatedAt','displaySampleData','Overwrite\x20\x27','run','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','relationships','Delete\x20a\x20realtime\x20personalization','Join\x20on:','eventKind:\x20','eventKind','Deleting\x20token\x20\x27','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','data','\x20\x20Tables:\x201\x20customers\x20+\x20','toFixed','map','workflowId','sections','some','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','token:'];a31_0x3713=function(){return _0x583b45;};return a31_0x3713();}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x3cf);[a31_0x164fd9(0x323)]='List\x20available\x20fields\x20for\x20segmentation';async[a31_0x164fd9(0x29d)](_0x52e1f2){const _0x3500dd=a31_0x164fd9,{options:_0xbc6e03,args:_0x572ab4,tdx:_0x441073}=_0x52e1f2,_0x32bb94=_0x572ab4[0x0]||_0xbc6e03[_0x3500dd(0x3ec)];if(!_0x32bb94)return showParentSegmentNotSetError(_0x3500dd(0x27c)+_0x3500dd(0x321)),0x1;_0xbc6e03[_0x3500dd(0x3d7)]&&(console[_0x3500dd(0x392)]('Site:\x20'+_0xbc6e03[_0x3500dd(0x1df)]),console[_0x3500dd(0x392)]('Parent\x20segment:\x20'+_0x32bb94));const _0x12a540=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x32bb94+_0x3500dd(0x3e1),()=>_0x441073[_0x3500dd(0x30b)][_0x3500dd(0x2e9)](_0x32bb94),{'verbose':_0xbc6e03['verbose']}),_0x5370e2=_0x12a540[_0x3500dd(0x27d)];console[_0x3500dd(0x392)](_0x3500dd(0x3dc)+_0x5370e2[_0x3500dd(0x2dc)]+_0x3500dd(0x1f0)+(_0x5370e2[_0x3500dd(0x2dc)]!==0x1?'s':''));if(_0xbc6e03['json']||_0xbc6e03[_0x3500dd(0x244)])return await handleSDKOutput(_0x5370e2,_0xbc6e03),0x0;return displayFieldsHumanReadable(_0x5370e2,_0x32bb94),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x164fd9(0x219)]='segment:parent:view';[a31_0x164fd9(0x323)]=a31_0x164fd9(0x39f);async[a31_0x164fd9(0x29d)](_0x4fdb17){const _0x335800=a31_0x164fd9,{options:_0x57bed5,args:_0x283d3b,tdx:_0x327266}=_0x4fdb17,_0xb68170=_0x57bed5,_0x3c54ee=_0x283d3b[0x0]||_0x57bed5[_0x335800(0x3ec)];if(!_0x3c54ee)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0x335800(0x2b3)+'Options:\x0a'+_0x335800(0x33d)),0x1;_0x57bed5[_0x335800(0x3d7)]&&(console[_0x335800(0x392)]('Site:\x20'+_0x57bed5[_0x335800(0x1df)]),console[_0x335800(0x392)](_0x335800(0x21b)+_0x3c54ee));const _0x2d8cfe=await withSpinner(_0x335800(0x310)+_0x3c54ee+'\x27...',()=>_0x327266[_0x335800(0x30b)][_0x335800(0x254)](_0x3c54ee),{'verbose':_0x57bed5[_0x335800(0x3d7)]}),_0x5f1e10=_0x2d8cfe['data'];if(_0xb68170[_0x335800(0x2f1)]){const _0x25f9f6=getConsoleNextUrl(_0xb68170[_0x335800(0x1df)],_0x335800(0x1f3)+_0x5f1e10['id']);return console[_0x335800(0x392)](a31_0x1c9df2[_0x335800(0x31e)]('✔')+_0x335800(0x2b5)+a31_0x1c9df2[_0x335800(0x250)](_0x25f9f6)),openBrowser(_0x25f9f6),0x0;}return await handleSingleObjectOutput(_0x5f1e10,_0x57bed5),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x2fd);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x3b2);async[a31_0x164fd9(0x29d)](_0x2f8d08){const _0x119f86=a31_0x164fd9,{options:_0x3b9b3a,args:_0x2a722a,tdx:_0x3a72be}=_0x2f8d08,_0x2a74b4=_0x3b9b3a,_0x77e3ee=_0x2a722a[0x0]||_0x3b9b3a[_0x119f86(0x3ec)];if(!_0x77e3ee)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a'+_0x119f86(0x341)+_0x119f86(0x222)),0x1;_0x3b9b3a[_0x119f86(0x3d7)]&&(console[_0x119f86(0x392)](_0x119f86(0x290)+_0x3b9b3a[_0x119f86(0x1df)]),console[_0x119f86(0x392)](_0x119f86(0x21b)+_0x77e3ee));const _0x159252=await withSpinner(_0x119f86(0x2c7)+_0x77e3ee+_0x119f86(0x3e1),()=>_0x3a72be['segment'][_0x119f86(0x335)](_0x77e3ee),{'verbose':_0x3b9b3a[_0x119f86(0x3d7)]}),_0x511710=_0x159252[_0x119f86(0x27d)],_0x5708ca=_0x3a72be[_0x119f86(0x30b)][_0x119f86(0x31f)](_0x511710);if(_0x2a74b4[_0x119f86(0x2fc)]){const _0x2ec995=await this['collectSchema'](_0x2f8d08,_0x77e3ee,_0x511710,_0x5708ca),_0x56cf05=this[_0x119f86(0x1f7)](_0x2ec995);writeFileSync(_0x2a74b4[_0x119f86(0x2fc)],_0x56cf05);const _0x20544c=_0x2ec995[_0x119f86(0x301)][_0x119f86(0x217)][_0x119f86(0x2dc)]+_0x2ec995[_0x119f86(0x3c3)][_0x119f86(0x39b)]((_0x16bb62,_0x338fd8)=>_0x16bb62+_0x338fd8[_0x119f86(0x217)][_0x119f86(0x2dc)],0x0),_0x56b736=_0x2ec995['behaviors'][_0x119f86(0x379)](_0x1e9b24=>_0x1e9b24[_0x119f86(0x217)][_0x119f86(0x2dc)]===0x0)[_0x119f86(0x2dc)];return console[_0x119f86(0x300)]('Schema\x20saved\x20to\x20'+_0x2a74b4[_0x119f86(0x2fc)]),console[_0x119f86(0x300)](_0x119f86(0x22e)+_0x5708ca),console[_0x119f86(0x300)](_0x119f86(0x27e)+_0x2ec995[_0x119f86(0x3c3)][_0x119f86(0x2dc)]+_0x119f86(0x260)),console[_0x119f86(0x300)](_0x119f86(0x289)+_0x20544c+_0x119f86(0x3a1)),_0x56b736>0x0&&console['log'](_0x119f86(0x2fa)+_0x56b736+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console[_0x119f86(0x392)]('\x0a'+a31_0x1c9df2[_0x119f86(0x2ea)](_0x119f86(0x376))+'\x20'+a31_0x1c9df2[_0x119f86(0x250)](_0x5708ca));const _0x42d704=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x3a72be[_0x119f86(0x30b)]['getParentSQL'](_0x511710),{'verbose':_0x3b9b3a[_0x119f86(0x3d7)]});console[_0x119f86(0x392)]('\x0a'+a31_0x1c9df2[_0x119f86(0x2ea)](_0x119f86(0x301))+'\x20'+a31_0x1c9df2[_0x119f86(0x256)]('('+_0x5708ca+_0x119f86(0x26d)));const _0x54371d=await executeSchemaQuery(_0x42d704[_0x119f86(0x27d)],_0x3a72be,_0x3b9b3a);await handleQueryOutput(_0x54371d,_0x3b9b3a);const _0x50dfa6=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x3a72be[_0x119f86(0x30b)][_0x119f86(0x249)](_0x511710),{'verbose':_0x3b9b3a[_0x119f86(0x3d7)]});for(const _0x3c07ad of _0x50dfa6[_0x119f86(0x27d)]){const _0x17a6ef=_0x119f86(0x202)+_0x3c07ad['toLowerCase']()[_0x119f86(0x395)](/\s+/g,'_'),_0xc5af0a='SELECT\x20*\x20FROM\x20'+_0x5708ca+'.'+_0x17a6ef;console[_0x119f86(0x392)]('\x0a'+a31_0x1c9df2['bold'](_0x3c07ad)+'\x20'+a31_0x1c9df2[_0x119f86(0x256)]('('+_0x5708ca+'.'+_0x17a6ef+')'));try{const _0xe49231=await executeSchemaQuery(_0xc5af0a,_0x3a72be,_0x3b9b3a);await handleQueryOutput(_0xe49231,_0x3b9b3a);}catch{console[_0x119f86(0x392)](a31_0x1c9df2[_0x119f86(0x216)](_0x119f86(0x368)));}}return 0x0;}async[a31_0x164fd9(0x336)](_0x3f0393,_0x208cfa,_0x2f6c57,_0x58aa13){const _0x33d5dc=a31_0x164fd9,{options:_0x19f78e,tdx:_0x26b58e}=_0x3f0393,_0xbec09f=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x26b58e[_0x33d5dc(0x30b)]['getParentSQL'](_0x2f6c57),{'verbose':_0x19f78e[_0x33d5dc(0x3d7)]}),_0x1d5f65=await executeSchemaQuery(_0xbec09f[_0x33d5dc(0x27d)],_0x26b58e,_0x19f78e),_0x5244b2=_0x1d5f65[_0x33d5dc(0x27d)]['map'](_0x1d848e=>({'name':_0x1d848e['column_name'],'type':_0x1d848e['column_type']})),_0x599230=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x26b58e[_0x33d5dc(0x30b)][_0x33d5dc(0x249)](_0x2f6c57),{'verbose':_0x19f78e['verbose']}),_0x4ca447=[];for(const _0x24551e of _0x599230[_0x33d5dc(0x27d)]){const _0xa47a3b=_0x33d5dc(0x202)+_0x24551e[_0x33d5dc(0x2d5)]()['replace'](/\s+/g,'_'),_0x5f3c82=_0x33d5dc(0x2ed)+_0x58aa13+'.'+_0xa47a3b;let _0x47cf95=[];try{const _0x107239=await executeSchemaQuery(_0x5f3c82,_0x26b58e,_0x19f78e);_0x47cf95=_0x107239[_0x33d5dc(0x27d)][_0x33d5dc(0x280)](_0x78f54f=>({'name':_0x78f54f[_0x33d5dc(0x246)],'type':_0x78f54f[_0x33d5dc(0x3a0)]}));}catch{}_0x4ca447[_0x33d5dc(0x1ec)]({'table':_0xa47a3b,'columns':_0x47cf95});}return{'database':_0x58aa13,'parent_segment':_0x208cfa,'parent_id':_0x2f6c57,'customers':{'table':_0x33d5dc(0x301),'columns':_0x5244b2},'behaviors':_0x4ca447};}[a31_0x164fd9(0x1f7)](_0x470740){const _0x5043d2=a31_0x164fd9,_0x26eb56=_0x128db2=>{const _0x193f16=a31_0x3973;if(_0x128db2[_0x193f16(0x2dc)]===0x0)return'[]';const _0x288ca5=_0x128db2['map'](_0x254d81=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x254d81[_0x193f16(0x219)]+_0x193f16(0x25e)+_0x254d81[_0x193f16(0x22c)]+_0x193f16(0x2f0));return'[\x0a'+_0x288ca5['join'](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x267b49=_0x470740[_0x5043d2(0x3c3)][_0x5043d2(0x280)](_0x560343=>{const _0x5d8a50=_0x5043d2;return _0x5d8a50(0x2ab)+_0x560343['table']+_0x5d8a50(0x26e)+_0x26eb56(_0x560343['columns'])[_0x5d8a50(0x395)](/^/gm,'\x20\x20')[_0x5d8a50(0x1e4)]()+_0x5d8a50(0x204);})[_0x5043d2(0x35e)](',\x0a');return _0x5043d2(0x3f3)+_0x470740[_0x5043d2(0x381)]+_0x5043d2(0x23b)+_0x470740[_0x5043d2(0x262)]+_0x5043d2(0x1ea)+_0x470740[_0x5043d2(0x2e8)]+_0x5043d2(0x3e2)+_0x470740[_0x5043d2(0x301)][_0x5043d2(0x366)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x26eb56(_0x470740['customers'][_0x5043d2(0x217)])[_0x5043d2(0x395)](/^/gm,'\x20\x20')[_0x5043d2(0x1e4)]()+_0x5043d2(0x267)+_0x267b49+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a31_0x164fd9(0x3a6);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x22a);async[a31_0x164fd9(0x29d)](_0x1454de){const _0x2b73bf=a31_0x164fd9,{options:_0x46a4f7,args:_0x4556f1,tdx:_0x21313a}=_0x1454de,_0x3a65f3=_0x4556f1[0x0]||_0x46a4f7[_0x2b73bf(0x3ec)];if(!_0x3a65f3)return showParentSegmentNotSetError(_0x2b73bf(0x2ce)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x46a4f7[_0x2b73bf(0x3d7)]&&(console[_0x2b73bf(0x392)](_0x2b73bf(0x290)+_0x46a4f7[_0x2b73bf(0x1df)]),console[_0x2b73bf(0x392)](_0x2b73bf(0x21b)+_0x3a65f3));const _0x535ba0=await withSpinner(_0x2b73bf(0x2c7)+_0x3a65f3+_0x2b73bf(0x3e1),()=>_0x21313a[_0x2b73bf(0x30b)][_0x2b73bf(0x335)](_0x3a65f3),{'verbose':_0x46a4f7[_0x2b73bf(0x3d7)]}),_0x2c1f2c=_0x535ba0['data'],_0x2c3598=await withSpinner(_0x2b73bf(0x2e3)+_0x3a65f3+_0x2b73bf(0x3e1),()=>_0x21313a['segment']['getParentSQL'](_0x2c1f2c),{'verbose':_0x46a4f7[_0x2b73bf(0x3d7)]}),_0x103b3f=_0x2c3598[_0x2b73bf(0x27d)];return _0x46a4f7[_0x2b73bf(0x30f)]===_0x2b73bf(0x3c4)||_0x46a4f7[_0x2b73bf(0x30f)]===_0x2b73bf(0x244)?await handleSDKOutput([{'sql':_0x103b3f}],_0x46a4f7):console['log'](_0x103b3f),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x2fb);['description']=a31_0x164fd9(0x3ca);async[a31_0x164fd9(0x29d)](_0xed876e){const _0x1ba849=a31_0x164fd9,{options:_0x34e230,args:_0x5a0cc7,tdx:_0x4fb4bf}=_0xed876e,_0x178928=_0x5a0cc7[0x0]||_0x34e230[_0x1ba849(0x3ec)];if(!_0x178928)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x34e230['verbose']&&(console[_0x1ba849(0x392)]('Site:\x20'+_0x34e230[_0x1ba849(0x1df)]),console['error']('Parent\x20segment:\x20'+_0x178928));const _0x57c01b=await withSpinner(_0x1ba849(0x2c7)+_0x178928+_0x1ba849(0x3e1),()=>_0x4fb4bf[_0x1ba849(0x30b)][_0x1ba849(0x335)](_0x178928),{'verbose':_0x34e230['verbose']}),_0x1636bc=_0x57c01b['data'],_0x29c1c7=await withSpinner(_0x1ba849(0x2e3)+_0x178928+_0x1ba849(0x3e1),()=>_0x4fb4bf['segment']['getParentSQL'](_0x1636bc),{'verbose':_0x34e230[_0x1ba849(0x3d7)]});let _0x4da3f4=_0x29c1c7[_0x1ba849(0x27d)];const _0x316bab=resolveLimit(_0x34e230['limit'],DEFAULT_DISPLAY_LIMIT),_0x3de03e=/\bLIMIT\s+\d+/i[_0x1ba849(0x1f1)](_0x4da3f4);!_0x3de03e&&(_0x4da3f4=_0x4da3f4[_0x1ba849(0x1e4)]()[_0x1ba849(0x395)](/;+$/,''),_0x4da3f4='SELECT\x20*\x20FROM\x20(\x0a'+_0x4da3f4+_0x1ba849(0x2c5)+_0x316bab);_0x34e230[_0x1ba849(0x3d7)]&&console[_0x1ba849(0x392)](_0x1ba849(0x270)+_0x4da3f4);const _0x42f934=await withProgressSpinner(_0x1ba849(0x3ad),async _0x2d19a0=>{const _0x51c5c9=_0x1ba849,_0x1500bf=await _0x4fb4bf['query'][_0x51c5c9(0x29d)](_0x4da3f4,{'catalog':'td','schema':_0x51c5c9(0x2e5),'onJobId':_0x2bdf8f=>{const _0x1bd736=_0x51c5c9;_0x2d19a0[_0x1bd736(0x38d)](_0x2bdf8f);}});return _0x1500bf;},{'verbose':_0x34e230[_0x1ba849(0x3d7)]}),_0x11200e=_0x42f934[_0x1ba849(0x27d)],_0x389e80=_0x11200e[_0x1ba849(0x2a8)]?_0x1ba849(0x264)+_0x11200e[_0x1ba849(0x2a8)]+']':'';return console[_0x1ba849(0x392)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x11200e['stats'][_0x1ba849(0x24f)][_0x1ba849(0x378)]()+_0x1ba849(0x3bb)+(_0x1ba849(0x369)+formatElapsed(_0x11200e[_0x1ba849(0x21e)]['elapsedTimeMillis'])+_0x389e80)),await handleQueryOutput(_0x11200e,_0x34e230),0x0;}}export class PSRtListCommand extends BaseCommand{['name']=a31_0x164fd9(0x329);['description']=a31_0x164fd9(0x386);async[a31_0x164fd9(0x29d)](_0x439ce5){const _0x527a2d=a31_0x164fd9,{options:_0x37d0a6,args:_0x5a8f0a,tdx:_0x4f58ce}=_0x439ce5,_0x3b977b=_0x5a8f0a[0x0],_0x58f3a2=await withSpinner(_0x3b977b?_0x527a2d(0x3d1)+_0x3b977b+'\x27...':_0x527a2d(0x3be),()=>_0x4f58ce['realtime']['list'](),{'verbose':_0x37d0a6[_0x527a2d(0x3d7)]});let _0x37f4e6=_0x58f3a2[_0x527a2d(0x27d)][_0x527a2d(0x379)](_0x24de31=>_0x24de31[_0x527a2d(0x36f)]);if(_0x3b977b){const _0xd8fdde=_0x3b977b[_0x527a2d(0x395)](/[.+^${}()|[\]\\]/g,_0x527a2d(0x344))[_0x527a2d(0x395)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x311164=new RegExp('^'+_0xd8fdde+'$','i');_0x37f4e6=_0x37f4e6[_0x527a2d(0x379)](_0x551ef7=>_0x311164['test'](_0x551ef7[_0x527a2d(0x219)]));}_0x37f4e6['sort']((_0x5720f6,_0x2d09dc)=>_0x5720f6[_0x527a2d(0x219)][_0x527a2d(0x26a)](_0x2d09dc[_0x527a2d(0x219)])),console['error'](_0x527a2d(0x3dc)+_0x37f4e6[_0x527a2d(0x2dc)]+_0x527a2d(0x32a)+(_0x37f4e6['length']!==0x1?'s':''));const _0x120ef4=_0xe23b1f=>{const _0x4a4a85=_0x527a2d;return getConsoleNextUrl(_0x37d0a6[_0x4a4a85(0x1df)],'/app/dw/parentSegments/'+_0xe23b1f);};if(_0x37d0a6[_0x527a2d(0x30f)]===_0x527a2d(0x3c4)||_0x37d0a6['format']===_0x527a2d(0x244)){const _0x394166=_0x37f4e6[_0x527a2d(0x280)](_0x567a52=>({..._0x567a52,'url':_0x120ef4(_0x567a52['id'])}));await handleSDKOutput(_0x394166,_0x37d0a6);}else{if(_0x37f4e6['length']===0x0)console[_0x527a2d(0x300)](_0x527a2d(0x348));else for(const _0x767075 of _0x37f4e6){const _0x11b0b3=_0x767075[_0x527a2d(0x34d)]?a31_0x1c9df2['dim']('\x20('+formatRows(_0x767075['population'])+')'):'',_0x16ca39=hyperlink(_0x767075[_0x527a2d(0x219)],_0x120ef4(_0x767075['id']));console[_0x527a2d(0x300)]('⚡\x20'+_0x16ca39+_0x11b0b3);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x2a1);['description']=a31_0x164fd9(0x2d0);async[a31_0x164fd9(0x29d)](_0x32f0fc){const _0x2ef94c=a31_0x164fd9,{options:_0x2418dc,args:_0x2fb7ea,tdx:_0xb13a0d}=_0x32f0fc,_0x3bd8b3=_0x2fb7ea[0x0]||_0x2418dc[_0x2ef94c(0x3ec)];if(!_0x3bd8b3)return showParentSegmentNotSetError(_0x2ef94c(0x237)+_0x2ef94c(0x2c9)),0x1;const _0x34b4da=resolveYamlFile(_0x3bd8b3);if(!existsSync(_0x34b4da))return showFileNotFoundError(_0x34b4da,_0x3bd8b3),0x1;let _0x3b4921;try{_0x3b4921=readFileSync(_0x34b4da,_0x2ef94c(0x29a));}catch(_0x30a02d){const _0x201c94=_0x30a02d instanceof Error?_0x30a02d[_0x2ef94c(0x2bf)]:String(_0x30a02d);return console[_0x2ef94c(0x392)]('Error\x20reading\x20file:\x20'+_0x201c94),0x1;}const _0x5ab2dc=createCommandSpinner(a31_0x1c9df2[_0x2ef94c(0x256)]('Validating\x20RT\x20configuration...'),{'verbose':_0x2418dc[_0x2ef94c(0x3d7)]});_0x5ab2dc[_0x2ef94c(0x340)]();const _0x3e03f9={'realtime':!![],'onProgress':_0x5a2741=>{const _0x647d73=_0x2ef94c;_0x5ab2dc[_0x647d73(0x2c6)]=formatProgressMessage(_0x5a2741);}};let _0x591603;try{_0x591603=await _0xb13a0d[_0x2ef94c(0x30b)]['validateParentYaml'](_0x3b4921,_0x3e03f9),_0x5ab2dc[_0x2ef94c(0x31d)]();}catch(_0x3590de){_0x5ab2dc['stop']();throw _0x3590de;}console[_0x2ef94c(0x392)]('\x0a'+a31_0x1c9df2[_0x2ef94c(0x2ea)](_0x2ef94c(0x3a2))+'\x20'+_0x591603[_0x2ef94c(0x219)]),console[_0x2ef94c(0x392)]('═'[_0x2ef94c(0x1ed)](0x3c)),displayRealtimeValidation(_0x591603),console[_0x2ef94c(0x392)]('─'[_0x2ef94c(0x1ed)](0x3c));if(_0x591603[_0x2ef94c(0x339)][_0x2ef94c(0x2dc)]>0x0){console[_0x2ef94c(0x392)]('\x0a'+a31_0x1c9df2[_0x2ef94c(0x338)](_0x2ef94c(0x24e)));for(const _0x4cf46f of _0x591603[_0x2ef94c(0x339)]){console[_0x2ef94c(0x392)]('\x20\x20'+a31_0x1c9df2['red']('•')+'\x20'+_0x4cf46f);}}return _0x591603[_0x2ef94c(0x307)]&&console['error']('\x0a'+a31_0x1c9df2['green']('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x591603['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x3cd);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x3a3);async['execute'](_0x2f8f1a){const _0x409817=a31_0x164fd9,{options:_0x369c1d,args:_0x7eff4d,tdx:_0x32254a}=_0x2f8f1a,_0x2c639b=_0x7eff4d[0x0]||_0x369c1d[_0x409817(0x3ec)];if(!_0x2c639b)return showParentSegmentNotSetError(_0x409817(0x28d)+_0x409817(0x224)),0x1;_0x369c1d[_0x409817(0x3d7)]&&(console['error'](_0x409817(0x290)+_0x369c1d[_0x409817(0x1df)]),console[_0x409817(0x392)](_0x409817(0x21b)+_0x2c639b));const _0x57813a=await withSpinner(_0x409817(0x2c7)+_0x2c639b+_0x409817(0x3e1),()=>_0x32254a[_0x409817(0x30b)][_0x409817(0x335)](_0x2c639b),{'verbose':_0x369c1d[_0x409817(0x3d7)]}),_0x12ce21=_0x57813a[_0x409817(0x27d)],_0x240fa2=await withSpinner('Listing\x20RT\x20journeys\x20for\x20\x27'+_0x2c639b+_0x409817(0x3e1),()=>_0x32254a[_0x409817(0x21d)][_0x409817(0x3f2)](_0x12ce21),{'verbose':_0x369c1d[_0x409817(0x3d7)]}),_0x11d0a8=_0x240fa2['data'];console[_0x409817(0x392)](_0x409817(0x3dc)+_0x11d0a8[_0x409817(0x2dc)]+'\x20RT\x20journey'+(_0x11d0a8[_0x409817(0x2dc)]!==0x1?'s':''));if(_0x369c1d[_0x409817(0x30f)]===_0x409817(0x3c4)||_0x369c1d['format']==='jsonl')await handleSDKOutput(_0x11d0a8,_0x369c1d);else{if(_0x11d0a8[_0x409817(0x2dc)]===0x0)console[_0x409817(0x300)]('No\x20RT\x20journeys\x20found');else for(const _0x3f0de5 of _0x11d0a8){const _0x9649e2=_0x3f0de5[_0x409817(0x3db)]==='launched'?'🚀':'📝',_0x5e7681=_0x3f0de5['paused']?a31_0x1c9df2[_0x409817(0x216)](_0x409817(0x255)):'',_0x194b65=a31_0x1c9df2[_0x409817(0x256)]('\x20('+_0x3f0de5[_0x409817(0x347)]+_0x409817(0x352)+(_0x3f0de5[_0x409817(0x347)]!==0x1?'s':'')+')');console['log'](_0x9649e2+'\x20'+_0x3f0de5[_0x409817(0x219)]+_0x5e7681+_0x194b65);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x21f);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x2d4);async['execute'](_0x4cd3d9){const _0x593e60=a31_0x164fd9,{options:_0x5f58e4,args:_0x4249a4,tdx:_0x4aa329}=_0x4cd3d9,_0x41b2f7=_0x4249a4[0x0];if(!_0x41b2f7)return console[_0x593e60(0x392)](a31_0x1c9df2[_0x593e60(0x338)](_0x593e60(0x220))),console[_0x593e60(0x392)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console[_0x593e60(0x392)](a31_0x1c9df2[_0x593e60(0x256)](_0x593e60(0x284))),0x1;_0x5f58e4[_0x593e60(0x3d7)]&&(console['error'](_0x593e60(0x290)+_0x5f58e4[_0x593e60(0x1df)]),console[_0x593e60(0x392)]('RT\x20Journey\x20ID:\x20'+_0x41b2f7));const _0xa1635=await withSpinner(_0x593e60(0x1e0)+_0x41b2f7+_0x593e60(0x3e1),()=>_0x4aa329[_0x593e60(0x21d)][_0x593e60(0x2ef)](_0x41b2f7),{'verbose':_0x5f58e4[_0x593e60(0x3d7)]}),_0x3afe30=_0xa1635['data'];console[_0x593e60(0x392)](_0x593e60(0x3f4)+_0x3afe30[_0x593e60(0x219)]+'\x27');if(_0x5f58e4[_0x593e60(0x30f)]==='json'||_0x5f58e4[_0x593e60(0x30f)]==='jsonl')await handleSDKOutput([_0x3afe30],_0x5f58e4);else{const _0x267fce=_0x3afe30[_0x593e60(0x3db)]===_0x593e60(0x2cf)?'🚀':'📝',_0x425e54=_0x3afe30['paused']?a31_0x1c9df2[_0x593e60(0x216)]('\x20(paused)'):'';console[_0x593e60(0x300)](_0x267fce+'\x20'+_0x3afe30['name']+_0x425e54);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x293);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x1d9);async[a31_0x164fd9(0x29d)](_0x32581a){const _0x32262b=a31_0x164fd9,{options:_0x240e7d,args:_0x211f58,tdx:_0x28510b}=_0x32581a,_0x48c807=_0x211f58[0x0];if(!_0x48c807)return console[_0x32262b(0x392)](a31_0x1c9df2[_0x32262b(0x338)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console['error'](_0x32262b(0x2f4)),console[_0x32262b(0x392)](a31_0x1c9df2[_0x32262b(0x256)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x240e7d[_0x32262b(0x3d7)]&&(console[_0x32262b(0x392)](_0x32262b(0x290)+_0x240e7d[_0x32262b(0x1df)]),console[_0x32262b(0x392)](_0x32262b(0x251)+_0x48c807));const _0x34f5a8=await withSpinner(_0x32262b(0x25c)+_0x48c807+_0x32262b(0x3e1),()=>_0x28510b[_0x32262b(0x21d)][_0x32262b(0x3a5)](_0x48c807),{'verbose':_0x240e7d['verbose']}),_0x2fe11c=_0x34f5a8['data'];console[_0x32262b(0x392)](_0x32262b(0x328)+_0x2fe11c['name']+'\x27');if(_0x240e7d[_0x32262b(0x30f)]==='json'||_0x240e7d[_0x32262b(0x30f)]==='jsonl')await handleSDKOutput([_0x2fe11c],_0x240e7d);else{const _0x3ef97f=_0x2fe11c['state']===_0x32262b(0x2cf)?'🚀':'📝',_0x5a7422=_0x2fe11c[_0x32262b(0x2b0)]?a31_0x1c9df2[_0x32262b(0x216)](_0x32262b(0x255)):'';console[_0x32262b(0x300)](_0x3ef97f+'\x20'+_0x2fe11c[_0x32262b(0x219)]+_0x5a7422);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x2b6);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x37e);async['execute'](_0x4c82e8){const _0x1e69af=a31_0x164fd9,{options:_0x44a516,args:_0x2d0272,tdx:_0x36aa88}=_0x4c82e8,_0x31ec65=_0x2d0272[0x0]||_0x44a516[_0x1e69af(0x3ec)];if(!_0x31ec65)return showParentSegmentNotSetError(_0x1e69af(0x3a8)+_0x1e69af(0x231)),0x1;_0x44a516[_0x1e69af(0x3d7)]&&(console[_0x1e69af(0x392)](_0x1e69af(0x290)+_0x44a516['site']),console[_0x1e69af(0x392)](_0x1e69af(0x21b)+_0x31ec65));const _0x461047=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x31ec65+_0x1e69af(0x3e1),()=>_0x36aa88[_0x1e69af(0x30b)][_0x1e69af(0x335)](_0x31ec65),{'verbose':_0x44a516[_0x1e69af(0x3d7)]}),_0x55192d=_0x461047['data'],_0x125eea=await withSpinner(_0x1e69af(0x3b6)+_0x31ec65+_0x1e69af(0x3e1),()=>_0x36aa88['realtime'][_0x1e69af(0x3ba)](_0x55192d),{'verbose':_0x44a516['verbose']}),_0x57787c=_0x125eea[_0x1e69af(0x27d)];return console[_0x1e69af(0x392)]('✔\x20Retrieved\x20RT\x20configuration\x20version'),_0x44a516[_0x1e69af(0x30f)]===_0x1e69af(0x3c4)||_0x44a516[_0x1e69af(0x30f)]===_0x1e69af(0x244)?await handleSDKOutput([_0x57787c],_0x44a516):(console['log'](_0x1e69af(0x2e7)+_0x57787c['id']),console[_0x1e69af(0x300)](_0x1e69af(0x25f)+_0x57787c[_0x1e69af(0x2ca)]),console['log']('identifier:\x20'+_0x57787c[_0x1e69af(0x32d)]),console[_0x1e69af(0x300)](_0x1e69af(0x279)+_0x57787c[_0x1e69af(0x27a)]),console['log'](_0x1e69af(0x3d5)+_0x57787c[_0x1e69af(0x383)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x265);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x25a);async[a31_0x164fd9(0x29d)](_0x3b6d59){const _0x3921bb=a31_0x164fd9,{options:_0x4ea2b4,args:_0x498352,tdx:_0x3aecba}=_0x3b6d59,_0x5e1e78=_0x498352[0x0]||_0x4ea2b4[_0x3921bb(0x3ec)];if(!_0x5e1e78)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+_0x3921bb(0x1d6)),0x1;const _0x2acade=await withSpinner(_0x3921bb(0x2c7)+_0x5e1e78+_0x3921bb(0x3e1),()=>_0x3aecba['segment']['resolveParentId'](_0x5e1e78),{'verbose':_0x4ea2b4[_0x3921bb(0x3d7)]}),_0x555554=_0x2acade['data'],_0x4b9ab7=await withSpinner(_0x3921bb(0x37a)+_0x5e1e78+_0x3921bb(0x3e1),()=>_0x3aecba['personalization'][_0x3921bb(0x35d)](_0x555554),{'verbose':_0x4ea2b4[_0x3921bb(0x3d7)]}),_0x7e118a=_0x4b9ab7[_0x3921bb(0x27d)];console[_0x3921bb(0x392)](_0x3921bb(0x3dc)+_0x7e118a[_0x3921bb(0x2dc)]+_0x3921bb(0x2b1)+(_0x7e118a['length']!==0x1?'s':''));if(_0x4ea2b4[_0x3921bb(0x30f)]===_0x3921bb(0x3c4)||_0x4ea2b4['format']===_0x3921bb(0x244))await handleSDKOutput(_0x7e118a,_0x4ea2b4);else{if(_0x7e118a[_0x3921bb(0x2dc)]===0x0)console[_0x3921bb(0x300)](_0x3921bb(0x3d2)),console[_0x3921bb(0x392)](a31_0x1c9df2[_0x3921bb(0x250)](_0x3921bb(0x2f2)));else for(const _0x327e48 of _0x7e118a){console[_0x3921bb(0x300)](a31_0x1c9df2[_0x3921bb(0x2ea)](_0x327e48[_0x3921bb(0x219)])+'\x20'+a31_0x1c9df2[_0x3921bb(0x256)]('(id:\x20'+_0x327e48['id']+')'));_0x327e48[_0x3921bb(0x323)]&&console['log']('\x20\x20'+a31_0x1c9df2[_0x3921bb(0x256)](_0x327e48[_0x3921bb(0x323)]));if(_0x327e48['tokens']&&_0x327e48[_0x3921bb(0x351)][_0x3921bb(0x2dc)]>0x0)for(const _0x5d3c3d of _0x327e48['tokens']){const _0x1d83b0=_0x5d3c3d[_0x3921bb(0x20a)]?.['length']?_0x5d3c3d[_0x3921bb(0x20a)]['join'](',\x20'):_0x3921bb(0x3c0);console[_0x3921bb(0x300)]('\x20\x20'+a31_0x1c9df2[_0x3921bb(0x250)](_0x3921bb(0x285))+'\x20'+_0x5d3c3d[_0x3921bb(0x219)]+'\x20'+a31_0x1c9df2['dim'](_0x3921bb(0x36e)+_0x5d3c3d['id']+')')),console['log'](_0x3921bb(0x3b1)+a31_0x1c9df2[_0x3921bb(0x256)]('allowed\x20IPs:')+'\x20'+_0x1d83b0);}else console['log']('\x20\x20'+a31_0x1c9df2['dim'](_0x3921bb(0x26b)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{['name']=a31_0x164fd9(0x337);['description']=a31_0x164fd9(0x3b7);async['execute'](_0x544f7f){const _0x33c26f=a31_0x164fd9,{options:_0x58b522,args:_0x452d06,tdx:_0x4ec0f4}=_0x544f7f,_0x5a590c=_0x58b522,_0x4e3cf5=_0x452d06[0x0],_0xe69f47=_0x452d06[0x1]||_0x58b522[_0x33c26f(0x3ec)];if(!_0x4e3cf5)return console[_0x33c26f(0x392)](_0x33c26f(0x3e6)),console[_0x33c26f(0x392)](_0x33c26f(0x1cf)),console['error'](_0x33c26f(0x362)),0x1;if(!_0xe69f47)return showParentSegmentNotSetError(_0x33c26f(0x34f)+_0x33c26f(0x362)),0x1;const _0x189b57=await withSpinner(_0x33c26f(0x2c7)+_0xe69f47+_0x33c26f(0x3e1),()=>_0x4ec0f4[_0x33c26f(0x30b)]['resolveParentId'](_0xe69f47),{'verbose':_0x58b522[_0x33c26f(0x3d7)]}),_0x500569=_0x189b57['data'],_0x5b4bd5={'name':_0x4e3cf5,'description':_0x5a590c[_0x33c26f(0x323)],'public':_0x5a590c[_0x33c26f(0x309)]},_0x1ccd60=await withSpinner(_0x33c26f(0x349)+_0x4e3cf5+_0x33c26f(0x3e1),()=>_0x4ec0f4[_0x33c26f(0x25d)]['create'](_0x500569,_0x5b4bd5),{'verbose':_0x58b522[_0x33c26f(0x3d7)]}),_0x33709c=_0x1ccd60['data'];return console['error'](_0x33c26f(0x213)+_0x33709c[_0x33c26f(0x219)]+_0x33c26f(0x221)+_0x33709c['id']),await handleSDKOutput([_0x33709c],_0x58b522),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x164fd9(0x219)]='ps:pz:service:show';[a31_0x164fd9(0x323)]=a31_0x164fd9(0x389);async['execute'](_0x1e2176){const _0x2cba88=a31_0x164fd9,{options:_0x3b8116,args:_0x10fc00,tdx:_0x38011c}=_0x1e2176,_0x4f6b68=_0x10fc00[0x0],_0x597328=_0x10fc00[0x1]||_0x3b8116[_0x2cba88(0x3ec)];if(!_0x4f6b68)return console[_0x2cba88(0x392)](_0x2cba88(0x240)),console[_0x2cba88(0x392)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x2cba88(0x392)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x597328)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+_0x2cba88(0x346)),0x1;const _0x249255=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x597328+'\x27...',()=>_0x38011c['segment']['resolveParentId'](_0x597328),{'verbose':_0x3b8116[_0x2cba88(0x3d7)]}),_0x17520a=_0x249255[_0x2cba88(0x27d)],_0x3edb68=await withSpinner(_0x2cba88(0x32c)+_0x4f6b68+_0x2cba88(0x3e1),()=>_0x38011c[_0x2cba88(0x25d)][_0x2cba88(0x37c)](_0x17520a,_0x4f6b68),{'verbose':_0x3b8116[_0x2cba88(0x3d7)]}),_0x4b51bf=_0x3edb68[_0x2cba88(0x27d)];if(_0x3b8116['json']||_0x3b8116[_0x2cba88(0x244)])await handleSDKOutput([_0x4b51bf],_0x3b8116);else{console[_0x2cba88(0x300)](a31_0x1c9df2[_0x2cba88(0x2ea)](_0x4b51bf['name'])+'\x20'+a31_0x1c9df2[_0x2cba88(0x256)](_0x2cba88(0x36e)+_0x4b51bf['id']+')'));_0x4b51bf['description']&&console[_0x2cba88(0x300)]('\x20\x20'+a31_0x1c9df2['dim'](_0x4b51bf[_0x2cba88(0x323)]));console[_0x2cba88(0x300)]('\x20\x20'+a31_0x1c9df2[_0x2cba88(0x250)](_0x2cba88(0x3e3))+'\x20'+(_0x4b51bf[_0x2cba88(0x309)]?'yes':'no'));if(_0x4b51bf[_0x2cba88(0x351)]&&_0x4b51bf[_0x2cba88(0x351)][_0x2cba88(0x2dc)]>0x0)for(const _0x356334 of _0x4b51bf[_0x2cba88(0x351)]){const _0x3f05b7=_0x356334[_0x2cba88(0x20a)]?.[_0x2cba88(0x2dc)]?_0x356334[_0x2cba88(0x20a)][_0x2cba88(0x35e)](',\x20'):_0x2cba88(0x3c0);console[_0x2cba88(0x300)]('\x20\x20'+a31_0x1c9df2[_0x2cba88(0x250)]('token:')+'\x20'+_0x356334[_0x2cba88(0x219)]+'\x20'+a31_0x1c9df2[_0x2cba88(0x256)](_0x2cba88(0x36e)+_0x356334['id']+')')),console[_0x2cba88(0x300)](_0x2cba88(0x3b1)+a31_0x1c9df2[_0x2cba88(0x256)](_0x2cba88(0x2df))+'\x20'+_0x3f05b7);}else console[_0x2cba88(0x300)]('\x20\x20'+a31_0x1c9df2[_0x2cba88(0x256)](_0x2cba88(0x26b)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']=a31_0x164fd9(0x295);[a31_0x164fd9(0x323)]='Delete\x20a\x20personalization\x20service';async[a31_0x164fd9(0x29d)](_0x8bd869){const _0x42eb06=a31_0x164fd9,{options:_0x411859,args:_0xc7a801,tdx:_0x85d55e}=_0x8bd869,_0x35ed86=_0xc7a801[0x0],_0x3bcc78=_0xc7a801[0x1]||_0x411859[_0x42eb06(0x3ec)];if(!_0x35ed86)return console[_0x42eb06(0x392)](_0x42eb06(0x240)),console[_0x42eb06(0x392)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console['error'](_0x42eb06(0x261)),0x1;if(!_0x3bcc78)return showParentSegmentNotSetError(_0x42eb06(0x2e6)+_0x42eb06(0x261)),0x1;const _0xeec180=await withSpinner(_0x42eb06(0x2c7)+_0x3bcc78+_0x42eb06(0x3e1),()=>_0x85d55e[_0x42eb06(0x30b)][_0x42eb06(0x335)](_0x3bcc78),{'verbose':_0x411859['verbose']}),_0x442e94=_0xeec180[_0x42eb06(0x27d)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x35ed86+_0x42eb06(0x3e1),()=>_0x85d55e[_0x42eb06(0x25d)][_0x42eb06(0x294)](_0x442e94,_0x35ed86),{'verbose':_0x411859[_0x42eb06(0x3d7)]}),console['error'](_0x42eb06(0x3a4)+_0x35ed86+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{['name']=a31_0x164fd9(0x29e);['description']=a31_0x164fd9(0x2bd);async['execute'](_0x2eff32){const _0x1b2ac9=a31_0x164fd9,{options:_0x1881ae,args:_0x1a285b,tdx:_0x9221c}=_0x2eff32,_0x40e2dc=_0x1881ae,_0x26521e=_0x1a285b[0x0],_0x5b1646=_0x1a285b[0x1]||_0x1881ae[_0x1b2ac9(0x3ec)];if(!_0x26521e)return console['error'](_0x1b2ac9(0x240)),console[_0x1b2ac9(0x392)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),console[_0x1b2ac9(0x392)](_0x1b2ac9(0x32f)),0x1;if(!_0x40e2dc[_0x1b2ac9(0x219)])return console[_0x1b2ac9(0x392)](_0x1b2ac9(0x3cb)),console[_0x1b2ac9(0x392)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x5b1646)return showParentSegmentNotSetError(_0x1b2ac9(0x203)+_0x1b2ac9(0x32f)),0x1;const _0x36af04=await withSpinner(_0x1b2ac9(0x2c7)+_0x5b1646+_0x1b2ac9(0x3e1),()=>_0x9221c[_0x1b2ac9(0x30b)][_0x1b2ac9(0x335)](_0x5b1646),{'verbose':_0x1881ae['verbose']}),_0x334934=_0x36af04[_0x1b2ac9(0x27d)],_0x5c940c={'name':_0x40e2dc[_0x1b2ac9(0x219)]};_0x40e2dc[_0x1b2ac9(0x323)]!==undefined&&(_0x5c940c[_0x1b2ac9(0x323)]=_0x40e2dc[_0x1b2ac9(0x323)]);const _0x1e1d10=await withSpinner(_0x1b2ac9(0x396)+_0x26521e+_0x1b2ac9(0x3e1),()=>_0x9221c[_0x1b2ac9(0x25d)]['patch'](_0x334934,_0x26521e,_0x5c940c),{'verbose':_0x1881ae[_0x1b2ac9(0x3d7)]}),_0x41429e=_0x1e1d10['data'];return console[_0x1b2ac9(0x392)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x41429e[_0x1b2ac9(0x219)]+'\x27'),await handleSDKOutput([_0x41429e],_0x1881ae),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']=a31_0x164fd9(0x3c8);[a31_0x164fd9(0x323)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a31_0x164fd9(0x29d)](_0x7b3296){const _0x33f352=a31_0x164fd9,{options:_0x44c90,args:_0x391f8d,tdx:_0x36e4ec}=_0x7b3296,_0x42d61a=_0x44c90,_0x199e27=_0x391f8d[0x0],_0x270ef8=_0x391f8d[0x1],_0x588f52=_0x391f8d[0x2]||_0x44c90[_0x33f352(0x3ec)];if(!_0x199e27)return console['error'](_0x33f352(0x1f4)),console[_0x33f352(0x392)](_0x33f352(0x3c7)),console[_0x33f352(0x392)](_0x33f352(0x31c)),0x1;if(!_0x270ef8)return console[_0x33f352(0x392)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x33f352(0x392)](_0x33f352(0x3c7)),console[_0x33f352(0x392)](_0x33f352(0x31c)),0x1;if(!_0x588f52)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+_0x33f352(0x31c)),0x1;const _0x421dfe=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x588f52+_0x33f352(0x3e1),()=>_0x36e4ec[_0x33f352(0x30b)][_0x33f352(0x335)](_0x588f52),{'verbose':_0x44c90['verbose']}),_0x2fed1f=_0x421dfe[_0x33f352(0x27d)],_0x425348={'name':_0x199e27};_0x42d61a[_0x33f352(0x20a)]&&(_0x425348[_0x33f352(0x20a)]=_0x42d61a[_0x33f352(0x20a)][_0x33f352(0x324)](',')['map'](_0x136fa0=>_0x136fa0[_0x33f352(0x1e4)]()));_0x42d61a[_0x33f352(0x323)]&&(_0x425348[_0x33f352(0x323)]=_0x42d61a[_0x33f352(0x323)]);const _0x18bee8=await withSpinner(_0x33f352(0x23a)+_0x199e27+_0x33f352(0x2c2)+_0x270ef8+'\x27...',()=>_0x36e4ec['personalization'][_0x33f352(0x2bb)](_0x2fed1f,_0x270ef8,_0x425348),{'verbose':_0x44c90[_0x33f352(0x3d7)]}),_0xa519cb=_0x18bee8['data'];return console['error'](_0x33f352(0x34a)+_0xa519cb[_0x33f352(0x219)]+_0x33f352(0x221)+_0xa519cb['id']),_0xa519cb[_0x33f352(0x239)]&&(console['error'](a31_0x1c9df2[_0x33f352(0x216)](_0x33f352(0x207))),console['error'](a31_0x1c9df2[_0x33f352(0x250)](_0xa519cb[_0x33f352(0x239)])),console['error']('')),await handleSDKOutput([_0xa519cb],_0x44c90),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x2da);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x371);async[a31_0x164fd9(0x29d)](_0x2bd3aa){const _0x13f1cb=a31_0x164fd9,{options:_0x51804d,args:_0x16d0e3,tdx:_0x24231e}=_0x2bd3aa,_0x198280=_0x16d0e3[0x0],_0x1f607f=_0x16d0e3[0x1]||_0x51804d[_0x13f1cb(0x3ec)];if(!_0x198280)return console['error'](_0x13f1cb(0x2ad)),console[_0x13f1cb(0x392)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console['error'](_0x13f1cb(0x296)),0x1;if(!_0x1f607f)return showParentSegmentNotSetError(_0x13f1cb(0x236)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x3ddad2=await withSpinner(_0x13f1cb(0x2c7)+_0x1f607f+'\x27...',()=>_0x24231e[_0x13f1cb(0x30b)][_0x13f1cb(0x335)](_0x1f607f),{'verbose':_0x51804d[_0x13f1cb(0x3d7)]}),_0x5bbbf6=_0x3ddad2[_0x13f1cb(0x27d)],_0x491638=await withSpinner('Finding\x20service\x20for\x20token...',()=>_0x24231e['personalization'][_0x13f1cb(0x35d)](_0x5bbbf6),{'verbose':_0x51804d[_0x13f1cb(0x3d7)]}),_0x2518b2=_0x491638[_0x13f1cb(0x27d)];let _0x5878e1;for(const _0xbdbae7 of _0x2518b2){if(_0xbdbae7[_0x13f1cb(0x351)]?.[_0x13f1cb(0x283)](_0x599c4a=>_0x599c4a['id']===_0x198280)){_0x5878e1=_0xbdbae7['id'];break;}}if(!_0x5878e1)return console['error']('Error:\x20Token\x20\x27'+_0x198280+_0x13f1cb(0x21c)),0x1;const _0x235ca3=await withSpinner(_0x13f1cb(0x27b)+_0x198280+'\x27...',()=>_0x24231e[_0x13f1cb(0x25d)][_0x13f1cb(0x359)](_0x5bbbf6,_0x5878e1,_0x198280),{'verbose':_0x51804d['verbose']}),_0x3e8faa=_0x235ca3[_0x13f1cb(0x27d)];return console['error'](_0x13f1cb(0x234)+(_0x3e8faa[_0x13f1cb(0x219)]||_0x198280)+'\x27'),await handleSDKOutput([_0x3e8faa],_0x51804d),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x164fd9(0x219)]='ps:pz:list';[a31_0x164fd9(0x323)]=a31_0x164fd9(0x1d8);async['execute'](_0x557c1f){const _0x286b7b=a31_0x164fd9,{options:_0x3d49c5,args:_0x498e70,tdx:_0x46fefc}=_0x557c1f,_0x1814f3=_0x498e70[0x0]||_0x3d49c5['parentSegment'];if(!_0x1814f3)return showParentSegmentNotSetError(_0x286b7b(0x2cd)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment'),0x1;const _0x2d17b1=await withSpinner(_0x286b7b(0x2c7)+_0x1814f3+'\x27...',()=>_0x46fefc[_0x286b7b(0x30b)][_0x286b7b(0x335)](_0x1814f3),{'verbose':_0x3d49c5[_0x286b7b(0x3d7)]}),_0x36c8f1=_0x2d17b1[_0x286b7b(0x27d)],_0x239487=await withSpinner(_0x286b7b(0x33e)+_0x1814f3+_0x286b7b(0x3e1),()=>_0x46fefc[_0x286b7b(0x25d)][_0x286b7b(0x2cc)](_0x36c8f1),{'verbose':_0x3d49c5['verbose']}),_0x418092=_0x239487[_0x286b7b(0x27d)];console['error'](_0x286b7b(0x3dc)+_0x418092[_0x286b7b(0x2dc)]+_0x286b7b(0x350)+(_0x418092[_0x286b7b(0x2dc)]!==0x1?'s':''));if(_0x3d49c5[_0x286b7b(0x30f)]==='json'||_0x3d49c5[_0x286b7b(0x30f)]===_0x286b7b(0x244))await handleSDKOutput(_0x418092,_0x3d49c5);else{if(_0x418092[_0x286b7b(0x2dc)]===0x0)console[_0x286b7b(0x300)](_0x286b7b(0x394));else for(const _0x2730b1 of _0x418092){console[_0x286b7b(0x300)](a31_0x1c9df2[_0x286b7b(0x2ea)](_0x2730b1[_0x286b7b(0x219)])+'\x20'+a31_0x1c9df2[_0x286b7b(0x256)](_0x286b7b(0x36e)+_0x2730b1['id']+')'));_0x2730b1[_0x286b7b(0x323)]&&console[_0x286b7b(0x300)]('\x20\x20'+a31_0x1c9df2[_0x286b7b(0x256)](_0x2730b1[_0x286b7b(0x323)]));const _0x5924b6=_0x2730b1[_0x286b7b(0x282)]?.[_0x286b7b(0x2dc)]||0x0;console[_0x286b7b(0x300)]('\x20\x20'+a31_0x1c9df2[_0x286b7b(0x250)]('sections:')+'\x20'+_0x5924b6);if(_0x2730b1[_0x286b7b(0x282)]&&_0x2730b1['sections'][_0x286b7b(0x2dc)]>0x0)for(const _0xf64099 of _0x2730b1['sections']){console[_0x286b7b(0x300)]('\x20\x20\x20\x20-\x20'+_0xf64099['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{['name']=a31_0x164fd9(0x397);['description']=a31_0x164fd9(0x209);async[a31_0x164fd9(0x29d)](_0x2e5783){const _0x3690cb=a31_0x164fd9,{options:_0x31d098,args:_0x1f1265,tdx:_0x2ab941}=_0x2e5783,_0x4ff199=_0x1f1265[0x0];if(!_0x4ff199)return console[_0x3690cb(0x392)](_0x3690cb(0x26c)),console[_0x3690cb(0x392)](_0x3690cb(0x227)),0x1;const _0x31c004=await withSpinner(_0x3690cb(0x28f)+_0x4ff199+_0x3690cb(0x3e1),()=>_0x2ab941[_0x3690cb(0x25d)][_0x3690cb(0x363)](_0x4ff199),{'verbose':_0x31d098['verbose']}),_0x424b46=_0x31c004[_0x3690cb(0x27d)];console[_0x3690cb(0x392)](_0x3690cb(0x233)+_0x424b46[_0x3690cb(0x219)]+'\x27');if(_0x31d098[_0x3690cb(0x30f)]===_0x3690cb(0x3c4)||_0x31d098[_0x3690cb(0x30f)]===_0x3690cb(0x244))await handleSDKOutput([_0x424b46],_0x31d098);else{console[_0x3690cb(0x300)](a31_0x1c9df2[_0x3690cb(0x2ea)](_0x424b46['name'])+'\x20'+a31_0x1c9df2[_0x3690cb(0x256)]('(id:\x20'+_0x424b46['id']+')'));_0x424b46['description']&&console[_0x3690cb(0x300)]('\x20\x20'+a31_0x1c9df2[_0x3690cb(0x256)](_0x424b46[_0x3690cb(0x323)]));_0x424b46[_0x3690cb(0x2ca)]&&console[_0x3690cb(0x300)]('\x20\x20'+a31_0x1c9df2[_0x3690cb(0x250)](_0x3690cb(0x21a))+'\x20'+_0x424b46['audienceId']);console[_0x3690cb(0x300)]('\x20\x20'+a31_0x1c9df2[_0x3690cb(0x250)](_0x3690cb(0x2d6))+'\x20'+_0x424b46[_0x3690cb(0x367)]),console[_0x3690cb(0x300)]('\x20\x20'+a31_0x1c9df2[_0x3690cb(0x250)]('updated:')+'\x20'+_0x424b46[_0x3690cb(0x271)]);const _0x3b5123=_0x424b46[_0x3690cb(0x282)]?.[_0x3690cb(0x2dc)]||0x0;console[_0x3690cb(0x300)]('\x20\x20'+a31_0x1c9df2[_0x3690cb(0x250)](_0x3690cb(0x3d8))+'\x20'+_0x3b5123);if(_0x424b46[_0x3690cb(0x282)]&&_0x424b46['sections'][_0x3690cb(0x2dc)]>0x0)for(const _0x4b8529 of _0x424b46[_0x3690cb(0x282)]){console[_0x3690cb(0x300)](_0x3690cb(0x3b1)+a31_0x1c9df2['bold'](_0x4b8529[_0x3690cb(0x219)])+'\x20'+a31_0x1c9df2['dim'](_0x3690cb(0x36e)+_0x4b8529['id']+')')),_0x4b8529['entryCriteria']&&(console['log'](_0x3690cb(0x208)+a31_0x1c9df2['cyan'](_0x3690cb(0x353))+'\x20'+_0x4b8529[_0x3690cb(0x38b)][_0x3690cb(0x219)]),_0x4b8529[_0x3690cb(0x38b)]['keyEventCriteria']?.[_0x3690cb(0x3aa)]&&console[_0x3690cb(0x300)](_0x3690cb(0x3c2)+a31_0x1c9df2[_0x3690cb(0x250)](_0x3690cb(0x305))+'\x20'+_0x4b8529['entryCriteria'][_0x3690cb(0x286)][_0x3690cb(0x3aa)])),_0x4b8529[_0x3690cb(0x388)]&&console[_0x3690cb(0x300)](_0x3690cb(0x208)+a31_0x1c9df2[_0x3690cb(0x250)](_0x3690cb(0x345))+'\x20'+JSON['stringify'](_0x4b8529['payload'])),_0x4b8529[_0x3690cb(0x38a)]&&console[_0x3690cb(0x300)](_0x3690cb(0x208)+a31_0x1c9df2[_0x3690cb(0x250)](_0x3690cb(0x33c))+_0x3690cb(0x3ed));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x3bc);['description']=a31_0x164fd9(0x277);async['execute'](_0x33c35f){const _0x264104=a31_0x164fd9,{options:_0x52e48c,args:_0x5302cf,tdx:_0x41e608}=_0x33c35f,_0x32d758=_0x5302cf[0x0];if(!_0x32d758)return console[_0x264104(0x392)](_0x264104(0x26c)),console[_0x264104(0x392)](_0x264104(0x22b)),0x1;return await withSpinner(_0x264104(0x223)+_0x32d758+_0x264104(0x3e1),()=>_0x41e608[_0x264104(0x25d)]['deletePersonalization'](_0x32d758),{'verbose':_0x52e48c[_0x264104(0x3d7)]}),console['error'](_0x264104(0x20f)+_0x32d758+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']=a31_0x164fd9(0x22d);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x2c8);async[a31_0x164fd9(0x29d)](_0x32ad23){const _0xdbe5d4=a31_0x164fd9,{options:_0x9b0068,tdx:_0x32d1eb}=_0x32ad23,_0x4cc426=_0x9b0068;let _0x60a15f;if(_0x4cc426[_0xdbe5d4(0x2db)]){_0x60a15f=await loadJSON(_0x4cc426['file'],!![]);if(!_0x60a15f[_0xdbe5d4(0x276)]?.[_0xdbe5d4(0x3b0)])return console[_0xdbe5d4(0x392)](_0xdbe5d4(0x2b4)),console[_0xdbe5d4(0x392)](_0xdbe5d4(0x259)),console[_0xdbe5d4(0x392)](_0xdbe5d4(0x1f2)),0x1;}else{if(!_0x4cc426[_0xdbe5d4(0x219)])return console[_0xdbe5d4(0x392)](_0xdbe5d4(0x288)),console[_0xdbe5d4(0x392)](_0xdbe5d4(0x31a)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x4cc426['description']===undefined)return console[_0xdbe5d4(0x392)](_0xdbe5d4(0x2e1)),console[_0xdbe5d4(0x392)](_0xdbe5d4(0x31a)),console[_0xdbe5d4(0x392)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x4cc426[_0xdbe5d4(0x370)]===undefined)return console[_0xdbe5d4(0x392)](_0xdbe5d4(0x3d4)),console['error']('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x9ed7ab=_0x4cc426[_0xdbe5d4(0x2ca)];if(!_0x9ed7ab&&_0x9b0068[_0xdbe5d4(0x3ec)]){const _0x2506cb=await withSpinner(_0xdbe5d4(0x2c7)+_0x9b0068[_0xdbe5d4(0x3ec)]+'\x27...',()=>_0x32d1eb[_0xdbe5d4(0x30b)][_0xdbe5d4(0x335)](_0x9b0068[_0xdbe5d4(0x3ec)]),{'verbose':_0x9b0068[_0xdbe5d4(0x3d7)]});_0x9ed7ab=_0x2506cb['data'];}let _0x18e0bb;_0x4cc426[_0xdbe5d4(0x282)]&&(_0x18e0bb=await loadJSON(_0x4cc426['sections'],![]));const _0x348772=_0x4cc426[_0xdbe5d4(0x370)]===_0xdbe5d4(0x247)?null:{'id':_0x4cc426[_0xdbe5d4(0x370)],'type':_0xdbe5d4(0x2b9)};_0x60a15f={'attributes':{'name':_0x4cc426['name'],'description':_0x4cc426[_0xdbe5d4(0x323)]||null,..._0x9ed7ab!==undefined&&{'audienceId':_0x9ed7ab},..._0x18e0bb!==undefined&&{'sections':_0x18e0bb}},'relationships':{'parentFolder':{'data':_0x348772}}};}const _0x5bf2dc=await withSpinner(_0xdbe5d4(0x3bd)+(_0x60a15f[_0xdbe5d4(0x218)]?.['name']??'')+'\x27...',()=>_0x32d1eb[_0xdbe5d4(0x25d)][_0xdbe5d4(0x2c1)](_0x60a15f),{'verbose':_0x9b0068[_0xdbe5d4(0x3d7)]}),_0x497e80=_0x5bf2dc['data'];return console['error'](_0xdbe5d4(0x2de)+_0x497e80[_0xdbe5d4(0x219)]+_0xdbe5d4(0x221)+_0x497e80['id']),await handleSDKOutput([_0x497e80],_0x9b0068),0x0;}}export class PSPzPatchCommand extends BaseCommand{['name']=a31_0x164fd9(0x1d1);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x331);async['execute'](_0x3388f0){const _0x3ac9f4=a31_0x164fd9,{options:_0x25ec69,args:_0x18b85a}=_0x3388f0,_0x1b1d7b=_0x25ec69,_0x117f9c=_0x18b85a[0x0];if(!_0x117f9c)return console[_0x3ac9f4(0x392)](_0x3ac9f4(0x26c)),console[_0x3ac9f4(0x392)](_0x3ac9f4(0x2ec)),console[_0x3ac9f4(0x392)](_0x3ac9f4(0x354)),0x1;let _0x4a4b6b;if(_0x1b1d7b[_0x3ac9f4(0x2db)])_0x4a4b6b=await loadJSON(_0x1b1d7b['file'],!![]);else{if(!_0x1b1d7b[_0x3ac9f4(0x219)])return console[_0x3ac9f4(0x392)](_0x3ac9f4(0x288)),console[_0x3ac9f4(0x392)](_0x3ac9f4(0x2ec)),0x1;if(_0x1b1d7b[_0x3ac9f4(0x323)]===undefined)return console[_0x3ac9f4(0x392)](_0x3ac9f4(0x2e1)),console[_0x3ac9f4(0x392)](_0x3ac9f4(0x2ec)),0x1;let _0x4eb6c4;_0x1b1d7b[_0x3ac9f4(0x282)]&&(_0x4eb6c4=await loadJSON(_0x1b1d7b[_0x3ac9f4(0x282)],![])),_0x4a4b6b={'attributes':{'name':_0x1b1d7b['name'],'description':_0x1b1d7b[_0x3ac9f4(0x323)]||null,..._0x4eb6c4!==undefined&&{'sections':_0x4eb6c4}}};}const {tdx:_0xe818c7}=_0x3388f0,_0x4618e2=await withSpinner(_0x3ac9f4(0x34c)+_0x117f9c+_0x3ac9f4(0x3e1),()=>_0xe818c7[_0x3ac9f4(0x25d)][_0x3ac9f4(0x356)](_0x117f9c,_0x4a4b6b),{'verbose':_0x25ec69[_0x3ac9f4(0x3d7)]}),_0x19735b=_0x4618e2[_0x3ac9f4(0x27d)];return console[_0x3ac9f4(0x392)](_0x3ac9f4(0x29c)+_0x19735b['name']+_0x3ac9f4(0x375)+_0x19735b['id']+')'),await handleSDKOutput([_0x19735b],_0x25ec69),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x164fd9(0x219)]=a31_0x164fd9(0x327);[a31_0x164fd9(0x323)]=a31_0x164fd9(0x2c4);async[a31_0x164fd9(0x29d)](_0x8fcfcf){const _0x49d1a4=a31_0x164fd9,{options:_0x5444d5,args:_0x4901b7}=_0x8fcfcf,_0x375ee3=_0x4901b7[0x0]||_0x5444d5[_0x49d1a4(0x3ec)];if(!_0x375ee3)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a'+_0x49d1a4(0x316)),0x1;const _0x4c9324=resolveYamlFile(_0x375ee3);if(!existsSync(_0x4c9324))return showFileNotFoundError(_0x4c9324,_0x375ee3),0x1;let _0x5e2ce8;try{_0x5e2ce8=readFileSync(_0x4c9324,_0x49d1a4(0x29a));}catch(_0x4b531a){const _0x4c632c=_0x4b531a instanceof Error?_0x4b531a[_0x49d1a4(0x2bf)]:String(_0x4b531a);return console[_0x49d1a4(0x392)](_0x49d1a4(0x364)+_0x4c632c),0x1;}let _0x4d524b;try{_0x4d524b=parseDef(_0x5e2ce8);}catch(_0x136369){const _0x148b43=_0x136369 instanceof Error?_0x136369[_0x49d1a4(0x2bf)]:String(_0x136369);return console[_0x49d1a4(0x392)](a31_0x1c9df2[_0x49d1a4(0x338)](_0x49d1a4(0x2f9)+_0x148b43)),0x1;}if(_0x4d524b[_0x49d1a4(0x229)]&&_0x4d524b[_0x49d1a4(0x229)]['length']>0x0)return console[_0x49d1a4(0x392)](a31_0x1c9df2[_0x49d1a4(0x216)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0x4c9324)),console['error'](a31_0x1c9df2[_0x49d1a4(0x256)](_0x49d1a4(0x3ae)+_0x4d524b['personalization_services'][_0x49d1a4(0x2dc)]+_0x49d1a4(0x312))),0x1;!_0x4d524b[_0x49d1a4(0x21d)]&&(_0x4d524b[_0x49d1a4(0x21d)]={'events':[{'name':_0x49d1a4(0x3ee),'source_table':_0x49d1a4(0x2f8)}],'attributes':[{'name':_0x49d1a4(0x245),'type':_0x49d1a4(0x2e2)}],'id_stitching':{'primary_key':_0x4d524b[_0x49d1a4(0x3ea)][_0x49d1a4(0x366)]===_0x49d1a4(0x301)?_0x49d1a4(0x248):_0x49d1a4(0x228)}});_0x4d524b[_0x49d1a4(0x229)]=[{'name':_0x49d1a4(0x387),'description':_0x49d1a4(0x2af),'trigger_event':_0x49d1a4(0x3ee),'sections':[{'name':_0x49d1a4(0x2a6),'criteria':_0x49d1a4(0x2f3),'attributes':[_0x49d1a4(0x245)]}]}];const _0x32b6a6=serializeDef(_0x4d524b);return writeFileSync(_0x4c9324,_0x32b6a6,_0x49d1a4(0x29a)),console[_0x49d1a4(0x392)](a31_0x1c9df2[_0x49d1a4(0x31e)]('✔')+_0x49d1a4(0x385)+a31_0x1c9df2[_0x49d1a4(0x250)](_0x4c9324)),(!_0x4d524b[_0x49d1a4(0x21d)]||_0x5e2ce8[_0x49d1a4(0x34e)]('realtime:')===-0x1)&&console['error'](a31_0x1c9df2[_0x49d1a4(0x31e)]('✔')+_0x49d1a4(0x3bf)),console[_0x49d1a4(0x392)]('\x0a'+a31_0x1c9df2[_0x49d1a4(0x256)](_0x49d1a4(0x334))),console[_0x49d1a4(0x392)](_0x49d1a4(0x1e3)+_0x4c9324+_0x49d1a4(0x33f)),console['error'](_0x49d1a4(0x24b)+a31_0x1c9df2[_0x49d1a4(0x256)]('tdx\x20ps\x20push\x20'+_0x375ee3)+_0x49d1a4(0x380)),0x0;}}
|