@treasuredata/tdx 2026.3.28 → 2026.3.29
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/auth-login-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/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-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/policy-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/upgrade-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/oauth-keychain.js +1 -1
- package/dist/core/oauth.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/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-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/oauth-refresh.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/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.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/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.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-validator.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-recovery.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/segment-validator.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/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.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/paginate.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/file-reader.js +1 -1
- package/dist/utils/github-releases.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/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a141_0x25f0fd=a141_0x4ca8;(function(_0x5cc177,_0x1a5953){const _0x14500b=a141_0x4ca8,_0x46d46c=_0x5cc177();while(!![]){try{const _0xddce2d=parseInt(_0x14500b(0xee))/0x1+parseInt(_0x14500b(0xf5))/0x2*(-parseInt(_0x14500b(0xf9))/0x3)+parseInt(_0x14500b(0xfd))/0x4+-parseInt(_0x14500b(0xfc))/0x5*(-parseInt(_0x14500b(0xf1))/0x6)+-parseInt(_0x14500b(0xeb))/0x7+parseInt(_0x14500b(0xf0))/0x8+-parseInt(_0x14500b(0xf4))/0x9*(-parseInt(_0x14500b(0xef))/0xa);if(_0xddce2d===_0x1a5953)break;else _0x46d46c['push'](_0x46d46c['shift']());}catch(_0x2badb0){_0x46d46c['push'](_0x46d46c['shift']());}}}(a141_0x1bba,0xea1fa));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x141414 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a141_0x25f0fd(0xf8));export function getPushRecoveryPath(_0x4920be){const _0x1eacc1=a141_0x25f0fd,_0xf0c425=a141_0x141414[_0x1eacc1(0xe6)](_0x4920be),_0x4124ce=a141_0x141414['basename'](_0x4920be);return a141_0x141414[_0x1eacc1(0xfa)](_0xf0c425,'.'+_0x4124ce+'.push-recovery.json');}function a141_0x4ca8(_0x2c48ac,_0x5402a1){_0x2c48ac=_0x2c48ac-0xe5;const _0x1bbab9=a141_0x1bba();let _0x4ca84b=_0x1bbab9[_0x2c48ac];return _0x4ca84b;}function a141_0x1bba(){const _0x42c669=['5AepSUR','84668YaeBMq','parse','dirname','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','string','stringify','version','10560263pTjYXB','code','utf-8','50850nQhNZQ','17210ieTCEp','2992992vVcPLL','4935234kBckTU','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','warn','9621iMaxxM','51268vqEPPG','segments','toISOString','tdx.sdk.push-recovery','75QtGZAT','join','debug'];a141_0x1bba=function(){return _0x42c669;};return a141_0x1bba();}export function readPushRecovery(_0x38054d){const _0x4b45c1=a141_0x25f0fd,_0x542937=getPushRecoveryPath(_0x38054d);if(!existsSync(_0x542937))return undefined;try{const _0x341331=readFileSync(_0x542937,_0x4b45c1(0xed)),_0x220d2b=JSON[_0x4b45c1(0xe5)](_0x341331);if(_0x220d2b?.[_0x4b45c1(0xea)]!==0x1||typeof _0x220d2b['journeyName']!==_0x4b45c1(0xe8))return undefined;return _0x220d2b;}catch(_0x28a057){return _0x28a057 instanceof SyntaxError?logger['debug'](_0x4b45c1(0xf2)+_0x28a057):logger[_0x4b45c1(0xf3)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x28a057),undefined;}}export function writePushRecovery(_0x26a083,_0x192104){const _0x4ab18a=a141_0x25f0fd,_0x2760a1=getPushRecoveryPath(_0x26a083),_0x39131f=_0x2760a1+'.tmp';writeFileSync(_0x39131f,JSON[_0x4ab18a(0xe9)](_0x192104,null,0x2)+'\x0a',_0x4ab18a(0xed)),renameSync(_0x39131f,_0x2760a1);}export function deletePushRecovery(_0x246f12){const _0x22b5ce=a141_0x25f0fd,_0x12a801=getPushRecoveryPath(_0x246f12);try{unlinkSync(_0x12a801);}catch(_0x211032){_0x211032[_0x22b5ce(0xec)]!=='ENOENT'&&logger[_0x22b5ce(0xfb)](_0x22b5ce(0xe7)+_0x211032);}}export function saveSegmentToPushRecovery(_0x3f1972,_0xce480b,_0x4f6a9e,_0x56531a){const _0x44dd1c=a141_0x25f0fd,_0x293e9e=readPushRecovery(_0x3f1972),_0x8eaf53=_0x293e9e?.['journeyName']===_0xce480b?{..._0x293e9e,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0xce480b,'updatedAt':new Date()[_0x44dd1c(0xf7)](),'segments':{}};_0x8eaf53[_0x44dd1c(0xf6)][_0x4f6a9e]=_0x56531a,writePushRecovery(_0x3f1972,_0x8eaf53);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a142_0x5b9def=a142_0x361a;(function(_0x35f6f5,_0x5c8d44){const _0x30be72=a142_0x361a,_0x2e27c0=_0x35f6f5();while(!![]){try{const _0x2c5395=parseInt(_0x30be72(0x1d0))/0x1+-parseInt(_0x30be72(0x18e))/0x2+-parseInt(_0x30be72(0x1bd))/0x3*(-parseInt(_0x30be72(0x209))/0x4)+-parseInt(_0x30be72(0x18c))/0x5*(-parseInt(_0x30be72(0x12f))/0x6)+-parseInt(_0x30be72(0x21a))/0x7+-parseInt(_0x30be72(0x1ae))/0x8+parseInt(_0x30be72(0x1e9))/0x9*(parseInt(_0x30be72(0x1f3))/0xa);if(_0x2c5395===_0x5c8d44)break;else _0x2e27c0['push'](_0x2e27c0['shift']());}catch(_0x58c4d5){_0x2e27c0['push'](_0x2e27c0['shift']());}}}(a142_0x3d03,0x3648b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x5b9def(0x16a));export const PENDING_SEGMENT_PREFIX=a142_0x5b9def(0x220);export const PENDING_ACTIVATION_PREFIX=a142_0x5b9def(0x13f);export function createPendingSegmentId(_0x13c79b){return''+PENDING_SEGMENT_PREFIX+_0x13c79b+'__';}export function isPendingSegmentId(_0x4ad2d3){const _0x17661e=a142_0x5b9def;return _0x4ad2d3['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x4ad2d3[_0x17661e(0x1ff)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1c511a){const _0x259067=a142_0x5b9def;return _0x1c511a[_0x259067(0x1d4)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x147ccf){return''+PENDING_ACTIVATION_PREFIX+_0x147ccf+'__';}function a142_0x361a(_0x14676b,_0x3c423f){_0x14676b=_0x14676b-0x124;const _0x3d033d=a142_0x3d03();let _0x361ab4=_0x3d033d[_0x14676b];return _0x361ab4;}export function isPendingActivationId(_0x3f432a){return _0x3f432a['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1f077a){const _0x2ad562=a142_0x5b9def;return _0x1f077a[_0x2ad562(0x1d4)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3e2e21,_0x4e10bd){const _0x24ac83=a142_0x5b9def,_0x3b3f8a=_0x3e2e21+'::'+(_0x4e10bd[_0x24ac83(0x12b)]()||'segment'),_0x57a75c=createHash(_0x24ac83(0x21b))[_0x24ac83(0x1c3)](_0x3b3f8a)[_0x24ac83(0x142)]('hex')[_0x24ac83(0x12e)](0x0,0xc);return'journey_entry_criteria_'+_0x57a75c;}export function ensureJourneyDefaults(_0xd398f4){const _0x433b17=a142_0x5b9def;!_0xd398f4[_0x433b17(0x190)]&&(_0xd398f4[_0x433b17(0x190)]=''),!_0xd398f4[_0x433b17(0x179)]&&(_0xd398f4[_0x433b17(0x179)]=_0x433b17(0x124));}export function injectExistingStageIds(_0x1fd4be,_0x9a7690){const _0x32e889=a142_0x5b9def,_0x2f61fc=new Map(_0x9a7690[_0x32e889(0x17c)](_0x134f88=>[_0x134f88[_0x32e889(0x13e)],_0x134f88['id']]));for(const _0x1f1052 of _0x1fd4be){if(!_0x1f1052['id']){const _0x15d5f8=_0x2f61fc[_0x32e889(0x1b1)](_0x1f1052[_0x32e889(0x13e)]);_0x15d5f8&&(_0x1f1052['id']=_0x15d5f8);}}}export function resolveTDFolderPath(_0x446a17,_0x584c97,_0x3dee29){const _0xc653c6=a142_0x5b9def;if(!_0x584c97)return _0x446a17;if(_0x446a17===_0x3dee29||_0x446a17[_0xc653c6(0x1ff)](_0x3dee29+'/'))return _0x446a17;return _0x446a17?_0x3dee29+'/'+_0x446a17:_0x3dee29;}export function addFoldersToCreate(_0x101458,_0x2d9641,_0x2c0ea9){const _0x72b1ce=a142_0x5b9def;if(!_0x101458)return;if(_0x2d9641[_0x72b1ce(0x1da)](_0x101458))return;const _0x130e26=_0x101458[_0x72b1ce(0x208)]('/');let _0x1f1922='';for(const _0x1cdc1b of _0x130e26){_0x1f1922=_0x1f1922?_0x1f1922+'/'+_0x1cdc1b:_0x1cdc1b,!_0x2d9641['has'](_0x1f1922)&&_0x2c0ea9['add'](_0x1f1922);}}export function sortFoldersByDepth(_0x2c6f2e){const _0x53c4f9=a142_0x5b9def;return[..._0x2c6f2e][_0x53c4f9(0x1f8)]((_0x5ee70c,_0x257db8)=>{const _0x18671d=_0x53c4f9,_0x1bd985=(_0x5ee70c[_0x18671d(0x1e2)](/\//g)||[])['length'],_0x255b87=(_0x257db8['match'](/\//g)||[])[_0x18671d(0x164)];return _0x1bd985-_0x255b87;});}import*as a142_0x2bab56 from'yaml';import{readFileSync}from'fs';import a142_0x30beb9 from'path';import{isJourneyDef,parseYamlString as a142_0x2abc5a,toYamlString as a142_0x4333ae,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x55f503){const _0x5e7762=a142_0x5b9def;if(Array['isArray'](_0x55f503))return'['+_0x55f503[_0x5e7762(0x17c)](_0x5ecf29=>stableStringify(_0x5ecf29))[_0x5e7762(0x1e3)](',')+']';if(_0x55f503&&typeof _0x55f503===_0x5e7762(0x180)){const _0xe7d24f=_0x55f503,_0x29c002=Object[_0x5e7762(0x205)](_0xe7d24f)[_0x5e7762(0x1f8)](),_0x45e906=_0x29c002[_0x5e7762(0x17c)](_0x392a45=>'\x22'+_0x392a45+'\x22:'+stableStringify(_0xe7d24f[_0x392a45]));return'{'+_0x45e906[_0x5e7762(0x1e3)](',')+'}';}const _0x49a21c=JSON[_0x5e7762(0x1dd)](_0x55f503);return _0x49a21c===undefined?'null':_0x49a21c;}function activationSignature(_0x230781){const _0x2c217b=a142_0x5b9def,_0x302f57={'connection':_0x230781[_0x2c217b(0x13c)],..._0x230781[_0x2c217b(0x174)]!==undefined&&{'all_columns':_0x230781['all_columns']},..._0x230781[_0x2c217b(0x1a1)]!==undefined&&{'columns':_0x230781[_0x2c217b(0x1a1)]},..._0x230781[_0x2c217b(0x224)]!==undefined&&{'behavior':_0x230781[_0x2c217b(0x224)]},..._0x230781[_0x2c217b(0x137)]!==undefined&&{'schedule':_0x230781['schedule']},..._0x230781[_0x2c217b(0x1dc)]!==undefined&&{'notification':_0x230781[_0x2c217b(0x1dc)]},..._0x230781[_0x2c217b(0x1f9)]!==undefined&&{'connector_config':_0x230781[_0x2c217b(0x1f9)]},..._0x230781[_0x2c217b(0x1e6)]!==undefined&&{'activation_template_id':_0x230781[_0x2c217b(0x1e6)]}};return stableStringify(_0x302f57);}async function fetchSegment(_0x80bf7f,_0x43343b,_0x474cca,_0x3004c0){const _0x33c67d=a142_0x5b9def,_0x109f71=_0x3004c0?.[_0x33c67d(0x1c5)](_0x2f9ea9=>_0x2f9ea9['id']===_0x474cca);if(_0x109f71)return _0x109f71;try{return await _0x80bf7f[_0x33c67d(0x162)][_0x33c67d(0x14d)](_0x43343b,_0x474cca);}catch(_0x158ade){logger[_0x33c67d(0x1c7)]('getSegment\x20failed\x20for\x20'+_0x474cca+_0x33c67d(0x1c0)+_0x158ade);try{return await _0x80bf7f[_0x33c67d(0x162)][_0x33c67d(0x1cc)](_0x474cca);}catch(_0x52055f){return logger[_0x33c67d(0x1c7)](_0x33c67d(0x1e5)+_0x474cca+':\x20'+_0x52055f),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3792dc,_0x3a2b30,_0x4e76a9){const _0x2881f5=a142_0x5b9def,_0x56addc=readPushRecovery(_0x3792dc['absolutePath']);if(_0x56addc?.[_0x2881f5(0x183)]===_0x3792dc[_0x2881f5(0x219)][_0x2881f5(0x13e)])for(const [_0x105559,_0x2dc7e2]of Object[_0x2881f5(0x181)](_0x56addc[_0x2881f5(0x15b)])){const _0x1869a1=generateDeterministicJourneySegmentName(_0x3792dc[_0x2881f5(0x219)][_0x2881f5(0x13e)],_0x105559);_0x2dc7e2['uniqueServerName']===_0x1869a1&&(_0x3a2b30[_0x2881f5(0x204)](_0x105559,_0x2dc7e2[_0x2881f5(0x191)]),_0x4e76a9['set'](_0x105559,_0x2dc7e2[_0x2881f5(0x191)]));}}async function createOrRecoverEmbeddedSegment(_0xf91b10,_0x50ed06,_0x373a50,_0x3fc75c){const _0x2aa6f4=a142_0x5b9def;let _0x3d5b6a;try{_0x3d5b6a=await _0xf91b10[_0x2aa6f4(0x162)][_0x2aa6f4(0x196)]({'name':_0x373a50['uniqueSegmentName'],'description':_0x373a50[_0x2aa6f4(0x190)],'journeyId':_0x373a50[_0x2aa6f4(0x1b7)],'rule':_0x3fc75c(_0x373a50[_0x2aa6f4(0x1bc)],!![]),'countPopulation':!![],'parentFolderId':_0x373a50['folderId'],'audienceId':_0x373a50[_0x2aa6f4(0x13d)]});}catch(_0x5aaa61){const _0x1a9cea=_0x5aaa61 instanceof Error&&_0x5aaa61[_0x2aa6f4(0x18f)][_0x2aa6f4(0x16b)]('Name\x20has\x20already\x20been\x20taken');if(_0x1a9cea){const _0x4db459=readPushRecovery(_0x50ed06['absolutePath']),_0x24d5d5=_0x4db459?.[_0x2aa6f4(0x183)]===_0x50ed06[_0x2aa6f4(0x219)]['name']?_0x4db459[_0x2aa6f4(0x15b)][_0x373a50[_0x2aa6f4(0x1e4)]]:undefined;if(_0x24d5d5?.[_0x2aa6f4(0x201)]===_0x373a50[_0x2aa6f4(0x130)])await _0xf91b10[_0x2aa6f4(0x162)][_0x2aa6f4(0x1df)](_0x373a50['parentId'],_0x24d5d5[_0x2aa6f4(0x191)],{'description':_0x373a50['description'],'rule':_0x3fc75c(_0x373a50['resolvedRule'],!![]),'countPopulation':!![]}),_0x3d5b6a=_0x24d5d5[_0x2aa6f4(0x191)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x2aa6f4(0x19a)+_0x373a50[_0x2aa6f4(0x1e4)]+_0x2aa6f4(0x15f)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x50ed06[_0x2aa6f4(0x156)]['replace'](/([^/]+)$/,_0x2aa6f4(0x195))+')\x20')+_0x2aa6f4(0x12d),_0x5aaa61);}else throw _0x5aaa61;}return saveSegmentToPushRecovery(_0x50ed06[_0x2aa6f4(0x156)],_0x50ed06[_0x2aa6f4(0x219)][_0x2aa6f4(0x13e)],_0x373a50[_0x2aa6f4(0x1e4)],{'segmentId':_0x3d5b6a,'uniqueServerName':_0x373a50[_0x2aa6f4(0x130)],'createdAt':new Date()[_0x2aa6f4(0x177)]()}),_0x3d5b6a;}export async function prepareSegmentFiles(_0x88ed8b,_0x13bb44,_0x1f028a,_0x47f0a9,_0x4bacac){const _0x22e14e=a142_0x5b9def,{activationDefToCreateRequest:_0x1d5db8}=await import('./child-segment-yaml.js'),_0x10a485=[],_0xe8566a=new Set();for(const {yamlConfig:_0x1bc3d5,folderPath:_0x461670,sourcePath:_0x59dc5e}of _0x88ed8b){const _0x4ff918=resolveTDFolderPath(_0x461670,_0x47f0a9,_0x4bacac),_0x4effad=_0x4ff918+':'+_0x1bc3d5[_0x22e14e(0x13e)],_0x200f5c=_0x13bb44['segmentByFolderAndName'][_0x22e14e(0x1b1)](_0x4effad),_0x531575=_0x200f5c?_0x13bb44['activationsBySegmentId'][_0x22e14e(0x1b1)](_0x200f5c['id'])||[]:[];addFoldersToCreate(_0x4ff918,_0x13bb44[_0x22e14e(0x1db)],_0xe8566a);const _0x1dcb74=calculateActivationActions(_0x1bc3d5[_0x22e14e(0x1d5)]||[],_0x531575,_0x13bb44[_0x22e14e(0x141)],_0x13bb44[_0x22e14e(0x1d9)]);for(const _0x123fba of _0x1dcb74){(_0x123fba[_0x22e14e(0x17b)]===_0x22e14e(0x1d1)||_0x123fba['type']===_0x22e14e(0x1c3))&&_0x123fba[_0x22e14e(0x12c)]&&(_0x123fba['validatedRequest']=await _0x1d5db8(_0x123fba[_0x22e14e(0x12c)],_0x1f028a));}const _0x53a5b8=calculateSegmentDiff(_0x1bc3d5,_0x200f5c,_0x531575,_0x13bb44[_0x22e14e(0x141)],_0x13bb44[_0x22e14e(0x1d9)]);_0x10a485[_0x22e14e(0x188)]({'relativePath':_0x1bc3d5['name'],'absolutePath':_0x59dc5e,'yamlConfig':_0x1bc3d5,'folderPath':_0x4ff918,'existingSegment':_0x200f5c,'existingActivations':_0x531575,'isNew':_0x53a5b8[_0x22e14e(0x1af)],'hasChanges':_0x53a5b8[_0x22e14e(0x161)],'diff':_0x53a5b8[_0x22e14e(0x21c)],'activationActions':_0x1dcb74});}return{'segmentFiles':_0x10a485,'foldersToCreate':_0xe8566a};}export async function prepareJourneyFiles(_0x65d119,_0x315c89,_0x287613,_0x197936){const _0x4d2c25=a142_0x5b9def,_0x1692d2=[],_0x1edd87=new Set();for(const {yamlConfig:_0x395f47,folderPath:_0x44cc5e,sourcePath:_0x2ca8e4}of _0x65d119){const _0x2fd61c=resolveTDFolderPath(_0x44cc5e,_0x287613,_0x197936),_0x2c65bf=_0x2fd61c+':'+_0x395f47[_0x4d2c25(0x13e)],_0x17ac1f=_0x315c89['journeyBundlesByFolderAndName'][_0x4d2c25(0x1b1)](_0x2c65bf);let _0x35c7c5,_0xdf7515;if(_0x17ac1f&&_0x17ac1f[_0x4d2c25(0x164)]>0x0){const _0x571047=buildLocalExpandedRuleMappings(_0x395f47),{createYamlContext:_0x31dea5,prefetchJourneySegments:_0xe318cf}=createPushYamlContextForBundle(_0x315c89[_0x4d2c25(0x160)],_0x315c89['parentId'],_0x315c89[_0x4d2c25(0x1ee)],_0x571047,_0x315c89[_0x4d2c25(0x141)],_0x315c89['connectionIdToNameMap'],_0x315c89[_0x4d2c25(0x1a7)],_0x315c89[_0x4d2c25(0x157)]);await _0xe318cf(_0x17ac1f['map'](_0x54b70e=>_0x54b70e['id']));const _0x2377ed=await _0x315c89[_0x4d2c25(0x160)]['journey'][_0x4d2c25(0x15d)](_0x17ac1f[0x0]['journeyBundleId']),_0x51b79a=hasMultipleVersions(_0x395f47),_0x38ad48=async _0x3f006b=>{const _0x38a26b=_0x4d2c25,_0x18ef7c=_0x315c89[_0x38a26b(0x157)]?.[_0x38a26b(0x1b1)](_0x3f006b);if(_0x18ef7c)return _0x18ef7c;return _0x315c89[_0x38a26b(0x136)]({'journeyId':_0x3f006b,'journeyName':_0x395f47['name'],'isMultiVersion':_0x17ac1f[_0x38a26b(0x164)]>0x1});};if(_0x51b79a&&_0x17ac1f[_0x4d2c25(0x164)]>0x1){const _0x415c0c=[];for(const _0xf10e02 of _0x17ac1f){const _0x3e6bac=_0xf10e02[_0x4d2c25(0x207)]||0x1;_0x315c89['progress']?.['update'](_0x4d2c25(0x1e1)+_0x395f47[_0x4d2c25(0x13e)]+'\x20v'+_0x3e6bac);const _0x75e628=await _0x38ad48(_0xf10e02['id']),_0x56b272=_0x31dea5(_0xf10e02['id']),_0x26fe83=await journeyResponseToDef(_0x75e628,_0x56b272);_0x415c0c[_0x4d2c25(0x188)]({'item':_0xf10e02,'yaml':_0x26fe83});}const _0x3e7f74=buildLocalRuleToNameMappingFromJourney(_0x395f47);_0xdf7515=buildMergedJourneyDef(_0x415c0c,_0x3e7f74,_0x2377ed);const _0x45add8=Math[_0x4d2c25(0x202)](..._0x415c0c[_0x4d2c25(0x17c)](_0x5aa5ca=>_0x5aa5ca[_0x4d2c25(0x18d)]['versionNumber']||0x0)),_0x3c8b98=_0x17ac1f[_0x4d2c25(0x1c5)](_0x33411b=>(_0x33411b[_0x4d2c25(0x207)]||0x0)===_0x45add8);_0x3c8b98&&(_0x315c89['progress']?.[_0x4d2c25(0x1c3)](_0x4d2c25(0x1e1)+_0x395f47['name']+'\x20v'+_0x45add8),_0x35c7c5=await _0x38ad48(_0x3c8b98['id']));}else{const _0x30caef=_0x17ac1f[_0x17ac1f[_0x4d2c25(0x164)]-0x1];_0x315c89['progress']?.[_0x4d2c25(0x1c3)](_0x4d2c25(0x1e1)+_0x395f47[_0x4d2c25(0x13e)]),_0x35c7c5=await _0x38ad48(_0x30caef['id']);const _0x5a970c=_0x31dea5(_0x30caef['id']),_0x1fcbcb=await journeyResponseToDef(_0x35c7c5,_0x5a970c),_0x383eb3=buildLocalRuleToNameMappingFromJourney(_0x395f47);_0xdf7515=buildMergedJourneyDef([{'item':_0x30caef,'yaml':_0x1fcbcb}],_0x383eb3,_0x2377ed);}}addFoldersToCreate(_0x2fd61c,_0x315c89[_0x4d2c25(0x1db)],_0x1edd87);const _0x26a831=calculateJourneyDiff(_0x395f47,_0xdf7515);_0x1692d2['push']({'relativePath':_0x395f47['name'],'absolutePath':_0x2ca8e4,'yamlConfig':_0x395f47,'folderPath':_0x2fd61c,'existingJourney':_0x35c7c5,'isNew':_0x26a831[_0x4d2c25(0x1af)],'hasChanges':_0x26a831[_0x4d2c25(0x161)],'diff':_0x26a831[_0x4d2c25(0x21c)]});}return{'journeyFiles':_0x1692d2,'foldersToCreate':_0x1edd87};}export function calculateActivationActions(_0x1f08d2,_0x12c859,_0x4a9b54,_0x9ec071){const _0x34ca93=a142_0x5b9def,_0x27b201=[],_0x49de1c=new Map();for(const _0xa68d91 of _0x12c859){_0x49de1c['set'](_0xa68d91[_0x34ca93(0x13e)],_0xa68d91);}const _0x437379=new Map();for(const _0x13c563 of _0x1f08d2){_0x437379['set'](_0x13c563[_0x34ca93(0x13e)],_0x13c563);}for(const _0x372e3f of _0x1f08d2){const _0x84158c=_0x49de1c[_0x34ca93(0x1b1)](_0x372e3f['name']);if(!_0x84158c)_0x27b201['push']({'type':_0x34ca93(0x1d1),'name':_0x372e3f[_0x34ca93(0x13e)],'yamlActivation':_0x372e3f});else{const _0xa86263=activationResponseToDef(_0x84158c,_0x4a9b54,_0x9ec071),_0x3825d5=a142_0x2bab56[_0x34ca93(0x1dd)](_0xa86263),_0x13f7d9=a142_0x2bab56['stringify'](_0x372e3f);_0x3825d5!==_0x13f7d9&&_0x27b201[_0x34ca93(0x188)]({'type':_0x34ca93(0x1c3),'name':_0x372e3f[_0x34ca93(0x13e)],'yamlActivation':_0x372e3f,'existingActivation':_0x84158c});}}for(const _0x3af0ee of _0x12c859){!_0x437379['has'](_0x3af0ee['name'])&&_0x27b201[_0x34ca93(0x188)]({'type':_0x34ca93(0x173),'name':_0x3af0ee[_0x34ca93(0x13e)],'existingActivation':_0x3af0ee});}return _0x27b201;}function calculateYamlDiff(_0x236765,_0x5a0d3d){if(_0x5a0d3d){const _0x1afd87=generateDiff(_0x5a0d3d,_0x236765),_0xc5d015=hasChanges(_0x1afd87);return{'isNew':![],'hasChanges':_0xc5d015,'diff':_0xc5d015?formatDiffWithColors(_0x1afd87):undefined};}const _0x27aeae=generateDiff('',_0x236765);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x27aeae)};}export function calculateSegmentDiff(_0x4d7bc8,_0x58053b,_0x16b6ff,_0x67574a,_0x2548aa){const _0x2ad68d=segmentToYamlString(_0x4d7bc8),_0x6c6041=_0x58053b?segmentToYamlString(segmentWithActivationsToYaml(_0x58053b,_0x16b6ff,undefined,_0x67574a,_0x2548aa)):undefined;return calculateYamlDiff(_0x2ad68d,_0x6c6041);}export function calculateJourneyDiff(_0x41c7c8,_0x2dba6a){const _0x246405=normalizeJourneyDef(_0x41c7c8,_0x41c7c8),_0x101253=a142_0x4333ae(_0x246405),_0x415cda=_0x2dba6a?a142_0x4333ae(normalizeJourneyDef(_0x2dba6a,_0x41c7c8)):undefined;return calculateYamlDiff(_0x101253,_0x415cda);}export function findSegmentsToDelete(_0x5c799c,_0x5a72fb,_0x5aab89,_0x51b98c,_0x4ae8d9){const _0x5ae967=a142_0x5b9def,_0x1949ae=new Set();for(const {yamlConfig:_0x1f2f61,folderPath:_0x48c3d8}of _0x5a72fb){_0x1949ae[_0x5ae967(0x128)](_0x48c3d8+':'+_0x1f2f61[_0x5ae967(0x13e)]);}return _0x5c799c[_0x5ae967(0x192)](_0x434755=>{const _0x308429=_0x5ae967,_0x2cc097=_0x434755['segmentFolderId']?_0x5aab89['get'](_0x434755[_0x308429(0x1d7)][_0x308429(0x1b0)]())||'':'',_0x598272=_0x2cc097+':'+_0x434755[_0x308429(0x13e)];if(_0x1949ae[_0x308429(0x1da)](_0x598272))return![];if(_0x4ae8d9)return _0x2cc097===_0x51b98c||_0x2cc097[_0x308429(0x1ff)](_0x51b98c+'/');return!![];});}export function findJourneysToDelete(_0x1da516,_0xae1b83,_0x2f0741,_0x4da8dd,_0x6bc7cc){const _0x3f899d=a142_0x5b9def,_0x180757=new Set();for(const {yamlConfig:_0x12ce42,folderPath:_0x1926d2}of _0xae1b83){_0x180757[_0x3f899d(0x128)](_0x1926d2+':'+_0x12ce42[_0x3f899d(0x13e)]);}return _0x1da516[_0x3f899d(0x192)](_0x4b7962=>{const _0x3111f2=_0x3f899d,_0x38a791=_0x4b7962[_0x3111f2(0x132)]?_0x2f0741['get'](_0x4b7962[_0x3111f2(0x132)])||'':'',_0x24d4df=_0x38a791+':'+_0x4b7962[_0x3111f2(0x1ab)];if(_0x180757[_0x3111f2(0x1da)](_0x24d4df))return![];if(_0x6bc7cc)return _0x38a791===_0x4da8dd||_0x38a791[_0x3111f2(0x1ff)](_0x4da8dd+'/');return!![];});}export function buildSegmentLookupMap(_0x45eaa1,_0x458082){const _0x59f084=a142_0x5b9def,_0x261bfe=new Map();for(const _0xb92f0c of _0x45eaa1){const _0x2c6753=_0xb92f0c[_0x59f084(0x1d7)]?_0x458082[_0x59f084(0x1b1)](_0xb92f0c['segmentFolderId']['toString']())||'':'',_0xa2622a=_0x2c6753+':'+_0xb92f0c[_0x59f084(0x13e)];_0x261bfe[_0x59f084(0x204)](_0xa2622a,_0xb92f0c);}return _0x261bfe;}export function buildSegmentNameToIdMap(_0x3882c3){const _0x343629=a142_0x5b9def,_0x580da6=new Map();for(const _0x2a9273 of _0x3882c3){_0x580da6[_0x343629(0x204)](_0x2a9273['name'],_0x2a9273['id']);}return _0x580da6;}export function buildJourneyBundleLookupMap(_0x1aa5c9,_0x20e6a0){const _0x5eb5b6=a142_0x5b9def,_0x23d9ea=new Map();for(const _0x361597 of _0x1aa5c9){const _0x42a0dc=_0x361597[_0x5eb5b6(0x132)]?_0x20e6a0[_0x5eb5b6(0x1b1)](_0x361597['folderId'])||'':'',_0x28d643=_0x42a0dc+':'+_0x361597[_0x5eb5b6(0x1ab)];!_0x23d9ea[_0x5eb5b6(0x1da)](_0x28d643)&&_0x23d9ea[_0x5eb5b6(0x204)](_0x28d643,[]),_0x23d9ea[_0x5eb5b6(0x1b1)](_0x28d643)[_0x5eb5b6(0x188)](_0x361597);}for(const _0x53abbc of _0x23d9ea[_0x5eb5b6(0x1d3)]()){_0x53abbc[_0x5eb5b6(0x1f8)]((_0xdc24c,_0x2979e3)=>(_0xdc24c[_0x5eb5b6(0x207)]||0x0)-(_0x2979e3[_0x5eb5b6(0x207)]||0x0));}return _0x23d9ea;}export function collectFoldersToCreate(_0x2e13cb,_0x1d7c24){const _0x121b64=a142_0x5b9def,_0xd5a9e1=new Set();for(const _0x5cb0ff of _0x2e13cb){if(!_0x5cb0ff)continue;if(_0x1d7c24['has'](_0x5cb0ff))continue;const _0x4578eb=_0x5cb0ff['split']('/');let _0x1374f0='';for(const _0xbcf442 of _0x4578eb){_0x1374f0=_0x1374f0?_0x1374f0+'/'+_0xbcf442:_0xbcf442,!_0x1d7c24[_0x121b64(0x1da)](_0x1374f0)&&_0xd5a9e1['add'](_0x1374f0);}}return _0xd5a9e1;}export function parseAndClassifyYamlFiles(_0x1e66b3,_0x62d109,_0x499880){const _0x50ddda=a142_0x5b9def,_0xbe5d2f=[],_0x2c7cc9=[];for(const _0x1e9bb9 of _0x1e66b3){const _0x5f5554=a142_0x30beb9[_0x50ddda(0x1f1)](_0x62d109,a142_0x30beb9[_0x50ddda(0x194)](_0x1e9bb9)),_0x1f2e24=_0x5f5554==='.'?'':_0x5f5554,_0x223582=readFileSync(_0x1e9bb9,_0x50ddda(0x19f)),_0x44d8e4=a142_0x2bab56[_0x50ddda(0x16f)](_0x223582);if(isJourneyDef(_0x44d8e4)){const _0x464146=a142_0x2abc5a(_0x223582);_0x2c7cc9['push']({'yamlConfig':_0x464146,'folderPath':_0x1f2e24,'sourcePath':_0x1e9bb9});}else{if(!_0x499880?.[_0x50ddda(0x1cd)]){const _0x4ccfa1=parseSegmentYamlFile(_0x223582),_0x460bd3=normalizeChildSegmentYaml(_0x4ccfa1);_0xbe5d2f[_0x50ddda(0x188)]({'yamlConfig':_0x460bd3,'folderPath':_0x1f2e24,'sourcePath':_0x1e9bb9});}}}return{'segments':_0xbe5d2f,'journeys':_0x2c7cc9};}export function validateParsedFiles(_0x303777,_0x3540d1){const _0x552525=a142_0x5b9def,_0x301380=[];for(const {yamlConfig:_0x5beddc,sourcePath:_0x1e330a}of _0x303777['segments']){const _0xd46d60=readFileSync(_0x1e330a,_0x552525(0x19f)),_0x4e78f9=a142_0x2bab56[_0x552525(0x17f)](_0xd46d60),_0x42aed3=validateSegmentDef(_0x5beddc,{'source':_0xd46d60,'document':_0x4e78f9},{'skipSchema':!![]});if(!_0x42aed3['valid']){const _0x44fbd4=a142_0x30beb9[_0x552525(0x1f1)](_0x3540d1,_0x1e330a);_0x301380['push']({'filePath':_0x44fbd4,'source':_0xd46d60,'result':_0x42aed3,'isJourney':![]});}}for(const {yamlConfig:_0x2323d8,sourcePath:_0x2148cf}of _0x303777[_0x552525(0x212)]){const _0x50776f=readFileSync(_0x2148cf,'utf-8'),_0x5ab2a1=a142_0x2bab56['parseDocument'](_0x50776f),_0x57a597=validateJourneyDef(_0x2323d8,{'source':_0x50776f,'document':_0x5ab2a1},{'skipSchema':!![]});if(!_0x57a597[_0x552525(0x1bf)]){const _0x3aee5a=a142_0x30beb9['relative'](_0x3540d1,_0x2148cf);_0x301380[_0x552525(0x188)]({'filePath':_0x3aee5a,'source':_0x50776f,'result':_0x57a597,'isJourney':!![]});}}return _0x301380;}export function formatValidationErrors(_0x382087){const _0x18896f=a142_0x5b9def,_0x3afa5a=[];for(const {filePath:_0x34ef0a,source:_0x3c023e,result:_0x2a6347,isJourney:_0x375476}of _0x382087){const _0x3983f5=_0x375476?_0x18896f(0x169):_0x18896f(0x162);_0x3afa5a[_0x18896f(0x188)]('\x0a'+_0x34ef0a+'\x20('+_0x3983f5+_0x18896f(0x211)+_0x2a6347[_0x18896f(0x171)][_0x18896f(0x164)]+'\x20error(s)'),_0x3afa5a['push'](formatValidationResult(_0x2a6347,_0x3c023e,_0x34ef0a));}return _0x3afa5a['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x21dc94){const _0x38658f=a142_0x5b9def,_0x69a2a7=new Set(),_0x1e5601=new Map(),_0x4b3956=collectSegmentUsageCounts(_0x21dc94);if(_0x21dc94[_0x38658f(0x15b)])for(const [_0x154936,_0x2912b0]of Object[_0x38658f(0x181)](_0x21dc94['segments'])){_0x69a2a7[_0x38658f(0x128)](_0x154936);if(_0x2912b0[_0x38658f(0x14c)]){const _0x5bcb2d=yamlRuleToApi(_0x2912b0[_0x38658f(0x14c)]),_0x6f17d8=apiRuleToYaml(_0x5bcb2d);_0x1e5601['set'](_0x154936,_0x6f17d8);}}const _0x2d8329=new Map();let _0x434541=0x0;for(const [_0x1f17e8,_0x38d99e]of _0x1e5601){const _0x357758=serializeExpandedRule(_0x38d99e,_0x1e5601),_0x3118ba=_0x2d8329[_0x38658f(0x1b1)](_0x357758)||[];_0x3118ba['push']({'name':_0x1f17e8,'index':_0x434541}),_0x2d8329[_0x38658f(0x204)](_0x357758,_0x3118ba),_0x434541++;}const _0x595cfe=new Map();for(const [_0x29e290,_0x387ca5]of _0x2d8329){const _0x20f580=_0x387ca5[_0x38658f(0x12e)]()[_0x38658f(0x1f8)]((_0x70acba,_0xd2598)=>{const _0x1581a2=_0x38658f,_0x3dc273=_0x4b3956[_0x1581a2(0x1b1)](_0x70acba[_0x1581a2(0x13e)])||0x0,_0x1747ca=_0x4b3956[_0x1581a2(0x1b1)](_0xd2598[_0x1581a2(0x13e)])||0x0;if(_0x3dc273!==_0x1747ca)return _0x1747ca-_0x3dc273;return _0x70acba[_0x1581a2(0x163)]-_0xd2598[_0x1581a2(0x163)];})[_0x38658f(0x17c)](_0x15404e=>_0x15404e['name']),_0x1d0c04=[];for(const _0x220a54 of _0x20f580){const _0x4a935c=_0x4b3956['get'](_0x220a54)||0x0,_0x2c6351=Math[_0x38658f(0x202)](_0x4a935c,0x1);for(let _0x48e2d3=0x0;_0x48e2d3<_0x2c6351;_0x48e2d3++){_0x1d0c04['push'](_0x220a54);}}_0x595cfe[_0x38658f(0x204)](_0x29e290,_0x1d0c04);}return{'existingLocalSegmentNames':_0x69a2a7,'localSegmentRules':_0x1e5601,'localExpandedRuleToNames':_0x595cfe};}function a142_0x3d03(){const _0x200918=['213UZpzkY','activationContext','valid',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','activationParams','day','update','some','find','\x27\x20decision\x20point\x20branch\x20\x27','debug','journey_creating','\x27\x20from\x20file:\x20','branches','\x27\x20milestone','getSegmentEntity','skipSegments','\x27\x20not\x20found\x20in\x20journey\x20\x27','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','239176BAuBFJ','create','INTERNAL','values','replace','activations','deleteSegment','segmentFolderId','Condition','connectionIdToNameMap','has','folderPathToId','notification','stringify','\x27\x20entry\x20criteria','updateSegmentById','entryCriteria','Fetching\x20','match','join','localName','getSegmentEntity\x20also\x20failed\x20for\x20','activation_template_id','goal\x20criteria','flatMap','20583MCeSyJ','Activation','withProgress','folder_created','Created\x20activation\x20\x27','existingSegments','run_after_journey_refresh','results','relative','JOURNEY_UPDATE_ERROR','2020jHfAQS','createFolder','exitCriterias','getActivation','journey_updating','sort','connector_config','created','Created\x20journey\x20\x27','reduce','\x27\x20for\x20','logDeleted','startsWith','deleted','uniqueServerName','max','kind','set','keys','\x20(referenced\x20in\x20journey\x20','versionNumber','split','2656nWcfkw','activation_deleted','segment_deleted','SEGMENT_SYNTAX_ERROR','Segment\x20not\x20found','JOURNEY_SYNTAX_ERROR','updated','\x20segment\x20from\x20file:\x20','):\x20','journeys','./journey-yaml.js','Updated\x20segment\x20\x27','waitStepType','createSegment','toLowerCase','WaitStep','yamlConfig','2118508NMszVS','sha1','diff','journeyStages','segmentNameToId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','__pending_','verbose','parentSegmentFolder','Duration','behavior','draft','logInfo','data','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','add','resolveSegment','journeyActivationNameToId','trim','yamlActivation','and\x20the\x20server\x20segment,\x20then\x20retry.','slice','3246aoUiLY','uniqueSegmentName','Entry\x20criteria:\x20','folderId','embedded_activation_creating','steps','createActivation','fetchJourney','schedule','createdSegmentId','journey_created','segment_creating','Failed\x20to\x20','connection','parentId','name','__pending_act_','Creating\x20segment\x20\x27','idToEmailMap','digest','\x0a\x20\x20','folder','activation_','embeddedSegmentNameToId','conditionTimeoutUnit','onProgress','activation_created','embedded_segment_created','segment_deleting','rule','getSegment','NOT_FOUND','stages','getJourney','milestone','size','\x27\x20exit\x20criteria','resolveJourneyId','logSuccess','absolutePath','journeyById','conditionSegmentId','ACTIVATION_UPDATE_ERROR','conditionTimeoutDuration','segments','existingActivation','getLatestJourneyId','Updating\x20segment\x20\x27','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','deps','hasChanges','segment','index','length','Created\x20segment\x20\x27','conditions','rootFolderId','waitStepUnit','journey','tdx.sdk.push-workflow','includes','Matched\x20server\x20segment\x20\x27','embedded_activation_created','SEGMENT_UPDATE_ERROR','parse','Creating\x20folder\x20\x27','errors','list','delete','all_columns','activationActions','with','toISOString','Creating\x20activation\x20\x27','state','Updated\x20journey\x20\x27','type','map','Deleted\x20activation\x20\x27','action','parseDocument','object','entries','\x27\x20to\x20local\x20\x27','journeyName','listActivations','ACTIVATION_SYNTAX_ERROR',').\x20','\x27\x20by\x20rule\x20content','push','embedded_segment_creating','attributes','../../utils/async.js','1055Jasgpy','item','161764yGaBQF','message','description','segmentId','filter','journey_updated','dirname','.$1.push-recovery.json','createJourneySegment','Created\x20folder\x20\x27','waitStep','from','Embedded\x20segment\x20\x27','existingJourney','\x27...','idToName','updateActivation','utf-8','Segment\x20not\x20found:\x20','columns','Updated\x20activation\x20\x27','validatedRequest','nameToId','relationships','stage\x20\x27','activationStepsById','\x27\x20wait\x20condition','DecisionPoint','activation_deleting','journeyBundleName','goal','existingSegment','2052576LFudxg','isNew','toString','get','deleteActivation','journeyActivationStepId','entry_criteria','Stage\x20\x27','createdSegmentIds','journeyId','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','unchanged','Deleted\x20segment\x20\x27','folderPath','resolvedRule'];a142_0x3d03=function(){return _0x200918;};return a142_0x3d03();}export function createSegmentIdResolver(_0x58dff9,_0x17ddf3){return async _0x478668=>{const _0x4b5458=a142_0x361a,_0x267f0c=_0x58dff9[_0x4b5458(0x1b1)](_0x478668);if(!_0x267f0c)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x478668+_0x4b5458(0x21f)+_0x17ddf3+'\x27)');return _0x267f0c;};}export function extractRootFolderId(_0x34e8ca){const _0x5f34c9=a142_0x5b9def;return _0x34e8ca['relationships']?.[_0x5f34c9(0x222)]?.[_0x5f34c9(0x126)]?.['id']||_0x34e8ca[_0x5f34c9(0x1a5)]?.['parentFolder']?.[_0x5f34c9(0x126)]?.['id'];}export function buildConnectionMaps(_0x3c21b5){const _0x30513f=a142_0x5b9def,_0x3baa62=new Map(),_0x4770a7=new Map(),_0x3c08d0=new Map();for(const _0x8a28b3 of _0x3c21b5){_0x3baa62[_0x30513f(0x204)](_0x8a28b3[_0x30513f(0x13e)],parseInt(_0x8a28b3['id'],0xa)),_0x4770a7['set'](_0x8a28b3['id'],_0x8a28b3[_0x30513f(0x13e)]),_0x3c08d0[_0x30513f(0x204)](_0x8a28b3['name'],_0x8a28b3[_0x30513f(0x17b)]);}return{'nameToId':_0x3baa62,'idToName':_0x4770a7,'nameToType':_0x3c08d0};}export function calculatePushStats(_0xe93db,_0xb38064,_0x1b2d5b,_0x3146d5,_0x2da9b2,_0x24be96,_0x52b4b3){const _0x598222=a142_0x5b9def,_0x1a97a8=_0xe93db[_0x598222(0x192)](_0x132ba0=>_0x132ba0['isNew']),_0x1bdd93=_0xe93db[_0x598222(0x192)](_0x3dcac8=>!_0x3dcac8[_0x598222(0x1af)]&&_0x3dcac8[_0x598222(0x161)]),_0x4ff01d=_0xe93db[_0x598222(0x192)](_0x5d39d8=>!_0x5d39d8[_0x598222(0x1af)]&&!_0x5d39d8[_0x598222(0x161)]),_0x44fc87=_0x24be96?_0x3146d5:[],_0x428971=_0xb38064[_0x598222(0x192)](_0x8d6c12=>_0x8d6c12[_0x598222(0x1af)]),_0x3b5db0=_0xb38064[_0x598222(0x192)](_0x5e539b=>!_0x5e539b[_0x598222(0x1af)]&&_0x5e539b['hasChanges']),_0x32d691=_0xb38064['filter'](_0x105875=>!_0x105875[_0x598222(0x1af)]&&!_0x105875[_0x598222(0x161)]),_0x3a821c=_0x24be96?_0x2da9b2:[],_0x56e3be=_0xe93db[_0x598222(0x1e8)](_0x5abff6=>_0x5abff6[_0x598222(0x175)]),_0x24e705=_0x56e3be[_0x598222(0x192)](_0x2a4955=>_0x2a4955[_0x598222(0x17b)]==='create'),_0x103696=_0x56e3be[_0x598222(0x192)](_0x183580=>_0x183580[_0x598222(0x17b)]==='update'),_0x1e6ac8=_0x56e3be[_0x598222(0x192)](_0x16f664=>_0x16f664[_0x598222(0x17b)]===_0x598222(0x173)),_0x22d502=Array[_0x598222(0x199)](_0x1b2d5b)[_0x598222(0x1f8)](),_0x37367a=_0x52b4b3?![]:_0x1a97a8[_0x598222(0x164)]>0x0||_0x1bdd93[_0x598222(0x164)]>0x0||_0x44fc87[_0x598222(0x164)]>0x0,_0x65404e=_0x428971[_0x598222(0x164)]>0x0||_0x3b5db0[_0x598222(0x164)]>0x0||_0x3a821c['length']>0x0,_0x2f6f2c=_0x52b4b3?![]:_0x56e3be[_0x598222(0x164)]>0x0,_0x2d2286=_0x22d502['length']>0x0;return{'segments':{'new':_0x1a97a8,'changed':_0x1bdd93,'unchanged':_0x4ff01d,'toDelete':_0x44fc87},'journeys':{'new':_0x428971,'changed':_0x3b5db0,'unchanged':_0x32d691,'toDelete':_0x3a821c},'activations':{'all':_0x56e3be,'toCreate':_0x24e705,'toUpdate':_0x103696,'toDelete':_0x1e6ac8},'folders':{'toCreate':_0x22d502},'counts':{'segments':{'new':_0x1a97a8[_0x598222(0x164)],'changed':_0x1bdd93[_0x598222(0x164)],'unchanged':_0x4ff01d[_0x598222(0x164)],'toDelete':_0x44fc87[_0x598222(0x164)]},'journeys':{'new':_0x428971[_0x598222(0x164)],'changed':_0x3b5db0[_0x598222(0x164)],'unchanged':_0x32d691['length'],'toDelete':_0x3a821c[_0x598222(0x164)]},'activations':{'create':_0x24e705['length'],'update':_0x103696['length'],'delete':_0x1e6ac8['length']},'folders':_0x22d502[_0x598222(0x164)]},'hasChanges':_0x37367a||_0x65404e||_0x2f6f2c||_0x2d2286};}export async function buildPushExecutionContext(_0x17735f,_0x4fcf2a,_0x2d192c,_0x3a2946,_0x9349ef,_0x388ab2){const _0x87b22d=a142_0x5b9def,_0x50bdb9=extractRootFolderId(_0x2d192c),{pathToId:_0x24e3a3,idToPath:_0x24d90b}=buildFolderMaps(_0x9349ef),_0x5157de=buildSegmentNameToIdMap(_0x3a2946),_0x26ef8b=new Map(),{batchAsync:_0x47e665}=await import(_0x87b22d(0x18b)),[_0x2b6c79,_0x3d5a0b]=await Promise['all']([_0x17735f['user']['buildUserMaps'](),_0x17735f['connection'][_0x87b22d(0x172)](),((async()=>{const _0x386b6c=_0x87b22d;!_0x388ab2&&_0x3a2946[_0x386b6c(0x164)]>0x0&&await _0x47e665(_0x3a2946,async _0x4941e4=>{const _0x250a96=_0x386b6c,_0x67dd8f=await _0x17735f[_0x250a96(0x162)][_0x250a96(0x184)](_0x4fcf2a,_0x4941e4['id']);_0x26ef8b[_0x250a96(0x204)](_0x4941e4['id'],_0x67dd8f);});})())]),{emailToId:_0x16df21,idToEmail:_0x22659c}=_0x2b6c79,_0x54b829=buildConnectionMaps(_0x3d5a0b);return{'rootFolderId':_0x50bdb9,'folderPathToId':_0x24e3a3,'folderIdToPath':_0x24d90b,'segmentNameToId':_0x5157de,'activationsBySegmentId':_0x26ef8b,'emailToIdMap':_0x16df21,'idToEmailMap':_0x22659c,'connectionNameToIdMap':_0x54b829[_0x87b22d(0x1a4)],'connectionIdToNameMap':_0x54b829[_0x87b22d(0x19d)],'connectionNameToTypeMap':_0x54b829['nameToType']};}export function createPushYamlContextForBundle(_0xa7bf1,_0x2cd9ec,_0x230b87,_0x397bbf,_0x414c15,_0x5648ba,_0x509c10,_0x20e76c){const {existingLocalSegmentNames:_0x4a1a65,localExpandedRuleToNames:_0xf4c73a}=_0x397bbf,_0xa290e1=new Set(),_0x2a8e47=new Map(),_0x4ab824=new Map(),_0x258af5=new Map(),_0x9fb272=createJumpTargetCache(),_0x1fc254=new Map(),_0x4f1289=new Map(),_0x36a6bc=new Set();let _0xc18c34;const _0x2a1a55=_0x4081ac=>{const _0x29b8aa={'resolveSegment':async _0x599cf9=>{const _0x481030=a142_0x361a,_0x14bec7=_0x258af5['get'](_0x599cf9);if(_0x14bec7!==undefined)return{'name':_0x14bec7,'isJourneyLocal':!![]};try{const _0x162c61=await fetchSegment(_0xa7bf1,_0x2cd9ec,_0x599cf9,_0x230b87);if(!_0x162c61)throw new Error(_0x481030(0x20d));const _0x53a872=generateJourneyLocalName(_0x162c61[_0x481030(0x13e)]),_0x1c5d81=_0x162c61[_0x481030(0x203)]===SEGMENT_KIND_JOURNEY&&_0x53a872!==undefined;let _0x5e0a73=_0x162c61['name'],_0x4b7a91;if(_0x1c5d81&&_0x162c61['rule']){const _0x1f74da=apiRuleToYaml(_0x162c61[_0x481030(0x14c)]);_0x4f1289[_0x481030(0x204)](_0x599cf9,_0x1f74da);const _0x58187f=async _0x25f0db=>{const _0x3de00d=_0x481030,_0x72c375=collectSegmentRefsFromRule(_0x25f0db);for(const _0x319ba0 of _0x72c375){if(!_0x4f1289['has'](_0x319ba0))try{const _0x49d485=await fetchSegment(_0xa7bf1,_0x2cd9ec,_0x319ba0,_0x230b87);if(_0x49d485?.[_0x3de00d(0x14c)]){const _0x538d7e=apiRuleToYaml(_0x49d485['rule']);_0x4f1289[_0x3de00d(0x204)](_0x319ba0,_0x538d7e),await _0x58187f(_0x538d7e);}}catch(_0xacd245){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x319ba0+':\x20'+_0xacd245);}}};await _0x58187f(_0x1f74da);const _0x297e8b=serializeExpandedRule(_0x1f74da,_0x4f1289),_0x45ff5b=_0xf4c73a[_0x481030(0x1b1)](_0x297e8b);if(_0x45ff5b&&_0x45ff5b[_0x481030(0x164)]>0x0){const _0x21edd2=_0x2a8e47[_0x481030(0x1b1)](_0x297e8b)||0x0,_0x502978=_0x45ff5b[_0x21edd2]||_0x45ff5b[_0x45ff5b[_0x481030(0x164)]-0x1];_0x2a8e47[_0x481030(0x204)](_0x297e8b,_0x21edd2+0x1),_0x5e0a73=_0x502978,_0xa290e1[_0x481030(0x128)](_0x5e0a73),_0x258af5['set'](_0x599cf9,_0x5e0a73);const _0x57c73b=await resolveRuleSegmentRefs(_0x1f74da,async _0xfad175=>{const _0x46368c=_0x481030,_0x2cc824=_0x258af5[_0x46368c(0x1b1)](_0xfad175);if(_0x2cc824)return _0x2cc824;const _0x50feba=await _0xc18c34[_0x46368c(0x129)](_0xfad175);return _0x50feba[_0x46368c(0x13e)];});_0x4b7a91={'description':_0x162c61[_0x481030(0x190)],'rule':_0x57c73b};}else{const _0x5eb0e7=_0x1fc254[_0x481030(0x1b1)](_0x297e8b);if(_0x5eb0e7)_0x5e0a73=_0x5eb0e7,_0x258af5[_0x481030(0x204)](_0x599cf9,_0x5e0a73);else{if(_0x53a872){let _0x499af1=_0x53a872,_0x43fdac=0x2;while(_0xa290e1[_0x481030(0x1da)](_0x499af1)||_0x4a1a65[_0x481030(0x1da)](_0x499af1)){_0x499af1=_0x53a872+'_'+_0x43fdac,_0x43fdac++;}_0xa290e1[_0x481030(0x128)](_0x499af1),_0x5e0a73=_0x499af1;}_0x258af5[_0x481030(0x204)](_0x599cf9,_0x5e0a73),_0x1fc254[_0x481030(0x204)](_0x297e8b,_0x5e0a73);const _0x32bed2=await resolveRuleSegmentRefs(_0x1f74da,async _0x471d65=>{const _0x476c58=_0x481030,_0x262201=_0x258af5[_0x476c58(0x1b1)](_0x471d65);if(_0x262201)return _0x262201;const _0x1124e4=await _0xc18c34[_0x476c58(0x129)](_0x471d65);return _0x1124e4['name'];});_0x4b7a91={'description':_0x162c61[_0x481030(0x190)],'rule':_0x32bed2};}}}return{'name':_0x5e0a73,'isJourneyLocal':_0x1c5d81,'definition':_0x4b7a91};}catch(_0x314732){return logger[_0x481030(0x1c7)]('Failed\x20to\x20resolve\x20segment\x20'+_0x599cf9+':\x20'+_0x314732),{'name':_0x599cf9,'isJourneyLocal':![]};}},'resolveActivation':async _0x32f078=>{const _0x358bae=a142_0x361a,_0x1f4181=_0x4ab824[_0x358bae(0x1b1)](_0x32f078);if(_0x1f4181!==undefined)return{'name':_0x1f4181,'isJourneyLocal':!![]};try{let _0x4f15b3=_0x509c10?.[_0x358bae(0x1b1)](_0x32f078);!_0x4f15b3&&(_0x4f15b3=await _0xa7bf1[_0x358bae(0x169)][_0x358bae(0x1f6)](_0x4081ac,_0x32f078));const _0x4d5886=_0x4f15b3[_0x358bae(0x18a)][_0x358bae(0x1c1)][_0x358bae(0x13e)]||_0x32f078,_0x55a139=sanitizeYamlKey(_0x4d5886)||_0x358bae(0x145)+_0x32f078,_0x1976a3=_0x55a139;_0x4ab824[_0x358bae(0x204)](_0x32f078,_0x1976a3);const _0x125385=journeyActivationStepToYaml(_0x4f15b3,_0x414c15,_0x5648ba);return{'name':_0x1976a3,'isJourneyLocal':!![],'definition':_0x125385};}catch(_0x37d7f6){return logger['debug']('Failed\x20to\x20resolve\x20activation\x20'+_0x32f078+':\x20'+_0x37d7f6),{'name':_0x32f078,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x20e54c,_0x17369b)=>resolveJumpTarget(_0x20e54c,_0x17369b,_0x9fb272,async _0x26d12c=>{const _0x3b65c3=a142_0x361a,_0x1fee34=_0x20e76c?.[_0x3b65c3(0x1b1)](_0x26d12c);if(_0x1fee34)return _0x1fee34;return _0xa7bf1[_0x3b65c3(0x169)][_0x3b65c3(0x150)](_0x26d12c);})};return _0xc18c34=_0x29b8aa,_0x29b8aa;},_0x3e8e13=async _0x2f1c4c=>{const _0x1836e7=a142_0x361a,{collectSegmentIdsFromJourneyApi:_0x5744a6}=await import(_0x1836e7(0x213)),{batchAsync:_0x4f4aef}=await import(_0x1836e7(0x18b)),_0x256c51=new Set();for(const _0x400ad5 of _0x2f1c4c){let _0x4bafe2=_0x20e76c?.[_0x1836e7(0x1b1)](_0x400ad5);!_0x4bafe2&&(_0x4bafe2=await _0xa7bf1[_0x1836e7(0x169)][_0x1836e7(0x150)](_0x400ad5));const _0x508e90=_0x5744a6(_0x4bafe2);for(const _0x476035 of _0x508e90){_0x256c51[_0x1836e7(0x128)](_0x476035);}}let _0x1ee74f=Array[_0x1836e7(0x199)](_0x256c51);while(_0x1ee74f['length']>0x0){const _0x2f83b2=_0x1ee74f[_0x1836e7(0x192)](_0x39b3a5=>!_0x36a6bc[_0x1836e7(0x1da)](_0x39b3a5));if(_0x2f83b2[_0x1836e7(0x164)]===0x0)break;const _0x372698=await _0x4f4aef(_0x2f83b2,async _0x4973ed=>{const _0x4653df=_0x1836e7;_0x36a6bc[_0x4653df(0x128)](_0x4973ed);const _0x11aa5b=await fetchSegment(_0xa7bf1,_0x2cd9ec,_0x4973ed,_0x230b87);if(!_0x11aa5b)return null;return{'segmentId':_0x4973ed,'segment':_0x11aa5b};},0xa),_0x2018cf=new Set();for(const _0x5b05c0 of _0x372698){if(!_0x5b05c0?.[_0x1836e7(0x162)]?.[_0x1836e7(0x14c)])continue;const _0x8cc859=apiRuleToYaml(_0x5b05c0[_0x1836e7(0x162)][_0x1836e7(0x14c)]);_0x4f1289['set'](_0x5b05c0[_0x1836e7(0x191)],_0x8cc859);const _0x3acac9=collectSegmentRefsFromRule(_0x8cc859);for(const _0x4dad1a of _0x3acac9){!_0x36a6bc[_0x1836e7(0x1da)](_0x4dad1a)&&_0x2018cf[_0x1836e7(0x128)](_0x4dad1a);}}_0x1ee74f=Array[_0x1836e7(0x199)](_0x2018cf);}};return{'createYamlContext':_0x2a1a55,'prefetchJourneySegments':_0x3e8e13};}export async function executePushSegments(_0x2db69b,_0x40115f,_0x2aa1d1,_0x559fff,_0x589abb){const _0x2fc3b1=a142_0x5b9def,{segmentDefToCreateRequest:_0x2b342d,segmentDefToUpdateRequest:_0x45929b}=await import('./child-segment-yaml.js'),_0x2469b7=_0x2aa1d1[_0x2fc3b1(0x1db)],_0x46411f=0x5,_0x234530=async _0x19e058=>{const _0x564c78=_0x2fc3b1,_0xc03415=_0x19e058[_0x564c78(0x1bb)]?_0x2469b7[_0x564c78(0x1b1)](_0x19e058[_0x564c78(0x1bb)]):undefined;let _0x49f1af;const _0x565587={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x99d17b=_0x19e058[_0x564c78(0x219)];if(_0x19e058[_0x564c78(0x219)][_0x564c78(0x14c)]){const _0x3d170c=createSegmentIdResolver(_0x2aa1d1[_0x564c78(0x21e)],_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]),_0x4c628d=await resolveRuleSegmentIds(_0x19e058['yamlConfig'][_0x564c78(0x14c)],_0x3d170c);_0x99d17b={..._0x19e058[_0x564c78(0x219)],'rule':_0x4c628d};}try{if(_0x19e058[_0x564c78(0x1af)]){_0x589abb[_0x564c78(0x148)]?.({'type':_0x564c78(0x13a),'name':_0x19e058['yamlConfig']['name']});const _0x29a80e=_0x2b342d(_0x99d17b,_0xc03415),_0x33ece8=await _0x589abb[_0x564c78(0x1eb)](_0x564c78(0x140)+_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]+'\x27...',()=>_0x2db69b['segment'][_0x564c78(0x216)](_0x559fff['parentId'],_0x29a80e));_0x49f1af=_0x33ece8['data']['id'],_0x2aa1d1[_0x564c78(0x21e)][_0x564c78(0x204)](_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)],_0x49f1af),_0x565587[_0x564c78(0x138)]={'name':_0x19e058['yamlConfig'][_0x564c78(0x13e)],'id':_0x49f1af},_0x589abb[_0x564c78(0x148)]?.({'type':'segment_created','name':_0x19e058['yamlConfig'][_0x564c78(0x13e)],'segmentId':_0x49f1af}),_0x589abb[_0x564c78(0x155)]?.(_0x564c78(0x165)+_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]+'\x27'),_0x565587[_0x564c78(0x1fa)]=0x1;}else{if(_0x19e058['hasChanges']){_0x589abb[_0x564c78(0x148)]?.({'type':'segment_updating','name':_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]});const _0x22ed54=_0x45929b(_0x99d17b);_0xc03415!==_0x19e058[_0x564c78(0x1ad)]?.[_0x564c78(0x1d7)]&&(_0x22ed54['segmentFolderId']=_0xc03415?parseInt(_0xc03415,0xa):undefined),await _0x589abb[_0x564c78(0x1eb)](_0x564c78(0x15e)+_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]+_0x564c78(0x19c),()=>_0x2db69b['segment'][_0x564c78(0x1df)](_0x559fff[_0x564c78(0x13d)],_0x19e058[_0x564c78(0x1ad)]['id'],_0x22ed54)),_0x49f1af=_0x19e058[_0x564c78(0x1ad)]['id'],_0x589abb['onProgress']?.({'type':'segment_updated','name':_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]}),_0x589abb['logSuccess']?.(_0x564c78(0x214)+_0x19e058['yamlConfig']['name']+'\x27'),_0x565587[_0x564c78(0x20f)]=0x1;}else _0x49f1af=_0x19e058[_0x564c78(0x1ad)]['id'];}}catch(_0x4efde8){const _0x45d614=isHttp400Error(_0x4efde8),_0x1e0b2d=_0x45d614?ErrorCode[_0x564c78(0x20c)]:ErrorCode[_0x564c78(0x16e)],_0x513398=getErrorMessage(_0x4efde8);throw new SDKError(_0x1e0b2d,'Failed\x20to\x20'+(_0x19e058[_0x564c78(0x1af)]?_0x564c78(0x1d1):_0x564c78(0x1c3))+_0x564c78(0x210)+_0x19e058[_0x564c78(0x156)]+_0x564c78(0x143)+_0x513398,_0x4efde8);}try{const _0x1bd399=await syncActivationsForSegment(_0x2db69b,_0x559fff[_0x564c78(0x13d)],_0x49f1af,_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)],_0x19e058[_0x564c78(0x175)],_0x589abb,_0x19e058['absolutePath']);_0x565587[_0x564c78(0x1d5)]=_0x1bd399;}catch(_0x448ade){if(_0x448ade instanceof SDKError)throw _0x448ade;throw new SDKError(ErrorCode[_0x564c78(0x159)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x19e058['yamlConfig']['name']+_0x564c78(0x1c9)+_0x19e058[_0x564c78(0x156)]+_0x564c78(0x143)+getErrorMessage(_0x448ade),_0x448ade);}return _0x565587;},_0x44771e=await batchAsync(_0x40115f,_0x234530,_0x46411f),_0x2f2bd7={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x457462 of _0x44771e){_0x2f2bd7[_0x2fc3b1(0x1fa)]+=_0x457462[_0x2fc3b1(0x1fa)],_0x2f2bd7[_0x2fc3b1(0x20f)]+=_0x457462['updated'],_0x457462[_0x2fc3b1(0x138)]&&_0x2f2bd7[_0x2fc3b1(0x1b6)][_0x2fc3b1(0x204)](_0x457462[_0x2fc3b1(0x138)][_0x2fc3b1(0x13e)],_0x457462[_0x2fc3b1(0x138)]['id']),_0x2f2bd7[_0x2fc3b1(0x1d5)]['created']+=_0x457462[_0x2fc3b1(0x1d5)]['created'],_0x2f2bd7['activations'][_0x2fc3b1(0x20f)]+=_0x457462[_0x2fc3b1(0x1d5)]['updated'],_0x2f2bd7['activations'][_0x2fc3b1(0x200)]+=_0x457462['activations'][_0x2fc3b1(0x200)];}return _0x2f2bd7;}async function syncActivationsForSegment(_0x180cca,_0x15643a,_0x4b8441,_0x497751,_0x1401b8,_0x5391e8,_0x13395a){const _0x272d6f=a142_0x5b9def,_0x541fcb={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x28e38b of _0x1401b8){try{if(_0x28e38b['type']===_0x272d6f(0x1d1)&&_0x28e38b[_0x272d6f(0x1a3)])_0x5391e8[_0x272d6f(0x148)]?.({'type':'activation_creating','segmentName':_0x497751,'activationName':_0x28e38b[_0x272d6f(0x13e)]}),await _0x5391e8[_0x272d6f(0x1eb)](_0x272d6f(0x178)+_0x28e38b[_0x272d6f(0x13e)]+_0x272d6f(0x19c),()=>_0x180cca[_0x272d6f(0x162)][_0x272d6f(0x135)](_0x15643a,_0x4b8441,_0x28e38b[_0x272d6f(0x1a3)])),_0x5391e8['onProgress']?.({'type':_0x272d6f(0x149),'segmentName':_0x497751,'activationName':_0x28e38b[_0x272d6f(0x13e)]}),_0x5391e8[_0x272d6f(0x155)]?.(_0x272d6f(0x1ed)+_0x28e38b[_0x272d6f(0x13e)]+'\x27'),_0x541fcb['created']++;else{if(_0x28e38b[_0x272d6f(0x17b)]==='update'&&_0x28e38b[_0x272d6f(0x1a3)]&&_0x28e38b[_0x272d6f(0x15c)])_0x5391e8['onProgress']?.({'type':'activation_updating','segmentName':_0x497751,'activationName':_0x28e38b[_0x272d6f(0x13e)]}),await _0x5391e8['withProgress']('Updating\x20activation\x20\x27'+_0x28e38b[_0x272d6f(0x13e)]+_0x272d6f(0x19c),()=>_0x180cca['segment'][_0x272d6f(0x19e)](_0x15643a,_0x4b8441,_0x28e38b[_0x272d6f(0x15c)]['id'],_0x28e38b[_0x272d6f(0x1a3)])),_0x5391e8['onProgress']?.({'type':'activation_updated','segmentName':_0x497751,'activationName':_0x28e38b['name']}),_0x5391e8[_0x272d6f(0x155)]?.(_0x272d6f(0x1a2)+_0x28e38b[_0x272d6f(0x13e)]+'\x27'),_0x541fcb[_0x272d6f(0x20f)]++;else _0x28e38b['type']===_0x272d6f(0x173)&&_0x28e38b[_0x272d6f(0x15c)]&&(_0x5391e8[_0x272d6f(0x148)]?.({'type':_0x272d6f(0x1aa),'segmentName':_0x497751,'activationName':_0x28e38b[_0x272d6f(0x13e)]}),await _0x5391e8[_0x272d6f(0x1eb)]('Deleting\x20activation\x20\x27'+_0x28e38b['name']+_0x272d6f(0x19c),()=>_0x180cca[_0x272d6f(0x162)][_0x272d6f(0x1b2)](_0x15643a,_0x4b8441,_0x28e38b[_0x272d6f(0x15c)]['id'])),_0x5391e8['onProgress']?.({'type':_0x272d6f(0x20a),'segmentName':_0x497751,'activationName':_0x28e38b[_0x272d6f(0x13e)]}),_0x5391e8[_0x272d6f(0x1fe)]?.(_0x272d6f(0x17d)+_0x28e38b[_0x272d6f(0x13e)]+'\x27'),_0x541fcb[_0x272d6f(0x200)]++);}}catch(_0x34c63c){const _0x3804b4=isHttp400Error(_0x34c63c),_0x3f18d9=_0x3804b4?ErrorCode[_0x272d6f(0x185)]:ErrorCode[_0x272d6f(0x159)],_0x2c87ab=getErrorMessage(_0x34c63c);throw new SDKError(_0x3f18d9,'Failed\x20to\x20'+_0x28e38b['type']+'\x20activation\x20\x27'+_0x28e38b[_0x272d6f(0x13e)]+'\x27\x20from\x20file:\x20'+_0x13395a+_0x272d6f(0x143)+_0x2c87ab,_0x34c63c);}}return _0x541fcb;}export async function executePushFolders(_0x1a8917,_0x39202f,_0x6efc97,_0xaea03a,_0x213591){const _0x1910d8=a142_0x5b9def,_0x26d6bf=new Map(_0x6efc97),_0xbcf289=sortFoldersByDepth(_0x39202f);for(const _0x3225ba of _0xbcf289){const _0x109f61=_0x3225ba['split']('/'),_0xd0c45a=_0x109f61[_0x109f61[_0x1910d8(0x164)]-0x1],_0x59f2f7=_0x109f61[_0x1910d8(0x12e)](0x0,-0x1)[_0x1910d8(0x1e3)]('/'),_0x201eb9=_0x26d6bf['get'](_0x59f2f7);_0x213591[_0x1910d8(0x148)]?.({'type':'folder_creating','folder':_0x3225ba});const _0x21b5d8={'name':_0xd0c45a,'parentFolderId':_0x201eb9},_0x31bb8c=await _0x213591[_0x1910d8(0x1eb)](_0x1910d8(0x170)+_0x3225ba+_0x1910d8(0x19c),()=>_0x1a8917['segment'][_0x1910d8(0x1f4)](_0xaea03a['parentId'],_0x21b5d8));_0x26d6bf[_0x1910d8(0x204)](_0x3225ba,_0x31bb8c[_0x1910d8(0x126)]['id']),_0x213591[_0x1910d8(0x148)]?.({'type':_0x1910d8(0x1ec),'folder':_0x3225ba,'folderId':_0x31bb8c[_0x1910d8(0x126)]['id']}),_0x213591[_0x1910d8(0x125)]?.(_0x1910d8(0x197)+_0x3225ba+'\x27');}return _0x26d6bf;}export async function executePushSegmentDeletions(_0x3ac322,_0x563782,_0x5191a7){const _0x4c988f=a142_0x5b9def;if(_0x563782[_0x4c988f(0x164)]===0x0)return 0x0;const {batchAsync:_0x643a1b}=await import(_0x4c988f(0x18b)),_0x215d35=0x5,_0x4352d1=await _0x643a1b(_0x563782,async _0x4aa51f=>{const _0x32fef7=_0x4c988f;return _0x5191a7[_0x32fef7(0x148)]?.({'type':_0x32fef7(0x14b),'name':_0x4aa51f[_0x32fef7(0x13e)]}),await _0x3ac322['segment'][_0x32fef7(0x1d6)](_0x4aa51f['id']),_0x5191a7[_0x32fef7(0x148)]?.({'type':_0x32fef7(0x20b),'name':_0x4aa51f[_0x32fef7(0x13e)]}),_0x5191a7[_0x32fef7(0x1fe)]?.(_0x32fef7(0x1ba)+_0x4aa51f[_0x32fef7(0x13e)]+'\x27'),0x1;},_0x215d35);return _0x4352d1[_0x4c988f(0x1fc)]((_0x1653bd,_0x363db2)=>_0x1653bd+_0x363db2,0x0);}export async function executePushJourneys(_0x419963,_0x2e5393,_0x59aed5,_0x37d098,_0x4db60a){const _0x4063f4=a142_0x5b9def,{journeyDefToRequest:_0x2c7430}=await import(_0x4063f4(0x213)),{activationDefToCreateRequest:_0x1957a6,yamlRuleToApi:_0x39e886,validateSegmentRule:_0x2ad619}=await import('./child-segment-yaml.js'),_0x528f15={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x43c515=new Map(_0x59aed5[_0x4063f4(0x21e)]),_0x3f6c64=0x5;for(let _0x569a1c=0x0;_0x569a1c<_0x2e5393[_0x4063f4(0x164)];_0x569a1c+=_0x3f6c64){const _0x37f8d9=_0x2e5393[_0x4063f4(0x12e)](_0x569a1c,_0x569a1c+_0x3f6c64),_0x54125d=await Promise['all'](_0x37f8d9[_0x4063f4(0x17c)](async _0x51af5a=>{const _0x3202f0=_0x4063f4;if(!_0x51af5a['isNew']&&!_0x51af5a['hasChanges'])return{'action':'unchanged','name':_0x51af5a[_0x3202f0(0x219)]['name'],'journeyId':_0x51af5a[_0x3202f0(0x19b)]?.['id']};const _0x3ea679=_0x51af5a[_0x3202f0(0x1bb)]?_0x59aed5[_0x3202f0(0x1db)][_0x3202f0(0x1b1)](_0x51af5a[_0x3202f0(0x1bb)]):undefined;_0x4db60a[_0x3202f0(0x148)]?.({'type':_0x51af5a['isNew']?_0x3202f0(0x1c8):_0x3202f0(0x1f7),'name':_0x51af5a[_0x3202f0(0x219)][_0x3202f0(0x13e)]});try{const _0x5b7ab9=await executeSingleJourneyPush(_0x419963,_0x51af5a,{..._0x59aed5,'segmentNameToId':_0x43c515},{'parentId':_0x37d098['parentId'],'rootFolderId':_0x37d098[_0x3202f0(0x167)],'folderId':_0x3ea679,'verbose':_0x37d098[_0x3202f0(0x221)]},_0x4db60a,{'journeyDefToRequest':_0x2c7430,'activationDefToCreateRequest':_0x1957a6,'yamlRuleToApi':_0x39e886,'validateSegmentRule':_0x2ad619});for(const [_0x4ac0c6,_0x3e5b11]of _0x5b7ab9[_0x3202f0(0x146)]){_0x43c515[_0x3202f0(0x204)](_0x4ac0c6,_0x3e5b11),_0x528f15[_0x3202f0(0x146)]['set'](_0x4ac0c6,_0x3e5b11);}if(_0x5b7ab9[_0x3202f0(0x17e)]===_0x3202f0(0x1fa))_0x4db60a['onProgress']?.({'type':_0x3202f0(0x139),'name':_0x51af5a[_0x3202f0(0x219)][_0x3202f0(0x13e)],'journeyId':_0x5b7ab9[_0x3202f0(0x1b7)]}),_0x4db60a[_0x3202f0(0x155)]?.(_0x3202f0(0x1fb)+_0x51af5a[_0x3202f0(0x219)][_0x3202f0(0x13e)]+'\x27'),_0x528f15[_0x3202f0(0x1fa)]++;else _0x5b7ab9[_0x3202f0(0x17e)]===_0x3202f0(0x20f)&&(_0x4db60a[_0x3202f0(0x148)]?.({'type':_0x3202f0(0x193),'name':_0x51af5a[_0x3202f0(0x219)]['name']}),_0x4db60a['logSuccess']?.(_0x3202f0(0x17a)+_0x51af5a[_0x3202f0(0x219)]['name']+'\x27'),_0x528f15['updated']++);return{'action':_0x5b7ab9[_0x3202f0(0x17e)],'name':_0x51af5a['yamlConfig']['name'],'journeyId':_0x5b7ab9[_0x3202f0(0x1b7)]};}catch(_0x59a13d){const _0x294fe3=isHttp400Error(_0x59a13d),_0x65085d=_0x294fe3?ErrorCode[_0x3202f0(0x20e)]:ErrorCode[_0x3202f0(0x1f2)],_0x12898b=getErrorMessage(_0x59a13d);throw new SDKError(_0x65085d,_0x3202f0(0x13b)+(_0x51af5a['isNew']?_0x3202f0(0x1d1):_0x3202f0(0x1c3))+'\x20journey\x20from\x20file:\x20'+_0x51af5a[_0x3202f0(0x156)]+_0x3202f0(0x143)+_0x12898b,_0x59a13d);}}));_0x528f15[_0x4063f4(0x1f0)][_0x4063f4(0x188)](..._0x54125d);}return _0x528f15;}async function matchExistingJourneySegments(_0x187695,_0x42ad9d,_0x5264d0,_0x272e67,_0x6f0ef5){const _0x218112=a142_0x5b9def;if(!_0x42ad9d['existingJourney']||!_0x42ad9d[_0x218112(0x219)]['segments'])return;const _0x428f03=new Map(),_0x2ada2f=new Set();for(const _0x481345 of Object[_0x218112(0x205)](_0x42ad9d[_0x218112(0x219)][_0x218112(0x15b)])){const _0x174349=generateDeterministicJourneySegmentName(_0x42ad9d[_0x218112(0x219)]['name'],_0x481345);_0x428f03[_0x218112(0x204)](_0x174349,_0x481345),_0x2ada2f[_0x218112(0x128)](_0x481345);}const _0x5874f3=[],_0x46139e=collectSegmentIdsFromJourneyApi(_0x42ad9d[_0x218112(0x19b)]);for(const _0x320f22 of _0x46139e){const _0x1693b5=await fetchSegment(_0x187695,_0x5264d0,_0x320f22,_0x272e67);if(!_0x1693b5?.[_0x218112(0x13e)])continue;const _0x526211=_0x428f03[_0x218112(0x1b1)](_0x1693b5[_0x218112(0x13e)]);_0x526211?(_0x6f0ef5[_0x218112(0x204)](_0x526211,_0x320f22),_0x2ada2f['delete'](_0x526211)):_0x5874f3[_0x218112(0x188)]({'id':_0x320f22,'seg':_0x1693b5});}if(_0x2ada2f[_0x218112(0x152)]>0x0&&_0x5874f3[_0x218112(0x164)]>0x0){const {localExpandedRuleToNames:_0x2b3e2d}=buildLocalExpandedRuleMappings(_0x42ad9d[_0x218112(0x219)]),_0x247a44=new Map();for(const {id:_0x5a91ca,seg:_0x45b543}of _0x5874f3){if(_0x45b543[_0x218112(0x14c)]){const _0x3b2937=apiRuleToYaml(_0x45b543[_0x218112(0x14c)]);_0x247a44['set'](_0x5a91ca,_0x3b2937);}}for(const {id:_0x48f4f2,seg:_0x5e697f}of _0x5874f3){if(!_0x5e697f[_0x218112(0x14c)])continue;const _0x1de032=_0x247a44[_0x218112(0x1b1)](_0x48f4f2);if(!_0x1de032)continue;const _0x1a52f5=serializeExpandedRule(_0x1de032,_0x247a44),_0x2bc24c=_0x2b3e2d[_0x218112(0x1b1)](_0x1a52f5);if(_0x2bc24c){const _0x4fee32=_0x2bc24c[_0x218112(0x1c5)](_0x102a62=>_0x2ada2f['has'](_0x102a62));_0x4fee32&&(_0x6f0ef5[_0x218112(0x204)](_0x4fee32,_0x48f4f2),_0x2ada2f[_0x218112(0x173)](_0x4fee32),logger[_0x218112(0x1c7)](_0x218112(0x16c)+_0x5e697f[_0x218112(0x13e)]+_0x218112(0x182)+_0x4fee32+_0x218112(0x187)));}}}}async function executeSingleJourneyPush(_0x2395a0,_0x197416,_0x122c1d,_0x2edff7,_0x223588,_0x4c4a77){const _0x10b21c=a142_0x5b9def,{journeyDefToRequest:_0x2ec786,activationDefToCreateRequest:_0x396506,yamlRuleToApi:_0x21943c,validateSegmentRule:_0x38225c}=_0x4c4a77,_0x5b0685=new Map(),_0x13bbc8=new Map();recoverSegmentIdsFromPushRecovery(_0x197416,_0x5b0685,_0x122c1d[_0x10b21c(0x21e)]);const _0x44756b=new Map(),_0x4e1579=new Map(),_0x166001=new Map();let _0x1fa7f5;const _0x1e2806=async()=>{const _0xaa1403=_0x10b21c;if(_0x1fa7f5)return;_0x1fa7f5=new Map();if(!_0x197416[_0xaa1403(0x19b)])return;const _0x3bebbc=await _0x2395a0[_0xaa1403(0x169)][_0xaa1403(0x184)](_0x197416[_0xaa1403(0x19b)]['id']);for(const _0x2c902a of _0x3bebbc){const _0x7cc1f6=journeyActivationStepToYaml(_0x2c902a,_0x122c1d[_0xaa1403(0x141)],_0x122c1d['connectionIdToNameMap']),_0x2c4b1a=activationSignature(_0x7cc1f6);!_0x1fa7f5[_0xaa1403(0x1da)](_0x2c4b1a)&&_0x1fa7f5[_0xaa1403(0x204)](_0x2c4b1a,_0x2c902a['id']),_0x7cc1f6[_0xaa1403(0x13e)]&&_0x13bbc8['set'](_0x7cc1f6[_0xaa1403(0x13e)],_0x2c902a['id']);}};await matchExistingJourneySegments(_0x2395a0,_0x197416,_0x2edff7[_0x10b21c(0x13d)],_0x122c1d[_0x10b21c(0x1ee)],_0x122c1d[_0x10b21c(0x21e)]);const _0x2cc9ae={'resolveSegmentId':async _0x417922=>{const _0x5b8a97=_0x10b21c,_0x121936=_0x122c1d['segmentNameToId'][_0x5b8a97(0x1b1)](_0x417922);if(!_0x121936)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5b8a97(0x1a0)+_0x417922+'\x20(referenced\x20in\x20journey\x20'+_0x197416[_0x5b8a97(0x219)][_0x5b8a97(0x13e)]+')');return _0x121936;},'resolveEmbeddedSegmentId':async(_0x10f796,_0x1525cc)=>{const _0x1cbd3d=_0x10b21c,_0x1b4377=_0x122c1d[_0x1cbd3d(0x21e)][_0x1cbd3d(0x1b1)](_0x10f796);if(_0x1b4377)return _0x1b4377;const _0x26cb47=_0x122c1d[_0x1cbd3d(0x1ee)][_0x1cbd3d(0x1c5)](_0x2826bf=>_0x2826bf[_0x1cbd3d(0x13e)]===_0x10f796);if(_0x26cb47)return _0x122c1d[_0x1cbd3d(0x21e)]['set'](_0x10f796,_0x26cb47['id']),_0x26cb47['id'];if(_0x197416[_0x1cbd3d(0x1af)]){const {stageName:_0x467ed5,criteriaName:_0x30fd7f}=findSegmentCriteriaLocation(_0x197416[_0x1cbd3d(0x219)],_0x10f796);return _0x38225c(_0x10f796,_0x1525cc[_0x1cbd3d(0x14c)]),_0x4e1579['set'](_0x10f796,{'definition':_0x1525cc,'stageName':_0x467ed5,'criteriaName':_0x30fd7f}),createPendingSegmentId(_0x10f796);}const _0x239608=_0x197416[_0x1cbd3d(0x19b)]?.['id'];if(!_0x239608)throw new SDKError(ErrorCode[_0x1cbd3d(0x1d2)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x5bd33e=_0x44756b[_0x1cbd3d(0x1b1)](_0x10f796);if(_0x5bd33e)return _0x5bd33e;const _0x1ba79c=((async()=>{const _0x522c5b=_0x1cbd3d;_0x38225c(_0x10f796,_0x1525cc[_0x522c5b(0x14c)]);const _0x305d47=generateDeterministicJourneySegmentName(_0x197416['yamlConfig'][_0x522c5b(0x13e)],_0x10f796),_0x4c19d6=_0x122c1d[_0x522c5b(0x1ee)][_0x522c5b(0x1c5)](_0x4a0188=>_0x4a0188[_0x522c5b(0x13e)]===_0x305d47),_0x1b35c6=createSegmentIdResolver(_0x122c1d[_0x522c5b(0x21e)],_0x10f796),_0x290bdc=await resolveRuleSegmentIds(_0x1525cc[_0x522c5b(0x14c)],_0x1b35c6);let _0x2a00d4;return _0x4c19d6?(await _0x2395a0['segment'][_0x522c5b(0x1df)](_0x2edff7[_0x522c5b(0x13d)],_0x4c19d6['id'],{'description':_0x1525cc[_0x522c5b(0x190)]||_0x522c5b(0x131)+_0x10f796,'rule':_0x21943c(_0x290bdc,!![]),'countPopulation':!![]}),_0x2a00d4=_0x4c19d6['id'],saveSegmentToPushRecovery(_0x197416[_0x522c5b(0x156)],_0x197416[_0x522c5b(0x219)][_0x522c5b(0x13e)],_0x10f796,{'segmentId':_0x2a00d4,'uniqueServerName':_0x305d47,'createdAt':new Date()[_0x522c5b(0x177)]()})):_0x2a00d4=await createOrRecoverEmbeddedSegment(_0x2395a0,_0x197416,{'localName':_0x10f796,'uniqueSegmentName':_0x305d47,'description':_0x1525cc[_0x522c5b(0x190)]||_0x522c5b(0x131)+_0x10f796,'journeyId':_0x239608,'resolvedRule':_0x290bdc,'parentId':_0x2edff7['parentId'],'folderId':_0x2edff7[_0x522c5b(0x167)]||''},_0x21943c),_0x122c1d[_0x522c5b(0x21e)]['set'](_0x10f796,_0x2a00d4),_0x5b0685[_0x522c5b(0x204)](_0x10f796,_0x2a00d4),_0x2a00d4;})());_0x44756b['set'](_0x10f796,_0x1ba79c);try{return await _0x1ba79c;}finally{_0x44756b['delete'](_0x10f796);}},'resolveActivationId':async _0x1ffe38=>{const _0xa9b4e7=_0x10b21c,_0x215c43=_0x13bbc8[_0xa9b4e7(0x1b1)](_0x1ffe38);if(_0x215c43)return _0x215c43;if(_0x197416['existingJourney']){await _0x1e2806();const _0x17cc35=_0x13bbc8[_0xa9b4e7(0x1b1)](_0x1ffe38);if(_0x17cc35)return _0x17cc35;}throw new SDKError(ErrorCode[_0xa9b4e7(0x14e)],'Activation\x20not\x20found:\x20'+_0x1ffe38+_0xa9b4e7(0x206)+_0x197416[_0xa9b4e7(0x219)][_0xa9b4e7(0x13e)]+_0xa9b4e7(0x186)+_0xa9b4e7(0x1b8));},'resolveEmbeddedActivationId':async(_0x25e30f,_0x3f2b02)=>{const _0x7d805a=_0x10b21c,_0x52940d=_0x13bbc8['get'](_0x25e30f);if(_0x52940d)return _0x52940d;if(_0x197416[_0x7d805a(0x1af)])return _0x166001[_0x7d805a(0x204)](_0x25e30f,_0x3f2b02),createPendingActivationId(_0x25e30f);if(_0x197416['existingJourney']){await _0x1e2806();const _0x45cbe3=_0x13bbc8[_0x7d805a(0x1b1)](_0x3f2b02['name']);if(_0x45cbe3)return _0x13bbc8['set'](_0x25e30f,_0x45cbe3),_0x45cbe3;const _0x23580e=activationSignature(_0x3f2b02),_0x24384c=_0x1fa7f5?.[_0x7d805a(0x1b1)](_0x23580e);if(_0x24384c)return _0x13bbc8['set'](_0x25e30f,_0x24384c),_0x24384c;const _0x54f7cc=await _0x396506(_0x3f2b02,_0x122c1d['activationContext']),_0x5cf1bf={..._0x54f7cc,..._0x3f2b02[_0x7d805a(0x1ef)]!==undefined&&{'runAfterJourneyRefresh':_0x3f2b02[_0x7d805a(0x1ef)]}},_0xc6a545=await _0x2395a0[_0x7d805a(0x169)][_0x7d805a(0x135)](_0x197416[_0x7d805a(0x19b)]['id'],_0x5cf1bf);return _0x13bbc8[_0x7d805a(0x204)](_0x25e30f,_0xc6a545['id']),_0xc6a545['id'];}throw new SDKError(ErrorCode[_0x7d805a(0x1d2)],_0x7d805a(0x127));},'resolveJourneyId':async _0xb1ecd1=>{const _0x3bf19a=_0x10b21c;try{return await _0x2395a0['journey'][_0x3bf19a(0x154)](_0x2edff7['parentId'],_0xb1ecd1);}catch(_0x1ae32c){throw new SDKError(ErrorCode[_0x3bf19a(0x14e)],'Journey\x20\x27'+_0xb1ecd1+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x197416[_0x3bf19a(0x219)][_0x3bf19a(0x13e)]+'\x27)',_0x1ae32c);}},'resolveStageId':async(_0x3a3777,_0xbbf602)=>{const _0x227cec=_0x10b21c,_0xd3b5b0=await _0x2395a0['journey']['getJourney'](_0x3a3777),_0x7fe8f8=_0xd3b5b0[_0x227cec(0x18a)]['journeyStages'][_0x227cec(0x1c5)](_0x3e5ab0=>_0x3e5ab0[_0x227cec(0x13e)][_0x227cec(0x217)]()===_0xbbf602[_0x227cec(0x217)]());if(!_0x7fe8f8?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x227cec(0x1b5)+_0xbbf602+_0x227cec(0x1ce)+(_0xd3b5b0['attributes']['journeyBundleName']||_0xd3b5b0[_0x227cec(0x18a)][_0x227cec(0x13e)])+'\x27');return _0x7fe8f8['id'];}},_0x2d60b5=await _0x2ec786(_0x197416[_0x10b21c(0x219)],_0x2edff7['parentId'],_0x2cc9ae),_0x2b7064=_0x2edff7[_0x10b21c(0x132)]||_0x2edff7['rootFolderId'];_0x2b7064&&(_0x2d60b5['relationships']={'parentFolder':{'data':{'id':_0x2b7064,'type':_0x10b21c(0x144)}}});if(_0x197416['isNew']){if(_0x4e1579['size']>0x0||_0x166001['size']>0x0)return await executeThreeStepJourneyCreate(_0x2395a0,_0x197416,_0x2d60b5,{'pendingEmbeddedSegments':_0x4e1579,'pendingEmbeddedActivations':_0x166001,'embeddedSegmentNameToId':_0x5b0685,'journeyActivationNameToId':_0x13bbc8},{..._0x2edff7,'effectiveFolderId':_0x2b7064},_0x122c1d,_0x223588,_0x4c4a77);else{ensureJourneyDefaults(_0x2d60b5[_0x10b21c(0x18a)]);const _0x2ccf71=await _0x2395a0['journey']['create'](_0x2d60b5);return deletePushRecovery(_0x197416['absolutePath']),{'action':'created','journeyId':_0x2ccf71['id'],'embeddedSegmentNameToId':_0x5b0685};}}else{if(_0x197416[_0x10b21c(0x161)]&&_0x197416[_0x10b21c(0x19b)]){_0x2d60b5['id']=_0x197416[_0x10b21c(0x19b)]['id'];const _0x4693b0=_0x2d60b5[_0x10b21c(0x18a)];_0x197416['existingJourney'][_0x10b21c(0x18a)]?.[_0x10b21c(0x1ab)]&&(_0x4693b0[_0x10b21c(0x1ab)]=_0x197416[_0x10b21c(0x19b)][_0x10b21c(0x18a)][_0x10b21c(0x1ab)]);const _0x203c97=_0x197416['existingJourney'][_0x10b21c(0x18a)]?.['journeyStages'];return _0x203c97&&_0x2d60b5[_0x10b21c(0x18a)][_0x10b21c(0x21d)]&&injectExistingStageIds(_0x2d60b5[_0x10b21c(0x18a)][_0x10b21c(0x21d)],_0x203c97),ensureJourneyDefaults(_0x4693b0),await _0x2395a0[_0x10b21c(0x169)][_0x10b21c(0x1c3)](_0x197416[_0x10b21c(0x19b)]['id'],_0x2d60b5),deletePushRecovery(_0x197416[_0x10b21c(0x156)]),{'action':_0x10b21c(0x20f),'journeyId':_0x197416['existingJourney']['id'],'embeddedSegmentNameToId':_0x5b0685};}}return deletePushRecovery(_0x197416[_0x10b21c(0x156)]),{'action':_0x10b21c(0x1b9),'journeyId':_0x197416['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x5b0685};}function findSegmentCriteriaLocation(_0x331046,_0x4b4a27){const _0x5821db=a142_0x5b9def,_0x6df35a=_0x331046[_0x5821db(0x14f)]||_0x331046[_0x5821db(0x212)]?.[0x0]?.[_0x5821db(0x14f)]||[];let _0x4596bd='entry',_0xa189e0=_0x4b4a27;const _0x2a2108=_0x331046[_0x5821db(0x1ac)]||_0x331046[_0x5821db(0x212)]?.[0x0]?.[_0x5821db(0x1ac)];if(_0x2a2108?.[_0x5821db(0x162)]===_0x4b4a27)return{'stageName':_0x5821db(0x1ac),'criteriaName':_0x2a2108[_0x5821db(0x13e)]||_0x4b4a27};_0x55cc6c:for(const _0x18bdcd of _0x6df35a){if(_0x18bdcd[_0x5821db(0x1b4)]?.[_0x5821db(0x162)]===_0x4b4a27){_0x4596bd=_0x18bdcd[_0x5821db(0x13e)],_0xa189e0=_0x18bdcd[_0x5821db(0x1b4)][_0x5821db(0x13e)]||_0x4b4a27;break;}if(_0x18bdcd[_0x5821db(0x134)])for(const _0x5e0703 of _0x18bdcd[_0x5821db(0x134)]){if(_0x5e0703['type']==='decision_point'&&_0x5e0703['with']?.['branches'])for(const _0x32276d of _0x5e0703[_0x5821db(0x176)][_0x5821db(0x1ca)]){if(_0x32276d['segment']===_0x4b4a27){_0x4596bd=_0x18bdcd[_0x5821db(0x13e)],_0xa189e0=_0x32276d[_0x5821db(0x13e)]||_0x4b4a27;break _0x55cc6c;}}}}return{'stageName':_0x4596bd,'criteriaName':_0xa189e0};}async function executeThreeStepJourneyCreate(_0x4f4cdb,_0x5c6863,_0x36999a,_0x353ed4,_0x1bc477,_0x2edfcd,_0x2f6630,_0x2b847e){const _0x380613=a142_0x5b9def,{activationDefToCreateRequest:_0x33925e,yamlRuleToApi:_0x5cf754}=_0x2b847e,{pendingEmbeddedSegments:_0x54fe25,pendingEmbeddedActivations:_0x67c8cf,embeddedSegmentNameToId:_0x52aa92}=_0x353ed4,_0x166a0e=JSON[_0x380613(0x16f)](JSON[_0x380613(0x1dd)](_0x36999a));ensureJourneyDefaults(_0x166a0e[_0x380613(0x18a)]),stripPendingIds(_0x166a0e);const _0x41aa9a=await _0x4f4cdb[_0x380613(0x169)][_0x380613(0x1d1)](_0x166a0e),_0x3c00d2=_0x41aa9a['id'],_0x1dd5f9=new Map();for(const _0x5d30c8 of _0x41aa9a[_0x380613(0x18a)][_0x380613(0x21d)]){_0x1dd5f9[_0x380613(0x204)](_0x5d30c8[_0x380613(0x13e)][_0x380613(0x217)](),_0x5d30c8['id']);}recoverSegmentIdsFromPushRecovery(_0x5c6863,_0x52aa92,_0x2edfcd[_0x380613(0x21e)]);for(const [_0x47125a,{definition:_0x4a4929}]of _0x54fe25){if(_0x52aa92[_0x380613(0x1da)](_0x47125a)){_0x2f6630[_0x380613(0x148)]?.({'type':_0x380613(0x14a),'journeyName':_0x5c6863[_0x380613(0x219)]['name'],'segmentName':_0x47125a});continue;}const _0x41d147=generateDeterministicJourneySegmentName(_0x5c6863[_0x380613(0x219)][_0x380613(0x13e)],_0x47125a);_0x2f6630['onProgress']?.({'type':_0x380613(0x189),'journeyName':_0x5c6863[_0x380613(0x219)][_0x380613(0x13e)],'segmentName':_0x47125a});const _0xc95687=createSegmentIdResolver(_0x2edfcd[_0x380613(0x21e)],_0x47125a),_0x2af6d1=await resolveRuleSegmentIds(_0x4a4929[_0x380613(0x14c)],_0xc95687),_0x5f4f4c=await createOrRecoverEmbeddedSegment(_0x4f4cdb,_0x5c6863,{'localName':_0x47125a,'uniqueSegmentName':_0x41d147,'description':_0x4a4929['description']||_0x380613(0x131)+_0x47125a,'journeyId':_0x3c00d2,'resolvedRule':_0x2af6d1,'parentId':_0x1bc477[_0x380613(0x13d)],'folderId':_0x1bc477['effectiveFolderId']||''},_0x5cf754);_0x52aa92[_0x380613(0x204)](_0x47125a,_0x5f4f4c),_0x2edfcd[_0x380613(0x21e)][_0x380613(0x204)](_0x47125a,_0x5f4f4c),_0x2f6630[_0x380613(0x148)]?.({'type':_0x380613(0x14a),'journeyName':_0x5c6863[_0x380613(0x219)][_0x380613(0x13e)],'segmentName':_0x47125a});}const _0x2b1eda=new Map();for(const [_0x36f324,_0x51ea75]of _0x67c8cf){_0x2f6630['onProgress']?.({'type':_0x380613(0x133),'journeyName':_0x5c6863['yamlConfig']['name'],'activationName':_0x36f324});const _0x18f507=await _0x33925e(_0x51ea75,_0x2edfcd[_0x380613(0x1be)]),_0x1e7539={..._0x18f507,..._0x51ea75[_0x380613(0x1ef)]!==undefined&&{'runAfterJourneyRefresh':_0x51ea75[_0x380613(0x1ef)]}},_0x4a2a1b=await _0x4f4cdb[_0x380613(0x169)][_0x380613(0x135)](_0x3c00d2,_0x1e7539);_0x2b1eda['set'](_0x36f324,_0x4a2a1b['id']),_0x353ed4[_0x380613(0x12a)][_0x380613(0x204)](_0x36f324,_0x4a2a1b['id']),_0x2f6630[_0x380613(0x148)]?.({'type':_0x380613(0x16d),'journeyName':_0x5c6863['yamlConfig'][_0x380613(0x13e)],'activationName':_0x36f324});}const _0x13079d=JSON[_0x380613(0x16f)](JSON[_0x380613(0x1dd)](_0x36999a));return _0x13079d['id']=_0x3c00d2,ensureJourneyDefaults(_0x13079d[_0x380613(0x18a)]),resolvePendingIdsInRequest(_0x13079d,_0x36999a,_0x1dd5f9,_0x52aa92,_0x2b1eda,_0x2f6630),await _0x4f4cdb[_0x380613(0x169)][_0x380613(0x1c3)](_0x3c00d2,_0x13079d),deletePushRecovery(_0x5c6863[_0x380613(0x156)]),{'action':_0x380613(0x1fa),'journeyId':_0x3c00d2,'embeddedSegmentNameToId':_0x52aa92};}export function stripWaitStepPendingIds(_0x18257c){const _0x20ecd5=a142_0x5b9def,_0x3f8914=_0x18257c[_0x20ecd5(0x158)]&&isPendingSegmentId(_0x18257c[_0x20ecd5(0x158)]),_0x540926=_0x18257c[_0x20ecd5(0x166)]?.['some'](_0x26f063=>_0x26f063[_0x20ecd5(0x191)]&&isPendingSegmentId(_0x26f063[_0x20ecd5(0x191)]));(_0x3f8914||_0x540926)&&(_0x18257c[_0x20ecd5(0x215)]=_0x20ecd5(0x223),_0x18257c[_0x20ecd5(0x198)]=0x1,_0x18257c[_0x20ecd5(0x168)]=_0x20ecd5(0x1c2),delete _0x18257c[_0x20ecd5(0x158)],delete _0x18257c[_0x20ecd5(0x15a)],delete _0x18257c['conditionTimeoutUnit'],delete _0x18257c['conditions']);}export function resolveWaitStepPendingIds(_0x111bbd,_0x56c280,_0x3019e6,_0x5df7da){const _0x17615e=a142_0x5b9def;if(_0x56c280[_0x17615e(0x158)]&&isPendingSegmentId(_0x56c280[_0x17615e(0x158)])){const _0x3a51e0=_0x3019e6(_0x56c280[_0x17615e(0x158)],'stage\x20\x27'+_0x5df7da+_0x17615e(0x1a8));_0x3a51e0&&(_0x111bbd[_0x17615e(0x215)]=_0x17615e(0x1d8),_0x111bbd[_0x17615e(0x158)]=_0x3a51e0,delete _0x111bbd[_0x17615e(0x198)],delete _0x111bbd[_0x17615e(0x168)],_0x56c280[_0x17615e(0x15a)]!==undefined&&(_0x111bbd[_0x17615e(0x15a)]=_0x56c280[_0x17615e(0x15a)]),_0x56c280[_0x17615e(0x147)]&&(_0x111bbd['conditionTimeoutUnit']=_0x56c280[_0x17615e(0x147)]));}if(_0x56c280[_0x17615e(0x166)]){const _0x18b282=_0x56c280[_0x17615e(0x166)][_0x17615e(0x1c4)](_0x23ce37=>_0x23ce37[_0x17615e(0x191)]&&isPendingSegmentId(_0x23ce37[_0x17615e(0x191)]));if(_0x18b282){const _0x5af847=_0x56c280[_0x17615e(0x166)][_0x17615e(0x17c)](_0x3c2039=>{const _0x486e39=_0x17615e;if(_0x3c2039[_0x486e39(0x191)]&&isPendingSegmentId(_0x3c2039[_0x486e39(0x191)])){const _0x1179a2=_0x3019e6(_0x3c2039['segmentId'],'stage\x20\x27'+_0x5df7da+_0x486e39(0x1a8));return{..._0x3c2039,'segmentId':_0x1179a2||_0x3c2039[_0x486e39(0x191)]};}return{..._0x3c2039};});_0x111bbd[_0x17615e(0x215)]=_0x17615e(0x1d8),_0x111bbd[_0x17615e(0x166)]=_0x5af847,delete _0x111bbd[_0x17615e(0x198)],delete _0x111bbd[_0x17615e(0x168)],delete _0x111bbd[_0x17615e(0x158)],delete _0x111bbd[_0x17615e(0x15a)],delete _0x111bbd[_0x17615e(0x147)];}}}function stripPendingIds(_0x45f013){const _0x38c017=a142_0x5b9def;_0x45f013[_0x38c017(0x18a)][_0x38c017(0x1ac)]?.[_0x38c017(0x191)]&&isPendingSegmentId(_0x45f013[_0x38c017(0x18a)][_0x38c017(0x1ac)]['segmentId'])&&delete _0x45f013[_0x38c017(0x18a)]['goal'];for(const _0x75fd7f of _0x45f013['attributes'][_0x38c017(0x21d)]||[]){_0x75fd7f[_0x38c017(0x1e0)]?.[_0x38c017(0x191)]&&isPendingSegmentId(_0x75fd7f[_0x38c017(0x1e0)][_0x38c017(0x191)])&&delete _0x75fd7f[_0x38c017(0x1e0)];_0x75fd7f['milestone']?.[_0x38c017(0x191)]&&isPendingSegmentId(_0x75fd7f[_0x38c017(0x151)][_0x38c017(0x191)])&&delete _0x75fd7f[_0x38c017(0x151)];_0x75fd7f['exitCriterias']&&(_0x75fd7f[_0x38c017(0x1f5)]=_0x75fd7f['exitCriterias'][_0x38c017(0x192)](_0x3f02a5=>!_0x3f02a5[_0x38c017(0x191)]||!isPendingSegmentId(_0x3f02a5['segmentId'])));if(_0x75fd7f[_0x38c017(0x134)])for(const _0x2ad080 of Object[_0x38c017(0x205)](_0x75fd7f[_0x38c017(0x134)])){const _0x416b52=_0x75fd7f[_0x38c017(0x134)][_0x2ad080];_0x416b52[_0x38c017(0x17b)]==='Activation'&&_0x416b52[_0x38c017(0x1b3)]&&isPendingActivationId(_0x416b52['journeyActivationStepId'])&&(_0x416b52[_0x38c017(0x1b3)]='');if(_0x416b52[_0x38c017(0x17b)]===_0x38c017(0x1a9)&&_0x416b52[_0x38c017(0x1ca)])for(const _0x51bfdd of _0x416b52['branches']){_0x51bfdd['segmentId']&&isPendingSegmentId(_0x51bfdd[_0x38c017(0x191)])&&(_0x51bfdd[_0x38c017(0x191)]='');}_0x416b52[_0x38c017(0x17b)]===_0x38c017(0x218)&&stripWaitStepPendingIds(_0x416b52);}}}function resolvePendingIdsInRequest(_0x58414b,_0x49a13a,_0x23e0e5,_0x426af9,_0x16cd4e,_0x51ad89){const _0x222cdb=a142_0x5b9def,_0x434695=(_0x1150cb,_0x4d8536)=>{const _0x311ac3=a142_0x361a;if(!isPendingSegmentId(_0x1150cb))return _0x1150cb;const _0x26ed78=extractPendingSegmentName(_0x1150cb),_0x577277=_0x426af9[_0x311ac3(0x1b1)](_0x26ed78);return!_0x577277&&_0x51ad89['logWarning']?.(_0x311ac3(0x1cf)+_0x26ed78+_0x311ac3(0x1fd)+_0x4d8536),_0x577277;};if(_0x58414b['attributes'][_0x222cdb(0x1ac)]?.['segmentId']&&isPendingSegmentId(_0x58414b[_0x222cdb(0x18a)][_0x222cdb(0x1ac)]['segmentId'])){const _0x3f88a8=_0x434695(_0x58414b[_0x222cdb(0x18a)][_0x222cdb(0x1ac)][_0x222cdb(0x191)],_0x222cdb(0x1e7));_0x3f88a8&&(_0x58414b[_0x222cdb(0x18a)][_0x222cdb(0x1ac)][_0x222cdb(0x191)]=_0x3f88a8);}for(const _0xe4817c of _0x58414b['attributes'][_0x222cdb(0x21d)]||[]){const _0x23371a=_0x23e0e5[_0x222cdb(0x1b1)](_0xe4817c['name'][_0x222cdb(0x217)]());_0x23371a&&(_0xe4817c['id']=_0x23371a);if(_0xe4817c[_0x222cdb(0x1e0)]?.[_0x222cdb(0x191)]&&isPendingSegmentId(_0xe4817c[_0x222cdb(0x1e0)]['segmentId'])){const _0x483a92=_0x434695(_0xe4817c['entryCriteria']['segmentId'],_0x222cdb(0x1a6)+_0xe4817c[_0x222cdb(0x13e)]+_0x222cdb(0x1de));_0x483a92&&(_0xe4817c[_0x222cdb(0x1e0)]['segmentId']=_0x483a92);}if(_0xe4817c[_0x222cdb(0x1f5)])for(const _0x198b35 of _0xe4817c[_0x222cdb(0x1f5)]){if(_0x198b35[_0x222cdb(0x191)]&&isPendingSegmentId(_0x198b35[_0x222cdb(0x191)])){const _0x57d80d=_0x434695(_0x198b35[_0x222cdb(0x191)],_0x222cdb(0x1a6)+_0xe4817c[_0x222cdb(0x13e)]+_0x222cdb(0x153));_0x57d80d&&(_0x198b35[_0x222cdb(0x191)]=_0x57d80d);}}if(_0xe4817c[_0x222cdb(0x151)]?.[_0x222cdb(0x191)]&&isPendingSegmentId(_0xe4817c[_0x222cdb(0x151)][_0x222cdb(0x191)])){const _0x1c810e=_0x434695(_0xe4817c[_0x222cdb(0x151)][_0x222cdb(0x191)],_0x222cdb(0x1a6)+_0xe4817c[_0x222cdb(0x13e)]+_0x222cdb(0x1cb));_0x1c810e&&(_0xe4817c[_0x222cdb(0x151)][_0x222cdb(0x191)]=_0x1c810e);}if(_0xe4817c[_0x222cdb(0x134)]){const _0x5afc04=_0x53f660=>_0x49a13a[_0x222cdb(0x18a)][_0x222cdb(0x21d)]?.[_0x222cdb(0x1c5)](_0x4b08a2=>_0x4b08a2[_0x222cdb(0x13e)][_0x222cdb(0x217)]()===_0xe4817c[_0x222cdb(0x13e)][_0x222cdb(0x217)]())?.['steps']?.[_0x53f660];for(const _0x51fe24 of Object['keys'](_0xe4817c['steps'])){const _0x405af3=_0xe4817c[_0x222cdb(0x134)][_0x51fe24],_0x67e4a2=_0x5afc04(_0x51fe24);if(_0x405af3[_0x222cdb(0x17b)]===_0x222cdb(0x1ea)&&_0x405af3[_0x222cdb(0x1b3)]&&(isPendingActivationId(_0x405af3['journeyActivationStepId'])||_0x405af3[_0x222cdb(0x1b3)]==='')){if(_0x67e4a2?.[_0x222cdb(0x1b3)]&&isPendingActivationId(_0x67e4a2[_0x222cdb(0x1b3)])){const _0x54f62c=extractPendingActivationName(_0x67e4a2[_0x222cdb(0x1b3)]),_0x18cf1a=_0x16cd4e[_0x222cdb(0x1b1)](_0x54f62c);_0x18cf1a&&(_0x405af3[_0x222cdb(0x1b3)]=_0x18cf1a);}}if(_0x405af3['type']==='DecisionPoint'&&_0x405af3[_0x222cdb(0x1ca)]&&_0x67e4a2?.['branches'])for(let _0x5f0550=0x0;_0x5f0550<_0x405af3['branches'][_0x222cdb(0x164)];_0x5f0550++){const _0x265c70=_0x405af3[_0x222cdb(0x1ca)][_0x5f0550],_0x1ef780=_0x67e4a2[_0x222cdb(0x1ca)][_0x5f0550];if(_0x1ef780?.[_0x222cdb(0x191)]&&isPendingSegmentId(_0x1ef780[_0x222cdb(0x191)])){const _0x59f397=_0x434695(_0x1ef780[_0x222cdb(0x191)],_0x222cdb(0x1a6)+_0xe4817c[_0x222cdb(0x13e)]+_0x222cdb(0x1c6)+(_0x265c70[_0x222cdb(0x13e)]||_0x5f0550)+'\x27');_0x59f397&&(_0x265c70[_0x222cdb(0x191)]=_0x59f397);}}_0x405af3[_0x222cdb(0x17b)]===_0x222cdb(0x218)&&_0x67e4a2?.[_0x222cdb(0x17b)]===_0x222cdb(0x218)&&resolveWaitStepPendingIds(_0x405af3,_0x67e4a2,_0x434695,_0xe4817c[_0x222cdb(0x13e)]);}}}}
|
|
1
|
+
const a142_0x11892d=a142_0x1405;(function(_0x5bc96a,_0x148815){const _0x4d7416=a142_0x1405,_0x24b6fe=_0x5bc96a();while(!![]){try{const _0x59ce92=parseInt(_0x4d7416(0x18b))/0x1*(parseInt(_0x4d7416(0x13b))/0x2)+parseInt(_0x4d7416(0x1b2))/0x3+parseInt(_0x4d7416(0xbd))/0x4+parseInt(_0x4d7416(0x178))/0x5+-parseInt(_0x4d7416(0xcd))/0x6+parseInt(_0x4d7416(0xf3))/0x7+-parseInt(_0x4d7416(0xec))/0x8;if(_0x59ce92===_0x148815)break;else _0x24b6fe['push'](_0x24b6fe['shift']());}catch(_0x1ed0ca){_0x24b6fe['push'](_0x24b6fe['shift']());}}}(a142_0x3e6b,0xedd5c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x11892d(0xc5));export const PENDING_SEGMENT_PREFIX=a142_0x11892d(0xdd);export const PENDING_ACTIVATION_PREFIX=a142_0x11892d(0x150);export function createPendingSegmentId(_0x2d8b4a){return''+PENDING_SEGMENT_PREFIX+_0x2d8b4a+'__';}export function isPendingSegmentId(_0x17474f){const _0x55863a=a142_0x11892d;return _0x17474f[_0x55863a(0x113)](PENDING_SEGMENT_PREFIX)&&!_0x17474f['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x137259){const _0x1a7f08=a142_0x11892d;return _0x137259[_0x1a7f08(0xf5)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x131e0b){return''+PENDING_ACTIVATION_PREFIX+_0x131e0b+'__';}export function isPendingActivationId(_0x1f4432){const _0x45322b=a142_0x11892d;return _0x1f4432[_0x45322b(0x113)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3eaa97){return _0x3eaa97['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x45dd53,_0x4a51fc){const _0x16370c=a142_0x11892d,_0x4a499e=_0x45dd53+'::'+(_0x4a51fc[_0x16370c(0xe8)]()||'segment'),_0x1c1247=createHash(_0x16370c(0x15d))['update'](_0x4a499e)['digest'](_0x16370c(0x12f))[_0x16370c(0x126)](0x0,0xc);return _0x16370c(0x1bf)+_0x1c1247;}export function ensureJourneyDefaults(_0x169fa0){const _0x5225b5=a142_0x11892d;!_0x169fa0[_0x5225b5(0xde)]&&(_0x169fa0[_0x5225b5(0xde)]=''),!_0x169fa0[_0x5225b5(0x11d)]&&(_0x169fa0[_0x5225b5(0x11d)]='draft');}export function injectExistingStageIds(_0xc72758,_0x50b1fc){const _0x3fc5c3=a142_0x11892d,_0x176626=new Map(_0x50b1fc[_0x3fc5c3(0xc7)](_0x328bbc=>[_0x328bbc['name'],_0x328bbc['id']]));for(const _0x283682 of _0xc72758){if(!_0x283682['id']){const _0x37248a=_0x176626['get'](_0x283682[_0x3fc5c3(0xc3)]);_0x37248a&&(_0x283682['id']=_0x37248a);}}}export function resolveTDFolderPath(_0x42e25b,_0x26a7e0,_0x4c101f){const _0xeff3ab=a142_0x11892d;if(!_0x26a7e0)return _0x42e25b;if(_0x42e25b===_0x4c101f||_0x42e25b[_0xeff3ab(0x113)](_0x4c101f+'/'))return _0x42e25b;return _0x42e25b?_0x4c101f+'/'+_0x42e25b:_0x4c101f;}export function addFoldersToCreate(_0x4c5060,_0x2dce4c,_0x207d7d){const _0xee8e4c=a142_0x11892d;if(!_0x4c5060)return;if(_0x2dce4c[_0xee8e4c(0x1c1)](_0x4c5060))return;const _0x2cadfc=_0x4c5060[_0xee8e4c(0x11a)]('/');let _0x12bf0c='';for(const _0x5206e4 of _0x2cadfc){_0x12bf0c=_0x12bf0c?_0x12bf0c+'/'+_0x5206e4:_0x5206e4,!_0x2dce4c[_0xee8e4c(0x1c1)](_0x12bf0c)&&_0x207d7d[_0xee8e4c(0xcc)](_0x12bf0c);}}export function sortFoldersByDepth(_0x232839){const _0x16a5a4=a142_0x11892d;return[..._0x232839][_0x16a5a4(0x123)]((_0x21c33a,_0x20181d)=>{const _0x29e36d=_0x16a5a4,_0x103ce6=(_0x21c33a['match'](/\//g)||[])[_0x29e36d(0x12a)],_0x56f44d=(_0x20181d[_0x29e36d(0x19f)](/\//g)||[])['length'];return _0x103ce6-_0x56f44d;});}import*as a142_0x157744 from'yaml';import{readFileSync}from'fs';import a142_0x22112c from'path';import{isJourneyDef,parseYamlString as a142_0x32e890,toYamlString as a142_0xe1e2b4,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x44f55f){const _0x4baf0c=a142_0x11892d;if(Array[_0x4baf0c(0x15a)](_0x44f55f))return'['+_0x44f55f[_0x4baf0c(0xc7)](_0x5ba38f=>stableStringify(_0x5ba38f))[_0x4baf0c(0xe4)](',')+']';if(_0x44f55f&&typeof _0x44f55f===_0x4baf0c(0x1a8)){const _0x40780d=_0x44f55f,_0x4b401c=Object[_0x4baf0c(0x1b6)](_0x40780d)[_0x4baf0c(0x123)](),_0x3f8631=_0x4b401c[_0x4baf0c(0xc7)](_0x540106=>'\x22'+_0x540106+'\x22:'+stableStringify(_0x40780d[_0x540106]));return'{'+_0x3f8631[_0x4baf0c(0xe4)](',')+'}';}const _0x1cfdae=JSON[_0x4baf0c(0x17c)](_0x44f55f);return _0x1cfdae===undefined?_0x4baf0c(0x191):_0x1cfdae;}function activationSignature(_0x1a739f){const _0x20d9de=a142_0x11892d,_0x46ffa0={'connection':_0x1a739f['connection'],..._0x1a739f[_0x20d9de(0x16b)]!==undefined&&{'all_columns':_0x1a739f[_0x20d9de(0x16b)]},..._0x1a739f[_0x20d9de(0x164)]!==undefined&&{'columns':_0x1a739f[_0x20d9de(0x164)]},..._0x1a739f[_0x20d9de(0x15b)]!==undefined&&{'behavior':_0x1a739f[_0x20d9de(0x15b)]},..._0x1a739f[_0x20d9de(0xda)]!==undefined&&{'schedule':_0x1a739f[_0x20d9de(0xda)]},..._0x1a739f['notification']!==undefined&&{'notification':_0x1a739f[_0x20d9de(0xbe)]},..._0x1a739f[_0x20d9de(0x139)]!==undefined&&{'connector_config':_0x1a739f[_0x20d9de(0x139)]},..._0x1a739f['activation_template_id']!==undefined&&{'activation_template_id':_0x1a739f['activation_template_id']}};return stableStringify(_0x46ffa0);}async function fetchSegment(_0x565a89,_0x132bc3,_0x4e3db7,_0x4b3375){const _0x404795=a142_0x11892d,_0x411dbe=_0x4b3375?.[_0x404795(0x1c0)](_0x3b7225=>_0x3b7225['id']===_0x4e3db7);if(_0x411dbe)return _0x411dbe;try{return await _0x565a89['segment']['getSegment'](_0x132bc3,_0x4e3db7);}catch(_0x167139){logger[_0x404795(0xe1)](_0x404795(0xd3)+_0x4e3db7+_0x404795(0x172)+_0x167139);try{return await _0x565a89[_0x404795(0x194)][_0x404795(0x159)](_0x4e3db7);}catch(_0x53bd2b){return logger[_0x404795(0xe1)](_0x404795(0x13c)+_0x4e3db7+':\x20'+_0x53bd2b),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3455c6,_0xf59902,_0x3d844a){const _0x33b2c3=a142_0x11892d,_0x3d48e8=readPushRecovery(_0x3455c6['absolutePath']);if(_0x3d48e8?.['journeyName']===_0x3455c6['yamlConfig'][_0x33b2c3(0xc3)])for(const [_0x40a923,_0x409506]of Object[_0x33b2c3(0x141)](_0x3d48e8['segments'])){const _0x4c8d9c=generateDeterministicJourneySegmentName(_0x3455c6[_0x33b2c3(0xd1)][_0x33b2c3(0xc3)],_0x40a923);_0x409506[_0x33b2c3(0x190)]===_0x4c8d9c&&(_0xf59902[_0x33b2c3(0x13e)](_0x40a923,_0x409506[_0x33b2c3(0xd6)]),_0x3d844a['set'](_0x40a923,_0x409506[_0x33b2c3(0xd6)]));}}async function createOrRecoverEmbeddedSegment(_0x1f512d,_0x539937,_0x5d0f2a,_0x155308){const _0x1d7077=a142_0x11892d;let _0x568c0b;try{_0x568c0b=await _0x1f512d[_0x1d7077(0x194)][_0x1d7077(0x19d)]({'name':_0x5d0f2a[_0x1d7077(0xc6)],'description':_0x5d0f2a['description'],'journeyId':_0x5d0f2a['journeyId'],'rule':_0x155308(_0x5d0f2a[_0x1d7077(0xba)],!![]),'countPopulation':!![],'parentFolderId':_0x5d0f2a[_0x1d7077(0xe7)],'audienceId':_0x5d0f2a[_0x1d7077(0x14d)]});}catch(_0x54bbd9){const _0x56535a=_0x54bbd9 instanceof Error&&_0x54bbd9[_0x1d7077(0x147)][_0x1d7077(0x12b)](_0x1d7077(0xd9));if(_0x56535a){const _0x5d5f9f=readPushRecovery(_0x539937['absolutePath']),_0xf2ee13=_0x5d5f9f?.['journeyName']===_0x539937[_0x1d7077(0xd1)][_0x1d7077(0xc3)]?_0x5d5f9f[_0x1d7077(0x185)][_0x5d0f2a[_0x1d7077(0x106)]]:undefined;if(_0xf2ee13?.[_0x1d7077(0x190)]===_0x5d0f2a['uniqueSegmentName'])await _0x1f512d['segment'][_0x1d7077(0x14a)](_0x5d0f2a[_0x1d7077(0x14d)],_0xf2ee13[_0x1d7077(0xd6)],{'description':_0x5d0f2a[_0x1d7077(0xde)],'rule':_0x155308(_0x5d0f2a['resolvedRule'],!![]),'countPopulation':!![]}),_0x568c0b=_0xf2ee13[_0x1d7077(0xd6)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x1d7077(0xe0)+_0x5d0f2a[_0x1d7077(0x106)]+_0x1d7077(0x118)+(_0x1d7077(0xdc)+_0x539937[_0x1d7077(0x111)][_0x1d7077(0xf5)](/([^/]+)$/,_0x1d7077(0x19a))+')\x20')+_0x1d7077(0x199),_0x54bbd9);}else throw _0x54bbd9;}return saveSegmentToPushRecovery(_0x539937[_0x1d7077(0x111)],_0x539937[_0x1d7077(0xd1)]['name'],_0x5d0f2a[_0x1d7077(0x106)],{'segmentId':_0x568c0b,'uniqueServerName':_0x5d0f2a['uniqueSegmentName'],'createdAt':new Date()[_0x1d7077(0xc9)]()}),_0x568c0b;}export async function prepareSegmentFiles(_0x562a17,_0x18ff52,_0x5b7c15,_0x469e17,_0x26dce1){const _0x3b5cf4=a142_0x11892d,{activationDefToCreateRequest:_0x385ad2}=await import(_0x3b5cf4(0x136)),_0xcb5e3f=[],_0x20fcc5=new Set();for(const {yamlConfig:_0x4cbc07,folderPath:_0x4ff7a0,sourcePath:_0x312d39}of _0x562a17){const _0x11bc9b=resolveTDFolderPath(_0x4ff7a0,_0x469e17,_0x26dce1),_0x88e8a9=_0x11bc9b+':'+_0x4cbc07[_0x3b5cf4(0xc3)],_0x472dc4=_0x18ff52[_0x3b5cf4(0x137)]['get'](_0x88e8a9),_0x469e2f=_0x472dc4?_0x18ff52['activationsBySegmentId'][_0x3b5cf4(0x1aa)](_0x472dc4['id'])||[]:[];addFoldersToCreate(_0x11bc9b,_0x18ff52['folderPathToId'],_0x20fcc5);const _0x45a06d=calculateActivationActions(_0x4cbc07[_0x3b5cf4(0x169)]||[],_0x469e2f,_0x18ff52[_0x3b5cf4(0x13a)],_0x18ff52['connectionIdToNameMap']);for(const _0x1e9d25 of _0x45a06d){(_0x1e9d25[_0x3b5cf4(0x11c)]===_0x3b5cf4(0xf1)||_0x1e9d25[_0x3b5cf4(0x11c)]===_0x3b5cf4(0x14e))&&_0x1e9d25[_0x3b5cf4(0x154)]&&(_0x1e9d25[_0x3b5cf4(0xc8)]=await _0x385ad2(_0x1e9d25[_0x3b5cf4(0x154)],_0x5b7c15));}const _0x3f970e=calculateSegmentDiff(_0x4cbc07,_0x472dc4,_0x469e2f,_0x18ff52[_0x3b5cf4(0x13a)],_0x18ff52[_0x3b5cf4(0x198)]);_0xcb5e3f[_0x3b5cf4(0x135)]({'relativePath':_0x4cbc07[_0x3b5cf4(0xc3)],'absolutePath':_0x312d39,'yamlConfig':_0x4cbc07,'folderPath':_0x11bc9b,'existingSegment':_0x472dc4,'existingActivations':_0x469e2f,'isNew':_0x3f970e[_0x3b5cf4(0x17e)],'hasChanges':_0x3f970e['hasChanges'],'diff':_0x3f970e['diff'],'activationActions':_0x45a06d});}return{'segmentFiles':_0xcb5e3f,'foldersToCreate':_0x20fcc5};}export async function prepareJourneyFiles(_0x2ccef0,_0x421e71,_0x5d747f,_0x336e57){const _0x46c1d3=a142_0x11892d,_0x50132d=[],_0x17c9a1=new Set();for(const {yamlConfig:_0x5e319a,folderPath:_0x2e5bf8,sourcePath:_0x551e5c}of _0x2ccef0){const _0x37e921=resolveTDFolderPath(_0x2e5bf8,_0x5d747f,_0x336e57),_0x2e1529=_0x37e921+':'+_0x5e319a[_0x46c1d3(0xc3)],_0x3ef83f=_0x421e71[_0x46c1d3(0xff)][_0x46c1d3(0x1aa)](_0x2e1529);let _0x183b15,_0x925f0c;if(_0x3ef83f&&_0x3ef83f['length']>0x0){const _0x163209=buildLocalExpandedRuleMappings(_0x5e319a),{createYamlContext:_0x490483,prefetchJourneySegments:_0x226ffe}=createPushYamlContextForBundle(_0x421e71[_0x46c1d3(0x18a)],_0x421e71[_0x46c1d3(0x14d)],_0x421e71[_0x46c1d3(0x179)],_0x163209,_0x421e71[_0x46c1d3(0x13a)],_0x421e71[_0x46c1d3(0x198)],_0x421e71[_0x46c1d3(0x19c)],_0x421e71[_0x46c1d3(0x176)]);await _0x226ffe(_0x3ef83f['map'](_0x51f261=>_0x51f261['id']));const _0x4f486f=await _0x421e71[_0x46c1d3(0x18a)][_0x46c1d3(0x1ab)]['getLatestJourneyId'](_0x3ef83f[0x0][_0x46c1d3(0x187)]),_0xb2e761=hasMultipleVersions(_0x5e319a),_0x2ea040=async _0x3261f8=>{const _0xcea277=_0x46c1d3,_0x3084d6=_0x421e71[_0xcea277(0x176)]?.[_0xcea277(0x1aa)](_0x3261f8);if(_0x3084d6)return _0x3084d6;return _0x421e71[_0xcea277(0x144)]({'journeyId':_0x3261f8,'journeyName':_0x5e319a[_0xcea277(0xc3)],'isMultiVersion':_0x3ef83f[_0xcea277(0x12a)]>0x1});};if(_0xb2e761&&_0x3ef83f[_0x46c1d3(0x12a)]>0x1){const _0x8135f4=[];for(const _0x46b550 of _0x3ef83f){const _0x2892bb=_0x46b550[_0x46c1d3(0x1ac)]||0x1;_0x421e71[_0x46c1d3(0xe9)]?.[_0x46c1d3(0x14e)](_0x46c1d3(0xd0)+_0x5e319a[_0x46c1d3(0xc3)]+'\x20v'+_0x2892bb);const _0x5529e9=await _0x2ea040(_0x46b550['id']),_0x455100=_0x490483(_0x46b550['id']),_0x5614ba=await journeyResponseToDef(_0x5529e9,_0x455100);_0x8135f4[_0x46c1d3(0x135)]({'item':_0x46b550,'yaml':_0x5614ba});}const _0x46a2c1=buildLocalRuleToNameMappingFromJourney(_0x5e319a);_0x925f0c=buildMergedJourneyDef(_0x8135f4,_0x46a2c1,_0x4f486f);const _0x2d38ec=Math[_0x46c1d3(0x1b1)](..._0x8135f4['map'](_0x46db72=>_0x46db72[_0x46c1d3(0x170)][_0x46c1d3(0x1ac)]||0x0)),_0x50c58d=_0x3ef83f[_0x46c1d3(0x1c0)](_0x1876b1=>(_0x1876b1[_0x46c1d3(0x1ac)]||0x0)===_0x2d38ec);_0x50c58d&&(_0x421e71[_0x46c1d3(0xe9)]?.[_0x46c1d3(0x14e)]('Fetching\x20'+_0x5e319a[_0x46c1d3(0xc3)]+'\x20v'+_0x2d38ec),_0x183b15=await _0x2ea040(_0x50c58d['id']));}else{const _0x56f195=_0x3ef83f[_0x3ef83f['length']-0x1];_0x421e71['progress']?.['update'](_0x46c1d3(0xd0)+_0x5e319a[_0x46c1d3(0xc3)]),_0x183b15=await _0x2ea040(_0x56f195['id']);const _0x1ebf28=_0x490483(_0x56f195['id']),_0xf2ae5e=await journeyResponseToDef(_0x183b15,_0x1ebf28),_0x3c46ce=buildLocalRuleToNameMappingFromJourney(_0x5e319a);_0x925f0c=buildMergedJourneyDef([{'item':_0x56f195,'yaml':_0xf2ae5e}],_0x3c46ce,_0x4f486f);}}addFoldersToCreate(_0x37e921,_0x421e71[_0x46c1d3(0x1a0)],_0x17c9a1);const _0x139af2=calculateJourneyDiff(_0x5e319a,_0x925f0c);_0x50132d[_0x46c1d3(0x135)]({'relativePath':_0x5e319a['name'],'absolutePath':_0x551e5c,'yamlConfig':_0x5e319a,'folderPath':_0x37e921,'existingJourney':_0x183b15,'isNew':_0x139af2[_0x46c1d3(0x17e)],'hasChanges':_0x139af2[_0x46c1d3(0x184)],'diff':_0x139af2[_0x46c1d3(0x104)]});}return{'journeyFiles':_0x50132d,'foldersToCreate':_0x17c9a1};}export function calculateActivationActions(_0x2033e0,_0x43179f,_0x17a317,_0x261349){const _0x1ee151=a142_0x11892d,_0x47a306=[],_0x15cb85=new Map();for(const _0x3df640 of _0x43179f){_0x15cb85[_0x1ee151(0x13e)](_0x3df640[_0x1ee151(0xc3)],_0x3df640);}const _0xc53f3d=new Map();for(const _0xb232f of _0x2033e0){_0xc53f3d['set'](_0xb232f['name'],_0xb232f);}for(const _0x19bd20 of _0x2033e0){const _0x10ca05=_0x15cb85[_0x1ee151(0x1aa)](_0x19bd20[_0x1ee151(0xc3)]);if(!_0x10ca05)_0x47a306[_0x1ee151(0x135)]({'type':_0x1ee151(0xf1),'name':_0x19bd20[_0x1ee151(0xc3)],'yamlActivation':_0x19bd20});else{const _0x1b58e8=activationResponseToDef(_0x10ca05,_0x17a317,_0x261349),_0x485469=a142_0x157744[_0x1ee151(0x17c)](_0x1b58e8),_0x2fcdac=a142_0x157744[_0x1ee151(0x17c)](_0x19bd20);_0x485469!==_0x2fcdac&&_0x47a306['push']({'type':'update','name':_0x19bd20[_0x1ee151(0xc3)],'yamlActivation':_0x19bd20,'existingActivation':_0x10ca05});}}for(const _0x29b665 of _0x43179f){!_0xc53f3d[_0x1ee151(0x1c1)](_0x29b665['name'])&&_0x47a306[_0x1ee151(0x135)]({'type':_0x1ee151(0x10c),'name':_0x29b665[_0x1ee151(0xc3)],'existingActivation':_0x29b665});}return _0x47a306;}function calculateYamlDiff(_0x252388,_0x2c2ca7){if(_0x2c2ca7){const _0x26ecd7=generateDiff(_0x2c2ca7,_0x252388),_0x47f634=hasChanges(_0x26ecd7);return{'isNew':![],'hasChanges':_0x47f634,'diff':_0x47f634?formatDiffWithColors(_0x26ecd7):undefined};}const _0x5647f3=generateDiff('',_0x252388);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5647f3)};}export function calculateSegmentDiff(_0x3bf65e,_0x1e0b4f,_0x1674e9,_0x4b9412,_0x18defc){const _0x583997=segmentToYamlString(_0x3bf65e),_0x3813ad=_0x1e0b4f?segmentToYamlString(segmentWithActivationsToYaml(_0x1e0b4f,_0x1674e9,undefined,_0x4b9412,_0x18defc)):undefined;return calculateYamlDiff(_0x583997,_0x3813ad);}export function calculateJourneyDiff(_0x434f0a,_0x4d94fd){const _0x51b34b=normalizeJourneyDef(_0x434f0a,_0x434f0a),_0x2441c2=a142_0xe1e2b4(_0x51b34b),_0x5cd857=_0x4d94fd?a142_0xe1e2b4(normalizeJourneyDef(_0x4d94fd,_0x434f0a)):undefined;return calculateYamlDiff(_0x2441c2,_0x5cd857);}export function findSegmentsToDelete(_0x4642ac,_0x42eedc,_0x5999a4,_0x1fe6b7,_0x3da363){const _0x5f2fe0=a142_0x11892d,_0x3880fa=new Set();for(const {yamlConfig:_0x364c57,folderPath:_0x3b44e7}of _0x42eedc){_0x3880fa[_0x5f2fe0(0xcc)](_0x3b44e7+':'+_0x364c57['name']);}return _0x4642ac[_0x5f2fe0(0x15c)](_0x3f89b8=>{const _0x3cdce1=_0x5f2fe0,_0x4151fe=_0x3f89b8[_0x3cdce1(0x143)]?_0x5999a4[_0x3cdce1(0x1aa)](_0x3f89b8[_0x3cdce1(0x143)][_0x3cdce1(0x183)]())||'':'',_0x2a20d2=_0x4151fe+':'+_0x3f89b8[_0x3cdce1(0xc3)];if(_0x3880fa[_0x3cdce1(0x1c1)](_0x2a20d2))return![];if(_0x3da363)return _0x4151fe===_0x1fe6b7||_0x4151fe[_0x3cdce1(0x113)](_0x1fe6b7+'/');return!![];});}export function findJourneysToDelete(_0xd1bfaa,_0x229181,_0x43c545,_0x1ee612,_0x24afb6){const _0x10af46=a142_0x11892d,_0x22a706=new Set();for(const {yamlConfig:_0x1ca23d,folderPath:_0x49f6ad}of _0x229181){_0x22a706[_0x10af46(0xcc)](_0x49f6ad+':'+_0x1ca23d[_0x10af46(0xc3)]);}return _0xd1bfaa[_0x10af46(0x15c)](_0x12af51=>{const _0x245e72=_0x10af46,_0x5b6f1a=_0x12af51['folderId']?_0x43c545[_0x245e72(0x1aa)](_0x12af51[_0x245e72(0xe7)])||'':'',_0x3f1a3d=_0x5b6f1a+':'+_0x12af51['journeyBundleName'];if(_0x22a706['has'](_0x3f1a3d))return![];if(_0x24afb6)return _0x5b6f1a===_0x1ee612||_0x5b6f1a['startsWith'](_0x1ee612+'/');return!![];});}export function buildSegmentLookupMap(_0x319544,_0x1ad35a){const _0x1d61ea=a142_0x11892d,_0x2815b8=new Map();for(const _0x41a603 of _0x319544){const _0x19e4d9=_0x41a603[_0x1d61ea(0x143)]?_0x1ad35a['get'](_0x41a603[_0x1d61ea(0x143)]['toString']())||'':'',_0x528916=_0x19e4d9+':'+_0x41a603[_0x1d61ea(0xc3)];_0x2815b8[_0x1d61ea(0x13e)](_0x528916,_0x41a603);}return _0x2815b8;}export function buildSegmentNameToIdMap(_0x180908){const _0x84a734=a142_0x11892d,_0x4aa3a2=new Map();for(const _0x2fb9f0 of _0x180908){_0x4aa3a2[_0x84a734(0x13e)](_0x2fb9f0[_0x84a734(0xc3)],_0x2fb9f0['id']);}return _0x4aa3a2;}export function buildJourneyBundleLookupMap(_0x342214,_0x3311b0){const _0x12d475=a142_0x11892d,_0x38d8d2=new Map();for(const _0x26fce9 of _0x342214){const _0x215971=_0x26fce9['folderId']?_0x3311b0['get'](_0x26fce9[_0x12d475(0xe7)])||'':'',_0x5f1dc6=_0x215971+':'+_0x26fce9[_0x12d475(0x131)];!_0x38d8d2[_0x12d475(0x1c1)](_0x5f1dc6)&&_0x38d8d2[_0x12d475(0x13e)](_0x5f1dc6,[]),_0x38d8d2[_0x12d475(0x1aa)](_0x5f1dc6)[_0x12d475(0x135)](_0x26fce9);}for(const _0x4e1a8a of _0x38d8d2['values']()){_0x4e1a8a[_0x12d475(0x123)]((_0x5a8c4b,_0x13ac5e)=>(_0x5a8c4b[_0x12d475(0x1ac)]||0x0)-(_0x13ac5e[_0x12d475(0x1ac)]||0x0));}return _0x38d8d2;}export function collectFoldersToCreate(_0x403839,_0x26ccdd){const _0x4b5d6d=a142_0x11892d,_0xaa3af0=new Set();for(const _0x341293 of _0x403839){if(!_0x341293)continue;if(_0x26ccdd[_0x4b5d6d(0x1c1)](_0x341293))continue;const _0x23b869=_0x341293[_0x4b5d6d(0x11a)]('/');let _0x1b7007='';for(const _0x307ed4 of _0x23b869){_0x1b7007=_0x1b7007?_0x1b7007+'/'+_0x307ed4:_0x307ed4,!_0x26ccdd[_0x4b5d6d(0x1c1)](_0x1b7007)&&_0xaa3af0[_0x4b5d6d(0xcc)](_0x1b7007);}}return _0xaa3af0;}export function parseAndClassifyYamlFiles(_0x31326b,_0x1293ae,_0x2a145d){const _0x128971=a142_0x11892d,_0xe52643=[],_0x31c776=[];for(const _0x33eea7 of _0x31326b){const _0x41f786=a142_0x22112c[_0x128971(0x134)](_0x1293ae,a142_0x22112c[_0x128971(0x197)](_0x33eea7)),_0x3ca9a9=_0x41f786==='.'?'':_0x41f786,_0x233e71=readFileSync(_0x33eea7,_0x128971(0x189)),_0x2fe4f5=a142_0x157744['parse'](_0x233e71);if(isJourneyDef(_0x2fe4f5)){const _0x3eadb2=a142_0x32e890(_0x233e71);_0x31c776['push']({'yamlConfig':_0x3eadb2,'folderPath':_0x3ca9a9,'sourcePath':_0x33eea7});}else{if(!_0x2a145d?.[_0x128971(0xb9)]){const _0xcd338=parseSegmentYamlFile(_0x233e71),_0x4f7a40=normalizeChildSegmentYaml(_0xcd338);_0xe52643[_0x128971(0x135)]({'yamlConfig':_0x4f7a40,'folderPath':_0x3ca9a9,'sourcePath':_0x33eea7});}}}return{'segments':_0xe52643,'journeys':_0x31c776};}export function validateParsedFiles(_0x14c188,_0x294b32){const _0x31f10b=a142_0x11892d,_0x330081=[];for(const {yamlConfig:_0x2cfb6e,sourcePath:_0x44f3e6}of _0x14c188['segments']){const _0x3498b3=readFileSync(_0x44f3e6,_0x31f10b(0x189)),_0x1d72aa=a142_0x157744['parseDocument'](_0x3498b3),_0x1763bb=validateSegmentDef(_0x2cfb6e,{'source':_0x3498b3,'document':_0x1d72aa},{'skipSchema':!![]});if(!_0x1763bb['valid']){const _0x32c962=a142_0x22112c['relative'](_0x294b32,_0x44f3e6);_0x330081[_0x31f10b(0x135)]({'filePath':_0x32c962,'source':_0x3498b3,'result':_0x1763bb,'isJourney':![]});}}for(const {yamlConfig:_0x54d26b,sourcePath:_0x4d6b85}of _0x14c188[_0x31f10b(0x1b9)]){const _0x2a4ecb=readFileSync(_0x4d6b85,_0x31f10b(0x189)),_0x52c09c=a142_0x157744[_0x31f10b(0x112)](_0x2a4ecb),_0x36348c=validateJourneyDef(_0x54d26b,{'source':_0x2a4ecb,'document':_0x52c09c},{'skipSchema':!![]});if(!_0x36348c[_0x31f10b(0xf0)]){const _0x32d5e8=a142_0x22112c[_0x31f10b(0x134)](_0x294b32,_0x4d6b85);_0x330081[_0x31f10b(0x135)]({'filePath':_0x32d5e8,'source':_0x2a4ecb,'result':_0x36348c,'isJourney':!![]});}}return _0x330081;}export function formatValidationErrors(_0x2c0d81){const _0x469804=a142_0x11892d,_0x1d8b2e=[];for(const {filePath:_0x1e8d94,source:_0x2f0b02,result:_0x404b5b,isJourney:_0xfa6bee}of _0x2c0d81){const _0x54a610=_0xfa6bee?'journey':_0x469804(0x194);_0x1d8b2e['push']('\x0a'+_0x1e8d94+'\x20('+_0x54a610+_0x469804(0x160)+_0x404b5b[_0x469804(0x1b0)]['length']+_0x469804(0x17a)),_0x1d8b2e[_0x469804(0x135)](formatValidationResult(_0x404b5b,_0x2f0b02,_0x1e8d94));}return _0x1d8b2e[_0x469804(0xe4)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x35cbab){const _0x4ad9d6=a142_0x11892d,_0x55d915=new Set(),_0x49e19c=new Map(),_0xcf4e68=collectSegmentUsageCounts(_0x35cbab);if(_0x35cbab[_0x4ad9d6(0x185)])for(const [_0x27fed4,_0x5d0b3e]of Object[_0x4ad9d6(0x141)](_0x35cbab[_0x4ad9d6(0x185)])){_0x55d915[_0x4ad9d6(0xcc)](_0x27fed4);if(_0x5d0b3e[_0x4ad9d6(0x10b)]){const _0x172283=yamlRuleToApi(_0x5d0b3e[_0x4ad9d6(0x10b)]),_0x533c78=apiRuleToYaml(_0x172283);_0x49e19c['set'](_0x27fed4,_0x533c78);}}const _0x1b52d1=new Map();let _0x4f4c1e=0x0;for(const [_0x577b1e,_0x4b622c]of _0x49e19c){const _0x132b87=serializeExpandedRule(_0x4b622c,_0x49e19c),_0x4e311c=_0x1b52d1[_0x4ad9d6(0x1aa)](_0x132b87)||[];_0x4e311c['push']({'name':_0x577b1e,'index':_0x4f4c1e}),_0x1b52d1[_0x4ad9d6(0x13e)](_0x132b87,_0x4e311c),_0x4f4c1e++;}const _0x2bf442=new Map();for(const [_0x5d958a,_0x2f0b03]of _0x1b52d1){const _0x3784e4=_0x2f0b03[_0x4ad9d6(0x126)]()[_0x4ad9d6(0x123)]((_0x65aa66,_0x33c533)=>{const _0x3ed989=_0x4ad9d6,_0x3a3431=_0xcf4e68[_0x3ed989(0x1aa)](_0x65aa66['name'])||0x0,_0x232903=_0xcf4e68[_0x3ed989(0x1aa)](_0x33c533['name'])||0x0;if(_0x3a3431!==_0x232903)return _0x232903-_0x3a3431;return _0x65aa66[_0x3ed989(0x1a4)]-_0x33c533[_0x3ed989(0x1a4)];})[_0x4ad9d6(0xc7)](_0x180f12=>_0x180f12[_0x4ad9d6(0xc3)]),_0x7131b8=[];for(const _0x313282 of _0x3784e4){const _0x25e4f0=_0xcf4e68[_0x4ad9d6(0x1aa)](_0x313282)||0x0,_0x208f60=Math[_0x4ad9d6(0x1b1)](_0x25e4f0,0x1);for(let _0x5aa072=0x0;_0x5aa072<_0x208f60;_0x5aa072++){_0x7131b8[_0x4ad9d6(0x135)](_0x313282);}}_0x2bf442[_0x4ad9d6(0x13e)](_0x5d958a,_0x7131b8);}return{'existingLocalSegmentNames':_0x55d915,'localSegmentRules':_0x49e19c,'localExpandedRuleToNames':_0x2bf442};}export function createSegmentIdResolver(_0x38ca67,_0x5f705e){return async _0x3efafa=>{const _0x4e9971=a142_0x1405,_0x5d0a61=_0x38ca67['get'](_0x3efafa);if(!_0x5d0a61)throw new SDKError(ErrorCode[_0x4e9971(0x156)],'Segment\x20not\x20found:\x20'+_0x3efafa+_0x4e9971(0x10e)+_0x5f705e+'\x27)');return _0x5d0a61;};}export function extractRootFolderId(_0x1b8aa5){const _0x1e43e3=a142_0x11892d;return _0x1b8aa5[_0x1e43e3(0xef)]?.[_0x1e43e3(0x127)]?.[_0x1e43e3(0x180)]?.['id']||_0x1b8aa5[_0x1e43e3(0xef)]?.['parentFolder']?.[_0x1e43e3(0x180)]?.['id'];}export function buildConnectionMaps(_0x4d83d8){const _0x38aaca=a142_0x11892d,_0x2c029c=new Map(),_0x1e13a0=new Map(),_0x4c8b4e=new Map();for(const _0x1dc061 of _0x4d83d8){_0x2c029c[_0x38aaca(0x13e)](_0x1dc061[_0x38aaca(0xc3)],parseInt(_0x1dc061['id'],0xa)),_0x1e13a0[_0x38aaca(0x13e)](_0x1dc061['id'],_0x1dc061[_0x38aaca(0xc3)]),_0x4c8b4e[_0x38aaca(0x13e)](_0x1dc061[_0x38aaca(0xc3)],_0x1dc061['type']);}return{'nameToId':_0x2c029c,'idToName':_0x1e13a0,'nameToType':_0x4c8b4e};}export function calculatePushStats(_0x39f839,_0x475bcb,_0x43526e,_0x4c3ae1,_0x7f7560,_0x2468cd,_0x157f1a){const _0x2d3f2d=a142_0x11892d,_0x35fda1=_0x39f839[_0x2d3f2d(0x15c)](_0x5259f7=>_0x5259f7[_0x2d3f2d(0x17e)]),_0x479a5b=_0x39f839[_0x2d3f2d(0x15c)](_0xe79346=>!_0xe79346[_0x2d3f2d(0x17e)]&&_0xe79346[_0x2d3f2d(0x184)]),_0x224da4=_0x39f839['filter'](_0x3b3e15=>!_0x3b3e15[_0x2d3f2d(0x17e)]&&!_0x3b3e15[_0x2d3f2d(0x184)]),_0x50377f=_0x2468cd?_0x4c3ae1:[],_0x3b0136=_0x475bcb[_0x2d3f2d(0x15c)](_0x2c9c36=>_0x2c9c36[_0x2d3f2d(0x17e)]),_0x1b504b=_0x475bcb[_0x2d3f2d(0x15c)](_0x2129ee=>!_0x2129ee[_0x2d3f2d(0x17e)]&&_0x2129ee[_0x2d3f2d(0x184)]),_0x1cae53=_0x475bcb[_0x2d3f2d(0x15c)](_0x278441=>!_0x278441[_0x2d3f2d(0x17e)]&&!_0x278441[_0x2d3f2d(0x184)]),_0x27b97a=_0x2468cd?_0x7f7560:[],_0xf47ba7=_0x39f839[_0x2d3f2d(0xf7)](_0x3fb4f5=>_0x3fb4f5[_0x2d3f2d(0x117)]),_0x55d9b8=_0xf47ba7[_0x2d3f2d(0x15c)](_0x1a51e5=>_0x1a51e5['type']==='create'),_0x1b122e=_0xf47ba7[_0x2d3f2d(0x15c)](_0x3ac413=>_0x3ac413['type']==='update'),_0x4d7e17=_0xf47ba7[_0x2d3f2d(0x15c)](_0x4abd71=>_0x4abd71['type']==='delete'),_0x136bed=Array[_0x2d3f2d(0xbb)](_0x43526e)['sort'](),_0x51a68e=_0x157f1a?![]:_0x35fda1[_0x2d3f2d(0x12a)]>0x0||_0x479a5b[_0x2d3f2d(0x12a)]>0x0||_0x50377f[_0x2d3f2d(0x12a)]>0x0,_0x32db4f=_0x3b0136['length']>0x0||_0x1b504b[_0x2d3f2d(0x12a)]>0x0||_0x27b97a[_0x2d3f2d(0x12a)]>0x0,_0x11135e=_0x157f1a?![]:_0xf47ba7[_0x2d3f2d(0x12a)]>0x0,_0x6fc7d7=_0x136bed[_0x2d3f2d(0x12a)]>0x0;return{'segments':{'new':_0x35fda1,'changed':_0x479a5b,'unchanged':_0x224da4,'toDelete':_0x50377f},'journeys':{'new':_0x3b0136,'changed':_0x1b504b,'unchanged':_0x1cae53,'toDelete':_0x27b97a},'activations':{'all':_0xf47ba7,'toCreate':_0x55d9b8,'toUpdate':_0x1b122e,'toDelete':_0x4d7e17},'folders':{'toCreate':_0x136bed},'counts':{'segments':{'new':_0x35fda1[_0x2d3f2d(0x12a)],'changed':_0x479a5b[_0x2d3f2d(0x12a)],'unchanged':_0x224da4['length'],'toDelete':_0x50377f[_0x2d3f2d(0x12a)]},'journeys':{'new':_0x3b0136[_0x2d3f2d(0x12a)],'changed':_0x1b504b[_0x2d3f2d(0x12a)],'unchanged':_0x1cae53[_0x2d3f2d(0x12a)],'toDelete':_0x27b97a[_0x2d3f2d(0x12a)]},'activations':{'create':_0x55d9b8[_0x2d3f2d(0x12a)],'update':_0x1b122e[_0x2d3f2d(0x12a)],'delete':_0x4d7e17['length']},'folders':_0x136bed[_0x2d3f2d(0x12a)]},'hasChanges':_0x51a68e||_0x32db4f||_0x11135e||_0x6fc7d7};}export async function buildPushExecutionContext(_0x359fd4,_0x23e7ac,_0x3fd8b5,_0x4977db,_0x297732,_0x837f78){const _0x32c7ac=a142_0x11892d,_0x38b638=extractRootFolderId(_0x3fd8b5),{pathToId:_0x2cb80d,idToPath:_0x57b2a3}=buildFolderMaps(_0x297732),_0x4e73ac=buildSegmentNameToIdMap(_0x4977db),_0x19d72c=new Map(),{batchAsync:_0xea73ca}=await import(_0x32c7ac(0x182)),[_0x3649e5,_0x24fe76]=await Promise[_0x32c7ac(0xd7)]([_0x359fd4[_0x32c7ac(0xc1)][_0x32c7ac(0x145)](),_0x359fd4['connection']['list'](),((async()=>{!_0x837f78&&_0x4977db['length']>0x0&&await _0xea73ca(_0x4977db,async _0x28a5cb=>{const _0x59b016=a142_0x1405,_0x35f420=await _0x359fd4[_0x59b016(0x194)]['listActivations'](_0x23e7ac,_0x28a5cb['id']);_0x19d72c[_0x59b016(0x13e)](_0x28a5cb['id'],_0x35f420);});})())]),{emailToId:_0x187fdf,idToEmail:_0x33fccb}=_0x3649e5,_0x290230=buildConnectionMaps(_0x24fe76);return{'rootFolderId':_0x38b638,'folderPathToId':_0x2cb80d,'folderIdToPath':_0x57b2a3,'segmentNameToId':_0x4e73ac,'activationsBySegmentId':_0x19d72c,'emailToIdMap':_0x187fdf,'idToEmailMap':_0x33fccb,'connectionNameToIdMap':_0x290230[_0x32c7ac(0xd2)],'connectionIdToNameMap':_0x290230['idToName'],'connectionNameToTypeMap':_0x290230[_0x32c7ac(0x158)]};}export function createPushYamlContextForBundle(_0x5b98a5,_0x1b78ef,_0x147174,_0x379f04,_0x3b18c7,_0x25930b,_0x46a230,_0x33f005){const {existingLocalSegmentNames:_0x34cef9,localExpandedRuleToNames:_0x579a95}=_0x379f04,_0x12e0be=new Set(),_0x1bbb9d=new Map(),_0x35fcfe=new Map(),_0x5b1de6=new Map(),_0x1af040=createJumpTargetCache(),_0x52ed8b=new Map(),_0xd213d=new Map(),_0x2f12c0=new Set();let _0x3cf9a1;const _0x36ec38=_0x401100=>{const _0x4b191d={'resolveSegment':async _0x21823f=>{const _0x56fc4a=a142_0x1405,_0x534174=_0x5b1de6[_0x56fc4a(0x1aa)](_0x21823f);if(_0x534174!==undefined)return{'name':_0x534174,'isJourneyLocal':!![]};try{const _0x633178=await fetchSegment(_0x5b98a5,_0x1b78ef,_0x21823f,_0x147174);if(!_0x633178)throw new Error('Segment\x20not\x20found');const _0x46834c=generateJourneyLocalName(_0x633178[_0x56fc4a(0xc3)]),_0x5c5087=_0x633178[_0x56fc4a(0x140)]===SEGMENT_KIND_JOURNEY&&_0x46834c!==undefined;let _0x1f918b=_0x633178[_0x56fc4a(0xc3)],_0x391d1b;if(_0x5c5087&&_0x633178['rule']){const _0xe557f=apiRuleToYaml(_0x633178[_0x56fc4a(0x10b)]);_0xd213d[_0x56fc4a(0x13e)](_0x21823f,_0xe557f);const _0x40b05b=async _0xbc888c=>{const _0x15352b=_0x56fc4a,_0x304687=collectSegmentRefsFromRule(_0xbc888c);for(const _0x39225c of _0x304687){if(!_0xd213d[_0x15352b(0x1c1)](_0x39225c))try{const _0x2a5478=await fetchSegment(_0x5b98a5,_0x1b78ef,_0x39225c,_0x147174);if(_0x2a5478?.[_0x15352b(0x10b)]){const _0x31aa60=apiRuleToYaml(_0x2a5478[_0x15352b(0x10b)]);_0xd213d['set'](_0x39225c,_0x31aa60),await _0x40b05b(_0x31aa60);}}catch(_0x2fd69a){logger[_0x15352b(0xe1)](_0x15352b(0x14f)+_0x39225c+':\x20'+_0x2fd69a);}}};await _0x40b05b(_0xe557f);const _0x2f3e45=serializeExpandedRule(_0xe557f,_0xd213d),_0x54d7eb=_0x579a95[_0x56fc4a(0x1aa)](_0x2f3e45);if(_0x54d7eb&&_0x54d7eb['length']>0x0){const _0x123089=_0x1bbb9d[_0x56fc4a(0x1aa)](_0x2f3e45)||0x0,_0x3299b6=_0x54d7eb[_0x123089]||_0x54d7eb[_0x54d7eb['length']-0x1];_0x1bbb9d['set'](_0x2f3e45,_0x123089+0x1),_0x1f918b=_0x3299b6,_0x12e0be[_0x56fc4a(0xcc)](_0x1f918b),_0x5b1de6[_0x56fc4a(0x13e)](_0x21823f,_0x1f918b);const _0x389e28=await resolveRuleSegmentRefs(_0xe557f,async _0xa00363=>{const _0x23b5fe=_0x56fc4a,_0x1bb670=_0x5b1de6['get'](_0xa00363);if(_0x1bb670)return _0x1bb670;const _0x2962f7=await _0x3cf9a1[_0x23b5fe(0x109)](_0xa00363);return _0x2962f7['name'];});_0x391d1b={'description':_0x633178[_0x56fc4a(0xde)],'rule':_0x389e28};}else{const _0x508fdb=_0x52ed8b[_0x56fc4a(0x1aa)](_0x2f3e45);if(_0x508fdb)_0x1f918b=_0x508fdb,_0x5b1de6[_0x56fc4a(0x13e)](_0x21823f,_0x1f918b);else{if(_0x46834c){let _0x9994e3=_0x46834c,_0x23ba73=0x2;while(_0x12e0be[_0x56fc4a(0x1c1)](_0x9994e3)||_0x34cef9[_0x56fc4a(0x1c1)](_0x9994e3)){_0x9994e3=_0x46834c+'_'+_0x23ba73,_0x23ba73++;}_0x12e0be['add'](_0x9994e3),_0x1f918b=_0x9994e3;}_0x5b1de6[_0x56fc4a(0x13e)](_0x21823f,_0x1f918b),_0x52ed8b[_0x56fc4a(0x13e)](_0x2f3e45,_0x1f918b);const _0x22c6b7=await resolveRuleSegmentRefs(_0xe557f,async _0x291ea0=>{const _0x3d4891=_0x56fc4a,_0x514422=_0x5b1de6['get'](_0x291ea0);if(_0x514422)return _0x514422;const _0xbcf4c9=await _0x3cf9a1[_0x3d4891(0x109)](_0x291ea0);return _0xbcf4c9['name'];});_0x391d1b={'description':_0x633178['description'],'rule':_0x22c6b7};}}}return{'name':_0x1f918b,'isJourneyLocal':_0x5c5087,'definition':_0x391d1b};}catch(_0x4146f3){return logger[_0x56fc4a(0xe1)](_0x56fc4a(0x108)+_0x21823f+':\x20'+_0x4146f3),{'name':_0x21823f,'isJourneyLocal':![]};}},'resolveActivation':async _0x4bdec6=>{const _0x2e0655=a142_0x1405,_0x5e5815=_0x35fcfe['get'](_0x4bdec6);if(_0x5e5815!==undefined)return{'name':_0x5e5815,'isJourneyLocal':!![]};try{let _0xa9f220=_0x46a230?.[_0x2e0655(0x1aa)](_0x4bdec6);!_0xa9f220&&(_0xa9f220=await _0x5b98a5[_0x2e0655(0x1ab)]['getActivation'](_0x401100,_0x4bdec6));const _0x44c151=_0xa9f220['attributes'][_0x2e0655(0x105)][_0x2e0655(0xc3)]||_0x4bdec6,_0x1fc0fa=sanitizeYamlKey(_0x44c151)||_0x2e0655(0x1a5)+_0x4bdec6,_0x591df4=_0x1fc0fa;_0x35fcfe[_0x2e0655(0x13e)](_0x4bdec6,_0x591df4);const _0x317277=journeyActivationStepToYaml(_0xa9f220,_0x3b18c7,_0x25930b);return{'name':_0x591df4,'isJourneyLocal':!![],'definition':_0x317277};}catch(_0x5dde91){return logger[_0x2e0655(0xe1)](_0x2e0655(0x192)+_0x4bdec6+':\x20'+_0x5dde91),{'name':_0x4bdec6,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x48c2d5,_0x258547)=>resolveJumpTarget(_0x48c2d5,_0x258547,_0x1af040,async _0x4b5acd=>{const _0x365f93=a142_0x1405,_0x101a16=_0x33f005?.[_0x365f93(0x1aa)](_0x4b5acd);if(_0x101a16)return _0x101a16;return _0x5b98a5[_0x365f93(0x1ab)]['getJourney'](_0x4b5acd);})};return _0x3cf9a1=_0x4b191d,_0x4b191d;},_0x39c30b=async _0x4c2119=>{const _0x376077=a142_0x1405,{collectSegmentIdsFromJourneyApi:_0x2e8d4e}=await import('./journey-yaml.js'),{batchAsync:_0xbfe1b4}=await import(_0x376077(0x182)),_0x55b9c4=new Set();for(const _0x5a3eec of _0x4c2119){let _0x19818b=_0x33f005?.[_0x376077(0x1aa)](_0x5a3eec);!_0x19818b&&(_0x19818b=await _0x5b98a5[_0x376077(0x1ab)][_0x376077(0x16c)](_0x5a3eec));const _0x3fae44=_0x2e8d4e(_0x19818b);for(const _0x175f5e of _0x3fae44){_0x55b9c4['add'](_0x175f5e);}}let _0x1204f4=Array[_0x376077(0xbb)](_0x55b9c4);while(_0x1204f4[_0x376077(0x12a)]>0x0){const _0x489c9d=_0x1204f4[_0x376077(0x15c)](_0x12036b=>!_0x2f12c0[_0x376077(0x1c1)](_0x12036b));if(_0x489c9d[_0x376077(0x12a)]===0x0)break;const _0x41a2a6=await _0xbfe1b4(_0x489c9d,async _0x1177fd=>{_0x2f12c0['add'](_0x1177fd);const _0x16e9d1=await fetchSegment(_0x5b98a5,_0x1b78ef,_0x1177fd,_0x147174);if(!_0x16e9d1)return null;return{'segmentId':_0x1177fd,'segment':_0x16e9d1};},0xa),_0x3b5d86=new Set();for(const _0x5b36d5 of _0x41a2a6){if(!_0x5b36d5?.[_0x376077(0x194)]?.[_0x376077(0x10b)])continue;const _0x4d96bb=apiRuleToYaml(_0x5b36d5[_0x376077(0x194)][_0x376077(0x10b)]);_0xd213d[_0x376077(0x13e)](_0x5b36d5[_0x376077(0xd6)],_0x4d96bb);const _0x4c24ce=collectSegmentRefsFromRule(_0x4d96bb);for(const _0x973fb0 of _0x4c24ce){!_0x2f12c0[_0x376077(0x1c1)](_0x973fb0)&&_0x3b5d86['add'](_0x973fb0);}}_0x1204f4=Array['from'](_0x3b5d86);}};return{'createYamlContext':_0x36ec38,'prefetchJourneySegments':_0x39c30b};}export async function executePushSegments(_0x4cb7c7,_0x44b58d,_0x5d8803,_0x4fa401,_0x3cdc93){const _0x4bb01e=a142_0x11892d,{segmentDefToCreateRequest:_0x3eea69,segmentDefToUpdateRequest:_0x5a2212}=await import(_0x4bb01e(0x136)),_0x2e50d1=_0x5d8803[_0x4bb01e(0x1a0)],_0x583a2d=0x5,_0x469f56=async _0x10dfa6=>{const _0x56e483=_0x4bb01e,_0x50408c=_0x10dfa6['folderPath']?_0x2e50d1[_0x56e483(0x1aa)](_0x10dfa6[_0x56e483(0x116)]):undefined;let _0x1a0dcc;const _0x1a0cbb={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x207442=_0x10dfa6[_0x56e483(0xd1)];if(_0x10dfa6['yamlConfig'][_0x56e483(0x10b)]){const _0x3681da=createSegmentIdResolver(_0x5d8803['segmentNameToId'],_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)]),_0xba7ccd=await resolveRuleSegmentIds(_0x10dfa6['yamlConfig'][_0x56e483(0x10b)],_0x3681da);_0x207442={..._0x10dfa6[_0x56e483(0xd1)],'rule':_0xba7ccd};}try{if(_0x10dfa6[_0x56e483(0x17e)]){_0x3cdc93[_0x56e483(0x1a2)]?.({'type':_0x56e483(0x110),'name':_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)]});const _0x26e0e8=_0x3eea69(_0x207442,_0x50408c),_0x24afae=await _0x3cdc93[_0x56e483(0xca)]('Creating\x20segment\x20\x27'+_0x10dfa6['yamlConfig'][_0x56e483(0xc3)]+_0x56e483(0x19e),()=>_0x4cb7c7[_0x56e483(0x194)][_0x56e483(0xea)](_0x4fa401['parentId'],_0x26e0e8));_0x1a0dcc=_0x24afae[_0x56e483(0x180)]['id'],_0x5d8803['segmentNameToId'][_0x56e483(0x13e)](_0x10dfa6['yamlConfig'][_0x56e483(0xc3)],_0x1a0dcc),_0x1a0cbb[_0x56e483(0xce)]={'name':_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)],'id':_0x1a0dcc},_0x3cdc93['onProgress']?.({'type':_0x56e483(0xf4),'name':_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)],'segmentId':_0x1a0dcc}),_0x3cdc93[_0x56e483(0x167)]?.(_0x56e483(0x12c)+_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)]+'\x27'),_0x1a0cbb[_0x56e483(0x14b)]=0x1;}else{if(_0x10dfa6[_0x56e483(0x184)]){_0x3cdc93[_0x56e483(0x1a2)]?.({'type':_0x56e483(0x155),'name':_0x10dfa6[_0x56e483(0xd1)]['name']});const _0x43865e=_0x5a2212(_0x207442);_0x50408c!==_0x10dfa6[_0x56e483(0x107)]?.[_0x56e483(0x143)]&&(_0x43865e[_0x56e483(0x143)]=_0x50408c?parseInt(_0x50408c,0xa):undefined),await _0x3cdc93[_0x56e483(0xca)](_0x56e483(0x1bc)+_0x10dfa6['yamlConfig'][_0x56e483(0xc3)]+_0x56e483(0x19e),()=>_0x4cb7c7[_0x56e483(0x194)][_0x56e483(0x14a)](_0x4fa401[_0x56e483(0x14d)],_0x10dfa6[_0x56e483(0x107)]['id'],_0x43865e)),_0x1a0dcc=_0x10dfa6[_0x56e483(0x107)]['id'],_0x3cdc93[_0x56e483(0x1a2)]?.({'type':_0x56e483(0x162),'name':_0x10dfa6[_0x56e483(0xd1)]['name']}),_0x3cdc93['logSuccess']?.(_0x56e483(0x1b5)+_0x10dfa6[_0x56e483(0xd1)]['name']+'\x27'),_0x1a0cbb[_0x56e483(0x129)]=0x1;}else _0x1a0dcc=_0x10dfa6['existingSegment']['id'];}}catch(_0x306a1d){const _0x26052e=isHttp400Error(_0x306a1d),_0xcf49b3=_0x26052e?ErrorCode[_0x56e483(0xc0)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x586afc=getErrorMessage(_0x306a1d);throw new SDKError(_0xcf49b3,_0x56e483(0x1ae)+(_0x10dfa6[_0x56e483(0x17e)]?_0x56e483(0xf1):_0x56e483(0x14e))+_0x56e483(0x17b)+_0x10dfa6[_0x56e483(0x111)]+_0x56e483(0x119)+_0x586afc,_0x306a1d);}try{const _0x35bf24=await syncActivationsForSegment(_0x4cb7c7,_0x4fa401[_0x56e483(0x14d)],_0x1a0dcc,_0x10dfa6[_0x56e483(0xd1)][_0x56e483(0xc3)],_0x10dfa6['activationActions'],_0x3cdc93,_0x10dfa6[_0x56e483(0x111)]);_0x1a0cbb['activations']=_0x35bf24;}catch(_0x33a5af){if(_0x33a5af instanceof SDKError)throw _0x33a5af;throw new SDKError(ErrorCode[_0x56e483(0xc4)],_0x56e483(0x1b8)+_0x10dfa6['yamlConfig']['name']+_0x56e483(0x175)+_0x10dfa6[_0x56e483(0x111)]+'\x0a\x20\x20'+getErrorMessage(_0x33a5af),_0x33a5af);}return _0x1a0cbb;},_0x4a59f4=await batchAsync(_0x44b58d,_0x469f56,_0x583a2d),_0x16e4dd={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x37bb9d of _0x4a59f4){_0x16e4dd[_0x4bb01e(0x14b)]+=_0x37bb9d[_0x4bb01e(0x14b)],_0x16e4dd[_0x4bb01e(0x129)]+=_0x37bb9d[_0x4bb01e(0x129)],_0x37bb9d[_0x4bb01e(0xce)]&&_0x16e4dd[_0x4bb01e(0x16f)][_0x4bb01e(0x13e)](_0x37bb9d[_0x4bb01e(0xce)]['name'],_0x37bb9d[_0x4bb01e(0xce)]['id']),_0x16e4dd[_0x4bb01e(0x169)][_0x4bb01e(0x14b)]+=_0x37bb9d[_0x4bb01e(0x169)][_0x4bb01e(0x14b)],_0x16e4dd[_0x4bb01e(0x169)][_0x4bb01e(0x129)]+=_0x37bb9d[_0x4bb01e(0x169)][_0x4bb01e(0x129)],_0x16e4dd[_0x4bb01e(0x169)][_0x4bb01e(0x132)]+=_0x37bb9d[_0x4bb01e(0x169)]['deleted'];}return _0x16e4dd;}function a142_0x1405(_0x289c7f,_0x1796f6){_0x289c7f=_0x289c7f-0xb9;const _0x3e6b5b=a142_0x3e6b();let _0x1405e5=_0x3e6b5b[_0x289c7f];return _0x1405e5;}async function syncActivationsForSegment(_0x5cb3f9,_0x156542,_0x25adf8,_0x2ed541,_0xfe65aa,_0x554c42,_0xe5ff29){const _0x3fe6de=a142_0x11892d,_0x21b11e={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5db66d of _0xfe65aa){try{if(_0x5db66d[_0x3fe6de(0x11c)]==='create'&&_0x5db66d[_0x3fe6de(0xc8)])_0x554c42[_0x3fe6de(0x1a2)]?.({'type':'activation_creating','segmentName':_0x2ed541,'activationName':_0x5db66d['name']}),await _0x554c42[_0x3fe6de(0xca)](_0x3fe6de(0xd8)+_0x5db66d['name']+_0x3fe6de(0x19e),()=>_0x5cb3f9[_0x3fe6de(0x194)]['createActivation'](_0x156542,_0x25adf8,_0x5db66d[_0x3fe6de(0xc8)])),_0x554c42['onProgress']?.({'type':_0x3fe6de(0x149),'segmentName':_0x2ed541,'activationName':_0x5db66d['name']}),_0x554c42['logSuccess']?.(_0x3fe6de(0x18d)+_0x5db66d[_0x3fe6de(0xc3)]+'\x27'),_0x21b11e[_0x3fe6de(0x14b)]++;else{if(_0x5db66d[_0x3fe6de(0x11c)]===_0x3fe6de(0x14e)&&_0x5db66d[_0x3fe6de(0xc8)]&&_0x5db66d[_0x3fe6de(0x157)])_0x554c42['onProgress']?.({'type':_0x3fe6de(0x151),'segmentName':_0x2ed541,'activationName':_0x5db66d['name']}),await _0x554c42[_0x3fe6de(0xca)]('Updating\x20activation\x20\x27'+_0x5db66d[_0x3fe6de(0xc3)]+_0x3fe6de(0x19e),()=>_0x5cb3f9[_0x3fe6de(0x194)][_0x3fe6de(0x13f)](_0x156542,_0x25adf8,_0x5db66d[_0x3fe6de(0x157)]['id'],_0x5db66d['validatedRequest'])),_0x554c42['onProgress']?.({'type':_0x3fe6de(0xbc),'segmentName':_0x2ed541,'activationName':_0x5db66d[_0x3fe6de(0xc3)]}),_0x554c42[_0x3fe6de(0x167)]?.(_0x3fe6de(0x17f)+_0x5db66d[_0x3fe6de(0xc3)]+'\x27'),_0x21b11e[_0x3fe6de(0x129)]++;else _0x5db66d[_0x3fe6de(0x11c)]===_0x3fe6de(0x10c)&&_0x5db66d[_0x3fe6de(0x157)]&&(_0x554c42[_0x3fe6de(0x1a2)]?.({'type':_0x3fe6de(0xcf),'segmentName':_0x2ed541,'activationName':_0x5db66d[_0x3fe6de(0xc3)]}),await _0x554c42[_0x3fe6de(0xca)](_0x3fe6de(0xf6)+_0x5db66d[_0x3fe6de(0xc3)]+'\x27...',()=>_0x5cb3f9['segment'][_0x3fe6de(0x11e)](_0x156542,_0x25adf8,_0x5db66d[_0x3fe6de(0x157)]['id'])),_0x554c42[_0x3fe6de(0x1a2)]?.({'type':_0x3fe6de(0x1b4),'segmentName':_0x2ed541,'activationName':_0x5db66d['name']}),_0x554c42[_0x3fe6de(0x11f)]?.(_0x3fe6de(0x16d)+_0x5db66d[_0x3fe6de(0xc3)]+'\x27'),_0x21b11e['deleted']++);}}catch(_0x45fba3){const _0xb32a88=isHttp400Error(_0x45fba3),_0x25f48e=_0xb32a88?ErrorCode[_0x3fe6de(0x196)]:ErrorCode[_0x3fe6de(0xc4)],_0x117e3d=getErrorMessage(_0x45fba3);throw new SDKError(_0x25f48e,'Failed\x20to\x20'+_0x5db66d[_0x3fe6de(0x11c)]+'\x20activation\x20\x27'+_0x5db66d[_0x3fe6de(0xc3)]+_0x3fe6de(0x175)+_0xe5ff29+_0x3fe6de(0x119)+_0x117e3d,_0x45fba3);}}return _0x21b11e;}export async function executePushFolders(_0x323ffb,_0x5839cc,_0x31e2d4,_0x153e92,_0x50f254){const _0x5c2fe2=a142_0x11892d,_0x52945a=new Map(_0x31e2d4),_0x3246ef=sortFoldersByDepth(_0x5839cc);for(const _0xa8346a of _0x3246ef){const _0x55bf46=_0xa8346a[_0x5c2fe2(0x11a)]('/'),_0x257fae=_0x55bf46[_0x55bf46[_0x5c2fe2(0x12a)]-0x1],_0x1a4641=_0x55bf46[_0x5c2fe2(0x126)](0x0,-0x1)[_0x5c2fe2(0xe4)]('/'),_0x444d2d=_0x52945a['get'](_0x1a4641);_0x50f254['onProgress']?.({'type':_0x5c2fe2(0x133),'folder':_0xa8346a});const _0x54baaa={'name':_0x257fae,'parentFolderId':_0x444d2d},_0xc949=await _0x50f254['withProgress'](_0x5c2fe2(0x10a)+_0xa8346a+_0x5c2fe2(0x19e),()=>_0x323ffb[_0x5c2fe2(0x194)][_0x5c2fe2(0x161)](_0x153e92['parentId'],_0x54baaa));_0x52945a[_0x5c2fe2(0x13e)](_0xa8346a,_0xc949[_0x5c2fe2(0x180)]['id']),_0x50f254[_0x5c2fe2(0x1a2)]?.({'type':_0x5c2fe2(0x1be),'folder':_0xa8346a,'folderId':_0xc949[_0x5c2fe2(0x180)]['id']}),_0x50f254[_0x5c2fe2(0x1ba)]?.('Created\x20folder\x20\x27'+_0xa8346a+'\x27');}return _0x52945a;}export async function executePushSegmentDeletions(_0x5d28a4,_0x3268f0,_0x5aa6ef){const _0x82aa64=a142_0x11892d;if(_0x3268f0['length']===0x0)return 0x0;const {batchAsync:_0x2205d5}=await import(_0x82aa64(0x182)),_0x22ae8e=0x5,_0x492715=await _0x2205d5(_0x3268f0,async _0x3f7d62=>{const _0x471cde=_0x82aa64;return _0x5aa6ef[_0x471cde(0x1a2)]?.({'type':_0x471cde(0xcb),'name':_0x3f7d62[_0x471cde(0xc3)]}),await _0x5d28a4['segment']['deleteSegment'](_0x3f7d62['id']),_0x5aa6ef[_0x471cde(0x1a2)]?.({'type':_0x471cde(0x181),'name':_0x3f7d62[_0x471cde(0xc3)]}),_0x5aa6ef[_0x471cde(0x11f)]?.('Deleted\x20segment\x20\x27'+_0x3f7d62['name']+'\x27'),0x1;},_0x22ae8e);return _0x492715[_0x82aa64(0xf8)]((_0x3aa4f7,_0x5f011f)=>_0x3aa4f7+_0x5f011f,0x0);}export async function executePushJourneys(_0x2fd453,_0x5ec88a,_0xac21b,_0x158d70,_0x152d7e){const _0x144808=a142_0x11892d,{journeyDefToRequest:_0x47e1fb}=await import(_0x144808(0x1a9)),{activationDefToCreateRequest:_0x5a4383,yamlRuleToApi:_0x12866a,validateSegmentRule:_0x39b8de}=await import('./child-segment-yaml.js'),_0x373e5a={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x279da0=new Map(_0xac21b[_0x144808(0xf2)]),_0x283bd7=0x5;for(let _0xe78abb=0x0;_0xe78abb<_0x5ec88a[_0x144808(0x12a)];_0xe78abb+=_0x283bd7){const _0x354928=_0x5ec88a['slice'](_0xe78abb,_0xe78abb+_0x283bd7),_0x420c3b=await Promise['all'](_0x354928[_0x144808(0xc7)](async _0x2fb8f7=>{const _0xd5e137=_0x144808;if(!_0x2fb8f7[_0xd5e137(0x17e)]&&!_0x2fb8f7[_0xd5e137(0x184)])return{'action':'unchanged','name':_0x2fb8f7[_0xd5e137(0xd1)][_0xd5e137(0xc3)],'journeyId':_0x2fb8f7[_0xd5e137(0x1a7)]?.['id']};const _0x4e162a=_0x2fb8f7['folderPath']?_0xac21b[_0xd5e137(0x1a0)][_0xd5e137(0x1aa)](_0x2fb8f7[_0xd5e137(0x116)]):undefined;_0x152d7e[_0xd5e137(0x1a2)]?.({'type':_0x2fb8f7[_0xd5e137(0x17e)]?_0xd5e137(0x115):'journey_updating','name':_0x2fb8f7[_0xd5e137(0xd1)][_0xd5e137(0xc3)]});try{const _0x444dd8=await executeSingleJourneyPush(_0x2fd453,_0x2fb8f7,{..._0xac21b,'segmentNameToId':_0x279da0},{'parentId':_0x158d70[_0xd5e137(0x14d)],'rootFolderId':_0x158d70[_0xd5e137(0x1ad)],'folderId':_0x4e162a,'verbose':_0x158d70[_0xd5e137(0xe3)]},_0x152d7e,{'journeyDefToRequest':_0x47e1fb,'activationDefToCreateRequest':_0x5a4383,'yamlRuleToApi':_0x12866a,'validateSegmentRule':_0x39b8de});for(const [_0x19f23c,_0x2a770f]of _0x444dd8['embeddedSegmentNameToId']){_0x279da0[_0xd5e137(0x13e)](_0x19f23c,_0x2a770f),_0x373e5a[_0xd5e137(0x153)]['set'](_0x19f23c,_0x2a770f);}if(_0x444dd8[_0xd5e137(0x1a1)]===_0xd5e137(0x14b))_0x152d7e[_0xd5e137(0x1a2)]?.({'type':_0xd5e137(0x101),'name':_0x2fb8f7['yamlConfig'][_0xd5e137(0xc3)],'journeyId':_0x444dd8['journeyId']}),_0x152d7e[_0xd5e137(0x167)]?.(_0xd5e137(0xf9)+_0x2fb8f7[_0xd5e137(0xd1)]['name']+'\x27'),_0x373e5a[_0xd5e137(0x14b)]++;else _0x444dd8['action']==='updated'&&(_0x152d7e[_0xd5e137(0x1a2)]?.({'type':_0xd5e137(0x125),'name':_0x2fb8f7[_0xd5e137(0xd1)][_0xd5e137(0xc3)]}),_0x152d7e[_0xd5e137(0x167)]?.(_0xd5e137(0x124)+_0x2fb8f7[_0xd5e137(0xd1)]['name']+'\x27'),_0x373e5a[_0xd5e137(0x129)]++);return{'action':_0x444dd8[_0xd5e137(0x1a1)],'name':_0x2fb8f7[_0xd5e137(0xd1)]['name'],'journeyId':_0x444dd8['journeyId']};}catch(_0xde735c){const _0x258e6f=isHttp400Error(_0xde735c),_0x57dadc=_0x258e6f?ErrorCode[_0xd5e137(0x18e)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x18cf9b=getErrorMessage(_0xde735c);throw new SDKError(_0x57dadc,_0xd5e137(0x1ae)+(_0x2fb8f7['isNew']?_0xd5e137(0xf1):_0xd5e137(0x14e))+'\x20journey\x20from\x20file:\x20'+_0x2fb8f7[_0xd5e137(0x111)]+_0xd5e137(0x119)+_0x18cf9b,_0xde735c);}}));_0x373e5a[_0x144808(0x1bb)][_0x144808(0x135)](..._0x420c3b);}return _0x373e5a;}async function matchExistingJourneySegments(_0x2c46fd,_0x7671d7,_0x13bbcb,_0x57ee12,_0x48ab76){const _0x4d55a7=a142_0x11892d;if(!_0x7671d7[_0x4d55a7(0x1a7)]||!_0x7671d7['yamlConfig'][_0x4d55a7(0x185)])return;const _0x2bd29a=new Map(),_0x51e592=new Set();for(const _0x377843 of Object[_0x4d55a7(0x1b6)](_0x7671d7[_0x4d55a7(0xd1)][_0x4d55a7(0x185)])){const _0x34b642=generateDeterministicJourneySegmentName(_0x7671d7['yamlConfig']['name'],_0x377843);_0x2bd29a[_0x4d55a7(0x13e)](_0x34b642,_0x377843),_0x51e592[_0x4d55a7(0xcc)](_0x377843);}const _0x8d7da7=[],_0x43465b=collectSegmentIdsFromJourneyApi(_0x7671d7['existingJourney']);for(const _0x8900a1 of _0x43465b){const _0x407bc3=await fetchSegment(_0x2c46fd,_0x13bbcb,_0x8900a1,_0x57ee12);if(!_0x407bc3?.['name'])continue;const _0x2974e0=_0x2bd29a[_0x4d55a7(0x1aa)](_0x407bc3[_0x4d55a7(0xc3)]);_0x2974e0?(_0x48ab76[_0x4d55a7(0x13e)](_0x2974e0,_0x8900a1),_0x51e592[_0x4d55a7(0x10c)](_0x2974e0)):_0x8d7da7['push']({'id':_0x8900a1,'seg':_0x407bc3});}if(_0x51e592['size']>0x0&&_0x8d7da7[_0x4d55a7(0x12a)]>0x0){const {localExpandedRuleToNames:_0x3607fd}=buildLocalExpandedRuleMappings(_0x7671d7[_0x4d55a7(0xd1)]),_0x4c14ef=new Map();for(const {id:_0x4f31b7,seg:_0x21d2cc}of _0x8d7da7){if(_0x21d2cc['rule']){const _0x2d3c5c=apiRuleToYaml(_0x21d2cc[_0x4d55a7(0x10b)]);_0x4c14ef[_0x4d55a7(0x13e)](_0x4f31b7,_0x2d3c5c);}}for(const {id:_0x4e3c82,seg:_0x58ac16}of _0x8d7da7){if(!_0x58ac16[_0x4d55a7(0x10b)])continue;const _0x34889f=_0x4c14ef[_0x4d55a7(0x1aa)](_0x4e3c82);if(!_0x34889f)continue;const _0x7aba5=serializeExpandedRule(_0x34889f,_0x4c14ef),_0x366146=_0x3607fd[_0x4d55a7(0x1aa)](_0x7aba5);if(_0x366146){const _0x587c59=_0x366146['find'](_0x53230b=>_0x51e592[_0x4d55a7(0x1c1)](_0x53230b));_0x587c59&&(_0x48ab76[_0x4d55a7(0x13e)](_0x587c59,_0x4e3c82),_0x51e592['delete'](_0x587c59),logger['debug']('Matched\x20server\x20segment\x20\x27'+_0x58ac16[_0x4d55a7(0xc3)]+_0x4d55a7(0x142)+_0x587c59+_0x4d55a7(0x12d)));}}}}function a142_0x3e6b(){const _0x47829d=['2100570KrDkGO','getSegmentEntity\x20also\x20failed\x20for\x20','toLowerCase','set','updateActivation','kind','entries','\x27\x20to\x20local\x20\x27','segmentFolderId','fetchJourney','buildUserMaps','embedded_activation_created','message','\x27\x20for\x20','activation_created','updateSegmentById','created','DecisionPoint','parentId','update','Failed\x20to\x20fetch\x20referenced\x20segment\x20','__pending_act_','activation_updating','run_after_journey_refresh','embeddedSegmentNameToId','yamlActivation','segment_updating','SEGMENT_NOT_FOUND','existingActivation','nameToType','getSegmentEntity','isArray','behavior','filter','sha1','Activation\x20not\x20found:\x20','goal\x20criteria','):\x20','createFolder','segment_updated','activationContext','columns','branches','embedded_activation_creating','logSuccess','Entry\x20criteria:\x20','activations','folder','all_columns','getJourney','Deleted\x20activation\x20\x27','entry_criteria','createdSegmentIds','item','milestone',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','effectiveFolderId','\x20(referenced\x20in\x20journey\x20','\x27\x20from\x20file:\x20','journeyById','waitStepUnit','8206955ILSMOy','existingSegments','\x20error(s)','\x20segment\x20from\x20file:\x20','stringify','some','isNew','Updated\x20activation\x20\x27','data','segment_deleted','../../utils/async.js','toString','hasChanges','segments','journeyStages','journeyBundleId','\x27\x20not\x20found\x20in\x20journey\x20\x27','utf-8','deps','1PXonin','attributes','Created\x20activation\x20\x27','JOURNEY_SYNTAX_ERROR','steps','uniqueServerName','null','Failed\x20to\x20resolve\x20activation\x20','entry','segment','INTERNAL','ACTIVATION_SYNTAX_ERROR','dirname','connectionIdToNameMap','and\x20the\x20server\x20segment,\x20then\x20retry.','.$1.push-recovery.json','\x27\x20entry\x20criteria','activationStepsById','createJourneySegment','\x27...','match','folderPathToId','action','onProgress','entryCriteria','index','activation_','goal','existingJourney','object','./journey-yaml.js','get','journey','versionNumber','rootFolderId','Failed\x20to\x20','\x27\x20decision\x20point\x20branch\x20\x27','errors','max','2851071GwlWNQ','logWarning','activation_deleted','Updated\x20segment\x20\x27','keys','conditionTimeoutUnit','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journeys','logInfo','results','Updating\x20segment\x20\x27','Stage\x20\x27','folder_created','journey_entry_criteria_','find','has','NOT_FOUND','skipSegments','resolvedRule','from','activation_updated','148456FUcrlF','notification','exitCriterias','SEGMENT_SYNTAX_ERROR','user','conditionSegmentId','name','ACTIVATION_UPDATE_ERROR','tdx.sdk.push-workflow','uniqueSegmentName','map','validatedRequest','toISOString','withProgress','segment_deleting','add','2098860GHIhkQ','createdSegmentId','activation_deleting','Fetching\x20','yamlConfig','nameToId','getSegment\x20failed\x20for\x20','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','unchanged','segmentId','all','Creating\x20activation\x20\x27','Name\x20has\x20already\x20been\x20taken','schedule','listActivations','Delete\x20the\x20push\x20recovery\x20file\x20(','__pending_','description','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Embedded\x20segment\x20\x27','debug','with','verbose','join','WaitStep','journeyActivationStepId','folderId','trim','progress','createSegment','\x27\x20wait\x20condition','21399648Swdmvi','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27',').\x20','relationships','valid','create','segmentNameToId','2238537VSdVDZ','segment_created','replace','Deleting\x20activation\x20\x27','flatMap','reduce','Created\x20journey\x20\x27','day','stage\x20\x27','waitStep','stages','embedded_segment_creating','journeyBundlesByFolderAndName','createActivation','journey_created','Duration','journeyActivationNameToId','diff','activationParams','localName','existingSegment','Failed\x20to\x20resolve\x20segment\x20','resolveSegment','Creating\x20folder\x20\x27','rule','delete','waitStepType','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Activation','segment_creating','absolutePath','parseDocument','startsWith','embedded_segment_created','journey_creating','folderPath','activationActions','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','\x0a\x20\x20','split','resolveJourneyId','type','state','deleteActivation','logDeleted','parse','Condition','conditionTimeoutDuration','sort','Updated\x20journey\x20\x27','journey_updated','slice','parentSegmentFolder','decision_point','updated','length','includes','Created\x20segment\x20\x27','\x27\x20by\x20rule\x20content','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','hex','conditions','journeyBundleName','deleted','folder_creating','relative','push','./child-segment-yaml.js','segmentByFolderAndName','\x27\x20milestone','connector_config','idToEmailMap'];a142_0x3e6b=function(){return _0x47829d;};return a142_0x3e6b();}async function executeSingleJourneyPush(_0x1cf3f7,_0x54ab91,_0x550c89,_0x45bef9,_0x1a6ca9,_0x383da8){const _0x213896=a142_0x11892d,{journeyDefToRequest:_0x4d8946,activationDefToCreateRequest:_0x35a34d,yamlRuleToApi:_0x115af8,validateSegmentRule:_0x103631}=_0x383da8,_0x3062e9=new Map(),_0x15cb7a=new Map();recoverSegmentIdsFromPushRecovery(_0x54ab91,_0x3062e9,_0x550c89[_0x213896(0xf2)]);const _0xfa9275=new Map(),_0xed49be=new Map(),_0x135f3e=new Map();let _0x2e4c40;const _0x210e76=async()=>{const _0x47dac0=_0x213896;if(_0x2e4c40)return;_0x2e4c40=new Map();if(!_0x54ab91[_0x47dac0(0x1a7)])return;const _0xc45908=await _0x1cf3f7[_0x47dac0(0x1ab)][_0x47dac0(0xdb)](_0x54ab91[_0x47dac0(0x1a7)]['id']);for(const _0x3e91d5 of _0xc45908){const _0x1a4b96=journeyActivationStepToYaml(_0x3e91d5,_0x550c89[_0x47dac0(0x13a)],_0x550c89[_0x47dac0(0x198)]),_0x5afa0e=activationSignature(_0x1a4b96);!_0x2e4c40[_0x47dac0(0x1c1)](_0x5afa0e)&&_0x2e4c40[_0x47dac0(0x13e)](_0x5afa0e,_0x3e91d5['id']),_0x1a4b96[_0x47dac0(0xc3)]&&_0x15cb7a['set'](_0x1a4b96[_0x47dac0(0xc3)],_0x3e91d5['id']);}};await matchExistingJourneySegments(_0x1cf3f7,_0x54ab91,_0x45bef9['parentId'],_0x550c89[_0x213896(0x179)],_0x550c89[_0x213896(0xf2)]);const _0x1aa583={'resolveSegmentId':async _0x41a517=>{const _0xf66e20=_0x213896,_0x494b4f=_0x550c89[_0xf66e20(0xf2)][_0xf66e20(0x1aa)](_0x41a517);if(!_0x494b4f)throw new SDKError(ErrorCode[_0xf66e20(0x156)],'Segment\x20not\x20found:\x20'+_0x41a517+_0xf66e20(0x174)+_0x54ab91[_0xf66e20(0xd1)][_0xf66e20(0xc3)]+')');return _0x494b4f;},'resolveEmbeddedSegmentId':async(_0x4a8cf3,_0x7b4c73)=>{const _0x27109c=_0x213896,_0x567e65=_0x550c89['segmentNameToId'][_0x27109c(0x1aa)](_0x4a8cf3);if(_0x567e65)return _0x567e65;const _0x5b9dad=_0x550c89[_0x27109c(0x179)][_0x27109c(0x1c0)](_0xa4c312=>_0xa4c312[_0x27109c(0xc3)]===_0x4a8cf3);if(_0x5b9dad)return _0x550c89['segmentNameToId'][_0x27109c(0x13e)](_0x4a8cf3,_0x5b9dad['id']),_0x5b9dad['id'];if(_0x54ab91[_0x27109c(0x17e)]){const {stageName:_0x2d199e,criteriaName:_0x26f63a}=findSegmentCriteriaLocation(_0x54ab91[_0x27109c(0xd1)],_0x4a8cf3);return _0x103631(_0x4a8cf3,_0x7b4c73[_0x27109c(0x10b)]),_0xed49be[_0x27109c(0x13e)](_0x4a8cf3,{'definition':_0x7b4c73,'stageName':_0x2d199e,'criteriaName':_0x26f63a}),createPendingSegmentId(_0x4a8cf3);}const _0x437b07=_0x54ab91[_0x27109c(0x1a7)]?.['id'];if(!_0x437b07)throw new SDKError(ErrorCode[_0x27109c(0x195)],_0x27109c(0xdf));const _0x4f89b0=_0xfa9275[_0x27109c(0x1aa)](_0x4a8cf3);if(_0x4f89b0)return _0x4f89b0;const _0xb295b9=((async()=>{const _0xb3c5c7=_0x27109c;_0x103631(_0x4a8cf3,_0x7b4c73['rule']);const _0x1c2b06=generateDeterministicJourneySegmentName(_0x54ab91[_0xb3c5c7(0xd1)][_0xb3c5c7(0xc3)],_0x4a8cf3),_0x1bbe97=_0x550c89[_0xb3c5c7(0x179)][_0xb3c5c7(0x1c0)](_0x1420bb=>_0x1420bb[_0xb3c5c7(0xc3)]===_0x1c2b06),_0x1f872f=createSegmentIdResolver(_0x550c89['segmentNameToId'],_0x4a8cf3),_0x2aa1b0=await resolveRuleSegmentIds(_0x7b4c73[_0xb3c5c7(0x10b)],_0x1f872f);let _0xac98b5;return _0x1bbe97?(await _0x1cf3f7[_0xb3c5c7(0x194)]['updateSegmentById'](_0x45bef9[_0xb3c5c7(0x14d)],_0x1bbe97['id'],{'description':_0x7b4c73['description']||_0xb3c5c7(0x168)+_0x4a8cf3,'rule':_0x115af8(_0x2aa1b0,!![]),'countPopulation':!![]}),_0xac98b5=_0x1bbe97['id'],saveSegmentToPushRecovery(_0x54ab91[_0xb3c5c7(0x111)],_0x54ab91['yamlConfig'][_0xb3c5c7(0xc3)],_0x4a8cf3,{'segmentId':_0xac98b5,'uniqueServerName':_0x1c2b06,'createdAt':new Date()[_0xb3c5c7(0xc9)]()})):_0xac98b5=await createOrRecoverEmbeddedSegment(_0x1cf3f7,_0x54ab91,{'localName':_0x4a8cf3,'uniqueSegmentName':_0x1c2b06,'description':_0x7b4c73[_0xb3c5c7(0xde)]||'Entry\x20criteria:\x20'+_0x4a8cf3,'journeyId':_0x437b07,'resolvedRule':_0x2aa1b0,'parentId':_0x45bef9[_0xb3c5c7(0x14d)],'folderId':_0x45bef9[_0xb3c5c7(0x1ad)]||''},_0x115af8),_0x550c89[_0xb3c5c7(0xf2)][_0xb3c5c7(0x13e)](_0x4a8cf3,_0xac98b5),_0x3062e9['set'](_0x4a8cf3,_0xac98b5),_0xac98b5;})());_0xfa9275['set'](_0x4a8cf3,_0xb295b9);try{return await _0xb295b9;}finally{_0xfa9275[_0x27109c(0x10c)](_0x4a8cf3);}},'resolveActivationId':async _0xbe759c=>{const _0x5e8b03=_0x213896,_0x531818=_0x15cb7a[_0x5e8b03(0x1aa)](_0xbe759c);if(_0x531818)return _0x531818;if(_0x54ab91['existingJourney']){await _0x210e76();const _0xbd4ca1=_0x15cb7a['get'](_0xbe759c);if(_0xbd4ca1)return _0xbd4ca1;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x5e8b03(0x15e)+_0xbe759c+'\x20(referenced\x20in\x20journey\x20'+_0x54ab91['yamlConfig'][_0x5e8b03(0xc3)]+_0x5e8b03(0xee)+_0x5e8b03(0x12e));},'resolveEmbeddedActivationId':async(_0xef8734,_0xb66c02)=>{const _0x5ec5a7=_0x213896,_0x1e2b15=_0x15cb7a['get'](_0xef8734);if(_0x1e2b15)return _0x1e2b15;if(_0x54ab91[_0x5ec5a7(0x17e)])return _0x135f3e[_0x5ec5a7(0x13e)](_0xef8734,_0xb66c02),createPendingActivationId(_0xef8734);if(_0x54ab91['existingJourney']){await _0x210e76();const _0x1fa014=_0x15cb7a[_0x5ec5a7(0x1aa)](_0xb66c02[_0x5ec5a7(0xc3)]);if(_0x1fa014)return _0x15cb7a[_0x5ec5a7(0x13e)](_0xef8734,_0x1fa014),_0x1fa014;const _0x3c8907=activationSignature(_0xb66c02),_0x4b286d=_0x2e4c40?.['get'](_0x3c8907);if(_0x4b286d)return _0x15cb7a[_0x5ec5a7(0x13e)](_0xef8734,_0x4b286d),_0x4b286d;const _0x2e16cf=await _0x35a34d(_0xb66c02,_0x550c89[_0x5ec5a7(0x163)]),_0x1da9d8={..._0x2e16cf,..._0xb66c02[_0x5ec5a7(0x152)]!==undefined&&{'runAfterJourneyRefresh':_0xb66c02[_0x5ec5a7(0x152)]}},_0x2e4a52=await _0x1cf3f7[_0x5ec5a7(0x1ab)][_0x5ec5a7(0x100)](_0x54ab91[_0x5ec5a7(0x1a7)]['id'],_0x1da9d8);return _0x15cb7a[_0x5ec5a7(0x13e)](_0xef8734,_0x2e4a52['id']),_0x2e4a52['id'];}throw new SDKError(ErrorCode[_0x5ec5a7(0x195)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x2e23a8=>{const _0x653f19=_0x213896;try{return await _0x1cf3f7[_0x653f19(0x1ab)][_0x653f19(0x11b)](_0x45bef9[_0x653f19(0x14d)],_0x2e23a8);}catch(_0x4e489f){throw new SDKError(ErrorCode[_0x653f19(0x1c2)],'Journey\x20\x27'+_0x2e23a8+_0x653f19(0xed)+_0x54ab91[_0x653f19(0xd1)]['name']+'\x27)',_0x4e489f);}},'resolveStageId':async(_0x5eda67,_0x37d4a3)=>{const _0x243f4a=_0x213896,_0xb75da2=await _0x1cf3f7[_0x243f4a(0x1ab)][_0x243f4a(0x16c)](_0x5eda67),_0x22350d=_0xb75da2[_0x243f4a(0x18c)]['journeyStages']['find'](_0x265cf7=>_0x265cf7[_0x243f4a(0xc3)][_0x243f4a(0x13d)]()===_0x37d4a3[_0x243f4a(0x13d)]());if(!_0x22350d?.['id'])throw new SDKError(ErrorCode[_0x243f4a(0x1c2)],_0x243f4a(0x1bd)+_0x37d4a3+_0x243f4a(0x188)+(_0xb75da2[_0x243f4a(0x18c)][_0x243f4a(0x131)]||_0xb75da2[_0x243f4a(0x18c)][_0x243f4a(0xc3)])+'\x27');return _0x22350d['id'];}},_0x41dbc6=await _0x4d8946(_0x54ab91['yamlConfig'],_0x45bef9[_0x213896(0x14d)],_0x1aa583),_0x27f475=_0x45bef9[_0x213896(0xe7)]||_0x45bef9['rootFolderId'];_0x27f475&&(_0x41dbc6[_0x213896(0xef)]={'parentFolder':{'data':{'id':_0x27f475,'type':_0x213896(0x16a)}}});if(_0x54ab91[_0x213896(0x17e)]){if(_0xed49be['size']>0x0||_0x135f3e['size']>0x0)return await executeThreeStepJourneyCreate(_0x1cf3f7,_0x54ab91,_0x41dbc6,{'pendingEmbeddedSegments':_0xed49be,'pendingEmbeddedActivations':_0x135f3e,'embeddedSegmentNameToId':_0x3062e9,'journeyActivationNameToId':_0x15cb7a},{..._0x45bef9,'effectiveFolderId':_0x27f475},_0x550c89,_0x1a6ca9,_0x383da8);else{ensureJourneyDefaults(_0x41dbc6[_0x213896(0x18c)]);const _0x4f0497=await _0x1cf3f7[_0x213896(0x1ab)][_0x213896(0xf1)](_0x41dbc6);return deletePushRecovery(_0x54ab91['absolutePath']),{'action':_0x213896(0x14b),'journeyId':_0x4f0497['id'],'embeddedSegmentNameToId':_0x3062e9};}}else{if(_0x54ab91[_0x213896(0x184)]&&_0x54ab91[_0x213896(0x1a7)]){_0x41dbc6['id']=_0x54ab91[_0x213896(0x1a7)]['id'];const _0x174a6f=_0x41dbc6[_0x213896(0x18c)];_0x54ab91[_0x213896(0x1a7)][_0x213896(0x18c)]?.[_0x213896(0x131)]&&(_0x174a6f['journeyBundleName']=_0x54ab91['existingJourney'][_0x213896(0x18c)][_0x213896(0x131)]);const _0x2ffe88=_0x54ab91['existingJourney'][_0x213896(0x18c)]?.[_0x213896(0x186)];return _0x2ffe88&&_0x41dbc6[_0x213896(0x18c)][_0x213896(0x186)]&&injectExistingStageIds(_0x41dbc6[_0x213896(0x18c)][_0x213896(0x186)],_0x2ffe88),ensureJourneyDefaults(_0x174a6f),await _0x1cf3f7[_0x213896(0x1ab)]['update'](_0x54ab91[_0x213896(0x1a7)]['id'],_0x41dbc6),deletePushRecovery(_0x54ab91['absolutePath']),{'action':_0x213896(0x129),'journeyId':_0x54ab91['existingJourney']['id'],'embeddedSegmentNameToId':_0x3062e9};}}return deletePushRecovery(_0x54ab91['absolutePath']),{'action':_0x213896(0xd5),'journeyId':_0x54ab91['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x3062e9};}function findSegmentCriteriaLocation(_0x340787,_0x5caa3f){const _0x556d07=a142_0x11892d,_0x4608e7=_0x340787[_0x556d07(0xfd)]||_0x340787[_0x556d07(0x1b9)]?.[0x0]?.[_0x556d07(0xfd)]||[];let _0x18b017=_0x556d07(0x193),_0x5e8f0e=_0x5caa3f;const _0x3403e8=_0x340787[_0x556d07(0x1a6)]||_0x340787[_0x556d07(0x1b9)]?.[0x0]?.[_0x556d07(0x1a6)];if(_0x3403e8?.[_0x556d07(0x194)]===_0x5caa3f)return{'stageName':_0x556d07(0x1a6),'criteriaName':_0x3403e8[_0x556d07(0xc3)]||_0x5caa3f};_0x5dfbbd:for(const _0x4dcc2a of _0x4608e7){if(_0x4dcc2a[_0x556d07(0x16e)]?.[_0x556d07(0x194)]===_0x5caa3f){_0x18b017=_0x4dcc2a[_0x556d07(0xc3)],_0x5e8f0e=_0x4dcc2a[_0x556d07(0x16e)][_0x556d07(0xc3)]||_0x5caa3f;break;}if(_0x4dcc2a[_0x556d07(0x18f)])for(const _0x56774e of _0x4dcc2a[_0x556d07(0x18f)]){if(_0x56774e[_0x556d07(0x11c)]===_0x556d07(0x128)&&_0x56774e['with']?.[_0x556d07(0x165)])for(const _0x44420d of _0x56774e[_0x556d07(0xe2)][_0x556d07(0x165)]){if(_0x44420d['segment']===_0x5caa3f){_0x18b017=_0x4dcc2a[_0x556d07(0xc3)],_0x5e8f0e=_0x44420d[_0x556d07(0xc3)]||_0x5caa3f;break _0x5dfbbd;}}}}return{'stageName':_0x18b017,'criteriaName':_0x5e8f0e};}async function executeThreeStepJourneyCreate(_0x522322,_0x542093,_0x4bc165,_0x20874e,_0x2dfaad,_0x324279,_0x1e62b3,_0x289a13){const _0xf6ffa6=a142_0x11892d,{activationDefToCreateRequest:_0x2667b2,yamlRuleToApi:_0xcb70ba}=_0x289a13,{pendingEmbeddedSegments:_0x50248a,pendingEmbeddedActivations:_0x56156d,embeddedSegmentNameToId:_0xe758c8}=_0x20874e,_0x2a6ea4=JSON[_0xf6ffa6(0x120)](JSON[_0xf6ffa6(0x17c)](_0x4bc165));ensureJourneyDefaults(_0x2a6ea4['attributes']),stripPendingIds(_0x2a6ea4);const _0x1a0a91=await _0x522322[_0xf6ffa6(0x1ab)][_0xf6ffa6(0xf1)](_0x2a6ea4),_0x161903=_0x1a0a91['id'],_0x2a0a58=new Map();for(const _0x35865b of _0x1a0a91[_0xf6ffa6(0x18c)][_0xf6ffa6(0x186)]){_0x2a0a58['set'](_0x35865b[_0xf6ffa6(0xc3)]['toLowerCase'](),_0x35865b['id']);}recoverSegmentIdsFromPushRecovery(_0x542093,_0xe758c8,_0x324279[_0xf6ffa6(0xf2)]);for(const [_0xacd273,{definition:_0x2356c4}]of _0x50248a){if(_0xe758c8[_0xf6ffa6(0x1c1)](_0xacd273)){_0x1e62b3['onProgress']?.({'type':_0xf6ffa6(0x114),'journeyName':_0x542093[_0xf6ffa6(0xd1)][_0xf6ffa6(0xc3)],'segmentName':_0xacd273});continue;}const _0x87ac6f=generateDeterministicJourneySegmentName(_0x542093[_0xf6ffa6(0xd1)][_0xf6ffa6(0xc3)],_0xacd273);_0x1e62b3[_0xf6ffa6(0x1a2)]?.({'type':_0xf6ffa6(0xfe),'journeyName':_0x542093[_0xf6ffa6(0xd1)][_0xf6ffa6(0xc3)],'segmentName':_0xacd273});const _0x291529=createSegmentIdResolver(_0x324279['segmentNameToId'],_0xacd273),_0x15c6c5=await resolveRuleSegmentIds(_0x2356c4[_0xf6ffa6(0x10b)],_0x291529),_0x41d1de=await createOrRecoverEmbeddedSegment(_0x522322,_0x542093,{'localName':_0xacd273,'uniqueSegmentName':_0x87ac6f,'description':_0x2356c4[_0xf6ffa6(0xde)]||_0xf6ffa6(0x168)+_0xacd273,'journeyId':_0x161903,'resolvedRule':_0x15c6c5,'parentId':_0x2dfaad[_0xf6ffa6(0x14d)],'folderId':_0x2dfaad[_0xf6ffa6(0x173)]||''},_0xcb70ba);_0xe758c8[_0xf6ffa6(0x13e)](_0xacd273,_0x41d1de),_0x324279[_0xf6ffa6(0xf2)][_0xf6ffa6(0x13e)](_0xacd273,_0x41d1de),_0x1e62b3['onProgress']?.({'type':_0xf6ffa6(0x114),'journeyName':_0x542093[_0xf6ffa6(0xd1)]['name'],'segmentName':_0xacd273});}const _0x31bd80=new Map();for(const [_0x363d25,_0x2b2b6b]of _0x56156d){_0x1e62b3[_0xf6ffa6(0x1a2)]?.({'type':_0xf6ffa6(0x166),'journeyName':_0x542093[_0xf6ffa6(0xd1)][_0xf6ffa6(0xc3)],'activationName':_0x363d25});const _0x416c14=await _0x2667b2(_0x2b2b6b,_0x324279[_0xf6ffa6(0x163)]),_0x44ab34={..._0x416c14,..._0x2b2b6b[_0xf6ffa6(0x152)]!==undefined&&{'runAfterJourneyRefresh':_0x2b2b6b[_0xf6ffa6(0x152)]}},_0x3541ce=await _0x522322['journey'][_0xf6ffa6(0x100)](_0x161903,_0x44ab34);_0x31bd80[_0xf6ffa6(0x13e)](_0x363d25,_0x3541ce['id']),_0x20874e[_0xf6ffa6(0x103)][_0xf6ffa6(0x13e)](_0x363d25,_0x3541ce['id']),_0x1e62b3[_0xf6ffa6(0x1a2)]?.({'type':_0xf6ffa6(0x146),'journeyName':_0x542093[_0xf6ffa6(0xd1)][_0xf6ffa6(0xc3)],'activationName':_0x363d25});}const _0x4576a1=JSON[_0xf6ffa6(0x120)](JSON[_0xf6ffa6(0x17c)](_0x4bc165));return _0x4576a1['id']=_0x161903,ensureJourneyDefaults(_0x4576a1['attributes']),resolvePendingIdsInRequest(_0x4576a1,_0x4bc165,_0x2a0a58,_0xe758c8,_0x31bd80,_0x1e62b3),await _0x522322[_0xf6ffa6(0x1ab)][_0xf6ffa6(0x14e)](_0x161903,_0x4576a1),deletePushRecovery(_0x542093[_0xf6ffa6(0x111)]),{'action':_0xf6ffa6(0x14b),'journeyId':_0x161903,'embeddedSegmentNameToId':_0xe758c8};}export function stripWaitStepPendingIds(_0x2fe5ac){const _0x7ebccf=a142_0x11892d,_0x2e9b0d=_0x2fe5ac[_0x7ebccf(0xc2)]&&isPendingSegmentId(_0x2fe5ac['conditionSegmentId']),_0x45d5d2=_0x2fe5ac['conditions']?.['some'](_0x561a6c=>_0x561a6c[_0x7ebccf(0xd6)]&&isPendingSegmentId(_0x561a6c[_0x7ebccf(0xd6)]));(_0x2e9b0d||_0x45d5d2)&&(_0x2fe5ac['waitStepType']=_0x7ebccf(0x102),_0x2fe5ac[_0x7ebccf(0xfc)]=0x1,_0x2fe5ac[_0x7ebccf(0x177)]=_0x7ebccf(0xfa),delete _0x2fe5ac[_0x7ebccf(0xc2)],delete _0x2fe5ac[_0x7ebccf(0x122)],delete _0x2fe5ac['conditionTimeoutUnit'],delete _0x2fe5ac[_0x7ebccf(0x130)]);}export function resolveWaitStepPendingIds(_0x2cd7fa,_0x5b922c,_0x3dd0b4,_0x20a609){const _0x1f128b=a142_0x11892d;if(_0x5b922c[_0x1f128b(0xc2)]&&isPendingSegmentId(_0x5b922c[_0x1f128b(0xc2)])){const _0x53ed46=_0x3dd0b4(_0x5b922c[_0x1f128b(0xc2)],_0x1f128b(0xfb)+_0x20a609+_0x1f128b(0xeb));_0x53ed46&&(_0x2cd7fa[_0x1f128b(0x10d)]='Condition',_0x2cd7fa['conditionSegmentId']=_0x53ed46,delete _0x2cd7fa[_0x1f128b(0xfc)],delete _0x2cd7fa[_0x1f128b(0x177)],_0x5b922c[_0x1f128b(0x122)]!==undefined&&(_0x2cd7fa[_0x1f128b(0x122)]=_0x5b922c[_0x1f128b(0x122)]),_0x5b922c[_0x1f128b(0x1b7)]&&(_0x2cd7fa['conditionTimeoutUnit']=_0x5b922c[_0x1f128b(0x1b7)]));}if(_0x5b922c['conditions']){const _0x334091=_0x5b922c[_0x1f128b(0x130)][_0x1f128b(0x17d)](_0x28ffe0=>_0x28ffe0[_0x1f128b(0xd6)]&&isPendingSegmentId(_0x28ffe0[_0x1f128b(0xd6)]));if(_0x334091){const _0x4e85e1=_0x5b922c[_0x1f128b(0x130)][_0x1f128b(0xc7)](_0x325456=>{const _0x2cd2f0=_0x1f128b;if(_0x325456[_0x2cd2f0(0xd6)]&&isPendingSegmentId(_0x325456[_0x2cd2f0(0xd6)])){const _0x1bec2f=_0x3dd0b4(_0x325456[_0x2cd2f0(0xd6)],_0x2cd2f0(0xfb)+_0x20a609+_0x2cd2f0(0xeb));return{..._0x325456,'segmentId':_0x1bec2f||_0x325456[_0x2cd2f0(0xd6)]};}return{..._0x325456};});_0x2cd7fa[_0x1f128b(0x10d)]=_0x1f128b(0x121),_0x2cd7fa[_0x1f128b(0x130)]=_0x4e85e1,delete _0x2cd7fa[_0x1f128b(0xfc)],delete _0x2cd7fa[_0x1f128b(0x177)],delete _0x2cd7fa['conditionSegmentId'],delete _0x2cd7fa[_0x1f128b(0x122)],delete _0x2cd7fa['conditionTimeoutUnit'];}}}function stripPendingIds(_0x45db40){const _0x4768d7=a142_0x11892d;_0x45db40[_0x4768d7(0x18c)][_0x4768d7(0x1a6)]?.[_0x4768d7(0xd6)]&&isPendingSegmentId(_0x45db40[_0x4768d7(0x18c)][_0x4768d7(0x1a6)][_0x4768d7(0xd6)])&&delete _0x45db40[_0x4768d7(0x18c)][_0x4768d7(0x1a6)];for(const _0x409ec3 of _0x45db40['attributes'][_0x4768d7(0x186)]||[]){_0x409ec3[_0x4768d7(0x1a3)]?.['segmentId']&&isPendingSegmentId(_0x409ec3[_0x4768d7(0x1a3)][_0x4768d7(0xd6)])&&delete _0x409ec3[_0x4768d7(0x1a3)];_0x409ec3[_0x4768d7(0x171)]?.[_0x4768d7(0xd6)]&&isPendingSegmentId(_0x409ec3[_0x4768d7(0x171)][_0x4768d7(0xd6)])&&delete _0x409ec3[_0x4768d7(0x171)];_0x409ec3[_0x4768d7(0xbf)]&&(_0x409ec3[_0x4768d7(0xbf)]=_0x409ec3['exitCriterias'][_0x4768d7(0x15c)](_0xb25fe5=>!_0xb25fe5[_0x4768d7(0xd6)]||!isPendingSegmentId(_0xb25fe5[_0x4768d7(0xd6)])));if(_0x409ec3[_0x4768d7(0x18f)])for(const _0x346158 of Object[_0x4768d7(0x1b6)](_0x409ec3[_0x4768d7(0x18f)])){const _0x396a49=_0x409ec3[_0x4768d7(0x18f)][_0x346158];_0x396a49[_0x4768d7(0x11c)]===_0x4768d7(0x10f)&&_0x396a49['journeyActivationStepId']&&isPendingActivationId(_0x396a49[_0x4768d7(0xe6)])&&(_0x396a49['journeyActivationStepId']='');if(_0x396a49['type']===_0x4768d7(0x14c)&&_0x396a49[_0x4768d7(0x165)])for(const _0x4620ac of _0x396a49[_0x4768d7(0x165)]){_0x4620ac[_0x4768d7(0xd6)]&&isPendingSegmentId(_0x4620ac[_0x4768d7(0xd6)])&&(_0x4620ac['segmentId']='');}_0x396a49[_0x4768d7(0x11c)]==='WaitStep'&&stripWaitStepPendingIds(_0x396a49);}}}function resolvePendingIdsInRequest(_0x497ae0,_0x132b1f,_0x451716,_0x381bd5,_0x39d5ec,_0x3543a0){const _0x1300d7=a142_0x11892d,_0x3efd91=(_0x59c58b,_0x1ab5c0)=>{const _0x5c855b=a142_0x1405;if(!isPendingSegmentId(_0x59c58b))return _0x59c58b;const _0x4457b9=extractPendingSegmentName(_0x59c58b),_0x3cdc97=_0x381bd5[_0x5c855b(0x1aa)](_0x4457b9);return!_0x3cdc97&&_0x3543a0[_0x5c855b(0x1b3)]?.(_0x5c855b(0xd4)+_0x4457b9+_0x5c855b(0x148)+_0x1ab5c0),_0x3cdc97;};if(_0x497ae0[_0x1300d7(0x18c)][_0x1300d7(0x1a6)]?.[_0x1300d7(0xd6)]&&isPendingSegmentId(_0x497ae0['attributes'][_0x1300d7(0x1a6)][_0x1300d7(0xd6)])){const _0x2dd6f7=_0x3efd91(_0x497ae0[_0x1300d7(0x18c)][_0x1300d7(0x1a6)]['segmentId'],_0x1300d7(0x15f));_0x2dd6f7&&(_0x497ae0[_0x1300d7(0x18c)][_0x1300d7(0x1a6)]['segmentId']=_0x2dd6f7);}for(const _0x5a4f93 of _0x497ae0[_0x1300d7(0x18c)][_0x1300d7(0x186)]||[]){const _0x530fb0=_0x451716['get'](_0x5a4f93[_0x1300d7(0xc3)][_0x1300d7(0x13d)]());_0x530fb0&&(_0x5a4f93['id']=_0x530fb0);if(_0x5a4f93[_0x1300d7(0x1a3)]?.[_0x1300d7(0xd6)]&&isPendingSegmentId(_0x5a4f93[_0x1300d7(0x1a3)][_0x1300d7(0xd6)])){const _0xf49d=_0x3efd91(_0x5a4f93[_0x1300d7(0x1a3)][_0x1300d7(0xd6)],_0x1300d7(0xfb)+_0x5a4f93[_0x1300d7(0xc3)]+_0x1300d7(0x19b));_0xf49d&&(_0x5a4f93['entryCriteria']['segmentId']=_0xf49d);}if(_0x5a4f93[_0x1300d7(0xbf)])for(const _0x50f7c2 of _0x5a4f93[_0x1300d7(0xbf)]){if(_0x50f7c2['segmentId']&&isPendingSegmentId(_0x50f7c2[_0x1300d7(0xd6)])){const _0x1e7e10=_0x3efd91(_0x50f7c2[_0x1300d7(0xd6)],_0x1300d7(0xfb)+_0x5a4f93[_0x1300d7(0xc3)]+'\x27\x20exit\x20criteria');_0x1e7e10&&(_0x50f7c2['segmentId']=_0x1e7e10);}}if(_0x5a4f93[_0x1300d7(0x171)]?.[_0x1300d7(0xd6)]&&isPendingSegmentId(_0x5a4f93['milestone'][_0x1300d7(0xd6)])){const _0x4f2863=_0x3efd91(_0x5a4f93[_0x1300d7(0x171)][_0x1300d7(0xd6)],_0x1300d7(0xfb)+_0x5a4f93[_0x1300d7(0xc3)]+_0x1300d7(0x138));_0x4f2863&&(_0x5a4f93['milestone']['segmentId']=_0x4f2863);}if(_0x5a4f93[_0x1300d7(0x18f)]){const _0x359b6b=_0x10e031=>_0x132b1f[_0x1300d7(0x18c)]['journeyStages']?.['find'](_0x8191c3=>_0x8191c3[_0x1300d7(0xc3)][_0x1300d7(0x13d)]()===_0x5a4f93[_0x1300d7(0xc3)][_0x1300d7(0x13d)]())?.[_0x1300d7(0x18f)]?.[_0x10e031];for(const _0x32702a of Object[_0x1300d7(0x1b6)](_0x5a4f93[_0x1300d7(0x18f)])){const _0x4a6b27=_0x5a4f93['steps'][_0x32702a],_0x55403d=_0x359b6b(_0x32702a);if(_0x4a6b27[_0x1300d7(0x11c)]==='Activation'&&_0x4a6b27['journeyActivationStepId']&&(isPendingActivationId(_0x4a6b27[_0x1300d7(0xe6)])||_0x4a6b27[_0x1300d7(0xe6)]==='')){if(_0x55403d?.['journeyActivationStepId']&&isPendingActivationId(_0x55403d[_0x1300d7(0xe6)])){const _0x79284f=extractPendingActivationName(_0x55403d[_0x1300d7(0xe6)]),_0x57d3d7=_0x39d5ec[_0x1300d7(0x1aa)](_0x79284f);_0x57d3d7&&(_0x4a6b27['journeyActivationStepId']=_0x57d3d7);}}if(_0x4a6b27[_0x1300d7(0x11c)]===_0x1300d7(0x14c)&&_0x4a6b27[_0x1300d7(0x165)]&&_0x55403d?.['branches'])for(let _0x47ddab=0x0;_0x47ddab<_0x4a6b27[_0x1300d7(0x165)][_0x1300d7(0x12a)];_0x47ddab++){const _0x5a061e=_0x4a6b27[_0x1300d7(0x165)][_0x47ddab],_0x19b01a=_0x55403d['branches'][_0x47ddab];if(_0x19b01a?.[_0x1300d7(0xd6)]&&isPendingSegmentId(_0x19b01a[_0x1300d7(0xd6)])){const _0x526023=_0x3efd91(_0x19b01a[_0x1300d7(0xd6)],_0x1300d7(0xfb)+_0x5a4f93[_0x1300d7(0xc3)]+_0x1300d7(0x1af)+(_0x5a061e[_0x1300d7(0xc3)]||_0x47ddab)+'\x27');_0x526023&&(_0x5a061e[_0x1300d7(0xd6)]=_0x526023);}}_0x4a6b27[_0x1300d7(0x11c)]===_0x1300d7(0xe5)&&_0x55403d?.[_0x1300d7(0x11c)]===_0x1300d7(0xe5)&&resolveWaitStepPendingIds(_0x4a6b27,_0x55403d,_0x3efd91,_0x5a4f93[_0x1300d7(0xc3)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x441ef6,_0x184b9e){const _0x13fc48=a143_0x481b,_0x4740f7=_0x441ef6();while(!![]){try{const _0x4db8ba=parseInt(_0x13fc48(0x125))/0x1*(parseInt(_0x13fc48(0x119))/0x2)+parseInt(_0x13fc48(0x11d))/0x3*(-parseInt(_0x13fc48(0x11f))/0x4)+-parseInt(_0x13fc48(0x118))/0x5+parseInt(_0x13fc48(0x114))/0x6*(-parseInt(_0x13fc48(0x11e))/0x7)+-parseInt(_0x13fc48(0x117))/0x8*(-parseInt(_0x13fc48(0x122))/0x9)+-parseInt(_0x13fc48(0x11a))/0xa+parseInt(_0x13fc48(0x123))/0xb*(parseInt(_0x13fc48(0x115))/0xc);if(_0x4db8ba===_0x184b9e)break;else _0x4740f7['push'](_0x4740f7['shift']());}catch(_0x189711){_0x4740f7['push'](_0x4740f7['shift']());}}}(a143_0x3a0b,0x768fb));export function buildFolderIdToPathMap(_0x178927){const _0x233eef=a143_0x481b,_0x905ce2=new Map(),_0x258def=new Map();for(const _0x436967 of _0x178927){_0x258def[_0x233eef(0x121)](_0x436967['id'],_0x436967);}const _0x4e04f4=new Set();for(const _0x3a13a4 of _0x178927){!_0x3a13a4['parentFolderId']&&_0x4e04f4[_0x233eef(0x116)](_0x3a13a4['id']);}function _0x3d4ab2(_0x49aee9){const _0x1f7234=_0x233eef;if(_0x905ce2[_0x1f7234(0x11c)](_0x49aee9['id']))return _0x905ce2['get'](_0x49aee9['id']);if(_0x4e04f4['has'](_0x49aee9['id']))return _0x905ce2[_0x1f7234(0x121)](_0x49aee9['id'],''),'';if(_0x49aee9[_0x1f7234(0x11b)]){const _0x266677=_0x258def[_0x1f7234(0x124)](_0x49aee9[_0x1f7234(0x11b)]);if(_0x266677){const _0x2dce6c=_0x3d4ab2(_0x266677),_0xd02d2f=_0x2dce6c?_0x2dce6c+'/'+_0x49aee9['name']:_0x49aee9[_0x1f7234(0x120)];return _0x905ce2[_0x1f7234(0x121)](_0x49aee9['id'],_0xd02d2f),_0xd02d2f;}}const _0xcbcb68=_0x49aee9[_0x1f7234(0x120)];return _0x905ce2['set'](_0x49aee9['id'],_0xcbcb68),_0xcbcb68;}for(const _0x3759b8 of _0x178927){_0x3d4ab2(_0x3759b8);}return _0x905ce2;}export function buildFolderPathToIdMap(_0x4ec55a){const _0x31e323=a143_0x481b,_0x5fdd8=new Map(),_0xe1e42b=new Map();for(const _0x4d34c5 of _0x4ec55a){_0xe1e42b[_0x31e323(0x121)](_0x4d34c5['id'],_0x4d34c5);}const _0x1b93a8=new Set();for(const _0x1784c7 of _0x4ec55a){!_0x1784c7[_0x31e323(0x11b)]&&_0x1b93a8[_0x31e323(0x116)](_0x1784c7['id']);}function _0x46cb27(_0x583a4a){const _0x462b9d=_0x31e323;if(_0x1b93a8[_0x462b9d(0x11c)](_0x583a4a['id']))return'';if(_0x583a4a[_0x462b9d(0x11b)]){const _0x21ef59=_0xe1e42b[_0x462b9d(0x124)](_0x583a4a[_0x462b9d(0x11b)]);if(_0x21ef59){const _0x221271=_0x46cb27(_0x21ef59);return _0x221271?_0x221271+'/'+_0x583a4a[_0x462b9d(0x120)]:_0x583a4a[_0x462b9d(0x120)];}}return _0x583a4a[_0x462b9d(0x120)];}for(const _0x2c1a72 of _0x4ec55a){const _0x86f8f6=_0x46cb27(_0x2c1a72);_0x5fdd8[_0x31e323(0x121)](_0x86f8f6,_0x2c1a72['id']);}return _0x5fdd8;}function a143_0x3a0b(){const _0x1d28d6=['12QnZboN','12rjVerd','add','8gtzzqa','2649355UMclBj','9398JVemfj','8287940xcZEWo','parentFolderId','has','1026444YlCMDz','561918DonKOo','4ijCzHM','name','set','1677069csDiSV','16220523GdMQOc','get','146BxbWhJ'];a143_0x3a0b=function(){return _0x1d28d6;};return a143_0x3a0b();}export function buildFolderMaps(_0x12e5ee){const _0x2668f9=buildFolderIdToPathMap(_0x12e5ee),_0x3c4c55=new Map();for(const [_0x56d58b,_0x3d830a]of _0x2668f9){_0x3c4c55['set'](_0x3d830a,_0x56d58b);}return{'idToPath':_0x2668f9,'pathToId':_0x3c4c55};}function a143_0x481b(_0x100775,_0x522f97){_0x100775=_0x100775-0x114;const _0x3a0b7b=a143_0x3a0b();let _0x481b91=_0x3a0b7b[_0x100775];return _0x481b91;}export function getFolderPath(_0x533002,_0x55d849){const _0x15063c=a143_0x481b;if(!_0x533002)return'';return _0x55d849[_0x15063c(0x124)](_0x533002)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a144_0x49d1(){const _0x51e855=['Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','name','parse','test','join','type','229208acfoJC','parent_segment','19502989hcDSia','split','12aCICbA','trim','relative','raw','isAbsolute','push','10740kogWLs','dirname','648QwXJoP','resolve','readFile','length','pop','endsWith','journey','startsWith','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','filter','tdx.json','segments','Path\x20attempts\x20to\x20navigate\x20above\x20root','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','.yml','File\x20not\x20found:\x20','10YoAwfD','75375UGcLlN','segment','2260053uUSUpj','665928SxNjtj','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','root','Relative\x20path\x20cannot\x20be\x20empty','.yaml','slice','Path\x20segment\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','30vsyVdh','exists','2944896OYyzVc'];a144_0x49d1=function(){return _0x51e855;};return a144_0x49d1();}(function(_0x43cd14,_0x39ef7c){const _0x3c361e=a144_0x54a8,_0xc1d605=_0x43cd14();while(!![]){try{const _0x4e0809=-parseInt(_0x3c361e(0x93))/0x1*(parseInt(_0x3c361e(0xab))/0x2)+-parseInt(_0x3c361e(0x95))/0x3+-parseInt(_0x3c361e(0xb3))/0x4*(-parseInt(_0x3c361e(0xb1))/0x5)+parseInt(_0x3c361e(0x9e))/0x6*(-parseInt(_0x3c361e(0xa7))/0x7)+-parseInt(_0x3c361e(0xa0))/0x8+-parseInt(_0x3c361e(0x96))/0x9*(-parseInt(_0x3c361e(0xc3))/0xa)+parseInt(_0x3c361e(0xa9))/0xb;if(_0x4e0809===_0x39ef7c)break;else _0xc1d605['push'](_0xc1d605['shift']());}catch(_0x103a59){_0xc1d605['push'](_0xc1d605['shift']());}}}(a144_0x49d1,0x6fb3e));import a144_0x2330de from'path';import{parse as a144_0x25f441}from'yaml';function a144_0x54a8(_0x505cdf,_0x5bf527){_0x505cdf=_0x505cdf-0x93;const _0x49d1f5=a144_0x49d1();let _0x54a854=_0x49d1f5[_0x505cdf];return _0x54a854;}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x51520f){const _0x7acbf5=a144_0x54a8;if(!_0x51520f||_0x51520f[_0x7acbf5(0xac)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x587995=_0x51520f[_0x7acbf5(0xac)]();if(_0x587995==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x51520f};const _0x5bbdc8=_0x587995['startsWith']('/')?_0x587995['substring'](0x1):_0x587995,_0x4abf43=_0x5bbdc8[_0x7acbf5(0xaa)]('/')[_0x7acbf5(0xbc)](_0x5449a8=>_0x5449a8!=='');if(_0x4abf43[_0x7acbf5(0xb6)]===0x0)throw new Error(_0x7acbf5(0x97));const _0x555d9a=_0x587995[_0x7acbf5(0xba)]('/')||!isRelativePathSegment(_0x4abf43[0x0]);for(const _0x2eb8a2 of _0x4abf43){validatePathSegment(_0x2eb8a2);}return{'segments':_0x4abf43,'isAbsolute':_0x555d9a,'raw':_0x51520f};}function isRelativePathSegment(_0x5256d6){return _0x5256d6==='.'||_0x5256d6==='..';}function validatePathSegment(_0x1ac1df){const _0x4438df=a144_0x54a8;if(_0x1ac1df==='')throw new Error(_0x4438df(0x9c));if(_0x1ac1df==='.'||_0x1ac1df==='..')return;if(/[\x00-\x1F\x7F]/[_0x4438df(0xa4)](_0x1ac1df))throw new Error(_0x4438df(0xa1)+_0x1ac1df);if(_0x1ac1df!==_0x1ac1df[_0x4438df(0xac)]()){}}export function validatePath(_0xf2fcb7){const _0x34356d=a144_0x54a8;if(_0xf2fcb7[_0x34356d(0xbe)][_0x34356d(0xb6)]===0x0&&!_0xf2fcb7[_0x34356d(0xaf)])throw new Error(_0x34356d(0x99));if(_0xf2fcb7[_0x34356d(0xaf)]){if(_0xf2fcb7[_0x34356d(0xbe)][0x0]==='..')throw new Error(_0x34356d(0xbb));let _0x22a7b4=0x0;for(const _0x3f7f8d of _0xf2fcb7[_0x34356d(0xbe)]){if(_0x3f7f8d==='..'){if(_0x22a7b4===0x0)throw new Error(_0x34356d(0xbf));_0x22a7b4--;}else _0x3f7f8d!=='.'&&_0x22a7b4++;}}}export function joinPaths(_0x5aaae1,_0x4ac10b){const _0x6345c5=a144_0x54a8;if(!_0x5aaae1||_0x5aaae1==='/')return _0x4ac10b;if(!_0x4ac10b||_0x4ac10b==='.')return _0x5aaae1;if(_0x4ac10b[_0x6345c5(0xba)]('/'))return _0x4ac10b;const _0x4756e2=parsePath(_0x5aaae1),_0x48ef7e=parsePath(_0x4ac10b),_0x53a750=[..._0x4756e2['segments']];for(const _0x59c637 of _0x48ef7e[_0x6345c5(0xbe)]){if(_0x59c637==='.')continue;else{if(_0x59c637==='..'){if(_0x53a750[_0x6345c5(0xb6)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x53a750[_0x6345c5(0xb7)]();}else _0x53a750[_0x6345c5(0xb0)](_0x59c637);}}const _0x3e1cc9=_0x53a750[_0x6345c5(0xa5)]('/');return _0x4756e2[_0x6345c5(0xae)]['startsWith']('/')?'/'+_0x3e1cc9:_0x3e1cc9;}export function normalizePath(_0x3d30c5){const _0x109897=a144_0x54a8,_0x3eed40=parsePath(_0x3d30c5),_0xf48e8=[];for(const _0x2bcb76 of _0x3eed40[_0x109897(0xbe)]){if(_0x2bcb76==='.')continue;else{if(_0x2bcb76==='..'){if(_0xf48e8[_0x109897(0xb6)]===0x0){if(_0x3eed40[_0x109897(0xaf)])throw new Error(_0x109897(0x9d));_0xf48e8[_0x109897(0xb0)]('..');}else _0xf48e8[_0xf48e8[_0x109897(0xb6)]-0x1]==='..'?_0xf48e8[_0x109897(0xb0)]('..'):_0xf48e8[_0x109897(0xb7)]();}else _0xf48e8['push'](_0x2bcb76);}}if(_0xf48e8[_0x109897(0xb6)]===0x0)return _0x3eed40[_0x109897(0xaf)]?'/':'.';const _0x27cb36=_0xf48e8[_0x109897(0xa5)]('/');return _0x3eed40[_0x109897(0xae)]['startsWith']('/')?'/'+_0x27cb36:_0x27cb36;}export function getParentPath(_0x18d21e){const _0x3e0cf9=a144_0x54a8,_0x1da8b7=parsePath(_0x18d21e);if(_0x1da8b7[_0x3e0cf9(0xbe)][_0x3e0cf9(0xb6)]<=0x1)return'/';const _0x3d72f3=_0x1da8b7[_0x3e0cf9(0xbe)][_0x3e0cf9(0x9b)](0x0,-0x1)[_0x3e0cf9(0xa5)]('/');return _0x1da8b7[_0x3e0cf9(0xae)]['startsWith']('/')?'/'+_0x3d72f3:_0x3d72f3;}export function getBaseName(_0x233e39){const _0x41a7ab=a144_0x54a8,_0x4fbf09=parsePath(_0x233e39);return _0x4fbf09[_0x41a7ab(0xbe)][_0x4fbf09[_0x41a7ab(0xbe)][_0x41a7ab(0xb6)]-0x1]||'';}export function isChildPath(_0x493b6f,_0x58a398){const _0x19d4c9=a144_0x54a8,_0x131e83=parsePath(_0x493b6f),_0x5eb1fd=parsePath(_0x58a398);if(_0x131e83[_0x19d4c9(0xbe)][_0x19d4c9(0xb6)]<=_0x5eb1fd['segments']['length'])return![];for(let _0x21ed79=0x0;_0x21ed79<_0x5eb1fd[_0x19d4c9(0xbe)][_0x19d4c9(0xb6)];_0x21ed79++){if(_0x131e83[_0x19d4c9(0xbe)][_0x21ed79]!==_0x5eb1fd[_0x19d4c9(0xbe)][_0x21ed79])return![];}return!![];}export function splitPath(_0x5f3ec5){const _0x4ea25f=a144_0x54a8,_0x5cce47=parsePath(_0x5f3ec5);if(_0x5cce47[_0x4ea25f(0xbe)][_0x4ea25f(0xb6)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x5cce47[_0x4ea25f(0xbe)][_0x4ea25f(0xb6)]===0x1)return{'parent':_0x5cce47[_0x4ea25f(0xbe)][0x0]};return{'parent':_0x5cce47[_0x4ea25f(0xbe)][0x0],'child':_0x5cce47[_0x4ea25f(0xbe)][_0x4ea25f(0x9b)](0x1)['join']('/')};}export function isYamlFilePath(_0x24a772){const _0x1ae994=a144_0x54a8;return _0x24a772[_0x1ae994(0xb8)](_0x1ae994(0xc1))||_0x24a772[_0x1ae994(0xb8)](_0x1ae994(0x9a));}export async function resolveYamlFilePath(_0x4498b5,_0x233e59=nodeFileSystem){const _0x1dda5f=a144_0x54a8,_0xc6ae1=a144_0x2330de[_0x1dda5f(0xb4)](_0x4498b5);if(!await _0x233e59[_0x1dda5f(0x9f)](_0xc6ae1))throw new Error(_0x1dda5f(0xc2)+_0x4498b5);let _0x48a23e=a144_0x2330de[_0x1dda5f(0xb2)](_0xc6ae1),_0x36c05b=null,_0x5c0cb7=null;const _0x296493=a144_0x2330de[_0x1dda5f(0xa3)](_0x48a23e)[_0x1dda5f(0x98)];while(_0x48a23e!==_0x296493){const _0x4bd0f9=a144_0x2330de['join'](_0x48a23e,_0x1dda5f(0xbd));if(await _0x233e59['exists'](_0x4bd0f9)){_0x36c05b=_0x4bd0f9,_0x5c0cb7=_0x48a23e;break;}_0x48a23e=a144_0x2330de[_0x1dda5f(0xb2)](_0x48a23e);}if(!_0x36c05b||!_0x5c0cb7)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x4498b5+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x5b96ff=await _0x233e59[_0x1dda5f(0xb5)](_0x36c05b),_0x5122fc=JSON['parse'](_0x5b96ff),_0x334b42=_0x5122fc[_0x1dda5f(0xa8)];if(!_0x334b42)throw new Error(_0x1dda5f(0xc0));const _0x3a789d=await _0x233e59[_0x1dda5f(0xb5)](_0xc6ae1),_0x3201e4=a144_0x25f441(_0x3a789d),_0x312870=_0x3201e4[_0x1dda5f(0xa2)];if(!_0x312870)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x4498b5);const _0x3160ed=_0x3201e4[_0x1dda5f(0xa6)]===_0x1dda5f(0xb9)?_0x1dda5f(0xb9):_0x1dda5f(0x94),_0x3a5323=a144_0x2330de[_0x1dda5f(0xad)](_0x5c0cb7,_0xc6ae1),_0x627797=a144_0x2330de[_0x1dda5f(0xb2)](_0x3a5323),_0x370b14=_0x627797==='.'?'':_0x627797['replace'](/\\/g,'/'),_0x1269fe=_0x370b14?_0x334b42+'/'+_0x370b14+'/'+_0x312870:_0x334b42+'/'+_0x312870;return{'parentSegment':_0x334b42,'segmentName':_0x312870,'folderPath':_0x370b14,'fullPath':_0x1269fe,'resourceType':_0x3160ed,'content':_0x3a789d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3f1c16,_0x3c477b){const _0x49a0ce=a145_0x5495,_0x43575a=_0x3f1c16();while(!![]){try{const _0x5b0c4f=parseInt(_0x49a0ce(0x174))/0x1+parseInt(_0x49a0ce(0x16c))/0x2*(parseInt(_0x49a0ce(0x16b))/0x3)+-parseInt(_0x49a0ce(0x169))/0x4+parseInt(_0x49a0ce(0x16d))/0x5*(parseInt(_0x49a0ce(0x176))/0x6)+-parseInt(_0x49a0ce(0x16e))/0x7+-parseInt(_0x49a0ce(0x173))/0x8+-parseInt(_0x49a0ce(0x175))/0x9;if(_0x5b0c4f===_0x3c477b)break;else _0x43575a['push'](_0x43575a['shift']());}catch(_0x4c818e){_0x43575a['push'](_0x43575a['shift']());}}}(a145_0x1475,0xab23b));function a145_0x5495(_0x2722a9,_0x40b0a1){_0x2722a9=_0x2722a9-0x169;const _0x1475fa=a145_0x1475();let _0x549580=_0x1475fa[_0x2722a9];return _0x549580;}function a145_0x1475(){const _0x15dc30=['substring','indexOf','980472expykB','1341955KoszCB','24947865CPTtjg','6VrpioE','107096FrmrcK','.\x20Parent\x20name\x20cannot\x20be\x20empty','897vxVdfI','8968soVutK','6159695mmAflf','2046135fNgezg','Invalid\x20segment\x20reference\x20format:\x20','.\x20Child\x20name\x20cannot\x20be\x20empty'];a145_0x1475=function(){return _0x15dc30;};return a145_0x1475();}export function parseSegmentRef(_0x345171){const _0x40dee6=a145_0x5495,_0xb501e9=_0x345171[_0x40dee6(0x172)]('/');if(_0xb501e9===-0x1)return{'parentId':_0x345171};if(_0xb501e9===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x345171+_0x40dee6(0x16a));const _0x590ff5=_0x345171[_0x40dee6(0x171)](0x0,_0xb501e9),_0x2bc8fc=_0x345171[_0x40dee6(0x171)](_0xb501e9+0x1);if(_0x2bc8fc==='')throw new Error(_0x40dee6(0x16f)+_0x345171+_0x40dee6(0x170));return{'parentId':_0x590ff5,'childId':_0x2bc8fc};}
|