@treasuredata/tdx 0.25.0 → 0.25.1
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(_0x1a7160,_0x3987f6){const _0x57b36b=a100_0x4ea5,_0x59beef=_0x1a7160();while(!![]){try{const _0x4d37f1=parseInt(_0x57b36b(0x18f))/0x1*(parseInt(_0x57b36b(0x180))/0x2)+parseInt(_0x57b36b(0x195))/0x3*(-parseInt(_0x57b36b(0x194))/0x4)+-parseInt(_0x57b36b(0x183))/0x5+-parseInt(_0x57b36b(0x181))/0x6+parseInt(_0x57b36b(0x185))/0x7+parseInt(_0x57b36b(0x197))/0x8+-parseInt(_0x57b36b(0x190))/0x9*(-parseInt(_0x57b36b(0x18e))/0xa);if(_0x4d37f1===_0x3987f6)break;else _0x59beef['push'](_0x59beef['shift']());}catch(_0x169b0b){_0x59beef['push'](_0x59beef['shift']());}}}(a100_0x170d,0x7e9cc));function a100_0x170d(){const _0x4bf266=['5096250DYSYTQ','close','3587705ghkAZS','Content\x20contains\x20no\x20SQL\x20statements','4291553DzxpZK','code','Error\x20reading\x20file\x20\x27','File\x20\x27','join','utf-8','Error\x20reading\x20from\x20stdin:\x20','\x27:\x20','push','3555710eGIGSf','14uCihlX','9kwCBpk','length','message','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','60ftuEUc','5043LrbZwI','replace','7670376fkeCAZ','filter','stdin','Permission\x20denied\x20reading\x20file\x20\x27','ENOENT','\x27\x20not\x20found','map','toLowerCase','EACCES','trim','stdin\x20','line','test','26184wmGiyl'];a100_0x170d=function(){return _0x4bf266;};return a100_0x170d();}import{readFileSync}from'fs';import{createInterface}from'readline';export function stripSqlComments(_0x3f3704){const _0xf2dc48=a100_0x4ea5;let _0x241f90=_0x3f3704[_0xf2dc48(0x196)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x241f90=_0x241f90[_0xf2dc48(0x196)](/--.*$/gm,''),_0x241f90['trim']();}function a100_0x4ea5(_0x585840,_0x1a63c4){_0x585840=_0x585840-0x17b;const _0x170d35=a100_0x170d();let _0x4ea536=_0x170d35[_0x585840];return _0x4ea536;}function isEscaped(_0x8c95b8,_0x19945b){let _0xadc016=0x0;for(let _0x44ac86=_0x19945b-0x1;_0x44ac86>=0x0&&_0x8c95b8[_0x44ac86]==='\x5c';_0x44ac86--){_0xadc016++;}return _0xadc016%0x2===0x1;}export function splitSqlStatements(_0x2ee479){const _0xa907f6=a100_0x4ea5,_0x5d136b=stripSqlComments(_0x2ee479);if(!_0x5d136b)throw new Error(_0xa907f6(0x184));const _0x4649ee=[];let _0x909d51='',_0x201e0c=![],_0x540117=![],_0x493ea8=![];for(let _0x2e7643=0x0;_0x2e7643<_0x2ee479[_0xa907f6(0x191)];_0x2e7643++){const _0x24c622=_0x2ee479[_0x2e7643];if(_0x24c622==='\x27'&&!isEscaped(_0x2ee479,_0x2e7643)&&!_0x540117&&!_0x493ea8)_0x201e0c=!_0x201e0c;else{if(_0x24c622==='\x22'&&!isEscaped(_0x2ee479,_0x2e7643)&&!_0x201e0c&&!_0x493ea8)_0x540117=!_0x540117;else _0x24c622==='`'&&!isEscaped(_0x2ee479,_0x2e7643)&&!_0x201e0c&&!_0x540117&&(_0x493ea8=!_0x493ea8);}if(_0x24c622===';'&&!_0x201e0c&&!_0x540117&&!_0x493ea8){const _0x3aab70=_0x909d51[_0xa907f6(0x17c)]();_0x3aab70&&_0x4649ee[_0xa907f6(0x18d)](_0x3aab70),_0x909d51='';}else _0x909d51+=_0x24c622;}const _0x5876a5=_0x909d51[_0xa907f6(0x17c)]();_0x5876a5&&_0x4649ee[_0xa907f6(0x18d)](_0x5876a5);const _0x4faf10=_0x4649ee[_0xa907f6(0x19d)](_0x4ffc05=>_0x4ffc05[_0xa907f6(0x17c)]())[_0xa907f6(0x198)](_0x12fad2=>{const _0x57a775=_0xa907f6,_0x47efec=stripSqlComments(_0x12fad2);return _0x47efec[_0x57a775(0x191)]>0x0;});if(_0x4faf10[_0xa907f6(0x191)]===0x0)throw new Error(_0xa907f6(0x184));return _0x4faf10;}export function readFileContent(_0x36a8ec){const _0x3fcbce=a100_0x4ea5;try{return readFileSync(_0x36a8ec,_0x3fcbce(0x18a));}catch(_0x1983a1){const _0x3291d0=_0x1983a1[_0x3fcbce(0x186)];if(_0x3291d0===_0x3fcbce(0x19b))throw new Error(_0x3fcbce(0x188)+_0x36a8ec+_0x3fcbce(0x19c));else{if(_0x3291d0===_0x3fcbce(0x17b))throw new Error(_0x3fcbce(0x19a)+_0x36a8ec+'\x27');else throw new Error(_0x3fcbce(0x187)+_0x36a8ec+_0x3fcbce(0x18c)+_0x1983a1[_0x3fcbce(0x192)]);}}}export function readSqlStatementsFromFile(_0xc9cbcf){const _0x5d4c3c=a100_0x4ea5,_0x1a9212=readFileContent(_0xc9cbcf);try{return splitSqlStatements(_0x1a9212);}catch(_0x3fe887){throw new Error(_0x5d4c3c(0x188)+_0xc9cbcf+'\x27\x20'+_0x3fe887[_0x5d4c3c(0x192)]['toLowerCase']());}}export async function readStdinContent(){const _0x517725=a100_0x4ea5;if(process[_0x517725(0x199)]['isTTY'])throw new Error(_0x517725(0x193));return new Promise((_0x4927ce,_0x316c75)=>{const _0x33a0ce=_0x517725,_0x108a6b=[],_0x41ec8e=createInterface({'input':process[_0x33a0ce(0x199)],'terminal':![]});_0x41ec8e['on'](_0x33a0ce(0x17e),_0x4a8300=>{const _0x5a396c=_0x33a0ce;_0x108a6b[_0x5a396c(0x18d)](_0x4a8300);}),_0x41ec8e['on'](_0x33a0ce(0x182),()=>{const _0x472892=_0x33a0ce;_0x4927ce(_0x108a6b[_0x472892(0x189)]('\x0a'));}),_0x41ec8e['on']('error',_0x253e1c=>{const _0x424c25=_0x33a0ce;_0x41ec8e[_0x424c25(0x182)](),_0x316c75(new Error(_0x424c25(0x18b)+_0x253e1c[_0x424c25(0x192)]));});});}export async function readSqlStatementsFromStdin(){const _0x473acf=a100_0x4ea5,_0x4bc139=await readStdinContent();try{return splitSqlStatements(_0x4bc139);}catch(_0x44bdc2){throw new Error(_0x473acf(0x17d)+_0x44bdc2[_0x473acf(0x192)][_0x473acf(0x19e)]());}}export function isSqlFilePath(_0x1c8e3c){const _0x995f6b=a100_0x4ea5;return/\w\.sql$/[_0x995f6b(0x17f)](_0x1c8e3c);}
|
package/dist/sdk/schedule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a101_0x369429=a101_0x2833;(function(_0x3896d8,_0x43f179){const _0x181f52=a101_0x2833,_0x54f79b=_0x3896d8();while(!![]){try{const _0x57cd25=-parseInt(_0x181f52(0x9f))/0x1*(-parseInt(_0x181f52(0x88))/0x2)+-parseInt(_0x181f52(0xa1))/0x3*(-parseInt(_0x181f52(0x95))/0x4)+-parseInt(_0x181f52(0xb4))/0x5+-parseInt(_0x181f52(0x82))/0x6+-parseInt(_0x181f52(0x8d))/0x7*(-parseInt(_0x181f52(0xa4))/0x8)+-parseInt(_0x181f52(0xac))/0x9*(-parseInt(_0x181f52(0xb2))/0xa)+-parseInt(_0x181f52(0xa7))/0xb*(-parseInt(_0x181f52(0x81))/0xc);if(_0x57cd25===_0x43f179)break;else _0x54f79b['push'](_0x54f79b['shift']());}catch(_0x429ed7){_0x54f79b['push'](_0x54f79b['shift']());}}}(a101_0x2a01,0x579b4));import{TDApiClient}from'./client/td-api-client.js';function a101_0x2833(_0x221151,_0x2eb512){_0x221151=_0x221151-0x7b;const _0x2a01ea=a101_0x2a01();let _0x2833e8=_0x2a01ea[_0x221151];return _0x2833e8;}import{SDKError,ErrorCode}from'./errors.js';function normalizeTimestamp(_0x11ad0b){const _0x2efffd=a101_0x2833;if(!_0x11ad0b)return undefined;if(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/[_0x2efffd(0xb1)](_0x11ad0b))return _0x11ad0b;return _0x11ad0b[_0x2efffd(0xa3)](_0x2efffd(0x8c),'Z')['replace']('\x20','T');}function a101_0x2a01(){const _0x3bf41e=['8GUtsYp','\x5c$&','num\x20must\x20be\x20between\x201\x20and\x2010','77qfmhzL','created_at','history','deleteSchedule','Invalid\x20time\x20format:\x20','21618CUTXZA','run','query','now','updated_at','test','2370EtIITR','updateSchedule','2720420mgZOst','cron','show','database','NOT_FOUND','name','Database\x20is\x20required','type','runSchedule','list','Type\x20is\x20required','start_at','Query\x20is\x20required','728652dtPJaN','2611542ejGNRM','Schedule\x20name\x20is\x20required','floor','map','find','pattern','191494OCsiBh','length','client','string','\x20UTC','946603kuPsaE','Schedule\x20not\x20found:\x20','listQueries','push','time','has_next_page','delete','num','12eHgMgt','slice','listSchedules','queries','getTime','update','create','scheduled','limit','filter','2oBqYaA','createSchedule','17133csWZui','INVALID_ARGUMENT','replace'];a101_0x2a01=function(){return _0x3bf41e;};return a101_0x2a01();}export class ScheduleSDK{['client'];constructor(_0xd5cd9e){const _0x762a6f=a101_0x2833;this[_0x762a6f(0x8a)]=new TDApiClient(_0xd5cd9e);}async[a101_0x369429(0x7d)](_0x2f8320){const _0x58ca7f=a101_0x369429,_0x5af7a5=await this['client'][_0x58ca7f(0x97)](),_0x5bb32b=_0x5af7a5[_0x58ca7f(0x85)](_0x2bd155=>({..._0x2bd155,'created_at':normalizeTimestamp(_0x2bd155[_0x58ca7f(0xa8)])??_0x2bd155[_0x58ca7f(0xa8)]}));if(_0x2f8320?.[_0x58ca7f(0x9d)]&&_0x2f8320[_0x58ca7f(0x9d)]>0x0)return _0x5bb32b['slice'](0x0,_0x2f8320[_0x58ca7f(0x9d)]);return _0x5bb32b;}async[a101_0x369429(0x8f)](_0x144309){const _0x418e5d=a101_0x369429,_0x636ece=0x64,_0x5d5fbb=_0x144309?.[_0x418e5d(0x9d)],_0x435d9f=[];let _0x40bec4=!![],_0x51eca2,_0x370002,_0x1ff1f7;if(_0x144309?.[_0x418e5d(0x87)]){const _0x4215e3=_0x144309[_0x418e5d(0x87)]['replace'](/[.+^${}()|[\]\\]/g,_0x418e5d(0xa5)),_0xd83864=_0x4215e3[_0x418e5d(0xa3)](/\*/g,'.*')['replace'](/\?/g,'.');_0x1ff1f7=new RegExp('^'+_0xd83864+'$','i');}while(_0x40bec4&&(!_0x5d5fbb||_0x435d9f[_0x418e5d(0x89)]<_0x5d5fbb)){const _0x372635=await this[_0x418e5d(0x8a)][_0x418e5d(0x8f)]({'anchor_column':_0x418e5d(0xb0),'sort_direction':'desc','page_size':_0x636ece,'anchor_id':_0x51eca2,'anchor_value':_0x370002});let _0x1a742b=_0x372635[_0x418e5d(0x98)];_0x144309?.[_0x418e5d(0x9c)]&&(_0x1a742b=_0x1a742b[_0x418e5d(0x9e)](_0x3147b3=>_0x3147b3[_0x418e5d(0xb5)]!==null));_0x1ff1f7&&(_0x1a742b=_0x1a742b[_0x418e5d(0x9e)](_0x381b65=>_0x381b65[_0x418e5d(0xb9)]&&_0x1ff1f7[_0x418e5d(0xb1)](_0x381b65[_0x418e5d(0xb9)])));_0x435d9f[_0x418e5d(0x90)](..._0x1a742b),_0x40bec4=_0x372635['pagination'][_0x418e5d(0x92)];if(_0x40bec4&&_0x372635['queries'][_0x418e5d(0x89)]>0x0){const _0x20b7f7=_0x372635['queries'][_0x372635[_0x418e5d(0x98)][_0x418e5d(0x89)]-0x1];_0x51eca2=_0x20b7f7['id'],_0x370002=_0x20b7f7[_0x418e5d(0xb0)];}}const _0xc64f47=_0x5d5fbb?_0x435d9f[_0x418e5d(0x96)](0x0,_0x5d5fbb):_0x435d9f;return{'queries':_0xc64f47,'pagination':{'has_next_page':_0x40bec4||(_0x5d5fbb?_0x435d9f[_0x418e5d(0x89)]>_0x5d5fbb:![])}};}async[a101_0x369429(0xb6)](_0x203e05){const _0x5dbdee=a101_0x369429,_0x1fc5d6=await this['client'][_0x5dbdee(0x97)](),_0x678dc9=_0x1fc5d6[_0x5dbdee(0x86)](_0x4f07d2=>_0x4f07d2['name']===_0x203e05);if(!_0x678dc9)throw new SDKError(ErrorCode[_0x5dbdee(0xb8)],_0x5dbdee(0x8e)+_0x203e05);return{..._0x678dc9,'created_at':normalizeTimestamp(_0x678dc9[_0x5dbdee(0xa8)])??_0x678dc9[_0x5dbdee(0xa8)]};}async[a101_0x369429(0x9b)](_0x19c44d,_0x5f370e){const _0x5194f3=a101_0x369429;if(!_0x19c44d)throw new SDKError(ErrorCode[_0x5194f3(0xa2)],_0x5194f3(0x83));if(!_0x5f370e[_0x5194f3(0xb7)])throw new SDKError(ErrorCode[_0x5194f3(0xa2)],_0x5194f3(0xba));if(!_0x5f370e[_0x5194f3(0xae)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5194f3(0x80));if(!_0x5f370e[_0x5194f3(0x7b)])throw new SDKError(ErrorCode[_0x5194f3(0xa2)],_0x5194f3(0x7e));return await this['client'][_0x5194f3(0xa0)](_0x19c44d,_0x5f370e);}async[a101_0x369429(0x9a)](_0x4f4801,_0x5811e6){const _0x25ca75=a101_0x369429;if(!_0x4f4801)throw new SDKError(ErrorCode[_0x25ca75(0xa2)],_0x25ca75(0x83));return await this[_0x25ca75(0x8a)][_0x25ca75(0xb3)](_0x4f4801,_0x5811e6);}async[a101_0x369429(0x93)](_0x187ff4){const _0x52b370=a101_0x369429;if(!_0x187ff4)throw new SDKError(ErrorCode[_0x52b370(0xa2)],_0x52b370(0x83));return await this[_0x52b370(0x8a)][_0x52b370(0xaa)](_0x187ff4);}async[a101_0x369429(0xad)](_0x4ce15d,_0x2a60d3){const _0x1d4758=a101_0x369429;if(!_0x4ce15d)throw new SDKError(ErrorCode[_0x1d4758(0xa2)],_0x1d4758(0x83));let _0x4b47f1;if(_0x2a60d3?.[_0x1d4758(0x91)]){const _0x245b15=typeof _0x2a60d3[_0x1d4758(0x91)]===_0x1d4758(0x8b)?new Date(_0x2a60d3[_0x1d4758(0x91)]):_0x2a60d3[_0x1d4758(0x91)];if(isNaN(_0x245b15[_0x1d4758(0x99)]()))throw new SDKError(ErrorCode[_0x1d4758(0xa2)],_0x1d4758(0xab)+_0x2a60d3[_0x1d4758(0x91)]);_0x4b47f1=Math['floor'](_0x245b15[_0x1d4758(0x99)]()/0x3e8);}else _0x4b47f1=Math[_0x1d4758(0x84)](Date[_0x1d4758(0xaf)]()/0x3e8);if(_0x2a60d3?.[_0x1d4758(0x94)]!==undefined){if(_0x2a60d3[_0x1d4758(0x94)]<0x1||_0x2a60d3['num']>0xa)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1d4758(0xa6));}return await this[_0x1d4758(0x8a)][_0x1d4758(0x7c)](_0x4ce15d,_0x4b47f1,_0x2a60d3?.[_0x1d4758(0x94)]);}async[a101_0x369429(0xa9)](_0x26fe56,_0xa6dab7){const _0x36f5c0=a101_0x369429;if(!_0x26fe56)throw new SDKError(ErrorCode[_0x36f5c0(0xa2)],'Schedule\x20name\x20is\x20required');const _0x191af=await this[_0x36f5c0(0x8a)]['getScheduleHistory'](_0x26fe56,_0xa6dab7);return{..._0x191af,'history':_0x191af[_0x36f5c0(0xa9)][_0x36f5c0(0x85)](_0x435882=>({..._0x435882,'created_at':normalizeTimestamp(_0x435882[_0x36f5c0(0xa8)]),'start_at':normalizeTimestamp(_0x435882[_0x36f5c0(0x7f)]),'end_at':normalizeTimestamp(_0x435882['end_at'])}))};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a102_0x435497=a102_0x3b3f;(function(_0x173acf,_0x552b5d){const _0x48db62=a102_0x3b3f,_0x1e06fd=_0x173acf();while(!![]){try{const _0x5e2a61=parseInt(_0x48db62(0x224))/0x1*(-parseInt(_0x48db62(0x245))/0x2)+parseInt(_0x48db62(0x22e))/0x3*(parseInt(_0x48db62(0x239))/0x4)+parseInt(_0x48db62(0x24e))/0x5+parseInt(_0x48db62(0x209))/0x6*(parseInt(_0x48db62(0x1ef))/0x7)+parseInt(_0x48db62(0x231))/0x8*(parseInt(_0x48db62(0x25d))/0x9)+parseInt(_0x48db62(0x243))/0xa*(-parseInt(_0x48db62(0x234))/0xb)+parseInt(_0x48db62(0x21a))/0xc*(-parseInt(_0x48db62(0x223))/0xd);if(_0x5e2a61===_0x552b5d)break;else _0x1e06fd['push'](_0x1e06fd['shift']());}catch(_0x4974ca){_0x1e06fd['push'](_0x1e06fd['shift']());}}}(a102_0x405c,0xdc0b2));import*as a102_0x46e16e from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0xaa2de0,_0x4721df){const _0x32149f=a102_0x3b3f,_0x198ddf=_0xaa2de0[_0x32149f(0x204)]&&_0x32149f(0x23a)in _0xaa2de0[_0x32149f(0x204)]&&_0xaa2de0['rule'][_0x32149f(0x23a)];return{'type':_0x32149f(0x274),'name':_0xaa2de0[_0x32149f(0x215)],..._0xaa2de0[_0x32149f(0x255)]&&{'description':_0xaa2de0[_0x32149f(0x255)]},..._0x4721df&&{'folder':_0x4721df},..._0x198ddf&&{'rule':apiRuleToYaml(_0xaa2de0[_0x32149f(0x204)])},..._0xaa2de0['kind']!==undefined&&{'kind':_0xaa2de0[_0x32149f(0x238)]===0x0?'batch':_0xaa2de0[_0x32149f(0x238)]===0x1?'realtime':'funnel_stage'},..._0xaa2de0['isVisible']!==undefined&&{'visible':_0xaa2de0['isVisible']}};}export async function segmentResponseToDef(_0x4f6919,_0x342290,_0x5921c2){const _0x16f473=a102_0x3b3f,_0x1b1fa5=segmentResponseToDefSync(_0x4f6919,_0x5921c2);if(!_0x342290||!_0x342290[_0x16f473(0x22d)])return _0x1b1fa5;return _0x1b1fa5[_0x16f473(0x204)]&&(_0x1b1fa5[_0x16f473(0x204)]=await resolveRuleSegmentRefs(_0x1b1fa5['rule'],_0x342290[_0x16f473(0x22d)])),_0x1b1fa5;}export function apiRuleToYaml(_0x472e99){const _0x1d15a7=a102_0x3b3f,_0x5dfd71=(_0x472e99[_0x1d15a7(0x21e)]||[])[_0x1d15a7(0x200)](apiConditionToYaml);if(_0x5dfd71[_0x1d15a7(0x20b)]===0x1&&!_0x472e99['description']&&'type'in _0x5dfd71[0x0]&&(_0x5dfd71[0x0]['type']===_0x1d15a7(0x1ed)||_0x5dfd71[0x0][_0x1d15a7(0x23a)]==='Or')){const _0x59f28e=_0x5dfd71[0x0];if(_0x59f28e[_0x1d15a7(0x23a)]===_0x472e99[_0x1d15a7(0x23a)]&&_0x59f28e[_0x1d15a7(0x21e)])return{'type':_0x472e99['type'],'conditions':_0x59f28e[_0x1d15a7(0x21e)],..._0x59f28e[_0x1d15a7(0x255)]&&{'description':_0x59f28e['description']}};}return{'type':_0x472e99[_0x1d15a7(0x23a)],'conditions':_0x5dfd71,..._0x472e99[_0x1d15a7(0x255)]&&{'description':_0x472e99[_0x1d15a7(0x255)]}};}export async function resolveRuleSegmentRefs(_0x119adb,_0x340769){const _0xeabc10=a102_0x3b3f,_0x5906fd=await Promise['all'](_0x119adb[_0xeabc10(0x21e)][_0xeabc10(0x200)](_0x3372ad=>resolveConditionSegmentRefs(_0x3372ad,_0x340769)));return{..._0x119adb,'conditions':_0x5906fd};}async function resolveConditionSegmentRefs(_0x2a8998,_0x3e89eb){const _0x10f760=a102_0x3b3f;if('segment'in _0x2a8998&&(_0x2a8998[_0x10f760(0x23a)]===_0x10f760(0x201)||_0x2a8998[_0x10f760(0x23a)]===_0x10f760(0x21c))){const _0x2b3795=_0x2a8998;if(/^\d+$/[_0x10f760(0x230)](_0x2b3795['segment'])){const _0x546387=await _0x3e89eb(_0x2b3795[_0x10f760(0x274)]);return{..._0x2b3795,'segment':_0x546387};}return _0x2a8998;}if(_0x10f760(0x21e)in _0x2a8998&&_0x2a8998[_0x10f760(0x21e)]){const _0x42207f=_0x2a8998,_0x3c92d8=await Promise[_0x10f760(0x261)](_0x42207f[_0x10f760(0x21e)][_0x10f760(0x200)](_0x561dc6=>resolveConditionSegmentRefs(_0x561dc6,_0x3e89eb)));return{..._0x42207f,'conditions':_0x3c92d8};}if(_0x10f760(0x1ee)in _0x2a8998&&_0x2a8998[_0x10f760(0x1ee)]){const _0x40135e=_0x2a8998,_0x5906bd=await resolveRuleSegmentRefs(_0x40135e[_0x10f760(0x1ee)],_0x3e89eb);return{..._0x40135e,'filter':_0x5906bd};}return _0x2a8998;}export async function resolveRuleSegmentIds(_0x1c8b25,_0x12467c){const _0x2e76dd=a102_0x3b3f,_0x293f70=await Promise[_0x2e76dd(0x261)](_0x1c8b25[_0x2e76dd(0x21e)][_0x2e76dd(0x200)](_0x237181=>resolveConditionSegmentIds(_0x237181,_0x12467c)));return{..._0x1c8b25,'conditions':_0x293f70};}async function resolveConditionSegmentIds(_0xcfa668,_0x49954f){const _0x1db032=a102_0x3b3f;if(_0x1db032(0x274)in _0xcfa668&&(_0xcfa668[_0x1db032(0x23a)]===_0x1db032(0x201)||_0xcfa668['type']===_0x1db032(0x21c))){const _0x64e183=_0xcfa668;if(!/^\d+$/[_0x1db032(0x230)](_0x64e183[_0x1db032(0x274)])){const _0x469b83=await _0x49954f(_0x64e183[_0x1db032(0x274)]);return{..._0x64e183,'segment':_0x469b83};}return _0xcfa668;}if(_0x1db032(0x21e)in _0xcfa668&&_0xcfa668[_0x1db032(0x21e)]){const _0x83f698=_0xcfa668,_0x2053c7=await Promise[_0x1db032(0x261)](_0x83f698['conditions'][_0x1db032(0x200)](_0x802436=>resolveConditionSegmentIds(_0x802436,_0x49954f)));return{..._0x83f698,'conditions':_0x2053c7};}if(_0x1db032(0x1ee)in _0xcfa668&&_0xcfa668['filter']){const _0x10a9ae=_0xcfa668,_0x3e7adb=await resolveRuleSegmentIds(_0x10a9ae[_0x1db032(0x1ee)],_0x49954f);return{..._0x10a9ae,'filter':_0x3e7adb};}return _0xcfa668;}function apiConditionToYaml(_0x5e193b){const _0xa69553=a102_0x3b3f;if(_0x5e193b['type']==='And'||_0x5e193b[_0xa69553(0x23a)]==='Or'){if(_0x5e193b[_0xa69553(0x21e)]){const _0x4713c1=_0x5e193b['conditions'][_0xa69553(0x200)](apiConditionToYaml);if(_0x4713c1[_0xa69553(0x20b)]===0x1&&!_0x5e193b[_0xa69553(0x255)])return _0x4713c1[0x0];return{'type':_0x5e193b[_0xa69553(0x23a)],'conditions':_0x4713c1,..._0x5e193b[_0xa69553(0x255)]&&{'description':_0x5e193b[_0xa69553(0x255)]}};}}if(_0x5e193b[_0xa69553(0x23a)]===_0xa69553(0x220)&&_0x5e193b[_0xa69553(0x254)]&&_0x5e193b[_0xa69553(0x21d)]){const _0x395ee0=_0x5e193b['leftValue'][_0xa69553(0x257)]?{'type':_0x5e193b[_0xa69553(0x254)][_0xa69553(0x257)][_0xa69553(0x23a)],..._0x5e193b['leftValue']['aggregation'][_0xa69553(0x1f3)]&&{'groupingColumns':_0x5e193b[_0xa69553(0x254)][_0xa69553(0x257)]['groupingColumns']}}:undefined;return{'type':_0xa69553(0x220),'attribute':_0x5e193b[_0xa69553(0x254)][_0xa69553(0x215)]||'','operator':apiOperatorToYaml(_0x5e193b[_0xa69553(0x21d)]),..._0x5e193b[_0xa69553(0x1fa)]&&_0x5e193b[_0xa69553(0x1fa)]!==_0xa69553(0x20e)?{'arrayMatching':_0x5e193b[_0xa69553(0x1fa)]}:{},..._0x5e193b[_0xa69553(0x21c)]?{'exclude':_0x5e193b['exclude']}:{},..._0x395ee0?{'aggregation':_0x395ee0}:{},..._0x5e193b[_0xa69553(0x254)]['source']?{'source':_0x5e193b[_0xa69553(0x254)]['source'][_0xa69553(0x215)]}:{},..._0x5e193b['leftValue'][_0xa69553(0x1ee)]?{'filter':apiRuleToYaml(_0x5e193b[_0xa69553(0x254)]['filter'])}:{},..._0x5e193b['limit']!==undefined&&_0x5e193b[_0xa69553(0x244)]!==null?{'limit':_0x5e193b[_0xa69553(0x244)]}:{}};}if(_0x5e193b[_0xa69553(0x23a)]==='Reference'&&_0x5e193b['id'])return{'type':_0x5e193b[_0xa69553(0x21c)]?'exclude':_0xa69553(0x201),'segment':_0x5e193b['id']};return{'type':_0xa69553(0x1ed),'conditions':[]};}function isTemporalOperator(_0x242784){const _0x249770=a102_0x3b3f;return _0x242784==='TimeWithinPast'||_0x242784===_0x249770(0x253);}function getEffectiveValue(_0xac81c4){const _0x88815=a102_0x3b3f,_0x37d04a=_0xac81c4[_0x88815(0x1f6)];return _0xac81c4['value']??_0x37d04a;}function apiOperatorToYaml(_0xfe0f25){const _0x2f174d=a102_0x3b3f;let _0x4c31af;if(_0xfe0f25[_0x2f174d(0x214)]&&_0xfe0f25[_0x2f174d(0x214)][_0x2f174d(0x20b)]>0x0)_0x4c31af=_0xfe0f25[_0x2f174d(0x214)];else{if(_0xfe0f25[_0x2f174d(0x26c)]!==undefined)_0x4c31af=_0xfe0f25[_0x2f174d(0x26c)];else isTemporalOperator(_0xfe0f25[_0x2f174d(0x23a)])&&_0xfe0f25[_0x2f174d(0x229)]!==undefined&&(_0x4c31af=_0xfe0f25['value']);}return{'type':mapApiOperatorType(_0xfe0f25[_0x2f174d(0x23a)]),..._0xfe0f25[_0x2f174d(0x278)]&&{'not':_0xfe0f25[_0x2f174d(0x278)]},..._0x4c31af!==undefined&&{'value':_0x4c31af},..._0xfe0f25[_0x2f174d(0x1f5)]&&{'unit':_0xfe0f25[_0x2f174d(0x1f5)]}};}function mapApiOperatorType(_0x7d7d2a){return _0x7d7d2a;}export function segmentDefToCreateRequest(_0x1545e8,_0x4abc52){const _0x356be3=a102_0x3b3f,_0x307dfc={'name':_0x1545e8[_0x356be3(0x215)]};return _0x1545e8[_0x356be3(0x255)]&&(_0x307dfc['description']=_0x1545e8[_0x356be3(0x255)]),_0x1545e8[_0x356be3(0x204)]&&(_0x307dfc[_0x356be3(0x204)]=yamlRuleToApi(_0x1545e8[_0x356be3(0x204)])),_0x1545e8[_0x356be3(0x238)]&&(_0x307dfc[_0x356be3(0x238)]=_0x1545e8[_0x356be3(0x238)]===_0x356be3(0x203)?0x0:_0x1545e8['kind']===_0x356be3(0x23e)?0x1:0x2),_0x1545e8[_0x356be3(0x22a)]!==undefined&&(_0x307dfc[_0x356be3(0x225)]=_0x1545e8[_0x356be3(0x22a)]),_0x4abc52&&(_0x307dfc[_0x356be3(0x24c)]=_0x4abc52),_0x307dfc;}export function segmentDefToUpdateRequest(_0x5b5375){const _0x1eda63=a102_0x3b3f,_0x218324={'name':_0x5b5375[_0x1eda63(0x215)]};return _0x5b5375['description']!==undefined&&(_0x218324['description']=_0x5b5375[_0x1eda63(0x255)]),_0x5b5375[_0x1eda63(0x204)]&&(_0x218324['rule']=yamlRuleToApi(_0x5b5375[_0x1eda63(0x204)])),_0x5b5375[_0x1eda63(0x238)]&&(_0x218324[_0x1eda63(0x238)]=_0x5b5375['kind']==='batch'?0x0:_0x5b5375[_0x1eda63(0x238)]===_0x1eda63(0x23e)?0x1:0x2),_0x218324;}export function yamlRuleToApi(_0x1c5b55,_0x375c1=![]){const _0x415758=a102_0x3b3f,_0x312fa5=_0x1c5b55[_0x415758(0x21e)][_0x415758(0x200)](yamlConditionToApi);if(_0x375c1){const _0x5cd4d2=_0x312fa5['every'](_0x45bdf5=>_0x45bdf5[_0x415758(0x23a)]===_0x415758(0x1ed)||_0x45bdf5[_0x415758(0x23a)]==='Or');if(!_0x5cd4d2&&_0x312fa5[_0x415758(0x20b)]>0x0)return{'type':_0x1c5b55['type'],'conditions':[{'type':'And','description':_0x1c5b55[_0x415758(0x255)]||'','conditions':_0x312fa5}]};}return{'type':_0x1c5b55[_0x415758(0x23a)],'conditions':_0x312fa5,..._0x1c5b55[_0x415758(0x255)]&&{'description':_0x1c5b55[_0x415758(0x255)]}};}function yamlConditionToApi(_0x4b8c29){const _0x57f1e7=a102_0x3b3f;if(_0x57f1e7(0x274)in _0x4b8c29&&(_0x4b8c29[_0x57f1e7(0x23a)]===_0x57f1e7(0x201)||_0x4b8c29[_0x57f1e7(0x23a)]===_0x57f1e7(0x21c))){const _0x555e36=_0x4b8c29;return{'type':_0x57f1e7(0x1fc),'id':_0x555e36[_0x57f1e7(0x274)],'exclude':_0x555e36['type']===_0x57f1e7(0x21c)};}if(_0x57f1e7(0x23a)in _0x4b8c29&&(_0x4b8c29[_0x57f1e7(0x23a)]===_0x57f1e7(0x1ed)||_0x4b8c29['type']==='Or')){const _0x1dbfd2=_0x4b8c29;return{'type':_0x1dbfd2[_0x57f1e7(0x23a)],'conditions':_0x1dbfd2[_0x57f1e7(0x21e)]['map'](yamlConditionToApi),..._0x1dbfd2[_0x57f1e7(0x255)]&&{'description':_0x1dbfd2[_0x57f1e7(0x255)]}};}const _0x233266=_0x4b8c29,_0x597d02={'type':_0x57f1e7(0x220),'leftValue':buildLeftValue(_0x233266),'operator':yamlOperatorToApi(_0x233266[_0x57f1e7(0x21d)]),'exclude':_0x233266[_0x57f1e7(0x21c)]??![],'arrayMatching':_0x233266[_0x57f1e7(0x1fa)]??_0x57f1e7(0x20e)};return _0x233266[_0x57f1e7(0x244)]!==undefined&&(_0x597d02[_0x57f1e7(0x244)]=_0x233266[_0x57f1e7(0x244)]),_0x597d02;}function buildLeftValue(_0x230351){const _0x18eef0=a102_0x3b3f,_0x2198f1={'name':_0x230351[_0x18eef0(0x22f)]};return _0x230351['aggregation']&&(_0x2198f1[_0x18eef0(0x257)]={'type':_0x230351[_0x18eef0(0x257)]['type'],..._0x230351[_0x18eef0(0x257)][_0x18eef0(0x1f3)]&&{'groupingColumns':_0x230351['aggregation'][_0x18eef0(0x1f3)]}}),_0x230351[_0x18eef0(0x247)]&&(_0x2198f1[_0x18eef0(0x247)]={'name':_0x230351['source']}),_0x230351[_0x18eef0(0x1ee)]&&(_0x2198f1['filter']=yamlRuleToApi(_0x230351[_0x18eef0(0x1ee)])),_0x2198f1;}function yamlOperatorToApi(_0x4b85fb){const _0x2fbba2=a102_0x3b3f,_0x1b89f0={'type':mapYamlOperatorType(_0x4b85fb[_0x2fbba2(0x23a)]),'not':_0x4b85fb['not']??![]},_0x209e85=getEffectiveValue(_0x4b85fb);if(_0x209e85!==undefined){if(Array['isArray'](_0x209e85))_0x1b89f0[_0x2fbba2(0x214)]=_0x209e85;else isTemporalOperator(_0x4b85fb[_0x2fbba2(0x23a)])?_0x1b89f0[_0x2fbba2(0x229)]=_0x209e85:_0x1b89f0[_0x2fbba2(0x26c)]=_0x209e85;}return _0x4b85fb['unit']&&(_0x1b89f0[_0x2fbba2(0x1f5)]=_0x4b85fb[_0x2fbba2(0x1f5)]),_0x1b89f0;}function mapYamlOperatorType(_0x197957){return _0x197957;}export function toYamlString(_0x5f0547){const _0x203fbc=a102_0x3b3f,_0x393071=JSON[_0x203fbc(0x232)](JSON['stringify'](_0x5f0547)),_0x3e6ee5=a102_0x46e16e[_0x203fbc(0x264)](_0x393071,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x4a66bb=[_0x203fbc(0x259)];let _0x33599f=_0x3e6ee5;for(const _0x3d9acf of _0x4a66bb){_0x33599f=_0x33599f[_0x203fbc(0x205)](new RegExp('^('+_0x3d9acf+')','m'),(_0x4ecb92,_0x3074cd,_0x5a24be)=>{if(_0x5a24be===0x0||_0x33599f[_0x5a24be-0x1]==='\x0a'&&_0x33599f[_0x5a24be-0x2]==='\x0a')return _0x3074cd;return'\x0a'+_0x3074cd;});}return _0x33599f;}export function parseYamlString(_0x532bfe){const _0x3c854d=a102_0x3b3f,_0x9f5927=a102_0x46e16e[_0x3c854d(0x232)](_0x532bfe);if(!_0x9f5927[_0x3c854d(0x215)])throw new Error(_0x3c854d(0x269));if(_0x9f5927[_0x3c854d(0x23a)]&&_0x9f5927[_0x3c854d(0x23a)]!==_0x3c854d(0x274))throw new Error(_0x3c854d(0x272)+_0x9f5927[_0x3c854d(0x23a)]);return _0x9f5927;}export function isSegmentYaml(_0x2b7d73){const _0x51fa27=a102_0x3b3f;if(typeof _0x2b7d73!==_0x51fa27(0x20a)||_0x2b7d73===null)return![];const _0x55a4fa=_0x2b7d73;return _0x55a4fa[_0x51fa27(0x23a)]===_0x51fa27(0x274)||_0x55a4fa['type']===undefined;}export function generateTemplate(_0xbdd4a7=a102_0x435497(0x266)){const _0x47df9e=a102_0x435497,_0x2c723e={'type':_0x47df9e(0x274),'name':_0xbdd4a7,'description':_0x47df9e(0x23f),'rule':{'type':_0x47df9e(0x1ed),'conditions':[{'type':_0x47df9e(0x220),'attribute':_0x47df9e(0x1ec),'operator':{'type':'Equal','value':_0x47df9e(0x229)}}]}};return toYamlString(_0x2c723e);}export function segmentToYamlString(_0x5d0ba1){const _0x85ccbe=a102_0x435497,_0x2a685a=JSON['parse'](JSON[_0x85ccbe(0x264)](_0x5d0ba1)),_0x2c0c33=a102_0x46e16e[_0x85ccbe(0x264)](_0x2a685a,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0xb6ff95=[_0x85ccbe(0x259),_0x85ccbe(0x256)];let _0x6c2830=_0x2c0c33;for(const _0x962216 of _0xb6ff95){_0x6c2830=_0x6c2830['replace'](new RegExp('^('+_0x962216+')','m'),(_0x4c8d59,_0x1ae6e0,_0x427816)=>{if(_0x427816===0x0||_0x6c2830[_0x427816-0x1]==='\x0a'&&_0x6c2830[_0x427816-0x2]==='\x0a')return _0x1ae6e0;return'\x0a'+_0x1ae6e0;});}return _0x6c2830;}export function parseSegmentYamlFile(_0x4d8a18){const _0x269cb6=a102_0x435497,_0x3d6238=a102_0x46e16e[_0x269cb6(0x232)](_0x4d8a18);if(!_0x3d6238[_0x269cb6(0x215)])throw new Error(_0x269cb6(0x269));return _0x3d6238;}export function normalizeChildSegmentYaml(_0x1e9b34){const _0x1b2583=a102_0x435497;return{'type':'segment','name':_0x1e9b34['name'],..._0x1e9b34[_0x1b2583(0x255)]!==undefined&&{'description':_0x1e9b34[_0x1b2583(0x255)]},..._0x1e9b34[_0x1b2583(0x22b)]!==undefined&&{'folder':_0x1e9b34[_0x1b2583(0x22b)]},..._0x1e9b34[_0x1b2583(0x204)]&&{'rule':normalizeRule(_0x1e9b34['rule'])},..._0x1e9b34[_0x1b2583(0x238)]!==undefined&&{'kind':_0x1e9b34['kind']},..._0x1e9b34['visible']!==undefined&&{'visible':_0x1e9b34[_0x1b2583(0x22a)]},..._0x1e9b34['activations']&&{'activations':_0x1e9b34['activations'][_0x1b2583(0x200)](normalizeActivation)}};}export function normalizeRule(_0x46b2a7){const _0xe8dcf=a102_0x435497;return{'type':_0x46b2a7['type'],'conditions':_0x46b2a7[_0xe8dcf(0x21e)][_0xe8dcf(0x200)](normalizeCondition),..._0x46b2a7[_0xe8dcf(0x255)]!==undefined&&{'description':_0x46b2a7[_0xe8dcf(0x255)]}};}function normalizeCondition(_0x230796){const _0x1134c2=a102_0x435497;if(_0x1134c2(0x274)in _0x230796&&(_0x230796[_0x1134c2(0x23a)]===_0x1134c2(0x201)||_0x230796[_0x1134c2(0x23a)]===_0x1134c2(0x21c))){const _0x43d8eb=_0x230796;return{'type':_0x43d8eb['type'],'segment':_0x43d8eb[_0x1134c2(0x274)]};}if(_0x1134c2(0x23a)in _0x230796&&(_0x230796[_0x1134c2(0x23a)]===_0x1134c2(0x1ed)||_0x230796[_0x1134c2(0x23a)]==='Or')){const _0x1b25d7=_0x230796;return{'type':_0x1b25d7['type'],'conditions':_0x1b25d7['conditions']['map'](normalizeCondition),..._0x1b25d7[_0x1134c2(0x255)]!==undefined&&{'description':_0x1b25d7[_0x1134c2(0x255)]}};}const _0x589a0a=_0x230796;return{'type':_0x1134c2(0x220),'attribute':_0x589a0a[_0x1134c2(0x22f)],'operator':normalizeOperator(_0x589a0a[_0x1134c2(0x21d)]),..._0x589a0a['arrayMatching']!==undefined&&{'arrayMatching':_0x589a0a[_0x1134c2(0x1fa)]},..._0x589a0a[_0x1134c2(0x21c)]!==undefined&&{'exclude':_0x589a0a[_0x1134c2(0x21c)]},..._0x589a0a[_0x1134c2(0x257)]!==undefined&&{'aggregation':_0x589a0a['aggregation']},..._0x589a0a['source']!==undefined&&{'source':_0x589a0a[_0x1134c2(0x247)]},..._0x589a0a['filter']!==undefined&&{'filter':normalizeRule(_0x589a0a[_0x1134c2(0x1ee)])},..._0x589a0a['limit']!==undefined&&{'limit':_0x589a0a[_0x1134c2(0x244)]}};}function normalizeOperator(_0x563eee){const _0x41b4cd=a102_0x435497,_0x11a874=getEffectiveValue(_0x563eee);return{'type':_0x563eee['type'],..._0x563eee[_0x41b4cd(0x278)]!==undefined&&{'not':_0x563eee['not']},..._0x11a874!==undefined&&{'value':_0x11a874},..._0x563eee['min']!==undefined&&{'min':_0x563eee[_0x41b4cd(0x24b)]},..._0x563eee['max']!==undefined&&{'max':_0x563eee[_0x41b4cd(0x207)]},..._0x563eee[_0x41b4cd(0x1f5)]!==undefined&&{'unit':_0x563eee[_0x41b4cd(0x1f5)]},..._0x563eee[_0x41b4cd(0x1f0)]!==undefined&&{'duration':_0x563eee[_0x41b4cd(0x1f0)]},..._0x563eee[_0x41b4cd(0x251)]!==undefined&&{'from':_0x563eee[_0x41b4cd(0x251)]}};}function normalizeActivation(_0x8af785){const _0x4f3ccf=a102_0x435497;return{'name':_0x8af785[_0x4f3ccf(0x215)],'connection':_0x8af785[_0x4f3ccf(0x237)],..._0x8af785['description']!==undefined&&{'description':_0x8af785[_0x4f3ccf(0x255)]},..._0x8af785['all_columns']!==undefined&&{'all_columns':_0x8af785[_0x4f3ccf(0x235)]},..._0x8af785[_0x4f3ccf(0x228)]!==undefined&&{'columns':_0x8af785[_0x4f3ccf(0x228)]},..._0x8af785[_0x4f3ccf(0x26a)]!==undefined&&{'behavior':_0x8af785[_0x4f3ccf(0x26a)]},..._0x8af785['schedule']!==undefined&&{'schedule':_0x8af785[_0x4f3ccf(0x233)]},..._0x8af785[_0x4f3ccf(0x1ff)]!==undefined&&{'notification':_0x8af785[_0x4f3ccf(0x1ff)]},..._0x8af785[_0x4f3ccf(0x210)]!==undefined&&{'connector_config':_0x8af785[_0x4f3ccf(0x210)]},..._0x8af785[_0x4f3ccf(0x248)]!==undefined&&{'activation_template_id':_0x8af785[_0x4f3ccf(0x248)]}};}export function activationResponseToDef(_0x1b57ff,_0x3fb838,_0x2ad998){const _0x1f88f6=a102_0x435497,_0x624109=_0x1b57ff['connectionId']||'',_0x4eb477=_0x2ad998?.[_0x1f88f6(0x1fe)](_0x624109)??_0x624109,_0xd2f64a={'name':_0x1b57ff[_0x1f88f6(0x215)],'connection':_0x4eb477};_0x1b57ff['description']&&(_0xd2f64a['description']=_0x1b57ff[_0x1f88f6(0x255)]);let _0x546747=[];_0x1b57ff['columns']&&_0x1b57ff['columns'][_0x1f88f6(0x20b)]>0x0&&(_0x546747=_0x1b57ff[_0x1f88f6(0x228)]['filter'](_0x38571a=>_0x38571a&&_0x38571a[_0x1f88f6(0x215)])[_0x1f88f6(0x200)](_0x21b90f=>{const _0x331ac0=_0x1f88f6;if(_0x21b90f[_0x331ac0(0x23a)]||_0x21b90f[_0x331ac0(0x240)])return{'name':_0x21b90f[_0x331ac0(0x215)],..._0x21b90f['type']&&{'type':_0x21b90f[_0x331ac0(0x23a)]},..._0x21b90f[_0x331ac0(0x240)]&&{'visibility':_0x21b90f[_0x331ac0(0x240)]}};return _0x21b90f['name'];}));_0x546747[_0x1f88f6(0x20b)]>0x0&&(_0xd2f64a[_0x1f88f6(0x228)]=_0x546747);_0x1b57ff['allColumns']!==undefined&&(_0x1b57ff[_0x1f88f6(0x25a)]===![]&&_0x546747[_0x1f88f6(0x20b)]===0x0?_0xd2f64a[_0x1f88f6(0x235)]=!![]:_0xd2f64a['all_columns']=_0x1b57ff['allColumns']);const _0x5355a8={};let _0x3c1e5f=![];_0x1b57ff['scheduleType']&&(_0x5355a8[_0x1f88f6(0x23a)]=_0x1b57ff['scheduleType'],_0x3c1e5f=!![]);_0x1b57ff[_0x1f88f6(0x23c)]&&(_0x5355a8[_0x1f88f6(0x1f9)]=_0x1b57ff['repeatUnit'],_0x3c1e5f=!![]);_0x1b57ff[_0x1f88f6(0x1f7)]!==undefined&&_0x1b57ff[_0x1f88f6(0x1f7)]!==null&&(_0x5355a8[_0x1f88f6(0x263)]=_0x1b57ff[_0x1f88f6(0x1f7)],_0x3c1e5f=!![]);_0x1b57ff[_0x1f88f6(0x258)]&&_0x1b57ff[_0x1f88f6(0x258)][_0x1f88f6(0x20b)]>0x0&&(_0x5355a8[_0x1f88f6(0x227)]=_0x1b57ff['repeatSubFrequency'],_0x3c1e5f=!![]);_0x1b57ff[_0x1f88f6(0x213)]!==undefined&&(_0x5355a8['start_at']=_0x1b57ff[_0x1f88f6(0x213)],_0x3c1e5f=!![]);_0x1b57ff[_0x1f88f6(0x1fb)]!==undefined&&(_0x5355a8[_0x1f88f6(0x1f1)]=_0x1b57ff[_0x1f88f6(0x1fb)],_0x3c1e5f=!![]);_0x1b57ff[_0x1f88f6(0x1f8)]&&(_0x5355a8['timezone']=_0x1b57ff[_0x1f88f6(0x1f8)],_0x3c1e5f=!![]);_0x3c1e5f&&(_0xd2f64a[_0x1f88f6(0x233)]=_0x5355a8);(_0x1b57ff[_0x1f88f6(0x260)]&&_0x1b57ff[_0x1f88f6(0x260)][_0x1f88f6(0x20b)]>0x0||_0x1b57ff[_0x1f88f6(0x275)]&&_0x1b57ff[_0x1f88f6(0x275)][_0x1f88f6(0x20b)]>0x0)&&(_0xd2f64a[_0x1f88f6(0x1ff)]={},_0x1b57ff[_0x1f88f6(0x260)]&&_0x1b57ff['notifyOn'][_0x1f88f6(0x20b)]>0x0&&(_0xd2f64a[_0x1f88f6(0x1ff)][_0x1f88f6(0x217)]=_0x1b57ff[_0x1f88f6(0x260)]),_0x1b57ff[_0x1f88f6(0x275)]&&_0x1b57ff[_0x1f88f6(0x275)]['length']>0x0&&(_0xd2f64a['notification'][_0x1f88f6(0x25b)]=_0x1b57ff[_0x1f88f6(0x275)][_0x1f88f6(0x200)](_0x24cbac=>{const _0x4249ea=_0x1f88f6,_0x2d5324=_0x3fb838?.[_0x4249ea(0x1fe)](_0x24cbac);return _0x2d5324??String(_0x24cbac);})));_0x1b57ff[_0x1f88f6(0x26b)]&&Object[_0x1f88f6(0x226)](_0x1b57ff['connectorConfig'])[_0x1f88f6(0x20b)]>0x0&&(_0xd2f64a['connector_config']=normalizeConnectorConfigForYaml(_0x1b57ff[_0x1f88f6(0x26b)]));_0x1b57ff[_0x1f88f6(0x218)]&&(_0xd2f64a['activation_template_id']=_0x1b57ff['activationTemplateId']);if(_0x1b57ff['syndicationBehavior']){const _0x15473d={},_0x27cd27=_0x1b57ff[_0x1f88f6(0x25f)];_0x27cd27[_0x1f88f6(0x228)]&&_0x27cd27[_0x1f88f6(0x228)][_0x1f88f6(0x20b)]>0x0&&(_0x15473d[_0x1f88f6(0x228)]=_0x27cd27[_0x1f88f6(0x228)][_0x1f88f6(0x1ee)](_0x161c91=>_0x161c91&&_0x161c91['name'])[_0x1f88f6(0x200)](_0x1b6f4a=>({'name':_0x1b6f4a['name'],..._0x1b6f4a[_0x1f88f6(0x23a)]&&{'type':_0x1b6f4a[_0x1f88f6(0x23a)]},..._0x1b6f4a[_0x1f88f6(0x240)]&&{'visibility':_0x1b6f4a[_0x1f88f6(0x240)]}}))),_0x27cd27[_0x1f88f6(0x219)]&&(_0x15473d[_0x1f88f6(0x1f4)]=_0x27cd27['behaviorTableName']),_0x27cd27[_0x1f88f6(0x277)]!==undefined&&(_0x15473d[_0x1f88f6(0x252)]=_0x27cd27['joinRow']),_0x27cd27[_0x1f88f6(0x242)]&&(_0x15473d['join_strategy']=_0x27cd27[_0x1f88f6(0x242)]),_0x27cd27['formatting']&&(_0x15473d[_0x1f88f6(0x249)]=_0x27cd27[_0x1f88f6(0x249)]),_0x27cd27[_0x1f88f6(0x26e)]&&_0x27cd27[_0x1f88f6(0x26e)][_0x1f88f6(0x20b)]>0x0&&(_0x15473d[_0x1f88f6(0x26d)]=_0x27cd27['orderBy']),Object[_0x1f88f6(0x226)](_0x15473d)['length']>0x0&&(_0xd2f64a[_0x1f88f6(0x26a)]=_0x15473d);}return _0xd2f64a;}export function journeyActivationStepToYaml(_0x3a3ecc,_0x35a156,_0xe2d5e3){const _0x332ac0=a102_0x435497,_0x4a0f83=_0x3a3ecc['attributes'][_0x332ac0(0x216)],_0x44ed48=_0x4a0f83[_0x332ac0(0x21b)]||'',_0x146851=_0xe2d5e3?.[_0x332ac0(0x1fe)](_0x44ed48)??_0x44ed48,_0x4a5760={'name':_0x4a0f83[_0x332ac0(0x215)]||'','connection':_0x146851};_0x4a0f83[_0x332ac0(0x255)]&&(_0x4a5760[_0x332ac0(0x255)]=_0x4a0f83['description']);let _0x1537bc=[];_0x4a0f83[_0x332ac0(0x228)]&&_0x4a0f83[_0x332ac0(0x228)]['length']>0x0&&(_0x1537bc=_0x4a0f83[_0x332ac0(0x228)][_0x332ac0(0x1ee)](_0x2e7c3b=>_0x2e7c3b&&_0x2e7c3b['name'])[_0x332ac0(0x200)](_0x5defec=>{const _0x53fec2=_0x332ac0;if(_0x5defec[_0x53fec2(0x23a)]||_0x5defec[_0x53fec2(0x240)])return{'name':_0x5defec[_0x53fec2(0x215)],..._0x5defec[_0x53fec2(0x23a)]&&{'type':_0x5defec[_0x53fec2(0x23a)]},..._0x5defec[_0x53fec2(0x240)]&&{'visibility':_0x5defec['visibility']}};return _0x5defec['name'];}));_0x1537bc[_0x332ac0(0x20b)]>0x0&&(_0x4a5760[_0x332ac0(0x228)]=_0x1537bc);_0x4a0f83[_0x332ac0(0x25a)]!==undefined&&(_0x4a0f83[_0x332ac0(0x25a)]===![]&&_0x1537bc[_0x332ac0(0x20b)]===0x0?_0x4a5760[_0x332ac0(0x235)]=!![]:_0x4a5760[_0x332ac0(0x235)]=_0x4a0f83['allColumns']);const _0x2f37f7={};let _0x11493d=![];_0x4a0f83[_0x332ac0(0x26f)]&&(_0x2f37f7[_0x332ac0(0x23a)]=_0x4a0f83['scheduleType'],_0x11493d=!![]);_0x4a0f83[_0x332ac0(0x23c)]&&(_0x2f37f7[_0x332ac0(0x1f9)]=_0x4a0f83[_0x332ac0(0x23c)],_0x11493d=!![]);_0x4a0f83[_0x332ac0(0x1f7)]!==undefined&&_0x4a0f83['repeatFrequency']!==null&&(_0x2f37f7['repeat_frequency']=_0x4a0f83['repeatFrequency'],_0x11493d=!![]);_0x4a0f83['startAt']!==undefined&&(_0x2f37f7['start_at']=_0x4a0f83[_0x332ac0(0x213)],_0x11493d=!![]);_0x4a0f83[_0x332ac0(0x1fb)]!==undefined&&(_0x2f37f7['end_on']=_0x4a0f83['endOn'],_0x11493d=!![]);_0x4a0f83['timezone']&&(_0x2f37f7[_0x332ac0(0x1f8)]=_0x4a0f83['timezone'],_0x11493d=!![]);_0x11493d&&(_0x4a5760[_0x332ac0(0x233)]=_0x2f37f7);(_0x4a0f83['notifyOn']&&_0x4a0f83['notifyOn'][_0x332ac0(0x20b)]>0x0||_0x4a0f83[_0x332ac0(0x275)]&&_0x4a0f83['emailRecipients'][_0x332ac0(0x20b)]>0x0)&&(_0x4a5760[_0x332ac0(0x1ff)]={},_0x4a0f83[_0x332ac0(0x260)]&&_0x4a0f83[_0x332ac0(0x260)][_0x332ac0(0x20b)]>0x0&&(_0x4a5760[_0x332ac0(0x1ff)][_0x332ac0(0x217)]=_0x4a0f83[_0x332ac0(0x260)]),_0x4a0f83[_0x332ac0(0x275)]&&_0x4a0f83[_0x332ac0(0x275)]['length']>0x0&&(_0x4a5760[_0x332ac0(0x1ff)][_0x332ac0(0x25b)]=_0x4a0f83[_0x332ac0(0x275)][_0x332ac0(0x200)](_0x3874ae=>{const _0x178387=_0x332ac0,_0x233922=_0x35a156?.[_0x178387(0x1fe)](_0x3874ae);return _0x233922??String(_0x3874ae);})));_0x4a0f83[_0x332ac0(0x26b)]&&Object[_0x332ac0(0x226)](_0x4a0f83[_0x332ac0(0x26b)])[_0x332ac0(0x20b)]>0x0&&(_0x4a5760[_0x332ac0(0x210)]=normalizeConnectorConfigForYaml(_0x4a0f83[_0x332ac0(0x26b)]));_0x4a0f83[_0x332ac0(0x218)]&&(_0x4a5760[_0x332ac0(0x248)]=_0x4a0f83[_0x332ac0(0x218)]);if(_0x4a0f83[_0x332ac0(0x25f)]){const _0x338db1={},_0x235d54=_0x4a0f83['syndicationBehavior'];_0x235d54['columns']&&_0x235d54[_0x332ac0(0x228)][_0x332ac0(0x20b)]>0x0&&(_0x338db1[_0x332ac0(0x228)]=_0x235d54[_0x332ac0(0x228)][_0x332ac0(0x1ee)](_0x2c6961=>_0x2c6961&&_0x2c6961[_0x332ac0(0x215)])[_0x332ac0(0x200)](_0x4c3ebb=>({'name':_0x4c3ebb['name'],..._0x4c3ebb[_0x332ac0(0x23a)]&&{'type':_0x4c3ebb[_0x332ac0(0x23a)]},..._0x4c3ebb['visibility']&&{'visibility':_0x4c3ebb[_0x332ac0(0x240)]}}))),_0x235d54['behaviorTableName']&&(_0x338db1[_0x332ac0(0x1f4)]=_0x235d54[_0x332ac0(0x219)]),_0x235d54['joinRow']!==undefined&&(_0x338db1['join_row']=_0x235d54[_0x332ac0(0x277)]),_0x235d54['joinStrategy']&&(_0x338db1[_0x332ac0(0x24d)]=_0x235d54[_0x332ac0(0x242)]),_0x235d54[_0x332ac0(0x249)]&&(_0x338db1[_0x332ac0(0x249)]=_0x235d54[_0x332ac0(0x249)]),_0x235d54['orderBy']&&_0x235d54[_0x332ac0(0x26e)][_0x332ac0(0x20b)]>0x0&&(_0x338db1['order_by']=_0x235d54[_0x332ac0(0x26e)]),Object[_0x332ac0(0x226)](_0x338db1)[_0x332ac0(0x20b)]>0x0&&(_0x4a5760[_0x332ac0(0x26a)]=_0x338db1);}return _0x4a5760;}export function segmentWithActivationsToYaml(_0x2122b7,_0x3630a9,_0x216a20,_0x3f077e,_0x45a657){const _0x251b54=a102_0x435497,_0x1d91a8=segmentResponseToDefSync(_0x2122b7,_0x216a20);return _0x3630a9[_0x251b54(0x20b)]>0x0&&(_0x1d91a8['activations']=_0x3630a9[_0x251b54(0x200)](_0x252a53=>activationResponseToDef(_0x252a53,_0x3f077e,_0x45a657))),_0x1d91a8;}function normalizeColumn(_0x16b5db){const _0x21565c=a102_0x435497;if(typeof _0x16b5db==='string')return{'name':_0x16b5db};return{'name':_0x16b5db[_0x21565c(0x215)],..._0x16b5db[_0x21565c(0x23a)]&&{'type':_0x16b5db[_0x21565c(0x23a)]},..._0x16b5db[_0x21565c(0x240)]&&{'visibility':_0x16b5db[_0x21565c(0x240)]}};}function a102_0x405c(){const _0x59fecd=['connector_config','add','warnings','startAt','rightValues','name','activationParams','notify_on','activationTemplateId','behaviorTableName','12MhxOrY','connectionId','exclude','operator','conditions','Unknown\x20email\x20recipient:\x20','Value','emailToIdMap','forEach','2386982EsLRkL','1vLLhTn','isVisible','keys','repeat_sub_frequency','columns','value','visible','folder','\x27:\x20','resolveSegmentName','140433zVAkrS','attribute','test','1168ICOrGU','parse','schedule','64097cOtqkV','all_columns','usedNames','connection','kind','92gVIaiS','type','localRuleToName','repeatUnit','\x0a\x0aAvailable\x20fields:\x0a','realtime','Segment\x20description','visibility','INVALID_ARGUMENT','joinStrategy','1990aCnTyV','limit','2813316CfbQJd','Connector:\x20','source','activation_template_id','formatting','code','min','segmentFolderId','join_strategy','5163660QAQSxo','connectionNameToTypeMap','Please\x20specify\x20a\x20valid\x20attribute\x20name.','from','join_row','TimeWithinNext','leftValue','description','activations:','aggregation','repeatSubFrequency','rule:','allColumns','email_recipients','localeCompare','5805tOoxbY','].attribute\x20cannot\x20be\x20empty.\x0a','syndicationBehavior','notifyOn','all','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','repeat_frequency','stringify','getSchema','New\x20Segment','sort','JOURNEY_SYNTAX_ERROR','YAML\x20config\x20missing\x20required\x20field:\x20name','behavior','connectorConfig','rightValue','order_by','orderBy','scheduleType','string','set','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','has','segment','emailRecipients','__UNRESOLVED__','joinRow','not','connectionNameToIdMap','attribute_name','And','filter','7mLeddc','duration','end_on','\x22:\x0a','groupingColumns','behavior_table','unit','values','repeatFrequency','timezone','repeat_unit','arrayMatching','endOn','Reference','push','get','notification','map','include','Unknown\x20connection:\x20','batch','rule','replace','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','max','start_at','8685528hcrZbZ','object','length','errors','toLowerCase','any','isArray'];a102_0x405c=function(){return _0x59fecd;};return a102_0x405c();}function a102_0x3b3f(_0x28f93b,_0x51fa4f){_0x28f93b=_0x28f93b-0x1ec;const _0x405c17=a102_0x405c();let _0x3b3f99=_0x405c17[_0x28f93b];return _0x3b3f99;}export async function activationDefToCreateRequest(_0x29a104,_0x961a97){const _0x52f96e=a102_0x435497,_0x281bf6=_0x961a97?.[_0x52f96e(0x221)],_0x466de2=_0x961a97?.[_0x52f96e(0x279)],_0x51f7d5=_0x29a104[_0x52f96e(0x237)];let _0x48b633;const _0x29820d=parseInt(_0x51f7d5,0xa);if(!isNaN(_0x29820d)&&String(_0x29820d)===_0x51f7d5)_0x48b633=_0x29820d;else{const _0x43be6d=_0x466de2?.[_0x52f96e(0x1fe)](_0x51f7d5);if(_0x43be6d===undefined)throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0x52f96e(0x202)+_0x51f7d5,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x48b633=_0x43be6d;}const _0x853425={'name':_0x29a104['name'],'connectionId':_0x48b633};_0x29a104[_0x52f96e(0x255)]&&(_0x853425['description']=_0x29a104['description']);let _0x5bfa87=[];_0x29a104['columns']&&_0x29a104[_0x52f96e(0x228)][_0x52f96e(0x20b)]>0x0&&(_0x5bfa87=_0x29a104['columns'][_0x52f96e(0x1ee)](_0x18c3d2=>_0x18c3d2!=null)[_0x52f96e(0x200)](normalizeColumn));_0x5bfa87[_0x52f96e(0x20b)]>0x0&&(_0x853425[_0x52f96e(0x228)]=_0x5bfa87);_0x29a104[_0x52f96e(0x235)]!==undefined&&(_0x29a104[_0x52f96e(0x235)]===![]&&_0x5bfa87[_0x52f96e(0x20b)]===0x0?_0x853425[_0x52f96e(0x25a)]=!![]:_0x853425[_0x52f96e(0x25a)]=_0x29a104[_0x52f96e(0x235)]);if(_0x29a104['schedule']){const _0x36c6b5=_0x29a104[_0x52f96e(0x233)];_0x36c6b5[_0x52f96e(0x23a)]&&(_0x853425[_0x52f96e(0x26f)]=_0x36c6b5[_0x52f96e(0x23a)]),_0x36c6b5[_0x52f96e(0x1f9)]&&(_0x853425['repeatUnit']=_0x36c6b5[_0x52f96e(0x1f9)]),_0x36c6b5[_0x52f96e(0x263)]!==undefined&&(_0x853425[_0x52f96e(0x1f7)]=_0x36c6b5['repeat_frequency']),_0x36c6b5[_0x52f96e(0x227)]&&(_0x853425[_0x52f96e(0x258)]=_0x36c6b5[_0x52f96e(0x227)]),_0x36c6b5[_0x52f96e(0x208)]!==undefined&&(_0x853425[_0x52f96e(0x213)]=_0x36c6b5[_0x52f96e(0x208)]),_0x36c6b5[_0x52f96e(0x1f1)]!==undefined&&(_0x853425[_0x52f96e(0x1fb)]=_0x36c6b5[_0x52f96e(0x1f1)]),_0x36c6b5[_0x52f96e(0x1f8)]&&(_0x853425['timezone']=_0x36c6b5['timezone']);}_0x29a104[_0x52f96e(0x1ff)]&&(_0x29a104[_0x52f96e(0x1ff)][_0x52f96e(0x217)]&&(_0x853425[_0x52f96e(0x260)]=_0x29a104[_0x52f96e(0x1ff)][_0x52f96e(0x217)]),_0x29a104[_0x52f96e(0x1ff)][_0x52f96e(0x25b)]&&(_0x853425[_0x52f96e(0x275)]=_0x29a104[_0x52f96e(0x1ff)][_0x52f96e(0x25b)]['map'](_0x4d47c6=>{const _0x1a869c=_0x52f96e,_0x3a9769=Number(_0x4d47c6);if(!isNaN(_0x3a9769)&&String(_0x3a9769)===_0x4d47c6)return _0x3a9769;const _0x197dea=_0x281bf6?.[_0x1a869c(0x1fe)](_0x4d47c6[_0x1a869c(0x20d)]());if(_0x197dea===undefined)throw new SDKError(ErrorCode[_0x1a869c(0x241)],_0x1a869c(0x21f)+_0x4d47c6+_0x1a869c(0x262));return _0x197dea;})));if(_0x29a104['connector_config']){const _0x5986d0=_0x961a97?.[_0x52f96e(0x24f)]?.[_0x52f96e(0x1fe)](_0x51f7d5);if(_0x5986d0&&_0x961a97?.[_0x52f96e(0x265)])try{const _0x26c513=await _0x961a97[_0x52f96e(0x265)](_0x5986d0),_0x3fa281=validateConnectorConfig(_0x29a104[_0x52f96e(0x210)],_0x26c513);if(!_0x3fa281['valid'])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x29a104['name']+_0x52f96e(0x1f2)+formatValidationErrors(_0x3fa281[_0x52f96e(0x20c)]),undefined,{'helpText':_0x52f96e(0x246)+_0x5986d0+_0x52f96e(0x23d)+formatSchemaAsHelp(_0x26c513)});if(_0x3fa281[_0x52f96e(0x212)][_0x52f96e(0x20b)]>0x0){const _0x31333e=formatValidationWarnings(_0x3fa281[_0x52f96e(0x212)]);console['warn']('connector_config\x20for\x20activation\x20\x22'+_0x29a104[_0x52f96e(0x215)]+_0x52f96e(0x1f2)+_0x31333e);}_0x853425['connectorConfig']=transformConfigToLegacy(_0x29a104[_0x52f96e(0x210)],_0x26c513);}catch(_0x42b897){if(_0x42b897 instanceof SDKError&&_0x42b897[_0x52f96e(0x24a)]===ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])_0x853425['connectorConfig']=_0x29a104[_0x52f96e(0x210)];else throw _0x42b897;}else _0x853425[_0x52f96e(0x26b)]=_0x29a104[_0x52f96e(0x210)];}_0x29a104[_0x52f96e(0x248)]!==undefined&&(_0x853425[_0x52f96e(0x218)]=_0x29a104[_0x52f96e(0x248)]);if(_0x29a104[_0x52f96e(0x26a)]){const _0x52c37c=_0x29a104[_0x52f96e(0x26a)],_0x517d44={};if(_0x52c37c[_0x52f96e(0x228)]&&_0x52c37c[_0x52f96e(0x228)][_0x52f96e(0x20b)]>0x0){const _0x29ac5c=_0x52c37c[_0x52f96e(0x228)][_0x52f96e(0x1ee)](_0x327598=>_0x327598&&_0x327598['name']);_0x29ac5c['length']>0x0&&(_0x517d44['columns']=_0x29ac5c);}_0x52c37c[_0x52f96e(0x1f4)]&&(_0x517d44[_0x52f96e(0x219)]=_0x52c37c['behavior_table']),_0x52c37c['join_row']!==undefined&&(_0x517d44['joinRow']=_0x52c37c[_0x52f96e(0x252)]),_0x52c37c['join_strategy']&&(_0x517d44[_0x52f96e(0x242)]=_0x52c37c['join_strategy']),_0x52c37c[_0x52f96e(0x249)]&&(_0x517d44['formatting']=_0x52c37c[_0x52f96e(0x249)]),_0x52c37c['order_by']&&(_0x517d44['orderBy']=_0x52c37c[_0x52f96e(0x26d)]),_0x853425[_0x52f96e(0x25f)]=_0x517d44;}return _0x853425;}export async function activationDefToUpdateRequest(_0x5ca34a,_0x34fb6d){return activationDefToCreateRequest(_0x5ca34a,_0x34fb6d);}export function deepSortObject(_0x5dee2f){const _0x33bde6=a102_0x435497;if(_0x5dee2f===null||typeof _0x5dee2f!==_0x33bde6(0x20a))return _0x5dee2f;if(Array['isArray'](_0x5dee2f))return _0x5dee2f[_0x33bde6(0x200)](deepSortObject)[_0x33bde6(0x267)]((_0x4a8e1e,_0x1d20e9)=>JSON[_0x33bde6(0x264)](_0x4a8e1e)[_0x33bde6(0x25c)](JSON['stringify'](_0x1d20e9)));const _0x134265={};for(const _0x47e4d4 of Object[_0x33bde6(0x226)](_0x5dee2f)[_0x33bde6(0x267)]()){_0x134265[_0x47e4d4]=deepSortObject(_0x5dee2f[_0x47e4d4]);}return _0x134265;}export function serializeRule(_0x3b954e){return JSON['stringify'](deepSortObject(_0x3b954e));}export function normalizeRuleForMatching(_0xc0d7c7){return normalizeConditionsForMatching(_0xc0d7c7);}function normalizeConditionsForMatching(_0x15bec8){const _0x433978=a102_0x435497;if(_0x15bec8===null||typeof _0x15bec8!==_0x433978(0x20a))return _0x15bec8;if(Array[_0x433978(0x20f)](_0x15bec8))return _0x15bec8[_0x433978(0x200)](normalizeConditionsForMatching);const _0x202771=_0x15bec8;if((_0x202771[_0x433978(0x23a)]===_0x433978(0x201)||_0x202771[_0x433978(0x23a)]===_0x433978(0x21c))&&typeof _0x202771[_0x433978(0x274)]==='string')return{..._0x202771,'segment':'__SEGMENT_REF__'};const _0x582a1a={};for(const _0x5eb59e of Object[_0x433978(0x226)](_0x202771)){_0x582a1a[_0x5eb59e]=normalizeConditionsForMatching(_0x202771[_0x5eb59e]);}return _0x582a1a;}export function serializeRuleForMatching(_0x32c37f){return JSON['stringify'](deepSortObject(normalizeRuleForMatching(_0x32c37f)));}export function expandSegmentReferences(_0x15aad2,_0x3e382f,_0x3fec1b=new Set()){return expandConditions(_0x15aad2,_0x3e382f,_0x3fec1b);}function expandConditions(_0x56aaae,_0x9ed83b,_0x5bab04){const _0x5ce63e=a102_0x435497;if(_0x56aaae===null||typeof _0x56aaae!==_0x5ce63e(0x20a))return _0x56aaae;if(Array['isArray'](_0x56aaae))return _0x56aaae[_0x5ce63e(0x200)](_0x59e6c0=>expandConditions(_0x59e6c0,_0x9ed83b,_0x5bab04));const _0x571720=_0x56aaae;if((_0x571720[_0x5ce63e(0x23a)]===_0x5ce63e(0x201)||_0x571720[_0x5ce63e(0x23a)]==='exclude')&&typeof _0x571720['segment']==='string'){const _0x52dbd2=_0x571720[_0x5ce63e(0x274)],_0x440f16=_0x9ed83b[_0x5ce63e(0x1fe)](_0x52dbd2);if(_0x440f16&&!_0x5bab04['has'](_0x52dbd2)){const _0x21761c=new Set(_0x5bab04);_0x21761c[_0x5ce63e(0x211)](_0x52dbd2);const _0x55c5ab=expandConditions(_0x440f16,_0x9ed83b,_0x21761c);return{'type':_0x571720[_0x5ce63e(0x23a)],'expanded_rule':_0x55c5ab};}return{'type':_0x571720[_0x5ce63e(0x23a)],'expanded_rule':_0x5ce63e(0x276)};}const _0x3abd6a={};for(const _0x2cfff9 of Object[_0x5ce63e(0x226)](_0x571720)){_0x3abd6a[_0x2cfff9]=expandConditions(_0x571720[_0x2cfff9],_0x9ed83b,_0x5bab04);}return _0x3abd6a;}export function serializeExpandedRule(_0x4043b1,_0x4df523){const _0x1cf6df=expandSegmentReferences(_0x4043b1,_0x4df523);return JSON['stringify'](deepSortObject(_0x1cf6df));}export function createSegmentNameContext(_0x11de44){const _0x2cf0f5=a102_0x435497,_0x3d4933=new Set(),_0xfa8d8d=new Map(),_0x38ea04=new Map();if(_0x11de44)for(const [_0x59f43e,_0x241104]of Object['entries'](_0x11de44)){if(_0x241104[_0x2cf0f5(0x204)]){const _0x17ab3b=serializeRule(_0x241104[_0x2cf0f5(0x204)]);_0x38ea04[_0x2cf0f5(0x271)](_0x17ab3b,_0x59f43e),_0x3d4933[_0x2cf0f5(0x211)](_0x59f43e);}}return{'usedNames':_0x3d4933,'ruleHashToName':_0xfa8d8d,'localRuleToName':_0x11de44?_0x38ea04:undefined};}export function resolveSegmentName(_0x35ff77,_0x1857e3,_0x40122a,_0x50c98e){const _0x3d5180=a102_0x435497,_0x5cfdc6=serializeRule(_0x1857e3);if(_0x40122a[_0x3d5180(0x23b)]){const _0x2a16cd=_0x40122a[_0x3d5180(0x23b)][_0x3d5180(0x1fe)](_0x5cfdc6);if(_0x2a16cd)return{'name':_0x2a16cd,'isDuplicate':![],'isLocalMatch':!![]};}const _0x5a768a=_0x40122a['ruleHashToName']['get'](_0x5cfdc6);if(_0x5a768a)return{'name':_0x5a768a,'isDuplicate':!![],'isLocalMatch':![]};const _0x221c27=_0x50c98e(_0x35ff77);let _0x3b9d86=_0x221c27||_0x35ff77,_0x165226=_0x3b9d86,_0x2f1e35=0x2;while(_0x40122a['usedNames'][_0x3d5180(0x273)](_0x165226)){_0x165226=_0x3b9d86+'_'+_0x2f1e35,_0x2f1e35++;}return _0x40122a[_0x3d5180(0x236)][_0x3d5180(0x211)](_0x165226),_0x40122a['ruleHashToName'][_0x3d5180(0x271)](_0x5cfdc6,_0x165226),{'name':_0x165226,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x46387c){const _0x4a1bed=[],_0x35d94e=_0x4899bf=>{const _0x2c9dbf=a102_0x3b3f;if(!_0x4899bf||typeof _0x4899bf!==_0x2c9dbf(0x20a))return;if(Array[_0x2c9dbf(0x20f)](_0x4899bf)){_0x4899bf[_0x2c9dbf(0x222)](_0x35d94e);return;}const _0x5e6a79=_0x4899bf;(_0x5e6a79[_0x2c9dbf(0x23a)]===_0x2c9dbf(0x201)||_0x5e6a79['type']==='exclude')&&typeof _0x5e6a79[_0x2c9dbf(0x274)]===_0x2c9dbf(0x270)&&_0x4a1bed[_0x2c9dbf(0x1fd)](_0x5e6a79[_0x2c9dbf(0x274)]);for(const _0xe10494 of Object['values'](_0x5e6a79)){_0x35d94e(_0xe10494);}};return _0x35d94e(_0x46387c),_0x4a1bed;}export function validateSegmentRule(_0x33f7a1,_0x3c7b74){const _0x2315a4=a102_0x435497;if(!_0x3c7b74||!_0x3c7b74['conditions'])return;for(let _0x4fbb28=0x0;_0x4fbb28<_0x3c7b74[_0x2315a4(0x21e)][_0x2315a4(0x20b)];_0x4fbb28++){const _0x25bf7e=_0x3c7b74[_0x2315a4(0x21e)][_0x4fbb28];if(_0x2315a4(0x23a)in _0x25bf7e&&_0x25bf7e[_0x2315a4(0x23a)]===_0x2315a4(0x220)){const _0x3f477f=_0x25bf7e;if(!_0x3f477f['attribute']||_0x3f477f[_0x2315a4(0x22f)]==='')throw new SDKError(ErrorCode[_0x2315a4(0x268)],_0x2315a4(0x206)+_0x33f7a1+_0x2315a4(0x22c)+('conditions['+_0x4fbb28+_0x2315a4(0x25e))+_0x2315a4(0x250));}}}
|
|
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 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x273f1a,_0x47d6c4){const _0x259563=a103_0x2217,_0x5942bd=_0x273f1a();while(!![]){try{const _0x56a612=parseInt(_0x259563(0xc9))/0x1*(parseInt(_0x259563(0xdb))/0x2)+parseInt(_0x259563(0xd2))/0x3*(-parseInt(_0x259563(0xd5))/0x4)+-parseInt(_0x259563(0xcc))/0x5*(parseInt(_0x259563(0xdd))/0x6)+-parseInt(_0x259563(0xf3))/0x7+-parseInt(_0x259563(0xd3))/0x8+-parseInt(_0x259563(0xd9))/0x9+parseInt(_0x259563(0xf0))/0xa;if(_0x56a612===_0x47d6c4)break;else _0x5942bd['push'](_0x5942bd['shift']());}catch(_0x138aa2){_0x5942bd['push'](_0x5942bd['shift']());}}}(a103_0x29c5,0x6d41e));import a103_0x562328 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x551d70){const _0x2f9306=a103_0x2217,_0x5ec8d4=_0x551d70[_0x2f9306(0xdc)][_0x2f9306(0xdf)](_0x20881f=>({'column_name':_0x20881f[_0x2f9306(0xc5)],'column_type':_0x20881f[_0x2f9306(0xc7)],'null':_0x2f9306(0xc4),'key':null,'default':null,'extra':null}));return{..._0x551d70,'columns':[{'name':_0x2f9306(0xeb),'type':_0x2f9306(0xe9)},{'name':_0x2f9306(0xec),'type':_0x2f9306(0xe9)},{'name':'null','type':_0x2f9306(0xe9)},{'name':_0x2f9306(0xea),'type':_0x2f9306(0xe9)},{'name':_0x2f9306(0xe2),'type':_0x2f9306(0xe9)},{'name':'extra','type':_0x2f9306(0xe9)}],'data':_0x5ec8d4};}export async function executeSchemaQuery(_0x20bf05,_0x2e0a12,_0x11cbeb){const _0xee6bd6=a103_0x2217,_0x1308ec=_0x20bf05[_0xee6bd6(0xe3)]()[_0xee6bd6(0xde)](/;+$/,''),_0x29719d=_0xee6bd6(0xf9)+_0x1308ec+_0xee6bd6(0xd0);_0x11cbeb[_0xee6bd6(0xcd)]&&console['error'](_0xee6bd6(0xe4)+_0x29719d);const _0x5535d9=await withProgressSpinner('Fetching\x20schema...',async _0x2eb7b0=>{const _0x1f29d9=_0xee6bd6,_0x16ce38=await _0x2e0a12['query'][_0x1f29d9(0xe0)](_0x29719d,{'catalog':'td','schema':_0x1f29d9(0xe5),'onJobId':_0x353cbb=>{const _0x30c949=_0x1f29d9;_0x2eb7b0[_0x30c949(0xf4)](_0x353cbb);}});return _0x16ce38;},{'verbose':_0x11cbeb[_0xee6bd6(0xcd)]});return buildSchemaResult(_0x5535d9[_0xee6bd6(0xf7)]);}export function displayFieldsHumanReadable(_0x13f0a5,_0x5f25c4){const _0x560d92=a103_0x2217,_0x60d537=_0x13f0a5['filter'](_0x2e78ee=>_0x2e78ee['source']==='attribute'),_0x376eb9=_0x13f0a5[_0x560d92(0xc8)](_0x38953c=>_0x38953c[_0x560d92(0xef)]==='behavior'),_0x3a35c9=new Map();for(const _0x3eb541 of _0x60d537){const _0xf15b33=_0x3eb541['groupingName']||_0x3eb541[_0x560d92(0xca)]||_0x560d92(0xc6),_0x174962=_0x3a35c9[_0x560d92(0xd6)](_0xf15b33);_0x174962?_0x174962[_0x560d92(0xd7)][_0x560d92(0xf1)](_0x3eb541):_0x3a35c9[_0x560d92(0xf2)](_0xf15b33,{'displayName':_0xf15b33,'tableName':_0x3eb541[_0x560d92(0xca)],'fields':[_0x3eb541]});}const _0x2f9efd=new Map();for(const _0x506b36 of _0x376eb9){const _0x3ab7d6=_0x506b36[_0x560d92(0xe6)]||'Unknown',_0x5b8eca=_0x2f9efd[_0x560d92(0xd6)](_0x3ab7d6)||[];_0x5b8eca[_0x560d92(0xf1)](_0x506b36),_0x2f9efd[_0x560d92(0xf2)](_0x3ab7d6,_0x5b8eca);}console['error']('\x0a'+a103_0x562328[_0x560d92(0xda)](_0x5f25c4));if(_0x3a35c9[_0x560d92(0xcb)]>0x0){console[_0x560d92(0xe7)]('\x0a'+a103_0x562328['dim'](_0x560d92(0xed)));const _0x2f749c=[..._0x3a35c9[_0x560d92(0xd4)]()][_0x560d92(0xcf)]((_0x89f12f,_0x4591c0)=>_0x89f12f[0x0][_0x560d92(0xce)](_0x4591c0[0x0]));for(const [,_0x21d385]of _0x2f749c){const _0x200e9b=_0x21d385[_0x560d92(0xee)]&&_0x21d385[_0x560d92(0xee)]!==_0x21d385[_0x560d92(0xd8)]?'\x20'+a103_0x562328['dim']('('+_0x21d385['tableName']+')'):'';console['error']('\x20\x20'+a103_0x562328['bold'](_0x21d385[_0x560d92(0xd8)])+_0x200e9b);const _0x4088f4=[..._0x21d385[_0x560d92(0xd7)]]['sort']((_0x4112b8,_0x5caf7a)=>_0x4112b8[_0x560d92(0xc5)][_0x560d92(0xce)](_0x5caf7a[_0x560d92(0xc5)]));for(const _0x58a670 of _0x4088f4){const _0x5d1883=_0x58a670['parentColumn']&&_0x58a670[_0x560d92(0xd1)]!==_0x58a670[_0x560d92(0xc5)]?'\x20'+a103_0x562328[_0x560d92(0xfa)]('('+_0x58a670[_0x560d92(0xd1)]+')'):'';console[_0x560d92(0xe7)](_0x560d92(0xf6)+_0x58a670['name']+_0x5d1883+':\x20'+a103_0x562328['cyan'](_0x58a670[_0x560d92(0xc7)]));}}}if(_0x2f9efd[_0x560d92(0xcb)]>0x0){console['error']('\x0a'+a103_0x562328['dim'](_0x560d92(0xe1)));const _0x9dbe48=[..._0x2f9efd[_0x560d92(0xd4)]()]['sort']((_0x4a77dc,_0x90fb4b)=>_0x4a77dc[0x0][_0x560d92(0xce)](_0x90fb4b[0x0]));for(const [_0x3ea340,_0x4d6adc]of _0x9dbe48){const _0x12d707=_0x4d6adc[0x0],_0x411460=_0x12d707?.[_0x560d92(0xca)]||'';console['error']('\x20\x20'+a103_0x562328[_0x560d92(0xda)](_0x3ea340)+(_0x411460?'\x20'+a103_0x562328['dim']('('+_0x411460+')'):''));const _0x32397c=[..._0x4d6adc][_0x560d92(0xcf)]((_0x1625b2,_0x36ae3f)=>_0x1625b2['name'][_0x560d92(0xce)](_0x36ae3f['name']));for(const _0x58c7e7 of _0x32397c){const _0x574738=_0x58c7e7[_0x560d92(0xc5)][_0x560d92(0xe8)](_0x3ea340+'.')?_0x58c7e7[_0x560d92(0xc5)]['slice'](_0x3ea340[_0x560d92(0xf8)]+0x1):_0x58c7e7['name'],_0x1093a3=_0x58c7e7[_0x560d92(0xd1)]&&_0x58c7e7[_0x560d92(0xd1)]!==_0x574738?'\x20'+a103_0x562328[_0x560d92(0xfa)]('('+_0x58c7e7[_0x560d92(0xd1)]+')'):'';console[_0x560d92(0xe7)](_0x560d92(0xf6)+_0x574738+_0x1093a3+':\x20'+a103_0x562328[_0x560d92(0xf5)](_0x58c7e7[_0x560d92(0xc7)]));}}}console[_0x560d92(0xe7)]('');}function a103_0x2217(_0x460f7b,_0x1f6fe4){_0x460f7b=_0x460f7b-0xc4;const _0x29c5bd=a103_0x29c5();let _0x2217a0=_0x29c5bd[_0x460f7b];return _0x2217a0;}function a103_0x29c5(){const _0x25d555=['setJobId','cyan','\x20\x20\x20\x20','data','length','SELECT\x20*\x20FROM\x20(\x0a','dim','YES','name','Unknown','type','filter','645741QVGKuL','parentTableName','size','2251745qLNDLx','verbose','localeCompare','sort','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','parentColumn','39873VZOnfK','6633032SKaHDn','entries','228RdsPll','get','fields','displayName','7200855lGuVDJ','bold','2EfYkys','columns','6MKgvav','replace','map','execute','Behaviors','default','trim','Schema\x20query:\x0a','information_schema','behaviorName','error','startsWith','varchar','key','column_name','column_type','Attributes','tableName','source','34937310Hqfqgk','push','set','5983558jJdqzg'];a103_0x29c5=function(){return _0x25d555;};return a103_0x29c5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1374f6,_0x3868de){const _0x73f8ae=a104_0x420c,_0x246297=_0x1374f6();while(!![]){try{const _0x534103=parseInt(_0x73f8ae(0xa5))/0x1*(parseInt(_0x73f8ae(0xb7))/0x2)+parseInt(_0x73f8ae(0xb2))/0x3*(parseInt(_0x73f8ae(0xa2))/0x4)+-parseInt(_0x73f8ae(0xad))/0x5*(-parseInt(_0x73f8ae(0xa9))/0x6)+-parseInt(_0x73f8ae(0xa8))/0x7+parseInt(_0x73f8ae(0xb8))/0x8*(-parseInt(_0x73f8ae(0xb6))/0x9)+-parseInt(_0x73f8ae(0xa1))/0xa*(-parseInt(_0x73f8ae(0xb3))/0xb)+parseInt(_0x73f8ae(0xab))/0xc;if(_0x534103===_0x3868de)break;else _0x246297['push'](_0x246297['shift']());}catch(_0x4befb5){_0x246297['push'](_0x246297['shift']());}}}(a104_0x455d,0xa8a5f));function a104_0x420c(_0x475a4d,_0x2c1c67){_0x475a4d=_0x475a4d-0xa1;const _0x455d2b=a104_0x455d();let _0x420c32=_0x455d2b[_0x475a4d];return _0x420c32;}import{readdirSync,statSync}from'fs';function a104_0x455d(){const _0x32677e=['10HFRwpO','4EOCPpS','isDirectory','join','27gUvLsG','extname','.yml','3169544VRSZcQ','1044nQBXIN','dirname','1406232AhXaHP','.yaml','20075WTCZZG','push','toLowerCase','endsWith','name','375789iWTQYc','1072907viURCP','isFile','map','45hgtguw','30014YQqtRP','480336LlqiKx'];a104_0x455d=function(){return _0x32677e;};return a104_0x455d();}import a104_0x312b7f from'path';export function findYamlFiles(_0x1cbed0){const _0x22473d=[];function _0x3bf202(_0x1cbc2c){const _0x1d1d2f=a104_0x420c,_0x43b7e6=readdirSync(_0x1cbc2c,{'withFileTypes':!![]});for(const _0x517ca4 of _0x43b7e6){const _0xc3c58c=a104_0x312b7f[_0x1d1d2f(0xa4)](_0x1cbc2c,_0x517ca4['name']);if(_0x517ca4[_0x1d1d2f(0xa3)]())_0x3bf202(_0xc3c58c);else(_0x517ca4[_0x1d1d2f(0xb1)][_0x1d1d2f(0xb0)]('.yml')||_0x517ca4[_0x1d1d2f(0xb1)][_0x1d1d2f(0xb0)](_0x1d1d2f(0xac)))&&_0x22473d[_0x1d1d2f(0xae)](_0xc3c58c);}}return _0x3bf202(_0x1cbed0),_0x22473d;}export function discoverYamlFiles(_0x234fed){const _0x30df71=a104_0x420c,_0x3a38d4=findYamlFiles(_0x234fed);return _0x3a38d4[_0x30df71(0xb5)](_0x1466fd=>{const _0x22a22b=_0x30df71,_0x574629=a104_0x312b7f['relative'](_0x234fed,_0x1466fd),_0x2c0ec1=a104_0x312b7f[_0x22a22b(0xaa)](_0x574629);return{'absolutePath':_0x1466fd,'relativePath':_0x574629,'folderPath':_0x2c0ec1==='.'?'':_0x2c0ec1};});}export function isYamlFile(_0x4e4cba){const _0x1249f0=a104_0x420c;try{const _0x2cb1db=statSync(_0x4e4cba);if(!_0x2cb1db[_0x1249f0(0xb4)]())return![];const _0x51deb5=a104_0x312b7f[_0x1249f0(0xa6)](_0x4e4cba)[_0x1249f0(0xaf)]();return _0x51deb5===_0x1249f0(0xa7)||_0x51deb5==='.yaml';}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3bbf04,_0x5b9dbf){const _0x1bb2ca=a105_0x2e8c,_0x1d7a24=_0x3bbf04();while(!![]){try{const _0x2b7415=-parseInt(_0x1bb2ca(0xd4))/0x1*(-parseInt(_0x1bb2ca(0x10f))/0x2)+-parseInt(_0x1bb2ca(0xe1))/0x3*(parseInt(_0x1bb2ca(0xe3))/0x4)+parseInt(_0x1bb2ca(0x102))/0x5+parseInt(_0x1bb2ca(0xd8))/0x6+parseInt(_0x1bb2ca(0xfa))/0x7+-parseInt(_0x1bb2ca(0x10a))/0x8+-parseInt(_0x1bb2ca(0xf1))/0x9*(parseInt(_0x1bb2ca(0xe7))/0xa);if(_0x2b7415===_0x5b9dbf)break;else _0x1d7a24['push'](_0x1d7a24['shift']());}catch(_0x4f2d85){_0x1d7a24['push'](_0x1d7a24['shift']());}}}(a105_0x3b76,0xa8cbe));function a105_0x2e8c(_0x15b1dd,_0x3f0c9d){_0x15b1dd=_0x15b1dd-0xd4;const _0x3b7669=a105_0x3b76();let _0x2e8c68=_0x3b7669[_0x15b1dd];return _0x2e8c68;}import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x3c75f7){const _0x574e86=a105_0x2e8c;return _0x3c75f7['toLowerCase']()[_0x574e86(0x106)](/\s+/g,'_')[_0x574e86(0x106)](/[^a-z0-9_]/g,'')[_0x574e86(0x106)](/_+/g,'_')['replace'](/^_|_$/g,'');}export function generateJourneyLocalName(_0x35a6cd){const _0x34a73d=a105_0x2e8c,_0x2aa269=_0x35a6cd['match'](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x2aa269){const _0x172075=_0x2aa269[0x1][_0x34a73d(0xe9)](),_0x5b8725=_0x2aa269[0x2],_0x29a149=_0x5b8725[_0x34a73d(0x106)](/-/g,'')[_0x34a73d(0xec)](0x0,0x4)[_0x34a73d(0xe9)]();return _0x172075+'_'+_0x29a149;}const _0x6c5811=_0x35a6cd[_0x34a73d(0xe2)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x6c5811){const _0x527cf3=_0x6c5811[0x1],_0x32f754=_0x6c5811[0x2][_0x34a73d(0xe9)](),_0x1e1c81=_0x527cf3[_0x34a73d(0x106)](/-/g,'')[_0x34a73d(0xec)](0x0,0x4)[_0x34a73d(0xe9)]();return _0x32f754+'_'+_0x1e1c81;}return undefined;}function stableStringify(_0x1e9e5b){const _0x4be9b1=a105_0x2e8c;if(Array[_0x4be9b1(0x11f)](_0x1e9e5b))return'['+_0x1e9e5b[_0x4be9b1(0x100)](_0x453fba=>stableStringify(_0x453fba))[_0x4be9b1(0x10e)](',')+']';if(_0x1e9e5b&&typeof _0x1e9e5b===_0x4be9b1(0x122)){const _0x58d36b=_0x1e9e5b,_0x1b8f78=Object[_0x4be9b1(0xf0)](_0x58d36b)['sort'](),_0x1cb0cf=_0x1b8f78[_0x4be9b1(0x100)](_0x4c15a6=>'\x22'+_0x4c15a6+'\x22:'+stableStringify(_0x58d36b[_0x4c15a6]));return'{'+_0x1cb0cf[_0x4be9b1(0x10e)](',')+'}';}const _0xda66b6=JSON[_0x4be9b1(0xfc)](_0x1e9e5b);return _0xda66b6===undefined?_0x4be9b1(0xe6):_0xda66b6;}export function consolidateActivationsByContent(_0x2c092f){const _0xbcab8c=a105_0x2e8c,_0x59ed72={},_0x238c05=new Map(),_0x530571=new Map();for(const _0x3e2537 of _0x2c092f){if(!_0x3e2537)continue;for(const [_0x878bc,_0x270240]of Object[_0xbcab8c(0xed)](_0x3e2537)){const _0x26c342={'connection':_0x270240[_0xbcab8c(0x113)],..._0x270240[_0xbcab8c(0x101)]!==undefined&&{'all_columns':_0x270240[_0xbcab8c(0x101)]},..._0x270240[_0xbcab8c(0xdc)]!==undefined&&{'columns':_0x270240[_0xbcab8c(0xdc)]},..._0x270240['behavior']!==undefined&&{'behavior':_0x270240[_0xbcab8c(0x111)]},..._0x270240[_0xbcab8c(0x117)]!==undefined&&{'schedule':_0x270240[_0xbcab8c(0x117)]},..._0x270240[_0xbcab8c(0xe8)]!==undefined&&{'notification':_0x270240[_0xbcab8c(0xe8)]},..._0x270240['connector_config']!==undefined&&{'connector_config':_0x270240[_0xbcab8c(0x110)]},..._0x270240[_0xbcab8c(0x115)]!==undefined&&{'activation_template_id':_0x270240['activation_template_id']}},_0x43a35c=stableStringify(_0x26c342),_0x5d77c9=_0x530571[_0xbcab8c(0x125)](_0x43a35c);_0x5d77c9?_0x238c05['set'](_0x878bc,_0x5d77c9):(_0x59ed72[_0x878bc]=_0x270240,_0x238c05[_0xbcab8c(0x11a)](_0x878bc,_0x878bc),_0x530571[_0xbcab8c(0x11a)](_0x43a35c,_0x878bc));}}return{'merged':_0x59ed72,'nameMapping':_0x238c05};}export function updateActivationReferences(_0xab9cf5,_0x555120){const _0x240499=a105_0x2e8c;if(!_0xab9cf5)return;for(const _0x57031e of _0xab9cf5){if(!_0x57031e[_0x240499(0x123)])continue;for(const _0x38f994 of _0x57031e[_0x240499(0x123)]){if(_0x38f994[_0x240499(0xf8)]===_0x240499(0xdd)&&_0x38f994[_0x240499(0x107)]?.[_0x240499(0xdd)]){const _0x3ba0a3=_0x555120[_0x240499(0x125)](_0x38f994[_0x240499(0x107)][_0x240499(0xdd)]);_0x3ba0a3&&_0x3ba0a3!==_0x38f994[_0x240499(0x107)][_0x240499(0xdd)]&&(_0x38f994[_0x240499(0x107)][_0x240499(0xdd)]=_0x3ba0a3);}}}}export function consolidateSegmentsByContent(_0x494d2c,_0x2f2ddd){const _0x257155=a105_0x2e8c,_0x39d489={},_0x539d15=new Map(),_0x405ef1=new Map();for(const _0x1bb755 of _0x494d2c){if(!_0x1bb755)continue;for(const [_0x135623,_0xe21e91]of Object['entries'](_0x1bb755)){if(!_0xe21e91[_0x257155(0x121)]){_0x39d489[_0x135623]=_0xe21e91,_0x539d15[_0x257155(0x11a)](_0x135623,_0x135623);continue;}const _0x1c5b1d=_0xe21e91[_0x257155(0x116)]&&_0xe21e91['description'][_0x257155(0x10c)]()?_0xe21e91[_0x257155(0x116)]:undefined,_0x5e31a5=JSON[_0x257155(0xfc)]({'description':_0x1c5b1d,'rule':deepSortObject(_0xe21e91[_0x257155(0x121)])}),_0x5e3d09=_0x405ef1[_0x257155(0x125)](_0x5e31a5);if(_0x5e3d09){const _0x1b75a6={..._0xe21e91[_0x257155(0x116)]!==undefined&&{'description':_0xe21e91[_0x257155(0x116)]},'rule':_0xe21e91[_0x257155(0x121)]?deepSortObject(_0xe21e91[_0x257155(0x121)]):_0xe21e91['rule']};if(_0x135623<_0x5e3d09){_0x39d489[_0x135623]=_0x1b75a6,delete _0x39d489[_0x5e3d09];for(const [_0x4e81b0,_0x3f4094]of _0x539d15[_0x257155(0xed)]()){_0x3f4094===_0x5e3d09&&_0x539d15[_0x257155(0x11a)](_0x4e81b0,_0x135623);}_0x539d15[_0x257155(0x11a)](_0x135623,_0x135623),_0x405ef1[_0x257155(0x11a)](_0x5e31a5,_0x135623);}else _0x39d489[_0x5e3d09]=_0x1b75a6,_0x539d15['set'](_0x135623,_0x5e3d09);}else{let _0x1b3a68=_0x135623;if(_0x2f2ddd){const _0x3b36c4=_0x2f2ddd[_0x257155(0x125)](_0x5e31a5);_0x3b36c4&&_0x3b36c4[_0x257155(0x114)]>0x0&&(_0x1b3a68=_0x3b36c4[_0x257155(0xec)]()[_0x257155(0x103)]()[0x0]);}const _0x33a6d5={..._0xe21e91[_0x257155(0x116)]!==undefined&&{'description':_0xe21e91[_0x257155(0x116)]},'rule':_0xe21e91[_0x257155(0x121)]?deepSortObject(_0xe21e91['rule']):_0xe21e91[_0x257155(0x121)]};_0x39d489[_0x1b3a68]=_0x33a6d5,_0x539d15[_0x257155(0x11a)](_0x135623,_0x1b3a68),_0x405ef1[_0x257155(0x11a)](_0x5e31a5,_0x1b3a68);}}}return{'merged':_0x39d489,'nameMapping':_0x539d15};}function a105_0x3b76(){const _0x4307ce=['exclude','slice','entries','milestone','decision_point','keys','12519grfruq','latest','item','draft','versionNumber','journeys','conditions','type','version','181006BlzlBP','versions','stringify','values','bundle_name','index','map','all_columns','1938450XuuUja','sort','journeyStages','exit_criteria','replace','with','nameMapping','attributes','2638800KVhYBe','push','trim','segment','join','3326mquXkJ','connector_config','behavior','yaml','connection','length','activation_template_id','description','schedule','state','journeyBundleName','set','journey','segments','activations','from','isArray','string','rule','object','steps','some','get','769QsRZPl','wait','endsWith','entry_criteria','6653982cAvRSa','name','.yml','version_number','columns','activation','goal','find','condition','123SQYdrU','match','50044cGpzVE','launched','branches','null','9110AuXpiw','notification','toLowerCase','stages'];a105_0x3b76=function(){return _0x4307ce;};return a105_0x3b76();}export function updateSegmentReferences(_0x3baefa,_0xd720df){const _0x5b243e=a105_0x2e8c;if(!_0x3baefa)return;for(const _0x1983e0 of _0x3baefa){if(_0x1983e0[_0x5b243e(0xd7)]?.['segment']){const _0x107480=_0xd720df[_0x5b243e(0x125)](_0x1983e0[_0x5b243e(0xd7)]['segment']);_0x107480&&(_0x1983e0['entry_criteria'][_0x5b243e(0x10d)]=_0x107480);}if(_0x1983e0['steps'])for(const _0x481194 of _0x1983e0[_0x5b243e(0x123)]){if(_0x481194['type']==='decision_point'&&_0x481194['with']?.[_0x5b243e(0xe5)])for(const _0x2e834c of _0x481194[_0x5b243e(0x107)][_0x5b243e(0xe5)]){if(_0x2e834c[_0x5b243e(0x10d)]){const _0x1f7d48=_0xd720df[_0x5b243e(0x125)](_0x2e834c[_0x5b243e(0x10d)]);_0x1f7d48&&(_0x2e834c['segment']=_0x1f7d48);}}}}}export function updateSegmentRefsInSegments(_0x337453,_0x5048f8){const _0x4437dc=a105_0x2e8c;for(const _0x41c88e of Object[_0x4437dc(0xfd)](_0x337453)){_0x41c88e['rule']&&updateSegmentRefsInRule(_0x41c88e[_0x4437dc(0x121)],_0x5048f8);}}function updateSegmentRefsInRule(_0x49558a,_0x1a655c){const _0x19154e=a105_0x2e8c;if(_0x49558a===null||typeof _0x49558a!=='object')return;if(Array[_0x19154e(0x11f)](_0x49558a)){for(const _0x40dc5f of _0x49558a){updateSegmentRefsInRule(_0x40dc5f,_0x1a655c);}return;}const _0x1768d3=_0x49558a;if((_0x1768d3[_0x19154e(0xf8)]==='include'||_0x1768d3['type']===_0x19154e(0xeb))&&typeof _0x1768d3[_0x19154e(0x10d)]===_0x19154e(0x120)){const _0x52d07a=_0x1a655c['get'](_0x1768d3[_0x19154e(0x10d)]);_0x52d07a&&(_0x1768d3[_0x19154e(0x10d)]=_0x52d07a);}if(_0x1768d3[_0x19154e(0xf7)]&&Array['isArray'](_0x1768d3[_0x19154e(0xf7)]))for(const _0x3ed64f of _0x1768d3[_0x19154e(0xf7)]){updateSegmentRefsInRule(_0x3ed64f,_0x1a655c);}}export function buildJourneysArray(_0x45ad6c){const _0x3f241b=a105_0x2e8c,_0x21b27b=Math['max'](..._0x45ad6c[_0x3f241b(0x100)](_0xc2096f=>_0xc2096f[_0x3f241b(0xf3)][_0x3f241b(0xf5)]||0x0));return _0x45ad6c[_0x3f241b(0x100)](_0x3e856b=>{const _0xcd794f=_0x3f241b,_0x509629=(_0x3e856b[_0xcd794f(0xf3)][_0xcd794f(0xf5)]||0x0)===_0x21b27b,_0x4c4765=_0x3e856b[_0xcd794f(0x112)][_0xcd794f(0xf6)]?.[0x0],_0x2430ef={'version':_0x4c4765?.[_0xcd794f(0xf9)]||_0x3e856b[_0xcd794f(0x112)]['version']||_0x3e856b[_0xcd794f(0xf3)][_0xcd794f(0xd9)],'state':_0x3e856b[_0xcd794f(0xf3)][_0xcd794f(0x118)]===_0xcd794f(0xe4)?'launched':_0xcd794f(0xf4),'stages':_0x4c4765?.[_0xcd794f(0xea)]||_0x3e856b['yaml'][_0xcd794f(0xea)]||[],'id':_0x4c4765?.['id']||_0x3e856b['yaml']['id'],'version_number':_0x4c4765?.[_0xcd794f(0xdb)]||_0x3e856b[_0xcd794f(0x112)][_0xcd794f(0xdb)]};return _0x509629&&(_0x2430ef[_0xcd794f(0xf2)]=!![]),_0x2430ef;});}export function buildMergedJourneyDef(_0x455601,_0x5d17d8){const _0xa78f6c=a105_0x2e8c,_0x3f4480=_0x455601[0x0][_0xa78f6c(0x112)],_0x4aeb5d=buildJourneysArray(_0x455601),{merged:_0x4bfca3,nameMapping:_0x1826c6}=consolidateSegmentsByContent(_0x455601[_0xa78f6c(0x100)](_0x3e62a4=>_0x3e62a4[_0xa78f6c(0x112)][_0xa78f6c(0x11c)]),_0x5d17d8);updateSegmentRefsInSegments(_0x4bfca3,_0x1826c6);const _0x249f12=Array[_0xa78f6c(0x11e)](_0x1826c6[_0xa78f6c(0xed)]())[_0xa78f6c(0x124)](([_0x594333,_0x2f85fd])=>_0x594333!==_0x2f85fd&&_0x594333['startsWith'](_0xa78f6c(0xd7)));let _0x2be45c=_0x4bfca3,_0x42c2f2=new Map();if(_0x249f12){const _0x332fb6=consolidateSegmentsByContent([_0x4bfca3],_0x5d17d8);_0x2be45c=_0x332fb6['merged'],_0x42c2f2=_0x332fb6[_0xa78f6c(0x108)];}const _0x4aee07=new Map(_0x1826c6);for(const [_0x1e2b19,_0x10a411]of _0x42c2f2[_0xa78f6c(0xed)]()){_0x4aee07[_0xa78f6c(0x11a)](_0x1e2b19,_0x10a411);}for(const [_0xa1c065,_0x4a8353]of _0x4aee07[_0xa78f6c(0xed)]()){let _0x588857=_0x4a8353,_0x103f6d=0x0;while(_0x4aee07['has'](_0x588857)&&_0x4aee07[_0xa78f6c(0x125)](_0x588857)!==_0x588857&&_0x103f6d<MAX_MAPPING_CHAIN_DEPTH){_0x588857=_0x4aee07['get'](_0x588857),_0x103f6d++;}_0x588857!==_0x4a8353&&_0x4aee07[_0xa78f6c(0x11a)](_0xa1c065,_0x588857);}for(const _0x110ee1 of _0x4aeb5d){updateSegmentReferences(_0x110ee1['stages'],_0x4aee07);}const {merged:_0x3ef241,nameMapping:_0x2a87cd}=consolidateActivationsByContent(_0x455601['map'](_0x1957c0=>_0x1957c0['yaml'][_0xa78f6c(0x11d)]));for(const _0x149044 of _0x4aeb5d){updateActivationReferences(_0x149044[_0xa78f6c(0xea)],_0x2a87cd);}let _0x276e74=_0x3f4480['goal'];if(_0x276e74?.[_0xa78f6c(0x10d)]){const _0x49c802=_0x4aee07[_0xa78f6c(0x125)](_0x276e74[_0xa78f6c(0x10d)]);_0x49c802&&(_0x276e74={..._0x276e74,'segment':_0x49c802});}for(const _0x3b9cc8 of _0x4aeb5d){if(_0x3b9cc8[_0xa78f6c(0xde)]?.[_0xa78f6c(0x10d)]){const _0x4ae16e=_0x4aee07[_0xa78f6c(0x125)](_0x3b9cc8[_0xa78f6c(0xde)]['segment']);_0x4ae16e&&(_0x3b9cc8[_0xa78f6c(0xde)]={..._0x3b9cc8[_0xa78f6c(0xde)],'segment':_0x4ae16e});}}return{'type':_0xa78f6c(0x11b),'name':_0x3f4480[_0xa78f6c(0xd9)],'description':_0x3f4480['description'],'goal':_0x276e74,'reentry':_0x3f4480['reentry'],'segments':Object[_0xa78f6c(0xf0)](_0x2be45c)[_0xa78f6c(0x114)]>0x0?_0x2be45c:undefined,'activations':Object['keys'](_0x3ef241)['length']>0x0?_0x3ef241:undefined,'journeys':_0x4aeb5d,'bundle_id':_0x3f4480['bundle_id'],'bundle_name':_0x3f4480[_0xa78f6c(0xfe)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x4dd2b4,_0x11a1e9,_0x169544,_0x1bd44e){const _0x2f93da=a105_0x2e8c,_0x35b982=_0x4dd2b4+':'+_0x11a1e9,_0x2eeaa4=_0x169544[_0x2f93da(0x125)](_0x35b982);if(_0x2eeaa4)return _0x2eeaa4;const _0x54dfc1=await _0x1bd44e(_0x4dd2b4),_0x2e87fa=_0x54dfc1[_0x2f93da(0x109)][_0x2f93da(0x119)]||_0x54dfc1['attributes'][_0x2f93da(0xd9)],_0x52f2be=_0x54dfc1[_0x2f93da(0x109)][_0x2f93da(0x104)][_0x2f93da(0xdf)](_0x51e983=>String(_0x51e983['id'])===String(_0x11a1e9)),_0x5ec148=_0x52f2be?.['name']||_0x11a1e9,_0x100bd8={'journeyName':_0x2e87fa,'stageName':_0x5ec148};return _0x169544[_0x2f93da(0x11a)](_0x35b982,_0x100bd8),_0x100bd8;}export function formatApiJourneyName(_0x115f0b,_0x5ee182){return _0x5ee182+'\x20('+_0x115f0b+')';}export function isLocalJourneyRef(_0x132b7c){const _0x4260ae=a105_0x2e8c;return _0x132b7c[_0x4260ae(0xd6)](_0x4260ae(0xda))||_0x132b7c[_0x4260ae(0xd6)]('.yaml');}export function buildLocalRuleToNameMapping(_0x18db08){const _0x5c6029=a105_0x2e8c,_0x5be1be=new Map();if(!_0x18db08)return _0x5be1be;for(const [_0x1205ce,_0x4ebd3d]of Object[_0x5c6029(0xed)](_0x18db08)){if(_0x4ebd3d[_0x5c6029(0x121)]){const _0x44f19b=serializeRule(_0x4ebd3d['rule']),_0x1e923c=_0x5be1be['get'](_0x44f19b)||[];_0x1e923c['push'](_0x1205ce),_0x5be1be['set'](_0x44f19b,_0x1e923c);}}return _0x5be1be;}export function buildLocalRuleToNameMappingFromJourney(_0x2f05c6){const _0x1f84d4=a105_0x2e8c,_0x437718=_0x2f05c6[_0x1f84d4(0x11c)];if(!_0x437718)return new Map();const _0x241a46=collectSegmentUsageCounts(_0x2f05c6),_0x2ec85d=new Map();let _0x5cc978=0x0;for(const [_0x521eb5,_0x112873]of Object[_0x1f84d4(0xed)](_0x437718)){if(!_0x112873[_0x1f84d4(0x121)]){_0x5cc978++;continue;}const _0x4c2339=serializeRule(_0x112873[_0x1f84d4(0x121)]),_0x1517b4=_0x2ec85d[_0x1f84d4(0x125)](_0x4c2339)||[];_0x1517b4[_0x1f84d4(0x10b)]({'name':_0x521eb5,'index':_0x5cc978}),_0x2ec85d[_0x1f84d4(0x11a)](_0x4c2339,_0x1517b4),_0x5cc978++;}const _0x38490d=new Map();for(const [_0x17060a,_0x53e991]of _0x2ec85d){const _0x5651c8=_0x53e991[_0x1f84d4(0xec)]()[_0x1f84d4(0x103)]((_0x46f0b9,_0x16104a)=>{const _0x1817f9=_0x1f84d4,_0x420a24=_0x241a46['get'](_0x46f0b9['name'])||0x0,_0x5c0c0=_0x241a46[_0x1817f9(0x125)](_0x16104a[_0x1817f9(0xd9)])||0x0;if(_0x420a24!==_0x5c0c0)return _0x5c0c0-_0x420a24;return _0x46f0b9[_0x1817f9(0xff)]-_0x16104a[_0x1817f9(0xff)];})[_0x1f84d4(0x100)](_0x4751bc=>_0x4751bc['name']);_0x38490d[_0x1f84d4(0x11a)](_0x17060a,_0x5651c8);}return _0x38490d;}export function collectSegmentUsageCounts(_0x187365){const _0x2af4b2=a105_0x2e8c,_0xd671f1=new Map(),_0x45dba9=_0x1e5e94=>{const _0x3d44e0=a105_0x2e8c;if(!_0x1e5e94)return;_0xd671f1[_0x3d44e0(0x11a)](_0x1e5e94,(_0xd671f1['get'](_0x1e5e94)||0x0)+0x1);},_0xf38e9=_0x2f8c20=>{const _0x34a351=a105_0x2e8c;for(const _0x38bd5d of _0x2f8c20){_0x45dba9(_0x38bd5d[_0x34a351(0xd7)]?.[_0x34a351(0x10d)]);if(_0x38bd5d[_0x34a351(0x105)])for(const _0x4e2057 of _0x38bd5d[_0x34a351(0x105)]){_0x45dba9(_0x4e2057[_0x34a351(0x10d)]);}_0x45dba9(_0x38bd5d[_0x34a351(0xee)]?.['segment']);if(_0x38bd5d['steps'])for(const _0x2f4160 of _0x38bd5d['steps']){if(_0x2f4160[_0x34a351(0xf8)]===_0x34a351(0xef))for(const _0x28379f of _0x2f4160[_0x34a351(0x107)][_0x34a351(0xe5)]){_0x45dba9(_0x28379f[_0x34a351(0x10d)]);}else _0x2f4160[_0x34a351(0xf8)]===_0x34a351(0xd5)&&_0x45dba9(_0x2f4160[_0x34a351(0x107)][_0x34a351(0xe0)]?.[_0x34a351(0x10d)]);}}};_0x45dba9(_0x187365[_0x2af4b2(0xde)]?.['segment']);if(_0x187365[_0x2af4b2(0xf6)])for(const _0x2f41e0 of _0x187365['journeys']){_0x45dba9(_0x2f41e0[_0x2af4b2(0xde)]?.[_0x2af4b2(0x10d)]),_0xf38e9(_0x2f41e0['stages']);}_0x187365[_0x2af4b2(0xea)]&&_0xf38e9(_0x187365[_0x2af4b2(0xea)]);if(_0x187365[_0x2af4b2(0xfb)])for(const _0x251af9 of _0x187365[_0x2af4b2(0xfb)]){_0xf38e9(_0x251af9[_0x2af4b2(0xea)]);}return _0xd671f1;}
|
|
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;}
|