@treasuredata/tdx 2026.4.17 → 2026.4.18

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 +17 -2
@@ -1 +1 @@
1
- const a31_0xdea3fe=a31_0x4b02;(function(_0x1e0d9e,_0x4c3ba1){const _0x37ee22=a31_0x4b02,_0x3cbd02=_0x1e0d9e();while(!![]){try{const _0x1c92ef=-parseInt(_0x37ee22(0x28e))/0x1*(parseInt(_0x37ee22(0x288))/0x2)+parseInt(_0x37ee22(0x216))/0x3+-parseInt(_0x37ee22(0x29c))/0x4*(-parseInt(_0x37ee22(0x293))/0x5)+-parseInt(_0x37ee22(0x31a))/0x6+-parseInt(_0x37ee22(0x336))/0x7+parseInt(_0x37ee22(0x1e6))/0x8+parseInt(_0x37ee22(0x36f))/0x9;if(_0x1c92ef===_0x4c3ba1)break;else _0x3cbd02['push'](_0x3cbd02['shift']());}catch(_0xeeb545){_0x3cbd02['push'](_0x3cbd02['shift']());}}}(a31_0x5df8,0x4f236));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x3c8cc9 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_0xd5335b from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a31_0xdea3fe(0x213);function openBrowser(_0x4bfc3b){const _0x46bc4a=a31_0xdea3fe,_0x55e64a=process[_0x46bc4a(0x229)],_0x213284=_0x55e64a==='darwin'?_0x46bc4a(0x392):_0x55e64a===_0x46bc4a(0x22d)?_0x46bc4a(0x302):'xdg-open';spawn(_0x213284,[_0x4bfc3b],{'detached':!![],'stdio':_0x46bc4a(0x20a)})[_0x46bc4a(0x1fa)]();}function migrateLegacyDirectory(){const _0x4d943d=a31_0xdea3fe;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x585236=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x585236[_0x4d943d(0x1ee)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x4d943d(0x3bb)](a31_0xd5335b['yellow'](_0x4d943d(0x3b8)+LEGACY_PARENT_SEGMENT_DIR+_0x4d943d(0x3a5)+PARENT_SEGMENT_DIR+_0x4d943d(0x25b))),console['error'](a31_0xd5335b['dim'](_0x4d943d(0x227)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x4d943d(0x3bb)](a31_0xd5335b['yellow'](_0x4d943d(0x2a2)+LEGACY_PARENT_SEGMENT_DIR+_0x4d943d(0x31d)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a31_0xd5335b[_0x4d943d(0x208)](_0x4d943d(0x35d)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x32aa06){const _0x136dda=_0x32aa06 instanceof Error?_0x32aa06['message']:String(_0x32aa06);return console[_0x4d943d(0x3bb)](a31_0xd5335b[_0x4d943d(0x1c5)](_0x4d943d(0x1f6)+_0x136dda+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0xdea3fe(0x1cc)](_0x4ea709){const _0x3686ec=a31_0xdea3fe;return migrateLegacyDirectory(),super[_0x3686ec(0x1cc)](_0x4ea709);}}function resolveYamlFile(_0x2c42c8){const _0x2632d1=a31_0xdea3fe;if(_0x2c42c8['endsWith'](_0x2632d1(0x3d0))||_0x2c42c8['endsWith']('.yaml'))return _0x2c42c8;return a31_0x3c8cc9['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2c42c8)+'.yml');}function formatProgressMessage(_0x517dfe){const _0x2d617f=a31_0xdea3fe,_0x5f2ae5=_0x517dfe[_0x2d617f(0x27e)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5f2ae5){const [,_0x57c079,_0x3e5529,_0x5df218='']=_0x5f2ae5;return a31_0xd5335b[_0x2d617f(0x297)](_0x57c079+':')+'\x20'+_0x3e5529+a31_0xd5335b['dim'](_0x5df218);}return a31_0xd5335b[_0x2d617f(0x297)](_0x517dfe);}function showFileNotFoundError(_0x30f7e8,_0x21c90a){const _0x1ba7a4=a31_0xdea3fe;console['error'](a31_0xd5335b['red'](_0x1ba7a4(0x384)+_0x30f7e8+'\x0a')),console[_0x1ba7a4(0x3bb)](a31_0xd5335b[_0x1ba7a4(0x325)](_0x1ba7a4(0x2b4)+_0x21c90a+_0x1ba7a4(0x3af)));}function a31_0x4b02(_0x1ed195,_0x534b36){_0x1ed195=_0x1ed195-0x1b9;const _0x5df85a=a31_0x5df8();let _0x4b0212=_0x5df85a[_0x1ed195];return _0x4b0212;}function displayRealtimeValidation(_0xf8c857){const _0x5a4c04=a31_0xdea3fe;if(!_0xf8c857[_0x5a4c04(0x339)])return;const _0xf36168=_0xf8c857['realtime'],_0x476e75=_0xf36168[_0x5a4c04(0x352)]?a31_0xd5335b[_0x5a4c04(0x208)](_0x5a4c04(0x27b)):a31_0xd5335b[_0x5a4c04(0x2e5)](_0x5a4c04(0x2ed));console[_0x5a4c04(0x3bb)]('\x0a'+a31_0xd5335b[_0x5a4c04(0x297)](_0x5a4c04(0x3a6))+'\x20'+_0x476e75);if(_0xf36168[_0x5a4c04(0x3a8)]&&_0xf36168[_0x5a4c04(0x3a8)][_0x5a4c04(0x2dd)]>0x0){console[_0x5a4c04(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x5a4c04(0x297)](_0x5a4c04(0x272))+'\x20'+_0xf36168['events'][_0x5a4c04(0x2dd)]+'\x20configured');for(const _0x3f1afd of _0xf36168[_0x5a4c04(0x3a8)]){const _0x5969c0=_0x3f1afd[_0x5a4c04(0x277)]===![]?a31_0xd5335b['red']('✘'):a31_0xd5335b[_0x5a4c04(0x208)]('✔');console[_0x5a4c04(0x3bb)](_0x5a4c04(0x233)+_0x5969c0+'\x20'+_0x3f1afd[_0x5a4c04(0x358)]),_0x3f1afd[_0x5a4c04(0x255)]&&console[_0x5a4c04(0x3bb)](_0x5a4c04(0x26d)+a31_0xd5335b['red'](_0x3f1afd['sourceTableError']));}}if(_0xf36168[_0x5a4c04(0x35c)]&&_0xf36168[_0x5a4c04(0x35c)]['length']>0x0){console[_0x5a4c04(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x5a4c04(0x297)](_0x5a4c04(0x2b9))+'\x20'+_0xf36168[_0x5a4c04(0x35c)][_0x5a4c04(0x2dd)]+_0x5a4c04(0x33a));for(const _0x346c14 of _0xf36168[_0x5a4c04(0x35c)]){const _0x3e10b5=_0x346c14[_0x5a4c04(0x2a5)]?a31_0xd5335b['green']('✔'):a31_0xd5335b[_0x5a4c04(0x1c5)]('✘');console[_0x5a4c04(0x3bb)](_0x5a4c04(0x233)+_0x3e10b5+'\x20'+_0x346c14[_0x5a4c04(0x358)]+'\x20'+a31_0xd5335b[_0x5a4c04(0x297)]('('+_0x346c14[_0x5a4c04(0x1ed)]+')'));}}if(_0xf36168[_0x5a4c04(0x234)]){const _0x12702a=_0xf36168['idStitching'][_0x5a4c04(0x1ca)]?.[_0x5a4c04(0x2dd)]?'\x20+\x20['+_0xf36168[_0x5a4c04(0x234)][_0x5a4c04(0x1ca)]['join'](',\x20')+']':'';console[_0x5a4c04(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x5a4c04(0x297)](_0x5a4c04(0x2a0))+'\x20'+_0xf36168[_0x5a4c04(0x234)][_0x5a4c04(0x2ff)]+_0x12702a);}if(_0xf36168[_0x5a4c04(0x329)]&&_0xf36168[_0x5a4c04(0x329)][_0x5a4c04(0x2dd)]>0x0){console[_0x5a4c04(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x5a4c04(0x297)](_0x5a4c04(0x2c9))+'\x20'+_0xf36168[_0x5a4c04(0x329)][_0x5a4c04(0x2dd)]+_0x5a4c04(0x331)+(_0xf36168[_0x5a4c04(0x329)]['length']!==0x1?'s':''));for(const _0x37a70f of _0xf36168[_0x5a4c04(0x329)]){console[_0x5a4c04(0x3bb)](_0x5a4c04(0x242)+_0x37a70f[_0x5a4c04(0x358)]);}}}function showParentSegmentNotSetError(_0x12a78d){const _0x284277=a31_0xdea3fe;console[_0x284277(0x3bb)](a31_0xd5335b['yellow'](_0x284277(0x22c))),console[_0x284277(0x3bb)](_0x12a78d);}export class ParentSegmentListCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x363);[a31_0xdea3fe(0x1f4)]='List\x20parent\x20segments';async[a31_0xdea3fe(0x2dc)](_0x4154f8){const _0x1f834e=a31_0xdea3fe,{options:_0xff977d,args:_0x4aedb5,tdx:_0x2ddc07}=_0x4154f8,_0x5611c9=_0x4aedb5[0x0];_0xff977d[_0x1f834e(0x2cf)]&&(console[_0x1f834e(0x3bb)](_0x1f834e(0x2cd)+_0xff977d[_0x1f834e(0x349)]),_0x5611c9&&console['error'](_0x1f834e(0x34f)+_0x5611c9));const _0x5a6fe5=await withSpinner(_0x5611c9?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x5611c9+_0x1f834e(0x23b):_0x1f834e(0x39d),()=>_0x2ddc07['segment']['listParents'](),{'verbose':_0xff977d[_0x1f834e(0x2cf)]});let _0x42b40c=_0x5a6fe5[_0x1f834e(0x2b6)];if(_0x5611c9){const _0x5b141b=_0x5611c9[_0x1f834e(0x25a)](/[.+^${}()|[\]\\]/g,_0x1f834e(0x2c4))[_0x1f834e(0x25a)](/\*/g,'.*')[_0x1f834e(0x25a)](/\?/g,'.'),_0x1f8b64=new RegExp('^'+_0x5b141b+'$','i');_0x42b40c=_0x42b40c[_0x1f834e(0x31c)](_0x5e35e3=>_0x1f8b64[_0x1f834e(0x1d5)](_0x5e35e3['attributes'][_0x1f834e(0x358)]));}_0x42b40c[_0x1f834e(0x219)]((_0x33377a,_0x277836)=>_0x33377a[_0x1f834e(0x35c)][_0x1f834e(0x358)]['localeCompare'](_0x277836[_0x1f834e(0x35c)]['name'])),console[_0x1f834e(0x3bb)](_0x1f834e(0x220)+_0x42b40c[_0x1f834e(0x2dd)]+'\x20parent\x20segment'+(_0x42b40c[_0x1f834e(0x2dd)]!==0x1?'s':''));const _0x5218ef=_0x4cd5e7=>{const _0x23e0a1=_0x1f834e;return getConsoleNextUrl(_0xff977d[_0x23e0a1(0x349)],_0x23e0a1(0x3be)+_0x4cd5e7);};if(_0xff977d[_0x1f834e(0x322)]===_0x1f834e(0x2b8)||_0xff977d[_0x1f834e(0x322)]===_0x1f834e(0x39c)){const _0x43f6c8=_0x42b40c[_0x1f834e(0x267)](_0x537baf=>({..._0x537baf,'url':_0x5218ef(_0x537baf['id'])}));await handleSDKOutput(_0x43f6c8,_0xff977d);}else{if(_0x42b40c['length']===0x0)_0x5611c9?console[_0x1f834e(0x231)](_0x1f834e(0x24a)+_0x5611c9):console[_0x1f834e(0x231)](_0x1f834e(0x370));else for(const _0x202ca5 of _0x42b40c){const _0x4edbf5=_0x202ca5[_0x1f834e(0x35c)][_0x1f834e(0x356)]?a31_0xd5335b[_0x1f834e(0x297)]('\x20('+formatRows(_0x202ca5[_0x1f834e(0x35c)][_0x1f834e(0x356)])+')'):'',_0x5111f1=hyperlink(_0x202ca5[_0x1f834e(0x35c)][_0x1f834e(0x358)],_0x5218ef(_0x202ca5['id']));console[_0x1f834e(0x231)](_0x1f834e(0x1e9)+_0x5111f1+_0x4edbf5);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a31_0xdea3fe(0x37b);[a31_0xdea3fe(0x1f4)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a31_0xdea3fe(0x2dc)](_0x3251d2){const _0x2061ac=a31_0xdea3fe,{options:_0x34fd6e,args:_0x128fc7,tdx:_0x25b7a1}=_0x3251d2;console[_0x2061ac(0x3bb)](_0x2061ac(0x3ca)+_0x2061ac(0x327)+_0x2061ac(0x3b3));const _0x4f1d24=_0x34fd6e;if(_0x128fc7[_0x2061ac(0x2dd)]===0x0)return console[_0x2061ac(0x3bb)](a31_0xd5335b[_0x2061ac(0x1c5)](_0x2061ac(0x248))),console[_0x2061ac(0x3bb)](_0x2061ac(0x25d)),0x1;const _0x3770e6=_0x128fc7[0x0];if(!_0x4f1d24['database']||!_0x4f1d24['table'])return console[_0x2061ac(0x3bb)](_0x2061ac(0x218)),console['error'](_0x2061ac(0x25d)),0x1;_0x4f1d24[_0x2061ac(0x2cf)]&&(console['error'](_0x2061ac(0x2cd)+_0x4f1d24[_0x2061ac(0x349)]),console['error']('Name:\x20'+_0x3770e6),console[_0x2061ac(0x3bb)](_0x2061ac(0x232)+_0x4f1d24['database']),console['error'](_0x2061ac(0x334)+_0x4f1d24[_0x2061ac(0x3cb)]));const _0x51e9fd=await loadJSONFromOptions(_0x4f1d24[_0x2061ac(0x35c)],_0x4f1d24['attributesFile']),_0xcf1fc9=await loadJSONFromOptions(_0x4f1d24[_0x2061ac(0x24c)],_0x4f1d24[_0x2061ac(0x1b9)]),_0x201656=await loadJSONFromOptions(_0x4f1d24[_0x2061ac(0x3cd)],_0x4f1d24[_0x2061ac(0x38f)]),_0x18bf19={'name':_0x3770e6,'description':_0x4f1d24[_0x2061ac(0x1f4)],'scheduleType':_0x4f1d24[_0x2061ac(0x252)],'scheduleOption':_0x4f1d24[_0x2061ac(0x31b)],'timezone':_0x4f1d24['timezone'],'master':{'parentDatabaseName':_0x4f1d24[_0x2061ac(0x247)],'parentTableName':_0x4f1d24[_0x2061ac(0x3cb)]},'attributes':_0x51e9fd,'behaviors':_0xcf1fc9,'customerGroup':_0x201656},_0x5e6cdd=await withSpinner(_0x2061ac(0x1da)+_0x3770e6+_0x2061ac(0x23b),()=>_0x25b7a1[_0x2061ac(0x2fe)][_0x2061ac(0x32e)](_0x18bf19),{'verbose':_0x34fd6e[_0x2061ac(0x2cf)]}),_0x3ee820=_0x5e6cdd[_0x2061ac(0x2b6)];return console[_0x2061ac(0x3bb)](_0x2061ac(0x1cd)+_0x3ee820['name']+'\x27\x20with\x20ID:\x20'+_0x3ee820['id']),await handleSDKOutput([_0x3ee820],_0x34fd6e),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x2f2);['description']=a31_0xdea3fe(0x237);async[a31_0xdea3fe(0x2dc)](_0x4419f4){const _0x2af2f4=a31_0xdea3fe,{options:_0x6b49f3,args:_0x10a71c,tdx:_0xde4c21}=_0x4419f4;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x2af2f4(0x327)+_0x2af2f4(0x3b3));const _0x1ff7d1=_0x6b49f3;if(_0x10a71c['length']===0x0)return console[_0x2af2f4(0x3bb)](a31_0xd5335b[_0x2af2f4(0x1c5)](_0x2af2f4(0x248))),console[_0x2af2f4(0x3bb)](_0x2af2f4(0x205)),0x1;const _0x848088=_0x10a71c[0x0];_0x1ff7d1[_0x2af2f4(0x2cf)]&&(console[_0x2af2f4(0x3bb)]('Site:\x20'+_0x1ff7d1[_0x2af2f4(0x349)]),console['error'](_0x2af2f4(0x3c9)+_0x848088));const _0x136950=await withSpinner(_0x2af2f4(0x262)+_0x848088+_0x2af2f4(0x23b),()=>_0xde4c21['segment'][_0x2af2f4(0x30d)](_0x848088),{'verbose':_0x1ff7d1[_0x2af2f4(0x2cf)]}),_0x367522=_0x136950['data'],_0x416b95=await loadJSONFromOptions(_0x1ff7d1[_0x2af2f4(0x268)],_0x1ff7d1[_0x2af2f4(0x3b2)]),_0x5a8e49=await loadJSONFromOptions(_0x1ff7d1[_0x2af2f4(0x2f7)],_0x1ff7d1['addBehaviorsFile']),_0x3f0eb9={'name':_0x367522[_0x2af2f4(0x358)],'description':_0x1ff7d1[_0x2af2f4(0x1f4)]!==undefined?_0x1ff7d1[_0x2af2f4(0x1f4)]:_0x367522[_0x2af2f4(0x1f4)],'scheduleType':_0x1ff7d1[_0x2af2f4(0x252)]!==undefined?_0x1ff7d1[_0x2af2f4(0x252)]:_0x367522[_0x2af2f4(0x252)],'scheduleOption':_0x1ff7d1[_0x2af2f4(0x31b)]!==undefined?_0x1ff7d1[_0x2af2f4(0x31b)]:_0x367522[_0x2af2f4(0x31b)],'timezone':_0x1ff7d1['timezone']!==undefined?_0x1ff7d1[_0x2af2f4(0x2be)]:_0x367522['timezone'],'master':_0x367522[_0x2af2f4(0x26a)],'attributes':_0x416b95?[..._0x367522[_0x2af2f4(0x35c)]||[],..._0x416b95]:_0x367522[_0x2af2f4(0x35c)],'behaviors':_0x5a8e49?[..._0x367522[_0x2af2f4(0x24c)]||[],..._0x5a8e49]:_0x367522[_0x2af2f4(0x24c)],'customerGroup':_0x367522[_0x2af2f4(0x3cd)]},_0x4201ae=await withSpinner(_0x2af2f4(0x261)+_0x848088+_0x2af2f4(0x23b),()=>_0xde4c21[_0x2af2f4(0x2fe)][_0x2af2f4(0x36d)](_0x848088,_0x3f0eb9),{'verbose':_0x1ff7d1[_0x2af2f4(0x2cf)]}),_0x1f8547=_0x4201ae[_0x2af2f4(0x2b6)];return console[_0x2af2f4(0x3bb)](_0x2af2f4(0x228)+_0x1f8547[_0x2af2f4(0x358)]+'\x27'),await handleSDKOutput([_0x1f8547],_0x1ff7d1),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a31_0xdea3fe(0x372);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x26e);async[a31_0xdea3fe(0x2dc)](_0x1d69ff){const _0x90740e=a31_0xdea3fe,{options:_0x483bdc,args:_0x443af7,tdx:_0x311398}=_0x1d69ff,_0x24d6e6=_0x483bdc,_0x45b6b2=_0x443af7[0x0]||_0x483bdc[_0x90740e(0x256)];if(!_0x45b6b2)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x24d6e6[_0x90740e(0x3a3)]&&_0x24d6e6[_0x90740e(0x346)])return console[_0x90740e(0x3bb)](a31_0xd5335b[_0x90740e(0x1c5)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console['error'](a31_0xd5335b[_0x90740e(0x297)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x90740e(0x3bb)](a31_0xd5335b[_0x90740e(0x297)](_0x90740e(0x3cc)+PARENT_SEGMENT_DIR+_0x90740e(0x23c))),console[_0x90740e(0x3bb)](a31_0xd5335b[_0x90740e(0x325)](_0x90740e(0x393))),0x1;const _0x1fd122=_0x24d6e6[_0x90740e(0x346)]||a31_0x3c8cc9[_0x90740e(0x23f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x45b6b2)+_0x90740e(0x3d0));_0x24d6e6['verbose']&&(console[_0x90740e(0x3bb)](_0x90740e(0x2cd)+_0x24d6e6[_0x90740e(0x349)]),console[_0x90740e(0x3bb)](_0x90740e(0x3c9)+_0x45b6b2),console[_0x90740e(0x3bb)](_0x90740e(0x28a)+_0x1fd122));const _0xe86671=await withSpinner(_0x90740e(0x32f)+_0x45b6b2+_0x90740e(0x23b),()=>_0x311398[_0x90740e(0x2fe)][_0x90740e(0x37d)](_0x45b6b2),{'verbose':_0x24d6e6[_0x90740e(0x2cf)]}),_0x214132=_0xe86671[_0x90740e(0x2b6)];if(existsSync(_0x1fd122)){const _0x10a846=readFileSync(_0x1fd122,_0x90740e(0x281)),_0x2f3e3e=generateDiff(_0x10a846,_0x214132);if(!hasChanges(_0x2f3e3e))console[_0x90740e(0x3bb)](a31_0xd5335b[_0x90740e(0x208)]('✔')+_0x90740e(0x345)+a31_0xd5335b[_0x90740e(0x325)](_0x1fd122)+_0x90740e(0x3b0));else{console[_0x90740e(0x3bb)](_0x90740e(0x3c8)+_0x1fd122+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x90740e(0x3bb)](formatDiffWithColors(_0x2f3e3e)),console[_0x90740e(0x3bb)]('─'[_0x90740e(0x2d6)](0x3c));if(!_0x24d6e6[_0x90740e(0x312)]){if(!isInteractive())return console['error'](a31_0xd5335b[_0x90740e(0x1c5)](_0x90740e(0x2f3)),_0x90740e(0x340)),console['error'](a31_0xd5335b['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2568bd=await confirmKey('Overwrite\x20\x27'+_0x1fd122+'\x27?');if(!_0x2568bd)return console[_0x90740e(0x3bb)](a31_0xd5335b[_0x90740e(0x2e5)](_0x90740e(0x32b))),0x1;}writeFileSync(_0x1fd122,_0x214132,_0x90740e(0x281)),console['error'](a31_0xd5335b[_0x90740e(0x208)]('✔')+_0x90740e(0x2d7)+a31_0xd5335b['cyan'](_0x1fd122));}}else{const _0x542cb8=a31_0x3c8cc9[_0x90740e(0x354)](_0x1fd122);!existsSync(_0x542cb8)&&mkdirSync(_0x542cb8,{'recursive':!![]}),writeFileSync(_0x1fd122,_0x214132,_0x90740e(0x281)),console[_0x90740e(0x3bb)](a31_0xd5335b[_0x90740e(0x208)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0xd5335b['cyan'](_0x1fd122));}return saveSessionContext({'parent_segment':_0x45b6b2},_0x24d6e6['session']),console['error'](a31_0xd5335b[_0x90740e(0x208)]('✔')+_0x90740e(0x2f8)+a31_0xd5335b[_0x90740e(0x297)](_0x90740e(0x213))+_0x90740e(0x396)+a31_0xd5335b[_0x90740e(0x325)](_0x45b6b2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x25c);['description']=a31_0xdea3fe(0x1bd);async[a31_0xdea3fe(0x2dc)](_0x1c65af){const _0x3010f7=a31_0xdea3fe,{options:_0x421ccc,args:_0x2091a9,tdx:_0x3ea36b}=_0x1c65af,_0x576490=_0x421ccc,_0xf40a6d=_0x2091a9[0x0]||_0x421ccc[_0x3010f7(0x256)];if(!_0xf40a6d)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'+_0x3010f7(0x36a)),0x1;const _0x506229=resolveYamlFile(_0xf40a6d);if(!existsSync(_0x506229))return showFileNotFoundError(_0x506229,_0xf40a6d),0x1;_0x576490[_0x3010f7(0x2cf)]&&(console[_0x3010f7(0x3bb)]('Site:\x20'+_0x576490[_0x3010f7(0x349)]),console[_0x3010f7(0x3bb)](_0x3010f7(0x379)+_0x506229));let _0x27583e;try{_0x27583e=readFileSync(_0x506229,_0x3010f7(0x281));}catch(_0x21aac8){const _0x181092=_0x21aac8 instanceof Error?_0x21aac8[_0x3010f7(0x2ee)]:String(_0x21aac8);return console[_0x3010f7(0x3bb)](_0x3010f7(0x3ae)+_0x181092),0x1;}const _0x23e7b8=await withSpinner(_0x3010f7(0x22b),()=>_0x3ea36b[_0x3010f7(0x2fe)][_0x3010f7(0x2d9)](_0x27583e),{'verbose':_0x576490[_0x3010f7(0x2cf)]}),_0x147918=_0x23e7b8[_0x3010f7(0x2b6)],{isNew:_0x3029a9,name:_0x2541b0,hasChanges:_0xf17a2c,diffFormatted:_0x3671dd}=_0x147918;if(!_0xf17a2c)return console[_0x3010f7(0x3bb)]('✔\x20No\x20changes\x20-\x20\x27'+_0x2541b0+_0x3010f7(0x338)),0x0;_0x3029a9?console[_0x3010f7(0x3bb)](_0x3010f7(0x235)+_0x2541b0+'\x27:'):console[_0x3010f7(0x3bb)](_0x3010f7(0x283)+_0x2541b0+'\x27:');console[_0x3010f7(0x3bb)]('─'[_0x3010f7(0x2d6)](0x3c)),console[_0x3010f7(0x3bb)](_0x3671dd),console[_0x3010f7(0x3bb)]('─'[_0x3010f7(0x2d6)](0x3c));const _0x1bab67=_0x3029a9?_0x3010f7(0x2da)+_0x2541b0+'\x27?':_0x3010f7(0x2b7)+_0x2541b0+'\x27?';if(!_0x576490['yes']){if(!isInteractive())return console[_0x3010f7(0x3bb)](a31_0xd5335b[_0x3010f7(0x1c5)](_0x3010f7(0x2f3)),_0x3010f7(0x340)),console[_0x3010f7(0x3bb)](a31_0xd5335b[_0x3010f7(0x297)](_0x3010f7(0x324))),0x1;const _0xc54a4b=await confirmKey(_0x1bab67);if(!_0xc54a4b)return console[_0x3010f7(0x3bb)](a31_0xd5335b[_0x3010f7(0x2e5)](_0x3010f7(0x32b))),0x1;}const _0x4f7a43=_0x3029a9?'Creating':'Updating',_0x42de42=await withSpinner(_0x4f7a43+_0x3010f7(0x289)+_0x2541b0+_0x3010f7(0x23b),()=>_0x147918['apply'](),{'verbose':_0x576490[_0x3010f7(0x2cf)]}),_0x1df956=_0x42de42['data'],_0x2ef8ef=getConsoleNextUrl(_0x576490['site'],_0x3010f7(0x3be)+_0x1df956['id']),_0x31626c=_0x3029a9?'Created':_0x3010f7(0x1f7);return console[_0x3010f7(0x3bb)]('✔\x20'+_0x31626c+_0x3010f7(0x289)+_0x1df956['name']+'\x27'),console[_0x3010f7(0x3bb)]('\x20\x20'+_0x2ef8ef),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a31_0xdea3fe(0x1f1);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x37e);async[a31_0xdea3fe(0x2dc)](_0x1a20fe){const _0x5598d9=a31_0xdea3fe,{options:_0x195779,args:_0x2455a3,tdx:_0x18481b}=_0x1a20fe,_0x39dd1f=_0x195779,_0x1332bf=_0x2455a3[0x0]||_0x195779['parentSegment'];if(!_0x1332bf)return showParentSegmentNotSetError(_0x5598d9(0x24f)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x5598d9(0x225)+_0x5598d9(0x3c0)+_0x5598d9(0x200)),0x1;const _0x596e3d=resolveYamlFile(_0x1332bf);if(!existsSync(_0x596e3d))return showFileNotFoundError(_0x596e3d,_0x1332bf),0x1;_0x39dd1f[_0x5598d9(0x2cf)]&&(console[_0x5598d9(0x3bb)](_0x5598d9(0x2cd)+_0x39dd1f[_0x5598d9(0x349)]),console[_0x5598d9(0x3bb)](_0x5598d9(0x379)+_0x596e3d));let _0x3e304e;try{_0x3e304e=readFileSync(_0x596e3d,_0x5598d9(0x281));}catch(_0x485821){const _0x431401=_0x485821 instanceof Error?_0x485821[_0x5598d9(0x2ee)]:String(_0x485821);return console[_0x5598d9(0x3bb)](_0x5598d9(0x3ae)+_0x431401),0x1;}const _0x9e497b=createCommandSpinner(a31_0xd5335b[_0x5598d9(0x297)]('Validating\x20configuration...'),{'verbose':_0x39dd1f[_0x5598d9(0x2cf)]});_0x9e497b['start']();const _0x53aa7f={'onProgress':_0x2e5ccc=>{_0x9e497b['text']=formatProgressMessage(_0x2e5ccc);}};if(_0x39dd1f['master'])_0x53aa7f[_0x5598d9(0x26a)]=!![];if(_0x39dd1f[_0x5598d9(0x2b2)])_0x53aa7f[_0x5598d9(0x2b2)]=!![];_0x39dd1f[_0x5598d9(0x1e5)]&&(_0x53aa7f[_0x5598d9(0x1e5)]=_0x39dd1f['attribute']);_0x39dd1f['behavior']&&(_0x53aa7f[_0x5598d9(0x3c3)]=_0x39dd1f['behavior']);if(_0x39dd1f['interval'])_0x53aa7f['interval']=_0x39dd1f[_0x5598d9(0x21e)];let _0x5e9975;try{_0x5e9975=await _0x18481b[_0x5598d9(0x2fe)][_0x5598d9(0x27c)](_0x3e304e,_0x53aa7f),_0x9e497b['stop']();}catch(_0x11d7b6){_0x9e497b['stop']();throw _0x11d7b6;}const _0x3a41bc=_0x39dd1f[_0x5598d9(0x21e)]||_0x5598d9(0x39f);return this[_0x5598d9(0x2b1)](_0x5e9975,_0x53aa7f,_0x596e3d,_0x3a41bc),_0x5e9975[_0x5598d9(0x3a2)]?0x0:0x1;}[a31_0xdea3fe(0x2b1)](_0x27cdd9,_0x35405b,_0x85fa1d,_0x524894){const _0x3530ad=a31_0xdea3fe;console[_0x3530ad(0x3bb)]('\x0a'+a31_0xd5335b[_0x3530ad(0x3a4)](_0x3530ad(0x204))+'\x20'+_0x27cdd9[_0x3530ad(0x358)]),console[_0x3530ad(0x3bb)]('═'[_0x3530ad(0x2d6)](0x3c)),this[_0x3530ad(0x306)](_0x27cdd9);if(typeof _0x35405b[_0x3530ad(0x1e5)]===_0x3530ad(0x222)){this[_0x3530ad(0x22f)](_0x27cdd9),this[_0x3530ad(0x2f0)](_0x27cdd9),this[_0x3530ad(0x284)](_0x85fa1d,_0x524894,'attribute',_0x35405b['attribute']);return;}if(_0x35405b[_0x3530ad(0x1e5)]===!![]){this['displayAttributesStats'](_0x27cdd9),this[_0x3530ad(0x2f0)](_0x27cdd9),this[_0x3530ad(0x284)](_0x85fa1d,_0x524894,_0x3530ad(0x35c));return;}if(typeof _0x35405b[_0x3530ad(0x3c3)]===_0x3530ad(0x222)){this[_0x3530ad(0x2b3)](_0x27cdd9,_0x524894),this[_0x3530ad(0x2f0)](_0x27cdd9),this[_0x3530ad(0x284)](_0x85fa1d,_0x524894,_0x3530ad(0x3c3),_0x35405b[_0x3530ad(0x3c3)]);return;}if(_0x35405b[_0x3530ad(0x3c3)]===!![]){this[_0x3530ad(0x2b3)](_0x27cdd9,_0x524894),this['displaySummary'](_0x27cdd9),this[_0x3530ad(0x284)](_0x85fa1d,_0x524894,_0x3530ad(0x24c));return;}this[_0x3530ad(0x22f)](_0x27cdd9),this[_0x3530ad(0x2b3)](_0x27cdd9,_0x524894),this['displayRealtimeInfo'](_0x27cdd9),this[_0x3530ad(0x2f0)](_0x27cdd9),this[_0x3530ad(0x284)](_0x85fa1d,_0x524894,_0x3530ad(0x21b));}[a31_0xdea3fe(0x1db)](_0xd31734){displayRealtimeValidation(_0xd31734);}[a31_0xdea3fe(0x284)](_0x4379ad,_0x5f3e53,_0x3a5f9f,_0x4614e3){const _0xf45975=a31_0xdea3fe;console[_0xf45975(0x3bb)]('\x0a'+a31_0xd5335b[_0xf45975(0x297)](_0xf45975(0x238)));const _0x501368=_0x5f3e53!==_0xf45975(0x39f)?'\x20--interval\x20'+_0x5f3e53:'';if(_0x3a5f9f===_0xf45975(0x1e5)&&_0x4614e3)console[_0xf45975(0x3bb)]('\x20\x20'+a31_0xd5335b[_0xf45975(0x297)](_0xf45975(0x348)+_0x4379ad+_0xf45975(0x309)+_0x4614e3+'\x22'+_0x501368));else{if(_0x3a5f9f===_0xf45975(0x3c3)&&_0x4614e3)console[_0xf45975(0x3bb)]('\x20\x20'+a31_0xd5335b[_0xf45975(0x297)](_0xf45975(0x348)+_0x4379ad+_0xf45975(0x2ab)+_0x4614e3+'\x22'+_0x501368));else(_0x3a5f9f===_0xf45975(0x35c)||_0x3a5f9f===_0xf45975(0x21b))&&console[_0xf45975(0x3bb)]('\x20\x20'+a31_0xd5335b[_0xf45975(0x297)](_0xf45975(0x348)+_0x4379ad+_0xf45975(0x3cf)+_0x501368));}(_0x3a5f9f===_0xf45975(0x24c)||_0x3a5f9f===_0xf45975(0x21b))&&console[_0xf45975(0x3bb)]('\x20\x20'+a31_0xd5335b['dim'](_0xf45975(0x348)+_0x4379ad+_0xf45975(0x1d4)+_0x501368)),_0x3a5f9f===_0xf45975(0x21b)&&console[_0xf45975(0x3bb)]('\x20\x20'+a31_0xd5335b[_0xf45975(0x297)](_0xf45975(0x348)+_0x4379ad+'\x20--enriched'+_0x501368));}[a31_0xdea3fe(0x306)](_0xdd1cca){const _0x5e6b35=a31_0xdea3fe,{master:_0x3d7db1}=_0xdd1cca,_0x36bf0b=_0x3d7db1[_0x5e6b35(0x299)]?a31_0xd5335b[_0x5e6b35(0x208)]('✔'):a31_0xd5335b['red']('✘');console[_0x5e6b35(0x3bb)]('\x0a'+a31_0xd5335b[_0x5e6b35(0x297)](_0x5e6b35(0x221))),console[_0x5e6b35(0x3bb)](_0x36bf0b+'\x20'+a31_0xd5335b['bold'](_0x3d7db1[_0x5e6b35(0x247)]+'.'+_0x3d7db1['table'])),_0x3d7db1[_0x5e6b35(0x299)]?_0x3d7db1['rowCount']!==undefined&&console[_0x5e6b35(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x5e6b35(0x297)](_0x5e6b35(0x371))+'\x20'+a31_0xd5335b[_0x5e6b35(0x325)](formatRows(_0x3d7db1[_0x5e6b35(0x316)]))):console[_0x5e6b35(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x5e6b35(0x1c5)]('Error:')+'\x20'+_0x3d7db1[_0x5e6b35(0x298)]);}['displayAttributesStats'](_0x3f4ce5){const _0x53bd3a=a31_0xdea3fe;if(_0x3f4ce5[_0x53bd3a(0x35c)]['length']===0x0)return;console['error']('\x0a'+a31_0xd5335b[_0x53bd3a(0x297)](_0x53bd3a(0x364)));for(const _0x77a4e9 of _0x3f4ce5[_0x53bd3a(0x35c)]){const _0x2e6305=_0x77a4e9[_0x53bd3a(0x299)]?a31_0xd5335b['green']('✔'):a31_0xd5335b['red']('✘');let _0x42e024='';if(_0x77a4e9['schemaValid']&&_0x77a4e9[_0x53bd3a(0x37c)]!==undefined&&_0x77a4e9[_0x53bd3a(0x20e)]!==undefined){const _0x5c8280=_0x77a4e9[_0x53bd3a(0x20e)]['toFixed'](0x1),_0x3f5c2e=_0x77a4e9[_0x53bd3a(0x20e)]>=0x50?a31_0xd5335b['green']:_0x77a4e9[_0x53bd3a(0x20e)]>=0x32?a31_0xd5335b[_0x53bd3a(0x2e5)]:a31_0xd5335b['red'];_0x42e024='\x20'+a31_0xd5335b['dim'](_0x53bd3a(0x24e))+'\x20'+_0x3f5c2e(_0x5c8280+'%')+'\x20('+formatRows(_0x77a4e9['matchedCount'])+_0x53bd3a(0x366);}console[_0x53bd3a(0x3bb)](_0x2e6305+'\x20'+a31_0xd5335b[_0x53bd3a(0x3a4)](_0x77a4e9['name'])+_0x42e024),console[_0x53bd3a(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x53bd3a(0x297)](_0x53bd3a(0x307))+'\x20'+a31_0xd5335b[_0x53bd3a(0x3a4)](_0x77a4e9[_0x53bd3a(0x247)]+'.'+_0x77a4e9[_0x53bd3a(0x3cb)]));const _0x35b265=_0x77a4e9[_0x53bd3a(0x30f)]===_0x77a4e9[_0x53bd3a(0x291)]?a31_0xd5335b[_0x53bd3a(0x297)](_0x53bd3a(0x2c3))+'\x20'+_0x77a4e9[_0x53bd3a(0x30f)]:a31_0xd5335b[_0x53bd3a(0x297)](_0x53bd3a(0x1bc))+'\x20'+_0x77a4e9[_0x53bd3a(0x30f)]+_0x53bd3a(0x396)+_0x77a4e9['foreignKey'];console[_0x53bd3a(0x3bb)]('\x20\x20'+_0x35b265),console[_0x53bd3a(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x53bd3a(0x297)](_0x53bd3a(0x1e1))),this[_0x53bd3a(0x3b7)](_0x77a4e9['columns']),!_0x77a4e9[_0x53bd3a(0x299)]&&console[_0x53bd3a(0x3bb)]('\x20\x20'+a31_0xd5335b['red'](_0x53bd3a(0x27f))+'\x20'+_0x77a4e9[_0x53bd3a(0x298)]);}}['displayBehaviorsStats'](_0x386aa7,_0x3c4225){const _0x31c6e=a31_0xdea3fe;if(_0x386aa7[_0x31c6e(0x24c)]['length']===0x0)return;console[_0x31c6e(0x3bb)]('\x0a'+a31_0xd5335b['dim']('Behaviors')+'\x20'+a31_0xd5335b['dim']('('+_0x3c4225+')'));for(const _0x20b1bb of _0x386aa7[_0x31c6e(0x24c)]){const _0x2cb94a=_0x20b1bb[_0x31c6e(0x299)]?a31_0xd5335b['green']('✔'):a31_0xd5335b['red']('✘');let _0x59a2cf='';if(_0x20b1bb['schemaValid']&&_0x20b1bb['customersWithEvents']!==undefined&&_0x20b1bb[_0x31c6e(0x1be)]!==undefined){const _0x53b9be=_0x20b1bb['customerPercent']?.['toFixed'](0x1)||'?',_0x1b1356=(_0x20b1bb[_0x31c6e(0x303)]??0x0)>=0x32?a31_0xd5335b['green']:(_0x20b1bb[_0x31c6e(0x303)]??0x0)>=0x14?a31_0xd5335b[_0x31c6e(0x2e5)]:a31_0xd5335b['red'];_0x59a2cf='\x20'+a31_0xd5335b[_0x31c6e(0x297)](_0x31c6e(0x2e3))+'\x20'+_0x1b1356(formatRows(_0x20b1bb[_0x31c6e(0x38c)]))+'\x20('+_0x53b9be+'%)\x20'+a31_0xd5335b['dim'](_0x31c6e(0x272))+'\x20'+a31_0xd5335b['cyan'](formatRows(_0x20b1bb['totalEvents']));}console['error'](_0x2cb94a+'\x20'+a31_0xd5335b[_0x31c6e(0x3a4)](_0x20b1bb[_0x31c6e(0x358)])+_0x59a2cf),console[_0x31c6e(0x3bb)]('\x20\x20'+a31_0xd5335b['dim'](_0x31c6e(0x307))+'\x20'+a31_0xd5335b[_0x31c6e(0x3a4)](_0x20b1bb[_0x31c6e(0x247)]+'.'+_0x20b1bb['table']));const _0x4e675f=_0x20b1bb['joinKey']===_0x20b1bb[_0x31c6e(0x291)]?a31_0xd5335b[_0x31c6e(0x297)](_0x31c6e(0x2c3))+'\x20'+_0x20b1bb[_0x31c6e(0x30f)]:a31_0xd5335b[_0x31c6e(0x297)](_0x31c6e(0x1bc))+'\x20'+_0x20b1bb['joinKey']+_0x31c6e(0x396)+_0x20b1bb['foreignKey'];console['error']('\x20\x20'+_0x4e675f),console[_0x31c6e(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x31c6e(0x297)](_0x31c6e(0x1e1))),this[_0x31c6e(0x3b7)](_0x20b1bb[_0x31c6e(0x275)]),!_0x20b1bb[_0x31c6e(0x299)]&&console[_0x31c6e(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x31c6e(0x1c5)](_0x31c6e(0x27f))+'\x20'+_0x20b1bb['schemaError']);}}[a31_0xdea3fe(0x3b7)](_0x538cc6){const _0x36d3cb=a31_0xdea3fe;for(const _0x5b2f40 of _0x538cc6){_0x5b2f40['label']===_0x5b2f40[_0x36d3cb(0x300)]||_0x5b2f40[_0x36d3cb(0x300)]==='*'?console['error'](_0x36d3cb(0x242)+_0x5b2f40[_0x36d3cb(0x3b6)]):console[_0x36d3cb(0x3bb)]('\x20\x20\x20\x20-\x20'+_0x5b2f40['label']+'\x20'+a31_0xd5335b[_0x36d3cb(0x297)]('('+_0x5b2f40[_0x36d3cb(0x300)]+')'));}}[a31_0xdea3fe(0x2f0)](_0x4d1901){const _0x226815=a31_0xdea3fe;console['error']('─'[_0x226815(0x2d6)](0x3c));if(_0x4d1901[_0x226815(0x2ad)][_0x226815(0x2dd)]>0x0){console['error']('\x0a'+a31_0xd5335b[_0x226815(0x1c5)](_0x226815(0x27d)));for(const _0x15f62b of _0x4d1901[_0x226815(0x2ad)]){console[_0x226815(0x3bb)]('\x20\x20'+a31_0xd5335b['red']('•')+'\x20'+_0x15f62b);}}_0x4d1901[_0x226815(0x3a2)]&&console[_0x226815(0x3bb)]('\x0a'+a31_0xd5335b[_0x226815(0x208)]('✔')+_0x226815(0x245));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x317);[a31_0xdea3fe(0x1f4)]='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async[a31_0xdea3fe(0x2dc)](_0x327425){const _0x48b29b=a31_0xdea3fe,{options:_0x309b7e,args:_0x22fe3e,tdx:_0x50b76d}=_0x327425,_0x2e1b67=_0x309b7e,_0x52d397=_0x22fe3e[0x0]||_0x309b7e[_0x48b29b(0x256)];if(!_0x52d397)return showParentSegmentNotSetError(_0x48b29b(0x274)+_0x48b29b(0x1c0)+'Options\x20(one\x20required):\x0a'+_0x48b29b(0x1c6)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x48b29b(0x378)+_0x48b29b(0x30e)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x2e1b67[_0x48b29b(0x26a)]&&!_0x2e1b67[_0x48b29b(0x1e5)]&&!_0x2e1b67[_0x48b29b(0x3c3)]&&!_0x2e1b67['enriched'])return console[_0x48b29b(0x3bb)](a31_0xd5335b[_0x48b29b(0x1c5)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x48b29b(0x3bb)](_0x48b29b(0x223)),console[_0x48b29b(0x3bb)](_0x48b29b(0x1bf)),console[_0x48b29b(0x3bb)](_0x48b29b(0x399)),console[_0x48b29b(0x3bb)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x48b29b(0x3bb)](_0x48b29b(0x31e)),0x1;const _0x4544b=resolveYamlFile(_0x52d397);if(!existsSync(_0x4544b))return showFileNotFoundError(_0x4544b,_0x52d397),0x1;_0x2e1b67[_0x48b29b(0x2cf)]&&(console[_0x48b29b(0x3bb)]('Site:\x20'+_0x2e1b67[_0x48b29b(0x349)]),console['error'](_0x48b29b(0x379)+_0x4544b));let _0x5d1cbe;try{_0x5d1cbe=readFileSync(_0x4544b,_0x48b29b(0x281));}catch(_0x386098){const _0x1c68ec=_0x386098 instanceof Error?_0x386098['message']:String(_0x386098);return console[_0x48b29b(0x3bb)]('Error\x20reading\x20file:\x20'+_0x1c68ec),0x1;}let _0x4ae463;try{_0x4ae463=parseDef(_0x5d1cbe);}catch(_0x166b6d){const _0x21bb3f=_0x166b6d instanceof Error?_0x166b6d[_0x48b29b(0x2ee)]:String(_0x166b6d);return console[_0x48b29b(0x3bb)](a31_0xd5335b['red'](_0x48b29b(0x1ff)+_0x21bb3f)),0x1;}if(_0x2e1b67[_0x48b29b(0x1e5)]===!![]||_0x2e1b67[_0x48b29b(0x1e5)]===''){const _0x207a21=_0x4ae463['attributes']?.[_0x48b29b(0x267)](_0x3d6c26=>_0x3d6c26['name'])||[];if(_0x207a21[_0x48b29b(0x2dd)]===0x0)console['error'](a31_0xd5335b[_0x48b29b(0x1c5)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x48b29b(0x3bb)](a31_0xd5335b['red'](_0x48b29b(0x301))),console['error'](_0x48b29b(0x1e8));for(const _0x45faf5 of _0x207a21){console[_0x48b29b(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x48b29b(0x325)](_0x45faf5));}console[_0x48b29b(0x3bb)](_0x48b29b(0x2ba)+_0x52d397+_0x48b29b(0x309)+_0x207a21[0x0]+'\x22');}return 0x1;}if(_0x2e1b67[_0x48b29b(0x3c3)]===!![]||_0x2e1b67[_0x48b29b(0x3c3)]===''){const _0x1b158b=_0x4ae463['behaviors']?.[_0x48b29b(0x267)](_0x5d06a9=>_0x5d06a9['name'])||[];if(_0x1b158b[_0x48b29b(0x2dd)]===0x0)console[_0x48b29b(0x3bb)](a31_0xd5335b[_0x48b29b(0x1c5)](_0x48b29b(0x377)));else{console['error'](a31_0xd5335b['red'](_0x48b29b(0x212))),console[_0x48b29b(0x3bb)]('Available\x20behaviors:');for(const _0x5499a5 of _0x1b158b){console['error']('\x20\x20'+a31_0xd5335b['cyan'](_0x5499a5));}console['error'](_0x48b29b(0x2ba)+_0x52d397+_0x48b29b(0x2ab)+_0x1b158b[0x0]+'\x22');}return 0x1;}const _0x429992=createCommandSpinner(a31_0xd5335b[_0x48b29b(0x297)](_0x48b29b(0x2d8)),{'verbose':_0x2e1b67['verbose']});_0x429992[_0x48b29b(0x302)]();const _0x3d0f3b={'onProgress':_0x3e7b02=>{const _0x15860f=_0x48b29b;_0x429992[_0x15860f(0x3ac)]=formatProgressMessage(_0x3e7b02);}};if(_0x2e1b67[_0x48b29b(0x26a)])_0x3d0f3b[_0x48b29b(0x26a)]=!![];if(_0x2e1b67[_0x48b29b(0x1e5)]&&typeof _0x2e1b67[_0x48b29b(0x1e5)]===_0x48b29b(0x222))_0x3d0f3b[_0x48b29b(0x1e5)]=_0x2e1b67['attribute'];if(_0x2e1b67['behavior']&&typeof _0x2e1b67[_0x48b29b(0x3c3)]===_0x48b29b(0x222))_0x3d0f3b[_0x48b29b(0x3c3)]=_0x2e1b67['behavior'];if(_0x2e1b67['enriched'])_0x3d0f3b[_0x48b29b(0x2b2)]=!![];if(_0x2e1b67[_0x48b29b(0x21e)])_0x3d0f3b[_0x48b29b(0x21e)]=_0x2e1b67[_0x48b29b(0x21e)];let _0x52e040;try{_0x52e040=await _0x50b76d[_0x48b29b(0x2fe)][_0x48b29b(0x1e2)](_0x5d1cbe,_0x3d0f3b),_0x429992['stop']();}catch(_0x57a6cd){_0x429992[_0x48b29b(0x292)]();throw _0x57a6cd;}return await this['displayPreviewResults'](_0x52e040,{'master':_0x2e1b67['master'],'attribute':typeof _0x2e1b67['attribute']==='string'?_0x2e1b67[_0x48b29b(0x1e5)]:undefined,'behavior':typeof _0x2e1b67[_0x48b29b(0x3c3)]===_0x48b29b(0x222)?_0x2e1b67['behavior']:undefined,'enriched':_0x2e1b67[_0x48b29b(0x2b2)]}),_0x52e040[_0x48b29b(0x3a2)]?0x0:0x1;}async[a31_0xdea3fe(0x23a)](_0x23918d,_0x28c6fc){const _0x5007be=a31_0xdea3fe;console[_0x5007be(0x3bb)]('\x0a'+a31_0xd5335b[_0x5007be(0x3a4)](_0x5007be(0x3c4))+'\x20'+_0x23918d['name']),console[_0x5007be(0x3bb)]('═'['repeat'](0x3c));if(_0x28c6fc[_0x5007be(0x26a)]&&_0x23918d[_0x5007be(0x3a1)]){const _0x3211e1=a31_0xd5335b[_0x5007be(0x297)](_0x5007be(0x305))+'\x20'+a31_0xd5335b[_0x5007be(0x3a4)](_0x23918d[_0x5007be(0x26a)][_0x5007be(0x247)]+'.'+_0x23918d['master'][_0x5007be(0x3cb)]);await this['displaySampleData'](_0x3211e1,_0x23918d['sampleData']);}else{if(_0x28c6fc[_0x5007be(0x1e5)]&&_0x23918d[_0x5007be(0x3a1)]){const _0xcf2c00=a31_0xd5335b[_0x5007be(0x297)](_0x5007be(0x287))+'\x20'+a31_0xd5335b[_0x5007be(0x3a4)](_0x28c6fc[_0x5007be(0x1e5)]);await this[_0x5007be(0x2ea)](_0xcf2c00,_0x23918d['sampleData']);}else{if(_0x28c6fc[_0x5007be(0x3c3)]&&_0x23918d[_0x5007be(0x3a1)]){const _0x19ac03=a31_0xd5335b[_0x5007be(0x297)](_0x5007be(0x35f))+'\x20'+a31_0xd5335b[_0x5007be(0x3a4)](_0x28c6fc[_0x5007be(0x3c3)]);await this[_0x5007be(0x2ea)](_0x19ac03,_0x23918d['sampleData']);}else{if(_0x28c6fc[_0x5007be(0x2b2)]&&_0x23918d[_0x5007be(0x3a1)]){const _0x3288db=a31_0xd5335b['dim'](_0x5007be(0x257))+'\x20'+a31_0xd5335b[_0x5007be(0x3a4)](_0x5007be(0x36e));await this[_0x5007be(0x2ea)](_0x3288db,_0x23918d[_0x5007be(0x3a1)]);}else!_0x23918d[_0x5007be(0x3a1)]&&console['error'](_0x5007be(0x2d4));}}}if(_0x23918d[_0x5007be(0x2ad)][_0x5007be(0x2dd)]>0x0){console[_0x5007be(0x3bb)]('─'[_0x5007be(0x2d6)](0x3c)),console[_0x5007be(0x3bb)]('\x0a'+a31_0xd5335b[_0x5007be(0x1c5)]('Errors:'));for(const _0x58d510 of _0x23918d[_0x5007be(0x2ad)]){console['error']('\x20\x20'+a31_0xd5335b[_0x5007be(0x1c5)]('•')+'\x20'+_0x58d510);}}}async[a31_0xdea3fe(0x2ea)](_0x54a4c8,_0x161ac8){const _0x1cd85e=a31_0xdea3fe;if(_0x161ac8[_0x1cd85e(0x2dd)]===0x0){console[_0x1cd85e(0x3bb)]('\x0a'+_0x54a4c8),console[_0x1cd85e(0x3bb)](_0x1cd85e(0x319));return;}console[_0x1cd85e(0x3bb)]('\x0a'+_0x54a4c8);const _0x857feb=Object[_0x1cd85e(0x35a)](_0x161ac8[0x0])[_0x1cd85e(0x267)](_0xa459de=>({'name':_0xa459de,'type':typeof _0x161ac8[0x0][_0xa459de]===_0x1cd85e(0x3ab)?_0x1cd85e(0x332):_0x1cd85e(0x2aa)})),_0x5ea218={'queryId':_0x1cd85e(0x360),'columns':_0x857feb,'data':_0x161ac8,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x161ac8[_0x1cd85e(0x2dd)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x4e3e52=formatAsTable(_0x5ea218,_0x161ac8[_0x1cd85e(0x2dd)],!![]);await writeOutput(_0x4e3e52,undefined,_0x1cd85e(0x3cb));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0xdea3fe(0x358)]='segment:parent:run';[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x240);async['execute'](_0x402a47){const _0x974166=a31_0xdea3fe,{options:_0x3b5ddc,args:_0x390755,tdx:_0x3e199a}=_0x402a47,_0x59df4e=_0x3b5ddc,_0xcfdaf0=_0x390755[0x0]||_0x3b5ddc['parentSegment'];if(!_0xcfdaf0)return showParentSegmentNotSetError(_0x974166(0x29d)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x3a8e68=resolveYamlFile(_0xcfdaf0);if(existsSync(_0x3a8e68)){_0x59df4e[_0x974166(0x2cf)]&&console[_0x974166(0x3bb)](_0x974166(0x280)+_0x3a8e68);let _0x15b2ba;try{_0x15b2ba=readFileSync(_0x3a8e68,_0x974166(0x281));}catch(_0x423e35){const _0x7eef24=_0x423e35 instanceof Error?_0x423e35[_0x974166(0x2ee)]:String(_0x423e35);return console[_0x974166(0x3bb)](_0x974166(0x3ae)+_0x7eef24),0x1;}const _0x54e855=await withSpinner(_0x974166(0x22b),()=>_0x3e199a[_0x974166(0x2fe)]['pushParentYaml'](_0x15b2ba),{'verbose':_0x59df4e[_0x974166(0x2cf)]}),_0x408aa2=_0x54e855[_0x974166(0x2b6)],{isNew:_0x5b51e4,name:_0x1b5938,hasChanges:_0x5c3704,diffFormatted:_0x1ed382}=_0x408aa2;if(_0x5c3704){_0x5b51e4?console[_0x974166(0x3bb)](_0x974166(0x235)+_0x1b5938+'\x27:'):console['error'](_0x974166(0x283)+_0x1b5938+'\x27:');console[_0x974166(0x3bb)]('─'[_0x974166(0x2d6)](0x3c)),console['error'](_0x1ed382),console[_0x974166(0x3bb)]('─'['repeat'](0x3c));const _0xd2d1f=_0x5b51e4?'Create\x20parent\x20segment\x20\x27'+_0x1b5938+_0x974166(0x381):_0x974166(0x2b7)+_0x1b5938+_0x974166(0x381);if(!_0x59df4e[_0x974166(0x312)]){if(!isInteractive())return console[_0x974166(0x3bb)](a31_0xd5335b[_0x974166(0x1c5)](_0x974166(0x2f3)),_0x974166(0x340)),console[_0x974166(0x3bb)](a31_0xd5335b['dim'](_0x974166(0x324))),0x1;const _0x277fe4=await confirmKey(_0xd2d1f);if(!_0x277fe4)return console[_0x974166(0x3bb)](a31_0xd5335b[_0x974166(0x2e5)]('Aborted.')),0x1;}const _0x5d7cc7=_0x5b51e4?_0x974166(0x311):'Updating';await withSpinner(_0x5d7cc7+_0x974166(0x289)+_0x1b5938+'\x27...',()=>_0x408aa2[_0x974166(0x2d3)](),{'verbose':_0x59df4e['verbose']});const _0x1218a2=_0x5b51e4?_0x974166(0x243):_0x974166(0x1f7);console['error']('✔\x20'+_0x1218a2+_0x974166(0x289)+_0x1b5938+'\x27');}else console[_0x974166(0x3bb)](_0x974166(0x1e7)+_0x1b5938+_0x974166(0x33c));}const _0x205be0=await withSpinner(_0x974166(0x335)+_0xcfdaf0+'\x27...',()=>_0x3e199a[_0x974166(0x2fe)]['runParent'](_0xcfdaf0),{'verbose':_0x59df4e[_0x974166(0x2cf)]}),_0x58f4fd=_0x205be0[_0x974166(0x2b6)],_0x4cae45=getConsoleUrl(_0x59df4e['site'],_0x974166(0x365)+_0x58f4fd[_0x974166(0x1c3)]+_0x974166(0x2d2)+_0x58f4fd[_0x974166(0x2df)]+_0x974166(0x1f8)+_0x58f4fd[_0x974166(0x286)]);return console[_0x974166(0x3bb)](_0x974166(0x1d0)),console[_0x974166(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x974166(0x297)](_0x974166(0x315))+'\x20'+_0x58f4fd['audienceId']),console[_0x974166(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x974166(0x297)](_0x974166(0x373))+'\x20'+_0x58f4fd[_0x974166(0x33d)]),console['error']('\x20\x20'+a31_0xd5335b['dim']('Session:')+'\x20'+_0x58f4fd[_0x974166(0x2df)]),console[_0x974166(0x3bb)]('\x20\x20'+a31_0xd5335b[_0x974166(0x297)](_0x974166(0x29f))+'\x20'+_0x58f4fd[_0x974166(0x286)]),console[_0x974166(0x3bb)]('\x20\x20'+_0x4cae45),console[_0x974166(0x3bb)]('\x0a'+a31_0xd5335b[_0x974166(0x297)](_0x974166(0x2f9))+_0x974166(0x282)+_0x58f4fd[_0x974166(0x286)]+_0x974166(0x347)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x2c2);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x265);async[a31_0xdea3fe(0x2dc)](_0x2f8c38){const _0x50980c=a31_0xdea3fe,{options:_0x535e69,args:_0x544374,tdx:_0x2ebb20}=_0x2f8c38,_0x79ed86=_0x544374[0x0]||_0x535e69['parentSegment'];if(!_0x79ed86)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+_0x50980c(0x202)),0x1;_0x535e69[_0x50980c(0x2cf)]&&(console[_0x50980c(0x3bb)](_0x50980c(0x2cd)+_0x535e69['site']),console[_0x50980c(0x3bb)](_0x50980c(0x3c9)+_0x79ed86));const _0x36fbf4=await withSpinner(_0x50980c(0x1c7)+_0x79ed86+_0x50980c(0x23b),()=>_0x2ebb20[_0x50980c(0x2fe)][_0x50980c(0x2b5)](_0x79ed86),{'verbose':_0x535e69[_0x50980c(0x2cf)]}),_0x3df165=_0x36fbf4[_0x50980c(0x2b6)];console[_0x50980c(0x3bb)](_0x50980c(0x220)+_0x3df165[_0x50980c(0x2dd)]+_0x50980c(0x314)+(_0x3df165[_0x50980c(0x2dd)]!==0x1?'s':''));if(_0x535e69[_0x50980c(0x2b8)]||_0x535e69[_0x50980c(0x39c)])return await handleSDKOutput(_0x3df165,_0x535e69),0x0;return displayFieldsHumanReadable(_0x3df165,_0x79ed86),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x3bd);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x350);async[a31_0xdea3fe(0x2dc)](_0x1a6c6a){const _0x5c462e=a31_0xdea3fe,{options:_0x3c76c1,args:_0x3bf536,tdx:_0xbc6a50}=_0x1a6c6a,_0x24968d=_0x3c76c1,_0x47b1bd=_0x3bf536[0x0]||_0x3c76c1[_0x5c462e(0x256)];if(!_0x47b1bd)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'+_0x5c462e(0x1f9)+_0x5c462e(0x25e)+_0x5c462e(0x2c8)),0x1;_0x3c76c1[_0x5c462e(0x2cf)]&&(console[_0x5c462e(0x3bb)](_0x5c462e(0x2cd)+_0x3c76c1[_0x5c462e(0x349)]),console[_0x5c462e(0x3bb)](_0x5c462e(0x3c9)+_0x47b1bd));const _0x886c52=await withSpinner(_0x5c462e(0x32f)+_0x47b1bd+_0x5c462e(0x23b),()=>_0xbc6a50[_0x5c462e(0x2fe)]['getParentFull'](_0x47b1bd),{'verbose':_0x3c76c1[_0x5c462e(0x2cf)]}),_0x4d6e26=_0x886c52[_0x5c462e(0x2b6)];if(_0x24968d[_0x5c462e(0x270)]){const _0x2fc714=getConsoleNextUrl(_0x24968d[_0x5c462e(0x349)],'/app/dw/parentSegments/'+_0x4d6e26['id']);return console[_0x5c462e(0x3bb)](a31_0xd5335b[_0x5c462e(0x208)]('✔')+_0x5c462e(0x32a)+a31_0xd5335b[_0x5c462e(0x325)](_0x2fc714)),openBrowser(_0x2fc714),0x0;}return await handleSingleObjectOutput(_0x4d6e26,_0x3c76c1),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x2e6);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x313);async['execute'](_0x57e267){const _0x548b71=a31_0xdea3fe,{options:_0x24c746,args:_0x2caea5,tdx:_0x12dddc}=_0x57e267,_0x240b4d=_0x24c746,_0xb29879=_0x2caea5[0x0]||_0x24c746[_0x548b71(0x256)];if(!_0xb29879)return showParentSegmentNotSetError(_0x548b71(0x2ec)+'\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'+_0x548b71(0x25e)+_0x548b71(0x353)),0x1;_0x24c746[_0x548b71(0x2cf)]&&(console[_0x548b71(0x3bb)](_0x548b71(0x2cd)+_0x24c746[_0x548b71(0x349)]),console[_0x548b71(0x3bb)](_0x548b71(0x3c9)+_0xb29879));const _0x3c96b6=await withSpinner(_0x548b71(0x203)+_0xb29879+_0x548b71(0x23b),()=>_0x12dddc[_0x548b71(0x2fe)][_0x548b71(0x3d1)](_0xb29879),{'verbose':_0x24c746[_0x548b71(0x2cf)]}),_0x335c6=_0x3c96b6[_0x548b71(0x2b6)],_0x445da2=_0x12dddc['segment'][_0x548b71(0x244)](_0x335c6);if(_0x240b4d[_0x548b71(0x346)]){const _0x3ec9d6=await this[_0x548b71(0x1fe)](_0x57e267,_0xb29879,_0x335c6,_0x445da2),_0x161469=this[_0x548b71(0x1c1)](_0x3ec9d6);writeFileSync(_0x240b4d[_0x548b71(0x346)],_0x161469);const _0x34380f=_0x3ec9d6[_0x548b71(0x33b)][_0x548b71(0x275)][_0x548b71(0x2dd)]+_0x3ec9d6['behaviors'][_0x548b71(0x3ba)]((_0x534f9b,_0x3109d1)=>_0x534f9b+_0x3109d1['columns'][_0x548b71(0x2dd)],0x0),_0x35dc49=_0x3ec9d6[_0x548b71(0x24c)][_0x548b71(0x31c)](_0x314a33=>_0x314a33[_0x548b71(0x275)]['length']===0x0)[_0x548b71(0x2dd)];return console[_0x548b71(0x231)](_0x548b71(0x1d6)+_0x240b4d[_0x548b71(0x346)]),console[_0x548b71(0x231)]('\x20\x20Database:\x20'+_0x445da2),console[_0x548b71(0x231)](_0x548b71(0x2fa)+_0x3ec9d6['behaviors']['length']+_0x548b71(0x2e0)),console['log'](_0x548b71(0x21a)+_0x34380f+'\x20total'),_0x35dc49>0x0&&console['log']('\x20\x20Note:\x20'+_0x35dc49+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console['error']('\x0a'+a31_0xd5335b[_0x548b71(0x3a4)](_0x548b71(0x38d))+'\x20'+a31_0xd5335b[_0x548b71(0x325)](_0x445da2));const _0x309133=await withSpinner(_0x548b71(0x361),()=>_0x12dddc[_0x548b71(0x2fe)][_0x548b71(0x2e7)](_0x335c6),{'verbose':_0x24c746[_0x548b71(0x2cf)]});console[_0x548b71(0x3bb)]('\x0a'+a31_0xd5335b[_0x548b71(0x3a4)](_0x548b71(0x33b))+'\x20'+a31_0xd5335b[_0x548b71(0x297)]('('+_0x445da2+_0x548b71(0x279)));const _0x596d7b=await executeSchemaQuery(_0x309133[_0x548b71(0x2b6)],_0x12dddc,_0x24c746);await handleQueryOutput(_0x596d7b,_0x24c746);const _0x320430=await withSpinner(_0x548b71(0x375),()=>_0x12dddc[_0x548b71(0x2fe)][_0x548b71(0x333)](_0x335c6),{'verbose':_0x24c746[_0x548b71(0x2cf)]});for(const _0x2388b9 of _0x320430[_0x548b71(0x2b6)]){const _0x5aecea=_0x548b71(0x3c6)+_0x2388b9['toLowerCase']()[_0x548b71(0x25a)](/\s+/g,'_'),_0xf52e1c=_0x548b71(0x285)+_0x445da2+'.'+_0x5aecea;console[_0x548b71(0x3bb)]('\x0a'+a31_0xd5335b[_0x548b71(0x3a4)](_0x2388b9)+'\x20'+a31_0xd5335b[_0x548b71(0x297)]('('+_0x445da2+'.'+_0x5aecea+')'));try{const _0x5dd843=await executeSchemaQuery(_0xf52e1c,_0x12dddc,_0x24c746);await handleQueryOutput(_0x5dd843,_0x24c746);}catch{console[_0x548b71(0x3bb)](a31_0xd5335b['yellow'](_0x548b71(0x3a7)));}}return 0x0;}async[a31_0xdea3fe(0x1fe)](_0x2c75ce,_0x308d42,_0x20804c,_0x38b349){const _0x49f756=a31_0xdea3fe,{options:_0x365043,tdx:_0x2e793a}=_0x2c75ce,_0x3c4cd8=await withSpinner(_0x49f756(0x361),()=>_0x2e793a['segment'][_0x49f756(0x2e7)](_0x20804c),{'verbose':_0x365043[_0x49f756(0x2cf)]}),_0x3a8bc3=await executeSchemaQuery(_0x3c4cd8[_0x49f756(0x2b6)],_0x2e793a,_0x365043),_0x67d0dc=_0x3a8bc3[_0x49f756(0x2b6)]['map'](_0x57a917=>({'name':_0x57a917['column_name'],'type':_0x57a917['column_type']})),_0x5d760b=await withSpinner(_0x49f756(0x375),()=>_0x2e793a[_0x49f756(0x2fe)]['getBehaviorNames'](_0x20804c),{'verbose':_0x365043[_0x49f756(0x2cf)]}),_0x34b96f=[];for(const _0x2bdc0b of _0x5d760b['data']){const _0x171543=_0x49f756(0x3c6)+_0x2bdc0b[_0x49f756(0x226)]()[_0x49f756(0x25a)](/\s+/g,'_'),_0x2b4b35='SELECT\x20*\x20FROM\x20'+_0x38b349+'.'+_0x171543;let _0x266828=[];try{const _0x39f630=await executeSchemaQuery(_0x2b4b35,_0x2e793a,_0x365043);_0x266828=_0x39f630[_0x49f756(0x2b6)][_0x49f756(0x267)](_0x13cfe8=>({'name':_0x13cfe8['column_name'],'type':_0x13cfe8[_0x49f756(0x21f)]}));}catch{}_0x34b96f['push']({'table':_0x171543,'columns':_0x266828});}return{'database':_0x38b349,'parent_segment':_0x308d42,'parent_id':_0x20804c,'customers':{'table':_0x49f756(0x33b),'columns':_0x67d0dc},'behaviors':_0x34b96f};}[a31_0xdea3fe(0x1c1)](_0x1ad3fd){const _0x14f416=a31_0xdea3fe,_0x3b3bd8=_0x4625ba=>{const _0x5dd882=a31_0x4b02;if(_0x4625ba[_0x5dd882(0x2dd)]===0x0)return'[]';const _0x5b8639=_0x4625ba[_0x5dd882(0x267)](_0x586587=>_0x5dd882(0x1eb)+_0x586587[_0x5dd882(0x358)]+_0x5dd882(0x217)+_0x586587[_0x5dd882(0x1ed)]+'\x22\x20}');return'[\x0a'+_0x5b8639[_0x5dd882(0x23f)](',\x0a')+_0x5dd882(0x1dd);},_0x4dc6ab=_0x1ad3fd[_0x14f416(0x24c)][_0x14f416(0x267)](_0xd6396d=>{const _0x47c324=_0x14f416;return _0x47c324(0x1f0)+_0xd6396d[_0x47c324(0x3cb)]+_0x47c324(0x2ef)+_0x3b3bd8(_0xd6396d[_0x47c324(0x275)])[_0x47c324(0x25a)](/^/gm,'\x20\x20')['trim']()+_0x47c324(0x1ea);})[_0x14f416(0x23f)](',\x0a');return _0x14f416(0x2a4)+_0x1ad3fd[_0x14f416(0x247)]+_0x14f416(0x201)+_0x1ad3fd[_0x14f416(0x213)]+_0x14f416(0x3b4)+_0x1ad3fd[_0x14f416(0x2f5)]+_0x14f416(0x28d)+_0x1ad3fd[_0x14f416(0x33b)][_0x14f416(0x3cb)]+_0x14f416(0x2c7)+_0x3b3bd8(_0x1ad3fd['customers'][_0x14f416(0x275)])[_0x14f416(0x25a)](/^/gm,'\x20\x20')['trim']()+_0x14f416(0x3c5)+_0x4dc6ab+_0x14f416(0x37a);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x2bb);['description']=a31_0xdea3fe(0x2f6);async[a31_0xdea3fe(0x2dc)](_0x42ad2f){const _0x175894=a31_0xdea3fe,{options:_0x1e6068,args:_0xa873b0,tdx:_0x3c56e5}=_0x42ad2f,_0x2d4c1f=_0xa873b0[0x0]||_0x1e6068[_0x175894(0x256)];if(!_0x2d4c1f)return showParentSegmentNotSetError(_0x175894(0x394)+_0x175894(0x304)),0x1;_0x1e6068[_0x175894(0x2cf)]&&(console[_0x175894(0x3bb)](_0x175894(0x2cd)+_0x1e6068[_0x175894(0x349)]),console[_0x175894(0x3bb)]('Parent\x20segment:\x20'+_0x2d4c1f));const _0x1b0ad3=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2d4c1f+_0x175894(0x23b),()=>_0x3c56e5['segment'][_0x175894(0x3d1)](_0x2d4c1f),{'verbose':_0x1e6068[_0x175894(0x2cf)]}),_0x4808f3=_0x1b0ad3[_0x175894(0x2b6)],_0x42854f=await withSpinner(_0x175894(0x2e4)+_0x2d4c1f+_0x175894(0x23b),()=>_0x3c56e5['segment'][_0x175894(0x2e7)](_0x4808f3),{'verbose':_0x1e6068[_0x175894(0x2cf)]}),_0x2c7a4b=_0x42854f[_0x175894(0x2b6)];return _0x1e6068[_0x175894(0x322)]===_0x175894(0x2b8)||_0x1e6068[_0x175894(0x322)]==='jsonl'?await handleSDKOutput([{'sql':_0x2c7a4b}],_0x1e6068):console[_0x175894(0x231)](_0x2c7a4b),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']='segment:parent:show';[a31_0xdea3fe(0x1f4)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x209a76){const _0x3ab3a9=a31_0xdea3fe,{options:_0xc1e2ef,args:_0x4329ee,tdx:_0x545bdb}=_0x209a76,_0x4895f4=_0x4329ee[0x0]||_0xc1e2ef[_0x3ab3a9(0x256)];if(!_0x4895f4)return showParentSegmentNotSetError(_0x3ab3a9(0x39b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0xc1e2ef[_0x3ab3a9(0x2cf)]&&(console['error'](_0x3ab3a9(0x2cd)+_0xc1e2ef[_0x3ab3a9(0x349)]),console['error'](_0x3ab3a9(0x3c9)+_0x4895f4));const _0x3825de=await withSpinner(_0x3ab3a9(0x203)+_0x4895f4+_0x3ab3a9(0x23b),()=>_0x545bdb['segment'][_0x3ab3a9(0x3d1)](_0x4895f4),{'verbose':_0xc1e2ef[_0x3ab3a9(0x2cf)]}),_0x463e3d=_0x3825de[_0x3ab3a9(0x2b6)],_0x1b1c40=await withSpinner(_0x3ab3a9(0x2e4)+_0x4895f4+_0x3ab3a9(0x23b),()=>_0x545bdb['segment'][_0x3ab3a9(0x2e7)](_0x463e3d),{'verbose':_0xc1e2ef[_0x3ab3a9(0x2cf)]});let _0x33d60d=_0x1b1c40[_0x3ab3a9(0x2b6)];const _0x5a156a=resolveLimit(_0xc1e2ef[_0x3ab3a9(0x30b)],DEFAULT_DISPLAY_LIMIT),_0x571ffd=/\bLIMIT\s+\d+/i[_0x3ab3a9(0x1d5)](_0x33d60d);!_0x571ffd&&(_0x33d60d=_0x33d60d['trim']()['replace'](/;+$/,''),_0x33d60d=_0x3ab3a9(0x3bc)+_0x33d60d+_0x3ab3a9(0x382)+_0x5a156a);_0xc1e2ef[_0x3ab3a9(0x2cf)]&&console[_0x3ab3a9(0x3bb)](_0x3ab3a9(0x2fc)+_0x33d60d);const _0x223c73=await withProgressSpinner(_0x3ab3a9(0x22a),async _0x5edec8=>{const _0xab8ee3=_0x3ab3a9,_0x2ec09c=await _0x545bdb[_0xab8ee3(0x34a)]['execute'](_0x33d60d,{'catalog':'td','schema':_0xab8ee3(0x38e),'onJobId':_0x54771b=>{const _0x486b3e=_0xab8ee3;_0x5edec8[_0x486b3e(0x3a9)](_0x54771b);}});return _0x2ec09c;},{'verbose':_0xc1e2ef[_0x3ab3a9(0x2cf)]}),_0x56c29f=_0x223c73[_0x3ab3a9(0x2b6)],_0x34e9f3=_0x56c29f[_0x3ab3a9(0x32d)]?_0x3ab3a9(0x26f)+_0x56c29f[_0x3ab3a9(0x32d)]+']':'';return console[_0x3ab3a9(0x3bb)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x56c29f[_0x3ab3a9(0x376)][_0x3ab3a9(0x20f)][_0x3ab3a9(0x386)]()+'\x20rows\x20'+(_0x3ab3a9(0x23d)+formatElapsed(_0x56c29f[_0x3ab3a9(0x376)][_0x3ab3a9(0x1d1)])+_0x34e9f3)),await handleQueryOutput(_0x56c29f,_0xc1e2ef),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x2c5);[a31_0xdea3fe(0x1f4)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async['execute'](_0x3cde45){const _0x1ada44=a31_0xdea3fe,{options:_0x39f65c,args:_0x141cd7,tdx:_0x56499b}=_0x3cde45,_0x517a82=_0x141cd7[0x0],_0x5bb458=await withSpinner(_0x517a82?_0x1ada44(0x2a6)+_0x517a82+_0x1ada44(0x23b):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x56499b[_0x1ada44(0x339)][_0x1ada44(0x3ce)](),{'verbose':_0x39f65c[_0x1ada44(0x2cf)]});let _0x22be43=_0x5bb458[_0x1ada44(0x2b6)][_0x1ada44(0x31c)](_0x54a16f=>_0x54a16f[_0x1ada44(0x24b)]);if(_0x517a82){const _0x393839=_0x517a82[_0x1ada44(0x25a)](/[.+^${}()|[\]\\]/g,_0x1ada44(0x2c4))[_0x1ada44(0x25a)](/\*/g,'.*')[_0x1ada44(0x25a)](/\?/g,'.'),_0x4c1d1f=new RegExp('^'+_0x393839+'$','i');_0x22be43=_0x22be43[_0x1ada44(0x31c)](_0x1e5c8c=>_0x4c1d1f['test'](_0x1e5c8c['name']));}_0x22be43['sort']((_0x3782c5,_0x3636f0)=>_0x3782c5[_0x1ada44(0x358)][_0x1ada44(0x263)](_0x3636f0[_0x1ada44(0x358)])),console['error'](_0x1ada44(0x220)+_0x22be43[_0x1ada44(0x2dd)]+_0x1ada44(0x2fb)+(_0x22be43['length']!==0x1?'s':''));const _0x56e888=_0x4ce363=>{const _0x4eb356=_0x1ada44;return getConsoleNextUrl(_0x39f65c[_0x4eb356(0x349)],_0x4eb356(0x3be)+_0x4ce363);};if(_0x39f65c[_0x1ada44(0x322)]===_0x1ada44(0x2b8)||_0x39f65c[_0x1ada44(0x322)]===_0x1ada44(0x39c)){const _0x185522=_0x22be43[_0x1ada44(0x267)](_0x4fa615=>({..._0x4fa615,'url':_0x56e888(_0x4fa615['id'])}));await handleSDKOutput(_0x185522,_0x39f65c);}else{if(_0x22be43[_0x1ada44(0x2dd)]===0x0)console[_0x1ada44(0x231)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x450669 of _0x22be43){const _0x2bfc98=_0x450669['population']?a31_0xd5335b['dim']('\x20('+formatRows(_0x450669[_0x1ada44(0x356)])+')'):'',_0x533c8a=hyperlink(_0x450669[_0x1ada44(0x358)],_0x56e888(_0x450669['id']));console['log']('⚡\x20'+_0x533c8a+_0x2bfc98);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x2d1);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x2a7);async[a31_0xdea3fe(0x2dc)](_0x5cf279){const _0xec16b=a31_0xdea3fe,{options:_0x34bf2a,args:_0x1c7fb6,tdx:_0x29d93f}=_0x5cf279,_0x209a80=_0x1c7fb6[0x0]||_0x34bf2a[_0xec16b(0x256)];if(!_0x209a80)return showParentSegmentNotSetError(_0xec16b(0x33e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment'),0x1;const _0x53006b=resolveYamlFile(_0x209a80);if(!existsSync(_0x53006b))return showFileNotFoundError(_0x53006b,_0x209a80),0x1;let _0x1443b3;try{_0x1443b3=readFileSync(_0x53006b,_0xec16b(0x281));}catch(_0x488f56){const _0xefab08=_0x488f56 instanceof Error?_0x488f56['message']:String(_0x488f56);return console[_0xec16b(0x3bb)](_0xec16b(0x3ae)+_0xefab08),0x1;}const _0x3d2df5=createCommandSpinner(a31_0xd5335b[_0xec16b(0x297)](_0xec16b(0x30a)),{'verbose':_0x34bf2a[_0xec16b(0x2cf)]});_0x3d2df5['start']();const _0x259cb6={'realtime':!![],'onProgress':_0x2e4ae4=>{const _0x108a23=_0xec16b;_0x3d2df5[_0x108a23(0x3ac)]=formatProgressMessage(_0x2e4ae4);}};let _0x352c13;try{_0x352c13=await _0x29d93f['segment'][_0xec16b(0x27c)](_0x1443b3,_0x259cb6),_0x3d2df5[_0xec16b(0x292)]();}catch(_0x3fa023){_0x3d2df5['stop']();throw _0x3fa023;}console[_0xec16b(0x3bb)]('\x0a'+a31_0xd5335b['bold'](_0xec16b(0x3c7))+'\x20'+_0x352c13[_0xec16b(0x358)]),console[_0xec16b(0x3bb)]('═'[_0xec16b(0x2d6)](0x3c)),displayRealtimeValidation(_0x352c13),console[_0xec16b(0x3bb)]('─'[_0xec16b(0x2d6)](0x3c));if(_0x352c13[_0xec16b(0x2ad)][_0xec16b(0x2dd)]>0x0){console[_0xec16b(0x3bb)]('\x0a'+a31_0xd5335b['red'](_0xec16b(0x27d)));for(const _0x1967a6 of _0x352c13[_0xec16b(0x2ad)]){console[_0xec16b(0x3bb)]('\x20\x20'+a31_0xd5335b[_0xec16b(0x1c5)]('•')+'\x20'+_0x1967a6);}}return _0x352c13[_0xec16b(0x3a2)]&&console['error']('\x0a'+a31_0xd5335b['green']('✔')+_0xec16b(0x326)),_0x352c13[_0xec16b(0x3a2)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{['name']=a31_0xdea3fe(0x367);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x34c);async['execute'](_0x3dae97){const _0xec3f39=a31_0xdea3fe,{options:_0x2d934a,args:_0x1facb4,tdx:_0x4f2373}=_0x3dae97,_0x5b3eef=_0x1facb4[0x0]||_0x2d934a['parentSegment'];if(!_0x5b3eef)return showParentSegmentNotSetError(_0xec3f39(0x241)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment'),0x1;_0x2d934a[_0xec3f39(0x2cf)]&&(console[_0xec3f39(0x3bb)](_0xec3f39(0x2cd)+_0x2d934a[_0xec3f39(0x349)]),console[_0xec3f39(0x3bb)]('Parent\x20segment:\x20'+_0x5b3eef));const _0x51d4f8=await withSpinner(_0xec3f39(0x203)+_0x5b3eef+_0xec3f39(0x23b),()=>_0x4f2373[_0xec3f39(0x2fe)][_0xec3f39(0x3d1)](_0x5b3eef),{'verbose':_0x2d934a[_0xec3f39(0x2cf)]}),_0x196b4d=_0x51d4f8[_0xec3f39(0x2b6)],_0x12932a=await withSpinner(_0xec3f39(0x259)+_0x5b3eef+'\x27...',()=>_0x4f2373[_0xec3f39(0x339)][_0xec3f39(0x357)](_0x196b4d),{'verbose':_0x2d934a[_0xec3f39(0x2cf)]}),_0x5c73c6=_0x12932a['data'];console[_0xec3f39(0x3bb)](_0xec3f39(0x220)+_0x5c73c6['length']+_0xec3f39(0x210)+(_0x5c73c6[_0xec3f39(0x2dd)]!==0x1?'s':''));if(_0x2d934a['format']==='json'||_0x2d934a[_0xec3f39(0x322)]===_0xec3f39(0x39c))await handleSDKOutput(_0x5c73c6,_0x2d934a);else{if(_0x5c73c6[_0xec3f39(0x2dd)]===0x0)console[_0xec3f39(0x231)]('No\x20RT\x20journeys\x20found');else for(const _0x2b78da of _0x5c73c6){const _0x268cf7=_0x2b78da[_0xec3f39(0x385)]===_0xec3f39(0x24d)?'🚀':'📝',_0x363c02=_0x2b78da[_0xec3f39(0x2af)]?a31_0xd5335b[_0xec3f39(0x2e5)](_0xec3f39(0x38a)):'',_0x35ea81=a31_0xd5335b['dim']('\x20('+_0x2b78da[_0xec3f39(0x25f)]+'\x20stage'+(_0x2b78da[_0xec3f39(0x25f)]!==0x1?'s':'')+')');console[_0xec3f39(0x231)](_0x268cf7+'\x20'+_0x2b78da['name']+_0x363c02+_0x35ea81);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{['name']='ps:rt:jn:pause';[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x398);async[a31_0xdea3fe(0x2dc)](_0x34e220){const _0x599a9b=a31_0xdea3fe,{options:_0x2e454e,args:_0x24eb46,tdx:_0x5691a3}=_0x34e220,_0x1eea8f=_0x24eb46[0x0];if(!_0x1eea8f)return console['error'](a31_0xd5335b[_0x599a9b(0x1c5)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x599a9b(0x3bb)](_0x599a9b(0x323)),console[_0x599a9b(0x3bb)](a31_0xd5335b['dim']('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x2e454e[_0x599a9b(0x2cf)]&&(console['error'](_0x599a9b(0x2cd)+_0x2e454e['site']),console['error']('RT\x20Journey\x20ID:\x20'+_0x1eea8f));const _0x4edc32=await withSpinner(_0x599a9b(0x3b9)+_0x1eea8f+'\x27...',()=>_0x5691a3['realtime'][_0x599a9b(0x29b)](_0x1eea8f),{'verbose':_0x2e454e[_0x599a9b(0x2cf)]}),_0x3b2719=_0x4edc32[_0x599a9b(0x2b6)];console[_0x599a9b(0x3bb)](_0x599a9b(0x2bd)+_0x3b2719[_0x599a9b(0x358)]+'\x27');if(_0x2e454e[_0x599a9b(0x322)]===_0x599a9b(0x2b8)||_0x2e454e[_0x599a9b(0x322)]===_0x599a9b(0x39c))await handleSDKOutput([_0x3b2719],_0x2e454e);else{const _0x16641d=_0x3b2719[_0x599a9b(0x385)]===_0x599a9b(0x24d)?'🚀':'📝',_0x52f261=_0x3b2719[_0x599a9b(0x2af)]?a31_0xd5335b[_0x599a9b(0x2e5)](_0x599a9b(0x38a)):'';console['log'](_0x16641d+'\x20'+_0x3b2719['name']+_0x52f261);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x246);['description']=a31_0xdea3fe(0x2d0);async[a31_0xdea3fe(0x2dc)](_0x33192d){const _0xbb54c6=a31_0xdea3fe,{options:_0x128a05,args:_0x46df06,tdx:_0x17389b}=_0x33192d,_0x3a37be=_0x46df06[0x0];if(!_0x3a37be)return console['error'](a31_0xd5335b[_0xbb54c6(0x1c5)](_0xbb54c6(0x29a))),console[_0xbb54c6(0x3bb)](_0xbb54c6(0x3c2)),console[_0xbb54c6(0x3bb)](a31_0xd5335b[_0xbb54c6(0x297)](_0xbb54c6(0x1d8))),0x1;_0x128a05[_0xbb54c6(0x2cf)]&&(console[_0xbb54c6(0x3bb)](_0xbb54c6(0x2cd)+_0x128a05[_0xbb54c6(0x349)]),console[_0xbb54c6(0x3bb)]('RT\x20Journey\x20ID:\x20'+_0x3a37be));const _0x4a05f0=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x3a37be+'\x27...',()=>_0x17389b[_0xbb54c6(0x339)][_0xbb54c6(0x368)](_0x3a37be),{'verbose':_0x128a05[_0xbb54c6(0x2cf)]}),_0x40ac23=_0x4a05f0[_0xbb54c6(0x2b6)];console[_0xbb54c6(0x3bb)]('✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x40ac23['name']+'\x27');if(_0x128a05[_0xbb54c6(0x322)]===_0xbb54c6(0x2b8)||_0x128a05[_0xbb54c6(0x322)]===_0xbb54c6(0x39c))await handleSDKOutput([_0x40ac23],_0x128a05);else{const _0x4c9bc3=_0x40ac23['state']===_0xbb54c6(0x24d)?'🚀':'📝',_0x13a864=_0x40ac23[_0xbb54c6(0x2af)]?a31_0xd5335b[_0xbb54c6(0x2e5)](_0xbb54c6(0x38a)):'';console[_0xbb54c6(0x231)](_0x4c9bc3+'\x20'+_0x40ac23[_0xbb54c6(0x358)]+_0x13a864);}return 0x0;}}function a31_0x5df8(){const _0x58195c=['Next\x20steps:','td_client_id','green','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','ignore','folder-segment','listPersonalizations','entryCriteria','coveragePercent','processedRows','\x20RT\x20journey','\x20\x20\x20','Error:\x20--behavior\x20requires\x20a\x20name\x0a','parent_segment','Personalization\x20service\x20description','keyEventId:','1190535EHuMYe','\x22,\x20\x22type\x22:\x20\x22','Error:\x20--database\x20and\x20--table\x20are\x20required','sort','\x20\x20Columns:\x20','all','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','interval','column_type','✔\x20Found\x20','Master\x20Table','string','Options:','eventKind','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','toLowerCase','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','✔\x20Updated\x20parent\x20segment\x20\x27','platform','Executing\x20parent\x20segment\x20query...','Analyzing\x20changes...','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','win32','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','displayAttributesStats','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','log','Database:\x20','\x20\x20\x20\x20','idStitching','\x0aNew\x20parent\x20segment\x20\x27','No\x20personalizations\x20configured','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','To\x20view\x20sample\x20data:','entryCriteria:','displayPreviewResults','\x27...','/{name}.yml\x0a','in\x20','\x20true','join','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a','\x20\x20\x20\x20-\x20','Created','getOutputDatabaseName','\x20Configuration\x20is\x20valid','ps:rt:jn:resume','database','Error:\x20Parent\x20segment\x20name\x20is\x20required','sections:','No\x20parent\x20segments\x20match\x20pattern:\x20','realtime_enabled','behaviors','launched','Coverage:','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','sections','some','scheduleType','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','ps:pz:service:create','sourceTableError','parentSegment','Enriched:','audienceId:\x20','Listing\x20RT\x20journeys\x20for\x20\x27','replace','/\x20directories\x20exist.','segment:parent:push','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Options:\x0a','stageCount','✔\x20Created\x20personalization\x20service\x20\x27','Updating\x20parent\x20segment\x20\x27','Fetching\x20current\x20configuration\x20for\x20\x27','localeCompare','<database>.<table>','List\x20available\x20fields\x20for\x20segmentation','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','map','addAttributes','ps:pz:init','master','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\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','\x20\x20\x20\x20\x20\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20[Job\x20ID:\x20','web','value','Events:','public:','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','columns','audienceId:','sourceTableValid','Error:\x20--name\x20is\x20required','.customers)','✔\x20Created\x20personalization\x20\x27','⚡\x20Enabled','validateParentYaml','Errors:','match','Error:','Found\x20YAML\x20file:\x20','utf-8','\x20tdx\x20wf\x20attempt\x20','\x0aChanges\x20to\x20apply\x20to\x20\x27','displayPreviewHints','SELECT\x20*\x20FROM\x20','workflowAttemptId','Attribute:','2mrlqcD','\x20parent\x20segment\x20\x27','Output\x20file:\x20','\x27\x20(id:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','265945tciSve','\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','audienceId','foreignKey','stop','5KtxwbM','\x20Added\x20personalization\x20template\x20to\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Deleting\x20personalization\x20service\x20\x27','dim','schemaError','schemaValid','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','pauseJourney','860424BNDNAx','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Attempt:','ID\x20Stitching:','✔\x20Found\x20personalization\x20\x27','\x0a⚠️\x20\x20Migrating:\x20','getCurrentConfigVersion','{\x0a\x20\x20\x22database\x22:\x20\x22','valid','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','No\x20personalization\x20services\x20configured','delete','varchar','\x20--behavior\x20\x22','Patching\x20personalization\x20\x27','errors','\x20service(s)\x20configured','paused','ps:pz:service:delete','displayValidateResults','enriched','displayBehaviorsStats','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','listFields','data','Apply\x20changes\x20to\x20\x27','json','Attributes:','\x0aUsage:\x20tdx\x20ps\x20preview\x20','segment:parent:sql','Deleting\x20personalization\x20\x27','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','timezone','allowedIps','Get\x20current\x20RT\x20configuration\x20version\x20status','\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','segment:parent:fields','Join\x20on:','\x5c$&','ps:rt:list','identifier:\x20','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Personalization:','realtime:','\x20\x202.\x20Run\x20','ps:pz:delete','Site:\x20','includeSensitive:','verbose','Resume\x20activations\x20in\x20an\x20RT\x20journey','ps:rt:validate','/sessions/','apply','\x0aNo\x20sample\x20data\x20available','Updating\x20personalization\x20service\x20\x27','repeat','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Fetching\x20sample\x20data...','pushParentYaml','Create\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','execute','length','Delete\x20a\x20realtime\x20personalization','workflowSessionId','\x20behaviors','last_page_viewed','\x20personalization','Customers:','Fetching\x20SQL\x20for\x20\x27','yellow','segment:parent:desc','getParentSQL','Default','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','displaySampleData','patch','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','⚡\x20Not\x20enabled','message','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','displaySummary','tokens','segment:parent:update','\x0aError:','page_view','parent_id','Get\x20SQL\x20query\x20for\x20parent\x20segment','addBehaviors','\x20Context\x20set:\x20','To\x20cancel:','\x20\x20Tables:\x201\x20customers\x20+\x20','\x20RT-enabled\x20parent\x20segment','SQL\x20query:\x0a','Fetching\x20personalization\x20service\x20\x27','segment','primaryKey','column','Error:\x20--attribute\x20requires\x20a\x20name\x0a','start','customerPercent','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Master:','displayMasterInfo','Source:','Error:\x20Service\x20ID\x20is\x20required','\x20--attribute\x20\x22','Validating\x20RT\x20configuration...','limit','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','getParentFull','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','joinKey','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Creating','yes','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20field','Audience\x20ID:','rowCount','segment:parent:preview','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','\x20\x20No\x20sample\x20data\x20available','2514612sQIkbD','scheduleOption','filter','/\x20→\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','ps:pz:service:token:create','\x27\x20for\x20service\x20\x27','ps:pz:service:show','format','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cyan','\x20RT\x20configuration\x20is\x20valid','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','folderId','personalizationServices','\x20Opening\x20','Aborted.','relationships','jobId','createParent','Fetching\x20parent\x20segment\x20\x27','getPersonalization','\x20service','double','getBehaviorNames','Table:\x20','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','2002763hHhrYO','Error:\x20Service\x20name\x20is\x20required','\x27\x20is\x20already\x20up\x20to\x20date','realtime','\x20configured','customers','\x27\x20is\x20up\x20to\x20date','status','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','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','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','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','ps:pz:service:list','\x20No\x20changes\x20-\x20','output','\x20kill','tdx\x20ps\x20preview\x20','site','query','true','List\x20RT\x20journeys','keyEventId','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Pattern:\x20','Show\x20parent\x20segment\x20details','createdAt','enabled','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','dirname','✔\x20Deleted\x20token\x20\x27','population','listJourneys','name','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','keys','Show\x20personalization\x20service\x20details','attributes','✔\x20Renamed\x20directory\x20to\x20','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','Behavior:','preview','Fetching\x20customers\x20schema...','identifier','segment:parent:list','Attributes','/app/workflows/','\x20rows)','ps:rt:jn:list','resumeJourney','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Error:\x20Personalization\x20ID\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','updateParent','Master\x20+\x20Attributes','6000894nyJJSn','No\x20parent\x20segments\x20found','Rows:','segment:parent:pull','Status:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','Fetching\x20behavior\x20list...','stats','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','YAML\x20file:\x20','\x0a\x20\x20]\x0a}\x0a','segment:parent:create','matchedCount','pullParentYaml','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','payload','Creating\x20personalization\x20\x27','\x27\x20and\x20run\x20workflow?','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','parentFolder','Error:\x20File\x20not\x20found:\x20','state','toLocaleString','allowed\x20IPs:','\x20\x20\x20\x20\x20\x20\x20\x20','ps:rt:configuration_versions','\x20(paused)','any','customersWithEvents','Output\x20Database:','information_schema','customerGroupFile','no\x20tokens\x20configured','ps:pz:service:token:delete','open','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20=\x20','ps:pz:service:update','Pause\x20activations\x20in\x20an\x20RT\x20journey','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','single','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','jsonl','Listing\x20parent\x20segments...','Listing\x20personalizations\x20for\x20\x27','-1d','Update\x20a\x20realtime\x20personalization\x20entity','sampleData','allValid','use','bold','/\x20and\x20','RT\x202.0:','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','events','setJobId','Error:\x20Token\x20ID\x20is\x20required','number','text','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Error\x20reading\x20file:\x20','`\x20to\x20download\x20the\x20configuration\x20first','\x20is\x20already\x20up\x20to\x20date','tdx\x20ps\x20push\x20','addAttributesFile','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','label','displayColumns','\x0a⚠️\x20\x20Both\x20','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','reduce','error','SELECT\x20*\x20FROM\x20(\x0a','segment:parent:view','/app/dw/parentSegments/','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','keyEventCriteria','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','behavior','Preview:','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','behavior_','RT\x202.0\x20Validate:','\x0aChanges\x20to\x20\x27','Parent\x20segment:\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','table','using\x20the\x20default\x20path:\x20','customerGroup','list','\x20--attribute\x20\x22<name>\x22','.yml','resolveParentId','behaviorsFile','\x27\x20with\x20ID:\x20','null','Join:','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','totalEvents','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','formatSchemaJson','Creating\x20personalization\x20service\x20\x27','workflowId','✔\x20Retrieved\x20RT\x20configuration\x20version','red','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Listing\x20fields\x20for\x20\x27','user_id','trim','stitchingKeys','createPersonalization','run','✔\x20Created\x20parent\x20segment\x20\x27','public','includeSensitive','\x0a✔\x20Workflow\x20started','elapsedTimeMillis','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20personalization\x20service','\x20--behavior\x20\x22<name>\x22','test','Schema\x20saved\x20to\x20','Creating\x20token\x20\x27','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','Error:\x20Token\x20\x27','Creating\x20parent\x20segment\x20\x27','displayRealtimeInfo','\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','\x0a\x20\x20\x20\x20]','(id:\x20','personalization_services','Getting\x20personalization\x20\x27','Columns:','previewParentYaml','personalization','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','attribute','132712TgSpNd','✔\x20No\x20changes\x20-\x20\x27','Available\x20attributes:','👥\x20','\x0a\x20\x20\x20\x20}','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','My\x20Service','type','isDirectory','updated:','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','segment:parent:validate','\x20to\x20push\x20the\x20configuration','file','description','split','✘\x20Failed\x20to\x20rename\x20directory:\x20','Updated','/attempt/','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','unref','token:','Delete\x20a\x20personalization\x20service','patchPersonalization','collectSchema','Error\x20parsing\x20YAML:\x20','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Resolving\x20parent\x20segment\x20\x27','Validate:','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'];a31_0x5df8=function(){return _0x58195c;};return a31_0x5df8();}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x389);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x2c0);async['execute'](_0x5009e1){const _0x2f02f9=a31_0xdea3fe,{options:_0x17054d,args:_0x379f48,tdx:_0x5567f8}=_0x5009e1,_0x43ad2f=_0x379f48[0x0]||_0x17054d['parentSegment'];if(!_0x43ad2f)return showParentSegmentNotSetError(_0x2f02f9(0x33f)+_0x2f02f9(0x28f)),0x1;_0x17054d[_0x2f02f9(0x2cf)]&&(console[_0x2f02f9(0x3bb)](_0x2f02f9(0x2cd)+_0x17054d[_0x2f02f9(0x349)]),console['error'](_0x2f02f9(0x3c9)+_0x43ad2f));const _0x366e1c=await withSpinner(_0x2f02f9(0x203)+_0x43ad2f+_0x2f02f9(0x23b),()=>_0x5567f8['segment'][_0x2f02f9(0x3d1)](_0x43ad2f),{'verbose':_0x17054d[_0x2f02f9(0x2cf)]}),_0x4eaf82=_0x366e1c[_0x2f02f9(0x2b6)],_0x552ad5=await withSpinner(_0x2f02f9(0x21d)+_0x43ad2f+_0x2f02f9(0x23b),()=>_0x5567f8[_0x2f02f9(0x339)][_0x2f02f9(0x2a3)](_0x4eaf82),{'verbose':_0x17054d[_0x2f02f9(0x2cf)]}),_0x1dc177=_0x552ad5[_0x2f02f9(0x2b6)];return console[_0x2f02f9(0x3bb)](_0x2f02f9(0x1c4)),_0x17054d[_0x2f02f9(0x322)]===_0x2f02f9(0x2b8)||_0x17054d[_0x2f02f9(0x322)]===_0x2f02f9(0x39c)?await handleSDKOutput([_0x1dc177],_0x17054d):(console[_0x2f02f9(0x231)]('id:\x20'+_0x1dc177['id']),console[_0x2f02f9(0x231)](_0x2f02f9(0x258)+_0x1dc177['audienceId']),console['log'](_0x2f02f9(0x2c6)+_0x1dc177[_0x2f02f9(0x362)]),console['log']('eventKind:\x20'+_0x1dc177[_0x2f02f9(0x224)]),console['log']('status:\x20'+_0x1dc177[_0x2f02f9(0x33d)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x344);[a31_0xdea3fe(0x1f4)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async[a31_0xdea3fe(0x2dc)](_0x280d69){const _0x4b08b1=a31_0xdea3fe,{options:_0x2e78ff,args:_0x29bbc5,tdx:_0x1c8bc1}=_0x280d69,_0x157a25=_0x29bbc5[0x0]||_0x2e78ff[_0x4b08b1(0x256)];if(!_0x157a25)return showParentSegmentNotSetError(_0x4b08b1(0x230)+_0x4b08b1(0x1dc)),0x1;const _0x4ee170=await withSpinner(_0x4b08b1(0x203)+_0x157a25+'\x27...',()=>_0x1c8bc1[_0x4b08b1(0x2fe)]['resolveParentId'](_0x157a25),{'verbose':_0x2e78ff['verbose']}),_0x3d1dae=_0x4ee170[_0x4b08b1(0x2b6)],_0x1ec7aa=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x157a25+_0x4b08b1(0x23b),()=>_0x1c8bc1[_0x4b08b1(0x1e3)][_0x4b08b1(0x3ce)](_0x3d1dae),{'verbose':_0x2e78ff[_0x4b08b1(0x2cf)]}),_0x947d7e=_0x1ec7aa[_0x4b08b1(0x2b6)];console[_0x4b08b1(0x3bb)]('✔\x20Found\x20'+_0x947d7e[_0x4b08b1(0x2dd)]+_0x4b08b1(0x1d3)+(_0x947d7e['length']!==0x1?'s':''));if(_0x2e78ff[_0x4b08b1(0x322)]==='json'||_0x2e78ff[_0x4b08b1(0x322)]===_0x4b08b1(0x39c))await handleSDKOutput(_0x947d7e,_0x2e78ff);else{if(_0x947d7e[_0x4b08b1(0x2dd)]===0x0)console[_0x4b08b1(0x231)](_0x4b08b1(0x2a8)),console['error'](a31_0xd5335b[_0x4b08b1(0x325)](_0x4b08b1(0x35e)));else for(const _0x4f95ee of _0x947d7e){console[_0x4b08b1(0x231)](a31_0xd5335b[_0x4b08b1(0x3a4)](_0x4f95ee['name'])+'\x20'+a31_0xd5335b['dim'](_0x4b08b1(0x1de)+_0x4f95ee['id']+')'));_0x4f95ee[_0x4b08b1(0x1f4)]&&console['log']('\x20\x20'+a31_0xd5335b[_0x4b08b1(0x297)](_0x4f95ee['description']));if(_0x4f95ee[_0x4b08b1(0x2f1)]&&_0x4f95ee[_0x4b08b1(0x2f1)]['length']>0x0)for(const _0x4d0d0f of _0x4f95ee[_0x4b08b1(0x2f1)]){const _0x15fb89=_0x4d0d0f[_0x4b08b1(0x2bf)]?.[_0x4b08b1(0x2dd)]?_0x4d0d0f[_0x4b08b1(0x2bf)][_0x4b08b1(0x23f)](',\x20'):_0x4b08b1(0x38b);console['log']('\x20\x20'+a31_0xd5335b[_0x4b08b1(0x325)](_0x4b08b1(0x1fb))+'\x20'+_0x4d0d0f[_0x4b08b1(0x358)]+'\x20'+a31_0xd5335b[_0x4b08b1(0x297)](_0x4b08b1(0x1de)+_0x4d0d0f['id']+')')),console[_0x4b08b1(0x231)](_0x4b08b1(0x233)+a31_0xd5335b[_0x4b08b1(0x297)](_0x4b08b1(0x387))+'\x20'+_0x15fb89);}else console[_0x4b08b1(0x231)]('\x20\x20'+a31_0xd5335b[_0x4b08b1(0x297)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{['name']=a31_0xdea3fe(0x254);[a31_0xdea3fe(0x1f4)]='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async[a31_0xdea3fe(0x2dc)](_0x4f8c21){const _0x200acd=a31_0xdea3fe,{options:_0x27a2b2,args:_0x739174,tdx:_0x501213}=_0x4f8c21,_0x28fe39=_0x27a2b2,_0x196ae6=_0x739174[0x0],_0x1e9223=_0x739174[0x1]||_0x27a2b2[_0x200acd(0x256)];if(!_0x196ae6)return console[_0x200acd(0x3bb)](_0x200acd(0x337)),console['error'](_0x200acd(0x310)),console[_0x200acd(0x3bb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x1e9223)return showParentSegmentNotSetError(_0x200acd(0x22e)+_0x200acd(0x36c)),0x1;const _0x19ccf1=await withSpinner(_0x200acd(0x203)+_0x1e9223+_0x200acd(0x23b),()=>_0x501213[_0x200acd(0x2fe)][_0x200acd(0x3d1)](_0x1e9223),{'verbose':_0x27a2b2[_0x200acd(0x2cf)]}),_0x1f911f=_0x19ccf1['data'],_0x47ae25={'name':_0x196ae6,'description':_0x28fe39[_0x200acd(0x1f4)],'public':_0x28fe39['public']},_0x453d4d=await withSpinner(_0x200acd(0x1c2)+_0x196ae6+_0x200acd(0x23b),()=>_0x501213[_0x200acd(0x1e3)]['create'](_0x1f911f,_0x47ae25),{'verbose':_0x27a2b2['verbose']}),_0x12043c=_0x453d4d['data'];return console['error'](_0x200acd(0x260)+_0x12043c[_0x200acd(0x358)]+_0x200acd(0x1ba)+_0x12043c['id']),await handleSDKOutput([_0x12043c],_0x27a2b2),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x321);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x35b);async[a31_0xdea3fe(0x2dc)](_0x48bb37){const _0x3a24f3=a31_0xdea3fe,{options:_0x241cad,args:_0x5d9086,tdx:_0x4fb277}=_0x48bb37,_0x7ce294=_0x5d9086[0x0],_0x17fa57=_0x5d9086[0x1]||_0x241cad['parentSegment'];if(!_0x7ce294)return console[_0x3a24f3(0x3bb)](_0x3a24f3(0x308)),console[_0x3a24f3(0x3bb)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console['error'](_0x3a24f3(0x253)),0x1;if(!_0x17fa57)return showParentSegmentNotSetError(_0x3a24f3(0x26b)+_0x3a24f3(0x253)),0x1;const _0x1226e4=await withSpinner(_0x3a24f3(0x203)+_0x17fa57+_0x3a24f3(0x23b),()=>_0x4fb277[_0x3a24f3(0x2fe)][_0x3a24f3(0x3d1)](_0x17fa57),{'verbose':_0x241cad['verbose']}),_0x1ac3b2=_0x1226e4[_0x3a24f3(0x2b6)],_0x5ae011=await withSpinner(_0x3a24f3(0x2fd)+_0x7ce294+_0x3a24f3(0x23b),()=>_0x4fb277[_0x3a24f3(0x1e3)]['get'](_0x1ac3b2,_0x7ce294),{'verbose':_0x241cad[_0x3a24f3(0x2cf)]}),_0x5baf05=_0x5ae011['data'];if(_0x241cad['json']||_0x241cad[_0x3a24f3(0x39c)])await handleSDKOutput([_0x5baf05],_0x241cad);else{console[_0x3a24f3(0x231)](a31_0xd5335b[_0x3a24f3(0x3a4)](_0x5baf05[_0x3a24f3(0x358)])+'\x20'+a31_0xd5335b[_0x3a24f3(0x297)](_0x3a24f3(0x1de)+_0x5baf05['id']+')'));_0x5baf05['description']&&console[_0x3a24f3(0x231)]('\x20\x20'+a31_0xd5335b[_0x3a24f3(0x297)](_0x5baf05[_0x3a24f3(0x1f4)]));console['log']('\x20\x20'+a31_0xd5335b[_0x3a24f3(0x325)](_0x3a24f3(0x273))+'\x20'+(_0x5baf05[_0x3a24f3(0x1ce)]?_0x3a24f3(0x312):'no'));if(_0x5baf05[_0x3a24f3(0x2f1)]&&_0x5baf05['tokens'][_0x3a24f3(0x2dd)]>0x0)for(const _0x30b190 of _0x5baf05[_0x3a24f3(0x2f1)]){const _0x4e8797=_0x30b190[_0x3a24f3(0x2bf)]?.[_0x3a24f3(0x2dd)]?_0x30b190[_0x3a24f3(0x2bf)][_0x3a24f3(0x23f)](',\x20'):_0x3a24f3(0x38b);console[_0x3a24f3(0x231)]('\x20\x20'+a31_0xd5335b[_0x3a24f3(0x325)](_0x3a24f3(0x1fb))+'\x20'+_0x30b190[_0x3a24f3(0x358)]+'\x20'+a31_0xd5335b[_0x3a24f3(0x297)](_0x3a24f3(0x1de)+_0x30b190['id']+')')),console[_0x3a24f3(0x231)](_0x3a24f3(0x233)+a31_0xd5335b['dim'](_0x3a24f3(0x387))+'\x20'+_0x4e8797);}else console[_0x3a24f3(0x231)]('\x20\x20'+a31_0xd5335b[_0x3a24f3(0x297)](_0x3a24f3(0x390)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x2b0);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x1fc);async[a31_0xdea3fe(0x2dc)](_0x4446a6){const _0xa45d31=a31_0xdea3fe,{options:_0x1864b0,args:_0x526c1c,tdx:_0x319e47}=_0x4446a6,_0x42ac04=_0x526c1c[0x0],_0x57bfc4=_0x526c1c[0x1]||_0x1864b0[_0xa45d31(0x256)];if(!_0x42ac04)return console[_0xa45d31(0x3bb)](_0xa45d31(0x308)),console[_0xa45d31(0x3bb)](_0xa45d31(0x295)),console['error'](_0xa45d31(0x26c)),0x1;if(!_0x57bfc4)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 _0x26e6b1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x57bfc4+_0xa45d31(0x23b),()=>_0x319e47[_0xa45d31(0x2fe)][_0xa45d31(0x3d1)](_0x57bfc4),{'verbose':_0x1864b0[_0xa45d31(0x2cf)]}),_0xb15adb=_0x26e6b1[_0xa45d31(0x2b6)];return await withSpinner(_0xa45d31(0x296)+_0x42ac04+_0xa45d31(0x23b),()=>_0x319e47[_0xa45d31(0x1e3)][_0xa45d31(0x2a9)](_0xb15adb,_0x42ac04),{'verbose':_0x1864b0['verbose']}),console[_0xa45d31(0x3bb)]('✔\x20Deleted\x20personalization\x20service\x20\x27'+_0x42ac04+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x397);[a31_0xdea3fe(0x1f4)]='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0xdea3fe(0x2dc)](_0x510a58){const _0x2df5de=a31_0xdea3fe,{options:_0x408170,args:_0x40f9fd,tdx:_0x360581}=_0x510a58,_0x3daf7d=_0x408170,_0x17c501=_0x40f9fd[0x0],_0x5d6581=_0x40f9fd[0x1]||_0x408170[_0x2df5de(0x256)];if(!_0x17c501)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console['error'](_0x2df5de(0x34e)),console[_0x2df5de(0x3bb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x3daf7d[_0x2df5de(0x358)])return console[_0x2df5de(0x3bb)](_0x2df5de(0x278)),console[_0x2df5de(0x3bb)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x5d6581)return showParentSegmentNotSetError(_0x2df5de(0x2db)+_0x2df5de(0x29e)),0x1;const _0x4ad73b=await withSpinner(_0x2df5de(0x203)+_0x5d6581+_0x2df5de(0x23b),()=>_0x360581['segment'][_0x2df5de(0x3d1)](_0x5d6581),{'verbose':_0x408170[_0x2df5de(0x2cf)]}),_0x5ece2a=_0x4ad73b['data'],_0x1994bd={'name':_0x3daf7d['name']};_0x3daf7d['description']!==undefined&&(_0x1994bd[_0x2df5de(0x1f4)]=_0x3daf7d[_0x2df5de(0x1f4)]);const _0xc848eb=await withSpinner(_0x2df5de(0x2d5)+_0x17c501+_0x2df5de(0x23b),()=>_0x360581[_0x2df5de(0x1e3)][_0x2df5de(0x2eb)](_0x5ece2a,_0x17c501,_0x1994bd),{'verbose':_0x408170[_0x2df5de(0x2cf)]}),_0x3f688b=_0xc848eb[_0x2df5de(0x2b6)];return console[_0x2df5de(0x3bb)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x3f688b['name']+'\x27'),await handleSDKOutput([_0x3f688b],_0x408170),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']=a31_0xdea3fe(0x31f);[a31_0xdea3fe(0x1f4)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a31_0xdea3fe(0x2dc)](_0x34d2ab){const _0x32668a=a31_0xdea3fe,{options:_0x96a0c,args:_0x4816fc,tdx:_0x4fdbe9}=_0x34d2ab,_0x6af00f=_0x96a0c,_0x1924b1=_0x4816fc[0x0],_0x48bab1=_0x4816fc[0x1],_0x5896d9=_0x4816fc[0x2]||_0x96a0c[_0x32668a(0x256)];if(!_0x1924b1)return console[_0x32668a(0x3bb)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x32668a(0x3bb)](_0x32668a(0x341)),console[_0x32668a(0x3bb)](_0x32668a(0x3b5)),0x1;if(!_0x48bab1)return console['error'](_0x32668a(0x308)),console['error'](_0x32668a(0x341)),console[_0x32668a(0x3bb)](_0x32668a(0x3b5)),0x1;if(!_0x5896d9)return showParentSegmentNotSetError(_0x32668a(0x374)+_0x32668a(0x3b5)),0x1;const _0x10e70d=await withSpinner(_0x32668a(0x203)+_0x5896d9+_0x32668a(0x23b),()=>_0x4fdbe9[_0x32668a(0x2fe)][_0x32668a(0x3d1)](_0x5896d9),{'verbose':_0x96a0c['verbose']}),_0x44fdce=_0x10e70d[_0x32668a(0x2b6)],_0x3ad82f={'name':_0x1924b1};_0x6af00f[_0x32668a(0x2bf)]&&(_0x3ad82f[_0x32668a(0x2bf)]=_0x6af00f[_0x32668a(0x2bf)][_0x32668a(0x1f5)](',')[_0x32668a(0x267)](_0x33c29a=>_0x33c29a[_0x32668a(0x1c9)]()));_0x6af00f[_0x32668a(0x1f4)]&&(_0x3ad82f[_0x32668a(0x1f4)]=_0x6af00f[_0x32668a(0x1f4)]);const _0x1c7133=await withSpinner(_0x32668a(0x1d7)+_0x1924b1+_0x32668a(0x320)+_0x48bab1+'\x27...',()=>_0x4fdbe9[_0x32668a(0x1e3)]['createToken'](_0x44fdce,_0x48bab1,_0x3ad82f),{'verbose':_0x96a0c[_0x32668a(0x2cf)]}),_0x7d8867=_0x1c7133[_0x32668a(0x2b6)];return console[_0x32668a(0x3bb)]('✔\x20Created\x20token\x20\x27'+_0x7d8867['name']+'\x27\x20with\x20ID:\x20'+_0x7d8867['id']),_0x7d8867[_0x32668a(0x271)]&&(console['error'](a31_0xd5335b['yellow']('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console[_0x32668a(0x3bb)](a31_0xd5335b[_0x32668a(0x325)](_0x7d8867['value'])),console[_0x32668a(0x3bb)]('')),await handleSDKOutput([_0x7d8867],_0x96a0c),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x391);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x209);async[a31_0xdea3fe(0x2dc)](_0x5e62c2){const _0x1336ad=a31_0xdea3fe,{options:_0x359a3c,args:_0x351673,tdx:_0x502ae0}=_0x5e62c2,_0x32da3b=_0x351673[0x0],_0x113ec7=_0x351673[0x1]||_0x359a3c['parentSegment'];if(!_0x32da3b)return console[_0x1336ad(0x3bb)](_0x1336ad(0x3aa)),console[_0x1336ad(0x3bb)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x1336ad(0x3bb)](_0x1336ad(0x28c)),0x1;if(!_0x113ec7)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a'+_0x1336ad(0x28c)),0x1;const _0x4a0501=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x113ec7+_0x1336ad(0x23b),()=>_0x502ae0[_0x1336ad(0x2fe)][_0x1336ad(0x3d1)](_0x113ec7),{'verbose':_0x359a3c[_0x1336ad(0x2cf)]}),_0x30ac4f=_0x4a0501[_0x1336ad(0x2b6)],_0x2c179b=await withSpinner('Finding\x20service\x20for\x20token...',()=>_0x502ae0[_0x1336ad(0x1e3)][_0x1336ad(0x3ce)](_0x30ac4f),{'verbose':_0x359a3c[_0x1336ad(0x2cf)]}),_0x515d86=_0x2c179b[_0x1336ad(0x2b6)];let _0x45c10e;for(const _0x32a06d of _0x515d86){if(_0x32a06d[_0x1336ad(0x2f1)]?.[_0x1336ad(0x251)](_0x402217=>_0x402217['id']===_0x32da3b)){_0x45c10e=_0x32a06d['id'];break;}}if(!_0x45c10e)return console[_0x1336ad(0x3bb)](_0x1336ad(0x1d9)+_0x32da3b+_0x1336ad(0x266)),0x1;const _0x2b5a4a=await withSpinner('Deleting\x20token\x20\x27'+_0x32da3b+_0x1336ad(0x23b),()=>_0x502ae0[_0x1336ad(0x1e3)]['deleteToken'](_0x30ac4f,_0x45c10e,_0x32da3b),{'verbose':_0x359a3c[_0x1336ad(0x2cf)]}),_0x5b6cc0=_0x2b5a4a['data'];return console['error'](_0x1336ad(0x355)+(_0x5b6cc0[_0x1336ad(0x358)]||_0x32da3b)+'\x27'),await handleSDKOutput([_0x5b6cc0],_0x359a3c),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0xdea3fe(0x358)]='ps:pz:list';[a31_0xdea3fe(0x1f4)]='List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment';async[a31_0xdea3fe(0x2dc)](_0x1d9a17){const _0x34a576=a31_0xdea3fe,{options:_0x2a320e,args:_0x1daac5,tdx:_0x12ae37}=_0x1d9a17,_0x148fb6=_0x1daac5[0x0]||_0x2a320e[_0x34a576(0x256)];if(!_0x148fb6)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'+_0x34a576(0x2c1)),0x1;const _0x426b89=await withSpinner(_0x34a576(0x203)+_0x148fb6+_0x34a576(0x23b),()=>_0x12ae37[_0x34a576(0x2fe)]['resolveParentId'](_0x148fb6),{'verbose':_0x2a320e['verbose']}),_0x4f2790=_0x426b89[_0x34a576(0x2b6)],_0x2bb362=await withSpinner(_0x34a576(0x39e)+_0x148fb6+_0x34a576(0x23b),()=>_0x12ae37['personalization'][_0x34a576(0x20c)](_0x4f2790),{'verbose':_0x2a320e[_0x34a576(0x2cf)]}),_0x31aad6=_0x2bb362[_0x34a576(0x2b6)];console[_0x34a576(0x3bb)](_0x34a576(0x220)+_0x31aad6['length']+_0x34a576(0x2e2)+(_0x31aad6['length']!==0x1?'s':''));if(_0x2a320e[_0x34a576(0x322)]==='json'||_0x2a320e[_0x34a576(0x322)]==='jsonl')await handleSDKOutput(_0x31aad6,_0x2a320e);else{if(_0x31aad6['length']===0x0)console[_0x34a576(0x231)](_0x34a576(0x236));else for(const _0x547494 of _0x31aad6){console[_0x34a576(0x231)](a31_0xd5335b[_0x34a576(0x3a4)](_0x547494[_0x34a576(0x358)])+'\x20'+a31_0xd5335b['dim']('(id:\x20'+_0x547494['id']+')'));_0x547494[_0x34a576(0x1f4)]&&console[_0x34a576(0x231)]('\x20\x20'+a31_0xd5335b[_0x34a576(0x297)](_0x547494['description']));const _0x233a7c=_0x547494[_0x34a576(0x250)]?.[_0x34a576(0x2dd)]||0x0;console[_0x34a576(0x231)]('\x20\x20'+a31_0xd5335b[_0x34a576(0x325)](_0x34a576(0x249))+'\x20'+_0x233a7c);if(_0x547494[_0x34a576(0x250)]&&_0x547494[_0x34a576(0x250)][_0x34a576(0x2dd)]>0x0)for(const _0x1dcd49 of _0x547494[_0x34a576(0x250)]){console[_0x34a576(0x231)]('\x20\x20\x20\x20-\x20'+_0x1dcd49[_0x34a576(0x358)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0xdea3fe(0x358)]='ps:pz:show';[a31_0xdea3fe(0x1f4)]='Show\x20a\x20specific\x20realtime\x20personalization';async['execute'](_0x4c35f7){const _0x4901d9=a31_0xdea3fe,{options:_0x5ceb29,args:_0x33b238,tdx:_0x26e1be}=_0x4c35f7,_0x5b8137=_0x33b238[0x0];if(!_0x5b8137)return console[_0x4901d9(0x3bb)](_0x4901d9(0x36b)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x2d8fe1=await withSpinner(_0x4901d9(0x1e0)+_0x5b8137+_0x4901d9(0x23b),()=>_0x26e1be[_0x4901d9(0x1e3)][_0x4901d9(0x330)](_0x5b8137),{'verbose':_0x5ceb29[_0x4901d9(0x2cf)]}),_0x277bff=_0x2d8fe1['data'];console[_0x4901d9(0x3bb)](_0x4901d9(0x2a1)+_0x277bff[_0x4901d9(0x358)]+'\x27');if(_0x5ceb29[_0x4901d9(0x322)]===_0x4901d9(0x2b8)||_0x5ceb29['format']==='jsonl')await handleSDKOutput([_0x277bff],_0x5ceb29);else{console[_0x4901d9(0x231)](a31_0xd5335b[_0x4901d9(0x3a4)](_0x277bff[_0x4901d9(0x358)])+'\x20'+a31_0xd5335b[_0x4901d9(0x297)](_0x4901d9(0x1de)+_0x277bff['id']+')'));_0x277bff[_0x4901d9(0x1f4)]&&console['log']('\x20\x20'+a31_0xd5335b[_0x4901d9(0x297)](_0x277bff[_0x4901d9(0x1f4)]));_0x277bff[_0x4901d9(0x290)]&&console[_0x4901d9(0x231)]('\x20\x20'+a31_0xd5335b[_0x4901d9(0x325)](_0x4901d9(0x276))+'\x20'+_0x277bff[_0x4901d9(0x290)]);console[_0x4901d9(0x231)]('\x20\x20'+a31_0xd5335b[_0x4901d9(0x325)]('created:')+'\x20'+_0x277bff[_0x4901d9(0x351)]),console[_0x4901d9(0x231)]('\x20\x20'+a31_0xd5335b['cyan'](_0x4901d9(0x1ef))+'\x20'+_0x277bff['updatedAt']);const _0x471ee6=_0x277bff['sections']?.[_0x4901d9(0x2dd)]||0x0;console[_0x4901d9(0x231)]('\x20\x20'+a31_0xd5335b['cyan']('sections:')+'\x20'+_0x471ee6);if(_0x277bff[_0x4901d9(0x250)]&&_0x277bff['sections'][_0x4901d9(0x2dd)]>0x0)for(const _0x41574e of _0x277bff[_0x4901d9(0x250)]){console[_0x4901d9(0x231)](_0x4901d9(0x233)+a31_0xd5335b[_0x4901d9(0x3a4)](_0x41574e[_0x4901d9(0x358)])+'\x20'+a31_0xd5335b[_0x4901d9(0x297)](_0x4901d9(0x1de)+_0x41574e['id']+')')),_0x41574e['entryCriteria']&&(console[_0x4901d9(0x231)](_0x4901d9(0x26d)+a31_0xd5335b[_0x4901d9(0x325)](_0x4901d9(0x239))+'\x20'+_0x41574e['entryCriteria'][_0x4901d9(0x358)]),_0x41574e['entryCriteria']['keyEventCriteria']?.[_0x4901d9(0x34d)]&&console[_0x4901d9(0x231)](_0x4901d9(0x388)+a31_0xd5335b[_0x4901d9(0x325)](_0x4901d9(0x215))+'\x20'+_0x41574e[_0x4901d9(0x20d)][_0x4901d9(0x3c1)][_0x4901d9(0x34d)])),_0x41574e['payload']&&console[_0x4901d9(0x231)]('\x20\x20\x20\x20\x20\x20'+a31_0xd5335b[_0x4901d9(0x325)]('payload:')+'\x20'+JSON['stringify'](_0x41574e[_0x4901d9(0x37f)])),_0x41574e[_0x4901d9(0x1cf)]&&console[_0x4901d9(0x231)](_0x4901d9(0x26d)+a31_0xd5335b[_0x4901d9(0x325)](_0x4901d9(0x2ce))+_0x4901d9(0x23e));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x2cc);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x2de);async[a31_0xdea3fe(0x2dc)](_0x4cb2de){const _0x57df52=a31_0xdea3fe,{options:_0x25f7b0,args:_0x3000aa,tdx:_0x50fea1}=_0x4cb2de,_0x4b4776=_0x3000aa[0x0];if(!_0x4b4776)return console[_0x57df52(0x3bb)](_0x57df52(0x36b)),console['error'](_0x57df52(0x342)),0x1;return await withSpinner(_0x57df52(0x2bc)+_0x4b4776+'\x27...',()=>_0x50fea1[_0x57df52(0x1e3)]['deletePersonalization'](_0x4b4776),{'verbose':_0x25f7b0[_0x57df52(0x2cf)]}),console[_0x57df52(0x3bb)]('✔\x20Deleted\x20personalization\x20\x27'+_0x4b4776+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0xdea3fe(0x358)]='ps:pz:create';['description']='Create\x20a\x20realtime\x20personalization\x20entity';async['execute'](_0x509fae){const _0x107480=a31_0xdea3fe,{options:_0x4021e8,tdx:_0x2486e7}=_0x509fae,_0x5de9db=_0x4021e8;let _0x58c400;if(_0x5de9db['file']){_0x58c400=await loadJSON(_0x5de9db[_0x107480(0x1f3)],!![]);if(!_0x58c400[_0x107480(0x32c)]?.[_0x107480(0x383)])return console[_0x107480(0x3bb)](_0x107480(0x2e9)),console[_0x107480(0x3bb)](_0x107480(0x318)),console[_0x107480(0x3bb)]('\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}'),0x1;}else{if(!_0x5de9db[_0x107480(0x358)])return console[_0x107480(0x3bb)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x107480(0x3bb)](_0x107480(0x1e4)),console[_0x107480(0x3bb)](_0x107480(0x369)),0x1;if(_0x5de9db[_0x107480(0x1f4)]===undefined)return console[_0x107480(0x3bb)](_0x107480(0x395)),console['error'](_0x107480(0x1e4)),console['error'](_0x107480(0x369)),0x1;if(_0x5de9db['folderId']===undefined)return console[_0x107480(0x3bb)](_0x107480(0x21c)),console[_0x107480(0x3bb)]('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x3b9533=_0x5de9db[_0x107480(0x290)];if(!_0x3b9533&&_0x4021e8[_0x107480(0x256)]){const _0x1cd91b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4021e8[_0x107480(0x256)]+'\x27...',()=>_0x2486e7[_0x107480(0x2fe)]['resolveParentId'](_0x4021e8[_0x107480(0x256)]),{'verbose':_0x4021e8[_0x107480(0x2cf)]});_0x3b9533=_0x1cd91b['data'];}let _0x3117b3;_0x5de9db[_0x107480(0x250)]&&(_0x3117b3=await loadJSON(_0x5de9db[_0x107480(0x250)],![]));const _0x45b9fa=_0x5de9db[_0x107480(0x328)]===_0x107480(0x1bb)?null:{'id':_0x5de9db[_0x107480(0x328)],'type':_0x107480(0x20b)};_0x58c400={'attributes':{'name':_0x5de9db[_0x107480(0x358)],'description':_0x5de9db[_0x107480(0x1f4)]||null,..._0x3b9533!==undefined&&{'audienceId':_0x3b9533},..._0x3117b3!==undefined&&{'sections':_0x3117b3}},'relationships':{'parentFolder':{'data':_0x45b9fa}}};}const _0x4d1dd9=await withSpinner(_0x107480(0x380)+(_0x58c400[_0x107480(0x35c)]?.['name']??'')+_0x107480(0x23b),()=>_0x2486e7[_0x107480(0x1e3)][_0x107480(0x1cb)](_0x58c400),{'verbose':_0x4021e8[_0x107480(0x2cf)]}),_0x4c9ebd=_0x4d1dd9['data'];return console[_0x107480(0x3bb)](_0x107480(0x27a)+_0x4c9ebd[_0x107480(0x358)]+_0x107480(0x1ba)+_0x4c9ebd['id']),await handleSDKOutput([_0x4c9ebd],_0x4021e8),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0xdea3fe(0x358)]='ps:pz:patch';[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x3a0);async[a31_0xdea3fe(0x2dc)](_0x9fea91){const _0x44ef9d=a31_0xdea3fe,{options:_0xf43a4f,args:_0x1140ca}=_0x9fea91,_0x42b33c=_0xf43a4f,_0x7e4f94=_0x1140ca[0x0];if(!_0x7e4f94)return console[_0x44ef9d(0x3bb)](_0x44ef9d(0x36b)),console[_0x44ef9d(0x3bb)](_0x44ef9d(0x3bf)),console[_0x44ef9d(0x3bb)](_0x44ef9d(0x3ad)),0x1;let _0x5360a2;if(_0x42b33c[_0x44ef9d(0x1f3)])_0x5360a2=await loadJSON(_0x42b33c['file'],!![]);else{if(!_0x42b33c[_0x44ef9d(0x358)])return console[_0x44ef9d(0x3bb)](_0x44ef9d(0x1d2)),console[_0x44ef9d(0x3bb)](_0x44ef9d(0x3bf)),0x1;if(_0x42b33c[_0x44ef9d(0x1f4)]===undefined)return console[_0x44ef9d(0x3bb)](_0x44ef9d(0x395)),console[_0x44ef9d(0x3bb)](_0x44ef9d(0x3bf)),0x1;let _0x58108e;_0x42b33c[_0x44ef9d(0x250)]&&(_0x58108e=await loadJSON(_0x42b33c['sections'],![])),_0x5360a2={'attributes':{'name':_0x42b33c[_0x44ef9d(0x358)],'description':_0x42b33c['description']||null,..._0x58108e!==undefined&&{'sections':_0x58108e}}};}const {tdx:_0x9c4f88}=_0x9fea91,_0x2bfd94=await withSpinner(_0x44ef9d(0x2ac)+_0x7e4f94+_0x44ef9d(0x23b),()=>_0x9c4f88['personalization'][_0x44ef9d(0x1fd)](_0x7e4f94,_0x5360a2),{'verbose':_0xf43a4f['verbose']}),_0x3ab148=_0x2bfd94[_0x44ef9d(0x2b6)];return console[_0x44ef9d(0x3bb)]('✔\x20Updated\x20personalization\x20\x27'+_0x3ab148[_0x44ef9d(0x358)]+_0x44ef9d(0x28b)+_0x3ab148['id']+')'),await handleSDKOutput([_0x3ab148],_0xf43a4f),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0xdea3fe(0x358)]=a31_0xdea3fe(0x269);[a31_0xdea3fe(0x1f4)]=a31_0xdea3fe(0x359);async[a31_0xdea3fe(0x2dc)](_0x1a2238){const _0x1b9f6d=a31_0xdea3fe,{options:_0xbc91ef,args:_0x553f1d}=_0x1a2238,_0x5f4f54=_0x553f1d[0x0]||_0xbc91ef[_0x1b9f6d(0x256)];if(!_0x5f4f54)return showParentSegmentNotSetError(_0x1b9f6d(0x343)+'\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 _0x40b96f=resolveYamlFile(_0x5f4f54);if(!existsSync(_0x40b96f))return showFileNotFoundError(_0x40b96f,_0x5f4f54),0x1;let _0x1c5056;try{_0x1c5056=readFileSync(_0x40b96f,'utf-8');}catch(_0x57d804){const _0x76f485=_0x57d804 instanceof Error?_0x57d804[_0x1b9f6d(0x2ee)]:String(_0x57d804);return console['error']('Error\x20reading\x20file:\x20'+_0x76f485),0x1;}let _0x2a3558;try{_0x2a3558=parseDef(_0x1c5056);}catch(_0x54a40d){const _0x4ed8cd=_0x54a40d instanceof Error?_0x54a40d['message']:String(_0x54a40d);return console[_0x1b9f6d(0x3bb)](a31_0xd5335b[_0x1b9f6d(0x1c5)](_0x1b9f6d(0x1ff)+_0x4ed8cd)),0x1;}if(_0x2a3558['personalization_services']&&_0x2a3558[_0x1b9f6d(0x1df)][_0x1b9f6d(0x2dd)]>0x0)return console['error'](a31_0xd5335b['yellow'](_0x1b9f6d(0x30c)+_0x40b96f)),console[_0x1b9f6d(0x3bb)](a31_0xd5335b[_0x1b9f6d(0x297)](_0x1b9f6d(0x211)+_0x2a3558['personalization_services'][_0x1b9f6d(0x2dd)]+_0x1b9f6d(0x2ae))),0x1;!_0x2a3558[_0x1b9f6d(0x339)]&&(_0x2a3558[_0x1b9f6d(0x339)]={'events':[{'name':_0x1b9f6d(0x2f4),'source_table':_0x1b9f6d(0x264)}],'attributes':[{'name':_0x1b9f6d(0x2e1),'type':_0x1b9f6d(0x39a)}],'id_stitching':{'primary_key':_0x2a3558[_0x1b9f6d(0x26a)][_0x1b9f6d(0x3cb)]===_0x1b9f6d(0x33b)?_0x1b9f6d(0x207):_0x1b9f6d(0x1c8)}});_0x2a3558[_0x1b9f6d(0x1df)]=[{'name':_0x1b9f6d(0x1ec),'description':_0x1b9f6d(0x214),'trigger_event':_0x1b9f6d(0x2f4),'sections':[{'name':_0x1b9f6d(0x2e8),'criteria':_0x1b9f6d(0x34b),'attributes':[_0x1b9f6d(0x2e1)]}]}];const _0x4a090a=serializeDef(_0x2a3558);return writeFileSync(_0x40b96f,_0x4a090a,_0x1b9f6d(0x281)),console[_0x1b9f6d(0x3bb)](a31_0xd5335b[_0x1b9f6d(0x208)]('✔')+_0x1b9f6d(0x294)+a31_0xd5335b['cyan'](_0x40b96f)),(!_0x2a3558['realtime']||_0x1c5056['indexOf'](_0x1b9f6d(0x2ca))===-0x1)&&console[_0x1b9f6d(0x3bb)](a31_0xd5335b['green']('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x1b9f6d(0x3bb)]('\x0a'+a31_0xd5335b[_0x1b9f6d(0x297)](_0x1b9f6d(0x206))),console[_0x1b9f6d(0x3bb)]('\x20\x201.\x20Edit\x20'+_0x40b96f+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x1b9f6d(0x3bb)](_0x1b9f6d(0x2cb)+a31_0xd5335b['dim'](_0x1b9f6d(0x3b1)+_0x5f4f54)+_0x1b9f6d(0x1f2)),0x0;}}
1
+ const a31_0x10c381=a31_0xc607;(function(_0x1fd1d9,_0x1ffd67){const _0x51c9ee=a31_0xc607,_0xdcfa11=_0x1fd1d9();while(!![]){try{const _0x20b4d0=parseInt(_0x51c9ee(0x120))/0x1*(-parseInt(_0x51c9ee(0x110))/0x2)+-parseInt(_0x51c9ee(0x26e))/0x3*(-parseInt(_0x51c9ee(0x8e))/0x4)+-parseInt(_0x51c9ee(0x7d))/0x5*(parseInt(_0x51c9ee(0x207))/0x6)+parseInt(_0x51c9ee(0x12d))/0x7*(-parseInt(_0x51c9ee(0x1c9))/0x8)+-parseInt(_0x51c9ee(0x25a))/0x9*(parseInt(_0x51c9ee(0x1b1))/0xa)+-parseInt(_0x51c9ee(0x1ea))/0xb+parseInt(_0x51c9ee(0x25f))/0xc;if(_0x20b4d0===_0x1ffd67)break;else _0xdcfa11['push'](_0xdcfa11['shift']());}catch(_0x115682){_0xdcfa11['push'](_0xdcfa11['shift']());}}}(a31_0x1457,0x52aaf));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x1ac1cb from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x343d08 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x10c381(0x17c),LEGACY_PARENT_SEGMENT_DIR=a31_0x10c381(0x27d);function openBrowser(_0x89c7b0){const _0x5a5e7b=a31_0x10c381,_0x59e79b=process[_0x5a5e7b(0xd8)],_0x5e9bb3=_0x59e79b===_0x5a5e7b(0x18c)?'open':_0x59e79b===_0x5a5e7b(0x249)?'start':_0x5a5e7b(0xb4);spawn(_0x5e9bb3,[_0x89c7b0],{'detached':!![],'stdio':'ignore'})[_0x5a5e7b(0x256)]();}function migrateLegacyDirectory(){const _0xcaade6=a31_0x10c381;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x3c2c03=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x3c2c03[_0xcaade6(0x132)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x185)](_0xcaade6(0x142)+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0x1a5)+PARENT_SEGMENT_DIR+_0xcaade6(0x222))),console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x1a7)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0xbf))),![];console['error'](a31_0x343d08[_0xcaade6(0x185)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0x19f)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x97)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x421e28){const _0x59c778=_0x421e28 instanceof Error?_0x421e28[_0xcaade6(0x14e)]:String(_0x421e28);return console['error'](a31_0x343d08['red'](_0xcaade6(0x23e)+_0x59c778+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x10c381(0xb3)](_0x31a99c){const _0x187c15=a31_0x10c381;return migrateLegacyDirectory(),super[_0x187c15(0xb3)](_0x31a99c);}}function resolveYamlFile(_0x474569){const _0x53ef7e=a31_0x10c381;if(_0x474569[_0x53ef7e(0x1fa)](_0x53ef7e(0x1d1))||_0x474569['endsWith']('.yaml'))return _0x474569;return a31_0x1ac1cb[_0x53ef7e(0xa1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x474569)+_0x53ef7e(0x1d1));}function formatProgressMessage(_0x3fb98b){const _0x50c57b=a31_0x10c381,_0x2c5e7b=_0x3fb98b[_0x50c57b(0x21d)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2c5e7b){const [,_0x3ee29e,_0x2818e2,_0x3ad993='']=_0x2c5e7b;return a31_0x343d08[_0x50c57b(0x1a7)](_0x3ee29e+':')+'\x20'+_0x2818e2+a31_0x343d08[_0x50c57b(0x1a7)](_0x3ad993);}return a31_0x343d08['dim'](_0x3fb98b);}function showFileNotFoundError(_0x3c8c5a,_0x1023bb){const _0xb4bb17=a31_0x10c381;console['error'](a31_0x343d08[_0xb4bb17(0x11b)]('Error:\x20File\x20not\x20found:\x20'+_0x3c8c5a+'\x0a')),console[_0xb4bb17(0xdd)](a31_0x343d08[_0xb4bb17(0x12a)](_0xb4bb17(0x96)+_0x1023bb+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x54e068){const _0x36fd51=a31_0x10c381;if(!_0x54e068[_0x36fd51(0x193)])return;const _0x2b2d53=_0x54e068[_0x36fd51(0x193)],_0x19acbe=_0x2b2d53[_0x36fd51(0x191)]?a31_0x343d08[_0x36fd51(0x97)]('⚡\x20Enabled'):a31_0x343d08[_0x36fd51(0x185)](_0x36fd51(0xbc));console['error']('\x0a'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x261))+'\x20'+_0x19acbe);if(_0x2b2d53[_0x36fd51(0xdc)]&&_0x2b2d53[_0x36fd51(0xdc)][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)]('Events:')+'\x20'+_0x2b2d53[_0x36fd51(0xdc)]['length']+_0x36fd51(0x135));for(const _0x85cacc of _0x2b2d53['events']){const _0x51a017=_0x85cacc[_0x36fd51(0x1f1)]===![]?a31_0x343d08[_0x36fd51(0x11b)]('✘'):a31_0x343d08[_0x36fd51(0x97)]('✔');console[_0x36fd51(0xdd)](_0x36fd51(0x263)+_0x51a017+'\x20'+_0x85cacc[_0x36fd51(0x23b)]),_0x85cacc[_0x36fd51(0x1dd)]&&console['error'](_0x36fd51(0x235)+a31_0x343d08[_0x36fd51(0x11b)](_0x85cacc['sourceTableError']));}}if(_0x2b2d53[_0x36fd51(0x166)]&&_0x2b2d53[_0x36fd51(0x166)][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x170))+'\x20'+_0x2b2d53[_0x36fd51(0x166)][_0x36fd51(0x190)]+_0x36fd51(0x135));for(const _0x2108bb of _0x2b2d53[_0x36fd51(0x166)]){const _0x3c90cd=_0x2108bb['valid']?a31_0x343d08[_0x36fd51(0x97)]('✔'):a31_0x343d08['red']('✘');console[_0x36fd51(0xdd)](_0x36fd51(0x263)+_0x3c90cd+'\x20'+_0x2108bb[_0x36fd51(0x23b)]+'\x20'+a31_0x343d08['dim']('('+_0x2108bb[_0x36fd51(0x83)]+')'));}}if(_0x2b2d53['idStitching']){const _0x380698=_0x2b2d53[_0x36fd51(0x155)][_0x36fd51(0xb5)]?.[_0x36fd51(0x190)]?'\x20+\x20['+_0x2b2d53['idStitching'][_0x36fd51(0xb5)][_0x36fd51(0xa1)](',\x20')+']':'';console['error']('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x23a))+'\x20'+_0x2b2d53[_0x36fd51(0x155)]['primaryKey']+_0x380698);}if(_0x2b2d53[_0x36fd51(0x101)]&&_0x2b2d53['personalizationServices'][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0xac))+'\x20'+_0x2b2d53['personalizationServices']['length']+_0x36fd51(0x18a)+(_0x2b2d53['personalizationServices'][_0x36fd51(0x190)]!==0x1?'s':''));for(const _0x462e28 of _0x2b2d53[_0x36fd51(0x101)]){console[_0x36fd51(0xdd)](_0x36fd51(0x1ab)+_0x462e28[_0x36fd51(0x23b)]);}}}function showParentSegmentNotSetError(_0x471b57){const _0x3a53c0=a31_0x10c381;console[_0x3a53c0(0xdd)](a31_0x343d08[_0x3a53c0(0x185)](_0x3a53c0(0x241))),console[_0x3a53c0(0xdd)](_0x471b57);}export class ParentSegmentListCommand extends BaseCommand{['name']='segment:parent:list';['description']='List\x20parent\x20segments';async[a31_0x10c381(0xa0)](_0x3098bc){const _0x4fee57=a31_0x10c381,{options:_0x298992,args:_0x19eaf8,tdx:_0x3066c2}=_0x3098bc,_0x1e51b2=_0x19eaf8[0x0];_0x298992[_0x4fee57(0x20b)]&&(console[_0x4fee57(0xdd)](_0x4fee57(0x25d)+_0x298992[_0x4fee57(0x201)]),_0x1e51b2&&console[_0x4fee57(0xdd)](_0x4fee57(0x220)+_0x1e51b2));const _0x60d6da=await withSpinner(_0x1e51b2?_0x4fee57(0x13c)+_0x1e51b2+_0x4fee57(0x169):_0x4fee57(0x250),()=>_0x3066c2['segment'][_0x4fee57(0x1c7)](),{'verbose':_0x298992[_0x4fee57(0x20b)]});let _0x42c91a=_0x60d6da[_0x4fee57(0x8b)];if(_0x1e51b2){const _0x21f67c=_0x1e51b2[_0x4fee57(0x15f)](/[.+^${}()|[\]\\]/g,_0x4fee57(0x1f3))['replace'](/\*/g,'.*')[_0x4fee57(0x15f)](/\?/g,'.'),_0xcb71d9=new RegExp('^'+_0x21f67c+'$','i');_0x42c91a=_0x42c91a[_0x4fee57(0xe0)](_0xc7704d=>_0xcb71d9['test'](_0xc7704d[_0x4fee57(0x166)]['name']));}_0x42c91a['sort']((_0x3f5cc9,_0x2c6157)=>_0x3f5cc9['attributes'][_0x4fee57(0x23b)][_0x4fee57(0x19e)](_0x2c6157[_0x4fee57(0x166)][_0x4fee57(0x23b)])),console[_0x4fee57(0xdd)](_0x4fee57(0x227)+_0x42c91a[_0x4fee57(0x190)]+_0x4fee57(0xca)+(_0x42c91a[_0x4fee57(0x190)]!==0x1?'s':''));const _0xabf71b=_0x3831f5=>{const _0x4f3d85=_0x4fee57;return getConsoleNextUrl(_0x298992[_0x4f3d85(0x201)],'/app/dw/parentSegments/'+_0x3831f5);};if(_0x298992['format']===_0x4fee57(0x22f)||_0x298992[_0x4fee57(0x6f)]===_0x4fee57(0xd1)){const _0x42622d=_0x42c91a[_0x4fee57(0xe9)](_0x54430f=>({..._0x54430f,'url':_0xabf71b(_0x54430f['id'])}));await handleSDKOutput(_0x42622d,_0x298992);}else{if(_0x42c91a[_0x4fee57(0x190)]===0x0)_0x1e51b2?console[_0x4fee57(0x1db)](_0x4fee57(0x17a)+_0x1e51b2):console[_0x4fee57(0x1db)](_0x4fee57(0x1d5));else for(const _0x128efa of _0x42c91a){const _0x45ac87=_0x128efa['attributes'][_0x4fee57(0x19b)]?a31_0x343d08[_0x4fee57(0x1a7)]('\x20('+formatRows(_0x128efa['attributes'][_0x4fee57(0x19b)])+')'):'',_0x31536e=hyperlink(_0x128efa[_0x4fee57(0x166)]['name'],_0xabf71b(_0x128efa['id']));console['log'](_0x4fee57(0xea)+_0x31536e+_0x45ac87);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x72);[a31_0x10c381(0x184)]=a31_0x10c381(0x15c);async[a31_0x10c381(0xa0)](_0x30d66b){const _0x45ef3d=a31_0x10c381,{options:_0x47dcb2,args:_0x53ffcd,tdx:_0x5d241e}=_0x30d66b;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x45ef3d(0x22d)+_0x45ef3d(0x211));const _0x56a0f8=_0x47dcb2;if(_0x53ffcd[_0x45ef3d(0x190)]===0x0)return console[_0x45ef3d(0xdd)](a31_0x343d08[_0x45ef3d(0x11b)](_0x45ef3d(0x99))),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x2a94b3=_0x53ffcd[0x0];if(!_0x56a0f8[_0x45ef3d(0x127)]||!_0x56a0f8['table'])return console[_0x45ef3d(0xdd)](_0x45ef3d(0xfb)),console[_0x45ef3d(0xdd)](_0x45ef3d(0xf4)),0x1;_0x56a0f8[_0x45ef3d(0x20b)]&&(console['error'](_0x45ef3d(0x25d)+_0x56a0f8[_0x45ef3d(0x201)]),console['error']('Name:\x20'+_0x2a94b3),console[_0x45ef3d(0xdd)](_0x45ef3d(0x9b)+_0x56a0f8[_0x45ef3d(0x127)]),console[_0x45ef3d(0xdd)](_0x45ef3d(0x11d)+_0x56a0f8[_0x45ef3d(0x27e)]));const _0x39917c=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x166)],_0x56a0f8[_0x45ef3d(0x71)]),_0x581764=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x70)],_0x56a0f8['behaviorsFile']),_0x53e0ca=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x102)],_0x56a0f8['customerGroupFile']),_0x21125d={'name':_0x2a94b3,'description':_0x56a0f8['description'],'scheduleType':_0x56a0f8[_0x45ef3d(0x177)],'scheduleOption':_0x56a0f8[_0x45ef3d(0x27b)],'timezone':_0x56a0f8[_0x45ef3d(0x214)],'master':{'parentDatabaseName':_0x56a0f8['database'],'parentTableName':_0x56a0f8[_0x45ef3d(0x27e)]},'attributes':_0x39917c,'behaviors':_0x581764,'customerGroup':_0x53e0ca},_0x125ae7=await withSpinner(_0x45ef3d(0x86)+_0x2a94b3+_0x45ef3d(0x169),()=>_0x5d241e[_0x45ef3d(0x209)][_0x45ef3d(0x73)](_0x21125d),{'verbose':_0x47dcb2[_0x45ef3d(0x20b)]}),_0x36ee59=_0x125ae7[_0x45ef3d(0x8b)];return console[_0x45ef3d(0xdd)](_0x45ef3d(0x194)+_0x36ee59['name']+_0x45ef3d(0x274)+_0x36ee59['id']),await handleSDKOutput([_0x36ee59],_0x47dcb2),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x218);['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x43aaf4){const _0x6bf07=a31_0x10c381,{options:_0x22ddfb,args:_0x46f3f3,tdx:_0x815c9}=_0x43aaf4;console[_0x6bf07(0xdd)](_0x6bf07(0x7f)+_0x6bf07(0x22d)+_0x6bf07(0x211));const _0x5cd3e5=_0x22ddfb;if(_0x46f3f3[_0x6bf07(0x190)]===0x0)return console['error'](a31_0x343d08[_0x6bf07(0x11b)](_0x6bf07(0x99))),console['error'](_0x6bf07(0x225)),0x1;const _0x314baf=_0x46f3f3[0x0];_0x5cd3e5[_0x6bf07(0x20b)]&&(console['error']('Site:\x20'+_0x5cd3e5['site']),console[_0x6bf07(0xdd)](_0x6bf07(0x224)+_0x314baf));const _0x5c1d31=await withSpinner(_0x6bf07(0x240)+_0x314baf+_0x6bf07(0x169),()=>_0x815c9[_0x6bf07(0x209)]['getParentFull'](_0x314baf),{'verbose':_0x5cd3e5['verbose']}),_0x2dba1f=_0x5c1d31['data'],_0x93ebbb=await loadJSONFromOptions(_0x5cd3e5['addAttributes'],_0x5cd3e5[_0x6bf07(0x180)]),_0x3b0f25=await loadJSONFromOptions(_0x5cd3e5['addBehaviors'],_0x5cd3e5[_0x6bf07(0x131)]),_0x590d80={'name':_0x2dba1f[_0x6bf07(0x23b)],'description':_0x5cd3e5[_0x6bf07(0x184)]!==undefined?_0x5cd3e5[_0x6bf07(0x184)]:_0x2dba1f[_0x6bf07(0x184)],'scheduleType':_0x5cd3e5[_0x6bf07(0x177)]!==undefined?_0x5cd3e5[_0x6bf07(0x177)]:_0x2dba1f[_0x6bf07(0x177)],'scheduleOption':_0x5cd3e5[_0x6bf07(0x27b)]!==undefined?_0x5cd3e5['scheduleOption']:_0x2dba1f[_0x6bf07(0x27b)],'timezone':_0x5cd3e5[_0x6bf07(0x214)]!==undefined?_0x5cd3e5[_0x6bf07(0x214)]:_0x2dba1f['timezone'],'master':_0x2dba1f['master'],'attributes':_0x93ebbb?[..._0x2dba1f['attributes']||[],..._0x93ebbb]:_0x2dba1f[_0x6bf07(0x166)],'behaviors':_0x3b0f25?[..._0x2dba1f[_0x6bf07(0x70)]||[],..._0x3b0f25]:_0x2dba1f[_0x6bf07(0x70)],'customerGroup':_0x2dba1f[_0x6bf07(0x102)]},_0x1458b6=await withSpinner(_0x6bf07(0x1ec)+_0x314baf+_0x6bf07(0x169),()=>_0x815c9[_0x6bf07(0x209)]['updateParent'](_0x314baf,_0x590d80),{'verbose':_0x5cd3e5[_0x6bf07(0x20b)]}),_0x3d14f5=_0x1458b6['data'];return console[_0x6bf07(0xdd)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x3d14f5[_0x6bf07(0x23b)]+'\x27'),await handleSDKOutput([_0x3d14f5],_0x5cd3e5),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']='segment:parent:pull';[a31_0x10c381(0x184)]=a31_0x10c381(0x178);async[a31_0x10c381(0xa0)](_0x5914c6){const _0x5e1418=a31_0x10c381,{options:_0x2a7f89,args:_0x16d040,tdx:_0x3e98ed}=_0x5914c6,_0x3841aa=_0x2a7f89,_0xd3e6f0=_0x16d040[0x0]||_0x2a7f89[_0x5e1418(0x113)];if(!_0xd3e6f0)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x5e1418(0x104)),0x1;if(_0x3841aa['use']&&_0x3841aa[_0x5e1418(0x1f5)])return console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x11b)](_0x5e1418(0x24d))),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)](_0x5e1418(0x95)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x5e1418(0xdd)](a31_0x343d08['cyan'](_0x5e1418(0x277))),0x1;const _0x2168c=_0x3841aa[_0x5e1418(0x1f5)]||a31_0x1ac1cb[_0x5e1418(0xa1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xd3e6f0)+'.yml');_0x3841aa[_0x5e1418(0x20b)]&&(console[_0x5e1418(0xdd)](_0x5e1418(0x25d)+_0x3841aa[_0x5e1418(0x201)]),console[_0x5e1418(0xdd)](_0x5e1418(0x224)+_0xd3e6f0),console[_0x5e1418(0xdd)](_0x5e1418(0x1bc)+_0x2168c));const _0x501d2c=await withSpinner(_0x5e1418(0xa9)+_0xd3e6f0+_0x5e1418(0x169),()=>_0x3e98ed[_0x5e1418(0x209)][_0x5e1418(0x159)](_0xd3e6f0),{'verbose':_0x3841aa[_0x5e1418(0x20b)]}),_0x316e1d=_0x501d2c[_0x5e1418(0x8b)];if(existsSync(_0x2168c)){const _0x53711b=readFileSync(_0x2168c,_0x5e1418(0x20f)),_0x1787d5=generateDiff(_0x53711b,_0x316e1d);if(!hasChanges(_0x1787d5))console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0x90)+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c)+'\x20is\x20already\x20up\x20to\x20date');else{console['error'](_0x5e1418(0x1b2)+_0x2168c+'\x27:'),console[_0x5e1418(0xdd)]('─'[_0x5e1418(0x1c1)](0x3c)),console[_0x5e1418(0xdd)](formatDiffWithColors(_0x1787d5)),console[_0x5e1418(0xdd)]('─'[_0x5e1418(0x1c1)](0x3c));if(!_0x3841aa[_0x5e1418(0x130)]){if(!isInteractive())return console['error'](a31_0x343d08[_0x5e1418(0x11b)](_0x5e1418(0xfd)),_0x5e1418(0x1b0)),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)](_0x5e1418(0x182))),0x1;const _0x110ecf=await confirmKey('Overwrite\x20\x27'+_0x2168c+'\x27?');if(!_0x110ecf)return console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x185)](_0x5e1418(0x1ae))),0x1;}writeFileSync(_0x2168c,_0x316e1d,'utf-8'),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0x14c)+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c));}}else{const _0x5b8b1e=a31_0x1ac1cb['dirname'](_0x2168c);!existsSync(_0x5b8b1e)&&mkdirSync(_0x5b8b1e,{'recursive':!![]}),writeFileSync(_0x2168c,_0x316e1d,_0x5e1418(0x20f)),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c));}return saveSessionContext({'parent_segment':_0xd3e6f0},_0x3841aa['session']),console['error'](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0xed)+a31_0x343d08['dim'](_0x5e1418(0x27d))+'\x20=\x20'+a31_0x343d08[_0x5e1418(0x12a)](_0xd3e6f0)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]='segment:parent:push';[a31_0x10c381(0x184)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0x171a9d){const _0x43569e=a31_0x10c381,{options:_0x282466,args:_0x1d0c17,tdx:_0x2da1ce}=_0x171a9d,_0x54c023=_0x282466,_0xf3e4b8=_0x1d0c17[0x0]||_0x282466[_0x43569e(0x113)];if(!_0xf3e4b8)return showParentSegmentNotSetError(_0x43569e(0x6c)+_0x43569e(0x245)),0x1;const _0x94f6bc=resolveYamlFile(_0xf3e4b8);if(!existsSync(_0x94f6bc))return showFileNotFoundError(_0x94f6bc,_0xf3e4b8),0x1;_0x54c023[_0x43569e(0x20b)]&&(console['error'](_0x43569e(0x25d)+_0x54c023[_0x43569e(0x201)]),console['error']('YAML\x20file:\x20'+_0x94f6bc));let _0x4fb0c1;try{_0x4fb0c1=readFileSync(_0x94f6bc,_0x43569e(0x20f));}catch(_0x46032b){const _0x5deaca=_0x46032b instanceof Error?_0x46032b['message']:String(_0x46032b);return console[_0x43569e(0xdd)](_0x43569e(0x1cf)+_0x5deaca),0x1;}const _0x4ec2f8=await withSpinner(_0x43569e(0x1ff),()=>_0x2da1ce[_0x43569e(0x209)][_0x43569e(0xce)](_0x4fb0c1),{'verbose':_0x54c023['verbose']}),_0x4dd4ba=_0x4ec2f8['data'],{isNew:_0x4fa72,name:_0x3532f8,hasChanges:_0x5c524f,diffFormatted:_0x118c43}=_0x4dd4ba;if(!_0x5c524f)return console['error'](_0x43569e(0x1e6)+_0x3532f8+_0x43569e(0x1ce)),0x0;_0x4fa72?console[_0x43569e(0xdd)](_0x43569e(0xcb)+_0x3532f8+'\x27:'):console['error'](_0x43569e(0xfa)+_0x3532f8+'\x27:');console[_0x43569e(0xdd)]('─'[_0x43569e(0x1c1)](0x3c)),console[_0x43569e(0xdd)](_0x118c43),console['error']('─'['repeat'](0x3c));const _0x3ed510=_0x4fa72?_0x43569e(0x136)+_0x3532f8+'\x27?':_0x43569e(0xb7)+_0x3532f8+'\x27?';if(!_0x54c023['yes']){if(!isInteractive())return console[_0x43569e(0xdd)](a31_0x343d08[_0x43569e(0x11b)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x43569e(0xdd)](a31_0x343d08['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4c3828=await confirmKey(_0x3ed510);if(!_0x4c3828)return console[_0x43569e(0xdd)](a31_0x343d08[_0x43569e(0x185)](_0x43569e(0x1ae))),0x1;}const _0x28d0c0=_0x4fa72?_0x43569e(0x147):_0x43569e(0x1a4),_0x52241c=await withSpinner(_0x28d0c0+_0x43569e(0x199)+_0x3532f8+'\x27...',()=>_0x4dd4ba[_0x43569e(0x9a)](),{'verbose':_0x54c023[_0x43569e(0x20b)]}),_0x552605=_0x52241c['data'],_0x1e14b9=getConsoleNextUrl(_0x54c023[_0x43569e(0x201)],_0x43569e(0x13d)+_0x552605['id']),_0x34ebeb=_0x4fa72?_0x43569e(0x21e):_0x43569e(0xcd);return console[_0x43569e(0xdd)]('✔\x20'+_0x34ebeb+_0x43569e(0x199)+_0x552605[_0x43569e(0x23b)]+'\x27'),console['error']('\x20\x20'+_0x1e14b9),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xd4);[a31_0x10c381(0x184)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a31_0x10c381(0xa0)](_0x135961){const _0xd78c2f=a31_0x10c381,{options:_0x38c0e8,args:_0x3c66fa,tdx:_0x1df442}=_0x135961,_0x53086f=_0x38c0e8,_0x237b8c=_0x3c66fa[0x0]||_0x38c0e8[_0xd78c2f(0x113)];if(!_0x237b8c)return showParentSegmentNotSetError(_0xd78c2f(0xef)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0xd78c2f(0x1a2)+_0xd78c2f(0x1b6)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0xd78c2f(0xd9)),0x1;const _0x1ce1d9=resolveYamlFile(_0x237b8c);if(!existsSync(_0x1ce1d9))return showFileNotFoundError(_0x1ce1d9,_0x237b8c),0x1;_0x53086f[_0xd78c2f(0x20b)]&&(console[_0xd78c2f(0xdd)](_0xd78c2f(0x25d)+_0x53086f[_0xd78c2f(0x201)]),console[_0xd78c2f(0xdd)]('YAML\x20file:\x20'+_0x1ce1d9));let _0x258ce7;try{_0x258ce7=readFileSync(_0x1ce1d9,_0xd78c2f(0x20f));}catch(_0x304227){const _0x173b17=_0x304227 instanceof Error?_0x304227[_0xd78c2f(0x14e)]:String(_0x304227);return console[_0xd78c2f(0xdd)](_0xd78c2f(0x1cf)+_0x173b17),0x1;}const _0x573b64=createCommandSpinner(a31_0x343d08[_0xd78c2f(0x1a7)](_0xd78c2f(0x216)),{'verbose':_0x53086f[_0xd78c2f(0x20b)]});_0x573b64[_0xd78c2f(0x134)]();const _0x32e9e3={'onProgress':_0x61ba4f=>{_0x573b64['text']=formatProgressMessage(_0x61ba4f);}};if(_0x53086f[_0xd78c2f(0x77)])_0x32e9e3[_0xd78c2f(0x77)]=!![];if(_0x53086f[_0xd78c2f(0x27f)])_0x32e9e3[_0xd78c2f(0x27f)]=!![];_0x53086f[_0xd78c2f(0xf8)]&&(_0x32e9e3[_0xd78c2f(0xf8)]=_0x53086f[_0xd78c2f(0xf8)]);_0x53086f['behavior']&&(_0x32e9e3[_0xd78c2f(0x239)]=_0x53086f[_0xd78c2f(0x239)]);if(_0x53086f['interval'])_0x32e9e3['interval']=_0x53086f[_0xd78c2f(0x1f4)];let _0x2cb6e8;try{_0x2cb6e8=await _0x1df442[_0xd78c2f(0x209)][_0xd78c2f(0x13e)](_0x258ce7,_0x32e9e3),_0x573b64[_0xd78c2f(0xf6)]();}catch(_0x47ae22){_0x573b64['stop']();throw _0x47ae22;}const _0x3907d4=_0x53086f[_0xd78c2f(0x1f4)]||_0xd78c2f(0x206);return this[_0xd78c2f(0xf5)](_0x2cb6e8,_0x32e9e3,_0x1ce1d9,_0x3907d4),_0x2cb6e8[_0xd78c2f(0x202)]?0x0:0x1;}[a31_0x10c381(0xf5)](_0x57cabf,_0xa75c38,_0x15cac8,_0x12fd59){const _0x2ee003=a31_0x10c381;console['error']('\x0a'+a31_0x343d08['bold'](_0x2ee003(0x115))+'\x20'+_0x57cabf[_0x2ee003(0x23b)]),console[_0x2ee003(0xdd)]('═'[_0x2ee003(0x1c1)](0x3c)),this[_0x2ee003(0x1c5)](_0x57cabf);if(typeof _0xa75c38[_0x2ee003(0xf8)]===_0x2ee003(0x6d)){this[_0x2ee003(0x213)](_0x57cabf),this['displaySummary'](_0x57cabf),this['displayPreviewHints'](_0x15cac8,_0x12fd59,_0x2ee003(0xf8),_0xa75c38[_0x2ee003(0xf8)]);return;}if(_0xa75c38[_0x2ee003(0xf8)]===!![]){this[_0x2ee003(0x213)](_0x57cabf),this['displaySummary'](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,'attributes');return;}if(typeof _0xa75c38[_0x2ee003(0x239)]===_0x2ee003(0x6d)){this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this['displaySummary'](_0x57cabf),this['displayPreviewHints'](_0x15cac8,_0x12fd59,'behavior',_0xa75c38[_0x2ee003(0x239)]);return;}if(_0xa75c38[_0x2ee003(0x239)]===!![]){this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this['displaySummary'](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,'behaviors');return;}this[_0x2ee003(0x213)](_0x57cabf),this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this[_0x2ee003(0x187)](_0x57cabf),this[_0x2ee003(0xc8)](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,_0x2ee003(0x1e8));}[a31_0x10c381(0x187)](_0xef9990){displayRealtimeValidation(_0xef9990);}[a31_0x10c381(0x16c)](_0xc115bf,_0x4ccd89,_0x255708,_0x3b533d){const _0x270f54=a31_0x10c381;console[_0x270f54(0xdd)]('\x0a'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x1f6)));const _0x3f5906=_0x4ccd89!==_0x270f54(0x206)?_0x270f54(0x8c)+_0x4ccd89:'';if(_0x255708==='attribute'&&_0x3b533d)console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x26b)+_0x3b533d+'\x22'+_0x3f5906));else{if(_0x255708===_0x270f54(0x239)&&_0x3b533d)console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x13b)+_0x3b533d+'\x22'+_0x3f5906));else(_0x255708==='attributes'||_0x255708===_0x270f54(0x1e8))&&console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)]('tdx\x20ps\x20preview\x20'+_0xc115bf+'\x20--attribute\x20\x22<name>\x22'+_0x3f5906));}(_0x255708==='behaviors'||_0x255708===_0x270f54(0x1e8))&&console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x22e)+_0x3f5906)),_0x255708===_0x270f54(0x1e8)&&console['error']('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)]('tdx\x20ps\x20preview\x20'+_0xc115bf+'\x20--enriched'+_0x3f5906));}[a31_0x10c381(0x1c5)](_0x19c790){const _0x256ce5=a31_0x10c381,{master:_0x44faa4}=_0x19c790,_0x28de44=_0x44faa4[_0x256ce5(0x121)]?a31_0x343d08[_0x256ce5(0x97)]('✔'):a31_0x343d08['red']('✘');console[_0x256ce5(0xdd)]('\x0a'+a31_0x343d08['dim'](_0x256ce5(0x108))),console[_0x256ce5(0xdd)](_0x28de44+'\x20'+a31_0x343d08[_0x256ce5(0x10a)](_0x44faa4[_0x256ce5(0x127)]+'.'+_0x44faa4[_0x256ce5(0x27e)])),_0x44faa4[_0x256ce5(0x121)]?_0x44faa4[_0x256ce5(0x139)]!==undefined&&console[_0x256ce5(0xdd)]('\x20\x20'+a31_0x343d08[_0x256ce5(0x1a7)](_0x256ce5(0x16f))+'\x20'+a31_0x343d08[_0x256ce5(0x12a)](formatRows(_0x44faa4[_0x256ce5(0x139)]))):console[_0x256ce5(0xdd)]('\x20\x20'+a31_0x343d08[_0x256ce5(0x11b)](_0x256ce5(0xaa))+'\x20'+_0x44faa4[_0x256ce5(0x80)]);}['displayAttributesStats'](_0x31044a){const _0x5337eb=a31_0x10c381;if(_0x31044a[_0x5337eb(0x166)]['length']===0x0)return;console[_0x5337eb(0xdd)]('\x0a'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0x12b)));for(const _0x3fb821 of _0x31044a[_0x5337eb(0x166)]){const _0x37062b=_0x3fb821[_0x5337eb(0x121)]?a31_0x343d08[_0x5337eb(0x97)]('✔'):a31_0x343d08[_0x5337eb(0x11b)]('✘');let _0x1986a2='';if(_0x3fb821['schemaValid']&&_0x3fb821[_0x5337eb(0x111)]!==undefined&&_0x3fb821[_0x5337eb(0x14f)]!==undefined){const _0x42ba99=_0x3fb821[_0x5337eb(0x14f)][_0x5337eb(0x1de)](0x1),_0x591dbd=_0x3fb821[_0x5337eb(0x14f)]>=0x50?a31_0x343d08[_0x5337eb(0x97)]:_0x3fb821['coveragePercent']>=0x32?a31_0x343d08[_0x5337eb(0x185)]:a31_0x343d08[_0x5337eb(0x11b)];_0x1986a2='\x20'+a31_0x343d08[_0x5337eb(0x1a7)]('Coverage:')+'\x20'+_0x591dbd(_0x42ba99+'%')+'\x20('+formatRows(_0x3fb821['matchedCount'])+_0x5337eb(0x78);}console[_0x5337eb(0xdd)](_0x37062b+'\x20'+a31_0x343d08[_0x5337eb(0x10a)](_0x3fb821[_0x5337eb(0x23b)])+_0x1986a2),console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0xa3))+'\x20'+a31_0x343d08[_0x5337eb(0x10a)](_0x3fb821[_0x5337eb(0x127)]+'.'+_0x3fb821[_0x5337eb(0x27e)]));const _0x3cdd2f=_0x3fb821[_0x5337eb(0x14d)]===_0x3fb821[_0x5337eb(0x20a)]?a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0x22c))+'\x20'+_0x3fb821[_0x5337eb(0x14d)]:a31_0x343d08[_0x5337eb(0x1a7)]('Join:')+'\x20'+_0x3fb821[_0x5337eb(0x14d)]+_0x5337eb(0x212)+_0x3fb821[_0x5337eb(0x20a)];console['error']('\x20\x20'+_0x3cdd2f),console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0xd5))),this[_0x5337eb(0x114)](_0x3fb821[_0x5337eb(0x1e1)]),!_0x3fb821[_0x5337eb(0x121)]&&console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08['red']('Error:')+'\x20'+_0x3fb821[_0x5337eb(0x80)]);}}[a31_0x10c381(0x1eb)](_0x41b017,_0x39bfd0){const _0x7fa835=a31_0x10c381;if(_0x41b017[_0x7fa835(0x70)][_0x7fa835(0x190)]===0x0)return;console['error']('\x0a'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xa5))+'\x20'+a31_0x343d08['dim']('('+_0x39bfd0+')'));for(const _0x16facd of _0x41b017[_0x7fa835(0x70)]){const _0x1038b1=_0x16facd[_0x7fa835(0x121)]?a31_0x343d08['green']('✔'):a31_0x343d08['red']('✘');let _0x6af501='';if(_0x16facd[_0x7fa835(0x121)]&&_0x16facd['customersWithEvents']!==undefined&&_0x16facd[_0x7fa835(0x6a)]!==undefined){const _0x1b6bc7=_0x16facd['customerPercent']?.[_0x7fa835(0x1de)](0x1)||'?',_0x273fe0=(_0x16facd[_0x7fa835(0x174)]??0x0)>=0x32?a31_0x343d08['green']:(_0x16facd[_0x7fa835(0x174)]??0x0)>=0x14?a31_0x343d08['yellow']:a31_0x343d08[_0x7fa835(0x11b)];_0x6af501='\x20'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xe3))+'\x20'+_0x273fe0(formatRows(_0x16facd[_0x7fa835(0x266)]))+'\x20('+_0x1b6bc7+'%)\x20'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0x160))+'\x20'+a31_0x343d08['cyan'](formatRows(_0x16facd['totalEvents']));}console[_0x7fa835(0xdd)](_0x1038b1+'\x20'+a31_0x343d08['bold'](_0x16facd['name'])+_0x6af501),console[_0x7fa835(0xdd)]('\x20\x20'+a31_0x343d08[_0x7fa835(0x1a7)]('Source:')+'\x20'+a31_0x343d08[_0x7fa835(0x10a)](_0x16facd[_0x7fa835(0x127)]+'.'+_0x16facd[_0x7fa835(0x27e)]));const _0x13f23a=_0x16facd[_0x7fa835(0x14d)]===_0x16facd['foreignKey']?a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0x22c))+'\x20'+_0x16facd[_0x7fa835(0x14d)]:a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xf9))+'\x20'+_0x16facd[_0x7fa835(0x14d)]+_0x7fa835(0x212)+_0x16facd[_0x7fa835(0x20a)];console['error']('\x20\x20'+_0x13f23a),console['error']('\x20\x20'+a31_0x343d08[_0x7fa835(0x1a7)]('Columns:')),this[_0x7fa835(0x114)](_0x16facd[_0x7fa835(0x1e1)]),!_0x16facd['schemaValid']&&console['error']('\x20\x20'+a31_0x343d08['red'](_0x7fa835(0xaa))+'\x20'+_0x16facd['schemaError']);}}[a31_0x10c381(0x114)](_0x56c907){const _0x43e2f9=a31_0x10c381;for(const _0x471d2d of _0x56c907){_0x471d2d[_0x43e2f9(0x23d)]===_0x471d2d[_0x43e2f9(0xbd)]||_0x471d2d[_0x43e2f9(0xbd)]==='*'?console[_0x43e2f9(0xdd)](_0x43e2f9(0x1ab)+_0x471d2d['label']):console[_0x43e2f9(0xdd)](_0x43e2f9(0x1ab)+_0x471d2d[_0x43e2f9(0x23d)]+'\x20'+a31_0x343d08[_0x43e2f9(0x1a7)]('('+_0x471d2d['column']+')'));}}[a31_0x10c381(0xc8)](_0x3a0d04){const _0x4767ea=a31_0x10c381;console[_0x4767ea(0xdd)]('─'[_0x4767ea(0x1c1)](0x3c));if(_0x3a0d04[_0x4767ea(0xc0)]['length']>0x0){console[_0x4767ea(0xdd)]('\x0a'+a31_0x343d08[_0x4767ea(0x11b)]('Errors:'));for(const _0x5a1673 of _0x3a0d04[_0x4767ea(0xc0)]){console[_0x4767ea(0xdd)]('\x20\x20'+a31_0x343d08[_0x4767ea(0x11b)]('•')+'\x20'+_0x5a1673);}}_0x3a0d04[_0x4767ea(0x202)]&&console['error']('\x0a'+a31_0x343d08[_0x4767ea(0x97)]('✔')+_0x4767ea(0x234));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xdf);[a31_0x10c381(0x184)]=a31_0x10c381(0x1fd);async[a31_0x10c381(0xa0)](_0x44efa8){const _0x1458f9=a31_0x10c381,{options:_0x12c47a,args:_0x19112d,tdx:_0x1cc753}=_0x44efa8,_0x32ee13=_0x12c47a,_0x42b1c6=_0x19112d[0x0]||_0x12c47a[_0x1458f9(0x113)];if(!_0x42b1c6)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0x1458f9(0x124)+'Options\x20(one\x20required):\x0a'+_0x1458f9(0x144)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x1458f9(0x269)+_0x1458f9(0xd9)),0x1;if(!_0x32ee13['master']&&!_0x32ee13[_0x1458f9(0xf8)]&&!_0x32ee13['behavior']&&!_0x32ee13[_0x1458f9(0x27f)])return console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0xde))),console[_0x1458f9(0xdd)](_0x1458f9(0x237)),console[_0x1458f9(0xdd)](_0x1458f9(0x19a)),console[_0x1458f9(0xdd)](_0x1458f9(0x109)),console[_0x1458f9(0xdd)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x1458f9(0xdd)](_0x1458f9(0x173)),console[_0x1458f9(0xdd)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x2488fe=resolveYamlFile(_0x42b1c6);if(!existsSync(_0x2488fe))return showFileNotFoundError(_0x2488fe,_0x42b1c6),0x1;_0x32ee13[_0x1458f9(0x20b)]&&(console['error'](_0x1458f9(0x25d)+_0x32ee13[_0x1458f9(0x201)]),console[_0x1458f9(0xdd)](_0x1458f9(0x12e)+_0x2488fe));let _0x32ed80;try{_0x32ed80=readFileSync(_0x2488fe,_0x1458f9(0x20f));}catch(_0x132a19){const _0x4503d0=_0x132a19 instanceof Error?_0x132a19[_0x1458f9(0x14e)]:String(_0x132a19);return console['error'](_0x1458f9(0x1cf)+_0x4503d0),0x1;}let _0x34607a;try{_0x34607a=parseDef(_0x32ed80);}catch(_0x247ff8){const _0x5447e3=_0x247ff8 instanceof Error?_0x247ff8[_0x1458f9(0x14e)]:String(_0x247ff8);return console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0xb0)+_0x5447e3)),0x1;}if(_0x32ee13[_0x1458f9(0xf8)]===!![]||_0x32ee13[_0x1458f9(0xf8)]===''){const _0x2d2c17=_0x34607a['attributes']?.['map'](_0x5501f6=>_0x5501f6['name'])||[];if(_0x2d2c17[_0x1458f9(0x190)]===0x0)console[_0x1458f9(0xdd)](a31_0x343d08['red']('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0x183))),console[_0x1458f9(0xdd)](_0x1458f9(0x217));for(const _0x4d315a of _0x2d2c17){console[_0x1458f9(0xdd)]('\x20\x20'+a31_0x343d08['cyan'](_0x4d315a));}console[_0x1458f9(0xdd)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x42b1c6+'\x20--attribute\x20\x22'+_0x2d2c17[0x0]+'\x22');}return 0x1;}if(_0x32ee13[_0x1458f9(0x239)]===!![]||_0x32ee13[_0x1458f9(0x239)]===''){const _0x3f2e3a=_0x34607a['behaviors']?.['map'](_0x6f6ba7=>_0x6f6ba7[_0x1458f9(0x23b)])||[];if(_0x3f2e3a[_0x1458f9(0x190)]===0x0)console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0x21a)));else{console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x1458f9(0xdd)]('Available\x20behaviors:');for(const _0x5b9b0c of _0x3f2e3a){console[_0x1458f9(0xdd)]('\x20\x20'+a31_0x343d08[_0x1458f9(0x12a)](_0x5b9b0c));}console[_0x1458f9(0xdd)](_0x1458f9(0x12f)+_0x42b1c6+_0x1458f9(0x13b)+_0x3f2e3a[0x0]+'\x22');}return 0x1;}const _0x32468c=createCommandSpinner(a31_0x343d08[_0x1458f9(0x1a7)](_0x1458f9(0x1b8)),{'verbose':_0x32ee13[_0x1458f9(0x20b)]});_0x32468c[_0x1458f9(0x134)]();const _0x32d7c5={'onProgress':_0xd559ca=>{const _0xbb0b11=_0x1458f9;_0x32468c[_0xbb0b11(0xf0)]=formatProgressMessage(_0xd559ca);}};if(_0x32ee13[_0x1458f9(0x77)])_0x32d7c5['master']=!![];if(_0x32ee13['attribute']&&typeof _0x32ee13['attribute']===_0x1458f9(0x6d))_0x32d7c5['attribute']=_0x32ee13[_0x1458f9(0xf8)];if(_0x32ee13[_0x1458f9(0x239)]&&typeof _0x32ee13[_0x1458f9(0x239)]==='string')_0x32d7c5[_0x1458f9(0x239)]=_0x32ee13[_0x1458f9(0x239)];if(_0x32ee13[_0x1458f9(0x27f)])_0x32d7c5[_0x1458f9(0x27f)]=!![];if(_0x32ee13[_0x1458f9(0x1f4)])_0x32d7c5[_0x1458f9(0x1f4)]=_0x32ee13['interval'];let _0x2d3e8c;try{_0x2d3e8c=await _0x1cc753[_0x1458f9(0x209)][_0x1458f9(0x1c2)](_0x32ed80,_0x32d7c5),_0x32468c[_0x1458f9(0xf6)]();}catch(_0x587d24){_0x32468c[_0x1458f9(0xf6)]();throw _0x587d24;}return await this[_0x1458f9(0x7e)](_0x2d3e8c,{'master':_0x32ee13[_0x1458f9(0x77)],'attribute':typeof _0x32ee13[_0x1458f9(0xf8)]==='string'?_0x32ee13['attribute']:undefined,'behavior':typeof _0x32ee13['behavior']==='string'?_0x32ee13[_0x1458f9(0x239)]:undefined,'enriched':_0x32ee13[_0x1458f9(0x27f)]}),_0x2d3e8c[_0x1458f9(0x202)]?0x0:0x1;}async[a31_0x10c381(0x7e)](_0x77abfe,_0x1d111d){const _0x5429ac=a31_0x10c381;console['error']('\x0a'+a31_0x343d08[_0x5429ac(0x10a)](_0x5429ac(0x1c6))+'\x20'+_0x77abfe['name']),console[_0x5429ac(0xdd)]('═'[_0x5429ac(0x1c1)](0x3c));if(_0x1d111d[_0x5429ac(0x77)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x4ce067=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x242))+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x77abfe['master'][_0x5429ac(0x127)]+'.'+_0x77abfe[_0x5429ac(0x77)][_0x5429ac(0x27e)]);await this[_0x5429ac(0x125)](_0x4ce067,_0x77abfe['sampleData']);}else{if(_0x1d111d[_0x5429ac(0xf8)]&&_0x77abfe['sampleData']){const _0x3417c8=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x10c))+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x1d111d[_0x5429ac(0xf8)]);await this[_0x5429ac(0x125)](_0x3417c8,_0x77abfe['sampleData']);}else{if(_0x1d111d[_0x5429ac(0x239)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x2f318d=a31_0x343d08[_0x5429ac(0x1a7)]('Behavior:')+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x1d111d[_0x5429ac(0x239)]);await this['displaySampleData'](_0x2f318d,_0x77abfe[_0x5429ac(0x226)]);}else{if(_0x1d111d[_0x5429ac(0x27f)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x59d38e=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x85))+'\x20'+a31_0x343d08['bold']('Master\x20+\x20Attributes');await this[_0x5429ac(0x125)](_0x59d38e,_0x77abfe['sampleData']);}else!_0x77abfe[_0x5429ac(0x226)]&&console[_0x5429ac(0xdd)](_0x5429ac(0x151));}}}if(_0x77abfe[_0x5429ac(0xc0)][_0x5429ac(0x190)]>0x0){console[_0x5429ac(0xdd)]('─'[_0x5429ac(0x1c1)](0x3c)),console['error']('\x0a'+a31_0x343d08[_0x5429ac(0x11b)](_0x5429ac(0x163)));for(const _0x1d1a69 of _0x77abfe['errors']){console['error']('\x20\x20'+a31_0x343d08[_0x5429ac(0x11b)]('•')+'\x20'+_0x1d1a69);}}}async['displaySampleData'](_0x1899ea,_0x3c7bc6){const _0x3f44e2=a31_0x10c381;if(_0x3c7bc6[_0x3f44e2(0x190)]===0x0){console[_0x3f44e2(0xdd)]('\x0a'+_0x1899ea),console[_0x3f44e2(0xdd)](_0x3f44e2(0x17d));return;}console[_0x3f44e2(0xdd)]('\x0a'+_0x1899ea);const _0x1437b6=Object[_0x3f44e2(0x93)](_0x3c7bc6[0x0])['map'](_0x930ba4=>({'name':_0x930ba4,'type':typeof _0x3c7bc6[0x0][_0x930ba4]===_0x3f44e2(0x1e5)?_0x3f44e2(0x1a6):_0x3f44e2(0x9d)})),_0x835ce4={'queryId':'preview','columns':_0x1437b6,'data':_0x3c7bc6,'stats':{'state':_0x3f44e2(0x1b7),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3c7bc6[_0x3f44e2(0x190)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5add35=formatAsTable(_0x835ce4,_0x3c7bc6[_0x3f44e2(0x190)],!![]);await writeOutput(_0x5add35,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x8a);[a31_0x10c381(0x184)]=a31_0x10c381(0x6b);async[a31_0x10c381(0xa0)](_0x335d89){const _0x4c169f=a31_0x10c381,{options:_0x6e259d,args:_0x51b9b7,tdx:_0x26eff8}=_0x335d89,_0x2447f8=_0x6e259d,_0xe5ca08=_0x51b9b7[0x0]||_0x6e259d[_0x4c169f(0x113)];if(!_0xe5ca08)return showParentSegmentNotSetError(_0x4c169f(0x18e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x2def5b=resolveYamlFile(_0xe5ca08);if(existsSync(_0x2def5b)){_0x2447f8['verbose']&&console[_0x4c169f(0xdd)](_0x4c169f(0xd0)+_0x2def5b);let _0x18ea26;try{_0x18ea26=readFileSync(_0x2def5b,_0x4c169f(0x20f));}catch(_0x270f74){const _0x1e6b59=_0x270f74 instanceof Error?_0x270f74[_0x4c169f(0x14e)]:String(_0x270f74);return console[_0x4c169f(0xdd)]('Error\x20reading\x20file:\x20'+_0x1e6b59),0x1;}const _0x215205=await withSpinner('Analyzing\x20changes...',()=>_0x26eff8[_0x4c169f(0x209)][_0x4c169f(0xce)](_0x18ea26),{'verbose':_0x2447f8['verbose']}),_0x212929=_0x215205[_0x4c169f(0x8b)],{isNew:_0x49c254,name:_0x4c71a4,hasChanges:_0xa209f2,diffFormatted:_0x466939}=_0x212929;if(_0xa209f2){_0x49c254?console[_0x4c169f(0xdd)](_0x4c169f(0xcb)+_0x4c71a4+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x4c71a4+'\x27:');console[_0x4c169f(0xdd)]('─'[_0x4c169f(0x1c1)](0x3c)),console[_0x4c169f(0xdd)](_0x466939),console[_0x4c169f(0xdd)]('─'[_0x4c169f(0x1c1)](0x3c));const _0x1d108e=_0x49c254?'Create\x20parent\x20segment\x20\x27'+_0x4c71a4+'\x27\x20and\x20run\x20workflow?':_0x4c169f(0xb7)+_0x4c71a4+_0x4c169f(0xee);if(!_0x2447f8['yes']){if(!isInteractive())return console['error'](a31_0x343d08[_0x4c169f(0x11b)]('\x0aError:'),_0x4c169f(0x1b0)),console[_0x4c169f(0xdd)](a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0x182))),0x1;const _0x36c1b4=await confirmKey(_0x1d108e);if(!_0x36c1b4)return console[_0x4c169f(0xdd)](a31_0x343d08[_0x4c169f(0x185)](_0x4c169f(0x1ae))),0x1;}const _0x1de1c5=_0x49c254?_0x4c169f(0x147):_0x4c169f(0x1a4);await withSpinner(_0x1de1c5+_0x4c169f(0x199)+_0x4c71a4+_0x4c169f(0x169),()=>_0x212929['apply'](),{'verbose':_0x2447f8[_0x4c169f(0x20b)]});const _0x270001=_0x49c254?_0x4c169f(0x21e):'Updated';console[_0x4c169f(0xdd)]('✔\x20'+_0x270001+_0x4c169f(0x199)+_0x4c71a4+'\x27');}else console[_0x4c169f(0xdd)](_0x4c169f(0x1e6)+_0x4c71a4+_0x4c169f(0xb8));}const _0xdfb9d0=await withSpinner(_0x4c169f(0x257)+_0xe5ca08+_0x4c169f(0x169),()=>_0x26eff8[_0x4c169f(0x209)][_0x4c169f(0x1d4)](_0xe5ca08),{'verbose':_0x2447f8[_0x4c169f(0x20b)]}),_0x199606=_0xdfb9d0['data'],_0x341710=getConsoleUrl(_0x2447f8['site'],_0x4c169f(0x179)+_0x199606[_0x4c169f(0xf2)]+_0x4c169f(0x10f)+_0x199606[_0x4c169f(0x172)]+_0x4c169f(0x22a)+_0x199606[_0x4c169f(0x271)]);return console[_0x4c169f(0xdd)]('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0xec))+'\x20'+_0x199606[_0x4c169f(0x75)]),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0x171))+'\x20'+_0x199606[_0x4c169f(0xab)]),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08['dim'](_0x4c169f(0xd2))+'\x20'+_0x199606['workflowSessionId']),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0xa8))+'\x20'+_0x199606[_0x4c169f(0x271)]),console[_0x4c169f(0xdd)]('\x20\x20'+_0x341710),console[_0x4c169f(0xdd)]('\x0a'+a31_0x343d08['dim']('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x199606[_0x4c169f(0x271)]+_0x4c169f(0xcc)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x1ba);[a31_0x10c381(0x184)]=a31_0x10c381(0x105);async[a31_0x10c381(0xa0)](_0x52e1ff){const _0x2a8514=a31_0x10c381,{options:_0x30f9e3,args:_0x5e3599,tdx:_0x52078f}=_0x52e1ff,_0x221fe7=_0x5e3599[0x0]||_0x30f9e3['parentSegment'];if(!_0x221fe7)return showParentSegmentNotSetError(_0x2a8514(0x200)+_0x2a8514(0xbb)),0x1;_0x30f9e3[_0x2a8514(0x20b)]&&(console[_0x2a8514(0xdd)](_0x2a8514(0x25d)+_0x30f9e3[_0x2a8514(0x201)]),console[_0x2a8514(0xdd)](_0x2a8514(0x224)+_0x221fe7));const _0x2429e0=await withSpinner(_0x2a8514(0xa6)+_0x221fe7+_0x2a8514(0x169),()=>_0x52078f[_0x2a8514(0x209)][_0x2a8514(0x9e)](_0x221fe7),{'verbose':_0x30f9e3[_0x2a8514(0x20b)]}),_0x596ded=_0x2429e0[_0x2a8514(0x8b)];console['error'](_0x2a8514(0x227)+_0x596ded[_0x2a8514(0x190)]+_0x2a8514(0x264)+(_0x596ded[_0x2a8514(0x190)]!==0x1?'s':''));if(_0x30f9e3[_0x2a8514(0x22f)]||_0x30f9e3[_0x2a8514(0xd1)])return await handleSDKOutput(_0x596ded,_0x30f9e3),0x0;return displayFieldsHumanReadable(_0x596ded,_0x221fe7),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a31_0x10c381(0x1d7);[a31_0x10c381(0x184)]=a31_0x10c381(0x270);async['execute'](_0x353f90){const _0x318124=a31_0x10c381,{options:_0x2bc0b0,args:_0x4aeacb,tdx:_0x480c32}=_0x353f90,_0x37defb=_0x2bc0b0,_0x8fea50=_0x4aeacb[0x0]||_0x2bc0b0[_0x318124(0x113)];if(!_0x8fea50)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0x318124(0x278)+'Options:\x0a'+_0x318124(0x20c)),0x1;_0x2bc0b0['verbose']&&(console['error'](_0x318124(0x25d)+_0x2bc0b0[_0x318124(0x201)]),console[_0x318124(0xdd)](_0x318124(0x224)+_0x8fea50));const _0x4aed97=await withSpinner(_0x318124(0xa9)+_0x8fea50+'\x27...',()=>_0x480c32[_0x318124(0x209)]['getParentFull'](_0x8fea50),{'verbose':_0x2bc0b0['verbose']}),_0x2ef3b9=_0x4aed97[_0x318124(0x8b)];if(_0x37defb[_0x318124(0xa4)]){const _0x2f2274=getConsoleNextUrl(_0x37defb[_0x318124(0x201)],_0x318124(0x13d)+_0x2ef3b9['id']);return console['error'](a31_0x343d08[_0x318124(0x97)]('✔')+_0x318124(0x1fb)+a31_0x343d08[_0x318124(0x12a)](_0x2f2274)),openBrowser(_0x2f2274),0x0;}return await handleSingleObjectOutput(_0x2ef3b9,_0x2bc0b0),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']='segment:parent:desc';[a31_0x10c381(0x184)]=a31_0x10c381(0x26c);async[a31_0x10c381(0xa0)](_0x4c4d50){const _0x23b122=a31_0x10c381,{options:_0x93b121,args:_0x4098ea,tdx:_0x1ecf2e}=_0x4c4d50,_0x428f7d=_0x93b121,_0x428147=_0x4098ea[0x0]||_0x93b121[_0x23b122(0x113)];if(!_0x428147)return showParentSegmentNotSetError(_0x23b122(0xd6)+_0x23b122(0x238)+'Options:\x0a'+_0x23b122(0x247)),0x1;_0x93b121[_0x23b122(0x20b)]&&(console[_0x23b122(0xdd)](_0x23b122(0x25d)+_0x93b121[_0x23b122(0x201)]),console[_0x23b122(0xdd)](_0x23b122(0x224)+_0x428147));const _0x591c0a=await withSpinner(_0x23b122(0x252)+_0x428147+_0x23b122(0x169),()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x13a)](_0x428147),{'verbose':_0x93b121[_0x23b122(0x20b)]}),_0x3620f3=_0x591c0a[_0x23b122(0x8b)],_0x1e3b9c=_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x268)](_0x3620f3);if(_0x428f7d[_0x23b122(0x1f5)]){const _0x1b65b0=await this[_0x23b122(0x157)](_0x4c4d50,_0x428147,_0x3620f3,_0x1e3b9c),_0x529d39=this[_0x23b122(0x8f)](_0x1b65b0);writeFileSync(_0x428f7d[_0x23b122(0x1f5)],_0x529d39);const _0x13fdec=_0x1b65b0[_0x23b122(0x141)]['columns']['length']+_0x1b65b0[_0x23b122(0x70)]['reduce']((_0x43a1f6,_0x4fd031)=>_0x43a1f6+_0x4fd031[_0x23b122(0x1e1)][_0x23b122(0x190)],0x0),_0x362f41=_0x1b65b0[_0x23b122(0x70)][_0x23b122(0xe0)](_0x26c352=>_0x26c352[_0x23b122(0x1e1)][_0x23b122(0x190)]===0x0)['length'];return console[_0x23b122(0x1db)](_0x23b122(0xf7)+_0x428f7d[_0x23b122(0x1f5)]),console[_0x23b122(0x1db)](_0x23b122(0x10b)+_0x1e3b9c),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x1b65b0[_0x23b122(0x70)][_0x23b122(0x190)]+_0x23b122(0x21f)),console[_0x23b122(0x1db)](_0x23b122(0xc6)+_0x13fdec+'\x20total'),_0x362f41>0x0&&console[_0x23b122(0x1db)](_0x23b122(0x14b)+_0x362f41+_0x23b122(0x228)),0x0;}console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)]('Output\x20Database:')+'\x20'+a31_0x343d08[_0x23b122(0x12a)](_0x1e3b9c));const _0x32b90c=await withSpinner(_0x23b122(0x23c),()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x1c4)](_0x3620f3),{'verbose':_0x93b121[_0x23b122(0x20b)]});console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)]('customers')+'\x20'+a31_0x343d08[_0x23b122(0x1a7)]('('+_0x1e3b9c+_0x23b122(0x87)));const _0x4ebcb7=await executeSchemaQuery(_0x32b90c[_0x23b122(0x8b)],_0x1ecf2e,_0x93b121);await handleQueryOutput(_0x4ebcb7,_0x93b121);const _0x303d29=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x24e)](_0x3620f3),{'verbose':_0x93b121[_0x23b122(0x20b)]});for(const _0x3e9c41 of _0x303d29[_0x23b122(0x8b)]){const _0x425d64='behavior_'+_0x3e9c41[_0x23b122(0x198)]()['replace'](/\s+/g,'_'),_0x27e650=_0x23b122(0x272)+_0x1e3b9c+'.'+_0x425d64;console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)](_0x3e9c41)+'\x20'+a31_0x343d08[_0x23b122(0x1a7)]('('+_0x1e3b9c+'.'+_0x425d64+')'));try{const _0x5f2453=await executeSchemaQuery(_0x27e650,_0x1ecf2e,_0x93b121);await handleQueryOutput(_0x5f2453,_0x93b121);}catch{console['error'](a31_0x343d08['yellow'](_0x23b122(0x19d)));}}return 0x0;}async[a31_0x10c381(0x157)](_0x4a80ab,_0xec355c,_0x402939,_0x50efad){const _0x222dc3=a31_0x10c381,{options:_0x35209c,tdx:_0x4add41}=_0x4a80ab,_0x499e5d=await withSpinner(_0x222dc3(0x23c),()=>_0x4add41[_0x222dc3(0x209)][_0x222dc3(0x1c4)](_0x402939),{'verbose':_0x35209c[_0x222dc3(0x20b)]}),_0xc67c56=await executeSchemaQuery(_0x499e5d[_0x222dc3(0x8b)],_0x4add41,_0x35209c),_0x28c57d=_0xc67c56[_0x222dc3(0x8b)][_0x222dc3(0xe9)](_0x295c8f=>({'name':_0x295c8f['column_name'],'type':_0x295c8f['column_type']})),_0x2b1700=await withSpinner(_0x222dc3(0x129),()=>_0x4add41[_0x222dc3(0x209)][_0x222dc3(0x24e)](_0x402939),{'verbose':_0x35209c['verbose']}),_0x2ee692=[];for(const _0x4d0b95 of _0x2b1700[_0x222dc3(0x8b)]){const _0x328d2f=_0x222dc3(0x1d2)+_0x4d0b95[_0x222dc3(0x198)]()[_0x222dc3(0x15f)](/\s+/g,'_'),_0x3714e9='SELECT\x20*\x20FROM\x20'+_0x50efad+'.'+_0x328d2f;let _0x1d4dc6=[];try{const _0x3f2955=await executeSchemaQuery(_0x3714e9,_0x4add41,_0x35209c);_0x1d4dc6=_0x3f2955[_0x222dc3(0x8b)][_0x222dc3(0xe9)](_0x231c0a=>({'name':_0x231c0a[_0x222dc3(0x20e)],'type':_0x231c0a[_0x222dc3(0x1f2)]}));}catch{}_0x2ee692[_0x222dc3(0x188)]({'table':_0x328d2f,'columns':_0x1d4dc6});}return{'database':_0x50efad,'parent_segment':_0xec355c,'parent_id':_0x402939,'customers':{'table':_0x222dc3(0x141),'columns':_0x28c57d},'behaviors':_0x2ee692};}['formatSchemaJson'](_0x4f71b3){const _0x557e6a=a31_0x10c381,_0x2e920e=_0x53a27c=>{const _0x3b63db=a31_0xc607;if(_0x53a27c[_0x3b63db(0x190)]===0x0)return'[]';const _0x5c9f07=_0x53a27c[_0x3b63db(0xe9)](_0x3529e0=>_0x3b63db(0x143)+_0x3529e0[_0x3b63db(0x23b)]+_0x3b63db(0x13f)+_0x3529e0['type']+_0x3b63db(0x1be));return'[\x0a'+_0x5c9f07['join'](',\x0a')+_0x3b63db(0x221);},_0x52d359=_0x4f71b3[_0x557e6a(0x70)][_0x557e6a(0xe9)](_0x20e1b3=>{const _0x402508=_0x557e6a;return _0x402508(0x1bb)+_0x20e1b3[_0x402508(0x27e)]+_0x402508(0x165)+_0x2e920e(_0x20e1b3['columns'])['replace'](/^/gm,'\x20\x20')[_0x402508(0x107)]()+'\x0a\x20\x20\x20\x20}';})[_0x557e6a(0xa1)](',\x0a');return _0x557e6a(0x259)+_0x4f71b3[_0x557e6a(0x127)]+_0x557e6a(0x24f)+_0x4f71b3[_0x557e6a(0x27d)]+_0x557e6a(0x232)+_0x4f71b3[_0x557e6a(0x84)]+_0x557e6a(0x26d)+_0x4f71b3[_0x557e6a(0x141)][_0x557e6a(0x27e)]+_0x557e6a(0xd3)+_0x2e920e(_0x4f71b3[_0x557e6a(0x141)]['columns'])[_0x557e6a(0x15f)](/^/gm,'\x20\x20')['trim']()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x52d359+_0x557e6a(0x17e);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x10e);[a31_0x10c381(0x184)]=a31_0x10c381(0x25b);async['execute'](_0x3118b8){const _0xc511a5=a31_0x10c381,{options:_0xbd78e8,args:_0x358d30,tdx:_0x104cfe}=_0x3118b8,_0x53a9de=_0x358d30[0x0]||_0xbd78e8[_0xc511a5(0x113)];if(!_0x53a9de)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0xc511a5(0x21b)),0x1;_0xbd78e8[_0xc511a5(0x20b)]&&(console[_0xc511a5(0xdd)](_0xc511a5(0x25d)+_0xbd78e8[_0xc511a5(0x201)]),console['error'](_0xc511a5(0x224)+_0x53a9de));const _0x35c3c7=await withSpinner(_0xc511a5(0x252)+_0x53a9de+_0xc511a5(0x169),()=>_0x104cfe[_0xc511a5(0x209)]['resolveParentId'](_0x53a9de),{'verbose':_0xbd78e8[_0xc511a5(0x20b)]}),_0x3d1be8=_0x35c3c7[_0xc511a5(0x8b)],_0x52306f=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x53a9de+_0xc511a5(0x169),()=>_0x104cfe[_0xc511a5(0x209)][_0xc511a5(0x1c4)](_0x3d1be8),{'verbose':_0xbd78e8[_0xc511a5(0x20b)]}),_0x1d4e19=_0x52306f[_0xc511a5(0x8b)];return _0xbd78e8['format']===_0xc511a5(0x22f)||_0xbd78e8[_0xc511a5(0x6f)]===_0xc511a5(0xd1)?await handleSDKOutput([{'sql':_0x1d4e19}],_0xbd78e8):console[_0xc511a5(0x1db)](_0x1d4e19),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a31_0x10c381(0x1ed);[a31_0x10c381(0x184)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x10c381(0xa0)](_0x44cbb5){const _0x4d97b6=a31_0x10c381,{options:_0x536f51,args:_0x56e795,tdx:_0x41d497}=_0x44cbb5,_0x42bda3=_0x56e795[0x0]||_0x536f51[_0x4d97b6(0x113)];if(!_0x42bda3)return showParentSegmentNotSetError(_0x4d97b6(0x1ad)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x536f51[_0x4d97b6(0x20b)]&&(console[_0x4d97b6(0xdd)](_0x4d97b6(0x25d)+_0x536f51[_0x4d97b6(0x201)]),console[_0x4d97b6(0xdd)]('Parent\x20segment:\x20'+_0x42bda3));const _0x124ce2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x42bda3+_0x4d97b6(0x169),()=>_0x41d497[_0x4d97b6(0x209)][_0x4d97b6(0x13a)](_0x42bda3),{'verbose':_0x536f51[_0x4d97b6(0x20b)]}),_0x48ca78=_0x124ce2[_0x4d97b6(0x8b)],_0x5b15a1=await withSpinner(_0x4d97b6(0x116)+_0x42bda3+_0x4d97b6(0x169),()=>_0x41d497[_0x4d97b6(0x209)][_0x4d97b6(0x1c4)](_0x48ca78),{'verbose':_0x536f51[_0x4d97b6(0x20b)]});let _0x406b20=_0x5b15a1[_0x4d97b6(0x8b)];const _0x1828e7=resolveLimit(_0x536f51[_0x4d97b6(0x244)],DEFAULT_DISPLAY_LIMIT),_0x35390c=/\bLIMIT\s+\d+/i[_0x4d97b6(0x1f7)](_0x406b20);!_0x35390c&&(_0x406b20=_0x406b20[_0x4d97b6(0x107)]()[_0x4d97b6(0x15f)](/;+$/,''),_0x406b20=_0x4d97b6(0xd7)+_0x406b20+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x1828e7);_0x536f51[_0x4d97b6(0x20b)]&&console[_0x4d97b6(0xdd)](_0x4d97b6(0x230)+_0x406b20);const _0x236f44=await withProgressSpinner(_0x4d97b6(0x106),async _0x311afb=>{const _0x5e00a6=_0x4d97b6,_0x3d2a8a=await _0x41d497[_0x5e00a6(0x27c)][_0x5e00a6(0xa0)](_0x406b20,{'catalog':'td','schema':'information_schema','onJobId':_0x513ec8=>{const _0x250ed1=_0x5e00a6;_0x311afb[_0x250ed1(0x6e)](_0x513ec8);}});return _0x3d2a8a;},{'verbose':_0x536f51[_0x4d97b6(0x20b)]}),_0xaf7573=_0x236f44[_0x4d97b6(0x8b)],_0x5cbb8e=_0xaf7573[_0x4d97b6(0x197)]?_0x4d97b6(0x1a9)+_0xaf7573['jobId']+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0xaf7573[_0x4d97b6(0x22b)][_0x4d97b6(0xe2)][_0x4d97b6(0x18f)]()+_0x4d97b6(0xa2)+(_0x4d97b6(0xb9)+formatElapsed(_0xaf7573[_0x4d97b6(0x22b)]['elapsedTimeMillis'])+_0x5cbb8e)),await handleQueryOutput(_0xaf7573,_0x536f51),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:rt:list';[a31_0x10c381(0x184)]=a31_0x10c381(0x243);async['execute'](_0x33ffef){const _0x158950=a31_0x10c381,{options:_0x5b8526,args:_0x581243,tdx:_0x4dabc1}=_0x33ffef,_0x443136=_0x581243[0x0],_0x1e0121=await withSpinner(_0x443136?_0x158950(0x223)+_0x443136+'\x27...':_0x158950(0xc1),()=>_0x4dabc1[_0x158950(0x193)][_0x158950(0xb1)](),{'verbose':_0x5b8526[_0x158950(0x20b)]});let _0x364e25=_0x1e0121[_0x158950(0x8b)][_0x158950(0xe0)](_0xb93c79=>_0xb93c79['realtime_enabled']);if(_0x443136){const _0x2a8322=_0x443136[_0x158950(0x15f)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3633a0=new RegExp('^'+_0x2a8322+'$','i');_0x364e25=_0x364e25['filter'](_0x2da970=>_0x3633a0['test'](_0x2da970[_0x158950(0x23b)]));}_0x364e25[_0x158950(0x1c3)]((_0x4c7553,_0x1d2d7c)=>_0x4c7553[_0x158950(0x23b)][_0x158950(0x19e)](_0x1d2d7c['name'])),console['error'](_0x158950(0x227)+_0x364e25[_0x158950(0x190)]+_0x158950(0x258)+(_0x364e25['length']!==0x1?'s':''));const _0x2d10b6=_0x56441b=>{const _0x297ebd=_0x158950;return getConsoleNextUrl(_0x5b8526[_0x297ebd(0x201)],_0x297ebd(0x13d)+_0x56441b);};if(_0x5b8526['format']===_0x158950(0x22f)||_0x5b8526[_0x158950(0x6f)]===_0x158950(0xd1)){const _0x5e6cac=_0x364e25[_0x158950(0xe9)](_0x50d8d7=>({..._0x50d8d7,'url':_0x2d10b6(_0x50d8d7['id'])}));await handleSDKOutput(_0x5e6cac,_0x5b8526);}else{if(_0x364e25[_0x158950(0x190)]===0x0)console[_0x158950(0x1db)](_0x158950(0x1f9));else for(const _0x595944 of _0x364e25){const _0x40ad02=_0x595944[_0x158950(0x19b)]?a31_0x343d08[_0x158950(0x1a7)]('\x20('+formatRows(_0x595944['population'])+')'):'',_0x38dc73=hyperlink(_0x595944[_0x158950(0x23b)],_0x2d10b6(_0x595944['id']));console[_0x158950(0x1db)]('⚡\x20'+_0x38dc73+_0x40ad02);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x10c381(0x76);[a31_0x10c381(0x184)]=a31_0x10c381(0x1cb);async[a31_0x10c381(0xa0)](_0x5565bf){const _0xc48a0a=a31_0x10c381,{options:_0x2181ec,args:_0x21f5c9,tdx:_0x4b618e}=_0x5565bf,_0x3e0c25=_0x21f5c9[0x0]||_0x2181ec[_0xc48a0a(0x113)];if(!_0x3e0c25)return showParentSegmentNotSetError(_0xc48a0a(0x24c)+_0xc48a0a(0x27a)),0x1;const _0x353b51=resolveYamlFile(_0x3e0c25);if(!existsSync(_0x353b51))return showFileNotFoundError(_0x353b51,_0x3e0c25),0x1;let _0x21c479;try{_0x21c479=readFileSync(_0x353b51,_0xc48a0a(0x20f));}catch(_0x1a9d2c){const _0x364746=_0x1a9d2c instanceof Error?_0x1a9d2c['message']:String(_0x1a9d2c);return console[_0xc48a0a(0xdd)](_0xc48a0a(0x1cf)+_0x364746),0x1;}const _0x1740c4=createCommandSpinner(a31_0x343d08[_0xc48a0a(0x1a7)](_0xc48a0a(0x1bf)),{'verbose':_0x2181ec[_0xc48a0a(0x20b)]});_0x1740c4[_0xc48a0a(0x134)]();const _0x4f729a={'realtime':!![],'onProgress':_0xd5f8f8=>{_0x1740c4['text']=formatProgressMessage(_0xd5f8f8);}};let _0x3ee981;try{_0x3ee981=await _0x4b618e['segment'][_0xc48a0a(0x13e)](_0x21c479,_0x4f729a),_0x1740c4['stop']();}catch(_0x4df603){_0x1740c4[_0xc48a0a(0xf6)]();throw _0x4df603;}console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x10a)](_0xc48a0a(0x26a))+'\x20'+_0x3ee981[_0xc48a0a(0x23b)]),console[_0xc48a0a(0xdd)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x3ee981),console[_0xc48a0a(0xdd)]('─'[_0xc48a0a(0x1c1)](0x3c));if(_0x3ee981['errors']['length']>0x0){console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x11b)](_0xc48a0a(0x163)));for(const _0x1f8311 of _0x3ee981[_0xc48a0a(0xc0)]){console['error']('\x20\x20'+a31_0x343d08['red']('•')+'\x20'+_0x1f8311);}}return _0x3ee981['allValid']&&console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x97)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x3ee981[_0xc48a0a(0x202)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x7c);[a31_0x10c381(0x184)]=a31_0x10c381(0xda);async[a31_0x10c381(0xa0)](_0x432e06){const _0x58c637=a31_0x10c381,{options:_0x33bd60,args:_0x572f0d,tdx:_0x2a358b}=_0x432e06,_0x445b63=_0x572f0d[0x0]||_0x33bd60['parentSegment'];if(!_0x445b63)return showParentSegmentNotSetError(_0x58c637(0x89)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment'),0x1;_0x33bd60[_0x58c637(0x20b)]&&(console[_0x58c637(0xdd)](_0x58c637(0x25d)+_0x33bd60[_0x58c637(0x201)]),console[_0x58c637(0xdd)](_0x58c637(0x224)+_0x445b63));const _0x4f6b67=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x445b63+'\x27...',()=>_0x2a358b[_0x58c637(0x209)][_0x58c637(0x13a)](_0x445b63),{'verbose':_0x33bd60[_0x58c637(0x20b)]}),_0x24d465=_0x4f6b67[_0x58c637(0x8b)],_0x83cb45=await withSpinner(_0x58c637(0xc4)+_0x445b63+_0x58c637(0x169),()=>_0x2a358b[_0x58c637(0x193)][_0x58c637(0x162)](_0x24d465),{'verbose':_0x33bd60[_0x58c637(0x20b)]}),_0x51da20=_0x83cb45[_0x58c637(0x8b)];console[_0x58c637(0xdd)](_0x58c637(0x227)+_0x51da20[_0x58c637(0x190)]+_0x58c637(0x1f8)+(_0x51da20[_0x58c637(0x190)]!==0x1?'s':''));if(_0x33bd60[_0x58c637(0x6f)]===_0x58c637(0x22f)||_0x33bd60[_0x58c637(0x6f)]===_0x58c637(0xd1))await handleSDKOutput(_0x51da20,_0x33bd60);else{if(_0x51da20['length']===0x0)console['log'](_0x58c637(0xfe));else for(const _0x41470b of _0x51da20){const _0x1ecc40=_0x41470b[_0x58c637(0xe8)]===_0x58c637(0x1b3)?'🚀':'📝',_0x280854=_0x41470b[_0x58c637(0xae)]?a31_0x343d08[_0x58c637(0x185)]('\x20(paused)'):'',_0xd10e03=a31_0x343d08[_0x58c637(0x1a7)]('\x20('+_0x41470b[_0x58c637(0xb6)]+_0x58c637(0x246)+(_0x41470b[_0x58c637(0xb6)]!==0x1?'s':'')+')');console[_0x58c637(0x1db)](_0x1ecc40+'\x20'+_0x41470b['name']+_0x280854+_0xd10e03);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:rt:jn:pause';[a31_0x10c381(0x184)]='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x10c381(0xa0)](_0x3ab82c){const _0x362d14=a31_0x10c381,{options:_0x473d74,args:_0x335bee,tdx:_0x76df46}=_0x3ab82c,_0x49487c=_0x335bee[0x0];if(!_0x49487c)return console['error'](a31_0x343d08[_0x362d14(0x11b)](_0x362d14(0x1a3))),console[_0x362d14(0xdd)](_0x362d14(0x260)),console[_0x362d14(0xdd)](a31_0x343d08['dim'](_0x362d14(0x79))),0x1;_0x473d74[_0x362d14(0x20b)]&&(console[_0x362d14(0xdd)]('Site:\x20'+_0x473d74['site']),console[_0x362d14(0xdd)]('RT\x20Journey\x20ID:\x20'+_0x49487c));const _0x11c724=await withSpinner(_0x362d14(0xe7)+_0x49487c+_0x362d14(0x169),()=>_0x76df46[_0x362d14(0x193)][_0x362d14(0xe1)](_0x49487c),{'verbose':_0x473d74[_0x362d14(0x20b)]}),_0x52cf94=_0x11c724['data'];console[_0x362d14(0xdd)](_0x362d14(0x16a)+_0x52cf94[_0x362d14(0x23b)]+'\x27');if(_0x473d74[_0x362d14(0x6f)]===_0x362d14(0x22f)||_0x473d74[_0x362d14(0x6f)]==='jsonl')await handleSDKOutput([_0x52cf94],_0x473d74);else{const _0x165614=_0x52cf94['state']===_0x362d14(0x1b3)?'🚀':'📝',_0x3a885e=_0x52cf94[_0x362d14(0xae)]?a31_0x343d08[_0x362d14(0x185)](_0x362d14(0xe6)):'';console['log'](_0x165614+'\x20'+_0x52cf94['name']+_0x3a885e);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']=a31_0x10c381(0xeb);[a31_0x10c381(0x184)]=a31_0x10c381(0xf1);async['execute'](_0x5ced64){const _0x27b149=a31_0x10c381,{options:_0x41695e,args:_0x3a85b9,tdx:_0x3043b9}=_0x5ced64,_0x19b4b8=_0x3a85b9[0x0];if(!_0x19b4b8)return console[_0x27b149(0xdd)](a31_0x343d08[_0x27b149(0x11b)](_0x27b149(0x1a3))),console[_0x27b149(0xdd)](_0x27b149(0x149)),console[_0x27b149(0xdd)](a31_0x343d08[_0x27b149(0x1a7)](_0x27b149(0x79))),0x1;_0x41695e[_0x27b149(0x20b)]&&(console[_0x27b149(0xdd)](_0x27b149(0x25d)+_0x41695e[_0x27b149(0x201)]),console['error'](_0x27b149(0x11e)+_0x19b4b8));const _0x2252f7=await withSpinner(_0x27b149(0x203)+_0x19b4b8+_0x27b149(0x169),()=>_0x3043b9[_0x27b149(0x193)][_0x27b149(0x117)](_0x19b4b8),{'verbose':_0x41695e[_0x27b149(0x20b)]}),_0x358c47=_0x2252f7[_0x27b149(0x8b)];console['error'](_0x27b149(0x175)+_0x358c47[_0x27b149(0x23b)]+'\x27');if(_0x41695e[_0x27b149(0x6f)]===_0x27b149(0x22f)||_0x41695e[_0x27b149(0x6f)]===_0x27b149(0xd1))await handleSDKOutput([_0x358c47],_0x41695e);else{const _0x6d485b=_0x358c47[_0x27b149(0xe8)]===_0x27b149(0x1b3)?'🚀':'📝',_0x3cd1fc=_0x358c47[_0x27b149(0xae)]?a31_0x343d08[_0x27b149(0x185)](_0x27b149(0xe6)):'';console[_0x27b149(0x1db)](_0x6d485b+'\x20'+_0x358c47['name']+_0x3cd1fc);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x205);[a31_0x10c381(0x184)]=a31_0x10c381(0xcf);async['execute'](_0xb83c57){const _0x4a7668=a31_0x10c381,{options:_0x44fc36,args:_0x25c781,tdx:_0x1276af}=_0xb83c57,_0x5b83d6=_0x25c781[0x0]||_0x44fc36[_0x4a7668(0x113)];if(!_0x5b83d6)return showParentSegmentNotSetError(_0x4a7668(0x12c)+_0x4a7668(0x7a)),0x1;_0x44fc36['verbose']&&(console[_0x4a7668(0xdd)](_0x4a7668(0x25d)+_0x44fc36[_0x4a7668(0x201)]),console[_0x4a7668(0xdd)](_0x4a7668(0x224)+_0x5b83d6));const _0x18efef=await withSpinner(_0x4a7668(0x252)+_0x5b83d6+'\x27...',()=>_0x1276af['segment'][_0x4a7668(0x13a)](_0x5b83d6),{'verbose':_0x44fc36[_0x4a7668(0x20b)]}),_0x2b464c=_0x18efef[_0x4a7668(0x8b)],_0x3f0844=await withSpinner(_0x4a7668(0x26f)+_0x5b83d6+_0x4a7668(0x169),()=>_0x1276af[_0x4a7668(0x193)][_0x4a7668(0x1da)](_0x2b464c),{'verbose':_0x44fc36['verbose']}),_0x26dbc3=_0x3f0844['data'];return console[_0x4a7668(0xdd)](_0x4a7668(0x1fe)),_0x44fc36['format']===_0x4a7668(0x22f)||_0x44fc36[_0x4a7668(0x6f)]===_0x4a7668(0xd1)?await handleSDKOutput([_0x26dbc3],_0x44fc36):(console[_0x4a7668(0x1db)](_0x4a7668(0x1cd)+_0x26dbc3['id']),console['log'](_0x4a7668(0xb2)+_0x26dbc3[_0x4a7668(0x75)]),console[_0x4a7668(0x1db)](_0x4a7668(0x1f0)+_0x26dbc3['identifier']),console[_0x4a7668(0x1db)]('eventKind:\x20'+_0x26dbc3['eventKind']),console[_0x4a7668(0x1db)](_0x4a7668(0x1ef)+_0x26dbc3['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:service:list';[a31_0x10c381(0x184)]=a31_0x10c381(0x1e0);async[a31_0x10c381(0xa0)](_0x25e872){const _0x374070=a31_0x10c381,{options:_0x35257d,args:_0x14afc8,tdx:_0x1156da}=_0x25e872,_0x1acec3=_0x14afc8[0x0]||_0x35257d[_0x374070(0x113)];if(!_0x1acec3)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+_0x374070(0xc5)),0x1;const _0x4c9903=await withSpinner(_0x374070(0x252)+_0x1acec3+_0x374070(0x169),()=>_0x1156da[_0x374070(0x209)]['resolveParentId'](_0x1acec3),{'verbose':_0x35257d[_0x374070(0x20b)]}),_0x5dea0f=_0x4c9903['data'],_0x32442c=await withSpinner(_0x374070(0x196)+_0x1acec3+_0x374070(0x169),()=>_0x1156da[_0x374070(0x18b)][_0x374070(0xb1)](_0x5dea0f),{'verbose':_0x35257d['verbose']}),_0x1b38ce=_0x32442c[_0x374070(0x8b)];console['error'](_0x374070(0x227)+_0x1b38ce[_0x374070(0x190)]+_0x374070(0x25c)+(_0x1b38ce['length']!==0x1?'s':''));if(_0x35257d[_0x374070(0x6f)]===_0x374070(0x22f)||_0x35257d[_0x374070(0x6f)]===_0x374070(0xd1))await handleSDKOutput(_0x1b38ce,_0x35257d);else{if(_0x1b38ce[_0x374070(0x190)]===0x0)console[_0x374070(0x1db)](_0x374070(0x1d6)),console[_0x374070(0xdd)](a31_0x343d08[_0x374070(0x12a)](_0x374070(0x16b)));else for(const _0x120aaa of _0x1b38ce){console[_0x374070(0x1db)](a31_0x343d08[_0x374070(0x10a)](_0x120aaa['name'])+'\x20'+a31_0x343d08[_0x374070(0x1a7)]('(id:\x20'+_0x120aaa['id']+')'));_0x120aaa['description']&&console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08[_0x374070(0x1a7)](_0x120aaa[_0x374070(0x184)]));if(_0x120aaa[_0x374070(0x1d3)]&&_0x120aaa[_0x374070(0x1d3)]['length']>0x0)for(const _0x55b96d of _0x120aaa['tokens']){const _0x23f8f2=_0x55b96d['allowedIps']?.[_0x374070(0x190)]?_0x55b96d[_0x374070(0x81)][_0x374070(0xa1)](',\x20'):'any';console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x374070(0x152))+'\x20'+_0x55b96d[_0x374070(0x23b)]+'\x20'+a31_0x343d08[_0x374070(0x1a7)]('(id:\x20'+_0x55b96d['id']+')')),console[_0x374070(0x1db)](_0x374070(0x263)+a31_0x343d08[_0x374070(0x1a7)](_0x374070(0x24a))+'\x20'+_0x23f8f2);}else console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08[_0x374070(0x1a7)](_0x374070(0x119)));}}return 0x0;}}function a31_0x1457(){const _0x3dd339=['updatedAt','Error\x20parsing\x20YAML:\x20','list','audienceId:\x20','run','xdg-open','stitchingKeys','stageCount','Apply\x20changes\x20to\x20\x27','\x27\x20is\x20up\x20to\x20date','in\x20','Error:\x20Token\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','⚡\x20Not\x20enabled','column','ps:pz:create','/\x20directory.\x0a','errors','Listing\x20RT-enabled\x20parent\x20segments...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','✔\x20Deleted\x20token\x20\x27','Listing\x20RT\x20journeys\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','\x20\x20Columns:\x20','ps:pz:delete','displaySummary','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','\x20parent\x20segment','\x0aNew\x20parent\x20segment\x20\x27','\x20kill','Updated','pushParentYaml','Get\x20current\x20RT\x20configuration\x20version\x20status','Found\x20YAML\x20file:\x20','jsonl','Session:','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','segment:parent:validate','Columns:','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','SELECT\x20*\x20FROM\x20(\x0a','platform','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','List\x20RT\x20journeys','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','events','error','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','segment:parent:preview','filter','pauseJourney','processedRows','Customers:','delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20(paused)','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','state','map','👥\x20','ps:rt:jn:resume','Audience\x20ID:','\x20Context\x20set:\x20','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','text','Resume\x20activations\x20in\x20an\x20RT\x20journey','workflowId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','displayValidateResults','stop','Schema\x20saved\x20to\x20','attribute','Join:','\x0aChanges\x20to\x20apply\x20to\x20\x27','Error:\x20--database\x20and\x20--table\x20are\x20required','Show\x20personalization\x20service\x20details','\x0aError:','No\x20RT\x20journeys\x20found','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','personalizationServices','customerGroup','public:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','List\x20available\x20fields\x20for\x20segmentation','Executing\x20parent\x20segment\x20query...','trim','Master\x20Table','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','bold','\x20\x20Database:\x20','Attribute:','user_id','segment:parent:sql','/sessions/','6442mWSPbu','matchedCount','ps:pz:service:token:create','parentSegment','displayColumns','Validate:','Fetching\x20SQL\x20for\x20\x27','resumeJourney','createPersonalization','no\x20tokens\x20configured','Delete\x20a\x20realtime\x20personalization','red','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Table:\x20','RT\x20Journey\x20ID:\x20','true','107zAegoZ','schemaValid','Update\x20a\x20realtime\x20personalization\x20entity','Deleting\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','displaySampleData','createToken','database','keyEventCriteria','Fetching\x20behavior\x20list...','cyan','Attributes','Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a','4529959uBijYq','YAML\x20file:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','yes','addBehaviorsFile','isDirectory','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','start','\x20configured','Create\x20parent\x20segment\x20\x27','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','rowCount','resolveParentId','\x20--behavior\x20\x22','Listing\x20parent\x20segments\x20matching\x20\x27','/app/dw/parentSegments/','validateParentYaml','\x22,\x20\x22type\x22:\x20\x22','create','customers','\x0a⚠️\x20\x20Both\x20','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Error:\x20Service\x20name\x20is\x20required','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Creating','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','entryCriteria:','\x20\x20Note:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','joinKey','message','coveragePercent','Personalization\x20service\x20description','\x0aNo\x20sample\x20data\x20available','token:','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','relationships','idStitching','folder-segment','collectSchema','audienceId:','pullParentYaml','tdx\x20ps\x20push\x20','createdAt','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','personalization_services','Deleting\x20personalization\x20service\x20\x27','replace','Events:','✔\x20Updated\x20personalization\x20service\x20\x27','listJourneys','Errors:','deletePersonalization','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','deleteToken','\x27...','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','displayPreviewHints','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','\x27\x20for\x20service\x20\x27','Rows:','Attributes:','Status:','workflowSessionId','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','customerPercent','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','keyEventId','scheduleType','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','/app/workflows/','No\x20parent\x20segments\x20match\x20pattern:\x20','patch','parent_segments','\x20\x20No\x20sample\x20data\x20available','\x0a\x20\x20]\x0a}\x0a','✔\x20Deleted\x20personalization\x20service\x20\x27','addAttributesFile','Listing\x20personalizations\x20for\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20--attribute\x20requires\x20a\x20name\x0a','description','yellow','Finding\x20service\x20for\x20token...','displayRealtimeInfo','push','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','\x20service','personalization','darwin','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','toLocaleString','length','enabled','payload','realtime','✔\x20Created\x20parent\x20segment\x20\x27','null','Listing\x20personalization\x20services\x20for\x20\x27','jobId','toLowerCase','\x20parent\x20segment\x20\x27','Options:','population','Error:\x20Service\x20ID\x20is\x20required','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','localeCompare','/\x20→\x20','\x20\x201.\x20Edit\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Options:\x0a','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Updating','/\x20and\x20','double','dim','(id:\x20','\x20[Job\x20ID:\x20','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x20\x20\x20\x20-\x20','ps:pz:list','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Aborted.','keyEventId:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','10VjCAer','\x0aChanges\x20to\x20\x27','launched','Creating\x20personalization\x20\x27','Error:\x20Token\x20name\x20is\x20required','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','FINISHED','Fetching\x20sample\x20data...','My\x20Service','segment:parent:fields','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Output\x20file:\x20','\x20to\x20push\x20the\x20configuration','\x22\x20}','Validating\x20RT\x20configuration...','✔\x20Created\x20personalization\x20\x27','repeat','previewParentYaml','sort','getParentSQL','displayMasterInfo','Preview:','listParents','Error:\x20Personalization\x20ID\x20is\x20required','8UHBXwg','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','✔\x20Found\x20personalization\x20\x27','id:\x20','\x27\x20is\x20already\x20up\x20to\x20date','Error\x20reading\x20file:\x20','\x20Added\x20RT\x202.0\x20template\x20section','.yml','behavior_','tokens','runParent','No\x20parent\x20segments\x20found','No\x20personalization\x20services\x20configured','segment:parent:view','parentFolder','sections','getCurrentConfigVersion','log','✔\x20Created\x20personalization\x20service\x20\x27','sourceTableError','toFixed','page_view','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','columns','value','payload:','last_page_viewed','number','✔\x20No\x20changes\x20-\x20\x27','Delete\x20a\x20personalization\x20service','all','listPersonalizations','1343111BulZIi','displayBehaviorsStats','Updating\x20parent\x20segment\x20\x27','segment:parent:show','Creating\x20token\x20\x27','status:\x20','identifier:\x20','sourceTableValid','column_type','\x5c$&','interval','output','To\x20view\x20sample\x20data:','test','\x20RT\x20journey','No\x20RT-enabled\x20parent\x20segments\x20found','endsWith','\x20Opening\x20','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','✔\x20Retrieved\x20RT\x20configuration\x20version','Analyzing\x20changes...','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','site','allValid','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','indexOf','ps:rt:configuration_versions','-1d','78gjeVpX','\x20\x20\x20\x20\x20\x20\x20\x20','segment','foreignKey','verbose','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','updated:','column_name','utf-8','ps:pz:service:create','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20=\x20','displayAttributesStats','timezone','ps:pz:service:update','Validating\x20configuration...','Available\x20attributes:','segment:parent:update','patchPersonalization','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','get','match','Created','\x20behaviors','Pattern:\x20','\x0a\x20\x20\x20\x20]','/\x20directories\x20exist.','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','sampleData','✔\x20Found\x20','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','includeSensitive:','/attempt/','stats','Join\x20on:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20--behavior\x20\x22<name>\x22','json','SQL\x20query:\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','\x20true','\x20Configuration\x20is\x20valid','\x20\x20\x20\x20\x20\x20','\x20to\x20configure\x20your\x20personalization\x20service','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','behavior','ID\x20Stitching:','name','Fetching\x20customers\x20schema...','label','✘\x20Failed\x20to\x20rename\x20directory:\x20','single','Fetching\x20current\x20configuration\x20for\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Master:','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','limit','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20stage','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','win32','allowed\x20IPs:','Next\x20steps:','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','getBehaviorNames','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Listing\x20parent\x20segments...','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Resolving\x20parent\x20segment\x20\x27','Create\x20a\x20realtime\x20personalization\x20entity','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','created:','unref','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20RT-enabled\x20parent\x20segment','{\x0a\x20\x20\x22database\x22:\x20\x22','3451383ewOKpk','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20personalization\x20service','Site:\x20','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','22481508EuAjvb','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','RT\x202.0:','<database>.<table>','\x20\x20\x20\x20','\x20field','\x20\x202.\x20Run\x20','customersWithEvents','Creating\x20personalization\x20service\x20\x27','getOutputDatabaseName','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','RT\x202.0\x20Validate:','\x20--attribute\x20\x22','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','3iiHuSw','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Show\x20parent\x20segment\x20details','workflowAttemptId','SELECT\x20*\x20FROM\x20','td_client_id','\x27\x20with\x20ID:\x20','ps:pz:service:delete','ps:pz:patch','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','tdx\x20ps\x20preview\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','scheduleOption','query','parent_segment','table','enriched','totalEvents','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','string','setJobId','format','behaviors','attributesFile','segment:parent:create','createParent','Show\x20a\x20specific\x20realtime\x20personalization','audienceId','ps:rt:validate','master','\x20rows)','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','public','ps:rt:jn:list','165265McJbhv','displayPreviewResults','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','schemaError','allowedIps','entryCriteria','type','parent_id','Enriched:','Creating\x20parent\x20segment\x20\x27','.customers)','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a','segment:parent:run','data','\x20--interval\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','1568836Cajerd','formatSchemaJson','\x20No\x20changes\x20-\x20','No\x20personalizations\x20configured','folderId','keys','✔\x20Deleted\x20personalization\x20\x27','using\x20the\x20default\x20path:\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','green','file','Error:\x20Parent\x20segment\x20name\x20is\x20required','apply','Database:\x20','\x20service(s)\x20configured','varchar','listFields','includeSensitive','execute','join','\x20rows\x20','Source:','web','Behaviors','Listing\x20fields\x20for\x20\x27','\x27\x20(id:\x20','Attempt:','Fetching\x20parent\x20segment\x20\x27','Error:','status','Personalization:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','paused'];a31_0x1457=function(){return _0x3dd339;};return a31_0x1457();}export class PSPzServiceCreateCommand extends BaseCommand{['name']=a31_0x10c381(0x210);['description']='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async['execute'](_0x14c081){const _0x50740a=a31_0x10c381,{options:_0x25b9a2,args:_0x2b8d4c,tdx:_0x248438}=_0x14c081,_0x2e0016=_0x25b9a2,_0x4f04ca=_0x2b8d4c[0x0],_0x1c0273=_0x2b8d4c[0x1]||_0x25b9a2[_0x50740a(0x113)];if(!_0x4f04ca)return console[_0x50740a(0xdd)](_0x50740a(0x145)),console[_0x50740a(0xdd)](_0x50740a(0x153)),console[_0x50740a(0xdd)](_0x50740a(0x1a1)),0x1;if(!_0x1c0273)return showParentSegmentNotSetError(_0x50740a(0x8d)+_0x50740a(0x1a1)),0x1;const _0x834737=await withSpinner(_0x50740a(0x252)+_0x1c0273+_0x50740a(0x169),()=>_0x248438['segment'][_0x50740a(0x13a)](_0x1c0273),{'verbose':_0x25b9a2[_0x50740a(0x20b)]}),_0x2528e1=_0x834737['data'],_0xbd2b17={'name':_0x4f04ca,'description':_0x2e0016[_0x50740a(0x184)],'public':_0x2e0016[_0x50740a(0x7b)]},_0x3ede30=await withSpinner(_0x50740a(0x267)+_0x4f04ca+'\x27...',()=>_0x248438[_0x50740a(0x18b)][_0x50740a(0x140)](_0x2528e1,_0xbd2b17),{'verbose':_0x25b9a2[_0x50740a(0x20b)]}),_0x183b9=_0x3ede30['data'];return console[_0x50740a(0xdd)](_0x50740a(0x1dc)+_0x183b9[_0x50740a(0x23b)]+_0x50740a(0x274)+_0x183b9['id']),await handleSDKOutput([_0x183b9],_0x25b9a2),0x0;}}function a31_0xc607(_0x154e97,_0x58a7cd){_0x154e97=_0x154e97-0x6a;const _0x1457f4=a31_0x1457();let _0xc60793=_0x1457f4[_0x154e97];return _0xc60793;}export class PSPzServiceShowCommand extends BaseCommand{['name']='ps:pz:service:show';[a31_0x10c381(0x184)]=a31_0x10c381(0xfc);async[a31_0x10c381(0xa0)](_0x21841b){const _0x396ddf=a31_0x10c381,{options:_0x4c5839,args:_0x4e73e0,tdx:_0x461618}=_0x21841b,_0x10fc73=_0x4e73e0[0x0],_0x526076=_0x4e73e0[0x1]||_0x4c5839[_0x396ddf(0x113)];if(!_0x10fc73)return console['error'](_0x396ddf(0x19c)),console[_0x396ddf(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x396ddf(0xdd)](_0x396ddf(0x16d)),0x1;if(!_0x526076)return showParentSegmentNotSetError(_0x396ddf(0x148)+_0x396ddf(0x16d)),0x1;const _0x2c6342=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x526076+_0x396ddf(0x169),()=>_0x461618[_0x396ddf(0x209)]['resolveParentId'](_0x526076),{'verbose':_0x4c5839[_0x396ddf(0x20b)]}),_0x5c0d24=_0x2c6342[_0x396ddf(0x8b)],_0x38f889=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x10fc73+_0x396ddf(0x169),()=>_0x461618[_0x396ddf(0x18b)][_0x396ddf(0x21c)](_0x5c0d24,_0x10fc73),{'verbose':_0x4c5839[_0x396ddf(0x20b)]}),_0xbc807f=_0x38f889[_0x396ddf(0x8b)];if(_0x4c5839['json']||_0x4c5839[_0x396ddf(0xd1)])await handleSDKOutput([_0xbc807f],_0x4c5839);else{console['log'](a31_0x343d08[_0x396ddf(0x10a)](_0xbc807f['name'])+'\x20'+a31_0x343d08[_0x396ddf(0x1a7)]('(id:\x20'+_0xbc807f['id']+')'));_0xbc807f[_0x396ddf(0x184)]&&console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08['dim'](_0xbc807f[_0x396ddf(0x184)]));console['log']('\x20\x20'+a31_0x343d08[_0x396ddf(0x12a)](_0x396ddf(0x103))+'\x20'+(_0xbc807f[_0x396ddf(0x7b)]?'yes':'no'));if(_0xbc807f[_0x396ddf(0x1d3)]&&_0xbc807f[_0x396ddf(0x1d3)][_0x396ddf(0x190)]>0x0)for(const _0x16a9de of _0xbc807f[_0x396ddf(0x1d3)]){const _0x85249=_0x16a9de[_0x396ddf(0x81)]?.[_0x396ddf(0x190)]?_0x16a9de['allowedIps'][_0x396ddf(0xa1)](',\x20'):'any';console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x396ddf(0x152))+'\x20'+_0x16a9de[_0x396ddf(0x23b)]+'\x20'+a31_0x343d08['dim'](_0x396ddf(0x1a8)+_0x16a9de['id']+')')),console[_0x396ddf(0x1db)]('\x20\x20\x20\x20'+a31_0x343d08[_0x396ddf(0x1a7)](_0x396ddf(0x24a))+'\x20'+_0x85249);}else console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08[_0x396ddf(0x1a7)]('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x275);['description']=a31_0x10c381(0x1e7);async[a31_0x10c381(0xa0)](_0x354435){const _0x440070=a31_0x10c381,{options:_0x5b74cc,args:_0x13f7c4,tdx:_0x1076b2}=_0x354435,_0x1f074f=_0x13f7c4[0x0],_0x20388d=_0x13f7c4[0x1]||_0x5b74cc[_0x440070(0x113)];if(!_0x1f074f)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console[_0x440070(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x440070(0xdd)](_0x440070(0xc2)),0x1;if(!_0x20388d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x440070(0xc2)),0x1;const _0x5bbd9c=await withSpinner(_0x440070(0x252)+_0x20388d+_0x440070(0x169),()=>_0x1076b2[_0x440070(0x209)][_0x440070(0x13a)](_0x20388d),{'verbose':_0x5b74cc[_0x440070(0x20b)]}),_0x2fd140=_0x5bbd9c[_0x440070(0x8b)];return await withSpinner(_0x440070(0x15e)+_0x1f074f+_0x440070(0x169),()=>_0x1076b2['personalization'][_0x440070(0xe4)](_0x2fd140,_0x1f074f),{'verbose':_0x5b74cc[_0x440070(0x20b)]}),console['error'](_0x440070(0x17f)+_0x1f074f+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x215);[a31_0x10c381(0x184)]='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x10c381(0xa0)](_0xf6cb19){const _0x5c2229=a31_0x10c381,{options:_0x48c980,args:_0x15a269,tdx:_0x17eb26}=_0xf6cb19,_0x30e9b7=_0x48c980,_0x235fbd=_0x15a269[0x0],_0x2076fb=_0x15a269[0x1]||_0x48c980[_0x5c2229(0x113)];if(!_0x235fbd)return console['error'](_0x5c2229(0x19c)),console[_0x5c2229(0xdd)](_0x5c2229(0xff)),console[_0x5c2229(0xdd)](_0x5c2229(0xf3)),0x1;if(!_0x30e9b7[_0x5c2229(0x23b)])return console[_0x5c2229(0xdd)]('Error:\x20--name\x20is\x20required'),console[_0x5c2229(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x2076fb)return showParentSegmentNotSetError(_0x5c2229(0x248)+_0x5c2229(0xf3)),0x1;const _0x67486=await withSpinner(_0x5c2229(0x252)+_0x2076fb+_0x5c2229(0x169),()=>_0x17eb26[_0x5c2229(0x209)][_0x5c2229(0x13a)](_0x2076fb),{'verbose':_0x48c980[_0x5c2229(0x20b)]}),_0x2e7e0b=_0x67486[_0x5c2229(0x8b)],_0x4cb217={'name':_0x30e9b7[_0x5c2229(0x23b)]};_0x30e9b7[_0x5c2229(0x184)]!==undefined&&(_0x4cb217[_0x5c2229(0x184)]=_0x30e9b7[_0x5c2229(0x184)]);const _0x50f6ce=await withSpinner('Updating\x20personalization\x20service\x20\x27'+_0x235fbd+_0x5c2229(0x169),()=>_0x17eb26[_0x5c2229(0x18b)][_0x5c2229(0x17b)](_0x2e7e0b,_0x235fbd,_0x4cb217),{'verbose':_0x48c980[_0x5c2229(0x20b)]}),_0x2b41f3=_0x50f6ce[_0x5c2229(0x8b)];return console['error'](_0x5c2229(0x161)+_0x2b41f3[_0x5c2229(0x23b)]+'\x27'),await handleSDKOutput([_0x2b41f3],_0x48c980),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x112);[a31_0x10c381(0x184)]=a31_0x10c381(0x88);async[a31_0x10c381(0xa0)](_0x3fa6a9){const _0x5c52a6=a31_0x10c381,{options:_0x458d91,args:_0x2559af,tdx:_0x2a3b3d}=_0x3fa6a9,_0x3a2569=_0x458d91,_0x39b27f=_0x2559af[0x0],_0x421fa4=_0x2559af[0x1],_0xf77ff6=_0x2559af[0x2]||_0x458d91[_0x5c52a6(0x113)];if(!_0x39b27f)return console[_0x5c52a6(0xdd)](_0x5c52a6(0x1b5)),console[_0x5c52a6(0xdd)](_0x5c52a6(0x11c)),console[_0x5c52a6(0xdd)](_0x5c52a6(0x138)),0x1;if(!_0x421fa4)return console[_0x5c52a6(0xdd)](_0x5c52a6(0x19c)),console[_0x5c52a6(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x5c52a6(0xdd)](_0x5c52a6(0x138)),0x1;if(!_0xf77ff6)return showParentSegmentNotSetError(_0x5c52a6(0xad)+_0x5c52a6(0x138)),0x1;const _0x5dc7e0=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf77ff6+_0x5c52a6(0x169),()=>_0x2a3b3d[_0x5c52a6(0x209)][_0x5c52a6(0x13a)](_0xf77ff6),{'verbose':_0x458d91[_0x5c52a6(0x20b)]}),_0x483253=_0x5dc7e0[_0x5c52a6(0x8b)],_0x52c4d8={'name':_0x39b27f};_0x3a2569[_0x5c52a6(0x81)]&&(_0x52c4d8['allowedIps']=_0x3a2569[_0x5c52a6(0x81)]['split'](',')['map'](_0xcded64=>_0xcded64['trim']()));_0x3a2569[_0x5c52a6(0x184)]&&(_0x52c4d8[_0x5c52a6(0x184)]=_0x3a2569['description']);const _0x1e2753=await withSpinner(_0x5c52a6(0x1ee)+_0x39b27f+_0x5c52a6(0x16e)+_0x421fa4+_0x5c52a6(0x169),()=>_0x2a3b3d[_0x5c52a6(0x18b)][_0x5c52a6(0x126)](_0x483253,_0x421fa4,_0x52c4d8),{'verbose':_0x458d91[_0x5c52a6(0x20b)]}),_0x255302=_0x1e2753['data'];return console[_0x5c52a6(0xdd)]('✔\x20Created\x20token\x20\x27'+_0x255302['name']+_0x5c52a6(0x274)+_0x255302['id']),_0x255302[_0x5c52a6(0x1e2)]&&(console[_0x5c52a6(0xdd)](a31_0x343d08[_0x5c52a6(0x185)](_0x5c52a6(0x25e))),console['error'](a31_0x343d08['cyan'](_0x255302[_0x5c52a6(0x1e2)])),console[_0x5c52a6(0xdd)]('')),await handleSDKOutput([_0x255302],_0x458d91),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:service:token:delete';[a31_0x10c381(0x184)]='Delete\x20a\x20token\x20from\x20a\x20personalization\x20service';async['execute'](_0x4a4c2f){const _0x23c5a3=a31_0x10c381,{options:_0x12981c,args:_0x176bbb,tdx:_0x45abcd}=_0x4a4c2f,_0x3a97d6=_0x176bbb[0x0],_0x513424=_0x176bbb[0x1]||_0x12981c['parentSegment'];if(!_0x3a97d6)return console['error']('Error:\x20Token\x20ID\x20is\x20required'),console[_0x23c5a3(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console['error'](_0x23c5a3(0xc9)),0x1;if(!_0x513424)return showParentSegmentNotSetError(_0x23c5a3(0x146)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x500b6a=await withSpinner(_0x23c5a3(0x252)+_0x513424+'\x27...',()=>_0x45abcd[_0x23c5a3(0x209)][_0x23c5a3(0x13a)](_0x513424),{'verbose':_0x12981c[_0x23c5a3(0x20b)]}),_0x15c95e=_0x500b6a[_0x23c5a3(0x8b)],_0x40b617=await withSpinner(_0x23c5a3(0x186),()=>_0x45abcd[_0x23c5a3(0x18b)]['list'](_0x15c95e),{'verbose':_0x12981c['verbose']}),_0x5df558=_0x40b617['data'];let _0x335be0;for(const _0x2df0ca of _0x5df558){if(_0x2df0ca[_0x23c5a3(0x1d3)]?.['some'](_0x5e9f0a=>_0x5e9f0a['id']===_0x3a97d6)){_0x335be0=_0x2df0ca['id'];break;}}if(!_0x335be0)return console[_0x23c5a3(0xdd)](_0x23c5a3(0xba)+_0x3a97d6+'\x27\x20not\x20found\x20in\x20any\x20personalization\x20service'),0x1;const _0x243520=await withSpinner('Deleting\x20token\x20\x27'+_0x3a97d6+'\x27...',()=>_0x45abcd[_0x23c5a3(0x18b)][_0x23c5a3(0x168)](_0x15c95e,_0x335be0,_0x3a97d6),{'verbose':_0x12981c[_0x23c5a3(0x20b)]}),_0x4d351d=_0x243520[_0x23c5a3(0x8b)];return console[_0x23c5a3(0xdd)](_0x23c5a3(0xc3)+(_0x4d351d['name']||_0x3a97d6)+'\x27'),await handleSDKOutput([_0x4d351d],_0x12981c),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x1ac);[a31_0x10c381(0x184)]=a31_0x10c381(0x189);async[a31_0x10c381(0xa0)](_0x509e7f){const _0x376243=a31_0x10c381,{options:_0x41704e,args:_0x5006d4,tdx:_0x3f7360}=_0x509e7f,_0x2075d6=_0x5006d4[0x0]||_0x41704e[_0x376243(0x113)];if(!_0x2075d6)return showParentSegmentNotSetError(_0x376243(0x1fc)+_0x376243(0x231)),0x1;const _0x54b4a9=await withSpinner(_0x376243(0x252)+_0x2075d6+'\x27...',()=>_0x3f7360[_0x376243(0x209)][_0x376243(0x13a)](_0x2075d6),{'verbose':_0x41704e[_0x376243(0x20b)]}),_0x3a75bc=_0x54b4a9[_0x376243(0x8b)],_0x2a638d=await withSpinner(_0x376243(0x181)+_0x2075d6+_0x376243(0x169),()=>_0x3f7360[_0x376243(0x18b)][_0x376243(0x1e9)](_0x3a75bc),{'verbose':_0x41704e['verbose']}),_0x3a49ea=_0x2a638d['data'];console[_0x376243(0xdd)](_0x376243(0x227)+_0x3a49ea[_0x376243(0x190)]+'\x20personalization'+(_0x3a49ea['length']!==0x1?'s':''));if(_0x41704e[_0x376243(0x6f)]===_0x376243(0x22f)||_0x41704e['format']===_0x376243(0xd1))await handleSDKOutput(_0x3a49ea,_0x41704e);else{if(_0x3a49ea[_0x376243(0x190)]===0x0)console[_0x376243(0x1db)](_0x376243(0x91));else for(const _0x2236db of _0x3a49ea){console[_0x376243(0x1db)](a31_0x343d08[_0x376243(0x10a)](_0x2236db['name'])+'\x20'+a31_0x343d08[_0x376243(0x1a7)](_0x376243(0x1a8)+_0x2236db['id']+')'));_0x2236db[_0x376243(0x184)]&&console[_0x376243(0x1db)]('\x20\x20'+a31_0x343d08[_0x376243(0x1a7)](_0x2236db[_0x376243(0x184)]));const _0x3a817b=_0x2236db[_0x376243(0x1d9)]?.[_0x376243(0x190)]||0x0;console[_0x376243(0x1db)]('\x20\x20'+a31_0x343d08[_0x376243(0x12a)]('sections:')+'\x20'+_0x3a817b);if(_0x2236db[_0x376243(0x1d9)]&&_0x2236db[_0x376243(0x1d9)][_0x376243(0x190)]>0x0)for(const _0x1f738b of _0x2236db['sections']){console['log'](_0x376243(0x1ab)+_0x1f738b[_0x376243(0x23b)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:show';[a31_0x10c381(0x184)]=a31_0x10c381(0x74);async['execute'](_0x27b26e){const _0x39e30a=a31_0x10c381,{options:_0x93446a,args:_0x12a437,tdx:_0x446d51}=_0x27b26e,_0x1f2d63=_0x12a437[0x0];if(!_0x1f2d63)return console[_0x39e30a(0xdd)](_0x39e30a(0x1c8)),console[_0x39e30a(0xdd)](_0x39e30a(0x1ca)),0x1;const _0x18e182=await withSpinner('Getting\x20personalization\x20\x27'+_0x1f2d63+'\x27...',()=>_0x446d51[_0x39e30a(0x18b)]['getPersonalization'](_0x1f2d63),{'verbose':_0x93446a['verbose']}),_0x244a90=_0x18e182[_0x39e30a(0x8b)];console['error'](_0x39e30a(0x1cc)+_0x244a90['name']+'\x27');if(_0x93446a[_0x39e30a(0x6f)]==='json'||_0x93446a[_0x39e30a(0x6f)]===_0x39e30a(0xd1))await handleSDKOutput([_0x244a90],_0x93446a);else{console['log'](a31_0x343d08[_0x39e30a(0x10a)](_0x244a90['name'])+'\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x39e30a(0x1a8)+_0x244a90['id']+')'));_0x244a90[_0x39e30a(0x184)]&&console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x244a90[_0x39e30a(0x184)]));_0x244a90[_0x39e30a(0x75)]&&console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x39e30a(0x158))+'\x20'+_0x244a90[_0x39e30a(0x75)]);console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x255))+'\x20'+_0x244a90[_0x39e30a(0x15b)]),console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x39e30a(0x20d))+'\x20'+_0x244a90[_0x39e30a(0xaf)]);const _0x1ce276=_0x244a90['sections']?.[_0x39e30a(0x190)]||0x0;console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x12a)]('sections:')+'\x20'+_0x1ce276);if(_0x244a90[_0x39e30a(0x1d9)]&&_0x244a90[_0x39e30a(0x1d9)][_0x39e30a(0x190)]>0x0)for(const _0x4160a5 of _0x244a90[_0x39e30a(0x1d9)]){console['log'](_0x39e30a(0x263)+a31_0x343d08[_0x39e30a(0x10a)](_0x4160a5[_0x39e30a(0x23b)])+'\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x39e30a(0x1a8)+_0x4160a5['id']+')')),_0x4160a5[_0x39e30a(0x82)]&&(console[_0x39e30a(0x1db)](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x14a))+'\x20'+_0x4160a5[_0x39e30a(0x82)]['name']),_0x4160a5[_0x39e30a(0x82)][_0x39e30a(0x128)]?.['keyEventId']&&console[_0x39e30a(0x1db)](_0x39e30a(0x208)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x1af))+'\x20'+_0x4160a5[_0x39e30a(0x82)]['keyEventCriteria'][_0x39e30a(0x176)])),_0x4160a5[_0x39e30a(0x192)]&&console['log'](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x1e3))+'\x20'+JSON['stringify'](_0x4160a5['payload'])),_0x4160a5[_0x39e30a(0x9f)]&&console['log'](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x229))+_0x39e30a(0x233));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xc7);[a31_0x10c381(0x184)]=a31_0x10c381(0x11a);async[a31_0x10c381(0xa0)](_0x9c7cff){const _0x34b730=a31_0x10c381,{options:_0x506448,args:_0x2db245,tdx:_0x483722}=_0x9c7cff,_0x26a8ba=_0x2db245[0x0];if(!_0x26a8ba)return console['error'](_0x34b730(0x1c8)),console[_0x34b730(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x34b730(0x123)+_0x26a8ba+_0x34b730(0x169),()=>_0x483722['personalization'][_0x34b730(0x164)](_0x26a8ba),{'verbose':_0x506448[_0x34b730(0x20b)]}),console['error'](_0x34b730(0x94)+_0x26a8ba+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xbe);[a31_0x10c381(0x184)]=a31_0x10c381(0x253);async['execute'](_0x17caa2){const _0x5436e4=a31_0x10c381,{options:_0x5361e6,tdx:_0x2dae15}=_0x17caa2,_0x120035=_0x5361e6;let _0x397555;if(_0x120035[_0x5436e4(0x98)]){_0x397555=await loadJSON(_0x120035[_0x5436e4(0x98)],!![]);if(!_0x397555[_0x5436e4(0x154)]?.[_0x5436e4(0x1d8)])return console[_0x5436e4(0xdd)](_0x5436e4(0x100)),console[_0x5436e4(0xdd)](_0x5436e4(0x133)),console['error']('\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}'),0x1;}else{if(!_0x120035[_0x5436e4(0x23b)])return console[_0x5436e4(0xdd)](_0x5436e4(0x18d)),console[_0x5436e4(0xdd)](_0x5436e4(0xdb)),console[_0x5436e4(0xdd)](_0x5436e4(0xe5)),0x1;if(_0x120035[_0x5436e4(0x184)]===undefined)return console[_0x5436e4(0xdd)](_0x5436e4(0x251)),console[_0x5436e4(0xdd)](_0x5436e4(0xdb)),console[_0x5436e4(0xdd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x120035[_0x5436e4(0x92)]===undefined)return console[_0x5436e4(0xdd)](_0x5436e4(0x1aa)),console[_0x5436e4(0xdd)]('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x40c6cc=_0x120035['audienceId'];if(!_0x40c6cc&&_0x5361e6[_0x5436e4(0x113)]){const _0x58e517=await withSpinner(_0x5436e4(0x252)+_0x5361e6['parentSegment']+'\x27...',()=>_0x2dae15[_0x5436e4(0x209)][_0x5436e4(0x13a)](_0x5361e6[_0x5436e4(0x113)]),{'verbose':_0x5361e6[_0x5436e4(0x20b)]});_0x40c6cc=_0x58e517[_0x5436e4(0x8b)];}let _0x5f424c;_0x120035[_0x5436e4(0x1d9)]&&(_0x5f424c=await loadJSON(_0x120035[_0x5436e4(0x1d9)],![]));const _0x5b88ca=_0x120035[_0x5436e4(0x92)]===_0x5436e4(0x195)?null:{'id':_0x120035[_0x5436e4(0x92)],'type':_0x5436e4(0x156)};_0x397555={'attributes':{'name':_0x120035['name'],'description':_0x120035[_0x5436e4(0x184)]||null,..._0x40c6cc!==undefined&&{'audienceId':_0x40c6cc},..._0x5f424c!==undefined&&{'sections':_0x5f424c}},'relationships':{'parentFolder':{'data':_0x5b88ca}}};}const _0x35f924=await withSpinner(_0x5436e4(0x1b4)+(_0x397555[_0x5436e4(0x166)]?.[_0x5436e4(0x23b)]??'')+'\x27...',()=>_0x2dae15[_0x5436e4(0x18b)][_0x5436e4(0x118)](_0x397555),{'verbose':_0x5361e6['verbose']}),_0x446d43=_0x35f924[_0x5436e4(0x8b)];return console['error'](_0x5436e4(0x1c0)+_0x446d43[_0x5436e4(0x23b)]+'\x27\x20with\x20ID:\x20'+_0x446d43['id']),await handleSDKOutput([_0x446d43],_0x5361e6),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x276);[a31_0x10c381(0x184)]=a31_0x10c381(0x122);async[a31_0x10c381(0xa0)](_0xa946ba){const _0x2be4e3=a31_0x10c381,{options:_0x6054af,args:_0x75a133}=_0xa946ba,_0x5c6f16=_0x6054af,_0x276e92=_0x75a133[0x0];if(!_0x276e92)return console[_0x2be4e3(0xdd)](_0x2be4e3(0x1c8)),console[_0x2be4e3(0xdd)](_0x2be4e3(0x254)),console[_0x2be4e3(0xdd)](_0x2be4e3(0x167)),0x1;let _0x37d924;if(_0x5c6f16[_0x2be4e3(0x98)])_0x37d924=await loadJSON(_0x5c6f16['file'],!![]);else{if(!_0x5c6f16[_0x2be4e3(0x23b)])return console[_0x2be4e3(0xdd)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x2be4e3(0xdd)](_0x2be4e3(0x254)),0x1;if(_0x5c6f16['description']===undefined)return console[_0x2be4e3(0xdd)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0x2be4e3(0x254)),0x1;let _0x3b3da0;_0x5c6f16[_0x2be4e3(0x1d9)]&&(_0x3b3da0=await loadJSON(_0x5c6f16[_0x2be4e3(0x1d9)],![])),_0x37d924={'attributes':{'name':_0x5c6f16[_0x2be4e3(0x23b)],'description':_0x5c6f16[_0x2be4e3(0x184)]||null,..._0x3b3da0!==undefined&&{'sections':_0x3b3da0}}};}const {tdx:_0x222022}=_0xa946ba,_0x5b9e2e=await withSpinner('Patching\x20personalization\x20\x27'+_0x276e92+'\x27...',()=>_0x222022[_0x2be4e3(0x18b)][_0x2be4e3(0x219)](_0x276e92,_0x37d924),{'verbose':_0x6054af[_0x2be4e3(0x20b)]}),_0x16bf5a=_0x5b9e2e[_0x2be4e3(0x8b)];return console[_0x2be4e3(0xdd)]('✔\x20Updated\x20personalization\x20\x27'+_0x16bf5a[_0x2be4e3(0x23b)]+_0x2be4e3(0xa7)+_0x16bf5a['id']+')'),await handleSDKOutput([_0x16bf5a],_0x6054af),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]='ps:pz:init';[a31_0x10c381(0x184)]=a31_0x10c381(0x137);async[a31_0x10c381(0xa0)](_0x564bc0){const _0x570bde=a31_0x10c381,{options:_0x58e73d,args:_0x161f60}=_0x564bc0,_0x164dcf=_0x161f60[0x0]||_0x58e73d[_0x570bde(0x113)];if(!_0x164dcf)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment'),0x1;const _0x3a8697=resolveYamlFile(_0x164dcf);if(!existsSync(_0x3a8697))return showFileNotFoundError(_0x3a8697,_0x164dcf),0x1;let _0x4f14f2;try{_0x4f14f2=readFileSync(_0x3a8697,_0x570bde(0x20f));}catch(_0x216638){const _0x4134a5=_0x216638 instanceof Error?_0x216638[_0x570bde(0x14e)]:String(_0x216638);return console[_0x570bde(0xdd)](_0x570bde(0x1cf)+_0x4134a5),0x1;}let _0x935bc7;try{_0x935bc7=parseDef(_0x4f14f2);}catch(_0x503531){const _0x18545c=_0x503531 instanceof Error?_0x503531[_0x570bde(0x14e)]:String(_0x503531);return console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x11b)](_0x570bde(0xb0)+_0x18545c)),0x1;}if(_0x935bc7[_0x570bde(0x15d)]&&_0x935bc7[_0x570bde(0x15d)]['length']>0x0)return console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x185)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0x3a8697)),console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x1a7)]('\x20\x20\x20'+_0x935bc7[_0x570bde(0x15d)][_0x570bde(0x190)]+_0x570bde(0x9c))),0x1;!_0x935bc7[_0x570bde(0x193)]&&(_0x935bc7[_0x570bde(0x193)]={'events':[{'name':_0x570bde(0x1df),'source_table':_0x570bde(0x262)}],'attributes':[{'name':'last_page_viewed','type':_0x570bde(0x23f)}],'id_stitching':{'primary_key':_0x935bc7[_0x570bde(0x77)][_0x570bde(0x27e)]==='customers'?_0x570bde(0x273):_0x570bde(0x10d)}});_0x935bc7[_0x570bde(0x15d)]=[{'name':_0x570bde(0x1b9),'description':_0x570bde(0x150),'trigger_event':_0x570bde(0x1df),'sections':[{'name':'Default','criteria':_0x570bde(0x11f),'attributes':[_0x570bde(0x1e4)]}]}];const _0x38615=serializeDef(_0x935bc7);return writeFileSync(_0x3a8697,_0x38615,'utf-8'),console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x97)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x343d08[_0x570bde(0x12a)](_0x3a8697)),(!_0x935bc7['realtime']||_0x4f14f2[_0x570bde(0x204)]('realtime:')===-0x1)&&console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x97)]('✔')+_0x570bde(0x1d0)),console[_0x570bde(0xdd)]('\x0a'+a31_0x343d08[_0x570bde(0x1a7)](_0x570bde(0x24b))),console[_0x570bde(0xdd)](_0x570bde(0x1a0)+_0x3a8697+_0x570bde(0x236)),console[_0x570bde(0xdd)](_0x570bde(0x265)+a31_0x343d08[_0x570bde(0x1a7)](_0x570bde(0x15a)+_0x164dcf)+_0x570bde(0x1bd)),0x0;}}