@treasuredata/tdx 0.25.1 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/schedule-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/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.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-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/schedule.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/archive-validation.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
|
-
(function(
|
|
1
|
+
(function(_0x5a4e20,_0x2c0490){const _0x10376b=a100_0x2505,_0x4a8773=_0x5a4e20();while(!![]){try{const _0x560e47=parseInt(_0x10376b(0x124))/0x1*(parseInt(_0x10376b(0x12f))/0x2)+-parseInt(_0x10376b(0x142))/0x3*(-parseInt(_0x10376b(0x130))/0x4)+-parseInt(_0x10376b(0x125))/0x5+parseInt(_0x10376b(0x12d))/0x6*(parseInt(_0x10376b(0x129))/0x7)+parseInt(_0x10376b(0x136))/0x8*(parseInt(_0x10376b(0x12e))/0x9)+parseInt(_0x10376b(0x137))/0xa+-parseInt(_0x10376b(0x121))/0xb*(parseInt(_0x10376b(0x138))/0xc);if(_0x560e47===_0x2c0490)break;else _0x4a8773['push'](_0x4a8773['shift']());}catch(_0x5f3211){_0x4a8773['push'](_0x4a8773['shift']());}}}(a100_0x4d51,0xb126a));import{readFileSync}from'fs';import{createInterface}from'readline';export function stripSqlComments(_0x367459){const _0x54f3ea=a100_0x2505;let _0x30ce6a=_0x367459[_0x54f3ea(0x127)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x30ce6a=_0x30ce6a[_0x54f3ea(0x127)](/--.*$/gm,''),_0x30ce6a[_0x54f3ea(0x13d)]();}function isEscaped(_0x5badf5,_0x48ad54){let _0x457aad=0x0;for(let _0x257d9f=_0x48ad54-0x1;_0x257d9f>=0x0&&_0x5badf5[_0x257d9f]==='\x5c';_0x257d9f--){_0x457aad++;}return _0x457aad%0x2===0x1;}export function splitSqlStatements(_0x583045){const _0x24163b=a100_0x2505,_0x169ba6=stripSqlComments(_0x583045);if(!_0x169ba6)throw new Error(_0x24163b(0x132));const _0x42a114=[];let _0x203d41='',_0x4e3338=![],_0x52eceb=![],_0x4be53a=![];for(let _0x4696a1=0x0;_0x4696a1<_0x583045[_0x24163b(0x12a)];_0x4696a1++){const _0x45ba9b=_0x583045[_0x4696a1];if(_0x45ba9b==='\x27'&&!isEscaped(_0x583045,_0x4696a1)&&!_0x52eceb&&!_0x4be53a)_0x4e3338=!_0x4e3338;else{if(_0x45ba9b==='\x22'&&!isEscaped(_0x583045,_0x4696a1)&&!_0x4e3338&&!_0x4be53a)_0x52eceb=!_0x52eceb;else _0x45ba9b==='`'&&!isEscaped(_0x583045,_0x4696a1)&&!_0x4e3338&&!_0x52eceb&&(_0x4be53a=!_0x4be53a);}if(_0x45ba9b===';'&&!_0x4e3338&&!_0x52eceb&&!_0x4be53a){const _0x15a925=_0x203d41[_0x24163b(0x13d)]();_0x15a925&&_0x42a114[_0x24163b(0x133)](_0x15a925),_0x203d41='';}else _0x203d41+=_0x45ba9b;}const _0x44a100=_0x203d41[_0x24163b(0x13d)]();_0x44a100&&_0x42a114[_0x24163b(0x133)](_0x44a100);const _0x483f51=_0x42a114['map'](_0x3a9b3b=>_0x3a9b3b[_0x24163b(0x13d)]())[_0x24163b(0x126)](_0x5a7892=>{const _0xa2ab75=stripSqlComments(_0x5a7892);return _0xa2ab75['length']>0x0;});if(_0x483f51[_0x24163b(0x12a)]===0x0)throw new Error('Content\x20contains\x20no\x20SQL\x20statements');return _0x483f51;}export function readFileContent(_0x53f574){const _0x574e41=a100_0x2505;try{return readFileSync(_0x53f574,_0x574e41(0x141));}catch(_0x567032){const _0x3f5973=_0x567032[_0x574e41(0x12b)];if(_0x3f5973===_0x574e41(0x13b))throw new Error(_0x574e41(0x131)+_0x53f574+_0x574e41(0x139));else{if(_0x3f5973==='EACCES')throw new Error(_0x574e41(0x13c)+_0x53f574+'\x27');else throw new Error('Error\x20reading\x20file\x20\x27'+_0x53f574+_0x574e41(0x12c)+_0x567032[_0x574e41(0x122)]);}}}export function readSqlStatementsFromFile(_0x3942c1){const _0x527024=a100_0x2505,_0x50d210=readFileContent(_0x3942c1);try{return splitSqlStatements(_0x50d210);}catch(_0x2a0145){throw new Error(_0x527024(0x131)+_0x3942c1+'\x27\x20'+_0x2a0145[_0x527024(0x122)][_0x527024(0x123)]());}}function a100_0x4d51(){const _0x5dd2dd=['length','code','\x27:\x20','100602ZQEUBM','8939358YhgwhO','866958YyYjqX','4njFTub','File\x20\x27','Content\x20contains\x20no\x20SQL\x20statements','push','error','Error\x20reading\x20from\x20stdin:\x20','8djazFH','5202840zNIcWj','17855688kjQbuZ','\x27\x20not\x20found','test','ENOENT','Permission\x20denied\x20reading\x20file\x20\x27','trim','stdin\x20','line','close','utf-8','3150033rAFgii','11dxtwii','message','toLowerCase','1vLGzkM','5342455HheyuA','filter','replace','stdin','119oFLtSk'];a100_0x4d51=function(){return _0x5dd2dd;};return a100_0x4d51();}export async function readStdinContent(){const _0x219c5b=a100_0x2505;if(process[_0x219c5b(0x128)]['isTTY'])throw new Error('No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-');return new Promise((_0x4d615e,_0x277bad)=>{const _0x1fab30=_0x219c5b,_0x213ece=[],_0x21a508=createInterface({'input':process[_0x1fab30(0x128)],'terminal':![]});_0x21a508['on'](_0x1fab30(0x13f),_0x17abd8=>{const _0x22f7f6=_0x1fab30;_0x213ece[_0x22f7f6(0x133)](_0x17abd8);}),_0x21a508['on']('close',()=>{_0x4d615e(_0x213ece['join']('\x0a'));}),_0x21a508['on'](_0x1fab30(0x134),_0x3b0f17=>{const _0xe2737c=_0x1fab30;_0x21a508[_0xe2737c(0x140)](),_0x277bad(new Error(_0xe2737c(0x135)+_0x3b0f17[_0xe2737c(0x122)]));});});}function a100_0x2505(_0x56e402,_0x29a960){_0x56e402=_0x56e402-0x121;const _0x4d51f6=a100_0x4d51();let _0x25050c=_0x4d51f6[_0x56e402];return _0x25050c;}export async function readSqlStatementsFromStdin(){const _0xbcc0d2=a100_0x2505,_0xeccb5b=await readStdinContent();try{return splitSqlStatements(_0xeccb5b);}catch(_0x276c25){throw new Error(_0xbcc0d2(0x13e)+_0x276c25[_0xbcc0d2(0x122)][_0xbcc0d2(0x123)]());}}export function isSqlFilePath(_0x3c34b1){const _0x3467a1=a100_0x2505;return/\w\.sql$/[_0x3467a1(0x13a)](_0x3c34b1);}
|
package/dist/sdk/schedule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a101_0x39f250=a101_0x500e;(function(_0x265c2c,_0x10dd63){const _0x35d025=a101_0x500e,_0x43c978=_0x265c2c();while(!![]){try{const _0x47c5f2=-parseInt(_0x35d025(0x89))/0x1+-parseInt(_0x35d025(0x94))/0x2+parseInt(_0x35d025(0x96))/0x3+parseInt(_0x35d025(0xaa))/0x4+-parseInt(_0x35d025(0x95))/0x5+parseInt(_0x35d025(0x84))/0x6+parseInt(_0x35d025(0x99))/0x7;if(_0x47c5f2===_0x10dd63)break;else _0x43c978['push'](_0x43c978['shift']());}catch(_0x21e906){_0x43c978['push'](_0x43c978['shift']());}}}(a101_0x1440,0xadeba));function a101_0x500e(_0xa8d8ae,_0x3f2726){_0xa8d8ae=_0xa8d8ae-0x84;const _0x144083=a101_0x1440();let _0x500e9e=_0x144083[_0xa8d8ae];return _0x500e9e;}import{TDApiClient}from'./client/td-api-client.js';import{SDKError,ErrorCode}from'./errors.js';function a101_0x1440(){const _0x27af09=['map','scheduled','type','database','run','getScheduleHistory','2360142WqQCLc','594105KmrurW','2328657RQELhk','test','Invalid\x20time\x20format:\x20','3449117MBTRaz','push','filter','createSchedule','\x5c$&','INVALID_ARGUMENT','string','create','getTime','replace','limit','pagination','time','updateSchedule','num','name','runSchedule','3121364TKLBpZ','desc','client','history','listQueries','queries','Schedule\x20not\x20found:\x20','end_at','updated_at','query','now','update','Type\x20is\x20required','floor','length','pattern','delete','643296lzSpKa','created_at','num\x20must\x20be\x20between\x201\x20and\x2010','cron','Query\x20is\x20required','145237AqaPwy','NOT_FOUND','slice','Schedule\x20name\x20is\x20required','listSchedules'];a101_0x1440=function(){return _0x27af09;};return a101_0x1440();}function normalizeTimestamp(_0x2b0605){const _0x55a12a=a101_0x500e;if(!_0x2b0605)return undefined;if(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/['test'](_0x2b0605))return _0x2b0605;return _0x2b0605[_0x55a12a(0xa2)]('\x20UTC','Z')[_0x55a12a(0xa2)]('\x20','T');}export class ScheduleSDK{[a101_0x39f250(0xac)];constructor(_0x2a8ebc){const _0xc76828=a101_0x39f250;this[_0xc76828(0xac)]=new TDApiClient(_0x2a8ebc);}async['list'](_0x449d78){const _0x5ab88b=a101_0x39f250,_0x24e7ae=await this[_0x5ab88b(0xac)]['listSchedules'](),_0x20a36d=_0x24e7ae[_0x5ab88b(0x8e)](_0xb0716=>({..._0xb0716,'created_at':normalizeTimestamp(_0xb0716[_0x5ab88b(0x85)])??_0xb0716[_0x5ab88b(0x85)]}));if(_0x449d78?.[_0x5ab88b(0xa3)]&&_0x449d78[_0x5ab88b(0xa3)]>0x0)return _0x20a36d[_0x5ab88b(0x8b)](0x0,_0x449d78[_0x5ab88b(0xa3)]);return _0x20a36d;}async[a101_0x39f250(0xae)](_0x3a9580){const _0x36a5b8=a101_0x39f250,_0x3fb5f8=0x64,_0x59bc9c=_0x3a9580?.[_0x36a5b8(0xa3)],_0x1e6b05=[];let _0x246cec=!![],_0x327d8f,_0x4e96f2,_0x1bf4a7;if(_0x3a9580?.['pattern']){const _0x1bd4a0=_0x3a9580[_0x36a5b8(0xb9)]['replace'](/[.+^${}()|[\]\\]/g,_0x36a5b8(0x9d)),_0x50732c=_0x1bd4a0[_0x36a5b8(0xa2)](/\*/g,'.*')['replace'](/\?/g,'.');_0x1bf4a7=new RegExp('^'+_0x50732c+'$','i');}while(_0x246cec&&(!_0x59bc9c||_0x1e6b05[_0x36a5b8(0xb8)]<_0x59bc9c)){const _0x17cf3f=await this[_0x36a5b8(0xac)][_0x36a5b8(0xae)]({'anchor_column':_0x36a5b8(0xb2),'sort_direction':_0x36a5b8(0xab),'page_size':_0x3fb5f8,'anchor_id':_0x327d8f,'anchor_value':_0x4e96f2});let _0x36b0fb=_0x17cf3f[_0x36a5b8(0xaf)];_0x3a9580?.[_0x36a5b8(0x8f)]&&(_0x36b0fb=_0x36b0fb[_0x36a5b8(0x9b)](_0x430c77=>_0x430c77[_0x36a5b8(0x87)]!==null));_0x1bf4a7&&(_0x36b0fb=_0x36b0fb[_0x36a5b8(0x9b)](_0x366e64=>_0x366e64[_0x36a5b8(0xa8)]&&_0x1bf4a7[_0x36a5b8(0x97)](_0x366e64[_0x36a5b8(0xa8)])));_0x1e6b05[_0x36a5b8(0x9a)](..._0x36b0fb),_0x246cec=_0x17cf3f[_0x36a5b8(0xa4)]['has_next_page'];if(_0x246cec&&_0x17cf3f['queries'][_0x36a5b8(0xb8)]>0x0){const _0x126b4a=_0x17cf3f[_0x36a5b8(0xaf)][_0x17cf3f[_0x36a5b8(0xaf)][_0x36a5b8(0xb8)]-0x1];_0x327d8f=_0x126b4a['id'],_0x4e96f2=_0x126b4a[_0x36a5b8(0xb2)];}}const _0xba4f7c=_0x59bc9c?_0x1e6b05[_0x36a5b8(0x8b)](0x0,_0x59bc9c):_0x1e6b05;return{'queries':_0xba4f7c,'pagination':{'has_next_page':_0x246cec||(_0x59bc9c?_0x1e6b05['length']>_0x59bc9c:![])}};}async['show'](_0x23ef50){const _0x429a2c=a101_0x39f250,_0x46c6f6=await this[_0x429a2c(0xac)][_0x429a2c(0x8d)](),_0x3748e6=_0x46c6f6['find'](_0x51551e=>_0x51551e[_0x429a2c(0xa8)]===_0x23ef50);if(!_0x3748e6)throw new SDKError(ErrorCode[_0x429a2c(0x8a)],_0x429a2c(0xb0)+_0x23ef50);return{..._0x3748e6,'created_at':normalizeTimestamp(_0x3748e6[_0x429a2c(0x85)])??_0x3748e6[_0x429a2c(0x85)]};}async[a101_0x39f250(0xa0)](_0x3eb49c,_0x27c2ce){const _0x1c6291=a101_0x39f250;if(!_0x3eb49c)throw new SDKError(ErrorCode[_0x1c6291(0x9e)],'Schedule\x20name\x20is\x20required');if(!_0x27c2ce[_0x1c6291(0x91)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Database\x20is\x20required');if(!_0x27c2ce[_0x1c6291(0xb3)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1c6291(0x88));if(!_0x27c2ce[_0x1c6291(0x90)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1c6291(0xb6));return await this[_0x1c6291(0xac)][_0x1c6291(0x9c)](_0x3eb49c,_0x27c2ce);}async[a101_0x39f250(0xb5)](_0x4eed28,_0xaa6f9){const _0x191c4c=a101_0x39f250;if(!_0x4eed28)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Schedule\x20name\x20is\x20required');return await this['client'][_0x191c4c(0xa6)](_0x4eed28,_0xaa6f9);}async[a101_0x39f250(0xba)](_0x24edbd){const _0x44f271=a101_0x39f250;if(!_0x24edbd)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x44f271(0x8c));return await this['client']['deleteSchedule'](_0x24edbd);}async[a101_0x39f250(0x92)](_0x408f5e,_0x3653ce){const _0x19213f=a101_0x39f250;if(!_0x408f5e)throw new SDKError(ErrorCode[_0x19213f(0x9e)],'Schedule\x20name\x20is\x20required');let _0x182f4c;if(_0x3653ce?.['time']){const _0x24b03d=typeof _0x3653ce[_0x19213f(0xa5)]===_0x19213f(0x9f)?new Date(_0x3653ce['time']):_0x3653ce[_0x19213f(0xa5)];if(isNaN(_0x24b03d[_0x19213f(0xa1)]()))throw new SDKError(ErrorCode[_0x19213f(0x9e)],_0x19213f(0x98)+_0x3653ce['time']);_0x182f4c=Math[_0x19213f(0xb7)](_0x24b03d[_0x19213f(0xa1)]()/0x3e8);}else _0x182f4c=Math[_0x19213f(0xb7)](Date[_0x19213f(0xb4)]()/0x3e8);if(_0x3653ce?.['num']!==undefined){if(_0x3653ce[_0x19213f(0xa7)]<0x1||_0x3653ce['num']>0xa)throw new SDKError(ErrorCode[_0x19213f(0x9e)],_0x19213f(0x86));}return await this[_0x19213f(0xac)][_0x19213f(0xa9)](_0x408f5e,_0x182f4c,_0x3653ce?.[_0x19213f(0xa7)]);}async[a101_0x39f250(0xad)](_0x3624ab,_0x494034){const _0x5e05eb=a101_0x39f250;if(!_0x3624ab)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5e05eb(0x8c));const _0x4057f2=await this[_0x5e05eb(0xac)][_0x5e05eb(0x93)](_0x3624ab,_0x494034);return{..._0x4057f2,'history':_0x4057f2['history'][_0x5e05eb(0x8e)](_0x587409=>({..._0x587409,'created_at':normalizeTimestamp(_0x587409[_0x5e05eb(0x85)]),'start_at':normalizeTimestamp(_0x587409['start_at']),'end_at':normalizeTimestamp(_0x587409[_0x5e05eb(0xb1)])}))};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a102_0x45a502=a102_0x30ca;(function(_0x3fcc42,_0x2029c6){const _0x29a2a5=a102_0x30ca,_0x5cc70d=_0x3fcc42();while(!![]){try{const _0x5c3d27=parseInt(_0x29a2a5(0x1e1))/0x1+parseInt(_0x29a2a5(0x1ff))/0x2*(-parseInt(_0x29a2a5(0x1a3))/0x3)+-parseInt(_0x29a2a5(0x216))/0x4*(-parseInt(_0x29a2a5(0x198))/0x5)+parseInt(_0x29a2a5(0x1de))/0x6+-parseInt(_0x29a2a5(0x210))/0x7+-parseInt(_0x29a2a5(0x203))/0x8+parseInt(_0x29a2a5(0x1b7))/0x9;if(_0x5c3d27===_0x2029c6)break;else _0x5cc70d['push'](_0x5cc70d['shift']());}catch(_0x52b3fc){_0x5cc70d['push'](_0x5cc70d['shift']());}}}(a102_0x726e,0x40569));import*as a102_0x1b0752 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x435f79,_0x2183ef){const _0x57d918=a102_0x30ca,_0x36a114=_0x435f79[_0x57d918(0x215)]&&_0x57d918(0x1fc)in _0x435f79[_0x57d918(0x215)]&&_0x435f79[_0x57d918(0x215)]['type'];return{'type':_0x57d918(0x1aa),'name':_0x435f79[_0x57d918(0x1e7)],..._0x435f79[_0x57d918(0x19a)]&&{'description':_0x435f79['description']},..._0x2183ef&&{'folder':_0x2183ef},..._0x36a114&&{'rule':apiRuleToYaml(_0x435f79[_0x57d918(0x215)])},..._0x435f79[_0x57d918(0x1b2)]!==undefined&&{'kind':_0x435f79[_0x57d918(0x1b2)]===0x0?'batch':_0x435f79[_0x57d918(0x1b2)]===0x1?_0x57d918(0x1cd):'funnel_stage'},..._0x435f79[_0x57d918(0x1ec)]!==undefined&&{'visible':_0x435f79['isVisible']}};}export async function segmentResponseToDef(_0x56eb72,_0x3fdde9,_0x52ba4e){const _0x5f570a=a102_0x30ca,_0x12c4e6=segmentResponseToDefSync(_0x56eb72,_0x52ba4e);if(!_0x3fdde9||!_0x3fdde9[_0x5f570a(0x1a6)])return _0x12c4e6;return _0x12c4e6[_0x5f570a(0x215)]&&(_0x12c4e6[_0x5f570a(0x215)]=await resolveRuleSegmentRefs(_0x12c4e6[_0x5f570a(0x215)],_0x3fdde9[_0x5f570a(0x1a6)])),_0x12c4e6;}export function apiRuleToYaml(_0x2c39e6){const _0x2267d2=a102_0x30ca,_0x3d7310=(_0x2c39e6[_0x2267d2(0x1db)]||[])[_0x2267d2(0x204)](apiConditionToYaml);if(_0x3d7310[_0x2267d2(0x21a)]===0x1&&!_0x2c39e6['description']&&_0x2267d2(0x1fc)in _0x3d7310[0x0]&&(_0x3d7310[0x0][_0x2267d2(0x1fc)]===_0x2267d2(0x1ed)||_0x3d7310[0x0]['type']==='Or')){const _0x2016da=_0x3d7310[0x0];if(_0x2016da['type']===_0x2c39e6[_0x2267d2(0x1fc)]&&_0x2016da[_0x2267d2(0x1db)])return{'type':_0x2c39e6[_0x2267d2(0x1fc)],'conditions':_0x2016da['conditions'],..._0x2016da[_0x2267d2(0x19a)]&&{'description':_0x2016da[_0x2267d2(0x19a)]}};}return{'type':_0x2c39e6[_0x2267d2(0x1fc)],'conditions':_0x3d7310,..._0x2c39e6['description']&&{'description':_0x2c39e6[_0x2267d2(0x19a)]}};}export async function resolveRuleSegmentRefs(_0x395761,_0x16af11){const _0x39d06d=a102_0x30ca,_0x131b27=await Promise['all'](_0x395761[_0x39d06d(0x1db)][_0x39d06d(0x204)](_0x3804cf=>resolveConditionSegmentRefs(_0x3804cf,_0x16af11)));return{..._0x395761,'conditions':_0x131b27};}async function resolveConditionSegmentRefs(_0x4ee0d9,_0x4f4163){const _0x1a6649=a102_0x30ca;if(_0x1a6649(0x1aa)in _0x4ee0d9&&(_0x4ee0d9['type']==='include'||_0x4ee0d9['type']==='exclude')){const _0x3cc622=_0x4ee0d9;if(/^\d+$/[_0x1a6649(0x1dd)](_0x3cc622[_0x1a6649(0x1aa)])){const _0x4eeecb=await _0x4f4163(_0x3cc622[_0x1a6649(0x1aa)]);return{..._0x3cc622,'segment':_0x4eeecb};}return _0x4ee0d9;}if('conditions'in _0x4ee0d9&&_0x4ee0d9[_0x1a6649(0x1db)]){const _0x3115d0=_0x4ee0d9,_0x38513a=await Promise['all'](_0x3115d0['conditions']['map'](_0x1b32eb=>resolveConditionSegmentRefs(_0x1b32eb,_0x4f4163)));return{..._0x3115d0,'conditions':_0x38513a};}if(_0x1a6649(0x1fd)in _0x4ee0d9&&_0x4ee0d9[_0x1a6649(0x1fd)]){const _0x200049=_0x4ee0d9,_0x25b069=await resolveRuleSegmentRefs(_0x200049['filter'],_0x4f4163);return{..._0x200049,'filter':_0x25b069};}return _0x4ee0d9;}export async function resolveRuleSegmentIds(_0x2df80c,_0x460147){const _0x3a5a1c=a102_0x30ca,_0x2b3250=await Promise['all'](_0x2df80c[_0x3a5a1c(0x1db)][_0x3a5a1c(0x204)](_0x36060d=>resolveConditionSegmentIds(_0x36060d,_0x460147)));return{..._0x2df80c,'conditions':_0x2b3250};}async function resolveConditionSegmentIds(_0x620d97,_0x21635d){const _0x3879b5=a102_0x30ca;if('segment'in _0x620d97&&(_0x620d97['type']===_0x3879b5(0x19b)||_0x620d97[_0x3879b5(0x1fc)]===_0x3879b5(0x18f))){const _0x1e47ae=_0x620d97;if(!/^\d+$/[_0x3879b5(0x1dd)](_0x1e47ae[_0x3879b5(0x1aa)])){const _0x41753c=await _0x21635d(_0x1e47ae[_0x3879b5(0x1aa)]);return{..._0x1e47ae,'segment':_0x41753c};}return _0x620d97;}if(_0x3879b5(0x1db)in _0x620d97&&_0x620d97[_0x3879b5(0x1db)]){const _0x4292cf=_0x620d97,_0xaa3394=await Promise['all'](_0x4292cf[_0x3879b5(0x1db)][_0x3879b5(0x204)](_0x315ee0=>resolveConditionSegmentIds(_0x315ee0,_0x21635d)));return{..._0x4292cf,'conditions':_0xaa3394};}if(_0x3879b5(0x1fd)in _0x620d97&&_0x620d97['filter']){const _0x360c64=_0x620d97,_0x459a4f=await resolveRuleSegmentIds(_0x360c64[_0x3879b5(0x1fd)],_0x21635d);return{..._0x360c64,'filter':_0x459a4f};}return _0x620d97;}function apiConditionToYaml(_0x106716){const _0x4d5cfe=a102_0x30ca;if(_0x106716[_0x4d5cfe(0x1fc)]===_0x4d5cfe(0x1ed)||_0x106716[_0x4d5cfe(0x1fc)]==='Or'){if(_0x106716[_0x4d5cfe(0x1db)]){const _0x45e73d=_0x106716[_0x4d5cfe(0x1db)][_0x4d5cfe(0x204)](apiConditionToYaml);if(_0x45e73d[_0x4d5cfe(0x21a)]===0x1&&!_0x106716[_0x4d5cfe(0x19a)])return _0x45e73d[0x0];return{'type':_0x106716[_0x4d5cfe(0x1fc)],'conditions':_0x45e73d,..._0x106716['description']&&{'description':_0x106716['description']}};}}if(_0x106716['type']===_0x4d5cfe(0x1b4)&&_0x106716[_0x4d5cfe(0x1af)]&&_0x106716[_0x4d5cfe(0x18e)]){const _0x10cb55=_0x106716['leftValue']['aggregation']?{'type':_0x106716[_0x4d5cfe(0x1af)]['aggregation'][_0x4d5cfe(0x1fc)],..._0x106716[_0x4d5cfe(0x1af)][_0x4d5cfe(0x1a0)][_0x4d5cfe(0x1df)]&&{'groupingColumns':_0x106716['leftValue'][_0x4d5cfe(0x1a0)][_0x4d5cfe(0x1df)]}}:undefined;return{'type':_0x4d5cfe(0x1b4),'attribute':_0x106716[_0x4d5cfe(0x1af)]['name']||'','operator':apiOperatorToYaml(_0x106716[_0x4d5cfe(0x18e)]),..._0x106716['arrayMatching']&&_0x106716[_0x4d5cfe(0x1da)]!==_0x4d5cfe(0x1b3)?{'arrayMatching':_0x106716[_0x4d5cfe(0x1da)]}:{},..._0x106716[_0x4d5cfe(0x18f)]?{'exclude':_0x106716['exclude']}:{},..._0x10cb55?{'aggregation':_0x10cb55}:{},..._0x106716[_0x4d5cfe(0x1af)][_0x4d5cfe(0x1d6)]?{'source':_0x106716[_0x4d5cfe(0x1af)][_0x4d5cfe(0x1d6)][_0x4d5cfe(0x1e7)]}:{},..._0x106716[_0x4d5cfe(0x1af)]['filter']?{'filter':apiRuleToYaml(_0x106716[_0x4d5cfe(0x1af)][_0x4d5cfe(0x1fd)])}:{},..._0x106716[_0x4d5cfe(0x1bc)]!==undefined&&_0x106716[_0x4d5cfe(0x1bc)]!==null?{'limit':_0x106716[_0x4d5cfe(0x1bc)]}:{}};}if(_0x106716[_0x4d5cfe(0x1fc)]===_0x4d5cfe(0x1c8)&&_0x106716['id'])return{'type':_0x106716[_0x4d5cfe(0x18f)]?_0x4d5cfe(0x18f):'include','segment':_0x106716['id']};return{'type':_0x4d5cfe(0x1ed),'conditions':[]};}function isTemporalOperator(_0x48a8b0){const _0x2bc064=a102_0x30ca;return _0x48a8b0===_0x2bc064(0x1ac)||_0x48a8b0===_0x2bc064(0x192);}function getEffectiveValue(_0x3e6bdf){const _0x32b198=a102_0x30ca,_0x2150f2=_0x3e6bdf[_0x32b198(0x1e0)];return _0x3e6bdf[_0x32b198(0x1d3)]??_0x2150f2;}function apiOperatorToYaml(_0x5622ed){const _0x16396d=a102_0x30ca;let _0x312d5a;if(_0x5622ed[_0x16396d(0x1ba)]&&_0x5622ed[_0x16396d(0x1ba)][_0x16396d(0x21a)]>0x0)_0x312d5a=_0x5622ed[_0x16396d(0x1ba)];else{if(_0x5622ed[_0x16396d(0x1ea)]!==undefined)_0x312d5a=_0x5622ed[_0x16396d(0x1ea)];else isTemporalOperator(_0x5622ed['type'])&&_0x5622ed[_0x16396d(0x1d3)]!==undefined&&(_0x312d5a=_0x5622ed[_0x16396d(0x1d3)]);}return{'type':mapApiOperatorType(_0x5622ed[_0x16396d(0x1fc)]),..._0x5622ed[_0x16396d(0x1f0)]&&{'not':_0x5622ed[_0x16396d(0x1f0)]},..._0x312d5a!==undefined&&{'value':_0x312d5a},..._0x5622ed[_0x16396d(0x1e2)]&&{'unit':_0x5622ed['unit']}};}function mapApiOperatorType(_0x5fc406){return _0x5fc406;}export function segmentDefToCreateRequest(_0x17a573,_0x698c3e){const _0xaea56a=a102_0x30ca,_0x4c3d42={'name':_0x17a573[_0xaea56a(0x1e7)]};return _0x17a573['description']&&(_0x4c3d42[_0xaea56a(0x19a)]=_0x17a573[_0xaea56a(0x19a)]),_0x17a573[_0xaea56a(0x215)]&&(_0x4c3d42[_0xaea56a(0x215)]=yamlRuleToApi(_0x17a573[_0xaea56a(0x215)])),_0x17a573[_0xaea56a(0x1b2)]&&(_0x4c3d42[_0xaea56a(0x1b2)]=_0x17a573['kind']===_0xaea56a(0x213)?0x0:_0x17a573[_0xaea56a(0x1b2)]===_0xaea56a(0x1cd)?0x1:0x2),_0x17a573[_0xaea56a(0x1e3)]!==undefined&&(_0x4c3d42[_0xaea56a(0x1ec)]=_0x17a573['visible']),_0x698c3e&&(_0x4c3d42[_0xaea56a(0x1ca)]=_0x698c3e),_0x4c3d42;}export function segmentDefToUpdateRequest(_0x488f73){const _0x3d2b0a=a102_0x30ca,_0x31288c={'name':_0x488f73['name']};return _0x488f73['description']!==undefined&&(_0x31288c[_0x3d2b0a(0x19a)]=_0x488f73['description']),_0x488f73[_0x3d2b0a(0x215)]&&(_0x31288c[_0x3d2b0a(0x215)]=yamlRuleToApi(_0x488f73['rule'])),_0x488f73[_0x3d2b0a(0x1b2)]&&(_0x31288c[_0x3d2b0a(0x1b2)]=_0x488f73['kind']===_0x3d2b0a(0x213)?0x0:_0x488f73[_0x3d2b0a(0x1b2)]===_0x3d2b0a(0x1cd)?0x1:0x2),_0x31288c;}function a102_0x726e(){const _0x4469a4=['warnings','rule:','2351846WlefsT','JOURNEY_SYNTAX_ERROR','code','batch','columns','rule','973780LPzRmI','formatting','YAML\x20config\x20missing\x20required\x20field:\x20name','syndicationBehavior','length','min','operator','exclude','repeat_frequency','joinStrategy','TimeWithinNext','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','behaviorTableName','behavior_table','sort','duration','5YePGkd','\x0a\x0aAvailable\x20fields:\x0a','description','include','activations','visibility','emailRecipients','CONNECTION_NOT_FOUND','aggregation','emailToIdMap','startAt','45261xYSRkX','has','repeat_sub_frequency','resolveSegmentName','localRuleToName','attribute','New\x20Segment','segment','connectionNameToTypeMap','TimeWithinPast','connectionId','orderBy','leftValue','__SEGMENT_REF__','usedNames','kind','any','Value','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','Segment\x20description','4400028WBossz','keys','join_strategy','rightValues','object','limit','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','Unknown\x20connection:\x20','string','stringify','null','start_at','connection','from','timezone','connector_config','localeCompare','Reference','schedule','segmentFolderId','connectorConfig','get','realtime','set','valid','repeatFrequency','activations:','repeatUnit','value','join_row','\x22:\x0a','source','isArray','notification','all_columns','arrayMatching','conditions','activation_template_id','test','1785456SkYTEr','groupingColumns','values','23052PvQfvD','unit','visible','joinRow','order_by','push','name','folder','Invalid\x20connector_config\x20for\x20activation\x20\x22','rightValue','repeatSubFrequency','isVisible','And','allColumns','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','not','ruleHashToName','end_on','toLowerCase','notify_on','endOn','max','parse','Unknown\x20email\x20recipient:\x20','replace','CONNECTOR_INVALID_CONFIG','repeat_unit','type','filter','getSchema','40sWQwjp','notifyOn','INVALID_ARGUMENT','attributes','1213744epNWdH','map','entries','add','behavior','email_recipients','Equal','activationParams','scheduleType','activationTemplateId','Please\x20specify\x20a\x20valid\x20attribute\x20name.'];a102_0x726e=function(){return _0x4469a4;};return a102_0x726e();}export function yamlRuleToApi(_0x2671b3,_0x34896d=![]){const _0x10be8d=a102_0x30ca,_0x2578b=_0x2671b3['conditions'][_0x10be8d(0x204)](yamlConditionToApi);if(_0x34896d){const _0x3a54d3=_0x2578b['every'](_0x251353=>_0x251353[_0x10be8d(0x1fc)]==='And'||_0x251353['type']==='Or');if(!_0x3a54d3&&_0x2578b[_0x10be8d(0x21a)]>0x0)return{'type':_0x2671b3[_0x10be8d(0x1fc)],'conditions':[{'type':_0x10be8d(0x1ed),'description':_0x2671b3['description']||'','conditions':_0x2578b}]};}return{'type':_0x2671b3[_0x10be8d(0x1fc)],'conditions':_0x2578b,..._0x2671b3['description']&&{'description':_0x2671b3[_0x10be8d(0x19a)]}};}function yamlConditionToApi(_0x24603b){const _0x5e15dc=a102_0x30ca;if(_0x5e15dc(0x1aa)in _0x24603b&&(_0x24603b[_0x5e15dc(0x1fc)]===_0x5e15dc(0x19b)||_0x24603b[_0x5e15dc(0x1fc)]==='exclude')){const _0x39cf1d=_0x24603b;return{'type':_0x5e15dc(0x1c8),'id':_0x39cf1d[_0x5e15dc(0x1aa)],'exclude':_0x39cf1d[_0x5e15dc(0x1fc)]===_0x5e15dc(0x18f)};}if(_0x5e15dc(0x1fc)in _0x24603b&&(_0x24603b['type']==='And'||_0x24603b[_0x5e15dc(0x1fc)]==='Or')){const _0xee85f9=_0x24603b;return{'type':_0xee85f9['type'],'conditions':_0xee85f9[_0x5e15dc(0x1db)][_0x5e15dc(0x204)](yamlConditionToApi),..._0xee85f9[_0x5e15dc(0x19a)]&&{'description':_0xee85f9['description']}};}const _0x9bf8c4=_0x24603b,_0x50d38e={'type':_0x5e15dc(0x1b4),'leftValue':buildLeftValue(_0x9bf8c4),'operator':yamlOperatorToApi(_0x9bf8c4['operator']),'exclude':_0x9bf8c4[_0x5e15dc(0x18f)]??![],'arrayMatching':_0x9bf8c4[_0x5e15dc(0x1da)]??'any'};return _0x9bf8c4[_0x5e15dc(0x1bc)]!==undefined&&(_0x50d38e[_0x5e15dc(0x1bc)]=_0x9bf8c4[_0x5e15dc(0x1bc)]),_0x50d38e;}function buildLeftValue(_0x36f3a4){const _0x5ade64=a102_0x30ca,_0x29d8db={'name':_0x36f3a4['attribute']};return _0x36f3a4['aggregation']&&(_0x29d8db[_0x5ade64(0x1a0)]={'type':_0x36f3a4[_0x5ade64(0x1a0)][_0x5ade64(0x1fc)],..._0x36f3a4[_0x5ade64(0x1a0)][_0x5ade64(0x1df)]&&{'groupingColumns':_0x36f3a4[_0x5ade64(0x1a0)][_0x5ade64(0x1df)]}}),_0x36f3a4[_0x5ade64(0x1d6)]&&(_0x29d8db[_0x5ade64(0x1d6)]={'name':_0x36f3a4[_0x5ade64(0x1d6)]}),_0x36f3a4[_0x5ade64(0x1fd)]&&(_0x29d8db[_0x5ade64(0x1fd)]=yamlRuleToApi(_0x36f3a4[_0x5ade64(0x1fd)])),_0x29d8db;}function yamlOperatorToApi(_0x468af1){const _0x34bf07=a102_0x30ca,_0x45b906={'type':mapYamlOperatorType(_0x468af1[_0x34bf07(0x1fc)]),'not':_0x468af1['not']??![]},_0x599966=getEffectiveValue(_0x468af1);if(_0x599966!==undefined){if(Array[_0x34bf07(0x1d7)](_0x599966))_0x45b906['rightValues']=_0x599966;else isTemporalOperator(_0x468af1['type'])?_0x45b906[_0x34bf07(0x1d3)]=_0x599966:_0x45b906[_0x34bf07(0x1ea)]=_0x599966;}return _0x468af1[_0x34bf07(0x1e2)]&&(_0x45b906['unit']=_0x468af1[_0x34bf07(0x1e2)]),_0x45b906;}function mapYamlOperatorType(_0x42195d){return _0x42195d;}export function toYamlString(_0x255320){const _0xb325b4=a102_0x30ca,_0x2a7a87=JSON[_0xb325b4(0x1f7)](JSON[_0xb325b4(0x1c0)](_0x255320)),_0x41850a=a102_0x1b0752[_0xb325b4(0x1c0)](_0x2a7a87,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x59a346=['rule:'];let _0x439548=_0x41850a;for(const _0x2bcc77 of _0x59a346){_0x439548=_0x439548[_0xb325b4(0x1f9)](new RegExp('^('+_0x2bcc77+')','m'),(_0x2fcb35,_0x38724f,_0x27b74a)=>{if(_0x27b74a===0x0||_0x439548[_0x27b74a-0x1]==='\x0a'&&_0x439548[_0x27b74a-0x2]==='\x0a')return _0x38724f;return'\x0a'+_0x38724f;});}return _0x439548;}export function parseYamlString(_0x132175){const _0x24125f=a102_0x30ca,_0x49c330=a102_0x1b0752[_0x24125f(0x1f7)](_0x132175);if(!_0x49c330[_0x24125f(0x1e7)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(_0x49c330[_0x24125f(0x1fc)]&&_0x49c330[_0x24125f(0x1fc)]!==_0x24125f(0x1aa))throw new Error(_0x24125f(0x193)+_0x49c330['type']);return _0x49c330;}export function isSegmentYaml(_0x1c25a7){const _0x1f3826=a102_0x30ca;if(typeof _0x1c25a7!=='object'||_0x1c25a7===null)return![];const _0x4819ac=_0x1c25a7;return _0x4819ac[_0x1f3826(0x1fc)]==='segment'||_0x4819ac[_0x1f3826(0x1fc)]===undefined;}export function generateTemplate(_0x340c41=a102_0x45a502(0x1a9)){const _0x13ebfa=a102_0x45a502,_0x213b7f={'type':_0x13ebfa(0x1aa),'name':_0x340c41,'description':_0x13ebfa(0x1b6),'rule':{'type':_0x13ebfa(0x1ed),'conditions':[{'type':'Value','attribute':'attribute_name','operator':{'type':_0x13ebfa(0x209),'value':_0x13ebfa(0x1d3)}}]}};return toYamlString(_0x213b7f);}export function segmentToYamlString(_0xdcf5e9){const _0x390436=a102_0x45a502,_0x22218a=JSON[_0x390436(0x1f7)](JSON[_0x390436(0x1c0)](_0xdcf5e9)),_0x5c8f83=a102_0x1b0752['stringify'](_0x22218a,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x390436(0x1c1)}),_0x203513=[_0x390436(0x20f),_0x390436(0x1d1)];let _0x3f2a70=_0x5c8f83;for(const _0x77de0f of _0x203513){_0x3f2a70=_0x3f2a70[_0x390436(0x1f9)](new RegExp('^('+_0x77de0f+')','m'),(_0x1026c4,_0x461f36,_0x14a47c)=>{if(_0x14a47c===0x0||_0x3f2a70[_0x14a47c-0x1]==='\x0a'&&_0x3f2a70[_0x14a47c-0x2]==='\x0a')return _0x461f36;return'\x0a'+_0x461f36;});}return _0x3f2a70;}export function parseSegmentYamlFile(_0x219614){const _0x597d25=a102_0x45a502,_0x40a32e=a102_0x1b0752[_0x597d25(0x1f7)](_0x219614);if(!_0x40a32e[_0x597d25(0x1e7)])throw new Error(_0x597d25(0x218));return _0x40a32e;}export function normalizeChildSegmentYaml(_0x3e88f7){const _0x5f06da=a102_0x45a502;return{'type':_0x5f06da(0x1aa),'name':_0x3e88f7[_0x5f06da(0x1e7)],..._0x3e88f7[_0x5f06da(0x19a)]!==undefined&&{'description':_0x3e88f7[_0x5f06da(0x19a)]},..._0x3e88f7[_0x5f06da(0x1e8)]!==undefined&&{'folder':_0x3e88f7[_0x5f06da(0x1e8)]},..._0x3e88f7['rule']&&{'rule':normalizeRule(_0x3e88f7[_0x5f06da(0x215)])},..._0x3e88f7[_0x5f06da(0x1b2)]!==undefined&&{'kind':_0x3e88f7[_0x5f06da(0x1b2)]},..._0x3e88f7['visible']!==undefined&&{'visible':_0x3e88f7[_0x5f06da(0x1e3)]},..._0x3e88f7[_0x5f06da(0x19c)]&&{'activations':_0x3e88f7['activations'][_0x5f06da(0x204)](normalizeActivation)}};}export function normalizeRule(_0xf152e1){const _0x54d83a=a102_0x45a502;return{'type':_0xf152e1[_0x54d83a(0x1fc)],'conditions':_0xf152e1[_0x54d83a(0x1db)]['map'](normalizeCondition),..._0xf152e1[_0x54d83a(0x19a)]!==undefined&&{'description':_0xf152e1[_0x54d83a(0x19a)]}};}function normalizeCondition(_0xcddd2){const _0x4cb2ac=a102_0x45a502;if(_0x4cb2ac(0x1aa)in _0xcddd2&&(_0xcddd2[_0x4cb2ac(0x1fc)]===_0x4cb2ac(0x19b)||_0xcddd2[_0x4cb2ac(0x1fc)]===_0x4cb2ac(0x18f))){const _0x33fbe9=_0xcddd2;return{'type':_0x33fbe9['type'],'segment':_0x33fbe9[_0x4cb2ac(0x1aa)]};}if('type'in _0xcddd2&&(_0xcddd2[_0x4cb2ac(0x1fc)]===_0x4cb2ac(0x1ed)||_0xcddd2[_0x4cb2ac(0x1fc)]==='Or')){const _0x48bf42=_0xcddd2;return{'type':_0x48bf42[_0x4cb2ac(0x1fc)],'conditions':_0x48bf42['conditions'][_0x4cb2ac(0x204)](normalizeCondition),..._0x48bf42['description']!==undefined&&{'description':_0x48bf42[_0x4cb2ac(0x19a)]}};}const _0x2517a8=_0xcddd2;return{'type':_0x4cb2ac(0x1b4),'attribute':_0x2517a8[_0x4cb2ac(0x1a8)],'operator':normalizeOperator(_0x2517a8['operator']),..._0x2517a8[_0x4cb2ac(0x1da)]!==undefined&&{'arrayMatching':_0x2517a8[_0x4cb2ac(0x1da)]},..._0x2517a8[_0x4cb2ac(0x18f)]!==undefined&&{'exclude':_0x2517a8[_0x4cb2ac(0x18f)]},..._0x2517a8['aggregation']!==undefined&&{'aggregation':_0x2517a8[_0x4cb2ac(0x1a0)]},..._0x2517a8[_0x4cb2ac(0x1d6)]!==undefined&&{'source':_0x2517a8['source']},..._0x2517a8[_0x4cb2ac(0x1fd)]!==undefined&&{'filter':normalizeRule(_0x2517a8['filter'])},..._0x2517a8[_0x4cb2ac(0x1bc)]!==undefined&&{'limit':_0x2517a8[_0x4cb2ac(0x1bc)]}};}function normalizeOperator(_0x3b056c){const _0x6454d9=a102_0x45a502,_0x4b4b16=getEffectiveValue(_0x3b056c);return{'type':_0x3b056c[_0x6454d9(0x1fc)],..._0x3b056c[_0x6454d9(0x1f0)]!==undefined&&{'not':_0x3b056c[_0x6454d9(0x1f0)]},..._0x4b4b16!==undefined&&{'value':_0x4b4b16},..._0x3b056c[_0x6454d9(0x18d)]!==undefined&&{'min':_0x3b056c[_0x6454d9(0x18d)]},..._0x3b056c['max']!==undefined&&{'max':_0x3b056c[_0x6454d9(0x1f6)]},..._0x3b056c[_0x6454d9(0x1e2)]!==undefined&&{'unit':_0x3b056c['unit']},..._0x3b056c[_0x6454d9(0x197)]!==undefined&&{'duration':_0x3b056c[_0x6454d9(0x197)]},..._0x3b056c[_0x6454d9(0x1c4)]!==undefined&&{'from':_0x3b056c[_0x6454d9(0x1c4)]}};}function normalizeActivation(_0x267dc1){const _0x1f6899=a102_0x45a502;return{'name':_0x267dc1[_0x1f6899(0x1e7)],'connection':_0x267dc1['connection'],..._0x267dc1[_0x1f6899(0x19a)]!==undefined&&{'description':_0x267dc1['description']},..._0x267dc1['all_columns']!==undefined&&{'all_columns':_0x267dc1['all_columns']},..._0x267dc1[_0x1f6899(0x214)]!==undefined&&{'columns':_0x267dc1[_0x1f6899(0x214)]},..._0x267dc1['behavior']!==undefined&&{'behavior':_0x267dc1['behavior']},..._0x267dc1[_0x1f6899(0x1c9)]!==undefined&&{'schedule':_0x267dc1['schedule']},..._0x267dc1[_0x1f6899(0x1d8)]!==undefined&&{'notification':_0x267dc1[_0x1f6899(0x1d8)]},..._0x267dc1[_0x1f6899(0x1c6)]!==undefined&&{'connector_config':_0x267dc1[_0x1f6899(0x1c6)]},..._0x267dc1['activation_template_id']!==undefined&&{'activation_template_id':_0x267dc1['activation_template_id']}};}export function activationResponseToDef(_0x5a0efc,_0x4841ba,_0x31125b){const _0x373227=a102_0x45a502,_0x2083ef=_0x5a0efc['connectionId']||'',_0x543ba8=_0x31125b?.[_0x373227(0x1cc)](_0x2083ef)??_0x2083ef,_0x324c59={'name':_0x5a0efc[_0x373227(0x1e7)],'connection':_0x543ba8};_0x5a0efc[_0x373227(0x19a)]&&(_0x324c59[_0x373227(0x19a)]=_0x5a0efc['description']);let _0x2d40a4=[];_0x5a0efc[_0x373227(0x214)]&&_0x5a0efc[_0x373227(0x214)][_0x373227(0x21a)]>0x0&&(_0x2d40a4=_0x5a0efc[_0x373227(0x214)][_0x373227(0x1fd)](_0x3eae53=>_0x3eae53&&_0x3eae53[_0x373227(0x1e7)])[_0x373227(0x204)](_0x416e49=>{const _0x42c417=_0x373227;if(_0x416e49[_0x42c417(0x1fc)]||_0x416e49[_0x42c417(0x19d)])return{'name':_0x416e49[_0x42c417(0x1e7)],..._0x416e49[_0x42c417(0x1fc)]&&{'type':_0x416e49[_0x42c417(0x1fc)]},..._0x416e49['visibility']&&{'visibility':_0x416e49['visibility']}};return _0x416e49[_0x42c417(0x1e7)];}));_0x2d40a4[_0x373227(0x21a)]>0x0&&(_0x324c59[_0x373227(0x214)]=_0x2d40a4);_0x5a0efc[_0x373227(0x1ee)]!==undefined&&(_0x5a0efc['allColumns']===![]&&_0x2d40a4[_0x373227(0x21a)]===0x0?_0x324c59[_0x373227(0x1d9)]=!![]:_0x324c59[_0x373227(0x1d9)]=_0x5a0efc['allColumns']);const _0x154978={};let _0x4d8992=![];_0x5a0efc[_0x373227(0x20b)]&&(_0x154978['type']=_0x5a0efc['scheduleType'],_0x4d8992=!![]);_0x5a0efc[_0x373227(0x1d2)]&&(_0x154978[_0x373227(0x1fb)]=_0x5a0efc[_0x373227(0x1d2)],_0x4d8992=!![]);_0x5a0efc[_0x373227(0x1d0)]!==undefined&&_0x5a0efc[_0x373227(0x1d0)]!==null&&(_0x154978[_0x373227(0x190)]=_0x5a0efc[_0x373227(0x1d0)],_0x4d8992=!![]);_0x5a0efc[_0x373227(0x1eb)]&&_0x5a0efc[_0x373227(0x1eb)][_0x373227(0x21a)]>0x0&&(_0x154978[_0x373227(0x1a5)]=_0x5a0efc[_0x373227(0x1eb)],_0x4d8992=!![]);_0x5a0efc[_0x373227(0x1a2)]!==undefined&&(_0x154978[_0x373227(0x1c2)]=_0x5a0efc['startAt'],_0x4d8992=!![]);_0x5a0efc[_0x373227(0x1f5)]!==undefined&&(_0x154978[_0x373227(0x1f2)]=_0x5a0efc[_0x373227(0x1f5)],_0x4d8992=!![]);_0x5a0efc[_0x373227(0x1c5)]&&(_0x154978[_0x373227(0x1c5)]=_0x5a0efc['timezone'],_0x4d8992=!![]);_0x4d8992&&(_0x324c59['schedule']=_0x154978);(_0x5a0efc[_0x373227(0x200)]&&_0x5a0efc[_0x373227(0x200)][_0x373227(0x21a)]>0x0||_0x5a0efc[_0x373227(0x19e)]&&_0x5a0efc['emailRecipients'][_0x373227(0x21a)]>0x0)&&(_0x324c59[_0x373227(0x1d8)]={},_0x5a0efc['notifyOn']&&_0x5a0efc['notifyOn'][_0x373227(0x21a)]>0x0&&(_0x324c59[_0x373227(0x1d8)][_0x373227(0x1f4)]=_0x5a0efc[_0x373227(0x200)]),_0x5a0efc[_0x373227(0x19e)]&&_0x5a0efc[_0x373227(0x19e)]['length']>0x0&&(_0x324c59[_0x373227(0x1d8)]['email_recipients']=_0x5a0efc[_0x373227(0x19e)]['map'](_0x42ff67=>{const _0x102ef9=_0x373227,_0xa216c2=_0x4841ba?.[_0x102ef9(0x1cc)](_0x42ff67);return _0xa216c2??String(_0x42ff67);})));_0x5a0efc[_0x373227(0x1cb)]&&Object[_0x373227(0x1b8)](_0x5a0efc['connectorConfig'])[_0x373227(0x21a)]>0x0&&(_0x324c59[_0x373227(0x1c6)]=normalizeConnectorConfigForYaml(_0x5a0efc[_0x373227(0x1cb)]));_0x5a0efc['activationTemplateId']&&(_0x324c59[_0x373227(0x1dc)]=_0x5a0efc[_0x373227(0x20c)]);if(_0x5a0efc[_0x373227(0x219)]){const _0xdaab6b={},_0x51e1ba=_0x5a0efc['syndicationBehavior'];_0x51e1ba[_0x373227(0x214)]&&_0x51e1ba[_0x373227(0x214)][_0x373227(0x21a)]>0x0&&(_0xdaab6b[_0x373227(0x214)]=_0x51e1ba['columns'][_0x373227(0x1fd)](_0x4c4bf4=>_0x4c4bf4&&_0x4c4bf4[_0x373227(0x1e7)])[_0x373227(0x204)](_0x2247ff=>({'name':_0x2247ff[_0x373227(0x1e7)],..._0x2247ff['type']&&{'type':_0x2247ff[_0x373227(0x1fc)]},..._0x2247ff['visibility']&&{'visibility':_0x2247ff[_0x373227(0x19d)]}}))),_0x51e1ba['behaviorTableName']&&(_0xdaab6b[_0x373227(0x195)]=_0x51e1ba[_0x373227(0x194)]),_0x51e1ba['joinRow']!==undefined&&(_0xdaab6b[_0x373227(0x1d4)]=_0x51e1ba['joinRow']),_0x51e1ba[_0x373227(0x191)]&&(_0xdaab6b[_0x373227(0x1b9)]=_0x51e1ba[_0x373227(0x191)]),_0x51e1ba[_0x373227(0x217)]&&(_0xdaab6b['formatting']=_0x51e1ba[_0x373227(0x217)]),_0x51e1ba[_0x373227(0x1ae)]&&_0x51e1ba['orderBy'][_0x373227(0x21a)]>0x0&&(_0xdaab6b[_0x373227(0x1e5)]=_0x51e1ba[_0x373227(0x1ae)]),Object['keys'](_0xdaab6b)[_0x373227(0x21a)]>0x0&&(_0x324c59[_0x373227(0x207)]=_0xdaab6b);}return _0x324c59;}export function journeyActivationStepToYaml(_0x50f9d4,_0x308a53,_0x42bf2b){const _0x33f0be=a102_0x45a502,_0x5799b6=_0x50f9d4[_0x33f0be(0x202)][_0x33f0be(0x20a)],_0x50605d=_0x5799b6[_0x33f0be(0x1ad)]||'',_0x270354=_0x42bf2b?.['get'](_0x50605d)??_0x50605d,_0x5cf305={'name':_0x5799b6[_0x33f0be(0x1e7)]||'','connection':_0x270354};_0x5799b6[_0x33f0be(0x19a)]&&(_0x5cf305[_0x33f0be(0x19a)]=_0x5799b6[_0x33f0be(0x19a)]);let _0x592778=[];_0x5799b6[_0x33f0be(0x214)]&&_0x5799b6['columns'][_0x33f0be(0x21a)]>0x0&&(_0x592778=_0x5799b6[_0x33f0be(0x214)][_0x33f0be(0x1fd)](_0x950035=>_0x950035&&_0x950035[_0x33f0be(0x1e7)])[_0x33f0be(0x204)](_0x4088bf=>{const _0x40c2c9=_0x33f0be;if(_0x4088bf['type']||_0x4088bf[_0x40c2c9(0x19d)])return{'name':_0x4088bf['name'],..._0x4088bf['type']&&{'type':_0x4088bf['type']},..._0x4088bf[_0x40c2c9(0x19d)]&&{'visibility':_0x4088bf[_0x40c2c9(0x19d)]}};return _0x4088bf[_0x40c2c9(0x1e7)];}));_0x592778['length']>0x0&&(_0x5cf305['columns']=_0x592778);_0x5799b6[_0x33f0be(0x1ee)]!==undefined&&(_0x5799b6[_0x33f0be(0x1ee)]===![]&&_0x592778[_0x33f0be(0x21a)]===0x0?_0x5cf305[_0x33f0be(0x1d9)]=!![]:_0x5cf305[_0x33f0be(0x1d9)]=_0x5799b6[_0x33f0be(0x1ee)]);const _0x29be0d={};let _0x2e5b07=![];_0x5799b6[_0x33f0be(0x20b)]&&(_0x29be0d['type']=_0x5799b6[_0x33f0be(0x20b)],_0x2e5b07=!![]);_0x5799b6[_0x33f0be(0x1d2)]&&(_0x29be0d['repeat_unit']=_0x5799b6['repeatUnit'],_0x2e5b07=!![]);_0x5799b6[_0x33f0be(0x1d0)]!==undefined&&_0x5799b6['repeatFrequency']!==null&&(_0x29be0d['repeat_frequency']=_0x5799b6[_0x33f0be(0x1d0)],_0x2e5b07=!![]);_0x5799b6[_0x33f0be(0x1a2)]!==undefined&&(_0x29be0d[_0x33f0be(0x1c2)]=_0x5799b6['startAt'],_0x2e5b07=!![]);_0x5799b6[_0x33f0be(0x1f5)]!==undefined&&(_0x29be0d['end_on']=_0x5799b6[_0x33f0be(0x1f5)],_0x2e5b07=!![]);_0x5799b6['timezone']&&(_0x29be0d[_0x33f0be(0x1c5)]=_0x5799b6['timezone'],_0x2e5b07=!![]);_0x2e5b07&&(_0x5cf305['schedule']=_0x29be0d);(_0x5799b6['notifyOn']&&_0x5799b6['notifyOn']['length']>0x0||_0x5799b6[_0x33f0be(0x19e)]&&_0x5799b6[_0x33f0be(0x19e)][_0x33f0be(0x21a)]>0x0)&&(_0x5cf305[_0x33f0be(0x1d8)]={},_0x5799b6[_0x33f0be(0x200)]&&_0x5799b6[_0x33f0be(0x200)][_0x33f0be(0x21a)]>0x0&&(_0x5cf305['notification'][_0x33f0be(0x1f4)]=_0x5799b6[_0x33f0be(0x200)]),_0x5799b6[_0x33f0be(0x19e)]&&_0x5799b6[_0x33f0be(0x19e)]['length']>0x0&&(_0x5cf305[_0x33f0be(0x1d8)]['email_recipients']=_0x5799b6[_0x33f0be(0x19e)]['map'](_0x1971be=>{const _0xc5a06d=_0x308a53?.['get'](_0x1971be);return _0xc5a06d??String(_0x1971be);})));_0x5799b6[_0x33f0be(0x1cb)]&&Object[_0x33f0be(0x1b8)](_0x5799b6[_0x33f0be(0x1cb)])[_0x33f0be(0x21a)]>0x0&&(_0x5cf305[_0x33f0be(0x1c6)]=normalizeConnectorConfigForYaml(_0x5799b6['connectorConfig']));_0x5799b6[_0x33f0be(0x20c)]&&(_0x5cf305[_0x33f0be(0x1dc)]=_0x5799b6['activationTemplateId']);if(_0x5799b6[_0x33f0be(0x219)]){const _0x4a41ad={},_0xff0ed6=_0x5799b6[_0x33f0be(0x219)];_0xff0ed6[_0x33f0be(0x214)]&&_0xff0ed6['columns'][_0x33f0be(0x21a)]>0x0&&(_0x4a41ad['columns']=_0xff0ed6[_0x33f0be(0x214)][_0x33f0be(0x1fd)](_0x3317b7=>_0x3317b7&&_0x3317b7[_0x33f0be(0x1e7)])[_0x33f0be(0x204)](_0x6c8644=>({'name':_0x6c8644[_0x33f0be(0x1e7)],..._0x6c8644['type']&&{'type':_0x6c8644[_0x33f0be(0x1fc)]},..._0x6c8644['visibility']&&{'visibility':_0x6c8644['visibility']}}))),_0xff0ed6['behaviorTableName']&&(_0x4a41ad[_0x33f0be(0x195)]=_0xff0ed6[_0x33f0be(0x194)]),_0xff0ed6['joinRow']!==undefined&&(_0x4a41ad['join_row']=_0xff0ed6[_0x33f0be(0x1e4)]),_0xff0ed6['joinStrategy']&&(_0x4a41ad[_0x33f0be(0x1b9)]=_0xff0ed6[_0x33f0be(0x191)]),_0xff0ed6[_0x33f0be(0x217)]&&(_0x4a41ad['formatting']=_0xff0ed6[_0x33f0be(0x217)]),_0xff0ed6[_0x33f0be(0x1ae)]&&_0xff0ed6[_0x33f0be(0x1ae)][_0x33f0be(0x21a)]>0x0&&(_0x4a41ad['order_by']=_0xff0ed6[_0x33f0be(0x1ae)]),Object['keys'](_0x4a41ad)['length']>0x0&&(_0x5cf305[_0x33f0be(0x207)]=_0x4a41ad);}return _0x5cf305;}export function segmentWithActivationsToYaml(_0x4dcd0e,_0x21b159,_0x490dfa,_0x3113f2,_0xf3367d){const _0x3d6554=a102_0x45a502,_0xaf3e97=segmentResponseToDefSync(_0x4dcd0e,_0x490dfa);return _0x21b159[_0x3d6554(0x21a)]>0x0&&(_0xaf3e97[_0x3d6554(0x19c)]=_0x21b159[_0x3d6554(0x204)](_0x17c99b=>activationResponseToDef(_0x17c99b,_0x3113f2,_0xf3367d))),_0xaf3e97;}function normalizeColumn(_0x491933){const _0x2971cf=a102_0x45a502;if(typeof _0x491933===_0x2971cf(0x1bf))return{'name':_0x491933};return{'name':_0x491933[_0x2971cf(0x1e7)],..._0x491933[_0x2971cf(0x1fc)]&&{'type':_0x491933[_0x2971cf(0x1fc)]},..._0x491933[_0x2971cf(0x19d)]&&{'visibility':_0x491933[_0x2971cf(0x19d)]}};}function a102_0x30ca(_0x166070,_0x181c5c){_0x166070=_0x166070-0x18d;const _0x726e0b=a102_0x726e();let _0x30ca81=_0x726e0b[_0x166070];return _0x30ca81;}export async function activationDefToCreateRequest(_0x370544,_0x5714c9){const _0x1bd919=a102_0x45a502,_0x34ac57=_0x5714c9?.[_0x1bd919(0x1a1)],_0x23aaba=_0x5714c9?.['connectionNameToIdMap'],_0x322d29=_0x370544[_0x1bd919(0x1c3)];let _0x5bf88a;const _0x1d1130=parseInt(_0x322d29,0xa);if(!isNaN(_0x1d1130)&&String(_0x1d1130)===_0x322d29)_0x5bf88a=_0x1d1130;else{const _0x4b8bd4=_0x23aaba?.[_0x1bd919(0x1cc)](_0x322d29);if(_0x4b8bd4===undefined)throw new SDKError(ErrorCode[_0x1bd919(0x19f)],_0x1bd919(0x1be)+_0x322d29,undefined,{'helpText':_0x1bd919(0x1ef)});_0x5bf88a=_0x4b8bd4;}const _0x4cec4c={'name':_0x370544[_0x1bd919(0x1e7)],'connectionId':_0x5bf88a};_0x370544[_0x1bd919(0x19a)]&&(_0x4cec4c[_0x1bd919(0x19a)]=_0x370544[_0x1bd919(0x19a)]);let _0x507cc2=[];_0x370544['columns']&&_0x370544[_0x1bd919(0x214)][_0x1bd919(0x21a)]>0x0&&(_0x507cc2=_0x370544[_0x1bd919(0x214)][_0x1bd919(0x1fd)](_0x2ef70f=>_0x2ef70f!=null)[_0x1bd919(0x204)](normalizeColumn));_0x507cc2[_0x1bd919(0x21a)]>0x0&&(_0x4cec4c[_0x1bd919(0x214)]=_0x507cc2);_0x370544[_0x1bd919(0x1d9)]!==undefined&&(_0x370544[_0x1bd919(0x1d9)]===![]&&_0x507cc2[_0x1bd919(0x21a)]===0x0?_0x4cec4c['allColumns']=!![]:_0x4cec4c[_0x1bd919(0x1ee)]=_0x370544[_0x1bd919(0x1d9)]);if(_0x370544['schedule']){const _0x156d92=_0x370544[_0x1bd919(0x1c9)];_0x156d92[_0x1bd919(0x1fc)]&&(_0x4cec4c[_0x1bd919(0x20b)]=_0x156d92[_0x1bd919(0x1fc)]),_0x156d92['repeat_unit']&&(_0x4cec4c[_0x1bd919(0x1d2)]=_0x156d92[_0x1bd919(0x1fb)]),_0x156d92[_0x1bd919(0x190)]!==undefined&&(_0x4cec4c[_0x1bd919(0x1d0)]=_0x156d92['repeat_frequency']),_0x156d92[_0x1bd919(0x1a5)]&&(_0x4cec4c[_0x1bd919(0x1eb)]=_0x156d92['repeat_sub_frequency']),_0x156d92[_0x1bd919(0x1c2)]!==undefined&&(_0x4cec4c[_0x1bd919(0x1a2)]=_0x156d92[_0x1bd919(0x1c2)]),_0x156d92[_0x1bd919(0x1f2)]!==undefined&&(_0x4cec4c[_0x1bd919(0x1f5)]=_0x156d92[_0x1bd919(0x1f2)]),_0x156d92[_0x1bd919(0x1c5)]&&(_0x4cec4c['timezone']=_0x156d92[_0x1bd919(0x1c5)]);}_0x370544['notification']&&(_0x370544[_0x1bd919(0x1d8)][_0x1bd919(0x1f4)]&&(_0x4cec4c[_0x1bd919(0x200)]=_0x370544[_0x1bd919(0x1d8)][_0x1bd919(0x1f4)]),_0x370544[_0x1bd919(0x1d8)]['email_recipients']&&(_0x4cec4c[_0x1bd919(0x19e)]=_0x370544[_0x1bd919(0x1d8)][_0x1bd919(0x208)][_0x1bd919(0x204)](_0x561206=>{const _0x107af2=_0x1bd919,_0x395449=Number(_0x561206);if(!isNaN(_0x395449)&&String(_0x395449)===_0x561206)return _0x395449;const _0x467006=_0x34ac57?.[_0x107af2(0x1cc)](_0x561206[_0x107af2(0x1f3)]());if(_0x467006===undefined)throw new SDKError(ErrorCode[_0x107af2(0x201)],_0x107af2(0x1f8)+_0x561206+_0x107af2(0x1b5));return _0x467006;})));if(_0x370544[_0x1bd919(0x1c6)]){const _0x1bbe58=_0x5714c9?.[_0x1bd919(0x1ab)]?.[_0x1bd919(0x1cc)](_0x322d29);if(_0x1bbe58&&_0x5714c9?.[_0x1bd919(0x1fe)])try{const _0x360042=await _0x5714c9['getSchema'](_0x1bbe58),_0x56cf79=validateConnectorConfig(_0x370544['connector_config'],_0x360042);if(!_0x56cf79[_0x1bd919(0x1cf)])throw new SDKError(ErrorCode[_0x1bd919(0x1fa)],_0x1bd919(0x1e9)+_0x370544['name']+'\x22:\x0a'+formatValidationErrors(_0x56cf79['errors']),undefined,{'helpText':'Connector:\x20'+_0x1bbe58+_0x1bd919(0x199)+formatSchemaAsHelp(_0x360042)});if(_0x56cf79[_0x1bd919(0x20e)]['length']>0x0){const _0x24d155=formatValidationWarnings(_0x56cf79[_0x1bd919(0x20e)]);console['warn']('connector_config\x20for\x20activation\x20\x22'+_0x370544['name']+_0x1bd919(0x1d5)+_0x24d155);}_0x4cec4c[_0x1bd919(0x1cb)]=transformConfigToLegacy(_0x370544[_0x1bd919(0x1c6)],_0x360042);}catch(_0x2c1011){if(_0x2c1011 instanceof SDKError&&_0x2c1011[_0x1bd919(0x212)]===ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])_0x4cec4c[_0x1bd919(0x1cb)]=_0x370544[_0x1bd919(0x1c6)];else throw _0x2c1011;}else _0x4cec4c['connectorConfig']=_0x370544[_0x1bd919(0x1c6)];}_0x370544['activation_template_id']!==undefined&&(_0x4cec4c[_0x1bd919(0x20c)]=_0x370544[_0x1bd919(0x1dc)]);if(_0x370544[_0x1bd919(0x207)]){const _0x2bed2f=_0x370544[_0x1bd919(0x207)],_0x98c413={};if(_0x2bed2f[_0x1bd919(0x214)]&&_0x2bed2f[_0x1bd919(0x214)]['length']>0x0){const _0x414828=_0x2bed2f[_0x1bd919(0x214)][_0x1bd919(0x1fd)](_0xf6a70b=>_0xf6a70b&&_0xf6a70b['name']);_0x414828[_0x1bd919(0x21a)]>0x0&&(_0x98c413[_0x1bd919(0x214)]=_0x414828);}_0x2bed2f['behavior_table']&&(_0x98c413[_0x1bd919(0x194)]=_0x2bed2f[_0x1bd919(0x195)]),_0x2bed2f[_0x1bd919(0x1d4)]!==undefined&&(_0x98c413[_0x1bd919(0x1e4)]=_0x2bed2f['join_row']),_0x2bed2f[_0x1bd919(0x1b9)]&&(_0x98c413[_0x1bd919(0x191)]=_0x2bed2f[_0x1bd919(0x1b9)]),_0x2bed2f['formatting']&&(_0x98c413[_0x1bd919(0x217)]=_0x2bed2f['formatting']),_0x2bed2f[_0x1bd919(0x1e5)]&&(_0x98c413['orderBy']=_0x2bed2f[_0x1bd919(0x1e5)]),_0x4cec4c['syndicationBehavior']=_0x98c413;}return _0x4cec4c;}export async function activationDefToUpdateRequest(_0x2bf4d6,_0x15b4bf){return activationDefToCreateRequest(_0x2bf4d6,_0x15b4bf);}export function deepSortObject(_0x46188){const _0x2d87f2=a102_0x45a502;if(_0x46188===null||typeof _0x46188!==_0x2d87f2(0x1bb))return _0x46188;if(Array[_0x2d87f2(0x1d7)](_0x46188))return _0x46188[_0x2d87f2(0x204)](deepSortObject)[_0x2d87f2(0x196)]((_0x455eeb,_0x311523)=>JSON['stringify'](_0x455eeb)[_0x2d87f2(0x1c7)](JSON[_0x2d87f2(0x1c0)](_0x311523)));const _0xd78ca0={};for(const _0x1098e9 of Object[_0x2d87f2(0x1b8)](_0x46188)[_0x2d87f2(0x196)]()){_0xd78ca0[_0x1098e9]=deepSortObject(_0x46188[_0x1098e9]);}return _0xd78ca0;}export function serializeRule(_0x10c9df){return JSON['stringify'](deepSortObject(_0x10c9df));}export function normalizeRuleForMatching(_0x14bc80){return normalizeConditionsForMatching(_0x14bc80);}function normalizeConditionsForMatching(_0x2c17e8){const _0xa72867=a102_0x45a502;if(_0x2c17e8===null||typeof _0x2c17e8!==_0xa72867(0x1bb))return _0x2c17e8;if(Array['isArray'](_0x2c17e8))return _0x2c17e8['map'](normalizeConditionsForMatching);const _0x2d5d25=_0x2c17e8;if((_0x2d5d25['type']===_0xa72867(0x19b)||_0x2d5d25[_0xa72867(0x1fc)]===_0xa72867(0x18f))&&typeof _0x2d5d25['segment']==='string')return{..._0x2d5d25,'segment':_0xa72867(0x1b0)};const _0x19f0a0={};for(const _0x455391 of Object[_0xa72867(0x1b8)](_0x2d5d25)){_0x19f0a0[_0x455391]=normalizeConditionsForMatching(_0x2d5d25[_0x455391]);}return _0x19f0a0;}export function serializeRuleForMatching(_0x327739){const _0x2e441f=a102_0x45a502;return JSON[_0x2e441f(0x1c0)](deepSortObject(normalizeRuleForMatching(_0x327739)));}export function expandSegmentReferences(_0x35063b,_0x4b7440,_0x5712ba=new Set()){return expandConditions(_0x35063b,_0x4b7440,_0x5712ba);}function expandConditions(_0x33cb7e,_0x1b4b66,_0x761ee7){const _0x111ee4=a102_0x45a502;if(_0x33cb7e===null||typeof _0x33cb7e!==_0x111ee4(0x1bb))return _0x33cb7e;if(Array[_0x111ee4(0x1d7)](_0x33cb7e))return _0x33cb7e['map'](_0x32c67a=>expandConditions(_0x32c67a,_0x1b4b66,_0x761ee7));const _0x118d0c=_0x33cb7e;if((_0x118d0c[_0x111ee4(0x1fc)]===_0x111ee4(0x19b)||_0x118d0c[_0x111ee4(0x1fc)]===_0x111ee4(0x18f))&&typeof _0x118d0c[_0x111ee4(0x1aa)]===_0x111ee4(0x1bf)){const _0x1571e2=_0x118d0c[_0x111ee4(0x1aa)],_0x510a20=_0x1b4b66[_0x111ee4(0x1cc)](_0x1571e2);if(_0x510a20&&!_0x761ee7[_0x111ee4(0x1a4)](_0x1571e2)){const _0x3a0114=new Set(_0x761ee7);_0x3a0114[_0x111ee4(0x206)](_0x1571e2);const _0x139f9e=expandConditions(_0x510a20,_0x1b4b66,_0x3a0114);return{'type':_0x118d0c[_0x111ee4(0x1fc)],'expanded_rule':_0x139f9e};}return{'type':_0x118d0c[_0x111ee4(0x1fc)],'expanded_rule':'__UNRESOLVED__'};}const _0xcf1008={};for(const _0x2c9dd6 of Object['keys'](_0x118d0c)){_0xcf1008[_0x2c9dd6]=expandConditions(_0x118d0c[_0x2c9dd6],_0x1b4b66,_0x761ee7);}return _0xcf1008;}export function serializeExpandedRule(_0x32480d,_0x34ee98){const _0x340ea5=a102_0x45a502,_0x3c950b=expandSegmentReferences(_0x32480d,_0x34ee98);return JSON[_0x340ea5(0x1c0)](deepSortObject(_0x3c950b));}export function createSegmentNameContext(_0x19011a){const _0x307f66=a102_0x45a502,_0x1b1885=new Set(),_0x76c37=new Map(),_0x22530d=new Map();if(_0x19011a)for(const [_0x2fb6d4,_0x523c50]of Object[_0x307f66(0x205)](_0x19011a)){if(_0x523c50[_0x307f66(0x215)]){const _0x493ea2=serializeRule(_0x523c50[_0x307f66(0x215)]);_0x22530d[_0x307f66(0x1ce)](_0x493ea2,_0x2fb6d4),_0x1b1885[_0x307f66(0x206)](_0x2fb6d4);}}return{'usedNames':_0x1b1885,'ruleHashToName':_0x76c37,'localRuleToName':_0x19011a?_0x22530d:undefined};}export function resolveSegmentName(_0x18a7ae,_0x492646,_0x598e45,_0x798562){const _0x5d1e06=a102_0x45a502,_0x43990b=serializeRule(_0x492646);if(_0x598e45[_0x5d1e06(0x1a7)]){const _0x341b1e=_0x598e45[_0x5d1e06(0x1a7)]['get'](_0x43990b);if(_0x341b1e)return{'name':_0x341b1e,'isDuplicate':![],'isLocalMatch':!![]};}const _0x2a5df3=_0x598e45['ruleHashToName'][_0x5d1e06(0x1cc)](_0x43990b);if(_0x2a5df3)return{'name':_0x2a5df3,'isDuplicate':!![],'isLocalMatch':![]};const _0x486d16=_0x798562(_0x18a7ae);let _0x5e1b64=_0x486d16||_0x18a7ae,_0x19631a=_0x5e1b64,_0x266319=0x2;while(_0x598e45[_0x5d1e06(0x1b1)][_0x5d1e06(0x1a4)](_0x19631a)){_0x19631a=_0x5e1b64+'_'+_0x266319,_0x266319++;}return _0x598e45[_0x5d1e06(0x1b1)][_0x5d1e06(0x206)](_0x19631a),_0x598e45[_0x5d1e06(0x1f1)]['set'](_0x43990b,_0x19631a),{'name':_0x19631a,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x463f44){const _0x3ae0f5=[],_0x177b19=_0x4f39b0=>{const _0x14b1e1=a102_0x30ca;if(!_0x4f39b0||typeof _0x4f39b0!==_0x14b1e1(0x1bb))return;if(Array['isArray'](_0x4f39b0)){_0x4f39b0['forEach'](_0x177b19);return;}const _0x89cb11=_0x4f39b0;(_0x89cb11['type']==='include'||_0x89cb11[_0x14b1e1(0x1fc)]===_0x14b1e1(0x18f))&&typeof _0x89cb11['segment']===_0x14b1e1(0x1bf)&&_0x3ae0f5[_0x14b1e1(0x1e6)](_0x89cb11[_0x14b1e1(0x1aa)]);for(const _0x30d837 of Object[_0x14b1e1(0x1e0)](_0x89cb11)){_0x177b19(_0x30d837);}};return _0x177b19(_0x463f44),_0x3ae0f5;}export function validateSegmentRule(_0x55128b,_0x4b0b67){const _0xd2d12b=a102_0x45a502;if(!_0x4b0b67||!_0x4b0b67[_0xd2d12b(0x1db)])return;for(let _0x32e6fc=0x0;_0x32e6fc<_0x4b0b67['conditions']['length'];_0x32e6fc++){const _0x3765db=_0x4b0b67[_0xd2d12b(0x1db)][_0x32e6fc];if('type'in _0x3765db&&_0x3765db[_0xd2d12b(0x1fc)]==='Value'){const _0x535e7b=_0x3765db;if(!_0x535e7b[_0xd2d12b(0x1a8)]||_0x535e7b[_0xd2d12b(0x1a8)]==='')throw new SDKError(ErrorCode[_0xd2d12b(0x211)],_0xd2d12b(0x1bd)+_0x55128b+'\x27:\x20'+('conditions['+_0x32e6fc+'].attribute\x20cannot\x20be\x20empty.\x0a')+_0xd2d12b(0x20d));}}}
|
|
1
|
+
(function(_0x596aa8,_0x4a7ce1){const _0x1d8c0b=a102_0x2f61,_0x4d5503=_0x596aa8();while(!![]){try{const _0x1a4068=parseInt(_0x1d8c0b(0x253))/0x1+-parseInt(_0x1d8c0b(0x239))/0x2+-parseInt(_0x1d8c0b(0x210))/0x3+parseInt(_0x1d8c0b(0x23a))/0x4*(-parseInt(_0x1d8c0b(0x265))/0x5)+parseInt(_0x1d8c0b(0x266))/0x6+parseInt(_0x1d8c0b(0x1ec))/0x7*(parseInt(_0x1d8c0b(0x24b))/0x8)+parseInt(_0x1d8c0b(0x230))/0x9*(parseInt(_0x1d8c0b(0x261))/0xa);if(_0x1a4068===_0x4a7ce1)break;else _0x4d5503['push'](_0x4d5503['shift']());}catch(_0x141232){_0x4d5503['push'](_0x4d5503['shift']());}}}(a102_0x3587,0xd58af));import*as a102_0x48e21f from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x4ec200,_0x1ec739){const _0x2db4e4=a102_0x2f61,_0x3b6547=_0x4ec200[_0x2db4e4(0x247)]&&'type'in _0x4ec200[_0x2db4e4(0x247)]&&_0x4ec200[_0x2db4e4(0x247)]['type'];return{'type':'segment','name':_0x4ec200['name'],..._0x4ec200['description']&&{'description':_0x4ec200[_0x2db4e4(0x207)]},..._0x1ec739&&{'folder':_0x1ec739},..._0x3b6547&&{'rule':apiRuleToYaml(_0x4ec200[_0x2db4e4(0x247)])},..._0x4ec200['kind']!==undefined&&{'kind':_0x4ec200[_0x2db4e4(0x208)]===0x0?_0x2db4e4(0x211):_0x4ec200[_0x2db4e4(0x208)]===0x1?_0x2db4e4(0x220):_0x2db4e4(0x22e)},..._0x4ec200[_0x2db4e4(0x243)]!==undefined&&{'visible':_0x4ec200['isVisible']}};}export async function segmentResponseToDef(_0xef1561,_0x244118,_0x4c7dcf){const _0x52180b=a102_0x2f61,_0x51df8f=segmentResponseToDefSync(_0xef1561,_0x4c7dcf);if(!_0x244118||!_0x244118['resolveSegmentName'])return _0x51df8f;return _0x51df8f['rule']&&(_0x51df8f[_0x52180b(0x247)]=await resolveRuleSegmentRefs(_0x51df8f[_0x52180b(0x247)],_0x244118[_0x52180b(0x267)])),_0x51df8f;}export function apiRuleToYaml(_0x5583bd){const _0x488cae=a102_0x2f61,_0x170894=(_0x5583bd['conditions']||[])['map'](apiConditionToYaml);if(_0x170894[_0x488cae(0x202)]===0x1&&!_0x5583bd[_0x488cae(0x207)]&&_0x488cae(0x1f5)in _0x170894[0x0]&&(_0x170894[0x0]['type']===_0x488cae(0x22d)||_0x170894[0x0][_0x488cae(0x1f5)]==='Or')){const _0x548b89=_0x170894[0x0];if(_0x548b89[_0x488cae(0x1f5)]===_0x5583bd[_0x488cae(0x1f5)]&&_0x548b89[_0x488cae(0x1f2)])return{'type':_0x5583bd[_0x488cae(0x1f5)],'conditions':_0x548b89[_0x488cae(0x1f2)],..._0x548b89[_0x488cae(0x207)]&&{'description':_0x548b89[_0x488cae(0x207)]}};}return{'type':_0x5583bd[_0x488cae(0x1f5)],'conditions':_0x170894,..._0x5583bd[_0x488cae(0x207)]&&{'description':_0x5583bd[_0x488cae(0x207)]}};}export async function resolveRuleSegmentRefs(_0x27c586,_0x34ca5e){const _0x1078fc=a102_0x2f61,_0x15e1e8=await Promise[_0x1078fc(0x20e)](_0x27c586['conditions'][_0x1078fc(0x1f7)](_0x155fd7=>resolveConditionSegmentRefs(_0x155fd7,_0x34ca5e)));return{..._0x27c586,'conditions':_0x15e1e8};}async function resolveConditionSegmentRefs(_0x475dc6,_0x3ada49){const _0x48e9cb=a102_0x2f61;if('segment'in _0x475dc6&&(_0x475dc6[_0x48e9cb(0x1f5)]==='include'||_0x475dc6['type']===_0x48e9cb(0x1f9))){const _0x1ea479=_0x475dc6;if(/^\d+$/[_0x48e9cb(0x21b)](_0x1ea479[_0x48e9cb(0x1f3)])){const _0x3819ba=await _0x3ada49(_0x1ea479[_0x48e9cb(0x1f3)]);return{..._0x1ea479,'segment':_0x3819ba};}return _0x475dc6;}if(_0x48e9cb(0x1f2)in _0x475dc6&&_0x475dc6[_0x48e9cb(0x1f2)]){const _0x4a97cb=_0x475dc6,_0x52f9ef=await Promise['all'](_0x4a97cb[_0x48e9cb(0x1f2)]['map'](_0x21babc=>resolveConditionSegmentRefs(_0x21babc,_0x3ada49)));return{..._0x4a97cb,'conditions':_0x52f9ef};}if(_0x48e9cb(0x218)in _0x475dc6&&_0x475dc6[_0x48e9cb(0x218)]){const _0x53fcaf=_0x475dc6,_0x446923=await resolveRuleSegmentRefs(_0x53fcaf[_0x48e9cb(0x218)],_0x3ada49);return{..._0x53fcaf,'filter':_0x446923};}return _0x475dc6;}export async function resolveRuleSegmentIds(_0xc071e8,_0x1214df){const _0x38e9cf=a102_0x2f61,_0x1db9ab=await Promise[_0x38e9cf(0x20e)](_0xc071e8[_0x38e9cf(0x1f2)]['map'](_0x2d44f4=>resolveConditionSegmentIds(_0x2d44f4,_0x1214df)));return{..._0xc071e8,'conditions':_0x1db9ab};}async function resolveConditionSegmentIds(_0x3c0cf3,_0x4af942){const _0x5e4666=a102_0x2f61;if(_0x5e4666(0x1f3)in _0x3c0cf3&&(_0x3c0cf3[_0x5e4666(0x1f5)]===_0x5e4666(0x249)||_0x3c0cf3['type']===_0x5e4666(0x1f9))){const _0x1857b8=_0x3c0cf3;if(!/^\d+$/[_0x5e4666(0x21b)](_0x1857b8[_0x5e4666(0x1f3)])){const _0x1d533a=await _0x4af942(_0x1857b8[_0x5e4666(0x1f3)]);return{..._0x1857b8,'segment':_0x1d533a};}return _0x3c0cf3;}if(_0x5e4666(0x1f2)in _0x3c0cf3&&_0x3c0cf3[_0x5e4666(0x1f2)]){const _0x462958=_0x3c0cf3,_0x44f466=await Promise['all'](_0x462958[_0x5e4666(0x1f2)]['map'](_0x6a22ec=>resolveConditionSegmentIds(_0x6a22ec,_0x4af942)));return{..._0x462958,'conditions':_0x44f466};}if(_0x5e4666(0x218)in _0x3c0cf3&&_0x3c0cf3[_0x5e4666(0x218)]){const _0x59205c=_0x3c0cf3,_0x2c261e=await resolveRuleSegmentIds(_0x59205c['filter'],_0x4af942);return{..._0x59205c,'filter':_0x2c261e};}return _0x3c0cf3;}function apiConditionToYaml(_0x14ba7f){const _0x2fc85b=a102_0x2f61;if(_0x14ba7f[_0x2fc85b(0x1f5)]===_0x2fc85b(0x22d)||_0x14ba7f[_0x2fc85b(0x1f5)]==='Or'){if(_0x14ba7f[_0x2fc85b(0x1f2)]){const _0x3aa54d=_0x14ba7f['conditions']['map'](apiConditionToYaml);if(_0x3aa54d[_0x2fc85b(0x202)]===0x1&&!_0x14ba7f[_0x2fc85b(0x207)])return _0x3aa54d[0x0];return{'type':_0x14ba7f[_0x2fc85b(0x1f5)],'conditions':_0x3aa54d,..._0x14ba7f[_0x2fc85b(0x207)]&&{'description':_0x14ba7f[_0x2fc85b(0x207)]}};}}if(_0x14ba7f[_0x2fc85b(0x1f5)]==='Value'&&_0x14ba7f[_0x2fc85b(0x24d)]&&_0x14ba7f[_0x2fc85b(0x26f)]){const _0x1f382a=_0x14ba7f[_0x2fc85b(0x24d)][_0x2fc85b(0x219)]?{'type':_0x14ba7f[_0x2fc85b(0x24d)]['aggregation']['type'],..._0x14ba7f[_0x2fc85b(0x24d)][_0x2fc85b(0x219)]['groupingColumns']&&{'groupingColumns':_0x14ba7f[_0x2fc85b(0x24d)]['aggregation']['groupingColumns']}}:undefined;return{'type':'Value','attribute':_0x14ba7f[_0x2fc85b(0x24d)][_0x2fc85b(0x1fb)]||'','operator':apiOperatorToYaml(_0x14ba7f[_0x2fc85b(0x26f)]),..._0x14ba7f['arrayMatching']&&_0x14ba7f[_0x2fc85b(0x222)]!==_0x2fc85b(0x235)?{'arrayMatching':_0x14ba7f[_0x2fc85b(0x222)]}:{},..._0x14ba7f['exclude']?{'exclude':_0x14ba7f['exclude']}:{},..._0x1f382a?{'aggregation':_0x1f382a}:{},..._0x14ba7f[_0x2fc85b(0x24d)][_0x2fc85b(0x1e5)]?{'source':_0x14ba7f[_0x2fc85b(0x24d)][_0x2fc85b(0x1e5)][_0x2fc85b(0x1fb)]}:{},..._0x14ba7f[_0x2fc85b(0x24d)][_0x2fc85b(0x218)]?{'filter':apiRuleToYaml(_0x14ba7f['leftValue'][_0x2fc85b(0x218)])}:{},..._0x14ba7f[_0x2fc85b(0x264)]!==undefined&&_0x14ba7f[_0x2fc85b(0x264)]!==null?{'limit':_0x14ba7f[_0x2fc85b(0x264)]}:{}};}if(_0x14ba7f[_0x2fc85b(0x1f5)]===_0x2fc85b(0x23d)&&_0x14ba7f['id'])return{'type':_0x14ba7f['exclude']?_0x2fc85b(0x1f9):_0x2fc85b(0x249),'segment':_0x14ba7f['id']};return{'type':_0x2fc85b(0x22d),'conditions':[]};}function isTemporalOperator(_0x1852a4){const _0x255799=a102_0x2f61;return _0x1852a4===_0x255799(0x237)||_0x1852a4===_0x255799(0x200);}function getEffectiveValue(_0x4fa5be){const _0x4196f4=a102_0x2f61,_0x27fc90=_0x4fa5be[_0x4196f4(0x20a)];return _0x4fa5be[_0x4196f4(0x256)]??_0x27fc90;}function apiOperatorToYaml(_0x5598b0){const _0x388a51=a102_0x2f61;let _0x3b6776;if(_0x5598b0['rightValues']&&_0x5598b0[_0x388a51(0x20f)][_0x388a51(0x202)]>0x0)_0x3b6776=_0x5598b0['rightValues'];else{if(_0x5598b0[_0x388a51(0x22f)]!==undefined)_0x3b6776=_0x5598b0[_0x388a51(0x22f)];else isTemporalOperator(_0x5598b0[_0x388a51(0x1f5)])&&_0x5598b0[_0x388a51(0x256)]!==undefined&&(_0x3b6776=_0x5598b0['value']);}return{'type':mapApiOperatorType(_0x5598b0[_0x388a51(0x1f5)]),..._0x5598b0[_0x388a51(0x227)]&&{'not':_0x5598b0[_0x388a51(0x227)]},..._0x3b6776!==undefined&&{'value':_0x3b6776},..._0x5598b0[_0x388a51(0x259)]&&{'unit':_0x5598b0[_0x388a51(0x259)]}};}function mapApiOperatorType(_0x43c718){return _0x43c718;}export function segmentDefToCreateRequest(_0x310f6e,_0xb7084a){const _0x4838fc=a102_0x2f61,_0x5e7249={'name':_0x310f6e[_0x4838fc(0x1fb)]};return _0x310f6e['description']&&(_0x5e7249[_0x4838fc(0x207)]=_0x310f6e[_0x4838fc(0x207)]),_0x310f6e['rule']&&(_0x5e7249[_0x4838fc(0x247)]=yamlRuleToApi(_0x310f6e[_0x4838fc(0x247)])),_0x310f6e[_0x4838fc(0x208)]&&(_0x5e7249[_0x4838fc(0x208)]=_0x310f6e[_0x4838fc(0x208)]==='batch'?0x0:_0x310f6e[_0x4838fc(0x208)]==='realtime'?0x1:0x2),_0x310f6e[_0x4838fc(0x22b)]!==undefined&&(_0x5e7249['isVisible']=_0x310f6e[_0x4838fc(0x22b)]),_0xb7084a&&(_0x5e7249['segmentFolderId']=_0xb7084a),_0x5e7249;}export function segmentDefToUpdateRequest(_0x493ad2){const _0x202037=a102_0x2f61,_0x2a39d6={'name':_0x493ad2[_0x202037(0x1fb)]};return _0x493ad2[_0x202037(0x207)]!==undefined&&(_0x2a39d6[_0x202037(0x207)]=_0x493ad2[_0x202037(0x207)]),_0x493ad2[_0x202037(0x247)]&&(_0x2a39d6['rule']=yamlRuleToApi(_0x493ad2[_0x202037(0x247)])),_0x493ad2[_0x202037(0x208)]&&(_0x2a39d6[_0x202037(0x208)]=_0x493ad2[_0x202037(0x208)]===_0x202037(0x211)?0x0:_0x493ad2['kind']===_0x202037(0x220)?0x1:0x2),_0x2a39d6;}export function yamlRuleToApi(_0x4bf145,_0x4205cf=![]){const _0x35d332=a102_0x2f61,_0x4871cb=_0x4bf145[_0x35d332(0x1f2)]['map'](yamlConditionToApi);if(_0x4205cf){const _0x2d947b=_0x4871cb['every'](_0x351e82=>_0x351e82['type']===_0x35d332(0x22d)||_0x351e82['type']==='Or');if(!_0x2d947b&&_0x4871cb[_0x35d332(0x202)]>0x0)return{'type':_0x4bf145[_0x35d332(0x1f5)],'conditions':[{'type':_0x35d332(0x22d),'description':_0x4bf145[_0x35d332(0x207)]||'','conditions':_0x4871cb}]};}return{'type':_0x4bf145[_0x35d332(0x1f5)],'conditions':_0x4871cb,..._0x4bf145[_0x35d332(0x207)]&&{'description':_0x4bf145['description']}};}function yamlConditionToApi(_0x505e70){const _0x8bf428=a102_0x2f61;if(_0x8bf428(0x1f3)in _0x505e70&&(_0x505e70[_0x8bf428(0x1f5)]===_0x8bf428(0x249)||_0x505e70[_0x8bf428(0x1f5)]==='exclude')){const _0x57352f=_0x505e70;return{'type':_0x8bf428(0x23d),'id':_0x57352f[_0x8bf428(0x1f3)],'exclude':_0x57352f['type']==='exclude'};}if('type'in _0x505e70&&(_0x505e70[_0x8bf428(0x1f5)]==='And'||_0x505e70[_0x8bf428(0x1f5)]==='Or')){const _0x567505=_0x505e70;return{'type':_0x567505[_0x8bf428(0x1f5)],'conditions':_0x567505[_0x8bf428(0x1f2)][_0x8bf428(0x1f7)](yamlConditionToApi),..._0x567505[_0x8bf428(0x207)]&&{'description':_0x567505[_0x8bf428(0x207)]}};}const _0x4cb793=_0x505e70,_0x3d85f8={'type':_0x8bf428(0x26c),'leftValue':buildLeftValue(_0x4cb793),'operator':yamlOperatorToApi(_0x4cb793[_0x8bf428(0x26f)]),'exclude':_0x4cb793[_0x8bf428(0x1f9)]??![],'arrayMatching':_0x4cb793[_0x8bf428(0x222)]??'any'};return _0x4cb793['limit']!==undefined&&(_0x3d85f8[_0x8bf428(0x264)]=_0x4cb793[_0x8bf428(0x264)]),_0x3d85f8;}function buildLeftValue(_0xf3d239){const _0x3a06d8=a102_0x2f61,_0x36511e={'name':_0xf3d239[_0x3a06d8(0x238)]};return _0xf3d239['aggregation']&&(_0x36511e[_0x3a06d8(0x219)]={'type':_0xf3d239[_0x3a06d8(0x219)][_0x3a06d8(0x1f5)],..._0xf3d239[_0x3a06d8(0x219)][_0x3a06d8(0x255)]&&{'groupingColumns':_0xf3d239[_0x3a06d8(0x219)]['groupingColumns']}}),_0xf3d239[_0x3a06d8(0x1e5)]&&(_0x36511e['source']={'name':_0xf3d239[_0x3a06d8(0x1e5)]}),_0xf3d239[_0x3a06d8(0x218)]&&(_0x36511e['filter']=yamlRuleToApi(_0xf3d239[_0x3a06d8(0x218)])),_0x36511e;}function yamlOperatorToApi(_0x5a392f){const _0x41edc6=a102_0x2f61,_0x4864a5={'type':mapYamlOperatorType(_0x5a392f[_0x41edc6(0x1f5)]),'not':_0x5a392f['not']??![]},_0x13f102=getEffectiveValue(_0x5a392f);if(_0x13f102!==undefined){if(Array[_0x41edc6(0x1e9)](_0x13f102))_0x4864a5[_0x41edc6(0x20f)]=_0x13f102;else isTemporalOperator(_0x5a392f[_0x41edc6(0x1f5)])?_0x4864a5[_0x41edc6(0x256)]=_0x13f102:_0x4864a5['rightValue']=_0x13f102;}return _0x5a392f[_0x41edc6(0x259)]&&(_0x4864a5[_0x41edc6(0x259)]=_0x5a392f[_0x41edc6(0x259)]),_0x4864a5;}function mapYamlOperatorType(_0x2d4f49){return _0x2d4f49;}export function toYamlString(_0x3ba3e0){const _0x500fce=a102_0x2f61,_0x45b735=JSON['parse'](JSON[_0x500fce(0x214)](_0x3ba3e0)),_0x27e5aa=a102_0x48e21f[_0x500fce(0x214)](_0x45b735,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x500fce(0x1eb)}),_0x3a52ae=[_0x500fce(0x25e)];let _0x481d78=_0x27e5aa;for(const _0x4ea191 of _0x3a52ae){_0x481d78=_0x481d78[_0x500fce(0x233)](new RegExp('^('+_0x4ea191+')','m'),(_0x5a380d,_0x47a0c3,_0x31b330)=>{if(_0x31b330===0x0||_0x481d78[_0x31b330-0x1]==='\x0a'&&_0x481d78[_0x31b330-0x2]==='\x0a')return _0x47a0c3;return'\x0a'+_0x47a0c3;});}return _0x481d78;}export function parseYamlString(_0x4417b2){const _0x5a3e01=a102_0x2f61,_0x5625cc=a102_0x48e21f[_0x5a3e01(0x23b)](_0x4417b2);if(!_0x5625cc[_0x5a3e01(0x1fb)])throw new Error(_0x5a3e01(0x24a));if(_0x5625cc[_0x5a3e01(0x1f5)]&&_0x5625cc[_0x5a3e01(0x1f5)]!==_0x5a3e01(0x1f3))throw new Error(_0x5a3e01(0x251)+_0x5625cc[_0x5a3e01(0x1f5)]);return _0x5625cc;}export function isSegmentYaml(_0x4c077f){const _0x1ac11a=a102_0x2f61;if(typeof _0x4c077f!=='object'||_0x4c077f===null)return![];const _0x4e6051=_0x4c077f;return _0x4e6051[_0x1ac11a(0x1f5)]===_0x1ac11a(0x1f3)||_0x4e6051[_0x1ac11a(0x1f5)]===undefined;}export function generateTemplate(_0x55db3a='New\x20Segment'){const _0x4c1f3c=a102_0x2f61,_0x5cbc4b={'type':_0x4c1f3c(0x1f3),'name':_0x55db3a,'description':_0x4c1f3c(0x1f8),'rule':{'type':_0x4c1f3c(0x22d),'conditions':[{'type':_0x4c1f3c(0x26c),'attribute':_0x4c1f3c(0x26e),'operator':{'type':_0x4c1f3c(0x258),'value':'value'}}]}};return toYamlString(_0x5cbc4b);}function a102_0x3587(){const _0x5505f9=['max','Equal','unit','entries','duration','getSchema','columns','rule:','usedNames','string','9630XnMkZK','\x0a\x0aAvailable\x20fields:\x0a','schedule','limit','3295HWFvno','3223818wFuaBc','resolveSegmentName','notifyOn','repeatSubFrequency','behavior','connection','Value','joinStrategy','attribute_name','operator','attributes','get','behavior_table','all_columns','activationTemplateId','source','connectionId','connectionNameToIdMap','INVALID_ARGUMENT','isArray','Invalid\x20connector_config\x20for\x20activation\x20\x22','null','165599AgsUaL','CONNECTION_NOT_FOUND','from','formatting','joinRow','repeatFrequency','conditions','segment','has','type','notification','map','Segment\x20description','exclude','min','name','allColumns','activations','join_row','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','TimeWithinNext','__SEGMENT_REF__','length','JOURNEY_SYNTAX_ERROR','repeatUnit','syndicationBehavior','start_at','description','kind','notify_on','values','repeat_sub_frequency','startAt','keys','all','rightValues','2329398NwDqLp','batch','repeat_frequency','Please\x20specify\x20a\x20valid\x20attribute\x20name.','stringify','activation_template_id','timezone','warn','filter','aggregation','code','test','].attribute\x20cannot\x20be\x20empty.\x0a','end_on','localeCompare','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','realtime','Unknown\x20email\x20recipient:\x20','arrayMatching','forEach','object','CONNECTOR_SCHEMA_NOT_FOUND','connector_config','not','connector_config\x20for\x20activation\x20\x22','ruleHashToName','activations:','visible','activationParams','And','funnel_stage','rightValue','4716KamcIo','order_by','scheduleType','replace','push','any','repeat_unit','TimeWithinPast','attribute','1198466iUSBzm','684trnPRK','parse','join_strategy','Reference','connectionNameToTypeMap','behaviorTableName','valid','\x27:\x20','connectorConfig','isVisible','folder','emailRecipients','orderBy','rule','endOn','include','YAML\x20config\x20missing\x20required\x20field:\x20name','32lbKmqb','set','leftValue','localRuleToName','email_recipients','visibility','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','conditions[','1226516PLVfFb','CONNECTOR_INVALID_CONFIG','groupingColumns','value'];a102_0x3587=function(){return _0x5505f9;};return a102_0x3587();}export function segmentToYamlString(_0x1aae30){const _0x12e3da=a102_0x2f61,_0x2078f8=JSON[_0x12e3da(0x23b)](JSON['stringify'](_0x1aae30)),_0x36b0a8=a102_0x48e21f[_0x12e3da(0x214)](_0x2078f8,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x39dac1=[_0x12e3da(0x25e),_0x12e3da(0x22a)];let _0x2e290f=_0x36b0a8;for(const _0x3058f6 of _0x39dac1){_0x2e290f=_0x2e290f['replace'](new RegExp('^('+_0x3058f6+')','m'),(_0x4d5deb,_0x4b28d7,_0x34ef46)=>{if(_0x34ef46===0x0||_0x2e290f[_0x34ef46-0x1]==='\x0a'&&_0x2e290f[_0x34ef46-0x2]==='\x0a')return _0x4b28d7;return'\x0a'+_0x4b28d7;});}return _0x2e290f;}function a102_0x2f61(_0x35d1a3,_0x4b949b){_0x35d1a3=_0x35d1a3-0x1e3;const _0x35876a=a102_0x3587();let _0x2f61df=_0x35876a[_0x35d1a3];return _0x2f61df;}export function parseSegmentYamlFile(_0x4c0f66){const _0x368e45=a102_0x2f61,_0x32c2a0=a102_0x48e21f['parse'](_0x4c0f66);if(!_0x32c2a0[_0x368e45(0x1fb)])throw new Error(_0x368e45(0x24a));return _0x32c2a0;}export function normalizeChildSegmentYaml(_0x52c289){const _0x145ab3=a102_0x2f61;return{'type':_0x145ab3(0x1f3),'name':_0x52c289[_0x145ab3(0x1fb)],..._0x52c289[_0x145ab3(0x207)]!==undefined&&{'description':_0x52c289[_0x145ab3(0x207)]},..._0x52c289['folder']!==undefined&&{'folder':_0x52c289[_0x145ab3(0x244)]},..._0x52c289[_0x145ab3(0x247)]&&{'rule':normalizeRule(_0x52c289['rule'])},..._0x52c289[_0x145ab3(0x208)]!==undefined&&{'kind':_0x52c289[_0x145ab3(0x208)]},..._0x52c289[_0x145ab3(0x22b)]!==undefined&&{'visible':_0x52c289['visible']},..._0x52c289[_0x145ab3(0x1fd)]&&{'activations':_0x52c289[_0x145ab3(0x1fd)][_0x145ab3(0x1f7)](normalizeActivation)}};}export function normalizeRule(_0x3114da){const _0xf808af=a102_0x2f61;return{'type':_0x3114da[_0xf808af(0x1f5)],'conditions':_0x3114da['conditions']['map'](normalizeCondition),..._0x3114da[_0xf808af(0x207)]!==undefined&&{'description':_0x3114da[_0xf808af(0x207)]}};}function normalizeCondition(_0x301138){const _0x5dd1a3=a102_0x2f61;if(_0x5dd1a3(0x1f3)in _0x301138&&(_0x301138[_0x5dd1a3(0x1f5)]==='include'||_0x301138['type']==='exclude')){const _0x3a630c=_0x301138;return{'type':_0x3a630c[_0x5dd1a3(0x1f5)],'segment':_0x3a630c[_0x5dd1a3(0x1f3)]};}if(_0x5dd1a3(0x1f5)in _0x301138&&(_0x301138[_0x5dd1a3(0x1f5)]===_0x5dd1a3(0x22d)||_0x301138[_0x5dd1a3(0x1f5)]==='Or')){const _0x3bab60=_0x301138;return{'type':_0x3bab60[_0x5dd1a3(0x1f5)],'conditions':_0x3bab60[_0x5dd1a3(0x1f2)][_0x5dd1a3(0x1f7)](normalizeCondition),..._0x3bab60[_0x5dd1a3(0x207)]!==undefined&&{'description':_0x3bab60[_0x5dd1a3(0x207)]}};}const _0x53df93=_0x301138;return{'type':_0x5dd1a3(0x26c),'attribute':_0x53df93[_0x5dd1a3(0x238)],'operator':normalizeOperator(_0x53df93[_0x5dd1a3(0x26f)]),..._0x53df93['arrayMatching']!==undefined&&{'arrayMatching':_0x53df93[_0x5dd1a3(0x222)]},..._0x53df93[_0x5dd1a3(0x1f9)]!==undefined&&{'exclude':_0x53df93['exclude']},..._0x53df93[_0x5dd1a3(0x219)]!==undefined&&{'aggregation':_0x53df93[_0x5dd1a3(0x219)]},..._0x53df93[_0x5dd1a3(0x1e5)]!==undefined&&{'source':_0x53df93[_0x5dd1a3(0x1e5)]},..._0x53df93[_0x5dd1a3(0x218)]!==undefined&&{'filter':normalizeRule(_0x53df93[_0x5dd1a3(0x218)])},..._0x53df93[_0x5dd1a3(0x264)]!==undefined&&{'limit':_0x53df93['limit']}};}function normalizeOperator(_0x1c318d){const _0x3dda3f=a102_0x2f61,_0x5d5cb7=getEffectiveValue(_0x1c318d);return{'type':_0x1c318d['type'],..._0x1c318d[_0x3dda3f(0x227)]!==undefined&&{'not':_0x1c318d[_0x3dda3f(0x227)]},..._0x5d5cb7!==undefined&&{'value':_0x5d5cb7},..._0x1c318d[_0x3dda3f(0x1fa)]!==undefined&&{'min':_0x1c318d['min']},..._0x1c318d[_0x3dda3f(0x257)]!==undefined&&{'max':_0x1c318d[_0x3dda3f(0x257)]},..._0x1c318d[_0x3dda3f(0x259)]!==undefined&&{'unit':_0x1c318d['unit']},..._0x1c318d[_0x3dda3f(0x25b)]!==undefined&&{'duration':_0x1c318d[_0x3dda3f(0x25b)]},..._0x1c318d[_0x3dda3f(0x1ee)]!==undefined&&{'from':_0x1c318d['from']}};}function normalizeActivation(_0x284240){const _0x336466=a102_0x2f61;return{'name':_0x284240[_0x336466(0x1fb)],'connection':_0x284240[_0x336466(0x26b)],..._0x284240[_0x336466(0x207)]!==undefined&&{'description':_0x284240[_0x336466(0x207)]},..._0x284240[_0x336466(0x1e3)]!==undefined&&{'all_columns':_0x284240[_0x336466(0x1e3)]},..._0x284240[_0x336466(0x25d)]!==undefined&&{'columns':_0x284240[_0x336466(0x25d)]},..._0x284240[_0x336466(0x26a)]!==undefined&&{'behavior':_0x284240[_0x336466(0x26a)]},..._0x284240[_0x336466(0x263)]!==undefined&&{'schedule':_0x284240['schedule']},..._0x284240['notification']!==undefined&&{'notification':_0x284240[_0x336466(0x1f6)]},..._0x284240['connector_config']!==undefined&&{'connector_config':_0x284240[_0x336466(0x226)]},..._0x284240[_0x336466(0x215)]!==undefined&&{'activation_template_id':_0x284240[_0x336466(0x215)]}};}export function activationResponseToDef(_0x46d156,_0x221086,_0x2389d2){const _0x57aeb6=a102_0x2f61,_0xc15ef9=_0x46d156[_0x57aeb6(0x1e6)]||'',_0x24c51a=_0x2389d2?.[_0x57aeb6(0x271)](_0xc15ef9)??_0xc15ef9,_0x2efd02={'name':_0x46d156['name'],'connection':_0x24c51a};_0x46d156[_0x57aeb6(0x207)]&&(_0x2efd02[_0x57aeb6(0x207)]=_0x46d156[_0x57aeb6(0x207)]);let _0x10cd46=[];_0x46d156['columns']&&_0x46d156[_0x57aeb6(0x25d)][_0x57aeb6(0x202)]>0x0&&(_0x10cd46=_0x46d156[_0x57aeb6(0x25d)][_0x57aeb6(0x218)](_0x4a3911=>_0x4a3911&&_0x4a3911[_0x57aeb6(0x1fb)])['map'](_0x19995d=>{const _0x5967b9=_0x57aeb6;if(_0x19995d[_0x5967b9(0x1f5)]||_0x19995d[_0x5967b9(0x250)])return{'name':_0x19995d['name'],..._0x19995d['type']&&{'type':_0x19995d['type']},..._0x19995d['visibility']&&{'visibility':_0x19995d[_0x5967b9(0x250)]}};return _0x19995d[_0x5967b9(0x1fb)];}));_0x10cd46[_0x57aeb6(0x202)]>0x0&&(_0x2efd02[_0x57aeb6(0x25d)]=_0x10cd46);_0x46d156[_0x57aeb6(0x1fc)]!==undefined&&(_0x46d156[_0x57aeb6(0x1fc)]===![]&&_0x10cd46[_0x57aeb6(0x202)]===0x0?_0x2efd02['all_columns']=!![]:_0x2efd02['all_columns']=_0x46d156['allColumns']);const _0x2536e5={};let _0x147834=![];_0x46d156[_0x57aeb6(0x232)]&&(_0x2536e5['type']=_0x46d156[_0x57aeb6(0x232)],_0x147834=!![]);_0x46d156[_0x57aeb6(0x204)]&&(_0x2536e5[_0x57aeb6(0x236)]=_0x46d156[_0x57aeb6(0x204)],_0x147834=!![]);_0x46d156[_0x57aeb6(0x1f1)]!==undefined&&_0x46d156[_0x57aeb6(0x1f1)]!==null&&(_0x2536e5['repeat_frequency']=_0x46d156[_0x57aeb6(0x1f1)],_0x147834=!![]);_0x46d156[_0x57aeb6(0x269)]&&_0x46d156[_0x57aeb6(0x269)]['length']>0x0&&(_0x2536e5[_0x57aeb6(0x20b)]=_0x46d156[_0x57aeb6(0x269)],_0x147834=!![]);_0x46d156[_0x57aeb6(0x20c)]!==undefined&&(_0x2536e5[_0x57aeb6(0x206)]=_0x46d156[_0x57aeb6(0x20c)],_0x147834=!![]);_0x46d156[_0x57aeb6(0x248)]!==undefined&&(_0x2536e5[_0x57aeb6(0x21d)]=_0x46d156[_0x57aeb6(0x248)],_0x147834=!![]);_0x46d156[_0x57aeb6(0x216)]&&(_0x2536e5[_0x57aeb6(0x216)]=_0x46d156[_0x57aeb6(0x216)],_0x147834=!![]);_0x147834&&(_0x2efd02[_0x57aeb6(0x263)]=_0x2536e5);(_0x46d156[_0x57aeb6(0x268)]&&_0x46d156[_0x57aeb6(0x268)][_0x57aeb6(0x202)]>0x0||_0x46d156[_0x57aeb6(0x245)]&&_0x46d156[_0x57aeb6(0x245)][_0x57aeb6(0x202)]>0x0)&&(_0x2efd02['notification']={},_0x46d156[_0x57aeb6(0x268)]&&_0x46d156[_0x57aeb6(0x268)][_0x57aeb6(0x202)]>0x0&&(_0x2efd02[_0x57aeb6(0x1f6)][_0x57aeb6(0x209)]=_0x46d156['notifyOn']),_0x46d156[_0x57aeb6(0x245)]&&_0x46d156['emailRecipients']['length']>0x0&&(_0x2efd02[_0x57aeb6(0x1f6)][_0x57aeb6(0x24f)]=_0x46d156[_0x57aeb6(0x245)][_0x57aeb6(0x1f7)](_0x1db8d5=>{const _0x50a319=_0x221086?.['get'](_0x1db8d5);return _0x50a319??String(_0x1db8d5);})));_0x46d156[_0x57aeb6(0x242)]&&Object[_0x57aeb6(0x20d)](_0x46d156[_0x57aeb6(0x242)])[_0x57aeb6(0x202)]>0x0&&(_0x2efd02[_0x57aeb6(0x226)]=normalizeConnectorConfigForYaml(_0x46d156['connectorConfig']));_0x46d156[_0x57aeb6(0x1e4)]&&(_0x2efd02['activation_template_id']=_0x46d156['activationTemplateId']);if(_0x46d156[_0x57aeb6(0x205)]){const _0x47a934={},_0x15d9ed=_0x46d156[_0x57aeb6(0x205)];_0x15d9ed[_0x57aeb6(0x25d)]&&_0x15d9ed[_0x57aeb6(0x25d)][_0x57aeb6(0x202)]>0x0&&(_0x47a934[_0x57aeb6(0x25d)]=_0x15d9ed[_0x57aeb6(0x25d)]['filter'](_0x4d15d0=>_0x4d15d0&&_0x4d15d0['name'])[_0x57aeb6(0x1f7)](_0x1cef34=>({'name':_0x1cef34[_0x57aeb6(0x1fb)],..._0x1cef34[_0x57aeb6(0x1f5)]&&{'type':_0x1cef34[_0x57aeb6(0x1f5)]},..._0x1cef34['visibility']&&{'visibility':_0x1cef34['visibility']}}))),_0x15d9ed[_0x57aeb6(0x23f)]&&(_0x47a934[_0x57aeb6(0x272)]=_0x15d9ed[_0x57aeb6(0x23f)]),_0x15d9ed[_0x57aeb6(0x1f0)]!==undefined&&(_0x47a934[_0x57aeb6(0x1fe)]=_0x15d9ed['joinRow']),_0x15d9ed[_0x57aeb6(0x26d)]&&(_0x47a934[_0x57aeb6(0x23c)]=_0x15d9ed[_0x57aeb6(0x26d)]),_0x15d9ed['formatting']&&(_0x47a934[_0x57aeb6(0x1ef)]=_0x15d9ed[_0x57aeb6(0x1ef)]),_0x15d9ed['orderBy']&&_0x15d9ed[_0x57aeb6(0x246)][_0x57aeb6(0x202)]>0x0&&(_0x47a934[_0x57aeb6(0x231)]=_0x15d9ed['orderBy']),Object[_0x57aeb6(0x20d)](_0x47a934)[_0x57aeb6(0x202)]>0x0&&(_0x2efd02[_0x57aeb6(0x26a)]=_0x47a934);}return _0x2efd02;}export function journeyActivationStepToYaml(_0x323e21,_0x3a5eca,_0x3bd88a){const _0x376ffa=a102_0x2f61,_0x4d4aa5=_0x323e21[_0x376ffa(0x270)][_0x376ffa(0x22c)],_0x5e60f7=_0x4d4aa5[_0x376ffa(0x1e6)]||'',_0x1dfa7c=_0x3bd88a?.[_0x376ffa(0x271)](_0x5e60f7)??_0x5e60f7,_0x1f3eb4={'name':_0x4d4aa5[_0x376ffa(0x1fb)]||'','connection':_0x1dfa7c};_0x4d4aa5[_0x376ffa(0x207)]&&(_0x1f3eb4['description']=_0x4d4aa5[_0x376ffa(0x207)]);let _0x1e0903=[];_0x4d4aa5['columns']&&_0x4d4aa5[_0x376ffa(0x25d)]['length']>0x0&&(_0x1e0903=_0x4d4aa5[_0x376ffa(0x25d)][_0x376ffa(0x218)](_0x550fb6=>_0x550fb6&&_0x550fb6[_0x376ffa(0x1fb)])[_0x376ffa(0x1f7)](_0x1bb14c=>{const _0x181b0d=_0x376ffa;if(_0x1bb14c[_0x181b0d(0x1f5)]||_0x1bb14c[_0x181b0d(0x250)])return{'name':_0x1bb14c[_0x181b0d(0x1fb)],..._0x1bb14c[_0x181b0d(0x1f5)]&&{'type':_0x1bb14c[_0x181b0d(0x1f5)]},..._0x1bb14c[_0x181b0d(0x250)]&&{'visibility':_0x1bb14c['visibility']}};return _0x1bb14c[_0x181b0d(0x1fb)];}));_0x1e0903[_0x376ffa(0x202)]>0x0&&(_0x1f3eb4[_0x376ffa(0x25d)]=_0x1e0903);_0x4d4aa5[_0x376ffa(0x1fc)]!==undefined&&(_0x4d4aa5['allColumns']===![]&&_0x1e0903[_0x376ffa(0x202)]===0x0?_0x1f3eb4['all_columns']=!![]:_0x1f3eb4['all_columns']=_0x4d4aa5[_0x376ffa(0x1fc)]);const _0x355787={};let _0x47f9e6=![];_0x4d4aa5['scheduleType']&&(_0x355787[_0x376ffa(0x1f5)]=_0x4d4aa5[_0x376ffa(0x232)],_0x47f9e6=!![]);_0x4d4aa5[_0x376ffa(0x204)]&&(_0x355787[_0x376ffa(0x236)]=_0x4d4aa5[_0x376ffa(0x204)],_0x47f9e6=!![]);_0x4d4aa5[_0x376ffa(0x1f1)]!==undefined&&_0x4d4aa5[_0x376ffa(0x1f1)]!==null&&(_0x355787['repeat_frequency']=_0x4d4aa5[_0x376ffa(0x1f1)],_0x47f9e6=!![]);_0x4d4aa5[_0x376ffa(0x20c)]!==undefined&&(_0x355787['start_at']=_0x4d4aa5['startAt'],_0x47f9e6=!![]);_0x4d4aa5[_0x376ffa(0x248)]!==undefined&&(_0x355787[_0x376ffa(0x21d)]=_0x4d4aa5[_0x376ffa(0x248)],_0x47f9e6=!![]);_0x4d4aa5[_0x376ffa(0x216)]&&(_0x355787['timezone']=_0x4d4aa5[_0x376ffa(0x216)],_0x47f9e6=!![]);_0x47f9e6&&(_0x1f3eb4[_0x376ffa(0x263)]=_0x355787);(_0x4d4aa5[_0x376ffa(0x268)]&&_0x4d4aa5[_0x376ffa(0x268)][_0x376ffa(0x202)]>0x0||_0x4d4aa5['emailRecipients']&&_0x4d4aa5['emailRecipients'][_0x376ffa(0x202)]>0x0)&&(_0x1f3eb4[_0x376ffa(0x1f6)]={},_0x4d4aa5[_0x376ffa(0x268)]&&_0x4d4aa5[_0x376ffa(0x268)][_0x376ffa(0x202)]>0x0&&(_0x1f3eb4[_0x376ffa(0x1f6)][_0x376ffa(0x209)]=_0x4d4aa5[_0x376ffa(0x268)]),_0x4d4aa5[_0x376ffa(0x245)]&&_0x4d4aa5[_0x376ffa(0x245)][_0x376ffa(0x202)]>0x0&&(_0x1f3eb4[_0x376ffa(0x1f6)][_0x376ffa(0x24f)]=_0x4d4aa5[_0x376ffa(0x245)][_0x376ffa(0x1f7)](_0x5d1eb7=>{const _0x51014a=_0x376ffa,_0x3020d5=_0x3a5eca?.[_0x51014a(0x271)](_0x5d1eb7);return _0x3020d5??String(_0x5d1eb7);})));_0x4d4aa5[_0x376ffa(0x242)]&&Object[_0x376ffa(0x20d)](_0x4d4aa5[_0x376ffa(0x242)])['length']>0x0&&(_0x1f3eb4['connector_config']=normalizeConnectorConfigForYaml(_0x4d4aa5[_0x376ffa(0x242)]));_0x4d4aa5[_0x376ffa(0x1e4)]&&(_0x1f3eb4[_0x376ffa(0x215)]=_0x4d4aa5[_0x376ffa(0x1e4)]);if(_0x4d4aa5[_0x376ffa(0x205)]){const _0x440813={},_0x26e2e1=_0x4d4aa5[_0x376ffa(0x205)];_0x26e2e1[_0x376ffa(0x25d)]&&_0x26e2e1[_0x376ffa(0x25d)]['length']>0x0&&(_0x440813[_0x376ffa(0x25d)]=_0x26e2e1[_0x376ffa(0x25d)][_0x376ffa(0x218)](_0xf6e9f5=>_0xf6e9f5&&_0xf6e9f5[_0x376ffa(0x1fb)])[_0x376ffa(0x1f7)](_0x3b5121=>({'name':_0x3b5121[_0x376ffa(0x1fb)],..._0x3b5121[_0x376ffa(0x1f5)]&&{'type':_0x3b5121[_0x376ffa(0x1f5)]},..._0x3b5121['visibility']&&{'visibility':_0x3b5121[_0x376ffa(0x250)]}}))),_0x26e2e1[_0x376ffa(0x23f)]&&(_0x440813['behavior_table']=_0x26e2e1[_0x376ffa(0x23f)]),_0x26e2e1[_0x376ffa(0x1f0)]!==undefined&&(_0x440813['join_row']=_0x26e2e1[_0x376ffa(0x1f0)]),_0x26e2e1['joinStrategy']&&(_0x440813[_0x376ffa(0x23c)]=_0x26e2e1[_0x376ffa(0x26d)]),_0x26e2e1[_0x376ffa(0x1ef)]&&(_0x440813[_0x376ffa(0x1ef)]=_0x26e2e1[_0x376ffa(0x1ef)]),_0x26e2e1['orderBy']&&_0x26e2e1['orderBy'][_0x376ffa(0x202)]>0x0&&(_0x440813[_0x376ffa(0x231)]=_0x26e2e1['orderBy']),Object[_0x376ffa(0x20d)](_0x440813)[_0x376ffa(0x202)]>0x0&&(_0x1f3eb4[_0x376ffa(0x26a)]=_0x440813);}return _0x1f3eb4;}export function segmentWithActivationsToYaml(_0x4bf7d8,_0x97d42e,_0x11c82b,_0xb35f58,_0x160f94){const _0x5c30d4=a102_0x2f61,_0x21fdb1=segmentResponseToDefSync(_0x4bf7d8,_0x11c82b);return _0x97d42e[_0x5c30d4(0x202)]>0x0&&(_0x21fdb1['activations']=_0x97d42e[_0x5c30d4(0x1f7)](_0x3f1fa3=>activationResponseToDef(_0x3f1fa3,_0xb35f58,_0x160f94))),_0x21fdb1;}function normalizeColumn(_0x59f5eb){const _0x46f603=a102_0x2f61;if(typeof _0x59f5eb===_0x46f603(0x260))return{'name':_0x59f5eb};return{'name':_0x59f5eb[_0x46f603(0x1fb)],..._0x59f5eb[_0x46f603(0x1f5)]&&{'type':_0x59f5eb[_0x46f603(0x1f5)]},..._0x59f5eb[_0x46f603(0x250)]&&{'visibility':_0x59f5eb['visibility']}};}export async function activationDefToCreateRequest(_0x2d9aea,_0x388ff7){const _0x2e6bfb=a102_0x2f61,_0x5a5eec=_0x388ff7?.['emailToIdMap'],_0x23c7d6=_0x388ff7?.[_0x2e6bfb(0x1e7)],_0x21c70f=_0x2d9aea[_0x2e6bfb(0x26b)];let _0x29af79;const _0x5cfca8=parseInt(_0x21c70f,0xa);if(!isNaN(_0x5cfca8)&&String(_0x5cfca8)===_0x21c70f)_0x29af79=_0x5cfca8;else{const _0x35c006=_0x23c7d6?.[_0x2e6bfb(0x271)](_0x21c70f);if(_0x35c006===undefined)throw new SDKError(ErrorCode[_0x2e6bfb(0x1ed)],'Unknown\x20connection:\x20'+_0x21c70f,undefined,{'helpText':_0x2e6bfb(0x21f)});_0x29af79=_0x35c006;}const _0x23a5c7={'name':_0x2d9aea[_0x2e6bfb(0x1fb)],'connectionId':_0x29af79};_0x2d9aea[_0x2e6bfb(0x207)]&&(_0x23a5c7[_0x2e6bfb(0x207)]=_0x2d9aea[_0x2e6bfb(0x207)]);let _0x3fc67b=[];_0x2d9aea['columns']&&_0x2d9aea['columns'][_0x2e6bfb(0x202)]>0x0&&(_0x3fc67b=_0x2d9aea[_0x2e6bfb(0x25d)]['filter'](_0x32c4c4=>_0x32c4c4!=null)[_0x2e6bfb(0x1f7)](normalizeColumn));_0x3fc67b[_0x2e6bfb(0x202)]>0x0&&(_0x23a5c7[_0x2e6bfb(0x25d)]=_0x3fc67b);_0x2d9aea[_0x2e6bfb(0x1e3)]!==undefined&&(_0x2d9aea['all_columns']===![]&&_0x3fc67b[_0x2e6bfb(0x202)]===0x0?_0x23a5c7[_0x2e6bfb(0x1fc)]=!![]:_0x23a5c7[_0x2e6bfb(0x1fc)]=_0x2d9aea['all_columns']);if(_0x2d9aea[_0x2e6bfb(0x263)]){const _0x410956=_0x2d9aea[_0x2e6bfb(0x263)];_0x410956[_0x2e6bfb(0x1f5)]&&(_0x23a5c7[_0x2e6bfb(0x232)]=_0x410956[_0x2e6bfb(0x1f5)]),_0x410956[_0x2e6bfb(0x236)]&&(_0x23a5c7[_0x2e6bfb(0x204)]=_0x410956['repeat_unit']),_0x410956[_0x2e6bfb(0x212)]!==undefined&&(_0x23a5c7[_0x2e6bfb(0x1f1)]=_0x410956[_0x2e6bfb(0x212)]),_0x410956[_0x2e6bfb(0x20b)]&&(_0x23a5c7[_0x2e6bfb(0x269)]=_0x410956[_0x2e6bfb(0x20b)]),_0x410956[_0x2e6bfb(0x206)]!==undefined&&(_0x23a5c7[_0x2e6bfb(0x20c)]=_0x410956['start_at']),_0x410956[_0x2e6bfb(0x21d)]!==undefined&&(_0x23a5c7[_0x2e6bfb(0x248)]=_0x410956['end_on']),_0x410956[_0x2e6bfb(0x216)]&&(_0x23a5c7[_0x2e6bfb(0x216)]=_0x410956[_0x2e6bfb(0x216)]);}_0x2d9aea[_0x2e6bfb(0x1f6)]&&(_0x2d9aea[_0x2e6bfb(0x1f6)][_0x2e6bfb(0x209)]&&(_0x23a5c7[_0x2e6bfb(0x268)]=_0x2d9aea[_0x2e6bfb(0x1f6)][_0x2e6bfb(0x209)]),_0x2d9aea['notification'][_0x2e6bfb(0x24f)]&&(_0x23a5c7[_0x2e6bfb(0x245)]=_0x2d9aea[_0x2e6bfb(0x1f6)][_0x2e6bfb(0x24f)]['map'](_0x54ce74=>{const _0x25963c=_0x2e6bfb,_0x501e97=Number(_0x54ce74);if(!isNaN(_0x501e97)&&String(_0x501e97)===_0x54ce74)return _0x501e97;const _0x549c3f=_0x5a5eec?.['get'](_0x54ce74['toLowerCase']());if(_0x549c3f===undefined)throw new SDKError(ErrorCode[_0x25963c(0x1e8)],_0x25963c(0x221)+_0x54ce74+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x549c3f;})));if(_0x2d9aea[_0x2e6bfb(0x226)]){const _0xc5461c=_0x388ff7?.[_0x2e6bfb(0x23e)]?.[_0x2e6bfb(0x271)](_0x21c70f);if(_0xc5461c&&_0x388ff7?.['getSchema'])try{const _0x46b8f=await _0x388ff7[_0x2e6bfb(0x25c)](_0xc5461c),_0x4296c2=validateConnectorConfig(_0x2d9aea[_0x2e6bfb(0x226)],_0x46b8f);if(!_0x4296c2[_0x2e6bfb(0x240)])throw new SDKError(ErrorCode[_0x2e6bfb(0x254)],_0x2e6bfb(0x1ea)+_0x2d9aea[_0x2e6bfb(0x1fb)]+'\x22:\x0a'+formatValidationErrors(_0x4296c2['errors']),undefined,{'helpText':'Connector:\x20'+_0xc5461c+_0x2e6bfb(0x262)+formatSchemaAsHelp(_0x46b8f)});if(_0x4296c2['warnings'][_0x2e6bfb(0x202)]>0x0){const _0x53d1eb=formatValidationWarnings(_0x4296c2['warnings']);console[_0x2e6bfb(0x217)](_0x2e6bfb(0x228)+_0x2d9aea[_0x2e6bfb(0x1fb)]+'\x22:\x0a'+_0x53d1eb);}_0x23a5c7[_0x2e6bfb(0x242)]=transformConfigToLegacy(_0x2d9aea['connector_config'],_0x46b8f);}catch(_0x251a81){if(_0x251a81 instanceof SDKError&&_0x251a81[_0x2e6bfb(0x21a)]===ErrorCode[_0x2e6bfb(0x225)])_0x23a5c7[_0x2e6bfb(0x242)]=_0x2d9aea[_0x2e6bfb(0x226)];else throw _0x251a81;}else _0x23a5c7[_0x2e6bfb(0x242)]=_0x2d9aea[_0x2e6bfb(0x226)];}_0x2d9aea[_0x2e6bfb(0x215)]!==undefined&&(_0x23a5c7['activationTemplateId']=_0x2d9aea[_0x2e6bfb(0x215)]);if(_0x2d9aea['behavior']){const _0x1bfa52=_0x2d9aea['behavior'],_0x7f9e1e={};if(_0x1bfa52[_0x2e6bfb(0x25d)]&&_0x1bfa52[_0x2e6bfb(0x25d)][_0x2e6bfb(0x202)]>0x0){const _0x44e69b=_0x1bfa52['columns']['filter'](_0x246d59=>_0x246d59&&_0x246d59['name']);_0x44e69b[_0x2e6bfb(0x202)]>0x0&&(_0x7f9e1e[_0x2e6bfb(0x25d)]=_0x44e69b);}_0x1bfa52[_0x2e6bfb(0x272)]&&(_0x7f9e1e[_0x2e6bfb(0x23f)]=_0x1bfa52[_0x2e6bfb(0x272)]),_0x1bfa52[_0x2e6bfb(0x1fe)]!==undefined&&(_0x7f9e1e[_0x2e6bfb(0x1f0)]=_0x1bfa52[_0x2e6bfb(0x1fe)]),_0x1bfa52[_0x2e6bfb(0x23c)]&&(_0x7f9e1e[_0x2e6bfb(0x26d)]=_0x1bfa52[_0x2e6bfb(0x23c)]),_0x1bfa52['formatting']&&(_0x7f9e1e[_0x2e6bfb(0x1ef)]=_0x1bfa52[_0x2e6bfb(0x1ef)]),_0x1bfa52[_0x2e6bfb(0x231)]&&(_0x7f9e1e[_0x2e6bfb(0x246)]=_0x1bfa52['order_by']),_0x23a5c7[_0x2e6bfb(0x205)]=_0x7f9e1e;}return _0x23a5c7;}export async function activationDefToUpdateRequest(_0x1ddf10,_0x31ebfa){return activationDefToCreateRequest(_0x1ddf10,_0x31ebfa);}export function deepSortObject(_0x34a215){const _0x8c366d=a102_0x2f61;if(_0x34a215===null||typeof _0x34a215!==_0x8c366d(0x224))return _0x34a215;if(Array[_0x8c366d(0x1e9)](_0x34a215))return _0x34a215[_0x8c366d(0x1f7)](deepSortObject)['sort']((_0x24101a,_0x5a6772)=>JSON['stringify'](_0x24101a)[_0x8c366d(0x21e)](JSON[_0x8c366d(0x214)](_0x5a6772)));const _0x1d3631={};for(const _0xfe1f3f of Object[_0x8c366d(0x20d)](_0x34a215)['sort']()){_0x1d3631[_0xfe1f3f]=deepSortObject(_0x34a215[_0xfe1f3f]);}return _0x1d3631;}export function serializeRule(_0x1675cc){const _0x44d62b=a102_0x2f61;return JSON[_0x44d62b(0x214)](deepSortObject(_0x1675cc));}export function normalizeRuleForMatching(_0x431e82){return normalizeConditionsForMatching(_0x431e82);}function normalizeConditionsForMatching(_0x10593a){const _0x4efa56=a102_0x2f61;if(_0x10593a===null||typeof _0x10593a!==_0x4efa56(0x224))return _0x10593a;if(Array[_0x4efa56(0x1e9)](_0x10593a))return _0x10593a[_0x4efa56(0x1f7)](normalizeConditionsForMatching);const _0x4f4da5=_0x10593a;if((_0x4f4da5[_0x4efa56(0x1f5)]===_0x4efa56(0x249)||_0x4f4da5[_0x4efa56(0x1f5)]===_0x4efa56(0x1f9))&&typeof _0x4f4da5[_0x4efa56(0x1f3)]===_0x4efa56(0x260))return{..._0x4f4da5,'segment':_0x4efa56(0x201)};const _0x3cc912={};for(const _0x18ae71 of Object['keys'](_0x4f4da5)){_0x3cc912[_0x18ae71]=normalizeConditionsForMatching(_0x4f4da5[_0x18ae71]);}return _0x3cc912;}export function serializeRuleForMatching(_0xb52424){const _0x4e132a=a102_0x2f61;return JSON[_0x4e132a(0x214)](deepSortObject(normalizeRuleForMatching(_0xb52424)));}export function expandSegmentReferences(_0x16a2c4,_0x55a220,_0x1f50e0=new Set()){return expandConditions(_0x16a2c4,_0x55a220,_0x1f50e0);}function expandConditions(_0xed2149,_0x21add7,_0x33e04e){const _0x39ef00=a102_0x2f61;if(_0xed2149===null||typeof _0xed2149!=='object')return _0xed2149;if(Array[_0x39ef00(0x1e9)](_0xed2149))return _0xed2149[_0x39ef00(0x1f7)](_0x1f90e4=>expandConditions(_0x1f90e4,_0x21add7,_0x33e04e));const _0x2a7a8d=_0xed2149;if((_0x2a7a8d['type']===_0x39ef00(0x249)||_0x2a7a8d[_0x39ef00(0x1f5)]===_0x39ef00(0x1f9))&&typeof _0x2a7a8d[_0x39ef00(0x1f3)]===_0x39ef00(0x260)){const _0x17e207=_0x2a7a8d['segment'],_0x1168a2=_0x21add7[_0x39ef00(0x271)](_0x17e207);if(_0x1168a2&&!_0x33e04e['has'](_0x17e207)){const _0x249951=new Set(_0x33e04e);_0x249951['add'](_0x17e207);const _0x53afb6=expandConditions(_0x1168a2,_0x21add7,_0x249951);return{'type':_0x2a7a8d[_0x39ef00(0x1f5)],'expanded_rule':_0x53afb6};}return{'type':_0x2a7a8d['type'],'expanded_rule':'__UNRESOLVED__'};}const _0x3dcfb4={};for(const _0x496306 of Object[_0x39ef00(0x20d)](_0x2a7a8d)){_0x3dcfb4[_0x496306]=expandConditions(_0x2a7a8d[_0x496306],_0x21add7,_0x33e04e);}return _0x3dcfb4;}export function serializeExpandedRule(_0x554d67,_0x2c6809){const _0x4f13e9=a102_0x2f61,_0x1ff399=expandSegmentReferences(_0x554d67,_0x2c6809);return JSON[_0x4f13e9(0x214)](deepSortObject(_0x1ff399));}export function createSegmentNameContext(_0x4cd761){const _0x4297b6=a102_0x2f61,_0x61d907=new Set(),_0xaa2e94=new Map(),_0x18b1e6=new Map();if(_0x4cd761)for(const [_0x295a18,_0x38bb15]of Object[_0x4297b6(0x25a)](_0x4cd761)){if(_0x38bb15[_0x4297b6(0x247)]){const _0x4c96d7=serializeRule(_0x38bb15[_0x4297b6(0x247)]);_0x18b1e6[_0x4297b6(0x24c)](_0x4c96d7,_0x295a18),_0x61d907['add'](_0x295a18);}}return{'usedNames':_0x61d907,'ruleHashToName':_0xaa2e94,'localRuleToName':_0x4cd761?_0x18b1e6:undefined};}export function resolveSegmentName(_0x526c83,_0x299b1d,_0x49bf35,_0x57fdbc){const _0x6e6b08=a102_0x2f61,_0x5224e5=serializeRule(_0x299b1d);if(_0x49bf35[_0x6e6b08(0x24e)]){const _0x34f4c6=_0x49bf35[_0x6e6b08(0x24e)]['get'](_0x5224e5);if(_0x34f4c6)return{'name':_0x34f4c6,'isDuplicate':![],'isLocalMatch':!![]};}const _0x56c739=_0x49bf35[_0x6e6b08(0x229)][_0x6e6b08(0x271)](_0x5224e5);if(_0x56c739)return{'name':_0x56c739,'isDuplicate':!![],'isLocalMatch':![]};const _0x23b1ff=_0x57fdbc(_0x526c83);let _0x5f248c=_0x23b1ff||_0x526c83,_0x202c19=_0x5f248c,_0x4ebab2=0x2;while(_0x49bf35[_0x6e6b08(0x25f)][_0x6e6b08(0x1f4)](_0x202c19)){_0x202c19=_0x5f248c+'_'+_0x4ebab2,_0x4ebab2++;}return _0x49bf35[_0x6e6b08(0x25f)]['add'](_0x202c19),_0x49bf35['ruleHashToName'][_0x6e6b08(0x24c)](_0x5224e5,_0x202c19),{'name':_0x202c19,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x18de1a){const _0x2200ef=[],_0x5a35cb=_0x44d0f0=>{const _0x3a073d=a102_0x2f61;if(!_0x44d0f0||typeof _0x44d0f0!==_0x3a073d(0x224))return;if(Array[_0x3a073d(0x1e9)](_0x44d0f0)){_0x44d0f0[_0x3a073d(0x223)](_0x5a35cb);return;}const _0x8b952a=_0x44d0f0;(_0x8b952a[_0x3a073d(0x1f5)]===_0x3a073d(0x249)||_0x8b952a['type']===_0x3a073d(0x1f9))&&typeof _0x8b952a[_0x3a073d(0x1f3)]===_0x3a073d(0x260)&&_0x2200ef[_0x3a073d(0x234)](_0x8b952a[_0x3a073d(0x1f3)]);for(const _0x58a420 of Object[_0x3a073d(0x20a)](_0x8b952a)){_0x5a35cb(_0x58a420);}};return _0x5a35cb(_0x18de1a),_0x2200ef;}export function validateSegmentRule(_0x27b69e,_0x29f10e){const _0x139db0=a102_0x2f61;if(!_0x29f10e||!_0x29f10e[_0x139db0(0x1f2)])return;for(let _0x22b8b2=0x0;_0x22b8b2<_0x29f10e[_0x139db0(0x1f2)][_0x139db0(0x202)];_0x22b8b2++){const _0xfc283c=_0x29f10e[_0x139db0(0x1f2)][_0x22b8b2];if(_0x139db0(0x1f5)in _0xfc283c&&_0xfc283c['type']===_0x139db0(0x26c)){const _0x4afcc1=_0xfc283c;if(!_0x4afcc1[_0x139db0(0x238)]||_0x4afcc1[_0x139db0(0x238)]==='')throw new SDKError(ErrorCode[_0x139db0(0x203)],_0x139db0(0x1ff)+_0x27b69e+_0x139db0(0x241)+(_0x139db0(0x252)+_0x22b8b2+_0x139db0(0x21c))+_0x139db0(0x213));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37407d,_0x173c17){const _0x357522=a103_0x4987,_0x4c00e1=_0x37407d();while(!![]){try{const _0x5394e2=parseInt(_0x357522(0xf9))/0x1+parseInt(_0x357522(0x10c))/0x2+parseInt(_0x357522(0x103))/0x3*(-parseInt(_0x357522(0x10b))/0x4)+parseInt(_0x357522(0x10f))/0x5+-parseInt(_0x357522(0xfb))/0x6+parseInt(_0x357522(0x110))/0x7+parseInt(_0x357522(0x119))/0x8*(-parseInt(_0x357522(0xf0))/0x9);if(_0x5394e2===_0x173c17)break;else _0x4c00e1['push'](_0x4c00e1['shift']());}catch(_0x55c873){_0x4c00e1['push'](_0x4c00e1['shift']());}}}(a103_0x92b2,0x31acc));function a103_0x4987(_0x19f178,_0x2cbf10){_0x19f178=_0x19f178-0xe3;const _0x92b2a3=a103_0x92b2();let _0x49877f=_0x92b2a3[_0x19f178];return _0x49877f;}import a103_0x1715f5 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x4b2738){const _0x3fbdaf=a103_0x4987,_0x2a5571=_0x4b2738[_0x3fbdaf(0xe4)]['map'](_0x523c46=>({'column_name':_0x523c46['name'],'column_type':_0x523c46['type'],'null':_0x3fbdaf(0x116),'key':null,'default':null,'extra':null}));return{..._0x4b2738,'columns':[{'name':_0x3fbdaf(0x10e),'type':_0x3fbdaf(0x118)},{'name':_0x3fbdaf(0x101),'type':_0x3fbdaf(0x118)},{'name':_0x3fbdaf(0x10a),'type':_0x3fbdaf(0x118)},{'name':_0x3fbdaf(0x113),'type':_0x3fbdaf(0x118)},{'name':_0x3fbdaf(0xe3),'type':_0x3fbdaf(0x118)},{'name':_0x3fbdaf(0x112),'type':'varchar'}],'data':_0x2a5571};}function a103_0x92b2(){const _0x32458d=['push','slice','attribute','sort','270870LZbQeh','Fetching\x20schema...','2130468cXvLTT','SELECT\x20*\x20FROM\x20(\x0a','query','entries','Schema\x20query:\x0a','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','column_type','startsWith','8628napwdh','information_schema','groupingName','Behaviors','\x20\x20\x20\x20','setJobId','error','null','88BsRffK','332130Ctcvhy','filter','column_name','1050035ueYYDe','1942388tkZxkC','Unknown','extra','key','dim','fields','YES','size','varchar','302608UebOrU','data','default','columns','cyan','displayName','set','bold','execute','type','name','get','localeCompare','parentColumn','verbose','72iJKgNL','length','tableName','parentTableName','source'];a103_0x92b2=function(){return _0x32458d;};return a103_0x92b2();}export async function executeSchemaQuery(_0x331785,_0xf3b135,_0x21ecf3){const _0x1749f8=a103_0x4987,_0x10a9a3=_0x331785['trim']()['replace'](/;+$/,''),_0x5ddc6c=_0x1749f8(0xfc)+_0x10a9a3+_0x1749f8(0x100);_0x21ecf3[_0x1749f8(0xef)]&&console['error'](_0x1749f8(0xff)+_0x5ddc6c);const _0x5e91ad=await withProgressSpinner(_0x1749f8(0xfa),async _0x3bd811=>{const _0x4aac26=_0x1749f8,_0x4ea6ba=await _0xf3b135[_0x4aac26(0xfd)][_0x4aac26(0xe9)](_0x5ddc6c,{'catalog':'td','schema':_0x4aac26(0x104),'onJobId':_0x2887fb=>{const _0x56904f=_0x4aac26;_0x3bd811[_0x56904f(0x108)](_0x2887fb);}});return _0x4ea6ba;},{'verbose':_0x21ecf3[_0x1749f8(0xef)]});return buildSchemaResult(_0x5e91ad[_0x1749f8(0x11a)]);}export function displayFieldsHumanReadable(_0x581aa0,_0x14c12c){const _0x36530b=a103_0x4987,_0x38d4f1=_0x581aa0[_0x36530b(0x10d)](_0x5b3eb5=>_0x5b3eb5[_0x36530b(0xf4)]===_0x36530b(0xf7)),_0x2993a9=_0x581aa0[_0x36530b(0x10d)](_0x472dba=>_0x472dba[_0x36530b(0xf4)]==='behavior'),_0x31d1fb=new Map();for(const _0x5a6766 of _0x38d4f1){const _0x3cf48f=_0x5a6766[_0x36530b(0x105)]||_0x5a6766['parentTableName']||_0x36530b(0x111),_0x28d959=_0x31d1fb[_0x36530b(0xec)](_0x3cf48f);_0x28d959?_0x28d959[_0x36530b(0x115)][_0x36530b(0xf5)](_0x5a6766):_0x31d1fb[_0x36530b(0xe7)](_0x3cf48f,{'displayName':_0x3cf48f,'tableName':_0x5a6766[_0x36530b(0xf3)],'fields':[_0x5a6766]});}const _0x3523d7=new Map();for(const _0x42a876 of _0x2993a9){const _0x16eca8=_0x42a876['behaviorName']||_0x36530b(0x111),_0x28456e=_0x3523d7[_0x36530b(0xec)](_0x16eca8)||[];_0x28456e[_0x36530b(0xf5)](_0x42a876),_0x3523d7[_0x36530b(0xe7)](_0x16eca8,_0x28456e);}console[_0x36530b(0x109)]('\x0a'+a103_0x1715f5[_0x36530b(0xe8)](_0x14c12c));if(_0x31d1fb[_0x36530b(0x117)]>0x0){console['error']('\x0a'+a103_0x1715f5['dim']('Attributes'));const _0x80712a=[..._0x31d1fb['entries']()][_0x36530b(0xf8)]((_0x475d0b,_0x2b66ab)=>_0x475d0b[0x0][_0x36530b(0xed)](_0x2b66ab[0x0]));for(const [,_0x995990]of _0x80712a){const _0x243508=_0x995990[_0x36530b(0xf2)]&&_0x995990[_0x36530b(0xf2)]!==_0x995990[_0x36530b(0xe6)]?'\x20'+a103_0x1715f5[_0x36530b(0x114)]('('+_0x995990[_0x36530b(0xf2)]+')'):'';console[_0x36530b(0x109)]('\x20\x20'+a103_0x1715f5[_0x36530b(0xe8)](_0x995990[_0x36530b(0xe6)])+_0x243508);const _0x4208eb=[..._0x995990['fields']][_0x36530b(0xf8)]((_0x1191fa,_0x11b8de)=>_0x1191fa['name']['localeCompare'](_0x11b8de[_0x36530b(0xeb)]));for(const _0x48c949 of _0x4208eb){const _0x22b50b=_0x48c949['parentColumn']&&_0x48c949[_0x36530b(0xee)]!==_0x48c949[_0x36530b(0xeb)]?'\x20'+a103_0x1715f5[_0x36530b(0x114)]('('+_0x48c949[_0x36530b(0xee)]+')'):'';console[_0x36530b(0x109)](_0x36530b(0x107)+_0x48c949[_0x36530b(0xeb)]+_0x22b50b+':\x20'+a103_0x1715f5[_0x36530b(0xe5)](_0x48c949[_0x36530b(0xea)]));}}}if(_0x3523d7[_0x36530b(0x117)]>0x0){console['error']('\x0a'+a103_0x1715f5[_0x36530b(0x114)](_0x36530b(0x106)));const _0x280b6a=[..._0x3523d7[_0x36530b(0xfe)]()][_0x36530b(0xf8)]((_0x5d5a2,_0x51940c)=>_0x5d5a2[0x0]['localeCompare'](_0x51940c[0x0]));for(const [_0x4982dc,_0x4b44b8]of _0x280b6a){const _0x482943=_0x4b44b8[0x0],_0xaa5bf1=_0x482943?.[_0x36530b(0xf3)]||'';console[_0x36530b(0x109)]('\x20\x20'+a103_0x1715f5[_0x36530b(0xe8)](_0x4982dc)+(_0xaa5bf1?'\x20'+a103_0x1715f5[_0x36530b(0x114)]('('+_0xaa5bf1+')'):''));const _0x376dab=[..._0x4b44b8][_0x36530b(0xf8)]((_0x30c066,_0x1c42af)=>_0x30c066[_0x36530b(0xeb)]['localeCompare'](_0x1c42af[_0x36530b(0xeb)]));for(const _0x1e2f51 of _0x376dab){const _0x5a6d54=_0x1e2f51[_0x36530b(0xeb)][_0x36530b(0x102)](_0x4982dc+'.')?_0x1e2f51[_0x36530b(0xeb)][_0x36530b(0xf6)](_0x4982dc[_0x36530b(0xf1)]+0x1):_0x1e2f51['name'],_0x27bd0a=_0x1e2f51[_0x36530b(0xee)]&&_0x1e2f51['parentColumn']!==_0x5a6d54?'\x20'+a103_0x1715f5['dim']('('+_0x1e2f51[_0x36530b(0xee)]+')'):'';console[_0x36530b(0x109)](_0x36530b(0x107)+_0x5a6d54+_0x27bd0a+':\x20'+a103_0x1715f5[_0x36530b(0xe5)](_0x1e2f51[_0x36530b(0xea)]));}}}console[_0x36530b(0x109)]('');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x21b2f5,_0x476b56){const _0x2769b1=a104_0x67aa,_0x4e6e9c=_0x21b2f5();while(!![]){try{const _0x2a1c3a=parseInt(_0x2769b1(0x161))/0x1*(parseInt(_0x2769b1(0x163))/0x2)+-parseInt(_0x2769b1(0x160))/0x3+parseInt(_0x2769b1(0x16b))/0x4+-parseInt(_0x2769b1(0x15d))/0x5*(-parseInt(_0x2769b1(0x15f))/0x6)+-parseInt(_0x2769b1(0x158))/0x7*(-parseInt(_0x2769b1(0x168))/0x8)+parseInt(_0x2769b1(0x16c))/0x9+-parseInt(_0x2769b1(0x16a))/0xa*(parseInt(_0x2769b1(0x166))/0xb);if(_0x2a1c3a===_0x476b56)break;else _0x4e6e9c['push'](_0x4e6e9c['shift']());}catch(_0x5b6999){_0x4e6e9c['push'](_0x4e6e9c['shift']());}}}(a104_0x5694,0xd72c1));function a104_0x67aa(_0x10f391,_0x543472){_0x10f391=_0x10f391-0x158;const _0x569412=a104_0x5694();let _0x67aab7=_0x569412[_0x10f391];return _0x67aab7;}import{readdirSync,statSync}from'fs';import a104_0x516703 from'path';export function findYamlFiles(_0x53c8a5){const _0x575191=[];function _0x356514(_0x9c088e){const _0x14bd81=a104_0x67aa,_0x202112=readdirSync(_0x9c088e,{'withFileTypes':!![]});for(const _0x1d42aa of _0x202112){const _0x1ba553=a104_0x516703[_0x14bd81(0x162)](_0x9c088e,_0x1d42aa[_0x14bd81(0x15c)]);if(_0x1d42aa[_0x14bd81(0x15b)]())_0x356514(_0x1ba553);else(_0x1d42aa[_0x14bd81(0x15c)][_0x14bd81(0x15e)](_0x14bd81(0x16d))||_0x1d42aa['name'][_0x14bd81(0x15e)](_0x14bd81(0x15a)))&&_0x575191[_0x14bd81(0x169)](_0x1ba553);}}return _0x356514(_0x53c8a5),_0x575191;}function a104_0x5694(){const _0x3a1c73=['toLowerCase','relative','14068450xLOnCY','map','5176QLLkfL','push','10ytrQoe','1507448HggeYc','3995739EGsSur','.yml','2996pXjnwx','isFile','.yaml','isDirectory','name','5420GRGjye','endsWith','5232ogNMnD','2387547IttTSd','1EtIxEh','join','1826294uRdctV'];a104_0x5694=function(){return _0x3a1c73;};return a104_0x5694();}export function discoverYamlFiles(_0x5fbd97){const _0xa615ce=a104_0x67aa,_0x1e12ba=findYamlFiles(_0x5fbd97);return _0x1e12ba[_0xa615ce(0x167)](_0x261179=>{const _0x287938=_0xa615ce,_0x707709=a104_0x516703[_0x287938(0x165)](_0x5fbd97,_0x261179),_0x129c07=a104_0x516703['dirname'](_0x707709);return{'absolutePath':_0x261179,'relativePath':_0x707709,'folderPath':_0x129c07==='.'?'':_0x129c07};});}export function isYamlFile(_0x32e94a){const _0x1ff91d=a104_0x67aa;try{const _0x2c2b95=statSync(_0x32e94a);if(!_0x2c2b95[_0x1ff91d(0x159)]())return![];const _0x32ed31=a104_0x516703['extname'](_0x32e94a)[_0x1ff91d(0x164)]();return _0x32ed31===_0x1ff91d(0x16d)||_0x32ed31===_0x1ff91d(0x15a);}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x45a0a5,_0x1a83a2){const _0x411eea=a105_0x3ec6,_0x469907=_0x45a0a5();while(!![]){try{const _0x18b3d5=parseInt(_0x411eea(0x181))/0x1+parseInt(_0x411eea(0x1ab))/0x2*(parseInt(_0x411eea(0x1a7))/0x3)+parseInt(_0x411eea(0x17a))/0x4*(-parseInt(_0x411eea(0x19e))/0x5)+-parseInt(_0x411eea(0x162))/0x6+parseInt(_0x411eea(0x18d))/0x7+-parseInt(_0x411eea(0x174))/0x8*(parseInt(_0x411eea(0x192))/0x9)+parseInt(_0x411eea(0x177))/0xa;if(_0x18b3d5===_0x1a83a2)break;else _0x469907['push'](_0x469907['shift']());}catch(_0x551d43){_0x469907['push'](_0x469907['shift']());}}}(a105_0x2cbf,0x230dd));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0xb93f85){const _0x2ae32d=a105_0x3ec6;return _0xb93f85[_0x2ae32d(0x16d)]()['replace'](/\s+/g,'_')[_0x2ae32d(0x1b1)](/[^a-z0-9_]/g,'')[_0x2ae32d(0x1b1)](/_+/g,'_')['replace'](/^_|_$/g,'');}export function generateJourneyLocalName(_0x23c1f3){const _0x1fb3f9=a105_0x3ec6,_0x5a74fc=_0x23c1f3[_0x1fb3f9(0x1a2)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x5a74fc){const _0x46f64a=_0x5a74fc[0x1][_0x1fb3f9(0x16d)](),_0x492f7a=_0x5a74fc[0x2],_0x49abcd=_0x492f7a[_0x1fb3f9(0x1b1)](/-/g,'')[_0x1fb3f9(0x170)](0x0,0x4)[_0x1fb3f9(0x16d)]();return _0x46f64a+'_'+_0x49abcd;}const _0x5e393c=_0x23c1f3[_0x1fb3f9(0x1a2)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x5e393c){const _0x4f1c22=_0x5e393c[0x1],_0x434c0b=_0x5e393c[0x2][_0x1fb3f9(0x16d)](),_0x26e422=_0x4f1c22[_0x1fb3f9(0x1b1)](/-/g,'')[_0x1fb3f9(0x170)](0x0,0x4)[_0x1fb3f9(0x16d)]();return _0x434c0b+'_'+_0x26e422;}return undefined;}function stableStringify(_0x3ec355){const _0x49f447=a105_0x3ec6;if(Array[_0x49f447(0x1a3)](_0x3ec355))return'['+_0x3ec355[_0x49f447(0x189)](_0xc4e4e4=>stableStringify(_0xc4e4e4))['join'](',')+']';if(_0x3ec355&&typeof _0x3ec355===_0x49f447(0x184)){const _0x5be547=_0x3ec355,_0x276709=Object[_0x49f447(0x17e)](_0x5be547)[_0x49f447(0x1a9)](),_0x421b73=_0x276709['map'](_0x15d7be=>'\x22'+_0x15d7be+'\x22:'+stableStringify(_0x5be547[_0x15d7be]));return'{'+_0x421b73[_0x49f447(0x187)](',')+'}';}const _0x4565d6=JSON[_0x49f447(0x185)](_0x3ec355);return _0x4565d6===undefined?'null':_0x4565d6;}function a105_0x2cbf(){const _0x46a6f7=['1336482OvSYBN','from','condition','conditions','exclude','set','all_columns','startsWith','description','trim','rule','toLowerCase','.yaml','behavior','slice','branches','reentry','with','1967144PvOlYF','stages','include','3410250QokjHc','exit_criteria','draft','184276YRQsYY','state','columns','segments','keys','some','attributes','239956oIysuJ','.yml','get','object','stringify','values','join','entries','map','name','bundle_name','versions','618744AcRyPl','version','journeyStages','schedule','decision_point','9nTziti','length','activation_template_id','launched','segment','version_number','endsWith','journeyBundleName','latest','connection','max','connector_config','30mbWbpP','type','activation','item','match','isArray','merged','versionNumber','milestone','222vWAvXO','index','sort','bundle_id','5926btaxuT','find','entry_criteria','steps','has','notification','replace','goal','nameMapping','journeys','journey','push','yaml'];a105_0x2cbf=function(){return _0x46a6f7;};return a105_0x2cbf();}export function consolidateActivationsByContent(_0x538f5a){const _0x587db4=a105_0x3ec6,_0x4254df={},_0x3c3275=new Map(),_0x23b607=new Map();for(const _0x465f7c of _0x538f5a){if(!_0x465f7c)continue;for(const [_0x286ef1,_0x23a063]of Object['entries'](_0x465f7c)){const _0x3e35d8={'connection':_0x23a063[_0x587db4(0x19b)],..._0x23a063[_0x587db4(0x168)]!==undefined&&{'all_columns':_0x23a063[_0x587db4(0x168)]},..._0x23a063[_0x587db4(0x17c)]!==undefined&&{'columns':_0x23a063['columns']},..._0x23a063[_0x587db4(0x16f)]!==undefined&&{'behavior':_0x23a063[_0x587db4(0x16f)]},..._0x23a063[_0x587db4(0x190)]!==undefined&&{'schedule':_0x23a063['schedule']},..._0x23a063['notification']!==undefined&&{'notification':_0x23a063[_0x587db4(0x1b0)]},..._0x23a063[_0x587db4(0x19d)]!==undefined&&{'connector_config':_0x23a063[_0x587db4(0x19d)]},..._0x23a063[_0x587db4(0x194)]!==undefined&&{'activation_template_id':_0x23a063[_0x587db4(0x194)]}},_0x1f42f5=stableStringify(_0x3e35d8),_0x511867=_0x23b607[_0x587db4(0x183)](_0x1f42f5);_0x511867?_0x3c3275['set'](_0x286ef1,_0x511867):(_0x4254df[_0x286ef1]=_0x23a063,_0x3c3275[_0x587db4(0x167)](_0x286ef1,_0x286ef1),_0x23b607[_0x587db4(0x167)](_0x1f42f5,_0x286ef1));}}return{'merged':_0x4254df,'nameMapping':_0x3c3275};}export function updateActivationReferences(_0x1be947,_0x5aff25){const _0x4335ad=a105_0x3ec6;if(!_0x1be947)return;for(const _0x512e1a of _0x1be947){if(!_0x512e1a[_0x4335ad(0x1ae)])continue;for(const _0x254959 of _0x512e1a[_0x4335ad(0x1ae)]){if(_0x254959[_0x4335ad(0x19f)]===_0x4335ad(0x1a0)&&_0x254959[_0x4335ad(0x173)]?.[_0x4335ad(0x1a0)]){const _0x31fbaf=_0x5aff25[_0x4335ad(0x183)](_0x254959[_0x4335ad(0x173)]['activation']);_0x31fbaf&&_0x31fbaf!==_0x254959[_0x4335ad(0x173)][_0x4335ad(0x1a0)]&&(_0x254959[_0x4335ad(0x173)][_0x4335ad(0x1a0)]=_0x31fbaf);}}}}export function consolidateSegmentsByContent(_0x53ddd4,_0x3d43b2){const _0x36ade5=a105_0x3ec6,_0x5aeeba={},_0x300d73=new Map(),_0x3431fb=new Map();for(const _0xb89d82 of _0x53ddd4){if(!_0xb89d82)continue;for(const [_0x49fa32,_0x37a7a5]of Object['entries'](_0xb89d82)){if(!_0x37a7a5[_0x36ade5(0x16c)]){_0x5aeeba[_0x49fa32]=_0x37a7a5,_0x300d73[_0x36ade5(0x167)](_0x49fa32,_0x49fa32);continue;}const _0x4c7edb=_0x37a7a5['description']&&_0x37a7a5['description'][_0x36ade5(0x16b)]()?_0x37a7a5[_0x36ade5(0x16a)]:undefined,_0x47b36c=JSON[_0x36ade5(0x185)]({'description':_0x4c7edb,'rule':deepSortObject(_0x37a7a5[_0x36ade5(0x16c)])}),_0x4f093e=_0x3431fb[_0x36ade5(0x183)](_0x47b36c);if(_0x4f093e){const _0x360f4f={..._0x37a7a5[_0x36ade5(0x16a)]!==undefined&&{'description':_0x37a7a5['description']},'rule':_0x37a7a5[_0x36ade5(0x16c)]?deepSortObject(_0x37a7a5[_0x36ade5(0x16c)]):_0x37a7a5[_0x36ade5(0x16c)]};if(_0x49fa32<_0x4f093e){_0x5aeeba[_0x49fa32]=_0x360f4f,delete _0x5aeeba[_0x4f093e];for(const [_0x3bfe6c,_0x1f2a48]of _0x300d73[_0x36ade5(0x188)]()){_0x1f2a48===_0x4f093e&&_0x300d73['set'](_0x3bfe6c,_0x49fa32);}_0x300d73[_0x36ade5(0x167)](_0x49fa32,_0x49fa32),_0x3431fb[_0x36ade5(0x167)](_0x47b36c,_0x49fa32);}else _0x5aeeba[_0x4f093e]=_0x360f4f,_0x300d73[_0x36ade5(0x167)](_0x49fa32,_0x4f093e);}else{let _0x2f2a28=_0x49fa32;if(_0x3d43b2){const _0x4567fc=_0x3d43b2[_0x36ade5(0x183)](_0x47b36c);_0x4567fc&&_0x4567fc['length']>0x0&&(_0x2f2a28=_0x4567fc['slice']()['sort']()[0x0]);}const _0xd5210d={..._0x37a7a5['description']!==undefined&&{'description':_0x37a7a5[_0x36ade5(0x16a)]},'rule':_0x37a7a5['rule']?deepSortObject(_0x37a7a5['rule']):_0x37a7a5['rule']};_0x5aeeba[_0x2f2a28]=_0xd5210d,_0x300d73[_0x36ade5(0x167)](_0x49fa32,_0x2f2a28),_0x3431fb[_0x36ade5(0x167)](_0x47b36c,_0x2f2a28);}}}return{'merged':_0x5aeeba,'nameMapping':_0x300d73};}export function updateSegmentReferences(_0x67af28,_0x1448bd){const _0x10c993=a105_0x3ec6;if(!_0x67af28)return;for(const _0x388b46 of _0x67af28){if(_0x388b46[_0x10c993(0x1ad)]?.[_0x10c993(0x196)]){const _0x2cd158=_0x1448bd[_0x10c993(0x183)](_0x388b46[_0x10c993(0x1ad)][_0x10c993(0x196)]);_0x2cd158&&(_0x388b46[_0x10c993(0x1ad)]['segment']=_0x2cd158);}if(_0x388b46[_0x10c993(0x1ae)])for(const _0x39b9ca of _0x388b46[_0x10c993(0x1ae)]){if(_0x39b9ca[_0x10c993(0x19f)]==='decision_point'&&_0x39b9ca['with']?.[_0x10c993(0x171)])for(const _0xd510e0 of _0x39b9ca[_0x10c993(0x173)][_0x10c993(0x171)]){if(_0xd510e0[_0x10c993(0x196)]){const _0x177beb=_0x1448bd[_0x10c993(0x183)](_0xd510e0[_0x10c993(0x196)]);_0x177beb&&(_0xd510e0['segment']=_0x177beb);}}}}}function a105_0x3ec6(_0x110762,_0x39e09e){_0x110762=_0x110762-0x161;const _0x2cbf88=a105_0x2cbf();let _0x3ec632=_0x2cbf88[_0x110762];return _0x3ec632;}export function updateSegmentRefsInSegments(_0x4c0f21,_0x266c90){const _0x31c772=a105_0x3ec6;for(const _0x510eb7 of Object[_0x31c772(0x186)](_0x4c0f21)){_0x510eb7[_0x31c772(0x16c)]&&updateSegmentRefsInRule(_0x510eb7['rule'],_0x266c90);}}function updateSegmentRefsInRule(_0x58d111,_0x113ec0){const _0x255324=a105_0x3ec6;if(_0x58d111===null||typeof _0x58d111!==_0x255324(0x184))return;if(Array[_0x255324(0x1a3)](_0x58d111)){for(const _0x1a8ca1 of _0x58d111){updateSegmentRefsInRule(_0x1a8ca1,_0x113ec0);}return;}const _0x4fd192=_0x58d111;if((_0x4fd192[_0x255324(0x19f)]===_0x255324(0x176)||_0x4fd192[_0x255324(0x19f)]===_0x255324(0x166))&&typeof _0x4fd192['segment']==='string'){const _0x5236bc=_0x113ec0['get'](_0x4fd192[_0x255324(0x196)]);_0x5236bc&&(_0x4fd192[_0x255324(0x196)]=_0x5236bc);}if(_0x4fd192[_0x255324(0x165)]&&Array[_0x255324(0x1a3)](_0x4fd192['conditions']))for(const _0x29b7a3 of _0x4fd192['conditions']){updateSegmentRefsInRule(_0x29b7a3,_0x113ec0);}}export function buildJourneysArray(_0x4a4bcc){const _0x851d3f=a105_0x3ec6,_0x4550a3=Math[_0x851d3f(0x19c)](..._0x4a4bcc[_0x851d3f(0x189)](_0x40d2d1=>_0x40d2d1[_0x851d3f(0x1a1)][_0x851d3f(0x1a5)]||0x0));return _0x4a4bcc[_0x851d3f(0x189)](_0x309142=>{const _0x1702b1=_0x851d3f,_0x452e8c=(_0x309142[_0x1702b1(0x1a1)][_0x1702b1(0x1a5)]||0x0)===_0x4550a3,_0x343ade=_0x309142['yaml']['journeys']?.[0x0],_0x310688={'version':_0x343ade?.[_0x1702b1(0x18e)]||_0x309142[_0x1702b1(0x161)]['version']||_0x309142[_0x1702b1(0x1a1)][_0x1702b1(0x18a)],'state':_0x309142[_0x1702b1(0x1a1)][_0x1702b1(0x17b)]===_0x1702b1(0x195)?'launched':_0x1702b1(0x179),'stages':_0x343ade?.[_0x1702b1(0x175)]||_0x309142[_0x1702b1(0x161)][_0x1702b1(0x175)]||[],'id':_0x343ade?.['id']||_0x309142[_0x1702b1(0x161)]['id'],'version_number':_0x343ade?.[_0x1702b1(0x197)]||_0x309142['yaml'][_0x1702b1(0x197)]};return _0x452e8c&&(_0x310688[_0x1702b1(0x19a)]=!![]),_0x310688;});}export function buildMergedJourneyDef(_0xb62618,_0x311119){const _0x45c5df=a105_0x3ec6,_0x5864af=_0xb62618[0x0][_0x45c5df(0x161)],_0x48bdd5=buildJourneysArray(_0xb62618),{merged:_0x4ada40,nameMapping:_0x5d8a03}=consolidateSegmentsByContent(_0xb62618[_0x45c5df(0x189)](_0x12f058=>_0x12f058[_0x45c5df(0x161)]['segments']),_0x311119);updateSegmentRefsInSegments(_0x4ada40,_0x5d8a03);const _0x2b8cd6=Array[_0x45c5df(0x163)](_0x5d8a03[_0x45c5df(0x188)]())[_0x45c5df(0x17f)](([_0x21236f,_0xeb2f1a])=>_0x21236f!==_0xeb2f1a&&_0x21236f[_0x45c5df(0x169)](_0x45c5df(0x1ad)));let _0x1d1299=_0x4ada40,_0x97cf45=new Map();if(_0x2b8cd6){const _0x21e801=consolidateSegmentsByContent([_0x4ada40],_0x311119);_0x1d1299=_0x21e801[_0x45c5df(0x1a4)],_0x97cf45=_0x21e801[_0x45c5df(0x1b3)];}const _0x35de50=new Map(_0x5d8a03);for(const [_0x2e613b,_0x395231]of _0x97cf45[_0x45c5df(0x188)]()){_0x35de50[_0x45c5df(0x167)](_0x2e613b,_0x395231);}for(const [_0x558cc9,_0x1cf237]of _0x35de50[_0x45c5df(0x188)]()){let _0x287ebb=_0x1cf237,_0x52e07d=0x0;while(_0x35de50[_0x45c5df(0x1af)](_0x287ebb)&&_0x35de50[_0x45c5df(0x183)](_0x287ebb)!==_0x287ebb&&_0x52e07d<MAX_MAPPING_CHAIN_DEPTH){_0x287ebb=_0x35de50['get'](_0x287ebb),_0x52e07d++;}_0x287ebb!==_0x1cf237&&_0x35de50[_0x45c5df(0x167)](_0x558cc9,_0x287ebb);}for(const _0x53b6aa of _0x48bdd5){updateSegmentReferences(_0x53b6aa[_0x45c5df(0x175)],_0x35de50);}const {merged:_0x46f042,nameMapping:_0x45e4a4}=consolidateActivationsByContent(_0xb62618[_0x45c5df(0x189)](_0xcd30c1=>_0xcd30c1[_0x45c5df(0x161)]['activations']));for(const _0x4731ea of _0x48bdd5){updateActivationReferences(_0x4731ea[_0x45c5df(0x175)],_0x45e4a4);}let _0xa226dd=_0x5864af[_0x45c5df(0x1b2)];if(_0xa226dd?.['segment']){const _0x55044a=_0x35de50[_0x45c5df(0x183)](_0xa226dd[_0x45c5df(0x196)]);_0x55044a&&(_0xa226dd={..._0xa226dd,'segment':_0x55044a});}for(const _0x5f0c4d of _0x48bdd5){if(_0x5f0c4d[_0x45c5df(0x1b2)]?.['segment']){const _0x1ef164=_0x35de50[_0x45c5df(0x183)](_0x5f0c4d[_0x45c5df(0x1b2)][_0x45c5df(0x196)]);_0x1ef164&&(_0x5f0c4d[_0x45c5df(0x1b2)]={..._0x5f0c4d[_0x45c5df(0x1b2)],'segment':_0x1ef164});}}return{'type':_0x45c5df(0x1b5),'name':_0x5864af[_0x45c5df(0x18a)],'description':_0x5864af[_0x45c5df(0x16a)],'goal':_0xa226dd,'reentry':_0x5864af[_0x45c5df(0x172)],'segments':Object[_0x45c5df(0x17e)](_0x1d1299)[_0x45c5df(0x193)]>0x0?_0x1d1299:undefined,'activations':Object[_0x45c5df(0x17e)](_0x46f042)[_0x45c5df(0x193)]>0x0?_0x46f042:undefined,'journeys':_0x48bdd5,'bundle_id':_0x5864af[_0x45c5df(0x1aa)],'bundle_name':_0x5864af[_0x45c5df(0x18b)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x3e6967,_0x31a2e7,_0x4ddc49,_0x15c28c){const _0x5c86ca=a105_0x3ec6,_0x58c43d=_0x3e6967+':'+_0x31a2e7,_0x39d6df=_0x4ddc49[_0x5c86ca(0x183)](_0x58c43d);if(_0x39d6df)return _0x39d6df;const _0x4cf9c2=await _0x15c28c(_0x3e6967),_0xd926fd=_0x4cf9c2[_0x5c86ca(0x180)][_0x5c86ca(0x199)]||_0x4cf9c2[_0x5c86ca(0x180)][_0x5c86ca(0x18a)],_0x5119f1=_0x4cf9c2[_0x5c86ca(0x180)][_0x5c86ca(0x18f)][_0x5c86ca(0x1ac)](_0x12a9c3=>String(_0x12a9c3['id'])===String(_0x31a2e7)),_0xb0c295=_0x5119f1?.['name']||_0x31a2e7,_0x8271d0={'journeyName':_0xd926fd,'stageName':_0xb0c295};return _0x4ddc49['set'](_0x58c43d,_0x8271d0),_0x8271d0;}export function formatApiJourneyName(_0x4ba127,_0x44d7be){return _0x44d7be+'\x20('+_0x4ba127+')';}export function isLocalJourneyRef(_0x3b720c){const _0x4e1fc9=a105_0x3ec6;return _0x3b720c[_0x4e1fc9(0x198)](_0x4e1fc9(0x182))||_0x3b720c[_0x4e1fc9(0x198)](_0x4e1fc9(0x16e));}export function buildLocalRuleToNameMapping(_0x1210e9){const _0x27ae70=a105_0x3ec6,_0x21bf71=new Map();if(!_0x1210e9)return _0x21bf71;for(const [_0x5c3788,_0x3d1950]of Object[_0x27ae70(0x188)](_0x1210e9)){if(_0x3d1950[_0x27ae70(0x16c)]){const _0x52f60e=serializeRule(_0x3d1950[_0x27ae70(0x16c)]),_0x5186b3=_0x21bf71[_0x27ae70(0x183)](_0x52f60e)||[];_0x5186b3[_0x27ae70(0x1b6)](_0x5c3788),_0x21bf71[_0x27ae70(0x167)](_0x52f60e,_0x5186b3);}}return _0x21bf71;}export function buildLocalRuleToNameMappingFromJourney(_0x3edc){const _0x1a99bc=a105_0x3ec6,_0x2ad527=_0x3edc[_0x1a99bc(0x17d)];if(!_0x2ad527)return new Map();const _0x28b5ac=collectSegmentUsageCounts(_0x3edc),_0x388f2f=new Map();let _0x3c0ef5=0x0;for(const [_0x457e40,_0x157cb1]of Object[_0x1a99bc(0x188)](_0x2ad527)){if(!_0x157cb1[_0x1a99bc(0x16c)]){_0x3c0ef5++;continue;}const _0x1c5565=serializeRule(_0x157cb1[_0x1a99bc(0x16c)]),_0x55556e=_0x388f2f[_0x1a99bc(0x183)](_0x1c5565)||[];_0x55556e[_0x1a99bc(0x1b6)]({'name':_0x457e40,'index':_0x3c0ef5}),_0x388f2f[_0x1a99bc(0x167)](_0x1c5565,_0x55556e),_0x3c0ef5++;}const _0x326719=new Map();for(const [_0x49b1fd,_0x14de07]of _0x388f2f){const _0x14ab7a=_0x14de07[_0x1a99bc(0x170)]()[_0x1a99bc(0x1a9)]((_0x1f946a,_0x546b3c)=>{const _0x21c7ad=_0x1a99bc,_0x42195=_0x28b5ac[_0x21c7ad(0x183)](_0x1f946a[_0x21c7ad(0x18a)])||0x0,_0x3e8fc5=_0x28b5ac[_0x21c7ad(0x183)](_0x546b3c['name'])||0x0;if(_0x42195!==_0x3e8fc5)return _0x3e8fc5-_0x42195;return _0x1f946a[_0x21c7ad(0x1a8)]-_0x546b3c[_0x21c7ad(0x1a8)];})[_0x1a99bc(0x189)](_0x18cb18=>_0x18cb18[_0x1a99bc(0x18a)]);_0x326719[_0x1a99bc(0x167)](_0x49b1fd,_0x14ab7a);}return _0x326719;}export function collectSegmentUsageCounts(_0x3bb03e){const _0x4b45b5=a105_0x3ec6,_0x426500=new Map(),_0x1a8ae4=_0x436adc=>{const _0x1aa22a=a105_0x3ec6;if(!_0x436adc)return;_0x426500['set'](_0x436adc,(_0x426500[_0x1aa22a(0x183)](_0x436adc)||0x0)+0x1);},_0x2d801b=_0x4bdbac=>{const _0x3e0c9c=a105_0x3ec6;for(const _0x3806a4 of _0x4bdbac){_0x1a8ae4(_0x3806a4[_0x3e0c9c(0x1ad)]?.['segment']);if(_0x3806a4[_0x3e0c9c(0x178)])for(const _0x3d0daf of _0x3806a4[_0x3e0c9c(0x178)]){_0x1a8ae4(_0x3d0daf[_0x3e0c9c(0x196)]);}_0x1a8ae4(_0x3806a4[_0x3e0c9c(0x1a6)]?.[_0x3e0c9c(0x196)]);if(_0x3806a4[_0x3e0c9c(0x1ae)])for(const _0x5c0005 of _0x3806a4['steps']){if(_0x5c0005[_0x3e0c9c(0x19f)]===_0x3e0c9c(0x191))for(const _0x1650c1 of _0x5c0005['with']['branches']){_0x1a8ae4(_0x1650c1['segment']);}else _0x5c0005[_0x3e0c9c(0x19f)]==='wait'&&_0x1a8ae4(_0x5c0005[_0x3e0c9c(0x173)][_0x3e0c9c(0x164)]?.[_0x3e0c9c(0x196)]);}}};_0x1a8ae4(_0x3bb03e[_0x4b45b5(0x1b2)]?.[_0x4b45b5(0x196)]);if(_0x3bb03e[_0x4b45b5(0x1b4)])for(const _0x5cd77b of _0x3bb03e[_0x4b45b5(0x1b4)]){_0x1a8ae4(_0x5cd77b[_0x4b45b5(0x1b2)]?.[_0x4b45b5(0x196)]),_0x2d801b(_0x5cd77b[_0x4b45b5(0x175)]);}_0x3bb03e[_0x4b45b5(0x175)]&&_0x2d801b(_0x3bb03e[_0x4b45b5(0x175)]);if(_0x3bb03e['versions'])for(const _0x54161b of _0x3bb03e[_0x4b45b5(0x18c)]){_0x2d801b(_0x54161b[_0x4b45b5(0x175)]);}return _0x426500;}
|
|
1
|
+
(function(_0x46da8c,_0x37d44e){const _0x678aa=a105_0x464b,_0x519013=_0x46da8c();while(!![]){try{const _0x481278=parseInt(_0x678aa(0x10f))/0x1*(-parseInt(_0x678aa(0xd5))/0x2)+-parseInt(_0x678aa(0xd4))/0x3*(parseInt(_0x678aa(0xdc))/0x4)+-parseInt(_0x678aa(0xf5))/0x5+-parseInt(_0x678aa(0xd2))/0x6+parseInt(_0x678aa(0x10c))/0x7+parseInt(_0x678aa(0xcf))/0x8*(parseInt(_0x678aa(0xc8))/0x9)+-parseInt(_0x678aa(0xf4))/0xa*(-parseInt(_0x678aa(0xda))/0xb);if(_0x481278===_0x37d44e)break;else _0x519013['push'](_0x519013['shift']());}catch(_0x4b8bef){_0x519013['push'](_0x519013['shift']());}}}(a105_0x26f0,0x4c7d9));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x12fbcf){const _0x40b440=a105_0x464b;return _0x12fbcf[_0x40b440(0x104)]()['replace'](/\s+/g,'_')['replace'](/[^a-z0-9_]/g,'')[_0x40b440(0x107)](/_+/g,'_')[_0x40b440(0x107)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x8b981f){const _0x343ee2=a105_0x464b,_0x4b723c=_0x8b981f[_0x343ee2(0xe4)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x4b723c){const _0x52e339=_0x4b723c[0x1]['toLowerCase'](),_0x1e01be=_0x4b723c[0x2],_0x1c4361=_0x1e01be['replace'](/-/g,'')[_0x343ee2(0x102)](0x0,0x4)[_0x343ee2(0x104)]();return _0x52e339+'_'+_0x1c4361;}const _0xae4c68=_0x8b981f[_0x343ee2(0xe4)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0xae4c68){const _0x2b5128=_0xae4c68[0x1],_0x88ea2a=_0xae4c68[0x2][_0x343ee2(0x104)](),_0x13e9ee=_0x2b5128['replace'](/-/g,'')[_0x343ee2(0x102)](0x0,0x4)['toLowerCase']();return _0x88ea2a+'_'+_0x13e9ee;}return undefined;}function stableStringify(_0x5c3fac){const _0x4ad7b6=a105_0x464b;if(Array['isArray'](_0x5c3fac))return'['+_0x5c3fac[_0x4ad7b6(0xe6)](_0x3e7cf0=>stableStringify(_0x3e7cf0))[_0x4ad7b6(0xe9)](',')+']';if(_0x5c3fac&&typeof _0x5c3fac===_0x4ad7b6(0xd7)){const _0x79ea37=_0x5c3fac,_0x50aba=Object[_0x4ad7b6(0xd3)](_0x79ea37)[_0x4ad7b6(0xe5)](),_0x16c273=_0x50aba[_0x4ad7b6(0xe6)](_0x291feb=>'\x22'+_0x291feb+'\x22:'+stableStringify(_0x79ea37[_0x291feb]));return'{'+_0x16c273['join'](',')+'}';}const _0xab6633=JSON[_0x4ad7b6(0xdf)](_0x5c3fac);return _0xab6633===undefined?_0x4ad7b6(0xea):_0xab6633;}function a105_0x26f0(){const _0x371201=['stages','trim','journeyStages','launched','index','11720iyRMjd','versionNumber','yaml','1934082NCzMeF','keys','111354RlCLIf','288846uSNnNp','schedule','object','activation','steps','55NTDEvr','journeys','52bKZqDw','push','has','stringify','bundle_id','length','latest','conditions','match','sort','map','entry_criteria','segments','join','null','decision_point','versions','columns','attributes','behavior','nameMapping','string','with','rule','2267890WyuMBh','373285PTinwl','activation_template_id','notification','exit_criteria','journey','entries','bundle_name','draft','values','type','set','version_number','goal','slice','item','toLowerCase','all_columns','wait','replace','journeyBundleName','version','name','connector_config','594279EgXGqa','segment','endsWith','3qhITsC','isArray','get','some','branches','2502JpYqkP','description'];a105_0x26f0=function(){return _0x371201;};return a105_0x26f0();}export function consolidateActivationsByContent(_0x4dc460){const _0x5890cf=a105_0x464b,_0x1eafc8={},_0x50cc78=new Map(),_0xc93a8c=new Map();for(const _0x56f35c of _0x4dc460){if(!_0x56f35c)continue;for(const [_0x2e4e1f,_0x55a1a3]of Object[_0x5890cf(0xfa)](_0x56f35c)){const _0x4dfd34={'connection':_0x55a1a3['connection'],..._0x55a1a3[_0x5890cf(0x105)]!==undefined&&{'all_columns':_0x55a1a3['all_columns']},..._0x55a1a3['columns']!==undefined&&{'columns':_0x55a1a3[_0x5890cf(0xed)]},..._0x55a1a3['behavior']!==undefined&&{'behavior':_0x55a1a3[_0x5890cf(0xef)]},..._0x55a1a3['schedule']!==undefined&&{'schedule':_0x55a1a3[_0x5890cf(0xd6)]},..._0x55a1a3[_0x5890cf(0xf7)]!==undefined&&{'notification':_0x55a1a3[_0x5890cf(0xf7)]},..._0x55a1a3['connector_config']!==undefined&&{'connector_config':_0x55a1a3[_0x5890cf(0x10b)]},..._0x55a1a3[_0x5890cf(0xf6)]!==undefined&&{'activation_template_id':_0x55a1a3[_0x5890cf(0xf6)]}},_0x30403e=stableStringify(_0x4dfd34),_0xc92876=_0xc93a8c[_0x5890cf(0x111)](_0x30403e);_0xc92876?_0x50cc78[_0x5890cf(0xff)](_0x2e4e1f,_0xc92876):(_0x1eafc8[_0x2e4e1f]=_0x55a1a3,_0x50cc78['set'](_0x2e4e1f,_0x2e4e1f),_0xc93a8c['set'](_0x30403e,_0x2e4e1f));}}return{'merged':_0x1eafc8,'nameMapping':_0x50cc78};}export function updateActivationReferences(_0x253b13,_0x4e6107){const _0x1a4f5f=a105_0x464b;if(!_0x253b13)return;for(const _0x4377cb of _0x253b13){if(!_0x4377cb[_0x1a4f5f(0xd9)])continue;for(const _0x43874d of _0x4377cb[_0x1a4f5f(0xd9)]){if(_0x43874d[_0x1a4f5f(0xfe)]===_0x1a4f5f(0xd8)&&_0x43874d[_0x1a4f5f(0xf2)]?.[_0x1a4f5f(0xd8)]){const _0x238bad=_0x4e6107[_0x1a4f5f(0x111)](_0x43874d[_0x1a4f5f(0xf2)][_0x1a4f5f(0xd8)]);_0x238bad&&_0x238bad!==_0x43874d[_0x1a4f5f(0xf2)][_0x1a4f5f(0xd8)]&&(_0x43874d['with'][_0x1a4f5f(0xd8)]=_0x238bad);}}}}export function consolidateSegmentsByContent(_0x348839,_0x44e2b9){const _0x4c6773=a105_0x464b,_0x3747d6={},_0x4a0062=new Map(),_0x4623ef=new Map();for(const _0x8fe327 of _0x348839){if(!_0x8fe327)continue;for(const [_0xa2de4f,_0x2b70b7]of Object[_0x4c6773(0xfa)](_0x8fe327)){if(!_0x2b70b7[_0x4c6773(0xf3)]){_0x3747d6[_0xa2de4f]=_0x2b70b7,_0x4a0062[_0x4c6773(0xff)](_0xa2de4f,_0xa2de4f);continue;}const _0xe29c66=_0x2b70b7[_0x4c6773(0xc9)]&&_0x2b70b7[_0x4c6773(0xc9)][_0x4c6773(0xcb)]()?_0x2b70b7[_0x4c6773(0xc9)]:undefined,_0x2404f1=JSON['stringify']({'description':_0xe29c66,'rule':deepSortObject(_0x2b70b7[_0x4c6773(0xf3)])}),_0x1174ab=_0x4623ef[_0x4c6773(0x111)](_0x2404f1);if(_0x1174ab){const _0x290a48={..._0x2b70b7[_0x4c6773(0xc9)]!==undefined&&{'description':_0x2b70b7[_0x4c6773(0xc9)]},'rule':_0x2b70b7[_0x4c6773(0xf3)]?deepSortObject(_0x2b70b7[_0x4c6773(0xf3)]):_0x2b70b7[_0x4c6773(0xf3)]};if(_0xa2de4f<_0x1174ab){_0x3747d6[_0xa2de4f]=_0x290a48,delete _0x3747d6[_0x1174ab];for(const [_0x2cde17,_0x72ca1f]of _0x4a0062[_0x4c6773(0xfa)]()){_0x72ca1f===_0x1174ab&&_0x4a0062[_0x4c6773(0xff)](_0x2cde17,_0xa2de4f);}_0x4a0062['set'](_0xa2de4f,_0xa2de4f),_0x4623ef['set'](_0x2404f1,_0xa2de4f);}else _0x3747d6[_0x1174ab]=_0x290a48,_0x4a0062[_0x4c6773(0xff)](_0xa2de4f,_0x1174ab);}else{let _0x2066dd=_0xa2de4f;if(_0x44e2b9){const _0x110ca0=_0x44e2b9[_0x4c6773(0x111)](_0x2404f1);_0x110ca0&&_0x110ca0[_0x4c6773(0xe1)]>0x0&&(_0x2066dd=_0x110ca0[_0x4c6773(0x102)]()['sort']()[0x0]);}const _0x9dcb0d={..._0x2b70b7[_0x4c6773(0xc9)]!==undefined&&{'description':_0x2b70b7[_0x4c6773(0xc9)]},'rule':_0x2b70b7[_0x4c6773(0xf3)]?deepSortObject(_0x2b70b7[_0x4c6773(0xf3)]):_0x2b70b7['rule']};_0x3747d6[_0x2066dd]=_0x9dcb0d,_0x4a0062['set'](_0xa2de4f,_0x2066dd),_0x4623ef[_0x4c6773(0xff)](_0x2404f1,_0x2066dd);}}}return{'merged':_0x3747d6,'nameMapping':_0x4a0062};}export function updateSegmentReferences(_0x13071e,_0x4f201c){const _0x286970=a105_0x464b;if(!_0x13071e)return;for(const _0x1e017e of _0x13071e){if(_0x1e017e[_0x286970(0xe7)]?.[_0x286970(0x10d)]){const _0x2d9178=_0x4f201c[_0x286970(0x111)](_0x1e017e[_0x286970(0xe7)]['segment']);_0x2d9178&&(_0x1e017e[_0x286970(0xe7)][_0x286970(0x10d)]=_0x2d9178);}if(_0x1e017e[_0x286970(0xd9)])for(const _0x2aa446 of _0x1e017e['steps']){if(_0x2aa446[_0x286970(0xfe)]===_0x286970(0xeb)&&_0x2aa446[_0x286970(0xf2)]?.[_0x286970(0xc7)])for(const _0x3cdf21 of _0x2aa446[_0x286970(0xf2)][_0x286970(0xc7)]){if(_0x3cdf21[_0x286970(0x10d)]){const _0x222466=_0x4f201c[_0x286970(0x111)](_0x3cdf21['segment']);_0x222466&&(_0x3cdf21[_0x286970(0x10d)]=_0x222466);}}}}}export function updateSegmentRefsInSegments(_0xaf255e,_0x42c57d){const _0x2ae8da=a105_0x464b;for(const _0x34196f of Object[_0x2ae8da(0xfd)](_0xaf255e)){_0x34196f[_0x2ae8da(0xf3)]&&updateSegmentRefsInRule(_0x34196f[_0x2ae8da(0xf3)],_0x42c57d);}}function updateSegmentRefsInRule(_0x43e44e,_0x56679e){const _0x466154=a105_0x464b;if(_0x43e44e===null||typeof _0x43e44e!=='object')return;if(Array[_0x466154(0x110)](_0x43e44e)){for(const _0x46f485 of _0x43e44e){updateSegmentRefsInRule(_0x46f485,_0x56679e);}return;}const _0xd91940=_0x43e44e;if((_0xd91940[_0x466154(0xfe)]==='include'||_0xd91940[_0x466154(0xfe)]==='exclude')&&typeof _0xd91940[_0x466154(0x10d)]===_0x466154(0xf1)){const _0x3561ed=_0x56679e['get'](_0xd91940[_0x466154(0x10d)]);_0x3561ed&&(_0xd91940[_0x466154(0x10d)]=_0x3561ed);}if(_0xd91940[_0x466154(0xe3)]&&Array['isArray'](_0xd91940[_0x466154(0xe3)]))for(const _0x3a3117 of _0xd91940[_0x466154(0xe3)]){updateSegmentRefsInRule(_0x3a3117,_0x56679e);}}export function buildJourneysArray(_0x501fa1){const _0x536113=a105_0x464b,_0x4f9eee=Math['max'](..._0x501fa1[_0x536113(0xe6)](_0xa79872=>_0xa79872['item'][_0x536113(0xd0)]||0x0));return _0x501fa1[_0x536113(0xe6)](_0x363a52=>{const _0x456ebd=_0x536113,_0x550e25=(_0x363a52[_0x456ebd(0x103)]['versionNumber']||0x0)===_0x4f9eee,_0x34109a=_0x363a52[_0x456ebd(0xd1)][_0x456ebd(0xdb)]?.[0x0],_0x19f0a3={'version':_0x34109a?.['version']||_0x363a52['yaml'][_0x456ebd(0x109)]||_0x363a52[_0x456ebd(0x103)]['name'],'state':_0x363a52[_0x456ebd(0x103)]['state']===_0x456ebd(0xcd)?'launched':_0x456ebd(0xfc),'stages':_0x34109a?.[_0x456ebd(0xca)]||_0x363a52[_0x456ebd(0xd1)]['stages']||[],'id':_0x34109a?.['id']||_0x363a52[_0x456ebd(0xd1)]['id'],'version_number':_0x34109a?.[_0x456ebd(0x100)]||_0x363a52[_0x456ebd(0xd1)][_0x456ebd(0x100)]};return _0x550e25&&(_0x19f0a3[_0x456ebd(0xe2)]=!![]),_0x19f0a3;});}export function buildMergedJourneyDef(_0x1de575,_0xb7f5a0){const _0xd514cc=a105_0x464b,_0x429834=_0x1de575[0x0][_0xd514cc(0xd1)],_0x58ba49=buildJourneysArray(_0x1de575),{merged:_0x5c4834,nameMapping:_0x4eff25}=consolidateSegmentsByContent(_0x1de575['map'](_0x144c14=>_0x144c14[_0xd514cc(0xd1)]['segments']),_0xb7f5a0);updateSegmentRefsInSegments(_0x5c4834,_0x4eff25);const _0x446bd8=Array['from'](_0x4eff25[_0xd514cc(0xfa)]())[_0xd514cc(0x112)](([_0x49add4,_0x334bc8])=>_0x49add4!==_0x334bc8&&_0x49add4['startsWith'](_0xd514cc(0xe7)));let _0xb5bd27=_0x5c4834,_0x1aeea4=new Map();if(_0x446bd8){const _0x4bd66b=consolidateSegmentsByContent([_0x5c4834],_0xb7f5a0);_0xb5bd27=_0x4bd66b['merged'],_0x1aeea4=_0x4bd66b[_0xd514cc(0xf0)];}const _0x349f4c=new Map(_0x4eff25);for(const [_0x43cb04,_0x2e32a0]of _0x1aeea4['entries']()){_0x349f4c['set'](_0x43cb04,_0x2e32a0);}for(const [_0x32c0c7,_0x254130]of _0x349f4c[_0xd514cc(0xfa)]()){let _0x4b9313=_0x254130,_0x51855d=0x0;while(_0x349f4c[_0xd514cc(0xde)](_0x4b9313)&&_0x349f4c[_0xd514cc(0x111)](_0x4b9313)!==_0x4b9313&&_0x51855d<MAX_MAPPING_CHAIN_DEPTH){_0x4b9313=_0x349f4c[_0xd514cc(0x111)](_0x4b9313),_0x51855d++;}_0x4b9313!==_0x254130&&_0x349f4c[_0xd514cc(0xff)](_0x32c0c7,_0x4b9313);}for(const _0x59abdd of _0x58ba49){updateSegmentReferences(_0x59abdd[_0xd514cc(0xca)],_0x349f4c);}const {merged:_0x1ae85e,nameMapping:_0x32e9c1}=consolidateActivationsByContent(_0x1de575['map'](_0x206f6a=>_0x206f6a[_0xd514cc(0xd1)]['activations']));for(const _0x418d69 of _0x58ba49){updateActivationReferences(_0x418d69[_0xd514cc(0xca)],_0x32e9c1);}let _0x3e4c29=_0x429834['goal'];if(_0x3e4c29?.[_0xd514cc(0x10d)]){const _0x3712a6=_0x349f4c['get'](_0x3e4c29[_0xd514cc(0x10d)]);_0x3712a6&&(_0x3e4c29={..._0x3e4c29,'segment':_0x3712a6});}for(const _0x49870c of _0x58ba49){if(_0x49870c[_0xd514cc(0x101)]?.[_0xd514cc(0x10d)]){const _0x1b0963=_0x349f4c[_0xd514cc(0x111)](_0x49870c[_0xd514cc(0x101)][_0xd514cc(0x10d)]);_0x1b0963&&(_0x49870c['goal']={..._0x49870c[_0xd514cc(0x101)],'segment':_0x1b0963});}}return{'type':_0xd514cc(0xf9),'name':_0x429834[_0xd514cc(0x10a)],'description':_0x429834[_0xd514cc(0xc9)],'goal':_0x3e4c29,'reentry':_0x429834['reentry'],'segments':Object[_0xd514cc(0xd3)](_0xb5bd27)[_0xd514cc(0xe1)]>0x0?_0xb5bd27:undefined,'activations':Object[_0xd514cc(0xd3)](_0x1ae85e)['length']>0x0?_0x1ae85e:undefined,'journeys':_0x58ba49,'bundle_id':_0x429834[_0xd514cc(0xe0)],'bundle_name':_0x429834[_0xd514cc(0xfb)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x2e9fc1,_0x1b8597,_0x1b03e9,_0x3713b1){const _0x4bd2fb=a105_0x464b,_0x20c2b1=_0x2e9fc1+':'+_0x1b8597,_0xcd2ffd=_0x1b03e9[_0x4bd2fb(0x111)](_0x20c2b1);if(_0xcd2ffd)return _0xcd2ffd;const _0x36254b=await _0x3713b1(_0x2e9fc1),_0x532aa9=_0x36254b[_0x4bd2fb(0xee)][_0x4bd2fb(0x108)]||_0x36254b[_0x4bd2fb(0xee)]['name'],_0x574c4e=_0x36254b[_0x4bd2fb(0xee)][_0x4bd2fb(0xcc)]['find'](_0x254448=>String(_0x254448['id'])===String(_0x1b8597)),_0x388114=_0x574c4e?.[_0x4bd2fb(0x10a)]||_0x1b8597,_0x8e63da={'journeyName':_0x532aa9,'stageName':_0x388114};return _0x1b03e9['set'](_0x20c2b1,_0x8e63da),_0x8e63da;}export function formatApiJourneyName(_0x498175,_0x53073b){return _0x53073b+'\x20('+_0x498175+')';}export function isLocalJourneyRef(_0xd06ad7){const _0x591cf7=a105_0x464b;return _0xd06ad7[_0x591cf7(0x10e)]('.yml')||_0xd06ad7[_0x591cf7(0x10e)]('.yaml');}export function buildLocalRuleToNameMapping(_0x3314d2){const _0x3be272=a105_0x464b,_0x1b3e89=new Map();if(!_0x3314d2)return _0x1b3e89;for(const [_0x18e337,_0x2672fb]of Object[_0x3be272(0xfa)](_0x3314d2)){if(_0x2672fb[_0x3be272(0xf3)]){const _0x475427=serializeRule(_0x2672fb[_0x3be272(0xf3)]),_0xd13f62=_0x1b3e89['get'](_0x475427)||[];_0xd13f62[_0x3be272(0xdd)](_0x18e337),_0x1b3e89['set'](_0x475427,_0xd13f62);}}return _0x1b3e89;}export function buildLocalRuleToNameMappingFromJourney(_0x1c0a84){const _0x506fff=a105_0x464b,_0x301997=_0x1c0a84[_0x506fff(0xe8)];if(!_0x301997)return new Map();const _0x28f830=collectSegmentUsageCounts(_0x1c0a84),_0x4f6a85=new Map();let _0x524804=0x0;for(const [_0xf346a5,_0x5f5508]of Object[_0x506fff(0xfa)](_0x301997)){if(!_0x5f5508['rule']){_0x524804++;continue;}const _0x47c08a=serializeRule(_0x5f5508['rule']),_0x2da86d=_0x4f6a85[_0x506fff(0x111)](_0x47c08a)||[];_0x2da86d[_0x506fff(0xdd)]({'name':_0xf346a5,'index':_0x524804}),_0x4f6a85[_0x506fff(0xff)](_0x47c08a,_0x2da86d),_0x524804++;}const _0xfbb03d=new Map();for(const [_0x14ecb9,_0x47c85a]of _0x4f6a85){const _0x20ecdf=_0x47c85a[_0x506fff(0x102)]()[_0x506fff(0xe5)]((_0x4dbf0a,_0x334364)=>{const _0x3fd0b7=_0x506fff,_0x2684e0=_0x28f830[_0x3fd0b7(0x111)](_0x4dbf0a['name'])||0x0,_0x4a4bda=_0x28f830['get'](_0x334364['name'])||0x0;if(_0x2684e0!==_0x4a4bda)return _0x4a4bda-_0x2684e0;return _0x4dbf0a[_0x3fd0b7(0xce)]-_0x334364[_0x3fd0b7(0xce)];})[_0x506fff(0xe6)](_0x4b6bb2=>_0x4b6bb2[_0x506fff(0x10a)]);_0xfbb03d[_0x506fff(0xff)](_0x14ecb9,_0x20ecdf);}return _0xfbb03d;}function a105_0x464b(_0x2534e1,_0x221493){_0x2534e1=_0x2534e1-0xc7;const _0x26f0cb=a105_0x26f0();let _0x464b1f=_0x26f0cb[_0x2534e1];return _0x464b1f;}export function collectSegmentUsageCounts(_0x343074){const _0x563d31=a105_0x464b,_0x2e1531=new Map(),_0x3a619a=_0x4bc469=>{const _0x961bb6=a105_0x464b;if(!_0x4bc469)return;_0x2e1531[_0x961bb6(0xff)](_0x4bc469,(_0x2e1531[_0x961bb6(0x111)](_0x4bc469)||0x0)+0x1);},_0x5912f6=_0x563bea=>{const _0x434ba6=a105_0x464b;for(const _0x28031c of _0x563bea){_0x3a619a(_0x28031c[_0x434ba6(0xe7)]?.[_0x434ba6(0x10d)]);if(_0x28031c[_0x434ba6(0xf8)])for(const _0xb379ac of _0x28031c[_0x434ba6(0xf8)]){_0x3a619a(_0xb379ac[_0x434ba6(0x10d)]);}_0x3a619a(_0x28031c['milestone']?.[_0x434ba6(0x10d)]);if(_0x28031c[_0x434ba6(0xd9)])for(const _0x2155fe of _0x28031c[_0x434ba6(0xd9)]){if(_0x2155fe['type']===_0x434ba6(0xeb))for(const _0x125675 of _0x2155fe[_0x434ba6(0xf2)][_0x434ba6(0xc7)]){_0x3a619a(_0x125675[_0x434ba6(0x10d)]);}else _0x2155fe['type']===_0x434ba6(0x106)&&_0x3a619a(_0x2155fe['with']['condition']?.['segment']);}}};_0x3a619a(_0x343074[_0x563d31(0x101)]?.[_0x563d31(0x10d)]);if(_0x343074[_0x563d31(0xdb)])for(const _0x2396ed of _0x343074[_0x563d31(0xdb)]){_0x3a619a(_0x2396ed['goal']?.[_0x563d31(0x10d)]),_0x5912f6(_0x2396ed['stages']);}_0x343074['stages']&&_0x5912f6(_0x343074[_0x563d31(0xca)]);if(_0x343074[_0x563d31(0xec)])for(const _0x27bca2 of _0x343074[_0x563d31(0xec)]){_0x5912f6(_0x27bca2[_0x563d31(0xca)]);}return _0x2e1531;}
|