@treasuredata/tdx 0.8.0 → 0.8.2

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 (125) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/engage-api-client.js +1 -1
  9. package/dist/client/http-client.js +1 -1
  10. package/dist/client/llm-api-client.js +1 -1
  11. package/dist/client/rate-limiter.js +1 -1
  12. package/dist/client/td-api-client.d.ts +2 -0
  13. package/dist/client/td-api-client.d.ts.map +1 -1
  14. package/dist/client/td-api-client.js +1 -1
  15. package/dist/client/td-api-client.js.map +1 -1
  16. package/dist/client/trino-api-client.js +1 -1
  17. package/dist/client/workflow-client.js +1 -1
  18. package/dist/commands/activations.js +1 -1
  19. package/dist/commands/api-command.js +1 -1
  20. package/dist/commands/auth-command.js +1 -1
  21. package/dist/commands/chat-command.js +1 -1
  22. package/dist/commands/claude-command.d.ts.map +1 -1
  23. package/dist/commands/claude-command.js +1 -1
  24. package/dist/commands/claude-command.js.map +1 -1
  25. package/dist/commands/claude-statusline-command.d.ts +1 -1
  26. package/dist/commands/claude-statusline-command.d.ts.map +1 -1
  27. package/dist/commands/claude-statusline-command.js +1 -1
  28. package/dist/commands/claude-statusline-command.js.map +1 -1
  29. package/dist/commands/claude-usage-command.js +1 -1
  30. package/dist/commands/command.js +1 -1
  31. package/dist/commands/connection-command.js +1 -1
  32. package/dist/commands/context-command.js +1 -1
  33. package/dist/commands/databases.js +1 -1
  34. package/dist/commands/describe.js +1 -1
  35. package/dist/commands/engage-command.js +1 -1
  36. package/dist/commands/job-command.js +1 -1
  37. package/dist/commands/llm-command.js +1 -1
  38. package/dist/commands/llm-proxy.js +1 -1
  39. package/dist/commands/parent-segment-command.js +1 -1
  40. package/dist/commands/profiles-command.js +1 -1
  41. package/dist/commands/query-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-pull-command.js +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/config.d.ts +26 -0
  57. package/dist/core/config.d.ts.map +1 -1
  58. package/dist/core/config.js +1 -1
  59. package/dist/core/config.js.map +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/credential-cache.js +1 -1
  62. package/dist/core/global-context.js +1 -1
  63. package/dist/core/keychain.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/index.js +1 -1
  69. package/dist/proxy/anthropic-adapter.js +1 -1
  70. package/dist/proxy/claude-usage-tracker.js +1 -1
  71. package/dist/proxy/context-signature.js +1 -1
  72. package/dist/proxy/conversation-utils.js +1 -1
  73. package/dist/proxy/server.js +1 -1
  74. package/dist/proxy/session-cache.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/connection.js +1 -1
  77. package/dist/sdk/engage.js +1 -1
  78. package/dist/sdk/errors.js +1 -1
  79. package/dist/sdk/index.js +1 -1
  80. package/dist/sdk/job.js +1 -1
  81. package/dist/sdk/llm.js +1 -1
  82. package/dist/sdk/query.js +1 -1
  83. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  84. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  85. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  86. package/dist/sdk/segment.js +1 -1
  87. package/dist/sdk/user.js +1 -1
  88. package/dist/sdk/workflow.js +1 -1
  89. package/dist/types/endpoints.js +1 -1
  90. package/dist/types/index.d.ts +20 -1
  91. package/dist/types/index.d.ts.map +1 -1
  92. package/dist/types/index.js +1 -1
  93. package/dist/types/index.js.map +1 -1
  94. package/dist/utils/agent-ref-parser.js +1 -1
  95. package/dist/utils/async.js +1 -1
  96. package/dist/utils/chat-cache.js +1 -1
  97. package/dist/utils/colors.js +1 -1
  98. package/dist/utils/command-output.js +1 -1
  99. package/dist/utils/constants.js +1 -1
  100. package/dist/utils/diff.js +1 -1
  101. package/dist/utils/fields-display.js +1 -1
  102. package/dist/utils/file-permissions.js +1 -1
  103. package/dist/utils/format-detector.js +1 -1
  104. package/dist/utils/formatters.js +1 -1
  105. package/dist/utils/json-loader.js +1 -1
  106. package/dist/utils/llm-backup-utils.js +1 -1
  107. package/dist/utils/model-aliases.js +1 -1
  108. package/dist/utils/model-factors.js +1 -1
  109. package/dist/utils/option-validation.js +1 -1
  110. package/dist/utils/port.js +1 -1
  111. package/dist/utils/process.js +1 -1
  112. package/dist/utils/prompt.js +1 -1
  113. package/dist/utils/segment-path-parser.js +1 -1
  114. package/dist/utils/segment-ref-parser.js +1 -1
  115. package/dist/utils/spinner.js +1 -1
  116. package/dist/utils/sql-parser.js +1 -1
  117. package/dist/utils/sse-parser.js +1 -1
  118. package/dist/utils/string-utils.js +1 -1
  119. package/dist/utils/table-ref-parser.js +1 -1
  120. package/dist/utils/tdx-config.js +1 -1
  121. package/dist/utils/tdx-logger.js +1 -1
  122. package/dist/utils/tree-formatter.js +1 -1
  123. package/dist/utils/version-check.js +1 -1
  124. package/dist/utils/workflow-utils.js +1 -1
  125. package/package.json +1 -1
