@treasuredata/tdx 0.14.7 → 0.14.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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/tdx +10 -0
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a110_0x3adc(){const _0x570614=['YAML\x20parse\x20error:\x20','message','segment','parseDocument','object','Failed\x20to\x20parse\x20YAML\x20file\x20(empty\x20or\x20invalid)','map','warnings','2528442dJcomR','801016kLgAjB','journey','error','8HPlNij','2695074chEHMd','5372688VGJpIz','toJSON','basename','YAML_PARSE_ERROR','valid','4364241woDaNN','result','not\x20a\x20','type','relative','skipped','2YsrKpV','2867040YiHuWw','3840644gNPQYl'];a110_0x3adc=function(){return _0x570614;};return a110_0x3adc();}function a110_0x2d5a(_0x4cc54b,_0x8129e3){_0x4cc54b=_0x4cc54b-0x9b;const _0x3adcff=a110_0x3adc();let _0x2d5a72=_0x3adcff[_0x4cc54b];return _0x2d5a72;}const a110_0x45ac35=a110_0x2d5a;(function(_0x1fc974,_0x2d1edd){const _0x38e630=a110_0x2d5a,_0x168698=_0x1fc974();while(!![]){try{const _0x445eb1=-parseInt(_0x38e630(0xab))/0x1*(parseInt(_0x38e630(0x9f))/0x2)+-parseInt(_0x38e630(0xaf))/0x3+parseInt(_0x38e630(0xa1))/0x4+-parseInt(_0x38e630(0xa0))/0x5+parseInt(_0x38e630(0xb0))/0x6+parseInt(_0x38e630(0xb5))/0x7*(parseInt(_0x38e630(0xae))/0x8)+parseInt(_0x38e630(0xaa))/0x9;if(_0x445eb1===_0x2d1edd)break;else _0x168698['push'](_0x168698['shift']());}catch(_0x20718a){_0x168698['push'](_0x168698['shift']());}}}(a110_0x3adc,0x76f3c));import{readFileSync}from'fs';import*as a110_0x55ef35 from'path';import*as a110_0x33d41d from'yaml';import{validateSegmentDef,validateJourneyDef}from'./yaml-validator.js';export function isJourneyDef(_0x3084f8){const _0x2f21e3=a110_0x2d5a;return typeof _0x3084f8===_0x2f21e3(0xa6)&&_0x3084f8!==null&&_0x2f21e3(0x9c)in _0x3084f8&&_0x3084f8[_0x2f21e3(0x9c)]===_0x2f21e3(0xac);}export function isValidationResult(_0x40a7c6){const _0x36c5d0=a110_0x2d5a;return!(_0x36c5d0(0x9e)in _0x40a7c6);}export function createParseErrorResult(_0x4077eb,_0x3365cc,_0x33862d,_0x1ff1e0,_0x20e04e=a110_0x45ac35(0xa4)){const _0x4ac295=a110_0x45ac35;return{'filePath':_0x4077eb,'relativePath':_0x3365cc,'source':_0x33862d,'result':{'valid':![],'errors':[{'level':_0x4ac295(0xad),'path':'','code':_0x4ac295(0xb3),'message':_0x1ff1e0}],'warnings':[]},'fileType':_0x20e04e};}export function validateYamlFile(_0x323ad0,_0x4de4c1,_0x2f94c2={}){const _0x421e1a=a110_0x45ac35,_0x108a47=a110_0x55ef35[_0x421e1a(0x9d)](_0x4de4c1,_0x323ad0)||a110_0x55ef35[_0x421e1a(0xb2)](_0x323ad0);try{const _0x342c78=readFileSync(_0x323ad0,'utf-8'),_0x4f8291=a110_0x33d41d[_0x421e1a(0xa5)](_0x342c78),_0x176767=_0x4f8291[_0x421e1a(0xb1)]();if(!_0x176767)return createParseErrorResult(_0x323ad0,_0x108a47,_0x342c78,_0x421e1a(0xa7));const _0x25b6ad=isJourneyDef(_0x176767)?_0x421e1a(0xac):_0x421e1a(0xa4);if(_0x2f94c2['filterType']&&_0x25b6ad!==_0x2f94c2['filterType'])return{'filePath':_0x323ad0,'relativePath':_0x108a47,'skipped':!![],'reason':_0x421e1a(0x9b)+_0x2f94c2['filterType']};const _0x4544d0={'source':_0x342c78,'document':_0x4f8291},_0x4b6267=_0x25b6ad===_0x421e1a(0xac)?validateJourneyDef(_0x176767,_0x4544d0):validateSegmentDef(_0x176767,_0x4544d0);return{'filePath':_0x323ad0,'relativePath':_0x108a47,'source':_0x342c78,'result':_0x4b6267,'fileType':_0x25b6ad};}catch(_0x54b26d){const _0x195de2=_0x54b26d instanceof Error?_0x54b26d[_0x421e1a(0xa3)]:String(_0x54b26d);return createParseErrorResult(_0x323ad0,_0x108a47,'',_0x421e1a(0xa2)+_0x195de2);}}export function validateYamlFiles(_0x1bfee7,_0x345033,_0x5be4a8={}){const _0x342853=a110_0x45ac35;return _0x1bfee7[_0x342853(0xa8)](_0x55754c=>validateYamlFile(_0x55754c,_0x345033,_0x5be4a8));}export function calculateSummary(_0x1b7a49){const _0x205ba4=a110_0x45ac35;let _0x5b74e0=0x0,_0x155124=0x0,_0x3843a5=0x0,_0x38ed9f=0x0;for(const _0x389989 of _0x1b7a49){if(!isValidationResult(_0x389989)){_0x38ed9f++;continue;}_0x389989[_0x205ba4(0xb6)][_0x205ba4(0xb4)]?_0x5b74e0++:_0x155124++,_0x3843a5+=_0x389989[_0x205ba4(0xb6)][_0x205ba4(0xa9)]['length'];}return{'validCount':_0x5b74e0,'invalidCount':_0x155124,'warningCount':_0x3843a5,'skippedCount':_0x38ed9f,'hasErrors':_0x155124>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a111_0x50af16=a111_0xa0be;(function(_0x162f35,_0x4e6f60){const _0x10995b=a111_0xa0be,_0x489fa9=_0x162f35();while(!![]){try{const _0x32fbeb=-parseInt(_0x10995b(0x19a))/0x1*(-parseInt(_0x10995b(0x208))/0x2)+-parseInt(_0x10995b(0x1b0))/0x3*(parseInt(_0x10995b(0x20e))/0x4)+-parseInt(_0x10995b(0x1dc))/0x5+parseInt(_0x10995b(0x21d))/0x6+parseInt(_0x10995b(0x197))/0x7*(parseInt(_0x10995b(0x1ba))/0x8)+-parseInt(_0x10995b(0x218))/0x9*(parseInt(_0x10995b(0x1c3))/0xa)+parseInt(_0x10995b(0x1de))/0xb;if(_0x32fbeb===_0x4e6f60)break;else _0x489fa9['push'](_0x489fa9['shift']());}catch(_0x1a6405){_0x489fa9['push'](_0x489fa9['shift']());}}}(a111_0x340a,0x83695));import a111_0x4931c6 from'chalk';const VALID_OPERATOR_TYPES=new Set([a111_0x50af16(0x20c),a111_0x50af16(0x1d0),a111_0x50af16(0x20f),a111_0x50af16(0x203),'Less',a111_0x50af16(0x1df),'In',a111_0x50af16(0x189),a111_0x50af16(0x1d7),a111_0x50af16(0x1bc),a111_0x50af16(0x1dd),a111_0x50af16(0x185),'IsNull',a111_0x50af16(0x18b),'TimeWithinNext',a111_0x50af16(0x21b),a111_0x50af16(0x1e1),a111_0x50af16(0x1d1)]),OPERATORS_REQUIRING_VALUE=new Set([a111_0x50af16(0x20c),a111_0x50af16(0x1d0),'Greater',a111_0x50af16(0x203),a111_0x50af16(0x19d),a111_0x50af16(0x1df),'In','NotIn','Contain',a111_0x50af16(0x1bc),a111_0x50af16(0x1dd),a111_0x50af16(0x185),a111_0x50af16(0x18b),a111_0x50af16(0x21a)]),OPERATORS_REQUIRING_UNIT=new Set(['TimeWithinPast','TimeWithinNext']);export function getLocationFromPath(_0x41591e,_0x4750db,_0x4587b5){const _0x20a444=a111_0x50af16;if(!_0x41591e||!_0x4750db)return undefined;try{let _0x36a245=_0x41591e[_0x20a444(0x171)](_0x4587b5,!![]),_0x33469f=[..._0x4587b5];while((!_0x36a245||typeof _0x36a245!=='object'||!(_0x20a444(0x1bd)in _0x36a245)||!_0x36a245[_0x20a444(0x1bd)])&&_0x33469f[_0x20a444(0x19f)]>0x0){_0x33469f[_0x20a444(0x191)](),_0x36a245=_0x33469f[_0x20a444(0x19f)]>0x0?_0x41591e[_0x20a444(0x171)](_0x33469f,!![]):_0x41591e[_0x20a444(0x1c8)];}if(!_0x36a245||typeof _0x36a245!==_0x20a444(0x1d2)||!(_0x20a444(0x1bd)in _0x36a245)||!_0x36a245['range'])return undefined;const [_0x164776]=_0x36a245['range'];return offsetToLocation(_0x4750db,_0x164776);}catch{return undefined;}}function a111_0xa0be(_0x4db63a,_0x106d4f){_0x4db63a=_0x4db63a-0x16a;const _0x340a96=a111_0x340a();let _0xa0beee=_0x340a96[_0x4db63a];return _0xa0beee;}export function offsetToLocation(_0x37eba5,_0x253f2a){const _0x356492=a111_0x50af16;let _0x36583d=0x1,_0x326f9a=0x1;for(let _0x59d147=0x0;_0x59d147<_0x253f2a&&_0x59d147<_0x37eba5[_0x356492(0x19f)];_0x59d147++){_0x37eba5[_0x59d147]==='\x0a'?(_0x36583d++,_0x326f9a=0x1):_0x326f9a++;}return{'line':_0x36583d,'column':_0x326f9a,'offset':_0x253f2a};}function pathToArray(_0x419f74){const _0x546c70=a111_0x50af16;if(!_0x419f74)return[];return _0x419f74[_0x546c70(0x1a7)]('.')['flatMap'](_0x2acdfd=>{const _0x226b83=_0x546c70,_0x59e1e7=_0x2acdfd[_0x226b83(0x205)](/^(\w+)\[(\d+)\]$/);if(_0x59e1e7)return[_0x59e1e7[0x1],parseInt(_0x59e1e7[0x2],0xa)];return[_0x2acdfd];});}export function validateRuleDef(_0x16186b,_0x3f0dc1,_0x3d8e60){const _0x4a5f21=a111_0x50af16,_0x12fe73=[];if(!_0x16186b)return _0x12fe73;_0x16186b[_0x4a5f21(0x181)]!=='And'&&_0x16186b['type']!=='Or'&&_0x12fe73[_0x4a5f21(0x1ab)]({'level':_0x4a5f21(0x1f8),'path':_0x3f0dc1+_0x4a5f21(0x18f),'code':_0x4a5f21(0x1e8),'message':_0x4a5f21(0x1c7)+_0x16186b[_0x4a5f21(0x181)]+'\x27','location':getLocationFromPath(_0x3d8e60['document'],_0x3d8e60[_0x4a5f21(0x217)],pathToArray(_0x3f0dc1+'.type'))});if(!_0x16186b[_0x4a5f21(0x1a4)]||!Array[_0x4a5f21(0x1ce)](_0x16186b[_0x4a5f21(0x1a4)]))return _0x12fe73['push']({'level':_0x4a5f21(0x1f8),'path':_0x3f0dc1+_0x4a5f21(0x1b1),'code':_0x4a5f21(0x1b5),'message':'Rule\x20must\x20have\x20a\x20conditions\x20array','location':getLocationFromPath(_0x3d8e60[_0x4a5f21(0x1b3)],_0x3d8e60[_0x4a5f21(0x217)],pathToArray(_0x3f0dc1))}),_0x12fe73;for(let _0x3699ff=0x0;_0x3699ff<_0x16186b[_0x4a5f21(0x1a4)][_0x4a5f21(0x19f)];_0x3699ff++){const _0x466688=_0x16186b[_0x4a5f21(0x1a4)][_0x3699ff],_0x19e65f=_0x3f0dc1+'.conditions['+_0x3699ff+']';_0x12fe73[_0x4a5f21(0x1ab)](...validateCondition(_0x466688,_0x19e65f,_0x3d8e60));}return _0x12fe73;}function validateCondition(_0x54fd38,_0x161daf,_0x126339){const _0x35be42=a111_0x50af16,_0x13a42f=[];if(!_0x54fd38||typeof _0x54fd38!=='object')return _0x13a42f;if(_0x54fd38[_0x35be42(0x181)]==='And'||_0x54fd38[_0x35be42(0x181)]==='Or'){if(!_0x54fd38[_0x35be42(0x1a4)]||!Array['isArray'](_0x54fd38[_0x35be42(0x1a4)]))_0x13a42f['push']({'level':'error','path':_0x161daf+'.conditions','code':_0x35be42(0x1b5),'message':_0x54fd38[_0x35be42(0x181)]+_0x35be42(0x1ee),'location':getLocationFromPath(_0x126339[_0x35be42(0x1b3)],_0x126339[_0x35be42(0x217)],pathToArray(_0x161daf))});else for(let _0x4f3639=0x0;_0x4f3639<_0x54fd38[_0x35be42(0x1a4)]['length'];_0x4f3639++){_0x13a42f[_0x35be42(0x1ab)](...validateCondition(_0x54fd38[_0x35be42(0x1a4)][_0x4f3639],_0x161daf+_0x35be42(0x1ac)+_0x4f3639+']',_0x126339));}return _0x13a42f;}if(_0x54fd38['type']===_0x35be42(0x195)||_0x54fd38[_0x35be42(0x181)]==='exclude')return!_0x54fd38[_0x35be42(0x1eb)]&&_0x13a42f['push']({'level':'error','path':_0x161daf+_0x35be42(0x1d3),'code':_0x35be42(0x1fb),'message':_0x54fd38[_0x35be42(0x181)]+_0x35be42(0x1be),'location':getLocationFromPath(_0x126339[_0x35be42(0x1b3)],_0x126339[_0x35be42(0x217)],pathToArray(_0x161daf))}),_0x13a42f;if(_0x54fd38[_0x35be42(0x181)]===_0x35be42(0x1bb)||_0x54fd38[_0x35be42(0x181)]===_0x35be42(0x19e)){const _0x2f316f=_0x54fd38,_0x470efd=_0x2f316f[_0x35be42(0x217)],_0xe31ba6=_0x2f316f[_0x35be42(0x215)],_0x31928a=_0x470efd||_0xe31ba6;(!_0x2f316f[_0x35be42(0x188)]||_0x2f316f[_0x35be42(0x188)]==='')&&!_0x31928a&&_0x13a42f[_0x35be42(0x1ab)]({'level':_0x35be42(0x1f8),'path':_0x161daf+_0x35be42(0x1e7),'code':_0x35be42(0x224),'message':_0x35be42(0x221),'location':getLocationFromPath(_0x126339['document'],_0x126339[_0x35be42(0x217)],pathToArray(_0x161daf+'.attribute'))}),_0x2f316f['operator']&&_0x13a42f['push'](...validateOperator(_0x2f316f[_0x35be42(0x1b4)],_0x161daf+_0x35be42(0x179),_0x126339)),_0x2f316f['arrayMatching']!==undefined&&_0x13a42f['push'](...validateArrayMatching(_0x2f316f[_0x35be42(0x201)],_0x161daf+'.arrayMatching',_0x126339)),_0x2f316f[_0x35be42(0x19c)]&&_0x13a42f[_0x35be42(0x1ab)](...validateRuleDef(_0x2f316f['filter'],_0x161daf+_0x35be42(0x1cd),_0x126339));}return _0x13a42f;}function validateOperator(_0x1ce297,_0x55d0d3,_0x346cd7){const _0x344194=a111_0x50af16,_0x542983=[];if(!VALID_OPERATOR_TYPES['has'](_0x1ce297[_0x344194(0x181)]))return _0x542983['push']({'level':_0x344194(0x1f8),'path':_0x55d0d3+'.type','code':_0x344194(0x1f0),'message':_0x344194(0x1d6)+_0x1ce297[_0x344194(0x181)]+_0x344194(0x16b)+[...VALID_OPERATOR_TYPES]['join'](',\x20'),'location':getLocationFromPath(_0x346cd7[_0x344194(0x1b3)],_0x346cd7[_0x344194(0x217)],pathToArray(_0x55d0d3+'.type'))}),_0x542983;return OPERATORS_REQUIRING_VALUE[_0x344194(0x20d)](_0x1ce297[_0x344194(0x181)])&&((_0x1ce297['value']===undefined||_0x1ce297['value']===null)&&_0x542983[_0x344194(0x1ab)]({'level':_0x344194(0x1f8),'path':_0x55d0d3+'.value','code':_0x344194(0x1fc),'message':_0x344194(0x204)+_0x1ce297[_0x344194(0x181)]+_0x344194(0x200),'location':getLocationFromPath(_0x346cd7[_0x344194(0x1b3)],_0x346cd7[_0x344194(0x217)],pathToArray(_0x55d0d3))})),_0x1ce297[_0x344194(0x181)]==='Between'&&(_0x1ce297[_0x344194(0x1e4)]===undefined&&_0x1ce297[_0x344194(0x1a6)]===undefined&&_0x542983[_0x344194(0x1ab)]({'level':_0x344194(0x1f8),'path':_0x55d0d3,'code':_0x344194(0x1f3),'message':_0x344194(0x202),'location':getLocationFromPath(_0x346cd7['document'],_0x346cd7[_0x344194(0x217)],pathToArray(_0x55d0d3))})),OPERATORS_REQUIRING_UNIT[_0x344194(0x20d)](_0x1ce297[_0x344194(0x181)])&&(!_0x1ce297[_0x344194(0x17c)]&&_0x1ce297[_0x344194(0x1c6)]!==undefined&&_0x542983['push']({'level':_0x344194(0x1f8),'path':_0x55d0d3+_0x344194(0x216),'code':'MISSING_TIME_UNIT','message':_0x344194(0x204)+_0x1ce297['type']+_0x344194(0x16f),'location':getLocationFromPath(_0x346cd7['document'],_0x346cd7[_0x344194(0x217)],pathToArray(_0x55d0d3))})),_0x542983;}function validateArrayMatching(_0xcc8b52,_0xe56e5e,_0xdb0dd5){const _0x2d0a6a=a111_0x50af16,_0x590b27=[];if(_0xcc8b52===_0x2d0a6a(0x223)||_0xcc8b52===_0x2d0a6a(0x1cc))return _0x590b27;if(typeof _0xcc8b52===_0x2d0a6a(0x1d2)){const _0x15e7a4=Object['keys'](_0xcc8b52),_0x55d716=['atLeast',_0x2d0a6a(0x21c),'exactly'],_0x20f8ea=_0x15e7a4[_0x2d0a6a(0x196)](_0x4c46e3=>_0x55d716[_0x2d0a6a(0x214)](_0x4c46e3));!_0x20f8ea&&_0x590b27[_0x2d0a6a(0x1ab)]({'level':'error','path':_0xe56e5e,'code':_0x2d0a6a(0x20b),'message':_0x2d0a6a(0x18a)+_0x55d716['join']('/')+'.','location':getLocationFromPath(_0xdb0dd5['document'],_0xdb0dd5['source'],pathToArray(_0xe56e5e))});}else _0x590b27[_0x2d0a6a(0x1ab)]({'level':_0x2d0a6a(0x1f8),'path':_0xe56e5e,'code':_0x2d0a6a(0x20b),'message':_0x2d0a6a(0x206),'location':getLocationFromPath(_0xdb0dd5[_0x2d0a6a(0x1b3)],_0xdb0dd5[_0x2d0a6a(0x217)],pathToArray(_0xe56e5e))});return _0x590b27;}export function validateSegmentDef(_0x32bfe2,_0x794bcc={}){const _0x3bb257=a111_0x50af16,_0x53d5c5=[],_0x4509ba=[];(!_0x32bfe2[_0x3bb257(0x1e9)]||_0x32bfe2[_0x3bb257(0x1e9)][_0x3bb257(0x209)]()==='')&&_0x53d5c5['push']({'level':'error','path':_0x3bb257(0x1e9),'code':_0x3bb257(0x176),'message':_0x3bb257(0x1f9),'location':getLocationFromPath(_0x794bcc[_0x3bb257(0x1b3)],_0x794bcc[_0x3bb257(0x217)],[_0x3bb257(0x1e9)])});if(_0x32bfe2[_0x3bb257(0x1e5)]){const _0x582eac=validateRuleDef(_0x32bfe2[_0x3bb257(0x1e5)],_0x3bb257(0x1e5),_0x794bcc);for(const _0x1548ab of _0x582eac){_0x1548ab[_0x3bb257(0x170)]===_0x3bb257(0x1f8)?_0x53d5c5[_0x3bb257(0x1ab)](_0x1548ab):_0x4509ba[_0x3bb257(0x1ab)](_0x1548ab);}}return{'valid':_0x53d5c5[_0x3bb257(0x19f)]===0x0,'errors':_0x53d5c5,'warnings':_0x4509ba};}export function validateJourneyDef(_0x3e2f12,_0x372f1c={}){const _0x2e79b6=a111_0x50af16,_0x143434=[],_0x1a8e68=[];(!_0x3e2f12[_0x2e79b6(0x1e9)]||_0x3e2f12['name'][_0x2e79b6(0x209)]()==='')&&_0x143434[_0x2e79b6(0x1ab)]({'level':_0x2e79b6(0x1f8),'path':_0x2e79b6(0x1e9),'code':_0x2e79b6(0x176),'message':_0x2e79b6(0x210),'location':getLocationFromPath(_0x372f1c[_0x2e79b6(0x1b3)],_0x372f1c[_0x2e79b6(0x217)],[_0x2e79b6(0x1e9)])});const _0x996ea0=new Set();if(_0x3e2f12[_0x2e79b6(0x17a)])for(const _0x153ff3 of Object[_0x2e79b6(0x1f1)](_0x3e2f12[_0x2e79b6(0x17a)])){_0x996ea0[_0x2e79b6(0x211)](_0x153ff3);}const _0x313c35=new Set(),_0x491946={..._0x372f1c,'embeddedSegments':_0x996ea0,'referencedSegments':_0x313c35};if(_0x3e2f12[_0x2e79b6(0x17a)])for(const [_0x2637bd,_0x40c1bc]of Object[_0x2e79b6(0x1a0)](_0x3e2f12['segments'])){const _0x4fa2a5=validateEmbeddedSegment(_0x40c1bc,'segments.'+_0x2637bd,_0x491946);for(const _0x1b07b4 of _0x4fa2a5){if(_0x1b07b4[_0x2e79b6(0x170)]===_0x2e79b6(0x1f8))_0x143434[_0x2e79b6(0x1ab)](_0x1b07b4);else _0x1a8e68[_0x2e79b6(0x1ab)](_0x1b07b4);}}const _0x1667dc=getJourneyStages(_0x3e2f12);_0x1667dc['length']===0x0&&_0x143434[_0x2e79b6(0x1ab)]({'level':_0x2e79b6(0x1f8),'path':_0x2e79b6(0x1ff),'code':_0x2e79b6(0x1db),'message':_0x2e79b6(0x1c0),'location':getLocationFromPath(_0x372f1c['document'],_0x372f1c[_0x2e79b6(0x217)],['stages'])});const _0x31b25a=new Set();for(const _0x659f35 of _0x1667dc){if(_0x659f35[_0x2e79b6(0x1ea)])for(const _0x4c9efd of _0x659f35[_0x2e79b6(0x1ea)]){_0x4c9efd['name']&&_0x31b25a['add'](_0x4c9efd[_0x2e79b6(0x1e9)]);}}_0x491946[_0x2e79b6(0x180)]=_0x31b25a;for(let _0x5c2bb7=0x0;_0x5c2bb7<_0x1667dc[_0x2e79b6(0x19f)];_0x5c2bb7++){const _0x1fbab6=_0x1667dc[_0x5c2bb7],_0x54c103='stages['+_0x5c2bb7+']',_0x572a61=validateStage(_0x1fbab6,_0x54c103,_0x491946);for(const _0x29a028 of _0x572a61){if(_0x29a028[_0x2e79b6(0x170)]===_0x2e79b6(0x1f8))_0x143434[_0x2e79b6(0x1ab)](_0x29a028);else _0x1a8e68[_0x2e79b6(0x1ab)](_0x29a028);}}if(_0x3e2f12['goal']){const _0x24f03b=validateCriteria(_0x3e2f12[_0x2e79b6(0x1a1)],_0x2e79b6(0x1a1),_0x491946);for(const _0x5b7a0f of _0x24f03b){if(_0x5b7a0f[_0x2e79b6(0x170)]==='error')_0x143434[_0x2e79b6(0x1ab)](_0x5b7a0f);else _0x1a8e68['push'](_0x5b7a0f);}}for(const _0x4ab015 of _0x996ea0){!_0x313c35['has'](_0x4ab015)&&!_0x4ab015['startsWith'](_0x2e79b6(0x17f))&&_0x1a8e68[_0x2e79b6(0x1ab)]({'level':_0x2e79b6(0x1a2),'path':_0x2e79b6(0x16d)+_0x4ab015,'code':'UNUSED_EMBEDDED_SEGMENT','message':_0x2e79b6(0x1b2)+_0x4ab015+_0x2e79b6(0x1a9),'location':getLocationFromPath(_0x372f1c[_0x2e79b6(0x1b3)],_0x372f1c[_0x2e79b6(0x217)],[_0x2e79b6(0x17a),_0x4ab015])});}return{'valid':_0x143434['length']===0x0,'errors':_0x143434,'warnings':_0x1a8e68};}function a111_0x340a(){const _0x5df746=['repeat','.name','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','MISSING_STAGES','3159675wjptjq','EndWith','14761593pgtCfp','LessEqual','condition','TimeToday','.with.condition.next','embeddedSegments','min','rule','Jump\x20step\x20requires\x20a\x20target','.attribute','INVALID_RULE_TYPE','name','steps','segment','stage','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','\x20condition\x20must\x20have\x20a\x20conditions\x20array','with','INVALID_OPERATOR_TYPE','keys','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','MISSING_BETWEEN_BOUNDS','set','ab_test','end','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','error','Segment\x20name\x20is\x20required','.with.condition.timeout.next','MISSING_SEGMENT_REFERENCE','MISSING_OPERATOR_VALUE','exit_criteria','.with.branches','stages','\x27\x20requires\x20a\x20value','arrayMatching','Between\x20operator\x20requires\x20\x27min\x27\x20and/or\x20\x27max\x27\x20values','GreaterEqual','Operator\x20\x27','match','Invalid\x20arrayMatching\x20value.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20atLeast/atMost/exactly.','.steps[','111626LuEWiK','trim','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','INVALID_ARRAY_MATCHING','Equal','has','4TxTbGy','Greater','Journey\x20name\x20is\x20required','add','].next','.with.target','includes','aggregation','.unit','source','9ecKRhN','percentage','TimeWithinNext','TimeRange','atMost','3905274PUQvTQ','branches','INVALID_NEXT_REFERENCE','padStart','Attribute\x20name\x20cannot\x20be\x20empty','.with.variants','any','EMPTY_ATTRIBUTE','MISSING_ACTIVATION_REF','INVALID_AB_TEST_PERCENTAGES','\x27.\x20Valid\x20types:\x20','red','segments.','decision_point','\x27\x20requires\x20a\x20time\x20unit','level','getIn','Activation\x20step\x20requires\x20an\x20activation\x20reference','Duplicate\x20step\x20name\x20\x27','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','yellow','MISSING_NAME','.next','ref:','.operator','segments','journeys','unit','abs','get','excluded_','stepNames','type','startsWith','journey','reduce','Regexp','message','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','attribute','NotIn','Invalid\x20arrayMatching.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20','TimeWithinPast','.entry_criteria','timeout','code','.type','variants','pop','join','.with.branches[','flatMap','include','some','7DaeBUp','toString','dim','13hHBOYJ','.milestone','filter','Less','Behavior','length','entries','goal','warning','cyan','conditions','entry_criteria','max','split','excluded','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','INVALID_JUMP_TARGET','push','.conditions[','Step\x20references\x20non-existent\x20step\x20\x27','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','milestone','2338611yADuhy','.conditions','Embedded\x20segment\x20\x27','document','operator','MISSING_CONDITIONS','.with','location','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','jump','453224UFHgnG','Value','StartWith','range','\x20condition\x20must\x20have\x20a\x20segment\x20reference','referencedSegments','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','.with.variants[','path','8253310JxCxUj','activation','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','value','Rule\x20type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','contents','target','.with.condition.segment','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','all','.filter','isArray','versions','NotEqual','Between','object','.segment','next','warnings','Invalid\x20operator\x20type\x20\x27','Contain'];a111_0x340a=function(){return _0x5df746;};return a111_0x340a();}function getJourneyStages(_0x147ca9){const _0x4db968=a111_0x50af16;if(_0x147ca9[_0x4db968(0x1ff)]&&_0x147ca9['stages']['length']>0x0)return _0x147ca9[_0x4db968(0x1ff)];if(_0x147ca9[_0x4db968(0x17b)]&&_0x147ca9[_0x4db968(0x17b)][_0x4db968(0x19f)]>0x0)return _0x147ca9['journeys'][_0x4db968(0x194)](_0x3d3b9d=>_0x3d3b9d['stages']||[]);if(_0x147ca9[_0x4db968(0x1cf)]&&_0x147ca9[_0x4db968(0x1cf)][_0x4db968(0x19f)]>0x0)return _0x147ca9[_0x4db968(0x1cf)]['flatMap'](_0x448572=>_0x448572['stages']||[]);return[];}function validateEmbeddedSegment(_0x28ed3d,_0x44953b,_0x207bb0){const _0x576dc8=a111_0x50af16,_0x19595d=[];return _0x28ed3d[_0x576dc8(0x1e5)]&&_0x19595d['push'](...validateRuleDef(_0x28ed3d[_0x576dc8(0x1e5)],_0x44953b+'.rule',_0x207bb0)),_0x19595d;}function validateStage(_0x3743fc,_0x3ccd65,_0x268526){const _0x1c8a32=a111_0x50af16,_0xa6d9c2=[],_0x4c6464=new Map();if(_0x3743fc[_0x1c8a32(0x1ea)])for(let _0x4905e8=0x0;_0x4905e8<_0x3743fc['steps'][_0x1c8a32(0x19f)];_0x4905e8++){const _0xe9e6f9=_0x3743fc['steps'][_0x4905e8],_0x1216dc=_0x3ccd65+_0x1c8a32(0x207)+_0x4905e8+']';if(_0xe9e6f9[_0x1c8a32(0x1e9)]){if(_0x4c6464[_0x1c8a32(0x20d)](_0xe9e6f9['name'])){const _0x36bd43=_0x4c6464[_0x1c8a32(0x17e)](_0xe9e6f9['name']);_0xa6d9c2[_0x1c8a32(0x1ab)]({'level':'error','path':_0x1216dc+_0x1c8a32(0x1d9),'code':'DUPLICATE_STEP_NAME','message':_0x1c8a32(0x173)+_0xe9e6f9[_0x1c8a32(0x1e9)]+'\x27\x20(first\x20defined\x20at\x20steps['+_0x36bd43+'])','location':getLocationFromPath(_0x268526[_0x1c8a32(0x1b3)],_0x268526[_0x1c8a32(0x217)],pathToArray(_0x1216dc+_0x1c8a32(0x1d9)))});}else _0x4c6464[_0x1c8a32(0x1f4)](_0xe9e6f9[_0x1c8a32(0x1e9)],_0x4905e8);}_0xa6d9c2[_0x1c8a32(0x1ab)](...validateStep(_0xe9e6f9,_0x1216dc,_0x268526));}_0x3743fc[_0x1c8a32(0x1a5)]&&_0xa6d9c2[_0x1c8a32(0x1ab)](...validateCriteria(_0x3743fc[_0x1c8a32(0x1a5)],_0x3ccd65+_0x1c8a32(0x18c),_0x268526));if(_0x3743fc['exit_criteria'])for(let _0x18c9f7=0x0;_0x18c9f7<_0x3743fc[_0x1c8a32(0x1fd)][_0x1c8a32(0x19f)];_0x18c9f7++){_0xa6d9c2['push'](...validateCriteria(_0x3743fc[_0x1c8a32(0x1fd)][_0x18c9f7],_0x3ccd65+'.exit_criteria['+_0x18c9f7+']',_0x268526));}return _0x3743fc[_0x1c8a32(0x1af)]&&_0xa6d9c2[_0x1c8a32(0x1ab)](...validateCriteria(_0x3743fc[_0x1c8a32(0x1af)],_0x3ccd65+_0x1c8a32(0x19b),_0x268526)),_0xa6d9c2;}function validateStep(_0x27ef8c,_0x2708cc,_0x5ac9ca){const _0x5826e5=a111_0x50af16,_0x39088f=[];_0x27ef8c[_0x5826e5(0x1d4)]&&_0x27ef8c[_0x5826e5(0x181)]!==_0x5826e5(0x1f6)&&(_0x5ac9ca['stepNames']&&!_0x5ac9ca[_0x5826e5(0x180)][_0x5826e5(0x20d)](_0x27ef8c[_0x5826e5(0x1d4)])&&_0x39088f[_0x5826e5(0x1ab)]({'level':_0x5826e5(0x1f8),'path':_0x2708cc+_0x5826e5(0x177),'code':_0x5826e5(0x21f),'message':_0x5826e5(0x1ad)+_0x27ef8c[_0x5826e5(0x1d4)]+'\x27','location':getLocationFromPath(_0x5ac9ca[_0x5826e5(0x1b3)],_0x5ac9ca[_0x5826e5(0x217)],pathToArray(_0x2708cc+'.next'))}));switch(_0x27ef8c['type']){case'wait':_0x39088f[_0x5826e5(0x1ab)](...validateWaitStep(_0x27ef8c,_0x2708cc,_0x5ac9ca));break;case _0x5826e5(0x1c4):_0x39088f[_0x5826e5(0x1ab)](...validateActivationStep(_0x27ef8c,_0x2708cc,_0x5ac9ca));break;case _0x5826e5(0x16e):_0x39088f[_0x5826e5(0x1ab)](...validateDecisionPointStep(_0x27ef8c,_0x2708cc,_0x5ac9ca));break;case _0x5826e5(0x1f5):_0x39088f[_0x5826e5(0x1ab)](...validateAbTestStep(_0x27ef8c,_0x2708cc,_0x5ac9ca));break;case _0x5826e5(0x1b9):_0x39088f[_0x5826e5(0x1ab)](...validateJumpStep(_0x27ef8c,_0x2708cc,_0x5ac9ca));break;}return _0x39088f;}function validateWaitStep(_0x1ec1af,_0x2b2169,_0x133ebb){const _0x5384b6=a111_0x50af16,_0x57cebb=[];if(!_0x1ec1af[_0x5384b6(0x1ef)])return _0x57cebb[_0x5384b6(0x1ab)]({'level':_0x5384b6(0x1f8),'path':_0x2b2169+_0x5384b6(0x1b6),'code':'MISSING_WAIT_PARAMS','message':_0x5384b6(0x174),'location':getLocationFromPath(_0x133ebb['document'],_0x133ebb['source'],pathToArray(_0x2b2169))}),_0x57cebb;if(_0x1ec1af[_0x5384b6(0x1ef)][_0x5384b6(0x1e0)]){const _0x34f8e3=_0x1ec1af['with'][_0x5384b6(0x1e0)];_0x34f8e3[_0x5384b6(0x1eb)]&&(_0x133ebb[_0x5384b6(0x1bf)]?.['add'](_0x34f8e3[_0x5384b6(0x1eb)]),!_0x34f8e3[_0x5384b6(0x1eb)]['startsWith'](_0x5384b6(0x178))&&(_0x133ebb[_0x5384b6(0x1e3)]&&!_0x133ebb[_0x5384b6(0x1e3)]['has'](_0x34f8e3['segment'])&&_0x57cebb[_0x5384b6(0x1ab)]({'level':_0x5384b6(0x1f8),'path':_0x2b2169+'.with.condition.segment','code':_0x5384b6(0x1fb),'message':_0x5384b6(0x1f7)+_0x34f8e3[_0x5384b6(0x1eb)]+_0x5384b6(0x187),'location':getLocationFromPath(_0x133ebb[_0x5384b6(0x1b3)],_0x133ebb['source'],pathToArray(_0x2b2169+_0x5384b6(0x1ca)))})),_0x34f8e3[_0x5384b6(0x1d4)]&&_0x133ebb[_0x5384b6(0x180)]&&!_0x133ebb[_0x5384b6(0x180)][_0x5384b6(0x20d)](_0x34f8e3[_0x5384b6(0x1d4)])&&_0x57cebb[_0x5384b6(0x1ab)]({'level':_0x5384b6(0x1f8),'path':_0x2b2169+_0x5384b6(0x1e2),'code':_0x5384b6(0x21f),'message':_0x5384b6(0x1da)+_0x34f8e3[_0x5384b6(0x1d4)]+'\x27','location':getLocationFromPath(_0x133ebb[_0x5384b6(0x1b3)],_0x133ebb[_0x5384b6(0x217)],pathToArray(_0x2b2169+_0x5384b6(0x1e2)))}),_0x34f8e3[_0x5384b6(0x18d)]?.[_0x5384b6(0x1d4)]&&_0x133ebb['stepNames']&&!_0x133ebb[_0x5384b6(0x180)][_0x5384b6(0x20d)](_0x34f8e3[_0x5384b6(0x18d)][_0x5384b6(0x1d4)])&&_0x57cebb[_0x5384b6(0x1ab)]({'level':_0x5384b6(0x1f8),'path':_0x2b2169+_0x5384b6(0x1fa),'code':_0x5384b6(0x21f),'message':_0x5384b6(0x1cb)+_0x34f8e3[_0x5384b6(0x18d)]['next']+'\x27','location':getLocationFromPath(_0x133ebb[_0x5384b6(0x1b3)],_0x133ebb['source'],pathToArray(_0x2b2169+_0x5384b6(0x1fa)))}));}return _0x57cebb;}function validateActivationStep(_0x4251b2,_0x39f599,_0x5934a3){const _0x307c55=a111_0x50af16,_0x5ab4e5=[];return!_0x4251b2[_0x307c55(0x1ef)]?.['activation']&&_0x5ab4e5['push']({'level':_0x307c55(0x1f8),'path':_0x39f599+'.with.activation','code':_0x307c55(0x225),'message':_0x307c55(0x172),'location':getLocationFromPath(_0x5934a3[_0x307c55(0x1b3)],_0x5934a3[_0x307c55(0x217)],pathToArray(_0x39f599))}),_0x5ab4e5;}function validateDecisionPointStep(_0x2feaa1,_0xae8967,_0x3f34ad){const _0x3b97eb=a111_0x50af16,_0x312b22=[];if(!_0x2feaa1['with']?.[_0x3b97eb(0x21e)]||_0x2feaa1[_0x3b97eb(0x1ef)]['branches'][_0x3b97eb(0x19f)]===0x0)return _0x312b22[_0x3b97eb(0x1ab)]({'level':_0x3b97eb(0x1f8),'path':_0xae8967+_0x3b97eb(0x1fe),'code':_0x3b97eb(0x1b5),'message':_0x3b97eb(0x1c5),'location':getLocationFromPath(_0x3f34ad[_0x3b97eb(0x1b3)],_0x3f34ad['source'],pathToArray(_0xae8967))}),_0x312b22;for(let _0x568c0c=0x0;_0x568c0c<_0x2feaa1['with'][_0x3b97eb(0x21e)]['length'];_0x568c0c++){const _0x4d7c78=_0x2feaa1[_0x3b97eb(0x1ef)]['branches'][_0x568c0c],_0x57f6c9=_0xae8967+_0x3b97eb(0x193)+_0x568c0c+']';_0x4d7c78[_0x3b97eb(0x1eb)]&&!_0x4d7c78[_0x3b97eb(0x1a8)]&&(_0x3f34ad[_0x3b97eb(0x1bf)]?.[_0x3b97eb(0x211)](_0x4d7c78[_0x3b97eb(0x1eb)]),!_0x4d7c78[_0x3b97eb(0x1eb)][_0x3b97eb(0x182)](_0x3b97eb(0x178))&&(_0x3f34ad[_0x3b97eb(0x1e3)]&&!_0x3f34ad[_0x3b97eb(0x1e3)][_0x3b97eb(0x20d)](_0x4d7c78[_0x3b97eb(0x1eb)])&&_0x312b22[_0x3b97eb(0x1ab)]({'level':'error','path':_0x57f6c9+_0x3b97eb(0x1d3),'code':_0x3b97eb(0x1fb),'message':_0x3b97eb(0x20a)+_0x4d7c78[_0x3b97eb(0x1eb)]+'\x27','location':getLocationFromPath(_0x3f34ad[_0x3b97eb(0x1b3)],_0x3f34ad['source'],pathToArray(_0x57f6c9+'.segment'))}))),_0x4d7c78[_0x3b97eb(0x1d4)]&&_0x3f34ad[_0x3b97eb(0x180)]&&!_0x3f34ad[_0x3b97eb(0x180)][_0x3b97eb(0x20d)](_0x4d7c78['next'])&&_0x312b22[_0x3b97eb(0x1ab)]({'level':'error','path':_0x57f6c9+_0x3b97eb(0x177),'code':_0x3b97eb(0x21f),'message':_0x3b97eb(0x1ae)+_0x4d7c78[_0x3b97eb(0x1d4)]+'\x27','location':getLocationFromPath(_0x3f34ad[_0x3b97eb(0x1b3)],_0x3f34ad['source'],pathToArray(_0x57f6c9+_0x3b97eb(0x177)))});}return _0x312b22;}function validateAbTestStep(_0x189990,_0x421173,_0x4ba669){const _0x24dd31=a111_0x50af16,_0xa665df=[];if(!_0x189990[_0x24dd31(0x1ef)]?.['variants']||_0x189990[_0x24dd31(0x1ef)][_0x24dd31(0x190)]['length']===0x0)return _0xa665df[_0x24dd31(0x1ab)]({'level':_0x24dd31(0x1f8),'path':_0x421173+'.with.variants','code':_0x24dd31(0x1b5),'message':'A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','location':getLocationFromPath(_0x4ba669[_0x24dd31(0x1b3)],_0x4ba669['source'],pathToArray(_0x421173))}),_0xa665df;const _0x57a0f2=_0x189990[_0x24dd31(0x1ef)][_0x24dd31(0x190)][_0x24dd31(0x184)]((_0x46d4e4,_0x283c31)=>_0x46d4e4+(_0x283c31[_0x24dd31(0x219)]||0x0),0x0);Math[_0x24dd31(0x17d)](_0x57a0f2-0x64)>0.01&&_0xa665df[_0x24dd31(0x1ab)]({'level':_0x24dd31(0x1f8),'path':_0x421173+'.with.variants','code':_0x24dd31(0x16a),'message':_0x24dd31(0x1ed)+_0x57a0f2+'%)','location':getLocationFromPath(_0x4ba669['document'],_0x4ba669[_0x24dd31(0x217)],pathToArray(_0x421173+_0x24dd31(0x222)))});for(let _0x1af8f4=0x0;_0x1af8f4<_0x189990[_0x24dd31(0x1ef)][_0x24dd31(0x190)][_0x24dd31(0x19f)];_0x1af8f4++){const _0x13d269=_0x189990['with'][_0x24dd31(0x190)][_0x1af8f4];_0x13d269[_0x24dd31(0x1d4)]&&_0x4ba669['stepNames']&&!_0x4ba669[_0x24dd31(0x180)][_0x24dd31(0x20d)](_0x13d269[_0x24dd31(0x1d4)])&&_0xa665df['push']({'level':_0x24dd31(0x1f8),'path':_0x421173+_0x24dd31(0x1c1)+_0x1af8f4+_0x24dd31(0x212),'code':'INVALID_NEXT_REFERENCE','message':_0x24dd31(0x1b8)+_0x13d269[_0x24dd31(0x1d4)]+'\x27','location':getLocationFromPath(_0x4ba669[_0x24dd31(0x1b3)],_0x4ba669[_0x24dd31(0x217)],pathToArray(_0x421173+_0x24dd31(0x1c1)+_0x1af8f4+_0x24dd31(0x212)))});}return _0xa665df;}function validateJumpStep(_0x1c60cc,_0x3d1753,_0x2bd8f0){const _0x51129d=a111_0x50af16,_0x2289fb=[];if(!_0x1c60cc['with']?.['target'])return _0x2289fb[_0x51129d(0x1ab)]({'level':_0x51129d(0x1f8),'path':_0x3d1753+_0x51129d(0x213),'code':_0x51129d(0x1aa),'message':_0x51129d(0x1e6),'location':getLocationFromPath(_0x2bd8f0[_0x51129d(0x1b3)],_0x2bd8f0[_0x51129d(0x217)],pathToArray(_0x3d1753))}),_0x2289fb;return(!_0x1c60cc[_0x51129d(0x1ef)][_0x51129d(0x1c9)][_0x51129d(0x183)]||!_0x1c60cc['with'][_0x51129d(0x1c9)][_0x51129d(0x1ec)])&&_0x2289fb[_0x51129d(0x1ab)]({'level':_0x51129d(0x1f8),'path':_0x3d1753+'.with.target','code':_0x51129d(0x1aa),'message':_0x51129d(0x1f2),'location':getLocationFromPath(_0x2bd8f0['document'],_0x2bd8f0[_0x51129d(0x217)],pathToArray(_0x3d1753+_0x51129d(0x213)))}),_0x2289fb;}function validateCriteria(_0x3674d8,_0x24e76d,_0x664dc1){const _0xfaf3b5=a111_0x50af16,_0x3ab7fe=[];return _0x3674d8['segment']&&(_0x664dc1[_0xfaf3b5(0x1bf)]?.[_0xfaf3b5(0x211)](_0x3674d8['segment']),!_0x3674d8[_0xfaf3b5(0x1eb)]['startsWith']('ref:')&&(_0x664dc1[_0xfaf3b5(0x1e3)]&&!_0x664dc1[_0xfaf3b5(0x1e3)][_0xfaf3b5(0x20d)](_0x3674d8[_0xfaf3b5(0x1eb)])&&_0x3ab7fe['push']({'level':'error','path':_0x24e76d+_0xfaf3b5(0x1d3),'code':_0xfaf3b5(0x1fb),'message':'Criteria\x20references\x20undefined\x20segment\x20\x27'+_0x3674d8[_0xfaf3b5(0x1eb)]+'\x27','location':getLocationFromPath(_0x664dc1[_0xfaf3b5(0x1b3)],_0x664dc1[_0xfaf3b5(0x217)],pathToArray(_0x24e76d+_0xfaf3b5(0x1d3)))}))),_0x3ab7fe;}export function formatIssueWithContext(_0x37c3a8,_0x37b6b8,_0xa4c07b){const _0x406aa9=a111_0x50af16,_0x929106=[],_0x5ccf19=_0x37c3a8[_0x406aa9(0x170)]==='error',_0x2657c7=_0x5ccf19?a111_0x4931c6['red']:a111_0x4931c6[_0x406aa9(0x175)],_0x16d9d7=_0x5ccf19?a111_0x4931c6[_0x406aa9(0x16c)]:a111_0x4931c6['yellow'],_0x236b23=_0xa4c07b?a111_0x4931c6[_0x406aa9(0x1a3)](_0xa4c07b+':'):'';if(_0x37c3a8['location']){const _0x456047=a111_0x4931c6[_0x406aa9(0x1a3)](_0x37c3a8[_0x406aa9(0x1b7)]['line']+':'+_0x37c3a8[_0x406aa9(0x1b7)]['column']);_0x929106[_0x406aa9(0x1ab)](''+_0x236b23+_0x456047+':\x20'+_0x2657c7(_0x37c3a8[_0x406aa9(0x170)])+'\x20'+_0x16d9d7('['+_0x37c3a8[_0x406aa9(0x18e)]+']'));}else _0x929106[_0x406aa9(0x1ab)](''+_0x236b23+a111_0x4931c6[_0x406aa9(0x199)](_0x37c3a8[_0x406aa9(0x1c2)])+':\x20'+_0x2657c7(_0x37c3a8[_0x406aa9(0x170)])+'\x20'+_0x16d9d7('['+_0x37c3a8[_0x406aa9(0x18e)]+']'));_0x929106[_0x406aa9(0x1ab)](_0x37c3a8[_0x406aa9(0x186)]);if(_0x37c3a8[_0x406aa9(0x1b7)]&&_0x37b6b8){const _0x175a38=_0x37b6b8[_0x406aa9(0x1a7)]('\x0a'),{line:_0x4230e8,column:_0xb4123c}=_0x37c3a8[_0x406aa9(0x1b7)],_0x35f06c=Math[_0x406aa9(0x1a6)](0x1,_0x4230e8-0x1),_0x2e6dd1=Math[_0x406aa9(0x1e4)](_0x175a38[_0x406aa9(0x19f)],_0x4230e8+0x1);_0x929106[_0x406aa9(0x1ab)]('');for(let _0x3ff63e=_0x35f06c;_0x3ff63e<=_0x2e6dd1;_0x3ff63e++){const _0x1da159=_0x175a38[_0x3ff63e-0x1]||'',_0x23f09b=a111_0x4931c6[_0x406aa9(0x199)](_0x3ff63e[_0x406aa9(0x198)]()[_0x406aa9(0x220)](0x4)),_0x570e3e=a111_0x4931c6['dim']('\x20|\x20');if(_0x3ff63e===_0x4230e8){_0x929106[_0x406aa9(0x1ab)]('\x20\x20'+_0x23f09b+_0x570e3e+_0x2657c7(_0x1da159));const _0x137b1f='\x20'[_0x406aa9(0x1d8)](0x4+0x3+_0xb4123c-0x1);_0x929106[_0x406aa9(0x1ab)]('\x20\x20'+_0x137b1f+_0x2657c7('^'));}else _0x929106[_0x406aa9(0x1ab)]('\x20\x20'+_0x23f09b+_0x570e3e+a111_0x4931c6[_0x406aa9(0x199)](_0x1da159));}}return _0x929106[_0x406aa9(0x192)]('\x0a');}export function formatValidationResult(_0x4a8097,_0x5cf700,_0x52b607){const _0x33c5fd=a111_0x50af16,_0x5969c4=[];for(const _0x64fa88 of _0x4a8097['errors']){_0x5969c4[_0x33c5fd(0x1ab)](formatIssueWithContext(_0x64fa88,_0x5cf700,_0x52b607)),_0x5969c4[_0x33c5fd(0x1ab)]('');}for(const _0x4ea674 of _0x4a8097[_0x33c5fd(0x1d5)]){_0x5969c4[_0x33c5fd(0x1ab)](formatIssueWithContext(_0x4ea674,_0x5cf700,_0x52b607)),_0x5969c4[_0x33c5fd(0x1ab)]('');}return _0x5969c4[_0x33c5fd(0x192)]('\x0a');}
|
|
1
|
+
const a111_0x511b0b=a111_0x4000;(function(_0x13834c,_0x25c84b){const _0x21f167=a111_0x4000,_0x5668be=_0x13834c();while(!![]){try{const _0x24ace9=parseInt(_0x21f167(0x135))/0x1+-parseInt(_0x21f167(0x113))/0x2+parseInt(_0x21f167(0x1b3))/0x3*(parseInt(_0x21f167(0x1a4))/0x4)+-parseInt(_0x21f167(0x13b))/0x5+parseInt(_0x21f167(0x101))/0x6*(-parseInt(_0x21f167(0x174))/0x7)+parseInt(_0x21f167(0x162))/0x8*(-parseInt(_0x21f167(0x19c))/0x9)+-parseInt(_0x21f167(0xf7))/0xa*(-parseInt(_0x21f167(0x1aa))/0xb);if(_0x24ace9===_0x25c84b)break;else _0x5668be['push'](_0x5668be['shift']());}catch(_0x9a2fd6){_0x5668be['push'](_0x5668be['shift']());}}}(a111_0x59df,0x266fd));import a111_0x31e602 from'chalk';const VALID_OPERATOR_TYPES=new Set([a111_0x511b0b(0x1a6),a111_0x511b0b(0x16f),a111_0x511b0b(0x1a7),'GreaterEqual',a111_0x511b0b(0x155),a111_0x511b0b(0x103),'In',a111_0x511b0b(0x108),a111_0x511b0b(0x13f),a111_0x511b0b(0x183),a111_0x511b0b(0x197),'Regexp',a111_0x511b0b(0x141),a111_0x511b0b(0x11e),'TimeWithinNext','TimeRange','TimeToday',a111_0x511b0b(0x172)]),OPERATORS_REQUIRING_VALUE=new Set([a111_0x511b0b(0x1a6),a111_0x511b0b(0x16f),a111_0x511b0b(0x1a7),'GreaterEqual',a111_0x511b0b(0x155),a111_0x511b0b(0x103),'In',a111_0x511b0b(0x108),a111_0x511b0b(0x13f),a111_0x511b0b(0x183),a111_0x511b0b(0x197),'Regexp','TimeWithinPast',a111_0x511b0b(0x1a3)]),OPERATORS_REQUIRING_UNIT=new Set([a111_0x511b0b(0x11e),a111_0x511b0b(0x1a3)]);export function getLocationFromPath(_0x46002e,_0x1e6b10,_0x2fe9db){const _0x49154e=a111_0x511b0b;if(!_0x46002e||!_0x1e6b10)return undefined;try{let _0xb7a440=_0x46002e[_0x49154e(0x193)](_0x2fe9db,!![]),_0x526e7a=[..._0x2fe9db];while((!_0xb7a440||typeof _0xb7a440!==_0x49154e(0x121)||!('range'in _0xb7a440)||!_0xb7a440[_0x49154e(0x189)])&&_0x526e7a[_0x49154e(0x168)]>0x0){_0x526e7a[_0x49154e(0x100)](),_0xb7a440=_0x526e7a[_0x49154e(0x168)]>0x0?_0x46002e[_0x49154e(0x193)](_0x526e7a,!![]):_0x46002e[_0x49154e(0x144)];}if(!_0xb7a440||typeof _0xb7a440!==_0x49154e(0x121)||!(_0x49154e(0x189)in _0xb7a440)||!_0xb7a440[_0x49154e(0x189)])return undefined;const [_0x1adc77]=_0xb7a440[_0x49154e(0x189)];return offsetToLocation(_0x1e6b10,_0x1adc77);}catch{return undefined;}}export function offsetToLocation(_0x38e878,_0x5890f9){let _0x174d42=0x1,_0x12132d=0x1;for(let _0xd35730=0x0;_0xd35730<_0x5890f9&&_0xd35730<_0x38e878['length'];_0xd35730++){_0x38e878[_0xd35730]==='\x0a'?(_0x174d42++,_0x12132d=0x1):_0x12132d++;}return{'line':_0x174d42,'column':_0x12132d,'offset':_0x5890f9};}function pathToArray(_0x2ca8c3){const _0x47ab1a=a111_0x511b0b;if(!_0x2ca8c3)return[];return _0x2ca8c3[_0x47ab1a(0x175)]('.')['flatMap'](_0x1a3700=>{const _0x35f1bb=_0x1a3700['match'](/^(\w+)\[(\d+)\]$/);if(_0x35f1bb)return[_0x35f1bb[0x1],parseInt(_0x35f1bb[0x2],0xa)];return[_0x1a3700];});}export function validateRuleDef(_0x49cfce,_0x438a79,_0x16209c){const _0x413f7b=a111_0x511b0b,_0x32165e=[];if(!_0x49cfce)return _0x32165e;_0x49cfce[_0x413f7b(0x13c)]!==_0x413f7b(0x171)&&_0x49cfce['type']!=='Or'&&_0x32165e[_0x413f7b(0x12b)]({'level':_0x413f7b(0x14b),'path':_0x438a79+'.type','code':_0x413f7b(0x147),'message':_0x413f7b(0x19d)+_0x49cfce[_0x413f7b(0x13c)]+'\x27','location':getLocationFromPath(_0x16209c[_0x413f7b(0x17d)],_0x16209c['source'],pathToArray(_0x438a79+'.type'))});if(!_0x49cfce[_0x413f7b(0x134)]||!Array[_0x413f7b(0x10e)](_0x49cfce['conditions']))return _0x32165e[_0x413f7b(0x12b)]({'level':_0x413f7b(0x14b),'path':_0x438a79+_0x413f7b(0x124),'code':_0x413f7b(0x165),'message':'Rule\x20must\x20have\x20a\x20conditions\x20array','location':getLocationFromPath(_0x16209c[_0x413f7b(0x17d)],_0x16209c[_0x413f7b(0x152)],pathToArray(_0x438a79))}),_0x32165e;for(let _0x291717=0x0;_0x291717<_0x49cfce[_0x413f7b(0x134)][_0x413f7b(0x168)];_0x291717++){const _0xfe0226=_0x49cfce[_0x413f7b(0x134)][_0x291717],_0x3c0fd2=_0x438a79+_0x413f7b(0xfc)+_0x291717+']';_0x32165e[_0x413f7b(0x12b)](...validateCondition(_0xfe0226,_0x3c0fd2,_0x16209c));}return _0x32165e;}function validateCondition(_0x4aa141,_0x46d4d2,_0x336994){const _0x2758ee=a111_0x511b0b,_0x5df3e0=[];if(!_0x4aa141||typeof _0x4aa141!=='object')return _0x5df3e0;if(_0x4aa141[_0x2758ee(0x13c)]===_0x2758ee(0x171)||_0x4aa141['type']==='Or'){if(!_0x4aa141[_0x2758ee(0x134)]||!Array[_0x2758ee(0x10e)](_0x4aa141[_0x2758ee(0x134)]))_0x5df3e0['push']({'level':'error','path':_0x46d4d2+_0x2758ee(0x124),'code':_0x2758ee(0x165),'message':_0x4aa141['type']+_0x2758ee(0x146),'location':getLocationFromPath(_0x336994[_0x2758ee(0x17d)],_0x336994[_0x2758ee(0x152)],pathToArray(_0x46d4d2))});else for(let _0x3ec568=0x0;_0x3ec568<_0x4aa141[_0x2758ee(0x134)][_0x2758ee(0x168)];_0x3ec568++){_0x5df3e0['push'](...validateCondition(_0x4aa141['conditions'][_0x3ec568],_0x46d4d2+_0x2758ee(0xfc)+_0x3ec568+']',_0x336994));}return _0x5df3e0;}if(_0x4aa141[_0x2758ee(0x13c)]===_0x2758ee(0x125)||_0x4aa141[_0x2758ee(0x13c)]===_0x2758ee(0x10c))return!_0x4aa141[_0x2758ee(0x173)]&&_0x5df3e0['push']({'level':'error','path':_0x46d4d2+'.segment','code':'MISSING_SEGMENT_REFERENCE','message':_0x4aa141[_0x2758ee(0x13c)]+_0x2758ee(0x15c),'location':getLocationFromPath(_0x336994[_0x2758ee(0x17d)],_0x336994[_0x2758ee(0x152)],pathToArray(_0x46d4d2))}),_0x5df3e0;if(_0x4aa141[_0x2758ee(0x13c)]===_0x2758ee(0x19e)||_0x4aa141[_0x2758ee(0x13c)]===_0x2758ee(0x1ad)){const _0x30aadf=_0x4aa141,_0x3ea4aa=_0x30aadf[_0x2758ee(0x152)],_0x3b4481=_0x30aadf[_0x2758ee(0x120)],_0x4813d6=_0x3ea4aa||_0x3b4481;(!_0x30aadf['attribute']||_0x30aadf[_0x2758ee(0x15a)]==='')&&!_0x4813d6&&_0x5df3e0[_0x2758ee(0x12b)]({'level':'error','path':_0x46d4d2+_0x2758ee(0x161),'code':_0x2758ee(0x178),'message':_0x2758ee(0x119),'location':getLocationFromPath(_0x336994[_0x2758ee(0x17d)],_0x336994['source'],pathToArray(_0x46d4d2+_0x2758ee(0x161)))}),_0x30aadf[_0x2758ee(0x114)]&&_0x5df3e0[_0x2758ee(0x12b)](...validateOperator(_0x30aadf[_0x2758ee(0x114)],_0x46d4d2+_0x2758ee(0x16d),_0x336994)),_0x30aadf[_0x2758ee(0x18b)]!==undefined&&_0x5df3e0[_0x2758ee(0x12b)](...validateArrayMatching(_0x30aadf[_0x2758ee(0x18b)],_0x46d4d2+_0x2758ee(0x157),_0x336994)),_0x30aadf[_0x2758ee(0xfd)]&&_0x5df3e0['push'](...validateRuleDef(_0x30aadf['filter'],_0x46d4d2+_0x2758ee(0x16a),_0x336994));}return _0x5df3e0;}function validateOperator(_0xbfeaf7,_0x4cd91f,_0x496f9e){const _0x3994fb=a111_0x511b0b,_0x2d1268=[];if(!VALID_OPERATOR_TYPES[_0x3994fb(0x17c)](_0xbfeaf7[_0x3994fb(0x13c)]))return _0x2d1268[_0x3994fb(0x12b)]({'level':'error','path':_0x4cd91f+_0x3994fb(0x18c),'code':_0x3994fb(0x11a),'message':_0x3994fb(0x163)+_0xbfeaf7[_0x3994fb(0x13c)]+_0x3994fb(0x191)+[...VALID_OPERATOR_TYPES][_0x3994fb(0x1b2)](',\x20'),'location':getLocationFromPath(_0x496f9e['document'],_0x496f9e['source'],pathToArray(_0x4cd91f+_0x3994fb(0x18c)))}),_0x2d1268;return OPERATORS_REQUIRING_VALUE['has'](_0xbfeaf7['type'])&&((_0xbfeaf7[_0x3994fb(0x160)]===undefined||_0xbfeaf7[_0x3994fb(0x160)]===null)&&_0x2d1268[_0x3994fb(0x12b)]({'level':'error','path':_0x4cd91f+_0x3994fb(0x190),'code':_0x3994fb(0x12d),'message':'Operator\x20\x27'+_0xbfeaf7[_0x3994fb(0x13c)]+_0x3994fb(0x127),'location':getLocationFromPath(_0x496f9e['document'],_0x496f9e[_0x3994fb(0x152)],pathToArray(_0x4cd91f))})),_0xbfeaf7[_0x3994fb(0x13c)]===_0x3994fb(0x172)&&(_0xbfeaf7[_0x3994fb(0x16e)]===undefined&&_0xbfeaf7[_0x3994fb(0x12a)]===undefined&&_0x2d1268[_0x3994fb(0x12b)]({'level':'error','path':_0x4cd91f,'code':'MISSING_BETWEEN_BOUNDS','message':_0x3994fb(0x13e),'location':getLocationFromPath(_0x496f9e[_0x3994fb(0x17d)],_0x496f9e[_0x3994fb(0x152)],pathToArray(_0x4cd91f))})),OPERATORS_REQUIRING_UNIT[_0x3994fb(0x17c)](_0xbfeaf7[_0x3994fb(0x13c)])&&(!_0xbfeaf7[_0x3994fb(0x18a)]&&_0xbfeaf7['value']!==undefined&&_0x2d1268[_0x3994fb(0x12b)]({'level':_0x3994fb(0x14b),'path':_0x4cd91f+'.unit','code':_0x3994fb(0xff),'message':_0x3994fb(0x122)+_0xbfeaf7[_0x3994fb(0x13c)]+_0x3994fb(0x188),'location':getLocationFromPath(_0x496f9e[_0x3994fb(0x17d)],_0x496f9e[_0x3994fb(0x152)],pathToArray(_0x4cd91f))})),_0x2d1268;}function validateArrayMatching(_0xbf8707,_0x5d0be1,_0x259d0e){const _0x5d7d38=a111_0x511b0b,_0x3aff9a=[];if(_0xbf8707===_0x5d7d38(0x1b1)||_0xbf8707===_0x5d7d38(0x1a5))return _0x3aff9a;if(typeof _0xbf8707===_0x5d7d38(0x121)){const _0xd0477c=Object[_0x5d7d38(0x106)](_0xbf8707),_0x39abbd=[_0x5d7d38(0x14f),_0x5d7d38(0x170),_0x5d7d38(0xf8)],_0x3e9048=_0xd0477c[_0x5d7d38(0x14c)](_0x11e591=>_0x39abbd[_0x5d7d38(0x11b)](_0x11e591));!_0x3e9048&&_0x3aff9a[_0x5d7d38(0x12b)]({'level':_0x5d7d38(0x14b),'path':_0x5d0be1,'code':'INVALID_ARRAY_MATCHING','message':_0x5d7d38(0x1b0)+_0x39abbd[_0x5d7d38(0x1b2)]('/')+'.','location':getLocationFromPath(_0x259d0e['document'],_0x259d0e['source'],pathToArray(_0x5d0be1))});}else _0x3aff9a['push']({'level':_0x5d7d38(0x14b),'path':_0x5d0be1,'code':_0x5d7d38(0xfa),'message':_0x5d7d38(0x156),'location':getLocationFromPath(_0x259d0e[_0x5d7d38(0x17d)],_0x259d0e[_0x5d7d38(0x152)],pathToArray(_0x5d0be1))});return _0x3aff9a;}export function validateSegmentDef(_0x1322c8,_0xac6058={}){const _0x3dee3b=a111_0x511b0b,_0x3af0b6=[],_0x462566=[];(!_0x1322c8[_0x3dee3b(0x126)]||_0x1322c8[_0x3dee3b(0x126)][_0x3dee3b(0x181)]()==='')&&_0x3af0b6[_0x3dee3b(0x12b)]({'level':'error','path':'name','code':'MISSING_NAME','message':_0x3dee3b(0x131),'location':getLocationFromPath(_0xac6058['document'],_0xac6058[_0x3dee3b(0x152)],[_0x3dee3b(0x126)])});if(_0x1322c8[_0x3dee3b(0x19b)]){const _0x2a4ebd=validateRuleDef(_0x1322c8[_0x3dee3b(0x19b)],_0x3dee3b(0x19b),_0xac6058);for(const _0x616c3e of _0x2a4ebd){_0x616c3e[_0x3dee3b(0x11c)]===_0x3dee3b(0x14b)?_0x3af0b6[_0x3dee3b(0x12b)](_0x616c3e):_0x462566[_0x3dee3b(0x12b)](_0x616c3e);}}return{'valid':_0x3af0b6['length']===0x0,'errors':_0x3af0b6,'warnings':_0x462566};}function a111_0x59df(){const _0x527c58=['jump','\x20condition\x20must\x20have\x20a\x20conditions\x20array','INVALID_RULE_TYPE','INVALID_JUMP_TARGET','code','activation','error','some','ab_test','yellow','atLeast','.entry_criteria','target','source','MISSING_WAIT_PARAMS','segments.','Less','Invalid\x20arrayMatching\x20value.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20atLeast/atMost/exactly.','.arrayMatching','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','versions','attribute','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','\x20condition\x20must\x20have\x20a\x20segment\x20reference','INVALID_AB_TEST_PERCENTAGES','.with.condition.timeout.next','MISSING_STAGES','value','.attribute','83384kXhIOH','Invalid\x20operator\x20type\x20\x27','].next','MISSING_CONDITIONS','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','length','dim','.filter','exit_criteria','goal','.operator','min','NotEqual','atMost','And','Between','segment','7YwBrgZ','split','stages','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','EMPTY_ATTRIBUTE','.with.target','.steps[','cyan','has','document','.exit_criteria[','.with.condition.segment','add','trim','UNUSED_EMBEDDED_SEGMENT','StartWith','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','warnings','milestone','.name','\x27\x20requires\x20a\x20time\x20unit','range','unit','arrayMatching','.type','excluded_','path','journeys','.value','\x27.\x20Valid\x20types:\x20','.milestone','getIn','red','MISSING_SEGMENT_REFERENCE','\x27\x20(first\x20defined\x20at\x20steps[','EndWith','flatMap','steps','.with','rule','72gtJmYr','Rule\x20type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','Value','ref:','stage','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','.with.branches','TimeWithinNext','4gUWJAs','all','Equal','Greater','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','DUPLICATE_STEP_NAME','596706TZcqts','wait','stages[','Behavior','stepNames','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','Invalid\x20arrayMatching.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20','any','join','645957nsOfxO','40TZXtBB','exactly','variants','INVALID_ARRAY_MATCHING','reduce','.conditions[','filter','repeat','MISSING_TIME_UNIT','pop','128514eolDJS','.with.branches[','LessEqual','.with.activation','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','keys','location','NotIn','condition','toString','Jump\x20step\x20requires\x20a\x20target','exclude','.with.condition.next','isArray','entry_criteria','.with.variants','end','errors','418302ENBiVO','operator','MISSING_ACTIVATION_REF','segments','.segment','set','Attribute\x20name\x20cannot\x20be\x20empty','INVALID_OPERATOR_TYPE','includes','level','.with.variants[','TimeWithinPast','Activation\x20step\x20requires\x20an\x20activation\x20reference','aggregation','object','Operator\x20\x27','Step\x20references\x20non-existent\x20step\x20\x27','.conditions','include','name','\x27\x20requires\x20a\x20value','percentage','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','max','push','next','MISSING_OPERATOR_VALUE','Criteria\x20references\x20undefined\x20segment\x20\x27','INVALID_NEXT_REFERENCE','.next','Segment\x20name\x20is\x20required','with','branches','conditions','103435unGlqe','startsWith','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','referencedSegments','embeddedSegments','message','321735WACMNa','type','timeout','Between\x20operator\x20requires\x20\x27min\x27\x20and/or\x20\x27max\x27\x20values','Contain','MISSING_NAME','IsNull','column','entries','contents'];a111_0x59df=function(){return _0x527c58;};return a111_0x59df();}export function validateJourneyDef(_0x520316,_0x55435b={}){const _0x32326c=a111_0x511b0b,_0x4cc383=[],_0x2e0f25=[];(!_0x520316[_0x32326c(0x126)]||_0x520316[_0x32326c(0x126)][_0x32326c(0x181)]()==='')&&_0x4cc383[_0x32326c(0x12b)]({'level':'error','path':_0x32326c(0x126),'code':_0x32326c(0x140),'message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x55435b[_0x32326c(0x17d)],_0x55435b[_0x32326c(0x152)],['name'])});const _0x350c58=new Set();if(_0x520316[_0x32326c(0x116)])for(const _0x4b7c00 of Object['keys'](_0x520316[_0x32326c(0x116)])){_0x350c58[_0x32326c(0x180)](_0x4b7c00);}const _0x357465=new Set(),_0x514065={..._0x55435b,'embeddedSegments':_0x350c58,'referencedSegments':_0x357465};if(_0x520316[_0x32326c(0x116)])for(const [_0x5e2b33,_0xbcb8e5]of Object[_0x32326c(0x143)](_0x520316['segments'])){const _0x2b52fc=validateEmbeddedSegment(_0xbcb8e5,_0x32326c(0x154)+_0x5e2b33,_0x514065);for(const _0x4d763c of _0x2b52fc){if(_0x4d763c[_0x32326c(0x11c)]===_0x32326c(0x14b))_0x4cc383[_0x32326c(0x12b)](_0x4d763c);else _0x2e0f25['push'](_0x4d763c);}}const _0x3668ed=getJourneyStages(_0x520316);_0x3668ed[_0x32326c(0x168)]===0x0&&_0x4cc383[_0x32326c(0x12b)]({'level':'error','path':_0x32326c(0x176),'code':_0x32326c(0x15f),'message':_0x32326c(0x137),'location':getLocationFromPath(_0x55435b[_0x32326c(0x17d)],_0x55435b[_0x32326c(0x152)],[_0x32326c(0x176)])});const _0x13079b=new Set();for(const _0x29a93b of _0x3668ed){if(_0x29a93b[_0x32326c(0x199)])for(const _0x26cdb4 of _0x29a93b[_0x32326c(0x199)]){_0x26cdb4[_0x32326c(0x126)]&&_0x13079b[_0x32326c(0x180)](_0x26cdb4[_0x32326c(0x126)]);}}_0x514065[_0x32326c(0x1ae)]=_0x13079b;for(let _0x6175a8=0x0;_0x6175a8<_0x3668ed[_0x32326c(0x168)];_0x6175a8++){const _0x38347d=_0x3668ed[_0x6175a8],_0x322cc1=_0x32326c(0x1ac)+_0x6175a8+']',_0x5e4ada=validateStage(_0x38347d,_0x322cc1,_0x514065);for(const _0x4947be of _0x5e4ada){if(_0x4947be[_0x32326c(0x11c)]==='error')_0x4cc383[_0x32326c(0x12b)](_0x4947be);else _0x2e0f25['push'](_0x4947be);}}if(_0x520316['goal']){const _0x5a50d6=validateCriteria(_0x520316[_0x32326c(0x16c)],_0x32326c(0x16c),_0x514065);for(const _0x7da30a of _0x5a50d6){if(_0x7da30a[_0x32326c(0x11c)]===_0x32326c(0x14b))_0x4cc383[_0x32326c(0x12b)](_0x7da30a);else _0x2e0f25[_0x32326c(0x12b)](_0x7da30a);}}for(const _0x61d1d0 of _0x350c58){!_0x357465[_0x32326c(0x17c)](_0x61d1d0)&&!_0x61d1d0[_0x32326c(0x136)](_0x32326c(0x18d))&&_0x2e0f25[_0x32326c(0x12b)]({'level':'warning','path':_0x32326c(0x154)+_0x61d1d0,'code':_0x32326c(0x182),'message':'Embedded\x20segment\x20\x27'+_0x61d1d0+_0x32326c(0x15b),'location':getLocationFromPath(_0x55435b[_0x32326c(0x17d)],_0x55435b[_0x32326c(0x152)],['segments',_0x61d1d0])});}return{'valid':_0x4cc383[_0x32326c(0x168)]===0x0,'errors':_0x4cc383,'warnings':_0x2e0f25};}function getJourneyStages(_0x13e897){const _0x4548c3=a111_0x511b0b;if(_0x13e897[_0x4548c3(0x176)]&&_0x13e897[_0x4548c3(0x176)][_0x4548c3(0x168)]>0x0)return _0x13e897[_0x4548c3(0x176)];if(_0x13e897['journeys']&&_0x13e897[_0x4548c3(0x18f)]['length']>0x0)return _0x13e897[_0x4548c3(0x18f)][_0x4548c3(0x198)](_0x285d64=>_0x285d64[_0x4548c3(0x176)]||[]);if(_0x13e897['versions']&&_0x13e897[_0x4548c3(0x159)]['length']>0x0)return _0x13e897['versions'][_0x4548c3(0x198)](_0x2a7af2=>_0x2a7af2[_0x4548c3(0x176)]||[]);return[];}function validateEmbeddedSegment(_0x1862d4,_0x2ee58a,_0x2a4c62){const _0x5be667=a111_0x511b0b,_0x5696fd=[];return _0x1862d4[_0x5be667(0x19b)]&&_0x5696fd[_0x5be667(0x12b)](...validateRuleDef(_0x1862d4[_0x5be667(0x19b)],_0x2ee58a+'.rule',_0x2a4c62)),_0x5696fd;}function validateStage(_0x57855b,_0x57ccb6,_0x3e2447){const _0x3aa97e=a111_0x511b0b,_0x173cd7=[],_0x582a94=new Map();if(_0x57855b['steps'])for(let _0x2875c7=0x0;_0x2875c7<_0x57855b['steps'][_0x3aa97e(0x168)];_0x2875c7++){const _0x4fdc5e=_0x57855b[_0x3aa97e(0x199)][_0x2875c7],_0x570a17=_0x57ccb6+_0x3aa97e(0x17a)+_0x2875c7+']';if(_0x4fdc5e[_0x3aa97e(0x126)]){if(_0x582a94[_0x3aa97e(0x17c)](_0x4fdc5e[_0x3aa97e(0x126)])){const _0x58d962=_0x582a94['get'](_0x4fdc5e[_0x3aa97e(0x126)]);_0x173cd7[_0x3aa97e(0x12b)]({'level':_0x3aa97e(0x14b),'path':_0x570a17+'.name','code':_0x3aa97e(0x1a9),'message':'Duplicate\x20step\x20name\x20\x27'+_0x4fdc5e[_0x3aa97e(0x126)]+_0x3aa97e(0x196)+_0x58d962+'])','location':getLocationFromPath(_0x3e2447[_0x3aa97e(0x17d)],_0x3e2447[_0x3aa97e(0x152)],pathToArray(_0x570a17+_0x3aa97e(0x187)))});}else _0x582a94[_0x3aa97e(0x118)](_0x4fdc5e[_0x3aa97e(0x126)],_0x2875c7);}_0x173cd7[_0x3aa97e(0x12b)](...validateStep(_0x4fdc5e,_0x570a17,_0x3e2447));}_0x57855b['entry_criteria']&&_0x173cd7[_0x3aa97e(0x12b)](...validateCriteria(_0x57855b[_0x3aa97e(0x10f)],_0x57ccb6+_0x3aa97e(0x150),_0x3e2447));if(_0x57855b['exit_criteria'])for(let _0x1f4d5f=0x0;_0x1f4d5f<_0x57855b[_0x3aa97e(0x16b)][_0x3aa97e(0x168)];_0x1f4d5f++){_0x173cd7[_0x3aa97e(0x12b)](...validateCriteria(_0x57855b[_0x3aa97e(0x16b)][_0x1f4d5f],_0x57ccb6+_0x3aa97e(0x17e)+_0x1f4d5f+']',_0x3e2447));}return _0x57855b[_0x3aa97e(0x186)]&&_0x173cd7[_0x3aa97e(0x12b)](...validateCriteria(_0x57855b['milestone'],_0x57ccb6+_0x3aa97e(0x192),_0x3e2447)),_0x173cd7;}function validateStep(_0x55b4bc,_0x517bfe,_0x229c5c){const _0x285781=a111_0x511b0b,_0x21ab52=[];_0x55b4bc[_0x285781(0x12c)]&&_0x55b4bc[_0x285781(0x13c)]!==_0x285781(0x111)&&(_0x229c5c[_0x285781(0x1ae)]&&!_0x229c5c[_0x285781(0x1ae)]['has'](_0x55b4bc[_0x285781(0x12c)])&&_0x21ab52[_0x285781(0x12b)]({'level':_0x285781(0x14b),'path':_0x517bfe+_0x285781(0x130),'code':_0x285781(0x12f),'message':_0x285781(0x123)+_0x55b4bc[_0x285781(0x12c)]+'\x27','location':getLocationFromPath(_0x229c5c[_0x285781(0x17d)],_0x229c5c[_0x285781(0x152)],pathToArray(_0x517bfe+_0x285781(0x130)))}));switch(_0x55b4bc[_0x285781(0x13c)]){case _0x285781(0x1ab):_0x21ab52[_0x285781(0x12b)](...validateWaitStep(_0x55b4bc,_0x517bfe,_0x229c5c));break;case _0x285781(0x14a):_0x21ab52[_0x285781(0x12b)](...validateActivationStep(_0x55b4bc,_0x517bfe,_0x229c5c));break;case'decision_point':_0x21ab52[_0x285781(0x12b)](...validateDecisionPointStep(_0x55b4bc,_0x517bfe,_0x229c5c));break;case _0x285781(0x14d):_0x21ab52[_0x285781(0x12b)](...validateAbTestStep(_0x55b4bc,_0x517bfe,_0x229c5c));break;case _0x285781(0x145):_0x21ab52[_0x285781(0x12b)](...validateJumpStep(_0x55b4bc,_0x517bfe,_0x229c5c));break;}return _0x21ab52;}function a111_0x4000(_0x40aa63,_0x4e9d7b){_0x40aa63=_0x40aa63-0xf7;const _0x59df07=a111_0x59df();let _0x4000a7=_0x59df07[_0x40aa63];return _0x4000a7;}function validateWaitStep(_0xb01960,_0x5310a7,_0x599488){const _0x49d4ce=a111_0x511b0b,_0x39c050=[];if(!_0xb01960[_0x49d4ce(0x132)])return _0x39c050[_0x49d4ce(0x12b)]({'level':'error','path':_0x5310a7+_0x49d4ce(0x19a),'code':_0x49d4ce(0x153),'message':_0x49d4ce(0x1a1),'location':getLocationFromPath(_0x599488[_0x49d4ce(0x17d)],_0x599488['source'],pathToArray(_0x5310a7))}),_0x39c050;if(_0xb01960[_0x49d4ce(0x132)][_0x49d4ce(0x109)]){const _0x3e1ae1=_0xb01960[_0x49d4ce(0x132)][_0x49d4ce(0x109)];_0x3e1ae1['segment']&&(_0x599488[_0x49d4ce(0x138)]?.[_0x49d4ce(0x180)](_0x3e1ae1[_0x49d4ce(0x173)]),!_0x3e1ae1[_0x49d4ce(0x173)][_0x49d4ce(0x136)](_0x49d4ce(0x19f))&&(_0x599488['embeddedSegments']&&!_0x599488[_0x49d4ce(0x139)][_0x49d4ce(0x17c)](_0x3e1ae1[_0x49d4ce(0x173)])&&_0x39c050[_0x49d4ce(0x12b)]({'level':'error','path':_0x5310a7+_0x49d4ce(0x17f),'code':'MISSING_SEGMENT_REFERENCE','message':_0x49d4ce(0x1af)+_0x3e1ae1['segment']+_0x49d4ce(0x158),'location':getLocationFromPath(_0x599488[_0x49d4ce(0x17d)],_0x599488['source'],pathToArray(_0x5310a7+_0x49d4ce(0x17f)))})),_0x3e1ae1[_0x49d4ce(0x12c)]&&_0x599488[_0x49d4ce(0x1ae)]&&!_0x599488[_0x49d4ce(0x1ae)]['has'](_0x3e1ae1['next'])&&_0x39c050[_0x49d4ce(0x12b)]({'level':_0x49d4ce(0x14b),'path':_0x5310a7+_0x49d4ce(0x10d),'code':'INVALID_NEXT_REFERENCE','message':_0x49d4ce(0x105)+_0x3e1ae1[_0x49d4ce(0x12c)]+'\x27','location':getLocationFromPath(_0x599488[_0x49d4ce(0x17d)],_0x599488[_0x49d4ce(0x152)],pathToArray(_0x5310a7+_0x49d4ce(0x10d)))}),_0x3e1ae1['timeout']?.['next']&&_0x599488['stepNames']&&!_0x599488[_0x49d4ce(0x1ae)]['has'](_0x3e1ae1[_0x49d4ce(0x13d)]['next'])&&_0x39c050[_0x49d4ce(0x12b)]({'level':_0x49d4ce(0x14b),'path':_0x5310a7+_0x49d4ce(0x15e),'code':_0x49d4ce(0x12f),'message':_0x49d4ce(0x177)+_0x3e1ae1['timeout'][_0x49d4ce(0x12c)]+'\x27','location':getLocationFromPath(_0x599488[_0x49d4ce(0x17d)],_0x599488[_0x49d4ce(0x152)],pathToArray(_0x5310a7+_0x49d4ce(0x15e)))}));}return _0x39c050;}function validateActivationStep(_0x38c264,_0x5e7d9d,_0x193ec6){const _0x577362=a111_0x511b0b,_0x3a16ce=[];return!_0x38c264[_0x577362(0x132)]?.[_0x577362(0x14a)]&&_0x3a16ce[_0x577362(0x12b)]({'level':_0x577362(0x14b),'path':_0x5e7d9d+_0x577362(0x104),'code':_0x577362(0x115),'message':_0x577362(0x11f),'location':getLocationFromPath(_0x193ec6[_0x577362(0x17d)],_0x193ec6['source'],pathToArray(_0x5e7d9d))}),_0x3a16ce;}function validateDecisionPointStep(_0x14eb21,_0x26c6b0,_0x4127f6){const _0x124ca3=a111_0x511b0b,_0x1ad7b0=[];if(!_0x14eb21[_0x124ca3(0x132)]?.['branches']||_0x14eb21[_0x124ca3(0x132)]['branches'][_0x124ca3(0x168)]===0x0)return _0x1ad7b0[_0x124ca3(0x12b)]({'level':_0x124ca3(0x14b),'path':_0x26c6b0+_0x124ca3(0x1a2),'code':'MISSING_CONDITIONS','message':_0x124ca3(0x1a8),'location':getLocationFromPath(_0x4127f6['document'],_0x4127f6[_0x124ca3(0x152)],pathToArray(_0x26c6b0))}),_0x1ad7b0;for(let _0x20ee85=0x0;_0x20ee85<_0x14eb21[_0x124ca3(0x132)][_0x124ca3(0x133)]['length'];_0x20ee85++){const _0x2724c3=_0x14eb21[_0x124ca3(0x132)][_0x124ca3(0x133)][_0x20ee85],_0x164303=_0x26c6b0+_0x124ca3(0x102)+_0x20ee85+']';_0x2724c3[_0x124ca3(0x173)]&&!_0x2724c3['excluded']&&(_0x4127f6[_0x124ca3(0x138)]?.[_0x124ca3(0x180)](_0x2724c3['segment']),!_0x2724c3[_0x124ca3(0x173)]['startsWith'](_0x124ca3(0x19f))&&(_0x4127f6[_0x124ca3(0x139)]&&!_0x4127f6[_0x124ca3(0x139)][_0x124ca3(0x17c)](_0x2724c3[_0x124ca3(0x173)])&&_0x1ad7b0[_0x124ca3(0x12b)]({'level':_0x124ca3(0x14b),'path':_0x164303+_0x124ca3(0x117),'code':_0x124ca3(0x195),'message':_0x124ca3(0x167)+_0x2724c3[_0x124ca3(0x173)]+'\x27','location':getLocationFromPath(_0x4127f6[_0x124ca3(0x17d)],_0x4127f6[_0x124ca3(0x152)],pathToArray(_0x164303+'.segment'))}))),_0x2724c3[_0x124ca3(0x12c)]&&_0x4127f6[_0x124ca3(0x1ae)]&&!_0x4127f6[_0x124ca3(0x1ae)][_0x124ca3(0x17c)](_0x2724c3['next'])&&_0x1ad7b0[_0x124ca3(0x12b)]({'level':'error','path':_0x164303+_0x124ca3(0x130),'code':_0x124ca3(0x12f),'message':_0x124ca3(0x166)+_0x2724c3[_0x124ca3(0x12c)]+'\x27','location':getLocationFromPath(_0x4127f6[_0x124ca3(0x17d)],_0x4127f6[_0x124ca3(0x152)],pathToArray(_0x164303+'.next'))});}return _0x1ad7b0;}function validateAbTestStep(_0x21a22a,_0x1bbff4,_0x1673cc){const _0x441725=a111_0x511b0b,_0x3cef8d=[];if(!_0x21a22a[_0x441725(0x132)]?.[_0x441725(0xf9)]||_0x21a22a[_0x441725(0x132)][_0x441725(0xf9)][_0x441725(0x168)]===0x0)return _0x3cef8d[_0x441725(0x12b)]({'level':'error','path':_0x1bbff4+'.with.variants','code':'MISSING_CONDITIONS','message':_0x441725(0x129),'location':getLocationFromPath(_0x1673cc[_0x441725(0x17d)],_0x1673cc[_0x441725(0x152)],pathToArray(_0x1bbff4))}),_0x3cef8d;const _0x595725=_0x21a22a[_0x441725(0x132)]['variants'][_0x441725(0xfb)]((_0x3a5713,_0x50c436)=>_0x3a5713+(_0x50c436[_0x441725(0x128)]||0x0),0x0);Math['abs'](_0x595725-0x64)>0.01&&_0x3cef8d[_0x441725(0x12b)]({'level':_0x441725(0x14b),'path':_0x1bbff4+_0x441725(0x110),'code':_0x441725(0x15d),'message':_0x441725(0x184)+_0x595725+'%)','location':getLocationFromPath(_0x1673cc[_0x441725(0x17d)],_0x1673cc[_0x441725(0x152)],pathToArray(_0x1bbff4+_0x441725(0x110)))});for(let _0x4c2c21=0x0;_0x4c2c21<_0x21a22a['with']['variants'][_0x441725(0x168)];_0x4c2c21++){const _0x9c5240=_0x21a22a[_0x441725(0x132)][_0x441725(0xf9)][_0x4c2c21];_0x9c5240[_0x441725(0x12c)]&&_0x1673cc[_0x441725(0x1ae)]&&!_0x1673cc[_0x441725(0x1ae)][_0x441725(0x17c)](_0x9c5240['next'])&&_0x3cef8d[_0x441725(0x12b)]({'level':_0x441725(0x14b),'path':_0x1bbff4+_0x441725(0x11d)+_0x4c2c21+_0x441725(0x164),'code':_0x441725(0x12f),'message':'A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27'+_0x9c5240[_0x441725(0x12c)]+'\x27','location':getLocationFromPath(_0x1673cc[_0x441725(0x17d)],_0x1673cc[_0x441725(0x152)],pathToArray(_0x1bbff4+_0x441725(0x11d)+_0x4c2c21+_0x441725(0x164)))});}return _0x3cef8d;}function validateJumpStep(_0x5b1ffb,_0x2dcf77,_0x31b54a){const _0x6b9f60=a111_0x511b0b,_0x46e738=[];if(!_0x5b1ffb[_0x6b9f60(0x132)]?.[_0x6b9f60(0x151)])return _0x46e738[_0x6b9f60(0x12b)]({'level':_0x6b9f60(0x14b),'path':_0x2dcf77+_0x6b9f60(0x179),'code':_0x6b9f60(0x148),'message':_0x6b9f60(0x10b),'location':getLocationFromPath(_0x31b54a['document'],_0x31b54a[_0x6b9f60(0x152)],pathToArray(_0x2dcf77))}),_0x46e738;return(!_0x5b1ffb[_0x6b9f60(0x132)][_0x6b9f60(0x151)]['journey']||!_0x5b1ffb[_0x6b9f60(0x132)][_0x6b9f60(0x151)][_0x6b9f60(0x1a0)])&&_0x46e738[_0x6b9f60(0x12b)]({'level':_0x6b9f60(0x14b),'path':_0x2dcf77+_0x6b9f60(0x179),'code':'INVALID_JUMP_TARGET','message':'Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','location':getLocationFromPath(_0x31b54a[_0x6b9f60(0x17d)],_0x31b54a[_0x6b9f60(0x152)],pathToArray(_0x2dcf77+'.with.target'))}),_0x46e738;}function validateCriteria(_0x171f71,_0x7beca9,_0x11396c){const _0x25c7c0=a111_0x511b0b,_0x47a008=[];return _0x171f71[_0x25c7c0(0x173)]&&(_0x11396c['referencedSegments']?.[_0x25c7c0(0x180)](_0x171f71[_0x25c7c0(0x173)]),!_0x171f71[_0x25c7c0(0x173)][_0x25c7c0(0x136)](_0x25c7c0(0x19f))&&(_0x11396c[_0x25c7c0(0x139)]&&!_0x11396c[_0x25c7c0(0x139)][_0x25c7c0(0x17c)](_0x171f71[_0x25c7c0(0x173)])&&_0x47a008[_0x25c7c0(0x12b)]({'level':_0x25c7c0(0x14b),'path':_0x7beca9+_0x25c7c0(0x117),'code':_0x25c7c0(0x195),'message':_0x25c7c0(0x12e)+_0x171f71[_0x25c7c0(0x173)]+'\x27','location':getLocationFromPath(_0x11396c[_0x25c7c0(0x17d)],_0x11396c[_0x25c7c0(0x152)],pathToArray(_0x7beca9+_0x25c7c0(0x117)))}))),_0x47a008;}export function formatIssueWithContext(_0x3ef10f,_0x3b9c2d,_0x384f16){const _0x5f4fee=a111_0x511b0b,_0x190a54=[],_0x1dfd16=_0x3ef10f['level']===_0x5f4fee(0x14b),_0x2eaae5=_0x1dfd16?a111_0x31e602[_0x5f4fee(0x194)]:a111_0x31e602[_0x5f4fee(0x14e)],_0x40dca5=_0x1dfd16?a111_0x31e602[_0x5f4fee(0x194)]:a111_0x31e602[_0x5f4fee(0x14e)],_0x1fd91d=_0x384f16?a111_0x31e602[_0x5f4fee(0x17b)](_0x384f16+':'):'';if(_0x3ef10f['location']){const _0x3562bc=a111_0x31e602[_0x5f4fee(0x17b)](_0x3ef10f[_0x5f4fee(0x107)]['line']+':'+_0x3ef10f[_0x5f4fee(0x107)][_0x5f4fee(0x142)]);_0x190a54[_0x5f4fee(0x12b)](''+_0x1fd91d+_0x3562bc+':\x20'+_0x2eaae5(_0x3ef10f[_0x5f4fee(0x11c)])+'\x20'+_0x40dca5('['+_0x3ef10f[_0x5f4fee(0x149)]+']'));}else _0x190a54[_0x5f4fee(0x12b)](''+_0x1fd91d+a111_0x31e602[_0x5f4fee(0x169)](_0x3ef10f[_0x5f4fee(0x18e)])+':\x20'+_0x2eaae5(_0x3ef10f['level'])+'\x20'+_0x40dca5('['+_0x3ef10f[_0x5f4fee(0x149)]+']'));_0x190a54['push'](_0x3ef10f[_0x5f4fee(0x13a)]);if(_0x3ef10f[_0x5f4fee(0x107)]&&_0x3b9c2d){const _0x36a643=_0x3b9c2d[_0x5f4fee(0x175)]('\x0a'),{line:_0x2aa8ce,column:_0x52a7d6}=_0x3ef10f[_0x5f4fee(0x107)],_0x55ef74=Math[_0x5f4fee(0x12a)](0x1,_0x2aa8ce-0x1),_0x190647=Math[_0x5f4fee(0x16e)](_0x36a643['length'],_0x2aa8ce+0x1);_0x190a54[_0x5f4fee(0x12b)]('');for(let _0x51b51d=_0x55ef74;_0x51b51d<=_0x190647;_0x51b51d++){const _0x423db5=_0x36a643[_0x51b51d-0x1]||'',_0x4e65dd=a111_0x31e602[_0x5f4fee(0x169)](_0x51b51d[_0x5f4fee(0x10a)]()['padStart'](0x4)),_0x1ef7cf=a111_0x31e602[_0x5f4fee(0x169)]('\x20|\x20');if(_0x51b51d===_0x2aa8ce){_0x190a54[_0x5f4fee(0x12b)]('\x20\x20'+_0x4e65dd+_0x1ef7cf+_0x2eaae5(_0x423db5));const _0x59dd0e='\x20'[_0x5f4fee(0xfe)](0x4+0x3+_0x52a7d6-0x1);_0x190a54[_0x5f4fee(0x12b)]('\x20\x20'+_0x59dd0e+_0x2eaae5('^'));}else _0x190a54[_0x5f4fee(0x12b)]('\x20\x20'+_0x4e65dd+_0x1ef7cf+a111_0x31e602[_0x5f4fee(0x169)](_0x423db5));}}return _0x190a54[_0x5f4fee(0x1b2)]('\x0a');}export function formatValidationResult(_0xd4ef0c,_0x4be8bd,_0x7d7cda){const _0x19f383=a111_0x511b0b,_0x5d7e91=[];for(const _0x29dc09 of _0xd4ef0c[_0x19f383(0x112)]){_0x5d7e91[_0x19f383(0x12b)](formatIssueWithContext(_0x29dc09,_0x4be8bd,_0x7d7cda)),_0x5d7e91[_0x19f383(0x12b)]('');}for(const _0x33950d of _0xd4ef0c[_0x19f383(0x185)]){_0x5d7e91['push'](formatIssueWithContext(_0x33950d,_0x4be8bd,_0x7d7cda)),_0x5d7e91[_0x19f383(0x12b)]('');}return _0x5d7e91[_0x19f383(0x1b2)]('\x0a');}
|
package/dist/sdk/segment.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a112_0x2dc0(){const _0x48eede=['push','deleteActivation','Validating\x20master\x20table:\x20','matched_count','getFolder','trinoClient','44278yownBF','updateParent','\x20in\x20parent\x20','attribute','sampleData','listFolders','updateSegmentById','user','versionNumber','343260fkcjta','3028RaXMNS','journey','16NjWgIr','resolveParentIdOrName','getSegment','detectResourceTypeInFolder','deleteSegment','table','getParent','273rtCmoN','traversePath','schemaError','catch','getActivation','master','error','updatedAt','Calculating\x20statistics\x20for:\x20','message','enriched','getParentSQL','listActivations','254954IJphFI','previewParentYaml','Enriched\x20query:\x20','test','Segment\x20\x27','pullSegments','createParent','parentFolderId','11uPrPkL','\x27\x20not\x20found\x20in\x20','matchedCount','state','Resource\x20\x27','buildTreeFromEntities','schema','getParentSegmentSQL','createJourneySegment','logger','rowCount','segment','1370ILiitm','\x27\x20not\x20found','journeyBundleId','name','Path\x20cannot\x20be\x20empty','createdAt','Attribute\x20\x27','listFields','resolveSegmentId','26477tlpzrp','customers_with_events','folder-segment','segment-realtime','Validating\x20all\x20attributes\x20in\x20parallel...','find','\x27:\x20','parentFolder','Folder\x20not\x20found:\x20','connection','row_count','getEntityParentFolderId','behaviors','Validating\x20behavior:\x20','createSegment','total_events','folder','map','has','schemaValid','ambiguous','attributes','customerPercent','getParentSegmentFull','join','listParents','buildTreeNodesForFolder','entity','filter','source','onProgress','segment-batch','entityToSegment','resolveFolderId','Fetching\x20sample\x20data\x20for:\x20','getParentSegment','parent_key','277578ZBrpWI','Fetching\x20master\x20sample\x20data...','INVALID_ARGUMENT','detectResourceType','length','Fetching\x20enriched\x20master\x20data...','parentColumn','\x27\x20not\x20found\x20in\x20path','Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)','segmentFolderId','entityToFolder','parentDatabaseName','listSegments','string','resolveParentId','isAbsolute','groupingName','SEGMENT_NOT_FOUND','Behavior\x20\x27','Validating\x20all\x20behaviors\x20in\x20parallel...','validateParentYaml','interval','listUnifiedWithJourneys','data','listParentSegments','then','behavior','client','listEntitiesByFolder','child_key','createSegmentFolder','customersWithEvents','Validating\x20attribute:\x20','description','getParentFull','database','relationships','rootFolderId','type','some','Validating\x20all\x20attributes\x20and\x20behaviors\x20in\x20parallel...','getSegmentFolder','allValid','population','all','parentTableName','906735zwMtTh','getAudienceAttributes','getTdxInstance','getAudienceBehaviors'];a112_0x2dc0=function(){return _0x48eede;};return a112_0x2dc0();}function a112_0x44bd(_0x132c6d,_0x57cdf9){_0x132c6d=_0x132c6d-0x160;const _0x2dc0fc=a112_0x2dc0();let _0x44bdac=_0x2dc0fc[_0x132c6d];return _0x44bdac;}const a112_0x5ac344=a112_0x44bd;(function(_0x2e6375,_0x2f1b06){const _0xee7c95=a112_0x44bd,_0x41d01f=_0x2e6375();while(!![]){try{const _0x2bee88=parseInt(_0xee7c95(0x196))/0x1*(parseInt(_0xee7c95(0x16e))/0x2)+-parseInt(_0xee7c95(0x181))/0x3*(-parseInt(_0xee7c95(0x178))/0x4)+parseInt(_0xee7c95(0x164))/0x5+-parseInt(_0xee7c95(0x177))/0x6+-parseInt(_0xee7c95(0x18e))/0x7*(-parseInt(_0xee7c95(0x17a))/0x8)+-parseInt(_0xee7c95(0x1d0))/0x9+parseInt(_0xee7c95(0x1a2))/0xa*(-parseInt(_0xee7c95(0x1ab))/0xb);if(_0x2bee88===_0x2f1b06)break;else _0x41d01f['push'](_0x41d01f['shift']());}catch(_0x557ea0){_0x41d01f['push'](_0x41d01f['shift']());}}}(a112_0x2dc0,0x2453c));import{CDPApiClient}from'./client/cdp-api-client.js';import{TrinoApiClient}from'./client/trino-api-client.js';import{SDKError,ErrorCode}from'./errors.js';import{deduplicateJourneysByBundle,entityToJourneyListItem,parseJourneyState}from'./journey.js';import{parsePath}from'./segment/segment-path-parser.js';import{pullSegments as a112_0x25c501}from'./segment/pull-workflow.js';import{apiToDef,defToApi,serializeDef,parseDef}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{[a112_0x5ac344(0x1eb)];[a112_0x5ac344(0x16d)];constructor(_0x5623f4){const _0x519a15=a112_0x5ac344;this[_0x519a15(0x1eb)]=new CDPApiClient(_0x5623f4,_0x5623f4[_0x519a15(0x19f)]),this[_0x519a15(0x16d)]=new TrinoApiClient(_0x5623f4,_0x5623f4[_0x519a15(0x19f)]);}async['listParents'](){const _0x55a7a4=a112_0x5ac344;return await this['client'][_0x55a7a4(0x1e8)]();}async[a112_0x5ac344(0x180)](_0x468de7){const _0x186c2f=a112_0x5ac344;return await this[_0x186c2f(0x1eb)][_0x186c2f(0x1ce)](_0x468de7);}async[a112_0x5ac344(0x1dc)](_0x40048d){const _0x596371=a112_0x5ac344;return await this['client'][_0x596371(0x1dc)](_0x40048d);}async[a112_0x5ac344(0x17c)](_0x327663,_0x3c1b42){const _0x1b7e49=a112_0x5ac344;return await this[_0x1b7e49(0x1eb)]['getSegment'](_0x327663,_0x3c1b42);}async['listFolders'](_0x262fdd){const _0x148acf=a112_0x5ac344;return await this[_0x148acf(0x1eb)]['listSegmentFolders'](_0x262fdd);}async[a112_0x5ac344(0x16c)](_0xde7029){const _0x5cdc17=a112_0x5ac344;return await this[_0x5cdc17(0x1eb)][_0x5cdc17(0x1f9)](_0xde7029);}async[a112_0x5ac344(0x18d)](_0x37c2cc,_0xffe899){const _0x43929d=a112_0x5ac344;return await this[_0x43929d(0x1eb)][_0x43929d(0x18d)](_0x37c2cc,_0xffe899);}async[a112_0x5ac344(0x185)](_0x49c315,_0x2c3d6d,_0x487cd7){const _0x30ccf9=a112_0x5ac344;return await this[_0x30ccf9(0x1eb)][_0x30ccf9(0x185)](_0x49c315,_0x2c3d6d,_0x487cd7);}async['createActivation'](_0x48db5b,_0x5bb006,_0xb6a1b9){return await this['client']['createActivation'](_0x48db5b,_0x5bb006,_0xb6a1b9);}async['updateActivation'](_0x13398f,_0x7dfd38,_0x2b5883,_0x10ba01){const _0xb4bdac=a112_0x5ac344;return await this[_0xb4bdac(0x1eb)]['updateActivation'](_0x13398f,_0x7dfd38,_0x2b5883,_0x10ba01);}async[a112_0x5ac344(0x169)](_0x2c6b14,_0x126fef,_0x307389){const _0x5ffc96=a112_0x5ac344;return await this[_0x5ffc96(0x1eb)][_0x5ffc96(0x169)](_0x2c6b14,_0x126fef,_0x307389);}async[a112_0x5ac344(0x18c)](_0x115c33){const _0x176396=a112_0x5ac344;return await this[_0x176396(0x1eb)][_0x176396(0x19d)](_0x115c33);}async['getSegmentSQL'](_0x41e027,_0x30079c){const _0x33549e=a112_0x5ac344;return await this[_0x33549e(0x1eb)]['getSegmentSQL'](_0x41e027,_0x30079c);}async[a112_0x5ac344(0x1de)](_0x1e5121){const _0x292dff=a112_0x5ac344,_0x259bef=await this[_0x292dff(0x1c4)](),_0x25cc89=_0x259bef[_0x292dff(0x1b0)](_0x2b2b4a=>_0x2b2b4a['attributes'][_0x292dff(0x1a5)]===_0x1e5121);if(!_0x25cc89)throw new SDKError(ErrorCode[_0x292dff(0x1e1)],'Parent\x20segment\x20not\x20found:\x20'+_0x1e5121);return _0x25cc89['id'];}async['runParent'](_0x3fd86d){const _0x3c4c26=a112_0x5ac344;let _0x3566f3=_0x3fd86d;return!/^\d+$/[_0x3c4c26(0x191)](_0x3fd86d)&&(_0x3566f3=await this[_0x3c4c26(0x1de)](_0x3fd86d)),await this[_0x3c4c26(0x1eb)]['runParentSegment'](_0x3566f3);}async[a112_0x5ac344(0x1aa)](_0xd9a6a4,_0x1d26c3){const _0xa01d69=a112_0x5ac344,_0x5444db=await this[_0xa01d69(0x1dc)](_0xd9a6a4),_0x2f5e48=_0x5444db['find'](_0x1159e7=>_0x1159e7[_0xa01d69(0x1a5)]===_0x1d26c3);if(!_0x2f5e48)throw new SDKError(ErrorCode[_0xa01d69(0x1e1)],'Child\x20segment\x20not\x20found:\x20'+_0x1d26c3+'\x20in\x20parent\x20'+_0xd9a6a4);return _0x2f5e48['id'];}async[a112_0x5ac344(0x1cc)](_0x4e2529,_0x1918f8){const _0x38030a=a112_0x5ac344,_0x4965cd=await this[_0x38030a(0x173)](_0x4e2529),_0x12b4a0=_0x4965cd['find'](_0x40b726=>_0x40b726['name']===_0x1918f8);if(!_0x12b4a0)throw new SDKError(ErrorCode[_0x38030a(0x1e1)],_0x38030a(0x1b3)+_0x1918f8+_0x38030a(0x170)+_0x4e2529);return _0x12b4a0['id'];}async[a112_0x5ac344(0x1a9)](_0x1c9e27){const _0x2f0a0c=a112_0x5ac344,_0x20dbfe=await this['resolveParentIdOrName'](_0x1c9e27),[_0x4adc87,_0x57b84f]=await Promise['all']([this[_0x2f0a0c(0x1eb)][_0x2f0a0c(0x165)](_0x20dbfe),this[_0x2f0a0c(0x1eb)][_0x2f0a0c(0x167)](_0x20dbfe)]),_0x4c4df7=[];for(const _0x10a447 of _0x4adc87){_0x4c4df7[_0x2f0a0c(0x168)]({'name':_0x10a447['name'],'type':_0x10a447[_0x2f0a0c(0x1f6)],'source':_0x2f0a0c(0x171),'parentDatabaseName':_0x10a447[_0x2f0a0c(0x1db)],'parentTableName':_0x10a447[_0x2f0a0c(0x163)],'parentColumn':_0x10a447[_0x2f0a0c(0x1d6)],'groupingName':_0x10a447[_0x2f0a0c(0x1e0)]??undefined});}for(const _0x36c975 of _0x57b84f){const _0x5ddc1b=_0x36c975[_0x2f0a0c(0x1a5)];if(_0x36c975[_0x2f0a0c(0x19c)]&&Array['isArray'](_0x36c975[_0x2f0a0c(0x19c)]))for(const _0x336a1a of _0x36c975[_0x2f0a0c(0x19c)]){_0x336a1a['name']&&_0x336a1a[_0x2f0a0c(0x1f6)]&&_0x4c4df7[_0x2f0a0c(0x168)]({'name':_0x5ddc1b+'.'+_0x336a1a['name'],'type':_0x336a1a[_0x2f0a0c(0x1f6)],'source':_0x2f0a0c(0x1ea),'behaviorName':_0x5ddc1b,'parentDatabaseName':_0x36c975['parentDatabaseName'],'parentTableName':_0x36c975['parentTableName'],'parentColumn':_0x336a1a[_0x2f0a0c(0x1d6)]});}}return _0x4c4df7;}async[a112_0x5ac344(0x194)](_0x403997){const _0x16cf70=a112_0x5ac344;return await this[_0x16cf70(0x1eb)]['createParentSegment'](_0x403997);}async[a112_0x5ac344(0x16f)](_0x4f4669,_0x3c1ac9){const _0x1616df=a112_0x5ac344,_0x543d8e=await this[_0x1616df(0x17b)](_0x4f4669);return await this[_0x1616df(0x1eb)]['updateParentSegment'](_0x543d8e,_0x3c1ac9);}async['getParentFull'](_0x761492){const _0x2ff24b=a112_0x5ac344,_0x4c011c=await this[_0x2ff24b(0x17b)](_0x761492);return await this['client'][_0x2ff24b(0x1c2)](_0x4c011c);}async['pullParentYaml'](_0x396f5c){const _0x1f7949=a112_0x5ac344,_0x3c06ac=await this[_0x1f7949(0x1f2)](_0x396f5c),_0x4c6bb8=apiToDef(_0x3c06ac);return serializeDef(_0x4c6bb8);}async['pushParentYaml'](_0x4fd638){const _0x14dc2c=a112_0x5ac344,_0x2cd4f9=typeof _0x4fd638==='string'?parseDef(_0x4fd638):_0x4fd638,_0x1cdc5f=defToApi(_0x2cd4f9);let _0x2fda90=null,_0x55ad1a='';try{_0x2fda90=await this[_0x14dc2c(0x1f2)](_0x2cd4f9[_0x14dc2c(0x1a5)]);const _0x511b05=apiToDef(_0x2fda90);_0x55ad1a=serializeDef(_0x511b05);}catch{}const _0x2b0735=serializeDef(_0x2cd4f9),_0x11c04d=generateDiff(_0x55ad1a,_0x2b0735),_0x5ea570=formatDiffWithColors(_0x11c04d),_0x4d3e53=_0x2fda90===null,_0x1573fc=hasChanges(_0x11c04d),_0x41c749={'isNew':_0x4d3e53,'id':_0x2fda90?.['id']||'','name':_0x2cd4f9[_0x14dc2c(0x1a5)],'diff':_0x11c04d,'diffFormatted':_0x5ea570,'hasChanges':_0x1573fc},_0x4a9d73=async()=>{const _0x1ddcf8=_0x14dc2c;return _0x4d3e53?await this[_0x1ddcf8(0x194)](_0x1cdc5f):await this[_0x1ddcf8(0x16f)](_0x2fda90['id'],_0x1cdc5f);};return{..._0x41c749,'apply':_0x4a9d73};}async[a112_0x5ac344(0x1e4)](_0x67de36,_0x5cd52d={}){const _0x565a7e=a112_0x5ac344,_0x3f2745=typeof _0x67de36==='string'?parseDef(_0x67de36):_0x67de36,_0x2587ba=[];let _0x59dce7=!![];const _0x44d50f=_0x411284=>_0x5cd52d[_0x565a7e(0x1c9)]?.(_0x411284),_0x158a92={'name':_0x3f2745['name'],'master':{'database':_0x3f2745[_0x565a7e(0x186)][_0x565a7e(0x1f3)],'table':_0x3f2745[_0x565a7e(0x186)]['table'],'schemaValid':![]},'attributes':[],'behaviors':[],'errors':_0x2587ba,'allValid':!![]},_0x1b6392=async _0x154dd3=>{const _0x1de8a9=_0x565a7e;try{const _0x161397=await this[_0x1de8a9(0x16d)]['executeQuery'](_0x154dd3);return{'data':_0x161397[_0x1de8a9(0x1e7)]};}catch(_0x3718a6){const _0x5c296f=_0x3718a6 instanceof Error?_0x3718a6[_0x1de8a9(0x18a)]:String(_0x3718a6);return{'data':[],'error':_0x5c296f};}};_0x44d50f(_0x565a7e(0x16a)+_0x3f2745['master'][_0x565a7e(0x1f3)]+'.'+_0x3f2745[_0x565a7e(0x186)][_0x565a7e(0x17f)]);const _0x2692da=generateSchemaValidationSQL(_0x3f2745[_0x565a7e(0x186)]['database'],_0x3f2745[_0x565a7e(0x186)][_0x565a7e(0x17f)]),_0x9ea661=await _0x1b6392(_0x2692da);if(_0x9ea661[_0x565a7e(0x187)])_0x158a92['master'][_0x565a7e(0x1be)]=![],_0x158a92['master'][_0x565a7e(0x183)]=_0x9ea661[_0x565a7e(0x187)],_0x2587ba[_0x565a7e(0x168)]('Master\x20table:\x20'+_0x9ea661[_0x565a7e(0x187)]),_0x59dce7=![];else{_0x158a92[_0x565a7e(0x186)][_0x565a7e(0x1be)]=!![],_0x44d50f('Counting\x20master\x20table\x20rows...');const _0x407a40=await _0x1b6392(generateMasterCountSQL(_0x3f2745));!_0x407a40['error']&&_0x407a40[_0x565a7e(0x1e7)][_0x565a7e(0x1d4)]>0x0&&(_0x158a92[_0x565a7e(0x186)][_0x565a7e(0x1a0)]=_0x407a40['data'][0x0][_0x565a7e(0x1b5)]);}if(_0x5cd52d[_0x565a7e(0x186)])return _0x158a92[_0x565a7e(0x160)]=_0x59dce7,_0x158a92;const _0x4a0147=async _0x1fe355=>{const _0x2419e1=_0x565a7e,_0x5840c1={'name':_0x1fe355[_0x2419e1(0x1a5)],'database':_0x1fe355['source'][_0x2419e1(0x1f3)],'table':_0x1fe355[_0x2419e1(0x1c8)][_0x2419e1(0x17f)],'joinKey':_0x1fe355[_0x2419e1(0x1c3)][_0x2419e1(0x1ed)],'foreignKey':_0x1fe355[_0x2419e1(0x1c3)]['parent_key'],'columns':getAttributeColumns(_0x1fe355),'schemaValid':![]};_0x44d50f(_0x2419e1(0x1f0)+_0x1fe355['name']);const _0x51b9ae=await _0x1b6392(generateAttributeSchemaSQL(_0x3f2745,_0x1fe355));if(_0x51b9ae[_0x2419e1(0x187)])_0x5840c1[_0x2419e1(0x183)]=_0x51b9ae[_0x2419e1(0x187)];else{_0x5840c1['schemaValid']=!![],_0x44d50f('Calculating\x20coverage\x20for:\x20'+_0x1fe355['name']);const _0xdfd384=await _0x1b6392(generateAttributeCoverageSQL(_0x3f2745,_0x1fe355));!_0xdfd384['error']&&_0xdfd384[_0x2419e1(0x1e7)][_0x2419e1(0x1d4)]>0x0&&(_0x5840c1[_0x2419e1(0x198)]=_0xdfd384['data'][0x0][_0x2419e1(0x16b)],_0x158a92[_0x2419e1(0x186)]['rowCount']&&_0x158a92['master'][_0x2419e1(0x1a0)]>0x0&&(_0x5840c1['coveragePercent']=_0x5840c1['matchedCount']/_0x158a92[_0x2419e1(0x186)][_0x2419e1(0x1a0)]*0x64));}return _0x5840c1;},_0x40380b=async(_0x2ed202,_0x47fe92)=>{const _0x16acfa=_0x565a7e,_0x29b696={'name':_0x2ed202[_0x16acfa(0x1a5)],'database':_0x2ed202[_0x16acfa(0x1c8)][_0x16acfa(0x1f3)],'table':_0x2ed202['source'][_0x16acfa(0x17f)],'joinKey':_0x2ed202[_0x16acfa(0x1c3)][_0x16acfa(0x1ed)],'foreignKey':_0x2ed202[_0x16acfa(0x1c3)][_0x16acfa(0x1cf)],'columns':getBehaviorColumns(_0x2ed202),'schemaValid':![]};_0x44d50f(_0x16acfa(0x1b8)+_0x2ed202['name']);const _0x1d74a2=await _0x1b6392(generateBehaviorSchemaSQL(_0x3f2745,_0x2ed202));if(_0x1d74a2[_0x16acfa(0x187)])_0x29b696[_0x16acfa(0x183)]=_0x1d74a2[_0x16acfa(0x187)];else{_0x29b696[_0x16acfa(0x1be)]=!![],_0x44d50f(_0x16acfa(0x189)+_0x2ed202[_0x16acfa(0x1a5)]+'\x20('+_0x47fe92+')');const _0x5c8581=await _0x1b6392(generateBehaviorStatsSQL(_0x3f2745,_0x2ed202,_0x47fe92));!_0x5c8581[_0x16acfa(0x187)]&&_0x5c8581[_0x16acfa(0x1e7)][_0x16acfa(0x1d4)]>0x0&&(_0x29b696[_0x16acfa(0x1ef)]=_0x5c8581[_0x16acfa(0x1e7)][0x0][_0x16acfa(0x1ac)],_0x29b696['totalEvents']=_0x5c8581['data'][0x0][_0x16acfa(0x1ba)],_0x158a92[_0x16acfa(0x186)]['rowCount']&&_0x158a92[_0x16acfa(0x186)][_0x16acfa(0x1a0)]>0x0&&(_0x29b696[_0x16acfa(0x1c1)]=_0x29b696[_0x16acfa(0x1ef)]/_0x158a92[_0x16acfa(0x186)][_0x16acfa(0x1a0)]*0x64));}return _0x29b696;},_0x2f59c4=(_0xe6e42e,_0x1c2c12)=>{const _0x340c60=_0x565a7e;_0x158a92[_0x340c60(0x1c0)]=_0xe6e42e,_0x158a92['behaviors']=_0x1c2c12;for(const _0x5b120c of _0xe6e42e){!_0x5b120c[_0x340c60(0x1be)]&&(_0x2587ba['push']('Attribute\x20\x27'+_0x5b120c[_0x340c60(0x1a5)]+_0x340c60(0x1b1)+_0x5b120c['schemaError']),_0x59dce7=![]);}for(const _0x50e722 of _0x1c2c12){!_0x50e722['schemaValid']&&(_0x2587ba[_0x340c60(0x168)](_0x340c60(0x1e2)+_0x50e722[_0x340c60(0x1a5)]+_0x340c60(0x1b1)+_0x50e722[_0x340c60(0x183)]),_0x59dce7=![]);}},_0x3530aa=_0x5cd52d[_0x565a7e(0x1e5)]||DEFAULT_TIME_RANGE;if(typeof _0x5cd52d['attribute']==='string'){const _0x3d83de=findAttributeByName(_0x3f2745,_0x5cd52d['attribute']);if(!_0x3d83de)throw new SDKError(ErrorCode[_0x565a7e(0x1e1)],_0x565a7e(0x1a8)+_0x5cd52d[_0x565a7e(0x171)]+'\x27\x20not\x20found');const _0x5d72ca=await _0x4a0147(_0x3d83de);return _0x2f59c4([_0x5d72ca],[]),_0x158a92[_0x565a7e(0x160)]=_0x59dce7,_0x158a92;}if(_0x5cd52d[_0x565a7e(0x171)]===!![]){_0x44d50f(_0x565a7e(0x1af));const _0x32362f=await Promise[_0x565a7e(0x162)]((_0x3f2745['attributes']||[])['map'](_0x3283c9=>_0x4a0147(_0x3283c9)));return _0x2f59c4(_0x32362f,[]),_0x158a92[_0x565a7e(0x160)]=_0x59dce7,_0x158a92;}if(typeof _0x5cd52d['behavior']===_0x565a7e(0x1dd)){const _0x1f9312=findBehaviorByName(_0x3f2745,_0x5cd52d[_0x565a7e(0x1ea)]);if(!_0x1f9312)throw new SDKError(ErrorCode[_0x565a7e(0x1e1)],_0x565a7e(0x1e2)+_0x5cd52d[_0x565a7e(0x1ea)]+_0x565a7e(0x1a3));const _0x417d9a=await _0x40380b(_0x1f9312,_0x3530aa);return _0x2f59c4([],[_0x417d9a]),_0x158a92[_0x565a7e(0x160)]=_0x59dce7,_0x158a92;}if(_0x5cd52d[_0x565a7e(0x1ea)]===!![]){_0x44d50f(_0x565a7e(0x1e3));const _0x4dad55=await Promise[_0x565a7e(0x162)]((_0x3f2745[_0x565a7e(0x1b7)]||[])[_0x565a7e(0x1bc)](_0x3fc352=>_0x40380b(_0x3fc352,_0x3530aa)));return _0x2f59c4([],_0x4dad55),_0x158a92['allValid']=_0x59dce7,_0x158a92;}if(_0x5cd52d[_0x565a7e(0x18b)]){_0x44d50f(_0x565a7e(0x1af));const _0x2bb5c6=await Promise[_0x565a7e(0x162)]((_0x3f2745['attributes']||[])[_0x565a7e(0x1bc)](_0x472c29=>_0x4a0147(_0x472c29)));return _0x2f59c4(_0x2bb5c6,[]),_0x158a92[_0x565a7e(0x160)]=_0x59dce7,_0x158a92;}_0x44d50f(_0x565a7e(0x1f8));const [_0xb68c90,_0x168585]=await Promise[_0x565a7e(0x162)]([Promise['all']((_0x3f2745[_0x565a7e(0x1c0)]||[])[_0x565a7e(0x1bc)](_0x388c92=>_0x4a0147(_0x388c92))),Promise[_0x565a7e(0x162)]((_0x3f2745['behaviors']||[])[_0x565a7e(0x1bc)](_0x4243a9=>_0x40380b(_0x4243a9,_0x3530aa)))]);return _0x2f59c4(_0xb68c90,_0x168585),_0x158a92[_0x565a7e(0x160)]=_0x59dce7,_0x158a92;}async[a112_0x5ac344(0x18f)](_0x2636bd,_0x1e1268={}){const _0x1139bb=a112_0x5ac344,_0x273783=typeof _0x2636bd==='string'?parseDef(_0x2636bd):_0x2636bd,_0x400674=[];let _0x1d0090=!![];const _0x58adab=_0x483daf=>_0x1e1268['onProgress']?.(_0x483daf),_0x57caaf={'name':_0x273783[_0x1139bb(0x1a5)],'master':{'database':_0x273783[_0x1139bb(0x186)]['database'],'table':_0x273783['master']['table'],'schemaValid':!![]},'attributes':[],'behaviors':[],'errors':_0x400674,'allValid':!![]},_0x5225e7=async _0x4f0c01=>{const _0xeb6dba=_0x1139bb;try{const _0x3b4188=await this[_0xeb6dba(0x16d)]['executeQuery'](_0x4f0c01);return{'data':_0x3b4188[_0xeb6dba(0x1e7)]};}catch(_0x5c6249){const _0x539e86=_0x5c6249 instanceof Error?_0x5c6249[_0xeb6dba(0x18a)]:String(_0x5c6249);return{'data':[],'error':_0x539e86};}};if(_0x1e1268[_0x1139bb(0x186)]){_0x58adab(_0x1139bb(0x1d1));const _0x38d8e3=generateMasterSampleSQL(_0x273783,DEFAULT_SAMPLE_LIMIT),_0x2520f6=await _0x5225e7(_0x38d8e3);return!_0x2520f6[_0x1139bb(0x187)]?_0x57caaf[_0x1139bb(0x172)]=_0x2520f6['data']:(_0x400674['push']('Master\x20table:\x20'+_0x2520f6[_0x1139bb(0x187)]),_0x1d0090=![]),_0x57caaf['allValid']=_0x1d0090,_0x57caaf;}if(_0x1e1268[_0x1139bb(0x171)]){const _0x27b500=findAttributeByName(_0x273783,_0x1e1268[_0x1139bb(0x171)]);if(!_0x27b500)throw new SDKError(ErrorCode[_0x1139bb(0x1e1)],_0x1139bb(0x1a8)+_0x1e1268[_0x1139bb(0x171)]+_0x1139bb(0x1a3));_0x58adab(_0x1139bb(0x1cd)+_0x27b500[_0x1139bb(0x1a5)]);const _0x2a457d=generateAttributeSampleSQL(_0x273783,_0x27b500,DEFAULT_SAMPLE_LIMIT),_0x39454c=await _0x5225e7(_0x2a457d);return!_0x39454c[_0x1139bb(0x187)]?_0x57caaf['sampleData']=_0x39454c['data']:(_0x400674[_0x1139bb(0x168)]('Attribute\x20\x27'+_0x27b500[_0x1139bb(0x1a5)]+'\x27:\x20'+_0x39454c[_0x1139bb(0x187)]),_0x1d0090=![]),_0x57caaf['allValid']=_0x1d0090,_0x57caaf;}if(_0x1e1268[_0x1139bb(0x1ea)]){const _0x11c6fc=findBehaviorByName(_0x273783,_0x1e1268[_0x1139bb(0x1ea)]);if(!_0x11c6fc)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1139bb(0x1e2)+_0x1e1268[_0x1139bb(0x1ea)]+_0x1139bb(0x1a3));const _0x3408d=_0x1e1268[_0x1139bb(0x1e5)]||DEFAULT_TIME_RANGE;_0x58adab(_0x1139bb(0x1cd)+_0x11c6fc[_0x1139bb(0x1a5)]+'\x20('+_0x3408d+')');const _0x1614fa=generateBehaviorSampleSQL(_0x273783,_0x11c6fc,DEFAULT_SAMPLE_LIMIT,_0x3408d),_0x366eca=await _0x5225e7(_0x1614fa);return!_0x366eca[_0x1139bb(0x187)]?_0x57caaf['sampleData']=_0x366eca[_0x1139bb(0x1e7)]:(_0x400674[_0x1139bb(0x168)](_0x1139bb(0x1e2)+_0x11c6fc[_0x1139bb(0x1a5)]+_0x1139bb(0x1b1)+_0x366eca[_0x1139bb(0x187)]),_0x1d0090=![]),_0x57caaf[_0x1139bb(0x160)]=_0x1d0090,_0x57caaf;}if(_0x1e1268[_0x1139bb(0x18b)]){_0x58adab(_0x1139bb(0x1d5));const _0x209346=generateEnrichedSQL(_0x273783,DEFAULT_SAMPLE_LIMIT),_0x63701c=await _0x5225e7(_0x209346);return!_0x63701c[_0x1139bb(0x187)]?_0x57caaf[_0x1139bb(0x172)]=_0x63701c[_0x1139bb(0x1e7)]:(_0x400674[_0x1139bb(0x168)](_0x1139bb(0x190)+_0x63701c['error']),_0x1d0090=![]),_0x57caaf[_0x1139bb(0x160)]=_0x1d0090,_0x57caaf;}return _0x57caaf['allValid']=_0x1d0090,_0x57caaf;}async[a112_0x5ac344(0x1b9)](_0x34a224,_0x202b8d){const _0x2aad9c=a112_0x5ac344;return await this[_0x2aad9c(0x1eb)]['createSegment'](_0x34a224,_0x202b8d);}async['createJourneySegment'](_0x16978b){const _0x13245f=a112_0x5ac344;return await this[_0x13245f(0x1eb)][_0x13245f(0x19e)](_0x16978b);}async[a112_0x5ac344(0x174)](_0x2fedab,_0x136316,_0x111f8c){return await this['client']['updateSegment'](_0x2fedab,_0x136316,_0x111f8c);}async[a112_0x5ac344(0x17e)](_0x207187){const _0x2a74c4=a112_0x5ac344;return await this[_0x2a74c4(0x1eb)]['deleteSegment'](_0x207187);}async['createFolder'](_0xae88b1,_0x743d00){const _0x5c56c0=a112_0x5ac344,_0xd1982d=await this['resolveParentIdOrName'](_0xae88b1);return await this[_0x5c56c0(0x1eb)][_0x5c56c0(0x1ee)](_0xd1982d,_0x743d00);}async[a112_0x5ac344(0x17b)](_0x491665){const _0x498c9=a112_0x5ac344;if(/^\d+$/['test'](_0x491665))return _0x491665;return await this[_0x498c9(0x1de)](_0x491665);}async[a112_0x5ac344(0x1d3)](_0x423013,_0x531ee5){const _0x3ab8ca=a112_0x5ac344,[_0x4eb09e,_0x94641]=await Promise[_0x3ab8ca(0x162)]([this[_0x3ab8ca(0x1cc)](_0x423013,_0x531ee5)[_0x3ab8ca(0x1e9)](()=>!![])[_0x3ab8ca(0x184)](()=>![]),this[_0x3ab8ca(0x1aa)](_0x423013,_0x531ee5)[_0x3ab8ca(0x1e9)](()=>!![])[_0x3ab8ca(0x184)](()=>![])]);if(_0x4eb09e&&_0x94641)return _0x3ab8ca(0x1bf);else{if(_0x4eb09e)return _0x3ab8ca(0x1bb);else{if(_0x94641)return _0x3ab8ca(0x1a1);}}throw new SDKError(ErrorCode[_0x3ab8ca(0x1e1)],_0x3ab8ca(0x19a)+_0x531ee5+'\x27\x20not\x20found\x20in\x20parent\x20segment');}async[a112_0x5ac344(0x17d)](_0xe4a896,_0x560e9a,_0x369f73){const _0x59ef6a=a112_0x5ac344,[_0x53e3ad,_0x21936b]=await Promise[_0x59ef6a(0x162)]([this[_0x59ef6a(0x173)](_0xe4a896),this[_0x59ef6a(0x1dc)](_0xe4a896)]),_0x6dfd45=_0x369f73?_0x53e3ad[_0x59ef6a(0x1c7)](_0x5cbe65=>_0x5cbe65[_0x59ef6a(0x195)]===_0x369f73):_0x53e3ad[_0x59ef6a(0x1c7)](_0x498d4d=>!_0x498d4d['parentFolderId']),_0x341405=_0x369f73?_0x21936b[_0x59ef6a(0x1c7)](_0x55ec25=>_0x55ec25[_0x59ef6a(0x1d9)]===_0x369f73):_0x21936b[_0x59ef6a(0x1c7)](_0x2a9abf=>!_0x2a9abf[_0x59ef6a(0x1d9)]),_0x5608a2=_0x6dfd45[_0x59ef6a(0x1f7)](_0x293718=>_0x293718[_0x59ef6a(0x1a5)]===_0x560e9a),_0x3bb0c1=_0x341405['some'](_0xabb461=>_0xabb461[_0x59ef6a(0x1a5)]===_0x560e9a);if(_0x5608a2&&_0x3bb0c1)return _0x59ef6a(0x1bf);else{if(_0x5608a2)return _0x59ef6a(0x1bb);else{if(_0x3bb0c1)return _0x59ef6a(0x1a1);}}throw new SDKError(ErrorCode[_0x59ef6a(0x1e1)],_0x59ef6a(0x19a)+_0x560e9a+_0x59ef6a(0x197)+(_0x369f73?_0x59ef6a(0x1bb):'parent\x20segment'));}async[a112_0x5ac344(0x182)](_0x289f19){const _0x1c0eae=a112_0x5ac344;if(_0x289f19['length']===0x0)throw new SDKError(ErrorCode[_0x1c0eae(0x1d2)],_0x1c0eae(0x1a6));const _0x43780a=_0x289f19[0x0],_0x336543=await this[_0x1c0eae(0x1de)](_0x43780a);if(_0x289f19[_0x1c0eae(0x1d4)]===0x1)return{'parentId':_0x336543,'parentName':_0x43780a,'type':'parent','fullPath':_0x43780a};const _0x5700bc=await this[_0x1c0eae(0x1f2)](_0x336543),_0x16f382=_0x5700bc[_0x1c0eae(0x1f5)],_0x12e5e1=[];let _0x39b918=_0x16f382;for(let _0x8b043=0x1;_0x8b043<_0x289f19[_0x1c0eae(0x1d4)]-0x1;_0x8b043++){const _0x136248=_0x289f19[_0x8b043],_0x4e0170=await this[_0x1c0eae(0x173)](_0x336543),_0x3f7a06=_0x39b918?_0x4e0170[_0x1c0eae(0x1b0)](_0x4fd8e9=>_0x4fd8e9[_0x1c0eae(0x1a5)]===_0x136248&&_0x4fd8e9[_0x1c0eae(0x195)]===_0x39b918):_0x4e0170[_0x1c0eae(0x1b0)](_0x559444=>_0x559444[_0x1c0eae(0x1a5)]===_0x136248&&!_0x559444[_0x1c0eae(0x195)]);if(!_0x3f7a06)throw new SDKError(ErrorCode[_0x1c0eae(0x1e1)],'Folder\x20\x27'+_0x136248+_0x1c0eae(0x1d7));_0x12e5e1['push'](_0x136248),_0x39b918=_0x3f7a06['id'];}const _0x4db948=_0x289f19[_0x289f19[_0x1c0eae(0x1d4)]-0x1],_0x3c1657=await this[_0x1c0eae(0x17d)](_0x336543,_0x4db948,_0x39b918);if(_0x3c1657===_0x1c0eae(0x1bf)||_0x3c1657===_0x1c0eae(0x1bb)){const _0x19bc03=await this[_0x1c0eae(0x173)](_0x336543),_0x471aca=_0x39b918?_0x19bc03[_0x1c0eae(0x1b0)](_0x5818ba=>_0x5818ba[_0x1c0eae(0x1a5)]===_0x4db948&&_0x5818ba[_0x1c0eae(0x195)]===_0x39b918):_0x19bc03['find'](_0x5561a3=>_0x5561a3[_0x1c0eae(0x1a5)]===_0x4db948&&!_0x5561a3[_0x1c0eae(0x195)]);if(!_0x471aca)throw new SDKError(ErrorCode[_0x1c0eae(0x1e1)],'Folder\x20\x27'+_0x4db948+_0x1c0eae(0x1a3));return _0x12e5e1[_0x1c0eae(0x168)](_0x4db948),{'parentId':_0x336543,'parentName':_0x43780a,'folderId':_0x471aca['id'],'folderPath':_0x12e5e1,'type':'folder','fullPath':_0x289f19[_0x1c0eae(0x1c3)]('/')};}else{const _0x46a051=await this[_0x1c0eae(0x1dc)](_0x336543),_0x19d7b5=_0x39b918?_0x46a051[_0x1c0eae(0x1b0)](_0x5df7e8=>_0x5df7e8[_0x1c0eae(0x1a5)]===_0x4db948&&_0x5df7e8['segmentFolderId']===_0x39b918):_0x46a051[_0x1c0eae(0x1b0)](_0x191f7f=>_0x191f7f[_0x1c0eae(0x1a5)]===_0x4db948&&!_0x191f7f['segmentFolderId']);if(!_0x19d7b5)throw new SDKError(ErrorCode[_0x1c0eae(0x1e1)],_0x1c0eae(0x192)+_0x4db948+_0x1c0eae(0x1a3));return{'parentId':_0x336543,'parentName':_0x43780a,'folderId':_0x39b918,'folderPath':_0x12e5e1[_0x1c0eae(0x1d4)]>0x0?_0x12e5e1:undefined,'segmentId':_0x19d7b5['id'],'segmentName':_0x4db948,'type':_0x1c0eae(0x1a1),'fullPath':_0x289f19[_0x1c0eae(0x1c3)]('/')};}}async['resolvePathToResource'](_0x5ee55e){const _0xe6f038=a112_0x5ac344,_0x2568d6=parsePath(_0x5ee55e);if(!_0x2568d6[_0xe6f038(0x1df)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe6f038(0x1d8));return await this[_0xe6f038(0x182)](_0x2568d6['segments']);}async[a112_0x5ac344(0x1e6)](_0x309255,_0x1031c7){const _0x2ef9cb=a112_0x5ac344;let _0x2b0c6c=_0x1031c7;if(!_0x2b0c6c){const _0x51d3d9=await this[_0x2ef9cb(0x1f2)](_0x309255);_0x2b0c6c=_0x51d3d9[_0x2ef9cb(0x1f5)];}if(!_0x2b0c6c)return{'folders':[],'segments':[],'journeys':[]};const _0x116024=await this['client'][_0x2ef9cb(0x1ec)](_0x2b0c6c,0x1,![]),_0x284877=_0x116024[_0x2ef9cb(0x1e7)],_0x312567=_0x284877[_0x2ef9cb(0x1c7)](_0x283cf2=>{const _0x23cc6e=_0x2ef9cb;if(_0x283cf2['id']===_0x2b0c6c)return![];const _0x4ab70f=this[_0x23cc6e(0x1b6)](_0x283cf2);return _0x4ab70f===_0x2b0c6c||!_0x4ab70f;}),_0x175276=_0x312567[_0x2ef9cb(0x1c7)](_0x2cbf90=>_0x2cbf90[_0x2ef9cb(0x1f6)]===_0x2ef9cb(0x1ad))[_0x2ef9cb(0x1bc)](_0x2f11ba=>this[_0x2ef9cb(0x1da)](_0x2f11ba,_0x309255)),_0x2d1404=_0x312567['filter'](_0x4355cc=>_0x4355cc[_0x2ef9cb(0x1f6)]===_0x2ef9cb(0x1ca)||_0x4355cc[_0x2ef9cb(0x1f6)]===_0x2ef9cb(0x1ae))[_0x2ef9cb(0x1bc)](_0x5e5920=>this[_0x2ef9cb(0x1cb)](_0x5e5920,_0x309255)),_0x383b39=_0x312567[_0x2ef9cb(0x1c7)](_0x44e9da=>_0x44e9da[_0x2ef9cb(0x1f6)]==='journey'),_0x1ce205=_0x383b39[_0x2ef9cb(0x1bc)](_0x290440=>({'journeyBundleId':_0x290440['attributes'][_0x2ef9cb(0x1a4)],'versionNumber':_0x290440[_0x2ef9cb(0x1c0)]['versionNumber'],'id':_0x290440['id'],'entity':_0x290440})),_0x1c1a3f=deduplicateJourneysByBundle(_0x1ce205),_0x338b5f=_0x1c1a3f[_0x2ef9cb(0x1bc)](_0x4f92b3=>entityToJourneyListItem(_0x4f92b3[_0x2ef9cb(0x1c6)],_0x309255));return{'folders':_0x175276,'segments':_0x2d1404,'journeys':_0x338b5f};}[a112_0x5ac344(0x1da)](_0x19d777,_0x56cf12){const _0x26b630=a112_0x5ac344;return{'audienceId':_0x56cf12,'id':_0x19d777['id'],'name':_0x19d777['attributes']['name'],'parentFolderId':_0x19d777[_0x26b630(0x1c0)][_0x26b630(0x195)]??_0x19d777[_0x26b630(0x1f4)]?.[_0x26b630(0x1b2)]?.[_0x26b630(0x1e7)]?.['id']??null,'description':_0x19d777[_0x26b630(0x1c0)][_0x26b630(0x1f1)]??null,'createdAt':_0x19d777[_0x26b630(0x1c0)][_0x26b630(0x1a7)],'updatedAt':_0x19d777[_0x26b630(0x1c0)][_0x26b630(0x188)]};}[a112_0x5ac344(0x1cb)](_0x1eda4f,_0x19d56d){const _0x3e1795=a112_0x5ac344;return{'audienceId':_0x19d56d,'id':_0x1eda4f['id'],'name':_0x1eda4f[_0x3e1795(0x1c0)][_0x3e1795(0x1a5)],'description':_0x1eda4f[_0x3e1795(0x1c0)][_0x3e1795(0x1f1)]??undefined,'realtime':_0x1eda4f['type']===_0x3e1795(0x1ae),'segmentFolderId':_0x1eda4f[_0x3e1795(0x1c0)]['segmentFolderId']??_0x1eda4f[_0x3e1795(0x1f4)]?.[_0x3e1795(0x1b2)]?.['data']?.['id']??undefined,'population':_0x1eda4f[_0x3e1795(0x1c0)][_0x3e1795(0x161)],'createdAt':_0x1eda4f[_0x3e1795(0x1c0)][_0x3e1795(0x1a7)],'updatedAt':_0x1eda4f['attributes'][_0x3e1795(0x188)]};}async['listRecursive'](_0x5d65e6,_0x419fd4,_0x285333,_0x2881b5=0xa){const _0x5500fd=a112_0x5ac344;let _0x256dd0=_0x419fd4;if(!_0x256dd0){const _0x2edb7b=await this['getParentFull'](_0x5d65e6);_0x256dd0=_0x2edb7b[_0x5500fd(0x1f5)];}if(!_0x256dd0)return[];const _0x1274e0=await this['client'][_0x5500fd(0x1ec)](_0x256dd0,_0x2881b5,![]),_0x456445=_0x1274e0[_0x5500fd(0x1e7)];return this[_0x5500fd(0x19b)](_0x456445,_0x256dd0);}[a112_0x5ac344(0x19b)](_0x522dd4,_0x147db1){const _0x55890f=a112_0x5ac344,_0x3d7f22=new Map();for(const _0x450b30 of _0x522dd4){if(_0x450b30[_0x55890f(0x1f6)]===_0x55890f(0x1ad)&&_0x450b30['id']===_0x147db1)continue;const _0xc3514=this[_0x55890f(0x1b6)](_0x450b30)??_0x147db1;!_0x3d7f22[_0x55890f(0x1bd)](_0xc3514)&&_0x3d7f22['set'](_0xc3514,[]),_0x3d7f22['get'](_0xc3514)[_0x55890f(0x168)](_0x450b30);}return this[_0x55890f(0x1c5)](_0x147db1,_0x3d7f22);}[a112_0x5ac344(0x1b6)](_0x11866c){const _0x4a080e=a112_0x5ac344;if(_0x11866c['relationships']?.['parentFolder']?.[_0x4a080e(0x1e7)]?.['id'])return _0x11866c['relationships'][_0x4a080e(0x1b2)][_0x4a080e(0x1e7)]['id'];return _0x11866c[_0x4a080e(0x1c0)]['parentFolderId']??_0x11866c['attributes'][_0x4a080e(0x1d9)]??undefined;}[a112_0x5ac344(0x1c5)](_0x5d713c,_0xb41e74){const _0x13abec=a112_0x5ac344,_0x283ce1=_0xb41e74['get'](_0x5d713c)??[],_0x912714=[],_0x52d947=_0x283ce1[_0x13abec(0x1c7)](_0xda8feb=>_0xda8feb['type']===_0x13abec(0x1ad)),_0x55a2d6=_0x283ce1[_0x13abec(0x1c7)](_0x30162b=>_0x30162b[_0x13abec(0x1f6)]===_0x13abec(0x1ca)||_0x30162b['type']==='segment-realtime'),_0x296c43=_0x283ce1['filter'](_0x502fb0=>_0x502fb0['type']===_0x13abec(0x179)),_0x12040a=_0x296c43[_0x13abec(0x1bc)](_0x13f067=>({'journeyBundleId':_0x13f067[_0x13abec(0x1c0)][_0x13abec(0x1a4)],'versionNumber':_0x13f067[_0x13abec(0x1c0)][_0x13abec(0x176)],'id':_0x13f067['id'],'entity':_0x13f067})),_0x3d8f45=deduplicateJourneysByBundle(_0x12040a);for(const _0x58b2d1 of _0x52d947){const _0x2f84bf=this[_0x13abec(0x1c5)](_0x58b2d1['id'],_0xb41e74);_0x912714['push']({'type':'folder','id':_0x58b2d1['id'],'name':_0x58b2d1[_0x13abec(0x1c0)]['name'],'children':_0x2f84bf[_0x13abec(0x1d4)]>0x0?_0x2f84bf:undefined,'metadata':{'description':_0x58b2d1[_0x13abec(0x1c0)]['description']??undefined,'folderCount':_0x2f84bf[_0x13abec(0x1c7)](_0x4ee915=>_0x4ee915[_0x13abec(0x1f6)]===_0x13abec(0x1bb))[_0x13abec(0x1d4)],'segmentCount':_0x2f84bf['filter'](_0x113a88=>_0x113a88[_0x13abec(0x1f6)]===_0x13abec(0x1a1))['length'],'journeyCount':_0x2f84bf[_0x13abec(0x1c7)](_0x110dc9=>_0x110dc9['type']===_0x13abec(0x179))['length'],'createdAt':_0x58b2d1[_0x13abec(0x1c0)][_0x13abec(0x1a7)],'updatedAt':_0x58b2d1['attributes'][_0x13abec(0x188)]}});}for(const _0x34c616 of _0x55a2d6){_0x912714[_0x13abec(0x168)]({'type':_0x13abec(0x1a1),'id':_0x34c616['id'],'name':_0x34c616[_0x13abec(0x1c0)][_0x13abec(0x1a5)],'population':_0x34c616['attributes'][_0x13abec(0x161)],'metadata':{'description':_0x34c616[_0x13abec(0x1c0)][_0x13abec(0x1f1)]??undefined,'createdAt':_0x34c616[_0x13abec(0x1c0)][_0x13abec(0x1a7)],'updatedAt':_0x34c616[_0x13abec(0x1c0)][_0x13abec(0x188)]}});}for(const _0x5afece of _0x3d8f45){const _0x4d8726=_0x5afece[_0x13abec(0x1c6)];_0x912714['push']({'type':'journey','id':_0x4d8726['id'],'name':_0x4d8726[_0x13abec(0x1c0)]['journeyBundleName']??_0x4d8726['attributes'][_0x13abec(0x1a5)]??'','state':parseJourneyState(_0x4d8726[_0x13abec(0x1c0)][_0x13abec(0x199)]),'metadata':{}});}return _0x912714;}async[a112_0x5ac344(0x193)](_0x208cce,_0x3a8415={}){const _0x7aec7d=a112_0x5ac344,_0x1e822c=this['getTdxInstance'](),_0x46a4da={'segment':_0x1e822c[_0x7aec7d(0x1a1)],'journey':_0x1e822c[_0x7aec7d(0x179)],'user':_0x1e822c[_0x7aec7d(0x175)],'connection':_0x1e822c[_0x7aec7d(0x1b4)]};return a112_0x25c501(_0x46a4da,_0x208cce,_0x3a8415);}[a112_0x5ac344(0x166)](){return this['_tdxInstance'];}}
|
|
1
|
+
const a112_0x52c6ad=a112_0x3636;(function(_0x43a96a,_0x4dd223){const _0x15909c=a112_0x3636,_0x529eb8=_0x43a96a();while(!![]){try{const _0x3a8647=parseInt(_0x15909c(0xa4))/0x1+parseInt(_0x15909c(0x89))/0x2+parseInt(_0x15909c(0xbf))/0x3*(-parseInt(_0x15909c(0x8d))/0x4)+parseInt(_0x15909c(0x85))/0x5*(-parseInt(_0x15909c(0x7c))/0x6)+-parseInt(_0x15909c(0xb3))/0x7*(parseInt(_0x15909c(0xf9))/0x8)+-parseInt(_0x15909c(0xc3))/0x9*(-parseInt(_0x15909c(0xe2))/0xa)+-parseInt(_0x15909c(0xe7))/0xb;if(_0x3a8647===_0x4dd223)break;else _0x529eb8['push'](_0x529eb8['shift']());}catch(_0x241fc9){_0x529eb8['push'](_0x529eb8['shift']());}}}(a112_0x46b6,0x1d228));import{CDPApiClient}from'./client/cdp-api-client.js';import{TrinoApiClient}from'./client/trino-api-client.js';import{SDKError,ErrorCode}from'./errors.js';function a112_0x46b6(){const _0x2b5674=['pushParentYaml','listActivations','Master\x20table:\x20','entityToFolder','customers_with_events','listRecursive','state','name','532091toULOU','trinoClient','then','rootFolderId','runParentSegment','updatedAt','segment','parentColumn','getParentFull','source','updateParent','entity','141jVBBjg','table','onProgress','total_events','171558qtWyUD','\x27\x20not\x20found\x20in\x20parent\x20segment','updateActivation','Fetching\x20master\x20sample\x20data...','Validating\x20all\x20behaviors\x20in\x20parallel...','SEGMENT_NOT_FOUND','journeyBundleId','resolveSegmentId','push','population','entityToSegment','database','type','buildTreeNodesForFolder','totalEvents','parentDatabaseName','listParents','groupingName','relationships','getFolder','sampleData','listParentSegments','getTdxInstance','ambiguous','find','customerPercent','Fetching\x20sample\x20data\x20for:\x20','Validating\x20master\x20table:\x20','createActivation','isArray','createFolder','80Udrqrd','createdAt','createParent','filter','getParent','829334yHIpXv','logger','schemaError','createJourneySegment','allValid','connection','client','pullParentYaml','getParentSegmentSQL','user','resolveParentIdOrName','Path\x20cannot\x20be\x20empty','segments','deleteSegment','resolveFolderId','test','listUnifiedWithJourneys','createParentSegment','8gXTdjn','\x27:\x20','enriched','all','\x20in\x20parent\x20','schema','updateSegmentById','\x27\x20not\x20found','buildTreeFromEntities','executeQuery','createSegment','segmentFolderId','description','getAudienceAttributes','journeyBundleName','folder','parentFolderId','behaviors','runParent','versionNumber','validateParentYaml','pullSegments','map','getEntityParentFolderId','parentFolder','data','Folder\x20not\x20found:\x20','behavior','set','master','\x27\x20not\x20found\x20in\x20path','rowCount','Resource\x20\x27','error','has','string','updateSegment','Folder\x20\x27','getParentSegmentFull','previewParentYaml','join','resolveParentId','984zpBsoU','parent_key','Parent\x20segment\x20not\x20found:\x20','attribute','attributes','detectResourceTypeInFolder','createSegmentFolder','parentTableName','schemaValid','3855rjBfJW','Calculating\x20statistics\x20for:\x20','listFolders','segment-batch','409488HAqXiD','coveragePercent','Child\x20segment\x20not\x20found:\x20','updateParentSegment','10216cvQlgs','Validating\x20all\x20attributes\x20and\x20behaviors\x20in\x20parallel...','journey','getParentSegment','get','Validating\x20behavior:\x20','Enriched\x20query:\x20','Calculating\x20coverage\x20for:\x20','child_key','parent','catch','some','Attribute\x20\x27','listFields','INVALID_ARGUMENT','row_count','length','deleteActivation','Segment\x20\x27','Behavior\x20\x27','segment-realtime','Validating\x20all\x20attributes\x20in\x20parallel...','interval','159985rtHDZi','resolvePathToResource','Counting\x20master\x20table\x20rows...','listEntitiesByFolder','listSegments','getSegment','listSegmentFolders'];a112_0x46b6=function(){return _0x2b5674;};return a112_0x46b6();}import{deduplicateJourneysByBundle,entityToJourneyListItem,parseJourneyState}from'./journey.js';import{parsePath}from'./segment/segment-path-parser.js';import{pullSegments as a112_0x4ecab2}from'./segment/pull-workflow.js';import{apiToDef,defToApi,serializeDef,parseDef}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';function a112_0x3636(_0x5f16e0,_0x3abc83){_0x5f16e0=_0x5f16e0-0x71;const _0x46b6ac=a112_0x46b6();let _0x363642=_0x46b6ac[_0x5f16e0];return _0x363642;}export class SegmentSDK{['client'];[a112_0x52c6ad(0xb4)];constructor(_0x56fb45){const _0x238414=a112_0x52c6ad;this['client']=new CDPApiClient(_0x56fb45,_0x56fb45['logger']),this['trinoClient']=new TrinoApiClient(_0x56fb45,_0x56fb45[_0x238414(0xe8)]);}async[a112_0x52c6ad(0xd3)](){const _0x536bd9=a112_0x52c6ad;return await this['client'][_0x536bd9(0xd8)]();}async[a112_0x52c6ad(0xe6)](_0x5a6d9c){const _0x31a60e=a112_0x52c6ad;return await this[_0x31a60e(0xed)][_0x31a60e(0x90)](_0x5a6d9c);}async['listSegments'](_0xa32e39){const _0xff42c1=a112_0x52c6ad;return await this[_0xff42c1(0xed)]['listSegments'](_0xa32e39);}async[a112_0x52c6ad(0xa9)](_0x39a30e,_0x146b7f){const _0x4dc397=a112_0x52c6ad;return await this[_0x4dc397(0xed)][_0x4dc397(0xa9)](_0x39a30e,_0x146b7f);}async['listFolders'](_0x498d3a){const _0x5ad447=a112_0x52c6ad;return await this[_0x5ad447(0xed)][_0x5ad447(0xaa)](_0x498d3a);}async[a112_0x52c6ad(0xd6)](_0x2ba134){const _0x2f0d34=a112_0x52c6ad;return await this[_0x2f0d34(0xed)]['getSegmentFolder'](_0x2ba134);}async[a112_0x52c6ad(0xac)](_0x380a1f,_0x4400f1){const _0x33de22=a112_0x52c6ad;return await this['client'][_0x33de22(0xac)](_0x380a1f,_0x4400f1);}async['getActivation'](_0x2c2ada,_0xaf3786,_0x4d7b1b){return await this['client']['getActivation'](_0x2c2ada,_0xaf3786,_0x4d7b1b);}async[a112_0x52c6ad(0xdf)](_0x12cb81,_0x43ef6a,_0x18e1f4){const _0x4b5b5b=a112_0x52c6ad;return await this[_0x4b5b5b(0xed)]['createActivation'](_0x12cb81,_0x43ef6a,_0x18e1f4);}async[a112_0x52c6ad(0xc5)](_0x18f492,_0x4bda,_0x44bc0d,_0x1978fd){const _0x562ece=a112_0x52c6ad;return await this['client'][_0x562ece(0xc5)](_0x18f492,_0x4bda,_0x44bc0d,_0x1978fd);}async['deleteActivation'](_0x369d33,_0x6c5a30,_0x20ac60){const _0x38c1f6=a112_0x52c6ad;return await this[_0x38c1f6(0xed)][_0x38c1f6(0x9e)](_0x369d33,_0x6c5a30,_0x20ac60);}async['getParentSQL'](_0xc82515){const _0xe7eaef=a112_0x52c6ad;return await this['client'][_0xe7eaef(0xef)](_0xc82515);}async['getSegmentSQL'](_0x2f524e,_0x4fc79b){const _0x5ae944=a112_0x52c6ad;return await this[_0x5ae944(0xed)]['getSegmentSQL'](_0x2f524e,_0x4fc79b);}async[a112_0x52c6ad(0x7b)](_0x10cdab){const _0xc392ca=a112_0x52c6ad,_0x19f2cc=await this[_0xc392ca(0xd3)](),_0x9f4c5d=_0x19f2cc[_0xc392ca(0xdb)](_0x1322be=>_0x1322be[_0xc392ca(0x80)][_0xc392ca(0xb2)]===_0x10cdab);if(!_0x9f4c5d)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xc392ca(0x7e)+_0x10cdab);return _0x9f4c5d['id'];}async[a112_0x52c6ad(0x10b)](_0x5ca929){const _0x210f75=a112_0x52c6ad;let _0x13d0b2=_0x5ca929;return!/^\d+$/[_0x210f75(0xf6)](_0x5ca929)&&(_0x13d0b2=await this[_0x210f75(0x7b)](_0x5ca929)),await this['client'][_0x210f75(0xb7)](_0x13d0b2);}async[a112_0x52c6ad(0xca)](_0x122f53,_0x5a8a08){const _0x19f7a3=a112_0x52c6ad,_0x37506d=await this[_0x19f7a3(0xa8)](_0x122f53),_0x252062=_0x37506d['find'](_0x1539f0=>_0x1539f0[_0x19f7a3(0xb2)]===_0x5a8a08);if(!_0x252062)throw new SDKError(ErrorCode[_0x19f7a3(0xc8)],_0x19f7a3(0x8b)+_0x5a8a08+_0x19f7a3(0xfd)+_0x122f53);return _0x252062['id'];}async[a112_0x52c6ad(0xf5)](_0x1b41f0,_0x435b90){const _0x335431=a112_0x52c6ad,_0x1668cb=await this['listFolders'](_0x1b41f0),_0x3aec28=_0x1668cb[_0x335431(0xdb)](_0x5cd0f1=>_0x5cd0f1[_0x335431(0xb2)]===_0x435b90);if(!_0x3aec28)throw new SDKError(ErrorCode[_0x335431(0xc8)],_0x335431(0x113)+_0x435b90+_0x335431(0xfd)+_0x1b41f0);return _0x3aec28['id'];}async[a112_0x52c6ad(0x9a)](_0x4983ed){const _0x475a30=a112_0x52c6ad,_0x597748=await this['resolveParentIdOrName'](_0x4983ed),[_0x2b59d6,_0x21eaec]=await Promise[_0x475a30(0xfc)]([this[_0x475a30(0xed)][_0x475a30(0x106)](_0x597748),this[_0x475a30(0xed)]['getAudienceBehaviors'](_0x597748)]),_0x2877c1=[];for(const _0x2f5ab4 of _0x2b59d6){_0x2877c1['push']({'name':_0x2f5ab4['name'],'type':_0x2f5ab4[_0x475a30(0xcf)],'source':_0x475a30(0x7f),'parentDatabaseName':_0x2f5ab4['parentDatabaseName'],'parentTableName':_0x2f5ab4[_0x475a30(0x83)],'parentColumn':_0x2f5ab4[_0x475a30(0xba)],'groupingName':_0x2f5ab4[_0x475a30(0xd4)]??undefined});}for(const _0x39a136 of _0x21eaec){const _0x5029d4=_0x39a136[_0x475a30(0xb2)];if(_0x39a136[_0x475a30(0xfe)]&&Array[_0x475a30(0xe0)](_0x39a136[_0x475a30(0xfe)]))for(const _0x21c0aa of _0x39a136['schema']){_0x21c0aa[_0x475a30(0xb2)]&&_0x21c0aa[_0x475a30(0xcf)]&&_0x2877c1[_0x475a30(0xcb)]({'name':_0x5029d4+'.'+_0x21c0aa[_0x475a30(0xb2)],'type':_0x21c0aa[_0x475a30(0xcf)],'source':_0x475a30(0x114),'behaviorName':_0x5029d4,'parentDatabaseName':_0x39a136[_0x475a30(0xd2)],'parentTableName':_0x39a136[_0x475a30(0x83)],'parentColumn':_0x21c0aa[_0x475a30(0xba)]});}}return _0x2877c1;}async[a112_0x52c6ad(0xe4)](_0x637b52){const _0x253725=a112_0x52c6ad;return await this['client'][_0x253725(0xf8)](_0x637b52);}async[a112_0x52c6ad(0xbd)](_0x538108,_0x3fad08){const _0x57bb54=a112_0x52c6ad,_0x2e4fc0=await this['resolveParentIdOrName'](_0x538108);return await this[_0x57bb54(0xed)][_0x57bb54(0x8c)](_0x2e4fc0,_0x3fad08);}async[a112_0x52c6ad(0xbb)](_0x3cb480){const _0x1d126c=a112_0x52c6ad,_0x3d19a2=await this[_0x1d126c(0xf1)](_0x3cb480);return await this[_0x1d126c(0xed)][_0x1d126c(0x78)](_0x3d19a2);}async[a112_0x52c6ad(0xee)](_0x20de33){const _0x4e0f1c=a112_0x52c6ad,_0x224fa3=await this[_0x4e0f1c(0xbb)](_0x20de33),_0x5497d4=apiToDef(_0x224fa3);return serializeDef(_0x5497d4);}async[a112_0x52c6ad(0xab)](_0x1cbbfe){const _0x3783fb=a112_0x52c6ad,_0x48f7a0=typeof _0x1cbbfe===_0x3783fb(0x75)?parseDef(_0x1cbbfe):_0x1cbbfe,_0x9d8064=defToApi(_0x48f7a0);let _0x4d0b99=null,_0x1b0e18='';try{_0x4d0b99=await this[_0x3783fb(0xbb)](_0x48f7a0[_0x3783fb(0xb2)]);const _0x560d4b=apiToDef(_0x4d0b99);_0x1b0e18=serializeDef(_0x560d4b);}catch{}const _0x101703=serializeDef(_0x48f7a0),_0x3c4327=generateDiff(_0x1b0e18,_0x101703),_0x18efbc=formatDiffWithColors(_0x3c4327),_0x425a21=_0x4d0b99===null,_0x111e8c=hasChanges(_0x3c4327),_0x1a2710={'isNew':_0x425a21,'id':_0x4d0b99?.['id']||'','name':_0x48f7a0[_0x3783fb(0xb2)],'diff':_0x3c4327,'diffFormatted':_0x18efbc,'hasChanges':_0x111e8c},_0x1d112b=async()=>{const _0x1e2567=_0x3783fb;return _0x425a21?await this[_0x1e2567(0xe4)](_0x9d8064):await this[_0x1e2567(0xbd)](_0x4d0b99['id'],_0x9d8064);};return{..._0x1a2710,'apply':_0x1d112b};}async[a112_0x52c6ad(0x10d)](_0x30a056,_0x2abc93={}){const _0x12968e=a112_0x52c6ad,_0x49de6d=typeof _0x30a056===_0x12968e(0x75)?parseDef(_0x30a056):_0x30a056,_0x1e55a8=[];let _0x348a81=!![];const _0x15fe5e=_0x24895a=>_0x2abc93[_0x12968e(0xc1)]?.(_0x24895a),_0x6dd6c7={'name':_0x49de6d[_0x12968e(0xb2)],'master':{'database':_0x49de6d[_0x12968e(0x116)][_0x12968e(0xce)],'table':_0x49de6d[_0x12968e(0x116)][_0x12968e(0xc0)],'schemaValid':![]},'attributes':[],'behaviors':[],'errors':_0x1e55a8,'allValid':!![]},_0x184818=async _0x31a46a=>{const _0x1e9dcf=_0x12968e;try{const _0x2284af=await this[_0x1e9dcf(0xb4)][_0x1e9dcf(0x102)](_0x31a46a);return{'data':_0x2284af[_0x1e9dcf(0x112)]};}catch(_0x893a99){const _0x3e5a48=_0x893a99 instanceof Error?_0x893a99['message']:String(_0x893a99);return{'data':[],'error':_0x3e5a48};}};_0x15fe5e(_0x12968e(0xde)+_0x49de6d[_0x12968e(0x116)][_0x12968e(0xce)]+'.'+_0x49de6d[_0x12968e(0x116)][_0x12968e(0xc0)]);const _0x4beafc=generateSchemaValidationSQL(_0x49de6d[_0x12968e(0x116)]['database'],_0x49de6d[_0x12968e(0x116)][_0x12968e(0xc0)]),_0x52ab48=await _0x184818(_0x4beafc);if(_0x52ab48[_0x12968e(0x73)])_0x6dd6c7['master']['schemaValid']=![],_0x6dd6c7[_0x12968e(0x116)]['schemaError']=_0x52ab48[_0x12968e(0x73)],_0x1e55a8[_0x12968e(0xcb)](_0x12968e(0xad)+_0x52ab48['error']),_0x348a81=![];else{_0x6dd6c7['master'][_0x12968e(0x84)]=!![],_0x15fe5e(_0x12968e(0xa6));const _0x91d365=await _0x184818(generateMasterCountSQL(_0x49de6d));!_0x91d365[_0x12968e(0x73)]&&_0x91d365[_0x12968e(0x112)][_0x12968e(0x9d)]>0x0&&(_0x6dd6c7[_0x12968e(0x116)][_0x12968e(0x71)]=_0x91d365['data'][0x0][_0x12968e(0x9c)]);}if(_0x2abc93['master'])return _0x6dd6c7[_0x12968e(0xeb)]=_0x348a81,_0x6dd6c7;const _0x187552=async _0x2a7a78=>{const _0x150d7c=_0x12968e,_0x417f4e={'name':_0x2a7a78['name'],'database':_0x2a7a78[_0x150d7c(0xbc)][_0x150d7c(0xce)],'table':_0x2a7a78[_0x150d7c(0xbc)]['table'],'joinKey':_0x2a7a78['join']['child_key'],'foreignKey':_0x2a7a78[_0x150d7c(0x7a)][_0x150d7c(0x7d)],'columns':getAttributeColumns(_0x2a7a78),'schemaValid':![]};_0x15fe5e('Validating\x20attribute:\x20'+_0x2a7a78[_0x150d7c(0xb2)]);const _0x4ca6ea=await _0x184818(generateAttributeSchemaSQL(_0x49de6d,_0x2a7a78));if(_0x4ca6ea['error'])_0x417f4e[_0x150d7c(0xe9)]=_0x4ca6ea[_0x150d7c(0x73)];else{_0x417f4e['schemaValid']=!![],_0x15fe5e(_0x150d7c(0x94)+_0x2a7a78[_0x150d7c(0xb2)]);const _0x416ebb=await _0x184818(generateAttributeCoverageSQL(_0x49de6d,_0x2a7a78));!_0x416ebb[_0x150d7c(0x73)]&&_0x416ebb['data'][_0x150d7c(0x9d)]>0x0&&(_0x417f4e['matchedCount']=_0x416ebb[_0x150d7c(0x112)][0x0]['matched_count'],_0x6dd6c7['master'][_0x150d7c(0x71)]&&_0x6dd6c7[_0x150d7c(0x116)]['rowCount']>0x0&&(_0x417f4e[_0x150d7c(0x8a)]=_0x417f4e['matchedCount']/_0x6dd6c7['master'][_0x150d7c(0x71)]*0x64));}return _0x417f4e;},_0x29c488=async(_0x5aa7a3,_0x5350a1)=>{const _0x1360c2=_0x12968e,_0x58ad9b={'name':_0x5aa7a3[_0x1360c2(0xb2)],'database':_0x5aa7a3[_0x1360c2(0xbc)]['database'],'table':_0x5aa7a3[_0x1360c2(0xbc)]['table'],'joinKey':_0x5aa7a3['join'][_0x1360c2(0x95)],'foreignKey':_0x5aa7a3['join'][_0x1360c2(0x7d)],'columns':getBehaviorColumns(_0x5aa7a3),'schemaValid':![]};_0x15fe5e(_0x1360c2(0x92)+_0x5aa7a3[_0x1360c2(0xb2)]);const _0x20baa5=await _0x184818(generateBehaviorSchemaSQL(_0x49de6d,_0x5aa7a3));if(_0x20baa5[_0x1360c2(0x73)])_0x58ad9b['schemaError']=_0x20baa5[_0x1360c2(0x73)];else{_0x58ad9b[_0x1360c2(0x84)]=!![],_0x15fe5e(_0x1360c2(0x86)+_0x5aa7a3[_0x1360c2(0xb2)]+'\x20('+_0x5350a1+')');const _0x5495a6=await _0x184818(generateBehaviorStatsSQL(_0x49de6d,_0x5aa7a3,_0x5350a1));!_0x5495a6[_0x1360c2(0x73)]&&_0x5495a6[_0x1360c2(0x112)][_0x1360c2(0x9d)]>0x0&&(_0x58ad9b['customersWithEvents']=_0x5495a6['data'][0x0][_0x1360c2(0xaf)],_0x58ad9b[_0x1360c2(0xd1)]=_0x5495a6['data'][0x0][_0x1360c2(0xc2)],_0x6dd6c7[_0x1360c2(0x116)][_0x1360c2(0x71)]&&_0x6dd6c7[_0x1360c2(0x116)][_0x1360c2(0x71)]>0x0&&(_0x58ad9b[_0x1360c2(0xdc)]=_0x58ad9b['customersWithEvents']/_0x6dd6c7['master'][_0x1360c2(0x71)]*0x64));}return _0x58ad9b;},_0x123179=(_0x4d058c,_0x4a3bd5)=>{const _0x56e0aa=_0x12968e;_0x6dd6c7['attributes']=_0x4d058c,_0x6dd6c7[_0x56e0aa(0x10a)]=_0x4a3bd5;for(const _0x2df766 of _0x4d058c){!_0x2df766[_0x56e0aa(0x84)]&&(_0x1e55a8[_0x56e0aa(0xcb)](_0x56e0aa(0x99)+_0x2df766[_0x56e0aa(0xb2)]+_0x56e0aa(0xfa)+_0x2df766[_0x56e0aa(0xe9)]),_0x348a81=![]);}for(const _0x143ac8 of _0x4a3bd5){!_0x143ac8[_0x56e0aa(0x84)]&&(_0x1e55a8['push'](_0x56e0aa(0xa0)+_0x143ac8[_0x56e0aa(0xb2)]+'\x27:\x20'+_0x143ac8[_0x56e0aa(0xe9)]),_0x348a81=![]);}},_0x1676c0=_0x2abc93[_0x12968e(0xa3)]||DEFAULT_TIME_RANGE;if(typeof _0x2abc93[_0x12968e(0x7f)]===_0x12968e(0x75)){const _0x17db85=findAttributeByName(_0x49de6d,_0x2abc93['attribute']);if(!_0x17db85)throw new SDKError(ErrorCode[_0x12968e(0xc8)],'Attribute\x20\x27'+_0x2abc93[_0x12968e(0x7f)]+'\x27\x20not\x20found');const _0x1bc99e=await _0x187552(_0x17db85);return _0x123179([_0x1bc99e],[]),_0x6dd6c7[_0x12968e(0xeb)]=_0x348a81,_0x6dd6c7;}if(_0x2abc93[_0x12968e(0x7f)]===!![]){_0x15fe5e('Validating\x20all\x20attributes\x20in\x20parallel...');const _0x485ad4=await Promise[_0x12968e(0xfc)]((_0x49de6d['attributes']||[])[_0x12968e(0x10f)](_0x3c4e0a=>_0x187552(_0x3c4e0a)));return _0x123179(_0x485ad4,[]),_0x6dd6c7[_0x12968e(0xeb)]=_0x348a81,_0x6dd6c7;}if(typeof _0x2abc93[_0x12968e(0x114)]==='string'){const _0x22bb6b=findBehaviorByName(_0x49de6d,_0x2abc93['behavior']);if(!_0x22bb6b)throw new SDKError(ErrorCode[_0x12968e(0xc8)],_0x12968e(0xa0)+_0x2abc93[_0x12968e(0x114)]+_0x12968e(0x100));const _0x212bcd=await _0x29c488(_0x22bb6b,_0x1676c0);return _0x123179([],[_0x212bcd]),_0x6dd6c7['allValid']=_0x348a81,_0x6dd6c7;}if(_0x2abc93[_0x12968e(0x114)]===!![]){_0x15fe5e(_0x12968e(0xc7));const _0x27fafa=await Promise['all']((_0x49de6d['behaviors']||[])['map'](_0x957a79=>_0x29c488(_0x957a79,_0x1676c0)));return _0x123179([],_0x27fafa),_0x6dd6c7[_0x12968e(0xeb)]=_0x348a81,_0x6dd6c7;}if(_0x2abc93[_0x12968e(0xfb)]){_0x15fe5e(_0x12968e(0xa2));const _0x285c97=await Promise[_0x12968e(0xfc)]((_0x49de6d['attributes']||[])[_0x12968e(0x10f)](_0x1f917f=>_0x187552(_0x1f917f)));return _0x123179(_0x285c97,[]),_0x6dd6c7[_0x12968e(0xeb)]=_0x348a81,_0x6dd6c7;}_0x15fe5e(_0x12968e(0x8e));const [_0x585a89,_0x3b2582]=await Promise[_0x12968e(0xfc)]([Promise[_0x12968e(0xfc)]((_0x49de6d['attributes']||[])[_0x12968e(0x10f)](_0xf82ea=>_0x187552(_0xf82ea))),Promise[_0x12968e(0xfc)]((_0x49de6d[_0x12968e(0x10a)]||[])[_0x12968e(0x10f)](_0x4b26a0=>_0x29c488(_0x4b26a0,_0x1676c0)))]);return _0x123179(_0x585a89,_0x3b2582),_0x6dd6c7['allValid']=_0x348a81,_0x6dd6c7;}async[a112_0x52c6ad(0x79)](_0xfc8a8b,_0x697b4a={}){const _0x49d6bc=a112_0x52c6ad,_0x174ff1=typeof _0xfc8a8b===_0x49d6bc(0x75)?parseDef(_0xfc8a8b):_0xfc8a8b,_0x34442c=[];let _0x4f8436=!![];const _0x3c8e06=_0x45a31a=>_0x697b4a[_0x49d6bc(0xc1)]?.(_0x45a31a),_0x3869da={'name':_0x174ff1[_0x49d6bc(0xb2)],'master':{'database':_0x174ff1[_0x49d6bc(0x116)][_0x49d6bc(0xce)],'table':_0x174ff1[_0x49d6bc(0x116)]['table'],'schemaValid':!![]},'attributes':[],'behaviors':[],'errors':_0x34442c,'allValid':!![]},_0x1bc751=async _0x486da9=>{const _0x47f012=_0x49d6bc;try{const _0x4fa4b1=await this[_0x47f012(0xb4)][_0x47f012(0x102)](_0x486da9);return{'data':_0x4fa4b1['data']};}catch(_0x31db28){const _0x426147=_0x31db28 instanceof Error?_0x31db28['message']:String(_0x31db28);return{'data':[],'error':_0x426147};}};if(_0x697b4a[_0x49d6bc(0x116)]){_0x3c8e06(_0x49d6bc(0xc6));const _0x4691c7=generateMasterSampleSQL(_0x174ff1,DEFAULT_SAMPLE_LIMIT),_0x5a44db=await _0x1bc751(_0x4691c7);return!_0x5a44db[_0x49d6bc(0x73)]?_0x3869da[_0x49d6bc(0xd7)]=_0x5a44db[_0x49d6bc(0x112)]:(_0x34442c[_0x49d6bc(0xcb)](_0x49d6bc(0xad)+_0x5a44db['error']),_0x4f8436=![]),_0x3869da['allValid']=_0x4f8436,_0x3869da;}if(_0x697b4a[_0x49d6bc(0x7f)]){const _0x4c2f1a=findAttributeByName(_0x174ff1,_0x697b4a[_0x49d6bc(0x7f)]);if(!_0x4c2f1a)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x49d6bc(0x99)+_0x697b4a[_0x49d6bc(0x7f)]+_0x49d6bc(0x100));_0x3c8e06(_0x49d6bc(0xdd)+_0x4c2f1a['name']);const _0x4c6a27=generateAttributeSampleSQL(_0x174ff1,_0x4c2f1a,DEFAULT_SAMPLE_LIMIT),_0x430a96=await _0x1bc751(_0x4c6a27);return!_0x430a96[_0x49d6bc(0x73)]?_0x3869da['sampleData']=_0x430a96[_0x49d6bc(0x112)]:(_0x34442c[_0x49d6bc(0xcb)]('Attribute\x20\x27'+_0x4c2f1a['name']+'\x27:\x20'+_0x430a96[_0x49d6bc(0x73)]),_0x4f8436=![]),_0x3869da[_0x49d6bc(0xeb)]=_0x4f8436,_0x3869da;}if(_0x697b4a['behavior']){const _0x5a1ba9=findBehaviorByName(_0x174ff1,_0x697b4a[_0x49d6bc(0x114)]);if(!_0x5a1ba9)throw new SDKError(ErrorCode[_0x49d6bc(0xc8)],_0x49d6bc(0xa0)+_0x697b4a[_0x49d6bc(0x114)]+'\x27\x20not\x20found');const _0x6a3b2f=_0x697b4a[_0x49d6bc(0xa3)]||DEFAULT_TIME_RANGE;_0x3c8e06(_0x49d6bc(0xdd)+_0x5a1ba9[_0x49d6bc(0xb2)]+'\x20('+_0x6a3b2f+')');const _0xd90af9=generateBehaviorSampleSQL(_0x174ff1,_0x5a1ba9,DEFAULT_SAMPLE_LIMIT,_0x6a3b2f),_0x543ae2=await _0x1bc751(_0xd90af9);return!_0x543ae2[_0x49d6bc(0x73)]?_0x3869da[_0x49d6bc(0xd7)]=_0x543ae2['data']:(_0x34442c['push'](_0x49d6bc(0xa0)+_0x5a1ba9[_0x49d6bc(0xb2)]+'\x27:\x20'+_0x543ae2['error']),_0x4f8436=![]),_0x3869da[_0x49d6bc(0xeb)]=_0x4f8436,_0x3869da;}if(_0x697b4a[_0x49d6bc(0xfb)]){_0x3c8e06('Fetching\x20enriched\x20master\x20data...');const _0x2b36fa=generateEnrichedSQL(_0x174ff1,DEFAULT_SAMPLE_LIMIT),_0x462052=await _0x1bc751(_0x2b36fa);return!_0x462052[_0x49d6bc(0x73)]?_0x3869da[_0x49d6bc(0xd7)]=_0x462052[_0x49d6bc(0x112)]:(_0x34442c[_0x49d6bc(0xcb)](_0x49d6bc(0x93)+_0x462052[_0x49d6bc(0x73)]),_0x4f8436=![]),_0x3869da[_0x49d6bc(0xeb)]=_0x4f8436,_0x3869da;}return _0x3869da[_0x49d6bc(0xeb)]=_0x4f8436,_0x3869da;}async[a112_0x52c6ad(0x103)](_0x2121b0,_0x2f9489){const _0x581321=a112_0x52c6ad;return await this[_0x581321(0xed)][_0x581321(0x103)](_0x2121b0,_0x2f9489);}async[a112_0x52c6ad(0xea)](_0x52de5b){const _0x5139ee=a112_0x52c6ad;return await this[_0x5139ee(0xed)][_0x5139ee(0xea)](_0x52de5b);}async[a112_0x52c6ad(0xff)](_0xec4c66,_0x1621a7,_0x4df74d){const _0x4c0fcb=a112_0x52c6ad;return await this['client'][_0x4c0fcb(0x76)](_0xec4c66,_0x1621a7,_0x4df74d);}async[a112_0x52c6ad(0xf4)](_0x18f0ba){const _0x4863a2=a112_0x52c6ad;return await this[_0x4863a2(0xed)][_0x4863a2(0xf4)](_0x18f0ba);}async[a112_0x52c6ad(0xe1)](_0x2888ca,_0x146e19){const _0x20eb1f=a112_0x52c6ad,_0x396706=await this[_0x20eb1f(0xf1)](_0x2888ca);return await this[_0x20eb1f(0xed)][_0x20eb1f(0x82)](_0x396706,_0x146e19);}async[a112_0x52c6ad(0xf1)](_0x4e3985){const _0x571560=a112_0x52c6ad;if(/^\d+$/['test'](_0x4e3985))return _0x4e3985;return await this[_0x571560(0x7b)](_0x4e3985);}async['detectResourceType'](_0xb21fb4,_0x4d072d){const _0x32896b=a112_0x52c6ad,[_0x12624a,_0x9a2c3d]=await Promise[_0x32896b(0xfc)]([this[_0x32896b(0xf5)](_0xb21fb4,_0x4d072d)[_0x32896b(0xb5)](()=>!![])['catch'](()=>![]),this[_0x32896b(0xca)](_0xb21fb4,_0x4d072d)[_0x32896b(0xb5)](()=>!![])[_0x32896b(0x97)](()=>![])]);if(_0x12624a&&_0x9a2c3d)return'ambiguous';else{if(_0x12624a)return _0x32896b(0x108);else{if(_0x9a2c3d)return'segment';}}throw new SDKError(ErrorCode[_0x32896b(0xc8)],_0x32896b(0x72)+_0x4d072d+_0x32896b(0xc4));}async[a112_0x52c6ad(0x81)](_0x16b19d,_0x17ed56,_0x417107){const _0x34d8c1=a112_0x52c6ad,[_0x5c5c45,_0x1c3e25]=await Promise[_0x34d8c1(0xfc)]([this[_0x34d8c1(0x87)](_0x16b19d),this['listSegments'](_0x16b19d)]),_0x13adab=_0x417107?_0x5c5c45['filter'](_0x472232=>_0x472232[_0x34d8c1(0x109)]===_0x417107):_0x5c5c45[_0x34d8c1(0xe5)](_0x3e4013=>!_0x3e4013['parentFolderId']),_0x54667a=_0x417107?_0x1c3e25[_0x34d8c1(0xe5)](_0x52b017=>_0x52b017['segmentFolderId']===_0x417107):_0x1c3e25['filter'](_0x35c1b0=>!_0x35c1b0[_0x34d8c1(0x104)]),_0x5795d4=_0x13adab[_0x34d8c1(0x98)](_0xe4a16c=>_0xe4a16c[_0x34d8c1(0xb2)]===_0x17ed56),_0x9bb34a=_0x54667a[_0x34d8c1(0x98)](_0x4622a5=>_0x4622a5[_0x34d8c1(0xb2)]===_0x17ed56);if(_0x5795d4&&_0x9bb34a)return _0x34d8c1(0xda);else{if(_0x5795d4)return _0x34d8c1(0x108);else{if(_0x9bb34a)return _0x34d8c1(0xb9);}}throw new SDKError(ErrorCode[_0x34d8c1(0xc8)],_0x34d8c1(0x72)+_0x17ed56+'\x27\x20not\x20found\x20in\x20'+(_0x417107?_0x34d8c1(0x108):'parent\x20segment'));}async['traversePath'](_0x192c93){const _0x23e58c=a112_0x52c6ad;if(_0x192c93[_0x23e58c(0x9d)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x23e58c(0xf2));const _0x541716=_0x192c93[0x0],_0x5c7c8c=await this['resolveParentId'](_0x541716);if(_0x192c93[_0x23e58c(0x9d)]===0x1)return{'parentId':_0x5c7c8c,'parentName':_0x541716,'type':_0x23e58c(0x96),'fullPath':_0x541716};const _0x35f89f=await this[_0x23e58c(0xbb)](_0x5c7c8c),_0x2e4ef2=_0x35f89f[_0x23e58c(0xb6)],_0x48d8f6=[];let _0x320172=_0x2e4ef2;for(let _0x3258ae=0x1;_0x3258ae<_0x192c93[_0x23e58c(0x9d)]-0x1;_0x3258ae++){const _0x179182=_0x192c93[_0x3258ae],_0x66998d=await this[_0x23e58c(0x87)](_0x5c7c8c),_0xc716b6=_0x320172?_0x66998d['find'](_0x1db58f=>_0x1db58f[_0x23e58c(0xb2)]===_0x179182&&_0x1db58f['parentFolderId']===_0x320172):_0x66998d[_0x23e58c(0xdb)](_0x59fd12=>_0x59fd12[_0x23e58c(0xb2)]===_0x179182&&!_0x59fd12[_0x23e58c(0x109)]);if(!_0xc716b6)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x23e58c(0x77)+_0x179182+_0x23e58c(0x117));_0x48d8f6[_0x23e58c(0xcb)](_0x179182),_0x320172=_0xc716b6['id'];}const _0x20c922=_0x192c93[_0x192c93[_0x23e58c(0x9d)]-0x1],_0x729e4b=await this[_0x23e58c(0x81)](_0x5c7c8c,_0x20c922,_0x320172);if(_0x729e4b===_0x23e58c(0xda)||_0x729e4b===_0x23e58c(0x108)){const _0x38a327=await this[_0x23e58c(0x87)](_0x5c7c8c),_0x4c54ee=_0x320172?_0x38a327[_0x23e58c(0xdb)](_0x58a757=>_0x58a757['name']===_0x20c922&&_0x58a757[_0x23e58c(0x109)]===_0x320172):_0x38a327[_0x23e58c(0xdb)](_0x5182b6=>_0x5182b6[_0x23e58c(0xb2)]===_0x20c922&&!_0x5182b6[_0x23e58c(0x109)]);if(!_0x4c54ee)throw new SDKError(ErrorCode[_0x23e58c(0xc8)],'Folder\x20\x27'+_0x20c922+_0x23e58c(0x100));return _0x48d8f6[_0x23e58c(0xcb)](_0x20c922),{'parentId':_0x5c7c8c,'parentName':_0x541716,'folderId':_0x4c54ee['id'],'folderPath':_0x48d8f6,'type':_0x23e58c(0x108),'fullPath':_0x192c93['join']('/')};}else{const _0x2be71a=await this[_0x23e58c(0xa8)](_0x5c7c8c),_0x8cc006=_0x320172?_0x2be71a['find'](_0x2caed6=>_0x2caed6['name']===_0x20c922&&_0x2caed6[_0x23e58c(0x104)]===_0x320172):_0x2be71a[_0x23e58c(0xdb)](_0x2bf0b9=>_0x2bf0b9[_0x23e58c(0xb2)]===_0x20c922&&!_0x2bf0b9[_0x23e58c(0x104)]);if(!_0x8cc006)throw new SDKError(ErrorCode[_0x23e58c(0xc8)],_0x23e58c(0x9f)+_0x20c922+'\x27\x20not\x20found');return{'parentId':_0x5c7c8c,'parentName':_0x541716,'folderId':_0x320172,'folderPath':_0x48d8f6['length']>0x0?_0x48d8f6:undefined,'segmentId':_0x8cc006['id'],'segmentName':_0x20c922,'type':'segment','fullPath':_0x192c93[_0x23e58c(0x7a)]('/')};}}async[a112_0x52c6ad(0xa5)](_0x4a7784){const _0x39d8d7=a112_0x52c6ad,_0x2b1524=parsePath(_0x4a7784);if(!_0x2b1524['isAbsolute'])throw new SDKError(ErrorCode[_0x39d8d7(0x9b)],'Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)');return await this['traversePath'](_0x2b1524[_0x39d8d7(0xf3)]);}async[a112_0x52c6ad(0xf7)](_0x1b3d4f,_0x3020ba){const _0x1f7d98=a112_0x52c6ad;let _0x20037d=_0x3020ba;if(!_0x20037d){const _0x1fc861=await this[_0x1f7d98(0xbb)](_0x1b3d4f);_0x20037d=_0x1fc861[_0x1f7d98(0xb6)];}if(!_0x20037d)return{'folders':[],'segments':[],'journeys':[]};const _0x52f0d0=await this[_0x1f7d98(0xed)][_0x1f7d98(0xa7)](_0x20037d,0x1,![]),_0x32e865=_0x52f0d0[_0x1f7d98(0x112)],_0xe13994=_0x32e865[_0x1f7d98(0xe5)](_0x426807=>{const _0x54e177=_0x1f7d98;if(_0x426807['id']===_0x20037d)return![];const _0x535436=this[_0x54e177(0x110)](_0x426807);return _0x535436===_0x20037d||!_0x535436;}),_0x4e7843=_0xe13994[_0x1f7d98(0xe5)](_0x4c5710=>_0x4c5710[_0x1f7d98(0xcf)]==='folder-segment')[_0x1f7d98(0x10f)](_0x97b7e=>this['entityToFolder'](_0x97b7e,_0x1b3d4f)),_0x201b63=_0xe13994['filter'](_0x41d2ef=>_0x41d2ef[_0x1f7d98(0xcf)]===_0x1f7d98(0x88)||_0x41d2ef['type']==='segment-realtime')[_0x1f7d98(0x10f)](_0x3eb082=>this[_0x1f7d98(0xcd)](_0x3eb082,_0x1b3d4f)),_0x5f5ac3=_0xe13994[_0x1f7d98(0xe5)](_0x5e7423=>_0x5e7423[_0x1f7d98(0xcf)]==='journey'),_0x3476d0=_0x5f5ac3[_0x1f7d98(0x10f)](_0x4d72d1=>({'journeyBundleId':_0x4d72d1[_0x1f7d98(0x80)][_0x1f7d98(0xc9)],'versionNumber':_0x4d72d1['attributes'][_0x1f7d98(0x10c)],'id':_0x4d72d1['id'],'entity':_0x4d72d1})),_0x4f1101=deduplicateJourneysByBundle(_0x3476d0),_0x846334=_0x4f1101[_0x1f7d98(0x10f)](_0x4c5c7d=>entityToJourneyListItem(_0x4c5c7d[_0x1f7d98(0xbe)],_0x1b3d4f));return{'folders':_0x4e7843,'segments':_0x201b63,'journeys':_0x846334};}[a112_0x52c6ad(0xae)](_0x1b15d9,_0xc79ea3){const _0x597985=a112_0x52c6ad;return{'audienceId':_0xc79ea3,'id':_0x1b15d9['id'],'name':_0x1b15d9[_0x597985(0x80)]['name'],'parentFolderId':_0x1b15d9[_0x597985(0x80)][_0x597985(0x109)]??_0x1b15d9['relationships']?.[_0x597985(0x111)]?.[_0x597985(0x112)]?.['id']??null,'description':_0x1b15d9[_0x597985(0x80)][_0x597985(0x105)]??null,'createdAt':_0x1b15d9[_0x597985(0x80)][_0x597985(0xe3)],'updatedAt':_0x1b15d9[_0x597985(0x80)][_0x597985(0xb8)]};}['entityToSegment'](_0x131027,_0x319a84){const _0x1ac82c=a112_0x52c6ad;return{'audienceId':_0x319a84,'id':_0x131027['id'],'name':_0x131027[_0x1ac82c(0x80)]['name'],'description':_0x131027[_0x1ac82c(0x80)]['description']??undefined,'realtime':_0x131027['type']===_0x1ac82c(0xa1),'segmentFolderId':_0x131027[_0x1ac82c(0x80)]['segmentFolderId']??_0x131027[_0x1ac82c(0xd5)]?.['parentFolder']?.[_0x1ac82c(0x112)]?.['id']??undefined,'population':_0x131027[_0x1ac82c(0x80)][_0x1ac82c(0xcc)],'createdAt':_0x131027[_0x1ac82c(0x80)][_0x1ac82c(0xe3)],'updatedAt':_0x131027['attributes'][_0x1ac82c(0xb8)]};}async[a112_0x52c6ad(0xb0)](_0x154c69,_0x27bafa,_0x1951f1,_0x1240ee=0xa){const _0x25e74e=a112_0x52c6ad;let _0xfa15c2=_0x27bafa;if(!_0xfa15c2){const _0x3828f9=await this['getParentFull'](_0x154c69);_0xfa15c2=_0x3828f9['rootFolderId'];}if(!_0xfa15c2)return[];const _0x53cfa9=await this['client']['listEntitiesByFolder'](_0xfa15c2,_0x1240ee,![]),_0x196ea3=_0x53cfa9[_0x25e74e(0x112)];return this['buildTreeFromEntities'](_0x196ea3,_0xfa15c2);}[a112_0x52c6ad(0x101)](_0x3e35bc,_0x47df52){const _0x4374a7=a112_0x52c6ad,_0x4cd3b7=new Map();for(const _0x442f4a of _0x3e35bc){if(_0x442f4a[_0x4374a7(0xcf)]==='folder-segment'&&_0x442f4a['id']===_0x47df52)continue;const _0x107498=this['getEntityParentFolderId'](_0x442f4a)??_0x47df52;!_0x4cd3b7[_0x4374a7(0x74)](_0x107498)&&_0x4cd3b7[_0x4374a7(0x115)](_0x107498,[]),_0x4cd3b7[_0x4374a7(0x91)](_0x107498)[_0x4374a7(0xcb)](_0x442f4a);}return this[_0x4374a7(0xd0)](_0x47df52,_0x4cd3b7);}['getEntityParentFolderId'](_0x3bbf5b){const _0xbcfa88=a112_0x52c6ad;if(_0x3bbf5b[_0xbcfa88(0xd5)]?.['parentFolder']?.[_0xbcfa88(0x112)]?.['id'])return _0x3bbf5b[_0xbcfa88(0xd5)][_0xbcfa88(0x111)]['data']['id'];return _0x3bbf5b[_0xbcfa88(0x80)][_0xbcfa88(0x109)]??_0x3bbf5b[_0xbcfa88(0x80)][_0xbcfa88(0x104)]??undefined;}[a112_0x52c6ad(0xd0)](_0x3f8ed6,_0x32bebe){const _0xc7aea1=a112_0x52c6ad,_0x50ff4f=_0x32bebe['get'](_0x3f8ed6)??[],_0x49322c=[],_0x3cb609=_0x50ff4f['filter'](_0x3d6ec6=>_0x3d6ec6[_0xc7aea1(0xcf)]==='folder-segment'),_0x23ca9e=_0x50ff4f[_0xc7aea1(0xe5)](_0x196492=>_0x196492[_0xc7aea1(0xcf)]==='segment-batch'||_0x196492[_0xc7aea1(0xcf)]==='segment-realtime'),_0x283979=_0x50ff4f['filter'](_0x35e2cd=>_0x35e2cd[_0xc7aea1(0xcf)]===_0xc7aea1(0x8f)),_0x3d6f01=_0x283979[_0xc7aea1(0x10f)](_0x2eb507=>({'journeyBundleId':_0x2eb507[_0xc7aea1(0x80)][_0xc7aea1(0xc9)],'versionNumber':_0x2eb507[_0xc7aea1(0x80)][_0xc7aea1(0x10c)],'id':_0x2eb507['id'],'entity':_0x2eb507})),_0x40f15a=deduplicateJourneysByBundle(_0x3d6f01);for(const _0x488152 of _0x3cb609){const _0x351e04=this['buildTreeNodesForFolder'](_0x488152['id'],_0x32bebe);_0x49322c[_0xc7aea1(0xcb)]({'type':_0xc7aea1(0x108),'id':_0x488152['id'],'name':_0x488152[_0xc7aea1(0x80)][_0xc7aea1(0xb2)],'children':_0x351e04[_0xc7aea1(0x9d)]>0x0?_0x351e04:undefined,'metadata':{'description':_0x488152[_0xc7aea1(0x80)][_0xc7aea1(0x105)]??undefined,'folderCount':_0x351e04[_0xc7aea1(0xe5)](_0x2f72a1=>_0x2f72a1['type']===_0xc7aea1(0x108))[_0xc7aea1(0x9d)],'segmentCount':_0x351e04[_0xc7aea1(0xe5)](_0xa5b784=>_0xa5b784[_0xc7aea1(0xcf)]===_0xc7aea1(0xb9))['length'],'journeyCount':_0x351e04['filter'](_0x45659e=>_0x45659e[_0xc7aea1(0xcf)]===_0xc7aea1(0x8f))['length'],'createdAt':_0x488152[_0xc7aea1(0x80)][_0xc7aea1(0xe3)],'updatedAt':_0x488152[_0xc7aea1(0x80)][_0xc7aea1(0xb8)]}});}for(const _0x2761cc of _0x23ca9e){_0x49322c['push']({'type':_0xc7aea1(0xb9),'id':_0x2761cc['id'],'name':_0x2761cc['attributes'][_0xc7aea1(0xb2)],'population':_0x2761cc['attributes']['population'],'metadata':{'description':_0x2761cc[_0xc7aea1(0x80)][_0xc7aea1(0x105)]??undefined,'createdAt':_0x2761cc['attributes'][_0xc7aea1(0xe3)],'updatedAt':_0x2761cc[_0xc7aea1(0x80)]['updatedAt']}});}for(const _0x4d40f4 of _0x40f15a){const _0x25575a=_0x4d40f4[_0xc7aea1(0xbe)];_0x49322c[_0xc7aea1(0xcb)]({'type':_0xc7aea1(0x8f),'id':_0x25575a['id'],'name':_0x25575a[_0xc7aea1(0x80)][_0xc7aea1(0x107)]??_0x25575a[_0xc7aea1(0x80)]['name']??'','state':parseJourneyState(_0x25575a[_0xc7aea1(0x80)][_0xc7aea1(0xb1)]),'metadata':{}});}return _0x49322c;}async[a112_0x52c6ad(0x10e)](_0x278f1a,_0x1bc2ed={}){const _0x29822e=a112_0x52c6ad,_0x4a5a92=this['getTdxInstance'](),_0x2cabb0={'segment':_0x4a5a92[_0x29822e(0xb9)],'journey':_0x4a5a92['journey'],'user':_0x4a5a92[_0x29822e(0xf0)],'connection':_0x4a5a92[_0x29822e(0xec)]};return a112_0x4ecab2(_0x2cabb0,_0x278f1a,_0x1bc2ed);}[a112_0x52c6ad(0xd9)](){return this['_tdxInstance'];}}
|
package/dist/sdk/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a119_0x3d67e3=a119_0x43bf;(function(_0x201001,_0x276e21){const _0x1891a1=a119_0x43bf,_0x1ba121=_0x201001();while(!![]){try{const _0x553d62=-parseInt(_0x1891a1(0x12f))/0x1*(parseInt(_0x1891a1(0x135))/0x2)+-parseInt(_0x1891a1(0x12e))/0x3*(-parseInt(_0x1891a1(0x134))/0x4)+-parseInt(_0x1891a1(0x129))/0x5*(parseInt(_0x1891a1(0x12d))/0x6)+-parseInt(_0x1891a1(0x132))/0x7*(-parseInt(_0x1891a1(0x12c))/0x8)+-parseInt(_0x1891a1(0x128))/0x9*(-parseInt(_0x1891a1(0x136))/0xa)+-parseInt(_0x1891a1(0x130))/0xb+-parseInt(_0x1891a1(0x12a))/0xc*(-parseInt(_0x1891a1(0x12b))/0xd);if(_0x553d62===_0x276e21)break;else _0x1ba121['push'](_0x1ba121['shift']());}catch(_0xbba13){_0x1ba121['push'](_0x1ba121['shift']());}}}(a119_0x9832,0x3cfb9));export const SITE_ALIASES={'us':a119_0x3d67e3(0x131),'aws':a119_0x3d67e3(0x131),'jp':a119_0x3d67e3(0x137),'aws-tokyo':'jp01','dev':a119_0x3d67e3(0x133),'stg':'stg-us01'};function a119_0x43bf(_0x27a64c,_0x3ddaa2){_0x27a64c=_0x27a64c-0x128;const _0x98328d=a119_0x9832();let _0x43bf60=_0x98328d[_0x27a64c];return _0x43bf60;}function a119_0x9832(){const _0x4460d9=['111duLEEn','4552757yWlQPB','us01','49GZxiPK','dev-us01','12oYwtkk','6332CFfxwe','70QNSZZO','jp01','73413iBuMjY','812905uecHEB','2436jXAJwW','41301PSiwdH','512984mHvKPc','12lWuTBa','189369ydJgCG'];a119_0x9832=function(){return _0x4460d9;};return a119_0x9832();}export{getEndpoint,API_ENDPOINTS}from'../client/endpoints.js';export{noopReporter}from'./progress.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x30a5ce,_0x5d970d){const _0x13efad=a122_0x42c7,_0x41ec6c=_0x30a5ce();while(!![]){try{const _0x69344e=-parseInt(_0x13efad(0x1e3))/0x1*(-parseInt(_0x13efad(0x1e5))/0x2)+parseInt(_0x13efad(0x1e9))/0x3+parseInt(_0x13efad(0x1e4))/0x4+-parseInt(_0x13efad(0x1e7))/0x5*(-parseInt(_0x13efad(0x1e2))/0x6)+-parseInt(_0x13efad(0x1ea))/0x7+-parseInt(_0x13efad(0x1e6))/0x8+-parseInt(_0x13efad(0x1e8))/0x9;if(_0x69344e===_0x5d970d)break;else _0x41ec6c['push'](_0x41ec6c['shift']());}catch(_0x5f5aa9){_0x41ec6c['push'](_0x41ec6c['shift']());}}}(a122_0x5204,0x74631));export const noopReporter={'update':()=>{}};function a122_0x42c7(_0x547569,_0x5de9b9){_0x547569=_0x547569-0x1e2;const _0x520403=a122_0x5204();let _0x42c7df=_0x520403[_0x547569];return _0x42c7df;}function a122_0x5204(){const _0x428126=['3487024iRAsra','10225MywjAl','11347785vlvtGQ','2842026bXiWsq','6621237IJmjmZ','2520hXMCQi','725769bOEDSy','2349376ElnOHk','2ThunfX'];a122_0x5204=function(){return _0x428126;};return a122_0x5204();}
|
package/dist/sdk/user.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a126_0x3719(_0x3ac0e8,_0x5dc580){_0x3ac0e8=_0x3ac0e8-0x91;const _0x4693c5=a126_0x4693();let _0x37194a=_0x4693c5[_0x3ac0e8];return _0x37194a;}const a126_0x482005=a126_0x3719;function a126_0x4693(){const _0xddbc9e=['map','logger','default','5htvgiK','getUserInfo','toLowerCase','getCurrent','findByEmail','list','buildEmailToIdMap','1972048mCdBaB','9599PNnwRY','47799LbSTSc','910FHmjrz','38kpsmye','clearCache','profile','185415TVhVEl','email','862770dcAKVM','1230356JAqwmB','find','buildIdToEmailMap','994931CNefvC','findById','client'];a126_0x4693=function(){return _0xddbc9e;};return a126_0x4693();}(function(_0x9267fd,_0x56a141){const _0x398ee4=a126_0x3719,_0x3b7c12=_0x9267fd();while(!![]){try{const _0x4e5fef=parseInt(_0x398ee4(0x97))/0x1*(-parseInt(_0x398ee4(0x9a))/0x2)+-parseInt(_0x398ee4(0x9d))/0x3+parseInt(_0x398ee4(0xa0))/0x4*(-parseInt(_0x398ee4(0xa9))/0x5)+parseInt(_0x398ee4(0x9f))/0x6+-parseInt(_0x398ee4(0xa3))/0x7+parseInt(_0x398ee4(0x96))/0x8+parseInt(_0x398ee4(0x98))/0x9*(parseInt(_0x398ee4(0x99))/0xa);if(_0x4e5fef===_0x56a141)break;else _0x3b7c12['push'](_0x3b7c12['shift']());}catch(_0x21c6d5){_0x3b7c12['push'](_0x3b7c12['shift']());}}}(a126_0x4693,0x2bdee));import{TDApiClient}from'./client/td-api-client.js';import{loadCachedUsers,saveCachedUsers,clearUserCache}from'../core/user-cache.js';export class UserSDK{[a126_0x482005(0xa5)];[a126_0x482005(0x9c)];constructor(_0x400377){const _0x251b1b=a126_0x482005;this[_0x251b1b(0xa5)]=new TDApiClient(_0x400377,_0x400377[_0x251b1b(0xa7)]),this[_0x251b1b(0x9c)]=_0x400377[_0x251b1b(0x9c)]||_0x251b1b(0xa8);}async[a126_0x482005(0x92)](){const _0x5f1c1e=a126_0x482005;return await this['client'][_0x5f1c1e(0xaa)]();}async[a126_0x482005(0x94)](_0x5c9f72=![]){const _0x5e3d73=a126_0x482005;if(!_0x5c9f72){const _0x4bda20=loadCachedUsers(this[_0x5e3d73(0x9c)]);if(_0x4bda20)return _0x4bda20;}const _0xf31f5e=await this['client']['listUsers']();return saveCachedUsers(this['profile'],_0xf31f5e),_0xf31f5e;}[a126_0x482005(0x9b)](){clearUserCache(this['profile']);}async[a126_0x482005(0x93)](_0x3b6849){const _0x547a60=a126_0x482005,_0x20af29=await this[_0x547a60(0x94)]();return _0x20af29[_0x547a60(0xa1)](_0x94a0ad=>_0x94a0ad[_0x547a60(0x9e)][_0x547a60(0x91)]()===_0x3b6849['toLowerCase']());}async[a126_0x482005(0xa4)](_0x32e9b4){const _0x1cc0f7=a126_0x482005,_0x2c070a=await this[_0x1cc0f7(0x94)]();return _0x2c070a[_0x1cc0f7(0xa1)](_0x5edcee=>_0x5edcee['id']===_0x32e9b4);}async[a126_0x482005(0x95)](){const _0x1c5213=a126_0x482005,_0xc341fa=await this[_0x1c5213(0x94)]();return new Map(_0xc341fa[_0x1c5213(0xa6)](_0xa20751=>[_0xa20751['email'][_0x1c5213(0x91)](),_0xa20751['id']]));}async[a126_0x482005(0xa2)](){const _0x35340a=a126_0x482005,_0x18d151=await this['list']();return new Map(_0x18d151[_0x35340a(0xa6)](_0x5b64a0=>[_0x5b64a0['id'],_0x5b64a0[_0x35340a(0x9e)]]));}async['buildUserMaps'](){const _0x5a9934=a126_0x482005,_0xa19189=await this[_0x5a9934(0x94)]();return{'emailToId':new Map(_0xa19189['map'](_0x146d81=>[_0x146d81[_0x5a9934(0x9e)][_0x5a9934(0x91)](),_0x146d81['id']])),'idToEmail':new Map(_0xa19189[_0x5a9934(0xa6)](_0x3dc55e=>[_0x3dc55e['id'],_0x3dc55e[_0x5a9934(0x9e)]]))};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a127_0x14d5(_0x21083a,_0x961470){_0x21083a=_0x21083a-0x1a0;const _0x2d226b=a127_0x2d22();let _0x14d5b5=_0x2d226b[_0x21083a];return _0x14d5b5;}(function(_0x31c6f7,_0x46fd02){const _0x4eaa3b=a127_0x14d5,_0x126d4e=_0x31c6f7();while(!![]){try{const _0x54be6d=-parseInt(_0x4eaa3b(0x1ae))/0x1*(-parseInt(_0x4eaa3b(0x1a7))/0x2)+parseInt(_0x4eaa3b(0x1a6))/0x3+-parseInt(_0x4eaa3b(0x1a4))/0x4+parseInt(_0x4eaa3b(0x1ac))/0x5*(-parseInt(_0x4eaa3b(0x1ad))/0x6)+parseInt(_0x4eaa3b(0x1a0))/0x7+-parseInt(_0x4eaa3b(0x1a1))/0x8+parseInt(_0x4eaa3b(0x1a5))/0x9;if(_0x54be6d===_0x46fd02)break;else _0x126d4e['push'](_0x126d4e['shift']());}catch(_0x16f382){_0x126d4e['push'](_0x126d4e['shift']());}}}(a127_0x2d22,0x3c07e));function a127_0x2d22(){const _0x66086f=['table','toLowerCase','pop','1043091LoXJtZ','62408zUYuTv','text','json','1725576HoFfIc','3528567IuIZSv','1113579kzsPjw','6XqhWae','txt','tab','tsv','split','899410KMhcaK','12gJdqXh','44192fmRJtD'];a127_0x2d22=function(){return _0x66086f;};return a127_0x2d22();}export function detectFormatFromExtension(_0xb6aeaf){const _0x2e11c2=a127_0x14d5,_0x58be09=_0xb6aeaf[_0x2e11c2(0x1b0)]()[_0x2e11c2(0x1ab)]('.')[_0x2e11c2(0x1b1)]();switch(_0x58be09){case _0x2e11c2(0x1a3):return _0x2e11c2(0x1a3);case'jsonl':return'jsonl';case _0x2e11c2(0x1aa):case _0x2e11c2(0x1a9):return _0x2e11c2(0x1aa);case _0x2e11c2(0x1a8):case _0x2e11c2(0x1a2):return _0x2e11c2(0x1af);default:return undefined;}}export function resolveOutputFormat(_0x52b250,_0x2d128f,_0x460ea0){if(_0x52b250)return _0x52b250;if(_0x2d128f){const _0x57d348=detectFormatFromExtension(_0x2d128f);if(_0x57d348)return _0x57d348;}return _0x460ea0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a128_0x15c0(){const _0x58eae5=['repeat','startsWith','slice','reduce','4824GAhDMA','length','99704ZsHgdB','boolean','No\x20rows\x20returned','4748zIllZB','toISOString','log','name','number','push','toString','max','join','stringify','3260MynpuP','pow','2153664eftJzq','\x20rows\x20(','2709mHBjmp','json','toLowerCase','1065eONrNh','table','true','string','false','forEach','\x20shown)','array','\x1b]8;;','entries','\x20row','timestamp','0\x20B','stdout','row','1367096SzqNia','replace','substring','bool','long','data','map','15818oYLXsC','30GrJwyo','16782wXiFse','jsonl','date','min','floor','columns','\x1b]8;;\x07'];a128_0x15c0=function(){return _0x58eae5;};return a128_0x15c0();}(function(_0x14a91f,_0x4ec126){const _0x58a136=a128_0x41ea,_0x25efcf=_0x14a91f();while(!![]){try{const _0x24187d=parseInt(_0x58a136(0xc3))/0x1+parseInt(_0x58a136(0xee))/0x2*(parseInt(_0x58a136(0xef))/0x3)+parseInt(_0x58a136(0xc6))/0x4*(-parseInt(_0x58a136(0xd7))/0x5)+parseInt(_0x58a136(0xc1))/0x6*(parseInt(_0x58a136(0xd4))/0x7)+parseInt(_0x58a136(0xe6))/0x8+parseInt(_0x58a136(0xd2))/0x9+-parseInt(_0x58a136(0xd0))/0xa*(parseInt(_0x58a136(0xed))/0xb);if(_0x24187d===_0x4ec126)break;else _0x25efcf['push'](_0x25efcf['shift']());}catch(_0xc3be3f){_0x25efcf['push'](_0x25efcf['shift']());}}}(a128_0x15c0,0x2cc1e));import{centerAlign,stringWidth,padEnd,padStart}from'../../utils/string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../../utils/colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function a128_0x41ea(_0x298344,_0x5655cf){_0x298344=_0x298344-0xb8;const _0x15c0fa=a128_0x15c0();let _0x41eaec=_0x15c0fa[_0x298344];return _0x41eaec;}function getTerminalWidth(){const _0x107747=a128_0x41ea;return process['stdout'][_0x107747(0xbb)]||Infinity;}export function formatAsTable(_0x1826b2,_0x25e83e=DEFAULT_MAX_DISPLAY_ROWS,_0x124cea=![],_0x48a847={}){const _0x2bb49c=a128_0x41ea;if(_0x1826b2[_0x2bb49c(0xeb)][_0x2bb49c(0xc2)]===0x0)return _0x2bb49c(0xc5);const _0x1bc641=_0x1826b2[_0x2bb49c(0xbb)]['map'](_0x1362d0=>_0x1362d0[_0x2bb49c(0xc9)]),_0x51d306=_0x1826b2[_0x2bb49c(0xbb)][_0x2bb49c(0xec)](_0x49e48c=>simplifyType(_0x49e48c['type'])),_0x2b575f=_0x1826b2[_0x2bb49c(0xeb)][_0x2bb49c(0xbf)](0x0,_0x25e83e),_0x30d5e2=_0x1826b2[_0x2bb49c(0xeb)]['length'],_0x4efa60=_0x30d5e2>_0x25e83e,_0x3002ba=[],_0x451dfa=getTerminalWidth(),_0xe19a36=_0x451dfa!==Infinity,_0x573301=0x32;let _0x27d36c=_0x1bc641[_0x2bb49c(0xec)]((_0x5c95d6,_0x22d8fc)=>{const _0x39d1e7=_0x2bb49c,_0x986e6=stringWidth(_0x51d306[_0x22d8fc]),_0x55efb7=Math[_0x39d1e7(0xcd)](..._0x2b575f[_0x39d1e7(0xec)](_0x5aa4c2=>{const _0x2e5366=_0x5aa4c2[_0x5c95d6];return stringWidth(formatValue(_0x2e5366));})),_0x593332=Math[_0x39d1e7(0xcd)](stringWidth(_0x5c95d6),_0x986e6,_0x55efb7);return _0x124cea?_0x593332:Math[_0x39d1e7(0xb9)](_0x593332,_0x573301);});if(_0xe19a36&&!_0x124cea&&_0x1bc641[_0x2bb49c(0xc2)]>0x0){const _0x4d5a6d=_0x1ae786=>{let _0x32293c=0x1;for(const _0x52e10b of _0x1ae786){_0x32293c+=_0x52e10b+0x3;}return _0x32293c+0x1;};let _0x21d811=_0x4d5a6d(_0x27d36c);if(_0x21d811>_0x451dfa){const _0x5b3b24=0x3;for(let _0x47b3c6=_0x27d36c[_0x2bb49c(0xc2)]-0x1;_0x47b3c6>=0x0;_0x47b3c6--){_0x21d811=_0x4d5a6d(_0x27d36c);if(_0x21d811<=_0x451dfa)break;const _0x21c86e=_0x27d36c[_0x47b3c6],_0x1acbdd=_0x21d811-_0x451dfa,_0xdc5617=_0x21c86e-_0x5b3b24,_0x136156=Math['min'](_0x1acbdd,_0xdc5617);_0x136156>0x0&&(_0x27d36c[_0x47b3c6]=_0x21c86e-_0x136156);}}}const _0x560095=_0x1bc641,_0x49532d=_0x51d306,_0x1d3475=_0x27d36c,_0xef1e8e=_0x27d36c;_0x3002ba[_0x2bb49c(0xcb)](colorBorder('┌'+_0xef1e8e[_0x2bb49c(0xec)](_0x150503=>'─'[_0x2bb49c(0xbd)](_0x150503+0x2))[_0x2bb49c(0xce)]('┬')+'┐',_0x48a847));const _0x4bd124=_0x560095[_0x2bb49c(0xec)]((_0x5ec2e5,_0x4ed105)=>centerAlign(_0x5ec2e5,_0x1d3475[_0x4ed105]));_0x3002ba[_0x2bb49c(0xcb)](colorBorder('│',_0x48a847)+'\x20'+_0x4bd124['join']('\x20'+colorBorder('│',_0x48a847)+'\x20')+'\x20'+colorBorder('│',_0x48a847));const _0xfcb125=_0x49532d[_0x2bb49c(0xec)]((_0x3ba623,_0x4890be)=>colorType(centerAlign(_0x3ba623,_0x1d3475[_0x4890be]),_0x48a847));_0x3002ba[_0x2bb49c(0xcb)](colorBorder('│',_0x48a847)+'\x20'+_0xfcb125[_0x2bb49c(0xce)]('\x20'+colorBorder('│',_0x48a847)+'\x20')+'\x20'+colorBorder('│',_0x48a847)),_0x3002ba[_0x2bb49c(0xcb)](colorBorder('├'+_0xef1e8e['map'](_0x7d7d62=>'─'[_0x2bb49c(0xbd)](_0x7d7d62+0x2))[_0x2bb49c(0xce)]('┼')+'┤',_0x48a847));const _0x1a4009=(_0xf1face,_0x29100a)=>{const _0x1dfa78=_0x2bb49c,_0x252222=stringWidth(_0xf1face);if(_0x252222<=_0x29100a)return _0xf1face;let _0xb5ade4=_0xf1face;while(stringWidth(_0xb5ade4+'…')>_0x29100a&&_0xb5ade4[_0x1dfa78(0xc2)]>0x0){_0xb5ade4=_0xb5ade4[_0x1dfa78(0xbf)](0x0,-0x1);}return _0xb5ade4+'…';};_0x2b575f[_0x2bb49c(0xdc)](_0x4269cf=>{const _0x292449=_0x2bb49c,_0x503c16=_0x1bc641[_0x292449(0xec)]((_0x4acd5f,_0x539825)=>{const _0x474f1c=_0x292449,_0x16519f=_0x4269cf[_0x4acd5f],_0x15a9eb=formatValue(_0x16519f),_0x4c1f6f=_0x1d3475[_0x539825],_0x2fe447=_0x1a4009(_0x15a9eb,_0x4c1f6f),_0x1571dc=typeof _0x16519f===_0x474f1c(0xca)||typeof _0x16519f==='string'&&/^-?\d+$/['test'](_0x16519f);return _0x1571dc?padStart(_0x2fe447,_0x4c1f6f):padEnd(_0x2fe447,_0x4c1f6f);});_0x3002ba['push'](colorBorder('│',_0x48a847)+'\x20'+_0x503c16[_0x292449(0xce)]('\x20'+colorBorder('│',_0x48a847)+'\x20')+'\x20'+colorBorder('│',_0x48a847));});const _0x438f61=_0xef1e8e[_0x2bb49c(0xc0)]((_0x54df3a,_0x517867)=>_0x54df3a+_0x517867+0x3,-0x1);_0x3002ba[_0x2bb49c(0xcb)](colorBorder('├'+_0xef1e8e[_0x2bb49c(0xec)](_0x2e3c60=>'─'[_0x2bb49c(0xbd)](_0x2e3c60+0x2))[_0x2bb49c(0xce)]('┴')+'┤',_0x48a847));let _0x353bf7;_0x4efa60?_0x353bf7=_0x30d5e2+_0x2bb49c(0xd3)+_0x25e83e+_0x2bb49c(0xdd):_0x353bf7=_0x30d5e2+_0x2bb49c(0xe1)+(_0x30d5e2===0x1?'':'s');const _0x3487d6=_0x353bf7['padEnd'](_0x438f61-0x2);return _0x3002ba[_0x2bb49c(0xcb)](colorBorder('│',_0x48a847)+'\x20'+_0x3487d6+'\x20'+colorBorder('│',_0x48a847)),_0x3002ba[_0x2bb49c(0xcb)](colorBorder('└'+'─'[_0x2bb49c(0xbd)](_0x438f61)+'┘',_0x48a847)),_0x3002ba[_0x2bb49c(0xce)]('\x0a');}function simplifyType(_0x5a421e){const _0x109e22=a128_0x41ea,_0x4a1ae4={'varchar':_0x109e22(0xda),'bigint':_0x109e22(0xea),'integer':'int','double':'double','boolean':_0x109e22(0xe9),'date':_0x109e22(0xb8),'timestamp':_0x109e22(0xe2),'array':_0x109e22(0xde),'map':_0x109e22(0xec),'row':_0x109e22(0xe5)},_0x70b724=_0x5a421e[_0x109e22(0xd6)]();for(const [_0x3d262d,_0x1923b8]of Object[_0x109e22(0xe0)](_0x4a1ae4)){if(_0x70b724[_0x109e22(0xbe)](_0x3d262d))return _0x1923b8;}return _0x5a421e[_0x109e22(0xc2)]>0xa?_0x5a421e[_0x109e22(0xe8)](0x0,0xa):_0x5a421e;}export function formatAsJSON(_0x197003,_0x120b04={}){const _0xf2b3eb=a128_0x41ea;if(_0x197003[_0xf2b3eb(0xeb)]['length']===0x0)return'[]';if(shouldUseColor(_0x120b04))return colorizeJSON(_0x197003[_0xf2b3eb(0xeb)],_0x120b04);const _0x4a9420=_0x197003['data'][_0xf2b3eb(0xec)](_0x3dc0d6=>'\x20\x20'+JSON[_0xf2b3eb(0xcf)](_0x3dc0d6));return'[\x0a'+_0x4a9420[_0xf2b3eb(0xce)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x3ef34e,_0x1d089d={}){const _0x32e57a=a128_0x41ea;if(_0x3ef34e[_0x32e57a(0xeb)][_0x32e57a(0xc2)]===0x0)return'';if(shouldUseColor(_0x1d089d))return _0x3ef34e[_0x32e57a(0xeb)]['map'](_0x4355fa=>colorizeJSONCompact(_0x4355fa,_0x1d089d))[_0x32e57a(0xce)]('\x0a');return _0x3ef34e['data'][_0x32e57a(0xec)](_0x49c1be=>JSON['stringify'](_0x49c1be))[_0x32e57a(0xce)]('\x0a');}export function formatAsTSV(_0x1b80be){const _0x132f96=a128_0x41ea;if(_0x1b80be[_0x132f96(0xeb)]['length']===0x0)return'';const _0x6a597=[],_0x1996cb=_0x1b80be['columns'][_0x132f96(0xec)](_0x13f225=>_0x13f225['name']);return _0x6a597['push'](_0x1996cb['join']('\x09')),_0x1b80be[_0x132f96(0xeb)][_0x132f96(0xdc)](_0x5d894a=>{const _0x3f7ae1=_0x132f96,_0xeb3e11=_0x1996cb[_0x3f7ae1(0xec)](_0x3a6105=>{const _0x37e62e=_0x5d894a[_0x3a6105];return formatValueForTSV(_0x37e62e);});_0x6a597[_0x3f7ae1(0xcb)](_0xeb3e11[_0x3f7ae1(0xce)]('\x09'));}),_0x6a597[_0x132f96(0xce)]('\x0a');}function formatValue(_0x4c85c6){const _0x51f1a9=a128_0x41ea;if(_0x4c85c6===null||_0x4c85c6===undefined)return'';if(typeof _0x4c85c6===_0x51f1a9(0xda)){const _0x4ef6f4=_0x4c85c6[_0x51f1a9(0xe7)](/\n/g,'\x5cn')[_0x51f1a9(0xe7)](/\r/g,'\x5cr')[_0x51f1a9(0xe7)](/\t/g,'\x5ct');return _0x4ef6f4;}if(typeof _0x4c85c6==='number')return String(_0x4c85c6);if(typeof _0x4c85c6===_0x51f1a9(0xc4))return _0x4c85c6?_0x51f1a9(0xd9):_0x51f1a9(0xdb);if(_0x4c85c6 instanceof Date)return _0x4c85c6[_0x51f1a9(0xc7)]();if(typeof _0x4c85c6==='object')return JSON['stringify'](_0x4c85c6);return String(_0x4c85c6);}function formatValueForTSV(_0x41145e){const _0x124c8a=a128_0x41ea;if(_0x41145e===null||_0x41145e===undefined)return'';if(typeof _0x41145e===_0x124c8a(0xda))return _0x41145e[_0x124c8a(0xe7)](/\t/g,'\x5ct')[_0x124c8a(0xe7)](/\n/g,'\x5cn');if(typeof _0x41145e===_0x124c8a(0xca)||typeof _0x41145e===_0x124c8a(0xc4))return String(_0x41145e);if(_0x41145e instanceof Date)return _0x41145e[_0x124c8a(0xc7)]();if(typeof _0x41145e==='object')return JSON[_0x124c8a(0xcf)](_0x41145e);return String(_0x41145e);}export function formatQueryResult(_0x125601,_0x45d904){const _0x57c703=a128_0x41ea;switch(_0x45d904){case _0x57c703(0xd8):return formatAsTable(_0x125601);case _0x57c703(0xd5):return formatAsJSON(_0x125601);case _0x57c703(0xf0):return formatAsJSONL(_0x125601);case'tsv':return formatAsTSV(_0x125601);default:return formatAsJSON(_0x125601);}}export function formatBytes(_0x3d6b90){const _0x28390f=a128_0x41ea;if(_0x3d6b90===0x0)return _0x28390f(0xe3);const _0x43f11c=['B','KB','MB','GB','TB'],_0x1b8ca9=0x400,_0x448890=Math['floor'](Math[_0x28390f(0xc8)](_0x3d6b90)/Math['log'](_0x1b8ca9)),_0x4fb770=_0x3d6b90/Math[_0x28390f(0xd1)](_0x1b8ca9,_0x448890),_0x4a7486=_0x4fb770>=0xa?0x1:0x2;return _0x4fb770['toFixed'](_0x4a7486)+'\x20'+_0x43f11c[_0x448890];}export function formatRows(_0x3c17eb){const _0x7d74f=a128_0x41ea;if(_0x3c17eb==null)return'-';if(_0x3c17eb===0x0)return'0';if(_0x3c17eb<0x3e8)return _0x3c17eb[_0x7d74f(0xcc)]();const _0x528fc5=['','K','M','B','T'],_0x195b42=0x3e8,_0x28ec1f=Math[_0x7d74f(0xba)](Math[_0x7d74f(0xc8)](_0x3c17eb)/Math[_0x7d74f(0xc8)](_0x195b42)),_0x3e566b=_0x3c17eb/Math[_0x7d74f(0xd1)](_0x195b42,_0x28ec1f),_0x2cf107=_0x3e566b>=0xa?0x1:0x2;return''+_0x3e566b['toFixed'](_0x2cf107)+_0x528fc5[_0x28ec1f];}export function hyperlink(_0x2b36c3,_0x38df56){const _0x218672=a128_0x41ea;if(!process[_0x218672(0xe4)]['isTTY'])return _0x2b36c3;return _0x218672(0xdf)+_0x38df56+'\x07'+_0x2b36c3+_0x218672(0xbc);}
|
|
1
|
+
(function(_0x53de2c,_0x3a31a2){const _0x5f59cb=a128_0x5fa5,_0x3f9690=_0x53de2c();while(!![]){try{const _0x444516=parseInt(_0x5f59cb(0x196))/0x1*(parseInt(_0x5f59cb(0x1a9))/0x2)+-parseInt(_0x5f59cb(0x1ac))/0x3+parseInt(_0x5f59cb(0x195))/0x4*(parseInt(_0x5f59cb(0x1af))/0x5)+-parseInt(_0x5f59cb(0x1bc))/0x6*(-parseInt(_0x5f59cb(0x18e))/0x7)+-parseInt(_0x5f59cb(0x1bf))/0x8*(parseInt(_0x5f59cb(0x1a1))/0x9)+parseInt(_0x5f59cb(0x1b6))/0xa*(parseInt(_0x5f59cb(0x1ad))/0xb)+parseInt(_0x5f59cb(0x1b1))/0xc*(-parseInt(_0x5f59cb(0x1b2))/0xd);if(_0x444516===_0x3a31a2)break;else _0x3f9690['push'](_0x3f9690['shift']());}catch(_0x45afe4){_0x3f9690['push'](_0x3f9690['shift']());}}}(a128_0x5ad9,0xb38a8));import{centerAlign,stringWidth,padEnd,padStart}from'../../utils/string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../../utils/colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){return process['stdout']['columns']||Infinity;}export function formatAsTable(_0x256b96,_0x460fcd=DEFAULT_MAX_DISPLAY_ROWS,_0x37065f=![],_0x402e67={}){const _0x2e0227=a128_0x5fa5;if(_0x256b96['data'][_0x2e0227(0x1a2)]===0x0)return _0x2e0227(0x1b5);const _0x2ae846=_0x256b96[_0x2e0227(0x1ba)][_0x2e0227(0x198)](_0x4dd56e=>_0x4dd56e['name']),_0x3140ff=_0x256b96[_0x2e0227(0x1ba)]['map'](_0x30e5cf=>simplifyType(_0x30e5cf[_0x2e0227(0x1a6)])),_0x57b05d=_0x256b96[_0x2e0227(0x19e)][_0x2e0227(0x1b7)](0x0,_0x460fcd),_0xc8ec9f=_0x256b96[_0x2e0227(0x19e)][_0x2e0227(0x1a2)],_0x30f595=_0xc8ec9f>_0x460fcd,_0x2a34b1=[],_0x51e5b7=getTerminalWidth(),_0x5725d0=_0x51e5b7!==Infinity,_0x36b476=0x32;let _0x1171c0=_0x2ae846[_0x2e0227(0x198)]((_0x590e0e,_0x38421f)=>{const _0x383b31=stringWidth(_0x3140ff[_0x38421f]),_0x7e9604=Math['max'](..._0x57b05d['map'](_0x2f50d1=>{const _0x109a5e=_0x2f50d1[_0x590e0e];return stringWidth(formatValue(_0x109a5e));})),_0x4ae86d=Math['max'](stringWidth(_0x590e0e),_0x383b31,_0x7e9604);return _0x37065f?_0x4ae86d:Math['min'](_0x4ae86d,_0x36b476);});if(_0x5725d0&&!_0x37065f&&_0x2ae846[_0x2e0227(0x1a2)]>0x0){const _0x5f5984=_0x32e9ae=>{let _0x1b637a=0x1;for(const _0x137bee of _0x32e9ae){_0x1b637a+=_0x137bee+0x3;}return _0x1b637a+0x1;};let _0x3c4f7c=_0x5f5984(_0x1171c0);if(_0x3c4f7c>_0x51e5b7){const _0x1f17a1=0x3;for(let _0x29f456=_0x1171c0[_0x2e0227(0x1a2)]-0x1;_0x29f456>=0x0;_0x29f456--){_0x3c4f7c=_0x5f5984(_0x1171c0);if(_0x3c4f7c<=_0x51e5b7)break;const _0x414d87=_0x1171c0[_0x29f456],_0x241f5c=_0x3c4f7c-_0x51e5b7,_0x580c9d=_0x414d87-_0x1f17a1,_0x3dac38=Math['min'](_0x241f5c,_0x580c9d);_0x3dac38>0x0&&(_0x1171c0[_0x29f456]=_0x414d87-_0x3dac38);}}}const _0x2a38ed=_0x2ae846,_0x47ef3d=_0x3140ff,_0x3d91b5=_0x1171c0,_0x501bce=_0x1171c0;_0x2a34b1[_0x2e0227(0x1a3)](colorBorder('┌'+_0x501bce[_0x2e0227(0x198)](_0x42a753=>'─'[_0x2e0227(0x191)](_0x42a753+0x2))[_0x2e0227(0x197)]('┬')+'┐',_0x402e67));const _0x267b04=_0x2a38ed[_0x2e0227(0x198)]((_0xb16ff3,_0x501d5a)=>centerAlign(_0xb16ff3,_0x3d91b5[_0x501d5a]));_0x2a34b1['push'](colorBorder('│',_0x402e67)+'\x20'+_0x267b04[_0x2e0227(0x197)]('\x20'+colorBorder('│',_0x402e67)+'\x20')+'\x20'+colorBorder('│',_0x402e67));const _0x51db6c=_0x47ef3d[_0x2e0227(0x198)]((_0x12dc11,_0x4c1e81)=>colorType(centerAlign(_0x12dc11,_0x3d91b5[_0x4c1e81]),_0x402e67));_0x2a34b1[_0x2e0227(0x1a3)](colorBorder('│',_0x402e67)+'\x20'+_0x51db6c['join']('\x20'+colorBorder('│',_0x402e67)+'\x20')+'\x20'+colorBorder('│',_0x402e67)),_0x2a34b1[_0x2e0227(0x1a3)](colorBorder('├'+_0x501bce['map'](_0x493c7f=>'─'[_0x2e0227(0x191)](_0x493c7f+0x2))[_0x2e0227(0x197)]('┼')+'┤',_0x402e67));const _0x234c05=(_0x2b8f0b,_0x49e97f)=>{const _0x4588de=_0x2e0227,_0xda4cc1=stringWidth(_0x2b8f0b);if(_0xda4cc1<=_0x49e97f)return _0x2b8f0b;let _0x24ba96=_0x2b8f0b;while(stringWidth(_0x24ba96+'…')>_0x49e97f&&_0x24ba96[_0x4588de(0x1a2)]>0x0){_0x24ba96=_0x24ba96[_0x4588de(0x1b7)](0x0,-0x1);}return _0x24ba96+'…';};_0x57b05d[_0x2e0227(0x1a5)](_0x4da678=>{const _0x32a97e=_0x2e0227,_0x8d6523=_0x2ae846[_0x32a97e(0x198)]((_0x51b70e,_0x4a4f19)=>{const _0x794cd5=_0x32a97e,_0x18fce6=_0x4da678[_0x51b70e],_0xff666f=formatValue(_0x18fce6),_0x4f3535=_0x3d91b5[_0x4a4f19],_0x3c7799=_0x234c05(_0xff666f,_0x4f3535),_0x161649=typeof _0x18fce6==='number'||typeof _0x18fce6===_0x794cd5(0x19d)&&/^-?\d+$/[_0x794cd5(0x193)](_0x18fce6);return _0x161649?padStart(_0x3c7799,_0x4f3535):padEnd(_0x3c7799,_0x4f3535);});_0x2a34b1[_0x32a97e(0x1a3)](colorBorder('│',_0x402e67)+'\x20'+_0x8d6523[_0x32a97e(0x197)]('\x20'+colorBorder('│',_0x402e67)+'\x20')+'\x20'+colorBorder('│',_0x402e67));});const _0x628be5=_0x501bce[_0x2e0227(0x1c1)]((_0xde1475,_0x127a09)=>_0xde1475+_0x127a09+0x3,-0x1);_0x2a34b1[_0x2e0227(0x1a3)](colorBorder('├'+_0x501bce[_0x2e0227(0x198)](_0x164c77=>'─'[_0x2e0227(0x191)](_0x164c77+0x2))[_0x2e0227(0x197)]('┴')+'┤',_0x402e67));let _0x2ff5b6;_0x30f595?_0x2ff5b6=_0xc8ec9f+'\x20rows\x20('+_0x460fcd+_0x2e0227(0x1a8):_0x2ff5b6=_0xc8ec9f+'\x20row'+(_0xc8ec9f===0x1?'':'s');const _0x26a5f1=_0x2ff5b6[_0x2e0227(0x1b3)](_0x628be5-0x2);return _0x2a34b1[_0x2e0227(0x1a3)](colorBorder('│',_0x402e67)+'\x20'+_0x26a5f1+'\x20'+colorBorder('│',_0x402e67)),_0x2a34b1['push'](colorBorder('└'+'─'[_0x2e0227(0x191)](_0x628be5)+'┘',_0x402e67)),_0x2a34b1['join']('\x0a');}function simplifyType(_0x58ad1b){const _0x31e1d9=a128_0x5fa5,_0x4c098f={'varchar':'string','bigint':_0x31e1d9(0x1ab),'integer':'int','double':_0x31e1d9(0x194),'boolean':_0x31e1d9(0x19a),'date':_0x31e1d9(0x1a0),'timestamp':_0x31e1d9(0x1c0),'array':'array','map':_0x31e1d9(0x198),'row':_0x31e1d9(0x1b8)},_0x5eb8e8=_0x58ad1b['toLowerCase']();for(const [_0x2bbf1f,_0x149823]of Object['entries'](_0x4c098f)){if(_0x5eb8e8[_0x31e1d9(0x1be)](_0x2bbf1f))return _0x149823;}return _0x58ad1b[_0x31e1d9(0x1a2)]>0xa?_0x58ad1b[_0x31e1d9(0x19b)](0x0,0xa):_0x58ad1b;}export function formatAsJSON(_0x566680,_0x5b85a6={}){const _0x3e1776=a128_0x5fa5;if(_0x566680[_0x3e1776(0x19e)]['length']===0x0)return'[]';if(shouldUseColor(_0x5b85a6))return colorizeJSON(_0x566680[_0x3e1776(0x19e)],_0x5b85a6);const _0x48609f=_0x566680[_0x3e1776(0x19e)]['map'](_0x3a8714=>'\x20\x20'+JSON[_0x3e1776(0x1bd)](_0x3a8714));return'[\x0a'+_0x48609f[_0x3e1776(0x197)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x31a96c,_0x58c466={}){const _0x4f4854=a128_0x5fa5;if(_0x31a96c['data'][_0x4f4854(0x1a2)]===0x0)return'';if(shouldUseColor(_0x58c466))return _0x31a96c[_0x4f4854(0x19e)]['map'](_0x136b1a=>colorizeJSONCompact(_0x136b1a,_0x58c466))['join']('\x0a');return _0x31a96c['data'][_0x4f4854(0x198)](_0x1a91cc=>JSON[_0x4f4854(0x1bd)](_0x1a91cc))[_0x4f4854(0x197)]('\x0a');}export function formatAsTSV(_0x19b1e6){const _0x56df2=a128_0x5fa5;if(_0x19b1e6[_0x56df2(0x19e)]['length']===0x0)return'';const _0x44f8d8=[],_0x4e607d=_0x19b1e6[_0x56df2(0x1ba)]['map'](_0x33e5e1=>_0x33e5e1[_0x56df2(0x18d)]);return _0x44f8d8[_0x56df2(0x1a3)](_0x4e607d[_0x56df2(0x197)]('\x09')),_0x19b1e6[_0x56df2(0x19e)]['forEach'](_0x14c38b=>{const _0xfb4c64=_0x56df2,_0x149c9f=_0x4e607d[_0xfb4c64(0x198)](_0x1f7277=>{const _0x5582b4=_0x14c38b[_0x1f7277];return formatValueForTSV(_0x5582b4);});_0x44f8d8[_0xfb4c64(0x1a3)](_0x149c9f[_0xfb4c64(0x197)]('\x09'));}),_0x44f8d8[_0x56df2(0x197)]('\x0a');}function formatValue(_0x380682){const _0x2a9e12=a128_0x5fa5;if(_0x380682===null||_0x380682===undefined)return'';if(typeof _0x380682===_0x2a9e12(0x19d)){const _0x319ce3=_0x380682[_0x2a9e12(0x1a4)](/\n/g,'\x5cn')[_0x2a9e12(0x1a4)](/\r/g,'\x5cr')['replace'](/\t/g,'\x5ct');return _0x319ce3;}if(typeof _0x380682===_0x2a9e12(0x199))return String(_0x380682);if(typeof _0x380682===_0x2a9e12(0x1b4))return _0x380682?_0x2a9e12(0x19f):_0x2a9e12(0x1a7);if(_0x380682 instanceof Date)return _0x380682[_0x2a9e12(0x1b9)]();if(typeof _0x380682===_0x2a9e12(0x192))return JSON[_0x2a9e12(0x1bd)](_0x380682);return String(_0x380682);}function formatValueForTSV(_0x3145b4){const _0x544fd4=a128_0x5fa5;if(_0x3145b4===null||_0x3145b4===undefined)return'';if(typeof _0x3145b4===_0x544fd4(0x19d))return _0x3145b4[_0x544fd4(0x1a4)](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x3145b4===_0x544fd4(0x199)||typeof _0x3145b4===_0x544fd4(0x1b4))return String(_0x3145b4);if(_0x3145b4 instanceof Date)return _0x3145b4['toISOString']();if(typeof _0x3145b4===_0x544fd4(0x192))return JSON[_0x544fd4(0x1bd)](_0x3145b4);return String(_0x3145b4);}function a128_0x5ad9(){const _0x322328=['reduce','name','28jyZXLB','\x1b]8;;','tsv','repeat','object','test','double','2806516IVhCeC','1gqTnvu','join','map','number','bool','substring','\x1b]8;;\x07','string','data','true','date','240129XOKxPQ','length','push','replace','forEach','type','false','\x20shown)','1091874eHxyrD','jsonl','long','586359WKhSGF','11TQbhSU','pow','10KIpiKV','floor','836784Gzkgqa','52TXsxic','padEnd','boolean','No\x20rows\x20returned','5575030RcNIMf','slice','row','toISOString','columns','log','175764WuEeil','stringify','startsWith','424cvxexy','timestamp'];a128_0x5ad9=function(){return _0x322328;};return a128_0x5ad9();}export function formatQueryResult(_0x56f8fd,_0x3558d3){const _0x7d6661=a128_0x5fa5;switch(_0x3558d3){case'table':return formatAsTable(_0x56f8fd);case'json':return formatAsJSON(_0x56f8fd);case _0x7d6661(0x1aa):return formatAsJSONL(_0x56f8fd);case _0x7d6661(0x190):return formatAsTSV(_0x56f8fd);default:return formatAsJSON(_0x56f8fd);}}function a128_0x5fa5(_0x7749c4,_0x7be65c){_0x7749c4=_0x7749c4-0x18d;const _0x5ad94c=a128_0x5ad9();let _0x5fa550=_0x5ad94c[_0x7749c4];return _0x5fa550;}export function formatBytes(_0x5981c8){const _0x488f79=a128_0x5fa5;if(_0x5981c8===0x0)return'0\x20B';const _0x59fb6a=['B','KB','MB','GB','TB'],_0x382899=0x400,_0x14a3d7=Math[_0x488f79(0x1b0)](Math[_0x488f79(0x1bb)](_0x5981c8)/Math[_0x488f79(0x1bb)](_0x382899)),_0x66ca16=_0x5981c8/Math[_0x488f79(0x1ae)](_0x382899,_0x14a3d7),_0x310038=_0x66ca16>=0xa?0x1:0x2;return _0x66ca16['toFixed'](_0x310038)+'\x20'+_0x59fb6a[_0x14a3d7];}export function formatRows(_0x1a8f48){const _0x14b132=a128_0x5fa5;if(_0x1a8f48==null)return'-';if(_0x1a8f48===0x0)return'0';if(_0x1a8f48<0x3e8)return _0x1a8f48['toString']();const _0x1b4439=['','K','M','B','T'],_0x3da533=0x3e8,_0x5ab688=Math[_0x14b132(0x1b0)](Math['log'](_0x1a8f48)/Math['log'](_0x3da533)),_0x134fc3=_0x1a8f48/Math[_0x14b132(0x1ae)](_0x3da533,_0x5ab688),_0x2beaf6=_0x134fc3>=0xa?0x1:0x2;return''+_0x134fc3['toFixed'](_0x2beaf6)+_0x1b4439[_0x5ab688];}export function hyperlink(_0x4ff260,_0x6f9002){const _0x2b10b5=a128_0x5fa5;if(!process['stdout']['isTTY'])return _0x4ff260;return _0x2b10b5(0x18f)+_0x6f9002+'\x07'+_0x4ff260+_0x2b10b5(0x19c);}
|
package/dist/sdk/util/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x180895,_0x332ea6){var _0x5988e0=a129_0x5c1c,_0x56a6b8=_0x180895();while(!![]){try{var _0x467078=-parseInt(_0x5988e0(0x122))/0x1*(-parseInt(_0x5988e0(0x124))/0x2)+parseInt(_0x5988e0(0x129))/0x3*(-parseInt(_0x5988e0(0x126))/0x4)+parseInt(_0x5988e0(0x12a))/0x5+parseInt(_0x5988e0(0x125))/0x6+-parseInt(_0x5988e0(0x12b))/0x7+parseInt(_0x5988e0(0x128))/0x8+-parseInt(_0x5988e0(0x127))/0x9*(-parseInt(_0x5988e0(0x123))/0xa);if(_0x467078===_0x332ea6)break;else _0x56a6b8['push'](_0x56a6b8['shift']());}catch(_0x2215b0){_0x56a6b8['push'](_0x56a6b8['shift']());}}}(a129_0x39de,0xc2294));export*from'./formatters.js';function a129_0x39de(){var _0x2731a7=['13746910tpMiHt','2BXOrmC','2211372DjFPOa','9300tRvbUB','9yiAWCo','568184fKrvId','177vrGyDR','478200uNhZdp','10538668rrWSVU','528067XLcLHm'];a129_0x39de=function(){return _0x2731a7;};return a129_0x39de();}export*from'./format-detector.js';function a129_0x5c1c(_0x228bc9,_0x5a5f45){_0x228bc9=_0x228bc9-0x122;var _0x39de63=a129_0x39de();var _0x5c1c4e=_0x39de63[_0x228bc9];return _0x5c1c4e;}export*from'./tree-formatter.js';
|