@treasuredata/tdx 2026.3.31 → 2026.3.32

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 (256) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-login-command.js +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/delivery-command.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.js +1 -1
  41. package/dist/commands/profiles-command.js +1 -1
  42. package/dist/commands/query-command.js +1 -1
  43. package/dist/commands/schedule-command.js +1 -1
  44. package/dist/commands/segment-command.js +1 -1
  45. package/dist/commands/segment-create-command.js +1 -1
  46. package/dist/commands/segment-fields-command.js +1 -1
  47. package/dist/commands/segment-pull-command.js +1 -1
  48. package/dist/commands/segment-push-command.js +1 -1
  49. package/dist/commands/segment-update-command.js +1 -1
  50. package/dist/commands/segment-use-command.js +1 -1
  51. package/dist/commands/segment-validate-command.js +1 -1
  52. package/dist/commands/segments.js +1 -1
  53. package/dist/commands/show.js +1 -1
  54. package/dist/commands/status-command.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.d.ts +36 -0
  61. package/dist/commands/work-command.d.ts.map +1 -0
  62. package/dist/commands/work-command.js +1 -0
  63. package/dist/commands/work-command.js.map +1 -0
  64. package/dist/commands/workflow-command.js +1 -1
  65. package/dist/core/auth.js +1 -1
  66. package/dist/core/command-output.js +1 -1
  67. package/dist/core/config.js +1 -1
  68. package/dist/core/connection-cache.js +1 -1
  69. package/dist/core/constants.js +1 -1
  70. package/dist/core/credential-cache.js +1 -1
  71. package/dist/core/global-context.js +1 -1
  72. package/dist/core/keychain.js +1 -1
  73. package/dist/core/oauth-keychain.js +1 -1
  74. package/dist/core/oauth.js +1 -1
  75. package/dist/core/profile.js +1 -1
  76. package/dist/core/project-config.d.ts +2 -0
  77. package/dist/core/project-config.d.ts.map +1 -1
  78. package/dist/core/project-config.js +1 -1
  79. package/dist/core/project-config.js.map +1 -1
  80. package/dist/core/session.js +1 -1
  81. package/dist/core/user-cache.js +1 -1
  82. package/dist/core/version.js +1 -1
  83. package/dist/index.js +1 -1
  84. package/dist/mcp/server.js +1 -1
  85. package/dist/mcp/tools/index.js +1 -1
  86. package/dist/mcp/tools/tdx-run.js +1 -1
  87. package/dist/mcp/tools/tdx-search.js +1 -1
  88. package/dist/mcp/utils.js +1 -1
  89. package/dist/proxy/claude-usage-tracker.js +1 -1
  90. package/dist/proxy/passthrough-server.js +1 -1
  91. package/dist/proxy/sse-usage-parser.js +1 -1
  92. package/dist/sdk/agent/agent-config.js +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.js +1 -1
  95. package/dist/sdk/agent/test/evaluator.js +1 -1
  96. package/dist/sdk/agent/test/executor.js +1 -1
  97. package/dist/sdk/agent/test/index.js +1 -1
  98. package/dist/sdk/agent/test/output.js +1 -1
  99. package/dist/sdk/agent/test/parser.js +1 -1
  100. package/dist/sdk/agent/tool-target-registry.js +1 -1
  101. package/dist/sdk/api.js +1 -1
  102. package/dist/sdk/cas/cas-api-client.js +1 -1
  103. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  104. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  105. package/dist/sdk/cas/index.js +1 -1
  106. package/dist/sdk/cas/pull-workflow.js +1 -1
  107. package/dist/sdk/cas/push-workflow.js +1 -1
  108. package/dist/sdk/client/cdp-api-client.js +1 -1
  109. package/dist/sdk/client/delivery-api-client.js +1 -1
  110. package/dist/sdk/client/endpoints.js +1 -1
  111. package/dist/sdk/client/engage-api-client.js +1 -1
  112. package/dist/sdk/client/http-client.js +1 -1
  113. package/dist/sdk/client/llm-api-client.js +1 -1
  114. package/dist/sdk/client/oauth-refresh.js +1 -1
  115. package/dist/sdk/client/rate-limiter.js +1 -1
  116. package/dist/sdk/client/td-api-client.js +1 -1
  117. package/dist/sdk/client/trino-api-client.js +1 -1
  118. package/dist/sdk/client/workflow-client.js +1 -1
  119. package/dist/sdk/connection-validator.js +1 -1
  120. package/dist/sdk/connection.js +1 -1
  121. package/dist/sdk/delivery.js +1 -1
  122. package/dist/sdk/engage/campaign-pull.js +1 -1
  123. package/dist/sdk/engage/campaign-push.js +1 -1
  124. package/dist/sdk/engage/campaign-validator.js +1 -1
  125. package/dist/sdk/engage/campaign-yaml.js +1 -1
  126. package/dist/sdk/engage/template-pull.js +1 -1
  127. package/dist/sdk/engage/template-push.js +1 -1
  128. package/dist/sdk/engage/template-validator.js +1 -1
  129. package/dist/sdk/engage/template-yaml.js +1 -1
  130. package/dist/sdk/engage/types/campaign-def.js +1 -1
  131. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  132. package/dist/sdk/engage/types/template-schema.js +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/errors.js +1 -1
  135. package/dist/sdk/index.d.ts +1 -0
  136. package/dist/sdk/index.d.ts.map +1 -1
  137. package/dist/sdk/index.js +1 -1
  138. package/dist/sdk/index.js.map +1 -1
  139. package/dist/sdk/io/index.js +1 -1
  140. package/dist/sdk/io/node-filesystem.js +1 -1
  141. package/dist/sdk/job.js +1 -1
  142. package/dist/sdk/journey.js +1 -1
  143. package/dist/sdk/llm/chat-cache.js +1 -1
  144. package/dist/sdk/llm/index.js +1 -1
  145. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  146. package/dist/sdk/llm/model-factors.js +1 -1
  147. package/dist/sdk/personalization.js +1 -1
  148. package/dist/sdk/policy.js +1 -1
  149. package/dist/sdk/query/index.js +1 -1
  150. package/dist/sdk/query/sql-parser.js +1 -1
  151. package/dist/sdk/realtime.js +1 -1
  152. package/dist/sdk/schedule.js +1 -1
  153. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  154. package/dist/sdk/segment/fields-display.js +1 -1
  155. package/dist/sdk/segment/file-discovery.js +1 -1
  156. package/dist/sdk/segment/journey-utils.js +1 -1
  157. package/dist/sdk/segment/journey-validator.js +1 -1
  158. package/dist/sdk/segment/journey-yaml.js +1 -1
  159. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  160. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  161. package/dist/sdk/segment/pull-workflow.js +1 -1
  162. package/dist/sdk/segment/push-recovery.js +1 -1
  163. package/dist/sdk/segment/push-workflow.js +1 -1
  164. package/dist/sdk/segment/resolution-context.js +1 -1
  165. package/dist/sdk/segment/segment-path-parser.js +1 -1
  166. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  167. package/dist/sdk/segment/segment-validator.js +1 -1
  168. package/dist/sdk/segment/target-resolution.js +1 -1
  169. package/dist/sdk/segment/tdx-config.js +1 -1
  170. package/dist/sdk/segment/types/activation-schema.js +1 -1
  171. package/dist/sdk/segment/types/journey-def.js +1 -1
  172. package/dist/sdk/segment/types/journey-schema.js +1 -1
  173. package/dist/sdk/segment/types/segment-def.js +1 -1
  174. package/dist/sdk/segment/types/segment-schema.js +1 -1
  175. package/dist/sdk/segment/validate-files.js +1 -1
  176. package/dist/sdk/segment/yaml-validator.js +1 -1
  177. package/dist/sdk/segment.js +1 -1
  178. package/dist/sdk/types/index.d.ts +2 -0
  179. package/dist/sdk/types/index.d.ts.map +1 -1
  180. package/dist/sdk/types/index.js +1 -1
  181. package/dist/sdk/types/index.js.map +1 -1
  182. package/dist/sdk/types/progress.js +1 -1
  183. package/dist/sdk/types/workspace.d.ts +146 -0
  184. package/dist/sdk/types/workspace.d.ts.map +1 -0
  185. package/dist/sdk/types/workspace.js +1 -0
  186. package/dist/sdk/types/workspace.js.map +1 -0
  187. package/dist/sdk/user.js +1 -1
  188. package/dist/sdk/util/format-detector.js +1 -1
  189. package/dist/sdk/util/formatters.js +1 -1
  190. package/dist/sdk/util/index.js +1 -1
  191. package/dist/sdk/util/paginate.js +1 -1
  192. package/dist/sdk/util/tree-formatter.js +1 -1
  193. package/dist/sdk/workflow/archive-validation.js +1 -1
  194. package/dist/sdk/workflow/clone-workflow.js +1 -1
  195. package/dist/sdk/workflow/index.js +1 -1
  196. package/dist/sdk/workflow/pull-workflow.js +1 -1
  197. package/dist/sdk/workflow/push-workflow.js +1 -1
  198. package/dist/sdk/workflow/tdx-config.js +1 -1
  199. package/dist/sdk/workflow/workflow-utils.js +1 -1
  200. package/dist/sdk/workspace/frontmatter.d.ts +28 -0
  201. package/dist/sdk/workspace/frontmatter.d.ts.map +1 -0
  202. package/dist/sdk/workspace/frontmatter.js +1 -0
  203. package/dist/sdk/workspace/frontmatter.js.map +1 -0
  204. package/dist/sdk/workspace/git.d.ts +55 -0
  205. package/dist/sdk/workspace/git.d.ts.map +1 -0
  206. package/dist/sdk/workspace/git.js +1 -0
  207. package/dist/sdk/workspace/git.js.map +1 -0
  208. package/dist/sdk/workspace/index.d.ts +149 -0
  209. package/dist/sdk/workspace/index.d.ts.map +1 -0
  210. package/dist/sdk/workspace/index.js +1 -0
  211. package/dist/sdk/workspace/index.js.map +1 -0
  212. package/dist/sdk/workspace/skills.d.ts +34 -0
  213. package/dist/sdk/workspace/skills.d.ts.map +1 -0
  214. package/dist/sdk/workspace/skills.js +1 -0
  215. package/dist/sdk/workspace/skills.js.map +1 -0
  216. package/dist/sdk/workspace/templates.d.ts +17 -0
  217. package/dist/sdk/workspace/templates.d.ts.map +1 -0
  218. package/dist/sdk/workspace/templates.js +1 -0
  219. package/dist/sdk/workspace/templates.js.map +1 -0
  220. package/dist/sdk/workspace/wikilinks.d.ts +44 -0
  221. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -0
  222. package/dist/sdk/workspace/wikilinks.js +1 -0
  223. package/dist/sdk/workspace/wikilinks.js.map +1 -0
  224. package/dist/test-utils/command-runner.js +1 -1
  225. package/dist/test-utils/factories.js +1 -1
  226. package/dist/test-utils/fixtures.js +1 -1
  227. package/dist/test-utils/http-mock.js +1 -1
  228. package/dist/test-utils/index.js +1 -1
  229. package/dist/utils/async.js +1 -1
  230. package/dist/utils/colors.js +1 -1
  231. package/dist/utils/diff.js +1 -1
  232. package/dist/utils/file-permissions.js +1 -1
  233. package/dist/utils/file-reader.js +1 -1
  234. package/dist/utils/github-releases.js +1 -1
  235. package/dist/utils/global-cache.js +1 -1
  236. package/dist/utils/json-loader.js +1 -1
  237. package/dist/utils/local-cache.js +1 -1
  238. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  239. package/dist/utils/logger/formatters/index.js +1 -1
  240. package/dist/utils/logger/handlers/console-handler.js +1 -1
  241. package/dist/utils/logger/handlers/file-handler.js +1 -1
  242. package/dist/utils/logger/handlers/index.js +1 -1
  243. package/dist/utils/logger/handlers/null-handler.js +1 -1
  244. package/dist/utils/logger/index.js +1 -1
  245. package/dist/utils/logger/logger.js +1 -1
  246. package/dist/utils/logger/types.js +1 -1
  247. package/dist/utils/option-validation.js +1 -1
  248. package/dist/utils/process.js +1 -1
  249. package/dist/utils/prompt.js +1 -1
  250. package/dist/utils/spinner.js +1 -1
  251. package/dist/utils/sse-parser.js +1 -1
  252. package/dist/utils/string-utils.js +1 -1
  253. package/dist/utils/table-ref-parser.js +1 -1
  254. package/dist/utils/tdx-logger.js +1 -1
  255. package/dist/utils/version-check.js +1 -1
  256. package/package.json +1 -1
