@treasuredata/tdx 2026.6.2 → 2026.6.4

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 (235) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-command.js.map +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-pull-command.js +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segment-validate-command.js +1 -1
  50. package/dist/commands/segments.js +1 -1
  51. package/dist/commands/show.js +1 -1
  52. package/dist/commands/status-command.js +1 -1
  53. package/dist/commands/table-deleted.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/work-command.js +1 -1
  60. package/dist/commands/workflow-command.js +1 -1
  61. package/dist/core/auth.js +1 -1
  62. package/dist/core/command-output.js +1 -1
  63. package/dist/core/config.d.ts +14 -0
  64. package/dist/core/config.d.ts.map +1 -1
  65. package/dist/core/config.js +1 -1
  66. package/dist/core/config.js.map +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.d.ts +1 -0
  76. package/dist/core/project-config.d.ts.map +1 -1
  77. package/dist/core/project-config.js +1 -1
  78. package/dist/core/project-config.js.map +1 -1
  79. package/dist/core/session.js +1 -1
  80. package/dist/core/user-cache.js +1 -1
  81. package/dist/core/version.js +1 -1
  82. package/dist/index.js +1 -1
  83. package/dist/mcp/server.js +1 -1
  84. package/dist/mcp/tools/index.js +1 -1
  85. package/dist/mcp/tools/tdx-run.js +1 -1
  86. package/dist/mcp/tools/tdx-search.d.ts.map +1 -1
  87. package/dist/mcp/tools/tdx-search.js +1 -1
  88. package/dist/mcp/tools/tdx-search.js.map +1 -1
  89. package/dist/mcp/tools/work-create-item.js +1 -1
  90. package/dist/mcp/utils.js +1 -1
  91. package/dist/proxy/claude-usage-tracker.js +1 -1
  92. package/dist/proxy/passthrough-server.js +1 -1
  93. package/dist/proxy/sse-usage-parser.js +1 -1
  94. package/dist/sdk/agent/agent-config.js +1 -1
  95. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/test/evaluator.js +1 -1
  98. package/dist/sdk/agent/test/executor.js +1 -1
  99. package/dist/sdk/agent/test/index.js +1 -1
  100. package/dist/sdk/agent/test/output.js +1 -1
  101. package/dist/sdk/agent/test/parser.js +1 -1
  102. package/dist/sdk/agent/tool-target-registry.js +1 -1
  103. package/dist/sdk/api.js +1 -1
  104. package/dist/sdk/cas/cas-api-client.js +1 -1
  105. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  106. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  107. package/dist/sdk/cas/index.js +1 -1
  108. package/dist/sdk/cas/pull-workflow.js +1 -1
  109. package/dist/sdk/cas/push-workflow.js +1 -1
  110. package/dist/sdk/client/cdp-api-client.js +1 -1
  111. package/dist/sdk/client/delivery-api-client.js +1 -1
  112. package/dist/sdk/client/endpoints.js +1 -1
  113. package/dist/sdk/client/engage-api-client.js +1 -1
  114. package/dist/sdk/client/http-client.js +1 -1
  115. package/dist/sdk/client/llm-api-client.js +1 -1
  116. package/dist/sdk/client/oauth-refresh.js +1 -1
  117. package/dist/sdk/client/rate-limiter.js +1 -1
  118. package/dist/sdk/client/td-api-client.js +1 -1
  119. package/dist/sdk/client/trino-api-client.js +1 -1
  120. package/dist/sdk/client/workflow-client.js +1 -1
  121. package/dist/sdk/connection-validator.js +1 -1
  122. package/dist/sdk/connection.js +1 -1
  123. package/dist/sdk/delivery.js +1 -1
  124. package/dist/sdk/engage/campaign-pull.js +1 -1
  125. package/dist/sdk/engage/campaign-push.js +1 -1
  126. package/dist/sdk/engage/campaign-validator.js +1 -1
  127. package/dist/sdk/engage/campaign-yaml.js +1 -1
  128. package/dist/sdk/engage/template-pull.js +1 -1
  129. package/dist/sdk/engage/template-push.js +1 -1
  130. package/dist/sdk/engage/template-validator.js +1 -1
  131. package/dist/sdk/engage/template-yaml.js +1 -1
  132. package/dist/sdk/engage/types/campaign-def.js +1 -1
  133. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  134. package/dist/sdk/engage/types/template-schema.js +1 -1
  135. package/dist/sdk/engage.js +1 -1
  136. package/dist/sdk/errors.js +1 -1
  137. package/dist/sdk/index.js +1 -1
  138. package/dist/sdk/io/index.js +1 -1
  139. package/dist/sdk/io/node-filesystem.js +1 -1
  140. package/dist/sdk/job.js +1 -1
  141. package/dist/sdk/journey.js +1 -1
  142. package/dist/sdk/llm/chat-cache.js +1 -1
  143. package/dist/sdk/llm/index.js +1 -1
  144. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  145. package/dist/sdk/llm/model-factors.js +1 -1
  146. package/dist/sdk/llm/user-settings.js +1 -1
  147. package/dist/sdk/personalization.js +1 -1
  148. package/dist/sdk/policy.js +1 -1
  149. package/dist/sdk/query/deleted-table-validation.js +1 -1
  150. package/dist/sdk/query/index.js +1 -1
  151. package/dist/sdk/query/sql-parser.js +1 -1
  152. package/dist/sdk/realtime.js +1 -1
  153. package/dist/sdk/schedule.js +1 -1
  154. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  155. package/dist/sdk/segment/fields-display.js +1 -1
  156. package/dist/sdk/segment/file-discovery.js +1 -1
  157. package/dist/sdk/segment/journey-utils.js +1 -1
  158. package/dist/sdk/segment/journey-validator.js +1 -1
  159. package/dist/sdk/segment/journey-yaml.js +1 -1
  160. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  161. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  162. package/dist/sdk/segment/pull-workflow.js +1 -1
  163. package/dist/sdk/segment/push-recovery.js +1 -1
  164. package/dist/sdk/segment/push-workflow.js +1 -1
  165. package/dist/sdk/segment/resolution-context.js +1 -1
  166. package/dist/sdk/segment/segment-path-parser.js +1 -1
  167. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  168. package/dist/sdk/segment/segment-validator.js +1 -1
  169. package/dist/sdk/segment/target-resolution.js +1 -1
  170. package/dist/sdk/segment/tdx-config.js +1 -1
  171. package/dist/sdk/segment/types/activation-schema.js +1 -1
  172. package/dist/sdk/segment/types/journey-def.js +1 -1
  173. package/dist/sdk/segment/types/journey-schema.js +1 -1
  174. package/dist/sdk/segment/types/segment-def.js +1 -1
  175. package/dist/sdk/segment/types/segment-schema.js +1 -1
  176. package/dist/sdk/segment/validate-files.js +1 -1
  177. package/dist/sdk/segment/yaml-validator.js +1 -1
  178. package/dist/sdk/segment.js +1 -1
  179. package/dist/sdk/types/index.js +1 -1
  180. package/dist/sdk/types/progress.js +1 -1
  181. package/dist/sdk/types/workspace.js +1 -1
  182. package/dist/sdk/user.js +1 -1
  183. package/dist/sdk/util/format-detector.js +1 -1
  184. package/dist/sdk/util/formatters.js +1 -1
  185. package/dist/sdk/util/index.js +1 -1
  186. package/dist/sdk/util/paginate.js +1 -1
  187. package/dist/sdk/util/tree-formatter.js +1 -1
  188. package/dist/sdk/workflow/archive-validation.js +1 -1
  189. package/dist/sdk/workflow/clone-workflow.js +1 -1
  190. package/dist/sdk/workflow/index.js +1 -1
  191. package/dist/sdk/workflow/pull-workflow.js +1 -1
  192. package/dist/sdk/workflow/push-workflow.js +1 -1
  193. package/dist/sdk/workflow/task-graph.js +1 -1
  194. package/dist/sdk/workflow/tdx-config.js +1 -1
  195. package/dist/sdk/workflow/workflow-utils.js +1 -1
  196. package/dist/sdk/workspace/access-tracker.js +1 -1
  197. package/dist/sdk/workspace/frontmatter.js +1 -1
  198. package/dist/sdk/workspace/git.js +1 -1
  199. package/dist/sdk/workspace/index.js +1 -1
  200. package/dist/sdk/workspace/templates.js +1 -1
  201. package/dist/sdk/workspace/weekly.js +1 -1
  202. package/dist/sdk/workspace/wikilinks.js +1 -1
  203. package/dist/test-utils/command-runner.js +1 -1
  204. package/dist/test-utils/factories.js +1 -1
  205. package/dist/test-utils/fixtures.js +1 -1
  206. package/dist/test-utils/http-mock.js +1 -1
  207. package/dist/test-utils/index.js +1 -1
  208. package/dist/utils/async.js +1 -1
  209. package/dist/utils/colors.js +1 -1
  210. package/dist/utils/diff.js +1 -1
  211. package/dist/utils/file-permissions.js +1 -1
  212. package/dist/utils/file-reader.js +1 -1
  213. package/dist/utils/github-releases.js +1 -1
  214. package/dist/utils/global-cache.js +1 -1
  215. package/dist/utils/json-loader.js +1 -1
  216. package/dist/utils/local-cache.js +1 -1
  217. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  218. package/dist/utils/logger/formatters/index.js +1 -1
  219. package/dist/utils/logger/handlers/console-handler.js +1 -1
  220. package/dist/utils/logger/handlers/file-handler.js +1 -1
  221. package/dist/utils/logger/handlers/index.js +1 -1
  222. package/dist/utils/logger/handlers/null-handler.js +1 -1
  223. package/dist/utils/logger/index.js +1 -1
  224. package/dist/utils/logger/logger.js +1 -1
  225. package/dist/utils/logger/types.js +1 -1
  226. package/dist/utils/option-validation.js +1 -1
  227. package/dist/utils/process.js +1 -1
  228. package/dist/utils/prompt.js +1 -1
  229. package/dist/utils/spinner.js +1 -1
  230. package/dist/utils/sse-parser.js +1 -1
  231. package/dist/utils/string-utils.js +1 -1
  232. package/dist/utils/table-ref-parser.js +1 -1
  233. package/dist/utils/tdx-logger.js +1 -1
  234. package/dist/utils/version-check.js +1 -1
  235. package/package.json +1 -1
