@treasuredata/tdx 0.8.7 → 0.8.9

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 (151) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.d.ts +16 -1
  6. package/dist/client/cdp-api-client.d.ts.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/cdp-api-client.js.map +1 -1
  9. package/dist/client/engage-api-client.js +1 -1
  10. package/dist/client/http-client.js +1 -1
  11. package/dist/client/llm-api-client.js +1 -1
  12. package/dist/client/rate-limiter.js +1 -1
  13. package/dist/client/td-api-client.js +1 -1
  14. package/dist/client/trino-api-client.js +1 -1
  15. package/dist/client/workflow-client.js +1 -1
  16. package/dist/commands/activations.js +1 -1
  17. package/dist/commands/api-command.js +1 -1
  18. package/dist/commands/auth-command.js +1 -1
  19. package/dist/commands/chat-command.js +1 -1
  20. package/dist/commands/claude-command.d.ts.map +1 -1
  21. package/dist/commands/claude-command.js +1 -1
  22. package/dist/commands/claude-command.js.map +1 -1
  23. package/dist/commands/claude-statusline-command.js +1 -1
  24. package/dist/commands/claude-usage-command.js +1 -1
  25. package/dist/commands/command.js +1 -1
  26. package/dist/commands/connection-command.js +1 -1
  27. package/dist/commands/context-command.js +1 -1
  28. package/dist/commands/databases.js +1 -1
  29. package/dist/commands/describe.js +1 -1
  30. package/dist/commands/engage-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.d.ts.map +1 -1
  33. package/dist/commands/journey-command.js +1 -1
  34. package/dist/commands/journey-command.js.map +1 -1
  35. package/dist/commands/llm-command.js +1 -1
  36. package/dist/commands/llm-proxy.js +1 -1
  37. package/dist/commands/parent-segment-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.d.ts +6 -6
  44. package/dist/commands/segment-pull-command.d.ts.map +1 -1
  45. package/dist/commands/segment-pull-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js.map +1 -1
  47. package/dist/commands/segment-push-command.d.ts +6 -6
  48. package/dist/commands/segment-push-command.d.ts.map +1 -1
  49. package/dist/commands/segment-push-command.js +1 -1
  50. package/dist/commands/segment-push-command.js.map +1 -1
  51. package/dist/commands/segment-update-command.js +1 -1
  52. package/dist/commands/segment-use-command.js +1 -1
  53. package/dist/commands/segments.d.ts +2 -2
  54. package/dist/commands/segments.d.ts.map +1 -1
  55. package/dist/commands/segments.js +1 -1
  56. package/dist/commands/segments.js.map +1 -1
  57. package/dist/commands/show.js +1 -1
  58. package/dist/commands/tables.js +1 -1
  59. package/dist/commands/use-command.js +1 -1
  60. package/dist/commands/user-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/config.js +1 -1
  64. package/dist/core/connection-cache.js +1 -1
  65. package/dist/core/credential-cache.js +1 -1
  66. package/dist/core/global-context.js +1 -1
  67. package/dist/core/keychain.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/proxy/anthropic-adapter.js +1 -1
  74. package/dist/proxy/claude-usage-tracker.js +1 -1
  75. package/dist/proxy/context-signature.js +1 -1
  76. package/dist/proxy/conversation-utils.js +1 -1
  77. package/dist/proxy/server.js +1 -1
  78. package/dist/proxy/session-cache.js +1 -1
  79. package/dist/sdk/api.js +1 -1
  80. package/dist/sdk/connection.js +1 -1
  81. package/dist/sdk/engage.js +1 -1
  82. package/dist/sdk/errors.d.ts +2 -0
  83. package/dist/sdk/errors.d.ts.map +1 -1
  84. package/dist/sdk/errors.js +1 -1
  85. package/dist/sdk/errors.js.map +1 -1
  86. package/dist/sdk/index.js +1 -1
  87. package/dist/sdk/job.js +1 -1
  88. package/dist/sdk/journey.d.ts +16 -1
  89. package/dist/sdk/journey.d.ts.map +1 -1
  90. package/dist/sdk/journey.js +1 -1
  91. package/dist/sdk/journey.js.map +1 -1
  92. package/dist/sdk/llm.js +1 -1
  93. package/dist/sdk/query.js +1 -1
  94. package/dist/sdk/segment/child-segment-yaml.d.ts +11 -2
  95. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  96. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  97. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  98. package/dist/sdk/segment/journey-yaml.d.ts +218 -46
  99. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  100. package/dist/sdk/segment/journey-yaml.js +1 -1
  101. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  102. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  103. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  104. package/dist/sdk/segment.js +1 -1
  105. package/dist/sdk/user.js +1 -1
  106. package/dist/sdk/workflow.js +1 -1
  107. package/dist/types/cdp.d.ts +46 -0
  108. package/dist/types/cdp.d.ts.map +1 -1
  109. package/dist/types/endpoints.js +1 -1
  110. package/dist/types/index.d.ts +1 -1
  111. package/dist/types/index.d.ts.map +1 -1
  112. package/dist/types/index.js +1 -1
  113. package/dist/utils/agent-ref-parser.js +1 -1
  114. package/dist/utils/async.js +1 -1
  115. package/dist/utils/chat-cache.js +1 -1
  116. package/dist/utils/colors.js +1 -1
  117. package/dist/utils/command-output.js +1 -1
  118. package/dist/utils/constants.js +1 -1
  119. package/dist/utils/diff.js +1 -1
  120. package/dist/utils/fields-display.js +1 -1
  121. package/dist/utils/file-permissions.js +1 -1
  122. package/dist/utils/format-detector.js +1 -1
  123. package/dist/utils/formatters.js +1 -1
  124. package/dist/utils/journey-utils.d.ts +110 -0
  125. package/dist/utils/journey-utils.d.ts.map +1 -0
  126. package/dist/utils/journey-utils.js +1 -0
  127. package/dist/utils/journey-utils.js.map +1 -0
  128. package/dist/utils/json-loader.js +1 -1
  129. package/dist/utils/llm-backup-utils.js +1 -1
  130. package/dist/utils/model-aliases.js +1 -1
  131. package/dist/utils/model-factors.js +1 -1
  132. package/dist/utils/option-validation.js +1 -1
  133. package/dist/utils/port.js +1 -1
  134. package/dist/utils/process.js +1 -1
  135. package/dist/utils/prompt.js +1 -1
  136. package/dist/utils/segment-path-parser.js +1 -1
  137. package/dist/utils/segment-ref-parser.js +1 -1
  138. package/dist/utils/spinner.js +1 -1
  139. package/dist/utils/sql-parser.js +1 -1
  140. package/dist/utils/sse-parser.js +1 -1
  141. package/dist/utils/string-utils.js +1 -1
  142. package/dist/utils/table-ref-parser.js +1 -1
  143. package/dist/utils/tdx-config.js +1 -1
  144. package/dist/utils/tdx-logger.js +1 -1
  145. package/dist/utils/tree-formatter.d.ts +9 -8
  146. package/dist/utils/tree-formatter.d.ts.map +1 -1
  147. package/dist/utils/tree-formatter.js +1 -1
  148. package/dist/utils/tree-formatter.js.map +1 -1
  149. package/dist/utils/version-check.js +1 -1
  150. package/dist/utils/workflow-utils.js +1 -1
  151. package/package.json +1 -1
