@treasuredata/tdx 0.14.3 → 0.14.4

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 (141) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/api-command.js +1 -1
  8. package/dist/commands/auth-command.js +1 -1
  9. package/dist/commands/chat-command.js +1 -1
  10. package/dist/commands/claude-command.d.ts.map +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-command.js.map +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-command.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/journey-command.js +1 -1
  22. package/dist/commands/journey-validate-command.js +1 -1
  23. package/dist/commands/llm-command.js +1 -1
  24. package/dist/commands/llm-proxy.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.js +1 -1
  43. package/dist/core/auth.js +1 -1
  44. package/dist/core/command-output.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/connection-cache.js +1 -1
  47. package/dist/core/constants.js +1 -1
  48. package/dist/core/credential-cache.js +1 -1
  49. package/dist/core/global-context.js +1 -1
  50. package/dist/core/keychain.js +1 -1
  51. package/dist/core/profile.js +1 -1
  52. package/dist/core/project-config.js +1 -1
  53. package/dist/core/session.js +1 -1
  54. package/dist/core/user-cache.js +1 -1
  55. package/dist/core/version.js +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/proxy/anthropic-adapter.js +1 -1
  58. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  61. package/dist/proxy/context-signature.js +1 -1
  62. package/dist/proxy/conversation-utils.js +1 -1
  63. package/dist/proxy/passthrough-server.js +1 -1
  64. package/dist/proxy/server.js +1 -1
  65. package/dist/proxy/session-cache.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/api.js +1 -1
  71. package/dist/sdk/client/cdp-api-client.js +1 -1
  72. package/dist/sdk/client/endpoints.js +1 -1
  73. package/dist/sdk/client/engage-api-client.js +1 -1
  74. package/dist/sdk/client/http-client.js +1 -1
  75. package/dist/sdk/client/llm-api-client.js +1 -1
  76. package/dist/sdk/client/rate-limiter.js +1 -1
  77. package/dist/sdk/client/td-api-client.js +1 -1
  78. package/dist/sdk/client/trino-api-client.js +1 -1
  79. package/dist/sdk/client/workflow-client.js +1 -1
  80. package/dist/sdk/connection-validator.js +1 -1
  81. package/dist/sdk/connection.js +1 -1
  82. package/dist/sdk/engage.js +1 -1
  83. package/dist/sdk/errors.js +1 -1
  84. package/dist/sdk/index.js +1 -1
  85. package/dist/sdk/io/index.js +1 -1
  86. package/dist/sdk/io/node-filesystem.js +1 -1
  87. package/dist/sdk/job.js +1 -1
  88. package/dist/sdk/journey.js +1 -1
  89. package/dist/sdk/llm/chat-cache.js +1 -1
  90. package/dist/sdk/llm/index.js +1 -1
  91. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  92. package/dist/sdk/llm/model-aliases.js +1 -1
  93. package/dist/sdk/llm/model-factors.js +1 -1
  94. package/dist/sdk/query/index.js +1 -1
  95. package/dist/sdk/query/sql-parser.js +1 -1
  96. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  97. package/dist/sdk/segment/fields-display.js +1 -1
  98. package/dist/sdk/segment/file-discovery.js +1 -1
  99. package/dist/sdk/segment/journey-utils.js +1 -1
  100. package/dist/sdk/segment/journey-yaml.js +1 -1
  101. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  102. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  103. package/dist/sdk/segment/pull-workflow.js +1 -1
  104. package/dist/sdk/segment/push-workflow.js +1 -1
  105. package/dist/sdk/segment/resolution-context.js +1 -1
  106. package/dist/sdk/segment/segment-path-parser.js +1 -1
  107. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  108. package/dist/sdk/segment/target-resolution.js +1 -1
  109. package/dist/sdk/segment/tdx-config.js +1 -1
  110. package/dist/sdk/segment/validate-files.js +1 -1
  111. package/dist/sdk/segment/yaml-validator.js +1 -1
  112. package/dist/sdk/segment.js +1 -1
  113. package/dist/sdk/types/index.js +1 -1
  114. package/dist/sdk/types/progress.js +1 -1
  115. package/dist/sdk/user.js +1 -1
  116. package/dist/sdk/util/format-detector.js +1 -1
  117. package/dist/sdk/util/formatters.js +1 -1
  118. package/dist/sdk/util/index.js +1 -1
  119. package/dist/sdk/util/tree-formatter.js +1 -1
  120. package/dist/sdk/workflow/clone-workflow.js +1 -1
  121. package/dist/sdk/workflow/index.js +1 -1
  122. package/dist/sdk/workflow/pull-workflow.js +1 -1
  123. package/dist/sdk/workflow/push-workflow.js +1 -1
  124. package/dist/sdk/workflow/tdx-config.js +1 -1
  125. package/dist/sdk/workflow/workflow-utils.js +1 -1
  126. package/dist/utils/async.js +1 -1
  127. package/dist/utils/colors.js +1 -1
  128. package/dist/utils/diff.js +1 -1
  129. package/dist/utils/file-permissions.js +1 -1
  130. package/dist/utils/json-loader.js +1 -1
  131. package/dist/utils/option-validation.js +1 -1
  132. package/dist/utils/port.js +1 -1
  133. package/dist/utils/process.js +1 -1
  134. package/dist/utils/prompt.js +1 -1
  135. package/dist/utils/spinner.js +1 -1
  136. package/dist/utils/sse-parser.js +1 -1
  137. package/dist/utils/string-utils.js +1 -1
  138. package/dist/utils/table-ref-parser.js +1 -1
  139. package/dist/utils/tdx-logger.js +1 -1
  140. package/dist/utils/version-check.js +1 -1
  141. package/package.json +1 -1