@@ -1 +1 @@
1
- const a32_0x5e657a=a32_0x1cbe;(function(_0x5e0573,_0x31499c){const _0x2088b0=a32_0x1cbe,_0x538624=_0x5e0573();while(!![]){try{const _0x2fdbfd=parseInt(_0x2088b0(0x203))/0x1*(-parseInt(_0x2088b0(0x34f))/0x2)+parseInt(_0x2088b0(0x28f))/0x3*(-parseInt(_0x2088b0(0x1f7))/0x4)+parseInt(_0x2088b0(0x384))/0x5*(-parseInt(_0x2088b0(0x3bb))/0x6)+parseInt(_0x2088b0(0x323))/0x7+parseInt(_0x2088b0(0x256))/0x8+-parseInt(_0x2088b0(0x2b1))/0x9*(parseInt(_0x2088b0(0x231))/0xa)+-parseInt(_0x2088b0(0x34e))/0xb*(-parseInt(_0x2088b0(0x276))/0xc);if(_0x2fdbfd===_0x31499c)break;else _0x538624['push'](_0x538624['shift']());}catch(_0x303ad){_0x538624['push'](_0x538624['shift']());}}}(a32_0x1c50,0x2f2ea));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a32_0x53743d from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a32_0x7af4a1 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=a32_0x5e657a(0x283),LEGACY_PARENT_SEGMENT_DIR=a32_0x5e657a(0x301);function openBrowser(_0x451b1e){const _0x576e8c=a32_0x5e657a,_0x310528=process[_0x576e8c(0x35f)],_0x7bdda=_0x310528==='darwin'?_0x576e8c(0x376):_0x310528===_0x576e8c(0x232)?_0x576e8c(0x3b1):'xdg-open';spawn(_0x7bdda,[_0x451b1e],{'detached':!![],'stdio':_0x576e8c(0x2cb)})['unref']();}function migrateLegacyDirectory(){const _0x4cefd7=a32_0x5e657a;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x46e9f7=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x46e9f7['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x4cefd7(0x341)](a32_0x7af4a1['yellow'](_0x4cefd7(0x27c)+LEGACY_PARENT_SEGMENT_DIR+_0x4cefd7(0x1e5)+PARENT_SEGMENT_DIR+_0x4cefd7(0x328))),console[_0x4cefd7(0x341)](a32_0x7af4a1[_0x4cefd7(0x1eb)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x4cefd7(0x1ca))),![];console['error'](a32_0x7af4a1[_0x4cefd7(0x23d)](_0x4cefd7(0x295)+LEGACY_PARENT_SEGMENT_DIR+_0x4cefd7(0x286)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a32_0x7af4a1['green'](_0x4cefd7(0x351)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1b8fb7){const _0x3c5729=_0x1b8fb7 instanceof Error?_0x1b8fb7[_0x4cefd7(0x271)]:String(_0x1b8fb7);return console[_0x4cefd7(0x341)](a32_0x7af4a1[_0x4cefd7(0x334)](_0x4cefd7(0x37c)+_0x3c5729+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a32_0x5e657a(0x338)](_0x46e5f1){const _0x5c2b00=a32_0x5e657a;return migrateLegacyDirectory(),super[_0x5c2b00(0x338)](_0x46e5f1);}}function resolveYamlFile(_0x4811bf){const _0x4618d5=a32_0x5e657a;if(_0x4811bf[_0x4618d5(0x3be)](_0x4618d5(0x2db))||_0x4811bf['endsWith'](_0x4618d5(0x26c)))return _0x4811bf;return a32_0x53743d[_0x4618d5(0x29d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4811bf)+_0x4618d5(0x2db));}function formatProgressMessage(_0x30978a){const _0xd9b1fd=a32_0x5e657a,_0x3a1c0f=_0x30978a[_0xd9b1fd(0x350)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3a1c0f){const [,_0x1fa5ca,_0x125312,_0x9a2715='']=_0x3a1c0f;return a32_0x7af4a1['dim'](_0x1fa5ca+':')+'\x20'+_0x125312+a32_0x7af4a1[_0xd9b1fd(0x1eb)](_0x9a2715);}return a32_0x7af4a1[_0xd9b1fd(0x1eb)](_0x30978a);}function showFileNotFoundError(_0x4801e1,_0x507cb2){const _0x3b31ab=a32_0x5e657a;console[_0x3b31ab(0x341)](a32_0x7af4a1[_0x3b31ab(0x334)](_0x3b31ab(0x29b)+_0x4801e1+'\x0a')),console[_0x3b31ab(0x341)](a32_0x7af4a1[_0x3b31ab(0x302)](_0x3b31ab(0x1f5)+_0x507cb2+_0x3b31ab(0x213)));}function displayRealtimeValidation(_0x3748f0){const _0x2ec101=a32_0x5e657a;if(!_0x3748f0[_0x2ec101(0x30f)])return;const _0x3a3fdf=_0x3748f0['realtime'],_0x3a3642=_0x3a3fdf[_0x2ec101(0x2c8)]?a32_0x7af4a1[_0x2ec101(0x262)](_0x2ec101(0x2ef)):a32_0x7af4a1[_0x2ec101(0x23d)](_0x2ec101(0x3c4));console[_0x2ec101(0x341)]('\x0a'+a32_0x7af4a1['dim'](_0x2ec101(0x2e8))+'\x20'+_0x3a3642);if(_0x3a3fdf[_0x2ec101(0x208)]&&_0x3a3fdf[_0x2ec101(0x208)][_0x2ec101(0x235)]>0x0){console[_0x2ec101(0x341)]('\x20\x20'+a32_0x7af4a1[_0x2ec101(0x1eb)]('Events:')+'\x20'+_0x3a3fdf[_0x2ec101(0x208)][_0x2ec101(0x235)]+'\x20configured');for(const _0xe8d96b of _0x3a3fdf[_0x2ec101(0x208)]){const _0x1eb04b=_0xe8d96b[_0x2ec101(0x27e)]===![]?a32_0x7af4a1[_0x2ec101(0x334)]('✘'):a32_0x7af4a1['green']('✔');console['error'](_0x2ec101(0x1e1)+_0x1eb04b+'\x20'+_0xe8d96b[_0x2ec101(0x2af)]),_0xe8d96b['sourceTableError']&&console[_0x2ec101(0x341)](_0x2ec101(0x291)+a32_0x7af4a1[_0x2ec101(0x334)](_0xe8d96b[_0x2ec101(0x280)]));}}if(_0x3a3fdf[_0x2ec101(0x2f5)]&&_0x3a3fdf[_0x2ec101(0x2f5)]['length']>0x0){console[_0x2ec101(0x341)]('\x20\x20'+a32_0x7af4a1[_0x2ec101(0x1eb)]('Attributes:')+'\x20'+_0x3a3fdf[_0x2ec101(0x2f5)][_0x2ec101(0x235)]+'\x20configured');for(const _0x26671c of _0x3a3fdf['attributes']){const _0x77af31=_0x26671c['valid']?a32_0x7af4a1[_0x2ec101(0x262)]('✔'):a32_0x7af4a1[_0x2ec101(0x334)]('✘');console[_0x2ec101(0x341)](_0x2ec101(0x1e1)+_0x77af31+'\x20'+_0x26671c[_0x2ec101(0x2af)]+'\x20'+a32_0x7af4a1[_0x2ec101(0x1eb)]('('+_0x26671c[_0x2ec101(0x285)]+')'));}}if(_0x3a3fdf[_0x2ec101(0x204)]){const _0x41e195=_0x3a3fdf['idStitching'][_0x2ec101(0x37e)]?.[_0x2ec101(0x235)]?'\x20+\x20['+_0x3a3fdf[_0x2ec101(0x204)]['stitchingKeys'][_0x2ec101(0x29d)](',\x20')+']':'';console['error']('\x20\x20'+a32_0x7af4a1[_0x2ec101(0x1eb)](_0x2ec101(0x26f))+'\x20'+_0x3a3fdf[_0x2ec101(0x204)][_0x2ec101(0x30d)]+_0x41e195);}if(_0x3a3fdf['personalizationServices']&&_0x3a3fdf['personalizationServices'][_0x2ec101(0x235)]>0x0){console['error']('\x20\x20'+a32_0x7af4a1[_0x2ec101(0x1eb)]('Personalization:')+'\x20'+_0x3a3fdf[_0x2ec101(0x1e6)][_0x2ec101(0x235)]+_0x2ec101(0x27f)+(_0x3a3fdf[_0x2ec101(0x1e6)][_0x2ec101(0x235)]!==0x1?'s':''));for(const _0x29e317 of _0x3a3fdf[_0x2ec101(0x1e6)]){console[_0x2ec101(0x341)](_0x2ec101(0x1e4)+_0x29e317[_0x2ec101(0x2af)]);}}}function showParentSegmentNotSetError(_0x216927){const _0x4478eb=a32_0x5e657a;console[_0x4478eb(0x341)](a32_0x7af4a1[_0x4478eb(0x23d)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x216927);}export class ParentSegmentListCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x1d3);[a32_0x5e657a(0x1ef)]='List\x20parent\x20segments';async[a32_0x5e657a(0x30b)](_0x30289b){const _0x5749e0=a32_0x5e657a,{options:_0x57d42e,args:_0x2b33e7,tdx:_0x328943}=_0x30289b,_0x5de253=_0x2b33e7[0x0];_0x57d42e[_0x5749e0(0x374)]&&(console['error']('Site:\x20'+_0x57d42e[_0x5749e0(0x287)]),_0x5de253&&console[_0x5749e0(0x341)]('Pattern:\x20'+_0x5de253));const _0x6aa689=await withSpinner(_0x5de253?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x5de253+_0x5749e0(0x31b):_0x5749e0(0x385),()=>_0x328943[_0x5749e0(0x1e7)][_0x5749e0(0x3a1)](),{'verbose':_0x57d42e[_0x5749e0(0x374)]});let _0x56de9c=_0x6aa689['data'];if(_0x5de253){const _0x362be5=_0x5de253[_0x5749e0(0x39a)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x5749e0(0x39a)](/\*/g,'.*')[_0x5749e0(0x39a)](/\?/g,'.'),_0x2bf6e9=new RegExp('^'+_0x362be5+'$','i');_0x56de9c=_0x56de9c[_0x5749e0(0x1e8)](_0x3230dc=>_0x2bf6e9['test'](_0x3230dc[_0x5749e0(0x2f5)][_0x5749e0(0x2af)]));}_0x56de9c['sort']((_0x337933,_0x353885)=>_0x337933['attributes']['name'][_0x5749e0(0x39b)](_0x353885[_0x5749e0(0x2f5)][_0x5749e0(0x2af)])),console['error'](_0x5749e0(0x2a2)+_0x56de9c[_0x5749e0(0x235)]+_0x5749e0(0x3df)+(_0x56de9c[_0x5749e0(0x235)]!==0x1?'s':''));const _0x380245=_0x5bb935=>{const _0x401f73=_0x5749e0;return getConsoleNextUrl(_0x57d42e[_0x401f73(0x287)],'/app/dw/parentSegments/'+_0x5bb935);};if(_0x57d42e[_0x5749e0(0x308)]===_0x5749e0(0x2fe)||_0x57d42e[_0x5749e0(0x308)]===_0x5749e0(0x309)){const _0x4b0e88=_0x56de9c['map'](_0x2fc5f6=>({..._0x2fc5f6,'url':_0x380245(_0x2fc5f6['id'])}));await handleSDKOutput(_0x4b0e88,_0x57d42e);}else{if(_0x56de9c['length']===0x0)_0x5de253?console[_0x5749e0(0x2e6)](_0x5749e0(0x2d7)+_0x5de253):console[_0x5749e0(0x2e6)](_0x5749e0(0x2fb));else for(const _0x33ebb9 of _0x56de9c){const _0x27741b=_0x33ebb9['attributes'][_0x5749e0(0x3d3)]?a32_0x7af4a1['dim']('\x20('+formatRows(_0x33ebb9[_0x5749e0(0x2f5)][_0x5749e0(0x3d3)])+')'):'',_0x511168=hyperlink(_0x33ebb9[_0x5749e0(0x2f5)]['name'],_0x380245(_0x33ebb9['id']));console[_0x5749e0(0x2e6)](_0x5749e0(0x210)+_0x511168+_0x27741b);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x1cb);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x22f);async[a32_0x5e657a(0x30b)](_0xcd8679){const _0x210ba4=a32_0x5e657a,{options:_0x1c42c8,args:_0x3bd38b,tdx:_0x5788dc}=_0xcd8679;console[_0x210ba4(0x341)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x210ba4(0x2c2)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x29affb=_0x1c42c8;if(_0x3bd38b[_0x210ba4(0x235)]===0x0)return console[_0x210ba4(0x341)](a32_0x7af4a1[_0x210ba4(0x334)](_0x210ba4(0x2d2))),console[_0x210ba4(0x341)](_0x210ba4(0x32c)),0x1;const _0x7a628d=_0x3bd38b[0x0];if(!_0x29affb[_0x210ba4(0x397)]||!_0x29affb['table'])return console[_0x210ba4(0x341)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x210ba4(0x341)](_0x210ba4(0x32c)),0x1;_0x29affb[_0x210ba4(0x374)]&&(console[_0x210ba4(0x341)](_0x210ba4(0x220)+_0x29affb[_0x210ba4(0x287)]),console[_0x210ba4(0x341)](_0x210ba4(0x329)+_0x7a628d),console['error'](_0x210ba4(0x1c6)+_0x29affb[_0x210ba4(0x397)]),console['error'](_0x210ba4(0x229)+_0x29affb['table']));const _0x232bfe=await loadJSONFromOptions(_0x29affb[_0x210ba4(0x2f5)],_0x29affb[_0x210ba4(0x1bf)]),_0x3d8957=await loadJSONFromOptions(_0x29affb['behaviors'],_0x29affb['behaviorsFile']),_0x177c91=await loadJSONFromOptions(_0x29affb[_0x210ba4(0x1d7)],_0x29affb[_0x210ba4(0x3cf)]),_0x3a7cb4={'name':_0x7a628d,'description':_0x29affb[_0x210ba4(0x1ef)],'scheduleType':_0x29affb[_0x210ba4(0x2fa)],'scheduleOption':_0x29affb[_0x210ba4(0x298)],'timezone':_0x29affb[_0x210ba4(0x25c)],'master':{'parentDatabaseName':_0x29affb['database'],'parentTableName':_0x29affb[_0x210ba4(0x1c7)]},'attributes':_0x232bfe,'behaviors':_0x3d8957,'customerGroup':_0x177c91},_0x359e19=await withSpinner(_0x210ba4(0x2a9)+_0x7a628d+_0x210ba4(0x31b),()=>_0x5788dc[_0x210ba4(0x1e7)][_0x210ba4(0x362)](_0x3a7cb4),{'verbose':_0x1c42c8['verbose']}),_0x1f1da3=_0x359e19[_0x210ba4(0x1f1)];return console[_0x210ba4(0x341)](_0x210ba4(0x312)+_0x1f1da3[_0x210ba4(0x2af)]+_0x210ba4(0x3a5)+_0x1f1da3['id']),await handleSDKOutput([_0x1f1da3],_0x1c42c8),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x370);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x38f);async[a32_0x5e657a(0x30b)](_0x1d93d9){const _0x14b508=a32_0x5e657a,{options:_0x3ce27a,args:_0x161f16,tdx:_0x57a417}=_0x1d93d9;console[_0x14b508(0x341)](_0x14b508(0x233)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x14b508(0x348));const _0x3fbe53=_0x3ce27a;if(_0x161f16[_0x14b508(0x235)]===0x0)return console['error'](a32_0x7af4a1['red'](_0x14b508(0x2d2))),console[_0x14b508(0x341)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x1a7288=_0x161f16[0x0];_0x3fbe53[_0x14b508(0x374)]&&(console[_0x14b508(0x341)](_0x14b508(0x220)+_0x3fbe53[_0x14b508(0x287)]),console['error'](_0x14b508(0x358)+_0x1a7288));const _0x83c3f9=await withSpinner(_0x14b508(0x274)+_0x1a7288+_0x14b508(0x31b),()=>_0x57a417[_0x14b508(0x1e7)][_0x14b508(0x3ac)](_0x1a7288),{'verbose':_0x3fbe53[_0x14b508(0x374)]}),_0x5e4380=_0x83c3f9['data'],_0x55c917=await loadJSONFromOptions(_0x3fbe53[_0x14b508(0x320)],_0x3fbe53[_0x14b508(0x266)]),_0x381d3a=await loadJSONFromOptions(_0x3fbe53[_0x14b508(0x22d)],_0x3fbe53[_0x14b508(0x31f)]),_0x33634e={'name':_0x5e4380[_0x14b508(0x2af)],'description':_0x3fbe53[_0x14b508(0x1ef)]!==undefined?_0x3fbe53[_0x14b508(0x1ef)]:_0x5e4380[_0x14b508(0x1ef)],'scheduleType':_0x3fbe53[_0x14b508(0x2fa)]!==undefined?_0x3fbe53['scheduleType']:_0x5e4380[_0x14b508(0x2fa)],'scheduleOption':_0x3fbe53[_0x14b508(0x298)]!==undefined?_0x3fbe53['scheduleOption']:_0x5e4380['scheduleOption'],'timezone':_0x3fbe53[_0x14b508(0x25c)]!==undefined?_0x3fbe53[_0x14b508(0x25c)]:_0x5e4380[_0x14b508(0x25c)],'master':_0x5e4380[_0x14b508(0x2ae)],'attributes':_0x55c917?[..._0x5e4380[_0x14b508(0x2f5)]||[],..._0x55c917]:_0x5e4380[_0x14b508(0x2f5)],'behaviors':_0x381d3a?[..._0x5e4380[_0x14b508(0x2e9)]||[],..._0x381d3a]:_0x5e4380[_0x14b508(0x2e9)],'customerGroup':_0x5e4380[_0x14b508(0x1d7)]},_0x5c61a1=await withSpinner(_0x14b508(0x21d)+_0x1a7288+'\x27...',()=>_0x57a417[_0x14b508(0x1e7)]['updateParent'](_0x1a7288,_0x33634e),{'verbose':_0x3fbe53[_0x14b508(0x374)]}),_0x49eaef=_0x5c61a1[_0x14b508(0x1f1)];return console['error'](_0x14b508(0x2b3)+_0x49eaef[_0x14b508(0x2af)]+'\x27'),await handleSDKOutput([_0x49eaef],_0x3fbe53),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']='segment:parent:pull';[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x396);async[a32_0x5e657a(0x30b)](_0x135a9c){const _0x7c5a30=a32_0x5e657a,{options:_0x29b67f,args:_0x390c28,tdx:_0x5bf404}=_0x135a9c,_0x54d95b=_0x29b67f,_0x5069be=_0x390c28[0x0]||_0x29b67f[_0x7c5a30(0x248)];if(!_0x5069be)return showParentSegmentNotSetError(_0x7c5a30(0x35a)+_0x7c5a30(0x339)),0x1;if(_0x54d95b[_0x7c5a30(0x38a)]&&_0x54d95b['output'])return console[_0x7c5a30(0x341)](a32_0x7af4a1['red'](_0x7c5a30(0x346))),console[_0x7c5a30(0x341)](a32_0x7af4a1[_0x7c5a30(0x1eb)](_0x7c5a30(0x20a))),console[_0x7c5a30(0x341)](a32_0x7af4a1[_0x7c5a30(0x1eb)](_0x7c5a30(0x243)+PARENT_SEGMENT_DIR+_0x7c5a30(0x2a4))),console[_0x7c5a30(0x341)](a32_0x7af4a1[_0x7c5a30(0x302)](_0x7c5a30(0x20f))),0x1;const _0x2e8aca=_0x54d95b[_0x7c5a30(0x278)]||a32_0x53743d['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5069be)+_0x7c5a30(0x2db));_0x54d95b[_0x7c5a30(0x374)]&&(console['error'](_0x7c5a30(0x220)+_0x54d95b[_0x7c5a30(0x287)]),console[_0x7c5a30(0x341)](_0x7c5a30(0x358)+_0x5069be),console['error'](_0x7c5a30(0x345)+_0x2e8aca));const _0x4351f1=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x5069be+_0x7c5a30(0x31b),()=>_0x5bf404[_0x7c5a30(0x1e7)][_0x7c5a30(0x352)](_0x5069be),{'verbose':_0x54d95b[_0x7c5a30(0x374)]}),_0x86e37b=_0x4351f1[_0x7c5a30(0x1f1)];if(existsSync(_0x2e8aca)){const _0xb415ed=readFileSync(_0x2e8aca,_0x7c5a30(0x2a7)),_0x3f8807=generateDiff(_0xb415ed,_0x86e37b);if(!hasChanges(_0x3f8807))console[_0x7c5a30(0x341)](a32_0x7af4a1[_0x7c5a30(0x262)]('✔')+_0x7c5a30(0x2dc)+a32_0x7af4a1[_0x7c5a30(0x302)](_0x2e8aca)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x7c5a30(0x341)](_0x7c5a30(0x2c6)+_0x2e8aca+'\x27:'),console[_0x7c5a30(0x341)]('─'[_0x7c5a30(0x3aa)](0x3c)),console[_0x7c5a30(0x341)](formatDiffWithColors(_0x3f8807)),console[_0x7c5a30(0x341)]('─'[_0x7c5a30(0x3aa)](0x3c));if(!_0x54d95b[_0x7c5a30(0x378)]){if(!isInteractive())return console[_0x7c5a30(0x341)](a32_0x7af4a1[_0x7c5a30(0x334)]('\x0aError:'),_0x7c5a30(0x254)),console[_0x7c5a30(0x341)](a32_0x7af4a1[_0x7c5a30(0x1eb)](_0x7c5a30(0x2ee))),0x1;const _0x3c383d=await confirmKey(_0x7c5a30(0x2f0)+_0x2e8aca+'\x27?');if(!_0x3c383d)return console['error'](a32_0x7af4a1[_0x7c5a30(0x23d)](_0x7c5a30(0x217))),0x1;}writeFileSync(_0x2e8aca,_0x86e37b,'utf-8'),console['error'](a32_0x7af4a1[_0x7c5a30(0x262)]('✔')+_0x7c5a30(0x1cc)+a32_0x7af4a1[_0x7c5a30(0x302)](_0x2e8aca));}}else{const _0x34a578=a32_0x53743d['dirname'](_0x2e8aca);!existsSync(_0x34a578)&&mkdirSync(_0x34a578,{'recursive':!![]}),writeFileSync(_0x2e8aca,_0x86e37b,_0x7c5a30(0x2a7)),console[_0x7c5a30(0x341)](a32_0x7af4a1['green']('✔')+_0x7c5a30(0x1cc)+a32_0x7af4a1[_0x7c5a30(0x302)](_0x2e8aca));}return saveSessionContext({'parent_segment':_0x5069be},_0x54d95b[_0x7c5a30(0x284)]),console['error'](a32_0x7af4a1[_0x7c5a30(0x262)]('✔')+_0x7c5a30(0x2cc)+a32_0x7af4a1['dim'](_0x7c5a30(0x301))+'\x20=\x20'+a32_0x7af4a1['cyan'](_0x5069be)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x33d);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x245);async[a32_0x5e657a(0x30b)](_0x41e2f4){const _0x4107e4=a32_0x5e657a,{options:_0x4b7590,args:_0x43100b,tdx:_0x322548}=_0x41e2f4,_0x5eb2ff=_0x4b7590,_0x5cc59c=_0x43100b[0x0]||_0x4b7590[_0x4107e4(0x248)];if(!_0x5cc59c)return showParentSegmentNotSetError(_0x4107e4(0x239)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x1728e7=resolveYamlFile(_0x5cc59c);if(!existsSync(_0x1728e7))return showFileNotFoundError(_0x1728e7,_0x5cc59c),0x1;_0x5eb2ff[_0x4107e4(0x374)]&&(console[_0x4107e4(0x341)](_0x4107e4(0x220)+_0x5eb2ff[_0x4107e4(0x287)]),console['error'](_0x4107e4(0x1e3)+_0x1728e7));let _0x2c9a0b;try{_0x2c9a0b=readFileSync(_0x1728e7,_0x4107e4(0x2a7));}catch(_0x55bba4){const _0x565e3e=_0x55bba4 instanceof Error?_0x55bba4[_0x4107e4(0x271)]:String(_0x55bba4);return console[_0x4107e4(0x341)](_0x4107e4(0x1e2)+_0x565e3e),0x1;}const _0xd23711=await withSpinner(_0x4107e4(0x3b0),()=>_0x322548[_0x4107e4(0x1e7)][_0x4107e4(0x1fb)](_0x2c9a0b),{'verbose':_0x5eb2ff[_0x4107e4(0x374)]}),_0x4d352d=_0xd23711[_0x4107e4(0x1f1)],{isNew:_0x7b10f7,name:_0x3364fe,hasChanges:_0x7581f7,diffFormatted:_0x359455}=_0x4d352d;if(!_0x7581f7)return console[_0x4107e4(0x341)](_0x4107e4(0x353)+_0x3364fe+_0x4107e4(0x1ee)),0x0;_0x7b10f7?console[_0x4107e4(0x341)](_0x4107e4(0x310)+_0x3364fe+'\x27:'):console[_0x4107e4(0x341)](_0x4107e4(0x3bf)+_0x3364fe+'\x27:');console['error']('─'[_0x4107e4(0x3aa)](0x3c)),console['error'](_0x359455),console[_0x4107e4(0x341)]('─'[_0x4107e4(0x3aa)](0x3c));const _0x55ed70=_0x7b10f7?_0x4107e4(0x212)+_0x3364fe+'\x27?':_0x4107e4(0x3de)+_0x3364fe+'\x27?';if(!_0x5eb2ff[_0x4107e4(0x378)]){if(!isInteractive())return console['error'](a32_0x7af4a1['red'](_0x4107e4(0x1c8)),_0x4107e4(0x254)),console[_0x4107e4(0x341)](a32_0x7af4a1[_0x4107e4(0x1eb)](_0x4107e4(0x2ee))),0x1;const _0x5bdd47=await confirmKey(_0x55ed70);if(!_0x5bdd47)return console[_0x4107e4(0x341)](a32_0x7af4a1[_0x4107e4(0x23d)](_0x4107e4(0x217))),0x1;}const _0x3e73d0=_0x7b10f7?_0x4107e4(0x2d8):_0x4107e4(0x1df),_0x197d24=await withSpinner(_0x3e73d0+_0x4107e4(0x2d6)+_0x3364fe+_0x4107e4(0x31b),()=>_0x4d352d['apply'](),{'verbose':_0x5eb2ff[_0x4107e4(0x374)]}),_0x5d527b=_0x197d24[_0x4107e4(0x1f1)],_0x522da4=getConsoleNextUrl(_0x5eb2ff['site'],_0x4107e4(0x205)+_0x5d527b['id']),_0x4856eb=_0x7b10f7?_0x4107e4(0x32a):_0x4107e4(0x30c);return console[_0x4107e4(0x341)]('✔\x20'+_0x4856eb+'\x20parent\x20segment\x20\x27'+_0x5d527b[_0x4107e4(0x2af)]+'\x27'),console[_0x4107e4(0x341)]('\x20\x20'+_0x522da4),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a32_0x5e657a(0x2af)]='segment:parent:validate';[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x23e);async[a32_0x5e657a(0x30b)](_0x451fe2){const _0x5a1fc5=a32_0x5e657a,{options:_0x37b1be,args:_0x33e7ee,tdx:_0x157233}=_0x451fe2,_0x13c733=_0x37b1be,_0x2d61e6=_0x33e7ee[0x0]||_0x37b1be[_0x5a1fc5(0x248)];if(!_0x2d61e6)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x5a1fc5(0x244)+_0x5a1fc5(0x207)+_0x5a1fc5(0x3ae)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x2907d7=resolveYamlFile(_0x2d61e6);if(!existsSync(_0x2907d7))return showFileNotFoundError(_0x2907d7,_0x2d61e6),0x1;_0x13c733[_0x5a1fc5(0x374)]&&(console[_0x5a1fc5(0x341)](_0x5a1fc5(0x220)+_0x13c733[_0x5a1fc5(0x287)]),console['error'](_0x5a1fc5(0x1e3)+_0x2907d7));let _0x4c07b0;try{_0x4c07b0=readFileSync(_0x2907d7,_0x5a1fc5(0x2a7));}catch(_0xfb94b){const _0x495922=_0xfb94b instanceof Error?_0xfb94b[_0x5a1fc5(0x271)]:String(_0xfb94b);return console['error']('Error\x20reading\x20file:\x20'+_0x495922),0x1;}const _0x57d302=createCommandSpinner(a32_0x7af4a1['dim']('Validating\x20configuration...'),{'verbose':_0x13c733['verbose']});_0x57d302[_0x5a1fc5(0x3b1)]();const _0x21d656={'onProgress':_0x1d93e3=>{const _0x54f2b0=_0x5a1fc5;_0x57d302[_0x54f2b0(0x340)]=formatProgressMessage(_0x1d93e3);}};if(_0x13c733[_0x5a1fc5(0x2ae)])_0x21d656[_0x5a1fc5(0x2ae)]=!![];if(_0x13c733[_0x5a1fc5(0x34a)])_0x21d656[_0x5a1fc5(0x34a)]=!![];_0x13c733[_0x5a1fc5(0x361)]&&(_0x21d656['attribute']=_0x13c733[_0x5a1fc5(0x361)]);_0x13c733[_0x5a1fc5(0x24c)]&&(_0x21d656['behavior']=_0x13c733[_0x5a1fc5(0x24c)]);if(_0x13c733[_0x5a1fc5(0x1ff)])_0x21d656['interval']=_0x13c733[_0x5a1fc5(0x1ff)];let _0x593ea5;try{_0x593ea5=await _0x157233['segment'][_0x5a1fc5(0x2fd)](_0x4c07b0,_0x21d656),_0x57d302['stop']();}catch(_0x4762b5){_0x57d302['stop']();throw _0x4762b5;}const _0x4ba920=_0x13c733['interval']||_0x5a1fc5(0x2be);return this[_0x5a1fc5(0x1f2)](_0x593ea5,_0x21d656,_0x2907d7,_0x4ba920),_0x593ea5['allValid']?0x0:0x1;}[a32_0x5e657a(0x1f2)](_0x2ceb5e,_0x7b1ded,_0x2a8886,_0x8b50dc){const _0x2a9d3d=a32_0x5e657a;console[_0x2a9d3d(0x341)]('\x0a'+a32_0x7af4a1[_0x2a9d3d(0x388)](_0x2a9d3d(0x1c1))+'\x20'+_0x2ceb5e[_0x2a9d3d(0x2af)]),console[_0x2a9d3d(0x341)]('═'['repeat'](0x3c)),this[_0x2a9d3d(0x316)](_0x2ceb5e);if(typeof _0x7b1ded['attribute']===_0x2a9d3d(0x327)){this[_0x2a9d3d(0x200)](_0x2ceb5e),this[_0x2a9d3d(0x2b5)](_0x2ceb5e),this[_0x2a9d3d(0x395)](_0x2a8886,_0x8b50dc,'attribute',_0x7b1ded[_0x2a9d3d(0x361)]);return;}if(_0x7b1ded['attribute']===!![]){this[_0x2a9d3d(0x200)](_0x2ceb5e),this[_0x2a9d3d(0x2b5)](_0x2ceb5e),this[_0x2a9d3d(0x395)](_0x2a8886,_0x8b50dc,_0x2a9d3d(0x2f5));return;}if(typeof _0x7b1ded['behavior']===_0x2a9d3d(0x327)){this[_0x2a9d3d(0x3d1)](_0x2ceb5e,_0x8b50dc),this[_0x2a9d3d(0x2b5)](_0x2ceb5e),this[_0x2a9d3d(0x395)](_0x2a8886,_0x8b50dc,_0x2a9d3d(0x24c),_0x7b1ded[_0x2a9d3d(0x24c)]);return;}if(_0x7b1ded['behavior']===!![]){this[_0x2a9d3d(0x3d1)](_0x2ceb5e,_0x8b50dc),this[_0x2a9d3d(0x2b5)](_0x2ceb5e),this['displayPreviewHints'](_0x2a8886,_0x8b50dc,_0x2a9d3d(0x2e9));return;}this['displayAttributesStats'](_0x2ceb5e),this[_0x2a9d3d(0x3d1)](_0x2ceb5e,_0x8b50dc),this[_0x2a9d3d(0x27d)](_0x2ceb5e),this[_0x2a9d3d(0x2b5)](_0x2ceb5e),this[_0x2a9d3d(0x395)](_0x2a8886,_0x8b50dc,_0x2a9d3d(0x2dd));}['displayRealtimeInfo'](_0x15bbb0){displayRealtimeValidation(_0x15bbb0);}[a32_0x5e657a(0x395)](_0x1c4ac1,_0x19465b,_0x4f7437,_0x317e34){const _0x396091=a32_0x5e657a;console[_0x396091(0x341)]('\x0a'+a32_0x7af4a1[_0x396091(0x1eb)](_0x396091(0x240)));const _0x321ab2=_0x19465b!==_0x396091(0x2be)?_0x396091(0x2b9)+_0x19465b:'';if(_0x4f7437==='attribute'&&_0x317e34)console[_0x396091(0x341)]('\x20\x20'+a32_0x7af4a1[_0x396091(0x1eb)]('tdx\x20ps\x20preview\x20'+_0x1c4ac1+'\x20--attribute\x20\x22'+_0x317e34+'\x22'+_0x321ab2));else{if(_0x4f7437==='behavior'&&_0x317e34)console[_0x396091(0x341)]('\x20\x20'+a32_0x7af4a1[_0x396091(0x1eb)]('tdx\x20ps\x20preview\x20'+_0x1c4ac1+_0x396091(0x21c)+_0x317e34+'\x22'+_0x321ab2));else(_0x4f7437===_0x396091(0x2f5)||_0x4f7437===_0x396091(0x2dd))&&console['error']('\x20\x20'+a32_0x7af4a1[_0x396091(0x1eb)](_0x396091(0x249)+_0x1c4ac1+_0x396091(0x28e)+_0x321ab2));}(_0x4f7437==='behaviors'||_0x4f7437==='all')&&console[_0x396091(0x341)]('\x20\x20'+a32_0x7af4a1['dim'](_0x396091(0x249)+_0x1c4ac1+_0x396091(0x2d0)+_0x321ab2)),_0x4f7437==='all'&&console[_0x396091(0x341)]('\x20\x20'+a32_0x7af4a1[_0x396091(0x1eb)]('tdx\x20ps\x20preview\x20'+_0x1c4ac1+_0x396091(0x337)+_0x321ab2));}[a32_0x5e657a(0x316)](_0x386599){const _0x487be5=a32_0x5e657a,{master:_0x591316}=_0x386599,_0x190fda=_0x591316[_0x487be5(0x218)]?a32_0x7af4a1[_0x487be5(0x262)]('✔'):a32_0x7af4a1[_0x487be5(0x334)]('✘');console[_0x487be5(0x341)]('\x0a'+a32_0x7af4a1[_0x487be5(0x1eb)](_0x487be5(0x20c))),console[_0x487be5(0x341)](_0x190fda+'\x20'+a32_0x7af4a1['bold'](_0x591316[_0x487be5(0x397)]+'.'+_0x591316['table'])),_0x591316[_0x487be5(0x218)]?_0x591316[_0x487be5(0x2e5)]!==undefined&&console[_0x487be5(0x341)]('\x20\x20'+a32_0x7af4a1['dim'](_0x487be5(0x236))+'\x20'+a32_0x7af4a1[_0x487be5(0x302)](formatRows(_0x591316['rowCount']))):console[_0x487be5(0x341)]('\x20\x20'+a32_0x7af4a1[_0x487be5(0x334)](_0x487be5(0x1d9))+'\x20'+_0x591316['schemaError']);}[a32_0x5e657a(0x200)](_0x490c62){const _0x8b4de0=a32_0x5e657a;if(_0x490c62[_0x8b4de0(0x2f5)][_0x8b4de0(0x235)]===0x0)return;console[_0x8b4de0(0x341)]('\x0a'+a32_0x7af4a1['dim'](_0x8b4de0(0x2e0)));for(const _0x493e25 of _0x490c62[_0x8b4de0(0x2f5)]){const _0x40475a=_0x493e25[_0x8b4de0(0x218)]?a32_0x7af4a1[_0x8b4de0(0x262)]('✔'):a32_0x7af4a1[_0x8b4de0(0x334)]('✘');let _0xf8c13d='';if(_0x493e25[_0x8b4de0(0x218)]&&_0x493e25[_0x8b4de0(0x2ce)]!==undefined&&_0x493e25[_0x8b4de0(0x2cd)]!==undefined){const _0x5a0eb9=_0x493e25[_0x8b4de0(0x2cd)]['toFixed'](0x1),_0x14ae9d=_0x493e25[_0x8b4de0(0x2cd)]>=0x50?a32_0x7af4a1[_0x8b4de0(0x262)]:_0x493e25[_0x8b4de0(0x2cd)]>=0x32?a32_0x7af4a1[_0x8b4de0(0x23d)]:a32_0x7af4a1['red'];_0xf8c13d='\x20'+a32_0x7af4a1[_0x8b4de0(0x1eb)]('Coverage:')+'\x20'+_0x14ae9d(_0x5a0eb9+'%')+'\x20('+formatRows(_0x493e25[_0x8b4de0(0x2ce)])+'\x20rows)';}console[_0x8b4de0(0x341)](_0x40475a+'\x20'+a32_0x7af4a1[_0x8b4de0(0x388)](_0x493e25[_0x8b4de0(0x2af)])+_0xf8c13d),console[_0x8b4de0(0x341)]('\x20\x20'+a32_0x7af4a1[_0x8b4de0(0x1eb)](_0x8b4de0(0x257))+'\x20'+a32_0x7af4a1[_0x8b4de0(0x388)](_0x493e25['database']+'.'+_0x493e25[_0x8b4de0(0x1c7)]));const _0xa88e2=_0x493e25[_0x8b4de0(0x33c)]===_0x493e25[_0x8b4de0(0x1c0)]?a32_0x7af4a1['dim'](_0x8b4de0(0x2a0))+'\x20'+_0x493e25[_0x8b4de0(0x33c)]:a32_0x7af4a1['dim']('Join:')+'\x20'+_0x493e25[_0x8b4de0(0x33c)]+'\x20=\x20'+_0x493e25['foreignKey'];console[_0x8b4de0(0x341)]('\x20\x20'+_0xa88e2),console[_0x8b4de0(0x341)]('\x20\x20'+a32_0x7af4a1['dim']('Columns:')),this['displayColumns'](_0x493e25[_0x8b4de0(0x324)]),!_0x493e25[_0x8b4de0(0x218)]&&console[_0x8b4de0(0x341)]('\x20\x20'+a32_0x7af4a1[_0x8b4de0(0x334)](_0x8b4de0(0x1d9))+'\x20'+_0x493e25[_0x8b4de0(0x241)]);}}[a32_0x5e657a(0x3d1)](_0x29a94e,_0x34e3cd){const _0x1a3b18=a32_0x5e657a;if(_0x29a94e['behaviors']['length']===0x0)return;console[_0x1a3b18(0x341)]('\x0a'+a32_0x7af4a1[_0x1a3b18(0x1eb)](_0x1a3b18(0x36f))+'\x20'+a32_0x7af4a1[_0x1a3b18(0x1eb)]('('+_0x34e3cd+')'));for(const _0x1479d1 of _0x29a94e['behaviors']){const _0x530ca0=_0x1479d1[_0x1a3b18(0x218)]?a32_0x7af4a1[_0x1a3b18(0x262)]('✔'):a32_0x7af4a1[_0x1a3b18(0x334)]('✘');let _0x22f5b4='';if(_0x1479d1[_0x1a3b18(0x218)]&&_0x1479d1[_0x1a3b18(0x366)]!==undefined&&_0x1479d1[_0x1a3b18(0x1fc)]!==undefined){const _0x5823e9=_0x1479d1[_0x1a3b18(0x23f)]?.[_0x1a3b18(0x2f6)](0x1)||'?',_0x421c44=(_0x1479d1[_0x1a3b18(0x23f)]??0x0)>=0x32?a32_0x7af4a1['green']:(_0x1479d1[_0x1a3b18(0x23f)]??0x0)>=0x14?a32_0x7af4a1[_0x1a3b18(0x23d)]:a32_0x7af4a1[_0x1a3b18(0x334)];_0x22f5b4='\x20'+a32_0x7af4a1['dim'](_0x1a3b18(0x1f9))+'\x20'+_0x421c44(formatRows(_0x1479d1['customersWithEvents']))+'\x20('+_0x5823e9+_0x1a3b18(0x333)+a32_0x7af4a1[_0x1a3b18(0x1eb)]('Events:')+'\x20'+a32_0x7af4a1[_0x1a3b18(0x302)](formatRows(_0x1479d1[_0x1a3b18(0x1fc)]));}console[_0x1a3b18(0x341)](_0x530ca0+'\x20'+a32_0x7af4a1[_0x1a3b18(0x388)](_0x1479d1['name'])+_0x22f5b4),console[_0x1a3b18(0x341)]('\x20\x20'+a32_0x7af4a1[_0x1a3b18(0x1eb)](_0x1a3b18(0x257))+'\x20'+a32_0x7af4a1[_0x1a3b18(0x388)](_0x1479d1[_0x1a3b18(0x397)]+'.'+_0x1479d1[_0x1a3b18(0x1c7)]));const _0x595faf=_0x1479d1['joinKey']===_0x1479d1['foreignKey']?a32_0x7af4a1['dim'](_0x1a3b18(0x2a0))+'\x20'+_0x1479d1[_0x1a3b18(0x33c)]:a32_0x7af4a1['dim'](_0x1a3b18(0x34c))+'\x20'+_0x1479d1[_0x1a3b18(0x33c)]+_0x1a3b18(0x21b)+_0x1479d1['foreignKey'];console[_0x1a3b18(0x341)]('\x20\x20'+_0x595faf),console['error']('\x20\x20'+a32_0x7af4a1[_0x1a3b18(0x1eb)](_0x1a3b18(0x1da))),this['displayColumns'](_0x1479d1[_0x1a3b18(0x324)]),!_0x1479d1[_0x1a3b18(0x218)]&&console[_0x1a3b18(0x341)]('\x20\x20'+a32_0x7af4a1[_0x1a3b18(0x334)](_0x1a3b18(0x1d9))+'\x20'+_0x1479d1[_0x1a3b18(0x241)]);}}[a32_0x5e657a(0x1ed)](_0x6e8c51){const _0x1a3469=a32_0x5e657a;for(const _0x457bba of _0x6e8c51){_0x457bba[_0x1a3469(0x1bc)]===_0x457bba[_0x1a3469(0x255)]||_0x457bba[_0x1a3469(0x255)]==='*'?console[_0x1a3469(0x341)](_0x1a3469(0x1e4)+_0x457bba[_0x1a3469(0x1bc)]):console[_0x1a3469(0x341)](_0x1a3469(0x1e4)+_0x457bba[_0x1a3469(0x1bc)]+'\x20'+a32_0x7af4a1[_0x1a3469(0x1eb)]('('+_0x457bba[_0x1a3469(0x255)]+')'));}}[a32_0x5e657a(0x2b5)](_0x4f88d1){const _0x47bff8=a32_0x5e657a;console[_0x47bff8(0x341)]('─'[_0x47bff8(0x3aa)](0x3c));if(_0x4f88d1[_0x47bff8(0x2cf)]['length']>0x0){console[_0x47bff8(0x341)]('\x0a'+a32_0x7af4a1['red']('Errors:'));for(const _0x6e389a of _0x4f88d1['errors']){console['error']('\x20\x20'+a32_0x7af4a1['red']('•')+'\x20'+_0x6e389a);}}_0x4f88d1[_0x47bff8(0x355)]&&console[_0x47bff8(0x341)]('\x0a'+a32_0x7af4a1[_0x47bff8(0x262)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a32_0x5e657a(0x2af)]='segment:parent:preview';[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x37b);async[a32_0x5e657a(0x30b)](_0x283a05){const _0x4d8ed6=a32_0x5e657a,{options:_0x5e2035,args:_0xbf64e1,tdx:_0x5d14e5}=_0x283a05,_0x300d44=_0x5e2035,_0x18c01e=_0xbf64e1[0x0]||_0x5e2035['parentSegment'];if(!_0x18c01e)return showParentSegmentNotSetError(_0x4d8ed6(0x2b8)+_0x4d8ed6(0x3cc)+'Options\x20(one\x20required):\x0a'+_0x4d8ed6(0x2e2)+_0x4d8ed6(0x1cf)+'\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'+_0x4d8ed6(0x27b)),0x1;if(!_0x300d44[_0x4d8ed6(0x2ae)]&&!_0x300d44[_0x4d8ed6(0x361)]&&!_0x300d44[_0x4d8ed6(0x24c)]&&!_0x300d44[_0x4d8ed6(0x34a)])return console[_0x4d8ed6(0x341)](a32_0x7af4a1['red'](_0x4d8ed6(0x32d))),console[_0x4d8ed6(0x341)](_0x4d8ed6(0x2b7)),console[_0x4d8ed6(0x341)](_0x4d8ed6(0x25a)),console[_0x4d8ed6(0x341)](_0x4d8ed6(0x28a)),console[_0x4d8ed6(0x341)](_0x4d8ed6(0x35e)),console[_0x4d8ed6(0x341)](_0x4d8ed6(0x307)),console[_0x4d8ed6(0x341)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x2f7bea=resolveYamlFile(_0x18c01e);if(!existsSync(_0x2f7bea))return showFileNotFoundError(_0x2f7bea,_0x18c01e),0x1;_0x300d44[_0x4d8ed6(0x374)]&&(console[_0x4d8ed6(0x341)](_0x4d8ed6(0x220)+_0x300d44[_0x4d8ed6(0x287)]),console[_0x4d8ed6(0x341)](_0x4d8ed6(0x1e3)+_0x2f7bea));let _0x535c54;try{_0x535c54=readFileSync(_0x2f7bea,_0x4d8ed6(0x2a7));}catch(_0x22ba63){const _0xc62ddd=_0x22ba63 instanceof Error?_0x22ba63[_0x4d8ed6(0x271)]:String(_0x22ba63);return console[_0x4d8ed6(0x341)]('Error\x20reading\x20file:\x20'+_0xc62ddd),0x1;}let _0x3f854d;try{_0x3f854d=parseDef(_0x535c54);}catch(_0x4ce181){const _0xc69e4c=_0x4ce181 instanceof Error?_0x4ce181[_0x4d8ed6(0x271)]:String(_0x4ce181);return console[_0x4d8ed6(0x341)](a32_0x7af4a1[_0x4d8ed6(0x334)]('Error\x20parsing\x20YAML:\x20'+_0xc69e4c)),0x1;}if(_0x300d44[_0x4d8ed6(0x361)]===!![]||_0x300d44[_0x4d8ed6(0x361)]===''){const _0x392fa5=_0x3f854d[_0x4d8ed6(0x2f5)]?.['map'](_0xf01ec6=>_0xf01ec6[_0x4d8ed6(0x2af)])||[];if(_0x392fa5[_0x4d8ed6(0x235)]===0x0)console[_0x4d8ed6(0x341)](a32_0x7af4a1['red'](_0x4d8ed6(0x332)));else{console[_0x4d8ed6(0x341)](a32_0x7af4a1[_0x4d8ed6(0x334)](_0x4d8ed6(0x3b4))),console[_0x4d8ed6(0x341)]('Available\x20attributes:');for(const _0x3baace of _0x392fa5){console[_0x4d8ed6(0x341)]('\x20\x20'+a32_0x7af4a1['cyan'](_0x3baace));}console[_0x4d8ed6(0x341)](_0x4d8ed6(0x2ab)+_0x18c01e+_0x4d8ed6(0x3a0)+_0x392fa5[0x0]+'\x22');}return 0x1;}if(_0x300d44[_0x4d8ed6(0x24c)]===!![]||_0x300d44[_0x4d8ed6(0x24c)]===''){const _0x2bf005=_0x3f854d[_0x4d8ed6(0x2e9)]?.[_0x4d8ed6(0x2d4)](_0x4ea2bb=>_0x4ea2bb[_0x4d8ed6(0x2af)])||[];if(_0x2bf005['length']===0x0)console[_0x4d8ed6(0x341)](a32_0x7af4a1[_0x4d8ed6(0x334)](_0x4d8ed6(0x2c0)));else{console[_0x4d8ed6(0x341)](a32_0x7af4a1[_0x4d8ed6(0x334)](_0x4d8ed6(0x253))),console[_0x4d8ed6(0x341)](_0x4d8ed6(0x1d2));for(const _0x13bd1d of _0x2bf005){console[_0x4d8ed6(0x341)]('\x20\x20'+a32_0x7af4a1[_0x4d8ed6(0x302)](_0x13bd1d));}console[_0x4d8ed6(0x341)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x18c01e+_0x4d8ed6(0x21c)+_0x2bf005[0x0]+'\x22');}return 0x1;}const _0x49e613=createCommandSpinner(a32_0x7af4a1[_0x4d8ed6(0x1eb)](_0x4d8ed6(0x28d)),{'verbose':_0x300d44[_0x4d8ed6(0x374)]});_0x49e613[_0x4d8ed6(0x3b1)]();const _0x1cc711={'onProgress':_0x53d6ec=>{const _0x20c51d=_0x4d8ed6;_0x49e613[_0x20c51d(0x340)]=formatProgressMessage(_0x53d6ec);}};if(_0x300d44[_0x4d8ed6(0x2ae)])_0x1cc711[_0x4d8ed6(0x2ae)]=!![];if(_0x300d44[_0x4d8ed6(0x361)]&&typeof _0x300d44['attribute']===_0x4d8ed6(0x327))_0x1cc711[_0x4d8ed6(0x361)]=_0x300d44[_0x4d8ed6(0x361)];if(_0x300d44[_0x4d8ed6(0x24c)]&&typeof _0x300d44['behavior']===_0x4d8ed6(0x327))_0x1cc711[_0x4d8ed6(0x24c)]=_0x300d44[_0x4d8ed6(0x24c)];if(_0x300d44['enriched'])_0x1cc711['enriched']=!![];if(_0x300d44['interval'])_0x1cc711[_0x4d8ed6(0x1ff)]=_0x300d44[_0x4d8ed6(0x1ff)];let _0x29c5b4;try{_0x29c5b4=await _0x5d14e5[_0x4d8ed6(0x1e7)][_0x4d8ed6(0x38d)](_0x535c54,_0x1cc711),_0x49e613[_0x4d8ed6(0x215)]();}catch(_0x4c1075){_0x49e613['stop']();throw _0x4c1075;}return await this[_0x4d8ed6(0x1f0)](_0x29c5b4,{'master':_0x300d44[_0x4d8ed6(0x2ae)],'attribute':typeof _0x300d44['attribute']===_0x4d8ed6(0x327)?_0x300d44[_0x4d8ed6(0x361)]:undefined,'behavior':typeof _0x300d44[_0x4d8ed6(0x24c)]===_0x4d8ed6(0x327)?_0x300d44['behavior']:undefined,'enriched':_0x300d44[_0x4d8ed6(0x34a)]}),_0x29c5b4['allValid']?0x0:0x1;}async[a32_0x5e657a(0x1f0)](_0x3e6863,_0x40449d){const _0x4fc314=a32_0x5e657a;console['error']('\x0a'+a32_0x7af4a1[_0x4fc314(0x388)](_0x4fc314(0x211))+'\x20'+_0x3e6863[_0x4fc314(0x2af)]),console[_0x4fc314(0x341)]('═'[_0x4fc314(0x3aa)](0x3c));if(_0x40449d['master']&&_0x3e6863[_0x4fc314(0x20e)]){const _0x336fb6=a32_0x7af4a1[_0x4fc314(0x1eb)]('Master:')+'\x20'+a32_0x7af4a1[_0x4fc314(0x388)](_0x3e6863[_0x4fc314(0x2ae)][_0x4fc314(0x397)]+'.'+_0x3e6863[_0x4fc314(0x2ae)][_0x4fc314(0x1c7)]);await this['displaySampleData'](_0x336fb6,_0x3e6863[_0x4fc314(0x20e)]);}else{if(_0x40449d[_0x4fc314(0x361)]&&_0x3e6863[_0x4fc314(0x20e)]){const _0x4ee5c3=a32_0x7af4a1[_0x4fc314(0x1eb)](_0x4fc314(0x2e7))+'\x20'+a32_0x7af4a1[_0x4fc314(0x388)](_0x40449d[_0x4fc314(0x361)]);await this[_0x4fc314(0x2e1)](_0x4ee5c3,_0x3e6863[_0x4fc314(0x20e)]);}else{if(_0x40449d['behavior']&&_0x3e6863[_0x4fc314(0x20e)]){const _0x1003d1=a32_0x7af4a1[_0x4fc314(0x1eb)](_0x4fc314(0x202))+'\x20'+a32_0x7af4a1[_0x4fc314(0x388)](_0x40449d[_0x4fc314(0x24c)]);await this[_0x4fc314(0x2e1)](_0x1003d1,_0x3e6863[_0x4fc314(0x20e)]);}else{if(_0x40449d[_0x4fc314(0x34a)]&&_0x3e6863[_0x4fc314(0x20e)]){const _0x45bcf9=a32_0x7af4a1['dim'](_0x4fc314(0x391))+'\x20'+a32_0x7af4a1['bold'](_0x4fc314(0x227));await this[_0x4fc314(0x2e1)](_0x45bcf9,_0x3e6863['sampleData']);}else!_0x3e6863[_0x4fc314(0x20e)]&&console[_0x4fc314(0x341)](_0x4fc314(0x3a2));}}}if(_0x3e6863[_0x4fc314(0x2cf)][_0x4fc314(0x235)]>0x0){console[_0x4fc314(0x341)]('─'[_0x4fc314(0x3aa)](0x3c)),console[_0x4fc314(0x341)]('\x0a'+a32_0x7af4a1[_0x4fc314(0x334)](_0x4fc314(0x22b)));for(const _0x2d2af9 of _0x3e6863[_0x4fc314(0x2cf)]){console[_0x4fc314(0x341)]('\x20\x20'+a32_0x7af4a1['red']('•')+'\x20'+_0x2d2af9);}}}async[a32_0x5e657a(0x2e1)](_0x2397da,_0x4d9cdc){const _0x82ab15=a32_0x5e657a;if(_0x4d9cdc[_0x82ab15(0x235)]===0x0){console[_0x82ab15(0x341)]('\x0a'+_0x2397da),console[_0x82ab15(0x341)](_0x82ab15(0x34d));return;}console[_0x82ab15(0x341)]('\x0a'+_0x2397da);const _0x34e2be=Object[_0x82ab15(0x20d)](_0x4d9cdc[0x0])[_0x82ab15(0x2d4)](_0x33ec35=>({'name':_0x33ec35,'type':typeof _0x4d9cdc[0x0][_0x33ec35]===_0x82ab15(0x3b5)?'double':_0x82ab15(0x247)})),_0xc3fd70={'queryId':_0x82ab15(0x331),'columns':_0x34e2be,'data':_0x4d9cdc,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4d9cdc[_0x82ab15(0x235)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x220899=formatAsTable(_0xc3fd70,_0x4d9cdc[_0x82ab15(0x235)],!![]);await writeOutput(_0x220899,undefined,_0x82ab15(0x1c7));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a32_0x5e657a(0x2af)]='segment:parent:run';['description']=a32_0x5e657a(0x272);async[a32_0x5e657a(0x30b)](_0x372ebf){const _0x267dae=a32_0x5e657a,{options:_0x1be3b1,args:_0x5b7918,tdx:_0x3581bc}=_0x372ebf,_0x2bdc4c=_0x1be3b1,_0x2abad0=_0x5b7918[0x0]||_0x1be3b1[_0x267dae(0x248)];if(!_0x2abad0)return showParentSegmentNotSetError(_0x267dae(0x336)+_0x267dae(0x2ec)),0x1;const _0x170ec1=resolveYamlFile(_0x2abad0);if(existsSync(_0x170ec1)){_0x2bdc4c[_0x267dae(0x374)]&&console[_0x267dae(0x341)]('Found\x20YAML\x20file:\x20'+_0x170ec1);let _0x59c047;try{_0x59c047=readFileSync(_0x170ec1,_0x267dae(0x2a7));}catch(_0x2eb319){const _0x1ad8f9=_0x2eb319 instanceof Error?_0x2eb319[_0x267dae(0x271)]:String(_0x2eb319);return console[_0x267dae(0x341)]('Error\x20reading\x20file:\x20'+_0x1ad8f9),0x1;}const _0x3d7145=await withSpinner(_0x267dae(0x3b0),()=>_0x3581bc[_0x267dae(0x1e7)]['pushParentYaml'](_0x59c047),{'verbose':_0x2bdc4c[_0x267dae(0x374)]}),_0x1e4572=_0x3d7145['data'],{isNew:_0x10b451,name:_0xca29bc,hasChanges:_0x13a32e,diffFormatted:_0x218c68}=_0x1e4572;if(_0x13a32e){_0x10b451?console[_0x267dae(0x341)](_0x267dae(0x310)+_0xca29bc+'\x27:'):console[_0x267dae(0x341)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0xca29bc+'\x27:');console[_0x267dae(0x341)]('─'['repeat'](0x3c)),console[_0x267dae(0x341)](_0x218c68),console[_0x267dae(0x341)]('─'[_0x267dae(0x3aa)](0x3c));const _0x53fa16=_0x10b451?_0x267dae(0x212)+_0xca29bc+'\x27\x20and\x20run\x20workflow?':_0x267dae(0x3de)+_0xca29bc+_0x267dae(0x275);if(!_0x2bdc4c[_0x267dae(0x378)]){if(!isInteractive())return console[_0x267dae(0x341)](a32_0x7af4a1[_0x267dae(0x334)](_0x267dae(0x1c8)),_0x267dae(0x254)),console[_0x267dae(0x341)](a32_0x7af4a1[_0x267dae(0x1eb)](_0x267dae(0x2ee))),0x1;const _0x26a9a4=await confirmKey(_0x53fa16);if(!_0x26a9a4)return console['error'](a32_0x7af4a1[_0x267dae(0x23d)](_0x267dae(0x217))),0x1;}const _0x20f87a=_0x10b451?'Creating':_0x267dae(0x1df);await withSpinner(_0x20f87a+_0x267dae(0x2d6)+_0xca29bc+'\x27...',()=>_0x1e4572[_0x267dae(0x2bd)](),{'verbose':_0x2bdc4c[_0x267dae(0x374)]});const _0x1057dc=_0x10b451?_0x267dae(0x32a):_0x267dae(0x30c);console[_0x267dae(0x341)]('✔\x20'+_0x1057dc+'\x20parent\x20segment\x20\x27'+_0xca29bc+'\x27');}else console[_0x267dae(0x341)](_0x267dae(0x353)+_0xca29bc+_0x267dae(0x1ba));}const _0x28c74c=await withSpinner(_0x267dae(0x261)+_0x2abad0+_0x267dae(0x31b),()=>_0x3581bc[_0x267dae(0x1e7)][_0x267dae(0x3d4)](_0x2abad0),{'verbose':_0x2bdc4c[_0x267dae(0x374)]}),_0x3fecf3=_0x28c74c[_0x267dae(0x1f1)],_0x28d3e8=getConsoleUrl(_0x2bdc4c['site'],_0x267dae(0x292)+_0x3fecf3['workflowId']+_0x267dae(0x38c)+_0x3fecf3[_0x267dae(0x290)]+_0x267dae(0x2ed)+_0x3fecf3['workflowAttemptId']);return console[_0x267dae(0x341)](_0x267dae(0x31a)),console[_0x267dae(0x341)]('\x20\x20'+a32_0x7af4a1[_0x267dae(0x1eb)](_0x267dae(0x37f))+'\x20'+_0x3fecf3['audienceId']),console[_0x267dae(0x341)]('\x20\x20'+a32_0x7af4a1['dim'](_0x267dae(0x22c))+'\x20'+_0x3fecf3[_0x267dae(0x347)]),console[_0x267dae(0x341)]('\x20\x20'+a32_0x7af4a1[_0x267dae(0x1eb)]('Session:')+'\x20'+_0x3fecf3['workflowSessionId']),console[_0x267dae(0x341)]('\x20\x20'+a32_0x7af4a1[_0x267dae(0x1eb)]('Attempt:')+'\x20'+_0x3fecf3[_0x267dae(0x364)]),console['error']('\x20\x20'+_0x28d3e8),console[_0x267dae(0x341)]('\x0a'+a32_0x7af4a1['dim'](_0x267dae(0x2a8))+_0x267dae(0x34b)+_0x3fecf3[_0x267dae(0x364)]+_0x267dae(0x2e3)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x305);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x2c4);async[a32_0x5e657a(0x30b)](_0x897526){const _0x4bfddc=a32_0x5e657a,{options:_0x5e0706,args:_0x59278b,tdx:_0x10483f}=_0x897526,_0x5caf62=_0x59278b[0x0]||_0x5e0706[_0x4bfddc(0x248)];if(!_0x5caf62)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+_0x4bfddc(0x2f7)),0x1;_0x5e0706['verbose']&&(console[_0x4bfddc(0x341)](_0x4bfddc(0x220)+_0x5e0706[_0x4bfddc(0x287)]),console['error']('Parent\x20segment:\x20'+_0x5caf62));const _0xabce10=await withSpinner(_0x4bfddc(0x2c5)+_0x5caf62+_0x4bfddc(0x31b),()=>_0x10483f['segment']['listFields'](_0x5caf62),{'verbose':_0x5e0706[_0x4bfddc(0x374)]}),_0x375f49=_0xabce10[_0x4bfddc(0x1f1)];console['error'](_0x4bfddc(0x2a2)+_0x375f49[_0x4bfddc(0x235)]+_0x4bfddc(0x273)+(_0x375f49[_0x4bfddc(0x235)]!==0x1?'s':''));if(_0x5e0706[_0x4bfddc(0x2fe)]||_0x5e0706['jsonl'])return await handleSDKOutput(_0x375f49,_0x5e0706),0x0;return displayFieldsHumanReadable(_0x375f49,_0x5caf62),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x3d8);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x2f4);async[a32_0x5e657a(0x30b)](_0x5b240d){const _0x3bb15e=a32_0x5e657a,{options:_0x53fe8d,args:_0x2ea7e2,tdx:_0x41492a}=_0x5b240d,_0x20dc72=_0x53fe8d,_0x392fcd=_0x2ea7e2[0x0]||_0x53fe8d[_0x3bb15e(0x248)];if(!_0x392fcd)return showParentSegmentNotSetError(_0x3bb15e(0x2f1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x3bb15e(0x39d)),0x1;_0x53fe8d[_0x3bb15e(0x374)]&&(console[_0x3bb15e(0x341)](_0x3bb15e(0x220)+_0x53fe8d['site']),console[_0x3bb15e(0x341)](_0x3bb15e(0x358)+_0x392fcd));const _0x5ac042=await withSpinner(_0x3bb15e(0x2f8)+_0x392fcd+_0x3bb15e(0x31b),()=>_0x41492a[_0x3bb15e(0x1e7)]['getParentFull'](_0x392fcd),{'verbose':_0x53fe8d[_0x3bb15e(0x374)]}),_0x3192fb=_0x5ac042[_0x3bb15e(0x1f1)];if(_0x20dc72[_0x3bb15e(0x343)]){const _0x1c74f0=getConsoleNextUrl(_0x20dc72[_0x3bb15e(0x287)],'/app/dw/parentSegments/'+_0x3192fb['id']);return console[_0x3bb15e(0x341)](a32_0x7af4a1[_0x3bb15e(0x262)]('✔')+'\x20Opening\x20'+a32_0x7af4a1[_0x3bb15e(0x302)](_0x1c74f0)),openBrowser(_0x1c74f0),0x0;}return await handleSingleObjectOutput(_0x3192fb,_0x53fe8d),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x1d5);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x1d0);async[a32_0x5e657a(0x30b)](_0x5aedfc){const _0x7fd240=a32_0x5e657a,{options:_0x41eadc,args:_0x45a95f,tdx:_0x40c564}=_0x5aedfc,_0x18e6e4=_0x41eadc,_0x1468c4=_0x45a95f[0x0]||_0x41eadc[_0x7fd240(0x248)];if(!_0x1468c4)return showParentSegmentNotSetError(_0x7fd240(0x289)+_0x7fd240(0x394)+_0x7fd240(0x244)+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x41eadc[_0x7fd240(0x374)]&&(console[_0x7fd240(0x341)](_0x7fd240(0x220)+_0x41eadc[_0x7fd240(0x287)]),console['error'](_0x7fd240(0x358)+_0x1468c4));const _0x5cc7d5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1468c4+_0x7fd240(0x31b),()=>_0x40c564['segment'][_0x7fd240(0x38b)](_0x1468c4),{'verbose':_0x41eadc['verbose']}),_0x396268=_0x5cc7d5[_0x7fd240(0x1f1)],_0x3cd4c7=_0x40c564[_0x7fd240(0x1e7)][_0x7fd240(0x2bf)](_0x396268);if(_0x18e6e4['output']){const _0x5e09cd=await this['collectSchema'](_0x5aedfc,_0x1468c4,_0x396268,_0x3cd4c7),_0x1fee6f=this[_0x7fd240(0x3a4)](_0x5e09cd);writeFileSync(_0x18e6e4[_0x7fd240(0x278)],_0x1fee6f);const _0x4485ef=_0x5e09cd[_0x7fd240(0x22a)][_0x7fd240(0x324)][_0x7fd240(0x235)]+_0x5e09cd[_0x7fd240(0x2e9)][_0x7fd240(0x325)]((_0x3a455b,_0x5d2418)=>_0x3a455b+_0x5d2418[_0x7fd240(0x324)][_0x7fd240(0x235)],0x0),_0x1d2412=_0x5e09cd[_0x7fd240(0x2e9)]['filter'](_0x557993=>_0x557993['columns'][_0x7fd240(0x235)]===0x0)[_0x7fd240(0x235)];return console[_0x7fd240(0x2e6)](_0x7fd240(0x230)+_0x18e6e4[_0x7fd240(0x278)]),console['log']('\x20\x20Database:\x20'+_0x3cd4c7),console['log'](_0x7fd240(0x1ec)+_0x5e09cd[_0x7fd240(0x2e9)][_0x7fd240(0x235)]+_0x7fd240(0x222)),console[_0x7fd240(0x2e6)]('\x20\x20Columns:\x20'+_0x4485ef+_0x7fd240(0x32b)),_0x1d2412>0x0&&console[_0x7fd240(0x2e6)]('\x20\x20Note:\x20'+_0x1d2412+_0x7fd240(0x317)),0x0;}console[_0x7fd240(0x341)]('\x0a'+a32_0x7af4a1[_0x7fd240(0x388)]('Output\x20Database:')+'\x20'+a32_0x7af4a1[_0x7fd240(0x302)](_0x3cd4c7));const _0x2c4594=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x40c564[_0x7fd240(0x1e7)][_0x7fd240(0x214)](_0x396268),{'verbose':_0x41eadc[_0x7fd240(0x374)]});console[_0x7fd240(0x341)]('\x0a'+a32_0x7af4a1[_0x7fd240(0x388)]('customers')+'\x20'+a32_0x7af4a1[_0x7fd240(0x1eb)]('('+_0x3cd4c7+_0x7fd240(0x3c3)));const _0x18b217=await executeSchemaQuery(_0x2c4594[_0x7fd240(0x1f1)],_0x40c564,_0x41eadc);await handleQueryOutput(_0x18b217,_0x41eadc);const _0x26939e=await withSpinner(_0x7fd240(0x23b),()=>_0x40c564[_0x7fd240(0x1e7)][_0x7fd240(0x2b4)](_0x396268),{'verbose':_0x41eadc[_0x7fd240(0x374)]});for(const _0x40f8c8 of _0x26939e[_0x7fd240(0x1f1)]){const _0x4ee87a='behavior_'+_0x40f8c8[_0x7fd240(0x304)]()[_0x7fd240(0x39a)](/\s+/g,'_'),_0x25a5ed='SELECT\x20*\x20FROM\x20'+_0x3cd4c7+'.'+_0x4ee87a;console['error']('\x0a'+a32_0x7af4a1['bold'](_0x40f8c8)+'\x20'+a32_0x7af4a1['dim']('('+_0x3cd4c7+'.'+_0x4ee87a+')'));try{const _0x2e4701=await executeSchemaQuery(_0x25a5ed,_0x40c564,_0x41eadc);await handleQueryOutput(_0x2e4701,_0x41eadc);}catch{console[_0x7fd240(0x341)](a32_0x7af4a1['yellow']('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a32_0x5e657a(0x267)](_0x19787e,_0x829108,_0x2eedc3,_0x2857cc){const _0x1b0aef=a32_0x5e657a,{options:_0x5d1db8,tdx:_0x521c92}=_0x19787e,_0x581afb=await withSpinner(_0x1b0aef(0x281),()=>_0x521c92[_0x1b0aef(0x1e7)][_0x1b0aef(0x214)](_0x2eedc3),{'verbose':_0x5d1db8['verbose']}),_0xb8c427=await executeSchemaQuery(_0x581afb[_0x1b0aef(0x1f1)],_0x521c92,_0x5d1db8),_0x7dc113=_0xb8c427[_0x1b0aef(0x1f1)][_0x1b0aef(0x2d4)](_0x5d5ab0=>({'name':_0x5d5ab0['column_name'],'type':_0x5d5ab0[_0x1b0aef(0x356)]})),_0x796389=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x521c92[_0x1b0aef(0x1e7)][_0x1b0aef(0x2b4)](_0x2eedc3),{'verbose':_0x5d1db8['verbose']}),_0x34882b=[];for(const _0x2631ce of _0x796389['data']){const _0x1f0d1b=_0x1b0aef(0x1fa)+_0x2631ce[_0x1b0aef(0x304)]()[_0x1b0aef(0x39a)](/\s+/g,'_'),_0x22d22c=_0x1b0aef(0x377)+_0x2857cc+'.'+_0x1f0d1b;let _0x1ac240=[];try{const _0x5d000d=await executeSchemaQuery(_0x22d22c,_0x521c92,_0x5d1db8);_0x1ac240=_0x5d000d[_0x1b0aef(0x1f1)][_0x1b0aef(0x2d4)](_0xaf0639=>({'name':_0xaf0639['column_name'],'type':_0xaf0639['column_type']}));}catch{}_0x34882b[_0x1b0aef(0x381)]({'table':_0x1f0d1b,'columns':_0x1ac240});}return{'database':_0x2857cc,'parent_segment':_0x829108,'parent_id':_0x2eedc3,'customers':{'table':_0x1b0aef(0x22a),'columns':_0x7dc113},'behaviors':_0x34882b};}[a32_0x5e657a(0x3a4)](_0x1fa6e5){const _0x51b0e4=a32_0x5e657a,_0x2cdf76=_0x4cc6f1=>{const _0x4cc09d=a32_0x1cbe;if(_0x4cc6f1[_0x4cc09d(0x235)]===0x0)return'[]';const _0x2ac6ea=_0x4cc6f1[_0x4cc09d(0x2d4)](_0x5e5136=>_0x4cc09d(0x2e4)+_0x5e5136['name']+_0x4cc09d(0x3db)+_0x5e5136[_0x4cc09d(0x285)]+_0x4cc09d(0x268));return'[\x0a'+_0x2ac6ea['join'](',\x0a')+_0x4cc09d(0x375);},_0x522905=_0x1fa6e5[_0x51b0e4(0x2e9)][_0x51b0e4(0x2d4)](_0x1dd970=>{const _0x42809d=_0x51b0e4;return _0x42809d(0x392)+_0x1dd970[_0x42809d(0x1c7)]+_0x42809d(0x3d5)+_0x2cdf76(_0x1dd970['columns'])[_0x42809d(0x39a)](/^/gm,'\x20\x20')[_0x42809d(0x38e)]()+_0x42809d(0x3d0);})[_0x51b0e4(0x29d)](',\x0a');return _0x51b0e4(0x265)+_0x1fa6e5['database']+_0x51b0e4(0x21f)+_0x1fa6e5['parent_segment']+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x1fa6e5[_0x51b0e4(0x22e)]+_0x51b0e4(0x1d6)+_0x1fa6e5['customers'][_0x51b0e4(0x1c7)]+_0x51b0e4(0x252)+_0x2cdf76(_0x1fa6e5['customers'][_0x51b0e4(0x324)])[_0x51b0e4(0x39a)](/^/gm,'\x20\x20')[_0x51b0e4(0x38e)]()+_0x51b0e4(0x2a6)+_0x522905+_0x51b0e4(0x29e);}}export class ParentSegmentSQLCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x23c);['description']=a32_0x5e657a(0x225);async['execute'](_0x3f7931){const _0x2685e6=a32_0x5e657a,{options:_0x30c8e6,args:_0x38f985,tdx:_0x325700}=_0x3f7931,_0x46507f=_0x38f985[0x0]||_0x30c8e6[_0x2685e6(0x248)];if(!_0x46507f)return showParentSegmentNotSetError(_0x2685e6(0x330)+_0x2685e6(0x360)),0x1;_0x30c8e6[_0x2685e6(0x374)]&&(console[_0x2685e6(0x341)]('Site:\x20'+_0x30c8e6[_0x2685e6(0x287)]),console['error'](_0x2685e6(0x358)+_0x46507f));const _0x11647c=await withSpinner(_0x2685e6(0x306)+_0x46507f+_0x2685e6(0x31b),()=>_0x325700[_0x2685e6(0x1e7)]['resolveParentId'](_0x46507f),{'verbose':_0x30c8e6[_0x2685e6(0x374)]}),_0x1bd577=_0x11647c[_0x2685e6(0x1f1)],_0x4ca2e8=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x46507f+_0x2685e6(0x31b),()=>_0x325700[_0x2685e6(0x1e7)]['getParentSQL'](_0x1bd577),{'verbose':_0x30c8e6[_0x2685e6(0x374)]}),_0x6e0eff=_0x4ca2e8[_0x2685e6(0x1f1)];return _0x30c8e6[_0x2685e6(0x308)]===_0x2685e6(0x2fe)||_0x30c8e6['format']===_0x2685e6(0x309)?await handleSDKOutput([{'sql':_0x6e0eff}],_0x30c8e6):console[_0x2685e6(0x2e6)](_0x6e0eff),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a32_0x5e657a(0x36c);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x297);async['execute'](_0x38eca7){const _0x2c8bd8=a32_0x5e657a,{options:_0x2a17e4,args:_0x406111,tdx:_0x20965b}=_0x38eca7,_0x5627bb=_0x406111[0x0]||_0x2a17e4['parentSegment'];if(!_0x5627bb)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'+_0x2c8bd8(0x1c5)),0x1;_0x2a17e4['verbose']&&(console[_0x2c8bd8(0x341)](_0x2c8bd8(0x220)+_0x2a17e4[_0x2c8bd8(0x287)]),console[_0x2c8bd8(0x341)](_0x2c8bd8(0x358)+_0x5627bb));const _0x24af69=await withSpinner(_0x2c8bd8(0x306)+_0x5627bb+'\x27...',()=>_0x20965b[_0x2c8bd8(0x1e7)][_0x2c8bd8(0x38b)](_0x5627bb),{'verbose':_0x2a17e4['verbose']}),_0x329183=_0x24af69[_0x2c8bd8(0x1f1)],_0x32443b=await withSpinner(_0x2c8bd8(0x2d3)+_0x5627bb+_0x2c8bd8(0x31b),()=>_0x20965b['segment'][_0x2c8bd8(0x214)](_0x329183),{'verbose':_0x2a17e4[_0x2c8bd8(0x374)]});let _0x81e46e=_0x32443b[_0x2c8bd8(0x1f1)];const _0x5b2a9a=resolveLimit(_0x2a17e4[_0x2c8bd8(0x293)],DEFAULT_DISPLAY_LIMIT),_0x17c16c=/\bLIMIT\s+\d+/i[_0x2c8bd8(0x35d)](_0x81e46e);!_0x17c16c&&(_0x81e46e=_0x81e46e[_0x2c8bd8(0x38e)]()[_0x2c8bd8(0x39a)](/;+$/,''),_0x81e46e='SELECT\x20*\x20FROM\x20(\x0a'+_0x81e46e+_0x2c8bd8(0x1fd)+_0x5b2a9a);_0x2a17e4[_0x2c8bd8(0x374)]&&console[_0x2c8bd8(0x341)](_0x2c8bd8(0x30e)+_0x81e46e);const _0x30e333=await withProgressSpinner(_0x2c8bd8(0x26e),async _0xa5ec17=>{const _0x32dc8c=_0x2c8bd8,_0x25305a=await _0x20965b[_0x32dc8c(0x2ad)][_0x32dc8c(0x30b)](_0x81e46e,{'catalog':'td','schema':'information_schema','onJobId':_0x2a5a14=>{const _0x1b281a=_0x32dc8c;_0xa5ec17[_0x1b281a(0x389)](_0x2a5a14);}});return _0x25305a;},{'verbose':_0x2a17e4[_0x2c8bd8(0x374)]}),_0x281750=_0x30e333['data'],_0x374d42=_0x281750['jobId']?_0x2c8bd8(0x303)+_0x281750['jobId']+']':'';return console['error'](_0x2c8bd8(0x21e)+_0x281750['stats']['processedRows'][_0x2c8bd8(0x224)]()+_0x2c8bd8(0x1d4)+(_0x2c8bd8(0x1ea)+formatElapsed(_0x281750[_0x2c8bd8(0x3c0)][_0x2c8bd8(0x321)])+_0x374d42)),await handleQueryOutput(_0x281750,_0x2a17e4),0x0;}}export class PSRtListCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x354);[a32_0x5e657a(0x1ef)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a32_0x5e657a(0x30b)](_0x30add8){const _0xb3336b=a32_0x5e657a,{options:_0x25cbe7,args:_0xc1757f,tdx:_0x5980d7}=_0x30add8,_0x1c2171=_0xc1757f[0x0],_0x420394=await withSpinner(_0x1c2171?_0xb3336b(0x269)+_0x1c2171+_0xb3336b(0x31b):_0xb3336b(0x1ce),()=>_0x5980d7[_0xb3336b(0x30f)][_0xb3336b(0x1dc)](),{'verbose':_0x25cbe7['verbose']});let _0x3c29fc=_0x420394[_0xb3336b(0x1f1)][_0xb3336b(0x1e8)](_0x393afa=>_0x393afa[_0xb3336b(0x363)]);if(_0x1c2171){const _0x4d28f1=_0x1c2171['replace'](/[.+^${}()|[\]\\]/g,_0xb3336b(0x3d6))[_0xb3336b(0x39a)](/\*/g,'.*')[_0xb3336b(0x39a)](/\?/g,'.'),_0x1d9d66=new RegExp('^'+_0x4d28f1+'$','i');_0x3c29fc=_0x3c29fc[_0xb3336b(0x1e8)](_0x1e573a=>_0x1d9d66[_0xb3336b(0x35d)](_0x1e573a[_0xb3336b(0x2af)]));}_0x3c29fc[_0xb3336b(0x3b6)]((_0x4397bf,_0x9a9723)=>_0x4397bf[_0xb3336b(0x2af)]['localeCompare'](_0x9a9723[_0xb3336b(0x2af)])),console['error']('✔\x20Found\x20'+_0x3c29fc[_0xb3336b(0x235)]+_0xb3336b(0x24e)+(_0x3c29fc[_0xb3336b(0x235)]!==0x1?'s':''));const _0x4228bc=_0x36b46a=>{const _0x3a81ba=_0xb3336b;return getConsoleNextUrl(_0x25cbe7['site'],_0x3a81ba(0x205)+_0x36b46a);};if(_0x25cbe7[_0xb3336b(0x308)]===_0xb3336b(0x2fe)||_0x25cbe7[_0xb3336b(0x308)]==='jsonl'){const _0x16a67e=_0x3c29fc['map'](_0x4af825=>({..._0x4af825,'url':_0x4228bc(_0x4af825['id'])}));await handleSDKOutput(_0x16a67e,_0x25cbe7);}else{if(_0x3c29fc[_0xb3336b(0x235)]===0x0)console['log'](_0xb3336b(0x357));else for(const _0x1402f6 of _0x3c29fc){const _0x26d481=_0x1402f6[_0xb3336b(0x3d3)]?a32_0x7af4a1['dim']('\x20('+formatRows(_0x1402f6[_0xb3336b(0x3d3)])+')'):'',_0x58513b=hyperlink(_0x1402f6['name'],_0x4228bc(_0x1402f6['id']));console[_0xb3336b(0x2e6)]('⚡\x20'+_0x58513b+_0x26d481);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x399);['description']=a32_0x5e657a(0x3b8);async[a32_0x5e657a(0x30b)](_0x3b44fe){const _0x41788d=a32_0x5e657a,{options:_0x15a8df,args:_0x1c22c7,tdx:_0x588d4e}=_0x3b44fe,_0x28ec67=_0x1c22c7[0x0]||_0x15a8df[_0x41788d(0x248)];if(!_0x28ec67)return showParentSegmentNotSetError(_0x41788d(0x1c3)+_0x41788d(0x342)),0x1;const _0x224b0a=resolveYamlFile(_0x28ec67);if(!existsSync(_0x224b0a))return showFileNotFoundError(_0x224b0a,_0x28ec67),0x1;let _0x4d2dd2;try{_0x4d2dd2=readFileSync(_0x224b0a,_0x41788d(0x2a7));}catch(_0x21f104){const _0x46b806=_0x21f104 instanceof Error?_0x21f104[_0x41788d(0x271)]:String(_0x21f104);return console[_0x41788d(0x341)](_0x41788d(0x1e2)+_0x46b806),0x1;}const _0x4c215d=createCommandSpinner(a32_0x7af4a1[_0x41788d(0x1eb)](_0x41788d(0x365)),{'verbose':_0x15a8df[_0x41788d(0x374)]});_0x4c215d[_0x41788d(0x3b1)]();const _0x4720f1={'realtime':!![],'onProgress':_0x609eaa=>{_0x4c215d['text']=formatProgressMessage(_0x609eaa);}};let _0x64267;try{_0x64267=await _0x588d4e[_0x41788d(0x1e7)][_0x41788d(0x2fd)](_0x4d2dd2,_0x4720f1),_0x4c215d['stop']();}catch(_0x1b8760){_0x4c215d['stop']();throw _0x1b8760;}console[_0x41788d(0x341)]('\x0a'+a32_0x7af4a1[_0x41788d(0x388)](_0x41788d(0x2b0))+'\x20'+_0x64267[_0x41788d(0x2af)]),console[_0x41788d(0x341)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x64267),console['error']('─'[_0x41788d(0x3aa)](0x3c));if(_0x64267[_0x41788d(0x2cf)]['length']>0x0){console[_0x41788d(0x341)]('\x0a'+a32_0x7af4a1['red'](_0x41788d(0x22b)));for(const _0x312e79 of _0x64267[_0x41788d(0x2cf)]){console[_0x41788d(0x341)]('\x20\x20'+a32_0x7af4a1[_0x41788d(0x334)]('•')+'\x20'+_0x312e79);}}return _0x64267['allValid']&&console[_0x41788d(0x341)]('\x0a'+a32_0x7af4a1['green']('✔')+_0x41788d(0x3ab)),_0x64267[_0x41788d(0x355)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x279);['description']=a32_0x5e657a(0x223);async[a32_0x5e657a(0x30b)](_0x387918){const _0x3b6c15=a32_0x5e657a,{options:_0x367b1c,args:_0x4c75c3,tdx:_0x2b68fb}=_0x387918,_0x5ec5d3=_0x4c75c3[0x0]||_0x367b1c[_0x3b6c15(0x248)];if(!_0x5ec5d3)return showParentSegmentNotSetError(_0x3b6c15(0x29f)+_0x3b6c15(0x216)),0x1;_0x367b1c[_0x3b6c15(0x374)]&&(console[_0x3b6c15(0x341)]('Site:\x20'+_0x367b1c['site']),console[_0x3b6c15(0x341)](_0x3b6c15(0x358)+_0x5ec5d3));const _0x4146c5=await withSpinner(_0x3b6c15(0x306)+_0x5ec5d3+'\x27...',()=>_0x2b68fb['segment']['resolveParentId'](_0x5ec5d3),{'verbose':_0x367b1c[_0x3b6c15(0x374)]}),_0x358aba=_0x4146c5['data'],_0x4cace6=await withSpinner(_0x3b6c15(0x39f)+_0x5ec5d3+_0x3b6c15(0x31b),()=>_0x2b68fb[_0x3b6c15(0x30f)][_0x3b6c15(0x294)](_0x358aba),{'verbose':_0x367b1c[_0x3b6c15(0x374)]}),_0x4a9d1f=_0x4cace6[_0x3b6c15(0x1f1)];console['error'](_0x3b6c15(0x2a2)+_0x4a9d1f[_0x3b6c15(0x235)]+_0x3b6c15(0x3bd)+(_0x4a9d1f[_0x3b6c15(0x235)]!==0x1?'s':''));if(_0x367b1c[_0x3b6c15(0x308)]===_0x3b6c15(0x2fe)||_0x367b1c[_0x3b6c15(0x308)]===_0x3b6c15(0x309))await handleSDKOutput(_0x4a9d1f,_0x367b1c);else{if(_0x4a9d1f[_0x3b6c15(0x235)]===0x0)console[_0x3b6c15(0x2e6)](_0x3b6c15(0x31d));else for(const _0x198391 of _0x4a9d1f){const _0x4b3d1f=_0x198391[_0x3b6c15(0x24f)]===_0x3b6c15(0x2c3)?'🚀':'📝',_0x1046b1=_0x198391[_0x3b6c15(0x1f8)]?a32_0x7af4a1['yellow'](_0x3b6c15(0x319)):'',_0x130655=a32_0x7af4a1[_0x3b6c15(0x1eb)]('\x20('+_0x198391['stageCount']+'\x20stage'+(_0x198391[_0x3b6c15(0x398)]!==0x1?'s':'')+')');console[_0x3b6c15(0x2e6)](_0x4b3d1f+'\x20'+_0x198391[_0x3b6c15(0x2af)]+_0x1046b1+_0x130655);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{['name']=a32_0x5e657a(0x221);['description']=a32_0x5e657a(0x1bb);async[a32_0x5e657a(0x30b)](_0x681add){const _0x15ce7a=a32_0x5e657a,{options:_0x227b9f,args:_0x2b0b8d,tdx:_0x35816b}=_0x681add,_0xa59c74=_0x2b0b8d[0x0];if(!_0xa59c74)return console[_0x15ce7a(0x341)](a32_0x7af4a1['red']('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x15ce7a(0x341)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console[_0x15ce7a(0x341)](a32_0x7af4a1[_0x15ce7a(0x1eb)](_0x15ce7a(0x2c1))),0x1;_0x227b9f[_0x15ce7a(0x374)]&&(console[_0x15ce7a(0x341)](_0x15ce7a(0x220)+_0x227b9f[_0x15ce7a(0x287)]),console[_0x15ce7a(0x341)](_0x15ce7a(0x1f3)+_0xa59c74));const _0x1f32e4=await withSpinner(_0x15ce7a(0x30a)+_0xa59c74+'\x27...',()=>_0x35816b[_0x15ce7a(0x30f)][_0x15ce7a(0x3d9)](_0xa59c74),{'verbose':_0x227b9f[_0x15ce7a(0x374)]}),_0x4373fa=_0x1f32e4[_0x15ce7a(0x1f1)];console[_0x15ce7a(0x341)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x4373fa['name']+'\x27');if(_0x227b9f['format']===_0x15ce7a(0x2fe)||_0x227b9f['format']===_0x15ce7a(0x309))await handleSDKOutput([_0x4373fa],_0x227b9f);else{const _0x2ece96=_0x4373fa[_0x15ce7a(0x24f)]===_0x15ce7a(0x2c3)?'🚀':'📝',_0x826bee=_0x4373fa[_0x15ce7a(0x1f8)]?a32_0x7af4a1[_0x15ce7a(0x23d)]('\x20(paused)'):'';console[_0x15ce7a(0x2e6)](_0x2ece96+'\x20'+_0x4373fa['name']+_0x826bee);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']=a32_0x5e657a(0x386);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x387);async[a32_0x5e657a(0x30b)](_0x39e961){const _0x190127=a32_0x5e657a,{options:_0x20201c,args:_0x55da61,tdx:_0x125d8e}=_0x39e961,_0x364399=_0x55da61[0x0];if(!_0x364399)return console[_0x190127(0x341)](a32_0x7af4a1[_0x190127(0x334)](_0x190127(0x3b9))),console[_0x190127(0x341)](_0x190127(0x28c)),console['error'](a32_0x7af4a1[_0x190127(0x1eb)](_0x190127(0x2c1))),0x1;_0x20201c[_0x190127(0x374)]&&(console['error'](_0x190127(0x220)+_0x20201c['site']),console[_0x190127(0x341)](_0x190127(0x1f3)+_0x364399));const _0x114686=await withSpinner(_0x190127(0x382)+_0x364399+_0x190127(0x31b),()=>_0x125d8e['realtime'][_0x190127(0x3d7)](_0x364399),{'verbose':_0x20201c[_0x190127(0x374)]}),_0xe41f0a=_0x114686[_0x190127(0x1f1)];console[_0x190127(0x341)](_0x190127(0x27a)+_0xe41f0a[_0x190127(0x2af)]+'\x27');if(_0x20201c[_0x190127(0x308)]===_0x190127(0x2fe)||_0x20201c[_0x190127(0x308)]===_0x190127(0x309))await handleSDKOutput([_0xe41f0a],_0x20201c);else{const _0x1cc60b=_0xe41f0a[_0x190127(0x24f)]===_0x190127(0x2c3)?'🚀':'📝',_0x44bc26=_0xe41f0a['paused']?a32_0x7af4a1[_0x190127(0x23d)](_0x190127(0x319)):'';console[_0x190127(0x2e6)](_0x1cc60b+'\x20'+_0xe41f0a[_0x190127(0x2af)]+_0x44bc26);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x237);[a32_0x5e657a(0x1ef)]='Get\x20current\x20RT\x20configuration\x20version\x20status';async['execute'](_0x368ebd){const _0x152e66=a32_0x5e657a,{options:_0x432736,args:_0x2bb012,tdx:_0xc5aad1}=_0x368ebd,_0x57038e=_0x2bb012[0x0]||_0x432736[_0x152e66(0x248)];if(!_0x57038e)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;_0x432736[_0x152e66(0x374)]&&(console['error'](_0x152e66(0x220)+_0x432736[_0x152e66(0x287)]),console[_0x152e66(0x341)]('Parent\x20segment:\x20'+_0x57038e));const _0x428a4d=await withSpinner(_0x152e66(0x306)+_0x57038e+_0x152e66(0x31b),()=>_0xc5aad1[_0x152e66(0x1e7)][_0x152e66(0x38b)](_0x57038e),{'verbose':_0x432736[_0x152e66(0x374)]}),_0x145fd9=_0x428a4d[_0x152e66(0x1f1)],_0x2ed3cb=await withSpinner(_0x152e66(0x2ba)+_0x57038e+_0x152e66(0x31b),()=>_0xc5aad1['realtime'][_0x152e66(0x26a)](_0x145fd9),{'verbose':_0x432736[_0x152e66(0x374)]}),_0x401990=_0x2ed3cb[_0x152e66(0x1f1)];return console[_0x152e66(0x341)]('✔\x20Retrieved\x20RT\x20configuration\x20version'),_0x432736[_0x152e66(0x308)]===_0x152e66(0x2fe)||_0x432736[_0x152e66(0x308)]===_0x152e66(0x309)?await handleSDKOutput([_0x401990],_0x432736):(console[_0x152e66(0x2e6)]('id:\x20'+_0x401990['id']),console[_0x152e66(0x2e6)](_0x152e66(0x258)+_0x401990[_0x152e66(0x1d8)]),console[_0x152e66(0x2e6)](_0x152e66(0x2a5)+_0x401990['identifier']),console['log']('eventKind:\x20'+_0x401990[_0x152e66(0x2fc)]),console[_0x152e66(0x2e6)]('status:\x20'+_0x401990[_0x152e66(0x347)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x322);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x1db);async[a32_0x5e657a(0x30b)](_0x2e5c69){const _0xc82735=a32_0x5e657a,{options:_0x1f2535,args:_0x5afae0,tdx:_0x5e8e6e}=_0x2e5c69,_0x31c526=_0x5afae0[0x0]||_0x1f2535[_0xc82735(0x248)];if(!_0x31c526)return showParentSegmentNotSetError(_0xc82735(0x349)+_0xc82735(0x311)),0x1;const _0x420ce3=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x31c526+_0xc82735(0x31b),()=>_0x5e8e6e[_0xc82735(0x1e7)][_0xc82735(0x38b)](_0x31c526),{'verbose':_0x1f2535['verbose']}),_0x34cf6f=_0x420ce3[_0xc82735(0x1f1)],_0x391dea=await withSpinner(_0xc82735(0x2ea)+_0x31c526+_0xc82735(0x31b),()=>_0x5e8e6e[_0xc82735(0x24d)][_0xc82735(0x1dc)](_0x34cf6f),{'verbose':_0x1f2535['verbose']}),_0x2bd31f=_0x391dea[_0xc82735(0x1f1)];console[_0xc82735(0x341)](_0xc82735(0x2a2)+_0x2bd31f[_0xc82735(0x235)]+_0xc82735(0x367)+(_0x2bd31f[_0xc82735(0x235)]!==0x1?'s':''));if(_0x1f2535[_0xc82735(0x308)]===_0xc82735(0x2fe)||_0x1f2535[_0xc82735(0x308)]===_0xc82735(0x309))await handleSDKOutput(_0x2bd31f,_0x1f2535);else{if(_0x2bd31f['length']===0x0)console['log'](_0xc82735(0x3da)),console[_0xc82735(0x341)](a32_0x7af4a1[_0xc82735(0x302)](_0xc82735(0x3c2)));else for(const _0x15b391 of _0x2bd31f){console[_0xc82735(0x2e6)](a32_0x7af4a1[_0xc82735(0x388)](_0x15b391[_0xc82735(0x2af)])+'\x20'+a32_0x7af4a1[_0xc82735(0x1eb)](_0xc82735(0x2eb)+_0x15b391['id']+')'));_0x15b391['description']&&console[_0xc82735(0x2e6)]('\x20\x20'+a32_0x7af4a1['dim'](_0x15b391['description']));if(_0x15b391[_0xc82735(0x1c4)]&&_0x15b391[_0xc82735(0x1c4)][_0xc82735(0x235)]>0x0)for(const _0x311cbe of _0x15b391[_0xc82735(0x1c4)]){const _0x1bd7bb=_0x311cbe[_0xc82735(0x3c8)]?.[_0xc82735(0x235)]?_0x311cbe['allowedIps'][_0xc82735(0x29d)](',\x20'):'any';console[_0xc82735(0x2e6)]('\x20\x20'+a32_0x7af4a1[_0xc82735(0x302)](_0xc82735(0x31e))+'\x20'+_0x311cbe[_0xc82735(0x2af)]+'\x20'+a32_0x7af4a1[_0xc82735(0x1eb)](_0xc82735(0x2eb)+_0x311cbe['id']+')')),console[_0xc82735(0x2e6)]('\x20\x20\x20\x20'+a32_0x7af4a1[_0xc82735(0x1eb)](_0xc82735(0x219))+'\x20'+_0x1bd7bb);}else console['log']('\x20\x20'+a32_0x7af4a1[_0xc82735(0x1eb)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x36a);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x359);async[a32_0x5e657a(0x30b)](_0x2de96c){const _0x3b6994=a32_0x5e657a,{options:_0x4cc398,args:_0x2e6ba1,tdx:_0x166b65}=_0x2de96c,_0x8ae595=_0x4cc398,_0x319dc5=_0x2e6ba1[0x0],_0x54c759=_0x2e6ba1[0x1]||_0x4cc398[_0x3b6994(0x248)];if(!_0x319dc5)return console[_0x3b6994(0x341)]('Error:\x20Service\x20name\x20is\x20required'),console[_0x3b6994(0x341)](_0x3b6994(0x3dd)),console[_0x3b6994(0x341)](_0x3b6994(0x3bc)),0x1;if(!_0x54c759)return showParentSegmentNotSetError(_0x3b6994(0x390)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x85d013=await withSpinner(_0x3b6994(0x306)+_0x54c759+_0x3b6994(0x31b),()=>_0x166b65[_0x3b6994(0x1e7)][_0x3b6994(0x38b)](_0x54c759),{'verbose':_0x4cc398[_0x3b6994(0x374)]}),_0x4ccb5a=_0x85d013[_0x3b6994(0x1f1)],_0xbb8a0d={'name':_0x319dc5,'description':_0x8ae595[_0x3b6994(0x1ef)],'public':_0x8ae595[_0x3b6994(0x29a)]},_0x2ea745=await withSpinner(_0x3b6994(0x3c9)+_0x319dc5+'\x27...',()=>_0x166b65[_0x3b6994(0x24d)][_0x3b6994(0x2de)](_0x4ccb5a,_0xbb8a0d),{'verbose':_0x4cc398['verbose']}),_0x16187a=_0x2ea745[_0x3b6994(0x1f1)];return console[_0x3b6994(0x341)]('✔\x20Created\x20personalization\x20service\x20\x27'+_0x16187a[_0x3b6994(0x2af)]+'\x27\x20with\x20ID:\x20'+_0x16187a['id']),await handleSDKOutput([_0x16187a],_0x4cc398),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']=a32_0x5e657a(0x383);['description']=a32_0x5e657a(0x3a6);async['execute'](_0x19b68c){const _0x5cd76c=a32_0x5e657a,{options:_0x39f917,args:_0x5499dc,tdx:_0x243651}=_0x19b68c,_0x1125fe=_0x5499dc[0x0],_0x80387b=_0x5499dc[0x1]||_0x39f917['parentSegment'];if(!_0x1125fe)return console['error'](_0x5cd76c(0x2f9)),console[_0x5cd76c(0x341)](_0x5cd76c(0x29c)),console['error'](_0x5cd76c(0x270)),0x1;if(!_0x80387b)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+_0x5cd76c(0x270)),0x1;const _0x4ef2c2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x80387b+_0x5cd76c(0x31b),()=>_0x243651[_0x5cd76c(0x1e7)][_0x5cd76c(0x38b)](_0x80387b),{'verbose':_0x39f917['verbose']}),_0x572726=_0x4ef2c2['data'],_0x16a4a4=await withSpinner(_0x5cd76c(0x2aa)+_0x1125fe+_0x5cd76c(0x31b),()=>_0x243651['personalization']['get'](_0x572726,_0x1125fe),{'verbose':_0x39f917[_0x5cd76c(0x374)]}),_0x4196ee=_0x16a4a4['data'];if(_0x39f917[_0x5cd76c(0x2fe)]||_0x39f917['jsonl'])await handleSDKOutput([_0x4196ee],_0x39f917);else{console[_0x5cd76c(0x2e6)](a32_0x7af4a1[_0x5cd76c(0x388)](_0x4196ee[_0x5cd76c(0x2af)])+'\x20'+a32_0x7af4a1[_0x5cd76c(0x1eb)]('(id:\x20'+_0x4196ee['id']+')'));_0x4196ee[_0x5cd76c(0x1ef)]&&console[_0x5cd76c(0x2e6)]('\x20\x20'+a32_0x7af4a1['dim'](_0x4196ee[_0x5cd76c(0x1ef)]));console[_0x5cd76c(0x2e6)]('\x20\x20'+a32_0x7af4a1[_0x5cd76c(0x302)](_0x5cd76c(0x26b))+'\x20'+(_0x4196ee[_0x5cd76c(0x29a)]?'yes':'no'));if(_0x4196ee[_0x5cd76c(0x1c4)]&&_0x4196ee[_0x5cd76c(0x1c4)][_0x5cd76c(0x235)]>0x0)for(const _0x480b91 of _0x4196ee['tokens']){const _0x5e0489=_0x480b91[_0x5cd76c(0x3c8)]?.[_0x5cd76c(0x235)]?_0x480b91['allowedIps'][_0x5cd76c(0x29d)](',\x20'):_0x5cd76c(0x1e0);console[_0x5cd76c(0x2e6)]('\x20\x20'+a32_0x7af4a1[_0x5cd76c(0x302)](_0x5cd76c(0x31e))+'\x20'+_0x480b91[_0x5cd76c(0x2af)]+'\x20'+a32_0x7af4a1[_0x5cd76c(0x1eb)](_0x5cd76c(0x2eb)+_0x480b91['id']+')')),console[_0x5cd76c(0x2e6)]('\x20\x20\x20\x20'+a32_0x7af4a1['dim'](_0x5cd76c(0x219))+'\x20'+_0x5e0489);}else console[_0x5cd76c(0x2e6)]('\x20\x20'+a32_0x7af4a1[_0x5cd76c(0x1eb)](_0x5cd76c(0x3cb)));}return 0x0;}}function a32_0x1cbe(_0x2bbad1,_0x4e30f1){_0x2bbad1=_0x2bbad1-0x1ba;const _0x1c502d=a32_0x1c50();let _0x1cbe68=_0x1c502d[_0x2bbad1];return _0x1cbe68;}export class PSPzServiceDeleteCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x1bd);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x2c9);async[a32_0x5e657a(0x30b)](_0xb71662){const _0x40fdcb=a32_0x5e657a,{options:_0x10e9d9,args:_0x5223ff,tdx:_0x2c97ad}=_0xb71662,_0x447b06=_0x5223ff[0x0],_0xdff30c=_0x5223ff[0x1]||_0x10e9d9[_0x40fdcb(0x248)];if(!_0x447b06)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console[_0x40fdcb(0x341)](_0x40fdcb(0x1fe)),console[_0x40fdcb(0x341)](_0x40fdcb(0x2a3)),0x1;if(!_0xdff30c)return showParentSegmentNotSetError(_0x40fdcb(0x234)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x45948d=await withSpinner(_0x40fdcb(0x306)+_0xdff30c+_0x40fdcb(0x31b),()=>_0x2c97ad[_0x40fdcb(0x1e7)][_0x40fdcb(0x38b)](_0xdff30c),{'verbose':_0x10e9d9[_0x40fdcb(0x374)]}),_0x18abf5=_0x45948d[_0x40fdcb(0x1f1)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x447b06+_0x40fdcb(0x31b),()=>_0x2c97ad['personalization'][_0x40fdcb(0x3b7)](_0x18abf5,_0x447b06),{'verbose':_0x10e9d9[_0x40fdcb(0x374)]}),console['error'](_0x40fdcb(0x299)+_0x447b06+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x3ca);[a32_0x5e657a(0x1ef)]='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a32_0x5e657a(0x30b)](_0x21ba16){const _0x5cde18=a32_0x5e657a,{options:_0x392e26,args:_0x54653f,tdx:_0x2aed76}=_0x21ba16,_0x4a3b26=_0x392e26,_0x1d5eaf=_0x54653f[0x0],_0x30f500=_0x54653f[0x1]||_0x392e26[_0x5cde18(0x248)];if(!_0x1d5eaf)return console[_0x5cde18(0x341)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x5cde18(0x341)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),console[_0x5cde18(0x341)](_0x5cde18(0x37d)),0x1;if(!_0x4a3b26[_0x5cde18(0x2af)])return console[_0x5cde18(0x341)](_0x5cde18(0x201)),console[_0x5cde18(0x341)](_0x5cde18(0x379)),0x1;if(!_0x30f500)return showParentSegmentNotSetError(_0x5cde18(0x264)+_0x5cde18(0x37d)),0x1;const _0x36000f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x30f500+_0x5cde18(0x31b),()=>_0x2aed76[_0x5cde18(0x1e7)][_0x5cde18(0x38b)](_0x30f500),{'verbose':_0x392e26[_0x5cde18(0x374)]}),_0x1d804f=_0x36000f[_0x5cde18(0x1f1)],_0x40f3c4={'name':_0x4a3b26['name']};_0x4a3b26[_0x5cde18(0x1ef)]!==undefined&&(_0x40f3c4[_0x5cde18(0x1ef)]=_0x4a3b26[_0x5cde18(0x1ef)]);const _0x3522d4=await withSpinner(_0x5cde18(0x282)+_0x1d5eaf+_0x5cde18(0x31b),()=>_0x2aed76[_0x5cde18(0x24d)][_0x5cde18(0x368)](_0x1d804f,_0x1d5eaf,_0x40f3c4),{'verbose':_0x392e26[_0x5cde18(0x374)]}),_0x5b1b4e=_0x3522d4[_0x5cde18(0x1f1)];return console[_0x5cde18(0x341)](_0x5cde18(0x1f6)+_0x5b1b4e[_0x5cde18(0x2af)]+'\x27'),await handleSDKOutput([_0x5b1b4e],_0x392e26),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']='ps:pz:service:token:create';['description']=a32_0x5e657a(0x335);async[a32_0x5e657a(0x30b)](_0xcbce7d){const _0x4d50d8=a32_0x5e657a,{options:_0x1e2cd2,args:_0x4d23a5,tdx:_0x5db639}=_0xcbce7d,_0xed4370=_0x1e2cd2,_0x3eebe9=_0x4d23a5[0x0],_0x224815=_0x4d23a5[0x1],_0x55d34f=_0x4d23a5[0x2]||_0x1e2cd2[_0x4d50d8(0x248)];if(!_0x3eebe9)return console['error']('Error:\x20Token\x20name\x20is\x20required'),console[_0x4d50d8(0x341)](_0x4d50d8(0x300)),console[_0x4d50d8(0x341)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x224815)return console[_0x4d50d8(0x341)](_0x4d50d8(0x2f9)),console[_0x4d50d8(0x341)](_0x4d50d8(0x300)),console[_0x4d50d8(0x341)](_0x4d50d8(0x1be)),0x1;if(!_0x55d34f)return showParentSegmentNotSetError(_0x4d50d8(0x226)+_0x4d50d8(0x1be)),0x1;const _0x5adfbe=await withSpinner(_0x4d50d8(0x306)+_0x55d34f+'\x27...',()=>_0x5db639[_0x4d50d8(0x1e7)]['resolveParentId'](_0x55d34f),{'verbose':_0x1e2cd2[_0x4d50d8(0x374)]}),_0x11a066=_0x5adfbe[_0x4d50d8(0x1f1)],_0x53a711={'name':_0x3eebe9};_0xed4370[_0x4d50d8(0x3c8)]&&(_0x53a711['allowedIps']=_0xed4370[_0x4d50d8(0x3c8)][_0x4d50d8(0x32e)](',')[_0x4d50d8(0x2d4)](_0x548917=>_0x548917['trim']()));_0xed4370[_0x4d50d8(0x1ef)]&&(_0x53a711[_0x4d50d8(0x1ef)]=_0xed4370[_0x4d50d8(0x1ef)]);const _0x4394c9=await withSpinner(_0x4d50d8(0x2a1)+_0x3eebe9+_0x4d50d8(0x36d)+_0x224815+_0x4d50d8(0x31b),()=>_0x5db639[_0x4d50d8(0x24d)][_0x4d50d8(0x35c)](_0x11a066,_0x224815,_0x53a711),{'verbose':_0x1e2cd2['verbose']}),_0x5367d7=_0x4394c9['data'];return console['error'](_0x4d50d8(0x1f4)+_0x5367d7['name']+_0x4d50d8(0x3a5)+_0x5367d7['id']),_0x5367d7[_0x4d50d8(0x369)]&&(console[_0x4d50d8(0x341)](a32_0x7af4a1['yellow'](_0x4d50d8(0x24b))),console[_0x4d50d8(0x341)](a32_0x7af4a1['cyan'](_0x5367d7[_0x4d50d8(0x369)])),console[_0x4d50d8(0x341)]('')),await handleSDKOutput([_0x5367d7],_0x1e2cd2),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x2b2);['description']=a32_0x5e657a(0x1cd);async['execute'](_0xf7105f){const _0x1923eb=a32_0x5e657a,{options:_0x2f5891,args:_0x13ba2,tdx:_0x18a0dd}=_0xf7105f,_0x59d6f1=_0x13ba2[0x0],_0x560339=_0x13ba2[0x1]||_0x2f5891[_0x1923eb(0x248)];if(!_0x59d6f1)return console[_0x1923eb(0x341)]('Error:\x20Token\x20ID\x20is\x20required'),console['error'](_0x1923eb(0x373)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x560339)return showParentSegmentNotSetError(_0x1923eb(0x1c2)+_0x1923eb(0x36e)),0x1;const _0x23662e=await withSpinner(_0x1923eb(0x306)+_0x560339+'\x27...',()=>_0x18a0dd[_0x1923eb(0x1e7)][_0x1923eb(0x38b)](_0x560339),{'verbose':_0x2f5891[_0x1923eb(0x374)]}),_0xa05e31=_0x23662e[_0x1923eb(0x1f1)],_0x4bef43=await withSpinner(_0x1923eb(0x2c7),()=>_0x18a0dd[_0x1923eb(0x24d)][_0x1923eb(0x1dc)](_0xa05e31),{'verbose':_0x2f5891[_0x1923eb(0x374)]}),_0x5cd5c5=_0x4bef43[_0x1923eb(0x1f1)];let _0x410cc9;for(const _0x1446a2 of _0x5cd5c5){if(_0x1446a2[_0x1923eb(0x1c4)]?.[_0x1923eb(0x344)](_0x48e303=>_0x48e303['id']===_0x59d6f1)){_0x410cc9=_0x1446a2['id'];break;}}if(!_0x410cc9)return console[_0x1923eb(0x341)](_0x1923eb(0x1c9)+_0x59d6f1+'\x27\x20not\x20found\x20in\x20any\x20personalization\x20service'),0x1;const _0x5ba9cd=await withSpinner('Deleting\x20token\x20\x27'+_0x59d6f1+_0x1923eb(0x31b),()=>_0x18a0dd['personalization'][_0x1923eb(0x33a)](_0xa05e31,_0x410cc9,_0x59d6f1),{'verbose':_0x2f5891[_0x1923eb(0x374)]}),_0x565a61=_0x5ba9cd['data'];return console[_0x1923eb(0x341)](_0x1923eb(0x209)+(_0x565a61[_0x1923eb(0x2af)]||_0x59d6f1)+'\x27'),await handleSDKOutput([_0x565a61],_0x2f5891),0x0;}}function a32_0x1c50(){const _0x32ea29=['Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','user_id','varchar','parentSegment','tdx\x20ps\x20preview\x20','file','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','behavior','personalization','\x20RT-enabled\x20parent\x20segment','state','Personalization\x20service\x20description','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','column','1440256yQnxAd','Source:','audienceId:\x20','Next\x20steps:','Options:','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','timezone','stringify','sections:','Getting\x20personalization\x20\x27','tdx\x20ps\x20push\x20','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','green','createdAt','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','{\x0a\x20\x20\x22database\x22:\x20\x22','addAttributesFile','collectSchema','\x22\x20}','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','getCurrentConfigVersion','public:','.yaml','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','Executing\x20parent\x20segment\x20query...','ID\x20Stitching:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','message','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20field','Fetching\x20current\x20configuration\x20for\x20\x27','\x27\x20and\x20run\x20workflow?','12upbvbS','last_page_viewed','output','ps:rt:jn:list','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x0a⚠️\x20\x20Both\x20','displayRealtimeInfo','sourceTableValid','\x20service','sourceTableError','Fetching\x20customers\x20schema...','Updating\x20personalization\x20service\x20\x27','parent_segments','session','type','/\x20→\x20','site','ps:pz:show','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','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','page_view','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','Fetching\x20sample\x20data...','\x20--attribute\x20\x22<name>\x22','3147uxTCEO','workflowSessionId','\x20\x20\x20\x20\x20\x20','/app/workflows/','limit','listJourneys','\x0a⚠️\x20\x20Migrating:\x20','ps:pz:create','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','scheduleOption','✔\x20Deleted\x20personalization\x20service\x20\x27','public','Error:\x20File\x20not\x20found:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','join','\x0a\x20\x20]\x0a}\x0a','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','Join\x20on:','Creating\x20token\x20\x27','✔\x20Found\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','/{name}.yml\x0a','identifier:\x20','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','utf-8','To\x20cancel:','Creating\x20parent\x20segment\x20\x27','Fetching\x20personalization\x20service\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','query','master','name','RT\x202.0\x20Validate:','128835pZZxpA','ps:pz:service:token:delete','✔\x20Updated\x20parent\x20segment\x20\x27','getBehaviorNames','displaySummary','audienceId:','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x20--interval\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','payload','My\x20Service','apply','-1d','getOutputDatabaseName','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','launched','List\x20available\x20fields\x20for\x20segmentation','Listing\x20fields\x20for\x20\x27','\x0aChanges\x20to\x20\x27','Finding\x20service\x20for\x20token...','enabled','Delete\x20a\x20personalization\x20service','\x20service(s)\x20configured','ignore','\x20Context\x20set:\x20','coveragePercent','matchedCount','errors','\x20--behavior\x20\x22<name>\x22','payload:','Error:\x20Parent\x20segment\x20name\x20is\x20required','Fetching\x20SQL\x20for\x20\x27','map','\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','\x20parent\x20segment\x20\x27','No\x20parent\x20segments\x20match\x20pattern:\x20','Creating','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','entryCriteria:','.yml','\x20No\x20changes\x20-\x20','all','create','✔\x20Updated\x20personalization\x20\x27','Attributes','displaySampleData','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','\x20kill','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','rowCount','log','Attribute:','RT\x202.0:','behaviors','Listing\x20personalization\x20services\x20for\x20\x27','(id:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','/attempt/','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','⚡\x20Enabled','Overwrite\x20\x27','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','updatedAt','keyEventId','Show\x20parent\x20segment\x20details','attributes','toFixed','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Fetching\x20parent\x20segment\x20\x27','Error:\x20Service\x20ID\x20is\x20required','scheduleType','No\x20parent\x20segments\x20found','eventKind','validateParentYaml','json','\x20Added\x20RT\x202.0\x20template\x20section','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','parent_segment','cyan','\x20[Job\x20ID:\x20','toLowerCase','segment:parent:fields','Resolving\x20parent\x20segment\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','format','jsonl','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','execute','Updated','primaryKey','SQL\x20query:\x0a','realtime','\x0aNew\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','✔\x20Created\x20parent\x20segment\x20\x27','entryCriteria','Default','created:','displayMasterInfo','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','indexOf','\x20(paused)','\x0a✔\x20Workflow\x20started','\x27...','ps:pz:init','No\x20RT\x20journeys\x20found','token:','addBehaviorsFile','addAttributes','elapsedTimeMillis','ps:pz:service:list','1003968KmAKrU','columns','reduce','✔\x20Deleted\x20personalization\x20\x27','string','/\x20directories\x20exist.','Name:\x20','Created','\x20total','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','split','folder-segment','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','preview','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','%)\x20','red','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x20--enriched','run','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','deleteToken','✔\x20Found\x20personalization\x20\x27','joinKey','segment:parent:push','<database>.<table>','relationships','text','error','\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','web','some','Output\x20file:\x20','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','status','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','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','enriched','\x20tdx\x20wf\x20attempt\x20','Join:','\x20\x20No\x20sample\x20data\x20available','3279254YnbSMC','442EtRvfv','match','✔\x20Renamed\x20directory\x20to\x20','pullParentYaml','✔\x20No\x20changes\x20-\x20\x27','ps:rt:list','allValid','column_type','No\x20RT-enabled\x20parent\x20segments\x20found','Parent\x20segment:\x20','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Deleting\x20personalization\x20\x27','createToken','test','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','platform','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','attribute','createParent','realtime_enabled','workflowAttemptId','Validating\x20RT\x20configuration...','customersWithEvents','\x20personalization\x20service','patch','value','ps:pz:service:create','createPersonalization','segment:parent:show','\x27\x20for\x20service\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Behaviors','segment:parent:update','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','td_client_id','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','verbose','\x0a\x20\x20\x20\x20]','open','SELECT\x20*\x20FROM\x20','yes','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','sections','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','stitchingKeys','Audience\x20ID:','null','push','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','ps:pz:service:show','20BDbWiz','Listing\x20parent\x20segments...','ps:rt:jn:resume','Resume\x20activations\x20in\x20an\x20RT\x20journey','bold','setJobId','use','resolveParentId','/sessions/','previewParentYaml','trim','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','Enriched:','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','\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','displayPreviewHints','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','database','stageCount','ps:rt:validate','replace','localeCompare','patchPersonalization','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Listing\x20RT\x20journeys\x20for\x20\x27','\x20--attribute\x20\x22','listParents','\x0aNo\x20sample\x20data\x20available','personalization_services','formatSchemaJson','\x27\x20with\x20ID:\x20','Show\x20personalization\x20service\x20details','folderId','Delete\x20a\x20realtime\x20personalization','\x20\x20\x20\x20\x20\x20\x20\x20','repeat','\x20RT\x20configuration\x20is\x20valid','getParentFull','Error\x20parsing\x20YAML:\x20','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','\x20to\x20push\x20the\x20configuration','Analyzing\x20changes...','start','parentFolder','Error:\x20Personalization\x20ID\x20is\x20required','Error:\x20--attribute\x20requires\x20a\x20name\x0a','number','sort','delete','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','343698stTgJD','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','\x20RT\x20journey','endsWith','\x0aChanges\x20to\x20apply\x20to\x20\x27','stats','ps:pz:patch','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','.customers)','⚡\x20Not\x20enabled','\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','single','includeSensitive','allowedIps','Creating\x20personalization\x20service\x20\x27','ps:pz:service:update','no\x20tokens\x20configured','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','listPersonalizations','Show\x20a\x20specific\x20realtime\x20personalization','customerGroupFile','\x0a\x20\x20\x20\x20}','displayBehaviorsStats','✔\x20Created\x20personalization\x20\x27','population','runParent','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x5c$&','resumeJourney','segment:parent:view','pauseJourney','No\x20personalization\x20services\x20configured','\x22,\x20\x22type\x22:\x20\x22','ps:pz:list','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Apply\x20changes\x20to\x20\x27','\x20parent\x20segment','\x27\x20is\x20up\x20to\x20date','Pause\x20activations\x20in\x20an\x20RT\x20journey','label','ps:pz:service:delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','attributesFile','foreignKey','Validate:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','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','tokens','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Database:\x20','table','\x0aError:','Error:\x20Token\x20\x27','/\x20directory.\x0a','segment:parent:create','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Listing\x20RT-enabled\x20parent\x20segments...','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Show\x20parent\x20segment\x20schema\x20(column\x20types)','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','Available\x20behaviors:','segment:parent:list','\x20rows\x20','segment:parent:desc','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','customerGroup','audienceId','Error:','Columns:','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','list','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','keyEventId:','Updating','any','\x20\x20\x20\x20','Error\x20reading\x20file:\x20','YAML\x20file:\x20','\x20\x20\x20\x20-\x20','/\x20and\x20','personalizationServices','segment','filter','\x20to\x20configure\x20your\x20personalization\x20service','in\x20','dim','\x20\x20Tables:\x201\x20customers\x20+\x20','displayColumns','\x27\x20is\x20already\x20up\x20to\x20date','description','displayPreviewResults','data','displayValidateResults','RT\x20Journey\x20ID:\x20','✔\x20Created\x20token\x20\x27','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','✔\x20Updated\x20personalization\x20service\x20\x27','8qYbFDN','paused','Customers:','behavior_','pushParentYaml','totalEvents','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','interval','displayAttributesStats','Error:\x20--name\x20is\x20required','Behavior:','827ZehjnZ','idStitching','/app/dw/parentSegments/','No\x20personalizations\x20configured','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','events','✔\x20Deleted\x20token\x20\x27','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','keyEventCriteria','Master\x20Table','keys','sampleData','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','👥\x20','Preview:','Create\x20parent\x20segment\x20\x27','`\x20to\x20download\x20the\x20configuration\x20first','getParentSQL','stop','\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','Aborted.','schemaValid','allowed\x20IPs:','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20=\x20','\x20--behavior\x20\x22','Updating\x20parent\x20segment\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Site:\x20','ps:rt:jn:pause','\x20behaviors','List\x20RT\x20journeys','toLocaleString','Get\x20SQL\x20query\x20for\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','Master\x20+\x20Attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Table:\x20','customers','Errors:','Status:','addBehaviors','parent_id','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Schema\x20saved\x20to\x20','10fgvRbx','win32','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','length','Rows:','ps:rt:configuration_versions','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Update\x20a\x20realtime\x20personalization\x20entity','Fetching\x20behavior\x20list...','segment:parent:sql','yellow','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','customerPercent','To\x20view\x20sample\x20data:','schemaError','Create\x20a\x20realtime\x20personalization\x20entity','using\x20the\x20default\x20path:\x20','Options:\x0a'];a32_0x1c50=function(){return _0x32ea29;};return a32_0x1c50();}export class PSPzListCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x3dc);[a32_0x5e657a(0x1ef)]='List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment';async['execute'](_0x55398a){const _0x14db55=a32_0x5e657a,{options:_0x573478,args:_0x475d2a,tdx:_0x47a8df}=_0x55398a,_0x23708a=_0x475d2a[0x0]||_0x573478[_0x14db55(0x248)];if(!_0x23708a)return showParentSegmentNotSetError(_0x14db55(0x1dd)+_0x14db55(0x2d5)),0x1;const _0x5d606d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x23708a+'\x27...',()=>_0x47a8df[_0x14db55(0x1e7)]['resolveParentId'](_0x23708a),{'verbose':_0x573478['verbose']}),_0x4aecf6=_0x5d606d['data'],_0x27ec80=await withSpinner('Listing\x20personalizations\x20for\x20\x27'+_0x23708a+'\x27...',()=>_0x47a8df[_0x14db55(0x24d)][_0x14db55(0x3cd)](_0x4aecf6),{'verbose':_0x573478[_0x14db55(0x374)]}),_0x4719a5=_0x27ec80[_0x14db55(0x1f1)];console[_0x14db55(0x341)](_0x14db55(0x2a2)+_0x4719a5[_0x14db55(0x235)]+'\x20personalization'+(_0x4719a5[_0x14db55(0x235)]!==0x1?'s':''));if(_0x573478['format']===_0x14db55(0x2fe)||_0x573478[_0x14db55(0x308)]===_0x14db55(0x309))await handleSDKOutput(_0x4719a5,_0x573478);else{if(_0x4719a5[_0x14db55(0x235)]===0x0)console[_0x14db55(0x2e6)](_0x14db55(0x206));else for(const _0x9302e0 of _0x4719a5){console[_0x14db55(0x2e6)](a32_0x7af4a1[_0x14db55(0x388)](_0x9302e0['name'])+'\x20'+a32_0x7af4a1[_0x14db55(0x1eb)]('(id:\x20'+_0x9302e0['id']+')'));_0x9302e0['description']&&console[_0x14db55(0x2e6)]('\x20\x20'+a32_0x7af4a1['dim'](_0x9302e0['description']));const _0x155da2=_0x9302e0['sections']?.[_0x14db55(0x235)]||0x0;console[_0x14db55(0x2e6)]('\x20\x20'+a32_0x7af4a1[_0x14db55(0x302)](_0x14db55(0x25e))+'\x20'+_0x155da2);if(_0x9302e0[_0x14db55(0x37a)]&&_0x9302e0[_0x14db55(0x37a)]['length']>0x0)for(const _0x2b8451 of _0x9302e0['sections']){console[_0x14db55(0x2e6)](_0x14db55(0x1e4)+_0x2b8451[_0x14db55(0x2af)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x288);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x3ce);async[a32_0x5e657a(0x30b)](_0x1badc5){const _0x50944a=a32_0x5e657a,{options:_0x1799a7,args:_0x213338,tdx:_0x4a824d}=_0x1badc5,_0x5c9115=_0x213338[0x0];if(!_0x5c9115)return console[_0x50944a(0x341)](_0x50944a(0x3b3)),console['error'](_0x50944a(0x251)),0x1;const _0x2c9c47=await withSpinner(_0x50944a(0x25f)+_0x5c9115+'\x27...',()=>_0x4a824d[_0x50944a(0x24d)]['getPersonalization'](_0x5c9115),{'verbose':_0x1799a7[_0x50944a(0x374)]}),_0x5cc1d0=_0x2c9c47['data'];console['error'](_0x50944a(0x33b)+_0x5cc1d0[_0x50944a(0x2af)]+'\x27');if(_0x1799a7[_0x50944a(0x308)]===_0x50944a(0x2fe)||_0x1799a7[_0x50944a(0x308)]==='jsonl')await handleSDKOutput([_0x5cc1d0],_0x1799a7);else{console['log'](a32_0x7af4a1[_0x50944a(0x388)](_0x5cc1d0[_0x50944a(0x2af)])+'\x20'+a32_0x7af4a1[_0x50944a(0x1eb)]('(id:\x20'+_0x5cc1d0['id']+')'));_0x5cc1d0['description']&&console[_0x50944a(0x2e6)]('\x20\x20'+a32_0x7af4a1[_0x50944a(0x1eb)](_0x5cc1d0[_0x50944a(0x1ef)]));_0x5cc1d0[_0x50944a(0x1d8)]&&console[_0x50944a(0x2e6)]('\x20\x20'+a32_0x7af4a1['cyan'](_0x50944a(0x2b6))+'\x20'+_0x5cc1d0[_0x50944a(0x1d8)]);console[_0x50944a(0x2e6)]('\x20\x20'+a32_0x7af4a1[_0x50944a(0x302)](_0x50944a(0x315))+'\x20'+_0x5cc1d0[_0x50944a(0x263)]),console['log']('\x20\x20'+a32_0x7af4a1['cyan']('updated:')+'\x20'+_0x5cc1d0[_0x50944a(0x2f2)]);const _0x35f6d6=_0x5cc1d0['sections']?.[_0x50944a(0x235)]||0x0;console[_0x50944a(0x2e6)]('\x20\x20'+a32_0x7af4a1[_0x50944a(0x302)](_0x50944a(0x25e))+'\x20'+_0x35f6d6);if(_0x5cc1d0[_0x50944a(0x37a)]&&_0x5cc1d0['sections'][_0x50944a(0x235)]>0x0)for(const _0x413e30 of _0x5cc1d0['sections']){console[_0x50944a(0x2e6)](_0x50944a(0x1e1)+a32_0x7af4a1[_0x50944a(0x388)](_0x413e30[_0x50944a(0x2af)])+'\x20'+a32_0x7af4a1[_0x50944a(0x1eb)](_0x50944a(0x2eb)+_0x413e30['id']+')')),_0x413e30[_0x50944a(0x313)]&&(console[_0x50944a(0x2e6)](_0x50944a(0x291)+a32_0x7af4a1['cyan'](_0x50944a(0x2da))+'\x20'+_0x413e30[_0x50944a(0x313)]['name']),_0x413e30[_0x50944a(0x313)][_0x50944a(0x20b)]?.[_0x50944a(0x2f3)]&&console['log'](_0x50944a(0x3a9)+a32_0x7af4a1[_0x50944a(0x302)](_0x50944a(0x1de))+'\x20'+_0x413e30[_0x50944a(0x313)]['keyEventCriteria']['keyEventId'])),_0x413e30[_0x50944a(0x2bb)]&&console['log'](_0x50944a(0x291)+a32_0x7af4a1['cyan'](_0x50944a(0x2d1))+'\x20'+JSON[_0x50944a(0x25d)](_0x413e30[_0x50944a(0x2bb)])),_0x413e30[_0x50944a(0x3c7)]&&console[_0x50944a(0x2e6)](_0x50944a(0x291)+a32_0x7af4a1['cyan']('includeSensitive:')+'\x20true');}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a32_0x5e657a(0x2af)]='ps:pz:delete';[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x3a8);async[a32_0x5e657a(0x30b)](_0x537044){const _0x5b9e40=a32_0x5e657a,{options:_0x1c7705,args:_0x955379,tdx:_0x4da72d}=_0x537044,_0x1612d8=_0x955379[0x0];if(!_0x1612d8)return console[_0x5b9e40(0x341)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x5b9e40(0x341)](_0x5b9e40(0x238)),0x1;return await withSpinner(_0x5b9e40(0x35b)+_0x1612d8+_0x5b9e40(0x31b),()=>_0x4da72d[_0x5b9e40(0x24d)]['deletePersonalization'](_0x1612d8),{'verbose':_0x1c7705[_0x5b9e40(0x374)]}),console[_0x5b9e40(0x341)](_0x5b9e40(0x326)+_0x1612d8+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']=a32_0x5e657a(0x296);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x242);async[a32_0x5e657a(0x30b)](_0x27553e){const _0x24717c=a32_0x5e657a,{options:_0x2da59d,tdx:_0x10b89f}=_0x27553e,_0xb34395=_0x2da59d;let _0x2e48ec;if(_0xb34395[_0x24717c(0x24a)]){_0x2e48ec=await loadJSON(_0xb34395[_0x24717c(0x24a)],!![]);if(!_0x2e48ec[_0x24717c(0x33f)]?.[_0x24717c(0x3b2)])return console[_0x24717c(0x341)]('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x24717c(0x341)](_0x24717c(0x393)),console[_0x24717c(0x341)]('\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}'),0x1;}else{if(!_0xb34395['name'])return console[_0x24717c(0x341)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x24717c(0x341)](_0x24717c(0x371)),console['error'](_0x24717c(0x228)),0x1;if(_0xb34395['description']===undefined)return console[_0x24717c(0x341)](_0x24717c(0x21a)),console[_0x24717c(0x341)](_0x24717c(0x371)),console[_0x24717c(0x341)](_0x24717c(0x228)),0x1;if(_0xb34395[_0x24717c(0x3a7)]===undefined)return console[_0x24717c(0x341)](_0x24717c(0x26d)),console['error'](_0x24717c(0x25b)),0x1;let _0xbc69bc=_0xb34395['audienceId'];if(!_0xbc69bc&&_0x2da59d[_0x24717c(0x248)]){const _0xc185a9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2da59d['parentSegment']+_0x24717c(0x31b),()=>_0x10b89f['segment']['resolveParentId'](_0x2da59d[_0x24717c(0x248)]),{'verbose':_0x2da59d[_0x24717c(0x374)]});_0xbc69bc=_0xc185a9[_0x24717c(0x1f1)];}let _0x8be082;_0xb34395[_0x24717c(0x37a)]&&(_0x8be082=await loadJSON(_0xb34395[_0x24717c(0x37a)],![]));const _0xa7ef8d=_0xb34395[_0x24717c(0x3a7)]===_0x24717c(0x380)?null:{'id':_0xb34395[_0x24717c(0x3a7)],'type':_0x24717c(0x32f)};_0x2e48ec={'attributes':{'name':_0xb34395[_0x24717c(0x2af)],'description':_0xb34395[_0x24717c(0x1ef)]||null,..._0xbc69bc!==undefined&&{'audienceId':_0xbc69bc},..._0x8be082!==undefined&&{'sections':_0x8be082}},'relationships':{'parentFolder':{'data':_0xa7ef8d}}};}const _0x49a482=await withSpinner('Creating\x20personalization\x20\x27'+(_0x2e48ec['attributes']?.['name']??'')+_0x24717c(0x31b),()=>_0x10b89f[_0x24717c(0x24d)][_0x24717c(0x36b)](_0x2e48ec),{'verbose':_0x2da59d[_0x24717c(0x374)]}),_0x13a8be=_0x49a482[_0x24717c(0x1f1)];return console[_0x24717c(0x341)](_0x24717c(0x3d2)+_0x13a8be['name']+_0x24717c(0x3a5)+_0x13a8be['id']),await handleSDKOutput([_0x13a8be],_0x2da59d),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x3c1);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x23a);async[a32_0x5e657a(0x30b)](_0x4a60b3){const _0x17af73=a32_0x5e657a,{options:_0x376864,args:_0x237e70}=_0x4a60b3,_0x476211=_0x376864,_0x42ca3=_0x237e70[0x0];if(!_0x42ca3)return console[_0x17af73(0x341)](_0x17af73(0x3b3)),console[_0x17af73(0x341)](_0x17af73(0x39e)),console[_0x17af73(0x341)](_0x17af73(0x2ac)),0x1;let _0x3942e0;if(_0x476211[_0x17af73(0x24a)])_0x3942e0=await loadJSON(_0x476211['file'],!![]);else{if(!_0x476211[_0x17af73(0x2af)])return console['error'](_0x17af73(0x3ba)),console[_0x17af73(0x341)](_0x17af73(0x39e)),0x1;if(_0x476211['description']===undefined)return console[_0x17af73(0x341)](_0x17af73(0x21a)),console[_0x17af73(0x341)](_0x17af73(0x39e)),0x1;let _0x5601c0;_0x476211[_0x17af73(0x37a)]&&(_0x5601c0=await loadJSON(_0x476211[_0x17af73(0x37a)],![])),_0x3942e0={'attributes':{'name':_0x476211[_0x17af73(0x2af)],'description':_0x476211['description']||null,..._0x5601c0!==undefined&&{'sections':_0x5601c0}}};}const {tdx:_0x4bc8cf}=_0x4a60b3,_0x2bcdfb=await withSpinner('Patching\x20personalization\x20\x27'+_0x42ca3+_0x17af73(0x31b),()=>_0x4bc8cf[_0x17af73(0x24d)][_0x17af73(0x39c)](_0x42ca3,_0x3942e0),{'verbose':_0x376864[_0x17af73(0x374)]}),_0x20d297=_0x2bcdfb[_0x17af73(0x1f1)];return console['error'](_0x17af73(0x2df)+_0x20d297[_0x17af73(0x2af)]+'\x27\x20(id:\x20'+_0x20d297['id']+')'),await handleSDKOutput([_0x20d297],_0x376864),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a32_0x5e657a(0x2af)]=a32_0x5e657a(0x31c);[a32_0x5e657a(0x1ef)]=a32_0x5e657a(0x2d9);async[a32_0x5e657a(0x30b)](_0x1d71fc){const _0x2c4345=a32_0x5e657a,{options:_0x517619,args:_0x178f8e}=_0x1d71fc,_0x3c83df=_0x178f8e[0x0]||_0x517619[_0x2c4345(0x248)];if(!_0x3c83df)return showParentSegmentNotSetError(_0x2c4345(0x1d1)+_0x2c4345(0x3c5)),0x1;const _0x466a4c=resolveYamlFile(_0x3c83df);if(!existsSync(_0x466a4c))return showFileNotFoundError(_0x466a4c,_0x3c83df),0x1;let _0x161905;try{_0x161905=readFileSync(_0x466a4c,'utf-8');}catch(_0x267c7a){const _0x123291=_0x267c7a instanceof Error?_0x267c7a[_0x2c4345(0x271)]:String(_0x267c7a);return console['error'](_0x2c4345(0x1e2)+_0x123291),0x1;}let _0x4ed35c;try{_0x4ed35c=parseDef(_0x161905);}catch(_0x231e1f){const _0xdc2a6f=_0x231e1f instanceof Error?_0x231e1f[_0x2c4345(0x271)]:String(_0x231e1f);return console['error'](a32_0x7af4a1[_0x2c4345(0x334)](_0x2c4345(0x3ad)+_0xdc2a6f)),0x1;}if(_0x4ed35c[_0x2c4345(0x3a3)]&&_0x4ed35c[_0x2c4345(0x3a3)][_0x2c4345(0x235)]>0x0)return console[_0x2c4345(0x341)](a32_0x7af4a1[_0x2c4345(0x23d)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0x466a4c)),console['error'](a32_0x7af4a1['dim']('\x20\x20\x20'+_0x4ed35c[_0x2c4345(0x3a3)]['length']+_0x2c4345(0x2ca))),0x1;!_0x4ed35c[_0x2c4345(0x30f)]&&(_0x4ed35c[_0x2c4345(0x30f)]={'events':[{'name':_0x2c4345(0x28b),'source_table':_0x2c4345(0x33e)}],'attributes':[{'name':_0x2c4345(0x277),'type':_0x2c4345(0x3c6)}],'id_stitching':{'primary_key':_0x4ed35c[_0x2c4345(0x2ae)][_0x2c4345(0x1c7)]===_0x2c4345(0x22a)?_0x2c4345(0x372):_0x2c4345(0x246)}});_0x4ed35c[_0x2c4345(0x3a3)]=[{'name':_0x2c4345(0x2bc),'description':_0x2c4345(0x250),'trigger_event':_0x2c4345(0x28b),'sections':[{'name':_0x2c4345(0x314),'criteria':'true','attributes':[_0x2c4345(0x277)]}]}];const _0x2cbb18=serializeDef(_0x4ed35c);return writeFileSync(_0x466a4c,_0x2cbb18,'utf-8'),console['error'](a32_0x7af4a1['green']('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a32_0x7af4a1[_0x2c4345(0x302)](_0x466a4c)),(!_0x4ed35c[_0x2c4345(0x30f)]||_0x161905[_0x2c4345(0x318)]('realtime:')===-0x1)&&console[_0x2c4345(0x341)](a32_0x7af4a1[_0x2c4345(0x262)]('✔')+_0x2c4345(0x2ff)),console['error']('\x0a'+a32_0x7af4a1[_0x2c4345(0x1eb)](_0x2c4345(0x259))),console[_0x2c4345(0x341)]('\x20\x201.\x20Edit\x20'+_0x466a4c+_0x2c4345(0x1e9)),console['error']('\x20\x202.\x20Run\x20'+a32_0x7af4a1[_0x2c4345(0x1eb)](_0x2c4345(0x260)+_0x3c83df)+_0x2c4345(0x3af)),0x0;}}
1
+ const a32_0x80eef0=a32_0x46b9;(function(_0x3f6127,_0x43ebf4){const _0x3be272=a32_0x46b9,_0x1eeee0=_0x3f6127();while(!![]){try{const _0x326d5b=parseInt(_0x3be272(0x288))/0x1*(parseInt(_0x3be272(0x162))/0x2)+-parseInt(_0x3be272(0x1b0))/0x3*(parseInt(_0x3be272(0xfd))/0x4)+-parseInt(_0x3be272(0x292))/0x5*(-parseInt(_0x3be272(0x1b4))/0x6)+-parseInt(_0x3be272(0x137))/0x7*(parseInt(_0x3be272(0xd2))/0x8)+-parseInt(_0x3be272(0xda))/0x9*(-parseInt(_0x3be272(0xb8))/0xa)+-parseInt(_0x3be272(0x203))/0xb+parseInt(_0x3be272(0x235))/0xc;if(_0x326d5b===_0x43ebf4)break;else _0x1eeee0['push'](_0x1eeee0['shift']());}catch(_0x5e6b65){_0x1eeee0['push'](_0x1eeee0['shift']());}}}(a32_0x5bc9,0x3d15b));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a32_0x52a707 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';function a32_0x46b9(_0x1e3583,_0xc55e28){_0x1e3583=_0x1e3583-0x98;const _0x5bc95e=a32_0x5bc9();let _0x46b994=_0x5bc95e[_0x1e3583];return _0x46b994;}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 a32_0x2144bc from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';function a32_0x5bc9(){const _0x3ef91b=['Listing\x20personalizations\x20for\x20\x27','Aborted.','ps:pz:service:token:delete','label','collectSchema','/sessions/','✔\x20Updated\x20parent\x20segment\x20\x27','ignore','database','unref','td_client_id','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','\x0a\x20\x20]\x0a}\x0a','toFixed','query','5002811FiimLd','state','No\x20parent\x20segments\x20match\x20pattern:\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','⚡\x20Enabled','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','folderId','Validate:','{\x0a\x20\x20\x22database\x22:\x20\x22','\x20is\x20already\x20up\x20to\x20date','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','some','value','ps:pz:service:show','runParent','customerPercent','jobId','message','\x20--behavior\x20\x22<name>\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','rowCount','sampleData','✘\x20Failed\x20to\x20rename\x20directory:\x20','Source:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','toLowerCase','columns','ps:rt:configuration_versions','web','audienceId:','Error\x20parsing\x20YAML:\x20','\x27\x20and\x20run\x20workflow?','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Attributes:','token:','processedRows','/{name}.yml\x0a','created:','public','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Default','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','entryCriteria','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','push','13637268KArpyH','string','schemaValid','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','Creating','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Listing\x20fields\x20for\x20\x27','attributesFile','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','displayBehaviorsStats','\x20behaviors','yes','personalizationServices','\x20(paused)','Preview:','enriched','Site:\x20','green','getBehaviorNames','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','split','Create\x20a\x20realtime\x20personalization\x20entity','\x20personalization','Pausing\x20activations\x20for\x20RT\x20journey\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','idStitching','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x27\x20with\x20ID:\x20','matchedCount','Pause\x20activations\x20in\x20an\x20RT\x20journey','\x27\x20is\x20already\x20up\x20to\x20date','\x27\x20for\x20service\x20\x27','sections','To\x20view\x20sample\x20data:','format','stringify','allowedIps','column','trim','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','parent_segment','updatedAt','sourceTableValid','personalization','displayRealtimeInfo','ps:pz:service:update','Name:\x20','platform','scheduleOption','text','verbose','\x0aError:','segment:parent:run','\x0a\x20\x20\x20\x20}','displayValidateResults','Get\x20SQL\x20query\x20for\x20parent\x20segment','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','\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','column_type','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Next\x20steps:','attributes','Options\x20(one\x20required):\x0a','last_page_viewed','segment:parent:list','Fetching\x20personalization\x20service\x20\x27','identifier','Error:\x20File\x20not\x20found:\x20','null','/\x20directory.\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','updateParent','parentSegment','stageCount','👥\x20','output','segment','\x20=\x20','\x20[Job\x20ID:\x20','displayAttributesStats','1AWHHtY','Available\x20behaviors:','localeCompare','events','includeSensitive:','launched','Errors:','yellow','enabled','\x20\x20Tables:\x201\x20customers\x20+\x20','5755OIvpNg','\x20field','Error:\x20Personalization\x20ID\x20is\x20required','No\x20parent\x20segments\x20found','formatSchemaJson','Options:','\x20Configuration\x20is\x20valid','\x20RT\x20journey','red','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','personalization_services','✔\x20Found\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','joinKey','dim','page_view','validateParentYaml','Join\x20on:','ps:pz:delete','population','SELECT\x20*\x20FROM\x20(\x0a','Updated','listPersonalizations','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','tdx\x20ps\x20preview\x20','Parent\x20segment:\x20','workflowSessionId','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20true','✔\x20Created\x20token\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','segment:parent:preview','\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','eventKind','reduce','\x20\x20\x20\x20\x20\x20\x20\x20','\x0a✔\x20Workflow\x20started','segment:parent:view','Error:','primaryKey','type','ps:pz:show','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Show\x20parent\x20segment\x20details','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','190IobANg','segment:parent:desc','/\x20→\x20','repeat','\x20service(s)\x20configured','no\x20tokens\x20configured','Error:\x20Service\x20ID\x20is\x20required','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Attempt:','allowed\x20IPs:','resolveParentId','✔\x20Deleted\x20token\x20\x27','darwin','data','Deleting\x20token\x20\x27','Coverage:','audienceId','replace','Table:\x20','/\x20directories\x20exist.','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x0a⚠️\x20\x20Migrating:\x20','\x27...','Deleting\x20personalization\x20\x27','\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','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','173384plUmrN','\x20\x20Database:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','SQL\x20query:\x0a','json','Show\x20parent\x20segment\x20schema\x20(column\x20types)','keyEventId:','\x20stage','1629mlpmSk','patch','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','any','totalEvents','Show\x20personalization\x20service\x20details','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','keyEventId','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','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','tdx\x20ps\x20push\x20','workflowAttemptId','Listing\x20RT-enabled\x20parent\x20segments...','workflowId','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Fetching\x20behavior\x20list...','Options:\x0a','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Creating\x20personalization\x20service\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','attribute','\x20parent\x20segment\x20\x27','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Listing\x20parent\x20segments\x20matching\x20\x27','in\x20','Fetching\x20SQL\x20for\x20\x27','createdAt','Error:\x20Token\x20ID\x20is\x20required','status:\x20','open','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','test','Attributes','createPersonalization','11476jlhCgQ','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x20to\x20push\x20the\x20configuration','bold','\x20service','\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}','<database>.<table>','\x20Context\x20set:\x20','use','/app/dw/parentSegments/','Updating\x20parent\x20segment\x20\x27','Customers:','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x0aNew\x20parent\x20segment\x20\x27','List\x20available\x20fields\x20for\x20segmentation','No\x20personalizations\x20configured','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','(id:\x20','start','\x20Opening\x20','\x20kill','behavior_','getOutputDatabaseName','log','sort','limit','apply','Audience\x20ID:','pullParentYaml','join','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','ps:rt:jn:pause','\x22\x20}','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','addBehaviorsFile','win32','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Error\x20reading\x20file:\x20','\x27\x20(id:\x20','parent_segments','\x20--attribute\x20\x22','realtime:','segment:parent:show','Getting\x20personalization\x20\x27','Events:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Attribute:','timezone','ps:pz:service:delete','\x20\x20Note:\x20','valid','displayMasterInfo','Available\x20attributes:','\x20configured','updated:','execute','126gZNEtK','Session:','Master:','Error:\x20--name\x20is\x20required','customerGroup','Columns:','\x20total','displayPreviewResults','Updating\x20personalization\x20service\x20\x27','\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','elapsedTimeMillis','\x20rows\x20','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','displayPreviewHints','tokens','Create\x20parent\x20segment\x20\x27','Deleting\x20personalization\x20service\x20\x27','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','.yml','eventKind:\x20','coveragePercent','parentFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Validating\x20RT\x20configuration...','allValid','length','utf-8','Validating\x20configuration...','master','audienceId:\x20','ps:pz:patch','error','Show\x20a\x20specific\x20realtime\x20personalization','public:','segment:parent:sql','behavior','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','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','stop','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','28642FeEYGN','file','RT\x20Journey\x20ID:\x20','column_name','paused','jsonl','endsWith','segment:parent:create','createParent','customers','Creating\x20personalization\x20\x27','getParentSQL','scheduleType','Apply\x20changes\x20to\x20\x27','listJourneys','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','ps:rt:jn:list','/\x20and\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','single','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','✔\x20No\x20changes\x20-\x20\x27','includeSensitive','\x20--behavior\x20\x22','sourceTableError','getParentFull','site','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','Fetching\x20current\x20configuration\x20for\x20\x27','Error:\x20Service\x20name\x20is\x20required','RT\x202.0:','To\x20cancel:','Database:\x20','errors','stats','\x20\x20\x20\x20\x20\x20','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','patchPersonalization','✔\x20Created\x20personalization\x20service\x20\x27','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','session','Resolving\x20parent\x20segment\x20\x27','foreignKey','Update\x20a\x20realtime\x20personalization\x20entity','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','information_schema','\x20\x20Columns:\x20','\x20RT-enabled\x20parent\x20segment','\x20--enriched','displaySampleData','ps:pz:service:create','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','✔\x20Found\x20personalization\x20\x27','entryCriteria:','FINISHED','Error:\x20--attribute\x20requires\x20a\x20name\x0a','\x5c$&','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','parent_id','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Delete\x20a\x20personalization\x20service','name','Join:','filter','user_id','Listing\x20parent\x20segments...','Fetching\x20customers\x20schema...','status','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','keyEventCriteria','ps:rt:validate','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','69fvuFtN','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Listing\x20personalization\x20services\x20for\x20\x27','addAttributesFile','36USBohq','\x0a\x20\x20\x20\x20]','\x0aNo\x20sample\x20data\x20available','xdg-open','✔\x20Deleted\x20personalization\x20\x27','Patching\x20personalization\x20\x27','.yaml','all','segment:parent:push','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','toLocaleString','displaySummary','payload','Analyzing\x20changes...','\x20+\x20[','-1d','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','varchar','realtime','displayColumns','%)\x20','get','customerGroupFile','YAML\x20file:\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','.customers)','Behaviors','✔\x20Renamed\x20directory\x20to\x20','previewParentYaml','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','List\x20RT\x20journeys','stitchingKeys','behaviors','\x20\x20\x20\x20','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','map','sections:','\x20\x201.\x20Edit\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Fetching\x20parent\x20segment\x20\x27','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','interval','schemaError','\x20\x20No\x20sample\x20data\x20available','SELECT\x20*\x20FROM\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','deleteToken','list','using\x20the\x20default\x20path:\x20','pauseJourney','table','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','description','Error:\x20Token\x20\x27','Error:\x20Token\x20name\x20is\x20required','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x20\x20\x20\x20-\x20','pushParentYaml','Updating','deletePersonalization','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\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'];a32_0x5bc9=function(){return _0x3ef91b;};return a32_0x5bc9();}import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a32_0x80eef0(0x125),LEGACY_PARENT_SEGMENT_DIR=a32_0x80eef0(0x25d);function openBrowser(_0x1229c2){const _0xabed57=a32_0x80eef0,_0x1cd4c0=process[_0xabed57(0x264)],_0x4fb70d=_0x1cd4c0===_0xabed57(0xc4)?_0xabed57(0xf8):_0x1cd4c0===_0xabed57(0x121)?_0xabed57(0x110):_0xabed57(0x1b7);spawn(_0x4fb70d,[_0x1229c2],{'detached':!![],'stdio':_0xabed57(0x1fa)})[_0xabed57(0x1fc)]();}function migrateLegacyDirectory(){const _0x3705fe=a32_0x80eef0;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x4a7f6f=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x4a7f6f['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x3705fe(0x159)](a32_0x2144bc[_0x3705fe(0x28f)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x3705fe(0x174)+PARENT_SEGMENT_DIR+_0x3705fe(0xcb))),console[_0x3705fe(0x159)](a32_0x2144bc[_0x3705fe(0x99)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x3705fe(0x27d))),![];console[_0x3705fe(0x159)](a32_0x2144bc['yellow'](_0x3705fe(0xcd)+LEGACY_PARENT_SEGMENT_DIR+_0x3705fe(0xba)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x3705fe(0x159)](a32_0x2144bc['green'](_0x3705fe(0x1cf)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1be7f9){const _0xb22ab2=_0x1be7f9 instanceof Error?_0x1be7f9[_0x3705fe(0x214)]:String(_0x1be7f9);return console['error'](a32_0x2144bc[_0x3705fe(0x29a)](_0x3705fe(0x21c)+_0xb22ab2+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x42dc43){return migrateLegacyDirectory(),super['run'](_0x42dc43);}}function resolveYamlFile(_0x19904a){const _0x5de266=a32_0x80eef0;if(_0x19904a[_0x5de266(0x168)](_0x5de266(0x14c))||_0x19904a[_0x5de266(0x168)](_0x5de266(0x1ba)))return _0x19904a;return a32_0x52a707[_0x5de266(0x11b)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x19904a)+_0x5de266(0x14c));}function formatProgressMessage(_0x512ab7){const _0x2e7478=a32_0x80eef0,_0x32f798=_0x512ab7['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x32f798){const [,_0x1eb205,_0xfa7024,_0x40a1f1='']=_0x32f798;return a32_0x2144bc['dim'](_0x1eb205+':')+'\x20'+_0xfa7024+a32_0x2144bc[_0x2e7478(0x99)](_0x40a1f1);}return a32_0x2144bc[_0x2e7478(0x99)](_0x512ab7);}function showFileNotFoundError(_0x1d8188,_0x16ff6b){const _0xba4ad=a32_0x80eef0;console[_0xba4ad(0x159)](a32_0x2144bc[_0xba4ad(0x29a)](_0xba4ad(0x27b)+_0x1d8188+'\x0a')),console[_0xba4ad(0x159)](a32_0x2144bc[_0xba4ad(0x26d)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x16ff6b+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x310b53){const _0x39343d=a32_0x80eef0;if(!_0x310b53[_0x39343d(0x1c6)])return;const _0x5bf1a4=_0x310b53[_0x39343d(0x1c6)],_0x532ffb=_0x5bf1a4[_0x39343d(0x290)]?a32_0x2144bc['green'](_0x39343d(0x207)):a32_0x2144bc['yellow']('⚡\x20Not\x20enabled');console[_0x39343d(0x159)]('\x0a'+a32_0x2144bc[_0x39343d(0x99)](_0x39343d(0x183))+'\x20'+_0x532ffb);if(_0x5bf1a4[_0x39343d(0x28b)]&&_0x5bf1a4[_0x39343d(0x28b)][_0x39343d(0x153)]>0x0){console[_0x39343d(0x159)]('\x20\x20'+a32_0x2144bc[_0x39343d(0x99)]('Events:')+'\x20'+_0x5bf1a4['events'][_0x39343d(0x153)]+'\x20configured');for(const _0x3c1885 of _0x5bf1a4['events']){const _0x5cc19a=_0x3c1885[_0x39343d(0x25f)]===![]?a32_0x2144bc[_0x39343d(0x29a)]('✘'):a32_0x2144bc[_0x39343d(0x246)]('✔');console[_0x39343d(0x159)]('\x20\x20\x20\x20'+_0x5cc19a+'\x20'+_0x3c1885['name']),_0x3c1885[_0x39343d(0x17d)]&&console[_0x39343d(0x159)]('\x20\x20\x20\x20\x20\x20'+a32_0x2144bc[_0x39343d(0x29a)](_0x3c1885[_0x39343d(0x17d)]));}}if(_0x5bf1a4[_0x39343d(0x275)]&&_0x5bf1a4['attributes'][_0x39343d(0x153)]>0x0){console[_0x39343d(0x159)]('\x20\x20'+a32_0x2144bc[_0x39343d(0x99)](_0x39343d(0x227))+'\x20'+_0x5bf1a4[_0x39343d(0x275)]['length']+_0x39343d(0x134));for(const _0x5b154b of _0x5bf1a4[_0x39343d(0x275)]){const _0x453a61=_0x5b154b[_0x39343d(0x131)]?a32_0x2144bc[_0x39343d(0x246)]('✔'):a32_0x2144bc[_0x39343d(0x29a)]('✘');console['error'](_0x39343d(0x1d5)+_0x453a61+'\x20'+_0x5b154b['name']+'\x20'+a32_0x2144bc[_0x39343d(0x99)]('('+_0x5b154b[_0x39343d(0xb3)]+')'));}}if(_0x5bf1a4['idStitching']){const _0x2d15c0=_0x5bf1a4[_0x39343d(0x24e)]['stitchingKeys']?.[_0x39343d(0x153)]?_0x39343d(0x1c2)+_0x5bf1a4['idStitching'][_0x39343d(0x1d3)][_0x39343d(0x11b)](',\x20')+']':'';console[_0x39343d(0x159)]('\x20\x20'+a32_0x2144bc['dim']('ID\x20Stitching:')+'\x20'+_0x5bf1a4[_0x39343d(0x24e)][_0x39343d(0xb2)]+_0x2d15c0);}if(_0x5bf1a4[_0x39343d(0x241)]&&_0x5bf1a4[_0x39343d(0x241)][_0x39343d(0x153)]>0x0){console[_0x39343d(0x159)]('\x20\x20'+a32_0x2144bc[_0x39343d(0x99)]('Personalization:')+'\x20'+_0x5bf1a4[_0x39343d(0x241)][_0x39343d(0x153)]+_0x39343d(0x101)+(_0x5bf1a4[_0x39343d(0x241)][_0x39343d(0x153)]!==0x1?'s':''));for(const _0x3fd01d of _0x5bf1a4[_0x39343d(0x241)]){console[_0x39343d(0x159)]('\x20\x20\x20\x20-\x20'+_0x3fd01d['name']);}}}function showParentSegmentNotSetError(_0x462ecb){const _0x3d64ff=a32_0x80eef0;console[_0x3d64ff(0x159)](a32_0x2144bc[_0x3d64ff(0x28f)](_0x3d64ff(0x27e))),console[_0x3d64ff(0x159)](_0x462ecb);}export class ParentSegmentListCommand extends BaseCommand{['name']=a32_0x80eef0(0x278);[a32_0x80eef0(0x1e9)]='List\x20parent\x20segments';async[a32_0x80eef0(0x136)](_0x57c066){const _0x35b912=a32_0x80eef0,{options:_0x19a037,args:_0x397020,tdx:_0x446a9d}=_0x57c066,_0x1c91c8=_0x397020[0x0];_0x19a037[_0x35b912(0x267)]&&(console[_0x35b912(0x159)](_0x35b912(0x245)+_0x19a037[_0x35b912(0x17f)]),_0x1c91c8&&console[_0x35b912(0x159)]('Pattern:\x20'+_0x1c91c8));const _0x2fa62d=await withSpinner(_0x1c91c8?_0x35b912(0xf2)+_0x1c91c8+_0x35b912(0xce):_0x35b912(0x1a8),()=>_0x446a9d[_0x35b912(0x284)]['listParents'](),{'verbose':_0x19a037[_0x35b912(0x267)]});let _0x2ecea1=_0x2fa62d[_0x35b912(0xc5)];if(_0x1c91c8){const _0x40f17f=_0x1c91c8[_0x35b912(0xc9)](/[.+^${}()|[\]\\]/g,_0x35b912(0x19e))[_0x35b912(0xc9)](/\*/g,'.*')[_0x35b912(0xc9)](/\?/g,'.'),_0x401c1e=new RegExp('^'+_0x40f17f+'$','i');_0x2ecea1=_0x2ecea1[_0x35b912(0x1a6)](_0x4f2c77=>_0x401c1e[_0x35b912(0xfa)](_0x4f2c77['attributes'][_0x35b912(0x1a4)]));}_0x2ecea1[_0x35b912(0x116)]((_0x19a870,_0x4a43d2)=>_0x19a870[_0x35b912(0x275)]['name'][_0x35b912(0x28a)](_0x4a43d2['attributes'][_0x35b912(0x1a4)])),console[_0x35b912(0x159)](_0x35b912(0x29d)+_0x2ecea1['length']+_0x35b912(0x140)+(_0x2ecea1[_0x35b912(0x153)]!==0x1?'s':''));const _0x32b02e=_0x26aa8b=>{const _0x42cff0=_0x35b912;return getConsoleNextUrl(_0x19a037[_0x42cff0(0x17f)],_0x42cff0(0x106)+_0x26aa8b);};if(_0x19a037[_0x35b912(0x257)]===_0x35b912(0xd6)||_0x19a037[_0x35b912(0x257)]===_0x35b912(0x167)){const _0x5c43bd=_0x2ecea1[_0x35b912(0x1d7)](_0x2a768c=>({..._0x2a768c,'url':_0x32b02e(_0x2a768c['id'])}));await handleSDKOutput(_0x5c43bd,_0x19a037);}else{if(_0x2ecea1['length']===0x0)_0x1c91c8?console[_0x35b912(0x115)](_0x35b912(0x205)+_0x1c91c8):console[_0x35b912(0x115)](_0x35b912(0x295));else for(const _0x75be42 of _0x2ecea1){const _0x4d203e=_0x75be42[_0x35b912(0x275)][_0x35b912(0x9e)]?a32_0x2144bc['dim']('\x20('+formatRows(_0x75be42[_0x35b912(0x275)][_0x35b912(0x9e)])+')'):'',_0x153fd4=hyperlink(_0x75be42[_0x35b912(0x275)][_0x35b912(0x1a4)],_0x32b02e(_0x75be42['id']));console['log'](_0x35b912(0x282)+_0x153fd4+_0x4d203e);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a32_0x80eef0(0x169);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0xa6);async[a32_0x80eef0(0x136)](_0x1a3ae2){const _0x2e7b41=a32_0x80eef0,{options:_0x3957c2,args:_0x14b7f1,tdx:_0x3a597c}=_0x1a3ae2;console[_0x2e7b41(0x159)](_0x2e7b41(0x12b)+_0x2e7b41(0xec)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3e8a65=_0x3957c2;if(_0x14b7f1[_0x2e7b41(0x153)]===0x0)return console[_0x2e7b41(0x159)](a32_0x2144bc[_0x2e7b41(0x29a)](_0x2e7b41(0xee))),console[_0x2e7b41(0x159)](_0x2e7b41(0x1b1)),0x1;const _0x274602=_0x14b7f1[0x0];if(!_0x3e8a65[_0x2e7b41(0x1fb)]||!_0x3e8a65[_0x2e7b41(0x1e6)])return console[_0x2e7b41(0x159)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x2e7b41(0x159)](_0x2e7b41(0x1b1)),0x1;_0x3e8a65[_0x2e7b41(0x267)]&&(console[_0x2e7b41(0x159)](_0x2e7b41(0x245)+_0x3e8a65[_0x2e7b41(0x17f)]),console[_0x2e7b41(0x159)](_0x2e7b41(0x263)+_0x274602),console[_0x2e7b41(0x159)](_0x2e7b41(0x185)+_0x3e8a65['database']),console[_0x2e7b41(0x159)](_0x2e7b41(0xca)+_0x3e8a65['table']));const _0x4f5b27=await loadJSONFromOptions(_0x3e8a65['attributes'],_0x3e8a65[_0x2e7b41(0x23c)]),_0x4761d8=await loadJSONFromOptions(_0x3e8a65['behaviors'],_0x3e8a65['behaviorsFile']),_0x4a5098=await loadJSONFromOptions(_0x3e8a65[_0x2e7b41(0x13b)],_0x3e8a65[_0x2e7b41(0x1ca)]),_0x24bdb8={'name':_0x274602,'description':_0x3e8a65['description'],'scheduleType':_0x3e8a65[_0x2e7b41(0x16e)],'scheduleOption':_0x3e8a65['scheduleOption'],'timezone':_0x3e8a65[_0x2e7b41(0x12e)],'master':{'parentDatabaseName':_0x3e8a65[_0x2e7b41(0x1fb)],'parentTableName':_0x3e8a65['table']},'attributes':_0x4f5b27,'behaviors':_0x4761d8,'customerGroup':_0x4a5098},_0x294813=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x274602+_0x2e7b41(0xce),()=>_0x3a597c[_0x2e7b41(0x284)][_0x2e7b41(0x16a)](_0x24bdb8),{'verbose':_0x3957c2[_0x2e7b41(0x267)]}),_0x45eddd=_0x294813[_0x2e7b41(0xc5)];return console[_0x2e7b41(0x159)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x45eddd['name']+'\x27\x20with\x20ID:\x20'+_0x45eddd['id']),await handleSDKOutput([_0x45eddd],_0x3957c2),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]='segment:parent:update';[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x208);async[a32_0x80eef0(0x136)](_0x28fcaf){const _0x4e5caa=a32_0x80eef0,{options:_0x174b98,args:_0x584d10,tdx:_0x30826e}=_0x28fcaf;console[_0x4e5caa(0x159)](_0x4e5caa(0x1a2)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x4e5caa(0x1cc));const _0x3db8c1=_0x174b98;if(_0x584d10['length']===0x0)return console[_0x4e5caa(0x159)](a32_0x2144bc[_0x4e5caa(0x29a)](_0x4e5caa(0xee))),console[_0x4e5caa(0x159)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x20c1a1=_0x584d10[0x0];_0x3db8c1[_0x4e5caa(0x267)]&&(console[_0x4e5caa(0x159)](_0x4e5caa(0x245)+_0x3db8c1[_0x4e5caa(0x17f)]),console[_0x4e5caa(0x159)](_0x4e5caa(0xa4)+_0x20c1a1));const _0x3f0131=await withSpinner(_0x4e5caa(0x181)+_0x20c1a1+'\x27...',()=>_0x30826e['segment']['getParentFull'](_0x20c1a1),{'verbose':_0x3db8c1[_0x4e5caa(0x267)]}),_0xda8656=_0x3f0131[_0x4e5caa(0xc5)],_0x153d13=await loadJSONFromOptions(_0x3db8c1['addAttributes'],_0x3db8c1[_0x4e5caa(0x1b3)]),_0x4317b0=await loadJSONFromOptions(_0x3db8c1['addBehaviors'],_0x3db8c1[_0x4e5caa(0x120)]),_0x37deaa={'name':_0xda8656[_0x4e5caa(0x1a4)],'description':_0x3db8c1[_0x4e5caa(0x1e9)]!==undefined?_0x3db8c1[_0x4e5caa(0x1e9)]:_0xda8656[_0x4e5caa(0x1e9)],'scheduleType':_0x3db8c1['scheduleType']!==undefined?_0x3db8c1[_0x4e5caa(0x16e)]:_0xda8656[_0x4e5caa(0x16e)],'scheduleOption':_0x3db8c1['scheduleOption']!==undefined?_0x3db8c1['scheduleOption']:_0xda8656[_0x4e5caa(0x265)],'timezone':_0x3db8c1[_0x4e5caa(0x12e)]!==undefined?_0x3db8c1[_0x4e5caa(0x12e)]:_0xda8656[_0x4e5caa(0x12e)],'master':_0xda8656[_0x4e5caa(0x156)],'attributes':_0x153d13?[..._0xda8656[_0x4e5caa(0x275)]||[],..._0x153d13]:_0xda8656['attributes'],'behaviors':_0x4317b0?[..._0xda8656[_0x4e5caa(0x1d4)]||[],..._0x4317b0]:_0xda8656[_0x4e5caa(0x1d4)],'customerGroup':_0xda8656[_0x4e5caa(0x13b)]},_0x1d4971=await withSpinner(_0x4e5caa(0x107)+_0x20c1a1+_0x4e5caa(0xce),()=>_0x30826e['segment'][_0x4e5caa(0x27f)](_0x20c1a1,_0x37deaa),{'verbose':_0x3db8c1[_0x4e5caa(0x267)]}),_0xe15d38=_0x1d4971[_0x4e5caa(0xc5)];return console[_0x4e5caa(0x159)](_0x4e5caa(0x1f9)+_0xe15d38[_0x4e5caa(0x1a4)]+'\x27'),await handleSDKOutput([_0xe15d38],_0x3db8c1),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a32_0x80eef0(0x1a4)]='segment:parent:pull';[a32_0x80eef0(0x1e9)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async['execute'](_0x442a6c){const _0x5110f6=a32_0x80eef0,{options:_0x5cff49,args:_0x207279,tdx:_0x19970d}=_0x442a6c,_0x2130bb=_0x5cff49,_0x2f917a=_0x207279[0x0]||_0x5cff49[_0x5110f6(0x280)];if(!_0x2f917a)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'+_0x5110f6(0x217)),0x1;if(_0x2130bb[_0x5110f6(0x105)]&&_0x2130bb[_0x5110f6(0x283)])return console[_0x5110f6(0x159)](a32_0x2144bc['red'](_0x5110f6(0x18c))),console[_0x5110f6(0x159)](a32_0x2144bc[_0x5110f6(0x99)](_0x5110f6(0xf1))),console[_0x5110f6(0x159)](a32_0x2144bc[_0x5110f6(0x99)](_0x5110f6(0x1e4)+PARENT_SEGMENT_DIR+_0x5110f6(0x22a))),console[_0x5110f6(0x159)](a32_0x2144bc[_0x5110f6(0x26d)](_0x5110f6(0xe2))),0x1;const _0x1cd7dc=_0x2130bb[_0x5110f6(0x283)]||a32_0x52a707['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2f917a)+'.yml');_0x2130bb[_0x5110f6(0x267)]&&(console[_0x5110f6(0x159)](_0x5110f6(0x245)+_0x2130bb[_0x5110f6(0x17f)]),console[_0x5110f6(0x159)]('Parent\x20segment:\x20'+_0x2f917a),console[_0x5110f6(0x159)]('Output\x20file:\x20'+_0x1cd7dc));const _0xb086fd=await withSpinner(_0x5110f6(0x1db)+_0x2f917a+_0x5110f6(0xce),()=>_0x19970d[_0x5110f6(0x284)][_0x5110f6(0x11a)](_0x2f917a),{'verbose':_0x2130bb['verbose']}),_0x15321f=_0xb086fd[_0x5110f6(0xc5)];if(existsSync(_0x1cd7dc)){const _0x3da332=readFileSync(_0x1cd7dc,_0x5110f6(0x154)),_0x115305=generateDiff(_0x3da332,_0x15321f);if(!hasChanges(_0x115305))console[_0x5110f6(0x159)](a32_0x2144bc[_0x5110f6(0x246)]('✔')+'\x20No\x20changes\x20-\x20'+a32_0x2144bc['cyan'](_0x1cd7dc)+_0x5110f6(0x20c));else{console[_0x5110f6(0x159)]('\x0aChanges\x20to\x20\x27'+_0x1cd7dc+'\x27:'),console[_0x5110f6(0x159)]('─'[_0x5110f6(0xbb)](0x3c)),console['error'](formatDiffWithColors(_0x115305)),console[_0x5110f6(0x159)]('─'['repeat'](0x3c));if(!_0x2130bb[_0x5110f6(0x240)]){if(!isInteractive())return console[_0x5110f6(0x159)](a32_0x2144bc[_0x5110f6(0x29a)](_0x5110f6(0x268)),_0x5110f6(0x21e)),console[_0x5110f6(0x159)](a32_0x2144bc[_0x5110f6(0x99)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3ddb35=await confirmKey('Overwrite\x20\x27'+_0x1cd7dc+'\x27?');if(!_0x3ddb35)return console[_0x5110f6(0x159)](a32_0x2144bc[_0x5110f6(0x28f)](_0x5110f6(0x1f4))),0x1;}writeFileSync(_0x1cd7dc,_0x15321f,_0x5110f6(0x154)),console[_0x5110f6(0x159)](a32_0x2144bc[_0x5110f6(0x246)]('✔')+_0x5110f6(0xcc)+a32_0x2144bc[_0x5110f6(0x26d)](_0x1cd7dc));}}else{const _0x5907b8=a32_0x52a707['dirname'](_0x1cd7dc);!existsSync(_0x5907b8)&&mkdirSync(_0x5907b8,{'recursive':!![]}),writeFileSync(_0x1cd7dc,_0x15321f,'utf-8'),console[_0x5110f6(0x159)](a32_0x2144bc[_0x5110f6(0x246)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a32_0x2144bc[_0x5110f6(0x26d)](_0x1cd7dc));}return saveSessionContext({'parent_segment':_0x2f917a},_0x2130bb[_0x5110f6(0x18d)]),console['error'](a32_0x2144bc[_0x5110f6(0x246)]('✔')+_0x5110f6(0x104)+a32_0x2144bc['dim']('parent_segment')+_0x5110f6(0x285)+a32_0x2144bc[_0x5110f6(0x26d)](_0x2f917a)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0x1bc);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x10a);async['execute'](_0x3646cd){const _0x36e9e1=a32_0x80eef0,{options:_0x6e205a,args:_0x3f1d34,tdx:_0x537613}=_0x3646cd,_0x144059=_0x6e205a,_0xf8f8fe=_0x3f1d34[0x0]||_0x6e205a[_0x36e9e1(0x280)];if(!_0xf8f8fe)return showParentSegmentNotSetError(_0x36e9e1(0x29b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x104c8a=resolveYamlFile(_0xf8f8fe);if(!existsSync(_0x104c8a))return showFileNotFoundError(_0x104c8a,_0xf8f8fe),0x1;_0x144059[_0x36e9e1(0x267)]&&(console[_0x36e9e1(0x159)](_0x36e9e1(0x245)+_0x144059[_0x36e9e1(0x17f)]),console['error'](_0x36e9e1(0x1cb)+_0x104c8a));let _0x24d535;try{_0x24d535=readFileSync(_0x104c8a,'utf-8');}catch(_0x3dcffe){const _0x1b78ab=_0x3dcffe instanceof Error?_0x3dcffe[_0x36e9e1(0x214)]:String(_0x3dcffe);return console[_0x36e9e1(0x159)](_0x36e9e1(0x123)+_0x1b78ab),0x1;}const _0x2e7683=await withSpinner(_0x36e9e1(0x1c1),()=>_0x537613[_0x36e9e1(0x284)]['pushParentYaml'](_0x24d535),{'verbose':_0x144059[_0x36e9e1(0x267)]}),_0x284afd=_0x2e7683[_0x36e9e1(0xc5)],{isNew:_0x54f954,name:_0x18b9d7,hasChanges:_0x213804,diffFormatted:_0x59e4a2}=_0x284afd;if(!_0x213804)return console[_0x36e9e1(0x159)](_0x36e9e1(0x17a)+_0x18b9d7+_0x36e9e1(0x253)),0x0;_0x54f954?console[_0x36e9e1(0x159)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x18b9d7+'\x27:'):console[_0x36e9e1(0x159)](_0x36e9e1(0x22d)+_0x18b9d7+'\x27:');console[_0x36e9e1(0x159)]('─'['repeat'](0x3c)),console[_0x36e9e1(0x159)](_0x59e4a2),console[_0x36e9e1(0x159)]('─'['repeat'](0x3c));const _0x2942dd=_0x54f954?'Create\x20parent\x20segment\x20\x27'+_0x18b9d7+'\x27?':_0x36e9e1(0x16f)+_0x18b9d7+'\x27?';if(!_0x144059[_0x36e9e1(0x240)]){if(!isInteractive())return console[_0x36e9e1(0x159)](a32_0x2144bc[_0x36e9e1(0x29a)](_0x36e9e1(0x268)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a32_0x2144bc[_0x36e9e1(0x99)](_0x36e9e1(0xe9))),0x1;const _0x7616c1=await confirmKey(_0x2942dd);if(!_0x7616c1)return console[_0x36e9e1(0x159)](a32_0x2144bc[_0x36e9e1(0x28f)](_0x36e9e1(0x1f4))),0x1;}const _0x15c710=_0x54f954?_0x36e9e1(0x239):_0x36e9e1(0x1ef),_0x5d76be=await withSpinner(_0x15c710+_0x36e9e1(0xf0)+_0x18b9d7+_0x36e9e1(0xce),()=>_0x284afd[_0x36e9e1(0x118)](),{'verbose':_0x144059[_0x36e9e1(0x267)]}),_0x44106f=_0x5d76be[_0x36e9e1(0xc5)],_0x135243=getConsoleNextUrl(_0x144059[_0x36e9e1(0x17f)],_0x36e9e1(0x106)+_0x44106f['id']),_0x54d879=_0x54f954?'Created':_0x36e9e1(0xa0);return console[_0x36e9e1(0x159)]('✔\x20'+_0x54d879+_0x36e9e1(0xf0)+_0x44106f[_0x36e9e1(0x1a4)]+'\x27'),console[_0x36e9e1(0x159)]('\x20\x20'+_0x135243),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']='segment:parent:validate';[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x199);async['execute'](_0x2f5756){const _0x2e7968=a32_0x80eef0,{options:_0x5144cf,args:_0xc351af,tdx:_0x1408bb}=_0x2f5756,_0x25e362=_0x5144cf,_0x1bd81b=_0xc351af[0x0]||_0x5144cf[_0x2e7968(0x280)];if(!_0x1bd81b)return showParentSegmentNotSetError(_0x2e7968(0xd1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x2e7968(0xeb)+_0x2e7968(0x198)+_0x2e7968(0x233)+_0x2e7968(0x22e)),0x1;const _0x2a65dc=resolveYamlFile(_0x1bd81b);if(!existsSync(_0x2a65dc))return showFileNotFoundError(_0x2a65dc,_0x1bd81b),0x1;_0x25e362[_0x2e7968(0x267)]&&(console[_0x2e7968(0x159)]('Site:\x20'+_0x25e362['site']),console[_0x2e7968(0x159)](_0x2e7968(0x1cb)+_0x2a65dc));let _0x5ba907;try{_0x5ba907=readFileSync(_0x2a65dc,_0x2e7968(0x154));}catch(_0x307520){const _0x57fb6d=_0x307520 instanceof Error?_0x307520[_0x2e7968(0x214)]:String(_0x307520);return console[_0x2e7968(0x159)](_0x2e7968(0x123)+_0x57fb6d),0x1;}const _0x35bcba=createCommandSpinner(a32_0x2144bc[_0x2e7968(0x99)](_0x2e7968(0x155)),{'verbose':_0x25e362[_0x2e7968(0x267)]});_0x35bcba[_0x2e7968(0x110)]();const _0x51d086={'onProgress':_0x6200cd=>{const _0x46defb=_0x2e7968;_0x35bcba[_0x46defb(0x266)]=formatProgressMessage(_0x6200cd);}};if(_0x25e362[_0x2e7968(0x156)])_0x51d086['master']=!![];if(_0x25e362[_0x2e7968(0x244)])_0x51d086[_0x2e7968(0x244)]=!![];_0x25e362[_0x2e7968(0xef)]&&(_0x51d086['attribute']=_0x25e362[_0x2e7968(0xef)]);_0x25e362['behavior']&&(_0x51d086[_0x2e7968(0x15d)]=_0x25e362[_0x2e7968(0x15d)]);if(_0x25e362[_0x2e7968(0x1dd)])_0x51d086['interval']=_0x25e362[_0x2e7968(0x1dd)];let _0x5b3cc6;try{_0x5b3cc6=await _0x1408bb[_0x2e7968(0x284)][_0x2e7968(0x9b)](_0x5ba907,_0x51d086),_0x35bcba[_0x2e7968(0x160)]();}catch(_0x54e6bd){_0x35bcba[_0x2e7968(0x160)]();throw _0x54e6bd;}const _0x4d3b5a=_0x25e362[_0x2e7968(0x1dd)]||_0x2e7968(0x1c3);return this[_0x2e7968(0x26b)](_0x5b3cc6,_0x51d086,_0x2a65dc,_0x4d3b5a),_0x5b3cc6['allValid']?0x0:0x1;}['displayValidateResults'](_0x33e95d,_0x127036,_0x111e8f,_0x2f7fc0){const _0x25fdc5=a32_0x80eef0;console[_0x25fdc5(0x159)]('\x0a'+a32_0x2144bc[_0x25fdc5(0x100)](_0x25fdc5(0x20a))+'\x20'+_0x33e95d['name']),console[_0x25fdc5(0x159)]('═'['repeat'](0x3c)),this[_0x25fdc5(0x132)](_0x33e95d);if(typeof _0x127036[_0x25fdc5(0xef)]===_0x25fdc5(0x236)){this[_0x25fdc5(0x287)](_0x33e95d),this[_0x25fdc5(0x1bf)](_0x33e95d),this[_0x25fdc5(0x147)](_0x111e8f,_0x2f7fc0,_0x25fdc5(0xef),_0x127036['attribute']);return;}if(_0x127036[_0x25fdc5(0xef)]===!![]){this[_0x25fdc5(0x287)](_0x33e95d),this[_0x25fdc5(0x1bf)](_0x33e95d),this[_0x25fdc5(0x147)](_0x111e8f,_0x2f7fc0,_0x25fdc5(0x275));return;}if(typeof _0x127036['behavior']===_0x25fdc5(0x236)){this[_0x25fdc5(0x23e)](_0x33e95d,_0x2f7fc0),this['displaySummary'](_0x33e95d),this[_0x25fdc5(0x147)](_0x111e8f,_0x2f7fc0,_0x25fdc5(0x15d),_0x127036[_0x25fdc5(0x15d)]);return;}if(_0x127036['behavior']===!![]){this['displayBehaviorsStats'](_0x33e95d,_0x2f7fc0),this[_0x25fdc5(0x1bf)](_0x33e95d),this['displayPreviewHints'](_0x111e8f,_0x2f7fc0,_0x25fdc5(0x1d4));return;}this['displayAttributesStats'](_0x33e95d),this[_0x25fdc5(0x23e)](_0x33e95d,_0x2f7fc0),this[_0x25fdc5(0x261)](_0x33e95d),this[_0x25fdc5(0x1bf)](_0x33e95d),this[_0x25fdc5(0x147)](_0x111e8f,_0x2f7fc0,_0x25fdc5(0x1bb));}[a32_0x80eef0(0x261)](_0x1097ba){displayRealtimeValidation(_0x1097ba);}[a32_0x80eef0(0x147)](_0x1a45aa,_0x3c6f44,_0x551c22,_0x18fef4){const _0x205ff0=a32_0x80eef0;console[_0x205ff0(0x159)]('\x0a'+a32_0x2144bc[_0x205ff0(0x99)](_0x205ff0(0x256)));const _0x25cd36=_0x3c6f44!==_0x205ff0(0x1c3)?'\x20--interval\x20'+_0x3c6f44:'';if(_0x551c22==='attribute'&&_0x18fef4)console[_0x205ff0(0x159)]('\x20\x20'+a32_0x2144bc[_0x205ff0(0x99)](_0x205ff0(0xa3)+_0x1a45aa+_0x205ff0(0x126)+_0x18fef4+'\x22'+_0x25cd36));else{if(_0x551c22==='behavior'&&_0x18fef4)console[_0x205ff0(0x159)]('\x20\x20'+a32_0x2144bc[_0x205ff0(0x99)](_0x205ff0(0xa3)+_0x1a45aa+_0x205ff0(0x17c)+_0x18fef4+'\x22'+_0x25cd36));else(_0x551c22===_0x205ff0(0x275)||_0x551c22===_0x205ff0(0x1bb))&&console[_0x205ff0(0x159)]('\x20\x20'+a32_0x2144bc['dim'](_0x205ff0(0xa3)+_0x1a45aa+'\x20--attribute\x20\x22<name>\x22'+_0x25cd36));}(_0x551c22===_0x205ff0(0x1d4)||_0x551c22===_0x205ff0(0x1bb))&&console['error']('\x20\x20'+a32_0x2144bc[_0x205ff0(0x99)](_0x205ff0(0xa3)+_0x1a45aa+_0x205ff0(0x215)+_0x25cd36)),_0x551c22==='all'&&console['error']('\x20\x20'+a32_0x2144bc[_0x205ff0(0x99)]('tdx\x20ps\x20preview\x20'+_0x1a45aa+_0x205ff0(0x195)+_0x25cd36));}[a32_0x80eef0(0x132)](_0x200ec6){const _0x131a62=a32_0x80eef0,{master:_0x43ef34}=_0x200ec6,_0x5aa0fd=_0x43ef34[_0x131a62(0x237)]?a32_0x2144bc['green']('✔'):a32_0x2144bc['red']('✘');console[_0x131a62(0x159)]('\x0a'+a32_0x2144bc['dim']('Master\x20Table')),console[_0x131a62(0x159)](_0x5aa0fd+'\x20'+a32_0x2144bc[_0x131a62(0x100)](_0x43ef34[_0x131a62(0x1fb)]+'.'+_0x43ef34[_0x131a62(0x1e6)])),_0x43ef34[_0x131a62(0x237)]?_0x43ef34[_0x131a62(0x21a)]!==undefined&&console[_0x131a62(0x159)]('\x20\x20'+a32_0x2144bc['dim']('Rows:')+'\x20'+a32_0x2144bc[_0x131a62(0x26d)](formatRows(_0x43ef34['rowCount']))):console[_0x131a62(0x159)]('\x20\x20'+a32_0x2144bc[_0x131a62(0x29a)]('Error:')+'\x20'+_0x43ef34[_0x131a62(0x1de)]);}[a32_0x80eef0(0x287)](_0x452500){const _0xb22f33=a32_0x80eef0;if(_0x452500[_0xb22f33(0x275)][_0xb22f33(0x153)]===0x0)return;console[_0xb22f33(0x159)]('\x0a'+a32_0x2144bc[_0xb22f33(0x99)](_0xb22f33(0xfb)));for(const _0x292dd8 of _0x452500[_0xb22f33(0x275)]){const _0x308eaa=_0x292dd8['schemaValid']?a32_0x2144bc['green']('✔'):a32_0x2144bc[_0xb22f33(0x29a)]('✘');let _0x37c979='';if(_0x292dd8[_0xb22f33(0x237)]&&_0x292dd8[_0xb22f33(0x251)]!==undefined&&_0x292dd8[_0xb22f33(0x14e)]!==undefined){const _0x58c3df=_0x292dd8[_0xb22f33(0x14e)]['toFixed'](0x1),_0x560114=_0x292dd8[_0xb22f33(0x14e)]>=0x50?a32_0x2144bc[_0xb22f33(0x246)]:_0x292dd8[_0xb22f33(0x14e)]>=0x32?a32_0x2144bc[_0xb22f33(0x28f)]:a32_0x2144bc[_0xb22f33(0x29a)];_0x37c979='\x20'+a32_0x2144bc[_0xb22f33(0x99)](_0xb22f33(0xc7))+'\x20'+_0x560114(_0x58c3df+'%')+'\x20('+formatRows(_0x292dd8[_0xb22f33(0x251)])+'\x20rows)';}console[_0xb22f33(0x159)](_0x308eaa+'\x20'+a32_0x2144bc['bold'](_0x292dd8[_0xb22f33(0x1a4)])+_0x37c979),console[_0xb22f33(0x159)]('\x20\x20'+a32_0x2144bc['dim'](_0xb22f33(0x21d))+'\x20'+a32_0x2144bc['bold'](_0x292dd8[_0xb22f33(0x1fb)]+'.'+_0x292dd8[_0xb22f33(0x1e6)]));const _0x1a8ffb=_0x292dd8[_0xb22f33(0x98)]===_0x292dd8[_0xb22f33(0x18f)]?a32_0x2144bc[_0xb22f33(0x99)](_0xb22f33(0x9c))+'\x20'+_0x292dd8[_0xb22f33(0x98)]:a32_0x2144bc[_0xb22f33(0x99)](_0xb22f33(0x1a5))+'\x20'+_0x292dd8['joinKey']+_0xb22f33(0x285)+_0x292dd8[_0xb22f33(0x18f)];console['error']('\x20\x20'+_0x1a8ffb),console[_0xb22f33(0x159)]('\x20\x20'+a32_0x2144bc[_0xb22f33(0x99)](_0xb22f33(0x13c))),this[_0xb22f33(0x1c7)](_0x292dd8[_0xb22f33(0x220)]),!_0x292dd8['schemaValid']&&console[_0xb22f33(0x159)]('\x20\x20'+a32_0x2144bc[_0xb22f33(0x29a)](_0xb22f33(0xb1))+'\x20'+_0x292dd8[_0xb22f33(0x1de)]);}}['displayBehaviorsStats'](_0x53e2f4,_0x3259be){const _0x29099c=a32_0x80eef0;if(_0x53e2f4[_0x29099c(0x1d4)][_0x29099c(0x153)]===0x0)return;console[_0x29099c(0x159)]('\x0a'+a32_0x2144bc[_0x29099c(0x99)](_0x29099c(0x1ce))+'\x20'+a32_0x2144bc['dim']('('+_0x3259be+')'));for(const _0x43ba26 of _0x53e2f4[_0x29099c(0x1d4)]){const _0x483c32=_0x43ba26[_0x29099c(0x237)]?a32_0x2144bc[_0x29099c(0x246)]('✔'):a32_0x2144bc[_0x29099c(0x29a)]('✘');let _0x46afc3='';if(_0x43ba26[_0x29099c(0x237)]&&_0x43ba26['customersWithEvents']!==undefined&&_0x43ba26[_0x29099c(0xde)]!==undefined){const _0x3ed6ea=_0x43ba26[_0x29099c(0x212)]?.[_0x29099c(0x201)](0x1)||'?',_0x446c1d=(_0x43ba26[_0x29099c(0x212)]??0x0)>=0x32?a32_0x2144bc['green']:(_0x43ba26['customerPercent']??0x0)>=0x14?a32_0x2144bc[_0x29099c(0x28f)]:a32_0x2144bc[_0x29099c(0x29a)];_0x46afc3='\x20'+a32_0x2144bc['dim'](_0x29099c(0x108))+'\x20'+_0x446c1d(formatRows(_0x43ba26['customersWithEvents']))+'\x20('+_0x3ed6ea+_0x29099c(0x1c8)+a32_0x2144bc[_0x29099c(0x99)](_0x29099c(0x12a))+'\x20'+a32_0x2144bc[_0x29099c(0x26d)](formatRows(_0x43ba26[_0x29099c(0xde)]));}console[_0x29099c(0x159)](_0x483c32+'\x20'+a32_0x2144bc[_0x29099c(0x100)](_0x43ba26[_0x29099c(0x1a4)])+_0x46afc3),console[_0x29099c(0x159)]('\x20\x20'+a32_0x2144bc['dim'](_0x29099c(0x21d))+'\x20'+a32_0x2144bc[_0x29099c(0x100)](_0x43ba26[_0x29099c(0x1fb)]+'.'+_0x43ba26['table']));const _0x4bb173=_0x43ba26[_0x29099c(0x98)]===_0x43ba26[_0x29099c(0x18f)]?a32_0x2144bc[_0x29099c(0x99)]('Join\x20on:')+'\x20'+_0x43ba26[_0x29099c(0x98)]:a32_0x2144bc[_0x29099c(0x99)](_0x29099c(0x1a5))+'\x20'+_0x43ba26[_0x29099c(0x98)]+_0x29099c(0x285)+_0x43ba26[_0x29099c(0x18f)];console[_0x29099c(0x159)]('\x20\x20'+_0x4bb173),console[_0x29099c(0x159)]('\x20\x20'+a32_0x2144bc[_0x29099c(0x99)]('Columns:')),this['displayColumns'](_0x43ba26['columns']),!_0x43ba26['schemaValid']&&console[_0x29099c(0x159)]('\x20\x20'+a32_0x2144bc[_0x29099c(0x29a)](_0x29099c(0xb1))+'\x20'+_0x43ba26[_0x29099c(0x1de)]);}}[a32_0x80eef0(0x1c7)](_0x559410){const _0x37f08b=a32_0x80eef0;for(const _0x315193 of _0x559410){_0x315193[_0x37f08b(0x1f6)]===_0x315193[_0x37f08b(0x25a)]||_0x315193[_0x37f08b(0x25a)]==='*'?console['error']('\x20\x20\x20\x20-\x20'+_0x315193['label']):console[_0x37f08b(0x159)](_0x37f08b(0x1ed)+_0x315193[_0x37f08b(0x1f6)]+'\x20'+a32_0x2144bc['dim']('('+_0x315193[_0x37f08b(0x25a)]+')'));}}[a32_0x80eef0(0x1bf)](_0x57d3a5){const _0x3030ff=a32_0x80eef0;console['error']('─'[_0x3030ff(0xbb)](0x3c));if(_0x57d3a5[_0x3030ff(0x186)]['length']>0x0){console[_0x3030ff(0x159)]('\x0a'+a32_0x2144bc['red']('Errors:'));for(const _0x5e7c57 of _0x57d3a5[_0x3030ff(0x186)]){console[_0x3030ff(0x159)]('\x20\x20'+a32_0x2144bc[_0x3030ff(0x29a)]('•')+'\x20'+_0x5e7c57);}}_0x57d3a5[_0x3030ff(0x152)]&&console['error']('\x0a'+a32_0x2144bc['green']('✔')+_0x3030ff(0x298));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0xaa);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x11c);async[a32_0x80eef0(0x136)](_0x165189){const _0x50f053=a32_0x80eef0,{options:_0x337dc0,args:_0x35856a,tdx:_0x5d15b3}=_0x165189,_0x72e4ad=_0x337dc0,_0x3f18bb=_0x35856a[0x0]||_0x337dc0['parentSegment'];if(!_0x3f18bb)return showParentSegmentNotSetError(_0x50f053(0x1f2)+_0x50f053(0x1e7)+_0x50f053(0x276)+_0x50f053(0x218)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x50f053(0x1fe)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x72e4ad[_0x50f053(0x156)]&&!_0x72e4ad[_0x50f053(0xef)]&&!_0x72e4ad[_0x50f053(0x15d)]&&!_0x72e4ad[_0x50f053(0x244)])return console[_0x50f053(0x159)](a32_0x2144bc[_0x50f053(0x29a)](_0x50f053(0x109))),console['error'](_0x50f053(0x272)),console[_0x50f053(0x159)](_0x50f053(0x297)),console[_0x50f053(0x159)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x50f053(0x159)](_0x50f053(0x273)),console[_0x50f053(0x159)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console['error']('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x4ff9a8=resolveYamlFile(_0x3f18bb);if(!existsSync(_0x4ff9a8))return showFileNotFoundError(_0x4ff9a8,_0x3f18bb),0x1;_0x72e4ad[_0x50f053(0x267)]&&(console['error']('Site:\x20'+_0x72e4ad[_0x50f053(0x17f)]),console[_0x50f053(0x159)](_0x50f053(0x1cb)+_0x4ff9a8));let _0x4ecddd;try{_0x4ecddd=readFileSync(_0x4ff9a8,_0x50f053(0x154));}catch(_0x56482d){const _0x448b72=_0x56482d instanceof Error?_0x56482d[_0x50f053(0x214)]:String(_0x56482d);return console[_0x50f053(0x159)](_0x50f053(0x123)+_0x448b72),0x1;}let _0x165832;try{_0x165832=parseDef(_0x4ecddd);}catch(_0x295c86){const _0x24d83c=_0x295c86 instanceof Error?_0x295c86[_0x50f053(0x214)]:String(_0x295c86);return console[_0x50f053(0x159)](a32_0x2144bc[_0x50f053(0x29a)]('Error\x20parsing\x20YAML:\x20'+_0x24d83c)),0x1;}if(_0x72e4ad['attribute']===!![]||_0x72e4ad[_0x50f053(0xef)]===''){const _0x398513=_0x165832['attributes']?.[_0x50f053(0x1d7)](_0x4a0c7e=>_0x4a0c7e[_0x50f053(0x1a4)])||[];if(_0x398513[_0x50f053(0x153)]===0x0)console[_0x50f053(0x159)](a32_0x2144bc[_0x50f053(0x29a)](_0x50f053(0x122)));else{console[_0x50f053(0x159)](a32_0x2144bc[_0x50f053(0x29a)](_0x50f053(0x19d))),console[_0x50f053(0x159)](_0x50f053(0x133));for(const _0x140aae of _0x398513){console[_0x50f053(0x159)]('\x20\x20'+a32_0x2144bc['cyan'](_0x140aae));}console[_0x50f053(0x159)](_0x50f053(0x19f)+_0x3f18bb+'\x20--attribute\x20\x22'+_0x398513[0x0]+'\x22');}return 0x1;}if(_0x72e4ad[_0x50f053(0x15d)]===!![]||_0x72e4ad[_0x50f053(0x15d)]===''){const _0x4150f2=_0x165832[_0x50f053(0x1d4)]?.[_0x50f053(0x1d7)](_0x467501=>_0x467501[_0x50f053(0x1a4)])||[];if(_0x4150f2[_0x50f053(0x153)]===0x0)console[_0x50f053(0x159)](a32_0x2144bc['red'](_0x50f053(0x226)));else{console[_0x50f053(0x159)](a32_0x2144bc[_0x50f053(0x29a)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x50f053(0x159)](_0x50f053(0x289));for(const _0x2db9ed of _0x4150f2){console['error']('\x20\x20'+a32_0x2144bc[_0x50f053(0x26d)](_0x2db9ed));}console[_0x50f053(0x159)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x3f18bb+_0x50f053(0x17c)+_0x4150f2[0x0]+'\x22');}return 0x1;}const _0x43996a=createCommandSpinner(a32_0x2144bc['dim']('Fetching\x20sample\x20data...'),{'verbose':_0x72e4ad[_0x50f053(0x267)]});_0x43996a[_0x50f053(0x110)]();const _0x451b14={'onProgress':_0x44c88f=>{_0x43996a['text']=formatProgressMessage(_0x44c88f);}};if(_0x72e4ad[_0x50f053(0x156)])_0x451b14[_0x50f053(0x156)]=!![];if(_0x72e4ad[_0x50f053(0xef)]&&typeof _0x72e4ad[_0x50f053(0xef)]===_0x50f053(0x236))_0x451b14['attribute']=_0x72e4ad[_0x50f053(0xef)];if(_0x72e4ad[_0x50f053(0x15d)]&&typeof _0x72e4ad[_0x50f053(0x15d)]==='string')_0x451b14[_0x50f053(0x15d)]=_0x72e4ad['behavior'];if(_0x72e4ad[_0x50f053(0x244)])_0x451b14[_0x50f053(0x244)]=!![];if(_0x72e4ad['interval'])_0x451b14['interval']=_0x72e4ad[_0x50f053(0x1dd)];let _0x34af45;try{_0x34af45=await _0x5d15b3[_0x50f053(0x284)][_0x50f053(0x1d0)](_0x4ecddd,_0x451b14),_0x43996a['stop']();}catch(_0x561066){_0x43996a[_0x50f053(0x160)]();throw _0x561066;}return await this['displayPreviewResults'](_0x34af45,{'master':_0x72e4ad[_0x50f053(0x156)],'attribute':typeof _0x72e4ad[_0x50f053(0xef)]===_0x50f053(0x236)?_0x72e4ad[_0x50f053(0xef)]:undefined,'behavior':typeof _0x72e4ad[_0x50f053(0x15d)]===_0x50f053(0x236)?_0x72e4ad[_0x50f053(0x15d)]:undefined,'enriched':_0x72e4ad[_0x50f053(0x244)]}),_0x34af45[_0x50f053(0x152)]?0x0:0x1;}async[a32_0x80eef0(0x13e)](_0x2c1ab7,_0x5039fe){const _0x1bb155=a32_0x80eef0;console[_0x1bb155(0x159)]('\x0a'+a32_0x2144bc[_0x1bb155(0x100)](_0x1bb155(0x243))+'\x20'+_0x2c1ab7[_0x1bb155(0x1a4)]),console[_0x1bb155(0x159)]('═'[_0x1bb155(0xbb)](0x3c));if(_0x5039fe[_0x1bb155(0x156)]&&_0x2c1ab7[_0x1bb155(0x21b)]){const _0x4d2972=a32_0x2144bc[_0x1bb155(0x99)](_0x1bb155(0x139))+'\x20'+a32_0x2144bc[_0x1bb155(0x100)](_0x2c1ab7[_0x1bb155(0x156)]['database']+'.'+_0x2c1ab7[_0x1bb155(0x156)]['table']);await this[_0x1bb155(0x196)](_0x4d2972,_0x2c1ab7[_0x1bb155(0x21b)]);}else{if(_0x5039fe['attribute']&&_0x2c1ab7[_0x1bb155(0x21b)]){const _0x254d8c=a32_0x2144bc[_0x1bb155(0x99)](_0x1bb155(0x12d))+'\x20'+a32_0x2144bc[_0x1bb155(0x100)](_0x5039fe['attribute']);await this[_0x1bb155(0x196)](_0x254d8c,_0x2c1ab7[_0x1bb155(0x21b)]);}else{if(_0x5039fe[_0x1bb155(0x15d)]&&_0x2c1ab7[_0x1bb155(0x21b)]){const _0x5116a7=a32_0x2144bc[_0x1bb155(0x99)]('Behavior:')+'\x20'+a32_0x2144bc[_0x1bb155(0x100)](_0x5039fe['behavior']);await this[_0x1bb155(0x196)](_0x5116a7,_0x2c1ab7[_0x1bb155(0x21b)]);}else{if(_0x5039fe[_0x1bb155(0x244)]&&_0x2c1ab7['sampleData']){const _0x35b8eb=a32_0x2144bc[_0x1bb155(0x99)]('Enriched:')+'\x20'+a32_0x2144bc['bold']('Master\x20+\x20Attributes');await this[_0x1bb155(0x196)](_0x35b8eb,_0x2c1ab7[_0x1bb155(0x21b)]);}else!_0x2c1ab7['sampleData']&&console[_0x1bb155(0x159)](_0x1bb155(0x1b6));}}}if(_0x2c1ab7[_0x1bb155(0x186)][_0x1bb155(0x153)]>0x0){console[_0x1bb155(0x159)]('─'[_0x1bb155(0xbb)](0x3c)),console['error']('\x0a'+a32_0x2144bc[_0x1bb155(0x29a)]('Errors:'));for(const _0x3d9738 of _0x2c1ab7[_0x1bb155(0x186)]){console[_0x1bb155(0x159)]('\x20\x20'+a32_0x2144bc[_0x1bb155(0x29a)]('•')+'\x20'+_0x3d9738);}}}async[a32_0x80eef0(0x196)](_0x5777b0,_0x13a113){const _0x361434=a32_0x80eef0;if(_0x13a113['length']===0x0){console[_0x361434(0x159)]('\x0a'+_0x5777b0),console[_0x361434(0x159)](_0x361434(0x1df));return;}console[_0x361434(0x159)]('\x0a'+_0x5777b0);const _0x3f2e5a=Object['keys'](_0x13a113[0x0])[_0x361434(0x1d7)](_0x363e3c=>({'name':_0x363e3c,'type':typeof _0x13a113[0x0][_0x363e3c]==='number'?'double':_0x361434(0x1c5)})),_0x4a2c38={'queryId':'preview','columns':_0x3f2e5a,'data':_0x13a113,'stats':{'state':_0x361434(0x19c),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x13a113['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x214c92=formatAsTable(_0x4a2c38,_0x13a113[_0x361434(0x153)],!![]);await writeOutput(_0x214c92,undefined,_0x361434(0x1e6));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a32_0x80eef0(0x269);['description']=a32_0x80eef0(0x176);async['execute'](_0x53b7ff){const _0x334c45=a32_0x80eef0,{options:_0x513027,args:_0x276174,tdx:_0x2c6a68}=_0x53b7ff,_0x4464fb=_0x513027,_0x34a189=_0x276174[0x0]||_0x513027[_0x334c45(0x280)];if(!_0x34a189)return showParentSegmentNotSetError(_0x334c45(0x1e8)+_0x334c45(0x1a0)),0x1;const _0xd5d790=resolveYamlFile(_0x34a189);if(existsSync(_0xd5d790)){_0x4464fb[_0x334c45(0x267)]&&console[_0x334c45(0x159)]('Found\x20YAML\x20file:\x20'+_0xd5d790);let _0x575aa5;try{_0x575aa5=readFileSync(_0xd5d790,'utf-8');}catch(_0x5dde52){const _0x29354b=_0x5dde52 instanceof Error?_0x5dde52[_0x334c45(0x214)]:String(_0x5dde52);return console[_0x334c45(0x159)](_0x334c45(0x123)+_0x29354b),0x1;}const _0x4f522f=await withSpinner(_0x334c45(0x1c1),()=>_0x2c6a68['segment'][_0x334c45(0x1ee)](_0x575aa5),{'verbose':_0x4464fb['verbose']}),_0x3be6bb=_0x4f522f[_0x334c45(0xc5)],{isNew:_0x2f3d3b,name:_0xff1922,hasChanges:_0x3ff77e,diffFormatted:_0x5c81f8}=_0x3be6bb;if(_0x3ff77e){_0x2f3d3b?console['error'](_0x334c45(0x10b)+_0xff1922+'\x27:'):console[_0x334c45(0x159)](_0x334c45(0x22d)+_0xff1922+'\x27:');console[_0x334c45(0x159)]('─'[_0x334c45(0xbb)](0x3c)),console[_0x334c45(0x159)](_0x5c81f8),console['error']('─'[_0x334c45(0xbb)](0x3c));const _0x2d2976=_0x2f3d3b?_0x334c45(0x149)+_0xff1922+_0x334c45(0x225):'Apply\x20changes\x20to\x20\x27'+_0xff1922+_0x334c45(0x225);if(!_0x4464fb[_0x334c45(0x240)]){if(!isInteractive())return console[_0x334c45(0x159)](a32_0x2144bc[_0x334c45(0x29a)](_0x334c45(0x268)),_0x334c45(0x21e)),console[_0x334c45(0x159)](a32_0x2144bc[_0x334c45(0x99)](_0x334c45(0xe9))),0x1;const _0x21a81f=await confirmKey(_0x2d2976);if(!_0x21a81f)return console['error'](a32_0x2144bc['yellow'](_0x334c45(0x1f4))),0x1;}const _0x298500=_0x2f3d3b?'Creating':_0x334c45(0x1ef);await withSpinner(_0x298500+'\x20parent\x20segment\x20\x27'+_0xff1922+_0x334c45(0xce),()=>_0x3be6bb[_0x334c45(0x118)](),{'verbose':_0x4464fb[_0x334c45(0x267)]});const _0x15440f=_0x2f3d3b?'Created':_0x334c45(0xa0);console[_0x334c45(0x159)]('✔\x20'+_0x15440f+_0x334c45(0xf0)+_0xff1922+'\x27');}else console['error']('✔\x20No\x20changes\x20-\x20\x27'+_0xff1922+'\x27\x20is\x20up\x20to\x20date');}const _0x44467f=await withSpinner(_0x334c45(0x219)+_0x34a189+'\x27...',()=>_0x2c6a68[_0x334c45(0x284)][_0x334c45(0x211)](_0x34a189),{'verbose':_0x4464fb[_0x334c45(0x267)]}),_0x15da97=_0x44467f['data'],_0x46b09d=getConsoleUrl(_0x4464fb[_0x334c45(0x17f)],'/app/workflows/'+_0x15da97[_0x334c45(0xe7)]+_0x334c45(0x1f8)+_0x15da97[_0x334c45(0xa5)]+'/attempt/'+_0x15da97['workflowAttemptId']);return console[_0x334c45(0x159)](_0x334c45(0xaf)),console[_0x334c45(0x159)]('\x20\x20'+a32_0x2144bc['dim'](_0x334c45(0x119))+'\x20'+_0x15da97[_0x334c45(0xc8)]),console[_0x334c45(0x159)]('\x20\x20'+a32_0x2144bc[_0x334c45(0x99)]('Status:')+'\x20'+_0x15da97[_0x334c45(0x1aa)]),console['error']('\x20\x20'+a32_0x2144bc[_0x334c45(0x99)](_0x334c45(0x138))+'\x20'+_0x15da97['workflowSessionId']),console[_0x334c45(0x159)]('\x20\x20'+a32_0x2144bc[_0x334c45(0x99)](_0x334c45(0xc0))+'\x20'+_0x15da97['workflowAttemptId']),console['error']('\x20\x20'+_0x46b09d),console[_0x334c45(0x159)]('\x0a'+a32_0x2144bc['dim'](_0x334c45(0x184))+'\x20tdx\x20wf\x20attempt\x20'+_0x15da97[_0x334c45(0xe5)]+_0x334c45(0x112)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]='segment:parent:fields';[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x10c);async[a32_0x80eef0(0x136)](_0x31bf71){const _0x6eb990=a32_0x80eef0,{options:_0x322903,args:_0x350b73,tdx:_0x5d1e42}=_0x31bf71,_0x5d0756=_0x350b73[0x0]||_0x322903[_0x6eb990(0x280)];if(!_0x5d0756)return showParentSegmentNotSetError(_0x6eb990(0x1ff)+_0x6eb990(0x24d)),0x1;_0x322903[_0x6eb990(0x267)]&&(console[_0x6eb990(0x159)](_0x6eb990(0x245)+_0x322903[_0x6eb990(0x17f)]),console[_0x6eb990(0x159)]('Parent\x20segment:\x20'+_0x5d0756));const _0x5c1124=await withSpinner(_0x6eb990(0x23b)+_0x5d0756+_0x6eb990(0xce),()=>_0x5d1e42[_0x6eb990(0x284)]['listFields'](_0x5d0756),{'verbose':_0x322903[_0x6eb990(0x267)]}),_0x50e49d=_0x5c1124[_0x6eb990(0xc5)];console[_0x6eb990(0x159)](_0x6eb990(0x29d)+_0x50e49d['length']+_0x6eb990(0x293)+(_0x50e49d[_0x6eb990(0x153)]!==0x1?'s':''));if(_0x322903[_0x6eb990(0xd6)]||_0x322903[_0x6eb990(0x167)])return await handleSDKOutput(_0x50e49d,_0x322903),0x0;return displayFieldsHumanReadable(_0x50e49d,_0x5d0756),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0xb0);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0xb6);async[a32_0x80eef0(0x136)](_0x1bf282){const _0x6c963e=a32_0x80eef0,{options:_0x3a9ccc,args:_0xf56268,tdx:_0x35bc80}=_0x1bf282,_0x1dd77b=_0x3a9ccc,_0x135336=_0xf56268[0x0]||_0x3a9ccc['parentSegment'];if(!_0x135336)return showParentSegmentNotSetError(_0x6c963e(0x248)+_0x6c963e(0x178)+_0x6c963e(0xeb)+_0x6c963e(0x12c)),0x1;_0x3a9ccc[_0x6c963e(0x267)]&&(console['error'](_0x6c963e(0x245)+_0x3a9ccc[_0x6c963e(0x17f)]),console[_0x6c963e(0x159)](_0x6c963e(0xa4)+_0x135336));const _0x5b3bf=await withSpinner(_0x6c963e(0x1db)+_0x135336+_0x6c963e(0xce),()=>_0x35bc80[_0x6c963e(0x284)][_0x6c963e(0x17e)](_0x135336),{'verbose':_0x3a9ccc['verbose']}),_0x51f751=_0x5b3bf[_0x6c963e(0xc5)];if(_0x1dd77b[_0x6c963e(0x222)]){const _0x405c7a=getConsoleNextUrl(_0x1dd77b[_0x6c963e(0x17f)],_0x6c963e(0x106)+_0x51f751['id']);return console[_0x6c963e(0x159)](a32_0x2144bc[_0x6c963e(0x246)]('✔')+_0x6c963e(0x111)+a32_0x2144bc[_0x6c963e(0x26d)](_0x405c7a)),openBrowser(_0x405c7a),0x0;}return await handleSingleObjectOutput(_0x51f751,_0x3a9ccc),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0xb9);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0xd7);async[a32_0x80eef0(0x136)](_0x2cacb5){const _0x4181ca=a32_0x80eef0,{options:_0x19a212,args:_0x45cf75,tdx:_0x5e3707}=_0x2cacb5,_0x15fd16=_0x19a212,_0x42e19d=_0x45cf75[0x0]||_0x19a212[_0x4181ca(0x280)];if(!_0x42e19d)return showParentSegmentNotSetError(_0x4181ca(0x15f)+'\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'+_0x4181ca(0xeb)+_0x4181ca(0x1bd)),0x1;_0x19a212[_0x4181ca(0x267)]&&(console[_0x4181ca(0x159)](_0x4181ca(0x245)+_0x19a212['site']),console[_0x4181ca(0x159)]('Parent\x20segment:\x20'+_0x42e19d));const _0x284a94=await withSpinner(_0x4181ca(0x18e)+_0x42e19d+_0x4181ca(0xce),()=>_0x5e3707['segment']['resolveParentId'](_0x42e19d),{'verbose':_0x19a212[_0x4181ca(0x267)]}),_0x55701f=_0x284a94[_0x4181ca(0xc5)],_0x14fcbd=_0x5e3707[_0x4181ca(0x284)][_0x4181ca(0x114)](_0x55701f);if(_0x15fd16[_0x4181ca(0x283)]){const _0x2c593b=await this[_0x4181ca(0x1f7)](_0x2cacb5,_0x42e19d,_0x55701f,_0x14fcbd),_0x109e91=this[_0x4181ca(0x296)](_0x2c593b);writeFileSync(_0x15fd16[_0x4181ca(0x283)],_0x109e91);const _0x30e497=_0x2c593b[_0x4181ca(0x16b)][_0x4181ca(0x220)][_0x4181ca(0x153)]+_0x2c593b['behaviors'][_0x4181ca(0xad)]((_0x5c2131,_0x46b15b)=>_0x5c2131+_0x46b15b['columns'][_0x4181ca(0x153)],0x0),_0x5d0107=_0x2c593b[_0x4181ca(0x1d4)][_0x4181ca(0x1a6)](_0x5ae279=>_0x5ae279[_0x4181ca(0x220)][_0x4181ca(0x153)]===0x0)['length'];return console[_0x4181ca(0x115)]('Schema\x20saved\x20to\x20'+_0x15fd16[_0x4181ca(0x283)]),console[_0x4181ca(0x115)](_0x4181ca(0xd3)+_0x14fcbd),console[_0x4181ca(0x115)](_0x4181ca(0x291)+_0x2c593b[_0x4181ca(0x1d4)][_0x4181ca(0x153)]+_0x4181ca(0x23f)),console[_0x4181ca(0x115)](_0x4181ca(0x193)+_0x30e497+_0x4181ca(0x13d)),_0x5d0107>0x0&&console[_0x4181ca(0x115)](_0x4181ca(0x130)+_0x5d0107+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console[_0x4181ca(0x159)]('\x0a'+a32_0x2144bc[_0x4181ca(0x100)]('Output\x20Database:')+'\x20'+a32_0x2144bc['cyan'](_0x14fcbd));const _0x5bbd0e=await withSpinner(_0x4181ca(0x1a9),()=>_0x5e3707[_0x4181ca(0x284)]['getParentSQL'](_0x55701f),{'verbose':_0x19a212[_0x4181ca(0x267)]});console[_0x4181ca(0x159)]('\x0a'+a32_0x2144bc[_0x4181ca(0x100)]('customers')+'\x20'+a32_0x2144bc['dim']('('+_0x14fcbd+_0x4181ca(0x1cd)));const _0x16aaf4=await executeSchemaQuery(_0x5bbd0e[_0x4181ca(0xc5)],_0x5e3707,_0x19a212);await handleQueryOutput(_0x16aaf4,_0x19a212);const _0x1b7d02=await withSpinner(_0x4181ca(0xea),()=>_0x5e3707[_0x4181ca(0x284)][_0x4181ca(0x247)](_0x55701f),{'verbose':_0x19a212[_0x4181ca(0x267)]});for(const _0x211821 of _0x1b7d02[_0x4181ca(0xc5)]){const _0x153ce5=_0x4181ca(0x113)+_0x211821['toLowerCase']()[_0x4181ca(0xc9)](/\s+/g,'_'),_0x60e44d=_0x4181ca(0x1e0)+_0x14fcbd+'.'+_0x153ce5;console['error']('\x0a'+a32_0x2144bc['bold'](_0x211821)+'\x20'+a32_0x2144bc[_0x4181ca(0x99)]('('+_0x14fcbd+'.'+_0x153ce5+')'));try{const _0x3fae1b=await executeSchemaQuery(_0x60e44d,_0x5e3707,_0x19a212);await handleQueryOutput(_0x3fae1b,_0x19a212);}catch{console[_0x4181ca(0x159)](a32_0x2144bc[_0x4181ca(0x28f)](_0x4181ca(0x24f)));}}return 0x0;}async[a32_0x80eef0(0x1f7)](_0x537920,_0x373e38,_0x1a28f9,_0x502356){const _0x359fa6=a32_0x80eef0,{options:_0x2d6006,tdx:_0x11f092}=_0x537920,_0x555fe9=await withSpinner(_0x359fa6(0x1a9),()=>_0x11f092['segment']['getParentSQL'](_0x1a28f9),{'verbose':_0x2d6006[_0x359fa6(0x267)]}),_0x45d424=await executeSchemaQuery(_0x555fe9[_0x359fa6(0xc5)],_0x11f092,_0x2d6006),_0x141eae=_0x45d424[_0x359fa6(0xc5)][_0x359fa6(0x1d7)](_0x56a960=>({'name':_0x56a960[_0x359fa6(0x165)],'type':_0x56a960[_0x359fa6(0x271)]})),_0x504eda=await withSpinner(_0x359fa6(0xea),()=>_0x11f092['segment'][_0x359fa6(0x247)](_0x1a28f9),{'verbose':_0x2d6006[_0x359fa6(0x267)]}),_0x5afa61=[];for(const _0xc4cb94 of _0x504eda[_0x359fa6(0xc5)]){const _0x3adcb6=_0x359fa6(0x113)+_0xc4cb94[_0x359fa6(0x21f)]()[_0x359fa6(0xc9)](/\s+/g,'_'),_0x58f71c='SELECT\x20*\x20FROM\x20'+_0x502356+'.'+_0x3adcb6;let _0x4ac163=[];try{const _0x341220=await executeSchemaQuery(_0x58f71c,_0x11f092,_0x2d6006);_0x4ac163=_0x341220[_0x359fa6(0xc5)][_0x359fa6(0x1d7)](_0x3a67f0=>({'name':_0x3a67f0[_0x359fa6(0x165)],'type':_0x3a67f0[_0x359fa6(0x271)]}));}catch{}_0x5afa61[_0x359fa6(0x234)]({'table':_0x3adcb6,'columns':_0x4ac163});}return{'database':_0x502356,'parent_segment':_0x373e38,'parent_id':_0x1a28f9,'customers':{'table':_0x359fa6(0x16b),'columns':_0x141eae},'behaviors':_0x5afa61};}['formatSchemaJson'](_0x1738b3){const _0x2f35dc=a32_0x80eef0,_0x7ae961=_0x58fcdd=>{const _0x2ccef8=a32_0x46b9;if(_0x58fcdd[_0x2ccef8(0x153)]===0x0)return'[]';const _0x43cb08=_0x58fcdd[_0x2ccef8(0x1d7)](_0x1da209=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x1da209[_0x2ccef8(0x1a4)]+'\x22,\x20\x22type\x22:\x20\x22'+_0x1da209[_0x2ccef8(0xb3)]+_0x2ccef8(0x11e));return'[\x0a'+_0x43cb08[_0x2ccef8(0x11b)](',\x0a')+_0x2ccef8(0x1b5);},_0x40a383=_0x1738b3[_0x2f35dc(0x1d4)][_0x2f35dc(0x1d7)](_0x2f2e94=>{const _0xbfc1f0=_0x2f35dc;return _0xbfc1f0(0x1f1)+_0x2f2e94[_0xbfc1f0(0x1e6)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x7ae961(_0x2f2e94[_0xbfc1f0(0x220)])[_0xbfc1f0(0xc9)](/^/gm,'\x20\x20')[_0xbfc1f0(0x25b)]()+_0xbfc1f0(0x26a);})[_0x2f35dc(0x11b)](',\x0a');return _0x2f35dc(0x20b)+_0x1738b3[_0x2f35dc(0x1fb)]+_0x2f35dc(0x142)+_0x1738b3[_0x2f35dc(0x25d)]+_0x2f35dc(0x10e)+_0x1738b3[_0x2f35dc(0x1a1)]+_0x2f35dc(0xf9)+_0x1738b3[_0x2f35dc(0x16b)][_0x2f35dc(0x1e6)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x7ae961(_0x1738b3['customers']['columns'])['replace'](/^/gm,'\x20\x20')['trim']()+_0x2f35dc(0xfe)+_0x40a383+_0x2f35dc(0x200);}}export class ParentSegmentSQLCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0x15c);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x26c);async[a32_0x80eef0(0x136)](_0x63d072){const _0x2bbaa1=a32_0x80eef0,{options:_0x4b3829,args:_0x4389d6,tdx:_0x130cdb}=_0x63d072,_0x547c14=_0x4389d6[0x0]||_0x4b3829[_0x2bbaa1(0x280)];if(!_0x547c14)return showParentSegmentNotSetError(_0x2bbaa1(0x1af)+_0x2bbaa1(0x22f)),0x1;_0x4b3829['verbose']&&(console['error'](_0x2bbaa1(0x245)+_0x4b3829[_0x2bbaa1(0x17f)]),console[_0x2bbaa1(0x159)](_0x2bbaa1(0xa4)+_0x547c14));const _0x323de0=await withSpinner(_0x2bbaa1(0x18e)+_0x547c14+_0x2bbaa1(0xce),()=>_0x130cdb[_0x2bbaa1(0x284)][_0x2bbaa1(0xc2)](_0x547c14),{'verbose':_0x4b3829[_0x2bbaa1(0x267)]}),_0x15c9df=_0x323de0[_0x2bbaa1(0xc5)],_0x176e0b=await withSpinner(_0x2bbaa1(0xf4)+_0x547c14+_0x2bbaa1(0xce),()=>_0x130cdb['segment'][_0x2bbaa1(0x16d)](_0x15c9df),{'verbose':_0x4b3829['verbose']}),_0xd2e13=_0x176e0b[_0x2bbaa1(0xc5)];return _0x4b3829['format']==='json'||_0x4b3829['format']==='jsonl'?await handleSDKOutput([{'sql':_0xd2e13}],_0x4b3829):console[_0x2bbaa1(0x115)](_0xd2e13),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0x128);[a32_0x80eef0(0x1e9)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a32_0x80eef0(0x136)](_0x7a9b8){const _0x45dd5f=a32_0x80eef0,{options:_0x59027e,args:_0x2fbb6c,tdx:_0xf2646}=_0x7a9b8,_0x124f80=_0x2fbb6c[0x0]||_0x59027e[_0x45dd5f(0x280)];if(!_0x124f80)return showParentSegmentNotSetError(_0x45dd5f(0x206)+_0x45dd5f(0x172)),0x1;_0x59027e[_0x45dd5f(0x267)]&&(console[_0x45dd5f(0x159)](_0x45dd5f(0x245)+_0x59027e[_0x45dd5f(0x17f)]),console[_0x45dd5f(0x159)](_0x45dd5f(0xa4)+_0x124f80));const _0x171c73=await withSpinner(_0x45dd5f(0x18e)+_0x124f80+_0x45dd5f(0xce),()=>_0xf2646['segment'][_0x45dd5f(0xc2)](_0x124f80),{'verbose':_0x59027e['verbose']}),_0x27ce43=_0x171c73[_0x45dd5f(0xc5)],_0x37bdf9=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x124f80+_0x45dd5f(0xce),()=>_0xf2646['segment'][_0x45dd5f(0x16d)](_0x27ce43),{'verbose':_0x59027e['verbose']});let _0x49ae56=_0x37bdf9['data'];const _0x5adaf3=resolveLimit(_0x59027e[_0x45dd5f(0x117)],DEFAULT_DISPLAY_LIMIT),_0x2726bf=/\bLIMIT\s+\d+/i[_0x45dd5f(0xfa)](_0x49ae56);!_0x2726bf&&(_0x49ae56=_0x49ae56[_0x45dd5f(0x25b)]()[_0x45dd5f(0xc9)](/;+$/,''),_0x49ae56=_0x45dd5f(0x9f)+_0x49ae56+_0x45dd5f(0x161)+_0x5adaf3);_0x59027e['verbose']&&console[_0x45dd5f(0x159)](_0x45dd5f(0xd5)+_0x49ae56);const _0x4fb151=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x34acd8=>{const _0x2fe31f=_0x45dd5f,_0x56d963=await _0xf2646[_0x2fe31f(0x202)][_0x2fe31f(0x136)](_0x49ae56,{'catalog':'td','schema':_0x2fe31f(0x192),'onJobId':_0xba4e3a=>{_0x34acd8['setJobId'](_0xba4e3a);}});return _0x56d963;},{'verbose':_0x59027e[_0x45dd5f(0x267)]}),_0x3eb948=_0x4fb151[_0x45dd5f(0xc5)],_0x8f75cf=_0x3eb948[_0x45dd5f(0x213)]?_0x45dd5f(0x286)+_0x3eb948[_0x45dd5f(0x213)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x3eb948[_0x45dd5f(0x187)][_0x45dd5f(0x229)][_0x45dd5f(0x1be)]()+_0x45dd5f(0x145)+(_0x45dd5f(0xf3)+formatElapsed(_0x3eb948[_0x45dd5f(0x187)][_0x45dd5f(0x144)])+_0x8f75cf)),await handleQueryOutput(_0x3eb948,_0x59027e),0x0;}}export class PSRtListCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]='ps:rt:list';[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x1ab);async[a32_0x80eef0(0x136)](_0x434602){const _0x1751c0=a32_0x80eef0,{options:_0x3a2813,args:_0x53c4e0,tdx:_0x36fd7a}=_0x434602,_0x50f87b=_0x53c4e0[0x0],_0x4eac84=await withSpinner(_0x50f87b?_0x1751c0(0x14b)+_0x50f87b+_0x1751c0(0xce):_0x1751c0(0xe6),()=>_0x36fd7a[_0x1751c0(0x1c6)][_0x1751c0(0x1e3)](),{'verbose':_0x3a2813[_0x1751c0(0x267)]});let _0xd5a0d=_0x4eac84['data'][_0x1751c0(0x1a6)](_0x5586e5=>_0x5586e5['realtime_enabled']);if(_0x50f87b){const _0x4df390=_0x50f87b[_0x1751c0(0xc9)](/[.+^${}()|[\]\\]/g,_0x1751c0(0x19e))[_0x1751c0(0xc9)](/\*/g,'.*')[_0x1751c0(0xc9)](/\?/g,'.'),_0x46f065=new RegExp('^'+_0x4df390+'$','i');_0xd5a0d=_0xd5a0d[_0x1751c0(0x1a6)](_0x26f778=>_0x46f065[_0x1751c0(0xfa)](_0x26f778[_0x1751c0(0x1a4)]));}_0xd5a0d[_0x1751c0(0x116)]((_0x50da41,_0xcb8ffb)=>_0x50da41[_0x1751c0(0x1a4)]['localeCompare'](_0xcb8ffb[_0x1751c0(0x1a4)])),console['error']('✔\x20Found\x20'+_0xd5a0d[_0x1751c0(0x153)]+_0x1751c0(0x194)+(_0xd5a0d[_0x1751c0(0x153)]!==0x1?'s':''));const _0x4f2d39=_0x3d3869=>{const _0x41d31b=_0x1751c0;return getConsoleNextUrl(_0x3a2813[_0x41d31b(0x17f)],_0x41d31b(0x106)+_0x3d3869);};if(_0x3a2813['format']===_0x1751c0(0xd6)||_0x3a2813[_0x1751c0(0x257)]===_0x1751c0(0x167)){const _0x2afa9f=_0xd5a0d[_0x1751c0(0x1d7)](_0x4a94f7=>({..._0x4a94f7,'url':_0x4f2d39(_0x4a94f7['id'])}));await handleSDKOutput(_0x2afa9f,_0x3a2813);}else{if(_0xd5a0d[_0x1751c0(0x153)]===0x0)console[_0x1751c0(0x115)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0xd089bc of _0xd5a0d){const _0xc1414a=_0xd089bc['population']?a32_0x2144bc['dim']('\x20('+formatRows(_0xd089bc[_0x1751c0(0x9e)])+')'):'',_0x232588=hyperlink(_0xd089bc[_0x1751c0(0x1a4)],_0x4f2d39(_0xd089bc['id']));console[_0x1751c0(0x115)]('⚡\x20'+_0x232588+_0xc1414a);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0x1ae);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x1dc);async['execute'](_0x54aad0){const _0x46c6f9=a32_0x80eef0,{options:_0x142e0a,args:_0x76d9da,tdx:_0x1d22b5}=_0x54aad0,_0x48a185=_0x76d9da[0x0]||_0x142e0a[_0x46c6f9(0x280)];if(!_0x48a185)return showParentSegmentNotSetError(_0x46c6f9(0xb7)+_0x46c6f9(0x270)),0x1;const _0x247655=resolveYamlFile(_0x48a185);if(!existsSync(_0x247655))return showFileNotFoundError(_0x247655,_0x48a185),0x1;let _0x22bd01;try{_0x22bd01=readFileSync(_0x247655,_0x46c6f9(0x154));}catch(_0x1c6049){const _0x598b56=_0x1c6049 instanceof Error?_0x1c6049['message']:String(_0x1c6049);return console[_0x46c6f9(0x159)]('Error\x20reading\x20file:\x20'+_0x598b56),0x1;}const _0x5acf9d=createCommandSpinner(a32_0x2144bc[_0x46c6f9(0x99)](_0x46c6f9(0x151)),{'verbose':_0x142e0a[_0x46c6f9(0x267)]});_0x5acf9d[_0x46c6f9(0x110)]();const _0x534b40={'realtime':!![],'onProgress':_0x17bbea=>{const _0x3291c4=_0x46c6f9;_0x5acf9d[_0x3291c4(0x266)]=formatProgressMessage(_0x17bbea);}};let _0x2ac02a;try{_0x2ac02a=await _0x1d22b5[_0x46c6f9(0x284)][_0x46c6f9(0x9b)](_0x22bd01,_0x534b40),_0x5acf9d[_0x46c6f9(0x160)]();}catch(_0x6fab91){_0x5acf9d[_0x46c6f9(0x160)]();throw _0x6fab91;}console[_0x46c6f9(0x159)]('\x0a'+a32_0x2144bc['bold']('RT\x202.0\x20Validate:')+'\x20'+_0x2ac02a[_0x46c6f9(0x1a4)]),console[_0x46c6f9(0x159)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x2ac02a),console['error']('─'['repeat'](0x3c));if(_0x2ac02a[_0x46c6f9(0x186)][_0x46c6f9(0x153)]>0x0){console[_0x46c6f9(0x159)]('\x0a'+a32_0x2144bc['red'](_0x46c6f9(0x28e)));for(const _0xa040a1 of _0x2ac02a['errors']){console[_0x46c6f9(0x159)]('\x20\x20'+a32_0x2144bc[_0x46c6f9(0x29a)]('•')+'\x20'+_0xa040a1);}}return _0x2ac02a[_0x46c6f9(0x152)]&&console['error']('\x0a'+a32_0x2144bc[_0x46c6f9(0x246)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x2ac02a['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{['name']=a32_0x80eef0(0x173);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x1d2);async[a32_0x80eef0(0x136)](_0x1733d6){const _0x35e260=a32_0x80eef0,{options:_0x1e7c7a,args:_0x12149d,tdx:_0x35d2ef}=_0x1733d6,_0x150feb=_0x12149d[0x0]||_0x1e7c7a['parentSegment'];if(!_0x150feb)return showParentSegmentNotSetError(_0x35e260(0x238)+_0x35e260(0xd0)),0x1;_0x1e7c7a['verbose']&&(console[_0x35e260(0x159)](_0x35e260(0x245)+_0x1e7c7a[_0x35e260(0x17f)]),console['error'](_0x35e260(0xa4)+_0x150feb));const _0x5be85a=await withSpinner(_0x35e260(0x18e)+_0x150feb+_0x35e260(0xce),()=>_0x35d2ef[_0x35e260(0x284)][_0x35e260(0xc2)](_0x150feb),{'verbose':_0x1e7c7a[_0x35e260(0x267)]}),_0x4feef2=_0x5be85a[_0x35e260(0xc5)],_0x41c3a9=await withSpinner('Listing\x20RT\x20journeys\x20for\x20\x27'+_0x150feb+_0x35e260(0xce),()=>_0x35d2ef[_0x35e260(0x1c6)][_0x35e260(0x170)](_0x4feef2),{'verbose':_0x1e7c7a[_0x35e260(0x267)]}),_0x4b1b40=_0x41c3a9[_0x35e260(0xc5)];console[_0x35e260(0x159)](_0x35e260(0x29d)+_0x4b1b40[_0x35e260(0x153)]+_0x35e260(0x299)+(_0x4b1b40[_0x35e260(0x153)]!==0x1?'s':''));if(_0x1e7c7a[_0x35e260(0x257)]===_0x35e260(0xd6)||_0x1e7c7a['format']===_0x35e260(0x167))await handleSDKOutput(_0x4b1b40,_0x1e7c7a);else{if(_0x4b1b40['length']===0x0)console['log']('No\x20RT\x20journeys\x20found');else for(const _0x32813f of _0x4b1b40){const _0x2b6e31=_0x32813f[_0x35e260(0x204)]===_0x35e260(0x28d)?'🚀':'📝',_0x332c72=_0x32813f['paused']?a32_0x2144bc[_0x35e260(0x28f)]('\x20(paused)'):'',_0x295e6e=a32_0x2144bc[_0x35e260(0x99)]('\x20('+_0x32813f[_0x35e260(0x281)]+_0x35e260(0xd9)+(_0x32813f[_0x35e260(0x281)]!==0x1?'s':'')+')');console['log'](_0x2b6e31+'\x20'+_0x32813f[_0x35e260(0x1a4)]+_0x332c72+_0x295e6e);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{['name']=a32_0x80eef0(0x11d);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x252);async[a32_0x80eef0(0x136)](_0x15a779){const _0x4da58a=a32_0x80eef0,{options:_0x6a990e,args:_0x1d2c60,tdx:_0x340c00}=_0x15a779,_0x14b810=_0x1d2c60[0x0];if(!_0x14b810)return console[_0x4da58a(0x159)](a32_0x2144bc[_0x4da58a(0x29a)](_0x4da58a(0xb5))),console[_0x4da58a(0x159)](_0x4da58a(0x1e1)),console[_0x4da58a(0x159)](a32_0x2144bc['dim'](_0x4da58a(0x1ec))),0x1;_0x6a990e['verbose']&&(console[_0x4da58a(0x159)](_0x4da58a(0x245)+_0x6a990e[_0x4da58a(0x17f)]),console[_0x4da58a(0x159)](_0x4da58a(0x164)+_0x14b810));const _0x2d0649=await withSpinner(_0x4da58a(0x24c)+_0x14b810+_0x4da58a(0xce),()=>_0x340c00[_0x4da58a(0x1c6)][_0x4da58a(0x1e5)](_0x14b810),{'verbose':_0x6a990e[_0x4da58a(0x267)]}),_0xcb3d3c=_0x2d0649[_0x4da58a(0xc5)];console['error'](_0x4da58a(0x231)+_0xcb3d3c['name']+'\x27');if(_0x6a990e[_0x4da58a(0x257)]===_0x4da58a(0xd6)||_0x6a990e[_0x4da58a(0x257)]===_0x4da58a(0x167))await handleSDKOutput([_0xcb3d3c],_0x6a990e);else{const _0x278df1=_0xcb3d3c[_0x4da58a(0x204)]===_0x4da58a(0x28d)?'🚀':'📝',_0x37f50c=_0xcb3d3c[_0x4da58a(0x166)]?a32_0x2144bc[_0x4da58a(0x28f)](_0x4da58a(0x242)):'';console['log'](_0x278df1+'\x20'+_0xcb3d3c['name']+_0x37f50c);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]='ps:rt:jn:resume';[a32_0x80eef0(0x1e9)]='Resume\x20activations\x20in\x20an\x20RT\x20journey';async['execute'](_0x48b096){const _0x5837b7=a32_0x80eef0,{options:_0x4b7335,args:_0x126b24,tdx:_0x6b5fc5}=_0x48b096,_0x5cc916=_0x126b24[0x0];if(!_0x5cc916)return console[_0x5837b7(0x159)](a32_0x2144bc[_0x5837b7(0x29a)](_0x5837b7(0xb5))),console[_0x5837b7(0x159)](_0x5837b7(0xdc)),console[_0x5837b7(0x159)](a32_0x2144bc[_0x5837b7(0x99)](_0x5837b7(0x1ec))),0x1;_0x4b7335['verbose']&&(console['error'](_0x5837b7(0x245)+_0x4b7335[_0x5837b7(0x17f)]),console[_0x5837b7(0x159)]('RT\x20Journey\x20ID:\x20'+_0x5cc916));const _0x591e9=await withSpinner(_0x5837b7(0x26f)+_0x5cc916+'\x27...',()=>_0x6b5fc5['realtime']['resumeJourney'](_0x5cc916),{'verbose':_0x4b7335[_0x5837b7(0x267)]}),_0x5e28a5=_0x591e9[_0x5837b7(0xc5)];console[_0x5837b7(0x159)](_0x5837b7(0x1d6)+_0x5e28a5[_0x5837b7(0x1a4)]+'\x27');if(_0x4b7335['format']==='json'||_0x4b7335[_0x5837b7(0x257)]==='jsonl')await handleSDKOutput([_0x5e28a5],_0x4b7335);else{const _0x5d656e=_0x5e28a5[_0x5837b7(0x204)]===_0x5837b7(0x28d)?'🚀':'📝',_0x3365b2=_0x5e28a5['paused']?a32_0x2144bc[_0x5837b7(0x28f)](_0x5837b7(0x242)):'';console[_0x5837b7(0x115)](_0x5d656e+'\x20'+_0x5e28a5[_0x5837b7(0x1a4)]+_0x3365b2);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0x221);[a32_0x80eef0(0x1e9)]='Get\x20current\x20RT\x20configuration\x20version\x20status';async['execute'](_0x18142a){const _0x15faaa=a32_0x80eef0,{options:_0x2a76d0,args:_0x59532d,tdx:_0x1c0778}=_0x18142a,_0xb1e312=_0x59532d[0x0]||_0x2a76d0[_0x15faaa(0x280)];if(!_0xb1e312)return showParentSegmentNotSetError(_0x15faaa(0xe3)+'\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;_0x2a76d0[_0x15faaa(0x267)]&&(console[_0x15faaa(0x159)](_0x15faaa(0x245)+_0x2a76d0[_0x15faaa(0x17f)]),console['error']('Parent\x20segment:\x20'+_0xb1e312));const _0x544d37=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xb1e312+'\x27...',()=>_0x1c0778[_0x15faaa(0x284)][_0x15faaa(0xc2)](_0xb1e312),{'verbose':_0x2a76d0['verbose']}),_0x13f993=_0x544d37[_0x15faaa(0xc5)],_0x1170b7=await withSpinner(_0x15faaa(0x1da)+_0xb1e312+_0x15faaa(0xce),()=>_0x1c0778['realtime']['getCurrentConfigVersion'](_0x13f993),{'verbose':_0x2a76d0[_0x15faaa(0x267)]}),_0x5c7c4c=_0x1170b7[_0x15faaa(0xc5)];return console[_0x15faaa(0x159)]('✔\x20Retrieved\x20RT\x20configuration\x20version'),_0x2a76d0['format']===_0x15faaa(0xd6)||_0x2a76d0['format']===_0x15faaa(0x167)?await handleSDKOutput([_0x5c7c4c],_0x2a76d0):(console['log']('id:\x20'+_0x5c7c4c['id']),console['log'](_0x15faaa(0x157)+_0x5c7c4c['audienceId']),console[_0x15faaa(0x115)]('identifier:\x20'+_0x5c7c4c[_0x15faaa(0x27a)]),console[_0x15faaa(0x115)](_0x15faaa(0x14d)+_0x5c7c4c[_0x15faaa(0xac)]),console[_0x15faaa(0x115)](_0x15faaa(0xf7)+_0x5c7c4c[_0x15faaa(0x1aa)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]='ps:pz:service:list';[a32_0x80eef0(0x1e9)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async[a32_0x80eef0(0x136)](_0x49f424){const _0x44b7c7=a32_0x80eef0,{options:_0x475173,args:_0x2e5940,tdx:_0x4708c0}=_0x49f424,_0x5dfbe9=_0x2e5940[0x0]||_0x475173['parentSegment'];if(!_0x5dfbe9)return showParentSegmentNotSetError(_0x44b7c7(0xa2)+_0x44b7c7(0xab)),0x1;const _0x4a09dd=await withSpinner(_0x44b7c7(0x18e)+_0x5dfbe9+'\x27...',()=>_0x4708c0[_0x44b7c7(0x284)][_0x44b7c7(0xc2)](_0x5dfbe9),{'verbose':_0x475173[_0x44b7c7(0x267)]}),_0xa14910=_0x4a09dd[_0x44b7c7(0xc5)],_0x2a4fab=await withSpinner(_0x44b7c7(0x1b2)+_0x5dfbe9+_0x44b7c7(0xce),()=>_0x4708c0[_0x44b7c7(0x260)]['list'](_0xa14910),{'verbose':_0x475173[_0x44b7c7(0x267)]}),_0x521803=_0x2a4fab[_0x44b7c7(0xc5)];console[_0x44b7c7(0x159)](_0x44b7c7(0x29d)+_0x521803['length']+'\x20personalization\x20service'+(_0x521803[_0x44b7c7(0x153)]!==0x1?'s':''));if(_0x475173[_0x44b7c7(0x257)]===_0x44b7c7(0xd6)||_0x475173[_0x44b7c7(0x257)]===_0x44b7c7(0x167))await handleSDKOutput(_0x521803,_0x475173);else{if(_0x521803[_0x44b7c7(0x153)]===0x0)console[_0x44b7c7(0x115)]('No\x20personalization\x20services\x20configured'),console[_0x44b7c7(0x159)](a32_0x2144bc['cyan'](_0x44b7c7(0x171)));else for(const _0x7c170c of _0x521803){console['log'](a32_0x2144bc['bold'](_0x7c170c['name'])+'\x20'+a32_0x2144bc[_0x44b7c7(0x99)](_0x44b7c7(0x10f)+_0x7c170c['id']+')'));_0x7c170c[_0x44b7c7(0x1e9)]&&console[_0x44b7c7(0x115)]('\x20\x20'+a32_0x2144bc[_0x44b7c7(0x99)](_0x7c170c[_0x44b7c7(0x1e9)]));if(_0x7c170c['tokens']&&_0x7c170c[_0x44b7c7(0x148)][_0x44b7c7(0x153)]>0x0)for(const _0x1eecda of _0x7c170c[_0x44b7c7(0x148)]){const _0x23fac6=_0x1eecda[_0x44b7c7(0x259)]?.[_0x44b7c7(0x153)]?_0x1eecda['allowedIps'][_0x44b7c7(0x11b)](',\x20'):'any';console['log']('\x20\x20'+a32_0x2144bc[_0x44b7c7(0x26d)](_0x44b7c7(0x228))+'\x20'+_0x1eecda['name']+'\x20'+a32_0x2144bc[_0x44b7c7(0x99)](_0x44b7c7(0x10f)+_0x1eecda['id']+')')),console[_0x44b7c7(0x115)](_0x44b7c7(0x1d5)+a32_0x2144bc['dim']('allowed\x20IPs:')+'\x20'+_0x23fac6);}else console[_0x44b7c7(0x115)]('\x20\x20'+a32_0x2144bc[_0x44b7c7(0x99)](_0x44b7c7(0xbd)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0x197);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x23d);async[a32_0x80eef0(0x136)](_0x5cfb74){const _0x4c1488=a32_0x80eef0,{options:_0x271eae,args:_0x26f37a,tdx:_0x2a106b}=_0x5cfb74,_0x225536=_0x271eae,_0x303058=_0x26f37a[0x0],_0x274eb1=_0x26f37a[0x1]||_0x271eae[_0x4c1488(0x280)];if(!_0x303058)return console['error'](_0x4c1488(0x182)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]'),console[_0x4c1488(0x159)](_0x4c1488(0x15e)),0x1;if(!_0x274eb1)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0x4c1488(0x15e)),0x1;const _0x52903b=await withSpinner(_0x4c1488(0x18e)+_0x274eb1+'\x27...',()=>_0x2a106b[_0x4c1488(0x284)][_0x4c1488(0xc2)](_0x274eb1),{'verbose':_0x271eae[_0x4c1488(0x267)]}),_0x5e9b56=_0x52903b['data'],_0x1cd892={'name':_0x303058,'description':_0x225536[_0x4c1488(0x1e9)],'public':_0x225536[_0x4c1488(0x22c)]},_0x4e65d2=await withSpinner(_0x4c1488(0xed)+_0x303058+_0x4c1488(0xce),()=>_0x2a106b[_0x4c1488(0x260)]['create'](_0x5e9b56,_0x1cd892),{'verbose':_0x271eae[_0x4c1488(0x267)]}),_0x4011e2=_0x4e65d2['data'];return console['error'](_0x4c1488(0x18b)+_0x4011e2['name']+_0x4c1488(0x250)+_0x4011e2['id']),await handleSDKOutput([_0x4011e2],_0x271eae),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0x210);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0xdf);async['execute'](_0x3e6b87){const _0x4f6309=a32_0x80eef0,{options:_0x51b3e7,args:_0x1e1b2b,tdx:_0x530505}=_0x3e6b87,_0x372e04=_0x1e1b2b[0x0],_0x9ba48d=_0x1e1b2b[0x1]||_0x51b3e7[_0x4f6309(0x280)];if(!_0x372e04)return console[_0x4f6309(0x159)](_0x4f6309(0xbe)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x9ba48d)return showParentSegmentNotSetError(_0x4f6309(0x29e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x15c5b1=await withSpinner(_0x4f6309(0x18e)+_0x9ba48d+_0x4f6309(0xce),()=>_0x530505[_0x4f6309(0x284)][_0x4f6309(0xc2)](_0x9ba48d),{'verbose':_0x51b3e7[_0x4f6309(0x267)]}),_0x200080=_0x15c5b1[_0x4f6309(0xc5)],_0x41847f=await withSpinner(_0x4f6309(0x279)+_0x372e04+_0x4f6309(0xce),()=>_0x530505[_0x4f6309(0x260)][_0x4f6309(0x1c9)](_0x200080,_0x372e04),{'verbose':_0x51b3e7[_0x4f6309(0x267)]}),_0x267f27=_0x41847f[_0x4f6309(0xc5)];if(_0x51b3e7[_0x4f6309(0xd6)]||_0x51b3e7[_0x4f6309(0x167)])await handleSDKOutput([_0x267f27],_0x51b3e7);else{console[_0x4f6309(0x115)](a32_0x2144bc[_0x4f6309(0x100)](_0x267f27['name'])+'\x20'+a32_0x2144bc[_0x4f6309(0x99)](_0x4f6309(0x10f)+_0x267f27['id']+')'));_0x267f27[_0x4f6309(0x1e9)]&&console[_0x4f6309(0x115)]('\x20\x20'+a32_0x2144bc[_0x4f6309(0x99)](_0x267f27[_0x4f6309(0x1e9)]));console[_0x4f6309(0x115)]('\x20\x20'+a32_0x2144bc[_0x4f6309(0x26d)](_0x4f6309(0x15b))+'\x20'+(_0x267f27[_0x4f6309(0x22c)]?_0x4f6309(0x240):'no'));if(_0x267f27[_0x4f6309(0x148)]&&_0x267f27['tokens'][_0x4f6309(0x153)]>0x0)for(const _0x515ecf of _0x267f27[_0x4f6309(0x148)]){const _0x29e069=_0x515ecf['allowedIps']?.['length']?_0x515ecf[_0x4f6309(0x259)][_0x4f6309(0x11b)](',\x20'):_0x4f6309(0xdd);console[_0x4f6309(0x115)]('\x20\x20'+a32_0x2144bc[_0x4f6309(0x26d)](_0x4f6309(0x228))+'\x20'+_0x515ecf[_0x4f6309(0x1a4)]+'\x20'+a32_0x2144bc[_0x4f6309(0x99)](_0x4f6309(0x10f)+_0x515ecf['id']+')')),console[_0x4f6309(0x115)](_0x4f6309(0x1d5)+a32_0x2144bc['dim'](_0x4f6309(0xc1))+'\x20'+_0x29e069);}else console['log']('\x20\x20'+a32_0x2144bc[_0x4f6309(0x99)](_0x4f6309(0xbd)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']=a32_0x80eef0(0x12f);['description']=a32_0x80eef0(0x1a3);async['execute'](_0x9c6864){const _0x314452=a32_0x80eef0,{options:_0x349d4e,args:_0x226ea5,tdx:_0x1b743e}=_0x9c6864,_0x39e42f=_0x226ea5[0x0],_0x5ee996=_0x226ea5[0x1]||_0x349d4e['parentSegment'];if(!_0x39e42f)return console[_0x314452(0x159)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x314452(0x159)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x5ee996)return showParentSegmentNotSetError(_0x314452(0xa9)+_0x314452(0x150)),0x1;const _0x4cda85=await withSpinner(_0x314452(0x18e)+_0x5ee996+_0x314452(0xce),()=>_0x1b743e[_0x314452(0x284)][_0x314452(0xc2)](_0x5ee996),{'verbose':_0x349d4e[_0x314452(0x267)]}),_0x111004=_0x4cda85[_0x314452(0xc5)];return await withSpinner(_0x314452(0x14a)+_0x39e42f+_0x314452(0xce),()=>_0x1b743e[_0x314452(0x260)]['delete'](_0x111004,_0x39e42f),{'verbose':_0x349d4e['verbose']}),console[_0x314452(0x159)]('✔\x20Deleted\x20personalization\x20service\x20\x27'+_0x39e42f+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0x262);['description']='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a32_0x80eef0(0x136)](_0x203015){const _0x22de1b=a32_0x80eef0,{options:_0x2899ff,args:_0x53b280,tdx:_0x2809e6}=_0x203015,_0x19b608=_0x2899ff,_0x1e423f=_0x53b280[0x0],_0x4c7c64=_0x53b280[0x1]||_0x2899ff[_0x22de1b(0x280)];if(!_0x1e423f)return console[_0x22de1b(0x159)](_0x22de1b(0xbe)),console['error'](_0x22de1b(0x179)),console[_0x22de1b(0x159)](_0x22de1b(0x1c4)),0x1;if(!_0x19b608['name'])return console[_0x22de1b(0x159)](_0x22de1b(0x13a)),console[_0x22de1b(0x159)](_0x22de1b(0x179)),0x1;if(!_0x4c7c64)return showParentSegmentNotSetError(_0x22de1b(0x175)+_0x22de1b(0x1c4)),0x1;const _0x1a10e0=await withSpinner(_0x22de1b(0x18e)+_0x4c7c64+_0x22de1b(0xce),()=>_0x2809e6[_0x22de1b(0x284)][_0x22de1b(0xc2)](_0x4c7c64),{'verbose':_0x2899ff[_0x22de1b(0x267)]}),_0x12cf5f=_0x1a10e0['data'],_0x57b36f={'name':_0x19b608['name']};_0x19b608['description']!==undefined&&(_0x57b36f['description']=_0x19b608[_0x22de1b(0x1e9)]);const _0x26f98e=await withSpinner(_0x22de1b(0x13f)+_0x1e423f+_0x22de1b(0xce),()=>_0x2809e6['personalization'][_0x22de1b(0xdb)](_0x12cf5f,_0x1e423f,_0x57b36f),{'verbose':_0x2899ff[_0x22de1b(0x267)]}),_0x1f9a91=_0x26f98e[_0x22de1b(0xc5)];return console[_0x22de1b(0x159)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x1f9a91[_0x22de1b(0x1a4)]+'\x27'),await handleSDKOutput([_0x1f9a91],_0x2899ff),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]='ps:pz:service:token:create';['description']=a32_0x80eef0(0x146);async[a32_0x80eef0(0x136)](_0xaf2edd){const _0x2fae52=a32_0x80eef0,{options:_0x3d6898,args:_0x309e17,tdx:_0x550479}=_0xaf2edd,_0x2e8dc9=_0x3d6898,_0x2d4538=_0x309e17[0x0],_0x8a2ab0=_0x309e17[0x1],_0x45471c=_0x309e17[0x2]||_0x3d6898[_0x2fae52(0x280)];if(!_0x2d4538)return console['error'](_0x2fae52(0x1eb)),console[_0x2fae52(0x159)](_0x2fae52(0x1ac)),console[_0x2fae52(0x159)](_0x2fae52(0x23a)),0x1;if(!_0x8a2ab0)return console[_0x2fae52(0x159)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x2fae52(0x159)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x2fae52(0x159)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x45471c)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+_0x2fae52(0x23a)),0x1;const _0x16eb3e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x45471c+_0x2fae52(0xce),()=>_0x550479['segment'][_0x2fae52(0xc2)](_0x45471c),{'verbose':_0x3d6898[_0x2fae52(0x267)]}),_0x2c28ab=_0x16eb3e['data'],_0xb67e0b={'name':_0x2d4538};_0x2e8dc9[_0x2fae52(0x259)]&&(_0xb67e0b[_0x2fae52(0x259)]=_0x2e8dc9[_0x2fae52(0x259)][_0x2fae52(0x249)](',')[_0x2fae52(0x1d7)](_0x2c8a73=>_0x2c8a73['trim']()));_0x2e8dc9[_0x2fae52(0x1e9)]&&(_0xb67e0b[_0x2fae52(0x1e9)]=_0x2e8dc9[_0x2fae52(0x1e9)]);const _0x2864e1=await withSpinner('Creating\x20token\x20\x27'+_0x2d4538+_0x2fae52(0x254)+_0x8a2ab0+_0x2fae52(0xce),()=>_0x550479['personalization']['createToken'](_0x2c28ab,_0x8a2ab0,_0xb67e0b),{'verbose':_0x3d6898[_0x2fae52(0x267)]}),_0x126e89=_0x2864e1[_0x2fae52(0xc5)];return console[_0x2fae52(0x159)](_0x2fae52(0xa8)+_0x126e89[_0x2fae52(0x1a4)]+_0x2fae52(0x250)+_0x126e89['id']),_0x126e89[_0x2fae52(0x20f)]&&(console['error'](a32_0x2144bc[_0x2fae52(0x28f)](_0x2fae52(0x25c))),console['error'](a32_0x2144bc[_0x2fae52(0x26d)](_0x126e89[_0x2fae52(0x20f)])),console[_0x2fae52(0x159)]('')),await handleSDKOutput([_0x126e89],_0x3d6898),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0x1f5);[a32_0x80eef0(0x1e9)]='Delete\x20a\x20token\x20from\x20a\x20personalization\x20service';async[a32_0x80eef0(0x136)](_0x18d458){const _0x1eff45=a32_0x80eef0,{options:_0x1bd2b7,args:_0x28e5f1,tdx:_0x57fcf8}=_0x18d458,_0x71465b=_0x28e5f1[0x0],_0x40e7d0=_0x28e5f1[0x1]||_0x1bd2b7[_0x1eff45(0x280)];if(!_0x71465b)return console[_0x1eff45(0x159)](_0x1eff45(0xf6)),console['error'](_0x1eff45(0x180)),console[_0x1eff45(0x159)](_0x1eff45(0x26e)),0x1;if(!_0x40e7d0)return showParentSegmentNotSetError(_0x1eff45(0xd4)+_0x1eff45(0x26e)),0x1;const _0x3d8b40=await withSpinner(_0x1eff45(0x18e)+_0x40e7d0+'\x27...',()=>_0x57fcf8['segment']['resolveParentId'](_0x40e7d0),{'verbose':_0x1bd2b7[_0x1eff45(0x267)]}),_0x43cdf6=_0x3d8b40[_0x1eff45(0xc5)],_0x1c1a92=await withSpinner('Finding\x20service\x20for\x20token...',()=>_0x57fcf8[_0x1eff45(0x260)][_0x1eff45(0x1e3)](_0x43cdf6),{'verbose':_0x1bd2b7[_0x1eff45(0x267)]}),_0x5633c9=_0x1c1a92['data'];let _0x3df4e6;for(const _0x29e5ca of _0x5633c9){if(_0x29e5ca[_0x1eff45(0x148)]?.[_0x1eff45(0x20e)](_0x4196f9=>_0x4196f9['id']===_0x71465b)){_0x3df4e6=_0x29e5ca['id'];break;}}if(!_0x3df4e6)return console[_0x1eff45(0x159)](_0x1eff45(0x1ea)+_0x71465b+'\x27\x20not\x20found\x20in\x20any\x20personalization\x20service'),0x1;const _0x289222=await withSpinner(_0x1eff45(0xc6)+_0x71465b+_0x1eff45(0xce),()=>_0x57fcf8[_0x1eff45(0x260)][_0x1eff45(0x1e2)](_0x43cdf6,_0x3df4e6,_0x71465b),{'verbose':_0x1bd2b7[_0x1eff45(0x267)]}),_0x5e9097=_0x289222['data'];return console[_0x1eff45(0x159)](_0x1eff45(0xc3)+(_0x5e9097[_0x1eff45(0x1a4)]||_0x71465b)+'\x27'),await handleSDKOutput([_0x5e9097],_0x1bd2b7),0x0;}}export class PSPzListCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]='ps:pz:list';['description']=a32_0x80eef0(0x11f);async[a32_0x80eef0(0x136)](_0x792662){const _0x3cc025=a32_0x80eef0,{options:_0x8c2f56,args:_0x20c35d,tdx:_0x3a9f75}=_0x792662,_0x2d5dfc=_0x20c35d[0x0]||_0x8c2f56['parentSegment'];if(!_0x2d5dfc)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment'),0x1;const _0x5725c1=await withSpinner(_0x3cc025(0x18e)+_0x2d5dfc+_0x3cc025(0xce),()=>_0x3a9f75['segment']['resolveParentId'](_0x2d5dfc),{'verbose':_0x8c2f56[_0x3cc025(0x267)]}),_0x2171d6=_0x5725c1[_0x3cc025(0xc5)],_0x2f5eca=await withSpinner(_0x3cc025(0x1f3)+_0x2d5dfc+_0x3cc025(0xce),()=>_0x3a9f75[_0x3cc025(0x260)][_0x3cc025(0xa1)](_0x2171d6),{'verbose':_0x8c2f56[_0x3cc025(0x267)]}),_0x475a61=_0x2f5eca['data'];console[_0x3cc025(0x159)]('✔\x20Found\x20'+_0x475a61[_0x3cc025(0x153)]+_0x3cc025(0x24b)+(_0x475a61['length']!==0x1?'s':''));if(_0x8c2f56[_0x3cc025(0x257)]==='json'||_0x8c2f56['format']===_0x3cc025(0x167))await handleSDKOutput(_0x475a61,_0x8c2f56);else{if(_0x475a61['length']===0x0)console['log'](_0x3cc025(0x10d));else for(const _0x4a4a62 of _0x475a61){console[_0x3cc025(0x115)](a32_0x2144bc[_0x3cc025(0x100)](_0x4a4a62[_0x3cc025(0x1a4)])+'\x20'+a32_0x2144bc[_0x3cc025(0x99)]('(id:\x20'+_0x4a4a62['id']+')'));_0x4a4a62[_0x3cc025(0x1e9)]&&console['log']('\x20\x20'+a32_0x2144bc['dim'](_0x4a4a62[_0x3cc025(0x1e9)]));const _0x1e20f4=_0x4a4a62['sections']?.[_0x3cc025(0x153)]||0x0;console[_0x3cc025(0x115)]('\x20\x20'+a32_0x2144bc[_0x3cc025(0x26d)](_0x3cc025(0x1d8))+'\x20'+_0x1e20f4);if(_0x4a4a62[_0x3cc025(0x255)]&&_0x4a4a62[_0x3cc025(0x255)][_0x3cc025(0x153)]>0x0)for(const _0x16c472 of _0x4a4a62[_0x3cc025(0x255)]){console[_0x3cc025(0x115)]('\x20\x20\x20\x20-\x20'+_0x16c472[_0x3cc025(0x1a4)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0xb4);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x15a);async[a32_0x80eef0(0x136)](_0x183230){const _0x411fa6=a32_0x80eef0,{options:_0x5dfa49,args:_0x34b7f8,tdx:_0x565674}=_0x183230,_0x4b50e4=_0x34b7f8[0x0];if(!_0x4b50e4)return console[_0x411fa6(0x159)](_0x411fa6(0x294)),console[_0x411fa6(0x159)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x5e3e3b=await withSpinner(_0x411fa6(0x129)+_0x4b50e4+_0x411fa6(0xce),()=>_0x565674[_0x411fa6(0x260)]['getPersonalization'](_0x4b50e4),{'verbose':_0x5dfa49['verbose']}),_0x23bdec=_0x5e3e3b[_0x411fa6(0xc5)];console[_0x411fa6(0x159)](_0x411fa6(0x19a)+_0x23bdec[_0x411fa6(0x1a4)]+'\x27');if(_0x5dfa49[_0x411fa6(0x257)]==='json'||_0x5dfa49[_0x411fa6(0x257)]===_0x411fa6(0x167))await handleSDKOutput([_0x23bdec],_0x5dfa49);else{console[_0x411fa6(0x115)](a32_0x2144bc[_0x411fa6(0x100)](_0x23bdec[_0x411fa6(0x1a4)])+'\x20'+a32_0x2144bc[_0x411fa6(0x99)]('(id:\x20'+_0x23bdec['id']+')'));_0x23bdec['description']&&console['log']('\x20\x20'+a32_0x2144bc['dim'](_0x23bdec[_0x411fa6(0x1e9)]));_0x23bdec[_0x411fa6(0xc8)]&&console['log']('\x20\x20'+a32_0x2144bc[_0x411fa6(0x26d)](_0x411fa6(0x223))+'\x20'+_0x23bdec[_0x411fa6(0xc8)]);console[_0x411fa6(0x115)]('\x20\x20'+a32_0x2144bc[_0x411fa6(0x26d)](_0x411fa6(0x22b))+'\x20'+_0x23bdec[_0x411fa6(0xf5)]),console['log']('\x20\x20'+a32_0x2144bc[_0x411fa6(0x26d)](_0x411fa6(0x135))+'\x20'+_0x23bdec[_0x411fa6(0x25e)]);const _0x5ec1c8=_0x23bdec['sections']?.['length']||0x0;console[_0x411fa6(0x115)]('\x20\x20'+a32_0x2144bc[_0x411fa6(0x26d)](_0x411fa6(0x1d8))+'\x20'+_0x5ec1c8);if(_0x23bdec[_0x411fa6(0x255)]&&_0x23bdec['sections'][_0x411fa6(0x153)]>0x0)for(const _0x3c0118 of _0x23bdec['sections']){console[_0x411fa6(0x115)]('\x20\x20\x20\x20'+a32_0x2144bc[_0x411fa6(0x100)](_0x3c0118[_0x411fa6(0x1a4)])+'\x20'+a32_0x2144bc[_0x411fa6(0x99)](_0x411fa6(0x10f)+_0x3c0118['id']+')')),_0x3c0118['entryCriteria']&&(console[_0x411fa6(0x115)](_0x411fa6(0x188)+a32_0x2144bc['cyan'](_0x411fa6(0x19b))+'\x20'+_0x3c0118[_0x411fa6(0x232)][_0x411fa6(0x1a4)]),_0x3c0118[_0x411fa6(0x232)][_0x411fa6(0x1ad)]?.[_0x411fa6(0xe1)]&&console['log'](_0x411fa6(0xae)+a32_0x2144bc[_0x411fa6(0x26d)](_0x411fa6(0xd8))+'\x20'+_0x3c0118[_0x411fa6(0x232)][_0x411fa6(0x1ad)][_0x411fa6(0xe1)])),_0x3c0118['payload']&&console['log'](_0x411fa6(0x188)+a32_0x2144bc[_0x411fa6(0x26d)]('payload:')+'\x20'+JSON[_0x411fa6(0x258)](_0x3c0118[_0x411fa6(0x1c0)])),_0x3c0118[_0x411fa6(0x17b)]&&console[_0x411fa6(0x115)](_0x411fa6(0x188)+a32_0x2144bc['cyan'](_0x411fa6(0x28c))+_0x411fa6(0xa7));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{['name']=a32_0x80eef0(0x9d);[a32_0x80eef0(0x1e9)]='Delete\x20a\x20realtime\x20personalization';async[a32_0x80eef0(0x136)](_0xa0257a){const _0x1f8ca1=a32_0x80eef0,{options:_0x53f232,args:_0xf36cec,tdx:_0x13f029}=_0xa0257a,_0x33d09e=_0xf36cec[0x0];if(!_0x33d09e)return console[_0x1f8ca1(0x159)](_0x1f8ca1(0x294)),console[_0x1f8ca1(0x159)]('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x1f8ca1(0xcf)+_0x33d09e+_0x1f8ca1(0xce),()=>_0x13f029[_0x1f8ca1(0x260)][_0x1f8ca1(0x1f0)](_0x33d09e),{'verbose':_0x53f232['verbose']}),console[_0x1f8ca1(0x159)](_0x1f8ca1(0x1b8)+_0x33d09e+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]='ps:pz:create';[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x24a);async[a32_0x80eef0(0x136)](_0x1b5fdc){const _0x5cdc01=a32_0x80eef0,{options:_0x1d3e5f,tdx:_0x3a8d86}=_0x1b5fdc,_0x491a9a=_0x1d3e5f;let _0x347cec;if(_0x491a9a['file']){_0x347cec=await loadJSON(_0x491a9a['file'],!![]);if(!_0x347cec['relationships']?.[_0x5cdc01(0x14f)])return console[_0x5cdc01(0x159)](_0x5cdc01(0x189)),console[_0x5cdc01(0x159)](_0x5cdc01(0x1d1)),console[_0x5cdc01(0x159)](_0x5cdc01(0x102)),0x1;}else{if(!_0x491a9a[_0x5cdc01(0x1a4)])return console[_0x5cdc01(0x159)](_0x5cdc01(0xbf)),console[_0x5cdc01(0x159)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x5cdc01(0x159)](_0x5cdc01(0x143)),0x1;if(_0x491a9a[_0x5cdc01(0x1e9)]===undefined)return console[_0x5cdc01(0x159)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x5cdc01(0x159)](_0x5cdc01(0xe8)),console[_0x5cdc01(0x159)](_0x5cdc01(0x143)),0x1;if(_0x491a9a[_0x5cdc01(0x209)]===undefined)return console[_0x5cdc01(0x159)]('Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.'),console[_0x5cdc01(0x159)]('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x24676c=_0x491a9a[_0x5cdc01(0xc8)];if(!_0x24676c&&_0x1d3e5f[_0x5cdc01(0x280)]){const _0x5c18e0=await withSpinner(_0x5cdc01(0x18e)+_0x1d3e5f[_0x5cdc01(0x280)]+'\x27...',()=>_0x3a8d86['segment']['resolveParentId'](_0x1d3e5f[_0x5cdc01(0x280)]),{'verbose':_0x1d3e5f[_0x5cdc01(0x267)]});_0x24676c=_0x5c18e0[_0x5cdc01(0xc5)];}let _0x30e8f4;_0x491a9a[_0x5cdc01(0x255)]&&(_0x30e8f4=await loadJSON(_0x491a9a[_0x5cdc01(0x255)],![]));const _0x35b665=_0x491a9a[_0x5cdc01(0x209)]===_0x5cdc01(0x27c)?null:{'id':_0x491a9a[_0x5cdc01(0x209)],'type':'folder-segment'};_0x347cec={'attributes':{'name':_0x491a9a[_0x5cdc01(0x1a4)],'description':_0x491a9a[_0x5cdc01(0x1e9)]||null,..._0x24676c!==undefined&&{'audienceId':_0x24676c},..._0x30e8f4!==undefined&&{'sections':_0x30e8f4}},'relationships':{'parentFolder':{'data':_0x35b665}}};}const _0x2ad970=await withSpinner(_0x5cdc01(0x16c)+(_0x347cec[_0x5cdc01(0x275)]?.[_0x5cdc01(0x1a4)]??'')+_0x5cdc01(0xce),()=>_0x3a8d86[_0x5cdc01(0x260)][_0x5cdc01(0xfc)](_0x347cec),{'verbose':_0x1d3e5f[_0x5cdc01(0x267)]}),_0x2e55d7=_0x2ad970['data'];return console[_0x5cdc01(0x159)]('✔\x20Created\x20personalization\x20\x27'+_0x2e55d7[_0x5cdc01(0x1a4)]+_0x5cdc01(0x250)+_0x2e55d7['id']),await handleSDKOutput([_0x2e55d7],_0x1d3e5f),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a32_0x80eef0(0x1a4)]=a32_0x80eef0(0x158);[a32_0x80eef0(0x1e9)]=a32_0x80eef0(0x190);async[a32_0x80eef0(0x136)](_0x1bfa3b){const _0x50ab61=a32_0x80eef0,{options:_0x3b1d97,args:_0x1316e0}=_0x1bfa3b,_0x3c8dec=_0x3b1d97,_0x34b03b=_0x1316e0[0x0];if(!_0x34b03b)return console['error']('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x50ab61(0x159)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0x50ab61(0x159)](_0x50ab61(0x216)),0x1;let _0xf65450;if(_0x3c8dec[_0x50ab61(0x163)])_0xf65450=await loadJSON(_0x3c8dec['file'],!![]);else{if(!_0x3c8dec[_0x50ab61(0x1a4)])return console['error'](_0x50ab61(0xbf)),console[_0x50ab61(0x159)](_0x50ab61(0x141)),0x1;if(_0x3c8dec['description']===undefined)return console[_0x50ab61(0x159)](_0x50ab61(0xe0)),console['error'](_0x50ab61(0x141)),0x1;let _0x2df76e;_0x3c8dec[_0x50ab61(0x255)]&&(_0x2df76e=await loadJSON(_0x3c8dec['sections'],![])),_0xf65450={'attributes':{'name':_0x3c8dec[_0x50ab61(0x1a4)],'description':_0x3c8dec[_0x50ab61(0x1e9)]||null,..._0x2df76e!==undefined&&{'sections':_0x2df76e}}};}const {tdx:_0x1b87c4}=_0x1bfa3b,_0x457deb=await withSpinner(_0x50ab61(0x1b9)+_0x34b03b+_0x50ab61(0xce),()=>_0x1b87c4[_0x50ab61(0x260)][_0x50ab61(0x18a)](_0x34b03b,_0xf65450),{'verbose':_0x3b1d97[_0x50ab61(0x267)]}),_0x274fef=_0x457deb[_0x50ab61(0xc5)];return console[_0x50ab61(0x159)]('✔\x20Updated\x20personalization\x20\x27'+_0x274fef[_0x50ab61(0x1a4)]+_0x50ab61(0x124)+_0x274fef['id']+')'),await handleSDKOutput([_0x274fef],_0x3b1d97),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a32_0x80eef0(0x1a4)]='ps:pz:init';[a32_0x80eef0(0x1e9)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a32_0x80eef0(0x136)](_0x5efaf7){const _0x48fd7b=a32_0x80eef0,{options:_0x5ec85b,args:_0x4edd7e}=_0x5efaf7,_0x3b9e5f=_0x4edd7e[0x0]||_0x5ec85b[_0x48fd7b(0x280)];if(!_0x3b9e5f)return showParentSegmentNotSetError(_0x48fd7b(0x20d)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment'),0x1;const _0x57b104=resolveYamlFile(_0x3b9e5f);if(!existsSync(_0x57b104))return showFileNotFoundError(_0x57b104,_0x3b9e5f),0x1;let _0x21c5ae;try{_0x21c5ae=readFileSync(_0x57b104,_0x48fd7b(0x154));}catch(_0x3b4ce6){const _0x3eae5e=_0x3b4ce6 instanceof Error?_0x3b4ce6['message']:String(_0x3b4ce6);return console[_0x48fd7b(0x159)](_0x48fd7b(0x123)+_0x3eae5e),0x1;}let _0x4fa0da;try{_0x4fa0da=parseDef(_0x21c5ae);}catch(_0x3785a5){const _0x541125=_0x3785a5 instanceof Error?_0x3785a5[_0x48fd7b(0x214)]:String(_0x3785a5);return console[_0x48fd7b(0x159)](a32_0x2144bc['red'](_0x48fd7b(0x224)+_0x541125)),0x1;}if(_0x4fa0da[_0x48fd7b(0x29c)]&&_0x4fa0da[_0x48fd7b(0x29c)][_0x48fd7b(0x153)]>0x0)return console['error'](a32_0x2144bc['yellow'](_0x48fd7b(0x191)+_0x57b104)),console[_0x48fd7b(0x159)](a32_0x2144bc['dim']('\x20\x20\x20'+_0x4fa0da[_0x48fd7b(0x29c)]['length']+_0x48fd7b(0xbc))),0x1;!_0x4fa0da[_0x48fd7b(0x1c6)]&&(_0x4fa0da['realtime']={'events':[{'name':_0x48fd7b(0x9a),'source_table':_0x48fd7b(0x103)}],'attributes':[{'name':_0x48fd7b(0x277),'type':_0x48fd7b(0x177)}],'id_stitching':{'primary_key':_0x4fa0da[_0x48fd7b(0x156)][_0x48fd7b(0x1e6)]==='customers'?_0x48fd7b(0x1fd):_0x48fd7b(0x1a7)}});_0x4fa0da['personalization_services']=[{'name':'My\x20Service','description':'Personalization\x20service\x20description','trigger_event':_0x48fd7b(0x9a),'sections':[{'name':_0x48fd7b(0x230),'criteria':'true','attributes':[_0x48fd7b(0x277)]}]}];const _0x2e2980=serializeDef(_0x4fa0da);return writeFileSync(_0x57b104,_0x2e2980,'utf-8'),console[_0x48fd7b(0x159)](a32_0x2144bc[_0x48fd7b(0x246)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a32_0x2144bc[_0x48fd7b(0x26d)](_0x57b104)),(!_0x4fa0da['realtime']||_0x21c5ae['indexOf'](_0x48fd7b(0x127))===-0x1)&&console['error'](a32_0x2144bc[_0x48fd7b(0x246)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x48fd7b(0x159)]('\x0a'+a32_0x2144bc[_0x48fd7b(0x99)](_0x48fd7b(0x274))),console['error'](_0x48fd7b(0x1d9)+_0x57b104+'\x20to\x20configure\x20your\x20personalization\x20service'),console['error']('\x20\x202.\x20Run\x20'+a32_0x2144bc[_0x48fd7b(0x99)](_0x48fd7b(0xe4)+_0x3b9e5f)+_0x48fd7b(0xff)),0x0;}}