@treasuredata/tdx 2026.3.29 → 2026.3.31

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 (268) 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.d.ts.map +1 -1
  5. package/dist/cli-categories.js +1 -1
  6. package/dist/cli-categories.js.map +1 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/activations.js +1 -1
  11. package/dist/commands/agent-command.js +1 -1
  12. package/dist/commands/agent-test-command.js +1 -1
  13. package/dist/commands/api-command.js +1 -1
  14. package/dist/commands/api-command.js.map +1 -1
  15. package/dist/commands/auth-command.js +1 -1
  16. package/dist/commands/auth-login-command.js +1 -1
  17. package/dist/commands/cas-command.d.ts +55 -0
  18. package/dist/commands/cas-command.d.ts.map +1 -0
  19. package/dist/commands/cas-command.js +1 -0
  20. package/dist/commands/cas-command.js.map +1 -0
  21. package/dist/commands/cas-segment-command.d.ts +18 -0
  22. package/dist/commands/cas-segment-command.d.ts.map +1 -0
  23. package/dist/commands/cas-segment-command.js +1 -0
  24. package/dist/commands/cas-segment-command.js.map +1 -0
  25. package/dist/commands/chat-command.js +1 -1
  26. package/dist/commands/claude-command.js +1 -1
  27. package/dist/commands/claude-statusline-command.js +1 -1
  28. package/dist/commands/claude-usage-command.js +1 -1
  29. package/dist/commands/command.js +1 -1
  30. package/dist/commands/connection-command.js +1 -1
  31. package/dist/commands/databases.js +1 -1
  32. package/dist/commands/delivery-command.js +1 -1
  33. package/dist/commands/describe.js +1 -1
  34. package/dist/commands/engage-campaign-pull-command.js +1 -1
  35. package/dist/commands/engage-campaign-push-command.js +1 -1
  36. package/dist/commands/engage-campaign-validate-command.js +1 -1
  37. package/dist/commands/engage-command.js +1 -1
  38. package/dist/commands/engage-template-pull-command.js +1 -1
  39. package/dist/commands/engage-template-push-command.js +1 -1
  40. package/dist/commands/engage-template-validate-command.js +1 -1
  41. package/dist/commands/job-command.js +1 -1
  42. package/dist/commands/journey-command.js +1 -1
  43. package/dist/commands/journey-validate-command.js +1 -1
  44. package/dist/commands/llm-command.js +1 -1
  45. package/dist/commands/mcp-command.js +1 -1
  46. package/dist/commands/parent-segment-command.js +1 -1
  47. package/dist/commands/policy-command.js +1 -1
  48. package/dist/commands/profile-command.js +1 -1
  49. package/dist/commands/profiles-command.js +1 -1
  50. package/dist/commands/query-command.js +1 -1
  51. package/dist/commands/schedule-command.js +1 -1
  52. package/dist/commands/segment-command.js +1 -1
  53. package/dist/commands/segment-create-command.js +1 -1
  54. package/dist/commands/segment-fields-command.js +1 -1
  55. package/dist/commands/segment-pull-command.js +1 -1
  56. package/dist/commands/segment-push-command.js +1 -1
  57. package/dist/commands/segment-update-command.js +1 -1
  58. package/dist/commands/segment-use-command.js +1 -1
  59. package/dist/commands/segment-validate-command.js +1 -1
  60. package/dist/commands/segments.js +1 -1
  61. package/dist/commands/show.js +1 -1
  62. package/dist/commands/status-command.js +1 -1
  63. package/dist/commands/tables.js +1 -1
  64. package/dist/commands/unset-command.d.ts.map +1 -1
  65. package/dist/commands/unset-command.js +1 -1
  66. package/dist/commands/unset-command.js.map +1 -1
  67. package/dist/commands/upgrade-command.js +1 -1
  68. package/dist/commands/use-command.d.ts.map +1 -1
  69. package/dist/commands/use-command.js +1 -1
  70. package/dist/commands/use-command.js.map +1 -1
  71. package/dist/commands/user-command.js +1 -1
  72. package/dist/commands/workflow-command.js +1 -1
  73. package/dist/core/auth.js +1 -1
  74. package/dist/core/command-output.js +1 -1
  75. package/dist/core/config.js +1 -1
  76. package/dist/core/connection-cache.js +1 -1
  77. package/dist/core/constants.js +1 -1
  78. package/dist/core/credential-cache.js +1 -1
  79. package/dist/core/global-context.d.ts +1 -0
  80. package/dist/core/global-context.d.ts.map +1 -1
  81. package/dist/core/global-context.js +1 -1
  82. package/dist/core/global-context.js.map +1 -1
  83. package/dist/core/keychain.js +1 -1
  84. package/dist/core/oauth-keychain.js +1 -1
  85. package/dist/core/oauth.js +1 -1
  86. package/dist/core/profile.js +1 -1
  87. package/dist/core/project-config.js +1 -1
  88. package/dist/core/session.d.ts +2 -1
  89. package/dist/core/session.d.ts.map +1 -1
  90. package/dist/core/session.js +1 -1
  91. package/dist/core/session.js.map +1 -1
  92. package/dist/core/user-cache.js +1 -1
  93. package/dist/core/version.js +1 -1
  94. package/dist/index.js +1 -1
  95. package/dist/mcp/server.js +1 -1
  96. package/dist/mcp/tools/index.js +1 -1
  97. package/dist/mcp/tools/tdx-run.js +1 -1
  98. package/dist/mcp/tools/tdx-search.js +1 -1
  99. package/dist/mcp/utils.js +1 -1
  100. package/dist/proxy/claude-usage-tracker.js +1 -1
  101. package/dist/proxy/passthrough-server.js +1 -1
  102. package/dist/proxy/sse-usage-parser.js +1 -1
  103. package/dist/sdk/agent/agent-config.js +1 -1
  104. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  105. package/dist/sdk/agent/agent-yaml.js +1 -1
  106. package/dist/sdk/agent/test/evaluator.js +1 -1
  107. package/dist/sdk/agent/test/executor.js +1 -1
  108. package/dist/sdk/agent/test/index.js +1 -1
  109. package/dist/sdk/agent/test/output.js +1 -1
  110. package/dist/sdk/agent/test/parser.js +1 -1
  111. package/dist/sdk/agent/tool-target-registry.js +1 -1
  112. package/dist/sdk/api.js +1 -1
  113. package/dist/sdk/cas/cas-api-client.d.ts +77 -0
  114. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -0
  115. package/dist/sdk/cas/cas-api-client.js +1 -0
  116. package/dist/sdk/cas/cas-api-client.js.map +1 -0
  117. package/dist/sdk/cas/cas-audience-yaml.d.ts +32 -0
  118. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -0
  119. package/dist/sdk/cas/cas-audience-yaml.js +1 -0
  120. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -0
  121. package/dist/sdk/cas/cas-segment-yaml.d.ts +38 -0
  122. package/dist/sdk/cas/cas-segment-yaml.d.ts.map +1 -0
  123. package/dist/sdk/cas/cas-segment-yaml.js +1 -0
  124. package/dist/sdk/cas/cas-segment-yaml.js.map +1 -0
  125. package/dist/sdk/cas/index.d.ts +61 -0
  126. package/dist/sdk/cas/index.d.ts.map +1 -0
  127. package/dist/sdk/cas/index.js +1 -0
  128. package/dist/sdk/cas/index.js.map +1 -0
  129. package/dist/sdk/cas/pull-workflow.d.ts +53 -0
  130. package/dist/sdk/cas/pull-workflow.d.ts.map +1 -0
  131. package/dist/sdk/cas/pull-workflow.js +1 -0
  132. package/dist/sdk/cas/pull-workflow.js.map +1 -0
  133. package/dist/sdk/cas/push-workflow.d.ts +50 -0
  134. package/dist/sdk/cas/push-workflow.d.ts.map +1 -0
  135. package/dist/sdk/cas/push-workflow.js +1 -0
  136. package/dist/sdk/cas/push-workflow.js.map +1 -0
  137. package/dist/sdk/cas/types.d.ts +115 -0
  138. package/dist/sdk/cas/types.d.ts.map +1 -0
  139. package/dist/sdk/cas/types.js +1 -0
  140. package/dist/sdk/cas/types.js.map +1 -0
  141. package/dist/sdk/client/cdp-api-client.js +1 -1
  142. package/dist/sdk/client/delivery-api-client.js +1 -1
  143. package/dist/sdk/client/endpoints.d.ts +4 -0
  144. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  145. package/dist/sdk/client/endpoints.js +1 -1
  146. package/dist/sdk/client/endpoints.js.map +1 -1
  147. package/dist/sdk/client/engage-api-client.js +1 -1
  148. package/dist/sdk/client/http-client.js +1 -1
  149. package/dist/sdk/client/llm-api-client.js +1 -1
  150. package/dist/sdk/client/oauth-refresh.js +1 -1
  151. package/dist/sdk/client/rate-limiter.js +1 -1
  152. package/dist/sdk/client/td-api-client.js +1 -1
  153. package/dist/sdk/client/trino-api-client.js +1 -1
  154. package/dist/sdk/client/workflow-client.js +1 -1
  155. package/dist/sdk/connection-validator.js +1 -1
  156. package/dist/sdk/connection.js +1 -1
  157. package/dist/sdk/delivery.js +1 -1
  158. package/dist/sdk/engage/campaign-pull.js +1 -1
  159. package/dist/sdk/engage/campaign-push.js +1 -1
  160. package/dist/sdk/engage/campaign-validator.js +1 -1
  161. package/dist/sdk/engage/campaign-yaml.js +1 -1
  162. package/dist/sdk/engage/template-pull.js +1 -1
  163. package/dist/sdk/engage/template-push.js +1 -1
  164. package/dist/sdk/engage/template-validator.js +1 -1
  165. package/dist/sdk/engage/template-yaml.js +1 -1
  166. package/dist/sdk/engage/types/campaign-def.js +1 -1
  167. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  168. package/dist/sdk/engage/types/template-schema.js +1 -1
  169. package/dist/sdk/engage.js +1 -1
  170. package/dist/sdk/errors.js +1 -1
  171. package/dist/sdk/index.d.ts +6 -0
  172. package/dist/sdk/index.d.ts.map +1 -1
  173. package/dist/sdk/index.js +1 -1
  174. package/dist/sdk/index.js.map +1 -1
  175. package/dist/sdk/io/index.js +1 -1
  176. package/dist/sdk/io/node-filesystem.js +1 -1
  177. package/dist/sdk/job.js +1 -1
  178. package/dist/sdk/journey.js +1 -1
  179. package/dist/sdk/llm/chat-cache.js +1 -1
  180. package/dist/sdk/llm/index.js +1 -1
  181. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  182. package/dist/sdk/llm/model-factors.js +1 -1
  183. package/dist/sdk/personalization.js +1 -1
  184. package/dist/sdk/policy.js +1 -1
  185. package/dist/sdk/query/index.js +1 -1
  186. package/dist/sdk/query/sql-parser.js +1 -1
  187. package/dist/sdk/realtime.js +1 -1
  188. package/dist/sdk/schedule.js +1 -1
  189. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  190. package/dist/sdk/segment/fields-display.js +1 -1
  191. package/dist/sdk/segment/file-discovery.js +1 -1
  192. package/dist/sdk/segment/journey-utils.js +1 -1
  193. package/dist/sdk/segment/journey-validator.js +1 -1
  194. package/dist/sdk/segment/journey-yaml.js +1 -1
  195. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  196. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  197. package/dist/sdk/segment/pull-workflow.js +1 -1
  198. package/dist/sdk/segment/push-recovery.js +1 -1
  199. package/dist/sdk/segment/push-workflow.js +1 -1
  200. package/dist/sdk/segment/resolution-context.js +1 -1
  201. package/dist/sdk/segment/segment-path-parser.js +1 -1
  202. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  203. package/dist/sdk/segment/segment-validator.js +1 -1
  204. package/dist/sdk/segment/target-resolution.js +1 -1
  205. package/dist/sdk/segment/tdx-config.js +1 -1
  206. package/dist/sdk/segment/types/activation-schema.js +1 -1
  207. package/dist/sdk/segment/types/journey-def.js +1 -1
  208. package/dist/sdk/segment/types/journey-schema.js +1 -1
  209. package/dist/sdk/segment/types/segment-def.js +1 -1
  210. package/dist/sdk/segment/types/segment-schema.js +1 -1
  211. package/dist/sdk/segment/validate-files.js +1 -1
  212. package/dist/sdk/segment/yaml-validator.js +1 -1
  213. package/dist/sdk/segment.js +1 -1
  214. package/dist/sdk/types/cas.d.ts +242 -0
  215. package/dist/sdk/types/cas.d.ts.map +1 -0
  216. package/dist/sdk/types/cas.js +1 -0
  217. package/dist/sdk/types/cas.js.map +1 -0
  218. package/dist/sdk/types/index.d.ts +3 -1
  219. package/dist/sdk/types/index.d.ts.map +1 -1
  220. package/dist/sdk/types/index.js +1 -1
  221. package/dist/sdk/types/index.js.map +1 -1
  222. package/dist/sdk/types/progress.js +1 -1
  223. package/dist/sdk/user.js +1 -1
  224. package/dist/sdk/util/format-detector.js +1 -1
  225. package/dist/sdk/util/formatters.js +1 -1
  226. package/dist/sdk/util/index.js +1 -1
  227. package/dist/sdk/util/paginate.js +1 -1
  228. package/dist/sdk/util/tree-formatter.js +1 -1
  229. package/dist/sdk/workflow/archive-validation.js +1 -1
  230. package/dist/sdk/workflow/clone-workflow.js +1 -1
  231. package/dist/sdk/workflow/index.js +1 -1
  232. package/dist/sdk/workflow/pull-workflow.js +1 -1
  233. package/dist/sdk/workflow/push-workflow.js +1 -1
  234. package/dist/sdk/workflow/tdx-config.js +1 -1
  235. package/dist/sdk/workflow/workflow-utils.js +1 -1
  236. package/dist/test-utils/command-runner.js +1 -1
  237. package/dist/test-utils/factories.js +1 -1
  238. package/dist/test-utils/fixtures.js +1 -1
  239. package/dist/test-utils/http-mock.js +1 -1
  240. package/dist/test-utils/index.js +1 -1
  241. package/dist/utils/async.js +1 -1
  242. package/dist/utils/colors.js +1 -1
  243. package/dist/utils/diff.js +1 -1
  244. package/dist/utils/file-permissions.js +1 -1
  245. package/dist/utils/file-reader.js +1 -1
  246. package/dist/utils/github-releases.js +1 -1
  247. package/dist/utils/global-cache.js +1 -1
  248. package/dist/utils/json-loader.js +1 -1
  249. package/dist/utils/local-cache.js +1 -1
  250. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  251. package/dist/utils/logger/formatters/index.js +1 -1
  252. package/dist/utils/logger/handlers/console-handler.js +1 -1
  253. package/dist/utils/logger/handlers/file-handler.js +1 -1
  254. package/dist/utils/logger/handlers/index.js +1 -1
  255. package/dist/utils/logger/handlers/null-handler.js +1 -1
  256. package/dist/utils/logger/index.js +1 -1
  257. package/dist/utils/logger/logger.js +1 -1
  258. package/dist/utils/logger/types.js +1 -1
  259. package/dist/utils/option-validation.js +1 -1
  260. package/dist/utils/process.js +1 -1
  261. package/dist/utils/prompt.js +1 -1
  262. package/dist/utils/spinner.js +1 -1
  263. package/dist/utils/sse-parser.js +1 -1
  264. package/dist/utils/string-utils.js +1 -1
  265. package/dist/utils/table-ref-parser.js +1 -1
  266. package/dist/utils/tdx-logger.js +1 -1
  267. package/dist/utils/version-check.js +1 -1
  268. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x41ba90=a30_0x49a8;function a30_0x2fc6(){const _0x4ec9ad=['realtime_enabled','segment','displayMasterInfo','createParent','Pattern:\x20','ps:pz:show','Error:\x20Token\x20name\x20is\x20required','Personalization:','displaySampleData','listJourneys','To\x20view\x20sample\x20data:','\x20rows\x20','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','ps:pz:service:show','\x20\x20Note:\x20','142986LfMcfq','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','utf-8','previewParentYaml','folderId','tokens','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','displayPreviewResults','\x20to\x20push\x20the\x20configuration','segment:parent:sql','No\x20parent\x20segments\x20found','addBehaviorsFile','sort','stop','repeat','✔\x20Deleted\x20token\x20\x27','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','isDirectory','matchedCount','number','validateParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','✔\x20Found\x20','Rows:','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','tdx\x20ps\x20preview\x20','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','toFixed','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','attributesFile','\x27\x20for\x20service\x20\x27','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','\x20total','No\x20personalization\x20services\x20configured','create','getParentFull','displayAttributesStats','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','site','runParent','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Audience\x20ID:','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','public','realtime','Error:\x20Parent\x20segment\x20name\x20is\x20required','tdx\x20ps\x20push\x20','\x0a✔\x20Workflow\x20started','\x20\x201.\x20Edit\x20','\x22\x20}','timezone','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','✔\x20Retrieved\x20RT\x20configuration\x20version','enriched','Errors:','\x20behaviors','sourceTableValid','Listing\x20personalization\x20services\x20for\x20\x27','bold','keyEventCriteria','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','✔\x20Deleted\x20personalization\x20\x27','7938567QeIRTS','varchar','folder-segment','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','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','toLowerCase','63gOTeeB','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','identifier:\x20','\x20rows)','customerGroupFile','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','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','output','/\x20directories\x20exist.','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Show\x20personalization\x20service\x20details','\x20\x20\x20','Resolving\x20parent\x20segment\x20\x27','ps:pz:service:update','get','parentFolder','831370azLoAU','sampleData','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\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','payload','yellow','query','ps:rt:list','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','filter','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Columns:','pauseJourney','createdAt','Creating\x20token\x20\x27','⚡\x20Not\x20enabled','21RlAeJr','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','ps:pz:patch','split','\x20parent\x20segment\x20\x27','\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','replace','My\x20Service','verbose','SQL\x20query:\x0a','Behavior:','realtime:','no\x20tokens\x20configured','addAttributesFile','Options:\x0a','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Creating','customerGroup','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','rowCount','addAttributes','\x20--behavior\x20\x22','Site:\x20','Analyzing\x20changes...','Status:','createToken','error','run','\x20--interval\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','keys','Error:','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','customers','all','\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}','public:','cyan','push','resolveParentId','YAML\x20file:\x20','Coverage:','/app/workflows/','segment:parent:fields','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','allowed\x20IPs:','Master\x20+\x20Attributes','joinKey','Fetching\x20SQL\x20for\x20\x27','schemaError','RT\x202.0:','segment:parent:show','Fetching\x20parent\x20segment\x20\x27','ignore','behaviorsFile','\x20\x20\x20\x20\x20\x20\x20\x20','getOutputDatabaseName','Output\x20Database:','stringify','Updating\x20parent\x20segment\x20\x27','Overwrite\x20\x27','segment:parent:run','/{name}.yml\x0a','\x20is\x20already\x20up\x20to\x20date','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','customerPercent','text','Validate:','session','darwin','✔\x20Found\x20personalization\x20\x27','Listing\x20personalizations\x20for\x20\x27','Attribute:','\x20personalization\x20service','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','file','enabled','Aborted.','Get\x20current\x20RT\x20configuration\x20version\x20status','description','Attempt:','Show\x20a\x20specific\x20realtime\x20personalization','\x27\x20and\x20run\x20workflow?','Behaviors','\x20[Job\x20ID:\x20','segment:parent:update','\x20configured','workflowSessionId','Master:','Error:\x20--database\x20and\x20--table\x20are\x20required','90908jHHLPD','segment:parent:list','dim','master','page_view','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Pause\x20activations\x20in\x20an\x20RT\x20journey','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x20kill','interval','paused','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','No\x20parent\x20segments\x20match\x20pattern:\x20','some','updateParent','Customers:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','Validating\x20configuration...','apply','any','resumeJourney','toLocaleString','Apply\x20changes\x20to\x20\x27','Available\x20behaviors:','parent_id','green','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','✘\x20Failed\x20to\x20rename\x20directory:\x20','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','formatSchemaJson','Error:\x20File\x20not\x20found:\x20','\x20\x20\x20\x20','Creating\x20personalization\x20\x27','foreignKey','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Join:','column_type','No\x20RT\x20journeys\x20found','✔\x20Renamed\x20directory\x20to\x20','entryCriteria:','behavior_','Fetching\x20customers\x20schema...','\x20Opening\x20','table','Events:','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x0a\x20\x20\x20\x20]','sections','\x20+\x20[','Next\x20steps:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','sourceTableError','primaryKey','/\x20directory.\x0a','td_client_id','entryCriteria','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','SELECT\x20*\x20FROM\x20','schemaValid','getBehaviorNames','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','Deleting\x20personalization\x20service\x20\x27','\x0a⚠️\x20\x20Migrating:\x20','column_name','Options\x20(one\x20required):\x0a','Error:\x20--name\x20is\x20required','keyEventId','Source:','ps:rt:jn:resume','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','collectSchema','Listing\x20RT\x20journeys\x20for\x20\x27','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','\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','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','delete','preview','List\x20available\x20fields\x20for\x20segmentation','column','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','ps:pz:service:delete','Listing\x20RT-enabled\x20parent\x20segments...','keyEventId:','behavior','database','Getting\x20personalization\x20\x27','\x20\x20\x20\x20-\x20','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','attributes','win32','\x20Added\x20RT\x202.0\x20template\x20section','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','\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','Master\x20Table','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','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','web','allValid','name','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','Listing\x20parent\x20segments\x20matching\x20\x27','execute','length','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','personalization','Error:\x20Service\x20name\x20is\x20required','\x0aError:','\x20service(s)\x20configured','✔\x20Updated\x20personalization\x20\x27','jobId','type','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','(id:\x20','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','in\x20','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Update\x20a\x20realtime\x20personalization\x20entity','\x0aNo\x20sample\x20data\x20available','message','/sessions/','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','double','population','yes','Executing\x20parent\x20segment\x20query...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Preview:','attribute','Create\x20a\x20realtime\x20personalization\x20entity','endsWith','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x20to\x20configure\x20your\x20personalization\x20service','ps:pz:service:token:create','Output\x20file:\x20','personalization_services','\x20--enriched','Fetching\x20behavior\x20list...','last_page_viewed','status:\x20','Updating\x20personalization\x20service\x20\x27','\x20Added\x20personalization\x20template\x20to\x20','✔\x20Created\x20parent\x20segment\x20\x27','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','use','allowedIps','state','map','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','join','relationships','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','Deleting\x20personalization\x20\x27','patchPersonalization','list','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','Options:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','✔\x20Deleted\x20personalization\x20service\x20\x27','ps:pz:list','jsonl','getParentSQL','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','true','Name:\x20','events','\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','.yml','Error:\x20Service\x20ID\x20is\x20required','\x20\x20Columns:\x20','format','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','parentSegment','audienceId','displaySummary','Delete\x20a\x20realtime\x20personalization','identifier','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','displayValidateResults','\x0aNew\x20parent\x20segment\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Running\x20parent\x20segment\x20workflow\x20for\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','parent_segment','stageCount','updatedAt','Create\x20parent\x20segment\x20\x27','Error\x20reading\x20file:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','Parent\x20segment:\x20','displayColumns','match','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','value','elapsedTimeMillis','List\x20RT\x20journeys','ps:pz:init','✔\x20No\x20changes\x20-\x20\x27','json','8NjXscg','\x20Configuration\x20is\x20valid','✔\x20Updated\x20parent\x20segment\x20\x27','Created','Fetching\x20personalization\x20service\x20\x27','displayRealtimeInfo','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Finding\x20service\x20for\x20token...','No\x20RT-enabled\x20parent\x20segments\x20found','To\x20cancel:','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','start','\x20parent\x20segment','/app/dw/parentSegments/','\x20tdx\x20wf\x20attempt\x20','\x20field','processedRows','scheduleType','launched','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','Attributes','\x5c$&','-1d','Validating\x20RT\x20configuration...','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Table:\x20','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','`\x20to\x20download\x20the\x20configuration\x20first','Error\x20parsing\x20YAML:\x20','sections:','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','displayPreviewHints','id:\x20','RT\x202.0\x20Validate:','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','workflowAttemptId','red','\x20\x20No\x20sample\x20data\x20available','createPersonalization','customersWithEvents','Personalization\x20service\x20description','deleteToken','label','using\x20the\x20default\x20path:\x20','<database>.<table>','Default','Join\x20on:','getPersonalization','\x20\x20\x20\x20\x20\x20','log','\x27...','payload:','RT\x20Journey\x20ID:\x20','data','segment:parent:validate','\x0aChanges\x20to\x20\x27','Error:\x20Personalization\x20ID\x20is\x20required','audienceId:\x20','patch','valid','reduce','\x20--attribute\x20\x22','includeSensitive:','errors','status','personalizationServices','\x20service','segment:parent:push','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','listParents','Available\x20attributes:','\x20(paused)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','.customers)','Schema\x20saved\x20to\x20','trim','token:','updated:','33207VPDvou','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','stats','coveragePercent','38BkrLRD','ps:rt:validate','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','behaviors','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','columns','Delete\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=\x20','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','FINISHED','eventKind','\x22,\x20\x22type\x22:\x20\x22','Updating','\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','✔\x20Query\x20completed:\x20Processed\x20','5102815hBGNMN','totalEvents','\x20RT-enabled\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Updated','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x202.\x20Run\x20','displayBehaviorsStats','Patching\x20personalization\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','test','Error:\x20Token\x20\x27','ID\x20Stitching:','\x20true','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','idStitching','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','string','stitchingKeys','18814224JyUnbu','\x27\x20is\x20up\x20to\x20date','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','scheduleOption'];a30_0x2fc6=function(){return _0x4ec9ad;};return a30_0x2fc6();}function a30_0x49a8(_0x10eaaa,_0x500bc1){_0x10eaaa=_0x10eaaa-0x1cf;const _0x2fc6df=a30_0x2fc6();let _0x49a886=_0x2fc6df[_0x10eaaa];return _0x49a886;}(function(_0x270342,_0x12ba37){const _0x5e1c7b=a30_0x49a8,_0x5d0418=_0x270342();while(!![]){try{const _0x2aada4=parseInt(_0x5e1c7b(0x294))/0x1*(parseInt(_0x5e1c7b(0x299))/0x2)+-parseInt(_0x5e1c7b(0x338))/0x3*(-parseInt(_0x5e1c7b(0x395))/0x4)+parseInt(_0x5e1c7b(0x2a9))/0x5+parseInt(_0x5e1c7b(0x2d1))/0x6*(-parseInt(_0x5e1c7b(0x318))/0x7)+-parseInt(_0x5e1c7b(0x243))/0x8*(-parseInt(_0x5e1c7b(0x311))/0x9)+-parseInt(_0x5e1c7b(0x328))/0xa+-parseInt(_0x5e1c7b(0x2be))/0xb;if(_0x2aada4===_0x12ba37)break;else _0x5d0418['push'](_0x5d0418['shift']());}catch(_0x5985c5){_0x5d0418['push'](_0x5d0418['shift']());}}}(a30_0x2fc6,0xa7268));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a30_0x17ee7b 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 a30_0x3ab056 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x3a7c73){const _0x5a60ac=a30_0x49a8,_0x34eb9d=process['platform'],_0x3c9a63=_0x34eb9d===_0x5a60ac(0x37f)?'open':_0x34eb9d===_0x5a60ac(0x1cf)?_0x5a60ac(0x24e):'xdg-open';spawn(_0x3c9a63,[_0x3a7c73],{'detached':!![],'stdio':_0x5a60ac(0x36f)})['unref']();}function migrateLegacyDirectory(){const _0x211926=a30_0x49a8;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x5b2f65=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x5b2f65[_0x211926(0x2e2)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a30_0x3ab056['yellow']('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x211926(0x320))),console[_0x211926(0x353)](a30_0x3ab056[_0x211926(0x397)](_0x211926(0x249)+LEGACY_PARENT_SEGMENT_DIR+_0x211926(0x3cd))),![];console['error'](a30_0x3ab056[_0x211926(0x32d)](_0x211926(0x3d6)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x211926(0x353)](a30_0x3ab056[_0x211926(0x3af)](_0x211926(0x3be)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x5b397c){const _0x2fa6fc=_0x5b397c instanceof Error?_0x5b397c['message']:String(_0x5b397c);return console[_0x211926(0x353)](a30_0x3ab056[_0x211926(0x269)](_0x211926(0x3b1)+_0x2fa6fc+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a30_0x41ba90(0x354)](_0x5ec1f5){const _0x5073f4=a30_0x41ba90;return migrateLegacyDirectory(),super[_0x5073f4(0x354)](_0x5ec1f5);}}function resolveYamlFile(_0x37b314){const _0x36c59f=a30_0x41ba90;if(_0x37b314[_0x36c59f(0x1fa)]('.yml')||_0x37b314['endsWith']('.yaml'))return _0x37b314;return a30_0x17ee7b[_0x36c59f(0x20d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x37b314)+_0x36c59f(0x221));}function formatProgressMessage(_0x1135d4){const _0x5f4b5c=a30_0x41ba90,_0xa3121=_0x1135d4[_0x5f4b5c(0x23a)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0xa3121){const [,_0x1c293b,_0xf3aacd,_0xfa6f7f='']=_0xa3121;return a30_0x3ab056[_0x5f4b5c(0x397)](_0x1c293b+':')+'\x20'+_0xf3aacd+a30_0x3ab056['dim'](_0xfa6f7f);}return a30_0x3ab056[_0x5f4b5c(0x397)](_0x1135d4);}function showFileNotFoundError(_0x578113,_0x13510a){const _0x393a4d=a30_0x41ba90;console[_0x393a4d(0x353)](a30_0x3ab056['red'](_0x393a4d(0x3b6)+_0x578113+'\x0a')),console['error'](a30_0x3ab056[_0x393a4d(0x35f)](_0x393a4d(0x1e5)+_0x13510a+_0x393a4d(0x25e)));}function displayRealtimeValidation(_0x165c2f){const _0x48edea=a30_0x41ba90;if(!_0x165c2f['realtime'])return;const _0x381f07=_0x165c2f[_0x48edea(0x2fe)],_0x254b6f=_0x381f07[_0x48edea(0x387)]?a30_0x3ab056[_0x48edea(0x3af)]('⚡\x20Enabled'):a30_0x3ab056[_0x48edea(0x32d)](_0x48edea(0x337));console['error']('\x0a'+a30_0x3ab056['dim'](_0x48edea(0x36c))+'\x20'+_0x254b6f);if(_0x381f07[_0x48edea(0x21f)]&&_0x381f07[_0x48edea(0x21f)][_0x48edea(0x1dc)]>0x0){console[_0x48edea(0x353)]('\x20\x20'+a30_0x3ab056[_0x48edea(0x397)](_0x48edea(0x3c4))+'\x20'+_0x381f07[_0x48edea(0x21f)][_0x48edea(0x1dc)]+_0x48edea(0x391));for(const _0x3db61c of _0x381f07[_0x48edea(0x21f)]){const _0x2ffef5=_0x3db61c[_0x48edea(0x30b)]===![]?a30_0x3ab056[_0x48edea(0x269)]('✘'):a30_0x3ab056[_0x48edea(0x3af)]('✔');console[_0x48edea(0x353)](_0x48edea(0x3b7)+_0x2ffef5+'\x20'+_0x3db61c[_0x48edea(0x1d8)]),_0x3db61c[_0x48edea(0x3cb)]&&console[_0x48edea(0x353)](_0x48edea(0x275)+a30_0x3ab056['red'](_0x3db61c[_0x48edea(0x3cb)]));}}if(_0x381f07[_0x48edea(0x3f0)]&&_0x381f07[_0x48edea(0x3f0)][_0x48edea(0x1dc)]>0x0){console['error']('\x20\x20'+a30_0x3ab056[_0x48edea(0x397)]('Attributes:')+'\x20'+_0x381f07[_0x48edea(0x3f0)][_0x48edea(0x1dc)]+_0x48edea(0x391));for(const _0x5dd85d of _0x381f07[_0x48edea(0x3f0)]){const _0x17e4b9=_0x5dd85d[_0x48edea(0x280)]?a30_0x3ab056[_0x48edea(0x3af)]('✔'):a30_0x3ab056[_0x48edea(0x269)]('✘');console[_0x48edea(0x353)](_0x48edea(0x3b7)+_0x17e4b9+'\x20'+_0x5dd85d[_0x48edea(0x1d8)]+'\x20'+a30_0x3ab056[_0x48edea(0x397)]('('+_0x5dd85d[_0x48edea(0x1e4)]+')'));}}if(_0x381f07['idStitching']){const _0x7cf86f=_0x381f07[_0x48edea(0x2b9)][_0x48edea(0x2bd)]?.['length']?_0x48edea(0x3c8)+_0x381f07['idStitching']['stitchingKeys'][_0x48edea(0x20d)](',\x20')+']':'';console[_0x48edea(0x353)]('\x20\x20'+a30_0x3ab056[_0x48edea(0x397)](_0x48edea(0x2b5))+'\x20'+_0x381f07[_0x48edea(0x2b9)][_0x48edea(0x3cc)]+_0x7cf86f);}if(_0x381f07[_0x48edea(0x286)]&&_0x381f07[_0x48edea(0x286)][_0x48edea(0x1dc)]>0x0){console[_0x48edea(0x353)]('\x20\x20'+a30_0x3ab056['dim'](_0x48edea(0x2c9))+'\x20'+_0x381f07[_0x48edea(0x286)][_0x48edea(0x1dc)]+_0x48edea(0x287)+(_0x381f07['personalizationServices']['length']!==0x1?'s':''));for(const _0x1954c4 of _0x381f07[_0x48edea(0x286)]){console[_0x48edea(0x353)](_0x48edea(0x3ee)+_0x1954c4['name']);}}}function showParentSegmentNotSetError(_0x1bccda){const _0x3481f8=a30_0x41ba90;console[_0x3481f8(0x353)](a30_0x3ab056[_0x3481f8(0x32d)](_0x3481f8(0x3ca))),console[_0x3481f8(0x353)](_0x1bccda);}export class ParentSegmentListCommand extends BaseCommand{['name']=a30_0x41ba90(0x396);[a30_0x41ba90(0x38a)]='List\x20parent\x20segments';async[a30_0x41ba90(0x1db)](_0x4aa7a8){const _0x25f5d3=a30_0x41ba90,{options:_0x18dc35,args:_0x1112a0,tdx:_0x39ed67}=_0x4aa7a8,_0x28c003=_0x1112a0[0x0];_0x18dc35[_0x25f5d3(0x340)]&&(console[_0x25f5d3(0x353)](_0x25f5d3(0x34f)+_0x18dc35[_0x25f5d3(0x2f8)]),_0x28c003&&console['error'](_0x25f5d3(0x2c6)+_0x28c003));const _0x2d9743=await withSpinner(_0x28c003?_0x25f5d3(0x1da)+_0x28c003+_0x25f5d3(0x277):'Listing\x20parent\x20segments...',()=>_0x39ed67[_0x25f5d3(0x2c3)][_0x25f5d3(0x28a)](),{'verbose':_0x18dc35[_0x25f5d3(0x340)]});let _0x358070=_0x2d9743[_0x25f5d3(0x27a)];if(_0x28c003){const _0x2aa54a=_0x28c003[_0x25f5d3(0x33e)](/[.+^${}()|[\]\\]/g,_0x25f5d3(0x258))[_0x25f5d3(0x33e)](/\*/g,'.*')[_0x25f5d3(0x33e)](/\?/g,'.'),_0x33d886=new RegExp('^'+_0x2aa54a+'$','i');_0x358070=_0x358070[_0x25f5d3(0x331)](_0x129150=>_0x33d886['test'](_0x129150[_0x25f5d3(0x3f0)][_0x25f5d3(0x1d8)]));}_0x358070[_0x25f5d3(0x2dd)]((_0x27527a,_0x4b888c)=>_0x27527a[_0x25f5d3(0x3f0)][_0x25f5d3(0x1d8)]['localeCompare'](_0x4b888c['attributes']['name'])),console[_0x25f5d3(0x353)]('✔\x20Found\x20'+_0x358070[_0x25f5d3(0x1dc)]+_0x25f5d3(0x24f)+(_0x358070[_0x25f5d3(0x1dc)]!==0x1?'s':''));const _0x546a5a=_0x4e6575=>{const _0x1382c6=_0x25f5d3;return getConsoleNextUrl(_0x18dc35[_0x1382c6(0x2f8)],_0x1382c6(0x250)+_0x4e6575);};if(_0x18dc35['format']===_0x25f5d3(0x242)||_0x18dc35['format']==='jsonl'){const _0x1e8b80=_0x358070[_0x25f5d3(0x20b)](_0x6c9152=>({..._0x6c9152,'url':_0x546a5a(_0x6c9152['id'])}));await handleSDKOutput(_0x1e8b80,_0x18dc35);}else{if(_0x358070[_0x25f5d3(0x1dc)]===0x0)_0x28c003?console[_0x25f5d3(0x276)](_0x25f5d3(0x3a2)+_0x28c003):console['log'](_0x25f5d3(0x2db));else for(const _0x4d9f88 of _0x358070){const _0x3abf80=_0x4d9f88['attributes'][_0x25f5d3(0x1f3)]?a30_0x3ab056['dim']('\x20('+formatRows(_0x4d9f88[_0x25f5d3(0x3f0)]['population'])+')'):'',_0x359301=hyperlink(_0x4d9f88[_0x25f5d3(0x3f0)][_0x25f5d3(0x1d8)],_0x546a5a(_0x4d9f88['id']));console['log']('👥\x20'+_0x359301+_0x3abf80);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='segment:parent:create';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x31d);async[a30_0x41ba90(0x1db)](_0x48481e){const _0x2d8fec=a30_0x41ba90,{options:_0x8f29b3,args:_0x203721,tdx:_0x1f3d95}=_0x48481e;console[_0x2d8fec(0x353)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x2d8fec(0x2a2)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x5b3a5e=_0x8f29b3;if(_0x203721[_0x2d8fec(0x1dc)]===0x0)return console[_0x2d8fec(0x353)](a30_0x3ab056['red'](_0x2d8fec(0x2ff))),console[_0x2d8fec(0x353)](_0x2d8fec(0x1e6)),0x1;const _0x2666c9=_0x203721[0x0];if(!_0x5b3a5e[_0x2d8fec(0x3ec)]||!_0x5b3a5e[_0x2d8fec(0x3c3)])return console[_0x2d8fec(0x353)](_0x2d8fec(0x394)),console['error'](_0x2d8fec(0x1e6)),0x1;_0x5b3a5e[_0x2d8fec(0x340)]&&(console['error'](_0x2d8fec(0x34f)+_0x5b3a5e[_0x2d8fec(0x2f8)]),console['error'](_0x2d8fec(0x21e)+_0x2666c9),console[_0x2d8fec(0x353)]('Database:\x20'+_0x5b3a5e[_0x2d8fec(0x3ec)]),console[_0x2d8fec(0x353)](_0x2d8fec(0x25c)+_0x5b3a5e[_0x2d8fec(0x3c3)]));const _0x474d53=await loadJSONFromOptions(_0x5b3a5e[_0x2d8fec(0x3f0)],_0x5b3a5e[_0x2d8fec(0x2ee)]),_0x1dae13=await loadJSONFromOptions(_0x5b3a5e['behaviors'],_0x5b3a5e[_0x2d8fec(0x370)]),_0x45410e=await loadJSONFromOptions(_0x5b3a5e[_0x2d8fec(0x349)],_0x5b3a5e[_0x2d8fec(0x31c)]),_0x4c34b6={'name':_0x2666c9,'description':_0x5b3a5e[_0x2d8fec(0x38a)],'scheduleType':_0x5b3a5e[_0x2d8fec(0x254)],'scheduleOption':_0x5b3a5e[_0x2d8fec(0x2c1)],'timezone':_0x5b3a5e[_0x2d8fec(0x304)],'master':{'parentDatabaseName':_0x5b3a5e[_0x2d8fec(0x3ec)],'parentTableName':_0x5b3a5e[_0x2d8fec(0x3c3)]},'attributes':_0x474d53,'behaviors':_0x1dae13,'customerGroup':_0x45410e},_0xf51b90=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x2666c9+_0x2d8fec(0x277),()=>_0x1f3d95[_0x2d8fec(0x2c3)][_0x2d8fec(0x2c5)](_0x4c34b6),{'verbose':_0x8f29b3[_0x2d8fec(0x340)]}),_0x1bc744=_0xf51b90[_0x2d8fec(0x27a)];return console[_0x2d8fec(0x353)](_0x2d8fec(0x206)+_0x1bc744[_0x2d8fec(0x1d8)]+_0x2d8fec(0x384)+_0x1bc744['id']),await handleSDKOutput([_0x1bc744],_0x8f29b3),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x390);[a30_0x41ba90(0x38a)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a30_0x41ba90(0x1db)](_0x1e1eb6){const _0x39c23a=a30_0x41ba90,{options:_0x570271,args:_0x234f19,tdx:_0x16b32b}=_0x1e1eb6;console['error'](_0x39c23a(0x22e)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x18dd5a=_0x570271;if(_0x234f19['length']===0x0)return console['error'](a30_0x3ab056[_0x39c23a(0x269)](_0x39c23a(0x2ff))),console['error'](_0x39c23a(0x21c)),0x1;const _0x2f1b57=_0x234f19[0x0];_0x18dd5a['verbose']&&(console[_0x39c23a(0x353)](_0x39c23a(0x34f)+_0x18dd5a[_0x39c23a(0x2f8)]),console[_0x39c23a(0x353)]('Parent\x20segment:\x20'+_0x2f1b57));const _0x392bc8=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x2f1b57+_0x39c23a(0x277),()=>_0x16b32b['segment']['getParentFull'](_0x2f1b57),{'verbose':_0x18dd5a[_0x39c23a(0x340)]}),_0xf6f2a5=_0x392bc8[_0x39c23a(0x27a)],_0x25a1d3=await loadJSONFromOptions(_0x18dd5a[_0x39c23a(0x34d)],_0x18dd5a[_0x39c23a(0x345)]),_0x1a419d=await loadJSONFromOptions(_0x18dd5a['addBehaviors'],_0x18dd5a[_0x39c23a(0x2dc)]),_0x2c86fe={'name':_0xf6f2a5[_0x39c23a(0x1d8)],'description':_0x18dd5a[_0x39c23a(0x38a)]!==undefined?_0x18dd5a['description']:_0xf6f2a5['description'],'scheduleType':_0x18dd5a[_0x39c23a(0x254)]!==undefined?_0x18dd5a[_0x39c23a(0x254)]:_0xf6f2a5[_0x39c23a(0x254)],'scheduleOption':_0x18dd5a['scheduleOption']!==undefined?_0x18dd5a[_0x39c23a(0x2c1)]:_0xf6f2a5[_0x39c23a(0x2c1)],'timezone':_0x18dd5a[_0x39c23a(0x304)]!==undefined?_0x18dd5a[_0x39c23a(0x304)]:_0xf6f2a5[_0x39c23a(0x304)],'master':_0xf6f2a5[_0x39c23a(0x398)],'attributes':_0x25a1d3?[..._0xf6f2a5[_0x39c23a(0x3f0)]||[],..._0x25a1d3]:_0xf6f2a5[_0x39c23a(0x3f0)],'behaviors':_0x1a419d?[..._0xf6f2a5['behaviors']||[],..._0x1a419d]:_0xf6f2a5[_0x39c23a(0x29c)],'customerGroup':_0xf6f2a5['customerGroup']},_0x4334bb=await withSpinner(_0x39c23a(0x375)+_0x2f1b57+'\x27...',()=>_0x16b32b['segment'][_0x39c23a(0x3a4)](_0x2f1b57,_0x2c86fe),{'verbose':_0x18dd5a[_0x39c23a(0x340)]}),_0x2e5960=_0x4334bb['data'];return console['error'](_0x39c23a(0x245)+_0x2e5960[_0x39c23a(0x1d8)]+'\x27'),await handleSDKOutput([_0x2e5960],_0x18dd5a),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a30_0x41ba90(0x1d8)]='segment:parent:pull';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x2b8);async[a30_0x41ba90(0x1db)](_0x5daf78){const _0x469b1d=a30_0x41ba90,{options:_0x5b3ba3,args:_0x1fa354,tdx:_0x1be460}=_0x5daf78,_0x1eab5a=_0x5b3ba3,_0x29ecb3=_0x1fa354[0x0]||_0x5b3ba3[_0x469b1d(0x226)];if(!_0x29ecb3)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'+_0x469b1d(0x2ac)),0x1;if(_0x1eab5a[_0x469b1d(0x208)]&&_0x1eab5a[_0x469b1d(0x31f)])return console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x269)](_0x469b1d(0x37a))),console[_0x469b1d(0x353)](a30_0x3ab056['dim']('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x469b1d(0x353)](a30_0x3ab056['dim'](_0x469b1d(0x270)+PARENT_SEGMENT_DIR+_0x469b1d(0x378))),console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x35f)](_0x469b1d(0x332))),0x1;const _0x3ebc8a=_0x1eab5a[_0x469b1d(0x31f)]||a30_0x17ee7b[_0x469b1d(0x20d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x29ecb3)+_0x469b1d(0x221));_0x1eab5a[_0x469b1d(0x340)]&&(console['error'](_0x469b1d(0x34f)+_0x1eab5a[_0x469b1d(0x2f8)]),console['error'](_0x469b1d(0x238)+_0x29ecb3),console[_0x469b1d(0x353)](_0x469b1d(0x1fe)+_0x3ebc8a));const _0x576c73=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x29ecb3+_0x469b1d(0x277),()=>_0x1be460[_0x469b1d(0x2c3)]['pullParentYaml'](_0x29ecb3),{'verbose':_0x1eab5a[_0x469b1d(0x340)]}),_0x39a3ad=_0x576c73[_0x469b1d(0x27a)];if(existsSync(_0x3ebc8a)){const _0x1f9c9b=readFileSync(_0x3ebc8a,_0x469b1d(0x2d3)),_0x364237=generateDiff(_0x1f9c9b,_0x39a3ad);if(!hasChanges(_0x364237))console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x3af)]('✔')+'\x20No\x20changes\x20-\x20'+a30_0x3ab056[_0x469b1d(0x35f)](_0x3ebc8a)+_0x469b1d(0x379));else{console[_0x469b1d(0x353)](_0x469b1d(0x27c)+_0x3ebc8a+'\x27:'),console['error']('─'[_0x469b1d(0x2df)](0x3c)),console[_0x469b1d(0x353)](formatDiffWithColors(_0x364237)),console[_0x469b1d(0x353)]('─'[_0x469b1d(0x2df)](0x3c));if(!_0x1eab5a[_0x469b1d(0x1f4)]){if(!isInteractive())return console['error'](a30_0x3ab056[_0x469b1d(0x269)]('\x0aError:'),_0x469b1d(0x319)),console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x397)](_0x469b1d(0x3e2))),0x1;const _0x10840c=await confirmKey(_0x469b1d(0x376)+_0x3ebc8a+'\x27?');if(!_0x10840c)return console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x32d)]('Aborted.')),0x1;}writeFileSync(_0x3ebc8a,_0x39a3ad,_0x469b1d(0x2d3)),console[_0x469b1d(0x353)](a30_0x3ab056['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a30_0x3ab056[_0x469b1d(0x35f)](_0x3ebc8a));}}else{const _0x209290=a30_0x17ee7b['dirname'](_0x3ebc8a);!existsSync(_0x209290)&&mkdirSync(_0x209290,{'recursive':!![]}),writeFileSync(_0x3ebc8a,_0x39a3ad,_0x469b1d(0x2d3)),console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x3af)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a30_0x3ab056[_0x469b1d(0x35f)](_0x3ebc8a));}return saveSessionContext({'parent_segment':_0x29ecb3},_0x1eab5a[_0x469b1d(0x37e)]),console[_0x469b1d(0x353)](a30_0x3ab056[_0x469b1d(0x3af)]('✔')+'\x20Context\x20set:\x20'+a30_0x3ab056[_0x469b1d(0x397)](_0x469b1d(0x232))+_0x469b1d(0x2a1)+a30_0x3ab056[_0x469b1d(0x35f)](_0x29ecb3)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x288);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x1dd);async[a30_0x41ba90(0x1db)](_0x55df31){const _0x17e02f=a30_0x41ba90,{options:_0x117298,args:_0x508c91,tdx:_0x1c193e}=_0x55df31,_0x2272a6=_0x117298,_0x43c6f0=_0x508c91[0x0]||_0x117298[_0x17e02f(0x226)];if(!_0x43c6f0)return showParentSegmentNotSetError(_0x17e02f(0x385)+_0x17e02f(0x28d)),0x1;const _0x1959d8=resolveYamlFile(_0x43c6f0);if(!existsSync(_0x1959d8))return showFileNotFoundError(_0x1959d8,_0x43c6f0),0x1;_0x2272a6['verbose']&&(console['error'](_0x17e02f(0x34f)+_0x2272a6[_0x17e02f(0x2f8)]),console['error'](_0x17e02f(0x362)+_0x1959d8));let _0x2af532;try{_0x2af532=readFileSync(_0x1959d8,_0x17e02f(0x2d3));}catch(_0x3fe109){const _0x2c89bc=_0x3fe109 instanceof Error?_0x3fe109[_0x17e02f(0x1ef)]:String(_0x3fe109);return console[_0x17e02f(0x353)]('Error\x20reading\x20file:\x20'+_0x2c89bc),0x1;}const _0x10871e=await withSpinner('Analyzing\x20changes...',()=>_0x1c193e[_0x17e02f(0x2c3)]['pushParentYaml'](_0x2af532),{'verbose':_0x2272a6['verbose']}),_0x2245a7=_0x10871e[_0x17e02f(0x27a)],{isNew:_0x3bf925,name:_0x400b35,hasChanges:_0x4c2945,diffFormatted:_0x3103cf}=_0x2245a7;if(!_0x4c2945)return console[_0x17e02f(0x353)](_0x17e02f(0x241)+_0x400b35+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x3bf925?console['error'](_0x17e02f(0x22d)+_0x400b35+'\x27:'):console[_0x17e02f(0x353)](_0x17e02f(0x2ae)+_0x400b35+'\x27:');console[_0x17e02f(0x353)]('─'[_0x17e02f(0x2df)](0x3c)),console[_0x17e02f(0x353)](_0x3103cf),console[_0x17e02f(0x353)]('─'[_0x17e02f(0x2df)](0x3c));const _0x598cb4=_0x3bf925?_0x17e02f(0x235)+_0x400b35+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x400b35+'\x27?';if(!_0x2272a6['yes']){if(!isInteractive())return console[_0x17e02f(0x353)](a30_0x3ab056[_0x17e02f(0x269)](_0x17e02f(0x1e0)),_0x17e02f(0x319)),console[_0x17e02f(0x353)](a30_0x3ab056[_0x17e02f(0x397)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x412276=await confirmKey(_0x598cb4);if(!_0x412276)return console['error'](a30_0x3ab056[_0x17e02f(0x32d)](_0x17e02f(0x388))),0x1;}const _0x3605cb=_0x3bf925?_0x17e02f(0x348):_0x17e02f(0x2a6),_0xbae3b5=await withSpinner(_0x3605cb+_0x17e02f(0x33c)+_0x400b35+_0x17e02f(0x277),()=>_0x2245a7['apply'](),{'verbose':_0x2272a6['verbose']}),_0x3f0ffb=_0xbae3b5[_0x17e02f(0x27a)],_0x18e4ba=getConsoleNextUrl(_0x2272a6['site'],'/app/dw/parentSegments/'+_0x3f0ffb['id']),_0x15c482=_0x3bf925?_0x17e02f(0x246):_0x17e02f(0x2ad);return console['error']('✔\x20'+_0x15c482+_0x17e02f(0x33c)+_0x3f0ffb[_0x17e02f(0x1d8)]+'\x27'),console[_0x17e02f(0x353)]('\x20\x20'+_0x18e4ba),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a30_0x41ba90(0x27b);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x295);async[a30_0x41ba90(0x1db)](_0xbd5713){const _0x346f3d=a30_0x41ba90,{options:_0x21615f,args:_0x4eb25a,tdx:_0x2e8556}=_0xbd5713,_0x49eefb=_0x21615f,_0x29e456=_0x4eb25a[0x0]||_0x21615f[_0x346f3d(0x226)];if(!_0x29e456)return showParentSegmentNotSetError(_0x346f3d(0x359)+_0x346f3d(0x215)+_0x346f3d(0x346)+_0x346f3d(0x2e1)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x346f3d(0x2fc)),0x1;const _0x1adf62=resolveYamlFile(_0x29e456);if(!existsSync(_0x1adf62))return showFileNotFoundError(_0x1adf62,_0x29e456),0x1;_0x49eefb[_0x346f3d(0x340)]&&(console[_0x346f3d(0x353)]('Site:\x20'+_0x49eefb['site']),console['error'](_0x346f3d(0x362)+_0x1adf62));let _0x436480;try{_0x436480=readFileSync(_0x1adf62,'utf-8');}catch(_0x55bbb4){const _0x381a46=_0x55bbb4 instanceof Error?_0x55bbb4[_0x346f3d(0x1ef)]:String(_0x55bbb4);return console[_0x346f3d(0x353)](_0x346f3d(0x236)+_0x381a46),0x1;}const _0x17bba7=createCommandSpinner(a30_0x3ab056['dim'](_0x346f3d(0x3a7)),{'verbose':_0x49eefb['verbose']});_0x17bba7[_0x346f3d(0x24e)]();const _0x239c0b={'onProgress':_0x40fc68=>{const _0x2e994d=_0x346f3d;_0x17bba7[_0x2e994d(0x37c)]=formatProgressMessage(_0x40fc68);}};if(_0x49eefb[_0x346f3d(0x398)])_0x239c0b[_0x346f3d(0x398)]=!![];if(_0x49eefb[_0x346f3d(0x308)])_0x239c0b['enriched']=!![];_0x49eefb[_0x346f3d(0x1f8)]&&(_0x239c0b['attribute']=_0x49eefb[_0x346f3d(0x1f8)]);_0x49eefb[_0x346f3d(0x3eb)]&&(_0x239c0b[_0x346f3d(0x3eb)]=_0x49eefb[_0x346f3d(0x3eb)]);if(_0x49eefb[_0x346f3d(0x39f)])_0x239c0b[_0x346f3d(0x39f)]=_0x49eefb['interval'];let _0x759dea;try{_0x759dea=await _0x2e8556[_0x346f3d(0x2c3)][_0x346f3d(0x2e5)](_0x436480,_0x239c0b),_0x17bba7['stop']();}catch(_0x451a75){_0x17bba7[_0x346f3d(0x2de)]();throw _0x451a75;}const _0x35cc82=_0x49eefb[_0x346f3d(0x39f)]||_0x346f3d(0x259);return this[_0x346f3d(0x22c)](_0x759dea,_0x239c0b,_0x1adf62,_0x35cc82),_0x759dea[_0x346f3d(0x1d7)]?0x0:0x1;}[a30_0x41ba90(0x22c)](_0x3b4f35,_0x5e05e4,_0x504d7c,_0x47e09c){const _0x5911ad=a30_0x41ba90;console[_0x5911ad(0x353)]('\x0a'+a30_0x3ab056[_0x5911ad(0x30d)](_0x5911ad(0x37d))+'\x20'+_0x3b4f35[_0x5911ad(0x1d8)]),console[_0x5911ad(0x353)]('═'[_0x5911ad(0x2df)](0x3c)),this[_0x5911ad(0x2c4)](_0x3b4f35);if(typeof _0x5e05e4[_0x5911ad(0x1f8)]==='string'){this[_0x5911ad(0x2f5)](_0x3b4f35),this[_0x5911ad(0x228)](_0x3b4f35),this[_0x5911ad(0x262)](_0x504d7c,_0x47e09c,_0x5911ad(0x1f8),_0x5e05e4[_0x5911ad(0x1f8)]);return;}if(_0x5e05e4[_0x5911ad(0x1f8)]===!![]){this['displayAttributesStats'](_0x3b4f35),this['displaySummary'](_0x3b4f35),this[_0x5911ad(0x262)](_0x504d7c,_0x47e09c,_0x5911ad(0x3f0));return;}if(typeof _0x5e05e4[_0x5911ad(0x3eb)]==='string'){this[_0x5911ad(0x2b0)](_0x3b4f35,_0x47e09c),this[_0x5911ad(0x228)](_0x3b4f35),this['displayPreviewHints'](_0x504d7c,_0x47e09c,_0x5911ad(0x3eb),_0x5e05e4[_0x5911ad(0x3eb)]);return;}if(_0x5e05e4[_0x5911ad(0x3eb)]===!![]){this[_0x5911ad(0x2b0)](_0x3b4f35,_0x47e09c),this['displaySummary'](_0x3b4f35),this[_0x5911ad(0x262)](_0x504d7c,_0x47e09c,_0x5911ad(0x29c));return;}this['displayAttributesStats'](_0x3b4f35),this[_0x5911ad(0x2b0)](_0x3b4f35,_0x47e09c),this[_0x5911ad(0x248)](_0x3b4f35),this['displaySummary'](_0x3b4f35),this['displayPreviewHints'](_0x504d7c,_0x47e09c,_0x5911ad(0x35c));}[a30_0x41ba90(0x248)](_0x234776){displayRealtimeValidation(_0x234776);}[a30_0x41ba90(0x262)](_0x2f3cef,_0xef4231,_0x498143,_0x4cfb49){const _0x7a99bc=a30_0x41ba90;console[_0x7a99bc(0x353)]('\x0a'+a30_0x3ab056['dim'](_0x7a99bc(0x2cc)));const _0x43bcd3=_0xef4231!==_0x7a99bc(0x259)?_0x7a99bc(0x355)+_0xef4231:'';if(_0x498143===_0x7a99bc(0x1f8)&&_0x4cfb49)console[_0x7a99bc(0x353)]('\x20\x20'+a30_0x3ab056[_0x7a99bc(0x397)](_0x7a99bc(0x2ea)+_0x2f3cef+_0x7a99bc(0x282)+_0x4cfb49+'\x22'+_0x43bcd3));else{if(_0x498143===_0x7a99bc(0x3eb)&&_0x4cfb49)console[_0x7a99bc(0x353)]('\x20\x20'+a30_0x3ab056[_0x7a99bc(0x397)](_0x7a99bc(0x2ea)+_0x2f3cef+_0x7a99bc(0x34e)+_0x4cfb49+'\x22'+_0x43bcd3));else(_0x498143==='attributes'||_0x498143===_0x7a99bc(0x35c))&&console[_0x7a99bc(0x353)]('\x20\x20'+a30_0x3ab056[_0x7a99bc(0x397)]('tdx\x20ps\x20preview\x20'+_0x2f3cef+'\x20--attribute\x20\x22<name>\x22'+_0x43bcd3));}(_0x498143===_0x7a99bc(0x29c)||_0x498143===_0x7a99bc(0x35c))&&console[_0x7a99bc(0x353)]('\x20\x20'+a30_0x3ab056[_0x7a99bc(0x397)](_0x7a99bc(0x2ea)+_0x2f3cef+'\x20--behavior\x20\x22<name>\x22'+_0x43bcd3)),_0x498143===_0x7a99bc(0x35c)&&console['error']('\x20\x20'+a30_0x3ab056['dim'](_0x7a99bc(0x2ea)+_0x2f3cef+_0x7a99bc(0x200)+_0x43bcd3));}['displayMasterInfo'](_0xc83619){const _0x2590cc=a30_0x41ba90,{master:_0x178604}=_0xc83619,_0x4b15a9=_0x178604[_0x2590cc(0x3d2)]?a30_0x3ab056['green']('✔'):a30_0x3ab056['red']('✘');console[_0x2590cc(0x353)]('\x0a'+a30_0x3ab056[_0x2590cc(0x397)](_0x2590cc(0x1d3))),console[_0x2590cc(0x353)](_0x4b15a9+'\x20'+a30_0x3ab056[_0x2590cc(0x30d)](_0x178604[_0x2590cc(0x3ec)]+'.'+_0x178604['table'])),_0x178604[_0x2590cc(0x3d2)]?_0x178604[_0x2590cc(0x34c)]!==undefined&&console[_0x2590cc(0x353)]('\x20\x20'+a30_0x3ab056[_0x2590cc(0x397)](_0x2590cc(0x2e8))+'\x20'+a30_0x3ab056[_0x2590cc(0x35f)](formatRows(_0x178604['rowCount']))):console[_0x2590cc(0x353)]('\x20\x20'+a30_0x3ab056[_0x2590cc(0x269)]('Error:')+'\x20'+_0x178604['schemaError']);}['displayAttributesStats'](_0xb020a){const _0x343bef=a30_0x41ba90;if(_0xb020a[_0x343bef(0x3f0)]['length']===0x0)return;console[_0x343bef(0x353)]('\x0a'+a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x257)));for(const _0x4a6054 of _0xb020a[_0x343bef(0x3f0)]){const _0x506d7a=_0x4a6054['schemaValid']?a30_0x3ab056[_0x343bef(0x3af)]('✔'):a30_0x3ab056[_0x343bef(0x269)]('✘');let _0x54549f='';if(_0x4a6054[_0x343bef(0x3d2)]&&_0x4a6054[_0x343bef(0x2e3)]!==undefined&&_0x4a6054[_0x343bef(0x298)]!==undefined){const _0x34dd50=_0x4a6054[_0x343bef(0x298)]['toFixed'](0x1),_0x28ebfb=_0x4a6054[_0x343bef(0x298)]>=0x50?a30_0x3ab056[_0x343bef(0x3af)]:_0x4a6054[_0x343bef(0x298)]>=0x32?a30_0x3ab056['yellow']:a30_0x3ab056[_0x343bef(0x269)];_0x54549f='\x20'+a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x363))+'\x20'+_0x28ebfb(_0x34dd50+'%')+'\x20('+formatRows(_0x4a6054[_0x343bef(0x2e3)])+_0x343bef(0x31b);}console['error'](_0x506d7a+'\x20'+a30_0x3ab056[_0x343bef(0x30d)](_0x4a6054[_0x343bef(0x1d8)])+_0x54549f),console[_0x343bef(0x353)]('\x20\x20'+a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x3db))+'\x20'+a30_0x3ab056[_0x343bef(0x30d)](_0x4a6054[_0x343bef(0x3ec)]+'.'+_0x4a6054[_0x343bef(0x3c3)]));const _0x1626c7=_0x4a6054[_0x343bef(0x369)]===_0x4a6054['foreignKey']?a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x273))+'\x20'+_0x4a6054['joinKey']:a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x3bb))+'\x20'+_0x4a6054[_0x343bef(0x369)]+'\x20=\x20'+_0x4a6054[_0x343bef(0x3b9)];console[_0x343bef(0x353)]('\x20\x20'+_0x1626c7),console['error']('\x20\x20'+a30_0x3ab056[_0x343bef(0x397)](_0x343bef(0x333))),this[_0x343bef(0x239)](_0x4a6054[_0x343bef(0x29e)]),!_0x4a6054[_0x343bef(0x3d2)]&&console[_0x343bef(0x353)]('\x20\x20'+a30_0x3ab056[_0x343bef(0x269)](_0x343bef(0x358))+'\x20'+_0x4a6054[_0x343bef(0x36b)]);}}[a30_0x41ba90(0x2b0)](_0x69a3b0,_0x3545ef){const _0x478966=a30_0x41ba90;if(_0x69a3b0[_0x478966(0x29c)][_0x478966(0x1dc)]===0x0)return;console['error']('\x0a'+a30_0x3ab056[_0x478966(0x397)](_0x478966(0x38e))+'\x20'+a30_0x3ab056[_0x478966(0x397)]('('+_0x3545ef+')'));for(const _0x10b83d of _0x69a3b0['behaviors']){const _0x44f5f7=_0x10b83d[_0x478966(0x3d2)]?a30_0x3ab056[_0x478966(0x3af)]('✔'):a30_0x3ab056['red']('✘');let _0x4385e4='';if(_0x10b83d[_0x478966(0x3d2)]&&_0x10b83d[_0x478966(0x26c)]!==undefined&&_0x10b83d[_0x478966(0x2aa)]!==undefined){const _0x145b34=_0x10b83d[_0x478966(0x37b)]?.[_0x478966(0x2ec)](0x1)||'?',_0x52cd06=(_0x10b83d[_0x478966(0x37b)]??0x0)>=0x32?a30_0x3ab056['green']:(_0x10b83d[_0x478966(0x37b)]??0x0)>=0x14?a30_0x3ab056[_0x478966(0x32d)]:a30_0x3ab056[_0x478966(0x269)];_0x4385e4='\x20'+a30_0x3ab056[_0x478966(0x397)](_0x478966(0x3a5))+'\x20'+_0x52cd06(formatRows(_0x10b83d[_0x478966(0x26c)]))+'\x20('+_0x145b34+'%)\x20'+a30_0x3ab056[_0x478966(0x397)]('Events:')+'\x20'+a30_0x3ab056['cyan'](formatRows(_0x10b83d['totalEvents']));}console[_0x478966(0x353)](_0x44f5f7+'\x20'+a30_0x3ab056[_0x478966(0x30d)](_0x10b83d[_0x478966(0x1d8)])+_0x4385e4),console['error']('\x20\x20'+a30_0x3ab056['dim'](_0x478966(0x3db))+'\x20'+a30_0x3ab056[_0x478966(0x30d)](_0x10b83d[_0x478966(0x3ec)]+'.'+_0x10b83d['table']));const _0x1d0cea=_0x10b83d[_0x478966(0x369)]===_0x10b83d[_0x478966(0x3b9)]?a30_0x3ab056['dim']('Join\x20on:')+'\x20'+_0x10b83d[_0x478966(0x369)]:a30_0x3ab056[_0x478966(0x397)](_0x478966(0x3bb))+'\x20'+_0x10b83d[_0x478966(0x369)]+_0x478966(0x2a1)+_0x10b83d[_0x478966(0x3b9)];console[_0x478966(0x353)]('\x20\x20'+_0x1d0cea),console[_0x478966(0x353)]('\x20\x20'+a30_0x3ab056['dim']('Columns:')),this[_0x478966(0x239)](_0x10b83d['columns']),!_0x10b83d[_0x478966(0x3d2)]&&console[_0x478966(0x353)]('\x20\x20'+a30_0x3ab056['red'](_0x478966(0x358))+'\x20'+_0x10b83d['schemaError']);}}[a30_0x41ba90(0x239)](_0x15871e){const _0x1e5339=a30_0x41ba90;for(const _0x38e36d of _0x15871e){_0x38e36d[_0x1e5339(0x26f)]===_0x38e36d[_0x1e5339(0x3e6)]||_0x38e36d[_0x1e5339(0x3e6)]==='*'?console[_0x1e5339(0x353)](_0x1e5339(0x3ee)+_0x38e36d[_0x1e5339(0x26f)]):console[_0x1e5339(0x353)]('\x20\x20\x20\x20-\x20'+_0x38e36d['label']+'\x20'+a30_0x3ab056[_0x1e5339(0x397)]('('+_0x38e36d['column']+')'));}}[a30_0x41ba90(0x228)](_0x1659e3){const _0x123677=a30_0x41ba90;console['error']('─'['repeat'](0x3c));if(_0x1659e3[_0x123677(0x284)]['length']>0x0){console[_0x123677(0x353)]('\x0a'+a30_0x3ab056['red'](_0x123677(0x309)));for(const _0x2daca1 of _0x1659e3[_0x123677(0x284)]){console[_0x123677(0x353)]('\x20\x20'+a30_0x3ab056[_0x123677(0x269)]('•')+'\x20'+_0x2daca1);}}_0x1659e3[_0x123677(0x1d7)]&&console[_0x123677(0x353)]('\x0a'+a30_0x3ab056[_0x123677(0x3af)]('✔')+_0x123677(0x244));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']='segment:parent:preview';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x366);async[a30_0x41ba90(0x1db)](_0x23f64a){const _0x31d8a8=a30_0x41ba90,{options:_0x43d85e,args:_0x25d17c,tdx:_0x399b70}=_0x23f64a,_0x5de8df=_0x43d85e,_0x44c6f8=_0x25d17c[0x0]||_0x43d85e[_0x31d8a8(0x226)];if(!_0x44c6f8)return showParentSegmentNotSetError(_0x31d8a8(0x3d4)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x31d8a8(0x3d8)+_0x31d8a8(0x2d2)+_0x31d8a8(0x3dd)+_0x31d8a8(0x305)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x31d8a8(0x2fc)),0x1;if(!_0x5de8df[_0x31d8a8(0x398)]&&!_0x5de8df[_0x31d8a8(0x1f8)]&&!_0x5de8df[_0x31d8a8(0x3eb)]&&!_0x5de8df[_0x31d8a8(0x308)])return console['error'](a30_0x3ab056[_0x31d8a8(0x269)](_0x31d8a8(0x39a))),console[_0x31d8a8(0x353)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x31d8a8(0x353)](_0x31d8a8(0x214)),console[_0x31d8a8(0x353)](_0x31d8a8(0x356)),console[_0x31d8a8(0x353)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x31d8a8(0x353)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console['error'](_0x31d8a8(0x39b)),0x1;const _0x181ae0=resolveYamlFile(_0x44c6f8);if(!existsSync(_0x181ae0))return showFileNotFoundError(_0x181ae0,_0x44c6f8),0x1;_0x5de8df['verbose']&&(console[_0x31d8a8(0x353)](_0x31d8a8(0x34f)+_0x5de8df['site']),console[_0x31d8a8(0x353)](_0x31d8a8(0x362)+_0x181ae0));let _0x2f7eb6;try{_0x2f7eb6=readFileSync(_0x181ae0,_0x31d8a8(0x2d3));}catch(_0x47e852){const _0x11649b=_0x47e852 instanceof Error?_0x47e852[_0x31d8a8(0x1ef)]:String(_0x47e852);return console[_0x31d8a8(0x353)]('Error\x20reading\x20file:\x20'+_0x11649b),0x1;}let _0x14eec7;try{_0x14eec7=parseDef(_0x2f7eb6);}catch(_0x21d199){const _0x10d26e=_0x21d199 instanceof Error?_0x21d199[_0x31d8a8(0x1ef)]:String(_0x21d199);return console[_0x31d8a8(0x353)](a30_0x3ab056['red'](_0x31d8a8(0x25f)+_0x10d26e)),0x1;}if(_0x5de8df[_0x31d8a8(0x1f8)]===!![]||_0x5de8df[_0x31d8a8(0x1f8)]===''){const _0x204afa=_0x14eec7[_0x31d8a8(0x3f0)]?.[_0x31d8a8(0x20b)](_0x41d3a3=>_0x41d3a3[_0x31d8a8(0x1d8)])||[];if(_0x204afa[_0x31d8a8(0x1dc)]===0x0)console[_0x31d8a8(0x353)](a30_0x3ab056[_0x31d8a8(0x269)](_0x31d8a8(0x207)));else{console[_0x31d8a8(0x353)](a30_0x3ab056[_0x31d8a8(0x269)](_0x31d8a8(0x1ec))),console['error'](_0x31d8a8(0x28b));for(const _0xb39a4c of _0x204afa){console[_0x31d8a8(0x353)]('\x20\x20'+a30_0x3ab056[_0x31d8a8(0x35f)](_0xb39a4c));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x44c6f8+_0x31d8a8(0x282)+_0x204afa[0x0]+'\x22');}return 0x1;}if(_0x5de8df[_0x31d8a8(0x3eb)]===!![]||_0x5de8df[_0x31d8a8(0x3eb)]===''){const _0x4200d2=_0x14eec7[_0x31d8a8(0x29c)]?.[_0x31d8a8(0x20b)](_0x31e762=>_0x31e762['name'])||[];if(_0x4200d2[_0x31d8a8(0x1dc)]===0x0)console['error'](a30_0x3ab056[_0x31d8a8(0x269)](_0x31d8a8(0x2ba)));else{console[_0x31d8a8(0x353)](a30_0x3ab056[_0x31d8a8(0x269)](_0x31d8a8(0x3b3))),console[_0x31d8a8(0x353)](_0x31d8a8(0x3ad));for(const _0x40849f of _0x4200d2){console[_0x31d8a8(0x353)]('\x20\x20'+a30_0x3ab056[_0x31d8a8(0x35f)](_0x40849f));}console[_0x31d8a8(0x353)](_0x31d8a8(0x3c5)+_0x44c6f8+_0x31d8a8(0x34e)+_0x4200d2[0x0]+'\x22');}return 0x1;}const _0x53ba78=createCommandSpinner(a30_0x3ab056[_0x31d8a8(0x397)]('Fetching\x20sample\x20data...'),{'verbose':_0x5de8df[_0x31d8a8(0x340)]});_0x53ba78[_0x31d8a8(0x24e)]();const _0x12a7c1={'onProgress':_0x1d8377=>{const _0x2989a7=_0x31d8a8;_0x53ba78[_0x2989a7(0x37c)]=formatProgressMessage(_0x1d8377);}};if(_0x5de8df[_0x31d8a8(0x398)])_0x12a7c1[_0x31d8a8(0x398)]=!![];if(_0x5de8df[_0x31d8a8(0x1f8)]&&typeof _0x5de8df[_0x31d8a8(0x1f8)]===_0x31d8a8(0x2bc))_0x12a7c1[_0x31d8a8(0x1f8)]=_0x5de8df[_0x31d8a8(0x1f8)];if(_0x5de8df[_0x31d8a8(0x3eb)]&&typeof _0x5de8df['behavior']==='string')_0x12a7c1[_0x31d8a8(0x3eb)]=_0x5de8df['behavior'];if(_0x5de8df[_0x31d8a8(0x308)])_0x12a7c1[_0x31d8a8(0x308)]=!![];if(_0x5de8df[_0x31d8a8(0x39f)])_0x12a7c1[_0x31d8a8(0x39f)]=_0x5de8df[_0x31d8a8(0x39f)];let _0x54d78d;try{_0x54d78d=await _0x399b70[_0x31d8a8(0x2c3)][_0x31d8a8(0x2d4)](_0x2f7eb6,_0x12a7c1),_0x53ba78[_0x31d8a8(0x2de)]();}catch(_0x43180d){_0x53ba78[_0x31d8a8(0x2de)]();throw _0x43180d;}return await this[_0x31d8a8(0x2d8)](_0x54d78d,{'master':_0x5de8df[_0x31d8a8(0x398)],'attribute':typeof _0x5de8df['attribute']===_0x31d8a8(0x2bc)?_0x5de8df[_0x31d8a8(0x1f8)]:undefined,'behavior':typeof _0x5de8df[_0x31d8a8(0x3eb)]===_0x31d8a8(0x2bc)?_0x5de8df[_0x31d8a8(0x3eb)]:undefined,'enriched':_0x5de8df[_0x31d8a8(0x308)]}),_0x54d78d[_0x31d8a8(0x1d7)]?0x0:0x1;}async[a30_0x41ba90(0x2d8)](_0x5ceb04,_0x4cb5a0){const _0x1f0a9a=a30_0x41ba90;console[_0x1f0a9a(0x353)]('\x0a'+a30_0x3ab056[_0x1f0a9a(0x30d)](_0x1f0a9a(0x1f7))+'\x20'+_0x5ceb04[_0x1f0a9a(0x1d8)]),console[_0x1f0a9a(0x353)]('═'[_0x1f0a9a(0x2df)](0x3c));if(_0x4cb5a0[_0x1f0a9a(0x398)]&&_0x5ceb04[_0x1f0a9a(0x329)]){const _0x2818a4=a30_0x3ab056['dim'](_0x1f0a9a(0x393))+'\x20'+a30_0x3ab056[_0x1f0a9a(0x30d)](_0x5ceb04[_0x1f0a9a(0x398)][_0x1f0a9a(0x3ec)]+'.'+_0x5ceb04[_0x1f0a9a(0x398)]['table']);await this[_0x1f0a9a(0x2ca)](_0x2818a4,_0x5ceb04[_0x1f0a9a(0x329)]);}else{if(_0x4cb5a0[_0x1f0a9a(0x1f8)]&&_0x5ceb04['sampleData']){const _0x11422f=a30_0x3ab056[_0x1f0a9a(0x397)](_0x1f0a9a(0x382))+'\x20'+a30_0x3ab056[_0x1f0a9a(0x30d)](_0x4cb5a0[_0x1f0a9a(0x1f8)]);await this['displaySampleData'](_0x11422f,_0x5ceb04[_0x1f0a9a(0x329)]);}else{if(_0x4cb5a0[_0x1f0a9a(0x3eb)]&&_0x5ceb04['sampleData']){const _0x146a21=a30_0x3ab056[_0x1f0a9a(0x397)](_0x1f0a9a(0x342))+'\x20'+a30_0x3ab056[_0x1f0a9a(0x30d)](_0x4cb5a0[_0x1f0a9a(0x3eb)]);await this[_0x1f0a9a(0x2ca)](_0x146a21,_0x5ceb04[_0x1f0a9a(0x329)]);}else{if(_0x4cb5a0[_0x1f0a9a(0x308)]&&_0x5ceb04[_0x1f0a9a(0x329)]){const _0x445722=a30_0x3ab056['dim']('Enriched:')+'\x20'+a30_0x3ab056[_0x1f0a9a(0x30d)](_0x1f0a9a(0x368));await this[_0x1f0a9a(0x2ca)](_0x445722,_0x5ceb04[_0x1f0a9a(0x329)]);}else!_0x5ceb04[_0x1f0a9a(0x329)]&&console[_0x1f0a9a(0x353)](_0x1f0a9a(0x1ee));}}}if(_0x5ceb04['errors'][_0x1f0a9a(0x1dc)]>0x0){console[_0x1f0a9a(0x353)]('─'['repeat'](0x3c)),console[_0x1f0a9a(0x353)]('\x0a'+a30_0x3ab056[_0x1f0a9a(0x269)]('Errors:'));for(const _0x1c14f8 of _0x5ceb04[_0x1f0a9a(0x284)]){console[_0x1f0a9a(0x353)]('\x20\x20'+a30_0x3ab056['red']('•')+'\x20'+_0x1c14f8);}}}async[a30_0x41ba90(0x2ca)](_0x23000f,_0x39e0dc){const _0x199751=a30_0x41ba90;if(_0x39e0dc[_0x199751(0x1dc)]===0x0){console[_0x199751(0x353)]('\x0a'+_0x23000f),console['error'](_0x199751(0x26a));return;}console[_0x199751(0x353)]('\x0a'+_0x23000f);const _0x3c4cb5=Object[_0x199751(0x357)](_0x39e0dc[0x0])['map'](_0x44b453=>({'name':_0x44b453,'type':typeof _0x39e0dc[0x0][_0x44b453]===_0x199751(0x2e4)?_0x199751(0x1f2):_0x199751(0x312)})),_0x11f576={'queryId':_0x199751(0x3e4),'columns':_0x3c4cb5,'data':_0x39e0dc,'stats':{'state':_0x199751(0x2a3),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x39e0dc['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5e8402=formatAsTable(_0x11f576,_0x39e0dc['length'],!![]);await writeOutput(_0x5e8402,undefined,_0x199751(0x3c3));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x377);['description']='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a30_0x41ba90(0x1db)](_0x9a1235){const _0x388c80=a30_0x41ba90,{options:_0x563579,args:_0x45857b,tdx:_0x3f203c}=_0x9a1235,_0x2bf1f7=_0x563579,_0x1ce035=_0x45857b[0x0]||_0x563579[_0x388c80(0x226)];if(!_0x1ce035)return showParentSegmentNotSetError(_0x388c80(0x2a0)+_0x388c80(0x225)),0x1;const _0x198202=resolveYamlFile(_0x1ce035);if(existsSync(_0x198202)){_0x2bf1f7[_0x388c80(0x340)]&&console[_0x388c80(0x353)]('Found\x20YAML\x20file:\x20'+_0x198202);let _0x2ad437;try{_0x2ad437=readFileSync(_0x198202,_0x388c80(0x2d3));}catch(_0x5b8a85){const _0x5eff60=_0x5b8a85 instanceof Error?_0x5b8a85[_0x388c80(0x1ef)]:String(_0x5b8a85);return console['error']('Error\x20reading\x20file:\x20'+_0x5eff60),0x1;}const _0x43f55c=await withSpinner(_0x388c80(0x350),()=>_0x3f203c['segment']['pushParentYaml'](_0x2ad437),{'verbose':_0x2bf1f7['verbose']}),_0x17297d=_0x43f55c[_0x388c80(0x27a)],{isNew:_0x1bd787,name:_0x5f5079,hasChanges:_0x582c71,diffFormatted:_0xfc9abb}=_0x17297d;if(_0x582c71){_0x1bd787?console[_0x388c80(0x353)](_0x388c80(0x22d)+_0x5f5079+'\x27:'):console[_0x388c80(0x353)](_0x388c80(0x2ae)+_0x5f5079+'\x27:');console[_0x388c80(0x353)]('─'['repeat'](0x3c)),console[_0x388c80(0x353)](_0xfc9abb),console[_0x388c80(0x353)]('─'[_0x388c80(0x2df)](0x3c));const _0xe627b2=_0x1bd787?_0x388c80(0x235)+_0x5f5079+_0x388c80(0x38d):_0x388c80(0x3ac)+_0x5f5079+_0x388c80(0x38d);if(!_0x2bf1f7[_0x388c80(0x1f4)]){if(!isInteractive())return console[_0x388c80(0x353)](a30_0x3ab056[_0x388c80(0x269)]('\x0aError:'),_0x388c80(0x319)),console[_0x388c80(0x353)](a30_0x3ab056[_0x388c80(0x397)](_0x388c80(0x3e2))),0x1;const _0x301e50=await confirmKey(_0xe627b2);if(!_0x301e50)return console[_0x388c80(0x353)](a30_0x3ab056[_0x388c80(0x32d)](_0x388c80(0x388))),0x1;}const _0x1f0483=_0x1bd787?'Creating':_0x388c80(0x2a6);await withSpinner(_0x1f0483+_0x388c80(0x33c)+_0x5f5079+_0x388c80(0x277),()=>_0x17297d[_0x388c80(0x3a8)](),{'verbose':_0x2bf1f7[_0x388c80(0x340)]});const _0x21bb86=_0x1bd787?'Created':_0x388c80(0x2ad);console['error']('✔\x20'+_0x21bb86+_0x388c80(0x33c)+_0x5f5079+'\x27');}else console[_0x388c80(0x353)](_0x388c80(0x241)+_0x5f5079+_0x388c80(0x2bf));}const _0x5bf9a5=await withSpinner(_0x388c80(0x230)+_0x1ce035+_0x388c80(0x277),()=>_0x3f203c['segment'][_0x388c80(0x2f9)](_0x1ce035),{'verbose':_0x2bf1f7[_0x388c80(0x340)]}),_0x3fbd0b=_0x5bf9a5[_0x388c80(0x27a)],_0x2d1168=getConsoleUrl(_0x2bf1f7[_0x388c80(0x2f8)],_0x388c80(0x364)+_0x3fbd0b['workflowId']+_0x388c80(0x1f0)+_0x3fbd0b['workflowSessionId']+'/attempt/'+_0x3fbd0b['workflowAttemptId']);return console[_0x388c80(0x353)](_0x388c80(0x301)),console['error']('\x20\x20'+a30_0x3ab056[_0x388c80(0x397)](_0x388c80(0x2fb))+'\x20'+_0x3fbd0b['audienceId']),console['error']('\x20\x20'+a30_0x3ab056[_0x388c80(0x397)](_0x388c80(0x351))+'\x20'+_0x3fbd0b[_0x388c80(0x285)]),console['error']('\x20\x20'+a30_0x3ab056['dim']('Session:')+'\x20'+_0x3fbd0b[_0x388c80(0x392)]),console[_0x388c80(0x353)]('\x20\x20'+a30_0x3ab056[_0x388c80(0x397)](_0x388c80(0x38b))+'\x20'+_0x3fbd0b[_0x388c80(0x268)]),console[_0x388c80(0x353)]('\x20\x20'+_0x2d1168),console[_0x388c80(0x353)]('\x0a'+a30_0x3ab056[_0x388c80(0x397)](_0x388c80(0x24c))+_0x388c80(0x251)+_0x3fbd0b['workflowAttemptId']+_0x388c80(0x39e)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x365);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x3e5);async[a30_0x41ba90(0x1db)](_0x4742c0){const _0xfb6e62=a30_0x41ba90,{options:_0x51a0e2,args:_0x1616b4,tdx:_0x329c96}=_0x4742c0,_0x5483b0=_0x1616b4[0x0]||_0x51a0e2[_0xfb6e62(0x226)];if(!_0x5483b0)return showParentSegmentNotSetError(_0xfb6e62(0x32b)+_0xfb6e62(0x231)),0x1;_0x51a0e2['verbose']&&(console[_0xfb6e62(0x353)](_0xfb6e62(0x34f)+_0x51a0e2[_0xfb6e62(0x2f8)]),console[_0xfb6e62(0x353)](_0xfb6e62(0x238)+_0x5483b0));const _0x4cf7d6=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x5483b0+_0xfb6e62(0x277),()=>_0x329c96['segment']['listFields'](_0x5483b0),{'verbose':_0x51a0e2[_0xfb6e62(0x340)]}),_0x34223f=_0x4cf7d6[_0xfb6e62(0x27a)];console[_0xfb6e62(0x353)](_0xfb6e62(0x2e7)+_0x34223f[_0xfb6e62(0x1dc)]+_0xfb6e62(0x252)+(_0x34223f[_0xfb6e62(0x1dc)]!==0x1?'s':''));if(_0x51a0e2[_0xfb6e62(0x242)]||_0x51a0e2[_0xfb6e62(0x219)])return await handleSDKOutput(_0x34223f,_0x51a0e2),0x0;return displayFieldsHumanReadable(_0x34223f,_0x5483b0),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='segment:parent:view';[a30_0x41ba90(0x38a)]='Show\x20parent\x20segment\x20details';async['execute'](_0x2fad35){const _0x2a5fbf=a30_0x41ba90,{options:_0x2df8c5,args:_0x2d0122,tdx:_0x2daee4}=_0x2fad35,_0x51b760=_0x2df8c5,_0x51007b=_0x2d0122[0x0]||_0x2df8c5[_0x2a5fbf(0x226)];if(!_0x51007b)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0x2a5fbf(0x1f6)+_0x2a5fbf(0x346)+_0x2a5fbf(0x1fb)),0x1;_0x2df8c5[_0x2a5fbf(0x340)]&&(console['error']('Site:\x20'+_0x2df8c5[_0x2a5fbf(0x2f8)]),console[_0x2a5fbf(0x353)]('Parent\x20segment:\x20'+_0x51007b));const _0xc46ee2=await withSpinner(_0x2a5fbf(0x36e)+_0x51007b+_0x2a5fbf(0x277),()=>_0x2daee4[_0x2a5fbf(0x2c3)][_0x2a5fbf(0x2f4)](_0x51007b),{'verbose':_0x2df8c5['verbose']}),_0x3cc920=_0xc46ee2[_0x2a5fbf(0x27a)];if(_0x51b760[_0x2a5fbf(0x1d6)]){const _0x2130da=getConsoleNextUrl(_0x51b760[_0x2a5fbf(0x2f8)],'/app/dw/parentSegments/'+_0x3cc920['id']);return console[_0x2a5fbf(0x353)](a30_0x3ab056[_0x2a5fbf(0x3af)]('✔')+_0x2a5fbf(0x3c2)+a30_0x3ab056[_0x2a5fbf(0x35f)](_0x2130da)),openBrowser(_0x2130da),0x0;}return await handleSingleObjectOutput(_0x3cc920,_0x2df8c5),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']='segment:parent:desc';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x23b);async['execute'](_0x4cf504){const _0x5f09f0=a30_0x41ba90,{options:_0xf22935,args:_0x6b8778,tdx:_0x5badf8}=_0x4cf504,_0x11d0f5=_0xf22935,_0x4360bf=_0x6b8778[0x0]||_0xf22935[_0x5f09f0(0x226)];if(!_0x4360bf)return showParentSegmentNotSetError(_0x5f09f0(0x1d4)+_0x5f09f0(0x220)+_0x5f09f0(0x346)+_0x5f09f0(0x3d0)),0x1;_0xf22935[_0x5f09f0(0x340)]&&(console['error']('Site:\x20'+_0xf22935[_0x5f09f0(0x2f8)]),console[_0x5f09f0(0x353)](_0x5f09f0(0x238)+_0x4360bf));const _0x77d47=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4360bf+'\x27...',()=>_0x5badf8[_0x5f09f0(0x2c3)][_0x5f09f0(0x361)](_0x4360bf),{'verbose':_0xf22935[_0x5f09f0(0x340)]}),_0x2a05b1=_0x77d47[_0x5f09f0(0x27a)],_0x1e9e5d=_0x5badf8['segment'][_0x5f09f0(0x372)](_0x2a05b1);if(_0x11d0f5[_0x5f09f0(0x31f)]){const _0x381d94=await this['collectSchema'](_0x4cf504,_0x4360bf,_0x2a05b1,_0x1e9e5d),_0x4fc45f=this[_0x5f09f0(0x3b5)](_0x381d94);writeFileSync(_0x11d0f5[_0x5f09f0(0x31f)],_0x4fc45f);const _0x5a0489=_0x381d94['customers'][_0x5f09f0(0x29e)][_0x5f09f0(0x1dc)]+_0x381d94[_0x5f09f0(0x29c)][_0x5f09f0(0x281)]((_0x143507,_0x2b350b)=>_0x143507+_0x2b350b[_0x5f09f0(0x29e)][_0x5f09f0(0x1dc)],0x0),_0x57d2ed=_0x381d94[_0x5f09f0(0x29c)][_0x5f09f0(0x331)](_0x471ab5=>_0x471ab5[_0x5f09f0(0x29e)][_0x5f09f0(0x1dc)]===0x0)[_0x5f09f0(0x1dc)];return console[_0x5f09f0(0x276)](_0x5f09f0(0x290)+_0x11d0f5[_0x5f09f0(0x31f)]),console[_0x5f09f0(0x276)]('\x20\x20Database:\x20'+_0x1e9e5d),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x381d94[_0x5f09f0(0x29c)][_0x5f09f0(0x1dc)]+_0x5f09f0(0x30a)),console['log'](_0x5f09f0(0x223)+_0x5a0489+_0x5f09f0(0x2f1)),_0x57d2ed>0x0&&console[_0x5f09f0(0x276)](_0x5f09f0(0x2d0)+_0x57d2ed+_0x5f09f0(0x29d)),0x0;}console[_0x5f09f0(0x353)]('\x0a'+a30_0x3ab056[_0x5f09f0(0x30d)](_0x5f09f0(0x373))+'\x20'+a30_0x3ab056[_0x5f09f0(0x35f)](_0x1e9e5d));const _0xc68265=await withSpinner(_0x5f09f0(0x3c1),()=>_0x5badf8[_0x5f09f0(0x2c3)][_0x5f09f0(0x21a)](_0x2a05b1),{'verbose':_0xf22935[_0x5f09f0(0x340)]});console[_0x5f09f0(0x353)]('\x0a'+a30_0x3ab056[_0x5f09f0(0x30d)](_0x5f09f0(0x35b))+'\x20'+a30_0x3ab056['dim']('('+_0x1e9e5d+_0x5f09f0(0x28f)));const _0x2f1661=await executeSchemaQuery(_0xc68265[_0x5f09f0(0x27a)],_0x5badf8,_0xf22935);await handleQueryOutput(_0x2f1661,_0xf22935);const _0x4da09d=await withSpinner(_0x5f09f0(0x201),()=>_0x5badf8['segment'][_0x5f09f0(0x3d3)](_0x2a05b1),{'verbose':_0xf22935[_0x5f09f0(0x340)]});for(const _0x473ded of _0x4da09d[_0x5f09f0(0x27a)]){const _0x188d7f=_0x5f09f0(0x3c0)+_0x473ded[_0x5f09f0(0x317)]()['replace'](/\s+/g,'_'),_0x23c687=_0x5f09f0(0x3d1)+_0x1e9e5d+'.'+_0x188d7f;console[_0x5f09f0(0x353)]('\x0a'+a30_0x3ab056[_0x5f09f0(0x30d)](_0x473ded)+'\x20'+a30_0x3ab056[_0x5f09f0(0x397)]('('+_0x1e9e5d+'.'+_0x188d7f+')'));try{const _0x30895a=await executeSchemaQuery(_0x23c687,_0x5badf8,_0xf22935);await handleQueryOutput(_0x30895a,_0xf22935);}catch{console[_0x5f09f0(0x353)](a30_0x3ab056['yellow'](_0x5f09f0(0x3e7)));}}return 0x0;}async[a30_0x41ba90(0x3de)](_0xd90f98,_0x4c5282,_0x3fbda5,_0x29af99){const _0x112786=a30_0x41ba90,{options:_0x58c575,tdx:_0x16a4ba}=_0xd90f98,_0x2ffa7a=await withSpinner(_0x112786(0x3c1),()=>_0x16a4ba['segment'][_0x112786(0x21a)](_0x3fbda5),{'verbose':_0x58c575[_0x112786(0x340)]}),_0x1e2839=await executeSchemaQuery(_0x2ffa7a['data'],_0x16a4ba,_0x58c575),_0x34c93f=_0x1e2839[_0x112786(0x27a)]['map'](_0x2e8838=>({'name':_0x2e8838[_0x112786(0x3d7)],'type':_0x2e8838[_0x112786(0x3bc)]})),_0x58074c=await withSpinner(_0x112786(0x201),()=>_0x16a4ba[_0x112786(0x2c3)][_0x112786(0x3d3)](_0x3fbda5),{'verbose':_0x58c575[_0x112786(0x340)]}),_0x2f047c=[];for(const _0x344649 of _0x58074c['data']){const _0x445873=_0x112786(0x3c0)+_0x344649['toLowerCase']()[_0x112786(0x33e)](/\s+/g,'_'),_0x2f3cc0=_0x112786(0x3d1)+_0x29af99+'.'+_0x445873;let _0xe2ef8a=[];try{const _0x34a3c7=await executeSchemaQuery(_0x2f3cc0,_0x16a4ba,_0x58c575);_0xe2ef8a=_0x34a3c7[_0x112786(0x27a)]['map'](_0x4bd400=>({'name':_0x4bd400['column_name'],'type':_0x4bd400['column_type']}));}catch{}_0x2f047c[_0x112786(0x360)]({'table':_0x445873,'columns':_0xe2ef8a});}return{'database':_0x29af99,'parent_segment':_0x4c5282,'parent_id':_0x3fbda5,'customers':{'table':_0x112786(0x35b),'columns':_0x34c93f},'behaviors':_0x2f047c};}[a30_0x41ba90(0x3b5)](_0x49d33c){const _0x192f53=a30_0x41ba90,_0x10782d=_0x28d259=>{const _0x494193=a30_0x49a8;if(_0x28d259[_0x494193(0x1dc)]===0x0)return'[]';const _0x174b85=_0x28d259[_0x494193(0x20b)](_0x17b95a=>_0x494193(0x2bb)+_0x17b95a['name']+_0x494193(0x2a5)+_0x17b95a[_0x494193(0x1e4)]+_0x494193(0x303));return'[\x0a'+_0x174b85[_0x494193(0x20d)](',\x0a')+_0x494193(0x3c6);},_0x199245=_0x49d33c[_0x192f53(0x29c)][_0x192f53(0x20b)](_0x475396=>{const _0x52eaf5=_0x192f53;return _0x52eaf5(0x22b)+_0x475396['table']+_0x52eaf5(0x24d)+_0x10782d(_0x475396[_0x52eaf5(0x29e)])['replace'](/^/gm,'\x20\x20')['trim']()+'\x0a\x20\x20\x20\x20}';})[_0x192f53(0x20d)](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x49d33c['database']+_0x192f53(0x315)+_0x49d33c['parent_segment']+_0x192f53(0x321)+_0x49d33c[_0x192f53(0x3ae)]+_0x192f53(0x1ea)+_0x49d33c[_0x192f53(0x35b)][_0x192f53(0x3c3)]+_0x192f53(0x1e7)+_0x10782d(_0x49d33c['customers']['columns'])[_0x192f53(0x33e)](/^/gm,'\x20\x20')[_0x192f53(0x291)]()+_0x192f53(0x2b7)+_0x199245+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x2da);[a30_0x41ba90(0x38a)]='Get\x20SQL\x20query\x20for\x20parent\x20segment';async[a30_0x41ba90(0x1db)](_0x38efb0){const _0x290ca7=a30_0x41ba90,{options:_0xc014de,args:_0x4628fd,tdx:_0x5e4543}=_0x38efb0,_0x2967ce=_0x4628fd[0x0]||_0xc014de[_0x290ca7(0x226)];if(!_0x2967ce)return showParentSegmentNotSetError(_0x290ca7(0x20c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0xc014de[_0x290ca7(0x340)]&&(console['error']('Site:\x20'+_0xc014de[_0x290ca7(0x2f8)]),console[_0x290ca7(0x353)]('Parent\x20segment:\x20'+_0x2967ce));const _0x4d45f0=await withSpinner(_0x290ca7(0x324)+_0x2967ce+_0x290ca7(0x277),()=>_0x5e4543['segment'][_0x290ca7(0x361)](_0x2967ce),{'verbose':_0xc014de[_0x290ca7(0x340)]}),_0x2ed414=_0x4d45f0['data'],_0x35f169=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x2967ce+'\x27...',()=>_0x5e4543[_0x290ca7(0x2c3)][_0x290ca7(0x21a)](_0x2ed414),{'verbose':_0xc014de['verbose']}),_0x5ee75a=_0x35f169[_0x290ca7(0x27a)];return _0xc014de[_0x290ca7(0x224)]===_0x290ca7(0x242)||_0xc014de['format']===_0x290ca7(0x219)?await handleSDKOutput([{'sql':_0x5ee75a}],_0xc014de):console['log'](_0x5ee75a),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x36d);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x2fa);async['execute'](_0x42be2d){const _0x231b48=a30_0x41ba90,{options:_0xa7cd55,args:_0xc1c908,tdx:_0x167471}=_0x42be2d,_0x4ebb23=_0xc1c908[0x0]||_0xa7cd55[_0x231b48(0x226)];if(!_0x4ebb23)return showParentSegmentNotSetError(_0x231b48(0x2f0)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0xa7cd55['verbose']&&(console[_0x231b48(0x353)]('Site:\x20'+_0xa7cd55[_0x231b48(0x2f8)]),console['error'](_0x231b48(0x238)+_0x4ebb23));const _0x4a8379=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4ebb23+_0x231b48(0x277),()=>_0x167471['segment'][_0x231b48(0x361)](_0x4ebb23),{'verbose':_0xa7cd55['verbose']}),_0x9d02d2=_0x4a8379[_0x231b48(0x27a)],_0x570f05=await withSpinner(_0x231b48(0x36a)+_0x4ebb23+_0x231b48(0x277),()=>_0x167471[_0x231b48(0x2c3)][_0x231b48(0x21a)](_0x9d02d2),{'verbose':_0xa7cd55[_0x231b48(0x340)]});let _0x445803=_0x570f05['data'];const _0x52a244=resolveLimit(_0xa7cd55['limit'],DEFAULT_DISPLAY_LIMIT),_0x1799e4=/\bLIMIT\s+\d+/i[_0x231b48(0x2b3)](_0x445803);!_0x1799e4&&(_0x445803=_0x445803[_0x231b48(0x291)]()['replace'](/;+$/,''),_0x445803='SELECT\x20*\x20FROM\x20(\x0a'+_0x445803+_0x231b48(0x347)+_0x52a244);_0xa7cd55['verbose']&&console['error'](_0x231b48(0x341)+_0x445803);const _0x4d8829=await withProgressSpinner(_0x231b48(0x1f5),async _0x351efc=>{const _0x49a67f=_0x231b48,_0x339cd2=await _0x167471[_0x49a67f(0x32e)][_0x49a67f(0x1db)](_0x445803,{'catalog':'td','schema':'information_schema','onJobId':_0x3974af=>{_0x351efc['setJobId'](_0x3974af);}});return _0x339cd2;},{'verbose':_0xa7cd55[_0x231b48(0x340)]}),_0x4e5308=_0x4d8829[_0x231b48(0x27a)],_0x188c49=_0x4e5308[_0x231b48(0x1e3)]?_0x231b48(0x38f)+_0x4e5308[_0x231b48(0x1e3)]+']':'';return console[_0x231b48(0x353)](_0x231b48(0x2a8)+_0x4e5308[_0x231b48(0x297)][_0x231b48(0x253)][_0x231b48(0x3ab)]()+_0x231b48(0x2cd)+(_0x231b48(0x1eb)+formatElapsed(_0x4e5308[_0x231b48(0x297)][_0x231b48(0x23e)])+_0x188c49)),await handleQueryOutput(_0x4e5308,_0xa7cd55),0x0;}}export class PSRtListCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x32f);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x25b);async[a30_0x41ba90(0x1db)](_0x5c5f8f){const _0x552a8b=a30_0x41ba90,{options:_0x480eb1,args:_0x518898,tdx:_0x134350}=_0x5c5f8f,_0x1eda18=_0x518898[0x0],_0x20f2f2=await withSpinner(_0x1eda18?_0x552a8b(0x29b)+_0x1eda18+_0x552a8b(0x277):_0x552a8b(0x3e9),()=>_0x134350[_0x552a8b(0x2fe)][_0x552a8b(0x212)](),{'verbose':_0x480eb1['verbose']});let _0x2fe016=_0x20f2f2[_0x552a8b(0x27a)][_0x552a8b(0x331)](_0x988066=>_0x988066[_0x552a8b(0x2c2)]);if(_0x1eda18){const _0x3b8c67=_0x1eda18[_0x552a8b(0x33e)](/[.+^${}()|[\]\\]/g,_0x552a8b(0x258))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4f3e1a=new RegExp('^'+_0x3b8c67+'$','i');_0x2fe016=_0x2fe016[_0x552a8b(0x331)](_0x5954ad=>_0x4f3e1a['test'](_0x5954ad['name']));}_0x2fe016[_0x552a8b(0x2dd)]((_0x167da2,_0x4404b0)=>_0x167da2[_0x552a8b(0x1d8)]['localeCompare'](_0x4404b0[_0x552a8b(0x1d8)])),console[_0x552a8b(0x353)]('✔\x20Found\x20'+_0x2fe016['length']+_0x552a8b(0x2ab)+(_0x2fe016['length']!==0x1?'s':''));const _0x37b955=_0x565e07=>{const _0x4c084f=_0x552a8b;return getConsoleNextUrl(_0x480eb1[_0x4c084f(0x2f8)],'/app/dw/parentSegments/'+_0x565e07);};if(_0x480eb1[_0x552a8b(0x224)]===_0x552a8b(0x242)||_0x480eb1['format']==='jsonl'){const _0x22945a=_0x2fe016[_0x552a8b(0x20b)](_0x12750b=>({..._0x12750b,'url':_0x37b955(_0x12750b['id'])}));await handleSDKOutput(_0x22945a,_0x480eb1);}else{if(_0x2fe016[_0x552a8b(0x1dc)]===0x0)console['log'](_0x552a8b(0x24b));else for(const _0x4f19a7 of _0x2fe016){const _0x3099b6=_0x4f19a7[_0x552a8b(0x1f3)]?a30_0x3ab056['dim']('\x20('+formatRows(_0x4f19a7['population'])+')'):'',_0x35667a=hyperlink(_0x4f19a7[_0x552a8b(0x1d8)],_0x37b955(_0x4f19a7['id']));console['log']('⚡\x20'+_0x35667a+_0x3099b6);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x29a);[a30_0x41ba90(0x38a)]='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a30_0x41ba90(0x1db)](_0x4839ef){const _0x2dd6ce=a30_0x41ba90,{options:_0x6fedf6,args:_0x4f7b63,tdx:_0x5ad33c}=_0x4839ef,_0x290197=_0x4f7b63[0x0]||_0x6fedf6[_0x2dd6ce(0x226)];if(!_0x290197)return showParentSegmentNotSetError(_0x2dd6ce(0x2ed)+_0x2dd6ce(0x306)),0x1;const _0x5e9f6b=resolveYamlFile(_0x290197);if(!existsSync(_0x5e9f6b))return showFileNotFoundError(_0x5e9f6b,_0x290197),0x1;let _0xd95e1e;try{_0xd95e1e=readFileSync(_0x5e9f6b,_0x2dd6ce(0x2d3));}catch(_0x219a11){const _0x93572=_0x219a11 instanceof Error?_0x219a11[_0x2dd6ce(0x1ef)]:String(_0x219a11);return console[_0x2dd6ce(0x353)](_0x2dd6ce(0x236)+_0x93572),0x1;}const _0x122c37=createCommandSpinner(a30_0x3ab056[_0x2dd6ce(0x397)](_0x2dd6ce(0x25a)),{'verbose':_0x6fedf6[_0x2dd6ce(0x340)]});_0x122c37['start']();const _0x367c7a={'realtime':!![],'onProgress':_0x26eb57=>{const _0x123dfc=_0x2dd6ce;_0x122c37[_0x123dfc(0x37c)]=formatProgressMessage(_0x26eb57);}};let _0x44dad4;try{_0x44dad4=await _0x5ad33c[_0x2dd6ce(0x2c3)][_0x2dd6ce(0x2e5)](_0xd95e1e,_0x367c7a),_0x122c37['stop']();}catch(_0x29e1e8){_0x122c37[_0x2dd6ce(0x2de)]();throw _0x29e1e8;}console[_0x2dd6ce(0x353)]('\x0a'+a30_0x3ab056[_0x2dd6ce(0x30d)](_0x2dd6ce(0x264))+'\x20'+_0x44dad4[_0x2dd6ce(0x1d8)]),console[_0x2dd6ce(0x353)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x44dad4),console[_0x2dd6ce(0x353)]('─'[_0x2dd6ce(0x2df)](0x3c));if(_0x44dad4['errors'][_0x2dd6ce(0x1dc)]>0x0){console[_0x2dd6ce(0x353)]('\x0a'+a30_0x3ab056[_0x2dd6ce(0x269)](_0x2dd6ce(0x309)));for(const _0x54e9b2 of _0x44dad4[_0x2dd6ce(0x284)]){console[_0x2dd6ce(0x353)]('\x20\x20'+a30_0x3ab056['red']('•')+'\x20'+_0x54e9b2);}}return _0x44dad4[_0x2dd6ce(0x1d7)]&&console[_0x2dd6ce(0x353)]('\x0a'+a30_0x3ab056[_0x2dd6ce(0x3af)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x44dad4[_0x2dd6ce(0x1d7)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:rt:jn:list';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x23f);async[a30_0x41ba90(0x1db)](_0x32afae){const _0x2d9897=a30_0x41ba90,{options:_0x359c33,args:_0x5151a1,tdx:_0x5e1222}=_0x32afae,_0x2a8f0f=_0x5151a1[0x0]||_0x359c33[_0x2d9897(0x226)];if(!_0x2a8f0f)return showParentSegmentNotSetError(_0x2d9897(0x31e)+_0x2d9897(0x1d2)),0x1;_0x359c33[_0x2d9897(0x340)]&&(console[_0x2d9897(0x353)](_0x2d9897(0x34f)+_0x359c33[_0x2d9897(0x2f8)]),console[_0x2d9897(0x353)]('Parent\x20segment:\x20'+_0x2a8f0f));const _0x34a6bb=await withSpinner(_0x2d9897(0x324)+_0x2a8f0f+_0x2d9897(0x277),()=>_0x5e1222[_0x2d9897(0x2c3)][_0x2d9897(0x361)](_0x2a8f0f),{'verbose':_0x359c33['verbose']}),_0x11aa6f=_0x34a6bb[_0x2d9897(0x27a)],_0x5554e5=await withSpinner(_0x2d9897(0x3df)+_0x2a8f0f+'\x27...',()=>_0x5e1222['realtime'][_0x2d9897(0x2cb)](_0x11aa6f),{'verbose':_0x359c33[_0x2d9897(0x340)]}),_0x1d7ad6=_0x5554e5[_0x2d9897(0x27a)];console['error'](_0x2d9897(0x2e7)+_0x1d7ad6[_0x2d9897(0x1dc)]+'\x20RT\x20journey'+(_0x1d7ad6[_0x2d9897(0x1dc)]!==0x1?'s':''));if(_0x359c33[_0x2d9897(0x224)]===_0x2d9897(0x242)||_0x359c33[_0x2d9897(0x224)]===_0x2d9897(0x219))await handleSDKOutput(_0x1d7ad6,_0x359c33);else{if(_0x1d7ad6['length']===0x0)console['log'](_0x2d9897(0x3bd));else for(const _0x3b20da of _0x1d7ad6){const _0x30481d=_0x3b20da[_0x2d9897(0x20a)]===_0x2d9897(0x255)?'🚀':'📝',_0x2f48f2=_0x3b20da[_0x2d9897(0x3a0)]?a30_0x3ab056['yellow']('\x20(paused)'):'',_0x1f2c82=a30_0x3ab056['dim']('\x20('+_0x3b20da[_0x2d9897(0x233)]+'\x20stage'+(_0x3b20da['stageCount']!==0x1?'s':'')+')');console['log'](_0x30481d+'\x20'+_0x3b20da['name']+_0x2f48f2+_0x1f2c82);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:rt:jn:pause';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x39c);async[a30_0x41ba90(0x1db)](_0x28d0e7){const _0xf591a5=a30_0x41ba90,{options:_0x199f59,args:_0x57d25f,tdx:_0x4280c1}=_0x28d0e7,_0x161a1e=_0x57d25f[0x0];if(!_0x161a1e)return console[_0xf591a5(0x353)](a30_0x3ab056[_0xf591a5(0x269)](_0xf591a5(0x261))),console[_0xf591a5(0x353)](_0xf591a5(0x32a)),console[_0xf591a5(0x353)](a30_0x3ab056['dim'](_0xf591a5(0x256))),0x1;_0x199f59['verbose']&&(console[_0xf591a5(0x353)](_0xf591a5(0x34f)+_0x199f59[_0xf591a5(0x2f8)]),console[_0xf591a5(0x353)](_0xf591a5(0x279)+_0x161a1e));const _0x51f443=await withSpinner(_0xf591a5(0x213)+_0x161a1e+_0xf591a5(0x277),()=>_0x4280c1[_0xf591a5(0x2fe)][_0xf591a5(0x334)](_0x161a1e),{'verbose':_0x199f59[_0xf591a5(0x340)]}),_0x5a7e03=_0x51f443[_0xf591a5(0x27a)];console[_0xf591a5(0x353)](_0xf591a5(0x3e0)+_0x5a7e03['name']+'\x27');if(_0x199f59[_0xf591a5(0x224)]===_0xf591a5(0x242)||_0x199f59[_0xf591a5(0x224)]===_0xf591a5(0x219))await handleSDKOutput([_0x5a7e03],_0x199f59);else{const _0x48363c=_0x5a7e03['state']===_0xf591a5(0x255)?'🚀':'📝',_0x4e7e23=_0x5a7e03['paused']?a30_0x3ab056['yellow'](_0xf591a5(0x28c)):'';console[_0xf591a5(0x276)](_0x48363c+'\x20'+_0x5a7e03[_0xf591a5(0x1d8)]+_0x4e7e23);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x3dc);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x39d);async[a30_0x41ba90(0x1db)](_0x529c6f){const _0x16a36f=a30_0x41ba90,{options:_0x46f794,args:_0x155786,tdx:_0x29ebbc}=_0x529c6f,_0x1797fc=_0x155786[0x0];if(!_0x1797fc)return console[_0x16a36f(0x353)](a30_0x3ab056['red'](_0x16a36f(0x261))),console[_0x16a36f(0x353)](_0x16a36f(0x2f6)),console[_0x16a36f(0x353)](a30_0x3ab056[_0x16a36f(0x397)](_0x16a36f(0x256))),0x1;_0x46f794[_0x16a36f(0x340)]&&(console['error']('Site:\x20'+_0x46f794[_0x16a36f(0x2f8)]),console[_0x16a36f(0x353)](_0x16a36f(0x279)+_0x1797fc));const _0x3e68e3=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1797fc+_0x16a36f(0x277),()=>_0x29ebbc[_0x16a36f(0x2fe)][_0x16a36f(0x3aa)](_0x1797fc),{'verbose':_0x46f794[_0x16a36f(0x340)]}),_0x3e9c8c=_0x3e68e3['data'];console['error'](_0x16a36f(0x3ef)+_0x3e9c8c[_0x16a36f(0x1d8)]+'\x27');if(_0x46f794['format']===_0x16a36f(0x242)||_0x46f794[_0x16a36f(0x224)]===_0x16a36f(0x219))await handleSDKOutput([_0x3e9c8c],_0x46f794);else{const _0x4ea4b8=_0x3e9c8c[_0x16a36f(0x20a)]===_0x16a36f(0x255)?'🚀':'📝',_0x24199d=_0x3e9c8c[_0x16a36f(0x3a0)]?a30_0x3ab056[_0x16a36f(0x32d)]('\x20(paused)'):'';console['log'](_0x4ea4b8+'\x20'+_0x3e9c8c[_0x16a36f(0x1d8)]+_0x24199d);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']='ps:rt:configuration_versions';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x389);async[a30_0x41ba90(0x1db)](_0x15bec7){const _0x1943d4=a30_0x41ba90,{options:_0xb49661,args:_0x3bcfa3,tdx:_0x5a1b04}=_0x15bec7,_0x22b389=_0x3bcfa3[0x0]||_0xb49661[_0x1943d4(0x226)];if(!_0x22b389)return showParentSegmentNotSetError(_0x1943d4(0x30f)+_0x1943d4(0x33d)),0x1;_0xb49661['verbose']&&(console[_0x1943d4(0x353)](_0x1943d4(0x34f)+_0xb49661['site']),console[_0x1943d4(0x353)]('Parent\x20segment:\x20'+_0x22b389));const _0x3f915d=await withSpinner(_0x1943d4(0x324)+_0x22b389+_0x1943d4(0x277),()=>_0x5a1b04[_0x1943d4(0x2c3)][_0x1943d4(0x361)](_0x22b389),{'verbose':_0xb49661[_0x1943d4(0x340)]}),_0x401cfa=_0x3f915d['data'],_0x19032f=await withSpinner(_0x1943d4(0x3b2)+_0x22b389+_0x1943d4(0x277),()=>_0x5a1b04[_0x1943d4(0x2fe)]['getCurrentConfigVersion'](_0x401cfa),{'verbose':_0xb49661[_0x1943d4(0x340)]}),_0x45f33c=_0x19032f[_0x1943d4(0x27a)];return console['error'](_0x1943d4(0x307)),_0xb49661['format']===_0x1943d4(0x242)||_0xb49661[_0x1943d4(0x224)]===_0x1943d4(0x219)?await handleSDKOutput([_0x45f33c],_0xb49661):(console[_0x1943d4(0x276)](_0x1943d4(0x263)+_0x45f33c['id']),console[_0x1943d4(0x276)](_0x1943d4(0x27e)+_0x45f33c[_0x1943d4(0x227)]),console['log'](_0x1943d4(0x31a)+_0x45f33c[_0x1943d4(0x22a)]),console[_0x1943d4(0x276)]('eventKind:\x20'+_0x45f33c[_0x1943d4(0x2a4)]),console[_0x1943d4(0x276)](_0x1943d4(0x203)+_0x45f33c[_0x1943d4(0x285)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:pz:service:list';[a30_0x41ba90(0x38a)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async[a30_0x41ba90(0x1db)](_0x1a2d5f){const _0x389c2a=a30_0x41ba90,{options:_0x50605b,args:_0x5ca8b0,tdx:_0x3771a9}=_0x1a2d5f,_0xf9b3ba=_0x5ca8b0[0x0]||_0x50605b[_0x389c2a(0x226)];if(!_0xf9b3ba)return showParentSegmentNotSetError(_0x389c2a(0x1d9)+_0x389c2a(0x20f)),0x1;const _0x1df289=await withSpinner(_0x389c2a(0x324)+_0xf9b3ba+'\x27...',()=>_0x3771a9[_0x389c2a(0x2c3)]['resolveParentId'](_0xf9b3ba),{'verbose':_0x50605b[_0x389c2a(0x340)]}),_0x4ade1f=_0x1df289['data'],_0x2a99c7=await withSpinner(_0x389c2a(0x30c)+_0xf9b3ba+'\x27...',()=>_0x3771a9['personalization'][_0x389c2a(0x212)](_0x4ade1f),{'verbose':_0x50605b[_0x389c2a(0x340)]}),_0x4d9ed2=_0x2a99c7['data'];console[_0x389c2a(0x353)](_0x389c2a(0x2e7)+_0x4d9ed2[_0x389c2a(0x1dc)]+_0x389c2a(0x383)+(_0x4d9ed2[_0x389c2a(0x1dc)]!==0x1?'s':''));if(_0x50605b[_0x389c2a(0x224)]===_0x389c2a(0x242)||_0x50605b[_0x389c2a(0x224)]===_0x389c2a(0x219))await handleSDKOutput(_0x4d9ed2,_0x50605b);else{if(_0x4d9ed2['length']===0x0)console['log'](_0x389c2a(0x2f2)),console['error'](a30_0x3ab056[_0x389c2a(0x35f)](_0x389c2a(0x2ce)));else for(const _0x57c9e3 of _0x4d9ed2){console[_0x389c2a(0x276)](a30_0x3ab056['bold'](_0x57c9e3[_0x389c2a(0x1d8)])+'\x20'+a30_0x3ab056[_0x389c2a(0x397)]('(id:\x20'+_0x57c9e3['id']+')'));_0x57c9e3['description']&&console['log']('\x20\x20'+a30_0x3ab056[_0x389c2a(0x397)](_0x57c9e3[_0x389c2a(0x38a)]));if(_0x57c9e3['tokens']&&_0x57c9e3[_0x389c2a(0x2d6)][_0x389c2a(0x1dc)]>0x0)for(const _0xd405e4 of _0x57c9e3[_0x389c2a(0x2d6)]){const _0x37027b=_0xd405e4[_0x389c2a(0x209)]?.['length']?_0xd405e4['allowedIps'][_0x389c2a(0x20d)](',\x20'):'any';console[_0x389c2a(0x276)]('\x20\x20'+a30_0x3ab056[_0x389c2a(0x35f)](_0x389c2a(0x292))+'\x20'+_0xd405e4['name']+'\x20'+a30_0x3ab056['dim'](_0x389c2a(0x1e8)+_0xd405e4['id']+')')),console['log'](_0x389c2a(0x3b7)+a30_0x3ab056[_0x389c2a(0x397)]('allowed\x20IPs:')+'\x20'+_0x37027b);}else console[_0x389c2a(0x276)]('\x20\x20'+a30_0x3ab056[_0x389c2a(0x397)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:pz:service:create';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x2eb);async[a30_0x41ba90(0x1db)](_0x5ea179){const _0x180206=a30_0x41ba90,{options:_0xa8f845,args:_0x2d95aa,tdx:_0x4238d2}=_0x5ea179,_0x71a6c5=_0xa8f845,_0x12f7e5=_0x2d95aa[0x0],_0x5f0036=_0x2d95aa[0x1]||_0xa8f845[_0x180206(0x226)];if(!_0x12f7e5)return console[_0x180206(0x353)](_0x180206(0x1df)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]'),console[_0x180206(0x353)](_0x180206(0x2d7)),0x1;if(!_0x5f0036)return showParentSegmentNotSetError(_0x180206(0x1d5)+_0x180206(0x2d7)),0x1;const _0x2b5db3=await withSpinner(_0x180206(0x324)+_0x5f0036+_0x180206(0x277),()=>_0x4238d2[_0x180206(0x2c3)][_0x180206(0x361)](_0x5f0036),{'verbose':_0xa8f845[_0x180206(0x340)]}),_0x460069=_0x2b5db3[_0x180206(0x27a)],_0x33cb9e={'name':_0x12f7e5,'description':_0x71a6c5[_0x180206(0x38a)],'public':_0x71a6c5[_0x180206(0x2fd)]},_0x295572=await withSpinner('Creating\x20personalization\x20service\x20\x27'+_0x12f7e5+_0x180206(0x277),()=>_0x4238d2['personalization'][_0x180206(0x2f3)](_0x460069,_0x33cb9e),{'verbose':_0xa8f845[_0x180206(0x340)]}),_0x13d5d1=_0x295572['data'];return console['error']('✔\x20Created\x20personalization\x20service\x20\x27'+_0x13d5d1[_0x180206(0x1d8)]+_0x180206(0x384)+_0x13d5d1['id']),await handleSDKOutput([_0x13d5d1],_0xa8f845),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x2cf);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x322);async[a30_0x41ba90(0x1db)](_0x321ea5){const _0x401c5d=a30_0x41ba90,{options:_0x1c0920,args:_0x539cdb,tdx:_0x48b594}=_0x321ea5,_0x56cd42=_0x539cdb[0x0],_0x2dbaa7=_0x539cdb[0x1]||_0x1c0920[_0x401c5d(0x226)];if(!_0x56cd42)return console[_0x401c5d(0x353)](_0x401c5d(0x222)),console[_0x401c5d(0x353)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x401c5d(0x353)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x2dbaa7)return showParentSegmentNotSetError(_0x401c5d(0x237)+_0x401c5d(0x34a)),0x1;const _0x1da585=await withSpinner(_0x401c5d(0x324)+_0x2dbaa7+_0x401c5d(0x277),()=>_0x48b594['segment']['resolveParentId'](_0x2dbaa7),{'verbose':_0x1c0920[_0x401c5d(0x340)]}),_0x16bec4=_0x1da585[_0x401c5d(0x27a)],_0x5eadc0=await withSpinner(_0x401c5d(0x247)+_0x56cd42+'\x27...',()=>_0x48b594[_0x401c5d(0x1de)][_0x401c5d(0x326)](_0x16bec4,_0x56cd42),{'verbose':_0x1c0920[_0x401c5d(0x340)]}),_0x2b1000=_0x5eadc0[_0x401c5d(0x27a)];if(_0x1c0920[_0x401c5d(0x242)]||_0x1c0920['jsonl'])await handleSDKOutput([_0x2b1000],_0x1c0920);else{console[_0x401c5d(0x276)](a30_0x3ab056[_0x401c5d(0x30d)](_0x2b1000[_0x401c5d(0x1d8)])+'\x20'+a30_0x3ab056[_0x401c5d(0x397)]('(id:\x20'+_0x2b1000['id']+')'));_0x2b1000[_0x401c5d(0x38a)]&&console[_0x401c5d(0x276)]('\x20\x20'+a30_0x3ab056[_0x401c5d(0x397)](_0x2b1000[_0x401c5d(0x38a)]));console[_0x401c5d(0x276)]('\x20\x20'+a30_0x3ab056['cyan'](_0x401c5d(0x35e))+'\x20'+(_0x2b1000[_0x401c5d(0x2fd)]?_0x401c5d(0x1f4):'no'));if(_0x2b1000[_0x401c5d(0x2d6)]&&_0x2b1000[_0x401c5d(0x2d6)][_0x401c5d(0x1dc)]>0x0)for(const _0x4b1858 of _0x2b1000[_0x401c5d(0x2d6)]){const _0x15fbac=_0x4b1858[_0x401c5d(0x209)]?.['length']?_0x4b1858[_0x401c5d(0x209)]['join'](',\x20'):_0x401c5d(0x3a9);console[_0x401c5d(0x276)]('\x20\x20'+a30_0x3ab056[_0x401c5d(0x35f)](_0x401c5d(0x292))+'\x20'+_0x4b1858[_0x401c5d(0x1d8)]+'\x20'+a30_0x3ab056[_0x401c5d(0x397)](_0x401c5d(0x1e8)+_0x4b1858['id']+')')),console[_0x401c5d(0x276)](_0x401c5d(0x3b7)+a30_0x3ab056['dim'](_0x401c5d(0x367))+'\x20'+_0x15fbac);}else console['log']('\x20\x20'+a30_0x3ab056[_0x401c5d(0x397)](_0x401c5d(0x344)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x3e8);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x29f);async[a30_0x41ba90(0x1db)](_0x2650c4){const _0x39c279=a30_0x41ba90,{options:_0x2ad370,args:_0x25b5fd,tdx:_0x3fdfb5}=_0x2650c4,_0x1f0e84=_0x25b5fd[0x0],_0x239651=_0x25b5fd[0x1]||_0x2ad370['parentSegment'];if(!_0x1f0e84)return console[_0x39c279(0x353)](_0x39c279(0x222)),console[_0x39c279(0x353)](_0x39c279(0x3ba)),console['error'](_0x39c279(0x267)),0x1;if(!_0x239651)return showParentSegmentNotSetError(_0x39c279(0x3a1)+_0x39c279(0x267)),0x1;const _0x1dddae=await withSpinner(_0x39c279(0x324)+_0x239651+_0x39c279(0x277),()=>_0x3fdfb5['segment'][_0x39c279(0x361)](_0x239651),{'verbose':_0x2ad370['verbose']}),_0x4427a0=_0x1dddae[_0x39c279(0x27a)];return await withSpinner(_0x39c279(0x3d5)+_0x1f0e84+'\x27...',()=>_0x3fdfb5['personalization'][_0x39c279(0x3e3)](_0x4427a0,_0x1f0e84),{'verbose':_0x2ad370[_0x39c279(0x340)]}),console[_0x39c279(0x353)](_0x39c279(0x217)+_0x1f0e84+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x325);['description']=a30_0x41ba90(0x1d1);async[a30_0x41ba90(0x1db)](_0x2216b3){const _0x31c5b6=a30_0x41ba90,{options:_0x9a0569,args:_0x18be07,tdx:_0x14b815}=_0x2216b3,_0x15f36b=_0x9a0569,_0x550b2d=_0x18be07[0x0],_0x5f11c9=_0x18be07[0x1]||_0x9a0569[_0x31c5b6(0x226)];if(!_0x550b2d)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console['error'](_0x31c5b6(0x35a)),console[_0x31c5b6(0x353)](_0x31c5b6(0x2e6)),0x1;if(!_0x15f36b[_0x31c5b6(0x1d8)])return console[_0x31c5b6(0x353)](_0x31c5b6(0x3d9)),console['error'](_0x31c5b6(0x35a)),0x1;if(!_0x5f11c9)return showParentSegmentNotSetError(_0x31c5b6(0x34b)+_0x31c5b6(0x2e6)),0x1;const _0x559983=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5f11c9+_0x31c5b6(0x277),()=>_0x14b815[_0x31c5b6(0x2c3)][_0x31c5b6(0x361)](_0x5f11c9),{'verbose':_0x9a0569[_0x31c5b6(0x340)]}),_0x13dbfd=_0x559983[_0x31c5b6(0x27a)],_0x36ef19={'name':_0x15f36b[_0x31c5b6(0x1d8)]};_0x15f36b[_0x31c5b6(0x38a)]!==undefined&&(_0x36ef19[_0x31c5b6(0x38a)]=_0x15f36b[_0x31c5b6(0x38a)]);const _0x3e22a6=await withSpinner(_0x31c5b6(0x204)+_0x550b2d+'\x27...',()=>_0x14b815[_0x31c5b6(0x1de)][_0x31c5b6(0x27f)](_0x13dbfd,_0x550b2d,_0x36ef19),{'verbose':_0x9a0569['verbose']}),_0x132bd5=_0x3e22a6['data'];return console['error']('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x132bd5['name']+'\x27'),await handleSDKOutput([_0x132bd5],_0x9a0569),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x1fd);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x28e);async['execute'](_0x53962f){const _0x111a10=a30_0x41ba90,{options:_0x1c6ec3,args:_0x35c7eb,tdx:_0x1cb8e6}=_0x53962f,_0x277abc=_0x1c6ec3,_0x36e2a3=_0x35c7eb[0x0],_0x2c285c=_0x35c7eb[0x1],_0x416f0d=_0x35c7eb[0x2]||_0x1c6ec3[_0x111a10(0x226)];if(!_0x36e2a3)return console[_0x111a10(0x353)](_0x111a10(0x2c8)),console[_0x111a10(0x353)](_0x111a10(0x2b2)),console['error'](_0x111a10(0x2f7)),0x1;if(!_0x2c285c)return console[_0x111a10(0x353)](_0x111a10(0x222)),console[_0x111a10(0x353)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x111a10(0x353)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x416f0d)return showParentSegmentNotSetError(_0x111a10(0x3a6)+_0x111a10(0x2f7)),0x1;const _0x53a739=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x416f0d+_0x111a10(0x277),()=>_0x1cb8e6['segment'][_0x111a10(0x361)](_0x416f0d),{'verbose':_0x1c6ec3[_0x111a10(0x340)]}),_0xf2e944=_0x53a739[_0x111a10(0x27a)],_0x435bd7={'name':_0x36e2a3};_0x277abc['allowedIps']&&(_0x435bd7[_0x111a10(0x209)]=_0x277abc['allowedIps'][_0x111a10(0x33b)](',')[_0x111a10(0x20b)](_0x46537b=>_0x46537b[_0x111a10(0x291)]()));_0x277abc[_0x111a10(0x38a)]&&(_0x435bd7[_0x111a10(0x38a)]=_0x277abc[_0x111a10(0x38a)]);const _0xe1b4c0=await withSpinner(_0x111a10(0x336)+_0x36e2a3+_0x111a10(0x2ef)+_0x2c285c+'\x27...',()=>_0x1cb8e6[_0x111a10(0x1de)][_0x111a10(0x352)](_0xf2e944,_0x2c285c,_0x435bd7),{'verbose':_0x1c6ec3['verbose']}),_0x191270=_0xe1b4c0[_0x111a10(0x27a)];return console[_0x111a10(0x353)]('✔\x20Created\x20token\x20\x27'+_0x191270[_0x111a10(0x1d8)]+'\x27\x20with\x20ID:\x20'+_0x191270['id']),_0x191270[_0x111a10(0x23d)]&&(console[_0x111a10(0x353)](a30_0x3ab056[_0x111a10(0x32d)]('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console[_0x111a10(0x353)](a30_0x3ab056[_0x111a10(0x35f)](_0x191270[_0x111a10(0x23d)])),console[_0x111a10(0x353)]('')),await handleSDKOutput([_0x191270],_0x1c6ec3),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:pz:service:token:delete';['description']=a30_0x41ba90(0x1e9);async[a30_0x41ba90(0x1db)](_0x1f8745){const _0x509560=a30_0x41ba90,{options:_0x3ca98f,args:_0x25df6b,tdx:_0x5706f0}=_0x1f8745,_0x255c5b=_0x25df6b[0x0],_0x42ecf1=_0x25df6b[0x1]||_0x3ca98f[_0x509560(0x226)];if(!_0x255c5b)return console[_0x509560(0x353)]('Error:\x20Token\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x509560(0x353)](_0x509560(0x22f)),0x1;if(!_0x42ecf1)return showParentSegmentNotSetError(_0x509560(0x216)+_0x509560(0x22f)),0x1;const _0x4cb710=await withSpinner(_0x509560(0x324)+_0x42ecf1+'\x27...',()=>_0x5706f0[_0x509560(0x2c3)]['resolveParentId'](_0x42ecf1),{'verbose':_0x3ca98f['verbose']}),_0x2a01ba=_0x4cb710['data'],_0x4eae1b=await withSpinner(_0x509560(0x24a),()=>_0x5706f0[_0x509560(0x1de)]['list'](_0x2a01ba),{'verbose':_0x3ca98f[_0x509560(0x340)]}),_0x464690=_0x4eae1b[_0x509560(0x27a)];let _0x50b402;for(const _0x44903c of _0x464690){if(_0x44903c[_0x509560(0x2d6)]?.[_0x509560(0x3a3)](_0x59b0f9=>_0x59b0f9['id']===_0x255c5b)){_0x50b402=_0x44903c['id'];break;}}if(!_0x50b402)return console[_0x509560(0x353)](_0x509560(0x2b4)+_0x255c5b+_0x509560(0x21b)),0x1;const _0x20f75e=await withSpinner('Deleting\x20token\x20\x27'+_0x255c5b+_0x509560(0x277),()=>_0x5706f0[_0x509560(0x1de)][_0x509560(0x26e)](_0x2a01ba,_0x50b402,_0x255c5b),{'verbose':_0x3ca98f[_0x509560(0x340)]}),_0x9173c0=_0x20f75e[_0x509560(0x27a)];return console['error'](_0x509560(0x2e0)+(_0x9173c0[_0x509560(0x1d8)]||_0x255c5b)+'\x27'),await handleSDKOutput([_0x9173c0],_0x3ca98f),0x0;}}export class PSPzListCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x218);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x1f1);async['execute'](_0x5e6cd7){const _0x2ed5cc=a30_0x41ba90,{options:_0x3f509a,args:_0x26bfbe,tdx:_0x6d3362}=_0x5e6cd7,_0x24c7fc=_0x26bfbe[0x0]||_0x3f509a[_0x2ed5cc(0x226)];if(!_0x24c7fc)return showParentSegmentNotSetError(_0x2ed5cc(0x316)+_0x2ed5cc(0x3e1)),0x1;const _0xb125d6=await withSpinner(_0x2ed5cc(0x324)+_0x24c7fc+'\x27...',()=>_0x6d3362['segment'][_0x2ed5cc(0x361)](_0x24c7fc),{'verbose':_0x3f509a[_0x2ed5cc(0x340)]}),_0x1530ff=_0xb125d6[_0x2ed5cc(0x27a)],_0x28fbfa=await withSpinner(_0x2ed5cc(0x381)+_0x24c7fc+_0x2ed5cc(0x277),()=>_0x6d3362[_0x2ed5cc(0x1de)]['listPersonalizations'](_0x1530ff),{'verbose':_0x3f509a[_0x2ed5cc(0x340)]}),_0x125499=_0x28fbfa[_0x2ed5cc(0x27a)];console[_0x2ed5cc(0x353)](_0x2ed5cc(0x2e7)+_0x125499[_0x2ed5cc(0x1dc)]+'\x20personalization'+(_0x125499['length']!==0x1?'s':''));if(_0x3f509a[_0x2ed5cc(0x224)]==='json'||_0x3f509a[_0x2ed5cc(0x224)]==='jsonl')await handleSDKOutput(_0x125499,_0x3f509a);else{if(_0x125499['length']===0x0)console[_0x2ed5cc(0x276)]('No\x20personalizations\x20configured');else for(const _0x466a80 of _0x125499){console[_0x2ed5cc(0x276)](a30_0x3ab056[_0x2ed5cc(0x30d)](_0x466a80[_0x2ed5cc(0x1d8)])+'\x20'+a30_0x3ab056[_0x2ed5cc(0x397)](_0x2ed5cc(0x1e8)+_0x466a80['id']+')'));_0x466a80[_0x2ed5cc(0x38a)]&&console['log']('\x20\x20'+a30_0x3ab056[_0x2ed5cc(0x397)](_0x466a80[_0x2ed5cc(0x38a)]));const _0x25cbd9=_0x466a80[_0x2ed5cc(0x3c7)]?.['length']||0x0;console[_0x2ed5cc(0x276)]('\x20\x20'+a30_0x3ab056[_0x2ed5cc(0x35f)](_0x2ed5cc(0x260))+'\x20'+_0x25cbd9);if(_0x466a80[_0x2ed5cc(0x3c7)]&&_0x466a80[_0x2ed5cc(0x3c7)][_0x2ed5cc(0x1dc)]>0x0)for(const _0xdb7fe6 of _0x466a80[_0x2ed5cc(0x3c7)]){console[_0x2ed5cc(0x276)](_0x2ed5cc(0x3ee)+_0xdb7fe6['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x2c7);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x38c);async[a30_0x41ba90(0x1db)](_0x24547c){const _0x5a7895=a30_0x41ba90,{options:_0x3735bc,args:_0x5de61d,tdx:_0x399024}=_0x24547c,_0x3f1eac=_0x5de61d[0x0];if(!_0x3f1eac)return console[_0x5a7895(0x353)](_0x5a7895(0x27d)),console[_0x5a7895(0x353)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x251556=await withSpinner(_0x5a7895(0x3ed)+_0x3f1eac+_0x5a7895(0x277),()=>_0x399024['personalization'][_0x5a7895(0x274)](_0x3f1eac),{'verbose':_0x3735bc['verbose']}),_0x5bb6c2=_0x251556[_0x5a7895(0x27a)];console[_0x5a7895(0x353)](_0x5a7895(0x380)+_0x5bb6c2['name']+'\x27');if(_0x3735bc[_0x5a7895(0x224)]==='json'||_0x3735bc[_0x5a7895(0x224)]===_0x5a7895(0x219))await handleSDKOutput([_0x5bb6c2],_0x3735bc);else{console['log'](a30_0x3ab056[_0x5a7895(0x30d)](_0x5bb6c2[_0x5a7895(0x1d8)])+'\x20'+a30_0x3ab056['dim'](_0x5a7895(0x1e8)+_0x5bb6c2['id']+')'));_0x5bb6c2[_0x5a7895(0x38a)]&&console[_0x5a7895(0x276)]('\x20\x20'+a30_0x3ab056[_0x5a7895(0x397)](_0x5bb6c2[_0x5a7895(0x38a)]));_0x5bb6c2[_0x5a7895(0x227)]&&console['log']('\x20\x20'+a30_0x3ab056[_0x5a7895(0x35f)]('audienceId:')+'\x20'+_0x5bb6c2[_0x5a7895(0x227)]);console[_0x5a7895(0x276)]('\x20\x20'+a30_0x3ab056['cyan']('created:')+'\x20'+_0x5bb6c2[_0x5a7895(0x335)]),console['log']('\x20\x20'+a30_0x3ab056['cyan'](_0x5a7895(0x293))+'\x20'+_0x5bb6c2[_0x5a7895(0x234)]);const _0x22e883=_0x5bb6c2['sections']?.['length']||0x0;console['log']('\x20\x20'+a30_0x3ab056[_0x5a7895(0x35f)](_0x5a7895(0x260))+'\x20'+_0x22e883);if(_0x5bb6c2[_0x5a7895(0x3c7)]&&_0x5bb6c2[_0x5a7895(0x3c7)]['length']>0x0)for(const _0x5c7cab of _0x5bb6c2[_0x5a7895(0x3c7)]){console[_0x5a7895(0x276)](_0x5a7895(0x3b7)+a30_0x3ab056['bold'](_0x5c7cab[_0x5a7895(0x1d8)])+'\x20'+a30_0x3ab056[_0x5a7895(0x397)](_0x5a7895(0x1e8)+_0x5c7cab['id']+')')),_0x5c7cab[_0x5a7895(0x3cf)]&&(console['log'](_0x5a7895(0x275)+a30_0x3ab056[_0x5a7895(0x35f)](_0x5a7895(0x3bf))+'\x20'+_0x5c7cab[_0x5a7895(0x3cf)]['name']),_0x5c7cab[_0x5a7895(0x3cf)][_0x5a7895(0x30e)]?.[_0x5a7895(0x3da)]&&console[_0x5a7895(0x276)](_0x5a7895(0x371)+a30_0x3ab056[_0x5a7895(0x35f)](_0x5a7895(0x3ea))+'\x20'+_0x5c7cab[_0x5a7895(0x3cf)][_0x5a7895(0x30e)][_0x5a7895(0x3da)])),_0x5c7cab['payload']&&console[_0x5a7895(0x276)](_0x5a7895(0x275)+a30_0x3ab056['cyan'](_0x5a7895(0x278))+'\x20'+JSON[_0x5a7895(0x374)](_0x5c7cab[_0x5a7895(0x32c)])),_0x5c7cab['includeSensitive']&&console[_0x5a7895(0x276)](_0x5a7895(0x275)+a30_0x3ab056[_0x5a7895(0x35f)](_0x5a7895(0x283))+_0x5a7895(0x2b6));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:pz:delete';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x229);async[a30_0x41ba90(0x1db)](_0x59597c){const _0x36dbc2=a30_0x41ba90,{options:_0x251a0d,args:_0x59d6ac,tdx:_0x565e9f}=_0x59597c,_0x43f671=_0x59d6ac[0x0];if(!_0x43f671)return console[_0x36dbc2(0x353)](_0x36dbc2(0x27d)),console[_0x36dbc2(0x353)](_0x36dbc2(0x296)),0x1;return await withSpinner(_0x36dbc2(0x210)+_0x43f671+_0x36dbc2(0x277),()=>_0x565e9f[_0x36dbc2(0x1de)]['deletePersonalization'](_0x43f671),{'verbose':_0x251a0d[_0x36dbc2(0x340)]}),console[_0x36dbc2(0x353)](_0x36dbc2(0x310)+_0x43f671+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]='ps:pz:create';[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x1f9);async[a30_0x41ba90(0x1db)](_0x218efc){const _0x4f0de7=a30_0x41ba90,{options:_0x571776,tdx:_0x3aae3d}=_0x218efc,_0x14a59d=_0x571776;let _0x3d8a89;if(_0x14a59d[_0x4f0de7(0x386)]){_0x3d8a89=await loadJSON(_0x14a59d[_0x4f0de7(0x386)],!![]);if(!_0x3d8a89[_0x4f0de7(0x20e)]?.[_0x4f0de7(0x327)])return console[_0x4f0de7(0x353)](_0x4f0de7(0x25d)),console['error'](_0x4f0de7(0x314)),console['error'](_0x4f0de7(0x35d)),0x1;}else{if(!_0x14a59d[_0x4f0de7(0x1d8)])return console[_0x4f0de7(0x353)](_0x4f0de7(0x2c0)),console[_0x4f0de7(0x353)](_0x4f0de7(0x23c)),console['error'](_0x4f0de7(0x3b4)),0x1;if(_0x14a59d[_0x4f0de7(0x38a)]===undefined)return console[_0x4f0de7(0x353)](_0x4f0de7(0x266)),console[_0x4f0de7(0x353)](_0x4f0de7(0x23c)),console[_0x4f0de7(0x353)](_0x4f0de7(0x3b4)),0x1;if(_0x14a59d[_0x4f0de7(0x2d5)]===undefined)return console[_0x4f0de7(0x353)](_0x4f0de7(0x330)),console[_0x4f0de7(0x353)](_0x4f0de7(0x2e9)),0x1;let _0x3de004=_0x14a59d[_0x4f0de7(0x227)];if(!_0x3de004&&_0x571776[_0x4f0de7(0x226)]){const _0x301ce3=await withSpinner(_0x4f0de7(0x324)+_0x571776[_0x4f0de7(0x226)]+_0x4f0de7(0x277),()=>_0x3aae3d[_0x4f0de7(0x2c3)][_0x4f0de7(0x361)](_0x571776['parentSegment']),{'verbose':_0x571776[_0x4f0de7(0x340)]});_0x3de004=_0x301ce3[_0x4f0de7(0x27a)];}let _0x1acce1;_0x14a59d[_0x4f0de7(0x3c7)]&&(_0x1acce1=await loadJSON(_0x14a59d['sections'],![]));const _0x5099d2=_0x14a59d[_0x4f0de7(0x2d5)]==='null'?null:{'id':_0x14a59d['folderId'],'type':_0x4f0de7(0x313)};_0x3d8a89={'attributes':{'name':_0x14a59d['name'],'description':_0x14a59d['description']||null,..._0x3de004!==undefined&&{'audienceId':_0x3de004},..._0x1acce1!==undefined&&{'sections':_0x1acce1}},'relationships':{'parentFolder':{'data':_0x5099d2}}};}const _0x151e98=await withSpinner(_0x4f0de7(0x3b8)+(_0x3d8a89['attributes']?.[_0x4f0de7(0x1d8)]??'')+_0x4f0de7(0x277),()=>_0x3aae3d['personalization'][_0x4f0de7(0x26b)](_0x3d8a89),{'verbose':_0x571776['verbose']}),_0xcd69e0=_0x151e98[_0x4f0de7(0x27a)];return console['error']('✔\x20Created\x20personalization\x20\x27'+_0xcd69e0[_0x4f0de7(0x1d8)]+_0x4f0de7(0x384)+_0xcd69e0['id']),await handleSDKOutput([_0xcd69e0],_0x571776),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a30_0x41ba90(0x1d8)]=a30_0x41ba90(0x33a);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x1ed);async[a30_0x41ba90(0x1db)](_0x154e0d){const _0x8e5b7b=a30_0x41ba90,{options:_0x53931c,args:_0xf29f5d}=_0x154e0d,_0xbd6b37=_0x53931c,_0x3672fc=_0xf29f5d[0x0];if(!_0x3672fc)return console['error'](_0x8e5b7b(0x27d)),console['error'](_0x8e5b7b(0x3b0)),console[_0x8e5b7b(0x353)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>'),0x1;let _0x5954c8;if(_0xbd6b37[_0x8e5b7b(0x386)])_0x5954c8=await loadJSON(_0xbd6b37['file'],!![]);else{if(!_0xbd6b37[_0x8e5b7b(0x1d8)])return console[_0x8e5b7b(0x353)](_0x8e5b7b(0x2c0)),console[_0x8e5b7b(0x353)](_0x8e5b7b(0x3b0)),0x1;if(_0xbd6b37['description']===undefined)return console['error'](_0x8e5b7b(0x266)),console['error'](_0x8e5b7b(0x3b0)),0x1;let _0xdd44a6;_0xbd6b37['sections']&&(_0xdd44a6=await loadJSON(_0xbd6b37[_0x8e5b7b(0x3c7)],![])),_0x5954c8={'attributes':{'name':_0xbd6b37['name'],'description':_0xbd6b37[_0x8e5b7b(0x38a)]||null,..._0xdd44a6!==undefined&&{'sections':_0xdd44a6}}};}const {tdx:_0x1e22f0}=_0x154e0d,_0x370f6b=await withSpinner(_0x8e5b7b(0x2b1)+_0x3672fc+_0x8e5b7b(0x277),()=>_0x1e22f0[_0x8e5b7b(0x1de)][_0x8e5b7b(0x211)](_0x3672fc,_0x5954c8),{'verbose':_0x53931c[_0x8e5b7b(0x340)]}),_0x2e053d=_0x370f6b[_0x8e5b7b(0x27a)];return console['error'](_0x8e5b7b(0x1e2)+_0x2e053d[_0x8e5b7b(0x1d8)]+'\x27\x20(id:\x20'+_0x2e053d['id']+')'),await handleSDKOutput([_0x2e053d],_0x53931c),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a30_0x41ba90(0x240);[a30_0x41ba90(0x38a)]=a30_0x41ba90(0x339);async[a30_0x41ba90(0x1db)](_0x9f497c){const _0x57b688=a30_0x41ba90,{options:_0x57711f,args:_0x4ad0ce}=_0x9f497c,_0x117c04=_0x4ad0ce[0x0]||_0x57711f[_0x57b688(0x226)];if(!_0x117c04)return showParentSegmentNotSetError(_0x57b688(0x289)+_0x57b688(0x2a7)),0x1;const _0x37af74=resolveYamlFile(_0x117c04);if(!existsSync(_0x37af74))return showFileNotFoundError(_0x37af74,_0x117c04),0x1;let _0x1aaeb4;try{_0x1aaeb4=readFileSync(_0x37af74,_0x57b688(0x2d3));}catch(_0x2b42e6){const _0xf0030d=_0x2b42e6 instanceof Error?_0x2b42e6[_0x57b688(0x1ef)]:String(_0x2b42e6);return console[_0x57b688(0x353)]('Error\x20reading\x20file:\x20'+_0xf0030d),0x1;}let _0xe9ea11;try{_0xe9ea11=parseDef(_0x1aaeb4);}catch(_0x2c4a37){const _0x3ce634=_0x2c4a37 instanceof Error?_0x2c4a37['message']:String(_0x2c4a37);return console[_0x57b688(0x353)](a30_0x3ab056[_0x57b688(0x269)](_0x57b688(0x25f)+_0x3ce634)),0x1;}if(_0xe9ea11[_0x57b688(0x1ff)]&&_0xe9ea11[_0x57b688(0x1ff)][_0x57b688(0x1dc)]>0x0)return console[_0x57b688(0x353)](a30_0x3ab056[_0x57b688(0x32d)](_0x57b688(0x265)+_0x37af74)),console[_0x57b688(0x353)](a30_0x3ab056[_0x57b688(0x397)](_0x57b688(0x323)+_0xe9ea11[_0x57b688(0x1ff)][_0x57b688(0x1dc)]+_0x57b688(0x1e1))),0x1;!_0xe9ea11[_0x57b688(0x2fe)]&&(_0xe9ea11[_0x57b688(0x2fe)]={'events':[{'name':_0x57b688(0x399),'source_table':_0x57b688(0x271)}],'attributes':[{'name':_0x57b688(0x202),'type':'single'}],'id_stitching':{'primary_key':_0xe9ea11[_0x57b688(0x398)]['table']==='customers'?_0x57b688(0x3ce):'user_id'}});_0xe9ea11['personalization_services']=[{'name':_0x57b688(0x33f),'description':_0x57b688(0x26d),'trigger_event':_0x57b688(0x399),'sections':[{'name':_0x57b688(0x272),'criteria':_0x57b688(0x21d),'attributes':[_0x57b688(0x202)]}]}];const _0x2b5eff=serializeDef(_0xe9ea11);return writeFileSync(_0x37af74,_0x2b5eff,_0x57b688(0x2d3)),console[_0x57b688(0x353)](a30_0x3ab056[_0x57b688(0x3af)]('✔')+_0x57b688(0x205)+a30_0x3ab056[_0x57b688(0x35f)](_0x37af74)),(!_0xe9ea11[_0x57b688(0x2fe)]||_0x1aaeb4['indexOf'](_0x57b688(0x343))===-0x1)&&console['error'](a30_0x3ab056['green']('✔')+_0x57b688(0x1d0)),console[_0x57b688(0x353)]('\x0a'+a30_0x3ab056[_0x57b688(0x397)](_0x57b688(0x3c9))),console[_0x57b688(0x353)](_0x57b688(0x302)+_0x37af74+_0x57b688(0x1fc)),console['error'](_0x57b688(0x2af)+a30_0x3ab056['dim'](_0x57b688(0x300)+_0x117c04)+_0x57b688(0x2d9)),0x0;}}
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;}}