@treasuredata/tdx 2026.3.27 → 2026.3.29
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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/auth-login-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.d.ts +141 -2
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +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/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/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts +29 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.d.ts +228 -0
- package/dist/sdk/personalization.d.ts.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/personalization.js.map +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.d.ts +57 -0
- package/dist/sdk/realtime.d.ts.map +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/realtime.js.map +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/cdp.d.ts +76 -0
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/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/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x11f642=a30_0x9f58;(function(_0x3c6e49,_0x550354){const _0x52ff0f=a30_0x9f58,_0x33a239=_0x3c6e49();while(!![]){try{const _0x31a040=-parseInt(_0x52ff0f(0x146))/0x1*(-parseInt(_0x52ff0f(0x1c5))/0x2)+parseInt(_0x52ff0f(0x185))/0x3+-parseInt(_0x52ff0f(0x168))/0x4*(parseInt(_0x52ff0f(0x209))/0x5)+-parseInt(_0x52ff0f(0x1e3))/0x6*(parseInt(_0x52ff0f(0x17f))/0x7)+-parseInt(_0x52ff0f(0xda))/0x8*(-parseInt(_0x52ff0f(0x10b))/0x9)+-parseInt(_0x52ff0f(0x103))/0xa+parseInt(_0x52ff0f(0x135))/0xb;if(_0x31a040===_0x550354)break;else _0x33a239['push'](_0x33a239['shift']());}catch(_0x4e6eed){_0x33a239['push'](_0x33a239['shift']());}}}(a30_0xfafd,0x9ff16));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a30_0x2024cb 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}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';function a30_0xfafd(){const _0x2cf5d2=['localeCompare','segment:parent:pull','segment:parent:sql','RT\x202.0\x20Validate:','Master\x20Table','11160820tTguUC','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20RT\x20configuration\x20is\x20valid','xdg-open','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','table','green','web','run','<database>.<table>','Errors:','Output\x20file:\x20','displayAttributesStats','format','column_name','runParent','attributes','2gsjWmp','\x20--interval\x20','\x20to\x20configure\x20your\x20personalization\x20service','cyan','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','timezone','joinKey','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','SELECT\x20*\x20FROM\x20(\x0a','dim','Parent\x20segment:\x20','No\x20personalization\x20services\x20configured','\x0a⚠️\x20\x20Both\x20','SELECT\x20*\x20FROM\x20','Options:\x0a','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','ps:rt:validate','getParentFull','\x20Opening\x20','Fetching\x20current\x20configuration\x20for\x20\x27','segment:parent:view','customerPercent','\x0aUsage:\x20tdx\x20ps\x20preview\x20','segment:parent:push','valid','\x0a⚠️\x20\x20Migrating:\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','scheduleType','👥\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','error','Updated','815132mpKYvM','keys','ps:pz:init','\x20\x20\x20','attributesFile','columns','page_view','%)\x20','addBehaviors','listParents','\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','Updating\x20parent\x20segment\x20\x27','Join:','displaySampleData','Analyzing\x20changes...','toLowerCase','yellow','Fetching\x20behavior\x20list...','trim','\x0aChanges\x20to\x20apply\x20to\x20\x27','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Attributes','Columns:','429114JCnKHV','⚡\x20Not\x20enabled','createParent','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','repeat','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','1680528JANKhA','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','toFixed','last_page_viewed','Creating\x20parent\x20segment\x20\x27','/app/workflows/','using\x20the\x20default\x20path:\x20','scheduleOption','behaviorsFile','\x20Configuration\x20is\x20valid','segment:parent:validate','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Fetching\x20parent\x20segment\x20\x27','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','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','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','utf-8','segment:parent:list','Creating','\x20service(s)\x20configured','Status:','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','No\x20parent\x20segments\x20match\x20pattern:\x20','To\x20cancel:','filter','single','customersWithEvents','parentSegment','Options\x20(one\x20required):\x0a','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','yes','all','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','addAttributes','Default','elapsedTimeMillis','\x20[Job\x20ID:\x20','Schema\x20saved\x20to\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','realtime','\x0a✔\x20Workflow\x20started','matchedCount','\x20--enriched','\x20field','SQL\x20query:\x0a','map','Updating','Error:','Preview:','\x0a\x20\x20\x20\x20]','displayBehaviorsStats','stitchingKeys','\x20RT-enabled\x20parent\x20segment','jsonl','\x20\x20Note:\x20','events','varchar','session','site','allValid','red','resolveParentId','\x20is\x20already\x20up\x20to\x20date','1092526MWAGzG','\x27\x20is\x20already\x20up\x20to\x20date','tdx\x20ps\x20push\x20','Options:','Next\x20steps:','column_type','displayMasterInfo','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','✔\x20No\x20changes\x20-\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','addAttributesFile','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','join','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','validateParentYaml','Audience\x20ID:','output','Personalization:','\x20service','\x20trigger=','\x27...','\x22\x20}','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','displayValidateResults','\x20\x20\x20\x20\x20\x20','getOutputDatabaseName','schemaValid','\x20\x20Tables:\x201\x20customers\x20+\x20','log','query','78qWJPSx','ps:pz:list','\x0a\x20\x20]\x0a}\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Error:\x20--attribute\x20requires\x20a\x20name\x0a','endsWith','parent_segment','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','data','Table:\x20','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','Executing\x20parent\x20segment\x20query...','bold','Coverage:','/sessions/','\x20tdx\x20wf\x20attempt\x20','✔\x20Query\x20completed:\x20Processed\x20','Master:','behavior','Validating\x20RT\x20configuration...','preview','displayPreviewResults','json','ignore','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','previewParentYaml','getParentSQL','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Error\x20parsing\x20YAML:\x20','`\x20to\x20download\x20the\x20configuration\x20first','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','realtime_enabled','✔\x20Created\x20parent\x20segment\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x20--behavior\x20\x22','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','25wDehDM','behavior_','Rows:','dirname','message','\x20--attribute\x20\x22<name>\x22','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','parent_id','Error\x20reading\x20file:\x20','\x20--behavior\x20\x22<name>\x22','Events:','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','jobId','\x20\x20\x20\x20','\x20rows)','\x27\x20with\x20ID:\x20','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','string','-1d','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Name:\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','\x20Context\x20set:\x20','\x0aError:','test','trigger_event','segment:parent:update','\x20rows\x20','behaviors','Error:\x20Parent\x20segment\x20name\x20is\x20required','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','customers','Overwrite\x20\x27','ID\x20Stitching:','length','\x20section','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','\x0aNew\x20parent\x20segment\x20\x27','column','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Error:\x20--database\x20and\x20--table\x20are\x20required','indexOf','displayRealtimeInfo','parent_segments','stop','double','realtime:','Personalization\x20service\x20description','setJobId','RT\x202.0:','Listing\x20RT-enabled\x20parent\x20segments...','enriched','start','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','ps:rt:list','Fetching\x20SQL\x20for\x20\x27','Validate:','\x20parent\x20segment\x20\x27','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','interval','push','errors','Create\x20parent\x20segment\x20\x27','Aborted.','personalization_services','\x20parent\x20segment','segment:parent:desc','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20\x20\x20-\x20','/\x20directories\x20exist.','tdx\x20ps\x20preview\x20','attribute','number','foreignKey','sourceTableError','/attempt/','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x27\x20and\x20run\x20workflow?','status','schemaError','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','name','stats','sort','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','verbose','addBehaviorsFile','sourceTableValid','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Listing\x20parent\x20segments\x20matching\x20\x27','Error:\x20File\x20not\x20found:\x20','coveragePercent','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','57368HaLQLH','\x20configured','getBehaviorNames','customerGroup','List\x20available\x20fields\x20for\x20segmentation','\x20=\x20','\x22,\x20\x22type\x22:\x20\x22','darwin','personalizationServices','displayColumns','population','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Customers:','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','database','replace','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','No\x20RT-enabled\x20parent\x20segments\x20found','FINISHED','totalEvents','Attempt:','/\x20→\x20','.yml','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','rowCount','formatSchemaJson','Output\x20Database:','\x20--attribute\x20\x22','displaySummary','{\x0a\x20\x20\x22database\x22:\x20\x22','Session:','Show\x20parent\x20segment\x20details','text','\x20\x20No\x20sample\x20data\x20available','idStitching','Apply\x20changes\x20to\x20\x27','segment:parent:run','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','12935180RIWQJJ','label','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Master\x20+\x20Attributes','sections','td_client_id','Join\x20on:','Enriched:','1377wrXeqd','pushParentYaml','\x20to\x20push\x20the\x20configuration','description','master','My\x20Service','✔\x20Found\x20','win32','Site:\x20','sampleData','List\x20parent\x20segments','YAML\x20file:\x20','use','segment','reduce','No\x20parent\x20segments\x20found','\x5c$&','Fetching\x20sample\x20data...','workflowSessionId','\x20\x201.\x20Edit\x20','segment:parent:preview','/\x20directory.\x0a','segment:parent:create','Behaviors','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','workflowAttemptId','true','Available\x20behaviors:','\x0a\x20\x20\x20\x20}','segment:parent:show','/app/dw/parentSegments/','\x20\x20Database:\x20','displayPreviewHints','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','execute','Fetching\x20customers\x20schema...','Running\x20parent\x20segment\x20workflow\x20for\x20\x27'];a30_0xfafd=function(){return _0x2cf5d2;};return a30_0xfafd();}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 a30_0x2ba769 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=a30_0x11f642(0xa6),LEGACY_PARENT_SEGMENT_DIR=a30_0x11f642(0x1e9);function openBrowser(_0xafeccd){const _0x414c41=a30_0x11f642,_0x3225f5=process['platform'],_0x22811c=_0x3225f5===_0x414c41(0xe1)?'open':_0x3225f5===_0x414c41(0x112)?_0x414c41(0xaf):_0x414c41(0x138);spawn(_0x22811c,[_0xafeccd],{'detached':!![],'stdio':_0x414c41(0x1fb)})['unref']();}function migrateLegacyDirectory(){const _0xc9ef1=a30_0x11f642;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2b7402=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2b7402['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xc9ef1(0x166)](a30_0x2ba769[_0xc9ef1(0x178)](_0xc9ef1(0x154)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0xc9ef1(0xc1))),console[_0xc9ef1(0x166)](a30_0x2ba769[_0xc9ef1(0x151)](_0xc9ef1(0x202)+LEGACY_PARENT_SEGMENT_DIR+_0xc9ef1(0x120))),![];console[_0xc9ef1(0x166)](a30_0x2ba769[_0xc9ef1(0x178)](_0xc9ef1(0x161)+LEGACY_PARENT_SEGMENT_DIR+_0xc9ef1(0xf0)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a30_0x2ba769[_0xc9ef1(0x13b)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4ac7e7){const _0x4c5ad0=_0x4ac7e7 instanceof Error?_0x4ac7e7[_0xc9ef1(0x20d)]:String(_0x4ac7e7);return console[_0xc9ef1(0x166)](a30_0x2ba769[_0xc9ef1(0x1c2)](_0xc9ef1(0x136)+_0x4c5ad0+'\x0a')),![];}}function a30_0x9f58(_0x5792c2,_0xdb4a34){_0x5792c2=_0x5792c2-0x93;const _0xfafdb7=a30_0xfafd();let _0x9f58f=_0xfafdb7[_0x5792c2];return _0x9f58f;}class BaseParentSegmentCommand extends BaseCommand{async[a30_0x11f642(0x13d)](_0x483852){return migrateLegacyDirectory(),super['run'](_0x483852);}}function resolveYamlFile(_0x50b497){const _0x5e8c80=a30_0x11f642;if(_0x50b497[_0x5e8c80(0x1e8)](_0x5e8c80(0xf1))||_0x50b497['endsWith']('.yaml'))return _0x50b497;return a30_0x2024cb['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x50b497)+'.yml');}function formatProgressMessage(_0x3f7914){const _0x4117d8=a30_0x11f642,_0x38d970=_0x3f7914['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x38d970){const [,_0x189af6,_0x3a5936,_0x35cd51='']=_0x38d970;return a30_0x2ba769['dim'](_0x189af6+':')+'\x20'+_0x3a5936+a30_0x2ba769[_0x4117d8(0x151)](_0x35cd51);}return a30_0x2ba769[_0x4117d8(0x151)](_0x3f7914);}function showFileNotFoundError(_0x3d04ab,_0x2dc58e){const _0x235cc0=a30_0x11f642;console[_0x235cc0(0x166)](a30_0x2ba769[_0x235cc0(0x1c2)](_0x235cc0(0xd7)+_0x3d04ab+'\x0a')),console[_0x235cc0(0x166)](a30_0x2ba769[_0x235cc0(0x149)](_0x235cc0(0x17c)+_0x2dc58e+_0x235cc0(0x201)));}function displayRealtimeValidation(_0x1b43b5){const _0x39b094=a30_0x11f642;if(!_0x1b43b5[_0x39b094(0x1ad)])return;const _0x17f67b=_0x1b43b5['realtime'],_0x87b3fc=_0x17f67b['enabled']?a30_0x2ba769['green']('⚡\x20Enabled'):a30_0x2ba769[_0x39b094(0x178)](_0x39b094(0x180));console['error']('\x0a'+a30_0x2ba769[_0x39b094(0x151)](_0x39b094(0xac))+'\x20'+_0x87b3fc);if(_0x17f67b[_0x39b094(0x1bd)]&&_0x17f67b[_0x39b094(0x1bd)][_0x39b094(0x9c)]>0x0){console[_0x39b094(0x166)]('\x20\x20'+a30_0x2ba769[_0x39b094(0x151)](_0x39b094(0x213))+'\x20'+_0x17f67b['events']['length']+_0x39b094(0xdb));for(const _0x18f86f of _0x17f67b[_0x39b094(0x1bd)]){const _0xa1b081=_0x18f86f[_0x39b094(0xd4)]===![]?a30_0x2ba769[_0x39b094(0x1c2)]('✘'):a30_0x2ba769['green']('✔');console['error'](_0x39b094(0x216)+_0xa1b081+'\x20'+_0x18f86f[_0x39b094(0xcd)]),_0x18f86f[_0x39b094(0xc6)]&&console[_0x39b094(0x166)](_0x39b094(0x1dd)+a30_0x2ba769[_0x39b094(0x1c2)](_0x18f86f[_0x39b094(0xc6)]));}}if(_0x17f67b['attributes']&&_0x17f67b['attributes']['length']>0x0){console[_0x39b094(0x166)]('\x20\x20'+a30_0x2ba769['dim']('Attributes:')+'\x20'+_0x17f67b[_0x39b094(0x145)][_0x39b094(0x9c)]+'\x20configured');for(const _0x295bc4 of _0x17f67b[_0x39b094(0x145)]){const _0x35870d=_0x295bc4[_0x39b094(0x160)]?a30_0x2ba769[_0x39b094(0x13b)]('✔'):a30_0x2ba769['red']('✘');console['error'](_0x39b094(0x216)+_0x35870d+'\x20'+_0x295bc4[_0x39b094(0xcd)]+'\x20'+a30_0x2ba769[_0x39b094(0x151)]('('+_0x295bc4['type']+')'));}}if(_0x17f67b[_0x39b094(0xfd)]){const _0x3448f0=_0x17f67b[_0x39b094(0xfd)][_0x39b094(0x1b9)]?.[_0x39b094(0x9c)]?'\x20+\x20['+_0x17f67b[_0x39b094(0xfd)][_0x39b094(0x1b9)][_0x39b094(0x1d1)](',\x20')+']':'';console[_0x39b094(0x166)]('\x20\x20'+a30_0x2ba769[_0x39b094(0x151)](_0x39b094(0x9b))+'\x20'+_0x17f67b[_0x39b094(0xfd)]['primaryKey']+_0x3448f0);}if(_0x17f67b[_0x39b094(0xe2)]&&_0x17f67b['personalizationServices']['length']>0x0){console[_0x39b094(0x166)]('\x20\x20'+a30_0x2ba769[_0x39b094(0x151)](_0x39b094(0x1d6))+'\x20'+_0x17f67b[_0x39b094(0xe2)][_0x39b094(0x9c)]+_0x39b094(0x1d7)+(_0x17f67b[_0x39b094(0xe2)][_0x39b094(0x9c)]!==0x1?'s':''));for(const _0x2b521b of _0x17f67b['personalizationServices']){console[_0x39b094(0x166)](_0x39b094(0xc0)+_0x2b521b['name']);}}}function showParentSegmentNotSetError(_0x50a5e7){const _0x50edab=a30_0x11f642;console[_0x50edab(0x166)](a30_0x2ba769['yellow'](_0x50edab(0xcc))),console['error'](_0x50a5e7);}export class ParentSegmentListCommand extends BaseCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0x196);['description']=a30_0x11f642(0x115);async[a30_0x11f642(0x12d)](_0x1b487d){const _0x4536f0=a30_0x11f642,{options:_0x2c46a1,args:_0x55aff1,tdx:_0x1c465c}=_0x1b487d,_0x442b34=_0x55aff1[0x0];_0x2c46a1['verbose']&&(console[_0x4536f0(0x166)](_0x4536f0(0x113)+_0x2c46a1[_0x4536f0(0x1c0)]),_0x442b34&&console[_0x4536f0(0x166)]('Pattern:\x20'+_0x442b34));const _0x53fdf1=await withSpinner(_0x442b34?_0x4536f0(0xd6)+_0x442b34+_0x4536f0(0x1d9):'Listing\x20parent\x20segments...',()=>_0x1c465c[_0x4536f0(0x118)][_0x4536f0(0x171)](),{'verbose':_0x2c46a1[_0x4536f0(0xd2)]});let _0x647ef0=_0x53fdf1[_0x4536f0(0x1ec)];if(_0x442b34){const _0x9af63c=_0x442b34[_0x4536f0(0xea)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x4536f0(0xea)](/\?/g,'.'),_0x598b54=new RegExp('^'+_0x9af63c+'$','i');_0x647ef0=_0x647ef0[_0x4536f0(0x19d)](_0x16f921=>_0x598b54[_0x4536f0(0x221)](_0x16f921[_0x4536f0(0x145)][_0x4536f0(0xcd)]));}_0x647ef0['sort']((_0x2437d6,_0x3121f0)=>_0x2437d6[_0x4536f0(0x145)]['name'][_0x4536f0(0x130)](_0x3121f0[_0x4536f0(0x145)][_0x4536f0(0xcd)])),console[_0x4536f0(0x166)](_0x4536f0(0x111)+_0x647ef0[_0x4536f0(0x9c)]+_0x4536f0(0xbd)+(_0x647ef0[_0x4536f0(0x9c)]!==0x1?'s':''));const _0x79cce9=_0xd0e48c=>{const _0x2076d8=_0x4536f0;return getConsoleNextUrl(_0x2c46a1['site'],_0x2076d8(0x129)+_0xd0e48c);};if(_0x2c46a1['format']===_0x4536f0(0x1fa)||_0x2c46a1[_0x4536f0(0x142)]==='jsonl'){const _0x25f82d=_0x647ef0[_0x4536f0(0x1b3)](_0x5982f1=>({..._0x5982f1,'url':_0x79cce9(_0x5982f1['id'])}));await handleSDKOutput(_0x25f82d,_0x2c46a1);}else{if(_0x647ef0[_0x4536f0(0x9c)]===0x0)_0x442b34?console[_0x4536f0(0x1e1)](_0x4536f0(0x19b)+_0x442b34):console[_0x4536f0(0x1e1)](_0x4536f0(0x11a));else for(const _0x2a8133 of _0x647ef0){const _0x5bd6f6=_0x2a8133[_0x4536f0(0x145)][_0x4536f0(0xe4)]?a30_0x2ba769[_0x4536f0(0x151)]('\x20('+formatRows(_0x2a8133[_0x4536f0(0x145)][_0x4536f0(0xe4)])+')'):'',_0x1a60f1=hyperlink(_0x2a8133[_0x4536f0(0x145)][_0x4536f0(0xcd)],_0x79cce9(_0x2a8133['id']));console[_0x4536f0(0x1e1)](_0x4536f0(0x164)+_0x1a60f1+_0x5bd6f6);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0x121);[a30_0x11f642(0x10e)]=a30_0x11f642(0xc8);async[a30_0x11f642(0x12d)](_0x46597f){const _0x55ef39=a30_0x11f642,{options:_0x1ed16f,args:_0x1e6608,tdx:_0x360b7b}=_0x46597f;console[_0x55ef39(0x166)](_0x55ef39(0x182)+_0x55ef39(0xeb)+_0x55ef39(0x1a2));const _0x3e5913=_0x1ed16f;if(_0x1e6608[_0x55ef39(0x9c)]===0x0)return console['error'](a30_0x2ba769[_0x55ef39(0x1c2)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x55ef39(0x166)](_0x55ef39(0x1ff)),0x1;const _0x5a33fe=_0x1e6608[0x0];if(!_0x3e5913[_0x55ef39(0xe9)]||!_0x3e5913[_0x55ef39(0x13a)])return console[_0x55ef39(0x166)](_0x55ef39(0xa3)),console[_0x55ef39(0x166)](_0x55ef39(0x1ff)),0x1;_0x3e5913[_0x55ef39(0xd2)]&&(console['error'](_0x55ef39(0x113)+_0x3e5913[_0x55ef39(0x1c0)]),console['error'](_0x55ef39(0x21d)+_0x5a33fe),console[_0x55ef39(0x166)]('Database:\x20'+_0x3e5913[_0x55ef39(0xe9)]),console[_0x55ef39(0x166)](_0x55ef39(0x1ed)+_0x3e5913['table']));const _0x3a1018=await loadJSONFromOptions(_0x3e5913[_0x55ef39(0x145)],_0x3e5913[_0x55ef39(0x16c)]),_0x530a32=await loadJSONFromOptions(_0x3e5913[_0x55ef39(0x96)],_0x3e5913[_0x55ef39(0x18d)]),_0x978638=await loadJSONFromOptions(_0x3e5913['customerGroup'],_0x3e5913['customerGroupFile']),_0x20b803={'name':_0x5a33fe,'description':_0x3e5913[_0x55ef39(0x10e)],'scheduleType':_0x3e5913[_0x55ef39(0x163)],'scheduleOption':_0x3e5913[_0x55ef39(0x18c)],'timezone':_0x3e5913[_0x55ef39(0x14c)],'master':{'parentDatabaseName':_0x3e5913['database'],'parentTableName':_0x3e5913[_0x55ef39(0x13a)]},'attributes':_0x3a1018,'behaviors':_0x530a32,'customerGroup':_0x978638},_0x20989c=await withSpinner(_0x55ef39(0x189)+_0x5a33fe+'\x27...',()=>_0x360b7b['segment'][_0x55ef39(0x181)](_0x20b803),{'verbose':_0x1ed16f[_0x55ef39(0xd2)]}),_0x4abb83=_0x20989c['data'];return console[_0x55ef39(0x166)](_0x55ef39(0x204)+_0x4abb83[_0x55ef39(0xcd)]+_0x55ef39(0x218)+_0x4abb83['id']),await handleSDKOutput([_0x4abb83],_0x1ed16f),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0x94);['description']=a30_0x11f642(0xe5);async[a30_0x11f642(0x12d)](_0x9ecde0){const _0x158dbe=a30_0x11f642,{options:_0x24a122,args:_0x43fea0,tdx:_0x8e864d}=_0x9ecde0;console[_0x158dbe(0x166)](_0x158dbe(0x184)+_0x158dbe(0xeb)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3cff93=_0x24a122;if(_0x43fea0[_0x158dbe(0x9c)]===0x0)return console['error'](a30_0x2ba769[_0x158dbe(0x1c2)](_0x158dbe(0x97))),console[_0x158dbe(0x166)](_0x158dbe(0x19a)),0x1;const _0x4591f0=_0x43fea0[0x0];_0x3cff93[_0x158dbe(0xd2)]&&(console['error'](_0x158dbe(0x113)+_0x3cff93[_0x158dbe(0x1c0)]),console['error'](_0x158dbe(0x152)+_0x4591f0));const _0x232c67=await withSpinner(_0x158dbe(0x15b)+_0x4591f0+_0x158dbe(0x1d9),()=>_0x8e864d['segment'][_0x158dbe(0x159)](_0x4591f0),{'verbose':_0x3cff93[_0x158dbe(0xd2)]}),_0x4aede1=_0x232c67[_0x158dbe(0x1ec)],_0x42b722=await loadJSONFromOptions(_0x3cff93[_0x158dbe(0x1a7)],_0x3cff93[_0x158dbe(0x1cf)]),_0x4ccfcc=await loadJSONFromOptions(_0x3cff93[_0x158dbe(0x170)],_0x3cff93[_0x158dbe(0xd3)]),_0x1b0ac8={'name':_0x4aede1[_0x158dbe(0xcd)],'description':_0x3cff93[_0x158dbe(0x10e)]!==undefined?_0x3cff93[_0x158dbe(0x10e)]:_0x4aede1[_0x158dbe(0x10e)],'scheduleType':_0x3cff93[_0x158dbe(0x163)]!==undefined?_0x3cff93[_0x158dbe(0x163)]:_0x4aede1[_0x158dbe(0x163)],'scheduleOption':_0x3cff93[_0x158dbe(0x18c)]!==undefined?_0x3cff93[_0x158dbe(0x18c)]:_0x4aede1[_0x158dbe(0x18c)],'timezone':_0x3cff93['timezone']!==undefined?_0x3cff93['timezone']:_0x4aede1[_0x158dbe(0x14c)],'master':_0x4aede1[_0x158dbe(0x10f)],'attributes':_0x42b722?[..._0x4aede1[_0x158dbe(0x145)]||[],..._0x42b722]:_0x4aede1[_0x158dbe(0x145)],'behaviors':_0x4ccfcc?[..._0x4aede1[_0x158dbe(0x96)]||[],..._0x4ccfcc]:_0x4aede1['behaviors'],'customerGroup':_0x4aede1[_0x158dbe(0xdd)]},_0x386a77=await withSpinner(_0x158dbe(0x173)+_0x4591f0+_0x158dbe(0x1d9),()=>_0x8e864d['segment']['updateParent'](_0x4591f0,_0x1b0ac8),{'verbose':_0x3cff93[_0x158dbe(0xd2)]}),_0x42143b=_0x386a77[_0x158dbe(0x1ec)];return console[_0x158dbe(0x166)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x42143b[_0x158dbe(0xcd)]+'\x27'),await handleSDKOutput([_0x42143b],_0x3cff93),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0x131);[a30_0x11f642(0x10e)]=a30_0x11f642(0xd9);async[a30_0x11f642(0x12d)](_0x5a2ca3){const _0x29944b=a30_0x11f642,{options:_0x2eb5e3,args:_0x158ac9,tdx:_0x3adeec}=_0x5a2ca3,_0x2b5131=_0x2eb5e3,_0x298968=_0x158ac9[0x0]||_0x2eb5e3['parentSegment'];if(!_0x298968)return showParentSegmentNotSetError(_0x29944b(0x21e)+_0x29944b(0x1ce)),0x1;if(_0x2b5131[_0x29944b(0x117)]&&_0x2b5131['output'])return console[_0x29944b(0x166)](a30_0x2ba769[_0x29944b(0x1c2)](_0x29944b(0x219))),console[_0x29944b(0x166)](a30_0x2ba769[_0x29944b(0x151)](_0x29944b(0x123))),console[_0x29944b(0x166)](a30_0x2ba769[_0x29944b(0x151)](_0x29944b(0x18b)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console['error'](a30_0x2ba769[_0x29944b(0x149)](_0x29944b(0x1d0))),0x1;const _0x53b18d=_0x2b5131[_0x29944b(0x1d5)]||a30_0x2024cb[_0x29944b(0x1d1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x298968)+_0x29944b(0xf1));_0x2b5131[_0x29944b(0xd2)]&&(console[_0x29944b(0x166)](_0x29944b(0x113)+_0x2b5131[_0x29944b(0x1c0)]),console[_0x29944b(0x166)](_0x29944b(0x152)+_0x298968),console[_0x29944b(0x166)](_0x29944b(0x140)+_0x53b18d));const _0x4b6a5e=await withSpinner(_0x29944b(0x191)+_0x298968+_0x29944b(0x1d9),()=>_0x3adeec['segment']['pullParentYaml'](_0x298968),{'verbose':_0x2b5131[_0x29944b(0xd2)]}),_0x38ca21=_0x4b6a5e[_0x29944b(0x1ec)];if(existsSync(_0x53b18d)){const _0x405f89=readFileSync(_0x53b18d,'utf-8'),_0x11d56e=generateDiff(_0x405f89,_0x38ca21);if(!hasChanges(_0x11d56e))console[_0x29944b(0x166)](a30_0x2ba769[_0x29944b(0x13b)]('✔')+'\x20No\x20changes\x20-\x20'+a30_0x2ba769[_0x29944b(0x149)](_0x53b18d)+_0x29944b(0x1c4));else{console[_0x29944b(0x166)]('\x0aChanges\x20to\x20\x27'+_0x53b18d+'\x27:'),console[_0x29944b(0x166)]('─'['repeat'](0x3c)),console[_0x29944b(0x166)](formatDiffWithColors(_0x11d56e)),console['error']('─'[_0x29944b(0x183)](0x3c));if(!_0x2b5131[_0x29944b(0x1a3)]){if(!isInteractive())return console[_0x29944b(0x166)](a30_0x2ba769[_0x29944b(0x1c2)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x29944b(0x166)](a30_0x2ba769[_0x29944b(0x151)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2641d5=await confirmKey(_0x29944b(0x9a)+_0x53b18d+'\x27?');if(!_0x2641d5)return console['error'](a30_0x2ba769[_0x29944b(0x178)](_0x29944b(0xbb))),0x1;}writeFileSync(_0x53b18d,_0x38ca21,_0x29944b(0x195)),console['error'](a30_0x2ba769[_0x29944b(0x13b)]('✔')+_0x29944b(0xa1)+a30_0x2ba769[_0x29944b(0x149)](_0x53b18d));}}else{const _0x4e9b1c=a30_0x2024cb[_0x29944b(0x20c)](_0x53b18d);!existsSync(_0x4e9b1c)&&mkdirSync(_0x4e9b1c,{'recursive':!![]}),writeFileSync(_0x53b18d,_0x38ca21,'utf-8'),console[_0x29944b(0x166)](a30_0x2ba769['green']('✔')+_0x29944b(0xa1)+a30_0x2ba769[_0x29944b(0x149)](_0x53b18d));}return saveSessionContext({'parent_segment':_0x298968},_0x2b5131[_0x29944b(0x1bf)]),console[_0x29944b(0x166)](a30_0x2ba769[_0x29944b(0x13b)]('✔')+_0x29944b(0x21f)+a30_0x2ba769[_0x29944b(0x151)]('parent_segment')+_0x29944b(0xdf)+a30_0x2ba769[_0x29944b(0x149)](_0x298968)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0x15f);[a30_0x11f642(0x10e)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a30_0x11f642(0x12d)](_0xdd2901){const _0x2c3e56=a30_0x11f642,{options:_0x1ab935,args:_0x2cec00,tdx:_0x4a2345}=_0xdd2901,_0x4997fb=_0x1ab935,_0x3fe60a=_0x2cec00[0x0]||_0x1ab935[_0x2c3e56(0x1a0)];if(!_0x3fe60a)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x2c3e56(0x101)),0x1;const _0x2a9f95=resolveYamlFile(_0x3fe60a);if(!existsSync(_0x2a9f95))return showFileNotFoundError(_0x2a9f95,_0x3fe60a),0x1;_0x4997fb[_0x2c3e56(0xd2)]&&(console['error']('Site:\x20'+_0x4997fb['site']),console[_0x2c3e56(0x166)](_0x2c3e56(0x116)+_0x2a9f95));let _0x468f58;try{_0x468f58=readFileSync(_0x2a9f95,_0x2c3e56(0x195));}catch(_0x346a60){const _0x2bca8f=_0x346a60 instanceof Error?_0x346a60[_0x2c3e56(0x20d)]:String(_0x346a60);return console[_0x2c3e56(0x166)](_0x2c3e56(0x211)+_0x2bca8f),0x1;}const _0x106e7d=await withSpinner(_0x2c3e56(0x176),()=>_0x4a2345[_0x2c3e56(0x118)]['pushParentYaml'](_0x468f58),{'verbose':_0x4997fb[_0x2c3e56(0xd2)]}),_0x58ac4e=_0x106e7d['data'],{isNew:_0x43f08e,name:_0x4625c6,hasChanges:_0x2987be,diffFormatted:_0x489fac}=_0x58ac4e;if(!_0x2987be)return console[_0x2c3e56(0x166)](_0x2c3e56(0x1cd)+_0x4625c6+_0x2c3e56(0x1c6)),0x0;_0x43f08e?console[_0x2c3e56(0x166)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x4625c6+'\x27:'):console['error'](_0x2c3e56(0x17b)+_0x4625c6+'\x27:');console[_0x2c3e56(0x166)]('─'['repeat'](0x3c)),console[_0x2c3e56(0x166)](_0x489fac),console[_0x2c3e56(0x166)]('─'['repeat'](0x3c));const _0x7f1c3a=_0x43f08e?_0x2c3e56(0xba)+_0x4625c6+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x4625c6+'\x27?';if(!_0x4997fb[_0x2c3e56(0x1a3)]){if(!isInteractive())return console[_0x2c3e56(0x166)](a30_0x2ba769[_0x2c3e56(0x1c2)](_0x2c3e56(0x220)),_0x2c3e56(0x165)),console[_0x2c3e56(0x166)](a30_0x2ba769[_0x2c3e56(0x151)](_0x2c3e56(0x14e))),0x1;const _0x7ecb2c=await confirmKey(_0x7f1c3a);if(!_0x7ecb2c)return console['error'](a30_0x2ba769[_0x2c3e56(0x178)]('Aborted.')),0x1;}const _0x26c74b=_0x43f08e?_0x2c3e56(0x197):_0x2c3e56(0x1b4),_0x54c7eb=await withSpinner(_0x26c74b+_0x2c3e56(0xb4)+_0x4625c6+_0x2c3e56(0x1d9),()=>_0x58ac4e['apply'](),{'verbose':_0x4997fb[_0x2c3e56(0xd2)]}),_0x4c435d=_0x54c7eb['data'],_0x2c2ee9=getConsoleNextUrl(_0x4997fb[_0x2c3e56(0x1c0)],'/app/dw/parentSegments/'+_0x4c435d['id']),_0x29958c=_0x43f08e?'Created':_0x2c3e56(0x167);return console[_0x2c3e56(0x166)]('✔\x20'+_0x29958c+_0x2c3e56(0xb4)+_0x4c435d[_0x2c3e56(0xcd)]+'\x27'),console['error']('\x20\x20'+_0x2c2ee9),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a30_0x11f642(0x18f);[a30_0x11f642(0x10e)]=a30_0x11f642(0x162);async['execute'](_0x49c1fd){const _0x3b1578=a30_0x11f642,{options:_0x231344,args:_0x4b494b,tdx:_0x5d1e80}=_0x49c1fd,_0x2608d0=_0x231344,_0x14f68c=_0x4b494b[0x0]||_0x231344[_0x3b1578(0x1a0)];if(!_0x14f68c)return showParentSegmentNotSetError(_0x3b1578(0x214)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x3b1578(0x156)+_0x3b1578(0x12c)+_0x3b1578(0xb6)+_0x3b1578(0x139)),0x1;const _0x29a3a1=resolveYamlFile(_0x14f68c);if(!existsSync(_0x29a3a1))return showFileNotFoundError(_0x29a3a1,_0x14f68c),0x1;_0x2608d0[_0x3b1578(0xd2)]&&(console[_0x3b1578(0x166)]('Site:\x20'+_0x2608d0[_0x3b1578(0x1c0)]),console['error'](_0x3b1578(0x116)+_0x29a3a1));let _0x58530d;try{_0x58530d=readFileSync(_0x29a3a1,_0x3b1578(0x195));}catch(_0x3f623f){const _0x1b1b98=_0x3f623f instanceof Error?_0x3f623f[_0x3b1578(0x20d)]:String(_0x3f623f);return console[_0x3b1578(0x166)]('Error\x20reading\x20file:\x20'+_0x1b1b98),0x1;}const _0x3a5f57=createCommandSpinner(a30_0x2ba769['dim']('Validating\x20configuration...'),{'verbose':_0x2608d0[_0x3b1578(0xd2)]});_0x3a5f57['start']();const _0x4761e1={'onProgress':_0x3dd55f=>{_0x3a5f57['text']=formatProgressMessage(_0x3dd55f);}};if(_0x2608d0[_0x3b1578(0x10f)])_0x4761e1[_0x3b1578(0x10f)]=!![];if(_0x2608d0[_0x3b1578(0xae)])_0x4761e1[_0x3b1578(0xae)]=!![];_0x2608d0[_0x3b1578(0xc3)]&&(_0x4761e1[_0x3b1578(0xc3)]=_0x2608d0[_0x3b1578(0xc3)]);_0x2608d0[_0x3b1578(0x1f6)]&&(_0x4761e1[_0x3b1578(0x1f6)]=_0x2608d0[_0x3b1578(0x1f6)]);if(_0x2608d0[_0x3b1578(0xb7)])_0x4761e1['interval']=_0x2608d0['interval'];let _0x14fc61;try{_0x14fc61=await _0x5d1e80[_0x3b1578(0x118)][_0x3b1578(0x1d3)](_0x58530d,_0x4761e1),_0x3a5f57[_0x3b1578(0xa7)]();}catch(_0x5001d3){_0x3a5f57[_0x3b1578(0xa7)]();throw _0x5001d3;}const _0x1c1cc5=_0x2608d0[_0x3b1578(0xb7)]||_0x3b1578(0x21b);return this[_0x3b1578(0x1dc)](_0x14fc61,_0x4761e1,_0x29a3a1,_0x1c1cc5),_0x14fc61[_0x3b1578(0x1c1)]?0x0:0x1;}[a30_0x11f642(0x1dc)](_0x1f79a1,_0x393b06,_0x1779f7,_0xf9e3e3){const _0x50473a=a30_0x11f642;console[_0x50473a(0x166)]('\x0a'+a30_0x2ba769['bold'](_0x50473a(0xb3))+'\x20'+_0x1f79a1[_0x50473a(0xcd)]),console['error']('═'[_0x50473a(0x183)](0x3c)),this[_0x50473a(0x1cb)](_0x1f79a1);if(typeof _0x393b06['attribute']===_0x50473a(0x21a)){this['displayAttributesStats'](_0x1f79a1),this[_0x50473a(0xf7)](_0x1f79a1),this['displayPreviewHints'](_0x1779f7,_0xf9e3e3,_0x50473a(0xc3),_0x393b06[_0x50473a(0xc3)]);return;}if(_0x393b06[_0x50473a(0xc3)]===!![]){this[_0x50473a(0x141)](_0x1f79a1),this['displaySummary'](_0x1f79a1),this[_0x50473a(0x12b)](_0x1779f7,_0xf9e3e3,'attributes');return;}if(typeof _0x393b06['behavior']===_0x50473a(0x21a)){this[_0x50473a(0x1b8)](_0x1f79a1,_0xf9e3e3),this[_0x50473a(0xf7)](_0x1f79a1),this['displayPreviewHints'](_0x1779f7,_0xf9e3e3,_0x50473a(0x1f6),_0x393b06[_0x50473a(0x1f6)]);return;}if(_0x393b06['behavior']===!![]){this['displayBehaviorsStats'](_0x1f79a1,_0xf9e3e3),this[_0x50473a(0xf7)](_0x1f79a1),this[_0x50473a(0x12b)](_0x1779f7,_0xf9e3e3,_0x50473a(0x96));return;}this['displayAttributesStats'](_0x1f79a1),this[_0x50473a(0x1b8)](_0x1f79a1,_0xf9e3e3),this[_0x50473a(0xa5)](_0x1f79a1),this[_0x50473a(0xf7)](_0x1f79a1),this[_0x50473a(0x12b)](_0x1779f7,_0xf9e3e3,_0x50473a(0x1a4));}['displayRealtimeInfo'](_0x28b2d9){displayRealtimeValidation(_0x28b2d9);}[a30_0x11f642(0x12b)](_0x517cfc,_0x3344eb,_0x1285e9,_0x4d811e){const _0x492492=a30_0x11f642;console[_0x492492(0x166)]('\x0a'+a30_0x2ba769[_0x492492(0x151)]('To\x20view\x20sample\x20data:'));const _0x2930cd=_0x3344eb!==_0x492492(0x21b)?_0x492492(0x147)+_0x3344eb:'';if(_0x1285e9===_0x492492(0xc3)&&_0x4d811e)console[_0x492492(0x166)]('\x20\x20'+a30_0x2ba769['dim'](_0x492492(0xc2)+_0x517cfc+_0x492492(0xf6)+_0x4d811e+'\x22'+_0x2930cd));else{if(_0x1285e9===_0x492492(0x1f6)&&_0x4d811e)console[_0x492492(0x166)]('\x20\x20'+a30_0x2ba769['dim'](_0x492492(0xc2)+_0x517cfc+_0x492492(0x207)+_0x4d811e+'\x22'+_0x2930cd));else(_0x1285e9===_0x492492(0x145)||_0x1285e9==='all')&&console[_0x492492(0x166)]('\x20\x20'+a30_0x2ba769[_0x492492(0x151)](_0x492492(0xc2)+_0x517cfc+_0x492492(0x20e)+_0x2930cd));}(_0x1285e9==='behaviors'||_0x1285e9===_0x492492(0x1a4))&&console[_0x492492(0x166)]('\x20\x20'+a30_0x2ba769[_0x492492(0x151)](_0x492492(0xc2)+_0x517cfc+_0x492492(0x212)+_0x2930cd)),_0x1285e9===_0x492492(0x1a4)&&console['error']('\x20\x20'+a30_0x2ba769[_0x492492(0x151)](_0x492492(0xc2)+_0x517cfc+_0x492492(0x1b0)+_0x2930cd));}['displayMasterInfo'](_0x40a45e){const _0xed6c73=a30_0x11f642,{master:_0x9c18d3}=_0x40a45e,_0x48cf9c=_0x9c18d3[_0xed6c73(0x1df)]?a30_0x2ba769['green']('✔'):a30_0x2ba769[_0xed6c73(0x1c2)]('✘');console[_0xed6c73(0x166)]('\x0a'+a30_0x2ba769['dim'](_0xed6c73(0x134))),console['error'](_0x48cf9c+'\x20'+a30_0x2ba769['bold'](_0x9c18d3[_0xed6c73(0xe9)]+'.'+_0x9c18d3[_0xed6c73(0x13a)])),_0x9c18d3[_0xed6c73(0x1df)]?_0x9c18d3[_0xed6c73(0xf3)]!==undefined&&console[_0xed6c73(0x166)]('\x20\x20'+a30_0x2ba769[_0xed6c73(0x151)](_0xed6c73(0x20b))+'\x20'+a30_0x2ba769['cyan'](formatRows(_0x9c18d3[_0xed6c73(0xf3)]))):console['error']('\x20\x20'+a30_0x2ba769['red'](_0xed6c73(0x1b5))+'\x20'+_0x9c18d3[_0xed6c73(0xcb)]);}[a30_0x11f642(0x141)](_0x3c822e){const _0x4d2f0e=a30_0x11f642;if(_0x3c822e[_0x4d2f0e(0x145)][_0x4d2f0e(0x9c)]===0x0)return;console[_0x4d2f0e(0x166)]('\x0a'+a30_0x2ba769[_0x4d2f0e(0x151)](_0x4d2f0e(0x17d)));for(const _0x9043f0 of _0x3c822e[_0x4d2f0e(0x145)]){const _0x4c5b67=_0x9043f0[_0x4d2f0e(0x1df)]?a30_0x2ba769['green']('✔'):a30_0x2ba769['red']('✘');let _0x51a30b='';if(_0x9043f0['schemaValid']&&_0x9043f0[_0x4d2f0e(0x1af)]!==undefined&&_0x9043f0[_0x4d2f0e(0xd8)]!==undefined){const _0x3e21e4=_0x9043f0[_0x4d2f0e(0xd8)]['toFixed'](0x1),_0x9084e9=_0x9043f0[_0x4d2f0e(0xd8)]>=0x50?a30_0x2ba769['green']:_0x9043f0[_0x4d2f0e(0xd8)]>=0x32?a30_0x2ba769[_0x4d2f0e(0x178)]:a30_0x2ba769['red'];_0x51a30b='\x20'+a30_0x2ba769['dim'](_0x4d2f0e(0x1f1))+'\x20'+_0x9084e9(_0x3e21e4+'%')+'\x20('+formatRows(_0x9043f0['matchedCount'])+_0x4d2f0e(0x217);}console['error'](_0x4c5b67+'\x20'+a30_0x2ba769['bold'](_0x9043f0[_0x4d2f0e(0xcd)])+_0x51a30b),console[_0x4d2f0e(0x166)]('\x20\x20'+a30_0x2ba769['dim']('Source:')+'\x20'+a30_0x2ba769[_0x4d2f0e(0x1f0)](_0x9043f0[_0x4d2f0e(0xe9)]+'.'+_0x9043f0[_0x4d2f0e(0x13a)]));const _0x9cb08a=_0x9043f0[_0x4d2f0e(0x14d)]===_0x9043f0[_0x4d2f0e(0xc5)]?a30_0x2ba769[_0x4d2f0e(0x151)](_0x4d2f0e(0x109))+'\x20'+_0x9043f0[_0x4d2f0e(0x14d)]:a30_0x2ba769[_0x4d2f0e(0x151)]('Join:')+'\x20'+_0x9043f0[_0x4d2f0e(0x14d)]+_0x4d2f0e(0xdf)+_0x9043f0[_0x4d2f0e(0xc5)];console['error']('\x20\x20'+_0x9cb08a),console['error']('\x20\x20'+a30_0x2ba769[_0x4d2f0e(0x151)](_0x4d2f0e(0x17e))),this[_0x4d2f0e(0xe3)](_0x9043f0['columns']),!_0x9043f0[_0x4d2f0e(0x1df)]&&console[_0x4d2f0e(0x166)]('\x20\x20'+a30_0x2ba769['red'](_0x4d2f0e(0x1b5))+'\x20'+_0x9043f0[_0x4d2f0e(0xcb)]);}}['displayBehaviorsStats'](_0x36fccb,_0x30ab02){const _0x1a70d9=a30_0x11f642;if(_0x36fccb[_0x1a70d9(0x96)]['length']===0x0)return;console['error']('\x0a'+a30_0x2ba769[_0x1a70d9(0x151)](_0x1a70d9(0x122))+'\x20'+a30_0x2ba769[_0x1a70d9(0x151)]('('+_0x30ab02+')'));for(const _0xa564bd of _0x36fccb['behaviors']){const _0x186813=_0xa564bd[_0x1a70d9(0x1df)]?a30_0x2ba769[_0x1a70d9(0x13b)]('✔'):a30_0x2ba769[_0x1a70d9(0x1c2)]('✘');let _0x268226='';if(_0xa564bd['schemaValid']&&_0xa564bd[_0x1a70d9(0x19f)]!==undefined&&_0xa564bd[_0x1a70d9(0xee)]!==undefined){const _0x1e25d2=_0xa564bd[_0x1a70d9(0x15d)]?.[_0x1a70d9(0x187)](0x1)||'?',_0x1684d5=(_0xa564bd[_0x1a70d9(0x15d)]??0x0)>=0x32?a30_0x2ba769[_0x1a70d9(0x13b)]:(_0xa564bd[_0x1a70d9(0x15d)]??0x0)>=0x14?a30_0x2ba769['yellow']:a30_0x2ba769[_0x1a70d9(0x1c2)];_0x268226='\x20'+a30_0x2ba769[_0x1a70d9(0x151)](_0x1a70d9(0xe7))+'\x20'+_0x1684d5(formatRows(_0xa564bd[_0x1a70d9(0x19f)]))+'\x20('+_0x1e25d2+_0x1a70d9(0x16f)+a30_0x2ba769[_0x1a70d9(0x151)]('Events:')+'\x20'+a30_0x2ba769[_0x1a70d9(0x149)](formatRows(_0xa564bd['totalEvents']));}console['error'](_0x186813+'\x20'+a30_0x2ba769[_0x1a70d9(0x1f0)](_0xa564bd[_0x1a70d9(0xcd)])+_0x268226),console['error']('\x20\x20'+a30_0x2ba769[_0x1a70d9(0x151)]('Source:')+'\x20'+a30_0x2ba769[_0x1a70d9(0x1f0)](_0xa564bd[_0x1a70d9(0xe9)]+'.'+_0xa564bd[_0x1a70d9(0x13a)]));const _0x4ce388=_0xa564bd[_0x1a70d9(0x14d)]===_0xa564bd[_0x1a70d9(0xc5)]?a30_0x2ba769[_0x1a70d9(0x151)](_0x1a70d9(0x109))+'\x20'+_0xa564bd[_0x1a70d9(0x14d)]:a30_0x2ba769[_0x1a70d9(0x151)](_0x1a70d9(0x174))+'\x20'+_0xa564bd[_0x1a70d9(0x14d)]+_0x1a70d9(0xdf)+_0xa564bd[_0x1a70d9(0xc5)];console[_0x1a70d9(0x166)]('\x20\x20'+_0x4ce388),console['error']('\x20\x20'+a30_0x2ba769[_0x1a70d9(0x151)](_0x1a70d9(0x17e))),this['displayColumns'](_0xa564bd[_0x1a70d9(0x16d)]),!_0xa564bd[_0x1a70d9(0x1df)]&&console[_0x1a70d9(0x166)]('\x20\x20'+a30_0x2ba769[_0x1a70d9(0x1c2)](_0x1a70d9(0x1b5))+'\x20'+_0xa564bd[_0x1a70d9(0xcb)]);}}['displayColumns'](_0x1462f8){const _0x511f2c=a30_0x11f642;for(const _0x336e29 of _0x1462f8){_0x336e29[_0x511f2c(0x104)]===_0x336e29[_0x511f2c(0xa0)]||_0x336e29[_0x511f2c(0xa0)]==='*'?console[_0x511f2c(0x166)]('\x20\x20\x20\x20-\x20'+_0x336e29[_0x511f2c(0x104)]):console[_0x511f2c(0x166)]('\x20\x20\x20\x20-\x20'+_0x336e29[_0x511f2c(0x104)]+'\x20'+a30_0x2ba769[_0x511f2c(0x151)]('('+_0x336e29[_0x511f2c(0xa0)]+')'));}}[a30_0x11f642(0xf7)](_0xd2b8d7){const _0x352d88=a30_0x11f642;console[_0x352d88(0x166)]('─'[_0x352d88(0x183)](0x3c));if(_0xd2b8d7['errors']['length']>0x0){console[_0x352d88(0x166)]('\x0a'+a30_0x2ba769['red'](_0x352d88(0x13f)));for(const _0x25cbea of _0xd2b8d7[_0x352d88(0xb9)]){console[_0x352d88(0x166)]('\x20\x20'+a30_0x2ba769['red']('•')+'\x20'+_0x25cbea);}}_0xd2b8d7[_0x352d88(0x1c1)]&&console[_0x352d88(0x166)]('\x0a'+a30_0x2ba769[_0x352d88(0x13b)]('✔')+_0x352d88(0x18e));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0x11f);['description']=a30_0x11f642(0xb0);async['execute'](_0x6edf0f){const _0x4d40b6=a30_0x11f642,{options:_0x380fe8,args:_0x1f9d4f,tdx:_0x248982}=_0x6edf0f,_0x424a13=_0x380fe8,_0x4c55cd=_0x1f9d4f[0x0]||_0x380fe8[_0x4d40b6(0x1a0)];if(!_0x4c55cd)return showParentSegmentNotSetError(_0x4d40b6(0x21c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x4d40b6(0x1a1)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x4d40b6(0x105)+_0x4d40b6(0x1fc)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x424a13[_0x4d40b6(0x10f)]&&!_0x424a13[_0x4d40b6(0xc3)]&&!_0x424a13[_0x4d40b6(0x1f6)]&&!_0x424a13['enriched'])return console[_0x4d40b6(0x166)](a30_0x2ba769[_0x4d40b6(0x1c2)](_0x4d40b6(0xd5))),console[_0x4d40b6(0x166)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console['error'](_0x4d40b6(0x1c8)),console[_0x4d40b6(0x166)](_0x4d40b6(0xb5)),console[_0x4d40b6(0x166)](_0x4d40b6(0x1db)),console[_0x4d40b6(0x166)](_0x4d40b6(0x1a5)),console[_0x4d40b6(0x166)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x175f82=resolveYamlFile(_0x4c55cd);if(!existsSync(_0x175f82))return showFileNotFoundError(_0x175f82,_0x4c55cd),0x1;_0x424a13['verbose']&&(console['error'](_0x4d40b6(0x113)+_0x424a13[_0x4d40b6(0x1c0)]),console[_0x4d40b6(0x166)](_0x4d40b6(0x116)+_0x175f82));let _0x40014a;try{_0x40014a=readFileSync(_0x175f82,_0x4d40b6(0x195));}catch(_0x3ea8a3){const _0x44832f=_0x3ea8a3 instanceof Error?_0x3ea8a3[_0x4d40b6(0x20d)]:String(_0x3ea8a3);return console[_0x4d40b6(0x166)](_0x4d40b6(0x211)+_0x44832f),0x1;}let _0x53951f;try{_0x53951f=parseDef(_0x40014a);}catch(_0x2cdf5f){const _0x2f36cf=_0x2cdf5f instanceof Error?_0x2cdf5f['message']:String(_0x2cdf5f);return console[_0x4d40b6(0x166)](a30_0x2ba769['red'](_0x4d40b6(0x200)+_0x2f36cf)),0x1;}if(_0x424a13['attribute']===!![]||_0x424a13[_0x4d40b6(0xc3)]===''){const _0x65cc49=_0x53951f[_0x4d40b6(0x145)]?.[_0x4d40b6(0x1b3)](_0x23281f=>_0x23281f['name'])||[];if(_0x65cc49[_0x4d40b6(0x9c)]===0x0)console[_0x4d40b6(0x166)](a30_0x2ba769[_0x4d40b6(0x1c2)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x4d40b6(0x166)](a30_0x2ba769[_0x4d40b6(0x1c2)](_0x4d40b6(0x1e7))),console[_0x4d40b6(0x166)]('Available\x20attributes:');for(const _0x131da6 of _0x65cc49){console[_0x4d40b6(0x166)]('\x20\x20'+a30_0x2ba769[_0x4d40b6(0x149)](_0x131da6));}console[_0x4d40b6(0x166)](_0x4d40b6(0x15e)+_0x4c55cd+_0x4d40b6(0xf6)+_0x65cc49[0x0]+'\x22');}return 0x1;}if(_0x424a13['behavior']===!![]||_0x424a13[_0x4d40b6(0x1f6)]===''){const _0x23eed2=_0x53951f['behaviors']?.[_0x4d40b6(0x1b3)](_0x2e3d40=>_0x2e3d40[_0x4d40b6(0xcd)])||[];if(_0x23eed2['length']===0x0)console[_0x4d40b6(0x166)](a30_0x2ba769[_0x4d40b6(0x1c2)](_0x4d40b6(0xbf)));else{console['error'](a30_0x2ba769[_0x4d40b6(0x1c2)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x4d40b6(0x166)](_0x4d40b6(0x126));for(const _0x3ea95 of _0x23eed2){console[_0x4d40b6(0x166)]('\x20\x20'+a30_0x2ba769[_0x4d40b6(0x149)](_0x3ea95));}console[_0x4d40b6(0x166)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x4c55cd+_0x4d40b6(0x207)+_0x23eed2[0x0]+'\x22');}return 0x1;}const _0x565e5b=createCommandSpinner(a30_0x2ba769[_0x4d40b6(0x151)](_0x4d40b6(0x11c)),{'verbose':_0x424a13[_0x4d40b6(0xd2)]});_0x565e5b[_0x4d40b6(0xaf)]();const _0x31e64e={'onProgress':_0x552bee=>{const _0x2d9da7=_0x4d40b6;_0x565e5b[_0x2d9da7(0xfb)]=formatProgressMessage(_0x552bee);}};if(_0x424a13[_0x4d40b6(0x10f)])_0x31e64e['master']=!![];if(_0x424a13[_0x4d40b6(0xc3)]&&typeof _0x424a13[_0x4d40b6(0xc3)]===_0x4d40b6(0x21a))_0x31e64e['attribute']=_0x424a13['attribute'];if(_0x424a13[_0x4d40b6(0x1f6)]&&typeof _0x424a13['behavior']===_0x4d40b6(0x21a))_0x31e64e[_0x4d40b6(0x1f6)]=_0x424a13['behavior'];if(_0x424a13[_0x4d40b6(0xae)])_0x31e64e[_0x4d40b6(0xae)]=!![];if(_0x424a13[_0x4d40b6(0xb7)])_0x31e64e[_0x4d40b6(0xb7)]=_0x424a13[_0x4d40b6(0xb7)];let _0xe371e;try{_0xe371e=await _0x248982[_0x4d40b6(0x118)][_0x4d40b6(0x1fd)](_0x40014a,_0x31e64e),_0x565e5b[_0x4d40b6(0xa7)]();}catch(_0x5a9556){_0x565e5b['stop']();throw _0x5a9556;}return await this[_0x4d40b6(0x1f9)](_0xe371e,{'master':_0x424a13[_0x4d40b6(0x10f)],'attribute':typeof _0x424a13[_0x4d40b6(0xc3)]===_0x4d40b6(0x21a)?_0x424a13['attribute']:undefined,'behavior':typeof _0x424a13[_0x4d40b6(0x1f6)]===_0x4d40b6(0x21a)?_0x424a13[_0x4d40b6(0x1f6)]:undefined,'enriched':_0x424a13[_0x4d40b6(0xae)]}),_0xe371e['allValid']?0x0:0x1;}async[a30_0x11f642(0x1f9)](_0x334baf,_0x4a682e){const _0x8665d7=a30_0x11f642;console[_0x8665d7(0x166)]('\x0a'+a30_0x2ba769[_0x8665d7(0x1f0)](_0x8665d7(0x1b6))+'\x20'+_0x334baf[_0x8665d7(0xcd)]),console['error']('═'[_0x8665d7(0x183)](0x3c));if(_0x4a682e[_0x8665d7(0x10f)]&&_0x334baf['sampleData']){const _0x9bbb2e=a30_0x2ba769['dim'](_0x8665d7(0x1f5))+'\x20'+a30_0x2ba769[_0x8665d7(0x1f0)](_0x334baf[_0x8665d7(0x10f)][_0x8665d7(0xe9)]+'.'+_0x334baf[_0x8665d7(0x10f)][_0x8665d7(0x13a)]);await this[_0x8665d7(0x175)](_0x9bbb2e,_0x334baf[_0x8665d7(0x114)]);}else{if(_0x4a682e[_0x8665d7(0xc3)]&&_0x334baf['sampleData']){const _0x2d45f4=a30_0x2ba769[_0x8665d7(0x151)]('Attribute:')+'\x20'+a30_0x2ba769[_0x8665d7(0x1f0)](_0x4a682e['attribute']);await this['displaySampleData'](_0x2d45f4,_0x334baf[_0x8665d7(0x114)]);}else{if(_0x4a682e['behavior']&&_0x334baf[_0x8665d7(0x114)]){const _0x6927e5=a30_0x2ba769[_0x8665d7(0x151)]('Behavior:')+'\x20'+a30_0x2ba769['bold'](_0x4a682e['behavior']);await this[_0x8665d7(0x175)](_0x6927e5,_0x334baf[_0x8665d7(0x114)]);}else{if(_0x4a682e[_0x8665d7(0xae)]&&_0x334baf['sampleData']){const _0x90c779=a30_0x2ba769[_0x8665d7(0x151)](_0x8665d7(0x10a))+'\x20'+a30_0x2ba769['bold'](_0x8665d7(0x106));await this['displaySampleData'](_0x90c779,_0x334baf[_0x8665d7(0x114)]);}else!_0x334baf[_0x8665d7(0x114)]&&console[_0x8665d7(0x166)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x334baf[_0x8665d7(0xb9)][_0x8665d7(0x9c)]>0x0){console[_0x8665d7(0x166)]('─'['repeat'](0x3c)),console['error']('\x0a'+a30_0x2ba769['red'](_0x8665d7(0x13f)));for(const _0x55a0a9 of _0x334baf[_0x8665d7(0xb9)]){console[_0x8665d7(0x166)]('\x20\x20'+a30_0x2ba769[_0x8665d7(0x1c2)]('•')+'\x20'+_0x55a0a9);}}}async['displaySampleData'](_0xc53c49,_0x11c808){const _0x391097=a30_0x11f642;if(_0x11c808[_0x391097(0x9c)]===0x0){console[_0x391097(0x166)]('\x0a'+_0xc53c49),console[_0x391097(0x166)](_0x391097(0xfc));return;}console['error']('\x0a'+_0xc53c49);const _0x237807=Object[_0x391097(0x169)](_0x11c808[0x0])[_0x391097(0x1b3)](_0x363a2a=>({'name':_0x363a2a,'type':typeof _0x11c808[0x0][_0x363a2a]===_0x391097(0xc4)?_0x391097(0xa8):_0x391097(0x1be)})),_0x324fba={'queryId':_0x391097(0x1f8),'columns':_0x237807,'data':_0x11c808,'stats':{'state':_0x391097(0xed),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x11c808[_0x391097(0x9c)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x456f69=formatAsTable(_0x324fba,_0x11c808[_0x391097(0x9c)],!![]);await writeOutput(_0x456f69,undefined,_0x391097(0x13a));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0xff);['description']='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async['execute'](_0x25a055){const _0x3b8444=a30_0x11f642,{options:_0x927ef5,args:_0x2152dd,tdx:_0x4d1c3a}=_0x25a055,_0x29a729=_0x927ef5,_0x480556=_0x2152dd[0x0]||_0x927ef5[_0x3b8444(0x1a0)];if(!_0x480556)return showParentSegmentNotSetError(_0x3b8444(0x102)+_0x3b8444(0xd1)),0x1;const _0x42c5ab=resolveYamlFile(_0x480556);if(existsSync(_0x42c5ab)){_0x29a729[_0x3b8444(0xd2)]&&console[_0x3b8444(0x166)]('Found\x20YAML\x20file:\x20'+_0x42c5ab);let _0x3051f6;try{_0x3051f6=readFileSync(_0x42c5ab,'utf-8');}catch(_0x303b6d){const _0x163b3e=_0x303b6d instanceof Error?_0x303b6d['message']:String(_0x303b6d);return console['error'](_0x3b8444(0x211)+_0x163b3e),0x1;}const _0x2bd42a=await withSpinner(_0x3b8444(0x176),()=>_0x4d1c3a['segment'][_0x3b8444(0x10c)](_0x3051f6),{'verbose':_0x29a729[_0x3b8444(0xd2)]}),_0x1d89f3=_0x2bd42a[_0x3b8444(0x1ec)],{isNew:_0x13f95a,name:_0xf02234,hasChanges:_0x1d4c3f,diffFormatted:_0x483166}=_0x1d89f3;if(_0x1d4c3f){_0x13f95a?console[_0x3b8444(0x166)](_0x3b8444(0x9f)+_0xf02234+'\x27:'):console['error'](_0x3b8444(0x17b)+_0xf02234+'\x27:');console[_0x3b8444(0x166)]('─'[_0x3b8444(0x183)](0x3c)),console[_0x3b8444(0x166)](_0x483166),console[_0x3b8444(0x166)]('─'['repeat'](0x3c));const _0x5dbdc5=_0x13f95a?_0x3b8444(0xba)+_0xf02234+_0x3b8444(0xc9):_0x3b8444(0xfe)+_0xf02234+'\x27\x20and\x20run\x20workflow?';if(!_0x29a729['yes']){if(!isInteractive())return console[_0x3b8444(0x166)](a30_0x2ba769[_0x3b8444(0x1c2)]('\x0aError:'),_0x3b8444(0x165)),console[_0x3b8444(0x166)](a30_0x2ba769['dim'](_0x3b8444(0x14e))),0x1;const _0x38c6f7=await confirmKey(_0x5dbdc5);if(!_0x38c6f7)return console[_0x3b8444(0x166)](a30_0x2ba769['yellow']('Aborted.')),0x1;}const _0x549af9=_0x13f95a?_0x3b8444(0x197):'Updating';await withSpinner(_0x549af9+'\x20parent\x20segment\x20\x27'+_0xf02234+_0x3b8444(0x1d9),()=>_0x1d89f3['apply'](),{'verbose':_0x29a729[_0x3b8444(0xd2)]});const _0x37dc65=_0x13f95a?'Created':_0x3b8444(0x167);console[_0x3b8444(0x166)]('✔\x20'+_0x37dc65+'\x20parent\x20segment\x20\x27'+_0xf02234+'\x27');}else console['error'](_0x3b8444(0x1cd)+_0xf02234+'\x27\x20is\x20up\x20to\x20date');}const _0x3b7c16=await withSpinner(_0x3b8444(0x12f)+_0x480556+_0x3b8444(0x1d9),()=>_0x4d1c3a[_0x3b8444(0x118)][_0x3b8444(0x144)](_0x480556),{'verbose':_0x29a729[_0x3b8444(0xd2)]}),_0x5dcf37=_0x3b7c16[_0x3b8444(0x1ec)],_0x3cd0b0=getConsoleUrl(_0x29a729[_0x3b8444(0x1c0)],_0x3b8444(0x18a)+_0x5dcf37['workflowId']+_0x3b8444(0x1f2)+_0x5dcf37['workflowSessionId']+_0x3b8444(0xc7)+_0x5dcf37[_0x3b8444(0x124)]);return console[_0x3b8444(0x166)](_0x3b8444(0x1ae)),console[_0x3b8444(0x166)]('\x20\x20'+a30_0x2ba769[_0x3b8444(0x151)](_0x3b8444(0x1d4))+'\x20'+_0x5dcf37['audienceId']),console['error']('\x20\x20'+a30_0x2ba769[_0x3b8444(0x151)](_0x3b8444(0x199))+'\x20'+_0x5dcf37[_0x3b8444(0xca)]),console[_0x3b8444(0x166)]('\x20\x20'+a30_0x2ba769['dim'](_0x3b8444(0xf9))+'\x20'+_0x5dcf37[_0x3b8444(0x11d)]),console[_0x3b8444(0x166)]('\x20\x20'+a30_0x2ba769['dim'](_0x3b8444(0xef))+'\x20'+_0x5dcf37['workflowAttemptId']),console[_0x3b8444(0x166)]('\x20\x20'+_0x3cd0b0),console['error']('\x0a'+a30_0x2ba769['dim'](_0x3b8444(0x19c))+_0x3b8444(0x1f3)+_0x5dcf37['workflowAttemptId']+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a30_0x11f642(0xcd)]='segment:parent:fields';['description']=a30_0x11f642(0xde);async['execute'](_0x5cccd7){const _0x5469=a30_0x11f642,{options:_0xf26e14,args:_0x571d36,tdx:_0x256ef9}=_0x5cccd7,_0x4e7236=_0x571d36[0x0]||_0xf26e14['parentSegment'];if(!_0x4e7236)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'+_0x5469(0x1e6)),0x1;_0xf26e14[_0x5469(0xd2)]&&(console[_0x5469(0x166)]('Site:\x20'+_0xf26e14[_0x5469(0x1c0)]),console[_0x5469(0x166)](_0x5469(0x152)+_0x4e7236));const _0x678bf1=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x4e7236+_0x5469(0x1d9),()=>_0x256ef9[_0x5469(0x118)]['listFields'](_0x4e7236),{'verbose':_0xf26e14['verbose']}),_0x2597b1=_0x678bf1[_0x5469(0x1ec)];console[_0x5469(0x166)]('✔\x20Found\x20'+_0x2597b1[_0x5469(0x9c)]+_0x5469(0x1b1)+(_0x2597b1[_0x5469(0x9c)]!==0x1?'s':''));if(_0xf26e14['json']||_0xf26e14[_0x5469(0x1bb)])return await handleSDKOutput(_0x2597b1,_0xf26e14),0x0;return displayFieldsHumanReadable(_0x2597b1,_0x4e7236),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0x15c);[a30_0x11f642(0x10e)]=a30_0x11f642(0xfa);async['execute'](_0x4aec9c){const _0x1be39f=a30_0x11f642,{options:_0x5566aa,args:_0x32a199,tdx:_0x37c857}=_0x4aec9c,_0x5a3c5f=_0x5566aa,_0x1c9308=_0x32a199[0x0]||_0x5566aa[_0x1be39f(0x1a0)];if(!_0x1c9308)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'+_0x1be39f(0x190)+_0x1be39f(0x156)+_0x1be39f(0x1cc)),0x1;_0x5566aa['verbose']&&(console['error'](_0x1be39f(0x113)+_0x5566aa[_0x1be39f(0x1c0)]),console[_0x1be39f(0x166)](_0x1be39f(0x152)+_0x1c9308));const _0x2acc77=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x1c9308+_0x1be39f(0x1d9),()=>_0x37c857[_0x1be39f(0x118)][_0x1be39f(0x159)](_0x1c9308),{'verbose':_0x5566aa[_0x1be39f(0xd2)]}),_0x48d0fa=_0x2acc77[_0x1be39f(0x1ec)];if(_0x5a3c5f[_0x1be39f(0x13c)]){const _0x46bb6f=getConsoleNextUrl(_0x5a3c5f[_0x1be39f(0x1c0)],'/app/dw/parentSegments/'+_0x48d0fa['id']);return console['error'](a30_0x2ba769[_0x1be39f(0x13b)]('✔')+_0x1be39f(0x15a)+a30_0x2ba769['cyan'](_0x46bb6f)),openBrowser(_0x46bb6f),0x0;}return await handleSingleObjectOutput(_0x48d0fa,_0x5566aa),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0xbe);[a30_0x11f642(0x10e)]=a30_0x11f642(0x100);async['execute'](_0x47f7bf){const _0x38a81f=a30_0x11f642,{options:_0x2edaf1,args:_0x5d13be,tdx:_0x537334}=_0x47f7bf,_0x5d1367=_0x2edaf1,_0x8b0243=_0x5d13be[0x0]||_0x2edaf1[_0x38a81f(0x1a0)];if(!_0x8b0243)return showParentSegmentNotSetError(_0x38a81f(0xf2)+'\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'+_0x38a81f(0x156)+_0x38a81f(0x14a)),0x1;_0x2edaf1[_0x38a81f(0xd2)]&&(console[_0x38a81f(0x166)](_0x38a81f(0x113)+_0x2edaf1[_0x38a81f(0x1c0)]),console[_0x38a81f(0x166)]('Parent\x20segment:\x20'+_0x8b0243));const _0x630391=await withSpinner(_0x38a81f(0x1ea)+_0x8b0243+_0x38a81f(0x1d9),()=>_0x537334[_0x38a81f(0x118)][_0x38a81f(0x1c3)](_0x8b0243),{'verbose':_0x2edaf1['verbose']}),_0x57d37d=_0x630391['data'],_0x222904=_0x537334[_0x38a81f(0x118)][_0x38a81f(0x1de)](_0x57d37d);if(_0x5d1367[_0x38a81f(0x1d5)]){const _0x3bdefc=await this['collectSchema'](_0x47f7bf,_0x8b0243,_0x57d37d,_0x222904),_0x516f5c=this[_0x38a81f(0xf4)](_0x3bdefc);writeFileSync(_0x5d1367[_0x38a81f(0x1d5)],_0x516f5c);const _0x3b7e11=_0x3bdefc[_0x38a81f(0x99)][_0x38a81f(0x16d)][_0x38a81f(0x9c)]+_0x3bdefc[_0x38a81f(0x96)][_0x38a81f(0x119)]((_0x1fca9d,_0x191873)=>_0x1fca9d+_0x191873[_0x38a81f(0x16d)]['length'],0x0),_0x10e8b6=_0x3bdefc[_0x38a81f(0x96)][_0x38a81f(0x19d)](_0x45a76c=>_0x45a76c[_0x38a81f(0x16d)][_0x38a81f(0x9c)]===0x0)[_0x38a81f(0x9c)];return console[_0x38a81f(0x1e1)](_0x38a81f(0x1ab)+_0x5d1367[_0x38a81f(0x1d5)]),console[_0x38a81f(0x1e1)](_0x38a81f(0x12a)+_0x222904),console[_0x38a81f(0x1e1)](_0x38a81f(0x1e0)+_0x3bdefc[_0x38a81f(0x96)][_0x38a81f(0x9c)]+'\x20behaviors'),console[_0x38a81f(0x1e1)]('\x20\x20Columns:\x20'+_0x3b7e11+'\x20total'),_0x10e8b6>0x0&&console[_0x38a81f(0x1e1)](_0x38a81f(0x1bc)+_0x10e8b6+_0x38a81f(0x1ee)),0x0;}console[_0x38a81f(0x166)]('\x0a'+a30_0x2ba769[_0x38a81f(0x1f0)](_0x38a81f(0xf5))+'\x20'+a30_0x2ba769[_0x38a81f(0x149)](_0x222904));const _0x4fe848=await withSpinner(_0x38a81f(0x12e),()=>_0x537334[_0x38a81f(0x118)]['getParentSQL'](_0x57d37d),{'verbose':_0x2edaf1[_0x38a81f(0xd2)]});console['error']('\x0a'+a30_0x2ba769[_0x38a81f(0x1f0)](_0x38a81f(0x99))+'\x20'+a30_0x2ba769['dim']('('+_0x222904+'.customers)'));const _0x58cc5c=await executeSchemaQuery(_0x4fe848[_0x38a81f(0x1ec)],_0x537334,_0x2edaf1);await handleQueryOutput(_0x58cc5c,_0x2edaf1);const _0x182620=await withSpinner(_0x38a81f(0x179),()=>_0x537334[_0x38a81f(0x118)]['getBehaviorNames'](_0x57d37d),{'verbose':_0x2edaf1[_0x38a81f(0xd2)]});for(const _0x2a898f of _0x182620['data']){const _0x34a0e5=_0x38a81f(0x20a)+_0x2a898f[_0x38a81f(0x177)]()[_0x38a81f(0xea)](/\s+/g,'_'),_0x23cb27=_0x38a81f(0x155)+_0x222904+'.'+_0x34a0e5;console[_0x38a81f(0x166)]('\x0a'+a30_0x2ba769[_0x38a81f(0x1f0)](_0x2a898f)+'\x20'+a30_0x2ba769[_0x38a81f(0x151)]('('+_0x222904+'.'+_0x34a0e5+')'));try{const _0x27ac64=await executeSchemaQuery(_0x23cb27,_0x537334,_0x2edaf1);await handleQueryOutput(_0x27ac64,_0x2edaf1);}catch{console[_0x38a81f(0x166)](a30_0x2ba769['yellow'](_0x38a81f(0x206)));}}return 0x0;}async['collectSchema'](_0x2ff120,_0x2aa262,_0x3f2e10,_0x1b258a){const _0x5de248=a30_0x11f642,{options:_0x5c4d8c,tdx:_0x599d94}=_0x2ff120,_0x477c33=await withSpinner(_0x5de248(0x12e),()=>_0x599d94[_0x5de248(0x118)]['getParentSQL'](_0x3f2e10),{'verbose':_0x5c4d8c[_0x5de248(0xd2)]}),_0x465303=await executeSchemaQuery(_0x477c33[_0x5de248(0x1ec)],_0x599d94,_0x5c4d8c),_0x12280a=_0x465303[_0x5de248(0x1ec)]['map'](_0x3aa855=>({'name':_0x3aa855[_0x5de248(0x143)],'type':_0x3aa855[_0x5de248(0x1ca)]})),_0x5b5d42=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x599d94[_0x5de248(0x118)][_0x5de248(0xdc)](_0x3f2e10),{'verbose':_0x5c4d8c[_0x5de248(0xd2)]}),_0x52825f=[];for(const _0x41ad92 of _0x5b5d42[_0x5de248(0x1ec)]){const _0x566f4e=_0x5de248(0x20a)+_0x41ad92[_0x5de248(0x177)]()[_0x5de248(0xea)](/\s+/g,'_'),_0x33424d='SELECT\x20*\x20FROM\x20'+_0x1b258a+'.'+_0x566f4e;let _0x5b6d7a=[];try{const _0x5594ee=await executeSchemaQuery(_0x33424d,_0x599d94,_0x5c4d8c);_0x5b6d7a=_0x5594ee[_0x5de248(0x1ec)]['map'](_0xe8856a=>({'name':_0xe8856a[_0x5de248(0x143)],'type':_0xe8856a['column_type']}));}catch{}_0x52825f[_0x5de248(0xb8)]({'table':_0x566f4e,'columns':_0x5b6d7a});}return{'database':_0x1b258a,'parent_segment':_0x2aa262,'parent_id':_0x3f2e10,'customers':{'table':_0x5de248(0x99),'columns':_0x12280a},'behaviors':_0x52825f};}[a30_0x11f642(0xf4)](_0x3b2bdf){const _0x7ead30=a30_0x11f642,_0x3775f7=_0x359027=>{const _0x541bde=a30_0x9f58;if(_0x359027['length']===0x0)return'[]';const _0x3f3e13=_0x359027[_0x541bde(0x1b3)](_0x3fd1e0=>_0x541bde(0x14f)+_0x3fd1e0[_0x541bde(0xcd)]+_0x541bde(0xe0)+_0x3fd1e0['type']+_0x541bde(0x1da));return'[\x0a'+_0x3f3e13[_0x541bde(0x1d1)](',\x0a')+_0x541bde(0x1b7);},_0x3df800=_0x3b2bdf[_0x7ead30(0x96)][_0x7ead30(0x1b3)](_0x34c064=>{const _0x43e76c=_0x7ead30;return _0x43e76c(0x192)+_0x34c064['table']+_0x43e76c(0x186)+_0x3775f7(_0x34c064[_0x43e76c(0x16d)])[_0x43e76c(0xea)](/^/gm,'\x20\x20')['trim']()+_0x43e76c(0x127);})[_0x7ead30(0x1d1)](',\x0a');return _0x7ead30(0xf8)+_0x3b2bdf[_0x7ead30(0xe9)]+_0x7ead30(0x208)+_0x3b2bdf[_0x7ead30(0x1e9)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x3b2bdf[_0x7ead30(0x210)]+_0x7ead30(0xe8)+_0x3b2bdf[_0x7ead30(0x99)][_0x7ead30(0x13a)]+_0x7ead30(0x157)+_0x3775f7(_0x3b2bdf['customers']['columns'])['replace'](/^/gm,'\x20\x20')[_0x7ead30(0x17a)]()+_0x7ead30(0xd0)+_0x3df800+_0x7ead30(0x1e5);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a30_0x11f642(0x132);[a30_0x11f642(0x10e)]=a30_0x11f642(0x205);async['execute'](_0x5b011e){const _0x45e855=a30_0x11f642,{options:_0x1ec911,args:_0x16e1d6,tdx:_0x44fd43}=_0x5b011e,_0x42b006=_0x16e1d6[0x0]||_0x1ec911[_0x45e855(0x1a0)];if(!_0x42b006)return showParentSegmentNotSetError(_0x45e855(0x194)+_0x45e855(0x1a6)),0x1;_0x1ec911['verbose']&&(console[_0x45e855(0x166)](_0x45e855(0x113)+_0x1ec911[_0x45e855(0x1c0)]),console[_0x45e855(0x166)](_0x45e855(0x152)+_0x42b006));const _0x1c63e6=await withSpinner(_0x45e855(0x1ea)+_0x42b006+_0x45e855(0x1d9),()=>_0x44fd43['segment'][_0x45e855(0x1c3)](_0x42b006),{'verbose':_0x1ec911[_0x45e855(0xd2)]}),_0x4178e0=_0x1c63e6['data'],_0x547c2c=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x42b006+_0x45e855(0x1d9),()=>_0x44fd43[_0x45e855(0x118)][_0x45e855(0x1fe)](_0x4178e0),{'verbose':_0x1ec911['verbose']}),_0x2a5639=_0x547c2c[_0x45e855(0x1ec)];return _0x1ec911[_0x45e855(0x142)]===_0x45e855(0x1fa)||_0x1ec911['format']===_0x45e855(0x1bb)?await handleSDKOutput([{'sql':_0x2a5639}],_0x1ec911):console[_0x45e855(0x1e1)](_0x2a5639),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0x128);['description']=a30_0x11f642(0x98);async[a30_0x11f642(0x12d)](_0x5a8d59){const _0x28b5a2=a30_0x11f642,{options:_0x3b89eb,args:_0x129beb,tdx:_0x2d0aff}=_0x5a8d59,_0x4a18ed=_0x129beb[0x0]||_0x3b89eb['parentSegment'];if(!_0x4a18ed)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'+_0x28b5a2(0x14b)),0x1;_0x3b89eb[_0x28b5a2(0xd2)]&&(console[_0x28b5a2(0x166)](_0x28b5a2(0x113)+_0x3b89eb[_0x28b5a2(0x1c0)]),console['error'](_0x28b5a2(0x152)+_0x4a18ed));const _0x3b052d=await withSpinner(_0x28b5a2(0x1ea)+_0x4a18ed+_0x28b5a2(0x1d9),()=>_0x2d0aff[_0x28b5a2(0x118)][_0x28b5a2(0x1c3)](_0x4a18ed),{'verbose':_0x3b89eb[_0x28b5a2(0xd2)]}),_0x50eb5c=_0x3b052d[_0x28b5a2(0x1ec)],_0x3680be=await withSpinner(_0x28b5a2(0xb2)+_0x4a18ed+'\x27...',()=>_0x2d0aff[_0x28b5a2(0x118)]['getParentSQL'](_0x50eb5c),{'verbose':_0x3b89eb[_0x28b5a2(0xd2)]});let _0x2eb24b=_0x3680be[_0x28b5a2(0x1ec)];const _0x14a163=resolveLimit(_0x3b89eb['limit'],DEFAULT_DISPLAY_LIMIT),_0x27670f=/\bLIMIT\s+\d+/i[_0x28b5a2(0x221)](_0x2eb24b);!_0x27670f&&(_0x2eb24b=_0x2eb24b[_0x28b5a2(0x17a)]()[_0x28b5a2(0xea)](/;+$/,''),_0x2eb24b=_0x28b5a2(0x150)+_0x2eb24b+_0x28b5a2(0x1ac)+_0x14a163);_0x3b89eb['verbose']&&console['error'](_0x28b5a2(0x1b2)+_0x2eb24b);const _0x1fe5e2=await withProgressSpinner(_0x28b5a2(0x1ef),async _0x2efaaa=>{const _0x5d9d23=_0x28b5a2,_0x35b0dd=await _0x2d0aff[_0x5d9d23(0x1e2)][_0x5d9d23(0x12d)](_0x2eb24b,{'catalog':'td','schema':'information_schema','onJobId':_0x5372fc=>{const _0x39a680=_0x5d9d23;_0x2efaaa[_0x39a680(0xab)](_0x5372fc);}});return _0x35b0dd;},{'verbose':_0x3b89eb[_0x28b5a2(0xd2)]}),_0x1602ec=_0x1fe5e2[_0x28b5a2(0x1ec)],_0x441c86=_0x1602ec[_0x28b5a2(0x215)]?_0x28b5a2(0x1aa)+_0x1602ec[_0x28b5a2(0x215)]+']':'';return console[_0x28b5a2(0x166)](_0x28b5a2(0x1f4)+_0x1602ec['stats']['processedRows']['toLocaleString']()+_0x28b5a2(0x95)+('in\x20'+formatElapsed(_0x1602ec[_0x28b5a2(0xce)][_0x28b5a2(0x1a9)])+_0x441c86)),await handleQueryOutput(_0x1602ec,_0x3b89eb),0x0;}}export class PSRtListCommand extends BaseCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0xb1);[a30_0x11f642(0x10e)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a30_0x11f642(0x12d)](_0x356176){const _0x17272b=a30_0x11f642,{options:_0x24de81,args:_0x5f30e5,tdx:_0x87c84d}=_0x356176,_0x22ad7e=_0x5f30e5[0x0],_0x10f4ee=await withSpinner(_0x22ad7e?_0x17272b(0xa2)+_0x22ad7e+'\x27...':_0x17272b(0xad),()=>_0x87c84d[_0x17272b(0x1ad)]['list'](),{'verbose':_0x24de81[_0x17272b(0xd2)]});let _0x17ea3d=_0x10f4ee['data'][_0x17272b(0x19d)](_0x31ec80=>_0x31ec80[_0x17272b(0x203)]);if(_0x22ad7e){const _0x3ed294=_0x22ad7e[_0x17272b(0xea)](/[.+^${}()|[\]\\]/g,_0x17272b(0x11b))[_0x17272b(0xea)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x30cdcd=new RegExp('^'+_0x3ed294+'$','i');_0x17ea3d=_0x17ea3d[_0x17272b(0x19d)](_0x16e08f=>_0x30cdcd['test'](_0x16e08f['name']));}_0x17ea3d[_0x17272b(0xcf)]((_0x21a06e,_0x3f3349)=>_0x21a06e[_0x17272b(0xcd)][_0x17272b(0x130)](_0x3f3349['name'])),console['error'](_0x17272b(0x111)+_0x17ea3d[_0x17272b(0x9c)]+_0x17272b(0x1ba)+(_0x17ea3d[_0x17272b(0x9c)]!==0x1?'s':''));const _0x114bad=_0x1286c0=>{const _0x1e6bff=_0x17272b;return getConsoleNextUrl(_0x24de81[_0x1e6bff(0x1c0)],_0x1e6bff(0x129)+_0x1286c0);};if(_0x24de81[_0x17272b(0x142)]===_0x17272b(0x1fa)||_0x24de81[_0x17272b(0x142)]===_0x17272b(0x1bb)){const _0x1ce4a3=_0x17ea3d[_0x17272b(0x1b3)](_0x56f5b8=>({..._0x56f5b8,'url':_0x114bad(_0x56f5b8['id'])}));await handleSDKOutput(_0x1ce4a3,_0x24de81);}else{if(_0x17ea3d[_0x17272b(0x9c)]===0x0)console[_0x17272b(0x1e1)](_0x17272b(0xec));else for(const _0x32019d of _0x17ea3d){const _0x557bb8=_0x32019d['population']?a30_0x2ba769[_0x17272b(0x151)]('\x20('+formatRows(_0x32019d[_0x17272b(0xe4)])+')'):'',_0x524a53=hyperlink(_0x32019d[_0x17272b(0xcd)],_0x114bad(_0x32019d['id']));console[_0x17272b(0x1e1)]('⚡\x20'+_0x524a53+_0x557bb8);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0x158);[a30_0x11f642(0x10e)]=a30_0x11f642(0xe6);async[a30_0x11f642(0x12d)](_0x24626a){const _0x3d2812=a30_0x11f642,{options:_0x2fdf3c,args:_0x20f6c0,tdx:_0x51e17a}=_0x24626a,_0x1bc03c=_0x20f6c0[0x0]||_0x2fdf3c[_0x3d2812(0x1a0)];if(!_0x1bc03c)return showParentSegmentNotSetError(_0x3d2812(0x1d2)+'\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'),0x1;const _0x47d4f7=resolveYamlFile(_0x1bc03c);if(!existsSync(_0x47d4f7))return showFileNotFoundError(_0x47d4f7,_0x1bc03c),0x1;let _0x4cf026;try{_0x4cf026=readFileSync(_0x47d4f7,_0x3d2812(0x195));}catch(_0x40b8b6){const _0x559a5e=_0x40b8b6 instanceof Error?_0x40b8b6['message']:String(_0x40b8b6);return console[_0x3d2812(0x166)]('Error\x20reading\x20file:\x20'+_0x559a5e),0x1;}const _0x43eb08=createCommandSpinner(a30_0x2ba769[_0x3d2812(0x151)](_0x3d2812(0x1f7)),{'verbose':_0x2fdf3c['verbose']});_0x43eb08[_0x3d2812(0xaf)]();const _0x19a519={'realtime':!![],'onProgress':_0x148e2d=>{const _0x3ef192=_0x3d2812;_0x43eb08[_0x3ef192(0xfb)]=formatProgressMessage(_0x148e2d);}};let _0x1af152;try{_0x1af152=await _0x51e17a[_0x3d2812(0x118)][_0x3d2812(0x1d3)](_0x4cf026,_0x19a519),_0x43eb08[_0x3d2812(0xa7)]();}catch(_0x86f174){_0x43eb08['stop']();throw _0x86f174;}console[_0x3d2812(0x166)]('\x0a'+a30_0x2ba769[_0x3d2812(0x1f0)](_0x3d2812(0x133))+'\x20'+_0x1af152[_0x3d2812(0xcd)]),console['error']('═'['repeat'](0x3c)),displayRealtimeValidation(_0x1af152),console[_0x3d2812(0x166)]('─'[_0x3d2812(0x183)](0x3c));if(_0x1af152['errors']['length']>0x0){console[_0x3d2812(0x166)]('\x0a'+a30_0x2ba769[_0x3d2812(0x1c2)]('Errors:'));for(const _0x590872 of _0x1af152[_0x3d2812(0xb9)]){console[_0x3d2812(0x166)]('\x20\x20'+a30_0x2ba769['red']('•')+'\x20'+_0x590872);}}return _0x1af152['allValid']&&console[_0x3d2812(0x166)]('\x0a'+a30_0x2ba769['green']('✔')+_0x3d2812(0x137)),_0x1af152[_0x3d2812(0x1c1)]?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{[a30_0x11f642(0xcd)]=a30_0x11f642(0x1e4);['description']='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async['execute'](_0x130791){const _0x3f9aa0=a30_0x11f642,{options:_0x24a470,args:_0xcb5bc0,tdx:_0x444d3a}=_0x130791,_0x163141=_0xcb5bc0[0x0]||_0x24a470[_0x3f9aa0(0x1a0)];if(!_0x163141)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+_0x3f9aa0(0x1eb)),0x1;const _0x284216=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x163141+_0x3f9aa0(0x1d9),()=>_0x444d3a['segment'][_0x3f9aa0(0x1c3)](_0x163141),{'verbose':_0x24a470['verbose']}),_0x20873f=_0x284216[_0x3f9aa0(0x1ec)],_0x285ffc=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x163141+'\x27...',()=>_0x444d3a['personalization']['list'](_0x20873f),{'verbose':_0x24a470['verbose']}),_0x3a80a3=_0x285ffc[_0x3f9aa0(0x1ec)];console[_0x3f9aa0(0x166)](_0x3f9aa0(0x111)+_0x3a80a3[_0x3f9aa0(0x9c)]+'\x20personalization\x20service'+(_0x3a80a3[_0x3f9aa0(0x9c)]!==0x1?'s':''));if(_0x24a470[_0x3f9aa0(0x142)]===_0x3f9aa0(0x1fa)||_0x24a470['format']===_0x3f9aa0(0x1bb))await handleSDKOutput(_0x3a80a3,_0x24a470);else{if(_0x3a80a3['length']===0x0)console[_0x3f9aa0(0x1e1)](_0x3f9aa0(0x153)),console[_0x3f9aa0(0x166)](a30_0x2ba769[_0x3f9aa0(0x149)](_0x3f9aa0(0x20f)));else for(const _0x1db032 of _0x3a80a3){const _0x5caf8e=_0x1db032[_0x3f9aa0(0x107)]?.['length']||0x0,_0x3dfae4=_0x1db032[_0x3f9aa0(0x93)]?a30_0x2ba769[_0x3f9aa0(0x151)](_0x3f9aa0(0x1d8)+_0x1db032['trigger_event']):'',_0x37c041=a30_0x2ba769[_0x3f9aa0(0x151)]('\x20('+_0x5caf8e+_0x3f9aa0(0x9d)+(_0x5caf8e!==0x1?'s':'')+')');console['log']('\x20\x20'+_0x1db032[_0x3f9aa0(0xcd)]+_0x3dfae4+_0x37c041),_0x1db032['description']&&console[_0x3f9aa0(0x1e1)](_0x3f9aa0(0x216)+a30_0x2ba769[_0x3f9aa0(0x151)](_0x1db032[_0x3f9aa0(0x10e)]));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a30_0x11f642(0x16a);[a30_0x11f642(0x10e)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a30_0x11f642(0x12d)](_0x1bcf45){const _0x11366c=a30_0x11f642,{options:_0x375706,args:_0x42cbb7}=_0x1bcf45,_0x2782c8=_0x42cbb7[0x0]||_0x375706[_0x11366c(0x1a0)];if(!_0x2782c8)return showParentSegmentNotSetError(_0x11366c(0x193)+_0x11366c(0x172)),0x1;const _0x43b98b=resolveYamlFile(_0x2782c8);if(!existsSync(_0x43b98b))return showFileNotFoundError(_0x43b98b,_0x2782c8),0x1;let _0x2f98ca;try{_0x2f98ca=readFileSync(_0x43b98b,_0x11366c(0x195));}catch(_0x44cd73){const _0x518257=_0x44cd73 instanceof Error?_0x44cd73[_0x11366c(0x20d)]:String(_0x44cd73);return console['error'](_0x11366c(0x211)+_0x518257),0x1;}let _0x27a4cd;try{_0x27a4cd=parseDef(_0x2f98ca);}catch(_0x103356){const _0x343b5c=_0x103356 instanceof Error?_0x103356[_0x11366c(0x20d)]:String(_0x103356);return console[_0x11366c(0x166)](a30_0x2ba769[_0x11366c(0x1c2)](_0x11366c(0x200)+_0x343b5c)),0x1;}if(_0x27a4cd[_0x11366c(0xbc)]&&_0x27a4cd[_0x11366c(0xbc)][_0x11366c(0x9c)]>0x0)return console[_0x11366c(0x166)](a30_0x2ba769[_0x11366c(0x178)](_0x11366c(0x9e)+_0x43b98b)),console[_0x11366c(0x166)](a30_0x2ba769['dim'](_0x11366c(0x16b)+_0x27a4cd['personalization_services'][_0x11366c(0x9c)]+_0x11366c(0x198))),0x1;!_0x27a4cd['realtime']&&(_0x27a4cd[_0x11366c(0x1ad)]={'events':[{'name':_0x11366c(0x16e),'source_table':_0x11366c(0x13e)}],'attributes':[{'name':_0x11366c(0x188),'type':_0x11366c(0x19e)}],'id_stitching':{'primary_key':_0x27a4cd['master']['table']===_0x11366c(0x99)?_0x11366c(0x108):'user_id'}});_0x27a4cd[_0x11366c(0xbc)]=[{'name':_0x11366c(0x110),'description':_0x11366c(0xaa),'trigger_event':_0x11366c(0x16e),'sections':[{'name':_0x11366c(0x1a8),'criteria':_0x11366c(0x125),'attributes':[_0x11366c(0x188)]}]}];const _0x28412a=serializeDef(_0x27a4cd);return writeFileSync(_0x43b98b,_0x28412a,_0x11366c(0x195)),console[_0x11366c(0x166)](a30_0x2ba769['green']('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a30_0x2ba769[_0x11366c(0x149)](_0x43b98b)),(!_0x27a4cd[_0x11366c(0x1ad)]||_0x2f98ca[_0x11366c(0xa4)](_0x11366c(0xa9))===-0x1)&&console[_0x11366c(0x166)](a30_0x2ba769[_0x11366c(0x13b)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x11366c(0x166)]('\x0a'+a30_0x2ba769[_0x11366c(0x151)](_0x11366c(0x1c9))),console[_0x11366c(0x166)](_0x11366c(0x11e)+_0x43b98b+_0x11366c(0x148)),console[_0x11366c(0x166)]('\x20\x202.\x20Run\x20'+a30_0x2ba769['dim'](_0x11366c(0x1c7)+_0x2782c8)+_0x11366c(0x10d)),0x0;}}
|
|
1
|
+
const a30_0x41ba90=a30_0x49a8;function a30_0x2fc6(){const _0x4ec9ad=['realtime_enabled','segment','displayMasterInfo','createParent','Pattern:\x20','ps:pz:show','Error:\x20Token\x20name\x20is\x20required','Personalization:','displaySampleData','listJourneys','To\x20view\x20sample\x20data:','\x20rows\x20','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','ps:pz:service:show','\x20\x20Note:\x20','142986LfMcfq','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','utf-8','previewParentYaml','folderId','tokens','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','displayPreviewResults','\x20to\x20push\x20the\x20configuration','segment:parent:sql','No\x20parent\x20segments\x20found','addBehaviorsFile','sort','stop','repeat','✔\x20Deleted\x20token\x20\x27','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','isDirectory','matchedCount','number','validateParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','✔\x20Found\x20','Rows:','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','tdx\x20ps\x20preview\x20','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','toFixed','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','attributesFile','\x27\x20for\x20service\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','\x20total','No\x20personalization\x20services\x20configured','create','getParentFull','displayAttributesStats','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','site','runParent','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Audience\x20ID:','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','public','realtime','Error:\x20Parent\x20segment\x20name\x20is\x20required','tdx\x20ps\x20push\x20','\x0a✔\x20Workflow\x20started','\x20\x201.\x20Edit\x20','\x22\x20}','timezone','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\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','✔\x20Retrieved\x20RT\x20configuration\x20version','enriched','Errors:','\x20behaviors','sourceTableValid','Listing\x20personalization\x20services\x20for\x20\x27','bold','keyEventCriteria','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','✔\x20Deleted\x20personalization\x20\x27','7938567QeIRTS','varchar','folder-segment','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','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','toLowerCase','63gOTeeB','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','identifier:\x20','\x20rows)','customerGroupFile','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','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','output','/\x20directories\x20exist.','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Show\x20personalization\x20service\x20details','\x20\x20\x20','Resolving\x20parent\x20segment\x20\x27','ps:pz:service:update','get','parentFolder','831370azLoAU','sampleData','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','payload','yellow','query','ps:rt:list','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','filter','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Columns:','pauseJourney','createdAt','Creating\x20token\x20\x27','⚡\x20Not\x20enabled','21RlAeJr','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','ps:pz:patch','split','\x20parent\x20segment\x20\x27','\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','replace','My\x20Service','verbose','SQL\x20query:\x0a','Behavior:','realtime:','no\x20tokens\x20configured','addAttributesFile','Options:\x0a','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Creating','customerGroup','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','rowCount','addAttributes','\x20--behavior\x20\x22','Site:\x20','Analyzing\x20changes...','Status:','createToken','error','run','\x20--interval\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','keys','Error:','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','customers','all','\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}','public:','cyan','push','resolveParentId','YAML\x20file:\x20','Coverage:','/app/workflows/','segment:parent:fields','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','allowed\x20IPs:','Master\x20+\x20Attributes','joinKey','Fetching\x20SQL\x20for\x20\x27','schemaError','RT\x202.0:','segment:parent:show','Fetching\x20parent\x20segment\x20\x27','ignore','behaviorsFile','\x20\x20\x20\x20\x20\x20\x20\x20','getOutputDatabaseName','Output\x20Database:','stringify','Updating\x20parent\x20segment\x20\x27','Overwrite\x20\x27','segment:parent:run','/{name}.yml\x0a','\x20is\x20already\x20up\x20to\x20date','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','customerPercent','text','Validate:','session','darwin','✔\x20Found\x20personalization\x20\x27','Listing\x20personalizations\x20for\x20\x27','Attribute:','\x20personalization\x20service','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','file','enabled','Aborted.','Get\x20current\x20RT\x20configuration\x20version\x20status','description','Attempt:','Show\x20a\x20specific\x20realtime\x20personalization','\x27\x20and\x20run\x20workflow?','Behaviors','\x20[Job\x20ID:\x20','segment:parent:update','\x20configured','workflowSessionId','Master:','Error:\x20--database\x20and\x20--table\x20are\x20required','90908jHHLPD','segment:parent:list','dim','master','page_view','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Pause\x20activations\x20in\x20an\x20RT\x20journey','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x20kill','interval','paused','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','No\x20parent\x20segments\x20match\x20pattern:\x20','some','updateParent','Customers:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','Validating\x20configuration...','apply','any','resumeJourney','toLocaleString','Apply\x20changes\x20to\x20\x27','Available\x20behaviors:','parent_id','green','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','✘\x20Failed\x20to\x20rename\x20directory:\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','formatSchemaJson','Error:\x20File\x20not\x20found:\x20','\x20\x20\x20\x20','Creating\x20personalization\x20\x27','foreignKey','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Join:','column_type','No\x20RT\x20journeys\x20found','✔\x20Renamed\x20directory\x20to\x20','entryCriteria:','behavior_','Fetching\x20customers\x20schema...','\x20Opening\x20','table','Events:','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x0a\x20\x20\x20\x20]','sections','\x20+\x20[','Next\x20steps:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','sourceTableError','primaryKey','/\x20directory.\x0a','td_client_id','entryCriteria','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','SELECT\x20*\x20FROM\x20','schemaValid','getBehaviorNames','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Deleting\x20personalization\x20service\x20\x27','\x0a⚠️\x20\x20Migrating:\x20','column_name','Options\x20(one\x20required):\x0a','Error:\x20--name\x20is\x20required','keyEventId','Source:','ps:rt:jn:resume','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','collectSchema','Listing\x20RT\x20journeys\x20for\x20\x27','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','\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','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','delete','preview','List\x20available\x20fields\x20for\x20segmentation','column','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','ps:pz:service:delete','Listing\x20RT-enabled\x20parent\x20segments...','keyEventId:','behavior','database','Getting\x20personalization\x20\x27','\x20\x20\x20\x20-\x20','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','attributes','win32','\x20Added\x20RT\x202.0\x20template\x20section','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','\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','Master\x20Table','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','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','web','allValid','name','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','Listing\x20parent\x20segments\x20matching\x20\x27','execute','length','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','personalization','Error:\x20Service\x20name\x20is\x20required','\x0aError:','\x20service(s)\x20configured','✔\x20Updated\x20personalization\x20\x27','jobId','type','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','(id:\x20','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','in\x20','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Update\x20a\x20realtime\x20personalization\x20entity','\x0aNo\x20sample\x20data\x20available','message','/sessions/','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','double','population','yes','Executing\x20parent\x20segment\x20query...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Preview:','attribute','Create\x20a\x20realtime\x20personalization\x20entity','endsWith','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x20to\x20configure\x20your\x20personalization\x20service','ps:pz:service:token:create','Output\x20file:\x20','personalization_services','\x20--enriched','Fetching\x20behavior\x20list...','last_page_viewed','status:\x20','Updating\x20personalization\x20service\x20\x27','\x20Added\x20personalization\x20template\x20to\x20','✔\x20Created\x20parent\x20segment\x20\x27','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','use','allowedIps','state','map','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','join','relationships','\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','Deleting\x20personalization\x20\x27','patchPersonalization','list','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','Options:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','✔\x20Deleted\x20personalization\x20service\x20\x27','ps:pz:list','jsonl','getParentSQL','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','true','Name:\x20','events','\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','.yml','Error:\x20Service\x20ID\x20is\x20required','\x20\x20Columns:\x20','format','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','parentSegment','audienceId','displaySummary','Delete\x20a\x20realtime\x20personalization','identifier','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','displayValidateResults','\x0aNew\x20parent\x20segment\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','parent_segment','stageCount','updatedAt','Create\x20parent\x20segment\x20\x27','Error\x20reading\x20file:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','Parent\x20segment:\x20','displayColumns','match','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','value','elapsedTimeMillis','List\x20RT\x20journeys','ps:pz:init','✔\x20No\x20changes\x20-\x20\x27','json','8NjXscg','\x20Configuration\x20is\x20valid','✔\x20Updated\x20parent\x20segment\x20\x27','Created','Fetching\x20personalization\x20service\x20\x27','displayRealtimeInfo','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Finding\x20service\x20for\x20token...','No\x20RT-enabled\x20parent\x20segments\x20found','To\x20cancel:','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','start','\x20parent\x20segment','/app/dw/parentSegments/','\x20tdx\x20wf\x20attempt\x20','\x20field','processedRows','scheduleType','launched','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','Attributes','\x5c$&','-1d','Validating\x20RT\x20configuration...','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Table:\x20','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','`\x20to\x20download\x20the\x20configuration\x20first','Error\x20parsing\x20YAML:\x20','sections:','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','displayPreviewHints','id:\x20','RT\x202.0\x20Validate:','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','workflowAttemptId','red','\x20\x20No\x20sample\x20data\x20available','createPersonalization','customersWithEvents','Personalization\x20service\x20description','deleteToken','label','using\x20the\x20default\x20path:\x20','<database>.<table>','Default','Join\x20on:','getPersonalization','\x20\x20\x20\x20\x20\x20','log','\x27...','payload:','RT\x20Journey\x20ID:\x20','data','segment:parent:validate','\x0aChanges\x20to\x20\x27','Error:\x20Personalization\x20ID\x20is\x20required','audienceId:\x20','patch','valid','reduce','\x20--attribute\x20\x22','includeSensitive:','errors','status','personalizationServices','\x20service','segment:parent:push','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','listParents','Available\x20attributes:','\x20(paused)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','.customers)','Schema\x20saved\x20to\x20','trim','token:','updated:','33207VPDvou','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','stats','coveragePercent','38BkrLRD','ps:rt:validate','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','behaviors','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','columns','Delete\x20a\x20personalization\x20service','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','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','FINISHED','eventKind','\x22,\x20\x22type\x22:\x20\x22','Updating','\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','✔\x20Query\x20completed:\x20Processed\x20','5102815hBGNMN','totalEvents','\x20RT-enabled\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Updated','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x202.\x20Run\x20','displayBehaviorsStats','Patching\x20personalization\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','test','Error:\x20Token\x20\x27','ID\x20Stitching:','\x20true','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','idStitching','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','string','stitchingKeys','18814224JyUnbu','\x27\x20is\x20up\x20to\x20date','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','scheduleOption'];a30_0x2fc6=function(){return _0x4ec9ad;};return a30_0x2fc6();}function a30_0x49a8(_0x10eaaa,_0x500bc1){_0x10eaaa=_0x10eaaa-0x1cf;const _0x2fc6df=a30_0x2fc6();let _0x49a886=_0x2fc6df[_0x10eaaa];return _0x49a886;}(function(_0x270342,_0x12ba37){const _0x5e1c7b=a30_0x49a8,_0x5d0418=_0x270342();while(!![]){try{const _0x2aada4=parseInt(_0x5e1c7b(0x294))/0x1*(parseInt(_0x5e1c7b(0x299))/0x2)+-parseInt(_0x5e1c7b(0x338))/0x3*(-parseInt(_0x5e1c7b(0x395))/0x4)+parseInt(_0x5e1c7b(0x2a9))/0x5+parseInt(_0x5e1c7b(0x2d1))/0x6*(-parseInt(_0x5e1c7b(0x318))/0x7)+-parseInt(_0x5e1c7b(0x243))/0x8*(-parseInt(_0x5e1c7b(0x311))/0x9)+-parseInt(_0x5e1c7b(0x328))/0xa+-parseInt(_0x5e1c7b(0x2be))/0xb;if(_0x2aada4===_0x12ba37)break;else _0x5d0418['push'](_0x5d0418['shift']());}catch(_0x5985c5){_0x5d0418['push'](_0x5d0418['shift']());}}}(a30_0x2fc6,0xa7268));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a30_0x17ee7b 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 a30_0x3ab056 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='parent_segment';function openBrowser(_0x3a7c73){const _0x5a60ac=a30_0x49a8,_0x34eb9d=process['platform'],_0x3c9a63=_0x34eb9d===_0x5a60ac(0x37f)?'open':_0x34eb9d===_0x5a60ac(0x1cf)?_0x5a60ac(0x24e):'xdg-open';spawn(_0x3c9a63,[_0x3a7c73],{'detached':!![],'stdio':_0x5a60ac(0x36f)})['unref']();}function migrateLegacyDirectory(){const _0x211926=a30_0x49a8;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x5b2f65=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x5b2f65[_0x211926(0x2e2)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a30_0x3ab056['yellow']('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x211926(0x320))),console[_0x211926(0x353)](a30_0x3ab056[_0x211926(0x397)](_0x211926(0x249)+LEGACY_PARENT_SEGMENT_DIR+_0x211926(0x3cd))),![];console['error'](a30_0x3ab056[_0x211926(0x32d)](_0x211926(0x3d6)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x211926(0x353)](a30_0x3ab056[_0x211926(0x3af)](_0x211926(0x3be)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x5b397c){const _0x2fa6fc=_0x5b397c instanceof Error?_0x5b397c['message']:String(_0x5b397c);return console[_0x211926(0x353)](a30_0x3ab056[_0x211926(0x269)](_0x211926(0x3b1)+_0x2fa6fc+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a30_0x41ba90(0x354)](_0x5ec1f5){const _0x5073f4=a30_0x41ba90;return migrateLegacyDirectory(),super[_0x5073f4(0x354)](_0x5ec1f5);}}function resolveYamlFile(_0x37b314){const _0x36c59f=a30_0x41ba90;if(_0x37b314[_0x36c59f(0x1fa)]('.yml')||_0x37b314['endsWith']('.yaml'))return _0x37b314;return a30_0x17ee7b[_0x36c59f(0x20d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x37b314)+_0x36c59f(0x221));}function formatProgressMessage(_0x1135d4){const _0x5f4b5c=a30_0x41ba90,_0xa3121=_0x1135d4[_0x5f4b5c(0x23a)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0xa3121){const [,_0x1c293b,_0xf3aacd,_0xfa6f7f='']=_0xa3121;return a30_0x3ab056[_0x5f4b5c(0x397)](_0x1c293b+':')+'\x20'+_0xf3aacd+a30_0x3ab056['dim'](_0xfa6f7f);}return a30_0x3ab056[_0x5f4b5c(0x397)](_0x1135d4);}function showFileNotFoundError(_0x578113,_0x13510a){const _0x393a4d=a30_0x41ba90;console[_0x393a4d(0x353)](a30_0x3ab056['red'](_0x393a4d(0x3b6)+_0x578113+'\x0a')),console['error'](a30_0x3ab056[_0x393a4d(0x35f)](_0x393a4d(0x1e5)+_0x13510a+_0x393a4d(0x25e)));}function displayRealtimeValidation(_0x165c2f){const _0x48edea=a30_0x41ba90;if(!_0x165c2f['realtime'])return;const _0x381f07=_0x165c2f[_0x48edea(0x2fe)],_0x254b6f=_0x381f07[_0x48edea(0x387)]?a30_0x3ab056[_0x48edea(0x3af)]('⚡\x20Enabled'):a30_0x3ab056[_0x48edea(0x32d)](_0x48edea(0x337));console['error']('\x0a'+a30_0x3ab056['dim'](_0x48edea(0x36c))+'\x20'+_0x254b6f);if(_0x381f07[_0x48edea(0x21f)]&&_0x381f07[_0x48edea(0x21f)][_0x48edea(0x1dc)]>0x0){console[_0x48edea(0x353)]('\x20\x20'+a30_0x3ab056[_0x48edea(0x397)](_0x48edea(0x3c4))+'\x20'+_0x381f07[_0x48edea(0x21f)][_0x48edea(0x1dc)]+_0x48edea(0x391));for(const _0x3db61c of _0x381f07[_0x48edea(0x21f)]){const _0x2ffef5=_0x3db61c[_0x48edea(0x30b)]===![]?a30_0x3ab056[_0x48edea(0x269)]('✘'):a30_0x3ab056[_0x48edea(0x3af)]('✔');console[_0x48edea(0x353)](_0x48edea(0x3b7)+_0x2ffef5+'\x20'+_0x3db61c[_0x48edea(0x1d8)]),_0x3db61c[_0x48edea(0x3cb)]&&console[_0x48edea(0x353)](_0x48edea(0x275)+a30_0x3ab056['red'](_0x3db61c[_0x48edea(0x3cb)]));}}if(_0x381f07[_0x48edea(0x3f0)]&&_0x381f07[_0x48edea(0x3f0)][_0x48edea(0x1dc)]>0x0){console['error']('\x20\x20'+a30_0x3ab056[_0x48edea(0x397)]('Attributes:')+'\x20'+_0x381f07[_0x48edea(0x3f0)][_0x48edea(0x1dc)]+_0x48edea(0x391));for(const _0x5dd85d of _0x381f07[_0x48edea(0x3f0)]){const _0x17e4b9=_0x5dd85d[_0x48edea(0x280)]?a30_0x3ab056[_0x48edea(0x3af)]('✔'):a30_0x3ab056[_0x48edea(0x269)]('✘');console[_0x48edea(0x353)](_0x48edea(0x3b7)+_0x17e4b9+'\x20'+_0x5dd85d[_0x48edea(0x1d8)]+'\x20'+a30_0x3ab056[_0x48edea(0x397)]('('+_0x5dd85d[_0x48edea(0x1e4)]+')'));}}if(_0x381f07['idStitching']){const _0x7cf86f=_0x381f07[_0x48edea(0x2b9)][_0x48edea(0x2bd)]?.['length']?_0x48edea(0x3c8)+_0x381f07['idStitching']['stitchingKeys'][_0x48edea(0x20d)](',\x20')+']':'';console[_0x48edea(0x353)]('\x20\x20'+a30_0x3ab056[_0x48edea(0x397)](_0x48edea(0x2b5))+'\x20'+_0x381f07[_0x48edea(0x2b9)][_0x48edea(0x3cc)]+_0x7cf86f);}if(_0x381f07[_0x48edea(0x286)]&&_0x381f07[_0x48edea(0x286)][_0x48edea(0x1dc)]>0x0){console[_0x48edea(0x353)]('\x20\x20'+a30_0x3ab056['dim'](_0x48edea(0x2c9))+'\x20'+_0x381f07[_0x48edea(0x286)][_0x48edea(0x1dc)]+_0x48edea(0x287)+(_0x381f07['personalizationServices']['length']!==0x1?'s':''));for(const _0x1954c4 of _0x381f07[_0x48edea(0x286)]){console[_0x48edea(0x353)](_0x48edea(0x3ee)+_0x1954c4['name']);}}}function showParentSegmentNotSetError(_0x1bccda){const _0x3481f8=a30_0x41ba90;console[_0x3481f8(0x353)](a30_0x3ab056[_0x3481f8(0x32d)](_0x3481f8(0x3ca))),console[_0x3481f8(0x353)](_0x1bccda);}export class ParentSegmentListCommand extends BaseCommand{['name']=a30_0x41ba90(0x396);[a30_0x41ba90(0x38a)]='List\x20parent\x20segments';async[a30_0x41ba90(0x1db)](_0x4aa7a8){const _0x25f5d3=a30_0x41ba90,{options:_0x18dc35,args:_0x1112a0,tdx:_0x39ed67}=_0x4aa7a8,_0x28c003=_0x1112a0[0x0];_0x18dc35[_0x25f5d3(0x340)]&&(console[_0x25f5d3(0x353)](_0x25f5d3(0x34f)+_0x18dc35[_0x25f5d3(0x2f8)]),_0x28c003&&console['error'](_0x25f5d3(0x2c6)+_0x28c003));const _0x2d9743=await withSpinner(_0x28c003?_0x25f5d3(0x1da)+_0x28c003+_0x25f5d3(0x277):'Listing\x20parent\x20segments...',()=>_0x39ed67[_0x25f5d3(0x2c3)][_0x25f5d3(0x28a)](),{'verbose':_0x18dc35[_0x25f5d3(0x340)]});let _0x358070=_0x2d9743[_0x25f5d3(0x27a)];if(_0x28c003){const _0x2aa54a=_0x28c003[_0x25f5d3(0x33e)](/[.+^${}()|[\]\\]/g,_0x25f5d3(0x258))[_0x25f5d3(0x33e)](/\*/g,'.*')[_0x25f5d3(0x33e)](/\?/g,'.'),_0x33d886=new RegExp('^'+_0x2aa54a+'$','i');_0x358070=_0x358070[_0x25f5d3(0x331)](_0x129150=>_0x33d886['test'](_0x129150[_0x25f5d3(0x3f0)][_0x25f5d3(0x1d8)]));}_0x358070[_0x25f5d3(0x2dd)]((_0x27527a,_0x4b888c)=>_0x27527a[_0x25f5d3(0x3f0)][_0x25f5d3(0x1d8)]['localeCompare'](_0x4b888c['attributes']['name'])),console[_0x25f5d3(0x353)]('✔\x20Found\x20'+_0x358070[_0x25f5d3(0x1dc)]+_0x25f5d3(0x24f)+(_0x358070[_0x25f5d3(0x1dc)]!==0x1?'s':''));const _0x546a5a=_0x4e6575=>{const _0x1382c6=_0x25f5d3;return getConsoleNextUrl(_0x18dc35[_0x1382c6(0x2f8)],_0x1382c6(0x250)+_0x4e6575);};if(_0x18dc35['format']===_0x25f5d3(0x242)||_0x18dc35['format']==='jsonl'){const _0x1e8b80=_0x358070[_0x25f5d3(0x20b)](_0x6c9152=>({..._0x6c9152,'url':_0x546a5a(_0x6c9152['id'])}));await handleSDKOutput(_0x1e8b80,_0x18dc35);}else{if(_0x358070[_0x25f5d3(0x1dc)]===0x0)_0x28c003?console[_0x25f5d3(0x276)](_0x25f5d3(0x3a2)+_0x28c003):console['log'](_0x25f5d3(0x2db));else for(const _0x4d9f88 of _0x358070){const _0x3abf80=_0x4d9f88['attributes'][_0x25f5d3(0x1f3)]?a30_0x3ab056['dim']('\x20('+formatRows(_0x4d9f88[_0x25f5d3(0x3f0)]['population'])+')'):'',_0x359301=hyperlink(_0x4d9f88[_0x25f5d3(0x3f0)][_0x25f5d3(0x1d8)],_0x546a5a(_0x4d9f88['id']));console['log']('👥\x20'+_0x359301+_0x3abf80);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='segment:parent:create';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x31d);async[a30_0x41ba90(0x1db)](_0x48481e){const _0x2d8fec=a30_0x41ba90,{options:_0x8f29b3,args:_0x203721,tdx:_0x1f3d95}=_0x48481e;console[_0x2d8fec(0x353)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x2d8fec(0x2a2)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x5b3a5e=_0x8f29b3;if(_0x203721[_0x2d8fec(0x1dc)]===0x0)return console[_0x2d8fec(0x353)](a30_0x3ab056['red'](_0x2d8fec(0x2ff))),console[_0x2d8fec(0x353)](_0x2d8fec(0x1e6)),0x1;const _0x2666c9=_0x203721[0x0];if(!_0x5b3a5e[_0x2d8fec(0x3ec)]||!_0x5b3a5e[_0x2d8fec(0x3c3)])return console[_0x2d8fec(0x353)](_0x2d8fec(0x394)),console['error'](_0x2d8fec(0x1e6)),0x1;_0x5b3a5e[_0x2d8fec(0x340)]&&(console['error'](_0x2d8fec(0x34f)+_0x5b3a5e[_0x2d8fec(0x2f8)]),console['error'](_0x2d8fec(0x21e)+_0x2666c9),console[_0x2d8fec(0x353)]('Database:\x20'+_0x5b3a5e[_0x2d8fec(0x3ec)]),console[_0x2d8fec(0x353)](_0x2d8fec(0x25c)+_0x5b3a5e[_0x2d8fec(0x3c3)]));const _0x474d53=await loadJSONFromOptions(_0x5b3a5e[_0x2d8fec(0x3f0)],_0x5b3a5e[_0x2d8fec(0x2ee)]),_0x1dae13=await loadJSONFromOptions(_0x5b3a5e['behaviors'],_0x5b3a5e[_0x2d8fec(0x370)]),_0x45410e=await loadJSONFromOptions(_0x5b3a5e[_0x2d8fec(0x349)],_0x5b3a5e[_0x2d8fec(0x31c)]),_0x4c34b6={'name':_0x2666c9,'description':_0x5b3a5e[_0x2d8fec(0x38a)],'scheduleType':_0x5b3a5e[_0x2d8fec(0x254)],'scheduleOption':_0x5b3a5e[_0x2d8fec(0x2c1)],'timezone':_0x5b3a5e[_0x2d8fec(0x304)],'master':{'parentDatabaseName':_0x5b3a5e[_0x2d8fec(0x3ec)],'parentTableName':_0x5b3a5e[_0x2d8fec(0x3c3)]},'attributes':_0x474d53,'behaviors':_0x1dae13,'customerGroup':_0x45410e},_0xf51b90=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x2666c9+_0x2d8fec(0x277),()=>_0x1f3d95[_0x2d8fec(0x2c3)][_0x2d8fec(0x2c5)](_0x4c34b6),{'verbose':_0x8f29b3[_0x2d8fec(0x340)]}),_0x1bc744=_0xf51b90[_0x2d8fec(0x27a)];return console[_0x2d8fec(0x353)](_0x2d8fec(0x206)+_0x1bc744[_0x2d8fec(0x1d8)]+_0x2d8fec(0x384)+_0x1bc744['id']),await handleSDKOutput([_0x1bc744],_0x8f29b3),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x390);[a30_0x41ba90(0x38a)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a30_0x41ba90(0x1db)](_0x1e1eb6){const _0x39c23a=a30_0x41ba90,{options:_0x570271,args:_0x234f19,tdx:_0x16b32b}=_0x1e1eb6;console['error'](_0x39c23a(0x22e)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x18dd5a=_0x570271;if(_0x234f19['length']===0x0)return console['error'](a30_0x3ab056[_0x39c23a(0x269)](_0x39c23a(0x2ff))),console['error'](_0x39c23a(0x21c)),0x1;const _0x2f1b57=_0x234f19[0x0];_0x18dd5a['verbose']&&(console[_0x39c23a(0x353)](_0x39c23a(0x34f)+_0x18dd5a[_0x39c23a(0x2f8)]),console[_0x39c23a(0x353)]('Parent\x20segment:\x20'+_0x2f1b57));const _0x392bc8=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x2f1b57+_0x39c23a(0x277),()=>_0x16b32b['segment']['getParentFull'](_0x2f1b57),{'verbose':_0x18dd5a[_0x39c23a(0x340)]}),_0xf6f2a5=_0x392bc8[_0x39c23a(0x27a)],_0x25a1d3=await loadJSONFromOptions(_0x18dd5a[_0x39c23a(0x34d)],_0x18dd5a[_0x39c23a(0x345)]),_0x1a419d=await loadJSONFromOptions(_0x18dd5a['addBehaviors'],_0x18dd5a[_0x39c23a(0x2dc)]),_0x2c86fe={'name':_0xf6f2a5[_0x39c23a(0x1d8)],'description':_0x18dd5a[_0x39c23a(0x38a)]!==undefined?_0x18dd5a['description']:_0xf6f2a5['description'],'scheduleType':_0x18dd5a[_0x39c23a(0x254)]!==undefined?_0x18dd5a[_0x39c23a(0x254)]:_0xf6f2a5[_0x39c23a(0x254)],'scheduleOption':_0x18dd5a['scheduleOption']!==undefined?_0x18dd5a[_0x39c23a(0x2c1)]:_0xf6f2a5[_0x39c23a(0x2c1)],'timezone':_0x18dd5a[_0x39c23a(0x304)]!==undefined?_0x18dd5a[_0x39c23a(0x304)]:_0xf6f2a5[_0x39c23a(0x304)],'master':_0xf6f2a5[_0x39c23a(0x398)],'attributes':_0x25a1d3?[..._0xf6f2a5[_0x39c23a(0x3f0)]||[],..._0x25a1d3]:_0xf6f2a5[_0x39c23a(0x3f0)],'behaviors':_0x1a419d?[..._0xf6f2a5['behaviors']||[],..._0x1a419d]:_0xf6f2a5[_0x39c23a(0x29c)],'customerGroup':_0xf6f2a5['customerGroup']},_0x4334bb=await withSpinner(_0x39c23a(0x375)+_0x2f1b57+'\x27...',()=>_0x16b32b['segment'][_0x39c23a(0x3a4)](_0x2f1b57,_0x2c86fe),{'verbose':_0x18dd5a[_0x39c23a(0x340)]}),_0x2e5960=_0x4334bb['data'];return console['error'](_0x39c23a(0x245)+_0x2e5960[_0x39c23a(0x1d8)]+'\x27'),await handleSDKOutput([_0x2e5960],_0x18dd5a),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a30_0x41ba90(0x1d8)]='segment:parent:pull';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x2b8);async[a30_0x41ba90(0x1db)](_0x5daf78){const _0x469b1d=a30_0x41ba90,{options:_0x5b3ba3,args:_0x1fa354,tdx:_0x1be460}=_0x5daf78,_0x1eab5a=_0x5b3ba3,_0x29ecb3=_0x1fa354[0x0]||_0x5b3ba3[_0x469b1d(0x226)];if(!_0x29ecb3)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x469b1d(0x2ac)),0x1;if(_0x1eab5a[_0x469b1d(0x208)]&&_0x1eab5a[_0x469b1d(0x31f)])return console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x269)](_0x469b1d(0x37a))),console[_0x469b1d(0x353)](a30_0x3ab056['dim']('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x469b1d(0x353)](a30_0x3ab056['dim'](_0x469b1d(0x270)+PARENT_SEGMENT_DIR+_0x469b1d(0x378))),console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x35f)](_0x469b1d(0x332))),0x1;const _0x3ebc8a=_0x1eab5a[_0x469b1d(0x31f)]||a30_0x17ee7b[_0x469b1d(0x20d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x29ecb3)+_0x469b1d(0x221));_0x1eab5a[_0x469b1d(0x340)]&&(console['error'](_0x469b1d(0x34f)+_0x1eab5a[_0x469b1d(0x2f8)]),console['error'](_0x469b1d(0x238)+_0x29ecb3),console[_0x469b1d(0x353)](_0x469b1d(0x1fe)+_0x3ebc8a));const _0x576c73=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x29ecb3+_0x469b1d(0x277),()=>_0x1be460[_0x469b1d(0x2c3)]['pullParentYaml'](_0x29ecb3),{'verbose':_0x1eab5a[_0x469b1d(0x340)]}),_0x39a3ad=_0x576c73[_0x469b1d(0x27a)];if(existsSync(_0x3ebc8a)){const _0x1f9c9b=readFileSync(_0x3ebc8a,_0x469b1d(0x2d3)),_0x364237=generateDiff(_0x1f9c9b,_0x39a3ad);if(!hasChanges(_0x364237))console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x3af)]('✔')+'\x20No\x20changes\x20-\x20'+a30_0x3ab056[_0x469b1d(0x35f)](_0x3ebc8a)+_0x469b1d(0x379));else{console[_0x469b1d(0x353)](_0x469b1d(0x27c)+_0x3ebc8a+'\x27:'),console['error']('─'[_0x469b1d(0x2df)](0x3c)),console[_0x469b1d(0x353)](formatDiffWithColors(_0x364237)),console[_0x469b1d(0x353)]('─'[_0x469b1d(0x2df)](0x3c));if(!_0x1eab5a[_0x469b1d(0x1f4)]){if(!isInteractive())return console['error'](a30_0x3ab056[_0x469b1d(0x269)]('\x0aError:'),_0x469b1d(0x319)),console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x397)](_0x469b1d(0x3e2))),0x1;const _0x10840c=await confirmKey(_0x469b1d(0x376)+_0x3ebc8a+'\x27?');if(!_0x10840c)return console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x32d)]('Aborted.')),0x1;}writeFileSync(_0x3ebc8a,_0x39a3ad,_0x469b1d(0x2d3)),console[_0x469b1d(0x353)](a30_0x3ab056['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a30_0x3ab056[_0x469b1d(0x35f)](_0x3ebc8a));}}else{const _0x209290=a30_0x17ee7b['dirname'](_0x3ebc8a);!existsSync(_0x209290)&&mkdirSync(_0x209290,{'recursive':!![]}),writeFileSync(_0x3ebc8a,_0x39a3ad,_0x469b1d(0x2d3)),console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x3af)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a30_0x3ab056[_0x469b1d(0x35f)](_0x3ebc8a));}return saveSessionContext({'parent_segment':_0x29ecb3},_0x1eab5a[_0x469b1d(0x37e)]),console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x3af)]('✔')+'\x20Context\x20set:\x20'+a30_0x3ab056[_0x469b1d(0x397)](_0x469b1d(0x232))+_0x469b1d(0x2a1)+a30_0x3ab056[_0x469b1d(0x35f)](_0x29ecb3)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x288);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x1dd);async[a30_0x41ba90(0x1db)](_0x55df31){const _0x17e02f=a30_0x41ba90,{options:_0x117298,args:_0x508c91,tdx:_0x1c193e}=_0x55df31,_0x2272a6=_0x117298,_0x43c6f0=_0x508c91[0x0]||_0x117298[_0x17e02f(0x226)];if(!_0x43c6f0)return showParentSegmentNotSetError(_0x17e02f(0x385)+_0x17e02f(0x28d)),0x1;const _0x1959d8=resolveYamlFile(_0x43c6f0);if(!existsSync(_0x1959d8))return showFileNotFoundError(_0x1959d8,_0x43c6f0),0x1;_0x2272a6['verbose']&&(console['error'](_0x17e02f(0x34f)+_0x2272a6[_0x17e02f(0x2f8)]),console['error'](_0x17e02f(0x362)+_0x1959d8));let _0x2af532;try{_0x2af532=readFileSync(_0x1959d8,_0x17e02f(0x2d3));}catch(_0x3fe109){const _0x2c89bc=_0x3fe109 instanceof Error?_0x3fe109[_0x17e02f(0x1ef)]:String(_0x3fe109);return console[_0x17e02f(0x353)]('Error\x20reading\x20file:\x20'+_0x2c89bc),0x1;}const _0x10871e=await withSpinner('Analyzing\x20changes...',()=>_0x1c193e[_0x17e02f(0x2c3)]['pushParentYaml'](_0x2af532),{'verbose':_0x2272a6['verbose']}),_0x2245a7=_0x10871e[_0x17e02f(0x27a)],{isNew:_0x3bf925,name:_0x400b35,hasChanges:_0x4c2945,diffFormatted:_0x3103cf}=_0x2245a7;if(!_0x4c2945)return console[_0x17e02f(0x353)](_0x17e02f(0x241)+_0x400b35+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x3bf925?console['error'](_0x17e02f(0x22d)+_0x400b35+'\x27:'):console[_0x17e02f(0x353)](_0x17e02f(0x2ae)+_0x400b35+'\x27:');console[_0x17e02f(0x353)]('─'[_0x17e02f(0x2df)](0x3c)),console[_0x17e02f(0x353)](_0x3103cf),console[_0x17e02f(0x353)]('─'[_0x17e02f(0x2df)](0x3c));const _0x598cb4=_0x3bf925?_0x17e02f(0x235)+_0x400b35+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x400b35+'\x27?';if(!_0x2272a6['yes']){if(!isInteractive())return console[_0x17e02f(0x353)](a30_0x3ab056[_0x17e02f(0x269)](_0x17e02f(0x1e0)),_0x17e02f(0x319)),console[_0x17e02f(0x353)](a30_0x3ab056[_0x17e02f(0x397)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x412276=await confirmKey(_0x598cb4);if(!_0x412276)return console['error'](a30_0x3ab056[_0x17e02f(0x32d)](_0x17e02f(0x388))),0x1;}const _0x3605cb=_0x3bf925?_0x17e02f(0x348):_0x17e02f(0x2a6),_0xbae3b5=await withSpinner(_0x3605cb+_0x17e02f(0x33c)+_0x400b35+_0x17e02f(0x277),()=>_0x2245a7['apply'](),{'verbose':_0x2272a6['verbose']}),_0x3f0ffb=_0xbae3b5[_0x17e02f(0x27a)],_0x18e4ba=getConsoleNextUrl(_0x2272a6['site'],'/app/dw/parentSegments/'+_0x3f0ffb['id']),_0x15c482=_0x3bf925?_0x17e02f(0x246):_0x17e02f(0x2ad);return console['error']('✔\x20'+_0x15c482+_0x17e02f(0x33c)+_0x3f0ffb[_0x17e02f(0x1d8)]+'\x27'),console[_0x17e02f(0x353)]('\x20\x20'+_0x18e4ba),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a30_0x41ba90(0x27b);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x295);async[a30_0x41ba90(0x1db)](_0xbd5713){const _0x346f3d=a30_0x41ba90,{options:_0x21615f,args:_0x4eb25a,tdx:_0x2e8556}=_0xbd5713,_0x49eefb=_0x21615f,_0x29e456=_0x4eb25a[0x0]||_0x21615f[_0x346f3d(0x226)];if(!_0x29e456)return showParentSegmentNotSetError(_0x346f3d(0x359)+_0x346f3d(0x215)+_0x346f3d(0x346)+_0x346f3d(0x2e1)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x346f3d(0x2fc)),0x1;const _0x1adf62=resolveYamlFile(_0x29e456);if(!existsSync(_0x1adf62))return showFileNotFoundError(_0x1adf62,_0x29e456),0x1;_0x49eefb[_0x346f3d(0x340)]&&(console[_0x346f3d(0x353)]('Site:\x20'+_0x49eefb['site']),console['error'](_0x346f3d(0x362)+_0x1adf62));let _0x436480;try{_0x436480=readFileSync(_0x1adf62,'utf-8');}catch(_0x55bbb4){const _0x381a46=_0x55bbb4 instanceof Error?_0x55bbb4[_0x346f3d(0x1ef)]:String(_0x55bbb4);return console[_0x346f3d(0x353)](_0x346f3d(0x236)+_0x381a46),0x1;}const _0x17bba7=createCommandSpinner(a30_0x3ab056['dim'](_0x346f3d(0x3a7)),{'verbose':_0x49eefb['verbose']});_0x17bba7[_0x346f3d(0x24e)]();const _0x239c0b={'onProgress':_0x40fc68=>{const _0x2e994d=_0x346f3d;_0x17bba7[_0x2e994d(0x37c)]=formatProgressMessage(_0x40fc68);}};if(_0x49eefb[_0x346f3d(0x398)])_0x239c0b[_0x346f3d(0x398)]=!![];if(_0x49eefb[_0x346f3d(0x308)])_0x239c0b['enriched']=!![];_0x49eefb[_0x346f3d(0x1f8)]&&(_0x239c0b['attribute']=_0x49eefb[_0x346f3d(0x1f8)]);_0x49eefb[_0x346f3d(0x3eb)]&&(_0x239c0b[_0x346f3d(0x3eb)]=_0x49eefb[_0x346f3d(0x3eb)]);if(_0x49eefb[_0x346f3d(0x39f)])_0x239c0b[_0x346f3d(0x39f)]=_0x49eefb['interval'];let _0x759dea;try{_0x759dea=await _0x2e8556[_0x346f3d(0x2c3)][_0x346f3d(0x2e5)](_0x436480,_0x239c0b),_0x17bba7['stop']();}catch(_0x451a75){_0x17bba7[_0x346f3d(0x2de)]();throw _0x451a75;}const _0x35cc82=_0x49eefb[_0x346f3d(0x39f)]||_0x346f3d(0x259);return this[_0x346f3d(0x22c)](_0x759dea,_0x239c0b,_0x1adf62,_0x35cc82),_0x759dea[_0x346f3d(0x1d7)]?0x0:0x1;}[a30_0x41ba90(0x22c)](_0x3b4f35,_0x5e05e4,_0x504d7c,_0x47e09c){const _0x5911ad=a30_0x41ba90;console[_0x5911ad(0x353)]('\x0a'+a30_0x3ab056[_0x5911ad(0x30d)](_0x5911ad(0x37d))+'\x20'+_0x3b4f35[_0x5911ad(0x1d8)]),console[_0x5911ad(0x353)]('═'[_0x5911ad(0x2df)](0x3c)),this[_0x5911ad(0x2c4)](_0x3b4f35);if(typeof _0x5e05e4[_0x5911ad(0x1f8)]==='string'){this[_0x5911ad(0x2f5)](_0x3b4f35),this[_0x5911ad(0x228)](_0x3b4f35),this[_0x5911ad(0x262)](_0x504d7c,_0x47e09c,_0x5911ad(0x1f8),_0x5e05e4[_0x5911ad(0x1f8)]);return;}if(_0x5e05e4[_0x5911ad(0x1f8)]===!![]){this['displayAttributesStats'](_0x3b4f35),this['displaySummary'](_0x3b4f35),this[_0x5911ad(0x262)](_0x504d7c,_0x47e09c,_0x5911ad(0x3f0));return;}if(typeof _0x5e05e4[_0x5911ad(0x3eb)]==='string'){this[_0x5911ad(0x2b0)](_0x3b4f35,_0x47e09c),this[_0x5911ad(0x228)](_0x3b4f35),this['displayPreviewHints'](_0x504d7c,_0x47e09c,_0x5911ad(0x3eb),_0x5e05e4[_0x5911ad(0x3eb)]);return;}if(_0x5e05e4[_0x5911ad(0x3eb)]===!![]){this[_0x5911ad(0x2b0)](_0x3b4f35,_0x47e09c),this['displaySummary'](_0x3b4f35),this[_0x5911ad(0x262)](_0x504d7c,_0x47e09c,_0x5911ad(0x29c));return;}this['displayAttributesStats'](_0x3b4f35),this[_0x5911ad(0x2b0)](_0x3b4f35,_0x47e09c),this[_0x5911ad(0x248)](_0x3b4f35),this['displaySummary'](_0x3b4f35),this['displayPreviewHints'](_0x504d7c,_0x47e09c,_0x5911ad(0x35c));}[a30_0x41ba90(0x248)](_0x234776){displayRealtimeValidation(_0x234776);}[a30_0x41ba90(0x262)](_0x2f3cef,_0xef4231,_0x498143,_0x4cfb49){const _0x7a99bc=a30_0x41ba90;console[_0x7a99bc(0x353)]('\x0a'+a30_0x3ab056['dim'](_0x7a99bc(0x2cc)));const _0x43bcd3=_0xef4231!==_0x7a99bc(0x259)?_0x7a99bc(0x355)+_0xef4231:'';if(_0x498143===_0x7a99bc(0x1f8)&&_0x4cfb49)console[_0x7a99bc(0x353)]('\x20\x20'+a30_0x3ab056[_0x7a99bc(0x397)](_0x7a99bc(0x2ea)+_0x2f3cef+_0x7a99bc(0x282)+_0x4cfb49+'\x22'+_0x43bcd3));else{if(_0x498143===_0x7a99bc(0x3eb)&&_0x4cfb49)console[_0x7a99bc(0x353)]('\x20\x20'+a30_0x3ab056[_0x7a99bc(0x397)](_0x7a99bc(0x2ea)+_0x2f3cef+_0x7a99bc(0x34e)+_0x4cfb49+'\x22'+_0x43bcd3));else(_0x498143==='attributes'||_0x498143===_0x7a99bc(0x35c))&&console[_0x7a99bc(0x353)]('\x20\x20'+a30_0x3ab056[_0x7a99bc(0x397)]('tdx\x20ps\x20preview\x20'+_0x2f3cef+'\x20--attribute\x20\x22<name>\x22'+_0x43bcd3));}(_0x498143===_0x7a99bc(0x29c)||_0x498143===_0x7a99bc(0x35c))&&console[_0x7a99bc(0x353)]('\x20\x20'+a30_0x3ab056[_0x7a99bc(0x397)](_0x7a99bc(0x2ea)+_0x2f3cef+'\x20--behavior\x20\x22<name>\x22'+_0x43bcd3)),_0x498143===_0x7a99bc(0x35c)&&console['error']('\x20\x20'+a30_0x3ab056['dim'](_0x7a99bc(0x2ea)+_0x2f3cef+_0x7a99bc(0x200)+_0x43bcd3));}['displayMasterInfo'](_0xc83619){const _0x2590cc=a30_0x41ba90,{master:_0x178604}=_0xc83619,_0x4b15a9=_0x178604[_0x2590cc(0x3d2)]?a30_0x3ab056['green']('✔'):a30_0x3ab056['red']('✘');console[_0x2590cc(0x353)]('\x0a'+a30_0x3ab056[_0x2590cc(0x397)](_0x2590cc(0x1d3))),console[_0x2590cc(0x353)](_0x4b15a9+'\x20'+a30_0x3ab056[_0x2590cc(0x30d)](_0x178604[_0x2590cc(0x3ec)]+'.'+_0x178604['table'])),_0x178604[_0x2590cc(0x3d2)]?_0x178604[_0x2590cc(0x34c)]!==undefined&&console[_0x2590cc(0x353)]('\x20\x20'+a30_0x3ab056[_0x2590cc(0x397)](_0x2590cc(0x2e8))+'\x20'+a30_0x3ab056[_0x2590cc(0x35f)](formatRows(_0x178604['rowCount']))):console[_0x2590cc(0x353)]('\x20\x20'+a30_0x3ab056[_0x2590cc(0x269)]('Error:')+'\x20'+_0x178604['schemaError']);}['displayAttributesStats'](_0xb020a){const _0x343bef=a30_0x41ba90;if(_0xb020a[_0x343bef(0x3f0)]['length']===0x0)return;console[_0x343bef(0x353)]('\x0a'+a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x257)));for(const _0x4a6054 of _0xb020a[_0x343bef(0x3f0)]){const _0x506d7a=_0x4a6054['schemaValid']?a30_0x3ab056[_0x343bef(0x3af)]('✔'):a30_0x3ab056[_0x343bef(0x269)]('✘');let _0x54549f='';if(_0x4a6054[_0x343bef(0x3d2)]&&_0x4a6054[_0x343bef(0x2e3)]!==undefined&&_0x4a6054[_0x343bef(0x298)]!==undefined){const _0x34dd50=_0x4a6054[_0x343bef(0x298)]['toFixed'](0x1),_0x28ebfb=_0x4a6054[_0x343bef(0x298)]>=0x50?a30_0x3ab056[_0x343bef(0x3af)]:_0x4a6054[_0x343bef(0x298)]>=0x32?a30_0x3ab056['yellow']:a30_0x3ab056[_0x343bef(0x269)];_0x54549f='\x20'+a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x363))+'\x20'+_0x28ebfb(_0x34dd50+'%')+'\x20('+formatRows(_0x4a6054[_0x343bef(0x2e3)])+_0x343bef(0x31b);}console['error'](_0x506d7a+'\x20'+a30_0x3ab056[_0x343bef(0x30d)](_0x4a6054[_0x343bef(0x1d8)])+_0x54549f),console[_0x343bef(0x353)]('\x20\x20'+a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x3db))+'\x20'+a30_0x3ab056[_0x343bef(0x30d)](_0x4a6054[_0x343bef(0x3ec)]+'.'+_0x4a6054[_0x343bef(0x3c3)]));const _0x1626c7=_0x4a6054[_0x343bef(0x369)]===_0x4a6054['foreignKey']?a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x273))+'\x20'+_0x4a6054['joinKey']:a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x3bb))+'\x20'+_0x4a6054[_0x343bef(0x369)]+'\x20=\x20'+_0x4a6054[_0x343bef(0x3b9)];console[_0x343bef(0x353)]('\x20\x20'+_0x1626c7),console['error']('\x20\x20'+a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x333))),this[_0x343bef(0x239)](_0x4a6054[_0x343bef(0x29e)]),!_0x4a6054[_0x343bef(0x3d2)]&&console[_0x343bef(0x353)]('\x20\x20'+a30_0x3ab056[_0x343bef(0x269)](_0x343bef(0x358))+'\x20'+_0x4a6054[_0x343bef(0x36b)]);}}[a30_0x41ba90(0x2b0)](_0x69a3b0,_0x3545ef){const _0x478966=a30_0x41ba90;if(_0x69a3b0[_0x478966(0x29c)][_0x478966(0x1dc)]===0x0)return;console['error']('\x0a'+a30_0x3ab056[_0x478966(0x397)](_0x478966(0x38e))+'\x20'+a30_0x3ab056[_0x478966(0x397)]('('+_0x3545ef+')'));for(const _0x10b83d of _0x69a3b0['behaviors']){const _0x44f5f7=_0x10b83d[_0x478966(0x3d2)]?a30_0x3ab056[_0x478966(0x3af)]('✔'):a30_0x3ab056['red']('✘');let _0x4385e4='';if(_0x10b83d[_0x478966(0x3d2)]&&_0x10b83d[_0x478966(0x26c)]!==undefined&&_0x10b83d[_0x478966(0x2aa)]!==undefined){const _0x145b34=_0x10b83d[_0x478966(0x37b)]?.[_0x478966(0x2ec)](0x1)||'?',_0x52cd06=(_0x10b83d[_0x478966(0x37b)]??0x0)>=0x32?a30_0x3ab056['green']:(_0x10b83d[_0x478966(0x37b)]??0x0)>=0x14?a30_0x3ab056[_0x478966(0x32d)]:a30_0x3ab056[_0x478966(0x269)];_0x4385e4='\x20'+a30_0x3ab056[_0x478966(0x397)](_0x478966(0x3a5))+'\x20'+_0x52cd06(formatRows(_0x10b83d[_0x478966(0x26c)]))+'\x20('+_0x145b34+'%)\x20'+a30_0x3ab056[_0x478966(0x397)]('Events:')+'\x20'+a30_0x3ab056['cyan'](formatRows(_0x10b83d['totalEvents']));}console[_0x478966(0x353)](_0x44f5f7+'\x20'+a30_0x3ab056[_0x478966(0x30d)](_0x10b83d[_0x478966(0x1d8)])+_0x4385e4),console['error']('\x20\x20'+a30_0x3ab056['dim'](_0x478966(0x3db))+'\x20'+a30_0x3ab056[_0x478966(0x30d)](_0x10b83d[_0x478966(0x3ec)]+'.'+_0x10b83d['table']));const _0x1d0cea=_0x10b83d[_0x478966(0x369)]===_0x10b83d[_0x478966(0x3b9)]?a30_0x3ab056['dim']('Join\x20on:')+'\x20'+_0x10b83d[_0x478966(0x369)]:a30_0x3ab056[_0x478966(0x397)](_0x478966(0x3bb))+'\x20'+_0x10b83d[_0x478966(0x369)]+_0x478966(0x2a1)+_0x10b83d[_0x478966(0x3b9)];console[_0x478966(0x353)]('\x20\x20'+_0x1d0cea),console[_0x478966(0x353)]('\x20\x20'+a30_0x3ab056['dim']('Columns:')),this[_0x478966(0x239)](_0x10b83d['columns']),!_0x10b83d[_0x478966(0x3d2)]&&console[_0x478966(0x353)]('\x20\x20'+a30_0x3ab056['red'](_0x478966(0x358))+'\x20'+_0x10b83d['schemaError']);}}[a30_0x41ba90(0x239)](_0x15871e){const _0x1e5339=a30_0x41ba90;for(const _0x38e36d of _0x15871e){_0x38e36d[_0x1e5339(0x26f)]===_0x38e36d[_0x1e5339(0x3e6)]||_0x38e36d[_0x1e5339(0x3e6)]==='*'?console[_0x1e5339(0x353)](_0x1e5339(0x3ee)+_0x38e36d[_0x1e5339(0x26f)]):console[_0x1e5339(0x353)]('\x20\x20\x20\x20-\x20'+_0x38e36d['label']+'\x20'+a30_0x3ab056[_0x1e5339(0x397)]('('+_0x38e36d['column']+')'));}}[a30_0x41ba90(0x228)](_0x1659e3){const _0x123677=a30_0x41ba90;console['error']('─'['repeat'](0x3c));if(_0x1659e3[_0x123677(0x284)]['length']>0x0){console[_0x123677(0x353)]('\x0a'+a30_0x3ab056['red'](_0x123677(0x309)));for(const _0x2daca1 of _0x1659e3[_0x123677(0x284)]){console[_0x123677(0x353)]('\x20\x20'+a30_0x3ab056[_0x123677(0x269)]('•')+'\x20'+_0x2daca1);}}_0x1659e3[_0x123677(0x1d7)]&&console[_0x123677(0x353)]('\x0a'+a30_0x3ab056[_0x123677(0x3af)]('✔')+_0x123677(0x244));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']='segment:parent:preview';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x366);async[a30_0x41ba90(0x1db)](_0x23f64a){const _0x31d8a8=a30_0x41ba90,{options:_0x43d85e,args:_0x25d17c,tdx:_0x399b70}=_0x23f64a,_0x5de8df=_0x43d85e,_0x44c6f8=_0x25d17c[0x0]||_0x43d85e[_0x31d8a8(0x226)];if(!_0x44c6f8)return showParentSegmentNotSetError(_0x31d8a8(0x3d4)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x31d8a8(0x3d8)+_0x31d8a8(0x2d2)+_0x31d8a8(0x3dd)+_0x31d8a8(0x305)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x31d8a8(0x2fc)),0x1;if(!_0x5de8df[_0x31d8a8(0x398)]&&!_0x5de8df[_0x31d8a8(0x1f8)]&&!_0x5de8df[_0x31d8a8(0x3eb)]&&!_0x5de8df[_0x31d8a8(0x308)])return console['error'](a30_0x3ab056[_0x31d8a8(0x269)](_0x31d8a8(0x39a))),console[_0x31d8a8(0x353)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x31d8a8(0x353)](_0x31d8a8(0x214)),console[_0x31d8a8(0x353)](_0x31d8a8(0x356)),console[_0x31d8a8(0x353)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x31d8a8(0x353)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console['error'](_0x31d8a8(0x39b)),0x1;const _0x181ae0=resolveYamlFile(_0x44c6f8);if(!existsSync(_0x181ae0))return showFileNotFoundError(_0x181ae0,_0x44c6f8),0x1;_0x5de8df['verbose']&&(console[_0x31d8a8(0x353)](_0x31d8a8(0x34f)+_0x5de8df['site']),console[_0x31d8a8(0x353)](_0x31d8a8(0x362)+_0x181ae0));let _0x2f7eb6;try{_0x2f7eb6=readFileSync(_0x181ae0,_0x31d8a8(0x2d3));}catch(_0x47e852){const _0x11649b=_0x47e852 instanceof Error?_0x47e852[_0x31d8a8(0x1ef)]:String(_0x47e852);return console[_0x31d8a8(0x353)]('Error\x20reading\x20file:\x20'+_0x11649b),0x1;}let _0x14eec7;try{_0x14eec7=parseDef(_0x2f7eb6);}catch(_0x21d199){const _0x10d26e=_0x21d199 instanceof Error?_0x21d199[_0x31d8a8(0x1ef)]:String(_0x21d199);return console[_0x31d8a8(0x353)](a30_0x3ab056['red'](_0x31d8a8(0x25f)+_0x10d26e)),0x1;}if(_0x5de8df[_0x31d8a8(0x1f8)]===!![]||_0x5de8df[_0x31d8a8(0x1f8)]===''){const _0x204afa=_0x14eec7[_0x31d8a8(0x3f0)]?.[_0x31d8a8(0x20b)](_0x41d3a3=>_0x41d3a3[_0x31d8a8(0x1d8)])||[];if(_0x204afa[_0x31d8a8(0x1dc)]===0x0)console[_0x31d8a8(0x353)](a30_0x3ab056[_0x31d8a8(0x269)](_0x31d8a8(0x207)));else{console[_0x31d8a8(0x353)](a30_0x3ab056[_0x31d8a8(0x269)](_0x31d8a8(0x1ec))),console['error'](_0x31d8a8(0x28b));for(const _0xb39a4c of _0x204afa){console[_0x31d8a8(0x353)]('\x20\x20'+a30_0x3ab056[_0x31d8a8(0x35f)](_0xb39a4c));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x44c6f8+_0x31d8a8(0x282)+_0x204afa[0x0]+'\x22');}return 0x1;}if(_0x5de8df[_0x31d8a8(0x3eb)]===!![]||_0x5de8df[_0x31d8a8(0x3eb)]===''){const _0x4200d2=_0x14eec7[_0x31d8a8(0x29c)]?.[_0x31d8a8(0x20b)](_0x31e762=>_0x31e762['name'])||[];if(_0x4200d2[_0x31d8a8(0x1dc)]===0x0)console['error'](a30_0x3ab056[_0x31d8a8(0x269)](_0x31d8a8(0x2ba)));else{console[_0x31d8a8(0x353)](a30_0x3ab056[_0x31d8a8(0x269)](_0x31d8a8(0x3b3))),console[_0x31d8a8(0x353)](_0x31d8a8(0x3ad));for(const _0x40849f of _0x4200d2){console[_0x31d8a8(0x353)]('\x20\x20'+a30_0x3ab056[_0x31d8a8(0x35f)](_0x40849f));}console[_0x31d8a8(0x353)](_0x31d8a8(0x3c5)+_0x44c6f8+_0x31d8a8(0x34e)+_0x4200d2[0x0]+'\x22');}return 0x1;}const _0x53ba78=createCommandSpinner(a30_0x3ab056[_0x31d8a8(0x397)]('Fetching\x20sample\x20data...'),{'verbose':_0x5de8df[_0x31d8a8(0x340)]});_0x53ba78[_0x31d8a8(0x24e)]();const _0x12a7c1={'onProgress':_0x1d8377=>{const _0x2989a7=_0x31d8a8;_0x53ba78[_0x2989a7(0x37c)]=formatProgressMessage(_0x1d8377);}};if(_0x5de8df[_0x31d8a8(0x398)])_0x12a7c1[_0x31d8a8(0x398)]=!![];if(_0x5de8df[_0x31d8a8(0x1f8)]&&typeof _0x5de8df[_0x31d8a8(0x1f8)]===_0x31d8a8(0x2bc))_0x12a7c1[_0x31d8a8(0x1f8)]=_0x5de8df[_0x31d8a8(0x1f8)];if(_0x5de8df[_0x31d8a8(0x3eb)]&&typeof _0x5de8df['behavior']==='string')_0x12a7c1[_0x31d8a8(0x3eb)]=_0x5de8df['behavior'];if(_0x5de8df[_0x31d8a8(0x308)])_0x12a7c1[_0x31d8a8(0x308)]=!![];if(_0x5de8df[_0x31d8a8(0x39f)])_0x12a7c1[_0x31d8a8(0x39f)]=_0x5de8df[_0x31d8a8(0x39f)];let _0x54d78d;try{_0x54d78d=await _0x399b70[_0x31d8a8(0x2c3)][_0x31d8a8(0x2d4)](_0x2f7eb6,_0x12a7c1),_0x53ba78[_0x31d8a8(0x2de)]();}catch(_0x43180d){_0x53ba78[_0x31d8a8(0x2de)]();throw _0x43180d;}return await this[_0x31d8a8(0x2d8)](_0x54d78d,{'master':_0x5de8df[_0x31d8a8(0x398)],'attribute':typeof _0x5de8df['attribute']===_0x31d8a8(0x2bc)?_0x5de8df[_0x31d8a8(0x1f8)]:undefined,'behavior':typeof _0x5de8df[_0x31d8a8(0x3eb)]===_0x31d8a8(0x2bc)?_0x5de8df[_0x31d8a8(0x3eb)]:undefined,'enriched':_0x5de8df[_0x31d8a8(0x308)]}),_0x54d78d[_0x31d8a8(0x1d7)]?0x0:0x1;}async[a30_0x41ba90(0x2d8)](_0x5ceb04,_0x4cb5a0){const _0x1f0a9a=a30_0x41ba90;console[_0x1f0a9a(0x353)]('\x0a'+a30_0x3ab056[_0x1f0a9a(0x30d)](_0x1f0a9a(0x1f7))+'\x20'+_0x5ceb04[_0x1f0a9a(0x1d8)]),console[_0x1f0a9a(0x353)]('═'[_0x1f0a9a(0x2df)](0x3c));if(_0x4cb5a0[_0x1f0a9a(0x398)]&&_0x5ceb04[_0x1f0a9a(0x329)]){const _0x2818a4=a30_0x3ab056['dim'](_0x1f0a9a(0x393))+'\x20'+a30_0x3ab056[_0x1f0a9a(0x30d)](_0x5ceb04[_0x1f0a9a(0x398)][_0x1f0a9a(0x3ec)]+'.'+_0x5ceb04[_0x1f0a9a(0x398)]['table']);await this[_0x1f0a9a(0x2ca)](_0x2818a4,_0x5ceb04[_0x1f0a9a(0x329)]);}else{if(_0x4cb5a0[_0x1f0a9a(0x1f8)]&&_0x5ceb04['sampleData']){const _0x11422f=a30_0x3ab056[_0x1f0a9a(0x397)](_0x1f0a9a(0x382))+'\x20'+a30_0x3ab056[_0x1f0a9a(0x30d)](_0x4cb5a0[_0x1f0a9a(0x1f8)]);await this['displaySampleData'](_0x11422f,_0x5ceb04[_0x1f0a9a(0x329)]);}else{if(_0x4cb5a0[_0x1f0a9a(0x3eb)]&&_0x5ceb04['sampleData']){const _0x146a21=a30_0x3ab056[_0x1f0a9a(0x397)](_0x1f0a9a(0x342))+'\x20'+a30_0x3ab056[_0x1f0a9a(0x30d)](_0x4cb5a0[_0x1f0a9a(0x3eb)]);await this[_0x1f0a9a(0x2ca)](_0x146a21,_0x5ceb04[_0x1f0a9a(0x329)]);}else{if(_0x4cb5a0[_0x1f0a9a(0x308)]&&_0x5ceb04[_0x1f0a9a(0x329)]){const _0x445722=a30_0x3ab056['dim']('Enriched:')+'\x20'+a30_0x3ab056[_0x1f0a9a(0x30d)](_0x1f0a9a(0x368));await this[_0x1f0a9a(0x2ca)](_0x445722,_0x5ceb04[_0x1f0a9a(0x329)]);}else!_0x5ceb04[_0x1f0a9a(0x329)]&&console[_0x1f0a9a(0x353)](_0x1f0a9a(0x1ee));}}}if(_0x5ceb04['errors'][_0x1f0a9a(0x1dc)]>0x0){console[_0x1f0a9a(0x353)]('─'['repeat'](0x3c)),console[_0x1f0a9a(0x353)]('\x0a'+a30_0x3ab056[_0x1f0a9a(0x269)]('Errors:'));for(const _0x1c14f8 of _0x5ceb04[_0x1f0a9a(0x284)]){console[_0x1f0a9a(0x353)]('\x20\x20'+a30_0x3ab056['red']('•')+'\x20'+_0x1c14f8);}}}async[a30_0x41ba90(0x2ca)](_0x23000f,_0x39e0dc){const _0x199751=a30_0x41ba90;if(_0x39e0dc[_0x199751(0x1dc)]===0x0){console[_0x199751(0x353)]('\x0a'+_0x23000f),console['error'](_0x199751(0x26a));return;}console[_0x199751(0x353)]('\x0a'+_0x23000f);const _0x3c4cb5=Object[_0x199751(0x357)](_0x39e0dc[0x0])['map'](_0x44b453=>({'name':_0x44b453,'type':typeof _0x39e0dc[0x0][_0x44b453]===_0x199751(0x2e4)?_0x199751(0x1f2):_0x199751(0x312)})),_0x11f576={'queryId':_0x199751(0x3e4),'columns':_0x3c4cb5,'data':_0x39e0dc,'stats':{'state':_0x199751(0x2a3),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x39e0dc['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5e8402=formatAsTable(_0x11f576,_0x39e0dc['length'],!![]);await writeOutput(_0x5e8402,undefined,_0x199751(0x3c3));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x377);['description']='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a30_0x41ba90(0x1db)](_0x9a1235){const _0x388c80=a30_0x41ba90,{options:_0x563579,args:_0x45857b,tdx:_0x3f203c}=_0x9a1235,_0x2bf1f7=_0x563579,_0x1ce035=_0x45857b[0x0]||_0x563579[_0x388c80(0x226)];if(!_0x1ce035)return showParentSegmentNotSetError(_0x388c80(0x2a0)+_0x388c80(0x225)),0x1;const _0x198202=resolveYamlFile(_0x1ce035);if(existsSync(_0x198202)){_0x2bf1f7[_0x388c80(0x340)]&&console[_0x388c80(0x353)]('Found\x20YAML\x20file:\x20'+_0x198202);let _0x2ad437;try{_0x2ad437=readFileSync(_0x198202,_0x388c80(0x2d3));}catch(_0x5b8a85){const _0x5eff60=_0x5b8a85 instanceof Error?_0x5b8a85[_0x388c80(0x1ef)]:String(_0x5b8a85);return console['error']('Error\x20reading\x20file:\x20'+_0x5eff60),0x1;}const _0x43f55c=await withSpinner(_0x388c80(0x350),()=>_0x3f203c['segment']['pushParentYaml'](_0x2ad437),{'verbose':_0x2bf1f7['verbose']}),_0x17297d=_0x43f55c[_0x388c80(0x27a)],{isNew:_0x1bd787,name:_0x5f5079,hasChanges:_0x582c71,diffFormatted:_0xfc9abb}=_0x17297d;if(_0x582c71){_0x1bd787?console[_0x388c80(0x353)](_0x388c80(0x22d)+_0x5f5079+'\x27:'):console[_0x388c80(0x353)](_0x388c80(0x2ae)+_0x5f5079+'\x27:');console[_0x388c80(0x353)]('─'['repeat'](0x3c)),console[_0x388c80(0x353)](_0xfc9abb),console[_0x388c80(0x353)]('─'[_0x388c80(0x2df)](0x3c));const _0xe627b2=_0x1bd787?_0x388c80(0x235)+_0x5f5079+_0x388c80(0x38d):_0x388c80(0x3ac)+_0x5f5079+_0x388c80(0x38d);if(!_0x2bf1f7[_0x388c80(0x1f4)]){if(!isInteractive())return console[_0x388c80(0x353)](a30_0x3ab056[_0x388c80(0x269)]('\x0aError:'),_0x388c80(0x319)),console[_0x388c80(0x353)](a30_0x3ab056[_0x388c80(0x397)](_0x388c80(0x3e2))),0x1;const _0x301e50=await confirmKey(_0xe627b2);if(!_0x301e50)return console[_0x388c80(0x353)](a30_0x3ab056[_0x388c80(0x32d)](_0x388c80(0x388))),0x1;}const _0x1f0483=_0x1bd787?'Creating':_0x388c80(0x2a6);await withSpinner(_0x1f0483+_0x388c80(0x33c)+_0x5f5079+_0x388c80(0x277),()=>_0x17297d[_0x388c80(0x3a8)](),{'verbose':_0x2bf1f7[_0x388c80(0x340)]});const _0x21bb86=_0x1bd787?'Created':_0x388c80(0x2ad);console['error']('✔\x20'+_0x21bb86+_0x388c80(0x33c)+_0x5f5079+'\x27');}else console[_0x388c80(0x353)](_0x388c80(0x241)+_0x5f5079+_0x388c80(0x2bf));}const _0x5bf9a5=await withSpinner(_0x388c80(0x230)+_0x1ce035+_0x388c80(0x277),()=>_0x3f203c['segment'][_0x388c80(0x2f9)](_0x1ce035),{'verbose':_0x2bf1f7[_0x388c80(0x340)]}),_0x3fbd0b=_0x5bf9a5[_0x388c80(0x27a)],_0x2d1168=getConsoleUrl(_0x2bf1f7[_0x388c80(0x2f8)],_0x388c80(0x364)+_0x3fbd0b['workflowId']+_0x388c80(0x1f0)+_0x3fbd0b['workflowSessionId']+'/attempt/'+_0x3fbd0b['workflowAttemptId']);return console[_0x388c80(0x353)](_0x388c80(0x301)),console['error']('\x20\x20'+a30_0x3ab056[_0x388c80(0x397)](_0x388c80(0x2fb))+'\x20'+_0x3fbd0b['audienceId']),console['error']('\x20\x20'+a30_0x3ab056[_0x388c80(0x397)](_0x388c80(0x351))+'\x20'+_0x3fbd0b[_0x388c80(0x285)]),console['error']('\x20\x20'+a30_0x3ab056['dim']('Session:')+'\x20'+_0x3fbd0b[_0x388c80(0x392)]),console[_0x388c80(0x353)]('\x20\x20'+a30_0x3ab056[_0x388c80(0x397)](_0x388c80(0x38b))+'\x20'+_0x3fbd0b[_0x388c80(0x268)]),console[_0x388c80(0x353)]('\x20\x20'+_0x2d1168),console[_0x388c80(0x353)]('\x0a'+a30_0x3ab056[_0x388c80(0x397)](_0x388c80(0x24c))+_0x388c80(0x251)+_0x3fbd0b['workflowAttemptId']+_0x388c80(0x39e)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x365);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x3e5);async[a30_0x41ba90(0x1db)](_0x4742c0){const _0xfb6e62=a30_0x41ba90,{options:_0x51a0e2,args:_0x1616b4,tdx:_0x329c96}=_0x4742c0,_0x5483b0=_0x1616b4[0x0]||_0x51a0e2[_0xfb6e62(0x226)];if(!_0x5483b0)return showParentSegmentNotSetError(_0xfb6e62(0x32b)+_0xfb6e62(0x231)),0x1;_0x51a0e2['verbose']&&(console[_0xfb6e62(0x353)](_0xfb6e62(0x34f)+_0x51a0e2[_0xfb6e62(0x2f8)]),console[_0xfb6e62(0x353)](_0xfb6e62(0x238)+_0x5483b0));const _0x4cf7d6=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x5483b0+_0xfb6e62(0x277),()=>_0x329c96['segment']['listFields'](_0x5483b0),{'verbose':_0x51a0e2[_0xfb6e62(0x340)]}),_0x34223f=_0x4cf7d6[_0xfb6e62(0x27a)];console[_0xfb6e62(0x353)](_0xfb6e62(0x2e7)+_0x34223f[_0xfb6e62(0x1dc)]+_0xfb6e62(0x252)+(_0x34223f[_0xfb6e62(0x1dc)]!==0x1?'s':''));if(_0x51a0e2[_0xfb6e62(0x242)]||_0x51a0e2[_0xfb6e62(0x219)])return await handleSDKOutput(_0x34223f,_0x51a0e2),0x0;return displayFieldsHumanReadable(_0x34223f,_0x5483b0),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='segment:parent:view';[a30_0x41ba90(0x38a)]='Show\x20parent\x20segment\x20details';async['execute'](_0x2fad35){const _0x2a5fbf=a30_0x41ba90,{options:_0x2df8c5,args:_0x2d0122,tdx:_0x2daee4}=_0x2fad35,_0x51b760=_0x2df8c5,_0x51007b=_0x2d0122[0x0]||_0x2df8c5[_0x2a5fbf(0x226)];if(!_0x51007b)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'+_0x2a5fbf(0x1f6)+_0x2a5fbf(0x346)+_0x2a5fbf(0x1fb)),0x1;_0x2df8c5[_0x2a5fbf(0x340)]&&(console['error']('Site:\x20'+_0x2df8c5[_0x2a5fbf(0x2f8)]),console[_0x2a5fbf(0x353)]('Parent\x20segment:\x20'+_0x51007b));const _0xc46ee2=await withSpinner(_0x2a5fbf(0x36e)+_0x51007b+_0x2a5fbf(0x277),()=>_0x2daee4[_0x2a5fbf(0x2c3)][_0x2a5fbf(0x2f4)](_0x51007b),{'verbose':_0x2df8c5['verbose']}),_0x3cc920=_0xc46ee2[_0x2a5fbf(0x27a)];if(_0x51b760[_0x2a5fbf(0x1d6)]){const _0x2130da=getConsoleNextUrl(_0x51b760[_0x2a5fbf(0x2f8)],'/app/dw/parentSegments/'+_0x3cc920['id']);return console[_0x2a5fbf(0x353)](a30_0x3ab056[_0x2a5fbf(0x3af)]('✔')+_0x2a5fbf(0x3c2)+a30_0x3ab056[_0x2a5fbf(0x35f)](_0x2130da)),openBrowser(_0x2130da),0x0;}return await handleSingleObjectOutput(_0x3cc920,_0x2df8c5),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']='segment:parent:desc';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x23b);async['execute'](_0x4cf504){const _0x5f09f0=a30_0x41ba90,{options:_0xf22935,args:_0x6b8778,tdx:_0x5badf8}=_0x4cf504,_0x11d0f5=_0xf22935,_0x4360bf=_0x6b8778[0x0]||_0xf22935[_0x5f09f0(0x226)];if(!_0x4360bf)return showParentSegmentNotSetError(_0x5f09f0(0x1d4)+_0x5f09f0(0x220)+_0x5f09f0(0x346)+_0x5f09f0(0x3d0)),0x1;_0xf22935[_0x5f09f0(0x340)]&&(console['error']('Site:\x20'+_0xf22935[_0x5f09f0(0x2f8)]),console[_0x5f09f0(0x353)](_0x5f09f0(0x238)+_0x4360bf));const _0x77d47=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4360bf+'\x27...',()=>_0x5badf8[_0x5f09f0(0x2c3)][_0x5f09f0(0x361)](_0x4360bf),{'verbose':_0xf22935[_0x5f09f0(0x340)]}),_0x2a05b1=_0x77d47[_0x5f09f0(0x27a)],_0x1e9e5d=_0x5badf8['segment'][_0x5f09f0(0x372)](_0x2a05b1);if(_0x11d0f5[_0x5f09f0(0x31f)]){const _0x381d94=await this['collectSchema'](_0x4cf504,_0x4360bf,_0x2a05b1,_0x1e9e5d),_0x4fc45f=this[_0x5f09f0(0x3b5)](_0x381d94);writeFileSync(_0x11d0f5[_0x5f09f0(0x31f)],_0x4fc45f);const _0x5a0489=_0x381d94['customers'][_0x5f09f0(0x29e)][_0x5f09f0(0x1dc)]+_0x381d94[_0x5f09f0(0x29c)][_0x5f09f0(0x281)]((_0x143507,_0x2b350b)=>_0x143507+_0x2b350b[_0x5f09f0(0x29e)][_0x5f09f0(0x1dc)],0x0),_0x57d2ed=_0x381d94[_0x5f09f0(0x29c)][_0x5f09f0(0x331)](_0x471ab5=>_0x471ab5[_0x5f09f0(0x29e)][_0x5f09f0(0x1dc)]===0x0)[_0x5f09f0(0x1dc)];return console[_0x5f09f0(0x276)](_0x5f09f0(0x290)+_0x11d0f5[_0x5f09f0(0x31f)]),console[_0x5f09f0(0x276)]('\x20\x20Database:\x20'+_0x1e9e5d),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x381d94[_0x5f09f0(0x29c)][_0x5f09f0(0x1dc)]+_0x5f09f0(0x30a)),console['log'](_0x5f09f0(0x223)+_0x5a0489+_0x5f09f0(0x2f1)),_0x57d2ed>0x0&&console[_0x5f09f0(0x276)](_0x5f09f0(0x2d0)+_0x57d2ed+_0x5f09f0(0x29d)),0x0;}console[_0x5f09f0(0x353)]('\x0a'+a30_0x3ab056[_0x5f09f0(0x30d)](_0x5f09f0(0x373))+'\x20'+a30_0x3ab056[_0x5f09f0(0x35f)](_0x1e9e5d));const _0xc68265=await withSpinner(_0x5f09f0(0x3c1),()=>_0x5badf8[_0x5f09f0(0x2c3)][_0x5f09f0(0x21a)](_0x2a05b1),{'verbose':_0xf22935[_0x5f09f0(0x340)]});console[_0x5f09f0(0x353)]('\x0a'+a30_0x3ab056[_0x5f09f0(0x30d)](_0x5f09f0(0x35b))+'\x20'+a30_0x3ab056['dim']('('+_0x1e9e5d+_0x5f09f0(0x28f)));const _0x2f1661=await executeSchemaQuery(_0xc68265[_0x5f09f0(0x27a)],_0x5badf8,_0xf22935);await handleQueryOutput(_0x2f1661,_0xf22935);const _0x4da09d=await withSpinner(_0x5f09f0(0x201),()=>_0x5badf8['segment'][_0x5f09f0(0x3d3)](_0x2a05b1),{'verbose':_0xf22935[_0x5f09f0(0x340)]});for(const _0x473ded of _0x4da09d[_0x5f09f0(0x27a)]){const _0x188d7f=_0x5f09f0(0x3c0)+_0x473ded[_0x5f09f0(0x317)]()['replace'](/\s+/g,'_'),_0x23c687=_0x5f09f0(0x3d1)+_0x1e9e5d+'.'+_0x188d7f;console[_0x5f09f0(0x353)]('\x0a'+a30_0x3ab056[_0x5f09f0(0x30d)](_0x473ded)+'\x20'+a30_0x3ab056[_0x5f09f0(0x397)]('('+_0x1e9e5d+'.'+_0x188d7f+')'));try{const _0x30895a=await executeSchemaQuery(_0x23c687,_0x5badf8,_0xf22935);await handleQueryOutput(_0x30895a,_0xf22935);}catch{console[_0x5f09f0(0x353)](a30_0x3ab056['yellow'](_0x5f09f0(0x3e7)));}}return 0x0;}async[a30_0x41ba90(0x3de)](_0xd90f98,_0x4c5282,_0x3fbda5,_0x29af99){const _0x112786=a30_0x41ba90,{options:_0x58c575,tdx:_0x16a4ba}=_0xd90f98,_0x2ffa7a=await withSpinner(_0x112786(0x3c1),()=>_0x16a4ba['segment'][_0x112786(0x21a)](_0x3fbda5),{'verbose':_0x58c575[_0x112786(0x340)]}),_0x1e2839=await executeSchemaQuery(_0x2ffa7a['data'],_0x16a4ba,_0x58c575),_0x34c93f=_0x1e2839[_0x112786(0x27a)]['map'](_0x2e8838=>({'name':_0x2e8838[_0x112786(0x3d7)],'type':_0x2e8838[_0x112786(0x3bc)]})),_0x58074c=await withSpinner(_0x112786(0x201),()=>_0x16a4ba[_0x112786(0x2c3)][_0x112786(0x3d3)](_0x3fbda5),{'verbose':_0x58c575[_0x112786(0x340)]}),_0x2f047c=[];for(const _0x344649 of _0x58074c['data']){const _0x445873=_0x112786(0x3c0)+_0x344649['toLowerCase']()[_0x112786(0x33e)](/\s+/g,'_'),_0x2f3cc0=_0x112786(0x3d1)+_0x29af99+'.'+_0x445873;let _0xe2ef8a=[];try{const _0x34a3c7=await executeSchemaQuery(_0x2f3cc0,_0x16a4ba,_0x58c575);_0xe2ef8a=_0x34a3c7[_0x112786(0x27a)]['map'](_0x4bd400=>({'name':_0x4bd400['column_name'],'type':_0x4bd400['column_type']}));}catch{}_0x2f047c[_0x112786(0x360)]({'table':_0x445873,'columns':_0xe2ef8a});}return{'database':_0x29af99,'parent_segment':_0x4c5282,'parent_id':_0x3fbda5,'customers':{'table':_0x112786(0x35b),'columns':_0x34c93f},'behaviors':_0x2f047c};}[a30_0x41ba90(0x3b5)](_0x49d33c){const _0x192f53=a30_0x41ba90,_0x10782d=_0x28d259=>{const _0x494193=a30_0x49a8;if(_0x28d259[_0x494193(0x1dc)]===0x0)return'[]';const _0x174b85=_0x28d259[_0x494193(0x20b)](_0x17b95a=>_0x494193(0x2bb)+_0x17b95a['name']+_0x494193(0x2a5)+_0x17b95a[_0x494193(0x1e4)]+_0x494193(0x303));return'[\x0a'+_0x174b85[_0x494193(0x20d)](',\x0a')+_0x494193(0x3c6);},_0x199245=_0x49d33c[_0x192f53(0x29c)][_0x192f53(0x20b)](_0x475396=>{const _0x52eaf5=_0x192f53;return _0x52eaf5(0x22b)+_0x475396['table']+_0x52eaf5(0x24d)+_0x10782d(_0x475396[_0x52eaf5(0x29e)])['replace'](/^/gm,'\x20\x20')['trim']()+'\x0a\x20\x20\x20\x20}';})[_0x192f53(0x20d)](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x49d33c['database']+_0x192f53(0x315)+_0x49d33c['parent_segment']+_0x192f53(0x321)+_0x49d33c[_0x192f53(0x3ae)]+_0x192f53(0x1ea)+_0x49d33c[_0x192f53(0x35b)][_0x192f53(0x3c3)]+_0x192f53(0x1e7)+_0x10782d(_0x49d33c['customers']['columns'])[_0x192f53(0x33e)](/^/gm,'\x20\x20')[_0x192f53(0x291)]()+_0x192f53(0x2b7)+_0x199245+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x2da);[a30_0x41ba90(0x38a)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a30_0x41ba90(0x1db)](_0x38efb0){const _0x290ca7=a30_0x41ba90,{options:_0xc014de,args:_0x4628fd,tdx:_0x5e4543}=_0x38efb0,_0x2967ce=_0x4628fd[0x0]||_0xc014de[_0x290ca7(0x226)];if(!_0x2967ce)return showParentSegmentNotSetError(_0x290ca7(0x20c)+'\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;_0xc014de[_0x290ca7(0x340)]&&(console['error']('Site:\x20'+_0xc014de[_0x290ca7(0x2f8)]),console[_0x290ca7(0x353)]('Parent\x20segment:\x20'+_0x2967ce));const _0x4d45f0=await withSpinner(_0x290ca7(0x324)+_0x2967ce+_0x290ca7(0x277),()=>_0x5e4543['segment'][_0x290ca7(0x361)](_0x2967ce),{'verbose':_0xc014de[_0x290ca7(0x340)]}),_0x2ed414=_0x4d45f0['data'],_0x35f169=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x2967ce+'\x27...',()=>_0x5e4543[_0x290ca7(0x2c3)][_0x290ca7(0x21a)](_0x2ed414),{'verbose':_0xc014de['verbose']}),_0x5ee75a=_0x35f169[_0x290ca7(0x27a)];return _0xc014de[_0x290ca7(0x224)]===_0x290ca7(0x242)||_0xc014de['format']===_0x290ca7(0x219)?await handleSDKOutput([{'sql':_0x5ee75a}],_0xc014de):console['log'](_0x5ee75a),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x36d);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x2fa);async['execute'](_0x42be2d){const _0x231b48=a30_0x41ba90,{options:_0xa7cd55,args:_0xc1c908,tdx:_0x167471}=_0x42be2d,_0x4ebb23=_0xc1c908[0x0]||_0xa7cd55[_0x231b48(0x226)];if(!_0x4ebb23)return showParentSegmentNotSetError(_0x231b48(0x2f0)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0xa7cd55['verbose']&&(console[_0x231b48(0x353)]('Site:\x20'+_0xa7cd55[_0x231b48(0x2f8)]),console['error'](_0x231b48(0x238)+_0x4ebb23));const _0x4a8379=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4ebb23+_0x231b48(0x277),()=>_0x167471['segment'][_0x231b48(0x361)](_0x4ebb23),{'verbose':_0xa7cd55['verbose']}),_0x9d02d2=_0x4a8379[_0x231b48(0x27a)],_0x570f05=await withSpinner(_0x231b48(0x36a)+_0x4ebb23+_0x231b48(0x277),()=>_0x167471[_0x231b48(0x2c3)][_0x231b48(0x21a)](_0x9d02d2),{'verbose':_0xa7cd55[_0x231b48(0x340)]});let _0x445803=_0x570f05['data'];const _0x52a244=resolveLimit(_0xa7cd55['limit'],DEFAULT_DISPLAY_LIMIT),_0x1799e4=/\bLIMIT\s+\d+/i[_0x231b48(0x2b3)](_0x445803);!_0x1799e4&&(_0x445803=_0x445803[_0x231b48(0x291)]()['replace'](/;+$/,''),_0x445803='SELECT\x20*\x20FROM\x20(\x0a'+_0x445803+_0x231b48(0x347)+_0x52a244);_0xa7cd55['verbose']&&console['error'](_0x231b48(0x341)+_0x445803);const _0x4d8829=await withProgressSpinner(_0x231b48(0x1f5),async _0x351efc=>{const _0x49a67f=_0x231b48,_0x339cd2=await _0x167471[_0x49a67f(0x32e)][_0x49a67f(0x1db)](_0x445803,{'catalog':'td','schema':'information_schema','onJobId':_0x3974af=>{_0x351efc['setJobId'](_0x3974af);}});return _0x339cd2;},{'verbose':_0xa7cd55[_0x231b48(0x340)]}),_0x4e5308=_0x4d8829[_0x231b48(0x27a)],_0x188c49=_0x4e5308[_0x231b48(0x1e3)]?_0x231b48(0x38f)+_0x4e5308[_0x231b48(0x1e3)]+']':'';return console[_0x231b48(0x353)](_0x231b48(0x2a8)+_0x4e5308[_0x231b48(0x297)][_0x231b48(0x253)][_0x231b48(0x3ab)]()+_0x231b48(0x2cd)+(_0x231b48(0x1eb)+formatElapsed(_0x4e5308[_0x231b48(0x297)][_0x231b48(0x23e)])+_0x188c49)),await handleQueryOutput(_0x4e5308,_0xa7cd55),0x0;}}export class PSRtListCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x32f);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x25b);async[a30_0x41ba90(0x1db)](_0x5c5f8f){const _0x552a8b=a30_0x41ba90,{options:_0x480eb1,args:_0x518898,tdx:_0x134350}=_0x5c5f8f,_0x1eda18=_0x518898[0x0],_0x20f2f2=await withSpinner(_0x1eda18?_0x552a8b(0x29b)+_0x1eda18+_0x552a8b(0x277):_0x552a8b(0x3e9),()=>_0x134350[_0x552a8b(0x2fe)][_0x552a8b(0x212)](),{'verbose':_0x480eb1['verbose']});let _0x2fe016=_0x20f2f2[_0x552a8b(0x27a)][_0x552a8b(0x331)](_0x988066=>_0x988066[_0x552a8b(0x2c2)]);if(_0x1eda18){const _0x3b8c67=_0x1eda18[_0x552a8b(0x33e)](/[.+^${}()|[\]\\]/g,_0x552a8b(0x258))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4f3e1a=new RegExp('^'+_0x3b8c67+'$','i');_0x2fe016=_0x2fe016[_0x552a8b(0x331)](_0x5954ad=>_0x4f3e1a['test'](_0x5954ad['name']));}_0x2fe016[_0x552a8b(0x2dd)]((_0x167da2,_0x4404b0)=>_0x167da2[_0x552a8b(0x1d8)]['localeCompare'](_0x4404b0[_0x552a8b(0x1d8)])),console[_0x552a8b(0x353)]('✔\x20Found\x20'+_0x2fe016['length']+_0x552a8b(0x2ab)+(_0x2fe016['length']!==0x1?'s':''));const _0x37b955=_0x565e07=>{const _0x4c084f=_0x552a8b;return getConsoleNextUrl(_0x480eb1[_0x4c084f(0x2f8)],'/app/dw/parentSegments/'+_0x565e07);};if(_0x480eb1[_0x552a8b(0x224)]===_0x552a8b(0x242)||_0x480eb1['format']==='jsonl'){const _0x22945a=_0x2fe016[_0x552a8b(0x20b)](_0x12750b=>({..._0x12750b,'url':_0x37b955(_0x12750b['id'])}));await handleSDKOutput(_0x22945a,_0x480eb1);}else{if(_0x2fe016[_0x552a8b(0x1dc)]===0x0)console['log'](_0x552a8b(0x24b));else for(const _0x4f19a7 of _0x2fe016){const _0x3099b6=_0x4f19a7[_0x552a8b(0x1f3)]?a30_0x3ab056['dim']('\x20('+formatRows(_0x4f19a7['population'])+')'):'',_0x35667a=hyperlink(_0x4f19a7[_0x552a8b(0x1d8)],_0x37b955(_0x4f19a7['id']));console['log']('⚡\x20'+_0x35667a+_0x3099b6);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x29a);[a30_0x41ba90(0x38a)]='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a30_0x41ba90(0x1db)](_0x4839ef){const _0x2dd6ce=a30_0x41ba90,{options:_0x6fedf6,args:_0x4f7b63,tdx:_0x5ad33c}=_0x4839ef,_0x290197=_0x4f7b63[0x0]||_0x6fedf6[_0x2dd6ce(0x226)];if(!_0x290197)return showParentSegmentNotSetError(_0x2dd6ce(0x2ed)+_0x2dd6ce(0x306)),0x1;const _0x5e9f6b=resolveYamlFile(_0x290197);if(!existsSync(_0x5e9f6b))return showFileNotFoundError(_0x5e9f6b,_0x290197),0x1;let _0xd95e1e;try{_0xd95e1e=readFileSync(_0x5e9f6b,_0x2dd6ce(0x2d3));}catch(_0x219a11){const _0x93572=_0x219a11 instanceof Error?_0x219a11[_0x2dd6ce(0x1ef)]:String(_0x219a11);return console[_0x2dd6ce(0x353)](_0x2dd6ce(0x236)+_0x93572),0x1;}const _0x122c37=createCommandSpinner(a30_0x3ab056[_0x2dd6ce(0x397)](_0x2dd6ce(0x25a)),{'verbose':_0x6fedf6[_0x2dd6ce(0x340)]});_0x122c37['start']();const _0x367c7a={'realtime':!![],'onProgress':_0x26eb57=>{const _0x123dfc=_0x2dd6ce;_0x122c37[_0x123dfc(0x37c)]=formatProgressMessage(_0x26eb57);}};let _0x44dad4;try{_0x44dad4=await _0x5ad33c[_0x2dd6ce(0x2c3)][_0x2dd6ce(0x2e5)](_0xd95e1e,_0x367c7a),_0x122c37['stop']();}catch(_0x29e1e8){_0x122c37[_0x2dd6ce(0x2de)]();throw _0x29e1e8;}console[_0x2dd6ce(0x353)]('\x0a'+a30_0x3ab056[_0x2dd6ce(0x30d)](_0x2dd6ce(0x264))+'\x20'+_0x44dad4[_0x2dd6ce(0x1d8)]),console[_0x2dd6ce(0x353)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x44dad4),console[_0x2dd6ce(0x353)]('─'[_0x2dd6ce(0x2df)](0x3c));if(_0x44dad4['errors'][_0x2dd6ce(0x1dc)]>0x0){console[_0x2dd6ce(0x353)]('\x0a'+a30_0x3ab056[_0x2dd6ce(0x269)](_0x2dd6ce(0x309)));for(const _0x54e9b2 of _0x44dad4[_0x2dd6ce(0x284)]){console[_0x2dd6ce(0x353)]('\x20\x20'+a30_0x3ab056['red']('•')+'\x20'+_0x54e9b2);}}return _0x44dad4[_0x2dd6ce(0x1d7)]&&console[_0x2dd6ce(0x353)]('\x0a'+a30_0x3ab056[_0x2dd6ce(0x3af)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x44dad4[_0x2dd6ce(0x1d7)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:rt:jn:list';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x23f);async[a30_0x41ba90(0x1db)](_0x32afae){const _0x2d9897=a30_0x41ba90,{options:_0x359c33,args:_0x5151a1,tdx:_0x5e1222}=_0x32afae,_0x2a8f0f=_0x5151a1[0x0]||_0x359c33[_0x2d9897(0x226)];if(!_0x2a8f0f)return showParentSegmentNotSetError(_0x2d9897(0x31e)+_0x2d9897(0x1d2)),0x1;_0x359c33[_0x2d9897(0x340)]&&(console[_0x2d9897(0x353)](_0x2d9897(0x34f)+_0x359c33[_0x2d9897(0x2f8)]),console[_0x2d9897(0x353)]('Parent\x20segment:\x20'+_0x2a8f0f));const _0x34a6bb=await withSpinner(_0x2d9897(0x324)+_0x2a8f0f+_0x2d9897(0x277),()=>_0x5e1222[_0x2d9897(0x2c3)][_0x2d9897(0x361)](_0x2a8f0f),{'verbose':_0x359c33['verbose']}),_0x11aa6f=_0x34a6bb[_0x2d9897(0x27a)],_0x5554e5=await withSpinner(_0x2d9897(0x3df)+_0x2a8f0f+'\x27...',()=>_0x5e1222['realtime'][_0x2d9897(0x2cb)](_0x11aa6f),{'verbose':_0x359c33[_0x2d9897(0x340)]}),_0x1d7ad6=_0x5554e5[_0x2d9897(0x27a)];console['error'](_0x2d9897(0x2e7)+_0x1d7ad6[_0x2d9897(0x1dc)]+'\x20RT\x20journey'+(_0x1d7ad6[_0x2d9897(0x1dc)]!==0x1?'s':''));if(_0x359c33[_0x2d9897(0x224)]===_0x2d9897(0x242)||_0x359c33[_0x2d9897(0x224)]===_0x2d9897(0x219))await handleSDKOutput(_0x1d7ad6,_0x359c33);else{if(_0x1d7ad6['length']===0x0)console['log'](_0x2d9897(0x3bd));else for(const _0x3b20da of _0x1d7ad6){const _0x30481d=_0x3b20da[_0x2d9897(0x20a)]===_0x2d9897(0x255)?'🚀':'📝',_0x2f48f2=_0x3b20da[_0x2d9897(0x3a0)]?a30_0x3ab056['yellow']('\x20(paused)'):'',_0x1f2c82=a30_0x3ab056['dim']('\x20('+_0x3b20da[_0x2d9897(0x233)]+'\x20stage'+(_0x3b20da['stageCount']!==0x1?'s':'')+')');console['log'](_0x30481d+'\x20'+_0x3b20da['name']+_0x2f48f2+_0x1f2c82);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:rt:jn:pause';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x39c);async[a30_0x41ba90(0x1db)](_0x28d0e7){const _0xf591a5=a30_0x41ba90,{options:_0x199f59,args:_0x57d25f,tdx:_0x4280c1}=_0x28d0e7,_0x161a1e=_0x57d25f[0x0];if(!_0x161a1e)return console[_0xf591a5(0x353)](a30_0x3ab056[_0xf591a5(0x269)](_0xf591a5(0x261))),console[_0xf591a5(0x353)](_0xf591a5(0x32a)),console[_0xf591a5(0x353)](a30_0x3ab056['dim'](_0xf591a5(0x256))),0x1;_0x199f59['verbose']&&(console[_0xf591a5(0x353)](_0xf591a5(0x34f)+_0x199f59[_0xf591a5(0x2f8)]),console[_0xf591a5(0x353)](_0xf591a5(0x279)+_0x161a1e));const _0x51f443=await withSpinner(_0xf591a5(0x213)+_0x161a1e+_0xf591a5(0x277),()=>_0x4280c1[_0xf591a5(0x2fe)][_0xf591a5(0x334)](_0x161a1e),{'verbose':_0x199f59[_0xf591a5(0x340)]}),_0x5a7e03=_0x51f443[_0xf591a5(0x27a)];console[_0xf591a5(0x353)](_0xf591a5(0x3e0)+_0x5a7e03['name']+'\x27');if(_0x199f59[_0xf591a5(0x224)]===_0xf591a5(0x242)||_0x199f59[_0xf591a5(0x224)]===_0xf591a5(0x219))await handleSDKOutput([_0x5a7e03],_0x199f59);else{const _0x48363c=_0x5a7e03['state']===_0xf591a5(0x255)?'🚀':'📝',_0x4e7e23=_0x5a7e03['paused']?a30_0x3ab056['yellow'](_0xf591a5(0x28c)):'';console[_0xf591a5(0x276)](_0x48363c+'\x20'+_0x5a7e03[_0xf591a5(0x1d8)]+_0x4e7e23);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x3dc);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x39d);async[a30_0x41ba90(0x1db)](_0x529c6f){const _0x16a36f=a30_0x41ba90,{options:_0x46f794,args:_0x155786,tdx:_0x29ebbc}=_0x529c6f,_0x1797fc=_0x155786[0x0];if(!_0x1797fc)return console[_0x16a36f(0x353)](a30_0x3ab056['red'](_0x16a36f(0x261))),console[_0x16a36f(0x353)](_0x16a36f(0x2f6)),console[_0x16a36f(0x353)](a30_0x3ab056[_0x16a36f(0x397)](_0x16a36f(0x256))),0x1;_0x46f794[_0x16a36f(0x340)]&&(console['error']('Site:\x20'+_0x46f794[_0x16a36f(0x2f8)]),console[_0x16a36f(0x353)](_0x16a36f(0x279)+_0x1797fc));const _0x3e68e3=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1797fc+_0x16a36f(0x277),()=>_0x29ebbc[_0x16a36f(0x2fe)][_0x16a36f(0x3aa)](_0x1797fc),{'verbose':_0x46f794[_0x16a36f(0x340)]}),_0x3e9c8c=_0x3e68e3['data'];console['error'](_0x16a36f(0x3ef)+_0x3e9c8c[_0x16a36f(0x1d8)]+'\x27');if(_0x46f794['format']===_0x16a36f(0x242)||_0x46f794[_0x16a36f(0x224)]===_0x16a36f(0x219))await handleSDKOutput([_0x3e9c8c],_0x46f794);else{const _0x4ea4b8=_0x3e9c8c[_0x16a36f(0x20a)]===_0x16a36f(0x255)?'🚀':'📝',_0x24199d=_0x3e9c8c[_0x16a36f(0x3a0)]?a30_0x3ab056[_0x16a36f(0x32d)]('\x20(paused)'):'';console['log'](_0x4ea4b8+'\x20'+_0x3e9c8c[_0x16a36f(0x1d8)]+_0x24199d);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']='ps:rt:configuration_versions';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x389);async[a30_0x41ba90(0x1db)](_0x15bec7){const _0x1943d4=a30_0x41ba90,{options:_0xb49661,args:_0x3bcfa3,tdx:_0x5a1b04}=_0x15bec7,_0x22b389=_0x3bcfa3[0x0]||_0xb49661[_0x1943d4(0x226)];if(!_0x22b389)return showParentSegmentNotSetError(_0x1943d4(0x30f)+_0x1943d4(0x33d)),0x1;_0xb49661['verbose']&&(console[_0x1943d4(0x353)](_0x1943d4(0x34f)+_0xb49661['site']),console[_0x1943d4(0x353)]('Parent\x20segment:\x20'+_0x22b389));const _0x3f915d=await withSpinner(_0x1943d4(0x324)+_0x22b389+_0x1943d4(0x277),()=>_0x5a1b04[_0x1943d4(0x2c3)][_0x1943d4(0x361)](_0x22b389),{'verbose':_0xb49661[_0x1943d4(0x340)]}),_0x401cfa=_0x3f915d['data'],_0x19032f=await withSpinner(_0x1943d4(0x3b2)+_0x22b389+_0x1943d4(0x277),()=>_0x5a1b04[_0x1943d4(0x2fe)]['getCurrentConfigVersion'](_0x401cfa),{'verbose':_0xb49661[_0x1943d4(0x340)]}),_0x45f33c=_0x19032f[_0x1943d4(0x27a)];return console['error'](_0x1943d4(0x307)),_0xb49661['format']===_0x1943d4(0x242)||_0xb49661[_0x1943d4(0x224)]===_0x1943d4(0x219)?await handleSDKOutput([_0x45f33c],_0xb49661):(console[_0x1943d4(0x276)](_0x1943d4(0x263)+_0x45f33c['id']),console[_0x1943d4(0x276)](_0x1943d4(0x27e)+_0x45f33c[_0x1943d4(0x227)]),console['log'](_0x1943d4(0x31a)+_0x45f33c[_0x1943d4(0x22a)]),console[_0x1943d4(0x276)]('eventKind:\x20'+_0x45f33c[_0x1943d4(0x2a4)]),console[_0x1943d4(0x276)](_0x1943d4(0x203)+_0x45f33c[_0x1943d4(0x285)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:pz:service:list';[a30_0x41ba90(0x38a)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async[a30_0x41ba90(0x1db)](_0x1a2d5f){const _0x389c2a=a30_0x41ba90,{options:_0x50605b,args:_0x5ca8b0,tdx:_0x3771a9}=_0x1a2d5f,_0xf9b3ba=_0x5ca8b0[0x0]||_0x50605b[_0x389c2a(0x226)];if(!_0xf9b3ba)return showParentSegmentNotSetError(_0x389c2a(0x1d9)+_0x389c2a(0x20f)),0x1;const _0x1df289=await withSpinner(_0x389c2a(0x324)+_0xf9b3ba+'\x27...',()=>_0x3771a9[_0x389c2a(0x2c3)]['resolveParentId'](_0xf9b3ba),{'verbose':_0x50605b[_0x389c2a(0x340)]}),_0x4ade1f=_0x1df289['data'],_0x2a99c7=await withSpinner(_0x389c2a(0x30c)+_0xf9b3ba+'\x27...',()=>_0x3771a9['personalization'][_0x389c2a(0x212)](_0x4ade1f),{'verbose':_0x50605b[_0x389c2a(0x340)]}),_0x4d9ed2=_0x2a99c7['data'];console[_0x389c2a(0x353)](_0x389c2a(0x2e7)+_0x4d9ed2[_0x389c2a(0x1dc)]+_0x389c2a(0x383)+(_0x4d9ed2[_0x389c2a(0x1dc)]!==0x1?'s':''));if(_0x50605b[_0x389c2a(0x224)]===_0x389c2a(0x242)||_0x50605b[_0x389c2a(0x224)]===_0x389c2a(0x219))await handleSDKOutput(_0x4d9ed2,_0x50605b);else{if(_0x4d9ed2['length']===0x0)console['log'](_0x389c2a(0x2f2)),console['error'](a30_0x3ab056[_0x389c2a(0x35f)](_0x389c2a(0x2ce)));else for(const _0x57c9e3 of _0x4d9ed2){console[_0x389c2a(0x276)](a30_0x3ab056['bold'](_0x57c9e3[_0x389c2a(0x1d8)])+'\x20'+a30_0x3ab056[_0x389c2a(0x397)]('(id:\x20'+_0x57c9e3['id']+')'));_0x57c9e3['description']&&console['log']('\x20\x20'+a30_0x3ab056[_0x389c2a(0x397)](_0x57c9e3[_0x389c2a(0x38a)]));if(_0x57c9e3['tokens']&&_0x57c9e3[_0x389c2a(0x2d6)][_0x389c2a(0x1dc)]>0x0)for(const _0xd405e4 of _0x57c9e3[_0x389c2a(0x2d6)]){const _0x37027b=_0xd405e4[_0x389c2a(0x209)]?.['length']?_0xd405e4['allowedIps'][_0x389c2a(0x20d)](',\x20'):'any';console[_0x389c2a(0x276)]('\x20\x20'+a30_0x3ab056[_0x389c2a(0x35f)](_0x389c2a(0x292))+'\x20'+_0xd405e4['name']+'\x20'+a30_0x3ab056['dim'](_0x389c2a(0x1e8)+_0xd405e4['id']+')')),console['log'](_0x389c2a(0x3b7)+a30_0x3ab056[_0x389c2a(0x397)]('allowed\x20IPs:')+'\x20'+_0x37027b);}else console[_0x389c2a(0x276)]('\x20\x20'+a30_0x3ab056[_0x389c2a(0x397)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:pz:service:create';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x2eb);async[a30_0x41ba90(0x1db)](_0x5ea179){const _0x180206=a30_0x41ba90,{options:_0xa8f845,args:_0x2d95aa,tdx:_0x4238d2}=_0x5ea179,_0x71a6c5=_0xa8f845,_0x12f7e5=_0x2d95aa[0x0],_0x5f0036=_0x2d95aa[0x1]||_0xa8f845[_0x180206(0x226)];if(!_0x12f7e5)return console[_0x180206(0x353)](_0x180206(0x1df)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]'),console[_0x180206(0x353)](_0x180206(0x2d7)),0x1;if(!_0x5f0036)return showParentSegmentNotSetError(_0x180206(0x1d5)+_0x180206(0x2d7)),0x1;const _0x2b5db3=await withSpinner(_0x180206(0x324)+_0x5f0036+_0x180206(0x277),()=>_0x4238d2[_0x180206(0x2c3)][_0x180206(0x361)](_0x5f0036),{'verbose':_0xa8f845[_0x180206(0x340)]}),_0x460069=_0x2b5db3[_0x180206(0x27a)],_0x33cb9e={'name':_0x12f7e5,'description':_0x71a6c5[_0x180206(0x38a)],'public':_0x71a6c5[_0x180206(0x2fd)]},_0x295572=await withSpinner('Creating\x20personalization\x20service\x20\x27'+_0x12f7e5+_0x180206(0x277),()=>_0x4238d2['personalization'][_0x180206(0x2f3)](_0x460069,_0x33cb9e),{'verbose':_0xa8f845[_0x180206(0x340)]}),_0x13d5d1=_0x295572['data'];return console['error']('✔\x20Created\x20personalization\x20service\x20\x27'+_0x13d5d1[_0x180206(0x1d8)]+_0x180206(0x384)+_0x13d5d1['id']),await handleSDKOutput([_0x13d5d1],_0xa8f845),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x2cf);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x322);async[a30_0x41ba90(0x1db)](_0x321ea5){const _0x401c5d=a30_0x41ba90,{options:_0x1c0920,args:_0x539cdb,tdx:_0x48b594}=_0x321ea5,_0x56cd42=_0x539cdb[0x0],_0x2dbaa7=_0x539cdb[0x1]||_0x1c0920[_0x401c5d(0x226)];if(!_0x56cd42)return console[_0x401c5d(0x353)](_0x401c5d(0x222)),console[_0x401c5d(0x353)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x401c5d(0x353)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x2dbaa7)return showParentSegmentNotSetError(_0x401c5d(0x237)+_0x401c5d(0x34a)),0x1;const _0x1da585=await withSpinner(_0x401c5d(0x324)+_0x2dbaa7+_0x401c5d(0x277),()=>_0x48b594['segment']['resolveParentId'](_0x2dbaa7),{'verbose':_0x1c0920[_0x401c5d(0x340)]}),_0x16bec4=_0x1da585[_0x401c5d(0x27a)],_0x5eadc0=await withSpinner(_0x401c5d(0x247)+_0x56cd42+'\x27...',()=>_0x48b594[_0x401c5d(0x1de)][_0x401c5d(0x326)](_0x16bec4,_0x56cd42),{'verbose':_0x1c0920[_0x401c5d(0x340)]}),_0x2b1000=_0x5eadc0[_0x401c5d(0x27a)];if(_0x1c0920[_0x401c5d(0x242)]||_0x1c0920['jsonl'])await handleSDKOutput([_0x2b1000],_0x1c0920);else{console[_0x401c5d(0x276)](a30_0x3ab056[_0x401c5d(0x30d)](_0x2b1000[_0x401c5d(0x1d8)])+'\x20'+a30_0x3ab056[_0x401c5d(0x397)]('(id:\x20'+_0x2b1000['id']+')'));_0x2b1000[_0x401c5d(0x38a)]&&console[_0x401c5d(0x276)]('\x20\x20'+a30_0x3ab056[_0x401c5d(0x397)](_0x2b1000[_0x401c5d(0x38a)]));console[_0x401c5d(0x276)]('\x20\x20'+a30_0x3ab056['cyan'](_0x401c5d(0x35e))+'\x20'+(_0x2b1000[_0x401c5d(0x2fd)]?_0x401c5d(0x1f4):'no'));if(_0x2b1000[_0x401c5d(0x2d6)]&&_0x2b1000[_0x401c5d(0x2d6)][_0x401c5d(0x1dc)]>0x0)for(const _0x4b1858 of _0x2b1000[_0x401c5d(0x2d6)]){const _0x15fbac=_0x4b1858[_0x401c5d(0x209)]?.['length']?_0x4b1858[_0x401c5d(0x209)]['join'](',\x20'):_0x401c5d(0x3a9);console[_0x401c5d(0x276)]('\x20\x20'+a30_0x3ab056[_0x401c5d(0x35f)](_0x401c5d(0x292))+'\x20'+_0x4b1858[_0x401c5d(0x1d8)]+'\x20'+a30_0x3ab056[_0x401c5d(0x397)](_0x401c5d(0x1e8)+_0x4b1858['id']+')')),console[_0x401c5d(0x276)](_0x401c5d(0x3b7)+a30_0x3ab056['dim'](_0x401c5d(0x367))+'\x20'+_0x15fbac);}else console['log']('\x20\x20'+a30_0x3ab056[_0x401c5d(0x397)](_0x401c5d(0x344)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x3e8);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x29f);async[a30_0x41ba90(0x1db)](_0x2650c4){const _0x39c279=a30_0x41ba90,{options:_0x2ad370,args:_0x25b5fd,tdx:_0x3fdfb5}=_0x2650c4,_0x1f0e84=_0x25b5fd[0x0],_0x239651=_0x25b5fd[0x1]||_0x2ad370['parentSegment'];if(!_0x1f0e84)return console[_0x39c279(0x353)](_0x39c279(0x222)),console[_0x39c279(0x353)](_0x39c279(0x3ba)),console['error'](_0x39c279(0x267)),0x1;if(!_0x239651)return showParentSegmentNotSetError(_0x39c279(0x3a1)+_0x39c279(0x267)),0x1;const _0x1dddae=await withSpinner(_0x39c279(0x324)+_0x239651+_0x39c279(0x277),()=>_0x3fdfb5['segment'][_0x39c279(0x361)](_0x239651),{'verbose':_0x2ad370['verbose']}),_0x4427a0=_0x1dddae[_0x39c279(0x27a)];return await withSpinner(_0x39c279(0x3d5)+_0x1f0e84+'\x27...',()=>_0x3fdfb5['personalization'][_0x39c279(0x3e3)](_0x4427a0,_0x1f0e84),{'verbose':_0x2ad370[_0x39c279(0x340)]}),console[_0x39c279(0x353)](_0x39c279(0x217)+_0x1f0e84+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x325);['description']=a30_0x41ba90(0x1d1);async[a30_0x41ba90(0x1db)](_0x2216b3){const _0x31c5b6=a30_0x41ba90,{options:_0x9a0569,args:_0x18be07,tdx:_0x14b815}=_0x2216b3,_0x15f36b=_0x9a0569,_0x550b2d=_0x18be07[0x0],_0x5f11c9=_0x18be07[0x1]||_0x9a0569[_0x31c5b6(0x226)];if(!_0x550b2d)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console['error'](_0x31c5b6(0x35a)),console[_0x31c5b6(0x353)](_0x31c5b6(0x2e6)),0x1;if(!_0x15f36b[_0x31c5b6(0x1d8)])return console[_0x31c5b6(0x353)](_0x31c5b6(0x3d9)),console['error'](_0x31c5b6(0x35a)),0x1;if(!_0x5f11c9)return showParentSegmentNotSetError(_0x31c5b6(0x34b)+_0x31c5b6(0x2e6)),0x1;const _0x559983=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5f11c9+_0x31c5b6(0x277),()=>_0x14b815[_0x31c5b6(0x2c3)][_0x31c5b6(0x361)](_0x5f11c9),{'verbose':_0x9a0569[_0x31c5b6(0x340)]}),_0x13dbfd=_0x559983[_0x31c5b6(0x27a)],_0x36ef19={'name':_0x15f36b[_0x31c5b6(0x1d8)]};_0x15f36b[_0x31c5b6(0x38a)]!==undefined&&(_0x36ef19[_0x31c5b6(0x38a)]=_0x15f36b[_0x31c5b6(0x38a)]);const _0x3e22a6=await withSpinner(_0x31c5b6(0x204)+_0x550b2d+'\x27...',()=>_0x14b815[_0x31c5b6(0x1de)][_0x31c5b6(0x27f)](_0x13dbfd,_0x550b2d,_0x36ef19),{'verbose':_0x9a0569['verbose']}),_0x132bd5=_0x3e22a6['data'];return console['error']('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x132bd5['name']+'\x27'),await handleSDKOutput([_0x132bd5],_0x9a0569),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x1fd);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x28e);async['execute'](_0x53962f){const _0x111a10=a30_0x41ba90,{options:_0x1c6ec3,args:_0x35c7eb,tdx:_0x1cb8e6}=_0x53962f,_0x277abc=_0x1c6ec3,_0x36e2a3=_0x35c7eb[0x0],_0x2c285c=_0x35c7eb[0x1],_0x416f0d=_0x35c7eb[0x2]||_0x1c6ec3[_0x111a10(0x226)];if(!_0x36e2a3)return console[_0x111a10(0x353)](_0x111a10(0x2c8)),console[_0x111a10(0x353)](_0x111a10(0x2b2)),console['error'](_0x111a10(0x2f7)),0x1;if(!_0x2c285c)return console[_0x111a10(0x353)](_0x111a10(0x222)),console[_0x111a10(0x353)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x111a10(0x353)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x416f0d)return showParentSegmentNotSetError(_0x111a10(0x3a6)+_0x111a10(0x2f7)),0x1;const _0x53a739=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x416f0d+_0x111a10(0x277),()=>_0x1cb8e6['segment'][_0x111a10(0x361)](_0x416f0d),{'verbose':_0x1c6ec3[_0x111a10(0x340)]}),_0xf2e944=_0x53a739[_0x111a10(0x27a)],_0x435bd7={'name':_0x36e2a3};_0x277abc['allowedIps']&&(_0x435bd7[_0x111a10(0x209)]=_0x277abc['allowedIps'][_0x111a10(0x33b)](',')[_0x111a10(0x20b)](_0x46537b=>_0x46537b[_0x111a10(0x291)]()));_0x277abc[_0x111a10(0x38a)]&&(_0x435bd7[_0x111a10(0x38a)]=_0x277abc[_0x111a10(0x38a)]);const _0xe1b4c0=await withSpinner(_0x111a10(0x336)+_0x36e2a3+_0x111a10(0x2ef)+_0x2c285c+'\x27...',()=>_0x1cb8e6[_0x111a10(0x1de)][_0x111a10(0x352)](_0xf2e944,_0x2c285c,_0x435bd7),{'verbose':_0x1c6ec3['verbose']}),_0x191270=_0xe1b4c0[_0x111a10(0x27a)];return console[_0x111a10(0x353)]('✔\x20Created\x20token\x20\x27'+_0x191270[_0x111a10(0x1d8)]+'\x27\x20with\x20ID:\x20'+_0x191270['id']),_0x191270[_0x111a10(0x23d)]&&(console[_0x111a10(0x353)](a30_0x3ab056[_0x111a10(0x32d)]('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console[_0x111a10(0x353)](a30_0x3ab056[_0x111a10(0x35f)](_0x191270[_0x111a10(0x23d)])),console[_0x111a10(0x353)]('')),await handleSDKOutput([_0x191270],_0x1c6ec3),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:pz:service:token:delete';['description']=a30_0x41ba90(0x1e9);async[a30_0x41ba90(0x1db)](_0x1f8745){const _0x509560=a30_0x41ba90,{options:_0x3ca98f,args:_0x25df6b,tdx:_0x5706f0}=_0x1f8745,_0x255c5b=_0x25df6b[0x0],_0x42ecf1=_0x25df6b[0x1]||_0x3ca98f[_0x509560(0x226)];if(!_0x255c5b)return console[_0x509560(0x353)]('Error:\x20Token\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x509560(0x353)](_0x509560(0x22f)),0x1;if(!_0x42ecf1)return showParentSegmentNotSetError(_0x509560(0x216)+_0x509560(0x22f)),0x1;const _0x4cb710=await withSpinner(_0x509560(0x324)+_0x42ecf1+'\x27...',()=>_0x5706f0[_0x509560(0x2c3)]['resolveParentId'](_0x42ecf1),{'verbose':_0x3ca98f['verbose']}),_0x2a01ba=_0x4cb710['data'],_0x4eae1b=await withSpinner(_0x509560(0x24a),()=>_0x5706f0[_0x509560(0x1de)]['list'](_0x2a01ba),{'verbose':_0x3ca98f[_0x509560(0x340)]}),_0x464690=_0x4eae1b[_0x509560(0x27a)];let _0x50b402;for(const _0x44903c of _0x464690){if(_0x44903c[_0x509560(0x2d6)]?.[_0x509560(0x3a3)](_0x59b0f9=>_0x59b0f9['id']===_0x255c5b)){_0x50b402=_0x44903c['id'];break;}}if(!_0x50b402)return console[_0x509560(0x353)](_0x509560(0x2b4)+_0x255c5b+_0x509560(0x21b)),0x1;const _0x20f75e=await withSpinner('Deleting\x20token\x20\x27'+_0x255c5b+_0x509560(0x277),()=>_0x5706f0[_0x509560(0x1de)][_0x509560(0x26e)](_0x2a01ba,_0x50b402,_0x255c5b),{'verbose':_0x3ca98f[_0x509560(0x340)]}),_0x9173c0=_0x20f75e[_0x509560(0x27a)];return console['error'](_0x509560(0x2e0)+(_0x9173c0[_0x509560(0x1d8)]||_0x255c5b)+'\x27'),await handleSDKOutput([_0x9173c0],_0x3ca98f),0x0;}}export class PSPzListCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x218);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x1f1);async['execute'](_0x5e6cd7){const _0x2ed5cc=a30_0x41ba90,{options:_0x3f509a,args:_0x26bfbe,tdx:_0x6d3362}=_0x5e6cd7,_0x24c7fc=_0x26bfbe[0x0]||_0x3f509a[_0x2ed5cc(0x226)];if(!_0x24c7fc)return showParentSegmentNotSetError(_0x2ed5cc(0x316)+_0x2ed5cc(0x3e1)),0x1;const _0xb125d6=await withSpinner(_0x2ed5cc(0x324)+_0x24c7fc+'\x27...',()=>_0x6d3362['segment'][_0x2ed5cc(0x361)](_0x24c7fc),{'verbose':_0x3f509a[_0x2ed5cc(0x340)]}),_0x1530ff=_0xb125d6[_0x2ed5cc(0x27a)],_0x28fbfa=await withSpinner(_0x2ed5cc(0x381)+_0x24c7fc+_0x2ed5cc(0x277),()=>_0x6d3362[_0x2ed5cc(0x1de)]['listPersonalizations'](_0x1530ff),{'verbose':_0x3f509a[_0x2ed5cc(0x340)]}),_0x125499=_0x28fbfa[_0x2ed5cc(0x27a)];console[_0x2ed5cc(0x353)](_0x2ed5cc(0x2e7)+_0x125499[_0x2ed5cc(0x1dc)]+'\x20personalization'+(_0x125499['length']!==0x1?'s':''));if(_0x3f509a[_0x2ed5cc(0x224)]==='json'||_0x3f509a[_0x2ed5cc(0x224)]==='jsonl')await handleSDKOutput(_0x125499,_0x3f509a);else{if(_0x125499['length']===0x0)console[_0x2ed5cc(0x276)]('No\x20personalizations\x20configured');else for(const _0x466a80 of _0x125499){console[_0x2ed5cc(0x276)](a30_0x3ab056[_0x2ed5cc(0x30d)](_0x466a80[_0x2ed5cc(0x1d8)])+'\x20'+a30_0x3ab056[_0x2ed5cc(0x397)](_0x2ed5cc(0x1e8)+_0x466a80['id']+')'));_0x466a80[_0x2ed5cc(0x38a)]&&console['log']('\x20\x20'+a30_0x3ab056[_0x2ed5cc(0x397)](_0x466a80[_0x2ed5cc(0x38a)]));const _0x25cbd9=_0x466a80[_0x2ed5cc(0x3c7)]?.['length']||0x0;console[_0x2ed5cc(0x276)]('\x20\x20'+a30_0x3ab056[_0x2ed5cc(0x35f)](_0x2ed5cc(0x260))+'\x20'+_0x25cbd9);if(_0x466a80[_0x2ed5cc(0x3c7)]&&_0x466a80[_0x2ed5cc(0x3c7)][_0x2ed5cc(0x1dc)]>0x0)for(const _0xdb7fe6 of _0x466a80[_0x2ed5cc(0x3c7)]){console[_0x2ed5cc(0x276)](_0x2ed5cc(0x3ee)+_0xdb7fe6['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x2c7);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x38c);async[a30_0x41ba90(0x1db)](_0x24547c){const _0x5a7895=a30_0x41ba90,{options:_0x3735bc,args:_0x5de61d,tdx:_0x399024}=_0x24547c,_0x3f1eac=_0x5de61d[0x0];if(!_0x3f1eac)return console[_0x5a7895(0x353)](_0x5a7895(0x27d)),console[_0x5a7895(0x353)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x251556=await withSpinner(_0x5a7895(0x3ed)+_0x3f1eac+_0x5a7895(0x277),()=>_0x399024['personalization'][_0x5a7895(0x274)](_0x3f1eac),{'verbose':_0x3735bc['verbose']}),_0x5bb6c2=_0x251556[_0x5a7895(0x27a)];console[_0x5a7895(0x353)](_0x5a7895(0x380)+_0x5bb6c2['name']+'\x27');if(_0x3735bc[_0x5a7895(0x224)]==='json'||_0x3735bc[_0x5a7895(0x224)]===_0x5a7895(0x219))await handleSDKOutput([_0x5bb6c2],_0x3735bc);else{console['log'](a30_0x3ab056[_0x5a7895(0x30d)](_0x5bb6c2[_0x5a7895(0x1d8)])+'\x20'+a30_0x3ab056['dim'](_0x5a7895(0x1e8)+_0x5bb6c2['id']+')'));_0x5bb6c2[_0x5a7895(0x38a)]&&console[_0x5a7895(0x276)]('\x20\x20'+a30_0x3ab056[_0x5a7895(0x397)](_0x5bb6c2[_0x5a7895(0x38a)]));_0x5bb6c2[_0x5a7895(0x227)]&&console['log']('\x20\x20'+a30_0x3ab056[_0x5a7895(0x35f)]('audienceId:')+'\x20'+_0x5bb6c2[_0x5a7895(0x227)]);console[_0x5a7895(0x276)]('\x20\x20'+a30_0x3ab056['cyan']('created:')+'\x20'+_0x5bb6c2[_0x5a7895(0x335)]),console['log']('\x20\x20'+a30_0x3ab056['cyan'](_0x5a7895(0x293))+'\x20'+_0x5bb6c2[_0x5a7895(0x234)]);const _0x22e883=_0x5bb6c2['sections']?.['length']||0x0;console['log']('\x20\x20'+a30_0x3ab056[_0x5a7895(0x35f)](_0x5a7895(0x260))+'\x20'+_0x22e883);if(_0x5bb6c2[_0x5a7895(0x3c7)]&&_0x5bb6c2[_0x5a7895(0x3c7)]['length']>0x0)for(const _0x5c7cab of _0x5bb6c2[_0x5a7895(0x3c7)]){console[_0x5a7895(0x276)](_0x5a7895(0x3b7)+a30_0x3ab056['bold'](_0x5c7cab[_0x5a7895(0x1d8)])+'\x20'+a30_0x3ab056[_0x5a7895(0x397)](_0x5a7895(0x1e8)+_0x5c7cab['id']+')')),_0x5c7cab[_0x5a7895(0x3cf)]&&(console['log'](_0x5a7895(0x275)+a30_0x3ab056[_0x5a7895(0x35f)](_0x5a7895(0x3bf))+'\x20'+_0x5c7cab[_0x5a7895(0x3cf)]['name']),_0x5c7cab[_0x5a7895(0x3cf)][_0x5a7895(0x30e)]?.[_0x5a7895(0x3da)]&&console[_0x5a7895(0x276)](_0x5a7895(0x371)+a30_0x3ab056[_0x5a7895(0x35f)](_0x5a7895(0x3ea))+'\x20'+_0x5c7cab[_0x5a7895(0x3cf)][_0x5a7895(0x30e)][_0x5a7895(0x3da)])),_0x5c7cab['payload']&&console[_0x5a7895(0x276)](_0x5a7895(0x275)+a30_0x3ab056['cyan'](_0x5a7895(0x278))+'\x20'+JSON[_0x5a7895(0x374)](_0x5c7cab[_0x5a7895(0x32c)])),_0x5c7cab['includeSensitive']&&console[_0x5a7895(0x276)](_0x5a7895(0x275)+a30_0x3ab056[_0x5a7895(0x35f)](_0x5a7895(0x283))+_0x5a7895(0x2b6));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:pz:delete';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x229);async[a30_0x41ba90(0x1db)](_0x59597c){const _0x36dbc2=a30_0x41ba90,{options:_0x251a0d,args:_0x59d6ac,tdx:_0x565e9f}=_0x59597c,_0x43f671=_0x59d6ac[0x0];if(!_0x43f671)return console[_0x36dbc2(0x353)](_0x36dbc2(0x27d)),console[_0x36dbc2(0x353)](_0x36dbc2(0x296)),0x1;return await withSpinner(_0x36dbc2(0x210)+_0x43f671+_0x36dbc2(0x277),()=>_0x565e9f[_0x36dbc2(0x1de)]['deletePersonalization'](_0x43f671),{'verbose':_0x251a0d[_0x36dbc2(0x340)]}),console[_0x36dbc2(0x353)](_0x36dbc2(0x310)+_0x43f671+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:pz:create';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x1f9);async[a30_0x41ba90(0x1db)](_0x218efc){const _0x4f0de7=a30_0x41ba90,{options:_0x571776,tdx:_0x3aae3d}=_0x218efc,_0x14a59d=_0x571776;let _0x3d8a89;if(_0x14a59d[_0x4f0de7(0x386)]){_0x3d8a89=await loadJSON(_0x14a59d[_0x4f0de7(0x386)],!![]);if(!_0x3d8a89[_0x4f0de7(0x20e)]?.[_0x4f0de7(0x327)])return console[_0x4f0de7(0x353)](_0x4f0de7(0x25d)),console['error'](_0x4f0de7(0x314)),console['error'](_0x4f0de7(0x35d)),0x1;}else{if(!_0x14a59d[_0x4f0de7(0x1d8)])return console[_0x4f0de7(0x353)](_0x4f0de7(0x2c0)),console[_0x4f0de7(0x353)](_0x4f0de7(0x23c)),console['error'](_0x4f0de7(0x3b4)),0x1;if(_0x14a59d[_0x4f0de7(0x38a)]===undefined)return console[_0x4f0de7(0x353)](_0x4f0de7(0x266)),console[_0x4f0de7(0x353)](_0x4f0de7(0x23c)),console[_0x4f0de7(0x353)](_0x4f0de7(0x3b4)),0x1;if(_0x14a59d[_0x4f0de7(0x2d5)]===undefined)return console[_0x4f0de7(0x353)](_0x4f0de7(0x330)),console[_0x4f0de7(0x353)](_0x4f0de7(0x2e9)),0x1;let _0x3de004=_0x14a59d[_0x4f0de7(0x227)];if(!_0x3de004&&_0x571776[_0x4f0de7(0x226)]){const _0x301ce3=await withSpinner(_0x4f0de7(0x324)+_0x571776[_0x4f0de7(0x226)]+_0x4f0de7(0x277),()=>_0x3aae3d[_0x4f0de7(0x2c3)][_0x4f0de7(0x361)](_0x571776['parentSegment']),{'verbose':_0x571776[_0x4f0de7(0x340)]});_0x3de004=_0x301ce3[_0x4f0de7(0x27a)];}let _0x1acce1;_0x14a59d[_0x4f0de7(0x3c7)]&&(_0x1acce1=await loadJSON(_0x14a59d['sections'],![]));const _0x5099d2=_0x14a59d[_0x4f0de7(0x2d5)]==='null'?null:{'id':_0x14a59d['folderId'],'type':_0x4f0de7(0x313)};_0x3d8a89={'attributes':{'name':_0x14a59d['name'],'description':_0x14a59d['description']||null,..._0x3de004!==undefined&&{'audienceId':_0x3de004},..._0x1acce1!==undefined&&{'sections':_0x1acce1}},'relationships':{'parentFolder':{'data':_0x5099d2}}};}const _0x151e98=await withSpinner(_0x4f0de7(0x3b8)+(_0x3d8a89['attributes']?.[_0x4f0de7(0x1d8)]??'')+_0x4f0de7(0x277),()=>_0x3aae3d['personalization'][_0x4f0de7(0x26b)](_0x3d8a89),{'verbose':_0x571776['verbose']}),_0xcd69e0=_0x151e98[_0x4f0de7(0x27a)];return console['error']('✔\x20Created\x20personalization\x20\x27'+_0xcd69e0[_0x4f0de7(0x1d8)]+_0x4f0de7(0x384)+_0xcd69e0['id']),await handleSDKOutput([_0xcd69e0],_0x571776),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x33a);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x1ed);async[a30_0x41ba90(0x1db)](_0x154e0d){const _0x8e5b7b=a30_0x41ba90,{options:_0x53931c,args:_0xf29f5d}=_0x154e0d,_0xbd6b37=_0x53931c,_0x3672fc=_0xf29f5d[0x0];if(!_0x3672fc)return console['error'](_0x8e5b7b(0x27d)),console['error'](_0x8e5b7b(0x3b0)),console[_0x8e5b7b(0x353)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>'),0x1;let _0x5954c8;if(_0xbd6b37[_0x8e5b7b(0x386)])_0x5954c8=await loadJSON(_0xbd6b37['file'],!![]);else{if(!_0xbd6b37[_0x8e5b7b(0x1d8)])return console[_0x8e5b7b(0x353)](_0x8e5b7b(0x2c0)),console[_0x8e5b7b(0x353)](_0x8e5b7b(0x3b0)),0x1;if(_0xbd6b37['description']===undefined)return console['error'](_0x8e5b7b(0x266)),console['error'](_0x8e5b7b(0x3b0)),0x1;let _0xdd44a6;_0xbd6b37['sections']&&(_0xdd44a6=await loadJSON(_0xbd6b37[_0x8e5b7b(0x3c7)],![])),_0x5954c8={'attributes':{'name':_0xbd6b37['name'],'description':_0xbd6b37[_0x8e5b7b(0x38a)]||null,..._0xdd44a6!==undefined&&{'sections':_0xdd44a6}}};}const {tdx:_0x1e22f0}=_0x154e0d,_0x370f6b=await withSpinner(_0x8e5b7b(0x2b1)+_0x3672fc+_0x8e5b7b(0x277),()=>_0x1e22f0[_0x8e5b7b(0x1de)][_0x8e5b7b(0x211)](_0x3672fc,_0x5954c8),{'verbose':_0x53931c[_0x8e5b7b(0x340)]}),_0x2e053d=_0x370f6b[_0x8e5b7b(0x27a)];return console['error'](_0x8e5b7b(0x1e2)+_0x2e053d[_0x8e5b7b(0x1d8)]+'\x27\x20(id:\x20'+_0x2e053d['id']+')'),await handleSDKOutput([_0x2e053d],_0x53931c),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a30_0x41ba90(0x240);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x339);async[a30_0x41ba90(0x1db)](_0x9f497c){const _0x57b688=a30_0x41ba90,{options:_0x57711f,args:_0x4ad0ce}=_0x9f497c,_0x117c04=_0x4ad0ce[0x0]||_0x57711f[_0x57b688(0x226)];if(!_0x117c04)return showParentSegmentNotSetError(_0x57b688(0x289)+_0x57b688(0x2a7)),0x1;const _0x37af74=resolveYamlFile(_0x117c04);if(!existsSync(_0x37af74))return showFileNotFoundError(_0x37af74,_0x117c04),0x1;let _0x1aaeb4;try{_0x1aaeb4=readFileSync(_0x37af74,_0x57b688(0x2d3));}catch(_0x2b42e6){const _0xf0030d=_0x2b42e6 instanceof Error?_0x2b42e6[_0x57b688(0x1ef)]:String(_0x2b42e6);return console[_0x57b688(0x353)]('Error\x20reading\x20file:\x20'+_0xf0030d),0x1;}let _0xe9ea11;try{_0xe9ea11=parseDef(_0x1aaeb4);}catch(_0x2c4a37){const _0x3ce634=_0x2c4a37 instanceof Error?_0x2c4a37['message']:String(_0x2c4a37);return console[_0x57b688(0x353)](a30_0x3ab056[_0x57b688(0x269)](_0x57b688(0x25f)+_0x3ce634)),0x1;}if(_0xe9ea11[_0x57b688(0x1ff)]&&_0xe9ea11[_0x57b688(0x1ff)][_0x57b688(0x1dc)]>0x0)return console[_0x57b688(0x353)](a30_0x3ab056[_0x57b688(0x32d)](_0x57b688(0x265)+_0x37af74)),console[_0x57b688(0x353)](a30_0x3ab056[_0x57b688(0x397)](_0x57b688(0x323)+_0xe9ea11[_0x57b688(0x1ff)][_0x57b688(0x1dc)]+_0x57b688(0x1e1))),0x1;!_0xe9ea11[_0x57b688(0x2fe)]&&(_0xe9ea11[_0x57b688(0x2fe)]={'events':[{'name':_0x57b688(0x399),'source_table':_0x57b688(0x271)}],'attributes':[{'name':_0x57b688(0x202),'type':'single'}],'id_stitching':{'primary_key':_0xe9ea11[_0x57b688(0x398)]['table']==='customers'?_0x57b688(0x3ce):'user_id'}});_0xe9ea11['personalization_services']=[{'name':_0x57b688(0x33f),'description':_0x57b688(0x26d),'trigger_event':_0x57b688(0x399),'sections':[{'name':_0x57b688(0x272),'criteria':_0x57b688(0x21d),'attributes':[_0x57b688(0x202)]}]}];const _0x2b5eff=serializeDef(_0xe9ea11);return writeFileSync(_0x37af74,_0x2b5eff,_0x57b688(0x2d3)),console[_0x57b688(0x353)](a30_0x3ab056[_0x57b688(0x3af)]('✔')+_0x57b688(0x205)+a30_0x3ab056[_0x57b688(0x35f)](_0x37af74)),(!_0xe9ea11[_0x57b688(0x2fe)]||_0x1aaeb4['indexOf'](_0x57b688(0x343))===-0x1)&&console['error'](a30_0x3ab056['green']('✔')+_0x57b688(0x1d0)),console[_0x57b688(0x353)]('\x0a'+a30_0x3ab056[_0x57b688(0x397)](_0x57b688(0x3c9))),console[_0x57b688(0x353)](_0x57b688(0x302)+_0x37af74+_0x57b688(0x1fc)),console['error'](_0x57b688(0x2af)+a30_0x3ab056['dim'](_0x57b688(0x300)+_0x117c04)+_0x57b688(0x2d9)),0x0;}}
|