@@ -1 +1 @@
1
- const a28_0x169315=a28_0x4084;function a28_0xe269(){const _0x189ffb=['elapsedTimeMillis','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','segment:parent:push','\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','behavior','Show\x20parent\x20segment\x20details','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','24IsgMVv','\x0aChanges\x20to\x20apply\x20to\x20\x27','No\x20parent\x20segments\x20match\x20pattern:\x20','Get\x20SQL\x20query\x20for\x20parent\x20segment','Errors:','parentSegment','enriched','Resolving\x20parent\x20segment\x20\x27','Pattern:\x20','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Creating\x20parent\x20segment\x20\x27','table','Session:','using\x20the\x20default\x20path:\x20','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20--attribute\x20\x22','joinKey','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','328gEAmsL','apply','/\x20directories\x20exist.','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','database','/app/dw/parentSegments/','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','jobId','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','updateParent','displaySummary','previewParentYaml','length','Error:','displayValidateResults','%)\x20','Listing\x20fields\x20for\x20\x27','✔\x20Renamed\x20directory\x20to\x20','\x20Configuration\x20is\x20valid','limit','master','runParent','format','scheduleOption','/sessions/','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','number','Preview:','site','filter','Join:','yes','sampleData','map','354669GzYTNb','Name:\x20','rowCount','error','\x20=\x20','Error\x20reading\x20file:\x20','Updating','open','segment:parent:fields','workflowAttemptId','localeCompare','timezone','displayColumns','pushParentYaml','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','message','.yml','status','platform','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Enriched:','\x20tdx\x20wf\x20attempt\x20','segment:parent:desc','pullParentYaml','Create\x20parent\x20segment\x20\x27','customerPercent','\x20Opening\x20','endsWith','start','Apply\x20changes\x20to\x20\x27','segment:parent:pull','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x0a✔\x20Workflow\x20started','bold','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','sort','✔\x20Created\x20parent\x20segment\x20\x27','string','\x20--behavior\x20\x22','dim','displayBehaviorsStats','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Options:\x0a','segment:parent:sql','test','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20rows)','\x0a⚠️\x20\x20Both\x20','No\x20parent\x20segments\x20found','SELECT\x20*\x20FROM\x20(\x0a','segment:parent:create','information_schema','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','979236mSTwxk','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','column','YAML\x20file:\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Source:','segment:parent:run','green','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','keys','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','List\x20available\x20fields\x20for\x20segmentation','session','parent_segment','\x20--behavior\x20\x22<name>\x22','Options:','Behavior:','/\x20directory.\x0a','Columns:','isDirectory','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','addAttributes','scheduleType','dirname','\x20[Job\x20ID:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','errors','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Error:\x20File\x20not\x20found:\x20','stop','Updating\x20parent\x20segment\x20\x27','\x20\x20No\x20sample\x20data\x20available','✔\x20No\x20changes\x20-\x20\x27','displayAttributesStats','in\x20','Validate:','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','execute','89028EavVRg','displayPreviewResults','Attempt:','toLocaleString','resolveParentId','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Options\x20(one\x20required):\x0a','Status:','segment:parent:view','5420630HsnefL','Events:','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','behaviors','darwin','output','totalEvents','/app/workflows/','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20--enriched','\x20--interval\x20','\x20rows\x20','tdx\x20segment\x20parent\x20preview\x20','getParentFull','\x0aNo\x20sample\x20data\x20available','description','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','displayMasterInfo','Aborted.','parent_segments','\x0aNew\x20parent\x20segment\x20\x27','/{name}.yml\x0a','use','Fetching\x20sample\x20data...','addBehaviorsFile','displayPreviewHints','foreignKey','Error:\x20--behavior\x20requires\x20a\x20name\x0a','2579286vsKMRt','log','setJobId','👥\x20','/\x20→\x20','customersWithEvents','behaviorsFile','Output\x20file:\x20','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','segment:parent:show','getParentSQL','\x20\x20\x20\x20-\x20','run','double','Behaviors','audienceId','all','preview','610309KiDZQl','Error\x20parsing\x20YAML:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x20is\x20already\x20up\x20to\x20date','name','replace','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','segment:parent:validate','Analyzing\x20changes...','SQL\x20query:\x0a','2KMoSDV','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20kill','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','coveragePercent','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','data','columns','schemaError','\x27...','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','yellow','segment:parent:list','Found\x20YAML\x20file:\x20','schemaValid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','`\x20to\x20download\x20the\x20configuration\x20first','647185MHEpCZ','\x27\x20and\x20run\x20workflow?','Available\x20behaviors:','\x0aUsage:\x20tdx\x20ps\x20preview\x20','workflowSessionId','verbose','\x20Context\x20set:\x20','label','web','population','red','jsonl','Creating','json','attributes','interval','Overwrite\x20\x27','\x20No\x20changes\x20-\x20','Master:','utf-8','displaySampleData','✔\x20Found\x20','cyan','Fetching\x20SQL\x20for\x20\x27','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Rows:','text','toFixed','Site:\x20','ignore','validateParentYaml','Parent\x20segment:\x20','Created','matchedCount','\x20--attribute\x20\x22<name>\x22','Coverage:','segment:parent:preview','xdg-open','listParents','-1d','varchar','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Updated','allValid','attribute','repeat','Table:\x20','addBehaviors','\x27\x20is\x20up\x20to\x20date','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x5c$&','Fetching\x20parent\x20segment\x20\x27','Attribute:','/\x20and\x20'];a28_0xe269=function(){return _0x189ffb;};return a28_0xe269();}(function(_0x4ef002,_0x4ef4fa){const _0x2df15f=a28_0x4084,_0x23ecc5=_0x4ef002();while(!![]){try{const _0x4cbc65=parseInt(_0x2df15f(0x1e3))/0x1*(-parseInt(_0x2df15f(0xc3))/0x2)+parseInt(_0x2df15f(0x1d0))/0x3+parseInt(_0x2df15f(0x183))/0x4+-parseInt(_0x2df15f(0xd8))/0x5+-parseInt(_0x2df15f(0x118))/0x6*(-parseInt(_0x2df15f(0x14d))/0x7)+-parseInt(_0x2df15f(0x12a))/0x8*(-parseInt(_0x2df15f(0x1ab))/0x9)+-parseInt(_0x2df15f(0x1b4))/0xa;if(_0x4cbc65===_0x4ef4fa)break;else _0x23ecc5['push'](_0x23ecc5['shift']());}catch(_0x6c5ba3){_0x23ecc5['push'](_0x23ecc5['shift']());}}}(a28_0xe269,0x6939a));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a28_0x221ccd from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a28_0x478b4a from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';function a28_0x4084(_0x42e6e3,_0x250092){_0x42e6e3=_0x42e6e3-0xc1;const _0xe2693=a28_0xe269();let _0x4084c8=_0xe2693[_0x42e6e3];return _0x4084c8;}import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a28_0x169315(0x1c7),LEGACY_PARENT_SEGMENT_DIR=a28_0x169315(0x190);function openBrowser(_0x18d3a3){const _0x557262=a28_0x169315,_0x1ffb01=process[_0x557262(0x160)],_0x216e1b=_0x1ffb01===_0x557262(0x1b8)?_0x557262(0x154):_0x1ffb01==='win32'?'start':_0x557262(0xfd);spawn(_0x216e1b,[_0x18d3a3],{'detached':!![],'stdio':_0x557262(0xf5)})['unref']();}function migrateLegacyDirectory(){const _0x4a611e=a28_0x169315;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x58b81b=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x58b81b[_0x4a611e(0x196)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x4a611e(0x150)](a28_0x478b4a[_0x4a611e(0xd2)](_0x4a611e(0x17d)+LEGACY_PARENT_SEGMENT_DIR+_0x4a611e(0x10d)+PARENT_SEGMENT_DIR+_0x4a611e(0x12c))),console[_0x4a611e(0x150)](a28_0x478b4a['dim'](_0x4a611e(0x1d9)+LEGACY_PARENT_SEGMENT_DIR+_0x4a611e(0x194))),![];console['error'](a28_0x478b4a[_0x4a611e(0xd2)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x4a611e(0x1d4)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x4a611e(0x150)](a28_0x478b4a[_0x4a611e(0x18a)](_0x4a611e(0x13c)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x59468b){const _0x36a616=_0x59468b instanceof Error?_0x59468b[_0x4a611e(0x15d)]:String(_0x59468b);return console[_0x4a611e(0x150)](a28_0x478b4a[_0x4a611e(0xe2)](_0x4a611e(0x131)+_0x36a616+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a28_0x169315(0x1dd)](_0x5f11ac){return migrateLegacyDirectory(),super['run'](_0x5f11ac);}}function resolveYamlFile(_0x45228){const _0x405e1e=a28_0x169315;if(_0x45228[_0x405e1e(0x169)](_0x405e1e(0x15e))||_0x45228['endsWith']('.yaml'))return _0x45228;return a28_0x221ccd[_0x405e1e(0xc4)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x45228)+_0x405e1e(0x15e));}function formatProgressMessage(_0x4ed14c){const _0x1e7d6d=a28_0x169315,_0x5b665a=_0x4ed14c['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5b665a){const [,_0x4a1b61,_0x2e5c87,_0x1771c0='']=_0x5b665a;return a28_0x478b4a[_0x1e7d6d(0x175)](_0x4a1b61+':')+'\x20'+_0x2e5c87+a28_0x478b4a[_0x1e7d6d(0x175)](_0x1771c0);}return a28_0x478b4a['dim'](_0x4ed14c);}function showFileNotFoundError(_0x4e61b3,_0x939ac7){const _0x4349da=a28_0x169315;console[_0x4349da(0x150)](a28_0x478b4a[_0x4349da(0xe2)](_0x4349da(0x1a1)+_0x4e61b3+'\x0a')),console['error'](a28_0x478b4a['cyan'](_0x4349da(0x1c4)+_0x939ac7+_0x4349da(0xd7)));}function showParentSegmentNotSetError(_0x315996){const _0x2a7f0c=a28_0x169315;console[_0x2a7f0c(0x150)](a28_0x478b4a['yellow'](_0x2a7f0c(0x170))),console[_0x2a7f0c(0x150)](_0x315996);}export class ParentSegmentListCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0xd3);[a28_0x169315(0x1c3)]='List\x20parent\x20segments';async['execute'](_0x21acaa){const _0x3aa2b8=a28_0x169315,{options:_0x3073eb,args:_0x1df368,tdx:_0x968fb8}=_0x21acaa,_0x43378f=_0x1df368[0x0];_0x3073eb[_0x3aa2b8(0xdd)]&&(console[_0x3aa2b8(0x150)](_0x3aa2b8(0xf4)+_0x3073eb['site']),_0x43378f&&console[_0x3aa2b8(0x150)](_0x3aa2b8(0x120)+_0x43378f));const _0x32953f=await withSpinner(_0x43378f?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x43378f+_0x3aa2b8(0xd0):'Listing\x20parent\x20segments...',()=>_0x968fb8[_0x3aa2b8(0x15b)][_0x3aa2b8(0xfe)](),{'verbose':_0x3073eb[_0x3aa2b8(0xdd)]});let _0x4fa632=_0x32953f[_0x3aa2b8(0xcd)];if(_0x43378f){const _0x11c00b=_0x43378f[_0x3aa2b8(0x1e9)](/[.+^${}()|[\]\\]/g,_0x3aa2b8(0x10a))[_0x3aa2b8(0x1e9)](/\*/g,'.*')[_0x3aa2b8(0x1e9)](/\?/g,'.'),_0x2d105f=new RegExp('^'+_0x11c00b+'$','i');_0x4fa632=_0x4fa632[_0x3aa2b8(0x148)](_0x2cc8d2=>_0x2d105f['test'](_0x2cc8d2[_0x3aa2b8(0xe6)]['name']));}_0x4fa632[_0x3aa2b8(0x171)]((_0x30fd67,_0x36d2cd)=>_0x30fd67['attributes'][_0x3aa2b8(0x1e8)][_0x3aa2b8(0x157)](_0x36d2cd[_0x3aa2b8(0xe6)][_0x3aa2b8(0x1e8)])),console[_0x3aa2b8(0x150)](_0x3aa2b8(0xed)+_0x4fa632['length']+'\x20parent\x20segment'+(_0x4fa632['length']!==0x1?'s':''));if(_0x3073eb[_0x3aa2b8(0x141)]===_0x3aa2b8(0xe5)||_0x3073eb[_0x3aa2b8(0x141)]==='jsonl')await handleSDKOutput(_0x4fa632,_0x3073eb);else{if(_0x4fa632[_0x3aa2b8(0x137)]===0x0)_0x43378f?console[_0x3aa2b8(0x1d1)](_0x3aa2b8(0x11a)+_0x43378f):console['log'](_0x3aa2b8(0x17e));else for(const _0x8ef5d0 of _0x4fa632){const _0x2dc9ed=_0x8ef5d0[_0x3aa2b8(0xe6)][_0x3aa2b8(0xe1)]?a28_0x478b4a[_0x3aa2b8(0x175)]('\x20('+formatRows(_0x8ef5d0[_0x3aa2b8(0xe6)][_0x3aa2b8(0xe1)])+')'):'';console[_0x3aa2b8(0x1d1)](_0x3aa2b8(0x1d3)+_0x8ef5d0[_0x3aa2b8(0xe6)]['name']+_0x2dc9ed);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a28_0x169315(0x180);[a28_0x169315(0x1c3)]=a28_0x169315(0x1b6);async['execute'](_0x10942a){const _0x2960e4=a28_0x169315,{options:_0x43002e,args:_0x13e649,tdx:_0x4af694}=_0x10942a;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x2960e4(0x18b)+_0x2960e4(0x198));const _0x2a30e8=_0x43002e;if(_0x13e649[_0x2960e4(0x137)]===0x0)return console['error'](a28_0x478b4a[_0x2960e4(0xe2)](_0x2960e4(0x10f))),console[_0x2960e4(0x150)](_0x2960e4(0x121)),0x1;const _0x2cbaac=_0x13e649[0x0];if(!_0x2a30e8[_0x2960e4(0x12e)]||!_0x2a30e8[_0x2960e4(0x123)])return console[_0x2960e4(0x150)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x2960e4(0x150)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x2a30e8[_0x2960e4(0xdd)]&&(console['error'](_0x2960e4(0xf4)+_0x2a30e8['site']),console[_0x2960e4(0x150)](_0x2960e4(0x14e)+_0x2cbaac),console[_0x2960e4(0x150)]('Database:\x20'+_0x2a30e8[_0x2960e4(0x12e)]),console[_0x2960e4(0x150)](_0x2960e4(0x106)+_0x2a30e8[_0x2960e4(0x123)]));const _0x499f7e=await loadJSONFromOptions(_0x2a30e8['attributes'],_0x2a30e8['attributesFile']),_0x30558d=await loadJSONFromOptions(_0x2a30e8[_0x2960e4(0x1b7)],_0x2a30e8[_0x2960e4(0x1d6)]),_0x2753a6=await loadJSONFromOptions(_0x2a30e8['customerGroup'],_0x2a30e8['customerGroupFile']),_0x4a06b8={'name':_0x2cbaac,'description':_0x2a30e8[_0x2960e4(0x1c3)],'scheduleType':_0x2a30e8[_0x2960e4(0x19a)],'scheduleOption':_0x2a30e8[_0x2960e4(0x142)],'timezone':_0x2a30e8[_0x2960e4(0x158)],'master':{'parentDatabaseName':_0x2a30e8[_0x2960e4(0x12e)],'parentTableName':_0x2a30e8[_0x2960e4(0x123)]},'attributes':_0x499f7e,'behaviors':_0x30558d,'customerGroup':_0x2753a6},_0xa35fe=await withSpinner(_0x2960e4(0x122)+_0x2cbaac+_0x2960e4(0xd0),()=>_0x4af694[_0x2960e4(0x15b)]['createParent'](_0x4a06b8),{'verbose':_0x43002e[_0x2960e4(0xdd)]}),_0x4ef8d1=_0xa35fe[_0x2960e4(0xcd)];return console['error'](_0x2960e4(0x172)+_0x4ef8d1['name']+'\x27\x20with\x20ID:\x20'+_0x4ef8d1['id']),await handleSDKOutput([_0x4ef8d1],_0x43002e),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a28_0x169315(0x1e8)]='segment:parent:update';[a28_0x169315(0x1c3)]=a28_0x169315(0x133);async[a28_0x169315(0x1aa)](_0x4636f1){const _0x2f4ce3=a28_0x169315,{options:_0x14dae4,args:_0x39dfc3,tdx:_0x3dba79}=_0x4636f1;console[_0x2f4ce3(0x150)](_0x2f4ce3(0x130)+_0x2f4ce3(0x18b)+_0x2f4ce3(0x198));const _0x98801c=_0x14dae4;if(_0x39dfc3['length']===0x0)return console[_0x2f4ce3(0x150)](a28_0x478b4a[_0x2f4ce3(0xe2)](_0x2f4ce3(0x10f))),console[_0x2f4ce3(0x150)](_0x2f4ce3(0xc7)),0x1;const _0x3d8c2a=_0x39dfc3[0x0];_0x98801c[_0x2f4ce3(0xdd)]&&(console['error'](_0x2f4ce3(0xf4)+_0x98801c[_0x2f4ce3(0x147)]),console[_0x2f4ce3(0x150)]('Parent\x20segment:\x20'+_0x3d8c2a));const _0xf4c38c=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x3d8c2a+_0x2f4ce3(0xd0),()=>_0x3dba79[_0x2f4ce3(0x15b)][_0x2f4ce3(0x1c1)](_0x3d8c2a),{'verbose':_0x98801c[_0x2f4ce3(0xdd)]}),_0xe93ab5=_0xf4c38c['data'],_0x5ee48e=await loadJSONFromOptions(_0x98801c[_0x2f4ce3(0x199)],_0x98801c['addAttributesFile']),_0x523855=await loadJSONFromOptions(_0x98801c[_0x2f4ce3(0x107)],_0x98801c[_0x2f4ce3(0x1cc)]),_0x4809b0={'name':_0xe93ab5[_0x2f4ce3(0x1e8)],'description':_0x98801c[_0x2f4ce3(0x1c3)]!==undefined?_0x98801c[_0x2f4ce3(0x1c3)]:_0xe93ab5['description'],'scheduleType':_0x98801c[_0x2f4ce3(0x19a)]!==undefined?_0x98801c[_0x2f4ce3(0x19a)]:_0xe93ab5['scheduleType'],'scheduleOption':_0x98801c[_0x2f4ce3(0x142)]!==undefined?_0x98801c[_0x2f4ce3(0x142)]:_0xe93ab5[_0x2f4ce3(0x142)],'timezone':_0x98801c[_0x2f4ce3(0x158)]!==undefined?_0x98801c[_0x2f4ce3(0x158)]:_0xe93ab5[_0x2f4ce3(0x158)],'master':_0xe93ab5['master'],'attributes':_0x5ee48e?[..._0xe93ab5['attributes']||[],..._0x5ee48e]:_0xe93ab5[_0x2f4ce3(0xe6)],'behaviors':_0x523855?[..._0xe93ab5[_0x2f4ce3(0x1b7)]||[],..._0x523855]:_0xe93ab5['behaviors'],'customerGroup':_0xe93ab5['customerGroup']},_0x1f279f=await withSpinner(_0x2f4ce3(0x1a3)+_0x3d8c2a+_0x2f4ce3(0xd0),()=>_0x3dba79[_0x2f4ce3(0x15b)][_0x2f4ce3(0x134)](_0x3d8c2a,_0x4809b0),{'verbose':_0x98801c[_0x2f4ce3(0xdd)]}),_0xf5fc48=_0x1f279f[_0x2f4ce3(0xcd)];return console[_0x2f4ce3(0x150)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0xf5fc48[_0x2f4ce3(0x1e8)]+'\x27'),await handleSDKOutput([_0xf5fc48],_0x98801c),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a28_0x169315(0x16c);[a28_0x169315(0x1c3)]=a28_0x169315(0x17b);async[a28_0x169315(0x1aa)](_0x29f68f){const _0x22432a=a28_0x169315,{options:_0x5baedc,args:_0xb48c3d,tdx:_0x898e5f}=_0x29f68f,_0x50f382=_0x5baedc,_0x2e6272=_0xb48c3d[0x0]||_0x5baedc[_0x22432a(0x11d)];if(!_0x2e6272)return showParentSegmentNotSetError(_0x22432a(0xc9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x50f382[_0x22432a(0x1ca)]&&_0x50f382[_0x22432a(0x1b9)])return console[_0x22432a(0x150)](a28_0x478b4a[_0x22432a(0xe2)](_0x22432a(0x1bc))),console[_0x22432a(0x150)](a28_0x478b4a[_0x22432a(0x175)](_0x22432a(0xcc))),console[_0x22432a(0x150)](a28_0x478b4a[_0x22432a(0x175)](_0x22432a(0x125)+PARENT_SEGMENT_DIR+_0x22432a(0x1c9))),console['error'](a28_0x478b4a[_0x22432a(0xee)](_0x22432a(0x182))),0x1;const _0x2f562f=_0x50f382['output']||a28_0x221ccd[_0x22432a(0xc4)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x2e6272)+'.yml');_0x50f382[_0x22432a(0xdd)]&&(console[_0x22432a(0x150)](_0x22432a(0xf4)+_0x50f382['site']),console[_0x22432a(0x150)]('Parent\x20segment:\x20'+_0x2e6272),console[_0x22432a(0x150)](_0x22432a(0x1d7)+_0x2f562f));const _0x4e8a38=await withSpinner(_0x22432a(0x10b)+_0x2e6272+_0x22432a(0xd0),()=>_0x898e5f['segment'][_0x22432a(0x165)](_0x2e6272),{'verbose':_0x50f382[_0x22432a(0xdd)]}),_0x4e7933=_0x4e8a38['data'];if(existsSync(_0x2f562f)){const _0x43d689=readFileSync(_0x2f562f,'utf-8'),_0x516d68=generateDiff(_0x43d689,_0x4e7933);if(!hasChanges(_0x516d68))console[_0x22432a(0x150)](a28_0x478b4a['green']('✔')+_0x22432a(0xe9)+a28_0x478b4a[_0x22432a(0xee)](_0x2f562f)+_0x22432a(0x1e7));else{console['error']('\x0aChanges\x20to\x20\x27'+_0x2f562f+'\x27:'),console[_0x22432a(0x150)]('─'[_0x22432a(0x105)](0x3c)),console['error'](formatDiffWithColors(_0x516d68)),console[_0x22432a(0x150)]('─'[_0x22432a(0x105)](0x3c));if(!_0x50f382[_0x22432a(0x14a)]){const _0x520be5=await confirmKey(_0x22432a(0xe8)+_0x2f562f+'\x27?');if(!_0x520be5)return console['error']('Aborted.'),0x1;}writeFileSync(_0x2f562f,_0x4e7933,_0x22432a(0xeb)),console[_0x22432a(0x150)](a28_0x478b4a[_0x22432a(0x18a)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a28_0x478b4a[_0x22432a(0xee)](_0x2f562f));}}else{const _0x5e186b=a28_0x221ccd[_0x22432a(0x19b)](_0x2f562f);!existsSync(_0x5e186b)&&mkdirSync(_0x5e186b,{'recursive':!![]}),writeFileSync(_0x2f562f,_0x4e7933,_0x22432a(0xeb)),console[_0x22432a(0x150)](a28_0x478b4a[_0x22432a(0x18a)]('✔')+_0x22432a(0x19d)+a28_0x478b4a['cyan'](_0x2f562f));}return saveSessionContext({'parent_segment':_0x2e6272},_0x50f382[_0x22432a(0x18f)]),console['error'](a28_0x478b4a[_0x22432a(0x18a)]('✔')+_0x22432a(0xde)+a28_0x478b4a[_0x22432a(0x175)]('parent_segment')+_0x22432a(0x151)+a28_0x478b4a[_0x22432a(0xee)](_0x2e6272)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x111);[a28_0x169315(0x1c3)]=a28_0x169315(0x1a9);async[a28_0x169315(0x1aa)](_0x8bb9ed){const _0x1bb743=a28_0x169315,{options:_0x4d17cb,args:_0x40e113,tdx:_0xc9597d}=_0x8bb9ed,_0x3e6f22=_0x4d17cb,_0x2f480f=_0x40e113[0x0]||_0x4d17cb[_0x1bb743(0x11d)];if(!_0x2f480f)return showParentSegmentNotSetError(_0x1bb743(0x19e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x4f9426=resolveYamlFile(_0x2f480f);if(!existsSync(_0x4f9426))return showFileNotFoundError(_0x4f9426,_0x2f480f),0x1;_0x3e6f22[_0x1bb743(0xdd)]&&(console[_0x1bb743(0x150)]('Site:\x20'+_0x3e6f22['site']),console[_0x1bb743(0x150)]('YAML\x20file:\x20'+_0x4f9426));let _0x3ecc93;try{_0x3ecc93=readFileSync(_0x4f9426,_0x1bb743(0xeb));}catch(_0x49b207){const _0x223638=_0x49b207 instanceof Error?_0x49b207[_0x1bb743(0x15d)]:String(_0x49b207);return console['error'](_0x1bb743(0x152)+_0x223638),0x1;}const _0x2bf3e4=await withSpinner(_0x1bb743(0xc1),()=>_0xc9597d[_0x1bb743(0x15b)][_0x1bb743(0x15a)](_0x3ecc93),{'verbose':_0x3e6f22['verbose']}),_0x48e467=_0x2bf3e4[_0x1bb743(0xcd)],{isNew:_0xa2455d,name:_0x2a4437,hasChanges:_0x3ae7e5,diffFormatted:_0x22fbd3}=_0x48e467;if(!_0x3ae7e5)return console[_0x1bb743(0x150)]('✔\x20No\x20changes\x20-\x20\x27'+_0x2a4437+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0xa2455d?console[_0x1bb743(0x150)](_0x1bb743(0x1c8)+_0x2a4437+'\x27:'):console['error'](_0x1bb743(0x119)+_0x2a4437+'\x27:');console[_0x1bb743(0x150)]('─'['repeat'](0x3c)),console[_0x1bb743(0x150)](_0x22fbd3),console[_0x1bb743(0x150)]('─'[_0x1bb743(0x105)](0x3c));const _0x3183a9=_0xa2455d?_0x1bb743(0x166)+_0x2a4437+'\x27?':_0x1bb743(0x16b)+_0x2a4437+'\x27?';if(!_0x3e6f22[_0x1bb743(0x14a)]){const _0x5e393f=await confirmKey(_0x3183a9);if(!_0x5e393f)return console[_0x1bb743(0x150)](_0x1bb743(0x1c6)),0x1;}const _0x3dbd12=_0xa2455d?_0x1bb743(0xe4):_0x1bb743(0x153),_0x584a32=await withSpinner(_0x3dbd12+_0x1bb743(0x112)+_0x2a4437+'\x27...',()=>_0x48e467['apply'](),{'verbose':_0x3e6f22[_0x1bb743(0xdd)]}),_0x1d642d=_0x584a32[_0x1bb743(0xcd)],_0x2b51b6=getConsoleNextUrl(_0x3e6f22[_0x1bb743(0x147)],_0x1bb743(0x12f)+_0x1d642d['id']),_0x4f691a=_0xa2455d?_0x1bb743(0xf8):'Updated';return console[_0x1bb743(0x150)]('✔\x20'+_0x4f691a+_0x1bb743(0x112)+_0x1d642d[_0x1bb743(0x1e8)]+'\x27'),console[_0x1bb743(0x150)]('\x20\x20'+_0x2b51b6),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a28_0x169315(0x1ec);[a28_0x169315(0x1c3)]=a28_0x169315(0x161);async[a28_0x169315(0x1aa)](_0x278edf){const _0x194832=a28_0x169315,{options:_0x355c5c,args:_0x52af83,tdx:_0x2ead45}=_0x278edf,_0x3a3e52=_0x355c5c,_0x770705=_0x52af83[0x0]||_0x355c5c[_0x194832(0x11d)];if(!_0x770705)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'+_0x194832(0x16d)+_0x194832(0x178)+_0x194832(0x129)+_0x194832(0x101)+_0x194832(0x1b0)),0x1;const _0x4320f5=resolveYamlFile(_0x770705);if(!existsSync(_0x4320f5))return showFileNotFoundError(_0x4320f5,_0x770705),0x1;_0x3a3e52[_0x194832(0xdd)]&&(console[_0x194832(0x150)](_0x194832(0xf4)+_0x3a3e52[_0x194832(0x147)]),console[_0x194832(0x150)](_0x194832(0x186)+_0x4320f5));let _0x114560;try{_0x114560=readFileSync(_0x4320f5,_0x194832(0xeb));}catch(_0x506041){const _0x42ac6a=_0x506041 instanceof Error?_0x506041[_0x194832(0x15d)]:String(_0x506041);return console['error'](_0x194832(0x152)+_0x42ac6a),0x1;}const _0x56aeb0=createCommandSpinner(a28_0x478b4a[_0x194832(0x175)]('Validating\x20configuration...'),{'verbose':_0x3a3e52[_0x194832(0xdd)]});_0x56aeb0[_0x194832(0x16a)]();const _0xc668db={'onProgress':_0x494a8a=>{const _0x9a5076=_0x194832;_0x56aeb0[_0x9a5076(0xf2)]=formatProgressMessage(_0x494a8a);}};if(_0x3a3e52[_0x194832(0x13f)])_0xc668db[_0x194832(0x13f)]=!![];if(_0x3a3e52[_0x194832(0x11e)])_0xc668db[_0x194832(0x11e)]=!![];_0x3a3e52[_0x194832(0x104)]&&(_0xc668db[_0x194832(0x104)]=_0x3a3e52['attribute']);_0x3a3e52[_0x194832(0x115)]&&(_0xc668db[_0x194832(0x115)]=_0x3a3e52[_0x194832(0x115)]);if(_0x3a3e52[_0x194832(0xe7)])_0xc668db[_0x194832(0xe7)]=_0x3a3e52[_0x194832(0xe7)];let _0xc93af0;try{_0xc93af0=await _0x2ead45[_0x194832(0x15b)][_0x194832(0xf6)](_0x114560,_0xc668db),_0x56aeb0[_0x194832(0x1a2)]();}catch(_0x414175){_0x56aeb0[_0x194832(0x1a2)]();throw _0x414175;}const _0x3113f5=_0x3a3e52[_0x194832(0xe7)]||'-1d';return this[_0x194832(0x139)](_0xc93af0,_0xc668db,_0x4320f5,_0x3113f5),_0xc93af0[_0x194832(0x103)]?0x0:0x1;}[a28_0x169315(0x139)](_0x16c276,_0xa27e04,_0x27a7c7,_0x51931f){const _0x597224=a28_0x169315;console[_0x597224(0x150)]('\x0a'+a28_0x478b4a[_0x597224(0x16f)](_0x597224(0x1a8))+'\x20'+_0x16c276[_0x597224(0x1e8)]),console[_0x597224(0x150)]('═'[_0x597224(0x105)](0x3c)),this[_0x597224(0x1c5)](_0x16c276);if(typeof _0xa27e04[_0x597224(0x104)]===_0x597224(0x173)){this[_0x597224(0x1a6)](_0x16c276),this[_0x597224(0x135)](_0x16c276),this[_0x597224(0x1cd)](_0x27a7c7,_0x51931f,_0x597224(0x104),_0xa27e04[_0x597224(0x104)]);return;}if(_0xa27e04[_0x597224(0x104)]===!![]){this[_0x597224(0x1a6)](_0x16c276),this[_0x597224(0x135)](_0x16c276),this[_0x597224(0x1cd)](_0x27a7c7,_0x51931f,_0x597224(0xe6));return;}if(typeof _0xa27e04[_0x597224(0x115)]===_0x597224(0x173)){this[_0x597224(0x176)](_0x16c276,_0x51931f),this['displaySummary'](_0x16c276),this[_0x597224(0x1cd)](_0x27a7c7,_0x51931f,_0x597224(0x115),_0xa27e04[_0x597224(0x115)]);return;}if(_0xa27e04[_0x597224(0x115)]===!![]){this[_0x597224(0x176)](_0x16c276,_0x51931f),this[_0x597224(0x135)](_0x16c276),this[_0x597224(0x1cd)](_0x27a7c7,_0x51931f,_0x597224(0x1b7));return;}this[_0x597224(0x1a6)](_0x16c276),this['displayBehaviorsStats'](_0x16c276,_0x51931f),this[_0x597224(0x135)](_0x16c276),this[_0x597224(0x1cd)](_0x27a7c7,_0x51931f,_0x597224(0x1e1));}[a28_0x169315(0x1cd)](_0x147a0b,_0x1f24fb,_0x424d7e,_0x197eb7){const _0x4ee98f=a28_0x169315;console['error']('\x0a'+a28_0x478b4a[_0x4ee98f(0x175)]('To\x20view\x20sample\x20data:'));const _0x2f8fa4=_0x1f24fb!==_0x4ee98f(0xff)?_0x4ee98f(0x1be)+_0x1f24fb:'';if(_0x424d7e===_0x4ee98f(0x104)&&_0x197eb7)console[_0x4ee98f(0x150)]('\x20\x20'+a28_0x478b4a[_0x4ee98f(0x175)]('tdx\x20segment\x20parent\x20preview\x20'+_0x147a0b+_0x4ee98f(0x127)+_0x197eb7+'\x22'+_0x2f8fa4));else{if(_0x424d7e===_0x4ee98f(0x115)&&_0x197eb7)console[_0x4ee98f(0x150)]('\x20\x20'+a28_0x478b4a['dim'](_0x4ee98f(0x1c0)+_0x147a0b+_0x4ee98f(0x174)+_0x197eb7+'\x22'+_0x2f8fa4));else(_0x424d7e==='attributes'||_0x424d7e===_0x4ee98f(0x1e1))&&console[_0x4ee98f(0x150)]('\x20\x20'+a28_0x478b4a['dim'](_0x4ee98f(0x1c0)+_0x147a0b+_0x4ee98f(0xfa)+_0x2f8fa4));}(_0x424d7e===_0x4ee98f(0x1b7)||_0x424d7e==='all')&&console[_0x4ee98f(0x150)]('\x20\x20'+a28_0x478b4a[_0x4ee98f(0x175)](_0x4ee98f(0x1c0)+_0x147a0b+_0x4ee98f(0x191)+_0x2f8fa4)),_0x424d7e===_0x4ee98f(0x1e1)&&console[_0x4ee98f(0x150)]('\x20\x20'+a28_0x478b4a[_0x4ee98f(0x175)]('tdx\x20segment\x20parent\x20preview\x20'+_0x147a0b+_0x4ee98f(0x1bd)+_0x2f8fa4));}[a28_0x169315(0x1c5)](_0x2a0739){const _0x2abec9=a28_0x169315,{master:_0x54cce6}=_0x2a0739,_0x19f648=_0x54cce6['schemaValid']?a28_0x478b4a['green']('✔'):a28_0x478b4a[_0x2abec9(0xe2)]('✘');console[_0x2abec9(0x150)]('\x0a'+a28_0x478b4a['dim']('Master\x20Table')),console[_0x2abec9(0x150)](_0x19f648+'\x20'+a28_0x478b4a[_0x2abec9(0x16f)](_0x54cce6[_0x2abec9(0x12e)]+'.'+_0x54cce6['table'])),_0x54cce6['schemaValid']?_0x54cce6[_0x2abec9(0x14f)]!==undefined&&console[_0x2abec9(0x150)]('\x20\x20'+a28_0x478b4a[_0x2abec9(0x175)](_0x2abec9(0xf1))+'\x20'+a28_0x478b4a[_0x2abec9(0xee)](formatRows(_0x54cce6['rowCount']))):console[_0x2abec9(0x150)]('\x20\x20'+a28_0x478b4a['red']('Error:')+'\x20'+_0x54cce6[_0x2abec9(0xcf)]);}[a28_0x169315(0x1a6)](_0x2255d0){const _0x4b44ce=a28_0x169315;if(_0x2255d0[_0x4b44ce(0xe6)]['length']===0x0)return;console['error']('\x0a'+a28_0x478b4a[_0x4b44ce(0x175)]('Attributes'));for(const _0x71cbe1 of _0x2255d0[_0x4b44ce(0xe6)]){const _0x1d4a7c=_0x71cbe1['schemaValid']?a28_0x478b4a[_0x4b44ce(0x18a)]('✔'):a28_0x478b4a['red']('✘');let _0x1c4b99='';if(_0x71cbe1[_0x4b44ce(0xd5)]&&_0x71cbe1[_0x4b44ce(0xf9)]!==undefined&&_0x71cbe1[_0x4b44ce(0xca)]!==undefined){const _0x187caa=_0x71cbe1[_0x4b44ce(0xca)][_0x4b44ce(0xf3)](0x1),_0x498eda=_0x71cbe1[_0x4b44ce(0xca)]>=0x50?a28_0x478b4a['green']:_0x71cbe1[_0x4b44ce(0xca)]>=0x32?a28_0x478b4a[_0x4b44ce(0xd2)]:a28_0x478b4a[_0x4b44ce(0xe2)];_0x1c4b99='\x20'+a28_0x478b4a['dim'](_0x4b44ce(0xfb))+'\x20'+_0x498eda(_0x187caa+'%')+'\x20('+formatRows(_0x71cbe1[_0x4b44ce(0xf9)])+_0x4b44ce(0x17c);}console['error'](_0x1d4a7c+'\x20'+a28_0x478b4a[_0x4b44ce(0x16f)](_0x71cbe1['name'])+_0x1c4b99),console[_0x4b44ce(0x150)]('\x20\x20'+a28_0x478b4a['dim'](_0x4b44ce(0x188))+'\x20'+a28_0x478b4a[_0x4b44ce(0x16f)](_0x71cbe1['database']+'.'+_0x71cbe1[_0x4b44ce(0x123)]));const _0x5e2616=_0x71cbe1[_0x4b44ce(0x128)]===_0x71cbe1['foreignKey']?a28_0x478b4a[_0x4b44ce(0x175)]('Join\x20on:')+'\x20'+_0x71cbe1[_0x4b44ce(0x128)]:a28_0x478b4a['dim'](_0x4b44ce(0x149))+'\x20'+_0x71cbe1[_0x4b44ce(0x128)]+_0x4b44ce(0x151)+_0x71cbe1[_0x4b44ce(0x1ce)];console[_0x4b44ce(0x150)]('\x20\x20'+_0x5e2616),console[_0x4b44ce(0x150)]('\x20\x20'+a28_0x478b4a[_0x4b44ce(0x175)](_0x4b44ce(0x195))),this[_0x4b44ce(0x159)](_0x71cbe1[_0x4b44ce(0xce)]),!_0x71cbe1[_0x4b44ce(0xd5)]&&console[_0x4b44ce(0x150)]('\x20\x20'+a28_0x478b4a[_0x4b44ce(0xe2)](_0x4b44ce(0x138))+'\x20'+_0x71cbe1[_0x4b44ce(0xcf)]);}}[a28_0x169315(0x176)](_0x30f88f,_0xf25f4c){const _0x155efc=a28_0x169315;if(_0x30f88f[_0x155efc(0x1b7)][_0x155efc(0x137)]===0x0)return;console['error']('\x0a'+a28_0x478b4a[_0x155efc(0x175)](_0x155efc(0x1df))+'\x20'+a28_0x478b4a[_0x155efc(0x175)]('('+_0xf25f4c+')'));for(const _0x29a554 of _0x30f88f['behaviors']){const _0xf868d0=_0x29a554[_0x155efc(0xd5)]?a28_0x478b4a[_0x155efc(0x18a)]('✔'):a28_0x478b4a[_0x155efc(0xe2)]('✘');let _0x520c2b='';if(_0x29a554[_0x155efc(0xd5)]&&_0x29a554[_0x155efc(0x1d5)]!==undefined&&_0x29a554[_0x155efc(0x1ba)]!==undefined){const _0x28ed10=_0x29a554['customerPercent']?.[_0x155efc(0xf3)](0x1)||'?',_0x362fd3=(_0x29a554['customerPercent']??0x0)>=0x32?a28_0x478b4a[_0x155efc(0x18a)]:(_0x29a554[_0x155efc(0x167)]??0x0)>=0x14?a28_0x478b4a[_0x155efc(0xd2)]:a28_0x478b4a[_0x155efc(0xe2)];_0x520c2b='\x20'+a28_0x478b4a[_0x155efc(0x175)]('Customers:')+'\x20'+_0x362fd3(formatRows(_0x29a554[_0x155efc(0x1d5)]))+'\x20('+_0x28ed10+_0x155efc(0x13a)+a28_0x478b4a[_0x155efc(0x175)](_0x155efc(0x1b5))+'\x20'+a28_0x478b4a['cyan'](formatRows(_0x29a554[_0x155efc(0x1ba)]));}console[_0x155efc(0x150)](_0xf868d0+'\x20'+a28_0x478b4a['bold'](_0x29a554[_0x155efc(0x1e8)])+_0x520c2b),console[_0x155efc(0x150)]('\x20\x20'+a28_0x478b4a[_0x155efc(0x175)]('Source:')+'\x20'+a28_0x478b4a[_0x155efc(0x16f)](_0x29a554[_0x155efc(0x12e)]+'.'+_0x29a554[_0x155efc(0x123)]));const _0x35cec7=_0x29a554[_0x155efc(0x128)]===_0x29a554[_0x155efc(0x1ce)]?a28_0x478b4a['dim']('Join\x20on:')+'\x20'+_0x29a554[_0x155efc(0x128)]:a28_0x478b4a['dim'](_0x155efc(0x149))+'\x20'+_0x29a554[_0x155efc(0x128)]+'\x20=\x20'+_0x29a554[_0x155efc(0x1ce)];console[_0x155efc(0x150)]('\x20\x20'+_0x35cec7),console[_0x155efc(0x150)]('\x20\x20'+a28_0x478b4a[_0x155efc(0x175)](_0x155efc(0x195))),this[_0x155efc(0x159)](_0x29a554[_0x155efc(0xce)]),!_0x29a554['schemaValid']&&console['error']('\x20\x20'+a28_0x478b4a[_0x155efc(0xe2)](_0x155efc(0x138))+'\x20'+_0x29a554[_0x155efc(0xcf)]);}}['displayColumns'](_0x1c2865){const _0xdafbf4=a28_0x169315;for(const _0x338079 of _0x1c2865){_0x338079[_0xdafbf4(0xdf)]===_0x338079[_0xdafbf4(0x185)]||_0x338079[_0xdafbf4(0x185)]==='*'?console[_0xdafbf4(0x150)](_0xdafbf4(0x1dc)+_0x338079['label']):console[_0xdafbf4(0x150)](_0xdafbf4(0x1dc)+_0x338079['label']+'\x20'+a28_0x478b4a[_0xdafbf4(0x175)]('('+_0x338079[_0xdafbf4(0x185)]+')'));}}[a28_0x169315(0x135)](_0x35d795){const _0x1df9fb=a28_0x169315;console[_0x1df9fb(0x150)]('─'[_0x1df9fb(0x105)](0x3c));if(_0x35d795[_0x1df9fb(0x19f)][_0x1df9fb(0x137)]>0x0){console[_0x1df9fb(0x150)]('\x0a'+a28_0x478b4a[_0x1df9fb(0xe2)](_0x1df9fb(0x11c)));for(const _0x3ec6f1 of _0x35d795[_0x1df9fb(0x19f)]){console[_0x1df9fb(0x150)]('\x20\x20'+a28_0x478b4a['red']('•')+'\x20'+_0x3ec6f1);}}_0x35d795[_0x1df9fb(0x103)]&&console[_0x1df9fb(0x150)]('\x0a'+a28_0x478b4a[_0x1df9fb(0x18a)]('✔')+_0x1df9fb(0x13d));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0xfc);[a28_0x169315(0x1c3)]=a28_0x169315(0x1d8);async[a28_0x169315(0x1aa)](_0x3acdf0){const _0x2b4eb5=a28_0x169315,{options:_0x1a6644,args:_0x5b4de0,tdx:_0xc13dea}=_0x3acdf0,_0x591357=_0x1a6644,_0x1eff99=_0x5b4de0[0x0]||_0x1a6644[_0x2b4eb5(0x11d)];if(!_0x1eff99)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x2b4eb5(0x1b1)+_0x2b4eb5(0x12d)+_0x2b4eb5(0x184)+_0x2b4eb5(0x1eb)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x2b4eb5(0x1b0)),0x1;if(!_0x591357[_0x2b4eb5(0x13f)]&&!_0x591357[_0x2b4eb5(0x104)]&&!_0x591357[_0x2b4eb5(0x115)]&&!_0x591357['enriched'])return console[_0x2b4eb5(0x150)](a28_0x478b4a[_0x2b4eb5(0xe2)](_0x2b4eb5(0xcb))),console[_0x2b4eb5(0x150)](_0x2b4eb5(0x110)),console['error'](_0x2b4eb5(0x192)),console[_0x2b4eb5(0x150)](_0x2b4eb5(0x109)),console['error'](_0x2b4eb5(0x177)),console[_0x2b4eb5(0x150)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console['error'](_0x2b4eb5(0xc8)),0x1;const _0xd6dd21=resolveYamlFile(_0x1eff99);if(!existsSync(_0xd6dd21))return showFileNotFoundError(_0xd6dd21,_0x1eff99),0x1;_0x591357[_0x2b4eb5(0xdd)]&&(console['error']('Site:\x20'+_0x591357[_0x2b4eb5(0x147)]),console['error']('YAML\x20file:\x20'+_0xd6dd21));let _0x1641f7;try{_0x1641f7=readFileSync(_0xd6dd21,'utf-8');}catch(_0x54e5f2){const _0x9e8e23=_0x54e5f2 instanceof Error?_0x54e5f2[_0x2b4eb5(0x15d)]:String(_0x54e5f2);return console['error']('Error\x20reading\x20file:\x20'+_0x9e8e23),0x1;}let _0x4ca3d5;try{_0x4ca3d5=parseYamlString(_0x1641f7);}catch(_0x4985fe){const _0x5324f4=_0x4985fe instanceof Error?_0x4985fe[_0x2b4eb5(0x15d)]:String(_0x4985fe);return console[_0x2b4eb5(0x150)](a28_0x478b4a['red'](_0x2b4eb5(0x1e4)+_0x5324f4)),0x1;}if(_0x591357['attribute']===!![]||_0x591357[_0x2b4eb5(0x104)]===''){const _0x1bbbd3=_0x4ca3d5['attributes']?.[_0x2b4eb5(0x14c)](_0x22b8cb=>_0x22b8cb[_0x2b4eb5(0x1e8)])||[];if(_0x1bbbd3[_0x2b4eb5(0x137)]===0x0)console[_0x2b4eb5(0x150)](a28_0x478b4a[_0x2b4eb5(0xe2)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x2b4eb5(0x150)](a28_0x478b4a['red'](_0x2b4eb5(0x1a0))),console[_0x2b4eb5(0x150)]('Available\x20attributes:');for(const _0x3e20ee of _0x1bbbd3){console[_0x2b4eb5(0x150)]('\x20\x20'+a28_0x478b4a[_0x2b4eb5(0xee)](_0x3e20ee));}console['error'](_0x2b4eb5(0xdb)+_0x1eff99+_0x2b4eb5(0x127)+_0x1bbbd3[0x0]+'\x22');}return 0x1;}if(_0x591357[_0x2b4eb5(0x115)]===!![]||_0x591357[_0x2b4eb5(0x115)]===''){const _0x4ebf18=_0x4ca3d5[_0x2b4eb5(0x1b7)]?.['map'](_0x3d43ef=>_0x3d43ef[_0x2b4eb5(0x1e8)])||[];if(_0x4ebf18[_0x2b4eb5(0x137)]===0x0)console[_0x2b4eb5(0x150)](a28_0x478b4a[_0x2b4eb5(0xe2)](_0x2b4eb5(0x126)));else{console[_0x2b4eb5(0x150)](a28_0x478b4a[_0x2b4eb5(0xe2)](_0x2b4eb5(0x1cf))),console[_0x2b4eb5(0x150)](_0x2b4eb5(0xda));for(const _0x5ea230 of _0x4ebf18){console[_0x2b4eb5(0x150)]('\x20\x20'+a28_0x478b4a[_0x2b4eb5(0xee)](_0x5ea230));}console[_0x2b4eb5(0x150)](_0x2b4eb5(0xdb)+_0x1eff99+_0x2b4eb5(0x174)+_0x4ebf18[0x0]+'\x22');}return 0x1;}const _0x29724b=createCommandSpinner(a28_0x478b4a[_0x2b4eb5(0x175)](_0x2b4eb5(0x1cb)),{'verbose':_0x591357[_0x2b4eb5(0xdd)]});_0x29724b[_0x2b4eb5(0x16a)]();const _0x3be1e5={'onProgress':_0x1a9597=>{const _0x3015c9=_0x2b4eb5;_0x29724b[_0x3015c9(0xf2)]=formatProgressMessage(_0x1a9597);}};if(_0x591357[_0x2b4eb5(0x13f)])_0x3be1e5[_0x2b4eb5(0x13f)]=!![];if(_0x591357[_0x2b4eb5(0x104)]&&typeof _0x591357[_0x2b4eb5(0x104)]==='string')_0x3be1e5[_0x2b4eb5(0x104)]=_0x591357[_0x2b4eb5(0x104)];if(_0x591357['behavior']&&typeof _0x591357['behavior']===_0x2b4eb5(0x173))_0x3be1e5[_0x2b4eb5(0x115)]=_0x591357[_0x2b4eb5(0x115)];if(_0x591357[_0x2b4eb5(0x11e)])_0x3be1e5[_0x2b4eb5(0x11e)]=!![];if(_0x591357[_0x2b4eb5(0xe7)])_0x3be1e5[_0x2b4eb5(0xe7)]=_0x591357[_0x2b4eb5(0xe7)];let _0x2e6e72;try{_0x2e6e72=await _0xc13dea['segment'][_0x2b4eb5(0x136)](_0x1641f7,_0x3be1e5),_0x29724b['stop']();}catch(_0x574ee3){_0x29724b[_0x2b4eb5(0x1a2)]();throw _0x574ee3;}return await this[_0x2b4eb5(0x1ac)](_0x2e6e72,{'master':_0x591357[_0x2b4eb5(0x13f)],'attribute':typeof _0x591357['attribute']===_0x2b4eb5(0x173)?_0x591357[_0x2b4eb5(0x104)]:undefined,'behavior':typeof _0x591357[_0x2b4eb5(0x115)]===_0x2b4eb5(0x173)?_0x591357['behavior']:undefined,'enriched':_0x591357[_0x2b4eb5(0x11e)]}),_0x2e6e72[_0x2b4eb5(0x103)]?0x0:0x1;}async['displayPreviewResults'](_0x503223,_0x1fb455){const _0x496f74=a28_0x169315;console[_0x496f74(0x150)]('\x0a'+a28_0x478b4a['bold'](_0x496f74(0x146))+'\x20'+_0x503223['name']),console['error']('═'[_0x496f74(0x105)](0x3c));if(_0x1fb455[_0x496f74(0x13f)]&&_0x503223[_0x496f74(0x14b)]){const _0x137c1e=a28_0x478b4a[_0x496f74(0x175)](_0x496f74(0xea))+'\x20'+a28_0x478b4a[_0x496f74(0x16f)](_0x503223[_0x496f74(0x13f)][_0x496f74(0x12e)]+'.'+_0x503223[_0x496f74(0x13f)]['table']);await this[_0x496f74(0xec)](_0x137c1e,_0x503223[_0x496f74(0x14b)]);}else{if(_0x1fb455[_0x496f74(0x104)]&&_0x503223[_0x496f74(0x14b)]){const _0x4a86c9=a28_0x478b4a[_0x496f74(0x175)](_0x496f74(0x10c))+'\x20'+a28_0x478b4a[_0x496f74(0x16f)](_0x1fb455[_0x496f74(0x104)]);await this['displaySampleData'](_0x4a86c9,_0x503223[_0x496f74(0x14b)]);}else{if(_0x1fb455[_0x496f74(0x115)]&&_0x503223[_0x496f74(0x14b)]){const _0x3f583a=a28_0x478b4a[_0x496f74(0x175)](_0x496f74(0x193))+'\x20'+a28_0x478b4a[_0x496f74(0x16f)](_0x1fb455['behavior']);await this[_0x496f74(0xec)](_0x3f583a,_0x503223['sampleData']);}else{if(_0x1fb455['enriched']&&_0x503223[_0x496f74(0x14b)]){const _0x1ab8e1=a28_0x478b4a[_0x496f74(0x175)](_0x496f74(0x162))+'\x20'+a28_0x478b4a[_0x496f74(0x16f)]('Master\x20+\x20Attributes');await this[_0x496f74(0xec)](_0x1ab8e1,_0x503223[_0x496f74(0x14b)]);}else!_0x503223[_0x496f74(0x14b)]&&console[_0x496f74(0x150)](_0x496f74(0x1c2));}}}if(_0x503223['errors'][_0x496f74(0x137)]>0x0){console[_0x496f74(0x150)]('─'[_0x496f74(0x105)](0x3c)),console['error']('\x0a'+a28_0x478b4a['red'](_0x496f74(0x11c)));for(const _0x3b6e3d of _0x503223[_0x496f74(0x19f)]){console['error']('\x20\x20'+a28_0x478b4a[_0x496f74(0xe2)]('•')+'\x20'+_0x3b6e3d);}}}async[a28_0x169315(0xec)](_0x3a0eaf,_0x2baed2){const _0x2c555d=a28_0x169315;if(_0x2baed2[_0x2c555d(0x137)]===0x0){console[_0x2c555d(0x150)]('\x0a'+_0x3a0eaf),console[_0x2c555d(0x150)](_0x2c555d(0x1a4));return;}console[_0x2c555d(0x150)]('\x0a'+_0x3a0eaf);const _0x30514e=Object[_0x2c555d(0x18c)](_0x2baed2[0x0])[_0x2c555d(0x14c)](_0x11c0f2=>({'name':_0x11c0f2,'type':typeof _0x2baed2[0x0][_0x11c0f2]===_0x2c555d(0x145)?_0x2c555d(0x1de):_0x2c555d(0x100)})),_0x5648a1={'queryId':_0x2c555d(0x1e2),'columns':_0x30514e,'data':_0x2baed2,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2baed2[_0x2c555d(0x137)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x527c1c=formatAsTable(_0x5648a1,_0x2baed2[_0x2c555d(0x137)],!![]);await writeOutput(_0x527c1c,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x189);[a28_0x169315(0x1c3)]=a28_0x169315(0x1ea);async['execute'](_0x30f477){const _0x261017=a28_0x169315,{options:_0x422f93,args:_0x2eba45,tdx:_0xc26d9c}=_0x30f477,_0x224051=_0x422f93,_0x389171=_0x2eba45[0x0]||_0x422f93[_0x261017(0x11d)];if(!_0x389171)return showParentSegmentNotSetError(_0x261017(0xd1)+_0x261017(0x113)),0x1;const _0x341e09=resolveYamlFile(_0x389171);if(existsSync(_0x341e09)){_0x224051[_0x261017(0xdd)]&&console[_0x261017(0x150)](_0x261017(0xd4)+_0x341e09);let _0x8af603;try{_0x8af603=readFileSync(_0x341e09,_0x261017(0xeb));}catch(_0x422401){const _0x3f82d5=_0x422401 instanceof Error?_0x422401['message']:String(_0x422401);return console[_0x261017(0x150)](_0x261017(0x152)+_0x3f82d5),0x1;}const _0x471872=await withSpinner('Analyzing\x20changes...',()=>_0xc26d9c[_0x261017(0x15b)][_0x261017(0x15a)](_0x8af603),{'verbose':_0x224051[_0x261017(0xdd)]}),_0xbfc3c2=_0x471872[_0x261017(0xcd)],{isNew:_0x4ef05c,name:_0x5eb0d7,hasChanges:_0x126f01,diffFormatted:_0x2db943}=_0xbfc3c2;if(_0x126f01){_0x4ef05c?console['error'](_0x261017(0x1c8)+_0x5eb0d7+'\x27:'):console[_0x261017(0x150)](_0x261017(0x119)+_0x5eb0d7+'\x27:');console[_0x261017(0x150)]('─'[_0x261017(0x105)](0x3c)),console['error'](_0x2db943),console['error']('─'[_0x261017(0x105)](0x3c));const _0x3fec20=_0x4ef05c?'Create\x20parent\x20segment\x20\x27'+_0x5eb0d7+_0x261017(0xd9):_0x261017(0x16b)+_0x5eb0d7+_0x261017(0xd9);if(!_0x224051[_0x261017(0x14a)]){const _0x3afcc8=await confirmKey(_0x3fec20);if(!_0x3afcc8)return console['error'](_0x261017(0x1c6)),0x1;}const _0x5ac4ea=_0x4ef05c?_0x261017(0xe4):_0x261017(0x153);await withSpinner(_0x5ac4ea+_0x261017(0x112)+_0x5eb0d7+_0x261017(0xd0),()=>_0xbfc3c2[_0x261017(0x12b)](),{'verbose':_0x224051['verbose']});const _0x15417d=_0x4ef05c?'Created':_0x261017(0x102);console[_0x261017(0x150)]('✔\x20'+_0x15417d+'\x20parent\x20segment\x20\x27'+_0x5eb0d7+'\x27');}else console[_0x261017(0x150)](_0x261017(0x1a5)+_0x5eb0d7+_0x261017(0x108));}const _0x7d48b8=await withSpinner(_0x261017(0x197)+_0x389171+_0x261017(0xd0),()=>_0xc26d9c[_0x261017(0x15b)][_0x261017(0x140)](_0x389171),{'verbose':_0x224051[_0x261017(0xdd)]}),_0xa6bd8c=_0x7d48b8[_0x261017(0xcd)],_0x121d7a=getConsoleUrl(_0x224051[_0x261017(0x147)],_0x261017(0x1bb)+_0xa6bd8c['workflowId']+_0x261017(0x143)+_0xa6bd8c['workflowSessionId']+'/attempt/'+_0xa6bd8c['workflowAttemptId']);return console[_0x261017(0x150)](_0x261017(0x16e)),console[_0x261017(0x150)]('\x20\x20'+a28_0x478b4a['dim']('Audience\x20ID:')+'\x20'+_0xa6bd8c[_0x261017(0x1e0)]),console[_0x261017(0x150)]('\x20\x20'+a28_0x478b4a['dim'](_0x261017(0x1b2))+'\x20'+_0xa6bd8c[_0x261017(0x15f)]),console['error']('\x20\x20'+a28_0x478b4a[_0x261017(0x175)](_0x261017(0x124))+'\x20'+_0xa6bd8c[_0x261017(0xdc)]),console[_0x261017(0x150)]('\x20\x20'+a28_0x478b4a['dim'](_0x261017(0x1ad))+'\x20'+_0xa6bd8c[_0x261017(0x156)]),console['error']('\x20\x20'+_0x121d7a),console[_0x261017(0x150)]('\x0a'+a28_0x478b4a[_0x261017(0x175)]('To\x20cancel:')+_0x261017(0x163)+_0xa6bd8c[_0x261017(0x156)]+_0x261017(0xc6)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x155);['description']=a28_0x169315(0x18e);async[a28_0x169315(0x1aa)](_0x36dd1c){const _0x3a4754=a28_0x169315,{options:_0x288ec3,args:_0x2da82c,tdx:_0xe70573}=_0x36dd1c,_0x26a1ca=_0x2da82c[0x0]||_0x288ec3[_0x3a4754(0x11d)];if(!_0x26a1ca)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'+_0x3a4754(0x1e6)),0x1;_0x288ec3[_0x3a4754(0xdd)]&&(console['error'](_0x3a4754(0xf4)+_0x288ec3[_0x3a4754(0x147)]),console['error'](_0x3a4754(0xf7)+_0x26a1ca));const _0x45e0e3=await withSpinner(_0x3a4754(0x13b)+_0x26a1ca+'\x27...',()=>_0xe70573[_0x3a4754(0x15b)]['listFields'](_0x26a1ca),{'verbose':_0x288ec3[_0x3a4754(0xdd)]}),_0x5643e1=_0x45e0e3['data'];console[_0x3a4754(0x150)]('✔\x20Found\x20'+_0x5643e1[_0x3a4754(0x137)]+'\x20field'+(_0x5643e1[_0x3a4754(0x137)]!==0x1?'s':''));if(_0x288ec3['json']||_0x288ec3[_0x3a4754(0xe3)])return await handleSDKOutput(_0x5643e1,_0x288ec3),0x0;return displayFieldsHumanReadable(_0x5643e1,_0x26a1ca),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x1b3);[a28_0x169315(0x1c3)]=a28_0x169315(0x116);async[a28_0x169315(0x1aa)](_0x4e47ab){const _0x4986bf=a28_0x169315,{options:_0x5cfab0,args:_0x173329,tdx:_0x186210}=_0x4e47ab,_0x544103=_0x5cfab0,_0x322d44=_0x173329[0x0]||_0x5cfab0['parentSegment'];if(!_0x322d44)return showParentSegmentNotSetError(_0x4986bf(0x187)+_0x4986bf(0xd6)+_0x4986bf(0x178)+_0x4986bf(0x18d)),0x1;_0x5cfab0[_0x4986bf(0xdd)]&&(console[_0x4986bf(0x150)](_0x4986bf(0xf4)+_0x5cfab0['site']),console[_0x4986bf(0x150)](_0x4986bf(0xf7)+_0x322d44));const _0x3a22d3=await withSpinner(_0x4986bf(0x10b)+_0x322d44+_0x4986bf(0xd0),()=>_0x186210[_0x4986bf(0x15b)][_0x4986bf(0x1c1)](_0x322d44),{'verbose':_0x5cfab0[_0x4986bf(0xdd)]}),_0x57c139=_0x3a22d3[_0x4986bf(0xcd)];if(_0x544103[_0x4986bf(0xe0)]){const _0x41e999=getConsoleNextUrl(_0x544103[_0x4986bf(0x147)],_0x4986bf(0x12f)+_0x57c139['id']);return console[_0x4986bf(0x150)](a28_0x478b4a['green']('✔')+_0x4986bf(0x168)+a28_0x478b4a[_0x4986bf(0xee)](_0x41e999)),openBrowser(_0x41e999),0x0;}return await handleSingleObjectOutput(_0x57c139,_0x5cfab0),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x164);[a28_0x169315(0x1c3)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a28_0x169315(0x1aa)](_0x51cca3){const _0x31db03=a28_0x169315,{options:_0x414edd,args:_0x2a29fd,tdx:_0x25b08e}=_0x51cca3,_0x40edfc=_0x2a29fd[0x0]||_0x414edd[_0x31db03(0x11d)];if(!_0x40edfc)return showParentSegmentNotSetError(_0x31db03(0x144)+_0x31db03(0x1e5)),0x1;_0x414edd[_0x31db03(0xdd)]&&(console[_0x31db03(0x150)](_0x31db03(0xf4)+_0x414edd['site']),console[_0x31db03(0x150)]('Parent\x20segment:\x20'+_0x40edfc));const _0x3a8fe0=await withSpinner(_0x31db03(0x11f)+_0x40edfc+'\x27...',()=>_0x25b08e['segment']['resolveParentId'](_0x40edfc),{'verbose':_0x414edd[_0x31db03(0xdd)]}),_0x1aca50=_0x3a8fe0[_0x31db03(0xcd)],_0x156f18=await withSpinner(_0x31db03(0xef)+_0x40edfc+'\x27...',()=>_0x25b08e[_0x31db03(0x15b)][_0x31db03(0x1db)](_0x1aca50),{'verbose':_0x414edd[_0x31db03(0xdd)]}),_0x24eb49=await executeSchemaQuery(_0x156f18[_0x31db03(0xcd)],_0x25b08e,_0x414edd);return await handleQueryOutput(_0x24eb49,_0x414edd),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x179);[a28_0x169315(0x1c3)]=a28_0x169315(0x11b);async[a28_0x169315(0x1aa)](_0x39bceb){const _0x26435d=a28_0x169315,{options:_0x2b0bb1,args:_0xbd1dfe,tdx:_0x5180b7}=_0x39bceb,_0x34bfd7=_0xbd1dfe[0x0]||_0x2b0bb1[_0x26435d(0x11d)];if(!_0x34bfd7)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x26435d(0x15c)),0x1;_0x2b0bb1['verbose']&&(console[_0x26435d(0x150)](_0x26435d(0xf4)+_0x2b0bb1[_0x26435d(0x147)]),console[_0x26435d(0x150)]('Parent\x20segment:\x20'+_0x34bfd7));const _0x573909=await withSpinner(_0x26435d(0x11f)+_0x34bfd7+_0x26435d(0xd0),()=>_0x5180b7[_0x26435d(0x15b)][_0x26435d(0x1af)](_0x34bfd7),{'verbose':_0x2b0bb1[_0x26435d(0xdd)]}),_0x31bc6c=_0x573909[_0x26435d(0xcd)],_0x1a7a30=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x34bfd7+'\x27...',()=>_0x5180b7['segment'][_0x26435d(0x1db)](_0x31bc6c),{'verbose':_0x2b0bb1[_0x26435d(0xdd)]}),_0x46898b=_0x1a7a30[_0x26435d(0xcd)];return _0x2b0bb1[_0x26435d(0x141)]===_0x26435d(0xe5)||_0x2b0bb1[_0x26435d(0x141)]===_0x26435d(0xe3)?await handleSDKOutput([{'sql':_0x46898b}],_0x2b0bb1):console[_0x26435d(0x1d1)](_0x46898b),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a28_0x169315(0x1e8)]=a28_0x169315(0x1da);['description']=a28_0x169315(0xf0);async[a28_0x169315(0x1aa)](_0x548c1f){const _0x26167f=a28_0x169315,{options:_0xd798a,args:_0x10629d,tdx:_0x3147ae}=_0x548c1f,_0x21c1bd=_0x10629d[0x0]||_0xd798a[_0x26167f(0x11d)];if(!_0x21c1bd)return showParentSegmentNotSetError(_0x26167f(0x114)+_0x26167f(0xc5)),0x1;_0xd798a[_0x26167f(0xdd)]&&(console[_0x26167f(0x150)](_0x26167f(0xf4)+_0xd798a['site']),console['error']('Parent\x20segment:\x20'+_0x21c1bd));const _0xb284bd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x21c1bd+'\x27...',()=>_0x3147ae[_0x26167f(0x15b)]['resolveParentId'](_0x21c1bd),{'verbose':_0xd798a[_0x26167f(0xdd)]}),_0x4c8abd=_0xb284bd[_0x26167f(0xcd)],_0x4e55df=await withSpinner(_0x26167f(0xef)+_0x21c1bd+'\x27...',()=>_0x3147ae[_0x26167f(0x15b)][_0x26167f(0x1db)](_0x4c8abd),{'verbose':_0xd798a[_0x26167f(0xdd)]});let _0x5341dd=_0x4e55df[_0x26167f(0xcd)];const _0x4511b7=resolveLimit(_0xd798a[_0x26167f(0x13e)],DEFAULT_DISPLAY_LIMIT),_0xe58f1b=/\bLIMIT\s+\d+/i[_0x26167f(0x17a)](_0x5341dd);!_0xe58f1b&&(_0x5341dd=_0x5341dd['trim']()['replace'](/;+$/,''),_0x5341dd=_0x26167f(0x17f)+_0x5341dd+_0x26167f(0x117)+_0x4511b7);_0xd798a[_0x26167f(0xdd)]&&console[_0x26167f(0x150)](_0x26167f(0xc2)+_0x5341dd);const _0x18dd01=await withQuerySpinner('Executing\x20parent\x20segment\x20query...',async _0x1c113b=>{const _0x85fb81=_0x26167f,_0x3b5c69=await _0x3147ae['query'][_0x85fb81(0x1aa)](_0x5341dd,{'catalog':'td','schema':_0x85fb81(0x181),'onJobId':_0x2a802f=>{const _0x2b7237=_0x85fb81;_0x1c113b[_0x2b7237(0x1d2)](_0x2a802f);}});return _0x3b5c69;},{'verbose':_0xd798a['verbose']}),_0x4d5af4=_0x18dd01[_0x26167f(0xcd)],_0x1cdae1=_0x4d5af4[_0x26167f(0x132)]?_0x26167f(0x19c)+_0x4d5af4[_0x26167f(0x132)]+']':'';return console[_0x26167f(0x150)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x4d5af4['stats']['processedRows'][_0x26167f(0x1ae)]()+_0x26167f(0x1bf)+(_0x26167f(0x1a7)+formatElapsed(_0x4d5af4['stats'][_0x26167f(0x10e)])+_0x1cdae1)),await handleQueryOutput(_0x4d5af4,_0xd798a),0x0;}}
1
+ const a28_0x13db83=a28_0x1aa3;(function(_0x2c7654,_0x31e8cb){const _0x31b41a=a28_0x1aa3,_0x325e6d=_0x2c7654();while(!![]){try{const _0x2d25af=parseInt(_0x31b41a(0xe9))/0x1*(parseInt(_0x31b41a(0x1d7))/0x2)+parseInt(_0x31b41a(0x20d))/0x3*(-parseInt(_0x31b41a(0x1b8))/0x4)+parseInt(_0x31b41a(0x203))/0x5+parseInt(_0x31b41a(0x171))/0x6+parseInt(_0x31b41a(0x1ba))/0x7+parseInt(_0x31b41a(0xfe))/0x8+-parseInt(_0x31b41a(0x1cb))/0x9*(parseInt(_0x31b41a(0x177))/0xa);if(_0x2d25af===_0x31e8cb)break;else _0x325e6d['push'](_0x325e6d['shift']());}catch(_0x2b12be){_0x325e6d['push'](_0x325e6d['shift']());}}}(a28_0x1713,0xac0de));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a28_0x1a1c24 from'path';import{BaseCommand}from'./command.js';function a28_0x1713(){const _0x35ac2d=['tdx\x20segment\x20parent\x20preview\x20','cyan','Error\x20parsing\x20YAML:\x20','Error:\x20--database\x20and\x20--table\x20are\x20required','Status:','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Error:\x20--attribute\x20requires\x20a\x20name\x0a','toFixed','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Master:','isDirectory','yellow','.yml','population','✔\x20Renamed\x20directory\x20to\x20','attributesFile','displayMasterInfo','segment:parent:fields','getParentSQL','\x20Opening\x20','createParent','elapsedTimeMillis','segment:parent:create','sampleData','Overwrite\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20[Job\x20ID:\x20','Available\x20attributes:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Coverage:','segment:parent:view','\x20--attribute\x20\x22<name>\x22','Rows:','/\x20directories\x20exist.','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','dim','unref','text','site','attribute','customerGroupFile','localeCompare','platform','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','name','using\x20the\x20default\x20path:\x20','audienceId','Fetching\x20current\x20configuration\x20for\x20\x27','schemaValid','filter','in\x20','behaviorsFile','use','👥\x20','Join:','timezone','table','Creating\x20parent\x20segment\x20\x27','List\x20parent\x20segments','2637642gHGftK','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Analyzing\x20changes...','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','segment:parent:desc','Join\x20on:','1316110WExCia','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','segment:parent:list','Available\x20behaviors:','Pattern:\x20','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x27\x20with\x20ID:\x20','master','displayPreviewResults','\x0aNo\x20sample\x20data\x20available','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','message','rowCount','segment:parent:validate','Create\x20parent\x20segment\x20\x27','displayValidateResults','listParents','log','matchedCount','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','limit','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','repeat','session','all','\x27...','utf-8','behavior','foreignKey','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','scheduleOption','red','\x0aNew\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Fetching\x20parent\x20segment\x20\x27','error','verbose','runParent','addBehaviors','Created','data','label','Updating','displayAttributesStats','displayBehaviorsStats','customerGroup','displaySummary','Master\x20+\x20Attributes','\x20\x20\x20\x20-\x20','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','allValid','Behavior:','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','displayPreviewHints','/\x20and\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20--behavior\x20\x22','\x20--behavior\x20\x22<name>\x22','stats','output','Resolving\x20parent\x20segment\x20\x27','\x20\x20No\x20sample\x20data\x20available','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','errors','3712300BQJEFm','workflowId','7725158qmeRqP','Show\x20parent\x20segment\x20details','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Parent\x20segment:\x20','/\x20directory.\x0a','segment:parent:preview','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','enriched','attributes','interval','segment:parent:run','\x20kill','totalEvents','YAML\x20file:\x20','pushParentYaml','Events:','test','207ybpbzg','behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','✔\x20No\x20changes\x20-\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','length','✔\x20Updated\x20parent\x20segment\x20\x27','\x27\x20and\x20run\x20workflow?','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','toLocaleString','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Creating','938952oSessH','Output\x20file:\x20','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','segment:parent:sql','double','\x0a⚠️\x20\x20Migrating:\x20','ignore','processedRows','Audience\x20ID:','pullParentYaml','Found\x20YAML\x20file:\x20','-1d','displayColumns','List\x20available\x20fields\x20for\x20segmentation','`\x20to\x20download\x20the\x20configuration\x20first','\x20Configuration\x20is\x20valid','bold','jsonl','Attribute:','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','match','trim','Attempt:','\x20parent\x20segment\x20\x27','Aborted.','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','/\x20→\x20','Error:','dirname','number','apply','Error:\x20File\x20not\x20found:\x20','✔\x20Found\x20','/attempt/','previewParentYaml','Preview:','darwin','Updated','Database:\x20','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Executing\x20parent\x20segment\x20query...','\x20Context\x20set:\x20','\x0aChanges\x20to\x20\x27','Updating\x20parent\x20segment\x20\x27','6936620Hbpbnb','description','%)\x20','json','execute','format','Enriched:','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','/app/workflows/','Error\x20reading\x20file:\x20','3YanImx','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','workflowSessionId','✔\x20Query\x20completed:\x20Processed\x20','\x0aChanges\x20to\x20apply\x20to\x20\x27','varchar','2MQgFON','\x5c$&','Source:','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','keys','joinKey','database','\x20field','parentSegment','segment:parent:push','SQL\x20query:\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x0a⚠️\x20\x20Both\x20','string','run','segment','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','customerPercent','map','6323080QOHEtS','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','replace','\x20is\x20already\x20up\x20to\x20date','\x20=\x20','Errors:','Options:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','web','/app/dw/parentSegments/','setJobId','start','coveragePercent','scheduleType','resolveParentId','Apply\x20changes\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','schemaError','\x20--enriched','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','green','/{name}.yml\x0a','parent_segment','Behaviors','SELECT\x20*\x20FROM\x20(\x0a','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','information_schema','\x20--interval\x20','jobId','Fetching\x20SQL\x20for\x20\x27','win32','xdg-open','displaySampleData','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20tdx\x20wf\x20attempt\x20','Customers:','Columns:','stop','\x20--attribute\x20\x22','Listing\x20parent\x20segments\x20matching\x20\x27','yes','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','updateParent','columns','workflowAttemptId','validateParentYaml','Options\x20(one\x20required):\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','getParentFull','column','join','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Options:\x0a','Site:\x20'];a28_0x1713=function(){return _0x35ac2d;};return a28_0x1713();}import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a28_0x1aa3(_0x1f4d48,_0x9b536a){_0x1f4d48=_0x1f4d48-0xe4;const _0x17137d=a28_0x1713();let _0x1aa3d1=_0x17137d[_0x1f4d48];return _0x1aa3d1;}import a28_0x414911 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/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(_0x42e220){const _0x5c8ba2=a28_0x1aa3,_0xa669d6=process[_0x5c8ba2(0x160)],_0x552e17=_0xa669d6===_0x5c8ba2(0x1fb)?'open':_0xa669d6===_0x5c8ba2(0x11e)?_0x5c8ba2(0x10a):_0x5c8ba2(0x11f);spawn(_0x552e17,[_0x42e220],{'detached':!![],'stdio':_0x5c8ba2(0x1dd)})[_0x5c8ba2(0x15a)]();}function migrateLegacyDirectory(){const _0x540678=a28_0x1aa3;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x1a1c94=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x1a1c94[_0x540678(0x140)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a28_0x414911[_0x540678(0x141)](_0x540678(0xf6)+LEGACY_PARENT_SEGMENT_DIR+_0x540678(0x1ae)+PARENT_SEGMENT_DIR+_0x540678(0x157))),console[_0x540678(0x19a)](a28_0x414911[_0x540678(0x159)](_0x540678(0x1ab)+LEGACY_PARENT_SEGMENT_DIR+_0x540678(0x1be))),![];console[_0x540678(0x19a)](a28_0x414911['yellow'](_0x540678(0x1dc)+LEGACY_PARENT_SEGMENT_DIR+_0x540678(0x1f1)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a28_0x414911[_0x540678(0x113)](_0x540678(0x144)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1d37a3){const _0x40f9dd=_0x1d37a3 instanceof Error?_0x1d37a3[_0x540678(0x182)]:String(_0x1d37a3);return console[_0x540678(0x19a)](a28_0x414911['red'](_0x540678(0xf5)+_0x40f9dd+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a28_0x13db83(0xf8)](_0x456112){const _0x1852c4=a28_0x13db83;return migrateLegacyDirectory(),super[_0x1852c4(0xf8)](_0x456112);}}function resolveYamlFile(_0x4a0600){const _0x42b735=a28_0x13db83;if(_0x4a0600['endsWith'](_0x42b735(0x142))||_0x4a0600['endsWith']('.yaml'))return _0x4a0600;return a28_0x1a1c24[_0x42b735(0x132)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4a0600)+_0x42b735(0x142));}function formatProgressMessage(_0x55bc10){const _0x1c46f9=a28_0x13db83,_0xa1cc38=_0x55bc10[_0x1c46f9(0x1eb)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0xa1cc38){const [,_0x4afc60,_0x294cf4,_0x37b2e0='']=_0xa1cc38;return a28_0x414911[_0x1c46f9(0x159)](_0x4afc60+':')+'\x20'+_0x294cf4+a28_0x414911[_0x1c46f9(0x159)](_0x37b2e0);}return a28_0x414911[_0x1c46f9(0x159)](_0x55bc10);}function showFileNotFoundError(_0x1604cd,_0x53171b){const _0x58a59a=a28_0x13db83;console['error'](a28_0x414911[_0x58a59a(0x196)](_0x58a59a(0x1f6)+_0x1604cd+'\x0a')),console[_0x58a59a(0x19a)](a28_0x414911['cyan']('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x53171b+_0x58a59a(0x1e5)));}function showParentSegmentNotSetError(_0x4d482b){const _0x411616=a28_0x13db83;console[_0x411616(0x19a)](a28_0x414911[_0x411616(0x141)](_0x411616(0x158))),console[_0x411616(0x19a)](_0x4d482b);}export class ParentSegmentListCommand extends BaseCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x179);[a28_0x13db83(0x204)]=a28_0x13db83(0x170);async[a28_0x13db83(0x207)](_0xd1c527){const _0x3422a7=a28_0x13db83,{options:_0x22140a,args:_0x551961,tdx:_0x522c8b}=_0xd1c527,_0x24b370=_0x551961[0x0];_0x22140a[_0x3422a7(0x19b)]&&(console['error']('Site:\x20'+_0x22140a[_0x3422a7(0x15c)]),_0x24b370&&console[_0x3422a7(0x19a)](_0x3422a7(0x17b)+_0x24b370));const _0x51208c=await withSpinner(_0x24b370?_0x3422a7(0x127)+_0x24b370+_0x3422a7(0x190):'Listing\x20parent\x20segments...',()=>_0x522c8b['segment'][_0x3422a7(0x187)](),{'verbose':_0x22140a[_0x3422a7(0x19b)]});let _0x5e07b3=_0x51208c['data'];if(_0x24b370){const _0x46ff61=_0x24b370['replace'](/[.+^${}()|[\]\\]/g,_0x3422a7(0xea))[_0x3422a7(0x101)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x227da8=new RegExp('^'+_0x46ff61+'$','i');_0x5e07b3=_0x5e07b3[_0x3422a7(0x167)](_0x42f62d=>_0x227da8['test'](_0x42f62d[_0x3422a7(0x1c2)]['name']));}_0x5e07b3['sort']((_0x584a46,_0x5a751c)=>_0x584a46[_0x3422a7(0x1c2)][_0x3422a7(0x162)][_0x3422a7(0x15f)](_0x5a751c['attributes'][_0x3422a7(0x162)])),console[_0x3422a7(0x19a)]('✔\x20Found\x20'+_0x5e07b3[_0x3422a7(0x1d0)]+'\x20parent\x20segment'+(_0x5e07b3[_0x3422a7(0x1d0)]!==0x1?'s':''));if(_0x22140a[_0x3422a7(0x208)]===_0x3422a7(0x206)||_0x22140a['format']==='jsonl')await handleSDKOutput(_0x5e07b3,_0x22140a);else{if(_0x5e07b3[_0x3422a7(0x1d0)]===0x0)_0x24b370?console[_0x3422a7(0x188)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x24b370):console['log']('No\x20parent\x20segments\x20found');else for(const _0x14608a of _0x5e07b3){const _0x3b3e11=_0x14608a[_0x3422a7(0x1c2)][_0x3422a7(0x143)]?a28_0x414911['dim']('\x20('+formatRows(_0x14608a['attributes']['population'])+')'):'';console['log'](_0x3422a7(0x16b)+_0x14608a[_0x3422a7(0x1c2)][_0x3422a7(0x162)]+_0x3b3e11);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x14c);[a28_0x13db83(0x204)]=a28_0x13db83(0x18a);async['execute'](_0x2ae936){const _0x505412=a28_0x13db83,{options:_0xd19e2c,args:_0x144d07,tdx:_0x5974b5}=_0x2ae936;console[_0x505412(0x19a)](_0x505412(0x133)+_0x505412(0x152)+_0x505412(0x119));const _0x2a85b=_0xd19e2c;if(_0x144d07['length']===0x0)return console[_0x505412(0x19a)](a28_0x414911[_0x505412(0x196)](_0x505412(0x1ac))),console[_0x505412(0x19a)](_0x505412(0x1d5)),0x1;const _0x35b54b=_0x144d07[0x0];if(!_0x2a85b[_0x505412(0xf0)]||!_0x2a85b['table'])return console['error'](_0x505412(0x139)),console[_0x505412(0x19a)](_0x505412(0x1d5)),0x1;_0x2a85b[_0x505412(0x19b)]&&(console[_0x505412(0x19a)]('Site:\x20'+_0x2a85b[_0x505412(0x15c)]),console[_0x505412(0x19a)]('Name:\x20'+_0x35b54b),console[_0x505412(0x19a)](_0x505412(0x1fd)+_0x2a85b[_0x505412(0xf0)]),console[_0x505412(0x19a)]('Table:\x20'+_0x2a85b[_0x505412(0x16e)]));const _0x51d925=await loadJSONFromOptions(_0x2a85b[_0x505412(0x1c2)],_0x2a85b[_0x505412(0x145)]),_0x46e624=await loadJSONFromOptions(_0x2a85b[_0x505412(0x1cc)],_0x2a85b[_0x505412(0x169)]),_0x39a5af=await loadJSONFromOptions(_0x2a85b[_0x505412(0x1a4)],_0x2a85b[_0x505412(0x15e)]),_0x4d6167={'name':_0x35b54b,'description':_0x2a85b[_0x505412(0x204)],'scheduleType':_0x2a85b[_0x505412(0x10c)],'scheduleOption':_0x2a85b[_0x505412(0x195)],'timezone':_0x2a85b[_0x505412(0x16d)],'master':{'parentDatabaseName':_0x2a85b['database'],'parentTableName':_0x2a85b[_0x505412(0x16e)]},'attributes':_0x51d925,'behaviors':_0x46e624,'customerGroup':_0x39a5af},_0x5e74c4=await withSpinner(_0x505412(0x16f)+_0x35b54b+_0x505412(0x190),()=>_0x5974b5[_0x505412(0xf9)][_0x505412(0x14a)](_0x4d6167),{'verbose':_0xd19e2c[_0x505412(0x19b)]}),_0x44c24d=_0x5e74c4[_0x505412(0x19f)];return console[_0x505412(0x19a)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x44c24d[_0x505412(0x162)]+_0x505412(0x17d)+_0x44c24d['id']),await handleSDKOutput([_0x44c24d],_0xd19e2c),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a28_0x13db83(0x162)]='segment:parent:update';[a28_0x13db83(0x204)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x50ef64){const _0xe5cc1f=a28_0x13db83,{options:_0x4e255e,args:_0x169c76,tdx:_0x97adb9}=_0x50ef64;console[_0xe5cc1f(0x19a)](_0xe5cc1f(0x129)+_0xe5cc1f(0x152)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3ae1db=_0x4e255e;if(_0x169c76[_0xe5cc1f(0x1d0)]===0x0)return console['error'](a28_0x414911[_0xe5cc1f(0x196)](_0xe5cc1f(0x1ac))),console[_0xe5cc1f(0x19a)](_0xe5cc1f(0x118)),0x1;const _0x2798f8=_0x169c76[0x0];_0x3ae1db[_0xe5cc1f(0x19b)]&&(console[_0xe5cc1f(0x19a)]('Site:\x20'+_0x3ae1db[_0xe5cc1f(0x15c)]),console['error']('Parent\x20segment:\x20'+_0x2798f8));const _0x576387=await withSpinner(_0xe5cc1f(0x165)+_0x2798f8+'\x27...',()=>_0x97adb9[_0xe5cc1f(0xf9)][_0xe5cc1f(0x130)](_0x2798f8),{'verbose':_0x3ae1db['verbose']}),_0x45c8f9=_0x576387[_0xe5cc1f(0x19f)],_0x515e19=await loadJSONFromOptions(_0x3ae1db['addAttributes'],_0x3ae1db['addAttributesFile']),_0x236cb6=await loadJSONFromOptions(_0x3ae1db[_0xe5cc1f(0x19d)],_0x3ae1db['addBehaviorsFile']),_0x5acf4e={'name':_0x45c8f9[_0xe5cc1f(0x162)],'description':_0x3ae1db[_0xe5cc1f(0x204)]!==undefined?_0x3ae1db['description']:_0x45c8f9[_0xe5cc1f(0x204)],'scheduleType':_0x3ae1db['scheduleType']!==undefined?_0x3ae1db[_0xe5cc1f(0x10c)]:_0x45c8f9[_0xe5cc1f(0x10c)],'scheduleOption':_0x3ae1db[_0xe5cc1f(0x195)]!==undefined?_0x3ae1db[_0xe5cc1f(0x195)]:_0x45c8f9[_0xe5cc1f(0x195)],'timezone':_0x3ae1db[_0xe5cc1f(0x16d)]!==undefined?_0x3ae1db[_0xe5cc1f(0x16d)]:_0x45c8f9[_0xe5cc1f(0x16d)],'master':_0x45c8f9[_0xe5cc1f(0x17e)],'attributes':_0x515e19?[..._0x45c8f9[_0xe5cc1f(0x1c2)]||[],..._0x515e19]:_0x45c8f9[_0xe5cc1f(0x1c2)],'behaviors':_0x236cb6?[..._0x45c8f9[_0xe5cc1f(0x1cc)]||[],..._0x236cb6]:_0x45c8f9[_0xe5cc1f(0x1cc)],'customerGroup':_0x45c8f9[_0xe5cc1f(0x1a4)]},_0x2cc88a=await withSpinner(_0xe5cc1f(0x202)+_0x2798f8+_0xe5cc1f(0x190),()=>_0x97adb9['segment'][_0xe5cc1f(0x12a)](_0x2798f8,_0x5acf4e),{'verbose':_0x3ae1db[_0xe5cc1f(0x19b)]}),_0x15d2bb=_0x2cc88a[_0xe5cc1f(0x19f)];return console[_0xe5cc1f(0x19a)](_0xe5cc1f(0x1d1)+_0x15d2bb[_0xe5cc1f(0x162)]+'\x27'),await handleSDKOutput([_0x15d2bb],_0x3ae1db),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a28_0x13db83(0x162)]='segment:parent:pull';[a28_0x13db83(0x204)]=a28_0x13db83(0x174);async[a28_0x13db83(0x207)](_0x2afbc8){const _0x2243d2=a28_0x13db83,{options:_0x1e112e,args:_0x5b07cf,tdx:_0x353e9c}=_0x2afbc8,_0x50a240=_0x1e112e,_0x442c98=_0x5b07cf[0x0]||_0x1e112e['parentSegment'];if(!_0x442c98)return showParentSegmentNotSetError(_0x2243d2(0x1b6)+_0x2243d2(0x1cf)),0x1;if(_0x50a240[_0x2243d2(0x16a)]&&_0x50a240[_0x2243d2(0x1b3)])return console[_0x2243d2(0x19a)](a28_0x414911[_0x2243d2(0x196)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x2243d2(0x19a)](a28_0x414911[_0x2243d2(0x159)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x2243d2(0x19a)](a28_0x414911['dim'](_0x2243d2(0x163)+PARENT_SEGMENT_DIR+_0x2243d2(0x114))),console[_0x2243d2(0x19a)](a28_0x414911['cyan'](_0x2243d2(0x20a))),0x1;const _0x4c2482=_0x50a240['output']||a28_0x1a1c24[_0x2243d2(0x132)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x442c98)+_0x2243d2(0x142));_0x50a240[_0x2243d2(0x19b)]&&(console[_0x2243d2(0x19a)](_0x2243d2(0x135)+_0x50a240['site']),console[_0x2243d2(0x19a)](_0x2243d2(0x1bd)+_0x442c98),console['error'](_0x2243d2(0x1d8)+_0x4c2482));const _0x2c0c87=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x442c98+_0x2243d2(0x190),()=>_0x353e9c[_0x2243d2(0xf9)][_0x2243d2(0x1e0)](_0x442c98),{'verbose':_0x50a240[_0x2243d2(0x19b)]}),_0x5e85f2=_0x2c0c87[_0x2243d2(0x19f)];if(existsSync(_0x4c2482)){const _0x134be9=readFileSync(_0x4c2482,'utf-8'),_0x5935e5=generateDiff(_0x134be9,_0x5e85f2);if(!hasChanges(_0x5935e5))console[_0x2243d2(0x19a)](a28_0x414911['green']('✔')+'\x20No\x20changes\x20-\x20'+a28_0x414911['cyan'](_0x4c2482)+_0x2243d2(0x102));else{console[_0x2243d2(0x19a)](_0x2243d2(0x201)+_0x4c2482+'\x27:'),console['error']('─'[_0x2243d2(0x18d)](0x3c)),console[_0x2243d2(0x19a)](formatDiffWithColors(_0x5935e5)),console[_0x2243d2(0x19a)]('─'[_0x2243d2(0x18d)](0x3c));if(!_0x50a240['yes']){const _0x1af1fb=await confirmKey(_0x2243d2(0x14e)+_0x4c2482+'\x27?');if(!_0x1af1fb)return console[_0x2243d2(0x19a)](_0x2243d2(0x1ef)),0x1;}writeFileSync(_0x4c2482,_0x5e85f2,_0x2243d2(0x191)),console[_0x2243d2(0x19a)](a28_0x414911[_0x2243d2(0x113)]('✔')+_0x2243d2(0x1d3)+a28_0x414911[_0x2243d2(0x137)](_0x4c2482));}}else{const _0x1d4542=a28_0x1a1c24[_0x2243d2(0x1f3)](_0x4c2482);!existsSync(_0x1d4542)&&mkdirSync(_0x1d4542,{'recursive':!![]}),writeFileSync(_0x4c2482,_0x5e85f2,_0x2243d2(0x191)),console[_0x2243d2(0x19a)](a28_0x414911[_0x2243d2(0x113)]('✔')+_0x2243d2(0x1d3)+a28_0x414911[_0x2243d2(0x137)](_0x4c2482));}return saveSessionContext({'parent_segment':_0x442c98},_0x50a240[_0x2243d2(0x18e)]),console[_0x2243d2(0x19a)](a28_0x414911[_0x2243d2(0x113)]('✔')+_0x2243d2(0x200)+a28_0x414911[_0x2243d2(0x159)](_0x2243d2(0x115))+_0x2243d2(0x103)+a28_0x414911[_0x2243d2(0x137)](_0x442c98)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a28_0x13db83(0xf3);[a28_0x13db83(0x204)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0x1a1652){const _0x138c45=a28_0x13db83,{options:_0x55fa63,args:_0xb1b7fb,tdx:_0x42ac3f}=_0x1a1652,_0x3fa765=_0x55fa63,_0x44efdb=_0xb1b7fb[0x0]||_0x55fa63[_0x138c45(0xf2)];if(!_0x44efdb)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x19538a=resolveYamlFile(_0x44efdb);if(!existsSync(_0x19538a))return showFileNotFoundError(_0x19538a,_0x44efdb),0x1;_0x3fa765[_0x138c45(0x19b)]&&(console[_0x138c45(0x19a)](_0x138c45(0x135)+_0x3fa765[_0x138c45(0x15c)]),console[_0x138c45(0x19a)](_0x138c45(0x1c7)+_0x19538a));let _0x36af6b;try{_0x36af6b=readFileSync(_0x19538a,_0x138c45(0x191));}catch(_0x46e1f3){const _0x2cdf71=_0x46e1f3 instanceof Error?_0x46e1f3['message']:String(_0x46e1f3);return console[_0x138c45(0x19a)](_0x138c45(0x20c)+_0x2cdf71),0x1;}const _0xa399b6=await withSpinner(_0x138c45(0x173),()=>_0x42ac3f['segment'][_0x138c45(0x1c8)](_0x36af6b),{'verbose':_0x3fa765[_0x138c45(0x19b)]}),_0x266aaf=_0xa399b6[_0x138c45(0x19f)],{isNew:_0x4755f7,name:_0x4ca4aa,hasChanges:_0x13b386,diffFormatted:_0x5b4ebb}=_0x266aaf;if(!_0x13b386)return console[_0x138c45(0x19a)]('✔\x20No\x20changes\x20-\x20\x27'+_0x4ca4aa+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x4755f7?console[_0x138c45(0x19a)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x4ca4aa+'\x27:'):console[_0x138c45(0x19a)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x4ca4aa+'\x27:');console['error']('─'[_0x138c45(0x18d)](0x3c)),console['error'](_0x5b4ebb),console['error']('─'[_0x138c45(0x18d)](0x3c));const _0x354a91=_0x4755f7?_0x138c45(0x185)+_0x4ca4aa+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x4ca4aa+'\x27?';if(!_0x3fa765[_0x138c45(0x128)]){const _0x57d744=await confirmKey(_0x354a91);if(!_0x57d744)return console[_0x138c45(0x19a)](_0x138c45(0x1ef)),0x1;}const _0x2b9684=_0x4755f7?_0x138c45(0x1d6):'Updating',_0x444483=await withSpinner(_0x2b9684+_0x138c45(0x1ee)+_0x4ca4aa+_0x138c45(0x190),()=>_0x266aaf[_0x138c45(0x1f5)](),{'verbose':_0x3fa765[_0x138c45(0x19b)]}),_0x363861=_0x444483[_0x138c45(0x19f)],_0x319dcc=getConsoleNextUrl(_0x3fa765[_0x138c45(0x15c)],_0x138c45(0x108)+_0x363861['id']),_0x2ed534=_0x4755f7?_0x138c45(0x19e):'Updated';return console['error']('✔\x20'+_0x2ed534+_0x138c45(0x1ee)+_0x363861[_0x138c45(0x162)]+'\x27'),console[_0x138c45(0x19a)]('\x20\x20'+_0x319dcc),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x184);[a28_0x13db83(0x204)]=a28_0x13db83(0x178);async['execute'](_0x1aebc4){const _0x100a3e=a28_0x13db83,{options:_0x3062ee,args:_0xec3986,tdx:_0x4d469a}=_0x1aebc4,_0x5568a9=_0x3062ee,_0x96a494=_0xec3986[0x0]||_0x3062ee[_0x100a3e(0xf2)];if(!_0x96a494)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'+_0x100a3e(0x134)+_0x100a3e(0xfa)+_0x100a3e(0x1f0)+_0x100a3e(0x1bc)),0x1;const _0x152f01=resolveYamlFile(_0x96a494);if(!existsSync(_0x152f01))return showFileNotFoundError(_0x152f01,_0x96a494),0x1;_0x5568a9['verbose']&&(console[_0x100a3e(0x19a)](_0x100a3e(0x135)+_0x5568a9[_0x100a3e(0x15c)]),console[_0x100a3e(0x19a)]('YAML\x20file:\x20'+_0x152f01));let _0x17e9d5;try{_0x17e9d5=readFileSync(_0x152f01,_0x100a3e(0x191));}catch(_0x272f20){const _0xf983aa=_0x272f20 instanceof Error?_0x272f20['message']:String(_0x272f20);return console[_0x100a3e(0x19a)](_0x100a3e(0x20c)+_0xf983aa),0x1;}const _0x31879c=createCommandSpinner(a28_0x414911[_0x100a3e(0x159)]('Validating\x20configuration...'),{'verbose':_0x5568a9['verbose']});_0x31879c[_0x100a3e(0x10a)]();const _0x248ac1={'onProgress':_0xda7219=>{_0x31879c['text']=formatProgressMessage(_0xda7219);}};if(_0x5568a9[_0x100a3e(0x17e)])_0x248ac1[_0x100a3e(0x17e)]=!![];if(_0x5568a9[_0x100a3e(0x1c1)])_0x248ac1[_0x100a3e(0x1c1)]=!![];_0x5568a9[_0x100a3e(0x15d)]&&(_0x248ac1['attribute']=_0x5568a9[_0x100a3e(0x15d)]);_0x5568a9[_0x100a3e(0x192)]&&(_0x248ac1[_0x100a3e(0x192)]=_0x5568a9[_0x100a3e(0x192)]);if(_0x5568a9[_0x100a3e(0x1c3)])_0x248ac1['interval']=_0x5568a9[_0x100a3e(0x1c3)];let _0x3ec794;try{_0x3ec794=await _0x4d469a[_0x100a3e(0xf9)][_0x100a3e(0x12d)](_0x17e9d5,_0x248ac1),_0x31879c[_0x100a3e(0x125)]();}catch(_0x1faf92){_0x31879c[_0x100a3e(0x125)]();throw _0x1faf92;}const _0x1bfe08=_0x5568a9[_0x100a3e(0x1c3)]||_0x100a3e(0x1e2);return this[_0x100a3e(0x186)](_0x3ec794,_0x248ac1,_0x152f01,_0x1bfe08),_0x3ec794[_0x100a3e(0x1a9)]?0x0:0x1;}[a28_0x13db83(0x186)](_0x4fb2c8,_0x387c24,_0x3326c9,_0x2da40a){const _0x3ceb41=a28_0x13db83;console[_0x3ceb41(0x19a)]('\x0a'+a28_0x414911[_0x3ceb41(0x1e7)]('Validate:')+'\x20'+_0x4fb2c8['name']),console['error']('═'[_0x3ceb41(0x18d)](0x3c)),this[_0x3ceb41(0x146)](_0x4fb2c8);if(typeof _0x387c24[_0x3ceb41(0x15d)]===_0x3ceb41(0xf7)){this[_0x3ceb41(0x1a2)](_0x4fb2c8),this['displaySummary'](_0x4fb2c8),this['displayPreviewHints'](_0x3326c9,_0x2da40a,'attribute',_0x387c24[_0x3ceb41(0x15d)]);return;}if(_0x387c24[_0x3ceb41(0x15d)]===!![]){this[_0x3ceb41(0x1a2)](_0x4fb2c8),this[_0x3ceb41(0x1a5)](_0x4fb2c8),this[_0x3ceb41(0x1ad)](_0x3326c9,_0x2da40a,_0x3ceb41(0x1c2));return;}if(typeof _0x387c24[_0x3ceb41(0x192)]===_0x3ceb41(0xf7)){this[_0x3ceb41(0x1a3)](_0x4fb2c8,_0x2da40a),this[_0x3ceb41(0x1a5)](_0x4fb2c8),this[_0x3ceb41(0x1ad)](_0x3326c9,_0x2da40a,_0x3ceb41(0x192),_0x387c24[_0x3ceb41(0x192)]);return;}if(_0x387c24[_0x3ceb41(0x192)]===!![]){this[_0x3ceb41(0x1a3)](_0x4fb2c8,_0x2da40a),this[_0x3ceb41(0x1a5)](_0x4fb2c8),this[_0x3ceb41(0x1ad)](_0x3326c9,_0x2da40a,'behaviors');return;}this[_0x3ceb41(0x1a2)](_0x4fb2c8),this[_0x3ceb41(0x1a3)](_0x4fb2c8,_0x2da40a),this[_0x3ceb41(0x1a5)](_0x4fb2c8),this[_0x3ceb41(0x1ad)](_0x3326c9,_0x2da40a,_0x3ceb41(0x18f));}[a28_0x13db83(0x1ad)](_0x4f849b,_0x46dab3,_0x5750fc,_0x7127bb){const _0x524038=a28_0x13db83;console[_0x524038(0x19a)]('\x0a'+a28_0x414911[_0x524038(0x159)]('To\x20view\x20sample\x20data:'));const _0x549bff=_0x46dab3!==_0x524038(0x1e2)?_0x524038(0x11b)+_0x46dab3:'';if(_0x5750fc===_0x524038(0x15d)&&_0x7127bb)console[_0x524038(0x19a)]('\x20\x20'+a28_0x414911[_0x524038(0x159)](_0x524038(0x136)+_0x4f849b+_0x524038(0x126)+_0x7127bb+'\x22'+_0x549bff));else{if(_0x5750fc===_0x524038(0x192)&&_0x7127bb)console['error']('\x20\x20'+a28_0x414911[_0x524038(0x159)](_0x524038(0x136)+_0x4f849b+_0x524038(0x1b0)+_0x7127bb+'\x22'+_0x549bff));else(_0x5750fc===_0x524038(0x1c2)||_0x5750fc==='all')&&console[_0x524038(0x19a)]('\x20\x20'+a28_0x414911[_0x524038(0x159)](_0x524038(0x136)+_0x4f849b+_0x524038(0x155)+_0x549bff));}(_0x5750fc==='behaviors'||_0x5750fc==='all')&&console['error']('\x20\x20'+a28_0x414911[_0x524038(0x159)](_0x524038(0x136)+_0x4f849b+_0x524038(0x1b1)+_0x549bff)),_0x5750fc===_0x524038(0x18f)&&console[_0x524038(0x19a)]('\x20\x20'+a28_0x414911[_0x524038(0x159)]('tdx\x20segment\x20parent\x20preview\x20'+_0x4f849b+_0x524038(0x111)+_0x549bff));}['displayMasterInfo'](_0x43af8e){const _0x24fafb=a28_0x13db83,{master:_0x569fa2}=_0x43af8e,_0x15787f=_0x569fa2[_0x24fafb(0x166)]?a28_0x414911[_0x24fafb(0x113)]('✔'):a28_0x414911[_0x24fafb(0x196)]('✘');console['error']('\x0a'+a28_0x414911[_0x24fafb(0x159)]('Master\x20Table')),console[_0x24fafb(0x19a)](_0x15787f+'\x20'+a28_0x414911['bold'](_0x569fa2['database']+'.'+_0x569fa2['table'])),_0x569fa2[_0x24fafb(0x166)]?_0x569fa2['rowCount']!==undefined&&console['error']('\x20\x20'+a28_0x414911[_0x24fafb(0x159)](_0x24fafb(0x156))+'\x20'+a28_0x414911[_0x24fafb(0x137)](formatRows(_0x569fa2[_0x24fafb(0x183)]))):console[_0x24fafb(0x19a)]('\x20\x20'+a28_0x414911[_0x24fafb(0x196)](_0x24fafb(0x1f2))+'\x20'+_0x569fa2[_0x24fafb(0x110)]);}['displayAttributesStats'](_0x30bede){const _0x272898=a28_0x13db83;if(_0x30bede['attributes'][_0x272898(0x1d0)]===0x0)return;console[_0x272898(0x19a)]('\x0a'+a28_0x414911['dim']('Attributes'));for(const _0x50f1e5 of _0x30bede[_0x272898(0x1c2)]){const _0x22601a=_0x50f1e5['schemaValid']?a28_0x414911[_0x272898(0x113)]('✔'):a28_0x414911['red']('✘');let _0xd404d0='';if(_0x50f1e5['schemaValid']&&_0x50f1e5['matchedCount']!==undefined&&_0x50f1e5[_0x272898(0x10b)]!==undefined){const _0x113b6b=_0x50f1e5[_0x272898(0x10b)][_0x272898(0x13d)](0x1),_0x5f20fe=_0x50f1e5[_0x272898(0x10b)]>=0x50?a28_0x414911['green']:_0x50f1e5['coveragePercent']>=0x32?a28_0x414911[_0x272898(0x141)]:a28_0x414911[_0x272898(0x196)];_0xd404d0='\x20'+a28_0x414911[_0x272898(0x159)](_0x272898(0x153))+'\x20'+_0x5f20fe(_0x113b6b+'%')+'\x20('+formatRows(_0x50f1e5[_0x272898(0x189)])+'\x20rows)';}console['error'](_0x22601a+'\x20'+a28_0x414911['bold'](_0x50f1e5[_0x272898(0x162)])+_0xd404d0),console[_0x272898(0x19a)]('\x20\x20'+a28_0x414911[_0x272898(0x159)](_0x272898(0xeb))+'\x20'+a28_0x414911['bold'](_0x50f1e5[_0x272898(0xf0)]+'.'+_0x50f1e5['table']));const _0x569933=_0x50f1e5[_0x272898(0xef)]===_0x50f1e5[_0x272898(0x193)]?a28_0x414911[_0x272898(0x159)](_0x272898(0x176))+'\x20'+_0x50f1e5[_0x272898(0xef)]:a28_0x414911['dim'](_0x272898(0x16c))+'\x20'+_0x50f1e5[_0x272898(0xef)]+_0x272898(0x103)+_0x50f1e5[_0x272898(0x193)];console[_0x272898(0x19a)]('\x20\x20'+_0x569933),console[_0x272898(0x19a)]('\x20\x20'+a28_0x414911[_0x272898(0x159)](_0x272898(0x124))),this[_0x272898(0x1e3)](_0x50f1e5[_0x272898(0x12b)]),!_0x50f1e5[_0x272898(0x166)]&&console[_0x272898(0x19a)]('\x20\x20'+a28_0x414911[_0x272898(0x196)](_0x272898(0x1f2))+'\x20'+_0x50f1e5['schemaError']);}}[a28_0x13db83(0x1a3)](_0x32eecf,_0x2ac6d1){const _0x36a238=a28_0x13db83;if(_0x32eecf[_0x36a238(0x1cc)][_0x36a238(0x1d0)]===0x0)return;console['error']('\x0a'+a28_0x414911[_0x36a238(0x159)](_0x36a238(0x116))+'\x20'+a28_0x414911[_0x36a238(0x159)]('('+_0x2ac6d1+')'));for(const _0xf35262 of _0x32eecf['behaviors']){const _0x11e40d=_0xf35262[_0x36a238(0x166)]?a28_0x414911[_0x36a238(0x113)]('✔'):a28_0x414911[_0x36a238(0x196)]('✘');let _0x177722='';if(_0xf35262[_0x36a238(0x166)]&&_0xf35262['customersWithEvents']!==undefined&&_0xf35262[_0x36a238(0x1c6)]!==undefined){const _0x8fbc0f=_0xf35262[_0x36a238(0xfc)]?.[_0x36a238(0x13d)](0x1)||'?',_0x3d013a=(_0xf35262['customerPercent']??0x0)>=0x32?a28_0x414911[_0x36a238(0x113)]:(_0xf35262[_0x36a238(0xfc)]??0x0)>=0x14?a28_0x414911[_0x36a238(0x141)]:a28_0x414911[_0x36a238(0x196)];_0x177722='\x20'+a28_0x414911[_0x36a238(0x159)](_0x36a238(0x123))+'\x20'+_0x3d013a(formatRows(_0xf35262['customersWithEvents']))+'\x20('+_0x8fbc0f+_0x36a238(0x205)+a28_0x414911['dim'](_0x36a238(0x1c9))+'\x20'+a28_0x414911[_0x36a238(0x137)](formatRows(_0xf35262[_0x36a238(0x1c6)]));}console['error'](_0x11e40d+'\x20'+a28_0x414911['bold'](_0xf35262[_0x36a238(0x162)])+_0x177722),console[_0x36a238(0x19a)]('\x20\x20'+a28_0x414911['dim']('Source:')+'\x20'+a28_0x414911['bold'](_0xf35262[_0x36a238(0xf0)]+'.'+_0xf35262['table']));const _0x584cb6=_0xf35262[_0x36a238(0xef)]===_0xf35262[_0x36a238(0x193)]?a28_0x414911[_0x36a238(0x159)](_0x36a238(0x176))+'\x20'+_0xf35262[_0x36a238(0xef)]:a28_0x414911['dim'](_0x36a238(0x16c))+'\x20'+_0xf35262['joinKey']+'\x20=\x20'+_0xf35262[_0x36a238(0x193)];console[_0x36a238(0x19a)]('\x20\x20'+_0x584cb6),console[_0x36a238(0x19a)]('\x20\x20'+a28_0x414911[_0x36a238(0x159)]('Columns:')),this[_0x36a238(0x1e3)](_0xf35262['columns']),!_0xf35262[_0x36a238(0x166)]&&console[_0x36a238(0x19a)]('\x20\x20'+a28_0x414911['red'](_0x36a238(0x1f2))+'\x20'+_0xf35262[_0x36a238(0x110)]);}}['displayColumns'](_0x105a0f){const _0x2ae8fa=a28_0x13db83;for(const _0x15981e of _0x105a0f){_0x15981e[_0x2ae8fa(0x1a0)]===_0x15981e[_0x2ae8fa(0x131)]||_0x15981e[_0x2ae8fa(0x131)]==='*'?console['error'](_0x2ae8fa(0x1a7)+_0x15981e['label']):console['error']('\x20\x20\x20\x20-\x20'+_0x15981e[_0x2ae8fa(0x1a0)]+'\x20'+a28_0x414911[_0x2ae8fa(0x159)]('('+_0x15981e['column']+')'));}}['displaySummary'](_0x3b1a1a){const _0x54ebf2=a28_0x13db83;console[_0x54ebf2(0x19a)]('─'[_0x54ebf2(0x18d)](0x3c));if(_0x3b1a1a[_0x54ebf2(0x1b7)]['length']>0x0){console[_0x54ebf2(0x19a)]('\x0a'+a28_0x414911[_0x54ebf2(0x196)](_0x54ebf2(0x104)));for(const _0x3f88b6 of _0x3b1a1a['errors']){console[_0x54ebf2(0x19a)]('\x20\x20'+a28_0x414911[_0x54ebf2(0x196)]('•')+'\x20'+_0x3f88b6);}}_0x3b1a1a['allValid']&&console[_0x54ebf2(0x19a)]('\x0a'+a28_0x414911[_0x54ebf2(0x113)]('✔')+_0x54ebf2(0x1e6));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x1bf);[a28_0x13db83(0x204)]=a28_0x13db83(0x13e);async[a28_0x13db83(0x207)](_0x2f0ff5){const _0x3d5b84=a28_0x13db83,{options:_0x37e1d3,args:_0x2453d0,tdx:_0x333f40}=_0x2f0ff5,_0x4f1de2=_0x37e1d3,_0x364890=_0x2453d0[0x0]||_0x37e1d3[_0x3d5b84(0xf2)];if(!_0x364890)return showParentSegmentNotSetError(_0x3d5b84(0x1a8)+_0x3d5b84(0x18c)+_0x3d5b84(0x12e)+_0x3d5b84(0xfb)+_0x3d5b84(0x112)+_0x3d5b84(0x1c0)+_0x3d5b84(0x1ea)+_0x3d5b84(0x1bc)),0x1;if(!_0x4f1de2[_0x3d5b84(0x17e)]&&!_0x4f1de2['attribute']&&!_0x4f1de2[_0x3d5b84(0x192)]&&!_0x4f1de2[_0x3d5b84(0x1c1)])return console[_0x3d5b84(0x19a)](a28_0x414911[_0x3d5b84(0x196)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x3d5b84(0x19a)](_0x3d5b84(0x100)),console[_0x3d5b84(0x19a)](_0x3d5b84(0x105)),console[_0x3d5b84(0x19a)](_0x3d5b84(0x172)),console['error'](_0x3d5b84(0xff)),console[_0x3d5b84(0x19a)](_0x3d5b84(0x17c)),console[_0x3d5b84(0x19a)](_0x3d5b84(0x181)),0x1;const _0x2a269e=resolveYamlFile(_0x364890);if(!existsSync(_0x2a269e))return showFileNotFoundError(_0x2a269e,_0x364890),0x1;_0x4f1de2[_0x3d5b84(0x19b)]&&(console['error'](_0x3d5b84(0x135)+_0x4f1de2[_0x3d5b84(0x15c)]),console[_0x3d5b84(0x19a)](_0x3d5b84(0x1c7)+_0x2a269e));let _0x2c3cf1;try{_0x2c3cf1=readFileSync(_0x2a269e,_0x3d5b84(0x191));}catch(_0x2df129){const _0xd5a419=_0x2df129 instanceof Error?_0x2df129['message']:String(_0x2df129);return console['error'](_0x3d5b84(0x20c)+_0xd5a419),0x1;}let _0x16f769;try{_0x16f769=parseYamlString(_0x2c3cf1);}catch(_0x3ad0c8){const _0x3e3681=_0x3ad0c8 instanceof Error?_0x3ad0c8['message']:String(_0x3ad0c8);return console['error'](a28_0x414911[_0x3d5b84(0x196)](_0x3d5b84(0x138)+_0x3e3681)),0x1;}if(_0x4f1de2['attribute']===!![]||_0x4f1de2[_0x3d5b84(0x15d)]===''){const _0x8c5351=_0x16f769[_0x3d5b84(0x1c2)]?.['map'](_0x57e130=>_0x57e130[_0x3d5b84(0x162)])||[];if(_0x8c5351[_0x3d5b84(0x1d0)]===0x0)console['error'](a28_0x414911['red'](_0x3d5b84(0x1af)));else{console['error'](a28_0x414911[_0x3d5b84(0x196)](_0x3d5b84(0x13c))),console[_0x3d5b84(0x19a)](_0x3d5b84(0x151));for(const _0x302afe of _0x8c5351){console[_0x3d5b84(0x19a)]('\x20\x20'+a28_0x414911[_0x3d5b84(0x137)](_0x302afe));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x364890+_0x3d5b84(0x126)+_0x8c5351[0x0]+'\x22');}return 0x1;}if(_0x4f1de2['behavior']===!![]||_0x4f1de2[_0x3d5b84(0x192)]===''){const _0x1ba6f0=_0x16f769['behaviors']?.['map'](_0x429d71=>_0x429d71['name'])||[];if(_0x1ba6f0[_0x3d5b84(0x1d0)]===0x0)console[_0x3d5b84(0x19a)](a28_0x414911[_0x3d5b84(0x196)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x3d5b84(0x19a)](a28_0x414911[_0x3d5b84(0x196)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error'](_0x3d5b84(0x17a));for(const _0x4f88a7 of _0x1ba6f0){console[_0x3d5b84(0x19a)]('\x20\x20'+a28_0x414911[_0x3d5b84(0x137)](_0x4f88a7));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x364890+'\x20--behavior\x20\x22'+_0x1ba6f0[0x0]+'\x22');}return 0x1;}const _0x474df5=createCommandSpinner(a28_0x414911['dim']('Fetching\x20sample\x20data...'),{'verbose':_0x4f1de2[_0x3d5b84(0x19b)]});_0x474df5['start']();const _0x1c9fd9={'onProgress':_0x4fc522=>{const _0x49b49b=_0x3d5b84;_0x474df5[_0x49b49b(0x15b)]=formatProgressMessage(_0x4fc522);}};if(_0x4f1de2[_0x3d5b84(0x17e)])_0x1c9fd9['master']=!![];if(_0x4f1de2[_0x3d5b84(0x15d)]&&typeof _0x4f1de2[_0x3d5b84(0x15d)]===_0x3d5b84(0xf7))_0x1c9fd9[_0x3d5b84(0x15d)]=_0x4f1de2[_0x3d5b84(0x15d)];if(_0x4f1de2[_0x3d5b84(0x192)]&&typeof _0x4f1de2[_0x3d5b84(0x192)]===_0x3d5b84(0xf7))_0x1c9fd9[_0x3d5b84(0x192)]=_0x4f1de2['behavior'];if(_0x4f1de2[_0x3d5b84(0x1c1)])_0x1c9fd9['enriched']=!![];if(_0x4f1de2[_0x3d5b84(0x1c3)])_0x1c9fd9[_0x3d5b84(0x1c3)]=_0x4f1de2[_0x3d5b84(0x1c3)];let _0x4540af;try{_0x4540af=await _0x333f40[_0x3d5b84(0xf9)][_0x3d5b84(0x1f9)](_0x2c3cf1,_0x1c9fd9),_0x474df5[_0x3d5b84(0x125)]();}catch(_0x1458ec){_0x474df5[_0x3d5b84(0x125)]();throw _0x1458ec;}return await this[_0x3d5b84(0x17f)](_0x4540af,{'master':_0x4f1de2['master'],'attribute':typeof _0x4f1de2['attribute']===_0x3d5b84(0xf7)?_0x4f1de2[_0x3d5b84(0x15d)]:undefined,'behavior':typeof _0x4f1de2['behavior']===_0x3d5b84(0xf7)?_0x4f1de2['behavior']:undefined,'enriched':_0x4f1de2[_0x3d5b84(0x1c1)]}),_0x4540af[_0x3d5b84(0x1a9)]?0x0:0x1;}async['displayPreviewResults'](_0x31b05e,_0x592c79){const _0x27787b=a28_0x13db83;console[_0x27787b(0x19a)]('\x0a'+a28_0x414911[_0x27787b(0x1e7)](_0x27787b(0x1fa))+'\x20'+_0x31b05e[_0x27787b(0x162)]),console['error']('═'[_0x27787b(0x18d)](0x3c));if(_0x592c79['master']&&_0x31b05e[_0x27787b(0x14d)]){const _0x5b9747=a28_0x414911[_0x27787b(0x159)](_0x27787b(0x13f))+'\x20'+a28_0x414911[_0x27787b(0x1e7)](_0x31b05e['master'][_0x27787b(0xf0)]+'.'+_0x31b05e['master'][_0x27787b(0x16e)]);await this[_0x27787b(0x120)](_0x5b9747,_0x31b05e['sampleData']);}else{if(_0x592c79['attribute']&&_0x31b05e[_0x27787b(0x14d)]){const _0x38ee86=a28_0x414911[_0x27787b(0x159)](_0x27787b(0x1e9))+'\x20'+a28_0x414911[_0x27787b(0x1e7)](_0x592c79['attribute']);await this[_0x27787b(0x120)](_0x38ee86,_0x31b05e[_0x27787b(0x14d)]);}else{if(_0x592c79[_0x27787b(0x192)]&&_0x31b05e[_0x27787b(0x14d)]){const _0x246519=a28_0x414911['dim'](_0x27787b(0x1aa))+'\x20'+a28_0x414911[_0x27787b(0x1e7)](_0x592c79[_0x27787b(0x192)]);await this[_0x27787b(0x120)](_0x246519,_0x31b05e[_0x27787b(0x14d)]);}else{if(_0x592c79[_0x27787b(0x1c1)]&&_0x31b05e[_0x27787b(0x14d)]){const _0x339a4f=a28_0x414911[_0x27787b(0x159)](_0x27787b(0x209))+'\x20'+a28_0x414911[_0x27787b(0x1e7)](_0x27787b(0x1a6));await this['displaySampleData'](_0x339a4f,_0x31b05e[_0x27787b(0x14d)]);}else!_0x31b05e[_0x27787b(0x14d)]&&console[_0x27787b(0x19a)](_0x27787b(0x180));}}}if(_0x31b05e[_0x27787b(0x1b7)][_0x27787b(0x1d0)]>0x0){console[_0x27787b(0x19a)]('─'[_0x27787b(0x18d)](0x3c)),console['error']('\x0a'+a28_0x414911[_0x27787b(0x196)]('Errors:'));for(const _0x5d51f3 of _0x31b05e[_0x27787b(0x1b7)]){console[_0x27787b(0x19a)]('\x20\x20'+a28_0x414911[_0x27787b(0x196)]('•')+'\x20'+_0x5d51f3);}}}async['displaySampleData'](_0x5278a1,_0x209fd9){const _0x172e1d=a28_0x13db83;if(_0x209fd9[_0x172e1d(0x1d0)]===0x0){console['error']('\x0a'+_0x5278a1),console[_0x172e1d(0x19a)](_0x172e1d(0x1b5));return;}console[_0x172e1d(0x19a)]('\x0a'+_0x5278a1);const _0x1a2f7d=Object[_0x172e1d(0xee)](_0x209fd9[0x0])[_0x172e1d(0xfd)](_0x3a62a1=>({'name':_0x3a62a1,'type':typeof _0x209fd9[0x0][_0x3a62a1]===_0x172e1d(0x1f4)?_0x172e1d(0x1db):_0x172e1d(0xe8)})),_0x1f3385={'queryId':'preview','columns':_0x1a2f7d,'data':_0x209fd9,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x209fd9['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x443eb3=formatAsTable(_0x1f3385,_0x209fd9[_0x172e1d(0x1d0)],!![]);await writeOutput(_0x443eb3,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a28_0x13db83(0x1c4);[a28_0x13db83(0x204)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async['execute'](_0x304b4a){const _0x49d988=a28_0x13db83,{options:_0x506bdc,args:_0x529d78,tdx:_0x1112a1}=_0x304b4a,_0x48352c=_0x506bdc,_0x1e4821=_0x529d78[0x0]||_0x506bdc['parentSegment'];if(!_0x1e4821)return showParentSegmentNotSetError(_0x49d988(0x198)+_0x49d988(0x106)),0x1;const _0x2c5da6=resolveYamlFile(_0x1e4821);if(existsSync(_0x2c5da6)){_0x48352c[_0x49d988(0x19b)]&&console[_0x49d988(0x19a)](_0x49d988(0x1e1)+_0x2c5da6);let _0x47ba7b;try{_0x47ba7b=readFileSync(_0x2c5da6,_0x49d988(0x191));}catch(_0x26d85d){const _0xd4e850=_0x26d85d instanceof Error?_0x26d85d[_0x49d988(0x182)]:String(_0x26d85d);return console[_0x49d988(0x19a)](_0x49d988(0x20c)+_0xd4e850),0x1;}const _0x1bbddf=await withSpinner(_0x49d988(0x173),()=>_0x1112a1[_0x49d988(0xf9)]['pushParentYaml'](_0x47ba7b),{'verbose':_0x48352c['verbose']}),_0x53ff2d=_0x1bbddf[_0x49d988(0x19f)],{isNew:_0x943002,name:_0xa86a4,hasChanges:_0x2f084f,diffFormatted:_0x52eadb}=_0x53ff2d;if(_0x2f084f){_0x943002?console[_0x49d988(0x19a)](_0x49d988(0x197)+_0xa86a4+'\x27:'):console[_0x49d988(0x19a)](_0x49d988(0xe7)+_0xa86a4+'\x27:');console['error']('─'[_0x49d988(0x18d)](0x3c)),console['error'](_0x52eadb),console['error']('─'['repeat'](0x3c));const _0xfc0ff7=_0x943002?_0x49d988(0x185)+_0xa86a4+_0x49d988(0x1d2):_0x49d988(0x10e)+_0xa86a4+_0x49d988(0x1d2);if(!_0x48352c[_0x49d988(0x128)]){const _0x126ccb=await confirmKey(_0xfc0ff7);if(!_0x126ccb)return console[_0x49d988(0x19a)]('Aborted.'),0x1;}const _0x1dbb58=_0x943002?_0x49d988(0x1d6):_0x49d988(0x1a1);await withSpinner(_0x1dbb58+_0x49d988(0x1ee)+_0xa86a4+'\x27...',()=>_0x53ff2d['apply'](),{'verbose':_0x48352c[_0x49d988(0x19b)]});const _0x22da84=_0x943002?_0x49d988(0x19e):_0x49d988(0x1fc);console[_0x49d988(0x19a)]('✔\x20'+_0x22da84+_0x49d988(0x1ee)+_0xa86a4+'\x27');}else console[_0x49d988(0x19a)](_0x49d988(0x1ce)+_0xa86a4+'\x27\x20is\x20up\x20to\x20date');}const _0x2bd563=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x1e4821+_0x49d988(0x190),()=>_0x1112a1[_0x49d988(0xf9)][_0x49d988(0x19c)](_0x1e4821),{'verbose':_0x48352c[_0x49d988(0x19b)]}),_0x347fbe=_0x2bd563[_0x49d988(0x19f)],_0x872e8f=getConsoleUrl(_0x48352c['site'],_0x49d988(0x20b)+_0x347fbe[_0x49d988(0x1b9)]+'/sessions/'+_0x347fbe['workflowSessionId']+_0x49d988(0x1f8)+_0x347fbe['workflowAttemptId']);return console[_0x49d988(0x19a)]('\x0a✔\x20Workflow\x20started'),console[_0x49d988(0x19a)]('\x20\x20'+a28_0x414911[_0x49d988(0x159)](_0x49d988(0x1df))+'\x20'+_0x347fbe[_0x49d988(0x164)]),console[_0x49d988(0x19a)]('\x20\x20'+a28_0x414911[_0x49d988(0x159)](_0x49d988(0x13a))+'\x20'+_0x347fbe['status']),console[_0x49d988(0x19a)]('\x20\x20'+a28_0x414911[_0x49d988(0x159)]('Session:')+'\x20'+_0x347fbe[_0x49d988(0xe5)]),console[_0x49d988(0x19a)]('\x20\x20'+a28_0x414911['dim'](_0x49d988(0x1ed))+'\x20'+_0x347fbe[_0x49d988(0x12c)]),console[_0x49d988(0x19a)]('\x20\x20'+_0x872e8f),console[_0x49d988(0x19a)]('\x0a'+a28_0x414911[_0x49d988(0x159)]('To\x20cancel:')+_0x49d988(0x122)+_0x347fbe['workflowAttemptId']+_0x49d988(0x1c5)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x147);[a28_0x13db83(0x204)]=a28_0x13db83(0x1e4);async[a28_0x13db83(0x207)](_0x165021){const _0x1f6e79=a28_0x13db83,{options:_0x17c649,args:_0x13eaf,tdx:_0x14a8a2}=_0x165021,_0x325c0e=_0x13eaf[0x0]||_0x17c649[_0x1f6e79(0xf2)];if(!_0x325c0e)return showParentSegmentNotSetError(_0x1f6e79(0x194)+_0x1f6e79(0x10f)),0x1;_0x17c649[_0x1f6e79(0x19b)]&&(console[_0x1f6e79(0x19a)](_0x1f6e79(0x135)+_0x17c649[_0x1f6e79(0x15c)]),console[_0x1f6e79(0x19a)](_0x1f6e79(0x1bd)+_0x325c0e));const _0x17e59b=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x325c0e+'\x27...',()=>_0x14a8a2[_0x1f6e79(0xf9)]['listFields'](_0x325c0e),{'verbose':_0x17c649['verbose']}),_0x1ab61f=_0x17e59b[_0x1f6e79(0x19f)];console[_0x1f6e79(0x19a)](_0x1f6e79(0x1f7)+_0x1ab61f['length']+_0x1f6e79(0xf1)+(_0x1ab61f[_0x1f6e79(0x1d0)]!==0x1?'s':''));if(_0x17c649[_0x1f6e79(0x206)]||_0x17c649[_0x1f6e79(0x1e8)])return await handleSDKOutput(_0x1ab61f,_0x17c649),0x0;return displayFieldsHumanReadable(_0x1ab61f,_0x325c0e),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x154);['description']=a28_0x13db83(0x1bb);async[a28_0x13db83(0x207)](_0x3e6bfc){const _0x3e4587=a28_0x13db83,{options:_0x22fe7e,args:_0x4ce655,tdx:_0x1860fd}=_0x3e6bfc,_0x3340e6=_0x22fe7e,_0xa231be=_0x4ce655[0x0]||_0x22fe7e[_0x3e4587(0xf2)];if(!_0xa231be)return showParentSegmentNotSetError(_0x3e4587(0xec)+_0x3e4587(0x12f)+'Options:\x0a'+_0x3e4587(0x13b)),0x1;_0x22fe7e[_0x3e4587(0x19b)]&&(console[_0x3e4587(0x19a)](_0x3e4587(0x135)+_0x22fe7e['site']),console['error'](_0x3e4587(0x1bd)+_0xa231be));const _0x646d58=await withSpinner(_0x3e4587(0x199)+_0xa231be+_0x3e4587(0x190),()=>_0x1860fd[_0x3e4587(0xf9)]['getParentFull'](_0xa231be),{'verbose':_0x22fe7e[_0x3e4587(0x19b)]}),_0x2bfc3=_0x646d58[_0x3e4587(0x19f)];if(_0x3340e6[_0x3e4587(0x107)]){const _0x210217=getConsoleNextUrl(_0x3340e6[_0x3e4587(0x15c)],_0x3e4587(0x108)+_0x2bfc3['id']);return console[_0x3e4587(0x19a)](a28_0x414911[_0x3e4587(0x113)]('✔')+_0x3e4587(0x149)+a28_0x414911['cyan'](_0x210217)),openBrowser(_0x210217),0x0;}return await handleSingleObjectOutput(_0x2bfc3,_0x22fe7e),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a28_0x13db83(0x175);['description']=a28_0x13db83(0x1fe);async[a28_0x13db83(0x207)](_0xef393e){const _0x326647=a28_0x13db83,{options:_0x2be302,args:_0x47c9a8,tdx:_0xedcb7}=_0xef393e,_0x36e029=_0x47c9a8[0x0]||_0x2be302['parentSegment'];if(!_0x36e029)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a'+_0x326647(0x161)),0x1;_0x2be302[_0x326647(0x19b)]&&(console[_0x326647(0x19a)](_0x326647(0x135)+_0x2be302[_0x326647(0x15c)]),console[_0x326647(0x19a)](_0x326647(0x1bd)+_0x36e029));const _0x4f3476=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x36e029+_0x326647(0x190),()=>_0xedcb7[_0x326647(0xf9)][_0x326647(0x10d)](_0x36e029),{'verbose':_0x2be302[_0x326647(0x19b)]}),_0x361ffc=_0x4f3476['data'],_0x2493fb=await withSpinner(_0x326647(0x11d)+_0x36e029+_0x326647(0x190),()=>_0xedcb7[_0x326647(0xf9)][_0x326647(0x148)](_0x361ffc),{'verbose':_0x2be302['verbose']}),_0x4c4fd7=await executeSchemaQuery(_0x2493fb[_0x326647(0x19f)],_0xedcb7,_0x2be302);return await handleQueryOutput(_0x4c4fd7,_0x2be302),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a28_0x13db83(0x162)]=a28_0x13db83(0x1da);[a28_0x13db83(0x204)]=a28_0x13db83(0x14f);async[a28_0x13db83(0x207)](_0x307296){const _0x27e934=a28_0x13db83,{options:_0x2b2f9f,args:_0x27b006,tdx:_0x2c5214}=_0x307296,_0x2e78e0=_0x27b006[0x0]||_0x2b2f9f[_0x27e934(0xf2)];if(!_0x2e78e0)return showParentSegmentNotSetError(_0x27e934(0x1d9)+_0x27e934(0x1cd)),0x1;_0x2b2f9f[_0x27e934(0x19b)]&&(console['error'](_0x27e934(0x135)+_0x2b2f9f[_0x27e934(0x15c)]),console['error']('Parent\x20segment:\x20'+_0x2e78e0));const _0x4fb766=await withSpinner(_0x27e934(0x1b4)+_0x2e78e0+'\x27...',()=>_0x2c5214['segment'][_0x27e934(0x10d)](_0x2e78e0),{'verbose':_0x2b2f9f[_0x27e934(0x19b)]}),_0x431498=_0x4fb766[_0x27e934(0x19f)],_0x165bea=await withSpinner(_0x27e934(0x11d)+_0x2e78e0+_0x27e934(0x190),()=>_0x2c5214['segment'][_0x27e934(0x148)](_0x431498),{'verbose':_0x2b2f9f[_0x27e934(0x19b)]}),_0x3c6940=_0x165bea[_0x27e934(0x19f)];return _0x2b2f9f[_0x27e934(0x208)]==='json'||_0x2b2f9f[_0x27e934(0x208)]===_0x27e934(0x1e8)?await handleSDKOutput([{'sql':_0x3c6940}],_0x2b2f9f):console[_0x27e934(0x188)](_0x3c6940),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']='segment:parent:show';[a28_0x13db83(0x204)]=a28_0x13db83(0xed);async[a28_0x13db83(0x207)](_0x4dd052){const _0x1fa4c0=a28_0x13db83,{options:_0x3ac7f5,args:_0x195e50,tdx:_0x16fcea}=_0x4dd052,_0x13317b=_0x195e50[0x0]||_0x3ac7f5[_0x1fa4c0(0xf2)];if(!_0x13317b)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'+_0x1fa4c0(0x121)),0x1;_0x3ac7f5[_0x1fa4c0(0x19b)]&&(console[_0x1fa4c0(0x19a)](_0x1fa4c0(0x135)+_0x3ac7f5[_0x1fa4c0(0x15c)]),console[_0x1fa4c0(0x19a)]('Parent\x20segment:\x20'+_0x13317b));const _0x183419=await withSpinner(_0x1fa4c0(0x1b4)+_0x13317b+_0x1fa4c0(0x190),()=>_0x16fcea[_0x1fa4c0(0xf9)][_0x1fa4c0(0x10d)](_0x13317b),{'verbose':_0x3ac7f5[_0x1fa4c0(0x19b)]}),_0x19fd75=_0x183419['data'],_0x1231cb=await withSpinner(_0x1fa4c0(0x11d)+_0x13317b+'\x27...',()=>_0x16fcea[_0x1fa4c0(0xf9)]['getParentSQL'](_0x19fd75),{'verbose':_0x3ac7f5[_0x1fa4c0(0x19b)]});let _0x363d82=_0x1231cb[_0x1fa4c0(0x19f)];const _0x1ac437=resolveLimit(_0x3ac7f5[_0x1fa4c0(0x18b)],DEFAULT_DISPLAY_LIMIT),_0x28f5ce=/\bLIMIT\s+\d+/i[_0x1fa4c0(0x1ca)](_0x363d82);!_0x28f5ce&&(_0x363d82=_0x363d82[_0x1fa4c0(0x1ec)]()[_0x1fa4c0(0x101)](/;+$/,''),_0x363d82=_0x1fa4c0(0x117)+_0x363d82+_0x1fa4c0(0xe4)+_0x1ac437);_0x3ac7f5['verbose']&&console[_0x1fa4c0(0x19a)](_0x1fa4c0(0xf4)+_0x363d82);const _0x5e1b34=await withQuerySpinner(_0x1fa4c0(0x1ff),async _0x12cdb1=>{const _0x2acb23=_0x1fa4c0,_0x5355f2=await _0x16fcea['query']['execute'](_0x363d82,{'catalog':'td','schema':_0x2acb23(0x11a),'onJobId':_0x1fb913=>{const _0x16352e=_0x2acb23;_0x12cdb1[_0x16352e(0x109)](_0x1fb913);}});return _0x5355f2;},{'verbose':_0x3ac7f5[_0x1fa4c0(0x19b)]}),_0x18fd4d=_0x5e1b34['data'],_0xb94925=_0x18fd4d['jobId']?_0x1fa4c0(0x150)+_0x18fd4d[_0x1fa4c0(0x11c)]+']':'';return console['error'](_0x1fa4c0(0xe6)+_0x18fd4d['stats'][_0x1fa4c0(0x1de)][_0x1fa4c0(0x1d4)]()+'\x20rows\x20'+(_0x1fa4c0(0x168)+formatElapsed(_0x18fd4d[_0x1fa4c0(0x1b2)][_0x1fa4c0(0x14b)])+_0xb94925)),await handleQueryOutput(_0x18fd4d,_0x3ac7f5),0x0;}}
@@ -1 +1 @@
1
- const a29_0x47310a=a29_0x310b;(function(_0x53ac54,_0x5d308a){const _0x8a6c7d=a29_0x310b,_0x2f07f7=_0x53ac54();while(!![]){try{const _0x3254dc=-parseInt(_0x8a6c7d(0x1fb))/0x1*(-parseInt(_0x8a6c7d(0x1ed))/0x2)+parseInt(_0x8a6c7d(0x1f0))/0x3*(-parseInt(_0x8a6c7d(0x1fd))/0x4)+parseInt(_0x8a6c7d(0x1e9))/0x5+-parseInt(_0x8a6c7d(0x1e7))/0x6*(parseInt(_0x8a6c7d(0x1e5))/0x7)+parseInt(_0x8a6c7d(0x1ee))/0x8+-parseInt(_0x8a6c7d(0x1e4))/0x9*(parseInt(_0x8a6c7d(0x1f5))/0xa)+-parseInt(_0x8a6c7d(0x1f2))/0xb*(parseInt(_0x8a6c7d(0x1f8))/0xc);if(_0x3254dc===_0x5d308a)break;else _0x2f07f7['push'](_0x2f07f7['shift']());}catch(_0x404027){_0x2f07f7['push'](_0x2f07f7['shift']());}}}(a29_0x282c,0x7d420));function a29_0x282c(){const _0x4a57ac=['1kIJXUP','error','2906156ejvGLz','profiles','755127XzURdk','14YbBdCr','config','694104QACBuz','log','2096335OlMztr','length','\x20\x20Global:\x20~/.config/tdx/tdx.json','description','2030998WfCyZw','5083712GTPiaY','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','3JzgyuZ','execute','11gDKnvj','map','name','30skeaGh','message','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','4170696murYXM','scope','Error:\x20'];a29_0x282c=function(){return _0x4a57ac;};return a29_0x282c();}function a29_0x310b(_0x5d7d13,_0x3bcbc5){_0x5d7d13=_0x5d7d13-0x1e3;const _0x282cfc=a29_0x282c();let _0x310b92=_0x282cfc[_0x5d7d13];return _0x310b92;}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{['name']=a29_0x47310a(0x1e3);['description']='List\x20all\x20available\x20profiles';async[a29_0x47310a(0x1f1)](_0x403674){const _0x3e8adf=a29_0x47310a,{options:_0x33038b}=_0x403674;try{const _0x4f0102=listProfiles(),_0x24deaf=getActiveProfile();if(_0x4f0102[_0x3e8adf(0x1ea)]===0x0)return console[_0x3e8adf(0x1e8)](_0x3e8adf(0x1ef)),console['log'](_0x3e8adf(0x1f7)),console['log'](_0x3e8adf(0x1eb)),0x0;const _0x2990bd=_0x4f0102[_0x3e8adf(0x1f3)](_0x13ce1e=>{const _0x4b91b9=_0x3e8adf,_0x3d8f97=_0x13ce1e[_0x4b91b9(0x1f4)]===_0x24deaf,_0x3f351d=getProfileParams(_0x13ce1e[_0x4b91b9(0x1e6)]);return{'name':_0x13ce1e[_0x4b91b9(0x1f4)],'active':_0x3d8f97,'scope':_0x13ce1e[_0x4b91b9(0x1f9)],'description':_0x13ce1e[_0x4b91b9(0x1e6)][_0x4b91b9(0x1ec)]||'','params':_0x3f351d};});return await handleSDKOutput(_0x2990bd,_0x33038b),0x0;}catch(_0x309fbc){return _0x309fbc instanceof Error&&console[_0x3e8adf(0x1fc)](_0x3e8adf(0x1fa)+_0x309fbc[_0x3e8adf(0x1f6)]),0x1;}}}
1
+ const a29_0x21d364=a29_0xcde7;function a29_0xcde7(_0x5e2da6,_0x328fd0){_0x5e2da6=_0x5e2da6-0x1b9;const _0xee5dee=a29_0xee5d();let _0xcde70e=_0xee5dee[_0x5e2da6];return _0xcde70e;}(function(_0x570aad,_0x152d7c){const _0x3e850f=a29_0xcde7,_0x5dcfe8=_0x570aad();while(!![]){try{const _0x127b8c=-parseInt(_0x3e850f(0x1ca))/0x1+-parseInt(_0x3e850f(0x1ba))/0x2+parseInt(_0x3e850f(0x1c4))/0x3*(-parseInt(_0x3e850f(0x1cc))/0x4)+parseInt(_0x3e850f(0x1c1))/0x5*(-parseInt(_0x3e850f(0x1ce))/0x6)+parseInt(_0x3e850f(0x1c0))/0x7+-parseInt(_0x3e850f(0x1c5))/0x8*(-parseInt(_0x3e850f(0x1c7))/0x9)+parseInt(_0x3e850f(0x1bb))/0xa;if(_0x127b8c===_0x152d7c)break;else _0x5dcfe8['push'](_0x5dcfe8['shift']());}catch(_0x1ff703){_0x5dcfe8['push'](_0x5dcfe8['shift']());}}}(a29_0xee5d,0xa0251));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a29_0xee5d(){const _0x2ce4f3=['13272JbgAXC','config','5751aLsQgV','log','\x20\x20Global:\x20~/.config/tdx/tdx.json','906231sfwMlD','List\x20all\x20available\x20profiles','1648044IQarHg','name','1011864sRrJdE','map','description','322424rDGurG','12993710VulgHf','scope','profiles','error','execute','4334085bqEhMF','25jvqVyU','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','Error:\x20','3WdIHEI'];a29_0xee5d=function(){return _0x2ce4f3;};return a29_0xee5d();}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a29_0x21d364(0x1cd)]=a29_0x21d364(0x1bd);['description']=a29_0x21d364(0x1cb);async[a29_0x21d364(0x1bf)](_0x5cb119){const _0x505b0d=a29_0x21d364,{options:_0x4396ec}=_0x5cb119;try{const _0x323bc1=listProfiles(),_0x5b91de=getActiveProfile();if(_0x323bc1['length']===0x0)return console[_0x505b0d(0x1c8)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console['log'](_0x505b0d(0x1c2)),console[_0x505b0d(0x1c8)](_0x505b0d(0x1c9)),0x0;const _0x28fa5f=_0x323bc1[_0x505b0d(0x1cf)](_0x15a4c5=>{const _0x1e6cbb=_0x505b0d,_0xc6618f=_0x15a4c5[_0x1e6cbb(0x1cd)]===_0x5b91de,_0x1e291a=getProfileParams(_0x15a4c5['config']);return{'name':_0x15a4c5[_0x1e6cbb(0x1cd)],'active':_0xc6618f,'scope':_0x15a4c5[_0x1e6cbb(0x1bc)],'description':_0x15a4c5[_0x1e6cbb(0x1c6)][_0x1e6cbb(0x1b9)]||'','params':_0x1e291a};});return await handleSDKOutput(_0x28fa5f,_0x4396ec),0x0;}catch(_0x1e2a78){return _0x1e2a78 instanceof Error&&console[_0x505b0d(0x1be)](_0x505b0d(0x1c3)+_0x1e2a78['message']),0x1;}}}
@@ -1 +1 @@
1
- function a30_0x2734(_0xf5f708,_0x6d3255){_0xf5f708=_0xf5f708-0x1bc;const _0x5bf942=a30_0x5bf9();let _0x2734fa=_0x5bf942[_0xf5f708];return _0x2734fa;}const a30_0xf57f76=a30_0x2734;(function(_0x340a83,_0x11a569){const _0x2bb98d=a30_0x2734,_0x4a7485=_0x340a83();while(!![]){try{const _0x2d60be=-parseInt(_0x2bb98d(0x1e4))/0x1*(-parseInt(_0x2bb98d(0x1c2))/0x2)+parseInt(_0x2bb98d(0x1dc))/0x3*(-parseInt(_0x2bb98d(0x1d8))/0x4)+parseInt(_0x2bb98d(0x1be))/0x5*(-parseInt(_0x2bb98d(0x1bc))/0x6)+-parseInt(_0x2bb98d(0x1e1))/0x7*(parseInt(_0x2bb98d(0x1f1))/0x8)+-parseInt(_0x2bb98d(0x1d1))/0x9*(parseInt(_0x2bb98d(0x1e7))/0xa)+-parseInt(_0x2bb98d(0x1ed))/0xb+parseInt(_0x2bb98d(0x1c8))/0xc;if(_0x2d60be===_0x11a569)break;else _0x4a7485['push'](_0x4a7485['shift']());}catch(_0x4155d1){_0x4a7485['push'](_0x4a7485['shift']());}}}(a30_0x5bf9,0x2b4b9));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a30_0x5bf9(){const _0x2ed428=['execute','verbose','99lSydSN','Schema:\x20','\x20[Job\x20ID:\x20','push','\x20rows\x20','error','No\x20SQL\x20provided','4HQwxXW','validate','site','completedSplits','469401ZikfCP','stats','\x0aAll\x20results\x20saved\x20to\x20','processedRows','originalMessage','91XPByIT','SQL:\x20','join','11pziArL','database','Run\x20Trino\x20queries\x20(streaming)','128560IdRkHD','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','in\x20','elapsedTimeMillis','state','Executing\x20query\x20[','1726857zAZjHl','data','setJobId','query','16120UxcYul','Executing\x20query...','length','26496NqjRIP','\x20-\x20','255xddLxK','catalog','Statement\x20','message','62216dHxHzC','setPhase','totalSplits','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','jobId','options','6497160wvPNVT','file','information_schema','output','Executing\x20statement\x20','Site:\x20','Query\x20completed:\x20Processed\x20'];a30_0x5bf9=function(){return _0x2ed428;};return a30_0x5bf9();}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{['name']=a30_0xf57f76(0x1f0);['description']=a30_0xf57f76(0x1e6);async[a30_0xf57f76(0x1cf)](_0x442bf8){const _0x469190=a30_0xf57f76,{options:_0x5944e0,args:_0x1a5afe,tdx:_0x50b8f7}=_0x442bf8,_0x2426c5=_0x1a5afe[0x0],_0x4a1155=_0x5944e0['file'];let _0x246b05;try{if(_0x4a1155)_0x246b05=readSqlStatementsFromFile(_0x4a1155);else{if(_0x2426c5==='-')_0x246b05=await readSqlStatementsFromStdin();else{if(_0x2426c5&&isSqlFilePath(_0x2426c5))_0x246b05=readSqlStatementsFromFile(_0x2426c5);else{if(_0x2426c5)_0x246b05=splitSqlStatements(_0x2426c5);else throw new Error(_0x469190(0x1d7));}}}}catch(_0x4af56b){return console[_0x469190(0x1d6)]('Error:\x20'+_0x4af56b[_0x469190(0x1c1)]),0x1;}const _0x58188a=_0x5944e0[_0x469190(0x1e5)]||_0x469190(0x1ca),_0x5e6d17=_0x5944e0[_0x469190(0x1bf)];try{const _0x241354=[],_0x4b3b7a=!!_0x5944e0[_0x469190(0x1cb)];for(let _0x52a967=0x0;_0x52a967<_0x246b05[_0x469190(0x1f3)];_0x52a967++){const _0x472264=_0x246b05[_0x52a967],_0x20c41f=_0x52a967+0x1,_0x413602=_0x246b05[_0x469190(0x1f3)],_0x2ff95a=_0x413602>0x1;_0x5944e0[_0x469190(0x1d0)]&&(console[_0x469190(0x1d6)]('\x0a'+(_0x2ff95a?_0x469190(0x1c0)+_0x20c41f+'/'+_0x413602+':':'')),console[_0x469190(0x1d6)](_0x469190(0x1cd)+_0x5944e0[_0x469190(0x1da)]),console[_0x469190(0x1d6)]('Catalog:\x20'+(_0x5e6d17||'td')),console['error'](_0x469190(0x1d2)+_0x58188a),console['error'](_0x469190(0x1e2)+_0x472264));const _0x558d65=_0x2ff95a?_0x469190(0x1cc)+_0x20c41f+'/'+_0x413602+'...':_0x469190(0x1f2);try{const _0x1af471=await withQuerySpinner(_0x558d65,async _0x13d96e=>{const _0xed5656=_0x469190,_0x4e064c=await _0x50b8f7[_0xed5656(0x1f0)]['execute'](_0x472264,{'catalog':_0x5e6d17,'schema':_0x58188a,'onJobId':_0xf0e8d2=>{const _0x50969c=_0xed5656;_0x13d96e[_0x50969c(0x1ef)](_0xf0e8d2);},'onProgress':_0x14f113=>{const _0x483df1=_0xed5656;_0x13d96e[_0x483df1(0x1c3)](_0x483df1(0x1ec)+_0x14f113[_0x483df1(0x1eb)]+']'),_0x13d96e['setExtra'](formatRows(_0x14f113['processedRows'])+_0x483df1(0x1d5)+_0x14f113[_0x483df1(0x1db)]+'/'+_0x14f113[_0x483df1(0x1c4)]+'\x20splits');}});return _0x4e064c;},{'verbose':_0x5944e0[_0x469190(0x1d0)]}),_0x44f180=_0x1af471[_0x469190(0x1ee)],_0x58bdcf=_0x44f180[_0x469190(0x1c6)]?_0x469190(0x1d3)+_0x44f180[_0x469190(0x1c6)]+']':'',_0x34d5e9=_0x2ff95a?_0x469190(0x1c0)+_0x20c41f+'/'+_0x413602+_0x469190(0x1bd):'';console[_0x469190(0x1d6)]('✔\x20'+_0x34d5e9+_0x469190(0x1ce)+formatRows(_0x44f180[_0x469190(0x1dd)][_0x469190(0x1df)])+_0x469190(0x1d5)+(_0x469190(0x1e9)+formatElapsed(_0x44f180[_0x469190(0x1dd)][_0x469190(0x1ea)])+_0x58bdcf));if(_0x2ff95a&&_0x4b3b7a){const _0x214036=resolveOutputOptions(_0x5944e0),_0x40907d=await formatQueryOutput(_0x44f180,_0x214036);_0x241354[_0x469190(0x1d4)](_0x40907d);}else await handleQueryOutput(_0x44f180,_0x5944e0);}catch(_0x54edc8){const _0x2d18ca=_0x2ff95a?'Statement\x20'+_0x20c41f+'/'+_0x413602+':\x0a':'',_0x220637=_0x54edc8 instanceof SDKError?_0x54edc8[_0x469190(0x1e0)]:_0x54edc8['message'];return console['error'](''+_0x2d18ca+_0x220637),0x1;}}if(_0x246b05[_0x469190(0x1f3)]>0x1&&_0x4b3b7a&&_0x241354[_0x469190(0x1f3)]>0x0){const _0xd2df7=_0x241354[_0x469190(0x1e3)]('\x0a');writeFileSync(_0x5944e0['output'],_0xd2df7),console[_0x469190(0x1d6)](_0x469190(0x1de)+_0x5944e0[_0x469190(0x1cb)]);}return 0x0;}catch(_0x2bed7b){throw _0x2bed7b;}}[a30_0xf57f76(0x1d9)](_0x1b044f){const _0x286d3b=a30_0xf57f76,_0x5a755e=_0x1b044f['args'][0x0],_0x357454=_0x1b044f[_0x286d3b(0x1c7)][_0x286d3b(0x1c9)];if(!_0x5a755e&&!_0x357454)return _0x286d3b(0x1c5);if(_0x5a755e&&_0x357454)return _0x286d3b(0x1e8);return undefined;}}
1
+ const a30_0x49c07b=a30_0x3c09;(function(_0x122941,_0x22322b){const _0x21b3d7=a30_0x3c09,_0x21c5e5=_0x122941();while(!![]){try{const _0x2ad9a6=-parseInt(_0x21b3d7(0xf6))/0x1+-parseInt(_0x21b3d7(0xd3))/0x2+-parseInt(_0x21b3d7(0xdf))/0x3+parseInt(_0x21b3d7(0xef))/0x4+-parseInt(_0x21b3d7(0xed))/0x5+-parseInt(_0x21b3d7(0xee))/0x6+parseInt(_0x21b3d7(0xd4))/0x7*(parseInt(_0x21b3d7(0xd0))/0x8);if(_0x2ad9a6===_0x22322b)break;else _0x21c5e5['push'](_0x21c5e5['shift']());}catch(_0x59af78){_0x21c5e5['push'](_0x21c5e5['shift']());}}}(a30_0x2816,0xc7409));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';function a30_0x3c09(_0x3d2a83,_0x4a3dfc){_0x3d2a83=_0x3d2a83-0xcc;const _0x281684=a30_0x2816();let _0x3c09b5=_0x281684[_0x3d2a83];return _0x3c09b5;}import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a30_0x2816(){const _0x941956=['length','...','2364909dYsRDk','join','options','query','description','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','error','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','originalMessage','totalSplits','message','Statement\x20','Executing\x20query\x20[','Query\x20completed:\x20Processed\x20','4255775HptCok','8922864hpvCTk','4382968VPoQPN','database','stats','output','data','verbose','jobId','663784VvcWXQ','args','\x20splits','site','information_schema','Executing\x20statement\x20','completedSplits','name','file','Error:\x20','\x20-\x20','2930336apvxkx','state','elapsedTimeMillis','2502030IbPKSb','91wEVPcR','setExtra','processedRows','SQL:\x20','Run\x20Trino\x20queries\x20(streaming)','Site:\x20','\x20rows\x20','execute','push'];a30_0x2816=function(){return _0x941956;};return a30_0x2816();}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a30_0x49c07b(0xcc)]='query';[a30_0x49c07b(0xe3)]=a30_0x49c07b(0xd8);async[a30_0x49c07b(0xdb)](_0x2c9804){const _0x197002=a30_0x49c07b,{options:_0x3e8676,args:_0x1b6bc5,tdx:_0x43d3ed}=_0x2c9804,_0xbb225f=_0x1b6bc5[0x0],_0x23d15b=_0x3e8676[_0x197002(0xcd)];let _0x439e80;try{if(_0x23d15b)_0x439e80=readSqlStatementsFromFile(_0x23d15b);else{if(_0xbb225f==='-')_0x439e80=await readSqlStatementsFromStdin();else{if(_0xbb225f&&isSqlFilePath(_0xbb225f))_0x439e80=readSqlStatementsFromFile(_0xbb225f);else{if(_0xbb225f)_0x439e80=splitSqlStatements(_0xbb225f);else throw new Error('No\x20SQL\x20provided');}}}}catch(_0x40a76d){return console[_0x197002(0xe5)](_0x197002(0xce)+_0x40a76d[_0x197002(0xe9)]),0x1;}const _0x5718b9=_0x3e8676[_0x197002(0xf0)]||_0x197002(0xfa),_0x516781=_0x3e8676['catalog'];try{const _0x50be71=[],_0x41c2e8=!!_0x3e8676[_0x197002(0xf2)];for(let _0x53fad8=0x0;_0x53fad8<_0x439e80[_0x197002(0xdd)];_0x53fad8++){const _0x2d3cef=_0x439e80[_0x53fad8],_0x1f3de8=_0x53fad8+0x1,_0x455a0f=_0x439e80['length'],_0x43c981=_0x455a0f>0x1;_0x3e8676[_0x197002(0xf4)]&&(console[_0x197002(0xe5)]('\x0a'+(_0x43c981?_0x197002(0xea)+_0x1f3de8+'/'+_0x455a0f+':':'')),console[_0x197002(0xe5)](_0x197002(0xd9)+_0x3e8676[_0x197002(0xf9)]),console[_0x197002(0xe5)]('Catalog:\x20'+(_0x516781||'td')),console[_0x197002(0xe5)]('Schema:\x20'+_0x5718b9),console[_0x197002(0xe5)](_0x197002(0xd7)+_0x2d3cef));const _0x292087=_0x43c981?_0x197002(0xfb)+_0x1f3de8+'/'+_0x455a0f+_0x197002(0xde):'Executing\x20query...';try{const _0x2bb458=await withQuerySpinner(_0x292087,async _0x382d2b=>{const _0x4d4f6a=_0x197002,_0x148bc3=await _0x43d3ed[_0x4d4f6a(0xe2)][_0x4d4f6a(0xdb)](_0x2d3cef,{'catalog':_0x516781,'schema':_0x5718b9,'onJobId':_0x407ff9=>{_0x382d2b['setJobId'](_0x407ff9);},'onProgress':_0x5738be=>{const _0x53b65b=_0x4d4f6a;_0x382d2b['setPhase'](_0x53b65b(0xeb)+_0x5738be[_0x53b65b(0xd1)]+']'),_0x382d2b[_0x53b65b(0xd5)](formatRows(_0x5738be[_0x53b65b(0xd6)])+_0x53b65b(0xda)+_0x5738be[_0x53b65b(0xfc)]+'/'+_0x5738be[_0x53b65b(0xe8)]+_0x53b65b(0xf8));}});return _0x148bc3;},{'verbose':_0x3e8676[_0x197002(0xf4)]}),_0x5e33ed=_0x2bb458[_0x197002(0xf3)],_0xb8e5d5=_0x5e33ed[_0x197002(0xf5)]?'\x20[Job\x20ID:\x20'+_0x5e33ed[_0x197002(0xf5)]+']':'',_0x402a06=_0x43c981?_0x197002(0xea)+_0x1f3de8+'/'+_0x455a0f+_0x197002(0xcf):'';console[_0x197002(0xe5)]('✔\x20'+_0x402a06+_0x197002(0xec)+formatRows(_0x5e33ed['stats'][_0x197002(0xd6)])+_0x197002(0xda)+('in\x20'+formatElapsed(_0x5e33ed[_0x197002(0xf1)][_0x197002(0xd2)])+_0xb8e5d5));if(_0x43c981&&_0x41c2e8){const _0x81cc1b=resolveOutputOptions(_0x3e8676),_0x723c25=await formatQueryOutput(_0x5e33ed,_0x81cc1b);_0x50be71[_0x197002(0xdc)](_0x723c25);}else await handleQueryOutput(_0x5e33ed,_0x3e8676);}catch(_0x23ab58){const _0x2c444d=_0x43c981?'Statement\x20'+_0x1f3de8+'/'+_0x455a0f+':\x0a':'',_0x822949=_0x23ab58 instanceof SDKError?_0x23ab58[_0x197002(0xe7)]:_0x23ab58['message'];return console[_0x197002(0xe5)](''+_0x2c444d+_0x822949),0x1;}}if(_0x439e80[_0x197002(0xdd)]>0x1&&_0x41c2e8&&_0x50be71[_0x197002(0xdd)]>0x0){const _0x3fff1a=_0x50be71[_0x197002(0xe0)]('\x0a');writeFileSync(_0x3e8676[_0x197002(0xf2)],_0x3fff1a),console[_0x197002(0xe5)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x3e8676[_0x197002(0xf2)]);}return 0x0;}catch(_0x4bda2a){throw _0x4bda2a;}}['validate'](_0x579f09){const _0x105ebb=a30_0x49c07b,_0x190469=_0x579f09[_0x105ebb(0xf7)][0x0],_0x408a84=_0x579f09[_0x105ebb(0xe1)][_0x105ebb(0xcd)];if(!_0x190469&&!_0x408a84)return _0x105ebb(0xe4);if(_0x190469&&_0x408a84)return _0x105ebb(0xe6);return undefined;}}
@@ -1 +1 @@
1
- const a31_0x5cf2c2=a31_0x3fec;(function(_0x590e82,_0x30134d){const _0x19673e=a31_0x3fec,_0x2f6b8d=_0x590e82();while(!![]){try{const _0x4e7c0c=parseInt(_0x19673e(0xf3))/0x1*(-parseInt(_0x19673e(0x136))/0x2)+-parseInt(_0x19673e(0x102))/0x3+-parseInt(_0x19673e(0xf4))/0x4+parseInt(_0x19673e(0x140))/0x5*(-parseInt(_0x19673e(0xed))/0x6)+-parseInt(_0x19673e(0x129))/0x7+parseInt(_0x19673e(0x15d))/0x8+parseInt(_0x19673e(0x115))/0x9;if(_0x4e7c0c===_0x30134d)break;else _0x2f6b8d['push'](_0x2f6b8d['shift']());}catch(_0x3eef79){_0x2f6b8d['push'](_0x2f6b8d['shift']());}}}(a31_0x46b2,0xb702c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a31_0xb205ff from'chalk';function resolveSegmentTarget(_0x4b32d9,_0x4dbda7,_0x476ea1){const _0x3c6dbc=a31_0x3fec;if(isYamlFilePath(_0x4b32d9))try{const _0x2b0b61=resolveYamlFilePath(_0x4b32d9);return _0x476ea1&&(console[_0x3c6dbc(0x168)](_0x3c6dbc(0x104)+_0x4b32d9),console[_0x3c6dbc(0x168)](_0x3c6dbc(0x142)+_0x2b0b61['parentSegment']),console['error'](_0x3c6dbc(0x164)+_0x2b0b61[_0x3c6dbc(0x13b)]),console[_0x3c6dbc(0x168)]('\x20\x20Folder\x20path:\x20'+(_0x2b0b61[_0x3c6dbc(0x160)]||_0x3c6dbc(0x152))),console['error'](_0x3c6dbc(0x135)+_0x2b0b61[_0x3c6dbc(0x112)])),_0x2b0b61[_0x3c6dbc(0x112)];}catch(_0x4484e1){throw new SDKError(ErrorCode[_0x3c6dbc(0x17a)],_0x3c6dbc(0xee)+_0x4484e1['message']);}if(!_0x4dbda7)throw new SDKError(ErrorCode[_0x3c6dbc(0x17a)],_0x3c6dbc(0x131));return _0x4dbda7+'/'+_0x4b32d9;}function a31_0x3fec(_0x4503f7,_0x3e3215){_0x4503f7=_0x4503f7-0xe1;const _0x46b2cf=a31_0x46b2();let _0x3fecef=_0x46b2cf[_0x4503f7];return _0x3fecef;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]=a31_0x5cf2c2(0x101);[a31_0x5cf2c2(0x170)]=a31_0x5cf2c2(0x16c);async[a31_0x5cf2c2(0x174)](_0xb2630){const _0x6cefae=a31_0x5cf2c2,{options:_0x37957a,args:_0x4dcbb5,tdx:_0x36640d}=_0xb2630,_0x14b15b=_0x4dcbb5[0x0],_0x5e5936=!_0x14b15b&&!!_0x37957a[_0x6cefae(0x128)],_0x1bff6d=_0x14b15b||_0x37957a[_0x6cefae(0x128)];if(!_0x1bff6d)return console[_0x6cefae(0x168)](_0x6cefae(0xe5)),console['error'](_0x6cefae(0x127)),console[_0x6cefae(0x168)](_0x6cefae(0x132)),console[_0x6cefae(0x168)](_0x6cefae(0x100)),console['error'](_0x6cefae(0x11f)),console[_0x6cefae(0x168)](_0x6cefae(0x124)),console[_0x6cefae(0x168)](_0x6cefae(0x137)),0x1;try{const _0x9afd4f=_0x37957a[_0x6cefae(0xf9)];let _0x498947=_0x1bff6d;!_0x5e5936&&_0x9afd4f&&!_0x1bff6d['includes']('/')&&(_0x498947=_0x9afd4f+'/'+_0x1bff6d,_0x37957a['verbose']&&console[_0x6cefae(0x168)]('Resolved\x20relative\x20path\x20to:\x20'+_0x498947));const _0x2488ef=await withSpinner(_0x6cefae(0x10d)+_0x498947+_0x6cefae(0x14c),()=>_0x36640d[_0x6cefae(0xf2)][_0x6cefae(0xeb)](_0x498947),{'verbose':_0x37957a[_0x6cefae(0x153)]}),_0x103d00=_0x2488ef[_0x6cefae(0x10e)];_0x37957a[_0x6cefae(0x153)]&&(console[_0x6cefae(0x168)]('Resolved\x20type:\x20'+_0x103d00['type']),console[_0x6cefae(0x168)]('Parent\x20ID:\x20'+_0x103d00[_0x6cefae(0x15e)]),_0x103d00[_0x6cefae(0xe8)]&&console[_0x6cefae(0x168)](_0x6cefae(0x16a)+_0x103d00[_0x6cefae(0xe8)]),_0x103d00[_0x6cefae(0x114)]&&console[_0x6cefae(0x168)]('Segment\x20ID:\x20'+_0x103d00[_0x6cefae(0x114)]));if(_0x103d00[_0x6cefae(0x12e)]==='parent'){const _0x5d2e54=await withSpinner(_0x6cefae(0x10f),()=>_0x36640d[_0x6cefae(0xf2)][_0x6cefae(0x133)](_0x103d00[_0x6cefae(0x15e)]),{'verbose':_0x37957a['verbose']});await handleSingleObjectOutput(_0x5d2e54[_0x6cefae(0x10e)],_0x37957a);}else{if(_0x103d00[_0x6cefae(0x12e)]==='folder'){if(!_0x103d00['folderId'])throw new SDKError(ErrorCode[_0x6cefae(0xf8)],_0x6cefae(0x109));const _0x434221=await withSpinner(_0x6cefae(0xe3),()=>_0x36640d[_0x6cefae(0xf2)][_0x6cefae(0xe2)](_0x103d00['folderId']),{'verbose':_0x37957a[_0x6cefae(0x153)]});await handleSingleObjectOutput(_0x434221[_0x6cefae(0x10e)],_0x37957a);}else{if(_0x103d00['type']==='segment'){if(!_0x103d00[_0x6cefae(0x114)])throw new SDKError(ErrorCode[_0x6cefae(0x14d)],_0x6cefae(0x167));const _0x10e3d6=await withSpinner(_0x6cefae(0xec),()=>_0x36640d[_0x6cefae(0xf2)][_0x6cefae(0xea)](_0x103d00['parentId'],_0x103d00['segmentId']),{'verbose':_0x37957a['verbose']});await handleSingleObjectOutput(_0x10e3d6[_0x6cefae(0x10e)],_0x37957a);}}}return 0x0;}catch(_0x5f5287){if(_0x5f5287 instanceof SDKError)return console[_0x6cefae(0x168)](_0x6cefae(0x113)+_0x5f5287[_0x6cefae(0x158)]),_0x5f5287[_0x6cefae(0x139)]&&console[_0x6cefae(0x168)](_0x6cefae(0x141)+_0x5f5287[_0x6cefae(0x139)]),0x1;throw _0x5f5287;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]='segment:show';[a31_0x5cf2c2(0x170)]=a31_0x5cf2c2(0x175);async[a31_0x5cf2c2(0x174)](_0x377d82){const _0x3851b1=a31_0x5cf2c2,{options:_0xb01003,args:_0x25bbdf,tdx:_0x17671c}=_0x377d82,_0x2169c1=_0x25bbdf[0x0];if(!_0x2169c1)return console[_0x3851b1(0x168)](_0x3851b1(0x161)),console['error']('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x3851b1(0x168)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x3851b1(0x168)]('Examples:'),console[_0x3851b1(0x168)](_0x3851b1(0x11b)),console[_0x3851b1(0x168)](_0x3851b1(0x105)),0x1;try{const _0x1e5c27=_0xb01003[_0x3851b1(0x128)],_0x3c1068=resolveSegmentTarget(_0x2169c1,_0x1e5c27,_0xb01003[_0x3851b1(0x153)]);_0xb01003[_0x3851b1(0x153)]&&console[_0x3851b1(0x168)](_0x3851b1(0x17d)+_0x3c1068);const _0x38170e=await withSpinner(_0x3851b1(0x17b)+_0x2169c1+_0x3851b1(0x14c),()=>_0x17671c['segment'][_0x3851b1(0xeb)](_0x3c1068),{'verbose':_0xb01003[_0x3851b1(0x153)]}),_0x58ea48=_0x38170e[_0x3851b1(0x10e)];_0xb01003[_0x3851b1(0x153)]&&(console[_0x3851b1(0x168)](_0x3851b1(0x130)+_0x58ea48[_0x3851b1(0x12e)]),console[_0x3851b1(0x168)]('Parent\x20ID:\x20'+_0x58ea48[_0x3851b1(0x15e)]));if(_0x58ea48[_0x3851b1(0x12e)]===_0x3851b1(0x150))return console[_0x3851b1(0x168)](_0x3851b1(0x15b)),console[_0x3851b1(0x168)](_0x3851b1(0x126)),0x1;if(_0x58ea48['type']===_0x3851b1(0x120))return console[_0x3851b1(0x168)](_0x3851b1(0xe6)),console['error']('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x58ea48['segmentId'])throw new SDKError(ErrorCode[_0x3851b1(0x14d)],_0x3851b1(0x167));const _0x5e6d51=await withSpinner(_0x3851b1(0x14a),()=>_0x17671c[_0x3851b1(0xf2)][_0x3851b1(0x17c)](_0x58ea48[_0x3851b1(0x15e)],_0x58ea48['segmentId']),{'verbose':_0xb01003[_0x3851b1(0x153)]});let _0x22bd87=_0x5e6d51[_0x3851b1(0x10e)];const _0x5306f9=resolveLimit(_0xb01003[_0x3851b1(0x145)],DEFAULT_DISPLAY_LIMIT),_0x1bdfc5=/\bLIMIT\s+\d+/i[_0x3851b1(0x147)](_0x22bd87);!_0x1bdfc5&&(_0x22bd87=_0x22bd87[_0x3851b1(0x14e)]()[_0x3851b1(0x156)](/;+$/,''),_0x22bd87=_0x3851b1(0x151)+_0x22bd87+_0x3851b1(0xe4)+_0x5306f9);_0xb01003['verbose']&&console[_0x3851b1(0x168)](_0x3851b1(0x157)+_0x22bd87);const _0x36d4bb=await withQuerySpinner(_0x3851b1(0x12a),async _0x415196=>{const _0x5c2123=_0x3851b1,_0x5572fa=await _0x17671c[_0x5c2123(0x107)][_0x5c2123(0x174)](_0x22bd87,{'catalog':'td','schema':_0x5c2123(0x179),'onJobId':_0x27f409=>{const _0x1ffacb=_0x5c2123;_0x415196[_0x1ffacb(0xe9)](_0x27f409);}});return _0x5572fa;},{'verbose':_0xb01003[_0x3851b1(0x153)]}),_0x4b82a0=_0x36d4bb[_0x3851b1(0x10e)],_0xb519d2=_0x4b82a0[_0x3851b1(0xef)]?_0x3851b1(0x15c)+_0x4b82a0[_0x3851b1(0xef)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x4b82a0[_0x3851b1(0x176)][_0x3851b1(0x111)][_0x3851b1(0x117)]()+_0x3851b1(0xff)+(_0x3851b1(0x149)+formatElapsed(_0x4b82a0[_0x3851b1(0x176)]['elapsedTimeMillis'])+_0xb519d2)),await handleQueryOutput(_0x4b82a0,_0xb01003),0x0;}catch(_0x30ee09){if(_0x30ee09 instanceof SDKError)return console[_0x3851b1(0x168)](_0x3851b1(0x166)+_0x30ee09[_0x3851b1(0x14b)]+']'),console['error']('\x0a'+_0x30ee09[_0x3851b1(0x158)]),0x1;throw _0x30ee09;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]=a31_0x5cf2c2(0xe1);[a31_0x5cf2c2(0x170)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a31_0x5cf2c2(0x174)](_0x1555cd){const _0x2c18a7=a31_0x5cf2c2,{options:_0x1a35d1,args:_0xef71b2,tdx:_0x11bdd5}=_0x1555cd;if(_0xef71b2['length']===0x0)return console[_0x2c18a7(0x168)](_0x2c18a7(0x11c)),console['error'](_0x2c18a7(0x16d)),0x1;const _0x72aca3=_0xef71b2[0x0];try{_0x1a35d1[_0x2c18a7(0x153)]&&(console[_0x2c18a7(0x168)]('Site:\x20'+_0x1a35d1['site']),console[_0x2c18a7(0x168)]('Parent\x20name:\x20'+_0x72aca3));const _0x5b4b47=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x72aca3+_0x2c18a7(0x14c),()=>_0x11bdd5[_0x2c18a7(0xf2)][_0x2c18a7(0x154)](_0x72aca3),{'verbose':_0x1a35d1[_0x2c18a7(0x153)]}),_0x13edac=_0x5b4b47[_0x2c18a7(0x10e)];_0x1a35d1[_0x2c18a7(0x153)]&&console[_0x2c18a7(0x168)]('Resolved\x20parent\x20ID:\x20'+_0x13edac);const _0x5e770a=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x72aca3+_0x2c18a7(0x14c),()=>_0x11bdd5[_0x2c18a7(0xf2)][_0x2c18a7(0xf0)](_0x13edac),{'verbose':_0x1a35d1[_0x2c18a7(0x153)]}),_0x512e19=_0x5e770a[_0x2c18a7(0x10e)];return console[_0x2c18a7(0x168)](_0x2c18a7(0xfe)+_0x512e19[_0x2c18a7(0x121)]+_0x2c18a7(0x13c)+(_0x512e19[_0x2c18a7(0x121)]!==0x1?'s':'')),await handleSDKOutput(_0x512e19,_0x1a35d1),0x0;}catch(_0x300278){if(_0x300278 instanceof SDKError)return console[_0x2c18a7(0x168)](_0x2c18a7(0x113)+_0x300278[_0x2c18a7(0x158)]),_0x300278[_0x2c18a7(0x139)]&&console['error'](_0x2c18a7(0x141)+_0x300278[_0x2c18a7(0x139)]),0x1;throw _0x300278;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]=a31_0x5cf2c2(0x11e);[a31_0x5cf2c2(0x170)]='Show\x20segment\x20folder\x20details';async[a31_0x5cf2c2(0x174)](_0x589dff){const _0x3b4821=a31_0x5cf2c2,{options:_0x3cd23f,args:_0x14dd1a,tdx:_0x3eac3a}=_0x589dff;if(_0x14dd1a['length']===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x3b4821(0x168)](_0x3b4821(0x177)),0x1;try{const {parentId:_0x1b4d6b,childId:_0x417c75}=parseSegmentRef(_0x14dd1a[0x0]);_0x3cd23f[_0x3b4821(0x153)]&&(console['error'](_0x3b4821(0x172)+_0x3cd23f[_0x3b4821(0x12d)]),console[_0x3b4821(0x168)](_0x3b4821(0x15f)+_0x1b4d6b),_0x417c75&&console[_0x3b4821(0x168)](_0x3b4821(0x138)+_0x417c75));if(!_0x417c75)return console['error'](_0x3b4821(0xe7)),0x1;const _0x112009=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1b4d6b+_0x3b4821(0x14c),()=>_0x3eac3a[_0x3b4821(0xf2)][_0x3b4821(0x154)](_0x1b4d6b),{'verbose':_0x3cd23f['verbose']}),_0x5852f7=_0x112009[_0x3b4821(0x10e)];_0x3cd23f[_0x3b4821(0x153)]&&console[_0x3b4821(0x168)](_0x3b4821(0x106)+_0x5852f7);const _0xc5ba99=await withSpinner(_0x3b4821(0x13a)+_0x417c75+_0x3b4821(0x14c),()=>_0x3eac3a[_0x3b4821(0xf2)]['resolveFolderId'](_0x5852f7,_0x417c75),{'verbose':_0x3cd23f['verbose']}),_0x528eb7=_0xc5ba99['data'];_0x3cd23f[_0x3b4821(0x153)]&&console[_0x3b4821(0x168)](_0x3b4821(0x119)+_0x528eb7);const _0x5d3a92=await withSpinner('Fetching\x20folder\x20\x27'+_0x417c75+_0x3b4821(0x14c),()=>_0x3eac3a['segment'][_0x3b4821(0xe2)](_0x528eb7),{'verbose':_0x3cd23f['verbose']});return await handleSDKOutput([_0x5d3a92[_0x3b4821(0x10e)]],_0x3cd23f),0x0;}catch(_0x5dc7eb){if(_0x5dc7eb instanceof SDKError)return console[_0x3b4821(0x168)](_0x3b4821(0x113)+_0x5dc7eb['message']),_0x5dc7eb[_0x3b4821(0x139)]&&console[_0x3b4821(0x168)](_0x3b4821(0x141)+_0x5dc7eb[_0x3b4821(0x139)]),0x1;throw _0x5dc7eb;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]=a31_0x5cf2c2(0x10b);[a31_0x5cf2c2(0x170)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a31_0x5cf2c2(0x174)](_0x15d996){const _0x5a2fec=a31_0x5cf2c2,{options:_0x3992a0,args:_0x1b2d7a,tdx:_0x59bf4f}=_0x15d996,_0x195fa9=_0x1b2d7a[0x0];if(!_0x195fa9)return console[_0x5a2fec(0x168)](_0x5a2fec(0x161)),console[_0x5a2fec(0x168)](_0x5a2fec(0x103)),console['error'](_0x5a2fec(0x143)),console[_0x5a2fec(0x168)](_0x5a2fec(0x132)),console['error']('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console['error']('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x52e813=_0x3992a0[_0x5a2fec(0x128)],_0xd1728e=resolveSegmentTarget(_0x195fa9,_0x52e813,_0x3992a0[_0x5a2fec(0x153)]);_0x3992a0[_0x5a2fec(0x153)]&&console['error'](_0x5a2fec(0x17d)+_0xd1728e);const _0x12d09c=await withSpinner(_0x5a2fec(0x17b)+_0x195fa9+'\x27...',()=>_0x59bf4f[_0x5a2fec(0xf2)][_0x5a2fec(0xeb)](_0xd1728e),{'verbose':_0x3992a0['verbose']}),_0x3d9fbe=_0x12d09c['data'];_0x3992a0[_0x5a2fec(0x153)]&&(console[_0x5a2fec(0x168)]('Resolved\x20type:\x20'+_0x3d9fbe[_0x5a2fec(0x12e)]),console['error'](_0x5a2fec(0x12b)+_0x3d9fbe[_0x5a2fec(0x15e)]));if(_0x3d9fbe[_0x5a2fec(0x12e)]==='folder')return console[_0x5a2fec(0x168)](_0x5a2fec(0xf7)),console[_0x5a2fec(0x168)](_0x5a2fec(0x159)),0x1;if(_0x3d9fbe[_0x5a2fec(0x12e)]===_0x5a2fec(0x120))return console[_0x5a2fec(0x168)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5a2fec(0x168)](_0x5a2fec(0x125)),0x1;if(!_0x3d9fbe[_0x5a2fec(0x114)])throw new SDKError(ErrorCode[_0x5a2fec(0x14d)],_0x5a2fec(0x167));const _0x46de48=await withSpinner(_0x5a2fec(0x14a),()=>_0x59bf4f[_0x5a2fec(0xf2)][_0x5a2fec(0x17c)](_0x3d9fbe[_0x5a2fec(0x15e)],_0x3d9fbe[_0x5a2fec(0x114)]),{'verbose':_0x3992a0['verbose']}),_0x4faf42=_0x46de48['data'];return _0x3992a0[_0x5a2fec(0x146)]===_0x5a2fec(0x11a)||_0x3992a0[_0x5a2fec(0x146)]===_0x5a2fec(0x15a)?await handleSDKOutput([{'sql':_0x4faf42}],_0x3992a0):console[_0x5a2fec(0xfb)](_0x4faf42),0x0;}catch(_0x51b928){if(_0x51b928 instanceof SDKError)return console[_0x5a2fec(0x168)](_0x5a2fec(0x113)+_0x51b928['message']),_0x51b928[_0x5a2fec(0x139)]&&console[_0x5a2fec(0x168)](_0x5a2fec(0x141)+_0x51b928[_0x5a2fec(0x139)]),0x1;throw _0x51b928;}}}function a31_0x46b2(){const _0x55e1a0=['36880461TLXGhu','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','toLocaleString','Use:\x20tdx\x20ps\x20view\x20-w','Resolved\x20folder\x20ID:\x20','json','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment:folder:show','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parent','length','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Use:\x20tdx\x20ps\x20sql','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Usage:\x20tdx\x20segment\x20describe\x20<path>','parentSegment','5258400rtIWDv','Executing\x20segment\x20query...','Parent\x20ID:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','site','type','resolveFolderId','Resolved\x20type:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Examples:','getParent','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20\x20Full\x20path:\x20','877136MTUWCG','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Folder\x20name:\x20','cause','Resolving\x20folder\x20\x27','segmentName','\x20folder','parentFolder','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolving\x20parent\x20segment\x20\x27','3565GXRrWH','\x20\x20Cause:\x20','\x20\x20Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Options:','limit','format','test','cyan','in\x20','Fetching\x20SQL\x20for\x20segment...','code','\x27...','SEGMENT_NOT_FOUND','trim','/app/ps/','folder','SELECT\x20*\x20FROM\x20(\x0a','(root)','verbose','resolveParentId','Parent\x20segment:\x20','replace','SQL\x20query:\x0a','message','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','jsonl','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20[Job\x20ID:\x20','5167008uESukm','parentId','Parent\x20name:\x20','folderPath','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20\x20Segment\x20name:\x20','web','✖\x20Query\x20failed\x20[','Segment\x20ID\x20missing\x20from\x20resolved\x20path','error','segment:view','Folder\x20ID:\x20','Use:\x20tdx\x20ps\x20desc','Show\x20segment\x20or\x20folder\x20details','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','✔\x20Created\x20folder\x20\x27','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','description','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Site:\x20','Resolving\x20parent\x20folder\x20\x27','execute','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','stats','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','information_schema','INVALID_ARGUMENT','Resolving\x20\x27','getSegmentSQL','Target\x20path:\x20','Show\x20folder\x20or\x20child\x20segment\x20details','segment:folder:list','getFolder','Fetching\x20folder\x20details...','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','folderId','setJobId','getSegment','resolvePathToResource','Fetching\x20segment\x20details...','4458ASvzkO','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','jobId','listFolders','green','segment','1jIXWTb','3892036QiinjL','name','/e/','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','SEGMENT_FOLDER_NOT_FOUND','segmentPath','Resolved\x20parent\x20folder\x20ID:\x20','log','Use:\x20tdx\x20ps\x20view','\x27\x20with\x20ID:\x20','✔\x20Found\x20','\x20rows\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','segment:describe','3904671uNFjuc','Usage:\x20tdx\x20sg\x20sql\x20<name>','Resolved\x20YAML\x20file:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Resolved\x20parent\x20ID:\x20','query','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','segment:sql','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Resolving\x20path\x20\x27','data','Fetching\x20parent\x20segment\x20details...','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','processedRows','fullPath','Error:\x20','segmentId'];a31_0x46b2=function(){return _0x55e1a0;};return a31_0x46b2();}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a31_0x5cf2c2(0x170)]='Create\x20segment\x20folder\x20for\x20organization';async[a31_0x5cf2c2(0x174)](_0x2b09e5){const _0x1090ec=a31_0x5cf2c2,{options:_0x23c89b,args:_0x5a7a5e,tdx:_0xbc85da}=_0x2b09e5,_0x51faf4=_0x23c89b;if(_0x5a7a5e['length']<0x2)return console['error'](_0x1090ec(0x162)),console['error'](_0x1090ec(0x13e)),0x1;const _0x121ac=_0x5a7a5e[0x0],_0x50492a=_0x5a7a5e[0x1];_0x51faf4['verbose']&&(console[_0x1090ec(0x168)](_0x1090ec(0x172)+_0x51faf4[_0x1090ec(0x12d)]),console[_0x1090ec(0x168)](_0x1090ec(0x155)+_0x121ac),console[_0x1090ec(0x168)](_0x1090ec(0x138)+_0x50492a));let _0x453867;if(_0x51faf4[_0x1090ec(0x13d)]){const _0x3c47aa=_0x51faf4[_0x1090ec(0x13d)],_0x4f2ca0=await withSpinner(_0x1090ec(0x13f)+_0x121ac+_0x1090ec(0x14c),()=>_0xbc85da[_0x1090ec(0xf2)]['resolveParentId'](_0x121ac),{'verbose':_0x51faf4[_0x1090ec(0x153)]}),_0x470e28=_0x4f2ca0[_0x1090ec(0x10e)],_0x3e7fea=await withSpinner(_0x1090ec(0x173)+_0x3c47aa+'\x27...',()=>_0xbc85da[_0x1090ec(0xf2)][_0x1090ec(0x12f)](_0x470e28,_0x3c47aa),{'verbose':_0x51faf4[_0x1090ec(0x153)]});_0x453867=_0x3e7fea[_0x1090ec(0x10e)],_0x51faf4['verbose']&&console[_0x1090ec(0x168)](_0x1090ec(0xfa)+_0x453867);}const _0x1f6d3e={'name':_0x50492a,'description':_0x51faf4[_0x1090ec(0x170)],'parentFolderId':_0x453867},_0x4f91aa=await withSpinner('Creating\x20folder\x20\x27'+_0x50492a+'\x27...',()=>_0xbc85da['segment']['createFolder'](_0x121ac,_0x1f6d3e),{'verbose':_0x51faf4[_0x1090ec(0x153)]}),_0x468ee6=_0x4f91aa[_0x1090ec(0x10e)];return console[_0x1090ec(0x168)](_0x1090ec(0x16e)+_0x468ee6[_0x1090ec(0xf5)]+_0x1090ec(0xfd)+_0x468ee6['id']),await handleSDKOutput([_0x468ee6],_0x51faf4),0x0;}}export class SegmentViewCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]=a31_0x5cf2c2(0x169);[a31_0x5cf2c2(0x170)]=a31_0x5cf2c2(0x17e);async[a31_0x5cf2c2(0x174)](_0x45f8a9){const _0x4b6435=a31_0x5cf2c2,{options:_0x2d1f0e,args:_0x2d25bc,tdx:_0x80bf4c}=_0x45f8a9,_0x33c37b=_0x2d25bc[0x0];if(!_0x33c37b)return console[_0x4b6435(0x168)](_0x4b6435(0x171)),console['error'](_0x4b6435(0x11d)),console[_0x4b6435(0x168)](_0x4b6435(0x123)),console[_0x4b6435(0x168)](_0x4b6435(0x144)),console[_0x4b6435(0x168)](_0x4b6435(0x12c)),console[_0x4b6435(0x168)](_0x4b6435(0x132)),console[_0x4b6435(0x168)](_0x4b6435(0x110)),console[_0x4b6435(0x168)](_0x4b6435(0x108)),console[_0x4b6435(0x168)](_0x4b6435(0x10a)),console[_0x4b6435(0x168)](_0x4b6435(0x10c)),0x1;try{const _0x1c23bd=_0x2d1f0e[_0x4b6435(0x128)],_0x22c23e=resolveSegmentTarget(_0x33c37b,_0x1c23bd,_0x2d1f0e['verbose']);_0x2d1f0e[_0x4b6435(0x153)]&&console[_0x4b6435(0x168)](_0x4b6435(0x17d)+_0x22c23e);const _0x4d87b5=await withSpinner('Resolving\x20\x27'+_0x33c37b+_0x4b6435(0x14c),()=>_0x80bf4c[_0x4b6435(0xf2)][_0x4b6435(0xeb)](_0x22c23e),{'verbose':_0x2d1f0e['verbose']}),_0x20d62b=_0x4d87b5['data'];_0x2d1f0e[_0x4b6435(0x153)]&&(console[_0x4b6435(0x168)]('Resolved\x20type:\x20'+_0x20d62b[_0x4b6435(0x12e)]),console['error']('Parent\x20ID:\x20'+_0x20d62b[_0x4b6435(0x15e)]),_0x20d62b['folderId']&&console[_0x4b6435(0x168)](_0x4b6435(0x16a)+_0x20d62b['folderId']),_0x20d62b[_0x4b6435(0x114)]&&console[_0x4b6435(0x168)]('Segment\x20ID:\x20'+_0x20d62b[_0x4b6435(0x114)]));if(_0x2d1f0e[_0x4b6435(0x165)]){if(_0x20d62b['type']===_0x4b6435(0x150))return console['error'](_0x4b6435(0x134)),0x1;if(_0x20d62b[_0x4b6435(0x12e)]===_0x4b6435(0x120))return console[_0x4b6435(0x168)](_0x4b6435(0x122)),console[_0x4b6435(0x168)](_0x4b6435(0x118)),0x1;if(!_0x20d62b[_0x4b6435(0x114)])throw new SDKError(ErrorCode[_0x4b6435(0x14d)],_0x4b6435(0x167));const _0x55adc7=getConsoleNextUrl(_0x2d1f0e[_0x4b6435(0x12d)],_0x4b6435(0x14f)+_0x20d62b['parentId']+'/e/'+_0x20d62b['segmentId']);return console['error'](a31_0xb205ff[_0x4b6435(0xf1)]('✔')+'\x20Opening\x20'+a31_0xb205ff[_0x4b6435(0x148)](_0x55adc7)),openBrowser(_0x55adc7),0x0;}if(_0x20d62b[_0x4b6435(0x12e)]==='folder'){if(!_0x20d62b[_0x4b6435(0xe8)])throw new SDKError(ErrorCode[_0x4b6435(0xf8)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x147aad=await withSpinner(_0x4b6435(0xe3),()=>_0x80bf4c[_0x4b6435(0xf2)][_0x4b6435(0xe2)](_0x20d62b['folderId']),{'verbose':_0x2d1f0e['verbose']});await handleSingleObjectOutput(_0x147aad[_0x4b6435(0x10e)],_0x2d1f0e);}else{if(_0x20d62b[_0x4b6435(0x12e)]===_0x4b6435(0xf2)){if(!_0x20d62b[_0x4b6435(0x114)])throw new SDKError(ErrorCode[_0x4b6435(0x14d)],_0x4b6435(0x167));const _0x1dd2f4=await withSpinner(_0x4b6435(0xec),()=>_0x80bf4c['segment'][_0x4b6435(0xea)](_0x20d62b['parentId'],_0x20d62b[_0x4b6435(0x114)]),{'verbose':_0x2d1f0e[_0x4b6435(0x153)]}),_0x2911e8=getConsoleNextUrl(_0x2d1f0e[_0x4b6435(0x12d)],_0x4b6435(0x14f)+_0x20d62b[_0x4b6435(0x15e)]+_0x4b6435(0xf6)+_0x20d62b[_0x4b6435(0x114)]),_0x31f936=_0x1dd2f4['data'];_0x31f936['url']=_0x2911e8,await handleSingleObjectOutput(_0x31f936,_0x2d1f0e);}else return console[_0x4b6435(0x168)](_0x4b6435(0x178)),console[_0x4b6435(0x168)](_0x4b6435(0xfc)),0x1;}return 0x0;}catch(_0x12897b){if(_0x12897b instanceof SDKError)return console['error'](_0x4b6435(0x113)+_0x12897b[_0x4b6435(0x158)]),_0x12897b[_0x4b6435(0x139)]&&console[_0x4b6435(0x168)](_0x4b6435(0x141)+_0x12897b['cause']),0x1;throw _0x12897b;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x5cf2c2(0xf5)]='segment:desc';['description']='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a31_0x5cf2c2(0x174)](_0x3fd599){const _0x2e65f0=a31_0x5cf2c2,{options:_0x55e9ea,args:_0x28f363,tdx:_0x514c64}=_0x3fd599,_0xdd700d=_0x28f363[0x0];if(!_0xdd700d)return console['error'](_0x2e65f0(0x161)),console[_0x2e65f0(0x168)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x2e65f0(0x168)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x2e65f0(0x168)](_0x2e65f0(0x132)),console[_0x2e65f0(0x168)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x2e65f0(0x168)](_0x2e65f0(0x163)),0x1;try{const _0x4f6097=_0x55e9ea[_0x2e65f0(0x128)],_0x7994d4=resolveSegmentTarget(_0xdd700d,_0x4f6097,_0x55e9ea['verbose']);_0x55e9ea['verbose']&&console['error'](_0x2e65f0(0x17d)+_0x7994d4);const _0x565406=await withSpinner(_0x2e65f0(0x17b)+_0xdd700d+'\x27...',()=>_0x514c64['segment'][_0x2e65f0(0xeb)](_0x7994d4),{'verbose':_0x55e9ea['verbose']}),_0x505c5e=_0x565406[_0x2e65f0(0x10e)];_0x55e9ea[_0x2e65f0(0x153)]&&(console[_0x2e65f0(0x168)](_0x2e65f0(0x130)+_0x505c5e[_0x2e65f0(0x12e)]),console[_0x2e65f0(0x168)](_0x2e65f0(0x12b)+_0x505c5e['parentId']));if(_0x505c5e[_0x2e65f0(0x12e)]==='folder')return console[_0x2e65f0(0x168)](_0x2e65f0(0x16f)),console[_0x2e65f0(0x168)](_0x2e65f0(0x159)),0x1;if(_0x505c5e[_0x2e65f0(0x12e)]===_0x2e65f0(0x120))return console[_0x2e65f0(0x168)](_0x2e65f0(0x116)),console[_0x2e65f0(0x168)](_0x2e65f0(0x16b)),0x1;if(!_0x505c5e[_0x2e65f0(0x114)])throw new SDKError(ErrorCode[_0x2e65f0(0x14d)],_0x2e65f0(0x167));const _0x1c435a=await withSpinner(_0x2e65f0(0x14a),()=>_0x514c64['segment'][_0x2e65f0(0x17c)](_0x505c5e['parentId'],_0x505c5e[_0x2e65f0(0x114)]),{'verbose':_0x55e9ea[_0x2e65f0(0x153)]}),_0x3570e0=_0x1c435a[_0x2e65f0(0x10e)],_0x50c679=await executeSchemaQuery(_0x3570e0,_0x514c64,_0x55e9ea);return await handleQueryOutput(_0x50c679,_0x55e9ea),0x0;}catch(_0x5459aa){if(_0x5459aa instanceof SDKError)return console[_0x2e65f0(0x168)](_0x2e65f0(0x113)+_0x5459aa[_0x2e65f0(0x158)]),_0x5459aa[_0x2e65f0(0x139)]&&console[_0x2e65f0(0x168)](_0x2e65f0(0x141)+_0x5459aa[_0x2e65f0(0x139)]),0x1;throw _0x5459aa;}}}
1
+ const a31_0x4aac13=a31_0xd327;(function(_0x2b69a4,_0x53a617){const _0x1939a7=a31_0xd327,_0x14625f=_0x2b69a4();while(!![]){try{const _0x411040=parseInt(_0x1939a7(0x1e5))/0x1*(parseInt(_0x1939a7(0x169))/0x2)+parseInt(_0x1939a7(0x174))/0x3+parseInt(_0x1939a7(0x1c4))/0x4*(parseInt(_0x1939a7(0x165))/0x5)+parseInt(_0x1939a7(0x1b4))/0x6+-parseInt(_0x1939a7(0x17a))/0x7*(parseInt(_0x1939a7(0x1a8))/0x8)+parseInt(_0x1939a7(0x1c5))/0x9+-parseInt(_0x1939a7(0x1e7))/0xa;if(_0x411040===_0x53a617)break;else _0x14625f['push'](_0x14625f['shift']());}catch(_0x5b7bc3){_0x14625f['push'](_0x14625f['shift']());}}}(a31_0x3803,0x3db73));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a31_0xd327(_0x8335a,_0x16eb9b){_0x8335a=_0x8335a-0x154;const _0x38033a=a31_0x3803();let _0xd32779=_0x38033a[_0x8335a];return _0xd32779;}import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a31_0x1d1a6e from'chalk';function a31_0x3803(){const _0xe0cbe=['Show\x20child\x20segment\x20schema\x20(column\x20types)','Resolving\x20parent\x20segment\x20\x27','name','1484vBNlDH','Target\x20path:\x20','/app/ps/','Resolved\x20parent\x20folder\x20ID:\x20','folder','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Resolving\x20\x27','execute','Resolved\x20type:\x20','stats','fullPath','length','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20view\x20-w','\x20\x20Cause:\x20','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20folder','trim','site','Resolved\x20folder\x20ID:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Fetching\x20SQL\x20for\x20segment...','\x20\x20Parent\x20segment:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Folder\x20reference\x20is\x20required','test','information_schema','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','description','✔\x20Query\x20completed:\x20Processed\x20','segmentPath','in\x20','Show\x20folder\x20or\x20child\x20segment\x20details','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Path\x20or\x20name\x20is\x20required','Examples:','Usage:\x20tdx\x20segment\x20describe\x20<path>','Error:\x20','parentSegment','resolvePathToResource','data','15048oLVpEh','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','parent','json','segment:sql','Executing\x20segment\x20query...','type','Fetching\x20folder\x20details...','Options:','query','Folder\x20name:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','2527188xOXbfF','getSegmentSQL','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','cause','getParent','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','replace','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Parent\x20name:\x20','includes','folderId','Folder\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','toLocaleString','segment','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','4fDIKns','4223691WEaLOm','Error:\x20Parent\x20segment\x20name\x20is\x20required','getSegment','limit','Resolved\x20parent\x20ID:\x20','Segment\x20ID:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','web','resolveParentId','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x27...','SEGMENT_FOLDER_NOT_FOUND','SEGMENT_NOT_FOUND','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','/e/','✖\x20Query\x20failed\x20[','SELECT\x20*\x20FROM\x20(\x0a','Fetching\x20parent\x20segment\x20details...','jobId','Show\x20segment\x20or\x20folder\x20details','\x20rows\x20','format','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20desc\x20<name>','Resolving\x20path\x20\x27','Creating\x20folder\x20\x27','jsonl','message','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','458267EKmumx','segment:show','10043710mNifsv','SQL\x20query:\x0a','Use:\x20tdx\x20ps\x20desc','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','✔\x20Found\x20','Parent\x20ID:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','resolveFolderId','segment:folder:create','segmentId','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','verbose','Resolving\x20parent\x20folder\x20\x27','1222800jaNKpq','parentId','INVALID_ARGUMENT','Site:\x20','2PjJAIs','Resolved\x20YAML\x20file:\x20','Use:\x20tdx\x20ps\x20sql','getFolder','error','cyan','createFolder','\x20\x20Full\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Create\x20segment\x20folder\x20for\x20organization','elapsedTimeMillis','187818VjSBlr','segmentName','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'];a31_0x3803=function(){return _0xe0cbe;};return a31_0x3803();}function resolveSegmentTarget(_0x5a9b14,_0x526af7,_0x3ad659){const _0x4c2a7b=a31_0xd327;if(isYamlFilePath(_0x5a9b14))try{const _0x549c24=resolveYamlFilePath(_0x5a9b14);return _0x3ad659&&(console['error'](_0x4c2a7b(0x16a)+_0x5a9b14),console[_0x4c2a7b(0x16d)](_0x4c2a7b(0x193)+_0x549c24[_0x4c2a7b(0x1a5)]),console['error']('\x20\x20Segment\x20name:\x20'+_0x549c24[_0x4c2a7b(0x175)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0x549c24['folderPath']||'(root)')),console['error'](_0x4c2a7b(0x170)+_0x549c24[_0x4c2a7b(0x184)])),_0x549c24[_0x4c2a7b(0x184)];}catch(_0xb1f7e9){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0xb1f7e9[_0x4c2a7b(0x1e2)]);}if(!_0x526af7)throw new SDKError(ErrorCode[_0x4c2a7b(0x167)],_0x4c2a7b(0x187));return _0x526af7+'/'+_0x5a9b14;}export class SegmentDescribeCommand extends BaseCommand{['name']='segment:describe';['description']=a31_0x4aac13(0x1d9);async[a31_0x4aac13(0x181)](_0x2f1786){const _0x53f98a=a31_0x4aac13,{options:_0x4c1f84,args:_0xc48d82,tdx:_0x374c3f}=_0x2f1786,_0x1b96b5=_0xc48d82[0x0],_0x512671=!_0x1b96b5&&!!_0x4c1f84['parentSegment'],_0x444fc5=_0x1b96b5||_0x4c1f84[_0x53f98a(0x1a5)];if(!_0x444fc5)return console[_0x53f98a(0x16d)](_0x53f98a(0x1a1)),console[_0x53f98a(0x16d)](_0x53f98a(0x1a3)),console[_0x53f98a(0x16d)](_0x53f98a(0x1a2)),console[_0x53f98a(0x16d)](_0x53f98a(0x156)),console[_0x53f98a(0x16d)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x53f98a(0x16d)](_0x53f98a(0x15d)),console[_0x53f98a(0x16d)](_0x53f98a(0x17f)),0x1;try{const _0x1dbf3d=_0x4c1f84[_0x53f98a(0x19c)];let _0xd54eb0=_0x444fc5;!_0x512671&&_0x1dbf3d&&!_0x444fc5[_0x53f98a(0x1bd)]('/')&&(_0xd54eb0=_0x1dbf3d+'/'+_0x444fc5,_0x4c1f84[_0x53f98a(0x163)]&&console['error'](_0x53f98a(0x1c0)+_0xd54eb0));const _0x435aa7=await withSpinner(_0x53f98a(0x1df)+_0xd54eb0+_0x53f98a(0x1d0),()=>_0x374c3f[_0x53f98a(0x1c2)]['resolvePathToResource'](_0xd54eb0),{'verbose':_0x4c1f84[_0x53f98a(0x163)]}),_0x406e46=_0x435aa7['data'];_0x4c1f84[_0x53f98a(0x163)]&&(console[_0x53f98a(0x16d)](_0x53f98a(0x182)+_0x406e46[_0x53f98a(0x1ae)]),console['error'](_0x53f98a(0x159)+_0x406e46[_0x53f98a(0x166)]),_0x406e46['folderId']&&console['error'](_0x53f98a(0x1bf)+_0x406e46[_0x53f98a(0x1be)]),_0x406e46[_0x53f98a(0x160)]&&console[_0x53f98a(0x16d)](_0x53f98a(0x1ca)+_0x406e46[_0x53f98a(0x160)]));if(_0x406e46[_0x53f98a(0x1ae)]===_0x53f98a(0x1aa)){const _0x372396=await withSpinner(_0x53f98a(0x1d7),()=>_0x374c3f[_0x53f98a(0x1c2)][_0x53f98a(0x1b8)](_0x406e46[_0x53f98a(0x166)]),{'verbose':_0x4c1f84[_0x53f98a(0x163)]});await handleSingleObjectOutput(_0x372396['data'],_0x4c1f84);}else{if(_0x406e46[_0x53f98a(0x1ae)]===_0x53f98a(0x17e)){if(!_0x406e46[_0x53f98a(0x1be)])throw new SDKError(ErrorCode[_0x53f98a(0x1d1)],_0x53f98a(0x1bb));const _0x4b825c=await withSpinner(_0x53f98a(0x1af),()=>_0x374c3f[_0x53f98a(0x1c2)]['getFolder'](_0x406e46[_0x53f98a(0x1be)]),{'verbose':_0x4c1f84['verbose']});await handleSingleObjectOutput(_0x4b825c['data'],_0x4c1f84);}else{if(_0x406e46[_0x53f98a(0x1ae)]===_0x53f98a(0x1c2)){if(!_0x406e46[_0x53f98a(0x160)])throw new SDKError(ErrorCode[_0x53f98a(0x1d2)],_0x53f98a(0x15c));const _0x880bb0=await withSpinner('Fetching\x20segment\x20details...',()=>_0x374c3f['segment']['getSegment'](_0x406e46[_0x53f98a(0x166)],_0x406e46['segmentId']),{'verbose':_0x4c1f84[_0x53f98a(0x163)]});await handleSingleObjectOutput(_0x880bb0[_0x53f98a(0x1a7)],_0x4c1f84);}}}return 0x0;}catch(_0x28d463){if(_0x28d463 instanceof SDKError)return console[_0x53f98a(0x16d)](_0x53f98a(0x1a4)+_0x28d463[_0x53f98a(0x1e2)]),_0x28d463['cause']&&console[_0x53f98a(0x16d)]('\x20\x20Cause:\x20'+_0x28d463['cause']),0x1;throw _0x28d463;}}}export class SegmentShowCommand extends BaseCommand{['name']=a31_0x4aac13(0x1e6);[a31_0x4aac13(0x19a)]=a31_0x4aac13(0x15b);async[a31_0x4aac13(0x181)](_0x3116e1){const _0x4b7e9b=a31_0x4aac13,{options:_0x43612e,args:_0x3edf48,tdx:_0x3dee4a}=_0x3116e1,_0x2fdfe3=_0x3edf48[0x0];if(!_0x2fdfe3)return console['error'](_0x4b7e9b(0x1e4)),console['error']('Usage:\x20tdx\x20sg\x20show\x20<name>'),console['error'](_0x4b7e9b(0x1a9)),console[_0x4b7e9b(0x16d)](_0x4b7e9b(0x1a2)),console[_0x4b7e9b(0x16d)](_0x4b7e9b(0x162)),console[_0x4b7e9b(0x16d)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x580052=_0x43612e[_0x4b7e9b(0x1a5)],_0xe67e26=resolveSegmentTarget(_0x2fdfe3,_0x580052,_0x43612e[_0x4b7e9b(0x163)]);_0x43612e[_0x4b7e9b(0x163)]&&console[_0x4b7e9b(0x16d)]('Target\x20path:\x20'+_0xe67e26);const _0x4cb83f=await withSpinner(_0x4b7e9b(0x180)+_0x2fdfe3+_0x4b7e9b(0x1d0),()=>_0x3dee4a['segment'][_0x4b7e9b(0x1a6)](_0xe67e26),{'verbose':_0x43612e[_0x4b7e9b(0x163)]}),_0x442d67=_0x4cb83f[_0x4b7e9b(0x1a7)];_0x43612e['verbose']&&(console[_0x4b7e9b(0x16d)](_0x4b7e9b(0x182)+_0x442d67['type']),console[_0x4b7e9b(0x16d)](_0x4b7e9b(0x159)+_0x442d67[_0x4b7e9b(0x166)]));if(_0x442d67[_0x4b7e9b(0x1ae)]==='folder')return console['error'](_0x4b7e9b(0x1d3)),console[_0x4b7e9b(0x16d)](_0x4b7e9b(0x157)),0x1;if(_0x442d67[_0x4b7e9b(0x1ae)]===_0x4b7e9b(0x1aa))return console[_0x4b7e9b(0x16d)](_0x4b7e9b(0x1a0)),console['error']('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x442d67['segmentId'])throw new SDKError(ErrorCode[_0x4b7e9b(0x1d2)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5b2c62=await withSpinner(_0x4b7e9b(0x192),()=>_0x3dee4a[_0x4b7e9b(0x1c2)][_0x4b7e9b(0x1b5)](_0x442d67[_0x4b7e9b(0x166)],_0x442d67[_0x4b7e9b(0x160)]),{'verbose':_0x43612e[_0x4b7e9b(0x163)]});let _0x49a876=_0x5b2c62[_0x4b7e9b(0x1a7)];const _0xbb89e5=resolveLimit(_0x43612e[_0x4b7e9b(0x1c8)],DEFAULT_DISPLAY_LIMIT),_0x1eea10=/\bLIMIT\s+\d+/i[_0x4b7e9b(0x197)](_0x49a876);!_0x1eea10&&(_0x49a876=_0x49a876[_0x4b7e9b(0x18e)]()[_0x4b7e9b(0x1ba)](/;+$/,''),_0x49a876=_0x4b7e9b(0x1d6)+_0x49a876+_0x4b7e9b(0x186)+_0xbb89e5);_0x43612e[_0x4b7e9b(0x163)]&&console[_0x4b7e9b(0x16d)](_0x4b7e9b(0x154)+_0x49a876);const _0x3e809c=await withQuerySpinner(_0x4b7e9b(0x1ad),async _0x4a4091=>{const _0x55f3ca=_0x4b7e9b,_0x1c188c=await _0x3dee4a[_0x55f3ca(0x1b1)][_0x55f3ca(0x181)](_0x49a876,{'catalog':'td','schema':_0x55f3ca(0x198),'onJobId':_0x544939=>{_0x4a4091['setJobId'](_0x544939);}});return _0x1c188c;},{'verbose':_0x43612e[_0x4b7e9b(0x163)]}),_0x18dc60=_0x3e809c['data'],_0x367730=_0x18dc60[_0x4b7e9b(0x1d8)]?'\x20[Job\x20ID:\x20'+_0x18dc60[_0x4b7e9b(0x1d8)]+']':'';return console[_0x4b7e9b(0x16d)](_0x4b7e9b(0x19b)+_0x18dc60[_0x4b7e9b(0x183)]['processedRows'][_0x4b7e9b(0x1c1)]()+_0x4b7e9b(0x1da)+(_0x4b7e9b(0x19d)+formatElapsed(_0x18dc60['stats'][_0x4b7e9b(0x173)])+_0x367730)),await handleQueryOutput(_0x18dc60,_0x43612e),0x0;}catch(_0x506b97){if(_0x506b97 instanceof SDKError)return console[_0x4b7e9b(0x16d)](_0x4b7e9b(0x1d5)+_0x506b97['code']+']'),console[_0x4b7e9b(0x16d)]('\x0a'+_0x506b97[_0x4b7e9b(0x1e2)]),0x1;throw _0x506b97;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x4aac13(0x179)]='segment:folder:list';[a31_0x4aac13(0x19a)]=a31_0x4aac13(0x1cb);async[a31_0x4aac13(0x181)](_0x3ee0f4){const _0x5e3db2=a31_0x4aac13,{options:_0x1316f8,args:_0x135200,tdx:_0x2977d0}=_0x3ee0f4;if(_0x135200[_0x5e3db2(0x185)]===0x0)return console[_0x5e3db2(0x16d)](_0x5e3db2(0x1c6)),console[_0x5e3db2(0x16d)](_0x5e3db2(0x1c3)),0x1;const _0x4ed659=_0x135200[0x0];try{_0x1316f8['verbose']&&(console[_0x5e3db2(0x16d)](_0x5e3db2(0x168)+_0x1316f8['site']),console[_0x5e3db2(0x16d)](_0x5e3db2(0x1bc)+_0x4ed659));const _0x166bdc=await withSpinner(_0x5e3db2(0x178)+_0x4ed659+_0x5e3db2(0x1d0),()=>_0x2977d0[_0x5e3db2(0x1c2)][_0x5e3db2(0x1cd)](_0x4ed659),{'verbose':_0x1316f8['verbose']}),_0x312696=_0x166bdc[_0x5e3db2(0x1a7)];_0x1316f8['verbose']&&console[_0x5e3db2(0x16d)](_0x5e3db2(0x1c9)+_0x312696);const _0xe2713e=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x4ed659+'\x27...',()=>_0x2977d0[_0x5e3db2(0x1c2)]['listFolders'](_0x312696),{'verbose':_0x1316f8[_0x5e3db2(0x163)]}),_0x28617c=_0xe2713e[_0x5e3db2(0x1a7)];return console[_0x5e3db2(0x16d)](_0x5e3db2(0x158)+_0x28617c[_0x5e3db2(0x185)]+_0x5e3db2(0x18d)+(_0x28617c['length']!==0x1?'s':'')),await handleSDKOutput(_0x28617c,_0x1316f8),0x0;}catch(_0x2d4106){if(_0x2d4106 instanceof SDKError)return console['error'](_0x5e3db2(0x1a4)+_0x2d4106[_0x5e3db2(0x1e2)]),_0x2d4106[_0x5e3db2(0x1b7)]&&console['error']('\x20\x20Cause:\x20'+_0x2d4106[_0x5e3db2(0x1b7)]),0x1;throw _0x2d4106;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x4aac13(0x179)]='segment:folder:show';[a31_0x4aac13(0x19a)]='Show\x20segment\x20folder\x20details';async['execute'](_0x526594){const _0x549e7d=a31_0x4aac13,{options:_0x12d250,args:_0x1411a6,tdx:_0x36f414}=_0x526594;if(_0x1411a6[_0x549e7d(0x185)]===0x0)return console[_0x549e7d(0x16d)](_0x549e7d(0x196)),console['error'](_0x549e7d(0x195)),0x1;try{const {parentId:_0x4791a8,childId:_0x2a9af7}=parseSegmentRef(_0x1411a6[0x0]);_0x12d250[_0x549e7d(0x163)]&&(console[_0x549e7d(0x16d)]('Site:\x20'+_0x12d250[_0x549e7d(0x18f)]),console[_0x549e7d(0x16d)](_0x549e7d(0x1bc)+_0x4791a8),_0x2a9af7&&console[_0x549e7d(0x16d)]('Folder\x20name:\x20'+_0x2a9af7));if(!_0x2a9af7)return console['error'](_0x549e7d(0x1ce)),0x1;const _0x4af4f=await withSpinner(_0x549e7d(0x178)+_0x4791a8+_0x549e7d(0x1d0),()=>_0x36f414['segment'][_0x549e7d(0x1cd)](_0x4791a8),{'verbose':_0x12d250['verbose']}),_0x790226=_0x4af4f['data'];_0x12d250[_0x549e7d(0x163)]&&console[_0x549e7d(0x16d)]('Resolved\x20parent\x20ID:\x20'+_0x790226);const _0x4f6c2f=await withSpinner('Resolving\x20folder\x20\x27'+_0x2a9af7+'\x27...',()=>_0x36f414[_0x549e7d(0x1c2)][_0x549e7d(0x15e)](_0x790226,_0x2a9af7),{'verbose':_0x12d250['verbose']}),_0x30ac00=_0x4f6c2f['data'];_0x12d250['verbose']&&console[_0x549e7d(0x16d)](_0x549e7d(0x190)+_0x30ac00);const _0x2b2095=await withSpinner('Fetching\x20folder\x20\x27'+_0x2a9af7+_0x549e7d(0x1d0),()=>_0x36f414[_0x549e7d(0x1c2)]['getFolder'](_0x30ac00),{'verbose':_0x12d250[_0x549e7d(0x163)]});return await handleSDKOutput([_0x2b2095['data']],_0x12d250),0x0;}catch(_0x56be33){if(_0x56be33 instanceof SDKError)return console[_0x549e7d(0x16d)](_0x549e7d(0x1a4)+_0x56be33[_0x549e7d(0x1e2)]),_0x56be33[_0x549e7d(0x1b7)]&&console[_0x549e7d(0x16d)](_0x549e7d(0x18a)+_0x56be33[_0x549e7d(0x1b7)]),0x1;throw _0x56be33;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a31_0x4aac13(0x1ac);['description']=a31_0x4aac13(0x1dc);async[a31_0x4aac13(0x181)](_0x574641){const _0x56429c=a31_0x4aac13,{options:_0x3dfe91,args:_0x3273d0,tdx:_0x4980f5}=_0x574641,_0x3f1cd9=_0x3273d0[0x0];if(!_0x3f1cd9)return console[_0x56429c(0x16d)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error'](_0x56429c(0x188)),console['error'](_0x56429c(0x1a2)),console[_0x56429c(0x16d)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x56429c(0x16d)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x162d68=_0x3dfe91[_0x56429c(0x1a5)],_0x37e041=resolveSegmentTarget(_0x3f1cd9,_0x162d68,_0x3dfe91[_0x56429c(0x163)]);_0x3dfe91[_0x56429c(0x163)]&&console[_0x56429c(0x16d)](_0x56429c(0x17b)+_0x37e041);const _0x496d3d=await withSpinner(_0x56429c(0x180)+_0x3f1cd9+_0x56429c(0x1d0),()=>_0x4980f5[_0x56429c(0x1c2)][_0x56429c(0x1a6)](_0x37e041),{'verbose':_0x3dfe91[_0x56429c(0x163)]}),_0x4f6366=_0x496d3d['data'];_0x3dfe91[_0x56429c(0x163)]&&(console['error']('Resolved\x20type:\x20'+_0x4f6366[_0x56429c(0x1ae)]),console[_0x56429c(0x16d)](_0x56429c(0x159)+_0x4f6366[_0x56429c(0x166)]));if(_0x4f6366[_0x56429c(0x1ae)]===_0x56429c(0x17e))return console[_0x56429c(0x16d)](_0x56429c(0x15a)),console[_0x56429c(0x16d)](_0x56429c(0x1b3)),0x1;if(_0x4f6366[_0x56429c(0x1ae)]===_0x56429c(0x1aa))return console[_0x56429c(0x16d)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x56429c(0x16b)),0x1;if(!_0x4f6366[_0x56429c(0x160)])throw new SDKError(ErrorCode[_0x56429c(0x1d2)],_0x56429c(0x15c));const _0x33fe2d=await withSpinner(_0x56429c(0x192),()=>_0x4980f5[_0x56429c(0x1c2)][_0x56429c(0x1b5)](_0x4f6366[_0x56429c(0x166)],_0x4f6366[_0x56429c(0x160)]),{'verbose':_0x3dfe91[_0x56429c(0x163)]}),_0x206a04=_0x33fe2d[_0x56429c(0x1a7)];return _0x3dfe91[_0x56429c(0x1db)]===_0x56429c(0x1ab)||_0x3dfe91['format']===_0x56429c(0x1e1)?await handleSDKOutput([{'sql':_0x206a04}],_0x3dfe91):console['log'](_0x206a04),0x0;}catch(_0x478c47){if(_0x478c47 instanceof SDKError)return console[_0x56429c(0x16d)](_0x56429c(0x1a4)+_0x478c47['message']),_0x478c47[_0x56429c(0x1b7)]&&console['error']('\x20\x20Cause:\x20'+_0x478c47[_0x56429c(0x1b7)]),0x1;throw _0x478c47;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a31_0x4aac13(0x15f);['description']=a31_0x4aac13(0x172);async[a31_0x4aac13(0x181)](_0x3799e1){const _0x4c5b66=a31_0x4aac13,{options:_0xe3c6e8,args:_0x45392c,tdx:_0x4af801}=_0x3799e1,_0x35d446=_0xe3c6e8;if(_0x45392c['length']<0x2)return console[_0x4c5b66(0x16d)](_0x4c5b66(0x19f)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x400f1d=_0x45392c[0x0],_0x2c4317=_0x45392c[0x1];_0x35d446[_0x4c5b66(0x163)]&&(console[_0x4c5b66(0x16d)](_0x4c5b66(0x168)+_0x35d446[_0x4c5b66(0x18f)]),console[_0x4c5b66(0x16d)]('Parent\x20segment:\x20'+_0x400f1d),console[_0x4c5b66(0x16d)](_0x4c5b66(0x1b2)+_0x2c4317));let _0x4894ec;if(_0x35d446['parentFolder']){const _0x1ea8ac=_0x35d446['parentFolder'],_0x5c20e7=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x400f1d+'\x27...',()=>_0x4af801[_0x4c5b66(0x1c2)][_0x4c5b66(0x1cd)](_0x400f1d),{'verbose':_0x35d446[_0x4c5b66(0x163)]}),_0x55dfda=_0x5c20e7[_0x4c5b66(0x1a7)],_0x4aae6d=await withSpinner(_0x4c5b66(0x164)+_0x1ea8ac+'\x27...',()=>_0x4af801[_0x4c5b66(0x1c2)][_0x4c5b66(0x15e)](_0x55dfda,_0x1ea8ac),{'verbose':_0x35d446['verbose']});_0x4894ec=_0x4aae6d[_0x4c5b66(0x1a7)],_0x35d446[_0x4c5b66(0x163)]&&console[_0x4c5b66(0x16d)](_0x4c5b66(0x17d)+_0x4894ec);}const _0x4f71ce={'name':_0x2c4317,'description':_0x35d446[_0x4c5b66(0x19a)],'parentFolderId':_0x4894ec},_0x2a7e65=await withSpinner(_0x4c5b66(0x1e0)+_0x2c4317+_0x4c5b66(0x1d0),()=>_0x4af801['segment'][_0x4c5b66(0x16f)](_0x400f1d,_0x4f71ce),{'verbose':_0x35d446[_0x4c5b66(0x163)]}),_0x4a33d0=_0x2a7e65[_0x4c5b66(0x1a7)];return console[_0x4c5b66(0x16d)]('✔\x20Created\x20folder\x20\x27'+_0x4a33d0['name']+'\x27\x20with\x20ID:\x20'+_0x4a33d0['id']),await handleSDKOutput([_0x4a33d0],_0x35d446),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']='segment:view';[a31_0x4aac13(0x19a)]=a31_0x4aac13(0x19e);async['execute'](_0xd71711){const _0xe5b6ea=a31_0x4aac13,{options:_0x205065,args:_0x4df436,tdx:_0x14a1da}=_0xd71711,_0x379fff=_0x4df436[0x0];if(!_0x379fff)return console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x191)),console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x194)),console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x171)),console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x1b0)),console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x161)),console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x1a2)),console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x199)),console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x18c)),console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x1e3)),console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x1cf)),0x1;try{const _0x33ddb8=_0x205065['parentSegment'],_0x865b75=resolveSegmentTarget(_0x379fff,_0x33ddb8,_0x205065[_0xe5b6ea(0x163)]);_0x205065['verbose']&&console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x17b)+_0x865b75);const _0x4be834=await withSpinner('Resolving\x20\x27'+_0x379fff+_0xe5b6ea(0x1d0),()=>_0x14a1da[_0xe5b6ea(0x1c2)][_0xe5b6ea(0x1a6)](_0x865b75),{'verbose':_0x205065[_0xe5b6ea(0x163)]}),_0x13a6f4=_0x4be834['data'];_0x205065[_0xe5b6ea(0x163)]&&(console[_0xe5b6ea(0x16d)]('Resolved\x20type:\x20'+_0x13a6f4[_0xe5b6ea(0x1ae)]),console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x159)+_0x13a6f4[_0xe5b6ea(0x166)]),_0x13a6f4['folderId']&&console[_0xe5b6ea(0x16d)](_0xe5b6ea(0x1bf)+_0x13a6f4['folderId']),_0x13a6f4['segmentId']&&console[_0xe5b6ea(0x16d)]('Segment\x20ID:\x20'+_0x13a6f4[_0xe5b6ea(0x160)]));if(_0x205065[_0xe5b6ea(0x1cc)]){if(_0x13a6f4[_0xe5b6ea(0x1ae)]===_0xe5b6ea(0x17e))return console[_0xe5b6ea(0x16d)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x13a6f4['type']==='parent')return console[_0xe5b6ea(0x16d)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0xe5b6ea(0x189)),0x1;if(!_0x13a6f4[_0xe5b6ea(0x160)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xe5b6ea(0x15c));const _0x3a83a1=getConsoleNextUrl(_0x205065[_0xe5b6ea(0x18f)],_0xe5b6ea(0x17c)+_0x13a6f4[_0xe5b6ea(0x166)]+_0xe5b6ea(0x1d4)+_0x13a6f4[_0xe5b6ea(0x160)]);return console[_0xe5b6ea(0x16d)](a31_0x1d1a6e['green']('✔')+'\x20Opening\x20'+a31_0x1d1a6e[_0xe5b6ea(0x16e)](_0x3a83a1)),openBrowser(_0x3a83a1),0x0;}if(_0x13a6f4[_0xe5b6ea(0x1ae)]==='folder'){if(!_0x13a6f4['folderId'])throw new SDKError(ErrorCode[_0xe5b6ea(0x1d1)],_0xe5b6ea(0x1bb));const _0x3b9759=await withSpinner(_0xe5b6ea(0x1af),()=>_0x14a1da[_0xe5b6ea(0x1c2)][_0xe5b6ea(0x16c)](_0x13a6f4[_0xe5b6ea(0x1be)]),{'verbose':_0x205065[_0xe5b6ea(0x163)]});await handleSingleObjectOutput(_0x3b9759[_0xe5b6ea(0x1a7)],_0x205065);}else{if(_0x13a6f4[_0xe5b6ea(0x1ae)]===_0xe5b6ea(0x1c2)){if(!_0x13a6f4['segmentId'])throw new SDKError(ErrorCode[_0xe5b6ea(0x1d2)],_0xe5b6ea(0x15c));const _0x2a64ed=await withSpinner(_0xe5b6ea(0x18b),()=>_0x14a1da[_0xe5b6ea(0x1c2)][_0xe5b6ea(0x1c7)](_0x13a6f4[_0xe5b6ea(0x166)],_0x13a6f4[_0xe5b6ea(0x160)]),{'verbose':_0x205065[_0xe5b6ea(0x163)]}),_0x39f029=getConsoleNextUrl(_0x205065[_0xe5b6ea(0x18f)],_0xe5b6ea(0x17c)+_0x13a6f4[_0xe5b6ea(0x166)]+_0xe5b6ea(0x1d4)+_0x13a6f4[_0xe5b6ea(0x160)]),_0x1cac34=_0x2a64ed[_0xe5b6ea(0x1a7)];_0x1cac34['url']=_0x39f029,await handleSingleObjectOutput(_0x1cac34,_0x205065);}else return console['error'](_0xe5b6ea(0x1b6)),console[_0xe5b6ea(0x16d)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0xb4a45c){if(_0xb4a45c instanceof SDKError)return console[_0xe5b6ea(0x16d)]('Error:\x20'+_0xb4a45c['message']),_0xb4a45c[_0xe5b6ea(0x1b7)]&&console['error'](_0xe5b6ea(0x18a)+_0xb4a45c[_0xe5b6ea(0x1b7)]),0x1;throw _0xb4a45c;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';[a31_0x4aac13(0x19a)]=a31_0x4aac13(0x177);async[a31_0x4aac13(0x181)](_0x12f67b){const _0x45caea=a31_0x4aac13,{options:_0x4925f1,args:_0x35f042,tdx:_0x3da760}=_0x12f67b,_0x31c52d=_0x35f042[0x0];if(!_0x31c52d)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x45caea(0x16d)](_0x45caea(0x1de)),console[_0x45caea(0x16d)](_0x45caea(0x1dd)),console['error']('Examples:'),console[_0x45caea(0x16d)](_0x45caea(0x176)),console[_0x45caea(0x16d)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0xf88c60=_0x4925f1[_0x45caea(0x1a5)],_0x1d0223=resolveSegmentTarget(_0x31c52d,_0xf88c60,_0x4925f1[_0x45caea(0x163)]);_0x4925f1[_0x45caea(0x163)]&&console[_0x45caea(0x16d)]('Target\x20path:\x20'+_0x1d0223);const _0x246f7c=await withSpinner(_0x45caea(0x180)+_0x31c52d+'\x27...',()=>_0x3da760[_0x45caea(0x1c2)][_0x45caea(0x1a6)](_0x1d0223),{'verbose':_0x4925f1[_0x45caea(0x163)]}),_0x15feab=_0x246f7c[_0x45caea(0x1a7)];_0x4925f1[_0x45caea(0x163)]&&(console[_0x45caea(0x16d)](_0x45caea(0x182)+_0x15feab['type']),console[_0x45caea(0x16d)](_0x45caea(0x159)+_0x15feab[_0x45caea(0x166)]));if(_0x15feab[_0x45caea(0x1ae)]===_0x45caea(0x17e))return console[_0x45caea(0x16d)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error'](_0x45caea(0x1b3)),0x1;if(_0x15feab['type']===_0x45caea(0x1aa))return console[_0x45caea(0x16d)](_0x45caea(0x1b9)),console[_0x45caea(0x16d)](_0x45caea(0x155)),0x1;if(!_0x15feab['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3bf9bf=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3da760['segment'][_0x45caea(0x1b5)](_0x15feab[_0x45caea(0x166)],_0x15feab[_0x45caea(0x160)]),{'verbose':_0x4925f1[_0x45caea(0x163)]}),_0x9d02b=_0x3bf9bf[_0x45caea(0x1a7)],_0x3ba1d8=await executeSchemaQuery(_0x9d02b,_0x3da760,_0x4925f1);return await handleQueryOutput(_0x3ba1d8,_0x4925f1),0x0;}catch(_0x144735){if(_0x144735 instanceof SDKError)return console['error']('Error:\x20'+_0x144735[_0x45caea(0x1e2)]),_0x144735[_0x45caea(0x1b7)]&&console['error'](_0x45caea(0x18a)+_0x144735[_0x45caea(0x1b7)]),0x1;throw _0x144735;}}}
@@ -1 +1 @@
1
- const a32_0x3b9f40=a32_0x391d;(function(_0x2c6f29,_0x274ac8){const _0x155214=a32_0x391d,_0x547b7b=_0x2c6f29();while(!![]){try{const _0x311f4f=parseInt(_0x155214(0x1bd))/0x1*(parseInt(_0x155214(0x1c8))/0x2)+-parseInt(_0x155214(0x1d9))/0x3+parseInt(_0x155214(0x1db))/0x4+parseInt(_0x155214(0x1be))/0x5+-parseInt(_0x155214(0x1c4))/0x6*(-parseInt(_0x155214(0x1d1))/0x7)+-parseInt(_0x155214(0x1da))/0x8+-parseInt(_0x155214(0x1bc))/0x9*(-parseInt(_0x155214(0x1ab))/0xa);if(_0x311f4f===_0x274ac8)break;else _0x547b7b['push'](_0x547b7b['shift']());}catch(_0x5b97e5){_0x547b7b['push'](_0x547b7b['shift']());}}}(a32_0x4cc2,0x87540));import{BaseCommand}from'./command.js';function a32_0x391d(_0x5b3a52,_0x46c9f2){_0x5b3a52=_0x5b3a52-0x1a8;const _0x4cc2a7=a32_0x4cc2();let _0x391d11=_0x4cc2a7[_0x5b3a52];return _0x391d11;}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a32_0x13c691 from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a32_0x3b9f40(0x1d5);[a32_0x3b9f40(0x1dc)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a32_0x3b9f40(0x1c3)](_0x2fa631){const _0x534626=a32_0x3b9f40;console[_0x534626(0x1c6)](a32_0x13c691['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x534626(0x1c6)](a32_0x13c691[_0x534626(0x1cb)](_0x534626(0x1b9)));const {options:_0x993faa,args:_0x9bc9a0,tdx:_0x341180}=_0x2fa631,_0x2ca7c6=_0x993faa;if(_0x9bc9a0[_0x534626(0x1b3)]===0x0)return console[_0x534626(0x1c6)](_0x534626(0x1cf)),console[_0x534626(0x1c6)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x534626(0x1c6)](_0x534626(0x1cc)),console[_0x534626(0x1c6)](_0x534626(0x1af)),console['error'](_0x534626(0x1ce)),console[_0x534626(0x1c6)](_0x534626(0x1b5)),0x1;const _0x4cc4ef=_0x9bc9a0[0x0],_0x49d5e2=_0x993faa['segmentPath'];let _0x2aeaab=_0x4cc4ef;_0x49d5e2&&!_0x4cc4ef[_0x534626(0x1d3)]('/')&&(_0x2aeaab=_0x49d5e2+'/'+_0x4cc4ef,_0x2ca7c6['verbose']&&console[_0x534626(0x1c6)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2aeaab));const _0x2bcd66=parsePath(_0x2aeaab);if(_0x2bcd66[_0x534626(0x1c7)][_0x534626(0x1b3)]<0x2)return console[_0x534626(0x1c6)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x534626(0x1c6)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x541ff0=_0x2bcd66['segments'][0x0],_0xbee0a7=getBaseName(_0x2aeaab),_0x510d03=getParentPath(_0x2aeaab);_0x2ca7c6['verbose']&&(console[_0x534626(0x1c6)](_0x534626(0x1c0)+_0x2ca7c6['site']),console[_0x534626(0x1c6)](_0x534626(0x1b8)+_0x2aeaab),console[_0x534626(0x1c6)](_0x534626(0x1a9)+_0x541ff0),console['error'](_0x534626(0x1bf)+_0xbee0a7),console['error'](_0x534626(0x1ad)+_0x510d03));const _0x480f2d=await withSpinner(_0x534626(0x1ae)+_0x541ff0+_0x534626(0x1ba),()=>_0x341180[_0x534626(0x1c1)][_0x534626(0x1b7)](_0x541ff0),{'verbose':_0x2ca7c6[_0x534626(0x1d6)]}),_0x2c2f5d=_0x480f2d[_0x534626(0x1d7)];let _0x2e4211;if(_0x2bcd66[_0x534626(0x1c7)][_0x534626(0x1b3)]>0x2){const _0x19b922=await withSpinner(_0x534626(0x1b2)+_0x510d03+_0x534626(0x1ba),()=>_0x341180['segment'][_0x534626(0x1bb)](_0x510d03),{'verbose':_0x2ca7c6['verbose']}),_0x947ef9=_0x19b922['data'];if(_0x947ef9['type']!==_0x534626(0x1aa)&&_0x947ef9[_0x534626(0x1d4)]!==_0x534626(0x1b1))return console['error'](_0x534626(0x1b0)),0x1;_0x2e4211=_0x947ef9[_0x534626(0x1ca)];}else{if(_0x2ca7c6[_0x534626(0x1aa)]){const _0x199d2f=await withSpinner(_0x534626(0x1cd)+_0x2ca7c6[_0x534626(0x1aa)]+_0x534626(0x1ba),()=>_0x341180['segment'][_0x534626(0x1b6)](_0x2c2f5d,_0x2ca7c6[_0x534626(0x1aa)]),{'verbose':_0x2ca7c6['verbose']});_0x2e4211=_0x199d2f[_0x534626(0x1d7)];}}_0x2ca7c6[_0x534626(0x1d6)]&&_0x2e4211&&console[_0x534626(0x1c6)]('Resolved\x20folder\x20ID:\x20'+_0x2e4211);const _0x49679a=await loadJSONFromOptions(_0x2ca7c6[_0x534626(0x1ac)],_0x2ca7c6[_0x534626(0x1c9)]),_0x28fc4c={'name':_0xbee0a7,'description':_0x2ca7c6[_0x534626(0x1dc)],'rule':_0x49679a,'kind':_0x2ca7c6[_0x534626(0x1c2)]!==undefined?parseInt(_0x2ca7c6[_0x534626(0x1c2)],0xa):undefined,'isVisible':_0x2ca7c6[_0x534626(0x1c5)]?![]:undefined,'segmentFolderId':_0x2e4211,'countPopulation':_0x2ca7c6[_0x534626(0x1d2)]?![]:undefined},_0x115143=await withSpinner('Creating\x20segment\x20\x27'+_0xbee0a7+_0x534626(0x1ba),()=>_0x341180[_0x534626(0x1c1)][_0x534626(0x1d0)](_0x2c2f5d,_0x28fc4c),{'verbose':_0x2ca7c6[_0x534626(0x1d6)]}),_0x4b2238=_0x115143[_0x534626(0x1d7)];return console[_0x534626(0x1c6)](_0x534626(0x1a8)+_0x4b2238[_0x534626(0x1b4)]+'\x27\x20with\x20ID:\x20'+_0x4b2238['id']),_0x2aeaab!==_0x4cc4ef&&console['error'](_0x534626(0x1d8)+_0x2aeaab),await handleSDKOutput([_0x4b2238],_0x2ca7c6),0x0;}}function a32_0x4cc2(){const _0x1e7e17=['Segment\x20name:\x20','Site:\x20','segment','kind','execute','5442VXRPkn','invisible','error','segments','2aLAHmL','ruleFile','folderId','yellow','Examples:','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','createSegment','1547YlFvDK','noCountPopulation','includes','type','segment:create','verbose','data','\x20\x20\x20Path:\x20','3191307NRHtGt','6551128omqBtg','3477088jQYUhR','description','✔\x20Created\x20segment\x20\x27','Parent:\x20','folder','80eokbLF','rule','Parent\x20path:\x20','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','parent','Resolving\x20folder\x20path\x20\x27','length','name','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','resolveFolderId','resolveParentId','Target\x20path:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x27...','resolvePathToResource','396009TRnmKr','123078OIqXCe','4460795yXihPJ'];a32_0x4cc2=function(){return _0x1e7e17;};return a32_0x4cc2();}
1
+ function a32_0x1067(){const _0x4cdfea=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','verbose','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','includes','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','36385QfPAwe','resolvePathToResource','invisible','✔\x20Created\x20segment\x20\x27','Resolved\x20relative\x20path\x20to:\x20','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','21616BYsmls','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20\x20Path:\x20','length','description','data','resolveParentId','Segment\x20name:\x20','Target\x20path:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','site','folder','segmentPath','segments','\x27...','Site:\x20','1682920svzLBP','Examples:','855822EGvNwi','segment:create','15FPEnuJ','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','1734056SzCRGo','name','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','yellow','error','parent','segment','folderId','1192158gtnFdl','Resolving\x20folder\x20\x27','noCountPopulation','resolveFolderId','Resolving\x20parent\x20segment\x20\x27','Parent\x20path:\x20','type','5FmfvlK','1528PRMqtX','18306GLywjH','execute'];a32_0x1067=function(){return _0x4cdfea;};return a32_0x1067();}const a32_0x35b131=a32_0x394b;(function(_0x1127a9,_0x13fefa){const _0x291ab5=a32_0x394b,_0x483654=_0x1127a9();while(!![]){try{const _0x2f99fb=parseInt(_0x291ab5(0x1b8))/0x1+parseInt(_0x291ab5(0x1e6))/0x2*(parseInt(_0x291ab5(0x1d3))/0x3)+parseInt(_0x291ab5(0x1d5))/0x4*(-parseInt(_0x291ab5(0x1e4))/0x5)+parseInt(_0x291ab5(0x1d1))/0x6+-parseInt(_0x291ab5(0x1bf))/0x7*(-parseInt(_0x291ab5(0x1e5))/0x8)+parseInt(_0x291ab5(0x1dd))/0x9+-parseInt(_0x291ab5(0x1cf))/0xa;if(_0x2f99fb===_0x13fefa)break;else _0x483654['push'](_0x483654['shift']());}catch(_0x10ddbe){_0x483654['push'](_0x483654['shift']());}}}(a32_0x1067,0x544a3));function a32_0x394b(_0x94cfb0,_0x15f901){_0x94cfb0=_0x94cfb0-0x1b2;const _0x1067e6=a32_0x1067();let _0x394bbf=_0x1067e6[_0x94cfb0];return _0x394bbf;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a32_0x1f7a91 from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a32_0x35b131(0x1d2);[a32_0x35b131(0x1c3)]=a32_0x35b131(0x1c8);async[a32_0x35b131(0x1b2)](_0x5a708a){const _0x4c3fcd=a32_0x35b131;console[_0x4c3fcd(0x1d9)](a32_0x1f7a91[_0x4c3fcd(0x1d8)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x4c3fcd(0x1d9)](a32_0x1f7a91[_0x4c3fcd(0x1d8)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x5975ed,args:_0x12886e,tdx:_0xb1186a}=_0x5a708a,_0x244a17=_0x5975ed;if(_0x12886e[_0x4c3fcd(0x1c2)]===0x0)return console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1d7)),console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1d4)),console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1d0)),console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1b3)),console['error'](_0x4c3fcd(0x1be)),console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1b5)),0x1;const _0x5d3ff0=_0x12886e[0x0],_0x4345da=_0x5975ed[_0x4c3fcd(0x1cb)];let _0x121dde=_0x5d3ff0;_0x4345da&&!_0x5d3ff0[_0x4c3fcd(0x1b6)]('/')&&(_0x121dde=_0x4345da+'/'+_0x5d3ff0,_0x244a17[_0x4c3fcd(0x1b4)]&&console['error'](_0x4c3fcd(0x1bc)+_0x121dde));const _0x571f11=parsePath(_0x121dde);if(_0x571f11['segments'][_0x4c3fcd(0x1c2)]<0x2)return console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1c0)),console[_0x4c3fcd(0x1d9)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x207893=_0x571f11['segments'][0x0],_0x29c65e=getBaseName(_0x121dde),_0x14f3c5=getParentPath(_0x121dde);_0x244a17['verbose']&&(console['error'](_0x4c3fcd(0x1ce)+_0x244a17[_0x4c3fcd(0x1c9)]),console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1c7)+_0x121dde),console[_0x4c3fcd(0x1d9)]('Parent:\x20'+_0x207893),console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1c6)+_0x29c65e),console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1e2)+_0x14f3c5));const _0x2e7111=await withSpinner(_0x4c3fcd(0x1e1)+_0x207893+_0x4c3fcd(0x1cd),()=>_0xb1186a[_0x4c3fcd(0x1db)][_0x4c3fcd(0x1c5)](_0x207893),{'verbose':_0x244a17['verbose']}),_0x9dc0f4=_0x2e7111[_0x4c3fcd(0x1c4)];let _0x2584b4;if(_0x571f11[_0x4c3fcd(0x1cc)][_0x4c3fcd(0x1c2)]>0x2){const _0x25573d=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x14f3c5+_0x4c3fcd(0x1cd),()=>_0xb1186a['segment'][_0x4c3fcd(0x1b9)](_0x14f3c5),{'verbose':_0x244a17[_0x4c3fcd(0x1b4)]}),_0x5aea10=_0x25573d[_0x4c3fcd(0x1c4)];if(_0x5aea10['type']!==_0x4c3fcd(0x1ca)&&_0x5aea10[_0x4c3fcd(0x1e3)]!==_0x4c3fcd(0x1da))return console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1b7)),0x1;_0x2584b4=_0x5aea10[_0x4c3fcd(0x1dc)];}else{if(_0x244a17['folder']){const _0x16a269=await withSpinner(_0x4c3fcd(0x1de)+_0x244a17[_0x4c3fcd(0x1ca)]+_0x4c3fcd(0x1cd),()=>_0xb1186a[_0x4c3fcd(0x1db)][_0x4c3fcd(0x1e0)](_0x9dc0f4,_0x244a17['folder']),{'verbose':_0x244a17['verbose']});_0x2584b4=_0x16a269[_0x4c3fcd(0x1c4)];}}_0x244a17[_0x4c3fcd(0x1b4)]&&_0x2584b4&&console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1bd)+_0x2584b4);const _0x3356d0=await loadJSONFromOptions(_0x244a17['rule'],_0x244a17['ruleFile']),_0x1af0ee={'name':_0x29c65e,'description':_0x244a17[_0x4c3fcd(0x1c3)],'rule':_0x3356d0,'kind':_0x244a17['kind']!==undefined?parseInt(_0x244a17['kind'],0xa):undefined,'isVisible':_0x244a17[_0x4c3fcd(0x1ba)]?![]:undefined,'segmentFolderId':_0x2584b4,'countPopulation':_0x244a17[_0x4c3fcd(0x1df)]?![]:undefined},_0x54e966=await withSpinner('Creating\x20segment\x20\x27'+_0x29c65e+_0x4c3fcd(0x1cd),()=>_0xb1186a[_0x4c3fcd(0x1db)]['createSegment'](_0x9dc0f4,_0x1af0ee),{'verbose':_0x244a17[_0x4c3fcd(0x1b4)]}),_0x32a3ae=_0x54e966[_0x4c3fcd(0x1c4)];return console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1bb)+_0x32a3ae[_0x4c3fcd(0x1d6)]+'\x27\x20with\x20ID:\x20'+_0x32a3ae['id']),_0x121dde!==_0x5d3ff0&&console[_0x4c3fcd(0x1d9)](_0x4c3fcd(0x1c1)+_0x121dde),await handleSDKOutput([_0x32a3ae],_0x244a17),0x0;}}
@@ -1 +1 @@
1
- const a33_0x5ea83a=a33_0x38db;(function(_0x31bd8c,_0x126a44){const _0x29fca9=a33_0x38db,_0x3a402f=_0x31bd8c();while(!![]){try{const _0x4b0566=-parseInt(_0x29fca9(0x1db))/0x1+-parseInt(_0x29fca9(0x1d7))/0x2*(-parseInt(_0x29fca9(0x1d6))/0x3)+-parseInt(_0x29fca9(0x1e5))/0x4*(-parseInt(_0x29fca9(0x1d5))/0x5)+parseInt(_0x29fca9(0x1e6))/0x6+parseInt(_0x29fca9(0x1e3))/0x7+-parseInt(_0x29fca9(0x1d4))/0x8*(parseInt(_0x29fca9(0x1e2))/0x9)+parseInt(_0x29fca9(0x1e7))/0xa*(parseInt(_0x29fca9(0x1d9))/0xb);if(_0x4b0566===_0x126a44)break;else _0x3a402f['push'](_0x3a402f['shift']());}catch(_0x9c19ce){_0x3a402f['push'](_0x3a402f['shift']());}}}(a33_0x6251,0x81259));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a33_0x6251(){const _0x118644=['\x27...','name','listFields','segment:fields','error','description','1054712cpFeau','250NfnZdI','56274jOatAj','10csXxUq','parentSegment','4653umAxPc','jsonl','527006YUPVeq','Error:\x20Parent\x20segment\x20name\x20is\x20required','Site:\x20','length','data','verbose','\x20field','45EKaqMz','2278255YAoyjU','site','45996nRyYoy','422442qZCXJm','15380MVndin','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','segment','✔\x20Found\x20'];a33_0x6251=function(){return _0x118644;};return a33_0x6251();}import{withSpinner}from'../utils/spinner.js';function a33_0x38db(_0x162974,_0x2df9d3){_0x162974=_0x162974-0x1cd;const _0x62514d=a33_0x6251();let _0x38db60=_0x62514d[_0x162974];return _0x38db60;}import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a33_0x5ea83a(0x1cf)]=a33_0x5ea83a(0x1d1);[a33_0x5ea83a(0x1d3)]='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x153999){const _0x474a58=a33_0x5ea83a,{options:_0x484062,args:_0x42fae1,tdx:_0x5e73a7}=_0x153999,_0x5c9040=_0x42fae1[0x0]||_0x484062[_0x474a58(0x1d8)];if(!_0x5c9040)return console[_0x474a58(0x1d2)](_0x474a58(0x1dc)),console[_0x474a58(0x1d2)](_0x474a58(0x1e8)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x484062[_0x474a58(0x1e0)]&&(console['error'](_0x474a58(0x1dd)+_0x484062[_0x474a58(0x1e4)]),console['error']('Parent\x20segment:\x20'+_0x5c9040));const _0x572bc4=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x5c9040+_0x474a58(0x1ce),()=>_0x5e73a7[_0x474a58(0x1e9)][_0x474a58(0x1d0)](_0x5c9040),{'verbose':_0x484062[_0x474a58(0x1e0)]}),_0x2764d2=_0x572bc4[_0x474a58(0x1df)];console[_0x474a58(0x1d2)](_0x474a58(0x1cd)+_0x2764d2[_0x474a58(0x1de)]+_0x474a58(0x1e1)+(_0x2764d2['length']!==0x1?'s':''));if(_0x484062['json']||_0x484062[_0x474a58(0x1da)])return await handleSDKOutput(_0x2764d2,_0x484062),0x0;return displayFieldsHumanReadable(_0x2764d2,_0x5c9040),0x0;}}
1
+ const a33_0x3cd7a6=a33_0x3f76;(function(_0x2d25fb,_0x3b070a){const _0x3a4646=a33_0x3f76,_0x26eb11=_0x2d25fb();while(!![]){try{const _0x305d67=parseInt(_0x3a4646(0xba))/0x1*(parseInt(_0x3a4646(0xca))/0x2)+parseInt(_0x3a4646(0xb9))/0x3*(parseInt(_0x3a4646(0xc0))/0x4)+parseInt(_0x3a4646(0xc8))/0x5*(parseInt(_0x3a4646(0xb8))/0x6)+parseInt(_0x3a4646(0xcb))/0x7+parseInt(_0x3a4646(0xc6))/0x8+-parseInt(_0x3a4646(0xc7))/0x9+parseInt(_0x3a4646(0xd0))/0xa*(-parseInt(_0x3a4646(0xc5))/0xb);if(_0x305d67===_0x3b070a)break;else _0x26eb11['push'](_0x26eb11['shift']());}catch(_0x5ca606){_0x26eb11['push'](_0x26eb11['shift']());}}}(a33_0x3593,0xa16ce));function a33_0x3f76(_0x5f2b1e,_0x12f1f4){_0x5f2b1e=_0x5f2b1e-0xb8;const _0x3593c5=a33_0x3593();let _0x3f76b4=_0x3593c5[_0x5f2b1e];return _0x3f76b4;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a33_0x3cd7a6(0xd6);[a33_0x3cd7a6(0xbd)]=a33_0x3cd7a6(0xbc);async[a33_0x3cd7a6(0xbb)](_0x3d0b2c){const _0x495a97=a33_0x3cd7a6,{options:_0x33557d,args:_0x5b5c2a,tdx:_0x3e3c7a}=_0x3d0b2c,_0x12945a=_0x5b5c2a[0x0]||_0x33557d[_0x495a97(0xbf)];if(!_0x12945a)return console[_0x495a97(0xbe)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x495a97(0xbe)](_0x495a97(0xd5)),console[_0x495a97(0xbe)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x33557d['verbose']&&(console[_0x495a97(0xbe)](_0x495a97(0xcd)+_0x33557d[_0x495a97(0xc4)]),console[_0x495a97(0xbe)](_0x495a97(0xcc)+_0x12945a));const _0x3f999c=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x12945a+_0x495a97(0xd1),()=>_0x3e3c7a[_0x495a97(0xcf)][_0x495a97(0xd4)](_0x12945a),{'verbose':_0x33557d[_0x495a97(0xce)]}),_0x2b176e=_0x3f999c[_0x495a97(0xc9)];console['error'](_0x495a97(0xc3)+_0x2b176e[_0x495a97(0xc1)]+_0x495a97(0xd3)+(_0x2b176e[_0x495a97(0xc1)]!==0x1?'s':''));if(_0x33557d[_0x495a97(0xc2)]||_0x33557d[_0x495a97(0xd2)])return await handleSDKOutput(_0x2b176e,_0x33557d),0x0;return displayFieldsHumanReadable(_0x2b176e,_0x12945a),0x0;}}function a33_0x3593(){const _0x48d338=['5823881GQgZEa','Parent\x20segment:\x20','Site:\x20','verbose','segment','8230aVklDx','\x27...','jsonl','\x20field','listFields','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','segment:fields','6qoMbLx','1662HnPXbl','5LSlFEI','execute','List\x20available\x20fields\x20for\x20segmentation','description','error','parentSegment','5816vzjktb','length','json','✔\x20Found\x20','site','26026SJSyuQ','2948088aKKeck','3365622bwzekM','4422445LFfGlI','data','36750IJzCdq'];a33_0x3593=function(){return _0x48d338;};return a33_0x3593();}