@treasuredata/tdx 2026.4.9 → 2026.4.10

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 (228) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +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.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/cas/cas-api-client.js +1 -1
  95. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  96. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  97. package/dist/sdk/cas/index.js +1 -1
  98. package/dist/sdk/cas/pull-workflow.js +1 -1
  99. package/dist/sdk/cas/push-workflow.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +1 -1
  101. package/dist/sdk/client/delivery-api-client.js +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.js +1 -1
  104. package/dist/sdk/client/http-client.js +1 -1
  105. package/dist/sdk/client/llm-api-client.js +1 -1
  106. package/dist/sdk/client/oauth-refresh.js +1 -1
  107. package/dist/sdk/client/rate-limiter.js +1 -1
  108. package/dist/sdk/client/td-api-client.js +1 -1
  109. package/dist/sdk/client/trino-api-client.js +1 -1
  110. package/dist/sdk/client/workflow-client.js +1 -1
  111. package/dist/sdk/connection-validator.js +1 -1
  112. package/dist/sdk/connection.js +1 -1
  113. package/dist/sdk/delivery.js +1 -1
  114. package/dist/sdk/engage/campaign-pull.js +1 -1
  115. package/dist/sdk/engage/campaign-push.js +1 -1
  116. package/dist/sdk/engage/campaign-validator.js +1 -1
  117. package/dist/sdk/engage/campaign-yaml.js +1 -1
  118. package/dist/sdk/engage/template-pull.js +1 -1
  119. package/dist/sdk/engage/template-push.js +1 -1
  120. package/dist/sdk/engage/template-validator.js +1 -1
  121. package/dist/sdk/engage/template-yaml.js +1 -1
  122. package/dist/sdk/engage/types/campaign-def.js +1 -1
  123. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  124. package/dist/sdk/engage/types/template-schema.js +1 -1
  125. package/dist/sdk/engage.js +1 -1
  126. package/dist/sdk/errors.js +1 -1
  127. package/dist/sdk/index.js +1 -1
  128. package/dist/sdk/io/index.js +1 -1
  129. package/dist/sdk/io/node-filesystem.js +1 -1
  130. package/dist/sdk/job.js +1 -1
  131. package/dist/sdk/journey.js +1 -1
  132. package/dist/sdk/llm/chat-cache.js +1 -1
  133. package/dist/sdk/llm/index.js +1 -1
  134. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  135. package/dist/sdk/llm/model-factors.js +1 -1
  136. package/dist/sdk/personalization.js +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/index.js +1 -1
  139. package/dist/sdk/query/sql-parser.js +1 -1
  140. package/dist/sdk/realtime.js +1 -1
  141. package/dist/sdk/schedule.js +1 -1
  142. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  143. package/dist/sdk/segment/fields-display.js +1 -1
  144. package/dist/sdk/segment/file-discovery.js +1 -1
  145. package/dist/sdk/segment/journey-utils.js +1 -1
  146. package/dist/sdk/segment/journey-validator.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js +1 -1
  148. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  149. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/pull-workflow.js +1 -1
  151. package/dist/sdk/segment/push-recovery.js +1 -1
  152. package/dist/sdk/segment/push-workflow.js +1 -1
  153. package/dist/sdk/segment/resolution-context.js +1 -1
  154. package/dist/sdk/segment/segment-path-parser.js +1 -1
  155. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  156. package/dist/sdk/segment/segment-validator.js +1 -1
  157. package/dist/sdk/segment/target-resolution.js +1 -1
  158. package/dist/sdk/segment/tdx-config.js +1 -1
  159. package/dist/sdk/segment/types/activation-schema.js +1 -1
  160. package/dist/sdk/segment/types/journey-def.js +1 -1
  161. package/dist/sdk/segment/types/journey-schema.js +1 -1
  162. package/dist/sdk/segment/types/segment-def.js +1 -1
  163. package/dist/sdk/segment/types/segment-schema.js +1 -1
  164. package/dist/sdk/segment/validate-files.js +1 -1
  165. package/dist/sdk/segment/yaml-validator.js +1 -1
  166. package/dist/sdk/segment.js +1 -1
  167. package/dist/sdk/types/index.js +1 -1
  168. package/dist/sdk/types/progress.js +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/access-tracker.js +1 -1
  184. package/dist/sdk/workspace/frontmatter.js +1 -1
  185. package/dist/sdk/workspace/git.d.ts +52 -0
  186. package/dist/sdk/workspace/git.d.ts.map +1 -1
  187. package/dist/sdk/workspace/git.js +1 -1
  188. package/dist/sdk/workspace/git.js.map +1 -1
  189. package/dist/sdk/workspace/index.d.ts +14 -0
  190. package/dist/sdk/workspace/index.d.ts.map +1 -1
  191. package/dist/sdk/workspace/index.js +1 -1
  192. package/dist/sdk/workspace/index.js.map +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.js +1 -1
  196. package/dist/test-utils/command-runner.js +1 -1
  197. package/dist/test-utils/factories.js +1 -1
  198. package/dist/test-utils/fixtures.js +1 -1
  199. package/dist/test-utils/http-mock.js +1 -1
  200. package/dist/test-utils/index.js +1 -1
  201. package/dist/utils/async.js +1 -1
  202. package/dist/utils/colors.js +1 -1
  203. package/dist/utils/diff.js +1 -1
  204. package/dist/utils/file-permissions.js +1 -1
  205. package/dist/utils/file-reader.js +1 -1
  206. package/dist/utils/github-releases.js +1 -1
  207. package/dist/utils/global-cache.js +1 -1
  208. package/dist/utils/json-loader.js +1 -1
  209. package/dist/utils/local-cache.js +1 -1
  210. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  211. package/dist/utils/logger/formatters/index.js +1 -1
  212. package/dist/utils/logger/handlers/console-handler.js +1 -1
  213. package/dist/utils/logger/handlers/file-handler.js +1 -1
  214. package/dist/utils/logger/handlers/index.js +1 -1
  215. package/dist/utils/logger/handlers/null-handler.js +1 -1
  216. package/dist/utils/logger/index.js +1 -1
  217. package/dist/utils/logger/logger.js +1 -1
  218. package/dist/utils/logger/types.js +1 -1
  219. package/dist/utils/option-validation.js +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/prompt.js +1 -1
  222. package/dist/utils/spinner.js +1 -1
  223. package/dist/utils/sse-parser.js +1 -1
  224. package/dist/utils/string-utils.js +1 -1
  225. package/dist/utils/table-ref-parser.js +1 -1
  226. package/dist/utils/tdx-logger.js +1 -1
  227. package/dist/utils/version-check.js +1 -1
  228. package/package.json +2 -1
