@treasuredata/tdx 0.16.13 → 0.16.14
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/agent-test-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/mcp-command.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/status-command.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/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.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/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.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/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- 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/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a124_0xa3ffab=a124_0x360e;(function(_0x1286d5,_0x206ead){const _0x56dcd8=a124_0x360e,_0x455898=_0x1286d5();while(!![]){try{const _0x54e912=-parseInt(_0x56dcd8(0xf8))/0x1*(-parseInt(_0x56dcd8(0xf9))/0x2)+-parseInt(_0x56dcd8(0xeb))/0x3+parseInt(_0x56dcd8(0xf0))/0x4+-parseInt(_0x56dcd8(0xf5))/0x5+parseInt(_0x56dcd8(0xf3))/0x6*(-parseInt(_0x56dcd8(0xf4))/0x7)+-parseInt(_0x56dcd8(0xff))/0x8*(-parseInt(_0x56dcd8(0xe7))/0x9)+parseInt(_0x56dcd8(0xea))/0xa;if(_0x54e912===_0x206ead)break;else _0x455898['push'](_0x455898['shift']());}catch(_0x7ccbd1){_0x455898['push'](_0x455898['shift']());}}}(a124_0x54cd,0x92f39));import{readFileSync}from'fs';import*as a124_0x4f81d3 from'path';function a124_0x360e(_0x49c3c1,_0x2a7974){_0x49c3c1=_0x49c3c1-0xe4;const _0x54cd75=a124_0x54cd();let _0x360ec6=_0x54cd75[_0x49c3c1];return _0x360ec6;}import*as a124_0x527461 from'yaml';function a124_0x54cd(){const _0x2f1221=['parseDocument','object','segment','Failed\x20to\x20parse\x20YAML\x20file\x20(empty\x20or\x20invalid)','4184ssvsnU','journey','relative','utf-8','16398mOezGE','filterType','length','896310jWYiEP','1652109pplGjt','not\x20a\x20','map','error','type','3021476zRQxdP','YAML_PARSE_ERROR','YAML\x20parse\x20error:\x20','439260CpzFlW','63gpYYhW','4617620pQiVvQ','result','basename','468562WeLPdO','4tKcHhe','toJSON'];a124_0x54cd=function(){return _0x2f1221;};return a124_0x54cd();}import{validateSegmentDef,validateJourneyDef}from'./yaml-validator.js';export function isJourneyDef(_0x3f5605){const _0x1c3fc0=a124_0x360e;return typeof _0x3f5605===_0x1c3fc0(0xfc)&&_0x3f5605!==null&&_0x1c3fc0(0xef)in _0x3f5605&&_0x3f5605['type']===_0x1c3fc0(0xe4);}export function isValidationResult(_0x1fb3a0){return!('skipped'in _0x1fb3a0);}export function createParseErrorResult(_0x5a0ae9,_0x34261f,_0x298e94,_0x13e77b,_0x3b21e7=a124_0xa3ffab(0xfd)){const _0x523686=a124_0xa3ffab;return{'filePath':_0x5a0ae9,'relativePath':_0x34261f,'source':_0x298e94,'result':{'valid':![],'errors':[{'level':_0x523686(0xee),'path':'','code':_0x523686(0xf1),'message':_0x13e77b}],'warnings':[]},'fileType':_0x3b21e7};}export function validateYamlFile(_0x3a1114,_0x5e83cd,_0x24f792={}){const _0x14a9f6=a124_0xa3ffab,_0xb4443d=a124_0x4f81d3[_0x14a9f6(0xe5)](_0x5e83cd,_0x3a1114)||a124_0x4f81d3[_0x14a9f6(0xf7)](_0x3a1114);try{const _0x423869=readFileSync(_0x3a1114,_0x14a9f6(0xe6)),_0x5be22c=a124_0x527461[_0x14a9f6(0xfb)](_0x423869),_0x5779de=_0x5be22c[_0x14a9f6(0xfa)]();if(!_0x5779de)return createParseErrorResult(_0x3a1114,_0xb4443d,_0x423869,_0x14a9f6(0xfe));const _0x2c9c5d=isJourneyDef(_0x5779de)?'journey':_0x14a9f6(0xfd);if(_0x24f792[_0x14a9f6(0xe8)]&&_0x2c9c5d!==_0x24f792[_0x14a9f6(0xe8)])return{'filePath':_0x3a1114,'relativePath':_0xb4443d,'skipped':!![],'reason':_0x14a9f6(0xec)+_0x24f792[_0x14a9f6(0xe8)]};const _0x3a16f2={'source':_0x423869,'document':_0x5be22c},_0x28a990=_0x2c9c5d==='journey'?validateJourneyDef(_0x5779de,_0x3a16f2):validateSegmentDef(_0x5779de,_0x3a16f2);return{'filePath':_0x3a1114,'relativePath':_0xb4443d,'source':_0x423869,'result':_0x28a990,'fileType':_0x2c9c5d};}catch(_0x42fb2e){const _0x31e60c=_0x42fb2e instanceof Error?_0x42fb2e['message']:String(_0x42fb2e);return createParseErrorResult(_0x3a1114,_0xb4443d,'',_0x14a9f6(0xf2)+_0x31e60c);}}export function validateYamlFiles(_0x4b966c,_0x1ba0e2,_0x55c409={}){const _0x17d71a=a124_0xa3ffab;return _0x4b966c[_0x17d71a(0xed)](_0x2d5f3c=>validateYamlFile(_0x2d5f3c,_0x1ba0e2,_0x55c409));}export function calculateSummary(_0x2c2e78){const _0x2e4cba=a124_0xa3ffab;let _0x3cd9f5=0x0,_0x531620=0x0,_0x514691=0x0,_0x38bba8=0x0;for(const _0x26836e of _0x2c2e78){if(!isValidationResult(_0x26836e)){_0x38bba8++;continue;}_0x26836e[_0x2e4cba(0xf6)]['valid']?_0x3cd9f5++:_0x531620++,_0x514691+=_0x26836e[_0x2e4cba(0xf6)]['warnings'][_0x2e4cba(0xe9)];}return{'validCount':_0x3cd9f5,'invalidCount':_0x531620,'warningCount':_0x514691,'skippedCount':_0x38bba8,'hasErrors':_0x531620>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a125_0x33d555=a125_0x3403;function a125_0x4290(){const _0x3cd604=['journeys','MISSING_OPERATOR_VALUE','LessEqual','yellow','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','Invalid\x20arrayMatching.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20','filter','startsWith','.with.condition.segment','.conditions[','Invalid\x20arrayMatching\x20value.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20atLeast/atMost/exactly.','INVALID_AB_TEST_PERCENTAGES','MISSING_TIME_UNIT','MISSING_STAGES','\x20condition\x20must\x20have\x20a\x20segment\x20reference','Regexp','operator','location','.next','source','.exit_criteria[','.with.branches[','min','INVALID_ARRAY_MATCHING','.entry_criteria','atMost','Embedded\x20segment\x20\x27','push','stages','document','4vOLXHY','\x27\x20requires\x20a\x20value','type','rule','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','\x20condition\x20must\x20have\x20a\x20conditions\x20array','TimeWithinNext','activation','.name','abs','steps','Step\x20references\x20non-existent\x20step\x20\x27','Greater','includes','pop','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','MISSING_BETWEEN_BOUNDS','condition','28wNulYl','.conditions','warning','Journey\x20name\x20is\x20required','include','error','set','timeout','entry_criteria','column','repeat','MISSING_ACTIVATION_REF','ref:','Rule\x20type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','segments','cyan','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','red','stages[','attribute','conditions','journey','get','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','match','2498800libKTm','Invalid\x20operator\x20type\x20\x27','padStart','.with.condition.timeout.next','\x27\x20requires\x20a\x20time\x20unit','code','join','\x27.\x20Valid\x20types:\x20','.type','Operator\x20\x27','.with.condition.next','isArray','path','.rule','NotEqual','NotIn','branches','].next','MISSING_NAME','entries','325044lDLZUP','has','IsNull','.with.target','keys','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','flatMap','variants','contents','message','segment','referencedSegments','Attribute\x20name\x20cannot\x20be\x20empty','range','.steps[','target','exit_criteria','value','with','1589814Ozfhfo','Equal','excluded_','arrayMatching','milestone','reduce','GreaterEqual','INVALID_RULE_TYPE','line','Activation\x20step\x20requires\x20an\x20activation\x20reference','.with.branches','143730RwcLHr','all','next','.with.variants[','ab_test','object','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','trim','And','Between','110eqassX','max','versions','UNUSED_EMBEDDED_SEGMENT','split','length','EndWith','83664ulURyd','DUPLICATE_STEP_NAME','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','level','atLeast','INVALID_JUMP_TARGET','stage','embeddedSegments','MISSING_SEGMENT_REFERENCE','.value','goal','Criteria\x20references\x20undefined\x20segment\x20\x27','.segment','MISSING_CONDITIONS','EMPTY_ATTRIBUTE','\x27\x20(first\x20defined\x20at\x20steps[','.attribute','1905069xPBdYH','percentage','warnings','Contain','dim','name','.milestone','excluded','stepNames','Jump\x20step\x20requires\x20a\x20target','TimeWithinPast','add','INVALID_NEXT_REFERENCE','764348KKAYWd','getIn'];a125_0x4290=function(){return _0x3cd604;};return a125_0x4290();}(function(_0x3e631c,_0x542c2c){const _0x67028f=a125_0x3403,_0x3c2e65=_0x3e631c();while(!![]){try{const _0x2a01a4=-parseInt(_0x67028f(0xfd))/0x1+parseInt(_0x67028f(0x7e))/0x2+-parseInt(_0x67028f(0x11f))/0x3+-parseInt(_0x67028f(0x9e))/0x4*(parseInt(_0x67028f(0xcb))/0x5)+-parseInt(_0x67028f(0xf2))/0x6*(-parseInt(_0x67028f(0xb2))/0x7)+parseInt(_0x67028f(0x10e))/0x8+parseInt(_0x67028f(0xdf))/0x9*(parseInt(_0x67028f(0x107))/0xa);if(_0x2a01a4===_0x542c2c)break;else _0x3c2e65['push'](_0x3c2e65['shift']());}catch(_0x27f438){_0x3c2e65['push'](_0x3c2e65['shift']());}}}(a125_0x4290,0x8b787));import a125_0x864d20 from'chalk';const VALID_OPERATOR_TYPES=new Set([a125_0x33d555(0xf3),a125_0x33d555(0xd9),'Greater',a125_0x33d555(0xf8),'Less','LessEqual','In',a125_0x33d555(0xda),a125_0x33d555(0x122),'StartWith',a125_0x33d555(0x10d),a125_0x33d555(0x8f),a125_0x33d555(0xe1),'TimeWithinPast','TimeWithinNext','TimeRange','TimeToday',a125_0x33d555(0x106)]),OPERATORS_REQUIRING_VALUE=new Set([a125_0x33d555(0xf3),'NotEqual',a125_0x33d555(0xab),a125_0x33d555(0xf8),'Less',a125_0x33d555(0x82),'In',a125_0x33d555(0xda),a125_0x33d555(0x122),'StartWith',a125_0x33d555(0x10d),'Regexp',a125_0x33d555(0x129),'TimeWithinNext']),OPERATORS_REQUIRING_UNIT=new Set(['TimeWithinPast',a125_0x33d555(0xa5)]);export function getLocationFromPath(_0x3489e3,_0x56c3ff,_0x594b79){const _0x3d9ec7=a125_0x33d555;if(!_0x3489e3||!_0x56c3ff)return undefined;try{let _0x2dd8b7=_0x3489e3['getIn'](_0x594b79,!![]),_0x4467a2=[..._0x594b79];while((!_0x2dd8b7||typeof _0x2dd8b7!=='object'||!(_0x3d9ec7(0xec)in _0x2dd8b7)||!_0x2dd8b7[_0x3d9ec7(0xec)])&&_0x4467a2[_0x3d9ec7(0x10c)]>0x0){_0x4467a2[_0x3d9ec7(0xad)](),_0x2dd8b7=_0x4467a2['length']>0x0?_0x3489e3[_0x3d9ec7(0x7f)](_0x4467a2,!![]):_0x3489e3[_0x3d9ec7(0xe7)];}if(!_0x2dd8b7||typeof _0x2dd8b7!=='object'||!(_0x3d9ec7(0xec)in _0x2dd8b7)||!_0x2dd8b7['range'])return undefined;const [_0x4004a2]=_0x2dd8b7['range'];return offsetToLocation(_0x56c3ff,_0x4004a2);}catch{return undefined;}}export function offsetToLocation(_0x5b0a0e,_0x41abd0){let _0x40e036=0x1,_0x1212d7=0x1;for(let _0x45f356=0x0;_0x45f356<_0x41abd0&&_0x45f356<_0x5b0a0e['length'];_0x45f356++){_0x5b0a0e[_0x45f356]==='\x0a'?(_0x40e036++,_0x1212d7=0x1):_0x1212d7++;}return{'line':_0x40e036,'column':_0x1212d7,'offset':_0x41abd0};}function pathToArray(_0x31a1f9){const _0x448c64=a125_0x33d555;if(!_0x31a1f9)return[];return _0x31a1f9['split']('.')[_0x448c64(0xe5)](_0x2b8512=>{const _0x13e21d=_0x448c64,_0x30ff69=_0x2b8512[_0x13e21d(0xca)](/^(\w+)\[(\d+)\]$/);if(_0x30ff69)return[_0x30ff69[0x1],parseInt(_0x30ff69[0x2],0xa)];return[_0x2b8512];});}export function validateRuleDef(_0x3b1525,_0x54c3ec,_0x195630){const _0x4e15d1=a125_0x33d555,_0x4473c0=[];if(!_0x3b1525)return _0x4473c0;_0x3b1525[_0x4e15d1(0xa0)]!=='And'&&_0x3b1525[_0x4e15d1(0xa0)]!=='Or'&&_0x4473c0['push']({'level':'error','path':_0x54c3ec+'.type','code':_0x4e15d1(0xf9),'message':_0x4e15d1(0xbf)+_0x3b1525[_0x4e15d1(0xa0)]+'\x27','location':getLocationFromPath(_0x195630['document'],_0x195630[_0x4e15d1(0x93)],pathToArray(_0x54c3ec+'.type'))});if(!_0x3b1525['conditions']||!Array[_0x4e15d1(0xd6)](_0x3b1525[_0x4e15d1(0xc6)]))return _0x4473c0['push']({'level':_0x4e15d1(0xb7),'path':_0x54c3ec+_0x4e15d1(0xb3),'code':_0x4e15d1(0x11b),'message':'Rule\x20must\x20have\x20a\x20conditions\x20array','location':getLocationFromPath(_0x195630['document'],_0x195630[_0x4e15d1(0x93)],pathToArray(_0x54c3ec))}),_0x4473c0;for(let _0x53f737=0x0;_0x53f737<_0x3b1525[_0x4e15d1(0xc6)]['length'];_0x53f737++){const _0xde16aa=_0x3b1525[_0x4e15d1(0xc6)][_0x53f737],_0x106ca5=_0x54c3ec+'.conditions['+_0x53f737+']';_0x4473c0[_0x4e15d1(0x9b)](...validateCondition(_0xde16aa,_0x106ca5,_0x195630));}return _0x4473c0;}function validateCondition(_0x53c821,_0x375147,_0x4d4043){const _0x2238bc=a125_0x33d555,_0x3195dc=[];if(!_0x53c821||typeof _0x53c821!==_0x2238bc(0x102))return _0x3195dc;if(_0x53c821[_0x2238bc(0xa0)]===_0x2238bc(0x105)||_0x53c821['type']==='Or'){if(!_0x53c821[_0x2238bc(0xc6)]||!Array[_0x2238bc(0xd6)](_0x53c821[_0x2238bc(0xc6)]))_0x3195dc[_0x2238bc(0x9b)]({'level':_0x2238bc(0xb7),'path':_0x375147+_0x2238bc(0xb3),'code':'MISSING_CONDITIONS','message':_0x53c821[_0x2238bc(0xa0)]+_0x2238bc(0xa4),'location':getLocationFromPath(_0x4d4043[_0x2238bc(0x9d)],_0x4d4043['source'],pathToArray(_0x375147))});else for(let _0x49a7a2=0x0;_0x49a7a2<_0x53c821['conditions'][_0x2238bc(0x10c)];_0x49a7a2++){_0x3195dc[_0x2238bc(0x9b)](...validateCondition(_0x53c821[_0x2238bc(0xc6)][_0x49a7a2],_0x375147+_0x2238bc(0x89)+_0x49a7a2+']',_0x4d4043));}return _0x3195dc;}if(_0x53c821[_0x2238bc(0xa0)]===_0x2238bc(0xb6)||_0x53c821['type']==='exclude')return!_0x53c821[_0x2238bc(0xe9)]&&_0x3195dc[_0x2238bc(0x9b)]({'level':_0x2238bc(0xb7),'path':_0x375147+_0x2238bc(0x11a),'code':'MISSING_SEGMENT_REFERENCE','message':_0x53c821[_0x2238bc(0xa0)]+_0x2238bc(0x8e),'location':getLocationFromPath(_0x4d4043[_0x2238bc(0x9d)],_0x4d4043[_0x2238bc(0x93)],pathToArray(_0x375147))}),_0x3195dc;if(_0x53c821[_0x2238bc(0xa0)]==='Value'||_0x53c821['type']==='Behavior'){const _0x48ab7e=_0x53c821,_0x5ad903=_0x48ab7e[_0x2238bc(0x93)],_0x3738f9=_0x48ab7e['aggregation'],_0x246a4d=_0x5ad903||_0x3738f9;(!_0x48ab7e[_0x2238bc(0xc5)]||_0x48ab7e[_0x2238bc(0xc5)]==='')&&!_0x246a4d&&_0x3195dc[_0x2238bc(0x9b)]({'level':_0x2238bc(0xb7),'path':_0x375147+'.attribute','code':_0x2238bc(0x11c),'message':_0x2238bc(0xeb),'location':getLocationFromPath(_0x4d4043[_0x2238bc(0x9d)],_0x4d4043['source'],pathToArray(_0x375147+_0x2238bc(0x11e)))}),_0x48ab7e[_0x2238bc(0x90)]&&_0x3195dc[_0x2238bc(0x9b)](...validateOperator(_0x48ab7e[_0x2238bc(0x90)],_0x375147+'.operator',_0x4d4043)),_0x48ab7e[_0x2238bc(0xf5)]!==undefined&&_0x3195dc[_0x2238bc(0x9b)](...validateArrayMatching(_0x48ab7e[_0x2238bc(0xf5)],_0x375147+'.arrayMatching',_0x4d4043)),_0x48ab7e[_0x2238bc(0x86)]&&_0x3195dc['push'](...validateRuleDef(_0x48ab7e[_0x2238bc(0x86)],_0x375147+'.filter',_0x4d4043));}return _0x3195dc;}function validateOperator(_0x28fe7a,_0x44f2c6,_0x4c1ce9){const _0x594c63=a125_0x33d555,_0x453470=[];if(!VALID_OPERATOR_TYPES[_0x594c63(0xe0)](_0x28fe7a['type']))return _0x453470[_0x594c63(0x9b)]({'level':'error','path':_0x44f2c6+_0x594c63(0xd3),'code':'INVALID_OPERATOR_TYPE','message':_0x594c63(0xcc)+_0x28fe7a['type']+_0x594c63(0xd2)+[...VALID_OPERATOR_TYPES][_0x594c63(0xd1)](',\x20'),'location':getLocationFromPath(_0x4c1ce9['document'],_0x4c1ce9[_0x594c63(0x93)],pathToArray(_0x44f2c6+_0x594c63(0xd3)))}),_0x453470;return OPERATORS_REQUIRING_VALUE[_0x594c63(0xe0)](_0x28fe7a[_0x594c63(0xa0)])&&((_0x28fe7a['value']===undefined||_0x28fe7a[_0x594c63(0xf0)]===null)&&_0x453470[_0x594c63(0x9b)]({'level':_0x594c63(0xb7),'path':_0x44f2c6+_0x594c63(0x117),'code':_0x594c63(0x81),'message':_0x594c63(0xd4)+_0x28fe7a[_0x594c63(0xa0)]+_0x594c63(0x9f),'location':getLocationFromPath(_0x4c1ce9[_0x594c63(0x9d)],_0x4c1ce9[_0x594c63(0x93)],pathToArray(_0x44f2c6))})),_0x28fe7a[_0x594c63(0xa0)]===_0x594c63(0x106)&&(_0x28fe7a[_0x594c63(0x96)]===undefined&&_0x28fe7a[_0x594c63(0x108)]===undefined&&_0x453470[_0x594c63(0x9b)]({'level':_0x594c63(0xb7),'path':_0x44f2c6,'code':_0x594c63(0xb0),'message':'Between\x20operator\x20requires\x20\x27min\x27\x20and/or\x20\x27max\x27\x20values','location':getLocationFromPath(_0x4c1ce9[_0x594c63(0x9d)],_0x4c1ce9['source'],pathToArray(_0x44f2c6))})),OPERATORS_REQUIRING_UNIT[_0x594c63(0xe0)](_0x28fe7a[_0x594c63(0xa0)])&&(!_0x28fe7a['unit']&&_0x28fe7a[_0x594c63(0xf0)]!==undefined&&_0x453470[_0x594c63(0x9b)]({'level':_0x594c63(0xb7),'path':_0x44f2c6+'.unit','code':_0x594c63(0x8c),'message':_0x594c63(0xd4)+_0x28fe7a[_0x594c63(0xa0)]+_0x594c63(0xcf),'location':getLocationFromPath(_0x4c1ce9[_0x594c63(0x9d)],_0x4c1ce9[_0x594c63(0x93)],pathToArray(_0x44f2c6))})),_0x453470;}function validateArrayMatching(_0x379556,_0x205fa6,_0x27da27){const _0xb271cb=a125_0x33d555,_0x58e93f=[];if(_0x379556==='any'||_0x379556===_0xb271cb(0xfe))return _0x58e93f;if(typeof _0x379556==='object'){const _0x2e94f3=Object[_0xb271cb(0xe3)](_0x379556),_0xf09d84=[_0xb271cb(0x112),_0xb271cb(0x99),'exactly'],_0x2f0c12=_0x2e94f3['some'](_0x5b6c24=>_0xf09d84[_0xb271cb(0xac)](_0x5b6c24));!_0x2f0c12&&_0x58e93f[_0xb271cb(0x9b)]({'level':_0xb271cb(0xb7),'path':_0x205fa6,'code':_0xb271cb(0x97),'message':_0xb271cb(0x85)+_0xf09d84[_0xb271cb(0xd1)]('/')+'.','location':getLocationFromPath(_0x27da27['document'],_0x27da27[_0xb271cb(0x93)],pathToArray(_0x205fa6))});}else _0x58e93f[_0xb271cb(0x9b)]({'level':_0xb271cb(0xb7),'path':_0x205fa6,'code':_0xb271cb(0x97),'message':_0xb271cb(0x8a),'location':getLocationFromPath(_0x27da27[_0xb271cb(0x9d)],_0x27da27['source'],pathToArray(_0x205fa6))});return _0x58e93f;}export function validateSegmentDef(_0x36e062,_0x5137fe={}){const _0x4d2028=a125_0x33d555,_0x147d1a=[],_0x2d5616=[];(!_0x36e062[_0x4d2028(0x124)]||_0x36e062[_0x4d2028(0x124)]['trim']()==='')&&_0x147d1a['push']({'level':_0x4d2028(0xb7),'path':_0x4d2028(0x124),'code':'MISSING_NAME','message':'Segment\x20name\x20is\x20required','location':getLocationFromPath(_0x5137fe[_0x4d2028(0x9d)],_0x5137fe[_0x4d2028(0x93)],['name'])});if(_0x36e062[_0x4d2028(0xa1)]){const _0x544300=validateRuleDef(_0x36e062['rule'],_0x4d2028(0xa1),_0x5137fe);for(const _0x4fcd28 of _0x544300){_0x4fcd28[_0x4d2028(0x111)]==='error'?_0x147d1a['push'](_0x4fcd28):_0x2d5616[_0x4d2028(0x9b)](_0x4fcd28);}}return{'valid':_0x147d1a[_0x4d2028(0x10c)]===0x0,'errors':_0x147d1a,'warnings':_0x2d5616};}export function validateJourneyDef(_0x3a91f3,_0x532b31={}){const _0x46023b=a125_0x33d555,_0x4cc842=[],_0x2fe899=[];(!_0x3a91f3[_0x46023b(0x124)]||_0x3a91f3[_0x46023b(0x124)][_0x46023b(0x104)]()==='')&&_0x4cc842[_0x46023b(0x9b)]({'level':_0x46023b(0xb7),'path':_0x46023b(0x124),'code':_0x46023b(0xdd),'message':_0x46023b(0xb5),'location':getLocationFromPath(_0x532b31['document'],_0x532b31['source'],[_0x46023b(0x124)])});const _0x39b87b=new Set();if(_0x3a91f3[_0x46023b(0xc0)])for(const _0x3de4c9 of Object[_0x46023b(0xe3)](_0x3a91f3['segments'])){_0x39b87b['add'](_0x3de4c9);}const _0x569322=new Set(),_0x314138={..._0x532b31,'embeddedSegments':_0x39b87b,'referencedSegments':_0x569322};if(_0x3a91f3['segments'])for(const [_0x245319,_0x45af50]of Object[_0x46023b(0xde)](_0x3a91f3[_0x46023b(0xc0)])){const _0x5d854d=validateEmbeddedSegment(_0x45af50,'segments.'+_0x245319,_0x314138);for(const _0x5b41d8 of _0x5d854d){if(_0x5b41d8[_0x46023b(0x111)]==='error')_0x4cc842[_0x46023b(0x9b)](_0x5b41d8);else _0x2fe899['push'](_0x5b41d8);}}const _0x4e64f4=getJourneyStages(_0x3a91f3);_0x4e64f4[_0x46023b(0x10c)]===0x0&&_0x4cc842[_0x46023b(0x9b)]({'level':_0x46023b(0xb7),'path':_0x46023b(0x9c),'code':_0x46023b(0x8d),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x532b31['document'],_0x532b31[_0x46023b(0x93)],[_0x46023b(0x9c)])});const _0x3191be=new Set();for(const _0x3a2590 of _0x4e64f4){if(_0x3a2590['steps'])for(const _0x19a68a of _0x3a2590[_0x46023b(0xa9)]){_0x19a68a[_0x46023b(0x124)]&&_0x3191be['add'](_0x19a68a[_0x46023b(0x124)]);}}_0x314138[_0x46023b(0x127)]=_0x3191be;for(let _0x3ad8fc=0x0;_0x3ad8fc<_0x4e64f4[_0x46023b(0x10c)];_0x3ad8fc++){const _0x16b041=_0x4e64f4[_0x3ad8fc],_0x531421=_0x46023b(0xc4)+_0x3ad8fc+']',_0x26e6b6=validateStage(_0x16b041,_0x531421,_0x314138);for(const _0x449045 of _0x26e6b6){if(_0x449045[_0x46023b(0x111)]===_0x46023b(0xb7))_0x4cc842[_0x46023b(0x9b)](_0x449045);else _0x2fe899[_0x46023b(0x9b)](_0x449045);}}if(_0x3a91f3[_0x46023b(0x118)]){const _0x475e55=validateCriteria(_0x3a91f3[_0x46023b(0x118)],_0x46023b(0x118),_0x314138);for(const _0x4b6190 of _0x475e55){if(_0x4b6190[_0x46023b(0x111)]==='error')_0x4cc842[_0x46023b(0x9b)](_0x4b6190);else _0x2fe899[_0x46023b(0x9b)](_0x4b6190);}}for(const _0x340ced of _0x39b87b){!_0x569322[_0x46023b(0xe0)](_0x340ced)&&!_0x340ced[_0x46023b(0x87)](_0x46023b(0xf4))&&_0x2fe899['push']({'level':_0x46023b(0xb4),'path':'segments.'+_0x340ced,'code':_0x46023b(0x10a),'message':_0x46023b(0x9a)+_0x340ced+_0x46023b(0xc9),'location':getLocationFromPath(_0x532b31['document'],_0x532b31[_0x46023b(0x93)],['segments',_0x340ced])});}return{'valid':_0x4cc842[_0x46023b(0x10c)]===0x0,'errors':_0x4cc842,'warnings':_0x2fe899};}function getJourneyStages(_0x2478bd){const _0x3f5780=a125_0x33d555;if(_0x2478bd[_0x3f5780(0x9c)]&&_0x2478bd['stages'][_0x3f5780(0x10c)]>0x0)return _0x2478bd[_0x3f5780(0x9c)];if(_0x2478bd[_0x3f5780(0x80)]&&_0x2478bd['journeys'][_0x3f5780(0x10c)]>0x0)return _0x2478bd['journeys'][_0x3f5780(0xe5)](_0x3a75a4=>_0x3a75a4[_0x3f5780(0x9c)]||[]);if(_0x2478bd[_0x3f5780(0x109)]&&_0x2478bd[_0x3f5780(0x109)][_0x3f5780(0x10c)]>0x0)return _0x2478bd['versions'][_0x3f5780(0xe5)](_0x528f14=>_0x528f14['stages']||[]);return[];}function validateEmbeddedSegment(_0x3285c2,_0x17a7d6,_0x5d10b0){const _0x838bd6=a125_0x33d555,_0x1858b4=[];return _0x3285c2[_0x838bd6(0xa1)]&&_0x1858b4['push'](...validateRuleDef(_0x3285c2['rule'],_0x17a7d6+_0x838bd6(0xd8),_0x5d10b0)),_0x1858b4;}function validateStage(_0x2a6acd,_0x43213f,_0x16cfd1){const _0xcf3b0c=a125_0x33d555,_0x700fd0=[],_0x40aafb=new Map();if(_0x2a6acd[_0xcf3b0c(0xa9)])for(let _0x3cf4da=0x0;_0x3cf4da<_0x2a6acd[_0xcf3b0c(0xa9)]['length'];_0x3cf4da++){const _0x5d8a0e=_0x2a6acd[_0xcf3b0c(0xa9)][_0x3cf4da],_0x469ddb=_0x43213f+_0xcf3b0c(0xed)+_0x3cf4da+']';if(_0x5d8a0e['name']){if(_0x40aafb[_0xcf3b0c(0xe0)](_0x5d8a0e['name'])){const _0x2d1890=_0x40aafb[_0xcf3b0c(0xc8)](_0x5d8a0e[_0xcf3b0c(0x124)]);_0x700fd0[_0xcf3b0c(0x9b)]({'level':_0xcf3b0c(0xb7),'path':_0x469ddb+'.name','code':_0xcf3b0c(0x10f),'message':'Duplicate\x20step\x20name\x20\x27'+_0x5d8a0e[_0xcf3b0c(0x124)]+_0xcf3b0c(0x11d)+_0x2d1890+'])','location':getLocationFromPath(_0x16cfd1[_0xcf3b0c(0x9d)],_0x16cfd1[_0xcf3b0c(0x93)],pathToArray(_0x469ddb+_0xcf3b0c(0xa7)))});}else _0x40aafb[_0xcf3b0c(0xb8)](_0x5d8a0e['name'],_0x3cf4da);}_0x700fd0[_0xcf3b0c(0x9b)](...validateStep(_0x5d8a0e,_0x469ddb,_0x16cfd1));}_0x2a6acd[_0xcf3b0c(0xba)]&&_0x700fd0['push'](...validateCriteria(_0x2a6acd[_0xcf3b0c(0xba)],_0x43213f+_0xcf3b0c(0x98),_0x16cfd1));if(_0x2a6acd[_0xcf3b0c(0xef)])for(let _0x3b6852=0x0;_0x3b6852<_0x2a6acd[_0xcf3b0c(0xef)][_0xcf3b0c(0x10c)];_0x3b6852++){_0x700fd0[_0xcf3b0c(0x9b)](...validateCriteria(_0x2a6acd[_0xcf3b0c(0xef)][_0x3b6852],_0x43213f+_0xcf3b0c(0x94)+_0x3b6852+']',_0x16cfd1));}return _0x2a6acd['milestone']&&_0x700fd0[_0xcf3b0c(0x9b)](...validateCriteria(_0x2a6acd[_0xcf3b0c(0xf6)],_0x43213f+_0xcf3b0c(0x125),_0x16cfd1)),_0x700fd0;}function validateStep(_0xabf1c3,_0xf65d12,_0xa6654c){const _0x490433=a125_0x33d555,_0x1f8d75=[];_0xabf1c3[_0x490433(0xff)]&&_0xabf1c3[_0x490433(0xa0)]!=='end'&&(_0xa6654c[_0x490433(0x127)]&&!_0xa6654c[_0x490433(0x127)]['has'](_0xabf1c3[_0x490433(0xff)])&&_0x1f8d75[_0x490433(0x9b)]({'level':'error','path':_0xf65d12+'.next','code':_0x490433(0x12b),'message':_0x490433(0xaa)+_0xabf1c3[_0x490433(0xff)]+'\x27','location':getLocationFromPath(_0xa6654c['document'],_0xa6654c[_0x490433(0x93)],pathToArray(_0xf65d12+_0x490433(0x92)))}));switch(_0xabf1c3[_0x490433(0xa0)]){case'wait':_0x1f8d75[_0x490433(0x9b)](...validateWaitStep(_0xabf1c3,_0xf65d12,_0xa6654c));break;case _0x490433(0xa6):_0x1f8d75['push'](...validateActivationStep(_0xabf1c3,_0xf65d12,_0xa6654c));break;case'decision_point':_0x1f8d75['push'](...validateDecisionPointStep(_0xabf1c3,_0xf65d12,_0xa6654c));break;case _0x490433(0x101):_0x1f8d75[_0x490433(0x9b)](...validateAbTestStep(_0xabf1c3,_0xf65d12,_0xa6654c));break;case'jump':_0x1f8d75[_0x490433(0x9b)](...validateJumpStep(_0xabf1c3,_0xf65d12,_0xa6654c));break;}return _0x1f8d75;}function validateWaitStep(_0x5da469,_0x57fdec,_0x29a4bc){const _0x4a4d30=a125_0x33d555,_0x769d86=[];if(!_0x5da469[_0x4a4d30(0xf1)])return _0x769d86['push']({'level':_0x4a4d30(0xb7),'path':_0x57fdec+'.with','code':'MISSING_WAIT_PARAMS','message':_0x4a4d30(0xaf),'location':getLocationFromPath(_0x29a4bc['document'],_0x29a4bc[_0x4a4d30(0x93)],pathToArray(_0x57fdec))}),_0x769d86;if(_0x5da469['with'][_0x4a4d30(0xb1)]){const _0x42d217=_0x5da469['with']['condition'];_0x42d217[_0x4a4d30(0xe9)]&&(_0x29a4bc[_0x4a4d30(0xea)]?.['add'](_0x42d217[_0x4a4d30(0xe9)]),!_0x42d217[_0x4a4d30(0xe9)]['startsWith'](_0x4a4d30(0xbe))&&(_0x29a4bc[_0x4a4d30(0x115)]&&!_0x29a4bc[_0x4a4d30(0x115)][_0x4a4d30(0xe0)](_0x42d217[_0x4a4d30(0xe9)])&&_0x769d86[_0x4a4d30(0x9b)]({'level':_0x4a4d30(0xb7),'path':_0x57fdec+_0x4a4d30(0x88),'code':_0x4a4d30(0x116),'message':_0x4a4d30(0x110)+_0x42d217[_0x4a4d30(0xe9)]+'\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','location':getLocationFromPath(_0x29a4bc[_0x4a4d30(0x9d)],_0x29a4bc[_0x4a4d30(0x93)],pathToArray(_0x57fdec+_0x4a4d30(0x88)))})),_0x42d217[_0x4a4d30(0xff)]&&_0x29a4bc[_0x4a4d30(0x127)]&&!_0x29a4bc[_0x4a4d30(0x127)][_0x4a4d30(0xe0)](_0x42d217[_0x4a4d30(0xff)])&&_0x769d86[_0x4a4d30(0x9b)]({'level':_0x4a4d30(0xb7),'path':_0x57fdec+_0x4a4d30(0xd5),'code':'INVALID_NEXT_REFERENCE','message':'Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x42d217[_0x4a4d30(0xff)]+'\x27','location':getLocationFromPath(_0x29a4bc[_0x4a4d30(0x9d)],_0x29a4bc[_0x4a4d30(0x93)],pathToArray(_0x57fdec+_0x4a4d30(0xd5)))}),_0x42d217[_0x4a4d30(0xb9)]?.['next']&&_0x29a4bc[_0x4a4d30(0x127)]&&!_0x29a4bc[_0x4a4d30(0x127)][_0x4a4d30(0xe0)](_0x42d217[_0x4a4d30(0xb9)]['next'])&&_0x769d86['push']({'level':_0x4a4d30(0xb7),'path':_0x57fdec+_0x4a4d30(0xce),'code':_0x4a4d30(0x12b),'message':_0x4a4d30(0x103)+_0x42d217[_0x4a4d30(0xb9)][_0x4a4d30(0xff)]+'\x27','location':getLocationFromPath(_0x29a4bc[_0x4a4d30(0x9d)],_0x29a4bc[_0x4a4d30(0x93)],pathToArray(_0x57fdec+_0x4a4d30(0xce)))}));}return _0x769d86;}function validateActivationStep(_0x44586e,_0x5ce454,_0x465990){const _0x3a8001=a125_0x33d555,_0x24831c=[];return!_0x44586e[_0x3a8001(0xf1)]?.[_0x3a8001(0xa6)]&&_0x24831c[_0x3a8001(0x9b)]({'level':'error','path':_0x5ce454+'.with.activation','code':_0x3a8001(0xbd),'message':_0x3a8001(0xfb),'location':getLocationFromPath(_0x465990[_0x3a8001(0x9d)],_0x465990[_0x3a8001(0x93)],pathToArray(_0x5ce454))}),_0x24831c;}function validateDecisionPointStep(_0x510082,_0x174b59,_0x25e83f){const _0x3e61ae=a125_0x33d555,_0x4962fa=[];if(!_0x510082[_0x3e61ae(0xf1)]?.[_0x3e61ae(0xdb)]||_0x510082[_0x3e61ae(0xf1)][_0x3e61ae(0xdb)][_0x3e61ae(0x10c)]===0x0)return _0x4962fa[_0x3e61ae(0x9b)]({'level':_0x3e61ae(0xb7),'path':_0x174b59+_0x3e61ae(0xfc),'code':_0x3e61ae(0x11b),'message':_0x3e61ae(0xa2),'location':getLocationFromPath(_0x25e83f['document'],_0x25e83f[_0x3e61ae(0x93)],pathToArray(_0x174b59))}),_0x4962fa;for(let _0x568605=0x0;_0x568605<_0x510082[_0x3e61ae(0xf1)][_0x3e61ae(0xdb)]['length'];_0x568605++){const _0x596855=_0x510082[_0x3e61ae(0xf1)][_0x3e61ae(0xdb)][_0x568605],_0x256c59=_0x174b59+_0x3e61ae(0x95)+_0x568605+']';_0x596855[_0x3e61ae(0xe9)]&&!_0x596855[_0x3e61ae(0x126)]&&(_0x25e83f[_0x3e61ae(0xea)]?.[_0x3e61ae(0x12a)](_0x596855['segment']),!_0x596855[_0x3e61ae(0xe9)]['startsWith'](_0x3e61ae(0xbe))&&(_0x25e83f[_0x3e61ae(0x115)]&&!_0x25e83f['embeddedSegments']['has'](_0x596855[_0x3e61ae(0xe9)])&&_0x4962fa['push']({'level':_0x3e61ae(0xb7),'path':_0x256c59+_0x3e61ae(0x11a),'code':'MISSING_SEGMENT_REFERENCE','message':_0x3e61ae(0xa3)+_0x596855[_0x3e61ae(0xe9)]+'\x27','location':getLocationFromPath(_0x25e83f['document'],_0x25e83f[_0x3e61ae(0x93)],pathToArray(_0x256c59+_0x3e61ae(0x11a)))}))),_0x596855[_0x3e61ae(0xff)]&&_0x25e83f[_0x3e61ae(0x127)]&&!_0x25e83f[_0x3e61ae(0x127)]['has'](_0x596855[_0x3e61ae(0xff)])&&_0x4962fa[_0x3e61ae(0x9b)]({'level':_0x3e61ae(0xb7),'path':_0x256c59+_0x3e61ae(0x92),'code':_0x3e61ae(0x12b),'message':_0x3e61ae(0xae)+_0x596855[_0x3e61ae(0xff)]+'\x27','location':getLocationFromPath(_0x25e83f[_0x3e61ae(0x9d)],_0x25e83f[_0x3e61ae(0x93)],pathToArray(_0x256c59+'.next'))});}return _0x4962fa;}function validateAbTestStep(_0x2c0394,_0xaebc6d,_0x68c67c){const _0x55d926=a125_0x33d555,_0x4770b6=[];if(!_0x2c0394[_0x55d926(0xf1)]?.[_0x55d926(0xe6)]||_0x2c0394['with'][_0x55d926(0xe6)][_0x55d926(0x10c)]===0x0)return _0x4770b6[_0x55d926(0x9b)]({'level':_0x55d926(0xb7),'path':_0xaebc6d+'.with.variants','code':_0x55d926(0x11b),'message':_0x55d926(0x84),'location':getLocationFromPath(_0x68c67c[_0x55d926(0x9d)],_0x68c67c['source'],pathToArray(_0xaebc6d))}),_0x4770b6;const _0x79bb1=_0x2c0394[_0x55d926(0xf1)][_0x55d926(0xe6)][_0x55d926(0xf7)]((_0x5b04f9,_0x2fdf18)=>_0x5b04f9+(_0x2fdf18[_0x55d926(0x120)]||0x0),0x0);Math[_0x55d926(0xa8)](_0x79bb1-0x64)>0.01&&_0x4770b6[_0x55d926(0x9b)]({'level':_0x55d926(0xb7),'path':_0xaebc6d+'.with.variants','code':_0x55d926(0x8b),'message':_0x55d926(0xc2)+_0x79bb1+'%)','location':getLocationFromPath(_0x68c67c[_0x55d926(0x9d)],_0x68c67c[_0x55d926(0x93)],pathToArray(_0xaebc6d+'.with.variants'))});for(let _0x5be828=0x0;_0x5be828<_0x2c0394['with'][_0x55d926(0xe6)][_0x55d926(0x10c)];_0x5be828++){const _0x41e672=_0x2c0394['with'][_0x55d926(0xe6)][_0x5be828];_0x41e672['next']&&_0x68c67c[_0x55d926(0x127)]&&!_0x68c67c[_0x55d926(0x127)][_0x55d926(0xe0)](_0x41e672[_0x55d926(0xff)])&&_0x4770b6[_0x55d926(0x9b)]({'level':_0x55d926(0xb7),'path':_0xaebc6d+_0x55d926(0x100)+_0x5be828+_0x55d926(0xdc),'code':_0x55d926(0x12b),'message':_0x55d926(0xe4)+_0x41e672['next']+'\x27','location':getLocationFromPath(_0x68c67c[_0x55d926(0x9d)],_0x68c67c['source'],pathToArray(_0xaebc6d+_0x55d926(0x100)+_0x5be828+_0x55d926(0xdc)))});}return _0x4770b6;}function validateJumpStep(_0x5a822a,_0x16ecde,_0x4a540b){const _0x145cd7=a125_0x33d555,_0x378ea4=[];if(!_0x5a822a[_0x145cd7(0xf1)]?.[_0x145cd7(0xee)])return _0x378ea4[_0x145cd7(0x9b)]({'level':_0x145cd7(0xb7),'path':_0x16ecde+_0x145cd7(0xe2),'code':_0x145cd7(0x113),'message':_0x145cd7(0x128),'location':getLocationFromPath(_0x4a540b['document'],_0x4a540b[_0x145cd7(0x93)],pathToArray(_0x16ecde))}),_0x378ea4;return(!_0x5a822a[_0x145cd7(0xf1)]['target'][_0x145cd7(0xc7)]||!_0x5a822a[_0x145cd7(0xf1)][_0x145cd7(0xee)][_0x145cd7(0x114)])&&_0x378ea4[_0x145cd7(0x9b)]({'level':_0x145cd7(0xb7),'path':_0x16ecde+_0x145cd7(0xe2),'code':_0x145cd7(0x113),'message':'Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','location':getLocationFromPath(_0x4a540b[_0x145cd7(0x9d)],_0x4a540b[_0x145cd7(0x93)],pathToArray(_0x16ecde+_0x145cd7(0xe2)))}),_0x378ea4;}function a125_0x3403(_0x4068e8,_0x5869b8){_0x4068e8=_0x4068e8-0x7e;const _0x429004=a125_0x4290();let _0x340383=_0x429004[_0x4068e8];return _0x340383;}function validateCriteria(_0x591d71,_0x51ce26,_0x22259e){const _0x57516a=a125_0x33d555,_0x3ed2de=[];return _0x591d71[_0x57516a(0xe9)]&&(_0x22259e[_0x57516a(0xea)]?.['add'](_0x591d71[_0x57516a(0xe9)]),!_0x591d71[_0x57516a(0xe9)][_0x57516a(0x87)](_0x57516a(0xbe))&&(_0x22259e[_0x57516a(0x115)]&&!_0x22259e[_0x57516a(0x115)]['has'](_0x591d71['segment'])&&_0x3ed2de['push']({'level':_0x57516a(0xb7),'path':_0x51ce26+_0x57516a(0x11a),'code':_0x57516a(0x116),'message':_0x57516a(0x119)+_0x591d71[_0x57516a(0xe9)]+'\x27','location':getLocationFromPath(_0x22259e[_0x57516a(0x9d)],_0x22259e[_0x57516a(0x93)],pathToArray(_0x51ce26+'.segment'))}))),_0x3ed2de;}export function formatIssueWithContext(_0x132c4d,_0x582517,_0x513aa2){const _0x17d8ba=a125_0x33d555,_0x535090=[],_0x29436d=_0x132c4d[_0x17d8ba(0x111)]===_0x17d8ba(0xb7),_0x12fc79=_0x29436d?a125_0x864d20[_0x17d8ba(0xc3)]:a125_0x864d20[_0x17d8ba(0x83)],_0x3103c8=_0x29436d?a125_0x864d20['red']:a125_0x864d20['yellow'],_0x3f1df8=_0x513aa2?a125_0x864d20[_0x17d8ba(0xc1)](_0x513aa2+':'):'';if(_0x132c4d[_0x17d8ba(0x91)]){const _0xb623db=a125_0x864d20[_0x17d8ba(0xc1)](_0x132c4d['location'][_0x17d8ba(0xfa)]+':'+_0x132c4d['location'][_0x17d8ba(0xbb)]);_0x535090[_0x17d8ba(0x9b)](''+_0x3f1df8+_0xb623db+':\x20'+_0x12fc79(_0x132c4d[_0x17d8ba(0x111)])+'\x20'+_0x3103c8('['+_0x132c4d['code']+']'));}else _0x535090[_0x17d8ba(0x9b)](''+_0x3f1df8+a125_0x864d20[_0x17d8ba(0x123)](_0x132c4d[_0x17d8ba(0xd7)])+':\x20'+_0x12fc79(_0x132c4d[_0x17d8ba(0x111)])+'\x20'+_0x3103c8('['+_0x132c4d[_0x17d8ba(0xd0)]+']'));_0x535090[_0x17d8ba(0x9b)](_0x132c4d[_0x17d8ba(0xe8)]);if(_0x132c4d[_0x17d8ba(0x91)]&&_0x582517){const _0x5cea2a=_0x582517[_0x17d8ba(0x10b)]('\x0a'),{line:_0x1dc293,column:_0x521bf6}=_0x132c4d[_0x17d8ba(0x91)],_0x105a93=Math[_0x17d8ba(0x108)](0x1,_0x1dc293-0x1),_0x595ea1=Math[_0x17d8ba(0x96)](_0x5cea2a[_0x17d8ba(0x10c)],_0x1dc293+0x1);_0x535090[_0x17d8ba(0x9b)]('');for(let _0x5e06e3=_0x105a93;_0x5e06e3<=_0x595ea1;_0x5e06e3++){const _0x519f35=_0x5cea2a[_0x5e06e3-0x1]||'',_0x4d1bd1=a125_0x864d20['dim'](_0x5e06e3['toString']()[_0x17d8ba(0xcd)](0x4)),_0x3e31ce=a125_0x864d20[_0x17d8ba(0x123)]('\x20|\x20');if(_0x5e06e3===_0x1dc293){_0x535090['push']('\x20\x20'+_0x4d1bd1+_0x3e31ce+_0x12fc79(_0x519f35));const _0x4e6545='\x20'[_0x17d8ba(0xbc)](0x4+0x3+_0x521bf6-0x1);_0x535090[_0x17d8ba(0x9b)]('\x20\x20'+_0x4e6545+_0x12fc79('^'));}else _0x535090[_0x17d8ba(0x9b)]('\x20\x20'+_0x4d1bd1+_0x3e31ce+a125_0x864d20[_0x17d8ba(0x123)](_0x519f35));}}return _0x535090[_0x17d8ba(0xd1)]('\x0a');}export function formatValidationResult(_0x507364,_0x1992c4,_0x7e4e21){const _0x527005=a125_0x33d555,_0x20cad9=[];for(const _0x55782e of _0x507364['errors']){_0x20cad9['push'](formatIssueWithContext(_0x55782e,_0x1992c4,_0x7e4e21)),_0x20cad9['push']('');}for(const _0x51d604 of _0x507364[_0x527005(0x121)]){_0x20cad9[_0x527005(0x9b)](formatIssueWithContext(_0x51d604,_0x1992c4,_0x7e4e21)),_0x20cad9[_0x527005(0x9b)]('');}return _0x20cad9['join']('\x0a');}
|
|
1
|
+
const a125_0x58f24c=a125_0x55c7;(function(_0x492d6d,_0x2353f9){const _0x31a296=a125_0x55c7,_0x272914=_0x492d6d();while(!![]){try{const _0x5b22d2=-parseInt(_0x31a296(0x1c7))/0x1+parseInt(_0x31a296(0x21f))/0x2*(parseInt(_0x31a296(0x20d))/0x3)+-parseInt(_0x31a296(0x18d))/0x4+-parseInt(_0x31a296(0x1c0))/0x5+-parseInt(_0x31a296(0x1d7))/0x6*(-parseInt(_0x31a296(0x21b))/0x7)+parseInt(_0x31a296(0x18b))/0x8*(-parseInt(_0x31a296(0x1d4))/0x9)+parseInt(_0x31a296(0x1c5))/0xa;if(_0x5b22d2===_0x2353f9)break;else _0x272914['push'](_0x272914['shift']());}catch(_0x414cc6){_0x272914['push'](_0x272914['shift']());}}}(a125_0x5a84,0x1a605));import a125_0x2a9868 from'chalk';const VALID_OPERATOR_TYPES=new Set(['Equal',a125_0x58f24c(0x20a),a125_0x58f24c(0x199),'GreaterEqual',a125_0x58f24c(0x1f5),a125_0x58f24c(0x18c),'In','NotIn',a125_0x58f24c(0x20f),'StartWith',a125_0x58f24c(0x190),a125_0x58f24c(0x191),a125_0x58f24c(0x231),a125_0x58f24c(0x1de),a125_0x58f24c(0x1bf),'TimeRange',a125_0x58f24c(0x1f0),a125_0x58f24c(0x1da)]),OPERATORS_REQUIRING_VALUE=new Set([a125_0x58f24c(0x220),a125_0x58f24c(0x20a),a125_0x58f24c(0x199),a125_0x58f24c(0x222),a125_0x58f24c(0x1f5),'LessEqual','In',a125_0x58f24c(0x1e4),a125_0x58f24c(0x20f),a125_0x58f24c(0x1c4),a125_0x58f24c(0x190),a125_0x58f24c(0x191),a125_0x58f24c(0x1de),a125_0x58f24c(0x1bf)]),OPERATORS_REQUIRING_UNIT=new Set(['TimeWithinPast',a125_0x58f24c(0x1bf)]);export function getLocationFromPath(_0x39284b,_0x93d2b,_0x136356){const _0xeda6d4=a125_0x58f24c;if(!_0x39284b||!_0x93d2b)return undefined;try{let _0x421ae4=_0x39284b[_0xeda6d4(0x1a0)](_0x136356,!![]),_0x2ab426=[..._0x136356];while((!_0x421ae4||typeof _0x421ae4!==_0xeda6d4(0x1c1)||!(_0xeda6d4(0x185)in _0x421ae4)||!_0x421ae4[_0xeda6d4(0x185)])&&_0x2ab426['length']>0x0){_0x2ab426[_0xeda6d4(0x1b3)](),_0x421ae4=_0x2ab426[_0xeda6d4(0x21d)]>0x0?_0x39284b['getIn'](_0x2ab426,!![]):_0x39284b[_0xeda6d4(0x218)];}if(!_0x421ae4||typeof _0x421ae4!==_0xeda6d4(0x1c1)||!('range'in _0x421ae4)||!_0x421ae4['range'])return undefined;const [_0x43c8d9]=_0x421ae4[_0xeda6d4(0x185)];return offsetToLocation(_0x93d2b,_0x43c8d9);}catch{return undefined;}}export function offsetToLocation(_0x5042a1,_0xede54c){const _0xddbeee=a125_0x58f24c;let _0x3fca31=0x1,_0xd3c455=0x1;for(let _0x4a8723=0x0;_0x4a8723<_0xede54c&&_0x4a8723<_0x5042a1[_0xddbeee(0x21d)];_0x4a8723++){_0x5042a1[_0x4a8723]==='\x0a'?(_0x3fca31++,_0xd3c455=0x1):_0xd3c455++;}return{'line':_0x3fca31,'column':_0xd3c455,'offset':_0xede54c};}function pathToArray(_0x533f48){const _0x394df8=a125_0x58f24c;if(!_0x533f48)return[];return _0x533f48[_0x394df8(0x20b)]('.')[_0x394df8(0x19d)](_0x1c4bf2=>{const _0x372f79=_0x1c4bf2['match'](/^(\w+)\[(\d+)\]$/);if(_0x372f79)return[_0x372f79[0x1],parseInt(_0x372f79[0x2],0xa)];return[_0x1c4bf2];});}export function validateRuleDef(_0xcbc67e,_0x5e15b7,_0x32da5b){const _0x552743=a125_0x58f24c,_0x3081fa=[];if(!_0xcbc67e)return _0x3081fa;_0xcbc67e[_0x552743(0x1ae)]!==_0x552743(0x1cc)&&_0xcbc67e[_0x552743(0x1ae)]!=='Or'&&_0x3081fa[_0x552743(0x22a)]({'level':_0x552743(0x1f9),'path':_0x5e15b7+_0x552743(0x1cf),'code':_0x552743(0x196),'message':_0x552743(0x1fa)+_0xcbc67e['type']+'\x27','location':getLocationFromPath(_0x32da5b['document'],_0x32da5b[_0x552743(0x1e9)],pathToArray(_0x5e15b7+_0x552743(0x1cf)))});if(!_0xcbc67e['conditions']||!Array[_0x552743(0x1f8)](_0xcbc67e['conditions']))return _0x3081fa['push']({'level':'error','path':_0x5e15b7+'.conditions','code':_0x552743(0x22f),'message':_0x552743(0x1b8),'location':getLocationFromPath(_0x32da5b[_0x552743(0x1be)],_0x32da5b[_0x552743(0x1e9)],pathToArray(_0x5e15b7))}),_0x3081fa;for(let _0x82f7e3=0x0;_0x82f7e3<_0xcbc67e['conditions'][_0x552743(0x21d)];_0x82f7e3++){const _0x306e4a=_0xcbc67e[_0x552743(0x1a2)][_0x82f7e3],_0x500995=_0x5e15b7+_0x552743(0x1a1)+_0x82f7e3+']';_0x3081fa['push'](...validateCondition(_0x306e4a,_0x500995,_0x32da5b));}return _0x3081fa;}function validateCondition(_0x3d6e40,_0x144f87,_0x5bf8f2){const _0x34e7e4=a125_0x58f24c,_0x3402a4=[];if(!_0x3d6e40||typeof _0x3d6e40!==_0x34e7e4(0x1c1))return _0x3402a4;if(_0x3d6e40['type']===_0x34e7e4(0x1cc)||_0x3d6e40[_0x34e7e4(0x1ae)]==='Or'){if(!_0x3d6e40['conditions']||!Array['isArray'](_0x3d6e40[_0x34e7e4(0x1a2)]))_0x3402a4['push']({'level':_0x34e7e4(0x1f9),'path':_0x144f87+_0x34e7e4(0x232),'code':_0x34e7e4(0x22f),'message':_0x3d6e40[_0x34e7e4(0x1ae)]+_0x34e7e4(0x19a),'location':getLocationFromPath(_0x5bf8f2[_0x34e7e4(0x1be)],_0x5bf8f2[_0x34e7e4(0x1e9)],pathToArray(_0x144f87))});else for(let _0x597ae6=0x0;_0x597ae6<_0x3d6e40[_0x34e7e4(0x1a2)][_0x34e7e4(0x21d)];_0x597ae6++){_0x3402a4[_0x34e7e4(0x22a)](...validateCondition(_0x3d6e40[_0x34e7e4(0x1a2)][_0x597ae6],_0x144f87+_0x34e7e4(0x1a1)+_0x597ae6+']',_0x5bf8f2));}return _0x3402a4;}if(_0x3d6e40[_0x34e7e4(0x1ae)]===_0x34e7e4(0x1a3)||_0x3d6e40[_0x34e7e4(0x1ae)]===_0x34e7e4(0x225))return!_0x3d6e40['segment']&&_0x3402a4[_0x34e7e4(0x22a)]({'level':_0x34e7e4(0x1f9),'path':_0x144f87+_0x34e7e4(0x212),'code':'MISSING_SEGMENT_REFERENCE','message':_0x3d6e40[_0x34e7e4(0x1ae)]+_0x34e7e4(0x1a6),'location':getLocationFromPath(_0x5bf8f2[_0x34e7e4(0x1be)],_0x5bf8f2[_0x34e7e4(0x1e9)],pathToArray(_0x144f87))}),_0x3402a4;if(_0x3d6e40[_0x34e7e4(0x1ae)]==='Value'||_0x3d6e40[_0x34e7e4(0x1ae)]===_0x34e7e4(0x1b1)){const _0x34a515=_0x3d6e40,_0x4def33=_0x34a515[_0x34e7e4(0x1e9)],_0x10fc3a=_0x34a515[_0x34e7e4(0x1d0)],_0x5ea651=_0x4def33||_0x10fc3a;(!_0x34a515[_0x34e7e4(0x1ee)]||_0x34a515['attribute']==='')&&!_0x5ea651&&_0x3402a4[_0x34e7e4(0x22a)]({'level':_0x34e7e4(0x1f9),'path':_0x144f87+_0x34e7e4(0x201),'code':'EMPTY_ATTRIBUTE','message':_0x34e7e4(0x1bc),'location':getLocationFromPath(_0x5bf8f2['document'],_0x5bf8f2[_0x34e7e4(0x1e9)],pathToArray(_0x144f87+_0x34e7e4(0x201)))}),_0x34a515[_0x34e7e4(0x18a)]&&_0x3402a4[_0x34e7e4(0x22a)](...validateOperator(_0x34a515['operator'],_0x144f87+'.operator',_0x5bf8f2)),_0x34a515[_0x34e7e4(0x202)]!==undefined&&_0x3402a4['push'](...validateArrayMatching(_0x34a515[_0x34e7e4(0x202)],_0x144f87+_0x34e7e4(0x1ce),_0x5bf8f2)),_0x34a515['filter']&&_0x3402a4[_0x34e7e4(0x22a)](...validateRuleDef(_0x34a515[_0x34e7e4(0x1b4)],_0x144f87+'.filter',_0x5bf8f2));}return _0x3402a4;}function validateOperator(_0x22a40a,_0x369d4d,_0x4887ad){const _0x401ea7=a125_0x58f24c,_0x10100f=[];if(!VALID_OPERATOR_TYPES[_0x401ea7(0x1e6)](_0x22a40a[_0x401ea7(0x1ae)]))return _0x10100f[_0x401ea7(0x22a)]({'level':'error','path':_0x369d4d+_0x401ea7(0x1cf),'code':_0x401ea7(0x1a8),'message':'Invalid\x20operator\x20type\x20\x27'+_0x22a40a['type']+_0x401ea7(0x228)+[...VALID_OPERATOR_TYPES][_0x401ea7(0x1ff)](',\x20'),'location':getLocationFromPath(_0x4887ad[_0x401ea7(0x1be)],_0x4887ad[_0x401ea7(0x1e9)],pathToArray(_0x369d4d+_0x401ea7(0x1cf)))}),_0x10100f;return OPERATORS_REQUIRING_VALUE[_0x401ea7(0x1e6)](_0x22a40a[_0x401ea7(0x1ae)])&&((_0x22a40a['value']===undefined||_0x22a40a[_0x401ea7(0x215)]===null)&&_0x10100f[_0x401ea7(0x22a)]({'level':_0x401ea7(0x1f9),'path':_0x369d4d+'.value','code':_0x401ea7(0x22d),'message':_0x401ea7(0x193)+_0x22a40a[_0x401ea7(0x1ae)]+_0x401ea7(0x1e7),'location':getLocationFromPath(_0x4887ad[_0x401ea7(0x1be)],_0x4887ad[_0x401ea7(0x1e9)],pathToArray(_0x369d4d))})),_0x22a40a[_0x401ea7(0x1ae)]===_0x401ea7(0x1da)&&(_0x22a40a['min']===undefined&&_0x22a40a[_0x401ea7(0x197)]===undefined&&_0x10100f[_0x401ea7(0x22a)]({'level':_0x401ea7(0x1f9),'path':_0x369d4d,'code':'MISSING_BETWEEN_BOUNDS','message':_0x401ea7(0x217),'location':getLocationFromPath(_0x4887ad[_0x401ea7(0x1be)],_0x4887ad['source'],pathToArray(_0x369d4d))})),OPERATORS_REQUIRING_UNIT[_0x401ea7(0x1e6)](_0x22a40a[_0x401ea7(0x1ae)])&&(!_0x22a40a[_0x401ea7(0x1f4)]&&_0x22a40a[_0x401ea7(0x215)]!==undefined&&_0x10100f[_0x401ea7(0x22a)]({'level':_0x401ea7(0x1f9),'path':_0x369d4d+_0x401ea7(0x22e),'code':'MISSING_TIME_UNIT','message':_0x401ea7(0x193)+_0x22a40a['type']+'\x27\x20requires\x20a\x20time\x20unit','location':getLocationFromPath(_0x4887ad['document'],_0x4887ad[_0x401ea7(0x1e9)],pathToArray(_0x369d4d))})),_0x10100f;}function a125_0x55c7(_0x3fd6a2,_0x22e88d){_0x3fd6a2=_0x3fd6a2-0x185;const _0x5a84e0=a125_0x5a84();let _0x55c7cd=_0x5a84e0[_0x3fd6a2];return _0x55c7cd;}function a125_0x5a84(){const _0x27ca6f=['INVALID_OPERATOR_TYPE','.with.variants[','excluded','.rule','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','ref:','type','versions','INVALID_ARRAY_MATCHING','Behavior','.exit_criteria[','pop','filter','].next','errors','segments','Rule\x20must\x20have\x20a\x20conditions\x20array','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','steps','Activation\x20step\x20requires\x20an\x20activation\x20reference','Attribute\x20name\x20cannot\x20be\x20empty','level','document','TimeWithinNext','689160clNXIE','object','stages[','Step\x20references\x20non-existent\x20step\x20\x27','StartWith','2810820DjHopD','abs','14457xvwYlm','startsWith','variants','.with.condition.segment','message','And','.with.variants','.arrayMatching','.type','aggregation','stepNames','.with.activation','entry_criteria','402507YvKOyx','code','segment','222xIkAEI','\x20|\x20','MISSING_NAME','Between','journey','rule','add','TimeWithinPast','goal','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','referencedSegments','trim','.with.condition.next','NotIn','jump','has','\x27\x20requires\x20a\x20value','any','source','.steps[','Jump\x20step\x20requires\x20a\x20target','embeddedSegments','milestone','attribute','INVALID_JUMP_TARGET','TimeToday','INVALID_NEXT_REFERENCE','.name','dim','unit','Less','target','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','isArray','error','Rule\x20type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','Duplicate\x20step\x20name\x20\x27','next','get','join','DUPLICATE_STEP_NAME','.attribute','arrayMatching','.with.target','exit_criteria','journeys','ab_test','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','with','location','NotEqual','split','MISSING_SEGMENT_REFERENCE','5931vhlUah','padStart','Contain','cyan','yellow','.segment','toString','timeout','value','INVALID_AB_TEST_PERCENTAGES','Between\x20operator\x20requires\x20\x27min\x27\x20and/or\x20\x27max\x27\x20values','contents','.with.condition.timeout.next','condition','31843RHYoJZ','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','length','MISSING_ACTIVATION_REF','194sKNQKB','Equal','warnings','GreaterEqual','decision_point','segments.','exclude','entries','Embedded\x20segment\x20\x27','\x27.\x20Valid\x20types:\x20','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','push','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','\x27\x20(first\x20defined\x20at\x20steps[','MISSING_OPERATOR_VALUE','.unit','MISSING_CONDITIONS','Invalid\x20arrayMatching\x20value.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20atLeast/atMost/exactly.','IsNull','.conditions','path','range','stage','name','atLeast','Criteria\x20references\x20undefined\x20segment\x20\x27','operator','32rtHtYk','LessEqual','807784TQMLki','.with.branches[','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','EndWith','Regexp','.entry_criteria','Operator\x20\x27','red','end','INVALID_RULE_TYPE','max','.with','Greater','\x20condition\x20must\x20have\x20a\x20conditions\x20array','branches','activation','flatMap','stages','.next','getIn','.conditions[','conditions','include','keys','UNUSED_EMBEDDED_SEGMENT','\x20condition\x20must\x20have\x20a\x20segment\x20reference','reduce'];a125_0x5a84=function(){return _0x27ca6f;};return a125_0x5a84();}function validateArrayMatching(_0x30cb1e,_0x416dc1,_0x375e13){const _0x27a194=a125_0x58f24c,_0x18b8d1=[];if(_0x30cb1e===_0x27a194(0x1e8)||_0x30cb1e==='all')return _0x18b8d1;if(typeof _0x30cb1e===_0x27a194(0x1c1)){const _0x4a0d9a=Object[_0x27a194(0x1a4)](_0x30cb1e),_0x2c4452=[_0x27a194(0x188),'atMost','exactly'],_0x5eeb1a=_0x4a0d9a['some'](_0x44a343=>_0x2c4452['includes'](_0x44a343));!_0x5eeb1a&&_0x18b8d1['push']({'level':_0x27a194(0x1f9),'path':_0x416dc1,'code':_0x27a194(0x1b0),'message':'Invalid\x20arrayMatching.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20'+_0x2c4452[_0x27a194(0x1ff)]('/')+'.','location':getLocationFromPath(_0x375e13['document'],_0x375e13[_0x27a194(0x1e9)],pathToArray(_0x416dc1))});}else _0x18b8d1[_0x27a194(0x22a)]({'level':_0x27a194(0x1f9),'path':_0x416dc1,'code':'INVALID_ARRAY_MATCHING','message':_0x27a194(0x230),'location':getLocationFromPath(_0x375e13[_0x27a194(0x1be)],_0x375e13['source'],pathToArray(_0x416dc1))});return _0x18b8d1;}export function validateSegmentDef(_0x573a23,_0x15efaf={}){const _0x37c607=a125_0x58f24c,_0x158b59=[],_0x5477df=[];(!_0x573a23['name']||_0x573a23[_0x37c607(0x187)][_0x37c607(0x1e2)]()==='')&&_0x158b59['push']({'level':'error','path':'name','code':_0x37c607(0x1d9),'message':'Segment\x20name\x20is\x20required','location':getLocationFromPath(_0x15efaf[_0x37c607(0x1be)],_0x15efaf[_0x37c607(0x1e9)],[_0x37c607(0x187)])});if(_0x573a23[_0x37c607(0x1dc)]){const _0x2e1e93=validateRuleDef(_0x573a23[_0x37c607(0x1dc)],_0x37c607(0x1dc),_0x15efaf);for(const _0x39894e of _0x2e1e93){_0x39894e[_0x37c607(0x1bd)]==='error'?_0x158b59[_0x37c607(0x22a)](_0x39894e):_0x5477df[_0x37c607(0x22a)](_0x39894e);}}return{'valid':_0x158b59['length']===0x0,'errors':_0x158b59,'warnings':_0x5477df};}export function validateJourneyDef(_0xcb2a86,_0x5684e3={}){const _0x408da0=a125_0x58f24c,_0x1a22b6=[],_0x2341f1=[];(!_0xcb2a86['name']||_0xcb2a86[_0x408da0(0x187)][_0x408da0(0x1e2)]()==='')&&_0x1a22b6['push']({'level':'error','path':_0x408da0(0x187),'code':_0x408da0(0x1d9),'message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x5684e3['document'],_0x5684e3[_0x408da0(0x1e9)],[_0x408da0(0x187)])});const _0x23f254=new Set();if(_0xcb2a86[_0x408da0(0x1b7)])for(const _0x38d749 of Object[_0x408da0(0x1a4)](_0xcb2a86[_0x408da0(0x1b7)])){_0x23f254[_0x408da0(0x1dd)](_0x38d749);}const _0x45be1d=new Set(),_0x3ac42c={..._0x5684e3,'embeddedSegments':_0x23f254,'referencedSegments':_0x45be1d};if(_0xcb2a86[_0x408da0(0x1b7)])for(const [_0x47b0e6,_0x2e68ae]of Object[_0x408da0(0x226)](_0xcb2a86[_0x408da0(0x1b7)])){const _0x469923=validateEmbeddedSegment(_0x2e68ae,_0x408da0(0x224)+_0x47b0e6,_0x3ac42c);for(const _0x12c115 of _0x469923){if(_0x12c115['level']===_0x408da0(0x1f9))_0x1a22b6[_0x408da0(0x22a)](_0x12c115);else _0x2341f1[_0x408da0(0x22a)](_0x12c115);}}const _0x1b3028=getJourneyStages(_0xcb2a86);_0x1b3028['length']===0x0&&_0x1a22b6[_0x408da0(0x22a)]({'level':'error','path':_0x408da0(0x19e),'code':'MISSING_STAGES','message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x5684e3[_0x408da0(0x1be)],_0x5684e3[_0x408da0(0x1e9)],['stages'])});const _0x310b46=new Set();for(const _0x1fed93 of _0x1b3028){if(_0x1fed93[_0x408da0(0x1ba)])for(const _0x13566a of _0x1fed93['steps']){_0x13566a[_0x408da0(0x187)]&&_0x310b46['add'](_0x13566a[_0x408da0(0x187)]);}}_0x3ac42c[_0x408da0(0x1d1)]=_0x310b46;for(let _0x14218d=0x0;_0x14218d<_0x1b3028[_0x408da0(0x21d)];_0x14218d++){const _0x38d76a=_0x1b3028[_0x14218d],_0x12f81a=_0x408da0(0x1c2)+_0x14218d+']',_0x30e56e=validateStage(_0x38d76a,_0x12f81a,_0x3ac42c);for(const _0x2ecc33 of _0x30e56e){if(_0x2ecc33['level']===_0x408da0(0x1f9))_0x1a22b6[_0x408da0(0x22a)](_0x2ecc33);else _0x2341f1[_0x408da0(0x22a)](_0x2ecc33);}}if(_0xcb2a86[_0x408da0(0x1df)]){const _0x12ddcd=validateCriteria(_0xcb2a86[_0x408da0(0x1df)],_0x408da0(0x1df),_0x3ac42c);for(const _0x3e9506 of _0x12ddcd){if(_0x3e9506[_0x408da0(0x1bd)]===_0x408da0(0x1f9))_0x1a22b6[_0x408da0(0x22a)](_0x3e9506);else _0x2341f1[_0x408da0(0x22a)](_0x3e9506);}}for(const _0x2680c7 of _0x23f254){!_0x45be1d['has'](_0x2680c7)&&!_0x2680c7[_0x408da0(0x1c8)]('excluded_')&&_0x2341f1['push']({'level':'warning','path':_0x408da0(0x224)+_0x2680c7,'code':_0x408da0(0x1a5),'message':_0x408da0(0x227)+_0x2680c7+_0x408da0(0x229),'location':getLocationFromPath(_0x5684e3['document'],_0x5684e3[_0x408da0(0x1e9)],['segments',_0x2680c7])});}return{'valid':_0x1a22b6[_0x408da0(0x21d)]===0x0,'errors':_0x1a22b6,'warnings':_0x2341f1};}function getJourneyStages(_0x5952b7){const _0x8c47dc=a125_0x58f24c;if(_0x5952b7[_0x8c47dc(0x19e)]&&_0x5952b7[_0x8c47dc(0x19e)][_0x8c47dc(0x21d)]>0x0)return _0x5952b7[_0x8c47dc(0x19e)];if(_0x5952b7[_0x8c47dc(0x205)]&&_0x5952b7[_0x8c47dc(0x205)][_0x8c47dc(0x21d)]>0x0)return _0x5952b7['journeys'][_0x8c47dc(0x19d)](_0x4b9701=>_0x4b9701[_0x8c47dc(0x19e)]||[]);if(_0x5952b7[_0x8c47dc(0x1af)]&&_0x5952b7['versions']['length']>0x0)return _0x5952b7['versions']['flatMap'](_0x5a5199=>_0x5a5199[_0x8c47dc(0x19e)]||[]);return[];}function validateEmbeddedSegment(_0x155551,_0x3e06d6,_0x22a65f){const _0x246133=a125_0x58f24c,_0x3a2208=[];return _0x155551['rule']&&_0x3a2208[_0x246133(0x22a)](...validateRuleDef(_0x155551[_0x246133(0x1dc)],_0x3e06d6+_0x246133(0x1ab),_0x22a65f)),_0x3a2208;}function validateStage(_0xe43902,_0x252bfc,_0x28f1f6){const _0x15e9b4=a125_0x58f24c,_0x2f9cc1=[],_0x1f8506=new Map();if(_0xe43902[_0x15e9b4(0x1ba)])for(let _0x67e52d=0x0;_0x67e52d<_0xe43902[_0x15e9b4(0x1ba)][_0x15e9b4(0x21d)];_0x67e52d++){const _0x23e96a=_0xe43902[_0x15e9b4(0x1ba)][_0x67e52d],_0x48bda7=_0x252bfc+_0x15e9b4(0x1ea)+_0x67e52d+']';if(_0x23e96a[_0x15e9b4(0x187)]){if(_0x1f8506[_0x15e9b4(0x1e6)](_0x23e96a[_0x15e9b4(0x187)])){const _0x346173=_0x1f8506[_0x15e9b4(0x1fe)](_0x23e96a[_0x15e9b4(0x187)]);_0x2f9cc1[_0x15e9b4(0x22a)]({'level':_0x15e9b4(0x1f9),'path':_0x48bda7+_0x15e9b4(0x1f2),'code':_0x15e9b4(0x200),'message':_0x15e9b4(0x1fc)+_0x23e96a[_0x15e9b4(0x187)]+_0x15e9b4(0x22c)+_0x346173+'])','location':getLocationFromPath(_0x28f1f6['document'],_0x28f1f6[_0x15e9b4(0x1e9)],pathToArray(_0x48bda7+'.name'))});}else _0x1f8506['set'](_0x23e96a['name'],_0x67e52d);}_0x2f9cc1['push'](...validateStep(_0x23e96a,_0x48bda7,_0x28f1f6));}_0xe43902[_0x15e9b4(0x1d3)]&&_0x2f9cc1[_0x15e9b4(0x22a)](...validateCriteria(_0xe43902[_0x15e9b4(0x1d3)],_0x252bfc+_0x15e9b4(0x192),_0x28f1f6));if(_0xe43902['exit_criteria'])for(let _0x244f39=0x0;_0x244f39<_0xe43902['exit_criteria'][_0x15e9b4(0x21d)];_0x244f39++){_0x2f9cc1[_0x15e9b4(0x22a)](...validateCriteria(_0xe43902[_0x15e9b4(0x204)][_0x244f39],_0x252bfc+_0x15e9b4(0x1b2)+_0x244f39+']',_0x28f1f6));}return _0xe43902['milestone']&&_0x2f9cc1[_0x15e9b4(0x22a)](...validateCriteria(_0xe43902[_0x15e9b4(0x1ed)],_0x252bfc+'.milestone',_0x28f1f6)),_0x2f9cc1;}function validateStep(_0x43a99a,_0x2a50ec,_0x3beeb9){const _0xd84de=a125_0x58f24c,_0xa5a6d1=[];_0x43a99a[_0xd84de(0x1fd)]&&_0x43a99a[_0xd84de(0x1ae)]!==_0xd84de(0x195)&&(_0x3beeb9['stepNames']&&!_0x3beeb9[_0xd84de(0x1d1)][_0xd84de(0x1e6)](_0x43a99a[_0xd84de(0x1fd)])&&_0xa5a6d1['push']({'level':_0xd84de(0x1f9),'path':_0x2a50ec+'.next','code':_0xd84de(0x1f1),'message':_0xd84de(0x1c3)+_0x43a99a[_0xd84de(0x1fd)]+'\x27','location':getLocationFromPath(_0x3beeb9['document'],_0x3beeb9[_0xd84de(0x1e9)],pathToArray(_0x2a50ec+_0xd84de(0x19f)))}));switch(_0x43a99a[_0xd84de(0x1ae)]){case'wait':_0xa5a6d1['push'](...validateWaitStep(_0x43a99a,_0x2a50ec,_0x3beeb9));break;case _0xd84de(0x19c):_0xa5a6d1[_0xd84de(0x22a)](...validateActivationStep(_0x43a99a,_0x2a50ec,_0x3beeb9));break;case _0xd84de(0x223):_0xa5a6d1[_0xd84de(0x22a)](...validateDecisionPointStep(_0x43a99a,_0x2a50ec,_0x3beeb9));break;case _0xd84de(0x206):_0xa5a6d1[_0xd84de(0x22a)](...validateAbTestStep(_0x43a99a,_0x2a50ec,_0x3beeb9));break;case _0xd84de(0x1e5):_0xa5a6d1[_0xd84de(0x22a)](...validateJumpStep(_0x43a99a,_0x2a50ec,_0x3beeb9));break;}return _0xa5a6d1;}function validateWaitStep(_0x315bd6,_0x11e5cf,_0x3bf384){const _0x2c7785=a125_0x58f24c,_0x5149c2=[];if(!_0x315bd6[_0x2c7785(0x208)])return _0x5149c2[_0x2c7785(0x22a)]({'level':_0x2c7785(0x1f9),'path':_0x11e5cf+_0x2c7785(0x198),'code':'MISSING_WAIT_PARAMS','message':'Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','location':getLocationFromPath(_0x3bf384[_0x2c7785(0x1be)],_0x3bf384[_0x2c7785(0x1e9)],pathToArray(_0x11e5cf))}),_0x5149c2;if(_0x315bd6[_0x2c7785(0x208)]['condition']){const _0x179506=_0x315bd6[_0x2c7785(0x208)][_0x2c7785(0x21a)];_0x179506['segment']&&(_0x3bf384[_0x2c7785(0x1e1)]?.[_0x2c7785(0x1dd)](_0x179506[_0x2c7785(0x1d6)]),!_0x179506[_0x2c7785(0x1d6)][_0x2c7785(0x1c8)](_0x2c7785(0x1ad))&&(_0x3bf384[_0x2c7785(0x1ec)]&&!_0x3bf384['embeddedSegments'][_0x2c7785(0x1e6)](_0x179506[_0x2c7785(0x1d6)])&&_0x5149c2[_0x2c7785(0x22a)]({'level':_0x2c7785(0x1f9),'path':_0x11e5cf+_0x2c7785(0x1ca),'code':_0x2c7785(0x20c),'message':'Wait\x20condition\x20references\x20undefined\x20segment\x20\x27'+_0x179506[_0x2c7785(0x1d6)]+'\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','location':getLocationFromPath(_0x3bf384[_0x2c7785(0x1be)],_0x3bf384[_0x2c7785(0x1e9)],pathToArray(_0x11e5cf+_0x2c7785(0x1ca)))})),_0x179506[_0x2c7785(0x1fd)]&&_0x3bf384[_0x2c7785(0x1d1)]&&!_0x3bf384[_0x2c7785(0x1d1)][_0x2c7785(0x1e6)](_0x179506['next'])&&_0x5149c2[_0x2c7785(0x22a)]({'level':'error','path':_0x11e5cf+_0x2c7785(0x1e3),'code':_0x2c7785(0x1f1),'message':_0x2c7785(0x1fb)+_0x179506['next']+'\x27','location':getLocationFromPath(_0x3bf384[_0x2c7785(0x1be)],_0x3bf384['source'],pathToArray(_0x11e5cf+_0x2c7785(0x1e3)))}),_0x179506[_0x2c7785(0x214)]?.['next']&&_0x3bf384['stepNames']&&!_0x3bf384['stepNames']['has'](_0x179506[_0x2c7785(0x214)][_0x2c7785(0x1fd)])&&_0x5149c2[_0x2c7785(0x22a)]({'level':_0x2c7785(0x1f9),'path':_0x11e5cf+'.with.condition.timeout.next','code':'INVALID_NEXT_REFERENCE','message':_0x2c7785(0x1e0)+_0x179506[_0x2c7785(0x214)]['next']+'\x27','location':getLocationFromPath(_0x3bf384['document'],_0x3bf384['source'],pathToArray(_0x11e5cf+_0x2c7785(0x219)))}));}return _0x5149c2;}function validateActivationStep(_0x20f1d2,_0x45f8ef,_0xfc5819){const _0x45635b=a125_0x58f24c,_0x474a48=[];return!_0x20f1d2[_0x45635b(0x208)]?.['activation']&&_0x474a48[_0x45635b(0x22a)]({'level':'error','path':_0x45f8ef+_0x45635b(0x1d2),'code':_0x45635b(0x21e),'message':_0x45635b(0x1bb),'location':getLocationFromPath(_0xfc5819[_0x45635b(0x1be)],_0xfc5819[_0x45635b(0x1e9)],pathToArray(_0x45f8ef))}),_0x474a48;}function validateDecisionPointStep(_0x325557,_0x424cf7,_0x239b08){const _0x3e00bb=a125_0x58f24c,_0x545f75=[];if(!_0x325557[_0x3e00bb(0x208)]?.[_0x3e00bb(0x19b)]||_0x325557[_0x3e00bb(0x208)]['branches'][_0x3e00bb(0x21d)]===0x0)return _0x545f75['push']({'level':_0x3e00bb(0x1f9),'path':_0x424cf7+'.with.branches','code':_0x3e00bb(0x22f),'message':_0x3e00bb(0x207),'location':getLocationFromPath(_0x239b08[_0x3e00bb(0x1be)],_0x239b08[_0x3e00bb(0x1e9)],pathToArray(_0x424cf7))}),_0x545f75;for(let _0x3843a6=0x0;_0x3843a6<_0x325557['with'][_0x3e00bb(0x19b)][_0x3e00bb(0x21d)];_0x3843a6++){const _0x157ca1=_0x325557[_0x3e00bb(0x208)][_0x3e00bb(0x19b)][_0x3843a6],_0x1483f8=_0x424cf7+_0x3e00bb(0x18e)+_0x3843a6+']';_0x157ca1['segment']&&!_0x157ca1[_0x3e00bb(0x1aa)]&&(_0x239b08['referencedSegments']?.[_0x3e00bb(0x1dd)](_0x157ca1['segment']),!_0x157ca1[_0x3e00bb(0x1d6)][_0x3e00bb(0x1c8)](_0x3e00bb(0x1ad))&&(_0x239b08[_0x3e00bb(0x1ec)]&&!_0x239b08[_0x3e00bb(0x1ec)][_0x3e00bb(0x1e6)](_0x157ca1[_0x3e00bb(0x1d6)])&&_0x545f75[_0x3e00bb(0x22a)]({'level':_0x3e00bb(0x1f9),'path':_0x1483f8+'.segment','code':'MISSING_SEGMENT_REFERENCE','message':_0x3e00bb(0x22b)+_0x157ca1[_0x3e00bb(0x1d6)]+'\x27','location':getLocationFromPath(_0x239b08[_0x3e00bb(0x1be)],_0x239b08[_0x3e00bb(0x1e9)],pathToArray(_0x1483f8+_0x3e00bb(0x212)))}))),_0x157ca1['next']&&_0x239b08[_0x3e00bb(0x1d1)]&&!_0x239b08[_0x3e00bb(0x1d1)]['has'](_0x157ca1[_0x3e00bb(0x1fd)])&&_0x545f75['push']({'level':_0x3e00bb(0x1f9),'path':_0x1483f8+_0x3e00bb(0x19f),'code':_0x3e00bb(0x1f1),'message':_0x3e00bb(0x21c)+_0x157ca1[_0x3e00bb(0x1fd)]+'\x27','location':getLocationFromPath(_0x239b08[_0x3e00bb(0x1be)],_0x239b08[_0x3e00bb(0x1e9)],pathToArray(_0x1483f8+_0x3e00bb(0x19f)))});}return _0x545f75;}function validateAbTestStep(_0x593b82,_0x568806,_0x268407){const _0x5a1f64=a125_0x58f24c,_0x560fad=[];if(!_0x593b82[_0x5a1f64(0x208)]?.[_0x5a1f64(0x1c9)]||_0x593b82[_0x5a1f64(0x208)][_0x5a1f64(0x1c9)][_0x5a1f64(0x21d)]===0x0)return _0x560fad[_0x5a1f64(0x22a)]({'level':_0x5a1f64(0x1f9),'path':_0x568806+_0x5a1f64(0x1cd),'code':_0x5a1f64(0x22f),'message':_0x5a1f64(0x1b9),'location':getLocationFromPath(_0x268407['document'],_0x268407[_0x5a1f64(0x1e9)],pathToArray(_0x568806))}),_0x560fad;const _0x4cfbf7=_0x593b82[_0x5a1f64(0x208)][_0x5a1f64(0x1c9)][_0x5a1f64(0x1a7)]((_0xc7a5b3,_0x265093)=>_0xc7a5b3+(_0x265093['percentage']||0x0),0x0);Math[_0x5a1f64(0x1c6)](_0x4cfbf7-0x64)>0.01&&_0x560fad[_0x5a1f64(0x22a)]({'level':_0x5a1f64(0x1f9),'path':_0x568806+'.with.variants','code':_0x5a1f64(0x216),'message':_0x5a1f64(0x18f)+_0x4cfbf7+'%)','location':getLocationFromPath(_0x268407[_0x5a1f64(0x1be)],_0x268407[_0x5a1f64(0x1e9)],pathToArray(_0x568806+_0x5a1f64(0x1cd)))});for(let _0x504291=0x0;_0x504291<_0x593b82[_0x5a1f64(0x208)][_0x5a1f64(0x1c9)][_0x5a1f64(0x21d)];_0x504291++){const _0x5dcc77=_0x593b82[_0x5a1f64(0x208)]['variants'][_0x504291];_0x5dcc77[_0x5a1f64(0x1fd)]&&_0x268407['stepNames']&&!_0x268407[_0x5a1f64(0x1d1)]['has'](_0x5dcc77[_0x5a1f64(0x1fd)])&&_0x560fad[_0x5a1f64(0x22a)]({'level':_0x5a1f64(0x1f9),'path':_0x568806+'.with.variants['+_0x504291+_0x5a1f64(0x1b5),'code':'INVALID_NEXT_REFERENCE','message':_0x5a1f64(0x1f7)+_0x5dcc77['next']+'\x27','location':getLocationFromPath(_0x268407[_0x5a1f64(0x1be)],_0x268407[_0x5a1f64(0x1e9)],pathToArray(_0x568806+_0x5a1f64(0x1a9)+_0x504291+_0x5a1f64(0x1b5)))});}return _0x560fad;}function validateJumpStep(_0x37e9e0,_0x2d72a2,_0x1c02ce){const _0x50e089=a125_0x58f24c,_0x2e746e=[];if(!_0x37e9e0[_0x50e089(0x208)]?.[_0x50e089(0x1f6)])return _0x2e746e[_0x50e089(0x22a)]({'level':_0x50e089(0x1f9),'path':_0x2d72a2+_0x50e089(0x203),'code':_0x50e089(0x1ef),'message':_0x50e089(0x1eb),'location':getLocationFromPath(_0x1c02ce['document'],_0x1c02ce['source'],pathToArray(_0x2d72a2))}),_0x2e746e;return(!_0x37e9e0[_0x50e089(0x208)][_0x50e089(0x1f6)][_0x50e089(0x1db)]||!_0x37e9e0[_0x50e089(0x208)][_0x50e089(0x1f6)][_0x50e089(0x186)])&&_0x2e746e['push']({'level':_0x50e089(0x1f9),'path':_0x2d72a2+_0x50e089(0x203),'code':_0x50e089(0x1ef),'message':_0x50e089(0x1ac),'location':getLocationFromPath(_0x1c02ce[_0x50e089(0x1be)],_0x1c02ce[_0x50e089(0x1e9)],pathToArray(_0x2d72a2+_0x50e089(0x203)))}),_0x2e746e;}function validateCriteria(_0x357733,_0x38a605,_0x1161b9){const _0x1f7a25=a125_0x58f24c,_0x2ec447=[];return _0x357733[_0x1f7a25(0x1d6)]&&(_0x1161b9[_0x1f7a25(0x1e1)]?.[_0x1f7a25(0x1dd)](_0x357733[_0x1f7a25(0x1d6)]),!_0x357733[_0x1f7a25(0x1d6)][_0x1f7a25(0x1c8)](_0x1f7a25(0x1ad))&&(_0x1161b9[_0x1f7a25(0x1ec)]&&!_0x1161b9['embeddedSegments'][_0x1f7a25(0x1e6)](_0x357733[_0x1f7a25(0x1d6)])&&_0x2ec447[_0x1f7a25(0x22a)]({'level':'error','path':_0x38a605+_0x1f7a25(0x212),'code':_0x1f7a25(0x20c),'message':_0x1f7a25(0x189)+_0x357733[_0x1f7a25(0x1d6)]+'\x27','location':getLocationFromPath(_0x1161b9[_0x1f7a25(0x1be)],_0x1161b9[_0x1f7a25(0x1e9)],pathToArray(_0x38a605+_0x1f7a25(0x212)))}))),_0x2ec447;}export function formatIssueWithContext(_0x21fc5f,_0x5e4092,_0x595508){const _0x1358b9=a125_0x58f24c,_0x50d748=[],_0x50731c=_0x21fc5f['level']===_0x1358b9(0x1f9),_0x135620=_0x50731c?a125_0x2a9868[_0x1358b9(0x194)]:a125_0x2a9868['yellow'],_0x4ccf57=_0x50731c?a125_0x2a9868[_0x1358b9(0x194)]:a125_0x2a9868[_0x1358b9(0x211)],_0x295869=_0x595508?a125_0x2a9868[_0x1358b9(0x210)](_0x595508+':'):'';if(_0x21fc5f['location']){const _0x2bdf87=a125_0x2a9868['cyan'](_0x21fc5f['location']['line']+':'+_0x21fc5f[_0x1358b9(0x209)]['column']);_0x50d748[_0x1358b9(0x22a)](''+_0x295869+_0x2bdf87+':\x20'+_0x135620(_0x21fc5f[_0x1358b9(0x1bd)])+'\x20'+_0x4ccf57('['+_0x21fc5f['code']+']'));}else _0x50d748[_0x1358b9(0x22a)](''+_0x295869+a125_0x2a9868[_0x1358b9(0x1f3)](_0x21fc5f[_0x1358b9(0x233)])+':\x20'+_0x135620(_0x21fc5f[_0x1358b9(0x1bd)])+'\x20'+_0x4ccf57('['+_0x21fc5f[_0x1358b9(0x1d5)]+']'));_0x50d748[_0x1358b9(0x22a)](_0x21fc5f[_0x1358b9(0x1cb)]);if(_0x21fc5f[_0x1358b9(0x209)]&&_0x5e4092){const _0x5e6d1d=_0x5e4092[_0x1358b9(0x20b)]('\x0a'),{line:_0x455568,column:_0x1a07e8}=_0x21fc5f[_0x1358b9(0x209)],_0x3bbd88=Math[_0x1358b9(0x197)](0x1,_0x455568-0x1),_0x5b2eef=Math['min'](_0x5e6d1d[_0x1358b9(0x21d)],_0x455568+0x1);_0x50d748[_0x1358b9(0x22a)]('');for(let _0x5b1743=_0x3bbd88;_0x5b1743<=_0x5b2eef;_0x5b1743++){const _0x2808cf=_0x5e6d1d[_0x5b1743-0x1]||'',_0x1ece60=a125_0x2a9868['dim'](_0x5b1743[_0x1358b9(0x213)]()[_0x1358b9(0x20e)](0x4)),_0x311035=a125_0x2a9868[_0x1358b9(0x1f3)](_0x1358b9(0x1d8));if(_0x5b1743===_0x455568){_0x50d748['push']('\x20\x20'+_0x1ece60+_0x311035+_0x135620(_0x2808cf));const _0x2ac5e3='\x20'['repeat'](0x4+0x3+_0x1a07e8-0x1);_0x50d748[_0x1358b9(0x22a)]('\x20\x20'+_0x2ac5e3+_0x135620('^'));}else _0x50d748['push']('\x20\x20'+_0x1ece60+_0x311035+a125_0x2a9868[_0x1358b9(0x1f3)](_0x2808cf));}}return _0x50d748['join']('\x0a');}export function formatValidationResult(_0x10f846,_0x3053d3,_0x2587ae){const _0x220e0a=a125_0x58f24c,_0x8c84f0=[];for(const _0x3a263c of _0x10f846[_0x220e0a(0x1b6)]){_0x8c84f0[_0x220e0a(0x22a)](formatIssueWithContext(_0x3a263c,_0x3053d3,_0x2587ae)),_0x8c84f0[_0x220e0a(0x22a)]('');}for(const _0x5de085 of _0x10f846[_0x220e0a(0x221)]){_0x8c84f0[_0x220e0a(0x22a)](formatIssueWithContext(_0x5de085,_0x3053d3,_0x2587ae)),_0x8c84f0[_0x220e0a(0x22a)]('');}return _0x8c84f0[_0x220e0a(0x1ff)]('\x0a');}
|
package/dist/sdk/segment.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a126_0x2b96c3=a126_0x436f;(function(_0x501064,_0x463bd8){const _0x24a130=a126_0x436f,_0x13daf2=_0x501064();while(!![]){try{const _0x2b6e46=parseInt(_0x24a130(0x1b4))/0x1*(-parseInt(_0x24a130(0x127))/0x2)+-parseInt(_0x24a130(0x156))/0x3*(-parseInt(_0x24a130(0x1a5))/0x4)+-parseInt(_0x24a130(0x182))/0x5*(-parseInt(_0x24a130(0x18e))/0x6)+parseInt(_0x24a130(0x151))/0x7*(parseInt(_0x24a130(0x19c))/0x8)+-parseInt(_0x24a130(0x14e))/0x9+-parseInt(_0x24a130(0x1c1))/0xa*(parseInt(_0x24a130(0x17a))/0xb)+parseInt(_0x24a130(0x16c))/0xc;if(_0x2b6e46===_0x463bd8)break;else _0x13daf2['push'](_0x13daf2['shift']());}catch(_0x288cb0){_0x13daf2['push'](_0x13daf2['shift']());}}}(a126_0x15d8,0xae798));import{CDPApiClient}from'./client/cdp-api-client.js';import{TrinoApiClient}from'./client/trino-api-client.js';function a126_0x436f(_0x3002f7,_0x3948ac){_0x3002f7=_0x3002f7-0x123;const _0x15d8e8=a126_0x15d8();let _0x436f60=_0x15d8e8[_0x3002f7];return _0x436f60;}import{SDKError,ErrorCode}from'./errors.js';function a126_0x15d8(){const _0xe3aa40=['schemaValid','segment-batch','segment-realtime','journeyBundleName','Attribute\x20\x27','Counting\x20master\x20table\x20rows...','4330165DpcEUy','behaviors','onProgress','groupingName','getEntityParentFolderId','executeQuery','getSegmentFolder','getParentSegmentSQL','createFolder','parentFolderId','isArray','matched_count','6FKazuE','Path\x20cannot\x20be\x20empty','join','relationships','folder-segment','filter','resolveFolderId','journeyBundleId','behavior','INVALID_ARGUMENT','has','detectResourceType','buildTreeNodesForFolder','createParent','104sHXMCE','then','enriched','parent','parent\x20segment','trinoClient','detectResourceTypeInFolder','getParentSQL','entity','5700052GEhulR','message','source','all','catch','Behavior\x20\x27','push','rowCount','sampleData','interval','segment','pullSegments','resolveSegmentId','parentColumn','length','1185244FplCzi','deleteActivation','createJourneySegment','journey','Parent\x20segment\x20not\x20found:\x20','createSegment','row_count','totalEvents','buildTreeFromEntities','resolveParentIdOrName','error','updatedAt','runParent','1207330kJgUyP','population','getParentSegment','type','pushParentYaml','entityToFolder','getActivation','parentFolder','resolveParentId','get','database','Validating\x20all\x20attributes\x20and\x20behaviors\x20in\x20parallel...','updateParent','pullParentYaml','2Cwapkn','data','Fetching\x20enriched\x20master\x20data...','versionNumber','Validating\x20all\x20attributes\x20in\x20parallel...','customers_with_events','test','Fetching\x20master\x20sample\x20data...','\x27\x20not\x20found\x20in\x20','updateActivation','Calculating\x20coverage\x20for:\x20','Validating\x20master\x20table:\x20','ambiguous','getParentFull','getFolder','parentTableName','segmentFolderId','getParentSegmentFull','state','Enriched\x20query:\x20','connection','\x27\x20not\x20found\x20in\x20path','Fetching\x20sample\x20data\x20for:\x20','child_key','createParentSegment','listEntitiesByFolder','customersWithEvents','\x27\x20not\x20found\x20in\x20parent\x20segment','string','listActivations','entityToSegment','listRecursive','folder','client','map','schema','some','matchedCount','parentDatabaseName','10935630kvlLlw','Validating\x20behavior:\x20','getAudienceBehaviors','180313wyzNPa','listFolders','segments','master','listSegmentFolders','3McmpnZ','table','allValid','isAbsolute','getSegment','schemaError','attribute','createActivation','updateParentSegment','attributes','getSegmentSQL','traversePath','listUnifiedWithJourneys','parent_key','\x20in\x20parent\x20','\x27\x20not\x20found','resolvePathToResource','find','SEGMENT_NOT_FOUND','Resource\x20\x27','createdAt','Master\x20table:\x20','7317384vtQcjm','validateParentYaml','description','updateSegment','Folder\x20\x27','updateSegmentById','deleteSegment','listSegments','set','listParents','Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)','\x27:\x20','customerPercent','rootFolderId','11XzufsJ','name'];a126_0x15d8=function(){return _0xe3aa40;};return a126_0x15d8();}import{deduplicateJourneysByBundle,entityToJourneyListItem,parseJourneyState}from'./journey.js';import{parsePath}from'./segment/segment-path-parser.js';import{pullSegments as a126_0x13f71c}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{[a126_0x2b96c3(0x148)];['trinoClient'];constructor(_0x3c2620){const _0x41eb7d=a126_0x2b96c3;this[_0x41eb7d(0x148)]=new CDPApiClient(_0x3c2620),this[_0x41eb7d(0x1a1)]=new TrinoApiClient(_0x3c2620);}async[a126_0x2b96c3(0x175)](){const _0x23d28f=a126_0x2b96c3;return await this[_0x23d28f(0x148)]['listParentSegments']();}async['getParent'](_0x50d55a){const _0xf1756e=a126_0x2b96c3;return await this[_0xf1756e(0x148)][_0xf1756e(0x1c3)](_0x50d55a);}async[a126_0x2b96c3(0x173)](_0x5be163){const _0x5ce250=a126_0x2b96c3;return await this[_0x5ce250(0x148)][_0x5ce250(0x173)](_0x5be163);}async[a126_0x2b96c3(0x15a)](_0x35bdb8,_0xca6e61){const _0xf70ad9=a126_0x2b96c3;return await this[_0xf70ad9(0x148)]['getSegment'](_0x35bdb8,_0xca6e61);}async[a126_0x2b96c3(0x152)](_0x8f238f){const _0x29fe48=a126_0x2b96c3;return await this[_0x29fe48(0x148)][_0x29fe48(0x155)](_0x8f238f);}async[a126_0x2b96c3(0x135)](_0x29b8df){const _0x89cb96=a126_0x2b96c3;return await this[_0x89cb96(0x148)][_0x89cb96(0x188)](_0x29b8df);}async['listActivations'](_0x21f43d,_0x45e67e){const _0xd4e5bf=a126_0x2b96c3;return await this[_0xd4e5bf(0x148)][_0xd4e5bf(0x144)](_0x21f43d,_0x45e67e);}async['getActivation'](_0x4046ab,_0x107c24,_0x1e3a93){const _0x533377=a126_0x2b96c3;return await this[_0x533377(0x148)][_0x533377(0x1c7)](_0x4046ab,_0x107c24,_0x1e3a93);}async[a126_0x2b96c3(0x15d)](_0x3babeb,_0x5c977c,_0x577f3a){const _0x3873d4=a126_0x2b96c3;return await this[_0x3873d4(0x148)]['createActivation'](_0x3babeb,_0x5c977c,_0x577f3a);}async[a126_0x2b96c3(0x130)](_0x6d143d,_0x635a94,_0x45b7f0,_0x50a18a){const _0x321c55=a126_0x2b96c3;return await this[_0x321c55(0x148)]['updateActivation'](_0x6d143d,_0x635a94,_0x45b7f0,_0x50a18a);}async[a126_0x2b96c3(0x1b5)](_0x1256b6,_0xd38489,_0x40d52c){const _0x59a691=a126_0x2b96c3;return await this[_0x59a691(0x148)]['deleteActivation'](_0x1256b6,_0xd38489,_0x40d52c);}async[a126_0x2b96c3(0x1a3)](_0x357fc5){const _0x4656b8=a126_0x2b96c3;return await this['client'][_0x4656b8(0x189)](_0x357fc5);}async[a126_0x2b96c3(0x160)](_0x1ca9ad,_0x4d825e){const _0x6557f5=a126_0x2b96c3;return await this['client'][_0x6557f5(0x160)](_0x1ca9ad,_0x4d825e);}async[a126_0x2b96c3(0x1c9)](_0xe6fd26){const _0x445409=a126_0x2b96c3,_0x50beaf=await this[_0x445409(0x175)](),_0x389867=_0x50beaf[_0x445409(0x167)](_0x609348=>_0x609348[_0x445409(0x15f)][_0x445409(0x17b)]===_0xe6fd26);if(!_0x389867)throw new SDKError(ErrorCode[_0x445409(0x168)],_0x445409(0x1b8)+_0xe6fd26);return _0x389867['id'];}async[a126_0x2b96c3(0x1c0)](_0x325c58){const _0x1c9626=a126_0x2b96c3;let _0x3a0153=_0x325c58;return!/^\d+$/['test'](_0x325c58)&&(_0x3a0153=await this[_0x1c9626(0x1c9)](_0x325c58)),await this[_0x1c9626(0x148)]['runParentSegment'](_0x3a0153);}async[a126_0x2b96c3(0x1b1)](_0x35ee6c,_0x5d07c7){const _0xc5c26c=a126_0x2b96c3,_0x13f8ca=await this[_0xc5c26c(0x173)](_0x35ee6c),_0x2b3ade=_0x13f8ca[_0xc5c26c(0x167)](_0xe14b6c=>_0xe14b6c[_0xc5c26c(0x17b)]===_0x5d07c7);if(!_0x2b3ade)throw new SDKError(ErrorCode[_0xc5c26c(0x168)],'Child\x20segment\x20not\x20found:\x20'+_0x5d07c7+_0xc5c26c(0x164)+_0x35ee6c);return _0x2b3ade['id'];}async['resolveFolderId'](_0x1b6fa3,_0x15351a){const _0x5665c1=a126_0x2b96c3,_0x107285=await this[_0x5665c1(0x152)](_0x1b6fa3),_0x267584=_0x107285[_0x5665c1(0x167)](_0x4e77db=>_0x4e77db[_0x5665c1(0x17b)]===_0x15351a);if(!_0x267584)throw new SDKError(ErrorCode[_0x5665c1(0x168)],'Folder\x20not\x20found:\x20'+_0x15351a+_0x5665c1(0x164)+_0x1b6fa3);return _0x267584['id'];}async['listFields'](_0x4ad8cc){const _0x1ee9b8=a126_0x2b96c3,_0x2c0780=await this[_0x1ee9b8(0x1bd)](_0x4ad8cc),[_0x382f93,_0x5b0fd5]=await Promise[_0x1ee9b8(0x1a8)]([this[_0x1ee9b8(0x148)]['getAudienceAttributes'](_0x2c0780),this[_0x1ee9b8(0x148)][_0x1ee9b8(0x150)](_0x2c0780)]),_0x403160=[];for(const _0xc180d of _0x382f93){_0x403160[_0x1ee9b8(0x1ab)]({'name':_0xc180d[_0x1ee9b8(0x17b)],'type':_0xc180d['type'],'source':_0x1ee9b8(0x15c),'parentDatabaseName':_0xc180d['parentDatabaseName'],'parentTableName':_0xc180d[_0x1ee9b8(0x136)],'parentColumn':_0xc180d[_0x1ee9b8(0x1b2)],'groupingName':_0xc180d[_0x1ee9b8(0x185)]??undefined});}for(const _0x3f731d of _0x5b0fd5){const _0x54468e=_0x3f731d[_0x1ee9b8(0x17b)];if(_0x3f731d['schema']&&Array[_0x1ee9b8(0x18c)](_0x3f731d[_0x1ee9b8(0x14a)]))for(const _0x5a721d of _0x3f731d[_0x1ee9b8(0x14a)]){_0x5a721d['name']&&_0x5a721d[_0x1ee9b8(0x1c4)]&&_0x403160[_0x1ee9b8(0x1ab)]({'name':_0x54468e+'.'+_0x5a721d['name'],'type':_0x5a721d[_0x1ee9b8(0x1c4)],'source':_0x1ee9b8(0x196),'behaviorName':_0x54468e,'parentDatabaseName':_0x3f731d[_0x1ee9b8(0x14d)],'parentTableName':_0x3f731d[_0x1ee9b8(0x136)],'parentColumn':_0x5a721d[_0x1ee9b8(0x1b2)]});}}return _0x403160;}async[a126_0x2b96c3(0x19b)](_0xe2eda7){const _0x1b218f=a126_0x2b96c3;return await this[_0x1b218f(0x148)][_0x1b218f(0x13f)](_0xe2eda7);}async[a126_0x2b96c3(0x125)](_0x44fd50,_0x135d4e){const _0x489383=a126_0x2b96c3,_0x40950c=await this[_0x489383(0x1bd)](_0x44fd50);return await this[_0x489383(0x148)][_0x489383(0x15e)](_0x40950c,_0x135d4e);}async[a126_0x2b96c3(0x134)](_0x440b60){const _0x555d45=a126_0x2b96c3,_0x205e6a=await this[_0x555d45(0x1bd)](_0x440b60);return await this[_0x555d45(0x148)][_0x555d45(0x138)](_0x205e6a);}async[a126_0x2b96c3(0x126)](_0x4185dc){const _0x552f74=await this['getParentFull'](_0x4185dc),_0x1a4dd8=apiToDef(_0x552f74);return serializeDef(_0x1a4dd8);}async[a126_0x2b96c3(0x1c5)](_0xf42e4){const _0x1ac79c=a126_0x2b96c3,_0x5053ee=typeof _0xf42e4===_0x1ac79c(0x143)?parseDef(_0xf42e4):_0xf42e4,_0x2ec89c=defToApi(_0x5053ee);let _0x565e15=null,_0x4fa031='';try{_0x565e15=await this[_0x1ac79c(0x134)](_0x5053ee[_0x1ac79c(0x17b)]);const _0x455a61=apiToDef(_0x565e15);_0x4fa031=serializeDef(_0x455a61);}catch{}const _0x5a8df7=serializeDef(_0x5053ee),_0x3d7be7=generateDiff(_0x4fa031,_0x5a8df7),_0x157a0e=formatDiffWithColors(_0x3d7be7),_0x427779=_0x565e15===null,_0x14b772=hasChanges(_0x3d7be7),_0x5ea520={'isNew':_0x427779,'id':_0x565e15?.['id']||'','name':_0x5053ee[_0x1ac79c(0x17b)],'diff':_0x3d7be7,'diffFormatted':_0x157a0e,'hasChanges':_0x14b772},_0x19360b=async()=>{const _0x496493=_0x1ac79c;return _0x427779?await this['createParent'](_0x2ec89c):await this[_0x496493(0x125)](_0x565e15['id'],_0x2ec89c);};return{..._0x5ea520,'apply':_0x19360b};}async[a126_0x2b96c3(0x16d)](_0x2dc7c3,_0x155b7a={}){const _0x7f773d=a126_0x2b96c3,_0x13cf8a=typeof _0x2dc7c3===_0x7f773d(0x143)?parseDef(_0x2dc7c3):_0x2dc7c3,_0x35fb5d=[];let _0x6f45d=!![];const _0x51f006=_0xdadb02=>_0x155b7a[_0x7f773d(0x184)]?.(_0xdadb02),_0x4a9cec={'name':_0x13cf8a['name'],'master':{'database':_0x13cf8a[_0x7f773d(0x154)][_0x7f773d(0x123)],'table':_0x13cf8a['master'][_0x7f773d(0x157)],'schemaValid':![]},'attributes':[],'behaviors':[],'errors':_0x35fb5d,'allValid':!![]},_0x14d436=async _0xe6c1cc=>{const _0x4510e2=_0x7f773d;try{const _0x47b6a8=await this[_0x4510e2(0x1a1)]['executeQuery'](_0xe6c1cc);return{'data':_0x47b6a8[_0x4510e2(0x128)]};}catch(_0x186f91){const _0x198b1b=_0x186f91 instanceof Error?_0x186f91[_0x4510e2(0x1a6)]:String(_0x186f91);return{'data':[],'error':_0x198b1b};}};_0x51f006(_0x7f773d(0x132)+_0x13cf8a[_0x7f773d(0x154)]['database']+'.'+_0x13cf8a[_0x7f773d(0x154)][_0x7f773d(0x157)]);const _0x1f3fca=generateSchemaValidationSQL(_0x13cf8a[_0x7f773d(0x154)][_0x7f773d(0x123)],_0x13cf8a['master']['table']),_0x1efa80=await _0x14d436(_0x1f3fca);if(_0x1efa80[_0x7f773d(0x1be)])_0x4a9cec[_0x7f773d(0x154)][_0x7f773d(0x17c)]=![],_0x4a9cec[_0x7f773d(0x154)][_0x7f773d(0x15b)]=_0x1efa80['error'],_0x35fb5d['push'](_0x7f773d(0x16b)+_0x1efa80[_0x7f773d(0x1be)]),_0x6f45d=![];else{_0x4a9cec[_0x7f773d(0x154)][_0x7f773d(0x17c)]=!![],_0x51f006(_0x7f773d(0x181));const _0x5d4e42=await _0x14d436(generateMasterCountSQL(_0x13cf8a));!_0x5d4e42[_0x7f773d(0x1be)]&&_0x5d4e42[_0x7f773d(0x128)][_0x7f773d(0x1b3)]>0x0&&(_0x4a9cec[_0x7f773d(0x154)][_0x7f773d(0x1ac)]=_0x5d4e42[_0x7f773d(0x128)][0x0][_0x7f773d(0x1ba)]);}if(_0x155b7a['master'])return _0x4a9cec['allValid']=_0x6f45d,_0x4a9cec;const _0x412a3d=async _0x588749=>{const _0x199555=_0x7f773d,_0x74acd5={'name':_0x588749['name'],'database':_0x588749['source']['database'],'table':_0x588749['source'][_0x199555(0x157)],'joinKey':_0x588749[_0x199555(0x190)][_0x199555(0x13e)],'foreignKey':_0x588749[_0x199555(0x190)][_0x199555(0x163)],'columns':getAttributeColumns(_0x588749),'schemaValid':![]};_0x51f006('Validating\x20attribute:\x20'+_0x588749['name']);const _0x43e3f8=await _0x14d436(generateAttributeSchemaSQL(_0x13cf8a,_0x588749));if(_0x43e3f8[_0x199555(0x1be)])_0x74acd5['schemaError']=_0x43e3f8['error'];else{_0x74acd5[_0x199555(0x17c)]=!![],_0x51f006(_0x199555(0x131)+_0x588749['name']);const _0x1c3704=await _0x14d436(generateAttributeCoverageSQL(_0x13cf8a,_0x588749));!_0x1c3704[_0x199555(0x1be)]&&_0x1c3704[_0x199555(0x128)][_0x199555(0x1b3)]>0x0&&(_0x74acd5[_0x199555(0x14c)]=_0x1c3704[_0x199555(0x128)][0x0][_0x199555(0x18d)],_0x4a9cec[_0x199555(0x154)][_0x199555(0x1ac)]&&_0x4a9cec[_0x199555(0x154)][_0x199555(0x1ac)]>0x0&&(_0x74acd5['coveragePercent']=_0x74acd5[_0x199555(0x14c)]/_0x4a9cec[_0x199555(0x154)][_0x199555(0x1ac)]*0x64));}return _0x74acd5;},_0x13cc36=async(_0xba8d52,_0x4b4f1c)=>{const _0x1d9a68=_0x7f773d,_0xcdc0d8={'name':_0xba8d52['name'],'database':_0xba8d52[_0x1d9a68(0x1a7)]['database'],'table':_0xba8d52['source'][_0x1d9a68(0x157)],'joinKey':_0xba8d52['join'][_0x1d9a68(0x13e)],'foreignKey':_0xba8d52[_0x1d9a68(0x190)][_0x1d9a68(0x163)],'columns':getBehaviorColumns(_0xba8d52),'schemaValid':![]};_0x51f006(_0x1d9a68(0x14f)+_0xba8d52[_0x1d9a68(0x17b)]);const _0x4c2c5e=await _0x14d436(generateBehaviorSchemaSQL(_0x13cf8a,_0xba8d52));if(_0x4c2c5e[_0x1d9a68(0x1be)])_0xcdc0d8[_0x1d9a68(0x15b)]=_0x4c2c5e[_0x1d9a68(0x1be)];else{_0xcdc0d8[_0x1d9a68(0x17c)]=!![],_0x51f006('Calculating\x20statistics\x20for:\x20'+_0xba8d52['name']+'\x20('+_0x4b4f1c+')');const _0x1727b5=await _0x14d436(generateBehaviorStatsSQL(_0x13cf8a,_0xba8d52,_0x4b4f1c));!_0x1727b5[_0x1d9a68(0x1be)]&&_0x1727b5[_0x1d9a68(0x128)]['length']>0x0&&(_0xcdc0d8[_0x1d9a68(0x141)]=_0x1727b5['data'][0x0][_0x1d9a68(0x12c)],_0xcdc0d8[_0x1d9a68(0x1bb)]=_0x1727b5[_0x1d9a68(0x128)][0x0]['total_events'],_0x4a9cec['master']['rowCount']&&_0x4a9cec[_0x1d9a68(0x154)][_0x1d9a68(0x1ac)]>0x0&&(_0xcdc0d8[_0x1d9a68(0x178)]=_0xcdc0d8[_0x1d9a68(0x141)]/_0x4a9cec['master'][_0x1d9a68(0x1ac)]*0x64));}return _0xcdc0d8;},_0x1ed0f9=(_0x549529,_0x3eb1a4)=>{const _0x53d2c2=_0x7f773d;_0x4a9cec[_0x53d2c2(0x15f)]=_0x549529,_0x4a9cec[_0x53d2c2(0x183)]=_0x3eb1a4;for(const _0x58d156 of _0x549529){!_0x58d156[_0x53d2c2(0x17c)]&&(_0x35fb5d[_0x53d2c2(0x1ab)]('Attribute\x20\x27'+_0x58d156[_0x53d2c2(0x17b)]+'\x27:\x20'+_0x58d156[_0x53d2c2(0x15b)]),_0x6f45d=![]);}for(const _0x5b368e of _0x3eb1a4){!_0x5b368e['schemaValid']&&(_0x35fb5d[_0x53d2c2(0x1ab)](_0x53d2c2(0x1aa)+_0x5b368e[_0x53d2c2(0x17b)]+_0x53d2c2(0x177)+_0x5b368e[_0x53d2c2(0x15b)]),_0x6f45d=![]);}},_0x17e072=_0x155b7a[_0x7f773d(0x1ae)]||DEFAULT_TIME_RANGE;if(typeof _0x155b7a[_0x7f773d(0x15c)]===_0x7f773d(0x143)){const _0x37043a=findAttributeByName(_0x13cf8a,_0x155b7a[_0x7f773d(0x15c)]);if(!_0x37043a)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x7f773d(0x180)+_0x155b7a[_0x7f773d(0x15c)]+'\x27\x20not\x20found');const _0x244bde=await _0x412a3d(_0x37043a);return _0x1ed0f9([_0x244bde],[]),_0x4a9cec['allValid']=_0x6f45d,_0x4a9cec;}if(_0x155b7a[_0x7f773d(0x15c)]===!![]){_0x51f006(_0x7f773d(0x12b));const _0x4e35f4=await Promise['all']((_0x13cf8a[_0x7f773d(0x15f)]||[])[_0x7f773d(0x149)](_0x19dc3a=>_0x412a3d(_0x19dc3a)));return _0x1ed0f9(_0x4e35f4,[]),_0x4a9cec[_0x7f773d(0x158)]=_0x6f45d,_0x4a9cec;}if(typeof _0x155b7a['behavior']===_0x7f773d(0x143)){const _0x4f2423=findBehaviorByName(_0x13cf8a,_0x155b7a[_0x7f773d(0x196)]);if(!_0x4f2423)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x7f773d(0x1aa)+_0x155b7a[_0x7f773d(0x196)]+_0x7f773d(0x165));const _0x489b66=await _0x13cc36(_0x4f2423,_0x17e072);return _0x1ed0f9([],[_0x489b66]),_0x4a9cec[_0x7f773d(0x158)]=_0x6f45d,_0x4a9cec;}if(_0x155b7a[_0x7f773d(0x196)]===!![]){_0x51f006('Validating\x20all\x20behaviors\x20in\x20parallel...');const _0x5cb931=await Promise['all']((_0x13cf8a[_0x7f773d(0x183)]||[])[_0x7f773d(0x149)](_0x3e6168=>_0x13cc36(_0x3e6168,_0x17e072)));return _0x1ed0f9([],_0x5cb931),_0x4a9cec[_0x7f773d(0x158)]=_0x6f45d,_0x4a9cec;}if(_0x155b7a[_0x7f773d(0x19e)]){_0x51f006(_0x7f773d(0x12b));const _0x559cc8=await Promise[_0x7f773d(0x1a8)]((_0x13cf8a[_0x7f773d(0x15f)]||[])[_0x7f773d(0x149)](_0x3c8117=>_0x412a3d(_0x3c8117)));return _0x1ed0f9(_0x559cc8,[]),_0x4a9cec[_0x7f773d(0x158)]=_0x6f45d,_0x4a9cec;}_0x51f006(_0x7f773d(0x124));const [_0x4237b7,_0x5e0c87]=await Promise[_0x7f773d(0x1a8)]([Promise[_0x7f773d(0x1a8)]((_0x13cf8a[_0x7f773d(0x15f)]||[])[_0x7f773d(0x149)](_0x5b5227=>_0x412a3d(_0x5b5227))),Promise[_0x7f773d(0x1a8)]((_0x13cf8a[_0x7f773d(0x183)]||[])[_0x7f773d(0x149)](_0x126fa9=>_0x13cc36(_0x126fa9,_0x17e072)))]);return _0x1ed0f9(_0x4237b7,_0x5e0c87),_0x4a9cec[_0x7f773d(0x158)]=_0x6f45d,_0x4a9cec;}async['previewParentYaml'](_0x2803bf,_0x3ef640={}){const _0x10cc95=a126_0x2b96c3,_0x630bbb=typeof _0x2803bf===_0x10cc95(0x143)?parseDef(_0x2803bf):_0x2803bf,_0x4fb614=[];let _0x5c936d=!![];const _0x2d859c=_0x41dbe1=>_0x3ef640[_0x10cc95(0x184)]?.(_0x41dbe1),_0x37efa3={'name':_0x630bbb[_0x10cc95(0x17b)],'master':{'database':_0x630bbb[_0x10cc95(0x154)][_0x10cc95(0x123)],'table':_0x630bbb[_0x10cc95(0x154)][_0x10cc95(0x157)],'schemaValid':!![]},'attributes':[],'behaviors':[],'errors':_0x4fb614,'allValid':!![]},_0x2dc1ac=async _0x26cedd=>{const _0x2a7a60=_0x10cc95;try{const _0x435d5d=await this[_0x2a7a60(0x1a1)][_0x2a7a60(0x187)](_0x26cedd);return{'data':_0x435d5d[_0x2a7a60(0x128)]};}catch(_0x10ffed){const _0x2661c4=_0x10ffed instanceof Error?_0x10ffed[_0x2a7a60(0x1a6)]:String(_0x10ffed);return{'data':[],'error':_0x2661c4};}};if(_0x3ef640[_0x10cc95(0x154)]){_0x2d859c(_0x10cc95(0x12e));const _0x47aff7=generateMasterSampleSQL(_0x630bbb,DEFAULT_SAMPLE_LIMIT),_0x4d3b3f=await _0x2dc1ac(_0x47aff7);return!_0x4d3b3f['error']?_0x37efa3['sampleData']=_0x4d3b3f[_0x10cc95(0x128)]:(_0x4fb614['push'](_0x10cc95(0x16b)+_0x4d3b3f[_0x10cc95(0x1be)]),_0x5c936d=![]),_0x37efa3['allValid']=_0x5c936d,_0x37efa3;}if(_0x3ef640['attribute']){const _0x1f91dc=findAttributeByName(_0x630bbb,_0x3ef640['attribute']);if(!_0x1f91dc)throw new SDKError(ErrorCode[_0x10cc95(0x168)],_0x10cc95(0x180)+_0x3ef640['attribute']+'\x27\x20not\x20found');_0x2d859c('Fetching\x20sample\x20data\x20for:\x20'+_0x1f91dc[_0x10cc95(0x17b)]);const _0xcc1220=generateAttributeSampleSQL(_0x630bbb,_0x1f91dc,DEFAULT_SAMPLE_LIMIT),_0x506cbb=await _0x2dc1ac(_0xcc1220);return!_0x506cbb[_0x10cc95(0x1be)]?_0x37efa3[_0x10cc95(0x1ad)]=_0x506cbb['data']:(_0x4fb614[_0x10cc95(0x1ab)]('Attribute\x20\x27'+_0x1f91dc[_0x10cc95(0x17b)]+_0x10cc95(0x177)+_0x506cbb[_0x10cc95(0x1be)]),_0x5c936d=![]),_0x37efa3[_0x10cc95(0x158)]=_0x5c936d,_0x37efa3;}if(_0x3ef640[_0x10cc95(0x196)]){const _0x1f99e2=findBehaviorByName(_0x630bbb,_0x3ef640[_0x10cc95(0x196)]);if(!_0x1f99e2)throw new SDKError(ErrorCode[_0x10cc95(0x168)],'Behavior\x20\x27'+_0x3ef640[_0x10cc95(0x196)]+_0x10cc95(0x165));const _0x10d5e2=_0x3ef640[_0x10cc95(0x1ae)]||DEFAULT_TIME_RANGE;_0x2d859c(_0x10cc95(0x13d)+_0x1f99e2[_0x10cc95(0x17b)]+'\x20('+_0x10d5e2+')');const _0x3cc336=generateBehaviorSampleSQL(_0x630bbb,_0x1f99e2,DEFAULT_SAMPLE_LIMIT,_0x10d5e2),_0x424ad1=await _0x2dc1ac(_0x3cc336);return!_0x424ad1[_0x10cc95(0x1be)]?_0x37efa3[_0x10cc95(0x1ad)]=_0x424ad1['data']:(_0x4fb614[_0x10cc95(0x1ab)]('Behavior\x20\x27'+_0x1f99e2[_0x10cc95(0x17b)]+_0x10cc95(0x177)+_0x424ad1[_0x10cc95(0x1be)]),_0x5c936d=![]),_0x37efa3[_0x10cc95(0x158)]=_0x5c936d,_0x37efa3;}if(_0x3ef640[_0x10cc95(0x19e)]){_0x2d859c(_0x10cc95(0x129));const _0x3d2b95=generateEnrichedSQL(_0x630bbb,DEFAULT_SAMPLE_LIMIT),_0x1bd708=await _0x2dc1ac(_0x3d2b95);return!_0x1bd708[_0x10cc95(0x1be)]?_0x37efa3[_0x10cc95(0x1ad)]=_0x1bd708[_0x10cc95(0x128)]:(_0x4fb614[_0x10cc95(0x1ab)](_0x10cc95(0x13a)+_0x1bd708['error']),_0x5c936d=![]),_0x37efa3[_0x10cc95(0x158)]=_0x5c936d,_0x37efa3;}return _0x37efa3[_0x10cc95(0x158)]=_0x5c936d,_0x37efa3;}async[a126_0x2b96c3(0x1b9)](_0x1ccf17,_0x85bec3){const _0x54aab0=a126_0x2b96c3;return await this[_0x54aab0(0x148)]['createSegment'](_0x1ccf17,_0x85bec3);}async['createJourneySegment'](_0x1a6c24){const _0x5a75a2=a126_0x2b96c3;return await this[_0x5a75a2(0x148)][_0x5a75a2(0x1b6)](_0x1a6c24);}async[a126_0x2b96c3(0x171)](_0x5e59dd,_0x4eb828,_0x5d1cf5){const _0x2c748f=a126_0x2b96c3;return await this['client'][_0x2c748f(0x16f)](_0x5e59dd,_0x4eb828,_0x5d1cf5);}async[a126_0x2b96c3(0x172)](_0x20de7d){const _0x1e4112=a126_0x2b96c3;return await this[_0x1e4112(0x148)]['deleteSegment'](_0x20de7d);}async[a126_0x2b96c3(0x18a)](_0x466586,_0x1df777){const _0x34b2dc=a126_0x2b96c3,_0xcf4ee8=await this[_0x34b2dc(0x1bd)](_0x466586);return await this[_0x34b2dc(0x148)]['createSegmentFolder'](_0xcf4ee8,_0x1df777);}async[a126_0x2b96c3(0x1bd)](_0x1af1c7){const _0x3f8cb4=a126_0x2b96c3;if(/^\d+$/[_0x3f8cb4(0x12d)](_0x1af1c7))return _0x1af1c7;return await this['resolveParentId'](_0x1af1c7);}async[a126_0x2b96c3(0x199)](_0x288b39,_0x16cca2){const _0x5f4441=a126_0x2b96c3,[_0x5b1fff,_0x221a6e]=await Promise[_0x5f4441(0x1a8)]([this[_0x5f4441(0x194)](_0x288b39,_0x16cca2)['then'](()=>!![])[_0x5f4441(0x1a9)](()=>![]),this[_0x5f4441(0x1b1)](_0x288b39,_0x16cca2)[_0x5f4441(0x19d)](()=>!![])[_0x5f4441(0x1a9)](()=>![])]);if(_0x5b1fff&&_0x221a6e)return _0x5f4441(0x133);else{if(_0x5b1fff)return'folder';else{if(_0x221a6e)return _0x5f4441(0x1af);}}throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5f4441(0x169)+_0x16cca2+_0x5f4441(0x142));}async[a126_0x2b96c3(0x1a2)](_0x28199e,_0x20d70b,_0x36261f){const _0x12da33=a126_0x2b96c3,[_0x59deb9,_0x127fa0]=await Promise['all']([this['listFolders'](_0x28199e),this[_0x12da33(0x173)](_0x28199e)]),_0x3a940d=_0x36261f?_0x59deb9['filter'](_0xa0f434=>_0xa0f434[_0x12da33(0x18b)]===_0x36261f):_0x59deb9[_0x12da33(0x193)](_0xc92b05=>!_0xc92b05[_0x12da33(0x18b)]),_0x4dcf0b=_0x36261f?_0x127fa0[_0x12da33(0x193)](_0x101e0d=>_0x101e0d[_0x12da33(0x137)]===_0x36261f):_0x127fa0[_0x12da33(0x193)](_0x4d2cd6=>!_0x4d2cd6[_0x12da33(0x137)]),_0x55530c=_0x3a940d[_0x12da33(0x14b)](_0x5c68be=>_0x5c68be[_0x12da33(0x17b)]===_0x20d70b),_0x3d33e7=_0x4dcf0b[_0x12da33(0x14b)](_0x105133=>_0x105133[_0x12da33(0x17b)]===_0x20d70b);if(_0x55530c&&_0x3d33e7)return _0x12da33(0x133);else{if(_0x55530c)return _0x12da33(0x147);else{if(_0x3d33e7)return'segment';}}throw new SDKError(ErrorCode[_0x12da33(0x168)],_0x12da33(0x169)+_0x20d70b+_0x12da33(0x12f)+(_0x36261f?_0x12da33(0x147):_0x12da33(0x1a0)));}async[a126_0x2b96c3(0x161)](_0x503080){const _0x2667c0=a126_0x2b96c3;if(_0x503080['length']===0x0)throw new SDKError(ErrorCode[_0x2667c0(0x197)],_0x2667c0(0x18f));const _0x9e1a16=_0x503080[0x0],_0x50ee2b=await this[_0x2667c0(0x1c9)](_0x9e1a16);if(_0x503080[_0x2667c0(0x1b3)]===0x1)return{'parentId':_0x50ee2b,'parentName':_0x9e1a16,'type':_0x2667c0(0x19f),'fullPath':_0x9e1a16};const _0x69b8b0=await this[_0x2667c0(0x134)](_0x50ee2b),_0x4fb5b0=_0x69b8b0['rootFolderId'],_0x45b71e=[];let _0x35338=_0x4fb5b0;for(let _0x29b5e1=0x1;_0x29b5e1<_0x503080[_0x2667c0(0x1b3)]-0x1;_0x29b5e1++){const _0x4f7499=_0x503080[_0x29b5e1],_0x39bb3=await this[_0x2667c0(0x152)](_0x50ee2b),_0x2e9102=_0x35338?_0x39bb3[_0x2667c0(0x167)](_0x40b267=>_0x40b267[_0x2667c0(0x17b)]===_0x4f7499&&_0x40b267[_0x2667c0(0x18b)]===_0x35338):_0x39bb3[_0x2667c0(0x167)](_0x2362d5=>_0x2362d5[_0x2667c0(0x17b)]===_0x4f7499&&!_0x2362d5[_0x2667c0(0x18b)]);if(!_0x2e9102)throw new SDKError(ErrorCode[_0x2667c0(0x168)],_0x2667c0(0x170)+_0x4f7499+_0x2667c0(0x13c));_0x45b71e[_0x2667c0(0x1ab)](_0x4f7499),_0x35338=_0x2e9102['id'];}const _0x7d819=_0x503080[_0x503080[_0x2667c0(0x1b3)]-0x1],_0x2c93e6=await this[_0x2667c0(0x1a2)](_0x50ee2b,_0x7d819,_0x35338);if(_0x2c93e6==='ambiguous'||_0x2c93e6===_0x2667c0(0x147)){const _0x541146=await this['listFolders'](_0x50ee2b),_0x1ef998=_0x35338?_0x541146['find'](_0x497e27=>_0x497e27[_0x2667c0(0x17b)]===_0x7d819&&_0x497e27[_0x2667c0(0x18b)]===_0x35338):_0x541146[_0x2667c0(0x167)](_0x5b8d78=>_0x5b8d78['name']===_0x7d819&&!_0x5b8d78[_0x2667c0(0x18b)]);if(!_0x1ef998)throw new SDKError(ErrorCode[_0x2667c0(0x168)],_0x2667c0(0x170)+_0x7d819+'\x27\x20not\x20found');return _0x45b71e[_0x2667c0(0x1ab)](_0x7d819),{'parentId':_0x50ee2b,'parentName':_0x9e1a16,'folderId':_0x1ef998['id'],'folderPath':_0x45b71e,'type':_0x2667c0(0x147),'fullPath':_0x503080[_0x2667c0(0x190)]('/')};}else{const _0x5b6e2c=await this[_0x2667c0(0x173)](_0x50ee2b),_0x33560f=_0x35338?_0x5b6e2c[_0x2667c0(0x167)](_0x5cc543=>_0x5cc543['name']===_0x7d819&&_0x5cc543[_0x2667c0(0x137)]===_0x35338):_0x5b6e2c['find'](_0x486738=>_0x486738[_0x2667c0(0x17b)]===_0x7d819&&!_0x486738[_0x2667c0(0x137)]);if(!_0x33560f)throw new SDKError(ErrorCode[_0x2667c0(0x168)],'Segment\x20\x27'+_0x7d819+'\x27\x20not\x20found');return{'parentId':_0x50ee2b,'parentName':_0x9e1a16,'folderId':_0x35338,'folderPath':_0x45b71e['length']>0x0?_0x45b71e:undefined,'segmentId':_0x33560f['id'],'segmentName':_0x7d819,'type':_0x2667c0(0x1af),'fullPath':_0x503080[_0x2667c0(0x190)]('/')};}}async[a126_0x2b96c3(0x166)](_0x2e4066){const _0x2bb74e=a126_0x2b96c3,_0x2e15f3=parsePath(_0x2e4066);if(!_0x2e15f3[_0x2bb74e(0x159)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2bb74e(0x176));return await this[_0x2bb74e(0x161)](_0x2e15f3[_0x2bb74e(0x153)]);}async[a126_0x2b96c3(0x162)](_0x3e6bc0,_0x26512f){const _0x2275ff=a126_0x2b96c3;let _0x5f10a2=_0x26512f;if(!_0x5f10a2){const _0x2701a7=await this[_0x2275ff(0x134)](_0x3e6bc0);_0x5f10a2=_0x2701a7[_0x2275ff(0x179)];}if(!_0x5f10a2)return{'folders':[],'segments':[],'journeys':[]};const _0x479457=await this[_0x2275ff(0x148)]['listEntitiesByFolder'](_0x5f10a2,0x1,![]),_0x233f30=_0x479457[_0x2275ff(0x128)],_0x5d6aa9=_0x233f30[_0x2275ff(0x193)](_0x3fa0cf=>{const _0x5a9f37=_0x2275ff;if(_0x3fa0cf['id']===_0x5f10a2)return![];const _0x2de104=this[_0x5a9f37(0x186)](_0x3fa0cf);return _0x2de104===_0x5f10a2||!_0x2de104;}),_0x3294b3=_0x5d6aa9['filter'](_0x648244=>_0x648244[_0x2275ff(0x1c4)]===_0x2275ff(0x192))['map'](_0x4fd2ed=>this[_0x2275ff(0x1c6)](_0x4fd2ed,_0x3e6bc0)),_0xd2d160=_0x5d6aa9[_0x2275ff(0x193)](_0x5b87aa=>_0x5b87aa[_0x2275ff(0x1c4)]===_0x2275ff(0x17d)||_0x5b87aa[_0x2275ff(0x1c4)]===_0x2275ff(0x17e))[_0x2275ff(0x149)](_0x1c527d=>this['entityToSegment'](_0x1c527d,_0x3e6bc0)),_0x5e9859=_0x5d6aa9[_0x2275ff(0x193)](_0x4a8384=>_0x4a8384['type']==='journey'),_0x41fa36=_0x5e9859[_0x2275ff(0x149)](_0x24a2fc=>({'journeyBundleId':_0x24a2fc[_0x2275ff(0x15f)][_0x2275ff(0x195)],'versionNumber':_0x24a2fc[_0x2275ff(0x15f)][_0x2275ff(0x12a)],'id':_0x24a2fc['id'],'entity':_0x24a2fc})),_0x56d205=deduplicateJourneysByBundle(_0x41fa36),_0x2c0276=_0x56d205[_0x2275ff(0x149)](_0x431507=>entityToJourneyListItem(_0x431507[_0x2275ff(0x1a4)],_0x3e6bc0));return{'folders':_0x3294b3,'segments':_0xd2d160,'journeys':_0x2c0276};}[a126_0x2b96c3(0x1c6)](_0x2cd8b2,_0x1b941e){const _0x2f2db3=a126_0x2b96c3;return{'audienceId':_0x1b941e,'id':_0x2cd8b2['id'],'name':_0x2cd8b2[_0x2f2db3(0x15f)]['name'],'parentFolderId':_0x2cd8b2[_0x2f2db3(0x15f)][_0x2f2db3(0x18b)]??_0x2cd8b2[_0x2f2db3(0x191)]?.[_0x2f2db3(0x1c8)]?.[_0x2f2db3(0x128)]?.['id']??null,'description':_0x2cd8b2[_0x2f2db3(0x15f)][_0x2f2db3(0x16e)]??null,'createdAt':_0x2cd8b2[_0x2f2db3(0x15f)][_0x2f2db3(0x16a)],'updatedAt':_0x2cd8b2[_0x2f2db3(0x15f)]['updatedAt']};}[a126_0x2b96c3(0x145)](_0x439870,_0x35f4e0){const _0x5a9584=a126_0x2b96c3;return{'audienceId':_0x35f4e0,'id':_0x439870['id'],'name':_0x439870['attributes'][_0x5a9584(0x17b)],'description':_0x439870[_0x5a9584(0x15f)][_0x5a9584(0x16e)]??undefined,'realtime':_0x439870[_0x5a9584(0x1c4)]==='segment-realtime','segmentFolderId':_0x439870[_0x5a9584(0x15f)]['segmentFolderId']??_0x439870[_0x5a9584(0x191)]?.[_0x5a9584(0x1c8)]?.[_0x5a9584(0x128)]?.['id']??undefined,'population':_0x439870[_0x5a9584(0x15f)][_0x5a9584(0x1c2)],'createdAt':_0x439870[_0x5a9584(0x15f)][_0x5a9584(0x16a)],'updatedAt':_0x439870[_0x5a9584(0x15f)]['updatedAt']};}async[a126_0x2b96c3(0x146)](_0x8033af,_0x4aac6c,_0x256f8d,_0x50d118=0xa){const _0x515056=a126_0x2b96c3;let _0x59ae74=_0x4aac6c;if(!_0x59ae74){const _0x1f0e64=await this[_0x515056(0x134)](_0x8033af);_0x59ae74=_0x1f0e64[_0x515056(0x179)];}if(!_0x59ae74)return[];const _0x1db56c=await this['client'][_0x515056(0x140)](_0x59ae74,_0x50d118,![]),_0x56ed35=_0x1db56c[_0x515056(0x128)];return this[_0x515056(0x1bc)](_0x56ed35,_0x59ae74);}[a126_0x2b96c3(0x1bc)](_0x1eab58,_0x269fd4){const _0x2fad45=a126_0x2b96c3,_0x5d82b4=new Map();for(const _0x1efbb8 of _0x1eab58){if(_0x1efbb8[_0x2fad45(0x1c4)]==='folder-segment'&&_0x1efbb8['id']===_0x269fd4)continue;const _0x117d18=this[_0x2fad45(0x186)](_0x1efbb8)??_0x269fd4;!_0x5d82b4[_0x2fad45(0x198)](_0x117d18)&&_0x5d82b4[_0x2fad45(0x174)](_0x117d18,[]),_0x5d82b4['get'](_0x117d18)[_0x2fad45(0x1ab)](_0x1efbb8);}return this[_0x2fad45(0x19a)](_0x269fd4,_0x5d82b4);}['getEntityParentFolderId'](_0x200bce){const _0x532031=a126_0x2b96c3;if(_0x200bce['relationships']?.[_0x532031(0x1c8)]?.[_0x532031(0x128)]?.['id'])return _0x200bce['relationships'][_0x532031(0x1c8)][_0x532031(0x128)]['id'];return _0x200bce['attributes'][_0x532031(0x18b)]??_0x200bce[_0x532031(0x15f)][_0x532031(0x137)]??undefined;}[a126_0x2b96c3(0x19a)](_0x3a6319,_0x19f2d8){const _0x509239=a126_0x2b96c3,_0x19acfb=_0x19f2d8[_0x509239(0x1ca)](_0x3a6319)??[],_0x368841=[],_0x41d486=_0x19acfb['filter'](_0x377d56=>_0x377d56[_0x509239(0x1c4)]===_0x509239(0x192)),_0x2da991=_0x19acfb[_0x509239(0x193)](_0xf421c9=>_0xf421c9['type']===_0x509239(0x17d)||_0xf421c9[_0x509239(0x1c4)]===_0x509239(0x17e)),_0x558915=_0x19acfb['filter'](_0x47db79=>_0x47db79[_0x509239(0x1c4)]==='journey'),_0x536946=_0x558915['map'](_0x413f14=>({'journeyBundleId':_0x413f14[_0x509239(0x15f)][_0x509239(0x195)],'versionNumber':_0x413f14[_0x509239(0x15f)][_0x509239(0x12a)],'id':_0x413f14['id'],'entity':_0x413f14})),_0xc315ed=deduplicateJourneysByBundle(_0x536946);for(const _0x57f3cc of _0x41d486){const _0x52ea18=this[_0x509239(0x19a)](_0x57f3cc['id'],_0x19f2d8);_0x368841[_0x509239(0x1ab)]({'type':_0x509239(0x147),'id':_0x57f3cc['id'],'name':_0x57f3cc[_0x509239(0x15f)]['name'],'children':_0x52ea18['length']>0x0?_0x52ea18:undefined,'metadata':{'description':_0x57f3cc[_0x509239(0x15f)][_0x509239(0x16e)]??undefined,'folderCount':_0x52ea18[_0x509239(0x193)](_0x1c0fb3=>_0x1c0fb3[_0x509239(0x1c4)]==='folder')[_0x509239(0x1b3)],'segmentCount':_0x52ea18[_0x509239(0x193)](_0x3aa934=>_0x3aa934[_0x509239(0x1c4)]===_0x509239(0x1af))['length'],'journeyCount':_0x52ea18[_0x509239(0x193)](_0x5decfd=>_0x5decfd[_0x509239(0x1c4)]===_0x509239(0x1b7))[_0x509239(0x1b3)],'createdAt':_0x57f3cc[_0x509239(0x15f)][_0x509239(0x16a)],'updatedAt':_0x57f3cc[_0x509239(0x15f)][_0x509239(0x1bf)]}});}for(const _0x3df238 of _0x2da991){_0x368841[_0x509239(0x1ab)]({'type':_0x509239(0x1af),'id':_0x3df238['id'],'name':_0x3df238[_0x509239(0x15f)][_0x509239(0x17b)],'population':_0x3df238[_0x509239(0x15f)][_0x509239(0x1c2)],'metadata':{'description':_0x3df238[_0x509239(0x15f)]['description']??undefined,'createdAt':_0x3df238[_0x509239(0x15f)]['createdAt'],'updatedAt':_0x3df238[_0x509239(0x15f)][_0x509239(0x1bf)]}});}for(const _0x1c4a0e of _0xc315ed){const _0x3a9536=_0x1c4a0e[_0x509239(0x1a4)];_0x368841[_0x509239(0x1ab)]({'type':_0x509239(0x1b7),'id':_0x3a9536['id'],'name':_0x3a9536['attributes'][_0x509239(0x17f)]??_0x3a9536[_0x509239(0x15f)][_0x509239(0x17b)]??'','state':parseJourneyState(_0x3a9536['attributes'][_0x509239(0x139)]),'metadata':{}});}return _0x368841;}async[a126_0x2b96c3(0x1b0)](_0x5c21e7,_0x2ce7d6={}){const _0xc4ee52=a126_0x2b96c3,_0x549377=this['getTdxInstance'](),_0x4c740c={'segment':_0x549377[_0xc4ee52(0x1af)],'journey':_0x549377[_0xc4ee52(0x1b7)],'user':_0x549377['user'],'connection':_0x549377[_0xc4ee52(0x13b)]};return a126_0x13f71c(_0x4c740c,_0x5c21e7,_0x2ce7d6);}['getTdxInstance'](){return this['_tdxInstance'];}}
|
|
1
|
+
const a126_0x3b3db0=a126_0x45ce;(function(_0x53acb0,_0x54318c){const _0x30dc13=a126_0x45ce,_0x4fa9ea=_0x53acb0();while(!![]){try{const _0x1d4bdc=parseInt(_0x30dc13(0x11f))/0x1+-parseInt(_0x30dc13(0x102))/0x2+-parseInt(_0x30dc13(0x154))/0x3+-parseInt(_0x30dc13(0xe5))/0x4*(parseInt(_0x30dc13(0x130))/0x5)+-parseInt(_0x30dc13(0xfb))/0x6+parseInt(_0x30dc13(0x136))/0x7+parseInt(_0x30dc13(0xdd))/0x8;if(_0x1d4bdc===_0x54318c)break;else _0x4fa9ea['push'](_0x4fa9ea['shift']());}catch(_0x26e3e9){_0x4fa9ea['push'](_0x4fa9ea['shift']());}}}(a126_0x4e59,0x4b85c));import{CDPApiClient}from'./client/cdp-api-client.js';function a126_0x45ce(_0x4dbff1,_0x2903d0){_0x4dbff1=_0x4dbff1-0xd0;const _0x4e595f=a126_0x4e59();let _0x45ce9f=_0x4e595f[_0x4dbff1];return _0x45ce9f;}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 a126_0x5f3369}from'./segment/pull-workflow.js';import{apiToDef,defToApi,serializeDef,parseDef}from'./segment/parent-segment-yaml.js';function a126_0x4e59(){const _0x3259af=['pushParentYaml','relationships','behaviors','segments','resolveParentIdOrName','row_count','segment-batch','isAbsolute','Validating\x20all\x20attributes\x20in\x20parallel...','customersWithEvents','deleteSegment','parentColumn','detectResourceType','rowCount','\x20in\x20parent\x20','parentDatabaseName','Attribute\x20\x27','Resource\x20\x27','\x27:\x20','enriched','parent_key','Enriched\x20query:\x20','Master\x20table:\x20','listActivations','getParentSegment','updateSegment','225061PUIBef','some','ambiguous','name','getParent','buildTreeNodesForFolder','Fetching\x20sample\x20data\x20for:\x20','getEntityParentFolderId','getParentSQL','parentFolderId','message','entityToFolder','parent\x20segment','createdAt','table','updateParentSegment','segment','85MiIbRk','data','schema','attribute','attributes','listSegmentFolders','3971212lsptGg','\x27\x20not\x20found\x20in\x20path','then','_tdxInstance','folder','resolveFolderId','all','database','total_events','error','journey','allValid','Calculating\x20coverage\x20for:\x20','get','matched_count','source','getSegmentSQL','traversePath','population','parent','resolveParentId','resolveSegmentId','INVALID_ARGUMENT','Counting\x20master\x20table\x20rows...','versionNumber','trinoClient','listEntitiesByFolder','folder-segment','Folder\x20\x27','length','9597sPHiZT','updateSegmentById','totalEvents','SEGMENT_NOT_FOUND','createSegment','client','sampleData','state','listParents','runParent','Validating\x20attribute:\x20','Behavior\x20\x27','segmentFolderId','groupingName','updateActivation','journeyBundleName','createActivation','push','updatedAt','map','customers_with_events','\x27\x20not\x20found','onProgress','pullSegments','interval','schemaError','listFields','createJourneySegment','updateParent','join','find','getSegment','segment-realtime','listSegments','master','7298032KGSQAt','behavior','deleteActivation','listRecursive','Parent\x20segment\x20not\x20found:\x20','type','Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)','Segment\x20\x27','99292jBURrB','description','previewParentYaml','parentFolder','entityToSegment','getFolder','filter','parentTableName','createSegmentFolder','rootFolderId','matchedCount','getSegmentFolder','buildTreeFromEntities','executeQuery','listFolders','pullParentYaml','entity','catch','test','getTdxInstance','detectResourceTypeInFolder','Path\x20cannot\x20be\x20empty','2584080gaBCxX','schemaValid','getParentFull','has','string','listUnifiedWithJourneys','journeyBundleId','1078842MDWcrj','getParentSegmentSQL','Fetching\x20enriched\x20master\x20data...'];a126_0x4e59=function(){return _0x3259af;};return a126_0x4e59();}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{[a126_0x3b3db0(0x159)];[a126_0x3b3db0(0x14f)];constructor(_0x1f234a){const _0x503a12=a126_0x3b3db0;this[_0x503a12(0x159)]=new CDPApiClient(_0x1f234a),this['trinoClient']=new TrinoApiClient(_0x1f234a);}async[a126_0x3b3db0(0x15c)](){const _0x27fd6=a126_0x3b3db0;return await this[_0x27fd6(0x159)]['listParentSegments']();}async[a126_0x3b3db0(0x123)](_0x1303c8){const _0x3aaf81=a126_0x3b3db0;return await this[_0x3aaf81(0x159)][_0x3aaf81(0x11d)](_0x1303c8);}async[a126_0x3b3db0(0xdb)](_0x165126){const _0x33e84a=a126_0x3b3db0;return await this['client'][_0x33e84a(0xdb)](_0x165126);}async[a126_0x3b3db0(0xd9)](_0x216d4a,_0x58d264){const _0x45d42b=a126_0x3b3db0;return await this[_0x45d42b(0x159)][_0x45d42b(0xd9)](_0x216d4a,_0x58d264);}async[a126_0x3b3db0(0xf3)](_0x200bbc){const _0x5d5b3b=a126_0x3b3db0;return await this[_0x5d5b3b(0x159)][_0x5d5b3b(0x135)](_0x200bbc);}async[a126_0x3b3db0(0xea)](_0x2a9511){const _0x293469=a126_0x3b3db0;return await this[_0x293469(0x159)][_0x293469(0xf0)](_0x2a9511);}async[a126_0x3b3db0(0x11c)](_0xb8aa22,_0x2d2a45){const _0x2fd1c0=a126_0x3b3db0;return await this[_0x2fd1c0(0x159)]['listActivations'](_0xb8aa22,_0x2d2a45);}async['getActivation'](_0x13d311,_0x37b724,_0x19f976){const _0x4e985c=a126_0x3b3db0;return await this[_0x4e985c(0x159)]['getActivation'](_0x13d311,_0x37b724,_0x19f976);}async['createActivation'](_0x4ed56c,_0x272d25,_0x20fa5d){const _0x38301d=a126_0x3b3db0;return await this[_0x38301d(0x159)][_0x38301d(0x164)](_0x4ed56c,_0x272d25,_0x20fa5d);}async[a126_0x3b3db0(0x162)](_0x4794e,_0x574818,_0x13611a,_0x134648){const _0x1b64b8=a126_0x3b3db0;return await this[_0x1b64b8(0x159)][_0x1b64b8(0x162)](_0x4794e,_0x574818,_0x13611a,_0x134648);}async[a126_0x3b3db0(0xdf)](_0x5b8366,_0x2b6373,_0x41a9f1){const _0x519df4=a126_0x3b3db0;return await this[_0x519df4(0x159)][_0x519df4(0xdf)](_0x5b8366,_0x2b6373,_0x41a9f1);}async[a126_0x3b3db0(0x127)](_0x524c0c){const _0x1277b7=a126_0x3b3db0;return await this[_0x1277b7(0x159)][_0x1277b7(0x103)](_0x524c0c);}async[a126_0x3b3db0(0x146)](_0x2e4816,_0x80cc16){const _0x120f37=a126_0x3b3db0;return await this[_0x120f37(0x159)][_0x120f37(0x146)](_0x2e4816,_0x80cc16);}async[a126_0x3b3db0(0x14a)](_0x1e722d){const _0x57a4ce=a126_0x3b3db0,_0x587888=await this[_0x57a4ce(0x15c)](),_0x276385=_0x587888['find'](_0x3a5bbb=>_0x3a5bbb[_0x57a4ce(0x134)]['name']===_0x1e722d);if(!_0x276385)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x57a4ce(0xe1)+_0x1e722d);return _0x276385['id'];}async[a126_0x3b3db0(0x15d)](_0x4adc54){const _0x1747bd=a126_0x3b3db0;let _0x143a61=_0x4adc54;return!/^\d+$/[_0x1747bd(0xf7)](_0x4adc54)&&(_0x143a61=await this['resolveParentId'](_0x4adc54)),await this[_0x1747bd(0x159)]['runParentSegment'](_0x143a61);}async[a126_0x3b3db0(0x14b)](_0x4c99e0,_0x29ccad){const _0x19dc65=a126_0x3b3db0,_0x59ea79=await this['listSegments'](_0x4c99e0),_0x43d1a6=_0x59ea79[_0x19dc65(0xd8)](_0xbf0b4a=>_0xbf0b4a[_0x19dc65(0x122)]===_0x29ccad);if(!_0x43d1a6)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Child\x20segment\x20not\x20found:\x20'+_0x29ccad+_0x19dc65(0x113)+_0x4c99e0);return _0x43d1a6['id'];}async[a126_0x3b3db0(0x13b)](_0x4948af,_0x393ebb){const _0x19df80=a126_0x3b3db0,_0x5122e4=await this['listFolders'](_0x4948af),_0x292dee=_0x5122e4[_0x19df80(0xd8)](_0xecd84c=>_0xecd84c[_0x19df80(0x122)]===_0x393ebb);if(!_0x292dee)throw new SDKError(ErrorCode[_0x19df80(0x157)],'Folder\x20not\x20found:\x20'+_0x393ebb+'\x20in\x20parent\x20'+_0x4948af);return _0x292dee['id'];}async[a126_0x3b3db0(0xd4)](_0x1a83c1){const _0x298b74=a126_0x3b3db0,_0x85bdaa=await this[_0x298b74(0x109)](_0x1a83c1),[_0x1f0b40,_0x557a57]=await Promise[_0x298b74(0x13c)]([this[_0x298b74(0x159)]['getAudienceAttributes'](_0x85bdaa),this[_0x298b74(0x159)]['getAudienceBehaviors'](_0x85bdaa)]),_0xeedfe7=[];for(const _0x93c6e4 of _0x1f0b40){_0xeedfe7[_0x298b74(0x165)]({'name':_0x93c6e4[_0x298b74(0x122)],'type':_0x93c6e4[_0x298b74(0xe2)],'source':_0x298b74(0x133),'parentDatabaseName':_0x93c6e4['parentDatabaseName'],'parentTableName':_0x93c6e4[_0x298b74(0xec)],'parentColumn':_0x93c6e4['parentColumn'],'groupingName':_0x93c6e4[_0x298b74(0x161)]??undefined});}for(const _0x2ba3a5 of _0x557a57){const _0x19d818=_0x2ba3a5[_0x298b74(0x122)];if(_0x2ba3a5['schema']&&Array['isArray'](_0x2ba3a5['schema']))for(const _0xe0254f of _0x2ba3a5[_0x298b74(0x132)]){_0xe0254f[_0x298b74(0x122)]&&_0xe0254f[_0x298b74(0xe2)]&&_0xeedfe7['push']({'name':_0x19d818+'.'+_0xe0254f[_0x298b74(0x122)],'type':_0xe0254f[_0x298b74(0xe2)],'source':_0x298b74(0xde),'behaviorName':_0x19d818,'parentDatabaseName':_0x2ba3a5[_0x298b74(0x114)],'parentTableName':_0x2ba3a5[_0x298b74(0xec)],'parentColumn':_0xe0254f[_0x298b74(0x110)]});}}return _0xeedfe7;}async['createParent'](_0x27b822){return await this['client']['createParentSegment'](_0x27b822);}async[a126_0x3b3db0(0xd6)](_0x18c4df,_0x2189e7){const _0x140708=a126_0x3b3db0,_0x321a63=await this[_0x140708(0x109)](_0x18c4df);return await this[_0x140708(0x159)][_0x140708(0x12e)](_0x321a63,_0x2189e7);}async[a126_0x3b3db0(0xfd)](_0x375caa){const _0x31fa1c=a126_0x3b3db0,_0x1469d5=await this['resolveParentIdOrName'](_0x375caa);return await this[_0x31fa1c(0x159)]['getParentSegmentFull'](_0x1469d5);}async[a126_0x3b3db0(0xf4)](_0x382e1e){const _0x2e5552=await this['getParentFull'](_0x382e1e),_0x2d15bc=apiToDef(_0x2e5552);return serializeDef(_0x2d15bc);}async[a126_0x3b3db0(0x105)](_0x49e4c1){const _0x550783=a126_0x3b3db0,_0xfff3f2=typeof _0x49e4c1==='string'?parseDef(_0x49e4c1):_0x49e4c1,_0x381fba=defToApi(_0xfff3f2);let _0x3aa3da=null,_0x58a7bc='';try{_0x3aa3da=await this[_0x550783(0xfd)](_0xfff3f2[_0x550783(0x122)]);const _0x5bb90f=apiToDef(_0x3aa3da);_0x58a7bc=serializeDef(_0x5bb90f);}catch{}const _0x1b4e12=serializeDef(_0xfff3f2),_0x3239cd=generateDiff(_0x58a7bc,_0x1b4e12),_0x4146c3=formatDiffWithColors(_0x3239cd),_0x2d2dde=_0x3aa3da===null,_0x1b1138=hasChanges(_0x3239cd),_0x577c7c={'isNew':_0x2d2dde,'id':_0x3aa3da?.['id']||'','name':_0xfff3f2['name'],'diff':_0x3239cd,'diffFormatted':_0x4146c3,'hasChanges':_0x1b1138},_0x2cb6a6=async()=>{const _0x11a842=_0x550783;return _0x2d2dde?await this['createParent'](_0x381fba):await this[_0x11a842(0xd6)](_0x3aa3da['id'],_0x381fba);};return{..._0x577c7c,'apply':_0x2cb6a6};}async['validateParentYaml'](_0x3483f7,_0x199793={}){const _0x306c75=a126_0x3b3db0,_0x210d3a=typeof _0x3483f7===_0x306c75(0xff)?parseDef(_0x3483f7):_0x3483f7,_0x1195c6=[];let _0x4a2c91=!![];const _0x34a5ab=_0x11081e=>_0x199793[_0x306c75(0xd0)]?.(_0x11081e),_0x313c39={'name':_0x210d3a[_0x306c75(0x122)],'master':{'database':_0x210d3a[_0x306c75(0xdc)][_0x306c75(0x13d)],'table':_0x210d3a[_0x306c75(0xdc)]['table'],'schemaValid':![]},'attributes':[],'behaviors':[],'errors':_0x1195c6,'allValid':!![]},_0x5ce42c=async _0x594e4b=>{const _0x574105=_0x306c75;try{const _0x2c2533=await this['trinoClient'][_0x574105(0xf2)](_0x594e4b);return{'data':_0x2c2533[_0x574105(0x131)]};}catch(_0x3a6de3){const _0x9278ac=_0x3a6de3 instanceof Error?_0x3a6de3[_0x574105(0x129)]:String(_0x3a6de3);return{'data':[],'error':_0x9278ac};}};_0x34a5ab('Validating\x20master\x20table:\x20'+_0x210d3a['master'][_0x306c75(0x13d)]+'.'+_0x210d3a['master'][_0x306c75(0x12d)]);const _0x2c099a=generateSchemaValidationSQL(_0x210d3a['master'][_0x306c75(0x13d)],_0x210d3a[_0x306c75(0xdc)][_0x306c75(0x12d)]),_0x3110a3=await _0x5ce42c(_0x2c099a);if(_0x3110a3[_0x306c75(0x13f)])_0x313c39[_0x306c75(0xdc)]['schemaValid']=![],_0x313c39[_0x306c75(0xdc)][_0x306c75(0xd3)]=_0x3110a3[_0x306c75(0x13f)],_0x1195c6[_0x306c75(0x165)](_0x306c75(0x11b)+_0x3110a3[_0x306c75(0x13f)]),_0x4a2c91=![];else{_0x313c39['master'][_0x306c75(0xfc)]=!![],_0x34a5ab(_0x306c75(0x14d));const _0x297357=await _0x5ce42c(generateMasterCountSQL(_0x210d3a));!_0x297357[_0x306c75(0x13f)]&&_0x297357[_0x306c75(0x131)]['length']>0x0&&(_0x313c39[_0x306c75(0xdc)][_0x306c75(0x112)]=_0x297357['data'][0x0][_0x306c75(0x10a)]);}if(_0x199793[_0x306c75(0xdc)])return _0x313c39['allValid']=_0x4a2c91,_0x313c39;const _0x5077c4=async _0x2f4b2c=>{const _0x388e0d=_0x306c75,_0x5a5915={'name':_0x2f4b2c[_0x388e0d(0x122)],'database':_0x2f4b2c[_0x388e0d(0x145)]['database'],'table':_0x2f4b2c[_0x388e0d(0x145)][_0x388e0d(0x12d)],'joinKey':_0x2f4b2c[_0x388e0d(0xd7)]['child_key'],'foreignKey':_0x2f4b2c['join'][_0x388e0d(0x119)],'columns':getAttributeColumns(_0x2f4b2c),'schemaValid':![]};_0x34a5ab(_0x388e0d(0x15e)+_0x2f4b2c['name']);const _0x3f6430=await _0x5ce42c(generateAttributeSchemaSQL(_0x210d3a,_0x2f4b2c));if(_0x3f6430[_0x388e0d(0x13f)])_0x5a5915[_0x388e0d(0xd3)]=_0x3f6430['error'];else{_0x5a5915['schemaValid']=!![],_0x34a5ab(_0x388e0d(0x142)+_0x2f4b2c[_0x388e0d(0x122)]);const _0x613dfa=await _0x5ce42c(generateAttributeCoverageSQL(_0x210d3a,_0x2f4b2c));!_0x613dfa[_0x388e0d(0x13f)]&&_0x613dfa[_0x388e0d(0x131)][_0x388e0d(0x153)]>0x0&&(_0x5a5915[_0x388e0d(0xef)]=_0x613dfa[_0x388e0d(0x131)][0x0][_0x388e0d(0x144)],_0x313c39['master'][_0x388e0d(0x112)]&&_0x313c39[_0x388e0d(0xdc)]['rowCount']>0x0&&(_0x5a5915['coveragePercent']=_0x5a5915[_0x388e0d(0xef)]/_0x313c39[_0x388e0d(0xdc)]['rowCount']*0x64));}return _0x5a5915;},_0x10ec42=async(_0x373121,_0x5ab1f4)=>{const _0x36c883=_0x306c75,_0x354da9={'name':_0x373121[_0x36c883(0x122)],'database':_0x373121[_0x36c883(0x145)][_0x36c883(0x13d)],'table':_0x373121[_0x36c883(0x145)]['table'],'joinKey':_0x373121[_0x36c883(0xd7)]['child_key'],'foreignKey':_0x373121['join'][_0x36c883(0x119)],'columns':getBehaviorColumns(_0x373121),'schemaValid':![]};_0x34a5ab('Validating\x20behavior:\x20'+_0x373121[_0x36c883(0x122)]);const _0x56621a=await _0x5ce42c(generateBehaviorSchemaSQL(_0x210d3a,_0x373121));if(_0x56621a[_0x36c883(0x13f)])_0x354da9[_0x36c883(0xd3)]=_0x56621a[_0x36c883(0x13f)];else{_0x354da9[_0x36c883(0xfc)]=!![],_0x34a5ab('Calculating\x20statistics\x20for:\x20'+_0x373121['name']+'\x20('+_0x5ab1f4+')');const _0x4dcc33=await _0x5ce42c(generateBehaviorStatsSQL(_0x210d3a,_0x373121,_0x5ab1f4));!_0x4dcc33[_0x36c883(0x13f)]&&_0x4dcc33[_0x36c883(0x131)][_0x36c883(0x153)]>0x0&&(_0x354da9[_0x36c883(0x10e)]=_0x4dcc33[_0x36c883(0x131)][0x0][_0x36c883(0x168)],_0x354da9[_0x36c883(0x156)]=_0x4dcc33[_0x36c883(0x131)][0x0][_0x36c883(0x13e)],_0x313c39['master']['rowCount']&&_0x313c39['master'][_0x36c883(0x112)]>0x0&&(_0x354da9['customerPercent']=_0x354da9[_0x36c883(0x10e)]/_0x313c39[_0x36c883(0xdc)][_0x36c883(0x112)]*0x64));}return _0x354da9;},_0x57a01d=(_0x461a78,_0x4fce0f)=>{const _0x59756d=_0x306c75;_0x313c39[_0x59756d(0x134)]=_0x461a78,_0x313c39['behaviors']=_0x4fce0f;for(const _0x506245 of _0x461a78){!_0x506245['schemaValid']&&(_0x1195c6[_0x59756d(0x165)](_0x59756d(0x115)+_0x506245[_0x59756d(0x122)]+_0x59756d(0x117)+_0x506245[_0x59756d(0xd3)]),_0x4a2c91=![]);}for(const _0x61cca3 of _0x4fce0f){!_0x61cca3[_0x59756d(0xfc)]&&(_0x1195c6[_0x59756d(0x165)]('Behavior\x20\x27'+_0x61cca3[_0x59756d(0x122)]+'\x27:\x20'+_0x61cca3[_0x59756d(0xd3)]),_0x4a2c91=![]);}},_0x419021=_0x199793[_0x306c75(0xd2)]||DEFAULT_TIME_RANGE;if(typeof _0x199793[_0x306c75(0x133)]===_0x306c75(0xff)){const _0x4baac9=findAttributeByName(_0x210d3a,_0x199793['attribute']);if(!_0x4baac9)throw new SDKError(ErrorCode[_0x306c75(0x157)],_0x306c75(0x115)+_0x199793[_0x306c75(0x133)]+'\x27\x20not\x20found');const _0x1fb8ae=await _0x5077c4(_0x4baac9);return _0x57a01d([_0x1fb8ae],[]),_0x313c39[_0x306c75(0x141)]=_0x4a2c91,_0x313c39;}if(_0x199793[_0x306c75(0x133)]===!![]){_0x34a5ab('Validating\x20all\x20attributes\x20in\x20parallel...');const _0x368d57=await Promise[_0x306c75(0x13c)]((_0x210d3a[_0x306c75(0x134)]||[])[_0x306c75(0x167)](_0x446887=>_0x5077c4(_0x446887)));return _0x57a01d(_0x368d57,[]),_0x313c39[_0x306c75(0x141)]=_0x4a2c91,_0x313c39;}if(typeof _0x199793[_0x306c75(0xde)]===_0x306c75(0xff)){const _0x556c3b=findBehaviorByName(_0x210d3a,_0x199793[_0x306c75(0xde)]);if(!_0x556c3b)throw new SDKError(ErrorCode[_0x306c75(0x157)],_0x306c75(0x15f)+_0x199793[_0x306c75(0xde)]+_0x306c75(0x169));const _0x11c85f=await _0x10ec42(_0x556c3b,_0x419021);return _0x57a01d([],[_0x11c85f]),_0x313c39[_0x306c75(0x141)]=_0x4a2c91,_0x313c39;}if(_0x199793[_0x306c75(0xde)]===!![]){_0x34a5ab('Validating\x20all\x20behaviors\x20in\x20parallel...');const _0x6b8f00=await Promise[_0x306c75(0x13c)]((_0x210d3a[_0x306c75(0x107)]||[])[_0x306c75(0x167)](_0x1f9d4c=>_0x10ec42(_0x1f9d4c,_0x419021)));return _0x57a01d([],_0x6b8f00),_0x313c39[_0x306c75(0x141)]=_0x4a2c91,_0x313c39;}if(_0x199793[_0x306c75(0x118)]){_0x34a5ab(_0x306c75(0x10d));const _0x5550c0=await Promise[_0x306c75(0x13c)]((_0x210d3a[_0x306c75(0x134)]||[])[_0x306c75(0x167)](_0x124e1b=>_0x5077c4(_0x124e1b)));return _0x57a01d(_0x5550c0,[]),_0x313c39['allValid']=_0x4a2c91,_0x313c39;}_0x34a5ab('Validating\x20all\x20attributes\x20and\x20behaviors\x20in\x20parallel...');const [_0x4e433d,_0x16a060]=await Promise[_0x306c75(0x13c)]([Promise[_0x306c75(0x13c)]((_0x210d3a[_0x306c75(0x134)]||[])[_0x306c75(0x167)](_0x470fcf=>_0x5077c4(_0x470fcf))),Promise[_0x306c75(0x13c)]((_0x210d3a['behaviors']||[])[_0x306c75(0x167)](_0x15c70a=>_0x10ec42(_0x15c70a,_0x419021)))]);return _0x57a01d(_0x4e433d,_0x16a060),_0x313c39[_0x306c75(0x141)]=_0x4a2c91,_0x313c39;}async[a126_0x3b3db0(0xe7)](_0x1b6b90,_0x310788={}){const _0x543fce=a126_0x3b3db0,_0x542d02=typeof _0x1b6b90===_0x543fce(0xff)?parseDef(_0x1b6b90):_0x1b6b90,_0x4c19be=[];let _0x2b42ae=!![];const _0x397a18=_0x5956b2=>_0x310788[_0x543fce(0xd0)]?.(_0x5956b2),_0xb3cbb5={'name':_0x542d02['name'],'master':{'database':_0x542d02[_0x543fce(0xdc)][_0x543fce(0x13d)],'table':_0x542d02[_0x543fce(0xdc)]['table'],'schemaValid':!![]},'attributes':[],'behaviors':[],'errors':_0x4c19be,'allValid':!![]},_0x3cd6a5=async _0x343cb2=>{const _0x38e888=_0x543fce;try{const _0x176ef2=await this[_0x38e888(0x14f)][_0x38e888(0xf2)](_0x343cb2);return{'data':_0x176ef2[_0x38e888(0x131)]};}catch(_0x8a7b4f){const _0xd3e87f=_0x8a7b4f instanceof Error?_0x8a7b4f[_0x38e888(0x129)]:String(_0x8a7b4f);return{'data':[],'error':_0xd3e87f};}};if(_0x310788[_0x543fce(0xdc)]){_0x397a18('Fetching\x20master\x20sample\x20data...');const _0x4f66a4=generateMasterSampleSQL(_0x542d02,DEFAULT_SAMPLE_LIMIT),_0x597cad=await _0x3cd6a5(_0x4f66a4);return!_0x597cad[_0x543fce(0x13f)]?_0xb3cbb5['sampleData']=_0x597cad[_0x543fce(0x131)]:(_0x4c19be['push'](_0x543fce(0x11b)+_0x597cad[_0x543fce(0x13f)]),_0x2b42ae=![]),_0xb3cbb5['allValid']=_0x2b42ae,_0xb3cbb5;}if(_0x310788['attribute']){const _0x2ae84c=findAttributeByName(_0x542d02,_0x310788[_0x543fce(0x133)]);if(!_0x2ae84c)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Attribute\x20\x27'+_0x310788[_0x543fce(0x133)]+_0x543fce(0x169));_0x397a18(_0x543fce(0x125)+_0x2ae84c[_0x543fce(0x122)]);const _0x4e2ce1=generateAttributeSampleSQL(_0x542d02,_0x2ae84c,DEFAULT_SAMPLE_LIMIT),_0x3bbdc4=await _0x3cd6a5(_0x4e2ce1);return!_0x3bbdc4['error']?_0xb3cbb5[_0x543fce(0x15a)]=_0x3bbdc4[_0x543fce(0x131)]:(_0x4c19be[_0x543fce(0x165)](_0x543fce(0x115)+_0x2ae84c[_0x543fce(0x122)]+_0x543fce(0x117)+_0x3bbdc4['error']),_0x2b42ae=![]),_0xb3cbb5['allValid']=_0x2b42ae,_0xb3cbb5;}if(_0x310788[_0x543fce(0xde)]){const _0x413a54=findBehaviorByName(_0x542d02,_0x310788[_0x543fce(0xde)]);if(!_0x413a54)throw new SDKError(ErrorCode[_0x543fce(0x157)],_0x543fce(0x15f)+_0x310788[_0x543fce(0xde)]+'\x27\x20not\x20found');const _0x5b16ec=_0x310788['interval']||DEFAULT_TIME_RANGE;_0x397a18(_0x543fce(0x125)+_0x413a54[_0x543fce(0x122)]+'\x20('+_0x5b16ec+')');const _0x54f94f=generateBehaviorSampleSQL(_0x542d02,_0x413a54,DEFAULT_SAMPLE_LIMIT,_0x5b16ec),_0x1b3abe=await _0x3cd6a5(_0x54f94f);return!_0x1b3abe['error']?_0xb3cbb5[_0x543fce(0x15a)]=_0x1b3abe['data']:(_0x4c19be[_0x543fce(0x165)](_0x543fce(0x15f)+_0x413a54[_0x543fce(0x122)]+_0x543fce(0x117)+_0x1b3abe[_0x543fce(0x13f)]),_0x2b42ae=![]),_0xb3cbb5['allValid']=_0x2b42ae,_0xb3cbb5;}if(_0x310788['enriched']){_0x397a18(_0x543fce(0x104));const _0x2b97af=generateEnrichedSQL(_0x542d02,DEFAULT_SAMPLE_LIMIT),_0x4ca31b=await _0x3cd6a5(_0x2b97af);return!_0x4ca31b[_0x543fce(0x13f)]?_0xb3cbb5[_0x543fce(0x15a)]=_0x4ca31b['data']:(_0x4c19be[_0x543fce(0x165)](_0x543fce(0x11a)+_0x4ca31b[_0x543fce(0x13f)]),_0x2b42ae=![]),_0xb3cbb5[_0x543fce(0x141)]=_0x2b42ae,_0xb3cbb5;}return _0xb3cbb5[_0x543fce(0x141)]=_0x2b42ae,_0xb3cbb5;}async['createSegment'](_0x4dace8,_0x547450){const _0x106ea0=a126_0x3b3db0;return await this[_0x106ea0(0x159)][_0x106ea0(0x158)](_0x4dace8,_0x547450);}async['createJourneySegment'](_0x367636){const _0x395b8d=a126_0x3b3db0;return await this[_0x395b8d(0x159)][_0x395b8d(0xd5)](_0x367636);}async[a126_0x3b3db0(0x155)](_0x56fc63,_0x3f5f43,_0x39d03e){const _0x4e6d2b=a126_0x3b3db0;return await this['client'][_0x4e6d2b(0x11e)](_0x56fc63,_0x3f5f43,_0x39d03e);}async[a126_0x3b3db0(0x10f)](_0x88eca){const _0xdd0cb8=a126_0x3b3db0;return await this[_0xdd0cb8(0x159)][_0xdd0cb8(0x10f)](_0x88eca);}async['createFolder'](_0x33aa8b,_0x3dc251){const _0x51e761=a126_0x3b3db0,_0x527a8e=await this[_0x51e761(0x109)](_0x33aa8b);return await this[_0x51e761(0x159)][_0x51e761(0xed)](_0x527a8e,_0x3dc251);}async[a126_0x3b3db0(0x109)](_0xfd52bd){const _0x50718e=a126_0x3b3db0;if(/^\d+$/[_0x50718e(0xf7)](_0xfd52bd))return _0xfd52bd;return await this[_0x50718e(0x14a)](_0xfd52bd);}async[a126_0x3b3db0(0x111)](_0x53dd5f,_0x3eba6c){const _0x1946e5=a126_0x3b3db0,[_0x23632f,_0x1388c7]=await Promise[_0x1946e5(0x13c)]([this[_0x1946e5(0x13b)](_0x53dd5f,_0x3eba6c)['then'](()=>!![])['catch'](()=>![]),this[_0x1946e5(0x14b)](_0x53dd5f,_0x3eba6c)[_0x1946e5(0x138)](()=>!![])[_0x1946e5(0xf6)](()=>![])]);if(_0x23632f&&_0x1388c7)return _0x1946e5(0x121);else{if(_0x23632f)return _0x1946e5(0x13a);else{if(_0x1388c7)return'segment';}}throw new SDKError(ErrorCode[_0x1946e5(0x157)],_0x1946e5(0x116)+_0x3eba6c+'\x27\x20not\x20found\x20in\x20parent\x20segment');}async[a126_0x3b3db0(0xf9)](_0x3d12db,_0x16b585,_0x551003){const _0x1cf928=a126_0x3b3db0,[_0x5e40cf,_0x18e9a5]=await Promise[_0x1cf928(0x13c)]([this[_0x1cf928(0xf3)](_0x3d12db),this[_0x1cf928(0xdb)](_0x3d12db)]),_0x44fb55=_0x551003?_0x5e40cf['filter'](_0x20057c=>_0x20057c[_0x1cf928(0x128)]===_0x551003):_0x5e40cf[_0x1cf928(0xeb)](_0x9de667=>!_0x9de667[_0x1cf928(0x128)]),_0x72dd9b=_0x551003?_0x18e9a5['filter'](_0x4b7da4=>_0x4b7da4[_0x1cf928(0x160)]===_0x551003):_0x18e9a5[_0x1cf928(0xeb)](_0x54606b=>!_0x54606b[_0x1cf928(0x160)]),_0x17ad65=_0x44fb55[_0x1cf928(0x120)](_0x210c80=>_0x210c80['name']===_0x16b585),_0x2077cf=_0x72dd9b[_0x1cf928(0x120)](_0x444eeb=>_0x444eeb[_0x1cf928(0x122)]===_0x16b585);if(_0x17ad65&&_0x2077cf)return _0x1cf928(0x121);else{if(_0x17ad65)return _0x1cf928(0x13a);else{if(_0x2077cf)return _0x1cf928(0x12f);}}throw new SDKError(ErrorCode[_0x1cf928(0x157)],_0x1cf928(0x116)+_0x16b585+'\x27\x20not\x20found\x20in\x20'+(_0x551003?_0x1cf928(0x13a):_0x1cf928(0x12b)));}async['traversePath'](_0x233d71){const _0x37ac49=a126_0x3b3db0;if(_0x233d71[_0x37ac49(0x153)]===0x0)throw new SDKError(ErrorCode[_0x37ac49(0x14c)],_0x37ac49(0xfa));const _0x58684b=_0x233d71[0x0],_0x4300f3=await this[_0x37ac49(0x14a)](_0x58684b);if(_0x233d71[_0x37ac49(0x153)]===0x1)return{'parentId':_0x4300f3,'parentName':_0x58684b,'type':_0x37ac49(0x149),'fullPath':_0x58684b};const _0x25c182=await this[_0x37ac49(0xfd)](_0x4300f3),_0x1da6ef=_0x25c182[_0x37ac49(0xee)],_0x1bb5ca=[];let _0x140ec6=_0x1da6ef;for(let _0x47c88b=0x1;_0x47c88b<_0x233d71[_0x37ac49(0x153)]-0x1;_0x47c88b++){const _0x32f4f7=_0x233d71[_0x47c88b],_0x36467d=await this[_0x37ac49(0xf3)](_0x4300f3),_0x286c9b=_0x140ec6?_0x36467d[_0x37ac49(0xd8)](_0x4fdfd5=>_0x4fdfd5[_0x37ac49(0x122)]===_0x32f4f7&&_0x4fdfd5['parentFolderId']===_0x140ec6):_0x36467d['find'](_0x344d3f=>_0x344d3f[_0x37ac49(0x122)]===_0x32f4f7&&!_0x344d3f[_0x37ac49(0x128)]);if(!_0x286c9b)throw new SDKError(ErrorCode[_0x37ac49(0x157)],'Folder\x20\x27'+_0x32f4f7+_0x37ac49(0x137));_0x1bb5ca[_0x37ac49(0x165)](_0x32f4f7),_0x140ec6=_0x286c9b['id'];}const _0x44712a=_0x233d71[_0x233d71['length']-0x1],_0x4f7aee=await this[_0x37ac49(0xf9)](_0x4300f3,_0x44712a,_0x140ec6);if(_0x4f7aee==='ambiguous'||_0x4f7aee===_0x37ac49(0x13a)){const _0x499a5b=await this[_0x37ac49(0xf3)](_0x4300f3),_0x1181e1=_0x140ec6?_0x499a5b['find'](_0x350d02=>_0x350d02[_0x37ac49(0x122)]===_0x44712a&&_0x350d02[_0x37ac49(0x128)]===_0x140ec6):_0x499a5b[_0x37ac49(0xd8)](_0x36ddab=>_0x36ddab['name']===_0x44712a&&!_0x36ddab['parentFolderId']);if(!_0x1181e1)throw new SDKError(ErrorCode[_0x37ac49(0x157)],_0x37ac49(0x152)+_0x44712a+'\x27\x20not\x20found');return _0x1bb5ca[_0x37ac49(0x165)](_0x44712a),{'parentId':_0x4300f3,'parentName':_0x58684b,'folderId':_0x1181e1['id'],'folderPath':_0x1bb5ca,'type':_0x37ac49(0x13a),'fullPath':_0x233d71['join']('/')};}else{const _0x23f815=await this[_0x37ac49(0xdb)](_0x4300f3),_0x5344fa=_0x140ec6?_0x23f815[_0x37ac49(0xd8)](_0x2f4520=>_0x2f4520[_0x37ac49(0x122)]===_0x44712a&&_0x2f4520[_0x37ac49(0x160)]===_0x140ec6):_0x23f815[_0x37ac49(0xd8)](_0x1a1d10=>_0x1a1d10[_0x37ac49(0x122)]===_0x44712a&&!_0x1a1d10[_0x37ac49(0x160)]);if(!_0x5344fa)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x37ac49(0xe4)+_0x44712a+_0x37ac49(0x169));return{'parentId':_0x4300f3,'parentName':_0x58684b,'folderId':_0x140ec6,'folderPath':_0x1bb5ca[_0x37ac49(0x153)]>0x0?_0x1bb5ca:undefined,'segmentId':_0x5344fa['id'],'segmentName':_0x44712a,'type':'segment','fullPath':_0x233d71['join']('/')};}}async['resolvePathToResource'](_0x498b88){const _0x43ecb9=a126_0x3b3db0,_0x27ad0c=parsePath(_0x498b88);if(!_0x27ad0c[_0x43ecb9(0x10c)])throw new SDKError(ErrorCode[_0x43ecb9(0x14c)],_0x43ecb9(0xe3));return await this[_0x43ecb9(0x147)](_0x27ad0c[_0x43ecb9(0x108)]);}async[a126_0x3b3db0(0x100)](_0x3379d6,_0x3f0ef2){const _0x311e64=a126_0x3b3db0;let _0x28c244=_0x3f0ef2;if(!_0x28c244){const _0x3d82a7=await this[_0x311e64(0xfd)](_0x3379d6);_0x28c244=_0x3d82a7[_0x311e64(0xee)];}if(!_0x28c244)return{'folders':[],'segments':[],'journeys':[]};const _0x321bd7=await this[_0x311e64(0x159)][_0x311e64(0x150)](_0x28c244,0x1,![]),_0x1b801e=_0x321bd7[_0x311e64(0x131)],_0x4d82e8=_0x1b801e['filter'](_0x4d0884=>{const _0x271385=_0x311e64;if(_0x4d0884['id']===_0x28c244)return![];const _0x31327f=this[_0x271385(0x126)](_0x4d0884);return _0x31327f===_0x28c244||!_0x31327f;}),_0x30785a=_0x4d82e8['filter'](_0x20f4c8=>_0x20f4c8[_0x311e64(0xe2)]===_0x311e64(0x151))['map'](_0x1b30ea=>this[_0x311e64(0x12a)](_0x1b30ea,_0x3379d6)),_0x15dd6e=_0x4d82e8['filter'](_0x5e98f2=>_0x5e98f2[_0x311e64(0xe2)]===_0x311e64(0x10b)||_0x5e98f2[_0x311e64(0xe2)]==='segment-realtime')[_0x311e64(0x167)](_0x36ed4f=>this[_0x311e64(0xe9)](_0x36ed4f,_0x3379d6)),_0x561372=_0x4d82e8[_0x311e64(0xeb)](_0x30122e=>_0x30122e[_0x311e64(0xe2)]===_0x311e64(0x140)),_0x2c3d1c=_0x561372[_0x311e64(0x167)](_0x1ac52f=>({'journeyBundleId':_0x1ac52f[_0x311e64(0x134)][_0x311e64(0x101)],'versionNumber':_0x1ac52f[_0x311e64(0x134)][_0x311e64(0x14e)],'id':_0x1ac52f['id'],'entity':_0x1ac52f})),_0x2493a6=deduplicateJourneysByBundle(_0x2c3d1c),_0x4192c2=_0x2493a6[_0x311e64(0x167)](_0x293c28=>entityToJourneyListItem(_0x293c28[_0x311e64(0xf5)],_0x3379d6));return{'folders':_0x30785a,'segments':_0x15dd6e,'journeys':_0x4192c2};}[a126_0x3b3db0(0x12a)](_0x3155be,_0xb74bad){const _0x78ecbb=a126_0x3b3db0;return{'audienceId':_0xb74bad,'id':_0x3155be['id'],'name':_0x3155be[_0x78ecbb(0x134)]['name'],'parentFolderId':_0x3155be[_0x78ecbb(0x134)][_0x78ecbb(0x128)]??_0x3155be[_0x78ecbb(0x106)]?.[_0x78ecbb(0xe8)]?.[_0x78ecbb(0x131)]?.['id']??null,'description':_0x3155be['attributes'][_0x78ecbb(0xe6)]??null,'createdAt':_0x3155be['attributes'][_0x78ecbb(0x12c)],'updatedAt':_0x3155be[_0x78ecbb(0x134)][_0x78ecbb(0x166)]};}[a126_0x3b3db0(0xe9)](_0x3f0435,_0x3a26bf){const _0x158e81=a126_0x3b3db0;return{'audienceId':_0x3a26bf,'id':_0x3f0435['id'],'name':_0x3f0435[_0x158e81(0x134)][_0x158e81(0x122)],'description':_0x3f0435['attributes'][_0x158e81(0xe6)]??undefined,'realtime':_0x3f0435[_0x158e81(0xe2)]==='segment-realtime','segmentFolderId':_0x3f0435['attributes']['segmentFolderId']??_0x3f0435[_0x158e81(0x106)]?.[_0x158e81(0xe8)]?.[_0x158e81(0x131)]?.['id']??undefined,'population':_0x3f0435[_0x158e81(0x134)]['population'],'createdAt':_0x3f0435[_0x158e81(0x134)][_0x158e81(0x12c)],'updatedAt':_0x3f0435['attributes']['updatedAt']};}async[a126_0x3b3db0(0xe0)](_0x3603d3,_0x19d1f3,_0x15e1e8,_0x31c0da=0xa){const _0x21c0b4=a126_0x3b3db0;let _0xdf42bc=_0x19d1f3;if(!_0xdf42bc){const _0x106dc9=await this['getParentFull'](_0x3603d3);_0xdf42bc=_0x106dc9[_0x21c0b4(0xee)];}if(!_0xdf42bc)return[];const _0x109892=await this[_0x21c0b4(0x159)][_0x21c0b4(0x150)](_0xdf42bc,_0x31c0da,![]),_0x229534=_0x109892[_0x21c0b4(0x131)];return this['buildTreeFromEntities'](_0x229534,_0xdf42bc);}[a126_0x3b3db0(0xf1)](_0x3ad759,_0x4e376d){const _0x3f9cd0=a126_0x3b3db0,_0x5809b7=new Map();for(const _0x3c8aed of _0x3ad759){if(_0x3c8aed[_0x3f9cd0(0xe2)]==='folder-segment'&&_0x3c8aed['id']===_0x4e376d)continue;const _0xd9d814=this[_0x3f9cd0(0x126)](_0x3c8aed)??_0x4e376d;!_0x5809b7[_0x3f9cd0(0xfe)](_0xd9d814)&&_0x5809b7['set'](_0xd9d814,[]),_0x5809b7[_0x3f9cd0(0x143)](_0xd9d814)['push'](_0x3c8aed);}return this[_0x3f9cd0(0x124)](_0x4e376d,_0x5809b7);}[a126_0x3b3db0(0x126)](_0x3607f7){const _0x2050cd=a126_0x3b3db0;if(_0x3607f7[_0x2050cd(0x106)]?.[_0x2050cd(0xe8)]?.[_0x2050cd(0x131)]?.['id'])return _0x3607f7[_0x2050cd(0x106)][_0x2050cd(0xe8)][_0x2050cd(0x131)]['id'];return _0x3607f7[_0x2050cd(0x134)][_0x2050cd(0x128)]??_0x3607f7[_0x2050cd(0x134)][_0x2050cd(0x160)]??undefined;}['buildTreeNodesForFolder'](_0x3632df,_0x531176){const _0x219fcc=a126_0x3b3db0,_0x2bc015=_0x531176[_0x219fcc(0x143)](_0x3632df)??[],_0x2cd1b6=[],_0x2b13ea=_0x2bc015[_0x219fcc(0xeb)](_0x192a21=>_0x192a21[_0x219fcc(0xe2)]===_0x219fcc(0x151)),_0x164334=_0x2bc015['filter'](_0x356b90=>_0x356b90[_0x219fcc(0xe2)]===_0x219fcc(0x10b)||_0x356b90[_0x219fcc(0xe2)]===_0x219fcc(0xda)),_0x373f40=_0x2bc015[_0x219fcc(0xeb)](_0x457379=>_0x457379[_0x219fcc(0xe2)]===_0x219fcc(0x140)),_0x4f3aae=_0x373f40[_0x219fcc(0x167)](_0xf8134c=>({'journeyBundleId':_0xf8134c[_0x219fcc(0x134)][_0x219fcc(0x101)],'versionNumber':_0xf8134c['attributes']['versionNumber'],'id':_0xf8134c['id'],'entity':_0xf8134c})),_0x2c03a0=deduplicateJourneysByBundle(_0x4f3aae);for(const _0x15b551 of _0x2b13ea){const _0x469c73=this[_0x219fcc(0x124)](_0x15b551['id'],_0x531176);_0x2cd1b6[_0x219fcc(0x165)]({'type':_0x219fcc(0x13a),'id':_0x15b551['id'],'name':_0x15b551[_0x219fcc(0x134)][_0x219fcc(0x122)],'children':_0x469c73[_0x219fcc(0x153)]>0x0?_0x469c73:undefined,'metadata':{'description':_0x15b551[_0x219fcc(0x134)][_0x219fcc(0xe6)]??undefined,'folderCount':_0x469c73[_0x219fcc(0xeb)](_0x30813f=>_0x30813f['type']==='folder')[_0x219fcc(0x153)],'segmentCount':_0x469c73['filter'](_0x5ea19a=>_0x5ea19a[_0x219fcc(0xe2)]==='segment')[_0x219fcc(0x153)],'journeyCount':_0x469c73[_0x219fcc(0xeb)](_0x233664=>_0x233664[_0x219fcc(0xe2)]===_0x219fcc(0x140))[_0x219fcc(0x153)],'createdAt':_0x15b551[_0x219fcc(0x134)][_0x219fcc(0x12c)],'updatedAt':_0x15b551['attributes']['updatedAt']}});}for(const _0x5e2936 of _0x164334){_0x2cd1b6[_0x219fcc(0x165)]({'type':_0x219fcc(0x12f),'id':_0x5e2936['id'],'name':_0x5e2936['attributes'][_0x219fcc(0x122)],'population':_0x5e2936[_0x219fcc(0x134)][_0x219fcc(0x148)],'metadata':{'description':_0x5e2936[_0x219fcc(0x134)][_0x219fcc(0xe6)]??undefined,'createdAt':_0x5e2936['attributes'][_0x219fcc(0x12c)],'updatedAt':_0x5e2936[_0x219fcc(0x134)]['updatedAt']}});}for(const _0x351948 of _0x2c03a0){const _0x43b3b0=_0x351948[_0x219fcc(0xf5)];_0x2cd1b6[_0x219fcc(0x165)]({'type':'journey','id':_0x43b3b0['id'],'name':_0x43b3b0[_0x219fcc(0x134)][_0x219fcc(0x163)]??_0x43b3b0['attributes'][_0x219fcc(0x122)]??'','state':parseJourneyState(_0x43b3b0[_0x219fcc(0x134)][_0x219fcc(0x15b)]),'metadata':{}});}return _0x2cd1b6;}async[a126_0x3b3db0(0xd1)](_0xa6cafe,_0x3d5945={}){const _0x5e2407=a126_0x3b3db0,_0x24b046=this[_0x5e2407(0xf8)](),_0x1dddeb={'segment':_0x24b046[_0x5e2407(0x12f)],'journey':_0x24b046[_0x5e2407(0x140)],'user':_0x24b046['user'],'connection':_0x24b046['connection']};return a126_0x5f3369(_0x1dddeb,_0xa6cafe,_0x3d5945);}[a126_0x3b3db0(0xf8)](){const _0x16356b=a126_0x3b3db0;return this[_0x16356b(0x139)];}}
|
package/dist/sdk/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0x183c33=a133_0x396b;function a133_0x396b(_0x3b2ea4,_0x4d0ace){_0x3b2ea4=_0x3b2ea4-0x1ea;const _0x2c0a13=a133_0x2c0a();let _0x396b97=_0x2c0a13[_0x3b2ea4];return _0x396b97;}function a133_0x2c0a(){const _0x35c41c=['jp01','18PNsSQh','4582806svEiOl','5193448XGENdn','1547272HXlMjQ','stg-us01','2241765ZoWzQU','1332783zHQQMg','51268YUnbcY','701373BQBCFS','7qvfQaR'];a133_0x2c0a=function(){return _0x35c41c;};return a133_0x2c0a();}(function(_0x69f7c0,_0x3719ed){const _0x596f22=a133_0x396b,_0x574a5c=_0x69f7c0();while(!![]){try{const _0x23fa1f=parseInt(_0x596f22(0x1ef))/0x1+parseInt(_0x596f22(0x1ee))/0x2+parseInt(_0x596f22(0x1ed))/0x3+-parseInt(_0x596f22(0x1ea))/0x4+parseInt(_0x596f22(0x1ec))/0x5+-parseInt(_0x596f22(0x1f3))/0x6*(-parseInt(_0x596f22(0x1f0))/0x7)+parseInt(_0x596f22(0x1f4))/0x8*(-parseInt(_0x596f22(0x1f2))/0x9);if(_0x23fa1f===_0x3719ed)break;else _0x574a5c['push'](_0x574a5c['shift']());}catch(_0x56c830){_0x574a5c['push'](_0x574a5c['shift']());}}}(a133_0x2c0a,0xaa782));export const SITE_ALIASES={'us':'us01','aws':'us01','jp':a133_0x183c33(0x1f1),'aws-tokyo':a133_0x183c33(0x1f1),'dev':'dev-us01','stg':a133_0x183c33(0x1eb)};export{getEndpoint,API_ENDPOINTS}from'../client/endpoints.js';export{noopReporter}from'./progress.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a136_0x3169(){const _0x3031df=['21qDGCHp','288868Ofasoc','1768amISFY','671130rWzGpm','1323130AQZAor','242395mARmWx','780348fImnCC','21648qpXkeE','273AnHkZy','66DFJfwM','27YVUTfa','174pecoHj'];a136_0x3169=function(){return _0x3031df;};return a136_0x3169();}function a136_0x3ab3(_0x3c6f99,_0x4a11a4){_0x3c6f99=_0x3c6f99-0x153;const _0x31694c=a136_0x3169();let _0x3ab34d=_0x31694c[_0x3c6f99];return _0x3ab34d;}(function(_0x2b8f27,_0x3bc29c){const _0x494cb0=a136_0x3ab3,_0x1eea6e=_0x2b8f27();while(!![]){try{const _0xe1562a=parseInt(_0x494cb0(0x156))/0x1+-parseInt(_0x494cb0(0x154))/0x2+-parseInt(_0x494cb0(0x15c))/0x3*(parseInt(_0x494cb0(0x15d))/0x4)+parseInt(_0x494cb0(0x155))/0x5*(parseInt(_0x494cb0(0x15b))/0x6)+-parseInt(_0x494cb0(0x158))/0x7*(parseInt(_0x494cb0(0x15e))/0x8)+parseInt(_0x494cb0(0x15a))/0x9*(-parseInt(_0x494cb0(0x153))/0xa)+-parseInt(_0x494cb0(0x159))/0xb*(-parseInt(_0x494cb0(0x157))/0xc);if(_0xe1562a===_0x3bc29c)break;else _0x1eea6e['push'](_0x1eea6e['shift']());}catch(_0x3a9517){_0x1eea6e['push'](_0x1eea6e['shift']());}}}(a136_0x3169,0xc8335));export const noopReporter={'update':()=>{}};
|
package/dist/sdk/user.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a140_0x4e45(_0x2657a6,_0x569720){_0x2657a6=_0x2657a6-0x12e;const _0x5c3e1e=a140_0x5c3e();let _0x4e455e=_0x5c3e1e[_0x2657a6];return _0x4e455e;}const a140_0x120c66=a140_0x4e45;(function(_0x1aeb44,_0x54ae2f){const _0x55f87f=a140_0x4e45,_0x3823a7=_0x1aeb44();while(!![]){try{const _0x1f7764=-parseInt(_0x55f87f(0x13d))/0x1+parseInt(_0x55f87f(0x145))/0x2+-parseInt(_0x55f87f(0x139))/0x3+parseInt(_0x55f87f(0x12e))/0x4+-parseInt(_0x55f87f(0x132))/0x5*(-parseInt(_0x55f87f(0x142))/0x6)+parseInt(_0x55f87f(0x13f))/0x7+-parseInt(_0x55f87f(0x13a))/0x8*(parseInt(_0x55f87f(0x143))/0x9);if(_0x1f7764===_0x54ae2f)break;else _0x3823a7['push'](_0x3823a7['shift']());}catch(_0x478116){_0x3823a7['push'](_0x3823a7['shift']());}}}(a140_0x5c3e,0x37347));import{TDApiClient}from'./client/td-api-client.js';function a140_0x5c3e(){const _0x1b01a3=['2613030kMXVCG','map','email','138lLFTGV','9EQwgjC','toLowerCase','473076IpzKcP','clearCache','1798092upKRIg','client','profile','buildEmailToIdMap','56410GVHgtM','getCurrent','buildUserMaps','getUserInfo','buildIdToEmailMap','list','listUsers','1081758xSwLgI','4695848dXzaAq','default','findById','145151GIzjgJ','findByEmail'];a140_0x5c3e=function(){return _0x1b01a3;};return a140_0x5c3e();}import{loadCachedUsers,saveCachedUsers,clearUserCache}from'../core/user-cache.js';export class UserSDK{[a140_0x120c66(0x12f)];['profile'];constructor(_0xe8dfa8){const _0x13618b=a140_0x120c66;this['client']=new TDApiClient(_0xe8dfa8),this[_0x13618b(0x130)]=_0xe8dfa8[_0x13618b(0x130)]||_0x13618b(0x13b);}async[a140_0x120c66(0x133)](){const _0x40a232=a140_0x120c66;return await this[_0x40a232(0x12f)][_0x40a232(0x135)]();}async[a140_0x120c66(0x137)](_0x2ac741=![]){const _0x40be28=a140_0x120c66;if(!_0x2ac741){const _0x5b6202=loadCachedUsers(this['profile']);if(_0x5b6202)return _0x5b6202;}const _0x19a153=await this[_0x40be28(0x12f)][_0x40be28(0x138)]();return saveCachedUsers(this[_0x40be28(0x130)],_0x19a153),_0x19a153;}[a140_0x120c66(0x146)](){clearUserCache(this['profile']);}async[a140_0x120c66(0x13e)](_0x4c28fe){const _0x285e92=a140_0x120c66,_0x3cee52=await this[_0x285e92(0x137)]();return _0x3cee52['find'](_0x391f8a=>_0x391f8a['email'][_0x285e92(0x144)]()===_0x4c28fe[_0x285e92(0x144)]());}async[a140_0x120c66(0x13c)](_0x164e74){const _0x5f458f=a140_0x120c66,_0x32a41c=await this[_0x5f458f(0x137)]();return _0x32a41c['find'](_0x31f94e=>_0x31f94e['id']===_0x164e74);}async[a140_0x120c66(0x131)](){const _0x226b76=a140_0x120c66,_0x455c20=await this[_0x226b76(0x137)]();return new Map(_0x455c20[_0x226b76(0x140)](_0x1a28f3=>[_0x1a28f3[_0x226b76(0x141)][_0x226b76(0x144)](),_0x1a28f3['id']]));}async[a140_0x120c66(0x136)](){const _0x21d179=a140_0x120c66,_0x3ccfc7=await this[_0x21d179(0x137)]();return new Map(_0x3ccfc7[_0x21d179(0x140)](_0x1d9883=>[_0x1d9883['id'],_0x1d9883['email']]));}async[a140_0x120c66(0x134)](){const _0x3b9066=a140_0x120c66,_0x2cbedc=await this[_0x3b9066(0x137)]();return{'emailToId':new Map(_0x2cbedc['map'](_0x568964=>[_0x568964[_0x3b9066(0x141)][_0x3b9066(0x144)](),_0x568964['id']])),'idToEmail':new Map(_0x2cbedc[_0x3b9066(0x140)](_0xcdeb99=>[_0xcdeb99['id'],_0xcdeb99[_0x3b9066(0x141)]]))};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a141_0x4ddc(){const _0x59b27a=['tsv','495705uKFJwZ','11pnXKwA','4964zYkgsr','83988xHQWVQ','1080HJqDEV','toLowerCase','5594617ATuVTS','4792UPBWKz','2406xYgptB','3926TUyFDy','jsonl','table','73LTuTjq','6174PVNXER','6rWZkGM','8019290fyJpFG'];a141_0x4ddc=function(){return _0x59b27a;};return a141_0x4ddc();}function a141_0x215d(_0x2760e1,_0x296c7a){_0x2760e1=_0x2760e1-0xa3;const _0x4ddce9=a141_0x4ddc();let _0x215dac=_0x4ddce9[_0x2760e1];return _0x215dac;}(function(_0x1c1041,_0x1ca35b){const _0x527fcc=a141_0x215d,_0x2815a0=_0x1c1041();while(!![]){try{const _0x522fc2=-parseInt(_0x527fcc(0xa5))/0x1*(-parseInt(_0x527fcc(0xb2))/0x2)+parseInt(_0x527fcc(0xaa))/0x3+-parseInt(_0x527fcc(0xac))/0x4*(-parseInt(_0x527fcc(0xae))/0x5)+-parseInt(_0x527fcc(0xa7))/0x6*(-parseInt(_0x527fcc(0xb0))/0x7)+-parseInt(_0x527fcc(0xb1))/0x8*(-parseInt(_0x527fcc(0xa6))/0x9)+parseInt(_0x527fcc(0xa8))/0xa*(parseInt(_0x527fcc(0xab))/0xb)+-parseInt(_0x527fcc(0xad))/0xc*(parseInt(_0x527fcc(0xb3))/0xd);if(_0x522fc2===_0x1ca35b)break;else _0x2815a0['push'](_0x2815a0['shift']());}catch(_0x4199f7){_0x2815a0['push'](_0x2815a0['shift']());}}}(a141_0x4ddc,0x6669e));export function detectFormatFromExtension(_0x3eb224){const _0x157636=a141_0x215d,_0x2616b3=_0x3eb224[_0x157636(0xaf)]()['split']('.')['pop']();switch(_0x2616b3){case'json':return'json';case _0x157636(0xa3):return _0x157636(0xa3);case _0x157636(0xa9):case'tab':return _0x157636(0xa9);case'txt':case'text':return _0x157636(0xa4);default:return undefined;}}export function resolveOutputFormat(_0x83231,_0x1f9a17,_0x3fd510){if(_0x83231)return _0x83231;if(_0x1f9a17){const _0xe09e30=detectFormatFromExtension(_0x1f9a17);if(_0xe09e30)return _0xe09e30;}return _0x3fd510;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a142_0x4554(_0x46103f,_0x554629){_0x46103f=_0x46103f-0x1e5;const _0x52ca6f=a142_0x52ca();let _0x45544a=_0x52ca6f[_0x46103f];return _0x45544a;}(function(_0x211ebf,_0x147808){const _0x3ca3e9=a142_0x4554,_0x151705=_0x211ebf();while(!![]){try{const _0x37a713=parseInt(_0x3ca3e9(0x20c))/0x1+-parseInt(_0x3ca3e9(0x21d))/0x2*(-parseInt(_0x3ca3e9(0x1ff))/0x3)+-parseInt(_0x3ca3e9(0x209))/0x4*(-parseInt(_0x3ca3e9(0x211))/0x5)+-parseInt(_0x3ca3e9(0x214))/0x6*(-parseInt(_0x3ca3e9(0x21a))/0x7)+parseInt(_0x3ca3e9(0x1f0))/0x8*(parseInt(_0x3ca3e9(0x201))/0x9)+parseInt(_0x3ca3e9(0x20d))/0xa+parseInt(_0x3ca3e9(0x20b))/0xb*(-parseInt(_0x3ca3e9(0x219))/0xc);if(_0x37a713===_0x147808)break;else _0x151705['push'](_0x151705['shift']());}catch(_0x936087){_0x151705['push'](_0x151705['shift']());}}}(a142_0x52ca,0x70e2b));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(){const _0x52b176=a142_0x4554;return process[_0x52b176(0x1ed)][_0x52b176(0x1ee)]||Infinity;}export function formatAsTable(_0x28c465,_0x47b7c6=DEFAULT_MAX_DISPLAY_ROWS,_0x54e2e2=![],_0x52e762={}){const _0x35d27e=a142_0x4554;if(_0x28c465['data'][_0x35d27e(0x207)]===0x0)return _0x35d27e(0x1ef);const _0x4dd182=_0x28c465['columns'][_0x35d27e(0x1f7)](_0x1390d7=>_0x1390d7[_0x35d27e(0x1ea)]),_0x4d0d4d=_0x28c465[_0x35d27e(0x1ee)][_0x35d27e(0x1f7)](_0x3bfdb4=>simplifyType(_0x3bfdb4[_0x35d27e(0x212)])),_0x49b3d6=_0x28c465[_0x35d27e(0x1fa)][_0x35d27e(0x1e9)](0x0,_0x47b7c6),_0x7a38eb=_0x28c465['data'][_0x35d27e(0x207)],_0x4dae8f=_0x7a38eb>_0x47b7c6,_0x6c1c9d=[],_0x3bd4cf=getTerminalWidth(),_0x114d57=_0x3bd4cf!==Infinity,_0x28f7e8=0x32;let _0x5379e9=_0x4dd182['map']((_0x35ec13,_0x18e61b)=>{const _0x475b55=_0x35d27e,_0x5ed0f8=stringWidth(_0x4d0d4d[_0x18e61b]),_0x534781=Math['max'](..._0x49b3d6[_0x475b55(0x1f7)](_0x403cad=>{const _0x123682=_0x403cad[_0x35ec13];return stringWidth(formatValue(_0x123682));})),_0x5b9736=Math['max'](stringWidth(_0x35ec13),_0x5ed0f8,_0x534781);return _0x54e2e2?_0x5b9736:Math[_0x475b55(0x1fc)](_0x5b9736,_0x28f7e8);});if(_0x114d57&&!_0x54e2e2&&_0x4dd182[_0x35d27e(0x207)]>0x0){const _0x26979a=_0x3b1136=>{let _0x256c20=0x1;for(const _0x8f1c91 of _0x3b1136){_0x256c20+=_0x8f1c91+0x3;}return _0x256c20+0x1;};let _0x1bf138=_0x26979a(_0x5379e9);if(_0x1bf138>_0x3bd4cf){const _0x2b8604=0x3;for(let _0xb72182=_0x5379e9[_0x35d27e(0x207)]-0x1;_0xb72182>=0x0;_0xb72182--){_0x1bf138=_0x26979a(_0x5379e9);if(_0x1bf138<=_0x3bd4cf)break;const _0x34b9c3=_0x5379e9[_0xb72182],_0x5190ba=_0x1bf138-_0x3bd4cf,_0xed70d4=_0x34b9c3-_0x2b8604,_0x343b53=Math[_0x35d27e(0x1fc)](_0x5190ba,_0xed70d4);_0x343b53>0x0&&(_0x5379e9[_0xb72182]=_0x34b9c3-_0x343b53);}}}const _0x24c1f7=_0x4dd182,_0x1b9df0=_0x4d0d4d,_0x106026=_0x5379e9,_0x11d0c7=_0x5379e9;_0x6c1c9d[_0x35d27e(0x1f6)](colorBorder('┌'+_0x11d0c7['map'](_0x21a6ab=>'─'[_0x35d27e(0x200)](_0x21a6ab+0x2))['join']('┬')+'┐',_0x52e762));const _0x7e4829=_0x24c1f7[_0x35d27e(0x1f7)]((_0x3a4109,_0x539919)=>centerAlign(_0x3a4109,_0x106026[_0x539919]));_0x6c1c9d[_0x35d27e(0x1f6)](colorBorder('│',_0x52e762)+'\x20'+_0x7e4829[_0x35d27e(0x204)]('\x20'+colorBorder('│',_0x52e762)+'\x20')+'\x20'+colorBorder('│',_0x52e762));const _0x13f7d3=_0x1b9df0['map']((_0x4bb9f5,_0x4a1ac0)=>colorType(centerAlign(_0x4bb9f5,_0x106026[_0x4a1ac0]),_0x52e762));_0x6c1c9d[_0x35d27e(0x1f6)](colorBorder('│',_0x52e762)+'\x20'+_0x13f7d3[_0x35d27e(0x204)]('\x20'+colorBorder('│',_0x52e762)+'\x20')+'\x20'+colorBorder('│',_0x52e762)),_0x6c1c9d['push'](colorBorder('├'+_0x11d0c7[_0x35d27e(0x1f7)](_0x6084b1=>'─'[_0x35d27e(0x200)](_0x6084b1+0x2))[_0x35d27e(0x204)]('┼')+'┤',_0x52e762));const _0x75f94d=(_0xbaeb10,_0x6b1495)=>{const _0x477554=_0x35d27e,_0x26a0d0=stringWidth(_0xbaeb10);if(_0x26a0d0<=_0x6b1495)return _0xbaeb10;let _0x4d0e9d=_0xbaeb10;while(stringWidth(_0x4d0e9d+'…')>_0x6b1495&&_0x4d0e9d[_0x477554(0x207)]>0x0){_0x4d0e9d=_0x4d0e9d[_0x477554(0x1e9)](0x0,-0x1);}return _0x4d0e9d+'…';};_0x49b3d6[_0x35d27e(0x1e8)](_0x2b9812=>{const _0x95e5be=_0x35d27e,_0x4031d8=_0x4dd182['map']((_0x50925f,_0x1de23c)=>{const _0x13d6d2=a142_0x4554,_0x2ef0be=_0x2b9812[_0x50925f],_0x48dc50=formatValue(_0x2ef0be),_0x4ad564=_0x106026[_0x1de23c],_0x44b0d2=_0x75f94d(_0x48dc50,_0x4ad564),_0x1f880b=typeof _0x2ef0be===_0x13d6d2(0x1e5)||typeof _0x2ef0be===_0x13d6d2(0x21c)&&/^-?\d+$/['test'](_0x2ef0be);return _0x1f880b?padStart(_0x44b0d2,_0x4ad564):padEnd(_0x44b0d2,_0x4ad564);});_0x6c1c9d[_0x95e5be(0x1f6)](colorBorder('│',_0x52e762)+'\x20'+_0x4031d8[_0x95e5be(0x204)]('\x20'+colorBorder('│',_0x52e762)+'\x20')+'\x20'+colorBorder('│',_0x52e762));});const _0x301e37=_0x11d0c7[_0x35d27e(0x218)]((_0x18a15d,_0x504f45)=>_0x18a15d+_0x504f45+0x3,-0x1);_0x6c1c9d['push'](colorBorder('├'+_0x11d0c7[_0x35d27e(0x1f7)](_0x56741d=>'─'[_0x35d27e(0x200)](_0x56741d+0x2))[_0x35d27e(0x204)]('┴')+'┤',_0x52e762));let _0x304bdb;_0x4dae8f?_0x304bdb=_0x7a38eb+'\x20rows\x20('+_0x47b7c6+_0x35d27e(0x1ec):_0x304bdb=_0x7a38eb+_0x35d27e(0x1f1)+(_0x7a38eb===0x1?'':'s');const _0x1c72d7=_0x304bdb['padEnd'](_0x301e37-0x2);return _0x6c1c9d[_0x35d27e(0x1f6)](colorBorder('│',_0x52e762)+'\x20'+_0x1c72d7+'\x20'+colorBorder('│',_0x52e762)),_0x6c1c9d['push'](colorBorder('└'+'─'[_0x35d27e(0x200)](_0x301e37)+'┘',_0x52e762)),_0x6c1c9d['join']('\x0a');}function simplifyType(_0xa48815){const _0x507007=a142_0x4554,_0x385c41={'varchar':'string','bigint':_0x507007(0x205),'integer':_0x507007(0x1f4),'double':_0x507007(0x206),'boolean':_0x507007(0x213),'date':_0x507007(0x1fd),'timestamp':'timestamp','array':_0x507007(0x1e6),'map':_0x507007(0x1f7),'row':'row'},_0xb66df7=_0xa48815[_0x507007(0x1e7)]();for(const [_0x22228e,_0x2d7f7a]of Object[_0x507007(0x1eb)](_0x385c41)){if(_0xb66df7[_0x507007(0x203)](_0x22228e))return _0x2d7f7a;}return _0xa48815['length']>0xa?_0xa48815[_0x507007(0x1f3)](0x0,0xa):_0xa48815;}export function formatAsJSON(_0x4c8bad,_0x40bc8b={}){const _0x2070e4=a142_0x4554;if(_0x4c8bad['data'][_0x2070e4(0x207)]===0x0)return'[]';if(shouldUseColor(_0x40bc8b))return colorizeJSON(_0x4c8bad[_0x2070e4(0x1fa)],_0x40bc8b);const _0x309bf1=_0x4c8bad[_0x2070e4(0x1fa)][_0x2070e4(0x1f7)](_0x463e60=>'\x20\x20'+JSON[_0x2070e4(0x1f9)](_0x463e60));return'[\x0a'+_0x309bf1[_0x2070e4(0x204)](',\x0a')+'\x0a]';}function a142_0x52ca(){const _0x6014df=['data','toISOString','min','date','\x1b]8;;\x07','3hcOMRG','repeat','126bpTFJc','log','startsWith','join','long','double','length','pow','6572AREbKx','isTTY','44OslqOb','185959PUjwRc','9155370dPmIdg','true','jsonl','tsv','1775CjmPaU','type','bool','2697594jAWKIB','toFixed','false','boolean','reduce','6736116CQCbXS','7uRLkhZ','toString','string','630574IYgLBn','floor','number','array','toLowerCase','forEach','slice','name','entries','\x20shown)','stdout','columns','No\x20rows\x20returned','147488JsYSHl','\x20row','0\x20B','substring','int','object','push','map','replace','stringify'];a142_0x52ca=function(){return _0x6014df;};return a142_0x52ca();}export function formatAsJSONL(_0x23eb56,_0x4c9b7c={}){const _0x31b602=a142_0x4554;if(_0x23eb56[_0x31b602(0x1fa)][_0x31b602(0x207)]===0x0)return'';if(shouldUseColor(_0x4c9b7c))return _0x23eb56[_0x31b602(0x1fa)][_0x31b602(0x1f7)](_0x35767f=>colorizeJSONCompact(_0x35767f,_0x4c9b7c))[_0x31b602(0x204)]('\x0a');return _0x23eb56[_0x31b602(0x1fa)][_0x31b602(0x1f7)](_0x31f2d8=>JSON[_0x31b602(0x1f9)](_0x31f2d8))[_0x31b602(0x204)]('\x0a');}export function formatAsTSV(_0x1fd894){const _0x3e0ddc=a142_0x4554;if(_0x1fd894[_0x3e0ddc(0x1fa)][_0x3e0ddc(0x207)]===0x0)return'';const _0x31698d=[],_0x33ca50=_0x1fd894['columns'][_0x3e0ddc(0x1f7)](_0x5c6021=>_0x5c6021[_0x3e0ddc(0x1ea)]);return _0x31698d[_0x3e0ddc(0x1f6)](_0x33ca50[_0x3e0ddc(0x204)]('\x09')),_0x1fd894[_0x3e0ddc(0x1fa)]['forEach'](_0x38298f=>{const _0x3faafd=_0x3e0ddc,_0x1a8c2a=_0x33ca50[_0x3faafd(0x1f7)](_0x1c69fc=>{const _0x4725a6=_0x38298f[_0x1c69fc];return formatValueForTSV(_0x4725a6);});_0x31698d['push'](_0x1a8c2a[_0x3faafd(0x204)]('\x09'));}),_0x31698d['join']('\x0a');}function formatValue(_0x2f576){const _0x23b972=a142_0x4554;if(_0x2f576===null||_0x2f576===undefined)return'';if(typeof _0x2f576==='string'){const _0xa8d79f=_0x2f576[_0x23b972(0x1f8)](/\n/g,'\x5cn')[_0x23b972(0x1f8)](/\r/g,'\x5cr')[_0x23b972(0x1f8)](/\t/g,'\x5ct');return _0xa8d79f;}if(typeof _0x2f576===_0x23b972(0x1e5))return String(_0x2f576);if(typeof _0x2f576===_0x23b972(0x217))return _0x2f576?_0x23b972(0x20e):_0x23b972(0x216);if(_0x2f576 instanceof Date)return _0x2f576['toISOString']();if(typeof _0x2f576===_0x23b972(0x1f5))return JSON['stringify'](_0x2f576);return String(_0x2f576);}function formatValueForTSV(_0x570f37){const _0x12c019=a142_0x4554;if(_0x570f37===null||_0x570f37===undefined)return'';if(typeof _0x570f37===_0x12c019(0x21c))return _0x570f37[_0x12c019(0x1f8)](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x570f37===_0x12c019(0x1e5)||typeof _0x570f37===_0x12c019(0x217))return String(_0x570f37);if(_0x570f37 instanceof Date)return _0x570f37[_0x12c019(0x1fb)]();if(typeof _0x570f37===_0x12c019(0x1f5))return JSON[_0x12c019(0x1f9)](_0x570f37);return String(_0x570f37);}export function formatQueryResult(_0x4785bc,_0x5cf1b4){const _0x144071=a142_0x4554;switch(_0x5cf1b4){case'table':return formatAsTable(_0x4785bc);case'json':return formatAsJSON(_0x4785bc);case _0x144071(0x20f):return formatAsJSONL(_0x4785bc);case _0x144071(0x210):return formatAsTSV(_0x4785bc);default:return formatAsJSON(_0x4785bc);}}export function formatBytes(_0x44bae4){const _0xd8c777=a142_0x4554;if(_0x44bae4===0x0)return _0xd8c777(0x1f2);const _0xed5a26=['B','KB','MB','GB','TB'],_0x2b839e=0x400,_0x388494=Math[_0xd8c777(0x21e)](Math[_0xd8c777(0x202)](_0x44bae4)/Math['log'](_0x2b839e)),_0x191afe=_0x44bae4/Math[_0xd8c777(0x208)](_0x2b839e,_0x388494),_0x1c2728=_0x191afe>=0xa?0x1:0x2;return _0x191afe[_0xd8c777(0x215)](_0x1c2728)+'\x20'+_0xed5a26[_0x388494];}export function formatRows(_0x6ae73f){const _0x3ef3fc=a142_0x4554;if(_0x6ae73f==null)return'-';if(_0x6ae73f===0x0)return'0';if(_0x6ae73f<0x3e8)return _0x6ae73f[_0x3ef3fc(0x21b)]();const _0x45cb02=['','K','M','B','T'],_0x1acc14=0x3e8,_0x1fb467=Math['floor'](Math[_0x3ef3fc(0x202)](_0x6ae73f)/Math[_0x3ef3fc(0x202)](_0x1acc14)),_0x562023=_0x6ae73f/Math[_0x3ef3fc(0x208)](_0x1acc14,_0x1fb467),_0x50e9bc=_0x562023>=0xa?0x1:0x2;return''+_0x562023[_0x3ef3fc(0x215)](_0x50e9bc)+_0x45cb02[_0x1fb467];}export function hyperlink(_0x440641,_0x2ff1a5){const _0x126a37=a142_0x4554;if(!process['stdout'][_0x126a37(0x20a)])return _0x440641;return'\x1b]8;;'+_0x2ff1a5+'\x07'+_0x440641+_0x126a37(0x1fe);}
|
|
1
|
+
(function(_0x613656,_0x10fd04){const _0x47598c=a142_0x547d,_0x21b9a4=_0x613656();while(!![]){try{const _0x2dff3e=-parseInt(_0x47598c(0x140))/0x1*(-parseInt(_0x47598c(0x12b))/0x2)+parseInt(_0x47598c(0x112))/0x3*(-parseInt(_0x47598c(0x145))/0x4)+parseInt(_0x47598c(0x147))/0x5+parseInt(_0x47598c(0x117))/0x6*(-parseInt(_0x47598c(0x11e))/0x7)+parseInt(_0x47598c(0x10f))/0x8*(-parseInt(_0x47598c(0x12f))/0x9)+parseInt(_0x47598c(0x125))/0xa*(parseInt(_0x47598c(0x111))/0xb)+parseInt(_0x47598c(0x146))/0xc*(-parseInt(_0x47598c(0x143))/0xd);if(_0x2dff3e===_0x10fd04)break;else _0x21b9a4['push'](_0x21b9a4['shift']());}catch(_0x4fb33f){_0x21b9a4['push'](_0x21b9a4['shift']());}}}(a142_0x42c3,0x6991d));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(){const _0x2bab17=a142_0x547d;return process[_0x2bab17(0x11a)][_0x2bab17(0x132)]||Infinity;}export function formatAsTable(_0x325c79,_0x22f5a5=DEFAULT_MAX_DISPLAY_ROWS,_0x301d89=![],_0x473e74={}){const _0x35fe06=a142_0x547d;if(_0x325c79['data']['length']===0x0)return'No\x20rows\x20returned';const _0x1884f8=_0x325c79[_0x35fe06(0x132)][_0x35fe06(0x118)](_0x18d5a6=>_0x18d5a6['name']),_0x1981fe=_0x325c79[_0x35fe06(0x132)][_0x35fe06(0x118)](_0x570b3e=>simplifyType(_0x570b3e['type'])),_0x526f88=_0x325c79[_0x35fe06(0x142)][_0x35fe06(0x119)](0x0,_0x22f5a5),_0x24e095=_0x325c79['data'][_0x35fe06(0x133)],_0x1d0b3c=_0x24e095>_0x22f5a5,_0x4a0298=[],_0x48447e=getTerminalWidth(),_0xcb0832=_0x48447e!==Infinity,_0x15b96c=0x32;let _0x154503=_0x1884f8[_0x35fe06(0x118)]((_0x2cf388,_0x44f861)=>{const _0x3095c0=_0x35fe06,_0x27073a=stringWidth(_0x1981fe[_0x44f861]),_0x2c52e9=Math[_0x3095c0(0x10e)](..._0x526f88[_0x3095c0(0x118)](_0x9e5da=>{const _0x110d51=_0x9e5da[_0x2cf388];return stringWidth(formatValue(_0x110d51));})),_0x29ead7=Math['max'](stringWidth(_0x2cf388),_0x27073a,_0x2c52e9);return _0x301d89?_0x29ead7:Math['min'](_0x29ead7,_0x15b96c);});if(_0xcb0832&&!_0x301d89&&_0x1884f8['length']>0x0){const _0xe3346b=_0x576354=>{let _0x58f1c7=0x1;for(const _0x3d4957 of _0x576354){_0x58f1c7+=_0x3d4957+0x3;}return _0x58f1c7+0x1;};let _0x571cf0=_0xe3346b(_0x154503);if(_0x571cf0>_0x48447e){const _0x3b2676=0x3;for(let _0x49a4e8=_0x154503['length']-0x1;_0x49a4e8>=0x0;_0x49a4e8--){_0x571cf0=_0xe3346b(_0x154503);if(_0x571cf0<=_0x48447e)break;const _0x59baaf=_0x154503[_0x49a4e8],_0x42109a=_0x571cf0-_0x48447e,_0xeae4e=_0x59baaf-_0x3b2676,_0x285048=Math['min'](_0x42109a,_0xeae4e);_0x285048>0x0&&(_0x154503[_0x49a4e8]=_0x59baaf-_0x285048);}}}const _0xc9c8cc=_0x1884f8,_0x1c3354=_0x1981fe,_0x1ae9de=_0x154503,_0x5f2f3b=_0x154503;_0x4a0298[_0x35fe06(0x13a)](colorBorder('┌'+_0x5f2f3b[_0x35fe06(0x118)](_0x2e1276=>'─'[_0x35fe06(0x13e)](_0x2e1276+0x2))[_0x35fe06(0x12c)]('┬')+'┐',_0x473e74));const _0xb339d2=_0xc9c8cc[_0x35fe06(0x118)]((_0xaf3eec,_0x3e9ee2)=>centerAlign(_0xaf3eec,_0x1ae9de[_0x3e9ee2]));_0x4a0298[_0x35fe06(0x13a)](colorBorder('│',_0x473e74)+'\x20'+_0xb339d2[_0x35fe06(0x12c)]('\x20'+colorBorder('│',_0x473e74)+'\x20')+'\x20'+colorBorder('│',_0x473e74));const _0x2f8873=_0x1c3354[_0x35fe06(0x118)]((_0x337111,_0x5a4f4b)=>colorType(centerAlign(_0x337111,_0x1ae9de[_0x5a4f4b]),_0x473e74));_0x4a0298['push'](colorBorder('│',_0x473e74)+'\x20'+_0x2f8873[_0x35fe06(0x12c)]('\x20'+colorBorder('│',_0x473e74)+'\x20')+'\x20'+colorBorder('│',_0x473e74)),_0x4a0298[_0x35fe06(0x13a)](colorBorder('├'+_0x5f2f3b['map'](_0x38274d=>'─'[_0x35fe06(0x13e)](_0x38274d+0x2))[_0x35fe06(0x12c)]('┼')+'┤',_0x473e74));const _0x291022=(_0x33e722,_0x1a054e)=>{const _0x55b88c=_0x35fe06,_0x4c3f49=stringWidth(_0x33e722);if(_0x4c3f49<=_0x1a054e)return _0x33e722;let _0x1bee14=_0x33e722;while(stringWidth(_0x1bee14+'…')>_0x1a054e&&_0x1bee14[_0x55b88c(0x133)]>0x0){_0x1bee14=_0x1bee14[_0x55b88c(0x119)](0x0,-0x1);}return _0x1bee14+'…';};_0x526f88[_0x35fe06(0x124)](_0x4e2fbf=>{const _0xa88038=_0x35fe06,_0x27a9df=_0x1884f8[_0xa88038(0x118)]((_0x434b1b,_0x5d5979)=>{const _0x249c5b=_0xa88038,_0x1b80d5=_0x4e2fbf[_0x434b1b],_0x48531d=formatValue(_0x1b80d5),_0x2db276=_0x1ae9de[_0x5d5979],_0x2db4b0=_0x291022(_0x48531d,_0x2db276),_0x27f384=typeof _0x1b80d5===_0x249c5b(0x129)||typeof _0x1b80d5===_0x249c5b(0x11f)&&/^-?\d+$/[_0x249c5b(0x130)](_0x1b80d5);return _0x27f384?padStart(_0x2db4b0,_0x2db276):padEnd(_0x2db4b0,_0x2db276);});_0x4a0298[_0xa88038(0x13a)](colorBorder('│',_0x473e74)+'\x20'+_0x27a9df[_0xa88038(0x12c)]('\x20'+colorBorder('│',_0x473e74)+'\x20')+'\x20'+colorBorder('│',_0x473e74));});const _0x37bfa4=_0x5f2f3b[_0x35fe06(0x10d)]((_0xbcf536,_0x221451)=>_0xbcf536+_0x221451+0x3,-0x1);_0x4a0298[_0x35fe06(0x13a)](colorBorder('├'+_0x5f2f3b['map'](_0x35669c=>'─'[_0x35fe06(0x13e)](_0x35669c+0x2))['join']('┴')+'┤',_0x473e74));let _0x43017f;_0x1d0b3c?_0x43017f=_0x24e095+'\x20rows\x20('+_0x22f5a5+_0x35fe06(0x134):_0x43017f=_0x24e095+_0x35fe06(0x13c)+(_0x24e095===0x1?'':'s');const _0x1bb771=_0x43017f[_0x35fe06(0x122)](_0x37bfa4-0x2);return _0x4a0298['push'](colorBorder('│',_0x473e74)+'\x20'+_0x1bb771+'\x20'+colorBorder('│',_0x473e74)),_0x4a0298[_0x35fe06(0x13a)](colorBorder('└'+'─'[_0x35fe06(0x13e)](_0x37bfa4)+'┘',_0x473e74)),_0x4a0298[_0x35fe06(0x12c)]('\x0a');}function a142_0x547d(_0x4200fa,_0x2593a){_0x4200fa=_0x4200fa-0x10d;const _0x42c38f=a142_0x42c3();let _0x547dba=_0x42c38f[_0x4200fa];return _0x547dba;}function simplifyType(_0x56af0a){const _0x3e68e2=a142_0x547d,_0x5b23e4={'varchar':'string','bigint':'long','integer':_0x3e68e2(0x137),'double':'double','boolean':_0x3e68e2(0x11c),'date':_0x3e68e2(0x141),'timestamp':_0x3e68e2(0x110),'array':'array','map':_0x3e68e2(0x118),'row':_0x3e68e2(0x11d)},_0x3e1850=_0x56af0a[_0x3e68e2(0x121)]();for(const [_0x2cf289,_0x48adfc]of Object[_0x3e68e2(0x12a)](_0x5b23e4)){if(_0x3e1850[_0x3e68e2(0x126)](_0x2cf289))return _0x48adfc;}return _0x56af0a[_0x3e68e2(0x133)]>0xa?_0x56af0a[_0x3e68e2(0x12e)](0x0,0xa):_0x56af0a;}export function formatAsJSON(_0x78d50f,_0x11c5fb={}){const _0x573051=a142_0x547d;if(_0x78d50f[_0x573051(0x142)][_0x573051(0x133)]===0x0)return'[]';if(shouldUseColor(_0x11c5fb))return colorizeJSON(_0x78d50f['data'],_0x11c5fb);const _0x3f0d06=_0x78d50f[_0x573051(0x142)][_0x573051(0x118)](_0x117afd=>'\x20\x20'+JSON[_0x573051(0x139)](_0x117afd));return'[\x0a'+_0x3f0d06[_0x573051(0x12c)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x4f1e2f,_0x1ed5f4={}){const _0x17bf95=a142_0x547d;if(_0x4f1e2f[_0x17bf95(0x142)][_0x17bf95(0x133)]===0x0)return'';if(shouldUseColor(_0x1ed5f4))return _0x4f1e2f['data']['map'](_0x5ddf5e=>colorizeJSONCompact(_0x5ddf5e,_0x1ed5f4))[_0x17bf95(0x12c)]('\x0a');return _0x4f1e2f['data']['map'](_0x20d696=>JSON[_0x17bf95(0x139)](_0x20d696))['join']('\x0a');}export function formatAsTSV(_0x1136b7){const _0x18e580=a142_0x547d;if(_0x1136b7[_0x18e580(0x142)]['length']===0x0)return'';const _0x371b99=[],_0x54c6f6=_0x1136b7[_0x18e580(0x132)]['map'](_0x142ac7=>_0x142ac7[_0x18e580(0x12d)]);return _0x371b99[_0x18e580(0x13a)](_0x54c6f6[_0x18e580(0x12c)]('\x09')),_0x1136b7[_0x18e580(0x142)][_0x18e580(0x124)](_0x3c1c8c=>{const _0x5cdb18=_0x18e580,_0x3d5c4e=_0x54c6f6[_0x5cdb18(0x118)](_0x584952=>{const _0x280d09=_0x3c1c8c[_0x584952];return formatValueForTSV(_0x280d09);});_0x371b99[_0x5cdb18(0x13a)](_0x3d5c4e[_0x5cdb18(0x12c)]('\x09'));}),_0x371b99[_0x18e580(0x12c)]('\x0a');}function formatValue(_0x2b2a4a){const _0x390a2c=a142_0x547d;if(_0x2b2a4a===null||_0x2b2a4a===undefined)return'';if(typeof _0x2b2a4a==='string'){const _0x477df6=_0x2b2a4a[_0x390a2c(0x113)](/\n/g,'\x5cn')[_0x390a2c(0x113)](/\r/g,'\x5cr')['replace'](/\t/g,'\x5ct');return _0x477df6;}if(typeof _0x2b2a4a===_0x390a2c(0x129))return String(_0x2b2a4a);if(typeof _0x2b2a4a===_0x390a2c(0x136))return _0x2b2a4a?_0x390a2c(0x114):_0x390a2c(0x13b);if(_0x2b2a4a instanceof Date)return _0x2b2a4a[_0x390a2c(0x116)]();if(typeof _0x2b2a4a===_0x390a2c(0x131))return JSON[_0x390a2c(0x139)](_0x2b2a4a);return String(_0x2b2a4a);}function formatValueForTSV(_0x41c60b){const _0x5a8b14=a142_0x547d;if(_0x41c60b===null||_0x41c60b===undefined)return'';if(typeof _0x41c60b===_0x5a8b14(0x11f))return _0x41c60b['replace'](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x41c60b===_0x5a8b14(0x129)||typeof _0x41c60b===_0x5a8b14(0x136))return String(_0x41c60b);if(_0x41c60b instanceof Date)return _0x41c60b[_0x5a8b14(0x116)]();if(typeof _0x41c60b==='object')return JSON[_0x5a8b14(0x139)](_0x41c60b);return String(_0x41c60b);}export function formatQueryResult(_0x56cfe9,_0x372a63){const _0x24f415=a142_0x547d;switch(_0x372a63){case _0x24f415(0x13f):return formatAsTable(_0x56cfe9);case _0x24f415(0x138):return formatAsJSON(_0x56cfe9);case _0x24f415(0x123):return formatAsJSONL(_0x56cfe9);case _0x24f415(0x11b):return formatAsTSV(_0x56cfe9);default:return formatAsJSON(_0x56cfe9);}}export function formatBytes(_0x378c61){const _0x455274=a142_0x547d;if(_0x378c61===0x0)return _0x455274(0x127);const _0x262cee=['B','KB','MB','GB','TB'],_0x187a05=0x400,_0xca440d=Math[_0x455274(0x135)](Math[_0x455274(0x128)](_0x378c61)/Math[_0x455274(0x128)](_0x187a05)),_0xfb77fc=_0x378c61/Math[_0x455274(0x120)](_0x187a05,_0xca440d),_0x37b53f=_0xfb77fc>=0xa?0x1:0x2;return _0xfb77fc[_0x455274(0x115)](_0x37b53f)+'\x20'+_0x262cee[_0xca440d];}export function formatRows(_0x24449a){const _0x5a8b8b=a142_0x547d;if(_0x24449a==null)return'-';if(_0x24449a===0x0)return'0';if(_0x24449a<0x3e8)return _0x24449a['toString']();const _0x1fa94d=['','K','M','B','T'],_0x145b24=0x3e8,_0x5aae4b=Math[_0x5a8b8b(0x135)](Math[_0x5a8b8b(0x128)](_0x24449a)/Math[_0x5a8b8b(0x128)](_0x145b24)),_0x111d0b=_0x24449a/Math[_0x5a8b8b(0x120)](_0x145b24,_0x5aae4b),_0x17e8c8=_0x111d0b>=0xa?0x1:0x2;return''+_0x111d0b[_0x5a8b8b(0x115)](_0x17e8c8)+_0x1fa94d[_0x5aae4b];}function a142_0x42c3(){const _0x1781bd=['tsv','bool','row','42fhrsPa','string','pow','toLowerCase','padEnd','jsonl','forEach','10ZGrtLK','startsWith','0\x20B','log','number','entries','305628xKcbVN','join','name','substring','1323HaQcFX','test','object','columns','length','\x20shown)','floor','boolean','int','json','stringify','push','false','\x20row','isTTY','repeat','table','4rwDIyt','date','data','119847yNgeyb','\x1b]8;;\x07','137884OTTXvv','12FueZZV','356330ZetPmb','reduce','max','26224qWiwbh','timestamp','5187226BXQOWF','12zpJRcQ','replace','true','toFixed','toISOString','92706NmjqDG','map','slice','stdout'];a142_0x42c3=function(){return _0x1781bd;};return a142_0x42c3();}export function hyperlink(_0x260be4,_0x538f98){const _0x4c5275=a142_0x547d;if(!process['stdout'][_0x4c5275(0x13d)])return _0x260be4;return'\x1b]8;;'+_0x538f98+'\x07'+_0x260be4+_0x4c5275(0x144);}
|
package/dist/sdk/util/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x18ad4a,_0x12cf33){var _0x4ad186=a143_0x1cfb,_0x479e36=_0x18ad4a();while(!![]){try{var _0x19eff2=parseInt(_0x4ad186(0x147))/0x1+parseInt(_0x4ad186(0x146))/0x2*(-parseInt(_0x4ad186(0x149))/0x3)+-parseInt(_0x4ad186(0x142))/0x4*(parseInt(_0x4ad186(0x14a))/0x5)+parseInt(_0x4ad186(0x145))/0x6+parseInt(_0x4ad186(0x14c))/0x7+-parseInt(_0x4ad186(0x144))/0x8*(-parseInt(_0x4ad186(0x148))/0x9)+-parseInt(_0x4ad186(0x143))/0xa*(parseInt(_0x4ad186(0x14b))/0xb);if(_0x19eff2===_0x12cf33)break;else _0x479e36['push'](_0x479e36['shift']());}catch(_0xab02f0){_0x479e36['push'](_0x479e36['shift']());}}}(a143_0x38a4,0x3f706));function a143_0x1cfb(_0x1024e3,_0x369c2e){_0x1024e3=_0x1024e3-0x142;var _0x38a461=a143_0x38a4();var _0x1cfb7f=_0x38a461[_0x1024e3];return _0x1cfb7f;}export*from'./formatters.js';export*from'./format-detector.js';export*from'./tree-formatter.js';function a143_0x38a4(){var _0x32ad1c=['398087nPfWDt','883854rKwWFe','7809nBGDLl','95480tAOPEi','4084289KRCUYO','1428784iJVOJy','4pVNnsd','20ueGazj','16pnlnYR','2727576wGcSOP','178hMSPXo'];a143_0x38a4=function(){return _0x32ad1c;};return a143_0x38a4();}
|