@treasuredata/tdx 2026.4.8 → 2026.4.9
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/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/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.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.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.js +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/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/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.d.ts +2 -0
- package/dist/sdk/workspace/access-tracker.d.ts.map +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/access-tracker.js.map +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts +2 -0
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +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.d.ts +3 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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.d.ts +10 -2
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x4a723d=a31_0x93c7;(function(_0x126cb3,_0x578ec0){const _0x11db39=a31_0x93c7,_0x5b4f33=_0x126cb3();while(!![]){try{const _0xe8bf3d=parseInt(_0x11db39(0xcd))/0x1+parseInt(_0x11db39(0x214))/0x2*(parseInt(_0x11db39(0x26b))/0x3)+parseInt(_0x11db39(0x1b4))/0x4*(parseInt(_0x11db39(0x105))/0x5)+-parseInt(_0x11db39(0x18f))/0x6+parseInt(_0x11db39(0x21c))/0x7+-parseInt(_0x11db39(0x265))/0x8+-parseInt(_0x11db39(0x178))/0x9;if(_0xe8bf3d===_0x578ec0)break;else _0x5b4f33['push'](_0x5b4f33['shift']());}catch(_0x3fa667){_0x5b4f33['push'](_0x5b4f33['shift']());}}}(a31_0x5774,0x95cb5));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x5d15cf 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';function a31_0x5774(){const _0x340acf=['displaySummary','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','previewParentYaml','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Updating','getParentFull','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Fetching\x20current\x20configuration\x20for\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','push','addAttributes','filter','using\x20the\x20default\x20path:\x20','public','<database>.<table>','segment:parent:sql','Resolving\x20parent\x20segment\x20\x27','id:\x20','processedRows','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','allowed\x20IPs:','Attribute:','SELECT\x20*\x20FROM\x20(\x0a','red','\x27\x20is\x20up\x20to\x20date','Error\x20reading\x20file:\x20','5571666LmkKKM','enabled','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','column_type','split','tdx\x20ps\x20preview\x20','Get\x20current\x20RT\x20configuration\x20version\x20status','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Error:\x20Token\x20name\x20is\x20required','pushParentYaml','\x20\x20\x20\x20\x20\x20','Created','Available\x20behaviors:','toFixed','Error:\x20Token\x20ID\x20is\x20required','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','Fetching\x20behavior\x20list...','verbose','stats','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','/\x20directories\x20exist.','rowCount','Error:\x20Service\x20ID\x20is\x20required','3244770DnMtzZ','Deleting\x20personalization\x20\x27','✔\x20Created\x20personalization\x20\x27','Fetching\x20personalization\x20service\x20\x27','Join:','entryCriteria:','/sessions/','✔\x20Deleted\x20personalization\x20service\x20\x27','Pattern:\x20','audienceId','listParents','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','darwin','No\x20personalization\x20services\x20configured','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','message','\x20RT-enabled\x20parent\x20segment','Creating\x20parent\x20segment\x20\x27','apply','preview','some','\x20personalization','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','createToken','\x20\x20No\x20sample\x20data\x20available','\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','site','getPersonalization','includeSensitive:','reduce','Personalization:','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x0aError:','Customers:','113148RXTVEU','\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','Default','\x0a\x20\x20\x20\x20}','Audience\x20ID:','string','segment:parent:show','Behaviors','personalization','matchedCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','execute','Update\x20a\x20realtime\x20personalization\x20entity','\x27\x20and\x20run\x20workflow?','displayColumns','stop','web','Status:','green','use','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','value','Output\x20Database:','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','\x20stage','customerPercent','\x0a\x20\x20]\x0a}\x0a','✔\x20Deleted\x20personalization\x20\x27','stringify','Output\x20file:\x20','ignore','YAML\x20file:\x20','✔\x20Created\x20token\x20\x27','jsonl','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','SQL\x20query:\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20--attribute\x20\x22<name>\x22','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','ps:pz:create','allValid','\x20--behavior\x20\x22','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','td_client_id','ps:pz:service:list','getParentSQL','List\x20available\x20fields\x20for\x20segmentation','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20kill','Error:\x20Parent\x20segment\x20name\x20is\x20required','Master\x20+\x20Attributes','addBehaviors','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','payload','workflowId','Creating\x20personalization\x20service\x20\x27','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','delete','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','⚡\x20Enabled','formatSchemaJson','platform','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','schemaValid','Create\x20a\x20realtime\x20personalization\x20entity','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','✔\x20No\x20changes\x20-\x20\x27','Attributes:','Listing\x20personalization\x20services\x20for\x20\x27','population','Table:\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','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\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','errors','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','\x20(paused)','parentFolder','localeCompare','\x20\x20\x20','Enriched:','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','scheduleOption','\x20service','\x20configured','\x20Configuration\x20is\x20valid','Delete\x20a\x20personalization\x20service','\x20\x202.\x20Run\x20','\x20\x20\x20\x20-\x20','all','Validating\x20RT\x20configuration...','Show\x20a\x20specific\x20realtime\x20personalization','output','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','4OhxGYb','parent_segment','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','stageCount','events','Finding\x20service\x20for\x20token...','get','Options:','6341160ermbRi','\x20field','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20\x20Note:\x20','audienceId:\x20','Patching\x20personalization\x20\x27','\x20No\x20changes\x20-\x20','Creating\x20token\x20\x27','{\x0a\x20\x20\x22database\x22:\x20\x22','Attributes','in\x20','launched','No\x20parent\x20segments\x20match\x20pattern:\x20','\x0a⚠️\x20\x20Both\x20','segment:parent:fields','segment','Deleting\x20token\x20\x27','Updating\x20personalization\x20service\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','attributes','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20Context\x20set:\x20','behavior_','customers','Events:','parent_segments','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','validateParentYaml','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','interval','sections:','\x0aNew\x20parent\x20segment\x20\x27','column','ps:pz:list','primaryKey','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','To\x20cancel:','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','displayMasterInfo','Error\x20parsing\x20YAML:\x20','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','bold','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Listing\x20parent\x20segments\x20matching\x20\x27','allowedIps','ps:rt:jn:list','\x20Added\x20RT\x202.0\x20template\x20section','Session:','enriched','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','Fetching\x20SQL\x20for\x20\x27','displayRealtimeInfo','-1d','null','stitchingKeys','\x20[Job\x20ID:\x20','ps:pz:delete','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','displayAttributesStats','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','unref','\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','Fetching\x20customers\x20schema...','Getting\x20personalization\x20\x27','utf-8','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','displayBehaviorsStats','yellow','6724080mbsEUh','trim','\x27\x20(id:\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','ID\x20Stitching:','file','386502bOLTIB','updated:','customerGroup','createPersonalization','folderId','\x0aChanges\x20to\x20apply\x20to\x20\x27','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','getBehaviorNames','query','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','sourceTableValid','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20personalization\x20service','log','Name:\x20','format','\x27...','ps:pz:service:show','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Site:\x20','identifier','\x27\x20for\x20service\x20\x27','\x20--behavior\x20\x22<name>\x22','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','segment:parent:run','Listing\x20RT-enabled\x20parent\x20segments...','open','Preview:','✔\x20Found\x20personalization\x20\x27','Options:\x0a','addBehaviorsFile','Aborted.','workflowSessionId','sort','list','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','label','Errors:','Analyzing\x20changes...','ps:pz:service:create','customersWithEvents','Creating\x20personalization\x20\x27','Error:\x20Personalization\x20ID\x20is\x20required','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','segment:parent:push','behaviorsFile','identifier:\x20','varchar','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x22\x20}','Deleting\x20personalization\x20service\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','behaviors','table','replace','keyEventId:','Fetching\x20sample\x20data...','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','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','eventKind:\x20','attribute','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','displayValidateResults','ps:rt:jn:pause','keyEventCriteria','deletePersonalization','description','tdx\x20ps\x20push\x20','realtime_enabled','paused','✔\x20Updated\x20parent\x20segment\x20\x27','Resume\x20activations\x20in\x20an\x20RT\x20journey','Create\x20parent\x20segment\x20\x27','\x20=\x20','type','ps:pz:service:token:delete','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','displayPreviewResults','ps:pz:service:update','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','schemaError','updatedAt','Database:\x20','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','Validate:','Schema\x20saved\x20to\x20','true','\x20service(s)\x20configured','personalization_services','%)\x20','scheduleType','Listing\x20fields\x20for\x20\x27','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Show\x20personalization\x20service\x20details','ps:pz:show','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','foreignKey','\x0a\x20\x20\x20\x20]','\x20is\x20already\x20up\x20to\x20date','ps:rt:validate','\x20\x20Tables:\x201\x20customers\x20+\x20','\x0aNo\x20sample\x20data\x20available','✔\x20Renamed\x20directory\x20to\x20','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','✔\x20Found\x20','No\x20parent\x20segments\x20found','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','.yaml','parentSegment','status','idStitching','828074Puchur','\x20RT\x20journey','Rows:','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x20rows\x20','name','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','database','listPersonalizations','map','Error:\x20Token\x20\x27','setJobId','patch','payload:','FINISHED','\x20--attribute\x20\x22','jobId','sections','(id:\x20','Creating','Master\x20Table','public:','updateParent','toLowerCase','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','\x20total','segment:parent:update','json','✔\x20Updated\x20personalization\x20service\x20\x27','Parent\x20segment:\x20','joinKey','realtime','master','Listing\x20parent\x20segments...','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20to\x20push\x20the\x20configuration','repeat','.yml','resumeJourney','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','totalEvents','entryCriteria','create','parent_id','addAttributesFile','RT\x202.0\x20Validate:','\x20parent\x20segment\x20\x27','Updated','segment:parent:pull','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','sampleData','Error:','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20+\x20[','110CPlcpH','/app/workflows/','✔\x20Created\x20parent\x20segment\x20\x27','join','segment:parent:create','/app/dw/parentSegments/','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','start','Validating\x20configuration...','Error:\x20--database\x20and\x20--table\x20are\x20required','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Attempt:','error','displaySampleData','\x5c$&','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','Error:\x20File\x20not\x20found:\x20','resolveParentId','columns','List\x20RT\x20journeys','RT\x20Journey\x20ID:\x20','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','Apply\x20changes\x20to\x20\x27','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','Fetching\x20parent\x20segment\x20\x27','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','ps:pz:service:token:create','test','Available\x20attributes:','\x20\x20Database:\x20','✔\x20Created\x20personalization\x20service\x20\x27','xdg-open','Delete\x20a\x20realtime\x20personalization','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','`\x20to\x20download\x20the\x20configuration\x20first','single','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','information_schema','workflowAttemptId','behavior','No\x20personalizations\x20configured','displayPreviewHints','data','personalizationServices','Listing\x20RT\x20journeys\x20for\x20\x27','timezone','/{name}.yml\x0a','\x0a✔\x20Workflow\x20started','tokens','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','isDirectory','text','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','length','Columns:','token:','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','collectSchema','\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}','coveragePercent','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','\x20\x20\x20\x20','deleteToken','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x0aUsage:\x20tdx\x20ps\x20preview\x20','✔\x20Updated\x20personalization\x20\x27','Error:\x20--behavior\x20requires\x20a\x20name\x0a','includeSensitive','win32','valid','Show\x20parent\x20segment\x20details','keys','ps:pz:init','\x20RT\x20configuration\x20is\x20valid','\x20\x201.\x20Edit\x20','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','no\x20tokens\x20configured','No\x20RT\x20journeys\x20found','⚡\x20Not\x20enabled','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','cyan','/attempt/','yes'];a31_0x5774=function(){return _0x340acf;};return a31_0x5774();}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_0x46354d 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_0x4a723d(0x238),LEGACY_PARENT_SEGMENT_DIR=a31_0x4a723d(0x215);function openBrowser(_0x232e7d){const _0x368544=a31_0x4a723d,_0x1b3cc3=process[_0x368544(0x1f3)],_0x388c8f=_0x1b3cc3===_0x368544(0x19b)?_0x368544(0x76):_0x1b3cc3===_0x368544(0x14e)?_0x368544(0x10d):_0x368544(0x127);spawn(_0x388c8f,[_0x232e7d],{'detached':!![],'stdio':_0x368544(0x1d2)})[_0x368544(0x25d)]();}function migrateLegacyDirectory(){const _0x54b0ac=a31_0x4a723d;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x31c23c=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x31c23c[_0x54b0ac(0x13c)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x54b0ac(0x112)](a31_0x46354d[_0x54b0ac(0x264)](_0x54b0ac(0x229)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x54b0ac(0x18c))),console[_0x54b0ac(0x112)](a31_0x46354d[_0x54b0ac(0x1a5)](_0x54b0ac(0x1b1)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x54b0ac(0x112)](a31_0x46354d[_0x54b0ac(0x264)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x54b0ac(0x112)](a31_0x46354d['green'](_0x54b0ac(0xc3)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1e3ba3){const _0x2a6a0e=_0x1e3ba3 instanceof Error?_0x1e3ba3[_0x54b0ac(0x19e)]:String(_0x1e3ba3);return console['error'](a31_0x46354d[_0x54b0ac(0x175)](_0x54b0ac(0x67)+_0x2a6a0e+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x2916fb){return migrateLegacyDirectory(),super['run'](_0x2916fb);}}function resolveYamlFile(_0x337b69){const _0x55fcb1=a31_0x4a723d;if(_0x337b69['endsWith']('.yml')||_0x337b69['endsWith'](_0x55fcb1(0xc9)))return _0x337b69;return a31_0x5d15cf[_0x55fcb1(0x108)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x337b69)+_0x55fcb1(0xf4));}function formatProgressMessage(_0x523d5c){const _0x22f35=a31_0x4a723d,_0x26c859=_0x523d5c['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x26c859){const [,_0x532d8c,_0x37a51c,_0x474aef='']=_0x26c859;return a31_0x46354d[_0x22f35(0x1a5)](_0x532d8c+':')+'\x20'+_0x37a51c+a31_0x46354d[_0x22f35(0x1a5)](_0x474aef);}return a31_0x46354d[_0x22f35(0x1a5)](_0x523d5c);}function showFileNotFoundError(_0x1a22ce,_0x5cbb79){const _0x5bd794=a31_0x4a723d;console[_0x5bd794(0x112)](a31_0x46354d[_0x5bd794(0x175)](_0x5bd794(0x116)+_0x1a22ce+'\x0a')),console[_0x5bd794(0x112)](a31_0x46354d[_0x5bd794(0x15a)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x5cbb79+_0x5bd794(0x12a)));}function displayRealtimeValidation(_0x249baf){const _0x5cc83f=a31_0x4a723d;if(!_0x249baf[_0x5cc83f(0xee)])return;const _0x20147c=_0x249baf[_0x5cc83f(0xee)],_0x13e92b=_0x20147c[_0x5cc83f(0x179)]?a31_0x46354d['green'](_0x5cc83f(0x1f1)):a31_0x46354d['yellow'](_0x5cc83f(0x158));console[_0x5cc83f(0x112)]('\x0a'+a31_0x46354d[_0x5cc83f(0x1a5)]('RT\x202.0:')+'\x20'+_0x13e92b);if(_0x20147c['events']&&_0x20147c[_0x5cc83f(0x218)][_0x5cc83f(0x13f)]>0x0){console[_0x5cc83f(0x112)]('\x20\x20'+a31_0x46354d[_0x5cc83f(0x1a5)](_0x5cc83f(0x237))+'\x20'+_0x20147c['events']['length']+_0x5cc83f(0x20a));for(const _0x26fef4 of _0x20147c[_0x5cc83f(0x218)]){const _0x245a43=_0x26fef4[_0x5cc83f(0x66)]===![]?a31_0x46354d[_0x5cc83f(0x175)]('✘'):a31_0x46354d['green']('✔');console[_0x5cc83f(0x112)](_0x5cc83f(0x147)+_0x245a43+'\x20'+_0x26fef4['name']),_0x26fef4['sourceTableError']&&console[_0x5cc83f(0x112)](_0x5cc83f(0x182)+a31_0x46354d[_0x5cc83f(0x175)](_0x26fef4['sourceTableError']));}}if(_0x20147c[_0x5cc83f(0x22f)]&&_0x20147c[_0x5cc83f(0x22f)][_0x5cc83f(0x13f)]>0x0){console[_0x5cc83f(0x112)]('\x20\x20'+a31_0x46354d[_0x5cc83f(0x1a5)](_0x5cc83f(0x1f9))+'\x20'+_0x20147c[_0x5cc83f(0x22f)][_0x5cc83f(0x13f)]+_0x5cc83f(0x20a));for(const _0x56ce15 of _0x20147c[_0x5cc83f(0x22f)]){const _0x3eb245=_0x56ce15[_0x5cc83f(0x14f)]?a31_0x46354d[_0x5cc83f(0x1c6)]('✔'):a31_0x46354d[_0x5cc83f(0x175)]('✘');console[_0x5cc83f(0x112)](_0x5cc83f(0x147)+_0x3eb245+'\x20'+_0x56ce15[_0x5cc83f(0xd3)]+'\x20'+a31_0x46354d[_0x5cc83f(0x1a5)]('('+_0x56ce15['type']+')'));}}if(_0x20147c[_0x5cc83f(0xcc)]){const _0x4d2bca=_0x20147c[_0x5cc83f(0xcc)][_0x5cc83f(0x256)]?.[_0x5cc83f(0x13f)]?_0x5cc83f(0x104)+_0x20147c['idStitching'][_0x5cc83f(0x256)]['join'](',\x20')+']':'';console['error']('\x20\x20'+a31_0x46354d['dim'](_0x5cc83f(0x269))+'\x20'+_0x20147c[_0x5cc83f(0xcc)][_0x5cc83f(0x241)]+_0x4d2bca);}if(_0x20147c[_0x5cc83f(0x135)]&&_0x20147c[_0x5cc83f(0x135)][_0x5cc83f(0x13f)]>0x0){console[_0x5cc83f(0x112)]('\x20\x20'+a31_0x46354d[_0x5cc83f(0x1a5)](_0x5cc83f(0x1ae))+'\x20'+_0x20147c[_0x5cc83f(0x135)][_0x5cc83f(0x13f)]+_0x5cc83f(0x209)+(_0x20147c[_0x5cc83f(0x135)][_0x5cc83f(0x13f)]!==0x1?'s':''));for(const _0x543ff0 of _0x20147c[_0x5cc83f(0x135)]){console[_0x5cc83f(0x112)]('\x20\x20\x20\x20-\x20'+_0x543ff0[_0x5cc83f(0xd3)]);}}}function showParentSegmentNotSetError(_0x5e629){const _0x5bf7b4=a31_0x4a723d;console[_0x5bf7b4(0x112)](a31_0x46354d[_0x5bf7b4(0x264)](_0x5bf7b4(0x17a))),console['error'](_0x5e629);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x4a723d(0xd3)]='segment:parent:list';[a31_0x4a723d(0x9e)]='List\x20parent\x20segments';async[a31_0x4a723d(0x1bf)](_0x5aa039){const _0x4f04f4=a31_0x4a723d,{options:_0x259990,args:_0x1ff1de,tdx:_0x34b2a6}=_0x5aa039,_0x487b5b=_0x1ff1de[0x0];_0x259990[_0x4f04f4(0x189)]&&(console[_0x4f04f4(0x112)](_0x4f04f4(0x6f)+_0x259990[_0x4f04f4(0x1aa)]),_0x487b5b&&console[_0x4f04f4(0x112)](_0x4f04f4(0x197)+_0x487b5b));const _0x59425d=await withSpinner(_0x487b5b?_0x4f04f4(0x24b)+_0x487b5b+'\x27...':_0x4f04f4(0xf0),()=>_0x34b2a6['segment'][_0x4f04f4(0x199)](),{'verbose':_0x259990[_0x4f04f4(0x189)]});let _0x3d896a=_0x59425d[_0x4f04f4(0x134)];if(_0x487b5b){const _0x15a27f=_0x487b5b[_0x4f04f4(0x92)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x4f04f4(0x92)](/\?/g,'.'),_0x247554=new RegExp('^'+_0x15a27f+'$','i');_0x3d896a=_0x3d896a['filter'](_0x45f291=>_0x247554['test'](_0x45f291[_0x4f04f4(0x22f)]['name']));}_0x3d896a[_0x4f04f4(0x7d)]((_0x5b55fb,_0x20ecc3)=>_0x5b55fb[_0x4f04f4(0x22f)][_0x4f04f4(0xd3)][_0x4f04f4(0x204)](_0x20ecc3[_0x4f04f4(0x22f)][_0x4f04f4(0xd3)])),console[_0x4f04f4(0x112)](_0x4f04f4(0xc5)+_0x3d896a[_0x4f04f4(0x13f)]+_0x4f04f4(0x120)+(_0x3d896a['length']!==0x1?'s':''));const _0x8024d9=_0x347a96=>{const _0x8deb65=_0x4f04f4;return getConsoleNextUrl(_0x259990[_0x8deb65(0x1aa)],'/app/dw/parentSegments/'+_0x347a96);};if(_0x259990[_0x4f04f4(0x6b)]==='json'||_0x259990['format']==='jsonl'){const _0x201200=_0x3d896a[_0x4f04f4(0xd7)](_0x1f7f4c=>({..._0x1f7f4c,'url':_0x8024d9(_0x1f7f4c['id'])}));await handleSDKOutput(_0x201200,_0x259990);}else{if(_0x3d896a[_0x4f04f4(0x13f)]===0x0)_0x487b5b?console[_0x4f04f4(0x69)](_0x4f04f4(0x228)+_0x487b5b):console[_0x4f04f4(0x69)](_0x4f04f4(0xc6));else for(const _0x1b6dae of _0x3d896a){const _0x43bbd3=_0x1b6dae[_0x4f04f4(0x22f)][_0x4f04f4(0x1fb)]?a31_0x46354d[_0x4f04f4(0x1a5)]('\x20('+formatRows(_0x1b6dae[_0x4f04f4(0x22f)]['population'])+')'):'',_0x446d6a=hyperlink(_0x1b6dae[_0x4f04f4(0x22f)][_0x4f04f4(0xd3)],_0x8024d9(_0x1b6dae['id']));console[_0x4f04f4(0x69)]('👥\x20'+_0x446d6a+_0x43bbd3);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x109);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x1e4);async[a31_0x4a723d(0x1bf)](_0x4bcf5f){const _0x399afc=a31_0x4a723d,{options:_0x332ff6,args:_0x630912,tdx:_0x2062e5}=_0x4bcf5f;console[_0x399afc(0x112)](_0x399afc(0xc8)+_0x399afc(0x1df)+_0x399afc(0xf1));const _0x355596=_0x332ff6;if(_0x630912[_0x399afc(0x13f)]===0x0)return console[_0x399afc(0x112)](a31_0x46354d[_0x399afc(0x175)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console['error'](_0x399afc(0x19a)),0x1;const _0x52efd3=_0x630912[0x0];if(!_0x355596[_0x399afc(0xd5)]||!_0x355596['table'])return console['error'](_0x399afc(0x10f)),console[_0x399afc(0x112)](_0x399afc(0x19a)),0x1;_0x355596[_0x399afc(0x189)]&&(console[_0x399afc(0x112)]('Site:\x20'+_0x355596[_0x399afc(0x1aa)]),console[_0x399afc(0x112)](_0x399afc(0x6a)+_0x52efd3),console['error'](_0x399afc(0xaf)+_0x355596['database']),console[_0x399afc(0x112)](_0x399afc(0x1fc)+_0x355596[_0x399afc(0x91)]));const _0x169686=await loadJSONFromOptions(_0x355596[_0x399afc(0x22f)],_0x355596['attributesFile']),_0x21861a=await loadJSONFromOptions(_0x355596['behaviors'],_0x355596[_0x399afc(0x89)]),_0x71fab4=await loadJSONFromOptions(_0x355596[_0x399afc(0x26d)],_0x355596['customerGroupFile']),_0x4a5870={'name':_0x52efd3,'description':_0x355596[_0x399afc(0x9e)],'scheduleType':_0x355596[_0x399afc(0xb7)],'scheduleOption':_0x355596[_0x399afc(0x208)],'timezone':_0x355596[_0x399afc(0x137)],'master':{'parentDatabaseName':_0x355596[_0x399afc(0xd5)],'parentTableName':_0x355596['table']},'attributes':_0x169686,'behaviors':_0x21861a,'customerGroup':_0x71fab4},_0x3d4284=await withSpinner(_0x399afc(0x1a0)+_0x52efd3+_0x399afc(0x6c),()=>_0x2062e5[_0x399afc(0x22b)]['createParent'](_0x4a5870),{'verbose':_0x332ff6[_0x399afc(0x189)]}),_0x131a50=_0x3d4284['data'];return console[_0x399afc(0x112)](_0x399afc(0x107)+_0x131a50[_0x399afc(0xd3)]+_0x399afc(0xe6)+_0x131a50['id']),await handleSDKOutput([_0x131a50],_0x332ff6),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0xe9);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x25a);async[a31_0x4a723d(0x1bf)](_0x42d07f){const _0x47b1b6=a31_0x4a723d,{options:_0x218eca,args:_0x97f656,tdx:_0x5a4693}=_0x42d07f;console[_0x47b1b6(0x112)](_0x47b1b6(0x17f)+_0x47b1b6(0x1df)+_0x47b1b6(0xf1));const _0x2bf0dd=_0x218eca;if(_0x97f656['length']===0x0)return console[_0x47b1b6(0x112)](a31_0x46354d[_0x47b1b6(0x175)](_0x47b1b6(0x1e7))),console[_0x47b1b6(0x112)](_0x47b1b6(0x1e5)),0x1;const _0x2e4fce=_0x97f656[0x0];_0x2bf0dd[_0x47b1b6(0x189)]&&(console['error']('Site:\x20'+_0x2bf0dd[_0x47b1b6(0x1aa)]),console[_0x47b1b6(0x112)]('Parent\x20segment:\x20'+_0x2e4fce));const _0x51b92f=await withSpinner(_0x47b1b6(0x164)+_0x2e4fce+'\x27...',()=>_0x5a4693[_0x47b1b6(0x22b)][_0x47b1b6(0x162)](_0x2e4fce),{'verbose':_0x2bf0dd[_0x47b1b6(0x189)]}),_0x3e1e53=_0x51b92f[_0x47b1b6(0x134)],_0x100e70=await loadJSONFromOptions(_0x2bf0dd[_0x47b1b6(0x168)],_0x2bf0dd[_0x47b1b6(0xfb)]),_0x3850d4=await loadJSONFromOptions(_0x2bf0dd[_0x47b1b6(0x1e9)],_0x2bf0dd[_0x47b1b6(0x7a)]),_0x1e371b={'name':_0x3e1e53[_0x47b1b6(0xd3)],'description':_0x2bf0dd[_0x47b1b6(0x9e)]!==undefined?_0x2bf0dd[_0x47b1b6(0x9e)]:_0x3e1e53[_0x47b1b6(0x9e)],'scheduleType':_0x2bf0dd['scheduleType']!==undefined?_0x2bf0dd['scheduleType']:_0x3e1e53['scheduleType'],'scheduleOption':_0x2bf0dd['scheduleOption']!==undefined?_0x2bf0dd[_0x47b1b6(0x208)]:_0x3e1e53[_0x47b1b6(0x208)],'timezone':_0x2bf0dd[_0x47b1b6(0x137)]!==undefined?_0x2bf0dd[_0x47b1b6(0x137)]:_0x3e1e53[_0x47b1b6(0x137)],'master':_0x3e1e53[_0x47b1b6(0xef)],'attributes':_0x100e70?[..._0x3e1e53[_0x47b1b6(0x22f)]||[],..._0x100e70]:_0x3e1e53['attributes'],'behaviors':_0x3850d4?[..._0x3e1e53['behaviors']||[],..._0x3850d4]:_0x3e1e53['behaviors'],'customerGroup':_0x3e1e53[_0x47b1b6(0x26d)]},_0x37317b=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x2e4fce+_0x47b1b6(0x6c),()=>_0x5a4693[_0x47b1b6(0x22b)][_0x47b1b6(0xe4)](_0x2e4fce,_0x1e371b),{'verbose':_0x2bf0dd[_0x47b1b6(0x189)]}),_0x3e3e11=_0x37317b[_0x47b1b6(0x134)];return console['error'](_0x47b1b6(0xa2)+_0x3e3e11[_0x47b1b6(0xd3)]+'\x27'),await handleSDKOutput([_0x3e3e11],_0x2bf0dd),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0xff);['description']=a31_0x4a723d(0x271);async['execute'](_0x2ba4c9){const _0x45bc24=a31_0x4a723d,{options:_0x767cbc,args:_0x268257,tdx:_0x43c300}=_0x2ba4c9,_0x4ed44b=_0x767cbc,_0x3cb0ca=_0x268257[0x0]||_0x767cbc[_0x45bc24(0xca)];if(!_0x3cb0ca)return showParentSegmentNotSetError(_0x45bc24(0x268)+_0x45bc24(0x8c)),0x1;if(_0x4ed44b[_0x45bc24(0x1c7)]&&_0x4ed44b[_0x45bc24(0x212)])return console[_0x45bc24(0x112)](a31_0x46354d['red'](_0x45bc24(0x1d8))),console['error'](a31_0x46354d[_0x45bc24(0x1a5)](_0x45bc24(0x25c))),console[_0x45bc24(0x112)](a31_0x46354d[_0x45bc24(0x1a5)](_0x45bc24(0x16a)+PARENT_SEGMENT_DIR+_0x45bc24(0x138))),console[_0x45bc24(0x112)](a31_0x46354d['cyan'](_0x45bc24(0xac))),0x1;const _0x331289=_0x4ed44b['output']||a31_0x5d15cf['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3cb0ca)+_0x45bc24(0xf4));_0x4ed44b[_0x45bc24(0x189)]&&(console[_0x45bc24(0x112)](_0x45bc24(0x6f)+_0x4ed44b[_0x45bc24(0x1aa)]),console[_0x45bc24(0x112)]('Parent\x20segment:\x20'+_0x3cb0ca),console[_0x45bc24(0x112)](_0x45bc24(0x1d1)+_0x331289));const _0x3ef199=await withSpinner(_0x45bc24(0x11e)+_0x3cb0ca+_0x45bc24(0x6c),()=>_0x43c300['segment']['pullParentYaml'](_0x3cb0ca),{'verbose':_0x4ed44b[_0x45bc24(0x189)]}),_0x189a44=_0x3ef199[_0x45bc24(0x134)];if(existsSync(_0x331289)){const _0x46cda7=readFileSync(_0x331289,_0x45bc24(0x261)),_0xa167fa=generateDiff(_0x46cda7,_0x189a44);if(!hasChanges(_0xa167fa))console[_0x45bc24(0x112)](a31_0x46354d[_0x45bc24(0x1c6)]('✔')+_0x45bc24(0x222)+a31_0x46354d['cyan'](_0x331289)+_0x45bc24(0xbf));else{console[_0x45bc24(0x112)]('\x0aChanges\x20to\x20\x27'+_0x331289+'\x27:'),console['error']('─'[_0x45bc24(0xf3)](0x3c)),console[_0x45bc24(0x112)](formatDiffWithColors(_0xa167fa)),console[_0x45bc24(0x112)]('─'['repeat'](0x3c));if(!_0x4ed44b[_0x45bc24(0x15c)]){if(!isInteractive())return console[_0x45bc24(0x112)](a31_0x46354d[_0x45bc24(0x175)](_0x45bc24(0x1b2)),_0x45bc24(0xa9)),console[_0x45bc24(0x112)](a31_0x46354d[_0x45bc24(0x1a5)](_0x45bc24(0x110))),0x1;const _0x3c8540=await confirmKey('Overwrite\x20\x27'+_0x331289+'\x27?');if(!_0x3c8540)return console[_0x45bc24(0x112)](a31_0x46354d[_0x45bc24(0x264)]('Aborted.')),0x1;}writeFileSync(_0x331289,_0x189a44,_0x45bc24(0x261)),console['error'](a31_0x46354d['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x46354d['cyan'](_0x331289));}}else{const _0x197215=a31_0x5d15cf['dirname'](_0x331289);!existsSync(_0x197215)&&mkdirSync(_0x197215,{'recursive':!![]}),writeFileSync(_0x331289,_0x189a44,_0x45bc24(0x261)),console[_0x45bc24(0x112)](a31_0x46354d[_0x45bc24(0x1c6)]('✔')+_0x45bc24(0x1d6)+a31_0x46354d[_0x45bc24(0x15a)](_0x331289));}return saveSessionContext({'parent_segment':_0x3cb0ca},_0x4ed44b['session']),console[_0x45bc24(0x112)](a31_0x46354d[_0x45bc24(0x1c6)]('✔')+_0x45bc24(0x234)+a31_0x46354d['dim'](_0x45bc24(0x215))+_0x45bc24(0xa5)+a31_0x46354d[_0x45bc24(0x15a)](_0x3cb0ca)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x88);[a31_0x4a723d(0x9e)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a31_0x4a723d(0x1bf)](_0x42e640){const _0x506a1e=a31_0x4a723d,{options:_0xd196d,args:_0xd7f253,tdx:_0x5793d9}=_0x42e640,_0x1e0c69=_0xd196d,_0x5de8ec=_0xd7f253[0x0]||_0xd196d['parentSegment'];if(!_0x5de8ec)return showParentSegmentNotSetError(_0x506a1e(0x166)+_0x506a1e(0x121)),0x1;const _0x13a4d7=resolveYamlFile(_0x5de8ec);if(!existsSync(_0x13a4d7))return showFileNotFoundError(_0x13a4d7,_0x5de8ec),0x1;_0x1e0c69[_0x506a1e(0x189)]&&(console[_0x506a1e(0x112)](_0x506a1e(0x6f)+_0x1e0c69['site']),console['error']('YAML\x20file:\x20'+_0x13a4d7));let _0x33e4c1;try{_0x33e4c1=readFileSync(_0x13a4d7,'utf-8');}catch(_0x4f2fd9){const _0x4a1159=_0x4f2fd9 instanceof Error?_0x4f2fd9[_0x506a1e(0x19e)]:String(_0x4f2fd9);return console[_0x506a1e(0x112)](_0x506a1e(0x177)+_0x4a1159),0x1;}const _0x499678=await withSpinner('Analyzing\x20changes...',()=>_0x5793d9[_0x506a1e(0x22b)][_0x506a1e(0x181)](_0x33e4c1),{'verbose':_0x1e0c69['verbose']}),_0x13356f=_0x499678[_0x506a1e(0x134)],{isNew:_0x3daa48,name:_0x6c6a65,hasChanges:_0x5ca07c,diffFormatted:_0x1fa1e2}=_0x13356f;if(!_0x5ca07c)return console[_0x506a1e(0x112)](_0x506a1e(0x1f8)+_0x6c6a65+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x3daa48?console['error']('\x0aNew\x20parent\x20segment\x20\x27'+_0x6c6a65+'\x27:'):console['error'](_0x506a1e(0x270)+_0x6c6a65+'\x27:');console[_0x506a1e(0x112)]('─'[_0x506a1e(0xf3)](0x3c)),console[_0x506a1e(0x112)](_0x1fa1e2),console['error']('─'[_0x506a1e(0xf3)](0x3c));const _0x35ae00=_0x3daa48?_0x506a1e(0xa4)+_0x6c6a65+'\x27?':_0x506a1e(0x11c)+_0x6c6a65+'\x27?';if(!_0x1e0c69[_0x506a1e(0x15c)]){if(!isInteractive())return console['error'](a31_0x46354d[_0x506a1e(0x175)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x506a1e(0x112)](a31_0x46354d['dim'](_0x506a1e(0x110))),0x1;const _0x598e0c=await confirmKey(_0x35ae00);if(!_0x598e0c)return console['error'](a31_0x46354d[_0x506a1e(0x264)]('Aborted.')),0x1;}const _0x3f9735=_0x3daa48?_0x506a1e(0xe1):_0x506a1e(0x161),_0xbcbcf2=await withSpinner(_0x3f9735+_0x506a1e(0xfd)+_0x6c6a65+_0x506a1e(0x6c),()=>_0x13356f[_0x506a1e(0x1a1)](),{'verbose':_0x1e0c69[_0x506a1e(0x189)]}),_0x588f8d=_0xbcbcf2[_0x506a1e(0x134)],_0xd85860=getConsoleNextUrl(_0x1e0c69[_0x506a1e(0x1aa)],_0x506a1e(0x10a)+_0x588f8d['id']),_0x3ef58d=_0x3daa48?_0x506a1e(0x183):_0x506a1e(0xfe);return console[_0x506a1e(0x112)]('✔\x20'+_0x3ef58d+_0x506a1e(0xfd)+_0x588f8d['name']+'\x27'),console[_0x506a1e(0x112)]('\x20\x20'+_0xd85860),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']='segment:parent:validate';['description']=a31_0x4a723d(0x13e);async[a31_0x4a723d(0x1bf)](_0x40993a){const _0x351808=a31_0x4a723d,{options:_0x1306f5,args:_0x70596d,tdx:_0x3317a3}=_0x40993a,_0x3937d6=_0x1306f5,_0x41f8c3=_0x70596d[0x0]||_0x1306f5[_0x351808(0xca)];if(!_0x41f8c3)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'+'\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'+_0x351808(0x103)+_0x351808(0x11f)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x25bdee=resolveYamlFile(_0x41f8c3);if(!existsSync(_0x25bdee))return showFileNotFoundError(_0x25bdee,_0x41f8c3),0x1;_0x3937d6['verbose']&&(console[_0x351808(0x112)]('Site:\x20'+_0x3937d6[_0x351808(0x1aa)]),console[_0x351808(0x112)](_0x351808(0x1d3)+_0x25bdee));let _0x58d8a3;try{_0x58d8a3=readFileSync(_0x25bdee,_0x351808(0x261));}catch(_0x1e1627){const _0x466e7a=_0x1e1627 instanceof Error?_0x1e1627[_0x351808(0x19e)]:String(_0x1e1627);return console[_0x351808(0x112)](_0x351808(0x177)+_0x466e7a),0x1;}const _0x4433f0=createCommandSpinner(a31_0x46354d['dim'](_0x351808(0x10e)),{'verbose':_0x3937d6[_0x351808(0x189)]});_0x4433f0[_0x351808(0x10d)]();const _0x5d2251={'onProgress':_0x350539=>{const _0x3e5489=_0x351808;_0x4433f0[_0x3e5489(0x13d)]=formatProgressMessage(_0x350539);}};if(_0x3937d6[_0x351808(0xef)])_0x5d2251[_0x351808(0xef)]=!![];if(_0x3937d6[_0x351808(0x250)])_0x5d2251[_0x351808(0x250)]=!![];_0x3937d6[_0x351808(0x98)]&&(_0x5d2251[_0x351808(0x98)]=_0x3937d6[_0x351808(0x98)]);_0x3937d6[_0x351808(0x131)]&&(_0x5d2251['behavior']=_0x3937d6['behavior']);if(_0x3937d6[_0x351808(0x23c)])_0x5d2251['interval']=_0x3937d6[_0x351808(0x23c)];let _0x1eb989;try{_0x1eb989=await _0x3317a3[_0x351808(0x22b)][_0x351808(0x23a)](_0x58d8a3,_0x5d2251),_0x4433f0[_0x351808(0x1c3)]();}catch(_0x3431bf){_0x4433f0[_0x351808(0x1c3)]();throw _0x3431bf;}const _0x4e8efb=_0x3937d6[_0x351808(0x23c)]||_0x351808(0x254);return this[_0x351808(0x9a)](_0x1eb989,_0x5d2251,_0x25bdee,_0x4e8efb),_0x1eb989[_0x351808(0x1dd)]?0x0:0x1;}[a31_0x4a723d(0x9a)](_0x5c768e,_0x50685a,_0x3c1e7f,_0x354973){const _0x4a3bd9=a31_0x4a723d;console[_0x4a3bd9(0x112)]('\x0a'+a31_0x46354d[_0x4a3bd9(0x249)](_0x4a3bd9(0xb1))+'\x20'+_0x5c768e[_0x4a3bd9(0xd3)]),console['error']('═'[_0x4a3bd9(0xf3)](0x3c)),this[_0x4a3bd9(0x246)](_0x5c768e);if(typeof _0x50685a[_0x4a3bd9(0x98)]===_0x4a3bd9(0x1b9)){this[_0x4a3bd9(0x25b)](_0x5c768e),this[_0x4a3bd9(0x15d)](_0x5c768e),this[_0x4a3bd9(0x133)](_0x3c1e7f,_0x354973,'attribute',_0x50685a[_0x4a3bd9(0x98)]);return;}if(_0x50685a[_0x4a3bd9(0x98)]===!![]){this['displayAttributesStats'](_0x5c768e),this[_0x4a3bd9(0x15d)](_0x5c768e),this[_0x4a3bd9(0x133)](_0x3c1e7f,_0x354973,_0x4a3bd9(0x22f));return;}if(typeof _0x50685a['behavior']===_0x4a3bd9(0x1b9)){this['displayBehaviorsStats'](_0x5c768e,_0x354973),this['displaySummary'](_0x5c768e),this['displayPreviewHints'](_0x3c1e7f,_0x354973,_0x4a3bd9(0x131),_0x50685a[_0x4a3bd9(0x131)]);return;}if(_0x50685a['behavior']===!![]){this[_0x4a3bd9(0x263)](_0x5c768e,_0x354973),this[_0x4a3bd9(0x15d)](_0x5c768e),this[_0x4a3bd9(0x133)](_0x3c1e7f,_0x354973,_0x4a3bd9(0x90));return;}this[_0x4a3bd9(0x25b)](_0x5c768e),this[_0x4a3bd9(0x263)](_0x5c768e,_0x354973),this[_0x4a3bd9(0x253)](_0x5c768e),this[_0x4a3bd9(0x15d)](_0x5c768e),this[_0x4a3bd9(0x133)](_0x3c1e7f,_0x354973,_0x4a3bd9(0x20f));}['displayRealtimeInfo'](_0x104a1c){displayRealtimeValidation(_0x104a1c);}[a31_0x4a723d(0x133)](_0x1871d2,_0x530081,_0x2bfa3b,_0x23219b){const _0x185f82=a31_0x4a723d;console[_0x185f82(0x112)]('\x0a'+a31_0x46354d['dim']('To\x20view\x20sample\x20data:'));const _0x4ede4a=_0x530081!==_0x185f82(0x254)?'\x20--interval\x20'+_0x530081:'';if(_0x2bfa3b==='attribute'&&_0x23219b)console['error']('\x20\x20'+a31_0x46354d['dim']('tdx\x20ps\x20preview\x20'+_0x1871d2+_0x185f82(0xdd)+_0x23219b+'\x22'+_0x4ede4a));else{if(_0x2bfa3b===_0x185f82(0x131)&&_0x23219b)console['error']('\x20\x20'+a31_0x46354d[_0x185f82(0x1a5)](_0x185f82(0x17d)+_0x1871d2+_0x185f82(0x1de)+_0x23219b+'\x22'+_0x4ede4a));else(_0x2bfa3b===_0x185f82(0x22f)||_0x2bfa3b==='all')&&console[_0x185f82(0x112)]('\x20\x20'+a31_0x46354d[_0x185f82(0x1a5)](_0x185f82(0x17d)+_0x1871d2+_0x185f82(0x1d9)+_0x4ede4a));}(_0x2bfa3b===_0x185f82(0x90)||_0x2bfa3b===_0x185f82(0x20f))&&console['error']('\x20\x20'+a31_0x46354d[_0x185f82(0x1a5)]('tdx\x20ps\x20preview\x20'+_0x1871d2+_0x185f82(0x72)+_0x4ede4a)),_0x2bfa3b===_0x185f82(0x20f)&&console[_0x185f82(0x112)]('\x20\x20'+a31_0x46354d['dim'](_0x185f82(0x17d)+_0x1871d2+'\x20--enriched'+_0x4ede4a));}[a31_0x4a723d(0x246)](_0x18faa6){const _0x54eafe=a31_0x4a723d,{master:_0x12169d}=_0x18faa6,_0x3eaa59=_0x12169d[_0x54eafe(0x1f5)]?a31_0x46354d[_0x54eafe(0x1c6)]('✔'):a31_0x46354d['red']('✘');console[_0x54eafe(0x112)]('\x0a'+a31_0x46354d[_0x54eafe(0x1a5)](_0x54eafe(0xe2))),console[_0x54eafe(0x112)](_0x3eaa59+'\x20'+a31_0x46354d[_0x54eafe(0x249)](_0x12169d[_0x54eafe(0xd5)]+'.'+_0x12169d['table'])),_0x12169d[_0x54eafe(0x1f5)]?_0x12169d[_0x54eafe(0x18d)]!==undefined&&console[_0x54eafe(0x112)]('\x20\x20'+a31_0x46354d[_0x54eafe(0x1a5)](_0x54eafe(0xcf))+'\x20'+a31_0x46354d[_0x54eafe(0x15a)](formatRows(_0x12169d[_0x54eafe(0x18d)]))):console[_0x54eafe(0x112)]('\x20\x20'+a31_0x46354d[_0x54eafe(0x175)](_0x54eafe(0x102))+'\x20'+_0x12169d[_0x54eafe(0xad)]);}[a31_0x4a723d(0x25b)](_0x5e8077){const _0x35f1b0=a31_0x4a723d;if(_0x5e8077[_0x35f1b0(0x22f)][_0x35f1b0(0x13f)]===0x0)return;console[_0x35f1b0(0x112)]('\x0a'+a31_0x46354d[_0x35f1b0(0x1a5)](_0x35f1b0(0x225)));for(const _0x12447f of _0x5e8077[_0x35f1b0(0x22f)]){const _0x1d5a23=_0x12447f['schemaValid']?a31_0x46354d[_0x35f1b0(0x1c6)]('✔'):a31_0x46354d['red']('✘');let _0x10d0fe='';if(_0x12447f[_0x35f1b0(0x1f5)]&&_0x12447f[_0x35f1b0(0x1bd)]!==undefined&&_0x12447f[_0x35f1b0(0x145)]!==undefined){const _0x2a3a91=_0x12447f[_0x35f1b0(0x145)][_0x35f1b0(0x185)](0x1),_0x320765=_0x12447f[_0x35f1b0(0x145)]>=0x50?a31_0x46354d['green']:_0x12447f[_0x35f1b0(0x145)]>=0x32?a31_0x46354d[_0x35f1b0(0x264)]:a31_0x46354d[_0x35f1b0(0x175)];_0x10d0fe='\x20'+a31_0x46354d[_0x35f1b0(0x1a5)]('Coverage:')+'\x20'+_0x320765(_0x2a3a91+'%')+'\x20('+formatRows(_0x12447f[_0x35f1b0(0x1bd)])+'\x20rows)';}console[_0x35f1b0(0x112)](_0x1d5a23+'\x20'+a31_0x46354d[_0x35f1b0(0x249)](_0x12447f['name'])+_0x10d0fe),console[_0x35f1b0(0x112)]('\x20\x20'+a31_0x46354d[_0x35f1b0(0x1a5)]('Source:')+'\x20'+a31_0x46354d[_0x35f1b0(0x249)](_0x12447f['database']+'.'+_0x12447f[_0x35f1b0(0x91)]));const _0x2cbb3a=_0x12447f[_0x35f1b0(0xed)]===_0x12447f[_0x35f1b0(0xbd)]?a31_0x46354d[_0x35f1b0(0x1a5)]('Join\x20on:')+'\x20'+_0x12447f[_0x35f1b0(0xed)]:a31_0x46354d['dim'](_0x35f1b0(0x193))+'\x20'+_0x12447f[_0x35f1b0(0xed)]+'\x20=\x20'+_0x12447f[_0x35f1b0(0xbd)];console['error']('\x20\x20'+_0x2cbb3a),console['error']('\x20\x20'+a31_0x46354d[_0x35f1b0(0x1a5)](_0x35f1b0(0x140))),this[_0x35f1b0(0x1c2)](_0x12447f[_0x35f1b0(0x118)]),!_0x12447f[_0x35f1b0(0x1f5)]&&console[_0x35f1b0(0x112)]('\x20\x20'+a31_0x46354d[_0x35f1b0(0x175)]('Error:')+'\x20'+_0x12447f['schemaError']);}}[a31_0x4a723d(0x263)](_0x38d462,_0x3e57fb){const _0x5a35b2=a31_0x4a723d;if(_0x38d462['behaviors'][_0x5a35b2(0x13f)]===0x0)return;console[_0x5a35b2(0x112)]('\x0a'+a31_0x46354d[_0x5a35b2(0x1a5)](_0x5a35b2(0x1bb))+'\x20'+a31_0x46354d['dim']('('+_0x3e57fb+')'));for(const _0x3131d8 of _0x38d462[_0x5a35b2(0x90)]){const _0x1de69d=_0x3131d8[_0x5a35b2(0x1f5)]?a31_0x46354d[_0x5a35b2(0x1c6)]('✔'):a31_0x46354d[_0x5a35b2(0x175)]('✘');let _0x59cd82='';if(_0x3131d8[_0x5a35b2(0x1f5)]&&_0x3131d8['customersWithEvents']!==undefined&&_0x3131d8[_0x5a35b2(0xf7)]!==undefined){const _0x14eae5=_0x3131d8[_0x5a35b2(0x1cd)]?.[_0x5a35b2(0x185)](0x1)||'?',_0x288268=(_0x3131d8['customerPercent']??0x0)>=0x32?a31_0x46354d[_0x5a35b2(0x1c6)]:(_0x3131d8[_0x5a35b2(0x1cd)]??0x0)>=0x14?a31_0x46354d[_0x5a35b2(0x264)]:a31_0x46354d[_0x5a35b2(0x175)];_0x59cd82='\x20'+a31_0x46354d[_0x5a35b2(0x1a5)](_0x5a35b2(0x1b3))+'\x20'+_0x288268(formatRows(_0x3131d8[_0x5a35b2(0x84)]))+'\x20('+_0x14eae5+_0x5a35b2(0xb6)+a31_0x46354d['dim'](_0x5a35b2(0x237))+'\x20'+a31_0x46354d[_0x5a35b2(0x15a)](formatRows(_0x3131d8[_0x5a35b2(0xf7)]));}console[_0x5a35b2(0x112)](_0x1de69d+'\x20'+a31_0x46354d[_0x5a35b2(0x249)](_0x3131d8[_0x5a35b2(0xd3)])+_0x59cd82),console[_0x5a35b2(0x112)]('\x20\x20'+a31_0x46354d['dim']('Source:')+'\x20'+a31_0x46354d[_0x5a35b2(0x249)](_0x3131d8['database']+'.'+_0x3131d8[_0x5a35b2(0x91)]));const _0x1bd400=_0x3131d8[_0x5a35b2(0xed)]===_0x3131d8[_0x5a35b2(0xbd)]?a31_0x46354d[_0x5a35b2(0x1a5)]('Join\x20on:')+'\x20'+_0x3131d8['joinKey']:a31_0x46354d[_0x5a35b2(0x1a5)](_0x5a35b2(0x193))+'\x20'+_0x3131d8[_0x5a35b2(0xed)]+_0x5a35b2(0xa5)+_0x3131d8['foreignKey'];console[_0x5a35b2(0x112)]('\x20\x20'+_0x1bd400),console[_0x5a35b2(0x112)]('\x20\x20'+a31_0x46354d[_0x5a35b2(0x1a5)]('Columns:')),this[_0x5a35b2(0x1c2)](_0x3131d8['columns']),!_0x3131d8[_0x5a35b2(0x1f5)]&&console[_0x5a35b2(0x112)]('\x20\x20'+a31_0x46354d[_0x5a35b2(0x175)](_0x5a35b2(0x102))+'\x20'+_0x3131d8[_0x5a35b2(0xad)]);}}[a31_0x4a723d(0x1c2)](_0x311798){const _0x498b8e=a31_0x4a723d;for(const _0x289568 of _0x311798){_0x289568[_0x498b8e(0x80)]===_0x289568[_0x498b8e(0x23f)]||_0x289568[_0x498b8e(0x23f)]==='*'?console[_0x498b8e(0x112)]('\x20\x20\x20\x20-\x20'+_0x289568[_0x498b8e(0x80)]):console[_0x498b8e(0x112)](_0x498b8e(0x20e)+_0x289568[_0x498b8e(0x80)]+'\x20'+a31_0x46354d[_0x498b8e(0x1a5)]('('+_0x289568['column']+')'));}}[a31_0x4a723d(0x15d)](_0x4b51fa){const _0x15542c=a31_0x4a723d;console[_0x15542c(0x112)]('─'[_0x15542c(0xf3)](0x3c));if(_0x4b51fa['errors'][_0x15542c(0x13f)]>0x0){console['error']('\x0a'+a31_0x46354d[_0x15542c(0x175)](_0x15542c(0x81)));for(const _0x57da3e of _0x4b51fa[_0x15542c(0x200)]){console[_0x15542c(0x112)]('\x20\x20'+a31_0x46354d[_0x15542c(0x175)]('•')+'\x20'+_0x57da3e);}}_0x4b51fa[_0x15542c(0x1dd)]&&console['error']('\x0a'+a31_0x46354d['green']('✔')+_0x15542c(0x20b));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x4a723d(0xd3)]='segment:parent:preview';[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x159);async[a31_0x4a723d(0x1bf)](_0x19b6e2){const _0x528943=a31_0x4a723d,{options:_0x5432bf,args:_0x4e07b2,tdx:_0x87147}=_0x19b6e2,_0x597936=_0x5432bf,_0xe9e6eb=_0x4e07b2[0x0]||_0x5432bf[_0x528943(0xca)];if(!_0xe9e6eb)return showParentSegmentNotSetError(_0x528943(0x1fe)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+'Options\x20(one\x20required):\x0a'+_0x528943(0x1db)+_0x528943(0x1b0)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x528943(0x1f0)),0x1;if(!_0x597936[_0x528943(0xef)]&&!_0x597936[_0x528943(0x98)]&&!_0x597936[_0x528943(0x131)]&&!_0x597936[_0x528943(0x250)])return console['error'](a31_0x46354d[_0x528943(0x175)](_0x528943(0x1ea))),console['error'](_0x528943(0x12e)),console[_0x528943(0x112)](_0x528943(0x21b)),console[_0x528943(0x112)](_0x528943(0x259)),console['error']('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x528943(0x112)](_0x528943(0x149)),console[_0x528943(0x112)](_0x528943(0x233)),0x1;const _0x5802fe=resolveYamlFile(_0xe9e6eb);if(!existsSync(_0x5802fe))return showFileNotFoundError(_0x5802fe,_0xe9e6eb),0x1;_0x597936['verbose']&&(console[_0x528943(0x112)](_0x528943(0x6f)+_0x597936[_0x528943(0x1aa)]),console[_0x528943(0x112)](_0x528943(0x1d3)+_0x5802fe));let _0x13a3c7;try{_0x13a3c7=readFileSync(_0x5802fe,'utf-8');}catch(_0xdb6d57){const _0x5585ea=_0xdb6d57 instanceof Error?_0xdb6d57[_0x528943(0x19e)]:String(_0xdb6d57);return console[_0x528943(0x112)]('Error\x20reading\x20file:\x20'+_0x5585ea),0x1;}let _0x37651a;try{_0x37651a=parseDef(_0x13a3c7);}catch(_0x3b46e9){const _0x3bdbee=_0x3b46e9 instanceof Error?_0x3b46e9['message']:String(_0x3b46e9);return console[_0x528943(0x112)](a31_0x46354d[_0x528943(0x175)](_0x528943(0x247)+_0x3bdbee)),0x1;}if(_0x597936[_0x528943(0x98)]===!![]||_0x597936[_0x528943(0x98)]===''){const _0x58b989=_0x37651a[_0x528943(0x22f)]?.[_0x528943(0xd7)](_0x325e24=>_0x325e24[_0x528943(0xd3)])||[];if(_0x58b989[_0x528943(0x13f)]===0x0)console['error'](a31_0x46354d[_0x528943(0x175)](_0x528943(0x12d)));else{console[_0x528943(0x112)](a31_0x46354d[_0x528943(0x175)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x528943(0x112)](_0x528943(0x124));for(const _0xf551a6 of _0x58b989){console[_0x528943(0x112)]('\x20\x20'+a31_0x46354d['cyan'](_0xf551a6));}console[_0x528943(0x112)](_0x528943(0x14a)+_0xe9e6eb+_0x528943(0xdd)+_0x58b989[0x0]+'\x22');}return 0x1;}if(_0x597936['behavior']===!![]||_0x597936[_0x528943(0x131)]===''){const _0x4d4e9e=_0x37651a[_0x528943(0x90)]?.['map'](_0x9f902a=>_0x9f902a[_0x528943(0xd3)])||[];if(_0x4d4e9e[_0x528943(0x13f)]===0x0)console[_0x528943(0x112)](a31_0x46354d[_0x528943(0x175)](_0x528943(0x15e)));else{console[_0x528943(0x112)](a31_0x46354d['red'](_0x528943(0x14c))),console[_0x528943(0x112)](_0x528943(0x184));for(const _0x5f6d1f of _0x4d4e9e){console[_0x528943(0x112)]('\x20\x20'+a31_0x46354d[_0x528943(0x15a)](_0x5f6d1f));}console[_0x528943(0x112)](_0x528943(0x14a)+_0xe9e6eb+_0x528943(0x1de)+_0x4d4e9e[0x0]+'\x22');}return 0x1;}const _0x586d19=createCommandSpinner(a31_0x46354d['dim'](_0x528943(0x94)),{'verbose':_0x597936[_0x528943(0x189)]});_0x586d19['start']();const _0x1e657d={'onProgress':_0xf1c176=>{const _0x402011=_0x528943;_0x586d19[_0x402011(0x13d)]=formatProgressMessage(_0xf1c176);}};if(_0x597936[_0x528943(0xef)])_0x1e657d[_0x528943(0xef)]=!![];if(_0x597936[_0x528943(0x98)]&&typeof _0x597936[_0x528943(0x98)]===_0x528943(0x1b9))_0x1e657d[_0x528943(0x98)]=_0x597936[_0x528943(0x98)];if(_0x597936[_0x528943(0x131)]&&typeof _0x597936[_0x528943(0x131)]===_0x528943(0x1b9))_0x1e657d[_0x528943(0x131)]=_0x597936[_0x528943(0x131)];if(_0x597936[_0x528943(0x250)])_0x1e657d[_0x528943(0x250)]=!![];if(_0x597936[_0x528943(0x23c)])_0x1e657d[_0x528943(0x23c)]=_0x597936['interval'];let _0x2af90f;try{_0x2af90f=await _0x87147['segment'][_0x528943(0x15f)](_0x13a3c7,_0x1e657d),_0x586d19['stop']();}catch(_0x430574){_0x586d19[_0x528943(0x1c3)]();throw _0x430574;}return await this['displayPreviewResults'](_0x2af90f,{'master':_0x597936[_0x528943(0xef)],'attribute':typeof _0x597936[_0x528943(0x98)]==='string'?_0x597936[_0x528943(0x98)]:undefined,'behavior':typeof _0x597936[_0x528943(0x131)]===_0x528943(0x1b9)?_0x597936['behavior']:undefined,'enriched':_0x597936[_0x528943(0x250)]}),_0x2af90f[_0x528943(0x1dd)]?0x0:0x1;}async[a31_0x4a723d(0xaa)](_0x10e653,_0x14f312){const _0x35e640=a31_0x4a723d;console['error']('\x0a'+a31_0x46354d[_0x35e640(0x249)](_0x35e640(0x77))+'\x20'+_0x10e653[_0x35e640(0xd3)]),console[_0x35e640(0x112)]('═'[_0x35e640(0xf3)](0x3c));if(_0x14f312['master']&&_0x10e653['sampleData']){const _0x4becf0=a31_0x46354d[_0x35e640(0x1a5)]('Master:')+'\x20'+a31_0x46354d[_0x35e640(0x249)](_0x10e653[_0x35e640(0xef)][_0x35e640(0xd5)]+'.'+_0x10e653['master'][_0x35e640(0x91)]);await this['displaySampleData'](_0x4becf0,_0x10e653[_0x35e640(0x101)]);}else{if(_0x14f312[_0x35e640(0x98)]&&_0x10e653[_0x35e640(0x101)]){const _0x475bff=a31_0x46354d[_0x35e640(0x1a5)](_0x35e640(0x173))+'\x20'+a31_0x46354d[_0x35e640(0x249)](_0x14f312[_0x35e640(0x98)]);await this[_0x35e640(0x113)](_0x475bff,_0x10e653[_0x35e640(0x101)]);}else{if(_0x14f312[_0x35e640(0x131)]&&_0x10e653['sampleData']){const _0x2e630c=a31_0x46354d[_0x35e640(0x1a5)]('Behavior:')+'\x20'+a31_0x46354d[_0x35e640(0x249)](_0x14f312[_0x35e640(0x131)]);await this[_0x35e640(0x113)](_0x2e630c,_0x10e653[_0x35e640(0x101)]);}else{if(_0x14f312['enriched']&&_0x10e653['sampleData']){const _0x40ea03=a31_0x46354d[_0x35e640(0x1a5)](_0x35e640(0x206))+'\x20'+a31_0x46354d[_0x35e640(0x249)](_0x35e640(0x1e8));await this[_0x35e640(0x113)](_0x40ea03,_0x10e653[_0x35e640(0x101)]);}else!_0x10e653[_0x35e640(0x101)]&&console[_0x35e640(0x112)](_0x35e640(0xc2));}}}if(_0x10e653[_0x35e640(0x200)][_0x35e640(0x13f)]>0x0){console[_0x35e640(0x112)]('─'[_0x35e640(0xf3)](0x3c)),console[_0x35e640(0x112)]('\x0a'+a31_0x46354d[_0x35e640(0x175)]('Errors:'));for(const _0x56dafb of _0x10e653[_0x35e640(0x200)]){console['error']('\x20\x20'+a31_0x46354d[_0x35e640(0x175)]('•')+'\x20'+_0x56dafb);}}}async[a31_0x4a723d(0x113)](_0x2065fe,_0x2aceed){const _0x506ce3=a31_0x4a723d;if(_0x2aceed[_0x506ce3(0x13f)]===0x0){console[_0x506ce3(0x112)]('\x0a'+_0x2065fe),console[_0x506ce3(0x112)](_0x506ce3(0x1a8));return;}console[_0x506ce3(0x112)]('\x0a'+_0x2065fe);const _0x5767e0=Object[_0x506ce3(0x151)](_0x2aceed[0x0])[_0x506ce3(0xd7)](_0x23e85a=>({'name':_0x23e85a,'type':typeof _0x2aceed[0x0][_0x23e85a]==='number'?'double':_0x506ce3(0x8b)})),_0x4de1be={'queryId':_0x506ce3(0x1a2),'columns':_0x5767e0,'data':_0x2aceed,'stats':{'state':_0x506ce3(0xdc),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2aceed[_0x506ce3(0x13f)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x1191ee=formatAsTable(_0x4de1be,_0x2aceed[_0x506ce3(0x13f)],!![]);await writeOutput(_0x1191ee,undefined,_0x506ce3(0x91));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x74);['description']='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a31_0x4a723d(0x1bf)](_0x4ced03){const _0x55ce46=a31_0x4a723d,{options:_0x472c48,args:_0x5d8049,tdx:_0x9fa793}=_0x4ced03,_0x102aa4=_0x472c48,_0x4d2fde=_0x5d8049[0x0]||_0x472c48[_0x55ce46(0xca)];if(!_0x4d2fde)return showParentSegmentNotSetError(_0x55ce46(0x1af)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x33aaa8=resolveYamlFile(_0x4d2fde);if(existsSync(_0x33aaa8)){_0x102aa4[_0x55ce46(0x189)]&&console[_0x55ce46(0x112)]('Found\x20YAML\x20file:\x20'+_0x33aaa8);let _0x600bbb;try{_0x600bbb=readFileSync(_0x33aaa8,_0x55ce46(0x261));}catch(_0x45845e){const _0x3e295a=_0x45845e instanceof Error?_0x45845e[_0x55ce46(0x19e)]:String(_0x45845e);return console['error'](_0x55ce46(0x177)+_0x3e295a),0x1;}const _0x56fe0f=await withSpinner(_0x55ce46(0x82),()=>_0x9fa793[_0x55ce46(0x22b)][_0x55ce46(0x181)](_0x600bbb),{'verbose':_0x102aa4[_0x55ce46(0x189)]}),_0x26b348=_0x56fe0f[_0x55ce46(0x134)],{isNew:_0x3a12c5,name:_0xe90f2c,hasChanges:_0x3ca7ee,diffFormatted:_0x76a1cd}=_0x26b348;if(_0x3ca7ee){_0x3a12c5?console['error'](_0x55ce46(0x23e)+_0xe90f2c+'\x27:'):console[_0x55ce46(0x112)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0xe90f2c+'\x27:');console[_0x55ce46(0x112)]('─'[_0x55ce46(0xf3)](0x3c)),console['error'](_0x76a1cd),console[_0x55ce46(0x112)]('─'[_0x55ce46(0xf3)](0x3c));const _0x45096f=_0x3a12c5?_0x55ce46(0xa4)+_0xe90f2c+_0x55ce46(0x1c1):_0x55ce46(0x11c)+_0xe90f2c+_0x55ce46(0x1c1);if(!_0x102aa4['yes']){if(!isInteractive())return console[_0x55ce46(0x112)](a31_0x46354d[_0x55ce46(0x175)](_0x55ce46(0x1b2)),_0x55ce46(0xa9)),console['error'](a31_0x46354d['dim'](_0x55ce46(0x110))),0x1;const _0x3ba6ef=await confirmKey(_0x45096f);if(!_0x3ba6ef)return console[_0x55ce46(0x112)](a31_0x46354d[_0x55ce46(0x264)](_0x55ce46(0x7b))),0x1;}const _0x44d32a=_0x3a12c5?_0x55ce46(0xe1):_0x55ce46(0x161);await withSpinner(_0x44d32a+_0x55ce46(0xfd)+_0xe90f2c+_0x55ce46(0x6c),()=>_0x26b348[_0x55ce46(0x1a1)](),{'verbose':_0x102aa4[_0x55ce46(0x189)]});const _0x2359cc=_0x3a12c5?_0x55ce46(0x183):_0x55ce46(0xfe);console['error']('✔\x20'+_0x2359cc+'\x20parent\x20segment\x20\x27'+_0xe90f2c+'\x27');}else console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0xe90f2c+_0x55ce46(0x176));}const _0x254bc2=await withSpinner(_0x55ce46(0x23b)+_0x4d2fde+'\x27...',()=>_0x9fa793[_0x55ce46(0x22b)]['runParent'](_0x4d2fde),{'verbose':_0x102aa4[_0x55ce46(0x189)]}),_0x3a9ce3=_0x254bc2['data'],_0x270e4f=getConsoleUrl(_0x102aa4[_0x55ce46(0x1aa)],_0x55ce46(0x106)+_0x3a9ce3[_0x55ce46(0x1ec)]+_0x55ce46(0x195)+_0x3a9ce3[_0x55ce46(0x7c)]+_0x55ce46(0x15b)+_0x3a9ce3[_0x55ce46(0x130)]);return console[_0x55ce46(0x112)](_0x55ce46(0x139)),console['error']('\x20\x20'+a31_0x46354d[_0x55ce46(0x1a5)](_0x55ce46(0x1b8))+'\x20'+_0x3a9ce3[_0x55ce46(0x198)]),console[_0x55ce46(0x112)]('\x20\x20'+a31_0x46354d[_0x55ce46(0x1a5)](_0x55ce46(0x1c5))+'\x20'+_0x3a9ce3[_0x55ce46(0xcb)]),console[_0x55ce46(0x112)]('\x20\x20'+a31_0x46354d[_0x55ce46(0x1a5)](_0x55ce46(0x24f))+'\x20'+_0x3a9ce3[_0x55ce46(0x7c)]),console[_0x55ce46(0x112)]('\x20\x20'+a31_0x46354d[_0x55ce46(0x1a5)](_0x55ce46(0x111))+'\x20'+_0x3a9ce3[_0x55ce46(0x130)]),console[_0x55ce46(0x112)]('\x20\x20'+_0x270e4f),console['error']('\x0a'+a31_0x46354d[_0x55ce46(0x1a5)](_0x55ce46(0x243))+'\x20tdx\x20wf\x20attempt\x20'+_0x3a9ce3['workflowAttemptId']+_0x55ce46(0x1e6)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x22a);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x1e3);async[a31_0x4a723d(0x1bf)](_0x1e846d){const _0x172bf6=a31_0x4a723d,{options:_0x32dc54,args:_0x2af1b6,tdx:_0x220ec3}=_0x1e846d,_0xbf0226=_0x2af1b6[0x0]||_0x32dc54[_0x172bf6(0xca)];if(!_0xbf0226)return showParentSegmentNotSetError(_0x172bf6(0x155)+_0x172bf6(0x13b)),0x1;_0x32dc54[_0x172bf6(0x189)]&&(console[_0x172bf6(0x112)](_0x172bf6(0x6f)+_0x32dc54[_0x172bf6(0x1aa)]),console['error'](_0x172bf6(0xec)+_0xbf0226));const _0x3f8089=await withSpinner(_0x172bf6(0xb8)+_0xbf0226+_0x172bf6(0x6c),()=>_0x220ec3['segment']['listFields'](_0xbf0226),{'verbose':_0x32dc54[_0x172bf6(0x189)]}),_0x2fa921=_0x3f8089[_0x172bf6(0x134)];console[_0x172bf6(0x112)]('✔\x20Found\x20'+_0x2fa921[_0x172bf6(0x13f)]+_0x172bf6(0x21d)+(_0x2fa921[_0x172bf6(0x13f)]!==0x1?'s':''));if(_0x32dc54[_0x172bf6(0xea)]||_0x32dc54[_0x172bf6(0x1d5)])return await handleSDKOutput(_0x2fa921,_0x32dc54),0x0;return displayFieldsHumanReadable(_0x2fa921,_0xbf0226),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x4a723d(0xd3)]='segment:parent:view';[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x150);async[a31_0x4a723d(0x1bf)](_0xe34012){const _0x1abda0=a31_0x4a723d,{options:_0x3ac3e8,args:_0x1531dd,tdx:_0x46a9c1}=_0xe34012,_0x461587=_0x3ac3e8,_0x38d4a6=_0x1531dd[0x0]||_0x3ac3e8[_0x1abda0(0xca)];if(!_0x38d4a6)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'+_0x1abda0(0x1a6)+_0x1abda0(0x79)+_0x1abda0(0x171)),0x1;_0x3ac3e8['verbose']&&(console[_0x1abda0(0x112)](_0x1abda0(0x6f)+_0x3ac3e8[_0x1abda0(0x1aa)]),console[_0x1abda0(0x112)](_0x1abda0(0xec)+_0x38d4a6));const _0x4a63be=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x38d4a6+_0x1abda0(0x6c),()=>_0x46a9c1['segment'][_0x1abda0(0x162)](_0x38d4a6),{'verbose':_0x3ac3e8[_0x1abda0(0x189)]}),_0x311c12=_0x4a63be[_0x1abda0(0x134)];if(_0x461587[_0x1abda0(0x1c4)]){const _0x31d731=getConsoleNextUrl(_0x461587[_0x1abda0(0x1aa)],'/app/dw/parentSegments/'+_0x311c12['id']);return console[_0x1abda0(0x112)](a31_0x46354d[_0x1abda0(0x1c6)]('✔')+'\x20Opening\x20'+a31_0x46354d[_0x1abda0(0x15a)](_0x31d731)),openBrowser(_0x31d731),0x0;}return await handleSingleObjectOutput(_0x311c12,_0x3ac3e8),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x4a723d(0xd3)]='segment:parent:desc';[a31_0x4a723d(0x9e)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x5d368f){const _0x5b3bb1=a31_0x4a723d,{options:_0x4cba86,args:_0xe336b,tdx:_0x52dd01}=_0x5d368f,_0x589557=_0x4cba86,_0x42912a=_0xe336b[0x0]||_0x4cba86[_0x5b3bb1(0xca)];if(!_0x42912a)return showParentSegmentNotSetError(_0x5b3bb1(0x239)+'\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'+_0x5b3bb1(0x79)+_0x5b3bb1(0xc4)),0x1;_0x4cba86[_0x5b3bb1(0x189)]&&(console[_0x5b3bb1(0x112)](_0x5b3bb1(0x6f)+_0x4cba86['site']),console[_0x5b3bb1(0x112)](_0x5b3bb1(0xec)+_0x42912a));const _0x5cc5d1=await withSpinner(_0x5b3bb1(0x16e)+_0x42912a+_0x5b3bb1(0x6c),()=>_0x52dd01[_0x5b3bb1(0x22b)][_0x5b3bb1(0x117)](_0x42912a),{'verbose':_0x4cba86['verbose']}),_0x190d4d=_0x5cc5d1['data'],_0x462e0f=_0x52dd01[_0x5b3bb1(0x22b)]['getOutputDatabaseName'](_0x190d4d);if(_0x589557[_0x5b3bb1(0x212)]){const _0x30d52c=await this[_0x5b3bb1(0x143)](_0x5d368f,_0x42912a,_0x190d4d,_0x462e0f),_0x1b4933=this[_0x5b3bb1(0x1f2)](_0x30d52c);writeFileSync(_0x589557[_0x5b3bb1(0x212)],_0x1b4933);const _0x99bd10=_0x30d52c[_0x5b3bb1(0x236)][_0x5b3bb1(0x118)][_0x5b3bb1(0x13f)]+_0x30d52c[_0x5b3bb1(0x90)][_0x5b3bb1(0x1ad)]((_0x22d2f4,_0x1c0c60)=>_0x22d2f4+_0x1c0c60[_0x5b3bb1(0x118)][_0x5b3bb1(0x13f)],0x0),_0x580674=_0x30d52c[_0x5b3bb1(0x90)][_0x5b3bb1(0x169)](_0x2dbede=>_0x2dbede['columns'][_0x5b3bb1(0x13f)]===0x0)['length'];return console[_0x5b3bb1(0x69)](_0x5b3bb1(0xb2)+_0x589557[_0x5b3bb1(0x212)]),console[_0x5b3bb1(0x69)](_0x5b3bb1(0x125)+_0x462e0f),console[_0x5b3bb1(0x69)](_0x5b3bb1(0xc1)+_0x30d52c[_0x5b3bb1(0x90)]['length']+'\x20behaviors'),console['log']('\x20\x20Columns:\x20'+_0x99bd10+_0x5b3bb1(0xe8)),_0x580674>0x0&&console['log'](_0x5b3bb1(0x21f)+_0x580674+_0x5b3bb1(0x244)),0x0;}console['error']('\x0a'+a31_0x46354d[_0x5b3bb1(0x249)](_0x5b3bb1(0x1ca))+'\x20'+a31_0x46354d[_0x5b3bb1(0x15a)](_0x462e0f));const _0xc6f265=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x52dd01['segment']['getParentSQL'](_0x190d4d),{'verbose':_0x4cba86['verbose']});console[_0x5b3bb1(0x112)]('\x0a'+a31_0x46354d['bold'](_0x5b3bb1(0x236))+'\x20'+a31_0x46354d[_0x5b3bb1(0x1a5)]('('+_0x462e0f+'.customers)'));const _0xb8beef=await executeSchemaQuery(_0xc6f265[_0x5b3bb1(0x134)],_0x52dd01,_0x4cba86);await handleQueryOutput(_0xb8beef,_0x4cba86);const _0xe0edfd=await withSpinner(_0x5b3bb1(0x188),()=>_0x52dd01[_0x5b3bb1(0x22b)][_0x5b3bb1(0x272)](_0x190d4d),{'verbose':_0x4cba86['verbose']});for(const _0x5d8257 of _0xe0edfd['data']){const _0x478f48=_0x5b3bb1(0x235)+_0x5d8257['toLowerCase']()[_0x5b3bb1(0x92)](/\s+/g,'_'),_0x31f4ed='SELECT\x20*\x20FROM\x20'+_0x462e0f+'.'+_0x478f48;console[_0x5b3bb1(0x112)]('\x0a'+a31_0x46354d[_0x5b3bb1(0x249)](_0x5d8257)+'\x20'+a31_0x46354d[_0x5b3bb1(0x1a5)]('('+_0x462e0f+'.'+_0x478f48+')'));try{const _0x3ebce8=await executeSchemaQuery(_0x31f4ed,_0x52dd01,_0x4cba86);await handleQueryOutput(_0x3ebce8,_0x4cba86);}catch{console[_0x5b3bb1(0x112)](a31_0x46354d[_0x5b3bb1(0x264)](_0x5b3bb1(0x95)));}}return 0x0;}async[a31_0x4a723d(0x143)](_0x37a66a,_0x2cfc0e,_0x5987e2,_0x2c353d){const _0x251d9c=a31_0x4a723d,{options:_0x2cb3ab,tdx:_0x1e44ea}=_0x37a66a,_0x855268=await withSpinner(_0x251d9c(0x25f),()=>_0x1e44ea[_0x251d9c(0x22b)][_0x251d9c(0x1e2)](_0x5987e2),{'verbose':_0x2cb3ab[_0x251d9c(0x189)]}),_0x3fadb8=await executeSchemaQuery(_0x855268[_0x251d9c(0x134)],_0x1e44ea,_0x2cb3ab),_0x22893d=_0x3fadb8[_0x251d9c(0x134)][_0x251d9c(0xd7)](_0x20bb86=>({'name':_0x20bb86['column_name'],'type':_0x20bb86[_0x251d9c(0x17b)]})),_0x520261=await withSpinner(_0x251d9c(0x188),()=>_0x1e44ea['segment'][_0x251d9c(0x272)](_0x5987e2),{'verbose':_0x2cb3ab[_0x251d9c(0x189)]}),_0x3c4cfb=[];for(const _0x21d2e0 of _0x520261['data']){const _0x560ed6=_0x251d9c(0x235)+_0x21d2e0[_0x251d9c(0xe5)]()[_0x251d9c(0x92)](/\s+/g,'_'),_0x2bd173='SELECT\x20*\x20FROM\x20'+_0x2c353d+'.'+_0x560ed6;let _0x4b2afd=[];try{const _0x4cb9a0=await executeSchemaQuery(_0x2bd173,_0x1e44ea,_0x2cb3ab);_0x4b2afd=_0x4cb9a0['data']['map'](_0x4c0e7b=>({'name':_0x4c0e7b['column_name'],'type':_0x4c0e7b[_0x251d9c(0x17b)]}));}catch{}_0x3c4cfb[_0x251d9c(0x167)]({'table':_0x560ed6,'columns':_0x4b2afd});}return{'database':_0x2c353d,'parent_segment':_0x2cfc0e,'parent_id':_0x5987e2,'customers':{'table':'customers','columns':_0x22893d},'behaviors':_0x3c4cfb};}[a31_0x4a723d(0x1f2)](_0x55106a){const _0x7bf23e=a31_0x4a723d,_0x20c144=_0xdc5092=>{const _0x1e7fba=a31_0x93c7;if(_0xdc5092['length']===0x0)return'[]';const _0x503beb=_0xdc5092['map'](_0x2e362e=>_0x1e7fba(0x262)+_0x2e362e[_0x1e7fba(0xd3)]+'\x22,\x20\x22type\x22:\x20\x22'+_0x2e362e[_0x1e7fba(0xa6)]+_0x1e7fba(0x8d));return'[\x0a'+_0x503beb[_0x1e7fba(0x108)](',\x0a')+_0x1e7fba(0xbe);},_0x3a4967=_0x55106a[_0x7bf23e(0x90)][_0x7bf23e(0xd7)](_0x1bed65=>{const _0x5b7bcd=_0x7bf23e;return _0x5b7bcd(0x18b)+_0x1bed65[_0x5b7bcd(0x91)]+_0x5b7bcd(0xd1)+_0x20c144(_0x1bed65[_0x5b7bcd(0x118)])[_0x5b7bcd(0x92)](/^/gm,'\x20\x20')[_0x5b7bcd(0x266)]()+_0x5b7bcd(0x1b7);})[_0x7bf23e(0x108)](',\x0a');return _0x7bf23e(0x224)+_0x55106a[_0x7bf23e(0xd5)]+_0x7bf23e(0x19d)+_0x55106a['parent_segment']+_0x7bf23e(0xa8)+_0x55106a[_0x7bf23e(0xfa)]+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x55106a['customers'][_0x7bf23e(0x91)]+_0x7bf23e(0x207)+_0x20c144(_0x55106a['customers'][_0x7bf23e(0x118)])[_0x7bf23e(0x92)](/^/gm,'\x20\x20')[_0x7bf23e(0x266)]()+_0x7bf23e(0x230)+_0x3a4967+_0x7bf23e(0x1ce);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a31_0x4a723d(0x16d);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0xd0);async[a31_0x4a723d(0x1bf)](_0x29d46d){const _0x5b26fa=a31_0x4a723d,{options:_0x2109b3,args:_0x16c19c,tdx:_0x4f61cd}=_0x29d46d,_0x1934ca=_0x16c19c[0x0]||_0x2109b3[_0x5b26fa(0xca)];if(!_0x1934ca)return showParentSegmentNotSetError(_0x5b26fa(0x160)+'\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;_0x2109b3[_0x5b26fa(0x189)]&&(console[_0x5b26fa(0x112)]('Site:\x20'+_0x2109b3[_0x5b26fa(0x1aa)]),console[_0x5b26fa(0x112)](_0x5b26fa(0xec)+_0x1934ca));const _0x1d012a=await withSpinner(_0x5b26fa(0x16e)+_0x1934ca+'\x27...',()=>_0x4f61cd[_0x5b26fa(0x22b)][_0x5b26fa(0x117)](_0x1934ca),{'verbose':_0x2109b3[_0x5b26fa(0x189)]}),_0x36934d=_0x1d012a[_0x5b26fa(0x134)],_0x1f23b1=await withSpinner(_0x5b26fa(0x252)+_0x1934ca+_0x5b26fa(0x6c),()=>_0x4f61cd[_0x5b26fa(0x22b)]['getParentSQL'](_0x36934d),{'verbose':_0x2109b3[_0x5b26fa(0x189)]}),_0x552838=_0x1f23b1[_0x5b26fa(0x134)];return _0x2109b3[_0x5b26fa(0x6b)]===_0x5b26fa(0xea)||_0x2109b3[_0x5b26fa(0x6b)]===_0x5b26fa(0x1d5)?await handleSDKOutput([{'sql':_0x552838}],_0x2109b3):console[_0x5b26fa(0x69)](_0x552838),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x1ba);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x232);async[a31_0x4a723d(0x1bf)](_0xf2570d){const _0x5020c9=a31_0x4a723d,{options:_0x1cfa89,args:_0x26a881,tdx:_0x59c3f0}=_0xf2570d,_0x500792=_0x26a881[0x0]||_0x1cfa89[_0x5020c9(0xca)];if(!_0x500792)return showParentSegmentNotSetError(_0x5020c9(0xb9)+_0x5020c9(0x1f4)),0x1;_0x1cfa89['verbose']&&(console['error'](_0x5020c9(0x6f)+_0x1cfa89[_0x5020c9(0x1aa)]),console[_0x5020c9(0x112)](_0x5020c9(0xec)+_0x500792));const _0x369ac5=await withSpinner(_0x5020c9(0x16e)+_0x500792+_0x5020c9(0x6c),()=>_0x59c3f0[_0x5020c9(0x22b)][_0x5020c9(0x117)](_0x500792),{'verbose':_0x1cfa89['verbose']}),_0x19712d=_0x369ac5[_0x5020c9(0x134)],_0x2921f9=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x500792+_0x5020c9(0x6c),()=>_0x59c3f0['segment'][_0x5020c9(0x1e2)](_0x19712d),{'verbose':_0x1cfa89[_0x5020c9(0x189)]});let _0x28010e=_0x2921f9['data'];const _0x449e46=resolveLimit(_0x1cfa89['limit'],DEFAULT_DISPLAY_LIMIT),_0x39a04d=/\bLIMIT\s+\d+/i['test'](_0x28010e);!_0x39a04d&&(_0x28010e=_0x28010e['trim']()['replace'](/;+$/,''),_0x28010e=_0x5020c9(0x174)+_0x28010e+_0x5020c9(0x7f)+_0x449e46);_0x1cfa89[_0x5020c9(0x189)]&&console[_0x5020c9(0x112)](_0x5020c9(0x1d7)+_0x28010e);const _0x59ddbf=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x1efea7=>{const _0x6d8928=_0x5020c9,_0x47d399=await _0x59c3f0[_0x6d8928(0x273)][_0x6d8928(0x1bf)](_0x28010e,{'catalog':'td','schema':_0x6d8928(0x12f),'onJobId':_0x7b5b61=>{const _0x58703d=_0x6d8928;_0x1efea7[_0x58703d(0xd9)](_0x7b5b61);}});return _0x47d399;},{'verbose':_0x1cfa89[_0x5020c9(0x189)]}),_0x1e67e6=_0x59ddbf[_0x5020c9(0x134)],_0xeb1bbf=_0x1e67e6[_0x5020c9(0xde)]?_0x5020c9(0x257)+_0x1e67e6['jobId']+']':'';return console[_0x5020c9(0x112)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x1e67e6[_0x5020c9(0x18a)][_0x5020c9(0x170)]['toLocaleString']()+_0x5020c9(0xd2)+(_0x5020c9(0x226)+formatElapsed(_0x1e67e6['stats']['elapsedTimeMillis'])+_0xeb1bbf)),await handleQueryOutput(_0x1e67e6,_0x1cfa89),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x4a723d(0xd3)]='ps:rt:list';['description']='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a31_0x4a723d(0x1bf)](_0x5e3844){const _0x220368=a31_0x4a723d,{options:_0x3380af,args:_0x2aa23f,tdx:_0x23d013}=_0x5e3844,_0x18bb43=_0x2aa23f[0x0],_0x123927=await withSpinner(_0x18bb43?_0x220368(0x1ee)+_0x18bb43+'\x27...':_0x220368(0x75),()=>_0x23d013[_0x220368(0xee)][_0x220368(0x7e)](),{'verbose':_0x3380af[_0x220368(0x189)]});let _0x955838=_0x123927[_0x220368(0x134)][_0x220368(0x169)](_0x5cfbae=>_0x5cfbae[_0x220368(0xa0)]);if(_0x18bb43){const _0x4e7927=_0x18bb43['replace'](/[.+^${}()|[\]\\]/g,_0x220368(0x114))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0xb3a0bb=new RegExp('^'+_0x4e7927+'$','i');_0x955838=_0x955838['filter'](_0x27ebaf=>_0xb3a0bb[_0x220368(0x123)](_0x27ebaf['name']));}_0x955838[_0x220368(0x7d)]((_0x1a0789,_0x502495)=>_0x1a0789[_0x220368(0xd3)][_0x220368(0x204)](_0x502495[_0x220368(0xd3)])),console[_0x220368(0x112)]('✔\x20Found\x20'+_0x955838[_0x220368(0x13f)]+_0x220368(0x19f)+(_0x955838[_0x220368(0x13f)]!==0x1?'s':''));const _0x53ed8b=_0x51ec99=>{return getConsoleNextUrl(_0x3380af['site'],'/app/dw/parentSegments/'+_0x51ec99);};if(_0x3380af[_0x220368(0x6b)]==='json'||_0x3380af[_0x220368(0x6b)]===_0x220368(0x1d5)){const _0x28393e=_0x955838['map'](_0x24a1ef=>({..._0x24a1ef,'url':_0x53ed8b(_0x24a1ef['id'])}));await handleSDKOutput(_0x28393e,_0x3380af);}else{if(_0x955838[_0x220368(0x13f)]===0x0)console[_0x220368(0x69)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x26cffb of _0x955838){const _0xda68b6=_0x26cffb[_0x220368(0x1fb)]?a31_0x46354d['dim']('\x20('+formatRows(_0x26cffb[_0x220368(0x1fb)])+')'):'',_0x1f355a=hyperlink(_0x26cffb[_0x220368(0xd3)],_0x53ed8b(_0x26cffb['id']));console[_0x220368(0x69)]('⚡\x20'+_0x1f355a+_0xda68b6);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x4a723d(0xc0);[a31_0x4a723d(0x9e)]='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async['execute'](_0x5eadca){const _0x4b49e0=a31_0x4a723d,{options:_0x1463e8,args:_0x41bf7f,tdx:_0x1e63ba}=_0x5eadca,_0x25d727=_0x41bf7f[0x0]||_0x1463e8[_0x4b49e0(0xca)];if(!_0x25d727)return showParentSegmentNotSetError(_0x4b49e0(0x96)+_0x4b49e0(0x25e)),0x1;const _0x502ad7=resolveYamlFile(_0x25d727);if(!existsSync(_0x502ad7))return showFileNotFoundError(_0x502ad7,_0x25d727),0x1;let _0x5f4951;try{_0x5f4951=readFileSync(_0x502ad7,_0x4b49e0(0x261));}catch(_0x5d254b){const _0x55af00=_0x5d254b instanceof Error?_0x5d254b[_0x4b49e0(0x19e)]:String(_0x5d254b);return console[_0x4b49e0(0x112)]('Error\x20reading\x20file:\x20'+_0x55af00),0x1;}const _0x33d67e=createCommandSpinner(a31_0x46354d[_0x4b49e0(0x1a5)](_0x4b49e0(0x210)),{'verbose':_0x1463e8[_0x4b49e0(0x189)]});_0x33d67e['start']();const _0x4ad36d={'realtime':!![],'onProgress':_0x4ca15b=>{const _0x3fd6af=_0x4b49e0;_0x33d67e[_0x3fd6af(0x13d)]=formatProgressMessage(_0x4ca15b);}};let _0x375b0b;try{_0x375b0b=await _0x1e63ba[_0x4b49e0(0x22b)][_0x4b49e0(0x23a)](_0x5f4951,_0x4ad36d),_0x33d67e[_0x4b49e0(0x1c3)]();}catch(_0x14ccd1){_0x33d67e[_0x4b49e0(0x1c3)]();throw _0x14ccd1;}console[_0x4b49e0(0x112)]('\x0a'+a31_0x46354d[_0x4b49e0(0x249)](_0x4b49e0(0xfc))+'\x20'+_0x375b0b[_0x4b49e0(0xd3)]),console[_0x4b49e0(0x112)]('═'[_0x4b49e0(0xf3)](0x3c)),displayRealtimeValidation(_0x375b0b),console[_0x4b49e0(0x112)]('─'[_0x4b49e0(0xf3)](0x3c));if(_0x375b0b[_0x4b49e0(0x200)][_0x4b49e0(0x13f)]>0x0){console[_0x4b49e0(0x112)]('\x0a'+a31_0x46354d[_0x4b49e0(0x175)](_0x4b49e0(0x81)));for(const _0x27a25d of _0x375b0b['errors']){console[_0x4b49e0(0x112)]('\x20\x20'+a31_0x46354d[_0x4b49e0(0x175)]('•')+'\x20'+_0x27a25d);}}return _0x375b0b[_0x4b49e0(0x1dd)]&&console[_0x4b49e0(0x112)]('\x0a'+a31_0x46354d['green']('✔')+_0x4b49e0(0x153)),_0x375b0b['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{['name']=a31_0x4a723d(0x24d);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x119);async[a31_0x4a723d(0x1bf)](_0x5934e0){const _0x9a0b1b=a31_0x4a723d,{options:_0x3bc577,args:_0xf77a94,tdx:_0x31dd0d}=_0x5934e0,_0x4d8167=_0xf77a94[0x0]||_0x3bc577[_0x9a0b1b(0xca)];if(!_0x4d8167)return showParentSegmentNotSetError('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'+'\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'),0x1;_0x3bc577[_0x9a0b1b(0x189)]&&(console[_0x9a0b1b(0x112)]('Site:\x20'+_0x3bc577[_0x9a0b1b(0x1aa)]),console['error']('Parent\x20segment:\x20'+_0x4d8167));const _0x56db08=await withSpinner(_0x9a0b1b(0x16e)+_0x4d8167+_0x9a0b1b(0x6c),()=>_0x31dd0d[_0x9a0b1b(0x22b)]['resolveParentId'](_0x4d8167),{'verbose':_0x3bc577[_0x9a0b1b(0x189)]}),_0x1314a2=_0x56db08[_0x9a0b1b(0x134)],_0x5747d7=await withSpinner(_0x9a0b1b(0x136)+_0x4d8167+_0x9a0b1b(0x6c),()=>_0x31dd0d[_0x9a0b1b(0xee)]['listJourneys'](_0x1314a2),{'verbose':_0x3bc577[_0x9a0b1b(0x189)]}),_0xff340c=_0x5747d7[_0x9a0b1b(0x134)];console['error'](_0x9a0b1b(0xc5)+_0xff340c['length']+_0x9a0b1b(0xce)+(_0xff340c[_0x9a0b1b(0x13f)]!==0x1?'s':''));if(_0x3bc577[_0x9a0b1b(0x6b)]===_0x9a0b1b(0xea)||_0x3bc577[_0x9a0b1b(0x6b)]===_0x9a0b1b(0x1d5))await handleSDKOutput(_0xff340c,_0x3bc577);else{if(_0xff340c[_0x9a0b1b(0x13f)]===0x0)console[_0x9a0b1b(0x69)](_0x9a0b1b(0x157));else for(const _0x39c7f5 of _0xff340c){const _0x4e69e0=_0x39c7f5['state']===_0x9a0b1b(0x227)?'🚀':'📝',_0x260955=_0x39c7f5[_0x9a0b1b(0xa1)]?a31_0x46354d[_0x9a0b1b(0x264)](_0x9a0b1b(0x202)):'',_0x3dc7af=a31_0x46354d['dim']('\x20('+_0x39c7f5[_0x9a0b1b(0x217)]+_0x9a0b1b(0x1cc)+(_0x39c7f5[_0x9a0b1b(0x217)]!==0x1?'s':'')+')');console[_0x9a0b1b(0x69)](_0x4e69e0+'\x20'+_0x39c7f5['name']+_0x260955+_0x3dc7af);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x9b);['description']='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x4a723d(0x1bf)](_0xfd49ef){const _0x52d068=a31_0x4a723d,{options:_0x4885b3,args:_0x1477b2,tdx:_0x4c2583}=_0xfd49ef,_0x214dd6=_0x1477b2[0x0];if(!_0x214dd6)return console['error'](a31_0x46354d[_0x52d068(0x175)](_0x52d068(0x274))),console[_0x52d068(0x112)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console['error'](a31_0x46354d[_0x52d068(0x1a5)](_0x52d068(0x248))),0x1;_0x4885b3['verbose']&&(console[_0x52d068(0x112)]('Site:\x20'+_0x4885b3[_0x52d068(0x1aa)]),console[_0x52d068(0x112)](_0x52d068(0x11a)+_0x214dd6));const _0x24ee48=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x214dd6+'\x27...',()=>_0x4c2583['realtime']['pauseJourney'](_0x214dd6),{'verbose':_0x4885b3['verbose']}),_0x4039f9=_0x24ee48['data'];console[_0x52d068(0x112)](_0x52d068(0x11b)+_0x4039f9[_0x52d068(0xd3)]+'\x27');if(_0x4885b3['format']===_0x52d068(0xea)||_0x4885b3['format']===_0x52d068(0x1d5))await handleSDKOutput([_0x4039f9],_0x4885b3);else{const _0x3460ff=_0x4039f9['state']===_0x52d068(0x227)?'🚀':'📝',_0x342ade=_0x4039f9[_0x52d068(0xa1)]?a31_0x46354d['yellow'](_0x52d068(0x202)):'';console[_0x52d068(0x69)](_0x3460ff+'\x20'+_0x4039f9['name']+_0x342ade);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']='ps:rt:jn:resume';[a31_0x4a723d(0x9e)]=a31_0x4a723d(0xa3);async[a31_0x4a723d(0x1bf)](_0x3f7fe5){const _0xa5caea=a31_0x4a723d,{options:_0x37a65b,args:_0x23b064,tdx:_0x4b0190}=_0x3f7fe5,_0x1a8c21=_0x23b064[0x0];if(!_0x1a8c21)return console['error'](a31_0x46354d[_0xa5caea(0x175)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0xa5caea(0x112)](_0xa5caea(0x1fd)),console[_0xa5caea(0x112)](a31_0x46354d[_0xa5caea(0x1a5)](_0xa5caea(0x248))),0x1;_0x37a65b[_0xa5caea(0x189)]&&(console['error'](_0xa5caea(0x6f)+_0x37a65b[_0xa5caea(0x1aa)]),console['error'](_0xa5caea(0x11a)+_0x1a8c21));const _0x159012=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1a8c21+_0xa5caea(0x6c),()=>_0x4b0190[_0xa5caea(0xee)][_0xa5caea(0xf5)](_0x1a8c21),{'verbose':_0x37a65b[_0xa5caea(0x189)]}),_0x299a7b=_0x159012[_0xa5caea(0x134)];console[_0xa5caea(0x112)](_0xa5caea(0x12c)+_0x299a7b[_0xa5caea(0xd3)]+'\x27');if(_0x37a65b['format']===_0xa5caea(0xea)||_0x37a65b[_0xa5caea(0x6b)]===_0xa5caea(0x1d5))await handleSDKOutput([_0x299a7b],_0x37a65b);else{const _0x1abaa0=_0x299a7b['state']===_0xa5caea(0x227)?'🚀':'📝',_0x2704c5=_0x299a7b['paused']?a31_0x46354d[_0xa5caea(0x264)](_0xa5caea(0x202)):'';console[_0xa5caea(0x69)](_0x1abaa0+'\x20'+_0x299a7b[_0xa5caea(0xd3)]+_0x2704c5);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x4a723d(0xd3)]='ps:rt:configuration_versions';['description']=a31_0x4a723d(0x17e);async[a31_0x4a723d(0x1bf)](_0xb0b344){const _0xcef5e2=a31_0x4a723d,{options:_0x5e99d4,args:_0x1988e5,tdx:_0x11f4b3}=_0xb0b344,_0x51949b=_0x1988e5[0x0]||_0x5e99d4[_0xcef5e2(0xca)];if(!_0x51949b)return showParentSegmentNotSetError(_0xcef5e2(0xb0)+'\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'),0x1;_0x5e99d4[_0xcef5e2(0x189)]&&(console[_0xcef5e2(0x112)](_0xcef5e2(0x6f)+_0x5e99d4['site']),console[_0xcef5e2(0x112)](_0xcef5e2(0xec)+_0x51949b));const _0x344ef1=await withSpinner(_0xcef5e2(0x16e)+_0x51949b+_0xcef5e2(0x6c),()=>_0x11f4b3['segment']['resolveParentId'](_0x51949b),{'verbose':_0x5e99d4[_0xcef5e2(0x189)]}),_0x467fea=_0x344ef1[_0xcef5e2(0x134)],_0x273ece=await withSpinner(_0xcef5e2(0x1c8)+_0x51949b+_0xcef5e2(0x6c),()=>_0x11f4b3[_0xcef5e2(0xee)]['getCurrentConfigVersion'](_0x467fea),{'verbose':_0x5e99d4[_0xcef5e2(0x189)]}),_0x4b39a9=_0x273ece['data'];return console['error']('✔\x20Retrieved\x20RT\x20configuration\x20version'),_0x5e99d4[_0xcef5e2(0x6b)]==='json'||_0x5e99d4[_0xcef5e2(0x6b)]===_0xcef5e2(0x1d5)?await handleSDKOutput([_0x4b39a9],_0x5e99d4):(console[_0xcef5e2(0x69)](_0xcef5e2(0x16f)+_0x4b39a9['id']),console[_0xcef5e2(0x69)](_0xcef5e2(0x220)+_0x4b39a9['audienceId']),console[_0xcef5e2(0x69)](_0xcef5e2(0x8a)+_0x4b39a9[_0xcef5e2(0x70)]),console[_0xcef5e2(0x69)](_0xcef5e2(0x97)+_0x4b39a9['eventKind']),console[_0xcef5e2(0x69)]('status:\x20'+_0x4b39a9[_0xcef5e2(0xcb)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x1e1);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x251);async[a31_0x4a723d(0x1bf)](_0x227c5f){const _0x1c426e=a31_0x4a723d,{options:_0x2ffeb4,args:_0x1d9fc7,tdx:_0x12e281}=_0x227c5f,_0x5bb048=_0x1d9fc7[0x0]||_0x2ffeb4[_0x1c426e(0xca)];if(!_0x5bb048)return showParentSegmentNotSetError(_0x1c426e(0x11d)+_0x1c426e(0x1b5)),0x1;const _0x23a503=await withSpinner(_0x1c426e(0x16e)+_0x5bb048+_0x1c426e(0x6c),()=>_0x12e281[_0x1c426e(0x22b)]['resolveParentId'](_0x5bb048),{'verbose':_0x2ffeb4[_0x1c426e(0x189)]}),_0x49c54a=_0x23a503[_0x1c426e(0x134)],_0x24b780=await withSpinner(_0x1c426e(0x1fa)+_0x5bb048+_0x1c426e(0x6c),()=>_0x12e281[_0x1c426e(0x1bc)][_0x1c426e(0x7e)](_0x49c54a),{'verbose':_0x2ffeb4[_0x1c426e(0x189)]}),_0x503e9c=_0x24b780[_0x1c426e(0x134)];console[_0x1c426e(0x112)](_0x1c426e(0xc5)+_0x503e9c[_0x1c426e(0x13f)]+_0x1c426e(0x68)+(_0x503e9c[_0x1c426e(0x13f)]!==0x1?'s':''));if(_0x2ffeb4[_0x1c426e(0x6b)]===_0x1c426e(0xea)||_0x2ffeb4[_0x1c426e(0x6b)]===_0x1c426e(0x1d5))await handleSDKOutput(_0x503e9c,_0x2ffeb4);else{if(_0x503e9c['length']===0x0)console[_0x1c426e(0x69)](_0x1c426e(0x19c)),console[_0x1c426e(0x112)](a31_0x46354d[_0x1c426e(0x15a)](_0x1c426e(0x115)));else for(const _0x3a23f3 of _0x503e9c){console[_0x1c426e(0x69)](a31_0x46354d[_0x1c426e(0x249)](_0x3a23f3[_0x1c426e(0xd3)])+'\x20'+a31_0x46354d[_0x1c426e(0x1a5)](_0x1c426e(0xe0)+_0x3a23f3['id']+')'));_0x3a23f3[_0x1c426e(0x9e)]&&console[_0x1c426e(0x69)]('\x20\x20'+a31_0x46354d[_0x1c426e(0x1a5)](_0x3a23f3['description']));if(_0x3a23f3[_0x1c426e(0x13a)]&&_0x3a23f3[_0x1c426e(0x13a)][_0x1c426e(0x13f)]>0x0)for(const _0x21d828 of _0x3a23f3[_0x1c426e(0x13a)]){const _0x4d3d85=_0x21d828[_0x1c426e(0x24c)]?.[_0x1c426e(0x13f)]?_0x21d828[_0x1c426e(0x24c)][_0x1c426e(0x108)](',\x20'):'any';console[_0x1c426e(0x69)]('\x20\x20'+a31_0x46354d[_0x1c426e(0x15a)](_0x1c426e(0x141))+'\x20'+_0x21d828[_0x1c426e(0xd3)]+'\x20'+a31_0x46354d[_0x1c426e(0x1a5)](_0x1c426e(0xe0)+_0x21d828['id']+')')),console['log'](_0x1c426e(0x147)+a31_0x46354d[_0x1c426e(0x1a5)]('allowed\x20IPs:')+'\x20'+_0x4d3d85);}else console[_0x1c426e(0x69)]('\x20\x20'+a31_0x46354d[_0x1c426e(0x1a5)](_0x1c426e(0x156)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{['name']=a31_0x4a723d(0x83);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x242);async[a31_0x4a723d(0x1bf)](_0xd8b347){const _0x239b1f=a31_0x4a723d,{options:_0x1136e1,args:_0x2fed28,tdx:_0x1a9d3e}=_0xd8b347,_0x1bdd29=_0x1136e1,_0x154bea=_0x2fed28[0x0],_0xa8a8bf=_0x2fed28[0x1]||_0x1136e1[_0x239b1f(0xca)];if(!_0x154bea)return console[_0x239b1f(0x112)]('Error:\x20Service\x20name\x20is\x20required'),console[_0x239b1f(0x112)](_0x239b1f(0x1da)),console[_0x239b1f(0x112)](_0x239b1f(0x1ff)),0x1;if(!_0xa8a8bf)return showParentSegmentNotSetError(_0x239b1f(0xe7)+_0x239b1f(0x1ff)),0x1;const _0x5a0d6e=await withSpinner(_0x239b1f(0x16e)+_0xa8a8bf+_0x239b1f(0x6c),()=>_0x1a9d3e[_0x239b1f(0x22b)][_0x239b1f(0x117)](_0xa8a8bf),{'verbose':_0x1136e1['verbose']}),_0x439f7a=_0x5a0d6e['data'],_0x2b6b7e={'name':_0x154bea,'description':_0x1bdd29[_0x239b1f(0x9e)],'public':_0x1bdd29[_0x239b1f(0x16b)]},_0x4f6057=await withSpinner(_0x239b1f(0x1ed)+_0x154bea+_0x239b1f(0x6c),()=>_0x1a9d3e[_0x239b1f(0x1bc)][_0x239b1f(0xf9)](_0x439f7a,_0x2b6b7e),{'verbose':_0x1136e1['verbose']}),_0x2e68cf=_0x4f6057[_0x239b1f(0x134)];return console[_0x239b1f(0x112)](_0x239b1f(0x126)+_0x2e68cf[_0x239b1f(0xd3)]+'\x27\x20with\x20ID:\x20'+_0x2e68cf['id']),await handleSDKOutput([_0x2e68cf],_0x1136e1),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x6d);['description']=a31_0x4a723d(0xba);async[a31_0x4a723d(0x1bf)](_0x65663e){const _0x509b41=a31_0x4a723d,{options:_0x5bcc80,args:_0x23d2c4,tdx:_0x39cd28}=_0x65663e,_0x59a82a=_0x23d2c4[0x0],_0x49a1dd=_0x23d2c4[0x1]||_0x5bcc80[_0x509b41(0xca)];if(!_0x59a82a)return console['error'](_0x509b41(0x18e)),console[_0x509b41(0x112)](_0x509b41(0xc7)),console[_0x509b41(0x112)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x49a1dd)return showParentSegmentNotSetError(_0x509b41(0x129)+_0x509b41(0x24a)),0x1;const _0x5effce=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x49a1dd+_0x509b41(0x6c),()=>_0x39cd28[_0x509b41(0x22b)]['resolveParentId'](_0x49a1dd),{'verbose':_0x5bcc80[_0x509b41(0x189)]}),_0x203d3d=_0x5effce[_0x509b41(0x134)],_0xb952be=await withSpinner(_0x509b41(0x192)+_0x59a82a+_0x509b41(0x6c),()=>_0x39cd28[_0x509b41(0x1bc)][_0x509b41(0x21a)](_0x203d3d,_0x59a82a),{'verbose':_0x5bcc80[_0x509b41(0x189)]}),_0x41fc8f=_0xb952be[_0x509b41(0x134)];if(_0x5bcc80[_0x509b41(0xea)]||_0x5bcc80[_0x509b41(0x1d5)])await handleSDKOutput([_0x41fc8f],_0x5bcc80);else{console[_0x509b41(0x69)](a31_0x46354d[_0x509b41(0x249)](_0x41fc8f[_0x509b41(0xd3)])+'\x20'+a31_0x46354d[_0x509b41(0x1a5)]('(id:\x20'+_0x41fc8f['id']+')'));_0x41fc8f[_0x509b41(0x9e)]&&console[_0x509b41(0x69)]('\x20\x20'+a31_0x46354d[_0x509b41(0x1a5)](_0x41fc8f[_0x509b41(0x9e)]));console['log']('\x20\x20'+a31_0x46354d[_0x509b41(0x15a)](_0x509b41(0xe3))+'\x20'+(_0x41fc8f['public']?_0x509b41(0x15c):'no'));if(_0x41fc8f[_0x509b41(0x13a)]&&_0x41fc8f[_0x509b41(0x13a)]['length']>0x0)for(const _0x53fef7 of _0x41fc8f['tokens']){const _0x576229=_0x53fef7[_0x509b41(0x24c)]?.[_0x509b41(0x13f)]?_0x53fef7[_0x509b41(0x24c)][_0x509b41(0x108)](',\x20'):'any';console[_0x509b41(0x69)]('\x20\x20'+a31_0x46354d[_0x509b41(0x15a)](_0x509b41(0x141))+'\x20'+_0x53fef7[_0x509b41(0xd3)]+'\x20'+a31_0x46354d[_0x509b41(0x1a5)](_0x509b41(0xe0)+_0x53fef7['id']+')')),console[_0x509b41(0x69)](_0x509b41(0x147)+a31_0x46354d[_0x509b41(0x1a5)](_0x509b41(0x172))+'\x20'+_0x576229);}else console[_0x509b41(0x69)]('\x20\x20'+a31_0x46354d[_0x509b41(0x1a5)](_0x509b41(0x156)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x4a723d(0xd3)]='ps:pz:service:delete';['description']=a31_0x4a723d(0x20c);async['execute'](_0x36cc66){const _0x2856a4=a31_0x4a723d,{options:_0xcf1fb8,args:_0x5a6668,tdx:_0xab2bb5}=_0x36cc66,_0x4c02c2=_0x5a6668[0x0],_0x349cb0=_0x5a6668[0x1]||_0xcf1fb8['parentSegment'];if(!_0x4c02c2)return console['error'](_0x2856a4(0x18e)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x2856a4(0x112)](_0x2856a4(0x163)),0x1;if(!_0x349cb0)return showParentSegmentNotSetError(_0x2856a4(0xf6)+_0x2856a4(0x163)),0x1;const _0x58218f=await withSpinner(_0x2856a4(0x16e)+_0x349cb0+_0x2856a4(0x6c),()=>_0xab2bb5[_0x2856a4(0x22b)][_0x2856a4(0x117)](_0x349cb0),{'verbose':_0xcf1fb8[_0x2856a4(0x189)]}),_0x2d55d9=_0x58218f[_0x2856a4(0x134)];return await withSpinner(_0x2856a4(0x8e)+_0x4c02c2+_0x2856a4(0x6c),()=>_0xab2bb5[_0x2856a4(0x1bc)][_0x2856a4(0x1ef)](_0x2d55d9,_0x4c02c2),{'verbose':_0xcf1fb8['verbose']}),console['error'](_0x2856a4(0x196)+_0x4c02c2+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0xab);['description']='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async['execute'](_0xf30e8){const _0x29e473=a31_0x4a723d,{options:_0xa3ac4b,args:_0x352a6a,tdx:_0x14a5f5}=_0xf30e8,_0x14eef3=_0xa3ac4b,_0x1b0a6c=_0x352a6a[0x0],_0x1178a5=_0x352a6a[0x1]||_0xa3ac4b[_0x29e473(0xca)];if(!_0x1b0a6c)return console[_0x29e473(0x112)](_0x29e473(0x18e)),console[_0x29e473(0x112)](_0x29e473(0x6e)),console[_0x29e473(0x112)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x14eef3['name'])return console[_0x29e473(0x112)]('Error:\x20--name\x20is\x20required'),console['error'](_0x29e473(0x6e)),0x1;if(!_0x1178a5)return showParentSegmentNotSetError(_0x29e473(0x87)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x3d5541=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1178a5+'\x27...',()=>_0x14a5f5[_0x29e473(0x22b)][_0x29e473(0x117)](_0x1178a5),{'verbose':_0xa3ac4b['verbose']}),_0xc17ea1=_0x3d5541[_0x29e473(0x134)],_0x55ffc2={'name':_0x14eef3['name']};_0x14eef3[_0x29e473(0x9e)]!==undefined&&(_0x55ffc2[_0x29e473(0x9e)]=_0x14eef3[_0x29e473(0x9e)]);const _0x2c9745=await withSpinner(_0x29e473(0x22d)+_0x1b0a6c+'\x27...',()=>_0x14a5f5['personalization'][_0x29e473(0xda)](_0xc17ea1,_0x1b0a6c,_0x55ffc2),{'verbose':_0xa3ac4b[_0x29e473(0x189)]}),_0x5c8eec=_0x2c9745['data'];return console[_0x29e473(0x112)](_0x29e473(0xeb)+_0x5c8eec[_0x29e473(0xd3)]+'\x27'),await handleSDKOutput([_0x5c8eec],_0xa3ac4b),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x122);['description']=a31_0x4a723d(0x73);async[a31_0x4a723d(0x1bf)](_0x1e8133){const _0x3090cc=a31_0x4a723d,{options:_0x56de2c,args:_0x2abbff,tdx:_0x11de8e}=_0x1e8133,_0x3d8f13=_0x56de2c,_0xb69f1c=_0x2abbff[0x0],_0x5ea6b9=_0x2abbff[0x1],_0x541054=_0x2abbff[0x2]||_0x56de2c[_0x3090cc(0xca)];if(!_0xb69f1c)return console['error'](_0x3090cc(0x180)),console[_0x3090cc(0x112)](_0x3090cc(0x231)),console[_0x3090cc(0x112)](_0x3090cc(0x10b)),0x1;if(!_0x5ea6b9)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console['error'](_0x3090cc(0x231)),console['error'](_0x3090cc(0x10b)),0x1;if(!_0x541054)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+_0x3090cc(0x10b)),0x1;const _0x5a9990=await withSpinner(_0x3090cc(0x16e)+_0x541054+_0x3090cc(0x6c),()=>_0x11de8e[_0x3090cc(0x22b)][_0x3090cc(0x117)](_0x541054),{'verbose':_0x56de2c[_0x3090cc(0x189)]}),_0x43015a=_0x5a9990['data'],_0x48cbfc={'name':_0xb69f1c};_0x3d8f13[_0x3090cc(0x24c)]&&(_0x48cbfc[_0x3090cc(0x24c)]=_0x3d8f13['allowedIps'][_0x3090cc(0x17c)](',')[_0x3090cc(0xd7)](_0x1fa94b=>_0x1fa94b[_0x3090cc(0x266)]()));_0x3d8f13['description']&&(_0x48cbfc[_0x3090cc(0x9e)]=_0x3d8f13[_0x3090cc(0x9e)]);const _0x2ddfe4=await withSpinner(_0x3090cc(0x223)+_0xb69f1c+_0x3090cc(0x71)+_0x5ea6b9+_0x3090cc(0x6c),()=>_0x11de8e[_0x3090cc(0x1bc)][_0x3090cc(0x1a7)](_0x43015a,_0x5ea6b9,_0x48cbfc),{'verbose':_0x56de2c[_0x3090cc(0x189)]}),_0x3bf5be=_0x2ddfe4[_0x3090cc(0x134)];return console['error'](_0x3090cc(0x1d4)+_0x3bf5be[_0x3090cc(0xd3)]+'\x27\x20with\x20ID:\x20'+_0x3bf5be['id']),_0x3bf5be[_0x3090cc(0x1c9)]&&(console[_0x3090cc(0x112)](a31_0x46354d[_0x3090cc(0x264)](_0x3090cc(0x1f7))),console['error'](a31_0x46354d[_0x3090cc(0x15a)](_0x3bf5be[_0x3090cc(0x1c9)])),console['error']('')),await handleSDKOutput([_0x3bf5be],_0x56de2c),0x0;}}function a31_0x93c7(_0x33b8ab,_0x4b9fd5){_0x33b8ab=_0x33b8ab-0x66;const _0x57740f=a31_0x5774();let _0x93c71f=_0x57740f[_0x33b8ab];return _0x93c71f;}export class PSPzServiceTokenDeleteCommand extends BaseCommand{['name']=a31_0x4a723d(0xa7);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x245);async['execute'](_0x52aef9){const _0x4077aa=a31_0x4a723d,{options:_0xe78221,args:_0x487c2d,tdx:_0x3b02d9}=_0x52aef9,_0x49ce43=_0x487c2d[0x0],_0x148ecc=_0x487c2d[0x1]||_0xe78221['parentSegment'];if(!_0x49ce43)return console[_0x4077aa(0x112)](_0x4077aa(0x186)),console[_0x4077aa(0x112)](_0x4077aa(0x8f)),console[_0x4077aa(0x112)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x148ecc)return showParentSegmentNotSetError(_0x4077aa(0x213)+_0x4077aa(0x1be)),0x1;const _0x5c3795=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x148ecc+_0x4077aa(0x6c),()=>_0x3b02d9[_0x4077aa(0x22b)][_0x4077aa(0x117)](_0x148ecc),{'verbose':_0xe78221[_0x4077aa(0x189)]}),_0x1eaead=_0x5c3795[_0x4077aa(0x134)],_0x238c8a=await withSpinner(_0x4077aa(0x219),()=>_0x3b02d9['personalization']['list'](_0x1eaead),{'verbose':_0xe78221[_0x4077aa(0x189)]}),_0x48bf9b=_0x238c8a[_0x4077aa(0x134)];let _0x3c1964;for(const _0xe98845 of _0x48bf9b){if(_0xe98845[_0x4077aa(0x13a)]?.[_0x4077aa(0x1a3)](_0x63590e=>_0x63590e['id']===_0x49ce43)){_0x3c1964=_0xe98845['id'];break;}}if(!_0x3c1964)return console[_0x4077aa(0x112)](_0x4077aa(0xd8)+_0x49ce43+_0x4077aa(0x146)),0x1;const _0x1c750b=await withSpinner(_0x4077aa(0x22c)+_0x49ce43+_0x4077aa(0x6c),()=>_0x3b02d9[_0x4077aa(0x1bc)][_0x4077aa(0x148)](_0x1eaead,_0x3c1964,_0x49ce43),{'verbose':_0xe78221[_0x4077aa(0x189)]}),_0x4e0392=_0x1c750b['data'];return console[_0x4077aa(0x112)]('✔\x20Deleted\x20token\x20\x27'+(_0x4e0392[_0x4077aa(0xd3)]||_0x49ce43)+'\x27'),await handleSDKOutput([_0x4e0392],_0xe78221),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x240);[a31_0x4a723d(0x9e)]='List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment';async[a31_0x4a723d(0x1bf)](_0xda73ea){const _0x47e12f=a31_0x4a723d,{options:_0x30a875,args:_0x392911,tdx:_0x1fbd28}=_0xda73ea,_0x51c899=_0x392911[0x0]||_0x30a875[_0x47e12f(0xca)];if(!_0x51c899)return showParentSegmentNotSetError(_0x47e12f(0x201)+_0x47e12f(0x1a9)),0x1;const _0x1e7cb1=await withSpinner(_0x47e12f(0x16e)+_0x51c899+'\x27...',()=>_0x1fbd28['segment']['resolveParentId'](_0x51c899),{'verbose':_0x30a875[_0x47e12f(0x189)]}),_0x2ecd0f=_0x1e7cb1[_0x47e12f(0x134)],_0x5d16ec=await withSpinner('Listing\x20personalizations\x20for\x20\x27'+_0x51c899+_0x47e12f(0x6c),()=>_0x1fbd28['personalization'][_0x47e12f(0xd6)](_0x2ecd0f),{'verbose':_0x30a875[_0x47e12f(0x189)]}),_0x46d205=_0x5d16ec[_0x47e12f(0x134)];console[_0x47e12f(0x112)](_0x47e12f(0xc5)+_0x46d205[_0x47e12f(0x13f)]+_0x47e12f(0x1a4)+(_0x46d205[_0x47e12f(0x13f)]!==0x1?'s':''));if(_0x30a875[_0x47e12f(0x6b)]===_0x47e12f(0xea)||_0x30a875[_0x47e12f(0x6b)]===_0x47e12f(0x1d5))await handleSDKOutput(_0x46d205,_0x30a875);else{if(_0x46d205[_0x47e12f(0x13f)]===0x0)console['log'](_0x47e12f(0x132));else for(const _0x27b851 of _0x46d205){console[_0x47e12f(0x69)](a31_0x46354d[_0x47e12f(0x249)](_0x27b851['name'])+'\x20'+a31_0x46354d[_0x47e12f(0x1a5)](_0x47e12f(0xe0)+_0x27b851['id']+')'));_0x27b851['description']&&console[_0x47e12f(0x69)]('\x20\x20'+a31_0x46354d[_0x47e12f(0x1a5)](_0x27b851[_0x47e12f(0x9e)]));const _0x279891=_0x27b851[_0x47e12f(0xdf)]?.['length']||0x0;console[_0x47e12f(0x69)]('\x20\x20'+a31_0x46354d['cyan'](_0x47e12f(0x23d))+'\x20'+_0x279891);if(_0x27b851[_0x47e12f(0xdf)]&&_0x27b851['sections']['length']>0x0)for(const _0x249f7d of _0x27b851['sections']){console[_0x47e12f(0x69)]('\x20\x20\x20\x20-\x20'+_0x249f7d['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{['name']=a31_0x4a723d(0xbb);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x211);async[a31_0x4a723d(0x1bf)](_0x13a276){const _0x59a7ed=a31_0x4a723d,{options:_0x499b7b,args:_0x13b294,tdx:_0x2263c4}=_0x13a276,_0x343f2d=_0x13b294[0x0];if(!_0x343f2d)return console[_0x59a7ed(0x112)](_0x59a7ed(0x86)),console[_0x59a7ed(0x112)](_0x59a7ed(0x10c)),0x1;const _0x1695d9=await withSpinner(_0x59a7ed(0x260)+_0x343f2d+_0x59a7ed(0x6c),()=>_0x2263c4[_0x59a7ed(0x1bc)][_0x59a7ed(0x1ab)](_0x343f2d),{'verbose':_0x499b7b['verbose']}),_0x2e7e89=_0x1695d9[_0x59a7ed(0x134)];console[_0x59a7ed(0x112)](_0x59a7ed(0x78)+_0x2e7e89['name']+'\x27');if(_0x499b7b[_0x59a7ed(0x6b)]==='json'||_0x499b7b[_0x59a7ed(0x6b)]==='jsonl')await handleSDKOutput([_0x2e7e89],_0x499b7b);else{console[_0x59a7ed(0x69)](a31_0x46354d[_0x59a7ed(0x249)](_0x2e7e89[_0x59a7ed(0xd3)])+'\x20'+a31_0x46354d[_0x59a7ed(0x1a5)](_0x59a7ed(0xe0)+_0x2e7e89['id']+')'));_0x2e7e89[_0x59a7ed(0x9e)]&&console[_0x59a7ed(0x69)]('\x20\x20'+a31_0x46354d[_0x59a7ed(0x1a5)](_0x2e7e89[_0x59a7ed(0x9e)]));_0x2e7e89['audienceId']&&console[_0x59a7ed(0x69)]('\x20\x20'+a31_0x46354d[_0x59a7ed(0x15a)]('audienceId:')+'\x20'+_0x2e7e89[_0x59a7ed(0x198)]);console['log']('\x20\x20'+a31_0x46354d[_0x59a7ed(0x15a)]('created:')+'\x20'+_0x2e7e89['createdAt']),console['log']('\x20\x20'+a31_0x46354d['cyan'](_0x59a7ed(0x26c))+'\x20'+_0x2e7e89[_0x59a7ed(0xae)]);const _0x3546ff=_0x2e7e89[_0x59a7ed(0xdf)]?.[_0x59a7ed(0x13f)]||0x0;console[_0x59a7ed(0x69)]('\x20\x20'+a31_0x46354d[_0x59a7ed(0x15a)](_0x59a7ed(0x23d))+'\x20'+_0x3546ff);if(_0x2e7e89[_0x59a7ed(0xdf)]&&_0x2e7e89[_0x59a7ed(0xdf)][_0x59a7ed(0x13f)]>0x0)for(const _0x3b83e3 of _0x2e7e89[_0x59a7ed(0xdf)]){console[_0x59a7ed(0x69)]('\x20\x20\x20\x20'+a31_0x46354d[_0x59a7ed(0x249)](_0x3b83e3[_0x59a7ed(0xd3)])+'\x20'+a31_0x46354d[_0x59a7ed(0x1a5)](_0x59a7ed(0xe0)+_0x3b83e3['id']+')')),_0x3b83e3[_0x59a7ed(0xf8)]&&(console[_0x59a7ed(0x69)](_0x59a7ed(0x182)+a31_0x46354d[_0x59a7ed(0x15a)](_0x59a7ed(0x194))+'\x20'+_0x3b83e3[_0x59a7ed(0xf8)]['name']),_0x3b83e3[_0x59a7ed(0xf8)][_0x59a7ed(0x9c)]?.['keyEventId']&&console['log']('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x46354d[_0x59a7ed(0x15a)](_0x59a7ed(0x93))+'\x20'+_0x3b83e3[_0x59a7ed(0xf8)]['keyEventCriteria']['keyEventId'])),_0x3b83e3[_0x59a7ed(0x1eb)]&&console['log'](_0x59a7ed(0x182)+a31_0x46354d[_0x59a7ed(0x15a)](_0x59a7ed(0xdb))+'\x20'+JSON[_0x59a7ed(0x1d0)](_0x3b83e3[_0x59a7ed(0x1eb)])),_0x3b83e3[_0x59a7ed(0x14d)]&&console[_0x59a7ed(0x69)](_0x59a7ed(0x182)+a31_0x46354d[_0x59a7ed(0x15a)](_0x59a7ed(0x1ac))+'\x20true');}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x258);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x128);async[a31_0x4a723d(0x1bf)](_0x1db56b){const _0x54d29b=a31_0x4a723d,{options:_0x51aa82,args:_0x333e54,tdx:_0x29d821}=_0x1db56b,_0x6314f2=_0x333e54[0x0];if(!_0x6314f2)return console[_0x54d29b(0x112)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x54d29b(0x112)](_0x54d29b(0xbc)),0x1;return await withSpinner(_0x54d29b(0x190)+_0x6314f2+'\x27...',()=>_0x29d821[_0x54d29b(0x1bc)][_0x54d29b(0x9d)](_0x6314f2),{'verbose':_0x51aa82['verbose']}),console['error'](_0x54d29b(0x1cf)+_0x6314f2+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x4a723d(0xd3)]=a31_0x4a723d(0x1dc);['description']=a31_0x4a723d(0x1f6);async[a31_0x4a723d(0x1bf)](_0x2babd0){const _0x199727=a31_0x4a723d,{options:_0x1f4552,tdx:_0x1b764f}=_0x2babd0,_0x117e1c=_0x1f4552;let _0x51dbd9;if(_0x117e1c[_0x199727(0x26a)]){_0x51dbd9=await loadJSON(_0x117e1c[_0x199727(0x26a)],!![]);if(!_0x51dbd9['relationships']?.[_0x199727(0x203)])return console[_0x199727(0x112)](_0x199727(0x1cb)),console[_0x199727(0x112)](_0x199727(0x187)),console[_0x199727(0x112)](_0x199727(0x144)),0x1;}else{if(!_0x117e1c[_0x199727(0xd3)])return console[_0x199727(0x112)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0x199727(0x165)),console['error'](_0x199727(0x21e)),0x1;if(_0x117e1c['description']===undefined)return console[_0x199727(0x112)](_0x199727(0x100)),console[_0x199727(0x112)](_0x199727(0x165)),console[_0x199727(0x112)](_0x199727(0x21e)),0x1;if(_0x117e1c[_0x199727(0x26f)]===undefined)return console[_0x199727(0x112)]('Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.'),console[_0x199727(0x112)]('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x5af3d3=_0x117e1c[_0x199727(0x198)];if(!_0x5af3d3&&_0x1f4552['parentSegment']){const _0x437526=await withSpinner(_0x199727(0x16e)+_0x1f4552['parentSegment']+'\x27...',()=>_0x1b764f[_0x199727(0x22b)][_0x199727(0x117)](_0x1f4552[_0x199727(0xca)]),{'verbose':_0x1f4552[_0x199727(0x189)]});_0x5af3d3=_0x437526['data'];}let _0xffffe6;_0x117e1c['sections']&&(_0xffffe6=await loadJSON(_0x117e1c[_0x199727(0xdf)],![]));const _0x2650ad=_0x117e1c[_0x199727(0x26f)]===_0x199727(0x255)?null:{'id':_0x117e1c['folderId'],'type':'folder-segment'};_0x51dbd9={'attributes':{'name':_0x117e1c[_0x199727(0xd3)],'description':_0x117e1c['description']||null,..._0x5af3d3!==undefined&&{'audienceId':_0x5af3d3},..._0xffffe6!==undefined&&{'sections':_0xffffe6}},'relationships':{'parentFolder':{'data':_0x2650ad}}};}const _0x47c50d=await withSpinner(_0x199727(0x85)+(_0x51dbd9[_0x199727(0x22f)]?.[_0x199727(0xd3)]??'')+_0x199727(0x6c),()=>_0x1b764f[_0x199727(0x1bc)][_0x199727(0x26e)](_0x51dbd9),{'verbose':_0x1f4552[_0x199727(0x189)]}),_0x5e1d2d=_0x47c50d[_0x199727(0x134)];return console[_0x199727(0x112)](_0x199727(0x191)+_0x5e1d2d[_0x199727(0xd3)]+_0x199727(0xe6)+_0x5e1d2d['id']),await handleSDKOutput([_0x5e1d2d],_0x1f4552),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x4a723d(0xd3)]='ps:pz:patch';[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x1c0);async[a31_0x4a723d(0x1bf)](_0x581fa9){const _0x1da993=a31_0x4a723d,{options:_0xebafd4,args:_0x43b497}=_0x581fa9,_0x321ffc=_0xebafd4,_0x824e6b=_0x43b497[0x0];if(!_0x824e6b)return console['error']('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x1da993(0x112)](_0x1da993(0x99)),console[_0x1da993(0x112)](_0x1da993(0x22e)),0x1;let _0x22e87d;if(_0x321ffc[_0x1da993(0x26a)])_0x22e87d=await loadJSON(_0x321ffc[_0x1da993(0x26a)],!![]);else{if(!_0x321ffc[_0x1da993(0xd3)])return console['error'](_0x1da993(0xd4)),console['error'](_0x1da993(0x99)),0x1;if(_0x321ffc['description']===undefined)return console[_0x1da993(0x112)](_0x1da993(0x100)),console['error'](_0x1da993(0x99)),0x1;let _0x3f2155;_0x321ffc[_0x1da993(0xdf)]&&(_0x3f2155=await loadJSON(_0x321ffc[_0x1da993(0xdf)],![])),_0x22e87d={'attributes':{'name':_0x321ffc[_0x1da993(0xd3)],'description':_0x321ffc[_0x1da993(0x9e)]||null,..._0x3f2155!==undefined&&{'sections':_0x3f2155}}};}const {tdx:_0x26a24a}=_0x581fa9,_0x8dcd74=await withSpinner(_0x1da993(0x221)+_0x824e6b+_0x1da993(0x6c),()=>_0x26a24a[_0x1da993(0x1bc)]['patchPersonalization'](_0x824e6b,_0x22e87d),{'verbose':_0xebafd4[_0x1da993(0x189)]}),_0x4cb1e9=_0x8dcd74[_0x1da993(0x134)];return console[_0x1da993(0x112)](_0x1da993(0x14b)+_0x4cb1e9['name']+_0x1da993(0x267)+_0x4cb1e9['id']+')'),await handleSDKOutput([_0x4cb1e9],_0xebafd4),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a31_0x4a723d(0x152);[a31_0x4a723d(0x9e)]=a31_0x4a723d(0x142);async[a31_0x4a723d(0x1bf)](_0x3e6b3c){const _0x45e80a=a31_0x4a723d,{options:_0x4363c7,args:_0x4654d3}=_0x3e6b3c,_0xf27cac=_0x4654d3[0x0]||_0x4363c7['parentSegment'];if(!_0xf27cac)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'+'\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'),0x1;const _0x25fafc=resolveYamlFile(_0xf27cac);if(!existsSync(_0x25fafc))return showFileNotFoundError(_0x25fafc,_0xf27cac),0x1;let _0x494b44;try{_0x494b44=readFileSync(_0x25fafc,_0x45e80a(0x261));}catch(_0x3eed6c){const _0x248d37=_0x3eed6c instanceof Error?_0x3eed6c[_0x45e80a(0x19e)]:String(_0x3eed6c);return console[_0x45e80a(0x112)](_0x45e80a(0x177)+_0x248d37),0x1;}let _0x53d307;try{_0x53d307=parseDef(_0x494b44);}catch(_0x56f459){const _0x576f6a=_0x56f459 instanceof Error?_0x56f459[_0x45e80a(0x19e)]:String(_0x56f459);return console[_0x45e80a(0x112)](a31_0x46354d['red']('Error\x20parsing\x20YAML:\x20'+_0x576f6a)),0x1;}if(_0x53d307[_0x45e80a(0xb5)]&&_0x53d307[_0x45e80a(0xb5)][_0x45e80a(0x13f)]>0x0)return console['error'](a31_0x46354d['yellow'](_0x45e80a(0x216)+_0x25fafc)),console[_0x45e80a(0x112)](a31_0x46354d[_0x45e80a(0x1a5)](_0x45e80a(0x205)+_0x53d307['personalization_services'][_0x45e80a(0x13f)]+_0x45e80a(0xb4))),0x1;!_0x53d307[_0x45e80a(0xee)]&&(_0x53d307['realtime']={'events':[{'name':'page_view','source_table':_0x45e80a(0x16c)}],'attributes':[{'name':'last_page_viewed','type':_0x45e80a(0x12b)}],'id_stitching':{'primary_key':_0x53d307[_0x45e80a(0xef)][_0x45e80a(0x91)]==='customers'?_0x45e80a(0x1e0):'user_id'}});_0x53d307['personalization_services']=[{'name':'My\x20Service','description':'Personalization\x20service\x20description','trigger_event':'page_view','sections':[{'name':_0x45e80a(0x1b6),'criteria':_0x45e80a(0xb3),'attributes':['last_page_viewed']}]}];const _0x3af0dd=serializeDef(_0x53d307);return writeFileSync(_0x25fafc,_0x3af0dd,_0x45e80a(0x261)),console['error'](a31_0x46354d['green']('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x46354d['cyan'](_0x25fafc)),(!_0x53d307['realtime']||_0x494b44['indexOf']('realtime:')===-0x1)&&console[_0x45e80a(0x112)](a31_0x46354d['green']('✔')+_0x45e80a(0x24e)),console['error']('\x0a'+a31_0x46354d[_0x45e80a(0x1a5)]('Next\x20steps:')),console[_0x45e80a(0x112)](_0x45e80a(0x154)+_0x25fafc+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x45e80a(0x112)](_0x45e80a(0x20d)+a31_0x46354d[_0x45e80a(0x1a5)](_0x45e80a(0x9f)+_0xf27cac)+_0x45e80a(0xf2)),0x0;}}
|
|
1
|
+
const a31_0x5bbcfa=a31_0x1942;(function(_0x43d70f,_0x36a01d){const _0x588862=a31_0x1942,_0x226083=_0x43d70f();while(!![]){try{const _0x100001=-parseInt(_0x588862(0x2f8))/0x1*(parseInt(_0x588862(0x137))/0x2)+parseInt(_0x588862(0x217))/0x3*(-parseInt(_0x588862(0x140))/0x4)+parseInt(_0x588862(0x31b))/0x5*(parseInt(_0x588862(0x2dd))/0x6)+-parseInt(_0x588862(0x16b))/0x7+parseInt(_0x588862(0x1f0))/0x8+parseInt(_0x588862(0x158))/0x9+parseInt(_0x588862(0x176))/0xa*(-parseInt(_0x588862(0x201))/0xb);if(_0x100001===_0x36a01d)break;else _0x226083['push'](_0x226083['shift']());}catch(_0x562fed){_0x226083['push'](_0x226083['shift']());}}}(a31_0x1ae9,0x8f62c));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x13e5f7 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_0x27c26e 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='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a31_0x5bbcfa(0x2a9);function openBrowser(_0x7652ba){const _0x532f15=a31_0x5bbcfa,_0x273123=process['platform'],_0x45872b=_0x273123===_0x532f15(0x208)?_0x532f15(0x21c):_0x273123===_0x532f15(0x1ba)?_0x532f15(0x157):'xdg-open';spawn(_0x45872b,[_0x7652ba],{'detached':!![],'stdio':'ignore'})[_0x532f15(0x1a9)]();}function migrateLegacyDirectory(){const _0x21004b=a31_0x5bbcfa;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x4cc409=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x4cc409[_0x21004b(0x30a)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x21004b(0x207)](a31_0x27c26e[_0x21004b(0x27d)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x21004b(0x2d5))),console['error'](a31_0x27c26e[_0x21004b(0x1be)](_0x21004b(0x26d)+LEGACY_PARENT_SEGMENT_DIR+_0x21004b(0x1e9))),![];console[_0x21004b(0x207)](a31_0x27c26e[_0x21004b(0x27d)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x21004b(0x191)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x21004b(0x207)](a31_0x27c26e[_0x21004b(0x2a3)](_0x21004b(0x174)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x520ff3){const _0x163afa=_0x520ff3 instanceof Error?_0x520ff3[_0x21004b(0x284)]:String(_0x520ff3);return console[_0x21004b(0x207)](a31_0x27c26e[_0x21004b(0x172)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x163afa+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x5b1e88){const _0x50c4fc=a31_0x5bbcfa;return migrateLegacyDirectory(),super[_0x50c4fc(0x2e8)](_0x5b1e88);}}function resolveYamlFile(_0x5901ba){const _0xca47df=a31_0x5bbcfa;if(_0x5901ba['endsWith'](_0xca47df(0x2af))||_0x5901ba['endsWith'](_0xca47df(0x21e)))return _0x5901ba;return a31_0x13e5f7['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5901ba)+'.yml');}function formatProgressMessage(_0xb59dd3){const _0x5a976e=a31_0x5bbcfa,_0x4e50f2=_0xb59dd3[_0x5a976e(0x194)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x4e50f2){const [,_0x594f6b,_0x40d0a0,_0x254219='']=_0x4e50f2;return a31_0x27c26e[_0x5a976e(0x1be)](_0x594f6b+':')+'\x20'+_0x40d0a0+a31_0x27c26e['dim'](_0x254219);}return a31_0x27c26e['dim'](_0xb59dd3);}function showFileNotFoundError(_0x48f377,_0x480a61){const _0x20e20b=a31_0x5bbcfa;console[_0x20e20b(0x207)](a31_0x27c26e['red'](_0x20e20b(0x2c2)+_0x48f377+'\x0a')),console['error'](a31_0x27c26e['cyan'](_0x20e20b(0x315)+_0x480a61+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x13f8ec){const _0x325d9d=a31_0x5bbcfa;if(!_0x13f8ec[_0x325d9d(0x299)])return;const _0x3141f6=_0x13f8ec[_0x325d9d(0x299)],_0x276e86=_0x3141f6[_0x325d9d(0x1eb)]?a31_0x27c26e[_0x325d9d(0x2a3)](_0x325d9d(0x2ad)):a31_0x27c26e[_0x325d9d(0x27d)](_0x325d9d(0x17b));console['error']('\x0a'+a31_0x27c26e[_0x325d9d(0x1be)](_0x325d9d(0x20c))+'\x20'+_0x276e86);if(_0x3141f6['events']&&_0x3141f6[_0x325d9d(0x219)]['length']>0x0){console[_0x325d9d(0x207)]('\x20\x20'+a31_0x27c26e['dim']('Events:')+'\x20'+_0x3141f6[_0x325d9d(0x219)][_0x325d9d(0x141)]+_0x325d9d(0x2a7));for(const _0x130449 of _0x3141f6['events']){const _0x1fdcb4=_0x130449[_0x325d9d(0x1f3)]===![]?a31_0x27c26e[_0x325d9d(0x172)]('✘'):a31_0x27c26e[_0x325d9d(0x2a3)]('✔');console[_0x325d9d(0x207)]('\x20\x20\x20\x20'+_0x1fdcb4+'\x20'+_0x130449[_0x325d9d(0x247)]),_0x130449[_0x325d9d(0x1b2)]&&console[_0x325d9d(0x207)](_0x325d9d(0x269)+a31_0x27c26e[_0x325d9d(0x172)](_0x130449[_0x325d9d(0x1b2)]));}}if(_0x3141f6[_0x325d9d(0x29e)]&&_0x3141f6['attributes'][_0x325d9d(0x141)]>0x0){console['error']('\x20\x20'+a31_0x27c26e['dim'](_0x325d9d(0x2cf))+'\x20'+_0x3141f6[_0x325d9d(0x29e)][_0x325d9d(0x141)]+_0x325d9d(0x2a7));for(const _0x50e70b of _0x3141f6[_0x325d9d(0x29e)]){const _0x740d1e=_0x50e70b['valid']?a31_0x27c26e[_0x325d9d(0x2a3)]('✔'):a31_0x27c26e['red']('✘');console[_0x325d9d(0x207)]('\x20\x20\x20\x20'+_0x740d1e+'\x20'+_0x50e70b[_0x325d9d(0x247)]+'\x20'+a31_0x27c26e['dim']('('+_0x50e70b[_0x325d9d(0x257)]+')'));}}if(_0x3141f6[_0x325d9d(0x31f)]){const _0x25cb8f=_0x3141f6[_0x325d9d(0x31f)][_0x325d9d(0x1d3)]?.[_0x325d9d(0x141)]?'\x20+\x20['+_0x3141f6[_0x325d9d(0x31f)][_0x325d9d(0x1d3)]['join'](',\x20')+']':'';console['error']('\x20\x20'+a31_0x27c26e[_0x325d9d(0x1be)](_0x325d9d(0x287))+'\x20'+_0x3141f6[_0x325d9d(0x31f)][_0x325d9d(0x1fc)]+_0x25cb8f);}if(_0x3141f6[_0x325d9d(0x31a)]&&_0x3141f6[_0x325d9d(0x31a)][_0x325d9d(0x141)]>0x0){console[_0x325d9d(0x207)]('\x20\x20'+a31_0x27c26e[_0x325d9d(0x1be)](_0x325d9d(0x1aa))+'\x20'+_0x3141f6[_0x325d9d(0x31a)][_0x325d9d(0x141)]+'\x20service'+(_0x3141f6[_0x325d9d(0x31a)]['length']!==0x1?'s':''));for(const _0x237cde of _0x3141f6[_0x325d9d(0x31a)]){console[_0x325d9d(0x207)](_0x325d9d(0x2d3)+_0x237cde[_0x325d9d(0x247)]);}}}function showParentSegmentNotSetError(_0x164883){const _0xd5d0d2=a31_0x5bbcfa;console['error'](a31_0x27c26e[_0xd5d0d2(0x27d)](_0xd5d0d2(0x1e1))),console[_0xd5d0d2(0x207)](_0x164883);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x2e4);[a31_0x5bbcfa(0x2f6)]='List\x20parent\x20segments';async[a31_0x5bbcfa(0x232)](_0x56026f){const _0x23f5a2=a31_0x5bbcfa,{options:_0x3b84d4,args:_0x58ceee,tdx:_0x2d5ef6}=_0x56026f,_0x54addd=_0x58ceee[0x0];_0x3b84d4[_0x23f5a2(0x28e)]&&(console['error'](_0x23f5a2(0x297)+_0x3b84d4[_0x23f5a2(0x268)]),_0x54addd&&console['error'](_0x23f5a2(0x145)+_0x54addd));const _0xbdc7b0=await withSpinner(_0x54addd?_0x23f5a2(0x16d)+_0x54addd+_0x23f5a2(0x185):_0x23f5a2(0x206),()=>_0x2d5ef6[_0x23f5a2(0x239)][_0x23f5a2(0x292)](),{'verbose':_0x3b84d4[_0x23f5a2(0x28e)]});let _0x374b88=_0xbdc7b0[_0x23f5a2(0x15e)];if(_0x54addd){const _0x3f96b1=_0x54addd[_0x23f5a2(0x261)](/[.+^${}()|[\]\\]/g,_0x23f5a2(0x148))[_0x23f5a2(0x261)](/\*/g,'.*')[_0x23f5a2(0x261)](/\?/g,'.'),_0x2d7273=new RegExp('^'+_0x3f96b1+'$','i');_0x374b88=_0x374b88[_0x23f5a2(0x262)](_0xf26885=>_0x2d7273[_0x23f5a2(0x205)](_0xf26885[_0x23f5a2(0x29e)]['name']));}_0x374b88[_0x23f5a2(0x18b)]((_0x1ed8b4,_0x124564)=>_0x1ed8b4[_0x23f5a2(0x29e)][_0x23f5a2(0x247)]['localeCompare'](_0x124564[_0x23f5a2(0x29e)]['name'])),console[_0x23f5a2(0x207)](_0x23f5a2(0x2c1)+_0x374b88[_0x23f5a2(0x141)]+'\x20parent\x20segment'+(_0x374b88[_0x23f5a2(0x141)]!==0x1?'s':''));const _0x28cc9c=_0x144054=>{const _0x26df89=_0x23f5a2;return getConsoleNextUrl(_0x3b84d4[_0x26df89(0x268)],'/app/dw/parentSegments/'+_0x144054);};if(_0x3b84d4[_0x23f5a2(0x27e)]==='json'||_0x3b84d4[_0x23f5a2(0x27e)]===_0x23f5a2(0x1d0)){const _0x2bfa6e=_0x374b88[_0x23f5a2(0x20a)](_0x469324=>({..._0x469324,'url':_0x28cc9c(_0x469324['id'])}));await handleSDKOutput(_0x2bfa6e,_0x3b84d4);}else{if(_0x374b88['length']===0x0)_0x54addd?console[_0x23f5a2(0x337)](_0x23f5a2(0x144)+_0x54addd):console[_0x23f5a2(0x337)](_0x23f5a2(0x13b));else for(const _0xa6654 of _0x374b88){const _0x333737=_0xa6654['attributes'][_0x23f5a2(0x225)]?a31_0x27c26e[_0x23f5a2(0x1be)]('\x20('+formatRows(_0xa6654[_0x23f5a2(0x29e)][_0x23f5a2(0x225)])+')'):'',_0x509c12=hyperlink(_0xa6654[_0x23f5a2(0x29e)][_0x23f5a2(0x247)],_0x28cc9c(_0xa6654['id']));console[_0x23f5a2(0x337)](_0x23f5a2(0x1ed)+_0x509c12+_0x333737);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x2ae);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x1a1);async[a31_0x5bbcfa(0x232)](_0x6cb316){const _0x5a1ff0=a31_0x5bbcfa,{options:_0x201c33,args:_0x55e40c,tdx:_0x35015e}=_0x6cb316;console[_0x5a1ff0(0x207)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x5a1ff0(0x2cc)+_0x5a1ff0(0x14a));const _0x1d0d60=_0x201c33;if(_0x55e40c[_0x5a1ff0(0x141)]===0x0)return console['error'](a31_0x27c26e['red'](_0x5a1ff0(0x2d0))),console[_0x5a1ff0(0x207)](_0x5a1ff0(0x29d)),0x1;const _0x108dd7=_0x55e40c[0x0];if(!_0x1d0d60['database']||!_0x1d0d60['table'])return console[_0x5a1ff0(0x207)](_0x5a1ff0(0x12f)),console[_0x5a1ff0(0x207)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x1d0d60[_0x5a1ff0(0x28e)]&&(console[_0x5a1ff0(0x207)](_0x5a1ff0(0x297)+_0x1d0d60[_0x5a1ff0(0x268)]),console[_0x5a1ff0(0x207)](_0x5a1ff0(0x2d7)+_0x108dd7),console[_0x5a1ff0(0x207)](_0x5a1ff0(0x1b1)+_0x1d0d60[_0x5a1ff0(0x18e)]),console[_0x5a1ff0(0x207)](_0x5a1ff0(0x30d)+_0x1d0d60[_0x5a1ff0(0x1fe)]));const _0x1b64dd=await loadJSONFromOptions(_0x1d0d60[_0x5a1ff0(0x29e)],_0x1d0d60['attributesFile']),_0x2cc2ac=await loadJSONFromOptions(_0x1d0d60[_0x5a1ff0(0x1cf)],_0x1d0d60[_0x5a1ff0(0x320)]),_0x26fc70=await loadJSONFromOptions(_0x1d0d60[_0x5a1ff0(0x133)],_0x1d0d60[_0x5a1ff0(0x23f)]),_0x3fb52a={'name':_0x108dd7,'description':_0x1d0d60['description'],'scheduleType':_0x1d0d60[_0x5a1ff0(0x34f)],'scheduleOption':_0x1d0d60[_0x5a1ff0(0x341)],'timezone':_0x1d0d60['timezone'],'master':{'parentDatabaseName':_0x1d0d60[_0x5a1ff0(0x18e)],'parentTableName':_0x1d0d60[_0x5a1ff0(0x1fe)]},'attributes':_0x1b64dd,'behaviors':_0x2cc2ac,'customerGroup':_0x26fc70},_0x5d89ea=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x108dd7+_0x5a1ff0(0x185),()=>_0x35015e[_0x5a1ff0(0x239)][_0x5a1ff0(0x1b5)](_0x3fb52a),{'verbose':_0x201c33[_0x5a1ff0(0x28e)]}),_0x6f970c=_0x5d89ea[_0x5a1ff0(0x15e)];return console[_0x5a1ff0(0x207)](_0x5a1ff0(0x149)+_0x6f970c[_0x5a1ff0(0x247)]+'\x27\x20with\x20ID:\x20'+_0x6f970c['id']),await handleSDKOutput([_0x6f970c],_0x201c33),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a31_0x5bbcfa(0x25d);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x329);async['execute'](_0x2c7432){const _0x3e6007=a31_0x5bbcfa,{options:_0x3841f7,args:_0x2cc12c,tdx:_0x3b95cc}=_0x2c7432;console[_0x3e6007(0x207)](_0x3e6007(0x1b8)+_0x3e6007(0x2cc)+_0x3e6007(0x14a));const _0x403bb2=_0x3841f7;if(_0x2cc12c[_0x3e6007(0x141)]===0x0)return console['error'](a31_0x27c26e['red'](_0x3e6007(0x2d0))),console[_0x3e6007(0x207)](_0x3e6007(0x27f)),0x1;const _0x24b2aa=_0x2cc12c[0x0];_0x403bb2['verbose']&&(console[_0x3e6007(0x207)](_0x3e6007(0x297)+_0x403bb2[_0x3e6007(0x268)]),console[_0x3e6007(0x207)](_0x3e6007(0x20b)+_0x24b2aa));const _0x1fd1a4=await withSpinner(_0x3e6007(0x326)+_0x24b2aa+'\x27...',()=>_0x3b95cc[_0x3e6007(0x239)][_0x3e6007(0x2f2)](_0x24b2aa),{'verbose':_0x403bb2[_0x3e6007(0x28e)]}),_0x1d79c0=_0x1fd1a4[_0x3e6007(0x15e)],_0x22c485=await loadJSONFromOptions(_0x403bb2[_0x3e6007(0x27a)],_0x403bb2['addAttributesFile']),_0x558e9b=await loadJSONFromOptions(_0x403bb2[_0x3e6007(0x1ae)],_0x403bb2[_0x3e6007(0x1fa)]),_0xaab6e={'name':_0x1d79c0['name'],'description':_0x403bb2[_0x3e6007(0x2f6)]!==undefined?_0x403bb2[_0x3e6007(0x2f6)]:_0x1d79c0[_0x3e6007(0x2f6)],'scheduleType':_0x403bb2['scheduleType']!==undefined?_0x403bb2['scheduleType']:_0x1d79c0[_0x3e6007(0x34f)],'scheduleOption':_0x403bb2[_0x3e6007(0x341)]!==undefined?_0x403bb2[_0x3e6007(0x341)]:_0x1d79c0[_0x3e6007(0x341)],'timezone':_0x403bb2[_0x3e6007(0x202)]!==undefined?_0x403bb2[_0x3e6007(0x202)]:_0x1d79c0[_0x3e6007(0x202)],'master':_0x1d79c0['master'],'attributes':_0x22c485?[..._0x1d79c0[_0x3e6007(0x29e)]||[],..._0x22c485]:_0x1d79c0[_0x3e6007(0x29e)],'behaviors':_0x558e9b?[..._0x1d79c0['behaviors']||[],..._0x558e9b]:_0x1d79c0['behaviors'],'customerGroup':_0x1d79c0[_0x3e6007(0x133)]},_0x1f1f2e=await withSpinner(_0x3e6007(0x1e5)+_0x24b2aa+_0x3e6007(0x185),()=>_0x3b95cc[_0x3e6007(0x239)][_0x3e6007(0x351)](_0x24b2aa,_0xaab6e),{'verbose':_0x403bb2[_0x3e6007(0x28e)]}),_0x54db27=_0x1f1f2e[_0x3e6007(0x15e)];return console[_0x3e6007(0x207)](_0x3e6007(0x22b)+_0x54db27[_0x3e6007(0x247)]+'\x27'),await handleSDKOutput([_0x54db27],_0x403bb2),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x19e);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x319);async[a31_0x5bbcfa(0x232)](_0x24e9ce){const _0x398cac=a31_0x5bbcfa,{options:_0x48a8f8,args:_0x275116,tdx:_0x165731}=_0x24e9ce,_0x77bcdd=_0x48a8f8,_0x2dfae5=_0x275116[0x0]||_0x48a8f8[_0x398cac(0x155)];if(!_0x2dfae5)return showParentSegmentNotSetError(_0x398cac(0x130)+_0x398cac(0x1a0)),0x1;if(_0x77bcdd['use']&&_0x77bcdd[_0x398cac(0x139)])return console['error'](a31_0x27c26e[_0x398cac(0x172)](_0x398cac(0x336))),console[_0x398cac(0x207)](a31_0x27c26e['dim']('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console['error'](a31_0x27c26e[_0x398cac(0x1be)](_0x398cac(0x2d8)+PARENT_SEGMENT_DIR+_0x398cac(0x270))),console[_0x398cac(0x207)](a31_0x27c26e['cyan'](_0x398cac(0x1db))),0x1;const _0x33f280=_0x77bcdd[_0x398cac(0x139)]||a31_0x13e5f7[_0x398cac(0x20e)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2dfae5)+_0x398cac(0x2af));_0x77bcdd['verbose']&&(console['error'](_0x398cac(0x297)+_0x77bcdd[_0x398cac(0x268)]),console[_0x398cac(0x207)](_0x398cac(0x20b)+_0x2dfae5),console[_0x398cac(0x207)](_0x398cac(0x200)+_0x33f280));const _0x2acb25=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x2dfae5+_0x398cac(0x185),()=>_0x165731[_0x398cac(0x239)][_0x398cac(0x1da)](_0x2dfae5),{'verbose':_0x77bcdd[_0x398cac(0x28e)]}),_0x3cab79=_0x2acb25[_0x398cac(0x15e)];if(existsSync(_0x33f280)){const _0x4a5f2b=readFileSync(_0x33f280,_0x398cac(0x2dc)),_0x50a570=generateDiff(_0x4a5f2b,_0x3cab79);if(!hasChanges(_0x50a570))console[_0x398cac(0x207)](a31_0x27c26e[_0x398cac(0x2a3)]('✔')+_0x398cac(0x183)+a31_0x27c26e[_0x398cac(0x271)](_0x33f280)+_0x398cac(0x19b));else{console[_0x398cac(0x207)]('\x0aChanges\x20to\x20\x27'+_0x33f280+'\x27:'),console['error']('─'[_0x398cac(0x1a6)](0x3c)),console[_0x398cac(0x207)](formatDiffWithColors(_0x50a570)),console[_0x398cac(0x207)]('─'[_0x398cac(0x1a6)](0x3c));if(!_0x77bcdd[_0x398cac(0x177)]){if(!isInteractive())return console['error'](a31_0x27c26e[_0x398cac(0x172)]('\x0aError:'),_0x398cac(0x2ac)),console[_0x398cac(0x207)](a31_0x27c26e[_0x398cac(0x1be)](_0x398cac(0x167))),0x1;const _0x2bb31a=await confirmKey(_0x398cac(0x255)+_0x33f280+'\x27?');if(!_0x2bb31a)return console[_0x398cac(0x207)](a31_0x27c26e[_0x398cac(0x27d)](_0x398cac(0x1f4))),0x1;}writeFileSync(_0x33f280,_0x3cab79,'utf-8'),console['error'](a31_0x27c26e[_0x398cac(0x2a3)]('✔')+_0x398cac(0x327)+a31_0x27c26e[_0x398cac(0x271)](_0x33f280));}}else{const _0x3b06d5=a31_0x13e5f7[_0x398cac(0x245)](_0x33f280);!existsSync(_0x3b06d5)&&mkdirSync(_0x3b06d5,{'recursive':!![]}),writeFileSync(_0x33f280,_0x3cab79,'utf-8'),console[_0x398cac(0x207)](a31_0x27c26e[_0x398cac(0x2a3)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x27c26e[_0x398cac(0x271)](_0x33f280));}return saveSessionContext({'parent_segment':_0x2dfae5},_0x77bcdd[_0x398cac(0x1d7)]),console[_0x398cac(0x207)](a31_0x27c26e[_0x398cac(0x2a3)]('✔')+_0x398cac(0x186)+a31_0x27c26e[_0x398cac(0x1be)](_0x398cac(0x2a9))+_0x398cac(0x1d6)+a31_0x27c26e['cyan'](_0x2dfae5)),0x0;}}function a31_0x1942(_0x18c97d,_0x2d6ef2){_0x18c97d=_0x18c97d-0x12d;const _0x1ae985=a31_0x1ae9();let _0x194293=_0x1ae985[_0x18c97d];return _0x194293;}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x263);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x168);async['execute'](_0x5863f7){const _0x28244f=a31_0x5bbcfa,{options:_0x37e129,args:_0x34689b,tdx:_0x27f64f}=_0x5863f7,_0x416365=_0x37e129,_0x307e5f=_0x34689b[0x0]||_0x37e129[_0x28244f(0x155)];if(!_0x307e5f)return showParentSegmentNotSetError(_0x28244f(0x21f)+_0x28244f(0x2f0)),0x1;const _0x335300=resolveYamlFile(_0x307e5f);if(!existsSync(_0x335300))return showFileNotFoundError(_0x335300,_0x307e5f),0x1;_0x416365[_0x28244f(0x28e)]&&(console[_0x28244f(0x207)]('Site:\x20'+_0x416365[_0x28244f(0x268)]),console[_0x28244f(0x207)](_0x28244f(0x280)+_0x335300));let _0x35e750;try{_0x35e750=readFileSync(_0x335300,_0x28244f(0x2dc));}catch(_0xbd715){const _0x3a4af9=_0xbd715 instanceof Error?_0xbd715[_0x28244f(0x284)]:String(_0xbd715);return console['error'](_0x28244f(0x2bb)+_0x3a4af9),0x1;}const _0x37f454=await withSpinner(_0x28244f(0x1f8),()=>_0x27f64f[_0x28244f(0x239)][_0x28244f(0x2e7)](_0x35e750),{'verbose':_0x416365[_0x28244f(0x28e)]}),_0x1517ab=_0x37f454[_0x28244f(0x15e)],{isNew:_0x4c36c8,name:_0x544267,hasChanges:_0x3113e2,diffFormatted:_0x1daa73}=_0x1517ab;if(!_0x3113e2)return console[_0x28244f(0x207)](_0x28244f(0x32a)+_0x544267+_0x28244f(0x2d2)),0x0;_0x4c36c8?console[_0x28244f(0x207)](_0x28244f(0x1dc)+_0x544267+'\x27:'):console[_0x28244f(0x207)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x544267+'\x27:');console['error']('─'[_0x28244f(0x1a6)](0x3c)),console[_0x28244f(0x207)](_0x1daa73),console['error']('─'['repeat'](0x3c));const _0x1df1f1=_0x4c36c8?_0x28244f(0x14c)+_0x544267+'\x27?':_0x28244f(0x2ed)+_0x544267+'\x27?';if(!_0x416365[_0x28244f(0x177)]){if(!isInteractive())return console[_0x28244f(0x207)](a31_0x27c26e[_0x28244f(0x172)](_0x28244f(0x238)),_0x28244f(0x2ac)),console[_0x28244f(0x207)](a31_0x27c26e['dim'](_0x28244f(0x167))),0x1;const _0x3f9d6a=await confirmKey(_0x1df1f1);if(!_0x3f9d6a)return console['error'](a31_0x27c26e[_0x28244f(0x27d)](_0x28244f(0x1f4))),0x1;}const _0x4d217c=_0x4c36c8?_0x28244f(0x1c9):_0x28244f(0x2a5),_0x5491ae=await withSpinner(_0x4d217c+'\x20parent\x20segment\x20\x27'+_0x544267+'\x27...',()=>_0x1517ab[_0x28244f(0x195)](),{'verbose':_0x416365[_0x28244f(0x28e)]}),_0x536438=_0x5491ae['data'],_0x220ad1=getConsoleNextUrl(_0x416365[_0x28244f(0x268)],_0x28244f(0x2c6)+_0x536438['id']),_0x12a90d=_0x4c36c8?_0x28244f(0x14d):_0x28244f(0x1dd);return console[_0x28244f(0x207)]('✔\x20'+_0x12a90d+_0x28244f(0x258)+_0x536438[_0x28244f(0x247)]+'\x27'),console[_0x28244f(0x207)]('\x20\x20'+_0x220ad1),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]='segment:parent:validate';['description']=a31_0x5bbcfa(0x277);async[a31_0x5bbcfa(0x232)](_0x4be27e){const _0x26384c=a31_0x5bbcfa,{options:_0x4613d7,args:_0x71ad04,tdx:_0x2ebe7a}=_0x4be27e,_0x323726=_0x4613d7,_0x5d13fe=_0x71ad04[0x0]||_0x4613d7[_0x26384c(0x155)];if(!_0x5d13fe)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'+_0x26384c(0x249)+'Options:\x0a'+_0x26384c(0x17c)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x26384c(0x2b9)),0x1;const _0x3a33f6=resolveYamlFile(_0x5d13fe);if(!existsSync(_0x3a33f6))return showFileNotFoundError(_0x3a33f6,_0x5d13fe),0x1;_0x323726[_0x26384c(0x28e)]&&(console[_0x26384c(0x207)](_0x26384c(0x297)+_0x323726['site']),console[_0x26384c(0x207)]('YAML\x20file:\x20'+_0x3a33f6));let _0x29074e;try{_0x29074e=readFileSync(_0x3a33f6,_0x26384c(0x2dc));}catch(_0x1e3b85){const _0x8675d6=_0x1e3b85 instanceof Error?_0x1e3b85[_0x26384c(0x284)]:String(_0x1e3b85);return console[_0x26384c(0x207)](_0x26384c(0x2bb)+_0x8675d6),0x1;}const _0xc26fad=createCommandSpinner(a31_0x27c26e['dim'](_0x26384c(0x24b)),{'verbose':_0x323726[_0x26384c(0x28e)]});_0xc26fad[_0x26384c(0x157)]();const _0x3e1e96={'onProgress':_0x13755a=>{const _0xab4537=_0x26384c;_0xc26fad[_0xab4537(0x19d)]=formatProgressMessage(_0x13755a);}};if(_0x323726[_0x26384c(0x289)])_0x3e1e96[_0x26384c(0x289)]=!![];if(_0x323726[_0x26384c(0x325)])_0x3e1e96[_0x26384c(0x325)]=!![];_0x323726['attribute']&&(_0x3e1e96['attribute']=_0x323726[_0x26384c(0x32e)]);_0x323726['behavior']&&(_0x3e1e96[_0x26384c(0x32d)]=_0x323726['behavior']);if(_0x323726[_0x26384c(0x22c)])_0x3e1e96[_0x26384c(0x22c)]=_0x323726[_0x26384c(0x22c)];let _0x19a7c8;try{_0x19a7c8=await _0x2ebe7a[_0x26384c(0x239)][_0x26384c(0x333)](_0x29074e,_0x3e1e96),_0xc26fad[_0x26384c(0x135)]();}catch(_0xd849fb){_0xc26fad[_0x26384c(0x135)]();throw _0xd849fb;}const _0x8b90c9=_0x323726['interval']||_0x26384c(0x27b);return this[_0x26384c(0x237)](_0x19a7c8,_0x3e1e96,_0x3a33f6,_0x8b90c9),_0x19a7c8[_0x26384c(0x150)]?0x0:0x1;}[a31_0x5bbcfa(0x237)](_0x5a05bd,_0x115567,_0x3f467e,_0x3d7a96){const _0x1aff85=a31_0x5bbcfa;console[_0x1aff85(0x207)]('\x0a'+a31_0x27c26e[_0x1aff85(0x146)](_0x1aff85(0x18f))+'\x20'+_0x5a05bd[_0x1aff85(0x247)]),console[_0x1aff85(0x207)]('═'[_0x1aff85(0x1a6)](0x3c)),this[_0x1aff85(0x182)](_0x5a05bd);if(typeof _0x115567[_0x1aff85(0x32e)]===_0x1aff85(0x310)){this[_0x1aff85(0x345)](_0x5a05bd),this['displaySummary'](_0x5a05bd),this[_0x1aff85(0x2e9)](_0x3f467e,_0x3d7a96,_0x1aff85(0x32e),_0x115567[_0x1aff85(0x32e)]);return;}if(_0x115567['attribute']===!![]){this[_0x1aff85(0x345)](_0x5a05bd),this[_0x1aff85(0x275)](_0x5a05bd),this[_0x1aff85(0x2e9)](_0x3f467e,_0x3d7a96,_0x1aff85(0x29e));return;}if(typeof _0x115567['behavior']===_0x1aff85(0x310)){this[_0x1aff85(0x30c)](_0x5a05bd,_0x3d7a96),this[_0x1aff85(0x275)](_0x5a05bd),this[_0x1aff85(0x2e9)](_0x3f467e,_0x3d7a96,'behavior',_0x115567['behavior']);return;}if(_0x115567[_0x1aff85(0x32d)]===!![]){this[_0x1aff85(0x30c)](_0x5a05bd,_0x3d7a96),this['displaySummary'](_0x5a05bd),this[_0x1aff85(0x2e9)](_0x3f467e,_0x3d7a96,_0x1aff85(0x1cf));return;}this[_0x1aff85(0x345)](_0x5a05bd),this[_0x1aff85(0x30c)](_0x5a05bd,_0x3d7a96),this['displayRealtimeInfo'](_0x5a05bd),this[_0x1aff85(0x275)](_0x5a05bd),this[_0x1aff85(0x2e9)](_0x3f467e,_0x3d7a96,_0x1aff85(0x2d6));}[a31_0x5bbcfa(0x1cc)](_0x4d9da2){displayRealtimeValidation(_0x4d9da2);}['displayPreviewHints'](_0x24a63c,_0x210d24,_0xf9bd83,_0x5e9e64){const _0x430bdf=a31_0x5bbcfa;console[_0x430bdf(0x207)]('\x0a'+a31_0x27c26e[_0x430bdf(0x1be)](_0x430bdf(0x2c5)));const _0xc19e19=_0x210d24!=='-1d'?_0x430bdf(0x267)+_0x210d24:'';if(_0xf9bd83==='attribute'&&_0x5e9e64)console[_0x430bdf(0x207)]('\x20\x20'+a31_0x27c26e['dim'](_0x430bdf(0x22e)+_0x24a63c+'\x20--attribute\x20\x22'+_0x5e9e64+'\x22'+_0xc19e19));else{if(_0xf9bd83==='behavior'&&_0x5e9e64)console[_0x430bdf(0x207)]('\x20\x20'+a31_0x27c26e[_0x430bdf(0x1be)](_0x430bdf(0x22e)+_0x24a63c+_0x430bdf(0x278)+_0x5e9e64+'\x22'+_0xc19e19));else(_0xf9bd83===_0x430bdf(0x29e)||_0xf9bd83===_0x430bdf(0x2d6))&&console['error']('\x20\x20'+a31_0x27c26e[_0x430bdf(0x1be)](_0x430bdf(0x22e)+_0x24a63c+_0x430bdf(0x160)+_0xc19e19));}(_0xf9bd83===_0x430bdf(0x1cf)||_0xf9bd83===_0x430bdf(0x2d6))&&console[_0x430bdf(0x207)]('\x20\x20'+a31_0x27c26e[_0x430bdf(0x1be)](_0x430bdf(0x22e)+_0x24a63c+_0x430bdf(0x2df)+_0xc19e19)),_0xf9bd83===_0x430bdf(0x2d6)&&console[_0x430bdf(0x207)]('\x20\x20'+a31_0x27c26e[_0x430bdf(0x1be)](_0x430bdf(0x22e)+_0x24a63c+_0x430bdf(0x2fd)+_0xc19e19));}[a31_0x5bbcfa(0x182)](_0x1cac96){const _0x37cafb=a31_0x5bbcfa,{master:_0x2a1c89}=_0x1cac96,_0x1d9c67=_0x2a1c89[_0x37cafb(0x353)]?a31_0x27c26e['green']('✔'):a31_0x27c26e[_0x37cafb(0x172)]('✘');console[_0x37cafb(0x207)]('\x0a'+a31_0x27c26e[_0x37cafb(0x1be)](_0x37cafb(0x1a4))),console[_0x37cafb(0x207)](_0x1d9c67+'\x20'+a31_0x27c26e[_0x37cafb(0x146)](_0x2a1c89[_0x37cafb(0x18e)]+'.'+_0x2a1c89['table'])),_0x2a1c89['schemaValid']?_0x2a1c89[_0x37cafb(0x156)]!==undefined&&console[_0x37cafb(0x207)]('\x20\x20'+a31_0x27c26e[_0x37cafb(0x1be)](_0x37cafb(0x2a6))+'\x20'+a31_0x27c26e[_0x37cafb(0x271)](formatRows(_0x2a1c89[_0x37cafb(0x156)]))):console[_0x37cafb(0x207)]('\x20\x20'+a31_0x27c26e['red'](_0x37cafb(0x224))+'\x20'+_0x2a1c89[_0x37cafb(0x29c)]);}[a31_0x5bbcfa(0x345)](_0x1faf4e){const _0x4918e4=a31_0x5bbcfa;if(_0x1faf4e[_0x4918e4(0x29e)]['length']===0x0)return;console[_0x4918e4(0x207)]('\x0a'+a31_0x27c26e[_0x4918e4(0x1be)](_0x4918e4(0x32c)));for(const _0x3c5e7d of _0x1faf4e[_0x4918e4(0x29e)]){const _0x749a18=_0x3c5e7d['schemaValid']?a31_0x27c26e[_0x4918e4(0x2a3)]('✔'):a31_0x27c26e[_0x4918e4(0x172)]('✘');let _0x569adb='';if(_0x3c5e7d['schemaValid']&&_0x3c5e7d[_0x4918e4(0x290)]!==undefined&&_0x3c5e7d[_0x4918e4(0x307)]!==undefined){const _0x38cf95=_0x3c5e7d[_0x4918e4(0x307)][_0x4918e4(0x18d)](0x1),_0x450539=_0x3c5e7d[_0x4918e4(0x307)]>=0x50?a31_0x27c26e[_0x4918e4(0x2a3)]:_0x3c5e7d[_0x4918e4(0x307)]>=0x32?a31_0x27c26e[_0x4918e4(0x27d)]:a31_0x27c26e[_0x4918e4(0x172)];_0x569adb='\x20'+a31_0x27c26e[_0x4918e4(0x1be)](_0x4918e4(0x33d))+'\x20'+_0x450539(_0x38cf95+'%')+'\x20('+formatRows(_0x3c5e7d[_0x4918e4(0x290)])+_0x4918e4(0x335);}console[_0x4918e4(0x207)](_0x749a18+'\x20'+a31_0x27c26e['bold'](_0x3c5e7d[_0x4918e4(0x247)])+_0x569adb),console[_0x4918e4(0x207)]('\x20\x20'+a31_0x27c26e[_0x4918e4(0x1be)](_0x4918e4(0x344))+'\x20'+a31_0x27c26e[_0x4918e4(0x146)](_0x3c5e7d[_0x4918e4(0x18e)]+'.'+_0x3c5e7d['table']));const _0x29b3a7=_0x3c5e7d[_0x4918e4(0x1cd)]===_0x3c5e7d['foreignKey']?a31_0x27c26e[_0x4918e4(0x1be)](_0x4918e4(0x1fb))+'\x20'+_0x3c5e7d[_0x4918e4(0x1cd)]:a31_0x27c26e['dim'](_0x4918e4(0x189))+'\x20'+_0x3c5e7d[_0x4918e4(0x1cd)]+_0x4918e4(0x1d6)+_0x3c5e7d[_0x4918e4(0x34b)];console[_0x4918e4(0x207)]('\x20\x20'+_0x29b3a7),console['error']('\x20\x20'+a31_0x27c26e[_0x4918e4(0x1be)](_0x4918e4(0x147))),this[_0x4918e4(0x283)](_0x3c5e7d['columns']),!_0x3c5e7d[_0x4918e4(0x353)]&&console[_0x4918e4(0x207)]('\x20\x20'+a31_0x27c26e['red']('Error:')+'\x20'+_0x3c5e7d[_0x4918e4(0x29c)]);}}[a31_0x5bbcfa(0x30c)](_0x5d49dd,_0x502623){const _0x46cdd1=a31_0x5bbcfa;if(_0x5d49dd[_0x46cdd1(0x1cf)][_0x46cdd1(0x141)]===0x0)return;console['error']('\x0a'+a31_0x27c26e[_0x46cdd1(0x1be)]('Behaviors')+'\x20'+a31_0x27c26e[_0x46cdd1(0x1be)]('('+_0x502623+')'));for(const _0x567925 of _0x5d49dd[_0x46cdd1(0x1cf)]){const _0x24f106=_0x567925[_0x46cdd1(0x353)]?a31_0x27c26e[_0x46cdd1(0x2a3)]('✔'):a31_0x27c26e[_0x46cdd1(0x172)]('✘');let _0x51bec4='';if(_0x567925[_0x46cdd1(0x353)]&&_0x567925[_0x46cdd1(0x187)]!==undefined&&_0x567925[_0x46cdd1(0x260)]!==undefined){const _0x143d52=_0x567925['customerPercent']?.[_0x46cdd1(0x18d)](0x1)||'?',_0x309047=(_0x567925[_0x46cdd1(0x25b)]??0x0)>=0x32?a31_0x27c26e['green']:(_0x567925['customerPercent']??0x0)>=0x14?a31_0x27c26e[_0x46cdd1(0x27d)]:a31_0x27c26e['red'];_0x51bec4='\x20'+a31_0x27c26e[_0x46cdd1(0x1be)](_0x46cdd1(0x256))+'\x20'+_0x309047(formatRows(_0x567925[_0x46cdd1(0x187)]))+'\x20('+_0x143d52+_0x46cdd1(0x2aa)+a31_0x27c26e['dim'](_0x46cdd1(0x33a))+'\x20'+a31_0x27c26e[_0x46cdd1(0x271)](formatRows(_0x567925[_0x46cdd1(0x260)]));}console[_0x46cdd1(0x207)](_0x24f106+'\x20'+a31_0x27c26e[_0x46cdd1(0x146)](_0x567925[_0x46cdd1(0x247)])+_0x51bec4),console['error']('\x20\x20'+a31_0x27c26e[_0x46cdd1(0x1be)]('Source:')+'\x20'+a31_0x27c26e[_0x46cdd1(0x146)](_0x567925[_0x46cdd1(0x18e)]+'.'+_0x567925['table']));const _0xfc907c=_0x567925['joinKey']===_0x567925['foreignKey']?a31_0x27c26e[_0x46cdd1(0x1be)](_0x46cdd1(0x1fb))+'\x20'+_0x567925['joinKey']:a31_0x27c26e['dim']('Join:')+'\x20'+_0x567925[_0x46cdd1(0x1cd)]+_0x46cdd1(0x1d6)+_0x567925[_0x46cdd1(0x34b)];console[_0x46cdd1(0x207)]('\x20\x20'+_0xfc907c),console[_0x46cdd1(0x207)]('\x20\x20'+a31_0x27c26e['dim'](_0x46cdd1(0x147))),this[_0x46cdd1(0x283)](_0x567925[_0x46cdd1(0x218)]),!_0x567925['schemaValid']&&console[_0x46cdd1(0x207)]('\x20\x20'+a31_0x27c26e[_0x46cdd1(0x172)](_0x46cdd1(0x224))+'\x20'+_0x567925[_0x46cdd1(0x29c)]);}}['displayColumns'](_0x112904){const _0x47d278=a31_0x5bbcfa;for(const _0x2c16bd of _0x112904){_0x2c16bd['label']===_0x2c16bd[_0x47d278(0x1ab)]||_0x2c16bd['column']==='*'?console[_0x47d278(0x207)](_0x47d278(0x2d3)+_0x2c16bd[_0x47d278(0x134)]):console[_0x47d278(0x207)](_0x47d278(0x2d3)+_0x2c16bd['label']+'\x20'+a31_0x27c26e[_0x47d278(0x1be)]('('+_0x2c16bd['column']+')'));}}[a31_0x5bbcfa(0x275)](_0xccb7c5){const _0x35af40=a31_0x5bbcfa;console[_0x35af40(0x207)]('─'['repeat'](0x3c));if(_0xccb7c5[_0x35af40(0x20f)][_0x35af40(0x141)]>0x0){console[_0x35af40(0x207)]('\x0a'+a31_0x27c26e[_0x35af40(0x172)](_0x35af40(0x259)));for(const _0x2c72a7 of _0xccb7c5['errors']){console[_0x35af40(0x207)]('\x20\x20'+a31_0x27c26e[_0x35af40(0x172)]('•')+'\x20'+_0x2c72a7);}}_0xccb7c5[_0x35af40(0x150)]&&console[_0x35af40(0x207)]('\x0a'+a31_0x27c26e[_0x35af40(0x2a3)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x349);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x163);async['execute'](_0x31085d){const _0x41dee3=a31_0x5bbcfa,{options:_0x34d12a,args:_0x46bf65,tdx:_0x2d8218}=_0x31085d,_0x102c5b=_0x34d12a,_0xb86117=_0x46bf65[0x0]||_0x34d12a[_0x41dee3(0x155)];if(!_0xb86117)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'+_0x41dee3(0x300)+_0x41dee3(0x171)+_0x41dee3(0x31d)+_0x41dee3(0x19f)+_0x41dee3(0x296)+_0x41dee3(0x2b9)),0x1;if(!_0x102c5b[_0x41dee3(0x289)]&&!_0x102c5b[_0x41dee3(0x32e)]&&!_0x102c5b[_0x41dee3(0x32d)]&&!_0x102c5b[_0x41dee3(0x325)])return console[_0x41dee3(0x207)](a31_0x27c26e['red'](_0x41dee3(0x2a1))),console[_0x41dee3(0x207)](_0x41dee3(0x331)),console['error'](_0x41dee3(0x316)),console[_0x41dee3(0x207)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x41dee3(0x207)](_0x41dee3(0x34d)),console['error'](_0x41dee3(0x28c)),console['error']('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x5d6fda=resolveYamlFile(_0xb86117);if(!existsSync(_0x5d6fda))return showFileNotFoundError(_0x5d6fda,_0xb86117),0x1;_0x102c5b[_0x41dee3(0x28e)]&&(console[_0x41dee3(0x207)]('Site:\x20'+_0x102c5b[_0x41dee3(0x268)]),console[_0x41dee3(0x207)](_0x41dee3(0x280)+_0x5d6fda));let _0x25fa11;try{_0x25fa11=readFileSync(_0x5d6fda,_0x41dee3(0x2dc));}catch(_0x469368){const _0xc6b1de=_0x469368 instanceof Error?_0x469368[_0x41dee3(0x284)]:String(_0x469368);return console[_0x41dee3(0x207)](_0x41dee3(0x2bb)+_0xc6b1de),0x1;}let _0x398b7e;try{_0x398b7e=parseDef(_0x25fa11);}catch(_0x1cfd52){const _0x392700=_0x1cfd52 instanceof Error?_0x1cfd52['message']:String(_0x1cfd52);return console[_0x41dee3(0x207)](a31_0x27c26e[_0x41dee3(0x172)]('Error\x20parsing\x20YAML:\x20'+_0x392700)),0x1;}if(_0x102c5b['attribute']===!![]||_0x102c5b['attribute']===''){const _0x4bc442=_0x398b7e[_0x41dee3(0x29e)]?.['map'](_0x3d91ab=>_0x3d91ab[_0x41dee3(0x247)])||[];if(_0x4bc442['length']===0x0)console[_0x41dee3(0x207)](a31_0x27c26e['red'](_0x41dee3(0x1b4)));else{console[_0x41dee3(0x207)](a31_0x27c26e[_0x41dee3(0x172)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x41dee3(0x207)](_0x41dee3(0x1b7));for(const _0x2595d8 of _0x4bc442){console[_0x41dee3(0x207)]('\x20\x20'+a31_0x27c26e[_0x41dee3(0x271)](_0x2595d8));}console['error'](_0x41dee3(0x24a)+_0xb86117+_0x41dee3(0x220)+_0x4bc442[0x0]+'\x22');}return 0x1;}if(_0x102c5b['behavior']===!![]||_0x102c5b[_0x41dee3(0x32d)]===''){const _0x161e95=_0x398b7e[_0x41dee3(0x1cf)]?.[_0x41dee3(0x20a)](_0x1f54a3=>_0x1f54a3[_0x41dee3(0x247)])||[];if(_0x161e95['length']===0x0)console[_0x41dee3(0x207)](a31_0x27c26e['red'](_0x41dee3(0x2cd)));else{console[_0x41dee3(0x207)](a31_0x27c26e[_0x41dee3(0x172)](_0x41dee3(0x318))),console[_0x41dee3(0x207)]('Available\x20behaviors:');for(const _0x5acc64 of _0x161e95){console['error']('\x20\x20'+a31_0x27c26e['cyan'](_0x5acc64));}console['error'](_0x41dee3(0x24a)+_0xb86117+_0x41dee3(0x278)+_0x161e95[0x0]+'\x22');}return 0x1;}const _0x18b2ec=createCommandSpinner(a31_0x27c26e[_0x41dee3(0x1be)]('Fetching\x20sample\x20data...'),{'verbose':_0x102c5b[_0x41dee3(0x28e)]});_0x18b2ec[_0x41dee3(0x157)]();const _0x5af7bc={'onProgress':_0x3fdb2f=>{const _0x42097f=_0x41dee3;_0x18b2ec[_0x42097f(0x19d)]=formatProgressMessage(_0x3fdb2f);}};if(_0x102c5b[_0x41dee3(0x289)])_0x5af7bc[_0x41dee3(0x289)]=!![];if(_0x102c5b[_0x41dee3(0x32e)]&&typeof _0x102c5b['attribute']===_0x41dee3(0x310))_0x5af7bc[_0x41dee3(0x32e)]=_0x102c5b[_0x41dee3(0x32e)];if(_0x102c5b['behavior']&&typeof _0x102c5b['behavior']==='string')_0x5af7bc[_0x41dee3(0x32d)]=_0x102c5b['behavior'];if(_0x102c5b[_0x41dee3(0x325)])_0x5af7bc[_0x41dee3(0x325)]=!![];if(_0x102c5b['interval'])_0x5af7bc[_0x41dee3(0x22c)]=_0x102c5b[_0x41dee3(0x22c)];let _0xd4b191;try{_0xd4b191=await _0x2d8218[_0x41dee3(0x239)][_0x41dee3(0x28b)](_0x25fa11,_0x5af7bc),_0x18b2ec['stop']();}catch(_0x21d59c){_0x18b2ec[_0x41dee3(0x135)]();throw _0x21d59c;}return await this[_0x41dee3(0x304)](_0xd4b191,{'master':_0x102c5b[_0x41dee3(0x289)],'attribute':typeof _0x102c5b[_0x41dee3(0x32e)]==='string'?_0x102c5b[_0x41dee3(0x32e)]:undefined,'behavior':typeof _0x102c5b[_0x41dee3(0x32d)]===_0x41dee3(0x310)?_0x102c5b['behavior']:undefined,'enriched':_0x102c5b['enriched']}),_0xd4b191['allValid']?0x0:0x1;}async[a31_0x5bbcfa(0x304)](_0x497858,_0x23254e){const _0x4571bc=a31_0x5bbcfa;console[_0x4571bc(0x207)]('\x0a'+a31_0x27c26e[_0x4571bc(0x146)](_0x4571bc(0x26e))+'\x20'+_0x497858[_0x4571bc(0x247)]),console[_0x4571bc(0x207)]('═'['repeat'](0x3c));if(_0x23254e[_0x4571bc(0x289)]&&_0x497858['sampleData']){const _0x143eca=a31_0x27c26e['dim']('Master:')+'\x20'+a31_0x27c26e[_0x4571bc(0x146)](_0x497858[_0x4571bc(0x289)][_0x4571bc(0x18e)]+'.'+_0x497858[_0x4571bc(0x289)]['table']);await this[_0x4571bc(0x15a)](_0x143eca,_0x497858[_0x4571bc(0x2cb)]);}else{if(_0x23254e[_0x4571bc(0x32e)]&&_0x497858[_0x4571bc(0x2cb)]){const _0x9ab3fa=a31_0x27c26e[_0x4571bc(0x1be)](_0x4571bc(0x1ef))+'\x20'+a31_0x27c26e['bold'](_0x23254e[_0x4571bc(0x32e)]);await this[_0x4571bc(0x15a)](_0x9ab3fa,_0x497858['sampleData']);}else{if(_0x23254e['behavior']&&_0x497858[_0x4571bc(0x2cb)]){const _0xd0bc01=a31_0x27c26e[_0x4571bc(0x1be)](_0x4571bc(0x173))+'\x20'+a31_0x27c26e[_0x4571bc(0x146)](_0x23254e[_0x4571bc(0x32d)]);await this[_0x4571bc(0x15a)](_0xd0bc01,_0x497858[_0x4571bc(0x2cb)]);}else{if(_0x23254e[_0x4571bc(0x325)]&&_0x497858[_0x4571bc(0x2cb)]){const _0x60c65d=a31_0x27c26e[_0x4571bc(0x1be)](_0x4571bc(0x1f2))+'\x20'+a31_0x27c26e['bold'](_0x4571bc(0x2e2));await this[_0x4571bc(0x15a)](_0x60c65d,_0x497858[_0x4571bc(0x2cb)]);}else!_0x497858[_0x4571bc(0x2cb)]&&console[_0x4571bc(0x207)](_0x4571bc(0x29a));}}}if(_0x497858['errors'][_0x4571bc(0x141)]>0x0){console[_0x4571bc(0x207)]('─'[_0x4571bc(0x1a6)](0x3c)),console[_0x4571bc(0x207)]('\x0a'+a31_0x27c26e[_0x4571bc(0x172)](_0x4571bc(0x259)));for(const _0xa50616 of _0x497858[_0x4571bc(0x20f)]){console[_0x4571bc(0x207)]('\x20\x20'+a31_0x27c26e['red']('•')+'\x20'+_0xa50616);}}}async['displaySampleData'](_0x5ebab4,_0x15ca3b){const _0x579b02=a31_0x5bbcfa;if(_0x15ca3b[_0x579b02(0x141)]===0x0){console[_0x579b02(0x207)]('\x0a'+_0x5ebab4),console['error'](_0x579b02(0x197));return;}console['error']('\x0a'+_0x5ebab4);const _0x5dc6cc=Object[_0x579b02(0x2a0)](_0x15ca3b[0x0])[_0x579b02(0x20a)](_0x54e417=>({'name':_0x54e417,'type':typeof _0x15ca3b[0x0][_0x54e417]===_0x579b02(0x1ea)?_0x579b02(0x175):_0x579b02(0x2f7)})),_0x2031da={'queryId':_0x579b02(0x334),'columns':_0x5dc6cc,'data':_0x15ca3b,'stats':{'state':_0x579b02(0x165),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x15ca3b[_0x579b02(0x141)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x350031=formatAsTable(_0x2031da,_0x15ca3b[_0x579b02(0x141)],!![]);await writeOutput(_0x350031,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a31_0x5bbcfa(0x142);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x12e);async['execute'](_0x265e55){const _0x25762e=a31_0x5bbcfa,{options:_0x272567,args:_0x1cbd09,tdx:_0xd8cdbc}=_0x265e55,_0x37cc08=_0x272567,_0x1bb08c=_0x1cbd09[0x0]||_0x272567[_0x25762e(0x155)];if(!_0x1bb08c)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+_0x25762e(0x23e)),0x1;const _0x5ecead=resolveYamlFile(_0x1bb08c);if(existsSync(_0x5ecead)){_0x37cc08[_0x25762e(0x28e)]&&console['error']('Found\x20YAML\x20file:\x20'+_0x5ecead);let _0x1eaa22;try{_0x1eaa22=readFileSync(_0x5ecead,_0x25762e(0x2dc));}catch(_0x533311){const _0x405765=_0x533311 instanceof Error?_0x533311[_0x25762e(0x284)]:String(_0x533311);return console[_0x25762e(0x207)](_0x25762e(0x2bb)+_0x405765),0x1;}const _0x40cf23=await withSpinner(_0x25762e(0x1f8),()=>_0xd8cdbc[_0x25762e(0x239)][_0x25762e(0x2e7)](_0x1eaa22),{'verbose':_0x37cc08[_0x25762e(0x28e)]}),_0x1d8fb9=_0x40cf23[_0x25762e(0x15e)],{isNew:_0x16470b,name:_0x25902d,hasChanges:_0x432f41,diffFormatted:_0x1610f9}=_0x1d8fb9;if(_0x432f41){_0x16470b?console[_0x25762e(0x207)](_0x25762e(0x1dc)+_0x25902d+'\x27:'):console['error'](_0x25762e(0x21a)+_0x25902d+'\x27:');console['error']('─'[_0x25762e(0x1a6)](0x3c)),console[_0x25762e(0x207)](_0x1610f9),console[_0x25762e(0x207)]('─'[_0x25762e(0x1a6)](0x3c));const _0x36b844=_0x16470b?'Create\x20parent\x20segment\x20\x27'+_0x25902d+_0x25762e(0x309):_0x25762e(0x2ed)+_0x25902d+_0x25762e(0x309);if(!_0x37cc08['yes']){if(!isInteractive())return console[_0x25762e(0x207)](a31_0x27c26e['red'](_0x25762e(0x238)),_0x25762e(0x2ac)),console[_0x25762e(0x207)](a31_0x27c26e[_0x25762e(0x1be)](_0x25762e(0x167))),0x1;const _0x43501c=await confirmKey(_0x36b844);if(!_0x43501c)return console[_0x25762e(0x207)](a31_0x27c26e[_0x25762e(0x27d)](_0x25762e(0x1f4))),0x1;}const _0x142a36=_0x16470b?'Creating':_0x25762e(0x2a5);await withSpinner(_0x142a36+'\x20parent\x20segment\x20\x27'+_0x25902d+_0x25762e(0x185),()=>_0x1d8fb9['apply'](),{'verbose':_0x37cc08[_0x25762e(0x28e)]});const _0x28d8a8=_0x16470b?_0x25762e(0x14d):_0x25762e(0x1dd);console[_0x25762e(0x207)]('✔\x20'+_0x28d8a8+_0x25762e(0x258)+_0x25902d+'\x27');}else console[_0x25762e(0x207)](_0x25762e(0x32a)+_0x25902d+_0x25762e(0x1c8));}const _0x187bee=await withSpinner(_0x25762e(0x192)+_0x1bb08c+_0x25762e(0x185),()=>_0xd8cdbc[_0x25762e(0x239)][_0x25762e(0x1b0)](_0x1bb08c),{'verbose':_0x37cc08[_0x25762e(0x28e)]}),_0x21fdd7=_0x187bee[_0x25762e(0x15e)],_0x422080=getConsoleUrl(_0x37cc08[_0x25762e(0x268)],_0x25762e(0x30f)+_0x21fdd7[_0x25762e(0x348)]+_0x25762e(0x1d2)+_0x21fdd7['workflowSessionId']+_0x25762e(0x1bf)+_0x21fdd7[_0x25762e(0x227)]);return console[_0x25762e(0x207)](_0x25762e(0x180)),console[_0x25762e(0x207)]('\x20\x20'+a31_0x27c26e[_0x25762e(0x1be)](_0x25762e(0x23b))+'\x20'+_0x21fdd7[_0x25762e(0x244)]),console[_0x25762e(0x207)]('\x20\x20'+a31_0x27c26e[_0x25762e(0x1be)](_0x25762e(0x1c3))+'\x20'+_0x21fdd7[_0x25762e(0x1b3)]),console[_0x25762e(0x207)]('\x20\x20'+a31_0x27c26e['dim'](_0x25762e(0x26f))+'\x20'+_0x21fdd7[_0x25762e(0x250)]),console['error']('\x20\x20'+a31_0x27c26e[_0x25762e(0x1be)](_0x25762e(0x2f5))+'\x20'+_0x21fdd7[_0x25762e(0x227)]),console[_0x25762e(0x207)]('\x20\x20'+_0x422080),console[_0x25762e(0x207)]('\x0a'+a31_0x27c26e['dim'](_0x25762e(0x15f))+_0x25762e(0x240)+_0x21fdd7[_0x25762e(0x227)]+_0x25762e(0x2db)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a31_0x5bbcfa(0x254);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x313);async[a31_0x5bbcfa(0x232)](_0x60473b){const _0x97f894=a31_0x5bbcfa,{options:_0x23d7ad,args:_0x1691ca,tdx:_0x326f55}=_0x60473b,_0x322680=_0x1691ca[0x0]||_0x23d7ad[_0x97f894(0x155)];if(!_0x322680)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'+_0x97f894(0x2c9)),0x1;_0x23d7ad[_0x97f894(0x28e)]&&(console[_0x97f894(0x207)](_0x97f894(0x297)+_0x23d7ad[_0x97f894(0x268)]),console[_0x97f894(0x207)](_0x97f894(0x20b)+_0x322680));const _0x358f98=await withSpinner(_0x97f894(0x2fc)+_0x322680+_0x97f894(0x185),()=>_0x326f55[_0x97f894(0x239)][_0x97f894(0x2ce)](_0x322680),{'verbose':_0x23d7ad[_0x97f894(0x28e)]}),_0x381e7d=_0x358f98['data'];console[_0x97f894(0x207)](_0x97f894(0x2c1)+_0x381e7d[_0x97f894(0x141)]+_0x97f894(0x251)+(_0x381e7d[_0x97f894(0x141)]!==0x1?'s':''));if(_0x23d7ad[_0x97f894(0x2bc)]||_0x23d7ad[_0x97f894(0x1d0)])return await handleSDKOutput(_0x381e7d,_0x23d7ad),0x0;return displayFieldsHumanReadable(_0x381e7d,_0x322680),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x29b);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x24c);async['execute'](_0x5bb967){const _0x5ce4f3=a31_0x5bbcfa,{options:_0x192007,args:_0x8947a2,tdx:_0x3f7efe}=_0x5bb967,_0x864412=_0x192007,_0x2f677b=_0x8947a2[0x0]||_0x192007['parentSegment'];if(!_0x2f677b)return showParentSegmentNotSetError(_0x5ce4f3(0x1c5)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x5ce4f3(0x2fa)+_0x5ce4f3(0x2b7)),0x1;_0x192007[_0x5ce4f3(0x28e)]&&(console[_0x5ce4f3(0x207)](_0x5ce4f3(0x297)+_0x192007[_0x5ce4f3(0x268)]),console[_0x5ce4f3(0x207)](_0x5ce4f3(0x20b)+_0x2f677b));const _0x153bad=await withSpinner(_0x5ce4f3(0x305)+_0x2f677b+'\x27...',()=>_0x3f7efe[_0x5ce4f3(0x239)]['getParentFull'](_0x2f677b),{'verbose':_0x192007[_0x5ce4f3(0x28e)]}),_0x56b599=_0x153bad[_0x5ce4f3(0x15e)];if(_0x864412[_0x5ce4f3(0x2fb)]){const _0x38b9ea=getConsoleNextUrl(_0x864412[_0x5ce4f3(0x268)],_0x5ce4f3(0x2c6)+_0x56b599['id']);return console[_0x5ce4f3(0x207)](a31_0x27c26e[_0x5ce4f3(0x2a3)]('✔')+'\x20Opening\x20'+a31_0x27c26e[_0x5ce4f3(0x271)](_0x38b9ea)),openBrowser(_0x38b9ea),0x0;}return await handleSingleObjectOutput(_0x56b599,_0x192007),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x2ee);['description']=a31_0x5bbcfa(0x311);async[a31_0x5bbcfa(0x232)](_0x301600){const _0x181de7=a31_0x5bbcfa,{options:_0x3a11d8,args:_0x2adcbc,tdx:_0x546a71}=_0x301600,_0x4a7964=_0x3a11d8,_0x4b2d4f=_0x2adcbc[0x0]||_0x3a11d8[_0x181de7(0x155)];if(!_0x4b2d4f)return showParentSegmentNotSetError(_0x181de7(0x242)+_0x181de7(0x323)+_0x181de7(0x2fa)+_0x181de7(0x1b6)),0x1;_0x3a11d8[_0x181de7(0x28e)]&&(console['error'](_0x181de7(0x297)+_0x3a11d8[_0x181de7(0x268)]),console[_0x181de7(0x207)](_0x181de7(0x20b)+_0x4b2d4f));const _0x5d55af=await withSpinner(_0x181de7(0x253)+_0x4b2d4f+_0x181de7(0x185),()=>_0x546a71['segment'][_0x181de7(0x1a8)](_0x4b2d4f),{'verbose':_0x3a11d8[_0x181de7(0x28e)]}),_0x3a4fa0=_0x5d55af[_0x181de7(0x15e)],_0x5508ae=_0x546a71['segment'][_0x181de7(0x22a)](_0x3a4fa0);if(_0x4a7964[_0x181de7(0x139)]){const _0x23ae14=await this[_0x181de7(0x1d5)](_0x301600,_0x4b2d4f,_0x3a4fa0,_0x5508ae),_0x1dc209=this[_0x181de7(0x25c)](_0x23ae14);writeFileSync(_0x4a7964['output'],_0x1dc209);const _0x4e3166=_0x23ae14[_0x181de7(0x188)]['columns'][_0x181de7(0x141)]+_0x23ae14['behaviors'][_0x181de7(0x33f)]((_0x12541d,_0x223a4f)=>_0x12541d+_0x223a4f[_0x181de7(0x218)][_0x181de7(0x141)],0x0),_0x5d1554=_0x23ae14[_0x181de7(0x1cf)]['filter'](_0x941f24=>_0x941f24['columns'][_0x181de7(0x141)]===0x0)['length'];return console[_0x181de7(0x337)](_0x181de7(0x1e7)+_0x4a7964[_0x181de7(0x139)]),console['log'](_0x181de7(0x236)+_0x5508ae),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x23ae14[_0x181de7(0x1cf)][_0x181de7(0x141)]+_0x181de7(0x285)),console[_0x181de7(0x337)]('\x20\x20Columns:\x20'+_0x4e3166+'\x20total'),_0x5d1554>0x0&&console[_0x181de7(0x337)]('\x20\x20Note:\x20'+_0x5d1554+_0x181de7(0x17f)),0x0;}console[_0x181de7(0x207)]('\x0a'+a31_0x27c26e[_0x181de7(0x146)](_0x181de7(0x23d))+'\x20'+a31_0x27c26e[_0x181de7(0x271)](_0x5508ae));const _0x76b809=await withSpinner(_0x181de7(0x1c7),()=>_0x546a71[_0x181de7(0x239)][_0x181de7(0x17a)](_0x3a4fa0),{'verbose':_0x3a11d8['verbose']});console['error']('\x0a'+a31_0x27c26e[_0x181de7(0x146)](_0x181de7(0x188))+'\x20'+a31_0x27c26e[_0x181de7(0x1be)]('('+_0x5508ae+_0x181de7(0x181)));const _0x376175=await executeSchemaQuery(_0x76b809[_0x181de7(0x15e)],_0x546a71,_0x3a11d8);await handleQueryOutput(_0x376175,_0x3a11d8);const _0x175e6f=await withSpinner(_0x181de7(0x293),()=>_0x546a71[_0x181de7(0x239)][_0x181de7(0x23c)](_0x3a4fa0),{'verbose':_0x3a11d8[_0x181de7(0x28e)]});for(const _0x2e7b3a of _0x175e6f[_0x181de7(0x15e)]){const _0xbacfc1=_0x181de7(0x231)+_0x2e7b3a['toLowerCase']()[_0x181de7(0x261)](/\s+/g,'_'),_0x3e53b3='SELECT\x20*\x20FROM\x20'+_0x5508ae+'.'+_0xbacfc1;console['error']('\x0a'+a31_0x27c26e[_0x181de7(0x146)](_0x2e7b3a)+'\x20'+a31_0x27c26e[_0x181de7(0x1be)]('('+_0x5508ae+'.'+_0xbacfc1+')'));try{const _0x5ec359=await executeSchemaQuery(_0x3e53b3,_0x546a71,_0x3a11d8);await handleQueryOutput(_0x5ec359,_0x3a11d8);}catch{console[_0x181de7(0x207)](a31_0x27c26e[_0x181de7(0x27d)](_0x181de7(0x1fd)));}}return 0x0;}async[a31_0x5bbcfa(0x1d5)](_0x2725cc,_0x2b0e2b,_0x567672,_0x41a84a){const _0x1b7d30=a31_0x5bbcfa,{options:_0x41456e,tdx:_0x39b357}=_0x2725cc,_0x3fbf27=await withSpinner(_0x1b7d30(0x1c7),()=>_0x39b357[_0x1b7d30(0x239)][_0x1b7d30(0x17a)](_0x567672),{'verbose':_0x41456e['verbose']}),_0x63dd12=await executeSchemaQuery(_0x3fbf27[_0x1b7d30(0x15e)],_0x39b357,_0x41456e),_0x5cd543=_0x63dd12[_0x1b7d30(0x15e)][_0x1b7d30(0x20a)](_0x2b1213=>({'name':_0x2b1213[_0x1b7d30(0x2bf)],'type':_0x2b1213['column_type']})),_0x53fe3b=await withSpinner(_0x1b7d30(0x293),()=>_0x39b357[_0x1b7d30(0x239)][_0x1b7d30(0x23c)](_0x567672),{'verbose':_0x41456e[_0x1b7d30(0x28e)]}),_0x3f8dbd=[];for(const _0x54ac41 of _0x53fe3b[_0x1b7d30(0x15e)]){const _0x553a5d=_0x1b7d30(0x231)+_0x54ac41['toLowerCase']()['replace'](/\s+/g,'_'),_0x5bdfbe=_0x1b7d30(0x13c)+_0x41a84a+'.'+_0x553a5d;let _0x352824=[];try{const _0x21ea4e=await executeSchemaQuery(_0x5bdfbe,_0x39b357,_0x41456e);_0x352824=_0x21ea4e[_0x1b7d30(0x15e)][_0x1b7d30(0x20a)](_0x21afc7=>({'name':_0x21afc7['column_name'],'type':_0x21afc7['column_type']}));}catch{}_0x3f8dbd[_0x1b7d30(0x246)]({'table':_0x553a5d,'columns':_0x352824});}return{'database':_0x41a84a,'parent_segment':_0x2b0e2b,'parent_id':_0x567672,'customers':{'table':_0x1b7d30(0x188),'columns':_0x5cd543},'behaviors':_0x3f8dbd};}['formatSchemaJson'](_0x402023){const _0x4bf8d6=a31_0x5bbcfa,_0x58525c=_0x262c60=>{const _0x24ee3c=a31_0x1942;if(_0x262c60[_0x24ee3c(0x141)]===0x0)return'[]';const _0x4eed12=_0x262c60[_0x24ee3c(0x20a)](_0xf00b70=>_0x24ee3c(0x252)+_0xf00b70[_0x24ee3c(0x247)]+'\x22,\x20\x22type\x22:\x20\x22'+_0xf00b70[_0x24ee3c(0x257)]+_0x24ee3c(0x1d8));return'[\x0a'+_0x4eed12['join'](',\x0a')+_0x24ee3c(0x1bb);},_0x50eb4c=_0x402023[_0x4bf8d6(0x1cf)][_0x4bf8d6(0x20a)](_0x475410=>{const _0x38000b=_0x4bf8d6;return _0x38000b(0x347)+_0x475410[_0x38000b(0x1fe)]+_0x38000b(0x28a)+_0x58525c(_0x475410[_0x38000b(0x218)])[_0x38000b(0x261)](/^/gm,'\x20\x20')[_0x38000b(0x164)]()+_0x38000b(0x346);})['join'](',\x0a');return _0x4bf8d6(0x1d4)+_0x402023[_0x4bf8d6(0x18e)]+_0x4bf8d6(0x1ac)+_0x402023[_0x4bf8d6(0x2a9)]+_0x4bf8d6(0x302)+_0x402023['parent_id']+_0x4bf8d6(0x350)+_0x402023['customers'][_0x4bf8d6(0x1fe)]+_0x4bf8d6(0x1e2)+_0x58525c(_0x402023[_0x4bf8d6(0x188)][_0x4bf8d6(0x218)])[_0x4bf8d6(0x261)](/^/gm,'\x20\x20')['trim']()+_0x4bf8d6(0x2da)+_0x50eb4c+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x14f);[a31_0x5bbcfa(0x2f6)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async['execute'](_0xdc07ef){const _0x4f515d=a31_0x5bbcfa,{options:_0x3011f0,args:_0x2ca152,tdx:_0x5f0ee2}=_0xdc07ef,_0x5d41f6=_0x2ca152[0x0]||_0x3011f0[_0x4f515d(0x155)];if(!_0x5d41f6)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x4f515d(0x16c)),0x1;_0x3011f0[_0x4f515d(0x28e)]&&(console[_0x4f515d(0x207)](_0x4f515d(0x297)+_0x3011f0[_0x4f515d(0x268)]),console['error'](_0x4f515d(0x20b)+_0x5d41f6));const _0x343173=await withSpinner(_0x4f515d(0x253)+_0x5d41f6+_0x4f515d(0x185),()=>_0x5f0ee2[_0x4f515d(0x239)][_0x4f515d(0x1a8)](_0x5d41f6),{'verbose':_0x3011f0[_0x4f515d(0x28e)]}),_0x255043=_0x343173['data'],_0x319b8f=await withSpinner(_0x4f515d(0x26a)+_0x5d41f6+'\x27...',()=>_0x5f0ee2[_0x4f515d(0x239)][_0x4f515d(0x17a)](_0x255043),{'verbose':_0x3011f0[_0x4f515d(0x28e)]}),_0x522f2f=_0x319b8f['data'];return _0x3011f0[_0x4f515d(0x27e)]==='json'||_0x3011f0[_0x4f515d(0x27e)]===_0x4f515d(0x1d0)?await handleSDKOutput([{'sql':_0x522f2f}],_0x3011f0):console[_0x4f515d(0x337)](_0x522f2f),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x322);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x138);async[a31_0x5bbcfa(0x232)](_0x42b4ab){const _0x90db13=a31_0x5bbcfa,{options:_0x244ecb,args:_0x34475a,tdx:_0x2ade20}=_0x42b4ab,_0x4d447f=_0x34475a[0x0]||_0x244ecb[_0x90db13(0x155)];if(!_0x4d447f)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'+_0x90db13(0x228)),0x1;_0x244ecb['verbose']&&(console['error'](_0x90db13(0x297)+_0x244ecb['site']),console[_0x90db13(0x207)](_0x90db13(0x20b)+_0x4d447f));const _0x16b542=await withSpinner(_0x90db13(0x253)+_0x4d447f+_0x90db13(0x185),()=>_0x2ade20[_0x90db13(0x239)]['resolveParentId'](_0x4d447f),{'verbose':_0x244ecb['verbose']}),_0x5c282e=_0x16b542[_0x90db13(0x15e)],_0x1f15f2=await withSpinner(_0x90db13(0x26a)+_0x4d447f+'\x27...',()=>_0x2ade20['segment']['getParentSQL'](_0x5c282e),{'verbose':_0x244ecb[_0x90db13(0x28e)]});let _0x70fc6e=_0x1f15f2[_0x90db13(0x15e)];const _0x261fd7=resolveLimit(_0x244ecb['limit'],DEFAULT_DISPLAY_LIMIT),_0xec04c0=/\bLIMIT\s+\d+/i[_0x90db13(0x205)](_0x70fc6e);!_0xec04c0&&(_0x70fc6e=_0x70fc6e[_0x90db13(0x164)]()[_0x90db13(0x261)](/;+$/,''),_0x70fc6e=_0x90db13(0x2c0)+_0x70fc6e+_0x90db13(0x2f3)+_0x261fd7);_0x244ecb['verbose']&&console['error'](_0x90db13(0x317)+_0x70fc6e);const _0x5d44a5=await withProgressSpinner(_0x90db13(0x229),async _0x3d231e=>{const _0x39815b=_0x90db13,_0x506770=await _0x2ade20[_0x39815b(0x1ad)]['execute'](_0x70fc6e,{'catalog':'td','schema':_0x39815b(0x230),'onJobId':_0x45baea=>{const _0x4a87f8=_0x39815b;_0x3d231e[_0x4a87f8(0x1e4)](_0x45baea);}});return _0x506770;},{'verbose':_0x244ecb['verbose']}),_0x3e2c26=_0x5d44a5[_0x90db13(0x15e)],_0x9b27a=_0x3e2c26[_0x90db13(0x264)]?'\x20[Job\x20ID:\x20'+_0x3e2c26['jobId']+']':'';return console[_0x90db13(0x207)](_0x90db13(0x223)+_0x3e2c26['stats'][_0x90db13(0x15c)][_0x90db13(0x339)]()+_0x90db13(0x179)+(_0x90db13(0x352)+formatElapsed(_0x3e2c26['stats'][_0x90db13(0x1a5)])+_0x9b27a)),await handleQueryOutput(_0x3e2c26,_0x244ecb),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x1c1);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x1f6);async[a31_0x5bbcfa(0x232)](_0x5a1173){const _0x46bbf9=a31_0x5bbcfa,{options:_0x4afa89,args:_0x2c48c8,tdx:_0x4a1743}=_0x5a1173,_0x73ffc1=_0x2c48c8[0x0],_0x39c273=await withSpinner(_0x73ffc1?'Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27'+_0x73ffc1+'\x27...':'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x4a1743[_0x46bbf9(0x299)][_0x46bbf9(0x16e)](),{'verbose':_0x4afa89[_0x46bbf9(0x28e)]});let _0x46de44=_0x39c273[_0x46bbf9(0x15e)][_0x46bbf9(0x262)](_0x401890=>_0x401890[_0x46bbf9(0x13e)]);if(_0x73ffc1){const _0x4466d7=_0x73ffc1['replace'](/[.+^${}()|[\]\\]/g,_0x46bbf9(0x148))[_0x46bbf9(0x261)](/\*/g,'.*')[_0x46bbf9(0x261)](/\?/g,'.'),_0x37b156=new RegExp('^'+_0x4466d7+'$','i');_0x46de44=_0x46de44[_0x46bbf9(0x262)](_0x17e62b=>_0x37b156[_0x46bbf9(0x205)](_0x17e62b[_0x46bbf9(0x247)]));}_0x46de44[_0x46bbf9(0x18b)]((_0x4a1cfd,_0x220382)=>_0x4a1cfd['name'][_0x46bbf9(0x1b9)](_0x220382['name'])),console[_0x46bbf9(0x207)](_0x46bbf9(0x2c1)+_0x46de44[_0x46bbf9(0x141)]+'\x20RT-enabled\x20parent\x20segment'+(_0x46de44[_0x46bbf9(0x141)]!==0x1?'s':''));const _0x28d198=_0x389f1c=>{const _0x48d5b9=_0x46bbf9;return getConsoleNextUrl(_0x4afa89[_0x48d5b9(0x268)],_0x48d5b9(0x2c6)+_0x389f1c);};if(_0x4afa89[_0x46bbf9(0x27e)]==='json'||_0x4afa89[_0x46bbf9(0x27e)]==='jsonl'){const _0x6ef7f3=_0x46de44[_0x46bbf9(0x20a)](_0x36b18f=>({..._0x36b18f,'url':_0x28d198(_0x36b18f['id'])}));await handleSDKOutput(_0x6ef7f3,_0x4afa89);}else{if(_0x46de44[_0x46bbf9(0x141)]===0x0)console[_0x46bbf9(0x337)](_0x46bbf9(0x1ca));else for(const _0x4163bb of _0x46de44){const _0x173c5f=_0x4163bb[_0x46bbf9(0x225)]?a31_0x27c26e[_0x46bbf9(0x1be)]('\x20('+formatRows(_0x4163bb[_0x46bbf9(0x225)])+')'):'',_0x1cb274=hyperlink(_0x4163bb[_0x46bbf9(0x247)],_0x28d198(_0x4163bb['id']));console[_0x46bbf9(0x337)]('⚡\x20'+_0x1cb274+_0x173c5f);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x2ea);['description']=a31_0x5bbcfa(0x19a);async[a31_0x5bbcfa(0x232)](_0x108377){const _0x3281d6=a31_0x5bbcfa,{options:_0x2b16f5,args:_0xbf7e29,tdx:_0x57e161}=_0x108377,_0x40e319=_0xbf7e29[0x0]||_0x2b16f5[_0x3281d6(0x155)];if(!_0x40e319)return showParentSegmentNotSetError('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'+_0x3281d6(0x248)),0x1;const _0x52060c=resolveYamlFile(_0x40e319);if(!existsSync(_0x52060c))return showFileNotFoundError(_0x52060c,_0x40e319),0x1;let _0x2bae8f;try{_0x2bae8f=readFileSync(_0x52060c,_0x3281d6(0x2dc));}catch(_0x213f4e){const _0xd850e0=_0x213f4e instanceof Error?_0x213f4e[_0x3281d6(0x284)]:String(_0x213f4e);return console[_0x3281d6(0x207)](_0x3281d6(0x2bb)+_0xd850e0),0x1;}const _0x239f49=createCommandSpinner(a31_0x27c26e[_0x3281d6(0x1be)](_0x3281d6(0x29f)),{'verbose':_0x2b16f5[_0x3281d6(0x28e)]});_0x239f49[_0x3281d6(0x157)]();const _0x24b60d={'realtime':!![],'onProgress':_0x1e9c4b=>{const _0x1b91f5=_0x3281d6;_0x239f49[_0x1b91f5(0x19d)]=formatProgressMessage(_0x1e9c4b);}};let _0x14678e;try{_0x14678e=await _0x57e161[_0x3281d6(0x239)]['validateParentYaml'](_0x2bae8f,_0x24b60d),_0x239f49['stop']();}catch(_0x4ae63b){_0x239f49[_0x3281d6(0x135)]();throw _0x4ae63b;}console[_0x3281d6(0x207)]('\x0a'+a31_0x27c26e[_0x3281d6(0x146)](_0x3281d6(0x226))+'\x20'+_0x14678e['name']),console[_0x3281d6(0x207)]('═'[_0x3281d6(0x1a6)](0x3c)),displayRealtimeValidation(_0x14678e),console[_0x3281d6(0x207)]('─'[_0x3281d6(0x1a6)](0x3c));if(_0x14678e[_0x3281d6(0x20f)][_0x3281d6(0x141)]>0x0){console[_0x3281d6(0x207)]('\x0a'+a31_0x27c26e[_0x3281d6(0x172)](_0x3281d6(0x259)));for(const _0x4846aa of _0x14678e[_0x3281d6(0x20f)]){console[_0x3281d6(0x207)]('\x20\x20'+a31_0x27c26e[_0x3281d6(0x172)]('•')+'\x20'+_0x4846aa);}}return _0x14678e[_0x3281d6(0x150)]&&console[_0x3281d6(0x207)]('\x0a'+a31_0x27c26e[_0x3281d6(0x2a3)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x14678e['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x17d);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x2ef);async['execute'](_0x5b0541){const _0x45ae46=a31_0x5bbcfa,{options:_0x17fd0b,args:_0x502d0a,tdx:_0x213fe2}=_0x5b0541,_0x796d9e=_0x502d0a[0x0]||_0x17fd0b[_0x45ae46(0x155)];if(!_0x796d9e)return showParentSegmentNotSetError('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'+_0x45ae46(0x221)),0x1;_0x17fd0b[_0x45ae46(0x28e)]&&(console[_0x45ae46(0x207)]('Site:\x20'+_0x17fd0b[_0x45ae46(0x268)]),console[_0x45ae46(0x207)](_0x45ae46(0x20b)+_0x796d9e));const _0xcd575e=await withSpinner(_0x45ae46(0x253)+_0x796d9e+'\x27...',()=>_0x213fe2['segment']['resolveParentId'](_0x796d9e),{'verbose':_0x17fd0b[_0x45ae46(0x28e)]}),_0x26fe0a=_0xcd575e['data'],_0x54a2de=await withSpinner(_0x45ae46(0x306)+_0x796d9e+_0x45ae46(0x185),()=>_0x213fe2[_0x45ae46(0x299)]['listJourneys'](_0x26fe0a),{'verbose':_0x17fd0b[_0x45ae46(0x28e)]}),_0x47cb5d=_0x54a2de[_0x45ae46(0x15e)];console[_0x45ae46(0x207)](_0x45ae46(0x2c1)+_0x47cb5d[_0x45ae46(0x141)]+'\x20RT\x20journey'+(_0x47cb5d[_0x45ae46(0x141)]!==0x1?'s':''));if(_0x17fd0b['format']===_0x45ae46(0x2bc)||_0x17fd0b['format']==='jsonl')await handleSDKOutput(_0x47cb5d,_0x17fd0b);else{if(_0x47cb5d[_0x45ae46(0x141)]===0x0)console[_0x45ae46(0x337)](_0x45ae46(0x31c));else for(const _0x2b3bee of _0x47cb5d){const _0x1bf3a1=_0x2b3bee[_0x45ae46(0x151)]===_0x45ae46(0x162)?'🚀':'📝',_0x4762e4=_0x2b3bee[_0x45ae46(0x18c)]?a31_0x27c26e[_0x45ae46(0x27d)](_0x45ae46(0x16a)):'',_0x33f963=a31_0x27c26e[_0x45ae46(0x1be)]('\x20('+_0x2b3bee[_0x45ae46(0x30b)]+_0x45ae46(0x1c6)+(_0x2b3bee[_0x45ae46(0x30b)]!==0x1?'s':'')+')');console[_0x45ae46(0x337)](_0x1bf3a1+'\x20'+_0x2b3bee[_0x45ae46(0x247)]+_0x4762e4+_0x33f963);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x324);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x308);async[a31_0x5bbcfa(0x232)](_0x2c9c1c){const _0x124e10=a31_0x5bbcfa,{options:_0x1acb7e,args:_0x1ba92e,tdx:_0x1a54c8}=_0x2c9c1c,_0x1a8def=_0x1ba92e[0x0];if(!_0x1a8def)return console[_0x124e10(0x207)](a31_0x27c26e['red'](_0x124e10(0x28f))),console['error'](_0x124e10(0x34c)),console[_0x124e10(0x207)](a31_0x27c26e[_0x124e10(0x1be)](_0x124e10(0x24d))),0x1;_0x1acb7e[_0x124e10(0x28e)]&&(console['error'](_0x124e10(0x297)+_0x1acb7e[_0x124e10(0x268)]),console[_0x124e10(0x207)](_0x124e10(0x33e)+_0x1a8def));const _0x54836c=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1a8def+_0x124e10(0x185),()=>_0x1a54c8[_0x124e10(0x299)][_0x124e10(0x357)](_0x1a8def),{'verbose':_0x1acb7e[_0x124e10(0x28e)]}),_0x11768f=_0x54836c[_0x124e10(0x15e)];console[_0x124e10(0x207)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x11768f[_0x124e10(0x247)]+'\x27');if(_0x1acb7e[_0x124e10(0x27e)]===_0x124e10(0x2bc)||_0x1acb7e[_0x124e10(0x27e)]===_0x124e10(0x1d0))await handleSDKOutput([_0x11768f],_0x1acb7e);else{const _0x3848a5=_0x11768f[_0x124e10(0x151)]===_0x124e10(0x162)?'🚀':'📝',_0x55d54f=_0x11768f[_0x124e10(0x18c)]?a31_0x27c26e[_0x124e10(0x27d)]('\x20(paused)'):'';console['log'](_0x3848a5+'\x20'+_0x11768f[_0x124e10(0x247)]+_0x55d54f);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x2a4);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x2c4);async['execute'](_0x108881){const _0x2b5517=a31_0x5bbcfa,{options:_0x3ee1ce,args:_0x2da8e1,tdx:_0x38c271}=_0x108881,_0x43eee3=_0x2da8e1[0x0];if(!_0x43eee3)return console[_0x2b5517(0x207)](a31_0x27c26e[_0x2b5517(0x172)](_0x2b5517(0x28f))),console[_0x2b5517(0x207)](_0x2b5517(0x31e)),console['error'](a31_0x27c26e['dim'](_0x2b5517(0x24d))),0x1;_0x3ee1ce[_0x2b5517(0x28e)]&&(console[_0x2b5517(0x207)](_0x2b5517(0x297)+_0x3ee1ce[_0x2b5517(0x268)]),console[_0x2b5517(0x207)]('RT\x20Journey\x20ID:\x20'+_0x43eee3));const _0x2a06d7=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x43eee3+_0x2b5517(0x185),()=>_0x38c271[_0x2b5517(0x299)][_0x2b5517(0x210)](_0x43eee3),{'verbose':_0x3ee1ce[_0x2b5517(0x28e)]}),_0x1657ea=_0x2a06d7[_0x2b5517(0x15e)];console[_0x2b5517(0x207)](_0x2b5517(0x2be)+_0x1657ea[_0x2b5517(0x247)]+'\x27');if(_0x3ee1ce[_0x2b5517(0x27e)]===_0x2b5517(0x2bc)||_0x3ee1ce[_0x2b5517(0x27e)]==='jsonl')await handleSDKOutput([_0x1657ea],_0x3ee1ce);else{const _0x31fa71=_0x1657ea[_0x2b5517(0x151)]===_0x2b5517(0x162)?'🚀':'📝',_0x592a27=_0x1657ea['paused']?a31_0x27c26e[_0x2b5517(0x27d)]('\x20(paused)'):'';console[_0x2b5517(0x337)](_0x31fa71+'\x20'+_0x1657ea[_0x2b5517(0x247)]+_0x592a27);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]='ps:rt:configuration_versions';[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x2e6);async[a31_0x5bbcfa(0x232)](_0x445b85){const _0x346f59=a31_0x5bbcfa,{options:_0x31fad2,args:_0x5246e0,tdx:_0x129b6c}=_0x445b85,_0x2907d4=_0x5246e0[0x0]||_0x31fad2['parentSegment'];if(!_0x2907d4)return showParentSegmentNotSetError('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'+_0x346f59(0x33b)),0x1;_0x31fad2[_0x346f59(0x28e)]&&(console[_0x346f59(0x207)]('Site:\x20'+_0x31fad2[_0x346f59(0x268)]),console[_0x346f59(0x207)](_0x346f59(0x20b)+_0x2907d4));const _0x5c1345=await withSpinner(_0x346f59(0x253)+_0x2907d4+'\x27...',()=>_0x129b6c[_0x346f59(0x239)][_0x346f59(0x1a8)](_0x2907d4),{'verbose':_0x31fad2[_0x346f59(0x28e)]}),_0x1dac84=_0x5c1345['data'],_0x22a00f=await withSpinner(_0x346f59(0x281)+_0x2907d4+_0x346f59(0x185),()=>_0x129b6c[_0x346f59(0x299)][_0x346f59(0x26b)](_0x1dac84),{'verbose':_0x31fad2[_0x346f59(0x28e)]}),_0x3f1263=_0x22a00f[_0x346f59(0x15e)];return console[_0x346f59(0x207)](_0x346f59(0x24e)),_0x31fad2[_0x346f59(0x27e)]===_0x346f59(0x2bc)||_0x31fad2[_0x346f59(0x27e)]===_0x346f59(0x1d0)?await handleSDKOutput([_0x3f1263],_0x31fad2):(console[_0x346f59(0x337)](_0x346f59(0x314)+_0x3f1263['id']),console[_0x346f59(0x337)](_0x346f59(0x132)+_0x3f1263[_0x346f59(0x244)]),console[_0x346f59(0x337)](_0x346f59(0x19c)+_0x3f1263['identifier']),console[_0x346f59(0x337)](_0x346f59(0x340)+_0x3f1263[_0x346f59(0x214)]),console[_0x346f59(0x337)]('status:\x20'+_0x3f1263[_0x346f59(0x1b3)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x209);[a31_0x5bbcfa(0x2f6)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async['execute'](_0x41c827){const _0x3ae614=a31_0x5bbcfa,{options:_0x536d5d,args:_0x4b8839,tdx:_0x4a7f5b}=_0x41c827,_0x71e97d=_0x4b8839[0x0]||_0x536d5d[_0x3ae614(0x155)];if(!_0x71e97d)return showParentSegmentNotSetError(_0x3ae614(0x328)+_0x3ae614(0x198)),0x1;const _0x500c4c=await withSpinner(_0x3ae614(0x253)+_0x71e97d+_0x3ae614(0x185),()=>_0x4a7f5b[_0x3ae614(0x239)][_0x3ae614(0x1a8)](_0x71e97d),{'verbose':_0x536d5d[_0x3ae614(0x28e)]}),_0x5b4381=_0x500c4c['data'],_0x51eea5=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x71e97d+_0x3ae614(0x185),()=>_0x4a7f5b[_0x3ae614(0x301)][_0x3ae614(0x16e)](_0x5b4381),{'verbose':_0x536d5d['verbose']}),_0x2f97b3=_0x51eea5['data'];console[_0x3ae614(0x207)]('✔\x20Found\x20'+_0x2f97b3[_0x3ae614(0x141)]+_0x3ae614(0x265)+(_0x2f97b3[_0x3ae614(0x141)]!==0x1?'s':''));if(_0x536d5d[_0x3ae614(0x27e)]===_0x3ae614(0x2bc)||_0x536d5d[_0x3ae614(0x27e)]===_0x3ae614(0x1d0))await handleSDKOutput(_0x2f97b3,_0x536d5d);else{if(_0x2f97b3[_0x3ae614(0x141)]===0x0)console[_0x3ae614(0x337)](_0x3ae614(0x203)),console[_0x3ae614(0x207)](a31_0x27c26e[_0x3ae614(0x271)](_0x3ae614(0x1e0)));else for(const _0x20ccac of _0x2f97b3){console[_0x3ae614(0x337)](a31_0x27c26e[_0x3ae614(0x146)](_0x20ccac[_0x3ae614(0x247)])+'\x20'+a31_0x27c26e[_0x3ae614(0x1be)]('(id:\x20'+_0x20ccac['id']+')'));_0x20ccac[_0x3ae614(0x2f6)]&&console['log']('\x20\x20'+a31_0x27c26e[_0x3ae614(0x1be)](_0x20ccac[_0x3ae614(0x2f6)]));if(_0x20ccac[_0x3ae614(0x152)]&&_0x20ccac['tokens']['length']>0x0)for(const _0xfeed75 of _0x20ccac[_0x3ae614(0x152)]){const _0x8b2778=_0xfeed75[_0x3ae614(0x235)]?.['length']?_0xfeed75[_0x3ae614(0x235)]['join'](',\x20'):_0x3ae614(0x153);console[_0x3ae614(0x337)]('\x20\x20'+a31_0x27c26e[_0x3ae614(0x271)](_0x3ae614(0x2fe))+'\x20'+_0xfeed75[_0x3ae614(0x247)]+'\x20'+a31_0x27c26e[_0x3ae614(0x1be)](_0x3ae614(0x266)+_0xfeed75['id']+')')),console[_0x3ae614(0x337)](_0x3ae614(0x2f9)+a31_0x27c26e[_0x3ae614(0x1be)](_0x3ae614(0x2c3))+'\x20'+_0x8b2778);}else console[_0x3ae614(0x337)]('\x20\x20'+a31_0x27c26e[_0x3ae614(0x1be)](_0x3ae614(0x20d)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x1e6);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x193);async[a31_0x5bbcfa(0x232)](_0x1deb62){const _0x396705=a31_0x5bbcfa,{options:_0x3cd4e3,args:_0x5eefed,tdx:_0x2650f9}=_0x1deb62,_0x50d2f2=_0x3cd4e3,_0x3ab3c2=_0x5eefed[0x0],_0x5be2d7=_0x5eefed[0x1]||_0x3cd4e3[_0x396705(0x155)];if(!_0x3ab3c2)return console[_0x396705(0x207)](_0x396705(0x1c2)),console['error'](_0x396705(0x32b)),console[_0x396705(0x207)](_0x396705(0x321)),0x1;if(!_0x5be2d7)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0xd83f5d=await withSpinner(_0x396705(0x253)+_0x5be2d7+'\x27...',()=>_0x2650f9[_0x396705(0x239)]['resolveParentId'](_0x5be2d7),{'verbose':_0x3cd4e3[_0x396705(0x28e)]}),_0x3cf884=_0xd83f5d[_0x396705(0x15e)],_0x54e725={'name':_0x3ab3c2,'description':_0x50d2f2[_0x396705(0x2f6)],'public':_0x50d2f2[_0x396705(0x14b)]},_0x3cb314=await withSpinner(_0x396705(0x2b6)+_0x3ab3c2+_0x396705(0x185),()=>_0x2650f9[_0x396705(0x301)][_0x396705(0x1a7)](_0x3cf884,_0x54e725),{'verbose':_0x3cd4e3[_0x396705(0x28e)]}),_0x3f6c5d=_0x3cb314[_0x396705(0x15e)];return console[_0x396705(0x207)]('✔\x20Created\x20personalization\x20service\x20\x27'+_0x3f6c5d[_0x396705(0x247)]+_0x396705(0x1de)+_0x3f6c5d['id']),await handleSDKOutput([_0x3f6c5d],_0x3cd4e3),0x0;}}function a31_0x1ae9(){const _0xe2f72b=['\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','Fetching\x20personalization\x20service\x20\x27','✔\x20Found\x20personalization\x20\x27','\x20\x20\x20','Creating\x20personalization\x20service\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','file','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','keyEventId','Error\x20reading\x20file:\x20','json','sections','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','column_name','SELECT\x20*\x20FROM\x20(\x0a','✔\x20Found\x20','Error:\x20File\x20not\x20found:\x20','allowed\x20IPs:','Resume\x20activations\x20in\x20an\x20RT\x20journey','To\x20view\x20sample\x20data:','/app/dw/parentSegments/','Error:\x20Service\x20ID\x20is\x20required','ps:pz:service:token:delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x27\x20(id:\x20','sampleData','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','listFields','Attributes:','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20to\x20configure\x20your\x20personalization\x20service','\x27\x20is\x20already\x20up\x20to\x20date','\x20\x20\x20\x20-\x20','sections:','/\x20directories\x20exist.','all','Name:\x20','using\x20the\x20default\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20\x20','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x20kill','utf-8','5674764gNSkuD','null','\x20--behavior\x20\x22<name>\x22','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','includeSensitive','Master\x20+\x20Attributes','entryCriteria:','segment:parent:list','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Get\x20current\x20RT\x20configuration\x20version\x20status','pushParentYaml','run','displayPreviewHints','ps:rt:validate','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Getting\x20personalization\x20\x27','Apply\x20changes\x20to\x20\x27','segment:parent:desc','List\x20RT\x20journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','tdx\x20ps\x20push\x20','getParentFull','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','folder-segment','Attempt:','description','varchar','42116cTkHzn','\x20\x20\x20\x20','Options:\x0a','web','Listing\x20fields\x20for\x20\x27','\x20--enriched','token:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Options\x20(one\x20required):\x0a','personalization','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','folderId','displayPreviewResults','Fetching\x20parent\x20segment\x20\x27','Listing\x20RT\x20journeys\x20for\x20\x27','coveragePercent','Pause\x20activations\x20in\x20an\x20RT\x20journey','\x27\x20and\x20run\x20workflow?','isDirectory','stageCount','displayBehaviorsStats','Table:\x20','Error\x20parsing\x20YAML:\x20','/app/workflows/','string','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\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','List\x20available\x20fields\x20for\x20segmentation','id:\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Options:','SQL\x20query:\x0a','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','personalizationServices','5UUmubb','No\x20RT\x20journeys\x20found','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','idStitching','behaviorsFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','segment:parent:show','\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','ps:rt:jn:pause','enriched','Fetching\x20current\x20configuration\x20for\x20\x27','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','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','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','✔\x20No\x20changes\x20-\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Attributes','behavior','attribute','ps:pz:delete','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20service(s)\x20configured','validateParentYaml','preview','\x20rows)','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','log','ps:pz:service:update','toLocaleString','Events:','\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','deletePersonalization','Coverage:','RT\x20Journey\x20ID:\x20','reduce','eventKind:\x20','scheduleOption','✔\x20Updated\x20personalization\x20service\x20\x27','entryCriteria','Source:','displayAttributesStats','\x0a\x20\x20\x20\x20}','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','workflowId','segment:parent:preview','listPersonalizations','foreignKey','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','keyEventId:','scheduleType','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','updateParent','in\x20','schemaValid','Error:\x20--name\x20is\x20required','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','Next\x20steps:','pauseJourney','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Error:\x20--database\x20and\x20--table\x20are\x20required','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','split','audienceId:\x20','customerGroup','label','stop','✔\x20Deleted\x20personalization\x20service\x20\x27','40FyPPeG','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','output','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','No\x20parent\x20segments\x20found','SELECT\x20*\x20FROM\x20','Error:\x20Personalization\x20ID\x20is\x20required','realtime_enabled','Show\x20personalization\x20service\x20details','11460zLgHrS','length','segment:parent:run','createPersonalization','No\x20parent\x20segments\x20match\x20pattern:\x20','Pattern:\x20','bold','Columns:','\x5c$&','✔\x20Created\x20parent\x20segment\x20\x27','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','public','Create\x20parent\x20segment\x20\x27','Created','\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:sql','allValid','state','tokens','any','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','parentSegment','rowCount','start','10174104LLMBfF','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','displaySampleData','single','processedRows','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','data','To\x20cancel:','\x20--attribute\x20\x22<name>\x22','ps:pz:show','launched','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','trim','FINISHED','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','\x20(paused)','4213804pWcuSV','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Listing\x20parent\x20segments\x20matching\x20\x27','list','\x27\x20for\x20service\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','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','red','Behavior:','✔\x20Renamed\x20directory\x20to\x20','double','110RevYKH','yes','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','\x20rows\x20','getParentSQL','⚡\x20Not\x20enabled','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','ps:rt:jn:list','Deleting\x20personalization\x20service\x20\x27','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','\x0a✔\x20Workflow\x20started','.customers)','displayMasterInfo','\x20No\x20changes\x20-\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','\x27...','\x20Context\x20set:\x20','customersWithEvents','customers','Join:','\x20personalization','sort','paused','toFixed','database','Validate:','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','/\x20→\x20','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','match','apply','value','\x20\x20No\x20sample\x20data\x20available','\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','personalization_services','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','\x20is\x20already\x20up\x20to\x20date','identifier:\x20','text','segment:parent:pull','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Deleting\x20personalization\x20\x27','Master\x20Table','elapsedTimeMillis','repeat','create','resolveParentId','unref','Personalization:','column','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','query','addBehaviors','user_id','runParent','Database:\x20','sourceTableError','status','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','createParent','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Available\x20attributes:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','localeCompare','win32','\x0a\x20\x20\x20\x20]','ps:pz:service:show','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','dim','/attempt/','\x20Added\x20RT\x202.0\x20template\x20section','ps:rt:list','Error:\x20Service\x20name\x20is\x20required','Status:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20stage','Fetching\x20customers\x20schema...','\x27\x20is\x20up\x20to\x20date','Creating','No\x20RT-enabled\x20parent\x20segments\x20found','createToken','displayRealtimeInfo','joinKey','Delete\x20a\x20personalization\x20service','behaviors','jsonl','Personalization\x20service\x20description','/sessions/','stitchingKeys','{\x0a\x20\x20\x22database\x22:\x20\x22','collectSchema','\x20=\x20','session','\x22\x20}','Patching\x20personalization\x20\x27','pullParentYaml','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x0aNew\x20parent\x20segment\x20\x27','Updated','\x27\x20with\x20ID:\x20','createdAt','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','keyEventCriteria','setJobId','Updating\x20parent\x20segment\x20\x27','ps:pz:service:create','Schema\x20saved\x20to\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','/\x20directory.\x0a','number','enabled','✔\x20Deleted\x20personalization\x20\x27','👥\x20','\x20Added\x20personalization\x20template\x20to\x20','Attribute:','6682248Gqflrk','true','Enriched:','sourceTableValid','Aborted.','ps:pz:patch','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Analyzing\x20changes...','Default','addBehaviorsFile','Join\x20on:','primaryKey','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','table','audienceId:','Output\x20file:\x20','705166mbCqsw','timezone','No\x20personalization\x20services\x20configured','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','test','Listing\x20parent\x20segments...','error','darwin','ps:pz:service:list','map','Parent\x20segment:\x20','RT\x202.0:','no\x20tokens\x20configured','join','errors','resumeJourney','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','deleteToken','ps:pz:init','eventKind','Creating\x20token\x20\x27','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','183fttaJP','columns','events','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','open','✔\x20Created\x20personalization\x20\x27','.yaml','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','\x20--attribute\x20\x22','\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','indexOf','✔\x20Query\x20completed:\x20Processed\x20','Error:','population','RT\x202.0\x20Validate:','workflowAttemptId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Executing\x20parent\x20segment\x20query...','getOutputDatabaseName','✔\x20Updated\x20parent\x20segment\x20\x27','interval','Creating\x20personalization\x20\x27','tdx\x20ps\x20preview\x20','Updating\x20personalization\x20service\x20\x27','information_schema','behavior_','execute','patch','Delete\x20a\x20realtime\x20personalization','allowedIps','\x20\x20Database:\x20','displayValidateResults','\x0aError:','segment','created:','Audience\x20ID:','getBehaviorNames','Output\x20Database:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','customerGroupFile','\x20tdx\x20wf\x20attempt\x20','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','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','Deleting\x20token\x20\x27','audienceId','dirname','push','name','\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','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Validating\x20configuration...','Show\x20parent\x20segment\x20details','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','✔\x20Retrieved\x20RT\x20configuration\x20version','\x20\x201.\x20Edit\x20','workflowSessionId','\x20field','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','Resolving\x20parent\x20segment\x20\x27','segment:parent:fields','Overwrite\x20\x27','Customers:','type','\x20parent\x20segment\x20\x27','Errors:','page_view','customerPercent','formatSchemaJson','segment:parent:update','✔\x20Updated\x20personalization\x20\x27','includeSensitive:','totalEvents','replace','filter','segment:parent:push','jobId','\x20personalization\x20service','(id:\x20','\x20--interval\x20','site','\x20\x20\x20\x20\x20\x20','Fetching\x20SQL\x20for\x20\x27','getCurrentConfigVersion','ps:pz:create','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Preview:','Session:','/{name}.yml\x0a','cyan','\x20to\x20push\x20the\x20configuration','last_page_viewed','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','displaySummary','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x20--behavior\x20\x22','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','addAttributes','-1d','Listing\x20personalizations\x20for\x20\x27','yellow','format','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','YAML\x20file:\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','No\x20personalizations\x20configured','displayColumns','message','\x20behaviors','delete','ID\x20Stitching:','Create\x20a\x20realtime\x20personalization\x20entity','master','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','previewParentYaml','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','updated:','verbose','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','matchedCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','listParents','Fetching\x20behavior\x20list...','realtime:','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Site:\x20','ps:pz:list','realtime','\x0aNo\x20sample\x20data\x20available','segment:parent:view','schemaError','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','attributes','Validating\x20RT\x20configuration...','keys','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Error:\x20Token\x20\x27','green','ps:rt:jn:resume','Updating','Rows:','\x20configured','payload','parent_segment','%)\x20','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','⚡\x20Enabled','segment:parent:create','.yml','Finding\x20service\x20for\x20token...','patchPersonalization'];a31_0x1ae9=function(){return _0xe2f72b;};return a31_0x1ae9();}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x1bc);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x13f);async[a31_0x5bbcfa(0x232)](_0x1afcd4){const _0x33217a=a31_0x5bbcfa,{options:_0x2f009e,args:_0x2f2378,tdx:_0x1955c4}=_0x1afcd4,_0x514d94=_0x2f2378[0x0],_0x1bfe0b=_0x2f2378[0x1]||_0x2f009e[_0x33217a(0x155)];if(!_0x514d94)return console[_0x33217a(0x207)](_0x33217a(0x2c7)),console[_0x33217a(0x207)](_0x33217a(0x13a)),console[_0x33217a(0x207)](_0x33217a(0x1a2)),0x1;if(!_0x1bfe0b)return showParentSegmentNotSetError(_0x33217a(0x184)+_0x33217a(0x1a2)),0x1;const _0x12737b=await withSpinner(_0x33217a(0x253)+_0x1bfe0b+_0x33217a(0x185),()=>_0x1955c4[_0x33217a(0x239)][_0x33217a(0x1a8)](_0x1bfe0b),{'verbose':_0x2f009e[_0x33217a(0x28e)]}),_0x136ce1=_0x12737b[_0x33217a(0x15e)],_0xa9e66a=await withSpinner(_0x33217a(0x2b3)+_0x514d94+'\x27...',()=>_0x1955c4['personalization']['get'](_0x136ce1,_0x514d94),{'verbose':_0x2f009e[_0x33217a(0x28e)]}),_0x5829ef=_0xa9e66a[_0x33217a(0x15e)];if(_0x2f009e[_0x33217a(0x2bc)]||_0x2f009e[_0x33217a(0x1d0)])await handleSDKOutput([_0x5829ef],_0x2f009e);else{console['log'](a31_0x27c26e[_0x33217a(0x146)](_0x5829ef[_0x33217a(0x247)])+'\x20'+a31_0x27c26e['dim'](_0x33217a(0x266)+_0x5829ef['id']+')'));_0x5829ef[_0x33217a(0x2f6)]&&console[_0x33217a(0x337)]('\x20\x20'+a31_0x27c26e[_0x33217a(0x1be)](_0x5829ef[_0x33217a(0x2f6)]));console[_0x33217a(0x337)]('\x20\x20'+a31_0x27c26e['cyan']('public:')+'\x20'+(_0x5829ef[_0x33217a(0x14b)]?_0x33217a(0x177):'no'));if(_0x5829ef['tokens']&&_0x5829ef[_0x33217a(0x152)][_0x33217a(0x141)]>0x0)for(const _0x3afd50 of _0x5829ef[_0x33217a(0x152)]){const _0x223d11=_0x3afd50[_0x33217a(0x235)]?.[_0x33217a(0x141)]?_0x3afd50['allowedIps'][_0x33217a(0x20e)](',\x20'):'any';console[_0x33217a(0x337)]('\x20\x20'+a31_0x27c26e[_0x33217a(0x271)]('token:')+'\x20'+_0x3afd50[_0x33217a(0x247)]+'\x20'+a31_0x27c26e[_0x33217a(0x1be)]('(id:\x20'+_0x3afd50['id']+')')),console[_0x33217a(0x337)](_0x33217a(0x2f9)+a31_0x27c26e['dim'](_0x33217a(0x2c3))+'\x20'+_0x223d11);}else console[_0x33217a(0x337)]('\x20\x20'+a31_0x27c26e[_0x33217a(0x1be)](_0x33217a(0x20d)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]='ps:pz:service:delete';[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x1ce);async[a31_0x5bbcfa(0x232)](_0x3bd393){const _0x55f2d1=a31_0x5bbcfa,{options:_0x356483,args:_0x471fac,tdx:_0x13a59c}=_0x3bd393,_0x1a6d20=_0x471fac[0x0],_0x33f1d1=_0x471fac[0x1]||_0x356483[_0x55f2d1(0x155)];if(!_0x1a6d20)return console[_0x55f2d1(0x207)](_0x55f2d1(0x2c7)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x55f2d1(0x207)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x33f1d1)return showParentSegmentNotSetError(_0x55f2d1(0x295)+_0x55f2d1(0x291)),0x1;const _0x207645=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x33f1d1+_0x55f2d1(0x185),()=>_0x13a59c['segment'][_0x55f2d1(0x1a8)](_0x33f1d1),{'verbose':_0x356483['verbose']}),_0xcf346b=_0x207645['data'];return await withSpinner(_0x55f2d1(0x17e)+_0x1a6d20+_0x55f2d1(0x185),()=>_0x13a59c[_0x55f2d1(0x301)][_0x55f2d1(0x286)](_0xcf346b,_0x1a6d20),{'verbose':_0x356483[_0x55f2d1(0x28e)]}),console['error'](_0x55f2d1(0x136)+_0x1a6d20+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{['name']=a31_0x5bbcfa(0x338);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x355);async['execute'](_0x499b8c){const _0x28f6e2=a31_0x5bbcfa,{options:_0x4253cb,args:_0x12de94,tdx:_0x29972e}=_0x499b8c,_0x32f0de=_0x4253cb,_0xcda782=_0x12de94[0x0],_0x1defd7=_0x12de94[0x1]||_0x4253cb['parentSegment'];if(!_0xcda782)return console[_0x28f6e2(0x207)](_0x28f6e2(0x2c7)),console[_0x28f6e2(0x207)](_0x28f6e2(0x276)),console['error'](_0x28f6e2(0x21b)),0x1;if(!_0x32f0de['name'])return console[_0x28f6e2(0x207)](_0x28f6e2(0x354)),console[_0x28f6e2(0x207)](_0x28f6e2(0x276)),0x1;if(!_0x1defd7)return showParentSegmentNotSetError(_0x28f6e2(0x279)+_0x28f6e2(0x21b)),0x1;const _0x18057c=await withSpinner(_0x28f6e2(0x253)+_0x1defd7+_0x28f6e2(0x185),()=>_0x29972e[_0x28f6e2(0x239)][_0x28f6e2(0x1a8)](_0x1defd7),{'verbose':_0x4253cb[_0x28f6e2(0x28e)]}),_0x3bd54c=_0x18057c[_0x28f6e2(0x15e)],_0x2c2880={'name':_0x32f0de['name']};_0x32f0de[_0x28f6e2(0x2f6)]!==undefined&&(_0x2c2880[_0x28f6e2(0x2f6)]=_0x32f0de[_0x28f6e2(0x2f6)]);const _0x6a508e=await withSpinner(_0x28f6e2(0x22f)+_0xcda782+_0x28f6e2(0x185),()=>_0x29972e[_0x28f6e2(0x301)][_0x28f6e2(0x233)](_0x3bd54c,_0xcda782,_0x2c2880),{'verbose':_0x4253cb[_0x28f6e2(0x28e)]}),_0x508acd=_0x6a508e[_0x28f6e2(0x15e)];return console['error'](_0x28f6e2(0x342)+_0x508acd[_0x28f6e2(0x247)]+'\x27'),await handleSDKOutput([_0x508acd],_0x4253cb),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]='ps:pz:service:token:create';[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x169);async['execute'](_0x114d71){const _0x2f6577=a31_0x5bbcfa,{options:_0x599239,args:_0x5d78b3,tdx:_0x355a81}=_0x114d71,_0x4597a8=_0x599239,_0x412990=_0x5d78b3[0x0],_0x306e80=_0x5d78b3[0x1],_0x2960f2=_0x5d78b3[0x2]||_0x599239[_0x2f6577(0x155)];if(!_0x412990)return console[_0x2f6577(0x207)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x2f6577(0x207)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x2f6577(0x207)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x306e80)return console[_0x2f6577(0x207)](_0x2f6577(0x2c7)),console[_0x2f6577(0x207)](_0x2f6577(0x2ff)),console[_0x2f6577(0x207)](_0x2f6577(0x1e8)),0x1;if(!_0x2960f2)return showParentSegmentNotSetError(_0x2f6577(0x154)+_0x2f6577(0x1e8)),0x1;const _0x23352f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2960f2+_0x2f6577(0x185),()=>_0x355a81[_0x2f6577(0x239)][_0x2f6577(0x1a8)](_0x2960f2),{'verbose':_0x599239[_0x2f6577(0x28e)]}),_0x5a41e7=_0x23352f[_0x2f6577(0x15e)],_0x26661f={'name':_0x412990};_0x4597a8['allowedIps']&&(_0x26661f[_0x2f6577(0x235)]=_0x4597a8[_0x2f6577(0x235)][_0x2f6577(0x131)](',')[_0x2f6577(0x20a)](_0x17d05a=>_0x17d05a[_0x2f6577(0x164)]()));_0x4597a8[_0x2f6577(0x2f6)]&&(_0x26661f[_0x2f6577(0x2f6)]=_0x4597a8[_0x2f6577(0x2f6)]);const _0x3020c6=await withSpinner(_0x2f6577(0x215)+_0x412990+_0x2f6577(0x16f)+_0x306e80+_0x2f6577(0x185),()=>_0x355a81[_0x2f6577(0x301)][_0x2f6577(0x1cb)](_0x5a41e7,_0x306e80,_0x26661f),{'verbose':_0x599239[_0x2f6577(0x28e)]}),_0x4a4ad3=_0x3020c6[_0x2f6577(0x15e)];return console[_0x2f6577(0x207)]('✔\x20Created\x20token\x20\x27'+_0x4a4ad3[_0x2f6577(0x247)]+_0x2f6577(0x1de)+_0x4a4ad3['id']),_0x4a4ad3[_0x2f6577(0x196)]&&(console[_0x2f6577(0x207)](a31_0x27c26e[_0x2f6577(0x27d)](_0x2f6577(0x2b2))),console[_0x2f6577(0x207)](a31_0x27c26e[_0x2f6577(0x271)](_0x4a4ad3[_0x2f6577(0x196)])),console['error']('')),await handleSDKOutput([_0x4a4ad3],_0x599239),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{['name']=a31_0x5bbcfa(0x2c8);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x1f7);async[a31_0x5bbcfa(0x232)](_0x275814){const _0x3605c1=a31_0x5bbcfa,{options:_0xe0ed5b,args:_0x2a0312,tdx:_0x488db1}=_0x275814,_0x25682d=_0x2a0312[0x0],_0xf71cfb=_0x2a0312[0x1]||_0xe0ed5b[_0x3605c1(0x155)];if(!_0x25682d)return console[_0x3605c1(0x207)]('Error:\x20Token\x20ID\x20is\x20required'),console[_0x3605c1(0x207)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x3605c1(0x207)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0xf71cfb)return showParentSegmentNotSetError(_0x3605c1(0x1c4)+_0x3605c1(0x274)),0x1;const _0x429174=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf71cfb+_0x3605c1(0x185),()=>_0x488db1[_0x3605c1(0x239)][_0x3605c1(0x1a8)](_0xf71cfb),{'verbose':_0xe0ed5b['verbose']}),_0x3ccd7f=_0x429174[_0x3605c1(0x15e)],_0x51f9d4=await withSpinner(_0x3605c1(0x2b0),()=>_0x488db1[_0x3605c1(0x301)]['list'](_0x3ccd7f),{'verbose':_0xe0ed5b['verbose']}),_0x1554ad=_0x51f9d4[_0x3605c1(0x15e)];let _0x50b6ab;for(const _0x21b073 of _0x1554ad){if(_0x21b073['tokens']?.['some'](_0x4b22e5=>_0x4b22e5['id']===_0x25682d)){_0x50b6ab=_0x21b073['id'];break;}}if(!_0x50b6ab)return console[_0x3605c1(0x207)](_0x3605c1(0x2a2)+_0x25682d+_0x3605c1(0x1bd)),0x1;const _0x24b51e=await withSpinner(_0x3605c1(0x243)+_0x25682d+'\x27...',()=>_0x488db1[_0x3605c1(0x301)][_0x3605c1(0x212)](_0x3ccd7f,_0x50b6ab,_0x25682d),{'verbose':_0xe0ed5b[_0x3605c1(0x28e)]}),_0x2f28e9=_0x24b51e[_0x3605c1(0x15e)];return console['error']('✔\x20Deleted\x20token\x20\x27'+(_0x2f28e9[_0x3605c1(0x247)]||_0x25682d)+'\x27'),await handleSDKOutput([_0x2f28e9],_0xe0ed5b),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x298);['description']=a31_0x5bbcfa(0x12d);async['execute'](_0x503328){const _0x2415d5=a31_0x5bbcfa,{options:_0x218be6,args:_0x40fe20,tdx:_0x1b9b90}=_0x503328,_0x162027=_0x40fe20[0x0]||_0x218be6[_0x2415d5(0x155)];if(!_0x162027)return showParentSegmentNotSetError(_0x2415d5(0x216)+_0x2415d5(0x312)),0x1;const _0x29ddb9=await withSpinner(_0x2415d5(0x253)+_0x162027+_0x2415d5(0x185),()=>_0x1b9b90[_0x2415d5(0x239)]['resolveParentId'](_0x162027),{'verbose':_0x218be6[_0x2415d5(0x28e)]}),_0x1c5696=_0x29ddb9[_0x2415d5(0x15e)],_0xe68311=await withSpinner(_0x2415d5(0x27c)+_0x162027+_0x2415d5(0x185),()=>_0x1b9b90[_0x2415d5(0x301)][_0x2415d5(0x34a)](_0x1c5696),{'verbose':_0x218be6[_0x2415d5(0x28e)]}),_0x3d679e=_0xe68311[_0x2415d5(0x15e)];console['error'](_0x2415d5(0x2c1)+_0x3d679e[_0x2415d5(0x141)]+_0x2415d5(0x18a)+(_0x3d679e['length']!==0x1?'s':''));if(_0x218be6[_0x2415d5(0x27e)]==='json'||_0x218be6[_0x2415d5(0x27e)]===_0x2415d5(0x1d0))await handleSDKOutput(_0x3d679e,_0x218be6);else{if(_0x3d679e[_0x2415d5(0x141)]===0x0)console[_0x2415d5(0x337)](_0x2415d5(0x282));else for(const _0x309c69 of _0x3d679e){console['log'](a31_0x27c26e[_0x2415d5(0x146)](_0x309c69[_0x2415d5(0x247)])+'\x20'+a31_0x27c26e['dim'](_0x2415d5(0x266)+_0x309c69['id']+')'));_0x309c69[_0x2415d5(0x2f6)]&&console[_0x2415d5(0x337)]('\x20\x20'+a31_0x27c26e['dim'](_0x309c69[_0x2415d5(0x2f6)]));const _0xddd05e=_0x309c69[_0x2415d5(0x2bd)]?.[_0x2415d5(0x141)]||0x0;console[_0x2415d5(0x337)]('\x20\x20'+a31_0x27c26e[_0x2415d5(0x271)](_0x2415d5(0x2d4))+'\x20'+_0xddd05e);if(_0x309c69[_0x2415d5(0x2bd)]&&_0x309c69[_0x2415d5(0x2bd)][_0x2415d5(0x141)]>0x0)for(const _0x1df7b6 of _0x309c69['sections']){console['log'](_0x2415d5(0x2d3)+_0x1df7b6[_0x2415d5(0x247)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x161);['description']='Show\x20a\x20specific\x20realtime\x20personalization';async[a31_0x5bbcfa(0x232)](_0x15e226){const _0x24bce8=a31_0x5bbcfa,{options:_0xf35457,args:_0x3f6eb4,tdx:_0x1ab956}=_0x15e226,_0x4d2eff=_0x3f6eb4[0x0];if(!_0x4d2eff)return console[_0x24bce8(0x207)](_0x24bce8(0x13d)),console[_0x24bce8(0x207)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x122615=await withSpinner(_0x24bce8(0x2ec)+_0x4d2eff+_0x24bce8(0x185),()=>_0x1ab956['personalization']['getPersonalization'](_0x4d2eff),{'verbose':_0xf35457[_0x24bce8(0x28e)]}),_0x5051c1=_0x122615[_0x24bce8(0x15e)];console[_0x24bce8(0x207)](_0x24bce8(0x2b4)+_0x5051c1['name']+'\x27');if(_0xf35457[_0x24bce8(0x27e)]===_0x24bce8(0x2bc)||_0xf35457[_0x24bce8(0x27e)]==='jsonl')await handleSDKOutput([_0x5051c1],_0xf35457);else{console[_0x24bce8(0x337)](a31_0x27c26e[_0x24bce8(0x146)](_0x5051c1[_0x24bce8(0x247)])+'\x20'+a31_0x27c26e[_0x24bce8(0x1be)](_0x24bce8(0x266)+_0x5051c1['id']+')'));_0x5051c1[_0x24bce8(0x2f6)]&&console[_0x24bce8(0x337)]('\x20\x20'+a31_0x27c26e[_0x24bce8(0x1be)](_0x5051c1[_0x24bce8(0x2f6)]));_0x5051c1['audienceId']&&console[_0x24bce8(0x337)]('\x20\x20'+a31_0x27c26e['cyan'](_0x24bce8(0x1ff))+'\x20'+_0x5051c1[_0x24bce8(0x244)]);console[_0x24bce8(0x337)]('\x20\x20'+a31_0x27c26e['cyan'](_0x24bce8(0x23a))+'\x20'+_0x5051c1[_0x24bce8(0x1df)]),console[_0x24bce8(0x337)]('\x20\x20'+a31_0x27c26e[_0x24bce8(0x271)](_0x24bce8(0x28d))+'\x20'+_0x5051c1['updatedAt']);const _0x46c695=_0x5051c1['sections']?.['length']||0x0;console[_0x24bce8(0x337)]('\x20\x20'+a31_0x27c26e[_0x24bce8(0x271)](_0x24bce8(0x2d4))+'\x20'+_0x46c695);if(_0x5051c1['sections']&&_0x5051c1[_0x24bce8(0x2bd)]['length']>0x0)for(const _0x3969df of _0x5051c1[_0x24bce8(0x2bd)]){console['log'](_0x24bce8(0x2f9)+a31_0x27c26e[_0x24bce8(0x146)](_0x3969df['name'])+'\x20'+a31_0x27c26e[_0x24bce8(0x1be)](_0x24bce8(0x266)+_0x3969df['id']+')')),_0x3969df['entryCriteria']&&(console[_0x24bce8(0x337)]('\x20\x20\x20\x20\x20\x20'+a31_0x27c26e[_0x24bce8(0x271)](_0x24bce8(0x2e3))+'\x20'+_0x3969df[_0x24bce8(0x343)]['name']),_0x3969df['entryCriteria'][_0x24bce8(0x1e3)]?.[_0x24bce8(0x2ba)]&&console['log'](_0x24bce8(0x2d9)+a31_0x27c26e[_0x24bce8(0x271)](_0x24bce8(0x34e))+'\x20'+_0x3969df['entryCriteria']['keyEventCriteria'][_0x24bce8(0x2ba)])),_0x3969df[_0x24bce8(0x2a8)]&&console[_0x24bce8(0x337)](_0x24bce8(0x269)+a31_0x27c26e[_0x24bce8(0x271)]('payload:')+'\x20'+JSON['stringify'](_0x3969df[_0x24bce8(0x2a8)])),_0x3969df[_0x24bce8(0x2e1)]&&console[_0x24bce8(0x337)](_0x24bce8(0x269)+a31_0x27c26e[_0x24bce8(0x271)](_0x24bce8(0x25f))+'\x20true');}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x32f);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x234);async[a31_0x5bbcfa(0x232)](_0x5e69a6){const _0x52c1fc=a31_0x5bbcfa,{options:_0x2ea6b6,args:_0x3907de,tdx:_0x2b28a7}=_0x5e69a6,_0x45b945=_0x3907de[0x0];if(!_0x45b945)return console[_0x52c1fc(0x207)](_0x52c1fc(0x13d)),console[_0x52c1fc(0x207)](_0x52c1fc(0x159)),0x1;return await withSpinner(_0x52c1fc(0x1a3)+_0x45b945+_0x52c1fc(0x185),()=>_0x2b28a7[_0x52c1fc(0x301)][_0x52c1fc(0x33c)](_0x45b945),{'verbose':_0x2ea6b6[_0x52c1fc(0x28e)]}),console[_0x52c1fc(0x207)](_0x52c1fc(0x1ec)+_0x45b945+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x26c);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x288);async['execute'](_0x55375a){const _0x49f501=a31_0x5bbcfa,{options:_0x26a79a,tdx:_0x253105}=_0x55375a,_0x1a0516=_0x26a79a;let _0x59f2d8;if(_0x1a0516[_0x49f501(0x2b8)]){_0x59f2d8=await loadJSON(_0x1a0516[_0x49f501(0x2b8)],!![]);if(!_0x59f2d8['relationships']?.['parentFolder'])return console[_0x49f501(0x207)](_0x49f501(0x204)),console['error'](_0x49f501(0x2e0)),console[_0x49f501(0x207)](_0x49f501(0x14e)),0x1;}else{if(!_0x1a0516[_0x49f501(0x247)])return console[_0x49f501(0x207)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x49f501(0x207)](_0x49f501(0x211)),console[_0x49f501(0x207)](_0x49f501(0x2eb)),0x1;if(_0x1a0516[_0x49f501(0x2f6)]===undefined)return console[_0x49f501(0x207)](_0x49f501(0x166)),console[_0x49f501(0x207)](_0x49f501(0x211)),console[_0x49f501(0x207)](_0x49f501(0x2eb)),0x1;if(_0x1a0516[_0x49f501(0x303)]===undefined)return console[_0x49f501(0x207)](_0x49f501(0x190)),console['error'](_0x49f501(0x241)),0x1;let _0x258262=_0x1a0516[_0x49f501(0x244)];if(!_0x258262&&_0x26a79a[_0x49f501(0x155)]){const _0xe63f51=await withSpinner(_0x49f501(0x253)+_0x26a79a['parentSegment']+_0x49f501(0x185),()=>_0x253105['segment'][_0x49f501(0x1a8)](_0x26a79a[_0x49f501(0x155)]),{'verbose':_0x26a79a[_0x49f501(0x28e)]});_0x258262=_0xe63f51[_0x49f501(0x15e)];}let _0x1e35d3;_0x1a0516[_0x49f501(0x2bd)]&&(_0x1e35d3=await loadJSON(_0x1a0516[_0x49f501(0x2bd)],![]));const _0x390a6d=_0x1a0516[_0x49f501(0x303)]===_0x49f501(0x2de)?null:{'id':_0x1a0516[_0x49f501(0x303)],'type':_0x49f501(0x2f4)};_0x59f2d8={'attributes':{'name':_0x1a0516[_0x49f501(0x247)],'description':_0x1a0516[_0x49f501(0x2f6)]||null,..._0x258262!==undefined&&{'audienceId':_0x258262},..._0x1e35d3!==undefined&&{'sections':_0x1e35d3}},'relationships':{'parentFolder':{'data':_0x390a6d}}};}const _0x184ee7=await withSpinner(_0x49f501(0x22d)+(_0x59f2d8[_0x49f501(0x29e)]?.[_0x49f501(0x247)]??'')+_0x49f501(0x185),()=>_0x253105[_0x49f501(0x301)][_0x49f501(0x143)](_0x59f2d8),{'verbose':_0x26a79a[_0x49f501(0x28e)]}),_0x10150b=_0x184ee7[_0x49f501(0x15e)];return console[_0x49f501(0x207)](_0x49f501(0x21d)+_0x10150b[_0x49f501(0x247)]+_0x49f501(0x1de)+_0x10150b['id']),await handleSDKOutput([_0x10150b],_0x26a79a),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x1f5);[a31_0x5bbcfa(0x2f6)]='Update\x20a\x20realtime\x20personalization\x20entity';async[a31_0x5bbcfa(0x232)](_0x46cdf2){const _0x741007=a31_0x5bbcfa,{options:_0x180b81,args:_0x49c107}=_0x46cdf2,_0x3b0915=_0x180b81,_0x426d26=_0x49c107[0x0];if(!_0x426d26)return console[_0x741007(0x207)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x741007(0x207)](_0x741007(0x2ab)),console[_0x741007(0x207)](_0x741007(0x2e5)),0x1;let _0xdc7fbd;if(_0x3b0915[_0x741007(0x2b8)])_0xdc7fbd=await loadJSON(_0x3b0915[_0x741007(0x2b8)],!![]);else{if(!_0x3b0915['name'])return console[_0x741007(0x207)](_0x741007(0x15d)),console[_0x741007(0x207)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;if(_0x3b0915[_0x741007(0x2f6)]===undefined)return console['error'](_0x741007(0x166)),console['error'](_0x741007(0x2ab)),0x1;let _0x2f8dc2;_0x3b0915[_0x741007(0x2bd)]&&(_0x2f8dc2=await loadJSON(_0x3b0915[_0x741007(0x2bd)],![])),_0xdc7fbd={'attributes':{'name':_0x3b0915['name'],'description':_0x3b0915[_0x741007(0x2f6)]||null,..._0x2f8dc2!==undefined&&{'sections':_0x2f8dc2}}};}const {tdx:_0xe570c4}=_0x46cdf2,_0x42316a=await withSpinner(_0x741007(0x1d9)+_0x426d26+_0x741007(0x185),()=>_0xe570c4[_0x741007(0x301)][_0x741007(0x2b1)](_0x426d26,_0xdc7fbd),{'verbose':_0x180b81[_0x741007(0x28e)]}),_0x115dae=_0x42316a[_0x741007(0x15e)];return console[_0x741007(0x207)](_0x741007(0x25e)+_0x115dae[_0x741007(0x247)]+_0x741007(0x2ca)+_0x115dae['id']+')'),await handleSDKOutput([_0x115dae],_0x180b81),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x213);['description']='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async['execute'](_0x330791){const _0x5bd7df=a31_0x5bbcfa,{options:_0x38635d,args:_0x6aed35}=_0x330791,_0x4ad7c7=_0x6aed35[0x0]||_0x38635d[_0x5bd7df(0x155)];if(!_0x4ad7c7)return showParentSegmentNotSetError(_0x5bd7df(0x178)+_0x5bd7df(0x170)),0x1;const _0x588064=resolveYamlFile(_0x4ad7c7);if(!existsSync(_0x588064))return showFileNotFoundError(_0x588064,_0x4ad7c7),0x1;let _0x5b15b3;try{_0x5b15b3=readFileSync(_0x588064,'utf-8');}catch(_0x326134){const _0x273198=_0x326134 instanceof Error?_0x326134['message']:String(_0x326134);return console[_0x5bd7df(0x207)](_0x5bd7df(0x2bb)+_0x273198),0x1;}let _0xc48831;try{_0xc48831=parseDef(_0x5b15b3);}catch(_0x55f19d){const _0x34c4c7=_0x55f19d instanceof Error?_0x55f19d['message']:String(_0x55f19d);return console[_0x5bd7df(0x207)](a31_0x27c26e[_0x5bd7df(0x172)](_0x5bd7df(0x30e)+_0x34c4c7)),0x1;}if(_0xc48831[_0x5bd7df(0x199)]&&_0xc48831['personalization_services']['length']>0x0)return console[_0x5bd7df(0x207)](a31_0x27c26e[_0x5bd7df(0x27d)](_0x5bd7df(0x330)+_0x588064)),console[_0x5bd7df(0x207)](a31_0x27c26e[_0x5bd7df(0x1be)](_0x5bd7df(0x2b5)+_0xc48831[_0x5bd7df(0x199)][_0x5bd7df(0x141)]+_0x5bd7df(0x332))),0x1;!_0xc48831[_0x5bd7df(0x299)]&&(_0xc48831[_0x5bd7df(0x299)]={'events':[{'name':'page_view','source_table':'<database>.<table>'}],'attributes':[{'name':_0x5bd7df(0x273),'type':_0x5bd7df(0x15b)}],'id_stitching':{'primary_key':_0xc48831[_0x5bd7df(0x289)]['table']===_0x5bd7df(0x188)?'td_client_id':_0x5bd7df(0x1af)}});_0xc48831[_0x5bd7df(0x199)]=[{'name':'My\x20Service','description':_0x5bd7df(0x1d1),'trigger_event':_0x5bd7df(0x25a),'sections':[{'name':_0x5bd7df(0x1f9),'criteria':_0x5bd7df(0x1f1),'attributes':['last_page_viewed']}]}];const _0x3720cb=serializeDef(_0xc48831);return writeFileSync(_0x588064,_0x3720cb,_0x5bd7df(0x2dc)),console['error'](a31_0x27c26e[_0x5bd7df(0x2a3)]('✔')+_0x5bd7df(0x1ee)+a31_0x27c26e[_0x5bd7df(0x271)](_0x588064)),(!_0xc48831['realtime']||_0x5b15b3[_0x5bd7df(0x222)](_0x5bd7df(0x294))===-0x1)&&console[_0x5bd7df(0x207)](a31_0x27c26e[_0x5bd7df(0x2a3)]('✔')+_0x5bd7df(0x1c0)),console[_0x5bd7df(0x207)]('\x0a'+a31_0x27c26e[_0x5bd7df(0x1be)](_0x5bd7df(0x356))),console[_0x5bd7df(0x207)](_0x5bd7df(0x24f)+_0x588064+_0x5bd7df(0x2d1)),console['error']('\x20\x202.\x20Run\x20'+a31_0x27c26e[_0x5bd7df(0x1be)](_0x5bd7df(0x2f1)+_0x4ad7c7)+_0x5bd7df(0x272)),0x0;}}
|