@@ -1 +1 @@
1
- const a27_0x4dd8e0=a27_0xfc7f;(function(_0x1064b3,_0x39236f){const _0x126fca=a27_0xfc7f,_0x466e98=_0x1064b3();while(!![]){try{const _0x56f840=parseInt(_0x126fca(0x13e))/0x1+parseInt(_0x126fca(0x1bf))/0x2+parseInt(_0x126fca(0x217))/0x3*(parseInt(_0x126fca(0x24a))/0x4)+parseInt(_0x126fca(0x136))/0x5+parseInt(_0x126fca(0x189))/0x6*(parseInt(_0x126fca(0x17e))/0x7)+parseInt(_0x126fca(0x1eb))/0x8+-parseInt(_0x126fca(0x18f))/0x9*(parseInt(_0x126fca(0x150))/0xa);if(_0x56f840===_0x39236f)break;else _0x466e98['push'](_0x466e98['shift']());}catch(_0x46fb93){_0x466e98['push'](_0x466e98['shift']());}}}(a27_0x201c,0x496a2));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a27_0xb78e46 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';function a27_0xfc7f(_0xdc981f,_0x529d70){_0xdc981f=_0xdc981f-0x12f;const _0x201cd0=a27_0x201c();let _0xfc7fbb=_0x201cd0[_0xdc981f];return _0xfc7fbb;}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 a27_0x580f47 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a27_0x4dd8e0(0x1c5),LEGACY_PARENT_SEGMENT_DIR=a27_0x4dd8e0(0x148);function openBrowser(_0x18eaba){const _0x16dc34=a27_0x4dd8e0,_0x37a571=process[_0x16dc34(0x141)],_0x6a6145=_0x37a571===_0x16dc34(0x1d0)?_0x16dc34(0x239):_0x37a571===_0x16dc34(0x1ca)?_0x16dc34(0x1f8):_0x16dc34(0x16f);spawn(_0x6a6145,[_0x18eaba],{'detached':!![],'stdio':_0x16dc34(0x201)})['unref']();}function sanitizeFileName(_0x568bf7){const _0x5a9bb9=a27_0x4dd8e0;return _0x568bf7[_0x5a9bb9(0x15b)]()['replace'](/[/\\:*?"<>|]/g,'-')[_0x5a9bb9(0x1b6)](/\s+/g,'-')[_0x5a9bb9(0x1b6)](/-+/g,'-')[_0x5a9bb9(0x1b6)](/^-|-$/g,'');}function migrateLegacyDirectory(){const _0x207487=a27_0x4dd8e0;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x18ec75=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x18ec75['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x207487(0x146)](a27_0x580f47[_0x207487(0x1ab)](_0x207487(0x23a)+LEGACY_PARENT_SEGMENT_DIR+_0x207487(0x132)+PARENT_SEGMENT_DIR+_0x207487(0x159))),console[_0x207487(0x146)](a27_0x580f47[_0x207487(0x206)](_0x207487(0x139)+LEGACY_PARENT_SEGMENT_DIR+_0x207487(0x195))),![];console[_0x207487(0x146)](a27_0x580f47[_0x207487(0x1ab)](_0x207487(0x1ad)+LEGACY_PARENT_SEGMENT_DIR+_0x207487(0x21b)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x207487(0x146)](a27_0x580f47[_0x207487(0x1f1)](_0x207487(0x223)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x32bfce){const _0x264ea1=_0x32bfce instanceof Error?_0x32bfce['message']:String(_0x32bfce);return console[_0x207487(0x146)](a27_0x580f47[_0x207487(0x24c)](_0x207487(0x1df)+_0x264ea1+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a27_0x4dd8e0(0x13f)](_0x38cdef){const _0x52fc88=a27_0x4dd8e0;return migrateLegacyDirectory(),super[_0x52fc88(0x13f)](_0x38cdef);}}function resolveYamlFile(_0x3a7706){const _0x4626f6=a27_0x4dd8e0;if(_0x3a7706[_0x4626f6(0x1fc)](_0x4626f6(0x1b9))||_0x3a7706[_0x4626f6(0x1fc)](_0x4626f6(0x16e)))return _0x3a7706;return a27_0xb78e46['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3a7706)+_0x4626f6(0x1b9));}function formatProgressMessage(_0x46e5b6){const _0x446e3e=a27_0x4dd8e0,_0x359c5c=_0x46e5b6[_0x446e3e(0x186)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x359c5c){const [,_0x365380,_0x5741ae,_0x124ddb='']=_0x359c5c;return a27_0x580f47[_0x446e3e(0x206)](_0x365380+':')+'\x20'+_0x5741ae+a27_0x580f47[_0x446e3e(0x206)](_0x124ddb);}return a27_0x580f47['dim'](_0x46e5b6);}function showFileNotFoundError(_0xccaf5e,_0x480dbf){const _0x55e1d5=a27_0x4dd8e0;console[_0x55e1d5(0x146)](a27_0x580f47[_0x55e1d5(0x24c)](_0x55e1d5(0x24d)+_0xccaf5e+'\x0a')),console['error'](a27_0x580f47[_0x55e1d5(0x1c2)](_0x55e1d5(0x1a1)+_0x480dbf+_0x55e1d5(0x15d)));}export class ParentSegmentListCommand extends BaseCommand{[a27_0x4dd8e0(0x210)]=a27_0x4dd8e0(0x174);[a27_0x4dd8e0(0x21f)]=a27_0x4dd8e0(0x218);async[a27_0x4dd8e0(0x165)](_0x24673e){const _0x17abde=a27_0x4dd8e0,{options:_0x517c2d,args:_0x18c46d,tdx:_0x2aa3a2}=_0x24673e,_0x5cacfb=_0x18c46d[0x0];_0x517c2d[_0x17abde(0x23b)]&&(console[_0x17abde(0x146)](_0x17abde(0x1f9)+_0x517c2d['site']),_0x5cacfb&&console[_0x17abde(0x146)](_0x17abde(0x234)+_0x5cacfb));const _0x2bf7ab=await withSpinner(_0x5cacfb?_0x17abde(0x184)+_0x5cacfb+_0x17abde(0x23f):'Listing\x20parent\x20segments...',()=>_0x2aa3a2[_0x17abde(0x13d)][_0x17abde(0x1e3)](),{'verbose':_0x517c2d[_0x17abde(0x23b)]});let _0x3bd33d=_0x2bf7ab['data'];if(_0x5cacfb){const _0x510290=_0x5cacfb['replace'](/[.+^${}()|[\]\\]/g,_0x17abde(0x18d))[_0x17abde(0x1b6)](/\*/g,'.*')[_0x17abde(0x1b6)](/\?/g,'.'),_0x5ab119=new RegExp('^'+_0x510290+'$','i');_0x3bd33d=_0x3bd33d[_0x17abde(0x222)](_0x2ccdc8=>_0x5ab119[_0x17abde(0x196)](_0x2ccdc8[_0x17abde(0x1db)]['name']));}_0x3bd33d[_0x17abde(0x1dc)]((_0x4e9ea1,_0x16349d)=>_0x4e9ea1['attributes'][_0x17abde(0x210)][_0x17abde(0x142)](_0x16349d[_0x17abde(0x1db)]['name'])),console[_0x17abde(0x146)](_0x17abde(0x1b5)+_0x3bd33d[_0x17abde(0x24f)]+'\x20parent\x20segment'+(_0x3bd33d[_0x17abde(0x24f)]!==0x1?'s':''));if(_0x517c2d['format']==='json'||_0x517c2d['format']===_0x17abde(0x23d))await handleSDKOutput(_0x3bd33d,_0x517c2d);else{if(_0x3bd33d[_0x17abde(0x24f)]===0x0)_0x5cacfb?console[_0x17abde(0x20d)](_0x17abde(0x173)+_0x5cacfb):console[_0x17abde(0x20d)](_0x17abde(0x212));else for(const _0x3ba98d of _0x3bd33d){const _0x2fff51=_0x3ba98d[_0x17abde(0x1db)][_0x17abde(0x230)]?a27_0x580f47[_0x17abde(0x206)]('\x20('+formatRows(_0x3ba98d[_0x17abde(0x1db)][_0x17abde(0x230)])+')'):'';console[_0x17abde(0x20d)]('👥\x20'+_0x3ba98d[_0x17abde(0x1db)][_0x17abde(0x210)]+_0x2fff51);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a27_0x4dd8e0(0x210)]=a27_0x4dd8e0(0x156);[a27_0x4dd8e0(0x21f)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a27_0x4dd8e0(0x165)](_0x2d327a){const _0x1753d9=a27_0x4dd8e0,{options:_0x4ea227,args:_0x355dcc,tdx:_0x74fc76}=_0x2d327a;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x46d44b=_0x4ea227;if(_0x355dcc[_0x1753d9(0x24f)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x1753d9(0x146)](_0x1753d9(0x22c)),0x1;const _0x1fb6e4=_0x355dcc[0x0];if(!_0x46d44b[_0x1753d9(0x14d)]||!_0x46d44b['table'])return console[_0x1753d9(0x146)](_0x1753d9(0x182)),console[_0x1753d9(0x146)](_0x1753d9(0x22c)),0x1;_0x46d44b[_0x1753d9(0x23b)]&&(console[_0x1753d9(0x146)](_0x1753d9(0x1f9)+_0x46d44b[_0x1753d9(0x17f)]),console[_0x1753d9(0x146)]('Name:\x20'+_0x1fb6e4),console['error']('Database:\x20'+_0x46d44b[_0x1753d9(0x14d)]),console[_0x1753d9(0x146)](_0x1753d9(0x153)+_0x46d44b[_0x1753d9(0x1cc)]));const _0x2e70eb=await loadJSONFromOptions(_0x46d44b[_0x1753d9(0x1db)],_0x46d44b['attributesFile']),_0x4e0ffb=await loadJSONFromOptions(_0x46d44b['behaviors'],_0x46d44b['behaviorsFile']),_0x27882e=await loadJSONFromOptions(_0x46d44b['customerGroup'],_0x46d44b[_0x1753d9(0x211)]),_0x2ea061={'name':_0x1fb6e4,'description':_0x46d44b['description'],'scheduleType':_0x46d44b[_0x1753d9(0x1e4)],'scheduleOption':_0x46d44b[_0x1753d9(0x164)],'timezone':_0x46d44b[_0x1753d9(0x1d3)],'master':{'parentDatabaseName':_0x46d44b[_0x1753d9(0x14d)],'parentTableName':_0x46d44b[_0x1753d9(0x1cc)]},'attributes':_0x2e70eb,'behaviors':_0x4e0ffb,'customerGroup':_0x27882e},_0x1edd9b=await withSpinner(_0x1753d9(0x12f)+_0x1fb6e4+'\x27...',()=>_0x74fc76[_0x1753d9(0x13d)][_0x1753d9(0x13b)](_0x2ea061),{'verbose':_0x4ea227[_0x1753d9(0x23b)]}),_0x59a7e1=_0x1edd9b[_0x1753d9(0x1e0)];return console[_0x1753d9(0x146)](_0x1753d9(0x14b)+_0x59a7e1[_0x1753d9(0x210)]+'\x27\x20with\x20ID:\x20'+_0x59a7e1['id']),await handleSDKOutput([_0x59a7e1],_0x4ea227),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a27_0x4dd8e0(0x210)]='segment:parent:update';[a27_0x4dd8e0(0x21f)]=a27_0x4dd8e0(0x1bd);async['execute'](_0x1dee90){const _0x1a4b8b=a27_0x4dd8e0,{options:_0x1f3ec2,args:_0x1fb267,tdx:_0x1f958f}=_0x1dee90;console[_0x1a4b8b(0x146)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x1a4b8b(0x20e)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x5ef48e=_0x1f3ec2;if(_0x1fb267[_0x1a4b8b(0x24f)]===0x0)return console['error'](_0x1a4b8b(0x23c)),console['error'](_0x1a4b8b(0x1e1)),0x1;const _0x25fd38=_0x1fb267[0x0];_0x5ef48e[_0x1a4b8b(0x23b)]&&(console[_0x1a4b8b(0x146)](_0x1a4b8b(0x1f9)+_0x5ef48e['site']),console[_0x1a4b8b(0x146)](_0x1a4b8b(0x14e)+_0x25fd38));const _0x8b36d5=await withSpinner(_0x1a4b8b(0x133)+_0x25fd38+'\x27...',()=>_0x1f958f[_0x1a4b8b(0x13d)][_0x1a4b8b(0x19e)](_0x25fd38),{'verbose':_0x5ef48e[_0x1a4b8b(0x23b)]}),_0x475f84=_0x8b36d5[_0x1a4b8b(0x1e0)],_0x4b27d0=await loadJSONFromOptions(_0x5ef48e['addAttributes'],_0x5ef48e[_0x1a4b8b(0x1e8)]),_0x44315a=await loadJSONFromOptions(_0x5ef48e['addBehaviors'],_0x5ef48e['addBehaviorsFile']),_0x49df7e={'name':_0x475f84[_0x1a4b8b(0x210)],'description':_0x5ef48e['description']!==undefined?_0x5ef48e['description']:_0x475f84[_0x1a4b8b(0x21f)],'scheduleType':_0x5ef48e[_0x1a4b8b(0x1e4)]!==undefined?_0x5ef48e[_0x1a4b8b(0x1e4)]:_0x475f84[_0x1a4b8b(0x1e4)],'scheduleOption':_0x5ef48e[_0x1a4b8b(0x164)]!==undefined?_0x5ef48e[_0x1a4b8b(0x164)]:_0x475f84[_0x1a4b8b(0x164)],'timezone':_0x5ef48e[_0x1a4b8b(0x1d3)]!==undefined?_0x5ef48e[_0x1a4b8b(0x1d3)]:_0x475f84[_0x1a4b8b(0x1d3)],'master':_0x475f84[_0x1a4b8b(0x235)],'attributes':_0x4b27d0?[..._0x475f84['attributes']||[],..._0x4b27d0]:_0x475f84[_0x1a4b8b(0x1db)],'behaviors':_0x44315a?[..._0x475f84[_0x1a4b8b(0x197)]||[],..._0x44315a]:_0x475f84['behaviors'],'customerGroup':_0x475f84[_0x1a4b8b(0x14c)]},_0x37a968=await withSpinner(_0x1a4b8b(0x19d)+_0x25fd38+_0x1a4b8b(0x23f),()=>_0x1f958f[_0x1a4b8b(0x13d)]['updateParent'](_0x25fd38,_0x49df7e),{'verbose':_0x5ef48e['verbose']}),_0x4b814e=_0x37a968['data'];return console[_0x1a4b8b(0x146)](_0x1a4b8b(0x15a)+_0x4b814e[_0x1a4b8b(0x210)]+'\x27'),await handleSDKOutput([_0x4b814e],_0x5ef48e),0x0;}}function a27_0x201c(){const _0x1f9f9b=['varchar','start','Site:\x20','limit','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','endsWith','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x0aChanges\x20to\x20\x27','Options:','text','ignore','Validating\x20configuration...','use','/app/workflows/','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','dim','Source:','format','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','rowCount','\x20Opening\x20','matchedCount','log','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','segment:parent:preview','name','customerGroupFile','No\x20parent\x20segments\x20found','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first','schemaValid','keys','Coverage:','159nCmvTO','List\x20parent\x20segments','\x0aNo\x20sample\x20data\x20available','schemaError','/\x20→\x20','Options\x20(one\x20required):','\x20tdx\x20wf\x20attempt\x20','errors','description','output','FINISHED','filter','✔\x20Renamed\x20directory\x20to\x20','Error:\x20--behavior\x20requires\x20a\x20name\x0a','displaySummary','enriched','\x20--enriched','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Usage:\x20tdx\x20ps\x20show\x20[name]\x0a','toLocaleString','displayValidateResults','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','YAML\x20file:\x20','json','/app/dw/parentSegments/','population','Listing\x20fields\x20for\x20\x27','Apply\x20changes\x20to\x20\x27','segment:parent:sql','Pattern:\x20','master','\x27\x20and\x20run\x20workflow?','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','segment:parent:view','open','\x0a⚠️\x20\x20Both\x20','verbose','Error:\x20Parent\x20segment\x20name\x20is\x20required','jsonl','Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a','\x27...','-1d','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a','displayBehaviorsStats','segment:parent:fields','Enriched:','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','\x20--behavior\x20\x22<name>\x22','\x20--attribute\x20\x22<name>\x22','validateParentYaml','5660eBfntD','resolveParentId','red','Error:\x20File\x20not\x20found:\x20','\x27\x20is\x20up\x20to\x20date','length','interval','\x0aChanges\x20to\x20apply\x20to\x20\x27','using\x20the\x20default\x20path:\x20','double','stats','displayAttributesStats','Creating\x20parent\x20segment\x20\x27','\x0aNew\x20parent\x20segment\x20\x27','List\x20available\x20fields\x20for\x20segmentation','/\x20and\x20','Fetching\x20current\x20configuration\x20for\x20\x27','\x27\x20is\x20already\x20up\x20to\x20date','Validate:','779950HkwnmO','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','✔\x20No\x20changes\x20-\x20\x27','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Events:','createParent','displayMasterInfo','segment','177144HLSJcr','run','\x20Configuration\x20is\x20valid','platform','localeCompare','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','segment:parent:validate','\x20--interval\x20','error','%)\x20','parent_segment','SQL\x20query:\x0a','To\x20cancel:','✔\x20Created\x20parent\x20segment\x20\x27','customerGroup','database','Parent\x20segment:\x20','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)','15646450QIuCiU','segment:parent:show','stop','Table:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','elapsedTimeMillis','segment:parent:create','pullParentYaml','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','/\x20directories\x20exist.','✔\x20Updated\x20parent\x20segment\x20\x27','toLowerCase','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','`\x20to\x20download\x20the\x20configuration\x20first','message','\x20[Job\x20ID:\x20','Columns:','/{name}.yml\x0a','session','Master\x20+\x20Attributes','scheduleOption','execute','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x20Context\x20set:\x20','\x20\x20\x20\x20-\x20','dirname','Join\x20on:','map','Fetching\x20SQL\x20for\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','.yaml','xdg-open','\x20--behavior\x20\x22','parentSegment','string','No\x20parent\x20segments\x20match\x20pattern:\x20','segment:parent:list','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','pushParentYaml','bold','displaySampleData','segment:parent:run','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Executing\x20parent\x20segment\x20query...','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20rows)','7HnoKwp','site','\x20--attribute\x20\x22','allValid','Error:\x20--database\x20and\x20--table\x20are\x20required','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Listing\x20parent\x20segments\x20matching\x20\x27','processedRows','match','Attribute:','toFixed','3517854UXOoKZ','displayPreviewResults','workflowSessionId','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','\x5c$&','✔\x20Query\x20completed:\x20Processed\x20','9yvTOhx','Behavior:','Attempt:','Error\x20reading\x20file:\x20','Behaviors','\x20parent\x20segment\x20\x27','/\x20directory.\x0a','test','behaviors','customerPercent','query','getParentSQL','Status:','behavior','Updating\x20parent\x20segment\x20\x27','getParentFull','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','trim','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','setJobId','listFields','Analyzing\x20changes...','\x20\x20No\x20sample\x20data\x20available','\x20No\x20changes\x20-\x20','Created','Aborted.','Preview:','Found\x20YAML\x20file:\x20','yellow','all','\x0a⚠️\x20\x20Migrating:\x20','Error:\x20--attribute\x20requires\x20a\x20name\x0a','foreignKey','\x20field','workflowId','tdx\x20segment\x20parent\x20preview\x20','Attributes','jobId','✔\x20Found\x20','replace','columns','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','.yml','segment:parent:push','coveragePercent','customersWithEvents','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','1129020mkDyWJ','Customers:','yes','cyan','Create\x20parent\x20segment\x20\x27','previewParentYaml','parent_segments','Available\x20behaviors:','column','SELECT\x20*\x20FROM\x20(\x0a','displayColumns','win32','Creating','table','Output\x20file:\x20','apply','joinKey','darwin','repeat','\x20=\x20','timezone','totalEvents','sampleData','Join:','Errors:','attribute','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','label','attributes','sort','\x0a✔\x20Workflow\x20started','preview','✘\x20Failed\x20to\x20rename\x20directory:\x20','data','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','displayPreviewHints','listParents','scheduleType','Get\x20SQL\x20query\x20for\x20parent\x20segment','information_schema','Show\x20parent\x20segment\x20details','addAttributesFile','Resolving\x20parent\x20segment\x20\x27','Updated','2451224YByohH','\x20kill','utf-8','Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a','Fetching\x20parent\x20segment\x20\x27','status','green','\x0aUsage:\x20tdx\x20ps\x20preview\x20','workflowAttemptId','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Error:','To\x20view\x20sample\x20data:'];a27_0x201c=function(){return _0x1f9f9b;};return a27_0x201c();}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a27_0x4dd8e0(0x210)]='segment:parent:pull';[a27_0x4dd8e0(0x21f)]=a27_0x4dd8e0(0x1fd);async['execute'](_0x2b1be8){const _0x262cb0=a27_0x4dd8e0,{options:_0x44599c,args:_0x1700f1,tdx:_0x58ee37}=_0x2b1be8,_0x2430be=_0x44599c,_0x4e7928=_0x1700f1[0x0]||_0x44599c[_0x262cb0(0x171)];if(!_0x4e7928)return console[_0x262cb0(0x146)](a27_0x580f47[_0x262cb0(0x24c)](_0x262cb0(0x18c))),console[_0x262cb0(0x146)]('Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a'),console[_0x262cb0(0x146)](a27_0x580f47[_0x262cb0(0x1c2)](_0x262cb0(0x175))),0x1;if(_0x2430be[_0x262cb0(0x203)]&&_0x2430be[_0x262cb0(0x220)])return console[_0x262cb0(0x146)](a27_0x580f47[_0x262cb0(0x24c)](_0x262cb0(0x228))),console[_0x262cb0(0x146)](a27_0x580f47[_0x262cb0(0x206)](_0x262cb0(0x1f4))),console[_0x262cb0(0x146)](a27_0x580f47[_0x262cb0(0x206)](_0x262cb0(0x252)+PARENT_SEGMENT_DIR+_0x262cb0(0x161))),console[_0x262cb0(0x146)](a27_0x580f47[_0x262cb0(0x1c2)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x124533=_0x2430be['output']||a27_0xb78e46['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4e7928)+'.yml');_0x2430be['verbose']&&(console[_0x262cb0(0x146)](_0x262cb0(0x1f9)+_0x2430be['site']),console[_0x262cb0(0x146)](_0x262cb0(0x14e)+_0x4e7928),console[_0x262cb0(0x146)](_0x262cb0(0x1cd)+_0x124533));const _0x39741b=await withSpinner(_0x262cb0(0x1ef)+_0x4e7928+_0x262cb0(0x23f),()=>_0x58ee37[_0x262cb0(0x13d)][_0x262cb0(0x157)](_0x4e7928),{'verbose':_0x2430be['verbose']}),_0x28795f=_0x39741b['data'];if(existsSync(_0x124533)){const _0x48ce9d=readFileSync(_0x124533,'utf-8'),_0xc869a9=generateDiff(_0x48ce9d,_0x28795f);if(!hasChanges(_0xc869a9))console[_0x262cb0(0x146)](a27_0x580f47[_0x262cb0(0x1f1)]('✔')+_0x262cb0(0x1a6)+a27_0x580f47[_0x262cb0(0x1c2)](_0x124533)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x262cb0(0x146)](_0x262cb0(0x1fe)+_0x124533+'\x27:'),console[_0x262cb0(0x146)]('─'['repeat'](0x3c)),console['error'](formatDiffWithColors(_0xc869a9)),console['error']('─'[_0x262cb0(0x1d1)](0x3c));if(!_0x2430be['yes']){const _0x55ed6e=await confirmKey('Overwrite\x20\x27'+_0x124533+'\x27?');if(!_0x55ed6e)return console[_0x262cb0(0x146)](_0x262cb0(0x1a8)),0x1;}writeFileSync(_0x124533,_0x28795f,_0x262cb0(0x1ed)),console[_0x262cb0(0x146)](a27_0x580f47['green']('✔')+_0x262cb0(0x154)+a27_0x580f47['cyan'](_0x124533));}}else{const _0x15bdee=a27_0xb78e46[_0x262cb0(0x169)](_0x124533);!existsSync(_0x15bdee)&&mkdirSync(_0x15bdee,{'recursive':!![]}),writeFileSync(_0x124533,_0x28795f,'utf-8'),console[_0x262cb0(0x146)](a27_0x580f47['green']('✔')+_0x262cb0(0x154)+a27_0x580f47['cyan'](_0x124533));}return saveSessionContext({'parent_segment':_0x4e7928},_0x2430be[_0x262cb0(0x162)]),console['error'](a27_0x580f47[_0x262cb0(0x1f1)]('✔')+_0x262cb0(0x167)+a27_0x580f47[_0x262cb0(0x206)](_0x262cb0(0x148))+'\x20=\x20'+a27_0x580f47[_0x262cb0(0x1c2)](_0x4e7928)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a27_0x4dd8e0(0x210)]=a27_0x4dd8e0(0x1ba);['description']=a27_0x4dd8e0(0x17a);async[a27_0x4dd8e0(0x165)](_0x220cdd){const _0x57d766=a27_0x4dd8e0,{options:_0x402540,args:_0x1de4e0,tdx:_0x5c704c}=_0x220cdd,_0x523a2c=_0x402540,_0x4b8a4e=_0x1de4e0[0x0]||_0x402540[_0x57d766(0x171)];if(!_0x4b8a4e)return console['error'](a27_0x580f47[_0x57d766(0x24c)](_0x57d766(0x18c))),console[_0x57d766(0x146)](_0x57d766(0x242)),console[_0x57d766(0x146)](a27_0x580f47[_0x57d766(0x1c2)](_0x57d766(0x213))),0x1;const _0x38c99e=resolveYamlFile(_0x4b8a4e);if(!existsSync(_0x38c99e))return showFileNotFoundError(_0x38c99e,_0x4b8a4e),0x1;_0x523a2c[_0x57d766(0x23b)]&&(console['error'](_0x57d766(0x1f9)+_0x523a2c[_0x57d766(0x17f)]),console[_0x57d766(0x146)](_0x57d766(0x22d)+_0x38c99e));let _0x385c8b;try{_0x385c8b=readFileSync(_0x38c99e,_0x57d766(0x1ed));}catch(_0xad0b5e){const _0x3aa222=_0xad0b5e instanceof Error?_0xad0b5e['message']:String(_0xad0b5e);return console['error'](_0x57d766(0x192)+_0x3aa222),0x1;}const _0x105cd6=await withSpinner(_0x57d766(0x1a4),()=>_0x5c704c[_0x57d766(0x13d)][_0x57d766(0x176)](_0x385c8b),{'verbose':_0x523a2c[_0x57d766(0x23b)]}),_0x1660a9=_0x105cd6['data'],{isNew:_0x21bfb8,name:_0xca6c76,hasChanges:_0x26e468,diffFormatted:_0x552847}=_0x1660a9;if(!_0x26e468)return console['error'](_0x57d766(0x138)+_0xca6c76+_0x57d766(0x134)),0x0;_0x21bfb8?console['error'](_0x57d766(0x130)+_0xca6c76+'\x27:'):console['error'](_0x57d766(0x251)+_0xca6c76+'\x27:');console[_0x57d766(0x146)]('─'['repeat'](0x3c)),console['error'](_0x552847),console[_0x57d766(0x146)]('─'[_0x57d766(0x1d1)](0x3c));const _0x13cd7d=_0x21bfb8?_0x57d766(0x1c3)+_0xca6c76+'\x27?':_0x57d766(0x232)+_0xca6c76+'\x27?';if(!_0x523a2c[_0x57d766(0x1c1)]){const _0xe9a3da=await confirmKey(_0x13cd7d);if(!_0xe9a3da)return console['error'](_0x57d766(0x1a8)),0x1;}const _0x5526df=_0x21bfb8?_0x57d766(0x1cb):'Updating',_0x270eae=await withSpinner(_0x5526df+_0x57d766(0x194)+_0xca6c76+_0x57d766(0x23f),()=>_0x1660a9['apply'](),{'verbose':_0x523a2c['verbose']}),_0x1ada26=_0x270eae['data'],_0x2c6152=getConsoleNextUrl(_0x523a2c[_0x57d766(0x17f)],_0x57d766(0x22f)+_0x1ada26['id']),_0xeb2498=_0x21bfb8?_0x57d766(0x1a7):_0x57d766(0x1ea);return console[_0x57d766(0x146)]('✔\x20'+_0xeb2498+_0x57d766(0x194)+_0x1ada26[_0x57d766(0x210)]+'\x27'),console[_0x57d766(0x146)]('\x20\x20'+_0x2c6152),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a27_0x4dd8e0(0x210)]=a27_0x4dd8e0(0x144);[a27_0x4dd8e0(0x21f)]=a27_0x4dd8e0(0x1be);async[a27_0x4dd8e0(0x165)](_0x225452){const _0x205c08=a27_0x4dd8e0,{options:_0x11f186,args:_0x4364dc,tdx:_0x4e5718}=_0x225452,_0x722a85=_0x11f186,_0x1e2b23=_0x4364dc[0x0]||_0x11f186[_0x205c08(0x171)];if(!_0x1e2b23)return console['error'](a27_0x580f47['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x205c08(0x146)](_0x205c08(0x1d9)),console[_0x205c08(0x146)]('Options:'),console[_0x205c08(0x146)](_0x205c08(0x246)),console[_0x205c08(0x146)](_0x205c08(0x14f)),console[_0x205c08(0x146)](_0x205c08(0x15c)),console[_0x205c08(0x146)](a27_0x580f47[_0x205c08(0x1c2)](_0x205c08(0x205))),0x1;const _0x3661e3=resolveYamlFile(_0x1e2b23);if(!existsSync(_0x3661e3))return showFileNotFoundError(_0x3661e3,_0x1e2b23),0x1;_0x722a85[_0x205c08(0x23b)]&&(console[_0x205c08(0x146)](_0x205c08(0x1f9)+_0x722a85[_0x205c08(0x17f)]),console[_0x205c08(0x146)](_0x205c08(0x22d)+_0x3661e3));let _0xfedc89;try{_0xfedc89=readFileSync(_0x3661e3,'utf-8');}catch(_0xdbd622){const _0x585473=_0xdbd622 instanceof Error?_0xdbd622[_0x205c08(0x15e)]:String(_0xdbd622);return console[_0x205c08(0x146)](_0x205c08(0x192)+_0x585473),0x1;}const _0x24e823=createCommandSpinner(a27_0x580f47[_0x205c08(0x206)](_0x205c08(0x202)),{'verbose':_0x722a85[_0x205c08(0x23b)]});_0x24e823[_0x205c08(0x1f8)]();const _0x2e80b3={'onProgress':_0x53d263=>{_0x24e823['text']=formatProgressMessage(_0x53d263);}};if(_0x722a85[_0x205c08(0x235)])_0x2e80b3['master']=!![];if(_0x722a85[_0x205c08(0x226)])_0x2e80b3[_0x205c08(0x226)]=!![];_0x722a85['attribute']&&(_0x2e80b3[_0x205c08(0x1d8)]=_0x722a85['attribute']);_0x722a85[_0x205c08(0x19c)]&&(_0x2e80b3[_0x205c08(0x19c)]=_0x722a85['behavior']);if(_0x722a85[_0x205c08(0x250)])_0x2e80b3[_0x205c08(0x250)]=_0x722a85[_0x205c08(0x250)];let _0x5ddf4a;try{_0x5ddf4a=await _0x4e5718[_0x205c08(0x13d)][_0x205c08(0x249)](_0xfedc89,_0x2e80b3),_0x24e823[_0x205c08(0x152)]();}catch(_0x324056){_0x24e823[_0x205c08(0x152)]();throw _0x324056;}const _0x3cb732=_0x722a85[_0x205c08(0x250)]||_0x205c08(0x240);return this[_0x205c08(0x22b)](_0x5ddf4a,_0x2e80b3,_0x3661e3,_0x3cb732),_0x5ddf4a['allValid']?0x0:0x1;}[a27_0x4dd8e0(0x22b)](_0x519641,_0x534dc1,_0x16d9ca,_0x7a7a28){const _0x509ce3=a27_0x4dd8e0;console[_0x509ce3(0x146)]('\x0a'+a27_0x580f47[_0x509ce3(0x177)](_0x509ce3(0x135))+'\x20'+_0x519641[_0x509ce3(0x210)]),console[_0x509ce3(0x146)]('═'[_0x509ce3(0x1d1)](0x3c)),this[_0x509ce3(0x13c)](_0x519641);if(typeof _0x534dc1['attribute']===_0x509ce3(0x172)){this[_0x509ce3(0x255)](_0x519641),this[_0x509ce3(0x225)](_0x519641),this[_0x509ce3(0x1e2)](_0x16d9ca,_0x7a7a28,_0x509ce3(0x1d8),_0x534dc1[_0x509ce3(0x1d8)]);return;}if(_0x534dc1[_0x509ce3(0x1d8)]===!![]){this[_0x509ce3(0x255)](_0x519641),this[_0x509ce3(0x225)](_0x519641),this[_0x509ce3(0x1e2)](_0x16d9ca,_0x7a7a28,_0x509ce3(0x1db));return;}if(typeof _0x534dc1['behavior']===_0x509ce3(0x172)){this[_0x509ce3(0x243)](_0x519641,_0x7a7a28),this[_0x509ce3(0x225)](_0x519641),this[_0x509ce3(0x1e2)](_0x16d9ca,_0x7a7a28,_0x509ce3(0x19c),_0x534dc1['behavior']);return;}if(_0x534dc1[_0x509ce3(0x19c)]===!![]){this[_0x509ce3(0x243)](_0x519641,_0x7a7a28),this[_0x509ce3(0x225)](_0x519641),this[_0x509ce3(0x1e2)](_0x16d9ca,_0x7a7a28,_0x509ce3(0x197));return;}this[_0x509ce3(0x255)](_0x519641),this['displayBehaviorsStats'](_0x519641,_0x7a7a28),this[_0x509ce3(0x225)](_0x519641),this[_0x509ce3(0x1e2)](_0x16d9ca,_0x7a7a28,_0x509ce3(0x1ac));}[a27_0x4dd8e0(0x1e2)](_0x265588,_0x11458f,_0x5b00f3,_0x239935){const _0xc77515=a27_0x4dd8e0;console[_0xc77515(0x146)]('\x0a'+a27_0x580f47['dim'](_0xc77515(0x1f6)));const _0x30f5e7=_0x11458f!==_0xc77515(0x240)?_0xc77515(0x145)+_0x11458f:'';if(_0x5b00f3===_0xc77515(0x1d8)&&_0x239935)console[_0xc77515(0x146)]('\x20\x20'+a27_0x580f47[_0xc77515(0x206)](_0xc77515(0x1b2)+_0x265588+'\x20--attribute\x20\x22'+_0x239935+'\x22'+_0x30f5e7));else{if(_0x5b00f3==='behavior'&&_0x239935)console[_0xc77515(0x146)]('\x20\x20'+a27_0x580f47[_0xc77515(0x206)](_0xc77515(0x1b2)+_0x265588+_0xc77515(0x170)+_0x239935+'\x22'+_0x30f5e7));else(_0x5b00f3===_0xc77515(0x1db)||_0x5b00f3==='all')&&console[_0xc77515(0x146)]('\x20\x20'+a27_0x580f47[_0xc77515(0x206)](_0xc77515(0x1b2)+_0x265588+_0xc77515(0x248)+_0x30f5e7));}(_0x5b00f3==='behaviors'||_0x5b00f3===_0xc77515(0x1ac))&&console[_0xc77515(0x146)]('\x20\x20'+a27_0x580f47[_0xc77515(0x206)]('tdx\x20segment\x20parent\x20preview\x20'+_0x265588+_0xc77515(0x247)+_0x30f5e7)),_0x5b00f3===_0xc77515(0x1ac)&&console[_0xc77515(0x146)]('\x20\x20'+a27_0x580f47[_0xc77515(0x206)](_0xc77515(0x1b2)+_0x265588+_0xc77515(0x227)+_0x30f5e7));}['displayMasterInfo'](_0xf0a18e){const _0x41b443=a27_0x4dd8e0,{master:_0x27c989}=_0xf0a18e,_0x10d26e=_0x27c989[_0x41b443(0x214)]?a27_0x580f47['green']('✔'):a27_0x580f47[_0x41b443(0x24c)]('✘');console[_0x41b443(0x146)]('\x0a'+a27_0x580f47[_0x41b443(0x206)]('Master\x20Table')),console[_0x41b443(0x146)](_0x10d26e+'\x20'+a27_0x580f47[_0x41b443(0x177)](_0x27c989[_0x41b443(0x14d)]+'.'+_0x27c989[_0x41b443(0x1cc)])),_0x27c989[_0x41b443(0x214)]?_0x27c989[_0x41b443(0x20a)]!==undefined&&console['error']('\x20\x20'+a27_0x580f47[_0x41b443(0x206)]('Rows:')+'\x20'+a27_0x580f47[_0x41b443(0x1c2)](formatRows(_0x27c989[_0x41b443(0x20a)]))):console['error']('\x20\x20'+a27_0x580f47[_0x41b443(0x24c)](_0x41b443(0x1f5))+'\x20'+_0x27c989[_0x41b443(0x21a)]);}[a27_0x4dd8e0(0x255)](_0x53a2ae){const _0x517c08=a27_0x4dd8e0;if(_0x53a2ae[_0x517c08(0x1db)][_0x517c08(0x24f)]===0x0)return;console[_0x517c08(0x146)]('\x0a'+a27_0x580f47['dim'](_0x517c08(0x1b3)));for(const _0x1bf339 of _0x53a2ae[_0x517c08(0x1db)]){const _0x34dd41=_0x1bf339[_0x517c08(0x214)]?a27_0x580f47[_0x517c08(0x1f1)]('✔'):a27_0x580f47['red']('✘');let _0x2fe581='';if(_0x1bf339[_0x517c08(0x214)]&&_0x1bf339['matchedCount']!==undefined&&_0x1bf339['coveragePercent']!==undefined){const _0x12d226=_0x1bf339[_0x517c08(0x1bb)]['toFixed'](0x1),_0x1a5abb=_0x1bf339[_0x517c08(0x1bb)]>=0x50?a27_0x580f47[_0x517c08(0x1f1)]:_0x1bf339[_0x517c08(0x1bb)]>=0x32?a27_0x580f47[_0x517c08(0x1ab)]:a27_0x580f47[_0x517c08(0x24c)];_0x2fe581='\x20'+a27_0x580f47[_0x517c08(0x206)](_0x517c08(0x216))+'\x20'+_0x1a5abb(_0x12d226+'%')+'\x20('+formatRows(_0x1bf339[_0x517c08(0x20c)])+_0x517c08(0x17d);}console['error'](_0x34dd41+'\x20'+a27_0x580f47['bold'](_0x1bf339[_0x517c08(0x210)])+_0x2fe581),console[_0x517c08(0x146)]('\x20\x20'+a27_0x580f47['dim']('Source:')+'\x20'+a27_0x580f47[_0x517c08(0x177)](_0x1bf339[_0x517c08(0x14d)]+'.'+_0x1bf339[_0x517c08(0x1cc)]));const _0x1f3779=_0x1bf339[_0x517c08(0x1cf)]===_0x1bf339['foreignKey']?a27_0x580f47['dim'](_0x517c08(0x16a))+'\x20'+_0x1bf339[_0x517c08(0x1cf)]:a27_0x580f47['dim'](_0x517c08(0x1d6))+'\x20'+_0x1bf339[_0x517c08(0x1cf)]+_0x517c08(0x1d2)+_0x1bf339[_0x517c08(0x1af)];console['error']('\x20\x20'+_0x1f3779),console['error']('\x20\x20'+a27_0x580f47['dim'](_0x517c08(0x160))),this[_0x517c08(0x1c9)](_0x1bf339[_0x517c08(0x1b7)]),!_0x1bf339[_0x517c08(0x214)]&&console[_0x517c08(0x146)]('\x20\x20'+a27_0x580f47[_0x517c08(0x24c)](_0x517c08(0x1f5))+'\x20'+_0x1bf339[_0x517c08(0x21a)]);}}[a27_0x4dd8e0(0x243)](_0x492940,_0x55e820){const _0x472a85=a27_0x4dd8e0;if(_0x492940[_0x472a85(0x197)][_0x472a85(0x24f)]===0x0)return;console[_0x472a85(0x146)]('\x0a'+a27_0x580f47[_0x472a85(0x206)](_0x472a85(0x193))+'\x20'+a27_0x580f47[_0x472a85(0x206)]('('+_0x55e820+')'));for(const _0x4fe61e of _0x492940[_0x472a85(0x197)]){const _0x251d0c=_0x4fe61e[_0x472a85(0x214)]?a27_0x580f47[_0x472a85(0x1f1)]('✔'):a27_0x580f47[_0x472a85(0x24c)]('✘');let _0x52be28='';if(_0x4fe61e[_0x472a85(0x214)]&&_0x4fe61e[_0x472a85(0x1bc)]!==undefined&&_0x4fe61e['totalEvents']!==undefined){const _0x28dfd9=_0x4fe61e[_0x472a85(0x198)]?.[_0x472a85(0x188)](0x1)||'?',_0x5e9dbc=(_0x4fe61e[_0x472a85(0x198)]??0x0)>=0x32?a27_0x580f47['green']:(_0x4fe61e[_0x472a85(0x198)]??0x0)>=0x14?a27_0x580f47['yellow']:a27_0x580f47['red'];_0x52be28='\x20'+a27_0x580f47[_0x472a85(0x206)](_0x472a85(0x1c0))+'\x20'+_0x5e9dbc(formatRows(_0x4fe61e['customersWithEvents']))+'\x20('+_0x28dfd9+_0x472a85(0x147)+a27_0x580f47[_0x472a85(0x206)](_0x472a85(0x13a))+'\x20'+a27_0x580f47[_0x472a85(0x1c2)](formatRows(_0x4fe61e[_0x472a85(0x1d4)]));}console[_0x472a85(0x146)](_0x251d0c+'\x20'+a27_0x580f47[_0x472a85(0x177)](_0x4fe61e[_0x472a85(0x210)])+_0x52be28),console[_0x472a85(0x146)]('\x20\x20'+a27_0x580f47[_0x472a85(0x206)](_0x472a85(0x207))+'\x20'+a27_0x580f47[_0x472a85(0x177)](_0x4fe61e[_0x472a85(0x14d)]+'.'+_0x4fe61e[_0x472a85(0x1cc)]));const _0x111e07=_0x4fe61e['joinKey']===_0x4fe61e[_0x472a85(0x1af)]?a27_0x580f47[_0x472a85(0x206)](_0x472a85(0x16a))+'\x20'+_0x4fe61e['joinKey']:a27_0x580f47[_0x472a85(0x206)](_0x472a85(0x1d6))+'\x20'+_0x4fe61e[_0x472a85(0x1cf)]+_0x472a85(0x1d2)+_0x4fe61e[_0x472a85(0x1af)];console[_0x472a85(0x146)]('\x20\x20'+_0x111e07),console[_0x472a85(0x146)]('\x20\x20'+a27_0x580f47[_0x472a85(0x206)](_0x472a85(0x160))),this['displayColumns'](_0x4fe61e[_0x472a85(0x1b7)]),!_0x4fe61e[_0x472a85(0x214)]&&console['error']('\x20\x20'+a27_0x580f47['red'](_0x472a85(0x1f5))+'\x20'+_0x4fe61e['schemaError']);}}[a27_0x4dd8e0(0x1c9)](_0xb634bb){const _0x52f236=a27_0x4dd8e0;for(const _0x2c6166 of _0xb634bb){_0x2c6166[_0x52f236(0x1da)]===_0x2c6166[_0x52f236(0x1c7)]||_0x2c6166['column']==='*'?console['error']('\x20\x20\x20\x20-\x20'+_0x2c6166[_0x52f236(0x1da)]):console[_0x52f236(0x146)](_0x52f236(0x168)+_0x2c6166[_0x52f236(0x1da)]+'\x20'+a27_0x580f47[_0x52f236(0x206)]('('+_0x2c6166[_0x52f236(0x1c7)]+')'));}}[a27_0x4dd8e0(0x225)](_0x12c14e){const _0x213aaf=a27_0x4dd8e0;console['error']('─'['repeat'](0x3c));if(_0x12c14e[_0x213aaf(0x21e)][_0x213aaf(0x24f)]>0x0){console[_0x213aaf(0x146)]('\x0a'+a27_0x580f47[_0x213aaf(0x24c)]('Errors:'));for(const _0x2d523f of _0x12c14e[_0x213aaf(0x21e)]){console[_0x213aaf(0x146)]('\x20\x20'+a27_0x580f47[_0x213aaf(0x24c)]('•')+'\x20'+_0x2d523f);}}_0x12c14e[_0x213aaf(0x181)]&&console[_0x213aaf(0x146)]('\x0a'+a27_0x580f47[_0x213aaf(0x1f1)]('✔')+_0x213aaf(0x140));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a27_0x4dd8e0(0x210)]=a27_0x4dd8e0(0x20f);['description']=a27_0x4dd8e0(0x137);async[a27_0x4dd8e0(0x165)](_0x58a38){const _0x5c0ea9=a27_0x4dd8e0,{options:_0x2561da,args:_0x4aa632,tdx:_0x42523e}=_0x58a38,_0x4edcd5=_0x2561da,_0x457bb9=_0x4aa632[0x0]||_0x2561da[_0x5c0ea9(0x171)];if(!_0x457bb9)return console[_0x5c0ea9(0x146)](a27_0x580f47[_0x5c0ea9(0x24c)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x5c0ea9(0x146)](_0x5c0ea9(0x209)),console['error'](_0x5c0ea9(0x21c)),console[_0x5c0ea9(0x146)](_0x5c0ea9(0x1b8)),console[_0x5c0ea9(0x146)](_0x5c0ea9(0x166)),console[_0x5c0ea9(0x146)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x5c0ea9(0x146)](_0x5c0ea9(0x183)),console['error'](_0x5c0ea9(0x15c)),console['error'](a27_0x580f47['cyan'](_0x5c0ea9(0x205))),0x1;if(!_0x4edcd5[_0x5c0ea9(0x235)]&&!_0x4edcd5[_0x5c0ea9(0x1d8)]&&!_0x4edcd5[_0x5c0ea9(0x19c)]&&!_0x4edcd5[_0x5c0ea9(0x226)])return console[_0x5c0ea9(0x146)](a27_0x580f47[_0x5c0ea9(0x24c)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x5c0ea9(0x146)](_0x5c0ea9(0x209)),console[_0x5c0ea9(0x146)]('Options:'),console[_0x5c0ea9(0x146)](_0x5c0ea9(0x1b8)),console['error'](_0x5c0ea9(0x166)),console['error'](_0x5c0ea9(0x16d)),console[_0x5c0ea9(0x146)](_0x5c0ea9(0x183)),0x1;const _0xe4bc7=resolveYamlFile(_0x457bb9);if(!existsSync(_0xe4bc7))return showFileNotFoundError(_0xe4bc7,_0x457bb9),0x1;_0x4edcd5[_0x5c0ea9(0x23b)]&&(console[_0x5c0ea9(0x146)]('Site:\x20'+_0x4edcd5[_0x5c0ea9(0x17f)]),console[_0x5c0ea9(0x146)]('YAML\x20file:\x20'+_0xe4bc7));let _0xc75449;try{_0xc75449=readFileSync(_0xe4bc7,_0x5c0ea9(0x1ed));}catch(_0x3039e1){const _0x2cd15c=_0x3039e1 instanceof Error?_0x3039e1['message']:String(_0x3039e1);return console['error']('Error\x20reading\x20file:\x20'+_0x2cd15c),0x1;}let _0xf3f81a;try{_0xf3f81a=parseYamlString(_0xc75449);}catch(_0x3d2bae){const _0x1500a8=_0x3d2bae instanceof Error?_0x3d2bae[_0x5c0ea9(0x15e)]:String(_0x3d2bae);return console['error'](a27_0x580f47['red']('Error\x20parsing\x20YAML:\x20'+_0x1500a8)),0x1;}if(_0x4edcd5[_0x5c0ea9(0x1d8)]===!![]||_0x4edcd5[_0x5c0ea9(0x1d8)]===''){const _0x531f03=_0xf3f81a[_0x5c0ea9(0x1db)]?.['map'](_0x5ac494=>_0x5ac494['name'])||[];if(_0x531f03[_0x5c0ea9(0x24f)]===0x0)console['error'](a27_0x580f47['red'](_0x5c0ea9(0x237)));else{console[_0x5c0ea9(0x146)](a27_0x580f47[_0x5c0ea9(0x24c)](_0x5c0ea9(0x1ae))),console['error']('Available\x20attributes:');for(const _0x3bced3 of _0x531f03){console[_0x5c0ea9(0x146)]('\x20\x20'+a27_0x580f47[_0x5c0ea9(0x1c2)](_0x3bced3));}console['error'](_0x5c0ea9(0x1f2)+_0x457bb9+_0x5c0ea9(0x180)+_0x531f03[0x0]+'\x22');}return 0x1;}if(_0x4edcd5[_0x5c0ea9(0x19c)]===!![]||_0x4edcd5[_0x5c0ea9(0x19c)]===''){const _0x5b7d6d=_0xf3f81a['behaviors']?.[_0x5c0ea9(0x16b)](_0x54f117=>_0x54f117['name'])||[];if(_0x5b7d6d[_0x5c0ea9(0x24f)]===0x0)console['error'](a27_0x580f47['red'](_0x5c0ea9(0x158)));else{console['error'](a27_0x580f47[_0x5c0ea9(0x24c)](_0x5c0ea9(0x224))),console['error'](_0x5c0ea9(0x1c6));for(const _0xd0d700 of _0x5b7d6d){console[_0x5c0ea9(0x146)]('\x20\x20'+a27_0x580f47[_0x5c0ea9(0x1c2)](_0xd0d700));}console[_0x5c0ea9(0x146)](_0x5c0ea9(0x1f2)+_0x457bb9+'\x20--behavior\x20\x22'+_0x5b7d6d[0x0]+'\x22');}return 0x1;}const _0x343cf7=createCommandSpinner(a27_0x580f47[_0x5c0ea9(0x206)]('Fetching\x20sample\x20data...'),{'verbose':_0x4edcd5[_0x5c0ea9(0x23b)]});_0x343cf7[_0x5c0ea9(0x1f8)]();const _0x5c21fc={'onProgress':_0x8c97a4=>{const _0x5d6749=_0x5c0ea9;_0x343cf7[_0x5d6749(0x200)]=formatProgressMessage(_0x8c97a4);}};if(_0x4edcd5[_0x5c0ea9(0x235)])_0x5c21fc[_0x5c0ea9(0x235)]=!![];if(_0x4edcd5[_0x5c0ea9(0x1d8)]&&typeof _0x4edcd5[_0x5c0ea9(0x1d8)]===_0x5c0ea9(0x172))_0x5c21fc['attribute']=_0x4edcd5[_0x5c0ea9(0x1d8)];if(_0x4edcd5[_0x5c0ea9(0x19c)]&&typeof _0x4edcd5[_0x5c0ea9(0x19c)]===_0x5c0ea9(0x172))_0x5c21fc[_0x5c0ea9(0x19c)]=_0x4edcd5['behavior'];if(_0x4edcd5[_0x5c0ea9(0x226)])_0x5c21fc[_0x5c0ea9(0x226)]=!![];if(_0x4edcd5['interval'])_0x5c21fc[_0x5c0ea9(0x250)]=_0x4edcd5['interval'];let _0x3674ad;try{_0x3674ad=await _0x42523e[_0x5c0ea9(0x13d)][_0x5c0ea9(0x1c4)](_0xc75449,_0x5c21fc),_0x343cf7[_0x5c0ea9(0x152)]();}catch(_0x53d68b){_0x343cf7[_0x5c0ea9(0x152)]();throw _0x53d68b;}return await this['displayPreviewResults'](_0x3674ad,{'master':_0x4edcd5[_0x5c0ea9(0x235)],'attribute':typeof _0x4edcd5[_0x5c0ea9(0x1d8)]==='string'?_0x4edcd5[_0x5c0ea9(0x1d8)]:undefined,'behavior':typeof _0x4edcd5[_0x5c0ea9(0x19c)]==='string'?_0x4edcd5[_0x5c0ea9(0x19c)]:undefined,'enriched':_0x4edcd5['enriched']}),_0x3674ad[_0x5c0ea9(0x181)]?0x0:0x1;}async[a27_0x4dd8e0(0x18a)](_0x566944,_0x59a4b1){const _0x57f710=a27_0x4dd8e0;console['error']('\x0a'+a27_0x580f47[_0x57f710(0x177)](_0x57f710(0x1a9))+'\x20'+_0x566944[_0x57f710(0x210)]),console[_0x57f710(0x146)]('═'[_0x57f710(0x1d1)](0x3c));if(_0x59a4b1[_0x57f710(0x235)]&&_0x566944[_0x57f710(0x1d5)]){const _0x182f76=a27_0x580f47[_0x57f710(0x206)]('Master:')+'\x20'+a27_0x580f47[_0x57f710(0x177)](_0x566944['master'][_0x57f710(0x14d)]+'.'+_0x566944[_0x57f710(0x235)][_0x57f710(0x1cc)]);await this[_0x57f710(0x178)](_0x182f76,_0x566944[_0x57f710(0x1d5)]);}else{if(_0x59a4b1['attribute']&&_0x566944['sampleData']){const _0x1ec830=a27_0x580f47[_0x57f710(0x206)](_0x57f710(0x187))+'\x20'+a27_0x580f47[_0x57f710(0x177)](_0x59a4b1['attribute']);await this[_0x57f710(0x178)](_0x1ec830,_0x566944[_0x57f710(0x1d5)]);}else{if(_0x59a4b1['behavior']&&_0x566944[_0x57f710(0x1d5)]){const _0x7be190=a27_0x580f47['dim'](_0x57f710(0x190))+'\x20'+a27_0x580f47[_0x57f710(0x177)](_0x59a4b1[_0x57f710(0x19c)]);await this[_0x57f710(0x178)](_0x7be190,_0x566944[_0x57f710(0x1d5)]);}else{if(_0x59a4b1['enriched']&&_0x566944[_0x57f710(0x1d5)]){const _0x3c3f53=a27_0x580f47[_0x57f710(0x206)](_0x57f710(0x245))+'\x20'+a27_0x580f47['bold'](_0x57f710(0x163));await this[_0x57f710(0x178)](_0x3c3f53,_0x566944['sampleData']);}else!_0x566944['sampleData']&&console[_0x57f710(0x146)](_0x57f710(0x219));}}}if(_0x566944[_0x57f710(0x21e)][_0x57f710(0x24f)]>0x0){console[_0x57f710(0x146)]('─'[_0x57f710(0x1d1)](0x3c)),console[_0x57f710(0x146)]('\x0a'+a27_0x580f47[_0x57f710(0x24c)](_0x57f710(0x1d7)));for(const _0x447b77 of _0x566944[_0x57f710(0x21e)]){console[_0x57f710(0x146)]('\x20\x20'+a27_0x580f47['red']('•')+'\x20'+_0x447b77);}}}async[a27_0x4dd8e0(0x178)](_0x2e0098,_0x1f87de){const _0x2dace2=a27_0x4dd8e0;if(_0x1f87de[_0x2dace2(0x24f)]===0x0){console[_0x2dace2(0x146)]('\x0a'+_0x2e0098),console['error'](_0x2dace2(0x1a5));return;}console['error']('\x0a'+_0x2e0098);const _0x59926e=Object[_0x2dace2(0x215)](_0x1f87de[0x0])['map'](_0x31453d=>({'name':_0x31453d,'type':typeof _0x1f87de[0x0][_0x31453d]==='number'?_0x2dace2(0x253):_0x2dace2(0x1f7)})),_0x243279={'queryId':_0x2dace2(0x1de),'columns':_0x59926e,'data':_0x1f87de,'stats':{'state':_0x2dace2(0x221),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1f87de[_0x2dace2(0x24f)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x34dd7b=formatAsTable(_0x243279,_0x1f87de[_0x2dace2(0x24f)],!![]);await writeOutput(_0x34dd7b,undefined,_0x2dace2(0x1cc));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a27_0x4dd8e0(0x210)]=a27_0x4dd8e0(0x179);[a27_0x4dd8e0(0x21f)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async['execute'](_0x41f18c){const _0x9543e3=a27_0x4dd8e0,{options:_0x187c41,args:_0x5afa6f,tdx:_0x23d0f1}=_0x41f18c,_0x3394b9=_0x187c41,_0xc8dd6=_0x5afa6f[0x0]||_0x187c41[_0x9543e3(0x171)];if(!_0xc8dd6)return console['error'](a27_0x580f47[_0x9543e3(0x24c)](_0x9543e3(0x18c))),console[_0x9543e3(0x146)]('Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a'),console[_0x9543e3(0x146)](a27_0x580f47['cyan'](_0x9543e3(0x175))),0x1;const _0x54dc18=resolveYamlFile(_0xc8dd6);if(existsSync(_0x54dc18)){_0x3394b9[_0x9543e3(0x23b)]&&console[_0x9543e3(0x146)](_0x9543e3(0x1aa)+_0x54dc18);let _0x27b6b1;try{_0x27b6b1=readFileSync(_0x54dc18,_0x9543e3(0x1ed));}catch(_0x4e47cf){const _0x3c5503=_0x4e47cf instanceof Error?_0x4e47cf[_0x9543e3(0x15e)]:String(_0x4e47cf);return console['error'](_0x9543e3(0x192)+_0x3c5503),0x1;}const _0x1b279c=await withSpinner('Analyzing\x20changes...',()=>_0x23d0f1[_0x9543e3(0x13d)][_0x9543e3(0x176)](_0x27b6b1),{'verbose':_0x3394b9[_0x9543e3(0x23b)]}),_0x140fb5=_0x1b279c['data'],{isNew:_0x2c2752,name:_0x589f5a,hasChanges:_0x4c9030,diffFormatted:_0x454ea7}=_0x140fb5;if(_0x4c9030){_0x2c2752?console['error']('\x0aNew\x20parent\x20segment\x20\x27'+_0x589f5a+'\x27:'):console[_0x9543e3(0x146)](_0x9543e3(0x251)+_0x589f5a+'\x27:');console[_0x9543e3(0x146)]('─'['repeat'](0x3c)),console[_0x9543e3(0x146)](_0x454ea7),console['error']('─'[_0x9543e3(0x1d1)](0x3c));const _0xc7e69f=_0x2c2752?_0x9543e3(0x1c3)+_0x589f5a+'\x27\x20and\x20run\x20workflow?':_0x9543e3(0x232)+_0x589f5a+_0x9543e3(0x236);if(!_0x3394b9['yes']){const _0x71b6ce=await confirmKey(_0xc7e69f);if(!_0x71b6ce)return console[_0x9543e3(0x146)](_0x9543e3(0x1a8)),0x1;}const _0x901d48=_0x2c2752?_0x9543e3(0x1cb):'Updating';await withSpinner(_0x901d48+_0x9543e3(0x194)+_0x589f5a+_0x9543e3(0x23f),()=>_0x140fb5[_0x9543e3(0x1ce)](),{'verbose':_0x3394b9['verbose']});const _0x5e7798=_0x2c2752?_0x9543e3(0x1a7):'Updated';console['error']('✔\x20'+_0x5e7798+_0x9543e3(0x194)+_0x589f5a+'\x27');}else console[_0x9543e3(0x146)]('✔\x20No\x20changes\x20-\x20\x27'+_0x589f5a+_0x9543e3(0x24e));}const _0x15ae69=await withSpinner(_0x9543e3(0x143)+_0xc8dd6+_0x9543e3(0x23f),()=>_0x23d0f1[_0x9543e3(0x13d)]['runParent'](_0xc8dd6),{'verbose':_0x3394b9[_0x9543e3(0x23b)]}),_0x4b9eff=_0x15ae69[_0x9543e3(0x1e0)],_0x5dbee3=getConsoleUrl(_0x3394b9['site'],_0x9543e3(0x204)+_0x4b9eff[_0x9543e3(0x1b1)]+'/sessions/'+_0x4b9eff[_0x9543e3(0x18b)]+'/attempt/'+_0x4b9eff['workflowAttemptId']);return console[_0x9543e3(0x146)](_0x9543e3(0x1dd)),console[_0x9543e3(0x146)]('\x20\x20'+a27_0x580f47[_0x9543e3(0x206)]('Audience\x20ID:')+'\x20'+_0x4b9eff['audienceId']),console[_0x9543e3(0x146)]('\x20\x20'+a27_0x580f47['dim'](_0x9543e3(0x19b))+'\x20'+_0x4b9eff[_0x9543e3(0x1f0)]),console[_0x9543e3(0x146)]('\x20\x20'+a27_0x580f47[_0x9543e3(0x206)]('Session:')+'\x20'+_0x4b9eff[_0x9543e3(0x18b)]),console[_0x9543e3(0x146)]('\x20\x20'+a27_0x580f47['dim'](_0x9543e3(0x191))+'\x20'+_0x4b9eff[_0x9543e3(0x1f3)]),console[_0x9543e3(0x146)]('\x20\x20'+_0x5dbee3),console['error']('\x0a'+a27_0x580f47[_0x9543e3(0x206)](_0x9543e3(0x14a))+_0x9543e3(0x21d)+_0x4b9eff[_0x9543e3(0x1f3)]+_0x9543e3(0x1ec)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a27_0x4dd8e0(0x210)]=a27_0x4dd8e0(0x244);['description']=a27_0x4dd8e0(0x131);async['execute'](_0x53f32e){const _0x24dcac=a27_0x4dd8e0,{options:_0x1d8609,args:_0x1b5333,tdx:_0x1d625c}=_0x53f32e,_0x2015c8=_0x1b5333[0x0]||_0x1d8609[_0x24dcac(0x171)];if(!_0x2015c8)return console[_0x24dcac(0x146)](a27_0x580f47[_0x24dcac(0x24c)](_0x24dcac(0x18c))),console[_0x24dcac(0x146)](_0x24dcac(0x1fb)),console[_0x24dcac(0x146)](a27_0x580f47[_0x24dcac(0x1c2)](_0x24dcac(0x175))),0x1;_0x1d8609[_0x24dcac(0x23b)]&&(console[_0x24dcac(0x146)](_0x24dcac(0x1f9)+_0x1d8609[_0x24dcac(0x17f)]),console[_0x24dcac(0x146)](_0x24dcac(0x14e)+_0x2015c8));const _0x507aba=await withSpinner(_0x24dcac(0x231)+_0x2015c8+_0x24dcac(0x23f),()=>_0x1d625c['segment'][_0x24dcac(0x1a3)](_0x2015c8),{'verbose':_0x1d8609[_0x24dcac(0x23b)]}),_0x464202=_0x507aba[_0x24dcac(0x1e0)];console['error'](_0x24dcac(0x1b5)+_0x464202[_0x24dcac(0x24f)]+_0x24dcac(0x1b0)+(_0x464202[_0x24dcac(0x24f)]!==0x1?'s':''));if(_0x1d8609[_0x24dcac(0x22e)]||_0x1d8609[_0x24dcac(0x23d)])return await handleSDKOutput(_0x464202,_0x1d8609),0x0;return displayFieldsHumanReadable(_0x464202,_0x2015c8),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a27_0x4dd8e0(0x210)]=a27_0x4dd8e0(0x238);[a27_0x4dd8e0(0x21f)]=a27_0x4dd8e0(0x1e7);async[a27_0x4dd8e0(0x165)](_0x26cdda){const _0xa030e6=a27_0x4dd8e0,{options:_0x13b0fa,args:_0x1768a1,tdx:_0x252f89}=_0x26cdda,_0xc146fc=_0x13b0fa,_0x15a109=_0x1768a1[0x0]||_0x13b0fa['parentSegment'];if(!_0x15a109)return console[_0xa030e6(0x146)](a27_0x580f47[_0xa030e6(0x24c)](_0xa030e6(0x18c))),console['error']('Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a'),console[_0xa030e6(0x146)](_0xa030e6(0x1ff)),console[_0xa030e6(0x146)](_0xa030e6(0x19f)),console[_0xa030e6(0x146)](a27_0x580f47['cyan'](_0xa030e6(0x205))),0x1;_0x13b0fa[_0xa030e6(0x23b)]&&(console['error'](_0xa030e6(0x1f9)+_0x13b0fa[_0xa030e6(0x17f)]),console[_0xa030e6(0x146)]('Parent\x20segment:\x20'+_0x15a109));const _0x3881f6=await withSpinner(_0xa030e6(0x1ef)+_0x15a109+_0xa030e6(0x23f),()=>_0x252f89[_0xa030e6(0x13d)][_0xa030e6(0x19e)](_0x15a109),{'verbose':_0x13b0fa[_0xa030e6(0x23b)]}),_0x4719c4=_0x3881f6[_0xa030e6(0x1e0)];if(_0xc146fc['web']){const _0x3ded2c=getConsoleNextUrl(_0xc146fc[_0xa030e6(0x17f)],_0xa030e6(0x22f)+_0x4719c4['id']);return console[_0xa030e6(0x146)](a27_0x580f47[_0xa030e6(0x1f1)]('✔')+_0xa030e6(0x20b)+a27_0x580f47[_0xa030e6(0x1c2)](_0x3ded2c)),openBrowser(_0x3ded2c),0x0;}return await handleSingleObjectOutput(_0x4719c4,_0x13b0fa),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a27_0x4dd8e0(0x210)]='segment:parent:desc';[a27_0x4dd8e0(0x21f)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a27_0x4dd8e0(0x165)](_0xd6327){const _0x37e01d=a27_0x4dd8e0,{options:_0x5888b8,args:_0x3ac89b,tdx:_0x26e43b}=_0xd6327,_0x3603f5=_0x3ac89b[0x0]||_0x5888b8['parentSegment'];if(!_0x3603f5)return console['error'](a27_0x580f47[_0x37e01d(0x24c)](_0x37e01d(0x18c))),console['error'](_0x37e01d(0x23e)),console[_0x37e01d(0x146)](a27_0x580f47[_0x37e01d(0x1c2)](_0x37e01d(0x175))),0x1;_0x5888b8[_0x37e01d(0x23b)]&&(console['error'](_0x37e01d(0x1f9)+_0x5888b8['site']),console[_0x37e01d(0x146)](_0x37e01d(0x14e)+_0x3603f5));const _0xe0cb0=await withSpinner(_0x37e01d(0x1e9)+_0x3603f5+_0x37e01d(0x23f),()=>_0x26e43b[_0x37e01d(0x13d)][_0x37e01d(0x24b)](_0x3603f5),{'verbose':_0x5888b8['verbose']}),_0x4064bf=_0xe0cb0[_0x37e01d(0x1e0)],_0x46c59f=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x3603f5+'\x27...',()=>_0x26e43b[_0x37e01d(0x13d)][_0x37e01d(0x19a)](_0x4064bf),{'verbose':_0x5888b8[_0x37e01d(0x23b)]}),_0x52aa3a=await executeSchemaQuery(_0x46c59f['data'],_0x26e43b,_0x5888b8);return await handleQueryOutput(_0x52aa3a,_0x5888b8),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a27_0x4dd8e0(0x233);[a27_0x4dd8e0(0x21f)]=a27_0x4dd8e0(0x1e5);async[a27_0x4dd8e0(0x165)](_0x1246f7){const _0x3109e9=a27_0x4dd8e0,{options:_0x66c533,args:_0x1307da,tdx:_0x4f61f9}=_0x1246f7,_0x3bc53b=_0x1307da[0x0]||_0x66c533[_0x3109e9(0x171)];if(!_0x3bc53b)return console[_0x3109e9(0x146)](a27_0x580f47[_0x3109e9(0x24c)](_0x3109e9(0x18c))),console[_0x3109e9(0x146)](_0x3109e9(0x1ee)),console[_0x3109e9(0x146)](a27_0x580f47['cyan'](_0x3109e9(0x175))),0x1;_0x66c533[_0x3109e9(0x23b)]&&(console[_0x3109e9(0x146)](_0x3109e9(0x1f9)+_0x66c533['site']),console['error']('Parent\x20segment:\x20'+_0x3bc53b));const _0x1a3011=await withSpinner(_0x3109e9(0x1e9)+_0x3bc53b+_0x3109e9(0x23f),()=>_0x4f61f9[_0x3109e9(0x13d)]['resolveParentId'](_0x3bc53b),{'verbose':_0x66c533[_0x3109e9(0x23b)]}),_0x102d72=_0x1a3011['data'],_0x377223=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x3bc53b+_0x3109e9(0x23f),()=>_0x4f61f9[_0x3109e9(0x13d)][_0x3109e9(0x19a)](_0x102d72),{'verbose':_0x66c533[_0x3109e9(0x23b)]}),_0x4d22a7=_0x377223[_0x3109e9(0x1e0)];return _0x66c533[_0x3109e9(0x208)]==='json'||_0x66c533[_0x3109e9(0x208)]===_0x3109e9(0x23d)?await handleSDKOutput([{'sql':_0x4d22a7}],_0x66c533):console[_0x3109e9(0x20d)](_0x4d22a7),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a27_0x4dd8e0(0x210)]=a27_0x4dd8e0(0x151);[a27_0x4dd8e0(0x21f)]=a27_0x4dd8e0(0x17c);async[a27_0x4dd8e0(0x165)](_0x3117ba){const _0x6b3b88=a27_0x4dd8e0,{options:_0x5040d5,args:_0x55a8a7,tdx:_0x2818d4}=_0x3117ba,_0x59105b=_0x55a8a7[0x0]||_0x5040d5[_0x6b3b88(0x171)];if(!_0x59105b)return console['error'](a27_0x580f47[_0x6b3b88(0x24c)](_0x6b3b88(0x18c))),console[_0x6b3b88(0x146)](_0x6b3b88(0x229)),console['error'](a27_0x580f47[_0x6b3b88(0x1c2)](_0x6b3b88(0x175))),0x1;_0x5040d5[_0x6b3b88(0x23b)]&&(console[_0x6b3b88(0x146)](_0x6b3b88(0x1f9)+_0x5040d5[_0x6b3b88(0x17f)]),console[_0x6b3b88(0x146)](_0x6b3b88(0x14e)+_0x59105b));const _0x443f00=await withSpinner(_0x6b3b88(0x1e9)+_0x59105b+'\x27...',()=>_0x2818d4[_0x6b3b88(0x13d)][_0x6b3b88(0x24b)](_0x59105b),{'verbose':_0x5040d5[_0x6b3b88(0x23b)]}),_0x3b4013=_0x443f00['data'],_0x272009=await withSpinner(_0x6b3b88(0x16c)+_0x59105b+_0x6b3b88(0x23f),()=>_0x2818d4[_0x6b3b88(0x13d)][_0x6b3b88(0x19a)](_0x3b4013),{'verbose':_0x5040d5[_0x6b3b88(0x23b)]});let _0x269d52=_0x272009['data'];const _0x361fdc=resolveLimit(_0x5040d5[_0x6b3b88(0x1fa)],DEFAULT_DISPLAY_LIMIT),_0x22c7a7=/\bLIMIT\s+\d+/i['test'](_0x269d52);!_0x22c7a7&&(_0x269d52=_0x269d52[_0x6b3b88(0x1a0)]()[_0x6b3b88(0x1b6)](/;+$/,''),_0x269d52=_0x6b3b88(0x1c8)+_0x269d52+_0x6b3b88(0x241)+_0x361fdc);_0x5040d5[_0x6b3b88(0x23b)]&&console[_0x6b3b88(0x146)](_0x6b3b88(0x149)+_0x269d52);const _0x3dd2fd=await withQuerySpinner(_0x6b3b88(0x17b),async _0x112e94=>{const _0x47d2d9=_0x6b3b88,_0x4c9070=await _0x2818d4[_0x47d2d9(0x199)]['execute'](_0x269d52,{'catalog':'td','schema':_0x47d2d9(0x1e6),'onJobId':_0x1bef08=>{const _0x224fed=_0x47d2d9;_0x112e94[_0x224fed(0x1a2)](_0x1bef08);}});return _0x4c9070;},{'verbose':_0x5040d5[_0x6b3b88(0x23b)]}),_0x189272=_0x3dd2fd[_0x6b3b88(0x1e0)],_0xb2645d=_0x189272[_0x6b3b88(0x1b4)]?_0x6b3b88(0x15f)+_0x189272[_0x6b3b88(0x1b4)]+']':'';return console[_0x6b3b88(0x146)](_0x6b3b88(0x18e)+_0x189272[_0x6b3b88(0x254)][_0x6b3b88(0x185)][_0x6b3b88(0x22a)]()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x189272[_0x6b3b88(0x254)][_0x6b3b88(0x155)])+_0xb2645d)),await handleQueryOutput(_0x189272,_0x5040d5),0x0;}}
1
+ const a27_0xe4513=a27_0x545b;(function(_0x445de0,_0x59044d){const _0x6886b3=a27_0x545b,_0x6a0ae6=_0x445de0();while(!![]){try{const _0x34688c=parseInt(_0x6886b3(0x28e))/0x1+parseInt(_0x6886b3(0x1c7))/0x2+-parseInt(_0x6886b3(0x196))/0x3+parseInt(_0x6886b3(0x192))/0x4+parseInt(_0x6886b3(0x27f))/0x5*(parseInt(_0x6886b3(0x176))/0x6)+parseInt(_0x6886b3(0x1c6))/0x7*(parseInt(_0x6886b3(0x25b))/0x8)+-parseInt(_0x6886b3(0x25c))/0x9;if(_0x34688c===_0x59044d)break;else _0x6a0ae6['push'](_0x6a0ae6['shift']());}catch(_0x25acbd){_0x6a0ae6['push'](_0x6a0ae6['shift']());}}}(a27_0x32a9,0xbafbd));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a27_0x2eadbd 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 a27_0x393c4e from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';const PARENT_SEGMENT_DIR=a27_0xe4513(0x270),LEGACY_PARENT_SEGMENT_DIR=a27_0xe4513(0x190);function openBrowser(_0x1bcf64){const _0xd1b997=a27_0xe4513,_0x17b786=process[_0xd1b997(0x182)],_0x5a1389=_0x17b786==='darwin'?_0xd1b997(0x181):_0x17b786===_0xd1b997(0x251)?_0xd1b997(0x246):_0xd1b997(0x21b);spawn(_0x5a1389,[_0x1bcf64],{'detached':!![],'stdio':_0xd1b997(0x211)})['unref']();}function sanitizeFileName(_0x1d7209){const _0x5dc4e3=a27_0xe4513;return _0x1d7209[_0x5dc4e3(0x1c4)]()[_0x5dc4e3(0x1bf)](/[/\\:*?"<>|]/g,'-')[_0x5dc4e3(0x1bf)](/\s+/g,'-')[_0x5dc4e3(0x1bf)](/-+/g,'-')[_0x5dc4e3(0x1bf)](/^-|-$/g,'');}function migrateLegacyDirectory(){const _0xed170b=a27_0xe4513;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x547270=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x547270['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xed170b(0x257)](a27_0x393c4e['yellow'](_0xed170b(0x19b)+LEGACY_PARENT_SEGMENT_DIR+_0xed170b(0x256)+PARENT_SEGMENT_DIR+_0xed170b(0x1dd))),console[_0xed170b(0x257)](a27_0x393c4e['dim']('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xed170b(0x259))),![];console[_0xed170b(0x257)](a27_0x393c4e[_0xed170b(0x274)](_0xed170b(0x1f2)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a27_0x393c4e[_0xed170b(0x20c)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x3f1f5d){const _0x45176f=_0x3f1f5d instanceof Error?_0x3f1f5d[_0xed170b(0x1d5)]:String(_0x3f1f5d);return console[_0xed170b(0x257)](a27_0x393c4e['red']('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x45176f+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a27_0xe4513(0x1d0)](_0x596470){const _0x1d1c9a=a27_0xe4513;return migrateLegacyDirectory(),super[_0x1d1c9a(0x1d0)](_0x596470);}}function resolveYamlFile(_0xbf1dc5){const _0xb2aae=a27_0xe4513;if(_0xbf1dc5['endsWith'](_0xb2aae(0x24b))||_0xbf1dc5[_0xb2aae(0x220)](_0xb2aae(0x1c3)))return _0xbf1dc5;return a27_0x2eadbd[_0xb2aae(0x1aa)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xbf1dc5)+'.yml');}function formatProgressMessage(_0x555582){const _0x5d31d0=a27_0xe4513,_0x7fc1cd=_0x555582[_0x5d31d0(0x1ff)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x7fc1cd){const [,_0x3b973d,_0x2dc7f3,_0x36fe5e='']=_0x7fc1cd;return a27_0x393c4e[_0x5d31d0(0x21d)](_0x3b973d+':')+'\x20'+_0x2dc7f3+a27_0x393c4e[_0x5d31d0(0x21d)](_0x36fe5e);}return a27_0x393c4e[_0x5d31d0(0x21d)](_0x555582);}function showFileNotFoundError(_0x3d64cc,_0x62b8f8){const _0x120742=a27_0xe4513;console[_0x120742(0x257)](a27_0x393c4e[_0x120742(0x25f)](_0x120742(0x267)+_0x3d64cc+'\x0a')),console['error'](a27_0x393c4e[_0x120742(0x1cc)](_0x120742(0x177)+_0x62b8f8+_0x120742(0x1e5)));}export class ParentSegmentListCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x20a);[a27_0xe4513(0x21f)]=a27_0xe4513(0x283);async[a27_0xe4513(0x1b0)](_0x5414e4){const _0x1c25e7=a27_0xe4513,{options:_0x2a4f94,args:_0x361bb6,tdx:_0x297cad}=_0x5414e4,_0x5d3294=_0x361bb6[0x0];_0x2a4f94[_0x1c25e7(0x28f)]&&(console[_0x1c25e7(0x257)](_0x1c25e7(0x175)+_0x2a4f94[_0x1c25e7(0x27c)]),_0x5d3294&&console[_0x1c25e7(0x257)]('Pattern:\x20'+_0x5d3294));const _0x1e5493=await withSpinner(_0x5d3294?_0x1c25e7(0x26a)+_0x5d3294+'\x27...':_0x1c25e7(0x277),()=>_0x297cad[_0x1c25e7(0x20f)]['listParents'](),{'verbose':_0x2a4f94[_0x1c25e7(0x28f)]});let _0x434746=_0x1e5493['data'];if(_0x5d3294){const _0x4e49b3=_0x5d3294[_0x1c25e7(0x1bf)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x1c25e7(0x1bf)](/\?/g,'.'),_0x273e84=new RegExp('^'+_0x4e49b3+'$','i');_0x434746=_0x434746[_0x1c25e7(0x247)](_0x1b9496=>_0x273e84[_0x1c25e7(0x236)](_0x1b9496[_0x1c25e7(0x189)][_0x1c25e7(0x262)]));}_0x434746[_0x1c25e7(0x210)]((_0x43175f,_0x78e1e0)=>_0x43175f[_0x1c25e7(0x189)][_0x1c25e7(0x262)][_0x1c25e7(0x215)](_0x78e1e0['attributes'][_0x1c25e7(0x262)])),console[_0x1c25e7(0x257)](_0x1c25e7(0x25d)+_0x434746[_0x1c25e7(0x239)]+_0x1c25e7(0x1f1)+(_0x434746[_0x1c25e7(0x239)]!==0x1?'s':''));if(_0x2a4f94[_0x1c25e7(0x1cf)]===_0x1c25e7(0x253)||_0x2a4f94[_0x1c25e7(0x1cf)]==='jsonl')await handleSDKOutput(_0x434746,_0x2a4f94);else{if(_0x434746['length']===0x0)_0x5d3294?console['log'](_0x1c25e7(0x22c)+_0x5d3294):console['log']('No\x20parent\x20segments\x20found');else for(const _0x4c0560 of _0x434746){const _0x34238d=_0x4c0560['attributes'][_0x1c25e7(0x282)]?a27_0x393c4e[_0x1c25e7(0x21d)]('\x20('+formatRows(_0x4c0560['attributes'][_0x1c25e7(0x282)])+')'):'';console['log'](_0x1c25e7(0x1f7)+_0x4c0560[_0x1c25e7(0x189)][_0x1c25e7(0x262)]+_0x34238d);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x184);['description']='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a27_0xe4513(0x1b0)](_0x375306){const _0x467244=a27_0xe4513,{options:_0x1d2980,args:_0x28b50d,tdx:_0x523542}=_0x375306;console[_0x467244(0x257)](_0x467244(0x1ab)+_0x467244(0x18a)+_0x467244(0x233));const _0x34bf47=_0x1d2980;if(_0x28b50d[_0x467244(0x239)]===0x0)return console['error'](_0x467244(0x1f6)),console[_0x467244(0x257)](_0x467244(0x273)),0x1;const _0x50ab66=_0x28b50d[0x0];if(!_0x34bf47[_0x467244(0x19a)]||!_0x34bf47['table'])return console[_0x467244(0x257)](_0x467244(0x1e0)),console[_0x467244(0x257)](_0x467244(0x273)),0x1;_0x34bf47[_0x467244(0x28f)]&&(console['error'](_0x467244(0x175)+_0x34bf47[_0x467244(0x27c)]),console[_0x467244(0x257)](_0x467244(0x24e)+_0x50ab66),console['error'](_0x467244(0x248)+_0x34bf47['database']),console[_0x467244(0x257)](_0x467244(0x1f3)+_0x34bf47['table']));const _0x382391=await loadJSONFromOptions(_0x34bf47['attributes'],_0x34bf47[_0x467244(0x261)]),_0x142f3b=await loadJSONFromOptions(_0x34bf47[_0x467244(0x1a1)],_0x34bf47[_0x467244(0x1f5)]),_0x52e895=await loadJSONFromOptions(_0x34bf47[_0x467244(0x243)],_0x34bf47[_0x467244(0x183)]),_0x3eb728={'name':_0x50ab66,'description':_0x34bf47[_0x467244(0x21f)],'scheduleType':_0x34bf47[_0x467244(0x279)],'scheduleOption':_0x34bf47[_0x467244(0x1a0)],'timezone':_0x34bf47[_0x467244(0x255)],'master':{'parentDatabaseName':_0x34bf47['database'],'parentTableName':_0x34bf47[_0x467244(0x258)]},'attributes':_0x382391,'behaviors':_0x142f3b,'customerGroup':_0x52e895},_0x2cc7fc=await withSpinner(_0x467244(0x221)+_0x50ab66+'\x27...',()=>_0x523542[_0x467244(0x20f)]['createParent'](_0x3eb728),{'verbose':_0x1d2980[_0x467244(0x28f)]}),_0x9ab870=_0x2cc7fc[_0x467244(0x226)];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0x9ab870[_0x467244(0x262)]+_0x467244(0x1af)+_0x9ab870['id']),await handleSDKOutput([_0x9ab870],_0x1d2980),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a27_0xe4513(0x1b0)](_0x3d28c1){const _0x2db336=a27_0xe4513,{options:_0xf5407a,args:_0x29243d,tdx:_0xdd5c59}=_0x3d28c1;console[_0x2db336(0x257)](_0x2db336(0x1b5)+_0x2db336(0x18a)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x3aabc9=_0xf5407a;if(_0x29243d[_0x2db336(0x239)]===0x0)return console[_0x2db336(0x257)](_0x2db336(0x1f6)),console[_0x2db336(0x257)](_0x2db336(0x288)),0x1;const _0x1a64ac=_0x29243d[0x0];_0x3aabc9[_0x2db336(0x28f)]&&(console[_0x2db336(0x257)](_0x2db336(0x175)+_0x3aabc9[_0x2db336(0x27c)]),console['error'](_0x2db336(0x198)+_0x1a64ac));const _0x13e8ea=await withSpinner(_0x2db336(0x241)+_0x1a64ac+_0x2db336(0x275),()=>_0xdd5c59['segment']['getParentFull'](_0x1a64ac),{'verbose':_0x3aabc9[_0x2db336(0x28f)]}),_0x14f8b1=_0x13e8ea['data'],_0x505bc7=await loadJSONFromOptions(_0x3aabc9['addAttributes'],_0x3aabc9[_0x2db336(0x1bc)]),_0x813b1e=await loadJSONFromOptions(_0x3aabc9[_0x2db336(0x23b)],_0x3aabc9['addBehaviorsFile']),_0x5bb024={'name':_0x14f8b1['name'],'description':_0x3aabc9['description']!==undefined?_0x3aabc9['description']:_0x14f8b1[_0x2db336(0x21f)],'scheduleType':_0x3aabc9[_0x2db336(0x279)]!==undefined?_0x3aabc9[_0x2db336(0x279)]:_0x14f8b1['scheduleType'],'scheduleOption':_0x3aabc9['scheduleOption']!==undefined?_0x3aabc9[_0x2db336(0x1a0)]:_0x14f8b1[_0x2db336(0x1a0)],'timezone':_0x3aabc9[_0x2db336(0x255)]!==undefined?_0x3aabc9[_0x2db336(0x255)]:_0x14f8b1['timezone'],'master':_0x14f8b1[_0x2db336(0x1ec)],'attributes':_0x505bc7?[..._0x14f8b1['attributes']||[],..._0x505bc7]:_0x14f8b1[_0x2db336(0x189)],'behaviors':_0x813b1e?[..._0x14f8b1[_0x2db336(0x1a1)]||[],..._0x813b1e]:_0x14f8b1[_0x2db336(0x1a1)],'customerGroup':_0x14f8b1[_0x2db336(0x243)]},_0x1471d6=await withSpinner(_0x2db336(0x1d9)+_0x1a64ac+_0x2db336(0x275),()=>_0xdd5c59[_0x2db336(0x20f)][_0x2db336(0x23a)](_0x1a64ac,_0x5bb024),{'verbose':_0x3aabc9[_0x2db336(0x28f)]}),_0x205037=_0x1471d6[_0x2db336(0x226)];return console['error'](_0x2db336(0x24d)+_0x205037['name']+'\x27'),await handleSDKOutput([_0x205037],_0x3aabc9),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x18b);['description']='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a27_0xe4513(0x1b0)](_0x39978e){const _0x706327=a27_0xe4513,{options:_0x360a04,args:_0x434c6,tdx:_0x204405}=_0x39978e,_0x2feb6a=_0x360a04,_0x4559e2=_0x434c6[0x0]||_0x360a04[_0x706327(0x17a)];if(!_0x4559e2)return console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x25f)](_0x706327(0x229))),console['error'](_0x706327(0x1bb)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x1cc)](_0x706327(0x1c2))),0x1;if(_0x2feb6a[_0x706327(0x214)]&&_0x2feb6a[_0x706327(0x292)])return console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x25f)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console['error'](a27_0x393c4e['dim'](_0x706327(0x1a4))),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x21d)](_0x706327(0x18f)+PARENT_SEGMENT_DIR+_0x706327(0x240))),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x1cc)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x534a91=_0x2feb6a[_0x706327(0x292)]||a27_0x2eadbd[_0x706327(0x1aa)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4559e2)+_0x706327(0x24b));_0x2feb6a['verbose']&&(console[_0x706327(0x257)]('Site:\x20'+_0x2feb6a['site']),console[_0x706327(0x257)]('Parent\x20segment:\x20'+_0x4559e2),console['error'](_0x706327(0x271)+_0x534a91));const _0x4dd2ba=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x4559e2+'\x27...',()=>_0x204405[_0x706327(0x20f)][_0x706327(0x26d)](_0x4559e2),{'verbose':_0x2feb6a[_0x706327(0x28f)]}),_0x553d9e=_0x4dd2ba['data'];if(existsSync(_0x534a91)){const _0x4bddb5=readFileSync(_0x534a91,_0x706327(0x1d1)),_0xff2e1c=generateDiff(_0x4bddb5,_0x553d9e);if(!hasChanges(_0xff2e1c))console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x266)+a27_0x393c4e['cyan'](_0x534a91)+_0x706327(0x289));else{console[_0x706327(0x257)]('\x0aChanges\x20to\x20\x27'+_0x534a91+'\x27:'),console[_0x706327(0x257)]('─'[_0x706327(0x18d)](0x3c)),console['error'](formatDiffWithColors(_0xff2e1c)),console[_0x706327(0x257)]('─'[_0x706327(0x18d)](0x3c));if(!_0x2feb6a[_0x706327(0x22e)]){const _0x54a040=await confirmKey('Overwrite\x20\x27'+_0x534a91+'\x27?');if(!_0x54a040)return console[_0x706327(0x257)](_0x706327(0x260)),0x1;}writeFileSync(_0x534a91,_0x553d9e,_0x706327(0x1d1)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x27d)+a27_0x393c4e[_0x706327(0x1cc)](_0x534a91));}}else{const _0x5e3cb4=a27_0x2eadbd[_0x706327(0x205)](_0x534a91);!existsSync(_0x5e3cb4)&&mkdirSync(_0x5e3cb4,{'recursive':!![]}),writeFileSync(_0x534a91,_0x553d9e,_0x706327(0x1d1)),console[_0x706327(0x257)](a27_0x393c4e[_0x706327(0x20c)]('✔')+_0x706327(0x27d)+a27_0x393c4e['cyan'](_0x534a91));}return saveSessionContext({'parent_segment':_0x4559e2},_0x2feb6a['session']),console[_0x706327(0x257)](a27_0x393c4e['green']('✔')+'\x20Context\x20set:\x20'+a27_0x393c4e['dim'](_0x706327(0x190))+_0x706327(0x18c)+a27_0x393c4e[_0x706327(0x1cc)](_0x4559e2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x1a5);[a27_0xe4513(0x21f)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a27_0xe4513(0x1b0)](_0x3be310){const _0x51e7e3=a27_0xe4513,{options:_0xe40479,args:_0x4a4bc2,tdx:_0x2036d0}=_0x3be310,_0x1b6870=_0xe40479,_0x2fd141=_0x4a4bc2[0x0]||_0xe40479[_0x51e7e3(0x17a)];if(!_0x2fd141)return console[_0x51e7e3(0x257)](a27_0x393c4e['red'](_0x51e7e3(0x229))),console[_0x51e7e3(0x257)]('Usage:\x20tdx\x20ps\x20push\x20[name]\x20[-y]\x0a'),console[_0x51e7e3(0x257)](a27_0x393c4e['cyan']('Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20use\x20`tdx\x20ps\x20pull`\x20to\x20get\x20a\x20YAML\x20file\x20first')),0x1;const _0xaebbc2=resolveYamlFile(_0x2fd141);if(!existsSync(_0xaebbc2))return showFileNotFoundError(_0xaebbc2,_0x2fd141),0x1;_0x1b6870['verbose']&&(console[_0x51e7e3(0x257)]('Site:\x20'+_0x1b6870[_0x51e7e3(0x27c)]),console[_0x51e7e3(0x257)]('YAML\x20file:\x20'+_0xaebbc2));let _0x314748;try{_0x314748=readFileSync(_0xaebbc2,_0x51e7e3(0x1d1));}catch(_0x33e732){const _0x2932d5=_0x33e732 instanceof Error?_0x33e732[_0x51e7e3(0x1d5)]:String(_0x33e732);return console[_0x51e7e3(0x257)](_0x51e7e3(0x278)+_0x2932d5),0x1;}const _0x3a7f8a=await withSpinner(_0x51e7e3(0x1fd),()=>_0x2036d0[_0x51e7e3(0x20f)]['pushParentYaml'](_0x314748),{'verbose':_0x1b6870[_0x51e7e3(0x28f)]}),_0x557f1a=_0x3a7f8a[_0x51e7e3(0x226)],{isNew:_0x24704c,name:_0x5a23c3,hasChanges:_0x936347,diffFormatted:_0x50f9e2}=_0x557f1a;if(!_0x936347)return console[_0x51e7e3(0x257)](_0x51e7e3(0x1a3)+_0x5a23c3+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x24704c?console[_0x51e7e3(0x257)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x5a23c3+'\x27:'):console[_0x51e7e3(0x257)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x5a23c3+'\x27:');console[_0x51e7e3(0x257)]('─'[_0x51e7e3(0x18d)](0x3c)),console[_0x51e7e3(0x257)](_0x50f9e2),console['error']('─'[_0x51e7e3(0x18d)](0x3c));const _0x2f1ee5=_0x24704c?_0x51e7e3(0x197)+_0x5a23c3+'\x27?':_0x51e7e3(0x18e)+_0x5a23c3+'\x27?';if(!_0x1b6870['yes']){const _0x45a613=await confirmKey(_0x2f1ee5);if(!_0x45a613)return console[_0x51e7e3(0x257)]('Aborted.'),0x1;}const _0x4a095d=_0x24704c?_0x51e7e3(0x28a):_0x51e7e3(0x204),_0x1ad3ba=await withSpinner(_0x4a095d+_0x51e7e3(0x1b4)+_0x5a23c3+_0x51e7e3(0x275),()=>_0x557f1a[_0x51e7e3(0x27e)](),{'verbose':_0x1b6870[_0x51e7e3(0x28f)]}),_0x3991f0=_0x1ad3ba['data'],_0x390646=getConsoleNextUrl(_0x1b6870[_0x51e7e3(0x27c)],_0x51e7e3(0x26b)+_0x3991f0['id']),_0x9a7de6=_0x24704c?_0x51e7e3(0x20b):_0x51e7e3(0x1da);return console['error']('✔\x20'+_0x9a7de6+'\x20parent\x20segment\x20\x27'+_0x3991f0[_0x51e7e3(0x262)]+'\x27'),console[_0x51e7e3(0x257)]('\x20\x20'+_0x390646),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a27_0xe4513(0x21a);[a27_0xe4513(0x21f)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a27_0xe4513(0x1b0)](_0x537193){const _0x454202=a27_0xe4513,{options:_0x52384b,args:_0x15dd46,tdx:_0x4370e4}=_0x537193,_0x1e063a=_0x52384b,_0xddacae=_0x15dd46[0x0]||_0x52384b['parentSegment'];if(!_0xddacae)return console[_0x454202(0x257)](a27_0x393c4e[_0x454202(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x454202(0x257)](_0x454202(0x23d)),console[_0x454202(0x257)](_0x454202(0x1f0)),console[_0x454202(0x257)](_0x454202(0x1f9)),console['error']('\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)'),console[_0x454202(0x257)](_0x454202(0x193)),console[_0x454202(0x257)](a27_0x393c4e[_0x454202(0x1cc)](_0x454202(0x1ca))),0x1;const _0x521335=resolveYamlFile(_0xddacae);if(!existsSync(_0x521335))return showFileNotFoundError(_0x521335,_0xddacae),0x1;_0x1e063a[_0x454202(0x28f)]&&(console[_0x454202(0x257)](_0x454202(0x175)+_0x1e063a['site']),console['error'](_0x454202(0x1b2)+_0x521335));let _0x35f1bc;try{_0x35f1bc=readFileSync(_0x521335,_0x454202(0x1d1));}catch(_0x342500){const _0x374612=_0x342500 instanceof Error?_0x342500[_0x454202(0x1d5)]:String(_0x342500);return console[_0x454202(0x257)](_0x454202(0x278)+_0x374612),0x1;}const _0x2a99d8=createCommandSpinner(a27_0x393c4e[_0x454202(0x21d)]('Validating\x20configuration...'),{'verbose':_0x1e063a[_0x454202(0x28f)]});_0x2a99d8[_0x454202(0x246)]();const _0x39e43c={'onProgress':_0x1a83e9=>{const _0x28272e=_0x454202;_0x2a99d8[_0x28272e(0x1de)]=formatProgressMessage(_0x1a83e9);}};if(_0x1e063a[_0x454202(0x1ec)])_0x39e43c[_0x454202(0x1ec)]=!![];if(_0x1e063a[_0x454202(0x17f)])_0x39e43c[_0x454202(0x17f)]=!![];_0x1e063a[_0x454202(0x219)]&&(_0x39e43c[_0x454202(0x219)]=_0x1e063a[_0x454202(0x219)]);_0x1e063a[_0x454202(0x206)]&&(_0x39e43c['behavior']=_0x1e063a[_0x454202(0x206)]);if(_0x1e063a['interval'])_0x39e43c['interval']=_0x1e063a[_0x454202(0x1bd)];let _0x3f65ad;try{_0x3f65ad=await _0x4370e4[_0x454202(0x20f)][_0x454202(0x208)](_0x35f1bc,_0x39e43c),_0x2a99d8[_0x454202(0x1b3)]();}catch(_0xe196d1){_0x2a99d8[_0x454202(0x1b3)]();throw _0xe196d1;}const _0x48c68c=_0x1e063a[_0x454202(0x1bd)]||_0x454202(0x1dc);return this[_0x454202(0x272)](_0x3f65ad,_0x39e43c,_0x521335,_0x48c68c),_0x3f65ad['allValid']?0x0:0x1;}[a27_0xe4513(0x272)](_0x143da4,_0x10d31d,_0x139a06,_0x1f9cf1){const _0x42c44d=a27_0xe4513;console[_0x42c44d(0x257)]('\x0a'+a27_0x393c4e[_0x42c44d(0x1d6)](_0x42c44d(0x269))+'\x20'+_0x143da4['name']),console[_0x42c44d(0x257)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x143da4);if(typeof _0x10d31d[_0x42c44d(0x219)]===_0x42c44d(0x1a6)){this['displayAttributesStats'](_0x143da4),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,'attribute',_0x10d31d[_0x42c44d(0x219)]);return;}if(_0x10d31d[_0x42c44d(0x219)]===!![]){this[_0x42c44d(0x245)](_0x143da4),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,_0x42c44d(0x189));return;}if(typeof _0x10d31d['behavior']==='string'){this['displayBehaviorsStats'](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,_0x42c44d(0x206),_0x10d31d[_0x42c44d(0x206)]);return;}if(_0x10d31d[_0x42c44d(0x206)]===!![]){this[_0x42c44d(0x223)](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this['displayPreviewHints'](_0x139a06,_0x1f9cf1,_0x42c44d(0x1a1));return;}this[_0x42c44d(0x245)](_0x143da4),this[_0x42c44d(0x223)](_0x143da4,_0x1f9cf1),this[_0x42c44d(0x1f4)](_0x143da4),this[_0x42c44d(0x230)](_0x139a06,_0x1f9cf1,'all');}['displayPreviewHints'](_0x248f3e,_0x2190a4,_0x224222,_0x43602f){const _0x1a148a=a27_0xe4513;console[_0x1a148a(0x257)]('\x0a'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x252)));const _0x437d63=_0x2190a4!==_0x1a148a(0x1dc)?_0x1a148a(0x232)+_0x2190a4:'';if(_0x224222==='attribute'&&_0x43602f)console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e['dim'](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x22a)+_0x43602f+'\x22'+_0x437d63));else{if(_0x224222===_0x1a148a(0x206)&&_0x43602f)console['error']('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x24f)+_0x43602f+'\x22'+_0x437d63));else(_0x224222===_0x1a148a(0x189)||_0x224222===_0x1a148a(0x1fb))&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x19d)+_0x437d63));}(_0x224222==='behaviors'||_0x224222===_0x1a148a(0x1fb))&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e[_0x1a148a(0x21d)]('tdx\x20segment\x20parent\x20preview\x20'+_0x248f3e+_0x1a148a(0x1c9)+_0x437d63)),_0x224222===_0x1a148a(0x1fb)&&console[_0x1a148a(0x257)]('\x20\x20'+a27_0x393c4e['dim'](_0x1a148a(0x268)+_0x248f3e+_0x1a148a(0x1a7)+_0x437d63));}['displayMasterInfo'](_0x1f773d){const _0x15f35b=a27_0xe4513,{master:_0x590b65}=_0x1f773d,_0x118efa=_0x590b65[_0x15f35b(0x24a)]?a27_0x393c4e[_0x15f35b(0x20c)]('✔'):a27_0x393c4e['red']('✘');console[_0x15f35b(0x257)]('\x0a'+a27_0x393c4e[_0x15f35b(0x21d)](_0x15f35b(0x1eb))),console['error'](_0x118efa+'\x20'+a27_0x393c4e[_0x15f35b(0x1d6)](_0x590b65[_0x15f35b(0x19a)]+'.'+_0x590b65[_0x15f35b(0x258)])),_0x590b65[_0x15f35b(0x24a)]?_0x590b65[_0x15f35b(0x20e)]!==undefined&&console[_0x15f35b(0x257)]('\x20\x20'+a27_0x393c4e[_0x15f35b(0x21d)](_0x15f35b(0x1e2))+'\x20'+a27_0x393c4e[_0x15f35b(0x1cc)](formatRows(_0x590b65['rowCount']))):console[_0x15f35b(0x257)]('\x20\x20'+a27_0x393c4e['red'](_0x15f35b(0x1ba))+'\x20'+_0x590b65[_0x15f35b(0x213)]);}[a27_0xe4513(0x245)](_0x4fa0d2){const _0x1ffb6c=a27_0xe4513;if(_0x4fa0d2[_0x1ffb6c(0x189)]['length']===0x0)return;console[_0x1ffb6c(0x257)]('\x0a'+a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x1fa)));for(const _0x14598f of _0x4fa0d2['attributes']){const _0x46e617=_0x14598f[_0x1ffb6c(0x24a)]?a27_0x393c4e[_0x1ffb6c(0x20c)]('✔'):a27_0x393c4e['red']('✘');let _0x59ecce='';if(_0x14598f[_0x1ffb6c(0x24a)]&&_0x14598f[_0x1ffb6c(0x291)]!==undefined&&_0x14598f[_0x1ffb6c(0x17d)]!==undefined){const _0x53567a=_0x14598f[_0x1ffb6c(0x17d)][_0x1ffb6c(0x19f)](0x1),_0x450d75=_0x14598f[_0x1ffb6c(0x17d)]>=0x50?a27_0x393c4e[_0x1ffb6c(0x20c)]:_0x14598f[_0x1ffb6c(0x17d)]>=0x32?a27_0x393c4e[_0x1ffb6c(0x274)]:a27_0x393c4e['red'];_0x59ecce='\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)]('Coverage:')+'\x20'+_0x450d75(_0x53567a+'%')+'\x20('+formatRows(_0x14598f[_0x1ffb6c(0x291)])+_0x1ffb6c(0x263);}console[_0x1ffb6c(0x257)](_0x46e617+'\x20'+a27_0x393c4e[_0x1ffb6c(0x1d6)](_0x14598f[_0x1ffb6c(0x262)])+_0x59ecce),console['error']('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x1e8))+'\x20'+a27_0x393c4e[_0x1ffb6c(0x1d6)](_0x14598f['database']+'.'+_0x14598f[_0x1ffb6c(0x258)]));const _0x6bea5c=_0x14598f['joinKey']===_0x14598f[_0x1ffb6c(0x27a)]?a27_0x393c4e[_0x1ffb6c(0x21d)]('Join\x20on:')+'\x20'+_0x14598f['joinKey']:a27_0x393c4e[_0x1ffb6c(0x21d)](_0x1ffb6c(0x254))+'\x20'+_0x14598f[_0x1ffb6c(0x25a)]+_0x1ffb6c(0x18c)+_0x14598f[_0x1ffb6c(0x27a)];console[_0x1ffb6c(0x257)]('\x20\x20'+_0x6bea5c),console['error']('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x21d)]('Columns:')),this[_0x1ffb6c(0x1cd)](_0x14598f[_0x1ffb6c(0x199)]),!_0x14598f[_0x1ffb6c(0x24a)]&&console[_0x1ffb6c(0x257)]('\x20\x20'+a27_0x393c4e[_0x1ffb6c(0x25f)](_0x1ffb6c(0x1ba))+'\x20'+_0x14598f['schemaError']);}}[a27_0xe4513(0x223)](_0x284d70,_0x5c0d0b){const _0x383aee=a27_0xe4513;if(_0x284d70['behaviors'][_0x383aee(0x239)]===0x0)return;console[_0x383aee(0x257)]('\x0a'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1c1))+'\x20'+a27_0x393c4e[_0x383aee(0x21d)]('('+_0x5c0d0b+')'));for(const _0x479c3a of _0x284d70['behaviors']){const _0x1f9b2e=_0x479c3a[_0x383aee(0x24a)]?a27_0x393c4e[_0x383aee(0x20c)]('✔'):a27_0x393c4e['red']('✘');let _0x4efea2='';if(_0x479c3a['schemaValid']&&_0x479c3a['customersWithEvents']!==undefined&&_0x479c3a[_0x383aee(0x25e)]!==undefined){const _0x2d4e01=_0x479c3a[_0x383aee(0x280)]?.[_0x383aee(0x19f)](0x1)||'?',_0x42cfe1=(_0x479c3a['customerPercent']??0x0)>=0x32?a27_0x393c4e[_0x383aee(0x20c)]:(_0x479c3a[_0x383aee(0x280)]??0x0)>=0x14?a27_0x393c4e[_0x383aee(0x274)]:a27_0x393c4e[_0x383aee(0x25f)];_0x4efea2='\x20'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1ed))+'\x20'+_0x42cfe1(formatRows(_0x479c3a[_0x383aee(0x231)]))+'\x20('+_0x2d4e01+'%)\x20'+a27_0x393c4e['dim'](_0x383aee(0x1c0))+'\x20'+a27_0x393c4e['cyan'](formatRows(_0x479c3a[_0x383aee(0x25e)]));}console[_0x383aee(0x257)](_0x1f9b2e+'\x20'+a27_0x393c4e['bold'](_0x479c3a['name'])+_0x4efea2),console[_0x383aee(0x257)]('\x20\x20'+a27_0x393c4e[_0x383aee(0x21d)](_0x383aee(0x1e8))+'\x20'+a27_0x393c4e[_0x383aee(0x1d6)](_0x479c3a[_0x383aee(0x19a)]+'.'+_0x479c3a[_0x383aee(0x258)]));const _0x9a5840=_0x479c3a[_0x383aee(0x25a)]===_0x479c3a[_0x383aee(0x27a)]?a27_0x393c4e['dim'](_0x383aee(0x1db))+'\x20'+_0x479c3a[_0x383aee(0x25a)]:a27_0x393c4e['dim'](_0x383aee(0x254))+'\x20'+_0x479c3a['joinKey']+_0x383aee(0x18c)+_0x479c3a[_0x383aee(0x27a)];console[_0x383aee(0x257)]('\x20\x20'+_0x9a5840),console['error']('\x20\x20'+a27_0x393c4e['dim'](_0x383aee(0x1d7))),this[_0x383aee(0x1cd)](_0x479c3a[_0x383aee(0x199)]),!_0x479c3a[_0x383aee(0x24a)]&&console['error']('\x20\x20'+a27_0x393c4e[_0x383aee(0x25f)]('Error:')+'\x20'+_0x479c3a['schemaError']);}}[a27_0xe4513(0x1cd)](_0x2f3615){const _0x5557cb=a27_0xe4513;for(const _0xf8eeb7 of _0x2f3615){_0xf8eeb7['label']===_0xf8eeb7[_0x5557cb(0x187)]||_0xf8eeb7[_0x5557cb(0x187)]==='*'?console[_0x5557cb(0x257)](_0x5557cb(0x1f8)+_0xf8eeb7['label']):console['error'](_0x5557cb(0x1f8)+_0xf8eeb7[_0x5557cb(0x188)]+'\x20'+a27_0x393c4e['dim']('('+_0xf8eeb7[_0x5557cb(0x187)]+')'));}}[a27_0xe4513(0x1f4)](_0x308b3e){const _0x31f453=a27_0xe4513;console[_0x31f453(0x257)]('─'[_0x31f453(0x18d)](0x3c));if(_0x308b3e[_0x31f453(0x17c)][_0x31f453(0x239)]>0x0){console[_0x31f453(0x257)]('\x0a'+a27_0x393c4e[_0x31f453(0x25f)](_0x31f453(0x1b9)));for(const _0x995649 of _0x308b3e['errors']){console[_0x31f453(0x257)]('\x20\x20'+a27_0x393c4e[_0x31f453(0x25f)]('•')+'\x20'+_0x995649);}}_0x308b3e[_0x31f453(0x222)]&&console[_0x31f453(0x257)]('\x0a'+a27_0x393c4e[_0x31f453(0x20c)]('✔')+_0x31f453(0x28d));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x264);[a27_0xe4513(0x21f)]=a27_0xe4513(0x1b6);async[a27_0xe4513(0x1b0)](_0x980ec9){const _0x573298=a27_0xe4513,{options:_0x4b4117,args:_0x164bf6,tdx:_0x19cd02}=_0x980ec9,_0x1238db=_0x4b4117,_0x43ec50=_0x164bf6[0x0]||_0x4b4117[_0x573298(0x17a)];if(!_0x43ec50)return console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x229))),console[_0x573298(0x257)](_0x573298(0x1ae)),console[_0x573298(0x257)](_0x573298(0x1e4)),console['error'](_0x573298(0x1e9)),console[_0x573298(0x257)](_0x573298(0x1fe)),console[_0x573298(0x257)](_0x573298(0x1d8)),console[_0x573298(0x257)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),console[_0x573298(0x257)](_0x573298(0x193)),console[_0x573298(0x257)](a27_0x393c4e['cyan'](_0x573298(0x1ca))),0x1;if(!_0x1238db[_0x573298(0x1ec)]&&!_0x1238db[_0x573298(0x219)]&&!_0x1238db[_0x573298(0x206)]&&!_0x1238db[_0x573298(0x17f)])return console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x194))),console[_0x573298(0x257)](_0x573298(0x1ae)),console['error'](_0x573298(0x1f0)),console[_0x573298(0x257)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x573298(0x257)](_0x573298(0x1fe)),console[_0x573298(0x257)](_0x573298(0x1d8)),console[_0x573298(0x257)](_0x573298(0x227)),0x1;const _0x544844=resolveYamlFile(_0x43ec50);if(!existsSync(_0x544844))return showFileNotFoundError(_0x544844,_0x43ec50),0x1;_0x1238db[_0x573298(0x28f)]&&(console[_0x573298(0x257)](_0x573298(0x175)+_0x1238db[_0x573298(0x27c)]),console[_0x573298(0x257)](_0x573298(0x1b2)+_0x544844));let _0x1e6c6a;try{_0x1e6c6a=readFileSync(_0x544844,_0x573298(0x1d1));}catch(_0x11e38e){const _0xedcfb0=_0x11e38e instanceof Error?_0x11e38e['message']:String(_0x11e38e);return console[_0x573298(0x257)](_0x573298(0x278)+_0xedcfb0),0x1;}let _0x274b95;try{_0x274b95=parseYamlString(_0x1e6c6a);}catch(_0x380012){const _0x412180=_0x380012 instanceof Error?_0x380012[_0x573298(0x1d5)]:String(_0x380012);return console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)]('Error\x20parsing\x20YAML:\x20'+_0x412180)),0x1;}if(_0x1238db[_0x573298(0x219)]===!![]||_0x1238db[_0x573298(0x219)]===''){const _0x4e64e4=_0x274b95[_0x573298(0x189)]?.['map'](_0x1c971a=>_0x1c971a[_0x573298(0x262)])||[];if(_0x4e64e4[_0x573298(0x239)]===0x0)console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x1a8)));else{console['error'](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x202))),console[_0x573298(0x257)](_0x573298(0x287));for(const _0x49b7dc of _0x4e64e4){console[_0x573298(0x257)]('\x20\x20'+a27_0x393c4e[_0x573298(0x1cc)](_0x49b7dc));}console['error'](_0x573298(0x265)+_0x43ec50+'\x20--attribute\x20\x22'+_0x4e64e4[0x0]+'\x22');}return 0x1;}if(_0x1238db[_0x573298(0x206)]===!![]||_0x1238db[_0x573298(0x206)]===''){const _0x11c77f=_0x274b95[_0x573298(0x1a1)]?.[_0x573298(0x200)](_0x2dea67=>_0x2dea67[_0x573298(0x262)])||[];if(_0x11c77f[_0x573298(0x239)]===0x0)console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x573298(0x257)](a27_0x393c4e[_0x573298(0x25f)](_0x573298(0x217))),console['error'](_0x573298(0x1d4));for(const _0x5e303a of _0x11c77f){console['error']('\x20\x20'+a27_0x393c4e['cyan'](_0x5e303a));}console[_0x573298(0x257)](_0x573298(0x265)+_0x43ec50+_0x573298(0x24f)+_0x11c77f[0x0]+'\x22');}return 0x1;}const _0x7ea2a8=createCommandSpinner(a27_0x393c4e[_0x573298(0x21d)](_0x573298(0x249)),{'verbose':_0x1238db[_0x573298(0x28f)]});_0x7ea2a8[_0x573298(0x246)]();const _0x2a3b15={'onProgress':_0x46be19=>{const _0x57e2cc=_0x573298;_0x7ea2a8[_0x57e2cc(0x1de)]=formatProgressMessage(_0x46be19);}};if(_0x1238db[_0x573298(0x1ec)])_0x2a3b15['master']=!![];if(_0x1238db[_0x573298(0x219)]&&typeof _0x1238db['attribute']===_0x573298(0x1a6))_0x2a3b15[_0x573298(0x219)]=_0x1238db[_0x573298(0x219)];if(_0x1238db[_0x573298(0x206)]&&typeof _0x1238db[_0x573298(0x206)]===_0x573298(0x1a6))_0x2a3b15['behavior']=_0x1238db[_0x573298(0x206)];if(_0x1238db[_0x573298(0x17f)])_0x2a3b15[_0x573298(0x17f)]=!![];if(_0x1238db[_0x573298(0x1bd)])_0x2a3b15[_0x573298(0x1bd)]=_0x1238db[_0x573298(0x1bd)];let _0x486efb;try{_0x486efb=await _0x19cd02['segment'][_0x573298(0x21e)](_0x1e6c6a,_0x2a3b15),_0x7ea2a8[_0x573298(0x1b3)]();}catch(_0x5a5ecc){_0x7ea2a8[_0x573298(0x1b3)]();throw _0x5a5ecc;}return await this[_0x573298(0x191)](_0x486efb,{'master':_0x1238db[_0x573298(0x1ec)],'attribute':typeof _0x1238db[_0x573298(0x219)]===_0x573298(0x1a6)?_0x1238db[_0x573298(0x219)]:undefined,'behavior':typeof _0x1238db[_0x573298(0x206)]==='string'?_0x1238db[_0x573298(0x206)]:undefined,'enriched':_0x1238db[_0x573298(0x17f)]}),_0x486efb['allValid']?0x0:0x1;}async[a27_0xe4513(0x191)](_0x5a4e2e,_0x2f9989){const _0x5d4e7b=a27_0xe4513;console[_0x5d4e7b(0x257)]('\x0a'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x5d4e7b(0x1d2))+'\x20'+_0x5a4e2e[_0x5d4e7b(0x262)]),console[_0x5d4e7b(0x257)]('═'['repeat'](0x3c));if(_0x2f9989['master']&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x521585=a27_0x393c4e[_0x5d4e7b(0x21d)]('Master:')+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x5a4e2e[_0x5d4e7b(0x1ec)][_0x5d4e7b(0x19a)]+'.'+_0x5a4e2e[_0x5d4e7b(0x1ec)]['table']);await this[_0x5d4e7b(0x24c)](_0x521585,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else{if(_0x2f9989[_0x5d4e7b(0x219)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x579597=a27_0x393c4e[_0x5d4e7b(0x21d)](_0x5d4e7b(0x28b))+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x2f9989['attribute']);await this[_0x5d4e7b(0x24c)](_0x579597,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else{if(_0x2f9989[_0x5d4e7b(0x206)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x131c3c=a27_0x393c4e['dim']('Behavior:')+'\x20'+a27_0x393c4e[_0x5d4e7b(0x1d6)](_0x2f9989[_0x5d4e7b(0x206)]);await this[_0x5d4e7b(0x24c)](_0x131c3c,_0x5a4e2e['sampleData']);}else{if(_0x2f9989[_0x5d4e7b(0x17f)]&&_0x5a4e2e[_0x5d4e7b(0x1ea)]){const _0x41ecef=a27_0x393c4e[_0x5d4e7b(0x21d)]('Enriched:')+'\x20'+a27_0x393c4e['bold'](_0x5d4e7b(0x235));await this[_0x5d4e7b(0x24c)](_0x41ecef,_0x5a4e2e[_0x5d4e7b(0x1ea)]);}else!_0x5a4e2e['sampleData']&&console[_0x5d4e7b(0x257)](_0x5d4e7b(0x1df));}}}if(_0x5a4e2e['errors'][_0x5d4e7b(0x239)]>0x0){console[_0x5d4e7b(0x257)]('─'['repeat'](0x3c)),console[_0x5d4e7b(0x257)]('\x0a'+a27_0x393c4e['red']('Errors:'));for(const _0x37467c of _0x5a4e2e[_0x5d4e7b(0x17c)]){console['error']('\x20\x20'+a27_0x393c4e['red']('•')+'\x20'+_0x37467c);}}}async[a27_0xe4513(0x24c)](_0x2d37dd,_0x467583){const _0x426667=a27_0xe4513;if(_0x467583[_0x426667(0x239)]===0x0){console['error']('\x0a'+_0x2d37dd),console[_0x426667(0x257)](_0x426667(0x17b));return;}console[_0x426667(0x257)]('\x0a'+_0x2d37dd);const _0x398837=Object[_0x426667(0x284)](_0x467583[0x0])['map'](_0x223ba0=>({'name':_0x223ba0,'type':typeof _0x467583[0x0][_0x223ba0]===_0x426667(0x22f)?_0x426667(0x201):_0x426667(0x238)})),_0x3aee7f={'queryId':_0x426667(0x244),'columns':_0x398837,'data':_0x467583,'stats':{'state':_0x426667(0x1ad),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x467583[_0x426667(0x239)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x7f9d10=formatAsTable(_0x3aee7f,_0x467583[_0x426667(0x239)],!![]);await writeOutput(_0x7f9d10,undefined,_0x426667(0x258));}}function a27_0x545b(_0x47f12d,_0x521d1c){_0x47f12d=_0x47f12d-0x175;const _0x32a9bd=a27_0x32a9();let _0x545b49=_0x32a9bd[_0x47f12d];return _0x545b49;}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x23f);[a27_0xe4513(0x21f)]=a27_0xe4513(0x26e);async[a27_0xe4513(0x1b0)](_0x39bc7e){const _0x20524e=a27_0xe4513,{options:_0x4ec766,args:_0x3eb623,tdx:_0x1f538e}=_0x39bc7e,_0x479fbf=_0x4ec766,_0x10278f=_0x3eb623[0x0]||_0x4ec766[_0x20524e(0x17a)];if(!_0x10278f)return console[_0x20524e(0x257)](a27_0x393c4e[_0x20524e(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x20524e(0x257)](_0x20524e(0x1c5)),console[_0x20524e(0x257)](a27_0x393c4e[_0x20524e(0x1cc)](_0x20524e(0x1c2))),0x1;const _0x3880c6=resolveYamlFile(_0x10278f);if(existsSync(_0x3880c6)){_0x479fbf['verbose']&&console[_0x20524e(0x257)]('Found\x20YAML\x20file:\x20'+_0x3880c6);let _0x2daed;try{_0x2daed=readFileSync(_0x3880c6,_0x20524e(0x1d1));}catch(_0x58ddbb){const _0x53184b=_0x58ddbb instanceof Error?_0x58ddbb[_0x20524e(0x1d5)]:String(_0x58ddbb);return console[_0x20524e(0x257)](_0x20524e(0x278)+_0x53184b),0x1;}const _0x2b0bb4=await withSpinner(_0x20524e(0x1fd),()=>_0x1f538e[_0x20524e(0x20f)][_0x20524e(0x23c)](_0x2daed),{'verbose':_0x479fbf[_0x20524e(0x28f)]}),_0x72163c=_0x2b0bb4[_0x20524e(0x226)],{isNew:_0x6af045,name:_0x40a8b2,hasChanges:_0x26b37c,diffFormatted:_0x53003b}=_0x72163c;if(_0x26b37c){_0x6af045?console['error'](_0x20524e(0x1d3)+_0x40a8b2+'\x27:'):console[_0x20524e(0x257)](_0x20524e(0x26c)+_0x40a8b2+'\x27:');console[_0x20524e(0x257)]('─'[_0x20524e(0x18d)](0x3c)),console[_0x20524e(0x257)](_0x53003b),console[_0x20524e(0x257)]('─'[_0x20524e(0x18d)](0x3c));const _0x3f3250=_0x6af045?_0x20524e(0x197)+_0x40a8b2+_0x20524e(0x22b):'Apply\x20changes\x20to\x20\x27'+_0x40a8b2+_0x20524e(0x22b);if(!_0x479fbf[_0x20524e(0x22e)]){const _0x1cf0b0=await confirmKey(_0x3f3250);if(!_0x1cf0b0)return console[_0x20524e(0x257)]('Aborted.'),0x1;}const _0x5e6152=_0x6af045?_0x20524e(0x28a):_0x20524e(0x204);await withSpinner(_0x5e6152+_0x20524e(0x1b4)+_0x40a8b2+_0x20524e(0x275),()=>_0x72163c[_0x20524e(0x27e)](),{'verbose':_0x479fbf['verbose']});const _0x300cb2=_0x6af045?_0x20524e(0x20b):_0x20524e(0x1da);console[_0x20524e(0x257)]('✔\x20'+_0x300cb2+_0x20524e(0x1b4)+_0x40a8b2+'\x27');}else console[_0x20524e(0x257)](_0x20524e(0x1a3)+_0x40a8b2+_0x20524e(0x207));}const _0x6e7f36=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x10278f+_0x20524e(0x275),()=>_0x1f538e[_0x20524e(0x20f)][_0x20524e(0x23e)](_0x10278f),{'verbose':_0x479fbf[_0x20524e(0x28f)]}),_0x377259=_0x6e7f36[_0x20524e(0x226)],_0x301faf=getConsoleUrl(_0x479fbf[_0x20524e(0x27c)],_0x20524e(0x242)+_0x377259[_0x20524e(0x17e)]+_0x20524e(0x1e1)+_0x377259[_0x20524e(0x19e)]+_0x20524e(0x234)+_0x377259[_0x20524e(0x228)]);return console['error']('\x0a✔\x20Workflow\x20started'),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x218))+'\x20'+_0x377259['audienceId']),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x21c))+'\x20'+_0x377259[_0x20524e(0x1b1)]),console[_0x20524e(0x257)]('\x20\x20'+a27_0x393c4e[_0x20524e(0x21d)](_0x20524e(0x180))+'\x20'+_0x377259[_0x20524e(0x19e)]),console['error']('\x20\x20'+a27_0x393c4e['dim'](_0x20524e(0x225))+'\x20'+_0x377259[_0x20524e(0x228)]),console[_0x20524e(0x257)]('\x20\x20'+_0x301faf),console[_0x20524e(0x257)]('\x0a'+a27_0x393c4e['dim'](_0x20524e(0x27b))+_0x20524e(0x1ce)+_0x377259[_0x20524e(0x228)]+_0x20524e(0x1e7)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x1b7);[a27_0xe4513(0x21f)]=a27_0xe4513(0x185);async[a27_0xe4513(0x1b0)](_0x125af1){const _0x17779d=a27_0xe4513,{options:_0x26196,args:_0x33d7d5,tdx:_0x146ac6}=_0x125af1,_0x24c200=_0x33d7d5[0x0]||_0x26196[_0x17779d(0x17a)];if(!_0x24c200)return console['error'](a27_0x393c4e[_0x17779d(0x25f)](_0x17779d(0x229))),console[_0x17779d(0x257)](_0x17779d(0x28c)),console[_0x17779d(0x257)](a27_0x393c4e[_0x17779d(0x1cc)](_0x17779d(0x1c2))),0x1;_0x26196['verbose']&&(console['error'](_0x17779d(0x175)+_0x26196['site']),console[_0x17779d(0x257)](_0x17779d(0x198)+_0x24c200));const _0x1f5e89=await withSpinner(_0x17779d(0x290)+_0x24c200+'\x27...',()=>_0x146ac6[_0x17779d(0x20f)]['listFields'](_0x24c200),{'verbose':_0x26196['verbose']}),_0x362d1c=_0x1f5e89[_0x17779d(0x226)];console['error'](_0x17779d(0x25d)+_0x362d1c[_0x17779d(0x239)]+'\x20field'+(_0x362d1c['length']!==0x1?'s':''));if(_0x26196[_0x17779d(0x253)]||_0x26196['jsonl'])return await handleSDKOutput(_0x362d1c,_0x26196),0x0;return displayFieldsHumanReadable(_0x362d1c,_0x24c200),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a27_0xe4513(0x262)]='segment:parent:view';['description']='Show\x20parent\x20segment\x20details';async[a27_0xe4513(0x1b0)](_0x2647ac){const _0x4f4c3b=a27_0xe4513,{options:_0x624d66,args:_0xb886b7,tdx:_0x537ad5}=_0x2647ac,_0x19f858=_0x624d66,_0x40a441=_0xb886b7[0x0]||_0x624d66[_0x4f4c3b(0x17a)];if(!_0x40a441)return console[_0x4f4c3b(0x257)](a27_0x393c4e[_0x4f4c3b(0x25f)](_0x4f4c3b(0x229))),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x1be)),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x1f0)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),console[_0x4f4c3b(0x257)](a27_0x393c4e[_0x4f4c3b(0x1cc)](_0x4f4c3b(0x1ca))),0x1;_0x624d66[_0x4f4c3b(0x28f)]&&(console[_0x4f4c3b(0x257)](_0x4f4c3b(0x175)+_0x624d66[_0x4f4c3b(0x27c)]),console[_0x4f4c3b(0x257)](_0x4f4c3b(0x198)+_0x40a441));const _0x5fd958=await withSpinner(_0x4f4c3b(0x1e6)+_0x40a441+'\x27...',()=>_0x537ad5[_0x4f4c3b(0x20f)]['getParentFull'](_0x40a441),{'verbose':_0x624d66[_0x4f4c3b(0x28f)]}),_0x2bbfab=_0x5fd958['data'];if(_0x19f858[_0x4f4c3b(0x216)]){const _0x40a56f=getConsoleNextUrl(_0x19f858[_0x4f4c3b(0x27c)],_0x4f4c3b(0x26b)+_0x2bbfab['id']);return console['error'](a27_0x393c4e[_0x4f4c3b(0x20c)]('✔')+'\x20Opening\x20'+a27_0x393c4e[_0x4f4c3b(0x1cc)](_0x40a56f)),openBrowser(_0x40a56f),0x0;}return await handleSingleObjectOutput(_0x2bbfab,_0x624d66),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x186);['description']=a27_0xe4513(0x250);async['execute'](_0x1bed8a){const _0xacb483=a27_0xe4513,{options:_0x30191e,args:_0x343cad,tdx:_0x5ab886}=_0x1bed8a,_0x3fa2b1=_0x343cad[0x0]||_0x30191e['parentSegment'];if(!_0x3fa2b1)return console[_0xacb483(0x257)](a27_0x393c4e[_0xacb483(0x25f)](_0xacb483(0x229))),console[_0xacb483(0x257)](_0xacb483(0x1cb)),console[_0xacb483(0x257)](a27_0x393c4e['cyan'](_0xacb483(0x1c2))),0x1;_0x30191e[_0xacb483(0x28f)]&&(console['error']('Site:\x20'+_0x30191e[_0xacb483(0x27c)]),console[_0xacb483(0x257)](_0xacb483(0x198)+_0x3fa2b1));const _0x5d4f3f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3fa2b1+_0xacb483(0x275),()=>_0x5ab886['segment'][_0xacb483(0x212)](_0x3fa2b1),{'verbose':_0x30191e[_0xacb483(0x28f)]}),_0x287d7d=_0x5d4f3f['data'],_0x336910=await withSpinner(_0xacb483(0x1a2)+_0x3fa2b1+_0xacb483(0x275),()=>_0x5ab886[_0xacb483(0x20f)][_0xacb483(0x1e3)](_0x287d7d),{'verbose':_0x30191e[_0xacb483(0x28f)]}),_0x2894cd=await executeSchemaQuery(_0x336910[_0xacb483(0x226)],_0x5ab886,_0x30191e);return await handleQueryOutput(_0x2894cd,_0x30191e),0x0;}}function a27_0x32a9(){const _0x23918a=['Fetching\x20SQL\x20for\x20\x27','✔\x20No\x20changes\x20-\x20\x27','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','segment:parent:push','string','\x20--enriched','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','jsonl','join','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Usage:\x20tdx\x20ps\x20sql\x20[name]\x0a','FINISHED','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x27\x20with\x20ID:\x20','execute','status','YAML\x20file:\x20','stop','\x20parent\x20segment\x20\x27','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','segment:parent:fields','stats','Errors:','Error:','Usage:\x20tdx\x20ps\x20pull\x20[name]\x20[-o\x20output.yml]\x20[-y]\x0a','addAttributesFile','interval','Usage:\x20tdx\x20ps\x20view\x20[name]\x20[-w]\x0a','replace','Events:','Behaviors','Tip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','.yaml','toLowerCase','Usage:\x20tdx\x20parent-segment\x20run\x20<name>\x20[-y]\x0a','77mEWmLv','245336CGWHvz','processedRows','\x20--behavior\x20\x22<name>\x22','\x0aTip:\x20Set\x20context\x20with\x20`tdx\x20ps\x20use\x20<name>`\x20or\x20list\x20with\x20`tdx\x20ps\x20list`','Usage:\x20tdx\x20ps\x20desc\x20[name]\x0a','cyan','displayColumns','\x20tdx\x20wf\x20attempt\x20','format','run','utf-8','Preview:','\x0aNew\x20parent\x20segment\x20\x27','Available\x20behaviors:','message','bold','Columns:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Updating\x20parent\x20segment\x20\x27','Updated','Join\x20on:','-1d','/\x20directories\x20exist.','text','\x0aNo\x20sample\x20data\x20available','Error:\x20--database\x20and\x20--table\x20are\x20required','/sessions/','Rows:','getParentSQL','Options\x20(one\x20required):','`\x20to\x20download\x20the\x20configuration\x20first','Fetching\x20parent\x20segment\x20\x27','\x20kill','Source:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','sampleData','Master\x20Table','master','Customers:','limit','✔\x20Query\x20completed:\x20Processed\x20','Options:','\x20parent\x20segment','\x0a⚠️\x20\x20Migrating:\x20','Table:\x20','displaySummary','behaviorsFile','Error:\x20Parent\x20segment\x20name\x20is\x20required','👥\x20','\x20\x20\x20\x20-\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)','Attributes','all','setJobId','Analyzing\x20changes...','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','match','map','double','Error:\x20--attribute\x20requires\x20a\x20name\x0a','information_schema','Updating','dirname','behavior','\x27\x20is\x20up\x20to\x20date','validateParentYaml','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','segment:parent:list','Created','green','in\x20','rowCount','segment','sort','ignore','resolveParentId','schemaError','use','localeCompare','web','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Audience\x20ID:','attribute','segment:parent:validate','xdg-open','Status:','dim','previewParentYaml','description','endsWith','Creating\x20parent\x20segment\x20\x27','allValid','displayBehaviorsStats','elapsedTimeMillis','Attempt:','data','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','workflowAttemptId','Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a','\x20--attribute\x20\x22','\x27\x20and\x20run\x20workflow?','No\x20parent\x20segments\x20match\x20pattern:\x20','segment:parent:sql','yes','number','displayPreviewHints','customersWithEvents','\x20--interval\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','/attempt/','Master\x20+\x20Attributes','test','Get\x20SQL\x20query\x20for\x20parent\x20segment','varchar','length','updateParent','addBehaviors','pushParentYaml','Usage:\x20tdx\x20parent-segment\x20validate\x20<name>\x20[options]\x0a','runParent','segment:parent:run','/{name}.yml\x0a','Fetching\x20current\x20configuration\x20for\x20\x27','/app/workflows/','customerGroup','preview','displayAttributesStats','start','filter','Database:\x20','Fetching\x20sample\x20data...','schemaValid','.yml','displaySampleData','✔\x20Updated\x20parent\x20segment\x20\x27','Name:\x20','\x20--behavior\x20\x22','Show\x20parent\x20segment\x20schema\x20(column\x20types)','win32','To\x20view\x20sample\x20data:','json','Join:','timezone','/\x20and\x20','error','table','/\x20directory.\x0a','joinKey','924656jxIioK','30213837qaXGxR','✔\x20Found\x20','totalEvents','red','Aborted.','attributesFile','name','\x20rows)','segment:parent:preview','\x0aUsage:\x20tdx\x20ps\x20preview\x20','\x20No\x20changes\x20-\x20','Error:\x20File\x20not\x20found:\x20','tdx\x20segment\x20parent\x20preview\x20','Validate:','Listing\x20parent\x20segments\x20matching\x20\x27','/app/dw/parentSegments/','\x0aChanges\x20to\x20apply\x20to\x20\x27','pullParentYaml','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20rows\x20','parent_segments','Output\x20file:\x20','displayValidateResults','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','yellow','\x27...','jobId','Listing\x20parent\x20segments...','Error\x20reading\x20file:\x20','scheduleType','foreignKey','To\x20cancel:','site','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','apply','204415ZMoSPd','customerPercent','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','population','List\x20parent\x20segments','keys','trim','SQL\x20query:\x0a','Available\x20attributes:','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20is\x20already\x20up\x20to\x20date','Creating','Attribute:','Usage:\x20tdx\x20ps\x20fields\x20[name]\x0a','\x20Configuration\x20is\x20valid','850662iZTuCI','verbose','Listing\x20fields\x20for\x20\x27','matchedCount','output','Site:\x20','168pigaYj','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Resolving\x20parent\x20segment\x20\x27','toLocaleString','parentSegment','\x20\x20No\x20sample\x20data\x20available','errors','coveragePercent','workflowId','enriched','Session:','open','platform','customerGroupFile','segment:parent:create','List\x20available\x20fields\x20for\x20segmentation','segment:parent:desc','column','label','attributes','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','segment:parent:pull','\x20=\x20','repeat','Apply\x20changes\x20to\x20\x27','using\x20the\x20default\x20path:\x20','parent_segment','displayPreviewResults','5752088utOlAM','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','SELECT\x20*\x20FROM\x20(\x0a','2113500cEXzzX','Create\x20parent\x20segment\x20\x27','Parent\x20segment:\x20','columns','database','\x0a⚠️\x20\x20Both\x20','Executing\x20parent\x20segment\x20query...','\x20--attribute\x20\x22<name>\x22','workflowSessionId','toFixed','scheduleOption','behaviors'];a27_0x32a9=function(){return _0x23918a;};return a27_0x32a9();}export class ParentSegmentSQLCommand extends BaseCommand{[a27_0xe4513(0x262)]=a27_0xe4513(0x22d);[a27_0xe4513(0x21f)]=a27_0xe4513(0x237);async[a27_0xe4513(0x1b0)](_0x5a57d0){const _0x40bf1b=a27_0xe4513,{options:_0x103209,args:_0x18f87b,tdx:_0x411b74}=_0x5a57d0,_0x49e4d7=_0x18f87b[0x0]||_0x103209['parentSegment'];if(!_0x49e4d7)return console[_0x40bf1b(0x257)](a27_0x393c4e[_0x40bf1b(0x25f)](_0x40bf1b(0x229))),console[_0x40bf1b(0x257)](_0x40bf1b(0x1ac)),console[_0x40bf1b(0x257)](a27_0x393c4e['cyan'](_0x40bf1b(0x1c2))),0x1;_0x103209[_0x40bf1b(0x28f)]&&(console[_0x40bf1b(0x257)]('Site:\x20'+_0x103209[_0x40bf1b(0x27c)]),console['error'](_0x40bf1b(0x198)+_0x49e4d7));const _0x116043=await withSpinner(_0x40bf1b(0x178)+_0x49e4d7+_0x40bf1b(0x275),()=>_0x411b74[_0x40bf1b(0x20f)][_0x40bf1b(0x212)](_0x49e4d7),{'verbose':_0x103209[_0x40bf1b(0x28f)]}),_0x2dd4f7=_0x116043[_0x40bf1b(0x226)],_0x319bf6=await withSpinner(_0x40bf1b(0x1a2)+_0x49e4d7+_0x40bf1b(0x275),()=>_0x411b74[_0x40bf1b(0x20f)][_0x40bf1b(0x1e3)](_0x2dd4f7),{'verbose':_0x103209[_0x40bf1b(0x28f)]}),_0x1c2b37=_0x319bf6[_0x40bf1b(0x226)];return _0x103209[_0x40bf1b(0x1cf)]===_0x40bf1b(0x253)||_0x103209[_0x40bf1b(0x1cf)]===_0x40bf1b(0x1a9)?await handleSDKOutput([{'sql':_0x1c2b37}],_0x103209):console['log'](_0x1c2b37),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a27_0xe4513(0x262)]='segment:parent:show';[a27_0xe4513(0x21f)]=a27_0xe4513(0x281);async[a27_0xe4513(0x1b0)](_0x516264){const _0x2718c1=a27_0xe4513,{options:_0x20f6e2,args:_0x1ea97f,tdx:_0x4a1f42}=_0x516264,_0x5c6626=_0x1ea97f[0x0]||_0x20f6e2['parentSegment'];if(!_0x5c6626)return console[_0x2718c1(0x257)](a27_0x393c4e[_0x2718c1(0x25f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required\x0a')),console[_0x2718c1(0x257)]('Usage:\x20tdx\x20ps\x20show\x20[name]\x0a'),console['error'](a27_0x393c4e[_0x2718c1(0x1cc)](_0x2718c1(0x1c2))),0x1;_0x20f6e2[_0x2718c1(0x28f)]&&(console[_0x2718c1(0x257)]('Site:\x20'+_0x20f6e2[_0x2718c1(0x27c)]),console[_0x2718c1(0x257)]('Parent\x20segment:\x20'+_0x5c6626));const _0x406a8c=await withSpinner(_0x2718c1(0x178)+_0x5c6626+_0x2718c1(0x275),()=>_0x4a1f42['segment'][_0x2718c1(0x212)](_0x5c6626),{'verbose':_0x20f6e2[_0x2718c1(0x28f)]}),_0x376079=_0x406a8c[_0x2718c1(0x226)],_0x568eb7=await withSpinner(_0x2718c1(0x1a2)+_0x5c6626+_0x2718c1(0x275),()=>_0x4a1f42['segment']['getParentSQL'](_0x376079),{'verbose':_0x20f6e2[_0x2718c1(0x28f)]});let _0x4b96ad=_0x568eb7[_0x2718c1(0x226)];const _0x4824df=resolveLimit(_0x20f6e2[_0x2718c1(0x1ee)],DEFAULT_DISPLAY_LIMIT),_0x1b9111=/\bLIMIT\s+\d+/i[_0x2718c1(0x236)](_0x4b96ad);!_0x1b9111&&(_0x4b96ad=_0x4b96ad[_0x2718c1(0x285)]()[_0x2718c1(0x1bf)](/;+$/,''),_0x4b96ad=_0x2718c1(0x195)+_0x4b96ad+_0x2718c1(0x209)+_0x4824df);_0x20f6e2[_0x2718c1(0x28f)]&&console[_0x2718c1(0x257)](_0x2718c1(0x286)+_0x4b96ad);const _0x1d2b5d=await withQuerySpinner(_0x2718c1(0x19c),async _0x59f800=>{const _0x41475a=_0x2718c1,_0xb696fb=await _0x4a1f42['query'][_0x41475a(0x1b0)](_0x4b96ad,{'catalog':'td','schema':_0x41475a(0x203),'onJobId':_0x3906c0=>{const _0x281684=_0x41475a;_0x59f800[_0x281684(0x1fc)](_0x3906c0);}});return _0xb696fb;},{'verbose':_0x20f6e2[_0x2718c1(0x28f)]}),_0x532816=_0x1d2b5d[_0x2718c1(0x226)],_0x4f6fa0=_0x532816[_0x2718c1(0x276)]?'\x20[Job\x20ID:\x20'+_0x532816[_0x2718c1(0x276)]+']':'';return console[_0x2718c1(0x257)](_0x2718c1(0x1ef)+_0x532816[_0x2718c1(0x1b8)][_0x2718c1(0x1c8)][_0x2718c1(0x179)]()+_0x2718c1(0x26f)+(_0x2718c1(0x20d)+formatElapsed(_0x532816[_0x2718c1(0x1b8)][_0x2718c1(0x224)])+_0x4f6fa0)),await handleQueryOutput(_0x532816,_0x20f6e2),0x0;}}
@@ -1 +1 @@
1
- const a28_0x53b54b=a28_0x22b9;(function(_0x4eb427,_0x57fca0){const _0x28a164=a28_0x22b9,_0x30bcbe=_0x4eb427();while(!![]){try{const _0x415b0c=parseInt(_0x28a164(0xe9))/0x1+parseInt(_0x28a164(0xec))/0x2+parseInt(_0x28a164(0xe7))/0x3+parseInt(_0x28a164(0xf6))/0x4*(parseInt(_0x28a164(0xf2))/0x5)+-parseInt(_0x28a164(0xe6))/0x6*(-parseInt(_0x28a164(0xea))/0x7)+-parseInt(_0x28a164(0xe4))/0x8+-parseInt(_0x28a164(0xf5))/0x9;if(_0x415b0c===_0x57fca0)break;else _0x30bcbe['push'](_0x30bcbe['shift']());}catch(_0x3b4da0){_0x30bcbe['push'](_0x30bcbe['shift']());}}}(a28_0x11ad,0xa7806));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{[a28_0x53b54b(0xf4)]=a28_0x53b54b(0xf7);[a28_0x53b54b(0xeb)]=a28_0x53b54b(0xf1);async[a28_0x53b54b(0xfc)](_0x366450){const _0x41766b=a28_0x53b54b,{options:_0x394fdb}=_0x366450;try{const _0xc44c1d=listProfiles(),_0x5a5965=getActiveProfile();if(_0xc44c1d[_0x41766b(0xf9)]===0x0)return console[_0x41766b(0xe8)](_0x41766b(0xe5)),console[_0x41766b(0xe8)](_0x41766b(0xf3)),console['log'](_0x41766b(0xfa)),0x0;const _0x21bbeb=_0xc44c1d[_0x41766b(0xfb)](_0xe088b6=>{const _0x5f22ac=_0x41766b,_0x10d379=_0xe088b6['name']===_0x5a5965,_0x5e0289=getProfileParams(_0xe088b6[_0x5f22ac(0xf8)]);return{'name':_0xe088b6[_0x5f22ac(0xf4)],'active':_0x10d379,'scope':_0xe088b6[_0x5f22ac(0xf0)],'description':_0xe088b6[_0x5f22ac(0xf8)][_0x5f22ac(0xeb)]||'','params':_0x5e0289};});return await handleSDKOutput(_0x21bbeb,_0x394fdb),0x0;}catch(_0xcb80a1){return _0xcb80a1 instanceof Error&&console[_0x41766b(0xef)](_0x41766b(0xee)+_0xcb80a1[_0x41766b(0xed)]),0x1;}}}function a28_0x22b9(_0x22e1a8,_0x8a3a4c){_0x22e1a8=_0x22e1a8-0xe4;const _0x11ade4=a28_0x11ad();let _0x22b9d4=_0x11ade4[_0x22e1a8];return _0x22b9d4;}function a28_0x11ad(){const _0x2f1ede=['log','22223cyESgK','161ctcMxb','description','926162KOKXmH','message','Error:\x20','error','scope','List\x20all\x20available\x20profiles','21315cXARoJ','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','name','15443622GimDCY','648kXEXRs','profiles','config','length','\x20\x20Global:\x20~/.config/tdx/tdx.json','map','execute','2886616NkyNfP','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','281472PFxElY','1523955nufjLt'];a28_0x11ad=function(){return _0x2f1ede;};return a28_0x11ad();}
1
+ const a28_0x4da8c0=a28_0x5d73;function a28_0x56fc(){const _0x2a53c4=['9zUYKWz','execute','2908975GzzvHb','2046KGROIR','map','scope','log','name','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','2121091kqPvPR','List\x20all\x20available\x20profiles','353085pDkylA','5406416SupNjP','profiles','Error:\x20','12CqLlyj','28880DotbOF','description','220300sbIEnY','message'];a28_0x56fc=function(){return _0x2a53c4;};return a28_0x56fc();}(function(_0x1112fd,_0x2b4cce){const _0x15c4e8=a28_0x5d73,_0x2a7386=_0x1112fd();while(!![]){try{const _0x254d65=parseInt(_0x15c4e8(0xdd))/0x1+-parseInt(_0x15c4e8(0xd6))/0x2+-parseInt(_0x15c4e8(0xd1))/0x3+-parseInt(_0x15c4e8(0xd8))/0x4+-parseInt(_0x15c4e8(0xdc))/0x5+parseInt(_0x15c4e8(0xd5))/0x6*(parseInt(_0x15c4e8(0xcf))/0x7)+parseInt(_0x15c4e8(0xd2))/0x8*(parseInt(_0x15c4e8(0xda))/0x9);if(_0x254d65===_0x2b4cce)break;else _0x2a7386['push'](_0x2a7386['shift']());}catch(_0x424adf){_0x2a7386['push'](_0x2a7386['shift']());}}}(a28_0x56fc,0x7db35));function a28_0x5d73(_0x1987af,_0x573d5b){_0x1987af=_0x1987af-0xce;const _0x56fc78=a28_0x56fc();let _0x5d7359=_0x56fc78[_0x1987af];return _0x5d7359;}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{[a28_0x4da8c0(0xe1)]=a28_0x4da8c0(0xd3);[a28_0x4da8c0(0xd7)]=a28_0x4da8c0(0xd0);async[a28_0x4da8c0(0xdb)](_0x2833d6){const _0x3c3c2e=a28_0x4da8c0,{options:_0x4b9a28}=_0x2833d6;try{const _0x1fe54d=listProfiles(),_0x33c902=getActiveProfile();if(_0x1fe54d['length']===0x0)return console[_0x3c3c2e(0xe0)](_0x3c3c2e(0xce)),console[_0x3c3c2e(0xe0)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x3c3c2e(0xe0)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0xdea32=_0x1fe54d[_0x3c3c2e(0xde)](_0x4c617b=>{const _0x46d376=_0x3c3c2e,_0x2c3d68=_0x4c617b[_0x46d376(0xe1)]===_0x33c902,_0x289f29=getProfileParams(_0x4c617b['config']);return{'name':_0x4c617b['name'],'active':_0x2c3d68,'scope':_0x4c617b[_0x46d376(0xdf)],'description':_0x4c617b['config'][_0x46d376(0xd7)]||'','params':_0x289f29};});return await handleSDKOutput(_0xdea32,_0x4b9a28),0x0;}catch(_0x400a05){return _0x400a05 instanceof Error&&console['error'](_0x3c3c2e(0xd4)+_0x400a05[_0x3c3c2e(0xd9)]),0x1;}}}
@@ -1 +1 @@
1
- function a29_0x2e84(){const _0x2158ac=['\x20rows\x20','113818ZMzuYI','8pYfiWd','args','5001752sRsBjM','database','\x20-\x20','3498370kpHlxR','206100QxLsan','10PZNejW','totalSplits','originalMessage','8328qhPPPR','Catalog:\x20','setExtra','in\x20','elapsedTimeMillis','completedSplits','execute','Query\x20completed:\x20Processed\x20','Executing\x20statement\x20','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','\x20[Job\x20ID:\x20','processedRows','information_schema','jobId','verbose','11391226ZVZcvN','catalog','\x0aAll\x20results\x20saved\x20to\x20','join','validate','options','description','324330IxqutY','name','setPhase','Error:\x20','SQL:\x20','Statement\x20','\x20splits','output','12fYgcFN','file','Run\x20Trino\x20queries\x20(streaming)','stats','query','message','length','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','Executing\x20query...','error','595nBwGBA'];a29_0x2e84=function(){return _0x2158ac;};return a29_0x2e84();}const a29_0x1fb19b=a29_0x300a;(function(_0x30166a,_0x529817){const _0x2f4877=a29_0x300a,_0x11f708=_0x30166a();while(!![]){try{const _0x185ac2=-parseInt(_0x2f4877(0x1a1))/0x1*(-parseInt(_0x2f4877(0x199))/0x2)+-parseInt(_0x2f4877(0x185))/0x3*(parseInt(_0x2f4877(0x18d))/0x4)+parseInt(_0x2f4877(0x197))/0x5*(parseInt(_0x2f4877(0x16f))/0x6)+-parseInt(_0x2f4877(0x19c))/0x7+-parseInt(_0x2f4877(0x19a))/0x8*(parseInt(_0x2f4877(0x1a0))/0x9)+-parseInt(_0x2f4877(0x19f))/0xa+parseInt(_0x2f4877(0x17e))/0xb;if(_0x185ac2===_0x529817)break;else _0x11f708['push'](_0x11f708['shift']());}catch(_0x2886ef){_0x11f708['push'](_0x11f708['shift']());}}}(a29_0x2e84,0x57751));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';function a29_0x300a(_0x459d35,_0x4be087){_0x459d35=_0x459d35-0x16e;const _0x2e84d4=a29_0x2e84();let _0x300a1a=_0x2e84d4[_0x459d35];return _0x300a1a;}import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a29_0x1fb19b(0x186)]=a29_0x1fb19b(0x191);[a29_0x1fb19b(0x184)]=a29_0x1fb19b(0x18f);async[a29_0x1fb19b(0x175)](_0x8b5740){const _0x438fdb=a29_0x1fb19b,{options:_0x102bda,args:_0x269fe7,tdx:_0x45a261}=_0x8b5740,_0x317435=_0x269fe7[0x0],_0x2918fe=_0x102bda[_0x438fdb(0x18e)];let _0x424225;if(_0x2918fe)try{_0x424225=readSqlStatementsFromFile(_0x2918fe);}catch(_0x460fe2){return console['error'](_0x438fdb(0x188)+_0x460fe2[_0x438fdb(0x192)]),0x1;}else try{_0x424225=splitSqlStatements(_0x317435);}catch(_0x26716f){return console['error'](_0x438fdb(0x188)+_0x26716f[_0x438fdb(0x192)]),0x1;}const _0x36851e=_0x102bda[_0x438fdb(0x19d)]||_0x438fdb(0x17b),_0x1381ce=_0x102bda[_0x438fdb(0x17f)];try{const _0xc9bb2=[],_0xa59d31=!!_0x102bda['output'];for(let _0x1031ee=0x0;_0x1031ee<_0x424225[_0x438fdb(0x193)];_0x1031ee++){const _0xf139f5=_0x424225[_0x1031ee],_0x7c5433=_0x1031ee+0x1,_0x4ee896=_0x424225['length'],_0x1c34a7=_0x4ee896>0x1;_0x102bda[_0x438fdb(0x17d)]&&(console[_0x438fdb(0x196)]('\x0a'+(_0x1c34a7?_0x438fdb(0x18a)+_0x7c5433+'/'+_0x4ee896+':':'')),console['error']('Site:\x20'+_0x102bda['site']),console[_0x438fdb(0x196)](_0x438fdb(0x170)+(_0x1381ce||'td')),console['error']('Schema:\x20'+_0x36851e),console[_0x438fdb(0x196)](_0x438fdb(0x189)+_0xf139f5));const _0x5d7abd=_0x1c34a7?_0x438fdb(0x177)+_0x7c5433+'/'+_0x4ee896+'...':_0x438fdb(0x195);try{const _0x322d6e=await withQuerySpinner(_0x5d7abd,async _0xb4d172=>{const _0x3c1746=_0x438fdb,_0x3666bd=await _0x45a261['query'][_0x3c1746(0x175)](_0xf139f5,{'catalog':_0x1381ce,'schema':_0x36851e,'onJobId':_0x59469b=>{_0xb4d172['setJobId'](_0x59469b);},'onProgress':_0x5086a2=>{const _0xb3ecca=_0x3c1746;_0xb4d172[_0xb3ecca(0x187)]('Executing\x20query\x20['+_0x5086a2['state']+']'),_0xb4d172[_0xb3ecca(0x171)](formatRows(_0x5086a2[_0xb3ecca(0x17a)])+_0xb3ecca(0x198)+_0x5086a2[_0xb3ecca(0x174)]+'/'+_0x5086a2[_0xb3ecca(0x1a2)]+_0xb3ecca(0x18b));}});return _0x3666bd;},{'verbose':_0x102bda[_0x438fdb(0x17d)]}),_0x5ce90a=_0x322d6e['data'],_0x1a17ac=_0x5ce90a['jobId']?_0x438fdb(0x179)+_0x5ce90a[_0x438fdb(0x17c)]+']':'',_0x32c8e4=_0x1c34a7?_0x438fdb(0x18a)+_0x7c5433+'/'+_0x4ee896+_0x438fdb(0x19e):'';console[_0x438fdb(0x196)]('✔\x20'+_0x32c8e4+_0x438fdb(0x176)+formatRows(_0x5ce90a[_0x438fdb(0x190)][_0x438fdb(0x17a)])+_0x438fdb(0x198)+(_0x438fdb(0x172)+formatElapsed(_0x5ce90a['stats'][_0x438fdb(0x173)])+_0x1a17ac));if(_0x1c34a7&&_0xa59d31){const _0x5659a3=resolveOutputOptions(_0x102bda),_0x4c34b1=await formatQueryOutput(_0x5ce90a,_0x5659a3);_0xc9bb2['push'](_0x4c34b1);}else await handleQueryOutput(_0x5ce90a,_0x102bda);}catch(_0x4c1c70){const _0x140eac=_0x1c34a7?_0x438fdb(0x18a)+_0x7c5433+'/'+_0x4ee896+':\x0a':'',_0x12803b=_0x4c1c70 instanceof SDKError?_0x4c1c70[_0x438fdb(0x16e)]:_0x4c1c70[_0x438fdb(0x192)];return console[_0x438fdb(0x196)](''+_0x140eac+_0x12803b),0x1;}}if(_0x424225[_0x438fdb(0x193)]>0x1&&_0xa59d31&&_0xc9bb2['length']>0x0){const _0x40f627=_0xc9bb2[_0x438fdb(0x181)]('\x0a');writeFileSync(_0x102bda[_0x438fdb(0x18c)],_0x40f627),console['error'](_0x438fdb(0x180)+_0x102bda['output']);}return 0x0;}catch(_0x5793cc){throw _0x5793cc;}}[a29_0x1fb19b(0x182)](_0x3dd5dd){const _0x3e6027=a29_0x1fb19b,_0x59fec8=_0x3dd5dd[_0x3e6027(0x19b)][0x0],_0x485be7=_0x3dd5dd[_0x3e6027(0x183)][_0x3e6027(0x18e)];if(!_0x59fec8&&!_0x485be7)return _0x3e6027(0x178);if(_0x59fec8&&_0x485be7)return _0x3e6027(0x194);return undefined;}}
1
+ const a29_0x2f31f6=a29_0xc777;(function(_0x314e88,_0x5af573){const _0x1f3a99=a29_0xc777,_0x462145=_0x314e88();while(!![]){try{const _0x2b418b=parseInt(_0x1f3a99(0xd2))/0x1*(-parseInt(_0x1f3a99(0xca))/0x2)+parseInt(_0x1f3a99(0xc4))/0x3*(-parseInt(_0x1f3a99(0xc0))/0x4)+-parseInt(_0x1f3a99(0xba))/0x5+-parseInt(_0x1f3a99(0xaf))/0x6*(-parseInt(_0x1f3a99(0xcd))/0x7)+-parseInt(_0x1f3a99(0xdb))/0x8+-parseInt(_0x1f3a99(0xc1))/0x9+parseInt(_0x1f3a99(0xd9))/0xa*(parseInt(_0x1f3a99(0xae))/0xb);if(_0x2b418b===_0x5af573)break;else _0x462145['push'](_0x462145['shift']());}catch(_0x3b1311){_0x462145['push'](_0x462145['shift']());}}}(a29_0x4fd8,0x38023));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';function a29_0xc777(_0x2bee23,_0x4490b2){_0x2bee23=_0x2bee23-0xac;const _0x4fd8a0=a29_0x4fd8();let _0xc77765=_0x4fd8a0[_0x2bee23];return _0xc77765;}import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a29_0x4fd8(){const _0xa6dff6=['Executing\x20statement\x20','totalSplits','...','in\x20','311566NcnScI','args','query','8603VQxlNh','file','validate','jobId','\x20-\x20','1mRJGid','data','error','push','Query\x20completed:\x20Processed\x20','Statement\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','695670bFPjdm','name','2311632GHUeQN','\x0aAll\x20results\x20saved\x20to\x20','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','Error:\x20','length','\x20rows\x20','209WLFzwd','150GCRPAR','site','Site:\x20','\x20[Job\x20ID:\x20','output','verbose','message','completedSplits','Schema:\x20','stats','execute','2290650DDvNbe','processedRows','elapsedTimeMillis','Catalog:\x20','information_schema','database','675856vYnzjH','461304RBCmIg','description','setPhase','3ymNrJO','SQL:\x20'];a29_0x4fd8=function(){return _0xa6dff6;};return a29_0x4fd8();}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a29_0x2f31f6(0xda)]=a29_0x2f31f6(0xcc);[a29_0x2f31f6(0xc2)]='Run\x20Trino\x20queries\x20(streaming)';async[a29_0x2f31f6(0xb9)](_0x52d58f){const _0x4f3eff=a29_0x2f31f6,{options:_0x21e487,args:_0x17d7a6,tdx:_0x52bede}=_0x52d58f,_0x114360=_0x17d7a6[0x0],_0x1e2c39=_0x21e487['file'];let _0x13aa05;if(_0x1e2c39)try{_0x13aa05=readSqlStatementsFromFile(_0x1e2c39);}catch(_0x515610){return console[_0x4f3eff(0xd4)]('Error:\x20'+_0x515610[_0x4f3eff(0xb5)]),0x1;}else try{_0x13aa05=splitSqlStatements(_0x114360);}catch(_0x40894c){return console['error'](_0x4f3eff(0xde)+_0x40894c[_0x4f3eff(0xb5)]),0x1;}const _0x497fbe=_0x21e487[_0x4f3eff(0xbf)]||_0x4f3eff(0xbe),_0x36c609=_0x21e487['catalog'];try{const _0x4123e1=[],_0x26fdb6=!!_0x21e487[_0x4f3eff(0xb3)];for(let _0x4b26da=0x0;_0x4b26da<_0x13aa05[_0x4f3eff(0xac)];_0x4b26da++){const _0x51db9a=_0x13aa05[_0x4b26da],_0x4a47a6=_0x4b26da+0x1,_0x271c05=_0x13aa05[_0x4f3eff(0xac)],_0x76977d=_0x271c05>0x1;_0x21e487[_0x4f3eff(0xb4)]&&(console[_0x4f3eff(0xd4)]('\x0a'+(_0x76977d?_0x4f3eff(0xd7)+_0x4a47a6+'/'+_0x271c05+':':'')),console['error'](_0x4f3eff(0xb1)+_0x21e487[_0x4f3eff(0xb0)]),console[_0x4f3eff(0xd4)](_0x4f3eff(0xbd)+(_0x36c609||'td')),console[_0x4f3eff(0xd4)](_0x4f3eff(0xb7)+_0x497fbe),console['error'](_0x4f3eff(0xc5)+_0x51db9a));const _0x5ea9a5=_0x76977d?_0x4f3eff(0xc6)+_0x4a47a6+'/'+_0x271c05+_0x4f3eff(0xc8):'Executing\x20query...';try{const _0x1d2633=await withQuerySpinner(_0x5ea9a5,async _0x4d8e9d=>{const _0x12442c=await _0x52bede['query']['execute'](_0x51db9a,{'catalog':_0x36c609,'schema':_0x497fbe,'onJobId':_0x515b98=>{_0x4d8e9d['setJobId'](_0x515b98);},'onProgress':_0x9e4924=>{const _0x5e78b9=a29_0xc777;_0x4d8e9d[_0x5e78b9(0xc3)]('Executing\x20query\x20['+_0x9e4924['state']+']'),_0x4d8e9d['setExtra'](formatRows(_0x9e4924[_0x5e78b9(0xbb)])+_0x5e78b9(0xad)+_0x9e4924[_0x5e78b9(0xb6)]+'/'+_0x9e4924[_0x5e78b9(0xc7)]+'\x20splits');}});return _0x12442c;},{'verbose':_0x21e487['verbose']}),_0x94f0e7=_0x1d2633[_0x4f3eff(0xd3)],_0x350eb5=_0x94f0e7[_0x4f3eff(0xd0)]?_0x4f3eff(0xb2)+_0x94f0e7[_0x4f3eff(0xd0)]+']':'',_0x1f4cdb=_0x76977d?_0x4f3eff(0xd7)+_0x4a47a6+'/'+_0x271c05+_0x4f3eff(0xd1):'';console[_0x4f3eff(0xd4)]('✔\x20'+_0x1f4cdb+_0x4f3eff(0xd6)+formatRows(_0x94f0e7[_0x4f3eff(0xb8)][_0x4f3eff(0xbb)])+_0x4f3eff(0xad)+(_0x4f3eff(0xc9)+formatElapsed(_0x94f0e7[_0x4f3eff(0xb8)][_0x4f3eff(0xbc)])+_0x350eb5));if(_0x76977d&&_0x26fdb6){const _0xfc2db2=resolveOutputOptions(_0x21e487),_0x21eb13=await formatQueryOutput(_0x94f0e7,_0xfc2db2);_0x4123e1[_0x4f3eff(0xd5)](_0x21eb13);}else await handleQueryOutput(_0x94f0e7,_0x21e487);}catch(_0x3e9d27){const _0x484819=_0x76977d?'Statement\x20'+_0x4a47a6+'/'+_0x271c05+':\x0a':'',_0x1ffc2c=_0x3e9d27 instanceof SDKError?_0x3e9d27['originalMessage']:_0x3e9d27[_0x4f3eff(0xb5)];return console[_0x4f3eff(0xd4)](''+_0x484819+_0x1ffc2c),0x1;}}if(_0x13aa05['length']>0x1&&_0x26fdb6&&_0x4123e1[_0x4f3eff(0xac)]>0x0){const _0x328654=_0x4123e1['join']('\x0a');writeFileSync(_0x21e487[_0x4f3eff(0xb3)],_0x328654),console[_0x4f3eff(0xd4)](_0x4f3eff(0xdc)+_0x21e487[_0x4f3eff(0xb3)]);}return 0x0;}catch(_0x38ff4b){throw _0x38ff4b;}}[a29_0x2f31f6(0xcf)](_0xfe6f9d){const _0x599d06=a29_0x2f31f6,_0x46930a=_0xfe6f9d[_0x599d06(0xcb)][0x0],_0x25528e=_0xfe6f9d['options'][_0x599d06(0xce)];if(!_0x46930a&&!_0x25528e)return _0x599d06(0xdd);if(_0x46930a&&_0x25528e)return _0x599d06(0xd8);return undefined;}}
@@ -1 +1 @@
1
- const a30_0x2cb603=a30_0x5cb7;(function(_0xabd055,_0xdc14e){const _0x125d31=a30_0x5cb7,_0x3f06bf=_0xabd055();while(!![]){try{const _0xf04ad2=parseInt(_0x125d31(0x260))/0x1*(parseInt(_0x125d31(0x25d))/0x2)+-parseInt(_0x125d31(0x277))/0x3*(parseInt(_0x125d31(0x21a))/0x4)+-parseInt(_0x125d31(0x1fa))/0x5+-parseInt(_0x125d31(0x26e))/0x6+-parseInt(_0x125d31(0x1f9))/0x7*(-parseInt(_0x125d31(0x248))/0x8)+-parseInt(_0x125d31(0x25c))/0x9+parseInt(_0x125d31(0x242))/0xa;if(_0xf04ad2===_0xdc14e)break;else _0x3f06bf['push'](_0x3f06bf['shift']());}catch(_0x5c3c38){_0x3f06bf['push'](_0x3f06bf['shift']());}}}(a30_0x4055,0xc8a15));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';function resolveSegmentTarget(_0xfcf1fd,_0x1bb420,_0x20d762){const _0x5eff98=a30_0x5cb7;if(isYamlFilePath(_0xfcf1fd))try{const _0x41b8d0=resolveYamlFilePath(_0xfcf1fd);return _0x20d762&&(console[_0x5eff98(0x227)](_0x5eff98(0x212)+_0xfcf1fd),console[_0x5eff98(0x227)](_0x5eff98(0x23f)+_0x41b8d0[_0x5eff98(0x246)]),console[_0x5eff98(0x227)](_0x5eff98(0x22b)+_0x41b8d0['segmentName']),console['error'](_0x5eff98(0x261)+(_0x41b8d0[_0x5eff98(0x202)]||_0x5eff98(0x27b))),console['error']('\x20\x20Full\x20path:\x20'+_0x41b8d0[_0x5eff98(0x279)])),_0x41b8d0[_0x5eff98(0x279)];}catch(_0x1f14a9){throw new SDKError(ErrorCode[_0x5eff98(0x25a)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x1f14a9[_0x5eff98(0x21d)]);}if(!_0x1bb420)throw new SDKError(ErrorCode[_0x5eff98(0x25a)],_0x5eff98(0x26a));return _0x1bb420+'/'+_0xfcf1fd;}export class SegmentDescribeCommand extends BaseCommand{[a30_0x2cb603(0x275)]=a30_0x2cb603(0x26f);[a30_0x2cb603(0x259)]=a30_0x2cb603(0x25b);async['execute'](_0xe3d557){const _0x43030a=a30_0x2cb603,{options:_0x11b9bb,args:_0x5a4ba2,tdx:_0x239633}=_0xe3d557,_0xb96ef1=_0x5a4ba2[0x0],_0x2a0bf0=!_0xb96ef1&&!!_0x11b9bb[_0x43030a(0x246)],_0x54665d=_0xb96ef1||_0x11b9bb[_0x43030a(0x246)];if(!_0x54665d)return console[_0x43030a(0x227)](_0x43030a(0x267)),console[_0x43030a(0x227)](_0x43030a(0x245)),console['error']('Examples:'),console[_0x43030a(0x227)](_0x43030a(0x232)),console[_0x43030a(0x227)](_0x43030a(0x22c)),console['error'](_0x43030a(0x26d)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x1785db=_0x11b9bb['segmentPath'];let _0x537d48=_0x54665d;!_0x2a0bf0&&_0x1785db&&!_0x54665d[_0x43030a(0x228)]('/')&&(_0x537d48=_0x1785db+'/'+_0x54665d,_0x11b9bb[_0x43030a(0x20a)]&&console[_0x43030a(0x227)]('Resolved\x20relative\x20path\x20to:\x20'+_0x537d48));const _0x4b8c26=await withSpinner('Resolving\x20path\x20\x27'+_0x537d48+_0x43030a(0x244),()=>_0x239633[_0x43030a(0x249)][_0x43030a(0x233)](_0x537d48),{'verbose':_0x11b9bb[_0x43030a(0x20a)]}),_0x248eef=_0x4b8c26[_0x43030a(0x21b)];_0x11b9bb['verbose']&&(console[_0x43030a(0x227)](_0x43030a(0x20c)+_0x248eef[_0x43030a(0x203)]),console[_0x43030a(0x227)](_0x43030a(0x266)+_0x248eef[_0x43030a(0x204)]),_0x248eef[_0x43030a(0x236)]&&console[_0x43030a(0x227)]('Folder\x20ID:\x20'+_0x248eef[_0x43030a(0x236)]),_0x248eef[_0x43030a(0x239)]&&console['error'](_0x43030a(0x263)+_0x248eef[_0x43030a(0x239)]));if(_0x248eef[_0x43030a(0x203)]===_0x43030a(0x25f)){const _0x124f8a=await withSpinner(_0x43030a(0x1fd),()=>_0x239633[_0x43030a(0x249)][_0x43030a(0x27c)](_0x248eef['parentId']),{'verbose':_0x11b9bb[_0x43030a(0x20a)]});await handleSingleObjectOutput(_0x124f8a['data'],_0x11b9bb);}else{if(_0x248eef[_0x43030a(0x203)]===_0x43030a(0x257)){if(!_0x248eef['folderId'])throw new SDKError(ErrorCode[_0x43030a(0x27a)],_0x43030a(0x214));const _0x385eef=await withSpinner(_0x43030a(0x24a),()=>_0x239633['segment'][_0x43030a(0x205)](_0x248eef[_0x43030a(0x236)]),{'verbose':_0x11b9bb[_0x43030a(0x20a)]});await handleSingleObjectOutput(_0x385eef[_0x43030a(0x21b)],_0x11b9bb);}else{if(_0x248eef[_0x43030a(0x203)]===_0x43030a(0x249)){if(!_0x248eef['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x43030a(0x207));const _0x4e6d4e=await withSpinner(_0x43030a(0x1fc),()=>_0x239633['segment']['getSegment'](_0x248eef['parentId'],_0x248eef[_0x43030a(0x239)]),{'verbose':_0x11b9bb[_0x43030a(0x20a)]});await handleSingleObjectOutput(_0x4e6d4e[_0x43030a(0x21b)],_0x11b9bb);}}}return 0x0;}catch(_0xd9345f){if(_0xd9345f instanceof SDKError)return console[_0x43030a(0x227)](_0x43030a(0x251)+_0xd9345f[_0x43030a(0x21d)]),_0xd9345f[_0x43030a(0x20d)]&&console[_0x43030a(0x227)](_0x43030a(0x23d)+_0xd9345f[_0x43030a(0x20d)]),0x1;throw _0xd9345f;}}}export class SegmentShowCommand extends BaseCommand{[a30_0x2cb603(0x275)]=a30_0x2cb603(0x273);[a30_0x2cb603(0x259)]=a30_0x2cb603(0x20f);async[a30_0x2cb603(0x27e)](_0x1a4197){const _0x7d9dba=a30_0x2cb603,{options:_0x3157f7,args:_0x443c09,tdx:_0x5c9558}=_0x1a4197,_0x14b060=_0x443c09[0x0];if(!_0x14b060)return console[_0x7d9dba(0x227)](_0x7d9dba(0x240)),console[_0x7d9dba(0x227)](_0x7d9dba(0x274)),console[_0x7d9dba(0x227)](_0x7d9dba(0x247)),console[_0x7d9dba(0x227)](_0x7d9dba(0x24e)),console[_0x7d9dba(0x227)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x7d9dba(0x227)](_0x7d9dba(0x20e)),0x1;try{const _0x1a349f=_0x3157f7[_0x7d9dba(0x246)],_0x3b8c3f=resolveSegmentTarget(_0x14b060,_0x1a349f,_0x3157f7[_0x7d9dba(0x20a)]);_0x3157f7[_0x7d9dba(0x20a)]&&console['error']('Target\x20path:\x20'+_0x3b8c3f);const _0x1c1489=await withSpinner('Resolving\x20\x27'+_0x14b060+_0x7d9dba(0x244),()=>_0x5c9558[_0x7d9dba(0x249)]['resolvePathToResource'](_0x3b8c3f),{'verbose':_0x3157f7[_0x7d9dba(0x20a)]}),_0x44660b=_0x1c1489['data'];_0x3157f7[_0x7d9dba(0x20a)]&&(console[_0x7d9dba(0x227)](_0x7d9dba(0x20c)+_0x44660b[_0x7d9dba(0x203)]),console['error']('Parent\x20ID:\x20'+_0x44660b[_0x7d9dba(0x204)]));if(_0x44660b[_0x7d9dba(0x203)]===_0x7d9dba(0x257))return console[_0x7d9dba(0x227)](_0x7d9dba(0x270)),console['error'](_0x7d9dba(0x1f8)),0x1;if(_0x44660b[_0x7d9dba(0x203)]===_0x7d9dba(0x25f))return console['error'](_0x7d9dba(0x206)),console[_0x7d9dba(0x227)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x44660b['segmentId'])throw new SDKError(ErrorCode[_0x7d9dba(0x265)],_0x7d9dba(0x207));const _0x66ff02=await withSpinner(_0x7d9dba(0x217),()=>_0x5c9558[_0x7d9dba(0x249)]['getSegmentSQL'](_0x44660b[_0x7d9dba(0x204)],_0x44660b['segmentId']),{'verbose':_0x3157f7[_0x7d9dba(0x20a)]});let _0xc789f5=_0x66ff02[_0x7d9dba(0x21b)];const _0x4059d0=resolveLimit(_0x3157f7['limit'],DEFAULT_DISPLAY_LIMIT),_0xdf340e=/\bLIMIT\s+\d+/i['test'](_0xc789f5);!_0xdf340e&&(_0xc789f5=_0xc789f5[_0x7d9dba(0x22a)]()[_0x7d9dba(0x234)](/;+$/,''),_0xc789f5=_0x7d9dba(0x241)+_0xc789f5+_0x7d9dba(0x200)+_0x4059d0);_0x3157f7[_0x7d9dba(0x20a)]&&console[_0x7d9dba(0x227)](_0x7d9dba(0x225)+_0xc789f5);const _0x45da22=await withQuerySpinner(_0x7d9dba(0x1f6),async _0xaa442d=>{const _0x5b602e=_0x7d9dba,_0x29af1d=await _0x5c9558[_0x5b602e(0x24c)][_0x5b602e(0x27e)](_0xc789f5,{'catalog':'td','schema':_0x5b602e(0x208),'onJobId':_0x47fe6f=>{_0xaa442d['setJobId'](_0x47fe6f);}});return _0x29af1d;},{'verbose':_0x3157f7[_0x7d9dba(0x20a)]}),_0x33d3d8=_0x45da22[_0x7d9dba(0x21b)],_0x56879b=_0x33d3d8[_0x7d9dba(0x272)]?'\x20[Job\x20ID:\x20'+_0x33d3d8[_0x7d9dba(0x272)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x33d3d8[_0x7d9dba(0x209)][_0x7d9dba(0x24d)][_0x7d9dba(0x1f5)]()+_0x7d9dba(0x25e)+(_0x7d9dba(0x1f7)+formatElapsed(_0x33d3d8[_0x7d9dba(0x209)]['elapsedTimeMillis'])+_0x56879b)),await handleQueryOutput(_0x33d3d8,_0x3157f7),0x0;}catch(_0x5080ac){if(_0x5080ac instanceof SDKError)return console['error'](_0x7d9dba(0x26c)+_0x5080ac['code']+']'),console[_0x7d9dba(0x227)]('\x0a'+_0x5080ac[_0x7d9dba(0x21d)]),0x1;throw _0x5080ac;}}}function a30_0x4055(){const _0x27d1ac=['Usage:\x20tdx\x20sg\x20view\x20<name>','description','INVALID_ARGUMENT','Show\x20segment\x20or\x20folder\x20details','6898122KtGAYR','396pSBRyB','\x20rows\x20','parent','6538RtJHfE','\x20\x20Folder\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Segment\x20ID:\x20','Resolving\x20\x27','SEGMENT_NOT_FOUND','Parent\x20ID:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','listFolders','parentFolder','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','segment:folder:show','✖\x20Query\x20failed\x20[','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','7029642tvhNvZ','segment:describe','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolving\x20folder\x20\x27','jobId','segment:show','Usage:\x20tdx\x20sg\x20show\x20<name>','name','\x20folder','81462VkhFtn','getSegmentSQL','fullPath','SEGMENT_FOLDER_NOT_FOUND','(root)','getParent','format','execute','Error:\x20Folder\x20reference\x20is\x20required','Parent\x20name:\x20','toLocaleString','Executing\x20segment\x20query...','in\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','1232567twhExQ','7552855KNPioZ','Create\x20segment\x20folder\x20for\x20organization','Fetching\x20segment\x20details...','Fetching\x20parent\x20segment\x20details...','Get\x20SQL\x20query\x20for\x20child\x20segment','createFolder','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Folder\x20name:\x20','folderPath','type','parentId','getFolder','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Segment\x20ID\x20missing\x20from\x20resolved\x20path','information_schema','stats','verbose','✔\x20Found\x20','Resolved\x20type:\x20','cause','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20Parent\x20segment\x20name\x20is\x20required','Resolved\x20YAML\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Folder\x20ID\x20missing\x20from\x20resolved\x20path','log','jsonl','Fetching\x20SQL\x20for\x20segment...','resolveParentId','Site:\x20','212ajIFPU','data','Use:\x20tdx\x20ps\x20view','message','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:folder:create','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','getSegment','SQL\x20query:\x0a','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','error','includes','Folder\x20ID:\x20','trim','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','segment:folder:list','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','✔\x20Created\x20folder\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','resolvePathToResource','replace','Target\x20path:\x20','folderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','resolveFolderId','segmentId','\x27\x20with\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x20\x20Cause:\x20','Resolved\x20folder\x20ID:\x20','\x20\x20Parent\x20segment:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','SELECT\x20*\x20FROM\x20(\x0a','31824880PCISKJ','Resolved\x20parent\x20ID:\x20','\x27...','Usage:\x20tdx\x20segment\x20describe\x20<path>','parentSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','56rhkLgP','segment','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','query','processedRows','Examples:','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Error:\x20','segment:desc','length','Fetching\x20folder\x20\x27','Creating\x20folder\x20\x27','site','folder'];a30_0x4055=function(){return _0x27d1ac;};return a30_0x4055();}export class SegmentFolderListCommand extends BaseCommand{[a30_0x2cb603(0x275)]=a30_0x2cb603(0x22f);[a30_0x2cb603(0x259)]=a30_0x2cb603(0x222);async[a30_0x2cb603(0x27e)](_0x256c94){const _0x171c0a=a30_0x2cb603,{options:_0x24e632,args:_0x102c87,tdx:_0x279b5b}=_0x256c94;if(_0x102c87['length']===0x0)return console[_0x171c0a(0x227)](_0x171c0a(0x211)),console[_0x171c0a(0x227)](_0x171c0a(0x210)),0x1;const _0x519865=_0x102c87[0x0];try{_0x24e632['verbose']&&(console['error']('Site:\x20'+_0x24e632['site']),console[_0x171c0a(0x227)](_0x171c0a(0x1f4)+_0x519865));const _0x5eff78=await withSpinner(_0x171c0a(0x23b)+_0x519865+_0x171c0a(0x244),()=>_0x279b5b[_0x171c0a(0x249)][_0x171c0a(0x218)](_0x519865),{'verbose':_0x24e632['verbose']}),_0xb9a78b=_0x5eff78['data'];_0x24e632[_0x171c0a(0x20a)]&&console[_0x171c0a(0x227)](_0x171c0a(0x243)+_0xb9a78b);const _0x86ee65=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x519865+_0x171c0a(0x244),()=>_0x279b5b[_0x171c0a(0x249)][_0x171c0a(0x268)](_0xb9a78b),{'verbose':_0x24e632['verbose']}),_0x146f81=_0x86ee65[_0x171c0a(0x21b)];return console['error'](_0x171c0a(0x20b)+_0x146f81['length']+_0x171c0a(0x276)+(_0x146f81[_0x171c0a(0x253)]!==0x1?'s':'')),await handleSDKOutput(_0x146f81,_0x24e632),0x0;}catch(_0x183ae4){if(_0x183ae4 instanceof SDKError)return console['error'](_0x171c0a(0x251)+_0x183ae4[_0x171c0a(0x21d)]),_0x183ae4['cause']&&console[_0x171c0a(0x227)](_0x171c0a(0x23d)+_0x183ae4[_0x171c0a(0x20d)]),0x1;throw _0x183ae4;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a30_0x2cb603(0x26b);[a30_0x2cb603(0x259)]='Show\x20segment\x20folder\x20details';async['execute'](_0x42ad07){const _0x2d0429=a30_0x2cb603,{options:_0xb1cf0,args:_0x2616b8,tdx:_0xa27f8b}=_0x42ad07;if(_0x2616b8['length']===0x0)return console[_0x2d0429(0x227)](_0x2d0429(0x1f3)),console[_0x2d0429(0x227)](_0x2d0429(0x22d)),0x1;try{const {parentId:_0x36fde7,childId:_0x36ef90}=parseSegmentRef(_0x2616b8[0x0]);_0xb1cf0[_0x2d0429(0x20a)]&&(console[_0x2d0429(0x227)]('Site:\x20'+_0xb1cf0[_0x2d0429(0x256)]),console['error'](_0x2d0429(0x1f4)+_0x36fde7),_0x36ef90&&console[_0x2d0429(0x227)](_0x2d0429(0x201)+_0x36ef90));if(!_0x36ef90)return console[_0x2d0429(0x227)](_0x2d0429(0x21e)),0x1;const _0xb9f743=await withSpinner(_0x2d0429(0x23b)+_0x36fde7+_0x2d0429(0x244),()=>_0xa27f8b[_0x2d0429(0x249)][_0x2d0429(0x218)](_0x36fde7),{'verbose':_0xb1cf0[_0x2d0429(0x20a)]}),_0x5ccf91=_0xb9f743[_0x2d0429(0x21b)];_0xb1cf0[_0x2d0429(0x20a)]&&console[_0x2d0429(0x227)](_0x2d0429(0x243)+_0x5ccf91);const _0x5786b8=await withSpinner(_0x2d0429(0x271)+_0x36ef90+'\x27...',()=>_0xa27f8b[_0x2d0429(0x249)][_0x2d0429(0x238)](_0x5ccf91,_0x36ef90),{'verbose':_0xb1cf0[_0x2d0429(0x20a)]}),_0x4ffae0=_0x5786b8[_0x2d0429(0x21b)];_0xb1cf0[_0x2d0429(0x20a)]&&console[_0x2d0429(0x227)](_0x2d0429(0x23e)+_0x4ffae0);const _0x5e3914=await withSpinner(_0x2d0429(0x254)+_0x36ef90+_0x2d0429(0x244),()=>_0xa27f8b['segment'][_0x2d0429(0x205)](_0x4ffae0),{'verbose':_0xb1cf0['verbose']});return await handleSDKOutput([_0x5e3914[_0x2d0429(0x21b)]],_0xb1cf0),0x0;}catch(_0x5ba301){if(_0x5ba301 instanceof SDKError)return console[_0x2d0429(0x227)]('Error:\x20'+_0x5ba301[_0x2d0429(0x21d)]),_0x5ba301[_0x2d0429(0x20d)]&&console[_0x2d0429(0x227)](_0x2d0429(0x23d)+_0x5ba301[_0x2d0429(0x20d)]),0x1;throw _0x5ba301;}}}export class SegmentSQLCommand extends BaseCommand{[a30_0x2cb603(0x275)]='segment:sql';[a30_0x2cb603(0x259)]=a30_0x2cb603(0x1fe);async[a30_0x2cb603(0x27e)](_0x4bba2e){const _0x477702=a30_0x2cb603,{options:_0xe0e459,args:_0x18997d,tdx:_0x1c403c}=_0x4bba2e,_0x405cb4=_0x18997d[0x0];if(!_0x405cb4)return console[_0x477702(0x227)](_0x477702(0x240)),console[_0x477702(0x227)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x477702(0x227)](_0x477702(0x213)),console[_0x477702(0x227)]('Examples:'),console['error'](_0x477702(0x24f)),console['error'](_0x477702(0x220)),0x1;try{const _0x42ea57=_0xe0e459[_0x477702(0x246)],_0x45c235=resolveSegmentTarget(_0x405cb4,_0x42ea57,_0xe0e459[_0x477702(0x20a)]);_0xe0e459[_0x477702(0x20a)]&&console['error'](_0x477702(0x235)+_0x45c235);const _0x35b89a=await withSpinner(_0x477702(0x264)+_0x405cb4+_0x477702(0x244),()=>_0x1c403c[_0x477702(0x249)][_0x477702(0x233)](_0x45c235),{'verbose':_0xe0e459[_0x477702(0x20a)]}),_0x43fd43=_0x35b89a[_0x477702(0x21b)];_0xe0e459['verbose']&&(console[_0x477702(0x227)](_0x477702(0x20c)+_0x43fd43[_0x477702(0x203)]),console['error']('Parent\x20ID:\x20'+_0x43fd43[_0x477702(0x204)]));if(_0x43fd43[_0x477702(0x203)]===_0x477702(0x257))return console[_0x477702(0x227)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console['error'](_0x477702(0x230)),0x1;if(_0x43fd43[_0x477702(0x203)]===_0x477702(0x25f))return console['error']('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x477702(0x227)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x43fd43[_0x477702(0x239)])throw new SDKError(ErrorCode[_0x477702(0x265)],_0x477702(0x207));const _0x1eb1bb=await withSpinner(_0x477702(0x217),()=>_0x1c403c[_0x477702(0x249)][_0x477702(0x278)](_0x43fd43['parentId'],_0x43fd43[_0x477702(0x239)]),{'verbose':_0xe0e459[_0x477702(0x20a)]}),_0x57f2cd=_0x1eb1bb[_0x477702(0x21b)];return _0xe0e459[_0x477702(0x27d)]==='json'||_0xe0e459[_0x477702(0x27d)]===_0x477702(0x216)?await handleSDKOutput([{'sql':_0x57f2cd}],_0xe0e459):console[_0x477702(0x215)](_0x57f2cd),0x0;}catch(_0x168dd9){if(_0x168dd9 instanceof SDKError)return console[_0x477702(0x227)]('Error:\x20'+_0x168dd9[_0x477702(0x21d)]),_0x168dd9[_0x477702(0x20d)]&&console[_0x477702(0x227)](_0x477702(0x23d)+_0x168dd9[_0x477702(0x20d)]),0x1;throw _0x168dd9;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a30_0x2cb603(0x275)]=a30_0x2cb603(0x21f);[a30_0x2cb603(0x259)]=a30_0x2cb603(0x1fb);async[a30_0x2cb603(0x27e)](_0x31bf1f){const _0x135c7c=a30_0x2cb603,{options:_0x578983,args:_0x1f9e8f,tdx:_0x679405}=_0x31bf1f,_0x553fc6=_0x578983;if(_0x1f9e8f[_0x135c7c(0x253)]<0x2)return console['error'](_0x135c7c(0x22e)),console[_0x135c7c(0x227)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x52eb7d=_0x1f9e8f[0x0],_0x2ed611=_0x1f9e8f[0x1];_0x553fc6['verbose']&&(console[_0x135c7c(0x227)](_0x135c7c(0x219)+_0x553fc6[_0x135c7c(0x256)]),console['error']('Parent\x20segment:\x20'+_0x52eb7d),console['error']('Folder\x20name:\x20'+_0x2ed611));let _0x79fdc7;if(_0x553fc6[_0x135c7c(0x269)]){const _0x3c5b42=_0x553fc6[_0x135c7c(0x269)],_0x2a702b=await withSpinner(_0x135c7c(0x23b)+_0x52eb7d+_0x135c7c(0x244),()=>_0x679405[_0x135c7c(0x249)][_0x135c7c(0x218)](_0x52eb7d),{'verbose':_0x553fc6[_0x135c7c(0x20a)]}),_0xac27fc=_0x2a702b['data'],_0x3b0294=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x3c5b42+_0x135c7c(0x244),()=>_0x679405[_0x135c7c(0x249)][_0x135c7c(0x238)](_0xac27fc,_0x3c5b42),{'verbose':_0x553fc6['verbose']});_0x79fdc7=_0x3b0294[_0x135c7c(0x21b)],_0x553fc6[_0x135c7c(0x20a)]&&console['error']('Resolved\x20parent\x20folder\x20ID:\x20'+_0x79fdc7);}const _0x851a0b={'name':_0x2ed611,'description':_0x553fc6[_0x135c7c(0x259)],'parentFolderId':_0x79fdc7},_0x270962=await withSpinner(_0x135c7c(0x255)+_0x2ed611+'\x27...',()=>_0x679405[_0x135c7c(0x249)][_0x135c7c(0x1ff)](_0x52eb7d,_0x851a0b),{'verbose':_0x553fc6[_0x135c7c(0x20a)]}),_0x1f2ee4=_0x270962[_0x135c7c(0x21b)];return console['error'](_0x135c7c(0x231)+_0x1f2ee4[_0x135c7c(0x275)]+_0x135c7c(0x23a)+_0x1f2ee4['id']),await handleSDKOutput([_0x1f2ee4],_0x553fc6),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']='segment:view';[a30_0x2cb603(0x259)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a30_0x2cb603(0x27e)](_0x30d902){const _0x4d695a=a30_0x2cb603,{options:_0x457626,args:_0x4b8e12,tdx:_0x148b88}=_0x30d902,_0xec351f=_0x4b8e12[0x0];if(!_0xec351f)return console[_0x4d695a(0x227)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4d695a(0x227)](_0x4d695a(0x258)),console[_0x4d695a(0x227)](_0x4d695a(0x237)),console[_0x4d695a(0x227)](_0x4d695a(0x24e)),console[_0x4d695a(0x227)](_0x4d695a(0x262)),console[_0x4d695a(0x227)](_0x4d695a(0x223)),console[_0x4d695a(0x227)](_0x4d695a(0x226)),0x1;try{const _0x5cfef6=_0x457626['parentSegment'],_0xb3abb8=resolveSegmentTarget(_0xec351f,_0x5cfef6,_0x457626[_0x4d695a(0x20a)]);_0x457626[_0x4d695a(0x20a)]&&console[_0x4d695a(0x227)](_0x4d695a(0x235)+_0xb3abb8);const _0x46b716=await withSpinner(_0x4d695a(0x264)+_0xec351f+_0x4d695a(0x244),()=>_0x148b88[_0x4d695a(0x249)][_0x4d695a(0x233)](_0xb3abb8),{'verbose':_0x457626[_0x4d695a(0x20a)]}),_0xbe38fc=_0x46b716[_0x4d695a(0x21b)];_0x457626[_0x4d695a(0x20a)]&&(console[_0x4d695a(0x227)](_0x4d695a(0x20c)+_0xbe38fc[_0x4d695a(0x203)]),console[_0x4d695a(0x227)]('Parent\x20ID:\x20'+_0xbe38fc[_0x4d695a(0x204)]),_0xbe38fc[_0x4d695a(0x236)]&&console[_0x4d695a(0x227)](_0x4d695a(0x229)+_0xbe38fc[_0x4d695a(0x236)]),_0xbe38fc[_0x4d695a(0x239)]&&console['error'](_0x4d695a(0x263)+_0xbe38fc['segmentId']));if(_0xbe38fc[_0x4d695a(0x203)]===_0x4d695a(0x257)){if(!_0xbe38fc[_0x4d695a(0x236)])throw new SDKError(ErrorCode[_0x4d695a(0x27a)],_0x4d695a(0x214));const _0x2f9573=await withSpinner(_0x4d695a(0x24a),()=>_0x148b88['segment'][_0x4d695a(0x205)](_0xbe38fc['folderId']),{'verbose':_0x457626[_0x4d695a(0x20a)]});await handleSingleObjectOutput(_0x2f9573['data'],_0x457626);}else{if(_0xbe38fc[_0x4d695a(0x203)]===_0x4d695a(0x249)){if(!_0xbe38fc[_0x4d695a(0x239)])throw new SDKError(ErrorCode[_0x4d695a(0x265)],_0x4d695a(0x207));const _0x22c5f0=await withSpinner(_0x4d695a(0x1fc),()=>_0x148b88[_0x4d695a(0x249)][_0x4d695a(0x224)](_0xbe38fc['parentId'],_0xbe38fc[_0x4d695a(0x239)]),{'verbose':_0x457626[_0x4d695a(0x20a)]});await handleSingleObjectOutput(_0x22c5f0[_0x4d695a(0x21b)],_0x457626);}else return console[_0x4d695a(0x227)](_0x4d695a(0x221)),console[_0x4d695a(0x227)](_0x4d695a(0x21c)),0x1;}return 0x0;}catch(_0x155246){if(_0x155246 instanceof SDKError)return console[_0x4d695a(0x227)]('Error:\x20'+_0x155246[_0x4d695a(0x21d)]),_0x155246[_0x4d695a(0x20d)]&&console[_0x4d695a(0x227)](_0x4d695a(0x23d)+_0x155246['cause']),0x1;throw _0x155246;}}}function a30_0x5cb7(_0x3b2928,_0x4ad2ac){_0x3b2928=_0x3b2928-0x1f3;const _0x405595=a30_0x4055();let _0x5cb77c=_0x405595[_0x3b2928];return _0x5cb77c;}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a30_0x2cb603(0x252);[a30_0x2cb603(0x259)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a30_0x2cb603(0x27e)](_0xf37d7b){const _0x268a88=a30_0x2cb603,{options:_0x21049d,args:_0x97c241,tdx:_0x5d70b0}=_0xf37d7b,_0x5636ec=_0x97c241[0x0];if(!_0x5636ec)return console[_0x268a88(0x227)](_0x268a88(0x240)),console[_0x268a88(0x227)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x268a88(0x227)](_0x268a88(0x23c)),console['error'](_0x268a88(0x24e)),console[_0x268a88(0x227)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x268a88(0x227)](_0x268a88(0x24b)),0x1;try{const _0x214ad4=_0x21049d[_0x268a88(0x246)],_0x4b34c9=resolveSegmentTarget(_0x5636ec,_0x214ad4,_0x21049d['verbose']);_0x21049d[_0x268a88(0x20a)]&&console[_0x268a88(0x227)](_0x268a88(0x235)+_0x4b34c9);const _0x43acc4=await withSpinner('Resolving\x20\x27'+_0x5636ec+_0x268a88(0x244),()=>_0x5d70b0[_0x268a88(0x249)]['resolvePathToResource'](_0x4b34c9),{'verbose':_0x21049d[_0x268a88(0x20a)]}),_0x2b0bfc=_0x43acc4[_0x268a88(0x21b)];_0x21049d[_0x268a88(0x20a)]&&(console['error'](_0x268a88(0x20c)+_0x2b0bfc[_0x268a88(0x203)]),console['error'](_0x268a88(0x266)+_0x2b0bfc[_0x268a88(0x204)]));if(_0x2b0bfc[_0x268a88(0x203)]===_0x268a88(0x257))return console[_0x268a88(0x227)](_0x268a88(0x250)),console['error'](_0x268a88(0x230)),0x1;if(_0x2b0bfc[_0x268a88(0x203)]==='parent')return console[_0x268a88(0x227)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x268a88(0x227)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x2b0bfc[_0x268a88(0x239)])throw new SDKError(ErrorCode[_0x268a88(0x265)],_0x268a88(0x207));const _0x208419=await withSpinner(_0x268a88(0x217),()=>_0x5d70b0[_0x268a88(0x249)][_0x268a88(0x278)](_0x2b0bfc['parentId'],_0x2b0bfc[_0x268a88(0x239)]),{'verbose':_0x21049d['verbose']}),_0x3b4452=_0x208419[_0x268a88(0x21b)],_0xf1e7ce=await executeSchemaQuery(_0x3b4452,_0x5d70b0,_0x21049d);return await handleQueryOutput(_0xf1e7ce,_0x21049d),0x0;}catch(_0x1e3064){if(_0x1e3064 instanceof SDKError)return console['error'](_0x268a88(0x251)+_0x1e3064[_0x268a88(0x21d)]),_0x1e3064[_0x268a88(0x20d)]&&console[_0x268a88(0x227)](_0x268a88(0x23d)+_0x1e3064[_0x268a88(0x20d)]),0x1;throw _0x1e3064;}}}
1
+ const a30_0x5786e6=a30_0x44e6;(function(_0x5a1c34,_0xc273a7){const _0x14d5dc=a30_0x44e6,_0x24a614=_0x5a1c34();while(!![]){try{const _0x12eca5=-parseInt(_0x14d5dc(0x17b))/0x1+parseInt(_0x14d5dc(0x1e2))/0x2+-parseInt(_0x14d5dc(0x1f2))/0x3*(-parseInt(_0x14d5dc(0x1f5))/0x4)+parseInt(_0x14d5dc(0x1fb))/0x5+-parseInt(_0x14d5dc(0x1af))/0x6+-parseInt(_0x14d5dc(0x1e4))/0x7+parseInt(_0x14d5dc(0x17f))/0x8*(parseInt(_0x14d5dc(0x1f7))/0x9);if(_0x12eca5===_0xc273a7)break;else _0x24a614['push'](_0x24a614['shift']());}catch(_0x23d7ac){_0x24a614['push'](_0x24a614['shift']());}}}(a30_0x3689,0x31b07));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';function resolveSegmentTarget(_0x1d47b9,_0x576adf,_0x35fd7b){const _0x29670e=a30_0x44e6;if(isYamlFilePath(_0x1d47b9))try{const _0x1a9573=resolveYamlFilePath(_0x1d47b9);return _0x35fd7b&&(console[_0x29670e(0x1a1)](_0x29670e(0x1d8)+_0x1d47b9),console[_0x29670e(0x1a1)](_0x29670e(0x194)+_0x1a9573[_0x29670e(0x170)]),console['error'](_0x29670e(0x1e8)+_0x1a9573[_0x29670e(0x176)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0x1a9573[_0x29670e(0x1e3)]||'(root)')),console['error']('\x20\x20Full\x20path:\x20'+_0x1a9573[_0x29670e(0x1b7)])),_0x1a9573[_0x29670e(0x1b7)];}catch(_0x1e5d37){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x1e5d37[_0x29670e(0x184)]);}if(!_0x576adf)throw new SDKError(ErrorCode[_0x29670e(0x196)],_0x29670e(0x1ec));return _0x576adf+'/'+_0x1d47b9;}export class SegmentDescribeCommand extends BaseCommand{['name']=a30_0x5786e6(0x1f4);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x16b);async[a30_0x5786e6(0x177)](_0x4a8fed){const _0x1dd7b1=a30_0x5786e6,{options:_0x384e66,args:_0x372646,tdx:_0x622a3b}=_0x4a8fed,_0x47e4c2=_0x372646[0x0],_0x2f04db=!_0x47e4c2&&!!_0x384e66['parentSegment'],_0x3c485a=_0x47e4c2||_0x384e66[_0x1dd7b1(0x170)];if(!_0x3c485a)return console['error'](_0x1dd7b1(0x1f9)),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x197)),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1c7)),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1b8)),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x187)),console['error'](_0x1dd7b1(0x1b5)),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x175)),0x1;try{const _0x3929f0=_0x384e66[_0x1dd7b1(0x19d)];let _0x5c4d09=_0x3c485a;!_0x2f04db&&_0x3929f0&&!_0x3c485a['includes']('/')&&(_0x5c4d09=_0x3929f0+'/'+_0x3c485a,_0x384e66[_0x1dd7b1(0x1b3)]&&console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x16a)+_0x5c4d09));const _0x512d2c=await withSpinner(_0x1dd7b1(0x1c0)+_0x5c4d09+'\x27...',()=>_0x622a3b[_0x1dd7b1(0x17a)]['resolvePathToResource'](_0x5c4d09),{'verbose':_0x384e66['verbose']}),_0x14156d=_0x512d2c['data'];_0x384e66[_0x1dd7b1(0x1b3)]&&(console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1d0)+_0x14156d[_0x1dd7b1(0x17c)]),console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1ce)+_0x14156d[_0x1dd7b1(0x1f6)]),_0x14156d['folderId']&&console[_0x1dd7b1(0x1a1)]('Folder\x20ID:\x20'+_0x14156d['folderId']),_0x14156d[_0x1dd7b1(0x1d9)]&&console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1b1)+_0x14156d[_0x1dd7b1(0x1d9)]));if(_0x14156d['type']===_0x1dd7b1(0x1ca)){const _0x58a97a=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x622a3b[_0x1dd7b1(0x17a)][_0x1dd7b1(0x185)](_0x14156d[_0x1dd7b1(0x1f6)]),{'verbose':_0x384e66['verbose']});await handleSingleObjectOutput(_0x58a97a[_0x1dd7b1(0x1db)],_0x384e66);}else{if(_0x14156d[_0x1dd7b1(0x17c)]===_0x1dd7b1(0x1cf)){if(!_0x14156d[_0x1dd7b1(0x19a)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x545cef=await withSpinner(_0x1dd7b1(0x18a),()=>_0x622a3b['segment'][_0x1dd7b1(0x1a3)](_0x14156d[_0x1dd7b1(0x19a)]),{'verbose':_0x384e66[_0x1dd7b1(0x1b3)]});await handleSingleObjectOutput(_0x545cef[_0x1dd7b1(0x1db)],_0x384e66);}else{if(_0x14156d[_0x1dd7b1(0x17c)]===_0x1dd7b1(0x17a)){if(!_0x14156d[_0x1dd7b1(0x1d9)])throw new SDKError(ErrorCode[_0x1dd7b1(0x195)],_0x1dd7b1(0x1e1));const _0x626e68=await withSpinner(_0x1dd7b1(0x1d7),()=>_0x622a3b[_0x1dd7b1(0x17a)][_0x1dd7b1(0x1df)](_0x14156d['parentId'],_0x14156d[_0x1dd7b1(0x1d9)]),{'verbose':_0x384e66[_0x1dd7b1(0x1b3)]});await handleSingleObjectOutput(_0x626e68[_0x1dd7b1(0x1db)],_0x384e66);}}}return 0x0;}catch(_0x181fa4){if(_0x181fa4 instanceof SDKError)return console[_0x1dd7b1(0x1a1)]('Error:\x20'+_0x181fa4[_0x1dd7b1(0x184)]),_0x181fa4[_0x1dd7b1(0x193)]&&console[_0x1dd7b1(0x1a1)](_0x1dd7b1(0x1e7)+_0x181fa4[_0x1dd7b1(0x193)]),0x1;throw _0x181fa4;}}}export class SegmentShowCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x1ba);[a30_0x5786e6(0x192)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x175eae){const _0x192e19=a30_0x5786e6,{options:_0x142fce,args:_0x25f809,tdx:_0x405561}=_0x175eae,_0x3f4173=_0x25f809[0x0];if(!_0x3f4173)return console[_0x192e19(0x1a1)](_0x192e19(0x1b2)),console['error'](_0x192e19(0x1b0)),console[_0x192e19(0x1a1)](_0x192e19(0x1a4)),console['error']('Examples:'),console[_0x192e19(0x1a1)](_0x192e19(0x1e0)),console[_0x192e19(0x1a1)](_0x192e19(0x1be)),0x1;try{const _0x7d0a00=_0x142fce[_0x192e19(0x170)],_0x177016=resolveSegmentTarget(_0x3f4173,_0x7d0a00,_0x142fce[_0x192e19(0x1b3)]);_0x142fce[_0x192e19(0x1b3)]&&console[_0x192e19(0x1a1)](_0x192e19(0x1a6)+_0x177016);const _0x535f00=await withSpinner(_0x192e19(0x169)+_0x3f4173+'\x27...',()=>_0x405561[_0x192e19(0x17a)][_0x192e19(0x1eb)](_0x177016),{'verbose':_0x142fce['verbose']}),_0x40ae7d=_0x535f00[_0x192e19(0x1db)];_0x142fce['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x40ae7d[_0x192e19(0x17c)]),console[_0x192e19(0x1a1)]('Parent\x20ID:\x20'+_0x40ae7d[_0x192e19(0x1f6)]));if(_0x40ae7d[_0x192e19(0x17c)]===_0x192e19(0x1cf))return console['error'](_0x192e19(0x1c9)),console['error'](_0x192e19(0x1ef)),0x1;if(_0x40ae7d[_0x192e19(0x17c)]===_0x192e19(0x1ca))return console[_0x192e19(0x1a1)](_0x192e19(0x18c)),console[_0x192e19(0x1a1)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x40ae7d[_0x192e19(0x1d9)])throw new SDKError(ErrorCode[_0x192e19(0x195)],_0x192e19(0x1e1));const _0x4054a1=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x405561[_0x192e19(0x17a)][_0x192e19(0x1c5)](_0x40ae7d[_0x192e19(0x1f6)],_0x40ae7d[_0x192e19(0x1d9)]),{'verbose':_0x142fce[_0x192e19(0x1b3)]});let _0x4c9528=_0x4054a1[_0x192e19(0x1db)];const _0x190945=resolveLimit(_0x142fce[_0x192e19(0x1f0)],DEFAULT_DISPLAY_LIMIT),_0x4b1df2=/\bLIMIT\s+\d+/i[_0x192e19(0x17e)](_0x4c9528);!_0x4b1df2&&(_0x4c9528=_0x4c9528['trim']()[_0x192e19(0x188)](/;+$/,''),_0x4c9528=_0x192e19(0x1b6)+_0x4c9528+_0x192e19(0x1ae)+_0x190945);_0x142fce[_0x192e19(0x1b3)]&&console[_0x192e19(0x1a1)](_0x192e19(0x179)+_0x4c9528);const _0x210534=await withQuerySpinner(_0x192e19(0x190),async _0x480e4d=>{const _0x4ec6f0=_0x192e19,_0x2caec5=await _0x405561[_0x4ec6f0(0x18d)][_0x4ec6f0(0x177)](_0x4c9528,{'catalog':'td','schema':_0x4ec6f0(0x1a9),'onJobId':_0x34a31e=>{const _0xda8fdc=_0x4ec6f0;_0x480e4d[_0xda8fdc(0x1c3)](_0x34a31e);}});return _0x2caec5;},{'verbose':_0x142fce['verbose']}),_0x29ed60=_0x210534['data'],_0x1ab272=_0x29ed60[_0x192e19(0x1b9)]?_0x192e19(0x1dd)+_0x29ed60['jobId']+']':'';return console['error'](_0x192e19(0x1bf)+_0x29ed60['stats'][_0x192e19(0x198)][_0x192e19(0x1c2)]()+_0x192e19(0x1fa)+(_0x192e19(0x1e6)+formatElapsed(_0x29ed60['stats'][_0x192e19(0x16c)])+_0x1ab272)),await handleQueryOutput(_0x29ed60,_0x142fce),0x0;}catch(_0x13aece){if(_0x13aece instanceof SDKError)return console[_0x192e19(0x1a1)](_0x192e19(0x1b4)+_0x13aece[_0x192e19(0x1ab)]+']'),console[_0x192e19(0x1a1)]('\x0a'+_0x13aece['message']),0x1;throw _0x13aece;}}}function a30_0x44e6(_0x1e4be3,_0x513d32){_0x1e4be3=_0x1e4be3-0x167;const _0x36895d=a30_0x3689();let _0x44e65f=_0x36895d[_0x1e4be3];return _0x44e65f;}export class SegmentFolderListCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x1ee);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x1bb);async[a30_0x5786e6(0x177)](_0x442643){const _0x4c3865=a30_0x5786e6,{options:_0x4066fa,args:_0x18f6ea,tdx:_0x363be2}=_0x442643;if(_0x18f6ea[_0x4c3865(0x19e)]===0x0)return console[_0x4c3865(0x1a1)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x4c3865(0x1a1)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x3efa82=_0x18f6ea[0x0];try{_0x4066fa[_0x4c3865(0x1b3)]&&(console[_0x4c3865(0x1a1)](_0x4c3865(0x1f3)+_0x4066fa[_0x4c3865(0x19b)]),console['error']('Parent\x20name:\x20'+_0x3efa82));const _0x1e0f73=await withSpinner(_0x4c3865(0x1a5)+_0x3efa82+_0x4c3865(0x1a7),()=>_0x363be2[_0x4c3865(0x17a)][_0x4c3865(0x1ad)](_0x3efa82),{'verbose':_0x4066fa[_0x4c3865(0x1b3)]}),_0x2b4dcc=_0x1e0f73[_0x4c3865(0x1db)];_0x4066fa[_0x4c3865(0x1b3)]&&console[_0x4c3865(0x1a1)](_0x4c3865(0x180)+_0x2b4dcc);const _0x2c390d=await withSpinner(_0x4c3865(0x18f)+_0x3efa82+_0x4c3865(0x1a7),()=>_0x363be2[_0x4c3865(0x17a)][_0x4c3865(0x18e)](_0x2b4dcc),{'verbose':_0x4066fa[_0x4c3865(0x1b3)]}),_0x5bd37e=_0x2c390d[_0x4c3865(0x1db)];return console[_0x4c3865(0x1a1)](_0x4c3865(0x178)+_0x5bd37e[_0x4c3865(0x19e)]+'\x20folder'+(_0x5bd37e['length']!==0x1?'s':'')),await handleSDKOutput(_0x5bd37e,_0x4066fa),0x0;}catch(_0x23e83b){if(_0x23e83b instanceof SDKError)return console[_0x4c3865(0x1a1)](_0x4c3865(0x19f)+_0x23e83b[_0x4c3865(0x184)]),_0x23e83b[_0x4c3865(0x193)]&&console[_0x4c3865(0x1a1)]('\x20\x20Cause:\x20'+_0x23e83b[_0x4c3865(0x193)]),0x1;throw _0x23e83b;}}}export class SegmentFolderShowCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x189);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x191);async[a30_0x5786e6(0x177)](_0x467c0f){const _0x501bf8=a30_0x5786e6,{options:_0x488585,args:_0x3fa6a7,tdx:_0x47261d}=_0x467c0f;if(_0x3fa6a7[_0x501bf8(0x19e)]===0x0)return console[_0x501bf8(0x1a1)](_0x501bf8(0x182)),console[_0x501bf8(0x1a1)](_0x501bf8(0x1d3)),0x1;try{const {parentId:_0x5a95ed,childId:_0x42cc30}=parseSegmentRef(_0x3fa6a7[0x0]);_0x488585[_0x501bf8(0x1b3)]&&(console['error'](_0x501bf8(0x1f3)+_0x488585[_0x501bf8(0x19b)]),console[_0x501bf8(0x1a1)](_0x501bf8(0x17d)+_0x5a95ed),_0x42cc30&&console['error'](_0x501bf8(0x199)+_0x42cc30));if(!_0x42cc30)return console['error'](_0x501bf8(0x1cb)),0x1;const _0x5ce6d0=await withSpinner(_0x501bf8(0x1a5)+_0x5a95ed+'\x27...',()=>_0x47261d['segment'][_0x501bf8(0x1ad)](_0x5a95ed),{'verbose':_0x488585[_0x501bf8(0x1b3)]}),_0x578bcf=_0x5ce6d0['data'];_0x488585['verbose']&&console[_0x501bf8(0x1a1)](_0x501bf8(0x180)+_0x578bcf);const _0xaa2ce2=await withSpinner('Resolving\x20folder\x20\x27'+_0x42cc30+_0x501bf8(0x1a7),()=>_0x47261d[_0x501bf8(0x17a)]['resolveFolderId'](_0x578bcf,_0x42cc30),{'verbose':_0x488585[_0x501bf8(0x1b3)]}),_0x44d511=_0xaa2ce2[_0x501bf8(0x1db)];_0x488585[_0x501bf8(0x1b3)]&&console[_0x501bf8(0x1a1)](_0x501bf8(0x172)+_0x44d511);const _0x29c2a1=await withSpinner('Fetching\x20folder\x20\x27'+_0x42cc30+_0x501bf8(0x1a7),()=>_0x47261d[_0x501bf8(0x17a)][_0x501bf8(0x1a3)](_0x44d511),{'verbose':_0x488585[_0x501bf8(0x1b3)]});return await handleSDKOutput([_0x29c2a1[_0x501bf8(0x1db)]],_0x488585),0x0;}catch(_0x59c1b6){if(_0x59c1b6 instanceof SDKError)return console[_0x501bf8(0x1a1)](_0x501bf8(0x19f)+_0x59c1b6[_0x501bf8(0x184)]),_0x59c1b6[_0x501bf8(0x193)]&&console['error'](_0x501bf8(0x1e7)+_0x59c1b6[_0x501bf8(0x193)]),0x1;throw _0x59c1b6;}}}function a30_0x3689(){const _0x2677d8=['8ZeokRv','Resolved\x20parent\x20ID:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Folder\x20reference\x20is\x20required','createFolder','message','getParent','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','replace','segment:folder:show','Fetching\x20folder\x20details...','Usage:\x20tdx\x20sg\x20view\x20<name>','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','query','listFolders','Listing\x20folders\x20for\x20parent\x20\x27','Executing\x20segment\x20query...','Show\x20segment\x20folder\x20details','description','cause','\x20\x20Parent\x20segment:\x20','SEGMENT_NOT_FOUND','INVALID_ARGUMENT','Usage:\x20tdx\x20segment\x20describe\x20<path>','processedRows','Folder\x20name:\x20','folderId','site','segment:sql','segmentPath','length','Error:\x20','resolveFolderId','error','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','getFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Resolving\x20parent\x20segment\x20\x27','Target\x20path:\x20','\x27...','Parent\x20segment:\x20','information_schema','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','code','Folder\x20ID\x20missing\x20from\x20resolved\x20path','resolveParentId','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','660378DGKqzf','Usage:\x20tdx\x20sg\x20show\x20<name>','Segment\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','verbose','✖\x20Query\x20failed\x20[','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SELECT\x20*\x20FROM\x20(\x0a','fullPath','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','jobId','segment:show','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolved\x20parent\x20folder\x20ID:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','✔\x20Query\x20completed:\x20Processed\x20','Resolving\x20path\x20\x27','segment:view','toLocaleString','setJobId','Creating\x20folder\x20\x27','getSegmentSQL','parentFolder','Examples:','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','parent','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20SQL\x20for\x20segment...','Parent\x20ID:\x20','folder','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','✔\x20Created\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','format','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Resolving\x20parent\x20folder\x20\x27','Fetching\x20segment\x20details...','Resolved\x20YAML\x20file:\x20','segmentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','data','Use:\x20tdx\x20ps\x20view','\x20[Job\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','getSegment','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Segment\x20ID\x20missing\x20from\x20resolved\x20path','420418EXUyGC','folderPath','955150RuSHPh','segment:folder:create','in\x20','\x20\x20Cause:\x20','\x20\x20Segment\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','jsonl','resolvePathToResource','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','name','segment:folder:list','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','limit','Use:\x20tdx\x20ps\x20desc','42hYekCB','Site:\x20','segment:describe','77116jLijHT','parentId','318267qkeVAl','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Error:\x20Path\x20or\x20name\x20is\x20required','\x20rows\x20','361745wNTSOI','Use:\x20tdx\x20ps\x20sql','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20\x27','Resolved\x20relative\x20path\x20to:\x20','Show\x20segment\x20or\x20folder\x20details','elapsedTimeMillis','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','parentSegment','segment:desc','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segmentName','execute','✔\x20Found\x20','SQL\x20query:\x0a','segment','137787DDzfAk','type','Parent\x20name:\x20','test'];a30_0x3689=function(){return _0x2677d8;};return a30_0x3689();}export class SegmentSQLCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x19c);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x174);async['execute'](_0x57da02){const _0x2240f3=a30_0x5786e6,{options:_0x475fd7,args:_0x77659f,tdx:_0x5932b3}=_0x57da02,_0x3f8199=_0x77659f[0x0];if(!_0x3f8199)return console[_0x2240f3(0x1a1)](_0x2240f3(0x1b2)),console[_0x2240f3(0x1a1)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error'](_0x2240f3(0x1da)),console[_0x2240f3(0x1a1)](_0x2240f3(0x1c7)),console[_0x2240f3(0x1a1)](_0x2240f3(0x1d1)),console['error']('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x3e6645=_0x475fd7[_0x2240f3(0x170)],_0x4e7af6=resolveSegmentTarget(_0x3f8199,_0x3e6645,_0x475fd7[_0x2240f3(0x1b3)]);_0x475fd7['verbose']&&console['error'](_0x2240f3(0x1a6)+_0x4e7af6);const _0xbc38a=await withSpinner(_0x2240f3(0x169)+_0x3f8199+'\x27...',()=>_0x5932b3[_0x2240f3(0x17a)][_0x2240f3(0x1eb)](_0x4e7af6),{'verbose':_0x475fd7[_0x2240f3(0x1b3)]}),_0x3a4c86=_0xbc38a[_0x2240f3(0x1db)];_0x475fd7[_0x2240f3(0x1b3)]&&(console[_0x2240f3(0x1a1)](_0x2240f3(0x1d0)+_0x3a4c86[_0x2240f3(0x17c)]),console[_0x2240f3(0x1a1)](_0x2240f3(0x1ce)+_0x3a4c86[_0x2240f3(0x1f6)]));if(_0x3a4c86['type']===_0x2240f3(0x1cf))return console[_0x2240f3(0x1a1)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x2240f3(0x1a1)](_0x2240f3(0x186)),0x1;if(_0x3a4c86[_0x2240f3(0x17c)]===_0x2240f3(0x1ca))return console['error'](_0x2240f3(0x168)),console[_0x2240f3(0x1a1)](_0x2240f3(0x167)),0x1;if(!_0x3a4c86[_0x2240f3(0x1d9)])throw new SDKError(ErrorCode[_0x2240f3(0x195)],_0x2240f3(0x1e1));const _0x2aa85a=await withSpinner(_0x2240f3(0x1cd),()=>_0x5932b3[_0x2240f3(0x17a)]['getSegmentSQL'](_0x3a4c86[_0x2240f3(0x1f6)],_0x3a4c86[_0x2240f3(0x1d9)]),{'verbose':_0x475fd7[_0x2240f3(0x1b3)]}),_0x5fa1b0=_0x2aa85a[_0x2240f3(0x1db)];return _0x475fd7[_0x2240f3(0x1d4)]==='json'||_0x475fd7[_0x2240f3(0x1d4)]===_0x2240f3(0x1ea)?await handleSDKOutput([{'sql':_0x5fa1b0}],_0x475fd7):console['log'](_0x5fa1b0),0x0;}catch(_0x122fbc){if(_0x122fbc instanceof SDKError)return console[_0x2240f3(0x1a1)](_0x2240f3(0x19f)+_0x122fbc[_0x2240f3(0x184)]),_0x122fbc[_0x2240f3(0x193)]&&console[_0x2240f3(0x1a1)](_0x2240f3(0x1e7)+_0x122fbc['cause']),0x1;throw _0x122fbc;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x1e5);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x16e);async[a30_0x5786e6(0x177)](_0x4b78b8){const _0x5845c7=a30_0x5786e6,{options:_0x3899b2,args:_0x20ed11,tdx:_0x4e0778}=_0x4b78b8,_0x3ec2ea=_0x3899b2;if(_0x20ed11[_0x5845c7(0x19e)]<0x2)return console[_0x5845c7(0x1a1)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x5845c7(0x1e9)),0x1;const _0x1e9952=_0x20ed11[0x0],_0x5eb27d=_0x20ed11[0x1];_0x3ec2ea[_0x5845c7(0x1b3)]&&(console['error'](_0x5845c7(0x1f3)+_0x3ec2ea['site']),console[_0x5845c7(0x1a1)](_0x5845c7(0x1a8)+_0x1e9952),console[_0x5845c7(0x1a1)](_0x5845c7(0x199)+_0x5eb27d));let _0x4d5358;if(_0x3ec2ea['parentFolder']){const _0x3e6f72=_0x3ec2ea[_0x5845c7(0x1c6)],_0x289158=await withSpinner(_0x5845c7(0x1a5)+_0x1e9952+_0x5845c7(0x1a7),()=>_0x4e0778[_0x5845c7(0x17a)][_0x5845c7(0x1ad)](_0x1e9952),{'verbose':_0x3ec2ea[_0x5845c7(0x1b3)]}),_0x510eda=_0x289158[_0x5845c7(0x1db)],_0x495631=await withSpinner(_0x5845c7(0x1d6)+_0x3e6f72+_0x5845c7(0x1a7),()=>_0x4e0778[_0x5845c7(0x17a)][_0x5845c7(0x1a0)](_0x510eda,_0x3e6f72),{'verbose':_0x3ec2ea[_0x5845c7(0x1b3)]});_0x4d5358=_0x495631[_0x5845c7(0x1db)],_0x3ec2ea['verbose']&&console[_0x5845c7(0x1a1)](_0x5845c7(0x1bc)+_0x4d5358);}const _0x40e12b={'name':_0x5eb27d,'description':_0x3ec2ea[_0x5845c7(0x192)],'parentFolderId':_0x4d5358},_0x332393=await withSpinner(_0x5845c7(0x1c4)+_0x5eb27d+_0x5845c7(0x1a7),()=>_0x4e0778[_0x5845c7(0x17a)][_0x5845c7(0x183)](_0x1e9952,_0x40e12b),{'verbose':_0x3ec2ea[_0x5845c7(0x1b3)]}),_0x2f7683=_0x332393[_0x5845c7(0x1db)];return console[_0x5845c7(0x1a1)](_0x5845c7(0x1d2)+_0x2f7683[_0x5845c7(0x1ed)]+'\x27\x20with\x20ID:\x20'+_0x2f7683['id']),await handleSDKOutput([_0x2f7683],_0x3ec2ea),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a30_0x5786e6(0x1c1);['description']='Show\x20folder\x20or\x20child\x20segment\x20details';async['execute'](_0x568dc6){const _0x278558=a30_0x5786e6,{options:_0x1d82cd,args:_0x4d2dad,tdx:_0x2105da}=_0x568dc6,_0x16035a=_0x4d2dad[0x0];if(!_0x16035a)return console[_0x278558(0x1a1)](_0x278558(0x16f)),console['error'](_0x278558(0x18b)),console[_0x278558(0x1a1)](_0x278558(0x1aa)),console[_0x278558(0x1a1)](_0x278558(0x1c7)),console[_0x278558(0x1a1)](_0x278558(0x1a2)),console['error'](_0x278558(0x16d)),console['error'](_0x278558(0x1de)),0x1;try{const _0xd29fa7=_0x1d82cd[_0x278558(0x170)],_0x1d8e2d=resolveSegmentTarget(_0x16035a,_0xd29fa7,_0x1d82cd[_0x278558(0x1b3)]);_0x1d82cd['verbose']&&console[_0x278558(0x1a1)](_0x278558(0x1a6)+_0x1d8e2d);const _0x61049a=await withSpinner(_0x278558(0x169)+_0x16035a+_0x278558(0x1a7),()=>_0x2105da[_0x278558(0x17a)]['resolvePathToResource'](_0x1d8e2d),{'verbose':_0x1d82cd[_0x278558(0x1b3)]}),_0x3c9769=_0x61049a[_0x278558(0x1db)];_0x1d82cd['verbose']&&(console[_0x278558(0x1a1)](_0x278558(0x1d0)+_0x3c9769['type']),console[_0x278558(0x1a1)]('Parent\x20ID:\x20'+_0x3c9769[_0x278558(0x1f6)]),_0x3c9769['folderId']&&console['error']('Folder\x20ID:\x20'+_0x3c9769[_0x278558(0x19a)]),_0x3c9769[_0x278558(0x1d9)]&&console['error'](_0x278558(0x1b1)+_0x3c9769[_0x278558(0x1d9)]));if(_0x3c9769[_0x278558(0x17c)]===_0x278558(0x1cf)){if(!_0x3c9769['folderId'])throw new SDKError(ErrorCode[_0x278558(0x1cc)],_0x278558(0x1ac));const _0x2b7d84=await withSpinner(_0x278558(0x18a),()=>_0x2105da[_0x278558(0x17a)][_0x278558(0x1a3)](_0x3c9769[_0x278558(0x19a)]),{'verbose':_0x1d82cd[_0x278558(0x1b3)]});await handleSingleObjectOutput(_0x2b7d84[_0x278558(0x1db)],_0x1d82cd);}else{if(_0x3c9769[_0x278558(0x17c)]===_0x278558(0x17a)){if(!_0x3c9769[_0x278558(0x1d9)])throw new SDKError(ErrorCode[_0x278558(0x195)],_0x278558(0x1e1));const _0x307e42=await withSpinner(_0x278558(0x1d7),()=>_0x2105da[_0x278558(0x17a)][_0x278558(0x1df)](_0x3c9769[_0x278558(0x1f6)],_0x3c9769[_0x278558(0x1d9)]),{'verbose':_0x1d82cd[_0x278558(0x1b3)]});await handleSingleObjectOutput(_0x307e42[_0x278558(0x1db)],_0x1d82cd);}else return console[_0x278558(0x1a1)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x278558(0x1a1)](_0x278558(0x1dc)),0x1;}return 0x0;}catch(_0x8d32bc){if(_0x8d32bc instanceof SDKError)return console[_0x278558(0x1a1)](_0x278558(0x19f)+_0x8d32bc[_0x278558(0x184)]),_0x8d32bc['cause']&&console[_0x278558(0x1a1)](_0x278558(0x1e7)+_0x8d32bc['cause']),0x1;throw _0x8d32bc;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a30_0x5786e6(0x1ed)]=a30_0x5786e6(0x171);[a30_0x5786e6(0x192)]=a30_0x5786e6(0x1bd);async['execute'](_0x11153e){const _0x480e27=a30_0x5786e6,{options:_0xb622ca,args:_0x43ea5c,tdx:_0x276cf1}=_0x11153e,_0x329771=_0x43ea5c[0x0];if(!_0x329771)return console['error'](_0x480e27(0x1b2)),console[_0x480e27(0x1a1)](_0x480e27(0x181)),console[_0x480e27(0x1a1)](_0x480e27(0x1d5)),console[_0x480e27(0x1a1)](_0x480e27(0x1c7)),console[_0x480e27(0x1a1)](_0x480e27(0x1c8)),console[_0x480e27(0x1a1)](_0x480e27(0x1f8)),0x1;try{const _0x116e68=_0xb622ca['parentSegment'],_0x13257f=resolveSegmentTarget(_0x329771,_0x116e68,_0xb622ca[_0x480e27(0x1b3)]);_0xb622ca[_0x480e27(0x1b3)]&&console[_0x480e27(0x1a1)](_0x480e27(0x1a6)+_0x13257f);const _0x11a775=await withSpinner('Resolving\x20\x27'+_0x329771+_0x480e27(0x1a7),()=>_0x276cf1[_0x480e27(0x17a)][_0x480e27(0x1eb)](_0x13257f),{'verbose':_0xb622ca[_0x480e27(0x1b3)]}),_0x2ac9f0=_0x11a775[_0x480e27(0x1db)];_0xb622ca['verbose']&&(console[_0x480e27(0x1a1)]('Resolved\x20type:\x20'+_0x2ac9f0[_0x480e27(0x17c)]),console['error'](_0x480e27(0x1ce)+_0x2ac9f0[_0x480e27(0x1f6)]));if(_0x2ac9f0['type']===_0x480e27(0x1cf))return console[_0x480e27(0x1a1)](_0x480e27(0x173)),console['error'](_0x480e27(0x186)),0x1;if(_0x2ac9f0[_0x480e27(0x17c)]===_0x480e27(0x1ca))return console[_0x480e27(0x1a1)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x480e27(0x1f1)),0x1;if(!_0x2ac9f0[_0x480e27(0x1d9)])throw new SDKError(ErrorCode[_0x480e27(0x195)],_0x480e27(0x1e1));const _0x4bb071=await withSpinner(_0x480e27(0x1cd),()=>_0x276cf1[_0x480e27(0x17a)][_0x480e27(0x1c5)](_0x2ac9f0[_0x480e27(0x1f6)],_0x2ac9f0[_0x480e27(0x1d9)]),{'verbose':_0xb622ca[_0x480e27(0x1b3)]}),_0x1341e8=_0x4bb071[_0x480e27(0x1db)],_0x404af3=await executeSchemaQuery(_0x1341e8,_0x276cf1,_0xb622ca);return await handleQueryOutput(_0x404af3,_0xb622ca),0x0;}catch(_0x1c0d95){if(_0x1c0d95 instanceof SDKError)return console[_0x480e27(0x1a1)]('Error:\x20'+_0x1c0d95[_0x480e27(0x184)]),_0x1c0d95[_0x480e27(0x193)]&&console[_0x480e27(0x1a1)](_0x480e27(0x1e7)+_0x1c0d95[_0x480e27(0x193)]),0x1;throw _0x1c0d95;}}}
@@ -1 +1 @@
1
- const a31_0x4a3570=a31_0x4d67;(function(_0x20c00e,_0xac8650){const _0x4bc983=a31_0x4d67,_0x1cb56e=_0x20c00e();while(!![]){try{const _0x319700=-parseInt(_0x4bc983(0x175))/0x1+parseInt(_0x4bc983(0x187))/0x2+-parseInt(_0x4bc983(0x158))/0x3+parseInt(_0x4bc983(0x169))/0x4+-parseInt(_0x4bc983(0x185))/0x5*(parseInt(_0x4bc983(0x177))/0x6)+-parseInt(_0x4bc983(0x183))/0x7+parseInt(_0x4bc983(0x16b))/0x8;if(_0x319700===_0xac8650)break;else _0x1cb56e['push'](_0x1cb56e['shift']());}catch(_0x505a22){_0x1cb56e['push'](_0x1cb56e['shift']());}}}(a31_0x1e10,0x255e9));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';function a31_0x1e10(){const _0x48dc8d=['yellow','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','\x20\x20\x20Path:\x20','parent','Site:\x20','folderId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segments','124767vanMmF','kind','6ZbcKdn','ruleFile','Creating\x20segment\x20\x27','Target\x20path:\x20','includes','Segment\x20name:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x27...','folder','data','length','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','669382JbxVnG','segment','10745IkfJZx','✔\x20Created\x20segment\x20\x27','478216bwUKZX','segment:create','type','invisible','Resolved\x20relative\x20path\x20to:\x20','Resolved\x20folder\x20ID:\x20','error','site','587943FpAHAD','name','Resolving\x20parent\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Parent\x20path:\x20','noCountPopulation','segmentPath','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','rule','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Resolving\x20folder\x20\x27','resolveParentId','\x27\x20with\x20ID:\x20','Examples:','verbose','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Create\x20child\x20segment\x20with\x20filtering\x20rules','999420QIrXcA','createSegment','661000vAPClx','resolvePathToResource'];a31_0x1e10=function(){return _0x48dc8d;};return a31_0x1e10();}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a31_0x50ecc4 from'chalk';function a31_0x4d67(_0x52f5b5,_0x3a0749){_0x52f5b5=_0x52f5b5-0x152;const _0x1e10d2=a31_0x1e10();let _0x4d67bc=_0x1e10d2[_0x52f5b5];return _0x4d67bc;}export class SegmentCreateCommand extends BaseCommand{[a31_0x4a3570(0x159)]=a31_0x4a3570(0x188);['description']=a31_0x4a3570(0x168);async['execute'](_0x597381){const _0x3d6366=a31_0x4a3570;console['error'](a31_0x50ecc4['yellow'](_0x3d6366(0x161))),console['error'](a31_0x50ecc4[_0x3d6366(0x16d)](_0x3d6366(0x15b)));const {options:_0x6bc7f8,args:_0x50ab24,tdx:_0xc8985a}=_0x597381,_0x259bf6=_0x6bc7f8;if(_0x50ab24['length']===0x0)return console[_0x3d6366(0x156)](_0x3d6366(0x173)),console[_0x3d6366(0x156)](_0x3d6366(0x182)),console[_0x3d6366(0x156)](_0x3d6366(0x165)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x3d6366(0x156)](_0x3d6366(0x167)),console[_0x3d6366(0x156)](_0x3d6366(0x15f)),0x1;const _0x4be096=_0x50ab24[0x0],_0xcd6d23=_0x6bc7f8[_0x3d6366(0x15e)];let _0x59383e=_0x4be096;_0xcd6d23&&!_0x4be096[_0x3d6366(0x17b)]('/')&&(_0x59383e=_0xcd6d23+'/'+_0x4be096,_0x259bf6['verbose']&&console[_0x3d6366(0x156)](_0x3d6366(0x154)+_0x59383e));const _0x392bae=parsePath(_0x59383e);if(_0x392bae[_0x3d6366(0x174)][_0x3d6366(0x181)]<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console['error'](_0x3d6366(0x16e)),0x1;const _0x45b684=_0x392bae[_0x3d6366(0x174)][0x0],_0x552502=getBaseName(_0x59383e),_0x18b7f7=getParentPath(_0x59383e);_0x259bf6['verbose']&&(console[_0x3d6366(0x156)](_0x3d6366(0x171)+_0x259bf6[_0x3d6366(0x157)]),console[_0x3d6366(0x156)](_0x3d6366(0x17a)+_0x59383e),console[_0x3d6366(0x156)]('Parent:\x20'+_0x45b684),console[_0x3d6366(0x156)](_0x3d6366(0x17c)+_0x552502),console[_0x3d6366(0x156)](_0x3d6366(0x15c)+_0x18b7f7));const _0x15469e=await withSpinner(_0x3d6366(0x15a)+_0x45b684+_0x3d6366(0x17e),()=>_0xc8985a[_0x3d6366(0x184)][_0x3d6366(0x163)](_0x45b684),{'verbose':_0x259bf6['verbose']}),_0x30ee94=_0x15469e[_0x3d6366(0x180)];let _0x53d6fd;if(_0x392bae[_0x3d6366(0x174)][_0x3d6366(0x181)]>0x2){const _0x34631f=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x18b7f7+_0x3d6366(0x17e),()=>_0xc8985a[_0x3d6366(0x184)][_0x3d6366(0x16c)](_0x18b7f7),{'verbose':_0x259bf6[_0x3d6366(0x166)]}),_0x3336b8=_0x34631f[_0x3d6366(0x180)];if(_0x3336b8[_0x3d6366(0x152)]!==_0x3d6366(0x17f)&&_0x3336b8[_0x3d6366(0x152)]!==_0x3d6366(0x170))return console['error'](_0x3d6366(0x17d)),0x1;_0x53d6fd=_0x3336b8[_0x3d6366(0x172)];}else{if(_0x259bf6[_0x3d6366(0x17f)]){const _0xb6d4af=await withSpinner(_0x3d6366(0x162)+_0x259bf6[_0x3d6366(0x17f)]+_0x3d6366(0x17e),()=>_0xc8985a[_0x3d6366(0x184)]['resolveFolderId'](_0x30ee94,_0x259bf6[_0x3d6366(0x17f)]),{'verbose':_0x259bf6[_0x3d6366(0x166)]});_0x53d6fd=_0xb6d4af[_0x3d6366(0x180)];}}_0x259bf6['verbose']&&_0x53d6fd&&console[_0x3d6366(0x156)](_0x3d6366(0x155)+_0x53d6fd);const _0xe10b01=await loadJSONFromOptions(_0x259bf6[_0x3d6366(0x160)],_0x259bf6[_0x3d6366(0x178)]),_0x1c5874={'name':_0x552502,'description':_0x259bf6['description'],'rule':_0xe10b01,'kind':_0x259bf6[_0x3d6366(0x176)]!==undefined?parseInt(_0x259bf6[_0x3d6366(0x176)],0xa):undefined,'isVisible':_0x259bf6[_0x3d6366(0x153)]?![]:undefined,'segmentFolderId':_0x53d6fd,'countPopulation':_0x259bf6[_0x3d6366(0x15d)]?![]:undefined},_0x16df48=await withSpinner(_0x3d6366(0x179)+_0x552502+_0x3d6366(0x17e),()=>_0xc8985a[_0x3d6366(0x184)][_0x3d6366(0x16a)](_0x30ee94,_0x1c5874),{'verbose':_0x259bf6[_0x3d6366(0x166)]}),_0x54b198=_0x16df48[_0x3d6366(0x180)];return console[_0x3d6366(0x156)](_0x3d6366(0x186)+_0x54b198[_0x3d6366(0x159)]+_0x3d6366(0x164)+_0x54b198['id']),_0x59383e!==_0x4be096&&console[_0x3d6366(0x156)](_0x3d6366(0x16f)+_0x59383e),await handleSDKOutput([_0x54b198],_0x259bf6),0x0;}}
1
+ function a31_0x2e46(_0x511f7f,_0x4e64cf){_0x511f7f=_0x511f7f-0x1b2;const _0x2c5bcd=a31_0x2c5b();let _0x2e46f4=_0x2c5bcd[_0x511f7f];return _0x2e46f4;}const a31_0x1af8f5=a31_0x2e46;(function(_0x13927d,_0x4feade){const _0x237c82=a31_0x2e46,_0x5e8a80=_0x13927d();while(!![]){try{const _0x1983fc=-parseInt(_0x237c82(0x1ba))/0x1+parseInt(_0x237c82(0x1d6))/0x2+-parseInt(_0x237c82(0x1dd))/0x3*(-parseInt(_0x237c82(0x1bd))/0x4)+-parseInt(_0x237c82(0x1e4))/0x5*(parseInt(_0x237c82(0x1d5))/0x6)+-parseInt(_0x237c82(0x1e8))/0x7+-parseInt(_0x237c82(0x1c0))/0x8+parseInt(_0x237c82(0x1e0))/0x9*(parseInt(_0x237c82(0x1e1))/0xa);if(_0x1983fc===_0x4feade)break;else _0x5e8a80['push'](_0x5e8a80['shift']());}catch(_0x519e5f){_0x5e8a80['push'](_0x5e8a80['shift']());}}}(a31_0x2c5b,0x62456));function a31_0x2c5b(){const _0x2b741e=['\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Site:\x20','folder','error','invisible','\x20\x20\x20Path:\x20','noCountPopulation','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolved\x20relative\x20path\x20to:\x20','resolveParentId','Creating\x20segment\x20\x27','createSegment','8106ncyKoN','1074008tjPpJY','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Parent:\x20','verbose','segments','5616DWmfoH','yellow','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','9VTMFmM','8344480EHVsGN','length','Resolving\x20folder\x20path\x20\x27','1465MoTTiO','resolvePathToResource','segmentPath','resolveFolderId','3453779Yvygkl','\x27...','execute','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','description','includes','rule','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Resolving\x20folder\x20\x27','16219SsAflS','segment','name','1120zJlYyT','folderId','type','4701080kUObLI','\x27\x20with\x20ID:\x20','kind','Segment\x20name:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Parent\x20path:\x20','data','site'];a31_0x2c5b=function(){return _0x2b741e;};return a31_0x2c5b();}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 a31_0x1ced08 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a31_0x1af8f5(0x1bc)]='segment:create';[a31_0x1af8f5(0x1b5)]=a31_0x1af8f5(0x1d0);async[a31_0x1af8f5(0x1b3)](_0x1a16a0){const _0x581efd=a31_0x1af8f5;console['error'](a31_0x1ced08[_0x581efd(0x1de)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x581efd(0x1cc)](a31_0x1ced08['yellow'](_0x581efd(0x1b4)));const {options:_0xc3f8f2,args:_0x4a876c,tdx:_0x3b3e33}=_0x1a16a0,_0x149788=_0xc3f8f2;if(_0x4a876c[_0x581efd(0x1e2)]===0x0)return console[_0x581efd(0x1cc)](_0x581efd(0x1c9)),console[_0x581efd(0x1cc)](_0x581efd(0x1b8)),console[_0x581efd(0x1cc)]('Examples:'),console[_0x581efd(0x1cc)](_0x581efd(0x1df)),console[_0x581efd(0x1cc)](_0x581efd(0x1d9)),console[_0x581efd(0x1cc)](_0x581efd(0x1c8)),0x1;const _0x5b1063=_0x4a876c[0x0],_0xa451f=_0xc3f8f2[_0x581efd(0x1e6)];let _0x1415cb=_0x5b1063;_0xa451f&&!_0x5b1063[_0x581efd(0x1b6)]('/')&&(_0x1415cb=_0xa451f+'/'+_0x5b1063,_0x149788['verbose']&&console[_0x581efd(0x1cc)](_0x581efd(0x1d1)+_0x1415cb));const _0x59d389=parsePath(_0x1415cb);if(_0x59d389[_0x581efd(0x1dc)][_0x581efd(0x1e2)]<0x2)return console['error'](_0x581efd(0x1c4)),console[_0x581efd(0x1cc)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x50733c=_0x59d389[_0x581efd(0x1dc)][0x0],_0x37eede=getBaseName(_0x1415cb),_0x2a19d3=getParentPath(_0x1415cb);_0x149788[_0x581efd(0x1db)]&&(console['error'](_0x581efd(0x1ca)+_0x149788[_0x581efd(0x1c7)]),console[_0x581efd(0x1cc)]('Target\x20path:\x20'+_0x1415cb),console['error'](_0x581efd(0x1da)+_0x50733c),console[_0x581efd(0x1cc)](_0x581efd(0x1c3)+_0x37eede),console[_0x581efd(0x1cc)](_0x581efd(0x1c5)+_0x2a19d3));const _0x3f77df=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x50733c+_0x581efd(0x1b2),()=>_0x3b3e33['segment'][_0x581efd(0x1d2)](_0x50733c),{'verbose':_0x149788['verbose']}),_0x4a56bc=_0x3f77df[_0x581efd(0x1c6)];let _0x4e01e9;if(_0x59d389[_0x581efd(0x1dc)][_0x581efd(0x1e2)]>0x2){const _0x208aac=await withSpinner(_0x581efd(0x1e3)+_0x2a19d3+_0x581efd(0x1b2),()=>_0x3b3e33[_0x581efd(0x1bb)][_0x581efd(0x1e5)](_0x2a19d3),{'verbose':_0x149788[_0x581efd(0x1db)]}),_0x1d5221=_0x208aac[_0x581efd(0x1c6)];if(_0x1d5221[_0x581efd(0x1bf)]!=='folder'&&_0x1d5221[_0x581efd(0x1bf)]!=='parent')return console[_0x581efd(0x1cc)](_0x581efd(0x1d8)),0x1;_0x4e01e9=_0x1d5221[_0x581efd(0x1be)];}else{if(_0x149788[_0x581efd(0x1cb)]){const _0x68d5ec=await withSpinner(_0x581efd(0x1b9)+_0x149788[_0x581efd(0x1cb)]+_0x581efd(0x1b2),()=>_0x3b3e33[_0x581efd(0x1bb)][_0x581efd(0x1e7)](_0x4a56bc,_0x149788[_0x581efd(0x1cb)]),{'verbose':_0x149788[_0x581efd(0x1db)]});_0x4e01e9=_0x68d5ec[_0x581efd(0x1c6)];}}_0x149788['verbose']&&_0x4e01e9&&console[_0x581efd(0x1cc)](_0x581efd(0x1d7)+_0x4e01e9);const _0x52c0f7=await loadJSONFromOptions(_0x149788[_0x581efd(0x1b7)],_0x149788['ruleFile']),_0x1abb5e={'name':_0x37eede,'description':_0x149788['description'],'rule':_0x52c0f7,'kind':_0x149788[_0x581efd(0x1c2)]!==undefined?parseInt(_0x149788[_0x581efd(0x1c2)],0xa):undefined,'isVisible':_0x149788[_0x581efd(0x1cd)]?![]:undefined,'segmentFolderId':_0x4e01e9,'countPopulation':_0x149788[_0x581efd(0x1cf)]?![]:undefined},_0x6908b3=await withSpinner(_0x581efd(0x1d3)+_0x37eede+_0x581efd(0x1b2),()=>_0x3b3e33['segment'][_0x581efd(0x1d4)](_0x4a56bc,_0x1abb5e),{'verbose':_0x149788[_0x581efd(0x1db)]}),_0x181573=_0x6908b3['data'];return console[_0x581efd(0x1cc)]('✔\x20Created\x20segment\x20\x27'+_0x181573['name']+_0x581efd(0x1c1)+_0x181573['id']),_0x1415cb!==_0x5b1063&&console['error'](_0x581efd(0x1ce)+_0x1415cb),await handleSDKOutput([_0x181573],_0x149788),0x0;}}
@@ -1 +1 @@
1
- const a32_0x4dfb69=a32_0x1d2d;(function(_0x2712a6,_0x313cab){const _0x2bd786=a32_0x1d2d,_0x406e49=_0x2712a6();while(!![]){try{const _0x149a0b=parseInt(_0x2bd786(0x1cb))/0x1*(parseInt(_0x2bd786(0x1c8))/0x2)+parseInt(_0x2bd786(0x1cd))/0x3+parseInt(_0x2bd786(0x1dd))/0x4*(parseInt(_0x2bd786(0x1d8))/0x5)+parseInt(_0x2bd786(0x1cf))/0x6*(parseInt(_0x2bd786(0x1e4))/0x7)+parseInt(_0x2bd786(0x1d9))/0x8+parseInt(_0x2bd786(0x1db))/0x9*(-parseInt(_0x2bd786(0x1c7))/0xa)+parseInt(_0x2bd786(0x1d7))/0xb*(-parseInt(_0x2bd786(0x1df))/0xc);if(_0x149a0b===_0x313cab)break;else _0x406e49['push'](_0x406e49['shift']());}catch(_0x494d56){_0x406e49['push'](_0x406e49['shift']());}}}(a32_0x26da,0x67f64));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a32_0x1d2d(_0x2ac67e,_0x261424){_0x2ac67e=_0x2ac67e-0x1c7;const _0x26da4a=a32_0x26da();let _0x1d2d12=_0x26da4a[_0x2ac67e];return _0x1d2d12;}import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a32_0x4dfb69(0x1da)]=a32_0x4dfb69(0x1c9);[a32_0x4dfb69(0x1e3)]=a32_0x4dfb69(0x1cc);async['execute'](_0x1740ea){const _0x3c0364=a32_0x4dfb69,{options:_0x2862a2,args:_0x2d56da,tdx:_0x5a351d}=_0x1740ea,_0x1ac377=_0x2d56da[0x0]||_0x2862a2[_0x3c0364(0x1d3)];if(!_0x1ac377)return console[_0x3c0364(0x1d2)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x3c0364(0x1e0)),console[_0x3c0364(0x1d2)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x2862a2[_0x3c0364(0x1d0)]&&(console[_0x3c0364(0x1d2)](_0x3c0364(0x1dc)+_0x2862a2[_0x3c0364(0x1ca)]),console[_0x3c0364(0x1d2)](_0x3c0364(0x1e1)+_0x1ac377));const _0x2404d4=await withSpinner(_0x3c0364(0x1ce)+_0x1ac377+'\x27...',()=>_0x5a351d[_0x3c0364(0x1e2)][_0x3c0364(0x1d5)](_0x1ac377),{'verbose':_0x2862a2['verbose']}),_0x47da1d=_0x2404d4[_0x3c0364(0x1d4)];console[_0x3c0364(0x1d2)](_0x3c0364(0x1d1)+_0x47da1d[_0x3c0364(0x1d6)]+'\x20field'+(_0x47da1d['length']!==0x1?'s':''));if(_0x2862a2[_0x3c0364(0x1de)]||_0x2862a2['jsonl'])return await handleSDKOutput(_0x47da1d,_0x2862a2),0x0;return displayFieldsHumanReadable(_0x47da1d,_0x1ac377),0x0;}}function a32_0x26da(){const _0x489d75=['name','42507DpabWh','Site:\x20','63092Icryzt','json','1836pzJsqf','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Parent\x20segment:\x20','segment','description','1393IdQRLF','1420ymILVA','2TnSlvP','segment:fields','site','261991JXSmOh','List\x20available\x20fields\x20for\x20segmentation','1556643VyzTpl','Listing\x20fields\x20for\x20\x27','12972WCtzWH','verbose','✔\x20Found\x20','error','parentSegment','data','listFields','length','39149lahNOY','5ZlJsWJ','3313104kowXDG'];a32_0x26da=function(){return _0x489d75;};return a32_0x26da();}
1
+ function a32_0x1bc1(_0x293acf,_0x22d81e){_0x293acf=_0x293acf-0x199;const _0x14724a=a32_0x1472();let _0x1bc164=_0x14724a[_0x293acf];return _0x1bc164;}const a32_0x26ef60=a32_0x1bc1;function a32_0x1472(){const _0x4654ab=['site','170qLFBDH','Listing\x20fields\x20for\x20\x27','6025261SKzonV','listFields','11893QnObGZ','description','parentSegment','\x27...','verbose','8kVVpNq','List\x20available\x20fields\x20for\x20segmentation','189819HcwwZp','877050XOTzEm','4714896ILaDBE','486155LlNtAC','222dOlMAD','47567XpZHcK','Parent\x20segment:\x20','execute','Error:\x20Parent\x20segment\x20name\x20is\x20required','error','26xrpDtm','data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Site:\x20','segment:fields','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','length','\x20field','segment','name','json'];a32_0x1472=function(){return _0x4654ab;};return a32_0x1472();}(function(_0x34f588,_0x5e337d){const _0x573335=a32_0x1bc1,_0x5c6745=_0x34f588();while(!![]){try{const _0x26357d=-parseInt(_0x573335(0x1a3))/0x1*(parseInt(_0x573335(0x1a8))/0x2)+parseInt(_0x573335(0x19f))/0x3+parseInt(_0x573335(0x19c))/0x4*(-parseInt(_0x573335(0x1a1))/0x5)+-parseInt(_0x573335(0x1a2))/0x6*(-parseInt(_0x573335(0x1b8))/0x7)+parseInt(_0x573335(0x1a0))/0x8+-parseInt(_0x573335(0x19e))/0x9*(parseInt(_0x573335(0x1b4))/0xa)+parseInt(_0x573335(0x1b6))/0xb;if(_0x26357d===_0x5e337d)break;else _0x5c6745['push'](_0x5c6745['shift']());}catch(_0x33238a){_0x5c6745['push'](_0x5c6745['shift']());}}}(a32_0x1472,0x4e5b2));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{[a32_0x26ef60(0x1b1)]=a32_0x26ef60(0x1ac);[a32_0x26ef60(0x1b9)]=a32_0x26ef60(0x19d);async[a32_0x26ef60(0x1a5)](_0x3f276a){const _0x11c1f6=a32_0x26ef60,{options:_0x5e0b49,args:_0x66f43a,tdx:_0x2133af}=_0x3f276a,_0x22a205=_0x66f43a[0x0]||_0x5e0b49[_0x11c1f6(0x199)];if(!_0x22a205)return console[_0x11c1f6(0x1a7)](_0x11c1f6(0x1a6)),console[_0x11c1f6(0x1a7)](_0x11c1f6(0x1aa)),console[_0x11c1f6(0x1a7)](_0x11c1f6(0x1ad)),0x1;_0x5e0b49[_0x11c1f6(0x19b)]&&(console[_0x11c1f6(0x1a7)](_0x11c1f6(0x1ab)+_0x5e0b49[_0x11c1f6(0x1b3)]),console['error'](_0x11c1f6(0x1a4)+_0x22a205));const _0xd58edf=await withSpinner(_0x11c1f6(0x1b5)+_0x22a205+_0x11c1f6(0x19a),()=>_0x2133af[_0x11c1f6(0x1b0)][_0x11c1f6(0x1b7)](_0x22a205),{'verbose':_0x5e0b49[_0x11c1f6(0x19b)]}),_0x35f2a8=_0xd58edf[_0x11c1f6(0x1a9)];console[_0x11c1f6(0x1a7)]('✔\x20Found\x20'+_0x35f2a8[_0x11c1f6(0x1ae)]+_0x11c1f6(0x1af)+(_0x35f2a8['length']!==0x1?'s':''));if(_0x5e0b49[_0x11c1f6(0x1b2)]||_0x5e0b49['jsonl'])return await handleSDKOutput(_0x35f2a8,_0x5e0b49),0x0;return displayFieldsHumanReadable(_0x35f2a8,_0x22a205),0x0;}}