@treasuredata/tdx 0.8.7 → 0.8.8

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 (114) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/api-command.js +1 -1
  15. package/dist/commands/auth-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.d.ts.map +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-command.js.map +1 -1
  20. package/dist/commands/claude-statusline-command.js +1 -1
  21. package/dist/commands/claude-usage-command.js +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/context-command.js +1 -1
  25. package/dist/commands/databases.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/llm-proxy.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profiles-command.js +1 -1
  34. package/dist/commands/query-command.js +1 -1
  35. package/dist/commands/segment-command.js +1 -1
  36. package/dist/commands/segment-create-command.js +1 -1
  37. package/dist/commands/segment-fields-command.js +1 -1
  38. package/dist/commands/segment-pull-command.js +1 -1
  39. package/dist/commands/segment-push-command.js +1 -1
  40. package/dist/commands/segment-update-command.js +1 -1
  41. package/dist/commands/segment-use-command.js +1 -1
  42. package/dist/commands/segments.js +1 -1
  43. package/dist/commands/show.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/user-command.js +1 -1
  47. package/dist/commands/workflow-command.js +1 -1
  48. package/dist/core/auth.js +1 -1
  49. package/dist/core/config.js +1 -1
  50. package/dist/core/connection-cache.js +1 -1
  51. package/dist/core/credential-cache.js +1 -1
  52. package/dist/core/global-context.js +1 -1
  53. package/dist/core/keychain.js +1 -1
  54. package/dist/core/profile.js +1 -1
  55. package/dist/core/project-config.js +1 -1
  56. package/dist/core/session.js +1 -1
  57. package/dist/core/user-cache.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/proxy/anthropic-adapter.js +1 -1
  60. package/dist/proxy/claude-usage-tracker.js +1 -1
  61. package/dist/proxy/context-signature.js +1 -1
  62. package/dist/proxy/conversation-utils.js +1 -1
  63. package/dist/proxy/server.js +1 -1
  64. package/dist/proxy/session-cache.js +1 -1
  65. package/dist/sdk/api.js +1 -1
  66. package/dist/sdk/connection.js +1 -1
  67. package/dist/sdk/engage.js +1 -1
  68. package/dist/sdk/errors.js +1 -1
  69. package/dist/sdk/index.js +1 -1
  70. package/dist/sdk/job.js +1 -1
  71. package/dist/sdk/journey.js +1 -1
  72. package/dist/sdk/llm.js +1 -1
  73. package/dist/sdk/query.js +1 -1
  74. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  75. package/dist/sdk/segment/journey-yaml.js +1 -1
  76. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  77. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  78. package/dist/sdk/segment.js +1 -1
  79. package/dist/sdk/user.js +1 -1
  80. package/dist/sdk/workflow.js +1 -1
  81. package/dist/types/endpoints.js +1 -1
  82. package/dist/types/index.js +1 -1
  83. package/dist/utils/agent-ref-parser.js +1 -1
  84. package/dist/utils/async.js +1 -1
  85. package/dist/utils/chat-cache.js +1 -1
  86. package/dist/utils/colors.js +1 -1
  87. package/dist/utils/command-output.js +1 -1
  88. package/dist/utils/constants.js +1 -1
  89. package/dist/utils/diff.js +1 -1
  90. package/dist/utils/fields-display.js +1 -1
  91. package/dist/utils/file-permissions.js +1 -1
  92. package/dist/utils/format-detector.js +1 -1
  93. package/dist/utils/formatters.js +1 -1
  94. package/dist/utils/json-loader.js +1 -1
  95. package/dist/utils/llm-backup-utils.js +1 -1
  96. package/dist/utils/model-aliases.js +1 -1
  97. package/dist/utils/model-factors.js +1 -1
  98. package/dist/utils/option-validation.js +1 -1
  99. package/dist/utils/port.js +1 -1
  100. package/dist/utils/process.js +1 -1
  101. package/dist/utils/prompt.js +1 -1
  102. package/dist/utils/segment-path-parser.js +1 -1
  103. package/dist/utils/segment-ref-parser.js +1 -1
  104. package/dist/utils/spinner.js +1 -1
  105. package/dist/utils/sql-parser.js +1 -1
  106. package/dist/utils/sse-parser.js +1 -1
  107. package/dist/utils/string-utils.js +1 -1
  108. package/dist/utils/table-ref-parser.js +1 -1
  109. package/dist/utils/tdx-config.js +1 -1
  110. package/dist/utils/tdx-logger.js +1 -1
  111. package/dist/utils/tree-formatter.js +1 -1
  112. package/dist/utils/version-check.js +1 -1
  113. package/dist/utils/workflow-utils.js +1 -1
  114. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x413528,_0x34d5cc){const _0x4b6fad=a73_0x52f2,_0x33a162=_0x413528();while(!![]){try{const _0x75a950=-parseInt(_0x4b6fad(0x1b5))/0x1+parseInt(_0x4b6fad(0x15a))/0x2+parseInt(_0x4b6fad(0x1aa))/0x3+parseInt(_0x4b6fad(0x17f))/0x4*(parseInt(_0x4b6fad(0x16d))/0x5)+-parseInt(_0x4b6fad(0x19e))/0x6+parseInt(_0x4b6fad(0x179))/0x7*(-parseInt(_0x4b6fad(0x190))/0x8)+-parseInt(_0x4b6fad(0x177))/0x9;if(_0x75a950===_0x34d5cc)break;else _0x33a162['push'](_0x33a162['shift']());}catch(_0x3d7c89){_0x33a162['push'](_0x33a162['shift']());}}}(a73_0x443d,0xc2842));import*as a73_0x465a5e from'yaml';function formatScheduleTime(_0x75272){const _0x4c6ff8=a73_0x52f2;if(typeof _0x75272===_0x4c6ff8(0x167)){const _0x25d6c9=Math[_0x4c6ff8(0x184)](_0x75272);return String(_0x25d6c9)[_0x4c6ff8(0x15d)](0x2,'0')+_0x4c6ff8(0x164);}if(typeof _0x75272===_0x4c6ff8(0x159)){if(/^\d{2}:\d{2}:\d{2}$/[_0x4c6ff8(0x16c)](_0x75272))return _0x75272;if(/^\d{1,2}:\d{2}$/[_0x4c6ff8(0x16c)](_0x75272)){const [_0x2201d7,_0xf7d50d]=_0x75272[_0x4c6ff8(0x1a9)](':');return _0x2201d7[_0x4c6ff8(0x15d)](0x2,'0')+':'+_0xf7d50d+_0x4c6ff8(0x1a2);}const _0x2d36d5=parseInt(_0x75272,0xa);if(!isNaN(_0x2d36d5)&&_0x75272[_0x4c6ff8(0x18e)](/^\d+$/))return String(_0x2d36d5)[_0x4c6ff8(0x15d)](0x2,'0')+_0x4c6ff8(0x164);return _0x75272;}return String(_0x75272);}export function apiToYaml(_0x533b89){const _0xa0b9fe=a73_0x52f2,_0x180dbf={'database':_0x533b89[_0xa0b9fe(0x15b)]?.[_0xa0b9fe(0x160)]||'','table':_0x533b89[_0xa0b9fe(0x15b)]?.['parentTableName']||''};_0x533b89[_0xa0b9fe(0x174)]&&_0x533b89[_0xa0b9fe(0x174)][_0xa0b9fe(0x189)]>0x0&&(_0x180dbf[_0xa0b9fe(0x15f)]=_0x533b89[_0xa0b9fe(0x174)][_0xa0b9fe(0x175)](_0x197993=>({'column':_0x197993[_0xa0b9fe(0x1a6)],'values':_0x197993[_0xa0b9fe(0x1ad)]})));let _0x164c68;_0x533b89[_0xa0b9fe(0x191)]&&_0x533b89[_0xa0b9fe(0x191)]!==_0xa0b9fe(0x1a0)&&(_0x164c68={'type':_0x533b89['scheduleType']},_0x533b89[_0xa0b9fe(0x180)]&&(_0x164c68[_0xa0b9fe(0x185)]=formatScheduleTime(_0x533b89['scheduleOption'])),_0x533b89[_0xa0b9fe(0x19b)]&&(_0x164c68[_0xa0b9fe(0x19b)]=_0x533b89['timezone']));let _0x28b31b;(_0x533b89[_0xa0b9fe(0x193)]||_0x533b89[_0xa0b9fe(0x188)]||_0x533b89[_0xa0b9fe(0x16a)])&&(_0x28b31b={},_0x533b89['workflowHiveOnly']&&(_0x28b31b['hive_only']=_0x533b89[_0xa0b9fe(0x193)]),_0x533b89[_0xa0b9fe(0x188)]&&(_0x28b31b['hive_pool']=_0x533b89[_0xa0b9fe(0x188)]),_0x533b89[_0xa0b9fe(0x16a)]&&(_0x28b31b['trino_pool']=_0x533b89[_0xa0b9fe(0x16a)]));const _0x5bcd50=_0x533b89['attributes']&&_0x533b89['attributes'][_0xa0b9fe(0x189)]>0x0?groupAttributesBySource(_0x533b89[_0xa0b9fe(0x199)]):undefined,_0x1755a9=_0x533b89['behaviors']&&_0x533b89['behaviors'][_0xa0b9fe(0x189)]>0x0?_0x533b89[_0xa0b9fe(0x15c)][_0xa0b9fe(0x175)](convertApiBehaviorToYaml):undefined;let _0x43365f;_0x533b89['customerGroup']&&(_0x43365f={'name':_0x533b89[_0xa0b9fe(0x15e)][_0xa0b9fe(0x1b2)],'source':{'database':_0x533b89[_0xa0b9fe(0x15e)][_0xa0b9fe(0x160)],'table':_0x533b89[_0xa0b9fe(0x15e)][_0xa0b9fe(0x17b)]},'join':{'parent_key':_0x533b89[_0xa0b9fe(0x15e)][_0xa0b9fe(0x1af)],'child_key':_0x533b89[_0xa0b9fe(0x15e)][_0xa0b9fe(0x176)]}},_0x533b89[_0xa0b9fe(0x15e)][_0xa0b9fe(0x181)]&&_0x533b89[_0xa0b9fe(0x15e)][_0xa0b9fe(0x181)][_0xa0b9fe(0x189)]>0x0&&(_0x43365f[_0xa0b9fe(0x199)]=groupAttributesBySource(_0x533b89[_0xa0b9fe(0x15e)][_0xa0b9fe(0x181)])),_0x533b89[_0xa0b9fe(0x15e)][_0xa0b9fe(0x18b)]&&_0x533b89[_0xa0b9fe(0x15e)][_0xa0b9fe(0x18b)][_0xa0b9fe(0x189)]>0x0&&(_0x43365f[_0xa0b9fe(0x15c)]=_0x533b89[_0xa0b9fe(0x15e)][_0xa0b9fe(0x18b)][_0xa0b9fe(0x175)](convertApiBehaviorToYaml)));const _0x2a1c17={'name':_0x533b89[_0xa0b9fe(0x1b2)],..._0x533b89[_0xa0b9fe(0x166)]&&{'description':_0x533b89[_0xa0b9fe(0x166)]},'master':_0x180dbf,..._0x164c68&&{'schedule':_0x164c68},..._0x28b31b&&{'engine':_0x28b31b},..._0x5bcd50&&{'attributes':_0x5bcd50},..._0x1755a9&&{'behaviors':_0x1755a9},..._0x43365f&&{'customer_group':_0x43365f}};return _0x2a1c17;}function groupAttributesBySource(_0xa85baa){const _0x22bb4d=a73_0x52f2,_0x372a53=new Map();for(const _0x2ea1bc of _0xa85baa){const _0x33d3ce=_0x2ea1bc[_0x22bb4d(0x160)]+'.'+_0x2ea1bc[_0x22bb4d(0x17b)]+'.'+_0x2ea1bc['parentKey']+'.'+_0x2ea1bc[_0x22bb4d(0x176)];!_0x372a53['has'](_0x33d3ce)&&_0x372a53[_0x22bb4d(0x1ab)](_0x33d3ce,[]),_0x372a53[_0x22bb4d(0x171)](_0x33d3ce)[_0x22bb4d(0x19d)](_0x2ea1bc);}const _0x52f8a9=[];for(const [,_0xca85fa]of _0x372a53){const _0x20fb2e=_0xca85fa[0x0],_0x42a454=_0x20fb2e[_0x22bb4d(0x170)]||_0x20fb2e[_0x22bb4d(0x17b)];_0x52f8a9[_0x22bb4d(0x19d)]({'name':_0x42a454,'source':{'database':_0x20fb2e[_0x22bb4d(0x160)],'table':_0x20fb2e[_0x22bb4d(0x17b)]},'join':{'parent_key':_0x20fb2e[_0x22bb4d(0x1af)],'child_key':_0x20fb2e[_0x22bb4d(0x176)]},'columns':_0xca85fa[_0x22bb4d(0x175)](_0x15db58=>{const _0x14f935=_0x22bb4d,_0x20be1b={'column':_0x15db58[_0x14f935(0x17a)],'type':_0x15db58['type']};return _0x15db58[_0x14f935(0x1b2)]!==_0x15db58[_0x14f935(0x17a)]&&(_0x20be1b[_0x14f935(0x18d)]=_0x15db58['name']),_0x20be1b;})});}return _0x52f8a9;}function convertApiBehaviorToYaml(_0xaef99){const _0x35f464=a73_0x52f2,_0x2eae57={'name':_0xaef99['name'],'source':{'database':_0xaef99[_0x35f464(0x160)],'table':_0xaef99[_0x35f464(0x17b)]},'join':{'parent_key':_0xaef99[_0x35f464(0x1af)],'child_key':_0xaef99[_0x35f464(0x176)]}};if(_0xaef99[_0x35f464(0x158)])_0x2eae57[_0x35f464(0x16e)]=!![];else _0xaef99['schema']&&_0xaef99[_0x35f464(0x1b1)]['length']>0x0&&(_0x2eae57[_0x35f464(0x1a7)]=_0xaef99[_0x35f464(0x1b1)][_0x35f464(0x175)](_0x456965=>{const _0x3c8033=_0x35f464,_0x15f386={'column':_0x456965[_0x3c8033(0x17a)],'type':_0x456965[_0x3c8033(0x16b)]};return _0x456965[_0x3c8033(0x1b2)]!==_0x456965[_0x3c8033(0x17a)]&&(_0x15f386['label']=_0x456965[_0x3c8033(0x1b2)]),_0x15f386;}));return _0xaef99[_0x35f464(0x19f)]&&(_0x2eae57['default_time_filter']=_0xaef99[_0x35f464(0x19f)]),_0xaef99[_0x35f464(0x163)]&&(_0x2eae57[_0x35f464(0x1a3)]=_0xaef99[_0x35f464(0x163)]),_0x2eae57;}export function yamlToApi(_0x38598c){const _0x246542=a73_0x52f2,_0x6ab786={'name':_0x38598c[_0x246542(0x1b2)],'master':{'parentDatabaseName':_0x38598c[_0x246542(0x15b)][_0x246542(0x1ae)],'parentTableName':_0x38598c[_0x246542(0x15b)][_0x246542(0x186)]}};_0x38598c['description']&&(_0x6ab786[_0x246542(0x166)]=_0x38598c['description']);_0x38598c[_0x246542(0x15b)][_0x246542(0x15f)]&&_0x38598c[_0x246542(0x15b)]['filters']['length']>0x0&&(_0x6ab786[_0x246542(0x174)]=_0x38598c['master'][_0x246542(0x15f)][_0x246542(0x175)](_0x25605b=>({'columnName':_0x25605b[_0x246542(0x172)],'rightValues':_0x25605b[_0x246542(0x195)]})));_0x38598c[_0x246542(0x1b4)]&&(_0x6ab786[_0x246542(0x191)]=_0x38598c[_0x246542(0x1b4)][_0x246542(0x16b)],_0x38598c[_0x246542(0x1b4)][_0x246542(0x185)]&&(_0x6ab786[_0x246542(0x180)]=_0x38598c['schedule'][_0x246542(0x185)]),_0x38598c[_0x246542(0x1b4)][_0x246542(0x19b)]&&(_0x6ab786['timezone']=_0x38598c[_0x246542(0x1b4)]['timezone']));_0x38598c['engine']&&(_0x38598c[_0x246542(0x178)][_0x246542(0x1b0)]!==undefined&&(_0x6ab786[_0x246542(0x193)]=_0x38598c[_0x246542(0x178)][_0x246542(0x1b0)]),_0x38598c['engine'][_0x246542(0x194)]!==undefined&&(_0x6ab786[_0x246542(0x188)]=_0x38598c[_0x246542(0x178)]['hive_pool']),_0x38598c[_0x246542(0x178)]['trino_pool']!==undefined&&(_0x6ab786[_0x246542(0x16a)]=_0x38598c['engine'][_0x246542(0x165)]));_0x38598c[_0x246542(0x199)]&&_0x38598c[_0x246542(0x199)][_0x246542(0x189)]>0x0&&(_0x6ab786[_0x246542(0x199)]=flattenAttributeGroups(_0x38598c['attributes']));_0x38598c[_0x246542(0x15c)]&&_0x38598c['behaviors'][_0x246542(0x189)]>0x0&&(_0x6ab786[_0x246542(0x15c)]=_0x38598c['behaviors'][_0x246542(0x175)](convertYamlBehaviorToApi));if(_0x38598c['customer_group']){const _0x1c283b=_0x38598c[_0x246542(0x19a)];_0x6ab786[_0x246542(0x15e)]={'name':_0x1c283b[_0x246542(0x1b2)],'parentDatabaseName':_0x1c283b['source']['database'],'parentTableName':_0x1c283b[_0x246542(0x183)][_0x246542(0x186)],'parentKey':_0x1c283b[_0x246542(0x1a8)][_0x246542(0x182)],'foreignKey':_0x1c283b[_0x246542(0x1a8)]['child_key']},_0x1c283b['attributes']&&_0x1c283b[_0x246542(0x199)][_0x246542(0x189)]>0x0&&(_0x6ab786[_0x246542(0x15e)][_0x246542(0x181)]=flattenAttributeGroups(_0x1c283b[_0x246542(0x199)])[_0x246542(0x175)](_0x3be1c2=>({'name':_0x3be1c2[_0x246542(0x1b2)],'type':_0x3be1c2[_0x246542(0x16b)],'parentDatabaseName':_0x3be1c2[_0x246542(0x160)],'parentTableName':_0x3be1c2[_0x246542(0x17b)],'parentColumn':_0x3be1c2['parentColumn'],'parentKey':_0x3be1c2[_0x246542(0x1af)],'foreignKey':_0x3be1c2[_0x246542(0x176)]}))),_0x1c283b[_0x246542(0x15c)]&&_0x1c283b[_0x246542(0x15c)][_0x246542(0x189)]>0x0&&(_0x6ab786[_0x246542(0x15e)][_0x246542(0x18b)]=_0x1c283b[_0x246542(0x15c)][_0x246542(0x175)](_0x24ba3b=>({'name':_0x24ba3b[_0x246542(0x1b2)],'parentDatabaseName':_0x24ba3b['source']['database'],'parentTableName':_0x24ba3b[_0x246542(0x183)][_0x246542(0x186)],'parentKey':_0x24ba3b[_0x246542(0x1a8)][_0x246542(0x182)],'foreignKey':_0x24ba3b[_0x246542(0x1a8)][_0x246542(0x17d)],'allColumns':_0x24ba3b[_0x246542(0x16e)],'schema':_0x24ba3b['columns']?.[_0x246542(0x175)](_0x3380f3=>({'name':_0x3380f3[_0x246542(0x18d)]||_0x3380f3[_0x246542(0x172)],'type':_0x3380f3['type'],'parentColumn':_0x3380f3[_0x246542(0x172)]}))})));}return _0x6ab786;}function flattenAttributeGroups(_0x12cb4e){const _0x1b3777=a73_0x52f2,_0x253859=[];for(const _0xf7e61c of _0x12cb4e){for(const _0x52b71b of _0xf7e61c['columns']){_0x253859[_0x1b3777(0x19d)]({'name':_0x52b71b[_0x1b3777(0x18d)]||_0x52b71b['column'],'type':_0x52b71b[_0x1b3777(0x16b)],'parentDatabaseName':_0xf7e61c['source'][_0x1b3777(0x1ae)],'parentTableName':_0xf7e61c['source'][_0x1b3777(0x186)],'parentColumn':_0x52b71b[_0x1b3777(0x172)],'parentKey':_0xf7e61c['join'][_0x1b3777(0x182)],'foreignKey':_0xf7e61c[_0x1b3777(0x1a8)]['child_key'],'groupingName':_0xf7e61c['name']});}}return _0x253859;}function convertYamlBehaviorToApi(_0x27b0f1){const _0x15a14f=a73_0x52f2,_0x1222a5={'name':_0x27b0f1['name'],'parentDatabaseName':_0x27b0f1['source'][_0x15a14f(0x1ae)],'parentTableName':_0x27b0f1[_0x15a14f(0x183)]['table'],'parentKey':_0x27b0f1['join']['parent_key'],'foreignKey':_0x27b0f1[_0x15a14f(0x1a8)][_0x15a14f(0x17d)]};if(_0x27b0f1['all_columns'])_0x1222a5[_0x15a14f(0x158)]=!![];else _0x27b0f1['columns']&&_0x27b0f1[_0x15a14f(0x1a7)][_0x15a14f(0x189)]>0x0&&(_0x1222a5[_0x15a14f(0x1b1)]=_0x27b0f1['columns']['map'](_0x212b66=>({'name':_0x212b66[_0x15a14f(0x18d)]||_0x212b66['column'],'type':_0x212b66[_0x15a14f(0x16b)],'parentColumn':_0x212b66[_0x15a14f(0x172)]})));return _0x27b0f1['default_time_filter']!==undefined&&(_0x1222a5[_0x15a14f(0x19f)]=_0x27b0f1[_0x15a14f(0x16f)]),_0x27b0f1['realtime']!==undefined&&(_0x1222a5['isRealtime']=_0x27b0f1[_0x15a14f(0x1a3)]),_0x1222a5;}export function toYamlString(_0x2fecef){const _0xfc3fcf=a73_0x52f2,_0x3f6dc6=JSON['parse'](JSON[_0xfc3fcf(0x192)](_0x2fecef)),_0x318b1=a73_0x465a5e[_0xfc3fcf(0x192)](_0x3f6dc6,{'indent':0x2,'lineWidth':0x0,'nullStr':_0xfc3fcf(0x1a4)}),_0x29465e=['master:',_0xfc3fcf(0x1a5),_0xfc3fcf(0x1b3),_0xfc3fcf(0x19c),_0xfc3fcf(0x198),_0xfc3fcf(0x187)];let _0x2af90e=_0x318b1;for(const _0x218884 of _0x29465e){_0x2af90e=_0x2af90e['replace'](new RegExp('^('+_0x218884+')','m'),(_0x22722f,_0x40f3ab,_0x3c2a86)=>{if(_0x3c2a86===0x0||_0x2af90e[_0x3c2a86-0x1]==='\x0a'&&_0x2af90e[_0x3c2a86-0x2]==='\x0a')return _0x40f3ab;return'\x0a'+_0x40f3ab;});}return _0x2af90e;}function a73_0x52f2(_0x4748ca,_0x317745){_0x4748ca=_0x4748ca-0x158;const _0x443d82=a73_0x443d();let _0x52f23e=_0x443d82[_0x4748ca];return _0x52f23e;}function a73_0x443d(){const _0x2ce577=['timezone','attributes:','push','8449350TbAxED','defaultTimeFilterEnabled','none','YAML\x20config\x20missing\x20required\x20field:\x20master.table',':00','realtime','null','schedule:','columnName','columns','join','split','4779378oOdMTr','set','events_table','rightValues','database','parentKey','hive_only','schema','name','engine:','schedule','301767nlrgZr','allColumns','string','454352AKSquy','master','behaviors','padStart','customerGroup','filters','parentDatabaseName','parse','user_id','isRealtime',':00:00','trino_pool','description','number','Parent\x20segment\x20description','UTC','prestoPoolName','type','test','5GYeMer','all_columns','default_time_filter','groupingName','get','column','03:00','audienceFilters','map','foreignKey','375129mWAPwb','engine','1245671rRmljr','parentColumn','parentTableName','YAML\x20config\x20missing\x20required\x20field:\x20name','child_key','attribute_table','3624248mPvTao','scheduleOption','customerGroupAttributes','parent_key','source','floor','time','table','customer_group:','hivePoolName','length','YAML\x20config\x20missing\x20required\x20field:\x20master','customerGroupBehaviors','YAML\x20config\x20missing\x20required\x20field:\x20master.database','label','match','customer_id','8aFbypc','scheduleType','stringify','workflowHiveOnly','hive_pool','values','Example\x20Attributes','Display\x20Name','behaviors:','attributes','customer_group'];a73_0x443d=function(){return _0x2ce577;};return a73_0x443d();}export function parseYamlString(_0x2cb31f){const _0x1decd9=a73_0x52f2,_0x7f8dc6=a73_0x465a5e[_0x1decd9(0x161)](_0x2cb31f);if(!_0x7f8dc6[_0x1decd9(0x1b2)])throw new Error(_0x1decd9(0x17c));if(!_0x7f8dc6[_0x1decd9(0x15b)])throw new Error(_0x1decd9(0x18a));if(!_0x7f8dc6[_0x1decd9(0x15b)][_0x1decd9(0x1ae)])throw new Error(_0x1decd9(0x18c));if(!_0x7f8dc6[_0x1decd9(0x15b)][_0x1decd9(0x186)])throw new Error(_0x1decd9(0x1a1));return _0x7f8dc6;}export function generateTemplate(_0x128c70,_0x5935d4,_0x117ce5){const _0x5b7888=a73_0x52f2,_0x5a17e0={'name':_0x128c70,'description':_0x5b7888(0x168),'master':{'database':_0x5935d4,'table':_0x117ce5},'schedule':{'type':'daily','time':_0x5b7888(0x173),'timezone':_0x5b7888(0x169)},'attributes':[{'name':_0x5b7888(0x196),'source':{'database':_0x5935d4,'table':_0x5b7888(0x17e)},'join':{'parent_key':'id','child_key':_0x5b7888(0x18f)},'columns':[{'column':'column_name','label':_0x5b7888(0x197),'type':'string'}]}],'behaviors':[{'name':'Example\x20Events','source':{'database':_0x5935d4,'table':_0x5b7888(0x1ac)},'join':{'parent_key':_0x5b7888(0x162),'child_key':'customer_id'},'all_columns':!![]}]};return toYamlString(_0x5a17e0);}
