@treasuredata/tdx 2026.4.18 → 2026.4.19

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 (252) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.d.ts +38 -0
  27. package/dist/commands/engage-command.d.ts.map +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-command.js.map +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.js +1 -1
  41. package/dist/commands/profiles-command.js +1 -1
  42. package/dist/commands/query-command.js +1 -1
  43. package/dist/commands/schedule-command.js +1 -1
  44. package/dist/commands/segment-command.js +1 -1
  45. package/dist/commands/segment-create-command.js +1 -1
  46. package/dist/commands/segment-fields-command.js +1 -1
  47. package/dist/commands/segment-pull-command.js +1 -1
  48. package/dist/commands/segment-push-command.js +1 -1
  49. package/dist/commands/segment-update-command.js +1 -1
  50. package/dist/commands/segment-use-command.js +1 -1
  51. package/dist/commands/segment-validate-command.js +1 -1
  52. package/dist/commands/segments.js +1 -1
  53. package/dist/commands/show.js +1 -1
  54. package/dist/commands/status-command.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/user-cache.js +1 -1
  76. package/dist/core/version.js +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/mcp/server.js +1 -1
  79. package/dist/mcp/tools/index.js +1 -1
  80. package/dist/mcp/tools/tdx-run.js +1 -1
  81. package/dist/mcp/tools/tdx-search.js +1 -1
  82. package/dist/mcp/tools/work-create-item.js +1 -1
  83. package/dist/mcp/utils.js +1 -1
  84. package/dist/proxy/claude-usage-tracker.js +1 -1
  85. package/dist/proxy/passthrough-server.js +1 -1
  86. package/dist/proxy/sse-usage-parser.js +1 -1
  87. package/dist/sdk/agent/agent-config.js +1 -1
  88. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  89. package/dist/sdk/agent/agent-yaml.js +1 -1
  90. package/dist/sdk/agent/test/evaluator.js +1 -1
  91. package/dist/sdk/agent/test/executor.js +1 -1
  92. package/dist/sdk/agent/test/index.js +1 -1
  93. package/dist/sdk/agent/test/output.js +1 -1
  94. package/dist/sdk/agent/test/parser.js +1 -1
  95. package/dist/sdk/agent/tool-target-registry.js +1 -1
  96. package/dist/sdk/api.js +1 -1
  97. package/dist/sdk/cas/cas-api-client.js +1 -1
  98. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  99. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  100. package/dist/sdk/cas/index.js +1 -1
  101. package/dist/sdk/cas/pull-workflow.js +1 -1
  102. package/dist/sdk/cas/push-workflow.js +1 -1
  103. package/dist/sdk/client/cdp-api-client.js +1 -1
  104. package/dist/sdk/client/delivery-api-client.js +1 -1
  105. package/dist/sdk/client/endpoints.js +1 -1
  106. package/dist/sdk/client/engage-api-client.d.ts +26 -1
  107. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  108. package/dist/sdk/client/engage-api-client.js +1 -1
  109. package/dist/sdk/client/engage-api-client.js.map +1 -1
  110. package/dist/sdk/client/http-client.d.ts +1 -1
  111. package/dist/sdk/client/http-client.d.ts.map +1 -1
  112. package/dist/sdk/client/http-client.js +1 -1
  113. package/dist/sdk/client/http-client.js.map +1 -1
  114. package/dist/sdk/client/llm-api-client.js +1 -1
  115. package/dist/sdk/client/oauth-refresh.js +1 -1
  116. package/dist/sdk/client/rate-limiter.js +1 -1
  117. package/dist/sdk/client/td-api-client.js +1 -1
  118. package/dist/sdk/client/trino-api-client.js +1 -1
  119. package/dist/sdk/client/workflow-client.js +1 -1
  120. package/dist/sdk/connection-validator.js +1 -1
  121. package/dist/sdk/connection.js +1 -1
  122. package/dist/sdk/delivery.js +1 -1
  123. package/dist/sdk/engage/campaign-pull.js +1 -1
  124. package/dist/sdk/engage/campaign-push.js +1 -1
  125. package/dist/sdk/engage/campaign-validator.js +1 -1
  126. package/dist/sdk/engage/campaign-validator.js.map +1 -1
  127. package/dist/sdk/engage/campaign-yaml.d.ts +1 -1
  128. package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
  129. package/dist/sdk/engage/campaign-yaml.js +1 -1
  130. package/dist/sdk/engage/campaign-yaml.js.map +1 -1
  131. package/dist/sdk/engage/template-pull.js +1 -1
  132. package/dist/sdk/engage/template-push.js +1 -1
  133. package/dist/sdk/engage/template-validator.js +1 -1
  134. package/dist/sdk/engage/template-yaml.js +1 -1
  135. package/dist/sdk/engage/types/campaign-def.d.ts +2 -2
  136. package/dist/sdk/engage/types/campaign-def.d.ts.map +1 -1
  137. package/dist/sdk/engage/types/campaign-def.js +1 -1
  138. package/dist/sdk/engage/types/campaign-def.js.map +1 -1
  139. package/dist/sdk/engage/types/campaign-schema.d.ts +256 -8
  140. package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
  141. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.d.ts +28 -1
  145. package/dist/sdk/engage.d.ts.map +1 -1
  146. package/dist/sdk/engage.js +1 -1
  147. package/dist/sdk/engage.js.map +1 -1
  148. package/dist/sdk/errors.js +1 -1
  149. package/dist/sdk/index.d.ts +1 -1
  150. package/dist/sdk/index.d.ts.map +1 -1
  151. package/dist/sdk/index.js +1 -1
  152. package/dist/sdk/index.js.map +1 -1
  153. package/dist/sdk/io/index.js +1 -1
  154. package/dist/sdk/io/node-filesystem.js +1 -1
  155. package/dist/sdk/job.js +1 -1
  156. package/dist/sdk/journey.js +1 -1
  157. package/dist/sdk/llm/chat-cache.js +1 -1
  158. package/dist/sdk/llm/index.js +1 -1
  159. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  160. package/dist/sdk/llm/model-factors.js +1 -1
  161. package/dist/sdk/personalization.js +1 -1
  162. package/dist/sdk/policy.js +1 -1
  163. package/dist/sdk/query/index.js +1 -1
  164. package/dist/sdk/query/sql-parser.js +1 -1
  165. package/dist/sdk/realtime.js +1 -1
  166. package/dist/sdk/schedule.js +1 -1
  167. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  168. package/dist/sdk/segment/fields-display.js +1 -1
  169. package/dist/sdk/segment/file-discovery.js +1 -1
  170. package/dist/sdk/segment/journey-utils.js +1 -1
  171. package/dist/sdk/segment/journey-validator.js +1 -1
  172. package/dist/sdk/segment/journey-yaml.js +1 -1
  173. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  174. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  175. package/dist/sdk/segment/pull-workflow.js +1 -1
  176. package/dist/sdk/segment/push-recovery.js +1 -1
  177. package/dist/sdk/segment/push-workflow.js +1 -1
  178. package/dist/sdk/segment/resolution-context.js +1 -1
  179. package/dist/sdk/segment/segment-path-parser.js +1 -1
  180. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  181. package/dist/sdk/segment/segment-validator.js +1 -1
  182. package/dist/sdk/segment/target-resolution.js +1 -1
  183. package/dist/sdk/segment/tdx-config.js +1 -1
  184. package/dist/sdk/segment/types/activation-schema.js +1 -1
  185. package/dist/sdk/segment/types/journey-def.js +1 -1
  186. package/dist/sdk/segment/types/journey-schema.js +1 -1
  187. package/dist/sdk/segment/types/segment-def.js +1 -1
  188. package/dist/sdk/segment/types/segment-schema.js +1 -1
  189. package/dist/sdk/segment/validate-files.js +1 -1
  190. package/dist/sdk/segment/yaml-validator.js +1 -1
  191. package/dist/sdk/segment.js +1 -1
  192. package/dist/sdk/types/engage.d.ts +125 -1
  193. package/dist/sdk/types/engage.d.ts.map +1 -1
  194. package/dist/sdk/types/index.d.ts +1 -1
  195. package/dist/sdk/types/index.d.ts.map +1 -1
  196. package/dist/sdk/types/index.js +1 -1
  197. package/dist/sdk/types/index.js.map +1 -1
  198. package/dist/sdk/types/progress.js +1 -1
  199. package/dist/sdk/types/workspace.js +1 -1
  200. package/dist/sdk/user.js +1 -1
  201. package/dist/sdk/util/format-detector.js +1 -1
  202. package/dist/sdk/util/formatters.js +1 -1
  203. package/dist/sdk/util/index.js +1 -1
  204. package/dist/sdk/util/paginate.js +1 -1
  205. package/dist/sdk/util/tree-formatter.js +1 -1
  206. package/dist/sdk/workflow/archive-validation.js +1 -1
  207. package/dist/sdk/workflow/clone-workflow.js +1 -1
  208. package/dist/sdk/workflow/index.js +1 -1
  209. package/dist/sdk/workflow/pull-workflow.js +1 -1
  210. package/dist/sdk/workflow/push-workflow.js +1 -1
  211. package/dist/sdk/workflow/tdx-config.js +1 -1
  212. package/dist/sdk/workflow/workflow-utils.js +1 -1
  213. package/dist/sdk/workspace/access-tracker.js +1 -1
  214. package/dist/sdk/workspace/frontmatter.js +1 -1
  215. package/dist/sdk/workspace/git.js +1 -1
  216. package/dist/sdk/workspace/index.js +1 -1
  217. package/dist/sdk/workspace/templates.js +1 -1
  218. package/dist/sdk/workspace/weekly.js +1 -1
  219. package/dist/sdk/workspace/wikilinks.js +1 -1
  220. package/dist/test-utils/command-runner.js +1 -1
  221. package/dist/test-utils/factories.js +1 -1
  222. package/dist/test-utils/fixtures.js +1 -1
  223. package/dist/test-utils/http-mock.js +1 -1
  224. package/dist/test-utils/index.js +1 -1
  225. package/dist/utils/async.js +1 -1
  226. package/dist/utils/colors.js +1 -1
  227. package/dist/utils/diff.js +1 -1
  228. package/dist/utils/file-permissions.js +1 -1
  229. package/dist/utils/file-reader.js +1 -1
  230. package/dist/utils/github-releases.js +1 -1
  231. package/dist/utils/global-cache.js +1 -1
  232. package/dist/utils/json-loader.js +1 -1
  233. package/dist/utils/local-cache.js +1 -1
  234. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  235. package/dist/utils/logger/formatters/index.js +1 -1
  236. package/dist/utils/logger/handlers/console-handler.js +1 -1
  237. package/dist/utils/logger/handlers/file-handler.js +1 -1
  238. package/dist/utils/logger/handlers/index.js +1 -1
  239. package/dist/utils/logger/handlers/null-handler.js +1 -1
  240. package/dist/utils/logger/index.js +1 -1
  241. package/dist/utils/logger/logger.js +1 -1
  242. package/dist/utils/logger/types.js +1 -1
  243. package/dist/utils/option-validation.js +1 -1
  244. package/dist/utils/process.js +1 -1
  245. package/dist/utils/prompt.js +1 -1
  246. package/dist/utils/spinner.js +1 -1
  247. package/dist/utils/sse-parser.js +1 -1
  248. package/dist/utils/string-utils.js +1 -1
  249. package/dist/utils/table-ref-parser.js +1 -1
  250. package/dist/utils/tdx-logger.js +1 -1
  251. package/dist/utils/version-check.js +1 -1
  252. package/package.json +1 -1
