@treasuredata/tdx 2026.4.12 → 2026.4.13

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 (220) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/access-tracker.js +1 -1
  182. package/dist/sdk/workspace/frontmatter.js +1 -1
  183. package/dist/sdk/workspace/git.js +1 -1
  184. package/dist/sdk/workspace/index.js +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +1 -1
@@ -1 +1 @@
1
- const a31_0x33df17=a31_0x26a5;(function(_0x3f5b5e,_0x4db013){const _0x16b37a=a31_0x26a5,_0x1960e2=_0x3f5b5e();while(!![]){try{const _0x26b25f=parseInt(_0x16b37a(0x2a0))/0x1*(-parseInt(_0x16b37a(0x1a3))/0x2)+parseInt(_0x16b37a(0x24f))/0x3*(parseInt(_0x16b37a(0x36c))/0x4)+-parseInt(_0x16b37a(0x1ae))/0x5*(-parseInt(_0x16b37a(0x32c))/0x6)+-parseInt(_0x16b37a(0x1c2))/0x7*(parseInt(_0x16b37a(0x3ae))/0x8)+-parseInt(_0x16b37a(0x357))/0x9*(parseInt(_0x16b37a(0x2a1))/0xa)+-parseInt(_0x16b37a(0x2ce))/0xb*(parseInt(_0x16b37a(0x3af))/0xc)+-parseInt(_0x16b37a(0x1e9))/0xd*(-parseInt(_0x16b37a(0x2e8))/0xe);if(_0x26b25f===_0x4db013)break;else _0x1960e2['push'](_0x1960e2['shift']());}catch(_0x4a3600){_0x1960e2['push'](_0x1960e2['shift']());}}}(a31_0x9269,0x854bb));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x3ba6d8 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_0x437b86 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x33df17(0x227),LEGACY_PARENT_SEGMENT_DIR=a31_0x33df17(0x38d);function openBrowser(_0x438557){const _0x736787=a31_0x33df17,_0xfe6cd4=process[_0x736787(0x1ad)],_0xc89d9c=_0xfe6cd4===_0x736787(0x314)?_0x736787(0x38e):_0xfe6cd4===_0x736787(0x2c0)?_0x736787(0x249):_0x736787(0x284);spawn(_0xc89d9c,[_0x438557],{'detached':!![],'stdio':_0x736787(0x28a)})[_0x736787(0x2d4)]();}function migrateLegacyDirectory(){const _0x59d958=a31_0x33df17;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x29d41b=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x29d41b[_0x59d958(0x1e3)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x59d958(0x2ef)](a31_0x437b86[_0x59d958(0x2e5)](_0x59d958(0x35a)+LEGACY_PARENT_SEGMENT_DIR+_0x59d958(0x1f9)+PARENT_SEGMENT_DIR+_0x59d958(0x220))),console[_0x59d958(0x2ef)](a31_0x437b86[_0x59d958(0x358)](_0x59d958(0x1ff)+LEGACY_PARENT_SEGMENT_DIR+_0x59d958(0x301))),![];console[_0x59d958(0x2ef)](a31_0x437b86[_0x59d958(0x2e5)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x59d958(0x1a7)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x59d958(0x2ef)](a31_0x437b86['green']('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1692e9){const _0x393f5e=_0x1692e9 instanceof Error?_0x1692e9[_0x59d958(0x367)]:String(_0x1692e9);return console[_0x59d958(0x2ef)](a31_0x437b86[_0x59d958(0x1bb)](_0x59d958(0x297)+_0x393f5e+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x33df17(0x306)](_0x50feac){const _0x3d0a88=a31_0x33df17;return migrateLegacyDirectory(),super[_0x3d0a88(0x306)](_0x50feac);}}function resolveYamlFile(_0x1bc318){const _0x8f6517=a31_0x33df17;if(_0x1bc318[_0x8f6517(0x2d6)](_0x8f6517(0x309))||_0x1bc318['endsWith'](_0x8f6517(0x21f)))return _0x1bc318;return a31_0x3ba6d8[_0x8f6517(0x1d3)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1bc318)+_0x8f6517(0x309));}function formatProgressMessage(_0xd304ac){const _0x4a7377=a31_0x33df17,_0x31bda0=_0xd304ac['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x31bda0){const [,_0x56d0ee,_0xbd9b7f,_0x2c7cff='']=_0x31bda0;return a31_0x437b86[_0x4a7377(0x358)](_0x56d0ee+':')+'\x20'+_0xbd9b7f+a31_0x437b86[_0x4a7377(0x358)](_0x2c7cff);}return a31_0x437b86[_0x4a7377(0x358)](_0xd304ac);}function showFileNotFoundError(_0x2df25c,_0x556e44){const _0x578b34=a31_0x33df17;console[_0x578b34(0x2ef)](a31_0x437b86[_0x578b34(0x1bb)](_0x578b34(0x345)+_0x2df25c+'\x0a')),console['error'](a31_0x437b86[_0x578b34(0x269)](_0x578b34(0x279)+_0x556e44+_0x578b34(0x2cd)));}function displayRealtimeValidation(_0x29dcfc){const _0x2737cc=a31_0x33df17;if(!_0x29dcfc[_0x2737cc(0x3bb)])return;const _0x267f33=_0x29dcfc[_0x2737cc(0x3bb)],_0x42ecb4=_0x267f33['enabled']?a31_0x437b86[_0x2737cc(0x292)](_0x2737cc(0x285)):a31_0x437b86['yellow'](_0x2737cc(0x20f));console[_0x2737cc(0x2ef)]('\x0a'+a31_0x437b86[_0x2737cc(0x358)](_0x2737cc(0x2e4))+'\x20'+_0x42ecb4);if(_0x267f33[_0x2737cc(0x1da)]&&_0x267f33['events'][_0x2737cc(0x2e9)]>0x0){console['error']('\x20\x20'+a31_0x437b86['dim'](_0x2737cc(0x2af))+'\x20'+_0x267f33['events'][_0x2737cc(0x2e9)]+_0x2737cc(0x39f));for(const _0x1f0ccd of _0x267f33[_0x2737cc(0x1da)]){const _0x394506=_0x1f0ccd[_0x2737cc(0x33a)]===![]?a31_0x437b86[_0x2737cc(0x1bb)]('✘'):a31_0x437b86['green']('✔');console['error'](_0x2737cc(0x373)+_0x394506+'\x20'+_0x1f0ccd[_0x2737cc(0x296)]),_0x1f0ccd[_0x2737cc(0x33e)]&&console[_0x2737cc(0x2ef)]('\x20\x20\x20\x20\x20\x20'+a31_0x437b86[_0x2737cc(0x1bb)](_0x1f0ccd[_0x2737cc(0x33e)]));}}if(_0x267f33[_0x2737cc(0x39d)]&&_0x267f33[_0x2737cc(0x39d)][_0x2737cc(0x2e9)]>0x0){console[_0x2737cc(0x2ef)]('\x20\x20'+a31_0x437b86[_0x2737cc(0x358)]('Attributes:')+'\x20'+_0x267f33[_0x2737cc(0x39d)][_0x2737cc(0x2e9)]+'\x20configured');for(const _0x4c77d6 of _0x267f33[_0x2737cc(0x39d)]){const _0x26f875=_0x4c77d6[_0x2737cc(0x351)]?a31_0x437b86[_0x2737cc(0x292)]('✔'):a31_0x437b86[_0x2737cc(0x1bb)]('✘');console[_0x2737cc(0x2ef)](_0x2737cc(0x373)+_0x26f875+'\x20'+_0x4c77d6['name']+'\x20'+a31_0x437b86[_0x2737cc(0x358)]('('+_0x4c77d6[_0x2737cc(0x34e)]+')'));}}if(_0x267f33['idStitching']){const _0x9cf069=_0x267f33[_0x2737cc(0x35e)][_0x2737cc(0x3bc)]?.[_0x2737cc(0x2e9)]?_0x2737cc(0x226)+_0x267f33[_0x2737cc(0x35e)][_0x2737cc(0x3bc)][_0x2737cc(0x1d3)](',\x20')+']':'';console[_0x2737cc(0x2ef)]('\x20\x20'+a31_0x437b86[_0x2737cc(0x358)](_0x2737cc(0x2f9))+'\x20'+_0x267f33[_0x2737cc(0x35e)][_0x2737cc(0x23c)]+_0x9cf069);}if(_0x267f33[_0x2737cc(0x3b2)]&&_0x267f33[_0x2737cc(0x3b2)][_0x2737cc(0x2e9)]>0x0){console['error']('\x20\x20'+a31_0x437b86[_0x2737cc(0x358)]('Personalization:')+'\x20'+_0x267f33['personalizationServices']['length']+_0x2737cc(0x203)+(_0x267f33[_0x2737cc(0x3b2)][_0x2737cc(0x2e9)]!==0x1?'s':''));for(const _0x23d5c1 of _0x267f33[_0x2737cc(0x3b2)]){console[_0x2737cc(0x2ef)](_0x2737cc(0x229)+_0x23d5c1[_0x2737cc(0x296)]);}}}function showParentSegmentNotSetError(_0x1e3b33){const _0x303a2c=a31_0x33df17;console[_0x303a2c(0x2ef)](a31_0x437b86[_0x303a2c(0x2e5)](_0x303a2c(0x260))),console[_0x303a2c(0x2ef)](_0x1e3b33);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x388);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2f8);async[a31_0x33df17(0x29e)](_0x2b4f3c){const _0x3fed58=a31_0x33df17,{options:_0x21e387,args:_0x13ac69,tdx:_0x42afa1}=_0x2b4f3c,_0x1aed93=_0x13ac69[0x0];_0x21e387[_0x3fed58(0x1a0)]&&(console['error'](_0x3fed58(0x368)+_0x21e387[_0x3fed58(0x24d)]),_0x1aed93&&console[_0x3fed58(0x2ef)]('Pattern:\x20'+_0x1aed93));const _0x490e3b=await withSpinner(_0x1aed93?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x1aed93+'\x27...':_0x3fed58(0x356),()=>_0x42afa1[_0x3fed58(0x207)][_0x3fed58(0x1bc)](),{'verbose':_0x21e387['verbose']});let _0x202ab7=_0x490e3b['data'];if(_0x1aed93){const _0x12cc01=_0x1aed93[_0x3fed58(0x341)](/[.+^${}()|[\]\\]/g,_0x3fed58(0x2bf))[_0x3fed58(0x341)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4120d2=new RegExp('^'+_0x12cc01+'$','i');_0x202ab7=_0x202ab7['filter'](_0x4ef65e=>_0x4120d2[_0x3fed58(0x2d9)](_0x4ef65e[_0x3fed58(0x39d)]['name']));}_0x202ab7[_0x3fed58(0x36e)]((_0x361817,_0x54d93a)=>_0x361817['attributes'][_0x3fed58(0x296)][_0x3fed58(0x35d)](_0x54d93a[_0x3fed58(0x39d)]['name'])),console['error'](_0x3fed58(0x396)+_0x202ab7['length']+_0x3fed58(0x3b3)+(_0x202ab7[_0x3fed58(0x2e9)]!==0x1?'s':''));const _0x4dcd2c=_0x53eec=>{const _0x4b5d27=_0x3fed58;return getConsoleNextUrl(_0x21e387[_0x4b5d27(0x24d)],_0x4b5d27(0x201)+_0x53eec);};if(_0x21e387[_0x3fed58(0x1f3)]===_0x3fed58(0x2c3)||_0x21e387[_0x3fed58(0x1f3)]===_0x3fed58(0x33b)){const _0x2ce704=_0x202ab7[_0x3fed58(0x1f7)](_0x9f7e1e=>({..._0x9f7e1e,'url':_0x4dcd2c(_0x9f7e1e['id'])}));await handleSDKOutput(_0x2ce704,_0x21e387);}else{if(_0x202ab7[_0x3fed58(0x2e9)]===0x0)_0x1aed93?console[_0x3fed58(0x2c2)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x1aed93):console[_0x3fed58(0x2c2)](_0x3fed58(0x2ed));else for(const _0x41856a of _0x202ab7){const _0x3315bd=_0x41856a['attributes'][_0x3fed58(0x1eb)]?a31_0x437b86[_0x3fed58(0x358)]('\x20('+formatRows(_0x41856a['attributes'][_0x3fed58(0x1eb)])+')'):'',_0x4b5661=hyperlink(_0x41856a[_0x3fed58(0x39d)][_0x3fed58(0x296)],_0x4dcd2c(_0x41856a['id']));console['log']('👥\x20'+_0x4b5661+_0x3315bd);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x224);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x25e);async[a31_0x33df17(0x29e)](_0x3c3c06){const _0x1a7653=a31_0x33df17,{options:_0xe53f74,args:_0x5e4a27,tdx:_0x812f76}=_0x3c3c06;console[_0x1a7653(0x2ef)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x1a7653(0x2ac)+_0x1a7653(0x316));const _0x551d08=_0xe53f74;if(_0x5e4a27[_0x1a7653(0x2e9)]===0x0)return console[_0x1a7653(0x2ef)](a31_0x437b86[_0x1a7653(0x1bb)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x1a7653(0x2ef)](_0x1a7653(0x2b4)),0x1;const _0x554d2e=_0x5e4a27[0x0];if(!_0x551d08[_0x1a7653(0x253)]||!_0x551d08[_0x1a7653(0x30d)])return console['error'](_0x1a7653(0x383)),console[_0x1a7653(0x2ef)](_0x1a7653(0x2b4)),0x1;_0x551d08[_0x1a7653(0x1a0)]&&(console[_0x1a7653(0x2ef)](_0x1a7653(0x368)+_0x551d08[_0x1a7653(0x24d)]),console['error'](_0x1a7653(0x319)+_0x554d2e),console[_0x1a7653(0x2ef)](_0x1a7653(0x1f0)+_0x551d08['database']),console[_0x1a7653(0x2ef)](_0x1a7653(0x206)+_0x551d08[_0x1a7653(0x30d)]));const _0x2747ff=await loadJSONFromOptions(_0x551d08[_0x1a7653(0x39d)],_0x551d08[_0x1a7653(0x1d4)]),_0x20af78=await loadJSONFromOptions(_0x551d08[_0x1a7653(0x308)],_0x551d08[_0x1a7653(0x228)]),_0x441a08=await loadJSONFromOptions(_0x551d08[_0x1a7653(0x332)],_0x551d08[_0x1a7653(0x2fc)]),_0xdad5a2={'name':_0x554d2e,'description':_0x551d08[_0x1a7653(0x2fa)],'scheduleType':_0x551d08[_0x1a7653(0x1e4)],'scheduleOption':_0x551d08['scheduleOption'],'timezone':_0x551d08[_0x1a7653(0x331)],'master':{'parentDatabaseName':_0x551d08[_0x1a7653(0x253)],'parentTableName':_0x551d08['table']},'attributes':_0x2747ff,'behaviors':_0x20af78,'customerGroup':_0x441a08},_0x1d2faa=await withSpinner(_0x1a7653(0x32d)+_0x554d2e+_0x1a7653(0x335),()=>_0x812f76[_0x1a7653(0x207)][_0x1a7653(0x26c)](_0xdad5a2),{'verbose':_0xe53f74[_0x1a7653(0x1a0)]}),_0x256e6b=_0x1d2faa['data'];return console['error'](_0x1a7653(0x354)+_0x256e6b[_0x1a7653(0x296)]+_0x1a7653(0x363)+_0x256e6b['id']),await handleSDKOutput([_0x256e6b],_0xe53f74),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x33df17(0x296)]='segment:parent:update';['description']=a31_0x33df17(0x237);async[a31_0x33df17(0x29e)](_0x411892){const _0x56f14b=a31_0x33df17,{options:_0x16bb02,args:_0x55e32c,tdx:_0x4cb132}=_0x411892;console[_0x56f14b(0x2ef)](_0x56f14b(0x2c5)+_0x56f14b(0x2ac)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3dd3e0=_0x16bb02;if(_0x55e32c[_0x56f14b(0x2e9)]===0x0)return console[_0x56f14b(0x2ef)](a31_0x437b86['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x56f14b(0x2ef)](_0x56f14b(0x2ec)),0x1;const _0x75ae87=_0x55e32c[0x0];_0x3dd3e0[_0x56f14b(0x1a0)]&&(console[_0x56f14b(0x2ef)]('Site:\x20'+_0x3dd3e0[_0x56f14b(0x24d)]),console[_0x56f14b(0x2ef)](_0x56f14b(0x29f)+_0x75ae87));const _0x54ec3b=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x75ae87+_0x56f14b(0x335),()=>_0x4cb132[_0x56f14b(0x207)][_0x56f14b(0x318)](_0x75ae87),{'verbose':_0x3dd3e0[_0x56f14b(0x1a0)]}),_0x32fe85=_0x54ec3b[_0x56f14b(0x1a1)],_0x4e7344=await loadJSONFromOptions(_0x3dd3e0[_0x56f14b(0x2bc)],_0x3dd3e0[_0x56f14b(0x1cc)]),_0xddfce0=await loadJSONFromOptions(_0x3dd3e0[_0x56f14b(0x1ca)],_0x3dd3e0['addBehaviorsFile']),_0x439067={'name':_0x32fe85[_0x56f14b(0x296)],'description':_0x3dd3e0[_0x56f14b(0x2fa)]!==undefined?_0x3dd3e0[_0x56f14b(0x2fa)]:_0x32fe85['description'],'scheduleType':_0x3dd3e0[_0x56f14b(0x1e4)]!==undefined?_0x3dd3e0[_0x56f14b(0x1e4)]:_0x32fe85['scheduleType'],'scheduleOption':_0x3dd3e0[_0x56f14b(0x377)]!==undefined?_0x3dd3e0[_0x56f14b(0x377)]:_0x32fe85[_0x56f14b(0x377)],'timezone':_0x3dd3e0[_0x56f14b(0x331)]!==undefined?_0x3dd3e0['timezone']:_0x32fe85[_0x56f14b(0x331)],'master':_0x32fe85[_0x56f14b(0x211)],'attributes':_0x4e7344?[..._0x32fe85[_0x56f14b(0x39d)]||[],..._0x4e7344]:_0x32fe85[_0x56f14b(0x39d)],'behaviors':_0xddfce0?[..._0x32fe85[_0x56f14b(0x308)]||[],..._0xddfce0]:_0x32fe85[_0x56f14b(0x308)],'customerGroup':_0x32fe85['customerGroup']},_0x439645=await withSpinner(_0x56f14b(0x2aa)+_0x75ae87+'\x27...',()=>_0x4cb132[_0x56f14b(0x207)][_0x56f14b(0x1c4)](_0x75ae87,_0x439067),{'verbose':_0x3dd3e0[_0x56f14b(0x1a0)]}),_0x49c518=_0x439645[_0x56f14b(0x1a1)];return console[_0x56f14b(0x2ef)](_0x56f14b(0x1fa)+_0x49c518['name']+'\x27'),await handleSDKOutput([_0x49c518],_0x3dd3e0),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a31_0x33df17(0x1dd);['description']=a31_0x33df17(0x3bd);async[a31_0x33df17(0x29e)](_0x1b8f03){const _0x2e6cf9=a31_0x33df17,{options:_0x22c2c0,args:_0x4f6b38,tdx:_0xf2a923}=_0x1b8f03,_0x10b298=_0x22c2c0,_0x99a7de=_0x4f6b38[0x0]||_0x22c2c0['parentSegment'];if(!_0x99a7de)return showParentSegmentNotSetError(_0x2e6cf9(0x3aa)+_0x2e6cf9(0x1c8)),0x1;if(_0x10b298['use']&&_0x10b298[_0x2e6cf9(0x233)])return console[_0x2e6cf9(0x2ef)](a31_0x437b86[_0x2e6cf9(0x1bb)](_0x2e6cf9(0x3a5))),console[_0x2e6cf9(0x2ef)](a31_0x437b86['dim'](_0x2e6cf9(0x2b1))),console[_0x2e6cf9(0x2ef)](a31_0x437b86[_0x2e6cf9(0x358)](_0x2e6cf9(0x204)+PARENT_SEGMENT_DIR+_0x2e6cf9(0x1a6))),console['error'](a31_0x437b86[_0x2e6cf9(0x269)](_0x2e6cf9(0x33f))),0x1;const _0x517218=_0x10b298[_0x2e6cf9(0x233)]||a31_0x3ba6d8[_0x2e6cf9(0x1d3)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x99a7de)+_0x2e6cf9(0x309));_0x10b298[_0x2e6cf9(0x1a0)]&&(console[_0x2e6cf9(0x2ef)](_0x2e6cf9(0x368)+_0x10b298[_0x2e6cf9(0x24d)]),console[_0x2e6cf9(0x2ef)]('Parent\x20segment:\x20'+_0x99a7de),console[_0x2e6cf9(0x2ef)](_0x2e6cf9(0x2eb)+_0x517218));const _0x9ca6dc=await withSpinner(_0x2e6cf9(0x394)+_0x99a7de+'\x27...',()=>_0xf2a923[_0x2e6cf9(0x207)][_0x2e6cf9(0x1bd)](_0x99a7de),{'verbose':_0x10b298[_0x2e6cf9(0x1a0)]}),_0x1f6dbf=_0x9ca6dc['data'];if(existsSync(_0x517218)){const _0x75173b=readFileSync(_0x517218,_0x2e6cf9(0x2e6)),_0x2ba799=generateDiff(_0x75173b,_0x1f6dbf);if(!hasChanges(_0x2ba799))console[_0x2e6cf9(0x2ef)](a31_0x437b86['green']('✔')+_0x2e6cf9(0x272)+a31_0x437b86[_0x2e6cf9(0x269)](_0x517218)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x2e6cf9(0x2ef)](_0x2e6cf9(0x1b9)+_0x517218+'\x27:'),console[_0x2e6cf9(0x2ef)]('─'[_0x2e6cf9(0x1ea)](0x3c)),console[_0x2e6cf9(0x2ef)](formatDiffWithColors(_0x2ba799)),console['error']('─'[_0x2e6cf9(0x1ea)](0x3c));if(!_0x10b298[_0x2e6cf9(0x32e)]){if(!isInteractive())return console['error'](a31_0x437b86['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2e6cf9(0x2ef)](a31_0x437b86[_0x2e6cf9(0x358)](_0x2e6cf9(0x262))),0x1;const _0x25cdf2=await confirmKey('Overwrite\x20\x27'+_0x517218+'\x27?');if(!_0x25cdf2)return console[_0x2e6cf9(0x2ef)](a31_0x437b86[_0x2e6cf9(0x2e5)](_0x2e6cf9(0x20d))),0x1;}writeFileSync(_0x517218,_0x1f6dbf,_0x2e6cf9(0x2e6)),console['error'](a31_0x437b86['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x437b86[_0x2e6cf9(0x269)](_0x517218));}}else{const _0x1218b0=a31_0x3ba6d8[_0x2e6cf9(0x27e)](_0x517218);!existsSync(_0x1218b0)&&mkdirSync(_0x1218b0,{'recursive':!![]}),writeFileSync(_0x517218,_0x1f6dbf,_0x2e6cf9(0x2e6)),console[_0x2e6cf9(0x2ef)](a31_0x437b86[_0x2e6cf9(0x292)]('✔')+_0x2e6cf9(0x2f6)+a31_0x437b86[_0x2e6cf9(0x269)](_0x517218));}return saveSessionContext({'parent_segment':_0x99a7de},_0x10b298['session']),console['error'](a31_0x437b86[_0x2e6cf9(0x292)]('✔')+'\x20Context\x20set:\x20'+a31_0x437b86['dim'](_0x2e6cf9(0x38d))+_0x2e6cf9(0x2e2)+a31_0x437b86[_0x2e6cf9(0x269)](_0x99a7de)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a31_0x33df17(0x39a);[a31_0x33df17(0x2fa)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a31_0x33df17(0x29e)](_0x1c839b){const _0x2406a4=a31_0x33df17,{options:_0x5b3593,args:_0x4e0760,tdx:_0x450f17}=_0x1c839b,_0x31699f=_0x5b3593,_0x2edd23=_0x4e0760[0x0]||_0x5b3593['parentSegment'];if(!_0x2edd23)return showParentSegmentNotSetError(_0x2406a4(0x1e1)+_0x2406a4(0x252)),0x1;const _0x7a681a=resolveYamlFile(_0x2edd23);if(!existsSync(_0x7a681a))return showFileNotFoundError(_0x7a681a,_0x2edd23),0x1;_0x31699f['verbose']&&(console[_0x2406a4(0x2ef)](_0x2406a4(0x368)+_0x31699f[_0x2406a4(0x24d)]),console[_0x2406a4(0x2ef)]('YAML\x20file:\x20'+_0x7a681a));let _0x57df6b;try{_0x57df6b=readFileSync(_0x7a681a,_0x2406a4(0x2e6));}catch(_0x36fb91){const _0x2717a4=_0x36fb91 instanceof Error?_0x36fb91[_0x2406a4(0x367)]:String(_0x36fb91);return console[_0x2406a4(0x2ef)]('Error\x20reading\x20file:\x20'+_0x2717a4),0x1;}const _0xfdb41e=await withSpinner(_0x2406a4(0x2d7),()=>_0x450f17['segment'][_0x2406a4(0x27d)](_0x57df6b),{'verbose':_0x31699f[_0x2406a4(0x1a0)]}),_0x59e749=_0xfdb41e['data'],{isNew:_0x4d5a2a,name:_0x37b371,hasChanges:_0x450da3,diffFormatted:_0x54b425}=_0x59e749;if(!_0x450da3)return console['error'](_0x2406a4(0x1d8)+_0x37b371+_0x2406a4(0x240)),0x0;_0x4d5a2a?console['error'](_0x2406a4(0x28e)+_0x37b371+'\x27:'):console[_0x2406a4(0x2ef)](_0x2406a4(0x353)+_0x37b371+'\x27:');console['error']('─'[_0x2406a4(0x1ea)](0x3c)),console[_0x2406a4(0x2ef)](_0x54b425),console[_0x2406a4(0x2ef)]('─'[_0x2406a4(0x1ea)](0x3c));const _0xa38d9a=_0x4d5a2a?'Create\x20parent\x20segment\x20\x27'+_0x37b371+'\x27?':_0x2406a4(0x31e)+_0x37b371+'\x27?';if(!_0x31699f['yes']){if(!isInteractive())return console['error'](a31_0x437b86[_0x2406a4(0x1bb)](_0x2406a4(0x340)),_0x2406a4(0x3ab)),console['error'](a31_0x437b86[_0x2406a4(0x358)](_0x2406a4(0x262))),0x1;const _0x5ba482=await confirmKey(_0xa38d9a);if(!_0x5ba482)return console['error'](a31_0x437b86['yellow'](_0x2406a4(0x20d))),0x1;}const _0x3f9fa3=_0x4d5a2a?_0x2406a4(0x27c):_0x2406a4(0x231),_0x4017d4=await withSpinner(_0x3f9fa3+_0x2406a4(0x360)+_0x37b371+_0x2406a4(0x335),()=>_0x59e749['apply'](),{'verbose':_0x31699f['verbose']}),_0x3ffdf4=_0x4017d4[_0x2406a4(0x1a1)],_0x5c646b=getConsoleNextUrl(_0x31699f['site'],'/app/dw/parentSegments/'+_0x3ffdf4['id']),_0xfca05c=_0x4d5a2a?_0x2406a4(0x1d2):'Updated';return console[_0x2406a4(0x2ef)]('✔\x20'+_0xfca05c+'\x20parent\x20segment\x20\x27'+_0x3ffdf4[_0x2406a4(0x296)]+'\x27'),console['error']('\x20\x20'+_0x5c646b),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x23a);['description']=a31_0x33df17(0x1ac);async['execute'](_0x43250b){const _0x494505=a31_0x33df17,{options:_0x1b4a7a,args:_0x1262d1,tdx:_0xd6e8c5}=_0x43250b,_0x3bcf59=_0x1b4a7a,_0x55bf94=_0x1262d1[0x0]||_0x1b4a7a[_0x494505(0x2dd)];if(!_0x55bf94)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x494505(0x28b)+_0x494505(0x238)+_0x494505(0x2d1)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x494505(0x212)),0x1;const _0x149099=resolveYamlFile(_0x55bf94);if(!existsSync(_0x149099))return showFileNotFoundError(_0x149099,_0x55bf94),0x1;_0x3bcf59['verbose']&&(console[_0x494505(0x2ef)](_0x494505(0x368)+_0x3bcf59[_0x494505(0x24d)]),console[_0x494505(0x2ef)]('YAML\x20file:\x20'+_0x149099));let _0xfaebc9;try{_0xfaebc9=readFileSync(_0x149099,_0x494505(0x2e6));}catch(_0x22a184){const _0x1ffc9d=_0x22a184 instanceof Error?_0x22a184[_0x494505(0x367)]:String(_0x22a184);return console['error'](_0x494505(0x30e)+_0x1ffc9d),0x1;}const _0x1fdf4c=createCommandSpinner(a31_0x437b86[_0x494505(0x358)](_0x494505(0x268)),{'verbose':_0x3bcf59[_0x494505(0x1a0)]});_0x1fdf4c[_0x494505(0x249)]();const _0x384cf3={'onProgress':_0x575916=>{const _0x1a66b6=_0x494505;_0x1fdf4c[_0x1a66b6(0x2f5)]=formatProgressMessage(_0x575916);}};if(_0x3bcf59[_0x494505(0x211)])_0x384cf3[_0x494505(0x211)]=!![];if(_0x3bcf59[_0x494505(0x205)])_0x384cf3[_0x494505(0x205)]=!![];_0x3bcf59[_0x494505(0x39c)]&&(_0x384cf3[_0x494505(0x39c)]=_0x3bcf59['attribute']);_0x3bcf59['behavior']&&(_0x384cf3[_0x494505(0x1d0)]=_0x3bcf59['behavior']);if(_0x3bcf59[_0x494505(0x1e7)])_0x384cf3[_0x494505(0x1e7)]=_0x3bcf59[_0x494505(0x1e7)];let _0x13e638;try{_0x13e638=await _0xd6e8c5[_0x494505(0x207)]['validateParentYaml'](_0xfaebc9,_0x384cf3),_0x1fdf4c[_0x494505(0x2a4)]();}catch(_0x25a519){_0x1fdf4c[_0x494505(0x2a4)]();throw _0x25a519;}const _0x3c6022=_0x3bcf59[_0x494505(0x1e7)]||'-1d';return this['displayValidateResults'](_0x13e638,_0x384cf3,_0x149099,_0x3c6022),_0x13e638[_0x494505(0x324)]?0x0:0x1;}['displayValidateResults'](_0x2fd531,_0x469116,_0x556cd5,_0x1d5f72){const _0x4222c0=a31_0x33df17;console[_0x4222c0(0x2ef)]('\x0a'+a31_0x437b86[_0x4222c0(0x31c)](_0x4222c0(0x329))+'\x20'+_0x2fd531['name']),console['error']('═'[_0x4222c0(0x1ea)](0x3c)),this[_0x4222c0(0x326)](_0x2fd531);if(typeof _0x469116[_0x4222c0(0x39c)]===_0x4222c0(0x3b0)){this[_0x4222c0(0x2c8)](_0x2fd531),this[_0x4222c0(0x307)](_0x2fd531),this[_0x4222c0(0x1f8)](_0x556cd5,_0x1d5f72,_0x4222c0(0x39c),_0x469116[_0x4222c0(0x39c)]);return;}if(_0x469116[_0x4222c0(0x39c)]===!![]){this[_0x4222c0(0x2c8)](_0x2fd531),this[_0x4222c0(0x307)](_0x2fd531),this[_0x4222c0(0x1f8)](_0x556cd5,_0x1d5f72,'attributes');return;}if(typeof _0x469116[_0x4222c0(0x1d0)]===_0x4222c0(0x3b0)){this[_0x4222c0(0x208)](_0x2fd531,_0x1d5f72),this['displaySummary'](_0x2fd531),this[_0x4222c0(0x1f8)](_0x556cd5,_0x1d5f72,_0x4222c0(0x1d0),_0x469116[_0x4222c0(0x1d0)]);return;}if(_0x469116[_0x4222c0(0x1d0)]===!![]){this[_0x4222c0(0x208)](_0x2fd531,_0x1d5f72),this[_0x4222c0(0x307)](_0x2fd531),this['displayPreviewHints'](_0x556cd5,_0x1d5f72,_0x4222c0(0x308));return;}this[_0x4222c0(0x2c8)](_0x2fd531),this['displayBehaviorsStats'](_0x2fd531,_0x1d5f72),this[_0x4222c0(0x24b)](_0x2fd531),this[_0x4222c0(0x307)](_0x2fd531),this[_0x4222c0(0x1f8)](_0x556cd5,_0x1d5f72,'all');}[a31_0x33df17(0x24b)](_0x1e1820){displayRealtimeValidation(_0x1e1820);}[a31_0x33df17(0x1f8)](_0x23580f,_0xff7134,_0x148b9c,_0x1e7bdf){const _0x398ad4=a31_0x33df17;console[_0x398ad4(0x2ef)]('\x0a'+a31_0x437b86[_0x398ad4(0x358)](_0x398ad4(0x3ad)));const _0x451410=_0xff7134!==_0x398ad4(0x30a)?_0x398ad4(0x2c6)+_0xff7134:'';if(_0x148b9c===_0x398ad4(0x39c)&&_0x1e7bdf)console[_0x398ad4(0x2ef)]('\x20\x20'+a31_0x437b86[_0x398ad4(0x358)](_0x398ad4(0x215)+_0x23580f+_0x398ad4(0x1b3)+_0x1e7bdf+'\x22'+_0x451410));else{if(_0x148b9c===_0x398ad4(0x1d0)&&_0x1e7bdf)console[_0x398ad4(0x2ef)]('\x20\x20'+a31_0x437b86['dim'](_0x398ad4(0x215)+_0x23580f+_0x398ad4(0x2a3)+_0x1e7bdf+'\x22'+_0x451410));else(_0x148b9c===_0x398ad4(0x39d)||_0x148b9c===_0x398ad4(0x24a))&&console[_0x398ad4(0x2ef)]('\x20\x20'+a31_0x437b86['dim'](_0x398ad4(0x215)+_0x23580f+_0x398ad4(0x264)+_0x451410));}(_0x148b9c===_0x398ad4(0x308)||_0x148b9c==='all')&&console[_0x398ad4(0x2ef)]('\x20\x20'+a31_0x437b86[_0x398ad4(0x358)](_0x398ad4(0x215)+_0x23580f+_0x398ad4(0x3a7)+_0x451410)),_0x148b9c===_0x398ad4(0x24a)&&console[_0x398ad4(0x2ef)]('\x20\x20'+a31_0x437b86[_0x398ad4(0x358)](_0x398ad4(0x215)+_0x23580f+_0x398ad4(0x359)+_0x451410));}[a31_0x33df17(0x326)](_0xfe72df){const _0xc159=a31_0x33df17,{master:_0x54fd09}=_0xfe72df,_0x4e9ac8=_0x54fd09['schemaValid']?a31_0x437b86['green']('✔'):a31_0x437b86[_0xc159(0x1bb)]('✘');console['error']('\x0a'+a31_0x437b86[_0xc159(0x358)](_0xc159(0x393))),console['error'](_0x4e9ac8+'\x20'+a31_0x437b86[_0xc159(0x31c)](_0x54fd09[_0xc159(0x253)]+'.'+_0x54fd09['table'])),_0x54fd09[_0xc159(0x295)]?_0x54fd09['rowCount']!==undefined&&console[_0xc159(0x2ef)]('\x20\x20'+a31_0x437b86[_0xc159(0x358)](_0xc159(0x1e6))+'\x20'+a31_0x437b86['cyan'](formatRows(_0x54fd09[_0xc159(0x283)]))):console[_0xc159(0x2ef)]('\x20\x20'+a31_0x437b86[_0xc159(0x1bb)](_0xc159(0x30c))+'\x20'+_0x54fd09[_0xc159(0x31b)]);}[a31_0x33df17(0x2c8)](_0x373b06){const _0x47df47=a31_0x33df17;if(_0x373b06['attributes']['length']===0x0)return;console[_0x47df47(0x2ef)]('\x0a'+a31_0x437b86[_0x47df47(0x358)]('Attributes'));for(const _0x1cdff6 of _0x373b06[_0x47df47(0x39d)]){const _0x7b3af8=_0x1cdff6[_0x47df47(0x295)]?a31_0x437b86['green']('✔'):a31_0x437b86[_0x47df47(0x1bb)]('✘');let _0x3a0934='';if(_0x1cdff6['schemaValid']&&_0x1cdff6[_0x47df47(0x33c)]!==undefined&&_0x1cdff6[_0x47df47(0x21a)]!==undefined){const _0x5b3d22=_0x1cdff6[_0x47df47(0x21a)][_0x47df47(0x210)](0x1),_0xbdb301=_0x1cdff6[_0x47df47(0x21a)]>=0x50?a31_0x437b86[_0x47df47(0x292)]:_0x1cdff6[_0x47df47(0x21a)]>=0x32?a31_0x437b86[_0x47df47(0x2e5)]:a31_0x437b86[_0x47df47(0x1bb)];_0x3a0934='\x20'+a31_0x437b86[_0x47df47(0x358)](_0x47df47(0x2bb))+'\x20'+_0xbdb301(_0x5b3d22+'%')+'\x20('+formatRows(_0x1cdff6[_0x47df47(0x33c)])+_0x47df47(0x371);}console[_0x47df47(0x2ef)](_0x7b3af8+'\x20'+a31_0x437b86['bold'](_0x1cdff6[_0x47df47(0x296)])+_0x3a0934),console['error']('\x20\x20'+a31_0x437b86[_0x47df47(0x358)]('Source:')+'\x20'+a31_0x437b86[_0x47df47(0x31c)](_0x1cdff6['database']+'.'+_0x1cdff6[_0x47df47(0x30d)]));const _0x3d9786=_0x1cdff6[_0x47df47(0x3b4)]===_0x1cdff6['foreignKey']?a31_0x437b86[_0x47df47(0x358)](_0x47df47(0x3a8))+'\x20'+_0x1cdff6[_0x47df47(0x3b4)]:a31_0x437b86[_0x47df47(0x358)](_0x47df47(0x2ca))+'\x20'+_0x1cdff6[_0x47df47(0x3b4)]+_0x47df47(0x2e2)+_0x1cdff6[_0x47df47(0x2de)];console[_0x47df47(0x2ef)]('\x20\x20'+_0x3d9786),console[_0x47df47(0x2ef)]('\x20\x20'+a31_0x437b86[_0x47df47(0x358)](_0x47df47(0x29d))),this[_0x47df47(0x20e)](_0x1cdff6[_0x47df47(0x34d)]),!_0x1cdff6[_0x47df47(0x295)]&&console['error']('\x20\x20'+a31_0x437b86[_0x47df47(0x1bb)](_0x47df47(0x30c))+'\x20'+_0x1cdff6[_0x47df47(0x31b)]);}}[a31_0x33df17(0x208)](_0x19590e,_0x1e448f){const _0xaaae20=a31_0x33df17;if(_0x19590e['behaviors']['length']===0x0)return;console[_0xaaae20(0x2ef)]('\x0a'+a31_0x437b86[_0xaaae20(0x358)](_0xaaae20(0x305))+'\x20'+a31_0x437b86[_0xaaae20(0x358)]('('+_0x1e448f+')'));for(const _0x54f9df of _0x19590e[_0xaaae20(0x308)]){const _0x3a04ee=_0x54f9df['schemaValid']?a31_0x437b86['green']('✔'):a31_0x437b86[_0xaaae20(0x1bb)]('✘');let _0x36981e='';if(_0x54f9df[_0xaaae20(0x295)]&&_0x54f9df[_0xaaae20(0x261)]!==undefined&&_0x54f9df[_0xaaae20(0x1b7)]!==undefined){const _0x1ad245=_0x54f9df[_0xaaae20(0x1e8)]?.[_0xaaae20(0x210)](0x1)||'?',_0x58b692=(_0x54f9df[_0xaaae20(0x1e8)]??0x0)>=0x32?a31_0x437b86[_0xaaae20(0x292)]:(_0x54f9df[_0xaaae20(0x1e8)]??0x0)>=0x14?a31_0x437b86[_0xaaae20(0x2e5)]:a31_0x437b86[_0xaaae20(0x1bb)];_0x36981e='\x20'+a31_0x437b86[_0xaaae20(0x358)]('Customers:')+'\x20'+_0x58b692(formatRows(_0x54f9df[_0xaaae20(0x261)]))+'\x20('+_0x1ad245+_0xaaae20(0x2b0)+a31_0x437b86[_0xaaae20(0x358)](_0xaaae20(0x2af))+'\x20'+a31_0x437b86[_0xaaae20(0x269)](formatRows(_0x54f9df['totalEvents']));}console[_0xaaae20(0x2ef)](_0x3a04ee+'\x20'+a31_0x437b86[_0xaaae20(0x31c)](_0x54f9df[_0xaaae20(0x296)])+_0x36981e),console[_0xaaae20(0x2ef)]('\x20\x20'+a31_0x437b86[_0xaaae20(0x358)](_0xaaae20(0x3ac))+'\x20'+a31_0x437b86['bold'](_0x54f9df[_0xaaae20(0x253)]+'.'+_0x54f9df[_0xaaae20(0x30d)]));const _0x2ed24c=_0x54f9df[_0xaaae20(0x3b4)]===_0x54f9df[_0xaaae20(0x2de)]?a31_0x437b86[_0xaaae20(0x358)](_0xaaae20(0x3a8))+'\x20'+_0x54f9df[_0xaaae20(0x3b4)]:a31_0x437b86[_0xaaae20(0x358)]('Join:')+'\x20'+_0x54f9df[_0xaaae20(0x3b4)]+_0xaaae20(0x2e2)+_0x54f9df[_0xaaae20(0x2de)];console['error']('\x20\x20'+_0x2ed24c),console[_0xaaae20(0x2ef)]('\x20\x20'+a31_0x437b86[_0xaaae20(0x358)](_0xaaae20(0x29d))),this[_0xaaae20(0x20e)](_0x54f9df[_0xaaae20(0x34d)]),!_0x54f9df['schemaValid']&&console[_0xaaae20(0x2ef)]('\x20\x20'+a31_0x437b86[_0xaaae20(0x1bb)](_0xaaae20(0x30c))+'\x20'+_0x54f9df['schemaError']);}}[a31_0x33df17(0x20e)](_0x71a37){const _0x577356=a31_0x33df17;for(const _0x4caf51 of _0x71a37){_0x4caf51[_0x577356(0x1ee)]===_0x4caf51[_0x577356(0x3b6)]||_0x4caf51['column']==='*'?console[_0x577356(0x2ef)](_0x577356(0x229)+_0x4caf51['label']):console[_0x577356(0x2ef)](_0x577356(0x229)+_0x4caf51[_0x577356(0x1ee)]+'\x20'+a31_0x437b86[_0x577356(0x358)]('('+_0x4caf51['column']+')'));}}[a31_0x33df17(0x307)](_0x321ff7){const _0x479288=a31_0x33df17;console[_0x479288(0x2ef)]('─'['repeat'](0x3c));if(_0x321ff7[_0x479288(0x245)][_0x479288(0x2e9)]>0x0){console[_0x479288(0x2ef)]('\x0a'+a31_0x437b86[_0x479288(0x1bb)]('Errors:'));for(const _0x4c7b9a of _0x321ff7[_0x479288(0x245)]){console[_0x479288(0x2ef)]('\x20\x20'+a31_0x437b86['red']('•')+'\x20'+_0x4c7b9a);}}_0x321ff7[_0x479288(0x324)]&&console[_0x479288(0x2ef)]('\x0a'+a31_0x437b86[_0x479288(0x292)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x33df17(0x296)]='segment:parent:preview';[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2b2);async[a31_0x33df17(0x29e)](_0x5ca351){const _0x55584d=a31_0x33df17,{options:_0x325608,args:_0x429b44,tdx:_0x3831e1}=_0x5ca351,_0x342c80=_0x325608,_0x4ea343=_0x429b44[0x0]||_0x325608['parentSegment'];if(!_0x4ea343)return showParentSegmentNotSetError(_0x55584d(0x3b5)+_0x55584d(0x348)+'Options\x20(one\x20required):\x0a'+_0x55584d(0x337)+_0x55584d(0x1ec)+_0x55584d(0x1c5)+_0x55584d(0x218)+_0x55584d(0x212)),0x1;if(!_0x342c80[_0x55584d(0x211)]&&!_0x342c80['attribute']&&!_0x342c80[_0x55584d(0x1d0)]&&!_0x342c80[_0x55584d(0x205)])return console['error'](a31_0x437b86[_0x55584d(0x1bb)](_0x55584d(0x216))),console[_0x55584d(0x2ef)](_0x55584d(0x34f)),console[_0x55584d(0x2ef)](_0x55584d(0x27f)),console[_0x55584d(0x2ef)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x55584d(0x2ef)](_0x55584d(0x3c0)),console[_0x55584d(0x2ef)](_0x55584d(0x2a9)),console[_0x55584d(0x2ef)](_0x55584d(0x384)),0x1;const _0x50d0a7=resolveYamlFile(_0x4ea343);if(!existsSync(_0x50d0a7))return showFileNotFoundError(_0x50d0a7,_0x4ea343),0x1;_0x342c80[_0x55584d(0x1a0)]&&(console['error']('Site:\x20'+_0x342c80[_0x55584d(0x24d)]),console['error']('YAML\x20file:\x20'+_0x50d0a7));let _0x178785;try{_0x178785=readFileSync(_0x50d0a7,_0x55584d(0x2e6));}catch(_0x15e607){const _0x2dfd9f=_0x15e607 instanceof Error?_0x15e607[_0x55584d(0x367)]:String(_0x15e607);return console[_0x55584d(0x2ef)]('Error\x20reading\x20file:\x20'+_0x2dfd9f),0x1;}let _0x5e14e0;try{_0x5e14e0=parseDef(_0x178785);}catch(_0x48a3af){const _0x47f2d5=_0x48a3af instanceof Error?_0x48a3af[_0x55584d(0x367)]:String(_0x48a3af);return console['error'](a31_0x437b86['red'](_0x55584d(0x24c)+_0x47f2d5)),0x1;}if(_0x342c80[_0x55584d(0x39c)]===!![]||_0x342c80[_0x55584d(0x39c)]===''){const _0x531d92=_0x5e14e0['attributes']?.[_0x55584d(0x1f7)](_0x3d98b7=>_0x3d98b7['name'])||[];if(_0x531d92['length']===0x0)console[_0x55584d(0x2ef)](a31_0x437b86[_0x55584d(0x1bb)](_0x55584d(0x1a8)));else{console[_0x55584d(0x2ef)](a31_0x437b86['red'](_0x55584d(0x2d8))),console['error']('Available\x20attributes:');for(const _0x24392f of _0x531d92){console[_0x55584d(0x2ef)]('\x20\x20'+a31_0x437b86[_0x55584d(0x269)](_0x24392f));}console[_0x55584d(0x2ef)](_0x55584d(0x278)+_0x4ea343+_0x55584d(0x1b3)+_0x531d92[0x0]+'\x22');}return 0x1;}if(_0x342c80[_0x55584d(0x1d0)]===!![]||_0x342c80['behavior']===''){const _0x429e52=_0x5e14e0[_0x55584d(0x308)]?.[_0x55584d(0x1f7)](_0x3e5426=>_0x3e5426[_0x55584d(0x296)])||[];if(_0x429e52[_0x55584d(0x2e9)]===0x0)console[_0x55584d(0x2ef)](a31_0x437b86[_0x55584d(0x1bb)](_0x55584d(0x2d0)));else{console['error'](a31_0x437b86[_0x55584d(0x1bb)](_0x55584d(0x1b6))),console[_0x55584d(0x2ef)](_0x55584d(0x3a2));for(const _0x6f1888 of _0x429e52){console[_0x55584d(0x2ef)]('\x20\x20'+a31_0x437b86['cyan'](_0x6f1888));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x4ea343+_0x55584d(0x2a3)+_0x429e52[0x0]+'\x22');}return 0x1;}const _0x28ed45=createCommandSpinner(a31_0x437b86[_0x55584d(0x358)](_0x55584d(0x321)),{'verbose':_0x342c80[_0x55584d(0x1a0)]});_0x28ed45['start']();const _0x16dae4={'onProgress':_0x2877c6=>{const _0x466106=_0x55584d;_0x28ed45[_0x466106(0x2f5)]=formatProgressMessage(_0x2877c6);}};if(_0x342c80[_0x55584d(0x211)])_0x16dae4['master']=!![];if(_0x342c80[_0x55584d(0x39c)]&&typeof _0x342c80[_0x55584d(0x39c)]==='string')_0x16dae4['attribute']=_0x342c80[_0x55584d(0x39c)];if(_0x342c80[_0x55584d(0x1d0)]&&typeof _0x342c80[_0x55584d(0x1d0)]===_0x55584d(0x3b0))_0x16dae4[_0x55584d(0x1d0)]=_0x342c80['behavior'];if(_0x342c80[_0x55584d(0x205)])_0x16dae4['enriched']=!![];if(_0x342c80[_0x55584d(0x1e7)])_0x16dae4['interval']=_0x342c80[_0x55584d(0x1e7)];let _0x329b0c;try{_0x329b0c=await _0x3831e1[_0x55584d(0x207)][_0x55584d(0x287)](_0x178785,_0x16dae4),_0x28ed45[_0x55584d(0x2a4)]();}catch(_0x1c0c2c){_0x28ed45[_0x55584d(0x2a4)]();throw _0x1c0c2c;}return await this['displayPreviewResults'](_0x329b0c,{'master':_0x342c80[_0x55584d(0x211)],'attribute':typeof _0x342c80[_0x55584d(0x39c)]===_0x55584d(0x3b0)?_0x342c80['attribute']:undefined,'behavior':typeof _0x342c80[_0x55584d(0x1d0)]===_0x55584d(0x3b0)?_0x342c80['behavior']:undefined,'enriched':_0x342c80[_0x55584d(0x205)]}),_0x329b0c[_0x55584d(0x324)]?0x0:0x1;}async[a31_0x33df17(0x251)](_0x463201,_0x3eac55){const _0x51e9e4=a31_0x33df17;console[_0x51e9e4(0x2ef)]('\x0a'+a31_0x437b86['bold']('Preview:')+'\x20'+_0x463201['name']),console[_0x51e9e4(0x2ef)]('═'[_0x51e9e4(0x1ea)](0x3c));if(_0x3eac55[_0x51e9e4(0x211)]&&_0x463201[_0x51e9e4(0x2c4)]){const _0x2c37de=a31_0x437b86['dim'](_0x51e9e4(0x347))+'\x20'+a31_0x437b86['bold'](_0x463201[_0x51e9e4(0x211)][_0x51e9e4(0x253)]+'.'+_0x463201[_0x51e9e4(0x211)][_0x51e9e4(0x30d)]);await this[_0x51e9e4(0x37d)](_0x2c37de,_0x463201[_0x51e9e4(0x2c4)]);}else{if(_0x3eac55[_0x51e9e4(0x39c)]&&_0x463201[_0x51e9e4(0x2c4)]){const _0x30b32a=a31_0x437b86[_0x51e9e4(0x358)](_0x51e9e4(0x2ff))+'\x20'+a31_0x437b86[_0x51e9e4(0x31c)](_0x3eac55[_0x51e9e4(0x39c)]);await this[_0x51e9e4(0x37d)](_0x30b32a,_0x463201[_0x51e9e4(0x2c4)]);}else{if(_0x3eac55[_0x51e9e4(0x1d0)]&&_0x463201['sampleData']){const _0xfed5a3=a31_0x437b86[_0x51e9e4(0x358)](_0x51e9e4(0x294))+'\x20'+a31_0x437b86[_0x51e9e4(0x31c)](_0x3eac55[_0x51e9e4(0x1d0)]);await this[_0x51e9e4(0x37d)](_0xfed5a3,_0x463201['sampleData']);}else{if(_0x3eac55[_0x51e9e4(0x205)]&&_0x463201[_0x51e9e4(0x2c4)]){const _0x3cd03a=a31_0x437b86['dim']('Enriched:')+'\x20'+a31_0x437b86['bold'](_0x51e9e4(0x1ba));await this[_0x51e9e4(0x37d)](_0x3cd03a,_0x463201[_0x51e9e4(0x2c4)]);}else!_0x463201[_0x51e9e4(0x2c4)]&&console['error']('\x0aNo\x20sample\x20data\x20available');}}}if(_0x463201[_0x51e9e4(0x245)][_0x51e9e4(0x2e9)]>0x0){console['error']('─'[_0x51e9e4(0x1ea)](0x3c)),console[_0x51e9e4(0x2ef)]('\x0a'+a31_0x437b86[_0x51e9e4(0x1bb)]('Errors:'));for(const _0x54b566 of _0x463201['errors']){console[_0x51e9e4(0x2ef)]('\x20\x20'+a31_0x437b86[_0x51e9e4(0x1bb)]('•')+'\x20'+_0x54b566);}}}async[a31_0x33df17(0x37d)](_0x3bafe2,_0x4151c6){const _0x1ba5d0=a31_0x33df17;if(_0x4151c6['length']===0x0){console[_0x1ba5d0(0x2ef)]('\x0a'+_0x3bafe2),console[_0x1ba5d0(0x2ef)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x1ba5d0(0x2ef)]('\x0a'+_0x3bafe2);const _0x429278=Object[_0x1ba5d0(0x2ad)](_0x4151c6[0x0])['map'](_0x4946ab=>({'name':_0x4946ab,'type':typeof _0x4151c6[0x0][_0x4946ab]===_0x1ba5d0(0x397)?_0x1ba5d0(0x1b0):'varchar'})),_0x28f3d7={'queryId':_0x1ba5d0(0x1b1),'columns':_0x429278,'data':_0x4151c6,'stats':{'state':_0x1ba5d0(0x38f),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4151c6[_0x1ba5d0(0x2e9)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x39b602=formatAsTable(_0x28f3d7,_0x4151c6['length'],!![]);await writeOutput(_0x39b602,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a31_0x33df17(0x37a);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2a8);async['execute'](_0x18c641){const _0x57e068=a31_0x33df17,{options:_0x86de41,args:_0x15b124,tdx:_0x4781c0}=_0x18c641,_0x271f25=_0x86de41,_0x7fd9aa=_0x15b124[0x0]||_0x86de41[_0x57e068(0x2dd)];if(!_0x7fd9aa)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'+_0x57e068(0x325)),0x1;const _0x3628bb=resolveYamlFile(_0x7fd9aa);if(existsSync(_0x3628bb)){_0x271f25[_0x57e068(0x1a0)]&&console[_0x57e068(0x2ef)]('Found\x20YAML\x20file:\x20'+_0x3628bb);let _0x6222a6;try{_0x6222a6=readFileSync(_0x3628bb,_0x57e068(0x2e6));}catch(_0x45b90d){const _0x1046f9=_0x45b90d instanceof Error?_0x45b90d[_0x57e068(0x367)]:String(_0x45b90d);return console[_0x57e068(0x2ef)]('Error\x20reading\x20file:\x20'+_0x1046f9),0x1;}const _0x5840ee=await withSpinner(_0x57e068(0x2d7),()=>_0x4781c0['segment'][_0x57e068(0x27d)](_0x6222a6),{'verbose':_0x271f25[_0x57e068(0x1a0)]}),_0x552383=_0x5840ee[_0x57e068(0x1a1)],{isNew:_0x2cc9e2,name:_0xb3edda,hasChanges:_0x5667cd,diffFormatted:_0x372c25}=_0x552383;if(_0x5667cd){_0x2cc9e2?console[_0x57e068(0x2ef)](_0x57e068(0x28e)+_0xb3edda+'\x27:'):console[_0x57e068(0x2ef)](_0x57e068(0x353)+_0xb3edda+'\x27:');console['error']('─'[_0x57e068(0x1ea)](0x3c)),console[_0x57e068(0x2ef)](_0x372c25),console['error']('─'[_0x57e068(0x1ea)](0x3c));const _0x1bdb5c=_0x2cc9e2?'Create\x20parent\x20segment\x20\x27'+_0xb3edda+_0x57e068(0x276):_0x57e068(0x31e)+_0xb3edda+'\x27\x20and\x20run\x20workflow?';if(!_0x271f25[_0x57e068(0x32e)]){if(!isInteractive())return console[_0x57e068(0x2ef)](a31_0x437b86['red'](_0x57e068(0x340)),_0x57e068(0x3ab)),console['error'](a31_0x437b86[_0x57e068(0x358)](_0x57e068(0x262))),0x1;const _0x20b961=await confirmKey(_0x1bdb5c);if(!_0x20b961)return console[_0x57e068(0x2ef)](a31_0x437b86[_0x57e068(0x2e5)](_0x57e068(0x20d))),0x1;}const _0x1cd9ef=_0x2cc9e2?_0x57e068(0x27c):_0x57e068(0x231);await withSpinner(_0x1cd9ef+_0x57e068(0x360)+_0xb3edda+_0x57e068(0x335),()=>_0x552383['apply'](),{'verbose':_0x271f25[_0x57e068(0x1a0)]});const _0x11f524=_0x2cc9e2?_0x57e068(0x1d2):_0x57e068(0x25d);console[_0x57e068(0x2ef)]('✔\x20'+_0x11f524+_0x57e068(0x360)+_0xb3edda+'\x27');}else console[_0x57e068(0x2ef)](_0x57e068(0x1d8)+_0xb3edda+_0x57e068(0x2ab));}const _0x10ed60=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x7fd9aa+_0x57e068(0x335),()=>_0x4781c0[_0x57e068(0x207)][_0x57e068(0x310)](_0x7fd9aa),{'verbose':_0x271f25[_0x57e068(0x1a0)]}),_0x3f9852=_0x10ed60['data'],_0x664073=getConsoleUrl(_0x271f25['site'],_0x57e068(0x267)+_0x3f9852[_0x57e068(0x21d)]+_0x57e068(0x37f)+_0x3f9852[_0x57e068(0x3be)]+_0x57e068(0x339)+_0x3f9852[_0x57e068(0x255)]);return console[_0x57e068(0x2ef)](_0x57e068(0x376)),console['error']('\x20\x20'+a31_0x437b86['dim'](_0x57e068(0x35f))+'\x20'+_0x3f9852[_0x57e068(0x2fd)]),console[_0x57e068(0x2ef)]('\x20\x20'+a31_0x437b86[_0x57e068(0x358)](_0x57e068(0x232))+'\x20'+_0x3f9852[_0x57e068(0x26f)]),console[_0x57e068(0x2ef)]('\x20\x20'+a31_0x437b86[_0x57e068(0x358)](_0x57e068(0x2fe))+'\x20'+_0x3f9852[_0x57e068(0x3be)]),console[_0x57e068(0x2ef)]('\x20\x20'+a31_0x437b86['dim'](_0x57e068(0x2d3))+'\x20'+_0x3f9852[_0x57e068(0x255)]),console[_0x57e068(0x2ef)]('\x20\x20'+_0x664073),console[_0x57e068(0x2ef)]('\x0a'+a31_0x437b86[_0x57e068(0x358)](_0x57e068(0x1d7))+_0x57e068(0x1a5)+_0x3f9852[_0x57e068(0x255)]+_0x57e068(0x1ce)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x33df17(0x296)]='segment:parent:fields';[a31_0x33df17(0x2fa)]=a31_0x33df17(0x1a4);async[a31_0x33df17(0x29e)](_0x6e6f74){const _0x4aff01=a31_0x33df17,{options:_0x527135,args:_0x27e501,tdx:_0xc9bc94}=_0x6e6f74,_0xa33d5c=_0x27e501[0x0]||_0x527135[_0x4aff01(0x2dd)];if(!_0xa33d5c)return showParentSegmentNotSetError(_0x4aff01(0x299)+_0x4aff01(0x1d5)),0x1;_0x527135[_0x4aff01(0x1a0)]&&(console[_0x4aff01(0x2ef)]('Site:\x20'+_0x527135[_0x4aff01(0x24d)]),console['error'](_0x4aff01(0x29f)+_0xa33d5c));const _0xade800=await withSpinner(_0x4aff01(0x2cc)+_0xa33d5c+_0x4aff01(0x335),()=>_0xc9bc94[_0x4aff01(0x207)]['listFields'](_0xa33d5c),{'verbose':_0x527135['verbose']}),_0x201e22=_0xade800[_0x4aff01(0x1a1)];console[_0x4aff01(0x2ef)](_0x4aff01(0x396)+_0x201e22[_0x4aff01(0x2e9)]+_0x4aff01(0x3a1)+(_0x201e22[_0x4aff01(0x2e9)]!==0x1?'s':''));if(_0x527135[_0x4aff01(0x2c3)]||_0x527135[_0x4aff01(0x33b)])return await handleSDKOutput(_0x201e22,_0x527135),0x0;return displayFieldsHumanReadable(_0x201e22,_0xa33d5c),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x2f0);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2f7);async[a31_0x33df17(0x29e)](_0x1c6081){const _0x1d5139=a31_0x33df17,{options:_0x3e2a2d,args:_0x1261b9,tdx:_0x2003a2}=_0x1c6081,_0x4296e4=_0x3e2a2d,_0x2e459d=_0x1261b9[0x0]||_0x3e2a2d[_0x1d5139(0x2dd)];if(!_0x2e459d)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'+_0x1d5139(0x286)+'Options:\x0a'+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x3e2a2d[_0x1d5139(0x1a0)]&&(console[_0x1d5139(0x2ef)](_0x1d5139(0x368)+_0x3e2a2d['site']),console[_0x1d5139(0x2ef)]('Parent\x20segment:\x20'+_0x2e459d));const _0x31d03d=await withSpinner(_0x1d5139(0x394)+_0x2e459d+_0x1d5139(0x335),()=>_0x2003a2['segment'][_0x1d5139(0x318)](_0x2e459d),{'verbose':_0x3e2a2d[_0x1d5139(0x1a0)]}),_0x2000d2=_0x31d03d[_0x1d5139(0x1a1)];if(_0x4296e4[_0x1d5139(0x37b)]){const _0x2f34dc=getConsoleNextUrl(_0x4296e4['site'],_0x1d5139(0x201)+_0x2000d2['id']);return console[_0x1d5139(0x2ef)](a31_0x437b86['green']('✔')+_0x1d5139(0x239)+a31_0x437b86['cyan'](_0x2f34dc)),openBrowser(_0x2f34dc),0x0;}return await handleSingleObjectOutput(_0x2000d2,_0x3e2a2d),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x33df17(0x296)]='segment:parent:desc';['description']=a31_0x33df17(0x21b);async['execute'](_0x3c0ce6){const _0x230a99=a31_0x33df17,{options:_0x309d4c,args:_0x4b54d1,tdx:_0x22575d}=_0x3c0ce6,_0x382d4c=_0x309d4c,_0x1837e9=_0x4b54d1[0x0]||_0x309d4c[_0x230a99(0x2dd)];if(!_0x1837e9)return showParentSegmentNotSetError(_0x230a99(0x266)+_0x230a99(0x2b5)+_0x230a99(0x238)+_0x230a99(0x374)),0x1;_0x309d4c[_0x230a99(0x1a0)]&&(console['error'](_0x230a99(0x368)+_0x309d4c[_0x230a99(0x24d)]),console[_0x230a99(0x2ef)]('Parent\x20segment:\x20'+_0x1837e9));const _0x53ad77=await withSpinner(_0x230a99(0x221)+_0x1837e9+_0x230a99(0x335),()=>_0x22575d[_0x230a99(0x207)][_0x230a99(0x1fc)](_0x1837e9),{'verbose':_0x309d4c['verbose']}),_0x156c9e=_0x53ad77['data'],_0x406b40=_0x22575d[_0x230a99(0x207)]['getOutputDatabaseName'](_0x156c9e);if(_0x382d4c['output']){const _0x2f41ac=await this[_0x230a99(0x265)](_0x3c0ce6,_0x1837e9,_0x156c9e,_0x406b40),_0x2d5227=this[_0x230a99(0x235)](_0x2f41ac);writeFileSync(_0x382d4c['output'],_0x2d5227);const _0x10f987=_0x2f41ac[_0x230a99(0x1b2)][_0x230a99(0x34d)][_0x230a99(0x2e9)]+_0x2f41ac[_0x230a99(0x308)][_0x230a99(0x1df)]((_0x3dbc9e,_0x2417b0)=>_0x3dbc9e+_0x2417b0[_0x230a99(0x34d)][_0x230a99(0x2e9)],0x0),_0x39c012=_0x2f41ac[_0x230a99(0x308)][_0x230a99(0x315)](_0x3cac7b=>_0x3cac7b[_0x230a99(0x34d)][_0x230a99(0x2e9)]===0x0)['length'];return console[_0x230a99(0x2c2)]('Schema\x20saved\x20to\x20'+_0x382d4c[_0x230a99(0x233)]),console[_0x230a99(0x2c2)](_0x230a99(0x22d)+_0x406b40),console[_0x230a99(0x2c2)](_0x230a99(0x2ba)+_0x2f41ac[_0x230a99(0x308)][_0x230a99(0x2e9)]+_0x230a99(0x322)),console[_0x230a99(0x2c2)](_0x230a99(0x25f)+_0x10f987+_0x230a99(0x2b6)),_0x39c012>0x0&&console[_0x230a99(0x2c2)](_0x230a99(0x263)+_0x39c012+_0x230a99(0x209)),0x0;}console[_0x230a99(0x2ef)]('\x0a'+a31_0x437b86[_0x230a99(0x31c)](_0x230a99(0x2ae))+'\x20'+a31_0x437b86['cyan'](_0x406b40));const _0x37d3e1=await withSpinner(_0x230a99(0x304),()=>_0x22575d[_0x230a99(0x207)][_0x230a99(0x334)](_0x156c9e),{'verbose':_0x309d4c[_0x230a99(0x1a0)]});console[_0x230a99(0x2ef)]('\x0a'+a31_0x437b86[_0x230a99(0x31c)](_0x230a99(0x1b2))+'\x20'+a31_0x437b86['dim']('('+_0x406b40+_0x230a99(0x390)));const _0x5c6408=await executeSchemaQuery(_0x37d3e1[_0x230a99(0x1a1)],_0x22575d,_0x309d4c);await handleQueryOutput(_0x5c6408,_0x309d4c);const _0x192f3c=await withSpinner(_0x230a99(0x214),()=>_0x22575d[_0x230a99(0x207)][_0x230a99(0x270)](_0x156c9e),{'verbose':_0x309d4c['verbose']});for(const _0x546672 of _0x192f3c[_0x230a99(0x1a1)]){const _0x3aafdb=_0x230a99(0x1f5)+_0x546672[_0x230a99(0x242)]()[_0x230a99(0x341)](/\s+/g,'_'),_0x2e0630=_0x230a99(0x25b)+_0x406b40+'.'+_0x3aafdb;console['error']('\x0a'+a31_0x437b86['bold'](_0x546672)+'\x20'+a31_0x437b86['dim']('('+_0x406b40+'.'+_0x3aafdb+')'));try{const _0x357b6e=await executeSchemaQuery(_0x2e0630,_0x22575d,_0x309d4c);await handleQueryOutput(_0x357b6e,_0x309d4c);}catch{console[_0x230a99(0x2ef)](a31_0x437b86[_0x230a99(0x2e5)](_0x230a99(0x370)));}}return 0x0;}async[a31_0x33df17(0x265)](_0x2a5d1d,_0x4a91fc,_0x26e889,_0x208b6c){const _0x4d6f47=a31_0x33df17,{options:_0xa17f45,tdx:_0x2ea480}=_0x2a5d1d,_0x3e822c=await withSpinner(_0x4d6f47(0x304),()=>_0x2ea480[_0x4d6f47(0x207)][_0x4d6f47(0x334)](_0x26e889),{'verbose':_0xa17f45[_0x4d6f47(0x1a0)]}),_0x2f5ca2=await executeSchemaQuery(_0x3e822c[_0x4d6f47(0x1a1)],_0x2ea480,_0xa17f45),_0x3b2ced=_0x2f5ca2['data'][_0x4d6f47(0x1f7)](_0x43e753=>({'name':_0x43e753[_0x4d6f47(0x22e)],'type':_0x43e753['column_type']})),_0x98d59a=await withSpinner(_0x4d6f47(0x214),()=>_0x2ea480[_0x4d6f47(0x207)]['getBehaviorNames'](_0x26e889),{'verbose':_0xa17f45[_0x4d6f47(0x1a0)]}),_0x235be1=[];for(const _0x45873b of _0x98d59a[_0x4d6f47(0x1a1)]){const _0x5c078f=_0x4d6f47(0x1f5)+_0x45873b[_0x4d6f47(0x242)]()['replace'](/\s+/g,'_'),_0xde6f78=_0x4d6f47(0x25b)+_0x208b6c+'.'+_0x5c078f;let _0x58ce88=[];try{const _0xdc2cbb=await executeSchemaQuery(_0xde6f78,_0x2ea480,_0xa17f45);_0x58ce88=_0xdc2cbb[_0x4d6f47(0x1a1)][_0x4d6f47(0x1f7)](_0x593900=>({'name':_0x593900[_0x4d6f47(0x22e)],'type':_0x593900[_0x4d6f47(0x27b)]}));}catch{}_0x235be1[_0x4d6f47(0x277)]({'table':_0x5c078f,'columns':_0x58ce88});}return{'database':_0x208b6c,'parent_segment':_0x4a91fc,'parent_id':_0x26e889,'customers':{'table':_0x4d6f47(0x1b2),'columns':_0x3b2ced},'behaviors':_0x235be1};}[a31_0x33df17(0x235)](_0x590514){const _0x3158d3=a31_0x33df17,_0x1bc592=_0x5cdf9b=>{const _0x585bee=a31_0x26a5;if(_0x5cdf9b[_0x585bee(0x2e9)]===0x0)return'[]';const _0x2e0cfc=_0x5cdf9b['map'](_0x12173d=>_0x585bee(0x1cd)+_0x12173d[_0x585bee(0x296)]+_0x585bee(0x1f2)+_0x12173d[_0x585bee(0x34e)]+'\x22\x20}');return'[\x0a'+_0x2e0cfc[_0x585bee(0x1d3)](',\x0a')+_0x585bee(0x1e0);},_0x24e8b0=_0x590514[_0x3158d3(0x308)][_0x3158d3(0x1f7)](_0x21f769=>{const _0x3fd4a3=_0x3158d3;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x21f769[_0x3fd4a3(0x30d)]+_0x3fd4a3(0x26d)+_0x1bc592(_0x21f769[_0x3fd4a3(0x34d)])['replace'](/^/gm,'\x20\x20')[_0x3fd4a3(0x364)]()+_0x3fd4a3(0x302);})[_0x3158d3(0x1d3)](',\x0a');return _0x3158d3(0x223)+_0x590514[_0x3158d3(0x253)]+_0x3158d3(0x21c)+_0x590514[_0x3158d3(0x38d)]+_0x3158d3(0x222)+_0x590514['parent_id']+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x590514['customers'][_0x3158d3(0x30d)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x1bc592(_0x590514[_0x3158d3(0x1b2)]['columns'])[_0x3158d3(0x341)](/^/gm,'\x20\x20')[_0x3158d3(0x364)]()+_0x3158d3(0x243)+_0x24e8b0+_0x3158d3(0x2c1);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x1d6);[a31_0x33df17(0x2fa)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a31_0x33df17(0x29e)](_0x4be00d){const _0x4dba22=a31_0x33df17,{options:_0x460adc,args:_0x5eeab5,tdx:_0x4e1f6c}=_0x4be00d,_0x33b824=_0x5eeab5[0x0]||_0x460adc['parentSegment'];if(!_0x33b824)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x4dba22(0x236)),0x1;_0x460adc[_0x4dba22(0x1a0)]&&(console[_0x4dba22(0x2ef)](_0x4dba22(0x368)+_0x460adc[_0x4dba22(0x24d)]),console[_0x4dba22(0x2ef)](_0x4dba22(0x29f)+_0x33b824));const _0x38da07=await withSpinner(_0x4dba22(0x221)+_0x33b824+_0x4dba22(0x335),()=>_0x4e1f6c[_0x4dba22(0x207)]['resolveParentId'](_0x33b824),{'verbose':_0x460adc['verbose']}),_0x5165cd=_0x38da07[_0x4dba22(0x1a1)],_0x1f3e61=await withSpinner(_0x4dba22(0x338)+_0x33b824+_0x4dba22(0x335),()=>_0x4e1f6c[_0x4dba22(0x207)][_0x4dba22(0x334)](_0x5165cd),{'verbose':_0x460adc[_0x4dba22(0x1a0)]}),_0x211a97=_0x1f3e61[_0x4dba22(0x1a1)];return _0x460adc[_0x4dba22(0x1f3)]===_0x4dba22(0x2c3)||_0x460adc['format']==='jsonl'?await handleSDKOutput([{'sql':_0x211a97}],_0x460adc):console[_0x4dba22(0x2c2)](_0x211a97),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a31_0x33df17(0x320);['description']='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x33df17(0x29e)](_0xa736e4){const _0x1f1a49=a31_0x33df17,{options:_0xa1fdb9,args:_0x518297,tdx:_0xae6d6f}=_0xa736e4,_0x1ec067=_0x518297[0x0]||_0xa1fdb9['parentSegment'];if(!_0x1ec067)return showParentSegmentNotSetError(_0x1f1a49(0x2cf)+_0x1f1a49(0x290)),0x1;_0xa1fdb9[_0x1f1a49(0x1a0)]&&(console[_0x1f1a49(0x2ef)](_0x1f1a49(0x368)+_0xa1fdb9['site']),console[_0x1f1a49(0x2ef)]('Parent\x20segment:\x20'+_0x1ec067));const _0x35d675=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1ec067+_0x1f1a49(0x335),()=>_0xae6d6f[_0x1f1a49(0x207)][_0x1f1a49(0x1fc)](_0x1ec067),{'verbose':_0xa1fdb9[_0x1f1a49(0x1a0)]}),_0x1795f5=_0x35d675[_0x1f1a49(0x1a1)],_0x46ca65=await withSpinner(_0x1f1a49(0x338)+_0x1ec067+'\x27...',()=>_0xae6d6f['segment']['getParentSQL'](_0x1795f5),{'verbose':_0xa1fdb9[_0x1f1a49(0x1a0)]});let _0x5e3051=_0x46ca65['data'];const _0x4a59b9=resolveLimit(_0xa1fdb9['limit'],DEFAULT_DISPLAY_LIMIT),_0x3b7d25=/\bLIMIT\s+\d+/i[_0x1f1a49(0x2d9)](_0x5e3051);!_0x3b7d25&&(_0x5e3051=_0x5e3051['trim']()[_0x1f1a49(0x341)](/;+$/,''),_0x5e3051=_0x1f1a49(0x26e)+_0x5e3051+_0x1f1a49(0x327)+_0x4a59b9);_0xa1fdb9['verbose']&&console[_0x1f1a49(0x2ef)](_0x1f1a49(0x330)+_0x5e3051);const _0x2356f6=await withProgressSpinner(_0x1f1a49(0x2e1),async _0x124ac4=>{const _0x135906=_0x1f1a49,_0x15eb99=await _0xae6d6f[_0x135906(0x2b3)][_0x135906(0x29e)](_0x5e3051,{'catalog':'td','schema':_0x135906(0x31a),'onJobId':_0x23d211=>{_0x124ac4['setJobId'](_0x23d211);}});return _0x15eb99;},{'verbose':_0xa1fdb9[_0x1f1a49(0x1a0)]}),_0x30c5dd=_0x2356f6[_0x1f1a49(0x1a1)],_0x1c3d52=_0x30c5dd[_0x1f1a49(0x23b)]?_0x1f1a49(0x25c)+_0x30c5dd[_0x1f1a49(0x23b)]+']':'';return console['error'](_0x1f1a49(0x1dc)+_0x30c5dd[_0x1f1a49(0x3b1)][_0x1f1a49(0x3a9)][_0x1f1a49(0x2d5)]()+'\x20rows\x20'+(_0x1f1a49(0x312)+formatElapsed(_0x30c5dd[_0x1f1a49(0x3b1)][_0x1f1a49(0x392)])+_0x1c3d52)),await handleQueryOutput(_0x30c5dd,_0xa1fdb9),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x298);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x247);async['execute'](_0x2e9c34){const _0x3c1c97=a31_0x33df17,{options:_0x50dfad,args:_0x39bd84,tdx:_0x229593}=_0x2e9c34,_0x20aebe=_0x39bd84[0x0],_0x5bf5c5=await withSpinner(_0x20aebe?'Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27'+_0x20aebe+_0x3c1c97(0x335):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x229593[_0x3c1c97(0x3bb)][_0x3c1c97(0x288)](),{'verbose':_0x50dfad[_0x3c1c97(0x1a0)]});let _0x18315b=_0x5bf5c5['data']['filter'](_0x511cf2=>_0x511cf2['realtime_enabled']);if(_0x20aebe){const _0x25254b=_0x20aebe[_0x3c1c97(0x341)](/[.+^${}()|[\]\\]/g,_0x3c1c97(0x2bf))[_0x3c1c97(0x341)](/\*/g,'.*')[_0x3c1c97(0x341)](/\?/g,'.'),_0x545ad3=new RegExp('^'+_0x25254b+'$','i');_0x18315b=_0x18315b[_0x3c1c97(0x315)](_0x48bad7=>_0x545ad3[_0x3c1c97(0x2d9)](_0x48bad7['name']));}_0x18315b['sort']((_0x3a3d55,_0x2cc74d)=>_0x3a3d55[_0x3c1c97(0x296)][_0x3c1c97(0x35d)](_0x2cc74d[_0x3c1c97(0x296)])),console[_0x3c1c97(0x2ef)]('✔\x20Found\x20'+_0x18315b[_0x3c1c97(0x2e9)]+_0x3c1c97(0x1c1)+(_0x18315b[_0x3c1c97(0x2e9)]!==0x1?'s':''));const _0x5e481f=_0x5254c8=>{const _0x33d2d5=_0x3c1c97;return getConsoleNextUrl(_0x50dfad[_0x33d2d5(0x24d)],'/app/dw/parentSegments/'+_0x5254c8);};if(_0x50dfad['format']===_0x3c1c97(0x2c3)||_0x50dfad[_0x3c1c97(0x1f3)]===_0x3c1c97(0x33b)){const _0x4d4e57=_0x18315b[_0x3c1c97(0x1f7)](_0x565095=>({..._0x565095,'url':_0x5e481f(_0x565095['id'])}));await handleSDKOutput(_0x4d4e57,_0x50dfad);}else{if(_0x18315b['length']===0x0)console[_0x3c1c97(0x2c2)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x3b2f18 of _0x18315b){const _0x43ad11=_0x3b2f18[_0x3c1c97(0x1eb)]?a31_0x437b86[_0x3c1c97(0x358)]('\x20('+formatRows(_0x3b2f18[_0x3c1c97(0x1eb)])+')'):'',_0xcf08f3=hyperlink(_0x3b2f18[_0x3c1c97(0x296)],_0x5e481f(_0x3b2f18['id']));console[_0x3c1c97(0x2c2)]('⚡\x20'+_0xcf08f3+_0x43ad11);}}return 0x0;}}function a31_0x9269(){const _0x551de3=['tdx\x20ps\x20preview\x20','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Error:\x20Token\x20ID\x20is\x20required','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','coveragePercent','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','workflowId','\x20Added\x20personalization\x20template\x20to\x20','.yaml','/\x20directories\x20exist.','Resolving\x20parent\x20segment\x20\x27','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','{\x0a\x20\x20\x22database\x22:\x20\x22','segment:parent:create','delete','\x20+\x20[','parent_segments','behaviorsFile','\x20\x20\x20\x20-\x20','Error:\x20--name\x20is\x20required','Personalization\x20service\x20description','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x20Database:\x20','column_name','entryCriteria','token:','Updating','Status:','output','✔\x20Found\x20personalization\x20\x27','formatSchemaJson','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Options:\x0a','\x20Opening\x20','segment:parent:validate','jobId','primaryKey','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','No\x20personalizations\x20configured','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','\x27\x20is\x20already\x20up\x20to\x20date','last_page_viewed','toLowerCase','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','errors','✔\x20Created\x20personalization\x20service\x20\x27','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','patchPersonalization','start','all','displayRealtimeInfo','Error\x20parsing\x20YAML:\x20','site','identifier','2494053kZulfR','value','displayPreviewResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','database','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','workflowAttemptId','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','payload','Fetching\x20personalization\x20service\x20\x27','folderId','Error:\x20Service\x20ID\x20is\x20required','SELECT\x20*\x20FROM\x20','\x20[Job\x20ID:\x20','Updated','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20Columns:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','customersWithEvents','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Note:\x20','\x20--attribute\x20\x22<name>\x22','collectSchema','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','/app/workflows/','Validating\x20configuration...','cyan','includeSensitive','Create\x20a\x20realtime\x20personalization\x20entity','createParent','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','SELECT\x20*\x20FROM\x20(\x0a','status','getBehaviorNames','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','\x20No\x20changes\x20-\x20','Delete\x20a\x20realtime\x20personalization','\x20RT\x20journey','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','\x27\x20and\x20run\x20workflow?','push','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','ps:rt:jn:pause','column_type','Creating','pushParentYaml','dirname','Options:','any','updatedAt','Deleting\x20token\x20\x27','rowCount','xdg-open','⚡\x20Enabled','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','previewParentYaml','list','My\x20Service','ignore','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','✔\x20Deleted\x20personalization\x20service\x20\x27','createToken','\x0aNew\x20parent\x20segment\x20\x27','ps:pz:list','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','ps:pz:service:list','green','\x27\x20for\x20service\x20\x27','Behavior:','schemaValid','name','✘\x20Failed\x20to\x20rename\x20directory:\x20','ps:rt:list','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','paused','ps:pz:init','(id:\x20','Columns:','execute','Parent\x20segment:\x20','178009uToUmw','30kdATPJ','stringify','\x20--behavior\x20\x22','stop','\x20\x201.\x20Edit\x20','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','allowedIps','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Updating\x20parent\x20segment\x20\x27','\x27\x20is\x20up\x20to\x20date','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','keys','Output\x20Database:','Events:','%)\x20','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','query','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\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','\x20total','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','ps:pz:delete','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x20Tables:\x201\x20customers\x20+\x20','Coverage:','addAttributes','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','\x5c$&','win32','\x0a\x20\x20]\x0a}\x0a','log','json','sampleData','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20--interval\x20','\x20personalization','displayAttributesStats','<database>.<table>','Join:','ps:rt:jn:resume','Listing\x20fields\x20for\x20\x27','`\x20to\x20download\x20the\x20configuration\x20first','339449ElWlgA','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Show\x20personalization\x20service\x20details','Attempt:','unref','toLocaleString','endsWith','Analyzing\x20changes...','Error:\x20--attribute\x20requires\x20a\x20name\x0a','test','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','tokens','parentSegment','foreignKey','\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','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','Executing\x20parent\x20segment\x20query...','\x20=\x20','file','RT\x202.0:','yellow','utf-8','sections','126yVcQJh','length','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','Output\x20file:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','No\x20parent\x20segments\x20found','\x20\x20\x20\x20\x20\x20','error','segment:parent:view','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','ps:pz:patch','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','some','text','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Show\x20parent\x20segment\x20details','List\x20parent\x20segments','ID\x20Stitching:','description','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','customerGroupFile','audienceId','Session:','Attribute:','create','/\x20directory.\x0a','\x0a\x20\x20\x20\x20}','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','Fetching\x20customers\x20schema...','Behaviors','run','displaySummary','behaviors','.yml','-1d','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','Error:','table','Error\x20reading\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','runParent','ps:pz:create','in\x20','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','darwin','filter','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','state','getParentFull','Name:\x20','information_schema','schemaError','bold','ps:rt:configuration_versions','Apply\x20changes\x20to\x20\x27','Patching\x20personalization\x20\x27','segment:parent:show','Fetching\x20sample\x20data...','\x20behaviors','Creating\x20token\x20\x27','allValid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','displayMasterInfo','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','stageCount','Validate:','RT\x202.0\x20Validate:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','126vnAhwP','Creating\x20parent\x20segment\x20\x27','yes','audienceId:\x20','SQL\x20query:\x0a','timezone','customerGroup','Listing\x20RT\x20journeys\x20for\x20\x27','getParentSQL','\x27...','validateParentYaml','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Fetching\x20SQL\x20for\x20\x27','/attempt/','sourceTableValid','jsonl','matchedCount','get','sourceTableError','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x0aError:','replace','relationships','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','Deleting\x20personalization\x20service\x20\x27','Error:\x20File\x20not\x20found:\x20','\x20RT\x20configuration\x20is\x20valid','Master:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','entryCriteria:','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','✔\x20Retrieved\x20RT\x20configuration\x20version','columns','type','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','valid','\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','\x0aChanges\x20to\x20apply\x20to\x20\x27','✔\x20Created\x20parent\x20segment\x20\x27','\x20stage','Listing\x20parent\x20segments...','1778895PVtXzP','dim','\x20--enriched','\x0a⚠️\x20\x20Both\x20','Listing\x20personalizations\x20for\x20\x27','Creating\x20personalization\x20service\x20\x27','localeCompare','idStitching','Audience\x20ID:','\x20parent\x20segment\x20\x27','ps:pz:service:token:delete','id:\x20','\x27\x20with\x20ID:\x20','trim','personalization_services','sections:','message','Site:\x20','Errors:','true','Error:\x20Service\x20name\x20is\x20required','4gaqEMs','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','sort','includeSensitive:','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x20rows)','\x20true','\x20\x20\x20\x20','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','identifier:\x20','\x0a✔\x20Workflow\x20started','scheduleOption','public','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','segment:parent:run','web','createdAt','displaySampleData','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','/sessions/','Default','folder-segment','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','Error:\x20--database\x20and\x20--table\x20are\x20required','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','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','segment:parent:list','RT\x20Journey\x20ID:\x20','Pause\x20activations\x20in\x20an\x20RT\x20journey','resumeJourney','ps:pz:service:delete','parent_segment','open','FINISHED','.customers)','ps:pz:service:show','elapsedTimeMillis','Master\x20Table','Fetching\x20parent\x20segment\x20\x27','ps:pz:show','✔\x20Found\x20','number','ps:pz:service:token:create','payload:','segment:parent:push','ps:rt:jn:list','attribute','attributes','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','\x20configured','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','\x20field','Available\x20behaviors:','✔\x20Created\x20personalization\x20\x27','created:','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','getPersonalization','\x20--behavior\x20\x22<name>\x22','Join\x20on:','processedRows','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Source:','To\x20view\x20sample\x20data:','2692448glWYoW','324drMtHX','string','stats','personalizationServices','\x20parent\x20segment','joinKey','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','column','\x20to\x20configure\x20your\x20personalization\x20service','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','✔\x20Created\x20token\x20\x27','audienceId:','realtime','stitchingKeys','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','workflowSessionId','single','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','ps:rt:validate','verbose','data','split','4kASLZW','List\x20available\x20fields\x20for\x20segmentation','\x20tdx\x20wf\x20attempt\x20','/{name}.yml\x0a','/\x20→\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','page_view','launched','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','platform','222295oPFkOe','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','double','preview','customers','\x20--attribute\x20\x22','null','keyEventCriteria','Error:\x20--behavior\x20requires\x20a\x20name\x0a','totalEvents','keyEventId:','\x0aChanges\x20to\x20\x27','Master\x20+\x20Attributes','red','listParents','pullParentYaml','Creating\x20personalization\x20\x27','\x20to\x20push\x20the\x20configuration','Updating\x20personalization\x20service\x20\x27','\x20RT-enabled\x20parent\x20segment','7yKVxep','pauseJourney','updateParent','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20service(s)\x20configured','Show\x20a\x20specific\x20realtime\x20personalization','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','deleteToken','addBehaviors','allowed\x20IPs:','addAttributesFile','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20kill','\x20(paused)','behavior','personalization','Created','join','attributesFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','segment:parent:sql','To\x20cancel:','✔\x20No\x20changes\x20-\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','events','tdx\x20ps\x20push\x20','✔\x20Query\x20completed:\x20Processed\x20','segment:parent:pull','Deleting\x20personalization\x20\x27','reduce','\x0a\x20\x20\x20\x20]','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','isDirectory','scheduleType','Listing\x20personalization\x20services\x20for\x20\x27','Rows:','interval','customerPercent','1299597PWGFaJ','repeat','population','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','label','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','Database:\x20','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','\x22,\x20\x22type\x22:\x20\x22','format','eventKind','behavior_','realtime:','map','displayPreviewHints','/\x20and\x20','✔\x20Updated\x20parent\x20segment\x20\x27','\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}','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Error:\x20Personalization\x20ID\x20is\x20required','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Update\x20a\x20realtime\x20personalization\x20entity','/app/dw/parentSegments/','Finding\x20service\x20for\x20token...','\x20service','using\x20the\x20default\x20path:\x20','enriched','Table:\x20','segment','displayBehaviorsStats','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','\x20personalization\x20service','\x20\x20\x20\x20\x20\x20\x20\x20','No\x20personalization\x20services\x20configured','Aborted.','displayColumns','⚡\x20Not\x20enabled','toFixed','master','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Fetching\x20behavior\x20list...'];a31_0x9269=function(){return _0x551de3;};return a31_0x9269();}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x3c1);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x1ed);async['execute'](_0x4e9c0d){const _0xdd2b51=a31_0x33df17,{options:_0x35f6ce,args:_0x1f3b0c,tdx:_0xf53c56}=_0x4e9c0d,_0x58719f=_0x1f3b0c[0x0]||_0x35f6ce[_0xdd2b51(0x2dd)];if(!_0x58719f)return showParentSegmentNotSetError(_0xdd2b51(0x275)+_0xdd2b51(0x303)),0x1;const _0x5618b9=resolveYamlFile(_0x58719f);if(!existsSync(_0x5618b9))return showFileNotFoundError(_0x5618b9,_0x58719f),0x1;let _0x12b7d3;try{_0x12b7d3=readFileSync(_0x5618b9,_0xdd2b51(0x2e6));}catch(_0x4bca04){const _0x489fa0=_0x4bca04 instanceof Error?_0x4bca04[_0xdd2b51(0x367)]:String(_0x4bca04);return console[_0xdd2b51(0x2ef)](_0xdd2b51(0x30e)+_0x489fa0),0x1;}const _0x589589=createCommandSpinner(a31_0x437b86[_0xdd2b51(0x358)]('Validating\x20RT\x20configuration...'),{'verbose':_0x35f6ce[_0xdd2b51(0x1a0)]});_0x589589[_0xdd2b51(0x249)]();const _0x15f180={'realtime':!![],'onProgress':_0x50f0af=>{const _0x54db51=_0xdd2b51;_0x589589[_0x54db51(0x2f5)]=formatProgressMessage(_0x50f0af);}};let _0x15ab51;try{_0x15ab51=await _0xf53c56[_0xdd2b51(0x207)][_0xdd2b51(0x336)](_0x12b7d3,_0x15f180),_0x589589[_0xdd2b51(0x2a4)]();}catch(_0xb7f442){_0x589589['stop']();throw _0xb7f442;}console[_0xdd2b51(0x2ef)]('\x0a'+a31_0x437b86[_0xdd2b51(0x31c)](_0xdd2b51(0x32a))+'\x20'+_0x15ab51[_0xdd2b51(0x296)]),console['error']('═'[_0xdd2b51(0x1ea)](0x3c)),displayRealtimeValidation(_0x15ab51),console[_0xdd2b51(0x2ef)]('─'[_0xdd2b51(0x1ea)](0x3c));if(_0x15ab51[_0xdd2b51(0x245)][_0xdd2b51(0x2e9)]>0x0){console[_0xdd2b51(0x2ef)]('\x0a'+a31_0x437b86[_0xdd2b51(0x1bb)](_0xdd2b51(0x369)));for(const _0x4ffbc5 of _0x15ab51['errors']){console[_0xdd2b51(0x2ef)]('\x20\x20'+a31_0x437b86[_0xdd2b51(0x1bb)]('•')+'\x20'+_0x4ffbc5);}}return _0x15ab51[_0xdd2b51(0x324)]&&console[_0xdd2b51(0x2ef)]('\x0a'+a31_0x437b86['green']('✔')+_0xdd2b51(0x346)),_0x15ab51[_0xdd2b51(0x324)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{['name']=a31_0x33df17(0x39b);[a31_0x33df17(0x2fa)]='List\x20RT\x20journeys';async[a31_0x33df17(0x29e)](_0x4ac9b6){const _0x2c94a8=a31_0x33df17,{options:_0x2b7755,args:_0x76fac,tdx:_0x17ee47}=_0x4ac9b6,_0x2af706=_0x76fac[0x0]||_0x2b7755['parentSegment'];if(!_0x2af706)return showParentSegmentNotSetError(_0x2c94a8(0x313)+_0x2c94a8(0x2df)),0x1;_0x2b7755[_0x2c94a8(0x1a0)]&&(console[_0x2c94a8(0x2ef)](_0x2c94a8(0x368)+_0x2b7755[_0x2c94a8(0x24d)]),console[_0x2c94a8(0x2ef)](_0x2c94a8(0x29f)+_0x2af706));const _0x2bf8b8=await withSpinner(_0x2c94a8(0x221)+_0x2af706+_0x2c94a8(0x335),()=>_0x17ee47[_0x2c94a8(0x207)][_0x2c94a8(0x1fc)](_0x2af706),{'verbose':_0x2b7755[_0x2c94a8(0x1a0)]}),_0x55bd0a=_0x2bf8b8[_0x2c94a8(0x1a1)],_0x91fadd=await withSpinner(_0x2c94a8(0x333)+_0x2af706+_0x2c94a8(0x335),()=>_0x17ee47[_0x2c94a8(0x3bb)]['listJourneys'](_0x55bd0a),{'verbose':_0x2b7755[_0x2c94a8(0x1a0)]}),_0x3385a4=_0x91fadd[_0x2c94a8(0x1a1)];console[_0x2c94a8(0x2ef)](_0x2c94a8(0x396)+_0x3385a4['length']+_0x2c94a8(0x274)+(_0x3385a4['length']!==0x1?'s':''));if(_0x2b7755['format']==='json'||_0x2b7755[_0x2c94a8(0x1f3)]===_0x2c94a8(0x33b))await handleSDKOutput(_0x3385a4,_0x2b7755);else{if(_0x3385a4[_0x2c94a8(0x2e9)]===0x0)console[_0x2c94a8(0x2c2)]('No\x20RT\x20journeys\x20found');else for(const _0x1a41be of _0x3385a4){const _0x58dc01=_0x1a41be['state']===_0x2c94a8(0x1aa)?'🚀':'📝',_0x451c55=_0x1a41be[_0x2c94a8(0x29a)]?a31_0x437b86[_0x2c94a8(0x2e5)]('\x20(paused)'):'',_0x1279cf=a31_0x437b86['dim']('\x20('+_0x1a41be[_0x2c94a8(0x328)]+_0x2c94a8(0x355)+(_0x1a41be[_0x2c94a8(0x328)]!==0x1?'s':'')+')');console[_0x2c94a8(0x2c2)](_0x58dc01+'\x20'+_0x1a41be['name']+_0x451c55+_0x1279cf);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x27a);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x38a);async[a31_0x33df17(0x29e)](_0x1ae08e){const _0x53283f=a31_0x33df17,{options:_0x4b8e72,args:_0x43baec,tdx:_0x280647}=_0x1ae08e,_0x29ee13=_0x43baec[0x0];if(!_0x29ee13)return console['error'](a31_0x437b86[_0x53283f(0x1bb)](_0x53283f(0x2f3))),console[_0x53283f(0x2ef)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console[_0x53283f(0x2ef)](a31_0x437b86['dim'](_0x53283f(0x30b))),0x1;_0x4b8e72[_0x53283f(0x1a0)]&&(console[_0x53283f(0x2ef)]('Site:\x20'+_0x4b8e72[_0x53283f(0x24d)]),console['error'](_0x53283f(0x389)+_0x29ee13));const _0x555173=await withSpinner(_0x53283f(0x1f1)+_0x29ee13+_0x53283f(0x335),()=>_0x280647[_0x53283f(0x3bb)][_0x53283f(0x1c3)](_0x29ee13),{'verbose':_0x4b8e72['verbose']}),_0x3fc16f=_0x555173[_0x53283f(0x1a1)];console[_0x53283f(0x2ef)](_0x53283f(0x1e2)+_0x3fc16f['name']+'\x27');if(_0x4b8e72[_0x53283f(0x1f3)]===_0x53283f(0x2c3)||_0x4b8e72['format']===_0x53283f(0x33b))await handleSDKOutput([_0x3fc16f],_0x4b8e72);else{const _0x131ef9=_0x3fc16f[_0x53283f(0x317)]===_0x53283f(0x1aa)?'🚀':'📝',_0x3a3339=_0x3fc16f[_0x53283f(0x29a)]?a31_0x437b86[_0x53283f(0x2e5)]('\x20(paused)'):'';console['log'](_0x131ef9+'\x20'+_0x3fc16f[_0x53283f(0x296)]+_0x3a3339);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x2cb);[a31_0x33df17(0x2fa)]='Resume\x20activations\x20in\x20an\x20RT\x20journey';async['execute'](_0x534f83){const _0x3d5099=a31_0x33df17,{options:_0x4ce517,args:_0x133355,tdx:_0x5503b7}=_0x534f83,_0x28e939=_0x133355[0x0];if(!_0x28e939)return console[_0x3d5099(0x2ef)](a31_0x437b86[_0x3d5099(0x1bb)](_0x3d5099(0x2f3))),console[_0x3d5099(0x2ef)](_0x3d5099(0x1af)),console[_0x3d5099(0x2ef)](a31_0x437b86[_0x3d5099(0x358)](_0x3d5099(0x30b))),0x1;_0x4ce517[_0x3d5099(0x1a0)]&&(console[_0x3d5099(0x2ef)](_0x3d5099(0x368)+_0x4ce517[_0x3d5099(0x24d)]),console['error'](_0x3d5099(0x389)+_0x28e939));const _0x5a6e13=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x28e939+_0x3d5099(0x335),()=>_0x5503b7[_0x3d5099(0x3bb)][_0x3d5099(0x38b)](_0x28e939),{'verbose':_0x4ce517[_0x3d5099(0x1a0)]}),_0x15a4e5=_0x5a6e13[_0x3d5099(0x1a1)];console[_0x3d5099(0x2ef)]('✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x15a4e5[_0x3d5099(0x296)]+'\x27');if(_0x4ce517['format']===_0x3d5099(0x2c3)||_0x4ce517['format']===_0x3d5099(0x33b))await handleSDKOutput([_0x15a4e5],_0x4ce517);else{const _0x2d868f=_0x15a4e5['state']===_0x3d5099(0x1aa)?'🚀':'📝',_0x5cf87e=_0x15a4e5[_0x3d5099(0x29a)]?a31_0x437b86[_0x3d5099(0x2e5)](_0x3d5099(0x1cf)):'';console[_0x3d5099(0x2c2)](_0x2d868f+'\x20'+_0x15a4e5[_0x3d5099(0x296)]+_0x5cf87e);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']=a31_0x33df17(0x31d);[a31_0x33df17(0x2fa)]='Get\x20current\x20RT\x20configuration\x20version\x20status';async[a31_0x33df17(0x29e)](_0x521388){const _0x4a2426=a31_0x33df17,{options:_0x1bc728,args:_0x16c47c,tdx:_0xf556c3}=_0x521388,_0x4130b7=_0x16c47c[0x0]||_0x1bc728['parentSegment'];if(!_0x4130b7)return showParentSegmentNotSetError(_0x4a2426(0x3a0)+'\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'),0x1;_0x1bc728[_0x4a2426(0x1a0)]&&(console['error'](_0x4a2426(0x368)+_0x1bc728[_0x4a2426(0x24d)]),console[_0x4a2426(0x2ef)](_0x4a2426(0x29f)+_0x4130b7));const _0xf407b=await withSpinner(_0x4a2426(0x221)+_0x4130b7+_0x4a2426(0x335),()=>_0xf556c3[_0x4a2426(0x207)]['resolveParentId'](_0x4130b7),{'verbose':_0x1bc728[_0x4a2426(0x1a0)]}),_0x3b78dc=_0xf407b[_0x4a2426(0x1a1)],_0x2f1c67=await withSpinner(_0x4a2426(0x271)+_0x4130b7+_0x4a2426(0x335),()=>_0xf556c3[_0x4a2426(0x3bb)]['getCurrentConfigVersion'](_0x3b78dc),{'verbose':_0x1bc728[_0x4a2426(0x1a0)]}),_0x1b8268=_0x2f1c67[_0x4a2426(0x1a1)];return console['error'](_0x4a2426(0x34c)),_0x1bc728['format']==='json'||_0x1bc728[_0x4a2426(0x1f3)]===_0x4a2426(0x33b)?await handleSDKOutput([_0x1b8268],_0x1bc728):(console[_0x4a2426(0x2c2)](_0x4a2426(0x362)+_0x1b8268['id']),console['log'](_0x4a2426(0x32f)+_0x1b8268['audienceId']),console[_0x4a2426(0x2c2)](_0x4a2426(0x375)+_0x1b8268[_0x4a2426(0x24e)]),console['log']('eventKind:\x20'+_0x1b8268[_0x4a2426(0x1f4)]),console['log']('status:\x20'+_0x1b8268['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x291);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2e0);async[a31_0x33df17(0x29e)](_0x21625f){const _0x13d510=a31_0x33df17,{options:_0xc74688,args:_0x396547,tdx:_0x1696c3}=_0x21625f,_0x32098d=_0x396547[0x0]||_0xc74688['parentSegment'];if(!_0x32098d)return showParentSegmentNotSetError(_0x13d510(0x2f1)+_0x13d510(0x343)),0x1;const _0x40c525=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x32098d+_0x13d510(0x335),()=>_0x1696c3[_0x13d510(0x207)][_0x13d510(0x1fc)](_0x32098d),{'verbose':_0xc74688[_0x13d510(0x1a0)]}),_0x20df41=_0x40c525['data'],_0x5c50bc=await withSpinner(_0x13d510(0x1e5)+_0x32098d+_0x13d510(0x335),()=>_0x1696c3[_0x13d510(0x1d1)][_0x13d510(0x288)](_0x20df41),{'verbose':_0xc74688[_0x13d510(0x1a0)]}),_0x4eb260=_0x5c50bc[_0x13d510(0x1a1)];console[_0x13d510(0x2ef)](_0x13d510(0x396)+_0x4eb260[_0x13d510(0x2e9)]+_0x13d510(0x20a)+(_0x4eb260[_0x13d510(0x2e9)]!==0x1?'s':''));if(_0xc74688['format']==='json'||_0xc74688[_0x13d510(0x1f3)]==='jsonl')await handleSDKOutput(_0x4eb260,_0xc74688);else{if(_0x4eb260[_0x13d510(0x2e9)]===0x0)console[_0x13d510(0x2c2)](_0x13d510(0x20c)),console[_0x13d510(0x2ef)](a31_0x437b86[_0x13d510(0x269)](_0x13d510(0x34b)));else for(const _0x4526db of _0x4eb260){console[_0x13d510(0x2c2)](a31_0x437b86['bold'](_0x4526db[_0x13d510(0x296)])+'\x20'+a31_0x437b86[_0x13d510(0x358)](_0x13d510(0x29c)+_0x4526db['id']+')'));_0x4526db[_0x13d510(0x2fa)]&&console['log']('\x20\x20'+a31_0x437b86[_0x13d510(0x358)](_0x4526db[_0x13d510(0x2fa)]));if(_0x4526db[_0x13d510(0x2dc)]&&_0x4526db[_0x13d510(0x2dc)][_0x13d510(0x2e9)]>0x0)for(const _0x2acb8b of _0x4526db['tokens']){const _0xc2b0be=_0x2acb8b[_0x13d510(0x2a7)]?.[_0x13d510(0x2e9)]?_0x2acb8b['allowedIps'][_0x13d510(0x1d3)](',\x20'):_0x13d510(0x280);console[_0x13d510(0x2c2)]('\x20\x20'+a31_0x437b86[_0x13d510(0x269)](_0x13d510(0x230))+'\x20'+_0x2acb8b[_0x13d510(0x296)]+'\x20'+a31_0x437b86[_0x13d510(0x358)](_0x13d510(0x29c)+_0x2acb8b['id']+')')),console[_0x13d510(0x2c2)](_0x13d510(0x373)+a31_0x437b86[_0x13d510(0x358)](_0x13d510(0x1cb))+'\x20'+_0xc2b0be);}else console['log']('\x20\x20'+a31_0x437b86['dim']('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{['name']='ps:pz:service:create';[a31_0x33df17(0x2fa)]=a31_0x33df17(0x382);async[a31_0x33df17(0x29e)](_0x33b061){const _0xb940e=a31_0x33df17,{options:_0x2acfe0,args:_0x4009c1,tdx:_0x3d26b7}=_0x33b061,_0x444598=_0x2acfe0,_0x2510ac=_0x4009c1[0x0],_0x46583f=_0x4009c1[0x1]||_0x2acfe0[_0xb940e(0x2dd)];if(!_0x2510ac)return console[_0xb940e(0x2ef)](_0xb940e(0x36b)),console[_0xb940e(0x2ef)](_0xb940e(0x1ab)),console[_0xb940e(0x2ef)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x46583f)return showParentSegmentNotSetError(_0xb940e(0x219)+_0xb940e(0x2db)),0x1;const _0x52d032=await withSpinner(_0xb940e(0x221)+_0x46583f+_0xb940e(0x335),()=>_0x3d26b7[_0xb940e(0x207)][_0xb940e(0x1fc)](_0x46583f),{'verbose':_0x2acfe0[_0xb940e(0x1a0)]}),_0xa8c9db=_0x52d032[_0xb940e(0x1a1)],_0x40bc2d={'name':_0x2510ac,'description':_0x444598['description'],'public':_0x444598[_0xb940e(0x378)]},_0x3d06c6=await withSpinner(_0xb940e(0x35c)+_0x2510ac+'\x27...',()=>_0x3d26b7[_0xb940e(0x1d1)][_0xb940e(0x300)](_0xa8c9db,_0x40bc2d),{'verbose':_0x2acfe0[_0xb940e(0x1a0)]}),_0x422b2a=_0x3d06c6[_0xb940e(0x1a1)];return console[_0xb940e(0x2ef)](_0xb940e(0x246)+_0x422b2a[_0xb940e(0x296)]+_0xb940e(0x363)+_0x422b2a['id']),await handleSDKOutput([_0x422b2a],_0x2acfe0),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']=a31_0x33df17(0x391);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2d2);async[a31_0x33df17(0x29e)](_0x26d90c){const _0x253b05=a31_0x33df17,{options:_0x48256a,args:_0x4ece0c,tdx:_0x5a4ee0}=_0x26d90c,_0x4836a0=_0x4ece0c[0x0],_0x20d822=_0x4ece0c[0x1]||_0x48256a[_0x253b05(0x2dd)];if(!_0x4836a0)return console[_0x253b05(0x2ef)](_0x253b05(0x25a)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x253b05(0x2ef)](_0x253b05(0x349)),0x1;if(!_0x20d822)return showParentSegmentNotSetError(_0x253b05(0x2da)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x35742d=await withSpinner(_0x253b05(0x221)+_0x20d822+_0x253b05(0x335),()=>_0x5a4ee0['segment']['resolveParentId'](_0x20d822),{'verbose':_0x48256a['verbose']}),_0x50580d=_0x35742d['data'],_0x29f28a=await withSpinner(_0x253b05(0x258)+_0x4836a0+'\x27...',()=>_0x5a4ee0['personalization'][_0x253b05(0x33d)](_0x50580d,_0x4836a0),{'verbose':_0x48256a[_0x253b05(0x1a0)]}),_0xbfe574=_0x29f28a[_0x253b05(0x1a1)];if(_0x48256a[_0x253b05(0x2c3)]||_0x48256a[_0x253b05(0x33b)])await handleSDKOutput([_0xbfe574],_0x48256a);else{console['log'](a31_0x437b86[_0x253b05(0x31c)](_0xbfe574[_0x253b05(0x296)])+'\x20'+a31_0x437b86['dim'](_0x253b05(0x29c)+_0xbfe574['id']+')'));_0xbfe574[_0x253b05(0x2fa)]&&console[_0x253b05(0x2c2)]('\x20\x20'+a31_0x437b86[_0x253b05(0x358)](_0xbfe574[_0x253b05(0x2fa)]));console[_0x253b05(0x2c2)]('\x20\x20'+a31_0x437b86[_0x253b05(0x269)]('public:')+'\x20'+(_0xbfe574[_0x253b05(0x378)]?'yes':'no'));if(_0xbfe574['tokens']&&_0xbfe574[_0x253b05(0x2dc)][_0x253b05(0x2e9)]>0x0)for(const _0x1c6d8c of _0xbfe574['tokens']){const _0xa6a10d=_0x1c6d8c[_0x253b05(0x2a7)]?.['length']?_0x1c6d8c[_0x253b05(0x2a7)][_0x253b05(0x1d3)](',\x20'):_0x253b05(0x280);console[_0x253b05(0x2c2)]('\x20\x20'+a31_0x437b86[_0x253b05(0x269)]('token:')+'\x20'+_0x1c6d8c[_0x253b05(0x296)]+'\x20'+a31_0x437b86[_0x253b05(0x358)](_0x253b05(0x29c)+_0x1c6d8c['id']+')')),console[_0x253b05(0x2c2)](_0x253b05(0x373)+a31_0x437b86[_0x253b05(0x358)]('allowed\x20IPs:')+'\x20'+_0xa6a10d);}else console[_0x253b05(0x2c2)]('\x20\x20'+a31_0x437b86['dim']('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x38c);['description']='Delete\x20a\x20personalization\x20service';async[a31_0x33df17(0x29e)](_0x448dd2){const _0x36db96=a31_0x33df17,{options:_0x4c866a,args:_0x330668,tdx:_0x19ab39}=_0x448dd2,_0xaf2719=_0x330668[0x0],_0xe5b8e3=_0x330668[0x1]||_0x4c866a['parentSegment'];if(!_0xaf2719)return console[_0x36db96(0x2ef)](_0x36db96(0x25a)),console[_0x36db96(0x2ef)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x36db96(0x2ef)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0xe5b8e3)return showParentSegmentNotSetError(_0x36db96(0x39e)+_0x36db96(0x30f)),0x1;const _0x23c897=await withSpinner(_0x36db96(0x221)+_0xe5b8e3+_0x36db96(0x335),()=>_0x19ab39['segment'][_0x36db96(0x1fc)](_0xe5b8e3),{'verbose':_0x4c866a[_0x36db96(0x1a0)]}),_0x206217=_0x23c897[_0x36db96(0x1a1)];return await withSpinner(_0x36db96(0x344)+_0xaf2719+_0x36db96(0x335),()=>_0x19ab39['personalization'][_0x36db96(0x225)](_0x206217,_0xaf2719),{'verbose':_0x4c866a['verbose']}),console[_0x36db96(0x2ef)](_0x36db96(0x28c)+_0xaf2719+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x33df17(0x296)]='ps:pz:service:update';['description']=a31_0x33df17(0x37e);async[a31_0x33df17(0x29e)](_0x1adc5d){const _0x5e5550=a31_0x33df17,{options:_0x40dac2,args:_0x870470,tdx:_0x101143}=_0x1adc5d,_0x26352a=_0x40dac2,_0x2b1bfd=_0x870470[0x0],_0x388c45=_0x870470[0x1]||_0x40dac2[_0x5e5550(0x2dd)];if(!_0x2b1bfd)return console['error'](_0x5e5550(0x25a)),console['error'](_0x5e5550(0x2fb)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x26352a['name'])return console[_0x5e5550(0x2ef)](_0x5e5550(0x22a)),console[_0x5e5550(0x2ef)](_0x5e5550(0x2fb)),0x1;if(!_0x388c45)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+_0x5e5550(0x3b8)),0x1;const _0x29ef48=await withSpinner(_0x5e5550(0x221)+_0x388c45+'\x27...',()=>_0x101143['segment'][_0x5e5550(0x1fc)](_0x388c45),{'verbose':_0x40dac2[_0x5e5550(0x1a0)]}),_0x164763=_0x29ef48[_0x5e5550(0x1a1)],_0x41ed1a={'name':_0x26352a[_0x5e5550(0x296)]};_0x26352a['description']!==undefined&&(_0x41ed1a[_0x5e5550(0x2fa)]=_0x26352a['description']);const _0x5cbf3d=await withSpinner(_0x5e5550(0x1c0)+_0x2b1bfd+_0x5e5550(0x335),()=>_0x101143[_0x5e5550(0x1d1)]['patch'](_0x164763,_0x2b1bfd,_0x41ed1a),{'verbose':_0x40dac2[_0x5e5550(0x1a0)]}),_0x362e70=_0x5cbf3d[_0x5e5550(0x1a1)];return console['error']('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x362e70[_0x5e5550(0x296)]+'\x27'),await handleSDKOutput([_0x362e70],_0x40dac2),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x398);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2be);async[a31_0x33df17(0x29e)](_0x461e06){const _0x144aec=a31_0x33df17,{options:_0xcb3798,args:_0x9ad04e,tdx:_0x5a59d4}=_0x461e06,_0x4fcf4d=_0xcb3798,_0x558417=_0x9ad04e[0x0],_0x20ec3a=_0x9ad04e[0x1],_0x5c7d87=_0x9ad04e[0x2]||_0xcb3798[_0x144aec(0x2dd)];if(!_0x558417)return console[_0x144aec(0x2ef)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x144aec(0x2ef)](_0x144aec(0x256)),console[_0x144aec(0x2ef)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x20ec3a)return console[_0x144aec(0x2ef)](_0x144aec(0x25a)),console[_0x144aec(0x2ef)](_0x144aec(0x256)),console['error'](_0x144aec(0x32b)),0x1;if(!_0x5c7d87)return showParentSegmentNotSetError(_0x144aec(0x2b7)+_0x144aec(0x32b)),0x1;const _0x2692c7=await withSpinner(_0x144aec(0x221)+_0x5c7d87+_0x144aec(0x335),()=>_0x5a59d4[_0x144aec(0x207)][_0x144aec(0x1fc)](_0x5c7d87),{'verbose':_0xcb3798['verbose']}),_0x51081e=_0x2692c7[_0x144aec(0x1a1)],_0x113f92={'name':_0x558417};_0x4fcf4d[_0x144aec(0x2a7)]&&(_0x113f92[_0x144aec(0x2a7)]=_0x4fcf4d['allowedIps'][_0x144aec(0x1a2)](',')['map'](_0x2ac349=>_0x2ac349['trim']()));_0x4fcf4d[_0x144aec(0x2fa)]&&(_0x113f92[_0x144aec(0x2fa)]=_0x4fcf4d['description']);const _0x38faaa=await withSpinner(_0x144aec(0x323)+_0x558417+_0x144aec(0x293)+_0x20ec3a+_0x144aec(0x335),()=>_0x5a59d4[_0x144aec(0x1d1)][_0x144aec(0x28d)](_0x51081e,_0x20ec3a,_0x113f92),{'verbose':_0xcb3798[_0x144aec(0x1a0)]}),_0x1d4dae=_0x38faaa['data'];return console['error'](_0x144aec(0x3b9)+_0x1d4dae[_0x144aec(0x296)]+_0x144aec(0x363)+_0x1d4dae['id']),_0x1d4dae[_0x144aec(0x250)]&&(console['error'](a31_0x437b86[_0x144aec(0x2e5)](_0x144aec(0x23f))),console['error'](a31_0x437b86['cyan'](_0x1d4dae[_0x144aec(0x250)])),console[_0x144aec(0x2ef)]('')),await handleSDKOutput([_0x1d4dae],_0xcb3798),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x361);[a31_0x33df17(0x2fa)]='Delete\x20a\x20token\x20from\x20a\x20personalization\x20service';async[a31_0x33df17(0x29e)](_0x299351){const _0x43138b=a31_0x33df17,{options:_0x390bdd,args:_0xc79f5c,tdx:_0x5a8d9b}=_0x299351,_0x6f2706=_0xc79f5c[0x0],_0x9c69c2=_0xc79f5c[0x1]||_0x390bdd['parentSegment'];if(!_0x6f2706)return console[_0x43138b(0x2ef)](_0x43138b(0x217)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x9c69c2)return showParentSegmentNotSetError(_0x43138b(0x379)+_0x43138b(0x254)),0x1;const _0x592f74=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x9c69c2+'\x27...',()=>_0x5a8d9b['segment'][_0x43138b(0x1fc)](_0x9c69c2),{'verbose':_0x390bdd[_0x43138b(0x1a0)]}),_0x51a58e=_0x592f74[_0x43138b(0x1a1)],_0x4c3b16=await withSpinner(_0x43138b(0x202),()=>_0x5a8d9b[_0x43138b(0x1d1)][_0x43138b(0x288)](_0x51a58e),{'verbose':_0x390bdd[_0x43138b(0x1a0)]}),_0x4858ad=_0x4c3b16[_0x43138b(0x1a1)];let _0x507e0b;for(const _0x4b1fa4 of _0x4858ad){if(_0x4b1fa4[_0x43138b(0x2dc)]?.[_0x43138b(0x2f4)](_0x46fb2b=>_0x46fb2b['id']===_0x6f2706)){_0x507e0b=_0x4b1fa4['id'];break;}}if(!_0x507e0b)return console[_0x43138b(0x2ef)]('Error:\x20Token\x20\x27'+_0x6f2706+'\x27\x20not\x20found\x20in\x20any\x20personalization\x20service'),0x1;const _0x109006=await withSpinner(_0x43138b(0x282)+_0x6f2706+_0x43138b(0x335),()=>_0x5a8d9b['personalization'][_0x43138b(0x1c9)](_0x51a58e,_0x507e0b,_0x6f2706),{'verbose':_0x390bdd[_0x43138b(0x1a0)]}),_0x35a3c4=_0x109006['data'];return console[_0x43138b(0x2ef)]('✔\x20Deleted\x20token\x20\x27'+(_0x35a3c4[_0x43138b(0x296)]||_0x6f2706)+'\x27'),await handleSDKOutput([_0x35a3c4],_0x390bdd),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x28f);['description']=a31_0x33df17(0x2a6);async[a31_0x33df17(0x29e)](_0x3c4abd){const _0x4b65b1=a31_0x33df17,{options:_0x21eb57,args:_0x846acb,tdx:_0x560c51}=_0x3c4abd,_0x12b4fd=_0x846acb[0x0]||_0x21eb57['parentSegment'];if(!_0x12b4fd)return showParentSegmentNotSetError(_0x4b65b1(0x387)+_0x4b65b1(0x352)),0x1;const _0x3de383=await withSpinner(_0x4b65b1(0x221)+_0x12b4fd+'\x27...',()=>_0x560c51[_0x4b65b1(0x207)][_0x4b65b1(0x1fc)](_0x12b4fd),{'verbose':_0x21eb57[_0x4b65b1(0x1a0)]}),_0x59c6ff=_0x3de383['data'],_0x67691e=await withSpinner(_0x4b65b1(0x35b)+_0x12b4fd+_0x4b65b1(0x335),()=>_0x560c51[_0x4b65b1(0x1d1)]['listPersonalizations'](_0x59c6ff),{'verbose':_0x21eb57[_0x4b65b1(0x1a0)]}),_0x100b6c=_0x67691e[_0x4b65b1(0x1a1)];console[_0x4b65b1(0x2ef)](_0x4b65b1(0x396)+_0x100b6c[_0x4b65b1(0x2e9)]+_0x4b65b1(0x2c7)+(_0x100b6c[_0x4b65b1(0x2e9)]!==0x1?'s':''));if(_0x21eb57[_0x4b65b1(0x1f3)]==='json'||_0x21eb57[_0x4b65b1(0x1f3)]==='jsonl')await handleSDKOutput(_0x100b6c,_0x21eb57);else{if(_0x100b6c[_0x4b65b1(0x2e9)]===0x0)console[_0x4b65b1(0x2c2)](_0x4b65b1(0x23e));else for(const _0x58bfed of _0x100b6c){console[_0x4b65b1(0x2c2)](a31_0x437b86[_0x4b65b1(0x31c)](_0x58bfed[_0x4b65b1(0x296)])+'\x20'+a31_0x437b86[_0x4b65b1(0x358)](_0x4b65b1(0x29c)+_0x58bfed['id']+')'));_0x58bfed['description']&&console[_0x4b65b1(0x2c2)]('\x20\x20'+a31_0x437b86[_0x4b65b1(0x358)](_0x58bfed[_0x4b65b1(0x2fa)]));const _0x56a192=_0x58bfed[_0x4b65b1(0x2e7)]?.['length']||0x0;console[_0x4b65b1(0x2c2)]('\x20\x20'+a31_0x437b86[_0x4b65b1(0x269)](_0x4b65b1(0x366))+'\x20'+_0x56a192);if(_0x58bfed['sections']&&_0x58bfed[_0x4b65b1(0x2e7)][_0x4b65b1(0x2e9)]>0x0)for(const _0xf04e13 of _0x58bfed['sections']){console[_0x4b65b1(0x2c2)](_0x4b65b1(0x229)+_0xf04e13[_0x4b65b1(0x296)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x395);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x1c7);async[a31_0x33df17(0x29e)](_0x1d5ed9){const _0x27c361=a31_0x33df17,{options:_0x44ab1d,args:_0x30cc59,tdx:_0x67bda2}=_0x1d5ed9,_0x1152e3=_0x30cc59[0x0];if(!_0x1152e3)return console['error']('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x27c361(0x2ef)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x43df3b=await withSpinner('Getting\x20personalization\x20\x27'+_0x1152e3+'\x27...',()=>_0x67bda2[_0x27c361(0x1d1)][_0x27c361(0x3a6)](_0x1152e3),{'verbose':_0x44ab1d[_0x27c361(0x1a0)]}),_0x104943=_0x43df3b[_0x27c361(0x1a1)];console[_0x27c361(0x2ef)](_0x27c361(0x234)+_0x104943[_0x27c361(0x296)]+'\x27');if(_0x44ab1d[_0x27c361(0x1f3)]==='json'||_0x44ab1d[_0x27c361(0x1f3)]===_0x27c361(0x33b))await handleSDKOutput([_0x104943],_0x44ab1d);else{console['log'](a31_0x437b86['bold'](_0x104943[_0x27c361(0x296)])+'\x20'+a31_0x437b86[_0x27c361(0x358)](_0x27c361(0x29c)+_0x104943['id']+')'));_0x104943['description']&&console[_0x27c361(0x2c2)]('\x20\x20'+a31_0x437b86['dim'](_0x104943[_0x27c361(0x2fa)]));_0x104943[_0x27c361(0x2fd)]&&console[_0x27c361(0x2c2)]('\x20\x20'+a31_0x437b86[_0x27c361(0x269)](_0x27c361(0x3ba))+'\x20'+_0x104943[_0x27c361(0x2fd)]);console[_0x27c361(0x2c2)]('\x20\x20'+a31_0x437b86[_0x27c361(0x269)](_0x27c361(0x3a4))+'\x20'+_0x104943[_0x27c361(0x37c)]),console[_0x27c361(0x2c2)]('\x20\x20'+a31_0x437b86[_0x27c361(0x269)]('updated:')+'\x20'+_0x104943[_0x27c361(0x281)]);const _0x3dec31=_0x104943[_0x27c361(0x2e7)]?.[_0x27c361(0x2e9)]||0x0;console[_0x27c361(0x2c2)]('\x20\x20'+a31_0x437b86[_0x27c361(0x269)](_0x27c361(0x366))+'\x20'+_0x3dec31);if(_0x104943[_0x27c361(0x2e7)]&&_0x104943[_0x27c361(0x2e7)][_0x27c361(0x2e9)]>0x0)for(const _0x4f346a of _0x104943[_0x27c361(0x2e7)]){console['log'](_0x27c361(0x373)+a31_0x437b86[_0x27c361(0x31c)](_0x4f346a['name'])+'\x20'+a31_0x437b86[_0x27c361(0x358)](_0x27c361(0x29c)+_0x4f346a['id']+')')),_0x4f346a[_0x27c361(0x22f)]&&(console[_0x27c361(0x2c2)](_0x27c361(0x2ee)+a31_0x437b86[_0x27c361(0x269)](_0x27c361(0x34a))+'\x20'+_0x4f346a[_0x27c361(0x22f)][_0x27c361(0x296)]),_0x4f346a['entryCriteria']['keyEventCriteria']?.['keyEventId']&&console['log'](_0x27c361(0x20b)+a31_0x437b86['cyan'](_0x27c361(0x1b8))+'\x20'+_0x4f346a[_0x27c361(0x22f)][_0x27c361(0x1b5)]['keyEventId'])),_0x4f346a['payload']&&console[_0x27c361(0x2c2)]('\x20\x20\x20\x20\x20\x20'+a31_0x437b86['cyan'](_0x27c361(0x399))+'\x20'+JSON[_0x27c361(0x2a2)](_0x4f346a[_0x27c361(0x257)])),_0x4f346a[_0x27c361(0x26a)]&&console[_0x27c361(0x2c2)](_0x27c361(0x2ee)+a31_0x437b86[_0x27c361(0x269)](_0x27c361(0x36f))+_0x27c361(0x372));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x2b8);['description']=a31_0x33df17(0x273);async[a31_0x33df17(0x29e)](_0x43ba2f){const _0x5b1dad=a31_0x33df17,{options:_0x13f071,args:_0xb4140,tdx:_0x57ce96}=_0x43ba2f,_0x1368be=_0xb4140[0x0];if(!_0x1368be)return console[_0x5b1dad(0x2ef)](_0x5b1dad(0x1fe)),console[_0x5b1dad(0x2ef)](_0x5b1dad(0x1d9)),0x1;return await withSpinner(_0x5b1dad(0x1de)+_0x1368be+_0x5b1dad(0x335),()=>_0x57ce96[_0x5b1dad(0x1d1)]['deletePersonalization'](_0x1368be),{'verbose':_0x13f071[_0x5b1dad(0x1a0)]}),console[_0x5b1dad(0x2ef)]('✔\x20Deleted\x20personalization\x20\x27'+_0x1368be+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x311);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x26b);async['execute'](_0x118c59){const _0x2a915f=a31_0x33df17,{options:_0x3095e4,tdx:_0x1c7ed1}=_0x118c59,_0x3ef6ce=_0x3095e4;let _0x241ace;if(_0x3ef6ce['file']){_0x241ace=await loadJSON(_0x3ef6ce[_0x2a915f(0x2e3)],!![]);if(!_0x241ace[_0x2a915f(0x342)]?.['parentFolder'])return console[_0x2a915f(0x2ef)](_0x2a915f(0x1ef)),console[_0x2a915f(0x2ef)](_0x2a915f(0x2ea)),console[_0x2a915f(0x2ef)](_0x2a915f(0x1fb)),0x1;}else{if(!_0x3ef6ce[_0x2a915f(0x296)])return console[_0x2a915f(0x2ef)](_0x2a915f(0x2b9)),console[_0x2a915f(0x2ef)](_0x2a915f(0x23d)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x3ef6ce['description']===undefined)return console[_0x2a915f(0x2ef)](_0x2a915f(0x22c)),console[_0x2a915f(0x2ef)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x2a915f(0x2ef)](_0x2a915f(0x213)),0x1;if(_0x3ef6ce['folderId']===undefined)return console[_0x2a915f(0x2ef)](_0x2a915f(0x386)),console[_0x2a915f(0x2ef)](_0x2a915f(0x385)),0x1;let _0x5909db=_0x3ef6ce[_0x2a915f(0x2fd)];if(!_0x5909db&&_0x3095e4[_0x2a915f(0x2dd)]){const _0x11cab0=await withSpinner(_0x2a915f(0x221)+_0x3095e4[_0x2a915f(0x2dd)]+'\x27...',()=>_0x1c7ed1[_0x2a915f(0x207)][_0x2a915f(0x1fc)](_0x3095e4[_0x2a915f(0x2dd)]),{'verbose':_0x3095e4['verbose']});_0x5909db=_0x11cab0[_0x2a915f(0x1a1)];}let _0x5032f5;_0x3ef6ce[_0x2a915f(0x2e7)]&&(_0x5032f5=await loadJSON(_0x3ef6ce['sections'],![]));const _0x77d98a=_0x3ef6ce[_0x2a915f(0x259)]===_0x2a915f(0x1b4)?null:{'id':_0x3ef6ce[_0x2a915f(0x259)],'type':_0x2a915f(0x381)};_0x241ace={'attributes':{'name':_0x3ef6ce[_0x2a915f(0x296)],'description':_0x3ef6ce[_0x2a915f(0x2fa)]||null,..._0x5909db!==undefined&&{'audienceId':_0x5909db},..._0x5032f5!==undefined&&{'sections':_0x5032f5}},'relationships':{'parentFolder':{'data':_0x77d98a}}};}const _0x5502df=await withSpinner(_0x2a915f(0x1be)+(_0x241ace['attributes']?.['name']??'')+_0x2a915f(0x335),()=>_0x1c7ed1[_0x2a915f(0x1d1)]['createPersonalization'](_0x241ace),{'verbose':_0x3095e4[_0x2a915f(0x1a0)]}),_0xd9d0cf=_0x5502df[_0x2a915f(0x1a1)];return console[_0x2a915f(0x2ef)](_0x2a915f(0x3a3)+_0xd9d0cf['name']+_0x2a915f(0x363)+_0xd9d0cf['id']),await handleSDKOutput([_0xd9d0cf],_0x3095e4),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x33df17(0x296)]=a31_0x33df17(0x2f2);['description']=a31_0x33df17(0x200);async[a31_0x33df17(0x29e)](_0x522e9b){const _0xc339e2=a31_0x33df17,{options:_0x495120,args:_0x26bc9a}=_0x522e9b,_0x34b4be=_0x495120,_0x253bcd=_0x26bc9a[0x0];if(!_0x253bcd)return console[_0xc339e2(0x2ef)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0xc339e2(0x2ef)](_0xc339e2(0x350)),console[_0xc339e2(0x2ef)](_0xc339e2(0x1fd)),0x1;let _0x2833e7;if(_0x34b4be[_0xc339e2(0x2e3)])_0x2833e7=await loadJSON(_0x34b4be[_0xc339e2(0x2e3)],!![]);else{if(!_0x34b4be[_0xc339e2(0x296)])return console[_0xc339e2(0x2ef)](_0xc339e2(0x2b9)),console[_0xc339e2(0x2ef)](_0xc339e2(0x350)),0x1;if(_0x34b4be[_0xc339e2(0x2fa)]===undefined)return console[_0xc339e2(0x2ef)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0xc339e2(0x2ef)](_0xc339e2(0x350)),0x1;let _0x4500b1;_0x34b4be['sections']&&(_0x4500b1=await loadJSON(_0x34b4be[_0xc339e2(0x2e7)],![])),_0x2833e7={'attributes':{'name':_0x34b4be[_0xc339e2(0x296)],'description':_0x34b4be[_0xc339e2(0x2fa)]||null,..._0x4500b1!==undefined&&{'sections':_0x4500b1}}};}const {tdx:_0x5c114e}=_0x522e9b,_0x5db79c=await withSpinner(_0xc339e2(0x31f)+_0x253bcd+'\x27...',()=>_0x5c114e[_0xc339e2(0x1d1)][_0xc339e2(0x248)](_0x253bcd,_0x2833e7),{'verbose':_0x495120['verbose']}),_0x531c21=_0x5db79c[_0xc339e2(0x1a1)];return console[_0xc339e2(0x2ef)]('✔\x20Updated\x20personalization\x20\x27'+_0x531c21[_0xc339e2(0x296)]+'\x27\x20(id:\x20'+_0x531c21['id']+')'),await handleSDKOutput([_0x531c21],_0x495120),0x0;}}function a31_0x26a5(_0x617322,_0x36147f){_0x617322=_0x617322-0x1a0;const _0x92691c=a31_0x9269();let _0x26a506=_0x92691c[_0x617322];return _0x26a506;}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a31_0x33df17(0x29b);[a31_0x33df17(0x2fa)]=a31_0x33df17(0x2bd);async[a31_0x33df17(0x29e)](_0x11e9dc){const _0x3eedc0=a31_0x33df17,{options:_0x42e444,args:_0x4dd821}=_0x11e9dc,_0x20ba74=_0x4dd821[0x0]||_0x42e444[_0x3eedc0(0x2dd)];if(!_0x20ba74)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a'+_0x3eedc0(0x244)),0x1;const _0x24f69a=resolveYamlFile(_0x20ba74);if(!existsSync(_0x24f69a))return showFileNotFoundError(_0x24f69a,_0x20ba74),0x1;let _0x39e058;try{_0x39e058=readFileSync(_0x24f69a,'utf-8');}catch(_0x3390fa){const _0x265489=_0x3390fa instanceof Error?_0x3390fa[_0x3eedc0(0x367)]:String(_0x3390fa);return console[_0x3eedc0(0x2ef)](_0x3eedc0(0x30e)+_0x265489),0x1;}let _0x471500;try{_0x471500=parseDef(_0x39e058);}catch(_0x4ed314){const _0x2c02f0=_0x4ed314 instanceof Error?_0x4ed314[_0x3eedc0(0x367)]:String(_0x4ed314);return console['error'](a31_0x437b86[_0x3eedc0(0x1bb)](_0x3eedc0(0x24c)+_0x2c02f0)),0x1;}if(_0x471500[_0x3eedc0(0x365)]&&_0x471500[_0x3eedc0(0x365)][_0x3eedc0(0x2e9)]>0x0)return console[_0x3eedc0(0x2ef)](a31_0x437b86[_0x3eedc0(0x2e5)](_0x3eedc0(0x36d)+_0x24f69a)),console['error'](a31_0x437b86[_0x3eedc0(0x358)]('\x20\x20\x20'+_0x471500[_0x3eedc0(0x365)][_0x3eedc0(0x2e9)]+_0x3eedc0(0x1c6))),0x1;!_0x471500['realtime']&&(_0x471500[_0x3eedc0(0x3bb)]={'events':[{'name':'page_view','source_table':_0x3eedc0(0x2c9)}],'attributes':[{'name':_0x3eedc0(0x241),'type':_0x3eedc0(0x3bf)}],'id_stitching':{'primary_key':_0x471500[_0x3eedc0(0x211)][_0x3eedc0(0x30d)]==='customers'?'td_client_id':'user_id'}});_0x471500[_0x3eedc0(0x365)]=[{'name':_0x3eedc0(0x289),'description':_0x3eedc0(0x22b),'trigger_event':_0x3eedc0(0x1a9),'sections':[{'name':_0x3eedc0(0x380),'criteria':_0x3eedc0(0x36a),'attributes':[_0x3eedc0(0x241)]}]}];const _0x10255e=serializeDef(_0x471500);return writeFileSync(_0x24f69a,_0x10255e,_0x3eedc0(0x2e6)),console[_0x3eedc0(0x2ef)](a31_0x437b86[_0x3eedc0(0x292)]('✔')+_0x3eedc0(0x21e)+a31_0x437b86['cyan'](_0x24f69a)),(!_0x471500[_0x3eedc0(0x3bb)]||_0x39e058['indexOf'](_0x3eedc0(0x1f6))===-0x1)&&console[_0x3eedc0(0x2ef)](a31_0x437b86[_0x3eedc0(0x292)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x3eedc0(0x2ef)]('\x0a'+a31_0x437b86['dim']('Next\x20steps:')),console[_0x3eedc0(0x2ef)](_0x3eedc0(0x2a5)+_0x24f69a+_0x3eedc0(0x3b7)),console[_0x3eedc0(0x2ef)]('\x20\x202.\x20Run\x20'+a31_0x437b86[_0x3eedc0(0x358)](_0x3eedc0(0x1db)+_0x20ba74)+_0x3eedc0(0x1bf)),0x0;}}
1
+ const a31_0x18a3da=a31_0x3c2e;(function(_0x54ffac,_0x3ac046){const _0x347b36=a31_0x3c2e,_0x5da757=_0x54ffac();while(!![]){try{const _0x108499=-parseInt(_0x347b36(0x322))/0x1*(-parseInt(_0x347b36(0x1ab))/0x2)+-parseInt(_0x347b36(0x35b))/0x3+parseInt(_0x347b36(0x212))/0x4+parseInt(_0x347b36(0x2e7))/0x5+-parseInt(_0x347b36(0x31b))/0x6+-parseInt(_0x347b36(0x258))/0x7+parseInt(_0x347b36(0x25e))/0x8;if(_0x108499===_0x3ac046)break;else _0x5da757['push'](_0x5da757['shift']());}catch(_0xea89fe){_0x5da757['push'](_0x5da757['shift']());}}}(a31_0x5c03,0x8b4d0));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x1dd735 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_0x341876 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x18a3da(0x2e6),LEGACY_PARENT_SEGMENT_DIR=a31_0x18a3da(0x25a);function openBrowser(_0x460ac2){const _0x1646c4=a31_0x18a3da,_0x40e3f2=process['platform'],_0x24eaea=_0x40e3f2==='darwin'?_0x1646c4(0x287):_0x40e3f2===_0x1646c4(0x255)?_0x1646c4(0x33b):_0x1646c4(0x1df);spawn(_0x24eaea,[_0x460ac2],{'detached':!![],'stdio':_0x1646c4(0x208)})[_0x1646c4(0x227)]();}function migrateLegacyDirectory(){const _0x4e0408=a31_0x18a3da;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x483967=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x483967[_0x4e0408(0x3ba)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a31_0x341876[_0x4e0408(0x1ec)](_0x4e0408(0x352)+LEGACY_PARENT_SEGMENT_DIR+_0x4e0408(0x2a9)+PARENT_SEGMENT_DIR+_0x4e0408(0x386))),console['error'](a31_0x341876[_0x4e0408(0x284)](_0x4e0408(0x2ff)+LEGACY_PARENT_SEGMENT_DIR+_0x4e0408(0x393))),![];console[_0x4e0408(0x263)](a31_0x341876[_0x4e0408(0x1ec)](_0x4e0408(0x274)+LEGACY_PARENT_SEGMENT_DIR+_0x4e0408(0x1e8)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x4e0408(0x263)](a31_0x341876[_0x4e0408(0x297)](_0x4e0408(0x358)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4b5177){const _0x1679a8=_0x4b5177 instanceof Error?_0x4b5177[_0x4e0408(0x39d)]:String(_0x4b5177);return console[_0x4e0408(0x263)](a31_0x341876[_0x4e0408(0x29a)](_0x4e0408(0x318)+_0x1679a8+'\x0a')),![];}}function a31_0x5c03(){const _0x4c779f=['parentSegment','\x22,\x20\x22type\x22:\x20\x22','list','column','push','behavior','single','segment:parent:desc','\x20RT\x20configuration\x20is\x20valid','includeSensitive','Name:\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','/\x20and\x20','customerGroup','personalization','ps:pz:init','data','\x0aNo\x20sample\x20data\x20available','✔\x20Created\x20parent\x20segment\x20\x27','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','/{name}.yml\x0a','audienceId:','segment:parent:preview','valid','\x20\x202.\x20Run\x20','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','segment:parent:update','keys','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','true','segment','\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','Events:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','file','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','ps:pz:service:update','displayPreviewResults','\x0aChanges\x20to\x20\x27','events','create','/app/dw/parentSegments/','toLocaleString','Updating\x20parent\x20segment\x20\x27','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','createToken','segment:parent:view','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','Creating','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','✔\x20Deleted\x20token\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20rows)','realtime:','RT\x202.0:','segment:parent:fields','setJobId','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20service','Output\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','description','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','listParents','\x5c$&','\x20RT\x20journey','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','stats','parent_segments','2245065ZJSsEV','eventKind:\x20','\x20--attribute\x20\x22<name>\x22','\x20--enriched','Rows:','split','sourceTableValid','patchPersonalization','Fetching\x20SQL\x20for\x20\x27','Error:\x20Token\x20\x27','some','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','filter','Database:\x20','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','all','string','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','segment:parent:create','getOutputDatabaseName','join','page_view','To\x20cancel:','Default','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Resolving\x20parent\x20segment\x20\x27','attributesFile','displayAttributesStats','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','json','✔\x20Found\x20','Preview:','\x0a\x20\x20]\x0a}\x0a','Patching\x20personalization\x20\x27','\x20--interval\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','scheduleOption','Attributes','\x20\x20Tables:\x201\x20customers\x20+\x20','SELECT\x20*\x20FROM\x20','errors','Behaviors','\x20(paused)','No\x20parent\x20segments\x20found','ps:pz:create','enabled','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','attributes','✘\x20Failed\x20to\x20rename\x20directory:\x20','createPersonalization','To\x20view\x20sample\x20data:','4907166aeyHvb','/app/workflows/','\x20service(s)\x20configured','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Analyzing\x20changes...','updated:','\x20configured','2hsupbG','Schema\x20saved\x20to\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','entryCriteria','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','customerGroupFile','\x20\x20\x20','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','using\x20the\x20default\x20path:\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','\x20\x201.\x20Edit\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','validateParentYaml','Pause\x20activations\x20in\x20an\x20RT\x20journey','tdx\x20ps\x20push\x20','tdx\x20ps\x20preview\x20','Updating\x20personalization\x20service\x20\x27','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','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)','stringify','start','getBehaviorNames','\x20Opening\x20','\x27\x20and\x20run\x20workflow?','audienceId:\x20','timezone','Source:','database','folderId','addBehaviorsFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','idStitching','Customers:','.customers)','\x20\x20Note:\x20','label','columns','Getting\x20personalization\x20\x27','\x27...','launched','ps:pz:service:show','execute','\x0a⚠️\x20\x20Both\x20','.yml','created:','Personalization\x20service\x20description','List\x20available\x20fields\x20for\x20segmentation','master','✔\x20Renamed\x20directory\x20to\x20','\x20true','\x20No\x20changes\x20-\x20','1599483KybuXA','id:\x20','Fetching\x20customers\x20schema...','addBehaviors','use','Aborted.','Error:\x20Personalization\x20ID\x20is\x20required','endsWith','keyEventId','keyEventId:','{\x0a\x20\x20\x22database\x22:\x20\x22','\x20--behavior\x20\x22','\x20\x20\x20\x20\x20\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','Listing\x20RT\x20journeys\x20for\x20\x27','Updating','ps:rt:jn:resume','utf-8','displayRealtimeInfo','tokens','log','yes','collectSchema','\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','token:','YAML\x20file:\x20','ps:pz:delete','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','No\x20RT\x20journeys\x20found','run','segment:parent:list','resumeJourney','List\x20RT\x20journeys','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','length','\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','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','Options:\x0a','FINISHED','\x20\x20\x20\x20','allValid','Pattern:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','/\x20directories\x20exist.','no\x20tokens\x20configured','foreignKey','pullParentYaml','Audience\x20ID:','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','sections:','listPersonalizations','\x20behaviors','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Validating\x20RT\x20configuration...','Delete\x20a\x20realtime\x20personalization','/\x20directory.\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','jsonl','Fetching\x20current\x20configuration\x20for\x20\x27','Updated','Creating\x20personalization\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','👥\x20','.yaml','processedRows','message','displayValidateResults','identifier','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','getParentSQL','totalEvents','bold','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Output\x20Database:','Error:\x20Service\x20ID\x20is\x20required','Listing\x20parent\x20segments\x20matching\x20\x27','workflowSessionId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','indexOf','folder-segment','ps:pz:list','Found\x20YAML\x20file:\x20','\x20kill','Attempt:','behaviors','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','formatSchemaJson','displaySummary','apply','resolveParentId','text','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','null','public','isDirectory','Parent\x20segment:\x20','behavior_','Executing\x20parent\x20segment\x20query...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20Configuration\x20is\x20valid','<database>.<table>','✔\x20Found\x20personalization\x20\x27','limit','Creating\x20personalization\x20service\x20\x27','delete','796534IBjFam','Master:','dirname','number','Fetching\x20parent\x20segment\x20\x27','displayMasterInfo','displayColumns','SQL\x20query:\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','repeat','verbose','RT\x20Journey\x20ID:\x20','status:\x20','includeSensitive:','Fetching\x20personalization\x20service\x20\x27','Error:\x20--behavior\x20requires\x20a\x20name\x0a','any','\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','name','✔\x20Updated\x20personalization\x20service\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','format','\x27\x20for\x20service\x20\x27','\x20to\x20configure\x20your\x20personalization\x20service','\x20parent\x20segment\x20\x27','ps:pz:show','Apply\x20changes\x20to\x20\x27','\x20parent\x20segment','\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','pauseJourney','Get\x20current\x20RT\x20configuration\x20version\x20status','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','enriched','Fetching\x20behavior\x20list...','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','Available\x20attributes:','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','No\x20personalization\x20services\x20configured','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','paused','last_page_viewed','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','(id:\x20','pushParentYaml','ps:rt:validate','allowedIps','Error:\x20Token\x20ID\x20is\x20required','Deleting\x20personalization\x20\x27','value','createdAt','updateParent','customerPercent','xdg-open','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x0a✔\x20Workflow\x20started','✔\x20Updated\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Fetching\x20sample\x20data...','column_name','scheduleType','/\x20→\x20','\x20Context\x20set:\x20','ps:pz:patch','\x20Added\x20RT\x202.0\x20template\x20section','yellow','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Validating\x20configuration...','state','\x20tdx\x20wf\x20attempt\x20','No\x20RT-enabled\x20parent\x20segments\x20found','toFixed','Attributes:','personalization_services','\x20\x20\x20\x20-\x20','Site:\x20','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','ps:pz:service:create','segment:parent:show','schemaValid','joinKey','parent_id','listFields','\x0aNew\x20parent\x20segment\x20\x27','✔\x20Created\x20personalization\x20service\x20\x27','Error:\x20Token\x20name\x20is\x20required','ps:pz:service:token:delete','displayPreviewHints','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Show\x20personalization\x20service\x20details','Personalization:','ignore','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','customers','site','Join:','payload','previewParentYaml','Creating\x20parent\x20segment\x20\x27','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','matchedCount','2529900nbWbVz','sections','Session:','List\x20parent\x20segments','✔\x20Updated\x20personalization\x20\x27','Creating\x20token\x20\x27','stop','Validate:','No\x20personalizations\x20configured','primaryKey','\x0aError:','⚡\x20Not\x20enabled','coveragePercent','\x20rows\x20','jobId','patch','\x20total','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','elapsedTimeMillis','displayBehaviorsStats','Error\x20reading\x20file:\x20','unref','table','preview','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','trim','updatedAt','Delete\x20a\x20personalization\x20service','segment:parent:push','payload:','Errors:','Finding\x20service\x20for\x20token...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Overwrite\x20\x27','✔\x20Created\x20token\x20\x27','\x27\x20is\x20already\x20up\x20to\x20date','Options\x20(one\x20required):\x0a','double','\x20=\x20','interval','\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','output','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','ps:rt:list','behaviorsFile','%)\x20','\x20personalization\x20service','keyEventCriteria','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','✔\x20Retrieved\x20RT\x20configuration\x20version','map','workflowAttemptId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','varchar','Create\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','\x27\x20with\x20ID:\x20','Listing\x20fields\x20for\x20\x27','population','Error:','rowCount','getParentFull','public:','\x20\x20\x20\x20\x20\x20\x20\x20','allowed\x20IPs:','\x20is\x20already\x20up\x20to\x20date','personalizationServices','win32','\x27\x20(id:\x20','customersWithEvents','5641496tHHDDV','Resume\x20activations\x20in\x20an\x20RT\x20journey','parent_segment','\x0aChanges\x20to\x20apply\x20to\x20\x27','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','attribute','6796032GaNNKa','user_id','\x20--behavior\x20\x22<name>\x22','segment:parent:run','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','error','Master\x20Table','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','workflowId','\x20\x20Database:\x20','test','realtime_enabled','-1d','status','Next\x20steps:','Deleting\x20token\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','sampleData','✔\x20Deleted\x20personalization\x20service\x20\x27','Error:\x20--database\x20and\x20--table\x20are\x20required','stageCount','\x0a⚠️\x20\x20Migrating:\x20','Columns:','parentFolder','Created','type','sort','audienceId','⚡\x20Enabled','relationships','replace','sourceTableError','realtime','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Create\x20a\x20realtime\x20personalization\x20entity','displaySampleData','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','identifier:\x20','open','get','Master\x20+\x20Attributes','schemaError','ps:rt:configuration_versions','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','✔\x20Created\x20personalization\x20\x27','td_client_id','web','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x0a\x20\x20\x20\x20]','Error:\x20Parent\x20segment\x20name\x20is\x20required','cyan','localeCompare','ID\x20Stitching:','\x20personalization','green','ps:rt:jn:pause','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','red','\x0a\x20\x20\x20\x20}','\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}'];a31_0x5c03=function(){return _0x4c779f;};return a31_0x5c03();}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x18a3da(0x378)](_0x4bd8b5){const _0x246cd9=a31_0x18a3da;return migrateLegacyDirectory(),super[_0x246cd9(0x378)](_0x4bd8b5);}}function resolveYamlFile(_0x34a40c){const _0x37a85f=a31_0x18a3da;if(_0x34a40c['endsWith'](_0x37a85f(0x353))||_0x34a40c[_0x37a85f(0x362)](_0x37a85f(0x39b)))return _0x34a40c;return a31_0x1dd735[_0x37a85f(0x2fb)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x34a40c)+'.yml');}function formatProgressMessage(_0x59475a){const _0x29f3f0=a31_0x18a3da,_0x4ec507=_0x59475a['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x4ec507){const [,_0x3a5337,_0x4f782d,_0x24e7aa='']=_0x4ec507;return a31_0x341876[_0x29f3f0(0x284)](_0x3a5337+':')+'\x20'+_0x4f782d+a31_0x341876[_0x29f3f0(0x284)](_0x24e7aa);}return a31_0x341876[_0x29f3f0(0x284)](_0x59475a);}function showFileNotFoundError(_0x4044f8,_0x16381b){const _0x416681=a31_0x18a3da;console[_0x416681(0x263)](a31_0x341876[_0x416681(0x29a)]('Error:\x20File\x20not\x20found:\x20'+_0x4044f8+'\x0a')),console[_0x416681(0x263)](a31_0x341876[_0x416681(0x293)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x16381b+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x73c152){const _0x35f7f1=a31_0x18a3da;if(!_0x73c152[_0x35f7f1(0x27f)])return;const _0x5e737e=_0x73c152[_0x35f7f1(0x27f)],_0x4521d6=_0x5e737e[_0x35f7f1(0x315)]?a31_0x341876[_0x35f7f1(0x297)](_0x35f7f1(0x27b)):a31_0x341876[_0x35f7f1(0x1ec)](_0x35f7f1(0x21d));console[_0x35f7f1(0x263)]('\x0a'+a31_0x341876[_0x35f7f1(0x284)](_0x35f7f1(0x2d6))+'\x20'+_0x4521d6);if(_0x5e737e[_0x35f7f1(0x2c7)]&&_0x5e737e[_0x35f7f1(0x2c7)][_0x35f7f1(0x37d)]>0x0){console[_0x35f7f1(0x263)]('\x20\x20'+a31_0x341876[_0x35f7f1(0x284)](_0x35f7f1(0x2be))+'\x20'+_0x5e737e['events'][_0x35f7f1(0x37d)]+'\x20configured');for(const _0x1c96d4 of _0x5e737e[_0x35f7f1(0x2c7)]){const _0x3d151b=_0x1c96d4[_0x35f7f1(0x2ed)]===![]?a31_0x341876[_0x35f7f1(0x29a)]('✘'):a31_0x341876[_0x35f7f1(0x297)]('✔');console[_0x35f7f1(0x263)](_0x35f7f1(0x382)+_0x3d151b+'\x20'+_0x1c96d4[_0x35f7f1(0x1bd)]),_0x1c96d4[_0x35f7f1(0x27e)]&&console[_0x35f7f1(0x263)](_0x35f7f1(0x367)+a31_0x341876[_0x35f7f1(0x29a)](_0x1c96d4[_0x35f7f1(0x27e)]));}}if(_0x5e737e['attributes']&&_0x5e737e[_0x35f7f1(0x317)]['length']>0x0){console[_0x35f7f1(0x263)]('\x20\x20'+a31_0x341876[_0x35f7f1(0x284)](_0x35f7f1(0x1f3))+'\x20'+_0x5e737e[_0x35f7f1(0x317)][_0x35f7f1(0x37d)]+_0x35f7f1(0x321));for(const _0xed12a8 of _0x5e737e['attributes']){const _0x511558=_0xed12a8[_0x35f7f1(0x2b4)]?a31_0x341876[_0x35f7f1(0x297)]('✔'):a31_0x341876[_0x35f7f1(0x29a)]('✘');console[_0x35f7f1(0x263)](_0x35f7f1(0x382)+_0x511558+'\x20'+_0xed12a8[_0x35f7f1(0x1bd)]+'\x20'+a31_0x341876[_0x35f7f1(0x284)]('('+_0xed12a8['type']+')'));}}if(_0x5e737e[_0x35f7f1(0x347)]){const _0x199648=_0x5e737e[_0x35f7f1(0x347)]['stitchingKeys']?.[_0x35f7f1(0x37d)]?'\x20+\x20['+_0x5e737e[_0x35f7f1(0x347)]['stitchingKeys'][_0x35f7f1(0x2fb)](',\x20')+']':'';console[_0x35f7f1(0x263)]('\x20\x20'+a31_0x341876[_0x35f7f1(0x284)](_0x35f7f1(0x295))+'\x20'+_0x5e737e['idStitching'][_0x35f7f1(0x21b)]+_0x199648);}if(_0x5e737e[_0x35f7f1(0x254)]&&_0x5e737e[_0x35f7f1(0x254)][_0x35f7f1(0x37d)]>0x0){console['error']('\x20\x20'+a31_0x341876[_0x35f7f1(0x284)](_0x35f7f1(0x207))+'\x20'+_0x5e737e['personalizationServices'][_0x35f7f1(0x37d)]+_0x35f7f1(0x2da)+(_0x5e737e[_0x35f7f1(0x254)][_0x35f7f1(0x37d)]!==0x1?'s':''));for(const _0x3a6e5f of _0x5e737e[_0x35f7f1(0x254)]){console[_0x35f7f1(0x263)]('\x20\x20\x20\x20-\x20'+_0x3a6e5f['name']);}}}function showParentSegmentNotSetError(_0x4f617a){const _0x580861=a31_0x18a3da;console[_0x580861(0x263)](a31_0x341876[_0x580861(0x1ec)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x580861(0x263)](_0x4f617a);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x379);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x215);async[a31_0x18a3da(0x351)](_0x2367db){const _0x26f9f1=a31_0x18a3da,{options:_0x5dff8d,args:_0x3d3fa8,tdx:_0x3ff006}=_0x2367db,_0x137664=_0x3d3fa8[0x0];_0x5dff8d[_0x26f9f1(0x1b5)]&&(console[_0x26f9f1(0x263)](_0x26f9f1(0x1f6)+_0x5dff8d[_0x26f9f1(0x20b)]),_0x137664&&console[_0x26f9f1(0x263)](_0x26f9f1(0x384)+_0x137664));const _0x106ba4=await withSpinner(_0x137664?_0x26f9f1(0x3a7)+_0x137664+_0x26f9f1(0x34e):'Listing\x20parent\x20segments...',()=>_0x3ff006[_0x26f9f1(0x2bc)][_0x26f9f1(0x2df)](),{'verbose':_0x5dff8d[_0x26f9f1(0x1b5)]});let _0x390dbb=_0x106ba4[_0x26f9f1(0x2ad)];if(_0x137664){const _0x3f44f6=_0x137664[_0x26f9f1(0x27d)](/[.+^${}()|[\]\\]/g,_0x26f9f1(0x2e0))[_0x26f9f1(0x27d)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1aa5c9=new RegExp('^'+_0x3f44f6+'$','i');_0x390dbb=_0x390dbb[_0x26f9f1(0x2f3)](_0x292e4b=>_0x1aa5c9[_0x26f9f1(0x269)](_0x292e4b[_0x26f9f1(0x317)][_0x26f9f1(0x1bd)]));}_0x390dbb[_0x26f9f1(0x279)]((_0xa02d7b,_0x537746)=>_0xa02d7b[_0x26f9f1(0x317)][_0x26f9f1(0x1bd)][_0x26f9f1(0x294)](_0x537746[_0x26f9f1(0x317)][_0x26f9f1(0x1bd)])),console[_0x26f9f1(0x263)](_0x26f9f1(0x306)+_0x390dbb[_0x26f9f1(0x37d)]+_0x26f9f1(0x1c6)+(_0x390dbb[_0x26f9f1(0x37d)]!==0x1?'s':''));const _0x3ccaea=_0x382547=>{const _0x2a92bf=_0x26f9f1;return getConsoleNextUrl(_0x5dff8d[_0x2a92bf(0x20b)],'/app/dw/parentSegments/'+_0x382547);};if(_0x5dff8d[_0x26f9f1(0x1c0)]===_0x26f9f1(0x305)||_0x5dff8d[_0x26f9f1(0x1c0)]==='jsonl'){const _0x41520a=_0x390dbb[_0x26f9f1(0x244)](_0x2dec45=>({..._0x2dec45,'url':_0x3ccaea(_0x2dec45['id'])}));await handleSDKOutput(_0x41520a,_0x5dff8d);}else{if(_0x390dbb[_0x26f9f1(0x37d)]===0x0)_0x137664?console['log'](_0x26f9f1(0x32e)+_0x137664):console[_0x26f9f1(0x36f)](_0x26f9f1(0x313));else for(const _0x4549aa of _0x390dbb){const _0x1a4244=_0x4549aa['attributes'][_0x26f9f1(0x24c)]?a31_0x341876[_0x26f9f1(0x284)]('\x20('+formatRows(_0x4549aa[_0x26f9f1(0x317)]['population'])+')'):'',_0x2f5291=hyperlink(_0x4549aa['attributes'][_0x26f9f1(0x1bd)],_0x3ccaea(_0x4549aa['id']));console[_0x26f9f1(0x36f)](_0x26f9f1(0x39a)+_0x2f5291+_0x1a4244);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x2f9);['description']='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a31_0x18a3da(0x351)](_0x3124be){const _0xab089e=a31_0x18a3da,{options:_0x1b6326,args:_0x10454f,tdx:_0x45d978}=_0x3124be;console[_0xab089e(0x263)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0xab089e(0x2d1)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x2f8e6b=_0x1b6326;if(_0x10454f[_0xab089e(0x37d)]===0x0)return console[_0xab089e(0x263)](a31_0x341876[_0xab089e(0x29a)](_0xab089e(0x292))),console[_0xab089e(0x263)](_0xab089e(0x32c)),0x1;const _0x3edf1f=_0x10454f[0x0];if(!_0x2f8e6b[_0xab089e(0x342)]||!_0x2f8e6b['table'])return console[_0xab089e(0x263)](_0xab089e(0x272)),console[_0xab089e(0x263)](_0xab089e(0x32c)),0x1;_0x2f8e6b['verbose']&&(console[_0xab089e(0x263)](_0xab089e(0x1f6)+_0x2f8e6b[_0xab089e(0x20b)]),console[_0xab089e(0x263)](_0xab089e(0x2a7)+_0x3edf1f),console[_0xab089e(0x263)](_0xab089e(0x2f4)+_0x2f8e6b[_0xab089e(0x342)]),console['error']('Table:\x20'+_0x2f8e6b['table']));const _0x24a907=await loadJSONFromOptions(_0x2f8e6b['attributes'],_0x2f8e6b[_0xab089e(0x301)]),_0x26e5a0=await loadJSONFromOptions(_0x2f8e6b[_0xab089e(0x3b0)],_0x2f8e6b[_0xab089e(0x23e)]),_0x3220fd=await loadJSONFromOptions(_0x2f8e6b[_0xab089e(0x2aa)],_0x2f8e6b[_0xab089e(0x327)]),_0x581397={'name':_0x3edf1f,'description':_0x2f8e6b['description'],'scheduleType':_0x2f8e6b[_0xab089e(0x1e7)],'scheduleOption':_0x2f8e6b['scheduleOption'],'timezone':_0x2f8e6b[_0xab089e(0x340)],'master':{'parentDatabaseName':_0x2f8e6b[_0xab089e(0x342)],'parentTableName':_0x2f8e6b[_0xab089e(0x228)]},'attributes':_0x24a907,'behaviors':_0x26e5a0,'customerGroup':_0x3220fd},_0x780f92=await withSpinner(_0xab089e(0x20f)+_0x3edf1f+_0xab089e(0x34e),()=>_0x45d978[_0xab089e(0x2bc)]['createParent'](_0x581397),{'verbose':_0x1b6326[_0xab089e(0x1b5)]}),_0x2a54d6=_0x780f92[_0xab089e(0x2ad)];return console[_0xab089e(0x263)](_0xab089e(0x2af)+_0x2a54d6['name']+_0xab089e(0x24a)+_0x2a54d6['id']),await handleSDKOutput([_0x2a54d6],_0x1b6326),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x2b8);[a31_0x18a3da(0x2dd)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a31_0x18a3da(0x351)](_0x537841){const _0x2f2e19=a31_0x18a3da,{options:_0x20d1d8,args:_0x399c12,tdx:_0x53c1e7}=_0x537841;console[_0x2f2e19(0x263)](_0x2f2e19(0x3a4)+'\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 _0x2e2c17=_0x20d1d8;if(_0x399c12[_0x2f2e19(0x37d)]===0x0)return console['error'](a31_0x341876[_0x2f2e19(0x29a)](_0x2f2e19(0x292))),console[_0x2f2e19(0x263)](_0x2f2e19(0x2d9)),0x1;const _0x2ef312=_0x399c12[0x0];_0x2e2c17[_0x2f2e19(0x1b5)]&&(console[_0x2f2e19(0x263)](_0x2f2e19(0x1f6)+_0x2e2c17[_0x2f2e19(0x20b)]),console[_0x2f2e19(0x263)](_0x2f2e19(0x3bb)+_0x2ef312));const _0x22ce8f=await withSpinner(_0x2f2e19(0x396)+_0x2ef312+_0x2f2e19(0x34e),()=>_0x53c1e7['segment'][_0x2f2e19(0x24f)](_0x2ef312),{'verbose':_0x2e2c17[_0x2f2e19(0x1b5)]}),_0x2ee257=_0x22ce8f[_0x2f2e19(0x2ad)],_0x94c670=await loadJSONFromOptions(_0x2e2c17['addAttributes'],_0x2e2c17['addAttributesFile']),_0x1bde0=await loadJSONFromOptions(_0x2e2c17[_0x2f2e19(0x35e)],_0x2e2c17[_0x2f2e19(0x344)]),_0x1a5b29={'name':_0x2ee257[_0x2f2e19(0x1bd)],'description':_0x2e2c17['description']!==undefined?_0x2e2c17[_0x2f2e19(0x2dd)]:_0x2ee257['description'],'scheduleType':_0x2e2c17[_0x2f2e19(0x1e7)]!==undefined?_0x2e2c17[_0x2f2e19(0x1e7)]:_0x2ee257[_0x2f2e19(0x1e7)],'scheduleOption':_0x2e2c17[_0x2f2e19(0x30c)]!==undefined?_0x2e2c17[_0x2f2e19(0x30c)]:_0x2ee257[_0x2f2e19(0x30c)],'timezone':_0x2e2c17['timezone']!==undefined?_0x2e2c17[_0x2f2e19(0x340)]:_0x2ee257[_0x2f2e19(0x340)],'master':_0x2ee257['master'],'attributes':_0x94c670?[..._0x2ee257['attributes']||[],..._0x94c670]:_0x2ee257[_0x2f2e19(0x317)],'behaviors':_0x1bde0?[..._0x2ee257[_0x2f2e19(0x3b0)]||[],..._0x1bde0]:_0x2ee257[_0x2f2e19(0x3b0)],'customerGroup':_0x2ee257['customerGroup']},_0x4c9a22=await withSpinner(_0x2f2e19(0x2cb)+_0x2ef312+'\x27...',()=>_0x53c1e7[_0x2f2e19(0x2bc)][_0x2f2e19(0x1dd)](_0x2ef312,_0x1a5b29),{'verbose':_0x2e2c17['verbose']}),_0x3f193a=_0x4c9a22['data'];return console[_0x2f2e19(0x263)](_0x2f2e19(0x1e2)+_0x3f193a[_0x2f2e19(0x1bd)]+'\x27'),await handleSDKOutput([_0x3f193a],_0x2e2c17),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x18a3da(0x1bd)]='segment:parent:pull';[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x299);async[a31_0x18a3da(0x351)](_0x23f13d){const _0x3bbda5=a31_0x18a3da,{options:_0x4f508c,args:_0x14bf68,tdx:_0x6c026}=_0x23f13d,_0x284d8e=_0x4f508c,_0x359306=_0x14bf68[0x0]||_0x4f508c['parentSegment'];if(!_0x359306)return showParentSegmentNotSetError(_0x3bbda5(0x2a8)+_0x3bbda5(0x2dc)),0x1;if(_0x284d8e[_0x3bbda5(0x35f)]&&_0x284d8e[_0x3bbda5(0x23b)])return console[_0x3bbda5(0x263)](a31_0x341876[_0x3bbda5(0x29a)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x3bbda5(0x263)](a31_0x341876[_0x3bbda5(0x284)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console['error'](a31_0x341876[_0x3bbda5(0x284)](_0x3bbda5(0x32d)+PARENT_SEGMENT_DIR+_0x3bbda5(0x2b1))),console[_0x3bbda5(0x263)](a31_0x341876['cyan'](_0x3bbda5(0x2b6))),0x1;const _0x4609fb=_0x284d8e[_0x3bbda5(0x23b)]||a31_0x1dd735[_0x3bbda5(0x2fb)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x359306)+_0x3bbda5(0x353));_0x284d8e[_0x3bbda5(0x1b5)]&&(console['error'](_0x3bbda5(0x1f6)+_0x284d8e['site']),console[_0x3bbda5(0x263)](_0x3bbda5(0x3bb)+_0x359306),console[_0x3bbda5(0x263)](_0x3bbda5(0x2db)+_0x4609fb));const _0x2aadda=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x359306+_0x3bbda5(0x34e),()=>_0x6c026[_0x3bbda5(0x2bc)][_0x3bbda5(0x389)](_0x359306),{'verbose':_0x284d8e['verbose']}),_0x350a50=_0x2aadda['data'];if(existsSync(_0x4609fb)){const _0x485be1=readFileSync(_0x4609fb,_0x3bbda5(0x36c)),_0x2b988a=generateDiff(_0x485be1,_0x350a50);if(!hasChanges(_0x2b988a))console[_0x3bbda5(0x263)](a31_0x341876[_0x3bbda5(0x297)]('✔')+_0x3bbda5(0x35a)+a31_0x341876[_0x3bbda5(0x293)](_0x4609fb)+_0x3bbda5(0x253));else{console[_0x3bbda5(0x263)](_0x3bbda5(0x2c6)+_0x4609fb+'\x27:'),console['error']('─'[_0x3bbda5(0x1b4)](0x3c)),console['error'](formatDiffWithColors(_0x2b988a)),console[_0x3bbda5(0x263)]('─'[_0x3bbda5(0x1b4)](0x3c));if(!_0x284d8e[_0x3bbda5(0x370)]){if(!isInteractive())return console[_0x3bbda5(0x263)](a31_0x341876['red']('\x0aError:'),_0x3bbda5(0x1a4)),console['error'](a31_0x341876[_0x3bbda5(0x284)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3147f9=await confirmKey(_0x3bbda5(0x233)+_0x4609fb+'\x27?');if(!_0x3147f9)return console[_0x3bbda5(0x263)](a31_0x341876[_0x3bbda5(0x1ec)](_0x3bbda5(0x360))),0x1;}writeFileSync(_0x4609fb,_0x350a50,'utf-8'),console[_0x3bbda5(0x263)](a31_0x341876[_0x3bbda5(0x297)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x341876[_0x3bbda5(0x293)](_0x4609fb));}}else{const _0x2fd676=a31_0x1dd735[_0x3bbda5(0x1ad)](_0x4609fb);!existsSync(_0x2fd676)&&mkdirSync(_0x2fd676,{'recursive':!![]}),writeFileSync(_0x4609fb,_0x350a50,'utf-8'),console[_0x3bbda5(0x263)](a31_0x341876[_0x3bbda5(0x297)]('✔')+_0x3bbda5(0x324)+a31_0x341876[_0x3bbda5(0x293)](_0x4609fb));}return saveSessionContext({'parent_segment':_0x359306},_0x284d8e['session']),console[_0x3bbda5(0x263)](a31_0x341876[_0x3bbda5(0x297)]('✔')+_0x3bbda5(0x1e9)+a31_0x341876[_0x3bbda5(0x284)](_0x3bbda5(0x25a))+_0x3bbda5(0x238)+a31_0x341876['cyan'](_0x359306)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x22e);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x204);async[a31_0x18a3da(0x351)](_0x379814){const _0x36d65c=a31_0x18a3da,{options:_0x1da4de,args:_0x1b62ec,tdx:_0x105f89}=_0x379814,_0x154048=_0x1da4de,_0x1cd1fc=_0x1b62ec[0x0]||_0x1da4de[_0x36d65c(0x29d)];if(!_0x1cd1fc)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'+_0x36d65c(0x1e0)),0x1;const _0x1af09e=resolveYamlFile(_0x1cd1fc);if(!existsSync(_0x1af09e))return showFileNotFoundError(_0x1af09e,_0x1cd1fc),0x1;_0x154048[_0x36d65c(0x1b5)]&&(console[_0x36d65c(0x263)]('Site:\x20'+_0x154048[_0x36d65c(0x20b)]),console[_0x36d65c(0x263)](_0x36d65c(0x374)+_0x1af09e));let _0x50ea34;try{_0x50ea34=readFileSync(_0x1af09e,_0x36d65c(0x36c));}catch(_0x242f7e){const _0x1c302a=_0x242f7e instanceof Error?_0x242f7e[_0x36d65c(0x39d)]:String(_0x242f7e);return console[_0x36d65c(0x263)]('Error\x20reading\x20file:\x20'+_0x1c302a),0x1;}const _0x593b51=await withSpinner('Analyzing\x20changes...',()=>_0x105f89[_0x36d65c(0x2bc)][_0x36d65c(0x1d6)](_0x50ea34),{'verbose':_0x154048['verbose']}),_0x1032c9=_0x593b51['data'],{isNew:_0x209224,name:_0x180c6a,hasChanges:_0x3f34ae,diffFormatted:_0x33ae15}=_0x1032c9;if(!_0x3f34ae)return console[_0x36d65c(0x263)]('✔\x20No\x20changes\x20-\x20\x27'+_0x180c6a+_0x36d65c(0x235)),0x0;_0x209224?console[_0x36d65c(0x263)](_0x36d65c(0x1ff)+_0x180c6a+'\x27:'):console[_0x36d65c(0x263)](_0x36d65c(0x25b)+_0x180c6a+'\x27:');console[_0x36d65c(0x263)]('─'[_0x36d65c(0x1b4)](0x3c)),console[_0x36d65c(0x263)](_0x33ae15),console['error']('─'[_0x36d65c(0x1b4)](0x3c));const _0x12aa67=_0x209224?_0x36d65c(0x248)+_0x180c6a+'\x27?':_0x36d65c(0x1c5)+_0x180c6a+'\x27?';if(!_0x154048[_0x36d65c(0x370)]){if(!isInteractive())return console['error'](a31_0x341876[_0x36d65c(0x29a)](_0x36d65c(0x21c)),_0x36d65c(0x1a4)),console[_0x36d65c(0x263)](a31_0x341876[_0x36d65c(0x284)](_0x36d65c(0x394))),0x1;const _0x219057=await confirmKey(_0x12aa67);if(!_0x219057)return console[_0x36d65c(0x263)](a31_0x341876['yellow'](_0x36d65c(0x360))),0x1;}const _0x37fe4b=_0x209224?_0x36d65c(0x2d0):'Updating',_0x5c36c1=await withSpinner(_0x37fe4b+_0x36d65c(0x1c3)+_0x180c6a+'\x27...',()=>_0x1032c9[_0x36d65c(0x3b4)](),{'verbose':_0x154048['verbose']}),_0x2aebea=_0x5c36c1[_0x36d65c(0x2ad)],_0x13e636=getConsoleNextUrl(_0x154048[_0x36d65c(0x20b)],'/app/dw/parentSegments/'+_0x2aebea['id']),_0x348150=_0x209224?_0x36d65c(0x277):_0x36d65c(0x397);return console['error']('✔\x20'+_0x348150+_0x36d65c(0x1c3)+_0x2aebea[_0x36d65c(0x1bd)]+'\x27'),console['error']('\x20\x20'+_0x13e636),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x18a3da(0x1bd)]='segment:parent:validate';[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x265);async[a31_0x18a3da(0x351)](_0x52b981){const _0x449e37=a31_0x18a3da,{options:_0x26f561,args:_0x8478d8,tdx:_0xda8252}=_0x52b981,_0x9ca6a2=_0x26f561,_0x37d7d0=_0x8478d8[0x0]||_0x26f561[_0x449e37(0x29d)];if(!_0x37d7d0)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x449e37(0x290)+'Options:\x0a'+_0x449e37(0x205)+_0x449e37(0x3b7)+_0x449e37(0x22a)),0x1;const _0x54e5df=resolveYamlFile(_0x37d7d0);if(!existsSync(_0x54e5df))return showFileNotFoundError(_0x54e5df,_0x37d7d0),0x1;_0x9ca6a2[_0x449e37(0x1b5)]&&(console[_0x449e37(0x263)]('Site:\x20'+_0x9ca6a2['site']),console[_0x449e37(0x263)](_0x449e37(0x374)+_0x54e5df));let _0x36a910;try{_0x36a910=readFileSync(_0x54e5df,_0x449e37(0x36c));}catch(_0x1a033f){const _0x3d23b1=_0x1a033f instanceof Error?_0x1a033f[_0x449e37(0x39d)]:String(_0x1a033f);return console['error'](_0x449e37(0x226)+_0x3d23b1),0x1;}const _0x425753=createCommandSpinner(a31_0x341876['dim'](_0x449e37(0x1ee)),{'verbose':_0x9ca6a2[_0x449e37(0x1b5)]});_0x425753[_0x449e37(0x33b)]();const _0x107e9a={'onProgress':_0x132e7e=>{const _0x35ac54=_0x449e37;_0x425753[_0x35ac54(0x3b6)]=formatProgressMessage(_0x132e7e);}};if(_0x9ca6a2['master'])_0x107e9a[_0x449e37(0x357)]=!![];if(_0x9ca6a2[_0x449e37(0x1cb)])_0x107e9a[_0x449e37(0x1cb)]=!![];_0x9ca6a2[_0x449e37(0x25d)]&&(_0x107e9a[_0x449e37(0x25d)]=_0x9ca6a2['attribute']);_0x9ca6a2[_0x449e37(0x2a2)]&&(_0x107e9a[_0x449e37(0x2a2)]=_0x9ca6a2[_0x449e37(0x2a2)]);if(_0x9ca6a2[_0x449e37(0x239)])_0x107e9a[_0x449e37(0x239)]=_0x9ca6a2[_0x449e37(0x239)];let _0x379364;try{_0x379364=await _0xda8252[_0x449e37(0x2bc)][_0x449e37(0x332)](_0x36a910,_0x107e9a),_0x425753[_0x449e37(0x218)]();}catch(_0x57aabb){_0x425753[_0x449e37(0x218)]();throw _0x57aabb;}const _0x2c1690=_0x9ca6a2['interval']||_0x449e37(0x26b);return this['displayValidateResults'](_0x379364,_0x107e9a,_0x54e5df,_0x2c1690),_0x379364['allValid']?0x0:0x1;}[a31_0x18a3da(0x39e)](_0x5c0d28,_0x25a3ec,_0x21a074,_0x2925f){const _0x4d1b4c=a31_0x18a3da;console[_0x4d1b4c(0x263)]('\x0a'+a31_0x341876[_0x4d1b4c(0x3a3)](_0x4d1b4c(0x219))+'\x20'+_0x5c0d28[_0x4d1b4c(0x1bd)]),console[_0x4d1b4c(0x263)]('═'[_0x4d1b4c(0x1b4)](0x3c)),this['displayMasterInfo'](_0x5c0d28);if(typeof _0x25a3ec[_0x4d1b4c(0x25d)]==='string'){this['displayAttributesStats'](_0x5c0d28),this[_0x4d1b4c(0x3b3)](_0x5c0d28),this[_0x4d1b4c(0x203)](_0x21a074,_0x2925f,'attribute',_0x25a3ec['attribute']);return;}if(_0x25a3ec[_0x4d1b4c(0x25d)]===!![]){this[_0x4d1b4c(0x302)](_0x5c0d28),this[_0x4d1b4c(0x3b3)](_0x5c0d28),this[_0x4d1b4c(0x203)](_0x21a074,_0x2925f,_0x4d1b4c(0x317));return;}if(typeof _0x25a3ec[_0x4d1b4c(0x2a2)]===_0x4d1b4c(0x2f7)){this['displayBehaviorsStats'](_0x5c0d28,_0x2925f),this[_0x4d1b4c(0x3b3)](_0x5c0d28),this[_0x4d1b4c(0x203)](_0x21a074,_0x2925f,_0x4d1b4c(0x2a2),_0x25a3ec[_0x4d1b4c(0x2a2)]);return;}if(_0x25a3ec[_0x4d1b4c(0x2a2)]===!![]){this[_0x4d1b4c(0x225)](_0x5c0d28,_0x2925f),this[_0x4d1b4c(0x3b3)](_0x5c0d28),this[_0x4d1b4c(0x203)](_0x21a074,_0x2925f,_0x4d1b4c(0x3b0));return;}this['displayAttributesStats'](_0x5c0d28),this[_0x4d1b4c(0x225)](_0x5c0d28,_0x2925f),this[_0x4d1b4c(0x36d)](_0x5c0d28),this[_0x4d1b4c(0x3b3)](_0x5c0d28),this[_0x4d1b4c(0x203)](_0x21a074,_0x2925f,_0x4d1b4c(0x2f6));}[a31_0x18a3da(0x36d)](_0x715dac){displayRealtimeValidation(_0x715dac);}[a31_0x18a3da(0x203)](_0x4915e0,_0x276b87,_0x34476f,_0x11c09c){const _0xe700e8=a31_0x18a3da;console[_0xe700e8(0x263)]('\x0a'+a31_0x341876[_0xe700e8(0x284)](_0xe700e8(0x31a)));const _0x5e5e6d=_0x276b87!==_0xe700e8(0x26b)?_0xe700e8(0x30a)+_0x276b87:'';if(_0x34476f===_0xe700e8(0x25d)&&_0x11c09c)console[_0xe700e8(0x263)]('\x20\x20'+a31_0x341876[_0xe700e8(0x284)]('tdx\x20ps\x20preview\x20'+_0x4915e0+'\x20--attribute\x20\x22'+_0x11c09c+'\x22'+_0x5e5e6d));else{if(_0x34476f===_0xe700e8(0x2a2)&&_0x11c09c)console[_0xe700e8(0x263)]('\x20\x20'+a31_0x341876[_0xe700e8(0x284)]('tdx\x20ps\x20preview\x20'+_0x4915e0+_0xe700e8(0x366)+_0x11c09c+'\x22'+_0x5e5e6d));else(_0x34476f===_0xe700e8(0x317)||_0x34476f===_0xe700e8(0x2f6))&&console['error']('\x20\x20'+a31_0x341876['dim'](_0xe700e8(0x335)+_0x4915e0+_0xe700e8(0x2e9)+_0x5e5e6d));}(_0x34476f===_0xe700e8(0x3b0)||_0x34476f===_0xe700e8(0x2f6))&&console[_0xe700e8(0x263)]('\x20\x20'+a31_0x341876['dim']('tdx\x20ps\x20preview\x20'+_0x4915e0+_0xe700e8(0x260)+_0x5e5e6d)),_0x34476f===_0xe700e8(0x2f6)&&console[_0xe700e8(0x263)]('\x20\x20'+a31_0x341876[_0xe700e8(0x284)](_0xe700e8(0x335)+_0x4915e0+_0xe700e8(0x2ea)+_0x5e5e6d));}[a31_0x18a3da(0x1b0)](_0x56c4ad){const _0x18d36b=a31_0x18a3da,{master:_0x511300}=_0x56c4ad,_0x75346c=_0x511300[_0x18d36b(0x1fb)]?a31_0x341876[_0x18d36b(0x297)]('✔'):a31_0x341876[_0x18d36b(0x29a)]('✘');console[_0x18d36b(0x263)]('\x0a'+a31_0x341876[_0x18d36b(0x284)](_0x18d36b(0x264))),console[_0x18d36b(0x263)](_0x75346c+'\x20'+a31_0x341876[_0x18d36b(0x3a3)](_0x511300[_0x18d36b(0x342)]+'.'+_0x511300[_0x18d36b(0x228)])),_0x511300[_0x18d36b(0x1fb)]?_0x511300[_0x18d36b(0x24e)]!==undefined&&console['error']('\x20\x20'+a31_0x341876[_0x18d36b(0x284)](_0x18d36b(0x2eb))+'\x20'+a31_0x341876[_0x18d36b(0x293)](formatRows(_0x511300['rowCount']))):console['error']('\x20\x20'+a31_0x341876[_0x18d36b(0x29a)](_0x18d36b(0x24d))+'\x20'+_0x511300[_0x18d36b(0x28a)]);}[a31_0x18a3da(0x302)](_0x13bfbd){const _0x37b1ab=a31_0x18a3da;if(_0x13bfbd[_0x37b1ab(0x317)][_0x37b1ab(0x37d)]===0x0)return;console[_0x37b1ab(0x263)]('\x0a'+a31_0x341876[_0x37b1ab(0x284)](_0x37b1ab(0x30d)));for(const _0x123ce0 of _0x13bfbd[_0x37b1ab(0x317)]){const _0xdd4249=_0x123ce0[_0x37b1ab(0x1fb)]?a31_0x341876[_0x37b1ab(0x297)]('✔'):a31_0x341876[_0x37b1ab(0x29a)]('✘');let _0x488914='';if(_0x123ce0['schemaValid']&&_0x123ce0[_0x37b1ab(0x211)]!==undefined&&_0x123ce0[_0x37b1ab(0x21e)]!==undefined){const _0x5c1a9a=_0x123ce0['coveragePercent'][_0x37b1ab(0x1f2)](0x1),_0x258c40=_0x123ce0[_0x37b1ab(0x21e)]>=0x50?a31_0x341876[_0x37b1ab(0x297)]:_0x123ce0[_0x37b1ab(0x21e)]>=0x32?a31_0x341876[_0x37b1ab(0x1ec)]:a31_0x341876['red'];_0x488914='\x20'+a31_0x341876[_0x37b1ab(0x284)]('Coverage:')+'\x20'+_0x258c40(_0x5c1a9a+'%')+'\x20('+formatRows(_0x123ce0['matchedCount'])+_0x37b1ab(0x2d4);}console[_0x37b1ab(0x263)](_0xdd4249+'\x20'+a31_0x341876[_0x37b1ab(0x3a3)](_0x123ce0['name'])+_0x488914),console[_0x37b1ab(0x263)]('\x20\x20'+a31_0x341876[_0x37b1ab(0x284)]('Source:')+'\x20'+a31_0x341876[_0x37b1ab(0x3a3)](_0x123ce0[_0x37b1ab(0x342)]+'.'+_0x123ce0[_0x37b1ab(0x228)]));const _0x1372c0=_0x123ce0[_0x37b1ab(0x1fc)]===_0x123ce0[_0x37b1ab(0x388)]?a31_0x341876['dim']('Join\x20on:')+'\x20'+_0x123ce0[_0x37b1ab(0x1fc)]:a31_0x341876[_0x37b1ab(0x284)](_0x37b1ab(0x20c))+'\x20'+_0x123ce0[_0x37b1ab(0x1fc)]+_0x37b1ab(0x238)+_0x123ce0[_0x37b1ab(0x388)];console[_0x37b1ab(0x263)]('\x20\x20'+_0x1372c0),console['error']('\x20\x20'+a31_0x341876['dim'](_0x37b1ab(0x275))),this[_0x37b1ab(0x1b1)](_0x123ce0['columns']),!_0x123ce0['schemaValid']&&console[_0x37b1ab(0x263)]('\x20\x20'+a31_0x341876['red'](_0x37b1ab(0x24d))+'\x20'+_0x123ce0[_0x37b1ab(0x28a)]);}}[a31_0x18a3da(0x225)](_0x2dab34,_0x5d5a2f){const _0x5be489=a31_0x18a3da;if(_0x2dab34[_0x5be489(0x3b0)][_0x5be489(0x37d)]===0x0)return;console['error']('\x0a'+a31_0x341876[_0x5be489(0x284)](_0x5be489(0x311))+'\x20'+a31_0x341876['dim']('('+_0x5d5a2f+')'));for(const _0x27ad14 of _0x2dab34[_0x5be489(0x3b0)]){const _0x5b9f13=_0x27ad14[_0x5be489(0x1fb)]?a31_0x341876['green']('✔'):a31_0x341876[_0x5be489(0x29a)]('✘');let _0x2ee0c3='';if(_0x27ad14[_0x5be489(0x1fb)]&&_0x27ad14[_0x5be489(0x257)]!==undefined&&_0x27ad14[_0x5be489(0x3a2)]!==undefined){const _0x5595e9=_0x27ad14[_0x5be489(0x1de)]?.[_0x5be489(0x1f2)](0x1)||'?',_0x30d0c1=(_0x27ad14[_0x5be489(0x1de)]??0x0)>=0x32?a31_0x341876['green']:(_0x27ad14[_0x5be489(0x1de)]??0x0)>=0x14?a31_0x341876[_0x5be489(0x1ec)]:a31_0x341876[_0x5be489(0x29a)];_0x2ee0c3='\x20'+a31_0x341876[_0x5be489(0x284)](_0x5be489(0x348))+'\x20'+_0x30d0c1(formatRows(_0x27ad14[_0x5be489(0x257)]))+'\x20('+_0x5595e9+_0x5be489(0x23f)+a31_0x341876[_0x5be489(0x284)](_0x5be489(0x2be))+'\x20'+a31_0x341876['cyan'](formatRows(_0x27ad14[_0x5be489(0x3a2)]));}console['error'](_0x5b9f13+'\x20'+a31_0x341876[_0x5be489(0x3a3)](_0x27ad14[_0x5be489(0x1bd)])+_0x2ee0c3),console['error']('\x20\x20'+a31_0x341876[_0x5be489(0x284)](_0x5be489(0x341))+'\x20'+a31_0x341876[_0x5be489(0x3a3)](_0x27ad14[_0x5be489(0x342)]+'.'+_0x27ad14[_0x5be489(0x228)]));const _0x5326f2=_0x27ad14[_0x5be489(0x1fc)]===_0x27ad14[_0x5be489(0x388)]?a31_0x341876['dim']('Join\x20on:')+'\x20'+_0x27ad14[_0x5be489(0x1fc)]:a31_0x341876[_0x5be489(0x284)]('Join:')+'\x20'+_0x27ad14[_0x5be489(0x1fc)]+_0x5be489(0x238)+_0x27ad14[_0x5be489(0x388)];console['error']('\x20\x20'+_0x5326f2),console['error']('\x20\x20'+a31_0x341876[_0x5be489(0x284)](_0x5be489(0x275))),this[_0x5be489(0x1b1)](_0x27ad14[_0x5be489(0x34c)]),!_0x27ad14[_0x5be489(0x1fb)]&&console['error']('\x20\x20'+a31_0x341876[_0x5be489(0x29a)](_0x5be489(0x24d))+'\x20'+_0x27ad14[_0x5be489(0x28a)]);}}[a31_0x18a3da(0x1b1)](_0x2d5214){const _0x1e8507=a31_0x18a3da;for(const _0x2330fe of _0x2d5214){_0x2330fe[_0x1e8507(0x34b)]===_0x2330fe[_0x1e8507(0x2a0)]||_0x2330fe['column']==='*'?console['error'](_0x1e8507(0x1f5)+_0x2330fe[_0x1e8507(0x34b)]):console[_0x1e8507(0x263)](_0x1e8507(0x1f5)+_0x2330fe[_0x1e8507(0x34b)]+'\x20'+a31_0x341876['dim']('('+_0x2330fe['column']+')'));}}[a31_0x18a3da(0x3b3)](_0x372041){const _0x13f42b=a31_0x18a3da;console[_0x13f42b(0x263)]('─'['repeat'](0x3c));if(_0x372041[_0x13f42b(0x310)]['length']>0x0){console[_0x13f42b(0x263)]('\x0a'+a31_0x341876[_0x13f42b(0x29a)](_0x13f42b(0x230)));for(const _0x56537e of _0x372041[_0x13f42b(0x310)]){console[_0x13f42b(0x263)]('\x20\x20'+a31_0x341876[_0x13f42b(0x29a)]('•')+'\x20'+_0x56537e);}}_0x372041[_0x13f42b(0x383)]&&console[_0x13f42b(0x263)]('\x0a'+a31_0x341876[_0x13f42b(0x297)]('✔')+_0x13f42b(0x1a5));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x2b3);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x210);async['execute'](_0x1bf928){const _0x1e7ec2=a31_0x18a3da,{options:_0x28ee60,args:_0x94ce07,tdx:_0x19c8c4}=_0x1bf928,_0x269e74=_0x28ee60,_0x3f2ed4=_0x94ce07[0x0]||_0x28ee60['parentSegment'];if(!_0x3f2ed4)return showParentSegmentNotSetError(_0x1e7ec2(0x2ba)+_0x1e7ec2(0x266)+_0x1e7ec2(0x236)+_0x1e7ec2(0x1d1)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x1e7ec2(0x22a)),0x1;if(!_0x269e74[_0x1e7ec2(0x357)]&&!_0x269e74[_0x1e7ec2(0x25d)]&&!_0x269e74['behavior']&&!_0x269e74[_0x1e7ec2(0x1cb)])return console[_0x1e7ec2(0x263)](a31_0x341876[_0x1e7ec2(0x29a)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x1e7ec2(0x263)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x1e7ec2(0x263)]('Options:'),console['error'](_0x1e7ec2(0x2f8)),console['error'](_0x1e7ec2(0x1b3)),console[_0x1e7ec2(0x263)](_0x1e7ec2(0x331)),console[_0x1e7ec2(0x263)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x4341cf=resolveYamlFile(_0x3f2ed4);if(!existsSync(_0x4341cf))return showFileNotFoundError(_0x4341cf,_0x3f2ed4),0x1;_0x269e74[_0x1e7ec2(0x1b5)]&&(console['error'](_0x1e7ec2(0x1f6)+_0x269e74[_0x1e7ec2(0x20b)]),console[_0x1e7ec2(0x263)]('YAML\x20file:\x20'+_0x4341cf));let _0x43f544;try{_0x43f544=readFileSync(_0x4341cf,_0x1e7ec2(0x36c));}catch(_0x363720){const _0x46d6dc=_0x363720 instanceof Error?_0x363720['message']:String(_0x363720);return console[_0x1e7ec2(0x263)](_0x1e7ec2(0x226)+_0x46d6dc),0x1;}let _0x2619c9;try{_0x2619c9=parseDef(_0x43f544);}catch(_0x5d2525){const _0xee6d50=_0x5d2525 instanceof Error?_0x5d2525['message']:String(_0x5d2525);return console[_0x1e7ec2(0x263)](a31_0x341876[_0x1e7ec2(0x29a)]('Error\x20parsing\x20YAML:\x20'+_0xee6d50)),0x1;}if(_0x269e74[_0x1e7ec2(0x25d)]===!![]||_0x269e74[_0x1e7ec2(0x25d)]===''){const _0x5ad47f=_0x2619c9[_0x1e7ec2(0x317)]?.[_0x1e7ec2(0x244)](_0x3c8a70=>_0x3c8a70[_0x1e7ec2(0x1bd)])||[];if(_0x5ad47f['length']===0x0)console[_0x1e7ec2(0x263)](a31_0x341876['red'](_0x1e7ec2(0x25c)));else{console[_0x1e7ec2(0x263)](a31_0x341876['red'](_0x1e7ec2(0x281))),console[_0x1e7ec2(0x263)](_0x1e7ec2(0x1ce));for(const _0x1020b3 of _0x5ad47f){console[_0x1e7ec2(0x263)]('\x20\x20'+a31_0x341876['cyan'](_0x1020b3));}console[_0x1e7ec2(0x263)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x3f2ed4+'\x20--attribute\x20\x22'+_0x5ad47f[0x0]+'\x22');}return 0x1;}if(_0x269e74[_0x1e7ec2(0x2a2)]===!![]||_0x269e74[_0x1e7ec2(0x2a2)]===''){const _0x5b87db=_0x2619c9['behaviors']?.[_0x1e7ec2(0x244)](_0x52acf0=>_0x52acf0['name'])||[];if(_0x5b87db[_0x1e7ec2(0x37d)]===0x0)console[_0x1e7ec2(0x263)](a31_0x341876[_0x1e7ec2(0x29a)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x1e7ec2(0x263)](a31_0x341876[_0x1e7ec2(0x29a)](_0x1e7ec2(0x1ba))),console[_0x1e7ec2(0x263)]('Available\x20behaviors:');for(const _0x9700f3 of _0x5b87db){console[_0x1e7ec2(0x263)]('\x20\x20'+a31_0x341876['cyan'](_0x9700f3));}console[_0x1e7ec2(0x263)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x3f2ed4+_0x1e7ec2(0x366)+_0x5b87db[0x0]+'\x22');}return 0x1;}const _0x3390a8=createCommandSpinner(a31_0x341876[_0x1e7ec2(0x284)](_0x1e7ec2(0x1e5)),{'verbose':_0x269e74[_0x1e7ec2(0x1b5)]});_0x3390a8[_0x1e7ec2(0x33b)]();const _0x45fa32={'onProgress':_0x52cc08=>{const _0x39c262=_0x1e7ec2;_0x3390a8[_0x39c262(0x3b6)]=formatProgressMessage(_0x52cc08);}};if(_0x269e74[_0x1e7ec2(0x357)])_0x45fa32[_0x1e7ec2(0x357)]=!![];if(_0x269e74[_0x1e7ec2(0x25d)]&&typeof _0x269e74[_0x1e7ec2(0x25d)]==='string')_0x45fa32[_0x1e7ec2(0x25d)]=_0x269e74[_0x1e7ec2(0x25d)];if(_0x269e74['behavior']&&typeof _0x269e74[_0x1e7ec2(0x2a2)]===_0x1e7ec2(0x2f7))_0x45fa32[_0x1e7ec2(0x2a2)]=_0x269e74[_0x1e7ec2(0x2a2)];if(_0x269e74[_0x1e7ec2(0x1cb)])_0x45fa32[_0x1e7ec2(0x1cb)]=!![];if(_0x269e74[_0x1e7ec2(0x239)])_0x45fa32['interval']=_0x269e74['interval'];let _0x5c31e8;try{_0x5c31e8=await _0x19c8c4[_0x1e7ec2(0x2bc)][_0x1e7ec2(0x20e)](_0x43f544,_0x45fa32),_0x3390a8[_0x1e7ec2(0x218)]();}catch(_0x19cb35){_0x3390a8[_0x1e7ec2(0x218)]();throw _0x19cb35;}return await this['displayPreviewResults'](_0x5c31e8,{'master':_0x269e74[_0x1e7ec2(0x357)],'attribute':typeof _0x269e74['attribute']==='string'?_0x269e74[_0x1e7ec2(0x25d)]:undefined,'behavior':typeof _0x269e74[_0x1e7ec2(0x2a2)]===_0x1e7ec2(0x2f7)?_0x269e74[_0x1e7ec2(0x2a2)]:undefined,'enriched':_0x269e74[_0x1e7ec2(0x1cb)]}),_0x5c31e8[_0x1e7ec2(0x383)]?0x0:0x1;}async[a31_0x18a3da(0x2c5)](_0x5e5a0e,_0x47d31d){const _0x4664cf=a31_0x18a3da;console[_0x4664cf(0x263)]('\x0a'+a31_0x341876[_0x4664cf(0x3a3)](_0x4664cf(0x307))+'\x20'+_0x5e5a0e['name']),console[_0x4664cf(0x263)]('═'['repeat'](0x3c));if(_0x47d31d['master']&&_0x5e5a0e['sampleData']){const _0x31ad9e=a31_0x341876[_0x4664cf(0x284)](_0x4664cf(0x1ac))+'\x20'+a31_0x341876[_0x4664cf(0x3a3)](_0x5e5a0e[_0x4664cf(0x357)][_0x4664cf(0x342)]+'.'+_0x5e5a0e['master']['table']);await this[_0x4664cf(0x283)](_0x31ad9e,_0x5e5a0e[_0x4664cf(0x270)]);}else{if(_0x47d31d[_0x4664cf(0x25d)]&&_0x5e5a0e[_0x4664cf(0x270)]){const _0x3cacec=a31_0x341876['dim']('Attribute:')+'\x20'+a31_0x341876[_0x4664cf(0x3a3)](_0x47d31d[_0x4664cf(0x25d)]);await this[_0x4664cf(0x283)](_0x3cacec,_0x5e5a0e[_0x4664cf(0x270)]);}else{if(_0x47d31d[_0x4664cf(0x2a2)]&&_0x5e5a0e[_0x4664cf(0x270)]){const _0x418654=a31_0x341876[_0x4664cf(0x284)]('Behavior:')+'\x20'+a31_0x341876[_0x4664cf(0x3a3)](_0x47d31d[_0x4664cf(0x2a2)]);await this[_0x4664cf(0x283)](_0x418654,_0x5e5a0e[_0x4664cf(0x270)]);}else{if(_0x47d31d[_0x4664cf(0x1cb)]&&_0x5e5a0e[_0x4664cf(0x270)]){const _0x4f0337=a31_0x341876[_0x4664cf(0x284)]('Enriched:')+'\x20'+a31_0x341876[_0x4664cf(0x3a3)](_0x4664cf(0x289));await this[_0x4664cf(0x283)](_0x4f0337,_0x5e5a0e[_0x4664cf(0x270)]);}else!_0x5e5a0e[_0x4664cf(0x270)]&&console[_0x4664cf(0x263)](_0x4664cf(0x2ae));}}}if(_0x5e5a0e['errors'][_0x4664cf(0x37d)]>0x0){console[_0x4664cf(0x263)]('─'[_0x4664cf(0x1b4)](0x3c)),console['error']('\x0a'+a31_0x341876[_0x4664cf(0x29a)](_0x4664cf(0x230)));for(const _0x310764 of _0x5e5a0e[_0x4664cf(0x310)]){console['error']('\x20\x20'+a31_0x341876[_0x4664cf(0x29a)]('•')+'\x20'+_0x310764);}}}async[a31_0x18a3da(0x283)](_0x375e69,_0x23083d){const _0x47ab3e=a31_0x18a3da;if(_0x23083d[_0x47ab3e(0x37d)]===0x0){console[_0x47ab3e(0x263)]('\x0a'+_0x375e69),console[_0x47ab3e(0x263)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x47ab3e(0x263)]('\x0a'+_0x375e69);const _0x456b7b=Object[_0x47ab3e(0x2b9)](_0x23083d[0x0])[_0x47ab3e(0x244)](_0x44a467=>({'name':_0x44a467,'type':typeof _0x23083d[0x0][_0x44a467]===_0x47ab3e(0x1ae)?_0x47ab3e(0x237):_0x47ab3e(0x247)})),_0x18c797={'queryId':_0x47ab3e(0x229),'columns':_0x456b7b,'data':_0x23083d,'stats':{'state':_0x47ab3e(0x381),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x23083d[_0x47ab3e(0x37d)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x28e544=formatAsTable(_0x18c797,_0x23083d[_0x47ab3e(0x37d)],!![]);await writeOutput(_0x28e544,undefined,_0x47ab3e(0x228));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x261);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x2f2);async[a31_0x18a3da(0x351)](_0x306dcc){const _0x535965=a31_0x18a3da,{options:_0x24e224,args:_0x165fcf,tdx:_0x5927db}=_0x306dcc,_0x518372=_0x24e224,_0x14a9af=_0x165fcf[0x0]||_0x24e224[_0x535965(0x29d)];if(!_0x14a9af)return showParentSegmentNotSetError(_0x535965(0x2e4)+_0x535965(0x3a9)),0x1;const _0xd7579e=resolveYamlFile(_0x14a9af);if(existsSync(_0xd7579e)){_0x518372[_0x535965(0x1b5)]&&console[_0x535965(0x263)](_0x535965(0x3ad)+_0xd7579e);let _0x8b43ef;try{_0x8b43ef=readFileSync(_0xd7579e,_0x535965(0x36c));}catch(_0x4061fa){const _0x1e0e44=_0x4061fa instanceof Error?_0x4061fa['message']:String(_0x4061fa);return console[_0x535965(0x263)](_0x535965(0x226)+_0x1e0e44),0x1;}const _0x4804e2=await withSpinner(_0x535965(0x31f),()=>_0x5927db[_0x535965(0x2bc)][_0x535965(0x1d6)](_0x8b43ef),{'verbose':_0x518372[_0x535965(0x1b5)]}),_0x13e227=_0x4804e2['data'],{isNew:_0x4fee58,name:_0x338ad0,hasChanges:_0x51b409,diffFormatted:_0x422650}=_0x13e227;if(_0x51b409){_0x4fee58?console[_0x535965(0x263)](_0x535965(0x1ff)+_0x338ad0+'\x27:'):console[_0x535965(0x263)](_0x535965(0x25b)+_0x338ad0+'\x27:');console[_0x535965(0x263)]('─'['repeat'](0x3c)),console[_0x535965(0x263)](_0x422650),console[_0x535965(0x263)]('─'[_0x535965(0x1b4)](0x3c));const _0x4e86f3=_0x4fee58?_0x535965(0x248)+_0x338ad0+_0x535965(0x33e):_0x535965(0x1c5)+_0x338ad0+_0x535965(0x33e);if(!_0x518372[_0x535965(0x370)]){if(!isInteractive())return console['error'](a31_0x341876[_0x535965(0x29a)](_0x535965(0x21c)),_0x535965(0x1a4)),console[_0x535965(0x263)](a31_0x341876[_0x535965(0x284)](_0x535965(0x394))),0x1;const _0x56e661=await confirmKey(_0x4e86f3);if(!_0x56e661)return console[_0x535965(0x263)](a31_0x341876[_0x535965(0x1ec)](_0x535965(0x360))),0x1;}const _0x17eaf5=_0x4fee58?_0x535965(0x2d0):_0x535965(0x36a);await withSpinner(_0x17eaf5+_0x535965(0x1c3)+_0x338ad0+_0x535965(0x34e),()=>_0x13e227[_0x535965(0x3b4)](),{'verbose':_0x518372[_0x535965(0x1b5)]});const _0x4f227a=_0x4fee58?_0x535965(0x277):_0x535965(0x397);console[_0x535965(0x263)]('✔\x20'+_0x4f227a+_0x535965(0x1c3)+_0x338ad0+'\x27');}else console[_0x535965(0x263)]('✔\x20No\x20changes\x20-\x20\x27'+_0x338ad0+'\x27\x20is\x20up\x20to\x20date');}const _0x534ba9=await withSpinner(_0x535965(0x2d3)+_0x14a9af+'\x27...',()=>_0x5927db[_0x535965(0x2bc)]['runParent'](_0x14a9af),{'verbose':_0x518372['verbose']}),_0x103d24=_0x534ba9[_0x535965(0x2ad)],_0x5c1aa0=getConsoleUrl(_0x518372[_0x535965(0x20b)],_0x535965(0x31c)+_0x103d24[_0x535965(0x267)]+'/sessions/'+_0x103d24[_0x535965(0x3a8)]+'/attempt/'+_0x103d24[_0x535965(0x245)]);return console[_0x535965(0x263)](_0x535965(0x1e1)),console[_0x535965(0x263)]('\x20\x20'+a31_0x341876[_0x535965(0x284)](_0x535965(0x38a))+'\x20'+_0x103d24['audienceId']),console['error']('\x20\x20'+a31_0x341876['dim']('Status:')+'\x20'+_0x103d24[_0x535965(0x26c)]),console[_0x535965(0x263)]('\x20\x20'+a31_0x341876[_0x535965(0x284)](_0x535965(0x214))+'\x20'+_0x103d24[_0x535965(0x3a8)]),console[_0x535965(0x263)]('\x20\x20'+a31_0x341876['dim'](_0x535965(0x3af))+'\x20'+_0x103d24['workflowAttemptId']),console[_0x535965(0x263)]('\x20\x20'+_0x5c1aa0),console[_0x535965(0x263)]('\x0a'+a31_0x341876['dim'](_0x535965(0x2fd))+_0x535965(0x1f0)+_0x103d24['workflowAttemptId']+_0x535965(0x3ae)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x2d7);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x356);async[a31_0x18a3da(0x351)](_0x2aa49a){const _0x2d8d2a=a31_0x18a3da,{options:_0x5936dc,args:_0x1b282a,tdx:_0x1c430b}=_0x2aa49a,_0x7fd399=_0x1b282a[0x0]||_0x5936dc['parentSegment'];if(!_0x7fd399)return showParentSegmentNotSetError(_0x2d8d2a(0x338)+_0x2d8d2a(0x1f8)),0x1;_0x5936dc[_0x2d8d2a(0x1b5)]&&(console[_0x2d8d2a(0x263)](_0x2d8d2a(0x1f6)+_0x5936dc[_0x2d8d2a(0x20b)]),console[_0x2d8d2a(0x263)](_0x2d8d2a(0x3bb)+_0x7fd399));const _0x389279=await withSpinner(_0x2d8d2a(0x24b)+_0x7fd399+_0x2d8d2a(0x34e),()=>_0x1c430b['segment'][_0x2d8d2a(0x1fe)](_0x7fd399),{'verbose':_0x5936dc[_0x2d8d2a(0x1b5)]}),_0x5448ac=_0x389279[_0x2d8d2a(0x2ad)];console[_0x2d8d2a(0x263)](_0x2d8d2a(0x306)+_0x5448ac[_0x2d8d2a(0x37d)]+'\x20field'+(_0x5448ac['length']!==0x1?'s':''));if(_0x5936dc['json']||_0x5936dc[_0x2d8d2a(0x395)])return await handleSDKOutput(_0x5448ac,_0x5936dc),0x0;return displayFieldsHumanReadable(_0x5448ac,_0x7fd399),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x2ce);[a31_0x18a3da(0x2dd)]='Show\x20parent\x20segment\x20details';async[a31_0x18a3da(0x351)](_0x4b2751){const _0xcc1667=a31_0x18a3da,{options:_0x924e09,args:_0x316f79,tdx:_0x122e50}=_0x4b2751,_0x5a8abf=_0x924e09,_0xc6ab3a=_0x316f79[0x0]||_0x924e09[_0xcc1667(0x29d)];if(!_0xc6ab3a)return showParentSegmentNotSetError(_0xcc1667(0x32b)+_0xcc1667(0x1e3)+_0xcc1667(0x380)+_0xcc1667(0x2e3)),0x1;_0x924e09[_0xcc1667(0x1b5)]&&(console['error'](_0xcc1667(0x1f6)+_0x924e09[_0xcc1667(0x20b)]),console[_0xcc1667(0x263)](_0xcc1667(0x3bb)+_0xc6ab3a));const _0x2e133e=await withSpinner(_0xcc1667(0x1af)+_0xc6ab3a+_0xcc1667(0x34e),()=>_0x122e50[_0xcc1667(0x2bc)][_0xcc1667(0x24f)](_0xc6ab3a),{'verbose':_0x924e09['verbose']}),_0x390882=_0x2e133e[_0xcc1667(0x2ad)];if(_0x5a8abf[_0xcc1667(0x28f)]){const _0x529396=getConsoleNextUrl(_0x5a8abf[_0xcc1667(0x20b)],'/app/dw/parentSegments/'+_0x390882['id']);return console[_0xcc1667(0x263)](a31_0x341876[_0xcc1667(0x297)]('✔')+_0xcc1667(0x33d)+a31_0x341876[_0xcc1667(0x293)](_0x529396)),openBrowser(_0x529396),0x0;}return await handleSingleObjectOutput(_0x390882,_0x924e09),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x2a4);[a31_0x18a3da(0x2dd)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a31_0x18a3da(0x351)](_0x220c16){const _0x1d2591=a31_0x18a3da,{options:_0x45aadf,args:_0x2d10a4,tdx:_0x3a0285}=_0x220c16,_0x2db248=_0x45aadf,_0x56e1f6=_0x2d10a4[0x0]||_0x45aadf[_0x1d2591(0x29d)];if(!_0x56e1f6)return showParentSegmentNotSetError(_0x1d2591(0x242)+_0x1d2591(0x37e)+_0x1d2591(0x380)+_0x1d2591(0x223)),0x1;_0x45aadf[_0x1d2591(0x1b5)]&&(console[_0x1d2591(0x263)](_0x1d2591(0x1f6)+_0x45aadf[_0x1d2591(0x20b)]),console[_0x1d2591(0x263)]('Parent\x20segment:\x20'+_0x56e1f6));const _0x124b07=await withSpinner(_0x1d2591(0x300)+_0x56e1f6+_0x1d2591(0x34e),()=>_0x3a0285[_0x1d2591(0x2bc)][_0x1d2591(0x3b5)](_0x56e1f6),{'verbose':_0x45aadf[_0x1d2591(0x1b5)]}),_0x4a6f0e=_0x124b07[_0x1d2591(0x2ad)],_0x9c409b=_0x3a0285[_0x1d2591(0x2bc)][_0x1d2591(0x2fa)](_0x4a6f0e);if(_0x2db248['output']){const _0x4b1db6=await this[_0x1d2591(0x371)](_0x220c16,_0x56e1f6,_0x4a6f0e,_0x9c409b),_0x499d88=this[_0x1d2591(0x3b2)](_0x4b1db6);writeFileSync(_0x2db248['output'],_0x499d88);const _0x4470b7=_0x4b1db6[_0x1d2591(0x20a)]['columns'][_0x1d2591(0x37d)]+_0x4b1db6[_0x1d2591(0x3b0)]['reduce']((_0x135693,_0xf7f10)=>_0x135693+_0xf7f10[_0x1d2591(0x34c)][_0x1d2591(0x37d)],0x0),_0x4fefc5=_0x4b1db6['behaviors'][_0x1d2591(0x2f3)](_0x2ba77e=>_0x2ba77e[_0x1d2591(0x34c)][_0x1d2591(0x37d)]===0x0)[_0x1d2591(0x37d)];return console[_0x1d2591(0x36f)](_0x1d2591(0x323)+_0x2db248[_0x1d2591(0x23b)]),console[_0x1d2591(0x36f)](_0x1d2591(0x268)+_0x9c409b),console[_0x1d2591(0x36f)](_0x1d2591(0x30e)+_0x4b1db6[_0x1d2591(0x3b0)][_0x1d2591(0x37d)]+_0x1d2591(0x38f)),console[_0x1d2591(0x36f)]('\x20\x20Columns:\x20'+_0x4470b7+_0x1d2591(0x222)),_0x4fefc5>0x0&&console[_0x1d2591(0x36f)](_0x1d2591(0x34a)+_0x4fefc5+_0x1d2591(0x2b7)),0x0;}console[_0x1d2591(0x263)]('\x0a'+a31_0x341876[_0x1d2591(0x3a3)](_0x1d2591(0x3a5))+'\x20'+a31_0x341876[_0x1d2591(0x293)](_0x9c409b));const _0x30af3d=await withSpinner(_0x1d2591(0x35d),()=>_0x3a0285[_0x1d2591(0x2bc)]['getParentSQL'](_0x4a6f0e),{'verbose':_0x45aadf['verbose']});console[_0x1d2591(0x263)]('\x0a'+a31_0x341876[_0x1d2591(0x3a3)](_0x1d2591(0x20a))+'\x20'+a31_0x341876['dim']('('+_0x9c409b+_0x1d2591(0x349)));const _0x2a836c=await executeSchemaQuery(_0x30af3d[_0x1d2591(0x2ad)],_0x3a0285,_0x45aadf);await handleQueryOutput(_0x2a836c,_0x45aadf);const _0x5ca6aa=await withSpinner(_0x1d2591(0x1cc),()=>_0x3a0285[_0x1d2591(0x2bc)][_0x1d2591(0x33c)](_0x4a6f0e),{'verbose':_0x45aadf[_0x1d2591(0x1b5)]});for(const _0x37770f of _0x5ca6aa['data']){const _0x51a036=_0x1d2591(0x1a2)+_0x37770f['toLowerCase']()[_0x1d2591(0x27d)](/\s+/g,'_'),_0x31b82c=_0x1d2591(0x30f)+_0x9c409b+'.'+_0x51a036;console[_0x1d2591(0x263)]('\x0a'+a31_0x341876[_0x1d2591(0x3a3)](_0x37770f)+'\x20'+a31_0x341876['dim']('('+_0x9c409b+'.'+_0x51a036+')'));try{const _0x36b204=await executeSchemaQuery(_0x31b82c,_0x3a0285,_0x45aadf);await handleQueryOutput(_0x36b204,_0x45aadf);}catch{console['error'](a31_0x341876[_0x1d2591(0x1ec)]('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a31_0x18a3da(0x371)](_0xa12d11,_0x1cfb8d,_0x140b3b,_0x21bd46){const _0x17d0ea=a31_0x18a3da,{options:_0x1a8e9b,tdx:_0x53f763}=_0xa12d11,_0x2a279a=await withSpinner(_0x17d0ea(0x35d),()=>_0x53f763['segment'][_0x17d0ea(0x3a1)](_0x140b3b),{'verbose':_0x1a8e9b['verbose']}),_0x3ea87d=await executeSchemaQuery(_0x2a279a['data'],_0x53f763,_0x1a8e9b),_0x55b031=_0x3ea87d[_0x17d0ea(0x2ad)][_0x17d0ea(0x244)](_0x225572=>({'name':_0x225572['column_name'],'type':_0x225572['column_type']})),_0x1829fc=await withSpinner(_0x17d0ea(0x1cc),()=>_0x53f763[_0x17d0ea(0x2bc)][_0x17d0ea(0x33c)](_0x140b3b),{'verbose':_0x1a8e9b[_0x17d0ea(0x1b5)]}),_0x25cf42=[];for(const _0x1b5722 of _0x1829fc[_0x17d0ea(0x2ad)]){const _0xa95f92=_0x17d0ea(0x1a2)+_0x1b5722['toLowerCase']()[_0x17d0ea(0x27d)](/\s+/g,'_'),_0x2aed7f='SELECT\x20*\x20FROM\x20'+_0x21bd46+'.'+_0xa95f92;let _0x20850b=[];try{const _0x3ee1e3=await executeSchemaQuery(_0x2aed7f,_0x53f763,_0x1a8e9b);_0x20850b=_0x3ee1e3[_0x17d0ea(0x2ad)]['map'](_0xf52547=>({'name':_0xf52547[_0x17d0ea(0x1e6)],'type':_0xf52547['column_type']}));}catch{}_0x25cf42[_0x17d0ea(0x2a1)]({'table':_0xa95f92,'columns':_0x20850b});}return{'database':_0x21bd46,'parent_segment':_0x1cfb8d,'parent_id':_0x140b3b,'customers':{'table':_0x17d0ea(0x20a),'columns':_0x55b031},'behaviors':_0x25cf42};}[a31_0x18a3da(0x3b2)](_0x2f5b6e){const _0x507a64=a31_0x18a3da,_0x2e12e0=_0x49217e=>{const _0x4bf199=a31_0x3c2e;if(_0x49217e[_0x4bf199(0x37d)]===0x0)return'[]';const _0x47f468=_0x49217e[_0x4bf199(0x244)](_0x481d0=>_0x4bf199(0x3b1)+_0x481d0['name']+_0x4bf199(0x29e)+_0x481d0[_0x4bf199(0x278)]+'\x22\x20}');return'[\x0a'+_0x47f468[_0x4bf199(0x2fb)](',\x0a')+_0x4bf199(0x291);},_0x3ec1dd=_0x2f5b6e[_0x507a64(0x3b0)][_0x507a64(0x244)](_0x31d296=>{const _0x4933a3=_0x507a64;return _0x4933a3(0x1ca)+_0x31d296[_0x4933a3(0x228)]+_0x4933a3(0x37c)+_0x2e12e0(_0x31d296[_0x4933a3(0x34c)])[_0x4933a3(0x27d)](/^/gm,'\x20\x20')[_0x4933a3(0x22b)]()+_0x4933a3(0x29b);})[_0x507a64(0x2fb)](',\x0a');return _0x507a64(0x365)+_0x2f5b6e['database']+_0x507a64(0x1cf)+_0x2f5b6e[_0x507a64(0x25a)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x2f5b6e[_0x507a64(0x1fd)]+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x2f5b6e['customers']['table']+_0x507a64(0x1ed)+_0x2e12e0(_0x2f5b6e[_0x507a64(0x20a)][_0x507a64(0x34c)])[_0x507a64(0x27d)](/^/gm,'\x20\x20')[_0x507a64(0x22b)]()+_0x507a64(0x3a0)+_0x3ec1dd+_0x507a64(0x308);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']='segment:parent:sql';[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x399);async[a31_0x18a3da(0x351)](_0xf4b9d8){const _0x388b97=a31_0x18a3da,{options:_0xcc3bac,args:_0x2662eb,tdx:_0x546a12}=_0xf4b9d8,_0x3b1dcd=_0x2662eb[0x0]||_0xcc3bac['parentSegment'];if(!_0x3b1dcd)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x388b97(0x26f)),0x1;_0xcc3bac[_0x388b97(0x1b5)]&&(console[_0x388b97(0x263)](_0x388b97(0x1f6)+_0xcc3bac[_0x388b97(0x20b)]),console['error'](_0x388b97(0x3bb)+_0x3b1dcd));const _0x4a104a=await withSpinner(_0x388b97(0x300)+_0x3b1dcd+_0x388b97(0x34e),()=>_0x546a12[_0x388b97(0x2bc)][_0x388b97(0x3b5)](_0x3b1dcd),{'verbose':_0xcc3bac[_0x388b97(0x1b5)]}),_0x4851f2=_0x4a104a[_0x388b97(0x2ad)],_0x512583=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x3b1dcd+_0x388b97(0x34e),()=>_0x546a12['segment'][_0x388b97(0x3a1)](_0x4851f2),{'verbose':_0xcc3bac[_0x388b97(0x1b5)]}),_0x16b450=_0x512583[_0x388b97(0x2ad)];return _0xcc3bac[_0x388b97(0x1c0)]===_0x388b97(0x305)||_0xcc3bac['format']===_0x388b97(0x395)?await handleSDKOutput([{'sql':_0x16b450}],_0xcc3bac):console[_0x388b97(0x36f)](_0x16b450),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x1fa);['description']=a31_0x18a3da(0x32a);async[a31_0x18a3da(0x351)](_0x360bc7){const _0x270e89=a31_0x18a3da,{options:_0x1e8b34,args:_0x2ebf48,tdx:_0x53a722}=_0x360bc7,_0x3a7aea=_0x2ebf48[0x0]||_0x1e8b34[_0x270e89(0x29d)];if(!_0x3a7aea)return showParentSegmentNotSetError(_0x270e89(0x31e)+_0x270e89(0x304)),0x1;_0x1e8b34[_0x270e89(0x1b5)]&&(console[_0x270e89(0x263)](_0x270e89(0x1f6)+_0x1e8b34['site']),console[_0x270e89(0x263)]('Parent\x20segment:\x20'+_0x3a7aea));const _0x9805ca=await withSpinner(_0x270e89(0x300)+_0x3a7aea+_0x270e89(0x34e),()=>_0x53a722[_0x270e89(0x2bc)][_0x270e89(0x3b5)](_0x3a7aea),{'verbose':_0x1e8b34[_0x270e89(0x1b5)]}),_0x266bf1=_0x9805ca[_0x270e89(0x2ad)],_0x4e9617=await withSpinner(_0x270e89(0x2ef)+_0x3a7aea+_0x270e89(0x34e),()=>_0x53a722[_0x270e89(0x2bc)][_0x270e89(0x3a1)](_0x266bf1),{'verbose':_0x1e8b34[_0x270e89(0x1b5)]});let _0x534376=_0x4e9617['data'];const _0x17ba00=resolveLimit(_0x1e8b34[_0x270e89(0x1a8)],DEFAULT_DISPLAY_LIMIT),_0x4864d5=/\bLIMIT\s+\d+/i[_0x270e89(0x269)](_0x534376);!_0x4864d5&&(_0x534376=_0x534376[_0x270e89(0x22b)]()[_0x270e89(0x27d)](/;+$/,''),_0x534376='SELECT\x20*\x20FROM\x20(\x0a'+_0x534376+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x17ba00);_0x1e8b34[_0x270e89(0x1b5)]&&console[_0x270e89(0x263)](_0x270e89(0x1b2)+_0x534376);const _0x42f3a1=await withProgressSpinner(_0x270e89(0x1a3),async _0x4f26cd=>{const _0x5787d1=_0x270e89,_0x17ff8b=await _0x53a722['query'][_0x5787d1(0x351)](_0x534376,{'catalog':'td','schema':'information_schema','onJobId':_0x4a4883=>{const _0xd374ce=_0x5787d1;_0x4f26cd[_0xd374ce(0x2d8)](_0x4a4883);}});return _0x17ff8b;},{'verbose':_0x1e8b34[_0x270e89(0x1b5)]}),_0x48343e=_0x42f3a1['data'],_0x111c60=_0x48343e[_0x270e89(0x220)]?'\x20[Job\x20ID:\x20'+_0x48343e['jobId']+']':'';return console[_0x270e89(0x263)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x48343e[_0x270e89(0x2e5)][_0x270e89(0x39c)][_0x270e89(0x2ca)]()+_0x270e89(0x21f)+('in\x20'+formatElapsed(_0x48343e[_0x270e89(0x2e5)][_0x270e89(0x224)])+_0x111c60)),await handleQueryOutput(_0x48343e,_0x1e8b34),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x23d);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x337);async['execute'](_0x5a408a){const _0x4725d2=a31_0x18a3da,{options:_0xca3642,args:_0x125c41,tdx:_0x353921}=_0x5a408a,_0x58652e=_0x125c41[0x0],_0x431607=await withSpinner(_0x58652e?_0x4725d2(0x1e4)+_0x58652e+_0x4725d2(0x34e):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x353921[_0x4725d2(0x27f)][_0x4725d2(0x29f)](),{'verbose':_0xca3642['verbose']});let _0x48dc35=_0x431607[_0x4725d2(0x2ad)]['filter'](_0x58566f=>_0x58566f[_0x4725d2(0x26a)]);if(_0x58652e){const _0x2950d3=_0x58652e[_0x4725d2(0x27d)](/[.+^${}()|[\]\\]/g,_0x4725d2(0x2e0))[_0x4725d2(0x27d)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x36d528=new RegExp('^'+_0x2950d3+'$','i');_0x48dc35=_0x48dc35[_0x4725d2(0x2f3)](_0x54575f=>_0x36d528[_0x4725d2(0x269)](_0x54575f['name']));}_0x48dc35[_0x4725d2(0x279)]((_0x237aba,_0x45c0ee)=>_0x237aba[_0x4725d2(0x1bd)][_0x4725d2(0x294)](_0x45c0ee[_0x4725d2(0x1bd)])),console['error']('✔\x20Found\x20'+_0x48dc35['length']+'\x20RT-enabled\x20parent\x20segment'+(_0x48dc35[_0x4725d2(0x37d)]!==0x1?'s':''));const _0x756294=_0x2386a9=>{const _0x5a5f9b=_0x4725d2;return getConsoleNextUrl(_0xca3642[_0x5a5f9b(0x20b)],_0x5a5f9b(0x2c9)+_0x2386a9);};if(_0xca3642[_0x4725d2(0x1c0)]===_0x4725d2(0x305)||_0xca3642[_0x4725d2(0x1c0)]==='jsonl'){const _0x54d2e5=_0x48dc35['map'](_0x4b3bdb=>({..._0x4b3bdb,'url':_0x756294(_0x4b3bdb['id'])}));await handleSDKOutput(_0x54d2e5,_0xca3642);}else{if(_0x48dc35[_0x4725d2(0x37d)]===0x0)console[_0x4725d2(0x36f)](_0x4725d2(0x1f1));else for(const _0x3ae9d9 of _0x48dc35){const _0x42554c=_0x3ae9d9['population']?a31_0x341876[_0x4725d2(0x284)]('\x20('+formatRows(_0x3ae9d9['population'])+')'):'',_0x276647=hyperlink(_0x3ae9d9[_0x4725d2(0x1bd)],_0x756294(_0x3ae9d9['id']));console[_0x4725d2(0x36f)]('⚡\x20'+_0x276647+_0x42554c);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x18a3da(0x1d7);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x2c2);async[a31_0x18a3da(0x351)](_0x5c43cd){const _0x47e12f=a31_0x18a3da,{options:_0x2ca692,args:_0x978b47,tdx:_0x358b67}=_0x5c43cd,_0x4bd681=_0x978b47[0x0]||_0x2ca692[_0x47e12f(0x29d)];if(!_0x4bd681)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a'+_0x47e12f(0x1bc)),0x1;const _0x4e992f=resolveYamlFile(_0x4bd681);if(!existsSync(_0x4e992f))return showFileNotFoundError(_0x4e992f,_0x4bd681),0x1;let _0x5d0640;try{_0x5d0640=readFileSync(_0x4e992f,_0x47e12f(0x36c));}catch(_0x5c2657){const _0x332565=_0x5c2657 instanceof Error?_0x5c2657[_0x47e12f(0x39d)]:String(_0x5c2657);return console[_0x47e12f(0x263)](_0x47e12f(0x226)+_0x332565),0x1;}const _0x87301e=createCommandSpinner(a31_0x341876[_0x47e12f(0x284)](_0x47e12f(0x391)),{'verbose':_0x2ca692[_0x47e12f(0x1b5)]});_0x87301e[_0x47e12f(0x33b)]();const _0x454f60={'realtime':!![],'onProgress':_0xb1c99e=>{const _0x5df201=_0x47e12f;_0x87301e[_0x5df201(0x3b6)]=formatProgressMessage(_0xb1c99e);}};let _0xb27be0;try{_0xb27be0=await _0x358b67[_0x47e12f(0x2bc)][_0x47e12f(0x332)](_0x5d0640,_0x454f60),_0x87301e[_0x47e12f(0x218)]();}catch(_0x9b430d){_0x87301e[_0x47e12f(0x218)]();throw _0x9b430d;}console[_0x47e12f(0x263)]('\x0a'+a31_0x341876[_0x47e12f(0x3a3)]('RT\x202.0\x20Validate:')+'\x20'+_0xb27be0['name']),console[_0x47e12f(0x263)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0xb27be0),console['error']('─'[_0x47e12f(0x1b4)](0x3c));if(_0xb27be0['errors'][_0x47e12f(0x37d)]>0x0){console[_0x47e12f(0x263)]('\x0a'+a31_0x341876[_0x47e12f(0x29a)]('Errors:'));for(const _0x2911e4 of _0xb27be0[_0x47e12f(0x310)]){console[_0x47e12f(0x263)]('\x20\x20'+a31_0x341876['red']('•')+'\x20'+_0x2911e4);}}return _0xb27be0[_0x47e12f(0x383)]&&console[_0x47e12f(0x263)]('\x0a'+a31_0x341876['green']('✔')+_0x47e12f(0x2a5)),_0xb27be0[_0x47e12f(0x383)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]='ps:rt:jn:list';[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x37b);async['execute'](_0x5db28b){const _0x489396=a31_0x18a3da,{options:_0x10195f,args:_0x50a3a7,tdx:_0x2bdb1d}=_0x5db28b,_0x426581=_0x50a3a7[0x0]||_0x10195f[_0x489396(0x29d)];if(!_0x426581)return showParentSegmentNotSetError(_0x489396(0x1cd)+_0x489396(0x23a)),0x1;_0x10195f[_0x489396(0x1b5)]&&(console['error'](_0x489396(0x1f6)+_0x10195f[_0x489396(0x20b)]),console[_0x489396(0x263)](_0x489396(0x3bb)+_0x426581));const _0x1c0f6a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x426581+_0x489396(0x34e),()=>_0x2bdb1d[_0x489396(0x2bc)][_0x489396(0x3b5)](_0x426581),{'verbose':_0x10195f['verbose']}),_0x23c409=_0x1c0f6a[_0x489396(0x2ad)],_0x10f6c1=await withSpinner(_0x489396(0x369)+_0x426581+_0x489396(0x34e),()=>_0x2bdb1d[_0x489396(0x27f)]['listJourneys'](_0x23c409),{'verbose':_0x10195f[_0x489396(0x1b5)]}),_0x13782c=_0x10f6c1[_0x489396(0x2ad)];console['error'](_0x489396(0x306)+_0x13782c[_0x489396(0x37d)]+_0x489396(0x2e1)+(_0x13782c[_0x489396(0x37d)]!==0x1?'s':''));if(_0x10195f['format']==='json'||_0x10195f[_0x489396(0x1c0)]===_0x489396(0x395))await handleSDKOutput(_0x13782c,_0x10195f);else{if(_0x13782c[_0x489396(0x37d)]===0x0)console['log'](_0x489396(0x377));else for(const _0x5d79eb of _0x13782c){const _0x2d709b=_0x5d79eb[_0x489396(0x1ef)]===_0x489396(0x34f)?'🚀':'📝',_0x388be6=_0x5d79eb[_0x489396(0x1d2)]?a31_0x341876['yellow'](_0x489396(0x312)):'',_0x40da8e=a31_0x341876['dim']('\x20('+_0x5d79eb[_0x489396(0x273)]+'\x20stage'+(_0x5d79eb[_0x489396(0x273)]!==0x1?'s':'')+')');console[_0x489396(0x36f)](_0x2d709b+'\x20'+_0x5d79eb[_0x489396(0x1bd)]+_0x388be6+_0x40da8e);}}return 0x0;}}function a31_0x3c2e(_0xebbeef,_0x3008c8){_0xebbeef=_0xebbeef-0x1a2;const _0x5c03ca=a31_0x5c03();let _0x3c2e01=_0x5c03ca[_0xebbeef];return _0x3c2e01;}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x298);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x333);async[a31_0x18a3da(0x351)](_0x567162){const _0x2db05a=a31_0x18a3da,{options:_0x21caf4,args:_0x5645d6,tdx:_0x4cdabd}=_0x567162,_0x41f725=_0x5645d6[0x0];if(!_0x41f725)return console['error'](a31_0x341876[_0x2db05a(0x29a)](_0x2db05a(0x1f7))),console[_0x2db05a(0x263)](_0x2db05a(0x38b)),console['error'](a31_0x341876[_0x2db05a(0x284)](_0x2db05a(0x2c3))),0x1;_0x21caf4['verbose']&&(console[_0x2db05a(0x263)]('Site:\x20'+_0x21caf4['site']),console[_0x2db05a(0x263)](_0x2db05a(0x1b6)+_0x41f725));const _0x2df7f8=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x41f725+_0x2db05a(0x34e),()=>_0x4cdabd[_0x2db05a(0x27f)][_0x2db05a(0x1c8)](_0x41f725),{'verbose':_0x21caf4[_0x2db05a(0x1b5)]}),_0x23d928=_0x2df7f8['data'];console[_0x2db05a(0x263)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x23d928[_0x2db05a(0x1bd)]+'\x27');if(_0x21caf4[_0x2db05a(0x1c0)]===_0x2db05a(0x305)||_0x21caf4[_0x2db05a(0x1c0)]==='jsonl')await handleSDKOutput([_0x23d928],_0x21caf4);else{const _0x9f548d=_0x23d928['state']==='launched'?'🚀':'📝',_0x407ca9=_0x23d928[_0x2db05a(0x1d2)]?a31_0x341876[_0x2db05a(0x1ec)](_0x2db05a(0x312)):'';console[_0x2db05a(0x36f)](_0x9f548d+'\x20'+_0x23d928[_0x2db05a(0x1bd)]+_0x407ca9);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x36b);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x259);async[a31_0x18a3da(0x351)](_0x3a5205){const _0x9cf302=a31_0x18a3da,{options:_0x5320f1,args:_0x173e8b,tdx:_0x291318}=_0x3a5205,_0x1f70dc=_0x173e8b[0x0];if(!_0x1f70dc)return console['error'](a31_0x341876[_0x9cf302(0x29a)](_0x9cf302(0x1f7))),console[_0x9cf302(0x263)](_0x9cf302(0x368)),console[_0x9cf302(0x263)](a31_0x341876[_0x9cf302(0x284)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x5320f1['verbose']&&(console[_0x9cf302(0x263)](_0x9cf302(0x1f6)+_0x5320f1[_0x9cf302(0x20b)]),console['error'](_0x9cf302(0x1b6)+_0x1f70dc));const _0x23f508=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1f70dc+_0x9cf302(0x34e),()=>_0x291318[_0x9cf302(0x27f)][_0x9cf302(0x37a)](_0x1f70dc),{'verbose':_0x5320f1[_0x9cf302(0x1b5)]}),_0x1a1936=_0x23f508['data'];console['error']('✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1a1936[_0x9cf302(0x1bd)]+'\x27');if(_0x5320f1[_0x9cf302(0x1c0)]===_0x9cf302(0x305)||_0x5320f1[_0x9cf302(0x1c0)]==='jsonl')await handleSDKOutput([_0x1a1936],_0x5320f1);else{const _0x479f6b=_0x1a1936[_0x9cf302(0x1ef)]===_0x9cf302(0x34f)?'🚀':'📝',_0x3c83f6=_0x1a1936[_0x9cf302(0x1d2)]?a31_0x341876['yellow'](_0x9cf302(0x312)):'';console[_0x9cf302(0x36f)](_0x479f6b+'\x20'+_0x1a1936[_0x9cf302(0x1bd)]+_0x3c83f6);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']=a31_0x18a3da(0x28b);['description']=a31_0x18a3da(0x1c9);async[a31_0x18a3da(0x351)](_0x522af2){const _0xcd093c=a31_0x18a3da,{options:_0x3beaeb,args:_0x50e314,tdx:_0x3867bf}=_0x522af2,_0x488b89=_0x50e314[0x0]||_0x3beaeb[_0xcd093c(0x29d)];if(!_0x488b89)return showParentSegmentNotSetError(_0xcd093c(0x23c)+_0xcd093c(0x372)),0x1;_0x3beaeb[_0xcd093c(0x1b5)]&&(console['error'](_0xcd093c(0x1f6)+_0x3beaeb[_0xcd093c(0x20b)]),console[_0xcd093c(0x263)]('Parent\x20segment:\x20'+_0x488b89));const _0x4c5f8e=await withSpinner(_0xcd093c(0x300)+_0x488b89+_0xcd093c(0x34e),()=>_0x3867bf[_0xcd093c(0x2bc)][_0xcd093c(0x3b5)](_0x488b89),{'verbose':_0x3beaeb[_0xcd093c(0x1b5)]}),_0x105f44=_0x4c5f8e['data'],_0x21fa31=await withSpinner('Getting\x20RT\x20configuration\x20version\x20for\x20\x27'+_0x488b89+_0xcd093c(0x34e),()=>_0x3867bf['realtime']['getCurrentConfigVersion'](_0x105f44),{'verbose':_0x3beaeb[_0xcd093c(0x1b5)]}),_0x171de9=_0x21fa31[_0xcd093c(0x2ad)];return console[_0xcd093c(0x263)](_0xcd093c(0x243)),_0x3beaeb[_0xcd093c(0x1c0)]===_0xcd093c(0x305)||_0x3beaeb['format']==='jsonl'?await handleSDKOutput([_0x171de9],_0x3beaeb):(console[_0xcd093c(0x36f)](_0xcd093c(0x35c)+_0x171de9['id']),console[_0xcd093c(0x36f)](_0xcd093c(0x33f)+_0x171de9[_0xcd093c(0x27a)]),console[_0xcd093c(0x36f)](_0xcd093c(0x286)+_0x171de9[_0xcd093c(0x39f)]),console['log'](_0xcd093c(0x2e8)+_0x171de9['eventKind']),console[_0xcd093c(0x36f)](_0xcd093c(0x1b7)+_0x171de9['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]='ps:pz:service:list';[a31_0x18a3da(0x2dd)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async[a31_0x18a3da(0x351)](_0x2b717e){const _0x30dd45=a31_0x18a3da,{options:_0x2c6cf1,args:_0x5a0aae,tdx:_0x2456dc}=_0x2b717e,_0x1d7683=_0x5a0aae[0x0]||_0x2c6cf1[_0x30dd45(0x29d)];if(!_0x1d7683)return showParentSegmentNotSetError(_0x30dd45(0x30b)+_0x30dd45(0x2bd)),0x1;const _0x2b0db7=await withSpinner(_0x30dd45(0x300)+_0x1d7683+_0x30dd45(0x34e),()=>_0x2456dc['segment']['resolveParentId'](_0x1d7683),{'verbose':_0x2c6cf1['verbose']}),_0x15cbd6=_0x2b0db7[_0x30dd45(0x2ad)],_0xc350d2=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x1d7683+_0x30dd45(0x34e),()=>_0x2456dc['personalization'][_0x30dd45(0x29f)](_0x15cbd6),{'verbose':_0x2c6cf1[_0x30dd45(0x1b5)]}),_0x13fb72=_0xc350d2['data'];console[_0x30dd45(0x263)](_0x30dd45(0x306)+_0x13fb72['length']+_0x30dd45(0x240)+(_0x13fb72[_0x30dd45(0x37d)]!==0x1?'s':''));if(_0x2c6cf1['format']===_0x30dd45(0x305)||_0x2c6cf1[_0x30dd45(0x1c0)]===_0x30dd45(0x395))await handleSDKOutput(_0x13fb72,_0x2c6cf1);else{if(_0x13fb72[_0x30dd45(0x37d)]===0x0)console[_0x30dd45(0x36f)](_0x30dd45(0x1d0)),console[_0x30dd45(0x263)](a31_0x341876[_0x30dd45(0x293)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x2211ce of _0x13fb72){console[_0x30dd45(0x36f)](a31_0x341876[_0x30dd45(0x3a3)](_0x2211ce[_0x30dd45(0x1bd)])+'\x20'+a31_0x341876['dim'](_0x30dd45(0x1d5)+_0x2211ce['id']+')'));_0x2211ce[_0x30dd45(0x2dd)]&&console['log']('\x20\x20'+a31_0x341876[_0x30dd45(0x284)](_0x2211ce[_0x30dd45(0x2dd)]));if(_0x2211ce[_0x30dd45(0x36e)]&&_0x2211ce[_0x30dd45(0x36e)]['length']>0x0)for(const _0x3f64b1 of _0x2211ce['tokens']){const _0x2fd47c=_0x3f64b1[_0x30dd45(0x1d8)]?.[_0x30dd45(0x37d)]?_0x3f64b1[_0x30dd45(0x1d8)][_0x30dd45(0x2fb)](',\x20'):_0x30dd45(0x1bb);console[_0x30dd45(0x36f)]('\x20\x20'+a31_0x341876[_0x30dd45(0x293)](_0x30dd45(0x373))+'\x20'+_0x3f64b1[_0x30dd45(0x1bd)]+'\x20'+a31_0x341876[_0x30dd45(0x284)](_0x30dd45(0x1d5)+_0x3f64b1['id']+')')),console['log'](_0x30dd45(0x382)+a31_0x341876[_0x30dd45(0x284)]('allowed\x20IPs:')+'\x20'+_0x2fd47c);}else console['log']('\x20\x20'+a31_0x341876[_0x30dd45(0x284)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x1f9);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x209);async[a31_0x18a3da(0x351)](_0x1973f8){const _0x475fde=a31_0x18a3da,{options:_0x1c6f98,args:_0x4eabc4,tdx:_0x40108e}=_0x1973f8,_0x165445=_0x1c6f98,_0x28028e=_0x4eabc4[0x0],_0xaf1f2c=_0x4eabc4[0x1]||_0x1c6f98[_0x475fde(0x29d)];if(!_0x28028e)return console[_0x475fde(0x263)]('Error:\x20Service\x20name\x20is\x20required'),console[_0x475fde(0x263)](_0x475fde(0x249)),console['error'](_0x475fde(0x232)),0x1;if(!_0xaf1f2c)return showParentSegmentNotSetError(_0x475fde(0x2cf)+_0x475fde(0x232)),0x1;const _0xea4717=await withSpinner(_0x475fde(0x300)+_0xaf1f2c+_0x475fde(0x34e),()=>_0x40108e['segment'][_0x475fde(0x3b5)](_0xaf1f2c),{'verbose':_0x1c6f98['verbose']}),_0x16b0c3=_0xea4717[_0x475fde(0x2ad)],_0x144c1a={'name':_0x28028e,'description':_0x165445[_0x475fde(0x2dd)],'public':_0x165445[_0x475fde(0x3b9)]},_0x119af5=await withSpinner(_0x475fde(0x1a9)+_0x28028e+'\x27...',()=>_0x40108e[_0x475fde(0x2ab)][_0x475fde(0x2c8)](_0x16b0c3,_0x144c1a),{'verbose':_0x1c6f98[_0x475fde(0x1b5)]}),_0x4b4178=_0x119af5[_0x475fde(0x2ad)];return console[_0x475fde(0x263)](_0x475fde(0x200)+_0x4b4178[_0x475fde(0x1bd)]+'\x27\x20with\x20ID:\x20'+_0x4b4178['id']),await handleSDKOutput([_0x4b4178],_0x1c6f98),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x350);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x206);async[a31_0x18a3da(0x351)](_0x19dbb6){const _0x93b9bd=a31_0x18a3da,{options:_0xb718ee,args:_0x4193ff,tdx:_0x4887c5}=_0x19dbb6,_0xb9a92e=_0x4193ff[0x0],_0x52dbb4=_0x4193ff[0x1]||_0xb718ee['parentSegment'];if(!_0xb9a92e)return console[_0x93b9bd(0x263)](_0x93b9bd(0x3a6)),console[_0x93b9bd(0x263)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x93b9bd(0x263)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x52dbb4)return showParentSegmentNotSetError(_0x93b9bd(0x2e2)+_0x93b9bd(0x330)),0x1;const _0x377c73=await withSpinner(_0x93b9bd(0x300)+_0x52dbb4+_0x93b9bd(0x34e),()=>_0x4887c5[_0x93b9bd(0x2bc)][_0x93b9bd(0x3b5)](_0x52dbb4),{'verbose':_0xb718ee['verbose']}),_0x4cddf9=_0x377c73[_0x93b9bd(0x2ad)],_0x22d3d6=await withSpinner(_0x93b9bd(0x1b9)+_0xb9a92e+'\x27...',()=>_0x4887c5['personalization'][_0x93b9bd(0x288)](_0x4cddf9,_0xb9a92e),{'verbose':_0xb718ee[_0x93b9bd(0x1b5)]}),_0x7d4146=_0x22d3d6[_0x93b9bd(0x2ad)];if(_0xb718ee['json']||_0xb718ee[_0x93b9bd(0x395)])await handleSDKOutput([_0x7d4146],_0xb718ee);else{console[_0x93b9bd(0x36f)](a31_0x341876[_0x93b9bd(0x3a3)](_0x7d4146[_0x93b9bd(0x1bd)])+'\x20'+a31_0x341876[_0x93b9bd(0x284)](_0x93b9bd(0x1d5)+_0x7d4146['id']+')'));_0x7d4146[_0x93b9bd(0x2dd)]&&console[_0x93b9bd(0x36f)]('\x20\x20'+a31_0x341876[_0x93b9bd(0x284)](_0x7d4146[_0x93b9bd(0x2dd)]));console[_0x93b9bd(0x36f)]('\x20\x20'+a31_0x341876[_0x93b9bd(0x293)](_0x93b9bd(0x250))+'\x20'+(_0x7d4146['public']?_0x93b9bd(0x370):'no'));if(_0x7d4146[_0x93b9bd(0x36e)]&&_0x7d4146[_0x93b9bd(0x36e)]['length']>0x0)for(const _0x44c0d9 of _0x7d4146[_0x93b9bd(0x36e)]){const _0x32ef29=_0x44c0d9[_0x93b9bd(0x1d8)]?.[_0x93b9bd(0x37d)]?_0x44c0d9[_0x93b9bd(0x1d8)][_0x93b9bd(0x2fb)](',\x20'):_0x93b9bd(0x1bb);console[_0x93b9bd(0x36f)]('\x20\x20'+a31_0x341876[_0x93b9bd(0x293)](_0x93b9bd(0x373))+'\x20'+_0x44c0d9[_0x93b9bd(0x1bd)]+'\x20'+a31_0x341876[_0x93b9bd(0x284)]('(id:\x20'+_0x44c0d9['id']+')')),console[_0x93b9bd(0x36f)](_0x93b9bd(0x382)+a31_0x341876[_0x93b9bd(0x284)](_0x93b9bd(0x252))+'\x20'+_0x32ef29);}else console['log']('\x20\x20'+a31_0x341876[_0x93b9bd(0x284)](_0x93b9bd(0x387)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]='ps:pz:service:delete';[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x22d);async[a31_0x18a3da(0x351)](_0x5adc73){const _0x5372db=a31_0x18a3da,{options:_0x23e159,args:_0x302471,tdx:_0x250deb}=_0x5adc73,_0x43da57=_0x302471[0x0],_0x44100d=_0x302471[0x1]||_0x23e159[_0x5372db(0x29d)];if(!_0x43da57)return console['error'](_0x5372db(0x3a6)),console[_0x5372db(0x263)](_0x5372db(0x390)),console[_0x5372db(0x263)](_0x5372db(0x246)),0x1;if(!_0x44100d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x58e9a3=await withSpinner(_0x5372db(0x300)+_0x44100d+_0x5372db(0x34e),()=>_0x250deb[_0x5372db(0x2bc)][_0x5372db(0x3b5)](_0x44100d),{'verbose':_0x23e159['verbose']}),_0x423033=_0x58e9a3[_0x5372db(0x2ad)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x43da57+_0x5372db(0x34e),()=>_0x250deb[_0x5372db(0x2ab)][_0x5372db(0x1aa)](_0x423033,_0x43da57),{'verbose':_0x23e159['verbose']}),console['error'](_0x5372db(0x271)+_0x43da57+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x2c4);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x326);async['execute'](_0x102142){const _0x95e7f=a31_0x18a3da,{options:_0x10ea80,args:_0x4cd1db,tdx:_0x5829f8}=_0x102142,_0x555781=_0x10ea80,_0x2e0e8c=_0x4cd1db[0x0],_0x29fc86=_0x4cd1db[0x1]||_0x10ea80[_0x95e7f(0x29d)];if(!_0x2e0e8c)return console[_0x95e7f(0x263)](_0x95e7f(0x3a6)),console[_0x95e7f(0x263)](_0x95e7f(0x346)),console[_0x95e7f(0x263)](_0x95e7f(0x2c0)),0x1;if(!_0x555781[_0x95e7f(0x1bd)])return console['error']('Error:\x20--name\x20is\x20required'),console['error'](_0x95e7f(0x346)),0x1;if(!_0x29fc86)return showParentSegmentNotSetError(_0x95e7f(0x38c)+_0x95e7f(0x2c0)),0x1;const _0x19aafe=await withSpinner(_0x95e7f(0x300)+_0x29fc86+_0x95e7f(0x34e),()=>_0x5829f8[_0x95e7f(0x2bc)]['resolveParentId'](_0x29fc86),{'verbose':_0x10ea80[_0x95e7f(0x1b5)]}),_0x47567d=_0x19aafe[_0x95e7f(0x2ad)],_0x2798f4={'name':_0x555781['name']};_0x555781[_0x95e7f(0x2dd)]!==undefined&&(_0x2798f4['description']=_0x555781['description']);const _0x360151=await withSpinner(_0x95e7f(0x336)+_0x2e0e8c+_0x95e7f(0x34e),()=>_0x5829f8[_0x95e7f(0x2ab)][_0x95e7f(0x221)](_0x47567d,_0x2e0e8c,_0x2798f4),{'verbose':_0x10ea80['verbose']}),_0x18aa14=_0x360151[_0x95e7f(0x2ad)];return console[_0x95e7f(0x263)](_0x95e7f(0x1be)+_0x18aa14[_0x95e7f(0x1bd)]+'\x27'),await handleSDKOutput([_0x18aa14],_0x10ea80),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]='ps:pz:service:token:create';[a31_0x18a3da(0x2dd)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a31_0x18a3da(0x351)](_0x554d6d){const _0xf8c6a2=a31_0x18a3da,{options:_0x3ace01,args:_0x3322db,tdx:_0x2cdbcf}=_0x554d6d,_0x4acfe2=_0x3ace01,_0x13938c=_0x3322db[0x0],_0xa6186c=_0x3322db[0x1],_0x420554=_0x3322db[0x2]||_0x3ace01[_0xf8c6a2(0x29d)];if(!_0x13938c)return console[_0xf8c6a2(0x263)](_0xf8c6a2(0x201)),console[_0xf8c6a2(0x263)](_0xf8c6a2(0x385)),console[_0xf8c6a2(0x263)](_0xf8c6a2(0x345)),0x1;if(!_0xa6186c)return console[_0xf8c6a2(0x263)](_0xf8c6a2(0x3a6)),console[_0xf8c6a2(0x263)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console['error'](_0xf8c6a2(0x345)),0x1;if(!_0x420554)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+_0xf8c6a2(0x345)),0x1;const _0x1a67ae=await withSpinner(_0xf8c6a2(0x300)+_0x420554+_0xf8c6a2(0x34e),()=>_0x2cdbcf[_0xf8c6a2(0x2bc)][_0xf8c6a2(0x3b5)](_0x420554),{'verbose':_0x3ace01['verbose']}),_0x5ceb53=_0x1a67ae[_0xf8c6a2(0x2ad)],_0x540124={'name':_0x13938c};_0x4acfe2[_0xf8c6a2(0x1d8)]&&(_0x540124[_0xf8c6a2(0x1d8)]=_0x4acfe2['allowedIps'][_0xf8c6a2(0x2ec)](',')[_0xf8c6a2(0x244)](_0x1e3542=>_0x1e3542[_0xf8c6a2(0x22b)]()));_0x4acfe2[_0xf8c6a2(0x2dd)]&&(_0x540124[_0xf8c6a2(0x2dd)]=_0x4acfe2['description']);const _0x22edaf=await withSpinner(_0xf8c6a2(0x217)+_0x13938c+_0xf8c6a2(0x1c1)+_0xa6186c+_0xf8c6a2(0x34e),()=>_0x2cdbcf['personalization'][_0xf8c6a2(0x2cd)](_0x5ceb53,_0xa6186c,_0x540124),{'verbose':_0x3ace01['verbose']}),_0x51a645=_0x22edaf['data'];return console['error'](_0xf8c6a2(0x234)+_0x51a645['name']+_0xf8c6a2(0x24a)+_0x51a645['id']),_0x51a645[_0xf8c6a2(0x1db)]&&(console[_0xf8c6a2(0x263)](a31_0x341876[_0xf8c6a2(0x1ec)](_0xf8c6a2(0x262))),console['error'](a31_0x341876[_0xf8c6a2(0x293)](_0x51a645['value'])),console[_0xf8c6a2(0x263)]('')),await handleSDKOutput([_0x51a645],_0x3ace01),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x202);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x280);async['execute'](_0x17ce1a){const _0x22dcc6=a31_0x18a3da,{options:_0x10e0a3,args:_0x3e68a8,tdx:_0x5d886a}=_0x17ce1a,_0x32da66=_0x3e68a8[0x0],_0xbd1c05=_0x3e68a8[0x1]||_0x10e0a3[_0x22dcc6(0x29d)];if(!_0x32da66)return console[_0x22dcc6(0x263)](_0x22dcc6(0x1d9)),console[_0x22dcc6(0x263)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x22dcc6(0x263)](_0x22dcc6(0x1bf)),0x1;if(!_0xbd1c05)return showParentSegmentNotSetError(_0x22dcc6(0x2bf)+_0x22dcc6(0x1bf)),0x1;const _0x41b98c=await withSpinner(_0x22dcc6(0x300)+_0xbd1c05+'\x27...',()=>_0x5d886a[_0x22dcc6(0x2bc)]['resolveParentId'](_0xbd1c05),{'verbose':_0x10e0a3[_0x22dcc6(0x1b5)]}),_0x167879=_0x41b98c[_0x22dcc6(0x2ad)],_0x31e053=await withSpinner(_0x22dcc6(0x231),()=>_0x5d886a[_0x22dcc6(0x2ab)][_0x22dcc6(0x29f)](_0x167879),{'verbose':_0x10e0a3[_0x22dcc6(0x1b5)]}),_0x4983d8=_0x31e053['data'];let _0x4f2541;for(const _0x305d36 of _0x4983d8){if(_0x305d36[_0x22dcc6(0x36e)]?.[_0x22dcc6(0x2f1)](_0x1ec89d=>_0x1ec89d['id']===_0x32da66)){_0x4f2541=_0x305d36['id'];break;}}if(!_0x4f2541)return console[_0x22dcc6(0x263)](_0x22dcc6(0x2f0)+_0x32da66+_0x22dcc6(0x1d4)),0x1;const _0xe1650d=await withSpinner(_0x22dcc6(0x26e)+_0x32da66+_0x22dcc6(0x34e),()=>_0x5d886a['personalization']['deleteToken'](_0x167879,_0x4f2541,_0x32da66),{'verbose':_0x10e0a3['verbose']}),_0x5e0095=_0xe1650d['data'];return console['error'](_0x22dcc6(0x2d2)+(_0x5e0095['name']||_0x32da66)+'\x27'),await handleSDKOutput([_0x5e0095],_0x10e0a3),0x0;}}export class PSPzListCommand extends BaseCommand{['name']=a31_0x18a3da(0x3ac);['description']=a31_0x18a3da(0x37f);async[a31_0x18a3da(0x351)](_0x197293){const _0x12c222=a31_0x18a3da,{options:_0x554355,args:_0x5bc3c8,tdx:_0x1111a7}=_0x197293,_0x19cf98=_0x5bc3c8[0x0]||_0x554355[_0x12c222(0x29d)];if(!_0x19cf98)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'+_0x12c222(0x1c7)),0x1;const _0x1a2f64=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x19cf98+_0x12c222(0x34e),()=>_0x1111a7[_0x12c222(0x2bc)]['resolveParentId'](_0x19cf98),{'verbose':_0x554355['verbose']}),_0x1aec96=_0x1a2f64['data'],_0xdc7d73=await withSpinner('Listing\x20personalizations\x20for\x20\x27'+_0x19cf98+_0x12c222(0x34e),()=>_0x1111a7[_0x12c222(0x2ab)][_0x12c222(0x38e)](_0x1aec96),{'verbose':_0x554355[_0x12c222(0x1b5)]}),_0x5003fa=_0xdc7d73[_0x12c222(0x2ad)];console[_0x12c222(0x263)]('✔\x20Found\x20'+_0x5003fa[_0x12c222(0x37d)]+_0x12c222(0x296)+(_0x5003fa['length']!==0x1?'s':''));if(_0x554355[_0x12c222(0x1c0)]===_0x12c222(0x305)||_0x554355[_0x12c222(0x1c0)]==='jsonl')await handleSDKOutput(_0x5003fa,_0x554355);else{if(_0x5003fa[_0x12c222(0x37d)]===0x0)console['log'](_0x12c222(0x21a));else for(const _0x30c82e of _0x5003fa){console[_0x12c222(0x36f)](a31_0x341876[_0x12c222(0x3a3)](_0x30c82e[_0x12c222(0x1bd)])+'\x20'+a31_0x341876['dim']('(id:\x20'+_0x30c82e['id']+')'));_0x30c82e[_0x12c222(0x2dd)]&&console[_0x12c222(0x36f)]('\x20\x20'+a31_0x341876['dim'](_0x30c82e['description']));const _0x254697=_0x30c82e[_0x12c222(0x213)]?.[_0x12c222(0x37d)]||0x0;console[_0x12c222(0x36f)]('\x20\x20'+a31_0x341876[_0x12c222(0x293)](_0x12c222(0x38d))+'\x20'+_0x254697);if(_0x30c82e[_0x12c222(0x213)]&&_0x30c82e[_0x12c222(0x213)]['length']>0x0)for(const _0x1b48eb of _0x30c82e[_0x12c222(0x213)]){console[_0x12c222(0x36f)](_0x12c222(0x1f5)+_0x1b48eb[_0x12c222(0x1bd)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x1c4);[a31_0x18a3da(0x2dd)]='Show\x20a\x20specific\x20realtime\x20personalization';async['execute'](_0x52b302){const _0x5bed22=a31_0x18a3da,{options:_0x56acc4,args:_0x536e82,tdx:_0x3cd903}=_0x52b302,_0x4764cf=_0x536e82[0x0];if(!_0x4764cf)return console[_0x5bed22(0x263)](_0x5bed22(0x361)),console[_0x5bed22(0x263)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x42a864=await withSpinner(_0x5bed22(0x34d)+_0x4764cf+'\x27...',()=>_0x3cd903[_0x5bed22(0x2ab)]['getPersonalization'](_0x4764cf),{'verbose':_0x56acc4[_0x5bed22(0x1b5)]}),_0x540081=_0x42a864[_0x5bed22(0x2ad)];console[_0x5bed22(0x263)](_0x5bed22(0x1a7)+_0x540081['name']+'\x27');if(_0x56acc4[_0x5bed22(0x1c0)]===_0x5bed22(0x305)||_0x56acc4['format']==='jsonl')await handleSDKOutput([_0x540081],_0x56acc4);else{console[_0x5bed22(0x36f)](a31_0x341876[_0x5bed22(0x3a3)](_0x540081['name'])+'\x20'+a31_0x341876[_0x5bed22(0x284)](_0x5bed22(0x1d5)+_0x540081['id']+')'));_0x540081[_0x5bed22(0x2dd)]&&console[_0x5bed22(0x36f)]('\x20\x20'+a31_0x341876[_0x5bed22(0x284)](_0x540081[_0x5bed22(0x2dd)]));_0x540081['audienceId']&&console['log']('\x20\x20'+a31_0x341876[_0x5bed22(0x293)](_0x5bed22(0x2b2))+'\x20'+_0x540081[_0x5bed22(0x27a)]);console[_0x5bed22(0x36f)]('\x20\x20'+a31_0x341876[_0x5bed22(0x293)](_0x5bed22(0x354))+'\x20'+_0x540081[_0x5bed22(0x1dc)]),console[_0x5bed22(0x36f)]('\x20\x20'+a31_0x341876['cyan'](_0x5bed22(0x320))+'\x20'+_0x540081[_0x5bed22(0x22c)]);const _0x2e9eba=_0x540081['sections']?.[_0x5bed22(0x37d)]||0x0;console[_0x5bed22(0x36f)]('\x20\x20'+a31_0x341876['cyan'](_0x5bed22(0x38d))+'\x20'+_0x2e9eba);if(_0x540081[_0x5bed22(0x213)]&&_0x540081['sections'][_0x5bed22(0x37d)]>0x0)for(const _0x2d7321 of _0x540081[_0x5bed22(0x213)]){console['log'](_0x5bed22(0x382)+a31_0x341876['bold'](_0x2d7321[_0x5bed22(0x1bd)])+'\x20'+a31_0x341876[_0x5bed22(0x284)](_0x5bed22(0x1d5)+_0x2d7321['id']+')')),_0x2d7321[_0x5bed22(0x325)]&&(console[_0x5bed22(0x36f)](_0x5bed22(0x367)+a31_0x341876[_0x5bed22(0x293)]('entryCriteria:')+'\x20'+_0x2d7321[_0x5bed22(0x325)]['name']),_0x2d7321['entryCriteria'][_0x5bed22(0x241)]?.[_0x5bed22(0x363)]&&console[_0x5bed22(0x36f)](_0x5bed22(0x251)+a31_0x341876[_0x5bed22(0x293)](_0x5bed22(0x364))+'\x20'+_0x2d7321[_0x5bed22(0x325)][_0x5bed22(0x241)]['keyEventId'])),_0x2d7321['payload']&&console[_0x5bed22(0x36f)](_0x5bed22(0x367)+a31_0x341876[_0x5bed22(0x293)](_0x5bed22(0x22f))+'\x20'+JSON[_0x5bed22(0x33a)](_0x2d7321[_0x5bed22(0x20d)])),_0x2d7321[_0x5bed22(0x2a6)]&&console[_0x5bed22(0x36f)](_0x5bed22(0x367)+a31_0x341876['cyan'](_0x5bed22(0x1b8))+_0x5bed22(0x359));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x375);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x392);async['execute'](_0x457a5f){const _0x181418=a31_0x18a3da,{options:_0x14d488,args:_0x3885e9,tdx:_0xbfad01}=_0x457a5f,_0x1405a9=_0x3885e9[0x0];if(!_0x1405a9)return console[_0x181418(0x263)](_0x181418(0x361)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x181418(0x1da)+_0x1405a9+_0x181418(0x34e),()=>_0xbfad01[_0x181418(0x2ab)]['deletePersonalization'](_0x1405a9),{'verbose':_0x14d488[_0x181418(0x1b5)]}),console[_0x181418(0x263)]('✔\x20Deleted\x20personalization\x20\x27'+_0x1405a9+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x18a3da(0x1bd)]=a31_0x18a3da(0x314);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x282);async[a31_0x18a3da(0x351)](_0x3b7f6d){const _0x5646f2=a31_0x18a3da,{options:_0x38b963,tdx:_0x32fc21}=_0x3b7f6d,_0x541c88=_0x38b963;let _0x3c86e4;if(_0x541c88[_0x5646f2(0x2c1)]){_0x3c86e4=await loadJSON(_0x541c88[_0x5646f2(0x2c1)],!![]);if(!_0x3c86e4[_0x5646f2(0x27c)]?.[_0x5646f2(0x276)])return console['error'](_0x5646f2(0x28c)),console[_0x5646f2(0x263)](_0x5646f2(0x303)),console[_0x5646f2(0x263)](_0x5646f2(0x29c)),0x1;}else{if(!_0x541c88[_0x5646f2(0x1bd)])return console[_0x5646f2(0x263)](_0x5646f2(0x2f5)),console[_0x5646f2(0x263)](_0x5646f2(0x376)),console[_0x5646f2(0x263)](_0x5646f2(0x285)),0x1;if(_0x541c88['description']===undefined)return console['error'](_0x5646f2(0x339)),console[_0x5646f2(0x263)](_0x5646f2(0x376)),console[_0x5646f2(0x263)](_0x5646f2(0x285)),0x1;if(_0x541c88[_0x5646f2(0x343)]===undefined)return console[_0x5646f2(0x263)]('Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.'),console['error'](_0x5646f2(0x2de)),0x1;let _0x3d8813=_0x541c88[_0x5646f2(0x27a)];if(!_0x3d8813&&_0x38b963[_0x5646f2(0x29d)]){const _0x560762=await withSpinner(_0x5646f2(0x300)+_0x38b963[_0x5646f2(0x29d)]+_0x5646f2(0x34e),()=>_0x32fc21[_0x5646f2(0x2bc)]['resolveParentId'](_0x38b963['parentSegment']),{'verbose':_0x38b963[_0x5646f2(0x1b5)]});_0x3d8813=_0x560762['data'];}let _0x598727;_0x541c88[_0x5646f2(0x213)]&&(_0x598727=await loadJSON(_0x541c88['sections'],![]));const _0x3d83d9=_0x541c88[_0x5646f2(0x343)]===_0x5646f2(0x3b8)?null:{'id':_0x541c88[_0x5646f2(0x343)],'type':_0x5646f2(0x3ab)};_0x3c86e4={'attributes':{'name':_0x541c88[_0x5646f2(0x1bd)],'description':_0x541c88['description']||null,..._0x3d8813!==undefined&&{'audienceId':_0x3d8813},..._0x598727!==undefined&&{'sections':_0x598727}},'relationships':{'parentFolder':{'data':_0x3d83d9}}};}const _0x26466f=await withSpinner(_0x5646f2(0x398)+(_0x3c86e4[_0x5646f2(0x317)]?.[_0x5646f2(0x1bd)]??'')+'\x27...',()=>_0x32fc21[_0x5646f2(0x2ab)][_0x5646f2(0x319)](_0x3c86e4),{'verbose':_0x38b963[_0x5646f2(0x1b5)]}),_0x42ec0a=_0x26466f['data'];return console[_0x5646f2(0x263)](_0x5646f2(0x28d)+_0x42ec0a[_0x5646f2(0x1bd)]+_0x5646f2(0x24a)+_0x42ec0a['id']),await handleSDKOutput([_0x42ec0a],_0x38b963),0x0;}}export class PSPzPatchCommand extends BaseCommand{['name']=a31_0x18a3da(0x1ea);['description']='Update\x20a\x20realtime\x20personalization\x20entity';async[a31_0x18a3da(0x351)](_0x44864d){const _0x1bcf96=a31_0x18a3da,{options:_0x124540,args:_0x411b19}=_0x44864d,_0x3ac522=_0x124540,_0x45ac37=_0x411b19[0x0];if(!_0x45ac37)return console['error'](_0x1bcf96(0x361)),console[_0x1bcf96(0x263)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0x1bcf96(0x263)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>'),0x1;let _0x41f2a2;if(_0x3ac522['file'])_0x41f2a2=await loadJSON(_0x3ac522[_0x1bcf96(0x2c1)],!![]);else{if(!_0x3ac522[_0x1bcf96(0x1bd)])return console[_0x1bcf96(0x263)](_0x1bcf96(0x2f5)),console[_0x1bcf96(0x263)](_0x1bcf96(0x329)),0x1;if(_0x3ac522[_0x1bcf96(0x2dd)]===undefined)return console[_0x1bcf96(0x263)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x1bcf96(0x263)](_0x1bcf96(0x329)),0x1;let _0x44a80c;_0x3ac522[_0x1bcf96(0x213)]&&(_0x44a80c=await loadJSON(_0x3ac522[_0x1bcf96(0x213)],![])),_0x41f2a2={'attributes':{'name':_0x3ac522[_0x1bcf96(0x1bd)],'description':_0x3ac522[_0x1bcf96(0x2dd)]||null,..._0x44a80c!==undefined&&{'sections':_0x44a80c}}};}const {tdx:_0x1d599b}=_0x44864d,_0x184265=await withSpinner(_0x1bcf96(0x309)+_0x45ac37+_0x1bcf96(0x34e),()=>_0x1d599b['personalization'][_0x1bcf96(0x2ee)](_0x45ac37,_0x41f2a2),{'verbose':_0x124540[_0x1bcf96(0x1b5)]}),_0x15f2aa=_0x184265[_0x1bcf96(0x2ad)];return console['error'](_0x1bcf96(0x216)+_0x15f2aa[_0x1bcf96(0x1bd)]+_0x1bcf96(0x256)+_0x15f2aa['id']+')'),await handleSDKOutput([_0x15f2aa],_0x124540),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a31_0x18a3da(0x2ac);[a31_0x18a3da(0x2dd)]=a31_0x18a3da(0x2b0);async[a31_0x18a3da(0x351)](_0xdcb769){const _0x3ecebf=a31_0x18a3da,{options:_0x253a71,args:_0x506032}=_0xdcb769,_0x5abc74=_0x506032[0x0]||_0x253a71[_0x3ecebf(0x29d)];if(!_0x5abc74)return showParentSegmentNotSetError(_0x3ecebf(0x2cc)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment'),0x1;const _0x580e05=resolveYamlFile(_0x5abc74);if(!existsSync(_0x580e05))return showFileNotFoundError(_0x580e05,_0x5abc74),0x1;let _0x17e17b;try{_0x17e17b=readFileSync(_0x580e05,'utf-8');}catch(_0x1d6fa0){const _0xb51efb=_0x1d6fa0 instanceof Error?_0x1d6fa0[_0x3ecebf(0x39d)]:String(_0x1d6fa0);return console[_0x3ecebf(0x263)]('Error\x20reading\x20file:\x20'+_0xb51efb),0x1;}let _0x138583;try{_0x138583=parseDef(_0x17e17b);}catch(_0x3deb06){const _0x27286a=_0x3deb06 instanceof Error?_0x3deb06[_0x3ecebf(0x39d)]:String(_0x3deb06);return console['error'](a31_0x341876['red']('Error\x20parsing\x20YAML:\x20'+_0x27286a)),0x1;}if(_0x138583['personalization_services']&&_0x138583[_0x3ecebf(0x1f4)][_0x3ecebf(0x37d)]>0x0)return console['error'](a31_0x341876[_0x3ecebf(0x1ec)](_0x3ecebf(0x316)+_0x580e05)),console[_0x3ecebf(0x263)](a31_0x341876[_0x3ecebf(0x284)](_0x3ecebf(0x328)+_0x138583[_0x3ecebf(0x1f4)][_0x3ecebf(0x37d)]+_0x3ecebf(0x31d))),0x1;!_0x138583[_0x3ecebf(0x27f)]&&(_0x138583[_0x3ecebf(0x27f)]={'events':[{'name':_0x3ecebf(0x2fc),'source_table':_0x3ecebf(0x1a6)}],'attributes':[{'name':_0x3ecebf(0x1d3),'type':_0x3ecebf(0x2a3)}],'id_stitching':{'primary_key':_0x138583[_0x3ecebf(0x357)][_0x3ecebf(0x228)]===_0x3ecebf(0x20a)?_0x3ecebf(0x28e):_0x3ecebf(0x25f)}});_0x138583[_0x3ecebf(0x1f4)]=[{'name':'My\x20Service','description':_0x3ecebf(0x355),'trigger_event':'page_view','sections':[{'name':_0x3ecebf(0x2fe),'criteria':_0x3ecebf(0x2bb),'attributes':['last_page_viewed']}]}];const _0x1f8bee=serializeDef(_0x138583);return writeFileSync(_0x580e05,_0x1f8bee,'utf-8'),console[_0x3ecebf(0x263)](a31_0x341876[_0x3ecebf(0x297)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x341876['cyan'](_0x580e05)),(!_0x138583[_0x3ecebf(0x27f)]||_0x17e17b[_0x3ecebf(0x3aa)](_0x3ecebf(0x2d5))===-0x1)&&console['error'](a31_0x341876[_0x3ecebf(0x297)]('✔')+_0x3ecebf(0x1eb)),console['error']('\x0a'+a31_0x341876[_0x3ecebf(0x284)](_0x3ecebf(0x26d))),console[_0x3ecebf(0x263)](_0x3ecebf(0x32f)+_0x580e05+_0x3ecebf(0x1c2)),console[_0x3ecebf(0x263)](_0x3ecebf(0x2b5)+a31_0x341876[_0x3ecebf(0x284)](_0x3ecebf(0x334)+_0x5abc74)+'\x20to\x20push\x20the\x20configuration'),0x0;}}