@treasuredata/tdx 2026.4.21 → 2026.4.23

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 (231) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  82. package/dist/proxy/claude-usage-tracker.js +1 -1
  83. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  84. package/dist/proxy/passthrough-server.d.ts +17 -0
  85. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/passthrough-server.js.map +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.js +1 -1
  90. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  91. package/dist/sdk/agent/agent-yaml.js +1 -1
  92. package/dist/sdk/agent/test/evaluator.js +1 -1
  93. package/dist/sdk/agent/test/executor.js +1 -1
  94. package/dist/sdk/agent/test/index.js +1 -1
  95. package/dist/sdk/agent/test/output.js +1 -1
  96. package/dist/sdk/agent/test/parser.js +1 -1
  97. package/dist/sdk/agent/tool-target-registry.js +1 -1
  98. package/dist/sdk/api.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.js +1 -1
  100. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  101. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  102. package/dist/sdk/cas/index.js +1 -1
  103. package/dist/sdk/cas/pull-workflow.js +1 -1
  104. package/dist/sdk/cas/push-workflow.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.js +1 -1
  106. package/dist/sdk/client/delivery-api-client.js +1 -1
  107. package/dist/sdk/client/endpoints.js +1 -1
  108. package/dist/sdk/client/engage-api-client.js +1 -1
  109. package/dist/sdk/client/http-client.js +1 -1
  110. package/dist/sdk/client/llm-api-client.js +1 -1
  111. package/dist/sdk/client/oauth-refresh.js +1 -1
  112. package/dist/sdk/client/rate-limiter.js +1 -1
  113. package/dist/sdk/client/td-api-client.js +1 -1
  114. package/dist/sdk/client/trino-api-client.js +1 -1
  115. package/dist/sdk/client/workflow-client.js +1 -1
  116. package/dist/sdk/connection-validator.js +1 -1
  117. package/dist/sdk/connection.js +1 -1
  118. package/dist/sdk/delivery.js +1 -1
  119. package/dist/sdk/engage/campaign-pull.js +1 -1
  120. package/dist/sdk/engage/campaign-push.js +1 -1
  121. package/dist/sdk/engage/campaign-validator.js +1 -1
  122. package/dist/sdk/engage/campaign-yaml.js +1 -1
  123. package/dist/sdk/engage/template-pull.js +1 -1
  124. package/dist/sdk/engage/template-push.js +1 -1
  125. package/dist/sdk/engage/template-validator.js +1 -1
  126. package/dist/sdk/engage/template-yaml.js +1 -1
  127. package/dist/sdk/engage/types/campaign-def.js +1 -1
  128. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  129. package/dist/sdk/engage/types/template-schema.js +1 -1
  130. package/dist/sdk/engage.js +1 -1
  131. package/dist/sdk/errors.js +1 -1
  132. package/dist/sdk/index.js +1 -1
  133. package/dist/sdk/io/index.js +1 -1
  134. package/dist/sdk/io/node-filesystem.js +1 -1
  135. package/dist/sdk/job.js +1 -1
  136. package/dist/sdk/journey.js +1 -1
  137. package/dist/sdk/llm/chat-cache.js +1 -1
  138. package/dist/sdk/llm/index.js +1 -1
  139. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  140. package/dist/sdk/llm/model-factors.d.ts +33 -9
  141. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  142. package/dist/sdk/llm/model-factors.js +1 -1
  143. package/dist/sdk/llm/model-factors.js.map +1 -1
  144. package/dist/sdk/personalization.js +1 -1
  145. package/dist/sdk/policy.js +1 -1
  146. package/dist/sdk/query/index.js +1 -1
  147. package/dist/sdk/query/sql-parser.js +1 -1
  148. package/dist/sdk/realtime.js +1 -1
  149. package/dist/sdk/schedule.js +1 -1
  150. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  151. package/dist/sdk/segment/fields-display.js +1 -1
  152. package/dist/sdk/segment/file-discovery.js +1 -1
  153. package/dist/sdk/segment/journey-utils.js +1 -1
  154. package/dist/sdk/segment/journey-validator.js +1 -1
  155. package/dist/sdk/segment/journey-yaml.js +1 -1
  156. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  157. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  158. package/dist/sdk/segment/pull-workflow.js +1 -1
  159. package/dist/sdk/segment/push-recovery.js +1 -1
  160. package/dist/sdk/segment/push-workflow.js +1 -1
  161. package/dist/sdk/segment/resolution-context.js +1 -1
  162. package/dist/sdk/segment/segment-path-parser.js +1 -1
  163. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  164. package/dist/sdk/segment/segment-validator.js +1 -1
  165. package/dist/sdk/segment/target-resolution.js +1 -1
  166. package/dist/sdk/segment/tdx-config.js +1 -1
  167. package/dist/sdk/segment/types/activation-schema.js +1 -1
  168. package/dist/sdk/segment/types/journey-def.js +1 -1
  169. package/dist/sdk/segment/types/journey-schema.js +1 -1
  170. package/dist/sdk/segment/types/segment-def.js +1 -1
  171. package/dist/sdk/segment/types/segment-schema.js +1 -1
  172. package/dist/sdk/segment/validate-files.js +1 -1
  173. package/dist/sdk/segment/yaml-validator.js +1 -1
  174. package/dist/sdk/segment.js +1 -1
  175. package/dist/sdk/types/index.js +1 -1
  176. package/dist/sdk/types/progress.js +1 -1
  177. package/dist/sdk/types/workspace.js +1 -1
  178. package/dist/sdk/user.js +1 -1
  179. package/dist/sdk/util/format-detector.js +1 -1
  180. package/dist/sdk/util/formatters.js +1 -1
  181. package/dist/sdk/util/index.js +1 -1
  182. package/dist/sdk/util/paginate.js +1 -1
  183. package/dist/sdk/util/tree-formatter.js +1 -1
  184. package/dist/sdk/workflow/archive-validation.js +1 -1
  185. package/dist/sdk/workflow/clone-workflow.js +1 -1
  186. package/dist/sdk/workflow/index.js +1 -1
  187. package/dist/sdk/workflow/pull-workflow.js +1 -1
  188. package/dist/sdk/workflow/push-workflow.js +1 -1
  189. package/dist/sdk/workflow/task-graph.js +1 -1
  190. package/dist/sdk/workflow/tdx-config.js +1 -1
  191. package/dist/sdk/workflow/workflow-utils.js +1 -1
  192. package/dist/sdk/workspace/access-tracker.js +1 -1
  193. package/dist/sdk/workspace/frontmatter.js +1 -1
  194. package/dist/sdk/workspace/git.js +1 -1
  195. package/dist/sdk/workspace/index.js +1 -1
  196. package/dist/sdk/workspace/templates.js +1 -1
  197. package/dist/sdk/workspace/weekly.js +1 -1
  198. package/dist/sdk/workspace/wikilinks.js +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -1 +1 @@
