@treasuredata/tdx 2026.3.35 → 2026.3.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a32_0x5407b9=a32_0x192d;(function(_0x39d56c,_0x23aefa){const _0x250577=a32_0x192d,_0x52fb57=_0x39d56c();while(!![]){try{const _0x11d60d=parseInt(_0x250577(0x315))/0x1*(parseInt(_0x250577(0x30f))/0x2)+parseInt(_0x250577(0x17c))/0x3*(-parseInt(_0x250577(0x2a7))/0x4)+parseInt(_0x250577(0x27f))/0x5*(parseInt(_0x250577(0x146))/0x6)+-parseInt(_0x250577(0x2dd))/0x7*(-parseInt(_0x250577(0x190))/0x8)+-parseInt(_0x250577(0x212))/0x9+parseInt(_0x250577(0x27c))/0xa+-parseInt(_0x250577(0x182))/0xb;if(_0x11d60d===_0x23aefa)break;else _0x52fb57['push'](_0x52fb57['shift']());}catch(_0x3c40a3){_0x52fb57['push'](_0x52fb57['shift']());}}}(a32_0x1395,0xe81cf));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a32_0x30ef65 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 a32_0x2401da 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=a32_0x5407b9(0x2f6),LEGACY_PARENT_SEGMENT_DIR=a32_0x5407b9(0x2c6);function openBrowser(_0x21ea87){const _0x2ad506=a32_0x5407b9,_0x1dc3a1=process[_0x2ad506(0x2a1)],_0x759c7f=_0x1dc3a1===_0x2ad506(0x1f0)?'open':_0x1dc3a1===_0x2ad506(0x29b)?'start':_0x2ad506(0x1d4);spawn(_0x759c7f,[_0x21ea87],{'detached':!![],'stdio':_0x2ad506(0x227)})[_0x2ad506(0x2a5)]();}function migrateLegacyDirectory(){const _0x49ee0d=a32_0x5407b9;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x36ed43=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x36ed43['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a32_0x2401da['yellow'](_0x49ee0d(0x273)+LEGACY_PARENT_SEGMENT_DIR+_0x49ee0d(0x289)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console['error'](a32_0x2401da[_0x49ee0d(0x145)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x49ee0d(0x249)](a32_0x2401da[_0x49ee0d(0x191)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x49ee0d(0x249)](a32_0x2401da[_0x49ee0d(0x32a)](_0x49ee0d(0x282)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x314a13){const _0x4844a3=_0x314a13 instanceof Error?_0x314a13[_0x49ee0d(0x2b0)]:String(_0x314a13);return console['error'](a32_0x2401da[_0x49ee0d(0x24c)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x4844a3+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a32_0x5407b9(0x308)](_0x5d6958){const _0x4784aa=a32_0x5407b9;return migrateLegacyDirectory(),super[_0x4784aa(0x308)](_0x5d6958);}}function resolveYamlFile(_0x242e78){const _0x4f4bd0=a32_0x5407b9;if(_0x242e78['endsWith'](_0x4f4bd0(0x150))||_0x242e78[_0x4f4bd0(0x28c)](_0x4f4bd0(0x14a)))return _0x242e78;return a32_0x30ef65[_0x4f4bd0(0x32f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x242e78)+_0x4f4bd0(0x150));}function formatProgressMessage(_0x1e6b5d){const _0x3464cb=a32_0x5407b9,_0x1141c7=_0x1e6b5d[_0x3464cb(0x245)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x1141c7){const [,_0x21817a,_0x4a7410,_0x1a96a2='']=_0x1141c7;return a32_0x2401da[_0x3464cb(0x145)](_0x21817a+':')+'\x20'+_0x4a7410+a32_0x2401da[_0x3464cb(0x145)](_0x1a96a2);}return a32_0x2401da[_0x3464cb(0x145)](_0x1e6b5d);}function a32_0x1395(){const _0x1ec3f6=['id:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','✔\x20Created\x20personalization\x20\x27','Analyzing\x20changes...','filter','%)\x20','Personalization\x20service\x20description','\x20parent\x20segment','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','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','segment:parent:pull','created:','\x0a\x20\x20\x20\x20}','behaviors','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','folder-segment','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','status','sections','631086XnuqYd','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','sourceTableValid','Available\x20attributes:','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','toLowerCase','27155370KdthkQ','updatedAt','Listing\x20parent\x20segments...','segment:parent:push','{\x0a\x20\x20\x22database\x22:\x20\x22','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','keyEventId','/attempt/','Error:\x20File\x20not\x20found:\x20','\x20behaviors','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','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','query','get','8ADcbTN','yellow','keys','Fetching\x20SQL\x20for\x20\x27','pullParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','label','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','displayValidateResults','Updated','\x20\x20\x20\x20\x20\x20','cyan','parentSegment','Get\x20current\x20RT\x20configuration\x20version\x20status','Delete\x20a\x20personalization\x20service','displaySampleData','runParent','Listing\x20RT\x20journeys\x20for\x20\x27','stitchingKeys','displayAttributesStats','value','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','\x20Context\x20set:\x20','createToken','start','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','sort','Validating\x20configuration...','personalization_services','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','no\x20tokens\x20configured','\x22\x20}','Deleting\x20personalization\x20service\x20\x27','apply','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','\x20--attribute\x20\x22<name>\x22','interval','.customers)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','displayBehaviorsStats','events','Get\x20SQL\x20query\x20for\x20parent\x20segment','segment','enriched','Fetching\x20behavior\x20list...','\x20\x20Tables:\x201\x20customers\x20+\x20','page_view','No\x20parent\x20segments\x20found','number','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Events:','jsonl','\x20total','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','foreignKey','stop','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','delete','attributes','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','status:\x20','sourceTableError','Creating','Error:\x20Token\x20name\x20is\x20required','Resolving\x20parent\x20segment\x20\x27','verbose','xdg-open','\x0a\x20\x20\x20\x20]','Enriched:','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x20Added\x20personalization\x20template\x20to\x20','limit','Table:\x20','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Error:\x20Token\x20\x27','\x27\x20is\x20up\x20to\x20date','Create\x20a\x20realtime\x20personalization\x20entity','primaryKey','✔\x20Deleted\x20personalization\x20service\x20\x27','Fetching\x20current\x20configuration\x20for\x20\x27','segment:parent:show','Error:\x20--behavior\x20requires\x20a\x20name\x0a','totalEvents','Updating','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','enabled','realtime:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','\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','SELECT\x20*\x20FROM\x20(\x0a','My\x20Service','ps:pz:service:delete','public','-1d','darwin','getParentFull','stringify','Found\x20YAML\x20file:\x20','rowCount','ID\x20Stitching:','Available\x20behaviors:','Errors:','master','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','format','Updating\x20personalization\x20service\x20\x27','true','\x20Configuration\x20is\x20valid','Error:\x20Token\x20ID\x20is\x20required','👥\x20','Executing\x20parent\x20segment\x20query...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Parent\x20segment:\x20','folderId','\x20[Job\x20ID:\x20','✔\x20No\x20changes\x20-\x20\x27','\x20Added\x20RT\x202.0\x20template\x20section','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','customerGroup','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','Show\x20parent\x20segment\x20schema\x20(column\x20types)','split','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','\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}','\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','⚡\x20Not\x20enabled','scheduleOption','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','4319001PIHqaT','personalizationServices','collectSchema','Deleting\x20token\x20\x27','listJourneys','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','keyEventCriteria','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','resolveParentId','Behavior:','\x20\x20Database:\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20RT-enabled\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x27\x20and\x20run\x20workflow?','Source:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','ps:pz:service:create','displayPreviewHints','ignore','Error:\x20Parent\x20segment\x20name\x20is\x20required','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','getPersonalization','\x20\x20Columns:\x20','parent_id','Error:\x20--database\x20and\x20--table\x20are\x20required','ps:rt:jn:list','repeat','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Master\x20+\x20Attributes','\x27\x20with\x20ID:\x20','realtime_enabled','data','table','\x0aChanges\x20to\x20\x27','Fetching\x20personalization\x20service\x20\x27','\x20RT\x20journey','\x27...','Finding\x20service\x20for\x20token...','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','in\x20','\x20kill','\x20personalization','payload:','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Attribute:','deleteToken','To\x20cancel:','\x5c$&','match','Preview:','Error:\x20Personalization\x20ID\x20is\x20required','site','error','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Show\x20a\x20specific\x20realtime\x20personalization','red','Created','map','output','No\x20RT-enabled\x20parent\x20segments\x20found','updateParent','ps:rt:jn:pause','columns','valid','eventKind','column','Join\x20on:','td_client_id','realtime','\x20\x20\x20','✔\x20Created\x20token\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Site:\x20','/app/dw/parentSegments/','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','type','\x0aChanges\x20to\x20apply\x20to\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','some','Fetching\x20customers\x20schema...','RT\x20Journey\x20ID:\x20','test','Next\x20steps:','\x20field','formatSchemaJson','Validate:','workflowAttemptId','Pause\x20activations\x20in\x20an\x20RT\x20journey','\x20\x20\x20\x20-\x20','Listing\x20RT-enabled\x20parent\x20segments...','displayRealtimeInfo','\x20tdx\x20wf\x20attempt\x20','toFixed','segment:parent:update','\x0a⚠️\x20\x20Both\x20','Show\x20parent\x20segment\x20details','displaySummary','addAttributesFile','Error\x20reading\x20file:\x20','relationships','identifier:\x20','includeSensitive:','✔\x20Found\x20','4974820Aumlyg','\x20RT\x20configuration\x20is\x20valid','customers','1459555ubncGz','\x20Opening\x20','payload','✔\x20Renamed\x20directory\x20to\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','elapsedTimeMillis','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','audienceId:\x20','Fetching\x20sample\x20data...','session','/\x20and\x20','length','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','endsWith','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Error\x20parsing\x20YAML:\x20','varchar','✔\x20Updated\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','Creating\x20personalization\x20\x27','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','name','getOutputDatabaseName','No\x20parent\x20segments\x20match\x20pattern:\x20','Columns:','column_type','attribute','win32','timezone','SELECT\x20*\x20FROM\x20','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','parentFolder','resumeJourney','platform','createdAt','Options:','behavior','unref','localeCompare','8RUylju','text','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','deletePersonalization','json','\x20to\x20configure\x20your\x20personalization\x20service','\x20true','push','RT\x202.0:','message','\x20=\x20','file','null','\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','\x20is\x20already\x20up\x20to\x20date','Options:\x0a','\x20parent\x20segment\x20\x27','web','segment:parent:list','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','segment:parent:run','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','No\x20personalization\x20services\x20configured','schemaValid','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','\x20personalization\x20service','List\x20RT\x20journeys','includeSensitive','ps:pz:patch','launched','Listing\x20personalization\x20services\x20for\x20\x27','parent_segment','segment:parent:validate','<database>.<table>','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Listing\x20fields\x20for\x20\x27','public:','processedRows','Error:\x20Service\x20ID\x20is\x20required','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','ps:pz:service:token:create','Error:','(id:\x20','entryCriteria','\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\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Aborted.','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','To\x20view\x20sample\x20data:','Error:\x20--name\x20is\x20required','/{name}.yml\x0a','4806081FiFdAG','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','matchedCount','ps:pz:service:token:delete','ps:pz:service:update','Patching\x20personalization\x20\x27','stats','displayColumns','Listing\x20personalizations\x20for\x20\x27','ps:rt:list','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','behavior_','stageCount','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','audienceId:','joinKey','Updating\x20parent\x20segment\x20\x27','Coverage:','Audience\x20ID:','\x20configured','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aNew\x20parent\x20segment\x20\x27','ps:pz:service:show','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','parent_segments','Master:','entryCriteria:','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','personalization','\x20stage','✔\x20Deleted\x20personalization\x20\x27','log','No\x20personalizations\x20configured','✔\x20Created\x20personalization\x20service\x20\x27','\x20\x20\x20\x20','last_page_viewed','Attributes:','segment:parent:fields','Creating\x20token\x20\x27','setJobId','token:','displayMasterInfo','run','idStitching','createPersonalization','\x0aNo\x20sample\x20data\x20available','getParentSQL','tokens','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','7306kLhrit','Delete\x20a\x20realtime\x20personalization','allowed\x20IPs:','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','⚡\x20Enabled','pushParentYaml','379GZXyEX','displayPreviewResults','schemaError','yes','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','Customers:','toLocaleString','keyEventId:','trim','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','tdx\x20ps\x20push\x20','execute','errors','YAML\x20file:\x20','column_name','✔\x20Created\x20parent\x20segment\x20\x27','customerGroupFile','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','tdx\x20ps\x20preview\x20','coveragePercent','Output\x20Database:','green','string','eventKind:\x20','allowedIps','\x27\x20(id:\x20','join','segment:parent:preview','ps:pz:service:list','Name:\x20','list','utf-8','✔\x20Updated\x20parent\x20segment\x20\x27','Creating\x20personalization\x20service\x20\x27','use','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','Attempt:','addBehaviors','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','\x20+\x20[','/sessions/','Error:\x20Service\x20name\x20is\x20required','Resume\x20activations\x20in\x20an\x20RT\x20journey','sampleData','\x20\x201.\x20Edit\x20','single','\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','allValid','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','customerPercent','✔\x20Deleted\x20token\x20\x27','scheduleType','information_schema','\x20(paused)','Join:','listPersonalizations','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','state','Error:\x20--attribute\x20requires\x20a\x20name\x0a','bold','customersWithEvents','Create\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','dim','36OAJxgm','patchPersonalization','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','database','.yaml','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','create','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','indexOf','audienceId','.yml','Rows:','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','Fetching\x20parent\x20segment\x20\x27','description','population','jobId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','\x20No\x20changes\x20-\x20','replace','sections:','No\x20RT\x20journeys\x20found','Update\x20a\x20realtime\x20personalization\x20entity','all','patch','any','using\x20the\x20default\x20path:\x20','paused','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','/app/workflows/','✔\x20Retrieved\x20RT\x20configuration\x20version','ps:rt:configuration_versions','\x20to\x20push\x20the\x20configuration','\x0aError:'];a32_0x1395=function(){return _0x1ec3f6;};return a32_0x1395();}function showFileNotFoundError(_0x483e45,_0x33f7ee){const _0x285daa=a32_0x5407b9;console[_0x285daa(0x249)](a32_0x2401da[_0x285daa(0x24c)](_0x285daa(0x18a)+_0x483e45+'\x0a')),console[_0x285daa(0x249)](a32_0x2401da[_0x285daa(0x19b)](_0x285daa(0x217)+_0x33f7ee+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x1b4026){const _0x171943=a32_0x5407b9;if(!_0x1b4026[_0x171943(0x259)])return;const _0x43b02a=_0x1b4026['realtime'],_0x4f25e3=_0x43b02a[_0x171943(0x1e7)]?a32_0x2401da[_0x171943(0x32a)](_0x171943(0x313)):a32_0x2401da[_0x171943(0x191)](_0x171943(0x20f));console['error']('\x0a'+a32_0x2401da[_0x171943(0x145)](_0x171943(0x2af))+'\x20'+_0x4f25e3);if(_0x43b02a[_0x171943(0x1b9)]&&_0x43b02a[_0x171943(0x1b9)][_0x171943(0x28a)]>0x0){console[_0x171943(0x249)]('\x20\x20'+a32_0x2401da[_0x171943(0x145)](_0x171943(0x1c3))+'\x20'+_0x43b02a[_0x171943(0x1b9)]['length']+_0x171943(0x2f1));for(const _0x467c87 of _0x43b02a[_0x171943(0x1b9)]){const _0x5e2df0=_0x467c87[_0x171943(0x17e)]===![]?a32_0x2401da[_0x171943(0x24c)]('✘'):a32_0x2401da[_0x171943(0x32a)]('✔');console[_0x171943(0x249)]('\x20\x20\x20\x20'+_0x5e2df0+'\x20'+_0x467c87[_0x171943(0x295)]),_0x467c87['sourceTableError']&&console[_0x171943(0x249)](_0x171943(0x19a)+a32_0x2401da[_0x171943(0x24c)](_0x467c87[_0x171943(0x1cf)]));}}if(_0x43b02a[_0x171943(0x1cb)]&&_0x43b02a[_0x171943(0x1cb)][_0x171943(0x28a)]>0x0){console[_0x171943(0x249)]('\x20\x20'+a32_0x2401da[_0x171943(0x145)](_0x171943(0x302))+'\x20'+_0x43b02a[_0x171943(0x1cb)]['length']+'\x20configured');for(const _0x3429df of _0x43b02a[_0x171943(0x1cb)]){const _0x29fc62=_0x3429df[_0x171943(0x254)]?a32_0x2401da['green']('✔'):a32_0x2401da[_0x171943(0x24c)]('✘');console[_0x171943(0x249)](_0x171943(0x300)+_0x29fc62+'\x20'+_0x3429df[_0x171943(0x295)]+'\x20'+a32_0x2401da[_0x171943(0x145)]('('+_0x3429df[_0x171943(0x260)]+')'));}}if(_0x43b02a[_0x171943(0x309)]){const _0x33969e=_0x43b02a[_0x171943(0x309)][_0x171943(0x1a2)]?.['length']?_0x171943(0x33c)+_0x43b02a[_0x171943(0x309)][_0x171943(0x1a2)][_0x171943(0x32f)](',\x20')+']':'';console['error']('\x20\x20'+a32_0x2401da[_0x171943(0x145)](_0x171943(0x1f5))+'\x20'+_0x43b02a[_0x171943(0x309)][_0x171943(0x1df)]+_0x33969e);}if(_0x43b02a[_0x171943(0x213)]&&_0x43b02a[_0x171943(0x213)][_0x171943(0x28a)]>0x0){console[_0x171943(0x249)]('\x20\x20'+a32_0x2401da[_0x171943(0x145)]('Personalization:')+'\x20'+_0x43b02a['personalizationServices'][_0x171943(0x28a)]+'\x20service'+(_0x43b02a['personalizationServices'][_0x171943(0x28a)]!==0x1?'s':''));for(const _0x3cd710 of _0x43b02a[_0x171943(0x213)]){console['error'](_0x171943(0x26d)+_0x3cd710[_0x171943(0x295)]);}}}function showParentSegmentNotSetError(_0x4cff0d){const _0x1fc49c=a32_0x5407b9;console[_0x1fc49c(0x249)](a32_0x2401da[_0x1fc49c(0x191)](_0x1fc49c(0x18d))),console[_0x1fc49c(0x249)](_0x4cff0d);}export class ParentSegmentListCommand extends BaseCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x2b9);['description']='List\x20parent\x20segments';async[a32_0x5407b9(0x320)](_0x43b323){const _0x233bba=a32_0x5407b9,{options:_0x51bc6a,args:_0x21c301,tdx:_0x50736f}=_0x43b323,_0x2b6b7f=_0x21c301[0x0];_0x51bc6a['verbose']&&(console[_0x233bba(0x249)](_0x233bba(0x25d)+_0x51bc6a[_0x233bba(0x248)]),_0x2b6b7f&&console[_0x233bba(0x249)]('Pattern:\x20'+_0x2b6b7f));const _0x2bfe78=await withSpinner(_0x2b6b7f?_0x233bba(0x2ea)+_0x2b6b7f+_0x233bba(0x239):_0x233bba(0x184),()=>_0x50736f[_0x233bba(0x1bb)]['listParents'](),{'verbose':_0x51bc6a['verbose']});let _0x1fc315=_0x2bfe78[_0x233bba(0x234)];if(_0x2b6b7f){const _0x5c2aea=_0x2b6b7f['replace'](/[.+^${}()|[\]\\]/g,_0x233bba(0x244))['replace'](/\*/g,'.*')[_0x233bba(0x15a)](/\?/g,'.'),_0x5ad1bc=new RegExp('^'+_0x5c2aea+'$','i');_0x1fc315=_0x1fc315['filter'](_0x1ef625=>_0x5ad1bc[_0x233bba(0x266)](_0x1ef625[_0x233bba(0x1cb)]['name']));}_0x1fc315[_0x233bba(0x1ab)]((_0xdf1a97,_0x291b93)=>_0xdf1a97[_0x233bba(0x1cb)]['name'][_0x233bba(0x2a6)](_0x291b93[_0x233bba(0x1cb)][_0x233bba(0x295)])),console[_0x233bba(0x249)](_0x233bba(0x27b)+_0x1fc315['length']+_0x233bba(0x170)+(_0x1fc315['length']!==0x1?'s':''));const _0x43070e=_0x129cb7=>{const _0x52f27a=_0x233bba;return getConsoleNextUrl(_0x51bc6a[_0x52f27a(0x248)],_0x52f27a(0x25e)+_0x129cb7);};if(_0x51bc6a[_0x233bba(0x1fa)]==='json'||_0x51bc6a[_0x233bba(0x1fa)]===_0x233bba(0x1c4)){const _0x50287e=_0x1fc315[_0x233bba(0x24e)](_0x5aa1ce=>({..._0x5aa1ce,'url':_0x43070e(_0x5aa1ce['id'])}));await handleSDKOutput(_0x50287e,_0x51bc6a);}else{if(_0x1fc315[_0x233bba(0x28a)]===0x0)_0x2b6b7f?console[_0x233bba(0x2fd)](_0x233bba(0x297)+_0x2b6b7f):console[_0x233bba(0x2fd)](_0x233bba(0x1c0));else for(const _0x1c1db9 of _0x1fc315){const _0x1cf679=_0x1c1db9[_0x233bba(0x1cb)][_0x233bba(0x155)]?a32_0x2401da['dim']('\x20('+formatRows(_0x1c1db9['attributes'][_0x233bba(0x155)])+')'):'',_0x278c02=hyperlink(_0x1c1db9[_0x233bba(0x1cb)]['name'],_0x43070e(_0x1c1db9['id']));console[_0x233bba(0x2fd)](_0x233bba(0x1ff)+_0x278c02+_0x1cf679);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']='segment:parent:create';[a32_0x5407b9(0x154)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a32_0x5407b9(0x320)](_0x54a18c){const _0x2a873b=a32_0x5407b9,{options:_0x11897f,args:_0x5693f5,tdx:_0x3e81c7}=_0x54a18c;console[_0x2a873b(0x249)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x2a873b(0x177)+_0x2a873b(0x179));const _0x253169=_0x11897f;if(_0x5693f5[_0x2a873b(0x28a)]===0x0)return console[_0x2a873b(0x249)](a32_0x2401da['red'](_0x2a873b(0x228))),console[_0x2a873b(0x249)](_0x2a873b(0x1ae)),0x1;const _0x49e486=_0x5693f5[0x0];if(!_0x253169['database']||!_0x253169[_0x2a873b(0x235)])return console[_0x2a873b(0x249)](_0x2a873b(0x22d)),console[_0x2a873b(0x249)](_0x2a873b(0x1ae)),0x1;_0x253169[_0x2a873b(0x1d3)]&&(console[_0x2a873b(0x249)](_0x2a873b(0x25d)+_0x253169[_0x2a873b(0x248)]),console['error'](_0x2a873b(0x332)+_0x49e486),console[_0x2a873b(0x249)]('Database:\x20'+_0x253169['database']),console['error'](_0x2a873b(0x1da)+_0x253169[_0x2a873b(0x235)]));const _0x196d21=await loadJSONFromOptions(_0x253169['attributes'],_0x253169['attributesFile']),_0x56e286=await loadJSONFromOptions(_0x253169['behaviors'],_0x253169['behaviorsFile']),_0x4b2329=await loadJSONFromOptions(_0x253169[_0x2a873b(0x208)],_0x253169[_0x2a873b(0x325)]),_0x5e397d={'name':_0x49e486,'description':_0x253169[_0x2a873b(0x154)],'scheduleType':_0x253169[_0x2a873b(0x134)],'scheduleOption':_0x253169['scheduleOption'],'timezone':_0x253169[_0x2a873b(0x29c)],'master':{'parentDatabaseName':_0x253169['database'],'parentTableName':_0x253169[_0x2a873b(0x235)]},'attributes':_0x196d21,'behaviors':_0x56e286,'customerGroup':_0x4b2329},_0x571660=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x49e486+_0x2a873b(0x239),()=>_0x3e81c7[_0x2a873b(0x1bb)]['createParent'](_0x5e397d),{'verbose':_0x11897f[_0x2a873b(0x1d3)]}),_0x1649e8=_0x571660['data'];return console[_0x2a873b(0x249)](_0x2a873b(0x324)+_0x1649e8[_0x2a873b(0x295)]+'\x27\x20with\x20ID:\x20'+_0x1649e8['id']),await handleSDKOutput([_0x1649e8],_0x11897f),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x272);[a32_0x5407b9(0x154)]=a32_0x5407b9(0x17d);async[a32_0x5407b9(0x320)](_0x3fb225){const _0xacbb9=a32_0x5407b9,{options:_0x2016b6,args:_0xdd5ab2,tdx:_0x12b5a3}=_0x3fb225;console['error'](_0xacbb9(0x139)+_0xacbb9(0x177)+_0xacbb9(0x179));const _0x3faf38=_0x2016b6;if(_0xdd5ab2[_0xacbb9(0x28a)]===0x0)return console[_0xacbb9(0x249)](a32_0x2401da[_0xacbb9(0x24c)](_0xacbb9(0x228))),console[_0xacbb9(0x249)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x4b445b=_0xdd5ab2[0x0];_0x3faf38['verbose']&&(console['error']('Site:\x20'+_0x3faf38[_0xacbb9(0x248)]),console[_0xacbb9(0x249)]('Parent\x20segment:\x20'+_0x4b445b));const _0x1ab537=await withSpinner(_0xacbb9(0x1e1)+_0x4b445b+'\x27...',()=>_0x12b5a3[_0xacbb9(0x1bb)]['getParentFull'](_0x4b445b),{'verbose':_0x3faf38[_0xacbb9(0x1d3)]}),_0x4cb4ae=_0x1ab537[_0xacbb9(0x234)],_0x27ce81=await loadJSONFromOptions(_0x3faf38['addAttributes'],_0x3faf38[_0xacbb9(0x276)]),_0xd4446d=await loadJSONFromOptions(_0x3faf38[_0xacbb9(0x33a)],_0x3faf38['addBehaviorsFile']),_0x4992cc={'name':_0x4cb4ae[_0xacbb9(0x295)],'description':_0x3faf38[_0xacbb9(0x154)]!==undefined?_0x3faf38[_0xacbb9(0x154)]:_0x4cb4ae[_0xacbb9(0x154)],'scheduleType':_0x3faf38[_0xacbb9(0x134)]!==undefined?_0x3faf38[_0xacbb9(0x134)]:_0x4cb4ae[_0xacbb9(0x134)],'scheduleOption':_0x3faf38[_0xacbb9(0x210)]!==undefined?_0x3faf38[_0xacbb9(0x210)]:_0x4cb4ae[_0xacbb9(0x210)],'timezone':_0x3faf38[_0xacbb9(0x29c)]!==undefined?_0x3faf38[_0xacbb9(0x29c)]:_0x4cb4ae[_0xacbb9(0x29c)],'master':_0x4cb4ae[_0xacbb9(0x1f8)],'attributes':_0x27ce81?[..._0x4cb4ae[_0xacbb9(0x1cb)]||[],..._0x27ce81]:_0x4cb4ae[_0xacbb9(0x1cb)],'behaviors':_0xd4446d?[..._0x4cb4ae['behaviors']||[],..._0xd4446d]:_0x4cb4ae['behaviors'],'customerGroup':_0x4cb4ae['customerGroup']},_0x150f91=await withSpinner(_0xacbb9(0x2ee)+_0x4b445b+_0xacbb9(0x239),()=>_0x12b5a3[_0xacbb9(0x1bb)][_0xacbb9(0x251)](_0x4b445b,_0x4992cc),{'verbose':_0x3faf38[_0xacbb9(0x1d3)]}),_0x230c2f=_0x150f91['data'];return console[_0xacbb9(0x249)](_0xacbb9(0x335)+_0x230c2f[_0xacbb9(0x295)]+'\x27'),await handleSDKOutput([_0x230c2f],_0x3faf38),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x173);[a32_0x5407b9(0x154)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a32_0x5407b9(0x320)](_0x293538){const _0x4f5c40=a32_0x5407b9,{options:_0x2cb5d0,args:_0x20974a,tdx:_0x50bb3c}=_0x293538,_0x5024c8=_0x2cb5d0,_0x5cba12=_0x20974a[0x0]||_0x2cb5d0[_0x4f5c40(0x19c)];if(!_0x5cba12)return showParentSegmentNotSetError(_0x4f5c40(0x131)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x5024c8[_0x4f5c40(0x337)]&&_0x5024c8[_0x4f5c40(0x24f)])return console[_0x4f5c40(0x249)](a32_0x2401da[_0x4f5c40(0x24c)](_0x4f5c40(0x171))),console['error'](a32_0x2401da[_0x4f5c40(0x145)](_0x4f5c40(0x240))),console[_0x4f5c40(0x249)](a32_0x2401da[_0x4f5c40(0x145)](_0x4f5c40(0x161)+PARENT_SEGMENT_DIR+_0x4f5c40(0x2dc))),console['error'](a32_0x2401da[_0x4f5c40(0x19b)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x22eb01=_0x5024c8[_0x4f5c40(0x24f)]||a32_0x30ef65['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5cba12)+_0x4f5c40(0x150));_0x5024c8[_0x4f5c40(0x1d3)]&&(console[_0x4f5c40(0x249)]('Site:\x20'+_0x5024c8[_0x4f5c40(0x248)]),console['error'](_0x4f5c40(0x202)+_0x5cba12),console['error']('Output\x20file:\x20'+_0x22eb01));const _0x49a65c=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x5cba12+_0x4f5c40(0x239),()=>_0x50bb3c[_0x4f5c40(0x1bb)][_0x4f5c40(0x194)](_0x5cba12),{'verbose':_0x5024c8['verbose']}),_0x583d79=_0x49a65c[_0x4f5c40(0x234)];if(existsSync(_0x22eb01)){const _0x500d57=readFileSync(_0x22eb01,_0x4f5c40(0x334)),_0xf93347=generateDiff(_0x500d57,_0x583d79);if(!hasChanges(_0xf93347))console[_0x4f5c40(0x249)](a32_0x2401da[_0x4f5c40(0x32a)]('✔')+_0x4f5c40(0x159)+a32_0x2401da['cyan'](_0x22eb01)+_0x4f5c40(0x2b5));else{console[_0x4f5c40(0x249)](_0x4f5c40(0x236)+_0x22eb01+'\x27:'),console[_0x4f5c40(0x249)]('─'['repeat'](0x3c)),console['error'](formatDiffWithColors(_0xf93347)),console[_0x4f5c40(0x249)]('─'[_0x4f5c40(0x22f)](0x3c));if(!_0x5024c8[_0x4f5c40(0x318)]){if(!isInteractive())return console['error'](a32_0x2401da[_0x4f5c40(0x24c)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4f5c40(0x249)](a32_0x2401da[_0x4f5c40(0x145)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x205ecc=await confirmKey('Overwrite\x20\x27'+_0x22eb01+'\x27?');if(!_0x205ecc)return console[_0x4f5c40(0x249)](a32_0x2401da[_0x4f5c40(0x191)](_0x4f5c40(0x2d5))),0x1;}writeFileSync(_0x22eb01,_0x583d79,_0x4f5c40(0x334)),console[_0x4f5c40(0x249)](a32_0x2401da[_0x4f5c40(0x32a)]('✔')+_0x4f5c40(0x28b)+a32_0x2401da[_0x4f5c40(0x19b)](_0x22eb01));}}else{const _0xdbc9ae=a32_0x30ef65['dirname'](_0x22eb01);!existsSync(_0xdbc9ae)&&mkdirSync(_0xdbc9ae,{'recursive':!![]}),writeFileSync(_0x22eb01,_0x583d79,_0x4f5c40(0x334)),console[_0x4f5c40(0x249)](a32_0x2401da[_0x4f5c40(0x32a)]('✔')+_0x4f5c40(0x28b)+a32_0x2401da[_0x4f5c40(0x19b)](_0x22eb01));}return saveSessionContext({'parent_segment':_0x5cba12},_0x5024c8[_0x4f5c40(0x288)]),console[_0x4f5c40(0x249)](a32_0x2401da[_0x4f5c40(0x32a)]('✔')+_0x4f5c40(0x1a7)+a32_0x2401da[_0x4f5c40(0x145)]('parent_segment')+_0x4f5c40(0x2b1)+a32_0x2401da[_0x4f5c40(0x19b)](_0x5cba12)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x185);['description']=a32_0x5407b9(0x230);async[a32_0x5407b9(0x320)](_0x259076){const _0x25499d=a32_0x5407b9,{options:_0x5a6c6c,args:_0x23da29,tdx:_0x1659a2}=_0x259076,_0x14f917=_0x5a6c6c,_0x31bd1b=_0x23da29[0x0]||_0x5a6c6c[_0x25499d(0x19c)];if(!_0x31bd1b)return showParentSegmentNotSetError(_0x25499d(0x1b3)+_0x25499d(0x2d3)),0x1;const _0x4fbc0d=resolveYamlFile(_0x31bd1b);if(!existsSync(_0x4fbc0d))return showFileNotFoundError(_0x4fbc0d,_0x31bd1b),0x1;_0x14f917['verbose']&&(console[_0x25499d(0x249)](_0x25499d(0x25d)+_0x14f917[_0x25499d(0x248)]),console[_0x25499d(0x249)](_0x25499d(0x322)+_0x4fbc0d));let _0x45e00c;try{_0x45e00c=readFileSync(_0x4fbc0d,_0x25499d(0x334));}catch(_0x2a5c7f){const _0x5b2b3e=_0x2a5c7f instanceof Error?_0x2a5c7f[_0x25499d(0x2b0)]:String(_0x2a5c7f);return console[_0x25499d(0x249)](_0x25499d(0x277)+_0x5b2b3e),0x1;}const _0x45dcdb=await withSpinner(_0x25499d(0x16c),()=>_0x1659a2[_0x25499d(0x1bb)][_0x25499d(0x314)](_0x45e00c),{'verbose':_0x14f917['verbose']}),_0x10b3bf=_0x45dcdb[_0x25499d(0x234)],{isNew:_0x44ebe5,name:_0x418290,hasChanges:_0x16b911,diffFormatted:_0x187c0b}=_0x10b3bf;if(!_0x16b911)return console[_0x25499d(0x249)](_0x25499d(0x205)+_0x418290+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x44ebe5?console[_0x25499d(0x249)](_0x25499d(0x2f3)+_0x418290+'\x27:'):console['error'](_0x25499d(0x261)+_0x418290+'\x27:');console[_0x25499d(0x249)]('─'['repeat'](0x3c)),console[_0x25499d(0x249)](_0x187c0b),console[_0x25499d(0x249)]('─'[_0x25499d(0x22f)](0x3c));const _0x29e774=_0x44ebe5?_0x25499d(0x141)+_0x418290+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x418290+'\x27?';if(!_0x14f917[_0x25499d(0x318)]){if(!isInteractive())return console[_0x25499d(0x249)](a32_0x2401da[_0x25499d(0x24c)]('\x0aError:'),_0x25499d(0x2f2)),console[_0x25499d(0x249)](a32_0x2401da[_0x25499d(0x145)](_0x25499d(0x1aa))),0x1;const _0x2e88c8=await confirmKey(_0x29e774);if(!_0x2e88c8)return console[_0x25499d(0x249)](a32_0x2401da['yellow'](_0x25499d(0x2d5))),0x1;}const _0xdadb80=_0x44ebe5?_0x25499d(0x1d0):_0x25499d(0x1e5),_0x200fda=await withSpinner(_0xdadb80+_0x25499d(0x2b7)+_0x418290+_0x25499d(0x239),()=>_0x10b3bf[_0x25499d(0x1b2)](),{'verbose':_0x14f917[_0x25499d(0x1d3)]}),_0x183be9=_0x200fda[_0x25499d(0x234)],_0x50cc81=getConsoleNextUrl(_0x14f917[_0x25499d(0x248)],_0x25499d(0x25e)+_0x183be9['id']),_0x29f5a1=_0x44ebe5?_0x25499d(0x24d):_0x25499d(0x199);return console[_0x25499d(0x249)]('✔\x20'+_0x29f5a1+'\x20parent\x20segment\x20\x27'+_0x183be9[_0x25499d(0x295)]+'\x27'),console[_0x25499d(0x249)]('\x20\x20'+_0x50cc81),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x2c7);[a32_0x5407b9(0x154)]=a32_0x5407b9(0x2ce);async[a32_0x5407b9(0x320)](_0x2bca18){const _0x5e23c4=a32_0x5407b9,{options:_0x393286,args:_0x2c78ea,tdx:_0xf64788}=_0x2bca18,_0x398a6d=_0x393286,_0xcb48e6=_0x2c78ea[0x0]||_0x393286[_0x5e23c4(0x19c)];if(!_0xcb48e6)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x5e23c4(0x2b6)+_0x5e23c4(0x28d)+_0x5e23c4(0x2bc)+_0x5e23c4(0x2a9)),0x1;const _0x2d656e=resolveYamlFile(_0xcb48e6);if(!existsSync(_0x2d656e))return showFileNotFoundError(_0x2d656e,_0xcb48e6),0x1;_0x398a6d['verbose']&&(console[_0x5e23c4(0x249)](_0x5e23c4(0x25d)+_0x398a6d[_0x5e23c4(0x248)]),console['error'](_0x5e23c4(0x322)+_0x2d656e));let _0x1e6107;try{_0x1e6107=readFileSync(_0x2d656e,_0x5e23c4(0x334));}catch(_0x96c0a4){const _0x3fabc8=_0x96c0a4 instanceof Error?_0x96c0a4[_0x5e23c4(0x2b0)]:String(_0x96c0a4);return console[_0x5e23c4(0x249)](_0x5e23c4(0x277)+_0x3fabc8),0x1;}const _0x38cb09=createCommandSpinner(a32_0x2401da[_0x5e23c4(0x145)](_0x5e23c4(0x1ac)),{'verbose':_0x398a6d[_0x5e23c4(0x1d3)]});_0x38cb09['start']();const _0x434892={'onProgress':_0x4410ed=>{const _0x196c60=_0x5e23c4;_0x38cb09[_0x196c60(0x2a8)]=formatProgressMessage(_0x4410ed);}};if(_0x398a6d[_0x5e23c4(0x1f8)])_0x434892[_0x5e23c4(0x1f8)]=!![];if(_0x398a6d[_0x5e23c4(0x1bc)])_0x434892[_0x5e23c4(0x1bc)]=!![];_0x398a6d['attribute']&&(_0x434892['attribute']=_0x398a6d[_0x5e23c4(0x29a)]);_0x398a6d[_0x5e23c4(0x2a4)]&&(_0x434892['behavior']=_0x398a6d['behavior']);if(_0x398a6d[_0x5e23c4(0x1b5)])_0x434892[_0x5e23c4(0x1b5)]=_0x398a6d['interval'];let _0x299b3b;try{_0x299b3b=await _0xf64788[_0x5e23c4(0x1bb)]['validateParentYaml'](_0x1e6107,_0x434892),_0x38cb09[_0x5e23c4(0x1c8)]();}catch(_0x220b00){_0x38cb09[_0x5e23c4(0x1c8)]();throw _0x220b00;}const _0x10923e=_0x398a6d[_0x5e23c4(0x1b5)]||_0x5e23c4(0x1ef);return this[_0x5e23c4(0x198)](_0x299b3b,_0x434892,_0x2d656e,_0x10923e),_0x299b3b[_0x5e23c4(0x130)]?0x0:0x1;}[a32_0x5407b9(0x198)](_0x5e42ba,_0x49f4d7,_0x10a439,_0xc018f9){const _0x3844d6=a32_0x5407b9;console[_0x3844d6(0x249)]('\x0a'+a32_0x2401da[_0x3844d6(0x13f)](_0x3844d6(0x26a))+'\x20'+_0x5e42ba[_0x3844d6(0x295)]),console[_0x3844d6(0x249)]('═'[_0x3844d6(0x22f)](0x3c)),this[_0x3844d6(0x307)](_0x5e42ba);if(typeof _0x49f4d7['attribute']===_0x3844d6(0x32b)){this[_0x3844d6(0x1a3)](_0x5e42ba),this['displaySummary'](_0x5e42ba),this[_0x3844d6(0x226)](_0x10a439,_0xc018f9,_0x3844d6(0x29a),_0x49f4d7[_0x3844d6(0x29a)]);return;}if(_0x49f4d7[_0x3844d6(0x29a)]===!![]){this['displayAttributesStats'](_0x5e42ba),this['displaySummary'](_0x5e42ba),this[_0x3844d6(0x226)](_0x10a439,_0xc018f9,_0x3844d6(0x1cb));return;}if(typeof _0x49f4d7[_0x3844d6(0x2a4)]==='string'){this[_0x3844d6(0x1b8)](_0x5e42ba,_0xc018f9),this[_0x3844d6(0x275)](_0x5e42ba),this[_0x3844d6(0x226)](_0x10a439,_0xc018f9,_0x3844d6(0x2a4),_0x49f4d7[_0x3844d6(0x2a4)]);return;}if(_0x49f4d7['behavior']===!![]){this[_0x3844d6(0x1b8)](_0x5e42ba,_0xc018f9),this[_0x3844d6(0x275)](_0x5e42ba),this[_0x3844d6(0x226)](_0x10a439,_0xc018f9,_0x3844d6(0x176));return;}this[_0x3844d6(0x1a3)](_0x5e42ba),this[_0x3844d6(0x1b8)](_0x5e42ba,_0xc018f9),this[_0x3844d6(0x26f)](_0x5e42ba),this[_0x3844d6(0x275)](_0x5e42ba),this[_0x3844d6(0x226)](_0x10a439,_0xc018f9,_0x3844d6(0x15e));}[a32_0x5407b9(0x26f)](_0x4fe073){displayRealtimeValidation(_0x4fe073);}[a32_0x5407b9(0x226)](_0xd42326,_0x22a25a,_0x52e35b,_0x72c0f4){const _0x1f2382=a32_0x5407b9;console[_0x1f2382(0x249)]('\x0a'+a32_0x2401da[_0x1f2382(0x145)](_0x1f2382(0x2da)));const _0x15d960=_0x22a25a!==_0x1f2382(0x1ef)?'\x20--interval\x20'+_0x22a25a:'';if(_0x52e35b===_0x1f2382(0x29a)&&_0x72c0f4)console[_0x1f2382(0x249)]('\x20\x20'+a32_0x2401da['dim'](_0x1f2382(0x327)+_0xd42326+'\x20--attribute\x20\x22'+_0x72c0f4+'\x22'+_0x15d960));else{if(_0x52e35b==='behavior'&&_0x72c0f4)console['error']('\x20\x20'+a32_0x2401da[_0x1f2382(0x145)](_0x1f2382(0x327)+_0xd42326+'\x20--behavior\x20\x22'+_0x72c0f4+'\x22'+_0x15d960));else(_0x52e35b===_0x1f2382(0x1cb)||_0x52e35b===_0x1f2382(0x15e))&&console['error']('\x20\x20'+a32_0x2401da['dim']('tdx\x20ps\x20preview\x20'+_0xd42326+_0x1f2382(0x1b4)+_0x15d960));}(_0x52e35b===_0x1f2382(0x176)||_0x52e35b===_0x1f2382(0x15e))&&console[_0x1f2382(0x249)]('\x20\x20'+a32_0x2401da[_0x1f2382(0x145)](_0x1f2382(0x327)+_0xd42326+'\x20--behavior\x20\x22<name>\x22'+_0x15d960)),_0x52e35b===_0x1f2382(0x15e)&&console['error']('\x20\x20'+a32_0x2401da[_0x1f2382(0x145)](_0x1f2382(0x327)+_0xd42326+'\x20--enriched'+_0x15d960));}['displayMasterInfo'](_0x562384){const _0x374e0e=a32_0x5407b9,{master:_0x5b4e36}=_0x562384,_0x46d576=_0x5b4e36[_0x374e0e(0x2be)]?a32_0x2401da[_0x374e0e(0x32a)]('✔'):a32_0x2401da['red']('✘');console[_0x374e0e(0x249)]('\x0a'+a32_0x2401da['dim']('Master\x20Table')),console[_0x374e0e(0x249)](_0x46d576+'\x20'+a32_0x2401da[_0x374e0e(0x13f)](_0x5b4e36[_0x374e0e(0x149)]+'.'+_0x5b4e36[_0x374e0e(0x235)])),_0x5b4e36['schemaValid']?_0x5b4e36[_0x374e0e(0x1f4)]!==undefined&&console[_0x374e0e(0x249)]('\x20\x20'+a32_0x2401da[_0x374e0e(0x145)](_0x374e0e(0x151))+'\x20'+a32_0x2401da[_0x374e0e(0x19b)](formatRows(_0x5b4e36[_0x374e0e(0x1f4)]))):console[_0x374e0e(0x249)]('\x20\x20'+a32_0x2401da[_0x374e0e(0x24c)](_0x374e0e(0x2d0))+'\x20'+_0x5b4e36[_0x374e0e(0x317)]);}['displayAttributesStats'](_0xa9208){const _0x1634df=a32_0x5407b9;if(_0xa9208[_0x1634df(0x1cb)]['length']===0x0)return;console[_0x1634df(0x249)]('\x0a'+a32_0x2401da[_0x1634df(0x145)]('Attributes'));for(const _0x5ec9ff of _0xa9208[_0x1634df(0x1cb)]){const _0x5a3785=_0x5ec9ff['schemaValid']?a32_0x2401da[_0x1634df(0x32a)]('✔'):a32_0x2401da[_0x1634df(0x24c)]('✘');let _0x3a8260='';if(_0x5ec9ff[_0x1634df(0x2be)]&&_0x5ec9ff[_0x1634df(0x2df)]!==undefined&&_0x5ec9ff[_0x1634df(0x328)]!==undefined){const _0x276ea5=_0x5ec9ff['coveragePercent'][_0x1634df(0x271)](0x1),_0x2e1312=_0x5ec9ff[_0x1634df(0x328)]>=0x50?a32_0x2401da[_0x1634df(0x32a)]:_0x5ec9ff[_0x1634df(0x328)]>=0x32?a32_0x2401da[_0x1634df(0x191)]:a32_0x2401da['red'];_0x3a8260='\x20'+a32_0x2401da[_0x1634df(0x145)](_0x1634df(0x2ef))+'\x20'+_0x2e1312(_0x276ea5+'%')+'\x20('+formatRows(_0x5ec9ff[_0x1634df(0x2df)])+'\x20rows)';}console['error'](_0x5a3785+'\x20'+a32_0x2401da[_0x1634df(0x13f)](_0x5ec9ff[_0x1634df(0x295)])+_0x3a8260),console[_0x1634df(0x249)]('\x20\x20'+a32_0x2401da[_0x1634df(0x145)]('Source:')+'\x20'+a32_0x2401da[_0x1634df(0x13f)](_0x5ec9ff['database']+'.'+_0x5ec9ff[_0x1634df(0x235)]));const _0x1fa6da=_0x5ec9ff[_0x1634df(0x2ed)]===_0x5ec9ff[_0x1634df(0x1c7)]?a32_0x2401da[_0x1634df(0x145)](_0x1634df(0x257))+'\x20'+_0x5ec9ff['joinKey']:a32_0x2401da[_0x1634df(0x145)](_0x1634df(0x137))+'\x20'+_0x5ec9ff[_0x1634df(0x2ed)]+_0x1634df(0x2b1)+_0x5ec9ff['foreignKey'];console[_0x1634df(0x249)]('\x20\x20'+_0x1fa6da),console['error']('\x20\x20'+a32_0x2401da['dim'](_0x1634df(0x298))),this[_0x1634df(0x2e4)](_0x5ec9ff[_0x1634df(0x253)]),!_0x5ec9ff[_0x1634df(0x2be)]&&console['error']('\x20\x20'+a32_0x2401da['red']('Error:')+'\x20'+_0x5ec9ff['schemaError']);}}[a32_0x5407b9(0x1b8)](_0x55609d,_0x3e7579){const _0x396e18=a32_0x5407b9;if(_0x55609d[_0x396e18(0x176)][_0x396e18(0x28a)]===0x0)return;console[_0x396e18(0x249)]('\x0a'+a32_0x2401da[_0x396e18(0x145)]('Behaviors')+'\x20'+a32_0x2401da[_0x396e18(0x145)]('('+_0x3e7579+')'));for(const _0x5e39a3 of _0x55609d[_0x396e18(0x176)]){const _0x2b0f62=_0x5e39a3[_0x396e18(0x2be)]?a32_0x2401da[_0x396e18(0x32a)]('✔'):a32_0x2401da[_0x396e18(0x24c)]('✘');let _0x5f58b3='';if(_0x5e39a3[_0x396e18(0x2be)]&&_0x5e39a3[_0x396e18(0x140)]!==undefined&&_0x5e39a3[_0x396e18(0x1e4)]!==undefined){const _0xa29741=_0x5e39a3[_0x396e18(0x132)]?.[_0x396e18(0x271)](0x1)||'?',_0x2f8e9a=(_0x5e39a3['customerPercent']??0x0)>=0x32?a32_0x2401da[_0x396e18(0x32a)]:(_0x5e39a3[_0x396e18(0x132)]??0x0)>=0x14?a32_0x2401da[_0x396e18(0x191)]:a32_0x2401da[_0x396e18(0x24c)];_0x5f58b3='\x20'+a32_0x2401da[_0x396e18(0x145)](_0x396e18(0x31a))+'\x20'+_0x2f8e9a(formatRows(_0x5e39a3['customersWithEvents']))+'\x20('+_0xa29741+_0x396e18(0x16e)+a32_0x2401da[_0x396e18(0x145)]('Events:')+'\x20'+a32_0x2401da[_0x396e18(0x19b)](formatRows(_0x5e39a3[_0x396e18(0x1e4)]));}console[_0x396e18(0x249)](_0x2b0f62+'\x20'+a32_0x2401da[_0x396e18(0x13f)](_0x5e39a3[_0x396e18(0x295)])+_0x5f58b3),console[_0x396e18(0x249)]('\x20\x20'+a32_0x2401da['dim'](_0x396e18(0x223))+'\x20'+a32_0x2401da[_0x396e18(0x13f)](_0x5e39a3[_0x396e18(0x149)]+'.'+_0x5e39a3[_0x396e18(0x235)]));const _0x13dd97=_0x5e39a3[_0x396e18(0x2ed)]===_0x5e39a3[_0x396e18(0x1c7)]?a32_0x2401da['dim']('Join\x20on:')+'\x20'+_0x5e39a3[_0x396e18(0x2ed)]:a32_0x2401da[_0x396e18(0x145)](_0x396e18(0x137))+'\x20'+_0x5e39a3['joinKey']+_0x396e18(0x2b1)+_0x5e39a3[_0x396e18(0x1c7)];console[_0x396e18(0x249)]('\x20\x20'+_0x13dd97),console[_0x396e18(0x249)]('\x20\x20'+a32_0x2401da[_0x396e18(0x145)]('Columns:')),this[_0x396e18(0x2e4)](_0x5e39a3[_0x396e18(0x253)]),!_0x5e39a3[_0x396e18(0x2be)]&&console[_0x396e18(0x249)]('\x20\x20'+a32_0x2401da['red']('Error:')+'\x20'+_0x5e39a3[_0x396e18(0x317)]);}}[a32_0x5407b9(0x2e4)](_0x578b7c){const _0x192041=a32_0x5407b9;for(const _0x4046af of _0x578b7c){_0x4046af['label']===_0x4046af[_0x192041(0x256)]||_0x4046af[_0x192041(0x256)]==='*'?console['error']('\x20\x20\x20\x20-\x20'+_0x4046af[_0x192041(0x196)]):console['error'](_0x192041(0x26d)+_0x4046af[_0x192041(0x196)]+'\x20'+a32_0x2401da[_0x192041(0x145)]('('+_0x4046af[_0x192041(0x256)]+')'));}}[a32_0x5407b9(0x275)](_0x296a95){const _0x3e7df8=a32_0x5407b9;console[_0x3e7df8(0x249)]('─'[_0x3e7df8(0x22f)](0x3c));if(_0x296a95['errors'][_0x3e7df8(0x28a)]>0x0){console[_0x3e7df8(0x249)]('\x0a'+a32_0x2401da['red'](_0x3e7df8(0x1f7)));for(const _0x4a6c93 of _0x296a95[_0x3e7df8(0x321)]){console[_0x3e7df8(0x249)]('\x20\x20'+a32_0x2401da[_0x3e7df8(0x24c)]('•')+'\x20'+_0x4a6c93);}}_0x296a95['allValid']&&console[_0x3e7df8(0x249)]('\x0a'+a32_0x2401da['green']('✔')+_0x3e7df8(0x1fd));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a32_0x5407b9(0x330);[a32_0x5407b9(0x154)]='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async[a32_0x5407b9(0x320)](_0x308b75){const _0x75065=a32_0x5407b9,{options:_0x432f40,args:_0x74da7f,tdx:_0x1824aa}=_0x308b75,_0x282bdc=_0x432f40,_0x41e597=_0x74da7f[0x0]||_0x432f40[_0x75065(0x19c)];if(!_0x41e597)return showParentSegmentNotSetError(_0x75065(0x1d7)+_0x75065(0x143)+'Options\x20(one\x20required):\x0a'+_0x75065(0x224)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x75065(0x21d)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x282bdc[_0x75065(0x1f8)]&&!_0x282bdc[_0x75065(0x29a)]&&!_0x282bdc[_0x75065(0x2a4)]&&!_0x282bdc[_0x75065(0x1bc)])return console['error'](a32_0x2401da[_0x75065(0x24c)](_0x75065(0x207))),console['error'](_0x75065(0x31e)),console[_0x75065(0x249)](_0x75065(0x2a3)),console[_0x75065(0x249)](_0x75065(0x283)),console[_0x75065(0x249)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console['error'](_0x75065(0x2ba)),console[_0x75065(0x249)](_0x75065(0x326)),0x1;const _0x458009=resolveYamlFile(_0x41e597);if(!existsSync(_0x458009))return showFileNotFoundError(_0x458009,_0x41e597),0x1;_0x282bdc[_0x75065(0x1d3)]&&(console[_0x75065(0x249)]('Site:\x20'+_0x282bdc['site']),console[_0x75065(0x249)](_0x75065(0x322)+_0x458009));let _0x8f154a;try{_0x8f154a=readFileSync(_0x458009,_0x75065(0x334));}catch(_0x49e126){const _0x5c3b33=_0x49e126 instanceof Error?_0x49e126[_0x75065(0x2b0)]:String(_0x49e126);return console['error'](_0x75065(0x277)+_0x5c3b33),0x1;}let _0x204207;try{_0x204207=parseDef(_0x8f154a);}catch(_0x4675b3){const _0x13d6ec=_0x4675b3 instanceof Error?_0x4675b3['message']:String(_0x4675b3);return console[_0x75065(0x249)](a32_0x2401da[_0x75065(0x24c)](_0x75065(0x28f)+_0x13d6ec)),0x1;}if(_0x282bdc[_0x75065(0x29a)]===!![]||_0x282bdc[_0x75065(0x29a)]===''){const _0x4161a6=_0x204207[_0x75065(0x1cb)]?.[_0x75065(0x24e)](_0x5530c7=>_0x5530c7[_0x75065(0x295)])||[];if(_0x4161a6[_0x75065(0x28a)]===0x0)console['error'](a32_0x2401da[_0x75065(0x24c)](_0x75065(0x1f9)));else{console['error'](a32_0x2401da['red'](_0x75065(0x13e))),console['error'](_0x75065(0x17f));for(const _0x474e95 of _0x4161a6){console[_0x75065(0x249)]('\x20\x20'+a32_0x2401da[_0x75065(0x19b)](_0x474e95));}console[_0x75065(0x249)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x41e597+'\x20--attribute\x20\x22'+_0x4161a6[0x0]+'\x22');}return 0x1;}if(_0x282bdc[_0x75065(0x2a4)]===!![]||_0x282bdc[_0x75065(0x2a4)]===''){const _0x2dc474=_0x204207[_0x75065(0x176)]?.['map'](_0x5e15f8=>_0x5e15f8[_0x75065(0x295)])||[];if(_0x2dc474['length']===0x0)console[_0x75065(0x249)](a32_0x2401da[_0x75065(0x24c)](_0x75065(0x187)));else{console[_0x75065(0x249)](a32_0x2401da[_0x75065(0x24c)](_0x75065(0x1e3))),console['error'](_0x75065(0x1f6));for(const _0x46f969 of _0x2dc474){console[_0x75065(0x249)]('\x20\x20'+a32_0x2401da['cyan'](_0x46f969));}console[_0x75065(0x249)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x41e597+'\x20--behavior\x20\x22'+_0x2dc474[0x0]+'\x22');}return 0x1;}const _0x33d52f=createCommandSpinner(a32_0x2401da[_0x75065(0x145)](_0x75065(0x287)),{'verbose':_0x282bdc[_0x75065(0x1d3)]});_0x33d52f[_0x75065(0x1a9)]();const _0x4934ac={'onProgress':_0xa3345=>{const _0x66d812=_0x75065;_0x33d52f[_0x66d812(0x2a8)]=formatProgressMessage(_0xa3345);}};if(_0x282bdc[_0x75065(0x1f8)])_0x4934ac[_0x75065(0x1f8)]=!![];if(_0x282bdc[_0x75065(0x29a)]&&typeof _0x282bdc['attribute']===_0x75065(0x32b))_0x4934ac[_0x75065(0x29a)]=_0x282bdc[_0x75065(0x29a)];if(_0x282bdc[_0x75065(0x2a4)]&&typeof _0x282bdc[_0x75065(0x2a4)]===_0x75065(0x32b))_0x4934ac[_0x75065(0x2a4)]=_0x282bdc[_0x75065(0x2a4)];if(_0x282bdc['enriched'])_0x4934ac[_0x75065(0x1bc)]=!![];if(_0x282bdc[_0x75065(0x1b5)])_0x4934ac[_0x75065(0x1b5)]=_0x282bdc['interval'];let _0x2451ee;try{_0x2451ee=await _0x1824aa['segment']['previewParentYaml'](_0x8f154a,_0x4934ac),_0x33d52f['stop']();}catch(_0x4cd563){_0x33d52f[_0x75065(0x1c8)]();throw _0x4cd563;}return await this[_0x75065(0x316)](_0x2451ee,{'master':_0x282bdc[_0x75065(0x1f8)],'attribute':typeof _0x282bdc[_0x75065(0x29a)]===_0x75065(0x32b)?_0x282bdc[_0x75065(0x29a)]:undefined,'behavior':typeof _0x282bdc[_0x75065(0x2a4)]===_0x75065(0x32b)?_0x282bdc['behavior']:undefined,'enriched':_0x282bdc[_0x75065(0x1bc)]}),_0x2451ee[_0x75065(0x130)]?0x0:0x1;}async[a32_0x5407b9(0x316)](_0x1171e4,_0x3c2ec5){const _0x1e9c9e=a32_0x5407b9;console[_0x1e9c9e(0x249)]('\x0a'+a32_0x2401da[_0x1e9c9e(0x13f)](_0x1e9c9e(0x246))+'\x20'+_0x1171e4[_0x1e9c9e(0x295)]),console[_0x1e9c9e(0x249)]('═'[_0x1e9c9e(0x22f)](0x3c));if(_0x3c2ec5[_0x1e9c9e(0x1f8)]&&_0x1171e4[_0x1e9c9e(0x340)]){const _0x5085d7=a32_0x2401da[_0x1e9c9e(0x145)](_0x1e9c9e(0x2f7))+'\x20'+a32_0x2401da[_0x1e9c9e(0x13f)](_0x1171e4['master'][_0x1e9c9e(0x149)]+'.'+_0x1171e4[_0x1e9c9e(0x1f8)][_0x1e9c9e(0x235)]);await this[_0x1e9c9e(0x19f)](_0x5085d7,_0x1171e4[_0x1e9c9e(0x340)]);}else{if(_0x3c2ec5[_0x1e9c9e(0x29a)]&&_0x1171e4['sampleData']){const _0xd363bf=a32_0x2401da[_0x1e9c9e(0x145)](_0x1e9c9e(0x241))+'\x20'+a32_0x2401da['bold'](_0x3c2ec5[_0x1e9c9e(0x29a)]);await this[_0x1e9c9e(0x19f)](_0xd363bf,_0x1171e4['sampleData']);}else{if(_0x3c2ec5[_0x1e9c9e(0x2a4)]&&_0x1171e4['sampleData']){const _0x21f8b0=a32_0x2401da[_0x1e9c9e(0x145)](_0x1e9c9e(0x21b))+'\x20'+a32_0x2401da[_0x1e9c9e(0x13f)](_0x3c2ec5[_0x1e9c9e(0x2a4)]);await this['displaySampleData'](_0x21f8b0,_0x1171e4[_0x1e9c9e(0x340)]);}else{if(_0x3c2ec5[_0x1e9c9e(0x1bc)]&&_0x1171e4['sampleData']){const _0x48cac4=a32_0x2401da[_0x1e9c9e(0x145)](_0x1e9c9e(0x1d6))+'\x20'+a32_0x2401da[_0x1e9c9e(0x13f)](_0x1e9c9e(0x231));await this[_0x1e9c9e(0x19f)](_0x48cac4,_0x1171e4[_0x1e9c9e(0x340)]);}else!_0x1171e4[_0x1e9c9e(0x340)]&&console['error'](_0x1e9c9e(0x30b));}}}if(_0x1171e4[_0x1e9c9e(0x321)]['length']>0x0){console[_0x1e9c9e(0x249)]('─'['repeat'](0x3c)),console[_0x1e9c9e(0x249)]('\x0a'+a32_0x2401da[_0x1e9c9e(0x24c)](_0x1e9c9e(0x1f7)));for(const _0x2c603f of _0x1171e4[_0x1e9c9e(0x321)]){console['error']('\x20\x20'+a32_0x2401da[_0x1e9c9e(0x24c)]('•')+'\x20'+_0x2c603f);}}}async['displaySampleData'](_0x12db15,_0x39a291){const _0x219aef=a32_0x5407b9;if(_0x39a291['length']===0x0){console['error']('\x0a'+_0x12db15),console[_0x219aef(0x249)]('\x20\x20No\x20sample\x20data\x20available');return;}console['error']('\x0a'+_0x12db15);const _0x408e97=Object[_0x219aef(0x192)](_0x39a291[0x0])['map'](_0x17c2bb=>({'name':_0x17c2bb,'type':typeof _0x39a291[0x0][_0x17c2bb]===_0x219aef(0x1c1)?'double':_0x219aef(0x290)})),_0x9ed0f2={'queryId':'preview','columns':_0x408e97,'data':_0x39a291,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x39a291[_0x219aef(0x28a)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x4714fc=formatAsTable(_0x9ed0f2,_0x39a291[_0x219aef(0x28a)],!![]);await writeOutput(_0x4714fc,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x2bb);[a32_0x5407b9(0x154)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a32_0x5407b9(0x320)](_0x19551b){const _0x101728=a32_0x5407b9,{options:_0x299b8e,args:_0xf67fea,tdx:_0x29aca9}=_0x19551b,_0x3a4d17=_0x299b8e,_0x5e6737=_0xf67fea[0x0]||_0x299b8e['parentSegment'];if(!_0x5e6737)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+_0x101728(0x292)),0x1;const _0x545b83=resolveYamlFile(_0x5e6737);if(existsSync(_0x545b83)){_0x3a4d17[_0x101728(0x1d3)]&&console['error'](_0x101728(0x1f3)+_0x545b83);let _0x369ae7;try{_0x369ae7=readFileSync(_0x545b83,'utf-8');}catch(_0x5054d3){const _0x155cd9=_0x5054d3 instanceof Error?_0x5054d3[_0x101728(0x2b0)]:String(_0x5054d3);return console[_0x101728(0x249)](_0x101728(0x277)+_0x155cd9),0x1;}const _0x589971=await withSpinner(_0x101728(0x16c),()=>_0x29aca9['segment'][_0x101728(0x314)](_0x369ae7),{'verbose':_0x3a4d17['verbose']}),_0x26486e=_0x589971[_0x101728(0x234)],{isNew:_0x18eb04,name:_0x6bbd4,hasChanges:_0x22b52c,diffFormatted:_0x5e9cc9}=_0x26486e;if(_0x22b52c){_0x18eb04?console[_0x101728(0x249)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x6bbd4+'\x27:'):console[_0x101728(0x249)](_0x101728(0x261)+_0x6bbd4+'\x27:');console[_0x101728(0x249)]('─'[_0x101728(0x22f)](0x3c)),console['error'](_0x5e9cc9),console[_0x101728(0x249)]('─'[_0x101728(0x22f)](0x3c));const _0x1a163c=_0x18eb04?_0x101728(0x141)+_0x6bbd4+_0x101728(0x222):'Apply\x20changes\x20to\x20\x27'+_0x6bbd4+_0x101728(0x222);if(!_0x3a4d17[_0x101728(0x318)]){if(!isInteractive())return console[_0x101728(0x249)](a32_0x2401da[_0x101728(0x24c)](_0x101728(0x168)),_0x101728(0x2f2)),console['error'](a32_0x2401da[_0x101728(0x145)](_0x101728(0x1aa))),0x1;const _0x342545=await confirmKey(_0x1a163c);if(!_0x342545)return console['error'](a32_0x2401da['yellow'](_0x101728(0x2d5))),0x1;}const _0x3a32a5=_0x18eb04?_0x101728(0x1d0):'Updating';await withSpinner(_0x3a32a5+_0x101728(0x2b7)+_0x6bbd4+_0x101728(0x239),()=>_0x26486e['apply'](),{'verbose':_0x3a4d17[_0x101728(0x1d3)]});const _0x3ba972=_0x18eb04?_0x101728(0x24d):'Updated';console[_0x101728(0x249)]('✔\x20'+_0x3ba972+_0x101728(0x2b7)+_0x6bbd4+'\x27');}else console[_0x101728(0x249)]('✔\x20No\x20changes\x20-\x20\x27'+_0x6bbd4+_0x101728(0x1dd));}const _0x41beed=await withSpinner(_0x101728(0x14d)+_0x5e6737+'\x27...',()=>_0x29aca9[_0x101728(0x1bb)][_0x101728(0x1a0)](_0x5e6737),{'verbose':_0x3a4d17[_0x101728(0x1d3)]}),_0x23d5d5=_0x41beed[_0x101728(0x234)],_0x49f5b2=getConsoleUrl(_0x3a4d17['site'],_0x101728(0x164)+_0x23d5d5['workflowId']+_0x101728(0x33d)+_0x23d5d5['workflowSessionId']+_0x101728(0x189)+_0x23d5d5['workflowAttemptId']);return console[_0x101728(0x249)]('\x0a✔\x20Workflow\x20started'),console[_0x101728(0x249)]('\x20\x20'+a32_0x2401da[_0x101728(0x145)](_0x101728(0x2f0))+'\x20'+_0x23d5d5[_0x101728(0x14f)]),console[_0x101728(0x249)]('\x20\x20'+a32_0x2401da[_0x101728(0x145)]('Status:')+'\x20'+_0x23d5d5[_0x101728(0x17a)]),console[_0x101728(0x249)]('\x20\x20'+a32_0x2401da[_0x101728(0x145)]('Session:')+'\x20'+_0x23d5d5['workflowSessionId']),console[_0x101728(0x249)]('\x20\x20'+a32_0x2401da[_0x101728(0x145)](_0x101728(0x339))+'\x20'+_0x23d5d5[_0x101728(0x26b)]),console['error']('\x20\x20'+_0x49f5b2),console[_0x101728(0x249)]('\x0a'+a32_0x2401da[_0x101728(0x145)](_0x101728(0x243))+_0x101728(0x270)+_0x23d5d5[_0x101728(0x26b)]+_0x101728(0x23d)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a32_0x5407b9(0x303);[a32_0x5407b9(0x154)]='List\x20available\x20fields\x20for\x20segmentation';async[a32_0x5407b9(0x320)](_0x1dca50){const _0x4dda4d=a32_0x5407b9,{options:_0x280e62,args:_0x383261,tdx:_0x42db9b}=_0x1dca50,_0x5a2b12=_0x383261[0x0]||_0x280e62[_0x4dda4d(0x19c)];if(!_0x5a2b12)return showParentSegmentNotSetError(_0x4dda4d(0x220)+_0x4dda4d(0x1b7)),0x1;_0x280e62[_0x4dda4d(0x1d3)]&&(console['error'](_0x4dda4d(0x25d)+_0x280e62['site']),console[_0x4dda4d(0x249)](_0x4dda4d(0x202)+_0x5a2b12));const _0x1b1ae4=await withSpinner(_0x4dda4d(0x2ca)+_0x5a2b12+_0x4dda4d(0x239),()=>_0x42db9b['segment']['listFields'](_0x5a2b12),{'verbose':_0x280e62[_0x4dda4d(0x1d3)]}),_0x3e1eac=_0x1b1ae4[_0x4dda4d(0x234)];console[_0x4dda4d(0x249)](_0x4dda4d(0x27b)+_0x3e1eac[_0x4dda4d(0x28a)]+_0x4dda4d(0x268)+(_0x3e1eac[_0x4dda4d(0x28a)]!==0x1?'s':''));if(_0x280e62[_0x4dda4d(0x2ab)]||_0x280e62[_0x4dda4d(0x1c4)])return await handleSDKOutput(_0x3e1eac,_0x280e62),0x0;return displayFieldsHumanReadable(_0x3e1eac,_0x5a2b12),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a32_0x5407b9(0x295)]='segment:parent:view';[a32_0x5407b9(0x154)]=a32_0x5407b9(0x274);async['execute'](_0x384c47){const _0x3eaf1d=a32_0x5407b9,{options:_0x47ff64,args:_0xd83502,tdx:_0x4fc865}=_0x384c47,_0x57275d=_0x47ff64,_0x43d73e=_0xd83502[0x0]||_0x47ff64[_0x3eaf1d(0x19c)];if(!_0x43d73e)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'+_0x3eaf1d(0x221)+_0x3eaf1d(0x2b6)+_0x3eaf1d(0x16a)),0x1;_0x47ff64[_0x3eaf1d(0x1d3)]&&(console['error'](_0x3eaf1d(0x25d)+_0x47ff64['site']),console['error']('Parent\x20segment:\x20'+_0x43d73e));const _0x2a82e1=await withSpinner(_0x3eaf1d(0x153)+_0x43d73e+_0x3eaf1d(0x239),()=>_0x4fc865[_0x3eaf1d(0x1bb)][_0x3eaf1d(0x1f1)](_0x43d73e),{'verbose':_0x47ff64[_0x3eaf1d(0x1d3)]}),_0x3b73f5=_0x2a82e1[_0x3eaf1d(0x234)];if(_0x57275d[_0x3eaf1d(0x2b8)]){const _0x114a43=getConsoleNextUrl(_0x57275d[_0x3eaf1d(0x248)],_0x3eaf1d(0x25e)+_0x3b73f5['id']);return console['error'](a32_0x2401da[_0x3eaf1d(0x32a)]('✔')+_0x3eaf1d(0x280)+a32_0x2401da[_0x3eaf1d(0x19b)](_0x114a43)),openBrowser(_0x114a43),0x0;}return await handleSingleObjectOutput(_0x3b73f5,_0x47ff64),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a32_0x5407b9(0x295)]='segment:parent:desc';['description']=a32_0x5407b9(0x20a);async[a32_0x5407b9(0x320)](_0x567bcb){const _0x5f1b62=a32_0x5407b9,{options:_0xf740e6,args:_0x2fcebb,tdx:_0x2483fc}=_0x567bcb,_0xaec202=_0xf740e6,_0x8bdf34=_0x2fcebb[0x0]||_0xf740e6[_0x5f1b62(0x19c)];if(!_0x8bdf34)return showParentSegmentNotSetError(_0x5f1b62(0x172)+'\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'+_0x5f1b62(0x2b6)+_0x5f1b62(0x1cc)),0x1;_0xf740e6[_0x5f1b62(0x1d3)]&&(console[_0x5f1b62(0x249)](_0x5f1b62(0x25d)+_0xf740e6['site']),console[_0x5f1b62(0x249)]('Parent\x20segment:\x20'+_0x8bdf34));const _0x29ed4c=await withSpinner(_0x5f1b62(0x1d2)+_0x8bdf34+_0x5f1b62(0x239),()=>_0x2483fc[_0x5f1b62(0x1bb)][_0x5f1b62(0x21a)](_0x8bdf34),{'verbose':_0xf740e6[_0x5f1b62(0x1d3)]}),_0x3ef627=_0x29ed4c[_0x5f1b62(0x234)],_0x4c1130=_0x2483fc[_0x5f1b62(0x1bb)][_0x5f1b62(0x296)](_0x3ef627);if(_0xaec202[_0x5f1b62(0x24f)]){const _0x1913df=await this[_0x5f1b62(0x214)](_0x567bcb,_0x8bdf34,_0x3ef627,_0x4c1130),_0x1bdb07=this[_0x5f1b62(0x269)](_0x1913df);writeFileSync(_0xaec202['output'],_0x1bdb07);const _0x306493=_0x1913df[_0x5f1b62(0x27e)][_0x5f1b62(0x253)]['length']+_0x1913df['behaviors']['reduce']((_0x38cfea,_0x4d74eb)=>_0x38cfea+_0x4d74eb[_0x5f1b62(0x253)][_0x5f1b62(0x28a)],0x0),_0x376a58=_0x1913df[_0x5f1b62(0x176)][_0x5f1b62(0x16d)](_0x102c2d=>_0x102c2d[_0x5f1b62(0x253)]['length']===0x0)[_0x5f1b62(0x28a)];return console['log']('Schema\x20saved\x20to\x20'+_0xaec202[_0x5f1b62(0x24f)]),console[_0x5f1b62(0x2fd)](_0x5f1b62(0x21c)+_0x4c1130),console['log'](_0x5f1b62(0x1be)+_0x1913df[_0x5f1b62(0x176)][_0x5f1b62(0x28a)]+_0x5f1b62(0x18b)),console[_0x5f1b62(0x2fd)](_0x5f1b62(0x22b)+_0x306493+_0x5f1b62(0x1c5)),_0x376a58>0x0&&console[_0x5f1b62(0x2fd)]('\x20\x20Note:\x20'+_0x376a58+_0x5f1b62(0x294)),0x0;}console['error']('\x0a'+a32_0x2401da['bold'](_0x5f1b62(0x329))+'\x20'+a32_0x2401da['cyan'](_0x4c1130));const _0x2c416e=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x2483fc['segment'][_0x5f1b62(0x30c)](_0x3ef627),{'verbose':_0xf740e6[_0x5f1b62(0x1d3)]});console[_0x5f1b62(0x249)]('\x0a'+a32_0x2401da['bold']('customers')+'\x20'+a32_0x2401da[_0x5f1b62(0x145)]('('+_0x4c1130+_0x5f1b62(0x1b6)));const _0x227d6d=await executeSchemaQuery(_0x2c416e[_0x5f1b62(0x234)],_0x2483fc,_0xf740e6);await handleQueryOutput(_0x227d6d,_0xf740e6);const _0x45608e=await withSpinner(_0x5f1b62(0x1bd),()=>_0x2483fc['segment']['getBehaviorNames'](_0x3ef627),{'verbose':_0xf740e6[_0x5f1b62(0x1d3)]});for(const _0x1bef04 of _0x45608e[_0x5f1b62(0x234)]){const _0x4d6945=_0x5f1b62(0x2e8)+_0x1bef04['toLowerCase']()['replace'](/\s+/g,'_'),_0x532cf5='SELECT\x20*\x20FROM\x20'+_0x4c1130+'.'+_0x4d6945;console[_0x5f1b62(0x249)]('\x0a'+a32_0x2401da[_0x5f1b62(0x13f)](_0x1bef04)+'\x20'+a32_0x2401da[_0x5f1b62(0x145)]('('+_0x4c1130+'.'+_0x4d6945+')'));try{const _0x1e7371=await executeSchemaQuery(_0x532cf5,_0x2483fc,_0xf740e6);await handleQueryOutput(_0x1e7371,_0xf740e6);}catch{console[_0x5f1b62(0x249)](a32_0x2401da[_0x5f1b62(0x191)](_0x5f1b62(0x1c6)));}}return 0x0;}async[a32_0x5407b9(0x214)](_0x575fd3,_0x4dd8f,_0x4898b6,_0x36b232){const _0x493be2=a32_0x5407b9,{options:_0x56a630,tdx:_0x545298}=_0x575fd3,_0x4870c9=await withSpinner(_0x493be2(0x264),()=>_0x545298[_0x493be2(0x1bb)][_0x493be2(0x30c)](_0x4898b6),{'verbose':_0x56a630['verbose']}),_0x1a076c=await executeSchemaQuery(_0x4870c9[_0x493be2(0x234)],_0x545298,_0x56a630),_0x354332=_0x1a076c[_0x493be2(0x234)][_0x493be2(0x24e)](_0x4631d7=>({'name':_0x4631d7[_0x493be2(0x323)],'type':_0x4631d7[_0x493be2(0x299)]})),_0x2ab82c=await withSpinner(_0x493be2(0x1bd),()=>_0x545298['segment']['getBehaviorNames'](_0x4898b6),{'verbose':_0x56a630[_0x493be2(0x1d3)]}),_0x55451b=[];for(const _0x48d27f of _0x2ab82c['data']){const _0x32397f='behavior_'+_0x48d27f[_0x493be2(0x181)]()[_0x493be2(0x15a)](/\s+/g,'_'),_0xefcf6a=_0x493be2(0x29d)+_0x36b232+'.'+_0x32397f;let _0x57cb17=[];try{const _0x508add=await executeSchemaQuery(_0xefcf6a,_0x545298,_0x56a630);_0x57cb17=_0x508add[_0x493be2(0x234)][_0x493be2(0x24e)](_0x592561=>({'name':_0x592561[_0x493be2(0x323)],'type':_0x592561[_0x493be2(0x299)]}));}catch{}_0x55451b[_0x493be2(0x2ae)]({'table':_0x32397f,'columns':_0x57cb17});}return{'database':_0x36b232,'parent_segment':_0x4dd8f,'parent_id':_0x4898b6,'customers':{'table':_0x493be2(0x27e),'columns':_0x354332},'behaviors':_0x55451b};}[a32_0x5407b9(0x269)](_0x563687){const _0x5ee320=a32_0x5407b9,_0x2feb8b=_0x1c9a28=>{const _0x444c8b=a32_0x192d;if(_0x1c9a28['length']===0x0)return'[]';const _0x1231a1=_0x1c9a28[_0x444c8b(0x24e)](_0x47e70e=>_0x444c8b(0x2f9)+_0x47e70e[_0x444c8b(0x295)]+'\x22,\x20\x22type\x22:\x20\x22'+_0x47e70e[_0x444c8b(0x260)]+_0x444c8b(0x1b0));return'[\x0a'+_0x1231a1['join'](',\x0a')+_0x444c8b(0x1d5);},_0x59a649=_0x563687[_0x5ee320(0x176)]['map'](_0x5222b3=>{const _0x388838=_0x5ee320;return _0x388838(0x219)+_0x5222b3['table']+_0x388838(0x2d6)+_0x2feb8b(_0x5222b3['columns'])[_0x388838(0x15a)](/^/gm,'\x20\x20')[_0x388838(0x31d)]()+_0x388838(0x175);})[_0x5ee320(0x32f)](',\x0a');return _0x5ee320(0x186)+_0x563687[_0x5ee320(0x149)]+_0x5ee320(0x1e6)+_0x563687[_0x5ee320(0x2c6)]+_0x5ee320(0x1cd)+_0x563687[_0x5ee320(0x22c)]+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x563687[_0x5ee320(0x27e)][_0x5ee320(0x235)]+_0x5ee320(0x2bf)+_0x2feb8b(_0x563687[_0x5ee320(0x27e)]['columns'])[_0x5ee320(0x15a)](/^/gm,'\x20\x20')['trim']()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x59a649+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a32_0x5407b9(0x295)]='segment:parent:sql';[a32_0x5407b9(0x154)]=a32_0x5407b9(0x1ba);async[a32_0x5407b9(0x320)](_0x12c219){const _0x4eae11=a32_0x5407b9,{options:_0xa9e083,args:_0x41c2e1,tdx:_0x2e771c}=_0x12c219,_0xa6d233=_0x41c2e1[0x0]||_0xa9e083['parentSegment'];if(!_0xa6d233)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x4eae11(0x201)),0x1;_0xa9e083[_0x4eae11(0x1d3)]&&(console[_0x4eae11(0x249)]('Site:\x20'+_0xa9e083[_0x4eae11(0x248)]),console[_0x4eae11(0x249)](_0x4eae11(0x202)+_0xa6d233));const _0x417ae=await withSpinner(_0x4eae11(0x1d2)+_0xa6d233+_0x4eae11(0x239),()=>_0x2e771c[_0x4eae11(0x1bb)][_0x4eae11(0x21a)](_0xa6d233),{'verbose':_0xa9e083['verbose']}),_0x2f4ae4=_0x417ae[_0x4eae11(0x234)],_0x197f5a=await withSpinner(_0x4eae11(0x193)+_0xa6d233+_0x4eae11(0x239),()=>_0x2e771c[_0x4eae11(0x1bb)][_0x4eae11(0x30c)](_0x2f4ae4),{'verbose':_0xa9e083[_0x4eae11(0x1d3)]}),_0x3767f8=_0x197f5a[_0x4eae11(0x234)];return _0xa9e083[_0x4eae11(0x1fa)]===_0x4eae11(0x2ab)||_0xa9e083[_0x4eae11(0x1fa)]===_0x4eae11(0x1c4)?await handleSDKOutput([{'sql':_0x3767f8}],_0xa9e083):console[_0x4eae11(0x2fd)](_0x3767f8),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x1e2);['description']='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a32_0x5407b9(0x320)](_0x3bf155){const _0x8f4a23=a32_0x5407b9,{options:_0x2ab53b,args:_0x1d2947,tdx:_0x2bac88}=_0x3bf155,_0x46dd9a=_0x1d2947[0x0]||_0x2ab53b[_0x8f4a23(0x19c)];if(!_0x46dd9a)return showParentSegmentNotSetError(_0x8f4a23(0x2d8)+'\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;_0x2ab53b[_0x8f4a23(0x1d3)]&&(console[_0x8f4a23(0x249)](_0x8f4a23(0x25d)+_0x2ab53b[_0x8f4a23(0x248)]),console[_0x8f4a23(0x249)](_0x8f4a23(0x202)+_0x46dd9a));const _0xed3136=await withSpinner(_0x8f4a23(0x1d2)+_0x46dd9a+'\x27...',()=>_0x2bac88[_0x8f4a23(0x1bb)]['resolveParentId'](_0x46dd9a),{'verbose':_0x2ab53b[_0x8f4a23(0x1d3)]}),_0x54f825=_0xed3136['data'],_0x57f483=await withSpinner(_0x8f4a23(0x193)+_0x46dd9a+_0x8f4a23(0x239),()=>_0x2bac88['segment'][_0x8f4a23(0x30c)](_0x54f825),{'verbose':_0x2ab53b[_0x8f4a23(0x1d3)]});let _0x53a211=_0x57f483['data'];const _0x2e78aa=resolveLimit(_0x2ab53b[_0x8f4a23(0x1d9)],DEFAULT_DISPLAY_LIMIT),_0x66624f=/\bLIMIT\s+\d+/i['test'](_0x53a211);!_0x66624f&&(_0x53a211=_0x53a211[_0x8f4a23(0x31d)]()[_0x8f4a23(0x15a)](/;+$/,''),_0x53a211=_0x8f4a23(0x1eb)+_0x53a211+_0x8f4a23(0x312)+_0x2e78aa);_0x2ab53b[_0x8f4a23(0x1d3)]&&console[_0x8f4a23(0x249)]('SQL\x20query:\x0a'+_0x53a211);const _0x5c924d=await withProgressSpinner(_0x8f4a23(0x200),async _0x40ccf6=>{const _0x1d5540=_0x8f4a23,_0x668fa=await _0x2bac88[_0x1d5540(0x18e)]['execute'](_0x53a211,{'catalog':'td','schema':_0x1d5540(0x135),'onJobId':_0x274539=>{const _0x2a0efc=_0x1d5540;_0x40ccf6[_0x2a0efc(0x305)](_0x274539);}});return _0x668fa;},{'verbose':_0x2ab53b['verbose']}),_0x52091c=_0x5c924d[_0x8f4a23(0x234)],_0x34a471=_0x52091c[_0x8f4a23(0x156)]?_0x8f4a23(0x204)+_0x52091c['jobId']+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x52091c['stats'][_0x8f4a23(0x2cc)][_0x8f4a23(0x31b)]()+'\x20rows\x20'+(_0x8f4a23(0x23c)+formatElapsed(_0x52091c[_0x8f4a23(0x2e3)][_0x8f4a23(0x284)])+_0x34a471)),await handleQueryOutput(_0x52091c,_0x2ab53b),0x0;}}export class PSRtListCommand extends BaseCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x2e6);[a32_0x5407b9(0x154)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a32_0x5407b9(0x320)](_0x4116e9){const _0x17545c=a32_0x5407b9,{options:_0x2c843d,args:_0x4a10a3,tdx:_0x267fb5}=_0x4116e9,_0x21eb24=_0x4a10a3[0x0],_0x3774ef=await withSpinner(_0x21eb24?_0x17545c(0x24a)+_0x21eb24+_0x17545c(0x239):_0x17545c(0x26e),()=>_0x267fb5[_0x17545c(0x259)]['list'](),{'verbose':_0x2c843d[_0x17545c(0x1d3)]});let _0x574306=_0x3774ef[_0x17545c(0x234)][_0x17545c(0x16d)](_0x43e6f0=>_0x43e6f0[_0x17545c(0x233)]);if(_0x21eb24){const _0x1740ea=_0x21eb24['replace'](/[.+^${}()|[\]\\]/g,_0x17545c(0x244))[_0x17545c(0x15a)](/\*/g,'.*')[_0x17545c(0x15a)](/\?/g,'.'),_0x4d3cad=new RegExp('^'+_0x1740ea+'$','i');_0x574306=_0x574306[_0x17545c(0x16d)](_0x1155a6=>_0x4d3cad['test'](_0x1155a6[_0x17545c(0x295)]));}_0x574306[_0x17545c(0x1ab)]((_0x3de245,_0x33fb96)=>_0x3de245[_0x17545c(0x295)][_0x17545c(0x2a6)](_0x33fb96[_0x17545c(0x295)])),console[_0x17545c(0x249)]('✔\x20Found\x20'+_0x574306['length']+_0x17545c(0x21e)+(_0x574306[_0x17545c(0x28a)]!==0x1?'s':''));const _0x543712=_0x3d586f=>{const _0x480532=_0x17545c;return getConsoleNextUrl(_0x2c843d[_0x480532(0x248)],_0x480532(0x25e)+_0x3d586f);};if(_0x2c843d[_0x17545c(0x1fa)]===_0x17545c(0x2ab)||_0x2c843d[_0x17545c(0x1fa)]==='jsonl'){const _0x599437=_0x574306[_0x17545c(0x24e)](_0x279c4f=>({..._0x279c4f,'url':_0x543712(_0x279c4f['id'])}));await handleSDKOutput(_0x599437,_0x2c843d);}else{if(_0x574306[_0x17545c(0x28a)]===0x0)console['log'](_0x17545c(0x250));else for(const _0x14656e of _0x574306){const _0x3f7255=_0x14656e[_0x17545c(0x155)]?a32_0x2401da[_0x17545c(0x145)]('\x20('+formatRows(_0x14656e['population'])+')'):'',_0x42c568=hyperlink(_0x14656e[_0x17545c(0x295)],_0x543712(_0x14656e['id']));console[_0x17545c(0x2fd)]('⚡\x20'+_0x42c568+_0x3f7255);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a32_0x5407b9(0x295)]='ps:rt:validate';['description']=a32_0x5407b9(0x1c2);async[a32_0x5407b9(0x320)](_0x2c9ba3){const _0x1bbe9c=a32_0x5407b9,{options:_0x1cbb99,args:_0x26fa48,tdx:_0x57e3ad}=_0x2c9ba3,_0x14fc84=_0x26fa48[0x0]||_0x1cbb99[_0x1bbe9c(0x19c)];if(!_0x14fc84)return showParentSegmentNotSetError(_0x1bbe9c(0x2d9)+_0x1bbe9c(0x12f)),0x1;const _0x1616a=resolveYamlFile(_0x14fc84);if(!existsSync(_0x1616a))return showFileNotFoundError(_0x1616a,_0x14fc84),0x1;let _0x524905;try{_0x524905=readFileSync(_0x1616a,_0x1bbe9c(0x334));}catch(_0x4be39b){const _0x2d9331=_0x4be39b instanceof Error?_0x4be39b['message']:String(_0x4be39b);return console[_0x1bbe9c(0x249)](_0x1bbe9c(0x277)+_0x2d9331),0x1;}const _0x4bbebc=createCommandSpinner(a32_0x2401da[_0x1bbe9c(0x145)]('Validating\x20RT\x20configuration...'),{'verbose':_0x1cbb99[_0x1bbe9c(0x1d3)]});_0x4bbebc['start']();const _0x57185a={'realtime':!![],'onProgress':_0x50e3fc=>{const _0x352337=_0x1bbe9c;_0x4bbebc[_0x352337(0x2a8)]=formatProgressMessage(_0x50e3fc);}};let _0x3696da;try{_0x3696da=await _0x57e3ad['segment']['validateParentYaml'](_0x524905,_0x57185a),_0x4bbebc['stop']();}catch(_0x105cab){_0x4bbebc[_0x1bbe9c(0x1c8)]();throw _0x105cab;}console[_0x1bbe9c(0x249)]('\x0a'+a32_0x2401da[_0x1bbe9c(0x13f)]('RT\x202.0\x20Validate:')+'\x20'+_0x3696da['name']),console[_0x1bbe9c(0x249)]('═'[_0x1bbe9c(0x22f)](0x3c)),displayRealtimeValidation(_0x3696da),console[_0x1bbe9c(0x249)]('─'['repeat'](0x3c));if(_0x3696da[_0x1bbe9c(0x321)][_0x1bbe9c(0x28a)]>0x0){console[_0x1bbe9c(0x249)]('\x0a'+a32_0x2401da[_0x1bbe9c(0x24c)]('Errors:'));for(const _0x4a5030 of _0x3696da[_0x1bbe9c(0x321)]){console[_0x1bbe9c(0x249)]('\x20\x20'+a32_0x2401da[_0x1bbe9c(0x24c)]('•')+'\x20'+_0x4a5030);}}return _0x3696da[_0x1bbe9c(0x130)]&&console['error']('\x0a'+a32_0x2401da[_0x1bbe9c(0x32a)]('✔')+_0x1bbe9c(0x27d)),_0x3696da['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{['name']=a32_0x5407b9(0x22e);['description']=a32_0x5407b9(0x2c1);async[a32_0x5407b9(0x320)](_0x15378c){const _0x44e46f=a32_0x5407b9,{options:_0x42e9b8,args:_0x1e99ad,tdx:_0x1aed64}=_0x15378c,_0xd47ef2=_0x1e99ad[0x0]||_0x42e9b8[_0x44e46f(0x19c)];if(!_0xd47ef2)return showParentSegmentNotSetError(_0x44e46f(0x18c)+_0x44e46f(0x1ea)),0x1;_0x42e9b8[_0x44e46f(0x1d3)]&&(console['error']('Site:\x20'+_0x42e9b8[_0x44e46f(0x248)]),console[_0x44e46f(0x249)]('Parent\x20segment:\x20'+_0xd47ef2));const _0x2d6a27=await withSpinner(_0x44e46f(0x1d2)+_0xd47ef2+_0x44e46f(0x239),()=>_0x1aed64[_0x44e46f(0x1bb)][_0x44e46f(0x21a)](_0xd47ef2),{'verbose':_0x42e9b8[_0x44e46f(0x1d3)]}),_0x67dad7=_0x2d6a27[_0x44e46f(0x234)],_0x5efbd9=await withSpinner(_0x44e46f(0x1a1)+_0xd47ef2+_0x44e46f(0x239),()=>_0x1aed64['realtime'][_0x44e46f(0x216)](_0x67dad7),{'verbose':_0x42e9b8[_0x44e46f(0x1d3)]}),_0x3424f4=_0x5efbd9[_0x44e46f(0x234)];console[_0x44e46f(0x249)](_0x44e46f(0x27b)+_0x3424f4[_0x44e46f(0x28a)]+_0x44e46f(0x238)+(_0x3424f4['length']!==0x1?'s':''));if(_0x42e9b8[_0x44e46f(0x1fa)]===_0x44e46f(0x2ab)||_0x42e9b8['format']==='jsonl')await handleSDKOutput(_0x3424f4,_0x42e9b8);else{if(_0x3424f4[_0x44e46f(0x28a)]===0x0)console['log'](_0x44e46f(0x15c));else for(const _0x4d19b3 of _0x3424f4){const _0x2ee93d=_0x4d19b3['state']===_0x44e46f(0x2c4)?'🚀':'📝',_0x216795=_0x4d19b3[_0x44e46f(0x162)]?a32_0x2401da['yellow']('\x20(paused)'):'',_0x5d0ea2=a32_0x2401da[_0x44e46f(0x145)]('\x20('+_0x4d19b3[_0x44e46f(0x2e9)]+_0x44e46f(0x2fb)+(_0x4d19b3[_0x44e46f(0x2e9)]!==0x1?'s':'')+')');console[_0x44e46f(0x2fd)](_0x2ee93d+'\x20'+_0x4d19b3[_0x44e46f(0x295)]+_0x216795+_0x5d0ea2);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{['name']=a32_0x5407b9(0x252);[a32_0x5407b9(0x154)]=a32_0x5407b9(0x26c);async[a32_0x5407b9(0x320)](_0x336b71){const _0x333dfc=a32_0x5407b9,{options:_0x10f6d5,args:_0x1905d9,tdx:_0xcb91bf}=_0x336b71,_0x5e694d=_0x1905d9[0x0];if(!_0x5e694d)return console[_0x333dfc(0x249)](a32_0x2401da[_0x333dfc(0x24c)](_0x333dfc(0x14b))),console['error'](_0x333dfc(0x142)),console[_0x333dfc(0x249)](a32_0x2401da[_0x333dfc(0x145)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x10f6d5[_0x333dfc(0x1d3)]&&(console['error']('Site:\x20'+_0x10f6d5[_0x333dfc(0x248)]),console[_0x333dfc(0x249)](_0x333dfc(0x265)+_0x5e694d));const _0x526e64=await withSpinner(_0x333dfc(0x209)+_0x5e694d+_0x333dfc(0x239),()=>_0xcb91bf['realtime']['pauseJourney'](_0x5e694d),{'verbose':_0x10f6d5[_0x333dfc(0x1d3)]}),_0x14b137=_0x526e64['data'];console['error'](_0x333dfc(0x148)+_0x14b137[_0x333dfc(0x295)]+'\x27');if(_0x10f6d5[_0x333dfc(0x1fa)]===_0x333dfc(0x2ab)||_0x10f6d5[_0x333dfc(0x1fa)]===_0x333dfc(0x1c4))await handleSDKOutput([_0x14b137],_0x10f6d5);else{const _0x5a8f5c=_0x14b137[_0x333dfc(0x13d)]===_0x333dfc(0x2c4)?'🚀':'📝',_0x324ee6=_0x14b137['paused']?a32_0x2401da[_0x333dfc(0x191)](_0x333dfc(0x136)):'';console[_0x333dfc(0x2fd)](_0x5a8f5c+'\x20'+_0x14b137[_0x333dfc(0x295)]+_0x324ee6);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a32_0x5407b9(0x295)]='ps:rt:jn:resume';[a32_0x5407b9(0x154)]=a32_0x5407b9(0x33f);async[a32_0x5407b9(0x320)](_0x45572f){const _0x449d27=a32_0x5407b9,{options:_0x19c7e9,args:_0x3ef930,tdx:_0x1623f9}=_0x45572f,_0x1b2824=_0x3ef930[0x0];if(!_0x1b2824)return console[_0x449d27(0x249)](a32_0x2401da['red'](_0x449d27(0x14b))),console[_0x449d27(0x249)](_0x449d27(0x25f)),console[_0x449d27(0x249)](a32_0x2401da[_0x449d27(0x145)](_0x449d27(0x2f5))),0x1;_0x19c7e9[_0x449d27(0x1d3)]&&(console[_0x449d27(0x249)](_0x449d27(0x25d)+_0x19c7e9[_0x449d27(0x248)]),console[_0x449d27(0x249)](_0x449d27(0x265)+_0x1b2824));const _0x16bfe6=await withSpinner(_0x449d27(0x29e)+_0x1b2824+_0x449d27(0x239),()=>_0x1623f9[_0x449d27(0x259)][_0x449d27(0x2a0)](_0x1b2824),{'verbose':_0x19c7e9['verbose']}),_0xb59135=_0x16bfe6['data'];console['error'](_0x449d27(0x13a)+_0xb59135[_0x449d27(0x295)]+'\x27');if(_0x19c7e9[_0x449d27(0x1fa)]===_0x449d27(0x2ab)||_0x19c7e9['format']===_0x449d27(0x1c4))await handleSDKOutput([_0xb59135],_0x19c7e9);else{const _0x8c2956=_0xb59135['state']==='launched'?'🚀':'📝',_0x5710fe=_0xb59135[_0x449d27(0x162)]?a32_0x2401da[_0x449d27(0x191)](_0x449d27(0x136)):'';console['log'](_0x8c2956+'\x20'+_0xb59135[_0x449d27(0x295)]+_0x5710fe);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x166);[a32_0x5407b9(0x154)]=a32_0x5407b9(0x19d);async[a32_0x5407b9(0x320)](_0x7d1137){const _0x4d346a=a32_0x5407b9,{options:_0x2ff218,args:_0x4be850,tdx:_0x49767e}=_0x7d1137,_0x3fa08b=_0x4be850[0x0]||_0x2ff218[_0x4d346a(0x19c)];if(!_0x3fa08b)return showParentSegmentNotSetError(_0x4d346a(0x23b)+_0x4d346a(0x2b4)),0x1;_0x2ff218[_0x4d346a(0x1d3)]&&(console['error']('Site:\x20'+_0x2ff218[_0x4d346a(0x248)]),console['error']('Parent\x20segment:\x20'+_0x3fa08b));const _0x14c20a=await withSpinner(_0x4d346a(0x1d2)+_0x3fa08b+_0x4d346a(0x239),()=>_0x49767e[_0x4d346a(0x1bb)]['resolveParentId'](_0x3fa08b),{'verbose':_0x2ff218[_0x4d346a(0x1d3)]}),_0x405113=_0x14c20a[_0x4d346a(0x234)],_0x262477=await withSpinner(_0x4d346a(0x229)+_0x3fa08b+_0x4d346a(0x239),()=>_0x49767e[_0x4d346a(0x259)]['getCurrentConfigVersion'](_0x405113),{'verbose':_0x2ff218[_0x4d346a(0x1d3)]}),_0x1fc8bc=_0x262477['data'];return console[_0x4d346a(0x249)](_0x4d346a(0x165)),_0x2ff218[_0x4d346a(0x1fa)]==='json'||_0x2ff218[_0x4d346a(0x1fa)]==='jsonl'?await handleSDKOutput([_0x1fc8bc],_0x2ff218):(console['log'](_0x4d346a(0x169)+_0x1fc8bc['id']),console[_0x4d346a(0x2fd)](_0x4d346a(0x286)+_0x1fc8bc[_0x4d346a(0x14f)]),console['log'](_0x4d346a(0x279)+_0x1fc8bc['identifier']),console[_0x4d346a(0x2fd)](_0x4d346a(0x32c)+_0x1fc8bc[_0x4d346a(0x255)]),console[_0x4d346a(0x2fd)](_0x4d346a(0x1ce)+_0x1fc8bc[_0x4d346a(0x17a)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x331);[a32_0x5407b9(0x154)]=a32_0x5407b9(0x152);async[a32_0x5407b9(0x320)](_0x3f95d2){const _0xb95705=a32_0x5407b9,{options:_0x1c4339,args:_0x2a2277,tdx:_0xf5a7ec}=_0x3f95d2,_0x78eb1a=_0x2a2277[0x0]||_0x1c4339[_0xb95705(0x19c)];if(!_0x78eb1a)return showParentSegmentNotSetError(_0xb95705(0x338)+_0xb95705(0x20e)),0x1;const _0x119c01=await withSpinner(_0xb95705(0x1d2)+_0x78eb1a+'\x27...',()=>_0xf5a7ec[_0xb95705(0x1bb)][_0xb95705(0x21a)](_0x78eb1a),{'verbose':_0x1c4339['verbose']}),_0x3be21c=_0x119c01['data'],_0x44d182=await withSpinner(_0xb95705(0x2c5)+_0x78eb1a+_0xb95705(0x239),()=>_0xf5a7ec['personalization'][_0xb95705(0x333)](_0x3be21c),{'verbose':_0x1c4339['verbose']}),_0x4af730=_0x44d182[_0xb95705(0x234)];console['error'](_0xb95705(0x27b)+_0x4af730[_0xb95705(0x28a)]+_0xb95705(0x2c0)+(_0x4af730[_0xb95705(0x28a)]!==0x1?'s':''));if(_0x1c4339[_0xb95705(0x1fa)]===_0xb95705(0x2ab)||_0x1c4339[_0xb95705(0x1fa)]==='jsonl')await handleSDKOutput(_0x4af730,_0x1c4339);else{if(_0x4af730[_0xb95705(0x28a)]===0x0)console[_0xb95705(0x2fd)](_0xb95705(0x2bd)),console[_0xb95705(0x249)](a32_0x2401da[_0xb95705(0x19b)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x64ec63 of _0x4af730){console[_0xb95705(0x2fd)](a32_0x2401da[_0xb95705(0x13f)](_0x64ec63[_0xb95705(0x295)])+'\x20'+a32_0x2401da['dim'](_0xb95705(0x2d1)+_0x64ec63['id']+')'));_0x64ec63['description']&&console[_0xb95705(0x2fd)]('\x20\x20'+a32_0x2401da['dim'](_0x64ec63[_0xb95705(0x154)]));if(_0x64ec63[_0xb95705(0x30d)]&&_0x64ec63[_0xb95705(0x30d)]['length']>0x0)for(const _0x263741 of _0x64ec63[_0xb95705(0x30d)]){const _0x37ed76=_0x263741[_0xb95705(0x32d)]?.[_0xb95705(0x28a)]?_0x263741[_0xb95705(0x32d)][_0xb95705(0x32f)](',\x20'):'any';console[_0xb95705(0x2fd)]('\x20\x20'+a32_0x2401da[_0xb95705(0x19b)](_0xb95705(0x306))+'\x20'+_0x263741[_0xb95705(0x295)]+'\x20'+a32_0x2401da[_0xb95705(0x145)]('(id:\x20'+_0x263741['id']+')')),console[_0xb95705(0x2fd)]('\x20\x20\x20\x20'+a32_0x2401da['dim'](_0xb95705(0x311))+'\x20'+_0x37ed76);}else console[_0xb95705(0x2fd)]('\x20\x20'+a32_0x2401da[_0xb95705(0x145)](_0xb95705(0x1af)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x225);[a32_0x5407b9(0x154)]=a32_0x5407b9(0x319);async['execute'](_0x56e652){const _0x1b321b=a32_0x5407b9,{options:_0x1519a8,args:_0x56c214,tdx:_0x31bbb3}=_0x56e652,_0x1714cb=_0x1519a8,_0x485a40=_0x56c214[0x0],_0x5569a4=_0x56c214[0x1]||_0x1519a8[_0x1b321b(0x19c)];if(!_0x485a40)return console[_0x1b321b(0x249)](_0x1b321b(0x33e)),console[_0x1b321b(0x249)](_0x1b321b(0x21f)),console[_0x1b321b(0x249)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x5569a4)return showParentSegmentNotSetError(_0x1b321b(0x144)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x3eea91=await withSpinner(_0x1b321b(0x1d2)+_0x5569a4+_0x1b321b(0x239),()=>_0x31bbb3[_0x1b321b(0x1bb)][_0x1b321b(0x21a)](_0x5569a4),{'verbose':_0x1519a8[_0x1b321b(0x1d3)]}),_0x1f2361=_0x3eea91[_0x1b321b(0x234)],_0x250a2b={'name':_0x485a40,'description':_0x1714cb['description'],'public':_0x1714cb[_0x1b321b(0x1ee)]},_0x1af197=await withSpinner(_0x1b321b(0x336)+_0x485a40+_0x1b321b(0x239),()=>_0x31bbb3[_0x1b321b(0x2fa)][_0x1b321b(0x14c)](_0x1f2361,_0x250a2b),{'verbose':_0x1519a8['verbose']}),_0x2719c9=_0x1af197['data'];return console[_0x1b321b(0x249)](_0x1b321b(0x2ff)+_0x2719c9[_0x1b321b(0x295)]+_0x1b321b(0x232)+_0x2719c9['id']),await handleSDKOutput([_0x2719c9],_0x1519a8),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']=a32_0x5407b9(0x2f4);['description']='Show\x20personalization\x20service\x20details';async[a32_0x5407b9(0x320)](_0x4f55bd){const _0x550e93=a32_0x5407b9,{options:_0x35b324,args:_0x3c01fd,tdx:_0x26644f}=_0x4f55bd,_0x5e586b=_0x3c01fd[0x0],_0x4e91d6=_0x3c01fd[0x1]||_0x35b324[_0x550e93(0x19c)];if(!_0x5e586b)return console[_0x550e93(0x249)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x550e93(0x249)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x550e93(0x249)](_0x550e93(0x25c)),0x1;if(!_0x4e91d6)return showParentSegmentNotSetError(_0x550e93(0x13b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x13a6e0=await withSpinner(_0x550e93(0x1d2)+_0x4e91d6+_0x550e93(0x239),()=>_0x26644f['segment']['resolveParentId'](_0x4e91d6),{'verbose':_0x35b324[_0x550e93(0x1d3)]}),_0xda740d=_0x13a6e0[_0x550e93(0x234)],_0x4743a5=await withSpinner(_0x550e93(0x237)+_0x5e586b+'\x27...',()=>_0x26644f[_0x550e93(0x2fa)][_0x550e93(0x18f)](_0xda740d,_0x5e586b),{'verbose':_0x35b324[_0x550e93(0x1d3)]}),_0x56ada1=_0x4743a5[_0x550e93(0x234)];if(_0x35b324[_0x550e93(0x2ab)]||_0x35b324[_0x550e93(0x1c4)])await handleSDKOutput([_0x56ada1],_0x35b324);else{console[_0x550e93(0x2fd)](a32_0x2401da['bold'](_0x56ada1[_0x550e93(0x295)])+'\x20'+a32_0x2401da[_0x550e93(0x145)](_0x550e93(0x2d1)+_0x56ada1['id']+')'));_0x56ada1[_0x550e93(0x154)]&&console[_0x550e93(0x2fd)]('\x20\x20'+a32_0x2401da['dim'](_0x56ada1[_0x550e93(0x154)]));console[_0x550e93(0x2fd)]('\x20\x20'+a32_0x2401da['cyan'](_0x550e93(0x2cb))+'\x20'+(_0x56ada1[_0x550e93(0x1ee)]?_0x550e93(0x318):'no'));if(_0x56ada1[_0x550e93(0x30d)]&&_0x56ada1[_0x550e93(0x30d)][_0x550e93(0x28a)]>0x0)for(const _0x1a38ab of _0x56ada1[_0x550e93(0x30d)]){const _0x5724c3=_0x1a38ab[_0x550e93(0x32d)]?.[_0x550e93(0x28a)]?_0x1a38ab['allowedIps']['join'](',\x20'):_0x550e93(0x160);console[_0x550e93(0x2fd)]('\x20\x20'+a32_0x2401da[_0x550e93(0x19b)](_0x550e93(0x306))+'\x20'+_0x1a38ab[_0x550e93(0x295)]+'\x20'+a32_0x2401da[_0x550e93(0x145)](_0x550e93(0x2d1)+_0x1a38ab['id']+')')),console[_0x550e93(0x2fd)](_0x550e93(0x300)+a32_0x2401da[_0x550e93(0x145)](_0x550e93(0x311))+'\x20'+_0x5724c3);}else console[_0x550e93(0x2fd)]('\x20\x20'+a32_0x2401da[_0x550e93(0x145)]('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x1ed);['description']=a32_0x5407b9(0x19e);async[a32_0x5407b9(0x320)](_0x549b47){const _0x3ece8c=a32_0x5407b9,{options:_0x4f6d55,args:_0x13e59d,tdx:_0x47a762}=_0x549b47,_0x1a8361=_0x13e59d[0x0],_0x579f61=_0x13e59d[0x1]||_0x4f6d55[_0x3ece8c(0x19c)];if(!_0x1a8361)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console[_0x3ece8c(0x249)](_0x3ece8c(0x1c9)),console['error'](_0x3ece8c(0x157)),0x1;if(!_0x579f61)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x3ece8c(0x157)),0x1;const _0x2cd465=await withSpinner(_0x3ece8c(0x1d2)+_0x579f61+_0x3ece8c(0x239),()=>_0x47a762[_0x3ece8c(0x1bb)][_0x3ece8c(0x21a)](_0x579f61),{'verbose':_0x4f6d55[_0x3ece8c(0x1d3)]}),_0x57d145=_0x2cd465[_0x3ece8c(0x234)];return await withSpinner(_0x3ece8c(0x1b1)+_0x1a8361+_0x3ece8c(0x239),()=>_0x47a762[_0x3ece8c(0x2fa)][_0x3ece8c(0x1ca)](_0x57d145,_0x1a8361),{'verbose':_0x4f6d55[_0x3ece8c(0x1d3)]}),console['error'](_0x3ece8c(0x1e0)+_0x1a8361+'\x27'),0x0;}}function a32_0x192d(_0x3f6236,_0x596681){_0x3f6236=_0x3f6236-0x12e;const _0x13958f=a32_0x1395();let _0x192db0=_0x13958f[_0x3f6236];return _0x192db0;}export class PSPzServiceUpdateCommand extends BaseCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x2e1);[a32_0x5407b9(0x154)]='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async['execute'](_0x20cfda){const _0x5a448b=a32_0x5407b9,{options:_0x590c2e,args:_0x5b65ff,tdx:_0x102a1e}=_0x20cfda,_0xc40526=_0x590c2e,_0x23a3fd=_0x5b65ff[0x0],_0x4f70a9=_0x5b65ff[0x1]||_0x590c2e['parentSegment'];if(!_0x23a3fd)return console[_0x5a448b(0x249)](_0x5a448b(0x2cd)),console[_0x5a448b(0x249)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),console[_0x5a448b(0x249)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0xc40526['name'])return console[_0x5a448b(0x249)](_0x5a448b(0x2db)),console[_0x5a448b(0x249)](_0x5a448b(0x2d4)),0x1;if(!_0x4f70a9)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+_0x5a448b(0x195)),0x1;const _0x3a0792=await withSpinner(_0x5a448b(0x1d2)+_0x4f70a9+_0x5a448b(0x239),()=>_0x102a1e[_0x5a448b(0x1bb)][_0x5a448b(0x21a)](_0x4f70a9),{'verbose':_0x590c2e[_0x5a448b(0x1d3)]}),_0x1ad09a=_0x3a0792[_0x5a448b(0x234)],_0x46a786={'name':_0xc40526[_0x5a448b(0x295)]};_0xc40526[_0x5a448b(0x154)]!==undefined&&(_0x46a786[_0x5a448b(0x154)]=_0xc40526[_0x5a448b(0x154)]);const _0x2947b6=await withSpinner(_0x5a448b(0x1fb)+_0x23a3fd+'\x27...',()=>_0x102a1e[_0x5a448b(0x2fa)][_0x5a448b(0x15f)](_0x1ad09a,_0x23a3fd,_0x46a786),{'verbose':_0x590c2e[_0x5a448b(0x1d3)]}),_0x24a75b=_0x2947b6[_0x5a448b(0x234)];return console[_0x5a448b(0x249)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x24a75b[_0x5a448b(0x295)]+'\x27'),await handleSDKOutput([_0x24a75b],_0x590c2e),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']=a32_0x5407b9(0x2cf);[a32_0x5407b9(0x154)]=a32_0x5407b9(0x285);async['execute'](_0x57a448){const _0x5eb3d7=a32_0x5407b9,{options:_0x5e5850,args:_0x22ff54,tdx:_0x5e5ac5}=_0x57a448,_0x554969=_0x5e5850,_0xe50dec=_0x22ff54[0x0],_0x2a0c52=_0x22ff54[0x1],_0x358954=_0x22ff54[0x2]||_0x5e5850[_0x5eb3d7(0x19c)];if(!_0xe50dec)return console[_0x5eb3d7(0x249)](_0x5eb3d7(0x1d1)),console[_0x5eb3d7(0x249)](_0x5eb3d7(0x2c9)),console[_0x5eb3d7(0x249)](_0x5eb3d7(0x1e9)),0x1;if(!_0x2a0c52)return console[_0x5eb3d7(0x249)](_0x5eb3d7(0x2cd)),console[_0x5eb3d7(0x249)](_0x5eb3d7(0x2c9)),console[_0x5eb3d7(0x249)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x358954)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+_0x5eb3d7(0x1e9)),0x1;const _0x3d193a=await withSpinner(_0x5eb3d7(0x1d2)+_0x358954+_0x5eb3d7(0x239),()=>_0x5e5ac5[_0x5eb3d7(0x1bb)][_0x5eb3d7(0x21a)](_0x358954),{'verbose':_0x5e5850[_0x5eb3d7(0x1d3)]}),_0x4a2838=_0x3d193a[_0x5eb3d7(0x234)],_0x243418={'name':_0xe50dec};_0x554969[_0x5eb3d7(0x32d)]&&(_0x243418[_0x5eb3d7(0x32d)]=_0x554969[_0x5eb3d7(0x32d)][_0x5eb3d7(0x20b)](',')[_0x5eb3d7(0x24e)](_0x3600ce=>_0x3600ce[_0x5eb3d7(0x31d)]()));_0x554969['description']&&(_0x243418[_0x5eb3d7(0x154)]=_0x554969[_0x5eb3d7(0x154)]);const _0x1a0af9=await withSpinner(_0x5eb3d7(0x304)+_0xe50dec+'\x27\x20for\x20service\x20\x27'+_0x2a0c52+'\x27...',()=>_0x5e5ac5[_0x5eb3d7(0x2fa)][_0x5eb3d7(0x1a8)](_0x4a2838,_0x2a0c52,_0x243418),{'verbose':_0x5e5850[_0x5eb3d7(0x1d3)]}),_0x44548a=_0x1a0af9[_0x5eb3d7(0x234)];return console[_0x5eb3d7(0x249)](_0x5eb3d7(0x25b)+_0x44548a[_0x5eb3d7(0x295)]+'\x27\x20with\x20ID:\x20'+_0x44548a['id']),_0x44548a[_0x5eb3d7(0x1a4)]&&(console['error'](a32_0x2401da[_0x5eb3d7(0x191)](_0x5eb3d7(0x180))),console['error'](a32_0x2401da['cyan'](_0x44548a[_0x5eb3d7(0x1a4)])),console['error']('')),await handleSDKOutput([_0x44548a],_0x5e5850),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x2e0);[a32_0x5407b9(0x154)]='Delete\x20a\x20token\x20from\x20a\x20personalization\x20service';async['execute'](_0x1edd97){const _0x2c2cd4=a32_0x5407b9,{options:_0x2fb5f0,args:_0x32381a,tdx:_0x263b8a}=_0x1edd97,_0x3193d6=_0x32381a[0x0],_0x5e2c21=_0x32381a[0x1]||_0x2fb5f0[_0x2c2cd4(0x19c)];if(!_0x3193d6)return console[_0x2c2cd4(0x249)](_0x2c2cd4(0x1fe)),console[_0x2c2cd4(0x249)](_0x2c2cd4(0x211)),console[_0x2c2cd4(0x249)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x5e2c21)return showParentSegmentNotSetError(_0x2c2cd4(0x30e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x5e5741=await withSpinner(_0x2c2cd4(0x1d2)+_0x5e2c21+_0x2c2cd4(0x239),()=>_0x263b8a[_0x2c2cd4(0x1bb)][_0x2c2cd4(0x21a)](_0x5e2c21),{'verbose':_0x2fb5f0[_0x2c2cd4(0x1d3)]}),_0x1fb881=_0x5e5741[_0x2c2cd4(0x234)],_0x106663=await withSpinner(_0x2c2cd4(0x23a),()=>_0x263b8a[_0x2c2cd4(0x2fa)][_0x2c2cd4(0x333)](_0x1fb881),{'verbose':_0x2fb5f0[_0x2c2cd4(0x1d3)]}),_0x5248b6=_0x106663['data'];let _0x2c6c6e;for(const _0x4e26d3 of _0x5248b6){if(_0x4e26d3[_0x2c2cd4(0x30d)]?.[_0x2c2cd4(0x263)](_0xd6efc1=>_0xd6efc1['id']===_0x3193d6)){_0x2c6c6e=_0x4e26d3['id'];break;}}if(!_0x2c6c6e)return console['error'](_0x2c2cd4(0x1dc)+_0x3193d6+'\x27\x20not\x20found\x20in\x20any\x20personalization\x20service'),0x1;const _0x30c298=await withSpinner(_0x2c2cd4(0x215)+_0x3193d6+_0x2c2cd4(0x239),()=>_0x263b8a[_0x2c2cd4(0x2fa)][_0x2c2cd4(0x242)](_0x1fb881,_0x2c6c6e,_0x3193d6),{'verbose':_0x2fb5f0['verbose']}),_0x59c05b=_0x30c298[_0x2c2cd4(0x234)];return console['error'](_0x2c2cd4(0x133)+(_0x59c05b['name']||_0x3193d6)+'\x27'),await handleSDKOutput([_0x59c05b],_0x2fb5f0),0x0;}}export class PSPzListCommand extends BaseCommand{['name']='ps:pz:list';[a32_0x5407b9(0x154)]=a32_0x5407b9(0x197);async[a32_0x5407b9(0x320)](_0xb97f1f){const _0x581873=a32_0x5407b9,{options:_0x3fe016,args:_0x8ec2a9,tdx:_0x5897b8}=_0xb97f1f,_0x173f10=_0x8ec2a9[0x0]||_0x3fe016[_0x581873(0x19c)];if(!_0x173f10)return showParentSegmentNotSetError(_0x581873(0x262)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment'),0x1;const _0x4001cf=await withSpinner(_0x581873(0x1d2)+_0x173f10+_0x581873(0x239),()=>_0x5897b8['segment']['resolveParentId'](_0x173f10),{'verbose':_0x3fe016[_0x581873(0x1d3)]}),_0x144be9=_0x4001cf[_0x581873(0x234)],_0x45bbd3=await withSpinner(_0x581873(0x2e5)+_0x173f10+_0x581873(0x239),()=>_0x5897b8[_0x581873(0x2fa)][_0x581873(0x138)](_0x144be9),{'verbose':_0x3fe016[_0x581873(0x1d3)]}),_0x570395=_0x45bbd3[_0x581873(0x234)];console[_0x581873(0x249)](_0x581873(0x27b)+_0x570395['length']+_0x581873(0x23e)+(_0x570395['length']!==0x1?'s':''));if(_0x3fe016[_0x581873(0x1fa)]===_0x581873(0x2ab)||_0x3fe016[_0x581873(0x1fa)]===_0x581873(0x1c4))await handleSDKOutput(_0x570395,_0x3fe016);else{if(_0x570395['length']===0x0)console[_0x581873(0x2fd)](_0x581873(0x2fe));else for(const _0x4f47a0 of _0x570395){console[_0x581873(0x2fd)](a32_0x2401da['bold'](_0x4f47a0[_0x581873(0x295)])+'\x20'+a32_0x2401da[_0x581873(0x145)](_0x581873(0x2d1)+_0x4f47a0['id']+')'));_0x4f47a0[_0x581873(0x154)]&&console[_0x581873(0x2fd)]('\x20\x20'+a32_0x2401da['dim'](_0x4f47a0[_0x581873(0x154)]));const _0x415d8e=_0x4f47a0['sections']?.[_0x581873(0x28a)]||0x0;console[_0x581873(0x2fd)]('\x20\x20'+a32_0x2401da[_0x581873(0x19b)](_0x581873(0x15b))+'\x20'+_0x415d8e);if(_0x4f47a0[_0x581873(0x17b)]&&_0x4f47a0['sections'][_0x581873(0x28a)]>0x0)for(const _0x929ae of _0x4f47a0[_0x581873(0x17b)]){console[_0x581873(0x2fd)](_0x581873(0x26d)+_0x929ae['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{['name']='ps:pz:show';[a32_0x5407b9(0x154)]=a32_0x5407b9(0x24b);async[a32_0x5407b9(0x320)](_0x10de33){const _0x5c94a5=a32_0x5407b9,{options:_0x4372ba,args:_0x57dd5c,tdx:_0x16bda2}=_0x10de33,_0x5e6d68=_0x57dd5c[0x0];if(!_0x5e6d68)return console['error'](_0x5c94a5(0x247)),console[_0x5c94a5(0x249)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x578da6=await withSpinner('Getting\x20personalization\x20\x27'+_0x5e6d68+'\x27...',()=>_0x16bda2['personalization'][_0x5c94a5(0x22a)](_0x5e6d68),{'verbose':_0x4372ba[_0x5c94a5(0x1d3)]}),_0x146424=_0x578da6[_0x5c94a5(0x234)];console[_0x5c94a5(0x249)]('✔\x20Found\x20personalization\x20\x27'+_0x146424[_0x5c94a5(0x295)]+'\x27');if(_0x4372ba[_0x5c94a5(0x1fa)]===_0x5c94a5(0x2ab)||_0x4372ba[_0x5c94a5(0x1fa)]===_0x5c94a5(0x1c4))await handleSDKOutput([_0x146424],_0x4372ba);else{console[_0x5c94a5(0x2fd)](a32_0x2401da['bold'](_0x146424[_0x5c94a5(0x295)])+'\x20'+a32_0x2401da[_0x5c94a5(0x145)](_0x5c94a5(0x2d1)+_0x146424['id']+')'));_0x146424['description']&&console[_0x5c94a5(0x2fd)]('\x20\x20'+a32_0x2401da[_0x5c94a5(0x145)](_0x146424[_0x5c94a5(0x154)]));_0x146424[_0x5c94a5(0x14f)]&&console[_0x5c94a5(0x2fd)]('\x20\x20'+a32_0x2401da[_0x5c94a5(0x19b)](_0x5c94a5(0x2ec))+'\x20'+_0x146424[_0x5c94a5(0x14f)]);console[_0x5c94a5(0x2fd)]('\x20\x20'+a32_0x2401da[_0x5c94a5(0x19b)](_0x5c94a5(0x174))+'\x20'+_0x146424[_0x5c94a5(0x2a2)]),console['log']('\x20\x20'+a32_0x2401da[_0x5c94a5(0x19b)]('updated:')+'\x20'+_0x146424[_0x5c94a5(0x183)]);const _0x1f6031=_0x146424[_0x5c94a5(0x17b)]?.['length']||0x0;console[_0x5c94a5(0x2fd)]('\x20\x20'+a32_0x2401da[_0x5c94a5(0x19b)]('sections:')+'\x20'+_0x1f6031);if(_0x146424[_0x5c94a5(0x17b)]&&_0x146424['sections'][_0x5c94a5(0x28a)]>0x0)for(const _0x4cabbc of _0x146424[_0x5c94a5(0x17b)]){console['log'](_0x5c94a5(0x300)+a32_0x2401da[_0x5c94a5(0x13f)](_0x4cabbc[_0x5c94a5(0x295)])+'\x20'+a32_0x2401da['dim'](_0x5c94a5(0x2d1)+_0x4cabbc['id']+')')),_0x4cabbc[_0x5c94a5(0x2d2)]&&(console[_0x5c94a5(0x2fd)](_0x5c94a5(0x19a)+a32_0x2401da[_0x5c94a5(0x19b)](_0x5c94a5(0x2f8))+'\x20'+_0x4cabbc[_0x5c94a5(0x2d2)][_0x5c94a5(0x295)]),_0x4cabbc['entryCriteria'][_0x5c94a5(0x218)]?.[_0x5c94a5(0x188)]&&console[_0x5c94a5(0x2fd)]('\x20\x20\x20\x20\x20\x20\x20\x20'+a32_0x2401da['cyan'](_0x5c94a5(0x31c))+'\x20'+_0x4cabbc[_0x5c94a5(0x2d2)][_0x5c94a5(0x218)][_0x5c94a5(0x188)])),_0x4cabbc[_0x5c94a5(0x281)]&&console[_0x5c94a5(0x2fd)]('\x20\x20\x20\x20\x20\x20'+a32_0x2401da['cyan'](_0x5c94a5(0x23f))+'\x20'+JSON[_0x5c94a5(0x1f2)](_0x4cabbc['payload'])),_0x4cabbc[_0x5c94a5(0x2c2)]&&console[_0x5c94a5(0x2fd)](_0x5c94a5(0x19a)+a32_0x2401da['cyan'](_0x5c94a5(0x27a))+_0x5c94a5(0x2ad));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a32_0x5407b9(0x295)]='ps:pz:delete';[a32_0x5407b9(0x154)]=a32_0x5407b9(0x310);async[a32_0x5407b9(0x320)](_0x37087b){const _0x2fc4b9=a32_0x5407b9,{options:_0x4b1fa6,args:_0x3f97dd,tdx:_0x10916a}=_0x37087b,_0x57d887=_0x3f97dd[0x0];if(!_0x57d887)return console[_0x2fc4b9(0x249)](_0x2fc4b9(0x247)),console[_0x2fc4b9(0x249)](_0x2fc4b9(0x2d7)),0x1;return await withSpinner('Deleting\x20personalization\x20\x27'+_0x57d887+_0x2fc4b9(0x239),()=>_0x10916a[_0x2fc4b9(0x2fa)][_0x2fc4b9(0x2aa)](_0x57d887),{'verbose':_0x4b1fa6[_0x2fc4b9(0x1d3)]}),console[_0x2fc4b9(0x249)](_0x2fc4b9(0x2fc)+_0x57d887+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']='ps:pz:create';['description']=a32_0x5407b9(0x1de);async[a32_0x5407b9(0x320)](_0x3a5419){const _0x429d73=a32_0x5407b9,{options:_0x57bf9b,tdx:_0x29c80f}=_0x3a5419,_0x12ec1b=_0x57bf9b;let _0x4096d2;if(_0x12ec1b[_0x429d73(0x2b2)]){_0x4096d2=await loadJSON(_0x12ec1b[_0x429d73(0x2b2)],!![]);if(!_0x4096d2[_0x429d73(0x278)]?.[_0x429d73(0x29f)])return console[_0x429d73(0x249)](_0x429d73(0x33b)),console[_0x429d73(0x249)](_0x429d73(0x20c)),console[_0x429d73(0x249)](_0x429d73(0x20d)),0x1;}else{if(!_0x12ec1b[_0x429d73(0x295)])return console[_0x429d73(0x249)](_0x429d73(0x163)),console['error'](_0x429d73(0x158)),console[_0x429d73(0x249)](_0x429d73(0x2de)),0x1;if(_0x12ec1b[_0x429d73(0x154)]===undefined)return console[_0x429d73(0x249)](_0x429d73(0x1db)),console[_0x429d73(0x249)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x429d73(0x249)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x12ec1b[_0x429d73(0x203)]===undefined)return console[_0x429d73(0x249)](_0x429d73(0x1a5)),console[_0x429d73(0x249)](_0x429d73(0x2eb)),0x1;let _0x5a1efa=_0x12ec1b['audienceId'];if(!_0x5a1efa&&_0x57bf9b[_0x429d73(0x19c)]){const _0x579ac1=await withSpinner(_0x429d73(0x1d2)+_0x57bf9b['parentSegment']+'\x27...',()=>_0x29c80f[_0x429d73(0x1bb)][_0x429d73(0x21a)](_0x57bf9b[_0x429d73(0x19c)]),{'verbose':_0x57bf9b[_0x429d73(0x1d3)]});_0x5a1efa=_0x579ac1['data'];}let _0x4d01df;_0x12ec1b[_0x429d73(0x17b)]&&(_0x4d01df=await loadJSON(_0x12ec1b[_0x429d73(0x17b)],![]));const _0xc05513=_0x12ec1b['folderId']===_0x429d73(0x2b3)?null:{'id':_0x12ec1b[_0x429d73(0x203)],'type':_0x429d73(0x178)};_0x4096d2={'attributes':{'name':_0x12ec1b[_0x429d73(0x295)],'description':_0x12ec1b['description']||null,..._0x5a1efa!==undefined&&{'audienceId':_0x5a1efa},..._0x4d01df!==undefined&&{'sections':_0x4d01df}},'relationships':{'parentFolder':{'data':_0xc05513}}};}const _0x911e56=await withSpinner(_0x429d73(0x293)+(_0x4096d2[_0x429d73(0x1cb)]?.[_0x429d73(0x295)]??'')+'\x27...',()=>_0x29c80f[_0x429d73(0x2fa)][_0x429d73(0x30a)](_0x4096d2),{'verbose':_0x57bf9b[_0x429d73(0x1d3)]}),_0x2ea61e=_0x911e56[_0x429d73(0x234)];return console[_0x429d73(0x249)](_0x429d73(0x16b)+_0x2ea61e['name']+_0x429d73(0x232)+_0x2ea61e['id']),await handleSDKOutput([_0x2ea61e],_0x57bf9b),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a32_0x5407b9(0x295)]=a32_0x5407b9(0x2c3);['description']=a32_0x5407b9(0x15d);async[a32_0x5407b9(0x320)](_0x36f554){const _0x5bf56c=a32_0x5407b9,{options:_0x583b3a,args:_0x2c3a0e}=_0x36f554,_0x236a07=_0x583b3a,_0x488643=_0x2c3a0e[0x0];if(!_0x488643)return console[_0x5bf56c(0x249)](_0x5bf56c(0x247)),console[_0x5bf56c(0x249)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console['error'](_0x5bf56c(0x28e)),0x1;let _0x4c8173;if(_0x236a07['file'])_0x4c8173=await loadJSON(_0x236a07['file'],!![]);else{if(!_0x236a07[_0x5bf56c(0x295)])return console[_0x5bf56c(0x249)](_0x5bf56c(0x163)),console[_0x5bf56c(0x249)](_0x5bf56c(0x1a6)),0x1;if(_0x236a07[_0x5bf56c(0x154)]===undefined)return console[_0x5bf56c(0x249)](_0x5bf56c(0x1db)),console[_0x5bf56c(0x249)](_0x5bf56c(0x1a6)),0x1;let _0x1c9fa7;_0x236a07[_0x5bf56c(0x17b)]&&(_0x1c9fa7=await loadJSON(_0x236a07[_0x5bf56c(0x17b)],![])),_0x4c8173={'attributes':{'name':_0x236a07[_0x5bf56c(0x295)],'description':_0x236a07[_0x5bf56c(0x154)]||null,..._0x1c9fa7!==undefined&&{'sections':_0x1c9fa7}}};}const {tdx:_0x3b186e}=_0x36f554,_0x4b9bb0=await withSpinner(_0x5bf56c(0x2e2)+_0x488643+_0x5bf56c(0x239),()=>_0x3b186e['personalization'][_0x5bf56c(0x147)](_0x488643,_0x4c8173),{'verbose':_0x583b3a[_0x5bf56c(0x1d3)]}),_0xa19372=_0x4b9bb0[_0x5bf56c(0x234)];return console['error'](_0x5bf56c(0x291)+_0xa19372['name']+_0x5bf56c(0x32e)+_0xa19372['id']+')'),await handleSDKOutput([_0xa19372],_0x583b3a),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a32_0x5407b9(0x295)]='ps:pz:init';[a32_0x5407b9(0x154)]=a32_0x5407b9(0x13c);async[a32_0x5407b9(0x320)](_0x642490){const _0x3c8807=a32_0x5407b9,{options:_0x2672ce,args:_0x4bed34}=_0x642490,_0x33b96b=_0x4bed34[0x0]||_0x2672ce[_0x3c8807(0x19c)];if(!_0x33b96b)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment'),0x1;const _0x20aa1d=resolveYamlFile(_0x33b96b);if(!existsSync(_0x20aa1d))return showFileNotFoundError(_0x20aa1d,_0x33b96b),0x1;let _0x2a79aa;try{_0x2a79aa=readFileSync(_0x20aa1d,'utf-8');}catch(_0x118500){const _0x1edb55=_0x118500 instanceof Error?_0x118500['message']:String(_0x118500);return console[_0x3c8807(0x249)](_0x3c8807(0x277)+_0x1edb55),0x1;}let _0x26d859;try{_0x26d859=parseDef(_0x2a79aa);}catch(_0x3e18b6){const _0x4bc72c=_0x3e18b6 instanceof Error?_0x3e18b6['message']:String(_0x3e18b6);return console[_0x3c8807(0x249)](a32_0x2401da['red']('Error\x20parsing\x20YAML:\x20'+_0x4bc72c)),0x1;}if(_0x26d859[_0x3c8807(0x1ad)]&&_0x26d859['personalization_services'][_0x3c8807(0x28a)]>0x0)return console[_0x3c8807(0x249)](a32_0x2401da[_0x3c8807(0x191)](_0x3c8807(0x2e7)+_0x20aa1d)),console[_0x3c8807(0x249)](a32_0x2401da['dim'](_0x3c8807(0x25a)+_0x26d859['personalization_services']['length']+'\x20service(s)\x20configured')),0x1;!_0x26d859[_0x3c8807(0x259)]&&(_0x26d859[_0x3c8807(0x259)]={'events':[{'name':_0x3c8807(0x1bf),'source_table':_0x3c8807(0x2c8)}],'attributes':[{'name':'last_page_viewed','type':_0x3c8807(0x12e)}],'id_stitching':{'primary_key':_0x26d859[_0x3c8807(0x1f8)]['table']===_0x3c8807(0x27e)?_0x3c8807(0x258):'user_id'}});_0x26d859[_0x3c8807(0x1ad)]=[{'name':_0x3c8807(0x1ec),'description':_0x3c8807(0x16f),'trigger_event':_0x3c8807(0x1bf),'sections':[{'name':'Default','criteria':_0x3c8807(0x1fc),'attributes':[_0x3c8807(0x301)]}]}];const _0x2bfcbc=serializeDef(_0x26d859);return writeFileSync(_0x20aa1d,_0x2bfcbc,_0x3c8807(0x334)),console[_0x3c8807(0x249)](a32_0x2401da[_0x3c8807(0x32a)]('✔')+_0x3c8807(0x1d8)+a32_0x2401da['cyan'](_0x20aa1d)),(!_0x26d859['realtime']||_0x2a79aa[_0x3c8807(0x14e)](_0x3c8807(0x1e8))===-0x1)&&console['error'](a32_0x2401da[_0x3c8807(0x32a)]('✔')+_0x3c8807(0x206)),console['error']('\x0a'+a32_0x2401da[_0x3c8807(0x145)](_0x3c8807(0x267))),console[_0x3c8807(0x249)](_0x3c8807(0x341)+_0x20aa1d+_0x3c8807(0x2ac)),console[_0x3c8807(0x249)]('\x20\x202.\x20Run\x20'+a32_0x2401da[_0x3c8807(0x145)](_0x3c8807(0x31f)+_0x33b96b)+_0x3c8807(0x167)),0x0;}}
1
+ const a32_0x5137c3=a32_0x498a;(function(_0x2e65c6,_0x25c12b){const _0x41bffa=a32_0x498a,_0x3b3e01=_0x2e65c6();while(!![]){try{const _0x3e9726=parseInt(_0x41bffa(0x1c7))/0x1*(-parseInt(_0x41bffa(0x337))/0x2)+-parseInt(_0x41bffa(0x36a))/0x3*(-parseInt(_0x41bffa(0x2da))/0x4)+parseInt(_0x41bffa(0x329))/0x5+-parseInt(_0x41bffa(0x2cc))/0x6*(parseInt(_0x41bffa(0x34f))/0x7)+-parseInt(_0x41bffa(0x2f4))/0x8*(-parseInt(_0x41bffa(0x29f))/0x9)+parseInt(_0x41bffa(0x1d9))/0xa+-parseInt(_0x41bffa(0x27c))/0xb;if(_0x3e9726===_0x25c12b)break;else _0x3b3e01['push'](_0x3b3e01['shift']());}catch(_0x56cdf9){_0x3b3e01['push'](_0x3b3e01['shift']());}}}(a32_0x37ec,0x728b9));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a32_0x19e749 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 a32_0x38d690 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=a32_0x5137c3(0x2f9),LEGACY_PARENT_SEGMENT_DIR=a32_0x5137c3(0x237);function openBrowser(_0x2342ee){const _0x5ab3eb=a32_0x5137c3,_0x2a2c7b=process[_0x5ab3eb(0x2dc)],_0x4e7671=_0x2a2c7b==='darwin'?_0x5ab3eb(0x203):_0x2a2c7b==='win32'?_0x5ab3eb(0x2cd):_0x5ab3eb(0x1a8);spawn(_0x4e7671,[_0x2342ee],{'detached':!![],'stdio':_0x5ab3eb(0x18f)})[_0x5ab3eb(0x180)]();}function migrateLegacyDirectory(){const _0x453559=a32_0x5137c3;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x527ae6=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x527ae6[_0x453559(0x306)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x453559(0x307)](a32_0x38d690[_0x453559(0x21d)](_0x453559(0x34a)+LEGACY_PARENT_SEGMENT_DIR+_0x453559(0x1ee)+PARENT_SEGMENT_DIR+_0x453559(0x225))),console[_0x453559(0x307)](a32_0x38d690['dim'](_0x453559(0x1fa)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x453559(0x307)](a32_0x38d690[_0x453559(0x21d)](_0x453559(0x25e)+LEGACY_PARENT_SEGMENT_DIR+_0x453559(0x1e1)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x453559(0x307)](a32_0x38d690[_0x453559(0x1c4)](_0x453559(0x2e6)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4e44ec){const _0x216e40=_0x4e44ec instanceof Error?_0x4e44ec['message']:String(_0x4e44ec);return console[_0x453559(0x307)](a32_0x38d690[_0x453559(0x25d)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x216e40+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a32_0x5137c3(0x28c)](_0x3d9a1e){const _0x48431a=a32_0x5137c3;return migrateLegacyDirectory(),super[_0x48431a(0x28c)](_0x3d9a1e);}}function resolveYamlFile(_0xc139f0){const _0x2d3ebf=a32_0x5137c3;if(_0xc139f0[_0x2d3ebf(0x269)](_0x2d3ebf(0x321))||_0xc139f0[_0x2d3ebf(0x269)](_0x2d3ebf(0x1ce)))return _0xc139f0;return a32_0x19e749[_0x2d3ebf(0x2a8)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xc139f0)+_0x2d3ebf(0x321));}function formatProgressMessage(_0x54be5e){const _0x47b185=a32_0x5137c3,_0x21920f=_0x54be5e[_0x47b185(0x265)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x21920f){const [,_0x14c9b9,_0x372c53,_0x3f7f1d='']=_0x21920f;return a32_0x38d690[_0x47b185(0x385)](_0x14c9b9+':')+'\x20'+_0x372c53+a32_0x38d690['dim'](_0x3f7f1d);}return a32_0x38d690[_0x47b185(0x385)](_0x54be5e);}function showFileNotFoundError(_0x82f99e,_0x495cb9){const _0xc0649a=a32_0x5137c3;console[_0xc0649a(0x307)](a32_0x38d690[_0xc0649a(0x25d)](_0xc0649a(0x316)+_0x82f99e+'\x0a')),console[_0xc0649a(0x307)](a32_0x38d690[_0xc0649a(0x226)](_0xc0649a(0x313)+_0x495cb9+_0xc0649a(0x308)));}function displayRealtimeValidation(_0x1b3a66){const _0x5b32f5=a32_0x5137c3;if(!_0x1b3a66[_0x5b32f5(0x300)])return;const _0x167796=_0x1b3a66['realtime'],_0x2810d8=_0x167796[_0x5b32f5(0x2b7)]?a32_0x38d690[_0x5b32f5(0x1c4)](_0x5b32f5(0x2c0)):a32_0x38d690[_0x5b32f5(0x21d)](_0x5b32f5(0x363));console['error']('\x0a'+a32_0x38d690[_0x5b32f5(0x385)](_0x5b32f5(0x18a))+'\x20'+_0x2810d8);if(_0x167796[_0x5b32f5(0x33d)]&&_0x167796[_0x5b32f5(0x33d)]['length']>0x0){console['error']('\x20\x20'+a32_0x38d690[_0x5b32f5(0x385)](_0x5b32f5(0x29b))+'\x20'+_0x167796[_0x5b32f5(0x33d)][_0x5b32f5(0x199)]+_0x5b32f5(0x34c));for(const _0x471c90 of _0x167796[_0x5b32f5(0x33d)]){const _0x5ece2e=_0x471c90[_0x5b32f5(0x33c)]===![]?a32_0x38d690[_0x5b32f5(0x25d)]('✘'):a32_0x38d690[_0x5b32f5(0x1c4)]('✔');console[_0x5b32f5(0x307)](_0x5b32f5(0x399)+_0x5ece2e+'\x20'+_0x471c90[_0x5b32f5(0x276)]),_0x471c90[_0x5b32f5(0x23c)]&&console['error'](_0x5b32f5(0x218)+a32_0x38d690[_0x5b32f5(0x25d)](_0x471c90[_0x5b32f5(0x23c)]));}}if(_0x167796[_0x5b32f5(0x1a4)]&&_0x167796[_0x5b32f5(0x1a4)][_0x5b32f5(0x199)]>0x0){console[_0x5b32f5(0x307)]('\x20\x20'+a32_0x38d690[_0x5b32f5(0x385)]('Attributes:')+'\x20'+_0x167796['attributes']['length']+_0x5b32f5(0x34c));for(const _0x24611d of _0x167796['attributes']){const _0x1def51=_0x24611d[_0x5b32f5(0x1e8)]?a32_0x38d690['green']('✔'):a32_0x38d690['red']('✘');console['error']('\x20\x20\x20\x20'+_0x1def51+'\x20'+_0x24611d[_0x5b32f5(0x276)]+'\x20'+a32_0x38d690[_0x5b32f5(0x385)]('('+_0x24611d[_0x5b32f5(0x2db)]+')'));}}if(_0x167796['idStitching']){const _0x4cc423=_0x167796[_0x5b32f5(0x202)]['stitchingKeys']?.[_0x5b32f5(0x199)]?_0x5b32f5(0x2a6)+_0x167796['idStitching'][_0x5b32f5(0x1fc)][_0x5b32f5(0x2a8)](',\x20')+']':'';console[_0x5b32f5(0x307)]('\x20\x20'+a32_0x38d690[_0x5b32f5(0x385)](_0x5b32f5(0x32b))+'\x20'+_0x167796[_0x5b32f5(0x202)]['primaryKey']+_0x4cc423);}if(_0x167796[_0x5b32f5(0x38f)]&&_0x167796[_0x5b32f5(0x38f)][_0x5b32f5(0x199)]>0x0){console[_0x5b32f5(0x307)]('\x20\x20'+a32_0x38d690['dim']('Personalization:')+'\x20'+_0x167796[_0x5b32f5(0x38f)][_0x5b32f5(0x199)]+'\x20service'+(_0x167796[_0x5b32f5(0x38f)][_0x5b32f5(0x199)]!==0x1?'s':''));for(const _0x1473e4 of _0x167796[_0x5b32f5(0x38f)]){console[_0x5b32f5(0x307)](_0x5b32f5(0x327)+_0x1473e4[_0x5b32f5(0x276)]);}}}function showParentSegmentNotSetError(_0x345965){const _0xf1f56=a32_0x5137c3;console['error'](a32_0x38d690[_0xf1f56(0x21d)](_0xf1f56(0x319))),console[_0xf1f56(0x307)](_0x345965);}export class ParentSegmentListCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x2ef);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x2fa);async[a32_0x5137c3(0x22a)](_0x1c2909){const _0x3808d2=a32_0x5137c3,{options:_0x397650,args:_0xb1a8c9,tdx:_0x267e0c}=_0x1c2909,_0x5b641e=_0xb1a8c9[0x0];_0x397650[_0x3808d2(0x1ac)]&&(console[_0x3808d2(0x307)](_0x3808d2(0x2e4)+_0x397650[_0x3808d2(0x2b6)]),_0x5b641e&&console[_0x3808d2(0x307)](_0x3808d2(0x1d6)+_0x5b641e));const _0x4bf62b=await withSpinner(_0x5b641e?_0x3808d2(0x249)+_0x5b641e+_0x3808d2(0x1d7):_0x3808d2(0x2ed),()=>_0x267e0c[_0x3808d2(0x1b8)]['listParents'](),{'verbose':_0x397650[_0x3808d2(0x1ac)]});let _0x4e2bd2=_0x4bf62b[_0x3808d2(0x39a)];if(_0x5b641e){const _0x2276cd=_0x5b641e[_0x3808d2(0x214)](/[.+^${}()|[\]\\]/g,_0x3808d2(0x301))[_0x3808d2(0x214)](/\*/g,'.*')[_0x3808d2(0x214)](/\?/g,'.'),_0x5898dc=new RegExp('^'+_0x2276cd+'$','i');_0x4e2bd2=_0x4e2bd2[_0x3808d2(0x2a7)](_0x115f92=>_0x5898dc[_0x3808d2(0x1d0)](_0x115f92['attributes'][_0x3808d2(0x276)]));}_0x4e2bd2[_0x3808d2(0x362)]((_0x4be4d2,_0x52de54)=>_0x4be4d2[_0x3808d2(0x1a4)][_0x3808d2(0x276)]['localeCompare'](_0x52de54[_0x3808d2(0x1a4)]['name'])),console['error']('✔\x20Found\x20'+_0x4e2bd2['length']+_0x3808d2(0x305)+(_0x4e2bd2['length']!==0x1?'s':''));const _0x53ab2f=_0x4ef744=>{const _0x22c589=_0x3808d2;return getConsoleNextUrl(_0x397650[_0x22c589(0x2b6)],_0x22c589(0x1f9)+_0x4ef744);};if(_0x397650['format']===_0x3808d2(0x293)||_0x397650[_0x3808d2(0x312)]===_0x3808d2(0x2c3)){const _0x13626c=_0x4e2bd2[_0x3808d2(0x2b1)](_0x53463f=>({..._0x53463f,'url':_0x53ab2f(_0x53463f['id'])}));await handleSDKOutput(_0x13626c,_0x397650);}else{if(_0x4e2bd2[_0x3808d2(0x199)]===0x0)_0x5b641e?console[_0x3808d2(0x21f)](_0x3808d2(0x2eb)+_0x5b641e):console[_0x3808d2(0x21f)](_0x3808d2(0x2d1));else for(const _0x33bf32 of _0x4e2bd2){const _0x25c450=_0x33bf32[_0x3808d2(0x1a4)][_0x3808d2(0x2d4)]?a32_0x38d690[_0x3808d2(0x385)]('\x20('+formatRows(_0x33bf32[_0x3808d2(0x1a4)][_0x3808d2(0x2d4)])+')'):'',_0x39196e=hyperlink(_0x33bf32[_0x3808d2(0x1a4)][_0x3808d2(0x276)],_0x53ab2f(_0x33bf32['id']));console[_0x3808d2(0x21f)](_0x3808d2(0x212)+_0x39196e+_0x25c450);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a32_0x5137c3(0x310);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x211);async['execute'](_0x5bbe53){const _0x5dc795=a32_0x5137c3,{options:_0x977461,args:_0xbb7c5b,tdx:_0x36fb15}=_0x5bbe53;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x5dc795(0x1f2)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x18fc1f=_0x977461;if(_0xbb7c5b[_0x5dc795(0x199)]===0x0)return console[_0x5dc795(0x307)](a32_0x38d690[_0x5dc795(0x25d)](_0x5dc795(0x2f0))),console['error'](_0x5dc795(0x231)),0x1;const _0x5b5480=_0xbb7c5b[0x0];if(!_0x18fc1f['database']||!_0x18fc1f[_0x5dc795(0x19d)])return console['error'](_0x5dc795(0x2b3)),console[_0x5dc795(0x307)](_0x5dc795(0x231)),0x1;_0x18fc1f[_0x5dc795(0x1ac)]&&(console['error'](_0x5dc795(0x2e4)+_0x18fc1f[_0x5dc795(0x2b6)]),console[_0x5dc795(0x307)](_0x5dc795(0x1f0)+_0x5b5480),console[_0x5dc795(0x307)](_0x5dc795(0x1d3)+_0x18fc1f[_0x5dc795(0x347)]),console[_0x5dc795(0x307)]('Table:\x20'+_0x18fc1f[_0x5dc795(0x19d)]));const _0x28ebe4=await loadJSONFromOptions(_0x18fc1f[_0x5dc795(0x1a4)],_0x18fc1f[_0x5dc795(0x1e4)]),_0x426a0b=await loadJSONFromOptions(_0x18fc1f[_0x5dc795(0x2e7)],_0x18fc1f[_0x5dc795(0x22e)]),_0x2bc5ba=await loadJSONFromOptions(_0x18fc1f['customerGroup'],_0x18fc1f['customerGroupFile']),_0x246002={'name':_0x5b5480,'description':_0x18fc1f[_0x5dc795(0x366)],'scheduleType':_0x18fc1f[_0x5dc795(0x278)],'scheduleOption':_0x18fc1f[_0x5dc795(0x260)],'timezone':_0x18fc1f[_0x5dc795(0x28f)],'master':{'parentDatabaseName':_0x18fc1f[_0x5dc795(0x347)],'parentTableName':_0x18fc1f[_0x5dc795(0x19d)]},'attributes':_0x28ebe4,'behaviors':_0x426a0b,'customerGroup':_0x2bc5ba},_0x32ed05=await withSpinner(_0x5dc795(0x1b5)+_0x5b5480+_0x5dc795(0x1d7),()=>_0x36fb15[_0x5dc795(0x1b8)][_0x5dc795(0x2f2)](_0x246002),{'verbose':_0x977461['verbose']}),_0x83b705=_0x32ed05[_0x5dc795(0x39a)];return console[_0x5dc795(0x307)](_0x5dc795(0x230)+_0x83b705[_0x5dc795(0x276)]+_0x5dc795(0x1fe)+_0x83b705['id']),await handleSDKOutput([_0x83b705],_0x977461),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x314);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x28d);async[a32_0x5137c3(0x22a)](_0x30ea6b){const _0x101bd2=a32_0x5137c3,{options:_0x580a54,args:_0x345e44,tdx:_0x3a22b1}=_0x30ea6b;console[_0x101bd2(0x307)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x101bd2(0x1f2)+_0x101bd2(0x37d));const _0x570c56=_0x580a54;if(_0x345e44['length']===0x0)return console[_0x101bd2(0x307)](a32_0x38d690[_0x101bd2(0x25d)](_0x101bd2(0x2f0))),console[_0x101bd2(0x307)](_0x101bd2(0x229)),0x1;const _0x5bfd75=_0x345e44[0x0];_0x570c56[_0x101bd2(0x1ac)]&&(console[_0x101bd2(0x307)]('Site:\x20'+_0x570c56[_0x101bd2(0x2b6)]),console[_0x101bd2(0x307)](_0x101bd2(0x369)+_0x5bfd75));const _0x4014e9=await withSpinner(_0x101bd2(0x248)+_0x5bfd75+_0x101bd2(0x1d7),()=>_0x3a22b1[_0x101bd2(0x1b8)][_0x101bd2(0x2aa)](_0x5bfd75),{'verbose':_0x570c56[_0x101bd2(0x1ac)]}),_0x48e926=_0x4014e9[_0x101bd2(0x39a)],_0xbb8169=await loadJSONFromOptions(_0x570c56[_0x101bd2(0x20b)],_0x570c56[_0x101bd2(0x26d)]),_0x149ad2=await loadJSONFromOptions(_0x570c56[_0x101bd2(0x1ae)],_0x570c56[_0x101bd2(0x1b9)]),_0x2aaaf1={'name':_0x48e926[_0x101bd2(0x276)],'description':_0x570c56[_0x101bd2(0x366)]!==undefined?_0x570c56['description']:_0x48e926[_0x101bd2(0x366)],'scheduleType':_0x570c56[_0x101bd2(0x278)]!==undefined?_0x570c56[_0x101bd2(0x278)]:_0x48e926['scheduleType'],'scheduleOption':_0x570c56[_0x101bd2(0x260)]!==undefined?_0x570c56[_0x101bd2(0x260)]:_0x48e926[_0x101bd2(0x260)],'timezone':_0x570c56[_0x101bd2(0x28f)]!==undefined?_0x570c56[_0x101bd2(0x28f)]:_0x48e926[_0x101bd2(0x28f)],'master':_0x48e926['master'],'attributes':_0xbb8169?[..._0x48e926[_0x101bd2(0x1a4)]||[],..._0xbb8169]:_0x48e926['attributes'],'behaviors':_0x149ad2?[..._0x48e926[_0x101bd2(0x2e7)]||[],..._0x149ad2]:_0x48e926[_0x101bd2(0x2e7)],'customerGroup':_0x48e926[_0x101bd2(0x1d5)]},_0x194b40=await withSpinner(_0x101bd2(0x330)+_0x5bfd75+'\x27...',()=>_0x3a22b1[_0x101bd2(0x1b8)][_0x101bd2(0x1b2)](_0x5bfd75,_0x2aaaf1),{'verbose':_0x570c56[_0x101bd2(0x1ac)]}),_0x4f4b61=_0x194b40[_0x101bd2(0x39a)];return console[_0x101bd2(0x307)](_0x101bd2(0x1f6)+_0x4f4b61[_0x101bd2(0x276)]+'\x27'),await handleSDKOutput([_0x4f4b61],_0x570c56),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a32_0x5137c3(0x20c);['description']='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a32_0x5137c3(0x22a)](_0x1fb144){const _0x4f9906=a32_0x5137c3,{options:_0xcccb2d,args:_0x26c90c,tdx:_0x3e9adc}=_0x1fb144,_0x1418e0=_0xcccb2d,_0x1b2146=_0x26c90c[0x0]||_0xcccb2d['parentSegment'];if(!_0x1b2146)return showParentSegmentNotSetError(_0x4f9906(0x317)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x1418e0[_0x4f9906(0x32c)]&&_0x1418e0[_0x4f9906(0x37b)])return console[_0x4f9906(0x307)](a32_0x38d690['red'](_0x4f9906(0x395))),console[_0x4f9906(0x307)](a32_0x38d690[_0x4f9906(0x385)](_0x4f9906(0x292))),console[_0x4f9906(0x307)](a32_0x38d690[_0x4f9906(0x385)](_0x4f9906(0x31b)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x4f9906(0x307)](a32_0x38d690[_0x4f9906(0x226)](_0x4f9906(0x233))),0x1;const _0x73e142=_0x1418e0[_0x4f9906(0x37b)]||a32_0x19e749[_0x4f9906(0x2a8)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1b2146)+_0x4f9906(0x321));_0x1418e0[_0x4f9906(0x1ac)]&&(console[_0x4f9906(0x307)](_0x4f9906(0x2e4)+_0x1418e0[_0x4f9906(0x2b6)]),console['error'](_0x4f9906(0x369)+_0x1b2146),console[_0x4f9906(0x307)](_0x4f9906(0x354)+_0x73e142));const _0x455514=await withSpinner(_0x4f9906(0x2ff)+_0x1b2146+_0x4f9906(0x1d7),()=>_0x3e9adc[_0x4f9906(0x1b8)][_0x4f9906(0x38c)](_0x1b2146),{'verbose':_0x1418e0[_0x4f9906(0x1ac)]}),_0x201594=_0x455514[_0x4f9906(0x39a)];if(existsSync(_0x73e142)){const _0x4a8f21=readFileSync(_0x73e142,_0x4f9906(0x243)),_0x16fdf6=generateDiff(_0x4a8f21,_0x201594);if(!hasChanges(_0x16fdf6))console[_0x4f9906(0x307)](a32_0x38d690['green']('✔')+_0x4f9906(0x332)+a32_0x38d690[_0x4f9906(0x226)](_0x73e142)+_0x4f9906(0x29c));else{console[_0x4f9906(0x307)](_0x4f9906(0x2d2)+_0x73e142+'\x27:'),console['error']('─'[_0x4f9906(0x1eb)](0x3c)),console['error'](formatDiffWithColors(_0x16fdf6)),console['error']('─'[_0x4f9906(0x1eb)](0x3c));if(!_0x1418e0[_0x4f9906(0x198)]){if(!isInteractive())return console[_0x4f9906(0x307)](a32_0x38d690[_0x4f9906(0x25d)](_0x4f9906(0x2d3)),_0x4f9906(0x393)),console[_0x4f9906(0x307)](a32_0x38d690[_0x4f9906(0x385)](_0x4f9906(0x339))),0x1;const _0xaa6d34=await confirmKey(_0x4f9906(0x390)+_0x73e142+'\x27?');if(!_0xaa6d34)return console['error'](a32_0x38d690['yellow'](_0x4f9906(0x1c1))),0x1;}writeFileSync(_0x73e142,_0x201594,_0x4f9906(0x243)),console[_0x4f9906(0x307)](a32_0x38d690[_0x4f9906(0x1c4)]('✔')+_0x4f9906(0x2c9)+a32_0x38d690[_0x4f9906(0x226)](_0x73e142));}}else{const _0x27194b=a32_0x19e749['dirname'](_0x73e142);!existsSync(_0x27194b)&&mkdirSync(_0x27194b,{'recursive':!![]}),writeFileSync(_0x73e142,_0x201594,_0x4f9906(0x243)),console[_0x4f9906(0x307)](a32_0x38d690[_0x4f9906(0x1c4)]('✔')+_0x4f9906(0x2c9)+a32_0x38d690[_0x4f9906(0x226)](_0x73e142));}return saveSessionContext({'parent_segment':_0x1b2146},_0x1418e0[_0x4f9906(0x1bf)]),console[_0x4f9906(0x307)](a32_0x38d690[_0x4f9906(0x1c4)]('✔')+_0x4f9906(0x2d6)+a32_0x38d690['dim'](_0x4f9906(0x237))+_0x4f9906(0x383)+a32_0x38d690['cyan'](_0x1b2146)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a32_0x5137c3(0x276)]='segment:parent:push';['description']=a32_0x5137c3(0x26c);async[a32_0x5137c3(0x22a)](_0x5826a3){const _0x54d1d3=a32_0x5137c3,{options:_0x262b3a,args:_0x71eef,tdx:_0x15cdeb}=_0x5826a3,_0x1eaf99=_0x262b3a,_0x509584=_0x71eef[0x0]||_0x262b3a['parentSegment'];if(!_0x509584)return showParentSegmentNotSetError(_0x54d1d3(0x210)+_0x54d1d3(0x2f7)),0x1;const _0x3004b2=resolveYamlFile(_0x509584);if(!existsSync(_0x3004b2))return showFileNotFoundError(_0x3004b2,_0x509584),0x1;_0x1eaf99[_0x54d1d3(0x1ac)]&&(console[_0x54d1d3(0x307)]('Site:\x20'+_0x1eaf99[_0x54d1d3(0x2b6)]),console[_0x54d1d3(0x307)](_0x54d1d3(0x2fb)+_0x3004b2));let _0x3726b1;try{_0x3726b1=readFileSync(_0x3004b2,_0x54d1d3(0x243));}catch(_0x566d5d){const _0x2ba3cc=_0x566d5d instanceof Error?_0x566d5d['message']:String(_0x566d5d);return console[_0x54d1d3(0x307)](_0x54d1d3(0x24c)+_0x2ba3cc),0x1;}const _0x5a2dba=await withSpinner(_0x54d1d3(0x27f),()=>_0x15cdeb[_0x54d1d3(0x1b8)][_0x54d1d3(0x258)](_0x3726b1),{'verbose':_0x1eaf99[_0x54d1d3(0x1ac)]}),_0x3ef4e2=_0x5a2dba[_0x54d1d3(0x39a)],{isNew:_0x2db930,name:_0x45001d,hasChanges:_0x473cbb,diffFormatted:_0x717a04}=_0x3ef4e2;if(!_0x473cbb)return console[_0x54d1d3(0x307)](_0x54d1d3(0x26e)+_0x45001d+_0x54d1d3(0x2bf)),0x0;_0x2db930?console[_0x54d1d3(0x307)](_0x54d1d3(0x21a)+_0x45001d+'\x27:'):console['error'](_0x54d1d3(0x2fe)+_0x45001d+'\x27:');console['error']('─'[_0x54d1d3(0x1eb)](0x3c)),console[_0x54d1d3(0x307)](_0x717a04),console[_0x54d1d3(0x307)]('─'['repeat'](0x3c));const _0x2d23f4=_0x2db930?_0x54d1d3(0x17e)+_0x45001d+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x45001d+'\x27?';if(!_0x1eaf99[_0x54d1d3(0x198)]){if(!isInteractive())return console['error'](a32_0x38d690[_0x54d1d3(0x25d)](_0x54d1d3(0x2d3)),_0x54d1d3(0x393)),console[_0x54d1d3(0x307)](a32_0x38d690[_0x54d1d3(0x385)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5d24b2=await confirmKey(_0x2d23f4);if(!_0x5d24b2)return console[_0x54d1d3(0x307)](a32_0x38d690[_0x54d1d3(0x21d)](_0x54d1d3(0x1c1))),0x1;}const _0x37760c=_0x2db930?'Creating':_0x54d1d3(0x263),_0x3c0913=await withSpinner(_0x37760c+_0x54d1d3(0x32d)+_0x45001d+_0x54d1d3(0x1d7),()=>_0x3ef4e2[_0x54d1d3(0x2e2)](),{'verbose':_0x1eaf99[_0x54d1d3(0x1ac)]}),_0x280430=_0x3c0913['data'],_0x342b88=getConsoleNextUrl(_0x1eaf99[_0x54d1d3(0x2b6)],'/app/dw/parentSegments/'+_0x280430['id']),_0x43427f=_0x2db930?_0x54d1d3(0x32e):_0x54d1d3(0x344);return console[_0x54d1d3(0x307)]('✔\x20'+_0x43427f+'\x20parent\x20segment\x20\x27'+_0x280430['name']+'\x27'),console[_0x54d1d3(0x307)]('\x20\x20'+_0x342b88),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a32_0x5137c3(0x381);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x23d);async[a32_0x5137c3(0x22a)](_0x60f7bc){const _0x35ed7b=a32_0x5137c3,{options:_0x20a044,args:_0x5f3331,tdx:_0x319f4c}=_0x60f7bc,_0x2c9738=_0x20a044,_0x352641=_0x5f3331[0x0]||_0x20a044['parentSegment'];if(!_0x352641)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x35ed7b(0x1df)+'Options:\x0a'+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+_0x35ed7b(0x2a5)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x32ec2a=resolveYamlFile(_0x352641);if(!existsSync(_0x32ec2a))return showFileNotFoundError(_0x32ec2a,_0x352641),0x1;_0x2c9738[_0x35ed7b(0x1ac)]&&(console[_0x35ed7b(0x307)](_0x35ed7b(0x2e4)+_0x2c9738[_0x35ed7b(0x2b6)]),console[_0x35ed7b(0x307)](_0x35ed7b(0x2fb)+_0x32ec2a));let _0xd5e5a6;try{_0xd5e5a6=readFileSync(_0x32ec2a,_0x35ed7b(0x243));}catch(_0x444155){const _0x4035d0=_0x444155 instanceof Error?_0x444155[_0x35ed7b(0x254)]:String(_0x444155);return console['error'](_0x35ed7b(0x24c)+_0x4035d0),0x1;}const _0x15e206=createCommandSpinner(a32_0x38d690[_0x35ed7b(0x385)](_0x35ed7b(0x2e3)),{'verbose':_0x2c9738[_0x35ed7b(0x1ac)]});_0x15e206[_0x35ed7b(0x2cd)]();const _0x5641d1={'onProgress':_0xba2458=>{const _0x1d4e4a=_0x35ed7b;_0x15e206[_0x1d4e4a(0x352)]=formatProgressMessage(_0xba2458);}};if(_0x2c9738[_0x35ed7b(0x182)])_0x5641d1[_0x35ed7b(0x182)]=!![];if(_0x2c9738[_0x35ed7b(0x1f4)])_0x5641d1[_0x35ed7b(0x1f4)]=!![];_0x2c9738[_0x35ed7b(0x2ba)]&&(_0x5641d1['attribute']=_0x2c9738[_0x35ed7b(0x2ba)]);_0x2c9738['behavior']&&(_0x5641d1['behavior']=_0x2c9738[_0x35ed7b(0x27b)]);if(_0x2c9738[_0x35ed7b(0x1a7)])_0x5641d1[_0x35ed7b(0x1a7)]=_0x2c9738[_0x35ed7b(0x1a7)];let _0x419832;try{_0x419832=await _0x319f4c[_0x35ed7b(0x1b8)][_0x35ed7b(0x1b6)](_0xd5e5a6,_0x5641d1),_0x15e206[_0x35ed7b(0x19a)]();}catch(_0x4fee3c){_0x15e206[_0x35ed7b(0x19a)]();throw _0x4fee3c;}const _0x3d09f4=_0x2c9738[_0x35ed7b(0x1a7)]||_0x35ed7b(0x262);return this[_0x35ed7b(0x185)](_0x419832,_0x5641d1,_0x32ec2a,_0x3d09f4),_0x419832[_0x35ed7b(0x1b3)]?0x0:0x1;}[a32_0x5137c3(0x185)](_0x4ddff3,_0x2cb870,_0xd9a19f,_0x4e487b){const _0x4b9651=a32_0x5137c3;console[_0x4b9651(0x307)]('\x0a'+a32_0x38d690['bold'](_0x4b9651(0x1cc))+'\x20'+_0x4ddff3[_0x4b9651(0x276)]),console[_0x4b9651(0x307)]('═'[_0x4b9651(0x1eb)](0x3c)),this[_0x4b9651(0x2bd)](_0x4ddff3);if(typeof _0x2cb870[_0x4b9651(0x2ba)]===_0x4b9651(0x194)){this[_0x4b9651(0x2ac)](_0x4ddff3),this[_0x4b9651(0x23f)](_0x4ddff3),this[_0x4b9651(0x371)](_0xd9a19f,_0x4e487b,_0x4b9651(0x2ba),_0x2cb870[_0x4b9651(0x2ba)]);return;}if(_0x2cb870[_0x4b9651(0x2ba)]===!![]){this['displayAttributesStats'](_0x4ddff3),this[_0x4b9651(0x23f)](_0x4ddff3),this['displayPreviewHints'](_0xd9a19f,_0x4e487b,_0x4b9651(0x1a4));return;}if(typeof _0x2cb870[_0x4b9651(0x27b)]===_0x4b9651(0x194)){this[_0x4b9651(0x373)](_0x4ddff3,_0x4e487b),this[_0x4b9651(0x23f)](_0x4ddff3),this[_0x4b9651(0x371)](_0xd9a19f,_0x4e487b,_0x4b9651(0x27b),_0x2cb870['behavior']);return;}if(_0x2cb870[_0x4b9651(0x27b)]===!![]){this[_0x4b9651(0x373)](_0x4ddff3,_0x4e487b),this[_0x4b9651(0x23f)](_0x4ddff3),this['displayPreviewHints'](_0xd9a19f,_0x4e487b,_0x4b9651(0x2e7));return;}this[_0x4b9651(0x2ac)](_0x4ddff3),this[_0x4b9651(0x373)](_0x4ddff3,_0x4e487b),this[_0x4b9651(0x2a9)](_0x4ddff3),this[_0x4b9651(0x23f)](_0x4ddff3),this[_0x4b9651(0x371)](_0xd9a19f,_0x4e487b,_0x4b9651(0x31d));}['displayRealtimeInfo'](_0x5b8797){displayRealtimeValidation(_0x5b8797);}[a32_0x5137c3(0x371)](_0x1b9c20,_0x4b9dcd,_0x4005d3,_0x50349b){const _0x5c1119=a32_0x5137c3;console[_0x5c1119(0x307)]('\x0a'+a32_0x38d690['dim'](_0x5c1119(0x244)));const _0x17a72b=_0x4b9dcd!==_0x5c1119(0x262)?_0x5c1119(0x17c)+_0x4b9dcd:'';if(_0x4005d3===_0x5c1119(0x2ba)&&_0x50349b)console[_0x5c1119(0x307)]('\x20\x20'+a32_0x38d690[_0x5c1119(0x385)]('tdx\x20ps\x20preview\x20'+_0x1b9c20+'\x20--attribute\x20\x22'+_0x50349b+'\x22'+_0x17a72b));else{if(_0x4005d3==='behavior'&&_0x50349b)console[_0x5c1119(0x307)]('\x20\x20'+a32_0x38d690[_0x5c1119(0x385)](_0x5c1119(0x389)+_0x1b9c20+_0x5c1119(0x318)+_0x50349b+'\x22'+_0x17a72b));else(_0x4005d3===_0x5c1119(0x1a4)||_0x4005d3===_0x5c1119(0x31d))&&console[_0x5c1119(0x307)]('\x20\x20'+a32_0x38d690[_0x5c1119(0x385)](_0x5c1119(0x389)+_0x1b9c20+_0x5c1119(0x2c1)+_0x17a72b));}(_0x4005d3===_0x5c1119(0x2e7)||_0x4005d3===_0x5c1119(0x31d))&&console[_0x5c1119(0x307)]('\x20\x20'+a32_0x38d690['dim']('tdx\x20ps\x20preview\x20'+_0x1b9c20+_0x5c1119(0x353)+_0x17a72b)),_0x4005d3===_0x5c1119(0x31d)&&console[_0x5c1119(0x307)]('\x20\x20'+a32_0x38d690[_0x5c1119(0x385)]('tdx\x20ps\x20preview\x20'+_0x1b9c20+_0x5c1119(0x1e6)+_0x17a72b));}[a32_0x5137c3(0x2bd)](_0x6467ec){const _0x38dedc=a32_0x5137c3,{master:_0x3da688}=_0x6467ec,_0x5dc4bd=_0x3da688[_0x38dedc(0x280)]?a32_0x38d690[_0x38dedc(0x1c4)]('✔'):a32_0x38d690['red']('✘');console[_0x38dedc(0x307)]('\x0a'+a32_0x38d690[_0x38dedc(0x385)](_0x38dedc(0x17d))),console[_0x38dedc(0x307)](_0x5dc4bd+'\x20'+a32_0x38d690[_0x38dedc(0x380)](_0x3da688['database']+'.'+_0x3da688['table'])),_0x3da688[_0x38dedc(0x280)]?_0x3da688[_0x38dedc(0x35b)]!==undefined&&console[_0x38dedc(0x307)]('\x20\x20'+a32_0x38d690[_0x38dedc(0x385)]('Rows:')+'\x20'+a32_0x38d690[_0x38dedc(0x226)](formatRows(_0x3da688[_0x38dedc(0x35b)]))):console['error']('\x20\x20'+a32_0x38d690[_0x38dedc(0x25d)](_0x38dedc(0x309))+'\x20'+_0x3da688[_0x38dedc(0x358)]);}[a32_0x5137c3(0x2ac)](_0x1b007d){const _0x2eff9e=a32_0x5137c3;if(_0x1b007d[_0x2eff9e(0x1a4)][_0x2eff9e(0x199)]===0x0)return;console[_0x2eff9e(0x307)]('\x0a'+a32_0x38d690[_0x2eff9e(0x385)](_0x2eff9e(0x1c2)));for(const _0x47d947 of _0x1b007d[_0x2eff9e(0x1a4)]){const _0x3a4167=_0x47d947[_0x2eff9e(0x280)]?a32_0x38d690[_0x2eff9e(0x1c4)]('✔'):a32_0x38d690['red']('✘');let _0xb63736='';if(_0x47d947[_0x2eff9e(0x280)]&&_0x47d947[_0x2eff9e(0x296)]!==undefined&&_0x47d947[_0x2eff9e(0x303)]!==undefined){const _0x55ba3e=_0x47d947[_0x2eff9e(0x303)][_0x2eff9e(0x201)](0x1),_0x49a3d2=_0x47d947[_0x2eff9e(0x303)]>=0x50?a32_0x38d690[_0x2eff9e(0x1c4)]:_0x47d947[_0x2eff9e(0x303)]>=0x32?a32_0x38d690[_0x2eff9e(0x21d)]:a32_0x38d690[_0x2eff9e(0x25d)];_0xb63736='\x20'+a32_0x38d690['dim']('Coverage:')+'\x20'+_0x49a3d2(_0x55ba3e+'%')+'\x20('+formatRows(_0x47d947[_0x2eff9e(0x296)])+_0x2eff9e(0x1ef);}console[_0x2eff9e(0x307)](_0x3a4167+'\x20'+a32_0x38d690[_0x2eff9e(0x380)](_0x47d947['name'])+_0xb63736),console['error']('\x20\x20'+a32_0x38d690[_0x2eff9e(0x385)]('Source:')+'\x20'+a32_0x38d690['bold'](_0x47d947[_0x2eff9e(0x347)]+'.'+_0x47d947[_0x2eff9e(0x19d)]));const _0x5f5389=_0x47d947[_0x2eff9e(0x19f)]===_0x47d947['foreignKey']?a32_0x38d690['dim'](_0x2eff9e(0x355))+'\x20'+_0x47d947[_0x2eff9e(0x19f)]:a32_0x38d690[_0x2eff9e(0x385)]('Join:')+'\x20'+_0x47d947[_0x2eff9e(0x19f)]+_0x2eff9e(0x383)+_0x47d947[_0x2eff9e(0x285)];console[_0x2eff9e(0x307)]('\x20\x20'+_0x5f5389),console[_0x2eff9e(0x307)]('\x20\x20'+a32_0x38d690[_0x2eff9e(0x385)](_0x2eff9e(0x2dd))),this['displayColumns'](_0x47d947[_0x2eff9e(0x30c)]),!_0x47d947[_0x2eff9e(0x280)]&&console[_0x2eff9e(0x307)]('\x20\x20'+a32_0x38d690['red']('Error:')+'\x20'+_0x47d947[_0x2eff9e(0x358)]);}}[a32_0x5137c3(0x373)](_0x3efb45,_0x56994a){const _0x1d31c0=a32_0x5137c3;if(_0x3efb45['behaviors'][_0x1d31c0(0x199)]===0x0)return;console['error']('\x0a'+a32_0x38d690[_0x1d31c0(0x385)](_0x1d31c0(0x18e))+'\x20'+a32_0x38d690['dim']('('+_0x56994a+')'));for(const _0x55974d of _0x3efb45[_0x1d31c0(0x2e7)]){const _0x56f132=_0x55974d[_0x1d31c0(0x280)]?a32_0x38d690[_0x1d31c0(0x1c4)]('✔'):a32_0x38d690[_0x1d31c0(0x25d)]('✘');let _0x2fc0f2='';if(_0x55974d['schemaValid']&&_0x55974d[_0x1d31c0(0x1f5)]!==undefined&&_0x55974d[_0x1d31c0(0x2f3)]!==undefined){const _0x774136=_0x55974d[_0x1d31c0(0x368)]?.[_0x1d31c0(0x201)](0x1)||'?',_0x845663=(_0x55974d[_0x1d31c0(0x368)]??0x0)>=0x32?a32_0x38d690['green']:(_0x55974d[_0x1d31c0(0x368)]??0x0)>=0x14?a32_0x38d690[_0x1d31c0(0x21d)]:a32_0x38d690[_0x1d31c0(0x25d)];_0x2fc0f2='\x20'+a32_0x38d690['dim'](_0x1d31c0(0x222))+'\x20'+_0x845663(formatRows(_0x55974d[_0x1d31c0(0x1f5)]))+'\x20('+_0x774136+_0x1d31c0(0x27d)+a32_0x38d690[_0x1d31c0(0x385)](_0x1d31c0(0x29b))+'\x20'+a32_0x38d690[_0x1d31c0(0x226)](formatRows(_0x55974d[_0x1d31c0(0x2f3)]));}console['error'](_0x56f132+'\x20'+a32_0x38d690['bold'](_0x55974d[_0x1d31c0(0x276)])+_0x2fc0f2),console[_0x1d31c0(0x307)]('\x20\x20'+a32_0x38d690[_0x1d31c0(0x385)](_0x1d31c0(0x281))+'\x20'+a32_0x38d690[_0x1d31c0(0x380)](_0x55974d[_0x1d31c0(0x347)]+'.'+_0x55974d[_0x1d31c0(0x19d)]));const _0x2d7d61=_0x55974d[_0x1d31c0(0x19f)]===_0x55974d[_0x1d31c0(0x285)]?a32_0x38d690[_0x1d31c0(0x385)](_0x1d31c0(0x355))+'\x20'+_0x55974d[_0x1d31c0(0x19f)]:a32_0x38d690['dim']('Join:')+'\x20'+_0x55974d[_0x1d31c0(0x19f)]+'\x20=\x20'+_0x55974d['foreignKey'];console['error']('\x20\x20'+_0x2d7d61),console[_0x1d31c0(0x307)]('\x20\x20'+a32_0x38d690[_0x1d31c0(0x385)](_0x1d31c0(0x2dd))),this[_0x1d31c0(0x2fd)](_0x55974d[_0x1d31c0(0x30c)]),!_0x55974d[_0x1d31c0(0x280)]&&console[_0x1d31c0(0x307)]('\x20\x20'+a32_0x38d690[_0x1d31c0(0x25d)](_0x1d31c0(0x309))+'\x20'+_0x55974d[_0x1d31c0(0x358)]);}}['displayColumns'](_0x1e3559){const _0x350e9f=a32_0x5137c3;for(const _0x526193 of _0x1e3559){_0x526193['label']===_0x526193['column']||_0x526193['column']==='*'?console[_0x350e9f(0x307)](_0x350e9f(0x327)+_0x526193['label']):console[_0x350e9f(0x307)]('\x20\x20\x20\x20-\x20'+_0x526193[_0x350e9f(0x1ca)]+'\x20'+a32_0x38d690[_0x350e9f(0x385)]('('+_0x526193[_0x350e9f(0x188)]+')'));}}[a32_0x5137c3(0x23f)](_0x4abe51){const _0x4471e7=a32_0x5137c3;console[_0x4471e7(0x307)]('─'[_0x4471e7(0x1eb)](0x3c));if(_0x4abe51[_0x4471e7(0x1d4)][_0x4471e7(0x199)]>0x0){console[_0x4471e7(0x307)]('\x0a'+a32_0x38d690[_0x4471e7(0x25d)](_0x4471e7(0x375)));for(const _0x13e44d of _0x4abe51[_0x4471e7(0x1d4)]){console[_0x4471e7(0x307)]('\x20\x20'+a32_0x38d690[_0x4471e7(0x25d)]('•')+'\x20'+_0x13e44d);}}_0x4abe51[_0x4471e7(0x1b3)]&&console[_0x4471e7(0x307)]('\x0a'+a32_0x38d690[_0x4471e7(0x1c4)]('✔')+_0x4471e7(0x374));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x196);['description']=a32_0x5137c3(0x25a);async[a32_0x5137c3(0x22a)](_0x1f9128){const _0x35682b=a32_0x5137c3,{options:_0x67a63f,args:_0x46e2ab,tdx:_0x3843fd}=_0x1f9128,_0x978a31=_0x67a63f,_0xdc5bd6=_0x46e2ab[0x0]||_0x67a63f['parentSegment'];if(!_0xdc5bd6)return showParentSegmentNotSetError(_0x35682b(0x1fd)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+'Options\x20(one\x20required):\x0a'+_0x35682b(0x2df)+_0x35682b(0x252)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x35682b(0x216)+_0x35682b(0x227)),0x1;if(!_0x978a31[_0x35682b(0x182)]&&!_0x978a31[_0x35682b(0x2ba)]&&!_0x978a31[_0x35682b(0x27b)]&&!_0x978a31['enriched'])return console[_0x35682b(0x307)](a32_0x38d690['red']('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x35682b(0x307)](_0x35682b(0x1e0)),console[_0x35682b(0x307)](_0x35682b(0x28e)),console[_0x35682b(0x307)](_0x35682b(0x377)),console[_0x35682b(0x307)](_0x35682b(0x2d8)),console['error']('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x35682b(0x307)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x3f02ea=resolveYamlFile(_0xdc5bd6);if(!existsSync(_0x3f02ea))return showFileNotFoundError(_0x3f02ea,_0xdc5bd6),0x1;_0x978a31[_0x35682b(0x1ac)]&&(console[_0x35682b(0x307)]('Site:\x20'+_0x978a31[_0x35682b(0x2b6)]),console[_0x35682b(0x307)]('YAML\x20file:\x20'+_0x3f02ea));let _0x2efe60;try{_0x2efe60=readFileSync(_0x3f02ea,_0x35682b(0x243));}catch(_0x4c8a77){const _0x50bfe0=_0x4c8a77 instanceof Error?_0x4c8a77[_0x35682b(0x254)]:String(_0x4c8a77);return console['error'](_0x35682b(0x24c)+_0x50bfe0),0x1;}let _0x3718fb;try{_0x3718fb=parseDef(_0x2efe60);}catch(_0x5d2551){const _0x143cfd=_0x5d2551 instanceof Error?_0x5d2551[_0x35682b(0x254)]:String(_0x5d2551);return console[_0x35682b(0x307)](a32_0x38d690['red'](_0x35682b(0x36e)+_0x143cfd)),0x1;}if(_0x978a31['attribute']===!![]||_0x978a31[_0x35682b(0x2ba)]===''){const _0x5ded20=_0x3718fb['attributes']?.[_0x35682b(0x2b1)](_0x335931=>_0x335931[_0x35682b(0x276)])||[];if(_0x5ded20[_0x35682b(0x199)]===0x0)console['error'](a32_0x38d690[_0x35682b(0x25d)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x35682b(0x307)](a32_0x38d690['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x35682b(0x307)]('Available\x20attributes:');for(const _0x1e78c9 of _0x5ded20){console[_0x35682b(0x307)]('\x20\x20'+a32_0x38d690[_0x35682b(0x226)](_0x1e78c9));}console['error'](_0x35682b(0x295)+_0xdc5bd6+_0x35682b(0x267)+_0x5ded20[0x0]+'\x22');}return 0x1;}if(_0x978a31['behavior']===!![]||_0x978a31[_0x35682b(0x27b)]===''){const _0x3b198f=_0x3718fb['behaviors']?.[_0x35682b(0x2b1)](_0x3aaf96=>_0x3aaf96[_0x35682b(0x276)])||[];if(_0x3b198f[_0x35682b(0x199)]===0x0)console['error'](a32_0x38d690[_0x35682b(0x25d)](_0x35682b(0x2f6)));else{console[_0x35682b(0x307)](a32_0x38d690['red'](_0x35682b(0x1d2))),console[_0x35682b(0x307)](_0x35682b(0x359));for(const _0x567971 of _0x3b198f){console[_0x35682b(0x307)]('\x20\x20'+a32_0x38d690[_0x35682b(0x226)](_0x567971));}console[_0x35682b(0x307)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0xdc5bd6+_0x35682b(0x318)+_0x3b198f[0x0]+'\x22');}return 0x1;}const _0x19c101=createCommandSpinner(a32_0x38d690['dim']('Fetching\x20sample\x20data...'),{'verbose':_0x978a31[_0x35682b(0x1ac)]});_0x19c101[_0x35682b(0x2cd)]();const _0xa82f61={'onProgress':_0xb45806=>{const _0x30971b=_0x35682b;_0x19c101[_0x30971b(0x352)]=formatProgressMessage(_0xb45806);}};if(_0x978a31['master'])_0xa82f61[_0x35682b(0x182)]=!![];if(_0x978a31[_0x35682b(0x2ba)]&&typeof _0x978a31[_0x35682b(0x2ba)]===_0x35682b(0x194))_0xa82f61[_0x35682b(0x2ba)]=_0x978a31[_0x35682b(0x2ba)];if(_0x978a31[_0x35682b(0x27b)]&&typeof _0x978a31[_0x35682b(0x27b)]===_0x35682b(0x194))_0xa82f61[_0x35682b(0x27b)]=_0x978a31[_0x35682b(0x27b)];if(_0x978a31[_0x35682b(0x1f4)])_0xa82f61['enriched']=!![];if(_0x978a31['interval'])_0xa82f61['interval']=_0x978a31[_0x35682b(0x1a7)];let _0x53b906;try{_0x53b906=await _0x3843fd[_0x35682b(0x1b8)][_0x35682b(0x1a9)](_0x2efe60,_0xa82f61),_0x19c101[_0x35682b(0x19a)]();}catch(_0x511dfa){_0x19c101[_0x35682b(0x19a)]();throw _0x511dfa;}return await this[_0x35682b(0x30b)](_0x53b906,{'master':_0x978a31[_0x35682b(0x182)],'attribute':typeof _0x978a31['attribute']===_0x35682b(0x194)?_0x978a31['attribute']:undefined,'behavior':typeof _0x978a31['behavior']===_0x35682b(0x194)?_0x978a31[_0x35682b(0x27b)]:undefined,'enriched':_0x978a31[_0x35682b(0x1f4)]}),_0x53b906[_0x35682b(0x1b3)]?0x0:0x1;}async[a32_0x5137c3(0x30b)](_0x213d50,_0x42f955){const _0x3973a4=a32_0x5137c3;console[_0x3973a4(0x307)]('\x0a'+a32_0x38d690[_0x3973a4(0x380)](_0x3973a4(0x1db))+'\x20'+_0x213d50['name']),console[_0x3973a4(0x307)]('═'[_0x3973a4(0x1eb)](0x3c));if(_0x42f955[_0x3973a4(0x182)]&&_0x213d50[_0x3973a4(0x23a)]){const _0x42757b=a32_0x38d690[_0x3973a4(0x385)](_0x3973a4(0x288))+'\x20'+a32_0x38d690['bold'](_0x213d50['master']['database']+'.'+_0x213d50[_0x3973a4(0x182)][_0x3973a4(0x19d)]);await this[_0x3973a4(0x283)](_0x42757b,_0x213d50['sampleData']);}else{if(_0x42f955[_0x3973a4(0x2ba)]&&_0x213d50[_0x3973a4(0x23a)]){const _0x2f0c40=a32_0x38d690[_0x3973a4(0x385)](_0x3973a4(0x1bc))+'\x20'+a32_0x38d690[_0x3973a4(0x380)](_0x42f955[_0x3973a4(0x2ba)]);await this[_0x3973a4(0x283)](_0x2f0c40,_0x213d50['sampleData']);}else{if(_0x42f955[_0x3973a4(0x27b)]&&_0x213d50[_0x3973a4(0x23a)]){const _0x14d85e=a32_0x38d690[_0x3973a4(0x385)](_0x3973a4(0x2a0))+'\x20'+a32_0x38d690['bold'](_0x42f955[_0x3973a4(0x27b)]);await this[_0x3973a4(0x283)](_0x14d85e,_0x213d50[_0x3973a4(0x23a)]);}else{if(_0x42f955[_0x3973a4(0x1f4)]&&_0x213d50[_0x3973a4(0x23a)]){const _0x2e37de=a32_0x38d690[_0x3973a4(0x385)](_0x3973a4(0x342))+'\x20'+a32_0x38d690['bold']('Master\x20+\x20Attributes');await this[_0x3973a4(0x283)](_0x2e37de,_0x213d50[_0x3973a4(0x23a)]);}else!_0x213d50[_0x3973a4(0x23a)]&&console[_0x3973a4(0x307)](_0x3973a4(0x1be));}}}if(_0x213d50[_0x3973a4(0x1d4)]['length']>0x0){console[_0x3973a4(0x307)]('─'[_0x3973a4(0x1eb)](0x3c)),console[_0x3973a4(0x307)]('\x0a'+a32_0x38d690[_0x3973a4(0x25d)](_0x3973a4(0x375)));for(const _0x456f80 of _0x213d50['errors']){console['error']('\x20\x20'+a32_0x38d690[_0x3973a4(0x25d)]('•')+'\x20'+_0x456f80);}}}async[a32_0x5137c3(0x283)](_0x534619,_0x22fcbb){const _0x2cc0e4=a32_0x5137c3;if(_0x22fcbb[_0x2cc0e4(0x199)]===0x0){console[_0x2cc0e4(0x307)]('\x0a'+_0x534619),console['error']('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x2cc0e4(0x307)]('\x0a'+_0x534619);const _0x456d47=Object[_0x2cc0e4(0x284)](_0x22fcbb[0x0])['map'](_0x22a9b7=>({'name':_0x22a9b7,'type':typeof _0x22fcbb[0x0][_0x22a9b7]===_0x2cc0e4(0x2de)?_0x2cc0e4(0x343):'varchar'})),_0x162395={'queryId':_0x2cc0e4(0x1af),'columns':_0x456d47,'data':_0x22fcbb,'stats':{'state':_0x2cc0e4(0x33a),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x22fcbb[_0x2cc0e4(0x199)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x52d22d=formatAsTable(_0x162395,_0x22fcbb[_0x2cc0e4(0x199)],!![]);await writeOutput(_0x52d22d,undefined,_0x2cc0e4(0x19d));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x386);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x34d);async[a32_0x5137c3(0x22a)](_0x22376b){const _0x11b660=a32_0x5137c3,{options:_0x5bde41,args:_0x4ac925,tdx:_0x45328e}=_0x22376b,_0x511a76=_0x5bde41,_0x2f2890=_0x4ac925[0x0]||_0x5bde41['parentSegment'];if(!_0x2f2890)return showParentSegmentNotSetError(_0x11b660(0x21c)+_0x11b660(0x1a6)),0x1;const _0x2641af=resolveYamlFile(_0x2f2890);if(existsSync(_0x2641af)){_0x511a76[_0x11b660(0x1ac)]&&console[_0x11b660(0x307)](_0x11b660(0x367)+_0x2641af);let _0x529b92;try{_0x529b92=readFileSync(_0x2641af,_0x11b660(0x243));}catch(_0x2a70da){const _0x82ed34=_0x2a70da instanceof Error?_0x2a70da[_0x11b660(0x254)]:String(_0x2a70da);return console['error']('Error\x20reading\x20file:\x20'+_0x82ed34),0x1;}const _0x221bd9=await withSpinner(_0x11b660(0x27f),()=>_0x45328e['segment'][_0x11b660(0x258)](_0x529b92),{'verbose':_0x511a76['verbose']}),_0x3136d8=_0x221bd9['data'],{isNew:_0x2ff44d,name:_0x48d379,hasChanges:_0x55bf2f,diffFormatted:_0x4bdb47}=_0x3136d8;if(_0x55bf2f){_0x2ff44d?console['error']('\x0aNew\x20parent\x20segment\x20\x27'+_0x48d379+'\x27:'):console[_0x11b660(0x307)](_0x11b660(0x2fe)+_0x48d379+'\x27:');console[_0x11b660(0x307)]('─'['repeat'](0x3c)),console[_0x11b660(0x307)](_0x4bdb47),console[_0x11b660(0x307)]('─'[_0x11b660(0x1eb)](0x3c));const _0x32456b=_0x2ff44d?_0x11b660(0x17e)+_0x48d379+'\x27\x20and\x20run\x20workflow?':_0x11b660(0x2e8)+_0x48d379+_0x11b660(0x220);if(!_0x511a76[_0x11b660(0x198)]){if(!isInteractive())return console['error'](a32_0x38d690['red']('\x0aError:'),_0x11b660(0x393)),console[_0x11b660(0x307)](a32_0x38d690[_0x11b660(0x385)](_0x11b660(0x339))),0x1;const _0x3f61b8=await confirmKey(_0x32456b);if(!_0x3f61b8)return console['error'](a32_0x38d690[_0x11b660(0x21d)](_0x11b660(0x1c1))),0x1;}const _0x553670=_0x2ff44d?_0x11b660(0x37c):_0x11b660(0x263);await withSpinner(_0x553670+_0x11b660(0x32d)+_0x48d379+_0x11b660(0x1d7),()=>_0x3136d8[_0x11b660(0x2e2)](),{'verbose':_0x511a76[_0x11b660(0x1ac)]});const _0x641e4=_0x2ff44d?_0x11b660(0x32e):_0x11b660(0x344);console[_0x11b660(0x307)]('✔\x20'+_0x641e4+_0x11b660(0x32d)+_0x48d379+'\x27');}else console[_0x11b660(0x307)](_0x11b660(0x26e)+_0x48d379+_0x11b660(0x2e9));}const _0x5f4c9b=await withSpinner(_0x11b660(0x370)+_0x2f2890+_0x11b660(0x1d7),()=>_0x45328e['segment'][_0x11b660(0x200)](_0x2f2890),{'verbose':_0x511a76[_0x11b660(0x1ac)]}),_0x1595ff=_0x5f4c9b[_0x11b660(0x39a)],_0x596f7c=getConsoleUrl(_0x511a76[_0x11b660(0x2b6)],_0x11b660(0x215)+_0x1595ff[_0x11b660(0x372)]+'/sessions/'+_0x1595ff[_0x11b660(0x304)]+'/attempt/'+_0x1595ff['workflowAttemptId']);return console[_0x11b660(0x307)](_0x11b660(0x241)),console[_0x11b660(0x307)]('\x20\x20'+a32_0x38d690[_0x11b660(0x385)](_0x11b660(0x246))+'\x20'+_0x1595ff[_0x11b660(0x323)]),console[_0x11b660(0x307)]('\x20\x20'+a32_0x38d690[_0x11b660(0x385)](_0x11b660(0x365))+'\x20'+_0x1595ff[_0x11b660(0x1ec)]),console[_0x11b660(0x307)]('\x20\x20'+a32_0x38d690[_0x11b660(0x385)](_0x11b660(0x2e0))+'\x20'+_0x1595ff['workflowSessionId']),console[_0x11b660(0x307)]('\x20\x20'+a32_0x38d690['dim'](_0x11b660(0x346))+'\x20'+_0x1595ff['workflowAttemptId']),console['error']('\x20\x20'+_0x596f7c),console[_0x11b660(0x307)]('\x0a'+a32_0x38d690[_0x11b660(0x385)](_0x11b660(0x1ab))+_0x11b660(0x207)+_0x1595ff[_0x11b660(0x17a)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a32_0x5137c3(0x219);['description']=a32_0x5137c3(0x2ce);async['execute'](_0xeb61f4){const _0x4fa7f3=a32_0x5137c3,{options:_0x3c4765,args:_0x1dda1e,tdx:_0x405190}=_0xeb61f4,_0x505850=_0x1dda1e[0x0]||_0x3c4765[_0x4fa7f3(0x1e9)];if(!_0x505850)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'+_0x4fa7f3(0x238)),0x1;_0x3c4765['verbose']&&(console[_0x4fa7f3(0x307)](_0x4fa7f3(0x2e4)+_0x3c4765[_0x4fa7f3(0x2b6)]),console['error'](_0x4fa7f3(0x369)+_0x505850));const _0x5644a6=await withSpinner(_0x4fa7f3(0x361)+_0x505850+'\x27...',()=>_0x405190[_0x4fa7f3(0x1b8)]['listFields'](_0x505850),{'verbose':_0x3c4765[_0x4fa7f3(0x1ac)]}),_0x581d3f=_0x5644a6['data'];console[_0x4fa7f3(0x307)](_0x4fa7f3(0x2ea)+_0x581d3f['length']+_0x4fa7f3(0x2b0)+(_0x581d3f[_0x4fa7f3(0x199)]!==0x1?'s':''));if(_0x3c4765['json']||_0x3c4765[_0x4fa7f3(0x2c3)])return await handleSDKOutput(_0x581d3f,_0x3c4765),0x0;return displayFieldsHumanReadable(_0x581d3f,_0x505850),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a32_0x5137c3(0x30d);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x2a2);async[a32_0x5137c3(0x22a)](_0x2f959c){const _0x48e7dd=a32_0x5137c3,{options:_0x197e32,args:_0x241b4a,tdx:_0x58941b}=_0x2f959c,_0x35cfd5=_0x197e32,_0x4140f0=_0x241b4a[0x0]||_0x197e32[_0x48e7dd(0x1e9)];if(!_0x4140f0)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'+_0x48e7dd(0x20e)+'Options:\x0a'+_0x48e7dd(0x35d)),0x1;_0x197e32[_0x48e7dd(0x1ac)]&&(console[_0x48e7dd(0x307)](_0x48e7dd(0x2e4)+_0x197e32['site']),console[_0x48e7dd(0x307)](_0x48e7dd(0x369)+_0x4140f0));const _0x4b89df=await withSpinner(_0x48e7dd(0x2ff)+_0x4140f0+_0x48e7dd(0x1d7),()=>_0x58941b[_0x48e7dd(0x1b8)][_0x48e7dd(0x2aa)](_0x4140f0),{'verbose':_0x197e32[_0x48e7dd(0x1ac)]}),_0x266591=_0x4b89df[_0x48e7dd(0x39a)];if(_0x35cfd5[_0x48e7dd(0x22d)]){const _0x105edc=getConsoleNextUrl(_0x35cfd5['site'],_0x48e7dd(0x1f9)+_0x266591['id']);return console[_0x48e7dd(0x307)](a32_0x38d690[_0x48e7dd(0x1c4)]('✔')+_0x48e7dd(0x274)+a32_0x38d690[_0x48e7dd(0x226)](_0x105edc)),openBrowser(_0x105edc),0x0;}return await handleSingleObjectOutput(_0x266591,_0x197e32),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a32_0x5137c3(0x276)]='segment:parent:desc';['description']=a32_0x5137c3(0x239);async[a32_0x5137c3(0x22a)](_0x22ce17){const _0x2d3800=a32_0x5137c3,{options:_0x4431e5,args:_0x1d4c40,tdx:_0xb28b73}=_0x22ce17,_0x114565=_0x4431e5,_0x7b5ca0=_0x1d4c40[0x0]||_0x4431e5[_0x2d3800(0x1e9)];if(!_0x7b5ca0)return showParentSegmentNotSetError(_0x2d3800(0x184)+_0x2d3800(0x2ab)+_0x2d3800(0x19c)+_0x2d3800(0x2d7)),0x1;_0x4431e5[_0x2d3800(0x1ac)]&&(console[_0x2d3800(0x307)](_0x2d3800(0x2e4)+_0x4431e5[_0x2d3800(0x2b6)]),console['error'](_0x2d3800(0x369)+_0x7b5ca0));const _0x16405e=await withSpinner(_0x2d3800(0x250)+_0x7b5ca0+'\x27...',()=>_0xb28b73[_0x2d3800(0x1b8)][_0x2d3800(0x34b)](_0x7b5ca0),{'verbose':_0x4431e5['verbose']}),_0x3b33d9=_0x16405e[_0x2d3800(0x39a)],_0xfef9db=_0xb28b73['segment'][_0x2d3800(0x232)](_0x3b33d9);if(_0x114565['output']){const _0x355fbd=await this[_0x2d3800(0x25f)](_0x22ce17,_0x7b5ca0,_0x3b33d9,_0xfef9db),_0x64343b=this[_0x2d3800(0x29e)](_0x355fbd);writeFileSync(_0x114565['output'],_0x64343b);const _0x18a9a7=_0x355fbd[_0x2d3800(0x297)][_0x2d3800(0x30c)][_0x2d3800(0x199)]+_0x355fbd[_0x2d3800(0x2e7)][_0x2d3800(0x33b)]((_0x742027,_0x1aaf74)=>_0x742027+_0x1aaf74[_0x2d3800(0x30c)][_0x2d3800(0x199)],0x0),_0xac9e02=_0x355fbd[_0x2d3800(0x2e7)][_0x2d3800(0x2a7)](_0x5aafef=>_0x5aafef[_0x2d3800(0x30c)][_0x2d3800(0x199)]===0x0)[_0x2d3800(0x199)];return console[_0x2d3800(0x21f)](_0x2d3800(0x32f)+_0x114565[_0x2d3800(0x37b)]),console[_0x2d3800(0x21f)](_0x2d3800(0x324)+_0xfef9db),console[_0x2d3800(0x21f)](_0x2d3800(0x291)+_0x355fbd['behaviors'][_0x2d3800(0x199)]+_0x2d3800(0x251)),console['log'](_0x2d3800(0x37f)+_0x18a9a7+'\x20total'),_0xac9e02>0x0&&console[_0x2d3800(0x21f)](_0x2d3800(0x2c5)+_0xac9e02+_0x2d3800(0x2e5)),0x0;}console[_0x2d3800(0x307)]('\x0a'+a32_0x38d690[_0x2d3800(0x380)](_0x2d3800(0x282))+'\x20'+a32_0x38d690[_0x2d3800(0x226)](_0xfef9db));const _0x2eeda5=await withSpinner('Fetching\x20customers\x20schema...',()=>_0xb28b73[_0x2d3800(0x1b8)][_0x2d3800(0x360)](_0x3b33d9),{'verbose':_0x4431e5[_0x2d3800(0x1ac)]});console[_0x2d3800(0x307)]('\x0a'+a32_0x38d690[_0x2d3800(0x380)](_0x2d3800(0x297))+'\x20'+a32_0x38d690[_0x2d3800(0x385)]('('+_0xfef9db+_0x2d3800(0x2f8)));const _0x9fb9ed=await executeSchemaQuery(_0x2eeda5[_0x2d3800(0x39a)],_0xb28b73,_0x4431e5);await handleQueryOutput(_0x9fb9ed,_0x4431e5);const _0xdfea4=await withSpinner(_0x2d3800(0x356),()=>_0xb28b73['segment']['getBehaviorNames'](_0x3b33d9),{'verbose':_0x4431e5[_0x2d3800(0x1ac)]});for(const _0x4784e6 of _0xdfea4[_0x2d3800(0x39a)]){const _0x192ac9='behavior_'+_0x4784e6[_0x2d3800(0x302)]()[_0x2d3800(0x214)](/\s+/g,'_'),_0x4a94b6=_0x2d3800(0x287)+_0xfef9db+'.'+_0x192ac9;console[_0x2d3800(0x307)]('\x0a'+a32_0x38d690[_0x2d3800(0x380)](_0x4784e6)+'\x20'+a32_0x38d690[_0x2d3800(0x385)]('('+_0xfef9db+'.'+_0x192ac9+')'));try{const _0x356280=await executeSchemaQuery(_0x4a94b6,_0xb28b73,_0x4431e5);await handleQueryOutput(_0x356280,_0x4431e5);}catch{console['error'](a32_0x38d690['yellow'](_0x2d3800(0x298)));}}return 0x0;}async[a32_0x5137c3(0x25f)](_0x4d88d5,_0x41d279,_0x3b3023,_0x3996a7){const _0x272aa7=a32_0x5137c3,{options:_0x2bd26,tdx:_0x1bff9b}=_0x4d88d5,_0x4c303d=await withSpinner(_0x272aa7(0x21e),()=>_0x1bff9b[_0x272aa7(0x1b8)][_0x272aa7(0x360)](_0x3b3023),{'verbose':_0x2bd26[_0x272aa7(0x1ac)]}),_0x37152f=await executeSchemaQuery(_0x4c303d[_0x272aa7(0x39a)],_0x1bff9b,_0x2bd26),_0x1daf31=_0x37152f['data'][_0x272aa7(0x2b1)](_0x17d1ed=>({'name':_0x17d1ed[_0x272aa7(0x1f8)],'type':_0x17d1ed[_0x272aa7(0x223)]})),_0x1b06d=await withSpinner(_0x272aa7(0x356),()=>_0x1bff9b[_0x272aa7(0x1b8)]['getBehaviorNames'](_0x3b3023),{'verbose':_0x2bd26[_0x272aa7(0x1ac)]}),_0xf30377=[];for(const _0x432657 of _0x1b06d[_0x272aa7(0x39a)]){const _0x16c928=_0x272aa7(0x37e)+_0x432657['toLowerCase']()[_0x272aa7(0x214)](/\s+/g,'_'),_0x393ae0=_0x272aa7(0x287)+_0x3996a7+'.'+_0x16c928;let _0x42a8c6=[];try{const _0xaa8ce5=await executeSchemaQuery(_0x393ae0,_0x1bff9b,_0x2bd26);_0x42a8c6=_0xaa8ce5[_0x272aa7(0x39a)][_0x272aa7(0x2b1)](_0xe0423b=>({'name':_0xe0423b['column_name'],'type':_0xe0423b[_0x272aa7(0x223)]}));}catch{}_0xf30377[_0x272aa7(0x2a4)]({'table':_0x16c928,'columns':_0x42a8c6});}return{'database':_0x3996a7,'parent_segment':_0x41d279,'parent_id':_0x3b3023,'customers':{'table':_0x272aa7(0x297),'columns':_0x1daf31},'behaviors':_0xf30377};}['formatSchemaJson'](_0x1993b4){const _0x4beb51=a32_0x5137c3,_0x464a37=_0x1c6f06=>{const _0xa5f83b=a32_0x498a;if(_0x1c6f06[_0xa5f83b(0x199)]===0x0)return'[]';const _0x447a8f=_0x1c6f06[_0xa5f83b(0x2b1)](_0x4db747=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x4db747['name']+_0xa5f83b(0x259)+_0x4db747[_0xa5f83b(0x2db)]+'\x22\x20}');return'[\x0a'+_0x447a8f['join'](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x69f6ed=_0x1993b4[_0x4beb51(0x2e7)][_0x4beb51(0x2b1)](_0x4ba9e0=>{const _0x28e9e0=_0x4beb51;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x4ba9e0[_0x28e9e0(0x19d)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x464a37(_0x4ba9e0[_0x28e9e0(0x30c)])[_0x28e9e0(0x214)](/^/gm,'\x20\x20')[_0x28e9e0(0x235)]()+'\x0a\x20\x20\x20\x20}';})[_0x4beb51(0x2a8)](',\x0a');return _0x4beb51(0x195)+_0x1993b4[_0x4beb51(0x347)]+_0x4beb51(0x1f3)+_0x1993b4['parent_segment']+_0x4beb51(0x24d)+_0x1993b4[_0x4beb51(0x177)]+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x1993b4['customers'][_0x4beb51(0x19d)]+_0x4beb51(0x394)+_0x464a37(_0x1993b4[_0x4beb51(0x297)][_0x4beb51(0x30c)])['replace'](/^/gm,'\x20\x20')[_0x4beb51(0x235)]()+_0x4beb51(0x2b4)+_0x69f6ed+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x2c4);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x1ba);async['execute'](_0x4ff22f){const _0x289281=a32_0x5137c3,{options:_0x1c7aa3,args:_0x1a4a19,tdx:_0x586857}=_0x4ff22f,_0x352c29=_0x1a4a19[0x0]||_0x1c7aa3['parentSegment'];if(!_0x352c29)return showParentSegmentNotSetError(_0x289281(0x391)+_0x289281(0x22c)),0x1;_0x1c7aa3[_0x289281(0x1ac)]&&(console['error']('Site:\x20'+_0x1c7aa3['site']),console[_0x289281(0x307)](_0x289281(0x369)+_0x352c29));const _0x445a0e=await withSpinner(_0x289281(0x250)+_0x352c29+'\x27...',()=>_0x586857['segment']['resolveParentId'](_0x352c29),{'verbose':_0x1c7aa3[_0x289281(0x1ac)]}),_0x364999=_0x445a0e[_0x289281(0x39a)],_0x943b7a=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x352c29+'\x27...',()=>_0x586857['segment'][_0x289281(0x360)](_0x364999),{'verbose':_0x1c7aa3[_0x289281(0x1ac)]}),_0x14629c=_0x943b7a[_0x289281(0x39a)];return _0x1c7aa3[_0x289281(0x312)]===_0x289281(0x293)||_0x1c7aa3['format']==='jsonl'?await handleSDKOutput([{'sql':_0x14629c}],_0x1c7aa3):console[_0x289281(0x21f)](_0x14629c),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a32_0x5137c3(0x224);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x26f);async[a32_0x5137c3(0x22a)](_0x53d15b){const _0x59909e=a32_0x5137c3,{options:_0x1e9a5d,args:_0x41cb02,tdx:_0x47ba89}=_0x53d15b,_0x2d06de=_0x41cb02[0x0]||_0x1e9a5d['parentSegment'];if(!_0x2d06de)return showParentSegmentNotSetError(_0x59909e(0x189)+_0x59909e(0x290)),0x1;_0x1e9a5d[_0x59909e(0x1ac)]&&(console[_0x59909e(0x307)](_0x59909e(0x2e4)+_0x1e9a5d['site']),console[_0x59909e(0x307)]('Parent\x20segment:\x20'+_0x2d06de));const _0x57930c=await withSpinner(_0x59909e(0x250)+_0x2d06de+'\x27...',()=>_0x47ba89[_0x59909e(0x1b8)][_0x59909e(0x34b)](_0x2d06de),{'verbose':_0x1e9a5d[_0x59909e(0x1ac)]}),_0x256fc7=_0x57930c[_0x59909e(0x39a)],_0x51aaa2=await withSpinner(_0x59909e(0x364)+_0x2d06de+_0x59909e(0x1d7),()=>_0x47ba89['segment']['getParentSQL'](_0x256fc7),{'verbose':_0x1e9a5d[_0x59909e(0x1ac)]});let _0x42367e=_0x51aaa2[_0x59909e(0x39a)];const _0x3ba7b2=resolveLimit(_0x1e9a5d[_0x59909e(0x1f7)],DEFAULT_DISPLAY_LIMIT),_0x54db9a=/\bLIMIT\s+\d+/i[_0x59909e(0x1d0)](_0x42367e);!_0x54db9a&&(_0x42367e=_0x42367e[_0x59909e(0x235)]()[_0x59909e(0x214)](/;+$/,''),_0x42367e=_0x59909e(0x27a)+_0x42367e+_0x59909e(0x311)+_0x3ba7b2);_0x1e9a5d[_0x59909e(0x1ac)]&&console[_0x59909e(0x307)]('SQL\x20query:\x0a'+_0x42367e);const _0x3135fa=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x4ca39e=>{const _0x2c4cec=_0x59909e,_0x19ed0f=await _0x47ba89[_0x2c4cec(0x33e)][_0x2c4cec(0x22a)](_0x42367e,{'catalog':'td','schema':_0x2c4cec(0x335),'onJobId':_0x301d85=>{const _0x63ea5e=_0x2c4cec;_0x4ca39e[_0x63ea5e(0x204)](_0x301d85);}});return _0x19ed0f;},{'verbose':_0x1e9a5d[_0x59909e(0x1ac)]}),_0x55a62a=_0x3135fa[_0x59909e(0x39a)],_0x534ba4=_0x55a62a['jobId']?_0x59909e(0x36b)+_0x55a62a[_0x59909e(0x325)]+']':'';return console['error'](_0x59909e(0x19e)+_0x55a62a[_0x59909e(0x25b)][_0x59909e(0x193)]['toLocaleString']()+_0x59909e(0x18b)+(_0x59909e(0x341)+formatElapsed(_0x55a62a['stats'][_0x59909e(0x348)])+_0x534ba4)),await handleQueryOutput(_0x55a62a,_0x1e9a5d),0x0;}}export class PSRtListCommand extends BaseCommand{[a32_0x5137c3(0x276)]='ps:rt:list';[a32_0x5137c3(0x366)]=a32_0x5137c3(0x1da);async['execute'](_0x58a254){const _0x2a922e=a32_0x5137c3,{options:_0x4e1055,args:_0x144116,tdx:_0x60cb13}=_0x58a254,_0x5ccaa3=_0x144116[0x0],_0x50d912=await withSpinner(_0x5ccaa3?'Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27'+_0x5ccaa3+_0x2a922e(0x1d7):_0x2a922e(0x1fb),()=>_0x60cb13[_0x2a922e(0x300)][_0x2a922e(0x37a)](),{'verbose':_0x4e1055[_0x2a922e(0x1ac)]});let _0x487326=_0x50d912[_0x2a922e(0x39a)][_0x2a922e(0x2a7)](_0x3d55e1=>_0x3d55e1[_0x2a922e(0x398)]);if(_0x5ccaa3){const _0x33bcf9=_0x5ccaa3[_0x2a922e(0x214)](/[.+^${}()|[\]\\]/g,_0x2a922e(0x301))[_0x2a922e(0x214)](/\*/g,'.*')[_0x2a922e(0x214)](/\?/g,'.'),_0x9177ce=new RegExp('^'+_0x33bcf9+'$','i');_0x487326=_0x487326[_0x2a922e(0x2a7)](_0x325cd3=>_0x9177ce[_0x2a922e(0x1d0)](_0x325cd3[_0x2a922e(0x276)]));}_0x487326['sort']((_0x515f09,_0x272d48)=>_0x515f09[_0x2a922e(0x276)][_0x2a922e(0x31e)](_0x272d48['name'])),console[_0x2a922e(0x307)](_0x2a922e(0x2ea)+_0x487326[_0x2a922e(0x199)]+_0x2a922e(0x336)+(_0x487326[_0x2a922e(0x199)]!==0x1?'s':''));const _0x5dfe93=_0x11af95=>{const _0x51536d=_0x2a922e;return getConsoleNextUrl(_0x4e1055[_0x51536d(0x2b6)],_0x51536d(0x1f9)+_0x11af95);};if(_0x4e1055['format']===_0x2a922e(0x293)||_0x4e1055[_0x2a922e(0x312)]===_0x2a922e(0x2c3)){const _0x3c3159=_0x487326[_0x2a922e(0x2b1)](_0x4bd072=>({..._0x4bd072,'url':_0x5dfe93(_0x4bd072['id'])}));await handleSDKOutput(_0x3c3159,_0x4e1055);}else{if(_0x487326[_0x2a922e(0x199)]===0x0)console[_0x2a922e(0x21f)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x2e540b of _0x487326){const _0x34a00e=_0x2e540b[_0x2a922e(0x2d4)]?a32_0x38d690[_0x2a922e(0x385)]('\x20('+formatRows(_0x2e540b[_0x2a922e(0x2d4)])+')'):'',_0x592c4f=hyperlink(_0x2e540b['name'],_0x5dfe93(_0x2e540b['id']));console[_0x2a922e(0x21f)]('⚡\x20'+_0x592c4f+_0x34a00e);}}return 0x0;}}function a32_0x498a(_0x136361,_0x32467){_0x136361=_0x136361-0x177;const _0x37ec28=a32_0x37ec();let _0x498a78=_0x37ec28[_0x136361];return _0x498a78;}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x191);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x234);async[a32_0x5137c3(0x22a)](_0x5add29){const _0x1a3440=a32_0x5137c3,{options:_0x47dd69,args:_0x4a8b05,tdx:_0x6321a4}=_0x5add29,_0x4c48bc=_0x4a8b05[0x0]||_0x47dd69[_0x1a3440(0x1e9)];if(!_0x4c48bc)return showParentSegmentNotSetError(_0x1a3440(0x190)+_0x1a3440(0x33f)),0x1;const _0x47fc2d=resolveYamlFile(_0x4c48bc);if(!existsSync(_0x47fc2d))return showFileNotFoundError(_0x47fc2d,_0x4c48bc),0x1;let _0x4073da;try{_0x4073da=readFileSync(_0x47fc2d,_0x1a3440(0x243));}catch(_0x4c2038){const _0x31b47b=_0x4c2038 instanceof Error?_0x4c2038['message']:String(_0x4c2038);return console[_0x1a3440(0x307)](_0x1a3440(0x24c)+_0x31b47b),0x1;}const _0x5068a8=createCommandSpinner(a32_0x38d690[_0x1a3440(0x385)](_0x1a3440(0x39b)),{'verbose':_0x47dd69[_0x1a3440(0x1ac)]});_0x5068a8[_0x1a3440(0x2cd)]();const _0x297ea5={'realtime':!![],'onProgress':_0x257279=>{_0x5068a8['text']=formatProgressMessage(_0x257279);}};let _0x340fc9;try{_0x340fc9=await _0x6321a4[_0x1a3440(0x1b8)][_0x1a3440(0x1b6)](_0x4073da,_0x297ea5),_0x5068a8[_0x1a3440(0x19a)]();}catch(_0x152e1c){_0x5068a8[_0x1a3440(0x19a)]();throw _0x152e1c;}console['error']('\x0a'+a32_0x38d690[_0x1a3440(0x380)]('RT\x202.0\x20Validate:')+'\x20'+_0x340fc9[_0x1a3440(0x276)]),console['error']('═'[_0x1a3440(0x1eb)](0x3c)),displayRealtimeValidation(_0x340fc9),console[_0x1a3440(0x307)]('─'[_0x1a3440(0x1eb)](0x3c));if(_0x340fc9[_0x1a3440(0x1d4)][_0x1a3440(0x199)]>0x0){console[_0x1a3440(0x307)]('\x0a'+a32_0x38d690[_0x1a3440(0x25d)]('Errors:'));for(const _0x9f0338 of _0x340fc9[_0x1a3440(0x1d4)]){console[_0x1a3440(0x307)]('\x20\x20'+a32_0x38d690[_0x1a3440(0x25d)]('•')+'\x20'+_0x9f0338);}}return _0x340fc9['allValid']&&console[_0x1a3440(0x307)]('\x0a'+a32_0x38d690[_0x1a3440(0x1c4)]('✔')+_0x1a3440(0x340)),_0x340fc9[_0x1a3440(0x1b3)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x2d0);['description']='List\x20RT\x20journeys';async[a32_0x5137c3(0x22a)](_0x363f17){const _0x478eb5=a32_0x5137c3,{options:_0x58efa3,args:_0x305e45,tdx:_0x2b89e4}=_0x363f17,_0x2ba4e0=_0x305e45[0x0]||_0x58efa3['parentSegment'];if(!_0x2ba4e0)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a'+_0x478eb5(0x19b)),0x1;_0x58efa3[_0x478eb5(0x1ac)]&&(console[_0x478eb5(0x307)](_0x478eb5(0x2e4)+_0x58efa3[_0x478eb5(0x2b6)]),console[_0x478eb5(0x307)](_0x478eb5(0x369)+_0x2ba4e0));const _0x1feb7c=await withSpinner(_0x478eb5(0x250)+_0x2ba4e0+'\x27...',()=>_0x2b89e4[_0x478eb5(0x1b8)][_0x478eb5(0x34b)](_0x2ba4e0),{'verbose':_0x58efa3['verbose']}),_0x3ccd5a=_0x1feb7c[_0x478eb5(0x39a)],_0x113e48=await withSpinner(_0x478eb5(0x24a)+_0x2ba4e0+_0x478eb5(0x1d7),()=>_0x2b89e4[_0x478eb5(0x300)][_0x478eb5(0x253)](_0x3ccd5a),{'verbose':_0x58efa3[_0x478eb5(0x1ac)]}),_0x434040=_0x113e48['data'];console[_0x478eb5(0x307)](_0x478eb5(0x2ea)+_0x434040[_0x478eb5(0x199)]+_0x478eb5(0x334)+(_0x434040['length']!==0x1?'s':''));if(_0x58efa3[_0x478eb5(0x312)]===_0x478eb5(0x293)||_0x58efa3[_0x478eb5(0x312)]===_0x478eb5(0x2c3))await handleSDKOutput(_0x434040,_0x58efa3);else{if(_0x434040[_0x478eb5(0x199)]===0x0)console['log']('No\x20RT\x20journeys\x20found');else for(const _0x465f8e of _0x434040){const _0x393632=_0x465f8e['state']==='launched'?'🚀':'📝',_0x1c019c=_0x465f8e[_0x478eb5(0x2d5)]?a32_0x38d690['yellow'](_0x478eb5(0x20f)):'',_0x465b57=a32_0x38d690[_0x478eb5(0x385)]('\x20('+_0x465f8e[_0x478eb5(0x208)]+_0x478eb5(0x2be)+(_0x465f8e[_0x478eb5(0x208)]!==0x1?'s':'')+')');console[_0x478eb5(0x21f)](_0x393632+'\x20'+_0x465f8e[_0x478eb5(0x276)]+_0x1c019c+_0x465b57);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a32_0x5137c3(0x276)]='ps:rt:jn:pause';[a32_0x5137c3(0x366)]=a32_0x5137c3(0x1ed);async['execute'](_0x19d211){const _0x3fabbf=a32_0x5137c3,{options:_0x46def4,args:_0x32ea91,tdx:_0x1e9b56}=_0x19d211,_0x53b176=_0x32ea91[0x0];if(!_0x53b176)return console[_0x3fabbf(0x307)](a32_0x38d690[_0x3fabbf(0x25d)](_0x3fabbf(0x20a))),console[_0x3fabbf(0x307)](_0x3fabbf(0x1de)),console[_0x3fabbf(0x307)](a32_0x38d690[_0x3fabbf(0x385)](_0x3fabbf(0x29d))),0x1;_0x46def4['verbose']&&(console[_0x3fabbf(0x307)](_0x3fabbf(0x2e4)+_0x46def4[_0x3fabbf(0x2b6)]),console[_0x3fabbf(0x307)](_0x3fabbf(0x1e7)+_0x53b176));const _0x28d8b0=await withSpinner(_0x3fabbf(0x240)+_0x53b176+_0x3fabbf(0x1d7),()=>_0x1e9b56[_0x3fabbf(0x300)][_0x3fabbf(0x2c2)](_0x53b176),{'verbose':_0x46def4[_0x3fabbf(0x1ac)]}),_0x3fcf07=_0x28d8b0['data'];console[_0x3fabbf(0x307)](_0x3fabbf(0x197)+_0x3fcf07[_0x3fabbf(0x276)]+'\x27');if(_0x46def4[_0x3fabbf(0x312)]===_0x3fabbf(0x293)||_0x46def4[_0x3fabbf(0x312)]===_0x3fabbf(0x2c3))await handleSDKOutput([_0x3fcf07],_0x46def4);else{const _0x49d4d8=_0x3fcf07[_0x3fabbf(0x1b4)]==='launched'?'🚀':'📝',_0x195741=_0x3fcf07[_0x3fabbf(0x2d5)]?a32_0x38d690[_0x3fabbf(0x21d)](_0x3fabbf(0x20f)):'';console[_0x3fabbf(0x21f)](_0x49d4d8+'\x20'+_0x3fcf07[_0x3fabbf(0x276)]+_0x195741);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']=a32_0x5137c3(0x2af);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x24b);async[a32_0x5137c3(0x22a)](_0x56e799){const _0x2d56b2=a32_0x5137c3,{options:_0x2d637c,args:_0x4379d0,tdx:_0x40044d}=_0x56e799,_0x1b1895=_0x4379d0[0x0];if(!_0x1b1895)return console['error'](a32_0x38d690[_0x2d56b2(0x25d)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x2d56b2(0x307)](_0x2d56b2(0x397)),console[_0x2d56b2(0x307)](a32_0x38d690['dim'](_0x2d56b2(0x29d))),0x1;_0x2d637c['verbose']&&(console[_0x2d56b2(0x307)](_0x2d56b2(0x2e4)+_0x2d637c[_0x2d56b2(0x2b6)]),console[_0x2d56b2(0x307)](_0x2d56b2(0x1e7)+_0x1b1895));const _0x1c7b10=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1b1895+_0x2d56b2(0x1d7),()=>_0x40044d[_0x2d56b2(0x300)][_0x2d56b2(0x21b)](_0x1b1895),{'verbose':_0x2d637c[_0x2d56b2(0x1ac)]}),_0xdeca93=_0x1c7b10[_0x2d56b2(0x39a)];console[_0x2d56b2(0x307)](_0x2d56b2(0x275)+_0xdeca93[_0x2d56b2(0x276)]+'\x27');if(_0x2d637c['format']===_0x2d56b2(0x293)||_0x2d637c['format']===_0x2d56b2(0x2c3))await handleSDKOutput([_0xdeca93],_0x2d637c);else{const _0x6b956c=_0xdeca93[_0x2d56b2(0x1b4)]==='launched'?'🚀':'📝',_0xa50f32=_0xdeca93[_0x2d56b2(0x2d5)]?a32_0x38d690[_0x2d56b2(0x21d)](_0x2d56b2(0x20f)):'';console[_0x2d56b2(0x21f)](_0x6b956c+'\x20'+_0xdeca93[_0x2d56b2(0x276)]+_0xa50f32);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x228);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x22b);async[a32_0x5137c3(0x22a)](_0x51e955){const _0x5aaff3=a32_0x5137c3,{options:_0x1296c8,args:_0x10d8d8,tdx:_0x1f2ede}=_0x51e955,_0x1e7685=_0x10d8d8[0x0]||_0x1296c8[_0x5aaff3(0x1e9)];if(!_0x1e7685)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a'+_0x5aaff3(0x23e)),0x1;_0x1296c8[_0x5aaff3(0x1ac)]&&(console['error'](_0x5aaff3(0x2e4)+_0x1296c8['site']),console[_0x5aaff3(0x307)](_0x5aaff3(0x369)+_0x1e7685));const _0x3b2040=await withSpinner(_0x5aaff3(0x250)+_0x1e7685+_0x5aaff3(0x1d7),()=>_0x1f2ede['segment'][_0x5aaff3(0x34b)](_0x1e7685),{'verbose':_0x1296c8[_0x5aaff3(0x1ac)]}),_0x37c345=_0x3b2040[_0x5aaff3(0x39a)],_0x8d144f=await withSpinner(_0x5aaff3(0x18c)+_0x1e7685+_0x5aaff3(0x1d7),()=>_0x1f2ede[_0x5aaff3(0x300)][_0x5aaff3(0x192)](_0x37c345),{'verbose':_0x1296c8['verbose']}),_0x2a8b00=_0x8d144f[_0x5aaff3(0x39a)];return console[_0x5aaff3(0x307)](_0x5aaff3(0x35e)),_0x1296c8['format']===_0x5aaff3(0x293)||_0x1296c8['format']===_0x5aaff3(0x2c3)?await handleSDKOutput([_0x2a8b00],_0x1296c8):(console['log'](_0x5aaff3(0x315)+_0x2a8b00['id']),console[_0x5aaff3(0x21f)](_0x5aaff3(0x28a)+_0x2a8b00[_0x5aaff3(0x323)]),console[_0x5aaff3(0x21f)]('identifier:\x20'+_0x2a8b00[_0x5aaff3(0x236)]),console[_0x5aaff3(0x21f)](_0x5aaff3(0x2f1)+_0x2a8b00[_0x5aaff3(0x1c3)]),console['log']('status:\x20'+_0x2a8b00['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x1b1);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x1e3);async[a32_0x5137c3(0x22a)](_0x17c9e1){const _0x5148ca=a32_0x5137c3,{options:_0x2facad,args:_0x4aed22,tdx:_0x90617e}=_0x17c9e1,_0x359813=_0x4aed22[0x0]||_0x2facad[_0x5148ca(0x1e9)];if(!_0x359813)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+_0x5148ca(0x2cf)),0x1;const _0x5d8388=await withSpinner(_0x5148ca(0x250)+_0x359813+_0x5148ca(0x1d7),()=>_0x90617e['segment'][_0x5148ca(0x34b)](_0x359813),{'verbose':_0x2facad['verbose']}),_0x32ec42=_0x5d8388['data'],_0x45154f=await withSpinner(_0x5148ca(0x35a)+_0x359813+_0x5148ca(0x1d7),()=>_0x90617e[_0x5148ca(0x378)][_0x5148ca(0x37a)](_0x32ec42),{'verbose':_0x2facad[_0x5148ca(0x1ac)]}),_0x5137cf=_0x45154f[_0x5148ca(0x39a)];console[_0x5148ca(0x307)](_0x5148ca(0x2ea)+_0x5137cf['length']+'\x20personalization\x20service'+(_0x5137cf[_0x5148ca(0x199)]!==0x1?'s':''));if(_0x2facad[_0x5148ca(0x312)]===_0x5148ca(0x293)||_0x2facad[_0x5148ca(0x312)]===_0x5148ca(0x2c3))await handleSDKOutput(_0x5137cf,_0x2facad);else{if(_0x5137cf[_0x5148ca(0x199)]===0x0)console['log'](_0x5148ca(0x2ec)),console[_0x5148ca(0x307)](a32_0x38d690[_0x5148ca(0x226)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x23bfbc of _0x5137cf){console[_0x5148ca(0x21f)](a32_0x38d690[_0x5148ca(0x380)](_0x23bfbc[_0x5148ca(0x276)])+'\x20'+a32_0x38d690[_0x5148ca(0x385)](_0x5148ca(0x2c6)+_0x23bfbc['id']+')'));_0x23bfbc[_0x5148ca(0x366)]&&console['log']('\x20\x20'+a32_0x38d690[_0x5148ca(0x385)](_0x23bfbc[_0x5148ca(0x366)]));if(_0x23bfbc[_0x5148ca(0x1a5)]&&_0x23bfbc['tokens'][_0x5148ca(0x199)]>0x0)for(const _0x2e5f9d of _0x23bfbc['tokens']){const _0x289bc3=_0x2e5f9d[_0x5148ca(0x31f)]?.['length']?_0x2e5f9d[_0x5148ca(0x31f)][_0x5148ca(0x2a8)](',\x20'):_0x5148ca(0x1ad);console[_0x5148ca(0x21f)]('\x20\x20'+a32_0x38d690[_0x5148ca(0x226)](_0x5148ca(0x338))+'\x20'+_0x2e5f9d[_0x5148ca(0x276)]+'\x20'+a32_0x38d690[_0x5148ca(0x385)](_0x5148ca(0x2c6)+_0x2e5f9d['id']+')')),console[_0x5148ca(0x21f)]('\x20\x20\x20\x20'+a32_0x38d690[_0x5148ca(0x385)](_0x5148ca(0x2c8))+'\x20'+_0x289bc3);}else console[_0x5148ca(0x21f)]('\x20\x20'+a32_0x38d690[_0x5148ca(0x385)](_0x5148ca(0x382)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x333);[a32_0x5137c3(0x366)]='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async[a32_0x5137c3(0x22a)](_0x108d27){const _0x524885=a32_0x5137c3,{options:_0x33bbe4,args:_0x2f1136,tdx:_0x47ca78}=_0x108d27,_0x2e900f=_0x33bbe4,_0x11f2ee=_0x2f1136[0x0],_0xb4ac04=_0x2f1136[0x1]||_0x33bbe4[_0x524885(0x1e9)];if(!_0x11f2ee)return console['error'](_0x524885(0x2b5)),console[_0x524885(0x307)](_0x524885(0x350)),console[_0x524885(0x307)](_0x524885(0x186)),0x1;if(!_0xb4ac04)return showParentSegmentNotSetError(_0x524885(0x17f)+_0x524885(0x186)),0x1;const _0x3ec422=await withSpinner(_0x524885(0x250)+_0xb4ac04+_0x524885(0x1d7),()=>_0x47ca78[_0x524885(0x1b8)][_0x524885(0x34b)](_0xb4ac04),{'verbose':_0x33bbe4[_0x524885(0x1ac)]}),_0x2ad1bc=_0x3ec422[_0x524885(0x39a)],_0x34d385={'name':_0x11f2ee,'description':_0x2e900f[_0x524885(0x366)],'public':_0x2e900f[_0x524885(0x17b)]},_0x3a81ab=await withSpinner(_0x524885(0x294)+_0x11f2ee+_0x524885(0x1d7),()=>_0x47ca78[_0x524885(0x378)][_0x524885(0x320)](_0x2ad1bc,_0x34d385),{'verbose':_0x33bbe4[_0x524885(0x1ac)]}),_0x56426e=_0x3a81ab[_0x524885(0x39a)];return console[_0x524885(0x307)]('✔\x20Created\x20personalization\x20service\x20\x27'+_0x56426e[_0x524885(0x276)]+_0x524885(0x1fe)+_0x56426e['id']),await handleSDKOutput([_0x56426e],_0x33bbe4),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x277);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x245);async[a32_0x5137c3(0x22a)](_0x2d6f9a){const _0x3e874d=a32_0x5137c3,{options:_0x41924e,args:_0x44ddd4,tdx:_0x1288bb}=_0x2d6f9a,_0x5b26ad=_0x44ddd4[0x0],_0x35fa82=_0x44ddd4[0x1]||_0x41924e[_0x3e874d(0x1e9)];if(!_0x5b26ad)return console[_0x3e874d(0x307)]('Error:\x20Service\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x3e874d(0x307)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x35fa82)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+_0x3e874d(0x221)),0x1;const _0x24c2cd=await withSpinner(_0x3e874d(0x250)+_0x35fa82+_0x3e874d(0x1d7),()=>_0x1288bb[_0x3e874d(0x1b8)]['resolveParentId'](_0x35fa82),{'verbose':_0x41924e[_0x3e874d(0x1ac)]}),_0x2c94b8=_0x24c2cd[_0x3e874d(0x39a)],_0x169e38=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x5b26ad+_0x3e874d(0x1d7),()=>_0x1288bb[_0x3e874d(0x378)]['get'](_0x2c94b8,_0x5b26ad),{'verbose':_0x41924e[_0x3e874d(0x1ac)]}),_0x54b1da=_0x169e38[_0x3e874d(0x39a)];if(_0x41924e[_0x3e874d(0x293)]||_0x41924e[_0x3e874d(0x2c3)])await handleSDKOutput([_0x54b1da],_0x41924e);else{console[_0x3e874d(0x21f)](a32_0x38d690[_0x3e874d(0x380)](_0x54b1da[_0x3e874d(0x276)])+'\x20'+a32_0x38d690['dim'](_0x3e874d(0x2c6)+_0x54b1da['id']+')'));_0x54b1da[_0x3e874d(0x366)]&&console[_0x3e874d(0x21f)]('\x20\x20'+a32_0x38d690[_0x3e874d(0x385)](_0x54b1da['description']));console['log']('\x20\x20'+a32_0x38d690[_0x3e874d(0x226)](_0x3e874d(0x2fc))+'\x20'+(_0x54b1da[_0x3e874d(0x17b)]?_0x3e874d(0x198):'no'));if(_0x54b1da[_0x3e874d(0x1a5)]&&_0x54b1da[_0x3e874d(0x1a5)][_0x3e874d(0x199)]>0x0)for(const _0x437ab9 of _0x54b1da[_0x3e874d(0x1a5)]){const _0x1366c8=_0x437ab9[_0x3e874d(0x31f)]?.[_0x3e874d(0x199)]?_0x437ab9[_0x3e874d(0x31f)]['join'](',\x20'):_0x3e874d(0x1ad);console[_0x3e874d(0x21f)]('\x20\x20'+a32_0x38d690['cyan'](_0x3e874d(0x338))+'\x20'+_0x437ab9['name']+'\x20'+a32_0x38d690[_0x3e874d(0x385)](_0x3e874d(0x2c6)+_0x437ab9['id']+')')),console[_0x3e874d(0x21f)](_0x3e874d(0x399)+a32_0x38d690[_0x3e874d(0x385)]('allowed\x20IPs:')+'\x20'+_0x1366c8);}else console[_0x3e874d(0x21f)]('\x20\x20'+a32_0x38d690[_0x3e874d(0x385)](_0x3e874d(0x382)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']=a32_0x5137c3(0x1c0);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x1f1);async['execute'](_0x491e43){const _0x488d41=a32_0x5137c3,{options:_0x3edcb4,args:_0x24cf56,tdx:_0x84fbb8}=_0x491e43,_0x12e670=_0x24cf56[0x0],_0x142d98=_0x24cf56[0x1]||_0x3edcb4[_0x488d41(0x1e9)];if(!_0x12e670)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x488d41(0x307)](_0x488d41(0x1a0)),0x1;if(!_0x142d98)return showParentSegmentNotSetError(_0x488d41(0x1aa)+_0x488d41(0x1a0)),0x1;const _0x353ff3=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x142d98+_0x488d41(0x1d7),()=>_0x84fbb8['segment']['resolveParentId'](_0x142d98),{'verbose':_0x3edcb4[_0x488d41(0x1ac)]}),_0x1759bc=_0x353ff3[_0x488d41(0x39a)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x12e670+_0x488d41(0x1d7),()=>_0x84fbb8['personalization'][_0x488d41(0x349)](_0x1759bc,_0x12e670),{'verbose':_0x3edcb4[_0x488d41(0x1ac)]}),console[_0x488d41(0x307)](_0x488d41(0x2d9)+_0x12e670+'\x27'),0x0;}}function a32_0x37ec(){const _0x2c30d3=['Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','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','label','\x20service(s)\x20configured','Validate:','<database>.<table>','.yaml','Delete\x20a\x20realtime\x20personalization','test','Creating\x20token\x20\x27','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Database:\x20','errors','customerGroup','Pattern:\x20','\x27...','createdAt','3939650yLcrRu','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Preview:','single','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','/\x20→\x20','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','attributesFile','td_client_id','\x20--enriched','RT\x20Journey\x20ID:\x20','valid','parentSegment','✔\x20Created\x20personalization\x20\x27','repeat','status','Pause\x20activations\x20in\x20an\x20RT\x20journey','/\x20and\x20','\x20rows)','Name:\x20','Delete\x20a\x20personalization\x20service','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','enriched','customersWithEvents','✔\x20Updated\x20parent\x20segment\x20\x27','limit','column_name','/app/dw/parentSegments/','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Listing\x20RT-enabled\x20parent\x20segments...','stitchingKeys','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x27\x20with\x20ID:\x20','ps:pz:service:token:delete','runParent','toFixed','idStitching','open','setJobId','Error:\x20Personalization\x20ID\x20is\x20required','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x20tdx\x20wf\x20attempt\x20','stageCount','Error:\x20Token\x20\x27','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','addAttributes','segment:parent:pull','✔\x20Found\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20(paused)','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','👥\x20','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','replace','/app/workflows/','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20\x202.\x20Run\x20','\x20\x20\x20\x20\x20\x20','segment:parent:fields','\x0aNew\x20parent\x20segment\x20\x27','resumeJourney','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','yellow','Fetching\x20customers\x20schema...','log','\x27\x20and\x20run\x20workflow?','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Customers:','column_type','segment:parent:show','/\x20directories\x20exist.','cyan','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','ps:rt:configuration_versions','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','execute','Get\x20current\x20RT\x20configuration\x20version\x20status','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','web','behaviorsFile','\x20true','✔\x20Created\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','getOutputDatabaseName','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','trim','identifier','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Show\x20parent\x20segment\x20schema\x20(column\x20types)','sampleData','relationships','sourceTableError','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\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','displaySummary','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','\x0a✔\x20Workflow\x20started','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','utf-8','To\x20view\x20sample\x20data:','Show\x20personalization\x20service\x20details','Audience\x20ID:','entryCriteria','Fetching\x20current\x20configuration\x20for\x20\x27','Listing\x20parent\x20segments\x20matching\x20\x27','Listing\x20RT\x20journeys\x20for\x20\x27','Resume\x20activations\x20in\x20an\x20RT\x20journey','Error\x20reading\x20file:\x20','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Show\x20a\x20specific\x20realtime\x20personalization','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','Resolving\x20parent\x20segment\x20\x27','\x20behaviors','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','listJourneys','message','ps:pz:list','tdx\x20ps\x20push\x20','\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}','pushParentYaml','\x22,\x20\x22type\x22:\x20\x22','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','stats','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','red','\x0a⚠️\x20\x20Migrating:\x20','collectSchema','scheduleOption','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','-1d','Updating','patch','match','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20--attribute\x20\x22','My\x20Service','endsWith','updated:','\x20\x201.\x20Edit\x20','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','addAttributesFile','✔\x20No\x20changes\x20-\x20\x27','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','keyEventCriteria','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','sections:','Creating\x20personalization\x20\x27','\x20Opening\x20','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','name','ps:pz:service:show','scheduleType','Error:\x20--name\x20is\x20required','SELECT\x20*\x20FROM\x20(\x0a','behavior','4801236LEaFxi','%)\x20','ps:pz:create','Analyzing\x20changes...','schemaValid','Source:','Output\x20Database:','displaySampleData','keys','foreignKey','\x20\x20\x20','SELECT\x20*\x20FROM\x20','Master:','\x20personalization','audienceId:\x20','\x27\x20(id:\x20','run','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Options:','timezone','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20\x20Tables:\x201\x20customers\x20+\x20','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','json','Creating\x20personalization\x20service\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','matchedCount','customers','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','Listing\x20personalizations\x20for\x20\x27','Events:','\x20is\x20already\x20up\x20to\x20date','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','formatSchemaJson','36FADtDD','Behavior:','true','Show\x20parent\x20segment\x20details','✔\x20Deleted\x20token\x20\x27','push','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','\x20+\x20[','filter','join','displayRealtimeInfo','getParentFull','\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','displayAttributesStats','✔\x20Created\x20token\x20\x27','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','ps:rt:jn:resume','\x20field','map','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Error:\x20--database\x20and\x20--table\x20are\x20required','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','Error:\x20Service\x20name\x20is\x20required','site','enabled','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','payload','attribute','ps:pz:patch','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','displayMasterInfo','\x20stage','\x27\x20is\x20already\x20up\x20to\x20date','⚡\x20Enabled','\x20--attribute\x20\x22<name>\x22','pauseJourney','jsonl','segment:parent:sql','\x20\x20Note:\x20','(id:\x20','\x20Added\x20RT\x202.0\x20template\x20section','allowed\x20IPs:','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','deletePersonalization','1579278ustJLc','start','List\x20available\x20fields\x20for\x20segmentation','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','ps:rt:jn:list','No\x20parent\x20segments\x20found','\x0aChanges\x20to\x20\x27','\x0aError:','population','paused','\x20Context\x20set:\x20','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','✔\x20Deleted\x20personalization\x20service\x20\x27','4SbcNTT','type','platform','Columns:','number','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Session:','No\x20personalizations\x20configured','apply','Validating\x20configuration...','Site:\x20','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','✔\x20Renamed\x20directory\x20to\x20','behaviors','Apply\x20changes\x20to\x20\x27','\x27\x20is\x20up\x20to\x20date','✔\x20Found\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','No\x20personalization\x20services\x20configured','Listing\x20parent\x20segments...','split','segment:parent:list','Error:\x20Parent\x20segment\x20name\x20is\x20required','eventKind:\x20','createParent','totalEvents','855224vUJCXQ','Error:\x20Service\x20ID\x20is\x20required','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','.customers)','parent_segments','List\x20parent\x20segments','YAML\x20file:\x20','public:','displayColumns','\x0aChanges\x20to\x20apply\x20to\x20\x27','Fetching\x20parent\x20segment\x20\x27','realtime','\x5c$&','toLowerCase','coveragePercent','workflowSessionId','\x20parent\x20segment','isDirectory','error','`\x20to\x20download\x20the\x20configuration\x20first','Error:','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','displayPreviewResults','columns','segment:parent:view','\x20to\x20push\x20the\x20configuration','Error:\x20Token\x20name\x20is\x20required','segment:parent:create','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','format','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','segment:parent:update','id:\x20','Error:\x20File\x20not\x20found:\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','\x20--behavior\x20\x22','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','using\x20the\x20default\x20path:\x20','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','all','localeCompare','allowedIps','create','.yml','includeSensitive','audienceId','\x20\x20Database:\x20','jobId','keyEventId','\x20\x20\x20\x20-\x20','Finding\x20service\x20for\x20token...','3807135FuBUrL','personalization_services','ID\x20Stitching:','use','\x20parent\x20segment\x20\x27','Created','Schema\x20saved\x20to\x20','Updating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','\x20No\x20changes\x20-\x20','ps:pz:service:create','\x20RT\x20journey','information_schema','\x20RT-enabled\x20parent\x20segment','2NTnmqj','token:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','FINISHED','reduce','sourceTableValid','events','query','\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','\x20RT\x20configuration\x20is\x20valid','in\x20','Enriched:','double','Updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Attempt:','database','elapsedTimeMillis','delete','\x0a⚠️\x20\x20Both\x20','resolveParentId','\x20configured','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','parentFolder','7DWfkNp','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','patchPersonalization','text','\x20--behavior\x20\x22<name>\x22','Output\x20file:\x20','Join\x20on:','Fetching\x20behavior\x20list...','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','schemaError','Available\x20behaviors:','Listing\x20personalization\x20services\x20for\x20\x27','rowCount','ps:pz:service:token:create','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','✔\x20Retrieved\x20RT\x20configuration\x20version','Personalization\x20service\x20description','getParentSQL','Listing\x20fields\x20for\x20\x27','sort','⚡\x20Not\x20enabled','Fetching\x20SQL\x20for\x20\x27','Status:','description','Found\x20YAML\x20file:\x20','customerPercent','Parent\x20segment:\x20','1093209xeGrwb','\x20[Job\x20ID:\x20','file','Getting\x20personalization\x20\x27','Error\x20parsing\x20YAML:\x20','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','displayPreviewHints','workflowId','displayBehaviorsStats','\x20Configuration\x20is\x20valid','Errors:','entryCriteria:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','personalization','last_page_viewed','list','output','Creating','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','behavior_','\x20\x20Columns:\x20','bold','segment:parent:validate','no\x20tokens\x20configured','\x20=\x20','created:','dim','segment:parent:run','\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','ps:pz:show','tdx\x20ps\x20preview\x20','Deleting\x20personalization\x20\x27','getPersonalization','pullParentYaml','✔\x20Updated\x20personalization\x20\x27','indexOf','personalizationServices','Overwrite\x20\x27','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','audienceId:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','realtime_enabled','\x20\x20\x20\x20','data','Validating\x20RT\x20configuration...','folder-segment','Error:\x20Token\x20ID\x20is\x20required','parent_id','Updating\x20personalization\x20service\x20\x27','\x20\x20\x20\x20\x20\x20\x20\x20','workflowAttemptId','public','\x20--interval\x20','Master\x20Table','Create\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','unref','value','master','\x20Added\x20personalization\x20template\x20to\x20','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','displayValidateResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','folderId','column','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','RT\x202.0:','\x20rows\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Deleting\x20token\x20\x27','Behaviors','ignore','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','ps:rt:validate','getCurrentConfigVersion','processedRows','string','{\x0a\x20\x20\x22database\x22:\x20\x22','segment:parent:preview','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','yes','length','stop','\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','Options:\x0a','table','✔\x20Query\x20completed:\x20Processed\x20','joinKey','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','\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','page_view','ps:pz:service:update','attributes','tokens','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','interval','xdg-open','previewParentYaml','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','To\x20cancel:','verbose','any','addBehaviors','preview','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','ps:pz:service:list','updateParent','allValid','state','Creating\x20parent\x20segment\x20\x27','validateParentYaml','user_id','segment','addBehaviorsFile','Get\x20SQL\x20query\x20for\x20parent\x20segment','Default','Attribute:','deleteToken','\x0aNo\x20sample\x20data\x20available','session','ps:pz:service:delete','Aborted.','Attributes','eventKind','green','sections','✔\x20Deleted\x20personalization\x20\x27','778541oLiESA'];a32_0x37ec=function(){return _0x2c30d3;};return a32_0x37ec();}export class PSPzServiceUpdateCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x1a3);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x299);async[a32_0x5137c3(0x22a)](_0xad59ef){const _0x1edc99=a32_0x5137c3,{options:_0x5e6367,args:_0x4793b6,tdx:_0x5b1296}=_0xad59ef,_0x33e854=_0x5e6367,_0x3ab1d7=_0x4793b6[0x0],_0x9bc44f=_0x4793b6[0x1]||_0x5e6367[_0x1edc99(0x1e9)];if(!_0x3ab1d7)return console[_0x1edc99(0x307)](_0x1edc99(0x2f5)),console[_0x1edc99(0x307)](_0x1edc99(0x2bc)),console[_0x1edc99(0x307)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x33e854[_0x1edc99(0x276)])return console[_0x1edc99(0x307)](_0x1edc99(0x279)),console[_0x1edc99(0x307)](_0x1edc99(0x2bc)),0x1;if(!_0x9bc44f)return showParentSegmentNotSetError(_0x1edc99(0x1dd)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x549124=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x9bc44f+_0x1edc99(0x1d7),()=>_0x5b1296[_0x1edc99(0x1b8)][_0x1edc99(0x34b)](_0x9bc44f),{'verbose':_0x5e6367[_0x1edc99(0x1ac)]}),_0x15a76e=_0x549124[_0x1edc99(0x39a)],_0x27b30e={'name':_0x33e854[_0x1edc99(0x276)]};_0x33e854[_0x1edc99(0x366)]!==undefined&&(_0x27b30e[_0x1edc99(0x366)]=_0x33e854[_0x1edc99(0x366)]);const _0x410bf7=await withSpinner(_0x1edc99(0x178)+_0x3ab1d7+_0x1edc99(0x1d7),()=>_0x5b1296[_0x1edc99(0x378)][_0x1edc99(0x264)](_0x15a76e,_0x3ab1d7,_0x27b30e),{'verbose':_0x5e6367[_0x1edc99(0x1ac)]}),_0x13a8e4=_0x410bf7[_0x1edc99(0x39a)];return console[_0x1edc99(0x307)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x13a8e4[_0x1edc99(0x276)]+'\x27'),await handleSDKOutput([_0x13a8e4],_0x5e6367),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x35c);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x30a);async['execute'](_0xe566bf){const _0x3b089f=a32_0x5137c3,{options:_0xdde309,args:_0x383b98,tdx:_0xcef0ac}=_0xe566bf,_0x54e9f0=_0xdde309,_0x3d1441=_0x383b98[0x0],_0x1253af=_0x383b98[0x1],_0x2131b6=_0x383b98[0x2]||_0xdde309['parentSegment'];if(!_0x3d1441)return console[_0x3b089f(0x307)](_0x3b089f(0x30f)),console['error'](_0x3b089f(0x2b8)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x1253af)return console['error'](_0x3b089f(0x2f5)),console['error'](_0x3b089f(0x2b8)),console[_0x3b089f(0x307)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x2131b6)return showParentSegmentNotSetError(_0x3b089f(0x2ca)+_0x3b089f(0x261)),0x1;const _0x394a64=await withSpinner(_0x3b089f(0x250)+_0x2131b6+_0x3b089f(0x1d7),()=>_0xcef0ac[_0x3b089f(0x1b8)][_0x3b089f(0x34b)](_0x2131b6),{'verbose':_0xdde309[_0x3b089f(0x1ac)]}),_0x5d9817=_0x394a64[_0x3b089f(0x39a)],_0x4c72e0={'name':_0x3d1441};_0x54e9f0['allowedIps']&&(_0x4c72e0[_0x3b089f(0x31f)]=_0x54e9f0[_0x3b089f(0x31f)][_0x3b089f(0x2ee)](',')['map'](_0x4a1c5b=>_0x4a1c5b[_0x3b089f(0x235)]()));_0x54e9f0['description']&&(_0x4c72e0['description']=_0x54e9f0[_0x3b089f(0x366)]);const _0xde5592=await withSpinner(_0x3b089f(0x1d1)+_0x3d1441+'\x27\x20for\x20service\x20\x27'+_0x1253af+_0x3b089f(0x1d7),()=>_0xcef0ac['personalization']['createToken'](_0x5d9817,_0x1253af,_0x4c72e0),{'verbose':_0xdde309['verbose']}),_0x4fa6b9=_0xde5592[_0x3b089f(0x39a)];return console[_0x3b089f(0x307)](_0x3b089f(0x2ad)+_0x4fa6b9[_0x3b089f(0x276)]+'\x27\x20with\x20ID:\x20'+_0x4fa6b9['id']),_0x4fa6b9['value']&&(console[_0x3b089f(0x307)](a32_0x38d690['yellow'](_0x3b089f(0x213))),console['error'](a32_0x38d690[_0x3b089f(0x226)](_0x4fa6b9[_0x3b089f(0x181)])),console[_0x3b089f(0x307)]('')),await handleSDKOutput([_0x4fa6b9],_0xdde309),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x1ff);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x31a);async[a32_0x5137c3(0x22a)](_0x5b9136){const _0x577faa=a32_0x5137c3,{options:_0x1e1983,args:_0x254e5a,tdx:_0x36ac1f}=_0x5b9136,_0x5c9232=_0x254e5a[0x0],_0x2855b9=_0x254e5a[0x1]||_0x1e1983[_0x577faa(0x1e9)];if(!_0x5c9232)return console['error'](_0x577faa(0x39d)),console[_0x577faa(0x307)](_0x577faa(0x206)),console[_0x577faa(0x307)](_0x577faa(0x345)),0x1;if(!_0x2855b9)return showParentSegmentNotSetError(_0x577faa(0x331)+_0x577faa(0x345)),0x1;const _0x569829=await withSpinner(_0x577faa(0x250)+_0x2855b9+_0x577faa(0x1d7),()=>_0x36ac1f[_0x577faa(0x1b8)][_0x577faa(0x34b)](_0x2855b9),{'verbose':_0x1e1983[_0x577faa(0x1ac)]}),_0x26785f=_0x569829[_0x577faa(0x39a)],_0x2ac81f=await withSpinner(_0x577faa(0x328),()=>_0x36ac1f[_0x577faa(0x378)][_0x577faa(0x37a)](_0x26785f),{'verbose':_0x1e1983[_0x577faa(0x1ac)]}),_0x9f9a96=_0x2ac81f[_0x577faa(0x39a)];let _0x5c1704;for(const _0x3bd3cd of _0x9f9a96){if(_0x3bd3cd[_0x577faa(0x1a5)]?.['some'](_0x3bf830=>_0x3bf830['id']===_0x5c9232)){_0x5c1704=_0x3bd3cd['id'];break;}}if(!_0x5c1704)return console[_0x577faa(0x307)](_0x577faa(0x209)+_0x5c9232+_0x577faa(0x2b2)),0x1;const _0x5838f1=await withSpinner(_0x577faa(0x18d)+_0x5c9232+'\x27...',()=>_0x36ac1f[_0x577faa(0x378)][_0x577faa(0x1bd)](_0x26785f,_0x5c1704,_0x5c9232),{'verbose':_0x1e1983[_0x577faa(0x1ac)]}),_0x35e605=_0x5838f1[_0x577faa(0x39a)];return console[_0x577faa(0x307)](_0x577faa(0x2a3)+(_0x35e605[_0x577faa(0x276)]||_0x5c9232)+'\x27'),await handleSDKOutput([_0x35e605],_0x1e1983),0x0;}}export class PSPzListCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x255);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x25c);async[a32_0x5137c3(0x22a)](_0x1bec92){const _0x7e39b2=a32_0x5137c3,{options:_0x43c7a7,args:_0x26927e,tdx:_0x95f5b7}=_0x1bec92,_0x12e183=_0x26927e[0x0]||_0x43c7a7[_0x7e39b2(0x1e9)];if(!_0x12e183)return showParentSegmentNotSetError(_0x7e39b2(0x357)+_0x7e39b2(0x387)),0x1;const _0x51d9d4=await withSpinner(_0x7e39b2(0x250)+_0x12e183+_0x7e39b2(0x1d7),()=>_0x95f5b7[_0x7e39b2(0x1b8)][_0x7e39b2(0x34b)](_0x12e183),{'verbose':_0x43c7a7[_0x7e39b2(0x1ac)]}),_0x2cd296=_0x51d9d4[_0x7e39b2(0x39a)],_0x2086da=await withSpinner(_0x7e39b2(0x29a)+_0x12e183+_0x7e39b2(0x1d7),()=>_0x95f5b7[_0x7e39b2(0x378)]['listPersonalizations'](_0x2cd296),{'verbose':_0x43c7a7[_0x7e39b2(0x1ac)]}),_0x4e73bb=_0x2086da[_0x7e39b2(0x39a)];console[_0x7e39b2(0x307)](_0x7e39b2(0x2ea)+_0x4e73bb['length']+_0x7e39b2(0x289)+(_0x4e73bb[_0x7e39b2(0x199)]!==0x1?'s':''));if(_0x43c7a7[_0x7e39b2(0x312)]===_0x7e39b2(0x293)||_0x43c7a7[_0x7e39b2(0x312)]===_0x7e39b2(0x2c3))await handleSDKOutput(_0x4e73bb,_0x43c7a7);else{if(_0x4e73bb[_0x7e39b2(0x199)]===0x0)console['log'](_0x7e39b2(0x2e1));else for(const _0xff4856 of _0x4e73bb){console[_0x7e39b2(0x21f)](a32_0x38d690[_0x7e39b2(0x380)](_0xff4856[_0x7e39b2(0x276)])+'\x20'+a32_0x38d690[_0x7e39b2(0x385)](_0x7e39b2(0x2c6)+_0xff4856['id']+')'));_0xff4856[_0x7e39b2(0x366)]&&console[_0x7e39b2(0x21f)]('\x20\x20'+a32_0x38d690[_0x7e39b2(0x385)](_0xff4856[_0x7e39b2(0x366)]));const _0x215aee=_0xff4856[_0x7e39b2(0x1c5)]?.['length']||0x0;console[_0x7e39b2(0x21f)]('\x20\x20'+a32_0x38d690[_0x7e39b2(0x226)](_0x7e39b2(0x272))+'\x20'+_0x215aee);if(_0xff4856[_0x7e39b2(0x1c5)]&&_0xff4856['sections'][_0x7e39b2(0x199)]>0x0)for(const _0x307758 of _0xff4856[_0x7e39b2(0x1c5)]){console[_0x7e39b2(0x21f)](_0x7e39b2(0x327)+_0x307758['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x388);[a32_0x5137c3(0x366)]=a32_0x5137c3(0x24e);async[a32_0x5137c3(0x22a)](_0x246f8c){const _0x52a3b1=a32_0x5137c3,{options:_0x333fa7,args:_0x3926db,tdx:_0x1a44fe}=_0x246f8c,_0x24d786=_0x3926db[0x0];if(!_0x24d786)return console['error'](_0x52a3b1(0x205)),console[_0x52a3b1(0x307)](_0x52a3b1(0x1e2)),0x1;const _0x5881ec=await withSpinner(_0x52a3b1(0x36d)+_0x24d786+_0x52a3b1(0x1d7),()=>_0x1a44fe['personalization'][_0x52a3b1(0x38b)](_0x24d786),{'verbose':_0x333fa7[_0x52a3b1(0x1ac)]}),_0x477d5e=_0x5881ec[_0x52a3b1(0x39a)];console[_0x52a3b1(0x307)](_0x52a3b1(0x20d)+_0x477d5e[_0x52a3b1(0x276)]+'\x27');if(_0x333fa7['format']===_0x52a3b1(0x293)||_0x333fa7['format']===_0x52a3b1(0x2c3))await handleSDKOutput([_0x477d5e],_0x333fa7);else{console[_0x52a3b1(0x21f)](a32_0x38d690['bold'](_0x477d5e[_0x52a3b1(0x276)])+'\x20'+a32_0x38d690[_0x52a3b1(0x385)](_0x52a3b1(0x2c6)+_0x477d5e['id']+')'));_0x477d5e['description']&&console[_0x52a3b1(0x21f)]('\x20\x20'+a32_0x38d690['dim'](_0x477d5e[_0x52a3b1(0x366)]));_0x477d5e[_0x52a3b1(0x323)]&&console['log']('\x20\x20'+a32_0x38d690[_0x52a3b1(0x226)](_0x52a3b1(0x392))+'\x20'+_0x477d5e['audienceId']);console[_0x52a3b1(0x21f)]('\x20\x20'+a32_0x38d690[_0x52a3b1(0x226)](_0x52a3b1(0x384))+'\x20'+_0x477d5e[_0x52a3b1(0x1d8)]),console[_0x52a3b1(0x21f)]('\x20\x20'+a32_0x38d690[_0x52a3b1(0x226)](_0x52a3b1(0x26a))+'\x20'+_0x477d5e['updatedAt']);const _0x13497e=_0x477d5e[_0x52a3b1(0x1c5)]?.['length']||0x0;console[_0x52a3b1(0x21f)]('\x20\x20'+a32_0x38d690[_0x52a3b1(0x226)](_0x52a3b1(0x272))+'\x20'+_0x13497e);if(_0x477d5e[_0x52a3b1(0x1c5)]&&_0x477d5e['sections'][_0x52a3b1(0x199)]>0x0)for(const _0x3fb3d0 of _0x477d5e[_0x52a3b1(0x1c5)]){console[_0x52a3b1(0x21f)](_0x52a3b1(0x399)+a32_0x38d690[_0x52a3b1(0x380)](_0x3fb3d0[_0x52a3b1(0x276)])+'\x20'+a32_0x38d690[_0x52a3b1(0x385)](_0x52a3b1(0x2c6)+_0x3fb3d0['id']+')')),_0x3fb3d0[_0x52a3b1(0x247)]&&(console['log'](_0x52a3b1(0x218)+a32_0x38d690[_0x52a3b1(0x226)](_0x52a3b1(0x376))+'\x20'+_0x3fb3d0[_0x52a3b1(0x247)][_0x52a3b1(0x276)]),_0x3fb3d0[_0x52a3b1(0x247)][_0x52a3b1(0x270)]?.[_0x52a3b1(0x326)]&&console[_0x52a3b1(0x21f)](_0x52a3b1(0x179)+a32_0x38d690['cyan']('keyEventId:')+'\x20'+_0x3fb3d0['entryCriteria'][_0x52a3b1(0x270)][_0x52a3b1(0x326)])),_0x3fb3d0['payload']&&console[_0x52a3b1(0x21f)](_0x52a3b1(0x218)+a32_0x38d690['cyan']('payload:')+'\x20'+JSON['stringify'](_0x3fb3d0[_0x52a3b1(0x2b9)])),_0x3fb3d0[_0x52a3b1(0x322)]&&console['log'](_0x52a3b1(0x218)+a32_0x38d690[_0x52a3b1(0x226)]('includeSensitive:')+_0x52a3b1(0x22f));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{['name']='ps:pz:delete';[a32_0x5137c3(0x366)]=a32_0x5137c3(0x1cf);async['execute'](_0x5c603d){const _0x1b33cc=a32_0x5137c3,{options:_0x1d1f7d,args:_0x19547d,tdx:_0x33e18a}=_0x5c603d,_0x17610d=_0x19547d[0x0];if(!_0x17610d)return console['error']('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x1b33cc(0x307)]('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x1b33cc(0x38a)+_0x17610d+'\x27...',()=>_0x33e18a[_0x1b33cc(0x378)][_0x1b33cc(0x2cb)](_0x17610d),{'verbose':_0x1d1f7d[_0x1b33cc(0x1ac)]}),console[_0x1b33cc(0x307)](_0x1b33cc(0x1c6)+_0x17610d+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x27e);['description']='Create\x20a\x20realtime\x20personalization\x20entity';async[a32_0x5137c3(0x22a)](_0x33b19b){const _0x4890be=a32_0x5137c3,{options:_0x2b497f,tdx:_0xb204c6}=_0x33b19b,_0x2b4ba7=_0x2b497f;let _0x34d9eb;if(_0x2b4ba7[_0x4890be(0x36c)]){_0x34d9eb=await loadJSON(_0x2b4ba7[_0x4890be(0x36c)],!![]);if(!_0x34d9eb[_0x4890be(0x23b)]?.[_0x4890be(0x34e)])return console[_0x4890be(0x307)](_0x4890be(0x24f)),console[_0x4890be(0x307)](_0x4890be(0x1b0)),console[_0x4890be(0x307)](_0x4890be(0x257)),0x1;}else{if(!_0x2b4ba7[_0x4890be(0x276)])return console['error'](_0x4890be(0x266)),console[_0x4890be(0x307)](_0x4890be(0x31c)),console[_0x4890be(0x307)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x2b4ba7[_0x4890be(0x366)]===undefined)return console[_0x4890be(0x307)](_0x4890be(0x1c8)),console[_0x4890be(0x307)](_0x4890be(0x31c)),console[_0x4890be(0x307)](_0x4890be(0x271)),0x1;if(_0x2b4ba7[_0x4890be(0x187)]===undefined)return console['error'](_0x4890be(0x396)),console[_0x4890be(0x307)](_0x4890be(0x242)),0x1;let _0x2e9f0f=_0x2b4ba7['audienceId'];if(!_0x2e9f0f&&_0x2b497f[_0x4890be(0x1e9)]){const _0x5d5001=await withSpinner(_0x4890be(0x250)+_0x2b497f[_0x4890be(0x1e9)]+_0x4890be(0x1d7),()=>_0xb204c6[_0x4890be(0x1b8)][_0x4890be(0x34b)](_0x2b497f[_0x4890be(0x1e9)]),{'verbose':_0x2b497f[_0x4890be(0x1ac)]});_0x2e9f0f=_0x5d5001[_0x4890be(0x39a)];}let _0xcb58de;_0x2b4ba7[_0x4890be(0x1c5)]&&(_0xcb58de=await loadJSON(_0x2b4ba7[_0x4890be(0x1c5)],![]));const _0x2555e5=_0x2b4ba7['folderId']==='null'?null:{'id':_0x2b4ba7['folderId'],'type':_0x4890be(0x39c)};_0x34d9eb={'attributes':{'name':_0x2b4ba7[_0x4890be(0x276)],'description':_0x2b4ba7[_0x4890be(0x366)]||null,..._0x2e9f0f!==undefined&&{'audienceId':_0x2e9f0f},..._0xcb58de!==undefined&&{'sections':_0xcb58de}},'relationships':{'parentFolder':{'data':_0x2555e5}}};}const _0x44a8af=await withSpinner(_0x4890be(0x273)+(_0x34d9eb[_0x4890be(0x1a4)]?.[_0x4890be(0x276)]??'')+_0x4890be(0x1d7),()=>_0xb204c6['personalization']['createPersonalization'](_0x34d9eb),{'verbose':_0x2b497f[_0x4890be(0x1ac)]}),_0x7d59fd=_0x44a8af[_0x4890be(0x39a)];return console[_0x4890be(0x307)](_0x4890be(0x1ea)+_0x7d59fd[_0x4890be(0x276)]+'\x27\x20with\x20ID:\x20'+_0x7d59fd['id']),await handleSDKOutput([_0x7d59fd],_0x2b497f),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a32_0x5137c3(0x276)]=a32_0x5137c3(0x2bb);['description']='Update\x20a\x20realtime\x20personalization\x20entity';async[a32_0x5137c3(0x22a)](_0x547d1f){const _0x2db1a3=a32_0x5137c3,{options:_0x1f2e26,args:_0x41a4fd}=_0x547d1f,_0x343299=_0x1f2e26,_0x222e4d=_0x41a4fd[0x0];if(!_0x222e4d)return console[_0x2db1a3(0x307)](_0x2db1a3(0x205)),console['error'](_0x2db1a3(0x36f)),console[_0x2db1a3(0x307)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>'),0x1;let _0x14da60;if(_0x343299[_0x2db1a3(0x36c)])_0x14da60=await loadJSON(_0x343299[_0x2db1a3(0x36c)],!![]);else{if(!_0x343299[_0x2db1a3(0x276)])return console[_0x2db1a3(0x307)](_0x2db1a3(0x266)),console[_0x2db1a3(0x307)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;if(_0x343299['description']===undefined)return console[_0x2db1a3(0x307)](_0x2db1a3(0x1c8)),console[_0x2db1a3(0x307)](_0x2db1a3(0x36f)),0x1;let _0x5dfbbc;_0x343299['sections']&&(_0x5dfbbc=await loadJSON(_0x343299[_0x2db1a3(0x1c5)],![])),_0x14da60={'attributes':{'name':_0x343299['name'],'description':_0x343299[_0x2db1a3(0x366)]||null,..._0x5dfbbc!==undefined&&{'sections':_0x5dfbbc}}};}const {tdx:_0x3a71fe}=_0x547d1f,_0xdc1b71=await withSpinner('Patching\x20personalization\x20\x27'+_0x222e4d+_0x2db1a3(0x1d7),()=>_0x3a71fe[_0x2db1a3(0x378)][_0x2db1a3(0x351)](_0x222e4d,_0x14da60),{'verbose':_0x1f2e26[_0x2db1a3(0x1ac)]}),_0x18461a=_0xdc1b71[_0x2db1a3(0x39a)];return console[_0x2db1a3(0x307)](_0x2db1a3(0x38d)+_0x18461a['name']+_0x2db1a3(0x28b)+_0x18461a['id']+')'),await handleSDKOutput([_0x18461a],_0x1f2e26),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a32_0x5137c3(0x276)]='ps:pz:init';[a32_0x5137c3(0x366)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a32_0x5137c3(0x22a)](_0x2c618b){const _0x2c45dc=a32_0x5137c3,{options:_0x44a7ac,args:_0x43b09b}=_0x2c618b,_0x1e4b1f=_0x43b09b[0x0]||_0x44a7ac[_0x2c45dc(0x1e9)];if(!_0x1e4b1f)return showParentSegmentNotSetError(_0x2c45dc(0x1c9)+_0x2c45dc(0x1a1)),0x1;const _0x2b7be6=resolveYamlFile(_0x1e4b1f);if(!existsSync(_0x2b7be6))return showFileNotFoundError(_0x2b7be6,_0x1e4b1f),0x1;let _0x656f79;try{_0x656f79=readFileSync(_0x2b7be6,'utf-8');}catch(_0x71b573){const _0x231e35=_0x71b573 instanceof Error?_0x71b573[_0x2c45dc(0x254)]:String(_0x71b573);return console[_0x2c45dc(0x307)]('Error\x20reading\x20file:\x20'+_0x231e35),0x1;}let _0x34c94f;try{_0x34c94f=parseDef(_0x656f79);}catch(_0x1417d7){const _0x56baf3=_0x1417d7 instanceof Error?_0x1417d7[_0x2c45dc(0x254)]:String(_0x1417d7);return console[_0x2c45dc(0x307)](a32_0x38d690[_0x2c45dc(0x25d)](_0x2c45dc(0x36e)+_0x56baf3)),0x1;}if(_0x34c94f[_0x2c45dc(0x32a)]&&_0x34c94f['personalization_services']['length']>0x0)return console['error'](a32_0x38d690[_0x2c45dc(0x21d)](_0x2c45dc(0x2ae)+_0x2b7be6)),console[_0x2c45dc(0x307)](a32_0x38d690[_0x2c45dc(0x385)](_0x2c45dc(0x286)+_0x34c94f['personalization_services'][_0x2c45dc(0x199)]+_0x2c45dc(0x1cb))),0x1;!_0x34c94f[_0x2c45dc(0x300)]&&(_0x34c94f[_0x2c45dc(0x300)]={'events':[{'name':_0x2c45dc(0x1a2),'source_table':_0x2c45dc(0x1cd)}],'attributes':[{'name':_0x2c45dc(0x379),'type':_0x2c45dc(0x1dc)}],'id_stitching':{'primary_key':_0x34c94f[_0x2c45dc(0x182)][_0x2c45dc(0x19d)]===_0x2c45dc(0x297)?_0x2c45dc(0x1e5):_0x2c45dc(0x1b7)}});_0x34c94f[_0x2c45dc(0x32a)]=[{'name':_0x2c45dc(0x268),'description':_0x2c45dc(0x35f),'trigger_event':_0x2c45dc(0x1a2),'sections':[{'name':_0x2c45dc(0x1bb),'criteria':_0x2c45dc(0x2a1),'attributes':[_0x2c45dc(0x379)]}]}];const _0x1a81aa=serializeDef(_0x34c94f);return writeFileSync(_0x2b7be6,_0x1a81aa,_0x2c45dc(0x243)),console[_0x2c45dc(0x307)](a32_0x38d690['green']('✔')+_0x2c45dc(0x183)+a32_0x38d690[_0x2c45dc(0x226)](_0x2b7be6)),(!_0x34c94f[_0x2c45dc(0x300)]||_0x656f79[_0x2c45dc(0x38e)]('realtime:')===-0x1)&&console[_0x2c45dc(0x307)](a32_0x38d690[_0x2c45dc(0x1c4)]('✔')+_0x2c45dc(0x2c7)),console['error']('\x0a'+a32_0x38d690['dim']('Next\x20steps:')),console['error'](_0x2c45dc(0x26b)+_0x2b7be6+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x2c45dc(0x307)](_0x2c45dc(0x217)+a32_0x38d690[_0x2c45dc(0x385)](_0x2c45dc(0x256)+_0x1e4b1f)+_0x2c45dc(0x30e)),0x0;}}