@@ -1 +1 @@
1
- const a31_0x10c381=a31_0xc607;(function(_0x1fd1d9,_0x1ffd67){const _0x51c9ee=a31_0xc607,_0xdcfa11=_0x1fd1d9();while(!![]){try{const _0x20b4d0=parseInt(_0x51c9ee(0x120))/0x1*(-parseInt(_0x51c9ee(0x110))/0x2)+-parseInt(_0x51c9ee(0x26e))/0x3*(-parseInt(_0x51c9ee(0x8e))/0x4)+-parseInt(_0x51c9ee(0x7d))/0x5*(parseInt(_0x51c9ee(0x207))/0x6)+parseInt(_0x51c9ee(0x12d))/0x7*(-parseInt(_0x51c9ee(0x1c9))/0x8)+-parseInt(_0x51c9ee(0x25a))/0x9*(parseInt(_0x51c9ee(0x1b1))/0xa)+-parseInt(_0x51c9ee(0x1ea))/0xb+parseInt(_0x51c9ee(0x25f))/0xc;if(_0x20b4d0===_0x1ffd67)break;else _0xdcfa11['push'](_0xdcfa11['shift']());}catch(_0x115682){_0xdcfa11['push'](_0xdcfa11['shift']());}}}(a31_0x1457,0x52aaf));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x1ac1cb from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x343d08 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x10c381(0x17c),LEGACY_PARENT_SEGMENT_DIR=a31_0x10c381(0x27d);function openBrowser(_0x89c7b0){const _0x5a5e7b=a31_0x10c381,_0x59e79b=process[_0x5a5e7b(0xd8)],_0x5e9bb3=_0x59e79b===_0x5a5e7b(0x18c)?'open':_0x59e79b===_0x5a5e7b(0x249)?'start':_0x5a5e7b(0xb4);spawn(_0x5e9bb3,[_0x89c7b0],{'detached':!![],'stdio':'ignore'})[_0x5a5e7b(0x256)]();}function migrateLegacyDirectory(){const _0xcaade6=a31_0x10c381;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x3c2c03=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x3c2c03[_0xcaade6(0x132)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x185)](_0xcaade6(0x142)+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0x1a5)+PARENT_SEGMENT_DIR+_0xcaade6(0x222))),console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x1a7)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0xbf))),![];console['error'](a31_0x343d08[_0xcaade6(0x185)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0x19f)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x97)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x421e28){const _0x59c778=_0x421e28 instanceof Error?_0x421e28[_0xcaade6(0x14e)]:String(_0x421e28);return console['error'](a31_0x343d08['red'](_0xcaade6(0x23e)+_0x59c778+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x10c381(0xb3)](_0x31a99c){const _0x187c15=a31_0x10c381;return migrateLegacyDirectory(),super[_0x187c15(0xb3)](_0x31a99c);}}function resolveYamlFile(_0x474569){const _0x53ef7e=a31_0x10c381;if(_0x474569[_0x53ef7e(0x1fa)](_0x53ef7e(0x1d1))||_0x474569['endsWith']('.yaml'))return _0x474569;return a31_0x1ac1cb[_0x53ef7e(0xa1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x474569)+_0x53ef7e(0x1d1));}function formatProgressMessage(_0x3fb98b){const _0x50c57b=a31_0x10c381,_0x2c5e7b=_0x3fb98b[_0x50c57b(0x21d)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2c5e7b){const [,_0x3ee29e,_0x2818e2,_0x3ad993='']=_0x2c5e7b;return a31_0x343d08[_0x50c57b(0x1a7)](_0x3ee29e+':')+'\x20'+_0x2818e2+a31_0x343d08[_0x50c57b(0x1a7)](_0x3ad993);}return a31_0x343d08['dim'](_0x3fb98b);}function showFileNotFoundError(_0x3c8c5a,_0x1023bb){const _0xb4bb17=a31_0x10c381;console['error'](a31_0x343d08[_0xb4bb17(0x11b)]('Error:\x20File\x20not\x20found:\x20'+_0x3c8c5a+'\x0a')),console[_0xb4bb17(0xdd)](a31_0x343d08[_0xb4bb17(0x12a)](_0xb4bb17(0x96)+_0x1023bb+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x54e068){const _0x36fd51=a31_0x10c381;if(!_0x54e068[_0x36fd51(0x193)])return;const _0x2b2d53=_0x54e068[_0x36fd51(0x193)],_0x19acbe=_0x2b2d53[_0x36fd51(0x191)]?a31_0x343d08[_0x36fd51(0x97)]('⚡\x20Enabled'):a31_0x343d08[_0x36fd51(0x185)](_0x36fd51(0xbc));console['error']('\x0a'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x261))+'\x20'+_0x19acbe);if(_0x2b2d53[_0x36fd51(0xdc)]&&_0x2b2d53[_0x36fd51(0xdc)][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)]('Events:')+'\x20'+_0x2b2d53[_0x36fd51(0xdc)]['length']+_0x36fd51(0x135));for(const _0x85cacc of _0x2b2d53['events']){const _0x51a017=_0x85cacc[_0x36fd51(0x1f1)]===![]?a31_0x343d08[_0x36fd51(0x11b)]('✘'):a31_0x343d08[_0x36fd51(0x97)]('✔');console[_0x36fd51(0xdd)](_0x36fd51(0x263)+_0x51a017+'\x20'+_0x85cacc[_0x36fd51(0x23b)]),_0x85cacc[_0x36fd51(0x1dd)]&&console['error'](_0x36fd51(0x235)+a31_0x343d08[_0x36fd51(0x11b)](_0x85cacc['sourceTableError']));}}if(_0x2b2d53[_0x36fd51(0x166)]&&_0x2b2d53[_0x36fd51(0x166)][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x170))+'\x20'+_0x2b2d53[_0x36fd51(0x166)][_0x36fd51(0x190)]+_0x36fd51(0x135));for(const _0x2108bb of _0x2b2d53[_0x36fd51(0x166)]){const _0x3c90cd=_0x2108bb['valid']?a31_0x343d08[_0x36fd51(0x97)]('✔'):a31_0x343d08['red']('✘');console[_0x36fd51(0xdd)](_0x36fd51(0x263)+_0x3c90cd+'\x20'+_0x2108bb[_0x36fd51(0x23b)]+'\x20'+a31_0x343d08['dim']('('+_0x2108bb[_0x36fd51(0x83)]+')'));}}if(_0x2b2d53['idStitching']){const _0x380698=_0x2b2d53[_0x36fd51(0x155)][_0x36fd51(0xb5)]?.[_0x36fd51(0x190)]?'\x20+\x20['+_0x2b2d53['idStitching'][_0x36fd51(0xb5)][_0x36fd51(0xa1)](',\x20')+']':'';console['error']('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x23a))+'\x20'+_0x2b2d53[_0x36fd51(0x155)]['primaryKey']+_0x380698);}if(_0x2b2d53[_0x36fd51(0x101)]&&_0x2b2d53['personalizationServices'][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0xac))+'\x20'+_0x2b2d53['personalizationServices']['length']+_0x36fd51(0x18a)+(_0x2b2d53['personalizationServices'][_0x36fd51(0x190)]!==0x1?'s':''));for(const _0x462e28 of _0x2b2d53[_0x36fd51(0x101)]){console[_0x36fd51(0xdd)](_0x36fd51(0x1ab)+_0x462e28[_0x36fd51(0x23b)]);}}}function showParentSegmentNotSetError(_0x471b57){const _0x3a53c0=a31_0x10c381;console[_0x3a53c0(0xdd)](a31_0x343d08[_0x3a53c0(0x185)](_0x3a53c0(0x241))),console[_0x3a53c0(0xdd)](_0x471b57);}export class ParentSegmentListCommand extends BaseCommand{['name']='segment:parent:list';['description']='List\x20parent\x20segments';async[a31_0x10c381(0xa0)](_0x3098bc){const _0x4fee57=a31_0x10c381,{options:_0x298992,args:_0x19eaf8,tdx:_0x3066c2}=_0x3098bc,_0x1e51b2=_0x19eaf8[0x0];_0x298992[_0x4fee57(0x20b)]&&(console[_0x4fee57(0xdd)](_0x4fee57(0x25d)+_0x298992[_0x4fee57(0x201)]),_0x1e51b2&&console[_0x4fee57(0xdd)](_0x4fee57(0x220)+_0x1e51b2));const _0x60d6da=await withSpinner(_0x1e51b2?_0x4fee57(0x13c)+_0x1e51b2+_0x4fee57(0x169):_0x4fee57(0x250),()=>_0x3066c2['segment'][_0x4fee57(0x1c7)](),{'verbose':_0x298992[_0x4fee57(0x20b)]});let _0x42c91a=_0x60d6da[_0x4fee57(0x8b)];if(_0x1e51b2){const _0x21f67c=_0x1e51b2[_0x4fee57(0x15f)](/[.+^${}()|[\]\\]/g,_0x4fee57(0x1f3))['replace'](/\*/g,'.*')[_0x4fee57(0x15f)](/\?/g,'.'),_0xcb71d9=new RegExp('^'+_0x21f67c+'$','i');_0x42c91a=_0x42c91a[_0x4fee57(0xe0)](_0xc7704d=>_0xcb71d9['test'](_0xc7704d[_0x4fee57(0x166)]['name']));}_0x42c91a['sort']((_0x3f5cc9,_0x2c6157)=>_0x3f5cc9['attributes'][_0x4fee57(0x23b)][_0x4fee57(0x19e)](_0x2c6157[_0x4fee57(0x166)][_0x4fee57(0x23b)])),console[_0x4fee57(0xdd)](_0x4fee57(0x227)+_0x42c91a[_0x4fee57(0x190)]+_0x4fee57(0xca)+(_0x42c91a[_0x4fee57(0x190)]!==0x1?'s':''));const _0xabf71b=_0x3831f5=>{const _0x4f3d85=_0x4fee57;return getConsoleNextUrl(_0x298992[_0x4f3d85(0x201)],'/app/dw/parentSegments/'+_0x3831f5);};if(_0x298992['format']===_0x4fee57(0x22f)||_0x298992[_0x4fee57(0x6f)]===_0x4fee57(0xd1)){const _0x42622d=_0x42c91a[_0x4fee57(0xe9)](_0x54430f=>({..._0x54430f,'url':_0xabf71b(_0x54430f['id'])}));await handleSDKOutput(_0x42622d,_0x298992);}else{if(_0x42c91a[_0x4fee57(0x190)]===0x0)_0x1e51b2?console[_0x4fee57(0x1db)](_0x4fee57(0x17a)+_0x1e51b2):console[_0x4fee57(0x1db)](_0x4fee57(0x1d5));else for(const _0x128efa of _0x42c91a){const _0x45ac87=_0x128efa['attributes'][_0x4fee57(0x19b)]?a31_0x343d08[_0x4fee57(0x1a7)]('\x20('+formatRows(_0x128efa['attributes'][_0x4fee57(0x19b)])+')'):'',_0x31536e=hyperlink(_0x128efa[_0x4fee57(0x166)]['name'],_0xabf71b(_0x128efa['id']));console['log'](_0x4fee57(0xea)+_0x31536e+_0x45ac87);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x72);[a31_0x10c381(0x184)]=a31_0x10c381(0x15c);async[a31_0x10c381(0xa0)](_0x30d66b){const _0x45ef3d=a31_0x10c381,{options:_0x47dcb2,args:_0x53ffcd,tdx:_0x5d241e}=_0x30d66b;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x45ef3d(0x22d)+_0x45ef3d(0x211));const _0x56a0f8=_0x47dcb2;if(_0x53ffcd[_0x45ef3d(0x190)]===0x0)return console[_0x45ef3d(0xdd)](a31_0x343d08[_0x45ef3d(0x11b)](_0x45ef3d(0x99))),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x2a94b3=_0x53ffcd[0x0];if(!_0x56a0f8[_0x45ef3d(0x127)]||!_0x56a0f8['table'])return console[_0x45ef3d(0xdd)](_0x45ef3d(0xfb)),console[_0x45ef3d(0xdd)](_0x45ef3d(0xf4)),0x1;_0x56a0f8[_0x45ef3d(0x20b)]&&(console['error'](_0x45ef3d(0x25d)+_0x56a0f8[_0x45ef3d(0x201)]),console['error']('Name:\x20'+_0x2a94b3),console[_0x45ef3d(0xdd)](_0x45ef3d(0x9b)+_0x56a0f8[_0x45ef3d(0x127)]),console[_0x45ef3d(0xdd)](_0x45ef3d(0x11d)+_0x56a0f8[_0x45ef3d(0x27e)]));const _0x39917c=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x166)],_0x56a0f8[_0x45ef3d(0x71)]),_0x581764=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x70)],_0x56a0f8['behaviorsFile']),_0x53e0ca=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x102)],_0x56a0f8['customerGroupFile']),_0x21125d={'name':_0x2a94b3,'description':_0x56a0f8['description'],'scheduleType':_0x56a0f8[_0x45ef3d(0x177)],'scheduleOption':_0x56a0f8[_0x45ef3d(0x27b)],'timezone':_0x56a0f8[_0x45ef3d(0x214)],'master':{'parentDatabaseName':_0x56a0f8['database'],'parentTableName':_0x56a0f8[_0x45ef3d(0x27e)]},'attributes':_0x39917c,'behaviors':_0x581764,'customerGroup':_0x53e0ca},_0x125ae7=await withSpinner(_0x45ef3d(0x86)+_0x2a94b3+_0x45ef3d(0x169),()=>_0x5d241e[_0x45ef3d(0x209)][_0x45ef3d(0x73)](_0x21125d),{'verbose':_0x47dcb2[_0x45ef3d(0x20b)]}),_0x36ee59=_0x125ae7[_0x45ef3d(0x8b)];return console[_0x45ef3d(0xdd)](_0x45ef3d(0x194)+_0x36ee59['name']+_0x45ef3d(0x274)+_0x36ee59['id']),await handleSDKOutput([_0x36ee59],_0x47dcb2),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x218);['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x43aaf4){const _0x6bf07=a31_0x10c381,{options:_0x22ddfb,args:_0x46f3f3,tdx:_0x815c9}=_0x43aaf4;console[_0x6bf07(0xdd)](_0x6bf07(0x7f)+_0x6bf07(0x22d)+_0x6bf07(0x211));const _0x5cd3e5=_0x22ddfb;if(_0x46f3f3[_0x6bf07(0x190)]===0x0)return console['error'](a31_0x343d08[_0x6bf07(0x11b)](_0x6bf07(0x99))),console['error'](_0x6bf07(0x225)),0x1;const _0x314baf=_0x46f3f3[0x0];_0x5cd3e5[_0x6bf07(0x20b)]&&(console['error']('Site:\x20'+_0x5cd3e5['site']),console[_0x6bf07(0xdd)](_0x6bf07(0x224)+_0x314baf));const _0x5c1d31=await withSpinner(_0x6bf07(0x240)+_0x314baf+_0x6bf07(0x169),()=>_0x815c9[_0x6bf07(0x209)]['getParentFull'](_0x314baf),{'verbose':_0x5cd3e5['verbose']}),_0x2dba1f=_0x5c1d31['data'],_0x93ebbb=await loadJSONFromOptions(_0x5cd3e5['addAttributes'],_0x5cd3e5[_0x6bf07(0x180)]),_0x3b0f25=await loadJSONFromOptions(_0x5cd3e5['addBehaviors'],_0x5cd3e5[_0x6bf07(0x131)]),_0x590d80={'name':_0x2dba1f[_0x6bf07(0x23b)],'description':_0x5cd3e5[_0x6bf07(0x184)]!==undefined?_0x5cd3e5[_0x6bf07(0x184)]:_0x2dba1f[_0x6bf07(0x184)],'scheduleType':_0x5cd3e5[_0x6bf07(0x177)]!==undefined?_0x5cd3e5[_0x6bf07(0x177)]:_0x2dba1f[_0x6bf07(0x177)],'scheduleOption':_0x5cd3e5[_0x6bf07(0x27b)]!==undefined?_0x5cd3e5['scheduleOption']:_0x2dba1f[_0x6bf07(0x27b)],'timezone':_0x5cd3e5[_0x6bf07(0x214)]!==undefined?_0x5cd3e5[_0x6bf07(0x214)]:_0x2dba1f['timezone'],'master':_0x2dba1f['master'],'attributes':_0x93ebbb?[..._0x2dba1f['attributes']||[],..._0x93ebbb]:_0x2dba1f[_0x6bf07(0x166)],'behaviors':_0x3b0f25?[..._0x2dba1f[_0x6bf07(0x70)]||[],..._0x3b0f25]:_0x2dba1f[_0x6bf07(0x70)],'customerGroup':_0x2dba1f[_0x6bf07(0x102)]},_0x1458b6=await withSpinner(_0x6bf07(0x1ec)+_0x314baf+_0x6bf07(0x169),()=>_0x815c9[_0x6bf07(0x209)]['updateParent'](_0x314baf,_0x590d80),{'verbose':_0x5cd3e5[_0x6bf07(0x20b)]}),_0x3d14f5=_0x1458b6['data'];return console[_0x6bf07(0xdd)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x3d14f5[_0x6bf07(0x23b)]+'\x27'),await handleSDKOutput([_0x3d14f5],_0x5cd3e5),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']='segment:parent:pull';[a31_0x10c381(0x184)]=a31_0x10c381(0x178);async[a31_0x10c381(0xa0)](_0x5914c6){const _0x5e1418=a31_0x10c381,{options:_0x2a7f89,args:_0x16d040,tdx:_0x3e98ed}=_0x5914c6,_0x3841aa=_0x2a7f89,_0xd3e6f0=_0x16d040[0x0]||_0x2a7f89[_0x5e1418(0x113)];if(!_0xd3e6f0)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x5e1418(0x104)),0x1;if(_0x3841aa['use']&&_0x3841aa[_0x5e1418(0x1f5)])return console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x11b)](_0x5e1418(0x24d))),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)](_0x5e1418(0x95)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x5e1418(0xdd)](a31_0x343d08['cyan'](_0x5e1418(0x277))),0x1;const _0x2168c=_0x3841aa[_0x5e1418(0x1f5)]||a31_0x1ac1cb[_0x5e1418(0xa1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xd3e6f0)+'.yml');_0x3841aa[_0x5e1418(0x20b)]&&(console[_0x5e1418(0xdd)](_0x5e1418(0x25d)+_0x3841aa[_0x5e1418(0x201)]),console[_0x5e1418(0xdd)](_0x5e1418(0x224)+_0xd3e6f0),console[_0x5e1418(0xdd)](_0x5e1418(0x1bc)+_0x2168c));const _0x501d2c=await withSpinner(_0x5e1418(0xa9)+_0xd3e6f0+_0x5e1418(0x169),()=>_0x3e98ed[_0x5e1418(0x209)][_0x5e1418(0x159)](_0xd3e6f0),{'verbose':_0x3841aa[_0x5e1418(0x20b)]}),_0x316e1d=_0x501d2c[_0x5e1418(0x8b)];if(existsSync(_0x2168c)){const _0x53711b=readFileSync(_0x2168c,_0x5e1418(0x20f)),_0x1787d5=generateDiff(_0x53711b,_0x316e1d);if(!hasChanges(_0x1787d5))console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0x90)+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c)+'\x20is\x20already\x20up\x20to\x20date');else{console['error'](_0x5e1418(0x1b2)+_0x2168c+'\x27:'),console[_0x5e1418(0xdd)]('─'[_0x5e1418(0x1c1)](0x3c)),console[_0x5e1418(0xdd)](formatDiffWithColors(_0x1787d5)),console[_0x5e1418(0xdd)]('─'[_0x5e1418(0x1c1)](0x3c));if(!_0x3841aa[_0x5e1418(0x130)]){if(!isInteractive())return console['error'](a31_0x343d08[_0x5e1418(0x11b)](_0x5e1418(0xfd)),_0x5e1418(0x1b0)),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)](_0x5e1418(0x182))),0x1;const _0x110ecf=await confirmKey('Overwrite\x20\x27'+_0x2168c+'\x27?');if(!_0x110ecf)return console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x185)](_0x5e1418(0x1ae))),0x1;}writeFileSync(_0x2168c,_0x316e1d,'utf-8'),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0x14c)+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c));}}else{const _0x5b8b1e=a31_0x1ac1cb['dirname'](_0x2168c);!existsSync(_0x5b8b1e)&&mkdirSync(_0x5b8b1e,{'recursive':!![]}),writeFileSync(_0x2168c,_0x316e1d,_0x5e1418(0x20f)),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c));}return saveSessionContext({'parent_segment':_0xd3e6f0},_0x3841aa['session']),console['error'](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0xed)+a31_0x343d08['dim'](_0x5e1418(0x27d))+'\x20=\x20'+a31_0x343d08[_0x5e1418(0x12a)](_0xd3e6f0)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]='segment:parent:push';[a31_0x10c381(0x184)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0x171a9d){const _0x43569e=a31_0x10c381,{options:_0x282466,args:_0x1d0c17,tdx:_0x2da1ce}=_0x171a9d,_0x54c023=_0x282466,_0xf3e4b8=_0x1d0c17[0x0]||_0x282466[_0x43569e(0x113)];if(!_0xf3e4b8)return showParentSegmentNotSetError(_0x43569e(0x6c)+_0x43569e(0x245)),0x1;const _0x94f6bc=resolveYamlFile(_0xf3e4b8);if(!existsSync(_0x94f6bc))return showFileNotFoundError(_0x94f6bc,_0xf3e4b8),0x1;_0x54c023[_0x43569e(0x20b)]&&(console['error'](_0x43569e(0x25d)+_0x54c023[_0x43569e(0x201)]),console['error']('YAML\x20file:\x20'+_0x94f6bc));let _0x4fb0c1;try{_0x4fb0c1=readFileSync(_0x94f6bc,_0x43569e(0x20f));}catch(_0x46032b){const _0x5deaca=_0x46032b instanceof Error?_0x46032b['message']:String(_0x46032b);return console[_0x43569e(0xdd)](_0x43569e(0x1cf)+_0x5deaca),0x1;}const _0x4ec2f8=await withSpinner(_0x43569e(0x1ff),()=>_0x2da1ce[_0x43569e(0x209)][_0x43569e(0xce)](_0x4fb0c1),{'verbose':_0x54c023['verbose']}),_0x4dd4ba=_0x4ec2f8['data'],{isNew:_0x4fa72,name:_0x3532f8,hasChanges:_0x5c524f,diffFormatted:_0x118c43}=_0x4dd4ba;if(!_0x5c524f)return console['error'](_0x43569e(0x1e6)+_0x3532f8+_0x43569e(0x1ce)),0x0;_0x4fa72?console[_0x43569e(0xdd)](_0x43569e(0xcb)+_0x3532f8+'\x27:'):console['error'](_0x43569e(0xfa)+_0x3532f8+'\x27:');console[_0x43569e(0xdd)]('─'[_0x43569e(0x1c1)](0x3c)),console[_0x43569e(0xdd)](_0x118c43),console['error']('─'['repeat'](0x3c));const _0x3ed510=_0x4fa72?_0x43569e(0x136)+_0x3532f8+'\x27?':_0x43569e(0xb7)+_0x3532f8+'\x27?';if(!_0x54c023['yes']){if(!isInteractive())return console[_0x43569e(0xdd)](a31_0x343d08[_0x43569e(0x11b)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x43569e(0xdd)](a31_0x343d08['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4c3828=await confirmKey(_0x3ed510);if(!_0x4c3828)return console[_0x43569e(0xdd)](a31_0x343d08[_0x43569e(0x185)](_0x43569e(0x1ae))),0x1;}const _0x28d0c0=_0x4fa72?_0x43569e(0x147):_0x43569e(0x1a4),_0x52241c=await withSpinner(_0x28d0c0+_0x43569e(0x199)+_0x3532f8+'\x27...',()=>_0x4dd4ba[_0x43569e(0x9a)](),{'verbose':_0x54c023[_0x43569e(0x20b)]}),_0x552605=_0x52241c['data'],_0x1e14b9=getConsoleNextUrl(_0x54c023[_0x43569e(0x201)],_0x43569e(0x13d)+_0x552605['id']),_0x34ebeb=_0x4fa72?_0x43569e(0x21e):_0x43569e(0xcd);return console[_0x43569e(0xdd)]('✔\x20'+_0x34ebeb+_0x43569e(0x199)+_0x552605[_0x43569e(0x23b)]+'\x27'),console['error']('\x20\x20'+_0x1e14b9),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xd4);[a31_0x10c381(0x184)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a31_0x10c381(0xa0)](_0x135961){const _0xd78c2f=a31_0x10c381,{options:_0x38c0e8,args:_0x3c66fa,tdx:_0x1df442}=_0x135961,_0x53086f=_0x38c0e8,_0x237b8c=_0x3c66fa[0x0]||_0x38c0e8[_0xd78c2f(0x113)];if(!_0x237b8c)return showParentSegmentNotSetError(_0xd78c2f(0xef)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0xd78c2f(0x1a2)+_0xd78c2f(0x1b6)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0xd78c2f(0xd9)),0x1;const _0x1ce1d9=resolveYamlFile(_0x237b8c);if(!existsSync(_0x1ce1d9))return showFileNotFoundError(_0x1ce1d9,_0x237b8c),0x1;_0x53086f[_0xd78c2f(0x20b)]&&(console[_0xd78c2f(0xdd)](_0xd78c2f(0x25d)+_0x53086f[_0xd78c2f(0x201)]),console[_0xd78c2f(0xdd)]('YAML\x20file:\x20'+_0x1ce1d9));let _0x258ce7;try{_0x258ce7=readFileSync(_0x1ce1d9,_0xd78c2f(0x20f));}catch(_0x304227){const _0x173b17=_0x304227 instanceof Error?_0x304227[_0xd78c2f(0x14e)]:String(_0x304227);return console[_0xd78c2f(0xdd)](_0xd78c2f(0x1cf)+_0x173b17),0x1;}const _0x573b64=createCommandSpinner(a31_0x343d08[_0xd78c2f(0x1a7)](_0xd78c2f(0x216)),{'verbose':_0x53086f[_0xd78c2f(0x20b)]});_0x573b64[_0xd78c2f(0x134)]();const _0x32e9e3={'onProgress':_0x61ba4f=>{_0x573b64['text']=formatProgressMessage(_0x61ba4f);}};if(_0x53086f[_0xd78c2f(0x77)])_0x32e9e3[_0xd78c2f(0x77)]=!![];if(_0x53086f[_0xd78c2f(0x27f)])_0x32e9e3[_0xd78c2f(0x27f)]=!![];_0x53086f[_0xd78c2f(0xf8)]&&(_0x32e9e3[_0xd78c2f(0xf8)]=_0x53086f[_0xd78c2f(0xf8)]);_0x53086f['behavior']&&(_0x32e9e3[_0xd78c2f(0x239)]=_0x53086f[_0xd78c2f(0x239)]);if(_0x53086f['interval'])_0x32e9e3['interval']=_0x53086f[_0xd78c2f(0x1f4)];let _0x2cb6e8;try{_0x2cb6e8=await _0x1df442[_0xd78c2f(0x209)][_0xd78c2f(0x13e)](_0x258ce7,_0x32e9e3),_0x573b64[_0xd78c2f(0xf6)]();}catch(_0x47ae22){_0x573b64['stop']();throw _0x47ae22;}const _0x3907d4=_0x53086f[_0xd78c2f(0x1f4)]||_0xd78c2f(0x206);return this[_0xd78c2f(0xf5)](_0x2cb6e8,_0x32e9e3,_0x1ce1d9,_0x3907d4),_0x2cb6e8[_0xd78c2f(0x202)]?0x0:0x1;}[a31_0x10c381(0xf5)](_0x57cabf,_0xa75c38,_0x15cac8,_0x12fd59){const _0x2ee003=a31_0x10c381;console['error']('\x0a'+a31_0x343d08['bold'](_0x2ee003(0x115))+'\x20'+_0x57cabf[_0x2ee003(0x23b)]),console[_0x2ee003(0xdd)]('═'[_0x2ee003(0x1c1)](0x3c)),this[_0x2ee003(0x1c5)](_0x57cabf);if(typeof _0xa75c38[_0x2ee003(0xf8)]===_0x2ee003(0x6d)){this[_0x2ee003(0x213)](_0x57cabf),this['displaySummary'](_0x57cabf),this['displayPreviewHints'](_0x15cac8,_0x12fd59,_0x2ee003(0xf8),_0xa75c38[_0x2ee003(0xf8)]);return;}if(_0xa75c38[_0x2ee003(0xf8)]===!![]){this[_0x2ee003(0x213)](_0x57cabf),this['displaySummary'](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,'attributes');return;}if(typeof _0xa75c38[_0x2ee003(0x239)]===_0x2ee003(0x6d)){this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this['displaySummary'](_0x57cabf),this['displayPreviewHints'](_0x15cac8,_0x12fd59,'behavior',_0xa75c38[_0x2ee003(0x239)]);return;}if(_0xa75c38[_0x2ee003(0x239)]===!![]){this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this['displaySummary'](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,'behaviors');return;}this[_0x2ee003(0x213)](_0x57cabf),this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this[_0x2ee003(0x187)](_0x57cabf),this[_0x2ee003(0xc8)](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,_0x2ee003(0x1e8));}[a31_0x10c381(0x187)](_0xef9990){displayRealtimeValidation(_0xef9990);}[a31_0x10c381(0x16c)](_0xc115bf,_0x4ccd89,_0x255708,_0x3b533d){const _0x270f54=a31_0x10c381;console[_0x270f54(0xdd)]('\x0a'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x1f6)));const _0x3f5906=_0x4ccd89!==_0x270f54(0x206)?_0x270f54(0x8c)+_0x4ccd89:'';if(_0x255708==='attribute'&&_0x3b533d)console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x26b)+_0x3b533d+'\x22'+_0x3f5906));else{if(_0x255708===_0x270f54(0x239)&&_0x3b533d)console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x13b)+_0x3b533d+'\x22'+_0x3f5906));else(_0x255708==='attributes'||_0x255708===_0x270f54(0x1e8))&&console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)]('tdx\x20ps\x20preview\x20'+_0xc115bf+'\x20--attribute\x20\x22<name>\x22'+_0x3f5906));}(_0x255708==='behaviors'||_0x255708===_0x270f54(0x1e8))&&console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x22e)+_0x3f5906)),_0x255708===_0x270f54(0x1e8)&&console['error']('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)]('tdx\x20ps\x20preview\x20'+_0xc115bf+'\x20--enriched'+_0x3f5906));}[a31_0x10c381(0x1c5)](_0x19c790){const _0x256ce5=a31_0x10c381,{master:_0x44faa4}=_0x19c790,_0x28de44=_0x44faa4[_0x256ce5(0x121)]?a31_0x343d08[_0x256ce5(0x97)]('✔'):a31_0x343d08['red']('✘');console[_0x256ce5(0xdd)]('\x0a'+a31_0x343d08['dim'](_0x256ce5(0x108))),console[_0x256ce5(0xdd)](_0x28de44+'\x20'+a31_0x343d08[_0x256ce5(0x10a)](_0x44faa4[_0x256ce5(0x127)]+'.'+_0x44faa4[_0x256ce5(0x27e)])),_0x44faa4[_0x256ce5(0x121)]?_0x44faa4[_0x256ce5(0x139)]!==undefined&&console[_0x256ce5(0xdd)]('\x20\x20'+a31_0x343d08[_0x256ce5(0x1a7)](_0x256ce5(0x16f))+'\x20'+a31_0x343d08[_0x256ce5(0x12a)](formatRows(_0x44faa4[_0x256ce5(0x139)]))):console[_0x256ce5(0xdd)]('\x20\x20'+a31_0x343d08[_0x256ce5(0x11b)](_0x256ce5(0xaa))+'\x20'+_0x44faa4[_0x256ce5(0x80)]);}['displayAttributesStats'](_0x31044a){const _0x5337eb=a31_0x10c381;if(_0x31044a[_0x5337eb(0x166)]['length']===0x0)return;console[_0x5337eb(0xdd)]('\x0a'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0x12b)));for(const _0x3fb821 of _0x31044a[_0x5337eb(0x166)]){const _0x37062b=_0x3fb821[_0x5337eb(0x121)]?a31_0x343d08[_0x5337eb(0x97)]('✔'):a31_0x343d08[_0x5337eb(0x11b)]('✘');let _0x1986a2='';if(_0x3fb821['schemaValid']&&_0x3fb821[_0x5337eb(0x111)]!==undefined&&_0x3fb821[_0x5337eb(0x14f)]!==undefined){const _0x42ba99=_0x3fb821[_0x5337eb(0x14f)][_0x5337eb(0x1de)](0x1),_0x591dbd=_0x3fb821[_0x5337eb(0x14f)]>=0x50?a31_0x343d08[_0x5337eb(0x97)]:_0x3fb821['coveragePercent']>=0x32?a31_0x343d08[_0x5337eb(0x185)]:a31_0x343d08[_0x5337eb(0x11b)];_0x1986a2='\x20'+a31_0x343d08[_0x5337eb(0x1a7)]('Coverage:')+'\x20'+_0x591dbd(_0x42ba99+'%')+'\x20('+formatRows(_0x3fb821['matchedCount'])+_0x5337eb(0x78);}console[_0x5337eb(0xdd)](_0x37062b+'\x20'+a31_0x343d08[_0x5337eb(0x10a)](_0x3fb821[_0x5337eb(0x23b)])+_0x1986a2),console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0xa3))+'\x20'+a31_0x343d08[_0x5337eb(0x10a)](_0x3fb821[_0x5337eb(0x127)]+'.'+_0x3fb821[_0x5337eb(0x27e)]));const _0x3cdd2f=_0x3fb821[_0x5337eb(0x14d)]===_0x3fb821[_0x5337eb(0x20a)]?a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0x22c))+'\x20'+_0x3fb821[_0x5337eb(0x14d)]:a31_0x343d08[_0x5337eb(0x1a7)]('Join:')+'\x20'+_0x3fb821[_0x5337eb(0x14d)]+_0x5337eb(0x212)+_0x3fb821[_0x5337eb(0x20a)];console['error']('\x20\x20'+_0x3cdd2f),console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0xd5))),this[_0x5337eb(0x114)](_0x3fb821[_0x5337eb(0x1e1)]),!_0x3fb821[_0x5337eb(0x121)]&&console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08['red']('Error:')+'\x20'+_0x3fb821[_0x5337eb(0x80)]);}}[a31_0x10c381(0x1eb)](_0x41b017,_0x39bfd0){const _0x7fa835=a31_0x10c381;if(_0x41b017[_0x7fa835(0x70)][_0x7fa835(0x190)]===0x0)return;console['error']('\x0a'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xa5))+'\x20'+a31_0x343d08['dim']('('+_0x39bfd0+')'));for(const _0x16facd of _0x41b017[_0x7fa835(0x70)]){const _0x1038b1=_0x16facd[_0x7fa835(0x121)]?a31_0x343d08['green']('✔'):a31_0x343d08['red']('✘');let _0x6af501='';if(_0x16facd[_0x7fa835(0x121)]&&_0x16facd['customersWithEvents']!==undefined&&_0x16facd[_0x7fa835(0x6a)]!==undefined){const _0x1b6bc7=_0x16facd['customerPercent']?.[_0x7fa835(0x1de)](0x1)||'?',_0x273fe0=(_0x16facd[_0x7fa835(0x174)]??0x0)>=0x32?a31_0x343d08['green']:(_0x16facd[_0x7fa835(0x174)]??0x0)>=0x14?a31_0x343d08['yellow']:a31_0x343d08[_0x7fa835(0x11b)];_0x6af501='\x20'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xe3))+'\x20'+_0x273fe0(formatRows(_0x16facd[_0x7fa835(0x266)]))+'\x20('+_0x1b6bc7+'%)\x20'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0x160))+'\x20'+a31_0x343d08['cyan'](formatRows(_0x16facd['totalEvents']));}console[_0x7fa835(0xdd)](_0x1038b1+'\x20'+a31_0x343d08['bold'](_0x16facd['name'])+_0x6af501),console[_0x7fa835(0xdd)]('\x20\x20'+a31_0x343d08[_0x7fa835(0x1a7)]('Source:')+'\x20'+a31_0x343d08[_0x7fa835(0x10a)](_0x16facd[_0x7fa835(0x127)]+'.'+_0x16facd[_0x7fa835(0x27e)]));const _0x13f23a=_0x16facd[_0x7fa835(0x14d)]===_0x16facd['foreignKey']?a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0x22c))+'\x20'+_0x16facd[_0x7fa835(0x14d)]:a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xf9))+'\x20'+_0x16facd[_0x7fa835(0x14d)]+_0x7fa835(0x212)+_0x16facd[_0x7fa835(0x20a)];console['error']('\x20\x20'+_0x13f23a),console['error']('\x20\x20'+a31_0x343d08[_0x7fa835(0x1a7)]('Columns:')),this[_0x7fa835(0x114)](_0x16facd[_0x7fa835(0x1e1)]),!_0x16facd['schemaValid']&&console['error']('\x20\x20'+a31_0x343d08['red'](_0x7fa835(0xaa))+'\x20'+_0x16facd['schemaError']);}}[a31_0x10c381(0x114)](_0x56c907){const _0x43e2f9=a31_0x10c381;for(const _0x471d2d of _0x56c907){_0x471d2d[_0x43e2f9(0x23d)]===_0x471d2d[_0x43e2f9(0xbd)]||_0x471d2d[_0x43e2f9(0xbd)]==='*'?console[_0x43e2f9(0xdd)](_0x43e2f9(0x1ab)+_0x471d2d['label']):console[_0x43e2f9(0xdd)](_0x43e2f9(0x1ab)+_0x471d2d[_0x43e2f9(0x23d)]+'\x20'+a31_0x343d08[_0x43e2f9(0x1a7)]('('+_0x471d2d['column']+')'));}}[a31_0x10c381(0xc8)](_0x3a0d04){const _0x4767ea=a31_0x10c381;console[_0x4767ea(0xdd)]('─'[_0x4767ea(0x1c1)](0x3c));if(_0x3a0d04[_0x4767ea(0xc0)]['length']>0x0){console[_0x4767ea(0xdd)]('\x0a'+a31_0x343d08[_0x4767ea(0x11b)]('Errors:'));for(const _0x5a1673 of _0x3a0d04[_0x4767ea(0xc0)]){console[_0x4767ea(0xdd)]('\x20\x20'+a31_0x343d08[_0x4767ea(0x11b)]('•')+'\x20'+_0x5a1673);}}_0x3a0d04[_0x4767ea(0x202)]&&console['error']('\x0a'+a31_0x343d08[_0x4767ea(0x97)]('✔')+_0x4767ea(0x234));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xdf);[a31_0x10c381(0x184)]=a31_0x10c381(0x1fd);async[a31_0x10c381(0xa0)](_0x44efa8){const _0x1458f9=a31_0x10c381,{options:_0x12c47a,args:_0x19112d,tdx:_0x1cc753}=_0x44efa8,_0x32ee13=_0x12c47a,_0x42b1c6=_0x19112d[0x0]||_0x12c47a[_0x1458f9(0x113)];if(!_0x42b1c6)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0x1458f9(0x124)+'Options\x20(one\x20required):\x0a'+_0x1458f9(0x144)+'\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'+_0x1458f9(0x269)+_0x1458f9(0xd9)),0x1;if(!_0x32ee13['master']&&!_0x32ee13[_0x1458f9(0xf8)]&&!_0x32ee13['behavior']&&!_0x32ee13[_0x1458f9(0x27f)])return console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0xde))),console[_0x1458f9(0xdd)](_0x1458f9(0x237)),console[_0x1458f9(0xdd)](_0x1458f9(0x19a)),console[_0x1458f9(0xdd)](_0x1458f9(0x109)),console[_0x1458f9(0xdd)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x1458f9(0xdd)](_0x1458f9(0x173)),console[_0x1458f9(0xdd)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x2488fe=resolveYamlFile(_0x42b1c6);if(!existsSync(_0x2488fe))return showFileNotFoundError(_0x2488fe,_0x42b1c6),0x1;_0x32ee13[_0x1458f9(0x20b)]&&(console['error'](_0x1458f9(0x25d)+_0x32ee13[_0x1458f9(0x201)]),console[_0x1458f9(0xdd)](_0x1458f9(0x12e)+_0x2488fe));let _0x32ed80;try{_0x32ed80=readFileSync(_0x2488fe,_0x1458f9(0x20f));}catch(_0x132a19){const _0x4503d0=_0x132a19 instanceof Error?_0x132a19[_0x1458f9(0x14e)]:String(_0x132a19);return console['error'](_0x1458f9(0x1cf)+_0x4503d0),0x1;}let _0x34607a;try{_0x34607a=parseDef(_0x32ed80);}catch(_0x247ff8){const _0x5447e3=_0x247ff8 instanceof Error?_0x247ff8[_0x1458f9(0x14e)]:String(_0x247ff8);return console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0xb0)+_0x5447e3)),0x1;}if(_0x32ee13[_0x1458f9(0xf8)]===!![]||_0x32ee13[_0x1458f9(0xf8)]===''){const _0x2d2c17=_0x34607a['attributes']?.['map'](_0x5501f6=>_0x5501f6['name'])||[];if(_0x2d2c17[_0x1458f9(0x190)]===0x0)console[_0x1458f9(0xdd)](a31_0x343d08['red']('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0x183))),console[_0x1458f9(0xdd)](_0x1458f9(0x217));for(const _0x4d315a of _0x2d2c17){console[_0x1458f9(0xdd)]('\x20\x20'+a31_0x343d08['cyan'](_0x4d315a));}console[_0x1458f9(0xdd)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x42b1c6+'\x20--attribute\x20\x22'+_0x2d2c17[0x0]+'\x22');}return 0x1;}if(_0x32ee13[_0x1458f9(0x239)]===!![]||_0x32ee13[_0x1458f9(0x239)]===''){const _0x3f2e3a=_0x34607a['behaviors']?.['map'](_0x6f6ba7=>_0x6f6ba7[_0x1458f9(0x23b)])||[];if(_0x3f2e3a[_0x1458f9(0x190)]===0x0)console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0x21a)));else{console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x1458f9(0xdd)]('Available\x20behaviors:');for(const _0x5b9b0c of _0x3f2e3a){console[_0x1458f9(0xdd)]('\x20\x20'+a31_0x343d08[_0x1458f9(0x12a)](_0x5b9b0c));}console[_0x1458f9(0xdd)](_0x1458f9(0x12f)+_0x42b1c6+_0x1458f9(0x13b)+_0x3f2e3a[0x0]+'\x22');}return 0x1;}const _0x32468c=createCommandSpinner(a31_0x343d08[_0x1458f9(0x1a7)](_0x1458f9(0x1b8)),{'verbose':_0x32ee13[_0x1458f9(0x20b)]});_0x32468c[_0x1458f9(0x134)]();const _0x32d7c5={'onProgress':_0xd559ca=>{const _0xbb0b11=_0x1458f9;_0x32468c[_0xbb0b11(0xf0)]=formatProgressMessage(_0xd559ca);}};if(_0x32ee13[_0x1458f9(0x77)])_0x32d7c5['master']=!![];if(_0x32ee13['attribute']&&typeof _0x32ee13['attribute']===_0x1458f9(0x6d))_0x32d7c5['attribute']=_0x32ee13[_0x1458f9(0xf8)];if(_0x32ee13[_0x1458f9(0x239)]&&typeof _0x32ee13[_0x1458f9(0x239)]==='string')_0x32d7c5[_0x1458f9(0x239)]=_0x32ee13[_0x1458f9(0x239)];if(_0x32ee13[_0x1458f9(0x27f)])_0x32d7c5[_0x1458f9(0x27f)]=!![];if(_0x32ee13[_0x1458f9(0x1f4)])_0x32d7c5[_0x1458f9(0x1f4)]=_0x32ee13['interval'];let _0x2d3e8c;try{_0x2d3e8c=await _0x1cc753[_0x1458f9(0x209)][_0x1458f9(0x1c2)](_0x32ed80,_0x32d7c5),_0x32468c[_0x1458f9(0xf6)]();}catch(_0x587d24){_0x32468c[_0x1458f9(0xf6)]();throw _0x587d24;}return await this[_0x1458f9(0x7e)](_0x2d3e8c,{'master':_0x32ee13[_0x1458f9(0x77)],'attribute':typeof _0x32ee13[_0x1458f9(0xf8)]==='string'?_0x32ee13['attribute']:undefined,'behavior':typeof _0x32ee13['behavior']==='string'?_0x32ee13[_0x1458f9(0x239)]:undefined,'enriched':_0x32ee13[_0x1458f9(0x27f)]}),_0x2d3e8c[_0x1458f9(0x202)]?0x0:0x1;}async[a31_0x10c381(0x7e)](_0x77abfe,_0x1d111d){const _0x5429ac=a31_0x10c381;console['error']('\x0a'+a31_0x343d08[_0x5429ac(0x10a)](_0x5429ac(0x1c6))+'\x20'+_0x77abfe['name']),console[_0x5429ac(0xdd)]('═'[_0x5429ac(0x1c1)](0x3c));if(_0x1d111d[_0x5429ac(0x77)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x4ce067=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x242))+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x77abfe['master'][_0x5429ac(0x127)]+'.'+_0x77abfe[_0x5429ac(0x77)][_0x5429ac(0x27e)]);await this[_0x5429ac(0x125)](_0x4ce067,_0x77abfe['sampleData']);}else{if(_0x1d111d[_0x5429ac(0xf8)]&&_0x77abfe['sampleData']){const _0x3417c8=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x10c))+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x1d111d[_0x5429ac(0xf8)]);await this[_0x5429ac(0x125)](_0x3417c8,_0x77abfe['sampleData']);}else{if(_0x1d111d[_0x5429ac(0x239)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x2f318d=a31_0x343d08[_0x5429ac(0x1a7)]('Behavior:')+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x1d111d[_0x5429ac(0x239)]);await this['displaySampleData'](_0x2f318d,_0x77abfe[_0x5429ac(0x226)]);}else{if(_0x1d111d[_0x5429ac(0x27f)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x59d38e=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x85))+'\x20'+a31_0x343d08['bold']('Master\x20+\x20Attributes');await this[_0x5429ac(0x125)](_0x59d38e,_0x77abfe['sampleData']);}else!_0x77abfe[_0x5429ac(0x226)]&&console[_0x5429ac(0xdd)](_0x5429ac(0x151));}}}if(_0x77abfe[_0x5429ac(0xc0)][_0x5429ac(0x190)]>0x0){console[_0x5429ac(0xdd)]('─'[_0x5429ac(0x1c1)](0x3c)),console['error']('\x0a'+a31_0x343d08[_0x5429ac(0x11b)](_0x5429ac(0x163)));for(const _0x1d1a69 of _0x77abfe['errors']){console['error']('\x20\x20'+a31_0x343d08[_0x5429ac(0x11b)]('•')+'\x20'+_0x1d1a69);}}}async['displaySampleData'](_0x1899ea,_0x3c7bc6){const _0x3f44e2=a31_0x10c381;if(_0x3c7bc6[_0x3f44e2(0x190)]===0x0){console[_0x3f44e2(0xdd)]('\x0a'+_0x1899ea),console[_0x3f44e2(0xdd)](_0x3f44e2(0x17d));return;}console[_0x3f44e2(0xdd)]('\x0a'+_0x1899ea);const _0x1437b6=Object[_0x3f44e2(0x93)](_0x3c7bc6[0x0])['map'](_0x930ba4=>({'name':_0x930ba4,'type':typeof _0x3c7bc6[0x0][_0x930ba4]===_0x3f44e2(0x1e5)?_0x3f44e2(0x1a6):_0x3f44e2(0x9d)})),_0x835ce4={'queryId':'preview','columns':_0x1437b6,'data':_0x3c7bc6,'stats':{'state':_0x3f44e2(0x1b7),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3c7bc6[_0x3f44e2(0x190)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5add35=formatAsTable(_0x835ce4,_0x3c7bc6[_0x3f44e2(0x190)],!![]);await writeOutput(_0x5add35,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x8a);[a31_0x10c381(0x184)]=a31_0x10c381(0x6b);async[a31_0x10c381(0xa0)](_0x335d89){const _0x4c169f=a31_0x10c381,{options:_0x6e259d,args:_0x51b9b7,tdx:_0x26eff8}=_0x335d89,_0x2447f8=_0x6e259d,_0xe5ca08=_0x51b9b7[0x0]||_0x6e259d[_0x4c169f(0x113)];if(!_0xe5ca08)return showParentSegmentNotSetError(_0x4c169f(0x18e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x2def5b=resolveYamlFile(_0xe5ca08);if(existsSync(_0x2def5b)){_0x2447f8['verbose']&&console[_0x4c169f(0xdd)](_0x4c169f(0xd0)+_0x2def5b);let _0x18ea26;try{_0x18ea26=readFileSync(_0x2def5b,_0x4c169f(0x20f));}catch(_0x270f74){const _0x1e6b59=_0x270f74 instanceof Error?_0x270f74[_0x4c169f(0x14e)]:String(_0x270f74);return console[_0x4c169f(0xdd)]('Error\x20reading\x20file:\x20'+_0x1e6b59),0x1;}const _0x215205=await withSpinner('Analyzing\x20changes...',()=>_0x26eff8[_0x4c169f(0x209)][_0x4c169f(0xce)](_0x18ea26),{'verbose':_0x2447f8['verbose']}),_0x212929=_0x215205[_0x4c169f(0x8b)],{isNew:_0x49c254,name:_0x4c71a4,hasChanges:_0xa209f2,diffFormatted:_0x466939}=_0x212929;if(_0xa209f2){_0x49c254?console[_0x4c169f(0xdd)](_0x4c169f(0xcb)+_0x4c71a4+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x4c71a4+'\x27:');console[_0x4c169f(0xdd)]('─'[_0x4c169f(0x1c1)](0x3c)),console[_0x4c169f(0xdd)](_0x466939),console[_0x4c169f(0xdd)]('─'[_0x4c169f(0x1c1)](0x3c));const _0x1d108e=_0x49c254?'Create\x20parent\x20segment\x20\x27'+_0x4c71a4+'\x27\x20and\x20run\x20workflow?':_0x4c169f(0xb7)+_0x4c71a4+_0x4c169f(0xee);if(!_0x2447f8['yes']){if(!isInteractive())return console['error'](a31_0x343d08[_0x4c169f(0x11b)]('\x0aError:'),_0x4c169f(0x1b0)),console[_0x4c169f(0xdd)](a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0x182))),0x1;const _0x36c1b4=await confirmKey(_0x1d108e);if(!_0x36c1b4)return console[_0x4c169f(0xdd)](a31_0x343d08[_0x4c169f(0x185)](_0x4c169f(0x1ae))),0x1;}const _0x1de1c5=_0x49c254?_0x4c169f(0x147):_0x4c169f(0x1a4);await withSpinner(_0x1de1c5+_0x4c169f(0x199)+_0x4c71a4+_0x4c169f(0x169),()=>_0x212929['apply'](),{'verbose':_0x2447f8[_0x4c169f(0x20b)]});const _0x270001=_0x49c254?_0x4c169f(0x21e):'Updated';console[_0x4c169f(0xdd)]('✔\x20'+_0x270001+_0x4c169f(0x199)+_0x4c71a4+'\x27');}else console[_0x4c169f(0xdd)](_0x4c169f(0x1e6)+_0x4c71a4+_0x4c169f(0xb8));}const _0xdfb9d0=await withSpinner(_0x4c169f(0x257)+_0xe5ca08+_0x4c169f(0x169),()=>_0x26eff8[_0x4c169f(0x209)][_0x4c169f(0x1d4)](_0xe5ca08),{'verbose':_0x2447f8[_0x4c169f(0x20b)]}),_0x199606=_0xdfb9d0['data'],_0x341710=getConsoleUrl(_0x2447f8['site'],_0x4c169f(0x179)+_0x199606[_0x4c169f(0xf2)]+_0x4c169f(0x10f)+_0x199606[_0x4c169f(0x172)]+_0x4c169f(0x22a)+_0x199606[_0x4c169f(0x271)]);return console[_0x4c169f(0xdd)]('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0xec))+'\x20'+_0x199606[_0x4c169f(0x75)]),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0x171))+'\x20'+_0x199606[_0x4c169f(0xab)]),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08['dim'](_0x4c169f(0xd2))+'\x20'+_0x199606['workflowSessionId']),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0xa8))+'\x20'+_0x199606[_0x4c169f(0x271)]),console[_0x4c169f(0xdd)]('\x20\x20'+_0x341710),console[_0x4c169f(0xdd)]('\x0a'+a31_0x343d08['dim']('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x199606[_0x4c169f(0x271)]+_0x4c169f(0xcc)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x1ba);[a31_0x10c381(0x184)]=a31_0x10c381(0x105);async[a31_0x10c381(0xa0)](_0x52e1ff){const _0x2a8514=a31_0x10c381,{options:_0x30f9e3,args:_0x5e3599,tdx:_0x52078f}=_0x52e1ff,_0x221fe7=_0x5e3599[0x0]||_0x30f9e3['parentSegment'];if(!_0x221fe7)return showParentSegmentNotSetError(_0x2a8514(0x200)+_0x2a8514(0xbb)),0x1;_0x30f9e3[_0x2a8514(0x20b)]&&(console[_0x2a8514(0xdd)](_0x2a8514(0x25d)+_0x30f9e3[_0x2a8514(0x201)]),console[_0x2a8514(0xdd)](_0x2a8514(0x224)+_0x221fe7));const _0x2429e0=await withSpinner(_0x2a8514(0xa6)+_0x221fe7+_0x2a8514(0x169),()=>_0x52078f[_0x2a8514(0x209)][_0x2a8514(0x9e)](_0x221fe7),{'verbose':_0x30f9e3[_0x2a8514(0x20b)]}),_0x596ded=_0x2429e0[_0x2a8514(0x8b)];console['error'](_0x2a8514(0x227)+_0x596ded[_0x2a8514(0x190)]+_0x2a8514(0x264)+(_0x596ded[_0x2a8514(0x190)]!==0x1?'s':''));if(_0x30f9e3[_0x2a8514(0x22f)]||_0x30f9e3[_0x2a8514(0xd1)])return await handleSDKOutput(_0x596ded,_0x30f9e3),0x0;return displayFieldsHumanReadable(_0x596ded,_0x221fe7),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a31_0x10c381(0x1d7);[a31_0x10c381(0x184)]=a31_0x10c381(0x270);async['execute'](_0x353f90){const _0x318124=a31_0x10c381,{options:_0x2bc0b0,args:_0x4aeacb,tdx:_0x480c32}=_0x353f90,_0x37defb=_0x2bc0b0,_0x8fea50=_0x4aeacb[0x0]||_0x2bc0b0[_0x318124(0x113)];if(!_0x8fea50)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'+_0x318124(0x278)+'Options:\x0a'+_0x318124(0x20c)),0x1;_0x2bc0b0['verbose']&&(console['error'](_0x318124(0x25d)+_0x2bc0b0[_0x318124(0x201)]),console[_0x318124(0xdd)](_0x318124(0x224)+_0x8fea50));const _0x4aed97=await withSpinner(_0x318124(0xa9)+_0x8fea50+'\x27...',()=>_0x480c32[_0x318124(0x209)]['getParentFull'](_0x8fea50),{'verbose':_0x2bc0b0['verbose']}),_0x2ef3b9=_0x4aed97[_0x318124(0x8b)];if(_0x37defb[_0x318124(0xa4)]){const _0x2f2274=getConsoleNextUrl(_0x37defb[_0x318124(0x201)],_0x318124(0x13d)+_0x2ef3b9['id']);return console['error'](a31_0x343d08[_0x318124(0x97)]('✔')+_0x318124(0x1fb)+a31_0x343d08[_0x318124(0x12a)](_0x2f2274)),openBrowser(_0x2f2274),0x0;}return await handleSingleObjectOutput(_0x2ef3b9,_0x2bc0b0),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']='segment:parent:desc';[a31_0x10c381(0x184)]=a31_0x10c381(0x26c);async[a31_0x10c381(0xa0)](_0x4c4d50){const _0x23b122=a31_0x10c381,{options:_0x93b121,args:_0x4098ea,tdx:_0x1ecf2e}=_0x4c4d50,_0x428f7d=_0x93b121,_0x428147=_0x4098ea[0x0]||_0x93b121[_0x23b122(0x113)];if(!_0x428147)return showParentSegmentNotSetError(_0x23b122(0xd6)+_0x23b122(0x238)+'Options:\x0a'+_0x23b122(0x247)),0x1;_0x93b121[_0x23b122(0x20b)]&&(console[_0x23b122(0xdd)](_0x23b122(0x25d)+_0x93b121[_0x23b122(0x201)]),console[_0x23b122(0xdd)](_0x23b122(0x224)+_0x428147));const _0x591c0a=await withSpinner(_0x23b122(0x252)+_0x428147+_0x23b122(0x169),()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x13a)](_0x428147),{'verbose':_0x93b121[_0x23b122(0x20b)]}),_0x3620f3=_0x591c0a[_0x23b122(0x8b)],_0x1e3b9c=_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x268)](_0x3620f3);if(_0x428f7d[_0x23b122(0x1f5)]){const _0x1b65b0=await this[_0x23b122(0x157)](_0x4c4d50,_0x428147,_0x3620f3,_0x1e3b9c),_0x529d39=this[_0x23b122(0x8f)](_0x1b65b0);writeFileSync(_0x428f7d[_0x23b122(0x1f5)],_0x529d39);const _0x13fdec=_0x1b65b0[_0x23b122(0x141)]['columns']['length']+_0x1b65b0[_0x23b122(0x70)]['reduce']((_0x43a1f6,_0x4fd031)=>_0x43a1f6+_0x4fd031[_0x23b122(0x1e1)][_0x23b122(0x190)],0x0),_0x362f41=_0x1b65b0[_0x23b122(0x70)][_0x23b122(0xe0)](_0x26c352=>_0x26c352[_0x23b122(0x1e1)][_0x23b122(0x190)]===0x0)['length'];return console[_0x23b122(0x1db)](_0x23b122(0xf7)+_0x428f7d[_0x23b122(0x1f5)]),console[_0x23b122(0x1db)](_0x23b122(0x10b)+_0x1e3b9c),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x1b65b0[_0x23b122(0x70)][_0x23b122(0x190)]+_0x23b122(0x21f)),console[_0x23b122(0x1db)](_0x23b122(0xc6)+_0x13fdec+'\x20total'),_0x362f41>0x0&&console[_0x23b122(0x1db)](_0x23b122(0x14b)+_0x362f41+_0x23b122(0x228)),0x0;}console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)]('Output\x20Database:')+'\x20'+a31_0x343d08[_0x23b122(0x12a)](_0x1e3b9c));const _0x32b90c=await withSpinner(_0x23b122(0x23c),()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x1c4)](_0x3620f3),{'verbose':_0x93b121[_0x23b122(0x20b)]});console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)]('customers')+'\x20'+a31_0x343d08[_0x23b122(0x1a7)]('('+_0x1e3b9c+_0x23b122(0x87)));const _0x4ebcb7=await executeSchemaQuery(_0x32b90c[_0x23b122(0x8b)],_0x1ecf2e,_0x93b121);await handleQueryOutput(_0x4ebcb7,_0x93b121);const _0x303d29=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x24e)](_0x3620f3),{'verbose':_0x93b121[_0x23b122(0x20b)]});for(const _0x3e9c41 of _0x303d29[_0x23b122(0x8b)]){const _0x425d64='behavior_'+_0x3e9c41[_0x23b122(0x198)]()['replace'](/\s+/g,'_'),_0x27e650=_0x23b122(0x272)+_0x1e3b9c+'.'+_0x425d64;console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)](_0x3e9c41)+'\x20'+a31_0x343d08[_0x23b122(0x1a7)]('('+_0x1e3b9c+'.'+_0x425d64+')'));try{const _0x5f2453=await executeSchemaQuery(_0x27e650,_0x1ecf2e,_0x93b121);await handleQueryOutput(_0x5f2453,_0x93b121);}catch{console['error'](a31_0x343d08['yellow'](_0x23b122(0x19d)));}}return 0x0;}async[a31_0x10c381(0x157)](_0x4a80ab,_0xec355c,_0x402939,_0x50efad){const _0x222dc3=a31_0x10c381,{options:_0x35209c,tdx:_0x4add41}=_0x4a80ab,_0x499e5d=await withSpinner(_0x222dc3(0x23c),()=>_0x4add41[_0x222dc3(0x209)][_0x222dc3(0x1c4)](_0x402939),{'verbose':_0x35209c[_0x222dc3(0x20b)]}),_0xc67c56=await executeSchemaQuery(_0x499e5d[_0x222dc3(0x8b)],_0x4add41,_0x35209c),_0x28c57d=_0xc67c56[_0x222dc3(0x8b)][_0x222dc3(0xe9)](_0x295c8f=>({'name':_0x295c8f['column_name'],'type':_0x295c8f['column_type']})),_0x2b1700=await withSpinner(_0x222dc3(0x129),()=>_0x4add41[_0x222dc3(0x209)][_0x222dc3(0x24e)](_0x402939),{'verbose':_0x35209c['verbose']}),_0x2ee692=[];for(const _0x4d0b95 of _0x2b1700[_0x222dc3(0x8b)]){const _0x328d2f=_0x222dc3(0x1d2)+_0x4d0b95[_0x222dc3(0x198)]()[_0x222dc3(0x15f)](/\s+/g,'_'),_0x3714e9='SELECT\x20*\x20FROM\x20'+_0x50efad+'.'+_0x328d2f;let _0x1d4dc6=[];try{const _0x3f2955=await executeSchemaQuery(_0x3714e9,_0x4add41,_0x35209c);_0x1d4dc6=_0x3f2955[_0x222dc3(0x8b)][_0x222dc3(0xe9)](_0x231c0a=>({'name':_0x231c0a[_0x222dc3(0x20e)],'type':_0x231c0a[_0x222dc3(0x1f2)]}));}catch{}_0x2ee692[_0x222dc3(0x188)]({'table':_0x328d2f,'columns':_0x1d4dc6});}return{'database':_0x50efad,'parent_segment':_0xec355c,'parent_id':_0x402939,'customers':{'table':_0x222dc3(0x141),'columns':_0x28c57d},'behaviors':_0x2ee692};}['formatSchemaJson'](_0x4f71b3){const _0x557e6a=a31_0x10c381,_0x2e920e=_0x53a27c=>{const _0x3b63db=a31_0xc607;if(_0x53a27c[_0x3b63db(0x190)]===0x0)return'[]';const _0x5c9f07=_0x53a27c[_0x3b63db(0xe9)](_0x3529e0=>_0x3b63db(0x143)+_0x3529e0[_0x3b63db(0x23b)]+_0x3b63db(0x13f)+_0x3529e0['type']+_0x3b63db(0x1be));return'[\x0a'+_0x5c9f07['join'](',\x0a')+_0x3b63db(0x221);},_0x52d359=_0x4f71b3[_0x557e6a(0x70)][_0x557e6a(0xe9)](_0x20e1b3=>{const _0x402508=_0x557e6a;return _0x402508(0x1bb)+_0x20e1b3[_0x402508(0x27e)]+_0x402508(0x165)+_0x2e920e(_0x20e1b3['columns'])['replace'](/^/gm,'\x20\x20')[_0x402508(0x107)]()+'\x0a\x20\x20\x20\x20}';})[_0x557e6a(0xa1)](',\x0a');return _0x557e6a(0x259)+_0x4f71b3[_0x557e6a(0x127)]+_0x557e6a(0x24f)+_0x4f71b3[_0x557e6a(0x27d)]+_0x557e6a(0x232)+_0x4f71b3[_0x557e6a(0x84)]+_0x557e6a(0x26d)+_0x4f71b3[_0x557e6a(0x141)][_0x557e6a(0x27e)]+_0x557e6a(0xd3)+_0x2e920e(_0x4f71b3[_0x557e6a(0x141)]['columns'])[_0x557e6a(0x15f)](/^/gm,'\x20\x20')['trim']()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x52d359+_0x557e6a(0x17e);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x10e);[a31_0x10c381(0x184)]=a31_0x10c381(0x25b);async['execute'](_0x3118b8){const _0xc511a5=a31_0x10c381,{options:_0xbd78e8,args:_0x358d30,tdx:_0x104cfe}=_0x3118b8,_0x53a9de=_0x358d30[0x0]||_0xbd78e8[_0xc511a5(0x113)];if(!_0x53a9de)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'+_0xc511a5(0x21b)),0x1;_0xbd78e8[_0xc511a5(0x20b)]&&(console[_0xc511a5(0xdd)](_0xc511a5(0x25d)+_0xbd78e8[_0xc511a5(0x201)]),console['error'](_0xc511a5(0x224)+_0x53a9de));const _0x35c3c7=await withSpinner(_0xc511a5(0x252)+_0x53a9de+_0xc511a5(0x169),()=>_0x104cfe[_0xc511a5(0x209)]['resolveParentId'](_0x53a9de),{'verbose':_0xbd78e8[_0xc511a5(0x20b)]}),_0x3d1be8=_0x35c3c7[_0xc511a5(0x8b)],_0x52306f=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x53a9de+_0xc511a5(0x169),()=>_0x104cfe[_0xc511a5(0x209)][_0xc511a5(0x1c4)](_0x3d1be8),{'verbose':_0xbd78e8[_0xc511a5(0x20b)]}),_0x1d4e19=_0x52306f[_0xc511a5(0x8b)];return _0xbd78e8['format']===_0xc511a5(0x22f)||_0xbd78e8[_0xc511a5(0x6f)]===_0xc511a5(0xd1)?await handleSDKOutput([{'sql':_0x1d4e19}],_0xbd78e8):console[_0xc511a5(0x1db)](_0x1d4e19),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a31_0x10c381(0x1ed);[a31_0x10c381(0x184)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x10c381(0xa0)](_0x44cbb5){const _0x4d97b6=a31_0x10c381,{options:_0x536f51,args:_0x56e795,tdx:_0x41d497}=_0x44cbb5,_0x42bda3=_0x56e795[0x0]||_0x536f51[_0x4d97b6(0x113)];if(!_0x42bda3)return showParentSegmentNotSetError(_0x4d97b6(0x1ad)+'\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;_0x536f51[_0x4d97b6(0x20b)]&&(console[_0x4d97b6(0xdd)](_0x4d97b6(0x25d)+_0x536f51[_0x4d97b6(0x201)]),console[_0x4d97b6(0xdd)]('Parent\x20segment:\x20'+_0x42bda3));const _0x124ce2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x42bda3+_0x4d97b6(0x169),()=>_0x41d497[_0x4d97b6(0x209)][_0x4d97b6(0x13a)](_0x42bda3),{'verbose':_0x536f51[_0x4d97b6(0x20b)]}),_0x48ca78=_0x124ce2[_0x4d97b6(0x8b)],_0x5b15a1=await withSpinner(_0x4d97b6(0x116)+_0x42bda3+_0x4d97b6(0x169),()=>_0x41d497[_0x4d97b6(0x209)][_0x4d97b6(0x1c4)](_0x48ca78),{'verbose':_0x536f51[_0x4d97b6(0x20b)]});let _0x406b20=_0x5b15a1[_0x4d97b6(0x8b)];const _0x1828e7=resolveLimit(_0x536f51[_0x4d97b6(0x244)],DEFAULT_DISPLAY_LIMIT),_0x35390c=/\bLIMIT\s+\d+/i[_0x4d97b6(0x1f7)](_0x406b20);!_0x35390c&&(_0x406b20=_0x406b20[_0x4d97b6(0x107)]()[_0x4d97b6(0x15f)](/;+$/,''),_0x406b20=_0x4d97b6(0xd7)+_0x406b20+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x1828e7);_0x536f51[_0x4d97b6(0x20b)]&&console[_0x4d97b6(0xdd)](_0x4d97b6(0x230)+_0x406b20);const _0x236f44=await withProgressSpinner(_0x4d97b6(0x106),async _0x311afb=>{const _0x5e00a6=_0x4d97b6,_0x3d2a8a=await _0x41d497[_0x5e00a6(0x27c)][_0x5e00a6(0xa0)](_0x406b20,{'catalog':'td','schema':'information_schema','onJobId':_0x513ec8=>{const _0x250ed1=_0x5e00a6;_0x311afb[_0x250ed1(0x6e)](_0x513ec8);}});return _0x3d2a8a;},{'verbose':_0x536f51[_0x4d97b6(0x20b)]}),_0xaf7573=_0x236f44[_0x4d97b6(0x8b)],_0x5cbb8e=_0xaf7573[_0x4d97b6(0x197)]?_0x4d97b6(0x1a9)+_0xaf7573['jobId']+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0xaf7573[_0x4d97b6(0x22b)][_0x4d97b6(0xe2)][_0x4d97b6(0x18f)]()+_0x4d97b6(0xa2)+(_0x4d97b6(0xb9)+formatElapsed(_0xaf7573[_0x4d97b6(0x22b)]['elapsedTimeMillis'])+_0x5cbb8e)),await handleQueryOutput(_0xaf7573,_0x536f51),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:rt:list';[a31_0x10c381(0x184)]=a31_0x10c381(0x243);async['execute'](_0x33ffef){const _0x158950=a31_0x10c381,{options:_0x5b8526,args:_0x581243,tdx:_0x4dabc1}=_0x33ffef,_0x443136=_0x581243[0x0],_0x1e0121=await withSpinner(_0x443136?_0x158950(0x223)+_0x443136+'\x27...':_0x158950(0xc1),()=>_0x4dabc1[_0x158950(0x193)][_0x158950(0xb1)](),{'verbose':_0x5b8526[_0x158950(0x20b)]});let _0x364e25=_0x1e0121[_0x158950(0x8b)][_0x158950(0xe0)](_0xb93c79=>_0xb93c79['realtime_enabled']);if(_0x443136){const _0x2a8322=_0x443136[_0x158950(0x15f)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3633a0=new RegExp('^'+_0x2a8322+'$','i');_0x364e25=_0x364e25['filter'](_0x2da970=>_0x3633a0['test'](_0x2da970[_0x158950(0x23b)]));}_0x364e25[_0x158950(0x1c3)]((_0x4c7553,_0x1d2d7c)=>_0x4c7553[_0x158950(0x23b)][_0x158950(0x19e)](_0x1d2d7c['name'])),console['error'](_0x158950(0x227)+_0x364e25[_0x158950(0x190)]+_0x158950(0x258)+(_0x364e25['length']!==0x1?'s':''));const _0x2d10b6=_0x56441b=>{const _0x297ebd=_0x158950;return getConsoleNextUrl(_0x5b8526[_0x297ebd(0x201)],_0x297ebd(0x13d)+_0x56441b);};if(_0x5b8526['format']===_0x158950(0x22f)||_0x5b8526[_0x158950(0x6f)]===_0x158950(0xd1)){const _0x5e6cac=_0x364e25[_0x158950(0xe9)](_0x50d8d7=>({..._0x50d8d7,'url':_0x2d10b6(_0x50d8d7['id'])}));await handleSDKOutput(_0x5e6cac,_0x5b8526);}else{if(_0x364e25[_0x158950(0x190)]===0x0)console[_0x158950(0x1db)](_0x158950(0x1f9));else for(const _0x595944 of _0x364e25){const _0x40ad02=_0x595944[_0x158950(0x19b)]?a31_0x343d08[_0x158950(0x1a7)]('\x20('+formatRows(_0x595944['population'])+')'):'',_0x38dc73=hyperlink(_0x595944[_0x158950(0x23b)],_0x2d10b6(_0x595944['id']));console[_0x158950(0x1db)]('⚡\x20'+_0x38dc73+_0x40ad02);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x10c381(0x76);[a31_0x10c381(0x184)]=a31_0x10c381(0x1cb);async[a31_0x10c381(0xa0)](_0x5565bf){const _0xc48a0a=a31_0x10c381,{options:_0x2181ec,args:_0x21f5c9,tdx:_0x4b618e}=_0x5565bf,_0x3e0c25=_0x21f5c9[0x0]||_0x2181ec[_0xc48a0a(0x113)];if(!_0x3e0c25)return showParentSegmentNotSetError(_0xc48a0a(0x24c)+_0xc48a0a(0x27a)),0x1;const _0x353b51=resolveYamlFile(_0x3e0c25);if(!existsSync(_0x353b51))return showFileNotFoundError(_0x353b51,_0x3e0c25),0x1;let _0x21c479;try{_0x21c479=readFileSync(_0x353b51,_0xc48a0a(0x20f));}catch(_0x1a9d2c){const _0x364746=_0x1a9d2c instanceof Error?_0x1a9d2c['message']:String(_0x1a9d2c);return console[_0xc48a0a(0xdd)](_0xc48a0a(0x1cf)+_0x364746),0x1;}const _0x1740c4=createCommandSpinner(a31_0x343d08[_0xc48a0a(0x1a7)](_0xc48a0a(0x1bf)),{'verbose':_0x2181ec[_0xc48a0a(0x20b)]});_0x1740c4[_0xc48a0a(0x134)]();const _0x4f729a={'realtime':!![],'onProgress':_0xd5f8f8=>{_0x1740c4['text']=formatProgressMessage(_0xd5f8f8);}};let _0x3ee981;try{_0x3ee981=await _0x4b618e['segment'][_0xc48a0a(0x13e)](_0x21c479,_0x4f729a),_0x1740c4['stop']();}catch(_0x4df603){_0x1740c4[_0xc48a0a(0xf6)]();throw _0x4df603;}console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x10a)](_0xc48a0a(0x26a))+'\x20'+_0x3ee981[_0xc48a0a(0x23b)]),console[_0xc48a0a(0xdd)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x3ee981),console[_0xc48a0a(0xdd)]('─'[_0xc48a0a(0x1c1)](0x3c));if(_0x3ee981['errors']['length']>0x0){console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x11b)](_0xc48a0a(0x163)));for(const _0x1f8311 of _0x3ee981[_0xc48a0a(0xc0)]){console['error']('\x20\x20'+a31_0x343d08['red']('•')+'\x20'+_0x1f8311);}}return _0x3ee981['allValid']&&console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x97)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x3ee981[_0xc48a0a(0x202)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x7c);[a31_0x10c381(0x184)]=a31_0x10c381(0xda);async[a31_0x10c381(0xa0)](_0x432e06){const _0x58c637=a31_0x10c381,{options:_0x33bd60,args:_0x572f0d,tdx:_0x2a358b}=_0x432e06,_0x445b63=_0x572f0d[0x0]||_0x33bd60['parentSegment'];if(!_0x445b63)return showParentSegmentNotSetError(_0x58c637(0x89)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment'),0x1;_0x33bd60[_0x58c637(0x20b)]&&(console[_0x58c637(0xdd)](_0x58c637(0x25d)+_0x33bd60[_0x58c637(0x201)]),console[_0x58c637(0xdd)](_0x58c637(0x224)+_0x445b63));const _0x4f6b67=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x445b63+'\x27...',()=>_0x2a358b[_0x58c637(0x209)][_0x58c637(0x13a)](_0x445b63),{'verbose':_0x33bd60[_0x58c637(0x20b)]}),_0x24d465=_0x4f6b67[_0x58c637(0x8b)],_0x83cb45=await withSpinner(_0x58c637(0xc4)+_0x445b63+_0x58c637(0x169),()=>_0x2a358b[_0x58c637(0x193)][_0x58c637(0x162)](_0x24d465),{'verbose':_0x33bd60[_0x58c637(0x20b)]}),_0x51da20=_0x83cb45[_0x58c637(0x8b)];console[_0x58c637(0xdd)](_0x58c637(0x227)+_0x51da20[_0x58c637(0x190)]+_0x58c637(0x1f8)+(_0x51da20[_0x58c637(0x190)]!==0x1?'s':''));if(_0x33bd60[_0x58c637(0x6f)]===_0x58c637(0x22f)||_0x33bd60[_0x58c637(0x6f)]===_0x58c637(0xd1))await handleSDKOutput(_0x51da20,_0x33bd60);else{if(_0x51da20['length']===0x0)console['log'](_0x58c637(0xfe));else for(const _0x41470b of _0x51da20){const _0x1ecc40=_0x41470b[_0x58c637(0xe8)]===_0x58c637(0x1b3)?'🚀':'📝',_0x280854=_0x41470b[_0x58c637(0xae)]?a31_0x343d08[_0x58c637(0x185)]('\x20(paused)'):'',_0xd10e03=a31_0x343d08[_0x58c637(0x1a7)]('\x20('+_0x41470b[_0x58c637(0xb6)]+_0x58c637(0x246)+(_0x41470b[_0x58c637(0xb6)]!==0x1?'s':'')+')');console[_0x58c637(0x1db)](_0x1ecc40+'\x20'+_0x41470b['name']+_0x280854+_0xd10e03);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:rt:jn:pause';[a31_0x10c381(0x184)]='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x10c381(0xa0)](_0x3ab82c){const _0x362d14=a31_0x10c381,{options:_0x473d74,args:_0x335bee,tdx:_0x76df46}=_0x3ab82c,_0x49487c=_0x335bee[0x0];if(!_0x49487c)return console['error'](a31_0x343d08[_0x362d14(0x11b)](_0x362d14(0x1a3))),console[_0x362d14(0xdd)](_0x362d14(0x260)),console[_0x362d14(0xdd)](a31_0x343d08['dim'](_0x362d14(0x79))),0x1;_0x473d74[_0x362d14(0x20b)]&&(console[_0x362d14(0xdd)]('Site:\x20'+_0x473d74['site']),console[_0x362d14(0xdd)]('RT\x20Journey\x20ID:\x20'+_0x49487c));const _0x11c724=await withSpinner(_0x362d14(0xe7)+_0x49487c+_0x362d14(0x169),()=>_0x76df46[_0x362d14(0x193)][_0x362d14(0xe1)](_0x49487c),{'verbose':_0x473d74[_0x362d14(0x20b)]}),_0x52cf94=_0x11c724['data'];console[_0x362d14(0xdd)](_0x362d14(0x16a)+_0x52cf94[_0x362d14(0x23b)]+'\x27');if(_0x473d74[_0x362d14(0x6f)]===_0x362d14(0x22f)||_0x473d74[_0x362d14(0x6f)]==='jsonl')await handleSDKOutput([_0x52cf94],_0x473d74);else{const _0x165614=_0x52cf94['state']===_0x362d14(0x1b3)?'🚀':'📝',_0x3a885e=_0x52cf94[_0x362d14(0xae)]?a31_0x343d08[_0x362d14(0x185)](_0x362d14(0xe6)):'';console['log'](_0x165614+'\x20'+_0x52cf94['name']+_0x3a885e);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']=a31_0x10c381(0xeb);[a31_0x10c381(0x184)]=a31_0x10c381(0xf1);async['execute'](_0x5ced64){const _0x27b149=a31_0x10c381,{options:_0x41695e,args:_0x3a85b9,tdx:_0x3043b9}=_0x5ced64,_0x19b4b8=_0x3a85b9[0x0];if(!_0x19b4b8)return console[_0x27b149(0xdd)](a31_0x343d08[_0x27b149(0x11b)](_0x27b149(0x1a3))),console[_0x27b149(0xdd)](_0x27b149(0x149)),console[_0x27b149(0xdd)](a31_0x343d08[_0x27b149(0x1a7)](_0x27b149(0x79))),0x1;_0x41695e[_0x27b149(0x20b)]&&(console[_0x27b149(0xdd)](_0x27b149(0x25d)+_0x41695e[_0x27b149(0x201)]),console['error'](_0x27b149(0x11e)+_0x19b4b8));const _0x2252f7=await withSpinner(_0x27b149(0x203)+_0x19b4b8+_0x27b149(0x169),()=>_0x3043b9[_0x27b149(0x193)][_0x27b149(0x117)](_0x19b4b8),{'verbose':_0x41695e[_0x27b149(0x20b)]}),_0x358c47=_0x2252f7[_0x27b149(0x8b)];console['error'](_0x27b149(0x175)+_0x358c47[_0x27b149(0x23b)]+'\x27');if(_0x41695e[_0x27b149(0x6f)]===_0x27b149(0x22f)||_0x41695e[_0x27b149(0x6f)]===_0x27b149(0xd1))await handleSDKOutput([_0x358c47],_0x41695e);else{const _0x6d485b=_0x358c47[_0x27b149(0xe8)]===_0x27b149(0x1b3)?'🚀':'📝',_0x3cd1fc=_0x358c47[_0x27b149(0xae)]?a31_0x343d08[_0x27b149(0x185)](_0x27b149(0xe6)):'';console[_0x27b149(0x1db)](_0x6d485b+'\x20'+_0x358c47['name']+_0x3cd1fc);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x205);[a31_0x10c381(0x184)]=a31_0x10c381(0xcf);async['execute'](_0xb83c57){const _0x4a7668=a31_0x10c381,{options:_0x44fc36,args:_0x25c781,tdx:_0x1276af}=_0xb83c57,_0x5b83d6=_0x25c781[0x0]||_0x44fc36[_0x4a7668(0x113)];if(!_0x5b83d6)return showParentSegmentNotSetError(_0x4a7668(0x12c)+_0x4a7668(0x7a)),0x1;_0x44fc36['verbose']&&(console[_0x4a7668(0xdd)](_0x4a7668(0x25d)+_0x44fc36[_0x4a7668(0x201)]),console[_0x4a7668(0xdd)](_0x4a7668(0x224)+_0x5b83d6));const _0x18efef=await withSpinner(_0x4a7668(0x252)+_0x5b83d6+'\x27...',()=>_0x1276af['segment'][_0x4a7668(0x13a)](_0x5b83d6),{'verbose':_0x44fc36[_0x4a7668(0x20b)]}),_0x2b464c=_0x18efef[_0x4a7668(0x8b)],_0x3f0844=await withSpinner(_0x4a7668(0x26f)+_0x5b83d6+_0x4a7668(0x169),()=>_0x1276af[_0x4a7668(0x193)][_0x4a7668(0x1da)](_0x2b464c),{'verbose':_0x44fc36['verbose']}),_0x26dbc3=_0x3f0844['data'];return console[_0x4a7668(0xdd)](_0x4a7668(0x1fe)),_0x44fc36['format']===_0x4a7668(0x22f)||_0x44fc36[_0x4a7668(0x6f)]===_0x4a7668(0xd1)?await handleSDKOutput([_0x26dbc3],_0x44fc36):(console[_0x4a7668(0x1db)](_0x4a7668(0x1cd)+_0x26dbc3['id']),console['log'](_0x4a7668(0xb2)+_0x26dbc3[_0x4a7668(0x75)]),console[_0x4a7668(0x1db)](_0x4a7668(0x1f0)+_0x26dbc3['identifier']),console[_0x4a7668(0x1db)]('eventKind:\x20'+_0x26dbc3['eventKind']),console[_0x4a7668(0x1db)](_0x4a7668(0x1ef)+_0x26dbc3['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:service:list';[a31_0x10c381(0x184)]=a31_0x10c381(0x1e0);async[a31_0x10c381(0xa0)](_0x25e872){const _0x374070=a31_0x10c381,{options:_0x35257d,args:_0x14afc8,tdx:_0x1156da}=_0x25e872,_0x1acec3=_0x14afc8[0x0]||_0x35257d[_0x374070(0x113)];if(!_0x1acec3)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'+_0x374070(0xc5)),0x1;const _0x4c9903=await withSpinner(_0x374070(0x252)+_0x1acec3+_0x374070(0x169),()=>_0x1156da[_0x374070(0x209)]['resolveParentId'](_0x1acec3),{'verbose':_0x35257d[_0x374070(0x20b)]}),_0x5dea0f=_0x4c9903['data'],_0x32442c=await withSpinner(_0x374070(0x196)+_0x1acec3+_0x374070(0x169),()=>_0x1156da[_0x374070(0x18b)][_0x374070(0xb1)](_0x5dea0f),{'verbose':_0x35257d['verbose']}),_0x1b38ce=_0x32442c[_0x374070(0x8b)];console['error'](_0x374070(0x227)+_0x1b38ce[_0x374070(0x190)]+_0x374070(0x25c)+(_0x1b38ce['length']!==0x1?'s':''));if(_0x35257d[_0x374070(0x6f)]===_0x374070(0x22f)||_0x35257d[_0x374070(0x6f)]===_0x374070(0xd1))await handleSDKOutput(_0x1b38ce,_0x35257d);else{if(_0x1b38ce[_0x374070(0x190)]===0x0)console[_0x374070(0x1db)](_0x374070(0x1d6)),console[_0x374070(0xdd)](a31_0x343d08[_0x374070(0x12a)](_0x374070(0x16b)));else for(const _0x120aaa of _0x1b38ce){console[_0x374070(0x1db)](a31_0x343d08[_0x374070(0x10a)](_0x120aaa['name'])+'\x20'+a31_0x343d08[_0x374070(0x1a7)]('(id:\x20'+_0x120aaa['id']+')'));_0x120aaa['description']&&console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08[_0x374070(0x1a7)](_0x120aaa[_0x374070(0x184)]));if(_0x120aaa[_0x374070(0x1d3)]&&_0x120aaa[_0x374070(0x1d3)]['length']>0x0)for(const _0x55b96d of _0x120aaa['tokens']){const _0x23f8f2=_0x55b96d['allowedIps']?.[_0x374070(0x190)]?_0x55b96d[_0x374070(0x81)][_0x374070(0xa1)](',\x20'):'any';console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x374070(0x152))+'\x20'+_0x55b96d[_0x374070(0x23b)]+'\x20'+a31_0x343d08[_0x374070(0x1a7)]('(id:\x20'+_0x55b96d['id']+')')),console[_0x374070(0x1db)](_0x374070(0x263)+a31_0x343d08[_0x374070(0x1a7)](_0x374070(0x24a))+'\x20'+_0x23f8f2);}else console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08[_0x374070(0x1a7)](_0x374070(0x119)));}}return 0x0;}}function a31_0x1457(){const _0x3dd339=['updatedAt','Error\x20parsing\x20YAML:\x20','list','audienceId:\x20','run','xdg-open','stitchingKeys','stageCount','Apply\x20changes\x20to\x20\x27','\x27\x20is\x20up\x20to\x20date','in\x20','Error:\x20Token\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','⚡\x20Not\x20enabled','column','ps:pz:create','/\x20directory.\x0a','errors','Listing\x20RT-enabled\x20parent\x20segments...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','✔\x20Deleted\x20token\x20\x27','Listing\x20RT\x20journeys\x20for\x20\x27','\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','\x20\x20Columns:\x20','ps:pz:delete','displaySummary','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','\x20parent\x20segment','\x0aNew\x20parent\x20segment\x20\x27','\x20kill','Updated','pushParentYaml','Get\x20current\x20RT\x20configuration\x20version\x20status','Found\x20YAML\x20file:\x20','jsonl','Session:','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','segment:parent:validate','Columns:','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','SELECT\x20*\x20FROM\x20(\x0a','platform','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','List\x20RT\x20journeys','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','events','error','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','segment:parent:preview','filter','pauseJourney','processedRows','Customers:','delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20(paused)','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','state','map','👥\x20','ps:rt:jn:resume','Audience\x20ID:','\x20Context\x20set:\x20','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','text','Resume\x20activations\x20in\x20an\x20RT\x20journey','workflowId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','displayValidateResults','stop','Schema\x20saved\x20to\x20','attribute','Join:','\x0aChanges\x20to\x20apply\x20to\x20\x27','Error:\x20--database\x20and\x20--table\x20are\x20required','Show\x20personalization\x20service\x20details','\x0aError:','No\x20RT\x20journeys\x20found','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','personalizationServices','customerGroup','public:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','List\x20available\x20fields\x20for\x20segmentation','Executing\x20parent\x20segment\x20query...','trim','Master\x20Table','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','bold','\x20\x20Database:\x20','Attribute:','user_id','segment:parent:sql','/sessions/','6442mWSPbu','matchedCount','ps:pz:service:token:create','parentSegment','displayColumns','Validate:','Fetching\x20SQL\x20for\x20\x27','resumeJourney','createPersonalization','no\x20tokens\x20configured','Delete\x20a\x20realtime\x20personalization','red','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Table:\x20','RT\x20Journey\x20ID:\x20','true','107zAegoZ','schemaValid','Update\x20a\x20realtime\x20personalization\x20entity','Deleting\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','displaySampleData','createToken','database','keyEventCriteria','Fetching\x20behavior\x20list...','cyan','Attributes','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','4529959uBijYq','YAML\x20file:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','yes','addBehaviorsFile','isDirectory','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','start','\x20configured','Create\x20parent\x20segment\x20\x27','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','rowCount','resolveParentId','\x20--behavior\x20\x22','Listing\x20parent\x20segments\x20matching\x20\x27','/app/dw/parentSegments/','validateParentYaml','\x22,\x20\x22type\x22:\x20\x22','create','customers','\x0a⚠️\x20\x20Both\x20','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Error:\x20Service\x20name\x20is\x20required','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Creating','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','entryCriteria:','\x20\x20Note:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','joinKey','message','coveragePercent','Personalization\x20service\x20description','\x0aNo\x20sample\x20data\x20available','token:','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','relationships','idStitching','folder-segment','collectSchema','audienceId:','pullParentYaml','tdx\x20ps\x20push\x20','createdAt','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','personalization_services','Deleting\x20personalization\x20service\x20\x27','replace','Events:','✔\x20Updated\x20personalization\x20service\x20\x27','listJourneys','Errors:','deletePersonalization','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','deleteToken','\x27...','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','displayPreviewHints','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','\x27\x20for\x20service\x20\x27','Rows:','Attributes:','Status:','workflowSessionId','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','customerPercent','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','keyEventId','scheduleType','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','/app/workflows/','No\x20parent\x20segments\x20match\x20pattern:\x20','patch','parent_segments','\x20\x20No\x20sample\x20data\x20available','\x0a\x20\x20]\x0a}\x0a','✔\x20Deleted\x20personalization\x20service\x20\x27','addAttributesFile','Listing\x20personalizations\x20for\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20--attribute\x20requires\x20a\x20name\x0a','description','yellow','Finding\x20service\x20for\x20token...','displayRealtimeInfo','push','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','\x20service','personalization','darwin','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','toLocaleString','length','enabled','payload','realtime','✔\x20Created\x20parent\x20segment\x20\x27','null','Listing\x20personalization\x20services\x20for\x20\x27','jobId','toLowerCase','\x20parent\x20segment\x20\x27','Options:','population','Error:\x20Service\x20ID\x20is\x20required','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','localeCompare','/\x20→\x20','\x20\x201.\x20Edit\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Options:\x0a','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Updating','/\x20and\x20','double','dim','(id:\x20','\x20[Job\x20ID:\x20','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x20\x20\x20\x20-\x20','ps:pz:list','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Aborted.','keyEventId:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','10VjCAer','\x0aChanges\x20to\x20\x27','launched','Creating\x20personalization\x20\x27','Error:\x20Token\x20name\x20is\x20required','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','FINISHED','Fetching\x20sample\x20data...','My\x20Service','segment:parent:fields','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Output\x20file:\x20','\x20to\x20push\x20the\x20configuration','\x22\x20}','Validating\x20RT\x20configuration...','✔\x20Created\x20personalization\x20\x27','repeat','previewParentYaml','sort','getParentSQL','displayMasterInfo','Preview:','listParents','Error:\x20Personalization\x20ID\x20is\x20required','8UHBXwg','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','✔\x20Found\x20personalization\x20\x27','id:\x20','\x27\x20is\x20already\x20up\x20to\x20date','Error\x20reading\x20file:\x20','\x20Added\x20RT\x202.0\x20template\x20section','.yml','behavior_','tokens','runParent','No\x20parent\x20segments\x20found','No\x20personalization\x20services\x20configured','segment:parent:view','parentFolder','sections','getCurrentConfigVersion','log','✔\x20Created\x20personalization\x20service\x20\x27','sourceTableError','toFixed','page_view','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','columns','value','payload:','last_page_viewed','number','✔\x20No\x20changes\x20-\x20\x27','Delete\x20a\x20personalization\x20service','all','listPersonalizations','1343111BulZIi','displayBehaviorsStats','Updating\x20parent\x20segment\x20\x27','segment:parent:show','Creating\x20token\x20\x27','status:\x20','identifier:\x20','sourceTableValid','column_type','\x5c$&','interval','output','To\x20view\x20sample\x20data:','test','\x20RT\x20journey','No\x20RT-enabled\x20parent\x20segments\x20found','endsWith','\x20Opening\x20','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','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','✔\x20Retrieved\x20RT\x20configuration\x20version','Analyzing\x20changes...','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','site','allValid','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','indexOf','ps:rt:configuration_versions','-1d','78gjeVpX','\x20\x20\x20\x20\x20\x20\x20\x20','segment','foreignKey','verbose','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','updated:','column_name','utf-8','ps:pz:service:create','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20=\x20','displayAttributesStats','timezone','ps:pz:service:update','Validating\x20configuration...','Available\x20attributes:','segment:parent:update','patchPersonalization','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','get','match','Created','\x20behaviors','Pattern:\x20','\x0a\x20\x20\x20\x20]','/\x20directories\x20exist.','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','sampleData','✔\x20Found\x20','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','includeSensitive:','/attempt/','stats','Join\x20on:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20--behavior\x20\x22<name>\x22','json','SQL\x20query:\x0a','\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','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','\x20true','\x20Configuration\x20is\x20valid','\x20\x20\x20\x20\x20\x20','\x20to\x20configure\x20your\x20personalization\x20service','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','behavior','ID\x20Stitching:','name','Fetching\x20customers\x20schema...','label','✘\x20Failed\x20to\x20rename\x20directory:\x20','single','Fetching\x20current\x20configuration\x20for\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Master:','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','limit','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20stage','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','win32','allowed\x20IPs:','Next\x20steps:','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','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','getBehaviorNames','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Listing\x20parent\x20segments...','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Resolving\x20parent\x20segment\x20\x27','Create\x20a\x20realtime\x20personalization\x20entity','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','created:','unref','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20RT-enabled\x20parent\x20segment','{\x0a\x20\x20\x22database\x22:\x20\x22','3451383ewOKpk','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20personalization\x20service','Site:\x20','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','22481508EuAjvb','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','RT\x202.0:','<database>.<table>','\x20\x20\x20\x20','\x20field','\x20\x202.\x20Run\x20','customersWithEvents','Creating\x20personalization\x20service\x20\x27','getOutputDatabaseName','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','RT\x202.0\x20Validate:','\x20--attribute\x20\x22','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','3iiHuSw','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Show\x20parent\x20segment\x20details','workflowAttemptId','SELECT\x20*\x20FROM\x20','td_client_id','\x27\x20with\x20ID:\x20','ps:pz:service:delete','ps:pz:patch','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','tdx\x20ps\x20preview\x20','\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','scheduleOption','query','parent_segment','table','enriched','totalEvents','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','string','setJobId','format','behaviors','attributesFile','segment:parent:create','createParent','Show\x20a\x20specific\x20realtime\x20personalization','audienceId','ps:rt:validate','master','\x20rows)','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\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','public','ps:rt:jn:list','165265McJbhv','displayPreviewResults','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','schemaError','allowedIps','entryCriteria','type','parent_id','Enriched:','Creating\x20parent\x20segment\x20\x27','.customers)','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','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','segment:parent:run','data','\x20--interval\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','1568836Cajerd','formatSchemaJson','\x20No\x20changes\x20-\x20','No\x20personalizations\x20configured','folderId','keys','✔\x20Deleted\x20personalization\x20\x27','using\x20the\x20default\x20path:\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','green','file','Error:\x20Parent\x20segment\x20name\x20is\x20required','apply','Database:\x20','\x20service(s)\x20configured','varchar','listFields','includeSensitive','execute','join','\x20rows\x20','Source:','web','Behaviors','Listing\x20fields\x20for\x20\x27','\x27\x20(id:\x20','Attempt:','Fetching\x20parent\x20segment\x20\x27','Error:','status','Personalization:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','paused'];a31_0x1457=function(){return _0x3dd339;};return a31_0x1457();}export class PSPzServiceCreateCommand extends BaseCommand{['name']=a31_0x10c381(0x210);['description']='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async['execute'](_0x14c081){const _0x50740a=a31_0x10c381,{options:_0x25b9a2,args:_0x2b8d4c,tdx:_0x248438}=_0x14c081,_0x2e0016=_0x25b9a2,_0x4f04ca=_0x2b8d4c[0x0],_0x1c0273=_0x2b8d4c[0x1]||_0x25b9a2[_0x50740a(0x113)];if(!_0x4f04ca)return console[_0x50740a(0xdd)](_0x50740a(0x145)),console[_0x50740a(0xdd)](_0x50740a(0x153)),console[_0x50740a(0xdd)](_0x50740a(0x1a1)),0x1;if(!_0x1c0273)return showParentSegmentNotSetError(_0x50740a(0x8d)+_0x50740a(0x1a1)),0x1;const _0x834737=await withSpinner(_0x50740a(0x252)+_0x1c0273+_0x50740a(0x169),()=>_0x248438['segment'][_0x50740a(0x13a)](_0x1c0273),{'verbose':_0x25b9a2[_0x50740a(0x20b)]}),_0x2528e1=_0x834737['data'],_0xbd2b17={'name':_0x4f04ca,'description':_0x2e0016[_0x50740a(0x184)],'public':_0x2e0016[_0x50740a(0x7b)]},_0x3ede30=await withSpinner(_0x50740a(0x267)+_0x4f04ca+'\x27...',()=>_0x248438[_0x50740a(0x18b)][_0x50740a(0x140)](_0x2528e1,_0xbd2b17),{'verbose':_0x25b9a2[_0x50740a(0x20b)]}),_0x183b9=_0x3ede30['data'];return console[_0x50740a(0xdd)](_0x50740a(0x1dc)+_0x183b9[_0x50740a(0x23b)]+_0x50740a(0x274)+_0x183b9['id']),await handleSDKOutput([_0x183b9],_0x25b9a2),0x0;}}function a31_0xc607(_0x154e97,_0x58a7cd){_0x154e97=_0x154e97-0x6a;const _0x1457f4=a31_0x1457();let _0xc60793=_0x1457f4[_0x154e97];return _0xc60793;}export class PSPzServiceShowCommand extends BaseCommand{['name']='ps:pz:service:show';[a31_0x10c381(0x184)]=a31_0x10c381(0xfc);async[a31_0x10c381(0xa0)](_0x21841b){const _0x396ddf=a31_0x10c381,{options:_0x4c5839,args:_0x4e73e0,tdx:_0x461618}=_0x21841b,_0x10fc73=_0x4e73e0[0x0],_0x526076=_0x4e73e0[0x1]||_0x4c5839[_0x396ddf(0x113)];if(!_0x10fc73)return console['error'](_0x396ddf(0x19c)),console[_0x396ddf(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x396ddf(0xdd)](_0x396ddf(0x16d)),0x1;if(!_0x526076)return showParentSegmentNotSetError(_0x396ddf(0x148)+_0x396ddf(0x16d)),0x1;const _0x2c6342=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x526076+_0x396ddf(0x169),()=>_0x461618[_0x396ddf(0x209)]['resolveParentId'](_0x526076),{'verbose':_0x4c5839[_0x396ddf(0x20b)]}),_0x5c0d24=_0x2c6342[_0x396ddf(0x8b)],_0x38f889=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x10fc73+_0x396ddf(0x169),()=>_0x461618[_0x396ddf(0x18b)][_0x396ddf(0x21c)](_0x5c0d24,_0x10fc73),{'verbose':_0x4c5839[_0x396ddf(0x20b)]}),_0xbc807f=_0x38f889[_0x396ddf(0x8b)];if(_0x4c5839['json']||_0x4c5839[_0x396ddf(0xd1)])await handleSDKOutput([_0xbc807f],_0x4c5839);else{console['log'](a31_0x343d08[_0x396ddf(0x10a)](_0xbc807f['name'])+'\x20'+a31_0x343d08[_0x396ddf(0x1a7)]('(id:\x20'+_0xbc807f['id']+')'));_0xbc807f[_0x396ddf(0x184)]&&console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08['dim'](_0xbc807f[_0x396ddf(0x184)]));console['log']('\x20\x20'+a31_0x343d08[_0x396ddf(0x12a)](_0x396ddf(0x103))+'\x20'+(_0xbc807f[_0x396ddf(0x7b)]?'yes':'no'));if(_0xbc807f[_0x396ddf(0x1d3)]&&_0xbc807f[_0x396ddf(0x1d3)][_0x396ddf(0x190)]>0x0)for(const _0x16a9de of _0xbc807f[_0x396ddf(0x1d3)]){const _0x85249=_0x16a9de[_0x396ddf(0x81)]?.[_0x396ddf(0x190)]?_0x16a9de['allowedIps'][_0x396ddf(0xa1)](',\x20'):'any';console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x396ddf(0x152))+'\x20'+_0x16a9de[_0x396ddf(0x23b)]+'\x20'+a31_0x343d08['dim'](_0x396ddf(0x1a8)+_0x16a9de['id']+')')),console[_0x396ddf(0x1db)]('\x20\x20\x20\x20'+a31_0x343d08[_0x396ddf(0x1a7)](_0x396ddf(0x24a))+'\x20'+_0x85249);}else console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08[_0x396ddf(0x1a7)]('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x275);['description']=a31_0x10c381(0x1e7);async[a31_0x10c381(0xa0)](_0x354435){const _0x440070=a31_0x10c381,{options:_0x5b74cc,args:_0x13f7c4,tdx:_0x1076b2}=_0x354435,_0x1f074f=_0x13f7c4[0x0],_0x20388d=_0x13f7c4[0x1]||_0x5b74cc[_0x440070(0x113)];if(!_0x1f074f)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console[_0x440070(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x440070(0xdd)](_0x440070(0xc2)),0x1;if(!_0x20388d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x440070(0xc2)),0x1;const _0x5bbd9c=await withSpinner(_0x440070(0x252)+_0x20388d+_0x440070(0x169),()=>_0x1076b2[_0x440070(0x209)][_0x440070(0x13a)](_0x20388d),{'verbose':_0x5b74cc[_0x440070(0x20b)]}),_0x2fd140=_0x5bbd9c[_0x440070(0x8b)];return await withSpinner(_0x440070(0x15e)+_0x1f074f+_0x440070(0x169),()=>_0x1076b2['personalization'][_0x440070(0xe4)](_0x2fd140,_0x1f074f),{'verbose':_0x5b74cc[_0x440070(0x20b)]}),console['error'](_0x440070(0x17f)+_0x1f074f+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x215);[a31_0x10c381(0x184)]='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x10c381(0xa0)](_0xf6cb19){const _0x5c2229=a31_0x10c381,{options:_0x48c980,args:_0x15a269,tdx:_0x17eb26}=_0xf6cb19,_0x30e9b7=_0x48c980,_0x235fbd=_0x15a269[0x0],_0x2076fb=_0x15a269[0x1]||_0x48c980[_0x5c2229(0x113)];if(!_0x235fbd)return console['error'](_0x5c2229(0x19c)),console[_0x5c2229(0xdd)](_0x5c2229(0xff)),console[_0x5c2229(0xdd)](_0x5c2229(0xf3)),0x1;if(!_0x30e9b7[_0x5c2229(0x23b)])return console[_0x5c2229(0xdd)]('Error:\x20--name\x20is\x20required'),console[_0x5c2229(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x2076fb)return showParentSegmentNotSetError(_0x5c2229(0x248)+_0x5c2229(0xf3)),0x1;const _0x67486=await withSpinner(_0x5c2229(0x252)+_0x2076fb+_0x5c2229(0x169),()=>_0x17eb26[_0x5c2229(0x209)][_0x5c2229(0x13a)](_0x2076fb),{'verbose':_0x48c980[_0x5c2229(0x20b)]}),_0x2e7e0b=_0x67486[_0x5c2229(0x8b)],_0x4cb217={'name':_0x30e9b7[_0x5c2229(0x23b)]};_0x30e9b7[_0x5c2229(0x184)]!==undefined&&(_0x4cb217[_0x5c2229(0x184)]=_0x30e9b7[_0x5c2229(0x184)]);const _0x50f6ce=await withSpinner('Updating\x20personalization\x20service\x20\x27'+_0x235fbd+_0x5c2229(0x169),()=>_0x17eb26[_0x5c2229(0x18b)][_0x5c2229(0x17b)](_0x2e7e0b,_0x235fbd,_0x4cb217),{'verbose':_0x48c980[_0x5c2229(0x20b)]}),_0x2b41f3=_0x50f6ce[_0x5c2229(0x8b)];return console['error'](_0x5c2229(0x161)+_0x2b41f3[_0x5c2229(0x23b)]+'\x27'),await handleSDKOutput([_0x2b41f3],_0x48c980),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x112);[a31_0x10c381(0x184)]=a31_0x10c381(0x88);async[a31_0x10c381(0xa0)](_0x3fa6a9){const _0x5c52a6=a31_0x10c381,{options:_0x458d91,args:_0x2559af,tdx:_0x2a3b3d}=_0x3fa6a9,_0x3a2569=_0x458d91,_0x39b27f=_0x2559af[0x0],_0x421fa4=_0x2559af[0x1],_0xf77ff6=_0x2559af[0x2]||_0x458d91[_0x5c52a6(0x113)];if(!_0x39b27f)return console[_0x5c52a6(0xdd)](_0x5c52a6(0x1b5)),console[_0x5c52a6(0xdd)](_0x5c52a6(0x11c)),console[_0x5c52a6(0xdd)](_0x5c52a6(0x138)),0x1;if(!_0x421fa4)return console[_0x5c52a6(0xdd)](_0x5c52a6(0x19c)),console[_0x5c52a6(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x5c52a6(0xdd)](_0x5c52a6(0x138)),0x1;if(!_0xf77ff6)return showParentSegmentNotSetError(_0x5c52a6(0xad)+_0x5c52a6(0x138)),0x1;const _0x5dc7e0=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf77ff6+_0x5c52a6(0x169),()=>_0x2a3b3d[_0x5c52a6(0x209)][_0x5c52a6(0x13a)](_0xf77ff6),{'verbose':_0x458d91[_0x5c52a6(0x20b)]}),_0x483253=_0x5dc7e0[_0x5c52a6(0x8b)],_0x52c4d8={'name':_0x39b27f};_0x3a2569[_0x5c52a6(0x81)]&&(_0x52c4d8['allowedIps']=_0x3a2569[_0x5c52a6(0x81)]['split'](',')['map'](_0xcded64=>_0xcded64['trim']()));_0x3a2569[_0x5c52a6(0x184)]&&(_0x52c4d8[_0x5c52a6(0x184)]=_0x3a2569['description']);const _0x1e2753=await withSpinner(_0x5c52a6(0x1ee)+_0x39b27f+_0x5c52a6(0x16e)+_0x421fa4+_0x5c52a6(0x169),()=>_0x2a3b3d[_0x5c52a6(0x18b)][_0x5c52a6(0x126)](_0x483253,_0x421fa4,_0x52c4d8),{'verbose':_0x458d91[_0x5c52a6(0x20b)]}),_0x255302=_0x1e2753['data'];return console[_0x5c52a6(0xdd)]('✔\x20Created\x20token\x20\x27'+_0x255302['name']+_0x5c52a6(0x274)+_0x255302['id']),_0x255302[_0x5c52a6(0x1e2)]&&(console[_0x5c52a6(0xdd)](a31_0x343d08[_0x5c52a6(0x185)](_0x5c52a6(0x25e))),console['error'](a31_0x343d08['cyan'](_0x255302[_0x5c52a6(0x1e2)])),console[_0x5c52a6(0xdd)]('')),await handleSDKOutput([_0x255302],_0x458d91),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:service:token:delete';[a31_0x10c381(0x184)]='Delete\x20a\x20token\x20from\x20a\x20personalization\x20service';async['execute'](_0x4a4c2f){const _0x23c5a3=a31_0x10c381,{options:_0x12981c,args:_0x176bbb,tdx:_0x45abcd}=_0x4a4c2f,_0x3a97d6=_0x176bbb[0x0],_0x513424=_0x176bbb[0x1]||_0x12981c['parentSegment'];if(!_0x3a97d6)return console['error']('Error:\x20Token\x20ID\x20is\x20required'),console[_0x23c5a3(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console['error'](_0x23c5a3(0xc9)),0x1;if(!_0x513424)return showParentSegmentNotSetError(_0x23c5a3(0x146)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x500b6a=await withSpinner(_0x23c5a3(0x252)+_0x513424+'\x27...',()=>_0x45abcd[_0x23c5a3(0x209)][_0x23c5a3(0x13a)](_0x513424),{'verbose':_0x12981c[_0x23c5a3(0x20b)]}),_0x15c95e=_0x500b6a[_0x23c5a3(0x8b)],_0x40b617=await withSpinner(_0x23c5a3(0x186),()=>_0x45abcd[_0x23c5a3(0x18b)]['list'](_0x15c95e),{'verbose':_0x12981c['verbose']}),_0x5df558=_0x40b617['data'];let _0x335be0;for(const _0x2df0ca of _0x5df558){if(_0x2df0ca[_0x23c5a3(0x1d3)]?.['some'](_0x5e9f0a=>_0x5e9f0a['id']===_0x3a97d6)){_0x335be0=_0x2df0ca['id'];break;}}if(!_0x335be0)return console[_0x23c5a3(0xdd)](_0x23c5a3(0xba)+_0x3a97d6+'\x27\x20not\x20found\x20in\x20any\x20personalization\x20service'),0x1;const _0x243520=await withSpinner('Deleting\x20token\x20\x27'+_0x3a97d6+'\x27...',()=>_0x45abcd[_0x23c5a3(0x18b)][_0x23c5a3(0x168)](_0x15c95e,_0x335be0,_0x3a97d6),{'verbose':_0x12981c[_0x23c5a3(0x20b)]}),_0x4d351d=_0x243520[_0x23c5a3(0x8b)];return console[_0x23c5a3(0xdd)](_0x23c5a3(0xc3)+(_0x4d351d['name']||_0x3a97d6)+'\x27'),await handleSDKOutput([_0x4d351d],_0x12981c),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x1ac);[a31_0x10c381(0x184)]=a31_0x10c381(0x189);async[a31_0x10c381(0xa0)](_0x509e7f){const _0x376243=a31_0x10c381,{options:_0x41704e,args:_0x5006d4,tdx:_0x3f7360}=_0x509e7f,_0x2075d6=_0x5006d4[0x0]||_0x41704e[_0x376243(0x113)];if(!_0x2075d6)return showParentSegmentNotSetError(_0x376243(0x1fc)+_0x376243(0x231)),0x1;const _0x54b4a9=await withSpinner(_0x376243(0x252)+_0x2075d6+'\x27...',()=>_0x3f7360[_0x376243(0x209)][_0x376243(0x13a)](_0x2075d6),{'verbose':_0x41704e[_0x376243(0x20b)]}),_0x3a75bc=_0x54b4a9[_0x376243(0x8b)],_0x2a638d=await withSpinner(_0x376243(0x181)+_0x2075d6+_0x376243(0x169),()=>_0x3f7360[_0x376243(0x18b)][_0x376243(0x1e9)](_0x3a75bc),{'verbose':_0x41704e['verbose']}),_0x3a49ea=_0x2a638d['data'];console[_0x376243(0xdd)](_0x376243(0x227)+_0x3a49ea[_0x376243(0x190)]+'\x20personalization'+(_0x3a49ea['length']!==0x1?'s':''));if(_0x41704e[_0x376243(0x6f)]===_0x376243(0x22f)||_0x41704e['format']===_0x376243(0xd1))await handleSDKOutput(_0x3a49ea,_0x41704e);else{if(_0x3a49ea[_0x376243(0x190)]===0x0)console[_0x376243(0x1db)](_0x376243(0x91));else for(const _0x2236db of _0x3a49ea){console[_0x376243(0x1db)](a31_0x343d08[_0x376243(0x10a)](_0x2236db['name'])+'\x20'+a31_0x343d08[_0x376243(0x1a7)](_0x376243(0x1a8)+_0x2236db['id']+')'));_0x2236db[_0x376243(0x184)]&&console[_0x376243(0x1db)]('\x20\x20'+a31_0x343d08[_0x376243(0x1a7)](_0x2236db[_0x376243(0x184)]));const _0x3a817b=_0x2236db[_0x376243(0x1d9)]?.[_0x376243(0x190)]||0x0;console[_0x376243(0x1db)]('\x20\x20'+a31_0x343d08[_0x376243(0x12a)]('sections:')+'\x20'+_0x3a817b);if(_0x2236db[_0x376243(0x1d9)]&&_0x2236db[_0x376243(0x1d9)][_0x376243(0x190)]>0x0)for(const _0x1f738b of _0x2236db['sections']){console['log'](_0x376243(0x1ab)+_0x1f738b[_0x376243(0x23b)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:show';[a31_0x10c381(0x184)]=a31_0x10c381(0x74);async['execute'](_0x27b26e){const _0x39e30a=a31_0x10c381,{options:_0x93446a,args:_0x12a437,tdx:_0x446d51}=_0x27b26e,_0x1f2d63=_0x12a437[0x0];if(!_0x1f2d63)return console[_0x39e30a(0xdd)](_0x39e30a(0x1c8)),console[_0x39e30a(0xdd)](_0x39e30a(0x1ca)),0x1;const _0x18e182=await withSpinner('Getting\x20personalization\x20\x27'+_0x1f2d63+'\x27...',()=>_0x446d51[_0x39e30a(0x18b)]['getPersonalization'](_0x1f2d63),{'verbose':_0x93446a['verbose']}),_0x244a90=_0x18e182[_0x39e30a(0x8b)];console['error'](_0x39e30a(0x1cc)+_0x244a90['name']+'\x27');if(_0x93446a[_0x39e30a(0x6f)]==='json'||_0x93446a[_0x39e30a(0x6f)]===_0x39e30a(0xd1))await handleSDKOutput([_0x244a90],_0x93446a);else{console['log'](a31_0x343d08[_0x39e30a(0x10a)](_0x244a90['name'])+'\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x39e30a(0x1a8)+_0x244a90['id']+')'));_0x244a90[_0x39e30a(0x184)]&&console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x244a90[_0x39e30a(0x184)]));_0x244a90[_0x39e30a(0x75)]&&console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x39e30a(0x158))+'\x20'+_0x244a90[_0x39e30a(0x75)]);console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x255))+'\x20'+_0x244a90[_0x39e30a(0x15b)]),console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x39e30a(0x20d))+'\x20'+_0x244a90[_0x39e30a(0xaf)]);const _0x1ce276=_0x244a90['sections']?.[_0x39e30a(0x190)]||0x0;console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x12a)]('sections:')+'\x20'+_0x1ce276);if(_0x244a90[_0x39e30a(0x1d9)]&&_0x244a90[_0x39e30a(0x1d9)][_0x39e30a(0x190)]>0x0)for(const _0x4160a5 of _0x244a90[_0x39e30a(0x1d9)]){console['log'](_0x39e30a(0x263)+a31_0x343d08[_0x39e30a(0x10a)](_0x4160a5[_0x39e30a(0x23b)])+'\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x39e30a(0x1a8)+_0x4160a5['id']+')')),_0x4160a5[_0x39e30a(0x82)]&&(console[_0x39e30a(0x1db)](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x14a))+'\x20'+_0x4160a5[_0x39e30a(0x82)]['name']),_0x4160a5[_0x39e30a(0x82)][_0x39e30a(0x128)]?.['keyEventId']&&console[_0x39e30a(0x1db)](_0x39e30a(0x208)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x1af))+'\x20'+_0x4160a5[_0x39e30a(0x82)]['keyEventCriteria'][_0x39e30a(0x176)])),_0x4160a5[_0x39e30a(0x192)]&&console['log'](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x1e3))+'\x20'+JSON['stringify'](_0x4160a5['payload'])),_0x4160a5[_0x39e30a(0x9f)]&&console['log'](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x229))+_0x39e30a(0x233));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xc7);[a31_0x10c381(0x184)]=a31_0x10c381(0x11a);async[a31_0x10c381(0xa0)](_0x9c7cff){const _0x34b730=a31_0x10c381,{options:_0x506448,args:_0x2db245,tdx:_0x483722}=_0x9c7cff,_0x26a8ba=_0x2db245[0x0];if(!_0x26a8ba)return console['error'](_0x34b730(0x1c8)),console[_0x34b730(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x34b730(0x123)+_0x26a8ba+_0x34b730(0x169),()=>_0x483722['personalization'][_0x34b730(0x164)](_0x26a8ba),{'verbose':_0x506448[_0x34b730(0x20b)]}),console['error'](_0x34b730(0x94)+_0x26a8ba+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xbe);[a31_0x10c381(0x184)]=a31_0x10c381(0x253);async['execute'](_0x17caa2){const _0x5436e4=a31_0x10c381,{options:_0x5361e6,tdx:_0x2dae15}=_0x17caa2,_0x120035=_0x5361e6;let _0x397555;if(_0x120035[_0x5436e4(0x98)]){_0x397555=await loadJSON(_0x120035[_0x5436e4(0x98)],!![]);if(!_0x397555[_0x5436e4(0x154)]?.[_0x5436e4(0x1d8)])return console[_0x5436e4(0xdd)](_0x5436e4(0x100)),console[_0x5436e4(0xdd)](_0x5436e4(0x133)),console['error']('\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}'),0x1;}else{if(!_0x120035[_0x5436e4(0x23b)])return console[_0x5436e4(0xdd)](_0x5436e4(0x18d)),console[_0x5436e4(0xdd)](_0x5436e4(0xdb)),console[_0x5436e4(0xdd)](_0x5436e4(0xe5)),0x1;if(_0x120035[_0x5436e4(0x184)]===undefined)return console[_0x5436e4(0xdd)](_0x5436e4(0x251)),console[_0x5436e4(0xdd)](_0x5436e4(0xdb)),console[_0x5436e4(0xdd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x120035[_0x5436e4(0x92)]===undefined)return console[_0x5436e4(0xdd)](_0x5436e4(0x1aa)),console[_0x5436e4(0xdd)]('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x40c6cc=_0x120035['audienceId'];if(!_0x40c6cc&&_0x5361e6[_0x5436e4(0x113)]){const _0x58e517=await withSpinner(_0x5436e4(0x252)+_0x5361e6['parentSegment']+'\x27...',()=>_0x2dae15[_0x5436e4(0x209)][_0x5436e4(0x13a)](_0x5361e6[_0x5436e4(0x113)]),{'verbose':_0x5361e6[_0x5436e4(0x20b)]});_0x40c6cc=_0x58e517[_0x5436e4(0x8b)];}let _0x5f424c;_0x120035[_0x5436e4(0x1d9)]&&(_0x5f424c=await loadJSON(_0x120035[_0x5436e4(0x1d9)],![]));const _0x5b88ca=_0x120035[_0x5436e4(0x92)]===_0x5436e4(0x195)?null:{'id':_0x120035[_0x5436e4(0x92)],'type':_0x5436e4(0x156)};_0x397555={'attributes':{'name':_0x120035['name'],'description':_0x120035[_0x5436e4(0x184)]||null,..._0x40c6cc!==undefined&&{'audienceId':_0x40c6cc},..._0x5f424c!==undefined&&{'sections':_0x5f424c}},'relationships':{'parentFolder':{'data':_0x5b88ca}}};}const _0x35f924=await withSpinner(_0x5436e4(0x1b4)+(_0x397555[_0x5436e4(0x166)]?.[_0x5436e4(0x23b)]??'')+'\x27...',()=>_0x2dae15[_0x5436e4(0x18b)][_0x5436e4(0x118)](_0x397555),{'verbose':_0x5361e6['verbose']}),_0x446d43=_0x35f924[_0x5436e4(0x8b)];return console['error'](_0x5436e4(0x1c0)+_0x446d43[_0x5436e4(0x23b)]+'\x27\x20with\x20ID:\x20'+_0x446d43['id']),await handleSDKOutput([_0x446d43],_0x5361e6),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x276);[a31_0x10c381(0x184)]=a31_0x10c381(0x122);async[a31_0x10c381(0xa0)](_0xa946ba){const _0x2be4e3=a31_0x10c381,{options:_0x6054af,args:_0x75a133}=_0xa946ba,_0x5c6f16=_0x6054af,_0x276e92=_0x75a133[0x0];if(!_0x276e92)return console[_0x2be4e3(0xdd)](_0x2be4e3(0x1c8)),console[_0x2be4e3(0xdd)](_0x2be4e3(0x254)),console[_0x2be4e3(0xdd)](_0x2be4e3(0x167)),0x1;let _0x37d924;if(_0x5c6f16[_0x2be4e3(0x98)])_0x37d924=await loadJSON(_0x5c6f16['file'],!![]);else{if(!_0x5c6f16[_0x2be4e3(0x23b)])return console[_0x2be4e3(0xdd)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x2be4e3(0xdd)](_0x2be4e3(0x254)),0x1;if(_0x5c6f16['description']===undefined)return console[_0x2be4e3(0xdd)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0x2be4e3(0x254)),0x1;let _0x3b3da0;_0x5c6f16[_0x2be4e3(0x1d9)]&&(_0x3b3da0=await loadJSON(_0x5c6f16[_0x2be4e3(0x1d9)],![])),_0x37d924={'attributes':{'name':_0x5c6f16[_0x2be4e3(0x23b)],'description':_0x5c6f16[_0x2be4e3(0x184)]||null,..._0x3b3da0!==undefined&&{'sections':_0x3b3da0}}};}const {tdx:_0x222022}=_0xa946ba,_0x5b9e2e=await withSpinner('Patching\x20personalization\x20\x27'+_0x276e92+'\x27...',()=>_0x222022[_0x2be4e3(0x18b)][_0x2be4e3(0x219)](_0x276e92,_0x37d924),{'verbose':_0x6054af[_0x2be4e3(0x20b)]}),_0x16bf5a=_0x5b9e2e[_0x2be4e3(0x8b)];return console[_0x2be4e3(0xdd)]('✔\x20Updated\x20personalization\x20\x27'+_0x16bf5a[_0x2be4e3(0x23b)]+_0x2be4e3(0xa7)+_0x16bf5a['id']+')'),await handleSDKOutput([_0x16bf5a],_0x6054af),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]='ps:pz:init';[a31_0x10c381(0x184)]=a31_0x10c381(0x137);async[a31_0x10c381(0xa0)](_0x564bc0){const _0x570bde=a31_0x10c381,{options:_0x58e73d,args:_0x161f60}=_0x564bc0,_0x164dcf=_0x161f60[0x0]||_0x58e73d[_0x570bde(0x113)];if(!_0x164dcf)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 _0x3a8697=resolveYamlFile(_0x164dcf);if(!existsSync(_0x3a8697))return showFileNotFoundError(_0x3a8697,_0x164dcf),0x1;let _0x4f14f2;try{_0x4f14f2=readFileSync(_0x3a8697,_0x570bde(0x20f));}catch(_0x216638){const _0x4134a5=_0x216638 instanceof Error?_0x216638[_0x570bde(0x14e)]:String(_0x216638);return console[_0x570bde(0xdd)](_0x570bde(0x1cf)+_0x4134a5),0x1;}let _0x935bc7;try{_0x935bc7=parseDef(_0x4f14f2);}catch(_0x503531){const _0x18545c=_0x503531 instanceof Error?_0x503531[_0x570bde(0x14e)]:String(_0x503531);return console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x11b)](_0x570bde(0xb0)+_0x18545c)),0x1;}if(_0x935bc7[_0x570bde(0x15d)]&&_0x935bc7[_0x570bde(0x15d)]['length']>0x0)return console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x185)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0x3a8697)),console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x1a7)]('\x20\x20\x20'+_0x935bc7[_0x570bde(0x15d)][_0x570bde(0x190)]+_0x570bde(0x9c))),0x1;!_0x935bc7[_0x570bde(0x193)]&&(_0x935bc7[_0x570bde(0x193)]={'events':[{'name':_0x570bde(0x1df),'source_table':_0x570bde(0x262)}],'attributes':[{'name':'last_page_viewed','type':_0x570bde(0x23f)}],'id_stitching':{'primary_key':_0x935bc7[_0x570bde(0x77)][_0x570bde(0x27e)]==='customers'?_0x570bde(0x273):_0x570bde(0x10d)}});_0x935bc7[_0x570bde(0x15d)]=[{'name':_0x570bde(0x1b9),'description':_0x570bde(0x150),'trigger_event':_0x570bde(0x1df),'sections':[{'name':'Default','criteria':_0x570bde(0x11f),'attributes':[_0x570bde(0x1e4)]}]}];const _0x38615=serializeDef(_0x935bc7);return writeFileSync(_0x3a8697,_0x38615,'utf-8'),console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x97)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x343d08[_0x570bde(0x12a)](_0x3a8697)),(!_0x935bc7['realtime']||_0x4f14f2[_0x570bde(0x204)]('realtime:')===-0x1)&&console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x97)]('✔')+_0x570bde(0x1d0)),console[_0x570bde(0xdd)]('\x0a'+a31_0x343d08[_0x570bde(0x1a7)](_0x570bde(0x24b))),console[_0x570bde(0xdd)](_0x570bde(0x1a0)+_0x3a8697+_0x570bde(0x236)),console[_0x570bde(0xdd)](_0x570bde(0x265)+a31_0x343d08[_0x570bde(0x1a7)](_0x570bde(0x15a)+_0x164dcf)+_0x570bde(0x1bd)),0x0;}}
1
+ const a31_0x5137f5=a31_0x4566;(function(_0xa1e0f7,_0x523f05){const _0x187f10=a31_0x4566,_0x7a96b5=_0xa1e0f7();while(!![]){try{const _0x24771f=parseInt(_0x187f10(0x2a0))/0x1+-parseInt(_0x187f10(0x257))/0x2+-parseInt(_0x187f10(0x358))/0x3*(-parseInt(_0x187f10(0x378))/0x4)+-parseInt(_0x187f10(0x20c))/0x5*(-parseInt(_0x187f10(0x263))/0x6)+-parseInt(_0x187f10(0x2f2))/0x7*(-parseInt(_0x187f10(0x204))/0x8)+-parseInt(_0x187f10(0x372))/0x9+-parseInt(_0x187f10(0x2b9))/0xa;if(_0x24771f===_0x523f05)break;else _0x7a96b5['push'](_0x7a96b5['shift']());}catch(_0x514ad9){_0x7a96b5['push'](_0x7a96b5['shift']());}}}(a31_0x15e5,0xe23c3));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x15d013 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x54e267 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x5137f5(0x357),LEGACY_PARENT_SEGMENT_DIR=a31_0x5137f5(0x32c);function openBrowser(_0x33b52e){const _0x37e054=a31_0x5137f5,_0x37aa66=process[_0x37e054(0x3b3)],_0x831540=_0x37aa66===_0x37e054(0x26a)?_0x37e054(0x1e2):_0x37aa66===_0x37e054(0x1e0)?_0x37e054(0x23b):'xdg-open';spawn(_0x831540,[_0x33b52e],{'detached':!![],'stdio':_0x37e054(0x250)})[_0x37e054(0x33b)]();}function migrateLegacyDirectory(){const _0x1f4b92=a31_0x5137f5;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x574a51=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x574a51['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x1f4b92(0x344)](a31_0x54e267[_0x1f4b92(0x366)](_0x1f4b92(0x28e)+LEGACY_PARENT_SEGMENT_DIR+_0x1f4b92(0x2e6)+PARENT_SEGMENT_DIR+_0x1f4b92(0x3aa))),console[_0x1f4b92(0x344)](a31_0x54e267['dim'](_0x1f4b92(0x3c1)+LEGACY_PARENT_SEGMENT_DIR+_0x1f4b92(0x1ff))),![];console[_0x1f4b92(0x344)](a31_0x54e267[_0x1f4b92(0x366)](_0x1f4b92(0x2a4)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x1f4b92(0x344)](a31_0x54e267[_0x1f4b92(0x324)](_0x1f4b92(0x37a)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2ef547){const _0x50f0aa=_0x2ef547 instanceof Error?_0x2ef547['message']:String(_0x2ef547);return console[_0x1f4b92(0x344)](a31_0x54e267[_0x1f4b92(0x1f2)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x50f0aa+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x5137f5(0x2ae)](_0x4b0bd0){const _0x3b6d87=a31_0x5137f5;return migrateLegacyDirectory(),super[_0x3b6d87(0x2ae)](_0x4b0bd0);}}function resolveYamlFile(_0xd4d80e){const _0x34dcf8=a31_0x5137f5;if(_0xd4d80e[_0x34dcf8(0x314)](_0x34dcf8(0x210))||_0xd4d80e[_0x34dcf8(0x314)]('.yaml'))return _0xd4d80e;return a31_0x15d013[_0x34dcf8(0x2e7)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xd4d80e)+'.yml');}function formatProgressMessage(_0x4c2323){const _0x2e0366=a31_0x5137f5,_0xe5cc1a=_0x4c2323[_0x2e0366(0x370)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0xe5cc1a){const [,_0x437820,_0x465739,_0x17a21e='']=_0xe5cc1a;return a31_0x54e267[_0x2e0366(0x285)](_0x437820+':')+'\x20'+_0x465739+a31_0x54e267['dim'](_0x17a21e);}return a31_0x54e267[_0x2e0366(0x285)](_0x4c2323);}function showFileNotFoundError(_0xc9ec6c,_0x448109){const _0x336151=a31_0x5137f5;console['error'](a31_0x54e267[_0x336151(0x1f2)](_0x336151(0x30d)+_0xc9ec6c+'\x0a')),console[_0x336151(0x344)](a31_0x54e267['cyan'](_0x336151(0x374)+_0x448109+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x4c262c){const _0x19c829=a31_0x5137f5;if(!_0x4c262c['realtime'])return;const _0x101807=_0x4c262c[_0x19c829(0x1c9)],_0x1e1d5f=_0x101807[_0x19c829(0x33a)]?a31_0x54e267[_0x19c829(0x324)](_0x19c829(0x37d)):a31_0x54e267[_0x19c829(0x366)](_0x19c829(0x384));console[_0x19c829(0x344)]('\x0a'+a31_0x54e267['dim'](_0x19c829(0x389))+'\x20'+_0x1e1d5f);if(_0x101807[_0x19c829(0x391)]&&_0x101807[_0x19c829(0x391)][_0x19c829(0x2bf)]>0x0){console[_0x19c829(0x344)]('\x20\x20'+a31_0x54e267['dim']('Events:')+'\x20'+_0x101807[_0x19c829(0x391)]['length']+'\x20configured');for(const _0x4979a9 of _0x101807[_0x19c829(0x391)]){const _0x4d6c0b=_0x4979a9[_0x19c829(0x2cc)]===![]?a31_0x54e267[_0x19c829(0x1f2)]('✘'):a31_0x54e267['green']('✔');console[_0x19c829(0x344)](_0x19c829(0x2f9)+_0x4d6c0b+'\x20'+_0x4979a9[_0x19c829(0x21d)]),_0x4979a9[_0x19c829(0x3ba)]&&console['error'](_0x19c829(0x2ca)+a31_0x54e267[_0x19c829(0x1f2)](_0x4979a9['sourceTableError']));}}if(_0x101807[_0x19c829(0x1fe)]&&_0x101807[_0x19c829(0x1fe)]['length']>0x0){console[_0x19c829(0x344)]('\x20\x20'+a31_0x54e267[_0x19c829(0x285)](_0x19c829(0x3be))+'\x20'+_0x101807[_0x19c829(0x1fe)][_0x19c829(0x2bf)]+_0x19c829(0x36e));for(const _0x1ad149 of _0x101807[_0x19c829(0x1fe)]){const _0x2ec19f=_0x1ad149[_0x19c829(0x3b1)]?a31_0x54e267[_0x19c829(0x324)]('✔'):a31_0x54e267[_0x19c829(0x1f2)]('✘');console[_0x19c829(0x344)]('\x20\x20\x20\x20'+_0x2ec19f+'\x20'+_0x1ad149[_0x19c829(0x21d)]+'\x20'+a31_0x54e267[_0x19c829(0x285)]('('+_0x1ad149[_0x19c829(0x1bf)]+')'));}}if(_0x101807[_0x19c829(0x271)]){const _0x273677=_0x101807[_0x19c829(0x271)][_0x19c829(0x1d7)]?.[_0x19c829(0x2bf)]?'\x20+\x20['+_0x101807[_0x19c829(0x271)][_0x19c829(0x1d7)][_0x19c829(0x2e7)](',\x20')+']':'';console[_0x19c829(0x344)]('\x20\x20'+a31_0x54e267[_0x19c829(0x285)](_0x19c829(0x296))+'\x20'+_0x101807['idStitching'][_0x19c829(0x287)]+_0x273677);}if(_0x101807[_0x19c829(0x317)]&&_0x101807['personalizationServices'][_0x19c829(0x2bf)]>0x0){console[_0x19c829(0x344)]('\x20\x20'+a31_0x54e267[_0x19c829(0x285)](_0x19c829(0x1cb))+'\x20'+_0x101807[_0x19c829(0x317)]['length']+_0x19c829(0x1f7)+(_0x101807[_0x19c829(0x317)][_0x19c829(0x2bf)]!==0x1?'s':''));for(const _0x5b53d6 of _0x101807[_0x19c829(0x317)]){console[_0x19c829(0x344)]('\x20\x20\x20\x20-\x20'+_0x5b53d6[_0x19c829(0x21d)]);}}}function showParentSegmentNotSetError(_0x3e8e19){const _0x5d4760=a31_0x5137f5;console[_0x5d4760(0x344)](a31_0x54e267[_0x5d4760(0x366)](_0x5d4760(0x20e))),console[_0x5d4760(0x344)](_0x3e8e19);}function a31_0x15e5(){const _0x2e83db=['Running\x20parent\x20segment\x20workflow\x20for\x20\x27','segment:parent:desc','all','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x20\x20Note:\x20','label','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','getOutputDatabaseName','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','Enriched:','Error:\x20Token\x20ID\x20is\x20required','keyEventId:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','dim','Validating\x20configuration...','primaryKey','\x20\x20Tables:\x201\x20customers\x20+\x20','\x20--attribute\x20\x22','description','sections','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','formatSchemaJson','\x0a⚠️\x20\x20Both\x20','status','tokens','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','customerPercent','ID\x20Stitching:','createParent','RT\x20Journey\x20ID:\x20','\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','Fetching\x20parent\x20segment\x20\x27','collectSchema','✔\x20Retrieved\x20RT\x20configuration\x20version','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','joinKey','Deleting\x20personalization\x20service\x20\x27','1181009zGiApK','Show\x20personalization\x20service\x20details','Updating','keys','\x0a⚠️\x20\x20Migrating:\x20','trim','Validating\x20RT\x20configuration...','Resume\x20activations\x20in\x20an\x20RT\x20journey','elapsedTimeMillis','\x27\x20is\x20up\x20to\x20date','SELECT\x20*\x20FROM\x20','Listing\x20parent\x20segments...','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','information_schema','run','List\x20RT\x20journeys','Listing\x20RT\x20journeys\x20for\x20\x27','Source:','Fetching\x20personalization\x20service\x20\x27','varchar','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','column_type','✔\x20Created\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','20896820DGQueo','RT\x202.0\x20Validate:','behavior','customerGroup','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','behavior_','length','No\x20parent\x20segments\x20match\x20pattern:\x20','query','audienceId:\x20','✔\x20Deleted\x20personalization\x20\x27','rowCount','ps:pz:service:delete','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','value','\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20','\x20Added\x20RT\x202.0\x20template\x20section','sourceTableValid','Columns:','entryCriteria','Creating\x20parent\x20segment\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','segment:parent:list','realtime_enabled','Getting\x20personalization\x20\x27','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\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','site','\x20--behavior\x20\x22','listJourneys','stats','\x20behaviors','Analyzing\x20changes...','\x0a✔\x20Workflow\x20started','enriched','user_id','column_name','segment:parent:show','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a','Master:','paused','createToken','/\x20and\x20','join','errors','Attribute:','Options:\x0a','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','No\x20RT\x20journeys\x20found','use','\x0aNo\x20sample\x20data\x20available','Found\x20YAML\x20file:\x20','\x20personalization\x20service','Validate:','217PFoxgU','number','Error:\x20Service\x20ID\x20is\x20required','ps:pz:list','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','launched','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','push','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Error:\x20Service\x20name\x20is\x20required','/app/dw/parentSegments/','\x0a\x20\x20]\x0a}\x0a','ps:pz:service:list','\x20--behavior\x20\x22<name>\x22','Error\x20parsing\x20YAML:\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','YAML\x20file:\x20','message','\x20to\x20push\x20the\x20configuration','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Error:\x20Token\x20\x27','Error:\x20Personalization\x20ID\x20is\x20required','\x27\x20is\x20already\x20up\x20to\x20date','token:','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Error:\x20File\x20not\x20found:\x20','Listing\x20parent\x20segments\x20matching\x20\x27','getParentSQL','audienceId','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Executing\x20parent\x20segment\x20query...','\x0aNew\x20parent\x20segment\x20\x27','endsWith','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','\x22\x20}','personalizationServices','ps:pz:service:show','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','schemaValid','created:','file','No\x20RT-enabled\x20parent\x20segments\x20found','\x27\x20for\x20service\x20\x27','utf-8','✔\x20Found\x20','Status:','log','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','green','displayPreviewHints','sampleData','Resolving\x20parent\x20segment\x20\x27','Attempt:','repeat','Database:\x20','-1d','parent_segment','column','any','Error\x20reading\x20file:\x20','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','displayAttributesStats','/app/workflows/','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','entryCriteria:','map','td_client_id','parentFolder','enabled','unref','updated:','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','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Aborted.','Site:\x20','getPersonalization','\x20true','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','error','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','processedRows','segment','✔\x20Found\x20personalization\x20\x27','Updating\x20parent\x20segment\x20\x27','coveragePercent','getBehaviorNames','displayPreviewResults','\x20\x20\x20','Name:\x20','\x20RT-enabled\x20parent\x20segment','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Coverage:','\x27\x20with\x20ID:\x20','displayMasterInfo','\x20--attribute\x20\x22<name>\x22','\x20Added\x20personalization\x20template\x20to\x20','parent_segments','4867227XuXFGy','last_page_viewed','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','\x20(paused)','patchPersonalization','dirname','To\x20view\x20sample\x20data:','execute','Available\x20attributes:','Options:','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','👥\x20','yellow','Created','\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','Table:\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','database','\x20RT\x20configuration\x20is\x20valid','\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','\x20configured','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','match','get','7887123GRpkmu','reduce','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','replace','To\x20cancel:','4ToEymK','resolveParentId','✔\x20Renamed\x20directory\x20to\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','stringify','⚡\x20Enabled','Deleting\x20personalization\x20\x27','Error:\x20--name\x20is\x20required','jobId','displaySampleData','Listing\x20personalization\x20services\x20for\x20\x27','\x20kill','⚡\x20Not\x20enabled','cyan','Apply\x20changes\x20to\x20\x27','stageCount','session','RT\x202.0:','Audience\x20ID:','stop','segment:parent:preview','Behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','deletePersonalization','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','events','segment:parent:view','.customers)','\x22,\x20\x22type\x22:\x20\x22','Fetching\x20customers\x20schema...','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20service(s)\x20configured','No\x20personalizations\x20configured','verbose','includeSensitive:','(id:\x20','Personalization\x20service\x20description','bold','✔\x20Created\x20personalization\x20service\x20\x27','Updated','displayColumns','Join:','folderId','\x20[Job\x20ID:\x20','\x0aChanges\x20to\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','\x20rows)','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','No\x20parent\x20segments\x20found','/sessions/','/\x20directories\x20exist.','\x20\x20No\x20sample\x20data\x20available','Behavior:','Listing\x20personalizations\x20for\x20\x27','\x0a\x20\x20\x20\x20]','test','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','valid','Options\x20(one\x20required):\x0a','platform','apply','tdx\x20ps\x20push\x20','Show\x20a\x20specific\x20realtime\x20personalization','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','public:','sourceTableError','scheduleOption','relationships','workflowSessionId','Attributes:','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Error:','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Patching\x20personalization\x20\x27','runParent','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Attributes','Error:\x20Parent\x20segment\x20name\x20is\x20required','toFixed','Error:\x20--database\x20and\x20--table\x20are\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','parentSegment','\x20\x20\x20\x20-\x20','data','Delete\x20a\x20personalization\x20service','ps:rt:jn:resume','Delete\x20a\x20realtime\x20personalization','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','Fetching\x20behavior\x20list...','\x20rows\x20','scheduleType','/{name}.yml\x0a','create','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','updateParent','type','allowed\x20IPs:','\x5c$&','interval','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x20--interval\x20','✔\x20Deleted\x20personalization\x20service\x20\x27','✔\x20Updated\x20parent\x20segment\x20\x27','realtime','list','Personalization:','eventKind','ps:rt:jn:list','segment:parent:run','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','tdx\x20ps\x20preview\x20','personalization','addBehaviorsFile','json','delete','personalization_services','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','stitchingKeys','table','ps:pz:init','\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','Create\x20a\x20realtime\x20personalization\x20entity','ps:pz:service:token:delete','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20to\x20configure\x20your\x20personalization\x20service','totalEvents','win32','\x27...','open','output','columns','workflowAttemptId','displayBehaviorsStats','\x27\x20and\x20run\x20workflow?','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20total','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','✔\x20Query\x20completed:\x20Processed\x20','Fetching\x20sample\x20data...','\x20\x20Columns:\x20','Creating\x20personalization\x20\x27','pauseJourney','addAttributes','foreignKey','red','Master\x20Table','Schema\x20saved\x20to\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20service','Join\x20on:','single','sort','Finding\x20service\x20for\x20token...','✔\x20No\x20changes\x20-\x20\x27','\x20parent\x20segment','attributes','/\x20directory.\x0a','pushParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','Parent\x20segment:\x20','66936CfQJJG','Available\x20behaviors:','displayValidateResults','/attempt/','localeCompare','page_view','timezone','\x20personalization','598965UwrZnv','\x20parent\x20segment\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','web','.yml','segment:parent:fields','\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','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','string','Listing\x20fields\x20for\x20\x27','Error:\x20Token\x20name\x20is\x20required','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20field','Show\x20parent\x20segment\x20schema\x20(column\x20types)','ps:pz:service:token:create','id:\x20','Creating','name','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','filter','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','displaySummary','text','<database>.<table>','Rows:','setJobId','schemaError','ps:rt:jn:pause','allowedIps','behaviors','\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}','keyEventId','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','List\x20available\x20fields\x20for\x20segmentation','no\x20tokens\x20configured','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','customers','matchedCount','allValid','getParentFull','customersWithEvents','identifier','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20=\x20','\x20Opening\x20','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','start','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','addAttributesFile','Errors:','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Creating\x20personalization\x20service\x20\x27','\x20\x20Database:\x20','master','pullParentYaml','keyEventCriteria','jsonl','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','ps:rt:list','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','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','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Customers:','Show\x20parent\x20segment\x20details','ps:pz:show','✔\x20Created\x20token\x20\x27','previewParentYaml','ignore','Get\x20current\x20RT\x20configuration\x20version\x20status','attribute','validateParentYaml','population','toLowerCase','No\x20personalization\x20services\x20configured','17316OxIQxn','✔\x20Deleted\x20token\x20\x27','\x0a\x20\x20\x20\x20}','behaviorsFile','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','%)\x20','format','createdAt','getCurrentConfigVersion','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20is\x20already\x20up\x20to\x20date','42cveSzF','customerGroupFile','\x0aError:','listFields','yes','state','\x20\x202.\x20Run\x20','darwin','\x20stage','sections:','\x20RT\x20journey','updatedAt','payload:','Update\x20a\x20realtime\x20personalization\x20entity','idStitching','segment:parent:push','ps:rt:validate','addBehaviors'];a31_0x15e5=function(){return _0x2e83db;};return a31_0x15e5();}export class ParentSegmentListCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x2d1);[a31_0x5137f5(0x28a)]='List\x20parent\x20segments';async[a31_0x5137f5(0x361)](_0xed9203){const _0x23977c=a31_0x5137f5,{options:_0x38ba32,args:_0x23b133,tdx:_0x41b474}=_0xed9203,_0x100add=_0x23b133[0x0];_0x38ba32['verbose']&&(console['error'](_0x23977c(0x340)+_0x38ba32['site']),_0x100add&&console[_0x23977c(0x344)]('Pattern:\x20'+_0x100add));const _0x3fefd4=await withSpinner(_0x100add?_0x23977c(0x30e)+_0x100add+_0x23977c(0x1e1):_0x23977c(0x2ab),()=>_0x41b474[_0x23977c(0x348)]['listParents'](),{'verbose':_0x38ba32[_0x23977c(0x399)]});let _0x2adeea=_0x3fefd4[_0x23977c(0x1b3)];if(_0x100add){const _0x30de99=_0x100add['replace'](/[.+^${}()|[\]\\]/g,_0x23977c(0x1c1))[_0x23977c(0x376)](/\*/g,'.*')[_0x23977c(0x376)](/\?/g,'.'),_0x58956f=new RegExp('^'+_0x30de99+'$','i');_0x2adeea=_0x2adeea[_0x23977c(0x21f)](_0x1dde6d=>_0x58956f['test'](_0x1dde6d[_0x23977c(0x1fe)][_0x23977c(0x21d)]));}_0x2adeea[_0x23977c(0x1fa)]((_0x8de6d9,_0xe0f23)=>_0x8de6d9['attributes']['name']['localeCompare'](_0xe0f23[_0x23977c(0x1fe)]['name'])),console['error']('✔\x20Found\x20'+_0x2adeea[_0x23977c(0x2bf)]+_0x23977c(0x1fd)+(_0x2adeea['length']!==0x1?'s':''));const _0x4b2b36=_0x12c2a6=>{const _0x369dcb=_0x23977c;return getConsoleNextUrl(_0x38ba32[_0x369dcb(0x2d6)],'/app/dw/parentSegments/'+_0x12c2a6);};if(_0x38ba32[_0x23977c(0x25d)]===_0x23977c(0x1d3)||_0x38ba32['format']===_0x23977c(0x245)){const _0x455cd1=_0x2adeea[_0x23977c(0x337)](_0x3bde3d=>({..._0x3bde3d,'url':_0x4b2b36(_0x3bde3d['id'])}));await handleSDKOutput(_0x455cd1,_0x38ba32);}else{if(_0x2adeea[_0x23977c(0x2bf)]===0x0)_0x100add?console[_0x23977c(0x322)](_0x23977c(0x2c0)+_0x100add):console[_0x23977c(0x322)](_0x23977c(0x3a8));else for(const _0x52cd97 of _0x2adeea){const _0x53eaff=_0x52cd97[_0x23977c(0x1fe)][_0x23977c(0x254)]?a31_0x54e267[_0x23977c(0x285)]('\x20('+formatRows(_0x52cd97[_0x23977c(0x1fe)][_0x23977c(0x254)])+')'):'',_0x3d5caa=hyperlink(_0x52cd97['attributes']['name'],_0x4b2b36(_0x52cd97['id']));console[_0x23977c(0x322)](_0x23977c(0x365)+_0x3d5caa+_0x53eaff);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x5137f5(0x21d)]='segment:parent:create';['description']='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a31_0x5137f5(0x361)](_0xcbb3bd){const _0x4b400a=a31_0x5137f5,{options:_0x5550f5,args:_0x4f5961,tdx:_0x38a525}=_0xcbb3bd;console[_0x4b400a(0x344)](_0x4b400a(0x2d0)+_0x4b400a(0x1e8)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x52b481=_0x5550f5;if(_0x4f5961[_0x4b400a(0x2bf)]===0x0)return console[_0x4b400a(0x344)](a31_0x54e267[_0x4b400a(0x1f2)](_0x4b400a(0x3c7))),console[_0x4b400a(0x344)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x1e11ee=_0x4f5961[0x0];if(!_0x52b481['database']||!_0x52b481[_0x4b400a(0x1d8)])return console[_0x4b400a(0x344)](_0x4b400a(0x3c9)),console[_0x4b400a(0x344)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x52b481[_0x4b400a(0x399)]&&(console[_0x4b400a(0x344)](_0x4b400a(0x340)+_0x52b481[_0x4b400a(0x2d6)]),console[_0x4b400a(0x344)](_0x4b400a(0x34f)+_0x1e11ee),console['error'](_0x4b400a(0x32a)+_0x52b481[_0x4b400a(0x36b)]),console[_0x4b400a(0x344)](_0x4b400a(0x369)+_0x52b481['table']));const _0xe09fa0=await loadJSONFromOptions(_0x52b481[_0x4b400a(0x1fe)],_0x52b481['attributesFile']),_0x3a6787=await loadJSONFromOptions(_0x52b481[_0x4b400a(0x22a)],_0x52b481[_0x4b400a(0x25a)]),_0x19a581=await loadJSONFromOptions(_0x52b481[_0x4b400a(0x2bc)],_0x52b481[_0x4b400a(0x264)]),_0x164ea5={'name':_0x1e11ee,'description':_0x52b481[_0x4b400a(0x28a)],'scheduleType':_0x52b481['scheduleType'],'scheduleOption':_0x52b481[_0x4b400a(0x3bb)],'timezone':_0x52b481[_0x4b400a(0x20a)],'master':{'parentDatabaseName':_0x52b481[_0x4b400a(0x36b)],'parentTableName':_0x52b481[_0x4b400a(0x1d8)]},'attributes':_0xe09fa0,'behaviors':_0x3a6787,'customerGroup':_0x19a581},_0xd24ab7=await withSpinner(_0x4b400a(0x2cf)+_0x1e11ee+_0x4b400a(0x1e1),()=>_0x38a525['segment'][_0x4b400a(0x297)](_0x164ea5),{'verbose':_0x5550f5[_0x4b400a(0x399)]}),_0x20b5fb=_0xd24ab7[_0x4b400a(0x1b3)];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0x20b5fb[_0x4b400a(0x21d)]+_0x4b400a(0x353)+_0x20b5fb['id']),await handleSDKOutput([_0x20b5fb],_0x5550f5),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x5137f5(0x21d)]='segment:parent:update';[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x23f);async[a31_0x5137f5(0x361)](_0x598cd6){const _0x1b3913=a31_0x5137f5,{options:_0x3bc687,args:_0x1d4bcc,tdx:_0x49dfc0}=_0x598cd6;console[_0x1b3913(0x344)](_0x1b3913(0x1dd)+_0x1b3913(0x1e8)+_0x1b3913(0x351));const _0x2b544f=_0x3bc687;if(_0x1d4bcc[_0x1b3913(0x2bf)]===0x0)return console[_0x1b3913(0x344)](a31_0x54e267[_0x1b3913(0x1f2)](_0x1b3913(0x3c7))),console[_0x1b3913(0x344)](_0x1b3913(0x396)),0x1;const _0x380ec3=_0x1d4bcc[0x0];_0x2b544f[_0x1b3913(0x399)]&&(console['error']('Site:\x20'+_0x2b544f[_0x1b3913(0x2d6)]),console['error'](_0x1b3913(0x203)+_0x380ec3));const _0x556ffe=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x380ec3+_0x1b3913(0x1e1),()=>_0x49dfc0[_0x1b3913(0x348)][_0x1b3913(0x234)](_0x380ec3),{'verbose':_0x2b544f['verbose']}),_0x1a652a=_0x556ffe['data'],_0x1b0d7b=await loadJSONFromOptions(_0x2b544f[_0x1b3913(0x1f0)],_0x2b544f[_0x1b3913(0x23d)]),_0x4ba44c=await loadJSONFromOptions(_0x2b544f[_0x1b3913(0x274)],_0x2b544f[_0x1b3913(0x1d2)]),_0x142e7f={'name':_0x1a652a[_0x1b3913(0x21d)],'description':_0x2b544f[_0x1b3913(0x28a)]!==undefined?_0x2b544f[_0x1b3913(0x28a)]:_0x1a652a[_0x1b3913(0x28a)],'scheduleType':_0x2b544f[_0x1b3913(0x1ba)]!==undefined?_0x2b544f[_0x1b3913(0x1ba)]:_0x1a652a['scheduleType'],'scheduleOption':_0x2b544f[_0x1b3913(0x3bb)]!==undefined?_0x2b544f[_0x1b3913(0x3bb)]:_0x1a652a[_0x1b3913(0x3bb)],'timezone':_0x2b544f[_0x1b3913(0x20a)]!==undefined?_0x2b544f[_0x1b3913(0x20a)]:_0x1a652a[_0x1b3913(0x20a)],'master':_0x1a652a[_0x1b3913(0x242)],'attributes':_0x1b0d7b?[..._0x1a652a[_0x1b3913(0x1fe)]||[],..._0x1b0d7b]:_0x1a652a[_0x1b3913(0x1fe)],'behaviors':_0x4ba44c?[..._0x1a652a[_0x1b3913(0x22a)]||[],..._0x4ba44c]:_0x1a652a[_0x1b3913(0x22a)],'customerGroup':_0x1a652a[_0x1b3913(0x2bc)]},_0x44b4b9=await withSpinner(_0x1b3913(0x34a)+_0x380ec3+_0x1b3913(0x1e1),()=>_0x49dfc0[_0x1b3913(0x348)][_0x1b3913(0x1be)](_0x380ec3,_0x142e7f),{'verbose':_0x2b544f[_0x1b3913(0x399)]}),_0x1d66ce=_0x44b4b9['data'];return console[_0x1b3913(0x344)](_0x1b3913(0x1c8)+_0x1d66ce['name']+'\x27'),await handleSDKOutput([_0x1d66ce],_0x2b544f),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x5137f5(0x21d)]='segment:parent:pull';[a31_0x5137f5(0x28a)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a31_0x5137f5(0x361)](_0x2af7d0){const _0x59027d=a31_0x5137f5,{options:_0x13126f,args:_0x329cdc,tdx:_0x513018}=_0x2af7d0,_0x2ff853=_0x13126f,_0x4f4a07=_0x329cdc[0x0]||_0x13126f['parentSegment'];if(!_0x4f4a07)return showParentSegmentNotSetError(_0x59027d(0x345)+_0x59027d(0x2e1)),0x1;if(_0x2ff853[_0x59027d(0x2ed)]&&_0x2ff853['output'])return console[_0x59027d(0x344)](a31_0x54e267[_0x59027d(0x1f2)](_0x59027d(0x23a))),console['error'](a31_0x54e267[_0x59027d(0x285)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x59027d(0x344)](a31_0x54e267['dim']('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x59027d(0x1bb))),console[_0x59027d(0x344)](a31_0x54e267[_0x59027d(0x385)](_0x59027d(0x2fc))),0x1;const _0x376759=_0x2ff853[_0x59027d(0x1e3)]||a31_0x15d013[_0x59027d(0x2e7)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4f4a07)+_0x59027d(0x210));_0x2ff853[_0x59027d(0x399)]&&(console['error'](_0x59027d(0x340)+_0x2ff853['site']),console[_0x59027d(0x344)]('Parent\x20segment:\x20'+_0x4f4a07),console[_0x59027d(0x344)]('Output\x20file:\x20'+_0x376759));const _0x104631=await withSpinner(_0x59027d(0x29a)+_0x4f4a07+_0x59027d(0x1e1),()=>_0x513018[_0x59027d(0x348)][_0x59027d(0x243)](_0x4f4a07),{'verbose':_0x2ff853['verbose']}),_0x2e0944=_0x104631[_0x59027d(0x1b3)];if(existsSync(_0x376759)){const _0x386fe4=readFileSync(_0x376759,'utf-8'),_0x8c86a1=generateDiff(_0x386fe4,_0x2e0944);if(!hasChanges(_0x8c86a1))console[_0x59027d(0x344)](a31_0x54e267[_0x59027d(0x324)]('✔')+'\x20No\x20changes\x20-\x20'+a31_0x54e267['cyan'](_0x376759)+_0x59027d(0x262));else{console[_0x59027d(0x344)](_0x59027d(0x3a4)+_0x376759+'\x27:'),console[_0x59027d(0x344)]('─'[_0x59027d(0x329)](0x3c)),console['error'](formatDiffWithColors(_0x8c86a1)),console[_0x59027d(0x344)]('─'[_0x59027d(0x329)](0x3c));if(!_0x2ff853[_0x59027d(0x267)]){if(!isInteractive())return console[_0x59027d(0x344)](a31_0x54e267[_0x59027d(0x1f2)]('\x0aError:'),_0x59027d(0x25b)),console[_0x59027d(0x344)](a31_0x54e267['dim'](_0x59027d(0x311))),0x1;const _0x10d4c9=await confirmKey('Overwrite\x20\x27'+_0x376759+'\x27?');if(!_0x10d4c9)return console[_0x59027d(0x344)](a31_0x54e267[_0x59027d(0x366)]('Aborted.')),0x1;}writeFileSync(_0x376759,_0x2e0944,_0x59027d(0x31f)),console[_0x59027d(0x344)](a31_0x54e267[_0x59027d(0x324)]('✔')+_0x59027d(0x2b4)+a31_0x54e267[_0x59027d(0x385)](_0x376759));}}else{const _0x5a102c=a31_0x15d013[_0x59027d(0x35f)](_0x376759);!existsSync(_0x5a102c)&&mkdirSync(_0x5a102c,{'recursive':!![]}),writeFileSync(_0x376759,_0x2e0944,_0x59027d(0x31f)),console[_0x59027d(0x344)](a31_0x54e267['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x54e267[_0x59027d(0x385)](_0x376759));}return saveSessionContext({'parent_segment':_0x4f4a07},_0x2ff853[_0x59027d(0x388)]),console[_0x59027d(0x344)](a31_0x54e267[_0x59027d(0x324)]('✔')+_0x59027d(0x2c9)+a31_0x54e267[_0x59027d(0x285)](_0x59027d(0x32c))+'\x20=\x20'+a31_0x54e267[_0x59027d(0x385)](_0x4f4a07)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a31_0x5137f5(0x272);[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x292);async['execute'](_0x6d370e){const _0x162094=a31_0x5137f5,{options:_0x4f1052,args:_0x105fab,tdx:_0x4db3a5}=_0x6d370e,_0x201305=_0x4f1052,_0x324a99=_0x105fab[0x0]||_0x4f1052[_0x162094(0x1b1)];if(!_0x324a99)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x162094(0x1cf)),0x1;const _0x3218e4=resolveYamlFile(_0x324a99);if(!existsSync(_0x3218e4))return showFileNotFoundError(_0x3218e4,_0x324a99),0x1;_0x201305['verbose']&&(console[_0x162094(0x344)](_0x162094(0x340)+_0x201305[_0x162094(0x2d6)]),console[_0x162094(0x344)](_0x162094(0x304)+_0x3218e4));let _0x1c5b08;try{_0x1c5b08=readFileSync(_0x3218e4,_0x162094(0x31f));}catch(_0x2e52c1){const _0x50923a=_0x2e52c1 instanceof Error?_0x2e52c1['message']:String(_0x2e52c1);return console[_0x162094(0x344)]('Error\x20reading\x20file:\x20'+_0x50923a),0x1;}const _0x99a039=await withSpinner(_0x162094(0x2db),()=>_0x4db3a5[_0x162094(0x348)][_0x162094(0x200)](_0x1c5b08),{'verbose':_0x201305[_0x162094(0x399)]}),_0x4dcc3f=_0x99a039[_0x162094(0x1b3)],{isNew:_0xc7083,name:_0x374ec0,hasChanges:_0x393939,diffFormatted:_0x4ee826}=_0x4dcc3f;if(!_0x393939)return console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0x374ec0+_0x162094(0x30a)),0x0;_0xc7083?console[_0x162094(0x344)](_0x162094(0x313)+_0x374ec0+'\x27:'):console[_0x162094(0x344)](_0x162094(0x1f6)+_0x374ec0+'\x27:');console['error']('─'[_0x162094(0x329)](0x3c)),console['error'](_0x4ee826),console['error']('─'[_0x162094(0x329)](0x3c));const _0x13bdea=_0xc7083?'Create\x20parent\x20segment\x20\x27'+_0x374ec0+'\x27?':_0x162094(0x386)+_0x374ec0+'\x27?';if(!_0x201305[_0x162094(0x267)]){if(!isInteractive())return console[_0x162094(0x344)](a31_0x54e267['red'](_0x162094(0x265)),_0x162094(0x25b)),console[_0x162094(0x344)](a31_0x54e267['dim'](_0x162094(0x311))),0x1;const _0x386e31=await confirmKey(_0x13bdea);if(!_0x386e31)return console[_0x162094(0x344)](a31_0x54e267['yellow'](_0x162094(0x33f))),0x1;}const _0x2fea8d=_0xc7083?'Creating':_0x162094(0x2a2),_0x4ad60f=await withSpinner(_0x2fea8d+_0x162094(0x20d)+_0x374ec0+_0x162094(0x1e1),()=>_0x4dcc3f[_0x162094(0x3b4)](),{'verbose':_0x201305[_0x162094(0x399)]}),_0x276d46=_0x4ad60f[_0x162094(0x1b3)],_0x3d87ae=getConsoleNextUrl(_0x201305['site'],'/app/dw/parentSegments/'+_0x276d46['id']),_0x43e8ca=_0xc7083?_0x162094(0x367):_0x162094(0x39f);return console[_0x162094(0x344)]('✔\x20'+_0x43e8ca+_0x162094(0x20d)+_0x276d46[_0x162094(0x21d)]+'\x27'),console[_0x162094(0x344)]('\x20\x20'+_0x3d87ae),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x5137f5(0x21d)]='segment:parent:validate';[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x1f5);async['execute'](_0x413b30){const _0x3e373=a31_0x5137f5,{options:_0xd45584,args:_0x4d591f,tdx:_0x40b3d0}=_0x413b30,_0xe2b7b3=_0xd45584,_0x368053=_0x4d591f[0x0]||_0xd45584[_0x3e373(0x1b1)];if(!_0x368053)return showParentSegmentNotSetError(_0x3e373(0x330)+_0x3e373(0x2b8)+_0x3e373(0x2ea)+_0x3e373(0x390)+_0x3e373(0x293)+_0x3e373(0x2c7)),0x1;const _0x3c8750=resolveYamlFile(_0x368053);if(!existsSync(_0x3c8750))return showFileNotFoundError(_0x3c8750,_0x368053),0x1;_0xe2b7b3[_0x3e373(0x399)]&&(console[_0x3e373(0x344)](_0x3e373(0x340)+_0xe2b7b3[_0x3e373(0x2d6)]),console[_0x3e373(0x344)](_0x3e373(0x304)+_0x3c8750));let _0x323e25;try{_0x323e25=readFileSync(_0x3c8750,_0x3e373(0x31f));}catch(_0x13ef56){const _0x39f514=_0x13ef56 instanceof Error?_0x13ef56[_0x3e373(0x305)]:String(_0x13ef56);return console[_0x3e373(0x344)]('Error\x20reading\x20file:\x20'+_0x39f514),0x1;}const _0x14c5d3=createCommandSpinner(a31_0x54e267['dim'](_0x3e373(0x286)),{'verbose':_0xe2b7b3[_0x3e373(0x399)]});_0x14c5d3[_0x3e373(0x23b)]();const _0x5f2e86={'onProgress':_0x5b8d5a=>{const _0x53df6d=_0x3e373;_0x14c5d3[_0x53df6d(0x223)]=formatProgressMessage(_0x5b8d5a);}};if(_0xe2b7b3[_0x3e373(0x242)])_0x5f2e86[_0x3e373(0x242)]=!![];if(_0xe2b7b3['enriched'])_0x5f2e86[_0x3e373(0x2dd)]=!![];_0xe2b7b3[_0x3e373(0x252)]&&(_0x5f2e86[_0x3e373(0x252)]=_0xe2b7b3[_0x3e373(0x252)]);_0xe2b7b3[_0x3e373(0x2bb)]&&(_0x5f2e86[_0x3e373(0x2bb)]=_0xe2b7b3['behavior']);if(_0xe2b7b3['interval'])_0x5f2e86[_0x3e373(0x1c2)]=_0xe2b7b3[_0x3e373(0x1c2)];let _0xe8c5b3;try{_0xe8c5b3=await _0x40b3d0['segment'][_0x3e373(0x253)](_0x323e25,_0x5f2e86),_0x14c5d3['stop']();}catch(_0x1f6019){_0x14c5d3[_0x3e373(0x38b)]();throw _0x1f6019;}const _0x3a2e4f=_0xe2b7b3[_0x3e373(0x1c2)]||_0x3e373(0x32b);return this[_0x3e373(0x206)](_0xe8c5b3,_0x5f2e86,_0x3c8750,_0x3a2e4f),_0xe8c5b3[_0x3e373(0x233)]?0x0:0x1;}[a31_0x5137f5(0x206)](_0x3cd39e,_0x38a322,_0x5d47e0,_0x4f11ec){const _0x2e4795=a31_0x5137f5;console['error']('\x0a'+a31_0x54e267['bold'](_0x2e4795(0x2f1))+'\x20'+_0x3cd39e['name']),console[_0x2e4795(0x344)]('═'[_0x2e4795(0x329)](0x3c)),this[_0x2e4795(0x354)](_0x3cd39e);if(typeof _0x38a322[_0x2e4795(0x252)]===_0x2e4795(0x214)){this[_0x2e4795(0x332)](_0x3cd39e),this[_0x2e4795(0x222)](_0x3cd39e),this['displayPreviewHints'](_0x5d47e0,_0x4f11ec,_0x2e4795(0x252),_0x38a322[_0x2e4795(0x252)]);return;}if(_0x38a322[_0x2e4795(0x252)]===!![]){this[_0x2e4795(0x332)](_0x3cd39e),this[_0x2e4795(0x222)](_0x3cd39e),this['displayPreviewHints'](_0x5d47e0,_0x4f11ec,'attributes');return;}if(typeof _0x38a322[_0x2e4795(0x2bb)]==='string'){this['displayBehaviorsStats'](_0x3cd39e,_0x4f11ec),this[_0x2e4795(0x222)](_0x3cd39e),this[_0x2e4795(0x325)](_0x5d47e0,_0x4f11ec,'behavior',_0x38a322['behavior']);return;}if(_0x38a322[_0x2e4795(0x2bb)]===!![]){this[_0x2e4795(0x1e6)](_0x3cd39e,_0x4f11ec),this[_0x2e4795(0x222)](_0x3cd39e),this[_0x2e4795(0x325)](_0x5d47e0,_0x4f11ec,_0x2e4795(0x22a));return;}this[_0x2e4795(0x332)](_0x3cd39e),this[_0x2e4795(0x1e6)](_0x3cd39e,_0x4f11ec),this['displayRealtimeInfo'](_0x3cd39e),this[_0x2e4795(0x222)](_0x3cd39e),this[_0x2e4795(0x325)](_0x5d47e0,_0x4f11ec,_0x2e4795(0x277));}['displayRealtimeInfo'](_0x332c74){displayRealtimeValidation(_0x332c74);}[a31_0x5137f5(0x325)](_0x599534,_0x29aafd,_0x37e62a,_0x217c6b){const _0x1ab0f1=a31_0x5137f5;console['error']('\x0a'+a31_0x54e267['dim'](_0x1ab0f1(0x360)));const _0x13a4d2=_0x29aafd!=='-1d'?_0x1ab0f1(0x1c6)+_0x29aafd:'';if(_0x37e62a===_0x1ab0f1(0x252)&&_0x217c6b)console[_0x1ab0f1(0x344)]('\x20\x20'+a31_0x54e267[_0x1ab0f1(0x285)](_0x1ab0f1(0x1d0)+_0x599534+_0x1ab0f1(0x289)+_0x217c6b+'\x22'+_0x13a4d2));else{if(_0x37e62a===_0x1ab0f1(0x2bb)&&_0x217c6b)console[_0x1ab0f1(0x344)]('\x20\x20'+a31_0x54e267[_0x1ab0f1(0x285)](_0x1ab0f1(0x1d0)+_0x599534+_0x1ab0f1(0x2d7)+_0x217c6b+'\x22'+_0x13a4d2));else(_0x37e62a==='attributes'||_0x37e62a==='all')&&console['error']('\x20\x20'+a31_0x54e267['dim']('tdx\x20ps\x20preview\x20'+_0x599534+_0x1ab0f1(0x355)+_0x13a4d2));}(_0x37e62a===_0x1ab0f1(0x22a)||_0x37e62a===_0x1ab0f1(0x277))&&console['error']('\x20\x20'+a31_0x54e267[_0x1ab0f1(0x285)]('tdx\x20ps\x20preview\x20'+_0x599534+_0x1ab0f1(0x301)+_0x13a4d2)),_0x37e62a===_0x1ab0f1(0x277)&&console[_0x1ab0f1(0x344)]('\x20\x20'+a31_0x54e267['dim']('tdx\x20ps\x20preview\x20'+_0x599534+'\x20--enriched'+_0x13a4d2));}[a31_0x5137f5(0x354)](_0x7ad8dc){const _0x32da6f=a31_0x5137f5,{master:_0x14c9db}=_0x7ad8dc,_0x46ad36=_0x14c9db[_0x32da6f(0x31a)]?a31_0x54e267[_0x32da6f(0x324)]('✔'):a31_0x54e267['red']('✘');console[_0x32da6f(0x344)]('\x0a'+a31_0x54e267[_0x32da6f(0x285)](_0x32da6f(0x1f3))),console[_0x32da6f(0x344)](_0x46ad36+'\x20'+a31_0x54e267[_0x32da6f(0x39d)](_0x14c9db[_0x32da6f(0x36b)]+'.'+_0x14c9db[_0x32da6f(0x1d8)])),_0x14c9db[_0x32da6f(0x31a)]?_0x14c9db[_0x32da6f(0x2c4)]!==undefined&&console['error']('\x20\x20'+a31_0x54e267['dim'](_0x32da6f(0x225))+'\x20'+a31_0x54e267[_0x32da6f(0x385)](formatRows(_0x14c9db[_0x32da6f(0x2c4)]))):console[_0x32da6f(0x344)]('\x20\x20'+a31_0x54e267['red'](_0x32da6f(0x3c0))+'\x20'+_0x14c9db[_0x32da6f(0x227)]);}[a31_0x5137f5(0x332)](_0x28c4aa){const _0x4f71cd=a31_0x5137f5;if(_0x28c4aa[_0x4f71cd(0x1fe)][_0x4f71cd(0x2bf)]===0x0)return;console[_0x4f71cd(0x344)]('\x0a'+a31_0x54e267['dim'](_0x4f71cd(0x3c6)));for(const _0x1c7e53 of _0x28c4aa[_0x4f71cd(0x1fe)]){const _0x2ce935=_0x1c7e53[_0x4f71cd(0x31a)]?a31_0x54e267[_0x4f71cd(0x324)]('✔'):a31_0x54e267[_0x4f71cd(0x1f2)]('✘');let _0x5eac38='';if(_0x1c7e53[_0x4f71cd(0x31a)]&&_0x1c7e53[_0x4f71cd(0x232)]!==undefined&&_0x1c7e53[_0x4f71cd(0x34b)]!==undefined){const _0x48b485=_0x1c7e53[_0x4f71cd(0x34b)][_0x4f71cd(0x3c8)](0x1),_0x37e299=_0x1c7e53['coveragePercent']>=0x50?a31_0x54e267[_0x4f71cd(0x324)]:_0x1c7e53['coveragePercent']>=0x32?a31_0x54e267['yellow']:a31_0x54e267['red'];_0x5eac38='\x20'+a31_0x54e267['dim'](_0x4f71cd(0x352))+'\x20'+_0x37e299(_0x48b485+'%')+'\x20('+formatRows(_0x1c7e53[_0x4f71cd(0x232)])+_0x4f71cd(0x3a6);}console['error'](_0x2ce935+'\x20'+a31_0x54e267['bold'](_0x1c7e53[_0x4f71cd(0x21d)])+_0x5eac38),console['error']('\x20\x20'+a31_0x54e267[_0x4f71cd(0x285)](_0x4f71cd(0x2b1))+'\x20'+a31_0x54e267[_0x4f71cd(0x39d)](_0x1c7e53['database']+'.'+_0x1c7e53['table']));const _0x5ef9ff=_0x1c7e53[_0x4f71cd(0x29e)]===_0x1c7e53[_0x4f71cd(0x1f1)]?a31_0x54e267['dim'](_0x4f71cd(0x1f8))+'\x20'+_0x1c7e53[_0x4f71cd(0x29e)]:a31_0x54e267[_0x4f71cd(0x285)](_0x4f71cd(0x3a1))+'\x20'+_0x1c7e53[_0x4f71cd(0x29e)]+_0x4f71cd(0x238)+_0x1c7e53[_0x4f71cd(0x1f1)];console[_0x4f71cd(0x344)]('\x20\x20'+_0x5ef9ff),console[_0x4f71cd(0x344)]('\x20\x20'+a31_0x54e267[_0x4f71cd(0x285)](_0x4f71cd(0x2cd))),this[_0x4f71cd(0x3a0)](_0x1c7e53['columns']),!_0x1c7e53[_0x4f71cd(0x31a)]&&console[_0x4f71cd(0x344)]('\x20\x20'+a31_0x54e267[_0x4f71cd(0x1f2)](_0x4f71cd(0x3c0))+'\x20'+_0x1c7e53['schemaError']);}}['displayBehaviorsStats'](_0x9f232b,_0x319ca6){const _0x173724=a31_0x5137f5;if(_0x9f232b[_0x173724(0x22a)][_0x173724(0x2bf)]===0x0)return;console['error']('\x0a'+a31_0x54e267[_0x173724(0x285)](_0x173724(0x38d))+'\x20'+a31_0x54e267[_0x173724(0x285)]('('+_0x319ca6+')'));for(const _0x4badee of _0x9f232b['behaviors']){const _0xb35bef=_0x4badee[_0x173724(0x31a)]?a31_0x54e267[_0x173724(0x324)]('✔'):a31_0x54e267['red']('✘');let _0x5b3eac='';if(_0x4badee['schemaValid']&&_0x4badee[_0x173724(0x235)]!==undefined&&_0x4badee[_0x173724(0x1df)]!==undefined){const _0x47c366=_0x4badee[_0x173724(0x295)]?.[_0x173724(0x3c8)](0x1)||'?',_0x13a07a=(_0x4badee[_0x173724(0x295)]??0x0)>=0x32?a31_0x54e267[_0x173724(0x324)]:(_0x4badee['customerPercent']??0x0)>=0x14?a31_0x54e267['yellow']:a31_0x54e267['red'];_0x5b3eac='\x20'+a31_0x54e267[_0x173724(0x285)](_0x173724(0x24b))+'\x20'+_0x13a07a(formatRows(_0x4badee[_0x173724(0x235)]))+'\x20('+_0x47c366+_0x173724(0x25c)+a31_0x54e267[_0x173724(0x285)]('Events:')+'\x20'+a31_0x54e267['cyan'](formatRows(_0x4badee[_0x173724(0x1df)]));}console[_0x173724(0x344)](_0xb35bef+'\x20'+a31_0x54e267['bold'](_0x4badee[_0x173724(0x21d)])+_0x5b3eac),console[_0x173724(0x344)]('\x20\x20'+a31_0x54e267[_0x173724(0x285)](_0x173724(0x2b1))+'\x20'+a31_0x54e267[_0x173724(0x39d)](_0x4badee[_0x173724(0x36b)]+'.'+_0x4badee[_0x173724(0x1d8)]));const _0xd7532=_0x4badee[_0x173724(0x29e)]===_0x4badee[_0x173724(0x1f1)]?a31_0x54e267['dim']('Join\x20on:')+'\x20'+_0x4badee[_0x173724(0x29e)]:a31_0x54e267[_0x173724(0x285)](_0x173724(0x3a1))+'\x20'+_0x4badee[_0x173724(0x29e)]+_0x173724(0x238)+_0x4badee[_0x173724(0x1f1)];console[_0x173724(0x344)]('\x20\x20'+_0xd7532),console[_0x173724(0x344)]('\x20\x20'+a31_0x54e267[_0x173724(0x285)]('Columns:')),this[_0x173724(0x3a0)](_0x4badee[_0x173724(0x1e4)]),!_0x4badee[_0x173724(0x31a)]&&console[_0x173724(0x344)]('\x20\x20'+a31_0x54e267[_0x173724(0x1f2)](_0x173724(0x3c0))+'\x20'+_0x4badee[_0x173724(0x227)]);}}[a31_0x5137f5(0x3a0)](_0x1062ea){const _0x422860=a31_0x5137f5;for(const _0x543acc of _0x1062ea){_0x543acc[_0x422860(0x27a)]===_0x543acc[_0x422860(0x32d)]||_0x543acc[_0x422860(0x32d)]==='*'?console[_0x422860(0x344)]('\x20\x20\x20\x20-\x20'+_0x543acc[_0x422860(0x27a)]):console[_0x422860(0x344)](_0x422860(0x1b2)+_0x543acc[_0x422860(0x27a)]+'\x20'+a31_0x54e267[_0x422860(0x285)]('('+_0x543acc['column']+')'));}}['displaySummary'](_0x1e63a0){const _0x3bf13b=a31_0x5137f5;console[_0x3bf13b(0x344)]('─'['repeat'](0x3c));if(_0x1e63a0['errors'][_0x3bf13b(0x2bf)]>0x0){console[_0x3bf13b(0x344)]('\x0a'+a31_0x54e267[_0x3bf13b(0x1f2)](_0x3bf13b(0x23e)));for(const _0x16fe21 of _0x1e63a0['errors']){console['error']('\x20\x20'+a31_0x54e267[_0x3bf13b(0x1f2)]('•')+'\x20'+_0x16fe21);}}_0x1e63a0[_0x3bf13b(0x233)]&&console[_0x3bf13b(0x344)]('\x0a'+a31_0x54e267[_0x3bf13b(0x324)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x38c);['description']='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async[a31_0x5137f5(0x361)](_0x4c7948){const _0x4c1068=a31_0x5137f5,{options:_0x3fde4d,args:_0x24bff5,tdx:_0x312ae7}=_0x4c7948,_0x1c3235=_0x3fde4d,_0x2f2c7a=_0x24bff5[0x0]||_0x3fde4d[_0x4c1068(0x1b1)];if(!_0x2f2c7a)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x4c1068(0x3b2)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x4c1068(0x213)+_0x4c1068(0x307)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x4c1068(0x2c7)),0x1;if(!_0x1c3235[_0x4c1068(0x242)]&&!_0x1c3235[_0x4c1068(0x252)]&&!_0x1c3235[_0x4c1068(0x2bb)]&&!_0x1c3235[_0x4c1068(0x2dd)])return console['error'](a31_0x54e267['red'](_0x4c1068(0x260))),console[_0x4c1068(0x344)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x4c1068(0x344)](_0x4c1068(0x363)),console[_0x4c1068(0x344)](_0x4c1068(0x3c5)),console[_0x4c1068(0x344)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x4c1068(0x344)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x4c1068(0x344)](_0x4c1068(0x36a)),0x1;const _0x15d70d=resolveYamlFile(_0x2f2c7a);if(!existsSync(_0x15d70d))return showFileNotFoundError(_0x15d70d,_0x2f2c7a),0x1;_0x1c3235[_0x4c1068(0x399)]&&(console[_0x4c1068(0x344)](_0x4c1068(0x340)+_0x1c3235['site']),console[_0x4c1068(0x344)](_0x4c1068(0x304)+_0x15d70d));let _0x420b4f;try{_0x420b4f=readFileSync(_0x15d70d,_0x4c1068(0x31f));}catch(_0x2134fe){const _0x258d0b=_0x2134fe instanceof Error?_0x2134fe[_0x4c1068(0x305)]:String(_0x2134fe);return console[_0x4c1068(0x344)](_0x4c1068(0x32f)+_0x258d0b),0x1;}let _0x1328aa;try{_0x1328aa=parseDef(_0x420b4f);}catch(_0x497493){const _0x4c3244=_0x497493 instanceof Error?_0x497493['message']:String(_0x497493);return console[_0x4c1068(0x344)](a31_0x54e267[_0x4c1068(0x1f2)]('Error\x20parsing\x20YAML:\x20'+_0x4c3244)),0x1;}if(_0x1c3235[_0x4c1068(0x252)]===!![]||_0x1c3235[_0x4c1068(0x252)]===''){const _0x1be060=_0x1328aa['attributes']?.[_0x4c1068(0x337)](_0x417af0=>_0x417af0['name'])||[];if(_0x1be060[_0x4c1068(0x2bf)]===0x0)console[_0x4c1068(0x344)](a31_0x54e267[_0x4c1068(0x1f2)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x4c1068(0x344)](a31_0x54e267['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x4c1068(0x344)](_0x4c1068(0x362));for(const _0x57a27a of _0x1be060){console[_0x4c1068(0x344)]('\x20\x20'+a31_0x54e267[_0x4c1068(0x385)](_0x57a27a));}console[_0x4c1068(0x344)](_0x4c1068(0x2b5)+_0x2f2c7a+_0x4c1068(0x289)+_0x1be060[0x0]+'\x22');}return 0x1;}if(_0x1c3235[_0x4c1068(0x2bb)]===!![]||_0x1c3235['behavior']===''){const _0x2ea6dd=_0x1328aa['behaviors']?.[_0x4c1068(0x337)](_0x48d976=>_0x48d976[_0x4c1068(0x21d)])||[];if(_0x2ea6dd[_0x4c1068(0x2bf)]===0x0)console[_0x4c1068(0x344)](a31_0x54e267[_0x4c1068(0x1f2)](_0x4c1068(0x343)));else{console[_0x4c1068(0x344)](a31_0x54e267[_0x4c1068(0x1f2)](_0x4c1068(0x24a))),console[_0x4c1068(0x344)](_0x4c1068(0x205));for(const _0x4d8329 of _0x2ea6dd){console[_0x4c1068(0x344)]('\x20\x20'+a31_0x54e267[_0x4c1068(0x385)](_0x4d8329));}console[_0x4c1068(0x344)](_0x4c1068(0x2b5)+_0x2f2c7a+'\x20--behavior\x20\x22'+_0x2ea6dd[0x0]+'\x22');}return 0x1;}const _0x3ef17=createCommandSpinner(a31_0x54e267[_0x4c1068(0x285)](_0x4c1068(0x1ec)),{'verbose':_0x1c3235[_0x4c1068(0x399)]});_0x3ef17['start']();const _0x2854db={'onProgress':_0x4def0b=>{const _0x168273=_0x4c1068;_0x3ef17[_0x168273(0x223)]=formatProgressMessage(_0x4def0b);}};if(_0x1c3235['master'])_0x2854db['master']=!![];if(_0x1c3235['attribute']&&typeof _0x1c3235[_0x4c1068(0x252)]===_0x4c1068(0x214))_0x2854db[_0x4c1068(0x252)]=_0x1c3235[_0x4c1068(0x252)];if(_0x1c3235[_0x4c1068(0x2bb)]&&typeof _0x1c3235['behavior']===_0x4c1068(0x214))_0x2854db[_0x4c1068(0x2bb)]=_0x1c3235['behavior'];if(_0x1c3235['enriched'])_0x2854db[_0x4c1068(0x2dd)]=!![];if(_0x1c3235[_0x4c1068(0x1c2)])_0x2854db[_0x4c1068(0x1c2)]=_0x1c3235[_0x4c1068(0x1c2)];let _0x37e034;try{_0x37e034=await _0x312ae7[_0x4c1068(0x348)][_0x4c1068(0x24f)](_0x420b4f,_0x2854db),_0x3ef17[_0x4c1068(0x38b)]();}catch(_0x5ae397){_0x3ef17[_0x4c1068(0x38b)]();throw _0x5ae397;}return await this[_0x4c1068(0x34d)](_0x37e034,{'master':_0x1c3235['master'],'attribute':typeof _0x1c3235[_0x4c1068(0x252)]==='string'?_0x1c3235[_0x4c1068(0x252)]:undefined,'behavior':typeof _0x1c3235[_0x4c1068(0x2bb)]===_0x4c1068(0x214)?_0x1c3235[_0x4c1068(0x2bb)]:undefined,'enriched':_0x1c3235['enriched']}),_0x37e034[_0x4c1068(0x233)]?0x0:0x1;}async[a31_0x5137f5(0x34d)](_0xca6a0c,_0x4f9a58){const _0x5127f7=a31_0x5137f5;console[_0x5127f7(0x344)]('\x0a'+a31_0x54e267[_0x5127f7(0x39d)]('Preview:')+'\x20'+_0xca6a0c[_0x5127f7(0x21d)]),console[_0x5127f7(0x344)]('═'[_0x5127f7(0x329)](0x3c));if(_0x4f9a58[_0x5127f7(0x242)]&&_0xca6a0c[_0x5127f7(0x326)]){const _0x1f81d8=a31_0x54e267[_0x5127f7(0x285)](_0x5127f7(0x2e3))+'\x20'+a31_0x54e267['bold'](_0xca6a0c['master']['database']+'.'+_0xca6a0c[_0x5127f7(0x242)][_0x5127f7(0x1d8)]);await this[_0x5127f7(0x381)](_0x1f81d8,_0xca6a0c[_0x5127f7(0x326)]);}else{if(_0x4f9a58['attribute']&&_0xca6a0c['sampleData']){const _0x4ec19f=a31_0x54e267[_0x5127f7(0x285)](_0x5127f7(0x2e9))+'\x20'+a31_0x54e267[_0x5127f7(0x39d)](_0x4f9a58[_0x5127f7(0x252)]);await this[_0x5127f7(0x381)](_0x4ec19f,_0xca6a0c[_0x5127f7(0x326)]);}else{if(_0x4f9a58[_0x5127f7(0x2bb)]&&_0xca6a0c['sampleData']){const _0x3b6721=a31_0x54e267[_0x5127f7(0x285)](_0x5127f7(0x3ac))+'\x20'+a31_0x54e267['bold'](_0x4f9a58[_0x5127f7(0x2bb)]);await this[_0x5127f7(0x381)](_0x3b6721,_0xca6a0c[_0x5127f7(0x326)]);}else{if(_0x4f9a58[_0x5127f7(0x2dd)]&&_0xca6a0c[_0x5127f7(0x326)]){const _0x3795bc=a31_0x54e267[_0x5127f7(0x285)](_0x5127f7(0x281))+'\x20'+a31_0x54e267[_0x5127f7(0x39d)]('Master\x20+\x20Attributes');await this['displaySampleData'](_0x3795bc,_0xca6a0c[_0x5127f7(0x326)]);}else!_0xca6a0c['sampleData']&&console[_0x5127f7(0x344)](_0x5127f7(0x2ee));}}}if(_0xca6a0c['errors']['length']>0x0){console['error']('─'['repeat'](0x3c)),console[_0x5127f7(0x344)]('\x0a'+a31_0x54e267[_0x5127f7(0x1f2)](_0x5127f7(0x23e)));for(const _0x5e6469 of _0xca6a0c[_0x5127f7(0x2e8)]){console[_0x5127f7(0x344)]('\x20\x20'+a31_0x54e267['red']('•')+'\x20'+_0x5e6469);}}}async[a31_0x5137f5(0x381)](_0x247ca5,_0x20bbc7){const _0x59a66e=a31_0x5137f5;if(_0x20bbc7[_0x59a66e(0x2bf)]===0x0){console['error']('\x0a'+_0x247ca5),console[_0x59a66e(0x344)](_0x59a66e(0x3ab));return;}console['error']('\x0a'+_0x247ca5);const _0x1c3e5e=Object[_0x59a66e(0x2a3)](_0x20bbc7[0x0])[_0x59a66e(0x337)](_0x521af8=>({'name':_0x521af8,'type':typeof _0x20bbc7[0x0][_0x521af8]===_0x59a66e(0x2f3)?'double':_0x59a66e(0x2b3)})),_0x9fdc55={'queryId':'preview','columns':_0x1c3e5e,'data':_0x20bbc7,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x20bbc7[_0x59a66e(0x2bf)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x4ccd5d=formatAsTable(_0x9fdc55,_0x20bbc7[_0x59a66e(0x2bf)],!![]);await writeOutput(_0x4ccd5d,undefined,_0x59a66e(0x1d8));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x1ce);[a31_0x5137f5(0x28a)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a31_0x5137f5(0x361)](_0x13d3f8){const _0x544ffd=a31_0x5137f5,{options:_0x21692e,args:_0x13021e,tdx:_0x459dde}=_0x13d3f8,_0xcb30ca=_0x21692e,_0x3376e1=_0x13021e[0x0]||_0x21692e[_0x544ffd(0x1b1)];if(!_0x3376e1)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'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x37a70c=resolveYamlFile(_0x3376e1);if(existsSync(_0x37a70c)){_0xcb30ca[_0x544ffd(0x399)]&&console[_0x544ffd(0x344)](_0x544ffd(0x2ef)+_0x37a70c);let _0x3058bb;try{_0x3058bb=readFileSync(_0x37a70c,_0x544ffd(0x31f));}catch(_0x5def44){const _0x44c8da=_0x5def44 instanceof Error?_0x5def44[_0x544ffd(0x305)]:String(_0x5def44);return console[_0x544ffd(0x344)](_0x544ffd(0x32f)+_0x44c8da),0x1;}const _0x216003=await withSpinner('Analyzing\x20changes...',()=>_0x459dde[_0x544ffd(0x348)][_0x544ffd(0x200)](_0x3058bb),{'verbose':_0xcb30ca['verbose']}),_0x425218=_0x216003[_0x544ffd(0x1b3)],{isNew:_0x122810,name:_0x525ae0,hasChanges:_0x343cce,diffFormatted:_0x23b9e8}=_0x425218;if(_0x343cce){_0x122810?console[_0x544ffd(0x344)](_0x544ffd(0x313)+_0x525ae0+'\x27:'):console[_0x544ffd(0x344)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x525ae0+'\x27:');console[_0x544ffd(0x344)]('─'[_0x544ffd(0x329)](0x3c)),console['error'](_0x23b9e8),console[_0x544ffd(0x344)]('─'[_0x544ffd(0x329)](0x3c));const _0x624cd=_0x122810?'Create\x20parent\x20segment\x20\x27'+_0x525ae0+_0x544ffd(0x1e7):'Apply\x20changes\x20to\x20\x27'+_0x525ae0+_0x544ffd(0x1e7);if(!_0xcb30ca[_0x544ffd(0x267)]){if(!isInteractive())return console[_0x544ffd(0x344)](a31_0x54e267[_0x544ffd(0x1f2)](_0x544ffd(0x265)),_0x544ffd(0x25b)),console[_0x544ffd(0x344)](a31_0x54e267[_0x544ffd(0x285)](_0x544ffd(0x311))),0x1;const _0x5981c6=await confirmKey(_0x624cd);if(!_0x5981c6)return console[_0x544ffd(0x344)](a31_0x54e267['yellow']('Aborted.')),0x1;}const _0x51ff50=_0x122810?_0x544ffd(0x21c):_0x544ffd(0x2a2);await withSpinner(_0x51ff50+_0x544ffd(0x20d)+_0x525ae0+'\x27...',()=>_0x425218[_0x544ffd(0x3b4)](),{'verbose':_0xcb30ca[_0x544ffd(0x399)]});const _0x37dba1=_0x122810?_0x544ffd(0x367):'Updated';console[_0x544ffd(0x344)]('✔\x20'+_0x37dba1+_0x544ffd(0x20d)+_0x525ae0+'\x27');}else console['error'](_0x544ffd(0x1fc)+_0x525ae0+_0x544ffd(0x2a9));}const _0x1aae2b=await withSpinner(_0x544ffd(0x275)+_0x3376e1+_0x544ffd(0x1e1),()=>_0x459dde[_0x544ffd(0x348)][_0x544ffd(0x3c4)](_0x3376e1),{'verbose':_0xcb30ca[_0x544ffd(0x399)]}),_0x1256ea=_0x1aae2b[_0x544ffd(0x1b3)],_0x4c956f=getConsoleUrl(_0xcb30ca[_0x544ffd(0x2d6)],_0x544ffd(0x333)+_0x1256ea['workflowId']+_0x544ffd(0x3a9)+_0x1256ea[_0x544ffd(0x3bd)]+_0x544ffd(0x207)+_0x1256ea[_0x544ffd(0x1e5)]);return console['error'](_0x544ffd(0x2dc)),console[_0x544ffd(0x344)]('\x20\x20'+a31_0x54e267[_0x544ffd(0x285)](_0x544ffd(0x38a))+'\x20'+_0x1256ea[_0x544ffd(0x310)]),console[_0x544ffd(0x344)]('\x20\x20'+a31_0x54e267['dim'](_0x544ffd(0x321))+'\x20'+_0x1256ea[_0x544ffd(0x28f)]),console[_0x544ffd(0x344)]('\x20\x20'+a31_0x54e267['dim']('Session:')+'\x20'+_0x1256ea[_0x544ffd(0x3bd)]),console[_0x544ffd(0x344)]('\x20\x20'+a31_0x54e267[_0x544ffd(0x285)](_0x544ffd(0x328))+'\x20'+_0x1256ea['workflowAttemptId']),console[_0x544ffd(0x344)]('\x20\x20'+_0x4c956f),console[_0x544ffd(0x344)]('\x0a'+a31_0x54e267['dim'](_0x544ffd(0x377))+'\x20tdx\x20wf\x20attempt\x20'+_0x1256ea[_0x544ffd(0x1e5)]+_0x544ffd(0x383)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x211);[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x22e);async[a31_0x5137f5(0x361)](_0x171a72){const _0x4c801b=a31_0x5137f5,{options:_0x2b1871,args:_0x28ed26,tdx:_0x900c07}=_0x171a72,_0x55c4ab=_0x28ed26[0x0]||_0x2b1871[_0x4c801b(0x1b1)];if(!_0x55c4ab)return showParentSegmentNotSetError(_0x4c801b(0x28c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x2b1871[_0x4c801b(0x399)]&&(console[_0x4c801b(0x344)](_0x4c801b(0x340)+_0x2b1871[_0x4c801b(0x2d6)]),console[_0x4c801b(0x344)](_0x4c801b(0x203)+_0x55c4ab));const _0x25bf67=await withSpinner(_0x4c801b(0x215)+_0x55c4ab+'\x27...',()=>_0x900c07[_0x4c801b(0x348)][_0x4c801b(0x266)](_0x55c4ab),{'verbose':_0x2b1871[_0x4c801b(0x399)]}),_0x153e35=_0x25bf67['data'];console[_0x4c801b(0x344)]('✔\x20Found\x20'+_0x153e35[_0x4c801b(0x2bf)]+_0x4c801b(0x218)+(_0x153e35[_0x4c801b(0x2bf)]!==0x1?'s':''));if(_0x2b1871['json']||_0x2b1871[_0x4c801b(0x245)])return await handleSDKOutput(_0x153e35,_0x2b1871),0x0;return displayFieldsHumanReadable(_0x153e35,_0x55c4ab),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x392);['description']=a31_0x5137f5(0x24c);async[a31_0x5137f5(0x361)](_0x5900f3){const _0x1ea492=a31_0x5137f5,{options:_0x2933ca,args:_0xafada0,tdx:_0x11e719}=_0x5900f3,_0x553394=_0x2933ca,_0x95089c=_0xafada0[0x0]||_0x2933ca[_0x1ea492(0x1b1)];if(!_0x95089c)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'+_0x1ea492(0x27f)+'Options:\x0a'+_0x1ea492(0x2c6)),0x1;_0x2933ca[_0x1ea492(0x399)]&&(console[_0x1ea492(0x344)]('Site:\x20'+_0x2933ca['site']),console[_0x1ea492(0x344)](_0x1ea492(0x203)+_0x95089c));const _0x3e71aa=await withSpinner(_0x1ea492(0x29a)+_0x95089c+'\x27...',()=>_0x11e719[_0x1ea492(0x348)]['getParentFull'](_0x95089c),{'verbose':_0x2933ca[_0x1ea492(0x399)]}),_0x36f669=_0x3e71aa['data'];if(_0x553394[_0x1ea492(0x20f)]){const _0x52ca8c=getConsoleNextUrl(_0x553394[_0x1ea492(0x2d6)],'/app/dw/parentSegments/'+_0x36f669['id']);return console['error'](a31_0x54e267['green']('✔')+_0x1ea492(0x239)+a31_0x54e267[_0x1ea492(0x385)](_0x52ca8c)),openBrowser(_0x52ca8c),0x0;}return await handleSingleObjectOutput(_0x36f669,_0x2933ca),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x276);['description']=a31_0x5137f5(0x219);async['execute'](_0x551c58){const _0x316beb=a31_0x5137f5,{options:_0x493cc6,args:_0x2b3cbe,tdx:_0x142b1f}=_0x551c58,_0x1a1619=_0x493cc6,_0x505224=_0x2b3cbe[0x0]||_0x493cc6[_0x316beb(0x1b1)];if(!_0x505224)return showParentSegmentNotSetError(_0x316beb(0x364)+_0x316beb(0x212)+_0x316beb(0x2ea)+_0x316beb(0x323)),0x1;_0x493cc6[_0x316beb(0x399)]&&(console['error'](_0x316beb(0x340)+_0x493cc6['site']),console['error'](_0x316beb(0x203)+_0x505224));const _0x1d9208=await withSpinner(_0x316beb(0x327)+_0x505224+_0x316beb(0x1e1),()=>_0x142b1f['segment'][_0x316beb(0x379)](_0x505224),{'verbose':_0x493cc6[_0x316beb(0x399)]}),_0x49b69e=_0x1d9208[_0x316beb(0x1b3)],_0xda9dc2=_0x142b1f[_0x316beb(0x348)][_0x316beb(0x27c)](_0x49b69e);if(_0x1a1619[_0x316beb(0x1e3)]){const _0xb88f4b=await this[_0x316beb(0x29b)](_0x551c58,_0x505224,_0x49b69e,_0xda9dc2),_0x283a68=this[_0x316beb(0x28d)](_0xb88f4b);writeFileSync(_0x1a1619[_0x316beb(0x1e3)],_0x283a68);const _0x1fcb5b=_0xb88f4b['customers'][_0x316beb(0x1e4)][_0x316beb(0x2bf)]+_0xb88f4b['behaviors'][_0x316beb(0x373)]((_0x24867e,_0x4abef1)=>_0x24867e+_0x4abef1['columns'][_0x316beb(0x2bf)],0x0),_0xb3faef=_0xb88f4b[_0x316beb(0x22a)][_0x316beb(0x21f)](_0x59b60d=>_0x59b60d[_0x316beb(0x1e4)][_0x316beb(0x2bf)]===0x0)[_0x316beb(0x2bf)];return console[_0x316beb(0x322)](_0x316beb(0x1f4)+_0x1a1619[_0x316beb(0x1e3)]),console['log'](_0x316beb(0x241)+_0xda9dc2),console[_0x316beb(0x322)](_0x316beb(0x288)+_0xb88f4b[_0x316beb(0x22a)][_0x316beb(0x2bf)]+_0x316beb(0x2da)),console[_0x316beb(0x322)](_0x316beb(0x1ed)+_0x1fcb5b+_0x316beb(0x1e9)),_0xb3faef>0x0&&console[_0x316beb(0x322)](_0x316beb(0x279)+_0xb3faef+_0x316beb(0x35a)),0x0;}console['error']('\x0a'+a31_0x54e267[_0x316beb(0x39d)]('Output\x20Database:')+'\x20'+a31_0x54e267['cyan'](_0xda9dc2));const _0x390f90=await withSpinner(_0x316beb(0x395),()=>_0x142b1f[_0x316beb(0x348)][_0x316beb(0x30f)](_0x49b69e),{'verbose':_0x493cc6[_0x316beb(0x399)]});console[_0x316beb(0x344)]('\x0a'+a31_0x54e267['bold']('customers')+'\x20'+a31_0x54e267[_0x316beb(0x285)]('('+_0xda9dc2+_0x316beb(0x393)));const _0x479027=await executeSchemaQuery(_0x390f90[_0x316beb(0x1b3)],_0x142b1f,_0x493cc6);await handleQueryOutput(_0x479027,_0x493cc6);const _0x138812=await withSpinner(_0x316beb(0x1b8),()=>_0x142b1f[_0x316beb(0x348)][_0x316beb(0x34c)](_0x49b69e),{'verbose':_0x493cc6[_0x316beb(0x399)]});for(const _0x17a63b of _0x138812[_0x316beb(0x1b3)]){const _0x323b79='behavior_'+_0x17a63b[_0x316beb(0x255)]()[_0x316beb(0x376)](/\s+/g,'_'),_0x279664='SELECT\x20*\x20FROM\x20'+_0xda9dc2+'.'+_0x323b79;console['error']('\x0a'+a31_0x54e267[_0x316beb(0x39d)](_0x17a63b)+'\x20'+a31_0x54e267['dim']('('+_0xda9dc2+'.'+_0x323b79+')'));try{const _0x53aa6a=await executeSchemaQuery(_0x279664,_0x142b1f,_0x493cc6);await handleQueryOutput(_0x53aa6a,_0x493cc6);}catch{console[_0x316beb(0x344)](a31_0x54e267[_0x316beb(0x366)](_0x316beb(0x334)));}}return 0x0;}async[a31_0x5137f5(0x29b)](_0x569390,_0x4c21bc,_0x38b03f,_0x135e08){const _0x4e3391=a31_0x5137f5,{options:_0x5cde12,tdx:_0x1377c8}=_0x569390,_0x2a392c=await withSpinner(_0x4e3391(0x395),()=>_0x1377c8[_0x4e3391(0x348)][_0x4e3391(0x30f)](_0x38b03f),{'verbose':_0x5cde12[_0x4e3391(0x399)]}),_0x2b1e22=await executeSchemaQuery(_0x2a392c[_0x4e3391(0x1b3)],_0x1377c8,_0x5cde12),_0x5cf027=_0x2b1e22['data'][_0x4e3391(0x337)](_0x3a03f6=>({'name':_0x3a03f6[_0x4e3391(0x2df)],'type':_0x3a03f6['column_type']})),_0x45d93b=await withSpinner(_0x4e3391(0x1b8),()=>_0x1377c8[_0x4e3391(0x348)]['getBehaviorNames'](_0x38b03f),{'verbose':_0x5cde12[_0x4e3391(0x399)]}),_0x48e308=[];for(const _0xc1f031 of _0x45d93b[_0x4e3391(0x1b3)]){const _0x3b2dfa=_0x4e3391(0x2be)+_0xc1f031[_0x4e3391(0x255)]()[_0x4e3391(0x376)](/\s+/g,'_'),_0xd1fa78=_0x4e3391(0x2aa)+_0x135e08+'.'+_0x3b2dfa;let _0x3f979b=[];try{const _0x4380d5=await executeSchemaQuery(_0xd1fa78,_0x1377c8,_0x5cde12);_0x3f979b=_0x4380d5[_0x4e3391(0x1b3)][_0x4e3391(0x337)](_0x9bc2dc=>({'name':_0x9bc2dc['column_name'],'type':_0x9bc2dc[_0x4e3391(0x2b6)]}));}catch{}_0x48e308[_0x4e3391(0x2fb)]({'table':_0x3b2dfa,'columns':_0x3f979b});}return{'database':_0x135e08,'parent_segment':_0x4c21bc,'parent_id':_0x38b03f,'customers':{'table':'customers','columns':_0x5cf027},'behaviors':_0x48e308};}[a31_0x5137f5(0x28d)](_0x16673e){const _0x1c06db=a31_0x5137f5,_0x34c1e3=_0x277d5a=>{const _0x3e46bd=a31_0x4566;if(_0x277d5a['length']===0x0)return'[]';const _0x363543=_0x277d5a[_0x3e46bd(0x337)](_0x42e256=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x42e256[_0x3e46bd(0x21d)]+_0x3e46bd(0x394)+_0x42e256[_0x3e46bd(0x1bf)]+_0x3e46bd(0x316));return'[\x0a'+_0x363543[_0x3e46bd(0x2e7)](',\x0a')+_0x3e46bd(0x3ae);},_0x3fb132=_0x16673e[_0x1c06db(0x22a)]['map'](_0x1886a1=>{const _0x2d820f=_0x1c06db;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x1886a1[_0x2d820f(0x1d8)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x34c1e3(_0x1886a1[_0x2d820f(0x1e4)])[_0x2d820f(0x376)](/^/gm,'\x20\x20')[_0x2d820f(0x2a5)]()+_0x2d820f(0x259);})['join'](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x16673e['database']+_0x1c06db(0x1c3)+_0x16673e[_0x1c06db(0x32c)]+_0x1c06db(0x375)+_0x16673e['parent_id']+_0x1c06db(0x2eb)+_0x16673e[_0x1c06db(0x231)][_0x1c06db(0x1d8)]+_0x1c06db(0x291)+_0x34c1e3(_0x16673e[_0x1c06db(0x231)][_0x1c06db(0x1e4)])[_0x1c06db(0x376)](/^/gm,'\x20\x20')[_0x1c06db(0x2a5)]()+_0x1c06db(0x331)+_0x3fb132+_0x1c06db(0x2ff);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x5137f5(0x21d)]='segment:parent:sql';[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x261);async['execute'](_0x4da896){const _0xb3dde1=a31_0x5137f5,{options:_0x14a9c1,args:_0x1e80f2,tdx:_0x3f2bab}=_0x4da896,_0x3581a1=_0x1e80f2[0x0]||_0x14a9c1[_0xb3dde1(0x1b1)];if(!_0x3581a1)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'+_0xb3dde1(0x237)),0x1;_0x14a9c1['verbose']&&(console['error'](_0xb3dde1(0x340)+_0x14a9c1[_0xb3dde1(0x2d6)]),console['error'](_0xb3dde1(0x203)+_0x3581a1));const _0xd5b49f=await withSpinner(_0xb3dde1(0x327)+_0x3581a1+'\x27...',()=>_0x3f2bab[_0xb3dde1(0x348)][_0xb3dde1(0x379)](_0x3581a1),{'verbose':_0x14a9c1['verbose']}),_0x2d413c=_0xd5b49f[_0xb3dde1(0x1b3)],_0x355396=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x3581a1+_0xb3dde1(0x1e1),()=>_0x3f2bab[_0xb3dde1(0x348)][_0xb3dde1(0x30f)](_0x2d413c),{'verbose':_0x14a9c1[_0xb3dde1(0x399)]}),_0x16194c=_0x355396[_0xb3dde1(0x1b3)];return _0x14a9c1[_0xb3dde1(0x25d)]===_0xb3dde1(0x1d3)||_0x14a9c1[_0xb3dde1(0x25d)]===_0xb3dde1(0x245)?await handleSDKOutput([{'sql':_0x16194c}],_0x14a9c1):console['log'](_0x16194c),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x2e0);[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x1c4);async[a31_0x5137f5(0x361)](_0x2c9c25){const _0xdd5121=a31_0x5137f5,{options:_0xab963b,args:_0x1a559b,tdx:_0x44b9b1}=_0x2c9c25,_0x5c9af4=_0x1a559b[0x0]||_0xab963b[_0xdd5121(0x1b1)];if(!_0x5c9af4)return showParentSegmentNotSetError(_0xdd5121(0x22d)+'\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;_0xab963b[_0xdd5121(0x399)]&&(console[_0xdd5121(0x344)](_0xdd5121(0x340)+_0xab963b[_0xdd5121(0x2d6)]),console[_0xdd5121(0x344)]('Parent\x20segment:\x20'+_0x5c9af4));const _0x1219d0=await withSpinner(_0xdd5121(0x327)+_0x5c9af4+_0xdd5121(0x1e1),()=>_0x44b9b1[_0xdd5121(0x348)][_0xdd5121(0x379)](_0x5c9af4),{'verbose':_0xab963b[_0xdd5121(0x399)]}),_0x17efdf=_0x1219d0['data'],_0x24cc51=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x5c9af4+_0xdd5121(0x1e1),()=>_0x44b9b1[_0xdd5121(0x348)][_0xdd5121(0x30f)](_0x17efdf),{'verbose':_0xab963b[_0xdd5121(0x399)]});let _0x58d7a2=_0x24cc51[_0xdd5121(0x1b3)];const _0x5a24ee=resolveLimit(_0xab963b['limit'],DEFAULT_DISPLAY_LIMIT),_0x149641=/\bLIMIT\s+\d+/i[_0xdd5121(0x3af)](_0x58d7a2);!_0x149641&&(_0x58d7a2=_0x58d7a2[_0xdd5121(0x2a5)]()[_0xdd5121(0x376)](/;+$/,''),_0x58d7a2='SELECT\x20*\x20FROM\x20(\x0a'+_0x58d7a2+_0xdd5121(0x1d6)+_0x5a24ee);_0xab963b['verbose']&&console[_0xdd5121(0x344)]('SQL\x20query:\x0a'+_0x58d7a2);const _0x45a204=await withProgressSpinner(_0xdd5121(0x312),async _0x1a2672=>{const _0x5d2255=_0xdd5121,_0xce70ed=await _0x44b9b1[_0x5d2255(0x2c1)][_0x5d2255(0x361)](_0x58d7a2,{'catalog':'td','schema':_0x5d2255(0x2ad),'onJobId':_0x583fc1=>{const _0x1ff516=_0x5d2255;_0x1a2672[_0x1ff516(0x226)](_0x583fc1);}});return _0xce70ed;},{'verbose':_0xab963b[_0xdd5121(0x399)]}),_0x4bd86d=_0x45a204['data'],_0x539174=_0x4bd86d[_0xdd5121(0x380)]?_0xdd5121(0x3a3)+_0x4bd86d['jobId']+']':'';return console[_0xdd5121(0x344)](_0xdd5121(0x1eb)+_0x4bd86d['stats'][_0xdd5121(0x347)]['toLocaleString']()+_0xdd5121(0x1b9)+('in\x20'+formatElapsed(_0x4bd86d[_0xdd5121(0x2d9)][_0xdd5121(0x2a8)])+_0x539174)),await handleQueryOutput(_0x4bd86d,_0xab963b),0x0;}}export class PSRtListCommand extends BaseCommand{['name']=a31_0x5137f5(0x247);[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x27d);async['execute'](_0x5de1a4){const _0x939767=a31_0x5137f5,{options:_0x57f11b,args:_0x2c9243,tdx:_0x3473db}=_0x5de1a4,_0x244103=_0x2c9243[0x0],_0x4cca31=await withSpinner(_0x244103?_0x939767(0x294)+_0x244103+_0x939767(0x1e1):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x3473db[_0x939767(0x1c9)]['list'](),{'verbose':_0x57f11b['verbose']});let _0x343524=_0x4cca31['data'][_0x939767(0x21f)](_0x15ba6c=>_0x15ba6c[_0x939767(0x2d2)]);if(_0x244103){const _0x52885f=_0x244103[_0x939767(0x376)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x939767(0x376)](/\?/g,'.'),_0x81ff02=new RegExp('^'+_0x52885f+'$','i');_0x343524=_0x343524[_0x939767(0x21f)](_0x3f82c3=>_0x81ff02[_0x939767(0x3af)](_0x3f82c3['name']));}_0x343524[_0x939767(0x1fa)]((_0x1abaac,_0x4ed90c)=>_0x1abaac[_0x939767(0x21d)][_0x939767(0x208)](_0x4ed90c['name'])),console[_0x939767(0x344)]('✔\x20Found\x20'+_0x343524[_0x939767(0x2bf)]+_0x939767(0x350)+(_0x343524[_0x939767(0x2bf)]!==0x1?'s':''));const _0x29fdac=_0x5eab7a=>{const _0x57e00f=_0x939767;return getConsoleNextUrl(_0x57f11b[_0x57e00f(0x2d6)],_0x57e00f(0x2fe)+_0x5eab7a);};if(_0x57f11b[_0x939767(0x25d)]===_0x939767(0x1d3)||_0x57f11b[_0x939767(0x25d)]==='jsonl'){const _0x2e8e7b=_0x343524['map'](_0x4dc9f2=>({..._0x4dc9f2,'url':_0x29fdac(_0x4dc9f2['id'])}));await handleSDKOutput(_0x2e8e7b,_0x57f11b);}else{if(_0x343524['length']===0x0)console['log'](_0x939767(0x31d));else for(const _0x347286 of _0x343524){const _0x5df0b4=_0x347286[_0x939767(0x254)]?a31_0x54e267[_0x939767(0x285)]('\x20('+formatRows(_0x347286[_0x939767(0x254)])+')'):'',_0x491643=hyperlink(_0x347286[_0x939767(0x21d)],_0x29fdac(_0x347286['id']));console[_0x939767(0x322)]('⚡\x20'+_0x491643+_0x5df0b4);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x273);[a31_0x5137f5(0x28a)]='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a31_0x5137f5(0x361)](_0x8b7c95){const _0x40c9e7=a31_0x5137f5,{options:_0x5223cc,args:_0xfbee9b,tdx:_0x3a6ed1}=_0x8b7c95,_0xf54f29=_0xfbee9b[0x0]||_0x5223cc['parentSegment'];if(!_0xf54f29)return showParentSegmentNotSetError(_0x40c9e7(0x3b7)+_0x40c9e7(0x2f8)),0x1;const _0x39b7b=resolveYamlFile(_0xf54f29);if(!existsSync(_0x39b7b))return showFileNotFoundError(_0x39b7b,_0xf54f29),0x1;let _0x33712b;try{_0x33712b=readFileSync(_0x39b7b,'utf-8');}catch(_0x33efee){const _0x474cb9=_0x33efee instanceof Error?_0x33efee[_0x40c9e7(0x305)]:String(_0x33efee);return console[_0x40c9e7(0x344)](_0x40c9e7(0x32f)+_0x474cb9),0x1;}const _0x856794=createCommandSpinner(a31_0x54e267['dim'](_0x40c9e7(0x2a6)),{'verbose':_0x5223cc[_0x40c9e7(0x399)]});_0x856794['start']();const _0x3aa0e1={'realtime':!![],'onProgress':_0x5396f7=>{_0x856794['text']=formatProgressMessage(_0x5396f7);}};let _0x130d18;try{_0x130d18=await _0x3a6ed1[_0x40c9e7(0x348)][_0x40c9e7(0x253)](_0x33712b,_0x3aa0e1),_0x856794[_0x40c9e7(0x38b)]();}catch(_0x5d076f){_0x856794[_0x40c9e7(0x38b)]();throw _0x5d076f;}console[_0x40c9e7(0x344)]('\x0a'+a31_0x54e267['bold'](_0x40c9e7(0x2ba))+'\x20'+_0x130d18[_0x40c9e7(0x21d)]),console[_0x40c9e7(0x344)]('═'[_0x40c9e7(0x329)](0x3c)),displayRealtimeValidation(_0x130d18),console[_0x40c9e7(0x344)]('─'['repeat'](0x3c));if(_0x130d18['errors'][_0x40c9e7(0x2bf)]>0x0){console[_0x40c9e7(0x344)]('\x0a'+a31_0x54e267[_0x40c9e7(0x1f2)]('Errors:'));for(const _0x275e88 of _0x130d18['errors']){console['error']('\x20\x20'+a31_0x54e267[_0x40c9e7(0x1f2)]('•')+'\x20'+_0x275e88);}}return _0x130d18['allValid']&&console[_0x40c9e7(0x344)]('\x0a'+a31_0x54e267['green']('✔')+_0x40c9e7(0x36c)),_0x130d18['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x1cd);[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x2af);async[a31_0x5137f5(0x361)](_0x48089c){const _0x2ebda6=a31_0x5137f5,{options:_0x3ca359,args:_0x1260d3,tdx:_0x4f809c}=_0x48089c,_0x1cb4cb=_0x1260d3[0x0]||_0x3ca359[_0x2ebda6(0x1b1)];if(!_0x1cb4cb)return showParentSegmentNotSetError(_0x2ebda6(0x2e2)+_0x2ebda6(0x368)),0x1;_0x3ca359[_0x2ebda6(0x399)]&&(console['error'](_0x2ebda6(0x340)+_0x3ca359[_0x2ebda6(0x2d6)]),console['error'](_0x2ebda6(0x203)+_0x1cb4cb));const _0x41773d=await withSpinner(_0x2ebda6(0x327)+_0x1cb4cb+_0x2ebda6(0x1e1),()=>_0x4f809c['segment'][_0x2ebda6(0x379)](_0x1cb4cb),{'verbose':_0x3ca359[_0x2ebda6(0x399)]}),_0xc4fc58=_0x41773d[_0x2ebda6(0x1b3)],_0x7db8e=await withSpinner(_0x2ebda6(0x2b0)+_0x1cb4cb+'\x27...',()=>_0x4f809c['realtime'][_0x2ebda6(0x2d8)](_0xc4fc58),{'verbose':_0x3ca359[_0x2ebda6(0x399)]}),_0x53abd9=_0x7db8e[_0x2ebda6(0x1b3)];console[_0x2ebda6(0x344)](_0x2ebda6(0x320)+_0x53abd9['length']+_0x2ebda6(0x26d)+(_0x53abd9[_0x2ebda6(0x2bf)]!==0x1?'s':''));if(_0x3ca359[_0x2ebda6(0x25d)]===_0x2ebda6(0x1d3)||_0x3ca359['format']===_0x2ebda6(0x245))await handleSDKOutput(_0x53abd9,_0x3ca359);else{if(_0x53abd9['length']===0x0)console[_0x2ebda6(0x322)](_0x2ebda6(0x2ec));else for(const _0x4883c5 of _0x53abd9){const _0xeaa726=_0x4883c5['state']==='launched'?'🚀':'📝',_0x17cb95=_0x4883c5['paused']?a31_0x54e267['yellow']('\x20(paused)'):'',_0x34daef=a31_0x54e267[_0x2ebda6(0x285)]('\x20('+_0x4883c5[_0x2ebda6(0x387)]+_0x2ebda6(0x26b)+(_0x4883c5['stageCount']!==0x1?'s':'')+')');console[_0x2ebda6(0x322)](_0xeaa726+'\x20'+_0x4883c5[_0x2ebda6(0x21d)]+_0x17cb95+_0x34daef);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{['name']=a31_0x5137f5(0x228);['description']='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x5137f5(0x361)](_0x204931){const _0x1d2955=a31_0x5137f5,{options:_0x209677,args:_0xb25930,tdx:_0x5a06c6}=_0x204931,_0x3ba79e=_0xb25930[0x0];if(!_0x3ba79e)return console[_0x1d2955(0x344)](a31_0x54e267[_0x1d2955(0x1f2)](_0x1d2955(0x335))),console['error'](_0x1d2955(0x29d)),console[_0x1d2955(0x344)](a31_0x54e267[_0x1d2955(0x285)](_0x1d2955(0x2ac))),0x1;_0x209677[_0x1d2955(0x399)]&&(console[_0x1d2955(0x344)](_0x1d2955(0x340)+_0x209677[_0x1d2955(0x2d6)]),console[_0x1d2955(0x344)](_0x1d2955(0x298)+_0x3ba79e));const _0x37f5f7=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x3ba79e+_0x1d2955(0x1e1),()=>_0x5a06c6['realtime'][_0x1d2955(0x1ef)](_0x3ba79e),{'verbose':_0x209677['verbose']}),_0x7814d1=_0x37f5f7[_0x1d2955(0x1b3)];console[_0x1d2955(0x344)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x7814d1[_0x1d2955(0x21d)]+'\x27');if(_0x209677['format']==='json'||_0x209677['format']===_0x1d2955(0x245))await handleSDKOutput([_0x7814d1],_0x209677);else{const _0x1074a0=_0x7814d1[_0x1d2955(0x268)]===_0x1d2955(0x2f7)?'🚀':'📝',_0xd00653=_0x7814d1[_0x1d2955(0x2e4)]?a31_0x54e267['yellow'](_0x1d2955(0x35d)):'';console[_0x1d2955(0x322)](_0x1074a0+'\x20'+_0x7814d1[_0x1d2955(0x21d)]+_0xd00653);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x1b5);[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x2a7);async['execute'](_0x13ae77){const _0x218909=a31_0x5137f5,{options:_0x5d6f47,args:_0x3268c9,tdx:_0x3fa883}=_0x13ae77,_0x12d057=_0x3268c9[0x0];if(!_0x12d057)return console['error'](a31_0x54e267[_0x218909(0x1f2)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x218909(0x344)](_0x218909(0x2d4)),console[_0x218909(0x344)](a31_0x54e267[_0x218909(0x285)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x5d6f47[_0x218909(0x399)]&&(console[_0x218909(0x344)](_0x218909(0x340)+_0x5d6f47[_0x218909(0x2d6)]),console[_0x218909(0x344)]('RT\x20Journey\x20ID:\x20'+_0x12d057));const _0x51626f=await withSpinner(_0x218909(0x280)+_0x12d057+_0x218909(0x1e1),()=>_0x3fa883[_0x218909(0x1c9)]['resumeJourney'](_0x12d057),{'verbose':_0x5d6f47[_0x218909(0x399)]}),_0x4f9d58=_0x51626f[_0x218909(0x1b3)];console[_0x218909(0x344)](_0x218909(0x230)+_0x4f9d58[_0x218909(0x21d)]+'\x27');if(_0x5d6f47['format']===_0x218909(0x1d3)||_0x5d6f47[_0x218909(0x25d)]==='jsonl')await handleSDKOutput([_0x4f9d58],_0x5d6f47);else{const _0xb8baad=_0x4f9d58[_0x218909(0x268)]===_0x218909(0x2f7)?'🚀':'📝',_0xe7af9a=_0x4f9d58[_0x218909(0x2e4)]?a31_0x54e267[_0x218909(0x366)](_0x218909(0x35d)):'';console[_0x218909(0x322)](_0xb8baad+'\x20'+_0x4f9d58[_0x218909(0x21d)]+_0xe7af9a);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x5137f5(0x21d)]='ps:rt:configuration_versions';[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x251);async[a31_0x5137f5(0x361)](_0xc1aad8){const _0x5db88e=a31_0x5137f5,{options:_0x332376,args:_0x1c57d3,tdx:_0x5260f4}=_0xc1aad8,_0x127272=_0x1c57d3[0x0]||_0x332376[_0x5db88e(0x1b1)];if(!_0x127272)return showParentSegmentNotSetError(_0x5db88e(0x3b0)+_0x5db88e(0x1da)),0x1;_0x332376[_0x5db88e(0x399)]&&(console[_0x5db88e(0x344)](_0x5db88e(0x340)+_0x332376[_0x5db88e(0x2d6)]),console[_0x5db88e(0x344)](_0x5db88e(0x203)+_0x127272));const _0x38e3e5=await withSpinner(_0x5db88e(0x327)+_0x127272+_0x5db88e(0x1e1),()=>_0x5260f4[_0x5db88e(0x348)][_0x5db88e(0x379)](_0x127272),{'verbose':_0x332376[_0x5db88e(0x399)]}),_0x4a0338=_0x38e3e5[_0x5db88e(0x1b3)],_0x297052=await withSpinner(_0x5db88e(0x303)+_0x127272+_0x5db88e(0x1e1),()=>_0x5260f4['realtime'][_0x5db88e(0x25f)](_0x4a0338),{'verbose':_0x332376['verbose']}),_0x163715=_0x297052[_0x5db88e(0x1b3)];return console[_0x5db88e(0x344)](_0x5db88e(0x29c)),_0x332376[_0x5db88e(0x25d)]==='json'||_0x332376['format']==='jsonl'?await handleSDKOutput([_0x163715],_0x332376):(console[_0x5db88e(0x322)](_0x5db88e(0x21b)+_0x163715['id']),console[_0x5db88e(0x322)](_0x5db88e(0x2c2)+_0x163715[_0x5db88e(0x310)]),console[_0x5db88e(0x322)]('identifier:\x20'+_0x163715[_0x5db88e(0x236)]),console[_0x5db88e(0x322)]('eventKind:\x20'+_0x163715[_0x5db88e(0x1cc)]),console[_0x5db88e(0x322)]('status:\x20'+_0x163715[_0x5db88e(0x28f)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x300);['description']=a31_0x5137f5(0x23c);async[a31_0x5137f5(0x361)](_0x217219){const _0x4e15a9=a31_0x5137f5,{options:_0x384952,args:_0x424010,tdx:_0x6fa6a3}=_0x217219,_0x310f2f=_0x424010[0x0]||_0x384952[_0x4e15a9(0x1b1)];if(!_0x310f2f)return showParentSegmentNotSetError(_0x4e15a9(0x33d)+_0x4e15a9(0x36d)),0x1;const _0x505293=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x310f2f+_0x4e15a9(0x1e1),()=>_0x6fa6a3['segment'][_0x4e15a9(0x379)](_0x310f2f),{'verbose':_0x384952[_0x4e15a9(0x399)]}),_0x5dd9b7=_0x505293[_0x4e15a9(0x1b3)],_0x2a344a=await withSpinner(_0x4e15a9(0x382)+_0x310f2f+_0x4e15a9(0x1e1),()=>_0x6fa6a3[_0x4e15a9(0x1d1)][_0x4e15a9(0x1ca)](_0x5dd9b7),{'verbose':_0x384952[_0x4e15a9(0x399)]}),_0x4fe15f=_0x2a344a['data'];console['error'](_0x4e15a9(0x320)+_0x4fe15f[_0x4e15a9(0x2bf)]+_0x4e15a9(0x2f0)+(_0x4fe15f[_0x4e15a9(0x2bf)]!==0x1?'s':''));if(_0x384952[_0x4e15a9(0x25d)]===_0x4e15a9(0x1d3)||_0x384952[_0x4e15a9(0x25d)]===_0x4e15a9(0x245))await handleSDKOutput(_0x4fe15f,_0x384952);else{if(_0x4fe15f[_0x4e15a9(0x2bf)]===0x0)console[_0x4e15a9(0x322)](_0x4e15a9(0x256)),console[_0x4e15a9(0x344)](a31_0x54e267[_0x4e15a9(0x385)](_0x4e15a9(0x21e)));else for(const _0x435da6 of _0x4fe15f){console['log'](a31_0x54e267['bold'](_0x435da6[_0x4e15a9(0x21d)])+'\x20'+a31_0x54e267[_0x4e15a9(0x285)](_0x4e15a9(0x39b)+_0x435da6['id']+')'));_0x435da6[_0x4e15a9(0x28a)]&&console['log']('\x20\x20'+a31_0x54e267[_0x4e15a9(0x285)](_0x435da6['description']));if(_0x435da6[_0x4e15a9(0x290)]&&_0x435da6[_0x4e15a9(0x290)][_0x4e15a9(0x2bf)]>0x0)for(const _0x46ae64 of _0x435da6[_0x4e15a9(0x290)]){const _0x1d0f10=_0x46ae64[_0x4e15a9(0x229)]?.[_0x4e15a9(0x2bf)]?_0x46ae64[_0x4e15a9(0x229)][_0x4e15a9(0x2e7)](',\x20'):'any';console['log']('\x20\x20'+a31_0x54e267[_0x4e15a9(0x385)]('token:')+'\x20'+_0x46ae64[_0x4e15a9(0x21d)]+'\x20'+a31_0x54e267[_0x4e15a9(0x285)](_0x4e15a9(0x39b)+_0x46ae64['id']+')')),console[_0x4e15a9(0x322)](_0x4e15a9(0x2f9)+a31_0x54e267[_0x4e15a9(0x285)]('allowed\x20IPs:')+'\x20'+_0x1d0f10);}else console[_0x4e15a9(0x322)]('\x20\x20'+a31_0x54e267[_0x4e15a9(0x285)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{['name']='ps:pz:service:create';[a31_0x5137f5(0x28a)]='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async[a31_0x5137f5(0x361)](_0x2f2aeb){const _0x511a34=a31_0x5137f5,{options:_0x351e29,args:_0x5a64b5,tdx:_0x74c4d3}=_0x2f2aeb,_0x117c78=_0x351e29,_0x4f9bd0=_0x5a64b5[0x0],_0x3273cc=_0x5a64b5[0x1]||_0x351e29[_0x511a34(0x1b1)];if(!_0x4f9bd0)return console['error'](_0x511a34(0x2fd)),console[_0x511a34(0x344)](_0x511a34(0x246)),console[_0x511a34(0x344)](_0x511a34(0x3ca)),0x1;if(!_0x3273cc)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0x511a34(0x3ca)),0x1;const _0x9fac58=await withSpinner(_0x511a34(0x327)+_0x3273cc+_0x511a34(0x1e1),()=>_0x74c4d3[_0x511a34(0x348)][_0x511a34(0x379)](_0x3273cc),{'verbose':_0x351e29['verbose']}),_0x4f4293=_0x9fac58[_0x511a34(0x1b3)],_0x5e3e5b={'name':_0x4f9bd0,'description':_0x117c78['description'],'public':_0x117c78['public']},_0x2289fa=await withSpinner(_0x511a34(0x240)+_0x4f9bd0+'\x27...',()=>_0x74c4d3[_0x511a34(0x1d1)][_0x511a34(0x1bc)](_0x4f4293,_0x5e3e5b),{'verbose':_0x351e29[_0x511a34(0x399)]}),_0x341ffd=_0x2289fa[_0x511a34(0x1b3)];return console['error'](_0x511a34(0x39e)+_0x341ffd[_0x511a34(0x21d)]+_0x511a34(0x353)+_0x341ffd['id']),await handleSDKOutput([_0x341ffd],_0x351e29),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x318);['description']=a31_0x5137f5(0x2a1);async[a31_0x5137f5(0x361)](_0x535671){const _0x1ba8e8=a31_0x5137f5,{options:_0x2721b3,args:_0x1a9ba5,tdx:_0xd4fb28}=_0x535671,_0x2e4ad0=_0x1a9ba5[0x0],_0x4fb50e=_0x1a9ba5[0x1]||_0x2721b3['parentSegment'];if(!_0x2e4ad0)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console[_0x1ba8e8(0x344)](_0x1ba8e8(0x248)),console[_0x1ba8e8(0x344)](_0x1ba8e8(0x346)),0x1;if(!_0x4fb50e)return showParentSegmentNotSetError(_0x1ba8e8(0x3a5)+_0x1ba8e8(0x346)),0x1;const _0x46a1e5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4fb50e+_0x1ba8e8(0x1e1),()=>_0xd4fb28['segment'][_0x1ba8e8(0x379)](_0x4fb50e),{'verbose':_0x2721b3['verbose']}),_0xf6d48f=_0x46a1e5[_0x1ba8e8(0x1b3)],_0x1d26a7=await withSpinner(_0x1ba8e8(0x2b2)+_0x2e4ad0+_0x1ba8e8(0x1e1),()=>_0xd4fb28[_0x1ba8e8(0x1d1)][_0x1ba8e8(0x371)](_0xf6d48f,_0x2e4ad0),{'verbose':_0x2721b3[_0x1ba8e8(0x399)]}),_0x3cf2c2=_0x1d26a7[_0x1ba8e8(0x1b3)];if(_0x2721b3[_0x1ba8e8(0x1d3)]||_0x2721b3[_0x1ba8e8(0x245)])await handleSDKOutput([_0x3cf2c2],_0x2721b3);else{console[_0x1ba8e8(0x322)](a31_0x54e267[_0x1ba8e8(0x39d)](_0x3cf2c2['name'])+'\x20'+a31_0x54e267['dim'](_0x1ba8e8(0x39b)+_0x3cf2c2['id']+')'));_0x3cf2c2[_0x1ba8e8(0x28a)]&&console['log']('\x20\x20'+a31_0x54e267[_0x1ba8e8(0x285)](_0x3cf2c2[_0x1ba8e8(0x28a)]));console[_0x1ba8e8(0x322)]('\x20\x20'+a31_0x54e267['cyan'](_0x1ba8e8(0x3b9))+'\x20'+(_0x3cf2c2['public']?_0x1ba8e8(0x267):'no'));if(_0x3cf2c2[_0x1ba8e8(0x290)]&&_0x3cf2c2[_0x1ba8e8(0x290)]['length']>0x0)for(const _0x3a64d1 of _0x3cf2c2[_0x1ba8e8(0x290)]){const _0x59b2a3=_0x3a64d1[_0x1ba8e8(0x229)]?.[_0x1ba8e8(0x2bf)]?_0x3a64d1['allowedIps']['join'](',\x20'):_0x1ba8e8(0x32e);console['log']('\x20\x20'+a31_0x54e267[_0x1ba8e8(0x385)](_0x1ba8e8(0x30b))+'\x20'+_0x3a64d1[_0x1ba8e8(0x21d)]+'\x20'+a31_0x54e267[_0x1ba8e8(0x285)](_0x1ba8e8(0x39b)+_0x3a64d1['id']+')')),console[_0x1ba8e8(0x322)](_0x1ba8e8(0x2f9)+a31_0x54e267['dim'](_0x1ba8e8(0x1c0))+'\x20'+_0x59b2a3);}else console[_0x1ba8e8(0x322)]('\x20\x20'+a31_0x54e267['dim'](_0x1ba8e8(0x22f)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']=a31_0x5137f5(0x2c5);['description']=a31_0x5137f5(0x1b4);async[a31_0x5137f5(0x361)](_0x13a833){const _0x5175d7=a31_0x5137f5,{options:_0x36651d,args:_0x424af5,tdx:_0x1a5794}=_0x13a833,_0x5ac5f8=_0x424af5[0x0],_0x5732db=_0x424af5[0x1]||_0x36651d[_0x5175d7(0x1b1)];if(!_0x5ac5f8)return console['error'](_0x5175d7(0x2f4)),console[_0x5175d7(0x344)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x5175d7(0x344)](_0x5175d7(0x284)),0x1;if(!_0x5732db)return showParentSegmentNotSetError(_0x5175d7(0x315)+_0x5175d7(0x284)),0x1;const _0x39896a=await withSpinner(_0x5175d7(0x327)+_0x5732db+'\x27...',()=>_0x1a5794[_0x5175d7(0x348)][_0x5175d7(0x379)](_0x5732db),{'verbose':_0x36651d[_0x5175d7(0x399)]}),_0x538b05=_0x39896a[_0x5175d7(0x1b3)];return await withSpinner(_0x5175d7(0x29f)+_0x5ac5f8+_0x5175d7(0x1e1),()=>_0x1a5794[_0x5175d7(0x1d1)][_0x5175d7(0x1d4)](_0x538b05,_0x5ac5f8),{'verbose':_0x36651d['verbose']}),console[_0x5175d7(0x344)](_0x5175d7(0x1c7)+_0x5ac5f8+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x5137f5(0x21d)]='ps:pz:service:update';['description']='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x5137f5(0x361)](_0x4c1ebd){const _0x1c04b3=a31_0x5137f5,{options:_0x381d1d,args:_0x39ec9f,tdx:_0x3dd3f4}=_0x4c1ebd,_0x380073=_0x381d1d,_0x16170a=_0x39ec9f[0x0],_0x539178=_0x39ec9f[0x1]||_0x381d1d[_0x1c04b3(0x1b1)];if(!_0x16170a)return console[_0x1c04b3(0x344)](_0x1c04b3(0x2f4)),console[_0x1c04b3(0x344)](_0x1c04b3(0x221)),console[_0x1c04b3(0x344)](_0x1c04b3(0x37b)),0x1;if(!_0x380073[_0x1c04b3(0x21d)])return console[_0x1c04b3(0x344)](_0x1c04b3(0x37f)),console[_0x1c04b3(0x344)](_0x1c04b3(0x221)),0x1;if(!_0x539178)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x1d1686=await withSpinner(_0x1c04b3(0x327)+_0x539178+_0x1c04b3(0x1e1),()=>_0x3dd3f4['segment']['resolveParentId'](_0x539178),{'verbose':_0x381d1d[_0x1c04b3(0x399)]}),_0x3e4dbf=_0x1d1686[_0x1c04b3(0x1b3)],_0x440607={'name':_0x380073[_0x1c04b3(0x21d)]};_0x380073[_0x1c04b3(0x28a)]!==undefined&&(_0x440607[_0x1c04b3(0x28a)]=_0x380073[_0x1c04b3(0x28a)]);const _0x3e47b9=await withSpinner('Updating\x20personalization\x20service\x20\x27'+_0x16170a+_0x1c04b3(0x1e1),()=>_0x3dd3f4['personalization']['patch'](_0x3e4dbf,_0x16170a,_0x440607),{'verbose':_0x381d1d['verbose']}),_0x133f66=_0x3e47b9[_0x1c04b3(0x1b3)];return console[_0x1c04b3(0x344)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x133f66[_0x1c04b3(0x21d)]+'\x27'),await handleSDKOutput([_0x133f66],_0x381d1d),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x21a);[a31_0x5137f5(0x28a)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async['execute'](_0x2ed1ec){const _0x50417a=a31_0x5137f5,{options:_0x3f5de2,args:_0x18678d,tdx:_0x4b1200}=_0x2ed1ec,_0x4932e4=_0x3f5de2,_0x5b30eb=_0x18678d[0x0],_0x4b43c0=_0x18678d[0x1],_0x380a3f=_0x18678d[0x2]||_0x3f5de2[_0x50417a(0x1b1)];if(!_0x5b30eb)return console[_0x50417a(0x344)](_0x50417a(0x216)),console['error'](_0x50417a(0x27b)),console[_0x50417a(0x344)](_0x50417a(0x38e)),0x1;if(!_0x4b43c0)return console[_0x50417a(0x344)](_0x50417a(0x2f4)),console[_0x50417a(0x344)](_0x50417a(0x27b)),console[_0x50417a(0x344)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x380a3f)return showParentSegmentNotSetError(_0x50417a(0x319)+_0x50417a(0x38e)),0x1;const _0x232bc6=await withSpinner(_0x50417a(0x327)+_0x380a3f+_0x50417a(0x1e1),()=>_0x4b1200[_0x50417a(0x348)][_0x50417a(0x379)](_0x380a3f),{'verbose':_0x3f5de2['verbose']}),_0xba234c=_0x232bc6[_0x50417a(0x1b3)],_0xc8658f={'name':_0x5b30eb};_0x4932e4[_0x50417a(0x229)]&&(_0xc8658f['allowedIps']=_0x4932e4[_0x50417a(0x229)]['split'](',')[_0x50417a(0x337)](_0x588902=>_0x588902[_0x50417a(0x2a5)]()));_0x4932e4[_0x50417a(0x28a)]&&(_0xc8658f[_0x50417a(0x28a)]=_0x4932e4[_0x50417a(0x28a)]);const _0x40c4cc=await withSpinner('Creating\x20token\x20\x27'+_0x5b30eb+_0x50417a(0x31e)+_0x4b43c0+_0x50417a(0x1e1),()=>_0x4b1200['personalization'][_0x50417a(0x2e5)](_0xba234c,_0x4b43c0,_0xc8658f),{'verbose':_0x3f5de2['verbose']}),_0x2eacf1=_0x40c4cc['data'];return console[_0x50417a(0x344)](_0x50417a(0x24e)+_0x2eacf1[_0x50417a(0x21d)]+_0x50417a(0x353)+_0x2eacf1['id']),_0x2eacf1[_0x50417a(0x2c8)]&&(console[_0x50417a(0x344)](a31_0x54e267['yellow'](_0x50417a(0x35c))),console[_0x50417a(0x344)](a31_0x54e267[_0x50417a(0x385)](_0x2eacf1[_0x50417a(0x2c8)])),console[_0x50417a(0x344)]('')),await handleSDKOutput([_0x2eacf1],_0x3f5de2),0x0;}}function a31_0x4566(_0x128eb4,_0x2028d4){_0x128eb4=_0x128eb4-0x1b1;const _0x15e53e=a31_0x15e5();let _0x45668a=_0x15e53e[_0x128eb4];return _0x45668a;}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x1dc);[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x30c);async['execute'](_0x5dabc4){const _0x3cd994=a31_0x5137f5,{options:_0x3b06e1,args:_0x3214aa,tdx:_0x44e78b}=_0x5dabc4,_0x3ca766=_0x3214aa[0x0],_0x51f478=_0x3214aa[0x1]||_0x3b06e1[_0x3cd994(0x1b1)];if(!_0x3ca766)return console[_0x3cd994(0x344)](_0x3cd994(0x282)),console['error'](_0x3cd994(0x1c5)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x51f478)return showParentSegmentNotSetError(_0x3cd994(0x3c2)+_0x3cd994(0x1bd)),0x1;const _0x17142d=await withSpinner(_0x3cd994(0x327)+_0x51f478+_0x3cd994(0x1e1),()=>_0x44e78b['segment'][_0x3cd994(0x379)](_0x51f478),{'verbose':_0x3b06e1[_0x3cd994(0x399)]}),_0x221588=_0x17142d['data'],_0x246dab=await withSpinner(_0x3cd994(0x1fb),()=>_0x44e78b['personalization'][_0x3cd994(0x1ca)](_0x221588),{'verbose':_0x3b06e1['verbose']}),_0xc606e=_0x246dab[_0x3cd994(0x1b3)];let _0x2fb99a;for(const _0x8cad35 of _0xc606e){if(_0x8cad35[_0x3cd994(0x290)]?.['some'](_0x17eaea=>_0x17eaea['id']===_0x3ca766)){_0x2fb99a=_0x8cad35['id'];break;}}if(!_0x2fb99a)return console[_0x3cd994(0x344)](_0x3cd994(0x308)+_0x3ca766+_0x3cd994(0x3bf)),0x1;const _0x150c11=await withSpinner('Deleting\x20token\x20\x27'+_0x3ca766+'\x27...',()=>_0x44e78b['personalization']['deleteToken'](_0x221588,_0x2fb99a,_0x3ca766),{'verbose':_0x3b06e1[_0x3cd994(0x399)]}),_0x2cf2be=_0x150c11[_0x3cd994(0x1b3)];return console[_0x3cd994(0x344)](_0x3cd994(0x258)+(_0x2cf2be[_0x3cd994(0x21d)]||_0x3ca766)+'\x27'),await handleSDKOutput([_0x2cf2be],_0x3b06e1),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x2f5);[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x1b7);async['execute'](_0x32045e){const _0x351a0c=a31_0x5137f5,{options:_0x1bf9f2,args:_0x4080f9,tdx:_0x43ce8b}=_0x32045e,_0x2638ad=_0x4080f9[0x0]||_0x1bf9f2[_0x351a0c(0x1b1)];if(!_0x2638ad)return showParentSegmentNotSetError(_0x351a0c(0x2f6)+_0x351a0c(0x299)),0x1;const _0x22446a=await withSpinner(_0x351a0c(0x327)+_0x2638ad+_0x351a0c(0x1e1),()=>_0x43ce8b[_0x351a0c(0x348)][_0x351a0c(0x379)](_0x2638ad),{'verbose':_0x1bf9f2['verbose']}),_0x4ad1d4=_0x22446a['data'],_0x4a0d4e=await withSpinner(_0x351a0c(0x3ad)+_0x2638ad+_0x351a0c(0x1e1),()=>_0x43ce8b['personalization']['listPersonalizations'](_0x4ad1d4),{'verbose':_0x1bf9f2[_0x351a0c(0x399)]}),_0x1dec3a=_0x4a0d4e[_0x351a0c(0x1b3)];console[_0x351a0c(0x344)](_0x351a0c(0x320)+_0x1dec3a[_0x351a0c(0x2bf)]+_0x351a0c(0x20b)+(_0x1dec3a['length']!==0x1?'s':''));if(_0x1bf9f2[_0x351a0c(0x25d)]===_0x351a0c(0x1d3)||_0x1bf9f2[_0x351a0c(0x25d)]===_0x351a0c(0x245))await handleSDKOutput(_0x1dec3a,_0x1bf9f2);else{if(_0x1dec3a[_0x351a0c(0x2bf)]===0x0)console['log'](_0x351a0c(0x398));else for(const _0x279180 of _0x1dec3a){console[_0x351a0c(0x322)](a31_0x54e267[_0x351a0c(0x39d)](_0x279180[_0x351a0c(0x21d)])+'\x20'+a31_0x54e267[_0x351a0c(0x285)]('(id:\x20'+_0x279180['id']+')'));_0x279180['description']&&console[_0x351a0c(0x322)]('\x20\x20'+a31_0x54e267[_0x351a0c(0x285)](_0x279180[_0x351a0c(0x28a)]));const _0x1d56b8=_0x279180[_0x351a0c(0x28b)]?.[_0x351a0c(0x2bf)]||0x0;console['log']('\x20\x20'+a31_0x54e267[_0x351a0c(0x385)](_0x351a0c(0x26c))+'\x20'+_0x1d56b8);if(_0x279180[_0x351a0c(0x28b)]&&_0x279180[_0x351a0c(0x28b)][_0x351a0c(0x2bf)]>0x0)for(const _0x147db9 of _0x279180[_0x351a0c(0x28b)]){console[_0x351a0c(0x322)]('\x20\x20\x20\x20-\x20'+_0x147db9[_0x351a0c(0x21d)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x24d);[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x3b6);async['execute'](_0x471814){const _0x5a4813=a31_0x5137f5,{options:_0x455444,args:_0x451771,tdx:_0x5a4633}=_0x471814,_0x4f2254=_0x451771[0x0];if(!_0x4f2254)return console['error'](_0x5a4813(0x309)),console[_0x5a4813(0x344)](_0x5a4813(0x2bd)),0x1;const _0x18f9fe=await withSpinner(_0x5a4813(0x2d3)+_0x4f2254+_0x5a4813(0x1e1),()=>_0x5a4633[_0x5a4813(0x1d1)][_0x5a4813(0x341)](_0x4f2254),{'verbose':_0x455444[_0x5a4813(0x399)]}),_0x4bc76c=_0x18f9fe[_0x5a4813(0x1b3)];console['error'](_0x5a4813(0x349)+_0x4bc76c[_0x5a4813(0x21d)]+'\x27');if(_0x455444[_0x5a4813(0x25d)]===_0x5a4813(0x1d3)||_0x455444[_0x5a4813(0x25d)]==='jsonl')await handleSDKOutput([_0x4bc76c],_0x455444);else{console['log'](a31_0x54e267['bold'](_0x4bc76c[_0x5a4813(0x21d)])+'\x20'+a31_0x54e267['dim'](_0x5a4813(0x39b)+_0x4bc76c['id']+')'));_0x4bc76c[_0x5a4813(0x28a)]&&console['log']('\x20\x20'+a31_0x54e267[_0x5a4813(0x285)](_0x4bc76c['description']));_0x4bc76c[_0x5a4813(0x310)]&&console['log']('\x20\x20'+a31_0x54e267[_0x5a4813(0x385)]('audienceId:')+'\x20'+_0x4bc76c[_0x5a4813(0x310)]);console[_0x5a4813(0x322)]('\x20\x20'+a31_0x54e267[_0x5a4813(0x385)](_0x5a4813(0x31b))+'\x20'+_0x4bc76c[_0x5a4813(0x25e)]),console[_0x5a4813(0x322)]('\x20\x20'+a31_0x54e267['cyan'](_0x5a4813(0x33c))+'\x20'+_0x4bc76c[_0x5a4813(0x26e)]);const _0x274101=_0x4bc76c[_0x5a4813(0x28b)]?.['length']||0x0;console[_0x5a4813(0x322)]('\x20\x20'+a31_0x54e267[_0x5a4813(0x385)](_0x5a4813(0x26c))+'\x20'+_0x274101);if(_0x4bc76c[_0x5a4813(0x28b)]&&_0x4bc76c['sections'][_0x5a4813(0x2bf)]>0x0)for(const _0x10b0d1 of _0x4bc76c[_0x5a4813(0x28b)]){console[_0x5a4813(0x322)](_0x5a4813(0x2f9)+a31_0x54e267[_0x5a4813(0x39d)](_0x10b0d1[_0x5a4813(0x21d)])+'\x20'+a31_0x54e267[_0x5a4813(0x285)]('(id:\x20'+_0x10b0d1['id']+')')),_0x10b0d1[_0x5a4813(0x2ce)]&&(console[_0x5a4813(0x322)]('\x20\x20\x20\x20\x20\x20'+a31_0x54e267['cyan'](_0x5a4813(0x336))+'\x20'+_0x10b0d1[_0x5a4813(0x2ce)][_0x5a4813(0x21d)]),_0x10b0d1[_0x5a4813(0x2ce)][_0x5a4813(0x244)]?.[_0x5a4813(0x22c)]&&console['log'](_0x5a4813(0x27e)+a31_0x54e267[_0x5a4813(0x385)](_0x5a4813(0x283))+'\x20'+_0x10b0d1[_0x5a4813(0x2ce)][_0x5a4813(0x244)][_0x5a4813(0x22c)])),_0x10b0d1['payload']&&console[_0x5a4813(0x322)](_0x5a4813(0x2ca)+a31_0x54e267[_0x5a4813(0x385)](_0x5a4813(0x26f))+'\x20'+JSON[_0x5a4813(0x37c)](_0x10b0d1['payload'])),_0x10b0d1['includeSensitive']&&console[_0x5a4813(0x322)]('\x20\x20\x20\x20\x20\x20'+a31_0x54e267[_0x5a4813(0x385)](_0x5a4813(0x39a))+_0x5a4813(0x342));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x5137f5(0x21d)]='ps:pz:delete';[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x1b6);async[a31_0x5137f5(0x361)](_0x3c228f){const _0x4c2b6a=a31_0x5137f5,{options:_0x54ba9a,args:_0x2025ed,tdx:_0x372c0f}=_0x3c228f,_0xb60e6a=_0x2025ed[0x0];if(!_0xb60e6a)return console['error'](_0x4c2b6a(0x309)),console[_0x4c2b6a(0x344)](_0x4c2b6a(0x1ea)),0x1;return await withSpinner(_0x4c2b6a(0x37e)+_0xb60e6a+_0x4c2b6a(0x1e1),()=>_0x372c0f[_0x4c2b6a(0x1d1)][_0x4c2b6a(0x38f)](_0xb60e6a),{'verbose':_0x54ba9a[_0x4c2b6a(0x399)]}),console['error'](_0x4c2b6a(0x2c3)+_0xb60e6a+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']='ps:pz:create';[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x1db);async[a31_0x5137f5(0x361)](_0x2e7406){const _0x569087=a31_0x5137f5,{options:_0x104fb7,tdx:_0x18bc32}=_0x2e7406,_0x4d05aa=_0x104fb7;let _0xe05542;if(_0x4d05aa[_0x569087(0x31c)]){_0xe05542=await loadJSON(_0x4d05aa[_0x569087(0x31c)],!![]);if(!_0xe05542[_0x569087(0x3bc)]?.[_0x569087(0x339)])return console['error'](_0x569087(0x3a7)),console[_0x569087(0x344)]('Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:'),console['error'](_0x569087(0x22b)),0x1;}else{if(!_0x4d05aa['name'])return console[_0x569087(0x344)](_0x569087(0x2fa)),console[_0x569087(0x344)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x569087(0x344)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x4d05aa['description']===undefined)return console[_0x569087(0x344)](_0x569087(0x217)),console[_0x569087(0x344)](_0x569087(0x202)),console['error'](_0x569087(0x201)),0x1;if(_0x4d05aa[_0x569087(0x3a2)]===undefined)return console[_0x569087(0x344)](_0x569087(0x278)),console[_0x569087(0x344)](_0x569087(0x33e)),0x1;let _0xd37c7e=_0x4d05aa['audienceId'];if(!_0xd37c7e&&_0x104fb7[_0x569087(0x1b1)]){const _0x4afe4b=await withSpinner(_0x569087(0x327)+_0x104fb7[_0x569087(0x1b1)]+'\x27...',()=>_0x18bc32['segment'][_0x569087(0x379)](_0x104fb7[_0x569087(0x1b1)]),{'verbose':_0x104fb7[_0x569087(0x399)]});_0xd37c7e=_0x4afe4b['data'];}let _0x45b6f4;_0x4d05aa[_0x569087(0x28b)]&&(_0x45b6f4=await loadJSON(_0x4d05aa[_0x569087(0x28b)],![]));const _0x5e3bdd=_0x4d05aa[_0x569087(0x3a2)]==='null'?null:{'id':_0x4d05aa['folderId'],'type':'folder-segment'};_0xe05542={'attributes':{'name':_0x4d05aa[_0x569087(0x21d)],'description':_0x4d05aa['description']||null,..._0xd37c7e!==undefined&&{'audienceId':_0xd37c7e},..._0x45b6f4!==undefined&&{'sections':_0x45b6f4}},'relationships':{'parentFolder':{'data':_0x5e3bdd}}};}const _0x14cf34=await withSpinner(_0x569087(0x1ee)+(_0xe05542['attributes']?.[_0x569087(0x21d)]??'')+_0x569087(0x1e1),()=>_0x18bc32[_0x569087(0x1d1)]['createPersonalization'](_0xe05542),{'verbose':_0x104fb7[_0x569087(0x399)]}),_0x5137b1=_0x14cf34[_0x569087(0x1b3)];return console[_0x569087(0x344)](_0x569087(0x2b7)+_0x5137b1['name']+'\x27\x20with\x20ID:\x20'+_0x5137b1['id']),await handleSDKOutput([_0x5137b1],_0x104fb7),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x5137f5(0x21d)]='ps:pz:patch';[a31_0x5137f5(0x28a)]=a31_0x5137f5(0x270);async[a31_0x5137f5(0x361)](_0xff9ae5){const _0x4147a4=a31_0x5137f5,{options:_0x2e1623,args:_0x3f9127}=_0xff9ae5,_0x37ecf8=_0x2e1623,_0x500713=_0x3f9127[0x0];if(!_0x500713)return console['error'](_0x4147a4(0x309)),console[_0x4147a4(0x344)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0x4147a4(0x344)](_0x4147a4(0x3b8)),0x1;let _0x111efd;if(_0x37ecf8[_0x4147a4(0x31c)])_0x111efd=await loadJSON(_0x37ecf8[_0x4147a4(0x31c)],!![]);else{if(!_0x37ecf8['name'])return console['error'](_0x4147a4(0x2fa)),console[_0x4147a4(0x344)](_0x4147a4(0x35b)),0x1;if(_0x37ecf8[_0x4147a4(0x28a)]===undefined)return console[_0x4147a4(0x344)](_0x4147a4(0x217)),console[_0x4147a4(0x344)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;let _0x3849de;_0x37ecf8[_0x4147a4(0x28b)]&&(_0x3849de=await loadJSON(_0x37ecf8['sections'],![])),_0x111efd={'attributes':{'name':_0x37ecf8[_0x4147a4(0x21d)],'description':_0x37ecf8['description']||null,..._0x3849de!==undefined&&{'sections':_0x3849de}}};}const {tdx:_0x208d92}=_0xff9ae5,_0x4af6cb=await withSpinner(_0x4147a4(0x3c3)+_0x500713+'\x27...',()=>_0x208d92[_0x4147a4(0x1d1)][_0x4147a4(0x35e)](_0x500713,_0x111efd),{'verbose':_0x2e1623['verbose']}),_0x3c2dbc=_0x4af6cb['data'];return console[_0x4147a4(0x344)]('✔\x20Updated\x20personalization\x20\x27'+_0x3c2dbc[_0x4147a4(0x21d)]+'\x27\x20(id:\x20'+_0x3c2dbc['id']+')'),await handleSDKOutput([_0x3c2dbc],_0x2e1623),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x5137f5(0x21d)]=a31_0x5137f5(0x1d9);['description']=a31_0x5137f5(0x220);async[a31_0x5137f5(0x361)](_0x576387){const _0x5b9586=a31_0x5137f5,{options:_0x1032ca,args:_0x27f9f0}=_0x576387,_0x2565b3=_0x27f9f0[0x0]||_0x1032ca[_0x5b9586(0x1b1)];if(!_0x2565b3)return showParentSegmentNotSetError(_0x5b9586(0x249)+_0x5b9586(0x2d5)),0x1;const _0x1c4229=resolveYamlFile(_0x2565b3);if(!existsSync(_0x1c4229))return showFileNotFoundError(_0x1c4229,_0x2565b3),0x1;let _0x15ccb7;try{_0x15ccb7=readFileSync(_0x1c4229,_0x5b9586(0x31f));}catch(_0x235808){const _0x56d5ae=_0x235808 instanceof Error?_0x235808[_0x5b9586(0x305)]:String(_0x235808);return console[_0x5b9586(0x344)](_0x5b9586(0x32f)+_0x56d5ae),0x1;}let _0x37e314;try{_0x37e314=parseDef(_0x15ccb7);}catch(_0x577d15){const _0x233196=_0x577d15 instanceof Error?_0x577d15[_0x5b9586(0x305)]:String(_0x577d15);return console[_0x5b9586(0x344)](a31_0x54e267[_0x5b9586(0x1f2)](_0x5b9586(0x302)+_0x233196)),0x1;}if(_0x37e314[_0x5b9586(0x1d5)]&&_0x37e314[_0x5b9586(0x1d5)][_0x5b9586(0x2bf)]>0x0)return console[_0x5b9586(0x344)](a31_0x54e267[_0x5b9586(0x366)](_0x5b9586(0x36f)+_0x1c4229)),console[_0x5b9586(0x344)](a31_0x54e267['dim'](_0x5b9586(0x34e)+_0x37e314[_0x5b9586(0x1d5)][_0x5b9586(0x2bf)]+_0x5b9586(0x397))),0x1;!_0x37e314[_0x5b9586(0x1c9)]&&(_0x37e314['realtime']={'events':[{'name':_0x5b9586(0x209),'source_table':_0x5b9586(0x224)}],'attributes':[{'name':_0x5b9586(0x359),'type':_0x5b9586(0x1f9)}],'id_stitching':{'primary_key':_0x37e314[_0x5b9586(0x242)]['table']===_0x5b9586(0x231)?_0x5b9586(0x338):_0x5b9586(0x2de)}});_0x37e314['personalization_services']=[{'name':'My\x20Service','description':_0x5b9586(0x39c),'trigger_event':_0x5b9586(0x209),'sections':[{'name':'Default','criteria':'true','attributes':['last_page_viewed']}]}];const _0x23b300=serializeDef(_0x37e314);return writeFileSync(_0x1c4229,_0x23b300,_0x5b9586(0x31f)),console[_0x5b9586(0x344)](a31_0x54e267[_0x5b9586(0x324)]('✔')+_0x5b9586(0x356)+a31_0x54e267[_0x5b9586(0x385)](_0x1c4229)),(!_0x37e314['realtime']||_0x15ccb7['indexOf']('realtime:')===-0x1)&&console['error'](a31_0x54e267[_0x5b9586(0x324)]('✔')+_0x5b9586(0x2cb)),console['error']('\x0a'+a31_0x54e267[_0x5b9586(0x285)]('Next\x20steps:')),console[_0x5b9586(0x344)]('\x20\x201.\x20Edit\x20'+_0x1c4229+_0x5b9586(0x1de)),console[_0x5b9586(0x344)](_0x5b9586(0x269)+a31_0x54e267['dim'](_0x5b9586(0x3b5)+_0x2565b3)+_0x5b9586(0x306)),0x0;}}