1
- const a31_0x4fe4c9=a31_0x224f;(function(_0x30140f,_0x158443){const _0x42e7be=a31_0x224f,_0x56904f=_0x30140f();while(!![]){try{const _0x349a67=-parseInt(_0x42e7be(0x326))/0x1+parseInt(_0x42e7be(0x31e))/0x2+-parseInt(_0x42e7be(0x285))/0x3*(parseInt(_0x42e7be(0x365))/0x4)+-parseInt(_0x42e7be(0x1a3))/0x5+-parseInt(_0x42e7be(0x27c))/0x6+parseInt(_0x42e7be(0x353))/0x7*(-parseInt(_0x42e7be(0x2d8))/0x8)+parseInt(_0x42e7be(0x1a9))/0x9;if(_0x349a67===_0x158443)break;else _0x56904f['push'](_0x56904f['shift']());}catch(_0x65a85c){_0x56904f['push'](_0x56904f['shift']());}}}(a31_0x47a1,0xb53d1));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x4e388c from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a31_0x224f(_0x44818d,_0x362c00){_0x44818d=_0x44818d-0x182;const _0x47a12b=a31_0x47a1();let _0x224f3d=_0x47a12b[_0x44818d];return _0x224f3d;}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_0x5de0bb 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_0x4fe4c9(0x1d5),LEGACY_PARENT_SEGMENT_DIR=a31_0x4fe4c9(0x188);function openBrowser(_0x3ddbfc){const _0x42557b=a31_0x4fe4c9,_0x555a42=process[_0x42557b(0x183)],_0x4474f3=_0x555a42===_0x42557b(0x2de)?_0x42557b(0x28b):_0x555a42===_0x42557b(0x2db)?_0x42557b(0x251):'xdg-open';spawn(_0x4474f3,[_0x3ddbfc],{'detached':!![],'stdio':_0x42557b(0x1a5)})[_0x42557b(0x328)]();}function migrateLegacyDirectory(){const _0xcc29c5=a31_0x4fe4c9;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x4a8222=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x4a8222[_0xcc29c5(0x2c0)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xcc29c5(0x33f)](a31_0x5de0bb[_0xcc29c5(0x1a0)](_0xcc29c5(0x303)+LEGACY_PARENT_SEGMENT_DIR+_0xcc29c5(0x37c)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0xcc29c5(0x33f)](a31_0x5de0bb[_0xcc29c5(0x1fd)](_0xcc29c5(0x30c)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0xcc29c5(0x33f)](a31_0x5de0bb[_0xcc29c5(0x1a0)](_0xcc29c5(0x323)+LEGACY_PARENT_SEGMENT_DIR+_0xcc29c5(0x243)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xcc29c5(0x33f)](a31_0x5de0bb[_0xcc29c5(0x25a)](_0xcc29c5(0x231)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2c7613){const _0x549718=_0x2c7613 instanceof Error?_0x2c7613['message']:String(_0x2c7613);return console[_0xcc29c5(0x33f)](a31_0x5de0bb[_0xcc29c5(0x2b6)](_0xcc29c5(0x33c)+_0x549718+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x4fe4c9(0x2a7)](_0x54d658){return migrateLegacyDirectory(),super['run'](_0x54d658);}}function resolveYamlFile(_0x31fe19){const _0x3ed19c=a31_0x4fe4c9;if(_0x31fe19['endsWith'](_0x3ed19c(0x360))||_0x31fe19[_0x3ed19c(0x377)]('.yaml'))return _0x31fe19;return a31_0x4e388c[_0x3ed19c(0x39a)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x31fe19)+_0x3ed19c(0x360));}function formatProgressMessage(_0x3acb22){const _0x21a81e=a31_0x4fe4c9,_0x1025a5=_0x3acb22[_0x21a81e(0x28a)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x1025a5){const [,_0x1d082e,_0x49c4d7,_0x5b088f='']=_0x1025a5;return a31_0x5de0bb[_0x21a81e(0x1fd)](_0x1d082e+':')+'\x20'+_0x49c4d7+a31_0x5de0bb[_0x21a81e(0x1fd)](_0x5b088f);}return a31_0x5de0bb[_0x21a81e(0x1fd)](_0x3acb22);}function showFileNotFoundError(_0x47123e,_0x26826a){const _0x3b42a8=a31_0x4fe4c9;console[_0x3b42a8(0x33f)](a31_0x5de0bb[_0x3b42a8(0x2b6)](_0x3b42a8(0x217)+_0x47123e+'\x0a')),console[_0x3b42a8(0x33f)](a31_0x5de0bb['cyan'](_0x3b42a8(0x387)+_0x26826a+_0x3b42a8(0x2bd)));}function displayRealtimeValidation(_0x3e8022){const _0x81f2=a31_0x4fe4c9;if(!_0x3e8022['realtime'])return;const _0x4b9613=_0x3e8022[_0x81f2(0x20a)],_0x2cd39e=_0x4b9613[_0x81f2(0x2ab)]?a31_0x5de0bb[_0x81f2(0x25a)]('⚡\x20Enabled'):a31_0x5de0bb['yellow'](_0x81f2(0x37d));console[_0x81f2(0x33f)]('\x0a'+a31_0x5de0bb[_0x81f2(0x1fd)](_0x81f2(0x1f6))+'\x20'+_0x2cd39e);if(_0x4b9613['events']&&_0x4b9613[_0x81f2(0x2f8)][_0x81f2(0x2ef)]>0x0){console['error']('\x20\x20'+a31_0x5de0bb[_0x81f2(0x1fd)]('Events:')+'\x20'+_0x4b9613[_0x81f2(0x2f8)][_0x81f2(0x2ef)]+_0x81f2(0x2f5));for(const _0x5f4155 of _0x4b9613[_0x81f2(0x2f8)]){const _0x166830=_0x5f4155[_0x81f2(0x18f)]===![]?a31_0x5de0bb[_0x81f2(0x2b6)]('✘'):a31_0x5de0bb[_0x81f2(0x25a)]('✔');console[_0x81f2(0x33f)](_0x81f2(0x2d4)+_0x166830+'\x20'+_0x5f4155['name']),_0x5f4155[_0x81f2(0x351)]&&console['error']('\x20\x20\x20\x20\x20\x20'+a31_0x5de0bb['red'](_0x5f4155['sourceTableError']));}}if(_0x4b9613[_0x81f2(0x19c)]&&_0x4b9613['attributes'][_0x81f2(0x2ef)]>0x0){console['error']('\x20\x20'+a31_0x5de0bb[_0x81f2(0x1fd)]('Attributes:')+'\x20'+_0x4b9613[_0x81f2(0x19c)][_0x81f2(0x2ef)]+'\x20configured');for(const _0x4cf4bc of _0x4b9613[_0x81f2(0x19c)]){const _0x1e0c18=_0x4cf4bc[_0x81f2(0x1a6)]?a31_0x5de0bb[_0x81f2(0x25a)]('✔'):a31_0x5de0bb['red']('✘');console['error']('\x20\x20\x20\x20'+_0x1e0c18+'\x20'+_0x4cf4bc[_0x81f2(0x284)]+'\x20'+a31_0x5de0bb[_0x81f2(0x1fd)]('('+_0x4cf4bc['type']+')'));}}if(_0x4b9613['idStitching']){const _0x30ecc2=_0x4b9613['idStitching'][_0x81f2(0x372)]?.[_0x81f2(0x2ef)]?_0x81f2(0x315)+_0x4b9613[_0x81f2(0x31a)][_0x81f2(0x372)][_0x81f2(0x39a)](',\x20')+']':'';console[_0x81f2(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x81f2(0x1fd)](_0x81f2(0x2f3))+'\x20'+_0x4b9613['idStitching']['primaryKey']+_0x30ecc2);}if(_0x4b9613[_0x81f2(0x37a)]&&_0x4b9613[_0x81f2(0x37a)]['length']>0x0){console[_0x81f2(0x33f)]('\x20\x20'+a31_0x5de0bb['dim'](_0x81f2(0x1fb))+'\x20'+_0x4b9613[_0x81f2(0x37a)]['length']+'\x20service'+(_0x4b9613[_0x81f2(0x37a)][_0x81f2(0x2ef)]!==0x1?'s':''));for(const _0x38c6a3 of _0x4b9613[_0x81f2(0x37a)]){console[_0x81f2(0x33f)]('\x20\x20\x20\x20-\x20'+_0x38c6a3[_0x81f2(0x284)]);}}}function showParentSegmentNotSetError(_0x4b4135){const _0x15a5e8=a31_0x4fe4c9;console['error'](a31_0x5de0bb[_0x15a5e8(0x1a0)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x4b4135);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x291);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x2e4);async['execute'](_0x50ead2){const _0x3bb408=a31_0x4fe4c9,{options:_0x247719,args:_0x4e5f50,tdx:_0x313f21}=_0x50ead2,_0x2a5282=_0x4e5f50[0x0];_0x247719[_0x3bb408(0x29d)]&&(console['error'](_0x3bb408(0x1ce)+_0x247719[_0x3bb408(0x362)]),_0x2a5282&&console[_0x3bb408(0x33f)](_0x3bb408(0x1eb)+_0x2a5282));const _0x11d8d3=await withSpinner(_0x2a5282?_0x3bb408(0x367)+_0x2a5282+_0x3bb408(0x32f):'Listing\x20parent\x20segments...',()=>_0x313f21['segment'][_0x3bb408(0x21c)](),{'verbose':_0x247719[_0x3bb408(0x29d)]});let _0x3e57d7=_0x11d8d3[_0x3bb408(0x268)];if(_0x2a5282){const _0x1002f6=_0x2a5282[_0x3bb408(0x305)](/[.+^${}()|[\]\\]/g,_0x3bb408(0x2c5))['replace'](/\*/g,'.*')[_0x3bb408(0x305)](/\?/g,'.'),_0x4089e1=new RegExp('^'+_0x1002f6+'$','i');_0x3e57d7=_0x3e57d7['filter'](_0x32c387=>_0x4089e1[_0x3bb408(0x35e)](_0x32c387['attributes'][_0x3bb408(0x284)]));}_0x3e57d7[_0x3bb408(0x32a)]((_0x5ad316,_0x43371d)=>_0x5ad316[_0x3bb408(0x19c)]['name'][_0x3bb408(0x237)](_0x43371d[_0x3bb408(0x19c)][_0x3bb408(0x284)])),console[_0x3bb408(0x33f)](_0x3bb408(0x194)+_0x3e57d7[_0x3bb408(0x2ef)]+_0x3bb408(0x342)+(_0x3e57d7['length']!==0x1?'s':''));const _0x1771bc=_0x2c4ee9=>{const _0x572a98=_0x3bb408;return getConsoleNextUrl(_0x247719[_0x572a98(0x362)],'/app/dw/parentSegments/'+_0x2c4ee9);};if(_0x247719[_0x3bb408(0x1dd)]===_0x3bb408(0x1ba)||_0x247719['format']===_0x3bb408(0x382)){const _0x15542f=_0x3e57d7[_0x3bb408(0x2d5)](_0xfabb6e=>({..._0xfabb6e,'url':_0x1771bc(_0xfabb6e['id'])}));await handleSDKOutput(_0x15542f,_0x247719);}else{if(_0x3e57d7[_0x3bb408(0x2ef)]===0x0)_0x2a5282?console[_0x3bb408(0x1e6)](_0x3bb408(0x385)+_0x2a5282):console[_0x3bb408(0x1e6)]('No\x20parent\x20segments\x20found');else for(const _0x2bfcb7 of _0x3e57d7){const _0x59af38=_0x2bfcb7[_0x3bb408(0x19c)]['population']?a31_0x5de0bb[_0x3bb408(0x1fd)]('\x20('+formatRows(_0x2bfcb7['attributes'][_0x3bb408(0x2d2)])+')'):'',_0x1cab48=hyperlink(_0x2bfcb7[_0x3bb408(0x19c)][_0x3bb408(0x284)],_0x1771bc(_0x2bfcb7['id']));console['log'](_0x3bb408(0x302)+_0x1cab48+_0x59af38);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x296);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x391);async[a31_0x4fe4c9(0x33b)](_0x4b0774){const _0xbc664f=a31_0x4fe4c9,{options:_0x54abfa,args:_0x1fc506,tdx:_0x3d1683}=_0x4b0774;console[_0xbc664f(0x33f)](_0xbc664f(0x204)+_0xbc664f(0x369)+_0xbc664f(0x329));const _0x3d19bb=_0x54abfa;if(_0x1fc506[_0xbc664f(0x2ef)]===0x0)return console[_0xbc664f(0x33f)](a31_0x5de0bb['red'](_0xbc664f(0x1b2))),console[_0xbc664f(0x33f)](_0xbc664f(0x37b)),0x1;const _0x2a9245=_0x1fc506[0x0];if(!_0x3d19bb[_0xbc664f(0x307)]||!_0x3d19bb[_0xbc664f(0x2fd)])return console[_0xbc664f(0x33f)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0xbc664f(0x33f)](_0xbc664f(0x37b)),0x1;_0x3d19bb[_0xbc664f(0x29d)]&&(console[_0xbc664f(0x33f)](_0xbc664f(0x1ce)+_0x3d19bb[_0xbc664f(0x362)]),console[_0xbc664f(0x33f)](_0xbc664f(0x1f0)+_0x2a9245),console['error']('Database:\x20'+_0x3d19bb[_0xbc664f(0x307)]),console['error'](_0xbc664f(0x1f9)+_0x3d19bb['table']));const _0x2c69b9=await loadJSONFromOptions(_0x3d19bb[_0xbc664f(0x19c)],_0x3d19bb[_0xbc664f(0x224)]),_0x40ab55=await loadJSONFromOptions(_0x3d19bb[_0xbc664f(0x1f1)],_0x3d19bb[_0xbc664f(0x20c)]),_0x24f98b=await loadJSONFromOptions(_0x3d19bb[_0xbc664f(0x2c2)],_0x3d19bb[_0xbc664f(0x32c)]),_0x5c8a2={'name':_0x2a9245,'description':_0x3d19bb[_0xbc664f(0x1ff)],'scheduleType':_0x3d19bb[_0xbc664f(0x28f)],'scheduleOption':_0x3d19bb[_0xbc664f(0x1ef)],'timezone':_0x3d19bb[_0xbc664f(0x1b4)],'master':{'parentDatabaseName':_0x3d19bb['database'],'parentTableName':_0x3d19bb[_0xbc664f(0x2fd)]},'attributes':_0x2c69b9,'behaviors':_0x40ab55,'customerGroup':_0x24f98b},_0x4b0a47=await withSpinner(_0xbc664f(0x319)+_0x2a9245+_0xbc664f(0x32f),()=>_0x3d1683['segment'][_0xbc664f(0x25b)](_0x5c8a2),{'verbose':_0x54abfa[_0xbc664f(0x29d)]}),_0x438de9=_0x4b0a47['data'];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0x438de9['name']+_0xbc664f(0x2b2)+_0x438de9['id']),await handleSDKOutput([_0x438de9],_0x54abfa),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x394);['description']=a31_0x4fe4c9(0x2c6);async[a31_0x4fe4c9(0x33b)](_0x4c549f){const _0x166ef6=a31_0x4fe4c9,{options:_0x3d8dbe,args:_0x248266,tdx:_0x48bca3}=_0x4c549f;console[_0x166ef6(0x33f)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x166ef6(0x369)+_0x166ef6(0x329));const _0x1bffc4=_0x3d8dbe;if(_0x248266[_0x166ef6(0x2ef)]===0x0)return console[_0x166ef6(0x33f)](a31_0x5de0bb[_0x166ef6(0x2b6)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console['error']('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x42dc99=_0x248266[0x0];_0x1bffc4[_0x166ef6(0x29d)]&&(console['error']('Site:\x20'+_0x1bffc4['site']),console[_0x166ef6(0x33f)]('Parent\x20segment:\x20'+_0x42dc99));const _0x41664a=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x42dc99+_0x166ef6(0x32f),()=>_0x48bca3[_0x166ef6(0x1f3)]['getParentFull'](_0x42dc99),{'verbose':_0x1bffc4['verbose']}),_0x4341ca=_0x41664a[_0x166ef6(0x268)],_0x417464=await loadJSONFromOptions(_0x1bffc4[_0x166ef6(0x25c)],_0x1bffc4[_0x166ef6(0x358)]),_0x95d140=await loadJSONFromOptions(_0x1bffc4[_0x166ef6(0x1cd)],_0x1bffc4['addBehaviorsFile']),_0x4e2d00={'name':_0x4341ca[_0x166ef6(0x284)],'description':_0x1bffc4['description']!==undefined?_0x1bffc4['description']:_0x4341ca[_0x166ef6(0x1ff)],'scheduleType':_0x1bffc4[_0x166ef6(0x28f)]!==undefined?_0x1bffc4[_0x166ef6(0x28f)]:_0x4341ca[_0x166ef6(0x28f)],'scheduleOption':_0x1bffc4['scheduleOption']!==undefined?_0x1bffc4[_0x166ef6(0x1ef)]:_0x4341ca[_0x166ef6(0x1ef)],'timezone':_0x1bffc4['timezone']!==undefined?_0x1bffc4[_0x166ef6(0x1b4)]:_0x4341ca['timezone'],'master':_0x4341ca[_0x166ef6(0x2f1)],'attributes':_0x417464?[..._0x4341ca[_0x166ef6(0x19c)]||[],..._0x417464]:_0x4341ca['attributes'],'behaviors':_0x95d140?[..._0x4341ca[_0x166ef6(0x1f1)]||[],..._0x95d140]:_0x4341ca[_0x166ef6(0x1f1)],'customerGroup':_0x4341ca[_0x166ef6(0x2c2)]},_0x327e92=await withSpinner(_0x166ef6(0x214)+_0x42dc99+'\x27...',()=>_0x48bca3['segment']['updateParent'](_0x42dc99,_0x4e2d00),{'verbose':_0x1bffc4[_0x166ef6(0x29d)]}),_0x556e39=_0x327e92[_0x166ef6(0x268)];return console[_0x166ef6(0x33f)](_0x166ef6(0x317)+_0x556e39[_0x166ef6(0x284)]+'\x27'),await handleSDKOutput([_0x556e39],_0x1bffc4),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x26c);['description']=a31_0x4fe4c9(0x2ba);async[a31_0x4fe4c9(0x33b)](_0x1fdf15){const _0x1dcec6=a31_0x4fe4c9,{options:_0xc79eba,args:_0x163c1d,tdx:_0x13f54a}=_0x1fdf15,_0x4fa6fa=_0xc79eba,_0x565f2a=_0x163c1d[0x0]||_0xc79eba[_0x1dcec6(0x301)];if(!_0x565f2a)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(_0x4fa6fa[_0x1dcec6(0x2ed)]&&_0x4fa6fa[_0x1dcec6(0x399)])return console[_0x1dcec6(0x33f)](a31_0x5de0bb[_0x1dcec6(0x2b6)](_0x1dcec6(0x24c))),console[_0x1dcec6(0x33f)](a31_0x5de0bb[_0x1dcec6(0x1fd)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x1dcec6(0x33f)](a31_0x5de0bb['dim'](_0x1dcec6(0x39e)+PARENT_SEGMENT_DIR+_0x1dcec6(0x2fb))),console[_0x1dcec6(0x33f)](a31_0x5de0bb[_0x1dcec6(0x348)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x25e2a0=_0x4fa6fa[_0x1dcec6(0x399)]||a31_0x4e388c[_0x1dcec6(0x39a)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x565f2a)+_0x1dcec6(0x360));_0x4fa6fa[_0x1dcec6(0x29d)]&&(console['error']('Site:\x20'+_0x4fa6fa[_0x1dcec6(0x362)]),console[_0x1dcec6(0x33f)](_0x1dcec6(0x235)+_0x565f2a),console[_0x1dcec6(0x33f)](_0x1dcec6(0x236)+_0x25e2a0));const _0x418f75=await withSpinner(_0x1dcec6(0x31f)+_0x565f2a+_0x1dcec6(0x32f),()=>_0x13f54a['segment']['pullParentYaml'](_0x565f2a),{'verbose':_0x4fa6fa['verbose']}),_0x1fa49d=_0x418f75[_0x1dcec6(0x268)];if(existsSync(_0x25e2a0)){const _0xdfa3fa=readFileSync(_0x25e2a0,'utf-8'),_0x1e614a=generateDiff(_0xdfa3fa,_0x1fa49d);if(!hasChanges(_0x1e614a))console[_0x1dcec6(0x33f)](a31_0x5de0bb[_0x1dcec6(0x25a)]('✔')+_0x1dcec6(0x1f4)+a31_0x5de0bb[_0x1dcec6(0x348)](_0x25e2a0)+_0x1dcec6(0x36f));else{console[_0x1dcec6(0x33f)](_0x1dcec6(0x1da)+_0x25e2a0+'\x27:'),console[_0x1dcec6(0x33f)]('─'[_0x1dcec6(0x38d)](0x3c)),console['error'](formatDiffWithColors(_0x1e614a)),console[_0x1dcec6(0x33f)]('─'['repeat'](0x3c));if(!_0x4fa6fa[_0x1dcec6(0x280)]){if(!isInteractive())return console[_0x1dcec6(0x33f)](a31_0x5de0bb[_0x1dcec6(0x2b6)](_0x1dcec6(0x23b)),_0x1dcec6(0x33e)),console['error'](a31_0x5de0bb[_0x1dcec6(0x1fd)](_0x1dcec6(0x223))),0x1;const _0x378ac2=await confirmKey(_0x1dcec6(0x2aa)+_0x25e2a0+'\x27?');if(!_0x378ac2)return console['error'](a31_0x5de0bb[_0x1dcec6(0x1a0)](_0x1dcec6(0x310))),0x1;}writeFileSync(_0x25e2a0,_0x1fa49d,_0x1dcec6(0x1f8)),console[_0x1dcec6(0x33f)](a31_0x5de0bb[_0x1dcec6(0x25a)]('✔')+_0x1dcec6(0x1cc)+a31_0x5de0bb['cyan'](_0x25e2a0));}}else{const _0x20d591=a31_0x4e388c[_0x1dcec6(0x211)](_0x25e2a0);!existsSync(_0x20d591)&&mkdirSync(_0x20d591,{'recursive':!![]}),writeFileSync(_0x25e2a0,_0x1fa49d,_0x1dcec6(0x1f8)),console[_0x1dcec6(0x33f)](a31_0x5de0bb[_0x1dcec6(0x25a)]('✔')+_0x1dcec6(0x1cc)+a31_0x5de0bb['cyan'](_0x25e2a0));}return saveSessionContext({'parent_segment':_0x565f2a},_0x4fa6fa[_0x1dcec6(0x2c8)]),console[_0x1dcec6(0x33f)](a31_0x5de0bb[_0x1dcec6(0x25a)]('✔')+'\x20Context\x20set:\x20'+a31_0x5de0bb[_0x1dcec6(0x1fd)](_0x1dcec6(0x188))+_0x1dcec6(0x2ea)+a31_0x5de0bb['cyan'](_0x565f2a)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x368);['description']=a31_0x4fe4c9(0x252);async[a31_0x4fe4c9(0x33b)](_0x3178a2){const _0x4787ed=a31_0x4fe4c9,{options:_0xce93b8,args:_0x1cafce,tdx:_0x414bba}=_0x3178a2,_0x297cf2=_0xce93b8,_0x207acd=_0x1cafce[0x0]||_0xce93b8[_0x4787ed(0x301)];if(!_0x207acd)return showParentSegmentNotSetError(_0x4787ed(0x34a)+_0x4787ed(0x35a)),0x1;const _0x5067cc=resolveYamlFile(_0x207acd);if(!existsSync(_0x5067cc))return showFileNotFoundError(_0x5067cc,_0x207acd),0x1;_0x297cf2[_0x4787ed(0x29d)]&&(console[_0x4787ed(0x33f)](_0x4787ed(0x1ce)+_0x297cf2[_0x4787ed(0x362)]),console['error'](_0x4787ed(0x1b0)+_0x5067cc));let _0x11d1e3;try{_0x11d1e3=readFileSync(_0x5067cc,'utf-8');}catch(_0x100f53){const _0x468b56=_0x100f53 instanceof Error?_0x100f53[_0x4787ed(0x26f)]:String(_0x100f53);return console[_0x4787ed(0x33f)](_0x4787ed(0x340)+_0x468b56),0x1;}const _0x4c010e=await withSpinner(_0x4787ed(0x228),()=>_0x414bba[_0x4787ed(0x1f3)]['pushParentYaml'](_0x11d1e3),{'verbose':_0x297cf2[_0x4787ed(0x29d)]}),_0x5e3cbc=_0x4c010e[_0x4787ed(0x268)],{isNew:_0x4c2ded,name:_0x18aa45,hasChanges:_0x2e6261,diffFormatted:_0x5743cc}=_0x5e3cbc;if(!_0x2e6261)return console[_0x4787ed(0x33f)](_0x4787ed(0x336)+_0x18aa45+_0x4787ed(0x1b9)),0x0;_0x4c2ded?console[_0x4787ed(0x33f)](_0x4787ed(0x386)+_0x18aa45+'\x27:'):console['error'](_0x4787ed(0x397)+_0x18aa45+'\x27:');console[_0x4787ed(0x33f)]('─'[_0x4787ed(0x38d)](0x3c)),console[_0x4787ed(0x33f)](_0x5743cc),console[_0x4787ed(0x33f)]('─'[_0x4787ed(0x38d)](0x3c));const _0xe3e9a3=_0x4c2ded?_0x4787ed(0x39d)+_0x18aa45+'\x27?':_0x4787ed(0x1d8)+_0x18aa45+'\x27?';if(!_0x297cf2[_0x4787ed(0x280)]){if(!isInteractive())return console[_0x4787ed(0x33f)](a31_0x5de0bb[_0x4787ed(0x2b6)](_0x4787ed(0x23b)),_0x4787ed(0x33e)),console[_0x4787ed(0x33f)](a31_0x5de0bb[_0x4787ed(0x1fd)](_0x4787ed(0x223))),0x1;const _0x1020b9=await confirmKey(_0xe3e9a3);if(!_0x1020b9)return console[_0x4787ed(0x33f)](a31_0x5de0bb[_0x4787ed(0x1a0)]('Aborted.')),0x1;}const _0x8e098f=_0x4c2ded?_0x4787ed(0x20f):_0x4787ed(0x36d),_0x40d61f=await withSpinner(_0x8e098f+_0x4787ed(0x2d7)+_0x18aa45+_0x4787ed(0x32f),()=>_0x5e3cbc[_0x4787ed(0x25e)](),{'verbose':_0x297cf2[_0x4787ed(0x29d)]}),_0x49e67b=_0x40d61f['data'],_0x9be5f3=getConsoleNextUrl(_0x297cf2[_0x4787ed(0x362)],_0x4787ed(0x2cc)+_0x49e67b['id']),_0x3137c5=_0x4c2ded?'Created':'Updated';return console[_0x4787ed(0x33f)]('✔\x20'+_0x3137c5+_0x4787ed(0x2d7)+_0x49e67b['name']+'\x27'),console[_0x4787ed(0x33f)]('\x20\x20'+_0x9be5f3),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x4fe4c9(0x284)]='segment:parent:validate';[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x259);async[a31_0x4fe4c9(0x33b)](_0x593f4d){const _0x46cd42=a31_0x4fe4c9,{options:_0x1a0ebb,args:_0xfa96e4,tdx:_0x3d41ea}=_0x593f4d,_0xb8559a=_0x1a0ebb,_0xbfde75=_0xfa96e4[0x0]||_0x1a0ebb[_0x46cd42(0x301)];if(!_0xbfde75)return showParentSegmentNotSetError(_0x46cd42(0x389)+_0x46cd42(0x216)+'Options:\x0a'+_0x46cd42(0x361)+_0x46cd42(0x219)+_0x46cd42(0x32b)),0x1;const _0x5c1312=resolveYamlFile(_0xbfde75);if(!existsSync(_0x5c1312))return showFileNotFoundError(_0x5c1312,_0xbfde75),0x1;_0xb8559a[_0x46cd42(0x29d)]&&(console[_0x46cd42(0x33f)](_0x46cd42(0x1ce)+_0xb8559a[_0x46cd42(0x362)]),console[_0x46cd42(0x33f)](_0x46cd42(0x1b0)+_0x5c1312));let _0x23992a;try{_0x23992a=readFileSync(_0x5c1312,_0x46cd42(0x1f8));}catch(_0x116e13){const _0x258ded=_0x116e13 instanceof Error?_0x116e13[_0x46cd42(0x26f)]:String(_0x116e13);return console[_0x46cd42(0x33f)]('Error\x20reading\x20file:\x20'+_0x258ded),0x1;}const _0x30bd7f=createCommandSpinner(a31_0x5de0bb[_0x46cd42(0x1fd)]('Validating\x20configuration...'),{'verbose':_0xb8559a[_0x46cd42(0x29d)]});_0x30bd7f[_0x46cd42(0x251)]();const _0x185852={'onProgress':_0x6fded0=>{const _0x571061=_0x46cd42;_0x30bd7f[_0x571061(0x333)]=formatProgressMessage(_0x6fded0);}};if(_0xb8559a['master'])_0x185852[_0x46cd42(0x2f1)]=!![];if(_0xb8559a[_0x46cd42(0x388)])_0x185852['enriched']=!![];_0xb8559a[_0x46cd42(0x1ad)]&&(_0x185852[_0x46cd42(0x1ad)]=_0xb8559a[_0x46cd42(0x1ad)]);_0xb8559a[_0x46cd42(0x2c4)]&&(_0x185852[_0x46cd42(0x2c4)]=_0xb8559a[_0x46cd42(0x2c4)]);if(_0xb8559a['interval'])_0x185852[_0x46cd42(0x21d)]=_0xb8559a[_0x46cd42(0x21d)];let _0x361bb6;try{_0x361bb6=await _0x3d41ea[_0x46cd42(0x1f3)][_0x46cd42(0x299)](_0x23992a,_0x185852),_0x30bd7f[_0x46cd42(0x209)]();}catch(_0x27f5cc){_0x30bd7f[_0x46cd42(0x209)]();throw _0x27f5cc;}const _0x5b8211=_0xb8559a[_0x46cd42(0x21d)]||_0x46cd42(0x347);return this[_0x46cd42(0x18d)](_0x361bb6,_0x185852,_0x5c1312,_0x5b8211),_0x361bb6[_0x46cd42(0x227)]?0x0:0x1;}['displayValidateResults'](_0x3ee483,_0x128764,_0x5c65c6,_0x27a4fb){const _0x14bdae=a31_0x4fe4c9;console[_0x14bdae(0x33f)]('\x0a'+a31_0x5de0bb[_0x14bdae(0x1d3)](_0x14bdae(0x1f7))+'\x20'+_0x3ee483[_0x14bdae(0x284)]),console[_0x14bdae(0x33f)]('═'[_0x14bdae(0x38d)](0x3c)),this[_0x14bdae(0x1c5)](_0x3ee483);if(typeof _0x128764[_0x14bdae(0x1ad)]===_0x14bdae(0x359)){this[_0x14bdae(0x1c3)](_0x3ee483),this[_0x14bdae(0x34c)](_0x3ee483),this['displayPreviewHints'](_0x5c65c6,_0x27a4fb,'attribute',_0x128764[_0x14bdae(0x1ad)]);return;}if(_0x128764['attribute']===!![]){this[_0x14bdae(0x1c3)](_0x3ee483),this[_0x14bdae(0x34c)](_0x3ee483),this[_0x14bdae(0x36a)](_0x5c65c6,_0x27a4fb,'attributes');return;}if(typeof _0x128764[_0x14bdae(0x2c4)]==='string'){this[_0x14bdae(0x35f)](_0x3ee483,_0x27a4fb),this[_0x14bdae(0x34c)](_0x3ee483),this[_0x14bdae(0x36a)](_0x5c65c6,_0x27a4fb,'behavior',_0x128764['behavior']);return;}if(_0x128764[_0x14bdae(0x2c4)]===!![]){this[_0x14bdae(0x35f)](_0x3ee483,_0x27a4fb),this['displaySummary'](_0x3ee483),this[_0x14bdae(0x36a)](_0x5c65c6,_0x27a4fb,_0x14bdae(0x1f1));return;}this[_0x14bdae(0x1c3)](_0x3ee483),this[_0x14bdae(0x35f)](_0x3ee483,_0x27a4fb),this[_0x14bdae(0x1cb)](_0x3ee483),this['displaySummary'](_0x3ee483),this['displayPreviewHints'](_0x5c65c6,_0x27a4fb,_0x14bdae(0x1aa));}[a31_0x4fe4c9(0x1cb)](_0x41f2af){displayRealtimeValidation(_0x41f2af);}[a31_0x4fe4c9(0x36a)](_0x5bbcf2,_0x4db7e9,_0x292c90,_0x228f13){const _0x497f5b=a31_0x4fe4c9;console[_0x497f5b(0x33f)]('\x0a'+a31_0x5de0bb[_0x497f5b(0x1fd)]('To\x20view\x20sample\x20data:'));const _0x240042=_0x4db7e9!==_0x497f5b(0x347)?_0x497f5b(0x2cf)+_0x4db7e9:'';if(_0x292c90==='attribute'&&_0x228f13)console[_0x497f5b(0x33f)]('\x20\x20'+a31_0x5de0bb['dim'](_0x497f5b(0x335)+_0x5bbcf2+_0x497f5b(0x292)+_0x228f13+'\x22'+_0x240042));else{if(_0x292c90===_0x497f5b(0x2c4)&&_0x228f13)console['error']('\x20\x20'+a31_0x5de0bb[_0x497f5b(0x1fd)]('tdx\x20ps\x20preview\x20'+_0x5bbcf2+_0x497f5b(0x2bc)+_0x228f13+'\x22'+_0x240042));else(_0x292c90===_0x497f5b(0x19c)||_0x292c90===_0x497f5b(0x1aa))&&console[_0x497f5b(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x497f5b(0x1fd)](_0x497f5b(0x335)+_0x5bbcf2+_0x497f5b(0x306)+_0x240042));}(_0x292c90===_0x497f5b(0x1f1)||_0x292c90===_0x497f5b(0x1aa))&&console[_0x497f5b(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x497f5b(0x1fd)](_0x497f5b(0x335)+_0x5bbcf2+_0x497f5b(0x2b7)+_0x240042)),_0x292c90===_0x497f5b(0x1aa)&&console[_0x497f5b(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x497f5b(0x1fd)](_0x497f5b(0x335)+_0x5bbcf2+_0x497f5b(0x1d0)+_0x240042));}[a31_0x4fe4c9(0x1c5)](_0x60460){const _0x10dc9b=a31_0x4fe4c9,{master:_0xed1851}=_0x60460,_0x56af73=_0xed1851['schemaValid']?a31_0x5de0bb[_0x10dc9b(0x25a)]('✔'):a31_0x5de0bb['red']('✘');console['error']('\x0a'+a31_0x5de0bb['dim'](_0x10dc9b(0x1d6))),console[_0x10dc9b(0x33f)](_0x56af73+'\x20'+a31_0x5de0bb[_0x10dc9b(0x1d3)](_0xed1851[_0x10dc9b(0x307)]+'.'+_0xed1851[_0x10dc9b(0x2fd)])),_0xed1851[_0x10dc9b(0x263)]?_0xed1851[_0x10dc9b(0x1b6)]!==undefined&&console[_0x10dc9b(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x10dc9b(0x1fd)](_0x10dc9b(0x29c))+'\x20'+a31_0x5de0bb['cyan'](formatRows(_0xed1851[_0x10dc9b(0x1b6)]))):console[_0x10dc9b(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x10dc9b(0x2b6)](_0x10dc9b(0x30a))+'\x20'+_0xed1851['schemaError']);}['displayAttributesStats'](_0x5b551d){const _0x4cc4aa=a31_0x4fe4c9;if(_0x5b551d[_0x4cc4aa(0x19c)][_0x4cc4aa(0x2ef)]===0x0)return;console['error']('\x0a'+a31_0x5de0bb[_0x4cc4aa(0x1fd)]('Attributes'));for(const _0x1e4185 of _0x5b551d['attributes']){const _0x5a9367=_0x1e4185[_0x4cc4aa(0x263)]?a31_0x5de0bb[_0x4cc4aa(0x25a)]('✔'):a31_0x5de0bb['red']('✘');let _0x28842e='';if(_0x1e4185[_0x4cc4aa(0x263)]&&_0x1e4185['matchedCount']!==undefined&&_0x1e4185[_0x4cc4aa(0x29b)]!==undefined){const _0x16481d=_0x1e4185[_0x4cc4aa(0x29b)][_0x4cc4aa(0x339)](0x1),_0x14eb6d=_0x1e4185[_0x4cc4aa(0x29b)]>=0x50?a31_0x5de0bb[_0x4cc4aa(0x25a)]:_0x1e4185[_0x4cc4aa(0x29b)]>=0x32?a31_0x5de0bb[_0x4cc4aa(0x1a0)]:a31_0x5de0bb[_0x4cc4aa(0x2b6)];_0x28842e='\x20'+a31_0x5de0bb[_0x4cc4aa(0x1fd)](_0x4cc4aa(0x2c1))+'\x20'+_0x14eb6d(_0x16481d+'%')+'\x20('+formatRows(_0x1e4185[_0x4cc4aa(0x261)])+_0x4cc4aa(0x2a1);}console[_0x4cc4aa(0x33f)](_0x5a9367+'\x20'+a31_0x5de0bb[_0x4cc4aa(0x1d3)](_0x1e4185[_0x4cc4aa(0x284)])+_0x28842e),console[_0x4cc4aa(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x4cc4aa(0x1fd)](_0x4cc4aa(0x2f2))+'\x20'+a31_0x5de0bb['bold'](_0x1e4185['database']+'.'+_0x1e4185[_0x4cc4aa(0x2fd)]));const _0x300103=_0x1e4185[_0x4cc4aa(0x363)]===_0x1e4185[_0x4cc4aa(0x196)]?a31_0x5de0bb[_0x4cc4aa(0x1fd)](_0x4cc4aa(0x1e5))+'\x20'+_0x1e4185['joinKey']:a31_0x5de0bb[_0x4cc4aa(0x1fd)](_0x4cc4aa(0x258))+'\x20'+_0x1e4185[_0x4cc4aa(0x363)]+_0x4cc4aa(0x2ea)+_0x1e4185[_0x4cc4aa(0x196)];console[_0x4cc4aa(0x33f)]('\x20\x20'+_0x300103),console[_0x4cc4aa(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x4cc4aa(0x1fd)](_0x4cc4aa(0x279))),this[_0x4cc4aa(0x2b5)](_0x1e4185['columns']),!_0x1e4185[_0x4cc4aa(0x263)]&&console[_0x4cc4aa(0x33f)]('\x20\x20'+a31_0x5de0bb['red'](_0x4cc4aa(0x30a))+'\x20'+_0x1e4185[_0x4cc4aa(0x218)]);}}[a31_0x4fe4c9(0x35f)](_0x23608c,_0x237506){const _0x353a7b=a31_0x4fe4c9;if(_0x23608c['behaviors']['length']===0x0)return;console[_0x353a7b(0x33f)]('\x0a'+a31_0x5de0bb[_0x353a7b(0x1fd)](_0x353a7b(0x1dc))+'\x20'+a31_0x5de0bb[_0x353a7b(0x1fd)]('('+_0x237506+')'));for(const _0x23ac68 of _0x23608c[_0x353a7b(0x1f1)]){const _0x599bb4=_0x23ac68[_0x353a7b(0x263)]?a31_0x5de0bb[_0x353a7b(0x25a)]('✔'):a31_0x5de0bb['red']('✘');let _0x39fb56='';if(_0x23ac68[_0x353a7b(0x263)]&&_0x23ac68['customersWithEvents']!==undefined&&_0x23ac68['totalEvents']!==undefined){const _0xb132a3=_0x23ac68[_0x353a7b(0x314)]?.['toFixed'](0x1)||'?',_0x5619d2=(_0x23ac68[_0x353a7b(0x314)]??0x0)>=0x32?a31_0x5de0bb[_0x353a7b(0x25a)]:(_0x23ac68[_0x353a7b(0x314)]??0x0)>=0x14?a31_0x5de0bb[_0x353a7b(0x1a0)]:a31_0x5de0bb[_0x353a7b(0x2b6)];_0x39fb56='\x20'+a31_0x5de0bb[_0x353a7b(0x1fd)](_0x353a7b(0x1b8))+'\x20'+_0x5619d2(formatRows(_0x23ac68[_0x353a7b(0x1de)]))+'\x20('+_0xb132a3+_0x353a7b(0x330)+a31_0x5de0bb[_0x353a7b(0x1fd)](_0x353a7b(0x273))+'\x20'+a31_0x5de0bb[_0x353a7b(0x348)](formatRows(_0x23ac68[_0x353a7b(0x21e)]));}console[_0x353a7b(0x33f)](_0x599bb4+'\x20'+a31_0x5de0bb['bold'](_0x23ac68[_0x353a7b(0x284)])+_0x39fb56),console[_0x353a7b(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x353a7b(0x1fd)](_0x353a7b(0x2f2))+'\x20'+a31_0x5de0bb[_0x353a7b(0x1d3)](_0x23ac68[_0x353a7b(0x307)]+'.'+_0x23ac68[_0x353a7b(0x2fd)]));const _0x5adfcc=_0x23ac68[_0x353a7b(0x363)]===_0x23ac68[_0x353a7b(0x196)]?a31_0x5de0bb['dim'](_0x353a7b(0x1e5))+'\x20'+_0x23ac68['joinKey']:a31_0x5de0bb[_0x353a7b(0x1fd)]('Join:')+'\x20'+_0x23ac68['joinKey']+_0x353a7b(0x2ea)+_0x23ac68[_0x353a7b(0x196)];console[_0x353a7b(0x33f)]('\x20\x20'+_0x5adfcc),console[_0x353a7b(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x353a7b(0x1fd)](_0x353a7b(0x279))),this[_0x353a7b(0x2b5)](_0x23ac68[_0x353a7b(0x210)]),!_0x23ac68[_0x353a7b(0x263)]&&console[_0x353a7b(0x33f)]('\x20\x20'+a31_0x5de0bb['red'](_0x353a7b(0x30a))+'\x20'+_0x23ac68[_0x353a7b(0x218)]);}}[a31_0x4fe4c9(0x2b5)](_0x331cc2){const _0x630cb2=a31_0x4fe4c9;for(const _0x301e9b of _0x331cc2){_0x301e9b[_0x630cb2(0x376)]===_0x301e9b[_0x630cb2(0x313)]||_0x301e9b[_0x630cb2(0x313)]==='*'?console[_0x630cb2(0x33f)](_0x630cb2(0x398)+_0x301e9b[_0x630cb2(0x376)]):console[_0x630cb2(0x33f)]('\x20\x20\x20\x20-\x20'+_0x301e9b[_0x630cb2(0x376)]+'\x20'+a31_0x5de0bb['dim']('('+_0x301e9b['column']+')'));}}[a31_0x4fe4c9(0x34c)](_0x473b64){const _0x2fc8b9=a31_0x4fe4c9;console['error']('─'[_0x2fc8b9(0x38d)](0x3c));if(_0x473b64[_0x2fc8b9(0x2ca)][_0x2fc8b9(0x2ef)]>0x0){console[_0x2fc8b9(0x33f)]('\x0a'+a31_0x5de0bb[_0x2fc8b9(0x2b6)](_0x2fc8b9(0x186)));for(const _0x13c542 of _0x473b64[_0x2fc8b9(0x2ca)]){console[_0x2fc8b9(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x2fc8b9(0x2b6)]('•')+'\x20'+_0x13c542);}}_0x473b64[_0x2fc8b9(0x227)]&&console[_0x2fc8b9(0x33f)]('\x0a'+a31_0x5de0bb[_0x2fc8b9(0x25a)]('✔')+_0x2fc8b9(0x1bb));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x4fe4c9(0x284)]='segment:parent:preview';[a31_0x4fe4c9(0x1ff)]='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async[a31_0x4fe4c9(0x33b)](_0x25529a){const _0xdb9f4c=a31_0x4fe4c9,{options:_0x5efb5c,args:_0x2e872d,tdx:_0x2038a3}=_0x25529a,_0x5c666d=_0x5efb5c,_0x5f512c=_0x2e872d[0x0]||_0x5efb5c['parentSegment'];if(!_0x5f512c)return showParentSegmentNotSetError(_0xdb9f4c(0x2fa)+_0xdb9f4c(0x266)+'Options\x20(one\x20required):\x0a'+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0xdb9f4c(0x298)+_0xdb9f4c(0x29f)+_0xdb9f4c(0x240)+_0xdb9f4c(0x32b)),0x1;if(!_0x5c666d[_0xdb9f4c(0x2f1)]&&!_0x5c666d[_0xdb9f4c(0x1ad)]&&!_0x5c666d[_0xdb9f4c(0x2c4)]&&!_0x5c666d[_0xdb9f4c(0x388)])return console[_0xdb9f4c(0x33f)](a31_0x5de0bb['red'](_0xdb9f4c(0x381))),console[_0xdb9f4c(0x33f)](_0xdb9f4c(0x250)),console[_0xdb9f4c(0x33f)](_0xdb9f4c(0x36b)),console[_0xdb9f4c(0x33f)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console['error'](_0xdb9f4c(0x22e)),console[_0xdb9f4c(0x33f)](_0xdb9f4c(0x2b9)),console[_0xdb9f4c(0x33f)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x18523a=resolveYamlFile(_0x5f512c);if(!existsSync(_0x18523a))return showFileNotFoundError(_0x18523a,_0x5f512c),0x1;_0x5c666d[_0xdb9f4c(0x29d)]&&(console['error']('Site:\x20'+_0x5c666d[_0xdb9f4c(0x362)]),console['error']('YAML\x20file:\x20'+_0x18523a));let _0x2a0e0a;try{_0x2a0e0a=readFileSync(_0x18523a,_0xdb9f4c(0x1f8));}catch(_0x436c5d){const _0x4e9b8b=_0x436c5d instanceof Error?_0x436c5d['message']:String(_0x436c5d);return console[_0xdb9f4c(0x33f)](_0xdb9f4c(0x340)+_0x4e9b8b),0x1;}let _0x567ccf;try{_0x567ccf=parseDef(_0x2a0e0a);}catch(_0x11e700){const _0x11f0b4=_0x11e700 instanceof Error?_0x11e700[_0xdb9f4c(0x26f)]:String(_0x11e700);return console[_0xdb9f4c(0x33f)](a31_0x5de0bb['red'](_0xdb9f4c(0x29a)+_0x11f0b4)),0x1;}if(_0x5c666d[_0xdb9f4c(0x1ad)]===!![]||_0x5c666d[_0xdb9f4c(0x1ad)]===''){const _0x56170e=_0x567ccf[_0xdb9f4c(0x19c)]?.[_0xdb9f4c(0x2d5)](_0xa16ed1=>_0xa16ed1[_0xdb9f4c(0x284)])||[];if(_0x56170e[_0xdb9f4c(0x2ef)]===0x0)console['error'](a31_0x5de0bb[_0xdb9f4c(0x2b6)](_0xdb9f4c(0x221)));else{console[_0xdb9f4c(0x33f)](a31_0x5de0bb[_0xdb9f4c(0x2b6)](_0xdb9f4c(0x337))),console[_0xdb9f4c(0x33f)](_0xdb9f4c(0x206));for(const _0x366a89 of _0x56170e){console[_0xdb9f4c(0x33f)]('\x20\x20'+a31_0x5de0bb[_0xdb9f4c(0x348)](_0x366a89));}console[_0xdb9f4c(0x33f)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x5f512c+'\x20--attribute\x20\x22'+_0x56170e[0x0]+'\x22');}return 0x1;}if(_0x5c666d[_0xdb9f4c(0x2c4)]===!![]||_0x5c666d[_0xdb9f4c(0x2c4)]===''){const _0x25ae25=_0x567ccf[_0xdb9f4c(0x1f1)]?.[_0xdb9f4c(0x2d5)](_0xa6d5f8=>_0xa6d5f8[_0xdb9f4c(0x284)])||[];if(_0x25ae25[_0xdb9f4c(0x2ef)]===0x0)console[_0xdb9f4c(0x33f)](a31_0x5de0bb[_0xdb9f4c(0x2b6)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0xdb9f4c(0x33f)](a31_0x5de0bb[_0xdb9f4c(0x2b6)](_0xdb9f4c(0x30e))),console[_0xdb9f4c(0x33f)](_0xdb9f4c(0x37e));for(const _0xabe4da of _0x25ae25){console[_0xdb9f4c(0x33f)]('\x20\x20'+a31_0x5de0bb[_0xdb9f4c(0x348)](_0xabe4da));}console[_0xdb9f4c(0x33f)](_0xdb9f4c(0x1ec)+_0x5f512c+_0xdb9f4c(0x2bc)+_0x25ae25[0x0]+'\x22');}return 0x1;}const _0x49b03c=createCommandSpinner(a31_0x5de0bb['dim'](_0xdb9f4c(0x189)),{'verbose':_0x5c666d['verbose']});_0x49b03c[_0xdb9f4c(0x251)]();const _0x1069f6={'onProgress':_0x1b4ece=>{const _0x167859=_0xdb9f4c;_0x49b03c[_0x167859(0x333)]=formatProgressMessage(_0x1b4ece);}};if(_0x5c666d[_0xdb9f4c(0x2f1)])_0x1069f6['master']=!![];if(_0x5c666d[_0xdb9f4c(0x1ad)]&&typeof _0x5c666d[_0xdb9f4c(0x1ad)]===_0xdb9f4c(0x359))_0x1069f6[_0xdb9f4c(0x1ad)]=_0x5c666d[_0xdb9f4c(0x1ad)];if(_0x5c666d[_0xdb9f4c(0x2c4)]&&typeof _0x5c666d['behavior']===_0xdb9f4c(0x359))_0x1069f6[_0xdb9f4c(0x2c4)]=_0x5c666d[_0xdb9f4c(0x2c4)];if(_0x5c666d[_0xdb9f4c(0x388)])_0x1069f6[_0xdb9f4c(0x388)]=!![];if(_0x5c666d['interval'])_0x1069f6[_0xdb9f4c(0x21d)]=_0x5c666d[_0xdb9f4c(0x21d)];let _0x230b90;try{_0x230b90=await _0x2038a3['segment'][_0xdb9f4c(0x318)](_0x2a0e0a,_0x1069f6),_0x49b03c[_0xdb9f4c(0x209)]();}catch(_0x56d791){_0x49b03c[_0xdb9f4c(0x209)]();throw _0x56d791;}return await this[_0xdb9f4c(0x203)](_0x230b90,{'master':_0x5c666d['master'],'attribute':typeof _0x5c666d['attribute']==='string'?_0x5c666d[_0xdb9f4c(0x1ad)]:undefined,'behavior':typeof _0x5c666d[_0xdb9f4c(0x2c4)]===_0xdb9f4c(0x359)?_0x5c666d['behavior']:undefined,'enriched':_0x5c666d[_0xdb9f4c(0x388)]}),_0x230b90[_0xdb9f4c(0x227)]?0x0:0x1;}async[a31_0x4fe4c9(0x203)](_0xdfb97b,_0x253b28){const _0x3a70be=a31_0x4fe4c9;console[_0x3a70be(0x33f)]('\x0a'+a31_0x5de0bb['bold'](_0x3a70be(0x185))+'\x20'+_0xdfb97b[_0x3a70be(0x284)]),console[_0x3a70be(0x33f)]('═'[_0x3a70be(0x38d)](0x3c));if(_0x253b28[_0x3a70be(0x2f1)]&&_0xdfb97b[_0x3a70be(0x254)]){const _0x287ce0=a31_0x5de0bb[_0x3a70be(0x1fd)]('Master:')+'\x20'+a31_0x5de0bb[_0x3a70be(0x1d3)](_0xdfb97b[_0x3a70be(0x2f1)][_0x3a70be(0x307)]+'.'+_0xdfb97b['master'][_0x3a70be(0x2fd)]);await this[_0x3a70be(0x295)](_0x287ce0,_0xdfb97b[_0x3a70be(0x254)]);}else{if(_0x253b28[_0x3a70be(0x1ad)]&&_0xdfb97b['sampleData']){const _0x4f9ad3=a31_0x5de0bb[_0x3a70be(0x1fd)](_0x3a70be(0x1e4))+'\x20'+a31_0x5de0bb['bold'](_0x253b28[_0x3a70be(0x1ad)]);await this['displaySampleData'](_0x4f9ad3,_0xdfb97b['sampleData']);}else{if(_0x253b28[_0x3a70be(0x2c4)]&&_0xdfb97b['sampleData']){const _0x3dcdb4=a31_0x5de0bb['dim'](_0x3a70be(0x30f))+'\x20'+a31_0x5de0bb[_0x3a70be(0x1d3)](_0x253b28[_0x3a70be(0x2c4)]);await this[_0x3a70be(0x295)](_0x3dcdb4,_0xdfb97b['sampleData']);}else{if(_0x253b28[_0x3a70be(0x388)]&&_0xdfb97b[_0x3a70be(0x254)]){const _0x5318ba=a31_0x5de0bb[_0x3a70be(0x1fd)]('Enriched:')+'\x20'+a31_0x5de0bb[_0x3a70be(0x1d3)](_0x3a70be(0x2bf));await this[_0x3a70be(0x295)](_0x5318ba,_0xdfb97b[_0x3a70be(0x254)]);}else!_0xdfb97b[_0x3a70be(0x254)]&&console[_0x3a70be(0x33f)](_0x3a70be(0x1ca));}}}if(_0xdfb97b[_0x3a70be(0x2ca)]['length']>0x0){console['error']('─'[_0x3a70be(0x38d)](0x3c)),console[_0x3a70be(0x33f)]('\x0a'+a31_0x5de0bb['red']('Errors:'));for(const _0x1e0c9d of _0xdfb97b[_0x3a70be(0x2ca)]){console['error']('\x20\x20'+a31_0x5de0bb['red']('•')+'\x20'+_0x1e0c9d);}}}async[a31_0x4fe4c9(0x295)](_0x164cd0,_0x58d125){const _0x1eed2a=a31_0x4fe4c9;if(_0x58d125[_0x1eed2a(0x2ef)]===0x0){console[_0x1eed2a(0x33f)]('\x0a'+_0x164cd0),console['error'](_0x1eed2a(0x2be));return;}console[_0x1eed2a(0x33f)]('\x0a'+_0x164cd0);const _0xfec93e=Object[_0x1eed2a(0x233)](_0x58d125[0x0])[_0x1eed2a(0x2d5)](_0x355279=>({'name':_0x355279,'type':typeof _0x58d125[0x0][_0x355279]==='number'?_0x1eed2a(0x1c4):'varchar'})),_0x2ac59d={'queryId':_0x1eed2a(0x31b),'columns':_0xfec93e,'data':_0x58d125,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x58d125['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x1e66a2=formatAsTable(_0x2ac59d,_0x58d125[_0x1eed2a(0x2ef)],!![]);await writeOutput(_0x1e66a2,undefined,_0x1eed2a(0x2fd));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x288);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x270);async['execute'](_0x465775){const _0xa1e3f8=a31_0x4fe4c9,{options:_0x2c2f39,args:_0x124188,tdx:_0x450504}=_0x465775,_0x1b5920=_0x2c2f39,_0x309f48=_0x124188[0x0]||_0x2c2f39[_0xa1e3f8(0x301)];if(!_0x309f48)return showParentSegmentNotSetError(_0xa1e3f8(0x2bb)+_0xa1e3f8(0x373)),0x1;const _0x131d7a=resolveYamlFile(_0x309f48);if(existsSync(_0x131d7a)){_0x1b5920[_0xa1e3f8(0x29d)]&&console[_0xa1e3f8(0x33f)](_0xa1e3f8(0x2b4)+_0x131d7a);let _0x3af91e;try{_0x3af91e=readFileSync(_0x131d7a,'utf-8');}catch(_0x5060e3){const _0x320aea=_0x5060e3 instanceof Error?_0x5060e3[_0xa1e3f8(0x26f)]:String(_0x5060e3);return console[_0xa1e3f8(0x33f)]('Error\x20reading\x20file:\x20'+_0x320aea),0x1;}const _0x4d3fb4=await withSpinner(_0xa1e3f8(0x228),()=>_0x450504['segment'][_0xa1e3f8(0x392)](_0x3af91e),{'verbose':_0x1b5920[_0xa1e3f8(0x29d)]}),_0x18ffc0=_0x4d3fb4[_0xa1e3f8(0x268)],{isNew:_0x4c0cee,name:_0x579bb9,hasChanges:_0x5651d0,diffFormatted:_0x19904d}=_0x18ffc0;if(_0x5651d0){_0x4c0cee?console[_0xa1e3f8(0x33f)](_0xa1e3f8(0x386)+_0x579bb9+'\x27:'):console[_0xa1e3f8(0x33f)](_0xa1e3f8(0x397)+_0x579bb9+'\x27:');console[_0xa1e3f8(0x33f)]('─'[_0xa1e3f8(0x38d)](0x3c)),console[_0xa1e3f8(0x33f)](_0x19904d),console[_0xa1e3f8(0x33f)]('─'[_0xa1e3f8(0x38d)](0x3c));const _0x12ab01=_0x4c0cee?_0xa1e3f8(0x39d)+_0x579bb9+_0xa1e3f8(0x309):'Apply\x20changes\x20to\x20\x27'+_0x579bb9+_0xa1e3f8(0x309);if(!_0x1b5920[_0xa1e3f8(0x280)]){if(!isInteractive())return console[_0xa1e3f8(0x33f)](a31_0x5de0bb[_0xa1e3f8(0x2b6)](_0xa1e3f8(0x23b)),_0xa1e3f8(0x33e)),console['error'](a31_0x5de0bb[_0xa1e3f8(0x1fd)](_0xa1e3f8(0x223))),0x1;const _0x1d9daa=await confirmKey(_0x12ab01);if(!_0x1d9daa)return console[_0xa1e3f8(0x33f)](a31_0x5de0bb[_0xa1e3f8(0x1a0)](_0xa1e3f8(0x310))),0x1;}const _0x3e6517=_0x4c0cee?_0xa1e3f8(0x20f):_0xa1e3f8(0x36d);await withSpinner(_0x3e6517+_0xa1e3f8(0x2d7)+_0x579bb9+_0xa1e3f8(0x32f),()=>_0x18ffc0[_0xa1e3f8(0x25e)](),{'verbose':_0x1b5920[_0xa1e3f8(0x29d)]});const _0x3a455e=_0x4c0cee?_0xa1e3f8(0x1a7):_0xa1e3f8(0x380);console[_0xa1e3f8(0x33f)]('✔\x20'+_0x3a455e+_0xa1e3f8(0x2d7)+_0x579bb9+'\x27');}else console[_0xa1e3f8(0x33f)](_0xa1e3f8(0x336)+_0x579bb9+'\x27\x20is\x20up\x20to\x20date');}const _0x19abe0=await withSpinner(_0xa1e3f8(0x1d9)+_0x309f48+'\x27...',()=>_0x450504[_0xa1e3f8(0x1f3)][_0xa1e3f8(0x2b8)](_0x309f48),{'verbose':_0x1b5920[_0xa1e3f8(0x29d)]}),_0x4d4dbe=_0x19abe0['data'],_0x4f81da=getConsoleUrl(_0x1b5920['site'],'/app/workflows/'+_0x4d4dbe[_0xa1e3f8(0x390)]+'/sessions/'+_0x4d4dbe[_0xa1e3f8(0x26a)]+_0xa1e3f8(0x289)+_0x4d4dbe[_0xa1e3f8(0x25f)]);return console[_0xa1e3f8(0x33f)](_0xa1e3f8(0x282)),console[_0xa1e3f8(0x33f)]('\x20\x20'+a31_0x5de0bb[_0xa1e3f8(0x1fd)](_0xa1e3f8(0x193))+'\x20'+_0x4d4dbe['audienceId']),console[_0xa1e3f8(0x33f)]('\x20\x20'+a31_0x5de0bb[_0xa1e3f8(0x1fd)](_0xa1e3f8(0x1ed))+'\x20'+_0x4d4dbe['status']),console[_0xa1e3f8(0x33f)]('\x20\x20'+a31_0x5de0bb[_0xa1e3f8(0x1fd)](_0xa1e3f8(0x26d))+'\x20'+_0x4d4dbe[_0xa1e3f8(0x26a)]),console[_0xa1e3f8(0x33f)]('\x20\x20'+a31_0x5de0bb['dim'](_0xa1e3f8(0x2d3))+'\x20'+_0x4d4dbe['workflowAttemptId']),console['error']('\x20\x20'+_0x4f81da),console['error']('\x0a'+a31_0x5de0bb[_0xa1e3f8(0x1fd)](_0xa1e3f8(0x21a))+_0xa1e3f8(0x1cf)+_0x4d4dbe[_0xa1e3f8(0x25f)]+_0xa1e3f8(0x2e7)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]='segment:parent:fields';[a31_0x4fe4c9(0x1ff)]='List\x20available\x20fields\x20for\x20segmentation';async[a31_0x4fe4c9(0x33b)](_0x2d53e2){const _0x5a716a=a31_0x4fe4c9,{options:_0x1cce62,args:_0x7932e8,tdx:_0x1bdca2}=_0x2d53e2,_0x147fc3=_0x7932e8[0x0]||_0x1cce62['parentSegment'];if(!_0x147fc3)return showParentSegmentNotSetError(_0x5a716a(0x22d)+_0x5a716a(0x1db)),0x1;_0x1cce62[_0x5a716a(0x29d)]&&(console[_0x5a716a(0x33f)](_0x5a716a(0x1ce)+_0x1cce62[_0x5a716a(0x362)]),console[_0x5a716a(0x33f)]('Parent\x20segment:\x20'+_0x147fc3));const _0x234f40=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x147fc3+'\x27...',()=>_0x1bdca2[_0x5a716a(0x1f3)]['listFields'](_0x147fc3),{'verbose':_0x1cce62[_0x5a716a(0x29d)]}),_0x1fdf2e=_0x234f40[_0x5a716a(0x268)];console['error'](_0x5a716a(0x194)+_0x1fdf2e[_0x5a716a(0x2ef)]+_0x5a716a(0x226)+(_0x1fdf2e[_0x5a716a(0x2ef)]!==0x1?'s':''));if(_0x1cce62[_0x5a716a(0x1ba)]||_0x1cce62[_0x5a716a(0x382)])return await handleSDKOutput(_0x1fdf2e,_0x1cce62),0x0;return displayFieldsHumanReadable(_0x1fdf2e,_0x147fc3),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]='segment:parent:view';[a31_0x4fe4c9(0x1ff)]='Show\x20parent\x20segment\x20details';async[a31_0x4fe4c9(0x33b)](_0x4dc8b7){const _0xf10ab=a31_0x4fe4c9,{options:_0x22f109,args:_0x10a6dc,tdx:_0x5d807a}=_0x4dc8b7,_0xc63aff=_0x22f109,_0x3247d2=_0x10a6dc[0x0]||_0x22f109[_0xf10ab(0x301)];if(!_0x3247d2)return showParentSegmentNotSetError(_0xf10ab(0x2a0)+_0xf10ab(0x2da)+_0xf10ab(0x338)+_0xf10ab(0x396)),0x1;_0x22f109[_0xf10ab(0x29d)]&&(console[_0xf10ab(0x33f)](_0xf10ab(0x1ce)+_0x22f109[_0xf10ab(0x362)]),console[_0xf10ab(0x33f)](_0xf10ab(0x235)+_0x3247d2));const _0x363488=await withSpinner(_0xf10ab(0x31f)+_0x3247d2+_0xf10ab(0x32f),()=>_0x5d807a[_0xf10ab(0x1f3)][_0xf10ab(0x379)](_0x3247d2),{'verbose':_0x22f109['verbose']}),_0x9fa95e=_0x363488[_0xf10ab(0x268)];if(_0xc63aff[_0xf10ab(0x2b0)]){const _0x4c9c1d=getConsoleNextUrl(_0xc63aff[_0xf10ab(0x362)],'/app/dw/parentSegments/'+_0x9fa95e['id']);return console['error'](a31_0x5de0bb[_0xf10ab(0x25a)]('✔')+_0xf10ab(0x352)+a31_0x5de0bb['cyan'](_0x4c9c1d)),openBrowser(_0x4c9c1d),0x0;}return await handleSingleObjectOutput(_0x9fa95e,_0x22f109),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a31_0x4fe4c9(0x343);['description']=a31_0x4fe4c9(0x375);async['execute'](_0x1abe78){const _0x3c8285=a31_0x4fe4c9,{options:_0x44e051,args:_0x55475a,tdx:_0x1001f6}=_0x1abe78,_0x578602=_0x44e051,_0x447d2b=_0x55475a[0x0]||_0x44e051[_0x3c8285(0x301)];if(!_0x447d2b)return showParentSegmentNotSetError('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'+_0x3c8285(0x24f)+_0x3c8285(0x338)+_0x3c8285(0x356)),0x1;_0x44e051[_0x3c8285(0x29d)]&&(console[_0x3c8285(0x33f)](_0x3c8285(0x1ce)+_0x44e051[_0x3c8285(0x362)]),console[_0x3c8285(0x33f)]('Parent\x20segment:\x20'+_0x447d2b));const _0x3b4401=await withSpinner(_0x3c8285(0x29e)+_0x447d2b+_0x3c8285(0x32f),()=>_0x1001f6[_0x3c8285(0x1f3)][_0x3c8285(0x187)](_0x447d2b),{'verbose':_0x44e051[_0x3c8285(0x29d)]}),_0x3d5368=_0x3b4401['data'],_0x322541=_0x1001f6[_0x3c8285(0x1f3)][_0x3c8285(0x244)](_0x3d5368);if(_0x578602[_0x3c8285(0x399)]){const _0x13c21b=await this['collectSchema'](_0x1abe78,_0x447d2b,_0x3d5368,_0x322541),_0x286072=this[_0x3c8285(0x26e)](_0x13c21b);writeFileSync(_0x578602['output'],_0x286072);const _0xbb11e0=_0x13c21b['customers'][_0x3c8285(0x210)]['length']+_0x13c21b['behaviors']['reduce']((_0x521793,_0x3b36de)=>_0x521793+_0x3b36de[_0x3c8285(0x210)][_0x3c8285(0x2ef)],0x0),_0x52a54e=_0x13c21b[_0x3c8285(0x1f1)]['filter'](_0x2df9cb=>_0x2df9cb[_0x3c8285(0x210)][_0x3c8285(0x2ef)]===0x0)[_0x3c8285(0x2ef)];return console[_0x3c8285(0x1e6)](_0x3c8285(0x274)+_0x578602[_0x3c8285(0x399)]),console['log'](_0x3c8285(0x2e3)+_0x322541),console['log'](_0x3c8285(0x1b5)+_0x13c21b[_0x3c8285(0x1f1)][_0x3c8285(0x2ef)]+'\x20behaviors'),console[_0x3c8285(0x1e6)](_0x3c8285(0x370)+_0xbb11e0+_0x3c8285(0x20d)),_0x52a54e>0x0&&console[_0x3c8285(0x1e6)](_0x3c8285(0x2d0)+_0x52a54e+_0x3c8285(0x269)),0x0;}console[_0x3c8285(0x33f)]('\x0a'+a31_0x5de0bb[_0x3c8285(0x1d3)](_0x3c8285(0x38c))+'\x20'+a31_0x5de0bb['cyan'](_0x322541));const _0x360ee1=await withSpinner(_0x3c8285(0x349),()=>_0x1001f6[_0x3c8285(0x1f3)]['getParentSQL'](_0x3d5368),{'verbose':_0x44e051[_0x3c8285(0x29d)]});console[_0x3c8285(0x33f)]('\x0a'+a31_0x5de0bb[_0x3c8285(0x1d3)]('customers')+'\x20'+a31_0x5de0bb[_0x3c8285(0x1fd)]('('+_0x322541+'.customers)'));const _0x46c165=await executeSchemaQuery(_0x360ee1['data'],_0x1001f6,_0x44e051);await handleQueryOutput(_0x46c165,_0x44e051);const _0x1719b4=await withSpinner(_0x3c8285(0x312),()=>_0x1001f6[_0x3c8285(0x1f3)][_0x3c8285(0x286)](_0x3d5368),{'verbose':_0x44e051[_0x3c8285(0x29d)]});for(const _0x530a76 of _0x1719b4[_0x3c8285(0x268)]){const _0x2e2a82=_0x3c8285(0x1ee)+_0x530a76[_0x3c8285(0x212)]()['replace'](/\s+/g,'_'),_0x2ddc59=_0x3c8285(0x36c)+_0x322541+'.'+_0x2e2a82;console[_0x3c8285(0x33f)]('\x0a'+a31_0x5de0bb[_0x3c8285(0x1d3)](_0x530a76)+'\x20'+a31_0x5de0bb[_0x3c8285(0x1fd)]('('+_0x322541+'.'+_0x2e2a82+')'));try{const _0x59d6eb=await executeSchemaQuery(_0x2ddc59,_0x1001f6,_0x44e051);await handleQueryOutput(_0x59d6eb,_0x44e051);}catch{console[_0x3c8285(0x33f)](a31_0x5de0bb[_0x3c8285(0x1a0)](_0x3c8285(0x1c0)));}}return 0x0;}async['collectSchema'](_0x5f20bd,_0x597a18,_0x5970f5,_0x24c04f){const _0xed0213=a31_0x4fe4c9,{options:_0x4a40a4,tdx:_0x38334b}=_0x5f20bd,_0xd056a3=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x38334b[_0xed0213(0x1f3)][_0xed0213(0x324)](_0x5970f5),{'verbose':_0x4a40a4[_0xed0213(0x29d)]}),_0x3a3f8c=await executeSchemaQuery(_0xd056a3[_0xed0213(0x268)],_0x38334b,_0x4a40a4),_0x10def3=_0x3a3f8c[_0xed0213(0x268)][_0xed0213(0x2d5)](_0x27e5cb=>({'name':_0x27e5cb[_0xed0213(0x383)],'type':_0x27e5cb['column_type']})),_0x55cda7=await withSpinner(_0xed0213(0x312),()=>_0x38334b[_0xed0213(0x1f3)][_0xed0213(0x286)](_0x5970f5),{'verbose':_0x4a40a4[_0xed0213(0x29d)]}),_0x35c141=[];for(const _0x27d059 of _0x55cda7['data']){const _0x5de15c=_0xed0213(0x1ee)+_0x27d059[_0xed0213(0x212)]()[_0xed0213(0x305)](/\s+/g,'_'),_0x4ec566=_0xed0213(0x36c)+_0x24c04f+'.'+_0x5de15c;let _0x1c29ca=[];try{const _0x1949a9=await executeSchemaQuery(_0x4ec566,_0x38334b,_0x4a40a4);_0x1c29ca=_0x1949a9['data'][_0xed0213(0x2d5)](_0x43e090=>({'name':_0x43e090['column_name'],'type':_0x43e090['column_type']}));}catch{}_0x35c141[_0xed0213(0x1d1)]({'table':_0x5de15c,'columns':_0x1c29ca});}return{'database':_0x24c04f,'parent_segment':_0x597a18,'parent_id':_0x5970f5,'customers':{'table':'customers','columns':_0x10def3},'behaviors':_0x35c141};}['formatSchemaJson'](_0x4794b8){const _0x5a8255=a31_0x4fe4c9,_0x354090=_0x28767f=>{const _0x1bffc8=a31_0x224f;if(_0x28767f[_0x1bffc8(0x2ef)]===0x0)return'[]';const _0x1da950=_0x28767f['map'](_0x1dbc48=>_0x1bffc8(0x334)+_0x1dbc48['name']+_0x1bffc8(0x19b)+_0x1dbc48[_0x1bffc8(0x182)]+_0x1bffc8(0x1e2));return'[\x0a'+_0x1da950[_0x1bffc8(0x39a)](',\x0a')+_0x1bffc8(0x215);},_0x333311=_0x4794b8[_0x5a8255(0x1f1)][_0x5a8255(0x2d5)](_0x370da0=>{const _0x9df362=_0x5a8255;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x370da0[_0x9df362(0x2fd)]+_0x9df362(0x300)+_0x354090(_0x370da0[_0x9df362(0x210)])['replace'](/^/gm,'\x20\x20')['trim']()+_0x9df362(0x21f);})[_0x5a8255(0x39a)](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x4794b8[_0x5a8255(0x307)]+_0x5a8255(0x2f9)+_0x4794b8[_0x5a8255(0x188)]+_0x5a8255(0x26b)+_0x4794b8[_0x5a8255(0x2ae)]+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x4794b8[_0x5a8255(0x1c7)][_0x5a8255(0x2fd)]+_0x5a8255(0x245)+_0x354090(_0x4794b8[_0x5a8255(0x1c7)][_0x5a8255(0x210)])[_0x5a8255(0x305)](/^/gm,'\x20\x20')[_0x5a8255(0x257)]()+_0x5a8255(0x199)+_0x333311+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x2e6);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x18c);async[a31_0x4fe4c9(0x33b)](_0x5d2ee9){const _0x312237=a31_0x4fe4c9,{options:_0xd1553a,args:_0x97ea73,tdx:_0x3d2fdd}=_0x5d2ee9,_0x4c032f=_0x97ea73[0x0]||_0xd1553a['parentSegment'];if(!_0x4c032f)return showParentSegmentNotSetError(_0x312237(0x2ad)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0xd1553a[_0x312237(0x29d)]&&(console['error'](_0x312237(0x1ce)+_0xd1553a[_0x312237(0x362)]),console[_0x312237(0x33f)](_0x312237(0x235)+_0x4c032f));const _0x4d0ab6=await withSpinner(_0x312237(0x29e)+_0x4c032f+_0x312237(0x32f),()=>_0x3d2fdd[_0x312237(0x1f3)][_0x312237(0x187)](_0x4c032f),{'verbose':_0xd1553a[_0x312237(0x29d)]}),_0x1507df=_0x4d0ab6[_0x312237(0x268)],_0x59110b=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x4c032f+_0x312237(0x32f),()=>_0x3d2fdd[_0x312237(0x1f3)]['getParentSQL'](_0x1507df),{'verbose':_0xd1553a[_0x312237(0x29d)]}),_0x1624b3=_0x59110b['data'];return _0xd1553a[_0x312237(0x1dd)]==='json'||_0xd1553a[_0x312237(0x1dd)]===_0x312237(0x382)?await handleSDKOutput([{'sql':_0x1624b3}],_0xd1553a):console[_0x312237(0x1e6)](_0x1624b3),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x27d);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x27b);async[a31_0x4fe4c9(0x33b)](_0x5a2a1d){const _0x1df029=a31_0x4fe4c9,{options:_0x505f92,args:_0x3f61c8,tdx:_0x384c73}=_0x5a2a1d,_0x3fcce2=_0x3f61c8[0x0]||_0x505f92['parentSegment'];if(!_0x3fcce2)return showParentSegmentNotSetError(_0x1df029(0x371)+_0x1df029(0x1b7)),0x1;_0x505f92[_0x1df029(0x29d)]&&(console['error']('Site:\x20'+_0x505f92[_0x1df029(0x362)]),console[_0x1df029(0x33f)](_0x1df029(0x235)+_0x3fcce2));const _0x4703d2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3fcce2+_0x1df029(0x32f),()=>_0x384c73[_0x1df029(0x1f3)][_0x1df029(0x187)](_0x3fcce2),{'verbose':_0x505f92[_0x1df029(0x29d)]}),_0x335e61=_0x4703d2[_0x1df029(0x268)],_0x2179ae=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x3fcce2+'\x27...',()=>_0x384c73[_0x1df029(0x1f3)][_0x1df029(0x324)](_0x335e61),{'verbose':_0x505f92[_0x1df029(0x29d)]});let _0x55b5ff=_0x2179ae[_0x1df029(0x268)];const _0x2c9e4e=resolveLimit(_0x505f92[_0x1df029(0x21b)],DEFAULT_DISPLAY_LIMIT),_0x176d22=/\bLIMIT\s+\d+/i[_0x1df029(0x35e)](_0x55b5ff);!_0x176d22&&(_0x55b5ff=_0x55b5ff['trim']()[_0x1df029(0x305)](/;+$/,''),_0x55b5ff=_0x1df029(0x39f)+_0x55b5ff+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x2c9e4e);_0x505f92[_0x1df029(0x29d)]&&console[_0x1df029(0x33f)](_0x1df029(0x20b)+_0x55b5ff);const _0x47eaed=await withProgressSpinner(_0x1df029(0x38b),async _0x18866d=>{const _0x12cc4e=_0x1df029,_0x8dd084=await _0x384c73['query']['execute'](_0x55b5ff,{'catalog':'td','schema':_0x12cc4e(0x1e1),'onJobId':_0x69321c=>{const _0x543d9c=_0x12cc4e;_0x18866d[_0x543d9c(0x294)](_0x69321c);}});return _0x8dd084;},{'verbose':_0x505f92[_0x1df029(0x29d)]}),_0x3569c0=_0x47eaed[_0x1df029(0x268)],_0xd7061d=_0x3569c0['jobId']?_0x1df029(0x20e)+_0x3569c0['jobId']+']':'';return console[_0x1df029(0x33f)](_0x1df029(0x246)+_0x3569c0[_0x1df029(0x1ac)][_0x1df029(0x18a)][_0x1df029(0x1a4)]()+_0x1df029(0x374)+(_0x1df029(0x1ab)+formatElapsed(_0x3569c0[_0x1df029(0x1ac)][_0x1df029(0x321)])+_0xd7061d)),await handleQueryOutput(_0x3569c0,_0x505f92),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]='ps:rt:list';[a31_0x4fe4c9(0x1ff)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async['execute'](_0x8c54d6){const _0x28ba23=a31_0x4fe4c9,{options:_0x49a47a,args:_0x32be4d,tdx:_0x27f45a}=_0x8c54d6,_0x35f900=_0x32be4d[0x0],_0x41cf91=await withSpinner(_0x35f900?'Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27'+_0x35f900+'\x27...':'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x27f45a[_0x28ba23(0x20a)][_0x28ba23(0x19a)](),{'verbose':_0x49a47a['verbose']});let _0x328b4f=_0x41cf91[_0x28ba23(0x268)][_0x28ba23(0x24e)](_0x3ecef0=>_0x3ecef0[_0x28ba23(0x28d)]);if(_0x35f900){const _0x4637c9=_0x35f900[_0x28ba23(0x305)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x28ba23(0x305)](/\*/g,'.*')[_0x28ba23(0x305)](/\?/g,'.'),_0x2bdd9b=new RegExp('^'+_0x4637c9+'$','i');_0x328b4f=_0x328b4f[_0x28ba23(0x24e)](_0x1f3beb=>_0x2bdd9b[_0x28ba23(0x35e)](_0x1f3beb[_0x28ba23(0x284)]));}_0x328b4f[_0x28ba23(0x32a)]((_0x4c4deb,_0x5db351)=>_0x4c4deb[_0x28ba23(0x284)][_0x28ba23(0x237)](_0x5db351[_0x28ba23(0x284)])),console[_0x28ba23(0x33f)](_0x28ba23(0x194)+_0x328b4f[_0x28ba23(0x2ef)]+_0x28ba23(0x1c2)+(_0x328b4f[_0x28ba23(0x2ef)]!==0x1?'s':''));const _0x257503=_0x30c607=>{const _0x2f9559=_0x28ba23;return getConsoleNextUrl(_0x49a47a[_0x2f9559(0x362)],_0x2f9559(0x2cc)+_0x30c607);};if(_0x49a47a[_0x28ba23(0x1dd)]===_0x28ba23(0x1ba)||_0x49a47a['format']==='jsonl'){const _0x293970=_0x328b4f['map'](_0x2b7c72=>({..._0x2b7c72,'url':_0x257503(_0x2b7c72['id'])}));await handleSDKOutput(_0x293970,_0x49a47a);}else{if(_0x328b4f[_0x28ba23(0x2ef)]===0x0)console['log'](_0x28ba23(0x39c));else for(const _0x3d5a52 of _0x328b4f){const _0x5f277a=_0x3d5a52['population']?a31_0x5de0bb[_0x28ba23(0x1fd)]('\x20('+formatRows(_0x3d5a52[_0x28ba23(0x2d2)])+')'):'',_0x48499b=hyperlink(_0x3d5a52[_0x28ba23(0x284)],_0x257503(_0x3d5a52['id']));console['log']('⚡\x20'+_0x48499b+_0x5f277a);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x4fe4c9(0x264);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x1d7);async['execute'](_0x51c6e0){const _0x56754b=a31_0x4fe4c9,{options:_0x361756,args:_0x2da941,tdx:_0x211fc7}=_0x51c6e0,_0x1ea20e=_0x2da941[0x0]||_0x361756[_0x56754b(0x301)];if(!_0x1ea20e)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a'+_0x56754b(0x2eb)),0x1;const _0x45b2a6=resolveYamlFile(_0x1ea20e);if(!existsSync(_0x45b2a6))return showFileNotFoundError(_0x45b2a6,_0x1ea20e),0x1;let _0x14c919;try{_0x14c919=readFileSync(_0x45b2a6,'utf-8');}catch(_0xe7e6ac){const _0x5b9728=_0xe7e6ac instanceof Error?_0xe7e6ac[_0x56754b(0x26f)]:String(_0xe7e6ac);return console[_0x56754b(0x33f)](_0x56754b(0x340)+_0x5b9728),0x1;}const _0x398b18=createCommandSpinner(a31_0x5de0bb[_0x56754b(0x1fd)](_0x56754b(0x2f7)),{'verbose':_0x361756[_0x56754b(0x29d)]});_0x398b18[_0x56754b(0x251)]();const _0x195f78={'realtime':!![],'onProgress':_0x4fe5d4=>{const _0x1d4b1c=_0x56754b;_0x398b18[_0x1d4b1c(0x333)]=formatProgressMessage(_0x4fe5d4);}};let _0x250bc2;try{_0x250bc2=await _0x211fc7[_0x56754b(0x1f3)][_0x56754b(0x299)](_0x14c919,_0x195f78),_0x398b18[_0x56754b(0x209)]();}catch(_0x1365f6){_0x398b18[_0x56754b(0x209)]();throw _0x1365f6;}console['error']('\x0a'+a31_0x5de0bb[_0x56754b(0x1d3)](_0x56754b(0x283))+'\x20'+_0x250bc2[_0x56754b(0x284)]),console['error']('═'['repeat'](0x3c)),displayRealtimeValidation(_0x250bc2),console[_0x56754b(0x33f)]('─'['repeat'](0x3c));if(_0x250bc2['errors'][_0x56754b(0x2ef)]>0x0){console[_0x56754b(0x33f)]('\x0a'+a31_0x5de0bb['red']('Errors:'));for(const _0x2fa670 of _0x250bc2[_0x56754b(0x2ca)]){console[_0x56754b(0x33f)]('\x20\x20'+a31_0x5de0bb[_0x56754b(0x2b6)]('•')+'\x20'+_0x2fa670);}}return _0x250bc2[_0x56754b(0x227)]&&console[_0x56754b(0x33f)]('\x0a'+a31_0x5de0bb[_0x56754b(0x25a)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x250bc2['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x1bf);['description']=a31_0x4fe4c9(0x32d);async['execute'](_0x55a87e){const _0x458157=a31_0x4fe4c9,{options:_0x56f5e9,args:_0x4a8849,tdx:_0x1a9c31}=_0x55a87e,_0x2f616f=_0x4a8849[0x0]||_0x56f5e9[_0x458157(0x301)];if(!_0x2f616f)return showParentSegmentNotSetError(_0x458157(0x249)+_0x458157(0x31d)),0x1;_0x56f5e9[_0x458157(0x29d)]&&(console[_0x458157(0x33f)](_0x458157(0x1ce)+_0x56f5e9[_0x458157(0x362)]),console['error'](_0x458157(0x235)+_0x2f616f));const _0x49028a=await withSpinner(_0x458157(0x29e)+_0x2f616f+_0x458157(0x32f),()=>_0x1a9c31[_0x458157(0x1f3)][_0x458157(0x187)](_0x2f616f),{'verbose':_0x56f5e9[_0x458157(0x29d)]}),_0x3572bc=_0x49028a[_0x458157(0x268)],_0xca897a=await withSpinner('Listing\x20RT\x20journeys\x20for\x20\x27'+_0x2f616f+'\x27...',()=>_0x1a9c31[_0x458157(0x20a)][_0x458157(0x1c1)](_0x3572bc),{'verbose':_0x56f5e9[_0x458157(0x29d)]}),_0x9e7f95=_0xca897a[_0x458157(0x268)];console[_0x458157(0x33f)](_0x458157(0x194)+_0x9e7f95[_0x458157(0x2ef)]+_0x458157(0x271)+(_0x9e7f95[_0x458157(0x2ef)]!==0x1?'s':''));if(_0x56f5e9['format']===_0x458157(0x1ba)||_0x56f5e9[_0x458157(0x1dd)]===_0x458157(0x382))await handleSDKOutput(_0x9e7f95,_0x56f5e9);else{if(_0x9e7f95['length']===0x0)console[_0x458157(0x1e6)](_0x458157(0x2cd));else for(const _0x15bda6 of _0x9e7f95){const _0x2a7146=_0x15bda6[_0x458157(0x2e0)]===_0x458157(0x24d)?'🚀':'📝',_0xcf5918=_0x15bda6[_0x458157(0x2a4)]?a31_0x5de0bb[_0x458157(0x1a0)]('\x20(paused)'):'',_0x519f55=a31_0x5de0bb[_0x458157(0x1fd)]('\x20('+_0x15bda6[_0x458157(0x27e)]+'\x20stage'+(_0x15bda6['stageCount']!==0x1?'s':'')+')');console['log'](_0x2a7146+'\x20'+_0x15bda6[_0x458157(0x284)]+_0xcf5918+_0x519f55);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x255);['description']=a31_0x4fe4c9(0x327);async[a31_0x4fe4c9(0x33b)](_0xe0ca09){const _0x116385=a31_0x4fe4c9,{options:_0xcf390c,args:_0x2e3777,tdx:_0xa17f6b}=_0xe0ca09,_0x288bd8=_0x2e3777[0x0];if(!_0x288bd8)return console['error'](a31_0x5de0bb[_0x116385(0x2b6)](_0x116385(0x208))),console[_0x116385(0x33f)](_0x116385(0x38f)),console[_0x116385(0x33f)](a31_0x5de0bb['dim'](_0x116385(0x2ee))),0x1;_0xcf390c['verbose']&&(console[_0x116385(0x33f)](_0x116385(0x1ce)+_0xcf390c[_0x116385(0x362)]),console[_0x116385(0x33f)](_0x116385(0x272)+_0x288bd8));const _0x177027=await withSpinner(_0x116385(0x23d)+_0x288bd8+'\x27...',()=>_0xa17f6b['realtime'][_0x116385(0x2b3)](_0x288bd8),{'verbose':_0xcf390c['verbose']}),_0x297bdc=_0x177027[_0x116385(0x268)];console[_0x116385(0x33f)](_0x116385(0x2d9)+_0x297bdc[_0x116385(0x284)]+'\x27');if(_0xcf390c[_0x116385(0x1dd)]===_0x116385(0x1ba)||_0xcf390c[_0x116385(0x1dd)]==='jsonl')await handleSDKOutput([_0x297bdc],_0xcf390c);else{const _0x113245=_0x297bdc[_0x116385(0x2e0)]===_0x116385(0x24d)?'🚀':'📝',_0x2d15d6=_0x297bdc[_0x116385(0x2a4)]?a31_0x5de0bb[_0x116385(0x1a0)](_0x116385(0x320)):'';console['log'](_0x113245+'\x20'+_0x297bdc[_0x116385(0x284)]+_0x2d15d6);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x1a1);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x2a6);async[a31_0x4fe4c9(0x33b)](_0x4a4cd0){const _0x21abf9=a31_0x4fe4c9,{options:_0x339b94,args:_0x39ea9e,tdx:_0x1f8c6a}=_0x4a4cd0,_0x257c5f=_0x39ea9e[0x0];if(!_0x257c5f)return console[_0x21abf9(0x33f)](a31_0x5de0bb['red'](_0x21abf9(0x208))),console['error']('Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a'),console[_0x21abf9(0x33f)](a31_0x5de0bb[_0x21abf9(0x1fd)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x339b94[_0x21abf9(0x29d)]&&(console[_0x21abf9(0x33f)](_0x21abf9(0x1ce)+_0x339b94[_0x21abf9(0x362)]),console[_0x21abf9(0x33f)](_0x21abf9(0x272)+_0x257c5f));const _0x413cdd=await withSpinner(_0x21abf9(0x229)+_0x257c5f+_0x21abf9(0x32f),()=>_0x1f8c6a[_0x21abf9(0x20a)][_0x21abf9(0x24a)](_0x257c5f),{'verbose':_0x339b94['verbose']}),_0x2cb151=_0x413cdd[_0x21abf9(0x268)];console[_0x21abf9(0x33f)]('✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x2cb151[_0x21abf9(0x284)]+'\x27');if(_0x339b94[_0x21abf9(0x1dd)]===_0x21abf9(0x1ba)||_0x339b94[_0x21abf9(0x1dd)]==='jsonl')await handleSDKOutput([_0x2cb151],_0x339b94);else{const _0x32c010=_0x2cb151[_0x21abf9(0x2e0)]===_0x21abf9(0x24d)?'🚀':'📝',_0x2da932=_0x2cb151[_0x21abf9(0x2a4)]?a31_0x5de0bb[_0x21abf9(0x1a0)]('\x20(paused)'):'';console[_0x21abf9(0x1e6)](_0x32c010+'\x20'+_0x2cb151[_0x21abf9(0x284)]+_0x2da932);}return 0x0;}}function a31_0x47a1(){const _0x2f03f9=['\x0aNo\x20sample\x20data\x20available','displayRealtimeInfo','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','addBehaviors','Site:\x20','\x20tdx\x20wf\x20attempt\x20','\x20--enriched','push','Deleting\x20personalization\x20\x27','bold','No\x20personalizations\x20configured','parent_segments','Master\x20Table','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Apply\x20changes\x20to\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x0aChanges\x20to\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','Behaviors','format','customersWithEvents','\x20Added\x20personalization\x20template\x20to\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','information_schema','\x22\x20}','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Attribute:','Join\x20on:','log','Error:\x20Token\x20ID\x20is\x20required','Error:\x20Service\x20name\x20is\x20required','Default','✔\x20Created\x20token\x20\x27','Pattern:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Status:','behavior_','scheduleOption','Name:\x20','behaviors','created:','segment','\x20No\x20changes\x20-\x20','Fetching\x20personalization\x20service\x20\x27','RT\x202.0:','Validate:','utf-8','Table:\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Personalization:','ps:rt:configuration_versions','dim','payload','description','ps:pz:service:token:delete','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','Creating\x20token\x20\x27','displayPreviewResults','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\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','Available\x20attributes:','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','stop','realtime','SQL\x20query:\x0a','behaviorsFile','\x20total','\x20[Job\x20ID:\x20','Creating','columns','dirname','toLowerCase','\x20\x20\x20\x20\x20\x20','Updating\x20parent\x20segment\x20\x27','\x0a\x20\x20\x20\x20]','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Error:\x20File\x20not\x20found:\x20','schemaError','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','To\x20cancel:','limit','listParents','interval','totalEvents','\x0a\x20\x20\x20\x20}','\x20service(s)\x20configured','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','get','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','attributesFile','getCurrentConfigVersion','\x20field','allValid','Analyzing\x20changes...','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','My\x20Service','public:','allowedIps','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\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','audienceId:\x20','✔\x20Renamed\x20directory\x20to\x20','Create\x20a\x20realtime\x20personalization\x20entity','keys','personalization','Parent\x20segment:\x20','Output\x20file:\x20','localeCompare','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','\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}','any','\x0aError:','relationships','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','ps:pz:delete','eventKind','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20\x201.\x20Edit\x20','Delete\x20a\x20realtime\x20personalization','/\x20→\x20','getOutputDatabaseName','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','✔\x20Query\x20completed:\x20Processed\x20','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','page_view','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','resumeJourney','getPersonalization','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','launched','filter','\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','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','start','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','ps:pz:service:list','sampleData','ps:rt:jn:pause','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','trim','Join:','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','green','createParent','addAttributes','\x20\x202.\x20Run\x20','apply','workflowAttemptId','Error:\x20Personalization\x20ID\x20is\x20required','matchedCount','tdx\x20ps\x20push\x20','schemaValid','ps:rt:validate','Finding\x20service\x20for\x20token...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Error:\x20Service\x20ID\x20is\x20required','data','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','workflowSessionId','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','segment:parent:pull','Session:','formatSchemaJson','message','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20RT\x20journey','RT\x20Journey\x20ID:\x20','Events:','Schema\x20saved\x20to\x20','Show\x20personalization\x20service\x20details','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','Updating\x20personalization\x20service\x20\x27','Patching\x20personalization\x20\x27','Columns:','\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','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','3205782HnjnUO','segment:parent:show','stageCount','\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','yes','stringify','\x0a✔\x20Workflow\x20started','RT\x202.0\x20Validate:','name','3mskzUi','getBehaviorNames','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','segment:parent:run','/attempt/','match','open','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','realtime_enabled','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','scheduleType','token:','segment:parent:list','\x20--attribute\x20\x22','status','setJobId','displaySampleData','segment:parent:create','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','validateParentYaml','Error\x20parsing\x20YAML:\x20','coveragePercent','Rows:','verbose','Resolving\x20parent\x20segment\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20rows)','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','paused','allowed\x20IPs:','Resume\x20activations\x20in\x20an\x20RT\x20journey','run','audienceId:','some','Overwrite\x20\x27','enabled','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','parent_id','\x20personalization\x20service','web','single','\x27\x20with\x20ID:\x20','pauseJourney','Found\x20YAML\x20file:\x20','displayColumns','red','\x20--behavior\x20\x22<name>\x22','runParent','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x20--behavior\x20\x22','`\x20to\x20download\x20the\x20configuration\x20first','\x20\x20No\x20sample\x20data\x20available','Master\x20+\x20Attributes','isDirectory','Coverage:','customerGroup','✔\x20Deleted\x20token\x20\x27','behavior','\x5c$&','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','session','✔\x20Deleted\x20personalization\x20service\x20\x27','errors','realtime:','/app/dw/parentSegments/','No\x20RT\x20journeys\x20found','ps:pz:create','\x20--interval\x20','\x20\x20Note:\x20','entryCriteria','population','Attempt:','\x20\x20\x20\x20','map','indexOf','\x20parent\x20segment\x20\x27','248iHeoKL','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','win32','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','darwin','Error:\x20Token\x20\x27','state','listPersonalizations','true','\x20\x20Database:\x20','List\x20parent\x20segments','(id:\x20','segment:parent:sql','\x20kill','td_client_id','file','\x20=\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','Listing\x20personalizations\x20for\x20\x27','use','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','length','Show\x20a\x20specific\x20realtime\x20personalization','master','Source:','ID\x20Stitching:','✔\x20Updated\x20personalization\x20service\x20\x27','\x20configured','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Validating\x20RT\x20configuration...','events','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','/{name}.yml\x0a','ps:pz:list','table','keyEventCriteria','payload:','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','parentSegment','👥\x20','\x0a⚠️\x20\x20Both\x20','✔\x20Updated\x20personalization\x20\x27','replace','\x20--attribute\x20\x22<name>\x22','database','deletePersonalization','\x27\x20and\x20run\x20workflow?','Error:','includeSensitive','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','sections','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Behavior:','Aborted.','folder-segment','Fetching\x20behavior\x20list...','column','customerPercent','\x20+\x20[','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','✔\x20Updated\x20parent\x20segment\x20\x27','previewParentYaml','Creating\x20parent\x20segment\x20\x27','idStitching','preview','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','\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','2672222irYrgR','Fetching\x20parent\x20segment\x20\x27','\x20(paused)','elapsedTimeMillis','ps:pz:service:create','\x0a⚠️\x20\x20Migrating:\x20','getParentSQL','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','307042hIEaOz','Pause\x20activations\x20in\x20an\x20RT\x20journey','unref','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','sort','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','customerGroupFile','List\x20RT\x20journeys','last_page_viewed','\x27...','%)\x20','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','Creating\x20personalization\x20\x27','text','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','tdx\x20ps\x20preview\x20','✔\x20No\x20changes\x20-\x20\x27','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Options:\x0a','toFixed','no\x20tokens\x20configured','execute','✘\x20Failed\x20to\x20rename\x20directory:\x20','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','error','Error\x20reading\x20file:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','\x20parent\x20segment','segment:parent:desc','createPersonalization','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','-1d','cyan','Fetching\x20customers\x20schema...','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','value','displaySummary','\x20to\x20configure\x20your\x20personalization\x20service','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','keyEventId:','tokens','sourceTableError','\x20Opening\x20','132853gmYPfJ','\x20personalization','entryCriteria:','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','ps:pz:service:delete','addAttributesFile','string','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','identifier:\x20','Deleting\x20personalization\x20service\x20\x27','keyEventId','test','displayBehaviorsStats','.yml','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','site','joinKey','Delete\x20a\x20personalization\x20service','607336vLSMjT','folderId','Listing\x20parent\x20segments\x20matching\x20\x27','segment:parent:push','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','displayPreviewHints','Options:','SELECT\x20*\x20FROM\x20','Updating','Listing\x20personalization\x20services\x20for\x20\x27','\x20is\x20already\x20up\x20to\x20date','\x20\x20Columns:\x20','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','stitchingKeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','\x20rows\x20','Show\x20parent\x20segment\x20schema\x20(column\x20types)','label','endsWith','includeSensitive:','getParentFull','personalizationServices','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','/\x20and\x20','⚡\x20Not\x20enabled','Available\x20behaviors:','sections:','Updated','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','jsonl','column_name','\x27\x20for\x20service\x20\x27','No\x20parent\x20segments\x20match\x20pattern:\x20','\x0aNew\x20parent\x20segment\x20\x27','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','enriched','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','✔\x20Found\x20personalization\x20\x27','Executing\x20parent\x20segment\x20query...','Output\x20Database:','repeat','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','workflowId','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','pushParentYaml','personalization_services','segment:parent:update','\x20true','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x20\x20\x20-\x20','output','join','createdAt','No\x20RT-enabled\x20parent\x20segments\x20found','Create\x20parent\x20segment\x20\x27','using\x20the\x20default\x20path:\x20','SELECT\x20*\x20FROM\x20(\x0a','type','platform','createToken','Preview:','Errors:','resolveParentId','parent_segment','Fetching\x20sample\x20data...','processedRows','\x20Added\x20RT\x202.0\x20template\x20section','Get\x20SQL\x20query\x20for\x20parent\x20segment','displayValidateResults','ps:pz:init','sourceTableValid','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','Getting\x20personalization\x20\x27','public','Audience\x20ID:','✔\x20Found\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','foreignKey','Update\x20a\x20realtime\x20personalization\x20entity','\x27\x20(id:\x20','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','list','\x22,\x20\x22type\x22:\x20\x22','attributes','identifier','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','create','yellow','ps:rt:jn:resume','\x20to\x20push\x20the\x20configuration','4721225CyHtUl','toLocaleString','ignore','valid','Created','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','17388081PZvCvg','all','in\x20','stats','attribute','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','ps:pz:service:update','YAML\x20file:\x20','updated:','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','timezone','\x20\x20Tables:\x201\x20customers\x20+\x20','rowCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Customers:','\x27\x20is\x20already\x20up\x20to\x20date','json','\x20Configuration\x20is\x20valid','audienceId','ps:pz:show','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','ps:rt:jn:list','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','listJourneys','\x20RT-enabled\x20parent\x20segment','displayAttributesStats','double','displayMasterInfo','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','customers','\x20\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'];a31_0x47a1=function(){return _0x2f03f9;};return a31_0x47a1();}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x1fc);['description']='Get\x20current\x20RT\x20configuration\x20version\x20status';async[a31_0x4fe4c9(0x33b)](_0x4b4b7f){const _0x5105db=a31_0x4fe4c9,{options:_0x1caffb,args:_0x19741d,tdx:_0x2bc8e2}=_0x4b4b7f,_0x572f6b=_0x19741d[0x0]||_0x1caffb['parentSegment'];if(!_0x572f6b)return showParentSegmentNotSetError(_0x5105db(0x28e)+_0x5105db(0x27f)),0x1;_0x1caffb[_0x5105db(0x29d)]&&(console[_0x5105db(0x33f)](_0x5105db(0x1ce)+_0x1caffb[_0x5105db(0x362)]),console[_0x5105db(0x33f)](_0x5105db(0x235)+_0x572f6b));const _0x46164d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x572f6b+'\x27...',()=>_0x2bc8e2[_0x5105db(0x1f3)][_0x5105db(0x187)](_0x572f6b),{'verbose':_0x1caffb[_0x5105db(0x29d)]}),_0x3f1fa1=_0x46164d[_0x5105db(0x268)],_0x1941fd=await withSpinner(_0x5105db(0x1fa)+_0x572f6b+_0x5105db(0x32f),()=>_0x2bc8e2[_0x5105db(0x20a)][_0x5105db(0x225)](_0x3f1fa1),{'verbose':_0x1caffb['verbose']}),_0x1bdbac=_0x1941fd[_0x5105db(0x268)];return console[_0x5105db(0x33f)]('✔\x20Retrieved\x20RT\x20configuration\x20version'),_0x1caffb['format']==='json'||_0x1caffb[_0x5105db(0x1dd)]==='jsonl'?await handleSDKOutput([_0x1bdbac],_0x1caffb):(console[_0x5105db(0x1e6)]('id:\x20'+_0x1bdbac['id']),console[_0x5105db(0x1e6)](_0x5105db(0x230)+_0x1bdbac[_0x5105db(0x1bc)]),console['log'](_0x5105db(0x35b)+_0x1bdbac[_0x5105db(0x19d)]),console[_0x5105db(0x1e6)]('eventKind:\x20'+_0x1bdbac[_0x5105db(0x23f)]),console[_0x5105db(0x1e6)]('status:\x20'+_0x1bdbac[_0x5105db(0x293)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x253);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x331);async[a31_0x4fe4c9(0x33b)](_0x2b39f6){const _0x104ea1=a31_0x4fe4c9,{options:_0x14d9f2,args:_0x4b8f08,tdx:_0x46a31a}=_0x2b39f6,_0x56e8f6=_0x4b8f08[0x0]||_0x14d9f2[_0x104ea1(0x301)];if(!_0x56e8f6)return showParentSegmentNotSetError(_0x104ea1(0x195)+_0x104ea1(0x27a)),0x1;const _0x2b20c9=await withSpinner(_0x104ea1(0x29e)+_0x56e8f6+_0x104ea1(0x32f),()=>_0x46a31a[_0x104ea1(0x1f3)][_0x104ea1(0x187)](_0x56e8f6),{'verbose':_0x14d9f2[_0x104ea1(0x29d)]}),_0xf8ddf7=_0x2b20c9['data'],_0x385a8d=await withSpinner(_0x104ea1(0x36e)+_0x56e8f6+_0x104ea1(0x32f),()=>_0x46a31a['personalization'][_0x104ea1(0x19a)](_0xf8ddf7),{'verbose':_0x14d9f2[_0x104ea1(0x29d)]}),_0xa7feaa=_0x385a8d[_0x104ea1(0x268)];console['error'](_0x104ea1(0x194)+_0xa7feaa['length']+_0x104ea1(0x2af)+(_0xa7feaa[_0x104ea1(0x2ef)]!==0x1?'s':''));if(_0x14d9f2[_0x104ea1(0x1dd)]==='json'||_0x14d9f2[_0x104ea1(0x1dd)]===_0x104ea1(0x382))await handleSDKOutput(_0xa7feaa,_0x14d9f2);else{if(_0xa7feaa['length']===0x0)console[_0x104ea1(0x1e6)]('No\x20personalization\x20services\x20configured'),console['error'](a31_0x5de0bb['cyan']('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x49671f of _0xa7feaa){console[_0x104ea1(0x1e6)](a31_0x5de0bb['bold'](_0x49671f['name'])+'\x20'+a31_0x5de0bb[_0x104ea1(0x1fd)](_0x104ea1(0x2e5)+_0x49671f['id']+')'));_0x49671f[_0x104ea1(0x1ff)]&&console['log']('\x20\x20'+a31_0x5de0bb[_0x104ea1(0x1fd)](_0x49671f[_0x104ea1(0x1ff)]));if(_0x49671f[_0x104ea1(0x350)]&&_0x49671f[_0x104ea1(0x350)][_0x104ea1(0x2ef)]>0x0)for(const _0x327f71 of _0x49671f[_0x104ea1(0x350)]){const _0x522534=_0x327f71[_0x104ea1(0x22c)]?.[_0x104ea1(0x2ef)]?_0x327f71[_0x104ea1(0x22c)]['join'](',\x20'):'any';console[_0x104ea1(0x1e6)]('\x20\x20'+a31_0x5de0bb[_0x104ea1(0x348)](_0x104ea1(0x290))+'\x20'+_0x327f71[_0x104ea1(0x284)]+'\x20'+a31_0x5de0bb[_0x104ea1(0x1fd)](_0x104ea1(0x2e5)+_0x327f71['id']+')')),console[_0x104ea1(0x1e6)](_0x104ea1(0x2d4)+a31_0x5de0bb['dim'](_0x104ea1(0x2a5))+'\x20'+_0x522534);}else console['log']('\x20\x20'+a31_0x5de0bb[_0x104ea1(0x1fd)](_0x104ea1(0x33a)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x322);['description']=a31_0x4fe4c9(0x276);async[a31_0x4fe4c9(0x33b)](_0x35649a){const _0x502f09=a31_0x4fe4c9,{options:_0x2525a3,args:_0x32013c,tdx:_0x2e4ea4}=_0x35649a,_0x10bce2=_0x2525a3,_0x3f000f=_0x32013c[0x0],_0x3aa922=_0x32013c[0x1]||_0x2525a3[_0x502f09(0x301)];if(!_0x3f000f)return console['error'](_0x502f09(0x1e8)),console[_0x502f09(0x33f)](_0x502f09(0x1be)),console[_0x502f09(0x33f)](_0x502f09(0x345)),0x1;if(!_0x3aa922)return showParentSegmentNotSetError(_0x502f09(0x346)+_0x502f09(0x345)),0x1;const _0x491010=await withSpinner(_0x502f09(0x29e)+_0x3aa922+'\x27...',()=>_0x2e4ea4['segment'][_0x502f09(0x187)](_0x3aa922),{'verbose':_0x2525a3[_0x502f09(0x29d)]}),_0x1e10ac=_0x491010['data'],_0x5c4b52={'name':_0x3f000f,'description':_0x10bce2['description'],'public':_0x10bce2[_0x502f09(0x192)]},_0xf96ec5=await withSpinner('Creating\x20personalization\x20service\x20\x27'+_0x3f000f+_0x502f09(0x32f),()=>_0x2e4ea4['personalization'][_0x502f09(0x19f)](_0x1e10ac,_0x5c4b52),{'verbose':_0x2525a3['verbose']}),_0x2a2fc6=_0xf96ec5['data'];return console['error']('✔\x20Created\x20personalization\x20service\x20\x27'+_0x2a2fc6[_0x502f09(0x284)]+_0x502f09(0x2b2)+_0x2a2fc6['id']),await handleSDKOutput([_0x2a2fc6],_0x2525a3),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]='ps:pz:service:show';[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x275);async[a31_0x4fe4c9(0x33b)](_0x15e9df){const _0x2d03=a31_0x4fe4c9,{options:_0x1bd824,args:_0x311e8b,tdx:_0x5d10c4}=_0x15e9df,_0xf752f7=_0x311e8b[0x0],_0x3d5da8=_0x311e8b[0x1]||_0x1bd824[_0x2d03(0x301)];if(!_0xf752f7)return console['error'](_0x2d03(0x267)),console[_0x2d03(0x33f)](_0x2d03(0x201)),console['error'](_0x2d03(0x2c7)),0x1;if(!_0x3d5da8)return showParentSegmentNotSetError(_0x2d03(0x2dd)+_0x2d03(0x2c7)),0x1;const _0x54d66e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3d5da8+_0x2d03(0x32f),()=>_0x5d10c4[_0x2d03(0x1f3)][_0x2d03(0x187)](_0x3d5da8),{'verbose':_0x1bd824[_0x2d03(0x29d)]}),_0x4a2c5c=_0x54d66e[_0x2d03(0x268)],_0x308373=await withSpinner(_0x2d03(0x1f5)+_0xf752f7+'\x27...',()=>_0x5d10c4[_0x2d03(0x234)][_0x2d03(0x222)](_0x4a2c5c,_0xf752f7),{'verbose':_0x1bd824[_0x2d03(0x29d)]}),_0xab3f10=_0x308373['data'];if(_0x1bd824['json']||_0x1bd824[_0x2d03(0x382)])await handleSDKOutput([_0xab3f10],_0x1bd824);else{console['log'](a31_0x5de0bb[_0x2d03(0x1d3)](_0xab3f10[_0x2d03(0x284)])+'\x20'+a31_0x5de0bb[_0x2d03(0x1fd)](_0x2d03(0x2e5)+_0xab3f10['id']+')'));_0xab3f10['description']&&console[_0x2d03(0x1e6)]('\x20\x20'+a31_0x5de0bb['dim'](_0xab3f10[_0x2d03(0x1ff)]));console['log']('\x20\x20'+a31_0x5de0bb[_0x2d03(0x348)](_0x2d03(0x22b))+'\x20'+(_0xab3f10[_0x2d03(0x192)]?_0x2d03(0x280):'no'));if(_0xab3f10['tokens']&&_0xab3f10['tokens'][_0x2d03(0x2ef)]>0x0)for(const _0x348657 of _0xab3f10[_0x2d03(0x350)]){const _0x533b81=_0x348657[_0x2d03(0x22c)]?.[_0x2d03(0x2ef)]?_0x348657[_0x2d03(0x22c)]['join'](',\x20'):_0x2d03(0x23a);console[_0x2d03(0x1e6)]('\x20\x20'+a31_0x5de0bb[_0x2d03(0x348)]('token:')+'\x20'+_0x348657[_0x2d03(0x284)]+'\x20'+a31_0x5de0bb['dim']('(id:\x20'+_0x348657['id']+')')),console['log'](_0x2d03(0x2d4)+a31_0x5de0bb[_0x2d03(0x1fd)](_0x2d03(0x2a5))+'\x20'+_0x533b81);}else console['log']('\x20\x20'+a31_0x5de0bb[_0x2d03(0x1fd)](_0x2d03(0x33a)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x357);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x364);async[a31_0x4fe4c9(0x33b)](_0x37c265){const _0x23b493=a31_0x4fe4c9,{options:_0x4c8e0a,args:_0x379214,tdx:_0x1cb79c}=_0x37c265,_0x53a23c=_0x379214[0x0],_0x586417=_0x379214[0x1]||_0x4c8e0a[_0x23b493(0x301)];if(!_0x53a23c)return console[_0x23b493(0x33f)](_0x23b493(0x267)),console[_0x23b493(0x33f)](_0x23b493(0x341)),console[_0x23b493(0x33f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x586417)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x23b493(0x1c9)),0x1;const _0x50ce7f=await withSpinner(_0x23b493(0x29e)+_0x586417+_0x23b493(0x32f),()=>_0x1cb79c[_0x23b493(0x1f3)]['resolveParentId'](_0x586417),{'verbose':_0x4c8e0a[_0x23b493(0x29d)]}),_0x121093=_0x50ce7f[_0x23b493(0x268)];return await withSpinner(_0x23b493(0x35c)+_0x53a23c+_0x23b493(0x32f),()=>_0x1cb79c[_0x23b493(0x234)]['delete'](_0x121093,_0x53a23c),{'verbose':_0x4c8e0a['verbose']}),console[_0x23b493(0x33f)](_0x23b493(0x2c9)+_0x53a23c+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x1af);['description']=a31_0x4fe4c9(0x1ae);async['execute'](_0x19c07d){const _0x19a54c=a31_0x4fe4c9,{options:_0x1111b9,args:_0x202d57,tdx:_0x3221ea}=_0x19c07d,_0x35d201=_0x1111b9,_0x42ea1e=_0x202d57[0x0],_0x4c3ef6=_0x202d57[0x1]||_0x1111b9[_0x19a54c(0x301)];if(!_0x42ea1e)return console[_0x19a54c(0x33f)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x19a54c(0x33f)](_0x19a54c(0x316)),console[_0x19a54c(0x33f)](_0x19a54c(0x34e)),0x1;if(!_0x35d201['name'])return console[_0x19a54c(0x33f)]('Error:\x20--name\x20is\x20required'),console['error'](_0x19a54c(0x316)),0x1;if(!_0x4c3ef6)return showParentSegmentNotSetError(_0x19a54c(0x2a3)+_0x19a54c(0x34e)),0x1;const _0x335786=await withSpinner(_0x19a54c(0x29e)+_0x4c3ef6+'\x27...',()=>_0x3221ea[_0x19a54c(0x1f3)]['resolveParentId'](_0x4c3ef6),{'verbose':_0x1111b9[_0x19a54c(0x29d)]}),_0x281880=_0x335786[_0x19a54c(0x268)],_0x5d7839={'name':_0x35d201[_0x19a54c(0x284)]};_0x35d201[_0x19a54c(0x1ff)]!==undefined&&(_0x5d7839['description']=_0x35d201[_0x19a54c(0x1ff)]);const _0x3ba84e=await withSpinner(_0x19a54c(0x277)+_0x42ea1e+_0x19a54c(0x32f),()=>_0x3221ea[_0x19a54c(0x234)]['patch'](_0x281880,_0x42ea1e,_0x5d7839),{'verbose':_0x1111b9[_0x19a54c(0x29d)]}),_0x5ca520=_0x3ba84e['data'];return console[_0x19a54c(0x33f)](_0x19a54c(0x2f4)+_0x5ca520[_0x19a54c(0x284)]+'\x27'),await handleSDKOutput([_0x5ca520],_0x1111b9),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']='ps:pz:service:token:create';[a31_0x4fe4c9(0x1ff)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a31_0x4fe4c9(0x33b)](_0x307866){const _0x4f8e53=a31_0x4fe4c9,{options:_0x2bd3b8,args:_0x34acf2,tdx:_0x1a9bfd}=_0x307866,_0x175838=_0x2bd3b8,_0x5949a3=_0x34acf2[0x0],_0x14d727=_0x34acf2[0x1],_0x2deda9=_0x34acf2[0x2]||_0x2bd3b8[_0x4f8e53(0x301)];if(!_0x5949a3)return console[_0x4f8e53(0x33f)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x4f8e53(0x33f)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console['error'](_0x4f8e53(0x38e)),0x1;if(!_0x14d727)return console[_0x4f8e53(0x33f)](_0x4f8e53(0x267)),console['error'](_0x4f8e53(0x238)),console['error'](_0x4f8e53(0x38e)),0x1;if(!_0x2deda9)return showParentSegmentNotSetError(_0x4f8e53(0x287)+_0x4f8e53(0x38e)),0x1;const _0x4b2d99=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2deda9+_0x4f8e53(0x32f),()=>_0x1a9bfd[_0x4f8e53(0x1f3)][_0x4f8e53(0x187)](_0x2deda9),{'verbose':_0x2bd3b8['verbose']}),_0xaff0c3=_0x4b2d99[_0x4f8e53(0x268)],_0x566b53={'name':_0x5949a3};_0x175838[_0x4f8e53(0x22c)]&&(_0x566b53[_0x4f8e53(0x22c)]=_0x175838[_0x4f8e53(0x22c)]['split'](',')[_0x4f8e53(0x2d5)](_0x10e9aa=>_0x10e9aa['trim']()));_0x175838[_0x4f8e53(0x1ff)]&&(_0x566b53[_0x4f8e53(0x1ff)]=_0x175838[_0x4f8e53(0x1ff)]);const _0x459bfc=await withSpinner(_0x4f8e53(0x202)+_0x5949a3+_0x4f8e53(0x384)+_0x14d727+_0x4f8e53(0x32f),()=>_0x1a9bfd['personalization'][_0x4f8e53(0x184)](_0xaff0c3,_0x14d727,_0x566b53),{'verbose':_0x2bd3b8['verbose']}),_0x4a2182=_0x459bfc['data'];return console[_0x4f8e53(0x33f)](_0x4f8e53(0x1ea)+_0x4a2182[_0x4f8e53(0x284)]+'\x27\x20with\x20ID:\x20'+_0x4a2182['id']),_0x4a2182[_0x4f8e53(0x34b)]&&(console[_0x4f8e53(0x33f)](a31_0x5de0bb[_0x4f8e53(0x1a0)]('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console[_0x4f8e53(0x33f)](a31_0x5de0bb[_0x4f8e53(0x348)](_0x4a2182['value'])),console[_0x4f8e53(0x33f)]('')),await handleSDKOutput([_0x4a2182],_0x2bd3b8),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x200);['description']=a31_0x4fe4c9(0x33d);async[a31_0x4fe4c9(0x33b)](_0x339303){const _0x41e84c=a31_0x4fe4c9,{options:_0x1f2e67,args:_0x309143,tdx:_0x55cc9e}=_0x339303,_0x2a5b2d=_0x309143[0x0],_0x2f0174=_0x309143[0x1]||_0x1f2e67[_0x41e84c(0x301)];if(!_0x2a5b2d)return console[_0x41e84c(0x33f)](_0x41e84c(0x1e7)),console[_0x41e84c(0x33f)](_0x41e84c(0x19e)),console[_0x41e84c(0x33f)](_0x41e84c(0x1b3)),0x1;if(!_0x2f0174)return showParentSegmentNotSetError(_0x41e84c(0x256)+_0x41e84c(0x1b3)),0x1;const _0x2bcac9=await withSpinner(_0x41e84c(0x29e)+_0x2f0174+'\x27...',()=>_0x55cc9e[_0x41e84c(0x1f3)][_0x41e84c(0x187)](_0x2f0174),{'verbose':_0x1f2e67['verbose']}),_0x10ca44=_0x2bcac9[_0x41e84c(0x268)],_0x5c1d29=await withSpinner(_0x41e84c(0x265),()=>_0x55cc9e[_0x41e84c(0x234)][_0x41e84c(0x19a)](_0x10ca44),{'verbose':_0x1f2e67[_0x41e84c(0x29d)]}),_0x536d18=_0x5c1d29['data'];let _0x34eab6;for(const _0x466aa6 of _0x536d18){if(_0x466aa6[_0x41e84c(0x350)]?.[_0x41e84c(0x2a9)](_0x1ded84=>_0x1ded84['id']===_0x2a5b2d)){_0x34eab6=_0x466aa6['id'];break;}}if(!_0x34eab6)return console[_0x41e84c(0x33f)](_0x41e84c(0x2df)+_0x2a5b2d+_0x41e84c(0x2a2)),0x1;const _0x3ed2ba=await withSpinner('Deleting\x20token\x20\x27'+_0x2a5b2d+'\x27...',()=>_0x55cc9e[_0x41e84c(0x234)]['deleteToken'](_0x10ca44,_0x34eab6,_0x2a5b2d),{'verbose':_0x1f2e67[_0x41e84c(0x29d)]}),_0x1d57c6=_0x3ed2ba[_0x41e84c(0x268)];return console[_0x41e84c(0x33f)](_0x41e84c(0x2c3)+(_0x1d57c6[_0x41e84c(0x284)]||_0x2a5b2d)+'\x27'),await handleSDKOutput([_0x1d57c6],_0x1f2e67),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x2fc);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x28c);async[a31_0x4fe4c9(0x33b)](_0x46adeb){const _0xc95ad0=a31_0x4fe4c9,{options:_0x51739f,args:_0x41e8b6,tdx:_0x393eb2}=_0x46adeb,_0x3184ef=_0x41e8b6[0x0]||_0x51739f[_0xc95ad0(0x301)];if(!_0x3184ef)return showParentSegmentNotSetError(_0xc95ad0(0x1c6)+_0xc95ad0(0x22f)),0x1;const _0x2f71bf=await withSpinner(_0xc95ad0(0x29e)+_0x3184ef+_0xc95ad0(0x32f),()=>_0x393eb2[_0xc95ad0(0x1f3)][_0xc95ad0(0x187)](_0x3184ef),{'verbose':_0x51739f['verbose']}),_0x48600e=_0x2f71bf['data'],_0x980c5a=await withSpinner(_0xc95ad0(0x2ec)+_0x3184ef+_0xc95ad0(0x32f),()=>_0x393eb2[_0xc95ad0(0x234)][_0xc95ad0(0x2e1)](_0x48600e),{'verbose':_0x51739f[_0xc95ad0(0x29d)]}),_0x218dee=_0x980c5a[_0xc95ad0(0x268)];console[_0xc95ad0(0x33f)]('✔\x20Found\x20'+_0x218dee[_0xc95ad0(0x2ef)]+_0xc95ad0(0x354)+(_0x218dee[_0xc95ad0(0x2ef)]!==0x1?'s':''));if(_0x51739f[_0xc95ad0(0x1dd)]==='json'||_0x51739f['format']===_0xc95ad0(0x382))await handleSDKOutput(_0x218dee,_0x51739f);else{if(_0x218dee[_0xc95ad0(0x2ef)]===0x0)console['log'](_0xc95ad0(0x1d4));else for(const _0x3d8c0b of _0x218dee){console[_0xc95ad0(0x1e6)](a31_0x5de0bb[_0xc95ad0(0x1d3)](_0x3d8c0b[_0xc95ad0(0x284)])+'\x20'+a31_0x5de0bb['dim']('(id:\x20'+_0x3d8c0b['id']+')'));_0x3d8c0b[_0xc95ad0(0x1ff)]&&console['log']('\x20\x20'+a31_0x5de0bb[_0xc95ad0(0x1fd)](_0x3d8c0b['description']));const _0x29d508=_0x3d8c0b[_0xc95ad0(0x30d)]?.[_0xc95ad0(0x2ef)]||0x0;console[_0xc95ad0(0x1e6)]('\x20\x20'+a31_0x5de0bb[_0xc95ad0(0x348)](_0xc95ad0(0x37f))+'\x20'+_0x29d508);if(_0x3d8c0b['sections']&&_0x3d8c0b[_0xc95ad0(0x30d)][_0xc95ad0(0x2ef)]>0x0)for(const _0x514ed5 of _0x3d8c0b['sections']){console[_0xc95ad0(0x1e6)](_0xc95ad0(0x398)+_0x514ed5[_0xc95ad0(0x284)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x1bd);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x2f0);async[a31_0x4fe4c9(0x33b)](_0x1a3623){const _0xd51029=a31_0x4fe4c9,{options:_0x4ad22a,args:_0x5e75ad,tdx:_0x1a47c3}=_0x1a3623,_0x2d9782=_0x5e75ad[0x0];if(!_0x2d9782)return console['error'](_0xd51029(0x260)),console[_0xd51029(0x33f)](_0xd51029(0x1e3)),0x1;const _0x28c63b=await withSpinner(_0xd51029(0x191)+_0x2d9782+_0xd51029(0x32f),()=>_0x1a47c3[_0xd51029(0x234)][_0xd51029(0x24b)](_0x2d9782),{'verbose':_0x4ad22a['verbose']}),_0x5cd22b=_0x28c63b[_0xd51029(0x268)];console[_0xd51029(0x33f)](_0xd51029(0x38a)+_0x5cd22b[_0xd51029(0x284)]+'\x27');if(_0x4ad22a[_0xd51029(0x1dd)]===_0xd51029(0x1ba)||_0x4ad22a[_0xd51029(0x1dd)]==='jsonl')await handleSDKOutput([_0x5cd22b],_0x4ad22a);else{console['log'](a31_0x5de0bb['bold'](_0x5cd22b[_0xd51029(0x284)])+'\x20'+a31_0x5de0bb[_0xd51029(0x1fd)](_0xd51029(0x2e5)+_0x5cd22b['id']+')'));_0x5cd22b[_0xd51029(0x1ff)]&&console['log']('\x20\x20'+a31_0x5de0bb[_0xd51029(0x1fd)](_0x5cd22b[_0xd51029(0x1ff)]));_0x5cd22b[_0xd51029(0x1bc)]&&console[_0xd51029(0x1e6)]('\x20\x20'+a31_0x5de0bb[_0xd51029(0x348)](_0xd51029(0x2a8))+'\x20'+_0x5cd22b[_0xd51029(0x1bc)]);console[_0xd51029(0x1e6)]('\x20\x20'+a31_0x5de0bb['cyan'](_0xd51029(0x1f2))+'\x20'+_0x5cd22b[_0xd51029(0x39b)]),console['log']('\x20\x20'+a31_0x5de0bb[_0xd51029(0x348)](_0xd51029(0x1b1))+'\x20'+_0x5cd22b['updatedAt']);const _0x31be7f=_0x5cd22b[_0xd51029(0x30d)]?.[_0xd51029(0x2ef)]||0x0;console[_0xd51029(0x1e6)]('\x20\x20'+a31_0x5de0bb['cyan'](_0xd51029(0x37f))+'\x20'+_0x31be7f);if(_0x5cd22b['sections']&&_0x5cd22b[_0xd51029(0x30d)][_0xd51029(0x2ef)]>0x0)for(const _0xe67ec3 of _0x5cd22b[_0xd51029(0x30d)]){console[_0xd51029(0x1e6)](_0xd51029(0x2d4)+a31_0x5de0bb['bold'](_0xe67ec3[_0xd51029(0x284)])+'\x20'+a31_0x5de0bb[_0xd51029(0x1fd)](_0xd51029(0x2e5)+_0xe67ec3['id']+')')),_0xe67ec3[_0xd51029(0x2d1)]&&(console['log'](_0xd51029(0x213)+a31_0x5de0bb[_0xd51029(0x348)](_0xd51029(0x355))+'\x20'+_0xe67ec3[_0xd51029(0x2d1)][_0xd51029(0x284)]),_0xe67ec3['entryCriteria']['keyEventCriteria']?.['keyEventId']&&console['log']('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x5de0bb[_0xd51029(0x348)](_0xd51029(0x34f))+'\x20'+_0xe67ec3['entryCriteria'][_0xd51029(0x2fe)][_0xd51029(0x35d)])),_0xe67ec3[_0xd51029(0x1fe)]&&console[_0xd51029(0x1e6)](_0xd51029(0x213)+a31_0x5de0bb[_0xd51029(0x348)](_0xd51029(0x2ff))+'\x20'+JSON[_0xd51029(0x281)](_0xe67ec3['payload'])),_0xe67ec3[_0xd51029(0x30b)]&&console[_0xd51029(0x1e6)](_0xd51029(0x213)+a31_0x5de0bb['cyan'](_0xd51029(0x378))+_0xd51029(0x395));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x23e);['description']=a31_0x4fe4c9(0x242);async[a31_0x4fe4c9(0x33b)](_0x3a71d4){const _0x754301=a31_0x4fe4c9,{options:_0x3a3259,args:_0x5cce75,tdx:_0x279ee8}=_0x3a71d4,_0x19bfab=_0x5cce75[0x0];if(!_0x19bfab)return console[_0x754301(0x33f)](_0x754301(0x260)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x754301(0x1d2)+_0x19bfab+_0x754301(0x32f),()=>_0x279ee8[_0x754301(0x234)][_0x754301(0x308)](_0x19bfab),{'verbose':_0x3a3259[_0x754301(0x29d)]}),console[_0x754301(0x33f)]('✔\x20Deleted\x20personalization\x20\x27'+_0x19bfab+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x2ce);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x232);async[a31_0x4fe4c9(0x33b)](_0x56eaf2){const _0x5b5529=a31_0x4fe4c9,{options:_0x48c90f,tdx:_0xfd521c}=_0x56eaf2,_0x152091=_0x48c90f;let _0x30e79b;if(_0x152091[_0x5b5529(0x2e9)]){_0x30e79b=await loadJSON(_0x152091['file'],!![]);if(!_0x30e79b[_0x5b5529(0x23c)]?.['parentFolder'])return console[_0x5b5529(0x33f)]('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x5b5529(0x33f)](_0x5b5529(0x31c)),console['error'](_0x5b5529(0x239)),0x1;}else{if(!_0x152091[_0x5b5529(0x284)])return console['error'](_0x5b5529(0x247)),console[_0x5b5529(0x33f)](_0x5b5529(0x297)),console[_0x5b5529(0x33f)](_0x5b5529(0x2dc)),0x1;if(_0x152091[_0x5b5529(0x1ff)]===undefined)return console[_0x5b5529(0x33f)](_0x5b5529(0x1a8)),console['error'](_0x5b5529(0x297)),console[_0x5b5529(0x33f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x152091[_0x5b5529(0x366)]===undefined)return console['error'](_0x5b5529(0x2ac)),console[_0x5b5529(0x33f)]('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x28bd46=_0x152091[_0x5b5529(0x1bc)];if(!_0x28bd46&&_0x48c90f[_0x5b5529(0x301)]){const _0x51f4f6=await withSpinner(_0x5b5529(0x29e)+_0x48c90f[_0x5b5529(0x301)]+'\x27...',()=>_0xfd521c[_0x5b5529(0x1f3)][_0x5b5529(0x187)](_0x48c90f[_0x5b5529(0x301)]),{'verbose':_0x48c90f[_0x5b5529(0x29d)]});_0x28bd46=_0x51f4f6['data'];}let _0x2f8e60;_0x152091[_0x5b5529(0x30d)]&&(_0x2f8e60=await loadJSON(_0x152091[_0x5b5529(0x30d)],![]));const _0x56c3cb=_0x152091[_0x5b5529(0x366)]==='null'?null:{'id':_0x152091['folderId'],'type':_0x5b5529(0x311)};_0x30e79b={'attributes':{'name':_0x152091[_0x5b5529(0x284)],'description':_0x152091['description']||null,..._0x28bd46!==undefined&&{'audienceId':_0x28bd46},..._0x2f8e60!==undefined&&{'sections':_0x2f8e60}},'relationships':{'parentFolder':{'data':_0x56c3cb}}};}const _0x1ecc1e=await withSpinner(_0x5b5529(0x332)+(_0x30e79b[_0x5b5529(0x19c)]?.['name']??'')+_0x5b5529(0x32f),()=>_0xfd521c[_0x5b5529(0x234)][_0x5b5529(0x344)](_0x30e79b),{'verbose':_0x48c90f['verbose']}),_0x1e3bc6=_0x1ecc1e[_0x5b5529(0x268)];return console['error']('✔\x20Created\x20personalization\x20\x27'+_0x1e3bc6['name']+_0x5b5529(0x2b2)+_0x1e3bc6['id']),await handleSDKOutput([_0x1e3bc6],_0x48c90f),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x4fe4c9(0x284)]='ps:pz:patch';[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x197);async[a31_0x4fe4c9(0x33b)](_0x2caa7d){const _0x1b7ecf=a31_0x4fe4c9,{options:_0x2c02e0,args:_0x593bc6}=_0x2caa7d,_0x169af0=_0x2c02e0,_0x42e2bc=_0x593bc6[0x0];if(!_0x42e2bc)return console[_0x1b7ecf(0x33f)](_0x1b7ecf(0x260)),console[_0x1b7ecf(0x33f)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0x1b7ecf(0x33f)](_0x1b7ecf(0x1e0)),0x1;let _0x3945bb;if(_0x169af0['file'])_0x3945bb=await loadJSON(_0x169af0['file'],!![]);else{if(!_0x169af0[_0x1b7ecf(0x284)])return console[_0x1b7ecf(0x33f)](_0x1b7ecf(0x247)),console['error'](_0x1b7ecf(0x2f6)),0x1;if(_0x169af0[_0x1b7ecf(0x1ff)]===undefined)return console['error'](_0x1b7ecf(0x1a8)),console[_0x1b7ecf(0x33f)](_0x1b7ecf(0x2f6)),0x1;let _0x3c36e6;_0x169af0['sections']&&(_0x3c36e6=await loadJSON(_0x169af0[_0x1b7ecf(0x30d)],![])),_0x3945bb={'attributes':{'name':_0x169af0['name'],'description':_0x169af0['description']||null,..._0x3c36e6!==undefined&&{'sections':_0x3c36e6}}};}const {tdx:_0x59ad52}=_0x2caa7d,_0xcccb78=await withSpinner(_0x1b7ecf(0x278)+_0x42e2bc+_0x1b7ecf(0x32f),()=>_0x59ad52['personalization']['patchPersonalization'](_0x42e2bc,_0x3945bb),{'verbose':_0x2c02e0[_0x1b7ecf(0x29d)]}),_0xcf1e36=_0xcccb78['data'];return console[_0x1b7ecf(0x33f)](_0x1b7ecf(0x304)+_0xcf1e36['name']+_0x1b7ecf(0x198)+_0xcf1e36['id']+')'),await handleSDKOutput([_0xcf1e36],_0x2c02e0),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x4fe4c9(0x284)]=a31_0x4fe4c9(0x18e);[a31_0x4fe4c9(0x1ff)]=a31_0x4fe4c9(0x325);async[a31_0x4fe4c9(0x33b)](_0x5e1021){const _0x2772db=a31_0x4fe4c9,{options:_0x8a18c1,args:_0x531aa0}=_0x5e1021,_0x3aa966=_0x531aa0[0x0]||_0x8a18c1['parentSegment'];if(!_0x3aa966)return showParentSegmentNotSetError(_0x2772db(0x190)+_0x2772db(0x205)),0x1;const _0x28022c=resolveYamlFile(_0x3aa966);if(!existsSync(_0x28022c))return showFileNotFoundError(_0x28022c,_0x3aa966),0x1;let _0x4014e2;try{_0x4014e2=readFileSync(_0x28022c,_0x2772db(0x1f8));}catch(_0x21dff6){const _0x1cb73c=_0x21dff6 instanceof Error?_0x21dff6[_0x2772db(0x26f)]:String(_0x21dff6);return console[_0x2772db(0x33f)]('Error\x20reading\x20file:\x20'+_0x1cb73c),0x1;}let _0x494acf;try{_0x494acf=parseDef(_0x4014e2);}catch(_0x5889d8){const _0x5eee13=_0x5889d8 instanceof Error?_0x5889d8[_0x2772db(0x26f)]:String(_0x5889d8);return console['error'](a31_0x5de0bb['red']('Error\x20parsing\x20YAML:\x20'+_0x5eee13)),0x1;}if(_0x494acf[_0x2772db(0x393)]&&_0x494acf[_0x2772db(0x393)][_0x2772db(0x2ef)]>0x0)return console[_0x2772db(0x33f)](a31_0x5de0bb[_0x2772db(0x1a0)](_0x2772db(0x207)+_0x28022c)),console[_0x2772db(0x33f)](a31_0x5de0bb[_0x2772db(0x1fd)](_0x2772db(0x1c8)+_0x494acf[_0x2772db(0x393)][_0x2772db(0x2ef)]+_0x2772db(0x220))),0x1;!_0x494acf[_0x2772db(0x20a)]&&(_0x494acf[_0x2772db(0x20a)]={'events':[{'name':_0x2772db(0x248),'source_table':'<database>.<table>'}],'attributes':[{'name':_0x2772db(0x32e),'type':_0x2772db(0x2b1)}],'id_stitching':{'primary_key':_0x494acf[_0x2772db(0x2f1)]['table']==='customers'?_0x2772db(0x2e8):'user_id'}});_0x494acf[_0x2772db(0x393)]=[{'name':_0x2772db(0x22a),'description':'Personalization\x20service\x20description','trigger_event':_0x2772db(0x248),'sections':[{'name':_0x2772db(0x1e9),'criteria':_0x2772db(0x2e2),'attributes':['last_page_viewed']}]}];const _0x423af8=serializeDef(_0x494acf);return writeFileSync(_0x28022c,_0x423af8,_0x2772db(0x1f8)),console['error'](a31_0x5de0bb[_0x2772db(0x25a)]('✔')+_0x2772db(0x1df)+a31_0x5de0bb['cyan'](_0x28022c)),(!_0x494acf[_0x2772db(0x20a)]||_0x4014e2[_0x2772db(0x2d6)](_0x2772db(0x2cb))===-0x1)&&console[_0x2772db(0x33f)](a31_0x5de0bb[_0x2772db(0x25a)]('✔')+_0x2772db(0x18b)),console[_0x2772db(0x33f)]('\x0a'+a31_0x5de0bb['dim']('Next\x20steps:')),console['error'](_0x2772db(0x241)+_0x28022c+_0x2772db(0x34d)),console[_0x2772db(0x33f)](_0x2772db(0x25d)+a31_0x5de0bb[_0x2772db(0x1fd)](_0x2772db(0x262)+_0x3aa966)+_0x2772db(0x1a2)),0x0;}}
1
+ const a31_0x3bc615=a31_0x9019;(function(_0x4463b0,_0x26ea5a){const _0x5e1dcc=a31_0x9019,_0x58d27c=_0x4463b0();while(!![]){try{const _0x3ba5eb=-parseInt(_0x5e1dcc(0x2da))/0x1*(-parseInt(_0x5e1dcc(0x379))/0x2)+parseInt(_0x5e1dcc(0x20c))/0x3+parseInt(_0x5e1dcc(0x1da))/0x4+parseInt(_0x5e1dcc(0x2ae))/0x5+parseInt(_0x5e1dcc(0x36e))/0x6+parseInt(_0x5e1dcc(0x1e5))/0x7+-parseInt(_0x5e1dcc(0x1b1))/0x8;if(_0x3ba5eb===_0x26ea5a)break;else _0x58d27c['push'](_0x58d27c['shift']());}catch(_0x1848fe){_0x58d27c['push'](_0x58d27c['shift']());}}}(a31_0x18ca,0x5602e));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0xd07bd3 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';function a31_0x18ca(){const _0x535886=['segment:parent:list','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','Error:\x20--name\x20is\x20required','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Master\x20+\x20Attributes','\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','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','token:','\x20RT\x20journey','toFixed','schemaValid','ps:rt:jn:resume','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','Fetching\x20current\x20configuration\x20for\x20\x27','\x0a\x20\x20\x20\x20}','allValid','folder-segment','ps:pz:init','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Updating\x20parent\x20segment\x20\x27','Name:\x20','idStitching','audienceId:\x20','\x0a\x20\x20]\x0a}\x0a','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Available\x20attributes:','YAML\x20file:\x20','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\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','Creating','createParent','\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','attributes','Update\x20a\x20realtime\x20personalization\x20entity','site','processedRows','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x27\x20is\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','database','ps:rt:list','✔\x20Deleted\x20personalization\x20\x27','Error:\x20Service\x20name\x20is\x20required','\x20RT\x20configuration\x20is\x20valid','\x20parent\x20segment','Audience\x20ID:','keys','last_page_viewed','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Pause\x20activations\x20in\x20an\x20RT\x20journey','\x0aNew\x20parent\x20segment\x20\x27','localeCompare','keyEventCriteria','schemaError','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Attribute:','RT\x202.0\x20Validate:','✔\x20Found\x20','audienceId','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','entryCriteria','\x20\x20Note:\x20','listFields','push','pullParentYaml','\x20\x20\x20\x20\x20\x20','trim','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Analyzing\x20changes...','Creating\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x0aNo\x20sample\x20data\x20available','user_id','✔\x20Updated\x20personalization\x20service\x20\x27','web','/{name}.yml\x0a','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','\x27\x20with\x20ID:\x20','addAttributesFile','includeSensitive','information_schema','number','\x20parent\x20segment\x20\x27','events','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','behaviors','Resolving\x20parent\x20segment\x20\x27','\x20Configuration\x20is\x20valid','id:\x20','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','\x20No\x20changes\x20-\x20','3160758nQrjgq','description','Rows:','interval','No\x20RT\x20journeys\x20found','segment:parent:push','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','name','Session:','✔\x20Found\x20personalization\x20\x27','error','2GfXxoR','\x0a⚠️\x20\x20Migrating:\x20','status:\x20','match','customers','\x20\x20\x20','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','ps:rt:configuration_versions','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','.yml','ps:pz:service:token:create','<database>.<table>','Schema\x20saved\x20to\x20','\x20field','enriched','output','toLowerCase','customerGroupFile','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Default','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','payload','all','Options\x20(one\x20required):\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','displayBehaviorsStats','setJobId','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','public:','\x20\x20Tables:\x201\x20customers\x20+\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','segment:parent:preview','personalization','keyEventId','timezone','ps:pz:service:list','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','attribute','\x20--behavior\x20\x22','listJourneys','resumeJourney','in\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','columns','column_type','totalEvents','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','darwin','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','parent_segment','displayColumns','run','getBehaviorNames','population','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Found\x20YAML\x20file:\x20','stitchingKeys','Error:\x20--database\x20and\x20--table\x20are\x20required','Enriched:','-1d','cyan','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','⚡\x20Not\x20enabled','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','indexOf','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Creating\x20personalization\x20service\x20\x27','Error\x20reading\x20file:\x20','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Create\x20a\x20realtime\x20personalization\x20entity','✔\x20No\x20changes\x20-\x20\x27','segment:parent:sql','My\x20Service','\x27\x20(id:\x20','matchedCount','✔\x20Query\x20completed:\x20Processed\x20','Personalization\x20service\x20description','delete','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','replace','table','ID\x20Stitching:','9704424Rdoopl','Database:\x20','displaySampleData','\x20\x20No\x20sample\x20data\x20available','✔\x20Retrieved\x20RT\x20configuration\x20version','column_name','\x20configured','ps:pz:create','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','Source:','\x20Added\x20RT\x202.0\x20template\x20section','createToken','Error\x20parsing\x20YAML:\x20','Options:\x0a','personalizationServices','verbose','list','Error:\x20Token\x20name\x20is\x20required','red','endsWith','updatedAt','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','\x27...','behavior','Attempt:','No\x20RT-enabled\x20parent\x20segments\x20found','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20[Job\x20ID:\x20','patchPersonalization','filter','dirname','No\x20personalization\x20services\x20configured','\x20service(s)\x20configured','Events:','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','\x20+\x20[','1228784LxgZFO','RT\x20Journey\x20ID:\x20','List\x20parent\x20segments','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','apply','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','Updating','\x20personalization\x20service','behavior_','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','displayAttributesStats','2337251EYPUwq','parentFolder','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','personalization_services','✔\x20Updated\x20parent\x20segment\x20\x27','No\x20parent\x20segments\x20match\x20pattern:\x20','`\x20to\x20download\x20the\x20configuration\x20first','state','\x0aChanges\x20to\x20apply\x20to\x20\x27','bold','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','getParentSQL','Fetching\x20sample\x20data...','\x20\x20\x20\x20\x20\x20\x20\x20','Creating\x20token\x20\x27','Executing\x20parent\x20segment\x20query...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20Opening\x20','Join\x20on:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','workflowId','No\x20parent\x20segments\x20found','parent_segments','\x20--interval\x20','listParents','displaySummary','To\x20view\x20sample\x20data:','Preview:','Error:\x20Service\x20ID\x20is\x20required','page_view','\x20rows)','\x20--enriched','\x20\x20\x20\x20','eventKind:\x20','\x22\x20}','yes','yellow','121851mPxGOT','sections','workflowAttemptId','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','created:','Fetching\x20customers\x20schema...','ps:pz:service:create','Fetching\x20parent\x20segment\x20\x27','Error:\x20File\x20not\x20found:\x20','resolveParentId','Table:\x20','entryCriteria:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','\x0a⚠️\x20\x20Both\x20','status','Output\x20file:\x20','scheduleType','displayMasterInfo','✔\x20Deleted\x20personalization\x20service\x20\x27','ps:pz:service:delete','customerPercent','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','valid','data','Updating\x20personalization\x20service\x20\x27','ps:pz:service:show','segment:parent:pull','👥\x20','errors','\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}','Attributes','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x0a✔\x20Workflow\x20started','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','parentSegment','validateParentYaml','Fetching\x20behavior\x20list...','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','displayPreviewResults','/app/dw/parentSegments/','✔\x20Created\x20token\x20\x27','Updated','ps:pz:service:update','Validating\x20configuration...','getParentFull','Pattern:\x20','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Error:','\x20service','file','Listing\x20personalizations\x20for\x20\x27','some','collectSchema','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','split','✔\x20Created\x20personalization\x20service\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','\x20to\x20configure\x20your\x20personalization\x20service','displayPreviewHints','joinKey','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Getting\x20personalization\x20\x27','✔\x20Updated\x20personalization\x20\x27','identifier','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','/\x20directories\x20exist.','stats','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','Parent\x20segment:\x20','Delete\x20a\x20realtime\x20personalization','Attributes:','start','pushParentYaml','log','repeat','single','\x20is\x20already\x20up\x20to\x20date','\x0aError:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','test','Listing\x20personalization\x20services\x20for\x20\x27','addBehaviorsFile','Create\x20parent\x20segment\x20\x27','Deleting\x20token\x20\x27','segment:parent:view','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','format','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','⚡\x20Enabled','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20Added\x20personalization\x20template\x20to\x20','\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','Show\x20a\x20specific\x20realtime\x20personalization','identifier:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','sections:','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','utf-8','no\x20tokens\x20configured','sampleData','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\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','ps:pz:show','displayValidateResults','execute','json','Fetching\x20personalization\x20service\x20\x27','segment:parent:update','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','message','Join:','td_client_id','\x20tdx\x20wf\x20attempt\x20','win32','xdg-open','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Error:\x20Token\x20\x27','segment:parent:desc','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','column','Delete\x20a\x20personalization\x20service','workflowSessionId','jsonl','formatSchemaJson','listPersonalizations','ps:rt:jn:pause','/\x20and\x20','green','Resume\x20activations\x20in\x20an\x20RT\x20journey','foreignKey','scheduleOption','Columns:','Fetching\x20SQL\x20for\x20\x27','varchar','Listing\x20fields\x20for\x20\x27','SELECT\x20*\x20FROM\x20','value','Show\x20parent\x20segment\x20details','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','addBehaviors','platform','behaviorsFile','\x20\x20Database:\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','segment','string','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','tokens','✔\x20Renamed\x20directory\x20to\x20','Error:\x20Token\x20ID\x20is\x20required','pauseJourney','Overwrite\x20\x27','updateParent','updated:','\x20RT-enabled\x20parent\x20segment','Get\x20current\x20RT\x20configuration\x20version\x20status','List\x20RT\x20journeys','Output\x20Database:','1014645MptYlk','map','No\x20personalizations\x20configured','Errors:','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','create','Aborted.','any','displayRealtimeInfo','To\x20cancel:','stop','\x20\x20Columns:\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Created','parent_id','Deleting\x20personalization\x20service\x20\x27','customersWithEvents','\x20\x201.\x20Edit\x20','getCurrentConfigVersion','\x20total','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','label','Site:\x20','Apply\x20changes\x20to\x20\x27','Error:\x20Personalization\x20ID\x20is\x20required','\x20stage','(id:\x20','type','\x20--attribute\x20\x22','join','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Error:\x20--attribute\x20requires\x20a\x20name\x0a','sort','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20kill','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','elapsedTimeMillis','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','coveragePercent','realtime','createdAt','master','keyEventId:','153927shONkg','sourceTableValid','public','Listing\x20RT\x20journeys\x20for\x20\x27','using\x20the\x20default\x20path:\x20','launched','length','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','\x20--behavior\x20\x22<name>\x22','paused','patch','tdx\x20ps\x20preview\x20','addAttributes','\x5c$&','session','audienceId:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x0a\x20\x20\x20\x20]','Available\x20behaviors:','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','deletePersonalization','\x27\x20is\x20already\x20up\x20to\x20date','allowedIps','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Patching\x20personalization\x20\x27','\x20true','text','\x20rows\x20','\x20(paused)','Status:','\x20personalization','includeSensitive:','getOutputDatabaseName','\x20\x20\x20\x20-\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Listing\x20parent\x20segments...','toLocaleString','dim','%)\x20','Coverage:','.customers)','sourceTableError','Finding\x20service\x20for\x20token...','limit','customerGroup','stageCount','ps:pz:list'];a31_0x18ca=function(){return _0x535886;};return a31_0x18ca();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a31_0x9019(_0x4a3249,_0x353e62){_0x4a3249=_0x4a3249-0x177;const _0x18ca89=a31_0x18ca();let _0x901961=_0x18ca89[_0x4a3249];return _0x901961;}import a31_0x580b2f 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_0x3bc615(0x1fd),LEGACY_PARENT_SEGMENT_DIR=a31_0x3bc615(0x190);function openBrowser(_0x5974e1){const _0x39920b=a31_0x3bc615,_0x4c1f0b=process[_0x39920b(0x29c)],_0x4984d8=_0x4c1f0b===_0x39920b(0x18d)?'open':_0x4c1f0b===_0x39920b(0x281)?'start':_0x39920b(0x282);spawn(_0x4984d8,[_0x5974e1],{'detached':!![],'stdio':'ignore'})['unref']();}function migrateLegacyDirectory(){const _0x4e9957=a31_0x3bc615;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2ad6e4=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2ad6e4['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x4e9957(0x378)](a31_0x580b2f[_0x4e9957(0x20b)](_0x4e9957(0x21b)+LEGACY_PARENT_SEGMENT_DIR+_0x4e9957(0x28e)+PARENT_SEGMENT_DIR+_0x4e9957(0x250))),console['error'](a31_0x580b2f[_0x4e9957(0x300)](_0x4e9957(0x252)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console['error'](a31_0x580b2f['yellow'](_0x4e9957(0x37a)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x4e9957(0x378)](a31_0x580b2f['green'](_0x4e9957(0x2a4)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1b29df){const _0x529dce=_0x1b29df instanceof Error?_0x1b29df[_0x4e9957(0x27d)]:String(_0x1b29df);return console['error'](a31_0x580b2f['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x529dce+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x3bc615(0x192)](_0x4c70cb){const _0x413ee3=a31_0x3bc615;return migrateLegacyDirectory(),super[_0x413ee3(0x192)](_0x4c70cb);}}function resolveYamlFile(_0x396004){const _0x221f61=a31_0x3bc615;if(_0x396004[_0x221f61(0x1c4)]('.yml')||_0x396004[_0x221f61(0x1c4)]('.yaml'))return _0x396004;return a31_0xd07bd3[_0x221f61(0x2cc)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x396004)+_0x221f61(0x382));}function formatProgressMessage(_0x1ccbe8){const _0x42ce13=a31_0x3bc615,_0x4790bf=_0x1ccbe8[_0x42ce13(0x37c)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x4790bf){const [,_0x528aef,_0x1f6ac2,_0x21781a='']=_0x4790bf;return a31_0x580b2f[_0x42ce13(0x300)](_0x528aef+':')+'\x20'+_0x1f6ac2+a31_0x580b2f['dim'](_0x21781a);}return a31_0x580b2f[_0x42ce13(0x300)](_0x1ccbe8);}function showFileNotFoundError(_0x434454,_0x2a6e32){const _0x2f486b=a31_0x3bc615;console[_0x2f486b(0x378)](a31_0x580b2f['red'](_0x2f486b(0x215)+_0x434454+'\x0a')),console[_0x2f486b(0x378)](a31_0x580b2f[_0x2f486b(0x19b)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x2a6e32+_0x2f486b(0x1eb)));}function displayRealtimeValidation(_0x4a17a8){const _0x3953e0=a31_0x3bc615;if(!_0x4a17a8[_0x3953e0(0x2d6)])return;const _0x41efad=_0x4a17a8[_0x3953e0(0x2d6)],_0x20c35a=_0x41efad['enabled']?a31_0x580b2f[_0x3953e0(0x28f)](_0x3953e0(0x268)):a31_0x580b2f[_0x3953e0(0x20b)](_0x3953e0(0x19d));console[_0x3953e0(0x378)]('\x0a'+a31_0x580b2f[_0x3953e0(0x300)]('RT\x202.0:')+'\x20'+_0x20c35a);if(_0x41efad[_0x3953e0(0x366)]&&_0x41efad[_0x3953e0(0x366)][_0x3953e0(0x2e0)]>0x0){console['error']('\x20\x20'+a31_0x580b2f['dim'](_0x3953e0(0x1d6))+'\x20'+_0x41efad[_0x3953e0(0x366)]['length']+_0x3953e0(0x1b7));for(const _0x19e1d0 of _0x41efad['events']){const _0x1f872e=_0x19e1d0[_0x3953e0(0x2db)]===![]?a31_0x580b2f[_0x3953e0(0x1c3)]('✘'):a31_0x580b2f[_0x3953e0(0x28f)]('✔');console['error'](_0x3953e0(0x207)+_0x1f872e+'\x20'+_0x19e1d0[_0x3953e0(0x375)]),_0x19e1d0[_0x3953e0(0x304)]&&console[_0x3953e0(0x378)](_0x3953e0(0x353)+a31_0x580b2f[_0x3953e0(0x1c3)](_0x19e1d0[_0x3953e0(0x304)]));}}if(_0x41efad[_0x3953e0(0x32d)]&&_0x41efad[_0x3953e0(0x32d)][_0x3953e0(0x2e0)]>0x0){console[_0x3953e0(0x378)]('\x20\x20'+a31_0x580b2f[_0x3953e0(0x300)](_0x3953e0(0x256))+'\x20'+_0x41efad[_0x3953e0(0x32d)][_0x3953e0(0x2e0)]+'\x20configured');for(const _0x5c3317 of _0x41efad[_0x3953e0(0x32d)]){const _0x4982d1=_0x5c3317[_0x3953e0(0x224)]?a31_0x580b2f[_0x3953e0(0x28f)]('✔'):a31_0x580b2f[_0x3953e0(0x1c3)]('✘');console[_0x3953e0(0x378)](_0x3953e0(0x207)+_0x4982d1+'\x20'+_0x5c3317[_0x3953e0(0x375)]+'\x20'+a31_0x580b2f[_0x3953e0(0x300)]('('+_0x5c3317[_0x3953e0(0x2ca)]+')'));}}if(_0x41efad['idStitching']){const _0x3a8232=_0x41efad[_0x3953e0(0x322)][_0x3953e0(0x197)]?.['length']?_0x3953e0(0x1d9)+_0x41efad[_0x3953e0(0x322)][_0x3953e0(0x197)][_0x3953e0(0x2cc)](',\x20')+']':'';console[_0x3953e0(0x378)]('\x20\x20'+a31_0x580b2f[_0x3953e0(0x300)](_0x3953e0(0x1b0))+'\x20'+_0x41efad['idStitching']['primaryKey']+_0x3a8232);}if(_0x41efad['personalizationServices']&&_0x41efad[_0x3953e0(0x1bf)]['length']>0x0){console[_0x3953e0(0x378)]('\x20\x20'+a31_0x580b2f[_0x3953e0(0x300)]('Personalization:')+'\x20'+_0x41efad[_0x3953e0(0x1bf)]['length']+_0x3953e0(0x23f)+(_0x41efad[_0x3953e0(0x1bf)][_0x3953e0(0x2e0)]!==0x1?'s':''));for(const _0x581a32 of _0x41efad[_0x3953e0(0x1bf)]){console[_0x3953e0(0x378)]('\x20\x20\x20\x20-\x20'+_0x581a32[_0x3953e0(0x375)]);}}}function showParentSegmentNotSetError(_0x580382){const _0x196fcd=a31_0x3bc615;console[_0x196fcd(0x378)](a31_0x580b2f[_0x196fcd(0x20b)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x196fcd(0x378)](_0x580382);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x30a);[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x1dc);async[a31_0x3bc615(0x278)](_0x204ca1){const _0x160869=a31_0x3bc615,{options:_0x487403,args:_0x2b44b2,tdx:_0x14fde9}=_0x204ca1,_0xced44d=_0x2b44b2[0x0];_0x487403[_0x160869(0x1c0)]&&(console[_0x160869(0x378)]('Site:\x20'+_0x487403[_0x160869(0x32f)]),_0xced44d&&console[_0x160869(0x378)](_0x160869(0x23c)+_0xced44d));const _0x3239d1=await withSpinner(_0xced44d?_0x160869(0x38e)+_0xced44d+'\x27...':_0x160869(0x2fe),()=>_0x14fde9['segment'][_0x160869(0x1ff)](),{'verbose':_0x487403[_0x160869(0x1c0)]});let _0x5258ca=_0x3239d1['data'];if(_0xced44d){const _0x29987d=_0xced44d[_0x160869(0x1ae)](/[.+^${}()|[\]\\]/g,_0x160869(0x2e7))[_0x160869(0x1ae)](/\*/g,'.*')[_0x160869(0x1ae)](/\?/g,'.'),_0x41f14f=new RegExp('^'+_0x29987d+'$','i');_0x5258ca=_0x5258ca[_0x160869(0x1d2)](_0x5b0f58=>_0x41f14f[_0x160869(0x25f)](_0x5b0f58[_0x160869(0x32d)][_0x160869(0x375)]));}_0x5258ca[_0x160869(0x2cf)]((_0x45cf60,_0x43f945)=>_0x45cf60[_0x160869(0x32d)]['name'][_0x160869(0x342)](_0x43f945[_0x160869(0x32d)][_0x160869(0x375)])),console[_0x160869(0x378)](_0x160869(0x34a)+_0x5258ca[_0x160869(0x2e0)]+_0x160869(0x33a)+(_0x5258ca['length']!==0x1?'s':''));const _0x2eb221=_0x119899=>{const _0x11c0b0=_0x160869;return getConsoleNextUrl(_0x487403[_0x11c0b0(0x32f)],_0x11c0b0(0x236)+_0x119899);};if(_0x487403[_0x160869(0x266)]===_0x160869(0x279)||_0x487403[_0x160869(0x266)]===_0x160869(0x28a)){const _0x19d857=_0x5258ca[_0x160869(0x2af)](_0x985aa7=>({..._0x985aa7,'url':_0x2eb221(_0x985aa7['id'])}));await handleSDKOutput(_0x19d857,_0x487403);}else{if(_0x5258ca[_0x160869(0x2e0)]===0x0)_0xced44d?console[_0x160869(0x259)](_0x160869(0x1ea)+_0xced44d):console[_0x160869(0x259)](_0x160869(0x1fc));else for(const _0x9e065b of _0x5258ca){const _0x8e8504=_0x9e065b[_0x160869(0x32d)]['population']?a31_0x580b2f['dim']('\x20('+formatRows(_0x9e065b[_0x160869(0x32d)][_0x160869(0x194)])+')'):'',_0x1802c4=hyperlink(_0x9e065b[_0x160869(0x32d)][_0x160869(0x375)],_0x2eb221(_0x9e065b['id']));console[_0x160869(0x259)](_0x160869(0x229)+_0x1802c4+_0x8e8504);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x3bc615(0x375)]='segment:parent:create';[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x274);async['execute'](_0x29d973){const _0x3cb06e=a31_0x3bc615,{options:_0x567372,args:_0x2d7c9b,tdx:_0x29b92c}=_0x29d973;console[_0x3cb06e(0x378)](_0x3cb06e(0x17c)+_0x3cb06e(0x1fa)+_0x3cb06e(0x331));const _0x21e212=_0x567372;if(_0x2d7c9b[_0x3cb06e(0x2e0)]===0x0)return console[_0x3cb06e(0x378)](a31_0x580b2f[_0x3cb06e(0x1c3)](_0x3cb06e(0x1cf))),console[_0x3cb06e(0x378)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x4dce89=_0x2d7c9b[0x0];if(!_0x21e212[_0x3cb06e(0x335)]||!_0x21e212['table'])return console[_0x3cb06e(0x378)](_0x3cb06e(0x198)),console[_0x3cb06e(0x378)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x21e212[_0x3cb06e(0x1c0)]&&(console['error'](_0x3cb06e(0x2c5)+_0x21e212[_0x3cb06e(0x32f)]),console[_0x3cb06e(0x378)](_0x3cb06e(0x321)+_0x4dce89),console[_0x3cb06e(0x378)](_0x3cb06e(0x1b2)+_0x21e212['database']),console[_0x3cb06e(0x378)](_0x3cb06e(0x217)+_0x21e212[_0x3cb06e(0x1af)]));const _0x1d455f=await loadJSONFromOptions(_0x21e212[_0x3cb06e(0x32d)],_0x21e212['attributesFile']),_0x399264=await loadJSONFromOptions(_0x21e212[_0x3cb06e(0x368)],_0x21e212[_0x3cb06e(0x29d)]),_0x5a0274=await loadJSONFromOptions(_0x21e212[_0x3cb06e(0x307)],_0x21e212[_0x3cb06e(0x38a)]),_0x45a213={'name':_0x4dce89,'description':_0x21e212['description'],'scheduleType':_0x21e212[_0x3cb06e(0x21e)],'scheduleOption':_0x21e212[_0x3cb06e(0x292)],'timezone':_0x21e212[_0x3cb06e(0x180)],'master':{'parentDatabaseName':_0x21e212[_0x3cb06e(0x335)],'parentTableName':_0x21e212[_0x3cb06e(0x1af)]},'attributes':_0x1d455f,'behaviors':_0x399264,'customerGroup':_0x5a0274},_0x17c917=await withSpinner(_0x3cb06e(0x358)+_0x4dce89+_0x3cb06e(0x1ca),()=>_0x29b92c[_0x3cb06e(0x2a0)][_0x3cb06e(0x32b)](_0x45a213),{'verbose':_0x567372[_0x3cb06e(0x1c0)]}),_0x25b561=_0x17c917[_0x3cb06e(0x225)];return console[_0x3cb06e(0x378)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x25b561[_0x3cb06e(0x375)]+'\x27\x20with\x20ID:\x20'+_0x25b561['id']),await handleSDKOutput([_0x25b561],_0x567372),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x27b);[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x29f);async[a31_0x3bc615(0x278)](_0xc5d7c0){const _0x257584=a31_0x3bc615,{options:_0x32c506,args:_0x8ae68b,tdx:_0x12f0a9}=_0xc5d7c0;console[_0x257584(0x378)](_0x257584(0x381)+_0x257584(0x1fa)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x10df65=_0x32c506;if(_0x8ae68b['length']===0x0)return console[_0x257584(0x378)](a31_0x580b2f[_0x257584(0x1c3)](_0x257584(0x1cf))),console[_0x257584(0x378)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x3473f7=_0x8ae68b[0x0];_0x10df65[_0x257584(0x1c0)]&&(console[_0x257584(0x378)](_0x257584(0x2c5)+_0x10df65[_0x257584(0x32f)]),console[_0x257584(0x378)](_0x257584(0x254)+_0x3473f7));const _0x328a7b=await withSpinner(_0x257584(0x319)+_0x3473f7+_0x257584(0x1ca),()=>_0x12f0a9[_0x257584(0x2a0)][_0x257584(0x23b)](_0x3473f7),{'verbose':_0x10df65[_0x257584(0x1c0)]}),_0x174eae=_0x328a7b[_0x257584(0x225)],_0x129a4e=await loadJSONFromOptions(_0x10df65[_0x257584(0x2e6)],_0x10df65[_0x257584(0x361)]),_0x7a868c=await loadJSONFromOptions(_0x10df65[_0x257584(0x29b)],_0x10df65[_0x257584(0x261)]),_0x5d8688={'name':_0x174eae[_0x257584(0x375)],'description':_0x10df65[_0x257584(0x36f)]!==undefined?_0x10df65[_0x257584(0x36f)]:_0x174eae[_0x257584(0x36f)],'scheduleType':_0x10df65[_0x257584(0x21e)]!==undefined?_0x10df65[_0x257584(0x21e)]:_0x174eae['scheduleType'],'scheduleOption':_0x10df65[_0x257584(0x292)]!==undefined?_0x10df65[_0x257584(0x292)]:_0x174eae[_0x257584(0x292)],'timezone':_0x10df65[_0x257584(0x180)]!==undefined?_0x10df65[_0x257584(0x180)]:_0x174eae[_0x257584(0x180)],'master':_0x174eae[_0x257584(0x2d8)],'attributes':_0x129a4e?[..._0x174eae[_0x257584(0x32d)]||[],..._0x129a4e]:_0x174eae[_0x257584(0x32d)],'behaviors':_0x7a868c?[..._0x174eae[_0x257584(0x368)]||[],..._0x7a868c]:_0x174eae[_0x257584(0x368)],'customerGroup':_0x174eae[_0x257584(0x307)]},_0x33790d=await withSpinner(_0x257584(0x320)+_0x3473f7+_0x257584(0x1ca),()=>_0x12f0a9[_0x257584(0x2a0)][_0x257584(0x2a8)](_0x3473f7,_0x5d8688),{'verbose':_0x10df65[_0x257584(0x1c0)]}),_0x362c70=_0x33790d[_0x257584(0x225)];return console[_0x257584(0x378)](_0x257584(0x1e9)+_0x362c70[_0x257584(0x375)]+'\x27'),await handleSDKOutput([_0x362c70],_0x10df65),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x228);[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x2bb);async[a31_0x3bc615(0x278)](_0x1781de){const _0x306358=a31_0x3bc615,{options:_0x501eb8,args:_0x131d47,tdx:_0x35caa9}=_0x1781de,_0x461f82=_0x501eb8,_0x59bfda=_0x131d47[0x0]||_0x501eb8[_0x306358(0x230)];if(!_0x59bfda)return showParentSegmentNotSetError(_0x306358(0x374)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x461f82['use']&&_0x461f82['output'])return console['error'](a31_0x580b2f[_0x306358(0x1c3)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x306358(0x378)](a31_0x580b2f[_0x306358(0x300)](_0x306358(0x37f))),console['error'](a31_0x580b2f[_0x306358(0x300)](_0x306358(0x2de)+PARENT_SEGMENT_DIR+_0x306358(0x35e))),console[_0x306358(0x378)](a31_0x580b2f[_0x306358(0x19b)](_0x306358(0x18f))),0x1;const _0x50ea23=_0x461f82[_0x306358(0x388)]||a31_0xd07bd3['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x59bfda)+_0x306358(0x382));_0x461f82[_0x306358(0x1c0)]&&(console['error'](_0x306358(0x2c5)+_0x461f82[_0x306358(0x32f)]),console['error'](_0x306358(0x254)+_0x59bfda),console['error'](_0x306358(0x21d)+_0x50ea23));const _0xe56df6=await withSpinner(_0x306358(0x214)+_0x59bfda+_0x306358(0x1ca),()=>_0x35caa9[_0x306358(0x2a0)][_0x306358(0x352)](_0x59bfda),{'verbose':_0x461f82[_0x306358(0x1c0)]}),_0x4546d6=_0xe56df6[_0x306358(0x225)];if(existsSync(_0x50ea23)){const _0x303b21=readFileSync(_0x50ea23,_0x306358(0x271)),_0x3a9857=generateDiff(_0x303b21,_0x4546d6);if(!hasChanges(_0x3a9857))console[_0x306358(0x378)](a31_0x580b2f[_0x306358(0x28f)]('✔')+_0x306358(0x36d)+a31_0x580b2f['cyan'](_0x50ea23)+_0x306358(0x25c));else{console[_0x306358(0x378)]('\x0aChanges\x20to\x20\x27'+_0x50ea23+'\x27:'),console[_0x306358(0x378)]('─'[_0x306358(0x25a)](0x3c)),console['error'](formatDiffWithColors(_0x3a9857)),console[_0x306358(0x378)]('─'['repeat'](0x3c));if(!_0x461f82[_0x306358(0x20a)]){if(!isInteractive())return console['error'](a31_0x580b2f[_0x306358(0x1c3)](_0x306358(0x25d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a31_0x580b2f[_0x306358(0x300)](_0x306358(0x345))),0x1;const _0x2f816c=await confirmKey(_0x306358(0x2a7)+_0x50ea23+'\x27?');if(!_0x2f816c)return console['error'](a31_0x580b2f[_0x306358(0x20b)](_0x306358(0x2b5))),0x1;}writeFileSync(_0x50ea23,_0x4546d6,_0x306358(0x271)),console[_0x306358(0x378)](a31_0x580b2f[_0x306358(0x28f)]('✔')+_0x306358(0x27c)+a31_0x580b2f[_0x306358(0x19b)](_0x50ea23));}}else{const _0xfd51b5=a31_0xd07bd3[_0x306358(0x1d3)](_0x50ea23);!existsSync(_0xfd51b5)&&mkdirSync(_0xfd51b5,{'recursive':!![]}),writeFileSync(_0x50ea23,_0x4546d6,'utf-8'),console['error'](a31_0x580b2f[_0x306358(0x28f)]('✔')+_0x306358(0x27c)+a31_0x580b2f[_0x306358(0x19b)](_0x50ea23));}return saveSessionContext({'parent_segment':_0x59bfda},_0x461f82[_0x306358(0x2e8)]),console[_0x306358(0x378)](a31_0x580b2f[_0x306358(0x28f)]('✔')+'\x20Context\x20set:\x20'+a31_0x580b2f[_0x306358(0x300)](_0x306358(0x190))+'\x20=\x20'+a31_0x580b2f[_0x306358(0x19b)](_0x59bfda)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x373);[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x2f2);async[a31_0x3bc615(0x278)](_0x42e9af){const _0x1fd1c2=a31_0x3bc615,{options:_0xd7ec43,args:_0x51361c,tdx:_0x543728}=_0x42e9af,_0x18907e=_0xd7ec43,_0x107e55=_0x51361c[0x0]||_0xd7ec43['parentSegment'];if(!_0x107e55)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'+_0x1fd1c2(0x359)),0x1;const _0x45f391=resolveYamlFile(_0x107e55);if(!existsSync(_0x45f391))return showFileNotFoundError(_0x45f391,_0x107e55),0x1;_0x18907e[_0x1fd1c2(0x1c0)]&&(console[_0x1fd1c2(0x378)](_0x1fd1c2(0x2c5)+_0x18907e['site']),console[_0x1fd1c2(0x378)](_0x1fd1c2(0x327)+_0x45f391));let _0x442aca;try{_0x442aca=readFileSync(_0x45f391,_0x1fd1c2(0x271));}catch(_0x18e6f6){const _0x219755=_0x18e6f6 instanceof Error?_0x18e6f6[_0x1fd1c2(0x27d)]:String(_0x18e6f6);return console[_0x1fd1c2(0x378)](_0x1fd1c2(0x1a2)+_0x219755),0x1;}const _0x5d9be1=await withSpinner('Analyzing\x20changes...',()=>_0x543728[_0x1fd1c2(0x2a0)][_0x1fd1c2(0x258)](_0x442aca),{'verbose':_0x18907e['verbose']}),_0x292ede=_0x5d9be1['data'],{isNew:_0x26af6f,name:_0x4137a8,hasChanges:_0x5a26a5,diffFormatted:_0x52f60c}=_0x292ede;if(!_0x5a26a5)return console[_0x1fd1c2(0x378)](_0x1fd1c2(0x1a5)+_0x4137a8+_0x1fd1c2(0x2ef)),0x0;_0x26af6f?console[_0x1fd1c2(0x378)](_0x1fd1c2(0x341)+_0x4137a8+'\x27:'):console[_0x1fd1c2(0x378)](_0x1fd1c2(0x1ed)+_0x4137a8+'\x27:');console[_0x1fd1c2(0x378)]('─'[_0x1fd1c2(0x25a)](0x3c)),console[_0x1fd1c2(0x378)](_0x52f60c),console['error']('─'[_0x1fd1c2(0x25a)](0x3c));const _0x5842e3=_0x26af6f?_0x1fd1c2(0x262)+_0x4137a8+'\x27?':_0x1fd1c2(0x2c6)+_0x4137a8+'\x27?';if(!_0x18907e[_0x1fd1c2(0x20a)]){if(!isInteractive())return console[_0x1fd1c2(0x378)](a31_0x580b2f[_0x1fd1c2(0x1c3)](_0x1fd1c2(0x25d)),_0x1fd1c2(0x1f6)),console[_0x1fd1c2(0x378)](a31_0x580b2f[_0x1fd1c2(0x300)](_0x1fd1c2(0x345))),0x1;const _0x168c5a=await confirmKey(_0x5842e3);if(!_0x168c5a)return console['error'](a31_0x580b2f[_0x1fd1c2(0x20b)](_0x1fd1c2(0x2b5))),0x1;}const _0x5acc5b=_0x26af6f?_0x1fd1c2(0x32a):_0x1fd1c2(0x1e0),_0x36cf0c=await withSpinner(_0x5acc5b+_0x1fd1c2(0x365)+_0x4137a8+_0x1fd1c2(0x1ca),()=>_0x292ede[_0x1fd1c2(0x1de)](),{'verbose':_0x18907e[_0x1fd1c2(0x1c0)]}),_0x1617b8=_0x36cf0c[_0x1fd1c2(0x225)],_0x4aaf60=getConsoleNextUrl(_0x18907e[_0x1fd1c2(0x32f)],'/app/dw/parentSegments/'+_0x1617b8['id']),_0x5e73fd=_0x26af6f?_0x1fd1c2(0x2bc):_0x1fd1c2(0x238);return console['error']('✔\x20'+_0x5e73fd+_0x1fd1c2(0x365)+_0x1617b8[_0x1fd1c2(0x375)]+'\x27'),console[_0x1fd1c2(0x378)]('\x20\x20'+_0x4aaf60),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x3bc615(0x375)]='segment:parent:validate';[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x2d2);async[a31_0x3bc615(0x278)](_0x349534){const _0x1fd1f1=a31_0x3bc615,{options:_0x8ead8,args:_0x31a9eb,tdx:_0x585b9d}=_0x349534,_0x275d31=_0x8ead8,_0x31da6d=_0x31a9eb[0x0]||_0x8ead8['parentSegment'];if(!_0x31da6d)return showParentSegmentNotSetError(_0x1fd1f1(0x1ad)+_0x1fd1f1(0x26e)+'Options:\x0a'+_0x1fd1f1(0x346)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x1fd1f1(0x23d)),0x1;const _0x4158b2=resolveYamlFile(_0x31da6d);if(!existsSync(_0x4158b2))return showFileNotFoundError(_0x4158b2,_0x31da6d),0x1;_0x275d31[_0x1fd1f1(0x1c0)]&&(console['error'](_0x1fd1f1(0x2c5)+_0x275d31[_0x1fd1f1(0x32f)]),console[_0x1fd1f1(0x378)]('YAML\x20file:\x20'+_0x4158b2));let _0x2b0fa5;try{_0x2b0fa5=readFileSync(_0x4158b2,'utf-8');}catch(_0x29c3b9){const _0x76983a=_0x29c3b9 instanceof Error?_0x29c3b9[_0x1fd1f1(0x27d)]:String(_0x29c3b9);return console[_0x1fd1f1(0x378)](_0x1fd1f1(0x1a2)+_0x76983a),0x1;}const _0x447850=createCommandSpinner(a31_0x580b2f[_0x1fd1f1(0x300)](_0x1fd1f1(0x23a)),{'verbose':_0x275d31[_0x1fd1f1(0x1c0)]});_0x447850[_0x1fd1f1(0x257)]();const _0x441ab8={'onProgress':_0x167d20=>{const _0x27858e=_0x1fd1f1;_0x447850[_0x27858e(0x2f5)]=formatProgressMessage(_0x167d20);}};if(_0x275d31[_0x1fd1f1(0x2d8)])_0x441ab8[_0x1fd1f1(0x2d8)]=!![];if(_0x275d31['enriched'])_0x441ab8[_0x1fd1f1(0x387)]=!![];_0x275d31[_0x1fd1f1(0x183)]&&(_0x441ab8[_0x1fd1f1(0x183)]=_0x275d31[_0x1fd1f1(0x183)]);_0x275d31[_0x1fd1f1(0x1cb)]&&(_0x441ab8['behavior']=_0x275d31[_0x1fd1f1(0x1cb)]);if(_0x275d31['interval'])_0x441ab8[_0x1fd1f1(0x371)]=_0x275d31['interval'];let _0x4ef8eb;try{_0x4ef8eb=await _0x585b9d[_0x1fd1f1(0x2a0)]['validateParentYaml'](_0x2b0fa5,_0x441ab8),_0x447850[_0x1fd1f1(0x2b9)]();}catch(_0x5c4584){_0x447850[_0x1fd1f1(0x2b9)]();throw _0x5c4584;}const _0x1c6a9f=_0x275d31[_0x1fd1f1(0x371)]||_0x1fd1f1(0x19a);return this[_0x1fd1f1(0x277)](_0x4ef8eb,_0x441ab8,_0x4158b2,_0x1c6a9f),_0x4ef8eb[_0x1fd1f1(0x31b)]?0x0:0x1;}[a31_0x3bc615(0x277)](_0x2a5f11,_0x3c965b,_0x3d5e13,_0x371d43){const _0x84f46=a31_0x3bc615;console[_0x84f46(0x378)]('\x0a'+a31_0x580b2f[_0x84f46(0x1ee)]('Validate:')+'\x20'+_0x2a5f11[_0x84f46(0x375)]),console[_0x84f46(0x378)]('═'[_0x84f46(0x25a)](0x3c)),this['displayMasterInfo'](_0x2a5f11);if(typeof _0x3c965b[_0x84f46(0x183)]==='string'){this[_0x84f46(0x1e4)](_0x2a5f11),this['displaySummary'](_0x2a5f11),this['displayPreviewHints'](_0x3d5e13,_0x371d43,_0x84f46(0x183),_0x3c965b['attribute']);return;}if(_0x3c965b[_0x84f46(0x183)]===!![]){this['displayAttributesStats'](_0x2a5f11),this['displaySummary'](_0x2a5f11),this[_0x84f46(0x249)](_0x3d5e13,_0x371d43,'attributes');return;}if(typeof _0x3c965b['behavior']===_0x84f46(0x2a1)){this[_0x84f46(0x177)](_0x2a5f11,_0x371d43),this[_0x84f46(0x200)](_0x2a5f11),this[_0x84f46(0x249)](_0x3d5e13,_0x371d43,_0x84f46(0x1cb),_0x3c965b[_0x84f46(0x1cb)]);return;}if(_0x3c965b[_0x84f46(0x1cb)]===!![]){this[_0x84f46(0x177)](_0x2a5f11,_0x371d43),this[_0x84f46(0x200)](_0x2a5f11),this[_0x84f46(0x249)](_0x3d5e13,_0x371d43,_0x84f46(0x368));return;}this['displayAttributesStats'](_0x2a5f11),this[_0x84f46(0x177)](_0x2a5f11,_0x371d43),this['displayRealtimeInfo'](_0x2a5f11),this[_0x84f46(0x200)](_0x2a5f11),this[_0x84f46(0x249)](_0x3d5e13,_0x371d43,_0x84f46(0x391));}[a31_0x3bc615(0x2b7)](_0x470574){displayRealtimeValidation(_0x470574);}['displayPreviewHints'](_0x58a461,_0x4a185f,_0x2617f8,_0x37c7bf){const _0x42f340=a31_0x3bc615;console[_0x42f340(0x378)]('\x0a'+a31_0x580b2f[_0x42f340(0x300)](_0x42f340(0x201)));const _0x5a7a9d=_0x4a185f!==_0x42f340(0x19a)?_0x42f340(0x1fe)+_0x4a185f:'';if(_0x2617f8===_0x42f340(0x183)&&_0x37c7bf)console[_0x42f340(0x378)]('\x20\x20'+a31_0x580b2f[_0x42f340(0x300)](_0x42f340(0x2e5)+_0x58a461+'\x20--attribute\x20\x22'+_0x37c7bf+'\x22'+_0x5a7a9d));else{if(_0x2617f8===_0x42f340(0x1cb)&&_0x37c7bf)console[_0x42f340(0x378)]('\x20\x20'+a31_0x580b2f[_0x42f340(0x300)](_0x42f340(0x2e5)+_0x58a461+_0x42f340(0x184)+_0x37c7bf+'\x22'+_0x5a7a9d));else(_0x2617f8===_0x42f340(0x32d)||_0x2617f8===_0x42f340(0x391))&&console[_0x42f340(0x378)]('\x20\x20'+a31_0x580b2f[_0x42f340(0x300)](_0x42f340(0x2e5)+_0x58a461+'\x20--attribute\x20\x22<name>\x22'+_0x5a7a9d));}(_0x2617f8===_0x42f340(0x368)||_0x2617f8===_0x42f340(0x391))&&console[_0x42f340(0x378)]('\x20\x20'+a31_0x580b2f[_0x42f340(0x300)]('tdx\x20ps\x20preview\x20'+_0x58a461+_0x42f340(0x2e2)+_0x5a7a9d)),_0x2617f8==='all'&&console[_0x42f340(0x378)]('\x20\x20'+a31_0x580b2f['dim'](_0x42f340(0x2e5)+_0x58a461+_0x42f340(0x206)+_0x5a7a9d));}[a31_0x3bc615(0x21f)](_0x1c7379){const _0x4a1183=a31_0x3bc615,{master:_0x533f71}=_0x1c7379,_0x16ed39=_0x533f71[_0x4a1183(0x316)]?a31_0x580b2f[_0x4a1183(0x28f)]('✔'):a31_0x580b2f[_0x4a1183(0x1c3)]('✘');console[_0x4a1183(0x378)]('\x0a'+a31_0x580b2f[_0x4a1183(0x300)]('Master\x20Table')),console[_0x4a1183(0x378)](_0x16ed39+'\x20'+a31_0x580b2f[_0x4a1183(0x1ee)](_0x533f71['database']+'.'+_0x533f71[_0x4a1183(0x1af)])),_0x533f71[_0x4a1183(0x316)]?_0x533f71['rowCount']!==undefined&&console['error']('\x20\x20'+a31_0x580b2f['dim'](_0x4a1183(0x370))+'\x20'+a31_0x580b2f[_0x4a1183(0x19b)](formatRows(_0x533f71['rowCount']))):console[_0x4a1183(0x378)]('\x20\x20'+a31_0x580b2f[_0x4a1183(0x1c3)]('Error:')+'\x20'+_0x533f71[_0x4a1183(0x344)]);}[a31_0x3bc615(0x1e4)](_0x1757ab){const _0x2b4e49=a31_0x3bc615;if(_0x1757ab['attributes']['length']===0x0)return;console[_0x2b4e49(0x378)]('\x0a'+a31_0x580b2f['dim'](_0x2b4e49(0x22c)));for(const _0x81b5c5 of _0x1757ab[_0x2b4e49(0x32d)]){const _0x25ead6=_0x81b5c5[_0x2b4e49(0x316)]?a31_0x580b2f[_0x2b4e49(0x28f)]('✔'):a31_0x580b2f[_0x2b4e49(0x1c3)]('✘');let _0x3682f3='';if(_0x81b5c5['schemaValid']&&_0x81b5c5[_0x2b4e49(0x1a9)]!==undefined&&_0x81b5c5['coveragePercent']!==undefined){const _0x3099d5=_0x81b5c5[_0x2b4e49(0x2d5)][_0x2b4e49(0x315)](0x1),_0x28ccf6=_0x81b5c5['coveragePercent']>=0x50?a31_0x580b2f[_0x2b4e49(0x28f)]:_0x81b5c5['coveragePercent']>=0x32?a31_0x580b2f['yellow']:a31_0x580b2f['red'];_0x3682f3='\x20'+a31_0x580b2f['dim'](_0x2b4e49(0x302))+'\x20'+_0x28ccf6(_0x3099d5+'%')+'\x20('+formatRows(_0x81b5c5[_0x2b4e49(0x1a9)])+_0x2b4e49(0x205);}console[_0x2b4e49(0x378)](_0x25ead6+'\x20'+a31_0x580b2f[_0x2b4e49(0x1ee)](_0x81b5c5[_0x2b4e49(0x375)])+_0x3682f3),console['error']('\x20\x20'+a31_0x580b2f[_0x2b4e49(0x300)](_0x2b4e49(0x1ba))+'\x20'+a31_0x580b2f[_0x2b4e49(0x1ee)](_0x81b5c5['database']+'.'+_0x81b5c5['table']));const _0x29210d=_0x81b5c5[_0x2b4e49(0x24a)]===_0x81b5c5[_0x2b4e49(0x291)]?a31_0x580b2f[_0x2b4e49(0x300)]('Join\x20on:')+'\x20'+_0x81b5c5[_0x2b4e49(0x24a)]:a31_0x580b2f['dim'](_0x2b4e49(0x27e))+'\x20'+_0x81b5c5['joinKey']+'\x20=\x20'+_0x81b5c5['foreignKey'];console[_0x2b4e49(0x378)]('\x20\x20'+_0x29210d),console['error']('\x20\x20'+a31_0x580b2f[_0x2b4e49(0x300)](_0x2b4e49(0x293))),this['displayColumns'](_0x81b5c5[_0x2b4e49(0x189)]),!_0x81b5c5[_0x2b4e49(0x316)]&&console[_0x2b4e49(0x378)]('\x20\x20'+a31_0x580b2f[_0x2b4e49(0x1c3)](_0x2b4e49(0x23e))+'\x20'+_0x81b5c5[_0x2b4e49(0x344)]);}}['displayBehaviorsStats'](_0x25050b,_0x519a40){const _0x254a83=a31_0x3bc615;if(_0x25050b[_0x254a83(0x368)][_0x254a83(0x2e0)]===0x0)return;console[_0x254a83(0x378)]('\x0a'+a31_0x580b2f[_0x254a83(0x300)]('Behaviors')+'\x20'+a31_0x580b2f[_0x254a83(0x300)]('('+_0x519a40+')'));for(const _0x509196 of _0x25050b[_0x254a83(0x368)]){const _0x387e6c=_0x509196[_0x254a83(0x316)]?a31_0x580b2f['green']('✔'):a31_0x580b2f['red']('✘');let _0x1fcc07='';if(_0x509196['schemaValid']&&_0x509196[_0x254a83(0x2bf)]!==undefined&&_0x509196[_0x254a83(0x18b)]!==undefined){const _0x2470ce=_0x509196[_0x254a83(0x222)]?.[_0x254a83(0x315)](0x1)||'?',_0x41a3e5=(_0x509196['customerPercent']??0x0)>=0x32?a31_0x580b2f[_0x254a83(0x28f)]:(_0x509196[_0x254a83(0x222)]??0x0)>=0x14?a31_0x580b2f[_0x254a83(0x20b)]:a31_0x580b2f[_0x254a83(0x1c3)];_0x1fcc07='\x20'+a31_0x580b2f[_0x254a83(0x300)]('Customers:')+'\x20'+_0x41a3e5(formatRows(_0x509196[_0x254a83(0x2bf)]))+'\x20('+_0x2470ce+_0x254a83(0x301)+a31_0x580b2f[_0x254a83(0x300)]('Events:')+'\x20'+a31_0x580b2f['cyan'](formatRows(_0x509196[_0x254a83(0x18b)]));}console[_0x254a83(0x378)](_0x387e6c+'\x20'+a31_0x580b2f['bold'](_0x509196['name'])+_0x1fcc07),console[_0x254a83(0x378)]('\x20\x20'+a31_0x580b2f[_0x254a83(0x300)](_0x254a83(0x1ba))+'\x20'+a31_0x580b2f[_0x254a83(0x1ee)](_0x509196[_0x254a83(0x335)]+'.'+_0x509196['table']));const _0x17fa58=_0x509196[_0x254a83(0x24a)]===_0x509196[_0x254a83(0x291)]?a31_0x580b2f[_0x254a83(0x300)](_0x254a83(0x1f8))+'\x20'+_0x509196[_0x254a83(0x24a)]:a31_0x580b2f[_0x254a83(0x300)]('Join:')+'\x20'+_0x509196[_0x254a83(0x24a)]+'\x20=\x20'+_0x509196[_0x254a83(0x291)];console['error']('\x20\x20'+_0x17fa58),console[_0x254a83(0x378)]('\x20\x20'+a31_0x580b2f[_0x254a83(0x300)](_0x254a83(0x293))),this[_0x254a83(0x191)](_0x509196[_0x254a83(0x189)]),!_0x509196[_0x254a83(0x316)]&&console[_0x254a83(0x378)]('\x20\x20'+a31_0x580b2f[_0x254a83(0x1c3)](_0x254a83(0x23e))+'\x20'+_0x509196[_0x254a83(0x344)]);}}['displayColumns'](_0xae0b2){const _0x43969e=a31_0x3bc615;for(const _0x44f8f4 of _0xae0b2){_0x44f8f4[_0x43969e(0x2c4)]===_0x44f8f4[_0x43969e(0x287)]||_0x44f8f4['column']==='*'?console[_0x43969e(0x378)]('\x20\x20\x20\x20-\x20'+_0x44f8f4[_0x43969e(0x2c4)]):console[_0x43969e(0x378)](_0x43969e(0x2fc)+_0x44f8f4[_0x43969e(0x2c4)]+'\x20'+a31_0x580b2f[_0x43969e(0x300)]('('+_0x44f8f4[_0x43969e(0x287)]+')'));}}[a31_0x3bc615(0x200)](_0x1442b5){const _0x3a78df=a31_0x3bc615;console[_0x3a78df(0x378)]('─'[_0x3a78df(0x25a)](0x3c));if(_0x1442b5['errors'][_0x3a78df(0x2e0)]>0x0){console[_0x3a78df(0x378)]('\x0a'+a31_0x580b2f[_0x3a78df(0x1c3)](_0x3a78df(0x2b1)));for(const _0x182c07 of _0x1442b5[_0x3a78df(0x22a)]){console[_0x3a78df(0x378)]('\x20\x20'+a31_0x580b2f['red']('•')+'\x20'+_0x182c07);}}_0x1442b5[_0x3a78df(0x31b)]&&console[_0x3a78df(0x378)]('\x0a'+a31_0x580b2f[_0x3a78df(0x28f)]('✔')+_0x3a78df(0x36a));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x17d);['description']=a31_0x3bc615(0x22d);async[a31_0x3bc615(0x278)](_0x46fbcd){const _0xe3b3=a31_0x3bc615,{options:_0x1e100e,args:_0x20a858,tdx:_0x25ea1a}=_0x46fbcd,_0x1ba789=_0x1e100e,_0x4dd0b1=_0x20a858[0x0]||_0x1e100e[_0xe3b3(0x230)];if(!_0x4dd0b1)return showParentSegmentNotSetError(_0xe3b3(0x2cd)+_0xe3b3(0x1ef)+_0xe3b3(0x392)+_0xe3b3(0x1e3)+_0xe3b3(0x18e)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0xe3b3(0x23d)),0x1;if(!_0x1ba789['master']&&!_0x1ba789[_0xe3b3(0x183)]&&!_0x1ba789[_0xe3b3(0x1cb)]&&!_0x1ba789[_0xe3b3(0x387)])return console['error'](a31_0x580b2f[_0xe3b3(0x1c3)](_0xe3b3(0x38b))),console[_0xe3b3(0x378)](_0xe3b3(0x332)),console['error']('Options:'),console[_0xe3b3(0x378)](_0xe3b3(0x219)),console['error'](_0xe3b3(0x1f9)),console[_0xe3b3(0x378)](_0xe3b3(0x311)),console[_0xe3b3(0x378)](_0xe3b3(0x356)),0x1;const _0x399d87=resolveYamlFile(_0x4dd0b1);if(!existsSync(_0x399d87))return showFileNotFoundError(_0x399d87,_0x4dd0b1),0x1;_0x1ba789[_0xe3b3(0x1c0)]&&(console[_0xe3b3(0x378)]('Site:\x20'+_0x1ba789[_0xe3b3(0x32f)]),console[_0xe3b3(0x378)](_0xe3b3(0x327)+_0x399d87));let _0x312750;try{_0x312750=readFileSync(_0x399d87,_0xe3b3(0x271));}catch(_0x4ed5d7){const _0x623654=_0x4ed5d7 instanceof Error?_0x4ed5d7['message']:String(_0x4ed5d7);return console[_0xe3b3(0x378)](_0xe3b3(0x1a2)+_0x623654),0x1;}let _0x2dbac4;try{_0x2dbac4=parseDef(_0x312750);}catch(_0xa13980){const _0x5a97cb=_0xa13980 instanceof Error?_0xa13980['message']:String(_0xa13980);return console['error'](a31_0x580b2f[_0xe3b3(0x1c3)](_0xe3b3(0x1bd)+_0x5a97cb)),0x1;}if(_0x1ba789[_0xe3b3(0x183)]===!![]||_0x1ba789[_0xe3b3(0x183)]===''){const _0x1c839a=_0x2dbac4['attributes']?.[_0xe3b3(0x2af)](_0x36d5ed=>_0x36d5ed[_0xe3b3(0x375)])||[];if(_0x1c839a[_0xe3b3(0x2e0)]===0x0)console[_0xe3b3(0x378)](a31_0x580b2f[_0xe3b3(0x1c3)](_0xe3b3(0x24f)));else{console[_0xe3b3(0x378)](a31_0x580b2f[_0xe3b3(0x1c3)](_0xe3b3(0x2ce))),console['error'](_0xe3b3(0x326));for(const _0x14c282 of _0x1c839a){console[_0xe3b3(0x378)]('\x20\x20'+a31_0x580b2f[_0xe3b3(0x19b)](_0x14c282));}console[_0xe3b3(0x378)](_0xe3b3(0x393)+_0x4dd0b1+_0xe3b3(0x2cb)+_0x1c839a[0x0]+'\x22');}return 0x1;}if(_0x1ba789[_0xe3b3(0x1cb)]===!![]||_0x1ba789[_0xe3b3(0x1cb)]===''){const _0x220ddb=_0x2dbac4[_0xe3b3(0x368)]?.[_0xe3b3(0x2af)](_0x59550a=>_0x59550a[_0xe3b3(0x375)])||[];if(_0x220ddb[_0xe3b3(0x2e0)]===0x0)console['error'](a31_0x580b2f[_0xe3b3(0x1c3)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console['error'](a31_0x580b2f[_0xe3b3(0x1c3)](_0xe3b3(0x34c))),console[_0xe3b3(0x378)](_0xe3b3(0x2ec));for(const _0x469a72 of _0x220ddb){console['error']('\x20\x20'+a31_0x580b2f[_0xe3b3(0x19b)](_0x469a72));}console[_0xe3b3(0x378)](_0xe3b3(0x393)+_0x4dd0b1+_0xe3b3(0x184)+_0x220ddb[0x0]+'\x22');}return 0x1;}const _0x3c25a1=createCommandSpinner(a31_0x580b2f[_0xe3b3(0x300)](_0xe3b3(0x1f2)),{'verbose':_0x1ba789[_0xe3b3(0x1c0)]});_0x3c25a1[_0xe3b3(0x257)]();const _0xc814ad={'onProgress':_0x120fcd=>{const _0x1ca344=_0xe3b3;_0x3c25a1[_0x1ca344(0x2f5)]=formatProgressMessage(_0x120fcd);}};if(_0x1ba789[_0xe3b3(0x2d8)])_0xc814ad['master']=!![];if(_0x1ba789[_0xe3b3(0x183)]&&typeof _0x1ba789[_0xe3b3(0x183)]==='string')_0xc814ad['attribute']=_0x1ba789[_0xe3b3(0x183)];if(_0x1ba789[_0xe3b3(0x1cb)]&&typeof _0x1ba789[_0xe3b3(0x1cb)]===_0xe3b3(0x2a1))_0xc814ad[_0xe3b3(0x1cb)]=_0x1ba789[_0xe3b3(0x1cb)];if(_0x1ba789[_0xe3b3(0x387)])_0xc814ad['enriched']=!![];if(_0x1ba789['interval'])_0xc814ad[_0xe3b3(0x371)]=_0x1ba789['interval'];let _0x3d4783;try{_0x3d4783=await _0x25ea1a[_0xe3b3(0x2a0)]['previewParentYaml'](_0x312750,_0xc814ad),_0x3c25a1[_0xe3b3(0x2b9)]();}catch(_0xf5b48){_0x3c25a1[_0xe3b3(0x2b9)]();throw _0xf5b48;}return await this[_0xe3b3(0x235)](_0x3d4783,{'master':_0x1ba789[_0xe3b3(0x2d8)],'attribute':typeof _0x1ba789['attribute']==='string'?_0x1ba789['attribute']:undefined,'behavior':typeof _0x1ba789[_0xe3b3(0x1cb)]===_0xe3b3(0x2a1)?_0x1ba789[_0xe3b3(0x1cb)]:undefined,'enriched':_0x1ba789[_0xe3b3(0x387)]}),_0x3d4783[_0xe3b3(0x31b)]?0x0:0x1;}async[a31_0x3bc615(0x235)](_0x55b4d1,_0x4665cb){const _0x38db86=a31_0x3bc615;console[_0x38db86(0x378)]('\x0a'+a31_0x580b2f['bold'](_0x38db86(0x202))+'\x20'+_0x55b4d1[_0x38db86(0x375)]),console[_0x38db86(0x378)]('═'[_0x38db86(0x25a)](0x3c));if(_0x4665cb[_0x38db86(0x2d8)]&&_0x55b4d1[_0x38db86(0x273)]){const _0x316e82=a31_0x580b2f[_0x38db86(0x300)]('Master:')+'\x20'+a31_0x580b2f[_0x38db86(0x1ee)](_0x55b4d1[_0x38db86(0x2d8)][_0x38db86(0x335)]+'.'+_0x55b4d1[_0x38db86(0x2d8)][_0x38db86(0x1af)]);await this[_0x38db86(0x1b3)](_0x316e82,_0x55b4d1[_0x38db86(0x273)]);}else{if(_0x4665cb[_0x38db86(0x183)]&&_0x55b4d1['sampleData']){const _0x4fe960=a31_0x580b2f[_0x38db86(0x300)](_0x38db86(0x348))+'\x20'+a31_0x580b2f['bold'](_0x4665cb[_0x38db86(0x183)]);await this['displaySampleData'](_0x4fe960,_0x55b4d1['sampleData']);}else{if(_0x4665cb[_0x38db86(0x1cb)]&&_0x55b4d1[_0x38db86(0x273)]){const _0x438784=a31_0x580b2f[_0x38db86(0x300)]('Behavior:')+'\x20'+a31_0x580b2f['bold'](_0x4665cb[_0x38db86(0x1cb)]);await this[_0x38db86(0x1b3)](_0x438784,_0x55b4d1['sampleData']);}else{if(_0x4665cb[_0x38db86(0x387)]&&_0x55b4d1[_0x38db86(0x273)]){const _0x1bc44a=a31_0x580b2f[_0x38db86(0x300)](_0x38db86(0x199))+'\x20'+a31_0x580b2f[_0x38db86(0x1ee)](_0x38db86(0x30e));await this['displaySampleData'](_0x1bc44a,_0x55b4d1[_0x38db86(0x273)]);}else!_0x55b4d1['sampleData']&&console['error'](_0x38db86(0x35a));}}}if(_0x55b4d1[_0x38db86(0x22a)][_0x38db86(0x2e0)]>0x0){console['error']('─'[_0x38db86(0x25a)](0x3c)),console[_0x38db86(0x378)]('\x0a'+a31_0x580b2f[_0x38db86(0x1c3)](_0x38db86(0x2b1)));for(const _0x260269 of _0x55b4d1[_0x38db86(0x22a)]){console[_0x38db86(0x378)]('\x20\x20'+a31_0x580b2f[_0x38db86(0x1c3)]('•')+'\x20'+_0x260269);}}}async['displaySampleData'](_0x3ce807,_0x39198c){const _0x81496f=a31_0x3bc615;if(_0x39198c[_0x81496f(0x2e0)]===0x0){console[_0x81496f(0x378)]('\x0a'+_0x3ce807),console[_0x81496f(0x378)](_0x81496f(0x1b4));return;}console[_0x81496f(0x378)]('\x0a'+_0x3ce807);const _0x4f5cbb=Object[_0x81496f(0x33c)](_0x39198c[0x0])[_0x81496f(0x2af)](_0x3545a5=>({'name':_0x3545a5,'type':typeof _0x39198c[0x0][_0x3545a5]===_0x81496f(0x364)?'double':_0x81496f(0x295)})),_0x36fe22={'queryId':'preview','columns':_0x4f5cbb,'data':_0x39198c,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x39198c[_0x81496f(0x2e0)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x19972c=formatAsTable(_0x36fe22,_0x39198c[_0x81496f(0x2e0)],!![]);await writeOutput(_0x19972c,undefined,_0x81496f(0x1af));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x3bc615(0x375)]='segment:parent:run';[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x244);async[a31_0x3bc615(0x278)](_0x36c682){const _0x2168f5=a31_0x3bc615,{options:_0xda3a97,args:_0x1b693d,tdx:_0x4c9890}=_0x36c682,_0xc96772=_0xda3a97,_0x8f2fa8=_0x1b693d[0x0]||_0xda3a97[_0x2168f5(0x230)];if(!_0x8f2fa8)return showParentSegmentNotSetError(_0x2168f5(0x334)+_0x2168f5(0x38f)),0x1;const _0x37f5a2=resolveYamlFile(_0x8f2fa8);if(existsSync(_0x37f5a2)){_0xc96772[_0x2168f5(0x1c0)]&&console[_0x2168f5(0x378)](_0x2168f5(0x196)+_0x37f5a2);let _0x1e0f82;try{_0x1e0f82=readFileSync(_0x37f5a2,_0x2168f5(0x271));}catch(_0x5713ae){const _0x476a95=_0x5713ae instanceof Error?_0x5713ae[_0x2168f5(0x27d)]:String(_0x5713ae);return console[_0x2168f5(0x378)](_0x2168f5(0x1a2)+_0x476a95),0x1;}const _0x5bdb39=await withSpinner(_0x2168f5(0x357),()=>_0x4c9890[_0x2168f5(0x2a0)][_0x2168f5(0x258)](_0x1e0f82),{'verbose':_0xc96772[_0x2168f5(0x1c0)]}),_0x2b95ef=_0x5bdb39[_0x2168f5(0x225)],{isNew:_0x3e03c0,name:_0x1dec62,hasChanges:_0x3b36d2,diffFormatted:_0x4e9d49}=_0x2b95ef;if(_0x3b36d2){_0x3e03c0?console[_0x2168f5(0x378)](_0x2168f5(0x341)+_0x1dec62+'\x27:'):console[_0x2168f5(0x378)](_0x2168f5(0x1ed)+_0x1dec62+'\x27:');console[_0x2168f5(0x378)]('─'['repeat'](0x3c)),console[_0x2168f5(0x378)](_0x4e9d49),console[_0x2168f5(0x378)]('─'[_0x2168f5(0x25a)](0x3c));const _0x4ff080=_0x3e03c0?_0x2168f5(0x262)+_0x1dec62+_0x2168f5(0x20f):'Apply\x20changes\x20to\x20\x27'+_0x1dec62+'\x27\x20and\x20run\x20workflow?';if(!_0xc96772[_0x2168f5(0x20a)]){if(!isInteractive())return console['error'](a31_0x580b2f['red'](_0x2168f5(0x25d)),_0x2168f5(0x1f6)),console[_0x2168f5(0x378)](a31_0x580b2f['dim'](_0x2168f5(0x345))),0x1;const _0xad578f=await confirmKey(_0x4ff080);if(!_0xad578f)return console[_0x2168f5(0x378)](a31_0x580b2f[_0x2168f5(0x20b)](_0x2168f5(0x2b5))),0x1;}const _0x27667e=_0x3e03c0?'Creating':_0x2168f5(0x1e0);await withSpinner(_0x27667e+_0x2168f5(0x365)+_0x1dec62+'\x27...',()=>_0x2b95ef[_0x2168f5(0x1de)](),{'verbose':_0xc96772[_0x2168f5(0x1c0)]});const _0x15f44b=_0x3e03c0?_0x2168f5(0x2bc):_0x2168f5(0x238);console[_0x2168f5(0x378)]('✔\x20'+_0x15f44b+_0x2168f5(0x365)+_0x1dec62+'\x27');}else console['error'](_0x2168f5(0x1a5)+_0x1dec62+_0x2168f5(0x333));}const _0x3ec267=await withSpinner(_0x2168f5(0x347)+_0x8f2fa8+'\x27...',()=>_0x4c9890[_0x2168f5(0x2a0)]['runParent'](_0x8f2fa8),{'verbose':_0xc96772['verbose']}),_0x2f6458=_0x3ec267['data'],_0x245464=getConsoleUrl(_0xc96772['site'],'/app/workflows/'+_0x2f6458[_0x2168f5(0x1fb)]+'/sessions/'+_0x2f6458[_0x2168f5(0x289)]+'/attempt/'+_0x2f6458[_0x2168f5(0x20e)]);return console[_0x2168f5(0x378)](_0x2168f5(0x22e)),console[_0x2168f5(0x378)]('\x20\x20'+a31_0x580b2f[_0x2168f5(0x300)](_0x2168f5(0x33b))+'\x20'+_0x2f6458[_0x2168f5(0x34b)]),console[_0x2168f5(0x378)]('\x20\x20'+a31_0x580b2f[_0x2168f5(0x300)](_0x2168f5(0x2f8))+'\x20'+_0x2f6458['status']),console['error']('\x20\x20'+a31_0x580b2f['dim'](_0x2168f5(0x376))+'\x20'+_0x2f6458[_0x2168f5(0x289)]),console[_0x2168f5(0x378)]('\x20\x20'+a31_0x580b2f[_0x2168f5(0x300)](_0x2168f5(0x1cc))+'\x20'+_0x2f6458[_0x2168f5(0x20e)]),console[_0x2168f5(0x378)]('\x20\x20'+_0x245464),console['error']('\x0a'+a31_0x580b2f[_0x2168f5(0x300)](_0x2168f5(0x2b8))+_0x2168f5(0x280)+_0x2f6458['workflowAttemptId']+_0x2168f5(0x2d1)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']='segment:parent:fields';[a31_0x3bc615(0x36f)]='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x3c6fe6){const _0x37fd88=a31_0x3bc615,{options:_0x167442,args:_0x1efa63,tdx:_0xc30549}=_0x3c6fe6,_0x1be50f=_0x1efa63[0x0]||_0x167442['parentSegment'];if(!_0x1be50f)return showParentSegmentNotSetError(_0x37fd88(0x31f)+_0x37fd88(0x182)),0x1;_0x167442[_0x37fd88(0x1c0)]&&(console['error']('Site:\x20'+_0x167442[_0x37fd88(0x32f)]),console['error'](_0x37fd88(0x254)+_0x1be50f));const _0x1ad580=await withSpinner(_0x37fd88(0x296)+_0x1be50f+_0x37fd88(0x1ca),()=>_0xc30549[_0x37fd88(0x2a0)][_0x37fd88(0x350)](_0x1be50f),{'verbose':_0x167442['verbose']}),_0x1f8b35=_0x1ad580[_0x37fd88(0x225)];console[_0x37fd88(0x378)]('✔\x20Found\x20'+_0x1f8b35[_0x37fd88(0x2e0)]+_0x37fd88(0x386)+(_0x1f8b35[_0x37fd88(0x2e0)]!==0x1?'s':''));if(_0x167442['json']||_0x167442[_0x37fd88(0x28a)])return await handleSDKOutput(_0x1f8b35,_0x167442),0x0;return displayFieldsHumanReadable(_0x1f8b35,_0x1be50f),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a31_0x3bc615(0x264);['description']=a31_0x3bc615(0x299);async[a31_0x3bc615(0x278)](_0x204050){const _0xcdf157=a31_0x3bc615,{options:_0x2a7abe,args:_0x5e974d,tdx:_0x4cf313}=_0x204050,_0x4ca205=_0x2a7abe,_0x2ee49e=_0x5e974d[0x0]||_0x2a7abe['parentSegment'];if(!_0x2ee49e)return showParentSegmentNotSetError(_0xcdf157(0x1c7)+_0xcdf157(0x269)+_0xcdf157(0x1be)+_0xcdf157(0x2ed)),0x1;_0x2a7abe[_0xcdf157(0x1c0)]&&(console[_0xcdf157(0x378)](_0xcdf157(0x2c5)+_0x2a7abe['site']),console['error'](_0xcdf157(0x254)+_0x2ee49e));const _0x57dbef=await withSpinner(_0xcdf157(0x214)+_0x2ee49e+_0xcdf157(0x1ca),()=>_0x4cf313[_0xcdf157(0x2a0)][_0xcdf157(0x23b)](_0x2ee49e),{'verbose':_0x2a7abe['verbose']}),_0x16e6aa=_0x57dbef['data'];if(_0x4ca205[_0xcdf157(0x35d)]){const _0x3f0315=getConsoleNextUrl(_0x4ca205[_0xcdf157(0x32f)],_0xcdf157(0x236)+_0x16e6aa['id']);return console['error'](a31_0x580b2f[_0xcdf157(0x28f)]('✔')+_0xcdf157(0x1f7)+a31_0x580b2f[_0xcdf157(0x19b)](_0x3f0315)),openBrowser(_0x3f0315),0x0;}return await handleSingleObjectOutput(_0x16e6aa,_0x2a7abe),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x285);[a31_0x3bc615(0x36f)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a31_0x3bc615(0x278)](_0x44e4a4){const _0x1cff26=a31_0x3bc615,{options:_0x3f8fe3,args:_0xb132ee,tdx:_0x291f98}=_0x44e4a4,_0x53e516=_0x3f8fe3,_0xdbd301=_0xb132ee[0x0]||_0x3f8fe3['parentSegment'];if(!_0xdbd301)return showParentSegmentNotSetError('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'+_0x1cff26(0x329)+_0x1cff26(0x1be)+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x3f8fe3['verbose']&&(console[_0x1cff26(0x378)]('Site:\x20'+_0x3f8fe3['site']),console[_0x1cff26(0x378)](_0x1cff26(0x254)+_0xdbd301));const _0x41e547=await withSpinner(_0x1cff26(0x369)+_0xdbd301+_0x1cff26(0x1ca),()=>_0x291f98[_0x1cff26(0x2a0)]['resolveParentId'](_0xdbd301),{'verbose':_0x3f8fe3[_0x1cff26(0x1c0)]}),_0x41b3d9=_0x41e547['data'],_0x16e08f=_0x291f98[_0x1cff26(0x2a0)][_0x1cff26(0x2fb)](_0x41b3d9);if(_0x53e516[_0x1cff26(0x388)]){const _0x284e6a=await this['collectSchema'](_0x44e4a4,_0xdbd301,_0x41b3d9,_0x16e08f),_0x570821=this['formatSchemaJson'](_0x284e6a);writeFileSync(_0x53e516[_0x1cff26(0x388)],_0x570821);const _0x4181a0=_0x284e6a[_0x1cff26(0x37d)][_0x1cff26(0x189)]['length']+_0x284e6a['behaviors']['reduce']((_0x31db3c,_0x331cb7)=>_0x31db3c+_0x331cb7[_0x1cff26(0x189)][_0x1cff26(0x2e0)],0x0),_0x53053f=_0x284e6a[_0x1cff26(0x368)][_0x1cff26(0x1d2)](_0x1bb75c=>_0x1bb75c[_0x1cff26(0x189)][_0x1cff26(0x2e0)]===0x0)[_0x1cff26(0x2e0)];return console[_0x1cff26(0x259)](_0x1cff26(0x385)+_0x53e516[_0x1cff26(0x388)]),console['log'](_0x1cff26(0x29e)+_0x16e08f),console[_0x1cff26(0x259)](_0x1cff26(0x17b)+_0x284e6a[_0x1cff26(0x368)][_0x1cff26(0x2e0)]+'\x20behaviors'),console['log'](_0x1cff26(0x2ba)+_0x4181a0+_0x1cff26(0x2c2)),_0x53053f>0x0&&console['log'](_0x1cff26(0x34f)+_0x53053f+_0x1cff26(0x1e7)),0x0;}console[_0x1cff26(0x378)]('\x0a'+a31_0x580b2f[_0x1cff26(0x1ee)](_0x1cff26(0x2ad))+'\x20'+a31_0x580b2f[_0x1cff26(0x19b)](_0x16e08f));const _0x46a609=await withSpinner(_0x1cff26(0x212),()=>_0x291f98['segment']['getParentSQL'](_0x41b3d9),{'verbose':_0x3f8fe3[_0x1cff26(0x1c0)]});console['error']('\x0a'+a31_0x580b2f[_0x1cff26(0x1ee)]('customers')+'\x20'+a31_0x580b2f[_0x1cff26(0x300)]('('+_0x16e08f+_0x1cff26(0x303)));const _0x1d3838=await executeSchemaQuery(_0x46a609[_0x1cff26(0x225)],_0x291f98,_0x3f8fe3);await handleQueryOutput(_0x1d3838,_0x3f8fe3);const _0x322102=await withSpinner(_0x1cff26(0x232),()=>_0x291f98[_0x1cff26(0x2a0)][_0x1cff26(0x193)](_0x41b3d9),{'verbose':_0x3f8fe3[_0x1cff26(0x1c0)]});for(const _0x5dc9c1 of _0x322102[_0x1cff26(0x225)]){const _0x411b82=_0x1cff26(0x1e2)+_0x5dc9c1[_0x1cff26(0x389)]()[_0x1cff26(0x1ae)](/\s+/g,'_'),_0x5d941e=_0x1cff26(0x297)+_0x16e08f+'.'+_0x411b82;console[_0x1cff26(0x378)]('\x0a'+a31_0x580b2f[_0x1cff26(0x1ee)](_0x5dc9c1)+'\x20'+a31_0x580b2f[_0x1cff26(0x300)]('('+_0x16e08f+'.'+_0x411b82+')'));try{const _0x274977=await executeSchemaQuery(_0x5d941e,_0x291f98,_0x3f8fe3);await handleQueryOutput(_0x274977,_0x3f8fe3);}catch{console[_0x1cff26(0x378)](a31_0x580b2f[_0x1cff26(0x20b)]('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a31_0x3bc615(0x243)](_0x527258,_0x203e0b,_0x3afbc3,_0x48424f){const _0x1f3017=a31_0x3bc615,{options:_0x4779de,tdx:_0x21d73a}=_0x527258,_0x30dc3c=await withSpinner(_0x1f3017(0x212),()=>_0x21d73a['segment'][_0x1f3017(0x1f1)](_0x3afbc3),{'verbose':_0x4779de[_0x1f3017(0x1c0)]}),_0x27dd23=await executeSchemaQuery(_0x30dc3c['data'],_0x21d73a,_0x4779de),_0x638fc8=_0x27dd23[_0x1f3017(0x225)]['map'](_0x363ffb=>({'name':_0x363ffb[_0x1f3017(0x1b6)],'type':_0x363ffb['column_type']})),_0x663a91=await withSpinner(_0x1f3017(0x232),()=>_0x21d73a[_0x1f3017(0x2a0)][_0x1f3017(0x193)](_0x3afbc3),{'verbose':_0x4779de[_0x1f3017(0x1c0)]}),_0x56e804=[];for(const _0x218ebc of _0x663a91[_0x1f3017(0x225)]){const _0x21f533=_0x1f3017(0x1e2)+_0x218ebc['toLowerCase']()['replace'](/\s+/g,'_'),_0x23ede4=_0x1f3017(0x297)+_0x48424f+'.'+_0x21f533;let _0x2917ab=[];try{const _0x3ffdb2=await executeSchemaQuery(_0x23ede4,_0x21d73a,_0x4779de);_0x2917ab=_0x3ffdb2[_0x1f3017(0x225)][_0x1f3017(0x2af)](_0x5a0a0f=>({'name':_0x5a0a0f['column_name'],'type':_0x5a0a0f[_0x1f3017(0x18a)]}));}catch{}_0x56e804[_0x1f3017(0x351)]({'table':_0x21f533,'columns':_0x2917ab});}return{'database':_0x48424f,'parent_segment':_0x203e0b,'parent_id':_0x3afbc3,'customers':{'table':'customers','columns':_0x638fc8},'behaviors':_0x56e804};}[a31_0x3bc615(0x28b)](_0x561607){const _0x33b838=a31_0x3bc615,_0x1073ac=_0x292061=>{const _0x2618f9=a31_0x9019;if(_0x292061['length']===0x0)return'[]';const _0x3967d9=_0x292061[_0x2618f9(0x2af)](_0x72c101=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x72c101[_0x2618f9(0x375)]+'\x22,\x20\x22type\x22:\x20\x22'+_0x72c101[_0x2618f9(0x2ca)]+_0x2618f9(0x209));return'[\x0a'+_0x3967d9[_0x2618f9(0x2cc)](',\x0a')+_0x2618f9(0x2eb);},_0x51d21b=_0x561607[_0x33b838(0x368)][_0x33b838(0x2af)](_0x399959=>{const _0x116549=_0x33b838;return _0x116549(0x195)+_0x399959['table']+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x1073ac(_0x399959['columns'])['replace'](/^/gm,'\x20\x20')[_0x116549(0x354)]()+_0x116549(0x31a);})[_0x33b838(0x2cc)](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x561607[_0x33b838(0x335)]+_0x33b838(0x234)+_0x561607[_0x33b838(0x190)]+_0x33b838(0x1c9)+_0x561607[_0x33b838(0x2bd)]+_0x33b838(0x2b3)+_0x561607[_0x33b838(0x37d)][_0x33b838(0x1af)]+_0x33b838(0x1f0)+_0x1073ac(_0x561607[_0x33b838(0x37d)][_0x33b838(0x189)])[_0x33b838(0x1ae)](/^/gm,'\x20\x20')[_0x33b838(0x354)]()+_0x33b838(0x328)+_0x51d21b+_0x33b838(0x324);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x1a6);[a31_0x3bc615(0x36f)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a31_0x3bc615(0x278)](_0x112630){const _0x3cffcc=a31_0x3bc615,{options:_0x37f106,args:_0x1dcc63,tdx:_0x2aba11}=_0x112630,_0x413acd=_0x1dcc63[0x0]||_0x37f106['parentSegment'];if(!_0x413acd)return showParentSegmentNotSetError(_0x3cffcc(0x210)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x37f106[_0x3cffcc(0x1c0)]&&(console[_0x3cffcc(0x378)](_0x3cffcc(0x2c5)+_0x37f106[_0x3cffcc(0x32f)]),console['error'](_0x3cffcc(0x254)+_0x413acd));const _0x24ec7a=await withSpinner(_0x3cffcc(0x369)+_0x413acd+_0x3cffcc(0x1ca),()=>_0x2aba11[_0x3cffcc(0x2a0)]['resolveParentId'](_0x413acd),{'verbose':_0x37f106['verbose']}),_0x29642f=_0x24ec7a['data'],_0x12bc49=await withSpinner(_0x3cffcc(0x294)+_0x413acd+_0x3cffcc(0x1ca),()=>_0x2aba11['segment'][_0x3cffcc(0x1f1)](_0x29642f),{'verbose':_0x37f106[_0x3cffcc(0x1c0)]}),_0x4ad682=_0x12bc49[_0x3cffcc(0x225)];return _0x37f106[_0x3cffcc(0x266)]===_0x3cffcc(0x279)||_0x37f106[_0x3cffcc(0x266)]===_0x3cffcc(0x28a)?await handleSDKOutput([{'sql':_0x4ad682}],_0x37f106):console[_0x3cffcc(0x259)](_0x4ad682),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']='segment:parent:show';[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x270);async['execute'](_0x5ac4ca){const _0x320ea7=a31_0x3bc615,{options:_0x1e1e91,args:_0x836708,tdx:_0x2bd825}=_0x5ac4ca,_0x18d3ac=_0x836708[0x0]||_0x1e1e91[_0x320ea7(0x230)];if(!_0x18d3ac)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0x320ea7(0x2ea)),0x1;_0x1e1e91[_0x320ea7(0x1c0)]&&(console[_0x320ea7(0x378)](_0x320ea7(0x2c5)+_0x1e1e91[_0x320ea7(0x32f)]),console[_0x320ea7(0x378)](_0x320ea7(0x254)+_0x18d3ac));const _0x46e21b=await withSpinner(_0x320ea7(0x369)+_0x18d3ac+_0x320ea7(0x1ca),()=>_0x2bd825[_0x320ea7(0x2a0)][_0x320ea7(0x216)](_0x18d3ac),{'verbose':_0x1e1e91[_0x320ea7(0x1c0)]}),_0x3c606b=_0x46e21b[_0x320ea7(0x225)],_0x21c410=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x18d3ac+_0x320ea7(0x1ca),()=>_0x2bd825[_0x320ea7(0x2a0)][_0x320ea7(0x1f1)](_0x3c606b),{'verbose':_0x1e1e91[_0x320ea7(0x1c0)]});let _0x2e3f41=_0x21c410[_0x320ea7(0x225)];const _0x35efe0=resolveLimit(_0x1e1e91[_0x320ea7(0x306)],DEFAULT_DISPLAY_LIMIT),_0x304385=/\bLIMIT\s+\d+/i[_0x320ea7(0x25f)](_0x2e3f41);!_0x304385&&(_0x2e3f41=_0x2e3f41[_0x320ea7(0x354)]()[_0x320ea7(0x1ae)](/;+$/,''),_0x2e3f41=_0x320ea7(0x1d7)+_0x2e3f41+_0x320ea7(0x325)+_0x35efe0);_0x1e1e91[_0x320ea7(0x1c0)]&&console[_0x320ea7(0x378)]('SQL\x20query:\x0a'+_0x2e3f41);const _0x57df49=await withProgressSpinner(_0x320ea7(0x1f5),async _0x5aa2a8=>{const _0x47081a=_0x320ea7,_0x3f5165=await _0x2bd825['query'][_0x47081a(0x278)](_0x2e3f41,{'catalog':'td','schema':_0x47081a(0x363),'onJobId':_0x566721=>{const _0x4dc745=_0x47081a;_0x5aa2a8[_0x4dc745(0x178)](_0x566721);}});return _0x3f5165;},{'verbose':_0x1e1e91[_0x320ea7(0x1c0)]}),_0xffc46b=_0x57df49[_0x320ea7(0x225)],_0x2e34fb=_0xffc46b['jobId']?_0x320ea7(0x1d0)+_0xffc46b['jobId']+']':'';return console['error'](_0x320ea7(0x1aa)+_0xffc46b[_0x320ea7(0x251)][_0x320ea7(0x330)][_0x320ea7(0x2ff)]()+_0x320ea7(0x2f6)+(_0x320ea7(0x187)+formatElapsed(_0xffc46b[_0x320ea7(0x251)][_0x320ea7(0x2d3)])+_0x2e34fb)),await handleQueryOutput(_0xffc46b,_0x1e1e91),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x336);[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x1c6);async[a31_0x3bc615(0x278)](_0x48f964){const _0x24976c=a31_0x3bc615,{options:_0x524c4d,args:_0x182390,tdx:_0x16ae1f}=_0x48f964,_0x43f057=_0x182390[0x0],_0xefb192=await withSpinner(_0x43f057?_0x24976c(0x1a0)+_0x43f057+_0x24976c(0x1ca):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x16ae1f[_0x24976c(0x2d6)][_0x24976c(0x1c1)](),{'verbose':_0x524c4d['verbose']});let _0x4203f5=_0xefb192[_0x24976c(0x225)]['filter'](_0x784dc1=>_0x784dc1['realtime_enabled']);if(_0x43f057){const _0x3e7092=_0x43f057[_0x24976c(0x1ae)](/[.+^${}()|[\]\\]/g,_0x24976c(0x2e7))[_0x24976c(0x1ae)](/\*/g,'.*')[_0x24976c(0x1ae)](/\?/g,'.'),_0x3c8f5d=new RegExp('^'+_0x3e7092+'$','i');_0x4203f5=_0x4203f5['filter'](_0x26b7e1=>_0x3c8f5d[_0x24976c(0x25f)](_0x26b7e1[_0x24976c(0x375)]));}_0x4203f5[_0x24976c(0x2cf)]((_0x5533d4,_0x362ec9)=>_0x5533d4['name'][_0x24976c(0x342)](_0x362ec9[_0x24976c(0x375)])),console[_0x24976c(0x378)](_0x24976c(0x34a)+_0x4203f5[_0x24976c(0x2e0)]+_0x24976c(0x2aa)+(_0x4203f5[_0x24976c(0x2e0)]!==0x1?'s':''));const _0x43ded9=_0x216519=>{const _0x5a8759=_0x24976c;return getConsoleNextUrl(_0x524c4d[_0x5a8759(0x32f)],_0x5a8759(0x236)+_0x216519);};if(_0x524c4d[_0x24976c(0x266)]===_0x24976c(0x279)||_0x524c4d[_0x24976c(0x266)]===_0x24976c(0x28a)){const _0x44ac25=_0x4203f5[_0x24976c(0x2af)](_0x63ef42=>({..._0x63ef42,'url':_0x43ded9(_0x63ef42['id'])}));await handleSDKOutput(_0x44ac25,_0x524c4d);}else{if(_0x4203f5[_0x24976c(0x2e0)]===0x0)console[_0x24976c(0x259)](_0x24976c(0x1cd));else for(const _0x216114 of _0x4203f5){const _0x29d8e0=_0x216114[_0x24976c(0x194)]?a31_0x580b2f[_0x24976c(0x300)]('\x20('+formatRows(_0x216114['population'])+')'):'',_0x1746c6=hyperlink(_0x216114['name'],_0x43ded9(_0x216114['id']));console['log']('⚡\x20'+_0x1746c6+_0x29d8e0);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']='ps:rt:validate';[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x310);async[a31_0x3bc615(0x278)](_0x4b30e6){const _0x2df38e=a31_0x3bc615,{options:_0xddb2c1,args:_0x53db10,tdx:_0x42fc5b}=_0x4b30e6,_0x372bc8=_0x53db10[0x0]||_0xddb2c1[_0x2df38e(0x230)];if(!_0x372bc8)return showParentSegmentNotSetError(_0x2df38e(0x2e1)+_0x2df38e(0x30f)),0x1;const _0x1dde22=resolveYamlFile(_0x372bc8);if(!existsSync(_0x1dde22))return showFileNotFoundError(_0x1dde22,_0x372bc8),0x1;let _0x50e1fb;try{_0x50e1fb=readFileSync(_0x1dde22,_0x2df38e(0x271));}catch(_0x6b8699){const _0x37df6d=_0x6b8699 instanceof Error?_0x6b8699[_0x2df38e(0x27d)]:String(_0x6b8699);return console[_0x2df38e(0x378)](_0x2df38e(0x1a2)+_0x37df6d),0x1;}const _0x3212ee=createCommandSpinner(a31_0x580b2f['dim']('Validating\x20RT\x20configuration...'),{'verbose':_0xddb2c1[_0x2df38e(0x1c0)]});_0x3212ee[_0x2df38e(0x257)]();const _0x40b21f={'realtime':!![],'onProgress':_0x3e6729=>{const _0x1e9178=_0x2df38e;_0x3212ee[_0x1e9178(0x2f5)]=formatProgressMessage(_0x3e6729);}};let _0x33b408;try{_0x33b408=await _0x42fc5b[_0x2df38e(0x2a0)][_0x2df38e(0x231)](_0x50e1fb,_0x40b21f),_0x3212ee['stop']();}catch(_0x16f9b2){_0x3212ee[_0x2df38e(0x2b9)]();throw _0x16f9b2;}console[_0x2df38e(0x378)]('\x0a'+a31_0x580b2f['bold'](_0x2df38e(0x349))+'\x20'+_0x33b408['name']),console[_0x2df38e(0x378)]('═'[_0x2df38e(0x25a)](0x3c)),displayRealtimeValidation(_0x33b408),console[_0x2df38e(0x378)]('─'[_0x2df38e(0x25a)](0x3c));if(_0x33b408[_0x2df38e(0x22a)]['length']>0x0){console['error']('\x0a'+a31_0x580b2f[_0x2df38e(0x1c3)]('Errors:'));for(const _0x4e0fbe of _0x33b408[_0x2df38e(0x22a)]){console[_0x2df38e(0x378)]('\x20\x20'+a31_0x580b2f[_0x2df38e(0x1c3)]('•')+'\x20'+_0x4e0fbe);}}return _0x33b408[_0x2df38e(0x31b)]&&console['error']('\x0a'+a31_0x580b2f[_0x2df38e(0x28f)]('✔')+_0x2df38e(0x339)),_0x33b408['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x3bc615(0x375)]='ps:rt:jn:list';[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x2ac);async[a31_0x3bc615(0x278)](_0x282db0){const _0x5b1fd5=a31_0x3bc615,{options:_0x117675,args:_0x4c2113,tdx:_0x2f8019}=_0x282db0,_0x2e6978=_0x4c2113[0x0]||_0x117675[_0x5b1fd5(0x230)];if(!_0x2e6978)return showParentSegmentNotSetError(_0x5b1fd5(0x318)+_0x5b1fd5(0x275)),0x1;_0x117675[_0x5b1fd5(0x1c0)]&&(console[_0x5b1fd5(0x378)](_0x5b1fd5(0x2c5)+_0x117675[_0x5b1fd5(0x32f)]),console['error'](_0x5b1fd5(0x254)+_0x2e6978));const _0x33e4ca=await withSpinner(_0x5b1fd5(0x369)+_0x2e6978+_0x5b1fd5(0x1ca),()=>_0x2f8019[_0x5b1fd5(0x2a0)][_0x5b1fd5(0x216)](_0x2e6978),{'verbose':_0x117675['verbose']}),_0x10925f=_0x33e4ca[_0x5b1fd5(0x225)],_0x248c4f=await withSpinner(_0x5b1fd5(0x2dd)+_0x2e6978+_0x5b1fd5(0x1ca),()=>_0x2f8019[_0x5b1fd5(0x2d6)][_0x5b1fd5(0x185)](_0x10925f),{'verbose':_0x117675[_0x5b1fd5(0x1c0)]}),_0x596834=_0x248c4f['data'];console[_0x5b1fd5(0x378)](_0x5b1fd5(0x34a)+_0x596834[_0x5b1fd5(0x2e0)]+_0x5b1fd5(0x314)+(_0x596834[_0x5b1fd5(0x2e0)]!==0x1?'s':''));if(_0x117675['format']===_0x5b1fd5(0x279)||_0x117675[_0x5b1fd5(0x266)]===_0x5b1fd5(0x28a))await handleSDKOutput(_0x596834,_0x117675);else{if(_0x596834['length']===0x0)console[_0x5b1fd5(0x259)](_0x5b1fd5(0x372));else for(const _0x116e10 of _0x596834){const _0x2adee7=_0x116e10[_0x5b1fd5(0x1ec)]===_0x5b1fd5(0x2df)?'🚀':'📝',_0x3662a0=_0x116e10['paused']?a31_0x580b2f['yellow'](_0x5b1fd5(0x2f7)):'',_0x20946b=a31_0x580b2f[_0x5b1fd5(0x300)]('\x20('+_0x116e10[_0x5b1fd5(0x308)]+_0x5b1fd5(0x2c8)+(_0x116e10[_0x5b1fd5(0x308)]!==0x1?'s':'')+')');console[_0x5b1fd5(0x259)](_0x2adee7+'\x20'+_0x116e10['name']+_0x3662a0+_0x20946b);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x28d);['description']=a31_0x3bc615(0x340);async[a31_0x3bc615(0x278)](_0x2454f6){const _0x5778e3=a31_0x3bc615,{options:_0x36ce0e,args:_0x278b50,tdx:_0x59e236}=_0x2454f6,_0x5ad9e8=_0x278b50[0x0];if(!_0x5ad9e8)return console[_0x5778e3(0x378)](a31_0x580b2f[_0x5778e3(0x1c3)](_0x5778e3(0x1d8))),console[_0x5778e3(0x378)](_0x5778e3(0x188)),console[_0x5778e3(0x378)](a31_0x580b2f[_0x5778e3(0x300)](_0x5778e3(0x253))),0x1;_0x36ce0e[_0x5778e3(0x1c0)]&&(console[_0x5778e3(0x378)](_0x5778e3(0x2c5)+_0x36ce0e[_0x5778e3(0x32f)]),console[_0x5778e3(0x378)](_0x5778e3(0x1db)+_0x5ad9e8));const _0x4a2114=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x5ad9e8+'\x27...',()=>_0x59e236[_0x5778e3(0x2d6)][_0x5778e3(0x2a6)](_0x5ad9e8),{'verbose':_0x36ce0e[_0x5778e3(0x1c0)]}),_0x21626b=_0x4a2114[_0x5778e3(0x225)];console[_0x5778e3(0x378)](_0x5778e3(0x1b9)+_0x21626b['name']+'\x27');if(_0x36ce0e[_0x5778e3(0x266)]===_0x5778e3(0x279)||_0x36ce0e['format']===_0x5778e3(0x28a))await handleSDKOutput([_0x21626b],_0x36ce0e);else{const _0x1a3f19=_0x21626b['state']===_0x5778e3(0x2df)?'🚀':'📝',_0x71ebc0=_0x21626b[_0x5778e3(0x2e3)]?a31_0x580b2f[_0x5778e3(0x20b)](_0x5778e3(0x2f7)):'';console[_0x5778e3(0x259)](_0x1a3f19+'\x20'+_0x21626b[_0x5778e3(0x375)]+_0x71ebc0);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x317);['description']=a31_0x3bc615(0x290);async[a31_0x3bc615(0x278)](_0x3230af){const _0x23847c=a31_0x3bc615,{options:_0x76947c,args:_0x4dd1c3,tdx:_0x2bd26f}=_0x3230af,_0x590f4a=_0x4dd1c3[0x0];if(!_0x590f4a)return console[_0x23847c(0x378)](a31_0x580b2f[_0x23847c(0x1c3)](_0x23847c(0x1d8))),console[_0x23847c(0x378)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a'),console[_0x23847c(0x378)](a31_0x580b2f['dim']('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x76947c[_0x23847c(0x1c0)]&&(console[_0x23847c(0x378)](_0x23847c(0x2c5)+_0x76947c[_0x23847c(0x32f)]),console[_0x23847c(0x378)](_0x23847c(0x1db)+_0x590f4a));const _0x50e954=await withSpinner(_0x23847c(0x1df)+_0x590f4a+_0x23847c(0x1ca),()=>_0x2bd26f[_0x23847c(0x2d6)][_0x23847c(0x186)](_0x590f4a),{'verbose':_0x76947c['verbose']}),_0xfdc09f=_0x50e954[_0x23847c(0x225)];console[_0x23847c(0x378)](_0x23847c(0x30d)+_0xfdc09f[_0x23847c(0x375)]+'\x27');if(_0x76947c['format']===_0x23847c(0x279)||_0x76947c[_0x23847c(0x266)]==='jsonl')await handleSDKOutput([_0xfdc09f],_0x76947c);else{const _0x580aa0=_0xfdc09f[_0x23847c(0x1ec)]===_0x23847c(0x2df)?'🚀':'📝',_0x3acd2a=_0xfdc09f[_0x23847c(0x2e3)]?a31_0x580b2f['yellow'](_0x23847c(0x2f7)):'';console[_0x23847c(0x259)](_0x580aa0+'\x20'+_0xfdc09f[_0x23847c(0x375)]+_0x3acd2a);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x380);[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x2ab);async[a31_0x3bc615(0x278)](_0x270b88){const _0x247d49=a31_0x3bc615,{options:_0x2b217d,args:_0xe8fbbe,tdx:_0x598d37}=_0x270b88,_0x4071cb=_0xe8fbbe[0x0]||_0x2b217d['parentSegment'];if(!_0x4071cb)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment'),0x1;_0x2b217d[_0x247d49(0x1c0)]&&(console[_0x247d49(0x378)]('Site:\x20'+_0x2b217d[_0x247d49(0x32f)]),console[_0x247d49(0x378)](_0x247d49(0x254)+_0x4071cb));const _0x364679=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4071cb+_0x247d49(0x1ca),()=>_0x598d37[_0x247d49(0x2a0)][_0x247d49(0x216)](_0x4071cb),{'verbose':_0x2b217d[_0x247d49(0x1c0)]}),_0x255487=_0x364679[_0x247d49(0x225)],_0x33777d=await withSpinner(_0x247d49(0x223)+_0x4071cb+_0x247d49(0x1ca),()=>_0x598d37[_0x247d49(0x2d6)][_0x247d49(0x2c1)](_0x255487),{'verbose':_0x2b217d[_0x247d49(0x1c0)]}),_0x2e597d=_0x33777d['data'];return console[_0x247d49(0x378)](_0x247d49(0x1b5)),_0x2b217d['format']===_0x247d49(0x279)||_0x2b217d[_0x247d49(0x266)]===_0x247d49(0x28a)?await handleSDKOutput([_0x2e597d],_0x2b217d):(console[_0x247d49(0x259)](_0x247d49(0x36b)+_0x2e597d['id']),console[_0x247d49(0x259)](_0x247d49(0x323)+_0x2e597d[_0x247d49(0x34b)]),console['log'](_0x247d49(0x26d)+_0x2e597d[_0x247d49(0x24e)]),console['log'](_0x247d49(0x208)+_0x2e597d['eventKind']),console[_0x247d49(0x259)](_0x247d49(0x37b)+_0x2e597d[_0x247d49(0x21c)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x181);['description']=a31_0x3bc615(0x19e);async[a31_0x3bc615(0x278)](_0x1e3e66){const _0x3a58ec=a31_0x3bc615,{options:_0x56dec9,args:_0x3df068,tdx:_0x1aeeb3}=_0x1e3e66,_0x5203b7=_0x3df068[0x0]||_0x56dec9[_0x3a58ec(0x230)];if(!_0x5203b7)return showParentSegmentNotSetError(_0x3a58ec(0x267)+_0x3a58ec(0x32c)),0x1;const _0x4037fb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5203b7+_0x3a58ec(0x1ca),()=>_0x1aeeb3[_0x3a58ec(0x2a0)][_0x3a58ec(0x216)](_0x5203b7),{'verbose':_0x56dec9[_0x3a58ec(0x1c0)]}),_0x4be93a=_0x4037fb[_0x3a58ec(0x225)],_0x53d31b=await withSpinner(_0x3a58ec(0x260)+_0x5203b7+_0x3a58ec(0x1ca),()=>_0x1aeeb3[_0x3a58ec(0x17e)][_0x3a58ec(0x1c1)](_0x4be93a),{'verbose':_0x56dec9[_0x3a58ec(0x1c0)]}),_0x3ee50a=_0x53d31b[_0x3a58ec(0x225)];console[_0x3a58ec(0x378)](_0x3a58ec(0x34a)+_0x3ee50a[_0x3a58ec(0x2e0)]+_0x3a58ec(0x1e1)+(_0x3ee50a['length']!==0x1?'s':''));if(_0x56dec9[_0x3a58ec(0x266)]===_0x3a58ec(0x279)||_0x56dec9['format']===_0x3a58ec(0x28a))await handleSDKOutput(_0x3ee50a,_0x56dec9);else{if(_0x3ee50a['length']===0x0)console[_0x3a58ec(0x259)](_0x3a58ec(0x1d4)),console[_0x3a58ec(0x378)](a31_0x580b2f['cyan'](_0x3a58ec(0x19c)));else for(const _0x1475c0 of _0x3ee50a){console[_0x3a58ec(0x259)](a31_0x580b2f[_0x3a58ec(0x1ee)](_0x1475c0[_0x3a58ec(0x375)])+'\x20'+a31_0x580b2f[_0x3a58ec(0x300)](_0x3a58ec(0x2c9)+_0x1475c0['id']+')'));_0x1475c0[_0x3a58ec(0x36f)]&&console[_0x3a58ec(0x259)]('\x20\x20'+a31_0x580b2f['dim'](_0x1475c0[_0x3a58ec(0x36f)]));if(_0x1475c0[_0x3a58ec(0x2a3)]&&_0x1475c0[_0x3a58ec(0x2a3)][_0x3a58ec(0x2e0)]>0x0)for(const _0x55dec9 of _0x1475c0[_0x3a58ec(0x2a3)]){const _0x6f1cc2=_0x55dec9[_0x3a58ec(0x2f0)]?.['length']?_0x55dec9[_0x3a58ec(0x2f0)][_0x3a58ec(0x2cc)](',\x20'):_0x3a58ec(0x2b6);console['log']('\x20\x20'+a31_0x580b2f['cyan'](_0x3a58ec(0x313))+'\x20'+_0x55dec9[_0x3a58ec(0x375)]+'\x20'+a31_0x580b2f[_0x3a58ec(0x300)](_0x3a58ec(0x2c9)+_0x55dec9['id']+')')),console[_0x3a58ec(0x259)](_0x3a58ec(0x207)+a31_0x580b2f['dim']('allowed\x20IPs:')+'\x20'+_0x6f1cc2);}else console['log']('\x20\x20'+a31_0x580b2f[_0x3a58ec(0x300)](_0x3a58ec(0x272)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x213);['description']=a31_0x3bc615(0x265);async[a31_0x3bc615(0x278)](_0x49d387){const _0x33bc9d=a31_0x3bc615,{options:_0x402e87,args:_0x326a0d,tdx:_0x4e9fc2}=_0x49d387,_0x535ed4=_0x402e87,_0x5286ea=_0x326a0d[0x0],_0x2e79b4=_0x326a0d[0x1]||_0x402e87[_0x33bc9d(0x230)];if(!_0x5286ea)return console['error'](_0x33bc9d(0x338)),console[_0x33bc9d(0x378)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]'),console[_0x33bc9d(0x378)](_0x33bc9d(0x33e)),0x1;if(!_0x2e79b4)return showParentSegmentNotSetError(_0x33bc9d(0x18c)+_0x33bc9d(0x33e)),0x1;const _0x5cc5f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2e79b4+_0x33bc9d(0x1ca),()=>_0x4e9fc2[_0x33bc9d(0x2a0)][_0x33bc9d(0x216)](_0x2e79b4),{'verbose':_0x402e87['verbose']}),_0x2a8178=_0x5cc5f[_0x33bc9d(0x225)],_0x9ba465={'name':_0x5286ea,'description':_0x535ed4[_0x33bc9d(0x36f)],'public':_0x535ed4['public']},_0xc51ee9=await withSpinner(_0x33bc9d(0x1a1)+_0x5286ea+_0x33bc9d(0x1ca),()=>_0x4e9fc2['personalization'][_0x33bc9d(0x2b4)](_0x2a8178,_0x9ba465),{'verbose':_0x402e87[_0x33bc9d(0x1c0)]}),_0x11770b=_0xc51ee9[_0x33bc9d(0x225)];return console[_0x33bc9d(0x378)](_0x33bc9d(0x246)+_0x11770b[_0x33bc9d(0x375)]+_0x33bc9d(0x360)+_0x11770b['id']),await handleSDKOutput([_0x11770b],_0x402e87),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x227);['description']='Show\x20personalization\x20service\x20details';async[a31_0x3bc615(0x278)](_0x5309d4){const _0x1f4d2b=a31_0x3bc615,{options:_0x3522eb,args:_0x4eb245,tdx:_0x182a12}=_0x5309d4,_0x59ce9a=_0x4eb245[0x0],_0x5bd2b8=_0x4eb245[0x1]||_0x3522eb[_0x1f4d2b(0x230)];if(!_0x59ce9a)return console['error'](_0x1f4d2b(0x203)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console['error'](_0x1f4d2b(0x1c8)),0x1;if(!_0x5bd2b8)return showParentSegmentNotSetError(_0x1f4d2b(0x2b2)+_0x1f4d2b(0x1c8)),0x1;const _0x436eba=await withSpinner(_0x1f4d2b(0x369)+_0x5bd2b8+_0x1f4d2b(0x1ca),()=>_0x182a12[_0x1f4d2b(0x2a0)][_0x1f4d2b(0x216)](_0x5bd2b8),{'verbose':_0x3522eb[_0x1f4d2b(0x1c0)]}),_0xb91e7b=_0x436eba['data'],_0x42d8b9=await withSpinner(_0x1f4d2b(0x27a)+_0x59ce9a+_0x1f4d2b(0x1ca),()=>_0x182a12[_0x1f4d2b(0x17e)]['get'](_0xb91e7b,_0x59ce9a),{'verbose':_0x3522eb[_0x1f4d2b(0x1c0)]}),_0x57a751=_0x42d8b9[_0x1f4d2b(0x225)];if(_0x3522eb[_0x1f4d2b(0x279)]||_0x3522eb[_0x1f4d2b(0x28a)])await handleSDKOutput([_0x57a751],_0x3522eb);else{console[_0x1f4d2b(0x259)](a31_0x580b2f[_0x1f4d2b(0x1ee)](_0x57a751[_0x1f4d2b(0x375)])+'\x20'+a31_0x580b2f[_0x1f4d2b(0x300)](_0x1f4d2b(0x2c9)+_0x57a751['id']+')'));_0x57a751['description']&&console[_0x1f4d2b(0x259)]('\x20\x20'+a31_0x580b2f[_0x1f4d2b(0x300)](_0x57a751[_0x1f4d2b(0x36f)]));console[_0x1f4d2b(0x259)]('\x20\x20'+a31_0x580b2f[_0x1f4d2b(0x19b)](_0x1f4d2b(0x17a))+'\x20'+(_0x57a751[_0x1f4d2b(0x2dc)]?_0x1f4d2b(0x20a):'no'));if(_0x57a751[_0x1f4d2b(0x2a3)]&&_0x57a751[_0x1f4d2b(0x2a3)][_0x1f4d2b(0x2e0)]>0x0)for(const _0x28f00c of _0x57a751[_0x1f4d2b(0x2a3)]){const _0x533822=_0x28f00c[_0x1f4d2b(0x2f0)]?.[_0x1f4d2b(0x2e0)]?_0x28f00c[_0x1f4d2b(0x2f0)][_0x1f4d2b(0x2cc)](',\x20'):_0x1f4d2b(0x2b6);console[_0x1f4d2b(0x259)]('\x20\x20'+a31_0x580b2f['cyan'](_0x1f4d2b(0x313))+'\x20'+_0x28f00c[_0x1f4d2b(0x375)]+'\x20'+a31_0x580b2f['dim'](_0x1f4d2b(0x2c9)+_0x28f00c['id']+')')),console[_0x1f4d2b(0x259)](_0x1f4d2b(0x207)+a31_0x580b2f['dim']('allowed\x20IPs:')+'\x20'+_0x533822);}else console[_0x1f4d2b(0x259)]('\x20\x20'+a31_0x580b2f['dim'](_0x1f4d2b(0x272)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x221);['description']=a31_0x3bc615(0x288);async[a31_0x3bc615(0x278)](_0x5ed56a){const _0x544275=a31_0x3bc615,{options:_0xa72a1e,args:_0x1d13a2,tdx:_0x5babf4}=_0x5ed56a,_0x59508d=_0x1d13a2[0x0],_0x191d1a=_0x1d13a2[0x1]||_0xa72a1e[_0x544275(0x230)];if(!_0x59508d)return console[_0x544275(0x378)](_0x544275(0x203)),console[_0x544275(0x378)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x544275(0x378)](_0x544275(0x283)),0x1;if(!_0x191d1a)return showParentSegmentNotSetError(_0x544275(0x1ce)+_0x544275(0x283)),0x1;const _0x544056=await withSpinner(_0x544275(0x369)+_0x191d1a+_0x544275(0x1ca),()=>_0x5babf4[_0x544275(0x2a0)][_0x544275(0x216)](_0x191d1a),{'verbose':_0xa72a1e[_0x544275(0x1c0)]}),_0x3d3735=_0x544056['data'];return await withSpinner(_0x544275(0x2be)+_0x59508d+'\x27...',()=>_0x5babf4[_0x544275(0x17e)][_0x544275(0x1ac)](_0x3d3735,_0x59508d),{'verbose':_0xa72a1e[_0x544275(0x1c0)]}),console[_0x544275(0x378)](_0x544275(0x220)+_0x59508d+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x239);[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x36c);async[a31_0x3bc615(0x278)](_0x4a7c4a){const _0x2a843c=a31_0x3bc615,{options:_0x1e5e50,args:_0x37d5fb,tdx:_0x4cd1e6}=_0x4a7c4a,_0x34b455=_0x1e5e50,_0x21de0e=_0x37d5fb[0x0],_0x28bbac=_0x37d5fb[0x1]||_0x1e5e50[_0x2a843c(0x230)];if(!_0x21de0e)return console[_0x2a843c(0x378)](_0x2a843c(0x203)),console[_0x2a843c(0x378)](_0x2a843c(0x247)),console[_0x2a843c(0x378)](_0x2a843c(0x2f1)),0x1;if(!_0x34b455['name'])return console[_0x2a843c(0x378)](_0x2a843c(0x30c)),console[_0x2a843c(0x378)](_0x2a843c(0x247)),0x1;if(!_0x28bbac)return showParentSegmentNotSetError(_0x2a843c(0x21a)+_0x2a843c(0x2f1)),0x1;const _0x25a5aa=await withSpinner(_0x2a843c(0x369)+_0x28bbac+_0x2a843c(0x1ca),()=>_0x4cd1e6[_0x2a843c(0x2a0)]['resolveParentId'](_0x28bbac),{'verbose':_0x1e5e50['verbose']}),_0x504764=_0x25a5aa[_0x2a843c(0x225)],_0x4278b5={'name':_0x34b455[_0x2a843c(0x375)]};_0x34b455[_0x2a843c(0x36f)]!==undefined&&(_0x4278b5['description']=_0x34b455[_0x2a843c(0x36f)]);const _0xd610=await withSpinner(_0x2a843c(0x226)+_0x21de0e+_0x2a843c(0x1ca),()=>_0x4cd1e6['personalization'][_0x2a843c(0x2e4)](_0x504764,_0x21de0e,_0x4278b5),{'verbose':_0x1e5e50[_0x2a843c(0x1c0)]}),_0x29c1af=_0xd610['data'];return console[_0x2a843c(0x378)](_0x2a843c(0x35c)+_0x29c1af['name']+'\x27'),await handleSDKOutput([_0x29c1af],_0x1e5e50),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x383);[a31_0x3bc615(0x36f)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a31_0x3bc615(0x278)](_0x25f66b){const _0x53efd4=a31_0x3bc615,{options:_0x5d268b,args:_0x2367c6,tdx:_0x483493}=_0x25f66b,_0x3276bf=_0x5d268b,_0x2c1e3e=_0x2367c6[0x0],_0x3f79f9=_0x2367c6[0x1],_0x5b9605=_0x2367c6[0x2]||_0x5d268b[_0x53efd4(0x230)];if(!_0x2c1e3e)return console[_0x53efd4(0x378)](_0x53efd4(0x1c2)),console[_0x53efd4(0x378)](_0x53efd4(0x2fd)),console[_0x53efd4(0x378)](_0x53efd4(0x24b)),0x1;if(!_0x3f79f9)return console['error'](_0x53efd4(0x203)),console[_0x53efd4(0x378)](_0x53efd4(0x2fd)),console[_0x53efd4(0x378)](_0x53efd4(0x24b)),0x1;if(!_0x5b9605)return showParentSegmentNotSetError(_0x53efd4(0x34d)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x360102=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5b9605+_0x53efd4(0x1ca),()=>_0x483493[_0x53efd4(0x2a0)]['resolveParentId'](_0x5b9605),{'verbose':_0x5d268b[_0x53efd4(0x1c0)]}),_0x40df67=_0x360102['data'],_0x3c9c7d={'name':_0x2c1e3e};_0x3276bf[_0x53efd4(0x2f0)]&&(_0x3c9c7d[_0x53efd4(0x2f0)]=_0x3276bf['allowedIps'][_0x53efd4(0x245)](',')[_0x53efd4(0x2af)](_0x154f00=>_0x154f00['trim']()));_0x3276bf[_0x53efd4(0x36f)]&&(_0x3c9c7d['description']=_0x3276bf[_0x53efd4(0x36f)]);const _0x55b034=await withSpinner(_0x53efd4(0x1f4)+_0x2c1e3e+'\x27\x20for\x20service\x20\x27'+_0x3f79f9+'\x27...',()=>_0x483493[_0x53efd4(0x17e)][_0x53efd4(0x1bc)](_0x40df67,_0x3f79f9,_0x3c9c7d),{'verbose':_0x5d268b['verbose']}),_0x18fff7=_0x55b034[_0x53efd4(0x225)];return console[_0x53efd4(0x378)](_0x53efd4(0x237)+_0x18fff7[_0x53efd4(0x375)]+'\x27\x20with\x20ID:\x20'+_0x18fff7['id']),_0x18fff7['value']&&(console[_0x53efd4(0x378)](a31_0x580b2f['yellow'](_0x53efd4(0x30b))),console[_0x53efd4(0x378)](a31_0x580b2f[_0x53efd4(0x19b)](_0x18fff7[_0x53efd4(0x298)])),console[_0x53efd4(0x378)]('')),await handleSDKOutput([_0x18fff7],_0x5d268b),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x3bc615(0x375)]='ps:pz:service:token:delete';[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x1dd);async[a31_0x3bc615(0x278)](_0x1e5ab3){const _0x2e3021=a31_0x3bc615,{options:_0xa473b7,args:_0x1a4c00,tdx:_0x14ccd8}=_0x1e5ab3,_0x4cc95f=_0x1a4c00[0x0],_0x4d24e6=_0x1a4c00[0x1]||_0xa473b7[_0x2e3021(0x230)];if(!_0x4cc95f)return console[_0x2e3021(0x378)](_0x2e3021(0x2a5)),console['error'](_0x2e3021(0x25e)),console[_0x2e3021(0x378)](_0x2e3021(0x312)),0x1;if(!_0x4d24e6)return showParentSegmentNotSetError(_0x2e3021(0x286)+_0x2e3021(0x312)),0x1;const _0x4129f9=await withSpinner(_0x2e3021(0x369)+_0x4d24e6+_0x2e3021(0x1ca),()=>_0x14ccd8[_0x2e3021(0x2a0)][_0x2e3021(0x216)](_0x4d24e6),{'verbose':_0xa473b7[_0x2e3021(0x1c0)]}),_0x16baf0=_0x4129f9['data'],_0x532434=await withSpinner(_0x2e3021(0x305),()=>_0x14ccd8[_0x2e3021(0x17e)][_0x2e3021(0x1c1)](_0x16baf0),{'verbose':_0xa473b7['verbose']}),_0x22c1a6=_0x532434['data'];let _0x11b7fd;for(const _0xe55f56 of _0x22c1a6){if(_0xe55f56['tokens']?.[_0x2e3021(0x242)](_0x253083=>_0x253083['id']===_0x4cc95f)){_0x11b7fd=_0xe55f56['id'];break;}}if(!_0x11b7fd)return console[_0x2e3021(0x378)](_0x2e3021(0x284)+_0x4cc95f+_0x2e3021(0x35f)),0x1;const _0x1b4008=await withSpinner(_0x2e3021(0x263)+_0x4cc95f+'\x27...',()=>_0x14ccd8[_0x2e3021(0x17e)]['deleteToken'](_0x16baf0,_0x11b7fd,_0x4cc95f),{'verbose':_0xa473b7[_0x2e3021(0x1c0)]}),_0x443c43=_0x1b4008[_0x2e3021(0x225)];return console[_0x2e3021(0x378)]('✔\x20Deleted\x20token\x20\x27'+(_0x443c43[_0x2e3021(0x375)]||_0x4cc95f)+'\x27'),await handleSDKOutput([_0x443c43],_0xa473b7),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x309);[a31_0x3bc615(0x36f)]='List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment';async['execute'](_0x2359bf){const _0x3f1d4f=a31_0x3bc615,{options:_0x2b4489,args:_0x2bb242,tdx:_0x228dac}=_0x2359bf,_0x50dec1=_0x2bb242[0x0]||_0x2b4489[_0x3f1d4f(0x230)];if(!_0x50dec1)return showParentSegmentNotSetError(_0x3f1d4f(0x367)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment'),0x1;const _0x5ea734=await withSpinner(_0x3f1d4f(0x369)+_0x50dec1+_0x3f1d4f(0x1ca),()=>_0x228dac[_0x3f1d4f(0x2a0)][_0x3f1d4f(0x216)](_0x50dec1),{'verbose':_0x2b4489[_0x3f1d4f(0x1c0)]}),_0x36d016=_0x5ea734[_0x3f1d4f(0x225)],_0x8ecd0a=await withSpinner(_0x3f1d4f(0x241)+_0x50dec1+_0x3f1d4f(0x1ca),()=>_0x228dac[_0x3f1d4f(0x17e)][_0x3f1d4f(0x28c)](_0x36d016),{'verbose':_0x2b4489[_0x3f1d4f(0x1c0)]}),_0x1798c0=_0x8ecd0a[_0x3f1d4f(0x225)];console['error'](_0x3f1d4f(0x34a)+_0x1798c0['length']+_0x3f1d4f(0x2f9)+(_0x1798c0[_0x3f1d4f(0x2e0)]!==0x1?'s':''));if(_0x2b4489[_0x3f1d4f(0x266)]==='json'||_0x2b4489[_0x3f1d4f(0x266)]===_0x3f1d4f(0x28a))await handleSDKOutput(_0x1798c0,_0x2b4489);else{if(_0x1798c0['length']===0x0)console[_0x3f1d4f(0x259)](_0x3f1d4f(0x2b0));else for(const _0x426f69 of _0x1798c0){console['log'](a31_0x580b2f[_0x3f1d4f(0x1ee)](_0x426f69[_0x3f1d4f(0x375)])+'\x20'+a31_0x580b2f['dim'](_0x3f1d4f(0x2c9)+_0x426f69['id']+')'));_0x426f69[_0x3f1d4f(0x36f)]&&console['log']('\x20\x20'+a31_0x580b2f['dim'](_0x426f69[_0x3f1d4f(0x36f)]));const _0x94277e=_0x426f69[_0x3f1d4f(0x20d)]?.['length']||0x0;console[_0x3f1d4f(0x259)]('\x20\x20'+a31_0x580b2f[_0x3f1d4f(0x19b)](_0x3f1d4f(0x26f))+'\x20'+_0x94277e);if(_0x426f69[_0x3f1d4f(0x20d)]&&_0x426f69['sections']['length']>0x0)for(const _0x572f94 of _0x426f69['sections']){console['log'](_0x3f1d4f(0x2fc)+_0x572f94[_0x3f1d4f(0x375)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x276);['description']=a31_0x3bc615(0x26c);async['execute'](_0x366f40){const _0x4dba15=a31_0x3bc615,{options:_0x36cabd,args:_0x53b734,tdx:_0x38b658}=_0x366f40,_0x582328=_0x53b734[0x0];if(!_0x582328)return console[_0x4dba15(0x378)](_0x4dba15(0x2c7)),console['error'](_0x4dba15(0x2c3)),0x1;const _0x1f0fc0=await withSpinner(_0x4dba15(0x24c)+_0x582328+_0x4dba15(0x1ca),()=>_0x38b658[_0x4dba15(0x17e)]['getPersonalization'](_0x582328),{'verbose':_0x36cabd[_0x4dba15(0x1c0)]}),_0xd3ffd2=_0x1f0fc0[_0x4dba15(0x225)];console[_0x4dba15(0x378)](_0x4dba15(0x377)+_0xd3ffd2[_0x4dba15(0x375)]+'\x27');if(_0x36cabd[_0x4dba15(0x266)]===_0x4dba15(0x279)||_0x36cabd[_0x4dba15(0x266)]==='jsonl')await handleSDKOutput([_0xd3ffd2],_0x36cabd);else{console[_0x4dba15(0x259)](a31_0x580b2f[_0x4dba15(0x1ee)](_0xd3ffd2[_0x4dba15(0x375)])+'\x20'+a31_0x580b2f[_0x4dba15(0x300)](_0x4dba15(0x2c9)+_0xd3ffd2['id']+')'));_0xd3ffd2[_0x4dba15(0x36f)]&&console[_0x4dba15(0x259)]('\x20\x20'+a31_0x580b2f[_0x4dba15(0x300)](_0xd3ffd2['description']));_0xd3ffd2[_0x4dba15(0x34b)]&&console[_0x4dba15(0x259)]('\x20\x20'+a31_0x580b2f['cyan'](_0x4dba15(0x2e9))+'\x20'+_0xd3ffd2[_0x4dba15(0x34b)]);console[_0x4dba15(0x259)]('\x20\x20'+a31_0x580b2f[_0x4dba15(0x19b)](_0x4dba15(0x211))+'\x20'+_0xd3ffd2[_0x4dba15(0x2d7)]),console[_0x4dba15(0x259)]('\x20\x20'+a31_0x580b2f[_0x4dba15(0x19b)](_0x4dba15(0x2a9))+'\x20'+_0xd3ffd2[_0x4dba15(0x1c5)]);const _0x455eeb=_0xd3ffd2[_0x4dba15(0x20d)]?.[_0x4dba15(0x2e0)]||0x0;console[_0x4dba15(0x259)]('\x20\x20'+a31_0x580b2f[_0x4dba15(0x19b)](_0x4dba15(0x26f))+'\x20'+_0x455eeb);if(_0xd3ffd2['sections']&&_0xd3ffd2[_0x4dba15(0x20d)][_0x4dba15(0x2e0)]>0x0)for(const _0x1c9ebd of _0xd3ffd2[_0x4dba15(0x20d)]){console['log'](_0x4dba15(0x207)+a31_0x580b2f['bold'](_0x1c9ebd[_0x4dba15(0x375)])+'\x20'+a31_0x580b2f[_0x4dba15(0x300)](_0x4dba15(0x2c9)+_0x1c9ebd['id']+')')),_0x1c9ebd[_0x4dba15(0x34e)]&&(console['log'](_0x4dba15(0x353)+a31_0x580b2f['cyan'](_0x4dba15(0x218))+'\x20'+_0x1c9ebd[_0x4dba15(0x34e)]['name']),_0x1c9ebd[_0x4dba15(0x34e)][_0x4dba15(0x343)]?.[_0x4dba15(0x17f)]&&console[_0x4dba15(0x259)](_0x4dba15(0x1f3)+a31_0x580b2f[_0x4dba15(0x19b)](_0x4dba15(0x2d9))+'\x20'+_0x1c9ebd[_0x4dba15(0x34e)]['keyEventCriteria'][_0x4dba15(0x17f)])),_0x1c9ebd[_0x4dba15(0x390)]&&console[_0x4dba15(0x259)](_0x4dba15(0x353)+a31_0x580b2f[_0x4dba15(0x19b)]('payload:')+'\x20'+JSON['stringify'](_0x1c9ebd[_0x4dba15(0x390)])),_0x1c9ebd[_0x4dba15(0x362)]&&console[_0x4dba15(0x259)]('\x20\x20\x20\x20\x20\x20'+a31_0x580b2f[_0x4dba15(0x19b)](_0x4dba15(0x2fa))+_0x4dba15(0x2f4));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x3bc615(0x375)]='ps:pz:delete';[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x255);async[a31_0x3bc615(0x278)](_0x25899a){const _0x4c7830=a31_0x3bc615,{options:_0x40985c,args:_0x5a3913,tdx:_0x48c62d}=_0x25899a,_0x2f1a14=_0x5a3913[0x0];if(!_0x2f1a14)return console['error'](_0x4c7830(0x2c7)),console[_0x4c7830(0x378)]('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner('Deleting\x20personalization\x20\x27'+_0x2f1a14+_0x4c7830(0x1ca),()=>_0x48c62d[_0x4c7830(0x17e)][_0x4c7830(0x2ee)](_0x2f1a14),{'verbose':_0x40985c[_0x4c7830(0x1c0)]}),console[_0x4c7830(0x378)](_0x4c7830(0x337)+_0x2f1a14+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x1b8);[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x1a4);async[a31_0x3bc615(0x278)](_0x20b0a5){const _0x2efbec=a31_0x3bc615,{options:_0x6984c4,tdx:_0x8e5a7c}=_0x20b0a5,_0x3c9869=_0x6984c4;let _0x372af6;if(_0x3c9869[_0x2efbec(0x240)]){_0x372af6=await loadJSON(_0x3c9869[_0x2efbec(0x240)],!![]);if(!_0x372af6['relationships']?.[_0x2efbec(0x1e6)])return console[_0x2efbec(0x378)](_0x2efbec(0x233)),console['error']('Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:'),console[_0x2efbec(0x378)](_0x2efbec(0x22b)),0x1;}else{if(!_0x3c9869[_0x2efbec(0x375)])return console['error']('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x2efbec(0x378)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x2efbec(0x378)](_0x2efbec(0x2d0)),0x1;if(_0x3c9869[_0x2efbec(0x36f)]===undefined)return console['error']('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x2efbec(0x378)](_0x2efbec(0x355)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x3c9869['folderId']===undefined)return console['error'](_0x2efbec(0x38d)),console[_0x2efbec(0x378)](_0x2efbec(0x2a2)),0x1;let _0x38be8b=_0x3c9869[_0x2efbec(0x34b)];if(!_0x38be8b&&_0x6984c4[_0x2efbec(0x230)]){const _0x51b60c=await withSpinner(_0x2efbec(0x369)+_0x6984c4[_0x2efbec(0x230)]+'\x27...',()=>_0x8e5a7c[_0x2efbec(0x2a0)][_0x2efbec(0x216)](_0x6984c4[_0x2efbec(0x230)]),{'verbose':_0x6984c4['verbose']});_0x38be8b=_0x51b60c[_0x2efbec(0x225)];}let _0x141dc9;_0x3c9869['sections']&&(_0x141dc9=await loadJSON(_0x3c9869['sections'],![]));const _0x4405aa=_0x3c9869['folderId']==='null'?null:{'id':_0x3c9869['folderId'],'type':_0x2efbec(0x31c)};_0x372af6={'attributes':{'name':_0x3c9869[_0x2efbec(0x375)],'description':_0x3c9869[_0x2efbec(0x36f)]||null,..._0x38be8b!==undefined&&{'audienceId':_0x38be8b},..._0x141dc9!==undefined&&{'sections':_0x141dc9}},'relationships':{'parentFolder':{'data':_0x4405aa}}};}const _0x1843bd=await withSpinner('Creating\x20personalization\x20\x27'+(_0x372af6[_0x2efbec(0x32d)]?.[_0x2efbec(0x375)]??'')+_0x2efbec(0x1ca),()=>_0x8e5a7c['personalization']['createPersonalization'](_0x372af6),{'verbose':_0x6984c4[_0x2efbec(0x1c0)]}),_0x25fcb5=_0x1843bd[_0x2efbec(0x225)];return console[_0x2efbec(0x378)]('✔\x20Created\x20personalization\x20\x27'+_0x25fcb5[_0x2efbec(0x375)]+_0x2efbec(0x360)+_0x25fcb5['id']),await handleSDKOutput([_0x25fcb5],_0x6984c4),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x3bc615(0x375)]='ps:pz:patch';[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x32e);async[a31_0x3bc615(0x278)](_0x363d29){const _0x1d4846=a31_0x3bc615,{options:_0x10260f,args:_0x4766e6}=_0x363d29,_0x12681b=_0x10260f,_0x5c8322=_0x4766e6[0x0];if(!_0x5c8322)return console[_0x1d4846(0x378)](_0x1d4846(0x2c7)),console[_0x1d4846(0x378)](_0x1d4846(0x22f)),console[_0x1d4846(0x378)](_0x1d4846(0x31e)),0x1;let _0x3830f9;if(_0x12681b[_0x1d4846(0x240)])_0x3830f9=await loadJSON(_0x12681b[_0x1d4846(0x240)],!![]);else{if(!_0x12681b[_0x1d4846(0x375)])return console[_0x1d4846(0x378)](_0x1d4846(0x179)),console[_0x1d4846(0x378)](_0x1d4846(0x22f)),0x1;if(_0x12681b[_0x1d4846(0x36f)]===undefined)return console[_0x1d4846(0x378)](_0x1d4846(0x33f)),console[_0x1d4846(0x378)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;let _0x145f0b;_0x12681b[_0x1d4846(0x20d)]&&(_0x145f0b=await loadJSON(_0x12681b[_0x1d4846(0x20d)],![])),_0x3830f9={'attributes':{'name':_0x12681b[_0x1d4846(0x375)],'description':_0x12681b['description']||null,..._0x145f0b!==undefined&&{'sections':_0x145f0b}}};}const {tdx:_0x36f3f3}=_0x363d29,_0x1dd363=await withSpinner(_0x1d4846(0x2f3)+_0x5c8322+'\x27...',()=>_0x36f3f3[_0x1d4846(0x17e)][_0x1d4846(0x1d1)](_0x5c8322,_0x3830f9),{'verbose':_0x10260f[_0x1d4846(0x1c0)]}),_0x25241c=_0x1dd363['data'];return console[_0x1d4846(0x378)](_0x1d4846(0x24d)+_0x25241c[_0x1d4846(0x375)]+_0x1d4846(0x1a8)+_0x25241c['id']+')'),await handleSDKOutput([_0x25241c],_0x10260f),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x3bc615(0x375)]=a31_0x3bc615(0x31d);[a31_0x3bc615(0x36f)]=a31_0x3bc615(0x2d4);async[a31_0x3bc615(0x278)](_0x21245f){const _0x5e7f6b=a31_0x3bc615,{options:_0x5a9c28,args:_0x369a99}=_0x21245f,_0x54ecdc=_0x369a99[0x0]||_0x5a9c28['parentSegment'];if(!_0x54ecdc)return showParentSegmentNotSetError(_0x5e7f6b(0x29a)+_0x5e7f6b(0x26b)),0x1;const _0x3c65e2=resolveYamlFile(_0x54ecdc);if(!existsSync(_0x3c65e2))return showFileNotFoundError(_0x3c65e2,_0x54ecdc),0x1;let _0x22106f;try{_0x22106f=readFileSync(_0x3c65e2,_0x5e7f6b(0x271));}catch(_0x1530b4){const _0x317dce=_0x1530b4 instanceof Error?_0x1530b4[_0x5e7f6b(0x27d)]:String(_0x1530b4);return console[_0x5e7f6b(0x378)](_0x5e7f6b(0x1a2)+_0x317dce),0x1;}let _0x3c3ed5;try{_0x3c3ed5=parseDef(_0x22106f);}catch(_0x341e0d){const _0x1dd658=_0x341e0d instanceof Error?_0x341e0d[_0x5e7f6b(0x27d)]:String(_0x341e0d);return console['error'](a31_0x580b2f['red']('Error\x20parsing\x20YAML:\x20'+_0x1dd658)),0x1;}if(_0x3c3ed5[_0x5e7f6b(0x1e8)]&&_0x3c3ed5['personalization_services'][_0x5e7f6b(0x2e0)]>0x0)return console[_0x5e7f6b(0x378)](a31_0x580b2f[_0x5e7f6b(0x20b)](_0x5e7f6b(0x1a3)+_0x3c65e2)),console[_0x5e7f6b(0x378)](a31_0x580b2f['dim'](_0x5e7f6b(0x37e)+_0x3c3ed5[_0x5e7f6b(0x1e8)]['length']+_0x5e7f6b(0x1d5))),0x1;!_0x3c3ed5[_0x5e7f6b(0x2d6)]&&(_0x3c3ed5[_0x5e7f6b(0x2d6)]={'events':[{'name':_0x5e7f6b(0x204),'source_table':_0x5e7f6b(0x384)}],'attributes':[{'name':_0x5e7f6b(0x33d),'type':_0x5e7f6b(0x25b)}],'id_stitching':{'primary_key':_0x3c3ed5[_0x5e7f6b(0x2d8)][_0x5e7f6b(0x1af)]===_0x5e7f6b(0x37d)?_0x5e7f6b(0x27f):_0x5e7f6b(0x35b)}});_0x3c3ed5[_0x5e7f6b(0x1e8)]=[{'name':_0x5e7f6b(0x1a7),'description':_0x5e7f6b(0x1ab),'trigger_event':_0x5e7f6b(0x204),'sections':[{'name':_0x5e7f6b(0x38c),'criteria':'true','attributes':[_0x5e7f6b(0x33d)]}]}];const _0x11496d=serializeDef(_0x3c3ed5);return writeFileSync(_0x3c65e2,_0x11496d,_0x5e7f6b(0x271)),console['error'](a31_0x580b2f[_0x5e7f6b(0x28f)]('✔')+_0x5e7f6b(0x26a)+a31_0x580b2f[_0x5e7f6b(0x19b)](_0x3c65e2)),(!_0x3c3ed5[_0x5e7f6b(0x2d6)]||_0x22106f[_0x5e7f6b(0x19f)]('realtime:')===-0x1)&&console[_0x5e7f6b(0x378)](a31_0x580b2f['green']('✔')+_0x5e7f6b(0x1bb)),console['error']('\x0a'+a31_0x580b2f[_0x5e7f6b(0x300)]('Next\x20steps:')),console[_0x5e7f6b(0x378)](_0x5e7f6b(0x2c0)+_0x3c65e2+_0x5e7f6b(0x248)),console['error']('\x20\x202.\x20Run\x20'+a31_0x580b2f[_0x5e7f6b(0x300)]('tdx\x20ps\x20push\x20'+_0x54ecdc)+'\x20to\x20push\x20the\x20configuration'),0x0;}}