@@ -1 +1 @@
1
- const a31_0x4797a6=a31_0x21b4;(function(_0x2c7f23,_0x317d73){const _0x31e2de=a31_0x21b4,_0x48ecd9=_0x2c7f23();while(!![]){try{const _0x463b07=-parseInt(_0x31e2de(0x15b))/0x1*(parseInt(_0x31e2de(0x319))/0x2)+-parseInt(_0x31e2de(0x255))/0x3+parseInt(_0x31e2de(0x149))/0x4*(parseInt(_0x31e2de(0x113))/0x5)+parseInt(_0x31e2de(0x2a0))/0x6+-parseInt(_0x31e2de(0x259))/0x7+-parseInt(_0x31e2de(0x2b3))/0x8+parseInt(_0x31e2de(0x18a))/0x9*(parseInt(_0x31e2de(0x2c9))/0xa);if(_0x463b07===_0x317d73)break;else _0x48ecd9['push'](_0x48ecd9['shift']());}catch(_0x7b3f1b){_0x48ecd9['push'](_0x48ecd9['shift']());}}}(a31_0xbd54,0x8c00f));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x1da727 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_0x12b51f 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_0x4797a6(0x2c2);function openBrowser(_0x45bf7e){const _0x2f6f04=a31_0x4797a6,_0x5b954f=process['platform'],_0x5db65f=_0x5b954f==='darwin'?'open':_0x5b954f===_0x2f6f04(0x2c7)?'start':_0x2f6f04(0x146);spawn(_0x5db65f,[_0x45bf7e],{'detached':!![],'stdio':_0x2f6f04(0x1bd)})['unref']();}function migrateLegacyDirectory(){const _0x3392e1=a31_0x4797a6;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x1c3f44=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x1c3f44['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x3392e1(0x306)](a31_0x12b51f[_0x3392e1(0x215)](_0x3392e1(0x103)+LEGACY_PARENT_SEGMENT_DIR+_0x3392e1(0x227)+PARENT_SEGMENT_DIR+_0x3392e1(0x1ae))),console[_0x3392e1(0x306)](a31_0x12b51f[_0x3392e1(0x2dc)](_0x3392e1(0x178)+LEGACY_PARENT_SEGMENT_DIR+_0x3392e1(0x16d))),![];console[_0x3392e1(0x306)](a31_0x12b51f[_0x3392e1(0x215)](_0x3392e1(0x265)+LEGACY_PARENT_SEGMENT_DIR+_0x3392e1(0x270)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x3392e1(0x306)](a31_0x12b51f['green']('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4fb8e2){const _0x1a81c8=_0x4fb8e2 instanceof Error?_0x4fb8e2['message']:String(_0x4fb8e2);return console[_0x3392e1(0x306)](a31_0x12b51f['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x1a81c8+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x4797a6(0x197)](_0x2ae570){const _0x1ac420=a31_0x4797a6;return migrateLegacyDirectory(),super[_0x1ac420(0x197)](_0x2ae570);}}function resolveYamlFile(_0x1624bc){const _0x49630b=a31_0x4797a6;if(_0x1624bc['endsWith'](_0x49630b(0x1fd))||_0x1624bc[_0x49630b(0x250)](_0x49630b(0x156)))return _0x1624bc;return a31_0x1da727['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1624bc)+_0x49630b(0x1fd));}function formatProgressMessage(_0x1964bc){const _0x509b76=a31_0x4797a6,_0x19d07e=_0x1964bc[_0x509b76(0x2cf)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x19d07e){const [,_0x1db6a7,_0x2c5f8d,_0x156384='']=_0x19d07e;return a31_0x12b51f[_0x509b76(0x2dc)](_0x1db6a7+':')+'\x20'+_0x2c5f8d+a31_0x12b51f['dim'](_0x156384);}return a31_0x12b51f[_0x509b76(0x2dc)](_0x1964bc);}function showFileNotFoundError(_0x4c595e,_0x501a5c){const _0x3cbb14=a31_0x4797a6;console['error'](a31_0x12b51f['red'](_0x3cbb14(0x21d)+_0x4c595e+'\x0a')),console[_0x3cbb14(0x306)](a31_0x12b51f[_0x3cbb14(0x137)](_0x3cbb14(0x157)+_0x501a5c+_0x3cbb14(0x2c3)));}function displayRealtimeValidation(_0x4b0a13){const _0x147a4a=a31_0x4797a6;if(!_0x4b0a13[_0x147a4a(0x20f)])return;const _0x5547b2=_0x4b0a13[_0x147a4a(0x20f)],_0x4ceb86=_0x5547b2[_0x147a4a(0x309)]?a31_0x12b51f[_0x147a4a(0x2db)]('⚡\x20Enabled'):a31_0x12b51f[_0x147a4a(0x215)]('⚡\x20Not\x20enabled');console[_0x147a4a(0x306)]('\x0a'+a31_0x12b51f[_0x147a4a(0x2dc)]('RT\x202.0:')+'\x20'+_0x4ceb86);if(_0x5547b2[_0x147a4a(0x2b8)]&&_0x5547b2['events'][_0x147a4a(0x16c)]>0x0){console[_0x147a4a(0x306)]('\x20\x20'+a31_0x12b51f[_0x147a4a(0x2dc)](_0x147a4a(0x237))+'\x20'+_0x5547b2[_0x147a4a(0x2b8)][_0x147a4a(0x16c)]+'\x20configured');for(const _0x1f20ab of _0x5547b2[_0x147a4a(0x2b8)]){const _0x2ce73f=_0x1f20ab[_0x147a4a(0x2ed)]===![]?a31_0x12b51f[_0x147a4a(0x315)]('✘'):a31_0x12b51f[_0x147a4a(0x2db)]('✔');console[_0x147a4a(0x306)](_0x147a4a(0x10b)+_0x2ce73f+'\x20'+_0x1f20ab[_0x147a4a(0x15c)]),_0x1f20ab[_0x147a4a(0x230)]&&console[_0x147a4a(0x306)](_0x147a4a(0x1a5)+a31_0x12b51f[_0x147a4a(0x315)](_0x1f20ab['sourceTableError']));}}if(_0x5547b2[_0x147a4a(0x2b7)]&&_0x5547b2[_0x147a4a(0x2b7)][_0x147a4a(0x16c)]>0x0){console['error']('\x20\x20'+a31_0x12b51f[_0x147a4a(0x2dc)]('Attributes:')+'\x20'+_0x5547b2[_0x147a4a(0x2b7)][_0x147a4a(0x16c)]+'\x20configured');for(const _0x310f75 of _0x5547b2[_0x147a4a(0x2b7)]){const _0x4ac703=_0x310f75[_0x147a4a(0x226)]?a31_0x12b51f[_0x147a4a(0x2db)]('✔'):a31_0x12b51f[_0x147a4a(0x315)]('✘');console[_0x147a4a(0x306)](_0x147a4a(0x10b)+_0x4ac703+'\x20'+_0x310f75['name']+'\x20'+a31_0x12b51f[_0x147a4a(0x2dc)]('('+_0x310f75[_0x147a4a(0x279)]+')'));}}if(_0x5547b2['idStitching']){const _0x5e056b=_0x5547b2[_0x147a4a(0x21b)][_0x147a4a(0x2f7)]?.[_0x147a4a(0x16c)]?'\x20+\x20['+_0x5547b2[_0x147a4a(0x21b)][_0x147a4a(0x2f7)][_0x147a4a(0x13f)](',\x20')+']':'';console[_0x147a4a(0x306)]('\x20\x20'+a31_0x12b51f[_0x147a4a(0x2dc)](_0x147a4a(0x28a))+'\x20'+_0x5547b2[_0x147a4a(0x21b)]['primaryKey']+_0x5e056b);}if(_0x5547b2[_0x147a4a(0x2b6)]&&_0x5547b2[_0x147a4a(0x2b6)][_0x147a4a(0x16c)]>0x0){console['error']('\x20\x20'+a31_0x12b51f[_0x147a4a(0x2dc)](_0x147a4a(0x121))+'\x20'+_0x5547b2[_0x147a4a(0x2b6)][_0x147a4a(0x16c)]+_0x147a4a(0x228)+(_0x5547b2[_0x147a4a(0x2b6)][_0x147a4a(0x16c)]!==0x1?'s':''));for(const _0x126994 of _0x5547b2['personalizationServices']){console[_0x147a4a(0x306)](_0x147a4a(0x24a)+_0x126994[_0x147a4a(0x15c)]);}}}function showParentSegmentNotSetError(_0x54b28a){const _0x22ae83=a31_0x4797a6;console[_0x22ae83(0x306)](a31_0x12b51f['yellow'](_0x22ae83(0x23e))),console[_0x22ae83(0x306)](_0x54b28a);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x299);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x1ad);async[a31_0x4797a6(0x152)](_0x20a683){const _0x27eccf=a31_0x4797a6,{options:_0xc023f4,args:_0x4df42f,tdx:_0x48cba8}=_0x20a683,_0x40ca71=_0x4df42f[0x0];_0xc023f4[_0x27eccf(0x282)]&&(console[_0x27eccf(0x306)](_0x27eccf(0x31b)+_0xc023f4[_0x27eccf(0x1c2)]),_0x40ca71&&console[_0x27eccf(0x306)]('Pattern:\x20'+_0x40ca71));const _0x1ffa43=await withSpinner(_0x40ca71?_0x27eccf(0x118)+_0x40ca71+_0x27eccf(0x131):'Listing\x20parent\x20segments...',()=>_0x48cba8[_0x27eccf(0x14c)][_0x27eccf(0x1c5)](),{'verbose':_0xc023f4[_0x27eccf(0x282)]});let _0x57bb90=_0x1ffa43[_0x27eccf(0x2a4)];if(_0x40ca71){const _0xb7ae1e=_0x40ca71[_0x27eccf(0x19b)](/[.+^${}()|[\]\\]/g,_0x27eccf(0x198))[_0x27eccf(0x19b)](/\*/g,'.*')[_0x27eccf(0x19b)](/\?/g,'.'),_0x582c71=new RegExp('^'+_0xb7ae1e+'$','i');_0x57bb90=_0x57bb90[_0x27eccf(0x19c)](_0x376d16=>_0x582c71[_0x27eccf(0x208)](_0x376d16[_0x27eccf(0x2b7)][_0x27eccf(0x15c)]));}_0x57bb90[_0x27eccf(0x2e8)]((_0x79cd48,_0x1e8d6e)=>_0x79cd48[_0x27eccf(0x2b7)]['name'][_0x27eccf(0x1cf)](_0x1e8d6e[_0x27eccf(0x2b7)][_0x27eccf(0x15c)])),console[_0x27eccf(0x306)](_0x27eccf(0x150)+_0x57bb90['length']+_0x27eccf(0x26c)+(_0x57bb90['length']!==0x1?'s':''));const _0x1f1c93=_0x5b1ec5=>{const _0x1f0ef1=_0x27eccf;return getConsoleNextUrl(_0xc023f4[_0x1f0ef1(0x1c2)],'/app/dw/parentSegments/'+_0x5b1ec5);};if(_0xc023f4[_0x27eccf(0x1b6)]===_0x27eccf(0x1bf)||_0xc023f4[_0x27eccf(0x1b6)]===_0x27eccf(0x1bc)){const _0x48a6ea=_0x57bb90[_0x27eccf(0x1d5)](_0x35fb45=>({..._0x35fb45,'url':_0x1f1c93(_0x35fb45['id'])}));await handleSDKOutput(_0x48a6ea,_0xc023f4);}else{if(_0x57bb90[_0x27eccf(0x16c)]===0x0)_0x40ca71?console[_0x27eccf(0x225)](_0x27eccf(0x123)+_0x40ca71):console[_0x27eccf(0x225)](_0x27eccf(0x1f3));else for(const _0x29d57d of _0x57bb90){const _0x46db24=_0x29d57d[_0x27eccf(0x2b7)][_0x27eccf(0x169)]?a31_0x12b51f[_0x27eccf(0x2dc)]('\x20('+formatRows(_0x29d57d['attributes'][_0x27eccf(0x169)])+')'):'',_0x44e076=hyperlink(_0x29d57d[_0x27eccf(0x2b7)][_0x27eccf(0x15c)],_0x1f1c93(_0x29d57d['id']));console['log'](_0x27eccf(0x143)+_0x44e076+_0x46db24);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x4797a6(0x15c)]='segment:parent:create';['description']=a31_0x4797a6(0x1a7);async[a31_0x4797a6(0x152)](_0x379b67){const _0x185544=a31_0x4797a6,{options:_0x1160fc,args:_0x1d629f,tdx:_0x11fe77}=_0x379b67;console[_0x185544(0x306)](_0x185544(0x308)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x109f7a=_0x1160fc;if(_0x1d629f['length']===0x0)return console[_0x185544(0x306)](a31_0x12b51f[_0x185544(0x315)](_0x185544(0x17e))),console[_0x185544(0x306)](_0x185544(0x2c6)),0x1;const _0x30c995=_0x1d629f[0x0];if(!_0x109f7a[_0x185544(0x247)]||!_0x109f7a[_0x185544(0x262)])return console[_0x185544(0x306)](_0x185544(0x154)),console['error'](_0x185544(0x2c6)),0x1;_0x109f7a[_0x185544(0x282)]&&(console['error'](_0x185544(0x31b)+_0x109f7a['site']),console[_0x185544(0x306)](_0x185544(0x2be)+_0x30c995),console[_0x185544(0x306)](_0x185544(0x23d)+_0x109f7a[_0x185544(0x247)]),console[_0x185544(0x306)](_0x185544(0x22d)+_0x109f7a['table']));const _0x455065=await loadJSONFromOptions(_0x109f7a[_0x185544(0x2b7)],_0x109f7a[_0x185544(0x244)]),_0x1e0181=await loadJSONFromOptions(_0x109f7a[_0x185544(0x275)],_0x109f7a['behaviorsFile']),_0x51edc4=await loadJSONFromOptions(_0x109f7a[_0x185544(0x311)],_0x109f7a[_0x185544(0x241)]),_0x352123={'name':_0x30c995,'description':_0x109f7a[_0x185544(0x2eb)],'scheduleType':_0x109f7a[_0x185544(0x1ec)],'scheduleOption':_0x109f7a[_0x185544(0x1c9)],'timezone':_0x109f7a[_0x185544(0x176)],'master':{'parentDatabaseName':_0x109f7a['database'],'parentTableName':_0x109f7a[_0x185544(0x262)]},'attributes':_0x455065,'behaviors':_0x1e0181,'customerGroup':_0x51edc4},_0x35f7f5=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x30c995+_0x185544(0x131),()=>_0x11fe77[_0x185544(0x14c)][_0x185544(0x1e6)](_0x352123),{'verbose':_0x1160fc[_0x185544(0x282)]}),_0x5befb0=_0x35f7f5[_0x185544(0x2a4)];return console[_0x185544(0x306)](_0x185544(0x2e5)+_0x5befb0[_0x185544(0x15c)]+_0x185544(0x19e)+_0x5befb0['id']),await handleSDKOutput([_0x5befb0],_0x1160fc),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x4797a6(0x15c)]='segment:parent:update';[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x13b);async['execute'](_0x19c54f){const _0x40797e=a31_0x4797a6,{options:_0x5346ba,args:_0x47bc53,tdx:_0x2fd9cc}=_0x19c54f;console[_0x40797e(0x306)](_0x40797e(0x192)+_0x40797e(0x274)+_0x40797e(0x135));const _0x195572=_0x5346ba;if(_0x47bc53['length']===0x0)return console[_0x40797e(0x306)](a31_0x12b51f[_0x40797e(0x315)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x40797e(0x306)](_0x40797e(0x1e8)),0x1;const _0x3dbf78=_0x47bc53[0x0];_0x195572[_0x40797e(0x282)]&&(console['error'](_0x40797e(0x31b)+_0x195572[_0x40797e(0x1c2)]),console['error'](_0x40797e(0x1b3)+_0x3dbf78));const _0x21f2a2=await withSpinner(_0x40797e(0x204)+_0x3dbf78+_0x40797e(0x131),()=>_0x2fd9cc[_0x40797e(0x14c)][_0x40797e(0x10d)](_0x3dbf78),{'verbose':_0x195572[_0x40797e(0x282)]}),_0x3e41a4=_0x21f2a2[_0x40797e(0x2a4)],_0x13004b=await loadJSONFromOptions(_0x195572['addAttributes'],_0x195572[_0x40797e(0x2cc)]),_0x5024f5=await loadJSONFromOptions(_0x195572[_0x40797e(0x164)],_0x195572[_0x40797e(0x133)]),_0x346fc5={'name':_0x3e41a4[_0x40797e(0x15c)],'description':_0x195572['description']!==undefined?_0x195572[_0x40797e(0x2eb)]:_0x3e41a4[_0x40797e(0x2eb)],'scheduleType':_0x195572[_0x40797e(0x1ec)]!==undefined?_0x195572[_0x40797e(0x1ec)]:_0x3e41a4[_0x40797e(0x1ec)],'scheduleOption':_0x195572['scheduleOption']!==undefined?_0x195572[_0x40797e(0x1c9)]:_0x3e41a4[_0x40797e(0x1c9)],'timezone':_0x195572[_0x40797e(0x176)]!==undefined?_0x195572[_0x40797e(0x176)]:_0x3e41a4[_0x40797e(0x176)],'master':_0x3e41a4[_0x40797e(0x2fe)],'attributes':_0x13004b?[..._0x3e41a4[_0x40797e(0x2b7)]||[],..._0x13004b]:_0x3e41a4[_0x40797e(0x2b7)],'behaviors':_0x5024f5?[..._0x3e41a4['behaviors']||[],..._0x5024f5]:_0x3e41a4[_0x40797e(0x275)],'customerGroup':_0x3e41a4[_0x40797e(0x311)]},_0x23c8f0=await withSpinner(_0x40797e(0x1f8)+_0x3dbf78+'\x27...',()=>_0x2fd9cc[_0x40797e(0x14c)]['updateParent'](_0x3dbf78,_0x346fc5),{'verbose':_0x195572[_0x40797e(0x282)]}),_0x4ad40c=_0x23c8f0[_0x40797e(0x2a4)];return console[_0x40797e(0x306)](_0x40797e(0x289)+_0x4ad40c[_0x40797e(0x15c)]+'\x27'),await handleSDKOutput([_0x4ad40c],_0x195572),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x2ba);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x318);async[a31_0x4797a6(0x152)](_0x3e20bc){const _0x368d19=a31_0x4797a6,{options:_0x7d16b5,args:_0x316f63,tdx:_0x59de2}=_0x3e20bc,_0x16906c=_0x7d16b5,_0x3f6406=_0x316f63[0x0]||_0x7d16b5[_0x368d19(0x13d)];if(!_0x3f6406)return showParentSegmentNotSetError(_0x368d19(0x2d7)+_0x368d19(0x188)),0x1;if(_0x16906c[_0x368d19(0x18c)]&&_0x16906c['output'])return console[_0x368d19(0x306)](a31_0x12b51f[_0x368d19(0x315)](_0x368d19(0x23c))),console[_0x368d19(0x306)](a31_0x12b51f[_0x368d19(0x2dc)](_0x368d19(0x1bb))),console[_0x368d19(0x306)](a31_0x12b51f[_0x368d19(0x2dc)](_0x368d19(0x109)+PARENT_SEGMENT_DIR+_0x368d19(0x126))),console[_0x368d19(0x306)](a31_0x12b51f[_0x368d19(0x137)](_0x368d19(0x28b))),0x1;const _0x148fdb=_0x16906c[_0x368d19(0x29c)]||a31_0x1da727['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3f6406)+_0x368d19(0x1fd));_0x16906c[_0x368d19(0x282)]&&(console[_0x368d19(0x306)](_0x368d19(0x31b)+_0x16906c[_0x368d19(0x1c2)]),console['error']('Parent\x20segment:\x20'+_0x3f6406),console[_0x368d19(0x306)](_0x368d19(0x24f)+_0x148fdb));const _0x15f294=await withSpinner(_0x368d19(0x2a2)+_0x3f6406+'\x27...',()=>_0x59de2[_0x368d19(0x14c)]['pullParentYaml'](_0x3f6406),{'verbose':_0x16906c['verbose']}),_0x5c1fc1=_0x15f294[_0x368d19(0x2a4)];if(existsSync(_0x148fdb)){const _0x1db1fe=readFileSync(_0x148fdb,_0x368d19(0x1aa)),_0x1e2919=generateDiff(_0x1db1fe,_0x5c1fc1);if(!hasChanges(_0x1e2919))console[_0x368d19(0x306)](a31_0x12b51f[_0x368d19(0x2db)]('✔')+_0x368d19(0x22e)+a31_0x12b51f['cyan'](_0x148fdb)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x368d19(0x306)]('\x0aChanges\x20to\x20\x27'+_0x148fdb+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x368d19(0x306)](formatDiffWithColors(_0x1e2919)),console[_0x368d19(0x306)]('─'[_0x368d19(0x112)](0x3c));if(!_0x16906c['yes']){if(!isInteractive())return console[_0x368d19(0x306)](a31_0x12b51f[_0x368d19(0x315)](_0x368d19(0x312)),_0x368d19(0x11e)),console[_0x368d19(0x306)](a31_0x12b51f[_0x368d19(0x2dc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3d9e73=await confirmKey(_0x368d19(0x221)+_0x148fdb+'\x27?');if(!_0x3d9e73)return console[_0x368d19(0x306)](a31_0x12b51f[_0x368d19(0x215)]('Aborted.')),0x1;}writeFileSync(_0x148fdb,_0x5c1fc1,_0x368d19(0x1aa)),console['error'](a31_0x12b51f[_0x368d19(0x2db)]('✔')+_0x368d19(0x12a)+a31_0x12b51f['cyan'](_0x148fdb));}}else{const _0x51c514=a31_0x1da727[_0x368d19(0x2b0)](_0x148fdb);!existsSync(_0x51c514)&&mkdirSync(_0x51c514,{'recursive':!![]}),writeFileSync(_0x148fdb,_0x5c1fc1,_0x368d19(0x1aa)),console[_0x368d19(0x306)](a31_0x12b51f['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x12b51f[_0x368d19(0x137)](_0x148fdb));}return saveSessionContext({'parent_segment':_0x3f6406},_0x16906c['session']),console[_0x368d19(0x306)](a31_0x12b51f[_0x368d19(0x2db)]('✔')+'\x20Context\x20set:\x20'+a31_0x12b51f['dim'](_0x368d19(0x2c2))+_0x368d19(0x1f4)+a31_0x12b51f['cyan'](_0x3f6406)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x4797a6(0x15c)]='segment:parent:push';[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x281);async[a31_0x4797a6(0x152)](_0x34cf57){const _0x5c4e95=a31_0x4797a6,{options:_0x54e236,args:_0x503c4c,tdx:_0x33316f}=_0x34cf57,_0x4059a5=_0x54e236,_0x10440c=_0x503c4c[0x0]||_0x54e236[_0x5c4e95(0x13d)];if(!_0x10440c)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'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x270266=resolveYamlFile(_0x10440c);if(!existsSync(_0x270266))return showFileNotFoundError(_0x270266,_0x10440c),0x1;_0x4059a5['verbose']&&(console[_0x5c4e95(0x306)](_0x5c4e95(0x31b)+_0x4059a5[_0x5c4e95(0x1c2)]),console[_0x5c4e95(0x306)](_0x5c4e95(0x212)+_0x270266));let _0x323a30;try{_0x323a30=readFileSync(_0x270266,_0x5c4e95(0x1aa));}catch(_0x3924b4){const _0x1123d4=_0x3924b4 instanceof Error?_0x3924b4['message']:String(_0x3924b4);return console[_0x5c4e95(0x306)](_0x5c4e95(0x251)+_0x1123d4),0x1;}const _0x51d3a5=await withSpinner(_0x5c4e95(0x1d1),()=>_0x33316f[_0x5c4e95(0x14c)]['pushParentYaml'](_0x323a30),{'verbose':_0x4059a5['verbose']}),_0x4b838a=_0x51d3a5['data'],{isNew:_0x2ecf4a,name:_0x16f6bc,hasChanges:_0xc921a8,diffFormatted:_0x96beb1}=_0x4b838a;if(!_0xc921a8)return console[_0x5c4e95(0x306)](_0x5c4e95(0x249)+_0x16f6bc+_0x5c4e95(0x1d2)),0x0;_0x2ecf4a?console['error'](_0x5c4e95(0x29a)+_0x16f6bc+'\x27:'):console['error'](_0x5c4e95(0x116)+_0x16f6bc+'\x27:');console[_0x5c4e95(0x306)]('─'[_0x5c4e95(0x112)](0x3c)),console['error'](_0x96beb1),console[_0x5c4e95(0x306)]('─'['repeat'](0x3c));const _0x2e8fce=_0x2ecf4a?_0x5c4e95(0x170)+_0x16f6bc+'\x27?':_0x5c4e95(0x11a)+_0x16f6bc+'\x27?';if(!_0x4059a5['yes']){if(!isInteractive())return console['error'](a31_0x12b51f[_0x5c4e95(0x315)](_0x5c4e95(0x312)),_0x5c4e95(0x11e)),console[_0x5c4e95(0x306)](a31_0x12b51f[_0x5c4e95(0x2dc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x56167c=await confirmKey(_0x2e8fce);if(!_0x56167c)return console['error'](a31_0x12b51f[_0x5c4e95(0x215)](_0x5c4e95(0x1a6))),0x1;}const _0x5b3252=_0x2ecf4a?_0x5c4e95(0x1d7):_0x5c4e95(0x18d),_0x4ad4f8=await withSpinner(_0x5b3252+_0x5c4e95(0x1c1)+_0x16f6bc+_0x5c4e95(0x131),()=>_0x4b838a[_0x5c4e95(0x30b)](),{'verbose':_0x4059a5[_0x5c4e95(0x282)]}),_0x3e1d62=_0x4ad4f8[_0x5c4e95(0x2a4)],_0x53d495=getConsoleNextUrl(_0x4059a5[_0x5c4e95(0x1c2)],_0x5c4e95(0x180)+_0x3e1d62['id']),_0xee4d96=_0x2ecf4a?_0x5c4e95(0x202):_0x5c4e95(0x30f);return console[_0x5c4e95(0x306)]('✔\x20'+_0xee4d96+'\x20parent\x20segment\x20\x27'+_0x3e1d62['name']+'\x27'),console['error']('\x20\x20'+_0x53d495),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x4797a6(0x1f0);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x10a);async['execute'](_0x29b24a){const _0x10372f=a31_0x4797a6,{options:_0xfb5975,args:_0x29093f,tdx:_0x495354}=_0x29b24a,_0x16839c=_0xfb5975,_0x5040e2=_0x29093f[0x0]||_0xfb5975['parentSegment'];if(!_0x5040e2)return showParentSegmentNotSetError(_0x10372f(0x1d8)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x10372f(0x211)+_0x10372f(0x222)+_0x10372f(0x2fb)+_0x10372f(0x175)),0x1;const _0x422556=resolveYamlFile(_0x5040e2);if(!existsSync(_0x422556))return showFileNotFoundError(_0x422556,_0x5040e2),0x1;_0x16839c[_0x10372f(0x282)]&&(console[_0x10372f(0x306)]('Site:\x20'+_0x16839c[_0x10372f(0x1c2)]),console['error'](_0x10372f(0x212)+_0x422556));let _0x30ae3d;try{_0x30ae3d=readFileSync(_0x422556,_0x10372f(0x1aa));}catch(_0x13857d){const _0x52fe2c=_0x13857d instanceof Error?_0x13857d[_0x10372f(0x182)]:String(_0x13857d);return console[_0x10372f(0x306)](_0x10372f(0x251)+_0x52fe2c),0x1;}const _0x3af96e=createCommandSpinner(a31_0x12b51f[_0x10372f(0x2dc)](_0x10372f(0x2ca)),{'verbose':_0x16839c['verbose']});_0x3af96e[_0x10372f(0x151)]();const _0x4076ab={'onProgress':_0x66a7e8=>{const _0x43da5d=_0x10372f;_0x3af96e[_0x43da5d(0x159)]=formatProgressMessage(_0x66a7e8);}};if(_0x16839c['master'])_0x4076ab[_0x10372f(0x2fe)]=!![];if(_0x16839c[_0x10372f(0x117)])_0x4076ab[_0x10372f(0x117)]=!![];_0x16839c['attribute']&&(_0x4076ab[_0x10372f(0x27a)]=_0x16839c['attribute']);_0x16839c[_0x10372f(0x1ba)]&&(_0x4076ab[_0x10372f(0x1ba)]=_0x16839c[_0x10372f(0x1ba)]);if(_0x16839c[_0x10372f(0x24d)])_0x4076ab[_0x10372f(0x24d)]=_0x16839c['interval'];let _0x44ef79;try{_0x44ef79=await _0x495354[_0x10372f(0x14c)][_0x10372f(0x218)](_0x30ae3d,_0x4076ab),_0x3af96e['stop']();}catch(_0xc61418){_0x3af96e[_0x10372f(0x2bc)]();throw _0xc61418;}const _0x3dfbfe=_0x16839c[_0x10372f(0x24d)]||_0x10372f(0x163);return this['displayValidateResults'](_0x44ef79,_0x4076ab,_0x422556,_0x3dfbfe),_0x44ef79[_0x10372f(0x191)]?0x0:0x1;}[a31_0x4797a6(0x17d)](_0x11f45b,_0x260161,_0x4f9146,_0xcb4b30){const _0x5c08ab=a31_0x4797a6;console[_0x5c08ab(0x306)]('\x0a'+a31_0x12b51f[_0x5c08ab(0x287)](_0x5c08ab(0x269))+'\x20'+_0x11f45b[_0x5c08ab(0x15c)]),console[_0x5c08ab(0x306)]('═'[_0x5c08ab(0x112)](0x3c)),this[_0x5c08ab(0x273)](_0x11f45b);if(typeof _0x260161['attribute']==='string'){this[_0x5c08ab(0x194)](_0x11f45b),this[_0x5c08ab(0x1a1)](_0x11f45b),this[_0x5c08ab(0x243)](_0x4f9146,_0xcb4b30,_0x5c08ab(0x27a),_0x260161['attribute']);return;}if(_0x260161[_0x5c08ab(0x27a)]===!![]){this[_0x5c08ab(0x194)](_0x11f45b),this[_0x5c08ab(0x1a1)](_0x11f45b),this[_0x5c08ab(0x243)](_0x4f9146,_0xcb4b30,_0x5c08ab(0x2b7));return;}if(typeof _0x260161[_0x5c08ab(0x1ba)]===_0x5c08ab(0x12d)){this[_0x5c08ab(0x1f5)](_0x11f45b,_0xcb4b30),this[_0x5c08ab(0x1a1)](_0x11f45b),this[_0x5c08ab(0x243)](_0x4f9146,_0xcb4b30,_0x5c08ab(0x1ba),_0x260161[_0x5c08ab(0x1ba)]);return;}if(_0x260161[_0x5c08ab(0x1ba)]===!![]){this[_0x5c08ab(0x1f5)](_0x11f45b,_0xcb4b30),this[_0x5c08ab(0x1a1)](_0x11f45b),this[_0x5c08ab(0x243)](_0x4f9146,_0xcb4b30,_0x5c08ab(0x275));return;}this[_0x5c08ab(0x194)](_0x11f45b),this['displayBehaviorsStats'](_0x11f45b,_0xcb4b30),this[_0x5c08ab(0x172)](_0x11f45b),this[_0x5c08ab(0x1a1)](_0x11f45b),this['displayPreviewHints'](_0x4f9146,_0xcb4b30,_0x5c08ab(0x195));}[a31_0x4797a6(0x172)](_0x533b14){displayRealtimeValidation(_0x533b14);}[a31_0x4797a6(0x243)](_0x1301d6,_0x11615f,_0x46f9e2,_0x468c1e){const _0x3a8207=a31_0x4797a6;console['error']('\x0a'+a31_0x12b51f['dim']('To\x20view\x20sample\x20data:'));const _0x47b145=_0x11615f!==_0x3a8207(0x163)?_0x3a8207(0x29e)+_0x11615f:'';if(_0x46f9e2===_0x3a8207(0x27a)&&_0x468c1e)console[_0x3a8207(0x306)]('\x20\x20'+a31_0x12b51f['dim'](_0x3a8207(0x266)+_0x1301d6+_0x3a8207(0x2f0)+_0x468c1e+'\x22'+_0x47b145));else{if(_0x46f9e2==='behavior'&&_0x468c1e)console[_0x3a8207(0x306)]('\x20\x20'+a31_0x12b51f['dim']('tdx\x20ps\x20preview\x20'+_0x1301d6+_0x3a8207(0x210)+_0x468c1e+'\x22'+_0x47b145));else(_0x46f9e2===_0x3a8207(0x2b7)||_0x46f9e2===_0x3a8207(0x195))&&console[_0x3a8207(0x306)]('\x20\x20'+a31_0x12b51f[_0x3a8207(0x2dc)](_0x3a8207(0x266)+_0x1301d6+'\x20--attribute\x20\x22<name>\x22'+_0x47b145));}(_0x46f9e2===_0x3a8207(0x275)||_0x46f9e2==='all')&&console[_0x3a8207(0x306)]('\x20\x20'+a31_0x12b51f['dim'](_0x3a8207(0x266)+_0x1301d6+_0x3a8207(0x27f)+_0x47b145)),_0x46f9e2==='all'&&console['error']('\x20\x20'+a31_0x12b51f[_0x3a8207(0x2dc)]('tdx\x20ps\x20preview\x20'+_0x1301d6+_0x3a8207(0x25a)+_0x47b145));}[a31_0x4797a6(0x273)](_0x576f57){const _0x26507a=a31_0x4797a6,{master:_0xf53af0}=_0x576f57,_0x114660=_0xf53af0[_0x26507a(0x2f3)]?a31_0x12b51f[_0x26507a(0x2db)]('✔'):a31_0x12b51f[_0x26507a(0x315)]('✘');console['error']('\x0a'+a31_0x12b51f[_0x26507a(0x2dc)](_0x26507a(0x165))),console[_0x26507a(0x306)](_0x114660+'\x20'+a31_0x12b51f[_0x26507a(0x287)](_0xf53af0[_0x26507a(0x247)]+'.'+_0xf53af0[_0x26507a(0x262)])),_0xf53af0[_0x26507a(0x2f3)]?_0xf53af0[_0x26507a(0x20a)]!==undefined&&console[_0x26507a(0x306)]('\x20\x20'+a31_0x12b51f[_0x26507a(0x2dc)]('Rows:')+'\x20'+a31_0x12b51f[_0x26507a(0x137)](formatRows(_0xf53af0[_0x26507a(0x20a)]))):console['error']('\x20\x20'+a31_0x12b51f['red'](_0x26507a(0x2a7))+'\x20'+_0xf53af0[_0x26507a(0x110)]);}[a31_0x4797a6(0x194)](_0x56069b){const _0x37fe3f=a31_0x4797a6;if(_0x56069b['attributes'][_0x37fe3f(0x16c)]===0x0)return;console[_0x37fe3f(0x306)]('\x0a'+a31_0x12b51f[_0x37fe3f(0x2dc)](_0x37fe3f(0x21f)));for(const _0x530c80 of _0x56069b['attributes']){const _0x1ea174=_0x530c80[_0x37fe3f(0x2f3)]?a31_0x12b51f['green']('✔'):a31_0x12b51f[_0x37fe3f(0x315)]('✘');let _0x3e3ba4='';if(_0x530c80[_0x37fe3f(0x2f3)]&&_0x530c80['matchedCount']!==undefined&&_0x530c80[_0x37fe3f(0x1e5)]!==undefined){const _0x1ffa9f=_0x530c80[_0x37fe3f(0x1e5)][_0x37fe3f(0x231)](0x1),_0x12538d=_0x530c80[_0x37fe3f(0x1e5)]>=0x50?a31_0x12b51f[_0x37fe3f(0x2db)]:_0x530c80['coveragePercent']>=0x32?a31_0x12b51f[_0x37fe3f(0x215)]:a31_0x12b51f[_0x37fe3f(0x315)];_0x3e3ba4='\x20'+a31_0x12b51f[_0x37fe3f(0x2dc)](_0x37fe3f(0x11d))+'\x20'+_0x12538d(_0x1ffa9f+'%')+'\x20('+formatRows(_0x530c80[_0x37fe3f(0x288)])+_0x37fe3f(0x2d8);}console[_0x37fe3f(0x306)](_0x1ea174+'\x20'+a31_0x12b51f[_0x37fe3f(0x287)](_0x530c80[_0x37fe3f(0x15c)])+_0x3e3ba4),console[_0x37fe3f(0x306)]('\x20\x20'+a31_0x12b51f[_0x37fe3f(0x2dc)](_0x37fe3f(0x12b))+'\x20'+a31_0x12b51f[_0x37fe3f(0x287)](_0x530c80[_0x37fe3f(0x247)]+'.'+_0x530c80['table']));const _0x5d50d3=_0x530c80['joinKey']===_0x530c80[_0x37fe3f(0x1ce)]?a31_0x12b51f[_0x37fe3f(0x2dc)]('Join\x20on:')+'\x20'+_0x530c80[_0x37fe3f(0x16b)]:a31_0x12b51f['dim'](_0x37fe3f(0x254))+'\x20'+_0x530c80[_0x37fe3f(0x16b)]+_0x37fe3f(0x1f4)+_0x530c80[_0x37fe3f(0x1ce)];console[_0x37fe3f(0x306)]('\x20\x20'+_0x5d50d3),console[_0x37fe3f(0x306)]('\x20\x20'+a31_0x12b51f[_0x37fe3f(0x2dc)]('Columns:')),this[_0x37fe3f(0x141)](_0x530c80[_0x37fe3f(0x207)]),!_0x530c80[_0x37fe3f(0x2f3)]&&console[_0x37fe3f(0x306)]('\x20\x20'+a31_0x12b51f[_0x37fe3f(0x315)](_0x37fe3f(0x2a7))+'\x20'+_0x530c80[_0x37fe3f(0x110)]);}}[a31_0x4797a6(0x1f5)](_0x403cb9,_0x581b3f){const _0x4f9a5b=a31_0x4797a6;if(_0x403cb9[_0x4f9a5b(0x275)][_0x4f9a5b(0x16c)]===0x0)return;console['error']('\x0a'+a31_0x12b51f[_0x4f9a5b(0x2dc)](_0x4f9a5b(0x2ea))+'\x20'+a31_0x12b51f[_0x4f9a5b(0x2dc)]('('+_0x581b3f+')'));for(const _0x4ed74b of _0x403cb9['behaviors']){const _0x2e9a98=_0x4ed74b[_0x4f9a5b(0x2f3)]?a31_0x12b51f[_0x4f9a5b(0x2db)]('✔'):a31_0x12b51f[_0x4f9a5b(0x315)]('✘');let _0x24bf92='';if(_0x4ed74b[_0x4f9a5b(0x2f3)]&&_0x4ed74b[_0x4f9a5b(0x130)]!==undefined&&_0x4ed74b[_0x4f9a5b(0x2fd)]!==undefined){const _0x5559c8=_0x4ed74b[_0x4f9a5b(0x2a5)]?.['toFixed'](0x1)||'?',_0x5eefa2=(_0x4ed74b['customerPercent']??0x0)>=0x32?a31_0x12b51f['green']:(_0x4ed74b[_0x4f9a5b(0x2a5)]??0x0)>=0x14?a31_0x12b51f[_0x4f9a5b(0x215)]:a31_0x12b51f[_0x4f9a5b(0x315)];_0x24bf92='\x20'+a31_0x12b51f[_0x4f9a5b(0x2dc)](_0x4f9a5b(0x30a))+'\x20'+_0x5eefa2(formatRows(_0x4ed74b['customersWithEvents']))+'\x20('+_0x5559c8+_0x4f9a5b(0x238)+a31_0x12b51f[_0x4f9a5b(0x2dc)](_0x4f9a5b(0x237))+'\x20'+a31_0x12b51f['cyan'](formatRows(_0x4ed74b[_0x4f9a5b(0x2fd)]));}console[_0x4f9a5b(0x306)](_0x2e9a98+'\x20'+a31_0x12b51f[_0x4f9a5b(0x287)](_0x4ed74b['name'])+_0x24bf92),console[_0x4f9a5b(0x306)]('\x20\x20'+a31_0x12b51f[_0x4f9a5b(0x2dc)](_0x4f9a5b(0x12b))+'\x20'+a31_0x12b51f[_0x4f9a5b(0x287)](_0x4ed74b['database']+'.'+_0x4ed74b[_0x4f9a5b(0x262)]));const _0x119e8e=_0x4ed74b[_0x4f9a5b(0x16b)]===_0x4ed74b[_0x4f9a5b(0x1ce)]?a31_0x12b51f[_0x4f9a5b(0x2dc)](_0x4f9a5b(0x1e9))+'\x20'+_0x4ed74b[_0x4f9a5b(0x16b)]:a31_0x12b51f[_0x4f9a5b(0x2dc)]('Join:')+'\x20'+_0x4ed74b[_0x4f9a5b(0x16b)]+_0x4f9a5b(0x1f4)+_0x4ed74b[_0x4f9a5b(0x1ce)];console[_0x4f9a5b(0x306)]('\x20\x20'+_0x119e8e),console[_0x4f9a5b(0x306)]('\x20\x20'+a31_0x12b51f[_0x4f9a5b(0x2dc)]('Columns:')),this[_0x4f9a5b(0x141)](_0x4ed74b[_0x4f9a5b(0x207)]),!_0x4ed74b[_0x4f9a5b(0x2f3)]&&console[_0x4f9a5b(0x306)]('\x20\x20'+a31_0x12b51f[_0x4f9a5b(0x315)](_0x4f9a5b(0x2a7))+'\x20'+_0x4ed74b[_0x4f9a5b(0x110)]);}}[a31_0x4797a6(0x141)](_0x49339f){const _0x934d96=a31_0x4797a6;for(const _0x4cea6c of _0x49339f){_0x4cea6c[_0x934d96(0x115)]===_0x4cea6c[_0x934d96(0x206)]||_0x4cea6c[_0x934d96(0x206)]==='*'?console[_0x934d96(0x306)](_0x934d96(0x24a)+_0x4cea6c[_0x934d96(0x115)]):console[_0x934d96(0x306)](_0x934d96(0x24a)+_0x4cea6c[_0x934d96(0x115)]+'\x20'+a31_0x12b51f[_0x934d96(0x2dc)]('('+_0x4cea6c[_0x934d96(0x206)]+')'));}}[a31_0x4797a6(0x1a1)](_0x169281){const _0x456338=a31_0x4797a6;console[_0x456338(0x306)]('─'['repeat'](0x3c));if(_0x169281[_0x456338(0x128)][_0x456338(0x16c)]>0x0){console[_0x456338(0x306)]('\x0a'+a31_0x12b51f['red'](_0x456338(0x1b7)));for(const _0x39caa0 of _0x169281[_0x456338(0x128)]){console[_0x456338(0x306)]('\x20\x20'+a31_0x12b51f[_0x456338(0x315)]('•')+'\x20'+_0x39caa0);}}_0x169281[_0x456338(0x191)]&&console[_0x456338(0x306)]('\x0a'+a31_0x12b51f[_0x456338(0x2db)]('✔')+_0x456338(0x303));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a31_0x4797a6(0x1d4);['description']='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async[a31_0x4797a6(0x152)](_0xff2537){const _0x488f83=a31_0x4797a6,{options:_0x1ea913,args:_0x5818b5,tdx:_0x462f82}=_0xff2537,_0x3a88da=_0x1ea913,_0x522da6=_0x5818b5[0x0]||_0x1ea913[_0x488f83(0x13d)];if(!_0x522da6)return showParentSegmentNotSetError(_0x488f83(0x2e4)+_0x488f83(0x253)+_0x488f83(0x1a4)+_0x488f83(0x2d5)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x488f83(0x1fe)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x488f83(0x175)),0x1;if(!_0x3a88da[_0x488f83(0x2fe)]&&!_0x3a88da[_0x488f83(0x27a)]&&!_0x3a88da[_0x488f83(0x1ba)]&&!_0x3a88da['enriched'])return console[_0x488f83(0x306)](a31_0x12b51f[_0x488f83(0x315)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x488f83(0x306)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x488f83(0x306)](_0x488f83(0x267)),console[_0x488f83(0x306)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x488f83(0x306)](_0x488f83(0x2f5)),console[_0x488f83(0x306)](_0x488f83(0x242)),console[_0x488f83(0x306)](_0x488f83(0x1f6)),0x1;const _0x214bf9=resolveYamlFile(_0x522da6);if(!existsSync(_0x214bf9))return showFileNotFoundError(_0x214bf9,_0x522da6),0x1;_0x3a88da[_0x488f83(0x282)]&&(console['error'](_0x488f83(0x31b)+_0x3a88da[_0x488f83(0x1c2)]),console[_0x488f83(0x306)](_0x488f83(0x212)+_0x214bf9));let _0x21a94b;try{_0x21a94b=readFileSync(_0x214bf9,_0x488f83(0x1aa));}catch(_0x33b905){const _0x5bbe58=_0x33b905 instanceof Error?_0x33b905[_0x488f83(0x182)]:String(_0x33b905);return console[_0x488f83(0x306)](_0x488f83(0x251)+_0x5bbe58),0x1;}let _0x5ae5a0;try{_0x5ae5a0=parseDef(_0x21a94b);}catch(_0x3c75f2){const _0x58a06b=_0x3c75f2 instanceof Error?_0x3c75f2[_0x488f83(0x182)]:String(_0x3c75f2);return console[_0x488f83(0x306)](a31_0x12b51f['red'](_0x488f83(0x15a)+_0x58a06b)),0x1;}if(_0x3a88da[_0x488f83(0x27a)]===!![]||_0x3a88da[_0x488f83(0x27a)]===''){const _0x44c888=_0x5ae5a0[_0x488f83(0x2b7)]?.[_0x488f83(0x1d5)](_0xbe44de=>_0xbe44de['name'])||[];if(_0x44c888[_0x488f83(0x16c)]===0x0)console['error'](a31_0x12b51f[_0x488f83(0x315)](_0x488f83(0x153)));else{console[_0x488f83(0x306)](a31_0x12b51f[_0x488f83(0x315)](_0x488f83(0x2cd))),console[_0x488f83(0x306)](_0x488f83(0x2e6));for(const _0x1bd139 of _0x44c888){console['error']('\x20\x20'+a31_0x12b51f[_0x488f83(0x137)](_0x1bd139));}console[_0x488f83(0x306)](_0x488f83(0x18f)+_0x522da6+'\x20--attribute\x20\x22'+_0x44c888[0x0]+'\x22');}return 0x1;}if(_0x3a88da[_0x488f83(0x1ba)]===!![]||_0x3a88da[_0x488f83(0x1ba)]===''){const _0x5bee87=_0x5ae5a0[_0x488f83(0x275)]?.[_0x488f83(0x1d5)](_0x5f4b6c=>_0x5f4b6c['name'])||[];if(_0x5bee87[_0x488f83(0x16c)]===0x0)console[_0x488f83(0x306)](a31_0x12b51f[_0x488f83(0x315)](_0x488f83(0x12e)));else{console[_0x488f83(0x306)](a31_0x12b51f[_0x488f83(0x315)](_0x488f83(0x1b5))),console[_0x488f83(0x306)](_0x488f83(0x2de));for(const _0xba992e of _0x5bee87){console[_0x488f83(0x306)]('\x20\x20'+a31_0x12b51f[_0x488f83(0x137)](_0xba992e));}console[_0x488f83(0x306)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x522da6+_0x488f83(0x210)+_0x5bee87[0x0]+'\x22');}return 0x1;}const _0xfd826f=createCommandSpinner(a31_0x12b51f[_0x488f83(0x2dc)](_0x488f83(0x1df)),{'verbose':_0x3a88da['verbose']});_0xfd826f['start']();const _0x5e706b={'onProgress':_0x113a74=>{const _0x1a87a7=_0x488f83;_0xfd826f[_0x1a87a7(0x159)]=formatProgressMessage(_0x113a74);}};if(_0x3a88da[_0x488f83(0x2fe)])_0x5e706b[_0x488f83(0x2fe)]=!![];if(_0x3a88da[_0x488f83(0x27a)]&&typeof _0x3a88da[_0x488f83(0x27a)]===_0x488f83(0x12d))_0x5e706b[_0x488f83(0x27a)]=_0x3a88da[_0x488f83(0x27a)];if(_0x3a88da['behavior']&&typeof _0x3a88da[_0x488f83(0x1ba)]===_0x488f83(0x12d))_0x5e706b[_0x488f83(0x1ba)]=_0x3a88da['behavior'];if(_0x3a88da[_0x488f83(0x117)])_0x5e706b['enriched']=!![];if(_0x3a88da['interval'])_0x5e706b[_0x488f83(0x24d)]=_0x3a88da[_0x488f83(0x24d)];let _0x2da5c6;try{_0x2da5c6=await _0x462f82['segment'][_0x488f83(0x2d6)](_0x21a94b,_0x5e706b),_0xfd826f[_0x488f83(0x2bc)]();}catch(_0x2ccd60){_0xfd826f['stop']();throw _0x2ccd60;}return await this['displayPreviewResults'](_0x2da5c6,{'master':_0x3a88da[_0x488f83(0x2fe)],'attribute':typeof _0x3a88da[_0x488f83(0x27a)]===_0x488f83(0x12d)?_0x3a88da['attribute']:undefined,'behavior':typeof _0x3a88da[_0x488f83(0x1ba)]===_0x488f83(0x12d)?_0x3a88da[_0x488f83(0x1ba)]:undefined,'enriched':_0x3a88da[_0x488f83(0x117)]}),_0x2da5c6[_0x488f83(0x191)]?0x0:0x1;}async[a31_0x4797a6(0x119)](_0x476258,_0x496b1d){const _0x1c66df=a31_0x4797a6;console['error']('\x0a'+a31_0x12b51f[_0x1c66df(0x287)](_0x1c66df(0x1e2))+'\x20'+_0x476258[_0x1c66df(0x15c)]),console[_0x1c66df(0x306)]('═'[_0x1c66df(0x112)](0x3c));if(_0x496b1d[_0x1c66df(0x2fe)]&&_0x476258[_0x1c66df(0x25f)]){const _0x21d2ac=a31_0x12b51f['dim']('Master:')+'\x20'+a31_0x12b51f[_0x1c66df(0x287)](_0x476258[_0x1c66df(0x2fe)][_0x1c66df(0x247)]+'.'+_0x476258[_0x1c66df(0x2fe)]['table']);await this[_0x1c66df(0x2a6)](_0x21d2ac,_0x476258[_0x1c66df(0x25f)]);}else{if(_0x496b1d[_0x1c66df(0x27a)]&&_0x476258['sampleData']){const _0x47cfdd=a31_0x12b51f[_0x1c66df(0x2dc)]('Attribute:')+'\x20'+a31_0x12b51f['bold'](_0x496b1d[_0x1c66df(0x27a)]);await this[_0x1c66df(0x2a6)](_0x47cfdd,_0x476258[_0x1c66df(0x25f)]);}else{if(_0x496b1d[_0x1c66df(0x1ba)]&&_0x476258[_0x1c66df(0x25f)]){const _0x547e0f=a31_0x12b51f[_0x1c66df(0x2dc)]('Behavior:')+'\x20'+a31_0x12b51f[_0x1c66df(0x287)](_0x496b1d[_0x1c66df(0x1ba)]);await this[_0x1c66df(0x2a6)](_0x547e0f,_0x476258[_0x1c66df(0x25f)]);}else{if(_0x496b1d['enriched']&&_0x476258[_0x1c66df(0x25f)]){const _0x1449f2=a31_0x12b51f[_0x1c66df(0x2dc)]('Enriched:')+'\x20'+a31_0x12b51f['bold'](_0x1c66df(0x1e0));await this[_0x1c66df(0x2a6)](_0x1449f2,_0x476258[_0x1c66df(0x25f)]);}else!_0x476258[_0x1c66df(0x25f)]&&console['error'](_0x1c66df(0x2ac));}}}if(_0x476258[_0x1c66df(0x128)][_0x1c66df(0x16c)]>0x0){console['error']('─'[_0x1c66df(0x112)](0x3c)),console[_0x1c66df(0x306)]('\x0a'+a31_0x12b51f[_0x1c66df(0x315)](_0x1c66df(0x1b7)));for(const _0x5267f8 of _0x476258[_0x1c66df(0x128)]){console[_0x1c66df(0x306)]('\x20\x20'+a31_0x12b51f[_0x1c66df(0x315)]('•')+'\x20'+_0x5267f8);}}}async['displaySampleData'](_0x5c8376,_0xfd7a6c){const _0x13430b=a31_0x4797a6;if(_0xfd7a6c[_0x13430b(0x16c)]===0x0){console[_0x13430b(0x306)]('\x0a'+_0x5c8376),console[_0x13430b(0x306)](_0x13430b(0x23b));return;}console[_0x13430b(0x306)]('\x0a'+_0x5c8376);const _0x1e6c93=Object['keys'](_0xfd7a6c[0x0])[_0x13430b(0x1d5)](_0x5089c7=>({'name':_0x5089c7,'type':typeof _0xfd7a6c[0x0][_0x5089c7]===_0x13430b(0x2a1)?_0x13430b(0x263):_0x13430b(0x173)})),_0x14a9f1={'queryId':_0x13430b(0x13a),'columns':_0x1e6c93,'data':_0xfd7a6c,'stats':{'state':_0x13430b(0x272),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xfd7a6c[_0x13430b(0x16c)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x30ba2b=formatAsTable(_0x14a9f1,_0xfd7a6c[_0x13430b(0x16c)],!![]);await writeOutput(_0x30ba2b,undefined,_0x13430b(0x262));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x161);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x132);async[a31_0x4797a6(0x152)](_0x45befe){const _0x46b09a=a31_0x4797a6,{options:_0x437dcc,args:_0x59042e,tdx:_0x361e04}=_0x45befe,_0x100c99=_0x437dcc,_0x1be823=_0x59042e[0x0]||_0x437dcc[_0x46b09a(0x13d)];if(!_0x1be823)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x58bdce=resolveYamlFile(_0x1be823);if(existsSync(_0x58bdce)){_0x100c99['verbose']&&console[_0x46b09a(0x306)](_0x46b09a(0x26d)+_0x58bdce);let _0x444015;try{_0x444015=readFileSync(_0x58bdce,_0x46b09a(0x1aa));}catch(_0x5470a6){const _0xf787b9=_0x5470a6 instanceof Error?_0x5470a6['message']:String(_0x5470a6);return console[_0x46b09a(0x306)](_0x46b09a(0x251)+_0xf787b9),0x1;}const _0x57f7d2=await withSpinner(_0x46b09a(0x1d1),()=>_0x361e04[_0x46b09a(0x14c)][_0x46b09a(0x2af)](_0x444015),{'verbose':_0x100c99[_0x46b09a(0x282)]}),_0x5119e4=_0x57f7d2['data'],{isNew:_0x4fc9bd,name:_0x2a2283,hasChanges:_0x338908,diffFormatted:_0x56f98e}=_0x5119e4;if(_0x338908){_0x4fc9bd?console[_0x46b09a(0x306)](_0x46b09a(0x29a)+_0x2a2283+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x2a2283+'\x27:');console[_0x46b09a(0x306)]('─'[_0x46b09a(0x112)](0x3c)),console['error'](_0x56f98e),console[_0x46b09a(0x306)]('─'['repeat'](0x3c));const _0x2edacf=_0x4fc9bd?_0x46b09a(0x170)+_0x2a2283+'\x27\x20and\x20run\x20workflow?':_0x46b09a(0x11a)+_0x2a2283+_0x46b09a(0x298);if(!_0x100c99[_0x46b09a(0x1fc)]){if(!isInteractive())return console[_0x46b09a(0x306)](a31_0x12b51f['red'](_0x46b09a(0x312)),_0x46b09a(0x11e)),console[_0x46b09a(0x306)](a31_0x12b51f[_0x46b09a(0x2dc)](_0x46b09a(0x2c1))),0x1;const _0x301fbd=await confirmKey(_0x2edacf);if(!_0x301fbd)return console['error'](a31_0x12b51f[_0x46b09a(0x215)](_0x46b09a(0x1a6))),0x1;}const _0xf46ab9=_0x4fc9bd?_0x46b09a(0x1d7):_0x46b09a(0x18d);await withSpinner(_0xf46ab9+_0x46b09a(0x1c1)+_0x2a2283+_0x46b09a(0x131),()=>_0x5119e4['apply'](),{'verbose':_0x100c99['verbose']});const _0x3222b4=_0x4fc9bd?_0x46b09a(0x202):'Updated';console[_0x46b09a(0x306)]('✔\x20'+_0x3222b4+'\x20parent\x20segment\x20\x27'+_0x2a2283+'\x27');}else console['error'](_0x46b09a(0x249)+_0x2a2283+_0x46b09a(0x2d2));}const _0x144457=await withSpinner(_0x46b09a(0x30e)+_0x1be823+_0x46b09a(0x131),()=>_0x361e04[_0x46b09a(0x14c)][_0x46b09a(0x17a)](_0x1be823),{'verbose':_0x100c99[_0x46b09a(0x282)]}),_0x1977a0=_0x144457['data'],_0x1957d7=getConsoleUrl(_0x100c99['site'],'/app/workflows/'+_0x1977a0['workflowId']+_0x46b09a(0x26e)+_0x1977a0['workflowSessionId']+_0x46b09a(0x16e)+_0x1977a0[_0x46b09a(0x260)]);return console['error']('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a31_0x12b51f[_0x46b09a(0x2dc)](_0x46b09a(0x2da))+'\x20'+_0x1977a0[_0x46b09a(0x108)]),console[_0x46b09a(0x306)]('\x20\x20'+a31_0x12b51f[_0x46b09a(0x2dc)](_0x46b09a(0x224))+'\x20'+_0x1977a0[_0x46b09a(0x301)]),console[_0x46b09a(0x306)]('\x20\x20'+a31_0x12b51f[_0x46b09a(0x2dc)](_0x46b09a(0x2c8))+'\x20'+_0x1977a0['workflowSessionId']),console['error']('\x20\x20'+a31_0x12b51f['dim'](_0x46b09a(0x1fb))+'\x20'+_0x1977a0[_0x46b09a(0x260)]),console['error']('\x20\x20'+_0x1957d7),console[_0x46b09a(0x306)]('\x0a'+a31_0x12b51f['dim'](_0x46b09a(0x22f))+'\x20tdx\x20wf\x20attempt\x20'+_0x1977a0[_0x46b09a(0x260)]+_0x46b09a(0x14e)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x4797a6(0x15c)]='segment:parent:fields';[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x245);async[a31_0x4797a6(0x152)](_0x4f6381){const _0x4883bc=a31_0x4797a6,{options:_0x5ec12f,args:_0x57a8cc,tdx:_0x443857}=_0x4f6381,_0x2586bd=_0x57a8cc[0x0]||_0x5ec12f[_0x4883bc(0x13d)];if(!_0x2586bd)return showParentSegmentNotSetError(_0x4883bc(0x302)+_0x4883bc(0x2e9)),0x1;_0x5ec12f[_0x4883bc(0x282)]&&(console['error'](_0x4883bc(0x31b)+_0x5ec12f[_0x4883bc(0x1c2)]),console[_0x4883bc(0x306)](_0x4883bc(0x1b3)+_0x2586bd));const _0x53399e=await withSpinner(_0x4883bc(0x314)+_0x2586bd+_0x4883bc(0x131),()=>_0x443857[_0x4883bc(0x14c)][_0x4883bc(0x229)](_0x2586bd),{'verbose':_0x5ec12f['verbose']}),_0x2f2234=_0x53399e['data'];console[_0x4883bc(0x306)]('✔\x20Found\x20'+_0x2f2234['length']+_0x4883bc(0x256)+(_0x2f2234[_0x4883bc(0x16c)]!==0x1?'s':''));if(_0x5ec12f[_0x4883bc(0x1bf)]||_0x5ec12f[_0x4883bc(0x1bc)])return await handleSDKOutput(_0x2f2234,_0x5ec12f),0x0;return displayFieldsHumanReadable(_0x2f2234,_0x2586bd),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x2df);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x2bf);async[a31_0x4797a6(0x152)](_0x26a438){const _0x1d2ec3=a31_0x4797a6,{options:_0x74393b,args:_0x227d88,tdx:_0x3de7cc}=_0x26a438,_0x2d9294=_0x74393b,_0x3b543d=_0x227d88[0x0]||_0x74393b[_0x1d2ec3(0x13d)];if(!_0x3b543d)return showParentSegmentNotSetError(_0x1d2ec3(0x158)+_0x1d2ec3(0x114)+_0x1d2ec3(0x211)+_0x1d2ec3(0x1dc)),0x1;_0x74393b[_0x1d2ec3(0x282)]&&(console[_0x1d2ec3(0x306)](_0x1d2ec3(0x31b)+_0x74393b['site']),console[_0x1d2ec3(0x306)](_0x1d2ec3(0x1b3)+_0x3b543d));const _0x7fc918=await withSpinner(_0x1d2ec3(0x2a2)+_0x3b543d+'\x27...',()=>_0x3de7cc[_0x1d2ec3(0x14c)][_0x1d2ec3(0x10d)](_0x3b543d),{'verbose':_0x74393b[_0x1d2ec3(0x282)]}),_0x1db76a=_0x7fc918[_0x1d2ec3(0x2a4)];if(_0x2d9294[_0x1d2ec3(0x184)]){const _0x1f3406=getConsoleNextUrl(_0x2d9294[_0x1d2ec3(0x1c2)],_0x1d2ec3(0x180)+_0x1db76a['id']);return console[_0x1d2ec3(0x306)](a31_0x12b51f[_0x1d2ec3(0x2db)]('✔')+_0x1d2ec3(0x2b2)+a31_0x12b51f[_0x1d2ec3(0x137)](_0x1f3406)),openBrowser(_0x1f3406),0x0;}return await handleSingleObjectOutput(_0x1db76a,_0x74393b),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x4797a6(0x15c)]='segment:parent:desc';[a31_0x4797a6(0x2eb)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x547012){const _0x530a1d=a31_0x4797a6,{options:_0x402f98,args:_0x59dacb,tdx:_0x4c8c9a}=_0x547012,_0x19c7d8=_0x402f98,_0x100e61=_0x59dacb[0x0]||_0x402f98[_0x530a1d(0x13d)];if(!_0x100e61)return showParentSegmentNotSetError(_0x530a1d(0x280)+_0x530a1d(0x177)+'Options:\x0a'+_0x530a1d(0x2b1)),0x1;_0x402f98[_0x530a1d(0x282)]&&(console[_0x530a1d(0x306)](_0x530a1d(0x31b)+_0x402f98['site']),console['error'](_0x530a1d(0x1b3)+_0x100e61));const _0x374d89=await withSpinner(_0x530a1d(0x2d3)+_0x100e61+_0x530a1d(0x131),()=>_0x4c8c9a['segment'][_0x530a1d(0x127)](_0x100e61),{'verbose':_0x402f98[_0x530a1d(0x282)]}),_0x5b2d4c=_0x374d89[_0x530a1d(0x2a4)],_0x5822e3=_0x4c8c9a[_0x530a1d(0x14c)][_0x530a1d(0x2a8)](_0x5b2d4c);if(_0x19c7d8[_0x530a1d(0x29c)]){const _0x5224a8=await this[_0x530a1d(0x25c)](_0x547012,_0x100e61,_0x5b2d4c,_0x5822e3),_0x1fbe0a=this[_0x530a1d(0x220)](_0x5224a8);writeFileSync(_0x19c7d8[_0x530a1d(0x29c)],_0x1fbe0a);const _0x328ecd=_0x5224a8[_0x530a1d(0x2e2)]['columns'][_0x530a1d(0x16c)]+_0x5224a8[_0x530a1d(0x275)][_0x530a1d(0x20b)]((_0x3c990c,_0x1e7093)=>_0x3c990c+_0x1e7093[_0x530a1d(0x207)][_0x530a1d(0x16c)],0x0),_0x5be78c=_0x5224a8[_0x530a1d(0x275)][_0x530a1d(0x19c)](_0x46ae85=>_0x46ae85[_0x530a1d(0x207)][_0x530a1d(0x16c)]===0x0)['length'];return console['log'](_0x530a1d(0x1a3)+_0x19c7d8['output']),console[_0x530a1d(0x225)]('\x20\x20Database:\x20'+_0x5822e3),console[_0x530a1d(0x225)]('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x5224a8[_0x530a1d(0x275)][_0x530a1d(0x16c)]+'\x20behaviors'),console[_0x530a1d(0x225)]('\x20\x20Columns:\x20'+_0x328ecd+'\x20total'),_0x5be78c>0x0&&console[_0x530a1d(0x225)](_0x530a1d(0x1ef)+_0x5be78c+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console['error']('\x0a'+a31_0x12b51f[_0x530a1d(0x287)](_0x530a1d(0x2b9))+'\x20'+a31_0x12b51f[_0x530a1d(0x137)](_0x5822e3));const _0x11c1d9=await withSpinner(_0x530a1d(0x11c),()=>_0x4c8c9a[_0x530a1d(0x14c)][_0x530a1d(0x187)](_0x5b2d4c),{'verbose':_0x402f98[_0x530a1d(0x282)]});console[_0x530a1d(0x306)]('\x0a'+a31_0x12b51f[_0x530a1d(0x287)](_0x530a1d(0x2e2))+'\x20'+a31_0x12b51f[_0x530a1d(0x2dc)]('('+_0x5822e3+_0x530a1d(0x18e)));const _0x5ad157=await executeSchemaQuery(_0x11c1d9[_0x530a1d(0x2a4)],_0x4c8c9a,_0x402f98);await handleQueryOutput(_0x5ad157,_0x402f98);const _0x5a358e=await withSpinner(_0x530a1d(0x22c),()=>_0x4c8c9a['segment'][_0x530a1d(0x15d)](_0x5b2d4c),{'verbose':_0x402f98[_0x530a1d(0x282)]});for(const _0x4a28ec of _0x5a358e['data']){const _0x7736b1='behavior_'+_0x4a28ec[_0x530a1d(0x140)]()[_0x530a1d(0x19b)](/\s+/g,'_'),_0x3fabde=_0x530a1d(0x1d6)+_0x5822e3+'.'+_0x7736b1;console[_0x530a1d(0x306)]('\x0a'+a31_0x12b51f[_0x530a1d(0x287)](_0x4a28ec)+'\x20'+a31_0x12b51f[_0x530a1d(0x2dc)]('('+_0x5822e3+'.'+_0x7736b1+')'));try{const _0x6a2368=await executeSchemaQuery(_0x3fabde,_0x4c8c9a,_0x402f98);await handleQueryOutput(_0x6a2368,_0x402f98);}catch{console[_0x530a1d(0x306)](a31_0x12b51f[_0x530a1d(0x215)](_0x530a1d(0x26f)));}}return 0x0;}async[a31_0x4797a6(0x25c)](_0x388e4c,_0x3f1a25,_0x6091b3,_0x1cf531){const _0x52a8d3=a31_0x4797a6,{options:_0x6d18f1,tdx:_0x53e3e5}=_0x388e4c,_0x3d83e5=await withSpinner(_0x52a8d3(0x11c),()=>_0x53e3e5[_0x52a8d3(0x14c)]['getParentSQL'](_0x6091b3),{'verbose':_0x6d18f1[_0x52a8d3(0x282)]}),_0x25bb19=await executeSchemaQuery(_0x3d83e5['data'],_0x53e3e5,_0x6d18f1),_0x23e6af=_0x25bb19[_0x52a8d3(0x2a4)]['map'](_0x21b34e=>({'name':_0x21b34e[_0x52a8d3(0x236)],'type':_0x21b34e[_0x52a8d3(0x271)]})),_0x885622=await withSpinner(_0x52a8d3(0x22c),()=>_0x53e3e5[_0x52a8d3(0x14c)][_0x52a8d3(0x15d)](_0x6091b3),{'verbose':_0x6d18f1[_0x52a8d3(0x282)]}),_0xbc73a6=[];for(const _0x24b7f7 of _0x885622[_0x52a8d3(0x2a4)]){const _0x738d6d=_0x52a8d3(0x305)+_0x24b7f7[_0x52a8d3(0x140)]()[_0x52a8d3(0x19b)](/\s+/g,'_'),_0x13bace='SELECT\x20*\x20FROM\x20'+_0x1cf531+'.'+_0x738d6d;let _0x290036=[];try{const _0x55cb7f=await executeSchemaQuery(_0x13bace,_0x53e3e5,_0x6d18f1);_0x290036=_0x55cb7f[_0x52a8d3(0x2a4)][_0x52a8d3(0x1d5)](_0x39d450=>({'name':_0x39d450[_0x52a8d3(0x236)],'type':_0x39d450[_0x52a8d3(0x271)]}));}catch{}_0xbc73a6[_0x52a8d3(0x1e7)]({'table':_0x738d6d,'columns':_0x290036});}return{'database':_0x1cf531,'parent_segment':_0x3f1a25,'parent_id':_0x6091b3,'customers':{'table':_0x52a8d3(0x2e2),'columns':_0x23e6af},'behaviors':_0xbc73a6};}[a31_0x4797a6(0x220)](_0x2c798b){const _0x54c435=a31_0x4797a6,_0x105fcb=_0x424909=>{const _0x1781b8=a31_0x21b4;if(_0x424909['length']===0x0)return'[]';const _0x190ba2=_0x424909[_0x1781b8(0x1d5)](_0x5ac1ac=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x5ac1ac['name']+'\x22,\x20\x22type\x22:\x20\x22'+_0x5ac1ac[_0x1781b8(0x279)]+'\x22\x20}');return'[\x0a'+_0x190ba2[_0x1781b8(0x13f)](',\x0a')+_0x1781b8(0x290);},_0x1b625b=_0x2c798b[_0x54c435(0x275)]['map'](_0x32dc7d=>{const _0x55b36b=_0x54c435;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x32dc7d[_0x55b36b(0x262)]+_0x55b36b(0x160)+_0x105fcb(_0x32dc7d[_0x55b36b(0x207)])[_0x55b36b(0x19b)](/^/gm,'\x20\x20')[_0x55b36b(0x16a)]()+'\x0a\x20\x20\x20\x20}';})[_0x54c435(0x13f)](',\x0a');return _0x54c435(0x2d4)+_0x2c798b[_0x54c435(0x247)]+_0x54c435(0x30c)+_0x2c798b['parent_segment']+_0x54c435(0x1e3)+_0x2c798b['parent_id']+_0x54c435(0x21a)+_0x2c798b[_0x54c435(0x2e2)][_0x54c435(0x262)]+_0x54c435(0x1e1)+_0x105fcb(_0x2c798b[_0x54c435(0x2e2)][_0x54c435(0x207)])[_0x54c435(0x19b)](/^/gm,'\x20\x20')[_0x54c435(0x16a)]()+_0x54c435(0x252)+_0x1b625b+_0x54c435(0x2d1);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x106);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x166);async['execute'](_0x239a0b){const _0x5f5b86=a31_0x4797a6,{options:_0x488edf,args:_0x346fcf,tdx:_0x1e1a0c}=_0x239a0b,_0x4be6a8=_0x346fcf[0x0]||_0x488edf[_0x5f5b86(0x13d)];if(!_0x4be6a8)return showParentSegmentNotSetError(_0x5f5b86(0x185)+_0x5f5b86(0x304)),0x1;_0x488edf[_0x5f5b86(0x282)]&&(console[_0x5f5b86(0x306)](_0x5f5b86(0x31b)+_0x488edf[_0x5f5b86(0x1c2)]),console[_0x5f5b86(0x306)](_0x5f5b86(0x1b3)+_0x4be6a8));const _0x2f3389=await withSpinner(_0x5f5b86(0x2d3)+_0x4be6a8+_0x5f5b86(0x131),()=>_0x1e1a0c['segment']['resolveParentId'](_0x4be6a8),{'verbose':_0x488edf[_0x5f5b86(0x282)]}),_0x46c7da=_0x2f3389[_0x5f5b86(0x2a4)],_0x1bf406=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x4be6a8+_0x5f5b86(0x131),()=>_0x1e1a0c[_0x5f5b86(0x14c)]['getParentSQL'](_0x46c7da),{'verbose':_0x488edf[_0x5f5b86(0x282)]}),_0x160a42=_0x1bf406['data'];return _0x488edf['format']==='json'||_0x488edf[_0x5f5b86(0x1b6)]==='jsonl'?await handleSDKOutput([{'sql':_0x160a42}],_0x488edf):console[_0x5f5b86(0x225)](_0x160a42),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x295);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x174);async[a31_0x4797a6(0x152)](_0x39b431){const _0x441421=a31_0x4797a6,{options:_0x5d8012,args:_0x35c8ae,tdx:_0xdc64c3}=_0x39b431,_0x8c4b1a=_0x35c8ae[0x0]||_0x5d8012[_0x441421(0x13d)];if(!_0x8c4b1a)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'+'\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;_0x5d8012[_0x441421(0x282)]&&(console[_0x441421(0x306)]('Site:\x20'+_0x5d8012[_0x441421(0x1c2)]),console[_0x441421(0x306)](_0x441421(0x1b3)+_0x8c4b1a));const _0x4de5f0=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x8c4b1a+'\x27...',()=>_0xdc64c3[_0x441421(0x14c)]['resolveParentId'](_0x8c4b1a),{'verbose':_0x5d8012[_0x441421(0x282)]}),_0x382d81=_0x4de5f0[_0x441421(0x2a4)],_0x2a1f98=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x8c4b1a+_0x441421(0x131),()=>_0xdc64c3[_0x441421(0x14c)]['getParentSQL'](_0x382d81),{'verbose':_0x5d8012[_0x441421(0x282)]});let _0x442ad9=_0x2a1f98[_0x441421(0x2a4)];const _0x4841dd=resolveLimit(_0x5d8012[_0x441421(0x258)],DEFAULT_DISPLAY_LIMIT),_0x426873=/\bLIMIT\s+\d+/i[_0x441421(0x208)](_0x442ad9);!_0x426873&&(_0x442ad9=_0x442ad9[_0x441421(0x16a)]()[_0x441421(0x19b)](/;+$/,''),_0x442ad9=_0x441421(0x1b4)+_0x442ad9+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x4841dd);_0x5d8012[_0x441421(0x282)]&&console[_0x441421(0x306)](_0x441421(0xfe)+_0x442ad9);const _0x28c07e=await withProgressSpinner(_0x441421(0x201),async _0x520d07=>{const _0x5b4f1b=_0x441421,_0x1a163e=await _0xdc64c3[_0x5b4f1b(0x1b1)]['execute'](_0x442ad9,{'catalog':'td','schema':'information_schema','onJobId':_0xe0426b=>{_0x520d07['setJobId'](_0xe0426b);}});return _0x1a163e;},{'verbose':_0x5d8012[_0x441421(0x282)]}),_0x14f3bd=_0x28c07e[_0x441421(0x2a4)],_0x13ff48=_0x14f3bd['jobId']?'\x20[Job\x20ID:\x20'+_0x14f3bd['jobId']+']':'';return console[_0x441421(0x306)](_0x441421(0x124)+_0x14f3bd[_0x441421(0x214)][_0x441421(0x1a0)][_0x441421(0x2ec)]()+_0x441421(0x268)+(_0x441421(0x14d)+formatElapsed(_0x14f3bd[_0x441421(0x214)]['elapsedTimeMillis'])+_0x13ff48)),await handleQueryOutput(_0x14f3bd,_0x5d8012),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x2c5);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x30d);async['execute'](_0x7357e6){const _0x1cac30=a31_0x4797a6,{options:_0xb3caf5,args:_0x17f02b,tdx:_0x1a2b02}=_0x7357e6,_0x47a299=_0x17f02b[0x0],_0x5bc884=await withSpinner(_0x47a299?_0x1cac30(0x25d)+_0x47a299+_0x1cac30(0x131):_0x1cac30(0x1b9),()=>_0x1a2b02[_0x1cac30(0x20f)][_0x1cac30(0x24c)](),{'verbose':_0xb3caf5[_0x1cac30(0x282)]});let _0x1d7625=_0x5bc884[_0x1cac30(0x2a4)][_0x1cac30(0x19c)](_0x2f6260=>_0x2f6260[_0x1cac30(0x21e)]);if(_0x47a299){const _0x339e37=_0x47a299[_0x1cac30(0x19b)](/[.+^${}()|[\]\\]/g,_0x1cac30(0x198))[_0x1cac30(0x19b)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x37ca25=new RegExp('^'+_0x339e37+'$','i');_0x1d7625=_0x1d7625[_0x1cac30(0x19c)](_0x24362b=>_0x37ca25[_0x1cac30(0x208)](_0x24362b[_0x1cac30(0x15c)]));}_0x1d7625[_0x1cac30(0x2e8)]((_0x387fb5,_0x3c1a05)=>_0x387fb5['name'][_0x1cac30(0x1cf)](_0x3c1a05[_0x1cac30(0x15c)])),console[_0x1cac30(0x306)]('✔\x20Found\x20'+_0x1d7625['length']+_0x1cac30(0x23f)+(_0x1d7625[_0x1cac30(0x16c)]!==0x1?'s':''));const _0x97ec36=_0x22e724=>{const _0x59a5b4=_0x1cac30;return getConsoleNextUrl(_0xb3caf5['site'],_0x59a5b4(0x180)+_0x22e724);};if(_0xb3caf5[_0x1cac30(0x1b6)]===_0x1cac30(0x1bf)||_0xb3caf5[_0x1cac30(0x1b6)]==='jsonl'){const _0x566555=_0x1d7625[_0x1cac30(0x1d5)](_0x418993=>({..._0x418993,'url':_0x97ec36(_0x418993['id'])}));await handleSDKOutput(_0x566555,_0xb3caf5);}else{if(_0x1d7625[_0x1cac30(0x16c)]===0x0)console[_0x1cac30(0x225)](_0x1cac30(0x2f1));else for(const _0x41c867 of _0x1d7625){const _0x4cb155=_0x41c867[_0x1cac30(0x169)]?a31_0x12b51f['dim']('\x20('+formatRows(_0x41c867[_0x1cac30(0x169)])+')'):'',_0x3e6de2=hyperlink(_0x41c867[_0x1cac30(0x15c)],_0x97ec36(_0x41c867['id']));console[_0x1cac30(0x225)]('⚡\x20'+_0x3e6de2+_0x4cb155);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x2c0);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x1f9);async[a31_0x4797a6(0x152)](_0x2faa37){const _0x423829=a31_0x4797a6,{options:_0x323e57,args:_0x49f396,tdx:_0x275f13}=_0x2faa37,_0x15f308=_0x49f396[0x0]||_0x323e57[_0x423829(0x13d)];if(!_0x15f308)return showParentSegmentNotSetError(_0x423829(0x13c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment'),0x1;const _0x37c71e=resolveYamlFile(_0x15f308);if(!existsSync(_0x37c71e))return showFileNotFoundError(_0x37c71e,_0x15f308),0x1;let _0x2d59e2;try{_0x2d59e2=readFileSync(_0x37c71e,_0x423829(0x1aa));}catch(_0x2a3e0e){const _0x2dd396=_0x2a3e0e instanceof Error?_0x2a3e0e['message']:String(_0x2a3e0e);return console['error'](_0x423829(0x251)+_0x2dd396),0x1;}const _0x427ee=createCommandSpinner(a31_0x12b51f[_0x423829(0x2dc)](_0x423829(0x19a)),{'verbose':_0x323e57[_0x423829(0x282)]});_0x427ee['start']();const _0x4dc889={'realtime':!![],'onProgress':_0x43ee9c=>{_0x427ee['text']=formatProgressMessage(_0x43ee9c);}};let _0x5bcd61;try{_0x5bcd61=await _0x275f13[_0x423829(0x14c)]['validateParentYaml'](_0x2d59e2,_0x4dc889),_0x427ee[_0x423829(0x2bc)]();}catch(_0x5114e1){_0x427ee['stop']();throw _0x5114e1;}console[_0x423829(0x306)]('\x0a'+a31_0x12b51f[_0x423829(0x287)](_0x423829(0x1c0))+'\x20'+_0x5bcd61[_0x423829(0x15c)]),console[_0x423829(0x306)]('═'[_0x423829(0x112)](0x3c)),displayRealtimeValidation(_0x5bcd61),console['error']('─'[_0x423829(0x112)](0x3c));if(_0x5bcd61[_0x423829(0x128)]['length']>0x0){console[_0x423829(0x306)]('\x0a'+a31_0x12b51f[_0x423829(0x315)](_0x423829(0x1b7)));for(const _0x5f007a of _0x5bcd61[_0x423829(0x128)]){console[_0x423829(0x306)]('\x20\x20'+a31_0x12b51f[_0x423829(0x315)]('•')+'\x20'+_0x5f007a);}}return _0x5bcd61[_0x423829(0x191)]&&console[_0x423829(0x306)]('\x0a'+a31_0x12b51f[_0x423829(0x2db)]('✔')+_0x423829(0x1ee)),_0x5bcd61[_0x423829(0x191)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x11f);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x1db);async[a31_0x4797a6(0x152)](_0x38f05e){const _0x20d89f=a31_0x4797a6,{options:_0x14ed26,args:_0x23fcc8,tdx:_0x3fcd18}=_0x38f05e,_0x2145f4=_0x23fcc8[0x0]||_0x14ed26['parentSegment'];if(!_0x2145f4)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment'),0x1;_0x14ed26['verbose']&&(console[_0x20d89f(0x306)]('Site:\x20'+_0x14ed26['site']),console[_0x20d89f(0x306)]('Parent\x20segment:\x20'+_0x2145f4));const _0x3d42b6=await withSpinner(_0x20d89f(0x2d3)+_0x2145f4+'\x27...',()=>_0x3fcd18[_0x20d89f(0x14c)]['resolveParentId'](_0x2145f4),{'verbose':_0x14ed26[_0x20d89f(0x282)]}),_0x4fdbc1=_0x3d42b6['data'],_0x49b4be=await withSpinner(_0x20d89f(0x200)+_0x2145f4+_0x20d89f(0x131),()=>_0x3fcd18[_0x20d89f(0x20f)][_0x20d89f(0x2aa)](_0x4fdbc1),{'verbose':_0x14ed26[_0x20d89f(0x282)]}),_0x1c79d7=_0x49b4be[_0x20d89f(0x2a4)];console[_0x20d89f(0x306)](_0x20d89f(0x150)+_0x1c79d7[_0x20d89f(0x16c)]+_0x20d89f(0x284)+(_0x1c79d7['length']!==0x1?'s':''));if(_0x14ed26[_0x20d89f(0x1b6)]===_0x20d89f(0x1bf)||_0x14ed26[_0x20d89f(0x1b6)]===_0x20d89f(0x1bc))await handleSDKOutput(_0x1c79d7,_0x14ed26);else{if(_0x1c79d7[_0x20d89f(0x16c)]===0x0)console[_0x20d89f(0x225)](_0x20d89f(0x134));else for(const _0x229d49 of _0x1c79d7){const _0x1319a8=_0x229d49[_0x20d89f(0x199)]==='launched'?'🚀':'📝',_0x2a1626=_0x229d49[_0x20d89f(0x1eb)]?a31_0x12b51f[_0x20d89f(0x215)](_0x20d89f(0x216)):'',_0x7445e0=a31_0x12b51f[_0x20d89f(0x2dc)]('\x20('+_0x229d49['stageCount']+_0x20d89f(0x1a2)+(_0x229d49[_0x20d89f(0x1ca)]!==0x1?'s':'')+')');console[_0x20d89f(0x225)](_0x1319a8+'\x20'+_0x229d49[_0x20d89f(0x15c)]+_0x2a1626+_0x7445e0);}}return 0x0;}}function a31_0x21b4(_0xbc01ba,_0x36b9c5){_0xbc01ba=_0xbc01ba-0xfe;const _0xbd54f9=a31_0xbd54();let _0x21b421=_0xbd54f9[_0xbc01ba];return _0x21b421;}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x203);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x234);async[a31_0x4797a6(0x152)](_0x3b03f9){const _0x239fd7=a31_0x4797a6,{options:_0x21af68,args:_0x4f3450,tdx:_0x34e42f}=_0x3b03f9,_0x111dff=_0x4f3450[0x0];if(!_0x111dff)return console['error'](a31_0x12b51f[_0x239fd7(0x315)](_0x239fd7(0x2e3))),console[_0x239fd7(0x306)](_0x239fd7(0x1b8)),console['error'](a31_0x12b51f[_0x239fd7(0x2dc)](_0x239fd7(0x286))),0x1;_0x21af68[_0x239fd7(0x282)]&&(console[_0x239fd7(0x306)]('Site:\x20'+_0x21af68[_0x239fd7(0x1c2)]),console[_0x239fd7(0x306)](_0x239fd7(0x136)+_0x111dff));const _0x419348=await withSpinner(_0x239fd7(0x29f)+_0x111dff+'\x27...',()=>_0x34e42f[_0x239fd7(0x20f)][_0x239fd7(0x223)](_0x111dff),{'verbose':_0x21af68[_0x239fd7(0x282)]}),_0x4b5753=_0x419348['data'];console[_0x239fd7(0x306)](_0x239fd7(0x293)+_0x4b5753[_0x239fd7(0x15c)]+'\x27');if(_0x21af68[_0x239fd7(0x1b6)]===_0x239fd7(0x1bf)||_0x21af68[_0x239fd7(0x1b6)]===_0x239fd7(0x1bc))await handleSDKOutput([_0x4b5753],_0x21af68);else{const _0x1cc057=_0x4b5753['state']===_0x239fd7(0x2ce)?'🚀':'📝',_0x1e453f=_0x4b5753[_0x239fd7(0x1eb)]?a31_0x12b51f['yellow'](_0x239fd7(0x216)):'';console[_0x239fd7(0x225)](_0x1cc057+'\x20'+_0x4b5753[_0x239fd7(0x15c)]+_0x1e453f);}return 0x0;}}function a31_0xbd54(){const _0x56ef72=['stringify','run','\x5c$&','state','Validating\x20RT\x20configuration...','replace','filter','✔\x20Updated\x20personalization\x20\x27','\x27\x20with\x20ID:\x20','parentFolder','processedRows','displaySummary','\x20stage','Schema\x20saved\x20to\x20','Options\x20(one\x20required):\x0a','\x20\x20\x20\x20\x20\x20','Aborted.','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','eventKind','utf-8','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','folderId','List\x20parent\x20segments','/\x20directories\x20exist.','\x20\x20\x20','Fetching\x20personalization\x20service\x20\x27','query','\x20true','Parent\x20segment:\x20','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20--behavior\x20requires\x20a\x20name\x0a','format','Errors:','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','Listing\x20RT-enabled\x20parent\x20segments...','behavior','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','jsonl','ignore','some','json','RT\x202.0\x20Validate:','\x20parent\x20segment\x20\x27','site','Create\x20a\x20realtime\x20personalization\x20entity','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','listParents','single','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','scheduleOption','stageCount','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','✔\x20Created\x20personalization\x20\x27','foreignKey','localeCompare','getCurrentConfigVersion','Analyzing\x20changes...','\x27\x20is\x20already\x20up\x20to\x20date','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','segment:parent:preview','map','SELECT\x20*\x20FROM\x20','Creating','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','\x20service(s)\x20configured','\x20Added\x20RT\x202.0\x20template\x20section','List\x20RT\x20journeys','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','ps:rt:configuration_versions','No\x20personalizations\x20configured','Fetching\x20sample\x20data...','Master\x20+\x20Attributes','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Preview:','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','coveragePercent','createParent','push','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Join\x20on:','patch','paused','scheduleType','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','\x20RT\x20configuration\x20is\x20valid','\x20\x20Note:\x20','segment:parent:validate','updatedAt','\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','No\x20parent\x20segments\x20found','\x20=\x20','displayBehaviorsStats','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','Updating\x20parent\x20segment\x20\x27','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','ps:pz:service:list','Attempt:','yes','.yml','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20personalization\x20service','Listing\x20RT\x20journeys\x20for\x20\x27','Executing\x20parent\x20segment\x20query...','Created','ps:rt:jn:pause','Fetching\x20current\x20configuration\x20for\x20\x27','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','column','columns','test','No\x20personalization\x20services\x20configured','rowCount','reduce','Updating\x20personalization\x20service\x20\x27','✔\x20Created\x20personalization\x20service\x20\x27','✔\x20Deleted\x20token\x20\x27','realtime','\x20--behavior\x20\x22','Options:\x0a','YAML\x20file:\x20','identifier','stats','yellow','\x20(paused)','value','validateParentYaml','\x20Added\x20personalization\x20template\x20to\x20','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','idStitching','Show\x20a\x20specific\x20realtime\x20personalization','Error:\x20File\x20not\x20found:\x20','realtime_enabled','Attributes','formatSchemaJson','Overwrite\x20\x27','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','pauseJourney','Status:','log','valid','/\x20and\x20','\x20service','listFields','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','identifier:\x20','Fetching\x20behavior\x20list...','Table:\x20','\x20No\x20changes\x20-\x20','To\x20cancel:','sourceTableError','toFixed','tokens','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Pause\x20activations\x20in\x20an\x20RT\x20journey','keyEventId','column_name','Events:','%)\x20','✔\x20Deleted\x20personalization\x20service\x20\x27','Error:\x20Service\x20name\x20is\x20required','\x20\x20No\x20sample\x20data\x20available','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Database:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x20RT-enabled\x20parent\x20segment','personalization_services','customerGroupFile','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','displayPreviewHints','attributesFile','List\x20available\x20fields\x20for\x20segmentation','user_id','database','ps:pz:delete','✔\x20No\x20changes\x20-\x20\x27','\x20\x20\x20\x20-\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','list','interval','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','Output\x20file:\x20','endsWith','Error\x20reading\x20file:\x20','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\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','Join:','804798zaNQGL','\x20field','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','limit','6811021LiKWNq','\x20--enriched','keyEventId:','collectSchema','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','true','sampleData','workflowAttemptId','realtime:','table','double','personalization','\x0a⚠️\x20\x20Migrating:\x20','tdx\x20ps\x20preview\x20','Options:','\x20rows\x20','Validate:','\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','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','\x20parent\x20segment','Found\x20YAML\x20file:\x20','/sessions/','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','/\x20→\x20','column_type','FINISHED','displayMasterInfo','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','behaviors','deletePersonalization','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','audienceId:','type','attribute','Listing\x20personalization\x20services\x20for\x20\x27','Listing\x20personalizations\x20for\x20\x27','allowedIps','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','\x20--behavior\x20\x22<name>\x22','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','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','verbose','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','\x20RT\x20journey','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','bold','matchedCount','✔\x20Updated\x20parent\x20segment\x20\x27','ID\x20Stitching:','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','folder-segment','Error:\x20Token\x20\x27','✔\x20Retrieved\x20RT\x20configuration\x20version','\x20personalization','\x0a\x20\x20\x20\x20]','eventKind:\x20','created:','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','public:','segment:parent:show','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','✔\x20Deleted\x20personalization\x20\x27','\x27\x20and\x20run\x20workflow?','segment:parent:list','\x0aNew\x20parent\x20segment\x20\x27','Show\x20personalization\x20service\x20details','output','deleteToken','\x20--interval\x20','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','4800756dEdanO','number','Fetching\x20parent\x20segment\x20\x27','ps:pz:patch','data','customerPercent','displaySampleData','Error:','getOutputDatabaseName','Patching\x20personalization\x20\x27','listJourneys','token:','\x0aNo\x20sample\x20data\x20available','(id:\x20','✔\x20Updated\x20personalization\x20service\x20\x27','pushParentYaml','dirname','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x20Opening\x20','6331680kGgKMI','Error:\x20Service\x20ID\x20is\x20required','ps:pz:create','personalizationServices','attributes','events','Output\x20Database:','segment:parent:pull','listPersonalizations','stop','ps:pz:service:delete','Name:\x20','Show\x20parent\x20segment\x20details','ps:rt:validate','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parent_segment','`\x20to\x20download\x20the\x20configuration\x20first','\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}','ps:rt:list','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','win32','Session:','190dWqiYB','Validating\x20configuration...','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','addAttributesFile','Error:\x20--attribute\x20requires\x20a\x20name\x0a','launched','match','delete','\x0a\x20\x20]\x0a}\x0a','\x27\x20is\x20up\x20to\x20date','Resolving\x20parent\x20segment\x20\x27','{\x0a\x20\x20\x22database\x22:\x20\x22','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','previewParentYaml','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','\x20rows)','create','Audience\x20ID:','green','dim','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','Available\x20behaviors:','segment:parent:view','ps:rt:jn:resume','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','customers','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','✔\x20Created\x20parent\x20segment\x20\x27','Available\x20attributes:','Getting\x20personalization\x20\x27','sort','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Behaviors','description','toLocaleString','sourceTableValid','Deleting\x20personalization\x20\x27','entryCriteria','\x20--attribute\x20\x22','No\x20RT-enabled\x20parent\x20segments\x20found','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','schemaValid','td_client_id','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','ps:pz:service:token:create','stitchingKeys','\x20\x201.\x20Edit\x20','Get\x20current\x20RT\x20configuration\x20version\x20status','createToken','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','page_view','totalEvents','master','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','\x20to\x20push\x20the\x20configuration','status','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','\x20Configuration\x20is\x20valid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','behavior_','error','patchPersonalization','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','enabled','Customers:','apply','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Updated','Deleting\x20personalization\x20service\x20\x27','customerGroup','\x0aError:','✔\x20Found\x20personalization\x20\x27','Listing\x20fields\x20for\x20\x27','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','1995778gZwxlk','ps:pz:service:show','Site:\x20','null','SQL\x20query:\x0a','relationships','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','includeSensitive:','tdx\x20ps\x20push\x20','\x0a⚠️\x20\x20Both\x20','file','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','segment:parent:sql','<database>.<table>','audienceId','using\x20the\x20default\x20path:\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x20\x20\x20\x20','ps:pz:service:create','getParentFull','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x27\x20for\x20service\x20\x27','schemaError','entryCriteria:','repeat','71530FNGrWL','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','label','\x0aChanges\x20to\x20apply\x20to\x20\x27','enriched','Listing\x20parent\x20segments\x20matching\x20\x27','displayPreviewResults','Apply\x20changes\x20to\x20\x27','updated:','Fetching\x20customers\x20schema...','Coverage:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','ps:rt:jn:list','Personalization\x20service\x20description','Personalization:','sections:','No\x20parent\x20segments\x20match\x20pattern:\x20','✔\x20Query\x20completed:\x20Processed\x20','allowed\x20IPs:','/{name}.yml\x0a','resolveParentId','errors','Error:\x20Personalization\x20ID\x20is\x20required','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Source:','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','string','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','sections','customersWithEvents','\x27...','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','addBehaviorsFile','No\x20RT\x20journeys\x20found','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','RT\x20Journey\x20ID:\x20','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','preview','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','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','parentSegment','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','join','toLowerCase','displayColumns','status:\x20','👥\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','\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','xdg-open','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','\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','64LhCXwJ','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','segment','in\x20','\x20kill','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','✔\x20Found\x20','start','execute','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Error:\x20--database\x20and\x20--table\x20are\x20required','Update\x20a\x20realtime\x20personalization\x20entity','.yaml','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','text','Error\x20parsing\x20YAML:\x20','1lCsFri','name','getBehaviorNames','public','Next\x20steps:','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','segment:parent:run','My\x20Service','-1d','addBehaviors','Master\x20Table','Get\x20SQL\x20query\x20for\x20parent\x20segment','get','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','population','trim','joinKey','length','/\x20directory.\x0a','/attempt/','Error:\x20Token\x20ID\x20is\x20required','Create\x20parent\x20segment\x20\x27','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','displayRealtimeInfo','varchar','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','timezone','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Default','runParent','Creating\x20personalization\x20\x27','no\x20tokens\x20configured','displayValidateResults','Error:\x20Parent\x20segment\x20name\x20is\x20required','split','/app/dw/parentSegments/','ps:pz:service:update','message','Finding\x20service\x20for\x20token...','web','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','any','getParentSQL','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','id:\x20','1219761pPivAL','keyEventCriteria','use','Updating','.customers)','\x0aUsage:\x20tdx\x20ps\x20preview\x20','ps:pz:init','allValid','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','last_page_viewed','displayAttributesStats','all'];a31_0xbd54=function(){return _0x56ef72;};return a31_0xbd54();}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x2e0);['description']='Resume\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x4797a6(0x152)](_0x3c554b){const _0x314db4=a31_0x4797a6,{options:_0x29aba2,args:_0x32e5e8,tdx:_0x3f03a1}=_0x3c554b,_0x4b9fdf=_0x32e5e8[0x0];if(!_0x4b9fdf)return console[_0x314db4(0x306)](a31_0x12b51f[_0x314db4(0x315)](_0x314db4(0x2e3))),console[_0x314db4(0x306)](_0x314db4(0x14f)),console['error'](a31_0x12b51f['dim'](_0x314db4(0x286))),0x1;_0x29aba2[_0x314db4(0x282)]&&(console[_0x314db4(0x306)]('Site:\x20'+_0x29aba2['site']),console[_0x314db4(0x306)](_0x314db4(0x136)+_0x4b9fdf));const _0x536623=await withSpinner(_0x314db4(0x2dd)+_0x4b9fdf+_0x314db4(0x131),()=>_0x3f03a1[_0x314db4(0x20f)]['resumeJourney'](_0x4b9fdf),{'verbose':_0x29aba2[_0x314db4(0x282)]}),_0x50abaa=_0x536623['data'];console[_0x314db4(0x306)](_0x314db4(0x1d3)+_0x50abaa[_0x314db4(0x15c)]+'\x27');if(_0x29aba2['format']===_0x314db4(0x1bf)||_0x29aba2[_0x314db4(0x1b6)]===_0x314db4(0x1bc))await handleSDKOutput([_0x50abaa],_0x29aba2);else{const _0x1312a6=_0x50abaa['state']===_0x314db4(0x2ce)?'🚀':'📝',_0x16cc29=_0x50abaa[_0x314db4(0x1eb)]?a31_0x12b51f[_0x314db4(0x215)](_0x314db4(0x216)):'';console[_0x314db4(0x225)](_0x1312a6+'\x20'+_0x50abaa[_0x314db4(0x15c)]+_0x16cc29);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']=a31_0x4797a6(0x1dd);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x2f9);async[a31_0x4797a6(0x152)](_0x5d539f){const _0x4ae55d=a31_0x4797a6,{options:_0x21ba2e,args:_0x5ad45c,tdx:_0x2f6605}=_0x5d539f,_0x25bd88=_0x5ad45c[0x0]||_0x21ba2e[_0x4ae55d(0x13d)];if(!_0x25bd88)return showParentSegmentNotSetError(_0x4ae55d(0x13e)+_0x4ae55d(0x145)),0x1;_0x21ba2e['verbose']&&(console[_0x4ae55d(0x306)](_0x4ae55d(0x31b)+_0x21ba2e[_0x4ae55d(0x1c2)]),console['error'](_0x4ae55d(0x1b3)+_0x25bd88));const _0x53b45b=await withSpinner(_0x4ae55d(0x2d3)+_0x25bd88+'\x27...',()=>_0x2f6605[_0x4ae55d(0x14c)][_0x4ae55d(0x127)](_0x25bd88),{'verbose':_0x21ba2e['verbose']}),_0x41cd29=_0x53b45b[_0x4ae55d(0x2a4)],_0x24101b=await withSpinner(_0x4ae55d(0x1a8)+_0x25bd88+_0x4ae55d(0x131),()=>_0x2f6605[_0x4ae55d(0x20f)][_0x4ae55d(0x1d0)](_0x41cd29),{'verbose':_0x21ba2e['verbose']}),_0x1a5aab=_0x24101b[_0x4ae55d(0x2a4)];return console['error'](_0x4ae55d(0x28e)),_0x21ba2e['format']===_0x4ae55d(0x1bf)||_0x21ba2e[_0x4ae55d(0x1b6)]===_0x4ae55d(0x1bc)?await handleSDKOutput([_0x1a5aab],_0x21ba2e):(console['log'](_0x4ae55d(0x189)+_0x1a5aab['id']),console[_0x4ae55d(0x225)]('audienceId:\x20'+_0x1a5aab[_0x4ae55d(0x108)]),console['log'](_0x4ae55d(0x22b)+_0x1a5aab[_0x4ae55d(0x213)]),console[_0x4ae55d(0x225)](_0x4ae55d(0x291)+_0x1a5aab[_0x4ae55d(0x1a9)]),console[_0x4ae55d(0x225)](_0x4ae55d(0x142)+_0x1a5aab['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{['name']=a31_0x4797a6(0x1fa);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x12c);async[a31_0x4797a6(0x152)](_0x5b0765){const _0x18dc93=a31_0x4797a6,{options:_0x4c3bfb,args:_0x59c4cc,tdx:_0x1962c0}=_0x5b0765,_0x195e5d=_0x59c4cc[0x0]||_0x4c3bfb[_0x18dc93(0x13d)];if(!_0x195e5d)return showParentSegmentNotSetError(_0x18dc93(0x2f2)+_0x18dc93(0x1f2)),0x1;const _0x3ebd90=await withSpinner(_0x18dc93(0x2d3)+_0x195e5d+_0x18dc93(0x131),()=>_0x1962c0[_0x18dc93(0x14c)]['resolveParentId'](_0x195e5d),{'verbose':_0x4c3bfb[_0x18dc93(0x282)]}),_0x25a2de=_0x3ebd90[_0x18dc93(0x2a4)],_0x56af9f=await withSpinner(_0x18dc93(0x27b)+_0x195e5d+_0x18dc93(0x131),()=>_0x1962c0[_0x18dc93(0x264)]['list'](_0x25a2de),{'verbose':_0x4c3bfb[_0x18dc93(0x282)]}),_0xf2d8f5=_0x56af9f[_0x18dc93(0x2a4)];console[_0x18dc93(0x306)](_0x18dc93(0x150)+_0xf2d8f5[_0x18dc93(0x16c)]+_0x18dc93(0x1ff)+(_0xf2d8f5[_0x18dc93(0x16c)]!==0x1?'s':''));if(_0x4c3bfb[_0x18dc93(0x1b6)]===_0x18dc93(0x1bf)||_0x4c3bfb['format']===_0x18dc93(0x1bc))await handleSDKOutput(_0xf2d8f5,_0x4c3bfb);else{if(_0xf2d8f5[_0x18dc93(0x16c)]===0x0)console[_0x18dc93(0x225)](_0x18dc93(0x209)),console[_0x18dc93(0x306)](a31_0x12b51f[_0x18dc93(0x137)](_0x18dc93(0x257)));else for(const _0x17a8ab of _0xf2d8f5){console[_0x18dc93(0x225)](a31_0x12b51f[_0x18dc93(0x287)](_0x17a8ab[_0x18dc93(0x15c)])+'\x20'+a31_0x12b51f[_0x18dc93(0x2dc)]('(id:\x20'+_0x17a8ab['id']+')'));_0x17a8ab[_0x18dc93(0x2eb)]&&console[_0x18dc93(0x225)]('\x20\x20'+a31_0x12b51f[_0x18dc93(0x2dc)](_0x17a8ab['description']));if(_0x17a8ab[_0x18dc93(0x232)]&&_0x17a8ab[_0x18dc93(0x232)][_0x18dc93(0x16c)]>0x0)for(const _0x175d0e of _0x17a8ab['tokens']){const _0x10103f=_0x175d0e[_0x18dc93(0x27d)]?.['length']?_0x175d0e[_0x18dc93(0x27d)][_0x18dc93(0x13f)](',\x20'):_0x18dc93(0x186);console[_0x18dc93(0x225)]('\x20\x20'+a31_0x12b51f[_0x18dc93(0x137)](_0x18dc93(0x2ab))+'\x20'+_0x175d0e[_0x18dc93(0x15c)]+'\x20'+a31_0x12b51f[_0x18dc93(0x2dc)](_0x18dc93(0x2ad)+_0x175d0e['id']+')')),console[_0x18dc93(0x225)](_0x18dc93(0x10b)+a31_0x12b51f[_0x18dc93(0x2dc)](_0x18dc93(0x125))+'\x20'+_0x10103f);}else console[_0x18dc93(0x225)]('\x20\x20'+a31_0x12b51f['dim'](_0x18dc93(0x17c)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x10c);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x171);async[a31_0x4797a6(0x152)](_0x591921){const _0x29be4e=a31_0x4797a6,{options:_0x105a18,args:_0x21dd1a,tdx:_0x11eb6f}=_0x591921,_0x10b7a2=_0x105a18,_0x44e1b4=_0x21dd1a[0x0],_0x488c87=_0x21dd1a[0x1]||_0x105a18[_0x29be4e(0x13d)];if(!_0x44e1b4)return console[_0x29be4e(0x306)](_0x29be4e(0x23a)),console[_0x29be4e(0x306)](_0x29be4e(0x26b)),console[_0x29be4e(0x306)](_0x29be4e(0x22a)),0x1;if(!_0x488c87)return showParentSegmentNotSetError(_0x29be4e(0x1cc)+_0x29be4e(0x22a)),0x1;const _0x2619b4=await withSpinner(_0x29be4e(0x2d3)+_0x488c87+'\x27...',()=>_0x11eb6f[_0x29be4e(0x14c)]['resolveParentId'](_0x488c87),{'verbose':_0x105a18[_0x29be4e(0x282)]}),_0x52ab96=_0x2619b4[_0x29be4e(0x2a4)],_0xf4a3d8={'name':_0x44e1b4,'description':_0x10b7a2[_0x29be4e(0x2eb)],'public':_0x10b7a2[_0x29be4e(0x15e)]},_0x3c00d6=await withSpinner('Creating\x20personalization\x20service\x20\x27'+_0x44e1b4+'\x27...',()=>_0x11eb6f['personalization'][_0x29be4e(0x2d9)](_0x52ab96,_0xf4a3d8),{'verbose':_0x105a18['verbose']}),_0x556739=_0x3c00d6[_0x29be4e(0x2a4)];return console[_0x29be4e(0x306)](_0x29be4e(0x20d)+_0x556739['name']+_0x29be4e(0x19e)+_0x556739['id']),await handleSDKOutput([_0x556739],_0x105a18),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x31a);['description']=a31_0x4797a6(0x29b);async[a31_0x4797a6(0x152)](_0x195349){const _0x38d4da=a31_0x4797a6,{options:_0x4c98b4,args:_0x1792e8,tdx:_0x97bbaf}=_0x195349,_0xbd0b90=_0x1792e8[0x0],_0x233d23=_0x1792e8[0x1]||_0x4c98b4['parentSegment'];if(!_0xbd0b90)return console[_0x38d4da(0x306)](_0x38d4da(0x2b4)),console[_0x38d4da(0x306)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x38d4da(0x306)](_0x38d4da(0x317)),0x1;if(!_0x233d23)return showParentSegmentNotSetError(_0x38d4da(0x24b)+_0x38d4da(0x317)),0x1;const _0x458862=await withSpinner(_0x38d4da(0x2d3)+_0x233d23+_0x38d4da(0x131),()=>_0x97bbaf[_0x38d4da(0x14c)][_0x38d4da(0x127)](_0x233d23),{'verbose':_0x4c98b4['verbose']}),_0x375e2a=_0x458862[_0x38d4da(0x2a4)],_0x12c286=await withSpinner(_0x38d4da(0x1b0)+_0xbd0b90+_0x38d4da(0x131),()=>_0x97bbaf[_0x38d4da(0x264)][_0x38d4da(0x167)](_0x375e2a,_0xbd0b90),{'verbose':_0x4c98b4[_0x38d4da(0x282)]}),_0x2ec6c7=_0x12c286['data'];if(_0x4c98b4[_0x38d4da(0x1bf)]||_0x4c98b4[_0x38d4da(0x1bc)])await handleSDKOutput([_0x2ec6c7],_0x4c98b4);else{console['log'](a31_0x12b51f[_0x38d4da(0x287)](_0x2ec6c7[_0x38d4da(0x15c)])+'\x20'+a31_0x12b51f[_0x38d4da(0x2dc)]('(id:\x20'+_0x2ec6c7['id']+')'));_0x2ec6c7[_0x38d4da(0x2eb)]&&console[_0x38d4da(0x225)]('\x20\x20'+a31_0x12b51f['dim'](_0x2ec6c7[_0x38d4da(0x2eb)]));console[_0x38d4da(0x225)]('\x20\x20'+a31_0x12b51f[_0x38d4da(0x137)](_0x38d4da(0x294))+'\x20'+(_0x2ec6c7[_0x38d4da(0x15e)]?_0x38d4da(0x1fc):'no'));if(_0x2ec6c7['tokens']&&_0x2ec6c7[_0x38d4da(0x232)][_0x38d4da(0x16c)]>0x0)for(const _0x3d7699 of _0x2ec6c7['tokens']){const _0x599c72=_0x3d7699[_0x38d4da(0x27d)]?.[_0x38d4da(0x16c)]?_0x3d7699[_0x38d4da(0x27d)]['join'](',\x20'):'any';console['log']('\x20\x20'+a31_0x12b51f[_0x38d4da(0x137)]('token:')+'\x20'+_0x3d7699['name']+'\x20'+a31_0x12b51f['dim'](_0x38d4da(0x2ad)+_0x3d7699['id']+')')),console[_0x38d4da(0x225)]('\x20\x20\x20\x20'+a31_0x12b51f[_0x38d4da(0x2dc)](_0x38d4da(0x125))+'\x20'+_0x599c72);}else console[_0x38d4da(0x225)]('\x20\x20'+a31_0x12b51f[_0x38d4da(0x2dc)](_0x38d4da(0x17c)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']=a31_0x4797a6(0x2bd);[a31_0x4797a6(0x2eb)]='Delete\x20a\x20personalization\x20service';async[a31_0x4797a6(0x152)](_0x331e61){const _0xb55c25=a31_0x4797a6,{options:_0x22edd9,args:_0xf49dd7,tdx:_0x3beacb}=_0x331e61,_0x4e2c5a=_0xf49dd7[0x0],_0x28c7a0=_0xf49dd7[0x1]||_0x22edd9[_0xb55c25(0x13d)];if(!_0x4e2c5a)return console[_0xb55c25(0x306)](_0xb55c25(0x2b4)),console[_0xb55c25(0x306)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0xb55c25(0x306)](_0xb55c25(0x27e)),0x1;if(!_0x28c7a0)return showParentSegmentNotSetError(_0xb55c25(0x24e)+_0xb55c25(0x27e)),0x1;const _0xf3e89=await withSpinner(_0xb55c25(0x2d3)+_0x28c7a0+'\x27...',()=>_0x3beacb['segment'][_0xb55c25(0x127)](_0x28c7a0),{'verbose':_0x22edd9['verbose']}),_0x48a564=_0xf3e89[_0xb55c25(0x2a4)];return await withSpinner(_0xb55c25(0x310)+_0x4e2c5a+_0xb55c25(0x131),()=>_0x3beacb[_0xb55c25(0x264)][_0xb55c25(0x2d0)](_0x48a564,_0x4e2c5a),{'verbose':_0x22edd9['verbose']}),console[_0xb55c25(0x306)](_0xb55c25(0x239)+_0x4e2c5a+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x181);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x1ed);async[a31_0x4797a6(0x152)](_0x21664c){const _0x518c51=a31_0x4797a6,{options:_0x15a179,args:_0x33b81d,tdx:_0x12e965}=_0x21664c,_0x125bf2=_0x15a179,_0x2e10e8=_0x33b81d[0x0],_0x1aebc6=_0x33b81d[0x1]||_0x15a179['parentSegment'];if(!_0x2e10e8)return console['error'](_0x518c51(0x2b4)),console[_0x518c51(0x306)](_0x518c51(0x2cb)),console[_0x518c51(0x306)](_0x518c51(0x138)),0x1;if(!_0x125bf2['name'])return console[_0x518c51(0x306)]('Error:\x20--name\x20is\x20required'),console[_0x518c51(0x306)](_0x518c51(0x2cb)),0x1;if(!_0x1aebc6)return showParentSegmentNotSetError(_0x518c51(0x100)+_0x518c51(0x138)),0x1;const _0x360365=await withSpinner(_0x518c51(0x2d3)+_0x1aebc6+_0x518c51(0x131),()=>_0x12e965[_0x518c51(0x14c)]['resolveParentId'](_0x1aebc6),{'verbose':_0x15a179[_0x518c51(0x282)]}),_0x512375=_0x360365['data'],_0x1a322a={'name':_0x125bf2[_0x518c51(0x15c)]};_0x125bf2[_0x518c51(0x2eb)]!==undefined&&(_0x1a322a[_0x518c51(0x2eb)]=_0x125bf2[_0x518c51(0x2eb)]);const _0x4dda2f=await withSpinner(_0x518c51(0x20c)+_0x2e10e8+'\x27...',()=>_0x12e965['personalization'][_0x518c51(0x1ea)](_0x512375,_0x2e10e8,_0x1a322a),{'verbose':_0x15a179[_0x518c51(0x282)]}),_0x5b23b1=_0x4dda2f['data'];return console[_0x518c51(0x306)](_0x518c51(0x2ae)+_0x5b23b1['name']+'\x27'),await handleSDKOutput([_0x5b23b1],_0x15a179),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x2f6);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x233);async[a31_0x4797a6(0x152)](_0x6b9e7d){const _0x542d48=a31_0x4797a6,{options:_0x3b7d77,args:_0x20600a,tdx:_0x434ae6}=_0x6b9e7d,_0x2864bc=_0x3b7d77,_0x57d27a=_0x20600a[0x0],_0x16dc2e=_0x20600a[0x1],_0x5960ad=_0x20600a[0x2]||_0x3b7d77[_0x542d48(0x13d)];if(!_0x57d27a)return console[_0x542d48(0x306)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x542d48(0x306)](_0x542d48(0x2ff)),console[_0x542d48(0x306)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x16dc2e)return console[_0x542d48(0x306)](_0x542d48(0x2b4)),console[_0x542d48(0x306)](_0x542d48(0x2ff)),console[_0x542d48(0x306)](_0x542d48(0x14a)),0x1;if(!_0x5960ad)return showParentSegmentNotSetError(_0x542d48(0x1c7)+_0x542d48(0x14a)),0x1;const _0x3e72dc=await withSpinner(_0x542d48(0x2d3)+_0x5960ad+'\x27...',()=>_0x434ae6['segment'][_0x542d48(0x127)](_0x5960ad),{'verbose':_0x3b7d77[_0x542d48(0x282)]}),_0x4962f1=_0x3e72dc[_0x542d48(0x2a4)],_0x5c7e66={'name':_0x57d27a};_0x2864bc[_0x542d48(0x27d)]&&(_0x5c7e66[_0x542d48(0x27d)]=_0x2864bc[_0x542d48(0x27d)][_0x542d48(0x17f)](',')[_0x542d48(0x1d5)](_0x10b02c=>_0x10b02c[_0x542d48(0x16a)]()));_0x2864bc['description']&&(_0x5c7e66[_0x542d48(0x2eb)]=_0x2864bc[_0x542d48(0x2eb)]);const _0x478187=await withSpinner('Creating\x20token\x20\x27'+_0x57d27a+_0x542d48(0x10f)+_0x16dc2e+_0x542d48(0x131),()=>_0x434ae6[_0x542d48(0x264)][_0x542d48(0x2fa)](_0x4962f1,_0x16dc2e,_0x5c7e66),{'verbose':_0x3b7d77[_0x542d48(0x282)]}),_0x38cbe3=_0x478187[_0x542d48(0x2a4)];return console[_0x542d48(0x306)]('✔\x20Created\x20token\x20\x27'+_0x38cbe3['name']+'\x27\x20with\x20ID:\x20'+_0x38cbe3['id']),_0x38cbe3[_0x542d48(0x217)]&&(console[_0x542d48(0x306)](a31_0x12b51f[_0x542d48(0x215)]('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console['error'](a31_0x12b51f[_0x542d48(0x137)](_0x38cbe3[_0x542d48(0x217)])),console[_0x542d48(0x306)]('')),await handleSDKOutput([_0x38cbe3],_0x3b7d77),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x4797a6(0x15c)]='ps:pz:service:token:delete';[a31_0x4797a6(0x2eb)]='Delete\x20a\x20token\x20from\x20a\x20personalization\x20service';async['execute'](_0x2b640b){const _0x98c921=a31_0x4797a6,{options:_0x462756,args:_0x48af96,tdx:_0x1cf7ab}=_0x2b640b,_0x577226=_0x48af96[0x0],_0x5bea3b=_0x48af96[0x1]||_0x462756[_0x98c921(0x13d)];if(!_0x577226)return console[_0x98c921(0x306)](_0x98c921(0x16f)),console[_0x98c921(0x306)](_0x98c921(0x296)),console[_0x98c921(0x306)](_0x98c921(0x316)),0x1;if(!_0x5bea3b)return showParentSegmentNotSetError(_0x98c921(0x285)+_0x98c921(0x316)),0x1;const _0x3a4e5e=await withSpinner(_0x98c921(0x2d3)+_0x5bea3b+_0x98c921(0x131),()=>_0x1cf7ab[_0x98c921(0x14c)]['resolveParentId'](_0x5bea3b),{'verbose':_0x462756[_0x98c921(0x282)]}),_0x21002f=_0x3a4e5e[_0x98c921(0x2a4)],_0x32f90a=await withSpinner(_0x98c921(0x183),()=>_0x1cf7ab[_0x98c921(0x264)][_0x98c921(0x24c)](_0x21002f),{'verbose':_0x462756['verbose']}),_0x35f1cd=_0x32f90a['data'];let _0x29079a;for(const _0x17306b of _0x35f1cd){if(_0x17306b[_0x98c921(0x232)]?.[_0x98c921(0x1be)](_0x23e775=>_0x23e775['id']===_0x577226)){_0x29079a=_0x17306b['id'];break;}}if(!_0x29079a)return console[_0x98c921(0x306)](_0x98c921(0x28d)+_0x577226+_0x98c921(0x1cb)),0x1;const _0x1b4aaa=await withSpinner('Deleting\x20token\x20\x27'+_0x577226+_0x98c921(0x131),()=>_0x1cf7ab[_0x98c921(0x264)][_0x98c921(0x29d)](_0x21002f,_0x29079a,_0x577226),{'verbose':_0x462756['verbose']}),_0x25d7c1=_0x1b4aaa[_0x98c921(0x2a4)];return console[_0x98c921(0x306)](_0x98c921(0x20e)+(_0x25d7c1[_0x98c921(0x15c)]||_0x577226)+'\x27'),await handleSDKOutput([_0x25d7c1],_0x462756),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x4797a6(0x15c)]='ps:pz:list';[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x1f7);async[a31_0x4797a6(0x152)](_0x17474d){const _0x10523c=a31_0x4797a6,{options:_0xb8ddf6,args:_0x5789d9,tdx:_0x195f29}=_0x17474d,_0xaa6f8a=_0x5789d9[0x0]||_0xb8ddf6['parentSegment'];if(!_0xaa6f8a)return showParentSegmentNotSetError(_0x10523c(0x139)+_0x10523c(0x26a)),0x1;const _0x4de0ef=await withSpinner(_0x10523c(0x2d3)+_0xaa6f8a+_0x10523c(0x131),()=>_0x195f29[_0x10523c(0x14c)][_0x10523c(0x127)](_0xaa6f8a),{'verbose':_0xb8ddf6[_0x10523c(0x282)]}),_0x4000a2=_0x4de0ef[_0x10523c(0x2a4)],_0x1a259b=await withSpinner(_0x10523c(0x27c)+_0xaa6f8a+_0x10523c(0x131),()=>_0x195f29[_0x10523c(0x264)][_0x10523c(0x2bb)](_0x4000a2),{'verbose':_0xb8ddf6[_0x10523c(0x282)]}),_0x1c1621=_0x1a259b[_0x10523c(0x2a4)];console['error'](_0x10523c(0x150)+_0x1c1621[_0x10523c(0x16c)]+_0x10523c(0x28f)+(_0x1c1621[_0x10523c(0x16c)]!==0x1?'s':''));if(_0xb8ddf6['format']===_0x10523c(0x1bf)||_0xb8ddf6['format']==='jsonl')await handleSDKOutput(_0x1c1621,_0xb8ddf6);else{if(_0x1c1621[_0x10523c(0x16c)]===0x0)console[_0x10523c(0x225)](_0x10523c(0x1de));else for(const _0x3c7bc1 of _0x1c1621){console[_0x10523c(0x225)](a31_0x12b51f[_0x10523c(0x287)](_0x3c7bc1[_0x10523c(0x15c)])+'\x20'+a31_0x12b51f[_0x10523c(0x2dc)]('(id:\x20'+_0x3c7bc1['id']+')'));_0x3c7bc1['description']&&console[_0x10523c(0x225)]('\x20\x20'+a31_0x12b51f[_0x10523c(0x2dc)](_0x3c7bc1[_0x10523c(0x2eb)]));const _0x392fa=_0x3c7bc1['sections']?.[_0x10523c(0x16c)]||0x0;console[_0x10523c(0x225)]('\x20\x20'+a31_0x12b51f[_0x10523c(0x137)](_0x10523c(0x122))+'\x20'+_0x392fa);if(_0x3c7bc1[_0x10523c(0x12f)]&&_0x3c7bc1[_0x10523c(0x12f)][_0x10523c(0x16c)]>0x0)for(const _0x3bc624 of _0x3c7bc1[_0x10523c(0x12f)]){console['log'](_0x10523c(0x24a)+_0x3bc624[_0x10523c(0x15c)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x4797a6(0x15c)]='ps:pz:show';[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x21c);async[a31_0x4797a6(0x152)](_0x29652f){const _0x16a167=a31_0x4797a6,{options:_0x99844c,args:_0x53aacd,tdx:_0x20ffec}=_0x29652f,_0x1baae5=_0x53aacd[0x0];if(!_0x1baae5)return console[_0x16a167(0x306)](_0x16a167(0x129)),console[_0x16a167(0x306)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x439fc2=await withSpinner(_0x16a167(0x2e7)+_0x1baae5+_0x16a167(0x131),()=>_0x20ffec[_0x16a167(0x264)]['getPersonalization'](_0x1baae5),{'verbose':_0x99844c[_0x16a167(0x282)]}),_0x403aa4=_0x439fc2['data'];console[_0x16a167(0x306)](_0x16a167(0x313)+_0x403aa4['name']+'\x27');if(_0x99844c[_0x16a167(0x1b6)]===_0x16a167(0x1bf)||_0x99844c['format']===_0x16a167(0x1bc))await handleSDKOutput([_0x403aa4],_0x99844c);else{console[_0x16a167(0x225)](a31_0x12b51f[_0x16a167(0x287)](_0x403aa4[_0x16a167(0x15c)])+'\x20'+a31_0x12b51f[_0x16a167(0x2dc)](_0x16a167(0x2ad)+_0x403aa4['id']+')'));_0x403aa4[_0x16a167(0x2eb)]&&console[_0x16a167(0x225)]('\x20\x20'+a31_0x12b51f['dim'](_0x403aa4[_0x16a167(0x2eb)]));_0x403aa4[_0x16a167(0x108)]&&console['log']('\x20\x20'+a31_0x12b51f['cyan'](_0x16a167(0x278))+'\x20'+_0x403aa4[_0x16a167(0x108)]);console[_0x16a167(0x225)]('\x20\x20'+a31_0x12b51f[_0x16a167(0x137)](_0x16a167(0x292))+'\x20'+_0x403aa4['createdAt']),console[_0x16a167(0x225)]('\x20\x20'+a31_0x12b51f[_0x16a167(0x137)](_0x16a167(0x11b))+'\x20'+_0x403aa4[_0x16a167(0x1f1)]);const _0x198114=_0x403aa4[_0x16a167(0x12f)]?.['length']||0x0;console[_0x16a167(0x225)]('\x20\x20'+a31_0x12b51f['cyan'](_0x16a167(0x122))+'\x20'+_0x198114);if(_0x403aa4[_0x16a167(0x12f)]&&_0x403aa4[_0x16a167(0x12f)][_0x16a167(0x16c)]>0x0)for(const _0x196cc7 of _0x403aa4['sections']){console[_0x16a167(0x225)](_0x16a167(0x10b)+a31_0x12b51f['bold'](_0x196cc7[_0x16a167(0x15c)])+'\x20'+a31_0x12b51f['dim'](_0x16a167(0x2ad)+_0x196cc7['id']+')')),_0x196cc7[_0x16a167(0x2ef)]&&(console[_0x16a167(0x225)](_0x16a167(0x1a5)+a31_0x12b51f[_0x16a167(0x137)](_0x16a167(0x111))+'\x20'+_0x196cc7['entryCriteria']['name']),_0x196cc7[_0x16a167(0x2ef)][_0x16a167(0x18b)]?.[_0x16a167(0x235)]&&console[_0x16a167(0x225)]('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x12b51f['cyan'](_0x16a167(0x25b))+'\x20'+_0x196cc7[_0x16a167(0x2ef)][_0x16a167(0x18b)][_0x16a167(0x235)])),_0x196cc7['payload']&&console[_0x16a167(0x225)](_0x16a167(0x1a5)+a31_0x12b51f['cyan']('payload:')+'\x20'+JSON[_0x16a167(0x196)](_0x196cc7['payload'])),_0x196cc7['includeSensitive']&&console[_0x16a167(0x225)](_0x16a167(0x1a5)+a31_0x12b51f[_0x16a167(0x137)](_0x16a167(0x101))+_0x16a167(0x1b2));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x248);['description']='Delete\x20a\x20realtime\x20personalization';async['execute'](_0x1542b0){const _0x49d072=a31_0x4797a6,{options:_0x1c2f17,args:_0x4a79ed,tdx:_0x149920}=_0x1542b0,_0x4937d6=_0x4a79ed[0x0];if(!_0x4937d6)return console[_0x49d072(0x306)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x49d072(0x306)](_0x49d072(0x283)),0x1;return await withSpinner(_0x49d072(0x2ee)+_0x4937d6+_0x49d072(0x131),()=>_0x149920[_0x49d072(0x264)][_0x49d072(0x276)](_0x4937d6),{'verbose':_0x1c2f17[_0x49d072(0x282)]}),console['error'](_0x49d072(0x297)+_0x4937d6+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x2b5);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x1c3);async[a31_0x4797a6(0x152)](_0x2ffb26){const _0x1543f6=a31_0x4797a6,{options:_0x4a89d2,tdx:_0x4bf463}=_0x2ffb26,_0x3ca2a5=_0x4a89d2;let _0x5b6109;if(_0x3ca2a5[_0x1543f6(0x104)]){_0x5b6109=await loadJSON(_0x3ca2a5[_0x1543f6(0x104)],!![]);if(!_0x5b6109[_0x1543f6(0xff)]?.[_0x1543f6(0x19f)])return console[_0x1543f6(0x306)](_0x1543f6(0x1e4)),console[_0x1543f6(0x306)](_0x1543f6(0x1c4)),console[_0x1543f6(0x306)](_0x1543f6(0x2c4)),0x1;}else{if(!_0x3ca2a5[_0x1543f6(0x15c)])return console['error']('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x1543f6(0x306)](_0x1543f6(0x2e1)),console[_0x1543f6(0x306)](_0x1543f6(0x10e)),0x1;if(_0x3ca2a5[_0x1543f6(0x2eb)]===undefined)return console[_0x1543f6(0x306)](_0x1543f6(0x1ab)),console[_0x1543f6(0x306)](_0x1543f6(0x2e1)),console[_0x1543f6(0x306)](_0x1543f6(0x10e)),0x1;if(_0x3ca2a5[_0x1543f6(0x1ac)]===undefined)return console[_0x1543f6(0x306)](_0x1543f6(0x14b)),console[_0x1543f6(0x306)](_0x1543f6(0x147)),0x1;let _0xb3501b=_0x3ca2a5[_0x1543f6(0x108)];if(!_0xb3501b&&_0x4a89d2[_0x1543f6(0x13d)]){const _0x187490=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4a89d2[_0x1543f6(0x13d)]+_0x1543f6(0x131),()=>_0x4bf463[_0x1543f6(0x14c)]['resolveParentId'](_0x4a89d2[_0x1543f6(0x13d)]),{'verbose':_0x4a89d2[_0x1543f6(0x282)]});_0xb3501b=_0x187490[_0x1543f6(0x2a4)];}let _0x207356;_0x3ca2a5[_0x1543f6(0x12f)]&&(_0x207356=await loadJSON(_0x3ca2a5[_0x1543f6(0x12f)],![]));const _0x2c77fe=_0x3ca2a5[_0x1543f6(0x1ac)]===_0x1543f6(0x31c)?null:{'id':_0x3ca2a5[_0x1543f6(0x1ac)],'type':_0x1543f6(0x28c)};_0x5b6109={'attributes':{'name':_0x3ca2a5['name'],'description':_0x3ca2a5['description']||null,..._0xb3501b!==undefined&&{'audienceId':_0xb3501b},..._0x207356!==undefined&&{'sections':_0x207356}},'relationships':{'parentFolder':{'data':_0x2c77fe}}};}const _0x22abc6=await withSpinner(_0x1543f6(0x17b)+(_0x5b6109[_0x1543f6(0x2b7)]?.[_0x1543f6(0x15c)]??'')+_0x1543f6(0x131),()=>_0x4bf463[_0x1543f6(0x264)]['createPersonalization'](_0x5b6109),{'verbose':_0x4a89d2[_0x1543f6(0x282)]}),_0x52fd2c=_0x22abc6[_0x1543f6(0x2a4)];return console[_0x1543f6(0x306)](_0x1543f6(0x1cd)+_0x52fd2c['name']+_0x1543f6(0x19e)+_0x52fd2c['id']),await handleSDKOutput([_0x52fd2c],_0x4a89d2),0x0;}}export class PSPzPatchCommand extends BaseCommand{['name']=a31_0x4797a6(0x2a3);['description']=a31_0x4797a6(0x155);async[a31_0x4797a6(0x152)](_0x47f0bd){const _0x46ea51=a31_0x4797a6,{options:_0x364228,args:_0x3b8571}=_0x47f0bd,_0x344930=_0x364228,_0x22f0da=_0x3b8571[0x0];if(!_0x22f0da)return console[_0x46ea51(0x306)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x46ea51(0x306)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0x46ea51(0x306)](_0x46ea51(0x144)),0x1;let _0x1f3628;if(_0x344930[_0x46ea51(0x104)])_0x1f3628=await loadJSON(_0x344930[_0x46ea51(0x104)],!![]);else{if(!_0x344930[_0x46ea51(0x15c)])return console[_0x46ea51(0x306)](_0x46ea51(0x205)),console['error'](_0x46ea51(0x168)),0x1;if(_0x344930[_0x46ea51(0x2eb)]===undefined)return console[_0x46ea51(0x306)](_0x46ea51(0x1ab)),console[_0x46ea51(0x306)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;let _0x2073c3;_0x344930[_0x46ea51(0x12f)]&&(_0x2073c3=await loadJSON(_0x344930[_0x46ea51(0x12f)],![])),_0x1f3628={'attributes':{'name':_0x344930[_0x46ea51(0x15c)],'description':_0x344930[_0x46ea51(0x2eb)]||null,..._0x2073c3!==undefined&&{'sections':_0x2073c3}}};}const {tdx:_0x4f6668}=_0x47f0bd,_0x4710c3=await withSpinner(_0x46ea51(0x2a9)+_0x22f0da+'\x27...',()=>_0x4f6668[_0x46ea51(0x264)][_0x46ea51(0x307)](_0x22f0da,_0x1f3628),{'verbose':_0x364228[_0x46ea51(0x282)]}),_0x37ba36=_0x4710c3[_0x46ea51(0x2a4)];return console[_0x46ea51(0x306)](_0x46ea51(0x19d)+_0x37ba36[_0x46ea51(0x15c)]+'\x27\x20(id:\x20'+_0x37ba36['id']+')'),await handleSDKOutput([_0x37ba36],_0x364228),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x4797a6(0x15c)]=a31_0x4797a6(0x190);[a31_0x4797a6(0x2eb)]=a31_0x4797a6(0x1c8);async[a31_0x4797a6(0x152)](_0x10dba3){const _0x59f12d=a31_0x4797a6,{options:_0xbb367f,args:_0x5752c6}=_0x10dba3,_0x453587=_0x5752c6[0x0]||_0xbb367f[_0x59f12d(0x13d)];if(!_0x453587)return showParentSegmentNotSetError(_0x59f12d(0x277)+_0x59f12d(0x148)),0x1;const _0x20c329=resolveYamlFile(_0x453587);if(!existsSync(_0x20c329))return showFileNotFoundError(_0x20c329,_0x453587),0x1;let _0x234245;try{_0x234245=readFileSync(_0x20c329,_0x59f12d(0x1aa));}catch(_0x553be9){const _0x396da4=_0x553be9 instanceof Error?_0x553be9[_0x59f12d(0x182)]:String(_0x553be9);return console[_0x59f12d(0x306)](_0x59f12d(0x251)+_0x396da4),0x1;}let _0x5d364e;try{_0x5d364e=parseDef(_0x234245);}catch(_0x271227){const _0x5e6f83=_0x271227 instanceof Error?_0x271227[_0x59f12d(0x182)]:String(_0x271227);return console['error'](a31_0x12b51f['red']('Error\x20parsing\x20YAML:\x20'+_0x5e6f83)),0x1;}if(_0x5d364e[_0x59f12d(0x240)]&&_0x5d364e[_0x59f12d(0x240)][_0x59f12d(0x16c)]>0x0)return console[_0x59f12d(0x306)](a31_0x12b51f[_0x59f12d(0x215)](_0x59f12d(0x105)+_0x20c329)),console[_0x59f12d(0x306)](a31_0x12b51f[_0x59f12d(0x2dc)](_0x59f12d(0x1af)+_0x5d364e[_0x59f12d(0x240)]['length']+_0x59f12d(0x1d9))),0x1;!_0x5d364e[_0x59f12d(0x20f)]&&(_0x5d364e[_0x59f12d(0x20f)]={'events':[{'name':_0x59f12d(0x2fc),'source_table':_0x59f12d(0x107)}],'attributes':[{'name':_0x59f12d(0x193),'type':_0x59f12d(0x1c6)}],'id_stitching':{'primary_key':_0x5d364e[_0x59f12d(0x2fe)][_0x59f12d(0x262)]===_0x59f12d(0x2e2)?_0x59f12d(0x2f4):_0x59f12d(0x246)}});_0x5d364e[_0x59f12d(0x240)]=[{'name':_0x59f12d(0x162),'description':_0x59f12d(0x120),'trigger_event':_0x59f12d(0x2fc),'sections':[{'name':_0x59f12d(0x179),'criteria':_0x59f12d(0x25e),'attributes':[_0x59f12d(0x193)]}]}];const _0x2d8e07=serializeDef(_0x5d364e);return writeFileSync(_0x20c329,_0x2d8e07,_0x59f12d(0x1aa)),console[_0x59f12d(0x306)](a31_0x12b51f[_0x59f12d(0x2db)]('✔')+_0x59f12d(0x219)+a31_0x12b51f['cyan'](_0x20c329)),(!_0x5d364e[_0x59f12d(0x20f)]||_0x234245['indexOf'](_0x59f12d(0x261))===-0x1)&&console[_0x59f12d(0x306)](a31_0x12b51f[_0x59f12d(0x2db)]('✔')+_0x59f12d(0x1da)),console[_0x59f12d(0x306)]('\x0a'+a31_0x12b51f[_0x59f12d(0x2dc)](_0x59f12d(0x15f))),console[_0x59f12d(0x306)](_0x59f12d(0x2f8)+_0x20c329+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x59f12d(0x306)]('\x20\x202.\x20Run\x20'+a31_0x12b51f[_0x59f12d(0x2dc)](_0x59f12d(0x102)+_0x453587)+_0x59f12d(0x300)),0x0;}}
1
+ const a31_0x1cf65c=a31_0x31f0;(function(_0x4fa8ec,_0x4ccc01){const _0x2237d2=a31_0x31f0,_0x20a204=_0x4fa8ec();while(!![]){try{const _0x3881d3=parseInt(_0x2237d2(0x12f))/0x1*(parseInt(_0x2237d2(0x16b))/0x2)+parseInt(_0x2237d2(0x2a0))/0x3+parseInt(_0x2237d2(0x2da))/0x4*(-parseInt(_0x2237d2(0x2b1))/0x5)+parseInt(_0x2237d2(0x274))/0x6+parseInt(_0x2237d2(0x118))/0x7*(-parseInt(_0x2237d2(0x185))/0x8)+-parseInt(_0x2237d2(0x1c3))/0x9+parseInt(_0x2237d2(0x1a7))/0xa;if(_0x3881d3===_0x4ccc01)break;else _0x20a204['push'](_0x20a204['shift']());}catch(_0x579caa){_0x20a204['push'](_0x20a204['shift']());}}}(a31_0x321a,0xbe52f));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x51cf72 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_0x2d8ea2 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';function a31_0x321a(){const _0x5e5925=['Error:\x20Parent\x20segment\x20name\x20is\x20required','Validate:','type','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','getParentSQL','verbose','scheduleOption','sourceTableValid','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','Source:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Create\x20parent\x20segment\x20\x27','\x22,\x20\x22type\x22:\x20\x22','Aborted.','enriched','\x0aNew\x20parent\x20segment\x20\x27','cyan','FINISHED','platform','Error:\x20Personalization\x20ID\x20is\x20required','👥\x20','\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','getBehaviorNames','ps:pz:service:list','bold','{\x0a\x20\x20\x22database\x22:\x20\x22','ps:rt:list','stageCount','Validating\x20RT\x20configuration...','keyEventId','SQL\x20query:\x0a','displayMasterInfo','\x0aChanges\x20to\x20\x27','Pause\x20activations\x20in\x20an\x20RT\x20journey','displaySampleData','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','\x20--behavior\x20\x22<name>\x22','yellow','Error:\x20--name\x20is\x20required','\x0aError:','285892dksRlH','RT\x20Journey\x20ID:\x20','create','processedRows','RT\x202.0\x20Validate:','keyEventId:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','Updating\x20parent\x20segment\x20\x27','listParents','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Output\x20file:\x20','public','displayPreviewResults','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','createdAt','✔\x20Created\x20token\x20\x27','Executing\x20parent\x20segment\x20query...','Creating\x20parent\x20segment\x20\x27','attribute','Error:\x20File\x20not\x20found:\x20','behaviors','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Attribute:','Error\x20reading\x20file:\x20','displayValidateResults','72hjrXYE','Error:\x20--database\x20and\x20--table\x20are\x20required','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','validateParentYaml','No\x20personalization\x20services\x20configured','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x20No\x20changes\x20-\x20','\x20\x20Tables:\x201\x20customers\x20+\x20','\x20--behavior\x20\x22','workflowAttemptId','pushParentYaml','RT\x202.0:','\x20\x20\x20\x20','toLocaleString','Status:','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','displayPreviewHints','\x20configured','token:','\x20parent\x20segment','pullParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','match','displayColumns','Listing\x20RT\x20journeys\x20for\x20\x27','realtime:','\x0a\x20\x20]\x0a}\x0a','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Updating','Site:\x20','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x27\x20is\x20up\x20to\x20date','column','11526200luuijd','length','segment:parent:desc','file','/\x20directories\x20exist.','Behavior:','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','displayRealtimeInfo','customerGroup','filter','Session:','\x20RT\x20journey','dim','segment:parent:view','No\x20RT-enabled\x20parent\x20segments\x20found','customersWithEvents','valid','payload','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20rows)','\x20Context\x20set:\x20','toFixed','patch','timezone','audienceId:\x20','10861245PIELKD','\x20parent\x20segment\x20\x27','patchPersonalization','paused','\x5c$&','stop','double','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','sort','✔\x20Query\x20completed:\x20Processed\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','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','Schema\x20saved\x20to\x20','replace','localeCompare','getParentFull','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','description','deleteToken','\x20tdx\x20wf\x20attempt\x20','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20Configuration\x20is\x20valid','\x20personalization\x20service','ps:rt:validate','\x0a⚠️\x20\x20Migrating:\x20','idStitching','displaySummary','Available\x20behaviors:','Columns:','label','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Parent\x20segment:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:','No\x20personalizations\x20configured','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','\x20\x20No\x20sample\x20data\x20available','ps:pz:service:token:delete','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','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','use','red','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','sourceTableError','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','stitchingKeys','Error:\x20Service\x20ID\x20is\x20required','\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','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','displayBehaviorsStats','My\x20Service','name','Creating\x20personalization\x20\x27','Validating\x20configuration...','parent_id','Fetching\x20customers\x20schema...','status','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Next\x20steps:','Deleting\x20token\x20\x27','\x20personalization','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x20--attribute\x20\x22','Created','setJobId','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','entryCriteria:','✔\x20No\x20changes\x20-\x20\x27','\x20rows\x20','\x20\x20\x20\x20\x20\x20\x20\x20','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x0a\x20\x20\x20\x20]','\x20--interval\x20','Listing\x20personalizations\x20for\x20\x27','Options:\x0a','behaviorsFile','all','ignore','Analyzing\x20changes...','personalization_services','keys','✔\x20Updated\x20personalization\x20\x27','✔\x20Deleted\x20personalization\x20service\x20\x27','start','List\x20available\x20fields\x20for\x20segmentation','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','ps:pz:patch','addAttributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Customers:','ps:pz:service:token:create','launched','.yaml','Options:','master','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','To\x20cancel:','customerGroupFile','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','population','identifier','site','value','tokens','coveragePercent','get','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','SELECT\x20*\x20FROM\x20','jsonl','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','\x20=\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x27\x20(id:\x20','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','⚡\x20Not\x20enabled','List\x20RT\x20journeys','entryCriteria','execute','\x20true','Creating\x20personalization\x20service\x20\x27','✔\x20Created\x20parent\x20segment\x20\x27','Listing\x20RT-enabled\x20parent\x20segments...','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\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--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','columns','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','pauseJourney','Master:','message','audienceId:','\x20[Job\x20ID:\x20','ps:rt:jn:resume','column_type','Rows:','Found\x20YAML\x20file:\x20','Options\x20(one\x20required):\x0a','\x20\x202.\x20Run\x20','\x20+\x20[','parent_segments','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','query','log','Errors:','allowedIps','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment','\x20--attribute\x20\x22<name>\x22','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','yes','Events:','Fetching\x20behavior\x20list...','\x20(paused)','dirname','/\x20→\x20','\x20behaviors','\x20service(s)\x20configured','no\x20tokens\x20configured','personalization','\x20\x20\x20','\x27\x20with\x20ID:\x20','498252dYYPch','created:','/sessions/','user_id','\x0aNo\x20sample\x20data\x20available','schemaError','Fetching\x20SQL\x20for\x20\x27','Listing\x20personalization\x20services\x20for\x20\x27','workflowSessionId','Output\x20Database:','map','repeat','ps:rt:jn:list','Master\x20+\x20Attributes','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','eventKind:\x20','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','limit','segment:parent:push','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','\x20RT-enabled\x20parent\x20segment','\x27...','\x20\x20Database:\x20','Error:\x20Token\x20name\x20is\x20required','✔\x20Deleted\x20personalization\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Behaviors','ps:pz:service:create','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','some','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','text','endsWith','/app/workflows/','Preview:','realtime','string','open','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','✔\x20Found\x20','displayAttributesStats','\x0aChanges\x20to\x20apply\x20to\x20\x27','(id:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','3932328tGzuSa','payload:','table','Error:\x20Token\x20ID\x20is\x20required','YAML\x20file:\x20','behavior_','No\x20parent\x20segments\x20found','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','✔\x20Renamed\x20directory\x20to\x20','\x20kill','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','rowCount','personalizationServices','segment:parent:preview','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','245515yhTWId','customers','segment:parent:update','formatSchemaJson','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\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}','\x0a\x20\x20\x20\x20}','delete','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','\x20service','✔\x20Updated\x20personalization\x20service\x20\x27','preview','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','realtime_enabled','updated:','-1d','foreignKey','Getting\x20personalization\x20\x27','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','listFields','format','page_view','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','runParent','sampleData','tdx\x20ps\x20preview\x20','state','%)\x20','\x27\x20is\x20already\x20up\x20to\x20date','Patching\x20personalization\x20\x27','\x20total','\x0a✔\x20Workflow\x20started','stringify','toLowerCase','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','json','folderId','Fetching\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','resolveParentId','totalEvents','20faYkFu','information_schema','deletePersonalization','parent_segment','apply','scheduleType','matchedCount','\x20\x20Columns:\x20','ps:rt:configuration_versions','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','utf-8','stats','schemaValid','createParent','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','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','addBehaviors','behavior','last_page_viewed','joinKey','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','null','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','ps:pz:init','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','relationships','ps:pz:service:delete','folder-segment','Show\x20parent\x20segment\x20details','.customers)','\x20\x20\x20\x20\x20\x20','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','green','allowed\x20IPs:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','ps:pz:service:update','Fetching\x20personalization\x20service\x20\x27','customerPercent','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','✔\x20Retrieved\x20RT\x20configuration\x20version','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','test','sections:','Updated','Finding\x20service\x20for\x20token...','interval','Show\x20a\x20specific\x20realtime\x20personalization','darwin','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Get\x20current\x20RT\x20configuration\x20version\x20status','\x20to\x20configure\x20your\x20personalization\x20service','list','Creating','includeSensitive','segment','previewParentYaml','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','attributes','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','Database:\x20','✔\x20Updated\x20parent\x20segment\x20\x27','⚡\x20Enabled','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','xdg-open','Resume\x20activations\x20in\x20an\x20RT\x20journey','Personalization:','Name:\x20','/app/dw/parentSegments/','column_name','trim','jobId','.yml','355831TjEcAs','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','createToken','✔\x20Deleted\x20token\x20\x27','public:','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','listPersonalizations','database','List\x20parent\x20segments','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','ps:pz:create','output','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','Resolving\x20parent\x20segment\x20\x27','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','parentSegment','in\x20','\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','tdx\x20ps\x20push\x20','Join\x20on:','\x20\x20Note:\x20','\x22\x20}','1mFzMUJ','parentFolder','Default','errors','segment:parent:run','updateParent','allValid','keyEventCriteria','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','enabled','sections','\x0a⚠️\x20\x20Both\x20','Overwrite\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','run','audienceId','Updating\x20personalization\x20service\x20\x27','events','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','/attempt/'];a31_0x321a=function(){return _0x5e5925;};return a31_0x321a();}import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x1cf65c(0x259),LEGACY_PARENT_SEGMENT_DIR=a31_0x1cf65c(0x2dd);function openBrowser(_0x4e0fbf){const _0x4de9b4=a31_0x1cf65c,_0x2baa0f=process[_0x4de9b4(0x155)],_0x40c342=_0x2baa0f===_0x4de9b4(0xfe)?_0x4de9b4(0x299):_0x2baa0f==='win32'?_0x4de9b4(0x21d):_0x4de9b4(0x10f);spawn(_0x40c342,[_0x4e0fbf],{'detached':!![],'stdio':_0x4de9b4(0x217)})['unref']();}function migrateLegacyDirectory(){const _0x48cd87=a31_0x1cf65c;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x18e2e4=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x18e2e4['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x48cd87(0xff)](a31_0x2d8ea2[_0x48cd87(0x168)](_0x48cd87(0x13a)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x48cd87(0x1ab))),console[_0x48cd87(0xff)](a31_0x2d8ea2[_0x48cd87(0x1b3)](_0x48cd87(0x2a7)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x48cd87(0xff)](a31_0x2d8ea2[_0x48cd87(0x168)](_0x48cd87(0x1dd)+LEGACY_PARENT_SEGMENT_DIR+_0x48cd87(0x26d)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x48cd87(0xff)](a31_0x2d8ea2[_0x48cd87(0xee)](_0x48cd87(0x2a8)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x138d0b){const _0x40f274=_0x138d0b instanceof Error?_0x138d0b['message']:String(_0x138d0b);return console[_0x48cd87(0xff)](a31_0x2d8ea2['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x40f274+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0xb2e275){const _0x5d502d=a31_0x1cf65c;return migrateLegacyDirectory(),super[_0x5d502d(0x13d)](_0xb2e275);}}function resolveYamlFile(_0x503543){const _0x384aa9=a31_0x1cf65c;if(_0x503543[_0x384aa9(0x294)](_0x384aa9(0x117))||_0x503543[_0x384aa9(0x294)](_0x384aa9(0x226)))return _0x503543;return a31_0x51cf72[_0x384aa9(0x1ba)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x503543)+_0x384aa9(0x117));}function formatProgressMessage(_0x291630){const _0x422073=a31_0x1cf65c,_0x2471a9=_0x291630[_0x422073(0x19c)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2471a9){const [,_0x999c88,_0x33e88a,_0x13f917='']=_0x2471a9;return a31_0x2d8ea2['dim'](_0x999c88+':')+'\x20'+_0x33e88a+a31_0x2d8ea2[_0x422073(0x1b3)](_0x13f917);}return a31_0x2d8ea2[_0x422073(0x1b3)](_0x291630);}function showFileNotFoundError(_0x41c5ea,_0x1f0d41){const _0x26f9ce=a31_0x1cf65c;console[_0x26f9ce(0xff)](a31_0x2d8ea2[_0x26f9ce(0x1f0)](_0x26f9ce(0x17f)+_0x41c5ea+'\x0a')),console[_0x26f9ce(0xff)](a31_0x2d8ea2[_0x26f9ce(0x153)](_0x26f9ce(0x1a1)+_0x1f0d41+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x5be94e){const _0x57c864=a31_0x1cf65c;if(!_0x5be94e[_0x57c864(0x297)])return;const _0x5eaaee=_0x5be94e['realtime'],_0x2afd0c=_0x5eaaee[_0x57c864(0x138)]?a31_0x2d8ea2['green'](_0x57c864(0x10d)):a31_0x2d8ea2[_0x57c864(0x168)](_0x57c864(0x23f));console['error']('\x0a'+a31_0x2d8ea2['dim'](_0x57c864(0x190))+'\x20'+_0x2afd0c);if(_0x5eaaee[_0x57c864(0x140)]&&_0x5eaaee[_0x57c864(0x140)][_0x57c864(0x1a8)]>0x0){console['error']('\x20\x20'+a31_0x2d8ea2[_0x57c864(0x1b3)]('Events:')+'\x20'+_0x5eaaee[_0x57c864(0x140)]['length']+_0x57c864(0x196));for(const _0x1261b6 of _0x5eaaee[_0x57c864(0x140)]){const _0x1bfe45=_0x1261b6[_0x57c864(0x14a)]===![]?a31_0x2d8ea2[_0x57c864(0x1f0)]('✘'):a31_0x2d8ea2[_0x57c864(0xee)]('✔');console[_0x57c864(0xff)](_0x57c864(0x191)+_0x1bfe45+'\x20'+_0x1261b6['name']),_0x1261b6['sourceTableError']&&console[_0x57c864(0xff)](_0x57c864(0xec)+a31_0x2d8ea2[_0x57c864(0x1f0)](_0x1261b6[_0x57c864(0x1f2)]));}}if(_0x5eaaee[_0x57c864(0x109)]&&_0x5eaaee[_0x57c864(0x109)][_0x57c864(0x1a8)]>0x0){console[_0x57c864(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x57c864(0x1b3)]('Attributes:')+'\x20'+_0x5eaaee[_0x57c864(0x109)][_0x57c864(0x1a8)]+'\x20configured');for(const _0x38b022 of _0x5eaaee[_0x57c864(0x109)]){const _0x2f7373=_0x38b022[_0x57c864(0x1b7)]?a31_0x2d8ea2[_0x57c864(0xee)]('✔'):a31_0x2d8ea2[_0x57c864(0x1f0)]('✘');console[_0x57c864(0xff)]('\x20\x20\x20\x20'+_0x2f7373+'\x20'+_0x38b022['name']+'\x20'+a31_0x2d8ea2[_0x57c864(0x1b3)]('('+_0x38b022[_0x57c864(0x145)]+')'));}}if(_0x5eaaee[_0x57c864(0x1de)]){const _0x5b4760=_0x5eaaee['idStitching'][_0x57c864(0x1f5)]?.[_0x57c864(0x1a8)]?_0x57c864(0x258)+_0x5eaaee['idStitching']['stitchingKeys']['join'](',\x20')+']':'';console[_0x57c864(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x57c864(0x1b3)]('ID\x20Stitching:')+'\x20'+_0x5eaaee[_0x57c864(0x1de)]['primaryKey']+_0x5b4760);}if(_0x5eaaee[_0x57c864(0x2ad)]&&_0x5eaaee['personalizationServices'][_0x57c864(0x1a8)]>0x0){console[_0x57c864(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x57c864(0x1b3)](_0x57c864(0x111))+'\x20'+_0x5eaaee[_0x57c864(0x2ad)][_0x57c864(0x1a8)]+_0x57c864(0x2ba)+(_0x5eaaee[_0x57c864(0x2ad)]['length']!==0x1?'s':''));for(const _0x1028f3 of _0x5eaaee[_0x57c864(0x2ad)]){console[_0x57c864(0xff)](_0x57c864(0x125)+_0x1028f3[_0x57c864(0x1fb)]);}}}function showParentSegmentNotSetError(_0x533df6){const _0x22120f=a31_0x1cf65c;console[_0x22120f(0xff)](a31_0x2d8ea2[_0x22120f(0x168)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x22120f(0xff)](_0x533df6);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='segment:parent:list';['description']=a31_0x1cf65c(0x120);async[a31_0x1cf65c(0x242)](_0x4eeb43){const _0x51f26a=a31_0x1cf65c,{options:_0x2dbe40,args:_0x543b2f,tdx:_0x5e1599}=_0x4eeb43,_0x3d8c9a=_0x543b2f[0x0];_0x2dbe40[_0x51f26a(0x148)]&&(console['error'](_0x51f26a(0x1a3)+_0x2dbe40[_0x51f26a(0x22f)]),_0x3d8c9a&&console[_0x51f26a(0xff)]('Pattern:\x20'+_0x3d8c9a));const _0x43cb2f=await withSpinner(_0x3d8c9a?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x3d8c9a+'\x27...':'Listing\x20parent\x20segments...',()=>_0x5e1599[_0x51f26a(0x106)][_0x51f26a(0x174)](),{'verbose':_0x2dbe40[_0x51f26a(0x148)]});let _0x42f021=_0x43cb2f[_0x51f26a(0x20f)];if(_0x3d8c9a){const _0x14dcf9=_0x3d8c9a[_0x51f26a(0x1d1)](/[.+^${}()|[\]\\]/g,_0x51f26a(0x1c7))[_0x51f26a(0x1d1)](/\*/g,'.*')[_0x51f26a(0x1d1)](/\?/g,'.'),_0x587fcf=new RegExp('^'+_0x14dcf9+'$','i');_0x42f021=_0x42f021[_0x51f26a(0x1b0)](_0x12401a=>_0x587fcf[_0x51f26a(0xf8)](_0x12401a[_0x51f26a(0x109)][_0x51f26a(0x1fb)]));}_0x42f021[_0x51f26a(0x1cc)]((_0x269d9f,_0xd748c1)=>_0x269d9f['attributes'][_0x51f26a(0x1fb)][_0x51f26a(0x1d2)](_0xd748c1[_0x51f26a(0x109)][_0x51f26a(0x1fb)])),console[_0x51f26a(0xff)](_0x51f26a(0x29b)+_0x42f021['length']+_0x51f26a(0x198)+(_0x42f021['length']!==0x1?'s':''));const _0x260c6f=_0x3f0c0b=>{const _0x275d38=_0x51f26a;return getConsoleNextUrl(_0x2dbe40[_0x275d38(0x22f)],_0x275d38(0x113)+_0x3f0c0b);};if(_0x2dbe40[_0x51f26a(0x2c5)]===_0x51f26a(0x2d4)||_0x2dbe40[_0x51f26a(0x2c5)]==='jsonl'){const _0x455a95=_0x42f021['map'](_0x219bf7=>({..._0x219bf7,'url':_0x260c6f(_0x219bf7['id'])}));await handleSDKOutput(_0x455a95,_0x2dbe40);}else{if(_0x42f021['length']===0x0)_0x3d8c9a?console[_0x51f26a(0x25e)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x3d8c9a):console['log'](_0x51f26a(0x2a6));else for(const _0x495fa1 of _0x42f021){const _0x559221=_0x495fa1[_0x51f26a(0x109)][_0x51f26a(0x22d)]?a31_0x2d8ea2[_0x51f26a(0x1b3)]('\x20('+formatRows(_0x495fa1[_0x51f26a(0x109)][_0x51f26a(0x22d)])+')'):'',_0x51c11a=hyperlink(_0x495fa1['attributes'][_0x51f26a(0x1fb)],_0x260c6f(_0x495fa1['id']));console[_0x51f26a(0x25e)](_0x51f26a(0x157)+_0x51c11a+_0x559221);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='segment:parent:create';[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x1d5);async[a31_0x1cf65c(0x242)](_0x2e4aff){const _0x494dea=a31_0x1cf65c,{options:_0x5a81f2,args:_0x5c40f1,tdx:_0x486f63}=_0x2e4aff;console[_0x494dea(0xff)](_0x494dea(0x18a)+_0x494dea(0x171)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x2e955a=_0x5a81f2;if(_0x5c40f1[_0x494dea(0x1a8)]===0x0)return console[_0x494dea(0xff)](a31_0x2d8ea2['red'](_0x494dea(0x143))),console['error'](_0x494dea(0x121)),0x1;const _0x3f0059=_0x5c40f1[0x0];if(!_0x2e955a['database']||!_0x2e955a['table'])return console['error'](_0x494dea(0x186)),console[_0x494dea(0xff)](_0x494dea(0x121)),0x1;_0x2e955a['verbose']&&(console[_0x494dea(0xff)]('Site:\x20'+_0x2e955a['site']),console['error'](_0x494dea(0x112)+_0x3f0059),console[_0x494dea(0xff)](_0x494dea(0x10b)+_0x2e955a['database']),console[_0x494dea(0xff)]('Table:\x20'+_0x2e955a[_0x494dea(0x2a2)]));const _0x18a26f=await loadJSONFromOptions(_0x2e955a[_0x494dea(0x109)],_0x2e955a['attributesFile']),_0x76ec83=await loadJSONFromOptions(_0x2e955a[_0x494dea(0x180)],_0x2e955a[_0x494dea(0x215)]),_0xd0dd60=await loadJSONFromOptions(_0x2e955a[_0x494dea(0x1af)],_0x2e955a[_0x494dea(0x22b)]),_0x523e12={'name':_0x3f0059,'description':_0x2e955a['description'],'scheduleType':_0x2e955a[_0x494dea(0x2df)],'scheduleOption':_0x2e955a[_0x494dea(0x149)],'timezone':_0x2e955a[_0x494dea(0x1c1)],'master':{'parentDatabaseName':_0x2e955a['database'],'parentTableName':_0x2e955a[_0x494dea(0x2a2)]},'attributes':_0x18a26f,'behaviors':_0x76ec83,'customerGroup':_0xd0dd60},_0x712b73=await withSpinner(_0x494dea(0x17d)+_0x3f0059+'\x27...',()=>_0x486f63['segment'][_0x494dea(0xda)](_0x523e12),{'verbose':_0x5a81f2['verbose']}),_0x33e219=_0x712b73[_0x494dea(0x20f)];return console[_0x494dea(0xff)](_0x494dea(0x245)+_0x33e219[_0x494dea(0x1fb)]+'\x27\x20with\x20ID:\x20'+_0x33e219['id']),await handleSDKOutput([_0x33e219],_0x5a81f2),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x2b3);['description']=a31_0x1cf65c(0x1ce);async[a31_0x1cf65c(0x242)](_0x483675){const _0x543f1d=a31_0x1cf65c,{options:_0x442f9d,args:_0x2fd50f,tdx:_0x5b8519}=_0x483675;console['error'](_0x543f1d(0xf4)+_0x543f1d(0x171)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x2989f3=_0x442f9d;if(_0x2fd50f[_0x543f1d(0x1a8)]===0x0)return console[_0x543f1d(0xff)](a31_0x2d8ea2[_0x543f1d(0x1f0)](_0x543f1d(0x143))),console[_0x543f1d(0xff)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x174ecc=_0x2fd50f[0x0];_0x2989f3[_0x543f1d(0x148)]&&(console[_0x543f1d(0xff)](_0x543f1d(0x1a3)+_0x2989f3['site']),console[_0x543f1d(0xff)](_0x543f1d(0x1e5)+_0x174ecc));const _0x397476=await withSpinner(_0x543f1d(0x265)+_0x174ecc+_0x543f1d(0x289),()=>_0x5b8519['segment'][_0x543f1d(0x1d3)](_0x174ecc),{'verbose':_0x2989f3[_0x543f1d(0x148)]}),_0xcf0b55=_0x397476[_0x543f1d(0x20f)],_0x25c161=await loadJSONFromOptions(_0x2989f3[_0x543f1d(0x221)],_0x2989f3['addAttributesFile']),_0x38184a=await loadJSONFromOptions(_0x2989f3[_0x543f1d(0xdd)],_0x2989f3['addBehaviorsFile']),_0x4f0f11={'name':_0xcf0b55[_0x543f1d(0x1fb)],'description':_0x2989f3[_0x543f1d(0x1d6)]!==undefined?_0x2989f3[_0x543f1d(0x1d6)]:_0xcf0b55['description'],'scheduleType':_0x2989f3['scheduleType']!==undefined?_0x2989f3[_0x543f1d(0x2df)]:_0xcf0b55['scheduleType'],'scheduleOption':_0x2989f3[_0x543f1d(0x149)]!==undefined?_0x2989f3[_0x543f1d(0x149)]:_0xcf0b55[_0x543f1d(0x149)],'timezone':_0x2989f3[_0x543f1d(0x1c1)]!==undefined?_0x2989f3['timezone']:_0xcf0b55[_0x543f1d(0x1c1)],'master':_0xcf0b55[_0x543f1d(0x228)],'attributes':_0x25c161?[..._0xcf0b55['attributes']||[],..._0x25c161]:_0xcf0b55[_0x543f1d(0x109)],'behaviors':_0x38184a?[..._0xcf0b55[_0x543f1d(0x180)]||[],..._0x38184a]:_0xcf0b55[_0x543f1d(0x180)],'customerGroup':_0xcf0b55['customerGroup']},_0x4f2d76=await withSpinner(_0x543f1d(0x173)+_0x174ecc+'\x27...',()=>_0x5b8519[_0x543f1d(0x106)][_0x543f1d(0x134)](_0x174ecc,_0x4f0f11),{'verbose':_0x2989f3['verbose']}),_0x17dc70=_0x4f2d76[_0x543f1d(0x20f)];return console[_0x543f1d(0xff)](_0x543f1d(0x10c)+_0x17dc70[_0x543f1d(0x1fb)]+'\x27'),await handleSDKOutput([_0x17dc70],_0x2989f3),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']='segment:parent:pull';[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0xe5);async[a31_0x1cf65c(0x242)](_0xc7ffa2){const _0x34ac3f=a31_0x1cf65c,{options:_0x14ac14,args:_0x55ff0e,tdx:_0x240598}=_0xc7ffa2,_0xce9349=_0x14ac14,_0x16463d=_0x55ff0e[0x0]||_0x14ac14[_0x34ac3f(0x128)];if(!_0x16463d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0xce9349[_0x34ac3f(0x1ef)]&&_0xce9349[_0x34ac3f(0x123)])return console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0x1f0)](_0x34ac3f(0x262))),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0x1b3)](_0x34ac3f(0xdb))),console['error'](a31_0x2d8ea2[_0x34ac3f(0x1b3)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0x153)](_0x34ac3f(0x21f))),0x1;const _0x2278e3=_0xce9349['output']||a31_0x51cf72[_0x34ac3f(0x1ba)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x16463d)+'.yml');_0xce9349[_0x34ac3f(0x148)]&&(console[_0x34ac3f(0xff)](_0x34ac3f(0x1a3)+_0xce9349['site']),console[_0x34ac3f(0xff)](_0x34ac3f(0x1e5)+_0x16463d),console[_0x34ac3f(0xff)](_0x34ac3f(0x176)+_0x2278e3));const _0x455346=await withSpinner(_0x34ac3f(0x2d6)+_0x16463d+'\x27...',()=>_0x240598[_0x34ac3f(0x106)][_0x34ac3f(0x199)](_0x16463d),{'verbose':_0xce9349['verbose']}),_0x43cf23=_0x455346[_0x34ac3f(0x20f)];if(existsSync(_0x2278e3)){const _0x4f9795=readFileSync(_0x2278e3,'utf-8'),_0x41b785=generateDiff(_0x4f9795,_0x43cf23);if(!hasChanges(_0x41b785))console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0xee)]('✔')+_0x34ac3f(0x18b)+a31_0x2d8ea2[_0x34ac3f(0x153)](_0x2278e3)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x34ac3f(0xff)](_0x34ac3f(0x163)+_0x2278e3+'\x27:'),console[_0x34ac3f(0xff)]('─'[_0x34ac3f(0x27f)](0x3c)),console[_0x34ac3f(0xff)](formatDiffWithColors(_0x41b785)),console[_0x34ac3f(0xff)]('─'[_0x34ac3f(0x27f)](0x3c));if(!_0xce9349[_0x34ac3f(0x268)]){if(!isInteractive())return console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0x1f0)](_0x34ac3f(0x16a)),_0x34ac3f(0x108)),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0x1b3)](_0x34ac3f(0x1e6))),0x1;const _0x37cc35=await confirmKey(_0x34ac3f(0x13b)+_0x2278e3+'\x27?');if(!_0x37cc35)return console['error'](a31_0x2d8ea2['yellow']('Aborted.')),0x1;}writeFileSync(_0x2278e3,_0x43cf23,_0x34ac3f(0xd7)),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0xee)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x2d8ea2[_0x34ac3f(0x153)](_0x2278e3));}}else{const _0x1b2c3e=a31_0x51cf72[_0x34ac3f(0x26c)](_0x2278e3);!existsSync(_0x1b2c3e)&&mkdirSync(_0x1b2c3e,{'recursive':!![]}),writeFileSync(_0x2278e3,_0x43cf23,_0x34ac3f(0xd7)),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0xee)]('✔')+_0x34ac3f(0x1ee)+a31_0x2d8ea2['cyan'](_0x2278e3));}return saveSessionContext({'parent_segment':_0x16463d},_0xce9349['session']),console[_0x34ac3f(0xff)](a31_0x2d8ea2[_0x34ac3f(0xee)]('✔')+_0x34ac3f(0x1be)+a31_0x2d8ea2[_0x34ac3f(0x1b3)](_0x34ac3f(0x2dd))+'\x20=\x20'+a31_0x2d8ea2[_0x34ac3f(0x153)](_0x16463d)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x286);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x1ca);async[a31_0x1cf65c(0x242)](_0x5932e6){const _0x52c6a2=a31_0x1cf65c,{options:_0x30fc86,args:_0x4763ab,tdx:_0x1d789c}=_0x5932e6,_0x4c4fea=_0x30fc86,_0x6d1cee=_0x4763ab[0x0]||_0x30fc86['parentSegment'];if(!_0x6d1cee)return showParentSegmentNotSetError(_0x52c6a2(0x141)+_0x52c6a2(0x1bb)),0x1;const _0x5b7233=resolveYamlFile(_0x6d1cee);if(!existsSync(_0x5b7233))return showFileNotFoundError(_0x5b7233,_0x6d1cee),0x1;_0x4c4fea[_0x52c6a2(0x148)]&&(console['error'](_0x52c6a2(0x1a3)+_0x4c4fea['site']),console[_0x52c6a2(0xff)](_0x52c6a2(0x2a4)+_0x5b7233));let _0x3884d3;try{_0x3884d3=readFileSync(_0x5b7233,_0x52c6a2(0xd7));}catch(_0x3dee15){const _0x143a07=_0x3dee15 instanceof Error?_0x3dee15['message']:String(_0x3dee15);return console[_0x52c6a2(0xff)]('Error\x20reading\x20file:\x20'+_0x143a07),0x1;}const _0x42fb7e=await withSpinner('Analyzing\x20changes...',()=>_0x1d789c[_0x52c6a2(0x106)]['pushParentYaml'](_0x3884d3),{'verbose':_0x4c4fea[_0x52c6a2(0x148)]}),_0x445812=_0x42fb7e[_0x52c6a2(0x20f)],{isNew:_0x2e5f13,name:_0x2231e2,hasChanges:_0x161e31,diffFormatted:_0xd603c5}=_0x445812;if(!_0x161e31)return console[_0x52c6a2(0xff)](_0x52c6a2(0x20c)+_0x2231e2+_0x52c6a2(0x2cd)),0x0;_0x2e5f13?console[_0x52c6a2(0xff)](_0x52c6a2(0x152)+_0x2231e2+'\x27:'):console[_0x52c6a2(0xff)](_0x52c6a2(0x29d)+_0x2231e2+'\x27:');console[_0x52c6a2(0xff)]('─'[_0x52c6a2(0x27f)](0x3c)),console[_0x52c6a2(0xff)](_0xd603c5),console[_0x52c6a2(0xff)]('─'[_0x52c6a2(0x27f)](0x3c));const _0x346d77=_0x2e5f13?_0x52c6a2(0x14e)+_0x2231e2+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x2231e2+'\x27?';if(!_0x4c4fea[_0x52c6a2(0x268)]){if(!isInteractive())return console['error'](a31_0x2d8ea2[_0x52c6a2(0x1f0)](_0x52c6a2(0x16a)),_0x52c6a2(0x108)),console[_0x52c6a2(0xff)](a31_0x2d8ea2[_0x52c6a2(0x1b3)](_0x52c6a2(0x1e6))),0x1;const _0x153961=await confirmKey(_0x346d77);if(!_0x153961)return console[_0x52c6a2(0xff)](a31_0x2d8ea2['yellow']('Aborted.')),0x1;}const _0x5ec5fa=_0x2e5f13?_0x52c6a2(0x104):_0x52c6a2(0x1a2),_0x5bcb0b=await withSpinner(_0x5ec5fa+'\x20parent\x20segment\x20\x27'+_0x2231e2+'\x27...',()=>_0x445812[_0x52c6a2(0x2de)](),{'verbose':_0x4c4fea['verbose']}),_0x39511f=_0x5bcb0b[_0x52c6a2(0x20f)],_0x285744=getConsoleNextUrl(_0x4c4fea[_0x52c6a2(0x22f)],_0x52c6a2(0x113)+_0x39511f['id']),_0x56caf5=_0x2e5f13?_0x52c6a2(0x207):_0x52c6a2(0xfa);return console['error']('✔\x20'+_0x56caf5+_0x52c6a2(0x1c4)+_0x39511f[_0x52c6a2(0x1fb)]+'\x27'),console[_0x52c6a2(0xff)]('\x20\x20'+_0x285744),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']='segment:parent:validate';[a31_0x1cf65c(0x1d6)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a31_0x1cf65c(0x242)](_0x140883){const _0x5d6f85=a31_0x1cf65c,{options:_0x114df9,args:_0x2b9e9,tdx:_0x2d1219}=_0x140883,_0x35c593=_0x114df9,_0x3a4095=_0x2b9e9[0x0]||_0x114df9[_0x5d6f85(0x128)];if(!_0x3a4095)return showParentSegmentNotSetError(_0x5d6f85(0x166)+_0x5d6f85(0x1b9)+_0x5d6f85(0x214)+_0x5d6f85(0x137)+_0x5d6f85(0x234)+_0x5d6f85(0x1e4)),0x1;const _0x1865e4=resolveYamlFile(_0x3a4095);if(!existsSync(_0x1865e4))return showFileNotFoundError(_0x1865e4,_0x3a4095),0x1;_0x35c593[_0x5d6f85(0x148)]&&(console[_0x5d6f85(0xff)](_0x5d6f85(0x1a3)+_0x35c593[_0x5d6f85(0x22f)]),console[_0x5d6f85(0xff)](_0x5d6f85(0x2a4)+_0x1865e4));let _0x20b6ec;try{_0x20b6ec=readFileSync(_0x1865e4,_0x5d6f85(0xd7));}catch(_0x6421df){const _0x43e717=_0x6421df instanceof Error?_0x6421df['message']:String(_0x6421df);return console['error'](_0x5d6f85(0x183)+_0x43e717),0x1;}const _0xff7cf1=createCommandSpinner(a31_0x2d8ea2[_0x5d6f85(0x1b3)](_0x5d6f85(0x1fd)),{'verbose':_0x35c593[_0x5d6f85(0x148)]});_0xff7cf1[_0x5d6f85(0x21d)]();const _0x182ed4={'onProgress':_0x21ad6=>{_0xff7cf1['text']=formatProgressMessage(_0x21ad6);}};if(_0x35c593['master'])_0x182ed4['master']=!![];if(_0x35c593['enriched'])_0x182ed4['enriched']=!![];_0x35c593[_0x5d6f85(0x17e)]&&(_0x182ed4[_0x5d6f85(0x17e)]=_0x35c593[_0x5d6f85(0x17e)]);_0x35c593['behavior']&&(_0x182ed4[_0x5d6f85(0xde)]=_0x35c593[_0x5d6f85(0xde)]);if(_0x35c593['interval'])_0x182ed4[_0x5d6f85(0xfc)]=_0x35c593[_0x5d6f85(0xfc)];let _0x5482e1;try{_0x5482e1=await _0x2d1219[_0x5d6f85(0x106)][_0x5d6f85(0x188)](_0x20b6ec,_0x182ed4),_0xff7cf1[_0x5d6f85(0x1c8)]();}catch(_0x1ac1d4){_0xff7cf1[_0x5d6f85(0x1c8)]();throw _0x1ac1d4;}const _0x353e7f=_0x35c593[_0x5d6f85(0xfc)]||_0x5d6f85(0x2c0);return this[_0x5d6f85(0x184)](_0x5482e1,_0x182ed4,_0x1865e4,_0x353e7f),_0x5482e1['allValid']?0x0:0x1;}[a31_0x1cf65c(0x184)](_0x108b4d,_0xb03f15,_0x2e4962,_0x13564c){const _0x9be4d6=a31_0x1cf65c;console[_0x9be4d6(0xff)]('\x0a'+a31_0x2d8ea2['bold'](_0x9be4d6(0x144))+'\x20'+_0x108b4d[_0x9be4d6(0x1fb)]),console[_0x9be4d6(0xff)]('═'[_0x9be4d6(0x27f)](0x3c)),this['displayMasterInfo'](_0x108b4d);if(typeof _0xb03f15[_0x9be4d6(0x17e)]==='string'){this['displayAttributesStats'](_0x108b4d),this[_0x9be4d6(0x1df)](_0x108b4d),this[_0x9be4d6(0x195)](_0x2e4962,_0x13564c,'attribute',_0xb03f15[_0x9be4d6(0x17e)]);return;}if(_0xb03f15[_0x9be4d6(0x17e)]===!![]){this[_0x9be4d6(0x29c)](_0x108b4d),this[_0x9be4d6(0x1df)](_0x108b4d),this[_0x9be4d6(0x195)](_0x2e4962,_0x13564c,_0x9be4d6(0x109));return;}if(typeof _0xb03f15['behavior']===_0x9be4d6(0x298)){this[_0x9be4d6(0x1f9)](_0x108b4d,_0x13564c),this[_0x9be4d6(0x1df)](_0x108b4d),this['displayPreviewHints'](_0x2e4962,_0x13564c,_0x9be4d6(0xde),_0xb03f15[_0x9be4d6(0xde)]);return;}if(_0xb03f15[_0x9be4d6(0xde)]===!![]){this['displayBehaviorsStats'](_0x108b4d,_0x13564c),this[_0x9be4d6(0x1df)](_0x108b4d),this[_0x9be4d6(0x195)](_0x2e4962,_0x13564c,_0x9be4d6(0x180));return;}this[_0x9be4d6(0x29c)](_0x108b4d),this[_0x9be4d6(0x1f9)](_0x108b4d,_0x13564c),this[_0x9be4d6(0x1ae)](_0x108b4d),this['displaySummary'](_0x108b4d),this[_0x9be4d6(0x195)](_0x2e4962,_0x13564c,_0x9be4d6(0x216));}[a31_0x1cf65c(0x1ae)](_0x493de0){displayRealtimeValidation(_0x493de0);}['displayPreviewHints'](_0x3d973f,_0x574682,_0x228849,_0x53e8ef){const _0x59fdeb=a31_0x1cf65c;console[_0x59fdeb(0xff)]('\x0a'+a31_0x2d8ea2['dim']('To\x20view\x20sample\x20data:'));const _0x34fd2e=_0x574682!==_0x59fdeb(0x2c0)?_0x59fdeb(0x212)+_0x574682:'';if(_0x228849===_0x59fdeb(0x17e)&&_0x53e8ef)console[_0x59fdeb(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x59fdeb(0x1b3)](_0x59fdeb(0x2ca)+_0x3d973f+_0x59fdeb(0x206)+_0x53e8ef+'\x22'+_0x34fd2e));else{if(_0x228849===_0x59fdeb(0xde)&&_0x53e8ef)console[_0x59fdeb(0xff)]('\x20\x20'+a31_0x2d8ea2['dim']('tdx\x20ps\x20preview\x20'+_0x3d973f+_0x59fdeb(0x18d)+_0x53e8ef+'\x22'+_0x34fd2e));else(_0x228849==='attributes'||_0x228849===_0x59fdeb(0x216))&&console[_0x59fdeb(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x59fdeb(0x1b3)](_0x59fdeb(0x2ca)+_0x3d973f+_0x59fdeb(0x264)+_0x34fd2e));}(_0x228849===_0x59fdeb(0x180)||_0x228849===_0x59fdeb(0x216))&&console[_0x59fdeb(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x59fdeb(0x1b3)](_0x59fdeb(0x2ca)+_0x3d973f+_0x59fdeb(0x167)+_0x34fd2e)),_0x228849===_0x59fdeb(0x216)&&console[_0x59fdeb(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x59fdeb(0x1b3)](_0x59fdeb(0x2ca)+_0x3d973f+'\x20--enriched'+_0x34fd2e));}[a31_0x1cf65c(0x162)](_0x5dc00c){const _0x233772=a31_0x1cf65c,{master:_0x4f01a6}=_0x5dc00c,_0x515fa9=_0x4f01a6[_0x233772(0xd9)]?a31_0x2d8ea2[_0x233772(0xee)]('✔'):a31_0x2d8ea2[_0x233772(0x1f0)]('✘');console[_0x233772(0xff)]('\x0a'+a31_0x2d8ea2[_0x233772(0x1b3)]('Master\x20Table')),console[_0x233772(0xff)](_0x515fa9+'\x20'+a31_0x2d8ea2[_0x233772(0x15b)](_0x4f01a6[_0x233772(0x11f)]+'.'+_0x4f01a6[_0x233772(0x2a2)])),_0x4f01a6[_0x233772(0xd9)]?_0x4f01a6['rowCount']!==undefined&&console[_0x233772(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x233772(0x1b3)](_0x233772(0x254))+'\x20'+a31_0x2d8ea2[_0x233772(0x153)](formatRows(_0x4f01a6[_0x233772(0x2ac)]))):console[_0x233772(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x233772(0x1f0)](_0x233772(0x1e7))+'\x20'+_0x4f01a6[_0x233772(0x279)]);}['displayAttributesStats'](_0x48abd1){const _0x2a1a0a=a31_0x1cf65c;if(_0x48abd1[_0x2a1a0a(0x109)][_0x2a1a0a(0x1a8)]===0x0)return;console['error']('\x0a'+a31_0x2d8ea2[_0x2a1a0a(0x1b3)]('Attributes'));for(const _0x31f9e2 of _0x48abd1[_0x2a1a0a(0x109)]){const _0x2e805c=_0x31f9e2['schemaValid']?a31_0x2d8ea2[_0x2a1a0a(0xee)]('✔'):a31_0x2d8ea2[_0x2a1a0a(0x1f0)]('✘');let _0x7746d6='';if(_0x31f9e2[_0x2a1a0a(0xd9)]&&_0x31f9e2[_0x2a1a0a(0x2e0)]!==undefined&&_0x31f9e2[_0x2a1a0a(0x232)]!==undefined){const _0x52a74f=_0x31f9e2[_0x2a1a0a(0x232)]['toFixed'](0x1),_0x453eb7=_0x31f9e2['coveragePercent']>=0x50?a31_0x2d8ea2['green']:_0x31f9e2[_0x2a1a0a(0x232)]>=0x32?a31_0x2d8ea2[_0x2a1a0a(0x168)]:a31_0x2d8ea2['red'];_0x7746d6='\x20'+a31_0x2d8ea2['dim']('Coverage:')+'\x20'+_0x453eb7(_0x52a74f+'%')+'\x20('+formatRows(_0x31f9e2[_0x2a1a0a(0x2e0)])+_0x2a1a0a(0x1bd);}console[_0x2a1a0a(0xff)](_0x2e805c+'\x20'+a31_0x2d8ea2[_0x2a1a0a(0x15b)](_0x31f9e2[_0x2a1a0a(0x1fb)])+_0x7746d6),console[_0x2a1a0a(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x2a1a0a(0x1b3)](_0x2a1a0a(0x14c))+'\x20'+a31_0x2d8ea2[_0x2a1a0a(0x15b)](_0x31f9e2[_0x2a1a0a(0x11f)]+'.'+_0x31f9e2[_0x2a1a0a(0x2a2)]));const _0x4d0dd9=_0x31f9e2[_0x2a1a0a(0xe0)]===_0x31f9e2['foreignKey']?a31_0x2d8ea2[_0x2a1a0a(0x1b3)](_0x2a1a0a(0x12c))+'\x20'+_0x31f9e2['joinKey']:a31_0x2d8ea2[_0x2a1a0a(0x1b3)]('Join:')+'\x20'+_0x31f9e2['joinKey']+'\x20=\x20'+_0x31f9e2['foreignKey'];console[_0x2a1a0a(0xff)]('\x20\x20'+_0x4d0dd9),console[_0x2a1a0a(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x2a1a0a(0x1b3)](_0x2a1a0a(0x1e1))),this[_0x2a1a0a(0x19d)](_0x31f9e2['columns']),!_0x31f9e2[_0x2a1a0a(0xd9)]&&console[_0x2a1a0a(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x2a1a0a(0x1f0)](_0x2a1a0a(0x1e7))+'\x20'+_0x31f9e2[_0x2a1a0a(0x279)]);}}[a31_0x1cf65c(0x1f9)](_0x179d30,_0x242a3d){const _0x1883b9=a31_0x1cf65c;if(_0x179d30[_0x1883b9(0x180)]['length']===0x0)return;console['error']('\x0a'+a31_0x2d8ea2[_0x1883b9(0x1b3)](_0x1883b9(0x28e))+'\x20'+a31_0x2d8ea2[_0x1883b9(0x1b3)]('('+_0x242a3d+')'));for(const _0x124efa of _0x179d30[_0x1883b9(0x180)]){const _0x12302f=_0x124efa[_0x1883b9(0xd9)]?a31_0x2d8ea2[_0x1883b9(0xee)]('✔'):a31_0x2d8ea2['red']('✘');let _0xa35416='';if(_0x124efa['schemaValid']&&_0x124efa[_0x1883b9(0x1b6)]!==undefined&&_0x124efa[_0x1883b9(0x2d9)]!==undefined){const _0x26b4ef=_0x124efa[_0x1883b9(0xf3)]?.[_0x1883b9(0x1bf)](0x1)||'?',_0x3089e4=(_0x124efa['customerPercent']??0x0)>=0x32?a31_0x2d8ea2[_0x1883b9(0xee)]:(_0x124efa[_0x1883b9(0xf3)]??0x0)>=0x14?a31_0x2d8ea2[_0x1883b9(0x168)]:a31_0x2d8ea2['red'];_0xa35416='\x20'+a31_0x2d8ea2[_0x1883b9(0x1b3)](_0x1883b9(0x223))+'\x20'+_0x3089e4(formatRows(_0x124efa[_0x1883b9(0x1b6)]))+'\x20('+_0x26b4ef+_0x1883b9(0x2cc)+a31_0x2d8ea2[_0x1883b9(0x1b3)](_0x1883b9(0x269))+'\x20'+a31_0x2d8ea2[_0x1883b9(0x153)](formatRows(_0x124efa[_0x1883b9(0x2d9)]));}console[_0x1883b9(0xff)](_0x12302f+'\x20'+a31_0x2d8ea2[_0x1883b9(0x15b)](_0x124efa['name'])+_0xa35416),console['error']('\x20\x20'+a31_0x2d8ea2[_0x1883b9(0x1b3)](_0x1883b9(0x14c))+'\x20'+a31_0x2d8ea2[_0x1883b9(0x15b)](_0x124efa['database']+'.'+_0x124efa['table']));const _0x2efced=_0x124efa['joinKey']===_0x124efa[_0x1883b9(0x2c1)]?a31_0x2d8ea2['dim'](_0x1883b9(0x12c))+'\x20'+_0x124efa[_0x1883b9(0xe0)]:a31_0x2d8ea2['dim']('Join:')+'\x20'+_0x124efa[_0x1883b9(0xe0)]+_0x1883b9(0x239)+_0x124efa[_0x1883b9(0x2c1)];console[_0x1883b9(0xff)]('\x20\x20'+_0x2efced),console[_0x1883b9(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x1883b9(0x1b3)](_0x1883b9(0x1e1))),this['displayColumns'](_0x124efa[_0x1883b9(0x24b)]),!_0x124efa['schemaValid']&&console[_0x1883b9(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x1883b9(0x1f0)](_0x1883b9(0x1e7))+'\x20'+_0x124efa[_0x1883b9(0x279)]);}}[a31_0x1cf65c(0x19d)](_0x4add18){const _0x2d06fd=a31_0x1cf65c;for(const _0x4c9345 of _0x4add18){_0x4c9345[_0x2d06fd(0x1e2)]===_0x4c9345['column']||_0x4c9345[_0x2d06fd(0x1a6)]==='*'?console[_0x2d06fd(0xff)](_0x2d06fd(0x125)+_0x4c9345[_0x2d06fd(0x1e2)]):console[_0x2d06fd(0xff)](_0x2d06fd(0x125)+_0x4c9345[_0x2d06fd(0x1e2)]+'\x20'+a31_0x2d8ea2[_0x2d06fd(0x1b3)]('('+_0x4c9345[_0x2d06fd(0x1a6)]+')'));}}[a31_0x1cf65c(0x1df)](_0x2d5db9){const _0x664e68=a31_0x1cf65c;console[_0x664e68(0xff)]('─'[_0x664e68(0x27f)](0x3c));if(_0x2d5db9['errors'][_0x664e68(0x1a8)]>0x0){console['error']('\x0a'+a31_0x2d8ea2[_0x664e68(0x1f0)](_0x664e68(0x25f)));for(const _0x137478 of _0x2d5db9[_0x664e68(0x132)]){console[_0x664e68(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x664e68(0x1f0)]('•')+'\x20'+_0x137478);}}_0x2d5db9[_0x664e68(0x135)]&&console['error']('\x0a'+a31_0x2d8ea2['green']('✔')+_0x664e68(0x1da));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x2ae);['description']=a31_0x1cf65c(0x284);async[a31_0x1cf65c(0x242)](_0x346ac1){const _0x56044b=a31_0x1cf65c,{options:_0x9c84f9,args:_0x32009f,tdx:_0x25d61c}=_0x346ac1,_0x5ac7a6=_0x9c84f9,_0x5d73b5=_0x32009f[0x0]||_0x9c84f9[_0x56044b(0x128)];if(!_0x5d73b5)return showParentSegmentNotSetError(_0x56044b(0x124)+_0x56044b(0x20a)+_0x56044b(0x256)+_0x56044b(0x2c7)+_0x56044b(0x179)+_0x56044b(0x2b5)+_0x56044b(0x249)+_0x56044b(0x1e4)),0x1;if(!_0x5ac7a6[_0x56044b(0x228)]&&!_0x5ac7a6[_0x56044b(0x17e)]&&!_0x5ac7a6['behavior']&&!_0x5ac7a6['enriched'])return console[_0x56044b(0xff)](a31_0x2d8ea2[_0x56044b(0x1f0)](_0x56044b(0x194))),console[_0x56044b(0xff)](_0x56044b(0x1bc)),console['error'](_0x56044b(0x227)),console[_0x56044b(0xff)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x56044b(0xff)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x56044b(0xff)](_0x56044b(0x14d)),console[_0x56044b(0xff)](_0x56044b(0x290)),0x1;const _0x3146b9=resolveYamlFile(_0x5d73b5);if(!existsSync(_0x3146b9))return showFileNotFoundError(_0x3146b9,_0x5d73b5),0x1;_0x5ac7a6['verbose']&&(console['error'](_0x56044b(0x1a3)+_0x5ac7a6['site']),console[_0x56044b(0xff)](_0x56044b(0x2a4)+_0x3146b9));let _0x2f2217;try{_0x2f2217=readFileSync(_0x3146b9,_0x56044b(0xd7));}catch(_0x1dcea0){const _0x11fb1f=_0x1dcea0 instanceof Error?_0x1dcea0[_0x56044b(0x24f)]:String(_0x1dcea0);return console[_0x56044b(0xff)](_0x56044b(0x183)+_0x11fb1f),0x1;}let _0x1e3ba2;try{_0x1e3ba2=parseDef(_0x2f2217);}catch(_0x4c4a00){const _0x3544c2=_0x4c4a00 instanceof Error?_0x4c4a00[_0x56044b(0x24f)]:String(_0x4c4a00);return console[_0x56044b(0xff)](a31_0x2d8ea2[_0x56044b(0x1f0)]('Error\x20parsing\x20YAML:\x20'+_0x3544c2)),0x1;}if(_0x5ac7a6[_0x56044b(0x17e)]===!![]||_0x5ac7a6[_0x56044b(0x17e)]===''){const _0x4c7f77=_0x1e3ba2[_0x56044b(0x109)]?.[_0x56044b(0x27e)](_0x5e68b8=>_0x5e68b8[_0x56044b(0x1fb)])||[];if(_0x4c7f77[_0x56044b(0x1a8)]===0x0)console['error'](a31_0x2d8ea2[_0x56044b(0x1f0)](_0x56044b(0x2aa)));else{console['error'](a31_0x2d8ea2['red'](_0x56044b(0xf0))),console[_0x56044b(0xff)]('Available\x20attributes:');for(const _0xb62f7b of _0x4c7f77){console[_0x56044b(0xff)]('\x20\x20'+a31_0x2d8ea2['cyan'](_0xb62f7b));}console[_0x56044b(0xff)](_0x56044b(0x13c)+_0x5d73b5+_0x56044b(0x206)+_0x4c7f77[0x0]+'\x22');}return 0x1;}if(_0x5ac7a6['behavior']===!![]||_0x5ac7a6['behavior']===''){const _0x3d5cf4=_0x1e3ba2['behaviors']?.[_0x56044b(0x27e)](_0x539cdd=>_0x539cdd['name'])||[];if(_0x3d5cf4['length']===0x0)console[_0x56044b(0xff)](a31_0x2d8ea2[_0x56044b(0x1f0)](_0x56044b(0x23b)));else{console[_0x56044b(0xff)](a31_0x2d8ea2[_0x56044b(0x1f0)](_0x56044b(0x1d9))),console[_0x56044b(0xff)](_0x56044b(0x1e0));for(const _0x4f75c9 of _0x3d5cf4){console[_0x56044b(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x56044b(0x153)](_0x4f75c9));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x5d73b5+_0x56044b(0x18d)+_0x3d5cf4[0x0]+'\x22');}return 0x1;}const _0x5340f1=createCommandSpinner(a31_0x2d8ea2[_0x56044b(0x1b3)]('Fetching\x20sample\x20data...'),{'verbose':_0x5ac7a6[_0x56044b(0x148)]});_0x5340f1['start']();const _0x39b4b2={'onProgress':_0x55d47b=>{const _0x5e0076=_0x56044b;_0x5340f1[_0x5e0076(0x293)]=formatProgressMessage(_0x55d47b);}};if(_0x5ac7a6[_0x56044b(0x228)])_0x39b4b2[_0x56044b(0x228)]=!![];if(_0x5ac7a6[_0x56044b(0x17e)]&&typeof _0x5ac7a6[_0x56044b(0x17e)]==='string')_0x39b4b2['attribute']=_0x5ac7a6['attribute'];if(_0x5ac7a6['behavior']&&typeof _0x5ac7a6['behavior']===_0x56044b(0x298))_0x39b4b2[_0x56044b(0xde)]=_0x5ac7a6[_0x56044b(0xde)];if(_0x5ac7a6[_0x56044b(0x151)])_0x39b4b2[_0x56044b(0x151)]=!![];if(_0x5ac7a6[_0x56044b(0xfc)])_0x39b4b2[_0x56044b(0xfc)]=_0x5ac7a6[_0x56044b(0xfc)];let _0x3dcced;try{_0x3dcced=await _0x25d61c[_0x56044b(0x106)][_0x56044b(0x107)](_0x2f2217,_0x39b4b2),_0x5340f1[_0x56044b(0x1c8)]();}catch(_0x5064d8){_0x5340f1[_0x56044b(0x1c8)]();throw _0x5064d8;}return await this[_0x56044b(0x178)](_0x3dcced,{'master':_0x5ac7a6['master'],'attribute':typeof _0x5ac7a6[_0x56044b(0x17e)]==='string'?_0x5ac7a6[_0x56044b(0x17e)]:undefined,'behavior':typeof _0x5ac7a6['behavior']===_0x56044b(0x298)?_0x5ac7a6[_0x56044b(0xde)]:undefined,'enriched':_0x5ac7a6[_0x56044b(0x151)]}),_0x3dcced[_0x56044b(0x135)]?0x0:0x1;}async['displayPreviewResults'](_0x568c5e,_0x457d50){const _0x2587d5=a31_0x1cf65c;console['error']('\x0a'+a31_0x2d8ea2[_0x2587d5(0x15b)](_0x2587d5(0x296))+'\x20'+_0x568c5e[_0x2587d5(0x1fb)]),console[_0x2587d5(0xff)]('═'[_0x2587d5(0x27f)](0x3c));if(_0x457d50[_0x2587d5(0x228)]&&_0x568c5e[_0x2587d5(0x2c9)]){const _0x2e64b9=a31_0x2d8ea2[_0x2587d5(0x1b3)](_0x2587d5(0x24e))+'\x20'+a31_0x2d8ea2[_0x2587d5(0x15b)](_0x568c5e[_0x2587d5(0x228)][_0x2587d5(0x11f)]+'.'+_0x568c5e[_0x2587d5(0x228)][_0x2587d5(0x2a2)]);await this[_0x2587d5(0x165)](_0x2e64b9,_0x568c5e[_0x2587d5(0x2c9)]);}else{if(_0x457d50[_0x2587d5(0x17e)]&&_0x568c5e['sampleData']){const _0x307fa1=a31_0x2d8ea2[_0x2587d5(0x1b3)](_0x2587d5(0x182))+'\x20'+a31_0x2d8ea2['bold'](_0x457d50['attribute']);await this[_0x2587d5(0x165)](_0x307fa1,_0x568c5e['sampleData']);}else{if(_0x457d50['behavior']&&_0x568c5e[_0x2587d5(0x2c9)]){const _0x18538b=a31_0x2d8ea2[_0x2587d5(0x1b3)](_0x2587d5(0x1ac))+'\x20'+a31_0x2d8ea2[_0x2587d5(0x15b)](_0x457d50[_0x2587d5(0xde)]);await this['displaySampleData'](_0x18538b,_0x568c5e[_0x2587d5(0x2c9)]);}else{if(_0x457d50[_0x2587d5(0x151)]&&_0x568c5e[_0x2587d5(0x2c9)]){const _0x2a9545=a31_0x2d8ea2[_0x2587d5(0x1b3)]('Enriched:')+'\x20'+a31_0x2d8ea2[_0x2587d5(0x15b)](_0x2587d5(0x281));await this['displaySampleData'](_0x2a9545,_0x568c5e[_0x2587d5(0x2c9)]);}else!_0x568c5e[_0x2587d5(0x2c9)]&&console[_0x2587d5(0xff)](_0x2587d5(0x278));}}}if(_0x568c5e[_0x2587d5(0x132)][_0x2587d5(0x1a8)]>0x0){console[_0x2587d5(0xff)]('─'[_0x2587d5(0x27f)](0x3c)),console[_0x2587d5(0xff)]('\x0a'+a31_0x2d8ea2['red'](_0x2587d5(0x25f)));for(const _0x4842e5 of _0x568c5e[_0x2587d5(0x132)]){console[_0x2587d5(0xff)]('\x20\x20'+a31_0x2d8ea2['red']('•')+'\x20'+_0x4842e5);}}}async['displaySampleData'](_0x41fd3c,_0x3d9be6){const _0x4bdb47=a31_0x1cf65c;if(_0x3d9be6[_0x4bdb47(0x1a8)]===0x0){console[_0x4bdb47(0xff)]('\x0a'+_0x41fd3c),console[_0x4bdb47(0xff)](_0x4bdb47(0x1eb));return;}console[_0x4bdb47(0xff)]('\x0a'+_0x41fd3c);const _0x218d21=Object[_0x4bdb47(0x21a)](_0x3d9be6[0x0])['map'](_0x2742f0=>({'name':_0x2742f0,'type':typeof _0x3d9be6[0x0][_0x2742f0]==='number'?_0x4bdb47(0x1c9):'varchar'})),_0x1ae41b={'queryId':_0x4bdb47(0x2bc),'columns':_0x218d21,'data':_0x3d9be6,'stats':{'state':_0x4bdb47(0x154),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3d9be6['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x4a31d8=formatAsTable(_0x1ae41b,_0x3d9be6['length'],!![]);await writeOutput(_0x4a31d8,undefined,_0x4bdb47(0x2a2));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x133);[a31_0x1cf65c(0x1d6)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async['execute'](_0x3a2aa3){const _0x2cc3f5=a31_0x1cf65c,{options:_0x5385af,args:_0x337e3e,tdx:_0x185cef}=_0x3a2aa3,_0x4b10f4=_0x5385af,_0x20f447=_0x337e3e[0x0]||_0x5385af[_0x2cc3f5(0x128)];if(!_0x20f447)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'+_0x2cc3f5(0x119)),0x1;const _0x1b42f5=resolveYamlFile(_0x20f447);if(existsSync(_0x1b42f5)){_0x4b10f4[_0x2cc3f5(0x148)]&&console[_0x2cc3f5(0xff)](_0x2cc3f5(0x255)+_0x1b42f5);let _0x551639;try{_0x551639=readFileSync(_0x1b42f5,'utf-8');}catch(_0x3e1958){const _0x5eb8e3=_0x3e1958 instanceof Error?_0x3e1958[_0x2cc3f5(0x24f)]:String(_0x3e1958);return console[_0x2cc3f5(0xff)]('Error\x20reading\x20file:\x20'+_0x5eb8e3),0x1;}const _0x43e9f0=await withSpinner(_0x2cc3f5(0x218),()=>_0x185cef[_0x2cc3f5(0x106)][_0x2cc3f5(0x18f)](_0x551639),{'verbose':_0x4b10f4[_0x2cc3f5(0x148)]}),_0x5abaed=_0x43e9f0['data'],{isNew:_0x58e34e,name:_0x365287,hasChanges:_0x4a605e,diffFormatted:_0x3497f8}=_0x5abaed;if(_0x4a605e){_0x58e34e?console[_0x2cc3f5(0xff)](_0x2cc3f5(0x152)+_0x365287+'\x27:'):console[_0x2cc3f5(0xff)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x365287+'\x27:');console[_0x2cc3f5(0xff)]('─'[_0x2cc3f5(0x27f)](0x3c)),console['error'](_0x3497f8),console[_0x2cc3f5(0xff)]('─'[_0x2cc3f5(0x27f)](0x3c));const _0x23e3ed=_0x58e34e?'Create\x20parent\x20segment\x20\x27'+_0x365287+'\x27\x20and\x20run\x20workflow?':'Apply\x20changes\x20to\x20\x27'+_0x365287+_0x2cc3f5(0x25a);if(!_0x4b10f4['yes']){if(!isInteractive())return console[_0x2cc3f5(0xff)](a31_0x2d8ea2[_0x2cc3f5(0x1f0)](_0x2cc3f5(0x16a)),_0x2cc3f5(0x108)),console[_0x2cc3f5(0xff)](a31_0x2d8ea2[_0x2cc3f5(0x1b3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3d141c=await confirmKey(_0x23e3ed);if(!_0x3d141c)return console[_0x2cc3f5(0xff)](a31_0x2d8ea2[_0x2cc3f5(0x168)](_0x2cc3f5(0x150))),0x1;}const _0x2488e3=_0x58e34e?'Creating':_0x2cc3f5(0x1a2);await withSpinner(_0x2488e3+_0x2cc3f5(0x1c4)+_0x365287+_0x2cc3f5(0x289),()=>_0x5abaed[_0x2cc3f5(0x2de)](),{'verbose':_0x4b10f4[_0x2cc3f5(0x148)]});const _0x51e59c=_0x58e34e?_0x2cc3f5(0x207):'Updated';console['error']('✔\x20'+_0x51e59c+_0x2cc3f5(0x1c4)+_0x365287+'\x27');}else console['error'](_0x2cc3f5(0x20c)+_0x365287+_0x2cc3f5(0x1a5));}const _0x367f64=await withSpinner(_0x2cc3f5(0x28d)+_0x20f447+_0x2cc3f5(0x289),()=>_0x185cef[_0x2cc3f5(0x106)][_0x2cc3f5(0x2c8)](_0x20f447),{'verbose':_0x4b10f4[_0x2cc3f5(0x148)]}),_0x13676d=_0x367f64[_0x2cc3f5(0x20f)],_0x2980f5=getConsoleUrl(_0x4b10f4[_0x2cc3f5(0x22f)],_0x2cc3f5(0x295)+_0x13676d['workflowId']+_0x2cc3f5(0x276)+_0x13676d[_0x2cc3f5(0x27c)]+_0x2cc3f5(0x142)+_0x13676d['workflowAttemptId']);return console[_0x2cc3f5(0xff)](_0x2cc3f5(0x2d0)),console[_0x2cc3f5(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x2cc3f5(0x1b3)]('Audience\x20ID:')+'\x20'+_0x13676d['audienceId']),console[_0x2cc3f5(0xff)]('\x20\x20'+a31_0x2d8ea2[_0x2cc3f5(0x1b3)](_0x2cc3f5(0x193))+'\x20'+_0x13676d[_0x2cc3f5(0x200)]),console['error']('\x20\x20'+a31_0x2d8ea2[_0x2cc3f5(0x1b3)](_0x2cc3f5(0x1b1))+'\x20'+_0x13676d[_0x2cc3f5(0x27c)]),console[_0x2cc3f5(0xff)]('\x20\x20'+a31_0x2d8ea2['dim']('Attempt:')+'\x20'+_0x13676d[_0x2cc3f5(0x18e)]),console[_0x2cc3f5(0xff)]('\x20\x20'+_0x2980f5),console[_0x2cc3f5(0xff)]('\x0a'+a31_0x2d8ea2['dim'](_0x2cc3f5(0x22a))+_0x2cc3f5(0x1d8)+_0x13676d[_0x2cc3f5(0x18e)]+_0x2cc3f5(0x2a9)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='segment:parent:fields';['description']=a31_0x1cf65c(0x21e);async['execute'](_0x14b096){const _0x1911ec=a31_0x1cf65c,{options:_0x4dd5a7,args:_0x323a33,tdx:_0x186526}=_0x14b096,_0x2035c4=_0x323a33[0x0]||_0x4dd5a7[_0x1911ec(0x128)];if(!_0x2035c4)return showParentSegmentNotSetError(_0x1911ec(0x25b)+_0x1911ec(0x222)),0x1;_0x4dd5a7[_0x1911ec(0x148)]&&(console[_0x1911ec(0xff)](_0x1911ec(0x1a3)+_0x4dd5a7['site']),console[_0x1911ec(0xff)](_0x1911ec(0x1e5)+_0x2035c4));const _0x11e217=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x2035c4+_0x1911ec(0x289),()=>_0x186526[_0x1911ec(0x106)][_0x1911ec(0x2c4)](_0x2035c4),{'verbose':_0x4dd5a7[_0x1911ec(0x148)]}),_0x217e1e=_0x11e217['data'];console[_0x1911ec(0xff)](_0x1911ec(0x29b)+_0x217e1e[_0x1911ec(0x1a8)]+'\x20field'+(_0x217e1e[_0x1911ec(0x1a8)]!==0x1?'s':''));if(_0x4dd5a7[_0x1911ec(0x2d4)]||_0x4dd5a7[_0x1911ec(0x237)])return await handleSDKOutput(_0x217e1e,_0x4dd5a7),0x0;return displayFieldsHumanReadable(_0x217e1e,_0x2035c4),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x1b4);['description']=a31_0x1cf65c(0xea);async['execute'](_0x30995f){const _0x218281=a31_0x1cf65c,{options:_0x11fff0,args:_0x94d3dd,tdx:_0x9857ce}=_0x30995f,_0x121561=_0x11fff0,_0x7af18=_0x94d3dd[0x0]||_0x11fff0[_0x218281(0x128)];if(!_0x7af18)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0x218281(0x229)+_0x218281(0x214)+_0x218281(0x292)),0x1;_0x11fff0[_0x218281(0x148)]&&(console[_0x218281(0xff)]('Site:\x20'+_0x11fff0['site']),console[_0x218281(0xff)](_0x218281(0x1e5)+_0x7af18));const _0x6b7f96=await withSpinner(_0x218281(0x2d6)+_0x7af18+_0x218281(0x289),()=>_0x9857ce[_0x218281(0x106)]['getParentFull'](_0x7af18),{'verbose':_0x11fff0[_0x218281(0x148)]}),_0x797b94=_0x6b7f96[_0x218281(0x20f)];if(_0x121561['web']){const _0x4fc909=getConsoleNextUrl(_0x121561['site'],_0x218281(0x113)+_0x797b94['id']);return console[_0x218281(0xff)](a31_0x2d8ea2[_0x218281(0xee)]('✔')+'\x20Opening\x20'+a31_0x2d8ea2['cyan'](_0x4fc909)),openBrowser(_0x4fc909),0x0;}return await handleSingleObjectOutput(_0x797b94,_0x11fff0),0x0;}}function a31_0x31f0(_0x27df21,_0x432b95){_0x27df21=_0x27df21-0xd6;const _0x321a97=a31_0x321a();let _0x31f0cf=_0x321a97[_0x27df21];return _0x31f0cf;}export class ParentSegmentDescCommand extends BaseCommand{['name']=a31_0x1cf65c(0x1a9);[a31_0x1cf65c(0x1d6)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a31_0x1cf65c(0x242)](_0x157817){const _0x1289db=a31_0x1cf65c,{options:_0x35b63f,args:_0x2707a1,tdx:_0x644420}=_0x157817,_0x4926d7=_0x35b63f,_0x51312a=_0x2707a1[0x0]||_0x35b63f[_0x1289db(0x128)];if(!_0x51312a)return showParentSegmentNotSetError(_0x1289db(0x1cf)+_0x1289db(0x158)+_0x1289db(0x214)+_0x1289db(0x247)),0x1;_0x35b63f[_0x1289db(0x148)]&&(console[_0x1289db(0xff)](_0x1289db(0x1a3)+_0x35b63f[_0x1289db(0x22f)]),console['error']('Parent\x20segment:\x20'+_0x51312a));const _0x5be2d1=await withSpinner(_0x1289db(0x126)+_0x51312a+_0x1289db(0x289),()=>_0x644420[_0x1289db(0x106)][_0x1289db(0x2d8)](_0x51312a),{'verbose':_0x35b63f[_0x1289db(0x148)]}),_0x7942c7=_0x5be2d1['data'],_0x204ffa=_0x644420[_0x1289db(0x106)]['getOutputDatabaseName'](_0x7942c7);if(_0x4926d7[_0x1289db(0x123)]){const _0x3cbda7=await this['collectSchema'](_0x157817,_0x51312a,_0x7942c7,_0x204ffa),_0x1d7ecb=this[_0x1289db(0x2b4)](_0x3cbda7);writeFileSync(_0x4926d7[_0x1289db(0x123)],_0x1d7ecb);const _0x144840=_0x3cbda7[_0x1289db(0x2b2)][_0x1289db(0x24b)][_0x1289db(0x1a8)]+_0x3cbda7[_0x1289db(0x180)]['reduce']((_0x400dbc,_0x1bdb7a)=>_0x400dbc+_0x1bdb7a[_0x1289db(0x24b)][_0x1289db(0x1a8)],0x0),_0x2635f0=_0x3cbda7['behaviors']['filter'](_0x5cd108=>_0x5cd108[_0x1289db(0x24b)][_0x1289db(0x1a8)]===0x0)[_0x1289db(0x1a8)];return console[_0x1289db(0x25e)](_0x1289db(0x1d0)+_0x4926d7['output']),console['log'](_0x1289db(0x28a)+_0x204ffa),console[_0x1289db(0x25e)](_0x1289db(0x18c)+_0x3cbda7[_0x1289db(0x180)][_0x1289db(0x1a8)]+_0x1289db(0x26e)),console['log'](_0x1289db(0x2e1)+_0x144840+_0x1289db(0x2cf)),_0x2635f0>0x0&&console[_0x1289db(0x25e)](_0x1289db(0x12d)+_0x2635f0+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console[_0x1289db(0xff)]('\x0a'+a31_0x2d8ea2[_0x1289db(0x15b)](_0x1289db(0x27d))+'\x20'+a31_0x2d8ea2['cyan'](_0x204ffa));const _0x1976cd=await withSpinner(_0x1289db(0x1ff),()=>_0x644420['segment'][_0x1289db(0x147)](_0x7942c7),{'verbose':_0x35b63f['verbose']});console[_0x1289db(0xff)]('\x0a'+a31_0x2d8ea2[_0x1289db(0x15b)](_0x1289db(0x2b2))+'\x20'+a31_0x2d8ea2[_0x1289db(0x1b3)]('('+_0x204ffa+_0x1289db(0xeb)));const _0x107dc5=await executeSchemaQuery(_0x1976cd[_0x1289db(0x20f)],_0x644420,_0x35b63f);await handleQueryOutput(_0x107dc5,_0x35b63f);const _0x3148fa=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x644420[_0x1289db(0x106)][_0x1289db(0x159)](_0x7942c7),{'verbose':_0x35b63f[_0x1289db(0x148)]});for(const _0x4944e8 of _0x3148fa[_0x1289db(0x20f)]){const _0x188325=_0x1289db(0x2a5)+_0x4944e8[_0x1289db(0x2d2)]()[_0x1289db(0x1d1)](/\s+/g,'_'),_0xfe7b4=_0x1289db(0x236)+_0x204ffa+'.'+_0x188325;console[_0x1289db(0xff)]('\x0a'+a31_0x2d8ea2[_0x1289db(0x15b)](_0x4944e8)+'\x20'+a31_0x2d8ea2[_0x1289db(0x1b3)]('('+_0x204ffa+'.'+_0x188325+')'));try{const _0x4d15a8=await executeSchemaQuery(_0xfe7b4,_0x644420,_0x35b63f);await handleQueryOutput(_0x4d15a8,_0x35b63f);}catch{console[_0x1289db(0xff)](a31_0x2d8ea2[_0x1289db(0x168)](_0x1289db(0x1ad)));}}return 0x0;}async['collectSchema'](_0x1cfefd,_0x5bfdf0,_0x116e77,_0x587d89){const _0xdc4044=a31_0x1cf65c,{options:_0x5c396f,tdx:_0x169a04}=_0x1cfefd,_0x56d47d=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x169a04[_0xdc4044(0x106)]['getParentSQL'](_0x116e77),{'verbose':_0x5c396f[_0xdc4044(0x148)]}),_0x2aca3b=await executeSchemaQuery(_0x56d47d[_0xdc4044(0x20f)],_0x169a04,_0x5c396f),_0xf7ad4a=_0x2aca3b[_0xdc4044(0x20f)]['map'](_0x14d71d=>({'name':_0x14d71d[_0xdc4044(0x114)],'type':_0x14d71d[_0xdc4044(0x253)]})),_0xa414aa=await withSpinner(_0xdc4044(0x26a),()=>_0x169a04[_0xdc4044(0x106)][_0xdc4044(0x159)](_0x116e77),{'verbose':_0x5c396f[_0xdc4044(0x148)]}),_0x3ec40c=[];for(const _0x3c753e of _0xa414aa[_0xdc4044(0x20f)]){const _0x1b46ca=_0xdc4044(0x2a5)+_0x3c753e['toLowerCase']()[_0xdc4044(0x1d1)](/\s+/g,'_'),_0x190951=_0xdc4044(0x236)+_0x587d89+'.'+_0x1b46ca;let _0x265d7b=[];try{const _0xb95934=await executeSchemaQuery(_0x190951,_0x169a04,_0x5c396f);_0x265d7b=_0xb95934[_0xdc4044(0x20f)][_0xdc4044(0x27e)](_0x58ce2b=>({'name':_0x58ce2b['column_name'],'type':_0x58ce2b['column_type']}));}catch{}_0x3ec40c['push']({'table':_0x1b46ca,'columns':_0x265d7b});}return{'database':_0x587d89,'parent_segment':_0x5bfdf0,'parent_id':_0x116e77,'customers':{'table':_0xdc4044(0x2b2),'columns':_0xf7ad4a},'behaviors':_0x3ec40c};}['formatSchemaJson'](_0xf61d3f){const _0x29a1c2=a31_0x1cf65c,_0x1c11ea=_0x48b993=>{const _0x17c0cf=a31_0x31f0;if(_0x48b993[_0x17c0cf(0x1a8)]===0x0)return'[]';const _0x1e6a6a=_0x48b993['map'](_0x323ef4=>_0x17c0cf(0x266)+_0x323ef4[_0x17c0cf(0x1fb)]+_0x17c0cf(0x14f)+_0x323ef4['type']+_0x17c0cf(0x12e));return'[\x0a'+_0x1e6a6a[_0x17c0cf(0x1ba)](',\x0a')+_0x17c0cf(0x211);},_0x8c1715=_0xf61d3f[_0x29a1c2(0x180)][_0x29a1c2(0x27e)](_0x11d4e2=>{const _0x229853=_0x29a1c2;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x11d4e2['table']+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x1c11ea(_0x11d4e2[_0x229853(0x24b)])[_0x229853(0x1d1)](/^/gm,'\x20\x20')[_0x229853(0x115)]()+_0x229853(0x2b7);})['join'](',\x0a');return _0x29a1c2(0x15c)+_0xf61d3f[_0x29a1c2(0x11f)]+_0x29a1c2(0x23e)+_0xf61d3f[_0x29a1c2(0x2dd)]+_0x29a1c2(0x1e9)+_0xf61d3f[_0x29a1c2(0x1fe)]+_0x29a1c2(0x22c)+_0xf61d3f['customers'][_0x29a1c2(0x2a2)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x1c11ea(_0xf61d3f[_0x29a1c2(0x2b2)][_0x29a1c2(0x24b)])[_0x29a1c2(0x1d1)](/^/gm,'\x20\x20')[_0x29a1c2(0x115)]()+_0x29a1c2(0x1f8)+_0x8c1715+_0x29a1c2(0x1a0);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='segment:parent:sql';['description']='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a31_0x1cf65c(0x242)](_0x9989b2){const _0xe11551=a31_0x1cf65c,{options:_0x2da14a,args:_0xd08f43,tdx:_0xe56265}=_0x9989b2,_0x2839d6=_0xd08f43[0x0]||_0x2da14a['parentSegment'];if(!_0x2839d6)return showParentSegmentNotSetError(_0xe11551(0xe3)+_0xe11551(0x19a)),0x1;_0x2da14a[_0xe11551(0x148)]&&(console[_0xe11551(0xff)]('Site:\x20'+_0x2da14a[_0xe11551(0x22f)]),console[_0xe11551(0xff)](_0xe11551(0x1e5)+_0x2839d6));const _0x5a0059=await withSpinner(_0xe11551(0x126)+_0x2839d6+_0xe11551(0x289),()=>_0xe56265[_0xe11551(0x106)][_0xe11551(0x2d8)](_0x2839d6),{'verbose':_0x2da14a[_0xe11551(0x148)]}),_0x4c43db=_0x5a0059['data'],_0x444719=await withSpinner(_0xe11551(0x27a)+_0x2839d6+'\x27...',()=>_0xe56265[_0xe11551(0x106)][_0xe11551(0x147)](_0x4c43db),{'verbose':_0x2da14a[_0xe11551(0x148)]}),_0x2b462d=_0x444719[_0xe11551(0x20f)];return _0x2da14a[_0xe11551(0x2c5)]===_0xe11551(0x2d4)||_0x2da14a[_0xe11551(0x2c5)]===_0xe11551(0x237)?await handleSDKOutput([{'sql':_0x2b462d}],_0x2da14a):console[_0xe11551(0x25e)](_0x2b462d),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='segment:parent:show';['description']=a31_0x1cf65c(0x127);async[a31_0x1cf65c(0x242)](_0x20826e){const _0x585cb2=a31_0x1cf65c,{options:_0x4f4da7,args:_0x191f06,tdx:_0x28b796}=_0x20826e,_0x1cd02e=_0x191f06[0x0]||_0x4f4da7['parentSegment'];if(!_0x1cd02e)return showParentSegmentNotSetError(_0x585cb2(0x146)+_0x585cb2(0x2b0)),0x1;_0x4f4da7[_0x585cb2(0x148)]&&(console['error'](_0x585cb2(0x1a3)+_0x4f4da7[_0x585cb2(0x22f)]),console[_0x585cb2(0xff)](_0x585cb2(0x1e5)+_0x1cd02e));const _0x44c57f=await withSpinner(_0x585cb2(0x126)+_0x1cd02e+'\x27...',()=>_0x28b796[_0x585cb2(0x106)][_0x585cb2(0x2d8)](_0x1cd02e),{'verbose':_0x4f4da7[_0x585cb2(0x148)]}),_0x917451=_0x44c57f[_0x585cb2(0x20f)],_0x470732=await withSpinner(_0x585cb2(0x27a)+_0x1cd02e+_0x585cb2(0x289),()=>_0x28b796[_0x585cb2(0x106)]['getParentSQL'](_0x917451),{'verbose':_0x4f4da7[_0x585cb2(0x148)]});let _0x43d9e0=_0x470732[_0x585cb2(0x20f)];const _0x396273=resolveLimit(_0x4f4da7[_0x585cb2(0x285)],DEFAULT_DISPLAY_LIMIT),_0x1d62c9=/\bLIMIT\s+\d+/i[_0x585cb2(0xf8)](_0x43d9e0);!_0x1d62c9&&(_0x43d9e0=_0x43d9e0['trim']()[_0x585cb2(0x1d1)](/;+$/,''),_0x43d9e0=_0x585cb2(0x1f3)+_0x43d9e0+_0x585cb2(0x175)+_0x396273);_0x4f4da7[_0x585cb2(0x148)]&&console[_0x585cb2(0xff)](_0x585cb2(0x161)+_0x43d9e0);const _0x47f8ad=await withProgressSpinner(_0x585cb2(0x17c),async _0x1f66cf=>{const _0x4ed19f=_0x585cb2,_0x38793c=await _0x28b796[_0x4ed19f(0x25d)]['execute'](_0x43d9e0,{'catalog':'td','schema':_0x4ed19f(0x2db),'onJobId':_0x24f72b=>{const _0x3ef29b=_0x4ed19f;_0x1f66cf[_0x3ef29b(0x208)](_0x24f72b);}});return _0x38793c;},{'verbose':_0x4f4da7['verbose']}),_0x27b345=_0x47f8ad[_0x585cb2(0x20f)],_0x1b924c=_0x27b345[_0x585cb2(0x116)]?_0x585cb2(0x251)+_0x27b345['jobId']+']':'';return console['error'](_0x585cb2(0x1cd)+_0x27b345['stats'][_0x585cb2(0x16e)][_0x585cb2(0x192)]()+_0x585cb2(0x20d)+(_0x585cb2(0x129)+formatElapsed(_0x27b345[_0x585cb2(0xd8)]['elapsedTimeMillis'])+_0x1b924c)),await handleQueryOutput(_0x27b345,_0x4f4da7),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x15d);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x2bd);async['execute'](_0x58046b){const _0xe3b67f=a31_0x1cf65c,{options:_0xa6c7ba,args:_0x5a4216,tdx:_0x2e5a66}=_0x58046b,_0x268cd6=_0x5a4216[0x0],_0x23e1f4=await withSpinner(_0x268cd6?_0xe3b67f(0x1ea)+_0x268cd6+_0xe3b67f(0x289):_0xe3b67f(0x246),()=>_0x2e5a66[_0xe3b67f(0x297)][_0xe3b67f(0x103)](),{'verbose':_0xa6c7ba[_0xe3b67f(0x148)]});let _0x57d666=_0x23e1f4['data'][_0xe3b67f(0x1b0)](_0x1a14ed=>_0x1a14ed[_0xe3b67f(0x2be)]);if(_0x268cd6){const _0x228a3b=_0x268cd6[_0xe3b67f(0x1d1)](/[.+^${}()|[\]\\]/g,_0xe3b67f(0x1c7))[_0xe3b67f(0x1d1)](/\*/g,'.*')[_0xe3b67f(0x1d1)](/\?/g,'.'),_0x4674b8=new RegExp('^'+_0x228a3b+'$','i');_0x57d666=_0x57d666[_0xe3b67f(0x1b0)](_0x343f46=>_0x4674b8[_0xe3b67f(0xf8)](_0x343f46[_0xe3b67f(0x1fb)]));}_0x57d666[_0xe3b67f(0x1cc)]((_0x1651e4,_0x3f1247)=>_0x1651e4['name'][_0xe3b67f(0x1d2)](_0x3f1247['name'])),console[_0xe3b67f(0xff)](_0xe3b67f(0x29b)+_0x57d666[_0xe3b67f(0x1a8)]+_0xe3b67f(0x288)+(_0x57d666['length']!==0x1?'s':''));const _0x164b9b=_0x1b9d6b=>{const _0x2c1c10=_0xe3b67f;return getConsoleNextUrl(_0xa6c7ba['site'],_0x2c1c10(0x113)+_0x1b9d6b);};if(_0xa6c7ba[_0xe3b67f(0x2c5)]===_0xe3b67f(0x2d4)||_0xa6c7ba[_0xe3b67f(0x2c5)]==='jsonl'){const _0x2df0fc=_0x57d666['map'](_0x361886=>({..._0x361886,'url':_0x164b9b(_0x361886['id'])}));await handleSDKOutput(_0x2df0fc,_0xa6c7ba);}else{if(_0x57d666[_0xe3b67f(0x1a8)]===0x0)console[_0xe3b67f(0x25e)](_0xe3b67f(0x1b5));else for(const _0x2cc231 of _0x57d666){const _0x319793=_0x2cc231[_0xe3b67f(0x22d)]?a31_0x2d8ea2[_0xe3b67f(0x1b3)]('\x20('+formatRows(_0x2cc231[_0xe3b67f(0x22d)])+')'):'',_0xe7c734=hyperlink(_0x2cc231['name'],_0x164b9b(_0x2cc231['id']));console['log']('⚡\x20'+_0xe7c734+_0x319793);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x1cf65c(0x1dc);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x201);async['execute'](_0x342f7f){const _0x43ac5c=a31_0x1cf65c,{options:_0x4b274b,args:_0x3e5c09,tdx:_0x4872b9}=_0x342f7f,_0x4b21ea=_0x3e5c09[0x0]||_0x4b274b[_0x43ac5c(0x128)];if(!_0x4b21ea)return showParentSegmentNotSetError(_0x43ac5c(0xed)+_0x43ac5c(0x1f4)),0x1;const _0x3ef2e3=resolveYamlFile(_0x4b21ea);if(!existsSync(_0x3ef2e3))return showFileNotFoundError(_0x3ef2e3,_0x4b21ea),0x1;let _0x3902f5;try{_0x3902f5=readFileSync(_0x3ef2e3,_0x43ac5c(0xd7));}catch(_0xe8a07c){const _0xb2d31f=_0xe8a07c instanceof Error?_0xe8a07c[_0x43ac5c(0x24f)]:String(_0xe8a07c);return console[_0x43ac5c(0xff)]('Error\x20reading\x20file:\x20'+_0xb2d31f),0x1;}const _0x4027e8=createCommandSpinner(a31_0x2d8ea2[_0x43ac5c(0x1b3)](_0x43ac5c(0x15f)),{'verbose':_0x4b274b[_0x43ac5c(0x148)]});_0x4027e8[_0x43ac5c(0x21d)]();const _0x292b87={'realtime':!![],'onProgress':_0x2aa05d=>{_0x4027e8['text']=formatProgressMessage(_0x2aa05d);}};let _0x1a5d32;try{_0x1a5d32=await _0x4872b9[_0x43ac5c(0x106)][_0x43ac5c(0x188)](_0x3902f5,_0x292b87),_0x4027e8[_0x43ac5c(0x1c8)]();}catch(_0x22e8c7){_0x4027e8[_0x43ac5c(0x1c8)]();throw _0x22e8c7;}console['error']('\x0a'+a31_0x2d8ea2[_0x43ac5c(0x15b)](_0x43ac5c(0x16f))+'\x20'+_0x1a5d32[_0x43ac5c(0x1fb)]),console['error']('═'[_0x43ac5c(0x27f)](0x3c)),displayRealtimeValidation(_0x1a5d32),console[_0x43ac5c(0xff)]('─'['repeat'](0x3c));if(_0x1a5d32['errors'][_0x43ac5c(0x1a8)]>0x0){console[_0x43ac5c(0xff)]('\x0a'+a31_0x2d8ea2[_0x43ac5c(0x1f0)]('Errors:'));for(const _0x43a5e8 of _0x1a5d32[_0x43ac5c(0x132)]){console[_0x43ac5c(0xff)]('\x20\x20'+a31_0x2d8ea2['red']('•')+'\x20'+_0x43a5e8);}}return _0x1a5d32[_0x43ac5c(0x135)]&&console[_0x43ac5c(0xff)]('\x0a'+a31_0x2d8ea2[_0x43ac5c(0xee)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x1a5d32['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x280);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x240);async['execute'](_0x2cf6eb){const _0x104843=a31_0x1cf65c,{options:_0x5a82b0,args:_0x5f21fe,tdx:_0x17639c}=_0x2cf6eb,_0x3f3264=_0x5f21fe[0x0]||_0x5a82b0[_0x104843(0x128)];if(!_0x3f3264)return showParentSegmentNotSetError(_0x104843(0x1ed)+_0x104843(0x263)),0x1;_0x5a82b0[_0x104843(0x148)]&&(console['error'](_0x104843(0x1a3)+_0x5a82b0[_0x104843(0x22f)]),console['error'](_0x104843(0x1e5)+_0x3f3264));const _0x4cf6ad=await withSpinner(_0x104843(0x126)+_0x3f3264+_0x104843(0x289),()=>_0x17639c[_0x104843(0x106)][_0x104843(0x2d8)](_0x3f3264),{'verbose':_0x5a82b0[_0x104843(0x148)]}),_0x1fff64=_0x4cf6ad[_0x104843(0x20f)],_0x314918=await withSpinner(_0x104843(0x19e)+_0x3f3264+_0x104843(0x289),()=>_0x17639c['realtime']['listJourneys'](_0x1fff64),{'verbose':_0x5a82b0[_0x104843(0x148)]}),_0x3239c1=_0x314918[_0x104843(0x20f)];console['error']('✔\x20Found\x20'+_0x3239c1[_0x104843(0x1a8)]+_0x104843(0x1b2)+(_0x3239c1[_0x104843(0x1a8)]!==0x1?'s':''));if(_0x5a82b0['format']===_0x104843(0x2d4)||_0x5a82b0[_0x104843(0x2c5)]===_0x104843(0x237))await handleSDKOutput(_0x3239c1,_0x5a82b0);else{if(_0x3239c1[_0x104843(0x1a8)]===0x0)console[_0x104843(0x25e)]('No\x20RT\x20journeys\x20found');else for(const _0xfd7b47 of _0x3239c1){const _0x10a686=_0xfd7b47[_0x104843(0x2cb)]===_0x104843(0x225)?'🚀':'📝',_0x36d9ab=_0xfd7b47[_0x104843(0x1c6)]?a31_0x2d8ea2[_0x104843(0x168)]('\x20(paused)'):'',_0x7e0617=a31_0x2d8ea2[_0x104843(0x1b3)]('\x20('+_0xfd7b47['stageCount']+'\x20stage'+(_0xfd7b47[_0x104843(0x15e)]!==0x1?'s':'')+')');console['log'](_0x10a686+'\x20'+_0xfd7b47['name']+_0x36d9ab+_0x7e0617);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{['name']='ps:rt:jn:pause';[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x164);async[a31_0x1cf65c(0x242)](_0x20dc31){const _0x5b054b=a31_0x1cf65c,{options:_0x1607fc,args:_0x240dff,tdx:_0x2d1572}=_0x20dc31,_0x3ade0e=_0x240dff[0x0];if(!_0x3ade0e)return console[_0x5b054b(0xff)](a31_0x2d8ea2[_0x5b054b(0x1f0)](_0x5b054b(0x2d3))),console[_0x5b054b(0xff)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console['error'](a31_0x2d8ea2[_0x5b054b(0x1b3)](_0x5b054b(0x23c))),0x1;_0x1607fc[_0x5b054b(0x148)]&&(console[_0x5b054b(0xff)](_0x5b054b(0x1a3)+_0x1607fc[_0x5b054b(0x22f)]),console[_0x5b054b(0xff)](_0x5b054b(0x16c)+_0x3ade0e));const _0x48154c=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x3ade0e+_0x5b054b(0x289),()=>_0x2d1572[_0x5b054b(0x297)][_0x5b054b(0x24d)](_0x3ade0e),{'verbose':_0x1607fc[_0x5b054b(0x148)]}),_0x5f4075=_0x48154c['data'];console[_0x5b054b(0xff)](_0x5b054b(0x172)+_0x5f4075['name']+'\x27');if(_0x1607fc[_0x5b054b(0x2c5)]===_0x5b054b(0x2d4)||_0x1607fc[_0x5b054b(0x2c5)]==='jsonl')await handleSDKOutput([_0x5f4075],_0x1607fc);else{const _0x599a77=_0x5f4075[_0x5b054b(0x2cb)]===_0x5b054b(0x225)?'🚀':'📝',_0x37610c=_0x5f4075[_0x5b054b(0x1c6)]?a31_0x2d8ea2[_0x5b054b(0x168)](_0x5b054b(0x26b)):'';console[_0x5b054b(0x25e)](_0x599a77+'\x20'+_0x5f4075[_0x5b054b(0x1fb)]+_0x37610c);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x252);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x110);async[a31_0x1cf65c(0x242)](_0x1dde23){const _0x681e93=a31_0x1cf65c,{options:_0x4a913c,args:_0x5d45af,tdx:_0x10ed03}=_0x1dde23,_0x59917d=_0x5d45af[0x0];if(!_0x59917d)return console['error'](a31_0x2d8ea2['red'](_0x681e93(0x2d3))),console[_0x681e93(0xff)](_0x681e93(0x1cb)),console[_0x681e93(0xff)](a31_0x2d8ea2[_0x681e93(0x1b3)](_0x681e93(0x23c))),0x1;_0x4a913c[_0x681e93(0x148)]&&(console['error'](_0x681e93(0x1a3)+_0x4a913c[_0x681e93(0x22f)]),console['error']('RT\x20Journey\x20ID:\x20'+_0x59917d));const _0x4789b7=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x59917d+_0x681e93(0x289),()=>_0x10ed03[_0x681e93(0x297)]['resumeJourney'](_0x59917d),{'verbose':_0x4a913c[_0x681e93(0x148)]}),_0x5831ad=_0x4789b7[_0x681e93(0x20f)];console[_0x681e93(0xff)]('✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x5831ad[_0x681e93(0x1fb)]+'\x27');if(_0x4a913c[_0x681e93(0x2c5)]==='json'||_0x4a913c[_0x681e93(0x2c5)]===_0x681e93(0x237))await handleSDKOutput([_0x5831ad],_0x4a913c);else{const _0x49747d=_0x5831ad['state']===_0x681e93(0x225)?'🚀':'📝',_0x3fd8e5=_0x5831ad[_0x681e93(0x1c6)]?a31_0x2d8ea2[_0x681e93(0x168)]('\x20(paused)'):'';console['log'](_0x49747d+'\x20'+_0x5831ad[_0x681e93(0x1fb)]+_0x3fd8e5);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x2e2);['description']=a31_0x1cf65c(0x101);async[a31_0x1cf65c(0x242)](_0x52a646){const _0x446345=a31_0x1cf65c,{options:_0x3aec3d,args:_0x5e0435,tdx:_0x54d78a}=_0x52a646,_0xd6aeb1=_0x5e0435[0x0]||_0x3aec3d[_0x446345(0x128)];if(!_0xd6aeb1)return showParentSegmentNotSetError(_0x446345(0x29a)+_0x446345(0x12a)),0x1;_0x3aec3d[_0x446345(0x148)]&&(console[_0x446345(0xff)](_0x446345(0x1a3)+_0x3aec3d[_0x446345(0x22f)]),console[_0x446345(0xff)](_0x446345(0x1e5)+_0xd6aeb1));const _0x3ebf2d=await withSpinner(_0x446345(0x126)+_0xd6aeb1+_0x446345(0x289),()=>_0x54d78a['segment']['resolveParentId'](_0xd6aeb1),{'verbose':_0x3aec3d[_0x446345(0x148)]}),_0x3d0d41=_0x3ebf2d['data'],_0x37e92a=await withSpinner('Getting\x20RT\x20configuration\x20version\x20for\x20\x27'+_0xd6aeb1+'\x27...',()=>_0x54d78a[_0x446345(0x297)]['getCurrentConfigVersion'](_0x3d0d41),{'verbose':_0x3aec3d[_0x446345(0x148)]}),_0x134e6a=_0x37e92a[_0x446345(0x20f)];return console[_0x446345(0xff)](_0x446345(0xf5)),_0x3aec3d['format']===_0x446345(0x2d4)||_0x3aec3d[_0x446345(0x2c5)]===_0x446345(0x237)?await handleSDKOutput([_0x134e6a],_0x3aec3d):(console['log']('id:\x20'+_0x134e6a['id']),console[_0x446345(0x25e)](_0x446345(0x1c2)+_0x134e6a[_0x446345(0x13e)]),console[_0x446345(0x25e)]('identifier:\x20'+_0x134e6a[_0x446345(0x22e)]),console['log'](_0x446345(0x283)+_0x134e6a['eventKind']),console[_0x446345(0x25e)]('status:\x20'+_0x134e6a[_0x446345(0x200)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x15a);['description']=a31_0x1cf65c(0x205);async['execute'](_0x5e7f4c){const _0x55640d=a31_0x1cf65c,{options:_0x4b4a9c,args:_0x2a7d05,tdx:_0x33ce9c}=_0x5e7f4c,_0x302706=_0x2a7d05[0x0]||_0x4b4a9c['parentSegment'];if(!_0x302706)return showParentSegmentNotSetError(_0x55640d(0xd6)+_0x55640d(0x248)),0x1;const _0x506b03=await withSpinner(_0x55640d(0x126)+_0x302706+_0x55640d(0x289),()=>_0x33ce9c['segment']['resolveParentId'](_0x302706),{'verbose':_0x4b4a9c[_0x55640d(0x148)]}),_0x521965=_0x506b03[_0x55640d(0x20f)],_0x3d9c17=await withSpinner(_0x55640d(0x27b)+_0x302706+_0x55640d(0x289),()=>_0x33ce9c[_0x55640d(0x271)][_0x55640d(0x103)](_0x521965),{'verbose':_0x4b4a9c[_0x55640d(0x148)]}),_0x36b4e1=_0x3d9c17['data'];console['error'](_0x55640d(0x29b)+_0x36b4e1[_0x55640d(0x1a8)]+_0x55640d(0x1db)+(_0x36b4e1[_0x55640d(0x1a8)]!==0x1?'s':''));if(_0x4b4a9c[_0x55640d(0x2c5)]===_0x55640d(0x2d4)||_0x4b4a9c['format']===_0x55640d(0x237))await handleSDKOutput(_0x36b4e1,_0x4b4a9c);else{if(_0x36b4e1[_0x55640d(0x1a8)]===0x0)console[_0x55640d(0x25e)](_0x55640d(0x189)),console[_0x55640d(0xff)](a31_0x2d8ea2[_0x55640d(0x153)](_0x55640d(0x2b9)));else for(const _0x7432bb of _0x36b4e1){console[_0x55640d(0x25e)](a31_0x2d8ea2['bold'](_0x7432bb[_0x55640d(0x1fb)])+'\x20'+a31_0x2d8ea2[_0x55640d(0x1b3)]('(id:\x20'+_0x7432bb['id']+')'));_0x7432bb[_0x55640d(0x1d6)]&&console[_0x55640d(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x55640d(0x1b3)](_0x7432bb[_0x55640d(0x1d6)]));if(_0x7432bb['tokens']&&_0x7432bb['tokens'][_0x55640d(0x1a8)]>0x0)for(const _0x2238b7 of _0x7432bb['tokens']){const _0x47e64d=_0x2238b7[_0x55640d(0x260)]?.['length']?_0x2238b7['allowedIps']['join'](',\x20'):_0x55640d(0x209);console[_0x55640d(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x55640d(0x153)](_0x55640d(0x197))+'\x20'+_0x2238b7[_0x55640d(0x1fb)]+'\x20'+a31_0x2d8ea2[_0x55640d(0x1b3)](_0x55640d(0x29e)+_0x2238b7['id']+')')),console[_0x55640d(0x25e)]('\x20\x20\x20\x20'+a31_0x2d8ea2[_0x55640d(0x1b3)](_0x55640d(0xef))+'\x20'+_0x47e64d);}else console['log']('\x20\x20'+a31_0x2d8ea2[_0x55640d(0x1b3)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x28f);['description']=a31_0x1cf65c(0x10e);async[a31_0x1cf65c(0x242)](_0x2bdaec){const _0x2f8a09=a31_0x1cf65c,{options:_0x5d47ab,args:_0x4e31b4,tdx:_0x4db1af}=_0x2bdaec,_0x5f57e8=_0x5d47ab,_0x750af0=_0x4e31b4[0x0],_0x15c0b6=_0x4e31b4[0x1]||_0x5d47ab[_0x2f8a09(0x128)];if(!_0x750af0)return console[_0x2f8a09(0xff)]('Error:\x20Service\x20name\x20is\x20required'),console[_0x2f8a09(0xff)](_0x2f8a09(0x282)),console[_0x2f8a09(0xff)](_0x2f8a09(0x23a)),0x1;if(!_0x15c0b6)return showParentSegmentNotSetError(_0x2f8a09(0x29f)+_0x2f8a09(0x23a)),0x1;const _0x3267ac=await withSpinner(_0x2f8a09(0x126)+_0x15c0b6+_0x2f8a09(0x289),()=>_0x4db1af[_0x2f8a09(0x106)][_0x2f8a09(0x2d8)](_0x15c0b6),{'verbose':_0x5d47ab[_0x2f8a09(0x148)]}),_0x60233a=_0x3267ac['data'],_0x9576e6={'name':_0x750af0,'description':_0x5f57e8['description'],'public':_0x5f57e8[_0x2f8a09(0x177)]},_0x4c6a6f=await withSpinner(_0x2f8a09(0x244)+_0x750af0+_0x2f8a09(0x289),()=>_0x4db1af[_0x2f8a09(0x271)][_0x2f8a09(0x16d)](_0x60233a,_0x9576e6),{'verbose':_0x5d47ab[_0x2f8a09(0x148)]}),_0x44f86e=_0x4c6a6f[_0x2f8a09(0x20f)];return console[_0x2f8a09(0xff)]('✔\x20Created\x20personalization\x20service\x20\x27'+_0x44f86e[_0x2f8a09(0x1fb)]+_0x2f8a09(0x273)+_0x44f86e['id']),await handleSDKOutput([_0x44f86e],_0x5d47ab),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']='ps:pz:service:show';[a31_0x1cf65c(0x1d6)]='Show\x20personalization\x20service\x20details';async[a31_0x1cf65c(0x242)](_0x38c9c3){const _0x5e8f71=a31_0x1cf65c,{options:_0x48e22c,args:_0x432e11,tdx:_0x5268c8}=_0x38c9c3,_0x1be177=_0x432e11[0x0],_0x36303b=_0x432e11[0x1]||_0x48e22c[_0x5e8f71(0x128)];if(!_0x1be177)return console[_0x5e8f71(0xff)](_0x5e8f71(0x1f6)),console[_0x5e8f71(0xff)](_0x5e8f71(0x19b)),console[_0x5e8f71(0xff)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x36303b)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x34ae40=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x36303b+_0x5e8f71(0x289),()=>_0x5268c8['segment'][_0x5e8f71(0x2d8)](_0x36303b),{'verbose':_0x48e22c[_0x5e8f71(0x148)]}),_0x210270=_0x34ae40[_0x5e8f71(0x20f)],_0x4fea5b=await withSpinner(_0x5e8f71(0xf2)+_0x1be177+'\x27...',()=>_0x5268c8[_0x5e8f71(0x271)][_0x5e8f71(0x233)](_0x210270,_0x1be177),{'verbose':_0x48e22c[_0x5e8f71(0x148)]}),_0x4bf1c7=_0x4fea5b[_0x5e8f71(0x20f)];if(_0x48e22c[_0x5e8f71(0x2d4)]||_0x48e22c['jsonl'])await handleSDKOutput([_0x4bf1c7],_0x48e22c);else{console[_0x5e8f71(0x25e)](a31_0x2d8ea2['bold'](_0x4bf1c7[_0x5e8f71(0x1fb)])+'\x20'+a31_0x2d8ea2[_0x5e8f71(0x1b3)](_0x5e8f71(0x29e)+_0x4bf1c7['id']+')'));_0x4bf1c7['description']&&console['log']('\x20\x20'+a31_0x2d8ea2[_0x5e8f71(0x1b3)](_0x4bf1c7['description']));console[_0x5e8f71(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x5e8f71(0x153)](_0x5e8f71(0x11c))+'\x20'+(_0x4bf1c7[_0x5e8f71(0x177)]?_0x5e8f71(0x268):'no'));if(_0x4bf1c7[_0x5e8f71(0x231)]&&_0x4bf1c7['tokens'][_0x5e8f71(0x1a8)]>0x0)for(const _0x3312cc of _0x4bf1c7[_0x5e8f71(0x231)]){const _0x554e2c=_0x3312cc[_0x5e8f71(0x260)]?.[_0x5e8f71(0x1a8)]?_0x3312cc[_0x5e8f71(0x260)][_0x5e8f71(0x1ba)](',\x20'):_0x5e8f71(0x209);console['log']('\x20\x20'+a31_0x2d8ea2['cyan'](_0x5e8f71(0x197))+'\x20'+_0x3312cc[_0x5e8f71(0x1fb)]+'\x20'+a31_0x2d8ea2[_0x5e8f71(0x1b3)](_0x5e8f71(0x29e)+_0x3312cc['id']+')')),console[_0x5e8f71(0x25e)](_0x5e8f71(0x191)+a31_0x2d8ea2['dim'](_0x5e8f71(0xef))+'\x20'+_0x554e2c);}else console[_0x5e8f71(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x5e8f71(0x1b3)](_0x5e8f71(0x270)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0xe8);[a31_0x1cf65c(0x1d6)]='Delete\x20a\x20personalization\x20service';async[a31_0x1cf65c(0x242)](_0x4ac5f8){const _0x4a0566=a31_0x1cf65c,{options:_0x5a4702,args:_0x248c3d,tdx:_0x42f933}=_0x4ac5f8,_0x3ccc92=_0x248c3d[0x0],_0x428812=_0x248c3d[0x1]||_0x5a4702['parentSegment'];if(!_0x3ccc92)return console[_0x4a0566(0xff)](_0x4a0566(0x1f6)),console[_0x4a0566(0xff)](_0x4a0566(0xf6)),console['error'](_0x4a0566(0x1d4)),0x1;if(!_0x428812)return showParentSegmentNotSetError(_0x4a0566(0x187)+_0x4a0566(0x1d4)),0x1;const _0xb2e17c=await withSpinner(_0x4a0566(0x126)+_0x428812+_0x4a0566(0x289),()=>_0x42f933['segment'][_0x4a0566(0x2d8)](_0x428812),{'verbose':_0x5a4702['verbose']}),_0x189228=_0xb2e17c[_0x4a0566(0x20f)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x3ccc92+_0x4a0566(0x289),()=>_0x42f933[_0x4a0566(0x271)][_0x4a0566(0x2b8)](_0x189228,_0x3ccc92),{'verbose':_0x5a4702[_0x4a0566(0x148)]}),console['error'](_0x4a0566(0x21c)+_0x3ccc92+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0xf1);['description']=a31_0x1cf65c(0x11d);async[a31_0x1cf65c(0x242)](_0x455fc8){const _0x47f073=a31_0x1cf65c,{options:_0x55f10c,args:_0x37224d,tdx:_0x4f3d43}=_0x455fc8,_0x572e2a=_0x55f10c,_0x55e302=_0x37224d[0x0],_0x1f54da=_0x37224d[0x1]||_0x55f10c[_0x47f073(0x128)];if(!_0x55e302)return console['error'](_0x47f073(0x1f6)),console[_0x47f073(0xff)](_0x47f073(0xf7)),console['error'](_0x47f073(0x267)),0x1;if(!_0x572e2a[_0x47f073(0x1fb)])return console[_0x47f073(0xff)](_0x47f073(0x169)),console[_0x47f073(0xff)](_0x47f073(0xf7)),0x1;if(!_0x1f54da)return showParentSegmentNotSetError(_0x47f073(0x10a)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x9ff28e=await withSpinner(_0x47f073(0x126)+_0x1f54da+_0x47f073(0x289),()=>_0x4f3d43[_0x47f073(0x106)][_0x47f073(0x2d8)](_0x1f54da),{'verbose':_0x55f10c[_0x47f073(0x148)]}),_0x3c14b5=_0x9ff28e[_0x47f073(0x20f)],_0x2de75b={'name':_0x572e2a[_0x47f073(0x1fb)]};_0x572e2a[_0x47f073(0x1d6)]!==undefined&&(_0x2de75b[_0x47f073(0x1d6)]=_0x572e2a[_0x47f073(0x1d6)]);const _0xa9d30f=await withSpinner(_0x47f073(0x13f)+_0x55e302+_0x47f073(0x289),()=>_0x4f3d43[_0x47f073(0x271)][_0x47f073(0x1c0)](_0x3c14b5,_0x55e302,_0x2de75b),{'verbose':_0x55f10c[_0x47f073(0x148)]}),_0x34f951=_0xa9d30f[_0x47f073(0x20f)];return console[_0x47f073(0xff)](_0x47f073(0x2bb)+_0x34f951[_0x47f073(0x1fb)]+'\x27'),await handleSDKOutput([_0x34f951],_0x55f10c),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']=a31_0x1cf65c(0x224);[a31_0x1cf65c(0x1d6)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a31_0x1cf65c(0x242)](_0x580d45){const _0x2afeb3=a31_0x1cf65c,{options:_0x351caf,args:_0x5043bb,tdx:_0x4543d7}=_0x580d45,_0x522129=_0x351caf,_0x24c44b=_0x5043bb[0x0],_0xdd85ff=_0x5043bb[0x1],_0x25b549=_0x5043bb[0x2]||_0x351caf[_0x2afeb3(0x128)];if(!_0x24c44b)return console[_0x2afeb3(0xff)](_0x2afeb3(0x28b)),console[_0x2afeb3(0xff)](_0x2afeb3(0x287)),console[_0x2afeb3(0xff)](_0x2afeb3(0x2d7)),0x1;if(!_0xdd85ff)return console[_0x2afeb3(0xff)](_0x2afeb3(0x1f6)),console[_0x2afeb3(0xff)](_0x2afeb3(0x287)),console[_0x2afeb3(0xff)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x25b549)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x24ba3e=await withSpinner(_0x2afeb3(0x126)+_0x25b549+_0x2afeb3(0x289),()=>_0x4543d7['segment'][_0x2afeb3(0x2d8)](_0x25b549),{'verbose':_0x351caf['verbose']}),_0x14cbb3=_0x24ba3e['data'],_0xc38937={'name':_0x24c44b};_0x522129[_0x2afeb3(0x260)]&&(_0xc38937['allowedIps']=_0x522129[_0x2afeb3(0x260)]['split'](',')['map'](_0x41a5ff=>_0x41a5ff[_0x2afeb3(0x115)]()));_0x522129[_0x2afeb3(0x1d6)]&&(_0xc38937[_0x2afeb3(0x1d6)]=_0x522129[_0x2afeb3(0x1d6)]);const _0x87477c=await withSpinner('Creating\x20token\x20\x27'+_0x24c44b+'\x27\x20for\x20service\x20\x27'+_0xdd85ff+_0x2afeb3(0x289),()=>_0x4543d7['personalization'][_0x2afeb3(0x11a)](_0x14cbb3,_0xdd85ff,_0xc38937),{'verbose':_0x351caf[_0x2afeb3(0x148)]}),_0x28d954=_0x87477c[_0x2afeb3(0x20f)];return console[_0x2afeb3(0xff)](_0x2afeb3(0x17b)+_0x28d954['name']+'\x27\x20with\x20ID:\x20'+_0x28d954['id']),_0x28d954[_0x2afeb3(0x230)]&&(console[_0x2afeb3(0xff)](a31_0x2d8ea2['yellow'](_0x2afeb3(0x24a))),console[_0x2afeb3(0xff)](a31_0x2d8ea2[_0x2afeb3(0x153)](_0x28d954[_0x2afeb3(0x230)])),console[_0x2afeb3(0xff)]('')),await handleSDKOutput([_0x28d954],_0x351caf),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x1ec);[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x2c3);async[a31_0x1cf65c(0x242)](_0x2637fd){const _0x3380ca=a31_0x1cf65c,{options:_0x8a1fce,args:_0x2b50ed,tdx:_0x1b5436}=_0x2637fd,_0xb720cc=_0x2b50ed[0x0],_0xdcd7ea=_0x2b50ed[0x1]||_0x8a1fce[_0x3380ca(0x128)];if(!_0xb720cc)return console[_0x3380ca(0xff)](_0x3380ca(0x2a3)),console[_0x3380ca(0xff)](_0x3380ca(0x1e3)),console[_0x3380ca(0xff)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0xdcd7ea)return showParentSegmentNotSetError(_0x3380ca(0x181)+_0x3380ca(0xe1)),0x1;const _0x410663=await withSpinner(_0x3380ca(0x126)+_0xdcd7ea+'\x27...',()=>_0x1b5436[_0x3380ca(0x106)][_0x3380ca(0x2d8)](_0xdcd7ea),{'verbose':_0x8a1fce[_0x3380ca(0x148)]}),_0x2737bb=_0x410663[_0x3380ca(0x20f)],_0x5e516b=await withSpinner(_0x3380ca(0xfb),()=>_0x1b5436[_0x3380ca(0x271)][_0x3380ca(0x103)](_0x2737bb),{'verbose':_0x8a1fce['verbose']}),_0x471aa9=_0x5e516b[_0x3380ca(0x20f)];let _0xc95506;for(const _0xacf39 of _0x471aa9){if(_0xacf39['tokens']?.[_0x3380ca(0x291)](_0x3bd737=>_0x3bd737['id']===_0xb720cc)){_0xc95506=_0xacf39['id'];break;}}if(!_0xc95506)return console[_0x3380ca(0xff)]('Error:\x20Token\x20\x27'+_0xb720cc+_0x3380ca(0x2ab)),0x1;const _0x3238b6=await withSpinner(_0x3380ca(0x203)+_0xb720cc+_0x3380ca(0x289),()=>_0x1b5436['personalization'][_0x3380ca(0x1d7)](_0x2737bb,_0xc95506,_0xb720cc),{'verbose':_0x8a1fce[_0x3380ca(0x148)]}),_0x2ed0d5=_0x3238b6[_0x3380ca(0x20f)];return console[_0x3380ca(0xff)](_0x3380ca(0x11b)+(_0x2ed0d5['name']||_0xb720cc)+'\x27'),await handleSDKOutput([_0x2ed0d5],_0x8a1fce),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='ps:pz:list';[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0x2af);async[a31_0x1cf65c(0x242)](_0x3cc6a8){const _0xecdb37=a31_0x1cf65c,{options:_0x28c1f4,args:_0x5064c1,tdx:_0xc73bc7}=_0x3cc6a8,_0x5c96ba=_0x5064c1[0x0]||_0x28c1f4['parentSegment'];if(!_0x5c96ba)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a'+'\x20\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 _0x409246=await withSpinner(_0xecdb37(0x126)+_0x5c96ba+_0xecdb37(0x289),()=>_0xc73bc7['segment'][_0xecdb37(0x2d8)](_0x5c96ba),{'verbose':_0x28c1f4['verbose']}),_0x4725ef=_0x409246[_0xecdb37(0x20f)],_0xd9b9c0=await withSpinner(_0xecdb37(0x213)+_0x5c96ba+_0xecdb37(0x289),()=>_0xc73bc7[_0xecdb37(0x271)][_0xecdb37(0x11e)](_0x4725ef),{'verbose':_0x28c1f4[_0xecdb37(0x148)]}),_0x473a04=_0xd9b9c0[_0xecdb37(0x20f)];console[_0xecdb37(0xff)](_0xecdb37(0x29b)+_0x473a04[_0xecdb37(0x1a8)]+_0xecdb37(0x204)+(_0x473a04[_0xecdb37(0x1a8)]!==0x1?'s':''));if(_0x28c1f4['format']==='json'||_0x28c1f4[_0xecdb37(0x2c5)]==='jsonl')await handleSDKOutput(_0x473a04,_0x28c1f4);else{if(_0x473a04[_0xecdb37(0x1a8)]===0x0)console[_0xecdb37(0x25e)](_0xecdb37(0x1e8));else for(const _0x551035 of _0x473a04){console[_0xecdb37(0x25e)](a31_0x2d8ea2[_0xecdb37(0x15b)](_0x551035[_0xecdb37(0x1fb)])+'\x20'+a31_0x2d8ea2['dim'](_0xecdb37(0x29e)+_0x551035['id']+')'));_0x551035[_0xecdb37(0x1d6)]&&console[_0xecdb37(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0xecdb37(0x1b3)](_0x551035[_0xecdb37(0x1d6)]));const _0x1a873d=_0x551035['sections']?.[_0xecdb37(0x1a8)]||0x0;console[_0xecdb37(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0xecdb37(0x153)](_0xecdb37(0xf9))+'\x20'+_0x1a873d);if(_0x551035[_0xecdb37(0x139)]&&_0x551035[_0xecdb37(0x139)][_0xecdb37(0x1a8)]>0x0)for(const _0x40df36 of _0x551035[_0xecdb37(0x139)]){console[_0xecdb37(0x25e)](_0xecdb37(0x125)+_0x40df36['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='ps:pz:show';[a31_0x1cf65c(0x1d6)]=a31_0x1cf65c(0xfd);async[a31_0x1cf65c(0x242)](_0x5988a3){const _0x1f254b=a31_0x1cf65c,{options:_0x529dff,args:_0x10cfab,tdx:_0x29f9a3}=_0x5988a3,_0x11bd68=_0x10cfab[0x0];if(!_0x11bd68)return console[_0x1f254b(0xff)](_0x1f254b(0x156)),console[_0x1f254b(0xff)](_0x1f254b(0x1f1)),0x1;const _0x5bce67=await withSpinner(_0x1f254b(0x2c2)+_0x11bd68+_0x1f254b(0x289),()=>_0x29f9a3['personalization']['getPersonalization'](_0x11bd68),{'verbose':_0x529dff[_0x1f254b(0x148)]}),_0x1b21d7=_0x5bce67[_0x1f254b(0x20f)];console['error']('✔\x20Found\x20personalization\x20\x27'+_0x1b21d7[_0x1f254b(0x1fb)]+'\x27');if(_0x529dff[_0x1f254b(0x2c5)]===_0x1f254b(0x2d4)||_0x529dff['format']===_0x1f254b(0x237))await handleSDKOutput([_0x1b21d7],_0x529dff);else{console[_0x1f254b(0x25e)](a31_0x2d8ea2['bold'](_0x1b21d7[_0x1f254b(0x1fb)])+'\x20'+a31_0x2d8ea2['dim']('(id:\x20'+_0x1b21d7['id']+')'));_0x1b21d7[_0x1f254b(0x1d6)]&&console[_0x1f254b(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x1f254b(0x1b3)](_0x1b21d7[_0x1f254b(0x1d6)]));_0x1b21d7[_0x1f254b(0x13e)]&&console[_0x1f254b(0x25e)]('\x20\x20'+a31_0x2d8ea2['cyan'](_0x1f254b(0x250))+'\x20'+_0x1b21d7[_0x1f254b(0x13e)]);console[_0x1f254b(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x1f254b(0x153)](_0x1f254b(0x275))+'\x20'+_0x1b21d7[_0x1f254b(0x17a)]),console[_0x1f254b(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x1f254b(0x153)](_0x1f254b(0x2bf))+'\x20'+_0x1b21d7['updatedAt']);const _0x3411ab=_0x1b21d7['sections']?.[_0x1f254b(0x1a8)]||0x0;console[_0x1f254b(0x25e)]('\x20\x20'+a31_0x2d8ea2[_0x1f254b(0x153)](_0x1f254b(0xf9))+'\x20'+_0x3411ab);if(_0x1b21d7[_0x1f254b(0x139)]&&_0x1b21d7[_0x1f254b(0x139)][_0x1f254b(0x1a8)]>0x0)for(const _0x2aab9c of _0x1b21d7['sections']){console[_0x1f254b(0x25e)](_0x1f254b(0x191)+a31_0x2d8ea2[_0x1f254b(0x15b)](_0x2aab9c[_0x1f254b(0x1fb)])+'\x20'+a31_0x2d8ea2['dim'](_0x1f254b(0x29e)+_0x2aab9c['id']+')')),_0x2aab9c[_0x1f254b(0x241)]&&(console['log'](_0x1f254b(0xec)+a31_0x2d8ea2['cyan'](_0x1f254b(0x20b))+'\x20'+_0x2aab9c[_0x1f254b(0x241)]['name']),_0x2aab9c[_0x1f254b(0x241)][_0x1f254b(0x136)]?.[_0x1f254b(0x160)]&&console[_0x1f254b(0x25e)](_0x1f254b(0x20e)+a31_0x2d8ea2['cyan'](_0x1f254b(0x170))+'\x20'+_0x2aab9c[_0x1f254b(0x241)][_0x1f254b(0x136)][_0x1f254b(0x160)])),_0x2aab9c[_0x1f254b(0x1b8)]&&console[_0x1f254b(0x25e)](_0x1f254b(0xec)+a31_0x2d8ea2['cyan'](_0x1f254b(0x2a1))+'\x20'+JSON[_0x1f254b(0x2d1)](_0x2aab9c[_0x1f254b(0x1b8)])),_0x2aab9c[_0x1f254b(0x105)]&&console[_0x1f254b(0x25e)]('\x20\x20\x20\x20\x20\x20'+a31_0x2d8ea2[_0x1f254b(0x153)]('includeSensitive:')+_0x1f254b(0x243));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]='ps:pz:delete';[a31_0x1cf65c(0x1d6)]='Delete\x20a\x20realtime\x20personalization';async[a31_0x1cf65c(0x242)](_0x2e9753){const _0x5a5681=a31_0x1cf65c,{options:_0xf9df27,args:_0x3907b0,tdx:_0x85bb98}=_0x2e9753,_0x313bc1=_0x3907b0[0x0];if(!_0x313bc1)return console[_0x5a5681(0xff)](_0x5a5681(0x156)),console[_0x5a5681(0xff)](_0x5a5681(0xe6)),0x1;return await withSpinner('Deleting\x20personalization\x20\x27'+_0x313bc1+_0x5a5681(0x289),()=>_0x85bb98['personalization'][_0x5a5681(0x2dc)](_0x313bc1),{'verbose':_0xf9df27[_0x5a5681(0x148)]}),console[_0x5a5681(0xff)](_0x5a5681(0x28c)+_0x313bc1+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x1cf65c(0x1fb)]=a31_0x1cf65c(0x122);['description']='Create\x20a\x20realtime\x20personalization\x20entity';async[a31_0x1cf65c(0x242)](_0x964176){const _0x153eda=a31_0x1cf65c,{options:_0x590938,tdx:_0x161a6a}=_0x964176,_0x2f684c=_0x590938;let _0x560036;if(_0x2f684c[_0x153eda(0x1aa)]){_0x560036=await loadJSON(_0x2f684c[_0x153eda(0x1aa)],!![]);if(!_0x560036[_0x153eda(0xe7)]?.[_0x153eda(0x130)])return console['error']('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x153eda(0xff)](_0x153eda(0x14b)),console[_0x153eda(0xff)](_0x153eda(0x2b6)),0x1;}else{if(!_0x2f684c[_0x153eda(0x1fb)])return console[_0x153eda(0xff)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x153eda(0xff)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x153eda(0xff)](_0x153eda(0x210)),0x1;if(_0x2f684c[_0x153eda(0x1d6)]===undefined)return console[_0x153eda(0xff)](_0x153eda(0x25c)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console['error'](_0x153eda(0x210)),0x1;if(_0x2f684c[_0x153eda(0x2d5)]===undefined)return console[_0x153eda(0xff)](_0x153eda(0x1a4)),console[_0x153eda(0xff)](_0x153eda(0x261)),0x1;let _0x44eae7=_0x2f684c[_0x153eda(0x13e)];if(!_0x44eae7&&_0x590938[_0x153eda(0x128)]){const _0x582fbb=await withSpinner(_0x153eda(0x126)+_0x590938[_0x153eda(0x128)]+_0x153eda(0x289),()=>_0x161a6a[_0x153eda(0x106)][_0x153eda(0x2d8)](_0x590938[_0x153eda(0x128)]),{'verbose':_0x590938[_0x153eda(0x148)]});_0x44eae7=_0x582fbb[_0x153eda(0x20f)];}let _0x19d754;_0x2f684c[_0x153eda(0x139)]&&(_0x19d754=await loadJSON(_0x2f684c[_0x153eda(0x139)],![]));const _0x593f96=_0x2f684c[_0x153eda(0x2d5)]===_0x153eda(0xe2)?null:{'id':_0x2f684c[_0x153eda(0x2d5)],'type':_0x153eda(0xe9)};_0x560036={'attributes':{'name':_0x2f684c['name'],'description':_0x2f684c['description']||null,..._0x44eae7!==undefined&&{'audienceId':_0x44eae7},..._0x19d754!==undefined&&{'sections':_0x19d754}},'relationships':{'parentFolder':{'data':_0x593f96}}};}const _0x2d5d83=await withSpinner(_0x153eda(0x1fc)+(_0x560036['attributes']?.[_0x153eda(0x1fb)]??'')+_0x153eda(0x289),()=>_0x161a6a[_0x153eda(0x271)]['createPersonalization'](_0x560036),{'verbose':_0x590938[_0x153eda(0x148)]}),_0x580b83=_0x2d5d83[_0x153eda(0x20f)];return console[_0x153eda(0xff)]('✔\x20Created\x20personalization\x20\x27'+_0x580b83[_0x153eda(0x1fb)]+_0x153eda(0x273)+_0x580b83['id']),await handleSDKOutput([_0x580b83],_0x590938),0x0;}}export class PSPzPatchCommand extends BaseCommand{['name']=a31_0x1cf65c(0x220);[a31_0x1cf65c(0x1d6)]='Update\x20a\x20realtime\x20personalization\x20entity';async[a31_0x1cf65c(0x242)](_0x3f2017){const _0x6003b4=a31_0x1cf65c,{options:_0xbd881a,args:_0x53397b}=_0x3f2017,_0x4ca157=_0xbd881a,_0xe6ef3e=_0x53397b[0x0];if(!_0xe6ef3e)return console['error'](_0x6003b4(0x156)),console[_0x6003b4(0xff)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0x6003b4(0xff)](_0x6003b4(0x100)),0x1;let _0x43888b;if(_0x4ca157[_0x6003b4(0x1aa)])_0x43888b=await loadJSON(_0x4ca157['file'],!![]);else{if(!_0x4ca157['name'])return console[_0x6003b4(0xff)](_0x6003b4(0x24c)),console[_0x6003b4(0xff)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;if(_0x4ca157['description']===undefined)return console[_0x6003b4(0xff)](_0x6003b4(0x25c)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;let _0x381a19;_0x4ca157[_0x6003b4(0x139)]&&(_0x381a19=await loadJSON(_0x4ca157[_0x6003b4(0x139)],![])),_0x43888b={'attributes':{'name':_0x4ca157['name'],'description':_0x4ca157[_0x6003b4(0x1d6)]||null,..._0x381a19!==undefined&&{'sections':_0x381a19}}};}const {tdx:_0x5bf54e}=_0x3f2017,_0x485601=await withSpinner(_0x6003b4(0x2ce)+_0xe6ef3e+_0x6003b4(0x289),()=>_0x5bf54e[_0x6003b4(0x271)][_0x6003b4(0x1c5)](_0xe6ef3e,_0x43888b),{'verbose':_0xbd881a['verbose']}),_0x453f11=_0x485601[_0x6003b4(0x20f)];return console[_0x6003b4(0xff)](_0x6003b4(0x21b)+_0x453f11[_0x6003b4(0x1fb)]+_0x6003b4(0x23d)+_0x453f11['id']+')'),await handleSDKOutput([_0x453f11],_0xbd881a),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a31_0x1cf65c(0xe4);['description']=a31_0x1cf65c(0x235);async['execute'](_0x47f25b){const _0x2082a1=a31_0x1cf65c,{options:_0x4eae0b,args:_0x4aa955}=_0x47f25b,_0x3a17f1=_0x4aa955[0x0]||_0x4eae0b[_0x2082a1(0x128)];if(!_0x3a17f1)return showParentSegmentNotSetError(_0x2082a1(0xdc)+_0x2082a1(0x1f7)),0x1;const _0x592c7e=resolveYamlFile(_0x3a17f1);if(!existsSync(_0x592c7e))return showFileNotFoundError(_0x592c7e,_0x3a17f1),0x1;let _0x63dc6d;try{_0x63dc6d=readFileSync(_0x592c7e,'utf-8');}catch(_0x118e75){const _0x3b68f4=_0x118e75 instanceof Error?_0x118e75[_0x2082a1(0x24f)]:String(_0x118e75);return console[_0x2082a1(0xff)]('Error\x20reading\x20file:\x20'+_0x3b68f4),0x1;}let _0x452466;try{_0x452466=parseDef(_0x63dc6d);}catch(_0x112be3){const _0x8440e8=_0x112be3 instanceof Error?_0x112be3['message']:String(_0x112be3);return console[_0x2082a1(0xff)](a31_0x2d8ea2['red']('Error\x20parsing\x20YAML:\x20'+_0x8440e8)),0x1;}if(_0x452466['personalization_services']&&_0x452466[_0x2082a1(0x219)][_0x2082a1(0x1a8)]>0x0)return console[_0x2082a1(0xff)](a31_0x2d8ea2[_0x2082a1(0x168)](_0x2082a1(0x238)+_0x592c7e)),console[_0x2082a1(0xff)](a31_0x2d8ea2[_0x2082a1(0x1b3)](_0x2082a1(0x272)+_0x452466[_0x2082a1(0x219)]['length']+_0x2082a1(0x26f))),0x1;!_0x452466[_0x2082a1(0x297)]&&(_0x452466['realtime']={'events':[{'name':_0x2082a1(0x2c6),'source_table':'<database>.<table>'}],'attributes':[{'name':_0x2082a1(0xdf),'type':'single'}],'id_stitching':{'primary_key':_0x452466['master']['table']===_0x2082a1(0x2b2)?'td_client_id':_0x2082a1(0x277)}});_0x452466[_0x2082a1(0x219)]=[{'name':_0x2082a1(0x1fa),'description':'Personalization\x20service\x20description','trigger_event':_0x2082a1(0x2c6),'sections':[{'name':_0x2082a1(0x131),'criteria':'true','attributes':[_0x2082a1(0xdf)]}]}];const _0x3e7b8a=serializeDef(_0x452466);return writeFileSync(_0x592c7e,_0x3e7b8a,_0x2082a1(0xd7)),console[_0x2082a1(0xff)](a31_0x2d8ea2['green']('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x2d8ea2[_0x2082a1(0x153)](_0x592c7e)),(!_0x452466[_0x2082a1(0x297)]||_0x63dc6d['indexOf'](_0x2082a1(0x19f))===-0x1)&&console[_0x2082a1(0xff)](a31_0x2d8ea2['green']('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console['error']('\x0a'+a31_0x2d8ea2[_0x2082a1(0x1b3)](_0x2082a1(0x202))),console[_0x2082a1(0xff)]('\x20\x201.\x20Edit\x20'+_0x592c7e+_0x2082a1(0x102)),console['error'](_0x2082a1(0x257)+a31_0x2d8ea2[_0x2082a1(0x1b3)](_0x2082a1(0x12b)+_0x3a17f1)+'\x20to\x20push\x20the\x20configuration'),0x0;}}