1
+ (function(_0x2f97c7,_0xe044bf){const _0x104e58=a73_0x27c9,_0x574223=_0x2f97c7();while(!![]){try{const _0x24b82b=parseInt(_0x104e58(0x19e))/0x1+-parseInt(_0x104e58(0x17a))/0x2+parseInt(_0x104e58(0x1b0))/0x3*(-parseInt(_0x104e58(0x1a0))/0x4)+-parseInt(_0x104e58(0x18f))/0x5+-parseInt(_0x104e58(0x1cb))/0x6*(parseInt(_0x104e58(0x1a4))/0x7)+-parseInt(_0x104e58(0x18d))/0x8*(-parseInt(_0x104e58(0x17c))/0x9)+parseInt(_0x104e58(0x195))/0xa;if(_0x24b82b===_0xe044bf)break;else _0x574223['push'](_0x574223['shift']());}catch(_0x599ce6){_0x574223['push'](_0x574223['shift']());}}}(a73_0xe70a,0xec135));import*as a73_0x5bfe6e from'yaml';function formatScheduleTime(_0x57466b){const _0x5d5d00=a73_0x27c9;if(typeof _0x57466b==='number'){const _0x450078=Math[_0x5d5d00(0x1b7)](_0x57466b);return String(_0x450078)[_0x5d5d00(0x1b9)](0x2,'0')+_0x5d5d00(0x1a6);}if(typeof _0x57466b===_0x5d5d00(0x1b4)){if(/^\d{2}:\d{2}:\d{2}$/[_0x5d5d00(0x1c5)](_0x57466b))return _0x57466b;if(/^\d{1,2}:\d{2}$/[_0x5d5d00(0x1c5)](_0x57466b)){const [_0x260148,_0x3a0fc4]=_0x57466b['split'](':');return _0x260148[_0x5d5d00(0x1b9)](0x2,'0')+':'+_0x3a0fc4+':00';}const _0x12c291=parseInt(_0x57466b,0xa);if(!isNaN(_0x12c291)&&_0x57466b[_0x5d5d00(0x17f)](/^\d+$/))return String(_0x12c291)[_0x5d5d00(0x1b9)](0x2,'0')+_0x5d5d00(0x1a6);return _0x57466b;}return String(_0x57466b);}export function apiToYaml(_0x4b0c31){const _0x2baad1=a73_0x27c9,_0x45c1c8={'database':_0x4b0c31[_0x2baad1(0x19a)]?.[_0x2baad1(0x17b)]||'','table':_0x4b0c31[_0x2baad1(0x19a)]?.[_0x2baad1(0x18e)]||''};_0x4b0c31['audienceFilters']&&_0x4b0c31[_0x2baad1(0x179)][_0x2baad1(0x1ab)]>0x0&&(_0x45c1c8[_0x2baad1(0x189)]=_0x4b0c31[_0x2baad1(0x179)][_0x2baad1(0x1c2)](_0x1c4fed=>({'column':_0x1c4fed[_0x2baad1(0x1cd)],'values':_0x1c4fed['rightValues']})));let _0x13bbc6;_0x4b0c31[_0x2baad1(0x191)]&&_0x4b0c31[_0x2baad1(0x191)]!==_0x2baad1(0x1ca)&&(_0x13bbc6={'type':_0x4b0c31['scheduleType']},_0x4b0c31[_0x2baad1(0x193)]&&(_0x13bbc6['time']=formatScheduleTime(_0x4b0c31[_0x2baad1(0x193)])),_0x4b0c31['timezone']&&(_0x13bbc6[_0x2baad1(0x192)]=_0x4b0c31[_0x2baad1(0x192)]));let _0x2b3648;(_0x4b0c31[_0x2baad1(0x190)]||_0x4b0c31[_0x2baad1(0x181)]||_0x4b0c31[_0x2baad1(0x1ce)])&&(_0x2b3648={},_0x4b0c31['workflowHiveOnly']&&(_0x2b3648['hive_only']=_0x4b0c31['workflowHiveOnly']),_0x4b0c31['hivePoolName']&&(_0x2b3648['hive_pool']=_0x4b0c31['hivePoolName']),_0x4b0c31['prestoPoolName']&&(_0x2b3648[_0x2baad1(0x1c1)]=_0x4b0c31[_0x2baad1(0x1ce)]));const _0x15ad63=_0x4b0c31[_0x2baad1(0x194)]&&_0x4b0c31[_0x2baad1(0x194)][_0x2baad1(0x1ab)]>0x0?groupAttributesBySource(_0x4b0c31[_0x2baad1(0x194)]):undefined,_0x4b7849=_0x4b0c31[_0x2baad1(0x17e)]&&_0x4b0c31[_0x2baad1(0x17e)][_0x2baad1(0x1ab)]>0x0?_0x4b0c31[_0x2baad1(0x17e)][_0x2baad1(0x1c2)](convertApiBehaviorToYaml):undefined;let _0xdfbeeb;_0x4b0c31[_0x2baad1(0x1c6)]&&(_0xdfbeeb={'name':_0x4b0c31['customerGroup'][_0x2baad1(0x1a7)],'source':{'database':_0x4b0c31['customerGroup'][_0x2baad1(0x17b)],'table':_0x4b0c31[_0x2baad1(0x1c6)][_0x2baad1(0x18e)]},'join':{'parent_key':_0x4b0c31[_0x2baad1(0x1c6)]['parentKey'],'child_key':_0x4b0c31['customerGroup'][_0x2baad1(0x184)]}},_0x4b0c31[_0x2baad1(0x1c6)]['customerGroupAttributes']&&_0x4b0c31[_0x2baad1(0x1c6)][_0x2baad1(0x1ac)]['length']>0x0&&(_0xdfbeeb[_0x2baad1(0x194)]=groupAttributesBySource(_0x4b0c31[_0x2baad1(0x1c6)][_0x2baad1(0x1ac)])),_0x4b0c31[_0x2baad1(0x1c6)][_0x2baad1(0x18b)]&&_0x4b0c31[_0x2baad1(0x1c6)][_0x2baad1(0x18b)][_0x2baad1(0x1ab)]>0x0&&(_0xdfbeeb['behaviors']=_0x4b0c31[_0x2baad1(0x1c6)][_0x2baad1(0x18b)]['map'](convertApiBehaviorToYaml)));const _0x27f004={'name':_0x4b0c31['name'],..._0x4b0c31[_0x2baad1(0x1b6)]&&{'description':_0x4b0c31[_0x2baad1(0x1b6)]},'master':_0x45c1c8,..._0x13bbc6&&{'schedule':_0x13bbc6},..._0x2b3648&&{'engine':_0x2b3648},..._0x15ad63&&{'attributes':_0x15ad63},..._0x4b7849&&{'behaviors':_0x4b7849},..._0xdfbeeb&&{'customer_group':_0xdfbeeb}};return _0x27f004;}function groupAttributesBySource(_0x97f039){const _0x151ba6=a73_0x27c9,_0x52f78d=new Map();for(const _0x225708 of _0x97f039){const _0x143ab1=_0x225708['parentDatabaseName']+'.'+_0x225708[_0x151ba6(0x18e)]+'.'+_0x225708[_0x151ba6(0x182)]+'.'+_0x225708[_0x151ba6(0x184)];!_0x52f78d[_0x151ba6(0x18a)](_0x143ab1)&&_0x52f78d[_0x151ba6(0x19d)](_0x143ab1,[]),_0x52f78d['get'](_0x143ab1)['push'](_0x225708);}const _0x218546=[];for(const [,_0xaf9ef7]of _0x52f78d){const _0x2e14c2=_0xaf9ef7[0x0],_0x3b6f1b=_0x2e14c2[_0x151ba6(0x197)]||_0x2e14c2[_0x151ba6(0x18e)];_0x218546[_0x151ba6(0x1bd)]({'name':_0x3b6f1b,'source':{'database':_0x2e14c2['parentDatabaseName'],'table':_0x2e14c2[_0x151ba6(0x18e)]},'join':{'parent_key':_0x2e14c2[_0x151ba6(0x182)],'child_key':_0x2e14c2[_0x151ba6(0x184)]},'columns':_0xaf9ef7[_0x151ba6(0x1c2)](_0x36baa1=>{const _0x3247b1=_0x151ba6,_0x256e2e={'column':_0x36baa1[_0x3247b1(0x1a2)],'type':_0x36baa1[_0x3247b1(0x1a8)]};return _0x36baa1[_0x3247b1(0x1a7)]!==_0x36baa1[_0x3247b1(0x1a2)]&&(_0x256e2e[_0x3247b1(0x1a1)]=_0x36baa1[_0x3247b1(0x1a7)]),_0x256e2e;})});}return _0x218546;}function convertApiBehaviorToYaml(_0x48af62){const _0x18408d=a73_0x27c9,_0x33ed8c={'name':_0x48af62[_0x18408d(0x1a7)],'source':{'database':_0x48af62[_0x18408d(0x17b)],'table':_0x48af62[_0x18408d(0x18e)]},'join':{'parent_key':_0x48af62['parentKey'],'child_key':_0x48af62[_0x18408d(0x184)]}};if(_0x48af62['allColumns'])_0x33ed8c[_0x18408d(0x19b)]=!![];else _0x48af62['schema']&&_0x48af62[_0x18408d(0x1c4)][_0x18408d(0x1ab)]>0x0&&(_0x33ed8c[_0x18408d(0x1af)]=_0x48af62[_0x18408d(0x1c4)][_0x18408d(0x1c2)](_0x258b90=>{const _0x164684=_0x18408d,_0x4e1438={'column':_0x258b90[_0x164684(0x1a2)],'type':_0x258b90[_0x164684(0x1a8)]};return _0x258b90[_0x164684(0x1a7)]!==_0x258b90[_0x164684(0x1a2)]&&(_0x4e1438[_0x164684(0x1a1)]=_0x258b90['name']),_0x4e1438;}));return _0x48af62[_0x18408d(0x1c9)]&&(_0x33ed8c[_0x18408d(0x1aa)]=_0x48af62['defaultTimeFilterEnabled']),_0x48af62[_0x18408d(0x1b8)]&&(_0x33ed8c['realtime']=_0x48af62['isRealtime']),_0x33ed8c;}export function yamlToApi(_0x360d77){const _0x29357b=a73_0x27c9,_0xab84f3={'name':_0x360d77[_0x29357b(0x1a7)],'master':{'parentDatabaseName':_0x360d77[_0x29357b(0x19a)][_0x29357b(0x1b2)],'parentTableName':_0x360d77[_0x29357b(0x19a)]['table']}};_0x360d77[_0x29357b(0x1b6)]&&(_0xab84f3[_0x29357b(0x1b6)]=_0x360d77[_0x29357b(0x1b6)]);_0x360d77[_0x29357b(0x19a)]['filters']&&_0x360d77[_0x29357b(0x19a)][_0x29357b(0x189)][_0x29357b(0x1ab)]>0x0&&(_0xab84f3[_0x29357b(0x179)]=_0x360d77[_0x29357b(0x19a)]['filters'][_0x29357b(0x1c2)](_0x276f61=>({'columnName':_0x276f61[_0x29357b(0x1cc)],'rightValues':_0x276f61[_0x29357b(0x1cf)]})));_0x360d77[_0x29357b(0x17d)]&&(_0xab84f3['scheduleType']=_0x360d77['schedule'][_0x29357b(0x1a8)],_0x360d77[_0x29357b(0x17d)][_0x29357b(0x1c7)]&&(_0xab84f3[_0x29357b(0x193)]=_0x360d77['schedule']['time']),_0x360d77[_0x29357b(0x17d)]['timezone']&&(_0xab84f3['timezone']=_0x360d77[_0x29357b(0x17d)][_0x29357b(0x192)]));_0x360d77[_0x29357b(0x19c)]&&(_0x360d77['engine'][_0x29357b(0x1a5)]!==undefined&&(_0xab84f3[_0x29357b(0x190)]=_0x360d77[_0x29357b(0x19c)]['hive_only']),_0x360d77[_0x29357b(0x19c)][_0x29357b(0x188)]!==undefined&&(_0xab84f3['hivePoolName']=_0x360d77[_0x29357b(0x19c)][_0x29357b(0x188)]),_0x360d77[_0x29357b(0x19c)][_0x29357b(0x1c1)]!==undefined&&(_0xab84f3[_0x29357b(0x1ce)]=_0x360d77[_0x29357b(0x19c)][_0x29357b(0x1c1)]));_0x360d77[_0x29357b(0x194)]&&_0x360d77[_0x29357b(0x194)]['length']>0x0&&(_0xab84f3[_0x29357b(0x194)]=flattenAttributeGroups(_0x360d77[_0x29357b(0x194)]));_0x360d77[_0x29357b(0x17e)]&&_0x360d77['behaviors']['length']>0x0&&(_0xab84f3['behaviors']=_0x360d77['behaviors'][_0x29357b(0x1c2)](convertYamlBehaviorToApi));if(_0x360d77[_0x29357b(0x1bc)]){const _0x534fa6=_0x360d77[_0x29357b(0x1bc)];_0xab84f3[_0x29357b(0x1c6)]={'name':_0x534fa6[_0x29357b(0x1a7)],'parentDatabaseName':_0x534fa6['source'][_0x29357b(0x1b2)],'parentTableName':_0x534fa6[_0x29357b(0x186)]['table'],'parentKey':_0x534fa6[_0x29357b(0x180)]['parent_key'],'foreignKey':_0x534fa6['join']['child_key']},_0x534fa6[_0x29357b(0x194)]&&_0x534fa6[_0x29357b(0x194)][_0x29357b(0x1ab)]>0x0&&(_0xab84f3[_0x29357b(0x1c6)][_0x29357b(0x1ac)]=flattenAttributeGroups(_0x534fa6[_0x29357b(0x194)])[_0x29357b(0x1c2)](_0x172035=>({'name':_0x172035[_0x29357b(0x1a7)],'type':_0x172035[_0x29357b(0x1a8)],'parentDatabaseName':_0x172035[_0x29357b(0x17b)],'parentTableName':_0x172035[_0x29357b(0x18e)],'parentColumn':_0x172035[_0x29357b(0x1a2)],'parentKey':_0x172035[_0x29357b(0x182)],'foreignKey':_0x172035[_0x29357b(0x184)]}))),_0x534fa6[_0x29357b(0x17e)]&&_0x534fa6['behaviors'][_0x29357b(0x1ab)]>0x0&&(_0xab84f3[_0x29357b(0x1c6)][_0x29357b(0x18b)]=_0x534fa6[_0x29357b(0x17e)][_0x29357b(0x1c2)](_0x335b64=>({'name':_0x335b64[_0x29357b(0x1a7)],'parentDatabaseName':_0x335b64[_0x29357b(0x186)][_0x29357b(0x1b2)],'parentTableName':_0x335b64['source'][_0x29357b(0x198)],'parentKey':_0x335b64[_0x29357b(0x180)][_0x29357b(0x1bf)],'foreignKey':_0x335b64[_0x29357b(0x180)][_0x29357b(0x183)],'allColumns':_0x335b64[_0x29357b(0x19b)],'schema':_0x335b64['columns']?.['map'](_0x1e0e07=>({'name':_0x1e0e07['label']||_0x1e0e07[_0x29357b(0x1cc)],'type':_0x1e0e07[_0x29357b(0x1a8)],'parentColumn':_0x1e0e07[_0x29357b(0x1cc)]}))})));}return _0xab84f3;}function flattenAttributeGroups(_0x4c8f26){const _0xcdf882=a73_0x27c9,_0xf9ecdf=[];for(const _0x506903 of _0x4c8f26){for(const _0x5a6cf9 of _0x506903['columns']){_0xf9ecdf['push']({'name':_0x5a6cf9['label']||_0x5a6cf9[_0xcdf882(0x1cc)],'type':_0x5a6cf9[_0xcdf882(0x1a8)],'parentDatabaseName':_0x506903['source'][_0xcdf882(0x1b2)],'parentTableName':_0x506903[_0xcdf882(0x186)][_0xcdf882(0x198)],'parentColumn':_0x5a6cf9['column'],'parentKey':_0x506903[_0xcdf882(0x180)][_0xcdf882(0x1bf)],'foreignKey':_0x506903['join'][_0xcdf882(0x183)],'groupingName':_0x506903[_0xcdf882(0x1a7)]});}}return _0xf9ecdf;}function convertYamlBehaviorToApi(_0xf60066){const _0x12ba3c=a73_0x27c9,_0x28dad9={'name':_0xf60066[_0x12ba3c(0x1a7)],'parentDatabaseName':_0xf60066['source'][_0x12ba3c(0x1b2)],'parentTableName':_0xf60066['source'][_0x12ba3c(0x198)],'parentKey':_0xf60066['join'][_0x12ba3c(0x1bf)],'foreignKey':_0xf60066[_0x12ba3c(0x180)][_0x12ba3c(0x183)]};if(_0xf60066['all_columns'])_0x28dad9['allColumns']=!![];else _0xf60066[_0x12ba3c(0x1af)]&&_0xf60066[_0x12ba3c(0x1af)]['length']>0x0&&(_0x28dad9[_0x12ba3c(0x1c4)]=_0xf60066[_0x12ba3c(0x1af)]['map'](_0x4475cc=>({'name':_0x4475cc[_0x12ba3c(0x1a1)]||_0x4475cc['column'],'type':_0x4475cc[_0x12ba3c(0x1a8)],'parentColumn':_0x4475cc['column']})));return _0xf60066[_0x12ba3c(0x1aa)]!==undefined&&(_0x28dad9[_0x12ba3c(0x1c9)]=_0xf60066[_0x12ba3c(0x1aa)]),_0xf60066[_0x12ba3c(0x1a3)]!==undefined&&(_0x28dad9[_0x12ba3c(0x1b8)]=_0xf60066['realtime']),_0x28dad9;}export function toYamlString(_0x185ae7){const _0x55abe9=a73_0x27c9,_0x939c4=JSON[_0x55abe9(0x1ad)](JSON[_0x55abe9(0x1ae)](_0x185ae7)),_0x74ac70=a73_0x5bfe6e[_0x55abe9(0x1ae)](_0x939c4,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x55abe9(0x196)}),_0x3e2d20=['master:',_0x55abe9(0x1b3),_0x55abe9(0x187),_0x55abe9(0x1be),_0x55abe9(0x18c),_0x55abe9(0x1a9)];let _0x553e3f=_0x74ac70;for(const _0x3b8579 of _0x3e2d20){_0x553e3f=_0x553e3f[_0x55abe9(0x1b1)](new RegExp('^('+_0x3b8579+')','m'),(_0x2297ce,_0x3fbf7c,_0x5b9300)=>{if(_0x5b9300===0x0||_0x553e3f[_0x5b9300-0x1]==='\x0a'&&_0x553e3f[_0x5b9300-0x2]==='\x0a')return _0x3fbf7c;return'\x0a'+_0x3fbf7c;});}return _0x553e3f;}export function parseYamlString(_0x293573){const _0x344736=a73_0x27c9,_0x3a4f92=a73_0x5bfe6e[_0x344736(0x1ad)](_0x293573);if(!_0x3a4f92[_0x344736(0x1a7)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x3a4f92[_0x344736(0x19a)])throw new Error(_0x344736(0x185));if(!_0x3a4f92[_0x344736(0x19a)][_0x344736(0x1b2)])throw new Error(_0x344736(0x1c0));if(!_0x3a4f92[_0x344736(0x19a)][_0x344736(0x198)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.table');return _0x3a4f92;}function a73_0x27c9(_0x4b9c26,_0x52df62){_0x4b9c26=_0x4b9c26-0x179;const _0xe70a06=a73_0xe70a();let _0x27c9d7=_0xe70a06[_0x4b9c26];return _0x27c9d7;}export function generateTemplate(_0x59f47d,_0x326bdb,_0x86cb0f){const _0x1e6bed=a73_0x27c9,_0x4a5dc6={'name':_0x59f47d,'description':'Parent\x20segment\x20description','master':{'database':_0x326bdb,'table':_0x86cb0f},'schedule':{'type':'daily','time':'03:00','timezone':_0x1e6bed(0x199)},'attributes':[{'name':'Example\x20Attributes','source':{'database':_0x326bdb,'table':'attribute_table'},'join':{'parent_key':'id','child_key':_0x1e6bed(0x1c8)},'columns':[{'column':_0x1e6bed(0x1c3),'label':_0x1e6bed(0x1bb),'type':_0x1e6bed(0x1b4)}]}],'behaviors':[{'name':_0x1e6bed(0x1b5),'source':{'database':_0x326bdb,'table':_0x1e6bed(0x1ba)},'join':{'parent_key':_0x1e6bed(0x19f),'child_key':'customer_id'},'all_columns':!![]}]};return toYamlString(_0x4a5dc6);}function a73_0xe70a(){const _0x513b9c=['trino_pool','map','column_name','schema','test','customerGroup','time','customer_id','defaultTimeFilterEnabled','none','101466gKeNDX','column','columnName','prestoPoolName','values','audienceFilters','1464556NquUTj','parentDatabaseName','21393LrYKUW','schedule','behaviors','match','join','hivePoolName','parentKey','child_key','foreignKey','YAML\x20config\x20missing\x20required\x20field:\x20master','source','engine:','hive_pool','filters','has','customerGroupBehaviors','behaviors:','2968IJELvP','parentTableName','8756950vvqZvV','workflowHiveOnly','scheduleType','timezone','scheduleOption','attributes','41514870KgViyv','null','groupingName','table','UTC','master','all_columns','engine','set','916187rubnBB','user_id','4lMpqrq','label','parentColumn','realtime','707pJbVSc','hive_only',':00:00','name','type','customer_group:','default_time_filter','length','customerGroupAttributes','parse','stringify','columns','2372691ZjtfgK','replace','database','schedule:','string','Example\x20Events','description','floor','isRealtime','padStart','events_table','Display\x20Name','customer_group','push','attributes:','parent_key','YAML\x20config\x20missing\x20required\x20field:\x20master.database'];a73_0xe70a=function(){return _0x513b9c;};return a73_0xe70a();}
@@ -1 +1 @@
1
- const a74_0x28f6b5=a74_0x371d;(function(_0xf53710,_0x4e84f5){const _0x32856c=a74_0x371d,_0x5ac126=_0xf53710();while(!![]){try{const _0x196712=-parseInt(_0x32856c(0x1b9))/0x1*(-parseInt(_0x32856c(0x1e0))/0x2)+-parseInt(_0x32856c(0x1b8))/0x3+parseInt(_0x32856c(0x22c))/0x4+parseInt(_0x32856c(0x1e9))/0x5*(parseInt(_0x32856c(0x1b7))/0x6)+parseInt(_0x32856c(0x1e6))/0x7+-parseInt(_0x32856c(0x1de))/0x8*(-parseInt(_0x32856c(0x23e))/0x9)+-parseInt(_0x32856c(0x21b))/0xa*(parseInt(_0x32856c(0x23f))/0xb);if(_0x196712===_0x4e84f5)break;else _0x5ac126['push'](_0x5ac126['shift']());}catch(_0xf13673){_0x5ac126['push'](_0x5ac126['shift']());}}}(a74_0xdaa0,0x88665));import{CDPApiClient}from'../client/cdp-api-client.js';import{TrinoApiClient}from'../client/trino-api-client.js';import{SDKError,ErrorCode}from'./errors.js';function a74_0x371d(_0x51dc6f,_0x20a8ba){_0x51dc6f=_0x51dc6f-0x1ad;const _0xdaa093=a74_0xdaa0();let _0x371d86=_0xdaa093[_0x51dc6f];return _0x371d86;}import{parsePath}from'../utils/segment-path-parser.js';import{apiToYaml,yamlToApi,toYamlString,parseYamlString}from'./segment/parent-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';function a74_0xdaa0(){const _0x5b0bd5=['listFolders','\x27\x20not\x20found','Validating\x20master\x20table:\x20','parent','Segment\x20\x27','matched_count','pullParentYaml','getParent','trinoClient','updateParentSegment','Fetching\x20sample\x20data\x20for:\x20','map','runParent','behaviors','2776456BRkUNp','getParentSegment','parentFolderId','folder','population','schemaValid','onProgress','listSegments','error','table','\x27:\x20','getAudienceBehaviors','previewParentYaml','sampleData','filter','description','logger','string','297shRzeD','11YeoyVa','resolveSegmentId','updateSegment','parentTableName','createSegmentFolder','detectResourceTypeInFolder','Fetching\x20enriched\x20master\x20data...','updateParent','parent_key','attribute','Calculating\x20coverage\x20for:\x20',')\x20exceeded','6UavvKJ','531777pTwoWM','127SmiSbn','row_count','updateActivation','isArray','attributes','customersWithEvents','join','Attribute\x20\x27','parentColumn','groupingName','behavior','allValid','INVALID_ARGUMENT','createSegment','createParentSegment','master','listFields','resolvePathToResource','Folder\x20\x27','listParentSegments','SEGMENT_NOT_FOUND','getSegment','interval','Child\x20segment\x20not\x20found:\x20','executeQuery','\x27\x20not\x20found\x20in\x20','Master\x20table:\x20','type','segment','catch','detectResourceType','getParentSegmentFull','parentDatabaseName','database','pushParentYaml','\x27\x20not\x20found\x20in\x20path','resolveParentId','3112xlMtUN','data','14052mfEwuy','schema','coveragePercent','segmentFolderId','runParentSegment','client','4812934juPgUU','traversePath','customers_with_events','2565755cZnTrW','Behavior\x20\x27','deleteSegment','segments','resolveFolderId','listParents','getSegmentFolder','getActivation','name','some','createActivation','deleteActivation','parent\x20segment','customerPercent','Validating\x20all\x20attributes\x20in\x20parallel...','schemaError','resolveParentIdOrName','listUnified','totalEvents','all','listActivations','enriched','getParentFull','then','push','getFolder','getParentSQL','rowCount','Parent\x20segment\x20not\x20found:\x20','Validating\x20attribute:\x20','Folder\x20not\x20found:\x20','\x20in\x20parent\x20','createParent','test','find','Calculating\x20statistics\x20for:\x20','Resource\x20\x27','Counting\x20master\x20table\x20rows...','listRecursive','Validating\x20all\x20behaviors\x20in\x20parallel...','listSegmentFolders','child_key','getSegmentSQL','source','ambiguous','length','message','updatedAt','Enriched\x20query:\x20','Validating\x20behavior:\x20','20640140jUngus','\x27\x20not\x20found\x20in\x20parent\x20segment','createFolder'];a74_0xdaa0=function(){return _0x5b0bd5;};return a74_0xdaa0();}import{DEFAULT_TIME_RANGE,DEFAULT_SAMPLE_LIMIT,generateSchemaValidationSQL,generateMasterCountSQL,generateMasterSampleSQL,generateAttributeCoverageSQL,generateBehaviorStatsSQL,generateAttributeSampleSQL,generateBehaviorSampleSQL,generateEnrichedSQL,generateAttributeSchemaSQL,generateBehaviorSchemaSQL,findAttributeByName,findBehaviorByName,getAttributeColumns,getBehaviorColumns}from'./segment/parent-segment-preview.js';export class SegmentSDK{[a74_0x28f6b5(0x1e5)];[a74_0x28f6b5(0x226)];constructor(_0x7da21){const _0x4d86f4=a74_0x28f6b5;this[_0x4d86f4(0x1e5)]=new CDPApiClient(_0x7da21,_0x7da21[_0x4d86f4(0x23c)]),this['trinoClient']=new TrinoApiClient(_0x7da21,_0x7da21[_0x4d86f4(0x23c)]);}async[a74_0x28f6b5(0x1ee)](){const _0x409c82=a74_0x28f6b5;return await this['client'][_0x409c82(0x1cc)]();}async[a74_0x28f6b5(0x225)](_0x23a759){const _0x43f9c1=a74_0x28f6b5;return await this[_0x43f9c1(0x1e5)][_0x43f9c1(0x22d)](_0x23a759);}async[a74_0x28f6b5(0x233)](_0x499749){const _0x1596ee=a74_0x28f6b5;return await this[_0x1596ee(0x1e5)][_0x1596ee(0x233)](_0x499749);}async[a74_0x28f6b5(0x1ce)](_0x524fcf,_0x1d116a){const _0x3cfc85=a74_0x28f6b5;return await this[_0x3cfc85(0x1e5)][_0x3cfc85(0x1ce)](_0x524fcf,_0x1d116a);}async['listFolders'](_0x4d34bd){const _0x46cc85=a74_0x28f6b5;return await this['client'][_0x46cc85(0x211)](_0x4d34bd);}async[a74_0x28f6b5(0x202)](_0x387ff9){const _0x3f2360=a74_0x28f6b5;return await this[_0x3f2360(0x1e5)][_0x3f2360(0x1ef)](_0x387ff9);}async[a74_0x28f6b5(0x1fd)](_0x1f54e4,_0x1b83f8){const _0x250914=a74_0x28f6b5;return await this[_0x250914(0x1e5)][_0x250914(0x1fd)](_0x1f54e4,_0x1b83f8);}async['getActivation'](_0x5b95d6,_0x4bf7a0,_0x10c85c){const _0x2d6a1c=a74_0x28f6b5;return await this['client'][_0x2d6a1c(0x1f0)](_0x5b95d6,_0x4bf7a0,_0x10c85c);}async[a74_0x28f6b5(0x1f3)](_0x866b1b,_0x419b3e,_0x389108){const _0x3efdef=a74_0x28f6b5;return await this[_0x3efdef(0x1e5)]['createActivation'](_0x866b1b,_0x419b3e,_0x389108);}async['updateActivation'](_0x566be5,_0x2ba084,_0x681503,_0x5f19b4){const _0xd19bfd=a74_0x28f6b5;return await this[_0xd19bfd(0x1e5)][_0xd19bfd(0x1bb)](_0x566be5,_0x2ba084,_0x681503,_0x5f19b4);}async['deleteActivation'](_0x34fac7,_0x56a2c4,_0x10098b){const _0x3b0154=a74_0x28f6b5;return await this['client'][_0x3b0154(0x1f4)](_0x34fac7,_0x56a2c4,_0x10098b);}async[a74_0x28f6b5(0x203)](_0x478d9f){const _0x5829fb=a74_0x28f6b5;return await this[_0x5829fb(0x1e5)]['getParentSegmentSQL'](_0x478d9f);}async['getSegmentSQL'](_0x39600d,_0x50f830){const _0x534f1f=a74_0x28f6b5;return await this[_0x534f1f(0x1e5)][_0x534f1f(0x213)](_0x39600d,_0x50f830);}async[a74_0x28f6b5(0x1dd)](_0x3a9e73){const _0x29e63a=a74_0x28f6b5,_0x311b96=await this['listParents'](),_0x3076c2=_0x311b96[_0x29e63a(0x20b)](_0x17aa7a=>_0x17aa7a[_0x29e63a(0x1bd)]['name']===_0x3a9e73);if(!_0x3076c2)throw new SDKError(ErrorCode[_0x29e63a(0x1cd)],_0x29e63a(0x205)+_0x3a9e73);return _0x3076c2['id'];}async[a74_0x28f6b5(0x22a)](_0x17c325){const _0x2cbf02=a74_0x28f6b5;let _0x2e41d3=_0x17c325;return!/^\d+$/['test'](_0x17c325)&&(_0x2e41d3=await this[_0x2cbf02(0x1dd)](_0x17c325)),await this[_0x2cbf02(0x1e5)][_0x2cbf02(0x1e4)](_0x2e41d3);}async['resolveSegmentId'](_0x46656e,_0x40d44b){const _0x4fa248=a74_0x28f6b5,_0x547f91=await this['listSegments'](_0x46656e),_0x219a7a=_0x547f91['find'](_0x2ffb7a=>_0x2ffb7a[_0x4fa248(0x1f1)]===_0x40d44b);if(!_0x219a7a)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4fa248(0x1d0)+_0x40d44b+_0x4fa248(0x208)+_0x46656e);return _0x219a7a['id'];}async[a74_0x28f6b5(0x1ed)](_0x3c948c,_0x2f222a){const _0x1c66ad=a74_0x28f6b5,_0x2d6a90=await this['listFolders'](_0x3c948c),_0x54a23b=_0x2d6a90['find'](_0x52d697=>_0x52d697[_0x1c66ad(0x1f1)]===_0x2f222a);if(!_0x54a23b)throw new SDKError(ErrorCode[_0x1c66ad(0x1cd)],_0x1c66ad(0x207)+_0x2f222a+_0x1c66ad(0x208)+_0x3c948c);return _0x54a23b['id'];}async[a74_0x28f6b5(0x1c9)](_0x7e47e9){const _0x4a9156=a74_0x28f6b5,_0x1f68b6=await this[_0x4a9156(0x1f9)](_0x7e47e9),[_0x1c1a87,_0x41c94d]=await Promise[_0x4a9156(0x1fc)]([this['client']['getAudienceAttributes'](_0x1f68b6),this[_0x4a9156(0x1e5)][_0x4a9156(0x237)](_0x1f68b6)]),_0xbf15bc=[];for(const _0x2368e7 of _0x1c1a87){_0xbf15bc[_0x4a9156(0x201)]({'name':_0x2368e7[_0x4a9156(0x1f1)],'type':_0x2368e7['type'],'source':_0x4a9156(0x1b4),'parentDatabaseName':_0x2368e7['parentDatabaseName'],'parentTableName':_0x2368e7['parentTableName'],'parentColumn':_0x2368e7['parentColumn'],'groupingName':_0x2368e7[_0x4a9156(0x1c2)]??undefined});}for(const _0x13dec2 of _0x41c94d){const _0x21fe19=_0x13dec2[_0x4a9156(0x1f1)];if(_0x13dec2[_0x4a9156(0x1e1)]&&Array[_0x4a9156(0x1bc)](_0x13dec2[_0x4a9156(0x1e1)]))for(const _0x588334 of _0x13dec2[_0x4a9156(0x1e1)]){_0x588334['name']&&_0x588334[_0x4a9156(0x1d4)]&&_0xbf15bc['push']({'name':_0x21fe19+'.'+_0x588334[_0x4a9156(0x1f1)],'type':_0x588334[_0x4a9156(0x1d4)],'source':_0x4a9156(0x1c3),'behaviorName':_0x21fe19,'parentDatabaseName':_0x13dec2[_0x4a9156(0x1d9)],'parentTableName':_0x13dec2[_0x4a9156(0x1ae)],'parentColumn':_0x588334[_0x4a9156(0x1c1)]});}}return _0xbf15bc;}async[a74_0x28f6b5(0x209)](_0x961764){const _0x10f76d=a74_0x28f6b5;return await this[_0x10f76d(0x1e5)][_0x10f76d(0x1c7)](_0x961764);}async[a74_0x28f6b5(0x1b2)](_0x488dba,_0x2331a8){const _0x5a2389=a74_0x28f6b5,_0x17c444=await this['resolveParentIdOrName'](_0x488dba);return await this[_0x5a2389(0x1e5)][_0x5a2389(0x227)](_0x17c444,_0x2331a8);}async[a74_0x28f6b5(0x1ff)](_0x2a80db){const _0x225c29=a74_0x28f6b5,_0x2d8b0d=await this[_0x225c29(0x1f9)](_0x2a80db);return await this['client'][_0x225c29(0x1d8)](_0x2d8b0d);}async[a74_0x28f6b5(0x224)](_0x2e3753){const _0xf6ae9=a74_0x28f6b5,_0x1d90eb=await this[_0xf6ae9(0x1ff)](_0x2e3753),_0x263b11=apiToYaml(_0x1d90eb);return toYamlString(_0x263b11);}async[a74_0x28f6b5(0x1db)](_0x78df11){const _0x19c8b8=a74_0x28f6b5,_0x25cd82=typeof _0x78df11===_0x19c8b8(0x23d)?parseYamlString(_0x78df11):_0x78df11,_0x20e482=yamlToApi(_0x25cd82);let _0x427be1=null,_0x4efa75='';try{_0x427be1=await this[_0x19c8b8(0x1ff)](_0x25cd82[_0x19c8b8(0x1f1)]);const _0x2c2638=apiToYaml(_0x427be1);_0x4efa75=toYamlString(_0x2c2638);}catch{}const _0x229ecc=toYamlString(_0x25cd82),_0x1a8215=generateDiff(_0x4efa75,_0x229ecc),_0x527e05=formatDiffWithColors(_0x1a8215),_0xa3328e=_0x427be1===null,_0x1efee5=hasChanges(_0x1a8215),_0x17678b={'isNew':_0xa3328e,'id':_0x427be1?.['id']||'','name':_0x25cd82[_0x19c8b8(0x1f1)],'diff':_0x1a8215,'diffFormatted':_0x527e05,'hasChanges':_0x1efee5},_0x3416a0=async()=>{const _0x40409f=_0x19c8b8;return _0xa3328e?await this[_0x40409f(0x209)](_0x20e482):await this[_0x40409f(0x1b2)](_0x427be1['id'],_0x20e482);};return{..._0x17678b,'apply':_0x3416a0};}async['validateParentYaml'](_0x612c5a,_0x2d7eac={}){const _0x11dae5=a74_0x28f6b5,_0x67a8ee=typeof _0x612c5a==='string'?parseYamlString(_0x612c5a):_0x612c5a,_0x9ce43d=[];let _0xac4ed5=!![];const _0x4f9e93=_0x5d4869=>_0x2d7eac[_0x11dae5(0x232)]?.(_0x5d4869),_0x4a4b9a={'name':_0x67a8ee[_0x11dae5(0x1f1)],'master':{'database':_0x67a8ee[_0x11dae5(0x1c8)][_0x11dae5(0x1da)],'table':_0x67a8ee[_0x11dae5(0x1c8)][_0x11dae5(0x235)],'schemaValid':![]},'attributes':[],'behaviors':[],'errors':_0x9ce43d,'allValid':!![]},_0x285ab1=async _0x10e57d=>{const _0x4a6527=_0x11dae5;try{const _0x57d266=await this[_0x4a6527(0x226)][_0x4a6527(0x1d1)](_0x10e57d);return{'data':_0x57d266['data']};}catch(_0x383b00){const _0x250e06=_0x383b00 instanceof Error?_0x383b00[_0x4a6527(0x217)]:String(_0x383b00);return{'data':[],'error':_0x250e06};}};_0x4f9e93(_0x11dae5(0x220)+_0x67a8ee['master'][_0x11dae5(0x1da)]+'.'+_0x67a8ee[_0x11dae5(0x1c8)]['table']);const _0x4660e0=generateSchemaValidationSQL(_0x67a8ee[_0x11dae5(0x1c8)][_0x11dae5(0x1da)],_0x67a8ee[_0x11dae5(0x1c8)][_0x11dae5(0x235)]),_0x3d3e66=await _0x285ab1(_0x4660e0);if(_0x3d3e66[_0x11dae5(0x234)])_0x4a4b9a['master']['schemaValid']=![],_0x4a4b9a[_0x11dae5(0x1c8)][_0x11dae5(0x1f8)]=_0x3d3e66['error'],_0x9ce43d[_0x11dae5(0x201)](_0x11dae5(0x1d3)+_0x3d3e66[_0x11dae5(0x234)]),_0xac4ed5=![];else{_0x4a4b9a['master'][_0x11dae5(0x231)]=!![],_0x4f9e93(_0x11dae5(0x20e));const _0x477b12=await _0x285ab1(generateMasterCountSQL(_0x67a8ee));!_0x477b12[_0x11dae5(0x234)]&&_0x477b12[_0x11dae5(0x1df)][_0x11dae5(0x216)]>0x0&&(_0x4a4b9a[_0x11dae5(0x1c8)][_0x11dae5(0x204)]=_0x477b12[_0x11dae5(0x1df)][0x0][_0x11dae5(0x1ba)]);}if(_0x2d7eac[_0x11dae5(0x1c8)])return _0x4a4b9a[_0x11dae5(0x1c4)]=_0xac4ed5,_0x4a4b9a;const _0x5dddb1=async _0x4d6d09=>{const _0x550573=_0x11dae5,_0x183229={'name':_0x4d6d09[_0x550573(0x1f1)],'database':_0x4d6d09['source'][_0x550573(0x1da)],'table':_0x4d6d09[_0x550573(0x214)][_0x550573(0x235)],'joinKey':_0x4d6d09['join'][_0x550573(0x212)],'foreignKey':_0x4d6d09[_0x550573(0x1bf)][_0x550573(0x1b3)],'columns':getAttributeColumns(_0x4d6d09),'schemaValid':![]};_0x4f9e93(_0x550573(0x206)+_0x4d6d09[_0x550573(0x1f1)]);const _0x5de673=await _0x285ab1(generateAttributeSchemaSQL(_0x67a8ee,_0x4d6d09));if(_0x5de673[_0x550573(0x234)])_0x183229['schemaError']=_0x5de673[_0x550573(0x234)];else{_0x183229[_0x550573(0x231)]=!![],_0x4f9e93(_0x550573(0x1b5)+_0x4d6d09[_0x550573(0x1f1)]);const _0x166dee=await _0x285ab1(generateAttributeCoverageSQL(_0x67a8ee,_0x4d6d09));!_0x166dee[_0x550573(0x234)]&&_0x166dee[_0x550573(0x1df)][_0x550573(0x216)]>0x0&&(_0x183229['matchedCount']=_0x166dee['data'][0x0][_0x550573(0x223)],_0x4a4b9a[_0x550573(0x1c8)]['rowCount']&&_0x4a4b9a[_0x550573(0x1c8)][_0x550573(0x204)]>0x0&&(_0x183229[_0x550573(0x1e2)]=_0x183229['matchedCount']/_0x4a4b9a[_0x550573(0x1c8)][_0x550573(0x204)]*0x64));}return _0x183229;},_0x3b0adb=async(_0x4c3a50,_0x212ab1)=>{const _0x1aee5b=_0x11dae5,_0x118a67={'name':_0x4c3a50[_0x1aee5b(0x1f1)],'database':_0x4c3a50[_0x1aee5b(0x214)][_0x1aee5b(0x1da)],'table':_0x4c3a50[_0x1aee5b(0x214)][_0x1aee5b(0x235)],'joinKey':_0x4c3a50[_0x1aee5b(0x1bf)][_0x1aee5b(0x212)],'foreignKey':_0x4c3a50['join'][_0x1aee5b(0x1b3)],'columns':getBehaviorColumns(_0x4c3a50),'schemaValid':![]};_0x4f9e93(_0x1aee5b(0x21a)+_0x4c3a50['name']);const _0x2a4e32=await _0x285ab1(generateBehaviorSchemaSQL(_0x67a8ee,_0x4c3a50));if(_0x2a4e32[_0x1aee5b(0x234)])_0x118a67[_0x1aee5b(0x1f8)]=_0x2a4e32[_0x1aee5b(0x234)];else{_0x118a67[_0x1aee5b(0x231)]=!![],_0x4f9e93(_0x1aee5b(0x20c)+_0x4c3a50[_0x1aee5b(0x1f1)]+'\x20('+_0x212ab1+')');const _0x433ceb=await _0x285ab1(generateBehaviorStatsSQL(_0x67a8ee,_0x4c3a50,_0x212ab1));!_0x433ceb[_0x1aee5b(0x234)]&&_0x433ceb['data'][_0x1aee5b(0x216)]>0x0&&(_0x118a67[_0x1aee5b(0x1be)]=_0x433ceb[_0x1aee5b(0x1df)][0x0][_0x1aee5b(0x1e8)],_0x118a67[_0x1aee5b(0x1fb)]=_0x433ceb[_0x1aee5b(0x1df)][0x0]['total_events'],_0x4a4b9a['master'][_0x1aee5b(0x204)]&&_0x4a4b9a[_0x1aee5b(0x1c8)][_0x1aee5b(0x204)]>0x0&&(_0x118a67[_0x1aee5b(0x1f6)]=_0x118a67[_0x1aee5b(0x1be)]/_0x4a4b9a[_0x1aee5b(0x1c8)][_0x1aee5b(0x204)]*0x64));}return _0x118a67;},_0x56b0ab=(_0x609322,_0x519cf4)=>{const _0x4b9492=_0x11dae5;_0x4a4b9a[_0x4b9492(0x1bd)]=_0x609322,_0x4a4b9a[_0x4b9492(0x22b)]=_0x519cf4;for(const _0x4c73d5 of _0x609322){!_0x4c73d5[_0x4b9492(0x231)]&&(_0x9ce43d['push'](_0x4b9492(0x1c0)+_0x4c73d5[_0x4b9492(0x1f1)]+'\x27:\x20'+_0x4c73d5['schemaError']),_0xac4ed5=![]);}for(const _0x2a498b of _0x519cf4){!_0x2a498b[_0x4b9492(0x231)]&&(_0x9ce43d['push'](_0x4b9492(0x1ea)+_0x2a498b[_0x4b9492(0x1f1)]+_0x4b9492(0x236)+_0x2a498b[_0x4b9492(0x1f8)]),_0xac4ed5=![]);}},_0x426d5d=_0x2d7eac['interval']||DEFAULT_TIME_RANGE;if(typeof _0x2d7eac[_0x11dae5(0x1b4)]===_0x11dae5(0x23d)){const _0x1b6d64=findAttributeByName(_0x67a8ee,_0x2d7eac[_0x11dae5(0x1b4)]);if(!_0x1b6d64)throw new SDKError(ErrorCode[_0x11dae5(0x1cd)],'Attribute\x20\x27'+_0x2d7eac[_0x11dae5(0x1b4)]+_0x11dae5(0x21f));const _0x51c6f5=await _0x5dddb1(_0x1b6d64);return _0x56b0ab([_0x51c6f5],[]),_0x4a4b9a[_0x11dae5(0x1c4)]=_0xac4ed5,_0x4a4b9a;}if(_0x2d7eac[_0x11dae5(0x1b4)]===!![]){_0x4f9e93(_0x11dae5(0x1f7));const _0x1ad96d=await Promise[_0x11dae5(0x1fc)]((_0x67a8ee['attributes']||[])[_0x11dae5(0x229)](_0x300992=>_0x5dddb1(_0x300992)));return _0x56b0ab(_0x1ad96d,[]),_0x4a4b9a[_0x11dae5(0x1c4)]=_0xac4ed5,_0x4a4b9a;}if(typeof _0x2d7eac['behavior']===_0x11dae5(0x23d)){const _0x568e05=findBehaviorByName(_0x67a8ee,_0x2d7eac['behavior']);if(!_0x568e05)throw new SDKError(ErrorCode[_0x11dae5(0x1cd)],_0x11dae5(0x1ea)+_0x2d7eac[_0x11dae5(0x1c3)]+'\x27\x20not\x20found');const _0x467d3b=await _0x3b0adb(_0x568e05,_0x426d5d);return _0x56b0ab([],[_0x467d3b]),_0x4a4b9a[_0x11dae5(0x1c4)]=_0xac4ed5,_0x4a4b9a;}if(_0x2d7eac[_0x11dae5(0x1c3)]===!![]){_0x4f9e93(_0x11dae5(0x210));const _0x38b6bf=await Promise[_0x11dae5(0x1fc)]((_0x67a8ee[_0x11dae5(0x22b)]||[])[_0x11dae5(0x229)](_0x5946e6=>_0x3b0adb(_0x5946e6,_0x426d5d)));return _0x56b0ab([],_0x38b6bf),_0x4a4b9a[_0x11dae5(0x1c4)]=_0xac4ed5,_0x4a4b9a;}if(_0x2d7eac[_0x11dae5(0x1fe)]){_0x4f9e93('Validating\x20all\x20attributes\x20in\x20parallel...');const _0x1dd61e=await Promise[_0x11dae5(0x1fc)]((_0x67a8ee[_0x11dae5(0x1bd)]||[])[_0x11dae5(0x229)](_0x8396db=>_0x5dddb1(_0x8396db)));return _0x56b0ab(_0x1dd61e,[]),_0x4a4b9a[_0x11dae5(0x1c4)]=_0xac4ed5,_0x4a4b9a;}_0x4f9e93('Validating\x20all\x20attributes\x20and\x20behaviors\x20in\x20parallel...');const [_0x594d90,_0x3501b2]=await Promise[_0x11dae5(0x1fc)]([Promise[_0x11dae5(0x1fc)]((_0x67a8ee[_0x11dae5(0x1bd)]||[])['map'](_0x1e4f7f=>_0x5dddb1(_0x1e4f7f))),Promise['all']((_0x67a8ee['behaviors']||[])['map'](_0x52e337=>_0x3b0adb(_0x52e337,_0x426d5d)))]);return _0x56b0ab(_0x594d90,_0x3501b2),_0x4a4b9a[_0x11dae5(0x1c4)]=_0xac4ed5,_0x4a4b9a;}async[a74_0x28f6b5(0x238)](_0x286312,_0x4d85bf={}){const _0x822988=a74_0x28f6b5,_0x31ca37=typeof _0x286312===_0x822988(0x23d)?parseYamlString(_0x286312):_0x286312,_0x11683c=[];let _0xb7f08e=!![];const _0x2de16e=_0xd249dd=>_0x4d85bf['onProgress']?.(_0xd249dd),_0x3439aa={'name':_0x31ca37[_0x822988(0x1f1)],'master':{'database':_0x31ca37[_0x822988(0x1c8)][_0x822988(0x1da)],'table':_0x31ca37['master']['table'],'schemaValid':!![]},'attributes':[],'behaviors':[],'errors':_0x11683c,'allValid':!![]},_0xd50355=async _0x1b6c5c=>{const _0x5034ca=_0x822988;try{const _0x6e93b6=await this[_0x5034ca(0x226)][_0x5034ca(0x1d1)](_0x1b6c5c);return{'data':_0x6e93b6[_0x5034ca(0x1df)]};}catch(_0x383dab){const _0x394136=_0x383dab instanceof Error?_0x383dab[_0x5034ca(0x217)]:String(_0x383dab);return{'data':[],'error':_0x394136};}};if(_0x4d85bf[_0x822988(0x1c8)]){_0x2de16e('Fetching\x20master\x20sample\x20data...');const _0x34f836=generateMasterSampleSQL(_0x31ca37,DEFAULT_SAMPLE_LIMIT),_0xcb586b=await _0xd50355(_0x34f836);return!_0xcb586b[_0x822988(0x234)]?_0x3439aa[_0x822988(0x239)]=_0xcb586b[_0x822988(0x1df)]:(_0x11683c[_0x822988(0x201)]('Master\x20table:\x20'+_0xcb586b[_0x822988(0x234)]),_0xb7f08e=![]),_0x3439aa[_0x822988(0x1c4)]=_0xb7f08e,_0x3439aa;}if(_0x4d85bf[_0x822988(0x1b4)]){const _0x1b4fb4=findAttributeByName(_0x31ca37,_0x4d85bf[_0x822988(0x1b4)]);if(!_0x1b4fb4)throw new SDKError(ErrorCode[_0x822988(0x1cd)],'Attribute\x20\x27'+_0x4d85bf['attribute']+'\x27\x20not\x20found');_0x2de16e(_0x822988(0x228)+_0x1b4fb4[_0x822988(0x1f1)]);const _0x26448b=generateAttributeSampleSQL(_0x31ca37,_0x1b4fb4,DEFAULT_SAMPLE_LIMIT),_0x4e1705=await _0xd50355(_0x26448b);return!_0x4e1705[_0x822988(0x234)]?_0x3439aa[_0x822988(0x239)]=_0x4e1705[_0x822988(0x1df)]:(_0x11683c['push'](_0x822988(0x1c0)+_0x1b4fb4[_0x822988(0x1f1)]+_0x822988(0x236)+_0x4e1705[_0x822988(0x234)]),_0xb7f08e=![]),_0x3439aa[_0x822988(0x1c4)]=_0xb7f08e,_0x3439aa;}if(_0x4d85bf['behavior']){const _0x863772=findBehaviorByName(_0x31ca37,_0x4d85bf[_0x822988(0x1c3)]);if(!_0x863772)throw new SDKError(ErrorCode[_0x822988(0x1cd)],_0x822988(0x1ea)+_0x4d85bf[_0x822988(0x1c3)]+_0x822988(0x21f));const _0x4baff9=_0x4d85bf[_0x822988(0x1cf)]||DEFAULT_TIME_RANGE;_0x2de16e(_0x822988(0x228)+_0x863772['name']+'\x20('+_0x4baff9+')');const _0xed58cb=generateBehaviorSampleSQL(_0x31ca37,_0x863772,DEFAULT_SAMPLE_LIMIT,_0x4baff9),_0x2fecb1=await _0xd50355(_0xed58cb);return!_0x2fecb1[_0x822988(0x234)]?_0x3439aa[_0x822988(0x239)]=_0x2fecb1[_0x822988(0x1df)]:(_0x11683c[_0x822988(0x201)](_0x822988(0x1ea)+_0x863772[_0x822988(0x1f1)]+_0x822988(0x236)+_0x2fecb1[_0x822988(0x234)]),_0xb7f08e=![]),_0x3439aa[_0x822988(0x1c4)]=_0xb7f08e,_0x3439aa;}if(_0x4d85bf[_0x822988(0x1fe)]){_0x2de16e(_0x822988(0x1b1));const _0x23ec8f=generateEnrichedSQL(_0x31ca37,DEFAULT_SAMPLE_LIMIT),_0x140bcc=await _0xd50355(_0x23ec8f);return!_0x140bcc['error']?_0x3439aa[_0x822988(0x239)]=_0x140bcc['data']:(_0x11683c[_0x822988(0x201)](_0x822988(0x219)+_0x140bcc[_0x822988(0x234)]),_0xb7f08e=![]),_0x3439aa[_0x822988(0x1c4)]=_0xb7f08e,_0x3439aa;}return _0x3439aa[_0x822988(0x1c4)]=_0xb7f08e,_0x3439aa;}async[a74_0x28f6b5(0x1c6)](_0x12ff04,_0x34888d){const _0x37afcc=a74_0x28f6b5;return await this['client'][_0x37afcc(0x1c6)](_0x12ff04,_0x34888d);}async['updateSegmentById'](_0x4948a9,_0x26947b,_0x5abe44){const _0x372b2a=a74_0x28f6b5;return await this[_0x372b2a(0x1e5)][_0x372b2a(0x1ad)](_0x4948a9,_0x26947b,_0x5abe44);}async[a74_0x28f6b5(0x1eb)](_0x1ec807){const _0x1fda42=a74_0x28f6b5;return await this[_0x1fda42(0x1e5)]['deleteSegment'](_0x1ec807);}async[a74_0x28f6b5(0x21d)](_0x230d25,_0x15c85b){const _0x5556f3=a74_0x28f6b5,_0x490e38=await this[_0x5556f3(0x1f9)](_0x230d25);return await this['client'][_0x5556f3(0x1af)](_0x490e38,_0x15c85b);}async[a74_0x28f6b5(0x1f9)](_0x1cafa6){const _0x55c5c0=a74_0x28f6b5;if(/^\d+$/[_0x55c5c0(0x20a)](_0x1cafa6))return _0x1cafa6;return await this[_0x55c5c0(0x1dd)](_0x1cafa6);}async[a74_0x28f6b5(0x1d7)](_0x5c45cd,_0x1ecccf){const _0x11cc02=a74_0x28f6b5,[_0x45dff8,_0x49dcc0]=await Promise[_0x11cc02(0x1fc)]([this['resolveFolderId'](_0x5c45cd,_0x1ecccf)[_0x11cc02(0x200)](()=>!![])[_0x11cc02(0x1d6)](()=>![]),this[_0x11cc02(0x240)](_0x5c45cd,_0x1ecccf)[_0x11cc02(0x200)](()=>!![])[_0x11cc02(0x1d6)](()=>![])]);if(_0x45dff8&&_0x49dcc0)return _0x11cc02(0x215);else{if(_0x45dff8)return _0x11cc02(0x22f);else{if(_0x49dcc0)return _0x11cc02(0x1d5);}}throw new SDKError(ErrorCode[_0x11cc02(0x1cd)],_0x11cc02(0x20d)+_0x1ecccf+_0x11cc02(0x21c));}async[a74_0x28f6b5(0x1b0)](_0x21b0d2,_0x267fb4,_0x5aef83){const _0x36597e=a74_0x28f6b5,[_0x2bbdc6,_0x1d2b3f]=await Promise[_0x36597e(0x1fc)]([this['listFolders'](_0x21b0d2),this[_0x36597e(0x233)](_0x21b0d2)]),_0x419be6=_0x5aef83?_0x2bbdc6[_0x36597e(0x23a)](_0x391f84=>_0x391f84[_0x36597e(0x22e)]===_0x5aef83):_0x2bbdc6['filter'](_0x570344=>!_0x570344[_0x36597e(0x22e)]),_0x3c76c7=_0x5aef83?_0x1d2b3f['filter'](_0x466044=>_0x466044['segmentFolderId']===_0x5aef83):_0x1d2b3f[_0x36597e(0x23a)](_0x2a7b90=>!_0x2a7b90['segmentFolderId']),_0x462d62=_0x419be6[_0x36597e(0x1f2)](_0x3427b4=>_0x3427b4[_0x36597e(0x1f1)]===_0x267fb4),_0x5d572c=_0x3c76c7[_0x36597e(0x1f2)](_0x59ffc5=>_0x59ffc5[_0x36597e(0x1f1)]===_0x267fb4);if(_0x462d62&&_0x5d572c)return _0x36597e(0x215);else{if(_0x462d62)return _0x36597e(0x22f);else{if(_0x5d572c)return _0x36597e(0x1d5);}}throw new SDKError(ErrorCode[_0x36597e(0x1cd)],_0x36597e(0x20d)+_0x267fb4+_0x36597e(0x1d2)+(_0x5aef83?'folder':_0x36597e(0x1f5)));}async['traversePath'](_0x3c6dff){const _0x48a97b=a74_0x28f6b5;if(_0x3c6dff[_0x48a97b(0x216)]===0x0)throw new SDKError(ErrorCode[_0x48a97b(0x1c5)],'Path\x20cannot\x20be\x20empty');const _0x3f55fe=_0x3c6dff[0x0],_0x5642e1=await this[_0x48a97b(0x1dd)](_0x3f55fe);if(_0x3c6dff['length']===0x1)return{'parentId':_0x5642e1,'parentName':_0x3f55fe,'type':_0x48a97b(0x221),'fullPath':_0x3f55fe};const _0x5b5614=await this[_0x48a97b(0x1ff)](_0x5642e1),_0x2e07aa=_0x5b5614['rootFolderId'],_0x1a6c11=[];let _0x44fcd3=_0x2e07aa;for(let _0xb3f001=0x1;_0xb3f001<_0x3c6dff['length']-0x1;_0xb3f001++){const _0x231ddc=_0x3c6dff[_0xb3f001],_0x54e87f=await this[_0x48a97b(0x21e)](_0x5642e1),_0xee4f2e=_0x44fcd3?_0x54e87f[_0x48a97b(0x20b)](_0x3bf783=>_0x3bf783[_0x48a97b(0x1f1)]===_0x231ddc&&_0x3bf783[_0x48a97b(0x22e)]===_0x44fcd3):_0x54e87f[_0x48a97b(0x20b)](_0x341c8e=>_0x341c8e[_0x48a97b(0x1f1)]===_0x231ddc&&!_0x341c8e[_0x48a97b(0x22e)]);if(!_0xee4f2e)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x48a97b(0x1cb)+_0x231ddc+_0x48a97b(0x1dc));_0x1a6c11[_0x48a97b(0x201)](_0x231ddc),_0x44fcd3=_0xee4f2e['id'];}const _0x20c15c=_0x3c6dff[_0x3c6dff[_0x48a97b(0x216)]-0x1],_0x568a89=await this[_0x48a97b(0x1b0)](_0x5642e1,_0x20c15c,_0x44fcd3);if(_0x568a89===_0x48a97b(0x215)||_0x568a89===_0x48a97b(0x22f)){const _0x5a9083=await this['listFolders'](_0x5642e1),_0x5528ce=_0x44fcd3?_0x5a9083['find'](_0x410b7f=>_0x410b7f['name']===_0x20c15c&&_0x410b7f['parentFolderId']===_0x44fcd3):_0x5a9083[_0x48a97b(0x20b)](_0x1c4c5=>_0x1c4c5[_0x48a97b(0x1f1)]===_0x20c15c&&!_0x1c4c5[_0x48a97b(0x22e)]);if(!_0x5528ce)throw new SDKError(ErrorCode[_0x48a97b(0x1cd)],_0x48a97b(0x1cb)+_0x20c15c+_0x48a97b(0x21f));return _0x1a6c11['push'](_0x20c15c),{'parentId':_0x5642e1,'parentName':_0x3f55fe,'folderId':_0x5528ce['id'],'folderPath':_0x1a6c11,'type':_0x48a97b(0x22f),'fullPath':_0x3c6dff['join']('/')};}else{const _0x5e6637=await this[_0x48a97b(0x233)](_0x5642e1),_0x205f3a=_0x44fcd3?_0x5e6637[_0x48a97b(0x20b)](_0x9ef59a=>_0x9ef59a[_0x48a97b(0x1f1)]===_0x20c15c&&_0x9ef59a[_0x48a97b(0x1e3)]===_0x44fcd3):_0x5e6637['find'](_0x2567b6=>_0x2567b6[_0x48a97b(0x1f1)]===_0x20c15c&&!_0x2567b6['segmentFolderId']);if(!_0x205f3a)throw new SDKError(ErrorCode[_0x48a97b(0x1cd)],_0x48a97b(0x222)+_0x20c15c+_0x48a97b(0x21f));return{'parentId':_0x5642e1,'parentName':_0x3f55fe,'folderId':_0x44fcd3,'folderPath':_0x1a6c11[_0x48a97b(0x216)]>0x0?_0x1a6c11:undefined,'segmentId':_0x205f3a['id'],'segmentName':_0x20c15c,'type':_0x48a97b(0x1d5),'fullPath':_0x3c6dff['join']('/')};}}async[a74_0x28f6b5(0x1ca)](_0xbd1f6e){const _0x448361=a74_0x28f6b5,_0x28e281=parsePath(_0xbd1f6e);if(!_0x28e281['isAbsolute'])throw new SDKError(ErrorCode[_0x448361(0x1c5)],'Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)');return await this[_0x448361(0x1e7)](_0x28e281[_0x448361(0x1ec)]);}async[a74_0x28f6b5(0x1fa)](_0x39300c,_0x2e2ae5){const _0xa18a74=a74_0x28f6b5,[_0x20bd0f,_0xbf0156]=await Promise[_0xa18a74(0x1fc)]([this[_0xa18a74(0x21e)](_0x39300c),this[_0xa18a74(0x233)](_0x39300c)]);if(_0x2e2ae5){const _0x516b17=_0x20bd0f[_0xa18a74(0x23a)](_0x45791e=>_0x45791e[_0xa18a74(0x22e)]===_0x2e2ae5),_0x52a652=_0xbf0156[_0xa18a74(0x23a)](_0x1aeef7=>_0x1aeef7['segmentFolderId']===_0x2e2ae5);return{'folders':_0x516b17,'segments':_0x52a652};}const _0x3c9b65=await this[_0xa18a74(0x1ff)](_0x39300c),_0xddfd83=_0x3c9b65['rootFolderId'];if(_0xddfd83){const _0x259cc3=_0x20bd0f[_0xa18a74(0x23a)](_0x5b75b8=>_0x5b75b8[_0xa18a74(0x22e)]===_0xddfd83),_0x2a3677=_0xbf0156[_0xa18a74(0x23a)](_0x236f35=>_0x236f35['segmentFolderId']===_0xddfd83);return{'folders':_0x259cc3,'segments':_0x2a3677};}const _0x40cf28=_0x20bd0f[_0xa18a74(0x23a)](_0x45962b=>!_0x45962b['parentFolderId']),_0x5428be=_0xbf0156[_0xa18a74(0x23a)](_0x301b34=>!_0x301b34[_0xa18a74(0x1e3)]);return{'folders':_0x40cf28,'segments':_0x5428be};}async['listRecursive'](_0x448f91,_0x3870f2,_0x2f02d7=0x0,_0x585858=0xa){const _0x21e6cd=a74_0x28f6b5;if(_0x2f02d7>=_0x585858)throw new SDKError(ErrorCode[_0x21e6cd(0x1c5)],'Maximum\x20recursion\x20depth\x20('+_0x585858+_0x21e6cd(0x1b6));const {folders:_0xb54fe6,segments:_0x47adcf}=await this['listUnified'](_0x448f91,_0x3870f2),_0x1c16df=[];for(const _0x19b17a of _0xb54fe6){const _0xab871c=await this[_0x21e6cd(0x20f)](_0x448f91,_0x19b17a['id'],_0x2f02d7+0x1,_0x585858);_0x1c16df[_0x21e6cd(0x201)]({'type':_0x21e6cd(0x22f),'id':_0x19b17a['id'],'name':_0x19b17a['name'],'children':_0xab871c[_0x21e6cd(0x216)]>0x0?_0xab871c:undefined,'metadata':{'description':_0x19b17a[_0x21e6cd(0x23b)]||undefined,'folderCount':_0xab871c[_0x21e6cd(0x23a)](_0x265dc3=>_0x265dc3['type']==='folder')['length'],'segmentCount':_0xab871c['filter'](_0x901bdc=>_0x901bdc[_0x21e6cd(0x1d4)]===_0x21e6cd(0x1d5))[_0x21e6cd(0x216)],'createdAt':_0x19b17a['createdAt'],'updatedAt':_0x19b17a[_0x21e6cd(0x218)]}});}for(const _0x56dd81 of _0x47adcf){_0x1c16df[_0x21e6cd(0x201)]({'type':_0x21e6cd(0x1d5),'id':_0x56dd81['id'],'name':_0x56dd81['name'],'population':_0x56dd81[_0x21e6cd(0x230)],'metadata':{'description':_0x56dd81['description'],'createdAt':_0x56dd81['createdAt'],'updatedAt':_0x56dd81['updatedAt']}});}return _0x1c16df;}}
1
+ function a74_0x11b4(){const _0x29752a=['deleteActivation','72qbhzwX','Validating\x20behavior:\x20','getFolder','10gKwuXG','getParentFull','Validating\x20attribute:\x20','schemaError','isAbsolute','filter','validateParentYaml','source','sampleData','all','deleteSegment','Validating\x20master\x20table:\x20','rowCount','parentColumn','createdAt','segment','parent','type','591540ZzXUiA','\x27:\x20','customerPercent','getAudienceAttributes','totalEvents','getParentSegment','folder','updateActivation','pullParentYaml','22752miGxES','createParentSegment','length','Calculating\x20coverage\x20for:\x20','message','behaviors','data','attributes',')\x20exceeded','customersWithEvents','interval','find','detectResourceTypeInFolder','then','master','createActivation','\x27\x20not\x20found\x20in\x20','trinoClient','listUnified','rootFolderId','schemaValid','push','createSegment','child_key','1RaBkCT','Fetching\x20sample\x20data\x20for:\x20','\x27\x20not\x20found','SEGMENT_NOT_FOUND','segments','getParentSegmentFull','\x20in\x20parent\x20','1027572hVmPtu','isArray','getParent','resolveParentIdOrName','Maximum\x20recursion\x20depth\x20(','some','parent\x20segment','client','Child\x20segment\x20not\x20found:\x20','Folder\x20not\x20found:\x20','test','executeQuery','enriched','listFolders','schema','Attribute\x20\x27','Fetching\x20enriched\x20master\x20data...','allValid','behavior','getAudienceBehaviors','updateSegmentById','INVALID_ARGUMENT','getSegment','map','1478286sWfUnn','parentFolderId','Folder\x20\x27','Fetching\x20master\x20sample\x20data...','groupingName','Calculating\x20statistics\x20for:\x20','getActivation','segmentFolderId','listRecursive','70568RNyOuM','createParent','parent_key','listSegments','Validating\x20all\x20attributes\x20and\x20behaviors\x20in\x20parallel...','population','string','124852OGPPPC','24RXFmjb','logger','listFields','updatedAt','6569793VXRACi','listParents','listSegmentFolders','Validating\x20all\x20attributes\x20in\x20parallel...','Segment\x20\x27','Resource\x20\x27','Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)','description','parentTableName','15AfczIS','55eQZksw','createFolder','table','getSegmentSQL','ambiguous','resolveFolderId','updateParent','catch','join','database','756JJxASZ','\x27\x20not\x20found\x20in\x20parent\x20segment','attribute','getParentSegmentSQL','Path\x20cannot\x20be\x20empty','resolveParentId','Validating\x20all\x20behaviors\x20in\x20parallel...','Behavior\x20\x27','runParent','name','Master\x20table:\x20','onProgress','error','listParentSegments','parentDatabaseName'];a74_0x11b4=function(){return _0x29752a;};return a74_0x11b4();}const a74_0x25922c=a74_0x1f75;function a74_0x1f75(_0x13f07a,_0x42d1bd){_0x13f07a=_0x13f07a-0x13a;const _0x11b4a3=a74_0x11b4();let _0x1f75fb=_0x11b4a3[_0x13f07a];return _0x1f75fb;}(function(_0x27d571,_0x44dcfa){const _0x48ded6=a74_0x1f75,_0x512812=_0x27d571();while(!![]){try{const _0x415a00=parseInt(_0x48ded6(0x170))/0x1*(parseInt(_0x48ded6(0x158))/0x2)+-parseInt(_0x48ded6(0x1a0))/0x3*(parseInt(_0x48ded6(0x198))/0x4)+-parseInt(_0x48ded6(0x1ad))/0x5*(-parseInt(_0x48ded6(0x18f))/0x6)+parseInt(_0x48ded6(0x177))/0x7*(parseInt(_0x48ded6(0x13a))/0x8)+-parseInt(_0x48ded6(0x1a4))/0x9*(parseInt(_0x48ded6(0x13d))/0xa)+parseInt(_0x48ded6(0x1ae))/0xb*(parseInt(_0x48ded6(0x14f))/0xc)+parseInt(_0x48ded6(0x19f))/0xd*(-parseInt(_0x48ded6(0x1b8))/0xe);if(_0x415a00===_0x44dcfa)break;else _0x512812['push'](_0x512812['shift']());}catch(_0x2c7fb6){_0x512812['push'](_0x512812['shift']());}}}(a74_0x11b4,0xe2aad));import{CDPApiClient}from'../client/cdp-api-client.js';import{TrinoApiClient}from'../client/trino-api-client.js';import{SDKError,ErrorCode}from'./errors.js';import{parsePath}from'../utils/segment-path-parser.js';import{apiToYaml,yamlToApi,toYamlString,parseYamlString}from'./segment/parent-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{DEFAULT_TIME_RANGE,DEFAULT_SAMPLE_LIMIT,generateSchemaValidationSQL,generateMasterCountSQL,generateMasterSampleSQL,generateAttributeCoverageSQL,generateBehaviorStatsSQL,generateAttributeSampleSQL,generateBehaviorSampleSQL,generateEnrichedSQL,generateAttributeSchemaSQL,generateBehaviorSchemaSQL,findAttributeByName,findBehaviorByName,getAttributeColumns,getBehaviorColumns}from'./segment/parent-segment-preview.js';export class SegmentSDK{['client'];[a74_0x25922c(0x169)];constructor(_0x367a8d){const _0x2d8fe1=a74_0x25922c;this['client']=new CDPApiClient(_0x367a8d,_0x367a8d[_0x2d8fe1(0x1a1)]),this[_0x2d8fe1(0x169)]=new TrinoApiClient(_0x367a8d,_0x367a8d['logger']);}async[a74_0x25922c(0x1a5)](){const _0xca1c1a=a74_0x25922c;return await this[_0xca1c1a(0x17e)][_0xca1c1a(0x1c5)]();}async[a74_0x25922c(0x179)](_0x1c7b58){const _0x1f1c21=a74_0x25922c;return await this[_0x1f1c21(0x17e)][_0x1f1c21(0x154)](_0x1c7b58);}async['listSegments'](_0x5edbad){const _0x340581=a74_0x25922c;return await this[_0x340581(0x17e)][_0x340581(0x19b)](_0x5edbad);}async['getSegment'](_0x4eaf68,_0x196520){const _0x2a35ea=a74_0x25922c;return await this[_0x2a35ea(0x17e)][_0x2a35ea(0x18d)](_0x4eaf68,_0x196520);}async[a74_0x25922c(0x184)](_0x299aba){const _0x44427f=a74_0x25922c;return await this[_0x44427f(0x17e)][_0x44427f(0x1a6)](_0x299aba);}async[a74_0x25922c(0x13c)](_0x108811){const _0x55fd5b=a74_0x25922c;return await this[_0x55fd5b(0x17e)]['getSegmentFolder'](_0x108811);}async['listActivations'](_0x2bc93f,_0x4428a1){const _0x90615f=a74_0x25922c;return await this[_0x90615f(0x17e)]['listActivations'](_0x2bc93f,_0x4428a1);}async[a74_0x25922c(0x195)](_0x587a4d,_0x3845bf,_0x17b1be){const _0x8e08bc=a74_0x25922c;return await this[_0x8e08bc(0x17e)]['getActivation'](_0x587a4d,_0x3845bf,_0x17b1be);}async[a74_0x25922c(0x167)](_0x4f341f,_0x4b22b7,_0x3b13ce){const _0x5ecb1e=a74_0x25922c;return await this[_0x5ecb1e(0x17e)][_0x5ecb1e(0x167)](_0x4f341f,_0x4b22b7,_0x3b13ce);}async['updateActivation'](_0x555d10,_0x4ef11a,_0x29b7a5,_0x2329df){const _0x4d33ee=a74_0x25922c;return await this[_0x4d33ee(0x17e)][_0x4d33ee(0x156)](_0x555d10,_0x4ef11a,_0x29b7a5,_0x2329df);}async[a74_0x25922c(0x1c7)](_0x1b78e7,_0x1a7f16,_0x20d2d1){const _0x1f28af=a74_0x25922c;return await this[_0x1f28af(0x17e)][_0x1f28af(0x1c7)](_0x1b78e7,_0x1a7f16,_0x20d2d1);}async['getParentSQL'](_0x289991){const _0x1a681a=a74_0x25922c;return await this[_0x1a681a(0x17e)][_0x1a681a(0x1bb)](_0x289991);}async[a74_0x25922c(0x1b1)](_0x1b5f83,_0x1e8f76){const _0x44000c=a74_0x25922c;return await this[_0x44000c(0x17e)]['getSegmentSQL'](_0x1b5f83,_0x1e8f76);}async[a74_0x25922c(0x1bd)](_0x58d13f){const _0x4375bd=a74_0x25922c,_0x27819d=await this[_0x4375bd(0x1a5)](),_0x57de9e=_0x27819d[_0x4375bd(0x163)](_0x5e89ae=>_0x5e89ae[_0x4375bd(0x15f)]['name']===_0x58d13f);if(!_0x57de9e)throw new SDKError(ErrorCode[_0x4375bd(0x173)],'Parent\x20segment\x20not\x20found:\x20'+_0x58d13f);return _0x57de9e['id'];}async[a74_0x25922c(0x1c0)](_0x5c7fe6){const _0x588441=a74_0x25922c;let _0x303a67=_0x5c7fe6;return!/^\d+$/[_0x588441(0x181)](_0x5c7fe6)&&(_0x303a67=await this[_0x588441(0x1bd)](_0x5c7fe6)),await this[_0x588441(0x17e)]['runParentSegment'](_0x303a67);}async['resolveSegmentId'](_0x514824,_0x39a9f5){const _0x33857a=a74_0x25922c,_0x33650d=await this[_0x33857a(0x19b)](_0x514824),_0x2d058a=_0x33650d[_0x33857a(0x163)](_0x177b89=>_0x177b89[_0x33857a(0x1c1)]===_0x39a9f5);if(!_0x2d058a)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x33857a(0x17f)+_0x39a9f5+'\x20in\x20parent\x20'+_0x514824);return _0x2d058a['id'];}async[a74_0x25922c(0x1b3)](_0x5963e9,_0x35a6cf){const _0x2320e4=a74_0x25922c,_0x414f48=await this[_0x2320e4(0x184)](_0x5963e9),_0x220a3e=_0x414f48[_0x2320e4(0x163)](_0x1c8d35=>_0x1c8d35[_0x2320e4(0x1c1)]===_0x35a6cf);if(!_0x220a3e)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2320e4(0x180)+_0x35a6cf+_0x2320e4(0x176)+_0x5963e9);return _0x220a3e['id'];}async[a74_0x25922c(0x1a2)](_0x25cc23){const _0x2c50e1=a74_0x25922c,_0x28225e=await this[_0x2c50e1(0x17a)](_0x25cc23),[_0x4d6b40,_0x3f6aaa]=await Promise[_0x2c50e1(0x146)]([this['client'][_0x2c50e1(0x152)](_0x28225e),this[_0x2c50e1(0x17e)][_0x2c50e1(0x18a)](_0x28225e)]),_0x53452e=[];for(const _0x30265a of _0x4d6b40){_0x53452e[_0x2c50e1(0x16d)]({'name':_0x30265a[_0x2c50e1(0x1c1)],'type':_0x30265a[_0x2c50e1(0x14e)],'source':_0x2c50e1(0x1ba),'parentDatabaseName':_0x30265a[_0x2c50e1(0x1c6)],'parentTableName':_0x30265a['parentTableName'],'parentColumn':_0x30265a[_0x2c50e1(0x14a)],'groupingName':_0x30265a[_0x2c50e1(0x193)]??undefined});}for(const _0xedb462 of _0x3f6aaa){const _0x504ca2=_0xedb462['name'];if(_0xedb462[_0x2c50e1(0x185)]&&Array[_0x2c50e1(0x178)](_0xedb462[_0x2c50e1(0x185)]))for(const _0x59eae2 of _0xedb462[_0x2c50e1(0x185)]){_0x59eae2[_0x2c50e1(0x1c1)]&&_0x59eae2['type']&&_0x53452e[_0x2c50e1(0x16d)]({'name':_0x504ca2+'.'+_0x59eae2[_0x2c50e1(0x1c1)],'type':_0x59eae2[_0x2c50e1(0x14e)],'source':_0x2c50e1(0x189),'behaviorName':_0x504ca2,'parentDatabaseName':_0xedb462[_0x2c50e1(0x1c6)],'parentTableName':_0xedb462[_0x2c50e1(0x1ac)],'parentColumn':_0x59eae2['parentColumn']});}}return _0x53452e;}async[a74_0x25922c(0x199)](_0x510dbf){const _0xc83a5f=a74_0x25922c;return await this[_0xc83a5f(0x17e)][_0xc83a5f(0x159)](_0x510dbf);}async[a74_0x25922c(0x1b4)](_0x5efbe9,_0xb082d){const _0x38c840=a74_0x25922c,_0x4d8483=await this['resolveParentIdOrName'](_0x5efbe9);return await this[_0x38c840(0x17e)]['updateParentSegment'](_0x4d8483,_0xb082d);}async[a74_0x25922c(0x13e)](_0x5d6d7f){const _0x2e0bf3=a74_0x25922c,_0x557796=await this[_0x2e0bf3(0x17a)](_0x5d6d7f);return await this[_0x2e0bf3(0x17e)][_0x2e0bf3(0x175)](_0x557796);}async[a74_0x25922c(0x157)](_0x47bcdc){const _0x3a28e3=await this['getParentFull'](_0x47bcdc),_0x1e51c3=apiToYaml(_0x3a28e3);return toYamlString(_0x1e51c3);}async['pushParentYaml'](_0x52be4e){const _0x57a9d1=a74_0x25922c,_0x280f50=typeof _0x52be4e===_0x57a9d1(0x19e)?parseYamlString(_0x52be4e):_0x52be4e,_0x19cae8=yamlToApi(_0x280f50);let _0x4a5143=null,_0x2f26de='';try{_0x4a5143=await this[_0x57a9d1(0x13e)](_0x280f50[_0x57a9d1(0x1c1)]);const _0x327720=apiToYaml(_0x4a5143);_0x2f26de=toYamlString(_0x327720);}catch{}const _0x7640f6=toYamlString(_0x280f50),_0x3b61f2=generateDiff(_0x2f26de,_0x7640f6),_0x56cc21=formatDiffWithColors(_0x3b61f2),_0x3070f5=_0x4a5143===null,_0x555a61=hasChanges(_0x3b61f2),_0x253e97={'isNew':_0x3070f5,'id':_0x4a5143?.['id']||'','name':_0x280f50[_0x57a9d1(0x1c1)],'diff':_0x3b61f2,'diffFormatted':_0x56cc21,'hasChanges':_0x555a61},_0x2c59be=async()=>{const _0x1d94d2=_0x57a9d1;return _0x3070f5?await this[_0x1d94d2(0x199)](_0x19cae8):await this[_0x1d94d2(0x1b4)](_0x4a5143['id'],_0x19cae8);};return{..._0x253e97,'apply':_0x2c59be};}async[a74_0x25922c(0x143)](_0x512b54,_0x44a6a8={}){const _0x29ea39=a74_0x25922c,_0xfa5358=typeof _0x512b54===_0x29ea39(0x19e)?parseYamlString(_0x512b54):_0x512b54,_0x4b1a03=[];let _0x11cab6=!![];const _0x4cb587=_0x2cf9d2=>_0x44a6a8['onProgress']?.(_0x2cf9d2),_0x16ba2d={'name':_0xfa5358[_0x29ea39(0x1c1)],'master':{'database':_0xfa5358[_0x29ea39(0x166)][_0x29ea39(0x1b7)],'table':_0xfa5358[_0x29ea39(0x166)][_0x29ea39(0x1b0)],'schemaValid':![]},'attributes':[],'behaviors':[],'errors':_0x4b1a03,'allValid':!![]},_0x1cee38=async _0x108391=>{const _0x228464=_0x29ea39;try{const _0x98944e=await this[_0x228464(0x169)]['executeQuery'](_0x108391);return{'data':_0x98944e[_0x228464(0x15e)]};}catch(_0x56a5c6){const _0x4fef7f=_0x56a5c6 instanceof Error?_0x56a5c6['message']:String(_0x56a5c6);return{'data':[],'error':_0x4fef7f};}};_0x4cb587(_0x29ea39(0x148)+_0xfa5358['master']['database']+'.'+_0xfa5358['master'][_0x29ea39(0x1b0)]);const _0x4f9efd=generateSchemaValidationSQL(_0xfa5358[_0x29ea39(0x166)][_0x29ea39(0x1b7)],_0xfa5358[_0x29ea39(0x166)][_0x29ea39(0x1b0)]),_0x486719=await _0x1cee38(_0x4f9efd);if(_0x486719['error'])_0x16ba2d['master']['schemaValid']=![],_0x16ba2d[_0x29ea39(0x166)][_0x29ea39(0x140)]=_0x486719[_0x29ea39(0x1c4)],_0x4b1a03[_0x29ea39(0x16d)](_0x29ea39(0x1c2)+_0x486719['error']),_0x11cab6=![];else{_0x16ba2d[_0x29ea39(0x166)][_0x29ea39(0x16c)]=!![],_0x4cb587('Counting\x20master\x20table\x20rows...');const _0x462a0e=await _0x1cee38(generateMasterCountSQL(_0xfa5358));!_0x462a0e[_0x29ea39(0x1c4)]&&_0x462a0e[_0x29ea39(0x15e)][_0x29ea39(0x15a)]>0x0&&(_0x16ba2d['master'][_0x29ea39(0x149)]=_0x462a0e[_0x29ea39(0x15e)][0x0]['row_count']);}if(_0x44a6a8['master'])return _0x16ba2d[_0x29ea39(0x188)]=_0x11cab6,_0x16ba2d;const _0xc763d8=async _0x4ee79f=>{const _0x1b56fa=_0x29ea39,_0x5008b6={'name':_0x4ee79f[_0x1b56fa(0x1c1)],'database':_0x4ee79f[_0x1b56fa(0x144)][_0x1b56fa(0x1b7)],'table':_0x4ee79f[_0x1b56fa(0x144)][_0x1b56fa(0x1b0)],'joinKey':_0x4ee79f[_0x1b56fa(0x1b6)][_0x1b56fa(0x16f)],'foreignKey':_0x4ee79f['join'][_0x1b56fa(0x19a)],'columns':getAttributeColumns(_0x4ee79f),'schemaValid':![]};_0x4cb587(_0x1b56fa(0x13f)+_0x4ee79f['name']);const _0x1280c7=await _0x1cee38(generateAttributeSchemaSQL(_0xfa5358,_0x4ee79f));if(_0x1280c7[_0x1b56fa(0x1c4)])_0x5008b6[_0x1b56fa(0x140)]=_0x1280c7[_0x1b56fa(0x1c4)];else{_0x5008b6[_0x1b56fa(0x16c)]=!![],_0x4cb587(_0x1b56fa(0x15b)+_0x4ee79f[_0x1b56fa(0x1c1)]);const _0x1164c8=await _0x1cee38(generateAttributeCoverageSQL(_0xfa5358,_0x4ee79f));!_0x1164c8[_0x1b56fa(0x1c4)]&&_0x1164c8['data'][_0x1b56fa(0x15a)]>0x0&&(_0x5008b6['matchedCount']=_0x1164c8[_0x1b56fa(0x15e)][0x0]['matched_count'],_0x16ba2d[_0x1b56fa(0x166)]['rowCount']&&_0x16ba2d['master'][_0x1b56fa(0x149)]>0x0&&(_0x5008b6['coveragePercent']=_0x5008b6['matchedCount']/_0x16ba2d[_0x1b56fa(0x166)]['rowCount']*0x64));}return _0x5008b6;},_0x5d75a3=async(_0x4e00f1,_0x894090)=>{const _0x39915b=_0x29ea39,_0x56cd75={'name':_0x4e00f1['name'],'database':_0x4e00f1[_0x39915b(0x144)][_0x39915b(0x1b7)],'table':_0x4e00f1[_0x39915b(0x144)][_0x39915b(0x1b0)],'joinKey':_0x4e00f1[_0x39915b(0x1b6)][_0x39915b(0x16f)],'foreignKey':_0x4e00f1[_0x39915b(0x1b6)][_0x39915b(0x19a)],'columns':getBehaviorColumns(_0x4e00f1),'schemaValid':![]};_0x4cb587(_0x39915b(0x13b)+_0x4e00f1[_0x39915b(0x1c1)]);const _0x4b78af=await _0x1cee38(generateBehaviorSchemaSQL(_0xfa5358,_0x4e00f1));if(_0x4b78af[_0x39915b(0x1c4)])_0x56cd75['schemaError']=_0x4b78af[_0x39915b(0x1c4)];else{_0x56cd75[_0x39915b(0x16c)]=!![],_0x4cb587(_0x39915b(0x194)+_0x4e00f1[_0x39915b(0x1c1)]+'\x20('+_0x894090+')');const _0x23a940=await _0x1cee38(generateBehaviorStatsSQL(_0xfa5358,_0x4e00f1,_0x894090));!_0x23a940[_0x39915b(0x1c4)]&&_0x23a940[_0x39915b(0x15e)][_0x39915b(0x15a)]>0x0&&(_0x56cd75[_0x39915b(0x161)]=_0x23a940[_0x39915b(0x15e)][0x0]['customers_with_events'],_0x56cd75[_0x39915b(0x153)]=_0x23a940['data'][0x0]['total_events'],_0x16ba2d[_0x39915b(0x166)][_0x39915b(0x149)]&&_0x16ba2d[_0x39915b(0x166)][_0x39915b(0x149)]>0x0&&(_0x56cd75[_0x39915b(0x151)]=_0x56cd75[_0x39915b(0x161)]/_0x16ba2d[_0x39915b(0x166)][_0x39915b(0x149)]*0x64));}return _0x56cd75;},_0x32fd4c=(_0x2fd4f1,_0x5c0c0a)=>{const _0x40e0c1=_0x29ea39;_0x16ba2d[_0x40e0c1(0x15f)]=_0x2fd4f1,_0x16ba2d[_0x40e0c1(0x15d)]=_0x5c0c0a;for(const _0x35e5bb of _0x2fd4f1){!_0x35e5bb[_0x40e0c1(0x16c)]&&(_0x4b1a03[_0x40e0c1(0x16d)](_0x40e0c1(0x186)+_0x35e5bb[_0x40e0c1(0x1c1)]+_0x40e0c1(0x150)+_0x35e5bb[_0x40e0c1(0x140)]),_0x11cab6=![]);}for(const _0x3bddfe of _0x5c0c0a){!_0x3bddfe[_0x40e0c1(0x16c)]&&(_0x4b1a03[_0x40e0c1(0x16d)](_0x40e0c1(0x1bf)+_0x3bddfe[_0x40e0c1(0x1c1)]+_0x40e0c1(0x150)+_0x3bddfe['schemaError']),_0x11cab6=![]);}},_0x5f4cbe=_0x44a6a8[_0x29ea39(0x162)]||DEFAULT_TIME_RANGE;if(typeof _0x44a6a8['attribute']===_0x29ea39(0x19e)){const _0x545ac1=findAttributeByName(_0xfa5358,_0x44a6a8[_0x29ea39(0x1ba)]);if(!_0x545ac1)throw new SDKError(ErrorCode[_0x29ea39(0x173)],_0x29ea39(0x186)+_0x44a6a8[_0x29ea39(0x1ba)]+_0x29ea39(0x172));const _0x1241a6=await _0xc763d8(_0x545ac1);return _0x32fd4c([_0x1241a6],[]),_0x16ba2d['allValid']=_0x11cab6,_0x16ba2d;}if(_0x44a6a8[_0x29ea39(0x1ba)]===!![]){_0x4cb587(_0x29ea39(0x1a7));const _0x29ab64=await Promise['all']((_0xfa5358[_0x29ea39(0x15f)]||[])['map'](_0x10f791=>_0xc763d8(_0x10f791)));return _0x32fd4c(_0x29ab64,[]),_0x16ba2d[_0x29ea39(0x188)]=_0x11cab6,_0x16ba2d;}if(typeof _0x44a6a8[_0x29ea39(0x189)]==='string'){const _0x497478=findBehaviorByName(_0xfa5358,_0x44a6a8[_0x29ea39(0x189)]);if(!_0x497478)throw new SDKError(ErrorCode[_0x29ea39(0x173)],_0x29ea39(0x1bf)+_0x44a6a8[_0x29ea39(0x189)]+'\x27\x20not\x20found');const _0x2d9582=await _0x5d75a3(_0x497478,_0x5f4cbe);return _0x32fd4c([],[_0x2d9582]),_0x16ba2d[_0x29ea39(0x188)]=_0x11cab6,_0x16ba2d;}if(_0x44a6a8['behavior']===!![]){_0x4cb587(_0x29ea39(0x1be));const _0xa6183b=await Promise[_0x29ea39(0x146)]((_0xfa5358[_0x29ea39(0x15d)]||[])[_0x29ea39(0x18e)](_0x4d02aa=>_0x5d75a3(_0x4d02aa,_0x5f4cbe)));return _0x32fd4c([],_0xa6183b),_0x16ba2d[_0x29ea39(0x188)]=_0x11cab6,_0x16ba2d;}if(_0x44a6a8[_0x29ea39(0x183)]){_0x4cb587(_0x29ea39(0x1a7));const _0x21a6a1=await Promise['all']((_0xfa5358[_0x29ea39(0x15f)]||[])[_0x29ea39(0x18e)](_0x9bd82d=>_0xc763d8(_0x9bd82d)));return _0x32fd4c(_0x21a6a1,[]),_0x16ba2d[_0x29ea39(0x188)]=_0x11cab6,_0x16ba2d;}_0x4cb587(_0x29ea39(0x19c));const [_0x22095b,_0x110754]=await Promise[_0x29ea39(0x146)]([Promise[_0x29ea39(0x146)]((_0xfa5358[_0x29ea39(0x15f)]||[])['map'](_0x14fd27=>_0xc763d8(_0x14fd27))),Promise[_0x29ea39(0x146)]((_0xfa5358[_0x29ea39(0x15d)]||[])['map'](_0x37a2bb=>_0x5d75a3(_0x37a2bb,_0x5f4cbe)))]);return _0x32fd4c(_0x22095b,_0x110754),_0x16ba2d[_0x29ea39(0x188)]=_0x11cab6,_0x16ba2d;}async['previewParentYaml'](_0x452f45,_0x1dc9bf={}){const _0x2d9291=a74_0x25922c,_0xbbf8c2=typeof _0x452f45===_0x2d9291(0x19e)?parseYamlString(_0x452f45):_0x452f45,_0x500561=[];let _0x7a7a7f=!![];const _0x9d82be=_0x12e4ac=>_0x1dc9bf[_0x2d9291(0x1c3)]?.(_0x12e4ac),_0x261ca1={'name':_0xbbf8c2['name'],'master':{'database':_0xbbf8c2[_0x2d9291(0x166)][_0x2d9291(0x1b7)],'table':_0xbbf8c2[_0x2d9291(0x166)][_0x2d9291(0x1b0)],'schemaValid':!![]},'attributes':[],'behaviors':[],'errors':_0x500561,'allValid':!![]},_0x507da0=async _0x5f4a3c=>{const _0x38bc4=_0x2d9291;try{const _0x461185=await this['trinoClient'][_0x38bc4(0x182)](_0x5f4a3c);return{'data':_0x461185[_0x38bc4(0x15e)]};}catch(_0x1aaa2f){const _0x5ca9f0=_0x1aaa2f instanceof Error?_0x1aaa2f[_0x38bc4(0x15c)]:String(_0x1aaa2f);return{'data':[],'error':_0x5ca9f0};}};if(_0x1dc9bf[_0x2d9291(0x166)]){_0x9d82be(_0x2d9291(0x192));const _0x5836f6=generateMasterSampleSQL(_0xbbf8c2,DEFAULT_SAMPLE_LIMIT),_0x267d90=await _0x507da0(_0x5836f6);return!_0x267d90['error']?_0x261ca1['sampleData']=_0x267d90[_0x2d9291(0x15e)]:(_0x500561[_0x2d9291(0x16d)](_0x2d9291(0x1c2)+_0x267d90[_0x2d9291(0x1c4)]),_0x7a7a7f=![]),_0x261ca1[_0x2d9291(0x188)]=_0x7a7a7f,_0x261ca1;}if(_0x1dc9bf[_0x2d9291(0x1ba)]){const _0x28c350=findAttributeByName(_0xbbf8c2,_0x1dc9bf['attribute']);if(!_0x28c350)throw new SDKError(ErrorCode[_0x2d9291(0x173)],_0x2d9291(0x186)+_0x1dc9bf[_0x2d9291(0x1ba)]+_0x2d9291(0x172));_0x9d82be(_0x2d9291(0x171)+_0x28c350[_0x2d9291(0x1c1)]);const _0x56e1c5=generateAttributeSampleSQL(_0xbbf8c2,_0x28c350,DEFAULT_SAMPLE_LIMIT),_0x344891=await _0x507da0(_0x56e1c5);return!_0x344891[_0x2d9291(0x1c4)]?_0x261ca1[_0x2d9291(0x145)]=_0x344891[_0x2d9291(0x15e)]:(_0x500561[_0x2d9291(0x16d)]('Attribute\x20\x27'+_0x28c350[_0x2d9291(0x1c1)]+'\x27:\x20'+_0x344891[_0x2d9291(0x1c4)]),_0x7a7a7f=![]),_0x261ca1['allValid']=_0x7a7a7f,_0x261ca1;}if(_0x1dc9bf[_0x2d9291(0x189)]){const _0x333db2=findBehaviorByName(_0xbbf8c2,_0x1dc9bf[_0x2d9291(0x189)]);if(!_0x333db2)throw new SDKError(ErrorCode[_0x2d9291(0x173)],_0x2d9291(0x1bf)+_0x1dc9bf[_0x2d9291(0x189)]+'\x27\x20not\x20found');const _0x444607=_0x1dc9bf[_0x2d9291(0x162)]||DEFAULT_TIME_RANGE;_0x9d82be(_0x2d9291(0x171)+_0x333db2[_0x2d9291(0x1c1)]+'\x20('+_0x444607+')');const _0x4e1474=generateBehaviorSampleSQL(_0xbbf8c2,_0x333db2,DEFAULT_SAMPLE_LIMIT,_0x444607),_0xe3e3cb=await _0x507da0(_0x4e1474);return!_0xe3e3cb[_0x2d9291(0x1c4)]?_0x261ca1[_0x2d9291(0x145)]=_0xe3e3cb[_0x2d9291(0x15e)]:(_0x500561['push'](_0x2d9291(0x1bf)+_0x333db2['name']+'\x27:\x20'+_0xe3e3cb[_0x2d9291(0x1c4)]),_0x7a7a7f=![]),_0x261ca1[_0x2d9291(0x188)]=_0x7a7a7f,_0x261ca1;}if(_0x1dc9bf[_0x2d9291(0x183)]){_0x9d82be(_0x2d9291(0x187));const _0x3c4b4b=generateEnrichedSQL(_0xbbf8c2,DEFAULT_SAMPLE_LIMIT),_0xbe252=await _0x507da0(_0x3c4b4b);return!_0xbe252[_0x2d9291(0x1c4)]?_0x261ca1['sampleData']=_0xbe252['data']:(_0x500561[_0x2d9291(0x16d)]('Enriched\x20query:\x20'+_0xbe252[_0x2d9291(0x1c4)]),_0x7a7a7f=![]),_0x261ca1[_0x2d9291(0x188)]=_0x7a7a7f,_0x261ca1;}return _0x261ca1[_0x2d9291(0x188)]=_0x7a7a7f,_0x261ca1;}async[a74_0x25922c(0x16e)](_0x1bb0a5,_0x592584){const _0x7074ff=a74_0x25922c;return await this[_0x7074ff(0x17e)][_0x7074ff(0x16e)](_0x1bb0a5,_0x592584);}async[a74_0x25922c(0x18b)](_0x24f2da,_0x2234b2,_0x30fd58){const _0x2351f2=a74_0x25922c;return await this[_0x2351f2(0x17e)]['updateSegment'](_0x24f2da,_0x2234b2,_0x30fd58);}async['deleteSegment'](_0xe7300){const _0x4140b2=a74_0x25922c;return await this['client'][_0x4140b2(0x147)](_0xe7300);}async[a74_0x25922c(0x1af)](_0x586f70,_0x38cd8a){const _0x316961=a74_0x25922c,_0x2551be=await this[_0x316961(0x17a)](_0x586f70);return await this['client']['createSegmentFolder'](_0x2551be,_0x38cd8a);}async[a74_0x25922c(0x17a)](_0x302edc){const _0x8d8e6b=a74_0x25922c;if(/^\d+$/[_0x8d8e6b(0x181)](_0x302edc))return _0x302edc;return await this['resolveParentId'](_0x302edc);}async['detectResourceType'](_0x257fac,_0x1e5a7d){const _0x2a6cda=a74_0x25922c,[_0x21e181,_0x55d0e1]=await Promise[_0x2a6cda(0x146)]([this[_0x2a6cda(0x1b3)](_0x257fac,_0x1e5a7d)[_0x2a6cda(0x165)](()=>!![])[_0x2a6cda(0x1b5)](()=>![]),this['resolveSegmentId'](_0x257fac,_0x1e5a7d)[_0x2a6cda(0x165)](()=>!![])[_0x2a6cda(0x1b5)](()=>![])]);if(_0x21e181&&_0x55d0e1)return _0x2a6cda(0x1b2);else{if(_0x21e181)return _0x2a6cda(0x155);else{if(_0x55d0e1)return _0x2a6cda(0x14c);}}throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2a6cda(0x1a9)+_0x1e5a7d+_0x2a6cda(0x1b9));}async['detectResourceTypeInFolder'](_0x5dd0c6,_0x2faba0,_0x25f49f){const _0xe96e69=a74_0x25922c,[_0xeda382,_0x49e6b0]=await Promise[_0xe96e69(0x146)]([this['listFolders'](_0x5dd0c6),this[_0xe96e69(0x19b)](_0x5dd0c6)]),_0x47c93d=_0x25f49f?_0xeda382[_0xe96e69(0x142)](_0x16b9fd=>_0x16b9fd['parentFolderId']===_0x25f49f):_0xeda382[_0xe96e69(0x142)](_0x306399=>!_0x306399[_0xe96e69(0x190)]),_0x6acfd4=_0x25f49f?_0x49e6b0[_0xe96e69(0x142)](_0x341b4b=>_0x341b4b[_0xe96e69(0x196)]===_0x25f49f):_0x49e6b0[_0xe96e69(0x142)](_0x259146=>!_0x259146[_0xe96e69(0x196)]),_0x2a0a69=_0x47c93d[_0xe96e69(0x17c)](_0x115307=>_0x115307[_0xe96e69(0x1c1)]===_0x2faba0),_0x51c55f=_0x6acfd4[_0xe96e69(0x17c)](_0x5de94b=>_0x5de94b[_0xe96e69(0x1c1)]===_0x2faba0);if(_0x2a0a69&&_0x51c55f)return _0xe96e69(0x1b2);else{if(_0x2a0a69)return'folder';else{if(_0x51c55f)return'segment';}}throw new SDKError(ErrorCode[_0xe96e69(0x173)],_0xe96e69(0x1a9)+_0x2faba0+_0xe96e69(0x168)+(_0x25f49f?_0xe96e69(0x155):_0xe96e69(0x17d)));}async['traversePath'](_0x7b4ef2){const _0x25f3ab=a74_0x25922c;if(_0x7b4ef2[_0x25f3ab(0x15a)]===0x0)throw new SDKError(ErrorCode[_0x25f3ab(0x18c)],_0x25f3ab(0x1bc));const _0x39d70d=_0x7b4ef2[0x0],_0x5d69e5=await this['resolveParentId'](_0x39d70d);if(_0x7b4ef2[_0x25f3ab(0x15a)]===0x1)return{'parentId':_0x5d69e5,'parentName':_0x39d70d,'type':_0x25f3ab(0x14d),'fullPath':_0x39d70d};const _0x469aaa=await this[_0x25f3ab(0x13e)](_0x5d69e5),_0x52c028=_0x469aaa[_0x25f3ab(0x16b)],_0x39194d=[];let _0x586672=_0x52c028;for(let _0x1fe13a=0x1;_0x1fe13a<_0x7b4ef2['length']-0x1;_0x1fe13a++){const _0x37a876=_0x7b4ef2[_0x1fe13a],_0x50e345=await this[_0x25f3ab(0x184)](_0x5d69e5),_0x40586c=_0x586672?_0x50e345['find'](_0x3f9a0f=>_0x3f9a0f['name']===_0x37a876&&_0x3f9a0f[_0x25f3ab(0x190)]===_0x586672):_0x50e345[_0x25f3ab(0x163)](_0x284219=>_0x284219['name']===_0x37a876&&!_0x284219[_0x25f3ab(0x190)]);if(!_0x40586c)throw new SDKError(ErrorCode[_0x25f3ab(0x173)],'Folder\x20\x27'+_0x37a876+'\x27\x20not\x20found\x20in\x20path');_0x39194d['push'](_0x37a876),_0x586672=_0x40586c['id'];}const _0x536db3=_0x7b4ef2[_0x7b4ef2[_0x25f3ab(0x15a)]-0x1],_0xa14776=await this[_0x25f3ab(0x164)](_0x5d69e5,_0x536db3,_0x586672);if(_0xa14776==='ambiguous'||_0xa14776===_0x25f3ab(0x155)){const _0x434fe8=await this[_0x25f3ab(0x184)](_0x5d69e5),_0x3bfe4c=_0x586672?_0x434fe8['find'](_0x5c24e7=>_0x5c24e7[_0x25f3ab(0x1c1)]===_0x536db3&&_0x5c24e7['parentFolderId']===_0x586672):_0x434fe8['find'](_0x1999f0=>_0x1999f0['name']===_0x536db3&&!_0x1999f0[_0x25f3ab(0x190)]);if(!_0x3bfe4c)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x25f3ab(0x191)+_0x536db3+_0x25f3ab(0x172));return _0x39194d[_0x25f3ab(0x16d)](_0x536db3),{'parentId':_0x5d69e5,'parentName':_0x39d70d,'folderId':_0x3bfe4c['id'],'folderPath':_0x39194d,'type':_0x25f3ab(0x155),'fullPath':_0x7b4ef2[_0x25f3ab(0x1b6)]('/')};}else{const _0x558595=await this[_0x25f3ab(0x19b)](_0x5d69e5),_0x391af3=_0x586672?_0x558595['find'](_0x42e22d=>_0x42e22d['name']===_0x536db3&&_0x42e22d['segmentFolderId']===_0x586672):_0x558595['find'](_0x558d8f=>_0x558d8f[_0x25f3ab(0x1c1)]===_0x536db3&&!_0x558d8f[_0x25f3ab(0x196)]);if(!_0x391af3)throw new SDKError(ErrorCode[_0x25f3ab(0x173)],_0x25f3ab(0x1a8)+_0x536db3+_0x25f3ab(0x172));return{'parentId':_0x5d69e5,'parentName':_0x39d70d,'folderId':_0x586672,'folderPath':_0x39194d['length']>0x0?_0x39194d:undefined,'segmentId':_0x391af3['id'],'segmentName':_0x536db3,'type':_0x25f3ab(0x14c),'fullPath':_0x7b4ef2[_0x25f3ab(0x1b6)]('/')};}}async['resolvePathToResource'](_0x368738){const _0x12ab88=a74_0x25922c,_0x1afb1f=parsePath(_0x368738);if(!_0x1afb1f[_0x12ab88(0x141)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x12ab88(0x1aa));return await this['traversePath'](_0x1afb1f[_0x12ab88(0x174)]);}async[a74_0x25922c(0x16a)](_0x1cc9d4,_0x10c9f7){const _0x158786=a74_0x25922c,[_0x46f185,_0x73f289]=await Promise['all']([this[_0x158786(0x184)](_0x1cc9d4),this[_0x158786(0x19b)](_0x1cc9d4)]);if(_0x10c9f7){const _0x103dda=_0x46f185['filter'](_0x390779=>_0x390779[_0x158786(0x190)]===_0x10c9f7),_0x46fd8a=_0x73f289[_0x158786(0x142)](_0x56677b=>_0x56677b[_0x158786(0x196)]===_0x10c9f7);return{'folders':_0x103dda,'segments':_0x46fd8a};}const _0x10fe63=await this['getParentFull'](_0x1cc9d4),_0x5da3d6=_0x10fe63[_0x158786(0x16b)];if(_0x5da3d6){const _0x2ba634=_0x46f185['filter'](_0x2fcea9=>_0x2fcea9[_0x158786(0x190)]===_0x5da3d6),_0x5edc49=_0x73f289[_0x158786(0x142)](_0x5717ed=>_0x5717ed['segmentFolderId']===_0x5da3d6);return{'folders':_0x2ba634,'segments':_0x5edc49};}const _0x5b23a6=_0x46f185['filter'](_0xf2567b=>!_0xf2567b[_0x158786(0x190)]),_0x38c7f8=_0x73f289[_0x158786(0x142)](_0xa4cb19=>!_0xa4cb19[_0x158786(0x196)]);return{'folders':_0x5b23a6,'segments':_0x38c7f8};}async['listRecursive'](_0x50dde5,_0x52f185,_0x168f89=0x0,_0x115ec9=0xa){const _0x1a19e1=a74_0x25922c;if(_0x168f89>=_0x115ec9)throw new SDKError(ErrorCode[_0x1a19e1(0x18c)],_0x1a19e1(0x17b)+_0x115ec9+_0x1a19e1(0x160));const {folders:_0x144c11,segments:_0x1a8460}=await this[_0x1a19e1(0x16a)](_0x50dde5,_0x52f185),_0x41c47b=[];for(const _0x3cdb82 of _0x144c11){const _0x4b80cd=await this[_0x1a19e1(0x197)](_0x50dde5,_0x3cdb82['id'],_0x168f89+0x1,_0x115ec9);_0x41c47b[_0x1a19e1(0x16d)]({'type':_0x1a19e1(0x155),'id':_0x3cdb82['id'],'name':_0x3cdb82['name'],'children':_0x4b80cd[_0x1a19e1(0x15a)]>0x0?_0x4b80cd:undefined,'metadata':{'description':_0x3cdb82[_0x1a19e1(0x1ab)]||undefined,'folderCount':_0x4b80cd[_0x1a19e1(0x142)](_0x4706f7=>_0x4706f7['type']===_0x1a19e1(0x155))[_0x1a19e1(0x15a)],'segmentCount':_0x4b80cd['filter'](_0x795124=>_0x795124[_0x1a19e1(0x14e)]===_0x1a19e1(0x14c))[_0x1a19e1(0x15a)],'createdAt':_0x3cdb82[_0x1a19e1(0x14b)],'updatedAt':_0x3cdb82['updatedAt']}});}for(const _0x40f0c3 of _0x1a8460){_0x41c47b[_0x1a19e1(0x16d)]({'type':_0x1a19e1(0x14c),'id':_0x40f0c3['id'],'name':_0x40f0c3['name'],'population':_0x40f0c3[_0x1a19e1(0x19d)],'metadata':{'description':_0x40f0c3[_0x1a19e1(0x1ab)],'createdAt':_0x40f0c3['createdAt'],'updatedAt':_0x40f0c3[_0x1a19e1(0x1a3)]}});}return _0x41c47b;}}
package/dist/sdk/user.js CHANGED
@@ -1 +1 @@
1
- function a75_0x5539(_0x503014,_0x577340){_0x503014=_0x503014-0x155;const _0x10b727=a75_0x10b7();let _0x55395e=_0x10b727[_0x503014];return _0x55395e;}const a75_0x893ec0=a75_0x5539;(function(_0x4091e4,_0x3fb02f){const _0x25c812=a75_0x5539,_0x7c8d91=_0x4091e4();while(!![]){try{const _0x247caf=-parseInt(_0x25c812(0x169))/0x1+-parseInt(_0x25c812(0x15d))/0x2*(-parseInt(_0x25c812(0x157))/0x3)+parseInt(_0x25c812(0x164))/0x4*(-parseInt(_0x25c812(0x163))/0x5)+-parseInt(_0x25c812(0x161))/0x6+parseInt(_0x25c812(0x160))/0x7*(-parseInt(_0x25c812(0x16d))/0x8)+-parseInt(_0x25c812(0x15a))/0x9+-parseInt(_0x25c812(0x165))/0xa*(-parseInt(_0x25c812(0x15b))/0xb);if(_0x247caf===_0x3fb02f)break;else _0x7c8d91['push'](_0x7c8d91['shift']());}catch(_0x5e8c7d){_0x7c8d91['push'](_0x7c8d91['shift']());}}}(a75_0x10b7,0x723aa));import{TDApiClient}from'../client/td-api-client.js';function a75_0x10b7(){const _0x72cc5d=['client','email','7cqZQlz','3277308lIAyAO','profile','128500FaDNiY','56nsCRXt','4965230ToLslB','find','default','buildEmailToIdMap','139025MVJmKw','listUsers','map','buildUserMaps','6680056oTIGrW','toLowerCase','list','getCurrent','1077804LONHeo','findByEmail','findById','4445559cPcQet','55pNlVcx','buildIdToEmailMap','2RUcjWq'];a75_0x10b7=function(){return _0x72cc5d;};return a75_0x10b7();}import{loadCachedUsers,saveCachedUsers,clearUserCache}from'../core/user-cache.js';export class UserSDK{['client'];[a75_0x893ec0(0x162)];constructor(_0x4e2ea2){const _0x2bd615=a75_0x893ec0;this[_0x2bd615(0x15e)]=new TDApiClient(_0x4e2ea2,_0x4e2ea2['logger']),this[_0x2bd615(0x162)]=_0x4e2ea2[_0x2bd615(0x162)]||_0x2bd615(0x167);}async[a75_0x893ec0(0x156)](){const _0x4dee12=a75_0x893ec0;return await this[_0x4dee12(0x15e)]['getUserInfo']();}async[a75_0x893ec0(0x155)](_0x276a73=![]){const _0x80f65f=a75_0x893ec0;if(!_0x276a73){const _0x1f95c9=loadCachedUsers(this[_0x80f65f(0x162)]);if(_0x1f95c9)return _0x1f95c9;}const _0x43d2f9=await this[_0x80f65f(0x15e)][_0x80f65f(0x16a)]();return saveCachedUsers(this[_0x80f65f(0x162)],_0x43d2f9),_0x43d2f9;}['clearCache'](){const _0x283cea=a75_0x893ec0;clearUserCache(this[_0x283cea(0x162)]);}async[a75_0x893ec0(0x158)](_0x4231dd){const _0x4ab87d=a75_0x893ec0,_0x3d2f79=await this[_0x4ab87d(0x155)]();return _0x3d2f79[_0x4ab87d(0x166)](_0xe4d61f=>_0xe4d61f[_0x4ab87d(0x15f)][_0x4ab87d(0x16e)]()===_0x4231dd['toLowerCase']());}async[a75_0x893ec0(0x159)](_0x591229){const _0x1a170c=a75_0x893ec0,_0x3abd0c=await this['list']();return _0x3abd0c[_0x1a170c(0x166)](_0x1a2d1c=>_0x1a2d1c['id']===_0x591229);}async[a75_0x893ec0(0x168)](){const _0x227216=a75_0x893ec0,_0x6cf172=await this[_0x227216(0x155)]();return new Map(_0x6cf172[_0x227216(0x16b)](_0x4d8479=>[_0x4d8479['email'][_0x227216(0x16e)](),_0x4d8479['id']]));}async[a75_0x893ec0(0x15c)](){const _0x1aed0d=a75_0x893ec0,_0x3d8a1f=await this[_0x1aed0d(0x155)]();return new Map(_0x3d8a1f[_0x1aed0d(0x16b)](_0x4677f6=>[_0x4677f6['id'],_0x4677f6['email']]));}async[a75_0x893ec0(0x16c)](){const _0x5c645d=a75_0x893ec0,_0x34c7ea=await this[_0x5c645d(0x155)]();return{'emailToId':new Map(_0x34c7ea[_0x5c645d(0x16b)](_0x440cb2=>[_0x440cb2[_0x5c645d(0x15f)][_0x5c645d(0x16e)](),_0x440cb2['id']])),'idToEmail':new Map(_0x34c7ea[_0x5c645d(0x16b)](_0xae634a=>[_0xae634a['id'],_0xae634a[_0x5c645d(0x15f)]]))};}}
1
+ const a75_0x5cfd48=a75_0x3383;(function(_0x40c743,_0x336294){const _0xcd2da3=a75_0x3383,_0x253842=_0x40c743();while(!![]){try{const _0x5cf5ac=-parseInt(_0xcd2da3(0x183))/0x1*(-parseInt(_0xcd2da3(0x180))/0x2)+-parseInt(_0xcd2da3(0x185))/0x3+parseInt(_0xcd2da3(0x179))/0x4*(parseInt(_0xcd2da3(0x187))/0x5)+parseInt(_0xcd2da3(0x176))/0x6*(-parseInt(_0xcd2da3(0x18a))/0x7)+-parseInt(_0xcd2da3(0x18b))/0x8*(parseInt(_0xcd2da3(0x17a))/0x9)+-parseInt(_0xcd2da3(0x17e))/0xa+parseInt(_0xcd2da3(0x186))/0xb;if(_0x5cf5ac===_0x336294)break;else _0x253842['push'](_0x253842['shift']());}catch(_0x21bccd){_0x253842['push'](_0x253842['shift']());}}}(a75_0x1673,0x7f46d));import{TDApiClient}from'../client/td-api-client.js';function a75_0x3383(_0x34c8e8,_0x2cfa07){_0x34c8e8=_0x34c8e8-0x174;const _0x1673ad=a75_0x1673();let _0x338305=_0x1673ad[_0x34c8e8];return _0x338305;}import{loadCachedUsers,saveCachedUsers,clearUserCache}from'../core/user-cache.js';export class UserSDK{['client'];[a75_0x5cfd48(0x177)];constructor(_0xd89d65){const _0x488326=a75_0x5cfd48;this[_0x488326(0x18e)]=new TDApiClient(_0xd89d65,_0xd89d65[_0x488326(0x17c)]),this[_0x488326(0x177)]=_0xd89d65[_0x488326(0x177)]||_0x488326(0x17b);}async[a75_0x5cfd48(0x188)](){const _0x49d6d3=a75_0x5cfd48;return await this[_0x49d6d3(0x18e)][_0x49d6d3(0x18c)]();}async[a75_0x5cfd48(0x181)](_0x4da1f4=![]){const _0x34f73c=a75_0x5cfd48;if(!_0x4da1f4){const _0x275025=loadCachedUsers(this['profile']);if(_0x275025)return _0x275025;}const _0x5329cf=await this[_0x34f73c(0x18e)][_0x34f73c(0x175)]();return saveCachedUsers(this[_0x34f73c(0x177)],_0x5329cf),_0x5329cf;}[a75_0x5cfd48(0x184)](){const _0x8135a3=a75_0x5cfd48;clearUserCache(this[_0x8135a3(0x177)]);}async['findByEmail'](_0x2992a5){const _0x5f7ab8=a75_0x5cfd48,_0xb6c794=await this['list']();return _0xb6c794[_0x5f7ab8(0x182)](_0x10060c=>_0x10060c['email'][_0x5f7ab8(0x178)]()===_0x2992a5[_0x5f7ab8(0x178)]());}async[a75_0x5cfd48(0x17d)](_0x1af01e){const _0x1f7c92=a75_0x5cfd48,_0x2d863f=await this[_0x1f7c92(0x181)]();return _0x2d863f[_0x1f7c92(0x182)](_0x116c1b=>_0x116c1b['id']===_0x1af01e);}async[a75_0x5cfd48(0x18f)](){const _0x439b4a=a75_0x5cfd48,_0x245ac7=await this['list']();return new Map(_0x245ac7[_0x439b4a(0x189)](_0x5ebeac=>[_0x5ebeac[_0x439b4a(0x18d)][_0x439b4a(0x178)](),_0x5ebeac['id']]));}async[a75_0x5cfd48(0x174)](){const _0x22a1ba=a75_0x5cfd48,_0x18318e=await this[_0x22a1ba(0x181)]();return new Map(_0x18318e['map'](_0x3d09a2=>[_0x3d09a2['id'],_0x3d09a2[_0x22a1ba(0x18d)]]));}async[a75_0x5cfd48(0x17f)](){const _0x355833=a75_0x5cfd48,_0x2c5ceb=await this[_0x355833(0x181)]();return{'emailToId':new Map(_0x2c5ceb['map'](_0x3ae24c=>[_0x3ae24c['email'][_0x355833(0x178)](),_0x3ae24c['id']])),'idToEmail':new Map(_0x2c5ceb[_0x355833(0x189)](_0x5dd237=>[_0x5dd237['id'],_0x5dd237[_0x355833(0x18d)]]))};}}function a75_0x1673(){const _0x56c473=['1260584JnqySw','9zSSiEm','default','logger','findById','2227020vFoIMx','buildUserMaps','1577918xnIWvq','list','find','1BkfoYG','clearCache','3001158BrRqeZ','18317882RptnmC','5wzWJnf','getCurrent','map','21rTTIGO','1154840NWXzIz','getUserInfo','email','client','buildEmailToIdMap','buildIdToEmailMap','listUsers','1761198PoXXGo','profile','toLowerCase'];a75_0x1673=function(){return _0x56c473;};return a75_0x1673();}
@@ -1 +1 @@
1
- const a76_0x24ec84=a76_0x5640;function a76_0x5640(_0x7ad714,_0x514287){_0x7ad714=_0x7ad714-0x193;const _0x10d48f=a76_0x10d4();let _0x5640ea=_0x10d48f[_0x7ad714];return _0x5640ea;}(function(_0x2b4085,_0x57c256){const _0x4d36fc=a76_0x5640,_0x1ddb7e=_0x2b4085();while(!![]){try{const _0x35892e=-parseInt(_0x4d36fc(0x1a0))/0x1+-parseInt(_0x4d36fc(0x1dc))/0x2+parseInt(_0x4d36fc(0x1b4))/0x3+-parseInt(_0x4d36fc(0x1f7))/0x4+parseInt(_0x4d36fc(0x1d9))/0x5+parseInt(_0x4d36fc(0x1db))/0x6*(-parseInt(_0x4d36fc(0x1b3))/0x7)+parseInt(_0x4d36fc(0x1d0))/0x8;if(_0x35892e===_0x57c256)break;else _0x1ddb7e['push'](_0x1ddb7e['shift']());}catch(_0xe8d9c5){_0x1ddb7e['push'](_0x1ddb7e['shift']());}}}(a76_0x10d4,0x8b971));import{WorkflowApiClient}from'../client/workflow-client.js';function a76_0x10d4(){const _0x24a238=['listLogFiles','upstreams','success','5561460IvmMLr','filter','204ZcJzBq','713304OdGCte','message','.\x20Expected\x20\x22project.workflow\x22','listWorkflows','config','client','status','clearScheduleAll','latest','isDirectory','force','tmpdir','create','killAttempt','projectName','getAttemptTasks','toString','toTime','tdx-workflow-','mkdir','index','push','logs','Invalid\x20workflow\x20format:\x20','map','done','tar','4247676HiVSIk','createdAt','No\x20','retryAttempt','getAttempt','data','run','readdir','fromTime','deleteProject','listSessions','join','cancelRequested','download','toISOString','workflowName','workflow','access','replace','1135808mJqAXr','util','retryParams','unlink','name','uploadProjectArchive','delete','indexOf','listAttempts','.tar.gz','zlib','last_id','state','revision','Cannot\x20read\x20workflow\x20file:\x20','gunzip','attempts','\x20workflow\x20files\x20found\x20in\x20project\x20directory','arrayBuffer','218918jdnWKj','1168611lUIHVe','scheduleFrom','listProjects','sessionUuid','sessionTime','tasks','kill','direct','fullName','lastId','params','isFile','isGroup','sessions','find','extract','tdx-workflow-push-','sessionId','endsWith','path','limit','now','length','substring','project','retrySession','utf-8','NUMERIC_ID_PATTERN','21501016ATYmEr','Failed\x20to\x20download\x20log\x20file:\x20','storeParams','includeRetried','Project\x20not\x20found:\x20','resolveProjectId'];a76_0x10d4=function(){return _0x24a238;};return a76_0x10d4();}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'../utils/workflow-utils.js';export class WorkflowSDK{static ['NUMERIC_ID_PATTERN']=/^\d+$/;[a76_0x24ec84(0x1e1)];constructor(_0x20de38){this['client']=new WorkflowApiClient(_0x20de38,_0x20de38['logger']);}async[a76_0x24ec84(0x1d5)](_0x377efb){const _0x4382c8=a76_0x24ec84;if(WorkflowSDK[_0x4382c8(0x1cf)]['test'](_0x377efb))return{'id':_0x377efb,'name':_0x377efb};const _0x2b7805=await this['client'][_0x4382c8(0x1b6)]({'name_pattern':_0x377efb}),_0xbbc671=_0x2b7805[_0x4382c8(0x1fc)][_0x4382c8(0x1c2)](_0xb449f2=>_0xb449f2[_0x4382c8(0x1a4)]===_0x377efb);if(!_0xbbc671)throw new Error(_0x4382c8(0x1d4)+_0x377efb);return{'id':_0xbbc671['id'],'name':_0xbbc671[_0x4382c8(0x1a4)]};}async['projects'](_0x39cde4,_0x58d846){const _0x2e8877=a76_0x24ec84,_0x41bac9=await this[_0x2e8877(0x1e1)][_0x2e8877(0x1b6)]({'name_pattern':_0x39cde4,..._0x58d846});return _0x41bac9[_0x2e8877(0x1fc)][_0x2e8877(0x1f4)](_0x62c0d=>({..._0x62c0d,'project_id':_0x62c0d['id'],'project_name':_0x62c0d[_0x2e8877(0x1a4)]}));}async['workflows'](_0x44eebb,_0x3493bd){const _0x1345e3=a76_0x24ec84,_0x34236e=await this[_0x1345e3(0x1e1)][_0x1345e3(0x1df)]({'project_name':_0x44eebb,..._0x3493bd});return _0x34236e[_0x1345e3(0x1fc)][_0x1345e3(0x1f4)](_0x1e533f=>({'project_id':_0x1e533f[_0x1345e3(0x1cc)]?.['id'],'project_name':_0x1e533f[_0x1345e3(0x1cc)]?.[_0x1345e3(0x1a4)],'workflow_id':_0x1e533f['id'],'workflow_name':_0x1e533f[_0x1345e3(0x1a4)],'revision':_0x1e533f[_0x1345e3(0x1ad)],'timezone':_0x1e533f['timezone'],'config':_0x1e533f[_0x1345e3(0x1e0)],'id':_0x1e533f['id'],'name':_0x1e533f[_0x1345e3(0x1a4)],'project':_0x1e533f['project']}));}async[a76_0x24ec84(0x1c1)](_0x5e2ad4){const _0x3e297b=a76_0x24ec84;let _0x2eefbf;if(_0x5e2ad4?.[_0x3e297b(0x1ea)]){let _0x3afbf7,_0x2fc330=![];while(!_0x2fc330){const _0x1caa04=await this[_0x3e297b(0x1e1)][_0x3e297b(0x1b6)]({'limit':0x64,'last_id':_0x3afbf7}),_0x4db156=_0x1caa04[_0x3e297b(0x1fc)][_0x3e297b(0x1c2)](_0x330b0a=>_0x330b0a[_0x3e297b(0x1a4)]===_0x5e2ad4['projectName']);if(_0x4db156){_0x2eefbf=_0x4db156['id'],_0x2fc330=!![];break;}if(!_0x1caa04[_0x3e297b(0x1bd)]||_0x1caa04['data'][_0x3e297b(0x1ca)]===0x0)break;_0x3afbf7=_0x1caa04[_0x3e297b(0x1bd)];}if(!_0x2eefbf)throw new Error('Project\x20not\x20found:\x20'+_0x5e2ad4[_0x3e297b(0x1ea)]);}const _0x4c1fbd=await this[_0x3e297b(0x1e1)][_0x3e297b(0x197)]({'project_id':_0x2eefbf,'project_name':_0x5e2ad4?.[_0x3e297b(0x1ea)],'workflow_name':_0x5e2ad4?.[_0x3e297b(0x19c)],'status':_0x5e2ad4?.[_0x3e297b(0x1e2)],'from_time':_0x5e2ad4?.[_0x3e297b(0x195)],'to_time':_0x5e2ad4?.[_0x3e297b(0x1ed)],'limit':_0x5e2ad4?.[_0x3e297b(0x1c8)],'last_id':_0x5e2ad4?.['last_id']});return _0x4c1fbd[_0x3e297b(0x1fc)]['map'](_0x4d713b=>({'project_id':_0x4d713b[_0x3e297b(0x1cc)]?.['id'],'project_name':_0x4d713b[_0x3e297b(0x1cc)]?.['name'],'workflow_id':_0x4d713b['workflow']?.['id'],'workflow_name':_0x4d713b[_0x3e297b(0x19d)]?.[_0x3e297b(0x1a4)],'session_id':_0x4d713b['id'],'sessionUuid':_0x4d713b[_0x3e297b(0x1b7)],'sessionTime':_0x4d713b['sessionTime'],'lastAttempt':_0x4d713b['lastAttempt'],'id':_0x4d713b['id'],'project':_0x4d713b['project'],'workflow':_0x4d713b[_0x3e297b(0x19d)]}));}async[a76_0x24ec84(0x1b0)](_0x2d56ba){const _0x36c5f0=a76_0x24ec84,_0xcf7c97=await this[_0x36c5f0(0x1e1)][_0x36c5f0(0x1a8)]({'project_name':_0x2d56ba?.['projectName'],'workflow_name':_0x2d56ba?.[_0x36c5f0(0x19c)],'include_retried':_0x2d56ba?.[_0x36c5f0(0x1d3)],'limit':_0x2d56ba?.['limit'],'last_id':_0x2d56ba?.[_0x36c5f0(0x1ab)]});return _0xcf7c97[_0x36c5f0(0x1fc)][_0x36c5f0(0x1f4)](_0x252159=>({'project_id':_0x252159[_0x36c5f0(0x1cc)]?.['id'],'project_name':_0x252159[_0x36c5f0(0x1cc)]?.[_0x36c5f0(0x1a4)],'workflow_id':_0x252159[_0x36c5f0(0x19d)]?.['id'],'workflow_name':_0x252159[_0x36c5f0(0x19d)]?.[_0x36c5f0(0x1a4)],'session_id':_0x252159['sessionId'],'sessionUuid':_0x252159[_0x36c5f0(0x1b7)],'sessionTime':_0x252159['sessionTime'],'attempt_id':_0x252159['id'],'attempt_index':_0x252159[_0x36c5f0(0x1f0)],'retryAttemptName':_0x252159['retryAttemptName'],'done':_0x252159[_0x36c5f0(0x1f5)],'success':_0x252159[_0x36c5f0(0x1d8)],'cancelRequested':_0x252159[_0x36c5f0(0x199)],'params':_0x252159[_0x36c5f0(0x1be)],'createdAt':_0x252159[_0x36c5f0(0x1f8)],'finishedAt':_0x252159['finishedAt'],'id':_0x252159['id'],'index':_0x252159['index'],'project':_0x252159[_0x36c5f0(0x1cc)],'workflow':_0x252159['workflow']}));}async['attempt'](_0x4786c9){const _0x45284c=a76_0x24ec84,_0x4119e7=await this[_0x45284c(0x1e1)][_0x45284c(0x1fb)](_0x4786c9);return _0x4119e7;}async[a76_0x24ec84(0x1b9)](_0xd2632b,_0x5d7bf9=![]){const _0x3360e9=a76_0x24ec84,_0x2b51af=await this['client'][_0x3360e9(0x1eb)](_0xd2632b,_0x5d7bf9);return _0x2b51af[_0x3360e9(0x1f4)](_0x283f37=>({'task_id':_0x283f37['id'],'task_name':_0x283f37[_0x3360e9(0x1bc)],'parentId':_0x283f37['parentId'],'config':_0x283f37[_0x3360e9(0x1e0)],'upstreams':_0x283f37[_0x3360e9(0x1d7)],'state':_0x283f37[_0x3360e9(0x1ac)],'exportParams':_0x283f37['exportParams'],'storeParams':_0x283f37[_0x3360e9(0x1d2)],'stateParams':_0x283f37['stateParams'],'updatedAt':_0x283f37['updatedAt'],'retryAt':_0x283f37['retryAt'],'startedAt':_0x283f37['startedAt'],'error':_0x283f37['error'],'isGroup':_0x283f37[_0x3360e9(0x1c0)],'id':_0x283f37['id'],'fullName':_0x283f37[_0x3360e9(0x1bc)]}));}async['logFiles'](_0x5a62eb,_0x936db){const _0x1026ec=a76_0x24ec84;return await this[_0x1026ec(0x1e1)][_0x1026ec(0x1d6)](_0x5a62eb,_0x936db);}async[a76_0x24ec84(0x1f2)](_0x5b7938,_0x43cc32){const _0x41fbba=a76_0x24ec84,_0x42f601=await import(_0x41fbba(0x1aa)),{promisify:_0x2e7e1a}=await import(_0x41fbba(0x1a1)),_0x49253a=_0x2e7e1a(_0x42f601[_0x41fbba(0x1af)]),_0x9f4bd3=await this['client'][_0x41fbba(0x1d6)](_0x5b7938,_0x43cc32);if(_0x9f4bd3[_0x41fbba(0x1ca)]===0x0)return'';const _0x446703=[];for(const _0x709bbd of _0x9f4bd3){if(!_0x709bbd['direct'])continue;const _0x5c7111=await fetch(_0x709bbd[_0x41fbba(0x1bb)]);if(!_0x5c7111['ok'])throw new Error(_0x41fbba(0x1d1)+_0x5c7111['status']);const _0xfd1126=Buffer['from'](await _0x5c7111[_0x41fbba(0x1b2)]()),_0xd522dc=await _0x49253a(_0xfd1126);_0x446703['push'](_0xd522dc[_0x41fbba(0x1ec)](_0x41fbba(0x1ce)));}return _0x446703['join']('\x0a');}async[a76_0x24ec84(0x1ba)](_0x3b3ef4,_0x2f905d){const _0xee48aa=a76_0x24ec84,_0x251360=await this[_0xee48aa(0x1e1)][_0xee48aa(0x1e9)](_0x3b3ef4,_0x2f905d);return _0x251360?.[_0xee48aa(0x1dd)]??'Kill\x20request\x20accepted';}async['retrySession'](_0x4d9e82,_0x8f30ae){const _0x5c12bb=a76_0x24ec84,_0xfcd73f=await this[_0x5c12bb(0x1e1)][_0x5c12bb(0x1cd)](_0x4d9e82,{'from_task':_0x8f30ae?.['fromTask'],'retry_params':_0x8f30ae?.['retryParams']});return{'attemptId':_0xfcd73f['id'],'sessionId':_0xfcd73f[_0x5c12bb(0x1c5)]};}async['retryAttempt'](_0x484590,_0x1be62c){const _0x2cee46=a76_0x24ec84,_0x45ace5=await this[_0x2cee46(0x1e1)][_0x2cee46(0x1fa)](_0x484590,{'resume_from':_0x1be62c?.['resumeFrom'],'retry_params':_0x1be62c?.[_0x2cee46(0x1a2)],'force':_0x1be62c?.[_0x2cee46(0x1e6)]});return{'attemptId':_0x45ace5['id'],'sessionId':_0x45ace5[_0x2cee46(0x1c5)]};}async[a76_0x24ec84(0x193)](_0x239437,_0x289271={},_0x29196){const _0x55eefa=a76_0x24ec84,_0x4676e1=_0x239437[_0x55eefa(0x1a7)]('.');let _0x5c6a39,_0x13724a;if(_0x4676e1===-0x1)throw new Error('Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format');_0x5c6a39=_0x239437[_0x55eefa(0x1cb)](0x0,_0x4676e1),_0x13724a=_0x239437[_0x55eefa(0x1cb)](_0x4676e1+0x1);if(!_0x5c6a39||!_0x13724a)throw new Error(_0x55eefa(0x1f3)+_0x239437+_0x55eefa(0x1de));const _0x3fc00b=_0x29196?.[_0x55eefa(0x1b8)]||new Date()[_0x55eefa(0x19b)]();return await this[_0x55eefa(0x1e1)]['startAttempt']({'projectName':_0x5c6a39,'workflowName':_0x13724a,'sessionTime':_0x3fc00b,'params':_0x289271});}async[a76_0x24ec84(0x19a)](_0xf9e3e2,_0x47543f,_0x3a3d4d){const _0x38ff6b=a76_0x24ec84,{promises:_0x532c95}=await import('fs'),_0x1683d5=await import(_0x38ff6b(0x1c7)),_0xc076=await import('os'),_0x55c85d=await import(_0x38ff6b(0x1f6)),{id:_0x51d96c,name:_0x2a9e2e}=await this['resolveProjectId'](_0xf9e3e2),_0x23ad22=_0xc076[_0x38ff6b(0x1e7)](),_0x16ccdc=_0x1683d5[_0x38ff6b(0x198)](_0x23ad22,_0x38ff6b(0x1ee)+_0x51d96c+'-'+Date[_0x38ff6b(0x1c9)]()+_0x38ff6b(0x1a9));try{await this[_0x38ff6b(0x1e1)]['downloadProjectArchive'](_0x51d96c,_0x16ccdc,_0x3a3d4d?.[_0x38ff6b(0x1ad)]);const _0x4754a9=_0x1683d5[_0x38ff6b(0x198)](_0x47543f,_0x2a9e2e);await _0x532c95[_0x38ff6b(0x1ef)](_0x4754a9,{'recursive':!![]}),await _0x55c85d[_0x38ff6b(0x1c3)]({'file':_0x16ccdc,'cwd':_0x4754a9,'gzip':!![]});const _0x14e9d5=async _0x5e7280=>{const _0x454d07=_0x38ff6b;let _0x175ce2=0x0;const _0x34f755=await _0x532c95[_0x454d07(0x194)](_0x5e7280,{'withFileTypes':!![]});for(const _0x42cd87 of _0x34f755){const _0x402b27=_0x1683d5[_0x454d07(0x198)](_0x5e7280,_0x42cd87[_0x454d07(0x1a4)]);if(_0x42cd87[_0x454d07(0x1bf)]())_0x175ce2++;else _0x42cd87[_0x454d07(0x1e5)]()&&(_0x175ce2+=await _0x14e9d5(_0x402b27));}return _0x175ce2;},_0x3eeee0=await _0x14e9d5(_0x4754a9);return{'projectName':_0x2a9e2e,'revision':_0x3a3d4d?.['revision']||_0x38ff6b(0x1e4),'filesExtracted':_0x3eeee0};}finally{try{await _0x532c95[_0x38ff6b(0x1a3)](_0x16ccdc);}catch{}}}async[a76_0x24ec84(0x1f1)](_0x374416,_0x3d19bf){const _0x1f80d8=a76_0x24ec84,{promises:_0x1418fb}=await import('fs'),_0x321d68=await import(_0x1f80d8(0x1c7)),_0x53928b=await import('tar'),_0x57054b=_0x3d19bf?.[_0x1f80d8(0x1ea)]||_0x321d68['basename'](_0x374416),_0x5218dc=_0x3d19bf?.[_0x1f80d8(0x1ad)]||new Date()['toISOString']()[_0x1f80d8(0x19f)](/[:.]/g,'-');try{await _0x1418fb[_0x1f80d8(0x19e)](_0x374416);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0x374416);}if(!_0x3d19bf?.['skipValidation']){const _0x39715d=await _0x1418fb[_0x1f80d8(0x194)](_0x374416),_0x5c97a9=_0x39715d[_0x1f80d8(0x1da)](_0x11277b=>_0x11277b[_0x1f80d8(0x1c6)](WORKFLOW_FILE_EXTENSION));if(_0x5c97a9['length']===0x0)throw new Error(_0x1f80d8(0x1f9)+WORKFLOW_FILE_EXTENSION+_0x1f80d8(0x1b1));for(const _0x52e531 of _0x5c97a9){const _0x24be38=_0x321d68[_0x1f80d8(0x198)](_0x374416,_0x52e531);try{await _0x1418fb[_0x1f80d8(0x19e)](_0x24be38);}catch{throw new Error(_0x1f80d8(0x1ae)+_0x52e531);}}}const _0x171fa4=async(_0x24a790,_0x5ec505='')=>{const _0x8c27eb=_0x1f80d8,_0x4b3e29=await _0x1418fb[_0x8c27eb(0x194)](_0x24a790,{'withFileTypes':!![]}),_0x38a5b1=[];for(const _0x4a06b7 of _0x4b3e29){const _0x22492f=_0x321d68[_0x8c27eb(0x198)](_0x5ec505,_0x4a06b7[_0x8c27eb(0x1a4)]),_0x345f30=_0x321d68['join'](_0x24a790,_0x4a06b7[_0x8c27eb(0x1a4)]);if(!shouldIncludeInArchive(_0x4a06b7['name']))continue;_0x4a06b7['isDirectory']()?_0x38a5b1[_0x8c27eb(0x1f1)](...await _0x171fa4(_0x345f30,_0x22492f)):_0x38a5b1[_0x8c27eb(0x1f1)](_0x22492f);}return _0x38a5b1;},_0x1f64e6=await _0x171fa4(_0x374416),_0x5420d1=await import('os'),_0x1cdcf0=_0x5420d1[_0x1f80d8(0x1e7)](),_0x2027bd=_0x321d68[_0x1f80d8(0x198)](_0x1cdcf0,_0x1f80d8(0x1c4)+Date[_0x1f80d8(0x1c9)]()+_0x1f80d8(0x1a9));try{await _0x53928b[_0x1f80d8(0x1e8)]({'file':_0x2027bd,'gzip':!![],'cwd':_0x374416,'portable':!![]},_0x1f64e6);const _0x17534c=await this[_0x1f80d8(0x1e1)][_0x1f80d8(0x1a5)](_0x57054b,_0x5218dc,_0x2027bd,{'scheduleFrom':_0x3d19bf?.[_0x1f80d8(0x1b5)],'clearSchedule':_0x3d19bf?.['clearSchedule'],'clearScheduleAll':_0x3d19bf?.[_0x1f80d8(0x1e3)]});return{'projectId':_0x17534c['id'],'projectName':_0x17534c['name'],'revision':_0x17534c[_0x1f80d8(0x1ad)]};}finally{try{await _0x1418fb[_0x1f80d8(0x1a3)](_0x2027bd);}catch{}}}async[a76_0x24ec84(0x1a6)](_0x39749e){const _0x2e8e79=a76_0x24ec84,{id:_0x1670dc}=await this[_0x2e8e79(0x1d5)](_0x39749e),_0x137a31=await this[_0x2e8e79(0x1e1)][_0x2e8e79(0x196)](_0x1670dc);return{'projectId':_0x137a31['id'],'projectName':_0x137a31['name']};}}
1
+ function a76_0x3242(_0x435cb3,_0x3dd240){_0x435cb3=_0x435cb3-0x14c;const _0x4464ae=a76_0x4464();let _0x324219=_0x4464ae[_0x435cb3];return _0x324219;}const a76_0x27975b=a76_0x3242;(function(_0x5c3a2a,_0x4ad0c4){const _0x281e5e=a76_0x3242,_0x3f8e64=_0x5c3a2a();while(!![]){try{const _0x7e3602=-parseInt(_0x281e5e(0x199))/0x1+-parseInt(_0x281e5e(0x185))/0x2*(parseInt(_0x281e5e(0x19c))/0x3)+parseInt(_0x281e5e(0x1b5))/0x4+parseInt(_0x281e5e(0x14d))/0x5*(-parseInt(_0x281e5e(0x1bb))/0x6)+-parseInt(_0x281e5e(0x1b1))/0x7+-parseInt(_0x281e5e(0x188))/0x8*(-parseInt(_0x281e5e(0x16e))/0x9)+parseInt(_0x281e5e(0x1be))/0xa;if(_0x7e3602===_0x4ad0c4)break;else _0x3f8e64['push'](_0x3f8e64['shift']());}catch(_0x2a049b){_0x3f8e64['push'](_0x3f8e64['shift']());}}}(a76_0x4464,0xd1e72));import{WorkflowApiClient}from'../client/workflow-client.js';function a76_0x4464(){const _0x252765=['.\x20Expected\x20\x22project.workflow\x22','listLogFiles','done','Project\x20directory\x20not\x20found:\x20','uploadProjectArchive','zlib','402qGGxfD','fromTask','tdx-workflow-','47528QOtttb','arrayBuffer','mkdir','fullName','NUMERIC_ID_PATTERN','access','direct','listAttempts','workflows','parentId','workflowName','Project\x20not\x20found:\x20','skipValidation','lastAttempt','force','projectName','params','1670382UmFGUq','config','join','18429SQZImL','success','sessionTime','gunzip','attempts','resolveProjectId','path','listWorkflows','toString','sessions','.tar.gz','client','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','substring','filter','listProjects','retryAttempt','createdAt','length','latest','logs','5345963wSCXdF','lastId','run','logger','5309668tzCPoS','Cannot\x20read\x20workflow\x20file:\x20','downloadProjectArchive','error','includeRetried','logFiles','30NwXGri','killAttempt','now','45078020jFQanx','find','1496735cspsXW','util','sessionUuid','tmpdir','map','delete','startedAt','isGroup','projects','tasks','listSessions','create','retryAt','sessionId','project','exportParams','test','retrySession','basename','limit','isDirectory','extract','state','retryAttemptName','retryParams','replace','timezone','scheduleFrom','message','Kill\x20request\x20accepted','push','data','download','288lqHReE','upstreams','No\x20','storeParams','name','kill','stateParams','workflow','toISOString','status','revision','index','\x20workflow\x20files\x20found\x20in\x20project\x20directory','resumeFrom','from','readdir','tar'];a76_0x4464=function(){return _0x252765;};return a76_0x4464();}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'../utils/workflow-utils.js';export class WorkflowSDK{static [a76_0x27975b(0x18c)]=/^\d+$/;[a76_0x27975b(0x1a7)];constructor(_0x371d1e){const _0x4af6cb=a76_0x27975b;this[_0x4af6cb(0x1a7)]=new WorkflowApiClient(_0x371d1e,_0x371d1e[_0x4af6cb(0x1b4)]);}async['resolveProjectId'](_0x4a187f){const _0x58905a=a76_0x27975b;if(WorkflowSDK[_0x58905a(0x18c)][_0x58905a(0x15d)](_0x4a187f))return{'id':_0x4a187f,'name':_0x4a187f};const _0x3d68d6=await this[_0x58905a(0x1a7)][_0x58905a(0x1ab)]({'name_pattern':_0x4a187f}),_0x4d7f2b=_0x3d68d6[_0x58905a(0x16c)][_0x58905a(0x14c)](_0xac284c=>_0xac284c[_0x58905a(0x172)]===_0x4a187f);if(!_0x4d7f2b)throw new Error(_0x58905a(0x193)+_0x4a187f);return{'id':_0x4d7f2b['id'],'name':_0x4d7f2b[_0x58905a(0x172)]};}async[a76_0x27975b(0x155)](_0x401581,_0x56ba3f){const _0x2e5cfc=a76_0x27975b,_0x32c77a=await this['client']['listProjects']({'name_pattern':_0x401581,..._0x56ba3f});return _0x32c77a[_0x2e5cfc(0x16c)]['map'](_0xc029c4=>({..._0xc029c4,'project_id':_0xc029c4['id'],'project_name':_0xc029c4['name']}));}async[a76_0x27975b(0x190)](_0x3dad13,_0x28900c){const _0x10e03a=a76_0x27975b,_0x5b7e40=await this[_0x10e03a(0x1a7)][_0x10e03a(0x1a3)]({'project_name':_0x3dad13,..._0x28900c});return _0x5b7e40[_0x10e03a(0x16c)][_0x10e03a(0x151)](_0x509eb8=>({'project_id':_0x509eb8[_0x10e03a(0x15b)]?.['id'],'project_name':_0x509eb8['project']?.[_0x10e03a(0x172)],'workflow_id':_0x509eb8['id'],'workflow_name':_0x509eb8['name'],'revision':_0x509eb8[_0x10e03a(0x178)],'timezone':_0x509eb8[_0x10e03a(0x167)],'config':_0x509eb8[_0x10e03a(0x19a)],'id':_0x509eb8['id'],'name':_0x509eb8[_0x10e03a(0x172)],'project':_0x509eb8[_0x10e03a(0x15b)]}));}async[a76_0x27975b(0x1a5)](_0x501d54){const _0x2b64f1=a76_0x27975b;let _0x577638;if(_0x501d54?.[_0x2b64f1(0x197)]){let _0x47f1d0,_0x2c9720=![];while(!_0x2c9720){const _0x1d706f=await this['client']['listProjects']({'limit':0x64,'last_id':_0x47f1d0}),_0xe46ba4=_0x1d706f['data'][_0x2b64f1(0x14c)](_0x2febb8=>_0x2febb8['name']===_0x501d54[_0x2b64f1(0x197)]);if(_0xe46ba4){_0x577638=_0xe46ba4['id'],_0x2c9720=!![];break;}if(!_0x1d706f[_0x2b64f1(0x1b2)]||_0x1d706f[_0x2b64f1(0x16c)][_0x2b64f1(0x1ae)]===0x0)break;_0x47f1d0=_0x1d706f[_0x2b64f1(0x1b2)];}if(!_0x577638)throw new Error(_0x2b64f1(0x193)+_0x501d54[_0x2b64f1(0x197)]);}const _0x5d48d8=await this[_0x2b64f1(0x1a7)][_0x2b64f1(0x157)]({'project_id':_0x577638,'project_name':_0x501d54?.[_0x2b64f1(0x197)],'workflow_name':_0x501d54?.['workflowName'],'status':_0x501d54?.[_0x2b64f1(0x177)],'from_time':_0x501d54?.['fromTime'],'to_time':_0x501d54?.['toTime'],'limit':_0x501d54?.[_0x2b64f1(0x160)],'last_id':_0x501d54?.['last_id']});return _0x5d48d8[_0x2b64f1(0x16c)]['map'](_0x3ed745=>({'project_id':_0x3ed745[_0x2b64f1(0x15b)]?.['id'],'project_name':_0x3ed745['project']?.[_0x2b64f1(0x172)],'workflow_id':_0x3ed745[_0x2b64f1(0x175)]?.['id'],'workflow_name':_0x3ed745[_0x2b64f1(0x175)]?.[_0x2b64f1(0x172)],'session_id':_0x3ed745['id'],'sessionUuid':_0x3ed745[_0x2b64f1(0x14f)],'sessionTime':_0x3ed745[_0x2b64f1(0x19e)],'lastAttempt':_0x3ed745[_0x2b64f1(0x195)],'id':_0x3ed745['id'],'project':_0x3ed745[_0x2b64f1(0x15b)],'workflow':_0x3ed745['workflow']}));}async[a76_0x27975b(0x1a0)](_0xea6d69){const _0x4bb72a=a76_0x27975b,_0x4a28ff=await this[_0x4bb72a(0x1a7)][_0x4bb72a(0x18f)]({'project_name':_0xea6d69?.[_0x4bb72a(0x197)],'workflow_name':_0xea6d69?.[_0x4bb72a(0x192)],'include_retried':_0xea6d69?.[_0x4bb72a(0x1b9)],'limit':_0xea6d69?.[_0x4bb72a(0x160)],'last_id':_0xea6d69?.['last_id']});return _0x4a28ff[_0x4bb72a(0x16c)][_0x4bb72a(0x151)](_0x4357d7=>({'project_id':_0x4357d7[_0x4bb72a(0x15b)]?.['id'],'project_name':_0x4357d7[_0x4bb72a(0x15b)]?.[_0x4bb72a(0x172)],'workflow_id':_0x4357d7['workflow']?.['id'],'workflow_name':_0x4357d7[_0x4bb72a(0x175)]?.['name'],'session_id':_0x4357d7[_0x4bb72a(0x15a)],'sessionUuid':_0x4357d7['sessionUuid'],'sessionTime':_0x4357d7['sessionTime'],'attempt_id':_0x4357d7['id'],'attempt_index':_0x4357d7[_0x4bb72a(0x179)],'retryAttemptName':_0x4357d7[_0x4bb72a(0x164)],'done':_0x4357d7[_0x4bb72a(0x181)],'success':_0x4357d7[_0x4bb72a(0x19d)],'cancelRequested':_0x4357d7['cancelRequested'],'params':_0x4357d7[_0x4bb72a(0x198)],'createdAt':_0x4357d7[_0x4bb72a(0x1ad)],'finishedAt':_0x4357d7['finishedAt'],'id':_0x4357d7['id'],'index':_0x4357d7[_0x4bb72a(0x179)],'project':_0x4357d7['project'],'workflow':_0x4357d7[_0x4bb72a(0x175)]}));}async['attempt'](_0x39e677){const _0x1aeec7=a76_0x27975b,_0x38c3a1=await this[_0x1aeec7(0x1a7)]['getAttempt'](_0x39e677);return _0x38c3a1;}async[a76_0x27975b(0x156)](_0x56645c,_0x5a345a=![]){const _0x14ac53=a76_0x27975b,_0x13b20d=await this[_0x14ac53(0x1a7)]['getAttemptTasks'](_0x56645c,_0x5a345a);return _0x13b20d[_0x14ac53(0x151)](_0x474e9c=>({'task_id':_0x474e9c['id'],'task_name':_0x474e9c[_0x14ac53(0x18b)],'parentId':_0x474e9c[_0x14ac53(0x191)],'config':_0x474e9c[_0x14ac53(0x19a)],'upstreams':_0x474e9c[_0x14ac53(0x16f)],'state':_0x474e9c[_0x14ac53(0x163)],'exportParams':_0x474e9c[_0x14ac53(0x15c)],'storeParams':_0x474e9c[_0x14ac53(0x171)],'stateParams':_0x474e9c[_0x14ac53(0x174)],'updatedAt':_0x474e9c['updatedAt'],'retryAt':_0x474e9c[_0x14ac53(0x159)],'startedAt':_0x474e9c[_0x14ac53(0x153)],'error':_0x474e9c[_0x14ac53(0x1b8)],'isGroup':_0x474e9c[_0x14ac53(0x154)],'id':_0x474e9c['id'],'fullName':_0x474e9c[_0x14ac53(0x18b)]}));}async[a76_0x27975b(0x1ba)](_0x4dca98,_0x2e9481){return await this['client']['listLogFiles'](_0x4dca98,_0x2e9481);}async[a76_0x27975b(0x1b0)](_0x18b3f5,_0x2ce506){const _0x3975b4=a76_0x27975b,_0x268d84=await import(_0x3975b4(0x184)),{promisify:_0x4e9bcd}=await import(_0x3975b4(0x14e)),_0x1bedcf=_0x4e9bcd(_0x268d84[_0x3975b4(0x19f)]),_0x33fdce=await this[_0x3975b4(0x1a7)][_0x3975b4(0x180)](_0x18b3f5,_0x2ce506);if(_0x33fdce[_0x3975b4(0x1ae)]===0x0)return'';const _0x53bb5b=[];for(const _0x4ae509 of _0x33fdce){if(!_0x4ae509[_0x3975b4(0x18e)])continue;const _0x188563=await fetch(_0x4ae509[_0x3975b4(0x18e)]);if(!_0x188563['ok'])throw new Error('Failed\x20to\x20download\x20log\x20file:\x20'+_0x188563[_0x3975b4(0x177)]);const _0x1909a5=Buffer[_0x3975b4(0x17c)](await _0x188563[_0x3975b4(0x189)]()),_0x24df27=await _0x1bedcf(_0x1909a5);_0x53bb5b[_0x3975b4(0x16b)](_0x24df27[_0x3975b4(0x1a4)]('utf-8'));}return _0x53bb5b[_0x3975b4(0x19b)]('\x0a');}async[a76_0x27975b(0x173)](_0x4de1b0,_0x106c7d){const _0x154803=a76_0x27975b,_0x340e6c=await this[_0x154803(0x1a7)][_0x154803(0x1bc)](_0x4de1b0,_0x106c7d);return _0x340e6c?.[_0x154803(0x169)]??_0x154803(0x16a);}async[a76_0x27975b(0x15e)](_0x2c4905,_0x19c05e){const _0x200159=a76_0x27975b,_0x4c149d=await this['client'][_0x200159(0x15e)](_0x2c4905,{'from_task':_0x19c05e?.[_0x200159(0x186)],'retry_params':_0x19c05e?.['retryParams']});return{'attemptId':_0x4c149d['id'],'sessionId':_0x4c149d[_0x200159(0x15a)]};}async['retryAttempt'](_0x554f59,_0x24cc62){const _0x77e372=a76_0x27975b,_0xfeb15e=await this[_0x77e372(0x1a7)][_0x77e372(0x1ac)](_0x554f59,{'resume_from':_0x24cc62?.[_0x77e372(0x17b)],'retry_params':_0x24cc62?.[_0x77e372(0x165)],'force':_0x24cc62?.[_0x77e372(0x196)]});return{'attemptId':_0xfeb15e['id'],'sessionId':_0xfeb15e[_0x77e372(0x15a)]};}async[a76_0x27975b(0x1b3)](_0x2a49d1,_0x158493={},_0x2097ff){const _0x422a35=a76_0x27975b,_0x3d437c=_0x2a49d1['indexOf']('.');let _0x584be3,_0x1555e2;if(_0x3d437c===-0x1)throw new Error(_0x422a35(0x1a8));_0x584be3=_0x2a49d1[_0x422a35(0x1a9)](0x0,_0x3d437c),_0x1555e2=_0x2a49d1[_0x422a35(0x1a9)](_0x3d437c+0x1);if(!_0x584be3||!_0x1555e2)throw new Error('Invalid\x20workflow\x20format:\x20'+_0x2a49d1+_0x422a35(0x17f));const _0x530b1b=_0x2097ff?.[_0x422a35(0x19e)]||new Date()[_0x422a35(0x176)]();return await this[_0x422a35(0x1a7)]['startAttempt']({'projectName':_0x584be3,'workflowName':_0x1555e2,'sessionTime':_0x530b1b,'params':_0x158493});}async[a76_0x27975b(0x16d)](_0x347e50,_0x12b12e,_0x380526){const _0x2328dc=a76_0x27975b,{promises:_0x21d311}=await import('fs'),_0x56803e=await import(_0x2328dc(0x1a2)),_0x541da2=await import('os'),_0x5dee5f=await import('tar'),{id:_0x3990bc,name:_0x822d44}=await this[_0x2328dc(0x1a1)](_0x347e50),_0x1e0bc0=_0x541da2['tmpdir'](),_0x233c7d=_0x56803e['join'](_0x1e0bc0,_0x2328dc(0x187)+_0x3990bc+'-'+Date[_0x2328dc(0x1bd)]()+_0x2328dc(0x1a6));try{await this[_0x2328dc(0x1a7)][_0x2328dc(0x1b7)](_0x3990bc,_0x233c7d,_0x380526?.['revision']);const _0x55a4bc=_0x56803e[_0x2328dc(0x19b)](_0x12b12e,_0x822d44);await _0x21d311[_0x2328dc(0x18a)](_0x55a4bc,{'recursive':!![]}),await _0x5dee5f[_0x2328dc(0x162)]({'file':_0x233c7d,'cwd':_0x55a4bc,'gzip':!![]});const _0x197c8c=async _0x5b4c26=>{const _0x4df7ee=_0x2328dc;let _0x238a52=0x0;const _0x3ca457=await _0x21d311['readdir'](_0x5b4c26,{'withFileTypes':!![]});for(const _0x485586 of _0x3ca457){const _0x3d908e=_0x56803e[_0x4df7ee(0x19b)](_0x5b4c26,_0x485586[_0x4df7ee(0x172)]);if(_0x485586['isFile']())_0x238a52++;else _0x485586[_0x4df7ee(0x161)]()&&(_0x238a52+=await _0x197c8c(_0x3d908e));}return _0x238a52;},_0xa1a2a3=await _0x197c8c(_0x55a4bc);return{'projectName':_0x822d44,'revision':_0x380526?.['revision']||_0x2328dc(0x1af),'filesExtracted':_0xa1a2a3};}finally{try{await _0x21d311['unlink'](_0x233c7d);}catch{}}}async[a76_0x27975b(0x16b)](_0x1105ea,_0x2e1793){const _0x365523=a76_0x27975b,{promises:_0x2cf3c3}=await import('fs'),_0x33c756=await import(_0x365523(0x1a2)),_0x4d1626=await import(_0x365523(0x17e)),_0x336ef2=_0x2e1793?.[_0x365523(0x197)]||_0x33c756[_0x365523(0x15f)](_0x1105ea),_0xda421b=_0x2e1793?.['revision']||new Date()[_0x365523(0x176)]()[_0x365523(0x166)](/[:.]/g,'-');try{await _0x2cf3c3[_0x365523(0x18d)](_0x1105ea);}catch{throw new Error(_0x365523(0x182)+_0x1105ea);}if(!_0x2e1793?.[_0x365523(0x194)]){const _0x13ba41=await _0x2cf3c3[_0x365523(0x17d)](_0x1105ea),_0x2f410e=_0x13ba41[_0x365523(0x1aa)](_0x131537=>_0x131537['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x2f410e['length']===0x0)throw new Error(_0x365523(0x170)+WORKFLOW_FILE_EXTENSION+_0x365523(0x17a));for(const _0x5bae5f of _0x2f410e){const _0x25862b=_0x33c756[_0x365523(0x19b)](_0x1105ea,_0x5bae5f);try{await _0x2cf3c3[_0x365523(0x18d)](_0x25862b);}catch{throw new Error(_0x365523(0x1b6)+_0x5bae5f);}}}const _0x6c3e5c=async(_0x17d1b7,_0x3b9195='')=>{const _0x3efb06=_0x365523,_0x27e2d0=await _0x2cf3c3[_0x3efb06(0x17d)](_0x17d1b7,{'withFileTypes':!![]}),_0x1e78d0=[];for(const _0x4bf361 of _0x27e2d0){const _0x190637=_0x33c756[_0x3efb06(0x19b)](_0x3b9195,_0x4bf361[_0x3efb06(0x172)]),_0x11398a=_0x33c756[_0x3efb06(0x19b)](_0x17d1b7,_0x4bf361[_0x3efb06(0x172)]);if(!shouldIncludeInArchive(_0x4bf361[_0x3efb06(0x172)]))continue;_0x4bf361[_0x3efb06(0x161)]()?_0x1e78d0[_0x3efb06(0x16b)](...await _0x6c3e5c(_0x11398a,_0x190637)):_0x1e78d0[_0x3efb06(0x16b)](_0x190637);}return _0x1e78d0;},_0x6b6d06=await _0x6c3e5c(_0x1105ea),_0x498ca9=await import('os'),_0x341b5a=_0x498ca9[_0x365523(0x150)](),_0x48800f=_0x33c756['join'](_0x341b5a,'tdx-workflow-push-'+Date['now']()+_0x365523(0x1a6));try{await _0x4d1626[_0x365523(0x158)]({'file':_0x48800f,'gzip':!![],'cwd':_0x1105ea,'portable':!![]},_0x6b6d06);const _0x4ea063=await this[_0x365523(0x1a7)][_0x365523(0x183)](_0x336ef2,_0xda421b,_0x48800f,{'scheduleFrom':_0x2e1793?.[_0x365523(0x168)],'clearSchedule':_0x2e1793?.['clearSchedule'],'clearScheduleAll':_0x2e1793?.['clearScheduleAll']});return{'projectId':_0x4ea063['id'],'projectName':_0x4ea063[_0x365523(0x172)],'revision':_0x4ea063[_0x365523(0x178)]};}finally{try{await _0x2cf3c3['unlink'](_0x48800f);}catch{}}}async[a76_0x27975b(0x152)](_0x2a2224){const _0x5bef48=a76_0x27975b,{id:_0x1f0d21}=await this['resolveProjectId'](_0x2a2224),_0x1f7687=await this['client']['deleteProject'](_0x1f0d21);return{'projectId':_0x1f7687['id'],'projectName':_0x1f7687[_0x5bef48(0x172)]};}}
@@ -1 +1 @@
1
- const a81_0x36b1dc=a81_0x3f4f;(function(_0xdd1118,_0x34a280){const _0x4dfb90=a81_0x3f4f,_0x500809=_0xdd1118();while(!![]){try{const _0x11d27a=-parseInt(_0x4dfb90(0x75))/0x1*(-parseInt(_0x4dfb90(0x79))/0x2)+parseInt(_0x4dfb90(0xa2))/0x3+parseInt(_0x4dfb90(0xb5))/0x4*(-parseInt(_0x4dfb90(0x86))/0x5)+parseInt(_0x4dfb90(0x72))/0x6+parseInt(_0x4dfb90(0xa4))/0x7+parseInt(_0x4dfb90(0xa1))/0x8*(parseInt(_0x4dfb90(0x95))/0x9)+-parseInt(_0x4dfb90(0x88))/0xa;if(_0x11d27a===_0x34a280)break;else _0x500809['push'](_0x500809['shift']());}catch(_0x61b0dc){_0x500809['push'](_0x500809['shift']());}}}(a81_0x4c48,0xc5bb7));export const TD_ENDPOINTS={'us01':a81_0x36b1dc(0x8b),'jp01':'https://api.treasuredata.co.jp','eu01':'https://api.eu01.treasuredata.com','ap02':a81_0x36b1dc(0x7b),'ap03':a81_0x36b1dc(0x78),'dev-us01':a81_0x36b1dc(0x7f),'dev-eu01':a81_0x36b1dc(0xbd),'stg-us01':a81_0x36b1dc(0x74),'stg-jp01':a81_0x36b1dc(0xb3),'stg-ap03':'https://api-staging.ap03.treasuredata.com'};export const CDP_ENDPOINTS={'us01':a81_0x36b1dc(0xbc),'jp01':a81_0x36b1dc(0x80),'eu01':a81_0x36b1dc(0xa7),'ap02':a81_0x36b1dc(0x77),'ap03':a81_0x36b1dc(0xab),'dev-us01':'https://api-development-cdp.us01.treasuredata.com','dev-eu01':a81_0x36b1dc(0xaf),'stg-us01':a81_0x36b1dc(0x99),'stg-jp01':a81_0x36b1dc(0xae),'stg-ap03':a81_0x36b1dc(0xb8)};export const WORKFLOW_ENDPOINTS={'us01':a81_0x36b1dc(0x90),'jp01':a81_0x36b1dc(0x9e),'eu01':a81_0x36b1dc(0xb6),'ap02':'https://api-workflow.ap02.treasuredata.com','ap03':a81_0x36b1dc(0xb4),'dev-us01':a81_0x36b1dc(0x93),'dev-eu01':'https://api-development-workflow.eu01.treasuredata.com','stg-us01':a81_0x36b1dc(0x83),'stg-jp01':a81_0x36b1dc(0x89),'stg-ap03':'https://api-staging-workflow.ap03.treasuredata.com'};export const TRINO_ENDPOINTS={'us01':a81_0x36b1dc(0xb7),'jp01':'https://api-presto.treasuredata.co.jp','eu01':a81_0x36b1dc(0x8c),'ap02':a81_0x36b1dc(0x92),'ap03':a81_0x36b1dc(0xa0),'dev-us01':a81_0x36b1dc(0xa3),'dev-eu01':a81_0x36b1dc(0xb0),'stg-us01':a81_0x36b1dc(0x8a),'stg-jp01':a81_0x36b1dc(0x7c),'stg-ap03':a81_0x36b1dc(0x98)};function a81_0x4c48(){const _0x21b440=['https://api-staging-cdp.treasuredata.co.jp','https://api-development-cdp.eu01.treasuredata.com','https://api-development-presto.eu01.treasuredata.com','No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27','https://engage-api.ap02.treasuredata.com','https://api-staging.treasuredata.co.jp','https://api-workflow.ap03.treasuredata.com','148siGPUm','https://api-workflow.eu01.treasuredata.com','https://api-presto.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','https://engage-api.treasuredata.com','.treasuredata.com','https://engage-api.eu01.treasuredata.com','https://api-cdp.treasuredata.com','https://api-development.eu01.treasuredata.com','837840QoENpr','https://console.ap03.treasuredata.com','https://api-staging.us01.treasuredata.com','174571VxBvQx','https://engage-api-development.us01.treasuredata.com','https://api-cdp.ap02.treasuredata.com','https://api.ap03.treasuredata.com','4zzgIMS','https://llm-api-staging.us01.treasuredata.com','https://api.ap02.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','\x27\x20and\x20site\x20\x27','https://console-next.ap03.treasuredata.com','https://api-development.treasuredata.com','https://api-cdp.treasuredata.co.jp','https://console-staging-next.us01.treasuredata.com','https://console-staging-next.treasuredata.co.jp','https://api-staging-workflow.us01.treasuredata.com','https://console-development-next.us01.treasuredata.com','https://console.','33230IStozj','https://console-next.us01.treasuredata.com','25016510AfgTXT','https://api-staging-workflow.treasuredata.co.jp','https://api-staging-presto.treasuredata.com','https://api.treasuredata.com','https://api-presto.eu01.treasuredata.com','https://console-staging.treasuredata.co.jp','https://llm-api.treasuredata.com','https://llm-api.treasuredata.co.jp','https://api-workflow.treasuredata.com','https://engage-api.treasuredata.co.jp','https://api-presto.ap02.treasuredata.com','https://api-development-workflow.us01.treasuredata.com','https://engage-api.ap03.treasuredata.com','180sQdjST','https://llm-api-development.us01.treasuredata.com','https://console-staging.us01.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','https://api-staging-cdp.us01.treasuredata.com','https://console-next.treasuredata.co.jp','https://console-staging.ap03.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://console-development-next.eu01.treasuredata.com','https://api-workflow.treasuredata.co.jp','https://llm-api-staging.ap03.treasuredata.com','https://api-presto.ap03.treasuredata.com','419128vSOsfO','2284110Ouoapl','https://api-development-presto.treasuredata.com','8816444dCcWcF','https://console-development.eu01.treasuredata.com','https://llm-api.ap03.treasuredata.com','https://api-cdp.eu01.treasuredata.com','https://llm-api.ap02.treasuredata.com','https://engage-api-staging.us01.treasuredata.com','https://console.eu01.treasuredata.com','https://api-cdp.ap03.treasuredata.com','https://llm-api.eu01.treasuredata.com','https://console-next.'];a81_0x4c48=function(){return _0x21b440;};return a81_0x4c48();}function a81_0x3f4f(_0x5f0294,_0x202be2){_0x5f0294=_0x5f0294-0x72;const _0x4c482b=a81_0x4c48();let _0x3f4f8f=_0x4c482b[_0x5f0294];return _0x3f4f8f;}export const LLM_ENDPOINTS={'us01':a81_0x36b1dc(0x8e),'jp01':a81_0x36b1dc(0x8f),'eu01':a81_0x36b1dc(0xac),'ap02':a81_0x36b1dc(0xa8),'ap03':a81_0x36b1dc(0xa6),'dev-us01':a81_0x36b1dc(0x96),'dev-eu01':'https://llm-api-development.eu01.treasuredata.com','stg-us01':a81_0x36b1dc(0x7a),'stg-jp01':'https://llm-api-staging.treasuredata.co.jp','stg-ap03':a81_0x36b1dc(0x9f)};export const ENGAGE_ENDPOINTS={'us01':a81_0x36b1dc(0xb9),'jp01':a81_0x36b1dc(0x91),'eu01':a81_0x36b1dc(0xbb),'ap02':a81_0x36b1dc(0xb2),'ap03':a81_0x36b1dc(0x94),'dev-us01':a81_0x36b1dc(0x76),'dev-eu01':'https://engage-api-development.eu01.treasuredata.com','stg-us01':a81_0x36b1dc(0xa9),'stg-jp01':'https://engage-api-staging.treasuredata.co.jp','stg-ap03':a81_0x36b1dc(0x9c)};export const CONSOLE_ENDPOINTS={'us01':'https://console.treasuredata.com','jp01':'https://console.treasuredata.co.jp','eu01':a81_0x36b1dc(0xaa),'ap02':'https://console.ap02.treasuredata.com','ap03':a81_0x36b1dc(0x73),'dev-us01':'https://console-development.treasuredata.com','dev-eu01':a81_0x36b1dc(0xa5),'stg-us01':a81_0x36b1dc(0x97),'stg-jp01':a81_0x36b1dc(0x8d),'stg-ap03':a81_0x36b1dc(0x9b)};export const CONSOLE_NEXT_ENDPOINTS={'us01':a81_0x36b1dc(0x87),'jp01':a81_0x36b1dc(0x9a),'eu01':'https://console-next.eu01.treasuredata.com','ap02':'https://console-next.ap02.treasuredata.com','ap03':a81_0x36b1dc(0x7e),'dev-us01':a81_0x36b1dc(0x84),'dev-eu01':a81_0x36b1dc(0x9d),'stg-us01':a81_0x36b1dc(0x81),'stg-jp01':a81_0x36b1dc(0x82),'stg-ap03':'https://console-staging-next.ap03.treasuredata.com'};export function getConsoleUrl(_0x528eda,_0x175091){const _0x13a120=a81_0x36b1dc,_0x2ff77a=CONSOLE_ENDPOINTS[_0x528eda]||_0x13a120(0x85)+_0x528eda+_0x13a120(0xba);return _0x175091?''+_0x2ff77a+_0x175091:_0x2ff77a;}export function getConsoleNextUrl(_0xe56885,_0x1294f0){const _0x518aa7=a81_0x36b1dc,_0x2bd886=CONSOLE_NEXT_ENDPOINTS[_0xe56885]||_0x518aa7(0xad)+_0xe56885+'.treasuredata.com';return _0x1294f0?''+_0x2bd886+_0x1294f0:_0x2bd886;}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS};export function getEndpoint(_0x4672ce,_0x3263d2='td'){const _0x3993da=a81_0x36b1dc,_0x535ca7=API_ENDPOINTS[_0x3263d2]?.[_0x4672ce];if(!_0x535ca7)throw new Error(_0x3993da(0xb1)+_0x3263d2+_0x3993da(0x7d)+_0x4672ce+'\x27');return _0x535ca7;}
1
+ const a81_0x1b1d3f=a81_0x5535;(function(_0x564788,_0xff4fe5){const _0x1acf92=a81_0x5535,_0x54f53f=_0x564788();while(!![]){try{const _0x97ebf9=-parseInt(_0x1acf92(0x1bf))/0x1+parseInt(_0x1acf92(0x1a5))/0x2*(-parseInt(_0x1acf92(0x1b6))/0x3)+parseInt(_0x1acf92(0x1e2))/0x4+parseInt(_0x1acf92(0x1b2))/0x5+-parseInt(_0x1acf92(0x1d7))/0x6+parseInt(_0x1acf92(0x1e7))/0x7*(parseInt(_0x1acf92(0x1c4))/0x8)+-parseInt(_0x1acf92(0x1ce))/0x9;if(_0x97ebf9===_0xff4fe5)break;else _0x54f53f['push'](_0x54f53f['shift']());}catch(_0x19a655){_0x54f53f['push'](_0x54f53f['shift']());}}}(a81_0x36d8,0x77d2f));export const TD_ENDPOINTS={'us01':a81_0x1b1d3f(0x1a1),'jp01':a81_0x1b1d3f(0x1dd),'eu01':'https://api.eu01.treasuredata.com','ap02':a81_0x1b1d3f(0x1cf),'ap03':'https://api.ap03.treasuredata.com','dev-us01':a81_0x1b1d3f(0x1d1),'dev-eu01':a81_0x1b1d3f(0x1cc),'stg-us01':a81_0x1b1d3f(0x1df),'stg-jp01':a81_0x1b1d3f(0x19f),'stg-ap03':a81_0x1b1d3f(0x1c6)};function a81_0x36d8(){const _0x2a803c=['https://api-staging-cdp.treasuredata.co.jp','2967552humXrD','https://api.ap02.treasuredata.com','https://api-development-cdp.us01.treasuredata.com','https://api-development.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://api-presto.ap03.treasuredata.com','https://engage-api.ap03.treasuredata.com','https://api-staging-presto.treasuredata.com','https://console-staging-next.us01.treasuredata.com','1378212ExSEzp','https://api-development-presto.eu01.treasuredata.com','https://console-next.eu01.treasuredata.com','https://llm-api-development.us01.treasuredata.com','https://llm-api.eu01.treasuredata.com','https://engage-api-staging.us01.treasuredata.com','https://api.treasuredata.co.jp','https://api-staging-cdp.us01.treasuredata.com','https://api-staging.us01.treasuredata.com','No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27','https://api-development-workflow.us01.treasuredata.com','3281420uoBsUy','https://api-cdp.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','https://api-presto.ap02.treasuredata.com','https://api-development-cdp.eu01.treasuredata.com','20181kxvdYX','https://api-staging.treasuredata.co.jp','https://console-next.us01.treasuredata.com','https://api.treasuredata.com','https://llm-api-staging.us01.treasuredata.com','https://llm-api.treasuredata.co.jp','https://llm-api-staging.treasuredata.co.jp','1922LcFzOr','https://api-workflow.ap02.treasuredata.com','https://api-presto.treasuredata.co.jp','https://console-development-next.eu01.treasuredata.com','https://engage-api.treasuredata.co.jp','https://api-cdp.eu01.treasuredata.com','https://api-staging-workflow.treasuredata.co.jp','https://api-cdp.treasuredata.co.jp','https://api-staging-workflow.ap03.treasuredata.com','https://console-development.eu01.treasuredata.com','https://api-presto.eu01.treasuredata.com','https://console-staging.ap03.treasuredata.com','.treasuredata.com','796745EZXxhc','https://console-next.','https://console-development-next.us01.treasuredata.com','https://engage-api.eu01.treasuredata.com','630CcfsOA','https://api-cdp.ap03.treasuredata.com','https://console-next.ap02.treasuredata.com','https://api-workflow.treasuredata.com','https://console-next.treasuredata.co.jp','https://engage-api.ap02.treasuredata.com','https://api-workflow.treasuredata.co.jp','\x27\x20and\x20site\x20\x27','https://api-workflow.ap03.treasuredata.com','508958YbCwpB','https://llm-api.ap02.treasuredata.com','https://engage-api-development.eu01.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','https://console-staging.treasuredata.co.jp','2168EMaDTt','https://llm-api.treasuredata.com','https://api-staging.ap03.treasuredata.com','https://api-cdp.ap02.treasuredata.com','https://api-staging-workflow.us01.treasuredata.com','https://console-next.ap03.treasuredata.com','https://engage-api.treasuredata.com','https://console-staging-next.treasuredata.co.jp','https://api-development.eu01.treasuredata.com'];a81_0x36d8=function(){return _0x2a803c;};return a81_0x36d8();}export const CDP_ENDPOINTS={'us01':a81_0x1b1d3f(0x1e3),'jp01':a81_0x1b1d3f(0x1ac),'eu01':a81_0x1b1d3f(0x1aa),'ap02':a81_0x1b1d3f(0x1c7),'ap03':a81_0x1b1d3f(0x1b7),'dev-us01':a81_0x1b1d3f(0x1d0),'dev-eu01':a81_0x1b1d3f(0x1e6),'stg-us01':a81_0x1b1d3f(0x1de),'stg-jp01':a81_0x1b1d3f(0x1cd),'stg-ap03':a81_0x1b1d3f(0x1e4)};export const WORKFLOW_ENDPOINTS={'us01':a81_0x1b1d3f(0x1b9),'jp01':a81_0x1b1d3f(0x1bc),'eu01':'https://api-workflow.eu01.treasuredata.com','ap02':a81_0x1b1d3f(0x1a6),'ap03':a81_0x1b1d3f(0x1be),'dev-us01':a81_0x1b1d3f(0x1e1),'dev-eu01':'https://api-development-workflow.eu01.treasuredata.com','stg-us01':a81_0x1b1d3f(0x1c8),'stg-jp01':a81_0x1b1d3f(0x1ab),'stg-ap03':a81_0x1b1d3f(0x1ad)};export const TRINO_ENDPOINTS={'us01':'https://api-presto.treasuredata.com','jp01':a81_0x1b1d3f(0x1a7),'eu01':a81_0x1b1d3f(0x1af),'ap02':a81_0x1b1d3f(0x1e5),'ap03':a81_0x1b1d3f(0x1d3),'dev-us01':'https://api-development-presto.treasuredata.com','dev-eu01':a81_0x1b1d3f(0x1d8),'stg-us01':a81_0x1b1d3f(0x1d5),'stg-jp01':'https://api-staging-presto.treasuredata.co.jp','stg-ap03':a81_0x1b1d3f(0x1c2)};export const LLM_ENDPOINTS={'us01':a81_0x1b1d3f(0x1c5),'jp01':a81_0x1b1d3f(0x1a3),'eu01':a81_0x1b1d3f(0x1db),'ap02':a81_0x1b1d3f(0x1c0),'ap03':'https://llm-api.ap03.treasuredata.com','dev-us01':a81_0x1b1d3f(0x1da),'dev-eu01':'https://llm-api-development.eu01.treasuredata.com','stg-us01':a81_0x1b1d3f(0x1a2),'stg-jp01':a81_0x1b1d3f(0x1a4),'stg-ap03':'https://llm-api-staging.ap03.treasuredata.com'};export const ENGAGE_ENDPOINTS={'us01':a81_0x1b1d3f(0x1ca),'jp01':a81_0x1b1d3f(0x1a9),'eu01':a81_0x1b1d3f(0x1b5),'ap02':a81_0x1b1d3f(0x1bb),'ap03':a81_0x1b1d3f(0x1d4),'dev-us01':'https://engage-api-development.us01.treasuredata.com','dev-eu01':a81_0x1b1d3f(0x1c1),'stg-us01':a81_0x1b1d3f(0x1dc),'stg-jp01':'https://engage-api-staging.treasuredata.co.jp','stg-ap03':a81_0x1b1d3f(0x1d2)};export const CONSOLE_ENDPOINTS={'us01':'https://console.treasuredata.com','jp01':'https://console.treasuredata.co.jp','eu01':'https://console.eu01.treasuredata.com','ap02':'https://console.ap02.treasuredata.com','ap03':'https://console.ap03.treasuredata.com','dev-us01':'https://console-development.treasuredata.com','dev-eu01':a81_0x1b1d3f(0x1ae),'stg-us01':'https://console-staging.us01.treasuredata.com','stg-jp01':a81_0x1b1d3f(0x1c3),'stg-ap03':a81_0x1b1d3f(0x1b0)};function a81_0x5535(_0x231244,_0x5a46a2){_0x231244=_0x231244-0x19f;const _0x36d8e3=a81_0x36d8();let _0x553553=_0x36d8e3[_0x231244];return _0x553553;}export const CONSOLE_NEXT_ENDPOINTS={'us01':a81_0x1b1d3f(0x1a0),'jp01':a81_0x1b1d3f(0x1ba),'eu01':a81_0x1b1d3f(0x1d9),'ap02':a81_0x1b1d3f(0x1b8),'ap03':a81_0x1b1d3f(0x1c9),'dev-us01':a81_0x1b1d3f(0x1b4),'dev-eu01':a81_0x1b1d3f(0x1a8),'stg-us01':a81_0x1b1d3f(0x1d6),'stg-jp01':a81_0x1b1d3f(0x1cb),'stg-ap03':'https://console-staging-next.ap03.treasuredata.com'};export function getConsoleUrl(_0x5b52fa,_0x514a91){const _0x1b55a5=CONSOLE_ENDPOINTS[_0x5b52fa]||'https://console.'+_0x5b52fa+'.treasuredata.com';return _0x514a91?''+_0x1b55a5+_0x514a91:_0x1b55a5;}export function getConsoleNextUrl(_0xed70f6,_0x19a2dd){const _0x4573f5=a81_0x1b1d3f,_0x54cf10=CONSOLE_NEXT_ENDPOINTS[_0xed70f6]||_0x4573f5(0x1b3)+_0xed70f6+_0x4573f5(0x1b1);return _0x19a2dd?''+_0x54cf10+_0x19a2dd:_0x54cf10;}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS};export function getEndpoint(_0x973766,_0x4252c1='td'){const _0xc4bfd4=a81_0x1b1d3f,_0x4d3dd4=API_ENDPOINTS[_0x4252c1]?.[_0x973766];if(!_0x4d3dd4)throw new Error(_0xc4bfd4(0x1e0)+_0x4252c1+_0xc4bfd4(0x1bd)+_0x973766+'\x27');return _0x4d3dd4;}
@@ -1 +1 @@
1
- const a83_0xe41695=a83_0x1d8a;function a83_0x65ca(){const _0x38ca46=['1117972XQxAZL','1330740PHRdfp','3maDDDN','22LsZmdY','8212596wPnDza','2137040FEBqou','jp01','28189vjeDrj','909FmOHWG','dev-us01','4476sEhpUa','348RmHvpl','5670trqsjc','30QUpXtW','us01'];a83_0x65ca=function(){return _0x38ca46;};return a83_0x65ca();}function a83_0x1d8a(_0x1db3a1,_0x48258d){_0x1db3a1=_0x1db3a1-0xd7;const _0x65cad=a83_0x65ca();let _0x1d8aab=_0x65cad[_0x1db3a1];return _0x1d8aab;}(function(_0x30ff90,_0x4f115f){const _0x55d966=a83_0x1d8a,_0x1ba440=_0x30ff90();while(!![]){try{const _0x283669=parseInt(_0x55d966(0xd7))/0x1*(-parseInt(_0x55d966(0xda))/0x2)+-parseInt(_0x55d966(0xde))/0x3*(parseInt(_0x55d966(0xdc))/0x4)+-parseInt(_0x55d966(0xdd))/0x5+-parseInt(_0x55d966(0xd8))/0x6*(parseInt(_0x55d966(0xe3))/0x7)+-parseInt(_0x55d966(0xe1))/0x8+parseInt(_0x55d966(0xe4))/0x9*(-parseInt(_0x55d966(0xd9))/0xa)+-parseInt(_0x55d966(0xdf))/0xb*(-parseInt(_0x55d966(0xe0))/0xc);if(_0x283669===_0x4f115f)break;else _0x1ba440['push'](_0x1ba440['shift']());}catch(_0x1a4e3e){_0x1ba440['push'](_0x1ba440['shift']());}}}(a83_0x65ca,0x30586));export const SITE_ALIASES={'us':'us01','aws':a83_0xe41695(0xdb),'jp':'jp01','aws-tokyo':a83_0xe41695(0xe2),'dev':a83_0xe41695(0xe5),'stg':'stg-us01'};export{getEndpoint,API_ENDPOINTS}from'./endpoints.js';
1
+ const a83_0x3b8483=a83_0x4165;function a83_0x4165(_0x59085e,_0x3f1aa5){_0x59085e=_0x59085e-0x12a;const _0xff6ce1=a83_0xff6c();let _0x4165ca=_0xff6ce1[_0x59085e];return _0x4165ca;}(function(_0xe3605a,_0x2aeeb9){const _0x15289f=a83_0x4165,_0x36d279=_0xe3605a();while(!![]){try{const _0x323a7e=-parseInt(_0x15289f(0x13a))/0x1*(-parseInt(_0x15289f(0x12d))/0x2)+-parseInt(_0x15289f(0x134))/0x3*(-parseInt(_0x15289f(0x138))/0x4)+-parseInt(_0x15289f(0x12c))/0x5*(-parseInt(_0x15289f(0x12f))/0x6)+parseInt(_0x15289f(0x12b))/0x7*(-parseInt(_0x15289f(0x12e))/0x8)+-parseInt(_0x15289f(0x137))/0x9*(parseInt(_0x15289f(0x130))/0xa)+-parseInt(_0x15289f(0x139))/0xb*(parseInt(_0x15289f(0x135))/0xc)+parseInt(_0x15289f(0x136))/0xd*(-parseInt(_0x15289f(0x132))/0xe);if(_0x323a7e===_0x2aeeb9)break;else _0x36d279['push'](_0x36d279['shift']());}catch(_0x36d242){_0x36d279['push'](_0x36d279['shift']());}}}(a83_0xff6c,0xa462a));function a83_0xff6c(){const _0x2fd268=['1032qMGJvl','6012wFrypM','328809PSzYQB','42615TJurIn','15244fGjwvy','14949cSaSYV','44xQmCYu','dev-us01','396403VzhppG','40495YeKgyj','42254dvXfZZ','64rKKJpy','600oWkQPs','1130attJNx','stg-us01','392eSJLeo','jp01'];a83_0xff6c=function(){return _0x2fd268;};return a83_0xff6c();}export const SITE_ALIASES={'us':'us01','aws':'us01','jp':a83_0x3b8483(0x133),'aws-tokyo':a83_0x3b8483(0x133),'dev':a83_0x3b8483(0x12a),'stg':a83_0x3b8483(0x131)};export{getEndpoint,API_ENDPOINTS}from'./endpoints.js';
@@ -1 +1 @@
1
- function a88_0x4133(_0x43081d,_0x518e20){_0x43081d=_0x43081d-0x1b0;const _0x37fb87=a88_0x37fb();let _0x4133c6=_0x37fb87[_0x43081d];return _0x4133c6;}function a88_0x37fb(){const _0x57b615=['length','3pkWQfa','Agent\x20reference\x20cannot\x20be\x20empty','Project\x20name\x20cannot\x20be\x20empty','5533923AOPqxb','35842SZwaII','Invalid\x20agent\x20reference\x20format:\x20','4cnSZRg','10DivYkP','286040anIsXE','6266565uPHFHU','4024625NJMeLR','11221980YYcZfH','203XEpusX','Agent\x20name\x20cannot\x20be\x20empty','39488493tXSHiA','trim'];a88_0x37fb=function(){return _0x57b615;};return a88_0x37fb();}(function(_0x4c080d,_0x4fb2e0){const _0x3c89d9=a88_0x4133,_0x42f633=_0x4c080d();while(!![]){try{const _0x1a464f=parseInt(_0x3c89d9(0x1bf))/0x1*(-parseInt(_0x3c89d9(0x1b2))/0x2)+-parseInt(_0x3c89d9(0x1b1))/0x3*(-parseInt(_0x3c89d9(0x1b4))/0x4)+-parseInt(_0x3c89d9(0x1b8))/0x5+parseInt(_0x3c89d9(0x1b9))/0x6+parseInt(_0x3c89d9(0x1ba))/0x7*(parseInt(_0x3c89d9(0x1b6))/0x8)+parseInt(_0x3c89d9(0x1b7))/0x9+parseInt(_0x3c89d9(0x1b5))/0xa*(-parseInt(_0x3c89d9(0x1bc))/0xb);if(_0x1a464f===_0x4fb2e0)break;else _0x42f633['push'](_0x42f633['shift']());}catch(_0x3f07ba){_0x42f633['push'](_0x42f633['shift']());}}}(a88_0x37fb,0xf40b0));export function parseAgentRef(_0x10142b){const _0x44439a=a88_0x4133;if(!_0x10142b||_0x10142b[_0x44439a(0x1bd)]()==='')throw new Error(_0x44439a(0x1c0));const _0x4cb67d=_0x10142b[_0x44439a(0x1bd)](),_0x51d22f=_0x4cb67d['split']('/');if(_0x51d22f['length']===0x1)return{'projectName':_0x51d22f[0x0],'agentName':undefined};else{if(_0x51d22f[_0x44439a(0x1be)]===0x2){const [_0x5ded67,_0x4fb2be]=_0x51d22f;if(!_0x5ded67||_0x5ded67[_0x44439a(0x1bd)]()==='')throw new Error(_0x44439a(0x1b0));if(!_0x4fb2be||_0x4fb2be[_0x44439a(0x1bd)]()==='')throw new Error(_0x44439a(0x1bb));return{'projectName':_0x5ded67[_0x44439a(0x1bd)](),'agentName':_0x4fb2be[_0x44439a(0x1bd)]()};}else throw new Error(_0x44439a(0x1b3)+_0x10142b+'.\x20Expected\x20\x22project_name\x22\x20or\x20\x22project_name/agent_name\x22');}}
1
+ function a88_0x394c(){const _0x394190=['83884yvabzy','.\x20Expected\x20\x22project_name\x22\x20or\x20\x22project_name/agent_name\x22','split','length','213138wYACJS','167476YQRjDE','44623260UZnzni','1304zqERbB','117xaIjYf','trim','6282810Zhjycp','1390818DZjMCU','Project\x20name\x20cannot\x20be\x20empty','Invalid\x20agent\x20reference\x20format:\x20','45241qczHVR'];a88_0x394c=function(){return _0x394190;};return a88_0x394c();}(function(_0x679857,_0x4a4253){const _0x8302cd=a88_0x4d38,_0x25895c=_0x679857();while(!![]){try{const _0x4dc504=parseInt(_0x8302cd(0xc8))/0x1+parseInt(_0x8302cd(0xc4))/0x2*(-parseInt(_0x8302cd(0xbd))/0x3)+-parseInt(_0x8302cd(0xba))/0x4+-parseInt(_0x8302cd(0xbf))/0x5+-parseInt(_0x8302cd(0xc0))/0x6+parseInt(_0x8302cd(0xc3))/0x7*(-parseInt(_0x8302cd(0xbc))/0x8)+parseInt(_0x8302cd(0xbb))/0x9;if(_0x4dc504===_0x4a4253)break;else _0x25895c['push'](_0x25895c['shift']());}catch(_0x357deb){_0x25895c['push'](_0x25895c['shift']());}}}(a88_0x394c,0xe861d));function a88_0x4d38(_0x4335df,_0x36e0d6){_0x4335df=_0x4335df-0xba;const _0x394c2d=a88_0x394c();let _0x4d384b=_0x394c2d[_0x4335df];return _0x4d384b;}export function parseAgentRef(_0x1cface){const _0x4fea00=a88_0x4d38;if(!_0x1cface||_0x1cface[_0x4fea00(0xbe)]()==='')throw new Error('Agent\x20reference\x20cannot\x20be\x20empty');const _0x47351a=_0x1cface[_0x4fea00(0xbe)](),_0x30ab85=_0x47351a[_0x4fea00(0xc6)]('/');if(_0x30ab85[_0x4fea00(0xc7)]===0x1)return{'projectName':_0x30ab85[0x0],'agentName':undefined};else{if(_0x30ab85['length']===0x2){const [_0x42422e,_0x39bb10]=_0x30ab85;if(!_0x42422e||_0x42422e[_0x4fea00(0xbe)]()==='')throw new Error(_0x4fea00(0xc1));if(!_0x39bb10||_0x39bb10[_0x4fea00(0xbe)]()==='')throw new Error('Agent\x20name\x20cannot\x20be\x20empty');return{'projectName':_0x42422e[_0x4fea00(0xbe)](),'agentName':_0x39bb10[_0x4fea00(0xbe)]()};}else throw new Error(_0x4fea00(0xc2)+_0x1cface+_0x4fea00(0xc5));}}
@@ -1 +1 @@
1
- (function(_0x47349b,_0x4549a1){const _0x1d35d8=a89_0x3708,_0x3ab61e=_0x47349b();while(!![]){try{const _0x94182a=-parseInt(_0x1d35d8(0x16d))/0x1*(-parseInt(_0x1d35d8(0x167))/0x2)+parseInt(_0x1d35d8(0x16b))/0x3*(-parseInt(_0x1d35d8(0x161))/0x4)+parseInt(_0x1d35d8(0x163))/0x5*(parseInt(_0x1d35d8(0x169))/0x6)+parseInt(_0x1d35d8(0x166))/0x7+parseInt(_0x1d35d8(0x160))/0x8+parseInt(_0x1d35d8(0x16c))/0x9*(parseInt(_0x1d35d8(0x164))/0xa)+-parseInt(_0x1d35d8(0x16a))/0xb*(parseInt(_0x1d35d8(0x15f))/0xc);if(_0x94182a===_0x4549a1)break;else _0x3ab61e['push'](_0x3ab61e['shift']());}catch(_0x6dc26d){_0x3ab61e['push'](_0x3ab61e['shift']());}}}(a89_0x5b40,0xac5a3));function a89_0x5b40(){const _0x1bb423=['all','1658930bvGKau','24vGbUde','push','318vwNXrC','7249YCHgkL','3bvRCGz','638721CSLeWr','65601hqhKIU','17844XLdJyL','4151384RMqIcl','4460432VYVTQj','map','45020LXHKOe','110uttSLt'];a89_0x5b40=function(){return _0x1bb423;};return a89_0x5b40();}function a89_0x3708(_0x299a38,_0xa5be4f){_0x299a38=_0x299a38-0x15f;const _0x5b401c=a89_0x5b40();let _0x370868=_0x5b401c[_0x299a38];return _0x370868;}export async function batchAsync(_0x13e516,_0x739562,_0x4df56c=0xa){const _0x51bd5b=a89_0x3708,_0x26de49=[];for(let _0x164cf7=0x0;_0x164cf7<_0x13e516['length'];_0x164cf7+=_0x4df56c){const _0x3ecea2=_0x13e516['slice'](_0x164cf7,_0x164cf7+_0x4df56c),_0xbf34c=await Promise[_0x51bd5b(0x165)](_0x3ecea2[_0x51bd5b(0x162)](_0x739562));_0x26de49[_0x51bd5b(0x168)](..._0xbf34c);}return _0x26de49;}
1
+ (function(_0x222974,_0x2c6811){const _0xd37494=a89_0x1112,_0x1f51d7=_0x222974();while(!![]){try{const _0x551a38=-parseInt(_0xd37494(0x100))/0x1+parseInt(_0xd37494(0xfd))/0x2*(parseInt(_0xd37494(0xfb))/0x3)+-parseInt(_0xd37494(0xf6))/0x4*(parseInt(_0xd37494(0xf9))/0x5)+parseInt(_0xd37494(0xff))/0x6+parseInt(_0xd37494(0x102))/0x7+parseInt(_0xd37494(0xfc))/0x8*(parseInt(_0xd37494(0xfa))/0x9)+-parseInt(_0xd37494(0xf7))/0xa*(-parseInt(_0xd37494(0xf8))/0xb);if(_0x551a38===_0x2c6811)break;else _0x1f51d7['push'](_0x1f51d7['shift']());}catch(_0x28a1eb){_0x1f51d7['push'](_0x1f51d7['shift']());}}}(a89_0x1bc2,0x6edf1));function a89_0x1112(_0x463af9,_0x55f5f2){_0x463af9=_0x463af9-0xf5;const _0x1bc2f6=a89_0x1bc2();let _0x111215=_0x1bc2f6[_0x463af9];return _0x111215;}function a89_0x1bc2(){const _0x514cf4=['slice','298204nFyYxX','60WXYrbk','8745HAJJAU','50oDWYiv','45eXmhWh','95223xpeKky','759400VCKtlV','52rSOeYt','all','370128XxyEpI','389696siPKhG','length','1560902DKVOJX'];a89_0x1bc2=function(){return _0x514cf4;};return a89_0x1bc2();}export async function batchAsync(_0xd6fb2b,_0x18b194,_0xdc2171=0xa){const _0x2dc9b2=a89_0x1112,_0x105b53=[];for(let _0x770ea0=0x0;_0x770ea0<_0xd6fb2b[_0x2dc9b2(0x101)];_0x770ea0+=_0xdc2171){const _0x156d52=_0xd6fb2b[_0x2dc9b2(0xf5)](_0x770ea0,_0x770ea0+_0xdc2171),_0x2ecc1c=await Promise[_0x2dc9b2(0xfe)](_0x156d52['map'](_0x18b194));_0x105b53['push'](..._0x2ecc1c);}return _0x105b53;}
@@ -1 +1 @@
1
- (function(_0x2e7673,_0x24e4e3){const _0x8997a0=a90_0x51c3,_0xcb160b=_0x2e7673();while(!![]){try{const _0x3afd9f=parseInt(_0x8997a0(0x17d))/0x1*(parseInt(_0x8997a0(0x17a))/0x2)+parseInt(_0x8997a0(0x181))/0x3+-parseInt(_0x8997a0(0x179))/0x4+-parseInt(_0x8997a0(0x184))/0x5+-parseInt(_0x8997a0(0x178))/0x6+-parseInt(_0x8997a0(0x17f))/0x7+parseInt(_0x8997a0(0x183))/0x8*(parseInt(_0x8997a0(0x17c))/0x9);if(_0x3afd9f===_0x24e4e3)break;else _0xcb160b['push'](_0xcb160b['shift']());}catch(_0x242ea1){_0xcb160b['push'](_0xcb160b['shift']());}}}(a90_0xac71,0x61e28));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{join}from'path';function getCacheDir(){const _0x49a01a=a90_0x51c3;return join(process['cwd'](),_0x49a01a(0x182),_0x49a01a(0x17e));}function a90_0x51c3(_0x19c43e,_0x302e0f){_0x19c43e=_0x19c43e-0x178;const _0xac71f4=a90_0xac71();let _0x51c3da=_0xac71f4[_0x19c43e];return _0x51c3da;}function getLastChatIdPath(){const _0x499aca=a90_0x51c3;return join(getCacheDir(),_0x499aca(0x180));}function ensureCacheDir(){const _0x25e4a6=getCacheDir();!existsSync(_0x25e4a6)&&mkdirSync(_0x25e4a6,{'recursive':!![]});}export function saveLastChatId(_0x3abbe9){ensureCacheDir();const _0x2ba91b=getLastChatIdPath();writeFileSync(_0x2ba91b,_0x3abbe9,'utf-8');}function a90_0xac71(){const _0x4159aa=['37DnHSQj','tdx','1234170Qejflc','last_chat_id','638535YezuOl','.cache','882608ooYUTJ','876390syLAGj','utf-8','2773590sndtgF','1307440MsUSsd','6228TYiZiN','trim','99cukmMb'];a90_0xac71=function(){return _0x4159aa;};return a90_0xac71();}export function loadLastChatId(){const _0x2e6f10=a90_0x51c3,_0x48ff18=getLastChatIdPath();if(!existsSync(_0x48ff18))return undefined;try{const _0xf89fd=readFileSync(_0x48ff18,_0x2e6f10(0x185))[_0x2e6f10(0x17b)]();return _0xf89fd||undefined;}catch{return undefined;}}export function clearLastChatId(){const _0x3108a8=a90_0x51c3,_0x2f777b=getLastChatIdPath();if(existsSync(_0x2f777b))try{writeFileSync(_0x2f777b,'',_0x3108a8(0x185));}catch{}}
1
+ (function(_0x20e70f,_0x47e2be){const _0x3a1018=a90_0x32b5,_0x31c7c8=_0x20e70f();while(!![]){try{const _0x198c54=parseInt(_0x3a1018(0xdb))/0x1*(parseInt(_0x3a1018(0xde))/0x2)+-parseInt(_0x3a1018(0xd9))/0x3*(-parseInt(_0x3a1018(0xdd))/0x4)+-parseInt(_0x3a1018(0xda))/0x5+parseInt(_0x3a1018(0xdf))/0x6*(parseInt(_0x3a1018(0xe2))/0x7)+-parseInt(_0x3a1018(0xe0))/0x8+-parseInt(_0x3a1018(0xd7))/0x9+parseInt(_0x3a1018(0xdc))/0xa;if(_0x198c54===_0x47e2be)break;else _0x31c7c8['push'](_0x31c7c8['shift']());}catch(_0x240e3d){_0x31c7c8['push'](_0x31c7c8['shift']());}}}(a90_0x1895,0xe94cb));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{join}from'path';function getCacheDir(){const _0x2202e6=a90_0x32b5;return join(process[_0x2202e6(0xd4)](),_0x2202e6(0xd6),'tdx');}function getLastChatIdPath(){const _0x5b68f1=a90_0x32b5;return join(getCacheDir(),_0x5b68f1(0xe1));}function a90_0x32b5(_0x539421,_0x5380ad){_0x539421=_0x539421-0xd4;const _0x189571=a90_0x1895();let _0x32b59a=_0x189571[_0x539421];return _0x32b59a;}function ensureCacheDir(){const _0x3ed0d0=getCacheDir();!existsSync(_0x3ed0d0)&&mkdirSync(_0x3ed0d0,{'recursive':!![]});}export function saveLastChatId(_0x2da1f9){const _0x27ded9=a90_0x32b5;ensureCacheDir();const _0x45542b=getLastChatIdPath();writeFileSync(_0x45542b,_0x2da1f9,_0x27ded9(0xd5));}function a90_0x1895(){const _0x475a1d=['5407024yHwZTs','last_chat_id','14WycaPw','cwd','utf-8','.cache','7593768qUOMTN','trim','133827kcYjqy','815010KcjQPU','20VnRKcY','4015710yIoHHV','64EGDkFc','88422JwhdeH','1916076NVqNme'];a90_0x1895=function(){return _0x475a1d;};return a90_0x1895();}export function loadLastChatId(){const _0x2de877=a90_0x32b5,_0x2ecae3=getLastChatIdPath();if(!existsSync(_0x2ecae3))return undefined;try{const _0x41a0e7=readFileSync(_0x2ecae3,_0x2de877(0xd5))[_0x2de877(0xd8)]();return _0x41a0e7||undefined;}catch{return undefined;}}export function clearLastChatId(){const _0x3513d0=a90_0x32b5,_0x3ef376=getLastChatIdPath();if(existsSync(_0x3ef376))try{writeFileSync(_0x3ef376,'',_0x3513d0(0xd5));}catch{}}
@@ -1 +1 @@
1
- (function(_0x5c38ab,_0x12c011){const _0x14022b=a91_0xb712,_0x38b20a=_0x5c38ab();while(!![]){try{const _0x85667=-parseInt(_0x14022b(0x1db))/0x1+-parseInt(_0x14022b(0x1e6))/0x2+parseInt(_0x14022b(0x1e8))/0x3*(parseInt(_0x14022b(0x1d6))/0x4)+-parseInt(_0x14022b(0x1e2))/0x5+parseInt(_0x14022b(0x1d3))/0x6*(-parseInt(_0x14022b(0x1d4))/0x7)+-parseInt(_0x14022b(0x1de))/0x8*(-parseInt(_0x14022b(0x1ea))/0x9)+parseInt(_0x14022b(0x1d8))/0xa*(parseInt(_0x14022b(0x1cf))/0xb);if(_0x85667===_0x12c011)break;else _0x38b20a['push'](_0x38b20a['shift']());}catch(_0x3864b0){_0x38b20a['push'](_0x38b20a['shift']());}}}(a91_0x189c,0x36ae5));import{Chalk}from'chalk';export function shouldUseColor(_0x3559c1={}){const _0x42b4b7=a91_0xb712;if(_0x3559c1['noColor']===!![])return![];if(_0x3559c1[_0x42b4b7(0x1e5)]===!![])return!![];if(process[_0x42b4b7(0x1d7)][_0x42b4b7(0x1e3)]!==undefined)return![];return process['stdout'][_0x42b4b7(0x1d5)]??![];}export function getChalk(_0x1c617b={}){if(shouldUseColor(_0x1c617b))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}export function colorBorder(_0xb6e94e,_0x57fd95={}){const _0x150d7c=a91_0xb712;return getChalk(_0x57fd95)[_0x150d7c(0x1e0)](_0xb6e94e);}export function colorHeader(_0x38ccb4,_0xfd8221={}){return getChalk(_0xfd8221)['cyan'](_0x38ccb4);}export function colorType(_0x2e2070,_0x3563bc={}){const _0x2a2987=a91_0xb712;return getChalk(_0x3563bc)[_0x2a2987(0x1e0)](_0x2e2070);}export function colorJSONKey(_0x5e812b,_0x593442={}){const _0x3590b9=a91_0xb712;return getChalk(_0x593442)[_0x3590b9(0x1dc)](_0x5e812b);}export function colorJSONString(_0x185a17,_0x3b4564={}){const _0x13b5c8=a91_0xb712;return getChalk(_0x3b4564)[_0x13b5c8(0x1d1)](_0x185a17);}export function colorJSONNumber(_0x4da4e4,_0x33f0a5={}){return getChalk(_0x33f0a5)['cyan'](_0x4da4e4);}export function colorJSONBoolean(_0x576c4a,_0x2ff19a={}){const _0x35535d=a91_0xb712;return getChalk(_0x2ff19a)[_0x35535d(0x1cd)](_0x576c4a);}function a91_0xb712(_0x281cdc,_0x47c879){_0x281cdc=_0x281cdc-0x1cd;const _0x189cb2=a91_0x189c();let _0xb7126a=_0x189cb2[_0x281cdc];return _0xb7126a;}export function colorJSONNull(_0x54a772,_0x48e422={}){const _0x13dfee=a91_0xb712;return getChalk(_0x48e422)[_0x13dfee(0x1e0)](_0x54a772);}export function colorizeJSONCompact(_0x377f2d,_0x428491={}){const _0x4c3f28=a91_0xb712;if(!shouldUseColor(_0x428491))return JSON[_0x4c3f28(0x1dd)](_0x377f2d);if(_0x377f2d===null)return colorJSONNull('null',_0x428491);if(typeof _0x377f2d==='boolean')return colorJSONBoolean(String(_0x377f2d),_0x428491);if(typeof _0x377f2d==='number')return colorJSONNumber(String(_0x377f2d),_0x428491);if(typeof _0x377f2d===_0x4c3f28(0x1ce))return colorJSONString(JSON[_0x4c3f28(0x1dd)](_0x377f2d),_0x428491);if(Array['isArray'](_0x377f2d)){if(_0x377f2d['length']===0x0)return'[]';const _0x51f911=_0x377f2d[_0x4c3f28(0x1e9)](_0x35d5c7=>colorizeJSONCompact(_0x35d5c7,_0x428491));return'['+_0x51f911['join'](',')+']';}if(typeof _0x377f2d==='object'){const _0x405cf8=Object[_0x4c3f28(0x1d2)](_0x377f2d);if(_0x405cf8[_0x4c3f28(0x1e1)]===0x0)return'{}';const _0x3566c3=_0x405cf8['map'](([_0x814673,_0x3b2681])=>{const _0x546762=_0x4c3f28,_0x3ddb64=colorJSONKey(JSON[_0x546762(0x1dd)](_0x814673),_0x428491),_0x2ffbfa=colorizeJSONCompact(_0x3b2681,_0x428491);return _0x3ddb64+':'+_0x2ffbfa;});return'{'+_0x3566c3['join'](',')+'}';}return String(_0x377f2d);}function a91_0x189c(){const _0x227f43=['1376485oCyHIj','NO_COLOR','isArray','color','113450gdgJSr','number','27DFHuKF','map','594JSpqWX','yellow','string','44XkcFeI','repeat','green','entries','6PCbHeR','2345861vYhwHd','isTTY','185372UDpOZz','env','1868610Usbsrt','boolean','object','355055KCVKdC','blue','stringify','9896mNKwuh','join','dim','length'];a91_0x189c=function(){return _0x227f43;};return a91_0x189c();}export function colorizeJSON(_0x12f922,_0x41e7d7={},_0x46229a=0x0){const _0x13761f=a91_0xb712;if(!shouldUseColor(_0x41e7d7))return JSON[_0x13761f(0x1dd)](_0x12f922,null,0x2);const _0x4a9117='\x20'['repeat'](_0x46229a),_0x5b2e5a=_0x46229a+0x2;if(_0x12f922===null)return colorJSONNull('null',_0x41e7d7);if(typeof _0x12f922===_0x13761f(0x1d9))return colorJSONBoolean(String(_0x12f922),_0x41e7d7);if(typeof _0x12f922===_0x13761f(0x1e7))return colorJSONNumber(String(_0x12f922),_0x41e7d7);if(typeof _0x12f922===_0x13761f(0x1ce))return colorJSONString(JSON[_0x13761f(0x1dd)](_0x12f922),_0x41e7d7);if(Array[_0x13761f(0x1e4)](_0x12f922)){if(_0x12f922[_0x13761f(0x1e1)]===0x0)return'[]';const _0xf2b57=_0x12f922['map'](_0x407d81=>{const _0x2c669b=colorizeJSON(_0x407d81,_0x41e7d7,_0x5b2e5a);return''+'\x20'['repeat'](_0x5b2e5a)+_0x2c669b;});return'[\x0a'+_0xf2b57[_0x13761f(0x1df)](',\x0a')+('\x0a'+_0x4a9117+']');}if(typeof _0x12f922===_0x13761f(0x1da)){const _0x42a666=Object['entries'](_0x12f922);if(_0x42a666['length']===0x0)return'{}';const _0x4985ab=_0x42a666['map'](([_0x3774af,_0x43621d])=>{const _0x31ced7=_0x13761f,_0x32fd0e=colorJSONKey(JSON[_0x31ced7(0x1dd)](_0x3774af),_0x41e7d7),_0x41ff54=colorizeJSON(_0x43621d,_0x41e7d7,_0x5b2e5a);return''+'\x20'[_0x31ced7(0x1d0)](_0x5b2e5a)+_0x32fd0e+':\x20'+_0x41ff54;});return'{\x0a'+_0x4985ab['join'](',\x0a')+('\x0a'+_0x4a9117+'}');}return String(_0x12f922);}
1
+ (function(_0x4a1aea,_0x4e526a){const _0x407fa4=a91_0x59e5,_0xa023=_0x4a1aea();while(!![]){try{const _0x3fde46=parseInt(_0x407fa4(0x156))/0x1+parseInt(_0x407fa4(0x150))/0x2*(-parseInt(_0x407fa4(0x145))/0x3)+parseInt(_0x407fa4(0x142))/0x4*(parseInt(_0x407fa4(0x141))/0x5)+-parseInt(_0x407fa4(0x140))/0x6+parseInt(_0x407fa4(0x14d))/0x7+-parseInt(_0x407fa4(0x146))/0x8*(parseInt(_0x407fa4(0x13a))/0x9)+-parseInt(_0x407fa4(0x13d))/0xa*(parseInt(_0x407fa4(0x151))/0xb);if(_0x3fde46===_0x4e526a)break;else _0xa023['push'](_0xa023['shift']());}catch(_0x18cb4b){_0xa023['push'](_0xa023['shift']());}}}(a91_0x1bc7,0x56707));import{Chalk}from'chalk';export function shouldUseColor(_0x54bf96={}){const _0x93f897=a91_0x59e5;if(_0x54bf96['noColor']===!![])return![];if(_0x54bf96['color']===!![])return!![];if(process[_0x93f897(0x13e)][_0x93f897(0x144)]!==undefined)return![];return process[_0x93f897(0x148)][_0x93f897(0x153)]??![];}function a91_0x1bc7(){const _0x4d0dda=['cyan','6qDAvjm','1353vXbdrG','string','isTTY','number','length','626816IdtMqM','object','null','9eVfiOz','dim','join','2510juXpND','env','green','2084952SUCzKt','13865bDIzVw','16mmTSCV','repeat','NO_COLOR','342918VWNmzc','1136912syyGUO','map','stdout','isArray','yellow','stringify','blue','4056808vEkpFK','boolean'];a91_0x1bc7=function(){return _0x4d0dda;};return a91_0x1bc7();}export function getChalk(_0xfa7ffa={}){if(shouldUseColor(_0xfa7ffa))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}export function colorBorder(_0x55a604,_0x3fb583={}){const _0x4fa56a=a91_0x59e5;return getChalk(_0x3fb583)[_0x4fa56a(0x13b)](_0x55a604);}export function colorHeader(_0x59a754,_0x1bdc0d={}){const _0x5dbbf8=a91_0x59e5;return getChalk(_0x1bdc0d)[_0x5dbbf8(0x14f)](_0x59a754);}export function colorType(_0x2157a8,_0x41f52e={}){const _0x152e1d=a91_0x59e5;return getChalk(_0x41f52e)[_0x152e1d(0x13b)](_0x2157a8);}export function colorJSONKey(_0x1b5808,_0x1e5ffd={}){const _0x40b201=a91_0x59e5;return getChalk(_0x1e5ffd)[_0x40b201(0x14c)](_0x1b5808);}function a91_0x59e5(_0x1651f8,_0x37ae7e){_0x1651f8=_0x1651f8-0x138;const _0x1bc70d=a91_0x1bc7();let _0x59e5d1=_0x1bc70d[_0x1651f8];return _0x59e5d1;}export function colorJSONString(_0x1225eb,_0x18bf6b={}){const _0x59ee4a=a91_0x59e5;return getChalk(_0x18bf6b)[_0x59ee4a(0x13f)](_0x1225eb);}export function colorJSONNumber(_0x18b630,_0x476b2d={}){return getChalk(_0x476b2d)['cyan'](_0x18b630);}export function colorJSONBoolean(_0x57ba6c,_0x3a1404={}){const _0x44b44c=a91_0x59e5;return getChalk(_0x3a1404)[_0x44b44c(0x14a)](_0x57ba6c);}export function colorJSONNull(_0x3d3d57,_0x3df764={}){const _0x879e9b=a91_0x59e5;return getChalk(_0x3df764)[_0x879e9b(0x13b)](_0x3d3d57);}export function colorizeJSONCompact(_0x2557e1,_0x16e7ab={}){const _0x4d3f09=a91_0x59e5;if(!shouldUseColor(_0x16e7ab))return JSON['stringify'](_0x2557e1);if(_0x2557e1===null)return colorJSONNull(_0x4d3f09(0x139),_0x16e7ab);if(typeof _0x2557e1===_0x4d3f09(0x14e))return colorJSONBoolean(String(_0x2557e1),_0x16e7ab);if(typeof _0x2557e1==='number')return colorJSONNumber(String(_0x2557e1),_0x16e7ab);if(typeof _0x2557e1===_0x4d3f09(0x152))return colorJSONString(JSON['stringify'](_0x2557e1),_0x16e7ab);if(Array['isArray'](_0x2557e1)){if(_0x2557e1[_0x4d3f09(0x155)]===0x0)return'[]';const _0x1b2bae=_0x2557e1[_0x4d3f09(0x147)](_0x19cb36=>colorizeJSONCompact(_0x19cb36,_0x16e7ab));return'['+_0x1b2bae[_0x4d3f09(0x13c)](',')+']';}if(typeof _0x2557e1===_0x4d3f09(0x138)){const _0x2592ac=Object['entries'](_0x2557e1);if(_0x2592ac['length']===0x0)return'{}';const _0x42ff66=_0x2592ac[_0x4d3f09(0x147)](([_0x2d602a,_0x1b0894])=>{const _0x91e202=_0x4d3f09,_0x54cb90=colorJSONKey(JSON[_0x91e202(0x14b)](_0x2d602a),_0x16e7ab),_0x50343f=colorizeJSONCompact(_0x1b0894,_0x16e7ab);return _0x54cb90+':'+_0x50343f;});return'{'+_0x42ff66[_0x4d3f09(0x13c)](',')+'}';}return String(_0x2557e1);}export function colorizeJSON(_0x20f2e8,_0x3daf5f={},_0x2f09a9=0x0){const _0x501d7c=a91_0x59e5;if(!shouldUseColor(_0x3daf5f))return JSON[_0x501d7c(0x14b)](_0x20f2e8,null,0x2);const _0x18d9cf='\x20'[_0x501d7c(0x143)](_0x2f09a9),_0x24ae8c=_0x2f09a9+0x2;if(_0x20f2e8===null)return colorJSONNull(_0x501d7c(0x139),_0x3daf5f);if(typeof _0x20f2e8===_0x501d7c(0x14e))return colorJSONBoolean(String(_0x20f2e8),_0x3daf5f);if(typeof _0x20f2e8===_0x501d7c(0x154))return colorJSONNumber(String(_0x20f2e8),_0x3daf5f);if(typeof _0x20f2e8===_0x501d7c(0x152))return colorJSONString(JSON[_0x501d7c(0x14b)](_0x20f2e8),_0x3daf5f);if(Array[_0x501d7c(0x149)](_0x20f2e8)){if(_0x20f2e8['length']===0x0)return'[]';const _0x39032f=_0x20f2e8['map'](_0x32755c=>{const _0x41cdb5=_0x501d7c,_0x9eea64=colorizeJSON(_0x32755c,_0x3daf5f,_0x24ae8c);return''+'\x20'[_0x41cdb5(0x143)](_0x24ae8c)+_0x9eea64;});return'[\x0a'+_0x39032f[_0x501d7c(0x13c)](',\x0a')+('\x0a'+_0x18d9cf+']');}if(typeof _0x20f2e8===_0x501d7c(0x138)){const _0x20552a=Object['entries'](_0x20f2e8);if(_0x20552a[_0x501d7c(0x155)]===0x0)return'{}';const _0x351650=_0x20552a['map'](([_0x3c887b,_0x3c38f3])=>{const _0x47ffeb=_0x501d7c,_0x1cbc93=colorJSONKey(JSON[_0x47ffeb(0x14b)](_0x3c887b),_0x3daf5f),_0x4b21da=colorizeJSON(_0x3c38f3,_0x3daf5f,_0x24ae8c);return''+'\x20'['repeat'](_0x24ae8c)+_0x1cbc93+':\x20'+_0x4b21da;});return'{\x0a'+_0x351650[_0x501d7c(0x13c)](',\x0a')+('\x0a'+_0x18d9cf+'}');}return String(_0x20f2e8);}