@@ -1 +1 @@
1
- function a21_0x29dc(_0x39b0b4,_0x456011){_0x39b0b4=_0x39b0b4-0x1ca;const _0x32cabd=a21_0x32ca();let _0x29dcbf=_0x32cabd[_0x39b0b4];return _0x29dcbf;}const a21_0xefde3=a21_0x29dc;(function(_0x28da2e,_0xc85bff){const _0x1e36e4=a21_0x29dc,_0x370432=_0x28da2e();while(!![]){try{const _0x1a3c03=parseInt(_0x1e36e4(0x1ff))/0x1+parseInt(_0x1e36e4(0x2e9))/0x2+parseInt(_0x1e36e4(0x259))/0x3+parseInt(_0x1e36e4(0x238))/0x4*(-parseInt(_0x1e36e4(0x289))/0x5)+-parseInt(_0x1e36e4(0x245))/0x6*(-parseInt(_0x1e36e4(0x1ed))/0x7)+parseInt(_0x1e36e4(0x21e))/0x8+-parseInt(_0x1e36e4(0x2a7))/0x9;if(_0x1a3c03===_0xc85bff)break;else _0x370432['push'](_0x370432['shift']());}catch(_0x1e052f){_0x370432['push'](_0x370432['shift']());}}}(a21_0x32ca,0x72b7e));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a21_0x315862 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a21_0x29c58e from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x352eaf){const _0x4ca04e=a21_0x29dc,_0x66203d=process[_0x4ca04e(0x256)],_0x41578d=_0x66203d==='darwin'?'open':_0x66203d===_0x4ca04e(0x293)?_0x4ca04e(0x27e):_0x4ca04e(0x2af);spawn(_0x41578d,[_0x352eaf],{'detached':!![],'stdio':_0x4ca04e(0x1d9)})['unref']();}function migrateLegacyDirectory(){const _0x406d68=a21_0x29dc;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x574cdb=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x574cdb[_0x406d68(0x240)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x406d68(0x2c2)](a21_0x29c58e['yellow']('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x406d68(0x225)+PARENT_SEGMENT_DIR+_0x406d68(0x1e3))),console[_0x406d68(0x2c2)](a21_0x29c58e[_0x406d68(0x222)](_0x406d68(0x270)+LEGACY_PARENT_SEGMENT_DIR+_0x406d68(0x276))),![];console[_0x406d68(0x2c2)](a21_0x29c58e[_0x406d68(0x215)](_0x406d68(0x241)+LEGACY_PARENT_SEGMENT_DIR+_0x406d68(0x218)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a21_0x29c58e[_0x406d68(0x2c1)](_0x406d68(0x203)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x503e03){const _0x47eb18=_0x503e03 instanceof Error?_0x503e03[_0x406d68(0x247)]:String(_0x503e03);return console[_0x406d68(0x2c2)](a21_0x29c58e[_0x406d68(0x2ce)](_0x406d68(0x1dc)+_0x47eb18+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a21_0xefde3(0x1e6)](_0x2879dd){const _0x1c4f6c=a21_0xefde3;return migrateLegacyDirectory(),super[_0x1c4f6c(0x1e6)](_0x2879dd);}}function resolveYamlFile(_0x497b0f){const _0x429a96=a21_0xefde3;if(_0x497b0f[_0x429a96(0x22e)]('.yml')||_0x497b0f[_0x429a96(0x22e)](_0x429a96(0x23c)))return _0x497b0f;return a21_0x315862['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x497b0f)+'.yml');}function formatProgressMessage(_0x1dd71b){const _0x54015c=a21_0xefde3,_0x1030ea=_0x1dd71b[_0x54015c(0x2e0)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x1030ea){const [,_0xd3574c,_0x734c09,_0x6e2d56='']=_0x1030ea;return a21_0x29c58e[_0x54015c(0x222)](_0xd3574c+':')+'\x20'+_0x734c09+a21_0x29c58e[_0x54015c(0x222)](_0x6e2d56);}return a21_0x29c58e[_0x54015c(0x222)](_0x1dd71b);}function showFileNotFoundError(_0x1c77d1,_0x4c56e8){const _0x4f7be5=a21_0xefde3;console['error'](a21_0x29c58e[_0x4f7be5(0x2ce)](_0x4f7be5(0x1d2)+_0x1c77d1+'\x0a')),console[_0x4f7be5(0x2c2)](a21_0x29c58e[_0x4f7be5(0x1f7)](_0x4f7be5(0x2d8)+_0x4c56e8+_0x4f7be5(0x1d7)));}function showParentSegmentNotSetError(_0x2fe0aa){const _0x5b65c8=a21_0xefde3;console['error'](a21_0x29c58e['yellow'](_0x5b65c8(0x1e0))),console[_0x5b65c8(0x2c2)](_0x2fe0aa);}export class ParentSegmentListCommand extends BaseCommand{[a21_0xefde3(0x232)]=a21_0xefde3(0x231);[a21_0xefde3(0x26a)]='List\x20parent\x20segments';async[a21_0xefde3(0x2eb)](_0x2044ac){const _0x466c14=a21_0xefde3,{options:_0x1b470a,args:_0x35a4ff,tdx:_0x39f928}=_0x2044ac,_0x9c4a13=_0x35a4ff[0x0];_0x1b470a[_0x466c14(0x25c)]&&(console['error'](_0x466c14(0x1d4)+_0x1b470a[_0x466c14(0x202)]),_0x9c4a13&&console[_0x466c14(0x2c2)](_0x466c14(0x244)+_0x9c4a13));const _0x7def22=await withSpinner(_0x9c4a13?_0x466c14(0x258)+_0x9c4a13+'\x27...':_0x466c14(0x2aa),()=>_0x39f928[_0x466c14(0x2d7)]['listParents'](),{'verbose':_0x1b470a[_0x466c14(0x25c)]});let _0xc8c284=_0x7def22[_0x466c14(0x294)];if(_0x9c4a13){const _0x56fb97=_0x9c4a13[_0x466c14(0x2b6)](/[.+^${}()|[\]\\]/g,_0x466c14(0x2b1))[_0x466c14(0x2b6)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x461360=new RegExp('^'+_0x56fb97+'$','i');_0xc8c284=_0xc8c284[_0x466c14(0x1db)](_0xef420=>_0x461360['test'](_0xef420[_0x466c14(0x2c6)][_0x466c14(0x232)]));}_0xc8c284[_0x466c14(0x208)]((_0x8f22bb,_0x600f87)=>_0x8f22bb[_0x466c14(0x2c6)][_0x466c14(0x232)][_0x466c14(0x213)](_0x600f87[_0x466c14(0x2c6)]['name'])),console[_0x466c14(0x2c2)](_0x466c14(0x28a)+_0xc8c284[_0x466c14(0x204)]+'\x20parent\x20segment'+(_0xc8c284['length']!==0x1?'s':''));const _0x2fc7eb=_0x118607=>{const _0x1fd602=_0x466c14;return getConsoleNextUrl(_0x1b470a[_0x1fd602(0x202)],_0x1fd602(0x260)+_0x118607);};if(_0x1b470a[_0x466c14(0x20f)]===_0x466c14(0x262)||_0x1b470a[_0x466c14(0x20f)]===_0x466c14(0x1f3)){const _0x14437f=_0xc8c284[_0x466c14(0x2ec)](_0x303eef=>({..._0x303eef,'url':_0x2fc7eb(_0x303eef['id'])}));await handleSDKOutput(_0x14437f,_0x1b470a);}else{if(_0xc8c284['length']===0x0)_0x9c4a13?console[_0x466c14(0x21d)](_0x466c14(0x2dc)+_0x9c4a13):console[_0x466c14(0x21d)](_0x466c14(0x2ab));else for(const _0x8bc468 of _0xc8c284){const _0x35dba5=_0x8bc468[_0x466c14(0x2c6)]['population']?a21_0x29c58e[_0x466c14(0x222)]('\x20('+formatRows(_0x8bc468[_0x466c14(0x2c6)]['population'])+')'):'',_0x120a26=hyperlink(_0x8bc468[_0x466c14(0x2c6)][_0x466c14(0x232)],_0x2fc7eb(_0x8bc468['id']));console['log']('👥\x20'+_0x120a26+_0x35dba5);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a21_0xefde3(0x232)]=a21_0xefde3(0x274);[a21_0xefde3(0x26a)]=a21_0xefde3(0x2de);async[a21_0xefde3(0x2eb)](_0x1e58fe){const _0x452bad=a21_0xefde3,{options:_0x181594,args:_0x5150b8,tdx:_0x2b301e}=_0x1e58fe;console[_0x452bad(0x2c2)](_0x452bad(0x1cb)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x452bad(0x29a));const _0x115e7e=_0x181594;if(_0x5150b8['length']===0x0)return console[_0x452bad(0x2c2)](a21_0x29c58e['red'](_0x452bad(0x1d3))),console['error'](_0x452bad(0x1cd)),0x1;const _0x1a4953=_0x5150b8[0x0];if(!_0x115e7e['database']||!_0x115e7e[_0x452bad(0x2a2)])return console[_0x452bad(0x2c2)](_0x452bad(0x1f6)),console[_0x452bad(0x2c2)](_0x452bad(0x1cd)),0x1;_0x115e7e['verbose']&&(console[_0x452bad(0x2c2)](_0x452bad(0x1d4)+_0x115e7e['site']),console['error']('Name:\x20'+_0x1a4953),console[_0x452bad(0x2c2)](_0x452bad(0x29f)+_0x115e7e['database']),console[_0x452bad(0x2c2)](_0x452bad(0x2c8)+_0x115e7e[_0x452bad(0x2a2)]));const _0x5960d1=await loadJSONFromOptions(_0x115e7e[_0x452bad(0x2c6)],_0x115e7e[_0x452bad(0x29c)]),_0x1ef5c3=await loadJSONFromOptions(_0x115e7e[_0x452bad(0x24c)],_0x115e7e[_0x452bad(0x2cf)]),_0x16ae0a=await loadJSONFromOptions(_0x115e7e['customerGroup'],_0x115e7e[_0x452bad(0x264)]),_0x2380dc={'name':_0x1a4953,'description':_0x115e7e[_0x452bad(0x26a)],'scheduleType':_0x115e7e[_0x452bad(0x2e5)],'scheduleOption':_0x115e7e[_0x452bad(0x246)],'timezone':_0x115e7e['timezone'],'master':{'parentDatabaseName':_0x115e7e[_0x452bad(0x221)],'parentTableName':_0x115e7e[_0x452bad(0x2a2)]},'attributes':_0x5960d1,'behaviors':_0x1ef5c3,'customerGroup':_0x16ae0a},_0x4eac7c=await withSpinner(_0x452bad(0x220)+_0x1a4953+_0x452bad(0x1d6),()=>_0x2b301e['segment'][_0x452bad(0x2e8)](_0x2380dc),{'verbose':_0x181594['verbose']}),_0x47f868=_0x4eac7c[_0x452bad(0x294)];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0x47f868[_0x452bad(0x232)]+'\x27\x20with\x20ID:\x20'+_0x47f868['id']),await handleSDKOutput([_0x47f868],_0x181594),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a21_0xefde3(0x2f2);[a21_0xefde3(0x26a)]=a21_0xefde3(0x22d);async['execute'](_0x56372d){const _0x30bc2b=a21_0xefde3,{options:_0x4a0e58,args:_0x292bc7,tdx:_0x5a0c48}=_0x56372d;console[_0x30bc2b(0x2c2)](_0x30bc2b(0x1f2)+'\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 _0x192913=_0x4a0e58;if(_0x292bc7[_0x30bc2b(0x204)]===0x0)return console[_0x30bc2b(0x2c2)](a21_0x29c58e[_0x30bc2b(0x2ce)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x30bc2b(0x2c2)](_0x30bc2b(0x25e)),0x1;const _0x46a830=_0x292bc7[0x0];_0x192913[_0x30bc2b(0x25c)]&&(console[_0x30bc2b(0x2c2)](_0x30bc2b(0x1d4)+_0x192913['site']),console[_0x30bc2b(0x2c2)](_0x30bc2b(0x2cb)+_0x46a830));const _0x2759ed=await withSpinner(_0x30bc2b(0x2a3)+_0x46a830+_0x30bc2b(0x1d6),()=>_0x5a0c48[_0x30bc2b(0x2d7)][_0x30bc2b(0x28e)](_0x46a830),{'verbose':_0x192913[_0x30bc2b(0x25c)]}),_0x36fe0d=_0x2759ed[_0x30bc2b(0x294)],_0x497984=await loadJSONFromOptions(_0x192913['addAttributes'],_0x192913[_0x30bc2b(0x2cd)]),_0x3074d0=await loadJSONFromOptions(_0x192913[_0x30bc2b(0x277)],_0x192913[_0x30bc2b(0x1e2)]),_0x58f117={'name':_0x36fe0d[_0x30bc2b(0x232)],'description':_0x192913['description']!==undefined?_0x192913[_0x30bc2b(0x26a)]:_0x36fe0d[_0x30bc2b(0x26a)],'scheduleType':_0x192913[_0x30bc2b(0x2e5)]!==undefined?_0x192913[_0x30bc2b(0x2e5)]:_0x36fe0d[_0x30bc2b(0x2e5)],'scheduleOption':_0x192913[_0x30bc2b(0x246)]!==undefined?_0x192913[_0x30bc2b(0x246)]:_0x36fe0d[_0x30bc2b(0x246)],'timezone':_0x192913['timezone']!==undefined?_0x192913['timezone']:_0x36fe0d['timezone'],'master':_0x36fe0d[_0x30bc2b(0x200)],'attributes':_0x497984?[..._0x36fe0d['attributes']||[],..._0x497984]:_0x36fe0d[_0x30bc2b(0x2c6)],'behaviors':_0x3074d0?[..._0x36fe0d[_0x30bc2b(0x24c)]||[],..._0x3074d0]:_0x36fe0d[_0x30bc2b(0x24c)],'customerGroup':_0x36fe0d['customerGroup']},_0x937152=await withSpinner(_0x30bc2b(0x2e4)+_0x46a830+_0x30bc2b(0x1d6),()=>_0x5a0c48[_0x30bc2b(0x2d7)][_0x30bc2b(0x2ea)](_0x46a830,_0x58f117),{'verbose':_0x192913[_0x30bc2b(0x25c)]}),_0x464fd4=_0x937152[_0x30bc2b(0x294)];return console[_0x30bc2b(0x2c2)](_0x30bc2b(0x282)+_0x464fd4[_0x30bc2b(0x232)]+'\x27'),await handleSDKOutput([_0x464fd4],_0x192913),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a21_0xefde3(0x232)]=a21_0xefde3(0x243);[a21_0xefde3(0x26a)]=a21_0xefde3(0x291);async[a21_0xefde3(0x2eb)](_0x29d95d){const _0x518130=a21_0xefde3,{options:_0x2e441f,args:_0x1cfe6f,tdx:_0x536ab0}=_0x29d95d,_0x1441a2=_0x2e441f,_0x1d5e8c=_0x1cfe6f[0x0]||_0x2e441f[_0x518130(0x2ac)];if(!_0x1d5e8c)return showParentSegmentNotSetError(_0x518130(0x27a)+_0x518130(0x283)),0x1;if(_0x1441a2['use']&&_0x1441a2['output'])return console[_0x518130(0x2c2)](a21_0x29c58e[_0x518130(0x2ce)](_0x518130(0x254))),console[_0x518130(0x2c2)](a21_0x29c58e[_0x518130(0x222)](_0x518130(0x25f))),console[_0x518130(0x2c2)](a21_0x29c58e[_0x518130(0x222)](_0x518130(0x295)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x518130(0x2c2)](a21_0x29c58e[_0x518130(0x1f7)](_0x518130(0x28b))),0x1;const _0x10943e=_0x1441a2[_0x518130(0x1f8)]||a21_0x315862['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1d5e8c)+_0x518130(0x2c4));_0x1441a2[_0x518130(0x25c)]&&(console[_0x518130(0x2c2)](_0x518130(0x1d4)+_0x1441a2[_0x518130(0x202)]),console['error'](_0x518130(0x2cb)+_0x1d5e8c),console[_0x518130(0x2c2)]('Output\x20file:\x20'+_0x10943e));const _0x1ba7d9=await withSpinner(_0x518130(0x1ec)+_0x1d5e8c+_0x518130(0x1d6),()=>_0x536ab0['segment'][_0x518130(0x2ee)](_0x1d5e8c),{'verbose':_0x1441a2[_0x518130(0x25c)]}),_0x53b5cc=_0x1ba7d9[_0x518130(0x294)];if(existsSync(_0x10943e)){const _0x2d010c=readFileSync(_0x10943e,_0x518130(0x1ea)),_0x70cd71=generateDiff(_0x2d010c,_0x53b5cc);if(!hasChanges(_0x70cd71))console[_0x518130(0x2c2)](a21_0x29c58e[_0x518130(0x2c1)]('✔')+'\x20No\x20changes\x20-\x20'+a21_0x29c58e[_0x518130(0x1f7)](_0x10943e)+_0x518130(0x2c5));else{console['error']('\x0aChanges\x20to\x20\x27'+_0x10943e+'\x27:'),console[_0x518130(0x2c2)]('─'[_0x518130(0x1f4)](0x3c)),console['error'](formatDiffWithColors(_0x70cd71)),console[_0x518130(0x2c2)]('─'[_0x518130(0x1f4)](0x3c));if(!_0x1441a2[_0x518130(0x224)]){const _0x55caf7=await confirmKey(_0x518130(0x242)+_0x10943e+'\x27?');if(!_0x55caf7)return console[_0x518130(0x2c2)]('Aborted.'),0x1;}writeFileSync(_0x10943e,_0x53b5cc,_0x518130(0x1ea)),console['error'](a21_0x29c58e[_0x518130(0x2c1)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a21_0x29c58e['cyan'](_0x10943e));}}else{const _0x547e73=a21_0x315862[_0x518130(0x226)](_0x10943e);!existsSync(_0x547e73)&&mkdirSync(_0x547e73,{'recursive':!![]}),writeFileSync(_0x10943e,_0x53b5cc,'utf-8'),console[_0x518130(0x2c2)](a21_0x29c58e[_0x518130(0x2c1)]('✔')+_0x518130(0x267)+a21_0x29c58e['cyan'](_0x10943e));}return saveSessionContext({'parent_segment':_0x1d5e8c},_0x1441a2[_0x518130(0x257)]),console[_0x518130(0x2c2)](a21_0x29c58e[_0x518130(0x2c1)]('✔')+_0x518130(0x2b9)+a21_0x29c58e[_0x518130(0x222)](_0x518130(0x2be))+_0x518130(0x27d)+a21_0x29c58e[_0x518130(0x1f7)](_0x1d5e8c)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a21_0xefde3(0x232)]=a21_0xefde3(0x1f1);[a21_0xefde3(0x26a)]=a21_0xefde3(0x2bb);async['execute'](_0x5f10b3){const _0x2e936b=a21_0xefde3,{options:_0x4d9670,args:_0x470691,tdx:_0xa2484}=_0x5f10b3,_0x29bdd1=_0x4d9670,_0x2e14d9=_0x470691[0x0]||_0x4d9670[_0x2e936b(0x2ac)];if(!_0x2e14d9)return showParentSegmentNotSetError(_0x2e936b(0x24e)+_0x2e936b(0x2e2)),0x1;const _0x360400=resolveYamlFile(_0x2e14d9);if(!existsSync(_0x360400))return showFileNotFoundError(_0x360400,_0x2e14d9),0x1;_0x29bdd1['verbose']&&(console['error'](_0x2e936b(0x1d4)+_0x29bdd1[_0x2e936b(0x202)]),console[_0x2e936b(0x2c2)](_0x2e936b(0x248)+_0x360400));let _0x178745;try{_0x178745=readFileSync(_0x360400,_0x2e936b(0x1ea));}catch(_0x187d59){const _0x383c63=_0x187d59 instanceof Error?_0x187d59['message']:String(_0x187d59);return console[_0x2e936b(0x2c2)]('Error\x20reading\x20file:\x20'+_0x383c63),0x1;}const _0x29e15e=await withSpinner(_0x2e936b(0x287),()=>_0xa2484[_0x2e936b(0x2d7)][_0x2e936b(0x1da)](_0x178745),{'verbose':_0x29bdd1[_0x2e936b(0x25c)]}),_0x23ab79=_0x29e15e[_0x2e936b(0x294)],{isNew:_0x3173a5,name:_0x50ff2b,hasChanges:_0x4f7b43,diffFormatted:_0x25d2ac}=_0x23ab79;if(!_0x4f7b43)return console[_0x2e936b(0x2c2)]('✔\x20No\x20changes\x20-\x20\x27'+_0x50ff2b+_0x2e936b(0x1f5)),0x0;_0x3173a5?console[_0x2e936b(0x2c2)](_0x2e936b(0x223)+_0x50ff2b+'\x27:'):console[_0x2e936b(0x2c2)](_0x2e936b(0x234)+_0x50ff2b+'\x27:');console['error']('─'[_0x2e936b(0x1f4)](0x3c)),console[_0x2e936b(0x2c2)](_0x25d2ac),console[_0x2e936b(0x2c2)]('─'[_0x2e936b(0x1f4)](0x3c));const _0x81d482=_0x3173a5?_0x2e936b(0x281)+_0x50ff2b+'\x27?':_0x2e936b(0x27b)+_0x50ff2b+'\x27?';if(!_0x29bdd1[_0x2e936b(0x224)]){const _0x1cc069=await confirmKey(_0x81d482);if(!_0x1cc069)return console[_0x2e936b(0x2c2)](_0x2e936b(0x1fe)),0x1;}const _0xa450f6=_0x3173a5?_0x2e936b(0x21a):_0x2e936b(0x2d9),_0x7da77c=await withSpinner(_0xa450f6+'\x20parent\x20segment\x20\x27'+_0x50ff2b+_0x2e936b(0x1d6),()=>_0x23ab79[_0x2e936b(0x2bf)](),{'verbose':_0x29bdd1['verbose']}),_0x1a248d=_0x7da77c[_0x2e936b(0x294)],_0x3b2a0d=getConsoleNextUrl(_0x29bdd1['site'],'/app/dw/parentSegments/'+_0x1a248d['id']),_0x568e52=_0x3173a5?_0x2e936b(0x1e9):_0x2e936b(0x1fa);return console['error']('✔\x20'+_0x568e52+_0x2e936b(0x2e7)+_0x1a248d[_0x2e936b(0x232)]+'\x27'),console['error']('\x20\x20'+_0x3b2a0d),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a21_0xefde3(0x205);['description']=a21_0xefde3(0x228);async['execute'](_0x12a5fe){const _0x174daf=a21_0xefde3,{options:_0x224e7f,args:_0x24db3d,tdx:_0x3ccb87}=_0x12a5fe,_0x69efea=_0x224e7f,_0x21b34d=_0x24db3d[0x0]||_0x224e7f['parentSegment'];if(!_0x21b34d)return showParentSegmentNotSetError(_0x174daf(0x1d0)+_0x174daf(0x1ca)+_0x174daf(0x239)+_0x174daf(0x29b)+_0x174daf(0x2b5)+_0x174daf(0x26b)),0x1;const _0x3bd9f8=resolveYamlFile(_0x21b34d);if(!existsSync(_0x3bd9f8))return showFileNotFoundError(_0x3bd9f8,_0x21b34d),0x1;_0x69efea[_0x174daf(0x25c)]&&(console[_0x174daf(0x2c2)](_0x174daf(0x1d4)+_0x69efea['site']),console[_0x174daf(0x2c2)](_0x174daf(0x248)+_0x3bd9f8));let _0x2a0626;try{_0x2a0626=readFileSync(_0x3bd9f8,_0x174daf(0x1ea));}catch(_0x3f9dc5){const _0x46af5e=_0x3f9dc5 instanceof Error?_0x3f9dc5[_0x174daf(0x247)]:String(_0x3f9dc5);return console[_0x174daf(0x2c2)](_0x174daf(0x1d5)+_0x46af5e),0x1;}const _0x141bf3=createCommandSpinner(a21_0x29c58e['dim'](_0x174daf(0x1e4)),{'verbose':_0x69efea[_0x174daf(0x25c)]});_0x141bf3['start']();const _0x444f21={'onProgress':_0x4f2d26=>{const _0x1f0030=_0x174daf;_0x141bf3[_0x1f0030(0x2df)]=formatProgressMessage(_0x4f2d26);}};if(_0x69efea[_0x174daf(0x200)])_0x444f21[_0x174daf(0x200)]=!![];if(_0x69efea['enriched'])_0x444f21[_0x174daf(0x1ef)]=!![];_0x69efea[_0x174daf(0x227)]&&(_0x444f21['attribute']=_0x69efea[_0x174daf(0x227)]);_0x69efea['behavior']&&(_0x444f21['behavior']=_0x69efea[_0x174daf(0x214)]);if(_0x69efea[_0x174daf(0x235)])_0x444f21['interval']=_0x69efea[_0x174daf(0x235)];let _0xecb6a0;try{_0xecb6a0=await _0x3ccb87[_0x174daf(0x2d7)]['validateParentYaml'](_0x2a0626,_0x444f21),_0x141bf3[_0x174daf(0x299)]();}catch(_0x57802b){_0x141bf3['stop']();throw _0x57802b;}const _0x4f79cb=_0x69efea[_0x174daf(0x235)]||_0x174daf(0x27c);return this[_0x174daf(0x2a9)](_0xecb6a0,_0x444f21,_0x3bd9f8,_0x4f79cb),_0xecb6a0['allValid']?0x0:0x1;}[a21_0xefde3(0x2a9)](_0x2a08ed,_0x22318f,_0x4bca75,_0x64e8b3){const _0x58eb41=a21_0xefde3;console['error']('\x0a'+a21_0x29c58e[_0x58eb41(0x1e8)]('Validate:')+'\x20'+_0x2a08ed[_0x58eb41(0x232)]),console[_0x58eb41(0x2c2)]('═'[_0x58eb41(0x1f4)](0x3c)),this['displayMasterInfo'](_0x2a08ed);if(typeof _0x22318f[_0x58eb41(0x227)]==='string'){this[_0x58eb41(0x20b)](_0x2a08ed),this[_0x58eb41(0x237)](_0x2a08ed),this[_0x58eb41(0x265)](_0x4bca75,_0x64e8b3,_0x58eb41(0x227),_0x22318f[_0x58eb41(0x227)]);return;}if(_0x22318f[_0x58eb41(0x227)]===!![]){this[_0x58eb41(0x20b)](_0x2a08ed),this[_0x58eb41(0x237)](_0x2a08ed),this['displayPreviewHints'](_0x4bca75,_0x64e8b3,_0x58eb41(0x2c6));return;}if(typeof _0x22318f[_0x58eb41(0x214)]===_0x58eb41(0x1ce)){this[_0x58eb41(0x25d)](_0x2a08ed,_0x64e8b3),this['displaySummary'](_0x2a08ed),this[_0x58eb41(0x265)](_0x4bca75,_0x64e8b3,_0x58eb41(0x214),_0x22318f[_0x58eb41(0x214)]);return;}if(_0x22318f[_0x58eb41(0x214)]===!![]){this[_0x58eb41(0x25d)](_0x2a08ed,_0x64e8b3),this[_0x58eb41(0x237)](_0x2a08ed),this['displayPreviewHints'](_0x4bca75,_0x64e8b3,_0x58eb41(0x24c));return;}this[_0x58eb41(0x20b)](_0x2a08ed),this['displayBehaviorsStats'](_0x2a08ed,_0x64e8b3),this['displaySummary'](_0x2a08ed),this[_0x58eb41(0x265)](_0x4bca75,_0x64e8b3,_0x58eb41(0x26f));}[a21_0xefde3(0x265)](_0x14a2e5,_0x340863,_0x1f8aa0,_0x22a0f6){const _0x11b103=a21_0xefde3;console['error']('\x0a'+a21_0x29c58e[_0x11b103(0x222)]('To\x20view\x20sample\x20data:'));const _0x55e0cb=_0x340863!=='-1d'?_0x11b103(0x1de)+_0x340863:'';if(_0x1f8aa0===_0x11b103(0x227)&&_0x22a0f6)console[_0x11b103(0x2c2)]('\x20\x20'+a21_0x29c58e['dim']('tdx\x20segment\x20parent\x20preview\x20'+_0x14a2e5+_0x11b103(0x2a5)+_0x22a0f6+'\x22'+_0x55e0cb));else{if(_0x1f8aa0==='behavior'&&_0x22a0f6)console[_0x11b103(0x2c2)]('\x20\x20'+a21_0x29c58e[_0x11b103(0x222)]('tdx\x20segment\x20parent\x20preview\x20'+_0x14a2e5+_0x11b103(0x2ad)+_0x22a0f6+'\x22'+_0x55e0cb));else(_0x1f8aa0===_0x11b103(0x2c6)||_0x1f8aa0===_0x11b103(0x26f))&&console[_0x11b103(0x2c2)]('\x20\x20'+a21_0x29c58e[_0x11b103(0x222)]('tdx\x20segment\x20parent\x20preview\x20'+_0x14a2e5+_0x11b103(0x2d1)+_0x55e0cb));}(_0x1f8aa0==='behaviors'||_0x1f8aa0===_0x11b103(0x26f))&&console[_0x11b103(0x2c2)]('\x20\x20'+a21_0x29c58e['dim']('tdx\x20segment\x20parent\x20preview\x20'+_0x14a2e5+_0x11b103(0x1cf)+_0x55e0cb)),_0x1f8aa0===_0x11b103(0x26f)&&console[_0x11b103(0x2c2)]('\x20\x20'+a21_0x29c58e[_0x11b103(0x222)](_0x11b103(0x2ef)+_0x14a2e5+_0x11b103(0x1e7)+_0x55e0cb));}[a21_0xefde3(0x297)](_0x552b30){const _0x5c02ab=a21_0xefde3,{master:_0x10f00b}=_0x552b30,_0x3603b9=_0x10f00b[_0x5c02ab(0x20e)]?a21_0x29c58e['green']('✔'):a21_0x29c58e[_0x5c02ab(0x2ce)]('✘');console['error']('\x0a'+a21_0x29c58e[_0x5c02ab(0x222)](_0x5c02ab(0x25b))),console['error'](_0x3603b9+'\x20'+a21_0x29c58e['bold'](_0x10f00b['database']+'.'+_0x10f00b['table'])),_0x10f00b[_0x5c02ab(0x20e)]?_0x10f00b['rowCount']!==undefined&&console[_0x5c02ab(0x2c2)]('\x20\x20'+a21_0x29c58e['dim'](_0x5c02ab(0x2b2))+'\x20'+a21_0x29c58e[_0x5c02ab(0x1f7)](formatRows(_0x10f00b[_0x5c02ab(0x206)]))):console[_0x5c02ab(0x2c2)]('\x20\x20'+a21_0x29c58e[_0x5c02ab(0x2ce)](_0x5c02ab(0x28f))+'\x20'+_0x10f00b[_0x5c02ab(0x217)]);}[a21_0xefde3(0x20b)](_0x59121f){const _0x2a7e9e=a21_0xefde3;if(_0x59121f[_0x2a7e9e(0x2c6)][_0x2a7e9e(0x204)]===0x0)return;console[_0x2a7e9e(0x2c2)]('\x0a'+a21_0x29c58e['dim'](_0x2a7e9e(0x23f)));for(const _0x16fedd of _0x59121f['attributes']){const _0x352038=_0x16fedd['schemaValid']?a21_0x29c58e[_0x2a7e9e(0x2c1)]('✔'):a21_0x29c58e[_0x2a7e9e(0x2ce)]('✘');let _0x4e8f37='';if(_0x16fedd[_0x2a7e9e(0x20e)]&&_0x16fedd['matchedCount']!==undefined&&_0x16fedd[_0x2a7e9e(0x2f0)]!==undefined){const _0x4ecc65=_0x16fedd[_0x2a7e9e(0x2f0)][_0x2a7e9e(0x212)](0x1),_0x1dbeb3=_0x16fedd['coveragePercent']>=0x50?a21_0x29c58e[_0x2a7e9e(0x2c1)]:_0x16fedd[_0x2a7e9e(0x2f0)]>=0x32?a21_0x29c58e['yellow']:a21_0x29c58e['red'];_0x4e8f37='\x20'+a21_0x29c58e['dim'](_0x2a7e9e(0x29d))+'\x20'+_0x1dbeb3(_0x4ecc65+'%')+'\x20('+formatRows(_0x16fedd['matchedCount'])+'\x20rows)';}console['error'](_0x352038+'\x20'+a21_0x29c58e[_0x2a7e9e(0x1e8)](_0x16fedd[_0x2a7e9e(0x232)])+_0x4e8f37),console[_0x2a7e9e(0x2c2)]('\x20\x20'+a21_0x29c58e['dim']('Source:')+'\x20'+a21_0x29c58e[_0x2a7e9e(0x1e8)](_0x16fedd[_0x2a7e9e(0x221)]+'.'+_0x16fedd['table']));const _0xef1bac=_0x16fedd[_0x2a7e9e(0x23e)]===_0x16fedd['foreignKey']?a21_0x29c58e[_0x2a7e9e(0x222)](_0x2a7e9e(0x21f))+'\x20'+_0x16fedd[_0x2a7e9e(0x23e)]:a21_0x29c58e[_0x2a7e9e(0x222)]('Join:')+'\x20'+_0x16fedd['joinKey']+'\x20=\x20'+_0x16fedd[_0x2a7e9e(0x2d0)];console['error']('\x20\x20'+_0xef1bac),console[_0x2a7e9e(0x2c2)]('\x20\x20'+a21_0x29c58e[_0x2a7e9e(0x222)](_0x2a7e9e(0x250))),this[_0x2a7e9e(0x28c)](_0x16fedd['columns']),!_0x16fedd[_0x2a7e9e(0x20e)]&&console['error']('\x20\x20'+a21_0x29c58e['red'](_0x2a7e9e(0x28f))+'\x20'+_0x16fedd[_0x2a7e9e(0x217)]);}}[a21_0xefde3(0x25d)](_0x2f6545,_0x371e9d){const _0x7f9ed5=a21_0xefde3;if(_0x2f6545[_0x7f9ed5(0x24c)]['length']===0x0)return;console[_0x7f9ed5(0x2c2)]('\x0a'+a21_0x29c58e['dim'](_0x7f9ed5(0x26d))+'\x20'+a21_0x29c58e[_0x7f9ed5(0x222)]('('+_0x371e9d+')'));for(const _0x495521 of _0x2f6545[_0x7f9ed5(0x24c)]){const _0x4dfe40=_0x495521[_0x7f9ed5(0x20e)]?a21_0x29c58e['green']('✔'):a21_0x29c58e[_0x7f9ed5(0x2ce)]('✘');let _0x505440='';if(_0x495521[_0x7f9ed5(0x20e)]&&_0x495521[_0x7f9ed5(0x273)]!==undefined&&_0x495521['totalEvents']!==undefined){const _0x566a0a=_0x495521[_0x7f9ed5(0x26e)]?.[_0x7f9ed5(0x212)](0x1)||'?',_0x385c52=(_0x495521[_0x7f9ed5(0x26e)]??0x0)>=0x32?a21_0x29c58e[_0x7f9ed5(0x2c1)]:(_0x495521[_0x7f9ed5(0x26e)]??0x0)>=0x14?a21_0x29c58e[_0x7f9ed5(0x215)]:a21_0x29c58e[_0x7f9ed5(0x2ce)];_0x505440='\x20'+a21_0x29c58e[_0x7f9ed5(0x222)](_0x7f9ed5(0x23d))+'\x20'+_0x385c52(formatRows(_0x495521[_0x7f9ed5(0x273)]))+'\x20('+_0x566a0a+_0x7f9ed5(0x210)+a21_0x29c58e[_0x7f9ed5(0x222)](_0x7f9ed5(0x1d1))+'\x20'+a21_0x29c58e[_0x7f9ed5(0x1f7)](formatRows(_0x495521[_0x7f9ed5(0x286)]));}console[_0x7f9ed5(0x2c2)](_0x4dfe40+'\x20'+a21_0x29c58e[_0x7f9ed5(0x1e8)](_0x495521[_0x7f9ed5(0x232)])+_0x505440),console[_0x7f9ed5(0x2c2)]('\x20\x20'+a21_0x29c58e['dim'](_0x7f9ed5(0x2a0))+'\x20'+a21_0x29c58e[_0x7f9ed5(0x1e8)](_0x495521[_0x7f9ed5(0x221)]+'.'+_0x495521[_0x7f9ed5(0x2a2)]));const _0x3ac450=_0x495521[_0x7f9ed5(0x23e)]===_0x495521['foreignKey']?a21_0x29c58e['dim']('Join\x20on:')+'\x20'+_0x495521[_0x7f9ed5(0x23e)]:a21_0x29c58e[_0x7f9ed5(0x222)](_0x7f9ed5(0x298))+'\x20'+_0x495521[_0x7f9ed5(0x23e)]+_0x7f9ed5(0x27d)+_0x495521['foreignKey'];console[_0x7f9ed5(0x2c2)]('\x20\x20'+_0x3ac450),console['error']('\x20\x20'+a21_0x29c58e['dim']('Columns:')),this['displayColumns'](_0x495521['columns']),!_0x495521[_0x7f9ed5(0x20e)]&&console[_0x7f9ed5(0x2c2)]('\x20\x20'+a21_0x29c58e['red'](_0x7f9ed5(0x28f))+'\x20'+_0x495521[_0x7f9ed5(0x217)]);}}['displayColumns'](_0xc12a05){const _0x250d63=a21_0xefde3;for(const _0x41397f of _0xc12a05){_0x41397f[_0x250d63(0x2b8)]===_0x41397f[_0x250d63(0x2c3)]||_0x41397f[_0x250d63(0x2c3)]==='*'?console[_0x250d63(0x2c2)](_0x250d63(0x24f)+_0x41397f[_0x250d63(0x2b8)]):console['error'](_0x250d63(0x24f)+_0x41397f['label']+'\x20'+a21_0x29c58e[_0x250d63(0x222)]('('+_0x41397f['column']+')'));}}[a21_0xefde3(0x237)](_0xad5607){const _0x35cd4e=a21_0xefde3;console[_0x35cd4e(0x2c2)]('─'[_0x35cd4e(0x1f4)](0x3c));if(_0xad5607['errors'][_0x35cd4e(0x204)]>0x0){console[_0x35cd4e(0x2c2)]('\x0a'+a21_0x29c58e[_0x35cd4e(0x2ce)](_0x35cd4e(0x21c)));for(const _0x308474 of _0xad5607[_0x35cd4e(0x2b4)]){console[_0x35cd4e(0x2c2)]('\x20\x20'+a21_0x29c58e[_0x35cd4e(0x2ce)]('•')+'\x20'+_0x308474);}}_0xad5607[_0x35cd4e(0x236)]&&console[_0x35cd4e(0x2c2)]('\x0a'+a21_0x29c58e['green']('✔')+_0x35cd4e(0x255));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a21_0xefde3(0x232)]=a21_0xefde3(0x2ca);[a21_0xefde3(0x26a)]=a21_0xefde3(0x229);async[a21_0xefde3(0x2eb)](_0xf0a60e){const _0x21e10=a21_0xefde3,{options:_0x1f1ca6,args:_0x5b7be7,tdx:_0x392120}=_0xf0a60e,_0x237c14=_0x1f1ca6,_0x4ac4a1=_0x5b7be7[0x0]||_0x1f1ca6[_0x21e10(0x2ac)];if(!_0x4ac4a1)return showParentSegmentNotSetError(_0x21e10(0x230)+_0x21e10(0x23b)+_0x21e10(0x2a1)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x21e10(0x2bc)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x21e10(0x2a4)+_0x21e10(0x26b)),0x1;if(!_0x237c14[_0x21e10(0x200)]&&!_0x237c14[_0x21e10(0x227)]&&!_0x237c14['behavior']&&!_0x237c14[_0x21e10(0x1ef)])return console['error'](a21_0x29c58e[_0x21e10(0x2ce)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x21e10(0x2c2)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x21e10(0x2c2)](_0x21e10(0x27f)),console[_0x21e10(0x2c2)](_0x21e10(0x271)),console[_0x21e10(0x2c2)](_0x21e10(0x288)),console[_0x21e10(0x2c2)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console['error']('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x17453e=resolveYamlFile(_0x4ac4a1);if(!existsSync(_0x17453e))return showFileNotFoundError(_0x17453e,_0x4ac4a1),0x1;_0x237c14[_0x21e10(0x25c)]&&(console[_0x21e10(0x2c2)](_0x21e10(0x1d4)+_0x237c14['site']),console[_0x21e10(0x2c2)](_0x21e10(0x248)+_0x17453e));let _0x43d1b3;try{_0x43d1b3=readFileSync(_0x17453e,'utf-8');}catch(_0x2ca04b){const _0x32b0e2=_0x2ca04b instanceof Error?_0x2ca04b[_0x21e10(0x247)]:String(_0x2ca04b);return console['error'](_0x21e10(0x1d5)+_0x32b0e2),0x1;}let _0x515976;try{_0x515976=parseDef(_0x43d1b3);}catch(_0x3791d2){const _0x39b338=_0x3791d2 instanceof Error?_0x3791d2[_0x21e10(0x247)]:String(_0x3791d2);return console['error'](a21_0x29c58e[_0x21e10(0x2ce)]('Error\x20parsing\x20YAML:\x20'+_0x39b338)),0x1;}if(_0x237c14[_0x21e10(0x227)]===!![]||_0x237c14[_0x21e10(0x227)]===''){const _0x4b03ce=_0x515976[_0x21e10(0x2c6)]?.[_0x21e10(0x2ec)](_0x434f1e=>_0x434f1e[_0x21e10(0x232)])||[];if(_0x4b03ce[_0x21e10(0x204)]===0x0)console[_0x21e10(0x2c2)](a21_0x29c58e[_0x21e10(0x2ce)](_0x21e10(0x20a)));else{console[_0x21e10(0x2c2)](a21_0x29c58e[_0x21e10(0x2ce)](_0x21e10(0x280))),console[_0x21e10(0x2c2)](_0x21e10(0x21b));for(const _0x3e6796 of _0x4b03ce){console[_0x21e10(0x2c2)]('\x20\x20'+a21_0x29c58e[_0x21e10(0x1f7)](_0x3e6796));}console[_0x21e10(0x2c2)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x4ac4a1+_0x21e10(0x2a5)+_0x4b03ce[0x0]+'\x22');}return 0x1;}if(_0x237c14[_0x21e10(0x214)]===!![]||_0x237c14[_0x21e10(0x214)]===''){const _0x4411ec=_0x515976[_0x21e10(0x24c)]?.[_0x21e10(0x2ec)](_0x529352=>_0x529352['name'])||[];if(_0x4411ec[_0x21e10(0x204)]===0x0)console['error'](a21_0x29c58e['red']('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x21e10(0x2c2)](a21_0x29c58e[_0x21e10(0x2ce)](_0x21e10(0x23a))),console[_0x21e10(0x2c2)](_0x21e10(0x24b));for(const _0x45b28d of _0x4411ec){console[_0x21e10(0x2c2)]('\x20\x20'+a21_0x29c58e['cyan'](_0x45b28d));}console[_0x21e10(0x2c2)](_0x21e10(0x2dd)+_0x4ac4a1+_0x21e10(0x2ad)+_0x4411ec[0x0]+'\x22');}return 0x1;}const _0x422cec=createCommandSpinner(a21_0x29c58e['dim'](_0x21e10(0x22f)),{'verbose':_0x237c14[_0x21e10(0x25c)]});_0x422cec[_0x21e10(0x27e)]();const _0x4b6ed7={'onProgress':_0x57a1d5=>{const _0x3f1cf6=_0x21e10;_0x422cec[_0x3f1cf6(0x2df)]=formatProgressMessage(_0x57a1d5);}};if(_0x237c14[_0x21e10(0x200)])_0x4b6ed7[_0x21e10(0x200)]=!![];if(_0x237c14[_0x21e10(0x227)]&&typeof _0x237c14['attribute']==='string')_0x4b6ed7['attribute']=_0x237c14['attribute'];if(_0x237c14[_0x21e10(0x214)]&&typeof _0x237c14[_0x21e10(0x214)]===_0x21e10(0x1ce))_0x4b6ed7[_0x21e10(0x214)]=_0x237c14['behavior'];if(_0x237c14[_0x21e10(0x1ef)])_0x4b6ed7[_0x21e10(0x1ef)]=!![];if(_0x237c14[_0x21e10(0x235)])_0x4b6ed7['interval']=_0x237c14['interval'];let _0x175ec0;try{_0x175ec0=await _0x392120['segment']['previewParentYaml'](_0x43d1b3,_0x4b6ed7),_0x422cec[_0x21e10(0x299)]();}catch(_0x42dab1){_0x422cec[_0x21e10(0x299)]();throw _0x42dab1;}return await this[_0x21e10(0x2cc)](_0x175ec0,{'master':_0x237c14[_0x21e10(0x200)],'attribute':typeof _0x237c14[_0x21e10(0x227)]==='string'?_0x237c14['attribute']:undefined,'behavior':typeof _0x237c14[_0x21e10(0x214)]===_0x21e10(0x1ce)?_0x237c14[_0x21e10(0x214)]:undefined,'enriched':_0x237c14[_0x21e10(0x1ef)]}),_0x175ec0[_0x21e10(0x236)]?0x0:0x1;}async['displayPreviewResults'](_0x7fcb40,_0x1d3988){const _0x13cbd3=a21_0xefde3;console[_0x13cbd3(0x2c2)]('\x0a'+a21_0x29c58e[_0x13cbd3(0x1e8)]('Preview:')+'\x20'+_0x7fcb40[_0x13cbd3(0x232)]),console[_0x13cbd3(0x2c2)]('═'[_0x13cbd3(0x1f4)](0x3c));if(_0x1d3988['master']&&_0x7fcb40['sampleData']){const _0xd6d2c5=a21_0x29c58e[_0x13cbd3(0x222)](_0x13cbd3(0x2bd))+'\x20'+a21_0x29c58e[_0x13cbd3(0x1e8)](_0x7fcb40['master'][_0x13cbd3(0x221)]+'.'+_0x7fcb40['master']['table']);await this['displaySampleData'](_0xd6d2c5,_0x7fcb40[_0x13cbd3(0x268)]);}else{if(_0x1d3988[_0x13cbd3(0x227)]&&_0x7fcb40[_0x13cbd3(0x268)]){const _0x26dab2=a21_0x29c58e['dim'](_0x13cbd3(0x24d))+'\x20'+a21_0x29c58e[_0x13cbd3(0x1e8)](_0x1d3988[_0x13cbd3(0x227)]);await this[_0x13cbd3(0x1d8)](_0x26dab2,_0x7fcb40[_0x13cbd3(0x268)]);}else{if(_0x1d3988[_0x13cbd3(0x214)]&&_0x7fcb40[_0x13cbd3(0x268)]){const _0x3edc82=a21_0x29c58e[_0x13cbd3(0x222)]('Behavior:')+'\x20'+a21_0x29c58e[_0x13cbd3(0x1e8)](_0x1d3988[_0x13cbd3(0x214)]);await this[_0x13cbd3(0x1d8)](_0x3edc82,_0x7fcb40[_0x13cbd3(0x268)]);}else{if(_0x1d3988[_0x13cbd3(0x1ef)]&&_0x7fcb40[_0x13cbd3(0x268)]){const _0x4e3594=a21_0x29c58e[_0x13cbd3(0x222)]('Enriched:')+'\x20'+a21_0x29c58e['bold'](_0x13cbd3(0x1eb));await this[_0x13cbd3(0x1d8)](_0x4e3594,_0x7fcb40['sampleData']);}else!_0x7fcb40[_0x13cbd3(0x268)]&&console[_0x13cbd3(0x2c2)](_0x13cbd3(0x249));}}}if(_0x7fcb40[_0x13cbd3(0x2b4)]['length']>0x0){console[_0x13cbd3(0x2c2)]('─'[_0x13cbd3(0x1f4)](0x3c)),console['error']('\x0a'+a21_0x29c58e[_0x13cbd3(0x2ce)](_0x13cbd3(0x21c)));for(const _0xa41525 of _0x7fcb40[_0x13cbd3(0x2b4)]){console[_0x13cbd3(0x2c2)]('\x20\x20'+a21_0x29c58e[_0x13cbd3(0x2ce)]('•')+'\x20'+_0xa41525);}}}async[a21_0xefde3(0x1d8)](_0x56bf83,_0x117856){const _0x4aa33e=a21_0xefde3;if(_0x117856[_0x4aa33e(0x204)]===0x0){console[_0x4aa33e(0x2c2)]('\x0a'+_0x56bf83),console[_0x4aa33e(0x2c2)](_0x4aa33e(0x252));return;}console['error']('\x0a'+_0x56bf83);const _0x469dc0=Object[_0x4aa33e(0x1ee)](_0x117856[0x0])[_0x4aa33e(0x2ec)](_0x361660=>({'name':_0x361660,'type':typeof _0x117856[0x0][_0x361660]===_0x4aa33e(0x285)?_0x4aa33e(0x20d):'varchar'})),_0x1966fd={'queryId':_0x4aa33e(0x290),'columns':_0x469dc0,'data':_0x117856,'stats':{'state':_0x4aa33e(0x272),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x117856[_0x4aa33e(0x204)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x1ec68f=formatAsTable(_0x1966fd,_0x117856['length'],!![]);await writeOutput(_0x1ec68f,undefined,_0x4aa33e(0x2a2));}}function a21_0x32ca(){const _0x27fe38=['Listing\x20parent\x20segments\x20matching\x20\x27','2592021WyMijI','jobId','Master\x20Table','verbose','displayBehaviorsStats','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','/app/dw/parentSegments/','Show\x20parent\x20segment\x20details','json','\x20Opening\x20','customerGroupFile','displayPreviewHints','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','sampleData','segment:parent:view','description','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Resolving\x20parent\x20segment\x20\x27','Behaviors','customerPercent','all','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','FINISHED','customersWithEvents','segment:parent:create','\x20field','/\x20directory.\x0a','addBehaviors','✔\x20Query\x20completed:\x20Processed\x20','workflowAttemptId','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','Apply\x20changes\x20to\x20\x27','-1d','\x20=\x20','start','Options:','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Create\x20parent\x20segment\x20\x27','✔\x20Updated\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Session:','number','totalEvents','Analyzing\x20changes...','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','10iHUgpT','✔\x20Found\x20','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','displayColumns','\x0a✔\x20Workflow\x20started','getParentFull','Error:','preview','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','/app/workflows/','win32','data','using\x20the\x20default\x20path:\x20','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','displayMasterInfo','Join:','stop','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','attributesFile','Coverage:','Fetching\x20SQL\x20for\x20\x27','Database:\x20','Source:','Options\x20(one\x20required):\x0a','table','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20--attribute\x20\x22','/attempt/','8926983bcQTIy','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','displayValidateResults','Listing\x20parent\x20segments...','No\x20parent\x20segments\x20found','parentSegment','\x20--behavior\x20\x22','information_schema','xdg-open','web','\x5c$&','Rows:','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','errors','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','replace','List\x20available\x20fields\x20for\x20segmentation','label','\x20Context\x20set:\x20','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Master:','parent_segment','apply','segment:parent:sql','green','error','column','.yml','\x20is\x20already\x20up\x20to\x20date','attributes','\x27\x20is\x20up\x20to\x20date','Table:\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','segment:parent:preview','Parent\x20segment:\x20','displayPreviewResults','addAttributesFile','red','behaviorsFile','foreignKey','\x20--attribute\x20\x22<name>\x22','Found\x20YAML\x20file:\x20','segment:parent:show','\x20tdx\x20wf\x20attempt\x20','processedRows','limit','segment','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Updating','resolveParentId','Listing\x20fields\x20for\x20\x27','No\x20parent\x20segments\x20match\x20pattern:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','text','match','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','setJobId','Updating\x20parent\x20segment\x20\x27','scheduleType','segment:parent:run','\x20parent\x20segment\x20\x27','createParent','225006STIuTv','updateParent','execute','map','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','pullParentYaml','tdx\x20segment\x20parent\x20preview\x20','coveragePercent','Get\x20SQL\x20query\x20for\x20parent\x20segment','segment:parent:update','status','Status:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','string','\x20--behavior\x20\x22<name>\x22','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Events:','Error:\x20File\x20not\x20found:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Site:\x20','Error\x20reading\x20file:\x20','\x27...','`\x20to\x20download\x20the\x20configuration\x20first','displaySampleData','ignore','pushParentYaml','filter','✘\x20Failed\x20to\x20rename\x20directory:\x20','toLocaleString','\x20--interval\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','To\x20cancel:','addBehaviorsFile','/\x20directories\x20exist.','Validating\x20configuration...','Show\x20parent\x20segment\x20schema\x20(column\x20types)','run','\x20--enriched','bold','Created','utf-8','Master\x20+\x20Attributes','Fetching\x20parent\x20segment\x20\x27','2589601EVjEgW','keys','enriched','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','segment:parent:push','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','jsonl','repeat','\x27\x20is\x20already\x20up\x20to\x20date','Error:\x20--database\x20and\x20--table\x20are\x20required','cyan','output','trim','Updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','SQL\x20query:\x0a','Aborted.','153746DQONrs','master','test','site','✔\x20Renamed\x20directory\x20to\x20','length','segment:parent:validate','rowCount','Attempt:','sort','in\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','displayAttributesStats','Audience\x20ID:','double','schemaValid','format','%)\x20','\x20[Job\x20ID:\x20','toFixed','localeCompare','behavior','yellow','runParent','schemaError','/\x20→\x20','segment:parent:fields','Creating','Available\x20attributes:','Errors:','log','6979808CPKAvw','Join\x20on:','Creating\x20parent\x20segment\x20\x27','database','dim','\x0aNew\x20parent\x20segment\x20\x27','yes','/\x20and\x20','dirname','attribute','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','/sessions/','query','getParentSQL','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','endsWith','Fetching\x20sample\x20data...','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','segment:parent:list','name','\x20kill','\x0aChanges\x20to\x20apply\x20to\x20\x27','interval','allValid','displaySummary','1821804DwOYmP','Options:\x0a','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','.yaml','Customers:','joinKey','Attributes','isDirectory','\x0a⚠️\x20\x20Migrating:\x20','Overwrite\x20\x27','segment:parent:pull','Pattern:\x20','6bPiens','scheduleOption','message','YAML\x20file:\x20','\x0aNo\x20sample\x20data\x20available','workflowSessionId','Available\x20behaviors:','behaviors','Attribute:','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','\x20\x20\x20\x20-\x20','Columns:','\x27\x20and\x20run\x20workflow?','\x20\x20No\x20sample\x20data\x20available','stats','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20Configuration\x20is\x20valid','platform','session'];a21_0x32ca=function(){return _0x27fe38;};return a21_0x32ca();}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a21_0xefde3(0x232)]=a21_0xefde3(0x2e6);[a21_0xefde3(0x26a)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async['execute'](_0x146b2b){const _0x8a3075=a21_0xefde3,{options:_0x17742d,args:_0x4f364d,tdx:_0x3a3d9b}=_0x146b2b,_0x4733e2=_0x17742d,_0x21675e=_0x4f364d[0x0]||_0x17742d['parentSegment'];if(!_0x21675e)return showParentSegmentNotSetError(_0x8a3075(0x2a8)+_0x8a3075(0x2ed)),0x1;const _0x1b1c8a=resolveYamlFile(_0x21675e);if(existsSync(_0x1b1c8a)){_0x4733e2[_0x8a3075(0x25c)]&&console[_0x8a3075(0x2c2)](_0x8a3075(0x2d2)+_0x1b1c8a);let _0x223ba5;try{_0x223ba5=readFileSync(_0x1b1c8a,'utf-8');}catch(_0x2db230){const _0x3f14a2=_0x2db230 instanceof Error?_0x2db230[_0x8a3075(0x247)]:String(_0x2db230);return console[_0x8a3075(0x2c2)](_0x8a3075(0x1d5)+_0x3f14a2),0x1;}const _0x2d87d0=await withSpinner(_0x8a3075(0x287),()=>_0x3a3d9b[_0x8a3075(0x2d7)][_0x8a3075(0x1da)](_0x223ba5),{'verbose':_0x4733e2[_0x8a3075(0x25c)]}),_0xe4fe12=_0x2d87d0[_0x8a3075(0x294)],{isNew:_0x267dc4,name:_0x2e3604,hasChanges:_0x162e9c,diffFormatted:_0x340f0c}=_0xe4fe12;if(_0x162e9c){_0x267dc4?console['error'](_0x8a3075(0x223)+_0x2e3604+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x2e3604+'\x27:');console['error']('─'[_0x8a3075(0x1f4)](0x3c)),console[_0x8a3075(0x2c2)](_0x340f0c),console[_0x8a3075(0x2c2)]('─'[_0x8a3075(0x1f4)](0x3c));const _0x3258ae=_0x267dc4?'Create\x20parent\x20segment\x20\x27'+_0x2e3604+_0x8a3075(0x251):_0x8a3075(0x27b)+_0x2e3604+_0x8a3075(0x251);if(!_0x4733e2[_0x8a3075(0x224)]){const _0x4cf731=await confirmKey(_0x3258ae);if(!_0x4cf731)return console[_0x8a3075(0x2c2)](_0x8a3075(0x1fe)),0x1;}const _0x54615d=_0x267dc4?_0x8a3075(0x21a):_0x8a3075(0x2d9);await withSpinner(_0x54615d+_0x8a3075(0x2e7)+_0x2e3604+_0x8a3075(0x1d6),()=>_0xe4fe12[_0x8a3075(0x2bf)](),{'verbose':_0x4733e2[_0x8a3075(0x25c)]});const _0x2d6871=_0x267dc4?_0x8a3075(0x1e9):_0x8a3075(0x1fa);console[_0x8a3075(0x2c2)]('✔\x20'+_0x2d6871+_0x8a3075(0x2e7)+_0x2e3604+'\x27');}else console[_0x8a3075(0x2c2)]('✔\x20No\x20changes\x20-\x20\x27'+_0x2e3604+_0x8a3075(0x2c7));}const _0x4867d7=await withSpinner(_0x8a3075(0x296)+_0x21675e+_0x8a3075(0x1d6),()=>_0x3a3d9b[_0x8a3075(0x2d7)][_0x8a3075(0x216)](_0x21675e),{'verbose':_0x4733e2[_0x8a3075(0x25c)]}),_0x3635ee=_0x4867d7['data'],_0x17c4cf=getConsoleUrl(_0x4733e2['site'],_0x8a3075(0x292)+_0x3635ee['workflowId']+_0x8a3075(0x22a)+_0x3635ee[_0x8a3075(0x24a)]+_0x8a3075(0x2a6)+_0x3635ee[_0x8a3075(0x279)]);return console[_0x8a3075(0x2c2)](_0x8a3075(0x28d)),console[_0x8a3075(0x2c2)]('\x20\x20'+a21_0x29c58e[_0x8a3075(0x222)](_0x8a3075(0x20c))+'\x20'+_0x3635ee['audienceId']),console[_0x8a3075(0x2c2)]('\x20\x20'+a21_0x29c58e['dim'](_0x8a3075(0x2f4))+'\x20'+_0x3635ee[_0x8a3075(0x2f3)]),console[_0x8a3075(0x2c2)]('\x20\x20'+a21_0x29c58e[_0x8a3075(0x222)](_0x8a3075(0x284))+'\x20'+_0x3635ee[_0x8a3075(0x24a)]),console[_0x8a3075(0x2c2)]('\x20\x20'+a21_0x29c58e[_0x8a3075(0x222)](_0x8a3075(0x207))+'\x20'+_0x3635ee[_0x8a3075(0x279)]),console[_0x8a3075(0x2c2)]('\x20\x20'+_0x17c4cf),console[_0x8a3075(0x2c2)]('\x0a'+a21_0x29c58e[_0x8a3075(0x222)](_0x8a3075(0x1e1))+_0x8a3075(0x2d4)+_0x3635ee['workflowAttemptId']+_0x8a3075(0x233)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a21_0xefde3(0x232)]=a21_0xefde3(0x219);[a21_0xefde3(0x26a)]=a21_0xefde3(0x2b7);async[a21_0xefde3(0x2eb)](_0x15763a){const _0x555be7=a21_0xefde3,{options:_0x115744,args:_0x4040ad,tdx:_0x30c829}=_0x15763a,_0x4cb0e4=_0x4040ad[0x0]||_0x115744['parentSegment'];if(!_0x4cb0e4)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+_0x555be7(0x1f0)),0x1;_0x115744[_0x555be7(0x25c)]&&(console[_0x555be7(0x2c2)]('Site:\x20'+_0x115744[_0x555be7(0x202)]),console[_0x555be7(0x2c2)](_0x555be7(0x2cb)+_0x4cb0e4));const _0x4ad051=await withSpinner(_0x555be7(0x2db)+_0x4cb0e4+_0x555be7(0x1d6),()=>_0x30c829[_0x555be7(0x2d7)]['listFields'](_0x4cb0e4),{'verbose':_0x115744[_0x555be7(0x25c)]}),_0x270a43=_0x4ad051[_0x555be7(0x294)];console[_0x555be7(0x2c2)](_0x555be7(0x28a)+_0x270a43[_0x555be7(0x204)]+_0x555be7(0x275)+(_0x270a43[_0x555be7(0x204)]!==0x1?'s':''));if(_0x115744[_0x555be7(0x262)]||_0x115744['jsonl'])return await handleSDKOutput(_0x270a43,_0x115744),0x0;return displayFieldsHumanReadable(_0x270a43,_0x4cb0e4),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a21_0xefde3(0x269);[a21_0xefde3(0x26a)]=a21_0xefde3(0x261);async[a21_0xefde3(0x2eb)](_0x52905a){const _0x12f28b=a21_0xefde3,{options:_0xe7ca55,args:_0x2ed99f,tdx:_0xdb6c54}=_0x52905a,_0x2b5521=_0xe7ca55,_0x3cf300=_0x2ed99f[0x0]||_0xe7ca55[_0x12f28b(0x2ac)];if(!_0x3cf300)return showParentSegmentNotSetError(_0x12f28b(0x2c9)+_0x12f28b(0x1fb)+_0x12f28b(0x239)+_0x12f28b(0x2e1)),0x1;_0xe7ca55[_0x12f28b(0x25c)]&&(console[_0x12f28b(0x2c2)]('Site:\x20'+_0xe7ca55[_0x12f28b(0x202)]),console['error'](_0x12f28b(0x2cb)+_0x3cf300));const _0x242c96=await withSpinner(_0x12f28b(0x1ec)+_0x3cf300+'\x27...',()=>_0xdb6c54[_0x12f28b(0x2d7)][_0x12f28b(0x28e)](_0x3cf300),{'verbose':_0xe7ca55[_0x12f28b(0x25c)]}),_0x2e8e4d=_0x242c96[_0x12f28b(0x294)];if(_0x2b5521[_0x12f28b(0x2b0)]){const _0x2923e6=getConsoleNextUrl(_0x2b5521[_0x12f28b(0x202)],_0x12f28b(0x260)+_0x2e8e4d['id']);return console['error'](a21_0x29c58e['green']('✔')+_0x12f28b(0x263)+a21_0x29c58e[_0x12f28b(0x1f7)](_0x2923e6)),openBrowser(_0x2923e6),0x0;}return await handleSingleObjectOutput(_0x2e8e4d,_0xe7ca55),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a21_0xefde3(0x232)]='segment:parent:desc';[a21_0xefde3(0x26a)]=a21_0xefde3(0x1e5);async['execute'](_0x38ec5e){const _0x53247a=a21_0xefde3,{options:_0xc3ed67,args:_0x3a6a89,tdx:_0x259745}=_0x38ec5e,_0x4f37c9=_0x3a6a89[0x0]||_0xc3ed67[_0x53247a(0x2ac)];if(!_0x4f37c9)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a'+_0x53247a(0x1df)),0x1;_0xc3ed67[_0x53247a(0x25c)]&&(console[_0x53247a(0x2c2)](_0x53247a(0x1d4)+_0xc3ed67[_0x53247a(0x202)]),console[_0x53247a(0x2c2)](_0x53247a(0x2cb)+_0x4f37c9));const _0x13f9e7=await withSpinner(_0x53247a(0x26c)+_0x4f37c9+_0x53247a(0x1d6),()=>_0x259745[_0x53247a(0x2d7)]['resolveParentId'](_0x4f37c9),{'verbose':_0xc3ed67[_0x53247a(0x25c)]}),_0x47b99c=_0x13f9e7[_0x53247a(0x294)],_0xdca9d4=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x4f37c9+'\x27...',()=>_0x259745[_0x53247a(0x2d7)][_0x53247a(0x22c)](_0x47b99c),{'verbose':_0xc3ed67['verbose']}),_0x14a3bc=await executeSchemaQuery(_0xdca9d4[_0x53247a(0x294)],_0x259745,_0xc3ed67);return await handleQueryOutput(_0x14a3bc,_0xc3ed67),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a21_0xefde3(0x232)]=a21_0xefde3(0x2c0);[a21_0xefde3(0x26a)]=a21_0xefde3(0x2f1);async[a21_0xefde3(0x2eb)](_0x2f7233){const _0x29229c=a21_0xefde3,{options:_0x3734cd,args:_0x32617d,tdx:_0x28546d}=_0x2f7233,_0x467601=_0x32617d[0x0]||_0x3734cd[_0x29229c(0x2ac)];if(!_0x467601)return showParentSegmentNotSetError(_0x29229c(0x1cc)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x3734cd['verbose']&&(console[_0x29229c(0x2c2)]('Site:\x20'+_0x3734cd[_0x29229c(0x202)]),console[_0x29229c(0x2c2)]('Parent\x20segment:\x20'+_0x467601));const _0x1dd5c0=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x467601+_0x29229c(0x1d6),()=>_0x28546d[_0x29229c(0x2d7)][_0x29229c(0x2da)](_0x467601),{'verbose':_0x3734cd[_0x29229c(0x25c)]}),_0x462b5a=_0x1dd5c0[_0x29229c(0x294)],_0x575def=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x467601+_0x29229c(0x1d6),()=>_0x28546d[_0x29229c(0x2d7)][_0x29229c(0x22c)](_0x462b5a),{'verbose':_0x3734cd[_0x29229c(0x25c)]}),_0x455840=_0x575def['data'];return _0x3734cd['format']==='json'||_0x3734cd[_0x29229c(0x20f)]==='jsonl'?await handleSDKOutput([{'sql':_0x455840}],_0x3734cd):console[_0x29229c(0x21d)](_0x455840),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a21_0xefde3(0x232)]=a21_0xefde3(0x2d3);[a21_0xefde3(0x26a)]=a21_0xefde3(0x2b3);async[a21_0xefde3(0x2eb)](_0x36eea9){const _0x48102e=a21_0xefde3,{options:_0x57bafb,args:_0x545d26,tdx:_0x48c978}=_0x36eea9,_0x219d28=_0x545d26[0x0]||_0x57bafb[_0x48102e(0x2ac)];if(!_0x219d28)return showParentSegmentNotSetError(_0x48102e(0x2ba)+_0x48102e(0x266)),0x1;_0x57bafb[_0x48102e(0x25c)]&&(console['error']('Site:\x20'+_0x57bafb['site']),console['error'](_0x48102e(0x2cb)+_0x219d28));const _0xda8b6d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x219d28+_0x48102e(0x1d6),()=>_0x48c978['segment'][_0x48102e(0x2da)](_0x219d28),{'verbose':_0x57bafb[_0x48102e(0x25c)]}),_0x5293f4=_0xda8b6d[_0x48102e(0x294)],_0x2aa22c=await withSpinner(_0x48102e(0x29e)+_0x219d28+_0x48102e(0x1d6),()=>_0x48c978[_0x48102e(0x2d7)]['getParentSQL'](_0x5293f4),{'verbose':_0x57bafb[_0x48102e(0x25c)]});let _0x32a39c=_0x2aa22c['data'];const _0x1b1016=resolveLimit(_0x57bafb[_0x48102e(0x2d6)],DEFAULT_DISPLAY_LIMIT),_0x2a3bf8=/\bLIMIT\s+\d+/i[_0x48102e(0x201)](_0x32a39c);!_0x2a3bf8&&(_0x32a39c=_0x32a39c[_0x48102e(0x1f9)]()[_0x48102e(0x2b6)](/;+$/,''),_0x32a39c='SELECT\x20*\x20FROM\x20(\x0a'+_0x32a39c+_0x48102e(0x1fc)+_0x1b1016);_0x57bafb[_0x48102e(0x25c)]&&console[_0x48102e(0x2c2)](_0x48102e(0x1fd)+_0x32a39c);const _0x370007=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x292925=>{const _0x17e5c0=_0x48102e,_0xf7b539=await _0x48c978[_0x17e5c0(0x22b)]['execute'](_0x32a39c,{'catalog':'td','schema':_0x17e5c0(0x2ae),'onJobId':_0x2aa24c=>{const _0x4b8adf=_0x17e5c0;_0x292925[_0x4b8adf(0x2e3)](_0x2aa24c);}});return _0xf7b539;},{'verbose':_0x57bafb[_0x48102e(0x25c)]}),_0xfbfdae=_0x370007[_0x48102e(0x294)],_0x4972b4=_0xfbfdae[_0x48102e(0x25a)]?_0x48102e(0x211)+_0xfbfdae[_0x48102e(0x25a)]+']':'';return console[_0x48102e(0x2c2)](_0x48102e(0x278)+_0xfbfdae[_0x48102e(0x253)][_0x48102e(0x2d5)][_0x48102e(0x1dd)]()+'\x20rows\x20'+(_0x48102e(0x209)+formatElapsed(_0xfbfdae[_0x48102e(0x253)]['elapsedTimeMillis'])+_0x4972b4)),await handleQueryOutput(_0xfbfdae,_0x57bafb),0x0;}}
1
+ const a21_0x52fe5b=a21_0x4595;(function(_0x440ed0,_0xd95c2b){const _0x1746bc=a21_0x4595,_0x5aa4a1=_0x440ed0();while(!![]){try{const _0x2b6904=parseInt(_0x1746bc(0x1f7))/0x1+-parseInt(_0x1746bc(0x2c9))/0x2+parseInt(_0x1746bc(0x271))/0x3*(-parseInt(_0x1746bc(0x205))/0x4)+-parseInt(_0x1746bc(0x24f))/0x5+-parseInt(_0x1746bc(0x2cd))/0x6*(-parseInt(_0x1746bc(0x1ea))/0x7)+-parseInt(_0x1746bc(0x1db))/0x8*(parseInt(_0x1746bc(0x2b4))/0x9)+parseInt(_0x1746bc(0x246))/0xa;if(_0x2b6904===_0xd95c2b)break;else _0x5aa4a1['push'](_0x5aa4a1['shift']());}catch(_0x992603){_0x5aa4a1['push'](_0x5aa4a1['shift']());}}}(a21_0x4a9f,0x98f02));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a21_0x47a985 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a21_0x854bff from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a21_0x52fe5b(0x2c0),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x11eece){const _0x52ba8f=a21_0x52fe5b,_0x45bc08=process['platform'],_0x593970=_0x45bc08===_0x52ba8f(0x245)?_0x52ba8f(0x2c6):_0x45bc08===_0x52ba8f(0x2ec)?'start':_0x52ba8f(0x26a);spawn(_0x593970,[_0x11eece],{'detached':!![],'stdio':_0x52ba8f(0x213)})[_0x52ba8f(0x25e)]();}function migrateLegacyDirectory(){const _0x470259=a21_0x52fe5b;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x42f13b=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x42f13b[_0x470259(0x28b)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x1de)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x470259(0x2b0)+PARENT_SEGMENT_DIR+_0x470259(0x28e))),console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x2a1)](_0x470259(0x1ce)+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x1de)](_0x470259(0x284)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x470259(0x27e)](a21_0x854bff[_0x470259(0x1fd)](_0x470259(0x258)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1fb4ee){const _0x435a11=_0x1fb4ee instanceof Error?_0x1fb4ee[_0x470259(0x1e6)]:String(_0x1fb4ee);return console[_0x470259(0x27e)](a21_0x854bff['red'](_0x470259(0x251)+_0x435a11+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a21_0x52fe5b(0x21c)](_0x237d91){const _0x25c9ca=a21_0x52fe5b;return migrateLegacyDirectory(),super[_0x25c9ca(0x21c)](_0x237d91);}}function resolveYamlFile(_0x28329f){const _0x40b8ac=a21_0x52fe5b;if(_0x28329f[_0x40b8ac(0x212)](_0x40b8ac(0x2e4))||_0x28329f['endsWith'](_0x40b8ac(0x25d)))return _0x28329f;return a21_0x47a985[_0x40b8ac(0x23f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x28329f)+_0x40b8ac(0x2e4));}function formatProgressMessage(_0x10cc55){const _0x94aa66=a21_0x52fe5b,_0x52dd5b=_0x10cc55['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x52dd5b){const [,_0xbc5b6d,_0x50ad44,_0x23f94e='']=_0x52dd5b;return a21_0x854bff[_0x94aa66(0x2a1)](_0xbc5b6d+':')+'\x20'+_0x50ad44+a21_0x854bff['dim'](_0x23f94e);}return a21_0x854bff['dim'](_0x10cc55);}function showFileNotFoundError(_0x399219,_0x174621){const _0x25ee3c=a21_0x52fe5b;console['error'](a21_0x854bff[_0x25ee3c(0x2da)](_0x25ee3c(0x22b)+_0x399219+'\x0a')),console['error'](a21_0x854bff['cyan'](_0x25ee3c(0x2c4)+_0x174621+'`\x20to\x20download\x20the\x20configuration\x20first'));}function showParentSegmentNotSetError(_0x565648){const _0x34c811=a21_0x52fe5b;console[_0x34c811(0x27e)](a21_0x854bff[_0x34c811(0x1de)](_0x34c811(0x273))),console['error'](_0x565648);}export class ParentSegmentListCommand extends BaseCommand{[a21_0x52fe5b(0x221)]='segment:parent:list';['description']=a21_0x52fe5b(0x1df);async[a21_0x52fe5b(0x1fa)](_0x52fa99){const _0x317863=a21_0x52fe5b,{options:_0x508930,args:_0x94812d,tdx:_0x1548c5}=_0x52fa99,_0x11e7a4=_0x94812d[0x0];_0x508930[_0x317863(0x297)]&&(console['error'](_0x317863(0x2db)+_0x508930[_0x317863(0x228)]),_0x11e7a4&&console['error'](_0x317863(0x25a)+_0x11e7a4));const _0x42eb95=await withSpinner(_0x11e7a4?_0x317863(0x1d1)+_0x11e7a4+_0x317863(0x1e3):_0x317863(0x203),()=>_0x1548c5[_0x317863(0x201)][_0x317863(0x256)](),{'verbose':_0x508930['verbose']});let _0x462de5=_0x42eb95['data'];if(_0x11e7a4){const _0x580b71=_0x11e7a4[_0x317863(0x2e8)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x317863(0x2e8)](/\*/g,'.*')[_0x317863(0x2e8)](/\?/g,'.'),_0x29c5c0=new RegExp('^'+_0x580b71+'$','i');_0x462de5=_0x462de5['filter'](_0x400c31=>_0x29c5c0[_0x317863(0x234)](_0x400c31[_0x317863(0x2d7)][_0x317863(0x221)]));}_0x462de5[_0x317863(0x208)]((_0x842dfa,_0xfda354)=>_0x842dfa[_0x317863(0x2d7)][_0x317863(0x221)][_0x317863(0x1ec)](_0xfda354[_0x317863(0x2d7)][_0x317863(0x221)])),console[_0x317863(0x27e)](_0x317863(0x242)+_0x462de5['length']+'\x20parent\x20segment'+(_0x462de5[_0x317863(0x240)]!==0x1?'s':''));const _0x4045b3=_0x522aa2=>{const _0x3e5543=_0x317863;return getConsoleNextUrl(_0x508930[_0x3e5543(0x228)],_0x3e5543(0x2d4)+_0x522aa2);};if(_0x508930[_0x317863(0x262)]===_0x317863(0x278)||_0x508930[_0x317863(0x262)]==='jsonl'){const _0x5e16c2=_0x462de5[_0x317863(0x1d4)](_0x5321b2=>({..._0x5321b2,'url':_0x4045b3(_0x5321b2['id'])}));await handleSDKOutput(_0x5e16c2,_0x508930);}else{if(_0x462de5[_0x317863(0x240)]===0x0)_0x11e7a4?console[_0x317863(0x1f3)](_0x317863(0x279)+_0x11e7a4):console[_0x317863(0x1f3)]('No\x20parent\x20segments\x20found');else for(const _0x23166e of _0x462de5){const _0x5ca0a4=_0x23166e[_0x317863(0x2d7)][_0x317863(0x2aa)]?a21_0x854bff[_0x317863(0x2a1)]('\x20('+formatRows(_0x23166e['attributes']['population'])+')'):'',_0xd31cd9=hyperlink(_0x23166e['attributes'][_0x317863(0x221)],_0x4045b3(_0x23166e['id']));console[_0x317863(0x1f3)]('👥\x20'+_0xd31cd9+_0x5ca0a4);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x290);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x229);async[a21_0x52fe5b(0x1fa)](_0x507843){const _0x4e6e9a=a21_0x52fe5b,{options:_0x2dbca1,args:_0x5effe7,tdx:_0x9b918d}=_0x507843;console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x252)+_0x4e6e9a(0x2b6)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x38a62a=_0x2dbca1;if(_0x5effe7[_0x4e6e9a(0x240)]===0x0)return console[_0x4e6e9a(0x27e)](a21_0x854bff['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x2a5)),0x1;const _0x3cb678=_0x5effe7[0x0];if(!_0x38a62a['database']||!_0x38a62a[_0x4e6e9a(0x2a3)])return console['error']('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x2a5)),0x1;_0x38a62a[_0x4e6e9a(0x297)]&&(console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x2db)+_0x38a62a[_0x4e6e9a(0x228)]),console[_0x4e6e9a(0x27e)]('Name:\x20'+_0x3cb678),console[_0x4e6e9a(0x27e)]('Database:\x20'+_0x38a62a['database']),console[_0x4e6e9a(0x27e)](_0x4e6e9a(0x210)+_0x38a62a['table']));const _0x50e9a3=await loadJSONFromOptions(_0x38a62a[_0x4e6e9a(0x2d7)],_0x38a62a['attributesFile']),_0x91606d=await loadJSONFromOptions(_0x38a62a[_0x4e6e9a(0x2df)],_0x38a62a[_0x4e6e9a(0x283)]),_0xbfc9fe=await loadJSONFromOptions(_0x38a62a[_0x4e6e9a(0x1e5)],_0x38a62a[_0x4e6e9a(0x243)]),_0x13636c={'name':_0x3cb678,'description':_0x38a62a['description'],'scheduleType':_0x38a62a[_0x4e6e9a(0x26f)],'scheduleOption':_0x38a62a['scheduleOption'],'timezone':_0x38a62a[_0x4e6e9a(0x2af)],'master':{'parentDatabaseName':_0x38a62a[_0x4e6e9a(0x2cf)],'parentTableName':_0x38a62a['table']},'attributes':_0x50e9a3,'behaviors':_0x91606d,'customerGroup':_0xbfc9fe},_0x334b1c=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x3cb678+_0x4e6e9a(0x1e3),()=>_0x9b918d['segment'][_0x4e6e9a(0x222)](_0x13636c),{'verbose':_0x2dbca1[_0x4e6e9a(0x297)]}),_0x34d3cd=_0x334b1c[_0x4e6e9a(0x29c)];return console[_0x4e6e9a(0x27e)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x34d3cd[_0x4e6e9a(0x221)]+_0x4e6e9a(0x25f)+_0x34d3cd['id']),await handleSDKOutput([_0x34d3cd],_0x2dbca1),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a21_0x52fe5b(0x221)]='segment:parent:update';[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x26c);async[a21_0x52fe5b(0x1fa)](_0x182424){const _0x4516aa=a21_0x52fe5b,{options:_0x45b32c,args:_0x3e7689,tdx:_0x2cbe72}=_0x182424;console[_0x4516aa(0x27e)](_0x4516aa(0x291)+'\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 _0x495dc9=_0x45b32c;if(_0x3e7689[_0x4516aa(0x240)]===0x0)return console[_0x4516aa(0x27e)](a21_0x854bff[_0x4516aa(0x2da)](_0x4516aa(0x2ce))),console[_0x4516aa(0x27e)](_0x4516aa(0x214)),0x1;const _0x3af2fe=_0x3e7689[0x0];_0x495dc9[_0x4516aa(0x297)]&&(console[_0x4516aa(0x27e)](_0x4516aa(0x2db)+_0x495dc9[_0x4516aa(0x228)]),console[_0x4516aa(0x27e)](_0x4516aa(0x200)+_0x3af2fe));const _0x4c9ee2=await withSpinner(_0x4516aa(0x20a)+_0x3af2fe+_0x4516aa(0x1e3),()=>_0x2cbe72[_0x4516aa(0x201)][_0x4516aa(0x1d8)](_0x3af2fe),{'verbose':_0x495dc9[_0x4516aa(0x297)]}),_0x50f4da=_0x4c9ee2[_0x4516aa(0x29c)],_0xd23497=await loadJSONFromOptions(_0x495dc9[_0x4516aa(0x216)],_0x495dc9[_0x4516aa(0x2e3)]),_0x5aa8b2=await loadJSONFromOptions(_0x495dc9[_0x4516aa(0x2bd)],_0x495dc9[_0x4516aa(0x1eb)]),_0x4dc8d9={'name':_0x50f4da['name'],'description':_0x495dc9[_0x4516aa(0x211)]!==undefined?_0x495dc9[_0x4516aa(0x211)]:_0x50f4da[_0x4516aa(0x211)],'scheduleType':_0x495dc9[_0x4516aa(0x26f)]!==undefined?_0x495dc9[_0x4516aa(0x26f)]:_0x50f4da['scheduleType'],'scheduleOption':_0x495dc9['scheduleOption']!==undefined?_0x495dc9[_0x4516aa(0x2e6)]:_0x50f4da['scheduleOption'],'timezone':_0x495dc9[_0x4516aa(0x2af)]!==undefined?_0x495dc9[_0x4516aa(0x2af)]:_0x50f4da[_0x4516aa(0x2af)],'master':_0x50f4da[_0x4516aa(0x1f6)],'attributes':_0xd23497?[..._0x50f4da['attributes']||[],..._0xd23497]:_0x50f4da['attributes'],'behaviors':_0x5aa8b2?[..._0x50f4da[_0x4516aa(0x2df)]||[],..._0x5aa8b2]:_0x50f4da[_0x4516aa(0x2df)],'customerGroup':_0x50f4da['customerGroup']},_0x325d28=await withSpinner(_0x4516aa(0x23c)+_0x3af2fe+_0x4516aa(0x1e3),()=>_0x2cbe72['segment'][_0x4516aa(0x2c8)](_0x3af2fe,_0x4dc8d9),{'verbose':_0x495dc9[_0x4516aa(0x297)]}),_0x33125e=_0x325d28['data'];return console[_0x4516aa(0x27e)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x33125e[_0x4516aa(0x221)]+'\x27'),await handleSDKOutput([_0x33125e],_0x495dc9),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x28c);['description']=a21_0x52fe5b(0x2a8);async[a21_0x52fe5b(0x1fa)](_0x302781){const _0x47d4d3=a21_0x52fe5b,{options:_0x4c2fde,args:_0x411f9e,tdx:_0x5f02dc}=_0x302781,_0x275728=_0x4c2fde,_0x59b9d2=_0x411f9e[0x0]||_0x4c2fde[_0x47d4d3(0x1e1)];if(!_0x59b9d2)return showParentSegmentNotSetError(_0x47d4d3(0x2d9)+_0x47d4d3(0x21d)),0x1;if(_0x275728[_0x47d4d3(0x270)]&&_0x275728['output'])return console['error'](a21_0x854bff[_0x47d4d3(0x2da)](_0x47d4d3(0x2b7))),console[_0x47d4d3(0x27e)](a21_0x854bff[_0x47d4d3(0x2a1)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console['error'](a21_0x854bff['dim'](_0x47d4d3(0x202)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x47d4d3(0x27e)](a21_0x854bff[_0x47d4d3(0x2c1)](_0x47d4d3(0x274))),0x1;const _0x408550=_0x275728['output']||a21_0x47a985['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x59b9d2)+_0x47d4d3(0x2e4));_0x275728['verbose']&&(console[_0x47d4d3(0x27e)]('Site:\x20'+_0x275728['site']),console['error']('Parent\x20segment:\x20'+_0x59b9d2),console[_0x47d4d3(0x27e)](_0x47d4d3(0x299)+_0x408550));const _0x36df2b=await withSpinner(_0x47d4d3(0x20f)+_0x59b9d2+_0x47d4d3(0x1e3),()=>_0x5f02dc[_0x47d4d3(0x201)][_0x47d4d3(0x26e)](_0x59b9d2),{'verbose':_0x275728[_0x47d4d3(0x297)]}),_0x3002ec=_0x36df2b[_0x47d4d3(0x29c)];if(existsSync(_0x408550)){const _0x41a3fa=readFileSync(_0x408550,_0x47d4d3(0x2bc)),_0x50233d=generateDiff(_0x41a3fa,_0x3002ec);if(!hasChanges(_0x50233d))console['error'](a21_0x854bff['green']('✔')+_0x47d4d3(0x1f5)+a21_0x854bff[_0x47d4d3(0x2c1)](_0x408550)+'\x20is\x20already\x20up\x20to\x20date');else{console['error']('\x0aChanges\x20to\x20\x27'+_0x408550+'\x27:'),console['error']('─'[_0x47d4d3(0x288)](0x3c)),console[_0x47d4d3(0x27e)](formatDiffWithColors(_0x50233d)),console['error']('─'[_0x47d4d3(0x288)](0x3c));if(!_0x275728[_0x47d4d3(0x2c3)]){const _0x523954=await confirmKey(_0x47d4d3(0x24d)+_0x408550+'\x27?');if(!_0x523954)return console[_0x47d4d3(0x27e)](_0x47d4d3(0x1f0)),0x1;}writeFileSync(_0x408550,_0x3002ec,_0x47d4d3(0x2bc)),console['error'](a21_0x854bff[_0x47d4d3(0x1fd)]('✔')+_0x47d4d3(0x2d5)+a21_0x854bff['cyan'](_0x408550));}}else{const _0x27e361=a21_0x47a985[_0x47d4d3(0x27b)](_0x408550);!existsSync(_0x27e361)&&mkdirSync(_0x27e361,{'recursive':!![]}),writeFileSync(_0x408550,_0x3002ec,'utf-8'),console[_0x47d4d3(0x27e)](a21_0x854bff[_0x47d4d3(0x1fd)]('✔')+_0x47d4d3(0x2d5)+a21_0x854bff[_0x47d4d3(0x2c1)](_0x408550));}return saveSessionContext({'parent_segment':_0x59b9d2},_0x275728[_0x47d4d3(0x227)]),console[_0x47d4d3(0x27e)](a21_0x854bff['green']('✔')+'\x20Context\x20set:\x20'+a21_0x854bff[_0x47d4d3(0x2a1)](_0x47d4d3(0x255))+_0x47d4d3(0x28f)+a21_0x854bff['cyan'](_0x59b9d2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a21_0x52fe5b(0x1e4);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x1dc);async[a21_0x52fe5b(0x1fa)](_0x7e2f71){const _0xb054ba=a21_0x52fe5b,{options:_0x381e19,args:_0x46eb5d,tdx:_0x4ca6a7}=_0x7e2f71,_0x270731=_0x381e19,_0x517e44=_0x46eb5d[0x0]||_0x381e19['parentSegment'];if(!_0x517e44)return showParentSegmentNotSetError(_0xb054ba(0x29e)+_0xb054ba(0x2ca)),0x1;const _0x271e75=resolveYamlFile(_0x517e44);if(!existsSync(_0x271e75))return showFileNotFoundError(_0x271e75,_0x517e44),0x1;_0x270731['verbose']&&(console[_0xb054ba(0x27e)](_0xb054ba(0x2db)+_0x270731['site']),console[_0xb054ba(0x27e)](_0xb054ba(0x225)+_0x271e75));let _0x31a676;try{_0x31a676=readFileSync(_0x271e75,_0xb054ba(0x2bc));}catch(_0x5897d1){const _0x18c11a=_0x5897d1 instanceof Error?_0x5897d1[_0xb054ba(0x1e6)]:String(_0x5897d1);return console[_0xb054ba(0x27e)]('Error\x20reading\x20file:\x20'+_0x18c11a),0x1;}const _0x266c94=await withSpinner('Analyzing\x20changes...',()=>_0x4ca6a7['segment'][_0xb054ba(0x296)](_0x31a676),{'verbose':_0x270731['verbose']}),_0x163773=_0x266c94['data'],{isNew:_0x3d71a2,name:_0x1128f6,hasChanges:_0x1b3376,diffFormatted:_0x159bc6}=_0x163773;if(!_0x1b3376)return console[_0xb054ba(0x27e)]('✔\x20No\x20changes\x20-\x20\x27'+_0x1128f6+_0xb054ba(0x2bf)),0x0;_0x3d71a2?console['error'](_0xb054ba(0x23b)+_0x1128f6+'\x27:'):console[_0xb054ba(0x27e)](_0xb054ba(0x22a)+_0x1128f6+'\x27:');console[_0xb054ba(0x27e)]('─'['repeat'](0x3c)),console[_0xb054ba(0x27e)](_0x159bc6),console['error']('─'[_0xb054ba(0x288)](0x3c));const _0x2d1dac=_0x3d71a2?_0xb054ba(0x265)+_0x1128f6+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x1128f6+'\x27?';if(!_0x270731['yes']){const _0x3dc207=await confirmKey(_0x2d1dac);if(!_0x3dc207)return console[_0xb054ba(0x27e)](_0xb054ba(0x1f0)),0x1;}const _0x711bfd=_0x3d71a2?_0xb054ba(0x287):_0xb054ba(0x1ff),_0x53bdac=await withSpinner(_0x711bfd+'\x20parent\x20segment\x20\x27'+_0x1128f6+_0xb054ba(0x1e3),()=>_0x163773[_0xb054ba(0x2cb)](),{'verbose':_0x270731[_0xb054ba(0x297)]}),_0x33ca39=_0x53bdac[_0xb054ba(0x29c)],_0x39ecf0=getConsoleNextUrl(_0x270731[_0xb054ba(0x228)],'/app/dw/parentSegments/'+_0x33ca39['id']),_0x1dd449=_0x3d71a2?_0xb054ba(0x2bb):_0xb054ba(0x207);return console[_0xb054ba(0x27e)]('✔\x20'+_0x1dd449+_0xb054ba(0x2c2)+_0x33ca39['name']+'\x27'),console['error']('\x20\x20'+_0x39ecf0),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x223);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x233);async['execute'](_0x4acfd9){const _0x4cb219=a21_0x52fe5b,{options:_0x49790a,args:_0x4064a5,tdx:_0x2634f6}=_0x4acfd9,_0x177560=_0x49790a,_0x495bc7=_0x4064a5[0x0]||_0x49790a[_0x4cb219(0x1e1)];if(!_0x495bc7)return showParentSegmentNotSetError(_0x4cb219(0x220)+_0x4cb219(0x226)+_0x4cb219(0x20c)+_0x4cb219(0x23e)+_0x4cb219(0x21f)+_0x4cb219(0x232)),0x1;const _0x1b0141=resolveYamlFile(_0x495bc7);if(!existsSync(_0x1b0141))return showFileNotFoundError(_0x1b0141,_0x495bc7),0x1;_0x177560['verbose']&&(console[_0x4cb219(0x27e)](_0x4cb219(0x2db)+_0x177560['site']),console[_0x4cb219(0x27e)](_0x4cb219(0x225)+_0x1b0141));let _0x23fb4f;try{_0x23fb4f=readFileSync(_0x1b0141,_0x4cb219(0x2bc));}catch(_0x3914e5){const _0x190bc5=_0x3914e5 instanceof Error?_0x3914e5[_0x4cb219(0x1e6)]:String(_0x3914e5);return console[_0x4cb219(0x27e)](_0x4cb219(0x1f8)+_0x190bc5),0x1;}const _0xf39ffe=createCommandSpinner(a21_0x854bff['dim'](_0x4cb219(0x2a2)),{'verbose':_0x177560['verbose']});_0xf39ffe[_0x4cb219(0x1ee)]();const _0x1b787e={'onProgress':_0x35c151=>{_0xf39ffe['text']=formatProgressMessage(_0x35c151);}};if(_0x177560[_0x4cb219(0x1f6)])_0x1b787e[_0x4cb219(0x1f6)]=!![];if(_0x177560['enriched'])_0x1b787e[_0x4cb219(0x2e9)]=!![];_0x177560[_0x4cb219(0x27d)]&&(_0x1b787e[_0x4cb219(0x27d)]=_0x177560[_0x4cb219(0x27d)]);_0x177560['behavior']&&(_0x1b787e[_0x4cb219(0x29d)]=_0x177560[_0x4cb219(0x29d)]);if(_0x177560[_0x4cb219(0x2dc)])_0x1b787e['interval']=_0x177560[_0x4cb219(0x2dc)];let _0x9bc1ea;try{_0x9bc1ea=await _0x2634f6['segment'][_0x4cb219(0x2b2)](_0x23fb4f,_0x1b787e),_0xf39ffe[_0x4cb219(0x268)]();}catch(_0x493cd0){_0xf39ffe[_0x4cb219(0x268)]();throw _0x493cd0;}const _0x755a73=_0x177560[_0x4cb219(0x2dc)]||'-1d';return this['displayValidateResults'](_0x9bc1ea,_0x1b787e,_0x1b0141,_0x755a73),_0x9bc1ea['allValid']?0x0:0x1;}[a21_0x52fe5b(0x26d)](_0x61d64c,_0x24d223,_0x172ca2,_0x2fde0a){const _0x350574=a21_0x52fe5b;console[_0x350574(0x27e)]('\x0a'+a21_0x854bff[_0x350574(0x26b)](_0x350574(0x2f1))+'\x20'+_0x61d64c[_0x350574(0x221)]),console[_0x350574(0x27e)]('═'[_0x350574(0x288)](0x3c)),this[_0x350574(0x248)](_0x61d64c);if(typeof _0x24d223[_0x350574(0x27d)]===_0x350574(0x24b)){this[_0x350574(0x27c)](_0x61d64c),this[_0x350574(0x266)](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,'attribute',_0x24d223['attribute']);return;}if(_0x24d223[_0x350574(0x27d)]===!![]){this['displayAttributesStats'](_0x61d64c),this['displaySummary'](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,_0x350574(0x2d7));return;}if(typeof _0x24d223[_0x350574(0x29d)]===_0x350574(0x24b)){this['displayBehaviorsStats'](_0x61d64c,_0x2fde0a),this[_0x350574(0x266)](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,_0x350574(0x29d),_0x24d223[_0x350574(0x29d)]);return;}if(_0x24d223['behavior']===!![]){this[_0x350574(0x235)](_0x61d64c,_0x2fde0a),this[_0x350574(0x266)](_0x61d64c),this['displayPreviewHints'](_0x172ca2,_0x2fde0a,'behaviors');return;}this[_0x350574(0x27c)](_0x61d64c),this[_0x350574(0x235)](_0x61d64c,_0x2fde0a),this[_0x350574(0x266)](_0x61d64c),this[_0x350574(0x215)](_0x172ca2,_0x2fde0a,_0x350574(0x276));}['displayPreviewHints'](_0x3b8c54,_0x28b698,_0x1c31b6,_0x186f6f){const _0x28a5cf=a21_0x52fe5b;console[_0x28a5cf(0x27e)]('\x0a'+a21_0x854bff['dim'](_0x28a5cf(0x241)));const _0x58a1ad=_0x28b698!==_0x28a5cf(0x2de)?_0x28a5cf(0x219)+_0x28b698:'';if(_0x1c31b6==='attribute'&&_0x186f6f)console['error']('\x20\x20'+a21_0x854bff['dim'](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x1e0)+_0x186f6f+'\x22'+_0x58a1ad));else{if(_0x1c31b6==='behavior'&&_0x186f6f)console[_0x28a5cf(0x27e)]('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x231)+_0x186f6f+'\x22'+_0x58a1ad));else(_0x1c31b6===_0x28a5cf(0x2d7)||_0x1c31b6===_0x28a5cf(0x276))&&console[_0x28a5cf(0x27e)]('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x1fc)+_0x58a1ad));}(_0x1c31b6===_0x28a5cf(0x2df)||_0x1c31b6==='all')&&console['error']('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)]('tdx\x20segment\x20parent\x20preview\x20'+_0x3b8c54+'\x20--behavior\x20\x22<name>\x22'+_0x58a1ad)),_0x1c31b6===_0x28a5cf(0x276)&&console[_0x28a5cf(0x27e)]('\x20\x20'+a21_0x854bff[_0x28a5cf(0x2a1)](_0x28a5cf(0x2a4)+_0x3b8c54+_0x28a5cf(0x224)+_0x58a1ad));}[a21_0x52fe5b(0x248)](_0x418a90){const _0x125413=a21_0x52fe5b,{master:_0xe04aa5}=_0x418a90,_0x586569=_0xe04aa5['schemaValid']?a21_0x854bff[_0x125413(0x1fd)]('✔'):a21_0x854bff[_0x125413(0x2da)]('✘');console[_0x125413(0x27e)]('\x0a'+a21_0x854bff[_0x125413(0x2a1)](_0x125413(0x21e))),console['error'](_0x586569+'\x20'+a21_0x854bff[_0x125413(0x26b)](_0xe04aa5['database']+'.'+_0xe04aa5[_0x125413(0x2a3)])),_0xe04aa5['schemaValid']?_0xe04aa5[_0x125413(0x2ee)]!==undefined&&console[_0x125413(0x27e)]('\x20\x20'+a21_0x854bff[_0x125413(0x2a1)](_0x125413(0x2ef))+'\x20'+a21_0x854bff[_0x125413(0x2c1)](formatRows(_0xe04aa5[_0x125413(0x2ee)]))):console[_0x125413(0x27e)]('\x20\x20'+a21_0x854bff[_0x125413(0x2da)](_0x125413(0x264))+'\x20'+_0xe04aa5['schemaError']);}[a21_0x52fe5b(0x27c)](_0x11ce9c){const _0x3f3c16=a21_0x52fe5b;if(_0x11ce9c[_0x3f3c16(0x2d7)][_0x3f3c16(0x240)]===0x0)return;console[_0x3f3c16(0x27e)]('\x0a'+a21_0x854bff[_0x3f3c16(0x2a1)](_0x3f3c16(0x2f2)));for(const _0x3eb07c of _0x11ce9c['attributes']){const _0x4de414=_0x3eb07c[_0x3f3c16(0x2b8)]?a21_0x854bff['green']('✔'):a21_0x854bff[_0x3f3c16(0x2da)]('✘');let _0x12d29f='';if(_0x3eb07c[_0x3f3c16(0x2b8)]&&_0x3eb07c[_0x3f3c16(0x1f1)]!==undefined&&_0x3eb07c[_0x3f3c16(0x261)]!==undefined){const _0xe8a6a6=_0x3eb07c[_0x3f3c16(0x261)][_0x3f3c16(0x236)](0x1),_0x3d60cb=_0x3eb07c[_0x3f3c16(0x261)]>=0x50?a21_0x854bff[_0x3f3c16(0x1fd)]:_0x3eb07c['coveragePercent']>=0x32?a21_0x854bff[_0x3f3c16(0x1de)]:a21_0x854bff['red'];_0x12d29f='\x20'+a21_0x854bff[_0x3f3c16(0x2a1)]('Coverage:')+'\x20'+_0x3d60cb(_0xe8a6a6+'%')+'\x20('+formatRows(_0x3eb07c['matchedCount'])+_0x3f3c16(0x25c);}console[_0x3f3c16(0x27e)](_0x4de414+'\x20'+a21_0x854bff[_0x3f3c16(0x26b)](_0x3eb07c[_0x3f3c16(0x221)])+_0x12d29f),console[_0x3f3c16(0x27e)]('\x20\x20'+a21_0x854bff[_0x3f3c16(0x2a1)]('Source:')+'\x20'+a21_0x854bff[_0x3f3c16(0x26b)](_0x3eb07c[_0x3f3c16(0x2cf)]+'.'+_0x3eb07c[_0x3f3c16(0x2a3)]));const _0x5c1f91=_0x3eb07c['joinKey']===_0x3eb07c[_0x3f3c16(0x1d5)]?a21_0x854bff[_0x3f3c16(0x2a1)](_0x3f3c16(0x2a0))+'\x20'+_0x3eb07c[_0x3f3c16(0x2d8)]:a21_0x854bff[_0x3f3c16(0x2a1)]('Join:')+'\x20'+_0x3eb07c[_0x3f3c16(0x2d8)]+_0x3f3c16(0x28f)+_0x3eb07c['foreignKey'];console[_0x3f3c16(0x27e)]('\x20\x20'+_0x5c1f91),console['error']('\x20\x20'+a21_0x854bff['dim'](_0x3f3c16(0x1d3))),this['displayColumns'](_0x3eb07c[_0x3f3c16(0x2b1)]),!_0x3eb07c[_0x3f3c16(0x2b8)]&&console[_0x3f3c16(0x27e)]('\x20\x20'+a21_0x854bff[_0x3f3c16(0x2da)](_0x3f3c16(0x264))+'\x20'+_0x3eb07c['schemaError']);}}[a21_0x52fe5b(0x235)](_0x54d7c3,_0x3918bf){const _0x3ae84b=a21_0x52fe5b;if(_0x54d7c3['behaviors']['length']===0x0)return;console[_0x3ae84b(0x27e)]('\x0a'+a21_0x854bff[_0x3ae84b(0x2a1)]('Behaviors')+'\x20'+a21_0x854bff[_0x3ae84b(0x2a1)]('('+_0x3918bf+')'));for(const _0x49f96e of _0x54d7c3[_0x3ae84b(0x2df)]){const _0x293478=_0x49f96e[_0x3ae84b(0x2b8)]?a21_0x854bff[_0x3ae84b(0x1fd)]('✔'):a21_0x854bff[_0x3ae84b(0x2da)]('✘');let _0x2d05ba='';if(_0x49f96e[_0x3ae84b(0x2b8)]&&_0x49f96e['customersWithEvents']!==undefined&&_0x49f96e[_0x3ae84b(0x2e5)]!==undefined){const _0x17b0bb=_0x49f96e['customerPercent']?.[_0x3ae84b(0x236)](0x1)||'?',_0x264027=(_0x49f96e[_0x3ae84b(0x272)]??0x0)>=0x32?a21_0x854bff[_0x3ae84b(0x1fd)]:(_0x49f96e[_0x3ae84b(0x272)]??0x0)>=0x14?a21_0x854bff[_0x3ae84b(0x1de)]:a21_0x854bff['red'];_0x2d05ba='\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x2e1))+'\x20'+_0x264027(formatRows(_0x49f96e[_0x3ae84b(0x23d)]))+'\x20('+_0x17b0bb+'%)\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x24e))+'\x20'+a21_0x854bff[_0x3ae84b(0x2c1)](formatRows(_0x49f96e[_0x3ae84b(0x2e5)]));}console['error'](_0x293478+'\x20'+a21_0x854bff[_0x3ae84b(0x26b)](_0x49f96e[_0x3ae84b(0x221)])+_0x2d05ba),console[_0x3ae84b(0x27e)]('\x20\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x267))+'\x20'+a21_0x854bff[_0x3ae84b(0x26b)](_0x49f96e[_0x3ae84b(0x2cf)]+'.'+_0x49f96e[_0x3ae84b(0x2a3)]));const _0x21058a=_0x49f96e['joinKey']===_0x49f96e[_0x3ae84b(0x1d5)]?a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x2a0))+'\x20'+_0x49f96e['joinKey']:a21_0x854bff['dim'](_0x3ae84b(0x29f))+'\x20'+_0x49f96e[_0x3ae84b(0x2d8)]+_0x3ae84b(0x28f)+_0x49f96e[_0x3ae84b(0x1d5)];console['error']('\x20\x20'+_0x21058a),console[_0x3ae84b(0x27e)]('\x20\x20'+a21_0x854bff[_0x3ae84b(0x2a1)](_0x3ae84b(0x1d3))),this[_0x3ae84b(0x239)](_0x49f96e[_0x3ae84b(0x2b1)]),!_0x49f96e[_0x3ae84b(0x2b8)]&&console[_0x3ae84b(0x27e)]('\x20\x20'+a21_0x854bff[_0x3ae84b(0x2da)]('Error:')+'\x20'+_0x49f96e['schemaError']);}}['displayColumns'](_0x3d0a6e){const _0x26ae2a=a21_0x52fe5b;for(const _0x3a3df4 of _0x3d0a6e){_0x3a3df4[_0x26ae2a(0x2be)]===_0x3a3df4[_0x26ae2a(0x1d6)]||_0x3a3df4['column']==='*'?console[_0x26ae2a(0x27e)](_0x26ae2a(0x230)+_0x3a3df4[_0x26ae2a(0x2be)]):console['error'](_0x26ae2a(0x230)+_0x3a3df4[_0x26ae2a(0x2be)]+'\x20'+a21_0x854bff[_0x26ae2a(0x2a1)]('('+_0x3a3df4[_0x26ae2a(0x1d6)]+')'));}}[a21_0x52fe5b(0x266)](_0x3706e2){const _0x3b0ffb=a21_0x52fe5b;console['error']('─'[_0x3b0ffb(0x288)](0x3c));if(_0x3706e2[_0x3b0ffb(0x24a)][_0x3b0ffb(0x240)]>0x0){console[_0x3b0ffb(0x27e)]('\x0a'+a21_0x854bff[_0x3b0ffb(0x2da)](_0x3b0ffb(0x2c5)));for(const _0x3b8db5 of _0x3706e2[_0x3b0ffb(0x24a)]){console['error']('\x20\x20'+a21_0x854bff[_0x3b0ffb(0x2da)]('•')+'\x20'+_0x3b8db5);}}_0x3706e2[_0x3b0ffb(0x238)]&&console[_0x3b0ffb(0x27e)]('\x0a'+a21_0x854bff[_0x3b0ffb(0x1fd)]('✔')+_0x3b0ffb(0x217));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x275);[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x1d0);async['execute'](_0x3fc93c){const _0x438f62=a21_0x52fe5b,{options:_0x1aab97,args:_0x2bf2c4,tdx:_0x1abaae}=_0x3fc93c,_0x5d01bc=_0x1aab97,_0x2ae92c=_0x2bf2c4[0x0]||_0x1aab97[_0x438f62(0x1e1)];if(!_0x2ae92c)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x438f62(0x1fb)+_0x438f62(0x28d)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x438f62(0x20b)+_0x438f62(0x1f4)+_0x438f62(0x232)),0x1;if(!_0x5d01bc[_0x438f62(0x1f6)]&&!_0x5d01bc[_0x438f62(0x27d)]&&!_0x5d01bc['behavior']&&!_0x5d01bc[_0x438f62(0x2e9)])return console[_0x438f62(0x27e)](a21_0x854bff[_0x438f62(0x2da)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x438f62(0x27e)](_0x438f62(0x247)),console[_0x438f62(0x27e)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x438f62(0x27e)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x438f62(0x27e)](_0x438f62(0x263)),console['error'](_0x438f62(0x2a7)),0x1;const _0x35288d=resolveYamlFile(_0x2ae92c);if(!existsSync(_0x35288d))return showFileNotFoundError(_0x35288d,_0x2ae92c),0x1;_0x5d01bc[_0x438f62(0x297)]&&(console[_0x438f62(0x27e)]('Site:\x20'+_0x5d01bc['site']),console['error'](_0x438f62(0x225)+_0x35288d));let _0x359ec2;try{_0x359ec2=readFileSync(_0x35288d,_0x438f62(0x2bc));}catch(_0x2512ad){const _0x26a55e=_0x2512ad instanceof Error?_0x2512ad['message']:String(_0x2512ad);return console[_0x438f62(0x27e)](_0x438f62(0x1f8)+_0x26a55e),0x1;}let _0x1f55e2;try{_0x1f55e2=parseDef(_0x359ec2);}catch(_0x3524cc){const _0xd3f164=_0x3524cc instanceof Error?_0x3524cc[_0x438f62(0x1e6)]:String(_0x3524cc);return console[_0x438f62(0x27e)](a21_0x854bff['red'](_0x438f62(0x2d1)+_0xd3f164)),0x1;}if(_0x5d01bc[_0x438f62(0x27d)]===!![]||_0x5d01bc[_0x438f62(0x27d)]===''){const _0x3aaa29=_0x1f55e2[_0x438f62(0x2d7)]?.['map'](_0x3e77bb=>_0x3e77bb['name'])||[];if(_0x3aaa29[_0x438f62(0x240)]===0x0)console[_0x438f62(0x27e)](a21_0x854bff[_0x438f62(0x2da)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x438f62(0x27e)](a21_0x854bff['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x438f62(0x27e)](_0x438f62(0x2ea));for(const _0x8297ad of _0x3aaa29){console[_0x438f62(0x27e)]('\x20\x20'+a21_0x854bff[_0x438f62(0x2c1)](_0x8297ad));}console[_0x438f62(0x27e)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x2ae92c+_0x438f62(0x1e0)+_0x3aaa29[0x0]+'\x22');}return 0x1;}if(_0x5d01bc[_0x438f62(0x29d)]===!![]||_0x5d01bc[_0x438f62(0x29d)]===''){const _0x10a9ee=_0x1f55e2[_0x438f62(0x2df)]?.['map'](_0x4c9ebf=>_0x4c9ebf['name'])||[];if(_0x10a9ee[_0x438f62(0x240)]===0x0)console['error'](a21_0x854bff[_0x438f62(0x2da)](_0x438f62(0x282)));else{console[_0x438f62(0x27e)](a21_0x854bff[_0x438f62(0x2da)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error'](_0x438f62(0x298));for(const _0x32d82c of _0x10a9ee){console[_0x438f62(0x27e)]('\x20\x20'+a21_0x854bff[_0x438f62(0x2c1)](_0x32d82c));}console[_0x438f62(0x27e)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x2ae92c+_0x438f62(0x231)+_0x10a9ee[0x0]+'\x22');}return 0x1;}const _0x254857=createCommandSpinner(a21_0x854bff[_0x438f62(0x2a1)](_0x438f62(0x204)),{'verbose':_0x5d01bc[_0x438f62(0x297)]});_0x254857[_0x438f62(0x1ee)]();const _0x33cf31={'onProgress':_0x13fec1=>{const _0x13e790=_0x438f62;_0x254857[_0x13e790(0x24c)]=formatProgressMessage(_0x13fec1);}};if(_0x5d01bc[_0x438f62(0x1f6)])_0x33cf31['master']=!![];if(_0x5d01bc[_0x438f62(0x27d)]&&typeof _0x5d01bc[_0x438f62(0x27d)]==='string')_0x33cf31[_0x438f62(0x27d)]=_0x5d01bc[_0x438f62(0x27d)];if(_0x5d01bc['behavior']&&typeof _0x5d01bc[_0x438f62(0x29d)]===_0x438f62(0x24b))_0x33cf31[_0x438f62(0x29d)]=_0x5d01bc['behavior'];if(_0x5d01bc['enriched'])_0x33cf31[_0x438f62(0x2e9)]=!![];if(_0x5d01bc['interval'])_0x33cf31['interval']=_0x5d01bc[_0x438f62(0x2dc)];let _0x839d97;try{_0x839d97=await _0x1abaae[_0x438f62(0x201)][_0x438f62(0x294)](_0x359ec2,_0x33cf31),_0x254857[_0x438f62(0x268)]();}catch(_0x43bedf){_0x254857['stop']();throw _0x43bedf;}return await this[_0x438f62(0x2dd)](_0x839d97,{'master':_0x5d01bc[_0x438f62(0x1f6)],'attribute':typeof _0x5d01bc['attribute']==='string'?_0x5d01bc[_0x438f62(0x27d)]:undefined,'behavior':typeof _0x5d01bc['behavior']===_0x438f62(0x24b)?_0x5d01bc['behavior']:undefined,'enriched':_0x5d01bc[_0x438f62(0x2e9)]}),_0x839d97['allValid']?0x0:0x1;}async['displayPreviewResults'](_0x2c18ce,_0x3c4be9){const _0x565165=a21_0x52fe5b;console[_0x565165(0x27e)]('\x0a'+a21_0x854bff[_0x565165(0x26b)](_0x565165(0x281))+'\x20'+_0x2c18ce[_0x565165(0x221)]),console['error']('═'['repeat'](0x3c));if(_0x3c4be9[_0x565165(0x1f6)]&&_0x2c18ce[_0x565165(0x2ac)]){const _0x1f3063=a21_0x854bff[_0x565165(0x2a1)](_0x565165(0x2d3))+'\x20'+a21_0x854bff[_0x565165(0x26b)](_0x2c18ce[_0x565165(0x1f6)][_0x565165(0x2cf)]+'.'+_0x2c18ce[_0x565165(0x1f6)]['table']);await this[_0x565165(0x2ed)](_0x1f3063,_0x2c18ce[_0x565165(0x2ac)]);}else{if(_0x3c4be9[_0x565165(0x27d)]&&_0x2c18ce[_0x565165(0x2ac)]){const _0x3cc4a1=a21_0x854bff['dim'](_0x565165(0x20e))+'\x20'+a21_0x854bff[_0x565165(0x26b)](_0x3c4be9[_0x565165(0x27d)]);await this[_0x565165(0x2ed)](_0x3cc4a1,_0x2c18ce[_0x565165(0x2ac)]);}else{if(_0x3c4be9[_0x565165(0x29d)]&&_0x2c18ce[_0x565165(0x2ac)]){const _0x3e0e33=a21_0x854bff[_0x565165(0x2a1)]('Behavior:')+'\x20'+a21_0x854bff['bold'](_0x3c4be9[_0x565165(0x29d)]);await this[_0x565165(0x2ed)](_0x3e0e33,_0x2c18ce[_0x565165(0x2ac)]);}else{if(_0x3c4be9[_0x565165(0x2e9)]&&_0x2c18ce['sampleData']){const _0x442237=a21_0x854bff[_0x565165(0x2a1)]('Enriched:')+'\x20'+a21_0x854bff[_0x565165(0x26b)]('Master\x20+\x20Attributes');await this['displaySampleData'](_0x442237,_0x2c18ce[_0x565165(0x2ac)]);}else!_0x2c18ce[_0x565165(0x2ac)]&&console[_0x565165(0x27e)](_0x565165(0x1e2));}}}if(_0x2c18ce[_0x565165(0x24a)][_0x565165(0x240)]>0x0){console[_0x565165(0x27e)]('─'[_0x565165(0x288)](0x3c)),console[_0x565165(0x27e)]('\x0a'+a21_0x854bff[_0x565165(0x2da)]('Errors:'));for(const _0x358195 of _0x2c18ce['errors']){console[_0x565165(0x27e)]('\x20\x20'+a21_0x854bff['red']('•')+'\x20'+_0x358195);}}}async[a21_0x52fe5b(0x2ed)](_0x47b755,_0x444432){const _0x49a291=a21_0x52fe5b;if(_0x444432[_0x49a291(0x240)]===0x0){console[_0x49a291(0x27e)]('\x0a'+_0x47b755),console[_0x49a291(0x27e)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x49a291(0x27e)]('\x0a'+_0x47b755);const _0x1db3ac=Object['keys'](_0x444432[0x0])[_0x49a291(0x1d4)](_0x4c9c02=>({'name':_0x4c9c02,'type':typeof _0x444432[0x0][_0x4c9c02]==='number'?_0x49a291(0x2d2):_0x49a291(0x218)})),_0x2f4cce={'queryId':_0x49a291(0x2d6),'columns':_0x1db3ac,'data':_0x444432,'stats':{'state':_0x49a291(0x2ae),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x444432[_0x49a291(0x240)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x14fe99=formatAsTable(_0x2f4cce,_0x444432[_0x49a291(0x240)],!![]);await writeOutput(_0x14fe99,undefined,_0x49a291(0x2a3));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x250);[a21_0x52fe5b(0x211)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async['execute'](_0x254c21){const _0xe0c25=a21_0x52fe5b,{options:_0x3602c3,args:_0x1c5024,tdx:_0x149a63}=_0x254c21,_0xdad49a=_0x3602c3,_0x5d2c83=_0x1c5024[0x0]||_0x3602c3[_0xe0c25(0x1e1)];if(!_0x5d2c83)return showParentSegmentNotSetError(_0xe0c25(0x2a9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x227b6b=resolveYamlFile(_0x5d2c83);if(existsSync(_0x227b6b)){_0xdad49a[_0xe0c25(0x297)]&&console['error'](_0xe0c25(0x289)+_0x227b6b);let _0x3172c1;try{_0x3172c1=readFileSync(_0x227b6b,'utf-8');}catch(_0x1c755f){const _0xec8547=_0x1c755f instanceof Error?_0x1c755f[_0xe0c25(0x1e6)]:String(_0x1c755f);return console[_0xe0c25(0x27e)]('Error\x20reading\x20file:\x20'+_0xec8547),0x1;}const _0x109e83=await withSpinner('Analyzing\x20changes...',()=>_0x149a63[_0xe0c25(0x201)][_0xe0c25(0x296)](_0x3172c1),{'verbose':_0xdad49a['verbose']}),_0x5c0eed=_0x109e83['data'],{isNew:_0x4dfb07,name:_0x28cc49,hasChanges:_0x2e726c,diffFormatted:_0x34f0dc}=_0x5c0eed;if(_0x2e726c){_0x4dfb07?console[_0xe0c25(0x27e)](_0xe0c25(0x23b)+_0x28cc49+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x28cc49+'\x27:');console['error']('─'[_0xe0c25(0x288)](0x3c)),console[_0xe0c25(0x27e)](_0x34f0dc),console[_0xe0c25(0x27e)]('─'[_0xe0c25(0x288)](0x3c));const _0x40b7db=_0x4dfb07?_0xe0c25(0x265)+_0x28cc49+'\x27\x20and\x20run\x20workflow?':_0xe0c25(0x1e7)+_0x28cc49+_0xe0c25(0x2b3);if(!_0xdad49a[_0xe0c25(0x2c3)]){const _0x1c8697=await confirmKey(_0x40b7db);if(!_0x1c8697)return console[_0xe0c25(0x27e)]('Aborted.'),0x1;}const _0x10f4d9=_0x4dfb07?'Creating':_0xe0c25(0x1ff);await withSpinner(_0x10f4d9+_0xe0c25(0x2c2)+_0x28cc49+_0xe0c25(0x1e3),()=>_0x5c0eed[_0xe0c25(0x2cb)](),{'verbose':_0xdad49a['verbose']});const _0x4c540d=_0x4dfb07?_0xe0c25(0x2bb):_0xe0c25(0x207);console[_0xe0c25(0x27e)]('✔\x20'+_0x4c540d+_0xe0c25(0x2c2)+_0x28cc49+'\x27');}else console[_0xe0c25(0x27e)](_0xe0c25(0x27a)+_0x28cc49+'\x27\x20is\x20up\x20to\x20date');}const _0x141dad=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x5d2c83+_0xe0c25(0x1e3),()=>_0x149a63[_0xe0c25(0x201)][_0xe0c25(0x2ab)](_0x5d2c83),{'verbose':_0xdad49a[_0xe0c25(0x297)]}),_0x55fb20=_0x141dad[_0xe0c25(0x29c)],_0x392049=getConsoleUrl(_0xdad49a[_0xe0c25(0x228)],_0xe0c25(0x293)+_0x55fb20[_0xe0c25(0x1f9)]+_0xe0c25(0x237)+_0x55fb20[_0xe0c25(0x254)]+_0xe0c25(0x257)+_0x55fb20[_0xe0c25(0x277)]);return console[_0xe0c25(0x27e)](_0xe0c25(0x269)),console[_0xe0c25(0x27e)]('\x20\x20'+a21_0x854bff[_0xe0c25(0x2a1)](_0xe0c25(0x2c7))+'\x20'+_0x55fb20[_0xe0c25(0x2a6)]),console['error']('\x20\x20'+a21_0x854bff['dim'](_0xe0c25(0x1e9))+'\x20'+_0x55fb20[_0xe0c25(0x1d9)]),console[_0xe0c25(0x27e)]('\x20\x20'+a21_0x854bff['dim'](_0xe0c25(0x209))+'\x20'+_0x55fb20[_0xe0c25(0x254)]),console[_0xe0c25(0x27e)]('\x20\x20'+a21_0x854bff['dim'](_0xe0c25(0x21b))+'\x20'+_0x55fb20[_0xe0c25(0x277)]),console[_0xe0c25(0x27e)]('\x20\x20'+_0x392049),console[_0xe0c25(0x27e)]('\x0a'+a21_0x854bff['dim'](_0xe0c25(0x29b))+_0xe0c25(0x23a)+_0x55fb20[_0xe0c25(0x277)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x286);['description']='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x1d4b9f){const _0x4f54d7=a21_0x52fe5b,{options:_0x4661a6,args:_0x3d32f9,tdx:_0x5c0746}=_0x1d4b9f,_0x25fe2f=_0x3d32f9[0x0]||_0x4661a6[_0x4f54d7(0x1e1)];if(!_0x25fe2f)return showParentSegmentNotSetError(_0x4f54d7(0x2e7)+_0x4f54d7(0x244)),0x1;_0x4661a6[_0x4f54d7(0x297)]&&(console['error'](_0x4f54d7(0x2db)+_0x4661a6[_0x4f54d7(0x228)]),console[_0x4f54d7(0x27e)](_0x4f54d7(0x200)+_0x25fe2f));const _0x173a4a=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x25fe2f+_0x4f54d7(0x1e3),()=>_0x5c0746[_0x4f54d7(0x201)][_0x4f54d7(0x2b9)](_0x25fe2f),{'verbose':_0x4661a6['verbose']}),_0x5ee6de=_0x173a4a[_0x4f54d7(0x29c)];console[_0x4f54d7(0x27e)](_0x4f54d7(0x242)+_0x5ee6de['length']+_0x4f54d7(0x1da)+(_0x5ee6de[_0x4f54d7(0x240)]!==0x1?'s':''));if(_0x4661a6[_0x4f54d7(0x278)]||_0x4661a6['jsonl'])return await handleSDKOutput(_0x5ee6de,_0x4661a6),0x0;return displayFieldsHumanReadable(_0x5ee6de,_0x25fe2f),0x0;}}function a21_0x4a9f(){const _0x1573d3=['Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','behaviorsFile','\x0a⚠️\x20\x20Migrating:\x20','Fetching\x20SQL\x20for\x20\x27','segment:parent:fields','Creating','repeat','Found\x20YAML\x20file:\x20','elapsedTimeMillis','isDirectory','segment:parent:pull','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','/\x20directories\x20exist.','\x20=\x20','segment:parent:create','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','getParentSQL','/app/workflows/','previewParentYaml','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','pushParentYaml','verbose','Available\x20behaviors:','Output\x20file:\x20','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','To\x20cancel:','data','behavior','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Join:','Join\x20on:','dim','Validating\x20configuration...','table','tdx\x20segment\x20parent\x20preview\x20','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','audienceId','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','population','runParent','sampleData','trim','FINISHED','timezone','/\x20and\x20','columns','validateParentYaml','\x27\x20and\x20run\x20workflow?','1137186haeXFa','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','schemaValid','listFields','processedRows','Created','utf-8','addBehaviors','label','\x27\x20is\x20already\x20up\x20to\x20date','parent_segments','cyan','\x20parent\x20segment\x20\x27','yes','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Errors:','open','Audience\x20ID:','updateParent','1082912qDUOic','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','apply','jobId','451662ePvYnc','Error:\x20Parent\x20segment\x20name\x20is\x20required','database','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Error\x20parsing\x20YAML:\x20','double','Master:','/app/dw/parentSegments/','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','preview','attributes','joinKey','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','red','Site:\x20','interval','displayPreviewResults','-1d','behaviors','stats','Customers:','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','addAttributesFile','.yml','totalEvents','scheduleOption','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','replace','enriched','Available\x20attributes:','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','win32','displaySampleData','rowCount','Rows:','Executing\x20parent\x20segment\x20query...','Validate:','Attributes','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x20[Job\x20ID:\x20','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Listing\x20parent\x20segments\x20matching\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','Columns:','map','foreignKey','column','\x20rows\x20','getParentFull','status','\x20field','64uIHdvc','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','query','yellow','List\x20parent\x20segments','\x20--attribute\x20\x22','parentSegment','\x0aNo\x20sample\x20data\x20available','\x27...','segment:parent:push','customerGroup','message','Apply\x20changes\x20to\x20\x27','web','Status:','35FljAMi','addBehaviorsFile','localeCompare','segment:parent:view','start','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','Aborted.','matchedCount','setJobId','log','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20No\x20changes\x20-\x20','master','237429DosxPd','Error\x20reading\x20file:\x20','workflowId','execute','Options\x20(one\x20required):\x0a','\x20--attribute\x20\x22<name>\x22','green','resolveParentId','Updating','Parent\x20segment:\x20','segment','using\x20the\x20default\x20path:\x20','Listing\x20parent\x20segments...','Fetching\x20sample\x20data...','1414028owUFui','Show\x20parent\x20segment\x20details','Updated','sort','Session:','Fetching\x20current\x20configuration\x20for\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Options:\x0a','in\x20','Attribute:','Fetching\x20parent\x20segment\x20\x27','Table:\x20','description','endsWith','ignore','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','displayPreviewHints','addAttributes','\x20Configuration\x20is\x20valid','varchar','\x20--interval\x20','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Attempt:','run','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Master\x20Table','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','name','createParent','segment:parent:validate','\x20--enriched','YAML\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','session','site','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x0aChanges\x20to\x20apply\x20to\x20\x27','Error:\x20File\x20not\x20found:\x20','\x20Opening\x20','limit','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20-\x20','\x20--behavior\x20\x22','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','test','displayBehaviorsStats','toFixed','/sessions/','allValid','displayColumns','\x20tdx\x20wf\x20attempt\x20','\x0aNew\x20parent\x20segment\x20\x27','Updating\x20parent\x20segment\x20\x27','customersWithEvents','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','join','length','To\x20view\x20sample\x20data:','✔\x20Found\x20','customerGroupFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','darwin','33291470DFYOMO','Options:','displayMasterInfo','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','errors','string','text','Overwrite\x20\x27','Events:','3518590ECMzyY','segment:parent:run','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','✔\x20Query\x20completed:\x20Processed\x20','workflowSessionId','parent_segment','listParents','/attempt/','✔\x20Renamed\x20directory\x20to\x20','toLocaleString','Pattern:\x20','segment:parent:desc','\x20rows)','.yaml','unref','\x27\x20with\x20ID:\x20','SQL\x20query:\x0a','coveragePercent','format','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Error:','Create\x20parent\x20segment\x20\x27','displaySummary','Source:','stop','\x0a✔\x20Workflow\x20started','xdg-open','bold','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','displayValidateResults','pullParentYaml','scheduleType','use','9adhBZv','customerPercent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','segment:parent:preview','all','workflowAttemptId','json','No\x20parent\x20segments\x20match\x20pattern:\x20','✔\x20No\x20changes\x20-\x20\x27','dirname','displayAttributesStats','attribute','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','segment:parent:sql','Preview:'];a21_0x4a9f=function(){return _0x1573d3;};return a21_0x4a9f();}export class ParentSegmentViewCommand extends BaseCommand{[a21_0x52fe5b(0x221)]=a21_0x52fe5b(0x1ed);['description']=a21_0x52fe5b(0x206);async[a21_0x52fe5b(0x1fa)](_0x14bf7d){const _0x15b7ed=a21_0x52fe5b,{options:_0x41d102,args:_0x45d6db,tdx:_0x22ca33}=_0x14bf7d,_0x4c896d=_0x41d102,_0x58ab79=_0x45d6db[0x0]||_0x41d102[_0x15b7ed(0x1e1)];if(!_0x58ab79)return showParentSegmentNotSetError(_0x15b7ed(0x2eb)+_0x15b7ed(0x249)+_0x15b7ed(0x20c)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x41d102[_0x15b7ed(0x297)]&&(console[_0x15b7ed(0x27e)]('Site:\x20'+_0x41d102[_0x15b7ed(0x228)]),console[_0x15b7ed(0x27e)]('Parent\x20segment:\x20'+_0x58ab79));const _0x1fcfc9=await withSpinner(_0x15b7ed(0x20f)+_0x58ab79+_0x15b7ed(0x1e3),()=>_0x22ca33[_0x15b7ed(0x201)]['getParentFull'](_0x58ab79),{'verbose':_0x41d102['verbose']}),_0x11d384=_0x1fcfc9[_0x15b7ed(0x29c)];if(_0x4c896d[_0x15b7ed(0x1e8)]){const _0x350441=getConsoleNextUrl(_0x4c896d[_0x15b7ed(0x228)],_0x15b7ed(0x2d4)+_0x11d384['id']);return console['error'](a21_0x854bff['green']('✔')+_0x15b7ed(0x22c)+a21_0x854bff[_0x15b7ed(0x2c1)](_0x350441)),openBrowser(_0x350441),0x0;}return await handleSingleObjectOutput(_0x11d384,_0x41d102),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a21_0x52fe5b(0x25b);['description']=a21_0x52fe5b(0x21a);async[a21_0x52fe5b(0x1fa)](_0x4d3944){const _0x110268=a21_0x52fe5b,{options:_0x3127fd,args:_0x54c277,tdx:_0x5b73f2}=_0x4d3944,_0x2d718b=_0x54c277[0x0]||_0x3127fd[_0x110268(0x1e1)];if(!_0x2d718b)return showParentSegmentNotSetError(_0x110268(0x1ef)+_0x110268(0x27f)),0x1;_0x3127fd[_0x110268(0x297)]&&(console['error'](_0x110268(0x2db)+_0x3127fd[_0x110268(0x228)]),console['error']('Parent\x20segment:\x20'+_0x2d718b));const _0x1274cf=await withSpinner(_0x110268(0x22e)+_0x2d718b+_0x110268(0x1e3),()=>_0x5b73f2[_0x110268(0x201)]['resolveParentId'](_0x2d718b),{'verbose':_0x3127fd[_0x110268(0x297)]}),_0x4e2d32=_0x1274cf[_0x110268(0x29c)],_0x59e8b9=await withSpinner(_0x110268(0x285)+_0x2d718b+_0x110268(0x1e3),()=>_0x5b73f2[_0x110268(0x201)]['getParentSQL'](_0x4e2d32),{'verbose':_0x3127fd[_0x110268(0x297)]}),_0x38e1af=await executeSchemaQuery(_0x59e8b9[_0x110268(0x29c)],_0x5b73f2,_0x3127fd);return await handleQueryOutput(_0x38e1af,_0x3127fd),0x0;}}function a21_0x4595(_0x542d35,_0x4f943f){_0x542d35=_0x542d35-0x1ce;const _0x4a9fbc=a21_0x4a9f();let _0x4595d8=_0x4a9fbc[_0x542d35];return _0x4595d8;}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a21_0x52fe5b(0x280);['description']=a21_0x52fe5b(0x1d2);async['execute'](_0x5de5d1){const _0x3b695d=a21_0x52fe5b,{options:_0x268771,args:_0x56d412,tdx:_0x4fa419}=_0x5de5d1,_0x3cb36e=_0x56d412[0x0]||_0x268771[_0x3b695d(0x1e1)];if(!_0x3cb36e)return showParentSegmentNotSetError(_0x3b695d(0x2b5)+_0x3b695d(0x22f)),0x1;_0x268771[_0x3b695d(0x297)]&&(console[_0x3b695d(0x27e)](_0x3b695d(0x2db)+_0x268771[_0x3b695d(0x228)]),console[_0x3b695d(0x27e)](_0x3b695d(0x200)+_0x3cb36e));const _0x25f0ee=await withSpinner(_0x3b695d(0x22e)+_0x3cb36e+_0x3b695d(0x1e3),()=>_0x4fa419['segment']['resolveParentId'](_0x3cb36e),{'verbose':_0x268771[_0x3b695d(0x297)]}),_0x429c50=_0x25f0ee[_0x3b695d(0x29c)],_0x5c615f=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x3cb36e+'\x27...',()=>_0x4fa419[_0x3b695d(0x201)]['getParentSQL'](_0x429c50),{'verbose':_0x268771['verbose']}),_0x4260f6=_0x5c615f[_0x3b695d(0x29c)];return _0x268771['format']===_0x3b695d(0x278)||_0x268771[_0x3b695d(0x262)]==='jsonl'?await handleSDKOutput([{'sql':_0x4260f6}],_0x268771):console[_0x3b695d(0x1f3)](_0x4260f6),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a21_0x52fe5b(0x221)]='segment:parent:show';[a21_0x52fe5b(0x211)]=a21_0x52fe5b(0x29a);async[a21_0x52fe5b(0x1fa)](_0x52d57d){const _0x428f0a=a21_0x52fe5b,{options:_0x3cb695,args:_0xf295e8,tdx:_0x5ede1c}=_0x52d57d,_0x1580d7=_0xf295e8[0x0]||_0x3cb695[_0x428f0a(0x1e1)];if(!_0x1580d7)return showParentSegmentNotSetError(_0x428f0a(0x2e2)+_0x428f0a(0x2d0)),0x1;_0x3cb695[_0x428f0a(0x297)]&&(console[_0x428f0a(0x27e)](_0x428f0a(0x2db)+_0x3cb695[_0x428f0a(0x228)]),console[_0x428f0a(0x27e)](_0x428f0a(0x200)+_0x1580d7));const _0x382c79=await withSpinner(_0x428f0a(0x22e)+_0x1580d7+'\x27...',()=>_0x5ede1c[_0x428f0a(0x201)][_0x428f0a(0x1fe)](_0x1580d7),{'verbose':_0x3cb695[_0x428f0a(0x297)]}),_0xe84d94=_0x382c79['data'],_0xbf5bff=await withSpinner(_0x428f0a(0x285)+_0x1580d7+_0x428f0a(0x1e3),()=>_0x5ede1c[_0x428f0a(0x201)][_0x428f0a(0x292)](_0xe84d94),{'verbose':_0x3cb695[_0x428f0a(0x297)]});let _0x3308a4=_0xbf5bff[_0x428f0a(0x29c)];const _0x248dcf=resolveLimit(_0x3cb695[_0x428f0a(0x22d)],DEFAULT_DISPLAY_LIMIT),_0x598692=/\bLIMIT\s+\d+/i[_0x428f0a(0x234)](_0x3308a4);!_0x598692&&(_0x3308a4=_0x3308a4[_0x428f0a(0x2ad)]()[_0x428f0a(0x2e8)](/;+$/,''),_0x3308a4='SELECT\x20*\x20FROM\x20(\x0a'+_0x3308a4+_0x428f0a(0x295)+_0x248dcf);_0x3cb695[_0x428f0a(0x297)]&&console[_0x428f0a(0x27e)](_0x428f0a(0x260)+_0x3308a4);const _0x2c02ec=await withProgressSpinner(_0x428f0a(0x2f0),async _0x1ce52e=>{const _0x1b4bcd=_0x428f0a,_0x4aa28a=await _0x5ede1c[_0x1b4bcd(0x1dd)][_0x1b4bcd(0x1fa)](_0x3308a4,{'catalog':'td','schema':'information_schema','onJobId':_0x8cc8ec=>{const _0x2ae3b1=_0x1b4bcd;_0x1ce52e[_0x2ae3b1(0x1f2)](_0x8cc8ec);}});return _0x4aa28a;},{'verbose':_0x3cb695['verbose']}),_0x433dc0=_0x2c02ec[_0x428f0a(0x29c)],_0x5c81d8=_0x433dc0[_0x428f0a(0x2cc)]?_0x428f0a(0x1cf)+_0x433dc0['jobId']+']':'';return console[_0x428f0a(0x27e)](_0x428f0a(0x253)+_0x433dc0['stats'][_0x428f0a(0x2ba)][_0x428f0a(0x259)]()+_0x428f0a(0x1d7)+(_0x428f0a(0x20d)+formatElapsed(_0x433dc0[_0x428f0a(0x2e0)][_0x428f0a(0x28a)])+_0x5c81d8)),await handleQueryOutput(_0x433dc0,_0x3cb695),0x0;}}
@@ -1 +1 @@
1
- const a22_0xed848a=a22_0x1d99;(function(_0x107ea8,_0x3de6ea){const _0x3b1998=a22_0x1d99,_0x3f0c50=_0x107ea8();while(!![]){try{const _0x170713=parseInt(_0x3b1998(0xcb))/0x1+-parseInt(_0x3b1998(0xf3))/0x2*(-parseInt(_0x3b1998(0xcc))/0x3)+-parseInt(_0x3b1998(0xdb))/0x4+-parseInt(_0x3b1998(0x8c))/0x5*(parseInt(_0x3b1998(0xce))/0x6)+parseInt(_0x3b1998(0x85))/0x7*(parseInt(_0x3b1998(0xdc))/0x8)+parseInt(_0x3b1998(0xbd))/0x9+parseInt(_0x3b1998(0xe9))/0xa*(-parseInt(_0x3b1998(0xe8))/0xb);if(_0x170713===_0x3de6ea)break;else _0x3f0c50['push'](_0x3f0c50['shift']());}catch(_0x5129b8){_0x3f0c50['push'](_0x3f0c50['shift']());}}}(a22_0x100b,0xf00f9));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile}from'../core/profile.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a22_0x1d99(_0x448158,_0x58f75a){_0x448158=_0x448158-0x7f;const _0x100bbd=a22_0x100b();let _0x1d99af=_0x100bbd[_0x448158];return _0x1d99af;}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a22_0x244a44 from'prompts';import a22_0x34b468 from'chalk';function validateProfileName(_0x477a59){const _0x47f70a=a22_0x1d99;if(!_0x477a59||!_0x477a59[_0x47f70a(0xc9)]())return _0x47f70a(0xac);const _0x4d9ae3=_0x477a59[_0x47f70a(0xc9)]();if(!/^[a-zA-Z0-9_-]+$/['test'](_0x4d9ae3))return'Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore';if(profileExists(_0x4d9ae3))return _0x47f70a(0xf0)+_0x4d9ae3+_0x47f70a(0xcd);return!![];}export class ProfileCreateCommand extends BaseCommand{[a22_0xed848a(0x9e)]='profile:create';['description']=a22_0xed848a(0xb1);async[a22_0xed848a(0xa6)](_0x16ae1d){const _0x5536b5=a22_0xed848a,{options:_0x488496,args:_0x286e7c}=_0x16ae1d;console[_0x5536b5(0x8a)](a22_0x34b468[_0x5536b5(0xd3)](_0x5536b5(0xbe)));let _0x2a2898;if(_0x286e7c[_0x5536b5(0xc2)]>0x0&&_0x286e7c[0x0]){const _0x14ee33=_0x286e7c[0x0][_0x5536b5(0xc9)](),_0x560b07=validateProfileName(_0x14ee33);if(_0x560b07!==!![])return console[_0x5536b5(0xea)](a22_0x34b468['red'](_0x560b07)),0x1;_0x2a2898=_0x14ee33;}else{const _0x49097b=await a22_0x244a44({'type':_0x5536b5(0x9d),'name':_0x5536b5(0xe7),'message':_0x5536b5(0xb4),'validate':validateProfileName});if(!_0x49097b[_0x5536b5(0xe7)])return console[_0x5536b5(0x8a)](_0x5536b5(0x9b)),0x1;_0x2a2898=_0x49097b[_0x5536b5(0xe7)][_0x5536b5(0xc9)]();}const _0x1007c1=await a22_0x244a44({'type':_0x5536b5(0x9d),'name':_0x5536b5(0xa9),'message':_0x5536b5(0x93)}),_0xfbba2d=_0x1007c1[_0x5536b5(0xa9)]?.[_0x5536b5(0xc9)]()||undefined,_0x126f23=_0x488496['site']||_0x5536b5(0xa2),_0x20fd6d=[{'title':_0x5536b5(0xd9),'value':_0x5536b5(0xa2)},{'title':_0x5536b5(0xba),'value':_0x5536b5(0xe6)},{'title':_0x5536b5(0x86),'value':'eu01'},{'title':_0x5536b5(0x8f),'value':_0x5536b5(0x96)}];let _0xf21705=_0x20fd6d[_0x5536b5(0xd5)](_0x5b9e60=>_0x5b9e60[_0x5536b5(0xaf)]===_0x126f23);_0xf21705===-0x1&&_0x126f23!==_0x5536b5(0xa2)&&(_0x20fd6d[_0x5536b5(0xb8)]({'title':_0x126f23,'value':_0x126f23}),_0xf21705=_0x20fd6d[_0x5536b5(0xc2)]-0x1);_0x20fd6d[_0x5536b5(0xb8)]({'title':_0x5536b5(0x83),'value':'other'});const _0x4555d7=await a22_0x244a44({'type':_0x5536b5(0xa3),'name':_0x5536b5(0xe4),'message':_0x5536b5(0x8e)+_0x2a2898+'\x27:','choices':_0x20fd6d,'initial':_0xf21705>=0x0?_0xf21705:0x0});if(!_0x4555d7['site'])return console[_0x5536b5(0x8a)]('\x0aSetup\x20cancelled'),0x1;let _0x19a34c;if(_0x4555d7[_0x5536b5(0xe4)]==='other'){const _0x1c849a=await a22_0x244a44({'type':'text','name':'customSite','message':_0x5536b5(0xc8),'initial':_0x5536b5(0xa2),'validate':_0x314f1d=>{const _0x1d23bc=_0x5536b5;if(!_0x314f1d||!_0x314f1d[_0x1d23bc(0xc9)]())return _0x1d23bc(0x97);if(!/^[a-z0-9-]+$/[_0x1d23bc(0xd7)](_0x314f1d['trim']()))return _0x1d23bc(0xda);return!![];}});if(!_0x1c849a['customSite'])return console['log'](_0x5536b5(0x9b)),0x1;_0x19a34c=_0x1c849a[_0x5536b5(0x8b)];}else _0x19a34c=_0x4555d7[_0x5536b5(0xe4)];const _0x4fb46b=resolveSite(_0x19a34c);console['log'](_0x5536b5(0xe1)+_0x4fb46b),console['log'](_0x5536b5(0xd8)),console[_0x5536b5(0x8a)]('\x20\x20'+getConsoleUrl(_0x4fb46b,'/app/mp/ak'));const _0x39451b=await a22_0x244a44({'type':_0x5536b5(0x98),'name':'apiKey','message':_0x5536b5(0xc7),'validate':_0x5ee10c=>{if(!_0x5ee10c||!_0x5ee10c['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x39451b[_0x5536b5(0x82)])return console[_0x5536b5(0x8a)](_0x5536b5(0x9b)),0x1;const _0x3b4568=_0x39451b[_0x5536b5(0x82)];console[_0x5536b5(0x8a)](_0x5536b5(0x94));try{const _0x5b8eed=TDX['create']({'site':_0x4fb46b,'apiKey':_0x3b4568[_0x5536b5(0xc9)](),'logLevel':_0x488496[_0x5536b5(0xb9)]??LogLevel[_0x5536b5(0xa7)]}),_0x26f831=await _0x5b8eed[_0x5536b5(0x95)][_0x5536b5(0xe0)]();console[_0x5536b5(0x8a)](a22_0x34b468[_0x5536b5(0xdf)]('✓')+_0x5536b5(0xc3)+_0x26f831[_0x5536b5(0xeb)]+')');const _0x21d71b=await isKeychainAvailable();_0x21d71b?(await saveAPIKeyAsync(_0x3b4568[_0x5536b5(0xc9)](),_0x4fb46b,_0x2a2898),console[_0x5536b5(0x8a)](a22_0x34b468[_0x5536b5(0xdf)]('✓')+_0x5536b5(0xc0)+_0x2a2898+')')):(console[_0x5536b5(0x99)](a22_0x34b468[_0x5536b5(0xde)](_0x5536b5(0x88))),console[_0x5536b5(0x99)](a22_0x34b468[_0x5536b5(0xde)](_0x5536b5(0xbf))));const _0x595a6c={'site':_0x4fb46b,..._0xfbba2d&&{'description':_0xfbba2d}};return saveProfileToUserConfig(_0x2a2898,_0x595a6c),console[_0x5536b5(0x8a)](a22_0x34b468[_0x5536b5(0xdf)]('✓')+_0x5536b5(0xee)+_0x2a2898+_0x5536b5(0xef)),console[_0x5536b5(0x8a)](),console['log'](_0x5536b5(0xcf)),console[_0x5536b5(0x8a)](_0x5536b5(0xb5)+_0x2a2898+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x5536b5(0xb5)+_0x2a2898+_0x5536b5(0xa5)),0x0;}catch(_0x578648){if(_0x578648 instanceof HTTPClientError&&_0x578648[_0x5536b5(0x9a)]===0x191)return printAuthError(_0x578648),0x1;return console[_0x5536b5(0xea)](a22_0x34b468[_0x5536b5(0x80)](_0x5536b5(0xb0)+(_0x578648 instanceof Error?_0x578648['message']:String(_0x578648)))),console['error'](_0x5536b5(0x89)),0x1;}}}function a22_0x100b(){const _0x5381f7=['Remove\x20a\x20profile','\x0aOperation\x20cancelled','Profile\x20name\x20cannot\x20be\x20empty','/app/mp/ak','VALID_KEYS','value','✗\x20Validation\x20failed:\x20','Create\x20a\x20new\x20profile','config','Set\x20a\x20profile\x20configuration\x20value','Enter\x20profile\x20name:','\x20\x20tdx\x20--profile\x20','Unknown\x20key\x20\x27','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','push','logLevel','jp\x20\x20\x20-\x20Japan','validate','session','17286732wahQgs','tdx:\x20profile\x20create','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','Failed\x20to\x20remove\x20profile:\x20','length','\x20API\x20key\x20is\x20valid\x20(User:\x20','API\x20key\x20cannot\x20be\x20empty','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','Operation\x20cancelled','Enter\x20your\x20TD\x20API\x20key:','Enter\x20site\x20name:','trim','toString','1632543JMaBvt','3FHnQYT','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','66AJQkTP','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','tdx:\x20profile\x20set','dim','\x0aAvailable\x20profiles:','bold','tdx:\x20profile\x20remove','findIndex','llm_agent','test','You\x20can\x20find\x20your\x20API\x20key\x20at:','us\x20\x20\x20-\x20United\x20States','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','6285708DqfMwc','8WTzkfa','\x20API\x20key\x20removed\x20from\x20system\x20keychain','yellow','green','getUserInfo','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','llm_project','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','site','profile:set','jp01','profileName','1536711kfJcoI','90hPUTSH','error','email','confirm','\x27\x20updated:\x20','\x20Profile\x20\x27','\x27\x20created','Profile\x20\x27','message','Site\x20was\x20not\x20changed.','1342992EWHgLc','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','red','\x20\x20-\x20','apiKey','Enter\x20custom\x20site','split','3799271TkhcZY','eu\x20\x20\x20-\x20Europe','(cleared)','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','log','customSite','434325tlKuBH','database','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','ap02\x20-\x20Korea','join','Set\x20session\x20profile','parent_segment','Enter\x20description\x20(optional):','Validating\x20API\x20key...','jobs','ap02','Site\x20name\x20cannot\x20be\x20empty','password','warn','status','\x0aSetup\x20cancelled','includes','text','name','create','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','us01','select','\x27\x20does\x20not\x20exist.','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','execute','ERROR','\x27\x20requires\x20API\x20key\x20validation.','description'];a22_0x100b=function(){return _0x5381f7;};return a22_0x100b();}export class ProfileRemoveCommand extends BaseCommand{[a22_0xed848a(0x9e)]='profile:remove';[a22_0xed848a(0xa9)]=a22_0xed848a(0xaa);[a22_0xed848a(0xbb)](_0x23bd9c){const _0x513715=a22_0xed848a,{args:_0x1cb506}=_0x23bd9c;if(_0x1cb506[_0x513715(0xc2)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>';return undefined;}async['execute'](_0x879306){const _0x798baf=a22_0xed848a,{args:_0x2c68a6}=_0x879306,_0x35eb02=_0x2c68a6[0x0];console[_0x798baf(0x8a)](a22_0x34b468[_0x798baf(0xd3)](_0x798baf(0xd4)));if(!profileExists(_0x35eb02)){console[_0x798baf(0xea)](a22_0x34b468[_0x798baf(0x80)]('Profile\x20\x27'+_0x35eb02+_0x798baf(0xa4))),console['log'](_0x798baf(0xd2));const _0x3a351f=listProfiles();if(_0x3a351f[_0x798baf(0xc2)]===0x0)console[_0x798baf(0x8a)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x32ef9c of _0x3a351f){console[_0x798baf(0x8a)]('\x20\x20-\x20'+_0x32ef9c[_0x798baf(0x9e)]);}return 0x1;}const _0x3f1413=await a22_0x244a44({'type':_0x798baf(0xec),'name':_0x798baf(0xec),'message':_0x798baf(0x7f)+_0x35eb02+'\x27?','initial':![]});if(!_0x3f1413[_0x798baf(0xec)])return console[_0x798baf(0x8a)]('Removal\x20cancelled'),0x0;try{removeProfileFromUserConfig(_0x35eb02),console[_0x798baf(0x8a)](a22_0x34b468[_0x798baf(0xdf)]('✓')+'\x20Profile\x20\x27'+_0x35eb02+'\x27\x20removed\x20from\x20configuration');}catch(_0x10212f){return console['error'](a22_0x34b468[_0x798baf(0x80)](_0x798baf(0xc1)+(_0x10212f instanceof Error?_0x10212f[_0x798baf(0xf1)]:String(_0x10212f)))),0x1;}const _0xb449d=await isKeychainAvailable();if(_0xb449d){const _0x438a27=await deleteKeychainAPIKey(_0x35eb02);_0x438a27&&console[_0x798baf(0x8a)](a22_0x34b468[_0x798baf(0xdf)]('✓')+_0x798baf(0xdd));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a22_0xed848a(0x9e)]=a22_0xed848a(0xe5);[a22_0xed848a(0xa9)]=a22_0xed848a(0xb3);static ['VALID_KEYS']=[a22_0xed848a(0xe4),a22_0xed848a(0x8d),a22_0xed848a(0x92),a22_0xed848a(0xe2),a22_0xed848a(0xd6),a22_0xed848a(0xa9)];[a22_0xed848a(0xbb)](_0x5f2cbf){const _0xd5ab8a=a22_0xed848a,{args:_0x55770b,options:_0x69c942}=_0x5f2cbf,_0x5098c2=_0x69c942['profile']||getActiveProfile();if(!_0x5098c2)return _0xd5ab8a(0xb7);if(_0x55770b[_0xd5ab8a(0xc2)]===0x0)return _0xd5ab8a(0xc5)+ProfileSetCommand[_0xd5ab8a(0xae)]['join'](',\x20');const _0x5bf6a5=_0x55770b[0x0];if(!_0x5bf6a5[_0xd5ab8a(0x9c)]('='))return _0xd5ab8a(0xe3)+ProfileSetCommand['VALID_KEYS']['join'](',\x20');const [_0x3c0233]=_0x5bf6a5[_0xd5ab8a(0x84)]('=',0x2);if(!ProfileSetCommand['VALID_KEYS'][_0xd5ab8a(0x9c)](_0x3c0233))return _0xd5ab8a(0xb6)+_0x3c0233+'\x27.\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0xd5ab8a(0xae)][_0xd5ab8a(0x90)](',\x20');return undefined;}async['execute'](_0x3ffca2){const _0x28dc31=a22_0xed848a,{args:_0x4dc123,options:_0x434c03}=_0x3ffca2,_0x4613dd=_0x434c03['profile']||getActiveProfile(),[_0x5973b3,..._0x17c412]=_0x4dc123[0x0][_0x28dc31(0x84)]('='),_0x2ab9bb=_0x17c412[_0x28dc31(0x90)]('=');console['log'](a22_0x34b468['bold'](_0x28dc31(0xd0)));if(!profileExists(_0x4613dd)){const _0x4be44f=await a22_0x244a44({'type':_0x28dc31(0xec),'name':_0x28dc31(0x9f),'message':_0x28dc31(0xf0)+_0x4613dd+'\x27\x20does\x20not\x20exist.\x20Create\x20it?','initial':!![]});if(!_0x4be44f[_0x28dc31(0x9f)])return console['log'](_0x28dc31(0xc6)),0x1;}const _0x5960bd=loadProfile(_0x4613dd),_0x405055=_0x5960bd?.[_0x28dc31(0xb2)]||{};if(_0x5973b3===_0x28dc31(0xe4)){const _0x1db276=resolveSite(_0x2ab9bb);console[_0x28dc31(0x8a)]('Changing\x20site\x20to\x20\x27'+_0x1db276+_0x28dc31(0xa8)),console['log'](_0x28dc31(0xa1)),console[_0x28dc31(0x8a)]('\x20\x20'+getConsoleUrl(_0x1db276,_0x28dc31(0xad)));const _0x18aba8=await a22_0x244a44({'type':_0x28dc31(0x98),'name':_0x28dc31(0x82),'message':_0x28dc31(0xa0),'validate':_0x3d7a6a=>{const _0x9c37af=_0x28dc31;if(!_0x3d7a6a||!_0x3d7a6a[_0x9c37af(0xc9)]())return _0x9c37af(0xc4);return!![];}});if(!_0x18aba8[_0x28dc31(0x82)])return console[_0x28dc31(0x8a)](_0x28dc31(0xab)),0x1;console[_0x28dc31(0x8a)](_0x28dc31(0x94));try{const _0x561bc8=TDX[_0x28dc31(0x9f)]({'site':_0x1db276,'apiKey':_0x18aba8['apiKey'][_0x28dc31(0xc9)](),'logLevel':_0x434c03[_0x28dc31(0xb9)]??LogLevel[_0x28dc31(0xa7)]}),_0x26aa10=await _0x561bc8['jobs'][_0x28dc31(0xe0)]();console[_0x28dc31(0x8a)](a22_0x34b468['green']('✓')+_0x28dc31(0xc3)+_0x26aa10[_0x28dc31(0xeb)]+')');const _0x37edd4=await isKeychainAvailable();_0x37edd4?(await saveAPIKeyAsync(_0x18aba8[_0x28dc31(0x82)]['trim'](),_0x1db276,_0x4613dd),console['log'](a22_0x34b468['green']('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain')):console['warn'](a22_0x34b468['yellow'](_0x28dc31(0x88))),_0x405055[_0x28dc31(0xe4)]=_0x1db276;}catch(_0x1e193c){if(_0x1e193c instanceof HTTPClientError&&_0x1e193c['status']===0x191)return printAuthError(_0x1e193c),0x1;return console[_0x28dc31(0xea)](a22_0x34b468[_0x28dc31(0x80)]('✗\x20Validation\x20failed:\x20'+(_0x1e193c instanceof Error?_0x1e193c[_0x28dc31(0xf1)]:String(_0x1e193c)))),console[_0x28dc31(0xea)](_0x28dc31(0xf2)),0x1;}}else _0x405055[_0x5973b3]=_0x2ab9bb||undefined;return saveProfileToUserConfig(_0x4613dd,_0x405055),console[_0x28dc31(0x8a)](a22_0x34b468[_0x28dc31(0xdf)]('✓')+_0x28dc31(0xee)+_0x4613dd+_0x28dc31(0xed)+_0x5973b3+'='+(_0x2ab9bb||_0x28dc31(0x87))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a22_0xed848a(0x9e)]='profile:use';[a22_0xed848a(0xa9)]=a22_0xed848a(0x91);[a22_0xed848a(0xbb)](_0x3a83ef){const {args:_0x2d3a05}=_0x3a83ef;if(_0x2d3a05['length']===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>';return undefined;}async[a22_0xed848a(0xa6)](_0x5a94a8){const _0x1a465f=a22_0xed848a,{args:_0x103aa9,options:_0x90ec49}=_0x5a94a8,_0x308b2f=_0x103aa9[0x0];cleanExpiredSessions();if(!profileExists(_0x308b2f)){console['error'](a22_0x34b468[_0x1a465f(0x80)]('Profile\x20\x27'+_0x308b2f+_0x1a465f(0xa4))),console[_0x1a465f(0x8a)]('\x0aAvailable\x20profiles:');const _0x348431=listProfiles();if(_0x348431[_0x1a465f(0xc2)]===0x0)console['log']('\x20\x20(no\x20profiles\x20found)');else for(const _0x2736b6 of _0x348431){console['log'](_0x1a465f(0x81)+_0x2736b6['name']);}return 0x1;}const _0x52be5b=_0x90ec49['session']||getCurrentSessionPID()[_0x1a465f(0xca)]();return saveSessionContext({'profile':_0x308b2f},_0x90ec49[_0x1a465f(0xbc)]),console[_0x1a465f(0x8a)]('Session\x20profile\x20set\x20to:\x20'+a22_0x34b468['green'](_0x308b2f)+'\x20'+a22_0x34b468[_0x1a465f(0xd1)]('(session:\x20'+_0x52be5b+')')),console[_0x1a465f(0x8a)](a22_0x34b468[_0x1a465f(0xd1)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}}
1
+ const a22_0xa81a40=a22_0x36f4;(function(_0x284c76,_0x349d4f){const _0x1655d7=a22_0x36f4,_0x2cdc31=_0x284c76();while(!![]){try{const _0x141b3f=parseInt(_0x1655d7(0x138))/0x1*(parseInt(_0x1655d7(0x122))/0x2)+-parseInt(_0x1655d7(0x158))/0x3+parseInt(_0x1655d7(0x154))/0x4+parseInt(_0x1655d7(0x160))/0x5*(parseInt(_0x1655d7(0x11b))/0x6)+-parseInt(_0x1655d7(0x149))/0x7*(-parseInt(_0x1655d7(0x153))/0x8)+-parseInt(_0x1655d7(0x166))/0x9*(parseInt(_0x1655d7(0x180))/0xa)+-parseInt(_0x1655d7(0x174))/0xb;if(_0x141b3f===_0x349d4f)break;else _0x2cdc31['push'](_0x2cdc31['shift']());}catch(_0x408443){_0x2cdc31['push'](_0x2cdc31['shift']());}}}(a22_0x4434,0xed5ad));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile}from'../core/profile.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a22_0x4434(){const _0x4693c5=['getUserInfo','message','\x20\x20tdx\x20--profile\x20','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','Profile\x20\x27','jobs','tdx:\x20profile\x20remove','95744NFzPvk','4118484fzaQcJ','findIndex','red','ap02\x20-\x20Korea','2025435HIlYhB','profile:set','text','other','warn','Validating\x20API\x20key...','profile:use','green','525obOUVQ','create','tdx:\x20profile\x20set','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','profileName','parent_segment','9pUjlTV','\x20\x20(no\x20profiles\x20found)','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','Site\x20was\x20not\x20changed.','select','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','\x20\x20-\x20','config','\x20API\x20key\x20is\x20valid\x20(User:\x20','Operation\x20cancelled','Set\x20session\x20profile','profile:remove','execute','test','8511030mjVcgZ','\x27\x20removed\x20from\x20configuration','logLevel','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>','description','Session\x20profile\x20set\x20to:\x20','✗\x20Validation\x20failed:\x20','API\x20key\x20cannot\x20be\x20empty','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','name','error','\x27.\x0a\x0aValid\x20keys:\x20','10715310xfFMrF','length','status','Changing\x20site\x20to\x20\x27','join','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','email','profile','us\x20\x20\x20-\x20United\x20States','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','Removal\x20cancelled','\x27\x20updated:\x20','tdx:\x20profile\x20create','\x27\x20created','\x27\x20requires\x20API\x20key\x20validation.','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','39654LTAmUz','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20Profile\x20\x27','profile:create','Enter\x20profile\x20name:','site','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','276770LhsTaA','ap02','session','dim','customSite','(session:\x20','\x0aOperation\x20cancelled','Enter\x20description\x20(optional):','bold','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','\x20API\x20key\x20removed\x20from\x20system\x20keychain','apiKey','jp\x20\x20\x20-\x20Japan','push','Set\x20a\x20profile\x20configuration\x20value','yellow','\x0aAvailable\x20profiles:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','log','validate','Remove\x20a\x20profile','\x27\x20does\x20not\x20exist.\x20Create\x20it?','5DekWAe','Profile\x20name\x20cannot\x20be\x20empty','split','eu01','includes','\x0aSetup\x20cancelled','confirm','Failed\x20to\x20remove\x20profile:\x20','database','us01','password','\x27\x20does\x20not\x20exist.','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','\x20API\x20key\x20saved\x20to\x20system\x20keychain','trim','VALID_KEYS','630jsEzrp','jp01','llm_project'];a22_0x4434=function(){return _0x4693c5;};return a22_0x4434();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a22_0x296651 from'prompts';import a22_0x373702 from'chalk';function validateProfileName(_0x1236a8){const _0x5cf86d=a22_0x36f4;if(!_0x1236a8||!_0x1236a8[_0x5cf86d(0x147)]())return _0x5cf86d(0x139);const _0x309d23=_0x1236a8[_0x5cf86d(0x147)]();if(!/^[a-zA-Z0-9_-]+$/[_0x5cf86d(0x173)](_0x309d23))return _0x5cf86d(0x17c);if(profileExists(_0x309d23))return'Profile\x20\x27'+_0x309d23+_0x5cf86d(0x18a);return!![];}export class ProfileCreateCommand extends BaseCommand{[a22_0xa81a40(0x17d)]=a22_0xa81a40(0x11e);[a22_0xa81a40(0x178)]='Create\x20a\x20new\x20profile';async['execute'](_0x5a12ee){const _0x49bed3=a22_0xa81a40,{options:_0x1f3480,args:_0x37bd09}=_0x5a12ee;console['log'](a22_0x373702[_0x49bed3(0x12a)](_0x49bed3(0x18d)));let _0x2cba8a;if(_0x37bd09[_0x49bed3(0x181)]>0x0&&_0x37bd09[0x0]){const _0x310876=_0x37bd09[0x0][_0x49bed3(0x147)](),_0x59fddb=validateProfileName(_0x310876);if(_0x59fddb!==!![])return console[_0x49bed3(0x17e)](a22_0x373702[_0x49bed3(0x156)](_0x59fddb)),0x1;_0x2cba8a=_0x310876;}else{const _0x1191bb=await a22_0x296651({'type':_0x49bed3(0x15a),'name':'profileName','message':_0x49bed3(0x11f),'validate':validateProfileName});if(!_0x1191bb[_0x49bed3(0x164)])return console[_0x49bed3(0x134)]('\x0aSetup\x20cancelled'),0x1;_0x2cba8a=_0x1191bb[_0x49bed3(0x164)][_0x49bed3(0x147)]();}const _0x4bf864=await a22_0x296651({'type':_0x49bed3(0x15a),'name':_0x49bed3(0x178),'message':_0x49bed3(0x129)}),_0x587ec7=_0x4bf864[_0x49bed3(0x178)]?.[_0x49bed3(0x147)]()||undefined,_0x227cb0=_0x1f3480[_0x49bed3(0x120)]||_0x49bed3(0x141),_0x1772b7=[{'title':_0x49bed3(0x188),'value':_0x49bed3(0x141)},{'title':_0x49bed3(0x12e),'value':_0x49bed3(0x14a)},{'title':'eu\x20\x20\x20-\x20Europe','value':_0x49bed3(0x13b)},{'title':_0x49bed3(0x157),'value':_0x49bed3(0x123)}];let _0x8a4489=_0x1772b7[_0x49bed3(0x155)](_0x2c75a0=>_0x2c75a0['value']===_0x227cb0);_0x8a4489===-0x1&&_0x227cb0!==_0x49bed3(0x141)&&(_0x1772b7[_0x49bed3(0x12f)]({'title':_0x227cb0,'value':_0x227cb0}),_0x8a4489=_0x1772b7[_0x49bed3(0x181)]-0x1);_0x1772b7[_0x49bed3(0x12f)]({'title':'Enter\x20custom\x20site','value':_0x49bed3(0x15b)});const _0x2ed623=await a22_0x296651({'type':_0x49bed3(0x16a),'name':'site','message':_0x49bed3(0x189)+_0x2cba8a+'\x27:','choices':_0x1772b7,'initial':_0x8a4489>=0x0?_0x8a4489:0x0});if(!_0x2ed623[_0x49bed3(0x120)])return console['log']('\x0aSetup\x20cancelled'),0x1;let _0x30dc61;if(_0x2ed623[_0x49bed3(0x120)]==='other'){const _0x23d131=await a22_0x296651({'type':_0x49bed3(0x15a),'name':_0x49bed3(0x126),'message':'Enter\x20site\x20name:','initial':_0x49bed3(0x141),'validate':_0x44f806=>{const _0x518b20=_0x49bed3;if(!_0x44f806||!_0x44f806[_0x518b20(0x147)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x518b20(0x173)](_0x44f806[_0x518b20(0x147)]()))return _0x518b20(0x144);return!![];}});if(!_0x23d131[_0x49bed3(0x126)])return console[_0x49bed3(0x134)](_0x49bed3(0x13d)),0x1;_0x30dc61=_0x23d131[_0x49bed3(0x126)];}else _0x30dc61=_0x2ed623[_0x49bed3(0x120)];const _0x1e4ba2=resolveSite(_0x30dc61);console[_0x49bed3(0x134)](_0x49bed3(0x168)+_0x1e4ba2),console[_0x49bed3(0x134)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x49bed3(0x134)]('\x20\x20'+getConsoleUrl(_0x1e4ba2,'/app/mp/ak'));const _0x386a41=await a22_0x296651({'type':_0x49bed3(0x142),'name':_0x49bed3(0x12d),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x38f196=>{const _0x3840d2=_0x49bed3;if(!_0x38f196||!_0x38f196[_0x3840d2(0x147)]())return _0x3840d2(0x17b);return!![];}});if(!_0x386a41[_0x49bed3(0x12d)])return console[_0x49bed3(0x134)](_0x49bed3(0x13d)),0x1;const _0xe44cea=_0x386a41[_0x49bed3(0x12d)];console[_0x49bed3(0x134)](_0x49bed3(0x15d));try{const _0x237661=TDX['create']({'site':_0x1e4ba2,'apiKey':_0xe44cea[_0x49bed3(0x147)](),'logLevel':_0x1f3480['logLevel']??LogLevel['ERROR']}),_0x1e6365=await _0x237661['jobs'][_0x49bed3(0x14c)]();console[_0x49bed3(0x134)](a22_0x373702[_0x49bed3(0x15f)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x1e6365[_0x49bed3(0x186)]+')');const _0x16a892=await isKeychainAvailable();_0x16a892?(await saveAPIKeyAsync(_0xe44cea[_0x49bed3(0x147)](),_0x1e4ba2,_0x2cba8a),console[_0x49bed3(0x134)](a22_0x373702['green']('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x2cba8a+')')):(console[_0x49bed3(0x15c)](a22_0x373702['yellow'](_0x49bed3(0x133))),console[_0x49bed3(0x15c)](a22_0x373702[_0x49bed3(0x131)](_0x49bed3(0x163))));const _0xe2aa7a={'site':_0x1e4ba2,..._0x587ec7&&{'description':_0x587ec7}};return saveProfileToUserConfig(_0x2cba8a,_0xe2aa7a),console[_0x49bed3(0x134)](a22_0x373702[_0x49bed3(0x15f)]('✓')+_0x49bed3(0x11d)+_0x2cba8a+_0x49bed3(0x18e)),console['log'](),console[_0x49bed3(0x134)](_0x49bed3(0x12b)),console[_0x49bed3(0x134)](_0x49bed3(0x14e)+_0x2cba8a+_0x49bed3(0x11c)),console[_0x49bed3(0x134)](_0x49bed3(0x14e)+_0x2cba8a+_0x49bed3(0x121)),0x0;}catch(_0x3106ef){if(_0x3106ef instanceof HTTPClientError&&_0x3106ef[_0x49bed3(0x182)]===0x191)return printAuthError(_0x3106ef),0x1;return console['error'](a22_0x373702['red'](_0x49bed3(0x17a)+(_0x3106ef instanceof Error?_0x3106ef[_0x49bed3(0x14d)]:String(_0x3106ef)))),console[_0x49bed3(0x17e)](_0x49bed3(0x145)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a22_0xa81a40(0x17d)]=a22_0xa81a40(0x171);['description']=a22_0xa81a40(0x136);['validate'](_0x54de16){const _0x43fc63=a22_0xa81a40,{args:_0x410fbe}=_0x54de16;if(_0x410fbe['length']===0x0)return _0x43fc63(0x14f);return undefined;}async[a22_0xa81a40(0x172)](_0x270824){const _0x14f7fd=a22_0xa81a40,{args:_0x3e6436}=_0x270824,_0x31932f=_0x3e6436[0x0];console[_0x14f7fd(0x134)](a22_0x373702[_0x14f7fd(0x12a)](_0x14f7fd(0x152)));if(!profileExists(_0x31932f)){console['error'](a22_0x373702[_0x14f7fd(0x156)](_0x14f7fd(0x150)+_0x31932f+_0x14f7fd(0x143))),console[_0x14f7fd(0x134)](_0x14f7fd(0x132));const _0x28f0f2=listProfiles();if(_0x28f0f2[_0x14f7fd(0x181)]===0x0)console[_0x14f7fd(0x134)](_0x14f7fd(0x167));else for(const _0x1af2f3 of _0x28f0f2){console['log'](_0x14f7fd(0x16c)+_0x1af2f3[_0x14f7fd(0x17d)]);}return 0x1;}const _0x42b51b=await a22_0x296651({'type':_0x14f7fd(0x13e),'name':_0x14f7fd(0x13e),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0x31932f+'\x27?','initial':![]});if(!_0x42b51b[_0x14f7fd(0x13e)])return console[_0x14f7fd(0x134)](_0x14f7fd(0x18b)),0x0;try{removeProfileFromUserConfig(_0x31932f),console[_0x14f7fd(0x134)](a22_0x373702[_0x14f7fd(0x15f)]('✓')+_0x14f7fd(0x11d)+_0x31932f+_0x14f7fd(0x175));}catch(_0xda011){return console[_0x14f7fd(0x17e)](a22_0x373702[_0x14f7fd(0x156)](_0x14f7fd(0x13f)+(_0xda011 instanceof Error?_0xda011[_0x14f7fd(0x14d)]:String(_0xda011)))),0x1;}const _0x1af25f=await isKeychainAvailable();if(_0x1af25f){const _0x18fc3c=await deleteKeychainAPIKey(_0x31932f);_0x18fc3c&&console[_0x14f7fd(0x134)](a22_0x373702[_0x14f7fd(0x15f)]('✓')+_0x14f7fd(0x12c));}return 0x0;}}function a22_0x36f4(_0x479ed1,_0x42ff23){_0x479ed1=_0x479ed1-0x119;const _0x443484=a22_0x4434();let _0x36f42f=_0x443484[_0x479ed1];return _0x36f42f;}export class ProfileSetCommand extends BaseCommand{[a22_0xa81a40(0x17d)]=a22_0xa81a40(0x159);['description']=a22_0xa81a40(0x130);static [a22_0xa81a40(0x148)]=['site',a22_0xa81a40(0x140),a22_0xa81a40(0x165),a22_0xa81a40(0x14b),'llm_agent',a22_0xa81a40(0x178)];[a22_0xa81a40(0x135)](_0x84efb7){const _0x35d5bf=a22_0xa81a40,{args:_0x189964,options:_0x1b78be}=_0x84efb7,_0x13b27b=_0x1b78be[_0x35d5bf(0x187)]||getActiveProfile();if(!_0x13b27b)return _0x35d5bf(0x11a);if(_0x189964[_0x35d5bf(0x181)]===0x0)return _0x35d5bf(0x16b)+ProfileSetCommand['VALID_KEYS'][_0x35d5bf(0x184)](',\x20');const _0x392c30=_0x189964[0x0];if(!_0x392c30[_0x35d5bf(0x13c)]('='))return'Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand['VALID_KEYS'][_0x35d5bf(0x184)](',\x20');const [_0x124bba]=_0x392c30['split']('=',0x2);if(!ProfileSetCommand[_0x35d5bf(0x148)]['includes'](_0x124bba))return'Unknown\x20key\x20\x27'+_0x124bba+_0x35d5bf(0x17f)+ProfileSetCommand[_0x35d5bf(0x148)][_0x35d5bf(0x184)](',\x20');return undefined;}async[a22_0xa81a40(0x172)](_0x4a967c){const _0x2a7b37=a22_0xa81a40,{args:_0x3c9841,options:_0x53b344}=_0x4a967c,_0x492498=_0x53b344[_0x2a7b37(0x187)]||getActiveProfile(),[_0x23aaba,..._0x19742c]=_0x3c9841[0x0][_0x2a7b37(0x13a)]('='),_0x6072c9=_0x19742c[_0x2a7b37(0x184)]('=');console['log'](a22_0x373702[_0x2a7b37(0x12a)](_0x2a7b37(0x162)));if(!profileExists(_0x492498)){const _0x16cf56=await a22_0x296651({'type':'confirm','name':_0x2a7b37(0x161),'message':_0x2a7b37(0x150)+_0x492498+_0x2a7b37(0x137),'initial':!![]});if(!_0x16cf56[_0x2a7b37(0x161)])return console[_0x2a7b37(0x134)](_0x2a7b37(0x16f)),0x1;}const _0x2f0c80=loadProfile(_0x492498),_0x51be3d=_0x2f0c80?.[_0x2a7b37(0x16d)]||{};if(_0x23aaba===_0x2a7b37(0x120)){const _0x392b97=resolveSite(_0x6072c9);console['log'](_0x2a7b37(0x183)+_0x392b97+_0x2a7b37(0x119)),console['log'](_0x2a7b37(0x185)),console[_0x2a7b37(0x134)]('\x20\x20'+getConsoleUrl(_0x392b97,'/app/mp/ak'));const _0x5674c5=await a22_0x296651({'type':_0x2a7b37(0x142),'name':_0x2a7b37(0x12d),'message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x4cebf4=>{const _0x5e1452=_0x2a7b37;if(!_0x4cebf4||!_0x4cebf4[_0x5e1452(0x147)]())return _0x5e1452(0x17b);return!![];}});if(!_0x5674c5[_0x2a7b37(0x12d)])return console[_0x2a7b37(0x134)](_0x2a7b37(0x128)),0x1;console['log'](_0x2a7b37(0x15d));try{const _0x3a0037=TDX[_0x2a7b37(0x161)]({'site':_0x392b97,'apiKey':_0x5674c5[_0x2a7b37(0x12d)]['trim'](),'logLevel':_0x53b344[_0x2a7b37(0x176)]??LogLevel['ERROR']}),_0x1d6270=await _0x3a0037[_0x2a7b37(0x151)][_0x2a7b37(0x14c)]();console[_0x2a7b37(0x134)](a22_0x373702[_0x2a7b37(0x15f)]('✓')+_0x2a7b37(0x16e)+_0x1d6270['email']+')');const _0x1181ad=await isKeychainAvailable();_0x1181ad?(await saveAPIKeyAsync(_0x5674c5[_0x2a7b37(0x12d)][_0x2a7b37(0x147)](),_0x392b97,_0x492498),console['log'](a22_0x373702['green']('✓')+_0x2a7b37(0x146))):console['warn'](a22_0x373702[_0x2a7b37(0x131)](_0x2a7b37(0x133))),_0x51be3d[_0x2a7b37(0x120)]=_0x392b97;}catch(_0x21f89a){if(_0x21f89a instanceof HTTPClientError&&_0x21f89a[_0x2a7b37(0x182)]===0x191)return printAuthError(_0x21f89a),0x1;return console[_0x2a7b37(0x17e)](a22_0x373702[_0x2a7b37(0x156)](_0x2a7b37(0x17a)+(_0x21f89a instanceof Error?_0x21f89a[_0x2a7b37(0x14d)]:String(_0x21f89a)))),console[_0x2a7b37(0x17e)](_0x2a7b37(0x169)),0x1;}}else _0x51be3d[_0x23aaba]=_0x6072c9||undefined;return saveProfileToUserConfig(_0x492498,_0x51be3d),console['log'](a22_0x373702[_0x2a7b37(0x15f)]('✓')+_0x2a7b37(0x11d)+_0x492498+_0x2a7b37(0x18c)+_0x23aaba+'='+(_0x6072c9||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a22_0xa81a40(0x15e);[a22_0xa81a40(0x178)]=a22_0xa81a40(0x170);[a22_0xa81a40(0x135)](_0x13797b){const _0x252ca3=a22_0xa81a40,{args:_0x494ee6}=_0x13797b;if(_0x494ee6[_0x252ca3(0x181)]===0x0)return _0x252ca3(0x177);return undefined;}async[a22_0xa81a40(0x172)](_0x13c5b7){const _0x220dc5=a22_0xa81a40,{args:_0x2e4d80,options:_0x117dd}=_0x13c5b7,_0x2a1647=_0x2e4d80[0x0];cleanExpiredSessions();if(!profileExists(_0x2a1647)){console['error'](a22_0x373702[_0x220dc5(0x156)](_0x220dc5(0x150)+_0x2a1647+_0x220dc5(0x143))),console[_0x220dc5(0x134)]('\x0aAvailable\x20profiles:');const _0x245bee=listProfiles();if(_0x245bee['length']===0x0)console[_0x220dc5(0x134)]('\x20\x20(no\x20profiles\x20found)');else for(const _0x509b3e of _0x245bee){console[_0x220dc5(0x134)](_0x220dc5(0x16c)+_0x509b3e[_0x220dc5(0x17d)]);}return 0x1;}const _0x470e3d=_0x117dd[_0x220dc5(0x124)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x2a1647},_0x117dd['session']),console['log'](_0x220dc5(0x179)+a22_0x373702[_0x220dc5(0x15f)](_0x2a1647)+'\x20'+a22_0x373702[_0x220dc5(0x125)](_0x220dc5(0x127)+_0x470e3d+')')),console['log'](a22_0x373702[_0x220dc5(0x125)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}}
@@ -1 +1 @@
1
- const a23_0x1e75f5=a23_0x7d47;(function(_0x1f070a,_0x322ca4){const _0x6b465f=a23_0x7d47,_0x4632e7=_0x1f070a();while(!![]){try{const _0x64cfcb=parseInt(_0x6b465f(0xc0))/0x1*(-parseInt(_0x6b465f(0xd1))/0x2)+parseInt(_0x6b465f(0xc9))/0x3+parseInt(_0x6b465f(0xcf))/0x4+-parseInt(_0x6b465f(0xcd))/0x5*(parseInt(_0x6b465f(0xbf))/0x6)+-parseInt(_0x6b465f(0xce))/0x7+-parseInt(_0x6b465f(0xba))/0x8*(parseInt(_0x6b465f(0xbc))/0x9)+parseInt(_0x6b465f(0xc8))/0xa;if(_0x64cfcb===_0x322ca4)break;else _0x4632e7['push'](_0x4632e7['shift']());}catch(_0x2cd2ce){_0x4632e7['push'](_0x4632e7['shift']());}}}(a23_0x1d29,0x91be3));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a23_0x1d29(){const _0x4e8f5e=['2358592FFqHlq','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','4fEGJEC','1656xtbEIE','message','31194AfNdiz','scope','List\x20all\x20available\x20profiles','859722IsEbWh','317153GMXmSO','log','config','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','description','length','name','execute','18650060rmNvua','1774437uzvIVa','error','profiles','\x20\x20Global:\x20~/.config/tdx/tdx.json','20xHXSWA','3669778FAxaLY'];a23_0x1d29=function(){return _0x4e8f5e;};return a23_0x1d29();}function a23_0x7d47(_0x320eca,_0x11e3f3){_0x320eca=_0x320eca-0xba;const _0x1d299d=a23_0x1d29();let _0x7d47bc=_0x1d299d[_0x320eca];return _0x7d47bc;}import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{['name']=a23_0x1e75f5(0xcb);[a23_0x1e75f5(0xc4)]=a23_0x1e75f5(0xbe);async[a23_0x1e75f5(0xc7)](_0x2a88d6){const _0x196809=a23_0x1e75f5,{options:_0x51f5cc}=_0x2a88d6;try{const _0x1ec4e6=listProfiles(),_0x22926e=getActiveProfile();if(_0x1ec4e6[_0x196809(0xc5)]===0x0)return console[_0x196809(0xc1)](_0x196809(0xd0)),console[_0x196809(0xc1)](_0x196809(0xc3)),console[_0x196809(0xc1)](_0x196809(0xcc)),0x0;const _0x18071d=_0x1ec4e6['map'](_0x5c26e2=>{const _0xedd786=_0x196809,_0x46ac3f=_0x5c26e2[_0xedd786(0xc6)]===_0x22926e,_0x558274=getProfileParams(_0x5c26e2[_0xedd786(0xc2)]);return{'name':_0x5c26e2[_0xedd786(0xc6)],'active':_0x46ac3f,'scope':_0x5c26e2[_0xedd786(0xbd)],'description':_0x5c26e2[_0xedd786(0xc2)][_0xedd786(0xc4)]||'','params':_0x558274};});return await handleSDKOutput(_0x18071d,_0x51f5cc),0x0;}catch(_0x15b7f4){return _0x15b7f4 instanceof Error&&console[_0x196809(0xca)]('Error:\x20'+_0x15b7f4[_0x196809(0xbb)]),0x1;}}}
1
+ function a23_0x1f32(_0x388f24,_0x2cd02e){_0x388f24=_0x388f24-0x12c;const _0x3b4d81=a23_0x3b4d();let _0x1f3201=_0x3b4d81[_0x388f24];return _0x1f3201;}const a23_0x186193=a23_0x1f32;(function(_0x1459d8,_0x31dbc9){const _0xda9960=a23_0x1f32,_0x172460=_0x1459d8();while(!![]){try{const _0x59f15e=-parseInt(_0xda9960(0x143))/0x1*(-parseInt(_0xda9960(0x13a))/0x2)+parseInt(_0xda9960(0x131))/0x3+-parseInt(_0xda9960(0x13e))/0x4+parseInt(_0xda9960(0x13d))/0x5*(parseInt(_0xda9960(0x139))/0x6)+-parseInt(_0xda9960(0x140))/0x7*(-parseInt(_0xda9960(0x13c))/0x8)+parseInt(_0xda9960(0x12f))/0x9+parseInt(_0xda9960(0x137))/0xa*(-parseInt(_0xda9960(0x135))/0xb);if(_0x59f15e===_0x31dbc9)break;else _0x172460['push'](_0x172460['shift']());}catch(_0x5756b7){_0x172460['push'](_0x172460['shift']());}}}(a23_0x3b4d,0xaee11));import{BaseCommand}from'./command.js';function a23_0x3b4d(){const _0xcc1b13=['7OnCFgs','scope','Error:\x20','1ezGBRM','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','length','description','1072026pSZzqf','\x20\x20Global:\x20~/.config/tdx/tdx.json','4064424MTYkbD','config','log','execute','792imIYic','name','258260pEZJZM','map','12pXQYQz','734434xSOOUq','profiles','1691320rwYtAq','3404330fGTBpx','3354036HkFpHz','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'];a23_0x3b4d=function(){return _0xcc1b13;};return a23_0x3b4d();}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{['name']=a23_0x186193(0x13b);[a23_0x186193(0x12e)]='List\x20all\x20available\x20profiles';async[a23_0x186193(0x134)](_0xfba1c4){const _0x47c186=a23_0x186193,{options:_0xccf24e}=_0xfba1c4;try{const _0x5be8a2=listProfiles(),_0x4cbb36=getActiveProfile();if(_0x5be8a2[_0x47c186(0x12d)]===0x0)return console[_0x47c186(0x133)](_0x47c186(0x13f)),console['log'](_0x47c186(0x12c)),console[_0x47c186(0x133)](_0x47c186(0x130)),0x0;const _0x4d41d2=_0x5be8a2[_0x47c186(0x138)](_0x42e976=>{const _0xc535e7=_0x47c186,_0x42629e=_0x42e976[_0xc535e7(0x136)]===_0x4cbb36,_0x207a9d=getProfileParams(_0x42e976[_0xc535e7(0x132)]);return{'name':_0x42e976[_0xc535e7(0x136)],'active':_0x42629e,'scope':_0x42e976[_0xc535e7(0x141)],'description':_0x42e976[_0xc535e7(0x132)][_0xc535e7(0x12e)]||'','params':_0x207a9d};});return await handleSDKOutput(_0x4d41d2,_0xccf24e),0x0;}catch(_0x546945){return _0x546945 instanceof Error&&console['error'](_0x47c186(0x142)+_0x546945['message']),0x1;}}}
@@ -1 +1 @@
1
- const a24_0x339bca=a24_0x499b;(function(_0x7f3865,_0x5dcead){const _0x1e9ead=a24_0x499b,_0x51851b=_0x7f3865();while(!![]){try{const _0x2ad479=-parseInt(_0x1e9ead(0x16e))/0x1+parseInt(_0x1e9ead(0x182))/0x2+-parseInt(_0x1e9ead(0x176))/0x3*(parseInt(_0x1e9ead(0x181))/0x4)+-parseInt(_0x1e9ead(0x15f))/0x5+parseInt(_0x1e9ead(0x180))/0x6+-parseInt(_0x1e9ead(0x18d))/0x7*(-parseInt(_0x1e9ead(0x164))/0x8)+parseInt(_0x1e9ead(0x167))/0x9;if(_0x2ad479===_0x5dcead)break;else _0x51851b['push'](_0x51851b['shift']());}catch(_0x5c6dbb){_0x51851b['push'](_0x51851b['shift']());}}}(a24_0x3cac,0x3ee4e));function a24_0x3cac(){const _0x3c919f=['verbose','...','Run\x20Trino\x20queries\x20(streaming)','error','validate','304765OFZxYB','\x0aAll\x20results\x20saved\x20to\x20','\x20splits','length','description','SQL:\x20','output','originalMessage','12seFbfU','push','catalog','Error:\x20','database','join','file','jobId','\x20-\x20','data','1316184SPMxXr','222356kjYmUL','231384bTUFVc','information_schema','Site:\x20','state','Executing\x20query\x20[','Catalog:\x20','query','Query\x20completed:\x20Processed\x20','message','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','completedSplits','7dVoDpy','Statement\x20','No\x20SQL\x20provided','894420fBYPyL','\x20[Job\x20ID:\x20','execute','Schema:\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','3360968dsSkUL','in\x20','site','1875978qfpDOV','setExtra'];a24_0x3cac=function(){return _0x3c919f;};return a24_0x3cac();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a24_0x499b(_0x41e2e6,_0x430c48){_0x41e2e6=_0x41e2e6-0x15d;const _0x3cacb0=a24_0x3cac();let _0x499bc2=_0x3cacb0[_0x41e2e6];return _0x499bc2;}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{['name']='query';[a24_0x339bca(0x172)]=a24_0x339bca(0x16b);async['execute'](_0x552ef1){const _0x1e04d0=a24_0x339bca,{options:_0x56f25b,args:_0x5dc9d1,tdx:_0xade52}=_0x552ef1,_0x4feca4=_0x5dc9d1[0x0],_0x4c4acd=_0x56f25b[_0x1e04d0(0x17c)];let _0x36d39d;try{if(_0x4c4acd)_0x36d39d=readSqlStatementsFromFile(_0x4c4acd);else{if(_0x4feca4==='-')_0x36d39d=await readSqlStatementsFromStdin();else{if(_0x4feca4&&isSqlFilePath(_0x4feca4))_0x36d39d=readSqlStatementsFromFile(_0x4feca4);else{if(_0x4feca4)_0x36d39d=splitSqlStatements(_0x4feca4);else throw new Error(_0x1e04d0(0x15e));}}}}catch(_0x51aaa2){return console[_0x1e04d0(0x16c)](_0x1e04d0(0x179)+_0x51aaa2[_0x1e04d0(0x18a)]),0x1;}const _0x456582=_0x56f25b[_0x1e04d0(0x17a)]||_0x1e04d0(0x183),_0x4e4097=_0x56f25b[_0x1e04d0(0x178)];try{const _0x2352d9=[],_0x906a21=!!_0x56f25b[_0x1e04d0(0x174)];for(let _0x547940=0x0;_0x547940<_0x36d39d[_0x1e04d0(0x171)];_0x547940++){const _0xd2a84f=_0x36d39d[_0x547940],_0x1f2521=_0x547940+0x1,_0x170d05=_0x36d39d[_0x1e04d0(0x171)],_0x3ec00e=_0x170d05>0x1;_0x56f25b[_0x1e04d0(0x169)]&&(console['error']('\x0a'+(_0x3ec00e?_0x1e04d0(0x15d)+_0x1f2521+'/'+_0x170d05+':':'')),console['error'](_0x1e04d0(0x184)+_0x56f25b[_0x1e04d0(0x166)]),console['error'](_0x1e04d0(0x187)+(_0x4e4097||'td')),console[_0x1e04d0(0x16c)](_0x1e04d0(0x162)+_0x456582),console[_0x1e04d0(0x16c)](_0x1e04d0(0x173)+_0xd2a84f));const _0x11c943=_0x3ec00e?'Executing\x20statement\x20'+_0x1f2521+'/'+_0x170d05+_0x1e04d0(0x16a):'Executing\x20query...';try{const _0x2bc8ee=await withProgressSpinner(_0x11c943,async _0x305fd8=>{const _0x3aa9b7=_0x1e04d0,_0x50bd6e=await _0xade52[_0x3aa9b7(0x188)][_0x3aa9b7(0x161)](_0xd2a84f,{'catalog':_0x4e4097,'schema':_0x456582,'onJobId':_0x4b36d2=>{_0x305fd8['setJobId'](_0x4b36d2);},'onProgress':_0x38c4dc=>{const _0x292fcf=_0x3aa9b7;_0x305fd8['setPhase'](_0x292fcf(0x186)+_0x38c4dc[_0x292fcf(0x185)]+']'),_0x305fd8[_0x292fcf(0x168)](formatRows(_0x38c4dc['processedRows'])+'\x20rows\x20'+_0x38c4dc[_0x292fcf(0x18c)]+'/'+_0x38c4dc['totalSplits']+_0x292fcf(0x170));}});return _0x50bd6e;},{'verbose':_0x56f25b['verbose']}),_0x4bfe91=_0x2bc8ee[_0x1e04d0(0x17f)],_0x47f177=_0x4bfe91[_0x1e04d0(0x17d)]?_0x1e04d0(0x160)+_0x4bfe91[_0x1e04d0(0x17d)]+']':'',_0x477cd8=_0x3ec00e?_0x1e04d0(0x15d)+_0x1f2521+'/'+_0x170d05+_0x1e04d0(0x17e):'';console['error']('✔\x20'+_0x477cd8+_0x1e04d0(0x189)+formatRows(_0x4bfe91['stats']['processedRows'])+'\x20rows\x20'+(_0x1e04d0(0x165)+formatElapsed(_0x4bfe91['stats']['elapsedTimeMillis'])+_0x47f177));if(_0x3ec00e&&_0x906a21){const _0x4635d0=resolveOutputOptions(_0x56f25b),_0x5c3a36=await formatQueryOutput(_0x4bfe91,_0x4635d0);_0x2352d9[_0x1e04d0(0x177)](_0x5c3a36);}else await handleQueryOutput(_0x4bfe91,_0x56f25b);}catch(_0x3d3348){const _0x2aea4a=_0x3ec00e?_0x1e04d0(0x15d)+_0x1f2521+'/'+_0x170d05+':\x0a':'',_0x3b3bd2=_0x3d3348 instanceof SDKError?_0x3d3348[_0x1e04d0(0x175)]:_0x3d3348[_0x1e04d0(0x18a)];return console['error'](''+_0x2aea4a+_0x3b3bd2),0x1;}}if(_0x36d39d[_0x1e04d0(0x171)]>0x1&&_0x906a21&&_0x2352d9[_0x1e04d0(0x171)]>0x0){const _0x54634a=_0x2352d9[_0x1e04d0(0x17b)]('\x0a');writeFileSync(_0x56f25b[_0x1e04d0(0x174)],_0x54634a),console[_0x1e04d0(0x16c)](_0x1e04d0(0x16f)+_0x56f25b[_0x1e04d0(0x174)]);}return 0x0;}catch(_0x5b1918){throw _0x5b1918;}}[a24_0x339bca(0x16d)](_0x5a9840){const _0x11d6db=a24_0x339bca,_0x3f67e2=_0x5a9840['args'][0x0],_0x470d12=_0x5a9840['options'][_0x11d6db(0x17c)];if(!_0x3f67e2&&!_0x470d12)return _0x11d6db(0x18b);if(_0x3f67e2&&_0x470d12)return _0x11d6db(0x163);return undefined;}}
1
+ const a24_0xafee6c=a24_0xba19;function a24_0x13a4(){const _0x34bf3e=['1098412bqKXys','site','state','Executing\x20query\x20[','6983019izbOOS','output','totalSplits','setJobId','message','length','10beTOqi','stats','...','19914059hhzaOt','5kvmNKd','\x20rows\x20','completedSplits','name','631716kferBt','Error:\x20','6dSKirj','catalog','SQL:\x20','processedRows','No\x20SQL\x20provided','\x20[Job\x20ID:\x20','elapsedTimeMillis','error','Executing\x20query...','args','execute','data','Schema:\x20','Catalog:\x20','query','options','Statement\x20','validate','in\x20','12014512FtFvuu','information_schema','database','\x20-\x20','2ApLksh','file','842463filcHV','Run\x20Trino\x20queries\x20(streaming)','5818127ZkKnAS','setExtra'];a24_0x13a4=function(){return _0x34bf3e;};return a24_0x13a4();}(function(_0xa6bc92,_0x4d22c3){const _0x84c1c7=a24_0xba19,_0x1fc108=_0xa6bc92();while(!![]){try{const _0x24277c=parseInt(_0x84c1c7(0xee))/0x1*(parseInt(_0x84c1c7(0x106))/0x2)+parseInt(_0x84c1c7(0xf0))/0x3+-parseInt(_0x84c1c7(0xf4))/0x4*(-parseInt(_0x84c1c7(0x102))/0x5)+-parseInt(_0x84c1c7(0x108))/0x6*(parseInt(_0x84c1c7(0xf2))/0x7)+parseInt(_0x84c1c7(0xea))/0x8+parseInt(_0x84c1c7(0xf8))/0x9+-parseInt(_0x84c1c7(0xfe))/0xa*(parseInt(_0x84c1c7(0x101))/0xb);if(_0x24277c===_0x4d22c3)break;else _0x1fc108['push'](_0x1fc108['shift']());}catch(_0x492bff){_0x1fc108['push'](_0x1fc108['shift']());}}}(a24_0x13a4,0xc9013));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';function a24_0xba19(_0x529ad1,_0x28d9bc){_0x529ad1=_0x529ad1-0xdc;const _0x13a4f0=a24_0x13a4();let _0xba19e4=_0x13a4f0[_0x529ad1];return _0xba19e4;}import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a24_0xafee6c(0x105)]=a24_0xafee6c(0xe5);['description']=a24_0xafee6c(0xf1);async[a24_0xafee6c(0xe1)](_0x2149ec){const _0x5098e8=a24_0xafee6c,{options:_0x22b08b,args:_0x5c477b,tdx:_0x2c34cb}=_0x2149ec,_0x712abd=_0x5c477b[0x0],_0xfcba14=_0x22b08b[_0x5098e8(0xef)];let _0xeadf8c;try{if(_0xfcba14)_0xeadf8c=readSqlStatementsFromFile(_0xfcba14);else{if(_0x712abd==='-')_0xeadf8c=await readSqlStatementsFromStdin();else{if(_0x712abd&&isSqlFilePath(_0x712abd))_0xeadf8c=readSqlStatementsFromFile(_0x712abd);else{if(_0x712abd)_0xeadf8c=splitSqlStatements(_0x712abd);else throw new Error(_0x5098e8(0x10c));}}}}catch(_0x51c911){return console['error'](_0x5098e8(0x107)+_0x51c911[_0x5098e8(0xfc)]),0x1;}const _0x1e39de=_0x22b08b[_0x5098e8(0xec)]||_0x5098e8(0xeb),_0x244aec=_0x22b08b[_0x5098e8(0x109)];try{const _0x239b00=[],_0x49d048=!!_0x22b08b[_0x5098e8(0xf9)];for(let _0x4ded98=0x0;_0x4ded98<_0xeadf8c[_0x5098e8(0xfd)];_0x4ded98++){const _0x41366f=_0xeadf8c[_0x4ded98],_0x475d2f=_0x4ded98+0x1,_0x19ff6d=_0xeadf8c[_0x5098e8(0xfd)],_0x21f6ff=_0x19ff6d>0x1;_0x22b08b['verbose']&&(console['error']('\x0a'+(_0x21f6ff?_0x5098e8(0xe7)+_0x475d2f+'/'+_0x19ff6d+':':'')),console[_0x5098e8(0xde)]('Site:\x20'+_0x22b08b[_0x5098e8(0xf5)]),console[_0x5098e8(0xde)](_0x5098e8(0xe4)+(_0x244aec||'td')),console[_0x5098e8(0xde)](_0x5098e8(0xe3)+_0x1e39de),console[_0x5098e8(0xde)](_0x5098e8(0x10a)+_0x41366f));const _0x5a5f8c=_0x21f6ff?'Executing\x20statement\x20'+_0x475d2f+'/'+_0x19ff6d+_0x5098e8(0x100):_0x5098e8(0xdf);try{const _0x7d990e=await withProgressSpinner(_0x5a5f8c,async _0x5b4676=>{const _0x158628=_0x5098e8,_0x16ff0c=await _0x2c34cb['query'][_0x158628(0xe1)](_0x41366f,{'catalog':_0x244aec,'schema':_0x1e39de,'onJobId':_0x3082e1=>{const _0x2fa51d=_0x158628;_0x5b4676[_0x2fa51d(0xfb)](_0x3082e1);},'onProgress':_0xc8a564=>{const _0x3734aa=_0x158628;_0x5b4676['setPhase'](_0x3734aa(0xf7)+_0xc8a564[_0x3734aa(0xf6)]+']'),_0x5b4676[_0x3734aa(0xf3)](formatRows(_0xc8a564[_0x3734aa(0x10b)])+_0x3734aa(0x103)+_0xc8a564[_0x3734aa(0x104)]+'/'+_0xc8a564[_0x3734aa(0xfa)]+'\x20splits');}});return _0x16ff0c;},{'verbose':_0x22b08b['verbose']}),_0x499428=_0x7d990e[_0x5098e8(0xe2)],_0x21719d=_0x499428['jobId']?_0x5098e8(0xdc)+_0x499428['jobId']+']':'',_0xd98b59=_0x21f6ff?'Statement\x20'+_0x475d2f+'/'+_0x19ff6d+_0x5098e8(0xed):'';console[_0x5098e8(0xde)]('✔\x20'+_0xd98b59+'Query\x20completed:\x20Processed\x20'+formatRows(_0x499428['stats'][_0x5098e8(0x10b)])+_0x5098e8(0x103)+(_0x5098e8(0xe9)+formatElapsed(_0x499428[_0x5098e8(0xff)][_0x5098e8(0xdd)])+_0x21719d));if(_0x21f6ff&&_0x49d048){const _0x1029a2=resolveOutputOptions(_0x22b08b),_0x190206=await formatQueryOutput(_0x499428,_0x1029a2);_0x239b00['push'](_0x190206);}else await handleQueryOutput(_0x499428,_0x22b08b);}catch(_0xa7f106){const _0x54ae6d=_0x21f6ff?_0x5098e8(0xe7)+_0x475d2f+'/'+_0x19ff6d+':\x0a':'',_0x13637a=_0xa7f106 instanceof SDKError?_0xa7f106['originalMessage']:_0xa7f106[_0x5098e8(0xfc)];return console['error'](''+_0x54ae6d+_0x13637a),0x1;}}if(_0xeadf8c[_0x5098e8(0xfd)]>0x1&&_0x49d048&&_0x239b00[_0x5098e8(0xfd)]>0x0){const _0x4f291a=_0x239b00['join']('\x0a');writeFileSync(_0x22b08b['output'],_0x4f291a),console['error']('\x0aAll\x20results\x20saved\x20to\x20'+_0x22b08b['output']);}return 0x0;}catch(_0x5e1f20){throw _0x5e1f20;}}[a24_0xafee6c(0xe8)](_0x4ae42f){const _0xac285b=a24_0xafee6c,_0x4bb30c=_0x4ae42f[_0xac285b(0xe0)][0x0],_0x29d801=_0x4ae42f[_0xac285b(0xe6)][_0xac285b(0xef)];if(!_0x4bb30c&&!_0x29d801)return'Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options';if(_0x4bb30c&&_0x29d801)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}