@@ -1 +1 @@
1
- const a31_0x5bbcfa=a31_0x1942;(function(_0x43d70f,_0x36a01d){const _0x588862=a31_0x1942,_0x226083=_0x43d70f();while(!![]){try{const _0x100001=-parseInt(_0x588862(0x2f8))/0x1*(parseInt(_0x588862(0x137))/0x2)+parseInt(_0x588862(0x217))/0x3*(-parseInt(_0x588862(0x140))/0x4)+parseInt(_0x588862(0x31b))/0x5*(parseInt(_0x588862(0x2dd))/0x6)+-parseInt(_0x588862(0x16b))/0x7+parseInt(_0x588862(0x1f0))/0x8+parseInt(_0x588862(0x158))/0x9+parseInt(_0x588862(0x176))/0xa*(-parseInt(_0x588862(0x201))/0xb);if(_0x100001===_0x36a01d)break;else _0x226083['push'](_0x226083['shift']());}catch(_0x562fed){_0x226083['push'](_0x226083['shift']());}}}(a31_0x1ae9,0x8f62c));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x13e5f7 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x27c26e from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a31_0x5bbcfa(0x2a9);function openBrowser(_0x7652ba){const _0x532f15=a31_0x5bbcfa,_0x273123=process['platform'],_0x45872b=_0x273123===_0x532f15(0x208)?_0x532f15(0x21c):_0x273123===_0x532f15(0x1ba)?_0x532f15(0x157):'xdg-open';spawn(_0x45872b,[_0x7652ba],{'detached':!![],'stdio':'ignore'})[_0x532f15(0x1a9)]();}function migrateLegacyDirectory(){const _0x21004b=a31_0x5bbcfa;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x4cc409=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x4cc409[_0x21004b(0x30a)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x21004b(0x207)](a31_0x27c26e[_0x21004b(0x27d)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x21004b(0x2d5))),console['error'](a31_0x27c26e[_0x21004b(0x1be)](_0x21004b(0x26d)+LEGACY_PARENT_SEGMENT_DIR+_0x21004b(0x1e9))),![];console[_0x21004b(0x207)](a31_0x27c26e[_0x21004b(0x27d)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x21004b(0x191)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x21004b(0x207)](a31_0x27c26e[_0x21004b(0x2a3)](_0x21004b(0x174)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x520ff3){const _0x163afa=_0x520ff3 instanceof Error?_0x520ff3[_0x21004b(0x284)]:String(_0x520ff3);return console[_0x21004b(0x207)](a31_0x27c26e[_0x21004b(0x172)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x163afa+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x5b1e88){const _0x50c4fc=a31_0x5bbcfa;return migrateLegacyDirectory(),super[_0x50c4fc(0x2e8)](_0x5b1e88);}}function resolveYamlFile(_0x5901ba){const _0xca47df=a31_0x5bbcfa;if(_0x5901ba['endsWith'](_0xca47df(0x2af))||_0x5901ba['endsWith'](_0xca47df(0x21e)))return _0x5901ba;return a31_0x13e5f7['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5901ba)+'.yml');}function formatProgressMessage(_0xb59dd3){const _0x5a976e=a31_0x5bbcfa,_0x4e50f2=_0xb59dd3[_0x5a976e(0x194)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x4e50f2){const [,_0x594f6b,_0x40d0a0,_0x254219='']=_0x4e50f2;return a31_0x27c26e[_0x5a976e(0x1be)](_0x594f6b+':')+'\x20'+_0x40d0a0+a31_0x27c26e['dim'](_0x254219);}return a31_0x27c26e['dim'](_0xb59dd3);}function showFileNotFoundError(_0x48f377,_0x480a61){const _0x20e20b=a31_0x5bbcfa;console[_0x20e20b(0x207)](a31_0x27c26e['red'](_0x20e20b(0x2c2)+_0x48f377+'\x0a')),console['error'](a31_0x27c26e['cyan'](_0x20e20b(0x315)+_0x480a61+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x13f8ec){const _0x325d9d=a31_0x5bbcfa;if(!_0x13f8ec[_0x325d9d(0x299)])return;const _0x3141f6=_0x13f8ec[_0x325d9d(0x299)],_0x276e86=_0x3141f6[_0x325d9d(0x1eb)]?a31_0x27c26e[_0x325d9d(0x2a3)](_0x325d9d(0x2ad)):a31_0x27c26e[_0x325d9d(0x27d)](_0x325d9d(0x17b));console['error']('\x0a'+a31_0x27c26e[_0x325d9d(0x1be)](_0x325d9d(0x20c))+'\x20'+_0x276e86);if(_0x3141f6['events']&&_0x3141f6[_0x325d9d(0x219)]['length']>0x0){console[_0x325d9d(0x207)]('\x20\x20'+a31_0x27c26e['dim']('Events:')+'\x20'+_0x3141f6[_0x325d9d(0x219)][_0x325d9d(0x141)]+_0x325d9d(0x2a7));for(const _0x130449 of _0x3141f6['events']){const _0x1fdcb4=_0x130449[_0x325d9d(0x1f3)]===![]?a31_0x27c26e[_0x325d9d(0x172)]('✘'):a31_0x27c26e[_0x325d9d(0x2a3)]('✔');console[_0x325d9d(0x207)]('\x20\x20\x20\x20'+_0x1fdcb4+'\x20'+_0x130449[_0x325d9d(0x247)]),_0x130449[_0x325d9d(0x1b2)]&&console[_0x325d9d(0x207)](_0x325d9d(0x269)+a31_0x27c26e[_0x325d9d(0x172)](_0x130449[_0x325d9d(0x1b2)]));}}if(_0x3141f6[_0x325d9d(0x29e)]&&_0x3141f6['attributes'][_0x325d9d(0x141)]>0x0){console['error']('\x20\x20'+a31_0x27c26e['dim'](_0x325d9d(0x2cf))+'\x20'+_0x3141f6[_0x325d9d(0x29e)][_0x325d9d(0x141)]+_0x325d9d(0x2a7));for(const _0x50e70b of _0x3141f6[_0x325d9d(0x29e)]){const _0x740d1e=_0x50e70b['valid']?a31_0x27c26e[_0x325d9d(0x2a3)]('✔'):a31_0x27c26e['red']('✘');console[_0x325d9d(0x207)]('\x20\x20\x20\x20'+_0x740d1e+'\x20'+_0x50e70b[_0x325d9d(0x247)]+'\x20'+a31_0x27c26e['dim']('('+_0x50e70b[_0x325d9d(0x257)]+')'));}}if(_0x3141f6[_0x325d9d(0x31f)]){const _0x25cb8f=_0x3141f6[_0x325d9d(0x31f)][_0x325d9d(0x1d3)]?.[_0x325d9d(0x141)]?'\x20+\x20['+_0x3141f6[_0x325d9d(0x31f)][_0x325d9d(0x1d3)]['join'](',\x20')+']':'';console['error']('\x20\x20'+a31_0x27c26e[_0x325d9d(0x1be)](_0x325d9d(0x287))+'\x20'+_0x3141f6[_0x325d9d(0x31f)][_0x325d9d(0x1fc)]+_0x25cb8f);}if(_0x3141f6[_0x325d9d(0x31a)]&&_0x3141f6[_0x325d9d(0x31a)][_0x325d9d(0x141)]>0x0){console[_0x325d9d(0x207)]('\x20\x20'+a31_0x27c26e[_0x325d9d(0x1be)](_0x325d9d(0x1aa))+'\x20'+_0x3141f6[_0x325d9d(0x31a)][_0x325d9d(0x141)]+'\x20service'+(_0x3141f6[_0x325d9d(0x31a)]['length']!==0x1?'s':''));for(const _0x237cde of _0x3141f6[_0x325d9d(0x31a)]){console[_0x325d9d(0x207)](_0x325d9d(0x2d3)+_0x237cde[_0x325d9d(0x247)]);}}}function showParentSegmentNotSetError(_0x164883){const _0xd5d0d2=a31_0x5bbcfa;console['error'](a31_0x27c26e[_0xd5d0d2(0x27d)](_0xd5d0d2(0x1e1))),console[_0xd5d0d2(0x207)](_0x164883);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x2e4);[a31_0x5bbcfa(0x2f6)]='List\x20parent\x20segments';async[a31_0x5bbcfa(0x232)](_0x56026f){const _0x23f5a2=a31_0x5bbcfa,{options:_0x3b84d4,args:_0x58ceee,tdx:_0x2d5ef6}=_0x56026f,_0x54addd=_0x58ceee[0x0];_0x3b84d4[_0x23f5a2(0x28e)]&&(console['error'](_0x23f5a2(0x297)+_0x3b84d4[_0x23f5a2(0x268)]),_0x54addd&&console['error'](_0x23f5a2(0x145)+_0x54addd));const _0xbdc7b0=await withSpinner(_0x54addd?_0x23f5a2(0x16d)+_0x54addd+_0x23f5a2(0x185):_0x23f5a2(0x206),()=>_0x2d5ef6[_0x23f5a2(0x239)][_0x23f5a2(0x292)](),{'verbose':_0x3b84d4[_0x23f5a2(0x28e)]});let _0x374b88=_0xbdc7b0[_0x23f5a2(0x15e)];if(_0x54addd){const _0x3f96b1=_0x54addd[_0x23f5a2(0x261)](/[.+^${}()|[\]\\]/g,_0x23f5a2(0x148))[_0x23f5a2(0x261)](/\*/g,'.*')[_0x23f5a2(0x261)](/\?/g,'.'),_0x2d7273=new RegExp('^'+_0x3f96b1+'$','i');_0x374b88=_0x374b88[_0x23f5a2(0x262)](_0xf26885=>_0x2d7273[_0x23f5a2(0x205)](_0xf26885[_0x23f5a2(0x29e)]['name']));}_0x374b88[_0x23f5a2(0x18b)]((_0x1ed8b4,_0x124564)=>_0x1ed8b4[_0x23f5a2(0x29e)][_0x23f5a2(0x247)]['localeCompare'](_0x124564[_0x23f5a2(0x29e)]['name'])),console[_0x23f5a2(0x207)](_0x23f5a2(0x2c1)+_0x374b88[_0x23f5a2(0x141)]+'\x20parent\x20segment'+(_0x374b88[_0x23f5a2(0x141)]!==0x1?'s':''));const _0x28cc9c=_0x144054=>{const _0x26df89=_0x23f5a2;return getConsoleNextUrl(_0x3b84d4[_0x26df89(0x268)],'/app/dw/parentSegments/'+_0x144054);};if(_0x3b84d4[_0x23f5a2(0x27e)]==='json'||_0x3b84d4[_0x23f5a2(0x27e)]===_0x23f5a2(0x1d0)){const _0x2bfa6e=_0x374b88[_0x23f5a2(0x20a)](_0x469324=>({..._0x469324,'url':_0x28cc9c(_0x469324['id'])}));await handleSDKOutput(_0x2bfa6e,_0x3b84d4);}else{if(_0x374b88['length']===0x0)_0x54addd?console[_0x23f5a2(0x337)](_0x23f5a2(0x144)+_0x54addd):console[_0x23f5a2(0x337)](_0x23f5a2(0x13b));else for(const _0xa6654 of _0x374b88){const _0x333737=_0xa6654['attributes'][_0x23f5a2(0x225)]?a31_0x27c26e[_0x23f5a2(0x1be)]('\x20('+formatRows(_0xa6654[_0x23f5a2(0x29e)][_0x23f5a2(0x225)])+')'):'',_0x509c12=hyperlink(_0xa6654[_0x23f5a2(0x29e)][_0x23f5a2(0x247)],_0x28cc9c(_0xa6654['id']));console[_0x23f5a2(0x337)](_0x23f5a2(0x1ed)+_0x509c12+_0x333737);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x2ae);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x1a1);async[a31_0x5bbcfa(0x232)](_0x6cb316){const _0x5a1ff0=a31_0x5bbcfa,{options:_0x201c33,args:_0x55e40c,tdx:_0x35015e}=_0x6cb316;console[_0x5a1ff0(0x207)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x5a1ff0(0x2cc)+_0x5a1ff0(0x14a));const _0x1d0d60=_0x201c33;if(_0x55e40c[_0x5a1ff0(0x141)]===0x0)return console['error'](a31_0x27c26e['red'](_0x5a1ff0(0x2d0))),console[_0x5a1ff0(0x207)](_0x5a1ff0(0x29d)),0x1;const _0x108dd7=_0x55e40c[0x0];if(!_0x1d0d60['database']||!_0x1d0d60['table'])return console[_0x5a1ff0(0x207)](_0x5a1ff0(0x12f)),console[_0x5a1ff0(0x207)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x1d0d60[_0x5a1ff0(0x28e)]&&(console[_0x5a1ff0(0x207)](_0x5a1ff0(0x297)+_0x1d0d60[_0x5a1ff0(0x268)]),console[_0x5a1ff0(0x207)](_0x5a1ff0(0x2d7)+_0x108dd7),console[_0x5a1ff0(0x207)](_0x5a1ff0(0x1b1)+_0x1d0d60[_0x5a1ff0(0x18e)]),console[_0x5a1ff0(0x207)](_0x5a1ff0(0x30d)+_0x1d0d60[_0x5a1ff0(0x1fe)]));const _0x1b64dd=await loadJSONFromOptions(_0x1d0d60[_0x5a1ff0(0x29e)],_0x1d0d60['attributesFile']),_0x2cc2ac=await loadJSONFromOptions(_0x1d0d60[_0x5a1ff0(0x1cf)],_0x1d0d60[_0x5a1ff0(0x320)]),_0x26fc70=await loadJSONFromOptions(_0x1d0d60[_0x5a1ff0(0x133)],_0x1d0d60[_0x5a1ff0(0x23f)]),_0x3fb52a={'name':_0x108dd7,'description':_0x1d0d60['description'],'scheduleType':_0x1d0d60[_0x5a1ff0(0x34f)],'scheduleOption':_0x1d0d60[_0x5a1ff0(0x341)],'timezone':_0x1d0d60['timezone'],'master':{'parentDatabaseName':_0x1d0d60[_0x5a1ff0(0x18e)],'parentTableName':_0x1d0d60[_0x5a1ff0(0x1fe)]},'attributes':_0x1b64dd,'behaviors':_0x2cc2ac,'customerGroup':_0x26fc70},_0x5d89ea=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x108dd7+_0x5a1ff0(0x185),()=>_0x35015e[_0x5a1ff0(0x239)][_0x5a1ff0(0x1b5)](_0x3fb52a),{'verbose':_0x201c33[_0x5a1ff0(0x28e)]}),_0x6f970c=_0x5d89ea[_0x5a1ff0(0x15e)];return console[_0x5a1ff0(0x207)](_0x5a1ff0(0x149)+_0x6f970c[_0x5a1ff0(0x247)]+'\x27\x20with\x20ID:\x20'+_0x6f970c['id']),await handleSDKOutput([_0x6f970c],_0x201c33),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a31_0x5bbcfa(0x25d);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x329);async['execute'](_0x2c7432){const _0x3e6007=a31_0x5bbcfa,{options:_0x3841f7,args:_0x2cc12c,tdx:_0x3b95cc}=_0x2c7432;console[_0x3e6007(0x207)](_0x3e6007(0x1b8)+_0x3e6007(0x2cc)+_0x3e6007(0x14a));const _0x403bb2=_0x3841f7;if(_0x2cc12c[_0x3e6007(0x141)]===0x0)return console['error'](a31_0x27c26e['red'](_0x3e6007(0x2d0))),console[_0x3e6007(0x207)](_0x3e6007(0x27f)),0x1;const _0x24b2aa=_0x2cc12c[0x0];_0x403bb2['verbose']&&(console[_0x3e6007(0x207)](_0x3e6007(0x297)+_0x403bb2[_0x3e6007(0x268)]),console[_0x3e6007(0x207)](_0x3e6007(0x20b)+_0x24b2aa));const _0x1fd1a4=await withSpinner(_0x3e6007(0x326)+_0x24b2aa+'\x27...',()=>_0x3b95cc[_0x3e6007(0x239)][_0x3e6007(0x2f2)](_0x24b2aa),{'verbose':_0x403bb2[_0x3e6007(0x28e)]}),_0x1d79c0=_0x1fd1a4[_0x3e6007(0x15e)],_0x22c485=await loadJSONFromOptions(_0x403bb2[_0x3e6007(0x27a)],_0x403bb2['addAttributesFile']),_0x558e9b=await loadJSONFromOptions(_0x403bb2[_0x3e6007(0x1ae)],_0x403bb2[_0x3e6007(0x1fa)]),_0xaab6e={'name':_0x1d79c0['name'],'description':_0x403bb2[_0x3e6007(0x2f6)]!==undefined?_0x403bb2[_0x3e6007(0x2f6)]:_0x1d79c0[_0x3e6007(0x2f6)],'scheduleType':_0x403bb2['scheduleType']!==undefined?_0x403bb2['scheduleType']:_0x1d79c0[_0x3e6007(0x34f)],'scheduleOption':_0x403bb2[_0x3e6007(0x341)]!==undefined?_0x403bb2[_0x3e6007(0x341)]:_0x1d79c0[_0x3e6007(0x341)],'timezone':_0x403bb2[_0x3e6007(0x202)]!==undefined?_0x403bb2[_0x3e6007(0x202)]:_0x1d79c0[_0x3e6007(0x202)],'master':_0x1d79c0['master'],'attributes':_0x22c485?[..._0x1d79c0[_0x3e6007(0x29e)]||[],..._0x22c485]:_0x1d79c0[_0x3e6007(0x29e)],'behaviors':_0x558e9b?[..._0x1d79c0['behaviors']||[],..._0x558e9b]:_0x1d79c0['behaviors'],'customerGroup':_0x1d79c0[_0x3e6007(0x133)]},_0x1f1f2e=await withSpinner(_0x3e6007(0x1e5)+_0x24b2aa+_0x3e6007(0x185),()=>_0x3b95cc[_0x3e6007(0x239)][_0x3e6007(0x351)](_0x24b2aa,_0xaab6e),{'verbose':_0x403bb2[_0x3e6007(0x28e)]}),_0x54db27=_0x1f1f2e[_0x3e6007(0x15e)];return console[_0x3e6007(0x207)](_0x3e6007(0x22b)+_0x54db27[_0x3e6007(0x247)]+'\x27'),await handleSDKOutput([_0x54db27],_0x403bb2),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x19e);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x319);async[a31_0x5bbcfa(0x232)](_0x24e9ce){const _0x398cac=a31_0x5bbcfa,{options:_0x48a8f8,args:_0x275116,tdx:_0x165731}=_0x24e9ce,_0x77bcdd=_0x48a8f8,_0x2dfae5=_0x275116[0x0]||_0x48a8f8[_0x398cac(0x155)];if(!_0x2dfae5)return showParentSegmentNotSetError(_0x398cac(0x130)+_0x398cac(0x1a0)),0x1;if(_0x77bcdd['use']&&_0x77bcdd[_0x398cac(0x139)])return console['error'](a31_0x27c26e[_0x398cac(0x172)](_0x398cac(0x336))),console[_0x398cac(0x207)](a31_0x27c26e['dim']('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console['error'](a31_0x27c26e[_0x398cac(0x1be)](_0x398cac(0x2d8)+PARENT_SEGMENT_DIR+_0x398cac(0x270))),console[_0x398cac(0x207)](a31_0x27c26e['cyan'](_0x398cac(0x1db))),0x1;const _0x33f280=_0x77bcdd[_0x398cac(0x139)]||a31_0x13e5f7[_0x398cac(0x20e)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2dfae5)+_0x398cac(0x2af));_0x77bcdd['verbose']&&(console['error'](_0x398cac(0x297)+_0x77bcdd[_0x398cac(0x268)]),console[_0x398cac(0x207)](_0x398cac(0x20b)+_0x2dfae5),console[_0x398cac(0x207)](_0x398cac(0x200)+_0x33f280));const _0x2acb25=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x2dfae5+_0x398cac(0x185),()=>_0x165731[_0x398cac(0x239)][_0x398cac(0x1da)](_0x2dfae5),{'verbose':_0x77bcdd[_0x398cac(0x28e)]}),_0x3cab79=_0x2acb25[_0x398cac(0x15e)];if(existsSync(_0x33f280)){const _0x4a5f2b=readFileSync(_0x33f280,_0x398cac(0x2dc)),_0x50a570=generateDiff(_0x4a5f2b,_0x3cab79);if(!hasChanges(_0x50a570))console[_0x398cac(0x207)](a31_0x27c26e[_0x398cac(0x2a3)]('✔')+_0x398cac(0x183)+a31_0x27c26e[_0x398cac(0x271)](_0x33f280)+_0x398cac(0x19b));else{console[_0x398cac(0x207)]('\x0aChanges\x20to\x20\x27'+_0x33f280+'\x27:'),console['error']('─'[_0x398cac(0x1a6)](0x3c)),console[_0x398cac(0x207)](formatDiffWithColors(_0x50a570)),console[_0x398cac(0x207)]('─'[_0x398cac(0x1a6)](0x3c));if(!_0x77bcdd[_0x398cac(0x177)]){if(!isInteractive())return console['error'](a31_0x27c26e[_0x398cac(0x172)]('\x0aError:'),_0x398cac(0x2ac)),console[_0x398cac(0x207)](a31_0x27c26e[_0x398cac(0x1be)](_0x398cac(0x167))),0x1;const _0x2bb31a=await confirmKey(_0x398cac(0x255)+_0x33f280+'\x27?');if(!_0x2bb31a)return console[_0x398cac(0x207)](a31_0x27c26e[_0x398cac(0x27d)](_0x398cac(0x1f4))),0x1;}writeFileSync(_0x33f280,_0x3cab79,'utf-8'),console['error'](a31_0x27c26e[_0x398cac(0x2a3)]('✔')+_0x398cac(0x327)+a31_0x27c26e[_0x398cac(0x271)](_0x33f280));}}else{const _0x3b06d5=a31_0x13e5f7[_0x398cac(0x245)](_0x33f280);!existsSync(_0x3b06d5)&&mkdirSync(_0x3b06d5,{'recursive':!![]}),writeFileSync(_0x33f280,_0x3cab79,'utf-8'),console[_0x398cac(0x207)](a31_0x27c26e[_0x398cac(0x2a3)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x27c26e[_0x398cac(0x271)](_0x33f280));}return saveSessionContext({'parent_segment':_0x2dfae5},_0x77bcdd[_0x398cac(0x1d7)]),console[_0x398cac(0x207)](a31_0x27c26e[_0x398cac(0x2a3)]('✔')+_0x398cac(0x186)+a31_0x27c26e[_0x398cac(0x1be)](_0x398cac(0x2a9))+_0x398cac(0x1d6)+a31_0x27c26e['cyan'](_0x2dfae5)),0x0;}}function a31_0x1942(_0x18c97d,_0x2d6ef2){_0x18c97d=_0x18c97d-0x12d;const _0x1ae985=a31_0x1ae9();let _0x194293=_0x1ae985[_0x18c97d];return _0x194293;}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x263);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x168);async['execute'](_0x5863f7){const _0x28244f=a31_0x5bbcfa,{options:_0x37e129,args:_0x34689b,tdx:_0x27f64f}=_0x5863f7,_0x416365=_0x37e129,_0x307e5f=_0x34689b[0x0]||_0x37e129[_0x28244f(0x155)];if(!_0x307e5f)return showParentSegmentNotSetError(_0x28244f(0x21f)+_0x28244f(0x2f0)),0x1;const _0x335300=resolveYamlFile(_0x307e5f);if(!existsSync(_0x335300))return showFileNotFoundError(_0x335300,_0x307e5f),0x1;_0x416365[_0x28244f(0x28e)]&&(console[_0x28244f(0x207)]('Site:\x20'+_0x416365[_0x28244f(0x268)]),console[_0x28244f(0x207)](_0x28244f(0x280)+_0x335300));let _0x35e750;try{_0x35e750=readFileSync(_0x335300,_0x28244f(0x2dc));}catch(_0xbd715){const _0x3a4af9=_0xbd715 instanceof Error?_0xbd715[_0x28244f(0x284)]:String(_0xbd715);return console['error'](_0x28244f(0x2bb)+_0x3a4af9),0x1;}const _0x37f454=await withSpinner(_0x28244f(0x1f8),()=>_0x27f64f[_0x28244f(0x239)][_0x28244f(0x2e7)](_0x35e750),{'verbose':_0x416365[_0x28244f(0x28e)]}),_0x1517ab=_0x37f454[_0x28244f(0x15e)],{isNew:_0x4c36c8,name:_0x544267,hasChanges:_0x3113e2,diffFormatted:_0x1daa73}=_0x1517ab;if(!_0x3113e2)return console[_0x28244f(0x207)](_0x28244f(0x32a)+_0x544267+_0x28244f(0x2d2)),0x0;_0x4c36c8?console[_0x28244f(0x207)](_0x28244f(0x1dc)+_0x544267+'\x27:'):console[_0x28244f(0x207)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x544267+'\x27:');console['error']('─'[_0x28244f(0x1a6)](0x3c)),console[_0x28244f(0x207)](_0x1daa73),console['error']('─'['repeat'](0x3c));const _0x1df1f1=_0x4c36c8?_0x28244f(0x14c)+_0x544267+'\x27?':_0x28244f(0x2ed)+_0x544267+'\x27?';if(!_0x416365[_0x28244f(0x177)]){if(!isInteractive())return console[_0x28244f(0x207)](a31_0x27c26e[_0x28244f(0x172)](_0x28244f(0x238)),_0x28244f(0x2ac)),console[_0x28244f(0x207)](a31_0x27c26e['dim'](_0x28244f(0x167))),0x1;const _0x3f9d6a=await confirmKey(_0x1df1f1);if(!_0x3f9d6a)return console['error'](a31_0x27c26e[_0x28244f(0x27d)](_0x28244f(0x1f4))),0x1;}const _0x4d217c=_0x4c36c8?_0x28244f(0x1c9):_0x28244f(0x2a5),_0x5491ae=await withSpinner(_0x4d217c+'\x20parent\x20segment\x20\x27'+_0x544267+'\x27...',()=>_0x1517ab[_0x28244f(0x195)](),{'verbose':_0x416365[_0x28244f(0x28e)]}),_0x536438=_0x5491ae['data'],_0x220ad1=getConsoleNextUrl(_0x416365[_0x28244f(0x268)],_0x28244f(0x2c6)+_0x536438['id']),_0x12a90d=_0x4c36c8?_0x28244f(0x14d):_0x28244f(0x1dd);return console[_0x28244f(0x207)]('✔\x20'+_0x12a90d+_0x28244f(0x258)+_0x536438[_0x28244f(0x247)]+'\x27'),console[_0x28244f(0x207)]('\x20\x20'+_0x220ad1),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]='segment:parent:validate';['description']=a31_0x5bbcfa(0x277);async[a31_0x5bbcfa(0x232)](_0x4be27e){const _0x26384c=a31_0x5bbcfa,{options:_0x4613d7,args:_0x71ad04,tdx:_0x2ebe7a}=_0x4be27e,_0x323726=_0x4613d7,_0x5d13fe=_0x71ad04[0x0]||_0x4613d7[_0x26384c(0x155)];if(!_0x5d13fe)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x26384c(0x249)+'Options:\x0a'+_0x26384c(0x17c)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x26384c(0x2b9)),0x1;const _0x3a33f6=resolveYamlFile(_0x5d13fe);if(!existsSync(_0x3a33f6))return showFileNotFoundError(_0x3a33f6,_0x5d13fe),0x1;_0x323726[_0x26384c(0x28e)]&&(console[_0x26384c(0x207)](_0x26384c(0x297)+_0x323726['site']),console[_0x26384c(0x207)]('YAML\x20file:\x20'+_0x3a33f6));let _0x29074e;try{_0x29074e=readFileSync(_0x3a33f6,_0x26384c(0x2dc));}catch(_0x1e3b85){const _0x8675d6=_0x1e3b85 instanceof Error?_0x1e3b85[_0x26384c(0x284)]:String(_0x1e3b85);return console[_0x26384c(0x207)](_0x26384c(0x2bb)+_0x8675d6),0x1;}const _0xc26fad=createCommandSpinner(a31_0x27c26e['dim'](_0x26384c(0x24b)),{'verbose':_0x323726[_0x26384c(0x28e)]});_0xc26fad[_0x26384c(0x157)]();const _0x3e1e96={'onProgress':_0x13755a=>{const _0xab4537=_0x26384c;_0xc26fad[_0xab4537(0x19d)]=formatProgressMessage(_0x13755a);}};if(_0x323726[_0x26384c(0x289)])_0x3e1e96[_0x26384c(0x289)]=!![];if(_0x323726[_0x26384c(0x325)])_0x3e1e96[_0x26384c(0x325)]=!![];_0x323726['attribute']&&(_0x3e1e96['attribute']=_0x323726[_0x26384c(0x32e)]);_0x323726['behavior']&&(_0x3e1e96[_0x26384c(0x32d)]=_0x323726['behavior']);if(_0x323726[_0x26384c(0x22c)])_0x3e1e96[_0x26384c(0x22c)]=_0x323726[_0x26384c(0x22c)];let _0x19a7c8;try{_0x19a7c8=await _0x2ebe7a[_0x26384c(0x239)][_0x26384c(0x333)](_0x29074e,_0x3e1e96),_0xc26fad[_0x26384c(0x135)]();}catch(_0xd849fb){_0xc26fad[_0x26384c(0x135)]();throw _0xd849fb;}const _0x8b90c9=_0x323726['interval']||_0x26384c(0x27b);return this[_0x26384c(0x237)](_0x19a7c8,_0x3e1e96,_0x3a33f6,_0x8b90c9),_0x19a7c8[_0x26384c(0x150)]?0x0:0x1;}[a31_0x5bbcfa(0x237)](_0x5a05bd,_0x115567,_0x3f467e,_0x3d7a96){const _0x1aff85=a31_0x5bbcfa;console[_0x1aff85(0x207)]('\x0a'+a31_0x27c26e[_0x1aff85(0x146)](_0x1aff85(0x18f))+'\x20'+_0x5a05bd[_0x1aff85(0x247)]),console[_0x1aff85(0x207)]('═'[_0x1aff85(0x1a6)](0x3c)),this[_0x1aff85(0x182)](_0x5a05bd);if(typeof _0x115567[_0x1aff85(0x32e)]===_0x1aff85(0x310)){this[_0x1aff85(0x345)](_0x5a05bd),this['displaySummary'](_0x5a05bd),this[_0x1aff85(0x2e9)](_0x3f467e,_0x3d7a96,_0x1aff85(0x32e),_0x115567[_0x1aff85(0x32e)]);return;}if(_0x115567['attribute']===!![]){this[_0x1aff85(0x345)](_0x5a05bd),this[_0x1aff85(0x275)](_0x5a05bd),this[_0x1aff85(0x2e9)](_0x3f467e,_0x3d7a96,_0x1aff85(0x29e));return;}if(typeof _0x115567['behavior']===_0x1aff85(0x310)){this[_0x1aff85(0x30c)](_0x5a05bd,_0x3d7a96),this[_0x1aff85(0x275)](_0x5a05bd),this[_0x1aff85(0x2e9)](_0x3f467e,_0x3d7a96,'behavior',_0x115567['behavior']);return;}if(_0x115567[_0x1aff85(0x32d)]===!![]){this[_0x1aff85(0x30c)](_0x5a05bd,_0x3d7a96),this['displaySummary'](_0x5a05bd),this[_0x1aff85(0x2e9)](_0x3f467e,_0x3d7a96,_0x1aff85(0x1cf));return;}this[_0x1aff85(0x345)](_0x5a05bd),this[_0x1aff85(0x30c)](_0x5a05bd,_0x3d7a96),this['displayRealtimeInfo'](_0x5a05bd),this[_0x1aff85(0x275)](_0x5a05bd),this[_0x1aff85(0x2e9)](_0x3f467e,_0x3d7a96,_0x1aff85(0x2d6));}[a31_0x5bbcfa(0x1cc)](_0x4d9da2){displayRealtimeValidation(_0x4d9da2);}['displayPreviewHints'](_0x24a63c,_0x210d24,_0xf9bd83,_0x5e9e64){const _0x430bdf=a31_0x5bbcfa;console[_0x430bdf(0x207)]('\x0a'+a31_0x27c26e[_0x430bdf(0x1be)](_0x430bdf(0x2c5)));const _0xc19e19=_0x210d24!=='-1d'?_0x430bdf(0x267)+_0x210d24:'';if(_0xf9bd83==='attribute'&&_0x5e9e64)console[_0x430bdf(0x207)]('\x20\x20'+a31_0x27c26e['dim'](_0x430bdf(0x22e)+_0x24a63c+'\x20--attribute\x20\x22'+_0x5e9e64+'\x22'+_0xc19e19));else{if(_0xf9bd83==='behavior'&&_0x5e9e64)console[_0x430bdf(0x207)]('\x20\x20'+a31_0x27c26e[_0x430bdf(0x1be)](_0x430bdf(0x22e)+_0x24a63c+_0x430bdf(0x278)+_0x5e9e64+'\x22'+_0xc19e19));else(_0xf9bd83===_0x430bdf(0x29e)||_0xf9bd83===_0x430bdf(0x2d6))&&console['error']('\x20\x20'+a31_0x27c26e[_0x430bdf(0x1be)](_0x430bdf(0x22e)+_0x24a63c+_0x430bdf(0x160)+_0xc19e19));}(_0xf9bd83===_0x430bdf(0x1cf)||_0xf9bd83===_0x430bdf(0x2d6))&&console[_0x430bdf(0x207)]('\x20\x20'+a31_0x27c26e[_0x430bdf(0x1be)](_0x430bdf(0x22e)+_0x24a63c+_0x430bdf(0x2df)+_0xc19e19)),_0xf9bd83===_0x430bdf(0x2d6)&&console[_0x430bdf(0x207)]('\x20\x20'+a31_0x27c26e[_0x430bdf(0x1be)](_0x430bdf(0x22e)+_0x24a63c+_0x430bdf(0x2fd)+_0xc19e19));}[a31_0x5bbcfa(0x182)](_0x1cac96){const _0x37cafb=a31_0x5bbcfa,{master:_0x2a1c89}=_0x1cac96,_0x1d9c67=_0x2a1c89[_0x37cafb(0x353)]?a31_0x27c26e['green']('✔'):a31_0x27c26e[_0x37cafb(0x172)]('✘');console[_0x37cafb(0x207)]('\x0a'+a31_0x27c26e[_0x37cafb(0x1be)](_0x37cafb(0x1a4))),console[_0x37cafb(0x207)](_0x1d9c67+'\x20'+a31_0x27c26e[_0x37cafb(0x146)](_0x2a1c89[_0x37cafb(0x18e)]+'.'+_0x2a1c89['table'])),_0x2a1c89['schemaValid']?_0x2a1c89[_0x37cafb(0x156)]!==undefined&&console[_0x37cafb(0x207)]('\x20\x20'+a31_0x27c26e[_0x37cafb(0x1be)](_0x37cafb(0x2a6))+'\x20'+a31_0x27c26e[_0x37cafb(0x271)](formatRows(_0x2a1c89[_0x37cafb(0x156)]))):console[_0x37cafb(0x207)]('\x20\x20'+a31_0x27c26e['red'](_0x37cafb(0x224))+'\x20'+_0x2a1c89[_0x37cafb(0x29c)]);}[a31_0x5bbcfa(0x345)](_0x1faf4e){const _0x4918e4=a31_0x5bbcfa;if(_0x1faf4e[_0x4918e4(0x29e)]['length']===0x0)return;console[_0x4918e4(0x207)]('\x0a'+a31_0x27c26e[_0x4918e4(0x1be)](_0x4918e4(0x32c)));for(const _0x3c5e7d of _0x1faf4e[_0x4918e4(0x29e)]){const _0x749a18=_0x3c5e7d['schemaValid']?a31_0x27c26e[_0x4918e4(0x2a3)]('✔'):a31_0x27c26e[_0x4918e4(0x172)]('✘');let _0x569adb='';if(_0x3c5e7d['schemaValid']&&_0x3c5e7d[_0x4918e4(0x290)]!==undefined&&_0x3c5e7d[_0x4918e4(0x307)]!==undefined){const _0x38cf95=_0x3c5e7d[_0x4918e4(0x307)][_0x4918e4(0x18d)](0x1),_0x450539=_0x3c5e7d[_0x4918e4(0x307)]>=0x50?a31_0x27c26e[_0x4918e4(0x2a3)]:_0x3c5e7d[_0x4918e4(0x307)]>=0x32?a31_0x27c26e[_0x4918e4(0x27d)]:a31_0x27c26e[_0x4918e4(0x172)];_0x569adb='\x20'+a31_0x27c26e[_0x4918e4(0x1be)](_0x4918e4(0x33d))+'\x20'+_0x450539(_0x38cf95+'%')+'\x20('+formatRows(_0x3c5e7d[_0x4918e4(0x290)])+_0x4918e4(0x335);}console[_0x4918e4(0x207)](_0x749a18+'\x20'+a31_0x27c26e['bold'](_0x3c5e7d[_0x4918e4(0x247)])+_0x569adb),console[_0x4918e4(0x207)]('\x20\x20'+a31_0x27c26e[_0x4918e4(0x1be)](_0x4918e4(0x344))+'\x20'+a31_0x27c26e[_0x4918e4(0x146)](_0x3c5e7d[_0x4918e4(0x18e)]+'.'+_0x3c5e7d['table']));const _0x29b3a7=_0x3c5e7d[_0x4918e4(0x1cd)]===_0x3c5e7d['foreignKey']?a31_0x27c26e[_0x4918e4(0x1be)](_0x4918e4(0x1fb))+'\x20'+_0x3c5e7d[_0x4918e4(0x1cd)]:a31_0x27c26e['dim'](_0x4918e4(0x189))+'\x20'+_0x3c5e7d[_0x4918e4(0x1cd)]+_0x4918e4(0x1d6)+_0x3c5e7d[_0x4918e4(0x34b)];console[_0x4918e4(0x207)]('\x20\x20'+_0x29b3a7),console['error']('\x20\x20'+a31_0x27c26e[_0x4918e4(0x1be)](_0x4918e4(0x147))),this[_0x4918e4(0x283)](_0x3c5e7d['columns']),!_0x3c5e7d[_0x4918e4(0x353)]&&console[_0x4918e4(0x207)]('\x20\x20'+a31_0x27c26e['red']('Error:')+'\x20'+_0x3c5e7d[_0x4918e4(0x29c)]);}}[a31_0x5bbcfa(0x30c)](_0x5d49dd,_0x502623){const _0x46cdd1=a31_0x5bbcfa;if(_0x5d49dd[_0x46cdd1(0x1cf)][_0x46cdd1(0x141)]===0x0)return;console['error']('\x0a'+a31_0x27c26e[_0x46cdd1(0x1be)]('Behaviors')+'\x20'+a31_0x27c26e[_0x46cdd1(0x1be)]('('+_0x502623+')'));for(const _0x567925 of _0x5d49dd[_0x46cdd1(0x1cf)]){const _0x24f106=_0x567925[_0x46cdd1(0x353)]?a31_0x27c26e[_0x46cdd1(0x2a3)]('✔'):a31_0x27c26e[_0x46cdd1(0x172)]('✘');let _0x51bec4='';if(_0x567925[_0x46cdd1(0x353)]&&_0x567925[_0x46cdd1(0x187)]!==undefined&&_0x567925[_0x46cdd1(0x260)]!==undefined){const _0x143d52=_0x567925['customerPercent']?.[_0x46cdd1(0x18d)](0x1)||'?',_0x309047=(_0x567925[_0x46cdd1(0x25b)]??0x0)>=0x32?a31_0x27c26e['green']:(_0x567925['customerPercent']??0x0)>=0x14?a31_0x27c26e[_0x46cdd1(0x27d)]:a31_0x27c26e['red'];_0x51bec4='\x20'+a31_0x27c26e[_0x46cdd1(0x1be)](_0x46cdd1(0x256))+'\x20'+_0x309047(formatRows(_0x567925[_0x46cdd1(0x187)]))+'\x20('+_0x143d52+_0x46cdd1(0x2aa)+a31_0x27c26e['dim'](_0x46cdd1(0x33a))+'\x20'+a31_0x27c26e[_0x46cdd1(0x271)](formatRows(_0x567925[_0x46cdd1(0x260)]));}console[_0x46cdd1(0x207)](_0x24f106+'\x20'+a31_0x27c26e[_0x46cdd1(0x146)](_0x567925[_0x46cdd1(0x247)])+_0x51bec4),console['error']('\x20\x20'+a31_0x27c26e[_0x46cdd1(0x1be)]('Source:')+'\x20'+a31_0x27c26e[_0x46cdd1(0x146)](_0x567925[_0x46cdd1(0x18e)]+'.'+_0x567925['table']));const _0xfc907c=_0x567925['joinKey']===_0x567925['foreignKey']?a31_0x27c26e[_0x46cdd1(0x1be)](_0x46cdd1(0x1fb))+'\x20'+_0x567925['joinKey']:a31_0x27c26e['dim']('Join:')+'\x20'+_0x567925[_0x46cdd1(0x1cd)]+_0x46cdd1(0x1d6)+_0x567925[_0x46cdd1(0x34b)];console[_0x46cdd1(0x207)]('\x20\x20'+_0xfc907c),console[_0x46cdd1(0x207)]('\x20\x20'+a31_0x27c26e['dim'](_0x46cdd1(0x147))),this[_0x46cdd1(0x283)](_0x567925[_0x46cdd1(0x218)]),!_0x567925['schemaValid']&&console[_0x46cdd1(0x207)]('\x20\x20'+a31_0x27c26e[_0x46cdd1(0x172)](_0x46cdd1(0x224))+'\x20'+_0x567925[_0x46cdd1(0x29c)]);}}['displayColumns'](_0x112904){const _0x47d278=a31_0x5bbcfa;for(const _0x2c16bd of _0x112904){_0x2c16bd['label']===_0x2c16bd[_0x47d278(0x1ab)]||_0x2c16bd['column']==='*'?console[_0x47d278(0x207)](_0x47d278(0x2d3)+_0x2c16bd[_0x47d278(0x134)]):console[_0x47d278(0x207)](_0x47d278(0x2d3)+_0x2c16bd['label']+'\x20'+a31_0x27c26e[_0x47d278(0x1be)]('('+_0x2c16bd['column']+')'));}}[a31_0x5bbcfa(0x275)](_0xccb7c5){const _0x35af40=a31_0x5bbcfa;console[_0x35af40(0x207)]('─'['repeat'](0x3c));if(_0xccb7c5[_0x35af40(0x20f)][_0x35af40(0x141)]>0x0){console[_0x35af40(0x207)]('\x0a'+a31_0x27c26e[_0x35af40(0x172)](_0x35af40(0x259)));for(const _0x2c72a7 of _0xccb7c5['errors']){console[_0x35af40(0x207)]('\x20\x20'+a31_0x27c26e[_0x35af40(0x172)]('•')+'\x20'+_0x2c72a7);}}_0xccb7c5[_0x35af40(0x150)]&&console[_0x35af40(0x207)]('\x0a'+a31_0x27c26e[_0x35af40(0x2a3)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x349);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x163);async['execute'](_0x31085d){const _0x41dee3=a31_0x5bbcfa,{options:_0x34d12a,args:_0x46bf65,tdx:_0x2d8218}=_0x31085d,_0x102c5b=_0x34d12a,_0xb86117=_0x46bf65[0x0]||_0x34d12a[_0x41dee3(0x155)];if(!_0xb86117)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x41dee3(0x300)+_0x41dee3(0x171)+_0x41dee3(0x31d)+_0x41dee3(0x19f)+_0x41dee3(0x296)+_0x41dee3(0x2b9)),0x1;if(!_0x102c5b[_0x41dee3(0x289)]&&!_0x102c5b[_0x41dee3(0x32e)]&&!_0x102c5b[_0x41dee3(0x32d)]&&!_0x102c5b[_0x41dee3(0x325)])return console[_0x41dee3(0x207)](a31_0x27c26e['red'](_0x41dee3(0x2a1))),console[_0x41dee3(0x207)](_0x41dee3(0x331)),console['error'](_0x41dee3(0x316)),console[_0x41dee3(0x207)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x41dee3(0x207)](_0x41dee3(0x34d)),console['error'](_0x41dee3(0x28c)),console['error']('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x5d6fda=resolveYamlFile(_0xb86117);if(!existsSync(_0x5d6fda))return showFileNotFoundError(_0x5d6fda,_0xb86117),0x1;_0x102c5b[_0x41dee3(0x28e)]&&(console[_0x41dee3(0x207)]('Site:\x20'+_0x102c5b[_0x41dee3(0x268)]),console[_0x41dee3(0x207)](_0x41dee3(0x280)+_0x5d6fda));let _0x25fa11;try{_0x25fa11=readFileSync(_0x5d6fda,_0x41dee3(0x2dc));}catch(_0x469368){const _0xc6b1de=_0x469368 instanceof Error?_0x469368[_0x41dee3(0x284)]:String(_0x469368);return console[_0x41dee3(0x207)](_0x41dee3(0x2bb)+_0xc6b1de),0x1;}let _0x398b7e;try{_0x398b7e=parseDef(_0x25fa11);}catch(_0x1cfd52){const _0x392700=_0x1cfd52 instanceof Error?_0x1cfd52['message']:String(_0x1cfd52);return console[_0x41dee3(0x207)](a31_0x27c26e[_0x41dee3(0x172)]('Error\x20parsing\x20YAML:\x20'+_0x392700)),0x1;}if(_0x102c5b['attribute']===!![]||_0x102c5b['attribute']===''){const _0x4bc442=_0x398b7e[_0x41dee3(0x29e)]?.['map'](_0x3d91ab=>_0x3d91ab[_0x41dee3(0x247)])||[];if(_0x4bc442['length']===0x0)console[_0x41dee3(0x207)](a31_0x27c26e['red'](_0x41dee3(0x1b4)));else{console[_0x41dee3(0x207)](a31_0x27c26e[_0x41dee3(0x172)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x41dee3(0x207)](_0x41dee3(0x1b7));for(const _0x2595d8 of _0x4bc442){console[_0x41dee3(0x207)]('\x20\x20'+a31_0x27c26e[_0x41dee3(0x271)](_0x2595d8));}console['error'](_0x41dee3(0x24a)+_0xb86117+_0x41dee3(0x220)+_0x4bc442[0x0]+'\x22');}return 0x1;}if(_0x102c5b['behavior']===!![]||_0x102c5b[_0x41dee3(0x32d)]===''){const _0x161e95=_0x398b7e[_0x41dee3(0x1cf)]?.[_0x41dee3(0x20a)](_0x1f54a3=>_0x1f54a3[_0x41dee3(0x247)])||[];if(_0x161e95['length']===0x0)console[_0x41dee3(0x207)](a31_0x27c26e['red'](_0x41dee3(0x2cd)));else{console[_0x41dee3(0x207)](a31_0x27c26e[_0x41dee3(0x172)](_0x41dee3(0x318))),console[_0x41dee3(0x207)]('Available\x20behaviors:');for(const _0x5acc64 of _0x161e95){console['error']('\x20\x20'+a31_0x27c26e['cyan'](_0x5acc64));}console['error'](_0x41dee3(0x24a)+_0xb86117+_0x41dee3(0x278)+_0x161e95[0x0]+'\x22');}return 0x1;}const _0x18b2ec=createCommandSpinner(a31_0x27c26e[_0x41dee3(0x1be)]('Fetching\x20sample\x20data...'),{'verbose':_0x102c5b[_0x41dee3(0x28e)]});_0x18b2ec[_0x41dee3(0x157)]();const _0x5af7bc={'onProgress':_0x3fdb2f=>{const _0x42097f=_0x41dee3;_0x18b2ec[_0x42097f(0x19d)]=formatProgressMessage(_0x3fdb2f);}};if(_0x102c5b[_0x41dee3(0x289)])_0x5af7bc[_0x41dee3(0x289)]=!![];if(_0x102c5b[_0x41dee3(0x32e)]&&typeof _0x102c5b['attribute']===_0x41dee3(0x310))_0x5af7bc[_0x41dee3(0x32e)]=_0x102c5b[_0x41dee3(0x32e)];if(_0x102c5b['behavior']&&typeof _0x102c5b['behavior']==='string')_0x5af7bc[_0x41dee3(0x32d)]=_0x102c5b['behavior'];if(_0x102c5b[_0x41dee3(0x325)])_0x5af7bc[_0x41dee3(0x325)]=!![];if(_0x102c5b['interval'])_0x5af7bc[_0x41dee3(0x22c)]=_0x102c5b[_0x41dee3(0x22c)];let _0xd4b191;try{_0xd4b191=await _0x2d8218[_0x41dee3(0x239)][_0x41dee3(0x28b)](_0x25fa11,_0x5af7bc),_0x18b2ec['stop']();}catch(_0x21d59c){_0x18b2ec[_0x41dee3(0x135)]();throw _0x21d59c;}return await this[_0x41dee3(0x304)](_0xd4b191,{'master':_0x102c5b[_0x41dee3(0x289)],'attribute':typeof _0x102c5b[_0x41dee3(0x32e)]==='string'?_0x102c5b[_0x41dee3(0x32e)]:undefined,'behavior':typeof _0x102c5b[_0x41dee3(0x32d)]===_0x41dee3(0x310)?_0x102c5b['behavior']:undefined,'enriched':_0x102c5b['enriched']}),_0xd4b191['allValid']?0x0:0x1;}async[a31_0x5bbcfa(0x304)](_0x497858,_0x23254e){const _0x4571bc=a31_0x5bbcfa;console[_0x4571bc(0x207)]('\x0a'+a31_0x27c26e[_0x4571bc(0x146)](_0x4571bc(0x26e))+'\x20'+_0x497858[_0x4571bc(0x247)]),console[_0x4571bc(0x207)]('═'['repeat'](0x3c));if(_0x23254e[_0x4571bc(0x289)]&&_0x497858['sampleData']){const _0x143eca=a31_0x27c26e['dim']('Master:')+'\x20'+a31_0x27c26e[_0x4571bc(0x146)](_0x497858[_0x4571bc(0x289)][_0x4571bc(0x18e)]+'.'+_0x497858[_0x4571bc(0x289)]['table']);await this[_0x4571bc(0x15a)](_0x143eca,_0x497858[_0x4571bc(0x2cb)]);}else{if(_0x23254e[_0x4571bc(0x32e)]&&_0x497858[_0x4571bc(0x2cb)]){const _0x9ab3fa=a31_0x27c26e[_0x4571bc(0x1be)](_0x4571bc(0x1ef))+'\x20'+a31_0x27c26e['bold'](_0x23254e[_0x4571bc(0x32e)]);await this[_0x4571bc(0x15a)](_0x9ab3fa,_0x497858['sampleData']);}else{if(_0x23254e['behavior']&&_0x497858[_0x4571bc(0x2cb)]){const _0xd0bc01=a31_0x27c26e[_0x4571bc(0x1be)](_0x4571bc(0x173))+'\x20'+a31_0x27c26e[_0x4571bc(0x146)](_0x23254e[_0x4571bc(0x32d)]);await this[_0x4571bc(0x15a)](_0xd0bc01,_0x497858[_0x4571bc(0x2cb)]);}else{if(_0x23254e[_0x4571bc(0x325)]&&_0x497858[_0x4571bc(0x2cb)]){const _0x60c65d=a31_0x27c26e[_0x4571bc(0x1be)](_0x4571bc(0x1f2))+'\x20'+a31_0x27c26e['bold'](_0x4571bc(0x2e2));await this[_0x4571bc(0x15a)](_0x60c65d,_0x497858[_0x4571bc(0x2cb)]);}else!_0x497858[_0x4571bc(0x2cb)]&&console[_0x4571bc(0x207)](_0x4571bc(0x29a));}}}if(_0x497858['errors'][_0x4571bc(0x141)]>0x0){console[_0x4571bc(0x207)]('─'[_0x4571bc(0x1a6)](0x3c)),console[_0x4571bc(0x207)]('\x0a'+a31_0x27c26e[_0x4571bc(0x172)](_0x4571bc(0x259)));for(const _0xa50616 of _0x497858[_0x4571bc(0x20f)]){console[_0x4571bc(0x207)]('\x20\x20'+a31_0x27c26e['red']('•')+'\x20'+_0xa50616);}}}async['displaySampleData'](_0x5ebab4,_0x15ca3b){const _0x579b02=a31_0x5bbcfa;if(_0x15ca3b[_0x579b02(0x141)]===0x0){console[_0x579b02(0x207)]('\x0a'+_0x5ebab4),console['error'](_0x579b02(0x197));return;}console['error']('\x0a'+_0x5ebab4);const _0x5dc6cc=Object[_0x579b02(0x2a0)](_0x15ca3b[0x0])[_0x579b02(0x20a)](_0x54e417=>({'name':_0x54e417,'type':typeof _0x15ca3b[0x0][_0x54e417]===_0x579b02(0x1ea)?_0x579b02(0x175):_0x579b02(0x2f7)})),_0x2031da={'queryId':_0x579b02(0x334),'columns':_0x5dc6cc,'data':_0x15ca3b,'stats':{'state':_0x579b02(0x165),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x15ca3b[_0x579b02(0x141)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x350031=formatAsTable(_0x2031da,_0x15ca3b[_0x579b02(0x141)],!![]);await writeOutput(_0x350031,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a31_0x5bbcfa(0x142);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x12e);async['execute'](_0x265e55){const _0x25762e=a31_0x5bbcfa,{options:_0x272567,args:_0x1cbd09,tdx:_0xd8cdbc}=_0x265e55,_0x37cc08=_0x272567,_0x1bb08c=_0x1cbd09[0x0]||_0x272567[_0x25762e(0x155)];if(!_0x1bb08c)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+_0x25762e(0x23e)),0x1;const _0x5ecead=resolveYamlFile(_0x1bb08c);if(existsSync(_0x5ecead)){_0x37cc08[_0x25762e(0x28e)]&&console['error']('Found\x20YAML\x20file:\x20'+_0x5ecead);let _0x1eaa22;try{_0x1eaa22=readFileSync(_0x5ecead,_0x25762e(0x2dc));}catch(_0x533311){const _0x405765=_0x533311 instanceof Error?_0x533311[_0x25762e(0x284)]:String(_0x533311);return console[_0x25762e(0x207)](_0x25762e(0x2bb)+_0x405765),0x1;}const _0x40cf23=await withSpinner(_0x25762e(0x1f8),()=>_0xd8cdbc[_0x25762e(0x239)][_0x25762e(0x2e7)](_0x1eaa22),{'verbose':_0x37cc08[_0x25762e(0x28e)]}),_0x1d8fb9=_0x40cf23[_0x25762e(0x15e)],{isNew:_0x16470b,name:_0x25902d,hasChanges:_0x432f41,diffFormatted:_0x1610f9}=_0x1d8fb9;if(_0x432f41){_0x16470b?console[_0x25762e(0x207)](_0x25762e(0x1dc)+_0x25902d+'\x27:'):console['error'](_0x25762e(0x21a)+_0x25902d+'\x27:');console['error']('─'[_0x25762e(0x1a6)](0x3c)),console[_0x25762e(0x207)](_0x1610f9),console[_0x25762e(0x207)]('─'[_0x25762e(0x1a6)](0x3c));const _0x36b844=_0x16470b?'Create\x20parent\x20segment\x20\x27'+_0x25902d+_0x25762e(0x309):_0x25762e(0x2ed)+_0x25902d+_0x25762e(0x309);if(!_0x37cc08['yes']){if(!isInteractive())return console[_0x25762e(0x207)](a31_0x27c26e['red'](_0x25762e(0x238)),_0x25762e(0x2ac)),console[_0x25762e(0x207)](a31_0x27c26e[_0x25762e(0x1be)](_0x25762e(0x167))),0x1;const _0x43501c=await confirmKey(_0x36b844);if(!_0x43501c)return console[_0x25762e(0x207)](a31_0x27c26e[_0x25762e(0x27d)](_0x25762e(0x1f4))),0x1;}const _0x142a36=_0x16470b?'Creating':_0x25762e(0x2a5);await withSpinner(_0x142a36+'\x20parent\x20segment\x20\x27'+_0x25902d+_0x25762e(0x185),()=>_0x1d8fb9['apply'](),{'verbose':_0x37cc08[_0x25762e(0x28e)]});const _0x28d8a8=_0x16470b?_0x25762e(0x14d):_0x25762e(0x1dd);console[_0x25762e(0x207)]('✔\x20'+_0x28d8a8+_0x25762e(0x258)+_0x25902d+'\x27');}else console[_0x25762e(0x207)](_0x25762e(0x32a)+_0x25902d+_0x25762e(0x1c8));}const _0x187bee=await withSpinner(_0x25762e(0x192)+_0x1bb08c+_0x25762e(0x185),()=>_0xd8cdbc[_0x25762e(0x239)][_0x25762e(0x1b0)](_0x1bb08c),{'verbose':_0x37cc08[_0x25762e(0x28e)]}),_0x21fdd7=_0x187bee[_0x25762e(0x15e)],_0x422080=getConsoleUrl(_0x37cc08[_0x25762e(0x268)],_0x25762e(0x30f)+_0x21fdd7[_0x25762e(0x348)]+_0x25762e(0x1d2)+_0x21fdd7['workflowSessionId']+_0x25762e(0x1bf)+_0x21fdd7[_0x25762e(0x227)]);return console[_0x25762e(0x207)](_0x25762e(0x180)),console[_0x25762e(0x207)]('\x20\x20'+a31_0x27c26e[_0x25762e(0x1be)](_0x25762e(0x23b))+'\x20'+_0x21fdd7[_0x25762e(0x244)]),console[_0x25762e(0x207)]('\x20\x20'+a31_0x27c26e[_0x25762e(0x1be)](_0x25762e(0x1c3))+'\x20'+_0x21fdd7[_0x25762e(0x1b3)]),console[_0x25762e(0x207)]('\x20\x20'+a31_0x27c26e['dim'](_0x25762e(0x26f))+'\x20'+_0x21fdd7[_0x25762e(0x250)]),console['error']('\x20\x20'+a31_0x27c26e[_0x25762e(0x1be)](_0x25762e(0x2f5))+'\x20'+_0x21fdd7[_0x25762e(0x227)]),console[_0x25762e(0x207)]('\x20\x20'+_0x422080),console[_0x25762e(0x207)]('\x0a'+a31_0x27c26e['dim'](_0x25762e(0x15f))+_0x25762e(0x240)+_0x21fdd7[_0x25762e(0x227)]+_0x25762e(0x2db)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']=a31_0x5bbcfa(0x254);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x313);async[a31_0x5bbcfa(0x232)](_0x60473b){const _0x97f894=a31_0x5bbcfa,{options:_0x23d7ad,args:_0x1691ca,tdx:_0x326f55}=_0x60473b,_0x322680=_0x1691ca[0x0]||_0x23d7ad[_0x97f894(0x155)];if(!_0x322680)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+_0x97f894(0x2c9)),0x1;_0x23d7ad[_0x97f894(0x28e)]&&(console[_0x97f894(0x207)](_0x97f894(0x297)+_0x23d7ad[_0x97f894(0x268)]),console[_0x97f894(0x207)](_0x97f894(0x20b)+_0x322680));const _0x358f98=await withSpinner(_0x97f894(0x2fc)+_0x322680+_0x97f894(0x185),()=>_0x326f55[_0x97f894(0x239)][_0x97f894(0x2ce)](_0x322680),{'verbose':_0x23d7ad[_0x97f894(0x28e)]}),_0x381e7d=_0x358f98['data'];console[_0x97f894(0x207)](_0x97f894(0x2c1)+_0x381e7d[_0x97f894(0x141)]+_0x97f894(0x251)+(_0x381e7d[_0x97f894(0x141)]!==0x1?'s':''));if(_0x23d7ad[_0x97f894(0x2bc)]||_0x23d7ad[_0x97f894(0x1d0)])return await handleSDKOutput(_0x381e7d,_0x23d7ad),0x0;return displayFieldsHumanReadable(_0x381e7d,_0x322680),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x29b);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x24c);async['execute'](_0x5bb967){const _0x5ce4f3=a31_0x5bbcfa,{options:_0x192007,args:_0x8947a2,tdx:_0x3f7efe}=_0x5bb967,_0x864412=_0x192007,_0x2f677b=_0x8947a2[0x0]||_0x192007['parentSegment'];if(!_0x2f677b)return showParentSegmentNotSetError(_0x5ce4f3(0x1c5)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x5ce4f3(0x2fa)+_0x5ce4f3(0x2b7)),0x1;_0x192007[_0x5ce4f3(0x28e)]&&(console[_0x5ce4f3(0x207)](_0x5ce4f3(0x297)+_0x192007[_0x5ce4f3(0x268)]),console[_0x5ce4f3(0x207)](_0x5ce4f3(0x20b)+_0x2f677b));const _0x153bad=await withSpinner(_0x5ce4f3(0x305)+_0x2f677b+'\x27...',()=>_0x3f7efe[_0x5ce4f3(0x239)]['getParentFull'](_0x2f677b),{'verbose':_0x192007[_0x5ce4f3(0x28e)]}),_0x56b599=_0x153bad[_0x5ce4f3(0x15e)];if(_0x864412[_0x5ce4f3(0x2fb)]){const _0x38b9ea=getConsoleNextUrl(_0x864412[_0x5ce4f3(0x268)],_0x5ce4f3(0x2c6)+_0x56b599['id']);return console[_0x5ce4f3(0x207)](a31_0x27c26e[_0x5ce4f3(0x2a3)]('✔')+'\x20Opening\x20'+a31_0x27c26e[_0x5ce4f3(0x271)](_0x38b9ea)),openBrowser(_0x38b9ea),0x0;}return await handleSingleObjectOutput(_0x56b599,_0x192007),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x2ee);['description']=a31_0x5bbcfa(0x311);async[a31_0x5bbcfa(0x232)](_0x301600){const _0x181de7=a31_0x5bbcfa,{options:_0x3a11d8,args:_0x2adcbc,tdx:_0x546a71}=_0x301600,_0x4a7964=_0x3a11d8,_0x4b2d4f=_0x2adcbc[0x0]||_0x3a11d8[_0x181de7(0x155)];if(!_0x4b2d4f)return showParentSegmentNotSetError(_0x181de7(0x242)+_0x181de7(0x323)+_0x181de7(0x2fa)+_0x181de7(0x1b6)),0x1;_0x3a11d8[_0x181de7(0x28e)]&&(console['error'](_0x181de7(0x297)+_0x3a11d8[_0x181de7(0x268)]),console[_0x181de7(0x207)](_0x181de7(0x20b)+_0x4b2d4f));const _0x5d55af=await withSpinner(_0x181de7(0x253)+_0x4b2d4f+_0x181de7(0x185),()=>_0x546a71['segment'][_0x181de7(0x1a8)](_0x4b2d4f),{'verbose':_0x3a11d8[_0x181de7(0x28e)]}),_0x3a4fa0=_0x5d55af[_0x181de7(0x15e)],_0x5508ae=_0x546a71['segment'][_0x181de7(0x22a)](_0x3a4fa0);if(_0x4a7964[_0x181de7(0x139)]){const _0x23ae14=await this[_0x181de7(0x1d5)](_0x301600,_0x4b2d4f,_0x3a4fa0,_0x5508ae),_0x1dc209=this[_0x181de7(0x25c)](_0x23ae14);writeFileSync(_0x4a7964['output'],_0x1dc209);const _0x4e3166=_0x23ae14[_0x181de7(0x188)]['columns'][_0x181de7(0x141)]+_0x23ae14['behaviors'][_0x181de7(0x33f)]((_0x12541d,_0x223a4f)=>_0x12541d+_0x223a4f[_0x181de7(0x218)][_0x181de7(0x141)],0x0),_0x5d1554=_0x23ae14[_0x181de7(0x1cf)]['filter'](_0x941f24=>_0x941f24['columns'][_0x181de7(0x141)]===0x0)['length'];return console[_0x181de7(0x337)](_0x181de7(0x1e7)+_0x4a7964[_0x181de7(0x139)]),console['log'](_0x181de7(0x236)+_0x5508ae),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x23ae14[_0x181de7(0x1cf)][_0x181de7(0x141)]+_0x181de7(0x285)),console[_0x181de7(0x337)]('\x20\x20Columns:\x20'+_0x4e3166+'\x20total'),_0x5d1554>0x0&&console[_0x181de7(0x337)]('\x20\x20Note:\x20'+_0x5d1554+_0x181de7(0x17f)),0x0;}console[_0x181de7(0x207)]('\x0a'+a31_0x27c26e[_0x181de7(0x146)](_0x181de7(0x23d))+'\x20'+a31_0x27c26e[_0x181de7(0x271)](_0x5508ae));const _0x76b809=await withSpinner(_0x181de7(0x1c7),()=>_0x546a71[_0x181de7(0x239)][_0x181de7(0x17a)](_0x3a4fa0),{'verbose':_0x3a11d8['verbose']});console['error']('\x0a'+a31_0x27c26e[_0x181de7(0x146)](_0x181de7(0x188))+'\x20'+a31_0x27c26e[_0x181de7(0x1be)]('('+_0x5508ae+_0x181de7(0x181)));const _0x376175=await executeSchemaQuery(_0x76b809[_0x181de7(0x15e)],_0x546a71,_0x3a11d8);await handleQueryOutput(_0x376175,_0x3a11d8);const _0x175e6f=await withSpinner(_0x181de7(0x293),()=>_0x546a71[_0x181de7(0x239)][_0x181de7(0x23c)](_0x3a4fa0),{'verbose':_0x3a11d8[_0x181de7(0x28e)]});for(const _0x2e7b3a of _0x175e6f[_0x181de7(0x15e)]){const _0xbacfc1=_0x181de7(0x231)+_0x2e7b3a['toLowerCase']()[_0x181de7(0x261)](/\s+/g,'_'),_0x3e53b3='SELECT\x20*\x20FROM\x20'+_0x5508ae+'.'+_0xbacfc1;console['error']('\x0a'+a31_0x27c26e[_0x181de7(0x146)](_0x2e7b3a)+'\x20'+a31_0x27c26e[_0x181de7(0x1be)]('('+_0x5508ae+'.'+_0xbacfc1+')'));try{const _0x5ec359=await executeSchemaQuery(_0x3e53b3,_0x546a71,_0x3a11d8);await handleQueryOutput(_0x5ec359,_0x3a11d8);}catch{console[_0x181de7(0x207)](a31_0x27c26e[_0x181de7(0x27d)](_0x181de7(0x1fd)));}}return 0x0;}async[a31_0x5bbcfa(0x1d5)](_0x2725cc,_0x2b0e2b,_0x567672,_0x41a84a){const _0x1b7d30=a31_0x5bbcfa,{options:_0x41456e,tdx:_0x39b357}=_0x2725cc,_0x3fbf27=await withSpinner(_0x1b7d30(0x1c7),()=>_0x39b357[_0x1b7d30(0x239)][_0x1b7d30(0x17a)](_0x567672),{'verbose':_0x41456e['verbose']}),_0x63dd12=await executeSchemaQuery(_0x3fbf27[_0x1b7d30(0x15e)],_0x39b357,_0x41456e),_0x5cd543=_0x63dd12[_0x1b7d30(0x15e)][_0x1b7d30(0x20a)](_0x2b1213=>({'name':_0x2b1213[_0x1b7d30(0x2bf)],'type':_0x2b1213['column_type']})),_0x53fe3b=await withSpinner(_0x1b7d30(0x293),()=>_0x39b357[_0x1b7d30(0x239)][_0x1b7d30(0x23c)](_0x567672),{'verbose':_0x41456e[_0x1b7d30(0x28e)]}),_0x3f8dbd=[];for(const _0x54ac41 of _0x53fe3b[_0x1b7d30(0x15e)]){const _0x553a5d=_0x1b7d30(0x231)+_0x54ac41['toLowerCase']()['replace'](/\s+/g,'_'),_0x5bdfbe=_0x1b7d30(0x13c)+_0x41a84a+'.'+_0x553a5d;let _0x352824=[];try{const _0x21ea4e=await executeSchemaQuery(_0x5bdfbe,_0x39b357,_0x41456e);_0x352824=_0x21ea4e[_0x1b7d30(0x15e)][_0x1b7d30(0x20a)](_0x21afc7=>({'name':_0x21afc7['column_name'],'type':_0x21afc7['column_type']}));}catch{}_0x3f8dbd[_0x1b7d30(0x246)]({'table':_0x553a5d,'columns':_0x352824});}return{'database':_0x41a84a,'parent_segment':_0x2b0e2b,'parent_id':_0x567672,'customers':{'table':_0x1b7d30(0x188),'columns':_0x5cd543},'behaviors':_0x3f8dbd};}['formatSchemaJson'](_0x402023){const _0x4bf8d6=a31_0x5bbcfa,_0x58525c=_0x262c60=>{const _0x24ee3c=a31_0x1942;if(_0x262c60[_0x24ee3c(0x141)]===0x0)return'[]';const _0x4eed12=_0x262c60[_0x24ee3c(0x20a)](_0xf00b70=>_0x24ee3c(0x252)+_0xf00b70[_0x24ee3c(0x247)]+'\x22,\x20\x22type\x22:\x20\x22'+_0xf00b70[_0x24ee3c(0x257)]+_0x24ee3c(0x1d8));return'[\x0a'+_0x4eed12['join'](',\x0a')+_0x24ee3c(0x1bb);},_0x50eb4c=_0x402023[_0x4bf8d6(0x1cf)][_0x4bf8d6(0x20a)](_0x475410=>{const _0x38000b=_0x4bf8d6;return _0x38000b(0x347)+_0x475410[_0x38000b(0x1fe)]+_0x38000b(0x28a)+_0x58525c(_0x475410[_0x38000b(0x218)])[_0x38000b(0x261)](/^/gm,'\x20\x20')[_0x38000b(0x164)]()+_0x38000b(0x346);})['join'](',\x0a');return _0x4bf8d6(0x1d4)+_0x402023[_0x4bf8d6(0x18e)]+_0x4bf8d6(0x1ac)+_0x402023[_0x4bf8d6(0x2a9)]+_0x4bf8d6(0x302)+_0x402023['parent_id']+_0x4bf8d6(0x350)+_0x402023['customers'][_0x4bf8d6(0x1fe)]+_0x4bf8d6(0x1e2)+_0x58525c(_0x402023[_0x4bf8d6(0x188)][_0x4bf8d6(0x218)])[_0x4bf8d6(0x261)](/^/gm,'\x20\x20')['trim']()+_0x4bf8d6(0x2da)+_0x50eb4c+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x14f);[a31_0x5bbcfa(0x2f6)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async['execute'](_0xdc07ef){const _0x4f515d=a31_0x5bbcfa,{options:_0x3011f0,args:_0x2ca152,tdx:_0x5f0ee2}=_0xdc07ef,_0x5d41f6=_0x2ca152[0x0]||_0x3011f0[_0x4f515d(0x155)];if(!_0x5d41f6)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x4f515d(0x16c)),0x1;_0x3011f0[_0x4f515d(0x28e)]&&(console[_0x4f515d(0x207)](_0x4f515d(0x297)+_0x3011f0[_0x4f515d(0x268)]),console['error'](_0x4f515d(0x20b)+_0x5d41f6));const _0x343173=await withSpinner(_0x4f515d(0x253)+_0x5d41f6+_0x4f515d(0x185),()=>_0x5f0ee2[_0x4f515d(0x239)][_0x4f515d(0x1a8)](_0x5d41f6),{'verbose':_0x3011f0[_0x4f515d(0x28e)]}),_0x255043=_0x343173['data'],_0x319b8f=await withSpinner(_0x4f515d(0x26a)+_0x5d41f6+'\x27...',()=>_0x5f0ee2[_0x4f515d(0x239)][_0x4f515d(0x17a)](_0x255043),{'verbose':_0x3011f0[_0x4f515d(0x28e)]}),_0x522f2f=_0x319b8f['data'];return _0x3011f0[_0x4f515d(0x27e)]==='json'||_0x3011f0[_0x4f515d(0x27e)]===_0x4f515d(0x1d0)?await handleSDKOutput([{'sql':_0x522f2f}],_0x3011f0):console[_0x4f515d(0x337)](_0x522f2f),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x322);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x138);async[a31_0x5bbcfa(0x232)](_0x42b4ab){const _0x90db13=a31_0x5bbcfa,{options:_0x244ecb,args:_0x34475a,tdx:_0x2ade20}=_0x42b4ab,_0x4d447f=_0x34475a[0x0]||_0x244ecb[_0x90db13(0x155)];if(!_0x4d447f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0x90db13(0x228)),0x1;_0x244ecb['verbose']&&(console['error'](_0x90db13(0x297)+_0x244ecb['site']),console[_0x90db13(0x207)](_0x90db13(0x20b)+_0x4d447f));const _0x16b542=await withSpinner(_0x90db13(0x253)+_0x4d447f+_0x90db13(0x185),()=>_0x2ade20[_0x90db13(0x239)]['resolveParentId'](_0x4d447f),{'verbose':_0x244ecb['verbose']}),_0x5c282e=_0x16b542[_0x90db13(0x15e)],_0x1f15f2=await withSpinner(_0x90db13(0x26a)+_0x4d447f+'\x27...',()=>_0x2ade20['segment']['getParentSQL'](_0x5c282e),{'verbose':_0x244ecb[_0x90db13(0x28e)]});let _0x70fc6e=_0x1f15f2[_0x90db13(0x15e)];const _0x261fd7=resolveLimit(_0x244ecb['limit'],DEFAULT_DISPLAY_LIMIT),_0xec04c0=/\bLIMIT\s+\d+/i[_0x90db13(0x205)](_0x70fc6e);!_0xec04c0&&(_0x70fc6e=_0x70fc6e[_0x90db13(0x164)]()[_0x90db13(0x261)](/;+$/,''),_0x70fc6e=_0x90db13(0x2c0)+_0x70fc6e+_0x90db13(0x2f3)+_0x261fd7);_0x244ecb['verbose']&&console['error'](_0x90db13(0x317)+_0x70fc6e);const _0x5d44a5=await withProgressSpinner(_0x90db13(0x229),async _0x3d231e=>{const _0x39815b=_0x90db13,_0x506770=await _0x2ade20[_0x39815b(0x1ad)]['execute'](_0x70fc6e,{'catalog':'td','schema':_0x39815b(0x230),'onJobId':_0x45baea=>{const _0x4a87f8=_0x39815b;_0x3d231e[_0x4a87f8(0x1e4)](_0x45baea);}});return _0x506770;},{'verbose':_0x244ecb['verbose']}),_0x3e2c26=_0x5d44a5[_0x90db13(0x15e)],_0x9b27a=_0x3e2c26[_0x90db13(0x264)]?'\x20[Job\x20ID:\x20'+_0x3e2c26['jobId']+']':'';return console[_0x90db13(0x207)](_0x90db13(0x223)+_0x3e2c26['stats'][_0x90db13(0x15c)][_0x90db13(0x339)]()+_0x90db13(0x179)+(_0x90db13(0x352)+formatElapsed(_0x3e2c26['stats'][_0x90db13(0x1a5)])+_0x9b27a)),await handleQueryOutput(_0x3e2c26,_0x244ecb),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x1c1);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x1f6);async[a31_0x5bbcfa(0x232)](_0x5a1173){const _0x46bbf9=a31_0x5bbcfa,{options:_0x4afa89,args:_0x2c48c8,tdx:_0x4a1743}=_0x5a1173,_0x73ffc1=_0x2c48c8[0x0],_0x39c273=await withSpinner(_0x73ffc1?'Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27'+_0x73ffc1+'\x27...':'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x4a1743[_0x46bbf9(0x299)][_0x46bbf9(0x16e)](),{'verbose':_0x4afa89[_0x46bbf9(0x28e)]});let _0x46de44=_0x39c273[_0x46bbf9(0x15e)][_0x46bbf9(0x262)](_0x401890=>_0x401890[_0x46bbf9(0x13e)]);if(_0x73ffc1){const _0x4466d7=_0x73ffc1['replace'](/[.+^${}()|[\]\\]/g,_0x46bbf9(0x148))[_0x46bbf9(0x261)](/\*/g,'.*')[_0x46bbf9(0x261)](/\?/g,'.'),_0x37b156=new RegExp('^'+_0x4466d7+'$','i');_0x46de44=_0x46de44[_0x46bbf9(0x262)](_0x17e62b=>_0x37b156[_0x46bbf9(0x205)](_0x17e62b[_0x46bbf9(0x247)]));}_0x46de44[_0x46bbf9(0x18b)]((_0x4a1cfd,_0x220382)=>_0x4a1cfd['name'][_0x46bbf9(0x1b9)](_0x220382['name'])),console[_0x46bbf9(0x207)](_0x46bbf9(0x2c1)+_0x46de44[_0x46bbf9(0x141)]+'\x20RT-enabled\x20parent\x20segment'+(_0x46de44[_0x46bbf9(0x141)]!==0x1?'s':''));const _0x28d198=_0x389f1c=>{const _0x48d5b9=_0x46bbf9;return getConsoleNextUrl(_0x4afa89[_0x48d5b9(0x268)],_0x48d5b9(0x2c6)+_0x389f1c);};if(_0x4afa89[_0x46bbf9(0x27e)]==='json'||_0x4afa89[_0x46bbf9(0x27e)]==='jsonl'){const _0x6ef7f3=_0x46de44[_0x46bbf9(0x20a)](_0x36b18f=>({..._0x36b18f,'url':_0x28d198(_0x36b18f['id'])}));await handleSDKOutput(_0x6ef7f3,_0x4afa89);}else{if(_0x46de44[_0x46bbf9(0x141)]===0x0)console[_0x46bbf9(0x337)](_0x46bbf9(0x1ca));else for(const _0x4163bb of _0x46de44){const _0x173c5f=_0x4163bb[_0x46bbf9(0x225)]?a31_0x27c26e[_0x46bbf9(0x1be)]('\x20('+formatRows(_0x4163bb[_0x46bbf9(0x225)])+')'):'',_0x1cb274=hyperlink(_0x4163bb[_0x46bbf9(0x247)],_0x28d198(_0x4163bb['id']));console[_0x46bbf9(0x337)]('⚡\x20'+_0x1cb274+_0x173c5f);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x2ea);['description']=a31_0x5bbcfa(0x19a);async[a31_0x5bbcfa(0x232)](_0x108377){const _0x3281d6=a31_0x5bbcfa,{options:_0x2b16f5,args:_0xbf7e29,tdx:_0x57e161}=_0x108377,_0x40e319=_0xbf7e29[0x0]||_0x2b16f5[_0x3281d6(0x155)];if(!_0x40e319)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a'+_0x3281d6(0x248)),0x1;const _0x52060c=resolveYamlFile(_0x40e319);if(!existsSync(_0x52060c))return showFileNotFoundError(_0x52060c,_0x40e319),0x1;let _0x2bae8f;try{_0x2bae8f=readFileSync(_0x52060c,_0x3281d6(0x2dc));}catch(_0x213f4e){const _0xd850e0=_0x213f4e instanceof Error?_0x213f4e[_0x3281d6(0x284)]:String(_0x213f4e);return console[_0x3281d6(0x207)](_0x3281d6(0x2bb)+_0xd850e0),0x1;}const _0x239f49=createCommandSpinner(a31_0x27c26e[_0x3281d6(0x1be)](_0x3281d6(0x29f)),{'verbose':_0x2b16f5[_0x3281d6(0x28e)]});_0x239f49[_0x3281d6(0x157)]();const _0x24b60d={'realtime':!![],'onProgress':_0x1e9c4b=>{const _0x1b91f5=_0x3281d6;_0x239f49[_0x1b91f5(0x19d)]=formatProgressMessage(_0x1e9c4b);}};let _0x14678e;try{_0x14678e=await _0x57e161[_0x3281d6(0x239)]['validateParentYaml'](_0x2bae8f,_0x24b60d),_0x239f49['stop']();}catch(_0x4ae63b){_0x239f49[_0x3281d6(0x135)]();throw _0x4ae63b;}console[_0x3281d6(0x207)]('\x0a'+a31_0x27c26e[_0x3281d6(0x146)](_0x3281d6(0x226))+'\x20'+_0x14678e['name']),console[_0x3281d6(0x207)]('═'[_0x3281d6(0x1a6)](0x3c)),displayRealtimeValidation(_0x14678e),console[_0x3281d6(0x207)]('─'[_0x3281d6(0x1a6)](0x3c));if(_0x14678e[_0x3281d6(0x20f)][_0x3281d6(0x141)]>0x0){console[_0x3281d6(0x207)]('\x0a'+a31_0x27c26e[_0x3281d6(0x172)](_0x3281d6(0x259)));for(const _0x4846aa of _0x14678e[_0x3281d6(0x20f)]){console[_0x3281d6(0x207)]('\x20\x20'+a31_0x27c26e[_0x3281d6(0x172)]('•')+'\x20'+_0x4846aa);}}return _0x14678e[_0x3281d6(0x150)]&&console[_0x3281d6(0x207)]('\x0a'+a31_0x27c26e[_0x3281d6(0x2a3)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x14678e['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x17d);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x2ef);async['execute'](_0x5b0541){const _0x45ae46=a31_0x5bbcfa,{options:_0x17fd0b,args:_0x502d0a,tdx:_0x213fe2}=_0x5b0541,_0x796d9e=_0x502d0a[0x0]||_0x17fd0b[_0x45ae46(0x155)];if(!_0x796d9e)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a'+_0x45ae46(0x221)),0x1;_0x17fd0b[_0x45ae46(0x28e)]&&(console[_0x45ae46(0x207)]('Site:\x20'+_0x17fd0b[_0x45ae46(0x268)]),console[_0x45ae46(0x207)](_0x45ae46(0x20b)+_0x796d9e));const _0xcd575e=await withSpinner(_0x45ae46(0x253)+_0x796d9e+'\x27...',()=>_0x213fe2['segment']['resolveParentId'](_0x796d9e),{'verbose':_0x17fd0b[_0x45ae46(0x28e)]}),_0x26fe0a=_0xcd575e['data'],_0x54a2de=await withSpinner(_0x45ae46(0x306)+_0x796d9e+_0x45ae46(0x185),()=>_0x213fe2[_0x45ae46(0x299)]['listJourneys'](_0x26fe0a),{'verbose':_0x17fd0b[_0x45ae46(0x28e)]}),_0x47cb5d=_0x54a2de[_0x45ae46(0x15e)];console[_0x45ae46(0x207)](_0x45ae46(0x2c1)+_0x47cb5d[_0x45ae46(0x141)]+'\x20RT\x20journey'+(_0x47cb5d[_0x45ae46(0x141)]!==0x1?'s':''));if(_0x17fd0b['format']===_0x45ae46(0x2bc)||_0x17fd0b['format']==='jsonl')await handleSDKOutput(_0x47cb5d,_0x17fd0b);else{if(_0x47cb5d[_0x45ae46(0x141)]===0x0)console[_0x45ae46(0x337)](_0x45ae46(0x31c));else for(const _0x2b3bee of _0x47cb5d){const _0x1bf3a1=_0x2b3bee[_0x45ae46(0x151)]===_0x45ae46(0x162)?'🚀':'📝',_0x4762e4=_0x2b3bee[_0x45ae46(0x18c)]?a31_0x27c26e[_0x45ae46(0x27d)](_0x45ae46(0x16a)):'',_0x33f963=a31_0x27c26e[_0x45ae46(0x1be)]('\x20('+_0x2b3bee[_0x45ae46(0x30b)]+_0x45ae46(0x1c6)+(_0x2b3bee[_0x45ae46(0x30b)]!==0x1?'s':'')+')');console[_0x45ae46(0x337)](_0x1bf3a1+'\x20'+_0x2b3bee[_0x45ae46(0x247)]+_0x4762e4+_0x33f963);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x324);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x308);async[a31_0x5bbcfa(0x232)](_0x2c9c1c){const _0x124e10=a31_0x5bbcfa,{options:_0x1acb7e,args:_0x1ba92e,tdx:_0x1a54c8}=_0x2c9c1c,_0x1a8def=_0x1ba92e[0x0];if(!_0x1a8def)return console[_0x124e10(0x207)](a31_0x27c26e['red'](_0x124e10(0x28f))),console['error'](_0x124e10(0x34c)),console[_0x124e10(0x207)](a31_0x27c26e[_0x124e10(0x1be)](_0x124e10(0x24d))),0x1;_0x1acb7e[_0x124e10(0x28e)]&&(console['error'](_0x124e10(0x297)+_0x1acb7e[_0x124e10(0x268)]),console[_0x124e10(0x207)](_0x124e10(0x33e)+_0x1a8def));const _0x54836c=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1a8def+_0x124e10(0x185),()=>_0x1a54c8[_0x124e10(0x299)][_0x124e10(0x357)](_0x1a8def),{'verbose':_0x1acb7e[_0x124e10(0x28e)]}),_0x11768f=_0x54836c[_0x124e10(0x15e)];console[_0x124e10(0x207)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x11768f[_0x124e10(0x247)]+'\x27');if(_0x1acb7e[_0x124e10(0x27e)]===_0x124e10(0x2bc)||_0x1acb7e[_0x124e10(0x27e)]===_0x124e10(0x1d0))await handleSDKOutput([_0x11768f],_0x1acb7e);else{const _0x3848a5=_0x11768f[_0x124e10(0x151)]===_0x124e10(0x162)?'🚀':'📝',_0x55d54f=_0x11768f[_0x124e10(0x18c)]?a31_0x27c26e[_0x124e10(0x27d)]('\x20(paused)'):'';console['log'](_0x3848a5+'\x20'+_0x11768f[_0x124e10(0x247)]+_0x55d54f);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x2a4);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x2c4);async['execute'](_0x108881){const _0x2b5517=a31_0x5bbcfa,{options:_0x3ee1ce,args:_0x2da8e1,tdx:_0x38c271}=_0x108881,_0x43eee3=_0x2da8e1[0x0];if(!_0x43eee3)return console[_0x2b5517(0x207)](a31_0x27c26e[_0x2b5517(0x172)](_0x2b5517(0x28f))),console[_0x2b5517(0x207)](_0x2b5517(0x31e)),console['error'](a31_0x27c26e['dim'](_0x2b5517(0x24d))),0x1;_0x3ee1ce[_0x2b5517(0x28e)]&&(console[_0x2b5517(0x207)](_0x2b5517(0x297)+_0x3ee1ce[_0x2b5517(0x268)]),console[_0x2b5517(0x207)]('RT\x20Journey\x20ID:\x20'+_0x43eee3));const _0x2a06d7=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x43eee3+_0x2b5517(0x185),()=>_0x38c271[_0x2b5517(0x299)][_0x2b5517(0x210)](_0x43eee3),{'verbose':_0x3ee1ce[_0x2b5517(0x28e)]}),_0x1657ea=_0x2a06d7[_0x2b5517(0x15e)];console[_0x2b5517(0x207)](_0x2b5517(0x2be)+_0x1657ea[_0x2b5517(0x247)]+'\x27');if(_0x3ee1ce[_0x2b5517(0x27e)]===_0x2b5517(0x2bc)||_0x3ee1ce[_0x2b5517(0x27e)]==='jsonl')await handleSDKOutput([_0x1657ea],_0x3ee1ce);else{const _0x31fa71=_0x1657ea[_0x2b5517(0x151)]===_0x2b5517(0x162)?'🚀':'📝',_0x592a27=_0x1657ea['paused']?a31_0x27c26e[_0x2b5517(0x27d)]('\x20(paused)'):'';console[_0x2b5517(0x337)](_0x31fa71+'\x20'+_0x1657ea[_0x2b5517(0x247)]+_0x592a27);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]='ps:rt:configuration_versions';[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x2e6);async[a31_0x5bbcfa(0x232)](_0x445b85){const _0x346f59=a31_0x5bbcfa,{options:_0x31fad2,args:_0x5246e0,tdx:_0x129b6c}=_0x445b85,_0x2907d4=_0x5246e0[0x0]||_0x31fad2['parentSegment'];if(!_0x2907d4)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a'+_0x346f59(0x33b)),0x1;_0x31fad2[_0x346f59(0x28e)]&&(console[_0x346f59(0x207)]('Site:\x20'+_0x31fad2[_0x346f59(0x268)]),console[_0x346f59(0x207)](_0x346f59(0x20b)+_0x2907d4));const _0x5c1345=await withSpinner(_0x346f59(0x253)+_0x2907d4+'\x27...',()=>_0x129b6c[_0x346f59(0x239)][_0x346f59(0x1a8)](_0x2907d4),{'verbose':_0x31fad2[_0x346f59(0x28e)]}),_0x1dac84=_0x5c1345['data'],_0x22a00f=await withSpinner(_0x346f59(0x281)+_0x2907d4+_0x346f59(0x185),()=>_0x129b6c[_0x346f59(0x299)][_0x346f59(0x26b)](_0x1dac84),{'verbose':_0x31fad2[_0x346f59(0x28e)]}),_0x3f1263=_0x22a00f[_0x346f59(0x15e)];return console[_0x346f59(0x207)](_0x346f59(0x24e)),_0x31fad2[_0x346f59(0x27e)]===_0x346f59(0x2bc)||_0x31fad2[_0x346f59(0x27e)]===_0x346f59(0x1d0)?await handleSDKOutput([_0x3f1263],_0x31fad2):(console[_0x346f59(0x337)](_0x346f59(0x314)+_0x3f1263['id']),console[_0x346f59(0x337)](_0x346f59(0x132)+_0x3f1263[_0x346f59(0x244)]),console[_0x346f59(0x337)](_0x346f59(0x19c)+_0x3f1263['identifier']),console[_0x346f59(0x337)](_0x346f59(0x340)+_0x3f1263[_0x346f59(0x214)]),console[_0x346f59(0x337)]('status:\x20'+_0x3f1263[_0x346f59(0x1b3)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x209);[a31_0x5bbcfa(0x2f6)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async['execute'](_0x41c827){const _0x3ae614=a31_0x5bbcfa,{options:_0x536d5d,args:_0x4b8839,tdx:_0x4a7f5b}=_0x41c827,_0x71e97d=_0x4b8839[0x0]||_0x536d5d[_0x3ae614(0x155)];if(!_0x71e97d)return showParentSegmentNotSetError(_0x3ae614(0x328)+_0x3ae614(0x198)),0x1;const _0x500c4c=await withSpinner(_0x3ae614(0x253)+_0x71e97d+_0x3ae614(0x185),()=>_0x4a7f5b[_0x3ae614(0x239)][_0x3ae614(0x1a8)](_0x71e97d),{'verbose':_0x536d5d[_0x3ae614(0x28e)]}),_0x5b4381=_0x500c4c['data'],_0x51eea5=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x71e97d+_0x3ae614(0x185),()=>_0x4a7f5b[_0x3ae614(0x301)][_0x3ae614(0x16e)](_0x5b4381),{'verbose':_0x536d5d['verbose']}),_0x2f97b3=_0x51eea5['data'];console[_0x3ae614(0x207)]('✔\x20Found\x20'+_0x2f97b3[_0x3ae614(0x141)]+_0x3ae614(0x265)+(_0x2f97b3[_0x3ae614(0x141)]!==0x1?'s':''));if(_0x536d5d[_0x3ae614(0x27e)]===_0x3ae614(0x2bc)||_0x536d5d[_0x3ae614(0x27e)]===_0x3ae614(0x1d0))await handleSDKOutput(_0x2f97b3,_0x536d5d);else{if(_0x2f97b3[_0x3ae614(0x141)]===0x0)console[_0x3ae614(0x337)](_0x3ae614(0x203)),console[_0x3ae614(0x207)](a31_0x27c26e[_0x3ae614(0x271)](_0x3ae614(0x1e0)));else for(const _0x20ccac of _0x2f97b3){console[_0x3ae614(0x337)](a31_0x27c26e[_0x3ae614(0x146)](_0x20ccac[_0x3ae614(0x247)])+'\x20'+a31_0x27c26e[_0x3ae614(0x1be)]('(id:\x20'+_0x20ccac['id']+')'));_0x20ccac[_0x3ae614(0x2f6)]&&console['log']('\x20\x20'+a31_0x27c26e[_0x3ae614(0x1be)](_0x20ccac[_0x3ae614(0x2f6)]));if(_0x20ccac[_0x3ae614(0x152)]&&_0x20ccac['tokens']['length']>0x0)for(const _0xfeed75 of _0x20ccac[_0x3ae614(0x152)]){const _0x8b2778=_0xfeed75[_0x3ae614(0x235)]?.['length']?_0xfeed75[_0x3ae614(0x235)]['join'](',\x20'):_0x3ae614(0x153);console[_0x3ae614(0x337)]('\x20\x20'+a31_0x27c26e[_0x3ae614(0x271)](_0x3ae614(0x2fe))+'\x20'+_0xfeed75[_0x3ae614(0x247)]+'\x20'+a31_0x27c26e[_0x3ae614(0x1be)](_0x3ae614(0x266)+_0xfeed75['id']+')')),console[_0x3ae614(0x337)](_0x3ae614(0x2f9)+a31_0x27c26e[_0x3ae614(0x1be)](_0x3ae614(0x2c3))+'\x20'+_0x8b2778);}else console[_0x3ae614(0x337)]('\x20\x20'+a31_0x27c26e[_0x3ae614(0x1be)](_0x3ae614(0x20d)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x1e6);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x193);async[a31_0x5bbcfa(0x232)](_0x1deb62){const _0x396705=a31_0x5bbcfa,{options:_0x3cd4e3,args:_0x5eefed,tdx:_0x2650f9}=_0x1deb62,_0x50d2f2=_0x3cd4e3,_0x3ab3c2=_0x5eefed[0x0],_0x5be2d7=_0x5eefed[0x1]||_0x3cd4e3[_0x396705(0x155)];if(!_0x3ab3c2)return console[_0x396705(0x207)](_0x396705(0x1c2)),console['error'](_0x396705(0x32b)),console[_0x396705(0x207)](_0x396705(0x321)),0x1;if(!_0x5be2d7)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0xd83f5d=await withSpinner(_0x396705(0x253)+_0x5be2d7+'\x27...',()=>_0x2650f9[_0x396705(0x239)]['resolveParentId'](_0x5be2d7),{'verbose':_0x3cd4e3[_0x396705(0x28e)]}),_0x3cf884=_0xd83f5d[_0x396705(0x15e)],_0x54e725={'name':_0x3ab3c2,'description':_0x50d2f2[_0x396705(0x2f6)],'public':_0x50d2f2[_0x396705(0x14b)]},_0x3cb314=await withSpinner(_0x396705(0x2b6)+_0x3ab3c2+_0x396705(0x185),()=>_0x2650f9[_0x396705(0x301)][_0x396705(0x1a7)](_0x3cf884,_0x54e725),{'verbose':_0x3cd4e3[_0x396705(0x28e)]}),_0x3f6c5d=_0x3cb314[_0x396705(0x15e)];return console[_0x396705(0x207)]('✔\x20Created\x20personalization\x20service\x20\x27'+_0x3f6c5d[_0x396705(0x247)]+_0x396705(0x1de)+_0x3f6c5d['id']),await handleSDKOutput([_0x3f6c5d],_0x3cd4e3),0x0;}}function a31_0x1ae9(){const _0xe2f72b=['\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','Fetching\x20personalization\x20service\x20\x27','✔\x20Found\x20personalization\x20\x27','\x20\x20\x20','Creating\x20personalization\x20service\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','file','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','keyEventId','Error\x20reading\x20file:\x20','json','sections','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','column_name','SELECT\x20*\x20FROM\x20(\x0a','✔\x20Found\x20','Error:\x20File\x20not\x20found:\x20','allowed\x20IPs:','Resume\x20activations\x20in\x20an\x20RT\x20journey','To\x20view\x20sample\x20data:','/app/dw/parentSegments/','Error:\x20Service\x20ID\x20is\x20required','ps:pz:service:token:delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x27\x20(id:\x20','sampleData','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','listFields','Attributes:','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20to\x20configure\x20your\x20personalization\x20service','\x27\x20is\x20already\x20up\x20to\x20date','\x20\x20\x20\x20-\x20','sections:','/\x20directories\x20exist.','all','Name:\x20','using\x20the\x20default\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20\x20','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x20kill','utf-8','5674764gNSkuD','null','\x20--behavior\x20\x22<name>\x22','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','includeSensitive','Master\x20+\x20Attributes','entryCriteria:','segment:parent:list','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Get\x20current\x20RT\x20configuration\x20version\x20status','pushParentYaml','run','displayPreviewHints','ps:rt:validate','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Getting\x20personalization\x20\x27','Apply\x20changes\x20to\x20\x27','segment:parent:desc','List\x20RT\x20journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','tdx\x20ps\x20push\x20','getParentFull','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','folder-segment','Attempt:','description','varchar','42116cTkHzn','\x20\x20\x20\x20','Options:\x0a','web','Listing\x20fields\x20for\x20\x27','\x20--enriched','token:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Options\x20(one\x20required):\x0a','personalization','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','folderId','displayPreviewResults','Fetching\x20parent\x20segment\x20\x27','Listing\x20RT\x20journeys\x20for\x20\x27','coveragePercent','Pause\x20activations\x20in\x20an\x20RT\x20journey','\x27\x20and\x20run\x20workflow?','isDirectory','stageCount','displayBehaviorsStats','Table:\x20','Error\x20parsing\x20YAML:\x20','/app/workflows/','string','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment','List\x20available\x20fields\x20for\x20segmentation','id:\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Options:','SQL\x20query:\x0a','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','personalizationServices','5UUmubb','No\x20RT\x20journeys\x20found','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','idStitching','behaviorsFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','segment:parent:show','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','ps:rt:jn:pause','enriched','Fetching\x20current\x20configuration\x20for\x20\x27','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','✔\x20No\x20changes\x20-\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Attributes','behavior','attribute','ps:pz:delete','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20service(s)\x20configured','validateParentYaml','preview','\x20rows)','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','log','ps:pz:service:update','toLocaleString','Events:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','deletePersonalization','Coverage:','RT\x20Journey\x20ID:\x20','reduce','eventKind:\x20','scheduleOption','✔\x20Updated\x20personalization\x20service\x20\x27','entryCriteria','Source:','displayAttributesStats','\x0a\x20\x20\x20\x20}','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','workflowId','segment:parent:preview','listPersonalizations','foreignKey','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','keyEventId:','scheduleType','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','updateParent','in\x20','schemaValid','Error:\x20--name\x20is\x20required','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','Next\x20steps:','pauseJourney','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Error:\x20--database\x20and\x20--table\x20are\x20required','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','split','audienceId:\x20','customerGroup','label','stop','✔\x20Deleted\x20personalization\x20service\x20\x27','40FyPPeG','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','output','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','No\x20parent\x20segments\x20found','SELECT\x20*\x20FROM\x20','Error:\x20Personalization\x20ID\x20is\x20required','realtime_enabled','Show\x20personalization\x20service\x20details','11460zLgHrS','length','segment:parent:run','createPersonalization','No\x20parent\x20segments\x20match\x20pattern:\x20','Pattern:\x20','bold','Columns:','\x5c$&','✔\x20Created\x20parent\x20segment\x20\x27','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','public','Create\x20parent\x20segment\x20\x27','Created','\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}','segment:parent:sql','allValid','state','tokens','any','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','parentSegment','rowCount','start','10174104LLMBfF','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','displaySampleData','single','processedRows','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','data','To\x20cancel:','\x20--attribute\x20\x22<name>\x22','ps:pz:show','launched','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','trim','FINISHED','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','\x20(paused)','4213804pWcuSV','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Listing\x20parent\x20segments\x20matching\x20\x27','list','\x27\x20for\x20service\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','red','Behavior:','✔\x20Renamed\x20directory\x20to\x20','double','110RevYKH','yes','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','\x20rows\x20','getParentSQL','⚡\x20Not\x20enabled','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','ps:rt:jn:list','Deleting\x20personalization\x20service\x20\x27','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','\x0a✔\x20Workflow\x20started','.customers)','displayMasterInfo','\x20No\x20changes\x20-\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','\x27...','\x20Context\x20set:\x20','customersWithEvents','customers','Join:','\x20personalization','sort','paused','toFixed','database','Validate:','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','/\x20→\x20','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','match','apply','value','\x20\x20No\x20sample\x20data\x20available','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','personalization_services','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','\x20is\x20already\x20up\x20to\x20date','identifier:\x20','text','segment:parent:pull','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Deleting\x20personalization\x20\x27','Master\x20Table','elapsedTimeMillis','repeat','create','resolveParentId','unref','Personalization:','column','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','query','addBehaviors','user_id','runParent','Database:\x20','sourceTableError','status','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','createParent','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Available\x20attributes:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','localeCompare','win32','\x0a\x20\x20\x20\x20]','ps:pz:service:show','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','dim','/attempt/','\x20Added\x20RT\x202.0\x20template\x20section','ps:rt:list','Error:\x20Service\x20name\x20is\x20required','Status:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20stage','Fetching\x20customers\x20schema...','\x27\x20is\x20up\x20to\x20date','Creating','No\x20RT-enabled\x20parent\x20segments\x20found','createToken','displayRealtimeInfo','joinKey','Delete\x20a\x20personalization\x20service','behaviors','jsonl','Personalization\x20service\x20description','/sessions/','stitchingKeys','{\x0a\x20\x20\x22database\x22:\x20\x22','collectSchema','\x20=\x20','session','\x22\x20}','Patching\x20personalization\x20\x27','pullParentYaml','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x0aNew\x20parent\x20segment\x20\x27','Updated','\x27\x20with\x20ID:\x20','createdAt','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','keyEventCriteria','setJobId','Updating\x20parent\x20segment\x20\x27','ps:pz:service:create','Schema\x20saved\x20to\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','/\x20directory.\x0a','number','enabled','✔\x20Deleted\x20personalization\x20\x27','👥\x20','\x20Added\x20personalization\x20template\x20to\x20','Attribute:','6682248Gqflrk','true','Enriched:','sourceTableValid','Aborted.','ps:pz:patch','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Analyzing\x20changes...','Default','addBehaviorsFile','Join\x20on:','primaryKey','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','table','audienceId:','Output\x20file:\x20','705166mbCqsw','timezone','No\x20personalization\x20services\x20configured','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','test','Listing\x20parent\x20segments...','error','darwin','ps:pz:service:list','map','Parent\x20segment:\x20','RT\x202.0:','no\x20tokens\x20configured','join','errors','resumeJourney','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','deleteToken','ps:pz:init','eventKind','Creating\x20token\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','183fttaJP','columns','events','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','open','✔\x20Created\x20personalization\x20\x27','.yaml','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','\x20--attribute\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment','indexOf','✔\x20Query\x20completed:\x20Processed\x20','Error:','population','RT\x202.0\x20Validate:','workflowAttemptId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Executing\x20parent\x20segment\x20query...','getOutputDatabaseName','✔\x20Updated\x20parent\x20segment\x20\x27','interval','Creating\x20personalization\x20\x27','tdx\x20ps\x20preview\x20','Updating\x20personalization\x20service\x20\x27','information_schema','behavior_','execute','patch','Delete\x20a\x20realtime\x20personalization','allowedIps','\x20\x20Database:\x20','displayValidateResults','\x0aError:','segment','created:','Audience\x20ID:','getBehaviorNames','Output\x20Database:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','customerGroupFile','\x20tdx\x20wf\x20attempt\x20','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','Deleting\x20token\x20\x27','audienceId','dirname','push','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Validating\x20configuration...','Show\x20parent\x20segment\x20details','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','✔\x20Retrieved\x20RT\x20configuration\x20version','\x20\x201.\x20Edit\x20','workflowSessionId','\x20field','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','Resolving\x20parent\x20segment\x20\x27','segment:parent:fields','Overwrite\x20\x27','Customers:','type','\x20parent\x20segment\x20\x27','Errors:','page_view','customerPercent','formatSchemaJson','segment:parent:update','✔\x20Updated\x20personalization\x20\x27','includeSensitive:','totalEvents','replace','filter','segment:parent:push','jobId','\x20personalization\x20service','(id:\x20','\x20--interval\x20','site','\x20\x20\x20\x20\x20\x20','Fetching\x20SQL\x20for\x20\x27','getCurrentConfigVersion','ps:pz:create','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Preview:','Session:','/{name}.yml\x0a','cyan','\x20to\x20push\x20the\x20configuration','last_page_viewed','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','displaySummary','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x20--behavior\x20\x22','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','addAttributes','-1d','Listing\x20personalizations\x20for\x20\x27','yellow','format','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','YAML\x20file:\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','No\x20personalizations\x20configured','displayColumns','message','\x20behaviors','delete','ID\x20Stitching:','Create\x20a\x20realtime\x20personalization\x20entity','master','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','previewParentYaml','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','updated:','verbose','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','matchedCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','listParents','Fetching\x20behavior\x20list...','realtime:','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Site:\x20','ps:pz:list','realtime','\x0aNo\x20sample\x20data\x20available','segment:parent:view','schemaError','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','attributes','Validating\x20RT\x20configuration...','keys','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Error:\x20Token\x20\x27','green','ps:rt:jn:resume','Updating','Rows:','\x20configured','payload','parent_segment','%)\x20','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','⚡\x20Enabled','segment:parent:create','.yml','Finding\x20service\x20for\x20token...','patchPersonalization'];a31_0x1ae9=function(){return _0xe2f72b;};return a31_0x1ae9();}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x1bc);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x13f);async[a31_0x5bbcfa(0x232)](_0x1afcd4){const _0x33217a=a31_0x5bbcfa,{options:_0x2f009e,args:_0x2f2378,tdx:_0x1955c4}=_0x1afcd4,_0x514d94=_0x2f2378[0x0],_0x1bfe0b=_0x2f2378[0x1]||_0x2f009e[_0x33217a(0x155)];if(!_0x514d94)return console[_0x33217a(0x207)](_0x33217a(0x2c7)),console[_0x33217a(0x207)](_0x33217a(0x13a)),console[_0x33217a(0x207)](_0x33217a(0x1a2)),0x1;if(!_0x1bfe0b)return showParentSegmentNotSetError(_0x33217a(0x184)+_0x33217a(0x1a2)),0x1;const _0x12737b=await withSpinner(_0x33217a(0x253)+_0x1bfe0b+_0x33217a(0x185),()=>_0x1955c4[_0x33217a(0x239)][_0x33217a(0x1a8)](_0x1bfe0b),{'verbose':_0x2f009e[_0x33217a(0x28e)]}),_0x136ce1=_0x12737b[_0x33217a(0x15e)],_0xa9e66a=await withSpinner(_0x33217a(0x2b3)+_0x514d94+'\x27...',()=>_0x1955c4['personalization']['get'](_0x136ce1,_0x514d94),{'verbose':_0x2f009e[_0x33217a(0x28e)]}),_0x5829ef=_0xa9e66a[_0x33217a(0x15e)];if(_0x2f009e[_0x33217a(0x2bc)]||_0x2f009e[_0x33217a(0x1d0)])await handleSDKOutput([_0x5829ef],_0x2f009e);else{console['log'](a31_0x27c26e[_0x33217a(0x146)](_0x5829ef[_0x33217a(0x247)])+'\x20'+a31_0x27c26e['dim'](_0x33217a(0x266)+_0x5829ef['id']+')'));_0x5829ef[_0x33217a(0x2f6)]&&console[_0x33217a(0x337)]('\x20\x20'+a31_0x27c26e[_0x33217a(0x1be)](_0x5829ef[_0x33217a(0x2f6)]));console[_0x33217a(0x337)]('\x20\x20'+a31_0x27c26e['cyan']('public:')+'\x20'+(_0x5829ef[_0x33217a(0x14b)]?_0x33217a(0x177):'no'));if(_0x5829ef['tokens']&&_0x5829ef[_0x33217a(0x152)][_0x33217a(0x141)]>0x0)for(const _0x3afd50 of _0x5829ef[_0x33217a(0x152)]){const _0x223d11=_0x3afd50[_0x33217a(0x235)]?.[_0x33217a(0x141)]?_0x3afd50['allowedIps'][_0x33217a(0x20e)](',\x20'):'any';console[_0x33217a(0x337)]('\x20\x20'+a31_0x27c26e[_0x33217a(0x271)]('token:')+'\x20'+_0x3afd50[_0x33217a(0x247)]+'\x20'+a31_0x27c26e[_0x33217a(0x1be)]('(id:\x20'+_0x3afd50['id']+')')),console[_0x33217a(0x337)](_0x33217a(0x2f9)+a31_0x27c26e['dim'](_0x33217a(0x2c3))+'\x20'+_0x223d11);}else console[_0x33217a(0x337)]('\x20\x20'+a31_0x27c26e[_0x33217a(0x1be)](_0x33217a(0x20d)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]='ps:pz:service:delete';[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x1ce);async[a31_0x5bbcfa(0x232)](_0x3bd393){const _0x55f2d1=a31_0x5bbcfa,{options:_0x356483,args:_0x471fac,tdx:_0x13a59c}=_0x3bd393,_0x1a6d20=_0x471fac[0x0],_0x33f1d1=_0x471fac[0x1]||_0x356483[_0x55f2d1(0x155)];if(!_0x1a6d20)return console[_0x55f2d1(0x207)](_0x55f2d1(0x2c7)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x55f2d1(0x207)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x33f1d1)return showParentSegmentNotSetError(_0x55f2d1(0x295)+_0x55f2d1(0x291)),0x1;const _0x207645=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x33f1d1+_0x55f2d1(0x185),()=>_0x13a59c['segment'][_0x55f2d1(0x1a8)](_0x33f1d1),{'verbose':_0x356483['verbose']}),_0xcf346b=_0x207645['data'];return await withSpinner(_0x55f2d1(0x17e)+_0x1a6d20+_0x55f2d1(0x185),()=>_0x13a59c[_0x55f2d1(0x301)][_0x55f2d1(0x286)](_0xcf346b,_0x1a6d20),{'verbose':_0x356483[_0x55f2d1(0x28e)]}),console['error'](_0x55f2d1(0x136)+_0x1a6d20+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{['name']=a31_0x5bbcfa(0x338);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x355);async['execute'](_0x499b8c){const _0x28f6e2=a31_0x5bbcfa,{options:_0x4253cb,args:_0x12de94,tdx:_0x29972e}=_0x499b8c,_0x32f0de=_0x4253cb,_0xcda782=_0x12de94[0x0],_0x1defd7=_0x12de94[0x1]||_0x4253cb['parentSegment'];if(!_0xcda782)return console[_0x28f6e2(0x207)](_0x28f6e2(0x2c7)),console[_0x28f6e2(0x207)](_0x28f6e2(0x276)),console['error'](_0x28f6e2(0x21b)),0x1;if(!_0x32f0de['name'])return console[_0x28f6e2(0x207)](_0x28f6e2(0x354)),console[_0x28f6e2(0x207)](_0x28f6e2(0x276)),0x1;if(!_0x1defd7)return showParentSegmentNotSetError(_0x28f6e2(0x279)+_0x28f6e2(0x21b)),0x1;const _0x18057c=await withSpinner(_0x28f6e2(0x253)+_0x1defd7+_0x28f6e2(0x185),()=>_0x29972e[_0x28f6e2(0x239)][_0x28f6e2(0x1a8)](_0x1defd7),{'verbose':_0x4253cb[_0x28f6e2(0x28e)]}),_0x3bd54c=_0x18057c[_0x28f6e2(0x15e)],_0x2c2880={'name':_0x32f0de['name']};_0x32f0de[_0x28f6e2(0x2f6)]!==undefined&&(_0x2c2880[_0x28f6e2(0x2f6)]=_0x32f0de[_0x28f6e2(0x2f6)]);const _0x6a508e=await withSpinner(_0x28f6e2(0x22f)+_0xcda782+_0x28f6e2(0x185),()=>_0x29972e[_0x28f6e2(0x301)][_0x28f6e2(0x233)](_0x3bd54c,_0xcda782,_0x2c2880),{'verbose':_0x4253cb[_0x28f6e2(0x28e)]}),_0x508acd=_0x6a508e[_0x28f6e2(0x15e)];return console['error'](_0x28f6e2(0x342)+_0x508acd[_0x28f6e2(0x247)]+'\x27'),await handleSDKOutput([_0x508acd],_0x4253cb),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]='ps:pz:service:token:create';[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x169);async['execute'](_0x114d71){const _0x2f6577=a31_0x5bbcfa,{options:_0x599239,args:_0x5d78b3,tdx:_0x355a81}=_0x114d71,_0x4597a8=_0x599239,_0x412990=_0x5d78b3[0x0],_0x306e80=_0x5d78b3[0x1],_0x2960f2=_0x5d78b3[0x2]||_0x599239[_0x2f6577(0x155)];if(!_0x412990)return console[_0x2f6577(0x207)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x2f6577(0x207)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x2f6577(0x207)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x306e80)return console[_0x2f6577(0x207)](_0x2f6577(0x2c7)),console[_0x2f6577(0x207)](_0x2f6577(0x2ff)),console[_0x2f6577(0x207)](_0x2f6577(0x1e8)),0x1;if(!_0x2960f2)return showParentSegmentNotSetError(_0x2f6577(0x154)+_0x2f6577(0x1e8)),0x1;const _0x23352f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2960f2+_0x2f6577(0x185),()=>_0x355a81[_0x2f6577(0x239)][_0x2f6577(0x1a8)](_0x2960f2),{'verbose':_0x599239[_0x2f6577(0x28e)]}),_0x5a41e7=_0x23352f[_0x2f6577(0x15e)],_0x26661f={'name':_0x412990};_0x4597a8['allowedIps']&&(_0x26661f[_0x2f6577(0x235)]=_0x4597a8[_0x2f6577(0x235)][_0x2f6577(0x131)](',')[_0x2f6577(0x20a)](_0x17d05a=>_0x17d05a[_0x2f6577(0x164)]()));_0x4597a8[_0x2f6577(0x2f6)]&&(_0x26661f[_0x2f6577(0x2f6)]=_0x4597a8[_0x2f6577(0x2f6)]);const _0x3020c6=await withSpinner(_0x2f6577(0x215)+_0x412990+_0x2f6577(0x16f)+_0x306e80+_0x2f6577(0x185),()=>_0x355a81[_0x2f6577(0x301)][_0x2f6577(0x1cb)](_0x5a41e7,_0x306e80,_0x26661f),{'verbose':_0x599239[_0x2f6577(0x28e)]}),_0x4a4ad3=_0x3020c6[_0x2f6577(0x15e)];return console[_0x2f6577(0x207)]('✔\x20Created\x20token\x20\x27'+_0x4a4ad3[_0x2f6577(0x247)]+_0x2f6577(0x1de)+_0x4a4ad3['id']),_0x4a4ad3[_0x2f6577(0x196)]&&(console[_0x2f6577(0x207)](a31_0x27c26e[_0x2f6577(0x27d)](_0x2f6577(0x2b2))),console[_0x2f6577(0x207)](a31_0x27c26e[_0x2f6577(0x271)](_0x4a4ad3[_0x2f6577(0x196)])),console['error']('')),await handleSDKOutput([_0x4a4ad3],_0x599239),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{['name']=a31_0x5bbcfa(0x2c8);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x1f7);async[a31_0x5bbcfa(0x232)](_0x275814){const _0x3605c1=a31_0x5bbcfa,{options:_0xe0ed5b,args:_0x2a0312,tdx:_0x488db1}=_0x275814,_0x25682d=_0x2a0312[0x0],_0xf71cfb=_0x2a0312[0x1]||_0xe0ed5b[_0x3605c1(0x155)];if(!_0x25682d)return console[_0x3605c1(0x207)]('Error:\x20Token\x20ID\x20is\x20required'),console[_0x3605c1(0x207)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x3605c1(0x207)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0xf71cfb)return showParentSegmentNotSetError(_0x3605c1(0x1c4)+_0x3605c1(0x274)),0x1;const _0x429174=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf71cfb+_0x3605c1(0x185),()=>_0x488db1[_0x3605c1(0x239)][_0x3605c1(0x1a8)](_0xf71cfb),{'verbose':_0xe0ed5b['verbose']}),_0x3ccd7f=_0x429174[_0x3605c1(0x15e)],_0x51f9d4=await withSpinner(_0x3605c1(0x2b0),()=>_0x488db1[_0x3605c1(0x301)]['list'](_0x3ccd7f),{'verbose':_0xe0ed5b['verbose']}),_0x1554ad=_0x51f9d4[_0x3605c1(0x15e)];let _0x50b6ab;for(const _0x21b073 of _0x1554ad){if(_0x21b073['tokens']?.['some'](_0x4b22e5=>_0x4b22e5['id']===_0x25682d)){_0x50b6ab=_0x21b073['id'];break;}}if(!_0x50b6ab)return console[_0x3605c1(0x207)](_0x3605c1(0x2a2)+_0x25682d+_0x3605c1(0x1bd)),0x1;const _0x24b51e=await withSpinner(_0x3605c1(0x243)+_0x25682d+'\x27...',()=>_0x488db1[_0x3605c1(0x301)][_0x3605c1(0x212)](_0x3ccd7f,_0x50b6ab,_0x25682d),{'verbose':_0xe0ed5b[_0x3605c1(0x28e)]}),_0x2f28e9=_0x24b51e[_0x3605c1(0x15e)];return console['error']('✔\x20Deleted\x20token\x20\x27'+(_0x2f28e9[_0x3605c1(0x247)]||_0x25682d)+'\x27'),await handleSDKOutput([_0x2f28e9],_0xe0ed5b),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x298);['description']=a31_0x5bbcfa(0x12d);async['execute'](_0x503328){const _0x2415d5=a31_0x5bbcfa,{options:_0x218be6,args:_0x40fe20,tdx:_0x1b9b90}=_0x503328,_0x162027=_0x40fe20[0x0]||_0x218be6[_0x2415d5(0x155)];if(!_0x162027)return showParentSegmentNotSetError(_0x2415d5(0x216)+_0x2415d5(0x312)),0x1;const _0x29ddb9=await withSpinner(_0x2415d5(0x253)+_0x162027+_0x2415d5(0x185),()=>_0x1b9b90[_0x2415d5(0x239)]['resolveParentId'](_0x162027),{'verbose':_0x218be6[_0x2415d5(0x28e)]}),_0x1c5696=_0x29ddb9[_0x2415d5(0x15e)],_0xe68311=await withSpinner(_0x2415d5(0x27c)+_0x162027+_0x2415d5(0x185),()=>_0x1b9b90[_0x2415d5(0x301)][_0x2415d5(0x34a)](_0x1c5696),{'verbose':_0x218be6[_0x2415d5(0x28e)]}),_0x3d679e=_0xe68311[_0x2415d5(0x15e)];console['error'](_0x2415d5(0x2c1)+_0x3d679e[_0x2415d5(0x141)]+_0x2415d5(0x18a)+(_0x3d679e['length']!==0x1?'s':''));if(_0x218be6[_0x2415d5(0x27e)]==='json'||_0x218be6[_0x2415d5(0x27e)]===_0x2415d5(0x1d0))await handleSDKOutput(_0x3d679e,_0x218be6);else{if(_0x3d679e[_0x2415d5(0x141)]===0x0)console[_0x2415d5(0x337)](_0x2415d5(0x282));else for(const _0x309c69 of _0x3d679e){console['log'](a31_0x27c26e[_0x2415d5(0x146)](_0x309c69[_0x2415d5(0x247)])+'\x20'+a31_0x27c26e['dim'](_0x2415d5(0x266)+_0x309c69['id']+')'));_0x309c69[_0x2415d5(0x2f6)]&&console[_0x2415d5(0x337)]('\x20\x20'+a31_0x27c26e['dim'](_0x309c69[_0x2415d5(0x2f6)]));const _0xddd05e=_0x309c69[_0x2415d5(0x2bd)]?.[_0x2415d5(0x141)]||0x0;console[_0x2415d5(0x337)]('\x20\x20'+a31_0x27c26e[_0x2415d5(0x271)](_0x2415d5(0x2d4))+'\x20'+_0xddd05e);if(_0x309c69[_0x2415d5(0x2bd)]&&_0x309c69[_0x2415d5(0x2bd)][_0x2415d5(0x141)]>0x0)for(const _0x1df7b6 of _0x309c69['sections']){console['log'](_0x2415d5(0x2d3)+_0x1df7b6[_0x2415d5(0x247)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x161);['description']='Show\x20a\x20specific\x20realtime\x20personalization';async[a31_0x5bbcfa(0x232)](_0x15e226){const _0x24bce8=a31_0x5bbcfa,{options:_0xf35457,args:_0x3f6eb4,tdx:_0x1ab956}=_0x15e226,_0x4d2eff=_0x3f6eb4[0x0];if(!_0x4d2eff)return console[_0x24bce8(0x207)](_0x24bce8(0x13d)),console[_0x24bce8(0x207)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x122615=await withSpinner(_0x24bce8(0x2ec)+_0x4d2eff+_0x24bce8(0x185),()=>_0x1ab956['personalization']['getPersonalization'](_0x4d2eff),{'verbose':_0xf35457[_0x24bce8(0x28e)]}),_0x5051c1=_0x122615[_0x24bce8(0x15e)];console[_0x24bce8(0x207)](_0x24bce8(0x2b4)+_0x5051c1['name']+'\x27');if(_0xf35457[_0x24bce8(0x27e)]===_0x24bce8(0x2bc)||_0xf35457[_0x24bce8(0x27e)]==='jsonl')await handleSDKOutput([_0x5051c1],_0xf35457);else{console[_0x24bce8(0x337)](a31_0x27c26e[_0x24bce8(0x146)](_0x5051c1[_0x24bce8(0x247)])+'\x20'+a31_0x27c26e[_0x24bce8(0x1be)](_0x24bce8(0x266)+_0x5051c1['id']+')'));_0x5051c1[_0x24bce8(0x2f6)]&&console[_0x24bce8(0x337)]('\x20\x20'+a31_0x27c26e[_0x24bce8(0x1be)](_0x5051c1[_0x24bce8(0x2f6)]));_0x5051c1['audienceId']&&console[_0x24bce8(0x337)]('\x20\x20'+a31_0x27c26e['cyan'](_0x24bce8(0x1ff))+'\x20'+_0x5051c1[_0x24bce8(0x244)]);console[_0x24bce8(0x337)]('\x20\x20'+a31_0x27c26e['cyan'](_0x24bce8(0x23a))+'\x20'+_0x5051c1[_0x24bce8(0x1df)]),console[_0x24bce8(0x337)]('\x20\x20'+a31_0x27c26e[_0x24bce8(0x271)](_0x24bce8(0x28d))+'\x20'+_0x5051c1['updatedAt']);const _0x46c695=_0x5051c1['sections']?.['length']||0x0;console[_0x24bce8(0x337)]('\x20\x20'+a31_0x27c26e[_0x24bce8(0x271)](_0x24bce8(0x2d4))+'\x20'+_0x46c695);if(_0x5051c1['sections']&&_0x5051c1[_0x24bce8(0x2bd)]['length']>0x0)for(const _0x3969df of _0x5051c1[_0x24bce8(0x2bd)]){console['log'](_0x24bce8(0x2f9)+a31_0x27c26e[_0x24bce8(0x146)](_0x3969df['name'])+'\x20'+a31_0x27c26e[_0x24bce8(0x1be)](_0x24bce8(0x266)+_0x3969df['id']+')')),_0x3969df['entryCriteria']&&(console[_0x24bce8(0x337)]('\x20\x20\x20\x20\x20\x20'+a31_0x27c26e[_0x24bce8(0x271)](_0x24bce8(0x2e3))+'\x20'+_0x3969df[_0x24bce8(0x343)]['name']),_0x3969df['entryCriteria'][_0x24bce8(0x1e3)]?.[_0x24bce8(0x2ba)]&&console['log'](_0x24bce8(0x2d9)+a31_0x27c26e[_0x24bce8(0x271)](_0x24bce8(0x34e))+'\x20'+_0x3969df['entryCriteria']['keyEventCriteria'][_0x24bce8(0x2ba)])),_0x3969df[_0x24bce8(0x2a8)]&&console[_0x24bce8(0x337)](_0x24bce8(0x269)+a31_0x27c26e[_0x24bce8(0x271)]('payload:')+'\x20'+JSON['stringify'](_0x3969df[_0x24bce8(0x2a8)])),_0x3969df[_0x24bce8(0x2e1)]&&console[_0x24bce8(0x337)](_0x24bce8(0x269)+a31_0x27c26e[_0x24bce8(0x271)](_0x24bce8(0x25f))+'\x20true');}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x32f);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x234);async[a31_0x5bbcfa(0x232)](_0x5e69a6){const _0x52c1fc=a31_0x5bbcfa,{options:_0x2ea6b6,args:_0x3907de,tdx:_0x2b28a7}=_0x5e69a6,_0x45b945=_0x3907de[0x0];if(!_0x45b945)return console[_0x52c1fc(0x207)](_0x52c1fc(0x13d)),console[_0x52c1fc(0x207)](_0x52c1fc(0x159)),0x1;return await withSpinner(_0x52c1fc(0x1a3)+_0x45b945+_0x52c1fc(0x185),()=>_0x2b28a7[_0x52c1fc(0x301)][_0x52c1fc(0x33c)](_0x45b945),{'verbose':_0x2ea6b6[_0x52c1fc(0x28e)]}),console[_0x52c1fc(0x207)](_0x52c1fc(0x1ec)+_0x45b945+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x26c);[a31_0x5bbcfa(0x2f6)]=a31_0x5bbcfa(0x288);async['execute'](_0x55375a){const _0x49f501=a31_0x5bbcfa,{options:_0x26a79a,tdx:_0x253105}=_0x55375a,_0x1a0516=_0x26a79a;let _0x59f2d8;if(_0x1a0516[_0x49f501(0x2b8)]){_0x59f2d8=await loadJSON(_0x1a0516[_0x49f501(0x2b8)],!![]);if(!_0x59f2d8['relationships']?.['parentFolder'])return console[_0x49f501(0x207)](_0x49f501(0x204)),console['error'](_0x49f501(0x2e0)),console[_0x49f501(0x207)](_0x49f501(0x14e)),0x1;}else{if(!_0x1a0516[_0x49f501(0x247)])return console[_0x49f501(0x207)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x49f501(0x207)](_0x49f501(0x211)),console[_0x49f501(0x207)](_0x49f501(0x2eb)),0x1;if(_0x1a0516[_0x49f501(0x2f6)]===undefined)return console[_0x49f501(0x207)](_0x49f501(0x166)),console[_0x49f501(0x207)](_0x49f501(0x211)),console[_0x49f501(0x207)](_0x49f501(0x2eb)),0x1;if(_0x1a0516[_0x49f501(0x303)]===undefined)return console[_0x49f501(0x207)](_0x49f501(0x190)),console['error'](_0x49f501(0x241)),0x1;let _0x258262=_0x1a0516[_0x49f501(0x244)];if(!_0x258262&&_0x26a79a[_0x49f501(0x155)]){const _0xe63f51=await withSpinner(_0x49f501(0x253)+_0x26a79a['parentSegment']+_0x49f501(0x185),()=>_0x253105['segment'][_0x49f501(0x1a8)](_0x26a79a[_0x49f501(0x155)]),{'verbose':_0x26a79a[_0x49f501(0x28e)]});_0x258262=_0xe63f51[_0x49f501(0x15e)];}let _0x1e35d3;_0x1a0516[_0x49f501(0x2bd)]&&(_0x1e35d3=await loadJSON(_0x1a0516[_0x49f501(0x2bd)],![]));const _0x390a6d=_0x1a0516[_0x49f501(0x303)]===_0x49f501(0x2de)?null:{'id':_0x1a0516[_0x49f501(0x303)],'type':_0x49f501(0x2f4)};_0x59f2d8={'attributes':{'name':_0x1a0516[_0x49f501(0x247)],'description':_0x1a0516[_0x49f501(0x2f6)]||null,..._0x258262!==undefined&&{'audienceId':_0x258262},..._0x1e35d3!==undefined&&{'sections':_0x1e35d3}},'relationships':{'parentFolder':{'data':_0x390a6d}}};}const _0x184ee7=await withSpinner(_0x49f501(0x22d)+(_0x59f2d8[_0x49f501(0x29e)]?.[_0x49f501(0x247)]??'')+_0x49f501(0x185),()=>_0x253105[_0x49f501(0x301)][_0x49f501(0x143)](_0x59f2d8),{'verbose':_0x26a79a[_0x49f501(0x28e)]}),_0x10150b=_0x184ee7[_0x49f501(0x15e)];return console[_0x49f501(0x207)](_0x49f501(0x21d)+_0x10150b[_0x49f501(0x247)]+_0x49f501(0x1de)+_0x10150b['id']),await handleSDKOutput([_0x10150b],_0x26a79a),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x1f5);[a31_0x5bbcfa(0x2f6)]='Update\x20a\x20realtime\x20personalization\x20entity';async[a31_0x5bbcfa(0x232)](_0x46cdf2){const _0x741007=a31_0x5bbcfa,{options:_0x180b81,args:_0x49c107}=_0x46cdf2,_0x3b0915=_0x180b81,_0x426d26=_0x49c107[0x0];if(!_0x426d26)return console[_0x741007(0x207)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x741007(0x207)](_0x741007(0x2ab)),console[_0x741007(0x207)](_0x741007(0x2e5)),0x1;let _0xdc7fbd;if(_0x3b0915[_0x741007(0x2b8)])_0xdc7fbd=await loadJSON(_0x3b0915[_0x741007(0x2b8)],!![]);else{if(!_0x3b0915['name'])return console[_0x741007(0x207)](_0x741007(0x15d)),console[_0x741007(0x207)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;if(_0x3b0915[_0x741007(0x2f6)]===undefined)return console['error'](_0x741007(0x166)),console['error'](_0x741007(0x2ab)),0x1;let _0x2f8dc2;_0x3b0915[_0x741007(0x2bd)]&&(_0x2f8dc2=await loadJSON(_0x3b0915[_0x741007(0x2bd)],![])),_0xdc7fbd={'attributes':{'name':_0x3b0915['name'],'description':_0x3b0915[_0x741007(0x2f6)]||null,..._0x2f8dc2!==undefined&&{'sections':_0x2f8dc2}}};}const {tdx:_0xe570c4}=_0x46cdf2,_0x42316a=await withSpinner(_0x741007(0x1d9)+_0x426d26+_0x741007(0x185),()=>_0xe570c4[_0x741007(0x301)][_0x741007(0x2b1)](_0x426d26,_0xdc7fbd),{'verbose':_0x180b81[_0x741007(0x28e)]}),_0x115dae=_0x42316a[_0x741007(0x15e)];return console[_0x741007(0x207)](_0x741007(0x25e)+_0x115dae[_0x741007(0x247)]+_0x741007(0x2ca)+_0x115dae['id']+')'),await handleSDKOutput([_0x115dae],_0x180b81),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x5bbcfa(0x247)]=a31_0x5bbcfa(0x213);['description']='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async['execute'](_0x330791){const _0x5bd7df=a31_0x5bbcfa,{options:_0x38635d,args:_0x6aed35}=_0x330791,_0x4ad7c7=_0x6aed35[0x0]||_0x38635d[_0x5bd7df(0x155)];if(!_0x4ad7c7)return showParentSegmentNotSetError(_0x5bd7df(0x178)+_0x5bd7df(0x170)),0x1;const _0x588064=resolveYamlFile(_0x4ad7c7);if(!existsSync(_0x588064))return showFileNotFoundError(_0x588064,_0x4ad7c7),0x1;let _0x5b15b3;try{_0x5b15b3=readFileSync(_0x588064,'utf-8');}catch(_0x326134){const _0x273198=_0x326134 instanceof Error?_0x326134['message']:String(_0x326134);return console[_0x5bd7df(0x207)](_0x5bd7df(0x2bb)+_0x273198),0x1;}let _0xc48831;try{_0xc48831=parseDef(_0x5b15b3);}catch(_0x55f19d){const _0x34c4c7=_0x55f19d instanceof Error?_0x55f19d['message']:String(_0x55f19d);return console[_0x5bd7df(0x207)](a31_0x27c26e[_0x5bd7df(0x172)](_0x5bd7df(0x30e)+_0x34c4c7)),0x1;}if(_0xc48831[_0x5bd7df(0x199)]&&_0xc48831['personalization_services']['length']>0x0)return console[_0x5bd7df(0x207)](a31_0x27c26e[_0x5bd7df(0x27d)](_0x5bd7df(0x330)+_0x588064)),console[_0x5bd7df(0x207)](a31_0x27c26e[_0x5bd7df(0x1be)](_0x5bd7df(0x2b5)+_0xc48831[_0x5bd7df(0x199)][_0x5bd7df(0x141)]+_0x5bd7df(0x332))),0x1;!_0xc48831[_0x5bd7df(0x299)]&&(_0xc48831[_0x5bd7df(0x299)]={'events':[{'name':'page_view','source_table':'<database>.<table>'}],'attributes':[{'name':_0x5bd7df(0x273),'type':_0x5bd7df(0x15b)}],'id_stitching':{'primary_key':_0xc48831[_0x5bd7df(0x289)]['table']===_0x5bd7df(0x188)?'td_client_id':_0x5bd7df(0x1af)}});_0xc48831[_0x5bd7df(0x199)]=[{'name':'My\x20Service','description':_0x5bd7df(0x1d1),'trigger_event':_0x5bd7df(0x25a),'sections':[{'name':_0x5bd7df(0x1f9),'criteria':_0x5bd7df(0x1f1),'attributes':['last_page_viewed']}]}];const _0x3720cb=serializeDef(_0xc48831);return writeFileSync(_0x588064,_0x3720cb,_0x5bd7df(0x2dc)),console['error'](a31_0x27c26e[_0x5bd7df(0x2a3)]('✔')+_0x5bd7df(0x1ee)+a31_0x27c26e[_0x5bd7df(0x271)](_0x588064)),(!_0xc48831['realtime']||_0x5b15b3[_0x5bd7df(0x222)](_0x5bd7df(0x294))===-0x1)&&console[_0x5bd7df(0x207)](a31_0x27c26e[_0x5bd7df(0x2a3)]('✔')+_0x5bd7df(0x1c0)),console[_0x5bd7df(0x207)]('\x0a'+a31_0x27c26e[_0x5bd7df(0x1be)](_0x5bd7df(0x356))),console[_0x5bd7df(0x207)](_0x5bd7df(0x24f)+_0x588064+_0x5bd7df(0x2d1)),console['error']('\x20\x202.\x20Run\x20'+a31_0x27c26e[_0x5bd7df(0x1be)](_0x5bd7df(0x2f1)+_0x4ad7c7)+_0x5bd7df(0x272)),0x0;}}
1
+ const a31_0xe8811a=a31_0x28cc;(function(_0x399502,_0x593542){const _0x27b4f1=a31_0x28cc,_0x2afb40=_0x399502();while(!![]){try{const _0x2bd6fe=parseInt(_0x27b4f1(0x1ee))/0x1+-parseInt(_0x27b4f1(0x26c))/0x2+parseInt(_0x27b4f1(0x2a8))/0x3*(-parseInt(_0x27b4f1(0x112))/0x4)+parseInt(_0x27b4f1(0x2f0))/0x5*(-parseInt(_0x27b4f1(0x1a1))/0x6)+-parseInt(_0x27b4f1(0x1ba))/0x7*(parseInt(_0x27b4f1(0x141))/0x8)+parseInt(_0x27b4f1(0x2df))/0x9+parseInt(_0x27b4f1(0x124))/0xa;if(_0x2bd6fe===_0x593542)break;else _0x2afb40['push'](_0x2afb40['shift']());}catch(_0x4e1bf5){_0x2afb40['push'](_0x2afb40['shift']());}}}(a31_0x1ad1,0x2b2f6));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0xc9ebda 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';function a31_0x1ad1(){const _0xaa1fd4=['allowed\x20IPs:','includeSensitive','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','push','41577QLUCxW','ps:pz:show','To\x20view\x20sample\x20data:','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','pullParentYaml','enabled','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Join:','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20personalization','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','getParentSQL','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','relationships','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','toFixed','segment','ps:pz:service:show','sort','any','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','message','Source:','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','sections','Updating','Listing\x20RT-enabled\x20parent\x20segments...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','personalization','entryCriteria','getPersonalization','✔\x20Updated\x20personalization\x20\x27','processedRows','payload:','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','displayValidateResults','Fetching\x20customers\x20schema...','/{name}.yml\x0a','Options:\x0a','tokens','Show\x20personalization\x20service\x20details','idStitching','\x20to\x20push\x20the\x20configuration','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','Pattern:\x20','Error:','in\x20','\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}','Show\x20a\x20specific\x20realtime\x20personalization','paused','type','execute','\x20Configuration\x20is\x20valid','SELECT\x20*\x20FROM\x20(\x0a','\x22,\x20\x22type\x22:\x20\x22','\x27...','attribute','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Error:\x20--behavior\x20requires\x20a\x20name\x0a','(id:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x5c$&','\x27\x20(id:\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Aborted.','public:','\x0aChanges\x20to\x20\x27','/\x20and\x20','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Master:','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','addBehaviorsFile','Found\x20YAML\x20file:\x20','delete','\x20rows\x20','\x20RT\x20journey','\x20\x202.\x20Run\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','runParent','\x20Opening\x20','stats','behaviors','\x20is\x20already\x20up\x20to\x20date','✔\x20Found\x20','query','Output\x20Database:','.customers)','displayPreviewHints','listParents','✔\x20Deleted\x20token\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','previewParentYaml','Behavior:','parent_segments','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','launched','✔\x20Created\x20personalization\x20\x27','log','json','Coverage:','-1d','⚡\x20Enabled','ps:rt:jn:pause','Deleting\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','status:\x20','localeCompare','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Listing\x20personalization\x20services\x20for\x20\x27','name','ps:pz:service:create','public','limit','Attributes:','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','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','Events:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Listing\x20parent\x20segments...','test','641492xqxPOH','sourceTableValid','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','addAttributesFile','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','ID\x20Stitching:','Deleting\x20token\x20\x27','realtime_enabled','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x0aError:','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','audienceId:\x20','attributesFile','displaySampleData','✔\x20Retrieved\x20RT\x20configuration\x20version','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','listPersonalizations','ps:rt:validate','Output\x20file:\x20','workflowId','audienceId:','List\x20available\x20fields\x20for\x20segmentation','start','totalEvents','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','attributes','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','session','segment:parent:validate','RT\x20Journey\x20ID:\x20','column_name','varchar','repeat','No\x20parent\x20segments\x20found','✔\x20Created\x20personalization\x20service\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x20\x20Tables:\x201\x20customers\x20+\x20','parent_segment','Errors:','/app/dw/parentSegments/','run','jsonl','✔\x20No\x20changes\x20-\x20\x27','joinKey','ps:rt:list','Behaviors','utf-8','\x20RT-enabled\x20parent\x20segment','Error:\x20Parent\x20segment\x20name\x20is\x20required','get','Name:\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Attributes','Error:\x20Token\x20\x27','indexOf','522597dTouCY','schemaValid','\x20\x20\x20\x20-\x20','description','✔\x20Created\x20parent\x20segment\x20\x27','Validate:','\x20\x20\x20','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','replace','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x27\x20with\x20ID:\x20','No\x20RT-enabled\x20parent\x20segments\x20found','Patching\x20personalization\x20\x27','validateParentYaml','includeSensitive:','segment:parent:run','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','rowCount','enriched','Delete\x20a\x20realtime\x20personalization','collectSchema','/\x20directory.\x0a','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Updated','.yml','updateParent','Personalization\x20service\x20description','segment:parent:update','\x20rows)','Enriched:','Created','No\x20personalizations\x20configured','displayBehaviorsStats','label','deletePersonalization','displayMasterInfo','RT\x202.0\x20Validate:','primaryKey','master','Preview:','trim','ps:pz:service:delete','\x20=\x20','\x27\x20and\x20run\x20workflow?','\x20\x20\x20\x20','jobId','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Available\x20behaviors:','Apply\x20changes\x20to\x20\x27','Audience\x20ID:','valid','Pause\x20activations\x20in\x20an\x20RT\x20journey','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','xdg-open','2067156CLjdIk','\x20total','interval','Fetching\x20SQL\x20for\x20\x27','behavior','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20No\x20changes\x20-\x20','personalizationServices','endsWith','tdx\x20ps\x20preview\x20','parent_id','dirname','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','ps:pz:init','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','reduce','15ggLmpW','Creating','\x0a⚠️\x20\x20Migrating:\x20','\x20configured','red','isDirectory','pauseJourney','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','dim','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','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','ps:rt:configuration_versions','Error\x20reading\x20file:\x20','customerGroup','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','folder-segment','Update\x20a\x20realtime\x20personalization\x20entity','\x20--behavior\x20\x22','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','ps:pz:patch','all','sections:','allValid','Fetching\x20sample\x20data...','\x20\x20\x20\x20\x20\x20','coveragePercent','\x0aNew\x20parent\x20segment\x20\x27','Overwrite\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','customerGroupFile','\x0aChanges\x20to\x20apply\x20to\x20\x27','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','state','Validating\x20RT\x20configuration...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','keyEventId','columns','Table:\x20','/attempt/','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Fetching\x20current\x20configuration\x20for\x20\x27','null','\x22\x20}','✔\x20Deleted\x20personalization\x20service\x20\x27','join','\x20to\x20configure\x20your\x20personalization\x20service','token:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','pushParentYaml','information_schema','table','✔\x20Renamed\x20directory\x20to\x20','Error:\x20Token\x20ID\x20is\x20required','error','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Error:\x20Service\x20ID\x20is\x20required','Finding\x20service\x20for\x20token...','segment:parent:show','page_view','displayPreviewResults','file','timezone','verbose','realtime','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x27\x20is\x20already\x20up\x20to\x20date','Listing\x20personalizations\x20for\x20\x27','8DqbEkR','data','\x20service','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','createToken','Error:\x20--database\x20and\x20--table\x20are\x20required','Status:','Creating\x20token\x20\x27','use','Fetching\x20parent\x20segment\x20\x27','displayRealtimeInfo','\x20tdx\x20wf\x20attempt\x20','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','string','no\x20tokens\x20configured','\x20personalization\x20service','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','segment:parent:sql','9838060WVtaoE','Fetching\x20behavior\x20list...','apply','customerPercent','Personalization:','tdx\x20ps\x20push\x20','Session:','Show\x20parent\x20segment\x20schema\x20(column\x20types)','segment:parent:push','schemaError','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','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','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','\x0a✔\x20Workflow\x20started','workflowAttemptId','listFields','✔\x20Deleted\x20personalization\x20\x27','displayAttributesStats','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Attribute:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','Attempt:','\x20\x20Note:\x20','parentSegment','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','✔\x20Updated\x20parent\x20segment\x20\x27','status','segment:parent:create','80NfZxAg','SELECT\x20*\x20FROM\x20','resolveParentId','behavior_','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Rows:','/app/workflows/','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','keyEventCriteria','single','format','\x20\x201.\x20Edit\x20','\x0a⚠️\x20\x20Both\x20','\x20Added\x20personalization\x20template\x20to\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','database','population','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Options\x20(one\x20required):\x0a','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','true','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','toLowerCase','\x20Added\x20RT\x202.0\x20template\x20section','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x0a\x20\x20\x20\x20]','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','foreignKey','To\x20cancel:','customers','patch','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','bold','sourceTableError','events','getOutputDatabaseName','addBehaviors','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Customers:','personalization_services','Show\x20parent\x20segment\x20details','output','customersWithEvents','\x20--attribute\x20\x22<name>\x22','YAML\x20file:\x20','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x27\x20for\x20service\x20\x27','cyan','stringify','Parent\x20segment:\x20','displayColumns','Getting\x20personalization\x20\x27','SQL\x20query:\x0a','some','getParentFull','split','map','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','platform','\x27\x20is\x20up\x20to\x20date','/\x20→\x20','Get\x20current\x20RT\x20configuration\x20version\x20status','folderId','deleteToken','filter','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','errors','Creating\x20personalization\x20\x27','scheduleOption','Creating\x20parent\x20segment\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Resolving\x20parent\x20segment\x20\x27','/sessions/','👥\x20','audienceId','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','using\x20the\x20default\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\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\x20Database:\x20','addAttributes','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Error:\x20Personalization\x20ID\x20is\x20required','✔\x20Found\x20personalization\x20\x27','displaySummary','column_type','getBehaviorNames','Creating\x20personalization\x20service\x20\x27','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','created:','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','403134rMqLhx','length','identifier','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','open','yellow','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','ps:rt:jn:list','ps:pz:delete','<database>.<table>','keyEventId:','%)\x20','realtime:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','darwin','workflowSessionId','\x20RT\x20configuration\x20is\x20valid','entryCriteria:','segment:parent:list','Updating\x20personalization\x20service\x20\x27','stageCount','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','sampleData','unref','145229owCVeH','\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','last_page_viewed','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','text','\x20--attribute\x20\x22','Master\x20Table','\x20service(s)\x20configured','value','Analyzing\x20changes...','Listing\x20RT\x20journeys\x20for\x20\x27','segment:parent:preview','Default','payload','keys','List\x20RT\x20journeys','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Deleting\x20personalization\x20service\x20\x27','⚡\x20Not\x20enabled','toLocaleString','\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+\x20[','\x20(paused)','td_client_id','yes','createPersonalization','Error\x20parsing\x20YAML:\x20','formatSchemaJson','site','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','ps:pz:create','\x20Context\x20set:\x20','patchPersonalization','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','allowedIps','segment:parent:fields','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','column','number','updated:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','stop','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','✔\x20Created\x20token\x20\x27','scheduleType','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Site:\x20','Create\x20parent\x20segment\x20\x27'];a31_0x1ad1=function(){return _0xaa1fd4;};return a31_0x1ad1();}import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';function a31_0x28cc(_0x48296,_0x300887){_0x48296=_0x48296-0xfe;const _0x1ad1c4=a31_0x1ad1();let _0x28cc9a=_0x1ad1c4[_0x48296];return _0x28cc9a;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x4d24f3 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_0xe8811a(0x24f),LEGACY_PARENT_SEGMENT_DIR=a31_0xe8811a(0x296);function openBrowser(_0x382c65){const _0x553f78=a31_0xe8811a,_0x275983=process[_0x553f78(0x180)],_0x31da0e=_0x275983===_0x553f78(0x1b0)?_0x553f78(0x1a6):_0x275983==='win32'?_0x553f78(0x283):_0x553f78(0x2de);spawn(_0x31da0e,[_0x382c65],{'detached':!![],'stdio':'ignore'})[_0x553f78(0x1b9)]();}function migrateLegacyDirectory(){const _0x11a27c=a31_0xe8811a;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x39f095=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x39f095[_0x11a27c(0x2f5)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x11a27c(0x104)](a31_0x4d24f3[_0x11a27c(0x1a7)](_0x11a27c(0x14f)+LEGACY_PARENT_SEGMENT_DIR+_0x11a27c(0x234)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x11a27c(0x104)](a31_0x4d24f3[_0x11a27c(0x2f8)](_0x11a27c(0x16b)+LEGACY_PARENT_SEGMENT_DIR+_0x11a27c(0x2be))),![];console[_0x11a27c(0x104)](a31_0x4d24f3['yellow'](_0x11a27c(0x2f2)+LEGACY_PARENT_SEGMENT_DIR+_0x11a27c(0x182)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x11a27c(0x104)](a31_0x4d24f3['green'](_0x11a27c(0x102)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0xf34599){const _0x26aaa3=_0xf34599 instanceof Error?_0xf34599[_0x11a27c(0x205)]:String(_0xf34599);return console[_0x11a27c(0x104)](a31_0x4d24f3[_0x11a27c(0x2f4)](_0x11a27c(0x1fe)+_0x26aaa3+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0xe8811a(0x299)](_0x38ba4e){const _0x366a8d=a31_0xe8811a;return migrateLegacyDirectory(),super[_0x366a8d(0x299)](_0x38ba4e);}}function resolveYamlFile(_0x5488e3){const _0x242ba4=a31_0xe8811a;if(_0x5488e3[_0x242ba4(0x2e7)](_0x242ba4(0x2c1))||_0x5488e3[_0x242ba4(0x2e7)]('.yaml'))return _0x5488e3;return a31_0xc9ebda[_0x242ba4(0x31f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5488e3)+'.yml');}function formatProgressMessage(_0x26fc3b){const _0x52c1ab=a31_0xe8811a,_0x9ba4e5=_0x26fc3b['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x9ba4e5){const [,_0x2e4bc1,_0x25afb9,_0x1fedd8='']=_0x9ba4e5;return a31_0x4d24f3[_0x52c1ab(0x2f8)](_0x2e4bc1+':')+'\x20'+_0x25afb9+a31_0x4d24f3['dim'](_0x1fedd8);}return a31_0x4d24f3['dim'](_0x26fc3b);}function showFileNotFoundError(_0x221c3d,_0x222ea3){const _0x23d3d4=a31_0xe8811a;console[_0x23d3d4(0x104)](a31_0x4d24f3[_0x23d3d4(0x2f4)]('Error:\x20File\x20not\x20found:\x20'+_0x221c3d+'\x0a')),console[_0x23d3d4(0x104)](a31_0x4d24f3[_0x23d3d4(0x175)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x222ea3+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x58d8aa){const _0x5bf396=a31_0xe8811a;if(!_0x58d8aa['realtime'])return;const _0x48db8b=_0x58d8aa[_0x5bf396(0x10e)],_0x455d74=_0x48db8b[_0x5bf396(0x1f3)]?a31_0x4d24f3[_0x5bf396(0x2af)](_0x5bf396(0x257)):a31_0x4d24f3[_0x5bf396(0x1a7)](_0x5bf396(0x1cc));console['error']('\x0a'+a31_0x4d24f3[_0x5bf396(0x2f8)]('RT\x202.0:')+'\x20'+_0x455d74);if(_0x48db8b[_0x5bf396(0x168)]&&_0x48db8b[_0x5bf396(0x168)][_0x5bf396(0x1a2)]>0x0){console[_0x5bf396(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x5bf396(0x268))+'\x20'+_0x48db8b[_0x5bf396(0x168)][_0x5bf396(0x1a2)]+'\x20configured');for(const _0x3dcb41 of _0x48db8b[_0x5bf396(0x168)]){const _0x268da7=_0x3dcb41[_0x5bf396(0x26d)]===![]?a31_0x4d24f3['red']('✘'):a31_0x4d24f3[_0x5bf396(0x2af)]('✔');console['error'](_0x5bf396(0x2d5)+_0x268da7+'\x20'+_0x3dcb41[_0x5bf396(0x260)]),_0x3dcb41['sourceTableError']&&console[_0x5bf396(0x104)]('\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3[_0x5bf396(0x2f4)](_0x3dcb41[_0x5bf396(0x167)]));}}if(_0x48db8b[_0x5bf396(0x289)]&&_0x48db8b[_0x5bf396(0x289)][_0x5bf396(0x1a2)]>0x0){console[_0x5bf396(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x5bf396(0x264))+'\x20'+_0x48db8b[_0x5bf396(0x289)]['length']+_0x5bf396(0x2f3));for(const _0x50cf85 of _0x48db8b[_0x5bf396(0x289)]){const _0x116595=_0x50cf85[_0x5bf396(0x2db)]?a31_0x4d24f3['green']('✔'):a31_0x4d24f3[_0x5bf396(0x2f4)]('✘');console['error'](_0x5bf396(0x2d5)+_0x116595+'\x20'+_0x50cf85[_0x5bf396(0x260)]+'\x20'+a31_0x4d24f3[_0x5bf396(0x2f8)]('('+_0x50cf85['type']+')'));}}if(_0x48db8b['idStitching']){const _0xcaa1ed=_0x48db8b[_0x5bf396(0x21a)]['stitchingKeys']?.['length']?_0x5bf396(0x1cf)+_0x48db8b['idStitching']['stitchingKeys'][_0x5bf396(0x31f)](',\x20')+']':'';console[_0x5bf396(0x104)]('\x20\x20'+a31_0x4d24f3[_0x5bf396(0x2f8)](_0x5bf396(0x272))+'\x20'+_0x48db8b['idStitching'][_0x5bf396(0x2ce)]+_0xcaa1ed);}if(_0x48db8b[_0x5bf396(0x2e6)]&&_0x48db8b[_0x5bf396(0x2e6)]['length']>0x0){console['error']('\x20\x20'+a31_0x4d24f3[_0x5bf396(0x2f8)](_0x5bf396(0x128))+'\x20'+_0x48db8b[_0x5bf396(0x2e6)][_0x5bf396(0x1a2)]+_0x5bf396(0x114)+(_0x48db8b[_0x5bf396(0x2e6)]['length']!==0x1?'s':''));for(const _0x1ba09c of _0x48db8b[_0x5bf396(0x2e6)]){console[_0x5bf396(0x104)](_0x5bf396(0x2aa)+_0x1ba09c['name']);}}}function showParentSegmentNotSetError(_0x5f3896){const _0x46ac8d=a31_0xe8811a;console[_0x46ac8d(0x104)](a31_0x4d24f3['yellow'](_0x46ac8d(0x2b0))),console[_0x46ac8d(0x104)](_0x5f3896);}export class ParentSegmentListCommand extends BaseCommand{['name']=a31_0xe8811a(0x1b4);[a31_0xe8811a(0x2ab)]='List\x20parent\x20segments';async[a31_0xe8811a(0x224)](_0xe8bcf9){const _0x206725=a31_0xe8811a,{options:_0x4830f2,args:_0x47bae4,tdx:_0x46f19b}=_0xe8bcf9,_0x4197d0=_0x47bae4[0x0];_0x4830f2['verbose']&&(console[_0x206725(0x104)](_0x206725(0x1e8)+_0x4830f2[_0x206725(0x1d6)]),_0x4197d0&&console[_0x206725(0x104)](_0x206725(0x21d)+_0x4197d0));const _0x57795a=await withSpinner(_0x4197d0?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x4197d0+_0x206725(0x228):_0x206725(0x26a),()=>_0x46f19b[_0x206725(0x200)][_0x206725(0x24a)](),{'verbose':_0x4830f2[_0x206725(0x10d)]});let _0x4edcd6=_0x57795a[_0x206725(0x113)];if(_0x4197d0){const _0xbc74e9=_0x4197d0[_0x206725(0x2b1)](/[.+^${}()|[\]\\]/g,_0x206725(0x22e))[_0x206725(0x2b1)](/\*/g,'.*')[_0x206725(0x2b1)](/\?/g,'.'),_0x54572f=new RegExp('^'+_0xbc74e9+'$','i');_0x4edcd6=_0x4edcd6[_0x206725(0x186)](_0x211e0c=>_0x54572f['test'](_0x211e0c[_0x206725(0x289)]['name']));}_0x4edcd6[_0x206725(0x202)]((_0x2cf43b,_0x206051)=>_0x2cf43b[_0x206725(0x289)][_0x206725(0x260)][_0x206725(0x25d)](_0x206051['attributes'][_0x206725(0x260)])),console[_0x206725(0x104)]('✔\x20Found\x20'+_0x4edcd6[_0x206725(0x1a2)]+'\x20parent\x20segment'+(_0x4edcd6[_0x206725(0x1a2)]!==0x1?'s':''));const _0x3adcdd=_0x408bb2=>{const _0x5124e7=_0x206725;return getConsoleNextUrl(_0x4830f2['site'],_0x5124e7(0x298)+_0x408bb2);};if(_0x4830f2['format']===_0x206725(0x254)||_0x4830f2['format']===_0x206725(0x29a)){const _0x46501e=_0x4edcd6['map'](_0x15efbb=>({..._0x15efbb,'url':_0x3adcdd(_0x15efbb['id'])}));await handleSDKOutput(_0x46501e,_0x4830f2);}else{if(_0x4edcd6[_0x206725(0x1a2)]===0x0)_0x4197d0?console[_0x206725(0x253)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x4197d0):console[_0x206725(0x253)](_0x206725(0x291));else for(const _0x519051 of _0x4edcd6){const _0x780ace=_0x519051[_0x206725(0x289)][_0x206725(0x154)]?a31_0x4d24f3[_0x206725(0x2f8)]('\x20('+formatRows(_0x519051[_0x206725(0x289)][_0x206725(0x154)])+')'):'',_0x4634a8=hyperlink(_0x519051['attributes'][_0x206725(0x260)],_0x3adcdd(_0x519051['id']));console['log'](_0x206725(0x18f)+_0x4634a8+_0x780ace);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x140);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x115);async[a31_0xe8811a(0x224)](_0x48d1de){const _0x12a22e=a31_0xe8811a,{options:_0x3d077c,args:_0xcd7f1c,tdx:_0x122b24}=_0x48d1de;console[_0x12a22e(0x104)](_0x12a22e(0x191)+_0x12a22e(0x269)+_0x12a22e(0x213));const _0x5758f6=_0x3d077c;if(_0xcd7f1c['length']===0x0)return console[_0x12a22e(0x104)](a31_0x4d24f3['red'](_0x12a22e(0x2a1))),console[_0x12a22e(0x104)](_0x12a22e(0x294)),0x1;const _0x136c57=_0xcd7f1c[0x0];if(!_0x5758f6[_0x12a22e(0x153)]||!_0x5758f6[_0x12a22e(0x101)])return console['error'](_0x12a22e(0x117)),console[_0x12a22e(0x104)](_0x12a22e(0x294)),0x1;_0x5758f6['verbose']&&(console[_0x12a22e(0x104)](_0x12a22e(0x1e8)+_0x5758f6[_0x12a22e(0x1d6)]),console[_0x12a22e(0x104)](_0x12a22e(0x2a3)+_0x136c57),console['error']('Database:\x20'+_0x5758f6[_0x12a22e(0x153)]),console[_0x12a22e(0x104)](_0x12a22e(0x318)+_0x5758f6['table']));const _0x1ef626=await loadJSONFromOptions(_0x5758f6[_0x12a22e(0x289)],_0x5758f6[_0x12a22e(0x279)]),_0x4a5cbd=await loadJSONFromOptions(_0x5758f6[_0x12a22e(0x243)],_0x5758f6['behaviorsFile']),_0x5810f0=await loadJSONFromOptions(_0x5758f6[_0x12a22e(0x2fd)],_0x5758f6[_0x12a22e(0x30e)]),_0x39147d={'name':_0x136c57,'description':_0x5758f6[_0x12a22e(0x2ab)],'scheduleType':_0x5758f6['scheduleType'],'scheduleOption':_0x5758f6[_0x12a22e(0x18a)],'timezone':_0x5758f6[_0x12a22e(0x10c)],'master':{'parentDatabaseName':_0x5758f6['database'],'parentTableName':_0x5758f6[_0x12a22e(0x101)]},'attributes':_0x1ef626,'behaviors':_0x4a5cbd,'customerGroup':_0x5810f0},_0x44186f=await withSpinner(_0x12a22e(0x18b)+_0x136c57+_0x12a22e(0x228),()=>_0x122b24[_0x12a22e(0x200)]['createParent'](_0x39147d),{'verbose':_0x3d077c[_0x12a22e(0x10d)]}),_0x1a5d34=_0x44186f[_0x12a22e(0x113)];return console[_0x12a22e(0x104)](_0x12a22e(0x2ac)+_0x1a5d34[_0x12a22e(0x260)]+_0x12a22e(0x2b3)+_0x1a5d34['id']),await handleSDKOutput([_0x1a5d34],_0x3d077c),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a31_0xe8811a(0x2c4);['description']=a31_0xe8811a(0x2a4);async['execute'](_0x2e5264){const _0x2d0ad1=a31_0xe8811a,{options:_0x7d13f3,args:_0x578566,tdx:_0x5dce0d}=_0x2e5264;console['error'](_0x2d0ad1(0x208)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2d0ad1(0x213));const _0x8840d=_0x7d13f3;if(_0x578566[_0x2d0ad1(0x1a2)]===0x0)return console[_0x2d0ad1(0x104)](a31_0x4d24f3[_0x2d0ad1(0x2f4)](_0x2d0ad1(0x2a1))),console[_0x2d0ad1(0x104)](_0x2d0ad1(0x1a0)),0x1;const _0x47a253=_0x578566[0x0];_0x8840d[_0x2d0ad1(0x10d)]&&(console['error'](_0x2d0ad1(0x1e8)+_0x8840d['site']),console[_0x2d0ad1(0x104)](_0x2d0ad1(0x177)+_0x47a253));const _0x50f900=await withSpinner(_0x2d0ad1(0x31b)+_0x47a253+_0x2d0ad1(0x228),()=>_0x5dce0d[_0x2d0ad1(0x200)][_0x2d0ad1(0x17c)](_0x47a253),{'verbose':_0x8840d[_0x2d0ad1(0x10d)]}),_0x262dd8=_0x50f900[_0x2d0ad1(0x113)],_0x2880f7=await loadJSONFromOptions(_0x8840d[_0x2d0ad1(0x196)],_0x8840d[_0x2d0ad1(0x26f)]),_0x1a1249=await loadJSONFromOptions(_0x8840d[_0x2d0ad1(0x16a)],_0x8840d[_0x2d0ad1(0x239)]),_0x153df0={'name':_0x262dd8[_0x2d0ad1(0x260)],'description':_0x8840d[_0x2d0ad1(0x2ab)]!==undefined?_0x8840d['description']:_0x262dd8[_0x2d0ad1(0x2ab)],'scheduleType':_0x8840d[_0x2d0ad1(0x1e6)]!==undefined?_0x8840d[_0x2d0ad1(0x1e6)]:_0x262dd8['scheduleType'],'scheduleOption':_0x8840d[_0x2d0ad1(0x18a)]!==undefined?_0x8840d['scheduleOption']:_0x262dd8['scheduleOption'],'timezone':_0x8840d['timezone']!==undefined?_0x8840d[_0x2d0ad1(0x10c)]:_0x262dd8[_0x2d0ad1(0x10c)],'master':_0x262dd8[_0x2d0ad1(0x2cf)],'attributes':_0x2880f7?[..._0x262dd8[_0x2d0ad1(0x289)]||[],..._0x2880f7]:_0x262dd8[_0x2d0ad1(0x289)],'behaviors':_0x1a1249?[..._0x262dd8['behaviors']||[],..._0x1a1249]:_0x262dd8['behaviors'],'customerGroup':_0x262dd8[_0x2d0ad1(0x2fd)]},_0x40d113=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x47a253+_0x2d0ad1(0x228),()=>_0x5dce0d['segment'][_0x2d0ad1(0x2c2)](_0x47a253,_0x153df0),{'verbose':_0x8840d[_0x2d0ad1(0x10d)]}),_0x4535f9=_0x40d113[_0x2d0ad1(0x113)];return console[_0x2d0ad1(0x104)](_0x2d0ad1(0x13e)+_0x4535f9[_0x2d0ad1(0x260)]+'\x27'),await handleSDKOutput([_0x4535f9],_0x8840d),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]='segment:parent:pull';['description']='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a31_0xe8811a(0x224)](_0x441702){const _0x27ac51=a31_0xe8811a,{options:_0x5ac53a,args:_0x4ada1d,tdx:_0x7df8d6}=_0x441702,_0x3732d3=_0x5ac53a,_0x4ca81a=_0x4ada1d[0x0]||_0x5ac53a[_0x27ac51(0x13c)];if(!_0x4ca81a)return showParentSegmentNotSetError(_0x27ac51(0x1fb)+_0x27ac51(0x193)),0x1;if(_0x3732d3[_0x27ac51(0x11a)]&&_0x3732d3[_0x27ac51(0x16f)])return console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2f4)](_0x27ac51(0x275))),console['error'](a31_0x4d24f3[_0x27ac51(0x2f8)](_0x27ac51(0x27c))),console['error'](a31_0x4d24f3[_0x27ac51(0x2f8)](_0x27ac51(0x192)+PARENT_SEGMENT_DIR+_0x27ac51(0x216))),console[_0x27ac51(0x104)](a31_0x4d24f3['cyan'](_0x27ac51(0x1f7))),0x1;const _0x5ebfe3=_0x3732d3[_0x27ac51(0x16f)]||a31_0xc9ebda[_0x27ac51(0x31f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4ca81a)+'.yml');_0x3732d3[_0x27ac51(0x10d)]&&(console[_0x27ac51(0x104)](_0x27ac51(0x1e8)+_0x3732d3[_0x27ac51(0x1d6)]),console[_0x27ac51(0x104)](_0x27ac51(0x177)+_0x4ca81a),console['error'](_0x27ac51(0x27f)+_0x5ebfe3));const _0x46e41f=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x4ca81a+'\x27...',()=>_0x7df8d6[_0x27ac51(0x200)][_0x27ac51(0x1f2)](_0x4ca81a),{'verbose':_0x3732d3[_0x27ac51(0x10d)]}),_0x166dbf=_0x46e41f[_0x27ac51(0x113)];if(existsSync(_0x5ebfe3)){const _0xbf99d=readFileSync(_0x5ebfe3,_0x27ac51(0x29f)),_0x9497da=generateDiff(_0xbf99d,_0x166dbf);if(!hasChanges(_0x9497da))console[_0x27ac51(0x104)](a31_0x4d24f3['green']('✔')+_0x27ac51(0x2e5)+a31_0x4d24f3[_0x27ac51(0x175)](_0x5ebfe3)+_0x27ac51(0x244));else{console['error'](_0x27ac51(0x233)+_0x5ebfe3+'\x27:'),console[_0x27ac51(0x104)]('─'[_0x27ac51(0x290)](0x3c)),console[_0x27ac51(0x104)](formatDiffWithColors(_0x9497da)),console[_0x27ac51(0x104)]('─'['repeat'](0x3c));if(!_0x3732d3['yes']){if(!isInteractive())return console['error'](a31_0x4d24f3['red'](_0x27ac51(0x276)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2f8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x41067a=await confirmKey(_0x27ac51(0x30c)+_0x5ebfe3+'\x27?');if(!_0x41067a)return console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x1a7)](_0x27ac51(0x231))),0x1;}writeFileSync(_0x5ebfe3,_0x166dbf,'utf-8'),console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2af)]('✔')+_0x27ac51(0x22d)+a31_0x4d24f3[_0x27ac51(0x175)](_0x5ebfe3));}}else{const _0x13a648=a31_0xc9ebda[_0x27ac51(0x2ea)](_0x5ebfe3);!existsSync(_0x13a648)&&mkdirSync(_0x13a648,{'recursive':!![]}),writeFileSync(_0x5ebfe3,_0x166dbf,_0x27ac51(0x29f)),console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2af)]('✔')+_0x27ac51(0x22d)+a31_0x4d24f3['cyan'](_0x5ebfe3));}return saveSessionContext({'parent_segment':_0x4ca81a},_0x3732d3[_0x27ac51(0x28b)]),console['error'](a31_0x4d24f3[_0x27ac51(0x2af)]('✔')+_0x27ac51(0x1d9)+a31_0x4d24f3[_0x27ac51(0x2f8)](_0x27ac51(0x296))+_0x27ac51(0x2d3)+a31_0x4d24f3['cyan'](_0x4ca81a)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x12c);[a31_0xe8811a(0x2ab)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0x10935f){const _0x4ffbac=a31_0xe8811a,{options:_0x37bd82,args:_0x4c5afa,tdx:_0x33c72b}=_0x10935f,_0x37951d=_0x37bd82,_0x42dffc=_0x4c5afa[0x0]||_0x37bd82[_0x4ffbac(0x13c)];if(!_0x42dffc)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'+_0x4ffbac(0x31a)),0x1;const _0x4fb7c3=resolveYamlFile(_0x42dffc);if(!existsSync(_0x4fb7c3))return showFileNotFoundError(_0x4fb7c3,_0x42dffc),0x1;_0x37951d[_0x4ffbac(0x10d)]&&(console['error'](_0x4ffbac(0x1e8)+_0x37951d[_0x4ffbac(0x1d6)]),console[_0x4ffbac(0x104)](_0x4ffbac(0x172)+_0x4fb7c3));let _0x39e905;try{_0x39e905=readFileSync(_0x4fb7c3,_0x4ffbac(0x29f));}catch(_0x22c7e9){const _0x4e6efc=_0x22c7e9 instanceof Error?_0x22c7e9[_0x4ffbac(0x205)]:String(_0x22c7e9);return console[_0x4ffbac(0x104)]('Error\x20reading\x20file:\x20'+_0x4e6efc),0x1;}const _0x1ad64b=await withSpinner('Analyzing\x20changes...',()=>_0x33c72b[_0x4ffbac(0x200)][_0x4ffbac(0xff)](_0x39e905),{'verbose':_0x37951d[_0x4ffbac(0x10d)]}),_0x2cd78d=_0x1ad64b[_0x4ffbac(0x113)],{isNew:_0x1a8ba5,name:_0xeeac11,hasChanges:_0x42cb30,diffFormatted:_0x3660de}=_0x2cd78d;if(!_0x42cb30)return console['error'](_0x4ffbac(0x29b)+_0xeeac11+_0x4ffbac(0x110)),0x0;_0x1a8ba5?console[_0x4ffbac(0x104)](_0x4ffbac(0x30b)+_0xeeac11+'\x27:'):console[_0x4ffbac(0x104)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0xeeac11+'\x27:');console[_0x4ffbac(0x104)]('─'['repeat'](0x3c)),console[_0x4ffbac(0x104)](_0x3660de),console[_0x4ffbac(0x104)]('─'[_0x4ffbac(0x290)](0x3c));const _0xb4dcf2=_0x1a8ba5?'Create\x20parent\x20segment\x20\x27'+_0xeeac11+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0xeeac11+'\x27?';if(!_0x37951d['yes']){if(!isInteractive())return console[_0x4ffbac(0x104)](a31_0x4d24f3[_0x4ffbac(0x2f4)]('\x0aError:'),_0x4ffbac(0x17f)),console[_0x4ffbac(0x104)](a31_0x4d24f3['dim'](_0x4ffbac(0x18c))),0x1;const _0x1fb097=await confirmKey(_0xb4dcf2);if(!_0x1fb097)return console[_0x4ffbac(0x104)](a31_0x4d24f3[_0x4ffbac(0x1a7)](_0x4ffbac(0x231))),0x1;}const _0x97f7b9=_0x1a8ba5?_0x4ffbac(0x2f1):'Updating',_0x2de5dc=await withSpinner(_0x97f7b9+'\x20parent\x20segment\x20\x27'+_0xeeac11+_0x4ffbac(0x228),()=>_0x2cd78d[_0x4ffbac(0x126)](),{'verbose':_0x37951d[_0x4ffbac(0x10d)]}),_0x4865d1=_0x2de5dc[_0x4ffbac(0x113)],_0x5b9d2e=getConsoleNextUrl(_0x37951d[_0x4ffbac(0x1d6)],_0x4ffbac(0x298)+_0x4865d1['id']),_0x5d341c=_0x1a8ba5?_0x4ffbac(0x2c7):_0x4ffbac(0x2c0);return console[_0x4ffbac(0x104)]('✔\x20'+_0x5d341c+'\x20parent\x20segment\x20\x27'+_0x4865d1[_0x4ffbac(0x260)]+'\x27'),console[_0x4ffbac(0x104)]('\x20\x20'+_0x5b9d2e),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a31_0xe8811a(0x28c);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x310);async[a31_0xe8811a(0x224)](_0x298b1b){const _0x44e3c8=a31_0xe8811a,{options:_0x556d1e,args:_0xa2ba26,tdx:_0x4b3b49}=_0x298b1b,_0x42a736=_0x556d1e,_0xceab0a=_0xa2ba26[0x0]||_0x556d1e[_0x44e3c8(0x13c)];if(!_0xceab0a)return showParentSegmentNotSetError(_0x44e3c8(0x22a)+_0x44e3c8(0x1af)+_0x44e3c8(0x217)+_0x44e3c8(0x230)+_0x44e3c8(0x187)+_0x44e3c8(0x149)),0x1;const _0x2cb1bc=resolveYamlFile(_0xceab0a);if(!existsSync(_0x2cb1bc))return showFileNotFoundError(_0x2cb1bc,_0xceab0a),0x1;_0x42a736[_0x44e3c8(0x10d)]&&(console[_0x44e3c8(0x104)](_0x44e3c8(0x1e8)+_0x42a736[_0x44e3c8(0x1d6)]),console['error']('YAML\x20file:\x20'+_0x2cb1bc));let _0x1cff53;try{_0x1cff53=readFileSync(_0x2cb1bc,'utf-8');}catch(_0x637644){const _0x10860c=_0x637644 instanceof Error?_0x637644[_0x44e3c8(0x205)]:String(_0x637644);return console[_0x44e3c8(0x104)](_0x44e3c8(0x2fc)+_0x10860c),0x1;}const _0x5b6477=createCommandSpinner(a31_0x4d24f3['dim']('Validating\x20configuration...'),{'verbose':_0x42a736[_0x44e3c8(0x10d)]});_0x5b6477[_0x44e3c8(0x283)]();const _0x5e8b90={'onProgress':_0x202528=>{const _0x1e9f2b=_0x44e3c8;_0x5b6477[_0x1e9f2b(0x1be)]=formatProgressMessage(_0x202528);}};if(_0x42a736[_0x44e3c8(0x2cf)])_0x5e8b90[_0x44e3c8(0x2cf)]=!![];if(_0x42a736['enriched'])_0x5e8b90[_0x44e3c8(0x2bb)]=!![];_0x42a736[_0x44e3c8(0x229)]&&(_0x5e8b90[_0x44e3c8(0x229)]=_0x42a736[_0x44e3c8(0x229)]);_0x42a736[_0x44e3c8(0x2e3)]&&(_0x5e8b90[_0x44e3c8(0x2e3)]=_0x42a736['behavior']);if(_0x42a736[_0x44e3c8(0x2e1)])_0x5e8b90[_0x44e3c8(0x2e1)]=_0x42a736[_0x44e3c8(0x2e1)];let _0x3ac25c;try{_0x3ac25c=await _0x4b3b49['segment'][_0x44e3c8(0x2b6)](_0x1cff53,_0x5e8b90),_0x5b6477[_0x44e3c8(0x1e3)]();}catch(_0x20040e){_0x5b6477[_0x44e3c8(0x1e3)]();throw _0x20040e;}const _0x1a3a7b=_0x42a736['interval']||_0x44e3c8(0x256);return this[_0x44e3c8(0x214)](_0x3ac25c,_0x5e8b90,_0x2cb1bc,_0x1a3a7b),_0x3ac25c[_0x44e3c8(0x307)]?0x0:0x1;}[a31_0xe8811a(0x214)](_0x5c5b2c,_0x271685,_0x1893e9,_0x5c4aac){const _0x3bea28=a31_0xe8811a;console['error']('\x0a'+a31_0x4d24f3[_0x3bea28(0x166)](_0x3bea28(0x2ad))+'\x20'+_0x5c5b2c[_0x3bea28(0x260)]),console[_0x3bea28(0x104)]('═'[_0x3bea28(0x290)](0x3c)),this[_0x3bea28(0x2cc)](_0x5c5b2c);if(typeof _0x271685[_0x3bea28(0x229)]==='string'){this[_0x3bea28(0x136)](_0x5c5b2c),this[_0x3bea28(0x19a)](_0x5c5b2c),this['displayPreviewHints'](_0x1893e9,_0x5c4aac,_0x3bea28(0x229),_0x271685[_0x3bea28(0x229)]);return;}if(_0x271685[_0x3bea28(0x229)]===!![]){this[_0x3bea28(0x136)](_0x5c5b2c),this['displaySummary'](_0x5c5b2c),this['displayPreviewHints'](_0x1893e9,_0x5c4aac,_0x3bea28(0x289));return;}if(typeof _0x271685[_0x3bea28(0x2e3)]===_0x3bea28(0x11f)){this[_0x3bea28(0x2c9)](_0x5c5b2c,_0x5c4aac),this['displaySummary'](_0x5c5b2c),this[_0x3bea28(0x249)](_0x1893e9,_0x5c4aac,_0x3bea28(0x2e3),_0x271685[_0x3bea28(0x2e3)]);return;}if(_0x271685[_0x3bea28(0x2e3)]===!![]){this['displayBehaviorsStats'](_0x5c5b2c,_0x5c4aac),this[_0x3bea28(0x19a)](_0x5c5b2c),this[_0x3bea28(0x249)](_0x1893e9,_0x5c4aac,_0x3bea28(0x243));return;}this[_0x3bea28(0x136)](_0x5c5b2c),this[_0x3bea28(0x2c9)](_0x5c5b2c,_0x5c4aac),this[_0x3bea28(0x11c)](_0x5c5b2c),this[_0x3bea28(0x19a)](_0x5c5b2c),this[_0x3bea28(0x249)](_0x1893e9,_0x5c4aac,'all');}[a31_0xe8811a(0x11c)](_0x525228){displayRealtimeValidation(_0x525228);}[a31_0xe8811a(0x249)](_0x398a44,_0x20b5de,_0x24b242,_0x1be27b){const _0x50d527=a31_0xe8811a;console[_0x50d527(0x104)]('\x0a'+a31_0x4d24f3[_0x50d527(0x2f8)](_0x50d527(0x1f0)));const _0x3914ff=_0x20b5de!=='-1d'?'\x20--interval\x20'+_0x20b5de:'';if(_0x24b242===_0x50d527(0x229)&&_0x1be27b)console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3['dim']('tdx\x20ps\x20preview\x20'+_0x398a44+'\x20--attribute\x20\x22'+_0x1be27b+'\x22'+_0x3914ff));else{if(_0x24b242==='behavior'&&_0x1be27b)console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3[_0x50d527(0x2f8)](_0x50d527(0x2e8)+_0x398a44+_0x50d527(0x301)+_0x1be27b+'\x22'+_0x3914ff));else(_0x24b242===_0x50d527(0x289)||_0x24b242===_0x50d527(0x305))&&console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x50d527(0x2e8)+_0x398a44+_0x50d527(0x171)+_0x3914ff));}(_0x24b242==='behaviors'||_0x24b242===_0x50d527(0x305))&&console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3[_0x50d527(0x2f8)](_0x50d527(0x2e8)+_0x398a44+'\x20--behavior\x20\x22<name>\x22'+_0x3914ff)),_0x24b242===_0x50d527(0x305)&&console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3[_0x50d527(0x2f8)]('tdx\x20ps\x20preview\x20'+_0x398a44+'\x20--enriched'+_0x3914ff));}[a31_0xe8811a(0x2cc)](_0xd09171){const _0x2fe0fe=a31_0xe8811a,{master:_0x21b55f}=_0xd09171,_0x51f0a8=_0x21b55f[_0x2fe0fe(0x2a9)]?a31_0x4d24f3[_0x2fe0fe(0x2af)]('✔'):a31_0x4d24f3['red']('✘');console[_0x2fe0fe(0x104)]('\x0a'+a31_0x4d24f3[_0x2fe0fe(0x2f8)](_0x2fe0fe(0x1c0))),console[_0x2fe0fe(0x104)](_0x51f0a8+'\x20'+a31_0x4d24f3[_0x2fe0fe(0x166)](_0x21b55f[_0x2fe0fe(0x153)]+'.'+_0x21b55f[_0x2fe0fe(0x101)])),_0x21b55f[_0x2fe0fe(0x2a9)]?_0x21b55f['rowCount']!==undefined&&console[_0x2fe0fe(0x104)]('\x20\x20'+a31_0x4d24f3[_0x2fe0fe(0x2f8)](_0x2fe0fe(0x147))+'\x20'+a31_0x4d24f3['cyan'](formatRows(_0x21b55f[_0x2fe0fe(0x2ba)]))):console['error']('\x20\x20'+a31_0x4d24f3['red']('Error:')+'\x20'+_0x21b55f[_0x2fe0fe(0x12d)]);}['displayAttributesStats'](_0x4cca46){const _0x58c03b=a31_0xe8811a;if(_0x4cca46[_0x58c03b(0x289)][_0x58c03b(0x1a2)]===0x0)return;console[_0x58c03b(0x104)]('\x0a'+a31_0x4d24f3[_0x58c03b(0x2f8)](_0x58c03b(0x2a5)));for(const _0x1e3a79 of _0x4cca46[_0x58c03b(0x289)]){const _0x1442ff=_0x1e3a79[_0x58c03b(0x2a9)]?a31_0x4d24f3['green']('✔'):a31_0x4d24f3[_0x58c03b(0x2f4)]('✘');let _0x497d00='';if(_0x1e3a79['schemaValid']&&_0x1e3a79['matchedCount']!==undefined&&_0x1e3a79['coveragePercent']!==undefined){const _0x33a206=_0x1e3a79[_0x58c03b(0x30a)]['toFixed'](0x1),_0x161dd7=_0x1e3a79[_0x58c03b(0x30a)]>=0x50?a31_0x4d24f3[_0x58c03b(0x2af)]:_0x1e3a79[_0x58c03b(0x30a)]>=0x32?a31_0x4d24f3['yellow']:a31_0x4d24f3['red'];_0x497d00='\x20'+a31_0x4d24f3[_0x58c03b(0x2f8)](_0x58c03b(0x255))+'\x20'+_0x161dd7(_0x33a206+'%')+'\x20('+formatRows(_0x1e3a79['matchedCount'])+_0x58c03b(0x2c5);}console[_0x58c03b(0x104)](_0x1442ff+'\x20'+a31_0x4d24f3[_0x58c03b(0x166)](_0x1e3a79['name'])+_0x497d00),console['error']('\x20\x20'+a31_0x4d24f3['dim'](_0x58c03b(0x206))+'\x20'+a31_0x4d24f3[_0x58c03b(0x166)](_0x1e3a79[_0x58c03b(0x153)]+'.'+_0x1e3a79[_0x58c03b(0x101)]));const _0x288de7=_0x1e3a79['joinKey']===_0x1e3a79['foreignKey']?a31_0x4d24f3['dim']('Join\x20on:')+'\x20'+_0x1e3a79[_0x58c03b(0x29c)]:a31_0x4d24f3[_0x58c03b(0x2f8)]('Join:')+'\x20'+_0x1e3a79[_0x58c03b(0x29c)]+'\x20=\x20'+_0x1e3a79[_0x58c03b(0x161)];console['error']('\x20\x20'+_0x288de7),console[_0x58c03b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x58c03b(0x2f8)]('Columns:')),this[_0x58c03b(0x178)](_0x1e3a79['columns']),!_0x1e3a79[_0x58c03b(0x2a9)]&&console[_0x58c03b(0x104)]('\x20\x20'+a31_0x4d24f3['red']('Error:')+'\x20'+_0x1e3a79['schemaError']);}}[a31_0xe8811a(0x2c9)](_0x57978b,_0x136e7f){const _0x14f79b=a31_0xe8811a;if(_0x57978b[_0x14f79b(0x243)]['length']===0x0)return;console[_0x14f79b(0x104)]('\x0a'+a31_0x4d24f3[_0x14f79b(0x2f8)](_0x14f79b(0x29e))+'\x20'+a31_0x4d24f3[_0x14f79b(0x2f8)]('('+_0x136e7f+')'));for(const _0x334533 of _0x57978b['behaviors']){const _0x3add9c=_0x334533[_0x14f79b(0x2a9)]?a31_0x4d24f3[_0x14f79b(0x2af)]('✔'):a31_0x4d24f3[_0x14f79b(0x2f4)]('✘');let _0x73bcfe='';if(_0x334533[_0x14f79b(0x2a9)]&&_0x334533[_0x14f79b(0x170)]!==undefined&&_0x334533[_0x14f79b(0x284)]!==undefined){const _0xbf5d6e=_0x334533[_0x14f79b(0x127)]?.[_0x14f79b(0x1ff)](0x1)||'?',_0xb84b06=(_0x334533[_0x14f79b(0x127)]??0x0)>=0x32?a31_0x4d24f3[_0x14f79b(0x2af)]:(_0x334533[_0x14f79b(0x127)]??0x0)>=0x14?a31_0x4d24f3[_0x14f79b(0x1a7)]:a31_0x4d24f3[_0x14f79b(0x2f4)];_0x73bcfe='\x20'+a31_0x4d24f3['dim'](_0x14f79b(0x16c))+'\x20'+_0xb84b06(formatRows(_0x334533[_0x14f79b(0x170)]))+'\x20('+_0xbf5d6e+_0x14f79b(0x1ad)+a31_0x4d24f3[_0x14f79b(0x2f8)](_0x14f79b(0x268))+'\x20'+a31_0x4d24f3[_0x14f79b(0x175)](formatRows(_0x334533[_0x14f79b(0x284)]));}console[_0x14f79b(0x104)](_0x3add9c+'\x20'+a31_0x4d24f3[_0x14f79b(0x166)](_0x334533[_0x14f79b(0x260)])+_0x73bcfe),console[_0x14f79b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x14f79b(0x2f8)](_0x14f79b(0x206))+'\x20'+a31_0x4d24f3[_0x14f79b(0x166)](_0x334533[_0x14f79b(0x153)]+'.'+_0x334533[_0x14f79b(0x101)]));const _0x49dd12=_0x334533[_0x14f79b(0x29c)]===_0x334533['foreignKey']?a31_0x4d24f3[_0x14f79b(0x2f8)]('Join\x20on:')+'\x20'+_0x334533['joinKey']:a31_0x4d24f3['dim'](_0x14f79b(0x1f6))+'\x20'+_0x334533['joinKey']+_0x14f79b(0x2d3)+_0x334533[_0x14f79b(0x161)];console[_0x14f79b(0x104)]('\x20\x20'+_0x49dd12),console[_0x14f79b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x14f79b(0x2f8)]('Columns:')),this[_0x14f79b(0x178)](_0x334533['columns']),!_0x334533[_0x14f79b(0x2a9)]&&console[_0x14f79b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x14f79b(0x2f4)](_0x14f79b(0x21e))+'\x20'+_0x334533[_0x14f79b(0x12d)]);}}[a31_0xe8811a(0x178)](_0x57fbb3){const _0xcc2c48=a31_0xe8811a;for(const _0x6525dc of _0x57fbb3){_0x6525dc['label']===_0x6525dc[_0xcc2c48(0x1df)]||_0x6525dc['column']==='*'?console[_0xcc2c48(0x104)](_0xcc2c48(0x2aa)+_0x6525dc[_0xcc2c48(0x2ca)]):console[_0xcc2c48(0x104)](_0xcc2c48(0x2aa)+_0x6525dc['label']+'\x20'+a31_0x4d24f3[_0xcc2c48(0x2f8)]('('+_0x6525dc[_0xcc2c48(0x1df)]+')'));}}['displaySummary'](_0x51ae29){const _0x2386fb=a31_0xe8811a;console[_0x2386fb(0x104)]('─'[_0x2386fb(0x290)](0x3c));if(_0x51ae29[_0x2386fb(0x188)][_0x2386fb(0x1a2)]>0x0){console[_0x2386fb(0x104)]('\x0a'+a31_0x4d24f3[_0x2386fb(0x2f4)](_0x2386fb(0x297)));for(const _0x291498 of _0x51ae29[_0x2386fb(0x188)]){console[_0x2386fb(0x104)]('\x20\x20'+a31_0x4d24f3['red']('•')+'\x20'+_0x291498);}}_0x51ae29[_0x2386fb(0x307)]&&console['error']('\x0a'+a31_0x4d24f3[_0x2386fb(0x2af)]('✔')+_0x2386fb(0x225));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1c5);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x1a5);async[a31_0xe8811a(0x224)](_0x291d63){const _0x424872=a31_0xe8811a,{options:_0x24c2c3,args:_0x321949,tdx:_0x544c93}=_0x291d63,_0x325322=_0x24c2c3,_0x1f7d24=_0x321949[0x0]||_0x24c2c3[_0x424872(0x13c)];if(!_0x1f7d24)return showParentSegmentNotSetError(_0x424872(0x235)+_0x424872(0x204)+_0x424872(0x157)+_0x424872(0x1e2)+_0x424872(0x1de)+_0x424872(0x197)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x424872(0x149)),0x1;if(!_0x325322[_0x424872(0x2cf)]&&!_0x325322[_0x424872(0x229)]&&!_0x325322[_0x424872(0x2e3)]&&!_0x325322['enriched'])return console['error'](a31_0x4d24f3[_0x424872(0x2f4)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error'](_0x424872(0x1e4)),console[_0x424872(0x104)]('Options:'),console[_0x424872(0x104)](_0x424872(0x14a)),console['error'](_0x424872(0x151)),console['error'](_0x424872(0x1d7)),console[_0x424872(0x104)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x315884=resolveYamlFile(_0x1f7d24);if(!existsSync(_0x315884))return showFileNotFoundError(_0x315884,_0x1f7d24),0x1;_0x325322[_0x424872(0x10d)]&&(console[_0x424872(0x104)](_0x424872(0x1e8)+_0x325322[_0x424872(0x1d6)]),console[_0x424872(0x104)](_0x424872(0x172)+_0x315884));let _0x71ca70;try{_0x71ca70=readFileSync(_0x315884,_0x424872(0x29f));}catch(_0x1d95fc){const _0x118f77=_0x1d95fc instanceof Error?_0x1d95fc['message']:String(_0x1d95fc);return console[_0x424872(0x104)](_0x424872(0x2fc)+_0x118f77),0x1;}let _0x4c5e32;try{_0x4c5e32=parseDef(_0x71ca70);}catch(_0x48cf68){const _0x3ee35d=_0x48cf68 instanceof Error?_0x48cf68[_0x424872(0x205)]:String(_0x48cf68);return console['error'](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x1d4)+_0x3ee35d)),0x1;}if(_0x325322[_0x424872(0x229)]===!![]||_0x325322[_0x424872(0x229)]===''){const _0x32e4be=_0x4c5e32[_0x424872(0x289)]?.[_0x424872(0x17e)](_0x39795f=>_0x39795f[_0x424872(0x260)])||[];if(_0x32e4be[_0x424872(0x1a2)]===0x0)console[_0x424872(0x104)](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x2ec)));else{console[_0x424872(0x104)](a31_0x4d24f3['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x424872(0x104)]('Available\x20attributes:');for(const _0x38ba33 of _0x32e4be){console[_0x424872(0x104)]('\x20\x20'+a31_0x4d24f3[_0x424872(0x175)](_0x38ba33));}console[_0x424872(0x104)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x1f7d24+_0x424872(0x1bf)+_0x32e4be[0x0]+'\x22');}return 0x1;}if(_0x325322['behavior']===!![]||_0x325322[_0x424872(0x2e3)]===''){const _0x250550=_0x4c5e32[_0x424872(0x243)]?.[_0x424872(0x17e)](_0x255483=>_0x255483[_0x424872(0x260)])||[];if(_0x250550['length']===0x0)console[_0x424872(0x104)](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x19e)));else{console[_0x424872(0x104)](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x22b))),console[_0x424872(0x104)](_0x424872(0x2d8));for(const _0x5ea291 of _0x250550){console[_0x424872(0x104)]('\x20\x20'+a31_0x4d24f3['cyan'](_0x5ea291));}console[_0x424872(0x104)](_0x424872(0x23f)+_0x1f7d24+_0x424872(0x301)+_0x250550[0x0]+'\x22');}return 0x1;}const _0x34968f=createCommandSpinner(a31_0x4d24f3[_0x424872(0x2f8)](_0x424872(0x308)),{'verbose':_0x325322[_0x424872(0x10d)]});_0x34968f[_0x424872(0x283)]();const _0x114c5f={'onProgress':_0x4ada37=>{const _0x296c0b=_0x424872;_0x34968f[_0x296c0b(0x1be)]=formatProgressMessage(_0x4ada37);}};if(_0x325322[_0x424872(0x2cf)])_0x114c5f['master']=!![];if(_0x325322['attribute']&&typeof _0x325322[_0x424872(0x229)]==='string')_0x114c5f[_0x424872(0x229)]=_0x325322[_0x424872(0x229)];if(_0x325322[_0x424872(0x2e3)]&&typeof _0x325322['behavior']===_0x424872(0x11f))_0x114c5f['behavior']=_0x325322[_0x424872(0x2e3)];if(_0x325322[_0x424872(0x2bb)])_0x114c5f[_0x424872(0x2bb)]=!![];if(_0x325322['interval'])_0x114c5f[_0x424872(0x2e1)]=_0x325322[_0x424872(0x2e1)];let _0x5c6012;try{_0x5c6012=await _0x544c93['segment'][_0x424872(0x24d)](_0x71ca70,_0x114c5f),_0x34968f['stop']();}catch(_0x4da99e){_0x34968f['stop']();throw _0x4da99e;}return await this[_0x424872(0x10a)](_0x5c6012,{'master':_0x325322['master'],'attribute':typeof _0x325322[_0x424872(0x229)]===_0x424872(0x11f)?_0x325322[_0x424872(0x229)]:undefined,'behavior':typeof _0x325322[_0x424872(0x2e3)]===_0x424872(0x11f)?_0x325322['behavior']:undefined,'enriched':_0x325322[_0x424872(0x2bb)]}),_0x5c6012[_0x424872(0x307)]?0x0:0x1;}async['displayPreviewResults'](_0x599e1e,_0x3326b8){const _0x22c1ae=a31_0xe8811a;console[_0x22c1ae(0x104)]('\x0a'+a31_0x4d24f3['bold'](_0x22c1ae(0x2d0))+'\x20'+_0x599e1e['name']),console[_0x22c1ae(0x104)]('═'[_0x22c1ae(0x290)](0x3c));if(_0x3326b8[_0x22c1ae(0x2cf)]&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x13ca22=a31_0x4d24f3['dim'](_0x22c1ae(0x237))+'\x20'+a31_0x4d24f3[_0x22c1ae(0x166)](_0x599e1e['master'][_0x22c1ae(0x153)]+'.'+_0x599e1e[_0x22c1ae(0x2cf)][_0x22c1ae(0x101)]);await this[_0x22c1ae(0x27a)](_0x13ca22,_0x599e1e['sampleData']);}else{if(_0x3326b8['attribute']&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x528890=a31_0x4d24f3[_0x22c1ae(0x2f8)](_0x22c1ae(0x138))+'\x20'+a31_0x4d24f3['bold'](_0x3326b8[_0x22c1ae(0x229)]);await this[_0x22c1ae(0x27a)](_0x528890,_0x599e1e[_0x22c1ae(0x1b8)]);}else{if(_0x3326b8[_0x22c1ae(0x2e3)]&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x390e4c=a31_0x4d24f3[_0x22c1ae(0x2f8)](_0x22c1ae(0x24e))+'\x20'+a31_0x4d24f3['bold'](_0x3326b8['behavior']);await this[_0x22c1ae(0x27a)](_0x390e4c,_0x599e1e[_0x22c1ae(0x1b8)]);}else{if(_0x3326b8[_0x22c1ae(0x2bb)]&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x356add=a31_0x4d24f3[_0x22c1ae(0x2f8)](_0x22c1ae(0x2c6))+'\x20'+a31_0x4d24f3[_0x22c1ae(0x166)]('Master\x20+\x20Attributes');await this[_0x22c1ae(0x27a)](_0x356add,_0x599e1e['sampleData']);}else!_0x599e1e[_0x22c1ae(0x1b8)]&&console[_0x22c1ae(0x104)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x599e1e['errors'][_0x22c1ae(0x1a2)]>0x0){console['error']('─'[_0x22c1ae(0x290)](0x3c)),console[_0x22c1ae(0x104)]('\x0a'+a31_0x4d24f3[_0x22c1ae(0x2f4)](_0x22c1ae(0x297)));for(const _0x21b436 of _0x599e1e[_0x22c1ae(0x188)]){console[_0x22c1ae(0x104)]('\x20\x20'+a31_0x4d24f3[_0x22c1ae(0x2f4)]('•')+'\x20'+_0x21b436);}}}async[a31_0xe8811a(0x27a)](_0x38542a,_0x3069e9){const _0x5944d3=a31_0xe8811a;if(_0x3069e9[_0x5944d3(0x1a2)]===0x0){console['error']('\x0a'+_0x38542a),console['error']('\x20\x20No\x20sample\x20data\x20available');return;}console['error']('\x0a'+_0x38542a);const _0xad1841=Object[_0x5944d3(0x1c8)](_0x3069e9[0x0])[_0x5944d3(0x17e)](_0x158479=>({'name':_0x158479,'type':typeof _0x3069e9[0x0][_0x158479]===_0x5944d3(0x1e0)?'double':_0x5944d3(0x28f)})),_0x2aa2ff={'queryId':'preview','columns':_0xad1841,'data':_0x3069e9,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3069e9['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5434de=formatAsTable(_0x2aa2ff,_0x3069e9[_0x5944d3(0x1a2)],!![]);await writeOutput(_0x5434de,undefined,_0x5944d3(0x101));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a31_0xe8811a(0x2b8);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x15a);async[a31_0xe8811a(0x224)](_0x18e0f8){const _0x182949=a31_0xe8811a,{options:_0xc70f0b,args:_0x299eca,tdx:_0x53512f}=_0x18e0f8,_0xffcd71=_0xc70f0b,_0x54e49e=_0x299eca[0x0]||_0xc70f0b[_0x182949(0x13c)];if(!_0x54e49e)return showParentSegmentNotSetError(_0x182949(0x137)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x239028=resolveYamlFile(_0x54e49e);if(existsSync(_0x239028)){_0xffcd71[_0x182949(0x10d)]&&console['error'](_0x182949(0x23a)+_0x239028);let _0x1bfd9b;try{_0x1bfd9b=readFileSync(_0x239028,_0x182949(0x29f));}catch(_0x54b4bc){const _0x50eb9d=_0x54b4bc instanceof Error?_0x54b4bc['message']:String(_0x54b4bc);return console[_0x182949(0x104)](_0x182949(0x2fc)+_0x50eb9d),0x1;}const _0x11548b=await withSpinner(_0x182949(0x1c3),()=>_0x53512f[_0x182949(0x200)]['pushParentYaml'](_0x1bfd9b),{'verbose':_0xffcd71[_0x182949(0x10d)]}),_0x20f759=_0x11548b['data'],{isNew:_0x35df1c,name:_0x42e0eb,hasChanges:_0x162864,diffFormatted:_0x298e18}=_0x20f759;if(_0x162864){_0x35df1c?console[_0x182949(0x104)](_0x182949(0x30b)+_0x42e0eb+'\x27:'):console[_0x182949(0x104)](_0x182949(0x30f)+_0x42e0eb+'\x27:');console[_0x182949(0x104)]('─'[_0x182949(0x290)](0x3c)),console[_0x182949(0x104)](_0x298e18),console['error']('─'['repeat'](0x3c));const _0x35876b=_0x35df1c?_0x182949(0x1e9)+_0x42e0eb+_0x182949(0x2d4):_0x182949(0x2d9)+_0x42e0eb+_0x182949(0x2d4);if(!_0xffcd71[_0x182949(0x1d2)]){if(!isInteractive())return console['error'](a31_0x4d24f3[_0x182949(0x2f4)](_0x182949(0x276)),_0x182949(0x17f)),console[_0x182949(0x104)](a31_0x4d24f3['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2c9ad9=await confirmKey(_0x35876b);if(!_0x2c9ad9)return console[_0x182949(0x104)](a31_0x4d24f3['yellow'](_0x182949(0x231))),0x1;}const _0x31417f=_0x35df1c?_0x182949(0x2f1):_0x182949(0x20a);await withSpinner(_0x31417f+'\x20parent\x20segment\x20\x27'+_0x42e0eb+'\x27...',()=>_0x20f759[_0x182949(0x126)](),{'verbose':_0xffcd71[_0x182949(0x10d)]});const _0x1193c2=_0x35df1c?_0x182949(0x2c7):'Updated';console[_0x182949(0x104)]('✔\x20'+_0x1193c2+'\x20parent\x20segment\x20\x27'+_0x42e0eb+'\x27');}else console[_0x182949(0x104)](_0x182949(0x29b)+_0x42e0eb+_0x182949(0x181));}const _0x1e564d=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x54e49e+_0x182949(0x228),()=>_0x53512f[_0x182949(0x200)][_0x182949(0x240)](_0x54e49e),{'verbose':_0xffcd71[_0x182949(0x10d)]}),_0x37037a=_0x1e564d[_0x182949(0x113)],_0x1bead1=getConsoleUrl(_0xffcd71[_0x182949(0x1d6)],_0x182949(0x148)+_0x37037a[_0x182949(0x280)]+_0x182949(0x18e)+_0x37037a[_0x182949(0x1b1)]+_0x182949(0x319)+_0x37037a['workflowAttemptId']);return console['error'](_0x182949(0x132)),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x2da))+'\x20'+_0x37037a[_0x182949(0x190)]),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x118))+'\x20'+_0x37037a[_0x182949(0x13f)]),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x182949(0x12a))+'\x20'+_0x37037a['workflowSessionId']),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x13a))+'\x20'+_0x37037a['workflowAttemptId']),console[_0x182949(0x104)]('\x20\x20'+_0x1bead1),console[_0x182949(0x104)]('\x0a'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x162))+_0x182949(0x11d)+_0x37037a[_0x182949(0x133)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1dd);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x282);async[a31_0xe8811a(0x224)](_0x23f7eb){const _0x1cf8e8=a31_0xe8811a,{options:_0x3e494b,args:_0x437fbc,tdx:_0x1a2ffe}=_0x23f7eb,_0x330a55=_0x437fbc[0x0]||_0x3e494b[_0x1cf8e8(0x13c)];if(!_0x330a55)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+_0x1cf8e8(0x20c)),0x1;_0x3e494b[_0x1cf8e8(0x10d)]&&(console['error']('Site:\x20'+_0x3e494b[_0x1cf8e8(0x1d6)]),console[_0x1cf8e8(0x104)]('Parent\x20segment:\x20'+_0x330a55));const _0x143828=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x330a55+_0x1cf8e8(0x228),()=>_0x1a2ffe[_0x1cf8e8(0x200)][_0x1cf8e8(0x134)](_0x330a55),{'verbose':_0x3e494b['verbose']}),_0xa603c3=_0x143828['data'];console[_0x1cf8e8(0x104)](_0x1cf8e8(0x245)+_0xa603c3[_0x1cf8e8(0x1a2)]+'\x20field'+(_0xa603c3[_0x1cf8e8(0x1a2)]!==0x1?'s':''));if(_0x3e494b[_0x1cf8e8(0x254)]||_0x3e494b[_0x1cf8e8(0x29a)])return await handleSDKOutput(_0xa603c3,_0x3e494b),0x0;return displayFieldsHumanReadable(_0xa603c3,_0x330a55),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0xe8811a(0x260)]='segment:parent:view';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x16e);async[a31_0xe8811a(0x224)](_0x1d9121){const _0x429e89=a31_0xe8811a,{options:_0x1ea218,args:_0xb7ad30,tdx:_0x3f9330}=_0x1d9121,_0x47eed8=_0x1ea218,_0x4b2d5a=_0xb7ad30[0x0]||_0x1ea218['parentSegment'];if(!_0x4b2d5a)return showParentSegmentNotSetError(_0x429e89(0x1e7)+_0x429e89(0x30d)+_0x429e89(0x217)+_0x429e89(0x11e)),0x1;_0x1ea218[_0x429e89(0x10d)]&&(console[_0x429e89(0x104)]('Site:\x20'+_0x1ea218[_0x429e89(0x1d6)]),console['error']('Parent\x20segment:\x20'+_0x4b2d5a));const _0x3eaf6a=await withSpinner(_0x429e89(0x11b)+_0x4b2d5a+_0x429e89(0x228),()=>_0x3f9330[_0x429e89(0x200)][_0x429e89(0x17c)](_0x4b2d5a),{'verbose':_0x1ea218['verbose']}),_0x98fa35=_0x3eaf6a[_0x429e89(0x113)];if(_0x47eed8['web']){const _0x1d935a=getConsoleNextUrl(_0x47eed8[_0x429e89(0x1d6)],_0x429e89(0x298)+_0x98fa35['id']);return console['error'](a31_0x4d24f3[_0x429e89(0x2af)]('✔')+_0x429e89(0x241)+a31_0x4d24f3[_0x429e89(0x175)](_0x1d935a)),openBrowser(_0x1d935a),0x0;}return await handleSingleObjectOutput(_0x98fa35,_0x1ea218),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']='segment:parent:desc';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x12b);async[a31_0xe8811a(0x224)](_0x74013e){const _0x169d16=a31_0xe8811a,{options:_0x4d8fc5,args:_0x20e531,tdx:_0x62d88}=_0x74013e,_0x143375=_0x4d8fc5,_0x296d32=_0x20e531[0x0]||_0x4d8fc5['parentSegment'];if(!_0x296d32)return showParentSegmentNotSetError(_0x169d16(0x1db)+_0x169d16(0x1bb)+_0x169d16(0x217)+_0x169d16(0x314)),0x1;_0x4d8fc5[_0x169d16(0x10d)]&&(console[_0x169d16(0x104)]('Site:\x20'+_0x4d8fc5[_0x169d16(0x1d6)]),console[_0x169d16(0x104)](_0x169d16(0x177)+_0x296d32));const _0x66220f=await withSpinner(_0x169d16(0x18d)+_0x296d32+_0x169d16(0x228),()=>_0x62d88[_0x169d16(0x200)][_0x169d16(0x143)](_0x296d32),{'verbose':_0x4d8fc5[_0x169d16(0x10d)]}),_0x13eecf=_0x66220f['data'],_0xff14d7=_0x62d88[_0x169d16(0x200)][_0x169d16(0x169)](_0x13eecf);if(_0x143375[_0x169d16(0x16f)]){const _0x4e8f9b=await this[_0x169d16(0x2bd)](_0x74013e,_0x296d32,_0x13eecf,_0xff14d7),_0x208f87=this[_0x169d16(0x1d5)](_0x4e8f9b);writeFileSync(_0x143375[_0x169d16(0x16f)],_0x208f87);const _0x1a7b2c=_0x4e8f9b[_0x169d16(0x163)][_0x169d16(0x317)][_0x169d16(0x1a2)]+_0x4e8f9b[_0x169d16(0x243)][_0x169d16(0x2ef)]((_0x2d2d45,_0xc2f568)=>_0x2d2d45+_0xc2f568[_0x169d16(0x317)][_0x169d16(0x1a2)],0x0),_0x5870f4=_0x4e8f9b[_0x169d16(0x243)][_0x169d16(0x186)](_0x4fb25e=>_0x4fb25e[_0x169d16(0x317)][_0x169d16(0x1a2)]===0x0)[_0x169d16(0x1a2)];return console[_0x169d16(0x253)]('Schema\x20saved\x20to\x20'+_0x143375[_0x169d16(0x16f)]),console['log'](_0x169d16(0x195)+_0xff14d7),console[_0x169d16(0x253)](_0x169d16(0x295)+_0x4e8f9b[_0x169d16(0x243)][_0x169d16(0x1a2)]+'\x20behaviors'),console[_0x169d16(0x253)]('\x20\x20Columns:\x20'+_0x1a7b2c+_0x169d16(0x2e0)),_0x5870f4>0x0&&console[_0x169d16(0x253)](_0x169d16(0x13b)+_0x5870f4+_0x169d16(0x1f1)),0x0;}console[_0x169d16(0x104)]('\x0a'+a31_0x4d24f3['bold'](_0x169d16(0x247))+'\x20'+a31_0x4d24f3[_0x169d16(0x175)](_0xff14d7));const _0x923671=await withSpinner(_0x169d16(0x215),()=>_0x62d88[_0x169d16(0x200)][_0x169d16(0x1fa)](_0x13eecf),{'verbose':_0x4d8fc5[_0x169d16(0x10d)]});console[_0x169d16(0x104)]('\x0a'+a31_0x4d24f3[_0x169d16(0x166)]('customers')+'\x20'+a31_0x4d24f3[_0x169d16(0x2f8)]('('+_0xff14d7+_0x169d16(0x248)));const _0x5f57c5=await executeSchemaQuery(_0x923671[_0x169d16(0x113)],_0x62d88,_0x4d8fc5);await handleQueryOutput(_0x5f57c5,_0x4d8fc5);const _0x229e4b=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x62d88[_0x169d16(0x200)][_0x169d16(0x19c)](_0x13eecf),{'verbose':_0x4d8fc5['verbose']});for(const _0x44933a of _0x229e4b['data']){const _0x522575='behavior_'+_0x44933a[_0x169d16(0x15b)]()['replace'](/\s+/g,'_'),_0xb368c8=_0x169d16(0x142)+_0xff14d7+'.'+_0x522575;console[_0x169d16(0x104)]('\x0a'+a31_0x4d24f3[_0x169d16(0x166)](_0x44933a)+'\x20'+a31_0x4d24f3['dim']('('+_0xff14d7+'.'+_0x522575+')'));try{const _0x5d4014=await executeSchemaQuery(_0xb368c8,_0x62d88,_0x4d8fc5);await handleQueryOutput(_0x5d4014,_0x4d8fc5);}catch{console[_0x169d16(0x104)](a31_0x4d24f3['yellow']('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a31_0xe8811a(0x2bd)](_0x26a622,_0x1c8927,_0x580e98,_0xda79fe){const _0x2f2ece=a31_0xe8811a,{options:_0x1c5132,tdx:_0x17707b}=_0x26a622,_0x4aad78=await withSpinner(_0x2f2ece(0x215),()=>_0x17707b['segment'][_0x2f2ece(0x1fa)](_0x580e98),{'verbose':_0x1c5132[_0x2f2ece(0x10d)]}),_0x26a38a=await executeSchemaQuery(_0x4aad78[_0x2f2ece(0x113)],_0x17707b,_0x1c5132),_0x1278c0=_0x26a38a[_0x2f2ece(0x113)][_0x2f2ece(0x17e)](_0x1b649b=>({'name':_0x1b649b[_0x2f2ece(0x28e)],'type':_0x1b649b[_0x2f2ece(0x19b)]})),_0x307a91=await withSpinner(_0x2f2ece(0x125),()=>_0x17707b[_0x2f2ece(0x200)][_0x2f2ece(0x19c)](_0x580e98),{'verbose':_0x1c5132[_0x2f2ece(0x10d)]}),_0x429c39=[];for(const _0x3ce39e of _0x307a91[_0x2f2ece(0x113)]){const _0x453fa7=_0x2f2ece(0x144)+_0x3ce39e[_0x2f2ece(0x15b)]()['replace'](/\s+/g,'_'),_0x1ffd2d='SELECT\x20*\x20FROM\x20'+_0xda79fe+'.'+_0x453fa7;let _0x1a498c=[];try{const _0x3f967d=await executeSchemaQuery(_0x1ffd2d,_0x17707b,_0x1c5132);_0x1a498c=_0x3f967d[_0x2f2ece(0x113)][_0x2f2ece(0x17e)](_0x59dfc0=>({'name':_0x59dfc0[_0x2f2ece(0x28e)],'type':_0x59dfc0[_0x2f2ece(0x19b)]}));}catch{}_0x429c39[_0x2f2ece(0x1ed)]({'table':_0x453fa7,'columns':_0x1a498c});}return{'database':_0xda79fe,'parent_segment':_0x1c8927,'parent_id':_0x580e98,'customers':{'table':_0x2f2ece(0x163),'columns':_0x1278c0},'behaviors':_0x429c39};}[a31_0xe8811a(0x1d5)](_0x43db26){const _0x5be76f=a31_0xe8811a,_0x2856e7=_0x42b6cc=>{const _0x3af1a1=a31_0x28cc;if(_0x42b6cc['length']===0x0)return'[]';const _0x2d200d=_0x42b6cc['map'](_0x1df1c0=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x1df1c0[_0x3af1a1(0x260)]+_0x3af1a1(0x227)+_0x1df1c0[_0x3af1a1(0x223)]+_0x3af1a1(0x31d));return'[\x0a'+_0x2d200d[_0x3af1a1(0x31f)](',\x0a')+_0x3af1a1(0x15e);},_0x10cfa4=_0x43db26['behaviors'][_0x5be76f(0x17e)](_0x12ff4e=>{const _0x82339e=_0x5be76f;return _0x82339e(0x13d)+_0x12ff4e[_0x82339e(0x101)]+_0x82339e(0x145)+_0x2856e7(_0x12ff4e['columns'])['replace'](/^/gm,'\x20\x20')[_0x82339e(0x2d1)]()+'\x0a\x20\x20\x20\x20}';})['join'](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x43db26[_0x5be76f(0x153)]+_0x5be76f(0x12e)+_0x43db26[_0x5be76f(0x296)]+_0x5be76f(0x2d7)+_0x43db26[_0x5be76f(0x2e9)]+_0x5be76f(0x1a4)+_0x43db26[_0x5be76f(0x163)][_0x5be76f(0x101)]+_0x5be76f(0x1b7)+_0x2856e7(_0x43db26['customers']['columns'])['replace'](/^/gm,'\x20\x20')[_0x5be76f(0x2d1)]()+_0x5be76f(0x2b2)+_0x10cfa4+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x123);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x2e4);async['execute'](_0x55b739){const _0x46b727=a31_0xe8811a,{options:_0x494111,args:_0x24f0d9,tdx:_0x358ecf}=_0x55b739,_0x766379=_0x24f0d9[0x0]||_0x494111[_0x46b727(0x13c)];if(!_0x766379)return showParentSegmentNotSetError(_0x46b727(0x25b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x494111['verbose']&&(console[_0x46b727(0x104)](_0x46b727(0x1e8)+_0x494111[_0x46b727(0x1d6)]),console['error'](_0x46b727(0x177)+_0x766379));const _0x580bb4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x766379+_0x46b727(0x228),()=>_0x358ecf['segment']['resolveParentId'](_0x766379),{'verbose':_0x494111[_0x46b727(0x10d)]}),_0x3c7240=_0x580bb4[_0x46b727(0x113)],_0xfd1b59=await withSpinner(_0x46b727(0x2e2)+_0x766379+'\x27...',()=>_0x358ecf[_0x46b727(0x200)][_0x46b727(0x1fa)](_0x3c7240),{'verbose':_0x494111[_0x46b727(0x10d)]}),_0x18f1fe=_0xfd1b59[_0x46b727(0x113)];return _0x494111[_0x46b727(0x14d)]===_0x46b727(0x254)||_0x494111[_0x46b727(0x14d)]===_0x46b727(0x29a)?await handleSDKOutput([{'sql':_0x18f1fe}],_0x494111):console[_0x46b727(0x253)](_0x18f1fe),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a31_0xe8811a(0x108);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x15d);async[a31_0xe8811a(0x224)](_0x2570ec){const _0x4b698c=a31_0xe8811a,{options:_0x3ff45b,args:_0x5a2cbd,tdx:_0x768115}=_0x2570ec,_0x56438f=_0x5a2cbd[0x0]||_0x3ff45b[_0x4b698c(0x13c)];if(!_0x56438f)return showParentSegmentNotSetError(_0x4b698c(0x270)+'\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;_0x3ff45b[_0x4b698c(0x10d)]&&(console['error']('Site:\x20'+_0x3ff45b[_0x4b698c(0x1d6)]),console[_0x4b698c(0x104)](_0x4b698c(0x177)+_0x56438f));const _0x5d9327=await withSpinner(_0x4b698c(0x18d)+_0x56438f+_0x4b698c(0x228),()=>_0x768115[_0x4b698c(0x200)][_0x4b698c(0x143)](_0x56438f),{'verbose':_0x3ff45b[_0x4b698c(0x10d)]}),_0x4f89d7=_0x5d9327[_0x4b698c(0x113)],_0x1f7f5d=await withSpinner(_0x4b698c(0x2e2)+_0x56438f+'\x27...',()=>_0x768115[_0x4b698c(0x200)][_0x4b698c(0x1fa)](_0x4f89d7),{'verbose':_0x3ff45b[_0x4b698c(0x10d)]});let _0x583df6=_0x1f7f5d[_0x4b698c(0x113)];const _0xb7473e=resolveLimit(_0x3ff45b[_0x4b698c(0x263)],DEFAULT_DISPLAY_LIMIT),_0x551224=/\bLIMIT\s+\d+/i['test'](_0x583df6);!_0x551224&&(_0x583df6=_0x583df6['trim']()[_0x4b698c(0x2b1)](/;+$/,''),_0x583df6=_0x4b698c(0x226)+_0x583df6+_0x4b698c(0x10f)+_0xb7473e);_0x3ff45b[_0x4b698c(0x10d)]&&console[_0x4b698c(0x104)](_0x4b698c(0x17a)+_0x583df6);const _0x14b2d7=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x19b9d9=>{const _0x4e8b2f=_0x4b698c,_0x3487d7=await _0x768115[_0x4e8b2f(0x246)]['execute'](_0x583df6,{'catalog':'td','schema':_0x4e8b2f(0x100),'onJobId':_0x32deec=>{_0x19b9d9['setJobId'](_0x32deec);}});return _0x3487d7;},{'verbose':_0x3ff45b[_0x4b698c(0x10d)]}),_0x2a9d24=_0x14b2d7[_0x4b698c(0x113)],_0x355c48=_0x2a9d24[_0x4b698c(0x2d6)]?_0x4b698c(0x285)+_0x2a9d24[_0x4b698c(0x2d6)]+']':'';return console[_0x4b698c(0x104)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x2a9d24[_0x4b698c(0x242)][_0x4b698c(0x211)][_0x4b698c(0x1cd)]()+_0x4b698c(0x23c)+(_0x4b698c(0x21f)+formatElapsed(_0x2a9d24[_0x4b698c(0x242)]['elapsedTimeMillis'])+_0x355c48)),await handleQueryOutput(_0x2a9d24,_0x3ff45b),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x29d);[a31_0xe8811a(0x2ab)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a31_0xe8811a(0x224)](_0x3951ed){const _0x7860e1=a31_0xe8811a,{options:_0x2ebda6,args:_0x5f4def,tdx:_0x5b7c27}=_0x3951ed,_0x161aa6=_0x5f4def[0x0],_0x4935ff=await withSpinner(_0x161aa6?_0x7860e1(0x105)+_0x161aa6+_0x7860e1(0x228):_0x7860e1(0x20b),()=>_0x5b7c27['realtime'][_0x7860e1(0x12f)](),{'verbose':_0x2ebda6[_0x7860e1(0x10d)]});let _0x4f5b22=_0x4935ff[_0x7860e1(0x113)]['filter'](_0x4a8514=>_0x4a8514[_0x7860e1(0x274)]);if(_0x161aa6){const _0x4def17=_0x161aa6[_0x7860e1(0x2b1)](/[.+^${}()|[\]\\]/g,_0x7860e1(0x22e))[_0x7860e1(0x2b1)](/\*/g,'.*')[_0x7860e1(0x2b1)](/\?/g,'.'),_0x227058=new RegExp('^'+_0x4def17+'$','i');_0x4f5b22=_0x4f5b22[_0x7860e1(0x186)](_0x53adc9=>_0x227058[_0x7860e1(0x26b)](_0x53adc9[_0x7860e1(0x260)]));}_0x4f5b22[_0x7860e1(0x202)]((_0x2743a0,_0x3a6e8d)=>_0x2743a0[_0x7860e1(0x260)][_0x7860e1(0x25d)](_0x3a6e8d[_0x7860e1(0x260)])),console[_0x7860e1(0x104)](_0x7860e1(0x245)+_0x4f5b22[_0x7860e1(0x1a2)]+_0x7860e1(0x2a0)+(_0x4f5b22['length']!==0x1?'s':''));const _0x216b7b=_0x495452=>{const _0x2c324b=_0x7860e1;return getConsoleNextUrl(_0x2ebda6[_0x2c324b(0x1d6)],_0x2c324b(0x298)+_0x495452);};if(_0x2ebda6[_0x7860e1(0x14d)]==='json'||_0x2ebda6[_0x7860e1(0x14d)]===_0x7860e1(0x29a)){const _0x5b1ce1=_0x4f5b22[_0x7860e1(0x17e)](_0x200bb6=>({..._0x200bb6,'url':_0x216b7b(_0x200bb6['id'])}));await handleSDKOutput(_0x5b1ce1,_0x2ebda6);}else{if(_0x4f5b22['length']===0x0)console['log'](_0x7860e1(0x2b4));else for(const _0x26ed49 of _0x4f5b22){const _0x56bdb8=_0x26ed49['population']?a31_0x4d24f3[_0x7860e1(0x2f8)]('\x20('+formatRows(_0x26ed49[_0x7860e1(0x154)])+')'):'',_0x4224e8=hyperlink(_0x26ed49[_0x7860e1(0x260)],_0x216b7b(_0x26ed49['id']));console['log']('⚡\x20'+_0x4224e8+_0x56bdb8);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x27e);['description']=a31_0xe8811a(0x287);async['execute'](_0x12a9a4){const _0x5ccba2=a31_0xe8811a,{options:_0x55b1bc,args:_0x5e6b9f,tdx:_0x319bc4}=_0x12a9a4,_0x3310af=_0x5e6b9f[0x0]||_0x55b1bc['parentSegment'];if(!_0x3310af)return showParentSegmentNotSetError(_0x5ccba2(0x21c)+_0x5ccba2(0x194)),0x1;const _0x126a91=resolveYamlFile(_0x3310af);if(!existsSync(_0x126a91))return showFileNotFoundError(_0x126a91,_0x3310af),0x1;let _0x63bc18;try{_0x63bc18=readFileSync(_0x126a91,_0x5ccba2(0x29f));}catch(_0x3c3cd5){const _0x5089c9=_0x3c3cd5 instanceof Error?_0x3c3cd5[_0x5ccba2(0x205)]:String(_0x3c3cd5);return console[_0x5ccba2(0x104)]('Error\x20reading\x20file:\x20'+_0x5089c9),0x1;}const _0xd70d02=createCommandSpinner(a31_0x4d24f3[_0x5ccba2(0x2f8)](_0x5ccba2(0x312)),{'verbose':_0x55b1bc['verbose']});_0xd70d02['start']();const _0x3eb533={'realtime':!![],'onProgress':_0x4af32d=>{const _0x33bbfe=_0x5ccba2;_0xd70d02[_0x33bbfe(0x1be)]=formatProgressMessage(_0x4af32d);}};let _0x1246bb;try{_0x1246bb=await _0x319bc4[_0x5ccba2(0x200)][_0x5ccba2(0x2b6)](_0x63bc18,_0x3eb533),_0xd70d02[_0x5ccba2(0x1e3)]();}catch(_0x5246fc){_0xd70d02[_0x5ccba2(0x1e3)]();throw _0x5246fc;}console[_0x5ccba2(0x104)]('\x0a'+a31_0x4d24f3[_0x5ccba2(0x166)](_0x5ccba2(0x2cd))+'\x20'+_0x1246bb[_0x5ccba2(0x260)]),console[_0x5ccba2(0x104)]('═'[_0x5ccba2(0x290)](0x3c)),displayRealtimeValidation(_0x1246bb),console[_0x5ccba2(0x104)]('─'['repeat'](0x3c));if(_0x1246bb['errors'][_0x5ccba2(0x1a2)]>0x0){console[_0x5ccba2(0x104)]('\x0a'+a31_0x4d24f3['red'](_0x5ccba2(0x297)));for(const _0xd52bf1 of _0x1246bb[_0x5ccba2(0x188)]){console['error']('\x20\x20'+a31_0x4d24f3[_0x5ccba2(0x2f4)]('•')+'\x20'+_0xd52bf1);}}return _0x1246bb['allValid']&&console[_0x5ccba2(0x104)]('\x0a'+a31_0x4d24f3[_0x5ccba2(0x2af)]('✔')+_0x5ccba2(0x1b2)),_0x1246bb[_0x5ccba2(0x307)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1a9);['description']=a31_0xe8811a(0x1c9);async[a31_0xe8811a(0x224)](_0x5f3c43){const _0x5aed30=a31_0xe8811a,{options:_0x2b81ea,args:_0x22d9b5,tdx:_0x309d44}=_0x5f3c43,_0x32a5c0=_0x22d9b5[0x0]||_0x2b81ea['parentSegment'];if(!_0x32a5c0)return showParentSegmentNotSetError(_0x5aed30(0x2fa)+'\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;_0x2b81ea[_0x5aed30(0x10d)]&&(console[_0x5aed30(0x104)]('Site:\x20'+_0x2b81ea[_0x5aed30(0x1d6)]),console[_0x5aed30(0x104)](_0x5aed30(0x177)+_0x32a5c0));const _0x270803=await withSpinner(_0x5aed30(0x18d)+_0x32a5c0+_0x5aed30(0x228),()=>_0x309d44[_0x5aed30(0x200)]['resolveParentId'](_0x32a5c0),{'verbose':_0x2b81ea[_0x5aed30(0x10d)]}),_0x3505d1=_0x270803[_0x5aed30(0x113)],_0x2a0c43=await withSpinner(_0x5aed30(0x1c4)+_0x32a5c0+'\x27...',()=>_0x309d44[_0x5aed30(0x10e)]['listJourneys'](_0x3505d1),{'verbose':_0x2b81ea[_0x5aed30(0x10d)]}),_0x146296=_0x2a0c43[_0x5aed30(0x113)];console['error'](_0x5aed30(0x245)+_0x146296[_0x5aed30(0x1a2)]+_0x5aed30(0x23d)+(_0x146296['length']!==0x1?'s':''));if(_0x2b81ea[_0x5aed30(0x14d)]===_0x5aed30(0x254)||_0x2b81ea['format']===_0x5aed30(0x29a))await handleSDKOutput(_0x146296,_0x2b81ea);else{if(_0x146296['length']===0x0)console['log']('No\x20RT\x20journeys\x20found');else for(const _0x5b84af of _0x146296){const _0x1a18a1=_0x5b84af[_0x5aed30(0x311)]===_0x5aed30(0x251)?'🚀':'📝',_0x54aa1e=_0x5b84af[_0x5aed30(0x222)]?a31_0x4d24f3[_0x5aed30(0x1a7)](_0x5aed30(0x1d0)):'',_0x4ef998=a31_0x4d24f3[_0x5aed30(0x2f8)]('\x20('+_0x5b84af[_0x5aed30(0x1b6)]+'\x20stage'+(_0x5b84af['stageCount']!==0x1?'s':'')+')');console['log'](_0x1a18a1+'\x20'+_0x5b84af[_0x5aed30(0x260)]+_0x54aa1e+_0x4ef998);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x258);['description']=a31_0xe8811a(0x2dc);async[a31_0xe8811a(0x224)](_0x52927e){const _0x547e90=a31_0xe8811a,{options:_0x4d4db5,args:_0x1fd824,tdx:_0x212165}=_0x52927e,_0xacc183=_0x1fd824[0x0];if(!_0xacc183)return console[_0x547e90(0x104)](a31_0x4d24f3[_0x547e90(0x2f4)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x547e90(0x104)](_0x547e90(0x122)),console['error'](a31_0x4d24f3[_0x547e90(0x2f8)](_0x547e90(0x288))),0x1;_0x4d4db5['verbose']&&(console['error'](_0x547e90(0x1e8)+_0x4d4db5[_0x547e90(0x1d6)]),console[_0x547e90(0x104)](_0x547e90(0x28d)+_0xacc183));const _0x10e1e1=await withSpinner(_0x547e90(0x28a)+_0xacc183+_0x547e90(0x228),()=>_0x212165['realtime'][_0x547e90(0x2f6)](_0xacc183),{'verbose':_0x4d4db5[_0x547e90(0x10d)]}),_0x1def9d=_0x10e1e1[_0x547e90(0x113)];console['error']('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1def9d[_0x547e90(0x260)]+'\x27');if(_0x4d4db5[_0x547e90(0x14d)]==='json'||_0x4d4db5[_0x547e90(0x14d)]===_0x547e90(0x29a))await handleSDKOutput([_0x1def9d],_0x4d4db5);else{const _0x5c7cd4=_0x1def9d['state']===_0x547e90(0x251)?'🚀':'📝',_0x429911=_0x1def9d[_0x547e90(0x222)]?a31_0x4d24f3[_0x547e90(0x1a7)]('\x20(paused)'):'';console[_0x547e90(0x253)](_0x5c7cd4+'\x20'+_0x1def9d[_0x547e90(0x260)]+_0x429911);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']='ps:rt:jn:resume';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x173);async[a31_0xe8811a(0x224)](_0x3541f8){const _0x10a788=a31_0xe8811a,{options:_0x593d5c,args:_0x3ca34a,tdx:_0x395986}=_0x3541f8,_0xdb571c=_0x3ca34a[0x0];if(!_0xdb571c)return console['error'](a31_0x4d24f3[_0x10a788(0x2f4)](_0x10a788(0x2bf))),console[_0x10a788(0x104)](_0x10a788(0x302)),console[_0x10a788(0x104)](a31_0x4d24f3['dim']('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x593d5c[_0x10a788(0x10d)]&&(console[_0x10a788(0x104)](_0x10a788(0x1e8)+_0x593d5c['site']),console[_0x10a788(0x104)](_0x10a788(0x28d)+_0xdb571c));const _0x234646=await withSpinner(_0x10a788(0x1a8)+_0xdb571c+_0x10a788(0x228),()=>_0x395986[_0x10a788(0x10e)]['resumeJourney'](_0xdb571c),{'verbose':_0x593d5c['verbose']}),_0x1fa8a1=_0x234646[_0x10a788(0x113)];console[_0x10a788(0x104)](_0x10a788(0x236)+_0x1fa8a1[_0x10a788(0x260)]+'\x27');if(_0x593d5c['format']==='json'||_0x593d5c[_0x10a788(0x14d)]===_0x10a788(0x29a))await handleSDKOutput([_0x1fa8a1],_0x593d5c);else{const _0x2683d4=_0x1fa8a1[_0x10a788(0x311)]===_0x10a788(0x251)?'🚀':'📝',_0x2af501=_0x1fa8a1[_0x10a788(0x222)]?a31_0x4d24f3['yellow'](_0x10a788(0x1d0)):'';console[_0x10a788(0x253)](_0x2683d4+'\x20'+_0x1fa8a1[_0x10a788(0x260)]+_0x2af501);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']=a31_0xe8811a(0x2fb);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x183);async[a31_0xe8811a(0x224)](_0x298986){const _0x2a2fde=a31_0xe8811a,{options:_0x3b0a63,args:_0x370645,tdx:_0x668b7e}=_0x298986,_0xeb438f=_0x370645[0x0]||_0x3b0a63[_0x2a2fde(0x13c)];if(!_0xeb438f)return showParentSegmentNotSetError(_0x2a2fde(0x267)+_0x2a2fde(0x25a)),0x1;_0x3b0a63['verbose']&&(console[_0x2a2fde(0x104)](_0x2a2fde(0x1e8)+_0x3b0a63['site']),console[_0x2a2fde(0x104)](_0x2a2fde(0x177)+_0xeb438f));const _0x395087=await withSpinner(_0x2a2fde(0x18d)+_0xeb438f+_0x2a2fde(0x228),()=>_0x668b7e[_0x2a2fde(0x200)][_0x2a2fde(0x143)](_0xeb438f),{'verbose':_0x3b0a63['verbose']}),_0x5766ad=_0x395087['data'],_0xcc9d9b=await withSpinner(_0x2a2fde(0x15f)+_0xeb438f+_0x2a2fde(0x228),()=>_0x668b7e[_0x2a2fde(0x10e)]['getCurrentConfigVersion'](_0x5766ad),{'verbose':_0x3b0a63[_0x2a2fde(0x10d)]}),_0x40219a=_0xcc9d9b[_0x2a2fde(0x113)];return console[_0x2a2fde(0x104)](_0x2a2fde(0x27b)),_0x3b0a63[_0x2a2fde(0x14d)]===_0x2a2fde(0x254)||_0x3b0a63[_0x2a2fde(0x14d)]==='jsonl'?await handleSDKOutput([_0x40219a],_0x3b0a63):(console[_0x2a2fde(0x253)]('id:\x20'+_0x40219a['id']),console[_0x2a2fde(0x253)](_0x2a2fde(0x278)+_0x40219a['audienceId']),console[_0x2a2fde(0x253)]('identifier:\x20'+_0x40219a[_0x2a2fde(0x1a3)]),console[_0x2a2fde(0x253)]('eventKind:\x20'+_0x40219a['eventKind']),console[_0x2a2fde(0x253)](_0x2a2fde(0x25c)+_0x40219a[_0x2a2fde(0x13f)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:list';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x2f7);async[a31_0xe8811a(0x224)](_0x57ba45){const _0x3b834a=a31_0xe8811a,{options:_0x2f8524,args:_0x5356bf,tdx:_0x9ec086}=_0x57ba45,_0x59d425=_0x5356bf[0x0]||_0x2f8524['parentSegment'];if(!_0x59d425)return showParentSegmentNotSetError(_0x3b834a(0x2dd)+_0x3b834a(0x1ce)),0x1;const _0x283810=await withSpinner(_0x3b834a(0x18d)+_0x59d425+_0x3b834a(0x228),()=>_0x9ec086['segment'][_0x3b834a(0x143)](_0x59d425),{'verbose':_0x2f8524['verbose']}),_0xa1209a=_0x283810[_0x3b834a(0x113)],_0x16e49b=await withSpinner(_0x3b834a(0x25f)+_0x59d425+_0x3b834a(0x228),()=>_0x9ec086[_0x3b834a(0x20d)]['list'](_0xa1209a),{'verbose':_0x2f8524[_0x3b834a(0x10d)]}),_0x473c72=_0x16e49b['data'];console[_0x3b834a(0x104)](_0x3b834a(0x245)+_0x473c72[_0x3b834a(0x1a2)]+_0x3b834a(0x121)+(_0x473c72[_0x3b834a(0x1a2)]!==0x1?'s':''));if(_0x2f8524[_0x3b834a(0x14d)]===_0x3b834a(0x254)||_0x2f8524['format']==='jsonl')await handleSDKOutput(_0x473c72,_0x2f8524);else{if(_0x473c72[_0x3b834a(0x1a2)]===0x0)console[_0x3b834a(0x253)]('No\x20personalization\x20services\x20configured'),console['error'](a31_0x4d24f3[_0x3b834a(0x175)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x2a2118 of _0x473c72){console[_0x3b834a(0x253)](a31_0x4d24f3[_0x3b834a(0x166)](_0x2a2118[_0x3b834a(0x260)])+'\x20'+a31_0x4d24f3['dim'](_0x3b834a(0x22c)+_0x2a2118['id']+')'));_0x2a2118['description']&&console[_0x3b834a(0x253)]('\x20\x20'+a31_0x4d24f3[_0x3b834a(0x2f8)](_0x2a2118[_0x3b834a(0x2ab)]));if(_0x2a2118[_0x3b834a(0x218)]&&_0x2a2118[_0x3b834a(0x218)][_0x3b834a(0x1a2)]>0x0)for(const _0x57a6ed of _0x2a2118[_0x3b834a(0x218)]){const _0x340b43=_0x57a6ed[_0x3b834a(0x1dc)]?.[_0x3b834a(0x1a2)]?_0x57a6ed[_0x3b834a(0x1dc)][_0x3b834a(0x31f)](',\x20'):_0x3b834a(0x203);console[_0x3b834a(0x253)]('\x20\x20'+a31_0x4d24f3['cyan'](_0x3b834a(0x321))+'\x20'+_0x57a6ed[_0x3b834a(0x260)]+'\x20'+a31_0x4d24f3[_0x3b834a(0x2f8)](_0x3b834a(0x22c)+_0x57a6ed['id']+')')),console[_0x3b834a(0x253)](_0x3b834a(0x2d5)+a31_0x4d24f3['dim'](_0x3b834a(0x1ea))+'\x20'+_0x340b43);}else console[_0x3b834a(0x253)]('\x20\x20'+a31_0x4d24f3[_0x3b834a(0x2f8)](_0x3b834a(0x120)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x261);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x131);async[a31_0xe8811a(0x224)](_0x44150f){const _0x4a97d0=a31_0xe8811a,{options:_0x5e6e75,args:_0x1af8fa,tdx:_0xfa932b}=_0x44150f,_0x242205=_0x5e6e75,_0x29eb48=_0x1af8fa[0x0],_0x276845=_0x1af8fa[0x1]||_0x5e6e75[_0x4a97d0(0x13c)];if(!_0x29eb48)return console[_0x4a97d0(0x104)]('Error:\x20Service\x20name\x20is\x20required'),console[_0x4a97d0(0x104)](_0x4a97d0(0x286)),console[_0x4a97d0(0x104)](_0x4a97d0(0x1f9)),0x1;if(!_0x276845)return showParentSegmentNotSetError(_0x4a97d0(0x160)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x3ad689=await withSpinner(_0x4a97d0(0x18d)+_0x276845+'\x27...',()=>_0xfa932b[_0x4a97d0(0x200)][_0x4a97d0(0x143)](_0x276845),{'verbose':_0x5e6e75[_0x4a97d0(0x10d)]}),_0x2f33b0=_0x3ad689[_0x4a97d0(0x113)],_0x486bcd={'name':_0x29eb48,'description':_0x242205[_0x4a97d0(0x2ab)],'public':_0x242205[_0x4a97d0(0x262)]},_0x3a016f=await withSpinner(_0x4a97d0(0x19d)+_0x29eb48+_0x4a97d0(0x228),()=>_0xfa932b[_0x4a97d0(0x20d)]['create'](_0x2f33b0,_0x486bcd),{'verbose':_0x5e6e75[_0x4a97d0(0x10d)]}),_0x473f6e=_0x3a016f[_0x4a97d0(0x113)];return console['error'](_0x4a97d0(0x292)+_0x473f6e['name']+_0x4a97d0(0x2b3)+_0x473f6e['id']),await handleSDKOutput([_0x473f6e],_0x5e6e75),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x201);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x219);async[a31_0xe8811a(0x224)](_0x385e52){const _0x52727f=a31_0xe8811a,{options:_0x54dc5a,args:_0x10f8d3,tdx:_0x3f95f5}=_0x385e52,_0x5f4ae7=_0x10f8d3[0x0],_0x1533d2=_0x10f8d3[0x1]||_0x54dc5a[_0x52727f(0x13c)];if(!_0x5f4ae7)return console['error'](_0x52727f(0x106)),console[_0x52727f(0x104)](_0x52727f(0x303)),console[_0x52727f(0x104)](_0x52727f(0x1f4)),0x1;if(!_0x1533d2)return showParentSegmentNotSetError(_0x52727f(0x1fd)+_0x52727f(0x1f4)),0x1;const _0x50abd9=await withSpinner(_0x52727f(0x18d)+_0x1533d2+_0x52727f(0x228),()=>_0x3f95f5[_0x52727f(0x200)][_0x52727f(0x143)](_0x1533d2),{'verbose':_0x54dc5a[_0x52727f(0x10d)]}),_0xb9abd5=_0x50abd9[_0x52727f(0x113)],_0x51c209=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x5f4ae7+_0x52727f(0x228),()=>_0x3f95f5[_0x52727f(0x20d)][_0x52727f(0x2a2)](_0xb9abd5,_0x5f4ae7),{'verbose':_0x54dc5a[_0x52727f(0x10d)]}),_0x357a76=_0x51c209[_0x52727f(0x113)];if(_0x54dc5a[_0x52727f(0x254)]||_0x54dc5a['jsonl'])await handleSDKOutput([_0x357a76],_0x54dc5a);else{console['log'](a31_0x4d24f3[_0x52727f(0x166)](_0x357a76['name'])+'\x20'+a31_0x4d24f3[_0x52727f(0x2f8)](_0x52727f(0x22c)+_0x357a76['id']+')'));_0x357a76[_0x52727f(0x2ab)]&&console[_0x52727f(0x253)]('\x20\x20'+a31_0x4d24f3['dim'](_0x357a76['description']));console['log']('\x20\x20'+a31_0x4d24f3[_0x52727f(0x175)](_0x52727f(0x232))+'\x20'+(_0x357a76[_0x52727f(0x262)]?'yes':'no'));if(_0x357a76[_0x52727f(0x218)]&&_0x357a76['tokens'][_0x52727f(0x1a2)]>0x0)for(const _0x18f90a of _0x357a76[_0x52727f(0x218)]){const _0x4b2ee8=_0x18f90a[_0x52727f(0x1dc)]?.['length']?_0x18f90a[_0x52727f(0x1dc)]['join'](',\x20'):_0x52727f(0x203);console[_0x52727f(0x253)]('\x20\x20'+a31_0x4d24f3['cyan'](_0x52727f(0x321))+'\x20'+_0x18f90a[_0x52727f(0x260)]+'\x20'+a31_0x4d24f3[_0x52727f(0x2f8)](_0x52727f(0x22c)+_0x18f90a['id']+')')),console[_0x52727f(0x253)](_0x52727f(0x2d5)+a31_0x4d24f3['dim'](_0x52727f(0x1ea))+'\x20'+_0x4b2ee8);}else console[_0x52727f(0x253)]('\x20\x20'+a31_0x4d24f3[_0x52727f(0x2f8)](_0x52727f(0x120)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']=a31_0xe8811a(0x2d2);['description']='Delete\x20a\x20personalization\x20service';async['execute'](_0x21073e){const _0x143f3c=a31_0xe8811a,{options:_0x3f5b18,args:_0x127d34,tdx:_0x4092a0}=_0x21073e,_0x2d5859=_0x127d34[0x0],_0x330a6b=_0x127d34[0x1]||_0x3f5b18[_0x143f3c(0x13c)];if(!_0x2d5859)return console[_0x143f3c(0x104)](_0x143f3c(0x106)),console[_0x143f3c(0x104)](_0x143f3c(0x1bd)),console[_0x143f3c(0x104)](_0x143f3c(0x2ee)),0x1;if(!_0x330a6b)return showParentSegmentNotSetError(_0x143f3c(0x266)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x10f31f=await withSpinner(_0x143f3c(0x18d)+_0x330a6b+_0x143f3c(0x228),()=>_0x4092a0[_0x143f3c(0x200)][_0x143f3c(0x143)](_0x330a6b),{'verbose':_0x3f5b18[_0x143f3c(0x10d)]}),_0x399f17=_0x10f31f[_0x143f3c(0x113)];return await withSpinner(_0x143f3c(0x1cb)+_0x2d5859+_0x143f3c(0x228),()=>_0x4092a0[_0x143f3c(0x20d)][_0x143f3c(0x23b)](_0x399f17,_0x2d5859),{'verbose':_0x3f5b18[_0x143f3c(0x10d)]}),console['error'](_0x143f3c(0x31e)+_0x2d5859+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:update';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x152);async[a31_0xe8811a(0x224)](_0x21aefe){const _0x395829=a31_0xe8811a,{options:_0x334de9,args:_0x3747b7,tdx:_0x34724b}=_0x21aefe,_0x3f462e=_0x334de9,_0x1a4678=_0x3747b7[0x0],_0x23d8c3=_0x3747b7[0x1]||_0x334de9['parentSegment'];if(!_0x1a4678)return console[_0x395829(0x104)](_0x395829(0x106)),console[_0x395829(0x104)](_0x395829(0x293)),console[_0x395829(0x104)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x3f462e[_0x395829(0x260)])return console[_0x395829(0x104)]('Error:\x20--name\x20is\x20required'),console['error'](_0x395829(0x293)),0x1;if(!_0x23d8c3)return showParentSegmentNotSetError(_0x395829(0x250)+_0x395829(0xfe)),0x1;const _0x9058e4=await withSpinner(_0x395829(0x18d)+_0x23d8c3+_0x395829(0x228),()=>_0x34724b['segment'][_0x395829(0x143)](_0x23d8c3),{'verbose':_0x334de9[_0x395829(0x10d)]}),_0xf315a9=_0x9058e4[_0x395829(0x113)],_0x3879b6={'name':_0x3f462e[_0x395829(0x260)]};_0x3f462e['description']!==undefined&&(_0x3879b6[_0x395829(0x2ab)]=_0x3f462e[_0x395829(0x2ab)]);const _0x47f5e7=await withSpinner(_0x395829(0x1b5)+_0x1a4678+_0x395829(0x228),()=>_0x34724b['personalization'][_0x395829(0x164)](_0xf315a9,_0x1a4678,_0x3879b6),{'verbose':_0x334de9[_0x395829(0x10d)]}),_0x4f7056=_0x47f5e7[_0x395829(0x113)];return console[_0x395829(0x104)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x4f7056[_0x395829(0x260)]+'\x27'),await handleSDKOutput([_0x4f7056],_0x334de9),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:token:create';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x1ca);async[a31_0xe8811a(0x224)](_0x2f8de8){const _0x4a2a18=a31_0xe8811a,{options:_0x5794f9,args:_0x21ab0f,tdx:_0x280647}=_0x2f8de8,_0x478392=_0x5794f9,_0x202918=_0x21ab0f[0x0],_0x3339ce=_0x21ab0f[0x1],_0x57f975=_0x21ab0f[0x2]||_0x5794f9[_0x4a2a18(0x13c)];if(!_0x202918)return console[_0x4a2a18(0x104)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x4a2a18(0x104)](_0x4a2a18(0x2f9)),console['error'](_0x4a2a18(0x156)),0x1;if(!_0x3339ce)return console[_0x4a2a18(0x104)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x4a2a18(0x104)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x4a2a18(0x104)](_0x4a2a18(0x156)),0x1;if(!_0x57f975)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+_0x4a2a18(0x156)),0x1;const _0x31a243=await withSpinner(_0x4a2a18(0x18d)+_0x57f975+_0x4a2a18(0x228),()=>_0x280647[_0x4a2a18(0x200)]['resolveParentId'](_0x57f975),{'verbose':_0x5794f9[_0x4a2a18(0x10d)]}),_0x2661fa=_0x31a243[_0x4a2a18(0x113)],_0x44defe={'name':_0x202918};_0x478392[_0x4a2a18(0x1dc)]&&(_0x44defe[_0x4a2a18(0x1dc)]=_0x478392[_0x4a2a18(0x1dc)][_0x4a2a18(0x17d)](',')[_0x4a2a18(0x17e)](_0x4c37f7=>_0x4c37f7[_0x4a2a18(0x2d1)]()));_0x478392[_0x4a2a18(0x2ab)]&&(_0x44defe[_0x4a2a18(0x2ab)]=_0x478392[_0x4a2a18(0x2ab)]);const _0x258880=await withSpinner(_0x4a2a18(0x119)+_0x202918+_0x4a2a18(0x174)+_0x3339ce+_0x4a2a18(0x228),()=>_0x280647['personalization'][_0x4a2a18(0x116)](_0x2661fa,_0x3339ce,_0x44defe),{'verbose':_0x5794f9['verbose']}),_0x173836=_0x258880['data'];return console[_0x4a2a18(0x104)](_0x4a2a18(0x1e5)+_0x173836[_0x4a2a18(0x260)]+_0x4a2a18(0x2b3)+_0x173836['id']),_0x173836[_0x4a2a18(0x1c2)]&&(console[_0x4a2a18(0x104)](a31_0x4d24f3[_0x4a2a18(0x1a7)](_0x4a2a18(0x1ec))),console['error'](a31_0x4d24f3['cyan'](_0x173836[_0x4a2a18(0x1c2)])),console['error']('')),await handleSDKOutput([_0x173836],_0x5794f9),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:token:delete';['description']=a31_0xe8811a(0x238);async[a31_0xe8811a(0x224)](_0x51b012){const _0x59d610=a31_0xe8811a,{options:_0x46f7fc,args:_0x1923fd,tdx:_0x15f1c}=_0x51b012,_0x11d6c4=_0x1923fd[0x0],_0x7dd43e=_0x1923fd[0x1]||_0x46f7fc[_0x59d610(0x13c)];if(!_0x11d6c4)return console['error'](_0x59d610(0x103)),console[_0x59d610(0x104)](_0x59d610(0x139)),console[_0x59d610(0x104)](_0x59d610(0x315)),0x1;if(!_0x7dd43e)return showParentSegmentNotSetError(_0x59d610(0x2b9)+_0x59d610(0x315)),0x1;const _0x52a56f=await withSpinner(_0x59d610(0x18d)+_0x7dd43e+_0x59d610(0x228),()=>_0x15f1c[_0x59d610(0x200)][_0x59d610(0x143)](_0x7dd43e),{'verbose':_0x46f7fc['verbose']}),_0x3a9081=_0x52a56f[_0x59d610(0x113)],_0x4eaf10=await withSpinner(_0x59d610(0x107),()=>_0x15f1c['personalization'][_0x59d610(0x12f)](_0x3a9081),{'verbose':_0x46f7fc[_0x59d610(0x10d)]}),_0x1bbec6=_0x4eaf10[_0x59d610(0x113)];let _0x3a8b57;for(const _0x255733 of _0x1bbec6){if(_0x255733['tokens']?.[_0x59d610(0x17b)](_0x4e56cd=>_0x4e56cd['id']===_0x11d6c4)){_0x3a8b57=_0x255733['id'];break;}}if(!_0x3a8b57)return console[_0x59d610(0x104)](_0x59d610(0x2a6)+_0x11d6c4+_0x59d610(0x2fe)),0x1;const _0x4f8f61=await withSpinner(_0x59d610(0x273)+_0x11d6c4+_0x59d610(0x228),()=>_0x15f1c['personalization'][_0x59d610(0x185)](_0x3a9081,_0x3a8b57,_0x11d6c4),{'verbose':_0x46f7fc[_0x59d610(0x10d)]}),_0x42c3ed=_0x4f8f61['data'];return console[_0x59d610(0x104)](_0x59d610(0x24b)+(_0x42c3ed[_0x59d610(0x260)]||_0x11d6c4)+'\x27'),await handleSDKOutput([_0x42c3ed],_0x46f7fc),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:list';[a31_0xe8811a(0x2ab)]='List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment';async['execute'](_0x2e71c6){const _0x4ba230=a31_0xe8811a,{options:_0x2e6d4d,args:_0x49ccf0,tdx:_0x12231b}=_0x2e71c6,_0x46a100=_0x49ccf0[0x0]||_0x2e6d4d[_0x4ba230(0x13c)];if(!_0x46a100)return showParentSegmentNotSetError(_0x4ba230(0x130)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment'),0x1;const _0x40eb64=await withSpinner(_0x4ba230(0x18d)+_0x46a100+'\x27...',()=>_0x12231b[_0x4ba230(0x200)][_0x4ba230(0x143)](_0x46a100),{'verbose':_0x2e6d4d[_0x4ba230(0x10d)]}),_0x54e7c3=_0x40eb64[_0x4ba230(0x113)],_0x5900fd=await withSpinner(_0x4ba230(0x111)+_0x46a100+_0x4ba230(0x228),()=>_0x12231b[_0x4ba230(0x20d)][_0x4ba230(0x27d)](_0x54e7c3),{'verbose':_0x2e6d4d[_0x4ba230(0x10d)]}),_0x21aa7a=_0x5900fd[_0x4ba230(0x113)];console[_0x4ba230(0x104)]('✔\x20Found\x20'+_0x21aa7a[_0x4ba230(0x1a2)]+_0x4ba230(0x1f8)+(_0x21aa7a[_0x4ba230(0x1a2)]!==0x1?'s':''));if(_0x2e6d4d[_0x4ba230(0x14d)]===_0x4ba230(0x254)||_0x2e6d4d[_0x4ba230(0x14d)]==='jsonl')await handleSDKOutput(_0x21aa7a,_0x2e6d4d);else{if(_0x21aa7a['length']===0x0)console['log'](_0x4ba230(0x2c8));else for(const _0x4824de of _0x21aa7a){console['log'](a31_0x4d24f3[_0x4ba230(0x166)](_0x4824de[_0x4ba230(0x260)])+'\x20'+a31_0x4d24f3[_0x4ba230(0x2f8)]('(id:\x20'+_0x4824de['id']+')'));_0x4824de[_0x4ba230(0x2ab)]&&console['log']('\x20\x20'+a31_0x4d24f3['dim'](_0x4824de[_0x4ba230(0x2ab)]));const _0x27cbbe=_0x4824de[_0x4ba230(0x209)]?.['length']||0x0;console[_0x4ba230(0x253)]('\x20\x20'+a31_0x4d24f3[_0x4ba230(0x175)](_0x4ba230(0x306))+'\x20'+_0x27cbbe);if(_0x4824de['sections']&&_0x4824de['sections']['length']>0x0)for(const _0xa9abf7 of _0x4824de['sections']){console['log'](_0x4ba230(0x2aa)+_0xa9abf7[_0x4ba230(0x260)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1ef);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x221);async['execute'](_0x35068c){const _0x504eb0=a31_0xe8811a,{options:_0x21c3c6,args:_0x6bf0ad,tdx:_0x22d54c}=_0x35068c,_0x767a9f=_0x6bf0ad[0x0];if(!_0x767a9f)return console[_0x504eb0(0x104)](_0x504eb0(0x198)),console['error'](_0x504eb0(0x1f5)),0x1;const _0x1a6e8b=await withSpinner(_0x504eb0(0x179)+_0x767a9f+'\x27...',()=>_0x22d54c[_0x504eb0(0x20d)][_0x504eb0(0x20f)](_0x767a9f),{'verbose':_0x21c3c6[_0x504eb0(0x10d)]}),_0x305198=_0x1a6e8b[_0x504eb0(0x113)];console[_0x504eb0(0x104)](_0x504eb0(0x199)+_0x305198[_0x504eb0(0x260)]+'\x27');if(_0x21c3c6[_0x504eb0(0x14d)]===_0x504eb0(0x254)||_0x21c3c6['format']==='jsonl')await handleSDKOutput([_0x305198],_0x21c3c6);else{console[_0x504eb0(0x253)](a31_0x4d24f3[_0x504eb0(0x166)](_0x305198[_0x504eb0(0x260)])+'\x20'+a31_0x4d24f3[_0x504eb0(0x2f8)]('(id:\x20'+_0x305198['id']+')'));_0x305198[_0x504eb0(0x2ab)]&&console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x2f8)](_0x305198[_0x504eb0(0x2ab)]));_0x305198[_0x504eb0(0x190)]&&console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x281))+'\x20'+_0x305198[_0x504eb0(0x190)]);console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x19f))+'\x20'+_0x305198['createdAt']),console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x1e1))+'\x20'+_0x305198['updatedAt']);const _0x2cb86a=_0x305198['sections']?.[_0x504eb0(0x1a2)]||0x0;console['log']('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x306))+'\x20'+_0x2cb86a);if(_0x305198[_0x504eb0(0x209)]&&_0x305198['sections'][_0x504eb0(0x1a2)]>0x0)for(const _0xfd070e of _0x305198[_0x504eb0(0x209)]){console[_0x504eb0(0x253)]('\x20\x20\x20\x20'+a31_0x4d24f3['bold'](_0xfd070e[_0x504eb0(0x260)])+'\x20'+a31_0x4d24f3[_0x504eb0(0x2f8)](_0x504eb0(0x22c)+_0xfd070e['id']+')')),_0xfd070e[_0x504eb0(0x20e)]&&(console[_0x504eb0(0x253)]('\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x1b3))+'\x20'+_0xfd070e[_0x504eb0(0x20e)][_0x504eb0(0x260)]),_0xfd070e[_0x504eb0(0x20e)][_0x504eb0(0x14b)]?.[_0x504eb0(0x316)]&&console[_0x504eb0(0x253)]('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x1ac))+'\x20'+_0xfd070e[_0x504eb0(0x20e)]['keyEventCriteria']['keyEventId'])),_0xfd070e['payload']&&console[_0x504eb0(0x253)](_0x504eb0(0x309)+a31_0x4d24f3['cyan'](_0x504eb0(0x212))+'\x20'+JSON[_0x504eb0(0x176)](_0xfd070e[_0x504eb0(0x1c7)])),_0xfd070e[_0x504eb0(0x1eb)]&&console[_0x504eb0(0x253)]('\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3['cyan'](_0x504eb0(0x2b7))+'\x20true');}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1aa);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x2bc);async['execute'](_0x351c52){const _0x2706f0=a31_0xe8811a,{options:_0x11e966,args:_0x43e53d,tdx:_0x19ad4d}=_0x351c52,_0x1f5ba6=_0x43e53d[0x0];if(!_0x1f5ba6)return console[_0x2706f0(0x104)](_0x2706f0(0x198)),console['error'](_0x2706f0(0x26e)),0x1;return await withSpinner(_0x2706f0(0x259)+_0x1f5ba6+_0x2706f0(0x228),()=>_0x19ad4d['personalization'][_0x2706f0(0x2cb)](_0x1f5ba6),{'verbose':_0x11e966[_0x2706f0(0x10d)]}),console[_0x2706f0(0x104)](_0x2706f0(0x135)+_0x1f5ba6+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']=a31_0xe8811a(0x1d8);[a31_0xe8811a(0x2ab)]='Create\x20a\x20realtime\x20personalization\x20entity';async[a31_0xe8811a(0x224)](_0x3b8fcd){const _0x12399c=a31_0xe8811a,{options:_0x3d0091,tdx:_0x5a4283}=_0x3b8fcd,_0x3e8616=_0x3d0091;let _0x28e9f0;if(_0x3e8616[_0x12399c(0x10b)]){_0x28e9f0=await loadJSON(_0x3e8616[_0x12399c(0x10b)],!![]);if(!_0x28e9f0[_0x12399c(0x1fc)]?.['parentFolder'])return console['error']('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x12399c(0x104)](_0x12399c(0x271)),console[_0x12399c(0x104)](_0x12399c(0x220)),0x1;}else{if(!_0x3e8616[_0x12399c(0x260)])return console['error'](_0x12399c(0x165)),console['error'](_0x12399c(0x277)),console[_0x12399c(0x104)](_0x12399c(0x25e)),0x1;if(_0x3e8616[_0x12399c(0x2ab)]===undefined)return console[_0x12399c(0x104)](_0x12399c(0x207)),console[_0x12399c(0x104)](_0x12399c(0x277)),console[_0x12399c(0x104)](_0x12399c(0x25e)),0x1;if(_0x3e8616[_0x12399c(0x184)]===undefined)return console[_0x12399c(0x104)](_0x12399c(0x155)),console[_0x12399c(0x104)](_0x12399c(0x2eb)),0x1;let _0x1f62c6=_0x3e8616[_0x12399c(0x190)];if(!_0x1f62c6&&_0x3d0091[_0x12399c(0x13c)]){const _0x57e038=await withSpinner(_0x12399c(0x18d)+_0x3d0091['parentSegment']+_0x12399c(0x228),()=>_0x5a4283[_0x12399c(0x200)][_0x12399c(0x143)](_0x3d0091['parentSegment']),{'verbose':_0x3d0091['verbose']});_0x1f62c6=_0x57e038[_0x12399c(0x113)];}let _0x36fb59;_0x3e8616['sections']&&(_0x36fb59=await loadJSON(_0x3e8616[_0x12399c(0x209)],![]));const _0x3bea13=_0x3e8616[_0x12399c(0x184)]===_0x12399c(0x31c)?null:{'id':_0x3e8616[_0x12399c(0x184)],'type':_0x12399c(0x2ff)};_0x28e9f0={'attributes':{'name':_0x3e8616[_0x12399c(0x260)],'description':_0x3e8616[_0x12399c(0x2ab)]||null,..._0x1f62c6!==undefined&&{'audienceId':_0x1f62c6},..._0x36fb59!==undefined&&{'sections':_0x36fb59}},'relationships':{'parentFolder':{'data':_0x3bea13}}};}const _0xc355fb=await withSpinner(_0x12399c(0x189)+(_0x28e9f0[_0x12399c(0x289)]?.[_0x12399c(0x260)]??'')+_0x12399c(0x228),()=>_0x5a4283['personalization'][_0x12399c(0x1d3)](_0x28e9f0),{'verbose':_0x3d0091['verbose']}),_0x397b67=_0xc355fb[_0x12399c(0x113)];return console[_0x12399c(0x104)](_0x12399c(0x252)+_0x397b67[_0x12399c(0x260)]+_0x12399c(0x2b3)+_0x397b67['id']),await handleSDKOutput([_0x397b67],_0x3d0091),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x304);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x300);async[a31_0xe8811a(0x224)](_0xfc5914){const _0x4d8215=a31_0xe8811a,{options:_0x50109b,args:_0x26737e}=_0xfc5914,_0x3e9fcc=_0x50109b,_0x5a6f57=_0x26737e[0x0];if(!_0x5a6f57)return console[_0x4d8215(0x104)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x4d8215(0x104)](_0x4d8215(0x146)),console[_0x4d8215(0x104)](_0x4d8215(0x313)),0x1;let _0x40021c;if(_0x3e9fcc[_0x4d8215(0x10b)])_0x40021c=await loadJSON(_0x3e9fcc['file'],!![]);else{if(!_0x3e9fcc[_0x4d8215(0x260)])return console[_0x4d8215(0x104)](_0x4d8215(0x165)),console['error'](_0x4d8215(0x146)),0x1;if(_0x3e9fcc[_0x4d8215(0x2ab)]===undefined)return console[_0x4d8215(0x104)](_0x4d8215(0x207)),console[_0x4d8215(0x104)](_0x4d8215(0x146)),0x1;let _0x5be9f3;_0x3e9fcc['sections']&&(_0x5be9f3=await loadJSON(_0x3e9fcc[_0x4d8215(0x209)],![])),_0x40021c={'attributes':{'name':_0x3e9fcc[_0x4d8215(0x260)],'description':_0x3e9fcc[_0x4d8215(0x2ab)]||null,..._0x5be9f3!==undefined&&{'sections':_0x5be9f3}}};}const {tdx:_0x49d668}=_0xfc5914,_0x325fdb=await withSpinner(_0x4d8215(0x2b5)+_0x5a6f57+_0x4d8215(0x228),()=>_0x49d668[_0x4d8215(0x20d)][_0x4d8215(0x1da)](_0x5a6f57,_0x40021c),{'verbose':_0x50109b[_0x4d8215(0x10d)]}),_0x287adf=_0x325fdb['data'];return console[_0x4d8215(0x104)](_0x4d8215(0x210)+_0x287adf['name']+_0x4d8215(0x22f)+_0x287adf['id']+')'),await handleSDKOutput([_0x287adf],_0x50109b),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x2ed);['description']='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a31_0xe8811a(0x224)](_0x18b559){const _0x44d3d5=a31_0xe8811a,{options:_0x1daa1f,args:_0x63c903}=_0x18b559,_0x2b5aa2=_0x63c903[0x0]||_0x1daa1f[_0x44d3d5(0x13c)];if(!_0x2b5aa2)return showParentSegmentNotSetError(_0x44d3d5(0x265)+_0x44d3d5(0x24c)),0x1;const _0x3fc678=resolveYamlFile(_0x2b5aa2);if(!existsSync(_0x3fc678))return showFileNotFoundError(_0x3fc678,_0x2b5aa2),0x1;let _0x3d4262;try{_0x3d4262=readFileSync(_0x3fc678,_0x44d3d5(0x29f));}catch(_0xbcd1f5){const _0x37581d=_0xbcd1f5 instanceof Error?_0xbcd1f5[_0x44d3d5(0x205)]:String(_0xbcd1f5);return console[_0x44d3d5(0x104)](_0x44d3d5(0x2fc)+_0x37581d),0x1;}let _0x5da684;try{_0x5da684=parseDef(_0x3d4262);}catch(_0x29d0fd){const _0x27d583=_0x29d0fd instanceof Error?_0x29d0fd['message']:String(_0x29d0fd);return console['error'](a31_0x4d24f3[_0x44d3d5(0x2f4)](_0x44d3d5(0x1d4)+_0x27d583)),0x1;}if(_0x5da684[_0x44d3d5(0x16d)]&&_0x5da684['personalization_services'][_0x44d3d5(0x1a2)]>0x0)return console[_0x44d3d5(0x104)](a31_0x4d24f3[_0x44d3d5(0x1a7)](_0x44d3d5(0x158)+_0x3fc678)),console[_0x44d3d5(0x104)](a31_0x4d24f3[_0x44d3d5(0x2f8)](_0x44d3d5(0x2ae)+_0x5da684[_0x44d3d5(0x16d)][_0x44d3d5(0x1a2)]+_0x44d3d5(0x1c1))),0x1;!_0x5da684[_0x44d3d5(0x10e)]&&(_0x5da684[_0x44d3d5(0x10e)]={'events':[{'name':_0x44d3d5(0x109),'source_table':_0x44d3d5(0x1ab)}],'attributes':[{'name':_0x44d3d5(0x1bc),'type':_0x44d3d5(0x14c)}],'id_stitching':{'primary_key':_0x5da684[_0x44d3d5(0x2cf)][_0x44d3d5(0x101)]===_0x44d3d5(0x163)?_0x44d3d5(0x1d1):'user_id'}});_0x5da684[_0x44d3d5(0x16d)]=[{'name':'My\x20Service','description':_0x44d3d5(0x2c3),'trigger_event':_0x44d3d5(0x109),'sections':[{'name':_0x44d3d5(0x1c6),'criteria':_0x44d3d5(0x159),'attributes':[_0x44d3d5(0x1bc)]}]}];const _0x16b3cf=serializeDef(_0x5da684);return writeFileSync(_0x3fc678,_0x16b3cf,'utf-8'),console[_0x44d3d5(0x104)](a31_0x4d24f3[_0x44d3d5(0x2af)]('✔')+_0x44d3d5(0x150)+a31_0x4d24f3[_0x44d3d5(0x175)](_0x3fc678)),(!_0x5da684[_0x44d3d5(0x10e)]||_0x3d4262[_0x44d3d5(0x2a7)](_0x44d3d5(0x1ae))===-0x1)&&console['error'](a31_0x4d24f3['green']('✔')+_0x44d3d5(0x15c)),console[_0x44d3d5(0x104)]('\x0a'+a31_0x4d24f3['dim']('Next\x20steps:')),console['error'](_0x44d3d5(0x14e)+_0x3fc678+_0x44d3d5(0x320)),console[_0x44d3d5(0x104)](_0x44d3d5(0x23e)+a31_0x4d24f3[_0x44d3d5(0x2f8)](_0x44d3d5(0x129)+_0x2b5aa2)+_0x44d3d5(0x21b)),0x0;}}