@treasuredata/tdx 0.25.8 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a114_0x4e41d5=a114_0x4671;(function(_0xfd549e,_0x317872){const _0x448653=a114_0x4671,_0x5278d4=_0xfd549e();while(!![]){try{const _0x480316=-parseInt(_0x448653(0x19a))/0x1+parseInt(_0x448653(0x182))/0x2+parseInt(_0x448653(0x16d))/0x3+-parseInt(_0x448653(0x130))/0x4*(parseInt(_0x448653(0x1d7))/0x5)+parseInt(_0x448653(0x1ac))/0x6+-parseInt(_0x448653(0x1e0))/0x7*(-parseInt(_0x448653(0x1ef))/0x8)+-parseInt(_0x448653(0x168))/0x9*(parseInt(_0x448653(0x1c2))/0xa);if(_0x480316===_0x317872)break;else _0x5278d4['push'](_0x5278d4['shift']());}catch(_0x140f41){_0x5278d4['push'](_0x5278d4['shift']());}}}(a114_0x45f0,0x51c51));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';function a114_0x4671(_0x418033,_0x469508){_0x418033=_0x418033-0x124;const _0x45f0da=a114_0x45f0();let _0x467188=_0x45f0da[_0x418033];return _0x467188;}const logger=Logger['of'](a114_0x4e41d5(0x217));export const PENDING_SEGMENT_PREFIX=a114_0x4e41d5(0x218);export const PENDING_ACTIVATION_PREFIX=a114_0x4e41d5(0x203);export function createPendingSegmentId(_0x140472){return''+PENDING_SEGMENT_PREFIX+_0x140472+'__';}export function isPendingSegmentId(_0xc15c06){const _0x254a6c=a114_0x4e41d5;return _0xc15c06['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0xc15c06[_0x254a6c(0x202)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x244226){const _0x40af6c=a114_0x4e41d5;return _0x244226[_0x40af6c(0x186)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x366a86){return''+PENDING_ACTIVATION_PREFIX+_0x366a86+'__';}export function isPendingActivationId(_0x2cc52f){const _0x287c8d=a114_0x4e41d5;return _0x2cc52f[_0x287c8d(0x202)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xdeeb6c){const _0x37a8ea=a114_0x4e41d5;return _0xdeeb6c[_0x37a8ea(0x186)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4f8fdd,_0x11ab8f){const _0x207129=a114_0x4e41d5,_0x11d3d4=_0x4f8fdd+'::'+(_0x11ab8f[_0x207129(0x173)]()||_0x207129(0x1a9)),_0x4fd07f=createHash(_0x207129(0x1b3))[_0x207129(0x1b1)](_0x11d3d4)['digest'](_0x207129(0x196))[_0x207129(0x1c8)](0x0,0xc);return _0x207129(0x12d)+_0x4fd07f;}export function ensureJourneyDefaults(_0x1061a2){const _0x2f3a67=a114_0x4e41d5;!_0x1061a2[_0x2f3a67(0x1a6)]&&(_0x1061a2[_0x2f3a67(0x1a6)]=''),!_0x1061a2['state']&&(_0x1061a2[_0x2f3a67(0x1fa)]='draft');}export function resolveTDFolderPath(_0x3ad855,_0x34390e,_0x111a24){const _0x343199=a114_0x4e41d5;if(!_0x34390e)return _0x3ad855;if(_0x3ad855===_0x111a24||_0x3ad855[_0x343199(0x202)](_0x111a24+'/'))return _0x3ad855;return _0x3ad855?_0x111a24+'/'+_0x3ad855:_0x111a24;}export function addFoldersToCreate(_0x539cc8,_0x2f7ca2,_0x3342a4){const _0x1d12fd=a114_0x4e41d5;if(!_0x539cc8)return;if(_0x2f7ca2['has'](_0x539cc8))return;const _0x35824b=_0x539cc8[_0x1d12fd(0x1f3)]('/');let _0x3c120a='';for(const _0x340e14 of _0x35824b){_0x3c120a=_0x3c120a?_0x3c120a+'/'+_0x340e14:_0x340e14,!_0x2f7ca2[_0x1d12fd(0x18a)](_0x3c120a)&&_0x3342a4[_0x1d12fd(0x1ee)](_0x3c120a);}}import*as a114_0x15ee24 from'yaml';import{readFileSync}from'fs';import a114_0x5e5ff3 from'path';import{isJourneyDef,parseYamlString as a114_0x33d79a,toYamlString as a114_0x1ab3c6,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(_0x57d35f){const _0x3818ea=a114_0x4e41d5;if(Array[_0x3818ea(0x14d)](_0x57d35f))return'['+_0x57d35f[_0x3818ea(0x12c)](_0x3a459e=>stableStringify(_0x3a459e))['join'](',')+']';if(_0x57d35f&&typeof _0x57d35f===_0x3818ea(0x1bd)){const _0xe544c2=_0x57d35f,_0x56115e=Object['keys'](_0xe544c2)[_0x3818ea(0x16e)](),_0x560528=_0x56115e[_0x3818ea(0x12c)](_0x4b3d9b=>'\x22'+_0x4b3d9b+'\x22:'+stableStringify(_0xe544c2[_0x4b3d9b]));return'{'+_0x560528[_0x3818ea(0x1e9)](',')+'}';}const _0x3a8f74=JSON[_0x3818ea(0x1e4)](_0x57d35f);return _0x3a8f74===undefined?'null':_0x3a8f74;}function activationSignature(_0x428e6f){const _0x5055b1=a114_0x4e41d5,_0x215d9e={'connection':_0x428e6f[_0x5055b1(0x1b9)],..._0x428e6f['all_columns']!==undefined&&{'all_columns':_0x428e6f[_0x5055b1(0x1c1)]},..._0x428e6f[_0x5055b1(0x1eb)]!==undefined&&{'columns':_0x428e6f['columns']},..._0x428e6f[_0x5055b1(0x20d)]!==undefined&&{'behavior':_0x428e6f[_0x5055b1(0x20d)]},..._0x428e6f[_0x5055b1(0x1dd)]!==undefined&&{'schedule':_0x428e6f['schedule']},..._0x428e6f['notification']!==undefined&&{'notification':_0x428e6f[_0x5055b1(0x222)]},..._0x428e6f[_0x5055b1(0x1fb)]!==undefined&&{'connector_config':_0x428e6f['connector_config']},..._0x428e6f[_0x5055b1(0x17b)]!==undefined&&{'activation_template_id':_0x428e6f[_0x5055b1(0x17b)]}};return stableStringify(_0x215d9e);}async function fetchSegment(_0x5342bc,_0x3bbf37,_0x491569,_0x15e3af){const _0x5b1825=a114_0x4e41d5,_0x2afb3a=_0x15e3af?.['find'](_0x46c7ba=>_0x46c7ba['id']===_0x491569);if(_0x2afb3a)return _0x2afb3a;try{return await _0x5342bc[_0x5b1825(0x1a9)]['getSegment'](_0x3bbf37,_0x491569);}catch(_0x40353c){logger[_0x5b1825(0x192)](_0x5b1825(0x175)+_0x491569+_0x5b1825(0x144)+_0x40353c);try{return await _0x5342bc['segment'][_0x5b1825(0x1d4)](_0x491569);}catch(_0x1490bf){return logger[_0x5b1825(0x192)](_0x5b1825(0x1cf)+_0x491569+':\x20'+_0x1490bf),null;}}}function recoverSegmentIdsFromPushRecovery(_0x119e49,_0x3c2ce3,_0x472f64){const _0x48e346=a114_0x4e41d5,_0x46e70e=readPushRecovery(_0x119e49[_0x48e346(0x124)]);if(_0x46e70e?.[_0x48e346(0x14b)]===_0x119e49[_0x48e346(0x1b8)][_0x48e346(0x127)])for(const [_0x558ccb,_0x27239d]of Object[_0x48e346(0x1ae)](_0x46e70e[_0x48e346(0x193)])){const _0x430af5=generateDeterministicJourneySegmentName(_0x119e49['yamlConfig'][_0x48e346(0x127)],_0x558ccb);_0x27239d[_0x48e346(0x140)]===_0x430af5&&(_0x3c2ce3[_0x48e346(0x15a)](_0x558ccb,_0x27239d['segmentId']),_0x472f64[_0x48e346(0x15a)](_0x558ccb,_0x27239d['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x8898e4,_0x1c7d73,_0x3dcb94,_0x2f179b){const _0x279d88=a114_0x4e41d5;let _0x35f5e8;try{_0x35f5e8=await _0x8898e4[_0x279d88(0x1a9)]['createJourneySegment']({'name':_0x3dcb94[_0x279d88(0x169)],'description':_0x3dcb94[_0x279d88(0x1a6)],'journeyId':_0x3dcb94['journeyId'],'rule':_0x2f179b(_0x3dcb94[_0x279d88(0x160)],!![]),'countPopulation':!![],'parentFolderId':_0x3dcb94[_0x279d88(0x201)],'audienceId':_0x3dcb94[_0x279d88(0x128)]});}catch(_0x223549){const _0x55fad0=_0x223549 instanceof Error&&_0x223549[_0x279d88(0x213)]['includes'](_0x279d88(0x1d1));if(_0x55fad0){const _0x14a446=readPushRecovery(_0x1c7d73['absolutePath']),_0x59d873=_0x14a446?.[_0x279d88(0x14b)]===_0x1c7d73[_0x279d88(0x1b8)]['name']?_0x14a446['segments'][_0x3dcb94['localName']]:undefined;if(_0x59d873?.['uniqueServerName']===_0x3dcb94[_0x279d88(0x169)])await _0x8898e4[_0x279d88(0x1a9)]['updateSegmentById'](_0x3dcb94[_0x279d88(0x128)],_0x59d873[_0x279d88(0x187)],{'description':_0x3dcb94['description'],'rule':_0x2f179b(_0x3dcb94[_0x279d88(0x160)],!![]),'countPopulation':!![]}),_0x35f5e8=_0x59d873[_0x279d88(0x187)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x279d88(0x19f)+_0x3dcb94[_0x279d88(0x1f7)]+_0x279d88(0x181)+(_0x279d88(0x21a)+_0x1c7d73[_0x279d88(0x124)]['replace'](/([^/]+)$/,_0x279d88(0x1d8))+')\x20')+_0x279d88(0x188),_0x223549);}else throw _0x223549;}return saveSegmentToPushRecovery(_0x1c7d73[_0x279d88(0x124)],_0x1c7d73['yamlConfig']['name'],_0x3dcb94['localName'],{'segmentId':_0x35f5e8,'uniqueServerName':_0x3dcb94[_0x279d88(0x169)],'createdAt':new Date()[_0x279d88(0x1c6)]()}),_0x35f5e8;}export async function prepareSegmentFiles(_0x2b8348,_0x2a994d,_0x4b39f4,_0x53184e,_0x1cae6a){const _0x195901=a114_0x4e41d5,{activationDefToCreateRequest:_0x48d074}=await import(_0x195901(0x209)),_0x2042a3=[],_0x3683ea=new Set();for(const {yamlConfig:_0x5a695c,folderPath:_0x4a84d6,sourcePath:_0x1a227b}of _0x2b8348){const _0x3266e1=resolveTDFolderPath(_0x4a84d6,_0x53184e,_0x1cae6a),_0x54c09d=_0x3266e1+':'+_0x5a695c[_0x195901(0x127)],_0x2bd4ff=_0x2a994d[_0x195901(0x149)][_0x195901(0x15d)](_0x54c09d),_0x260480=_0x2bd4ff?_0x2a994d[_0x195901(0x1da)][_0x195901(0x15d)](_0x2bd4ff['id'])||[]:[];addFoldersToCreate(_0x3266e1,_0x2a994d[_0x195901(0x1a5)],_0x3683ea);const _0x1ca8a4=calculateActivationActions(_0x5a695c[_0x195901(0x20b)]||[],_0x260480,_0x2a994d[_0x195901(0x21d)],_0x2a994d[_0x195901(0x159)]);for(const _0x52d40d of _0x1ca8a4){(_0x52d40d[_0x195901(0x18d)]===_0x195901(0x1ca)||_0x52d40d[_0x195901(0x18d)]===_0x195901(0x1b1))&&_0x52d40d[_0x195901(0x21f)]&&(_0x52d40d[_0x195901(0x1c4)]=await _0x48d074(_0x52d40d[_0x195901(0x21f)],_0x4b39f4));}const _0x4a8075=calculateSegmentDiff(_0x5a695c,_0x2bd4ff,_0x260480,_0x2a994d[_0x195901(0x21d)],_0x2a994d[_0x195901(0x159)]);_0x2042a3['push']({'relativePath':_0x5a695c['name'],'absolutePath':_0x1a227b,'yamlConfig':_0x5a695c,'folderPath':_0x3266e1,'existingSegment':_0x2bd4ff,'existingActivations':_0x260480,'isNew':_0x4a8075[_0x195901(0x197)],'hasChanges':_0x4a8075['hasChanges'],'diff':_0x4a8075['diff'],'activationActions':_0x1ca8a4});}return{'segmentFiles':_0x2042a3,'foldersToCreate':_0x3683ea};}export async function prepareJourneyFiles(_0x17869f,_0x6318e0,_0x4d00b0,_0x25db3f){const _0xdc5dbb=a114_0x4e41d5,_0x532b3b=[],_0x2580f3=new Set();for(const {yamlConfig:_0x549c00,folderPath:_0x4a7c5c,sourcePath:_0x3e609f}of _0x17869f){const _0x391b4d=resolveTDFolderPath(_0x4a7c5c,_0x4d00b0,_0x25db3f),_0x2e26ae=_0x391b4d+':'+_0x549c00['name'],_0x1718b3=_0x6318e0[_0xdc5dbb(0x1df)][_0xdc5dbb(0x15d)](_0x2e26ae);let _0x1dba72,_0x20627c;if(_0x1718b3&&_0x1718b3[_0xdc5dbb(0x1f6)]>0x0){const _0x41e3d1=buildLocalExpandedRuleMappings(_0x549c00),{createYamlContext:_0x56908c,prefetchJourneySegments:_0x46fad6}=createPushYamlContextForBundle(_0x6318e0[_0xdc5dbb(0x132)],_0x6318e0[_0xdc5dbb(0x128)],_0x6318e0[_0xdc5dbb(0x1c5)],_0x41e3d1,_0x6318e0[_0xdc5dbb(0x21d)],_0x6318e0['connectionIdToNameMap'],_0x6318e0[_0xdc5dbb(0x1c9)],_0x6318e0[_0xdc5dbb(0x1b7)]);await _0x46fad6(_0x1718b3['map'](_0x5087f7=>_0x5087f7['id']));const _0x4c5307=hasMultipleVersions(_0x549c00),_0x55ca9e=async _0x313a30=>{const _0x48757e=_0xdc5dbb,_0x166e62=_0x6318e0[_0x48757e(0x1b7)]?.['get'](_0x313a30);if(_0x166e62)return _0x166e62;return _0x6318e0['fetchJourney']({'journeyId':_0x313a30,'journeyName':_0x549c00[_0x48757e(0x127)],'isMultiVersion':_0x1718b3['length']>0x1});};if(_0x4c5307&&_0x1718b3[_0xdc5dbb(0x1f6)]>0x1){const _0x2b503f=[];for(const _0x53c56e of _0x1718b3){const _0x5acb55=_0x53c56e[_0xdc5dbb(0x150)]||0x1;_0x6318e0[_0xdc5dbb(0x12f)]?.[_0xdc5dbb(0x1b1)]('Fetching\x20'+_0x549c00['name']+'\x20v'+_0x5acb55);const _0x291584=await _0x55ca9e(_0x53c56e['id']),_0x5470e2=_0x56908c(_0x53c56e['id']),_0x22dd98=await journeyResponseToDef(_0x291584,_0x5470e2);_0x2b503f[_0xdc5dbb(0x164)]({'item':_0x53c56e,'yaml':_0x22dd98});}const _0x1105ea=buildLocalRuleToNameMappingFromJourney(_0x549c00);_0x20627c=buildMergedJourneyDef(_0x2b503f,_0x1105ea);const _0x44cb32=Math[_0xdc5dbb(0x16a)](..._0x2b503f[_0xdc5dbb(0x12c)](_0x2b0434=>_0x2b0434['item'][_0xdc5dbb(0x150)]||0x0)),_0x405926=_0x1718b3[_0xdc5dbb(0x21b)](_0x294ebc=>(_0x294ebc[_0xdc5dbb(0x150)]||0x0)===_0x44cb32);_0x405926&&(_0x6318e0['progress']?.[_0xdc5dbb(0x1b1)](_0xdc5dbb(0x16b)+_0x549c00[_0xdc5dbb(0x127)]+'\x20v'+_0x44cb32),_0x1dba72=await _0x55ca9e(_0x405926['id']));}else{const _0x21491f=_0x1718b3[_0x1718b3[_0xdc5dbb(0x1f6)]-0x1];_0x6318e0[_0xdc5dbb(0x12f)]?.[_0xdc5dbb(0x1b1)](_0xdc5dbb(0x16b)+_0x549c00[_0xdc5dbb(0x127)]),_0x1dba72=await _0x55ca9e(_0x21491f['id']);const _0x4c42c8=_0x56908c(_0x21491f['id']),_0x1bec1d=await journeyResponseToDef(_0x1dba72,_0x4c42c8),_0x1f5042=buildLocalRuleToNameMappingFromJourney(_0x549c00);_0x20627c=buildMergedJourneyDef([{'item':_0x21491f,'yaml':_0x1bec1d}],_0x1f5042);}}addFoldersToCreate(_0x391b4d,_0x6318e0[_0xdc5dbb(0x1a5)],_0x2580f3);const _0x2dc268=calculateJourneyDiff(_0x549c00,_0x20627c);_0x532b3b[_0xdc5dbb(0x164)]({'relativePath':_0x549c00[_0xdc5dbb(0x127)],'absolutePath':_0x3e609f,'yamlConfig':_0x549c00,'folderPath':_0x391b4d,'existingJourney':_0x1dba72,'isNew':_0x2dc268['isNew'],'hasChanges':_0x2dc268[_0xdc5dbb(0x1a3)],'diff':_0x2dc268[_0xdc5dbb(0x1bc)]});}return{'journeyFiles':_0x532b3b,'foldersToCreate':_0x2580f3};}export function calculateActivationActions(_0x25782d,_0xc809d4,_0x4d3278,_0x5e7970){const _0x1a187a=a114_0x4e41d5,_0x563812=[],_0x2cf6bd=new Map();for(const _0x16e69b of _0xc809d4){_0x2cf6bd[_0x1a187a(0x15a)](_0x16e69b[_0x1a187a(0x127)],_0x16e69b);}const _0x4ea785=new Map();for(const _0x44bfd5 of _0x25782d){_0x4ea785[_0x1a187a(0x15a)](_0x44bfd5[_0x1a187a(0x127)],_0x44bfd5);}for(const _0x25799c of _0x25782d){const _0x2d38e6=_0x2cf6bd['get'](_0x25799c['name']);if(!_0x2d38e6)_0x563812[_0x1a187a(0x164)]({'type':_0x1a187a(0x1ca),'name':_0x25799c[_0x1a187a(0x127)],'yamlActivation':_0x25799c});else{const _0x54d56c=activationResponseToDef(_0x2d38e6,_0x4d3278,_0x5e7970),_0x3ec09e=a114_0x15ee24[_0x1a187a(0x1e4)](_0x54d56c),_0x5e6c7c=a114_0x15ee24['stringify'](_0x25799c);_0x3ec09e!==_0x5e6c7c&&_0x563812['push']({'type':_0x1a187a(0x1b1),'name':_0x25799c[_0x1a187a(0x127)],'yamlActivation':_0x25799c,'existingActivation':_0x2d38e6});}}for(const _0xd015e8 of _0xc809d4){!_0x4ea785[_0x1a187a(0x18a)](_0xd015e8[_0x1a187a(0x127)])&&_0x563812['push']({'type':_0x1a187a(0x1a7),'name':_0xd015e8[_0x1a187a(0x127)],'existingActivation':_0xd015e8});}return _0x563812;}function calculateYamlDiff(_0xd23af,_0x38864b){if(_0x38864b){const _0x345bc4=generateDiff(_0x38864b,_0xd23af),_0x4ab228=hasChanges(_0x345bc4);return{'isNew':![],'hasChanges':_0x4ab228,'diff':_0x4ab228?formatDiffWithColors(_0x345bc4):undefined};}const _0x34a473=generateDiff('',_0xd23af);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x34a473)};}export function calculateSegmentDiff(_0x5197cc,_0x285cca,_0xf7729d,_0x56cf4d,_0x57afb6){const _0x592548=segmentToYamlString(_0x5197cc),_0x2e60a9=_0x285cca?segmentToYamlString(segmentWithActivationsToYaml(_0x285cca,_0xf7729d,undefined,_0x56cf4d,_0x57afb6)):undefined;return calculateYamlDiff(_0x592548,_0x2e60a9);}export function calculateJourneyDiff(_0x4ae2e9,_0x83a9b6){const _0x551e3b=normalizeJourneyDef(_0x4ae2e9,_0x4ae2e9),_0xe7482d=a114_0x1ab3c6(_0x551e3b),_0x240ee1=_0x83a9b6?a114_0x1ab3c6(normalizeJourneyDef(_0x83a9b6,_0x4ae2e9)):undefined;return calculateYamlDiff(_0xe7482d,_0x240ee1);}export function findSegmentsToDelete(_0x29f2e2,_0x53065f,_0x365c91,_0xd4ec08,_0x3e37d0){const _0x574c20=a114_0x4e41d5,_0x69ff33=new Set();for(const {yamlConfig:_0x463ade,folderPath:_0x55c8f6}of _0x53065f){_0x69ff33[_0x574c20(0x1ee)](_0x55c8f6+':'+_0x463ade['name']);}return _0x29f2e2[_0x574c20(0x19b)](_0x4f1e6d=>{const _0x508167=_0x574c20,_0x567d2a=_0x4f1e6d['segmentFolderId']?_0x365c91[_0x508167(0x15d)](_0x4f1e6d[_0x508167(0x1ed)][_0x508167(0x155)]())||'':'',_0x4587ca=_0x567d2a+':'+_0x4f1e6d['name'];if(_0x69ff33[_0x508167(0x18a)](_0x4587ca))return![];if(_0x3e37d0)return _0x567d2a===_0xd4ec08||_0x567d2a['startsWith'](_0xd4ec08+'/');return!![];});}export function findJourneysToDelete(_0x127c44,_0xe6299a,_0x3d1006,_0x2506cd,_0x180398){const _0x4d36d5=a114_0x4e41d5,_0x39254c=new Set();for(const {yamlConfig:_0x518224,folderPath:_0x47a435}of _0xe6299a){_0x39254c[_0x4d36d5(0x1ee)](_0x47a435+':'+_0x518224['name']);}return _0x127c44[_0x4d36d5(0x19b)](_0x58d9d7=>{const _0x20a027=_0x4d36d5,_0x22622b=_0x58d9d7['folderId']?_0x3d1006[_0x20a027(0x15d)](_0x58d9d7['folderId'])||'':'',_0x35963d=_0x22622b+':'+_0x58d9d7[_0x20a027(0x1cc)];if(_0x39254c[_0x20a027(0x18a)](_0x35963d))return![];if(_0x180398)return _0x22622b===_0x2506cd||_0x22622b[_0x20a027(0x202)](_0x2506cd+'/');return!![];});}export function buildSegmentLookupMap(_0x2bef16,_0x411362){const _0x52986d=a114_0x4e41d5,_0x43a1b4=new Map();for(const _0x5a3d8a of _0x2bef16){const _0x16ffee=_0x5a3d8a[_0x52986d(0x1ed)]?_0x411362[_0x52986d(0x15d)](_0x5a3d8a[_0x52986d(0x1ed)][_0x52986d(0x155)]())||'':'',_0xdb5592=_0x16ffee+':'+_0x5a3d8a[_0x52986d(0x127)];_0x43a1b4[_0x52986d(0x15a)](_0xdb5592,_0x5a3d8a);}return _0x43a1b4;}export function buildSegmentNameToIdMap(_0x5944bc){const _0x5438a9=a114_0x4e41d5,_0x3404db=new Map();for(const _0x5dbbb6 of _0x5944bc){_0x3404db[_0x5438a9(0x15a)](_0x5dbbb6[_0x5438a9(0x127)],_0x5dbbb6['id']);}return _0x3404db;}export function buildJourneyBundleLookupMap(_0x3f9fdf,_0x495403){const _0x2150d3=a114_0x4e41d5,_0x1da169=new Map();for(const _0x3a6118 of _0x3f9fdf){const _0x5aefbf=_0x3a6118[_0x2150d3(0x201)]?_0x495403['get'](_0x3a6118[_0x2150d3(0x201)])||'':'',_0x994854=_0x5aefbf+':'+_0x3a6118[_0x2150d3(0x1cc)];!_0x1da169['has'](_0x994854)&&_0x1da169[_0x2150d3(0x15a)](_0x994854,[]),_0x1da169[_0x2150d3(0x15d)](_0x994854)[_0x2150d3(0x164)](_0x3a6118);}for(const _0x57e758 of _0x1da169[_0x2150d3(0x195)]()){_0x57e758[_0x2150d3(0x16e)]((_0x466e52,_0x5acd3b)=>(_0x466e52[_0x2150d3(0x150)]||0x0)-(_0x5acd3b[_0x2150d3(0x150)]||0x0));}return _0x1da169;}export function collectFoldersToCreate(_0x5d4a41,_0x360523){const _0x5b055=a114_0x4e41d5,_0x2c9493=new Set();for(const _0x1e3db3 of _0x5d4a41){if(!_0x1e3db3)continue;if(_0x360523['has'](_0x1e3db3))continue;const _0x348d30=_0x1e3db3[_0x5b055(0x1f3)]('/');let _0x42eb89='';for(const _0x3a2525 of _0x348d30){_0x42eb89=_0x42eb89?_0x42eb89+'/'+_0x3a2525:_0x3a2525,!_0x360523[_0x5b055(0x18a)](_0x42eb89)&&_0x2c9493['add'](_0x42eb89);}}return _0x2c9493;}export function parseAndClassifyYamlFiles(_0x303c5d,_0x5e0003,_0x5edbf9){const _0x4be711=a114_0x4e41d5,_0x2a92b0=[],_0x2f9fe6=[];for(const _0x32dad9 of _0x303c5d){const _0x56ab6b=a114_0x5e5ff3[_0x4be711(0x1f9)](_0x5e0003,a114_0x5e5ff3[_0x4be711(0x161)](_0x32dad9)),_0x2bb0b5=_0x56ab6b==='.'?'':_0x56ab6b,_0xf5f9e8=readFileSync(_0x32dad9,_0x4be711(0x141)),_0x3e4421=a114_0x15ee24[_0x4be711(0x152)](_0xf5f9e8);if(isJourneyDef(_0x3e4421)){const _0x11454f=a114_0x33d79a(_0xf5f9e8);_0x2f9fe6['push']({'yamlConfig':_0x11454f,'folderPath':_0x2bb0b5,'sourcePath':_0x32dad9});}else{if(!_0x5edbf9?.[_0x4be711(0x158)]){const _0x40e9f1=parseSegmentYamlFile(_0xf5f9e8),_0x1fd8a7=normalizeChildSegmentYaml(_0x40e9f1);_0x2a92b0[_0x4be711(0x164)]({'yamlConfig':_0x1fd8a7,'folderPath':_0x2bb0b5,'sourcePath':_0x32dad9});}}}return{'segments':_0x2a92b0,'journeys':_0x2f9fe6};}export function validateParsedFiles(_0x43867c,_0x439e25){const _0x1b1a1b=a114_0x4e41d5,_0x26e481=[];for(const {yamlConfig:_0x19bd4b,sourcePath:_0x39ebf7}of _0x43867c[_0x1b1a1b(0x193)]){const _0x52e352=readFileSync(_0x39ebf7,_0x1b1a1b(0x141)),_0x1bcb68=a114_0x15ee24[_0x1b1a1b(0x12b)](_0x52e352),_0x3a3003=validateSegmentDef(_0x19bd4b,{'source':_0x52e352,'document':_0x1bcb68});if(!_0x3a3003[_0x1b1a1b(0x21c)]){const _0x1e3266=a114_0x5e5ff3[_0x1b1a1b(0x1f9)](_0x439e25,_0x39ebf7);_0x26e481[_0x1b1a1b(0x164)]({'filePath':_0x1e3266,'source':_0x52e352,'result':_0x3a3003,'isJourney':![]});}}for(const {yamlConfig:_0x5b95df,sourcePath:_0x34d4c1}of _0x43867c[_0x1b1a1b(0x17a)]){const _0x7b93c1=readFileSync(_0x34d4c1,'utf-8'),_0x2a32bc=a114_0x15ee24[_0x1b1a1b(0x12b)](_0x7b93c1),_0x2716cd=validateJourneyDef(_0x5b95df,{'source':_0x7b93c1,'document':_0x2a32bc});if(!_0x2716cd['valid']){const _0x148087=a114_0x5e5ff3[_0x1b1a1b(0x1f9)](_0x439e25,_0x34d4c1);_0x26e481[_0x1b1a1b(0x164)]({'filePath':_0x148087,'source':_0x7b93c1,'result':_0x2716cd,'isJourney':!![]});}}return _0x26e481;}export function formatValidationErrors(_0x58ac9c){const _0x5a6705=a114_0x4e41d5,_0x581681=[];for(const {filePath:_0x38e2ea,source:_0x3a3725,result:_0x4a37aa,isJourney:_0x71f9c1}of _0x58ac9c){const _0x34565c=_0x71f9c1?'journey':_0x5a6705(0x1a9);_0x581681[_0x5a6705(0x164)]('\x0a'+_0x38e2ea+'\x20('+_0x34565c+'):\x20'+_0x4a37aa[_0x5a6705(0x214)][_0x5a6705(0x1f6)]+_0x5a6705(0x1f0)),_0x581681[_0x5a6705(0x164)](formatValidationResult(_0x4a37aa,_0x3a3725,_0x38e2ea));}return _0x581681[_0x5a6705(0x1e9)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x35fa14){const _0x30cfeb=a114_0x4e41d5,_0x45d2ba=new Set(),_0x412413=new Map(),_0x53db92=collectSegmentUsageCounts(_0x35fa14);if(_0x35fa14['segments'])for(const [_0x47b8e6,_0x37b620]of Object[_0x30cfeb(0x1ae)](_0x35fa14[_0x30cfeb(0x193)])){_0x45d2ba[_0x30cfeb(0x1ee)](_0x47b8e6);if(_0x37b620[_0x30cfeb(0x136)]){const _0x237439=yamlRuleToApi(_0x37b620[_0x30cfeb(0x136)]),_0x523549=apiRuleToYaml(_0x237439);_0x412413[_0x30cfeb(0x15a)](_0x47b8e6,_0x523549);}}const _0x37e873=new Map();let _0x45a9fe=0x0;for(const [_0x324a31,_0x334fd4]of _0x412413){const _0x20fe90=serializeExpandedRule(_0x334fd4,_0x412413),_0x23f0f5=_0x37e873[_0x30cfeb(0x15d)](_0x20fe90)||[];_0x23f0f5[_0x30cfeb(0x164)]({'name':_0x324a31,'index':_0x45a9fe}),_0x37e873[_0x30cfeb(0x15a)](_0x20fe90,_0x23f0f5),_0x45a9fe++;}const _0x1114db=new Map();for(const [_0x43ae78,_0x2fb5fe]of _0x37e873){const _0x47ab4c=_0x2fb5fe['slice']()[_0x30cfeb(0x16e)]((_0x382d62,_0x25cdb2)=>{const _0x154afd=_0x30cfeb,_0x295cb8=_0x53db92['get'](_0x382d62[_0x154afd(0x127)])||0x0,_0x2cbd40=_0x53db92['get'](_0x25cdb2[_0x154afd(0x127)])||0x0;if(_0x295cb8!==_0x2cbd40)return _0x2cbd40-_0x295cb8;return _0x382d62['index']-_0x25cdb2[_0x154afd(0x1f4)];})[_0x30cfeb(0x12c)](_0x415f7d=>_0x415f7d[_0x30cfeb(0x127)]),_0x1f5ed5=[];for(const _0x29295a of _0x47ab4c){const _0x444617=_0x53db92[_0x30cfeb(0x15d)](_0x29295a)||0x0,_0x58515d=Math['max'](_0x444617,0x1);for(let _0x120af7=0x0;_0x120af7<_0x58515d;_0x120af7++){_0x1f5ed5['push'](_0x29295a);}}_0x1114db['set'](_0x43ae78,_0x1f5ed5);}return{'existingLocalSegmentNames':_0x45d2ba,'localSegmentRules':_0x412413,'localExpandedRuleToNames':_0x1114db};}export function createSegmentIdResolver(_0x41e9f4,_0x53c37b){return async _0x1736af=>{const _0x1777b0=a114_0x4671,_0x462e38=_0x41e9f4['get'](_0x1736af);if(!_0x462e38)throw new SDKError(ErrorCode[_0x1777b0(0x220)],'Segment\x20not\x20found:\x20'+_0x1736af+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x53c37b+'\x27)');return _0x462e38;};}export function extractRootFolderId(_0xe5a881){const _0x5d0ac9=a114_0x4e41d5;return _0xe5a881['relationships']?.[_0x5d0ac9(0x147)]?.[_0x5d0ac9(0x207)]?.['id']||_0xe5a881[_0x5d0ac9(0x174)]?.[_0x5d0ac9(0x1de)]?.[_0x5d0ac9(0x207)]?.['id'];}export function buildConnectionMaps(_0x39aa7e){const _0x10f912=a114_0x4e41d5,_0x354350=new Map(),_0x6e9eac=new Map(),_0x2cac61=new Map();for(const _0x390e9d of _0x39aa7e){_0x354350[_0x10f912(0x15a)](_0x390e9d[_0x10f912(0x127)],parseInt(_0x390e9d['id'],0xa)),_0x6e9eac[_0x10f912(0x15a)](_0x390e9d['id'],_0x390e9d[_0x10f912(0x127)]),_0x2cac61[_0x10f912(0x15a)](_0x390e9d[_0x10f912(0x127)],_0x390e9d[_0x10f912(0x18d)]);}return{'nameToId':_0x354350,'idToName':_0x6e9eac,'nameToType':_0x2cac61};}export function calculatePushStats(_0x5f54b3,_0xeaf3a3,_0x5351a5,_0x18f6a3,_0x107287,_0x13c67d,_0x3a797b){const _0x3f7ae2=a114_0x4e41d5,_0x2972bb=_0x5f54b3['filter'](_0x40ee29=>_0x40ee29['isNew']),_0x382394=_0x5f54b3['filter'](_0x4f1273=>!_0x4f1273[_0x3f7ae2(0x197)]&&_0x4f1273['hasChanges']),_0x3a8f00=_0x5f54b3[_0x3f7ae2(0x19b)](_0x29ef73=>!_0x29ef73[_0x3f7ae2(0x197)]&&!_0x29ef73[_0x3f7ae2(0x1a3)]),_0x513f94=_0x13c67d?_0x18f6a3:[],_0x2fd614=_0xeaf3a3[_0x3f7ae2(0x19b)](_0x99e1e9=>_0x99e1e9[_0x3f7ae2(0x197)]),_0x285073=_0xeaf3a3[_0x3f7ae2(0x19b)](_0x4b4940=>!_0x4b4940[_0x3f7ae2(0x197)]&&_0x4b4940[_0x3f7ae2(0x1a3)]),_0x1e193e=_0xeaf3a3['filter'](_0x368a5a=>!_0x368a5a[_0x3f7ae2(0x197)]&&!_0x368a5a[_0x3f7ae2(0x1a3)]),_0xbe071=_0x13c67d?_0x107287:[],_0x5953f4=_0x5f54b3[_0x3f7ae2(0x1bf)](_0x3192e4=>_0x3192e4[_0x3f7ae2(0x162)]),_0x371d63=_0x5953f4[_0x3f7ae2(0x19b)](_0x1a3580=>_0x1a3580['type']===_0x3f7ae2(0x1ca)),_0xf09d7f=_0x5953f4['filter'](_0x58dd43=>_0x58dd43[_0x3f7ae2(0x18d)]===_0x3f7ae2(0x1b1)),_0x5cccf5=_0x5953f4[_0x3f7ae2(0x19b)](_0x423669=>_0x423669['type']===_0x3f7ae2(0x1a7)),_0x5828e4=Array[_0x3f7ae2(0x15b)](_0x5351a5)[_0x3f7ae2(0x16e)](),_0x3993e5=_0x3a797b?![]:_0x2972bb[_0x3f7ae2(0x1f6)]>0x0||_0x382394['length']>0x0||_0x513f94['length']>0x0,_0x5cc2fd=_0x2fd614[_0x3f7ae2(0x1f6)]>0x0||_0x285073[_0x3f7ae2(0x1f6)]>0x0||_0xbe071[_0x3f7ae2(0x1f6)]>0x0,_0x5a92a4=_0x3a797b?![]:_0x5953f4[_0x3f7ae2(0x1f6)]>0x0,_0x10b429=_0x5828e4[_0x3f7ae2(0x1f6)]>0x0;return{'segments':{'new':_0x2972bb,'changed':_0x382394,'unchanged':_0x3a8f00,'toDelete':_0x513f94},'journeys':{'new':_0x2fd614,'changed':_0x285073,'unchanged':_0x1e193e,'toDelete':_0xbe071},'activations':{'all':_0x5953f4,'toCreate':_0x371d63,'toUpdate':_0xf09d7f,'toDelete':_0x5cccf5},'folders':{'toCreate':_0x5828e4},'counts':{'segments':{'new':_0x2972bb[_0x3f7ae2(0x1f6)],'changed':_0x382394['length'],'unchanged':_0x3a8f00[_0x3f7ae2(0x1f6)],'toDelete':_0x513f94[_0x3f7ae2(0x1f6)]},'journeys':{'new':_0x2fd614['length'],'changed':_0x285073[_0x3f7ae2(0x1f6)],'unchanged':_0x1e193e[_0x3f7ae2(0x1f6)],'toDelete':_0xbe071[_0x3f7ae2(0x1f6)]},'activations':{'create':_0x371d63[_0x3f7ae2(0x1f6)],'update':_0xf09d7f[_0x3f7ae2(0x1f6)],'delete':_0x5cccf5[_0x3f7ae2(0x1f6)]},'folders':_0x5828e4['length']},'hasChanges':_0x3993e5||_0x5cc2fd||_0x5a92a4||_0x10b429};}function a114_0x45f0(){const _0x3b3832=['logInfo','Created\x20segment\x20\x27','Embedded\x20segment\x20\x27','waitStepUnit','resolveJourneyId','existingActivation','hasChanges','some','folderPathToId','description','delete','effectiveFolderId','segment','activation_updated','entryCriteria','16194GcSGGL','Deleting\x20activation\x20\x27','entries','attributes','with','update','segment_created','sha1','createFolder','activation_deleting','conditions','journeyById','yamlConfig','connection','deleteSegment','updated','diff','object','entry_criteria','flatMap','created','all_columns','7350gXOWHV','createdSegmentId','validatedRequest','existingSegments','toISOString','./journey-yaml.js','slice','activationStepsById','create','journey','journeyBundleName','\x27\x20for\x20','activation_created','getSegmentEntity\x20also\x20failed\x20for\x20','waitStepType','Name\x20has\x20already\x20been\x20taken','segment_deleting','decision_point','getSegmentEntity','\x0a\x20\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','1490Rkounz','.$1.push-recovery.json','conditionSegmentId','activationsBySegmentId','deleted','Activation','schedule','parentFolder','journeyBundlesByFolderAndName','7vSLtSp','Created\x20folder\x20\x27','segment_updated','JOURNEY_SYNTAX_ERROR','stringify','journeyActivationNameToId','Updated\x20journey\x20\x27','listActivations','segmentNameToId','join','stages','columns','\x20journey\x20from\x20file:\x20','segmentFolderId','add','2431384EjaEMD','\x20error(s)','\x27\x20milestone','segment_updating','split','index','embedded_segment_creating','length','localName','waitStep','relative','state','connector_config','toLowerCase','Deleted\x20segment\x20\x27','goal','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','existingSegment','folderId','startsWith','__pending_act_','folder_created','Segment\x20not\x20found','activation_updating','data','action','./child-segment-yaml.js','embeddedSegmentNameToId','activations','journeyActivationStepId','behavior','WaitStep','journeyId','steps','logDeleted','logWarning','message','errors','kind','getJourney','tdx.sdk.push-workflow','__pending_','embedded_activation_creating','Delete\x20the\x20push\x20recovery\x20file\x20(','find','valid','idToEmailMap','Updated\x20segment\x20\x27','yamlActivation','SEGMENT_NOT_FOUND','updateActivation','notification','absolutePath','createActivation','resolveSegment','name','parentId','embedded_activation_created','conditionTimeoutUnit','parseDocument','map','journey_entry_criteria_','Condition','progress','3284dVOIdk','existingJourney','deps',').\x20','verbose','../../utils/async.js','rule','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','deleteActivation','\x27\x20wait\x20condition','results','embedded_segment_created','withProgress','INTERNAL','all','Segment\x20not\x20found:\x20','uniqueServerName','utf-8','activation_','SEGMENT_SYNTAX_ERROR',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','getActivation','\x20segment\x20from\x20file:\x20','parentSegmentFolder','activation_creating','segmentByFolderAndName','list','journeyName','unchanged','isArray','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','stage\x20\x27','versionNumber','run_after_journey_refresh','parse','NOT_FOUND','\x27\x20not\x20found\x20in\x20journey\x20\x27','toString','Created\x20activation\x20\x27','goal\x20criteria','skipSegments','connectionIdToNameMap','set','from','size','get','Creating\x20activation\x20\x27','onProgress','resolvedRule','dirname','activationActions','Entry\x20criteria:\x20','push','conditionTimeoutDuration','\x20activation\x20\x27','ACTIVATION_UPDATE_ERROR','747owdPUc','uniqueSegmentName','max','Fetching\x20','Creating\x20segment\x20\x27','364113SSczqf','sort','journey_created','createdSegmentIds','activation_deleted','segment_creating','trim','relationships','getSegment\x20failed\x20for\x20','branches','Failed\x20to\x20resolve\x20activation\x20','\x27\x20exit\x20criteria','logSuccess','journeys','activation_template_id','activationContext','exitCriterias','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','activationParams','Failed\x20to\x20','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','618992JGnuVv','segment_deleted','milestone','\x27\x20decision\x20point\x20branch\x20\x27','replace','segmentId','and\x20the\x20server\x20segment,\x20then\x20retry.','\x27\x20from\x20file:\x20','has','journeyStages','Deleted\x20activation\x20\x27','type','DecisionPoint','updateSegmentById','\x27...','rootFolderId','debug','segments','\x27\x20entry\x20criteria','values','hex','isNew','keys','folderPath','96897tjPQcc','filter','Activation\x20not\x20found:\x20'];a114_0x45f0=function(){return _0x3b3832;};return a114_0x45f0();}export async function buildPushExecutionContext(_0xa0eab6,_0x48db73,_0x49e7d9,_0x3c2a59,_0x3af293,_0x544ec9){const _0xda40a4=a114_0x4e41d5,_0x18dc02=extractRootFolderId(_0x49e7d9),{pathToId:_0x5d561f,idToPath:_0x3201d5}=buildFolderMaps(_0x3af293),_0x14b4e6=buildSegmentNameToIdMap(_0x3c2a59),_0x27c9d8=new Map(),{batchAsync:_0x4154ea}=await import(_0xda40a4(0x135)),[_0x170201,_0x40cd1b]=await Promise['all']([_0xa0eab6['user']['buildUserMaps'](),_0xa0eab6[_0xda40a4(0x1b9)][_0xda40a4(0x14a)](),((async()=>{const _0x431ea4=_0xda40a4;!_0x544ec9&&_0x3c2a59[_0x431ea4(0x1f6)]>0x0&&await _0x4154ea(_0x3c2a59,async _0xbd898=>{const _0x4030bf=_0x431ea4,_0x3d9150=await _0xa0eab6[_0x4030bf(0x1a9)][_0x4030bf(0x1e7)](_0x48db73,_0xbd898['id']);_0x27c9d8[_0x4030bf(0x15a)](_0xbd898['id'],_0x3d9150);});})())]),{emailToId:_0x1cb559,idToEmail:_0x2487ca}=_0x170201,_0x4dab15=buildConnectionMaps(_0x40cd1b);return{'rootFolderId':_0x18dc02,'folderPathToId':_0x5d561f,'folderIdToPath':_0x3201d5,'segmentNameToId':_0x14b4e6,'activationsBySegmentId':_0x27c9d8,'emailToIdMap':_0x1cb559,'idToEmailMap':_0x2487ca,'connectionNameToIdMap':_0x4dab15['nameToId'],'connectionIdToNameMap':_0x4dab15['idToName'],'connectionNameToTypeMap':_0x4dab15['nameToType']};}export function createPushYamlContextForBundle(_0x2fe28a,_0x32fe65,_0x16c6f3,_0x14a41d,_0x4bc674,_0x3dd40e,_0x4ed7cd,_0x546549){const {existingLocalSegmentNames:_0x577c70,localExpandedRuleToNames:_0x61c033}=_0x14a41d,_0x1f7231=new Set(),_0x14449d=new Map(),_0x456887=new Map(),_0x2e21d4=new Map(),_0x47192e=createJumpTargetCache(),_0x3f6319=new Map(),_0x13e765=new Map(),_0x3b69dd=new Set();let _0x26b801;const _0x5cefff=_0x5163b7=>{const _0x4553c9={'resolveSegment':async _0x2068e9=>{const _0xb8a5ef=a114_0x4671,_0x733b0d=_0x2e21d4['get'](_0x2068e9);if(_0x733b0d!==undefined)return{'name':_0x733b0d,'isJourneyLocal':!![]};try{const _0x19b28f=await fetchSegment(_0x2fe28a,_0x32fe65,_0x2068e9,_0x16c6f3);if(!_0x19b28f)throw new Error(_0xb8a5ef(0x205));const _0x39356b=generateJourneyLocalName(_0x19b28f['name']),_0x3ec7c0=_0x19b28f[_0xb8a5ef(0x215)]===SEGMENT_KIND_JOURNEY&&_0x39356b!==undefined;let _0x4418ca=_0x19b28f[_0xb8a5ef(0x127)],_0x4fafed;if(_0x3ec7c0&&_0x19b28f['rule']){const _0x11259a=apiRuleToYaml(_0x19b28f[_0xb8a5ef(0x136)]);_0x13e765[_0xb8a5ef(0x15a)](_0x2068e9,_0x11259a);const _0x2ea729=async _0xed9767=>{const _0x80b4ec=_0xb8a5ef,_0x35cf56=collectSegmentRefsFromRule(_0xed9767);for(const _0x175d18 of _0x35cf56){if(!_0x13e765[_0x80b4ec(0x18a)](_0x175d18))try{const _0x59b51c=await fetchSegment(_0x2fe28a,_0x32fe65,_0x175d18,_0x16c6f3);if(_0x59b51c?.['rule']){const _0x5cd881=apiRuleToYaml(_0x59b51c[_0x80b4ec(0x136)]);_0x13e765[_0x80b4ec(0x15a)](_0x175d18,_0x5cd881),await _0x2ea729(_0x5cd881);}}catch(_0x34f01e){logger[_0x80b4ec(0x192)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x175d18+':\x20'+_0x34f01e);}}};await _0x2ea729(_0x11259a);const _0x154923=serializeExpandedRule(_0x11259a,_0x13e765),_0x336eb0=_0x61c033[_0xb8a5ef(0x15d)](_0x154923);if(_0x336eb0&&_0x336eb0[_0xb8a5ef(0x1f6)]>0x0){const _0x1f2f15=_0x14449d[_0xb8a5ef(0x15d)](_0x154923)||0x0,_0x2b90c6=_0x336eb0[_0x1f2f15]||_0x336eb0[_0x336eb0[_0xb8a5ef(0x1f6)]-0x1];_0x14449d['set'](_0x154923,_0x1f2f15+0x1),_0x4418ca=_0x2b90c6,_0x1f7231['add'](_0x4418ca),_0x2e21d4[_0xb8a5ef(0x15a)](_0x2068e9,_0x4418ca);const _0x168213=await resolveRuleSegmentRefs(_0x11259a,async _0x4a2b4a=>{const _0x239081=_0xb8a5ef,_0x3ad5bb=_0x2e21d4[_0x239081(0x15d)](_0x4a2b4a);if(_0x3ad5bb)return _0x3ad5bb;const _0x54222f=await _0x26b801[_0x239081(0x126)](_0x4a2b4a);return _0x54222f[_0x239081(0x127)];});_0x4fafed={'description':_0x19b28f[_0xb8a5ef(0x1a6)],'rule':_0x168213};}else{const _0x48a045=_0x3f6319[_0xb8a5ef(0x15d)](_0x154923);if(_0x48a045)_0x4418ca=_0x48a045,_0x2e21d4['set'](_0x2068e9,_0x4418ca);else{if(_0x39356b){let _0x265169=_0x39356b,_0x39f86c=0x2;while(_0x1f7231[_0xb8a5ef(0x18a)](_0x265169)||_0x577c70['has'](_0x265169)){_0x265169=_0x39356b+'_'+_0x39f86c,_0x39f86c++;}_0x1f7231['add'](_0x265169),_0x4418ca=_0x265169;}_0x2e21d4[_0xb8a5ef(0x15a)](_0x2068e9,_0x4418ca),_0x3f6319[_0xb8a5ef(0x15a)](_0x154923,_0x4418ca);const _0x35c6c7=await resolveRuleSegmentRefs(_0x11259a,async _0x1a273b=>{const _0x26733f=_0xb8a5ef,_0x3a47a0=_0x2e21d4[_0x26733f(0x15d)](_0x1a273b);if(_0x3a47a0)return _0x3a47a0;const _0x7fe01c=await _0x26b801['resolveSegment'](_0x1a273b);return _0x7fe01c[_0x26733f(0x127)];});_0x4fafed={'description':_0x19b28f[_0xb8a5ef(0x1a6)],'rule':_0x35c6c7};}}}return{'name':_0x4418ca,'isJourneyLocal':_0x3ec7c0,'definition':_0x4fafed};}catch(_0x41590b){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x2068e9+':\x20'+_0x41590b),{'name':_0x2068e9,'isJourneyLocal':![]};}},'resolveActivation':async _0x19ab91=>{const _0xf9ce57=a114_0x4671,_0x11b304=_0x456887[_0xf9ce57(0x15d)](_0x19ab91);if(_0x11b304!==undefined)return{'name':_0x11b304,'isJourneyLocal':!![]};try{let _0x2420b1=_0x4ed7cd?.[_0xf9ce57(0x15d)](_0x19ab91);!_0x2420b1&&(_0x2420b1=await _0x2fe28a[_0xf9ce57(0x1cb)][_0xf9ce57(0x145)](_0x5163b7,_0x19ab91));const _0x359ec3=_0x2420b1[_0xf9ce57(0x1af)][_0xf9ce57(0x17f)][_0xf9ce57(0x127)]||_0x19ab91,_0x5658ea=sanitizeYamlKey(_0x359ec3)||_0xf9ce57(0x142)+_0x19ab91,_0x3d8f1a=_0x5658ea;_0x456887[_0xf9ce57(0x15a)](_0x19ab91,_0x3d8f1a);const _0x10b578=journeyActivationStepToYaml(_0x2420b1,_0x4bc674,_0x3dd40e);return{'name':_0x3d8f1a,'isJourneyLocal':!![],'definition':_0x10b578};}catch(_0x230280){return logger[_0xf9ce57(0x192)](_0xf9ce57(0x177)+_0x19ab91+':\x20'+_0x230280),{'name':_0x19ab91,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x45a43c,_0x31ee29)=>resolveJumpTarget(_0x45a43c,_0x31ee29,_0x47192e,async _0x57fe69=>{const _0x146249=a114_0x4671,_0x3118b5=_0x546549?.['get'](_0x57fe69);if(_0x3118b5)return _0x3118b5;return _0x2fe28a[_0x146249(0x1cb)]['getJourney'](_0x57fe69);})};return _0x26b801=_0x4553c9,_0x4553c9;},_0x851bdd=async _0xbdf9de=>{const _0x4bee58=a114_0x4671,{collectSegmentIdsFromJourneyApi:_0x3e0ff7}=await import(_0x4bee58(0x1c7)),{batchAsync:_0xdf0c01}=await import(_0x4bee58(0x135)),_0x4eb174=new Set();for(const _0x28dfbf of _0xbdf9de){let _0x3870f7=_0x546549?.[_0x4bee58(0x15d)](_0x28dfbf);!_0x3870f7&&(_0x3870f7=await _0x2fe28a[_0x4bee58(0x1cb)][_0x4bee58(0x216)](_0x28dfbf));const _0x42c567=_0x3e0ff7(_0x3870f7);for(const _0x26d963 of _0x42c567){_0x4eb174[_0x4bee58(0x1ee)](_0x26d963);}}let _0x58ca64=Array[_0x4bee58(0x15b)](_0x4eb174);while(_0x58ca64[_0x4bee58(0x1f6)]>0x0){const _0x45675a=_0x58ca64[_0x4bee58(0x19b)](_0x1e2275=>!_0x3b69dd[_0x4bee58(0x18a)](_0x1e2275));if(_0x45675a[_0x4bee58(0x1f6)]===0x0)break;const _0x301ac1=await _0xdf0c01(_0x45675a,async _0x4a262e=>{const _0x39bf4e=_0x4bee58;_0x3b69dd[_0x39bf4e(0x1ee)](_0x4a262e);const _0x47ec86=await fetchSegment(_0x2fe28a,_0x32fe65,_0x4a262e,_0x16c6f3);if(!_0x47ec86)return null;return{'segmentId':_0x4a262e,'segment':_0x47ec86};},0xa),_0x17dc44=new Set();for(const _0x2e02ba of _0x301ac1){if(!_0x2e02ba?.[_0x4bee58(0x1a9)]?.[_0x4bee58(0x136)])continue;const _0x4e0606=apiRuleToYaml(_0x2e02ba[_0x4bee58(0x1a9)]['rule']);_0x13e765['set'](_0x2e02ba[_0x4bee58(0x187)],_0x4e0606);const _0x51e19a=collectSegmentRefsFromRule(_0x4e0606);for(const _0x2030cc of _0x51e19a){!_0x3b69dd['has'](_0x2030cc)&&_0x17dc44['add'](_0x2030cc);}}_0x58ca64=Array[_0x4bee58(0x15b)](_0x17dc44);}};return{'createYamlContext':_0x5cefff,'prefetchJourneySegments':_0x851bdd};}export async function executePushSegments(_0x30c1c8,_0x79408e,_0x4360cd,_0x2f6a4f,_0x1b26b0){const _0xb0ca56=a114_0x4e41d5,{segmentDefToCreateRequest:_0x5e0807,segmentDefToUpdateRequest:_0x2f1946}=await import(_0xb0ca56(0x209)),_0x400dcd=_0x4360cd[_0xb0ca56(0x1a5)],_0x18d1ab=0x5,_0x3d81aa=async _0x567f52=>{const _0x2e579c=_0xb0ca56,_0x3ceb2e=_0x567f52['folderPath']?_0x400dcd['get'](_0x567f52[_0x2e579c(0x199)]):undefined;let _0xce4a97;const _0xb2ef50={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x567f52[_0x2e579c(0x197)]){_0x1b26b0[_0x2e579c(0x15f)]?.({'type':_0x2e579c(0x172),'name':_0x567f52[_0x2e579c(0x1b8)]['name']});const _0x2a3599=_0x5e0807(_0x567f52[_0x2e579c(0x1b8)],_0x3ceb2e),_0x6b8159=await _0x1b26b0[_0x2e579c(0x13c)](_0x2e579c(0x16c)+_0x567f52[_0x2e579c(0x1b8)][_0x2e579c(0x127)]+_0x2e579c(0x190),()=>_0x30c1c8[_0x2e579c(0x1a9)]['createSegment'](_0x2f6a4f[_0x2e579c(0x128)],_0x2a3599));_0xce4a97=_0x6b8159[_0x2e579c(0x207)]['id'],_0xb2ef50[_0x2e579c(0x1c3)]={'name':_0x567f52[_0x2e579c(0x1b8)][_0x2e579c(0x127)],'id':_0xce4a97},_0x1b26b0['onProgress']?.({'type':_0x2e579c(0x1b2),'name':_0x567f52['yamlConfig'][_0x2e579c(0x127)],'segmentId':_0xce4a97}),_0x1b26b0[_0x2e579c(0x179)]?.(_0x2e579c(0x19e)+_0x567f52[_0x2e579c(0x1b8)]['name']+'\x27'),_0xb2ef50['created']=0x1;}else{if(_0x567f52[_0x2e579c(0x1a3)]){_0x1b26b0[_0x2e579c(0x15f)]?.({'type':_0x2e579c(0x1f2),'name':_0x567f52[_0x2e579c(0x1b8)][_0x2e579c(0x127)]});const _0x57b973=_0x2f1946(_0x567f52[_0x2e579c(0x1b8)]);_0x3ceb2e!==_0x567f52[_0x2e579c(0x200)]?.['segmentFolderId']&&(_0x57b973[_0x2e579c(0x1ed)]=_0x3ceb2e?parseInt(_0x3ceb2e,0xa):undefined),await _0x1b26b0[_0x2e579c(0x13c)]('Updating\x20segment\x20\x27'+_0x567f52[_0x2e579c(0x1b8)][_0x2e579c(0x127)]+_0x2e579c(0x190),()=>_0x30c1c8[_0x2e579c(0x1a9)]['updateSegmentById'](_0x2f6a4f[_0x2e579c(0x128)],_0x567f52[_0x2e579c(0x200)]['id'],_0x57b973)),_0xce4a97=_0x567f52['existingSegment']['id'],_0x1b26b0[_0x2e579c(0x15f)]?.({'type':_0x2e579c(0x1e2),'name':_0x567f52['yamlConfig'][_0x2e579c(0x127)]}),_0x1b26b0[_0x2e579c(0x179)]?.(_0x2e579c(0x21e)+_0x567f52[_0x2e579c(0x1b8)][_0x2e579c(0x127)]+'\x27'),_0xb2ef50[_0x2e579c(0x1bb)]=0x1;}else _0xce4a97=_0x567f52['existingSegment']['id'];}}catch(_0x58b039){const _0x40f90f=isHttp400Error(_0x58b039),_0x500ac9=_0x40f90f?ErrorCode[_0x2e579c(0x143)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x2ffcbc=getErrorMessage(_0x58b039);throw new SDKError(_0x500ac9,_0x2e579c(0x180)+(_0x567f52[_0x2e579c(0x197)]?_0x2e579c(0x1ca):_0x2e579c(0x1b1))+_0x2e579c(0x146)+_0x567f52[_0x2e579c(0x124)]+_0x2e579c(0x1d5)+_0x2ffcbc,_0x58b039);}try{const _0x24bbc5=await syncActivationsForSegment(_0x30c1c8,_0x2f6a4f[_0x2e579c(0x128)],_0xce4a97,_0x567f52['yamlConfig']['name'],_0x567f52[_0x2e579c(0x162)],_0x1b26b0,_0x567f52[_0x2e579c(0x124)]);_0xb2ef50[_0x2e579c(0x20b)]=_0x24bbc5;}catch(_0xae94f0){if(_0xae94f0 instanceof SDKError)throw _0xae94f0;throw new SDKError(ErrorCode[_0x2e579c(0x167)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x567f52['yamlConfig'][_0x2e579c(0x127)]+_0x2e579c(0x189)+_0x567f52[_0x2e579c(0x124)]+_0x2e579c(0x1d5)+getErrorMessage(_0xae94f0),_0xae94f0);}return _0xb2ef50;},_0xa6300b=await batchAsync(_0x79408e,_0x3d81aa,_0x18d1ab),_0x2d9e46={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2241d2 of _0xa6300b){_0x2d9e46[_0xb0ca56(0x1c0)]+=_0x2241d2[_0xb0ca56(0x1c0)],_0x2d9e46['updated']+=_0x2241d2[_0xb0ca56(0x1bb)],_0x2241d2['createdSegmentId']&&_0x2d9e46[_0xb0ca56(0x170)][_0xb0ca56(0x15a)](_0x2241d2['createdSegmentId'][_0xb0ca56(0x127)],_0x2241d2[_0xb0ca56(0x1c3)]['id']),_0x2d9e46[_0xb0ca56(0x20b)][_0xb0ca56(0x1c0)]+=_0x2241d2['activations'][_0xb0ca56(0x1c0)],_0x2d9e46['activations'][_0xb0ca56(0x1bb)]+=_0x2241d2[_0xb0ca56(0x20b)]['updated'],_0x2d9e46[_0xb0ca56(0x20b)][_0xb0ca56(0x1db)]+=_0x2241d2[_0xb0ca56(0x20b)][_0xb0ca56(0x1db)];}return _0x2d9e46;}async function syncActivationsForSegment(_0x507909,_0x3ffc76,_0x4ae81a,_0x467c9a,_0x1ef0c9,_0x1437b5,_0x108636){const _0x3f4613=a114_0x4e41d5,_0x35c99b={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x299e92 of _0x1ef0c9){try{if(_0x299e92['type']===_0x3f4613(0x1ca)&&_0x299e92[_0x3f4613(0x1c4)])_0x1437b5[_0x3f4613(0x15f)]?.({'type':_0x3f4613(0x148),'segmentName':_0x467c9a,'activationName':_0x299e92[_0x3f4613(0x127)]}),await _0x1437b5[_0x3f4613(0x13c)](_0x3f4613(0x15e)+_0x299e92[_0x3f4613(0x127)]+_0x3f4613(0x190),()=>_0x507909['segment'][_0x3f4613(0x125)](_0x3ffc76,_0x4ae81a,_0x299e92[_0x3f4613(0x1c4)])),_0x1437b5[_0x3f4613(0x15f)]?.({'type':_0x3f4613(0x1ce),'segmentName':_0x467c9a,'activationName':_0x299e92['name']}),_0x1437b5[_0x3f4613(0x179)]?.(_0x3f4613(0x156)+_0x299e92[_0x3f4613(0x127)]+'\x27'),_0x35c99b[_0x3f4613(0x1c0)]++;else{if(_0x299e92[_0x3f4613(0x18d)]===_0x3f4613(0x1b1)&&_0x299e92[_0x3f4613(0x1c4)]&&_0x299e92[_0x3f4613(0x1a2)])_0x1437b5[_0x3f4613(0x15f)]?.({'type':_0x3f4613(0x206),'segmentName':_0x467c9a,'activationName':_0x299e92[_0x3f4613(0x127)]}),await _0x1437b5[_0x3f4613(0x13c)]('Updating\x20activation\x20\x27'+_0x299e92['name']+_0x3f4613(0x190),()=>_0x507909[_0x3f4613(0x1a9)][_0x3f4613(0x221)](_0x3ffc76,_0x4ae81a,_0x299e92[_0x3f4613(0x1a2)]['id'],_0x299e92[_0x3f4613(0x1c4)])),_0x1437b5['onProgress']?.({'type':_0x3f4613(0x1aa),'segmentName':_0x467c9a,'activationName':_0x299e92['name']}),_0x1437b5['logSuccess']?.('Updated\x20activation\x20\x27'+_0x299e92[_0x3f4613(0x127)]+'\x27'),_0x35c99b[_0x3f4613(0x1bb)]++;else _0x299e92['type']===_0x3f4613(0x1a7)&&_0x299e92[_0x3f4613(0x1a2)]&&(_0x1437b5[_0x3f4613(0x15f)]?.({'type':_0x3f4613(0x1b5),'segmentName':_0x467c9a,'activationName':_0x299e92[_0x3f4613(0x127)]}),await _0x1437b5[_0x3f4613(0x13c)](_0x3f4613(0x1ad)+_0x299e92['name']+_0x3f4613(0x190),()=>_0x507909['segment'][_0x3f4613(0x138)](_0x3ffc76,_0x4ae81a,_0x299e92['existingActivation']['id'])),_0x1437b5['onProgress']?.({'type':_0x3f4613(0x171),'segmentName':_0x467c9a,'activationName':_0x299e92[_0x3f4613(0x127)]}),_0x1437b5[_0x3f4613(0x211)]?.(_0x3f4613(0x18c)+_0x299e92[_0x3f4613(0x127)]+'\x27'),_0x35c99b['deleted']++);}}catch(_0x486465){const _0x435e02=isHttp400Error(_0x486465),_0x3ab4a7=_0x435e02?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x3f4613(0x167)],_0x6f4861=getErrorMessage(_0x486465);throw new SDKError(_0x3ab4a7,_0x3f4613(0x180)+_0x299e92[_0x3f4613(0x18d)]+_0x3f4613(0x166)+_0x299e92['name']+_0x3f4613(0x189)+_0x108636+_0x3f4613(0x1d5)+_0x6f4861,_0x486465);}}return _0x35c99b;}export async function executePushFolders(_0x4cdc92,_0x7e4418,_0x2cc0df,_0xe8931f,_0x13574d){const _0xf90c17=a114_0x4e41d5,_0x3a9b20=new Map(_0x2cc0df);for(const _0x441998 of _0x7e4418){const _0x4d95a0=_0x441998[_0xf90c17(0x1f3)]('/'),_0x685a19=_0x4d95a0[_0x4d95a0[_0xf90c17(0x1f6)]-0x1],_0x20a23b=_0x4d95a0['slice'](0x0,-0x1)['join']('/'),_0x4549f8=_0x3a9b20['get'](_0x20a23b);_0x13574d[_0xf90c17(0x15f)]?.({'type':'folder_creating','folder':_0x441998});const _0x196ce6={'name':_0x685a19,'parentFolderId':_0x4549f8},_0x53dc9a=await _0x13574d['withProgress']('Creating\x20folder\x20\x27'+_0x441998+_0xf90c17(0x190),()=>_0x4cdc92[_0xf90c17(0x1a9)][_0xf90c17(0x1b4)](_0xe8931f['parentId'],_0x196ce6));_0x3a9b20['set'](_0x441998,_0x53dc9a[_0xf90c17(0x207)]['id']),_0x13574d[_0xf90c17(0x15f)]?.({'type':_0xf90c17(0x204),'folder':_0x441998,'folderId':_0x53dc9a[_0xf90c17(0x207)]['id']}),_0x13574d[_0xf90c17(0x19d)]?.(_0xf90c17(0x1e1)+_0x441998+'\x27');}return _0x3a9b20;}export async function executePushSegmentDeletions(_0x152f04,_0x423c52,_0x49d433){const _0x4f16be=a114_0x4e41d5;if(_0x423c52['length']===0x0)return 0x0;const {batchAsync:_0x15615b}=await import(_0x4f16be(0x135)),_0x35944a=0x5,_0x3c4cd7=await _0x15615b(_0x423c52,async _0x26f5c6=>{const _0x40b304=_0x4f16be;return _0x49d433[_0x40b304(0x15f)]?.({'type':_0x40b304(0x1d2),'name':_0x26f5c6[_0x40b304(0x127)]}),await _0x152f04[_0x40b304(0x1a9)][_0x40b304(0x1ba)](_0x26f5c6['id']),_0x49d433['onProgress']?.({'type':_0x40b304(0x183),'name':_0x26f5c6[_0x40b304(0x127)]}),_0x49d433[_0x40b304(0x211)]?.(_0x40b304(0x1fd)+_0x26f5c6['name']+'\x27'),0x1;},_0x35944a);return _0x3c4cd7['reduce']((_0x12440b,_0x1c067f)=>_0x12440b+_0x1c067f,0x0);}export async function executePushJourneys(_0x3e1081,_0x389e76,_0x517860,_0x902a0,_0x308288){const _0x1d77b8=a114_0x4e41d5,{journeyDefToRequest:_0x1ff9ec}=await import(_0x1d77b8(0x1c7)),{activationDefToCreateRequest:_0x3a120e,yamlRuleToApi:_0x571db9,validateSegmentRule:_0x4cbf93}=await import(_0x1d77b8(0x209)),_0x30730e={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5bd61f=new Map(_0x517860[_0x1d77b8(0x1e8)]),_0x3a5d39=0x5;for(let _0x50e9da=0x0;_0x50e9da<_0x389e76[_0x1d77b8(0x1f6)];_0x50e9da+=_0x3a5d39){const _0x16f56c=_0x389e76['slice'](_0x50e9da,_0x50e9da+_0x3a5d39),_0x4d78f7=await Promise[_0x1d77b8(0x13e)](_0x16f56c[_0x1d77b8(0x12c)](async _0x5df99f=>{const _0x73cf86=_0x1d77b8;if(!_0x5df99f[_0x73cf86(0x197)]&&!_0x5df99f[_0x73cf86(0x1a3)])return{'action':_0x73cf86(0x14c),'name':_0x5df99f[_0x73cf86(0x1b8)][_0x73cf86(0x127)],'journeyId':_0x5df99f[_0x73cf86(0x131)]?.['id']};const _0x411e4a=_0x5df99f[_0x73cf86(0x199)]?_0x517860[_0x73cf86(0x1a5)][_0x73cf86(0x15d)](_0x5df99f[_0x73cf86(0x199)]):undefined;_0x308288['onProgress']?.({'type':_0x5df99f[_0x73cf86(0x197)]?'journey_creating':'journey_updating','name':_0x5df99f['yamlConfig']['name']});try{const _0x462fb3=await executeSingleJourneyPush(_0x3e1081,_0x5df99f,{..._0x517860,'segmentNameToId':_0x5bd61f},{'parentId':_0x902a0[_0x73cf86(0x128)],'rootFolderId':_0x902a0[_0x73cf86(0x191)],'folderId':_0x411e4a,'verbose':_0x902a0[_0x73cf86(0x134)]},_0x308288,{'journeyDefToRequest':_0x1ff9ec,'activationDefToCreateRequest':_0x3a120e,'yamlRuleToApi':_0x571db9,'validateSegmentRule':_0x4cbf93});for(const [_0x687a16,_0x214dcf]of _0x462fb3[_0x73cf86(0x20a)]){_0x5bd61f[_0x73cf86(0x15a)](_0x687a16,_0x214dcf),_0x30730e[_0x73cf86(0x20a)]['set'](_0x687a16,_0x214dcf);}if(_0x462fb3[_0x73cf86(0x208)]===_0x73cf86(0x1c0))_0x308288[_0x73cf86(0x15f)]?.({'type':_0x73cf86(0x16f),'name':_0x5df99f[_0x73cf86(0x1b8)][_0x73cf86(0x127)],'journeyId':_0x462fb3[_0x73cf86(0x20f)]}),_0x308288[_0x73cf86(0x179)]?.('Created\x20journey\x20\x27'+_0x5df99f['yamlConfig'][_0x73cf86(0x127)]+'\x27'),_0x30730e['created']++;else _0x462fb3[_0x73cf86(0x208)]===_0x73cf86(0x1bb)&&(_0x308288[_0x73cf86(0x15f)]?.({'type':'journey_updated','name':_0x5df99f[_0x73cf86(0x1b8)][_0x73cf86(0x127)]}),_0x308288[_0x73cf86(0x179)]?.(_0x73cf86(0x1e6)+_0x5df99f[_0x73cf86(0x1b8)][_0x73cf86(0x127)]+'\x27'),_0x30730e[_0x73cf86(0x1bb)]++);return{'action':_0x462fb3[_0x73cf86(0x208)],'name':_0x5df99f['yamlConfig'][_0x73cf86(0x127)],'journeyId':_0x462fb3[_0x73cf86(0x20f)]};}catch(_0x3f0b7b){const _0x37924c=isHttp400Error(_0x3f0b7b),_0xfeafdd=_0x37924c?ErrorCode[_0x73cf86(0x1e3)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x2caedb=getErrorMessage(_0x3f0b7b);throw new SDKError(_0xfeafdd,'Failed\x20to\x20'+(_0x5df99f[_0x73cf86(0x197)]?'create':_0x73cf86(0x1b1))+_0x73cf86(0x1ec)+_0x5df99f[_0x73cf86(0x124)]+_0x73cf86(0x1d5)+_0x2caedb,_0x3f0b7b);}}));_0x30730e[_0x1d77b8(0x13a)][_0x1d77b8(0x164)](..._0x4d78f7);}return _0x30730e;}async function matchExistingJourneySegments(_0x5c1c40,_0x262c0d,_0x29e25d,_0x18d6fd,_0xbbf618){const _0x1fdf4f=a114_0x4e41d5;if(!_0x262c0d[_0x1fdf4f(0x131)]||!_0x262c0d['yamlConfig'][_0x1fdf4f(0x193)])return;const _0x54007d=new Map();for(const _0x1752d0 of Object['keys'](_0x262c0d[_0x1fdf4f(0x1b8)][_0x1fdf4f(0x193)])){const _0x2af611=generateDeterministicJourneySegmentName(_0x262c0d['yamlConfig'][_0x1fdf4f(0x127)],_0x1752d0);_0x54007d[_0x1fdf4f(0x15a)](_0x2af611,_0x1752d0);}const _0x5c2b66=collectSegmentIdsFromJourneyApi(_0x262c0d[_0x1fdf4f(0x131)]);for(const _0xd6aca5 of _0x5c2b66){const _0x360474=await fetchSegment(_0x5c1c40,_0x29e25d,_0xd6aca5,_0x18d6fd);if(!_0x360474?.[_0x1fdf4f(0x127)])continue;const _0x34462d=_0x54007d[_0x1fdf4f(0x15d)](_0x360474[_0x1fdf4f(0x127)]);_0x34462d&&_0xbbf618[_0x1fdf4f(0x15a)](_0x34462d,_0xd6aca5);}}async function executeSingleJourneyPush(_0x18f625,_0x1edd47,_0x210b9d,_0x24243c,_0x151895,_0x464bcb){const _0xc04307=a114_0x4e41d5,{journeyDefToRequest:_0xe47297,activationDefToCreateRequest:_0x57e41,yamlRuleToApi:_0x3ce78b,validateSegmentRule:_0x215ccc}=_0x464bcb,_0x222ad0=new Map(),_0xd8b8ef=new Map();recoverSegmentIdsFromPushRecovery(_0x1edd47,_0x222ad0,_0x210b9d[_0xc04307(0x1e8)]);const _0x4bcf88=new Map(),_0x58494e=new Map(),_0x4ab885=new Map();let _0x96485d;const _0xa958e7=async()=>{const _0x4b8347=_0xc04307;if(_0x96485d)return;_0x96485d=new Map();if(!_0x1edd47[_0x4b8347(0x131)])return;const _0x2e50d6=await _0x18f625[_0x4b8347(0x1cb)][_0x4b8347(0x1e7)](_0x1edd47[_0x4b8347(0x131)]['id']);for(const _0x190be3 of _0x2e50d6){const _0x3a9af2=journeyActivationStepToYaml(_0x190be3,_0x210b9d[_0x4b8347(0x21d)],_0x210b9d[_0x4b8347(0x159)]),_0x20c0ea=activationSignature(_0x3a9af2);!_0x96485d['has'](_0x20c0ea)&&_0x96485d[_0x4b8347(0x15a)](_0x20c0ea,_0x190be3['id']),_0x3a9af2[_0x4b8347(0x127)]&&_0xd8b8ef[_0x4b8347(0x15a)](_0x3a9af2[_0x4b8347(0x127)],_0x190be3['id']);}};await matchExistingJourneySegments(_0x18f625,_0x1edd47,_0x24243c[_0xc04307(0x128)],_0x210b9d['existingSegments'],_0x210b9d[_0xc04307(0x1e8)]);const _0x998306={'resolveSegmentId':async _0x2b9268=>{const _0x30d37e=_0xc04307,_0x4e1678=_0x210b9d['segmentNameToId'][_0x30d37e(0x15d)](_0x2b9268);if(!_0x4e1678)throw new SDKError(ErrorCode[_0x30d37e(0x220)],_0x30d37e(0x13f)+_0x2b9268+'\x20(referenced\x20in\x20journey\x20'+_0x1edd47[_0x30d37e(0x1b8)][_0x30d37e(0x127)]+')');return _0x4e1678;},'resolveEmbeddedSegmentId':async(_0x588555,_0x16b8dd)=>{const _0x4dab42=_0xc04307,_0xc1b860=_0x210b9d['segmentNameToId'][_0x4dab42(0x15d)](_0x588555);if(_0xc1b860)return _0xc1b860;const _0x324a57=_0x210b9d[_0x4dab42(0x1c5)][_0x4dab42(0x21b)](_0x3db0b6=>_0x3db0b6[_0x4dab42(0x127)]===_0x588555);if(_0x324a57)return _0x210b9d[_0x4dab42(0x1e8)]['set'](_0x588555,_0x324a57['id']),_0x324a57['id'];if(_0x1edd47[_0x4dab42(0x197)]){const {stageName:_0x511fc7,criteriaName:_0x358a10}=findSegmentCriteriaLocation(_0x1edd47[_0x4dab42(0x1b8)],_0x588555);return _0x215ccc(_0x588555,_0x16b8dd['rule']),_0x58494e[_0x4dab42(0x15a)](_0x588555,{'definition':_0x16b8dd,'stageName':_0x511fc7,'criteriaName':_0x358a10}),createPendingSegmentId(_0x588555);}const _0x299300=_0x1edd47[_0x4dab42(0x131)]?.['id'];if(!_0x299300)throw new SDKError(ErrorCode[_0x4dab42(0x13d)],_0x4dab42(0x17e));const _0x161fdf=_0x4bcf88[_0x4dab42(0x15d)](_0x588555);if(_0x161fdf)return _0x161fdf;const _0x5f0d5d=((async()=>{const _0x4da2f8=_0x4dab42;_0x215ccc(_0x588555,_0x16b8dd[_0x4da2f8(0x136)]);const _0x179d0e=generateDeterministicJourneySegmentName(_0x1edd47['yamlConfig'][_0x4da2f8(0x127)],_0x588555),_0x7b71f4=_0x210b9d[_0x4da2f8(0x1c5)][_0x4da2f8(0x21b)](_0x17dbc8=>_0x17dbc8[_0x4da2f8(0x127)]===_0x179d0e),_0x5d12a7=createSegmentIdResolver(_0x210b9d[_0x4da2f8(0x1e8)],_0x588555),_0x20f314=await resolveRuleSegmentIds(_0x16b8dd['rule'],_0x5d12a7);let _0x422708;return _0x7b71f4?(await _0x18f625['segment'][_0x4da2f8(0x18f)](_0x24243c['parentId'],_0x7b71f4['id'],{'description':_0x16b8dd[_0x4da2f8(0x1a6)]||_0x4da2f8(0x163)+_0x588555,'rule':_0x3ce78b(_0x20f314,!![]),'countPopulation':!![]}),_0x422708=_0x7b71f4['id'],saveSegmentToPushRecovery(_0x1edd47['absolutePath'],_0x1edd47[_0x4da2f8(0x1b8)][_0x4da2f8(0x127)],_0x588555,{'segmentId':_0x422708,'uniqueServerName':_0x179d0e,'createdAt':new Date()[_0x4da2f8(0x1c6)]()})):_0x422708=await createOrRecoverEmbeddedSegment(_0x18f625,_0x1edd47,{'localName':_0x588555,'uniqueSegmentName':_0x179d0e,'description':_0x16b8dd[_0x4da2f8(0x1a6)]||'Entry\x20criteria:\x20'+_0x588555,'journeyId':_0x299300,'resolvedRule':_0x20f314,'parentId':_0x24243c[_0x4da2f8(0x128)],'folderId':_0x24243c['rootFolderId']||''},_0x3ce78b),_0x210b9d[_0x4da2f8(0x1e8)][_0x4da2f8(0x15a)](_0x588555,_0x422708),_0x222ad0[_0x4da2f8(0x15a)](_0x588555,_0x422708),_0x422708;})());_0x4bcf88['set'](_0x588555,_0x5f0d5d);try{return await _0x5f0d5d;}finally{_0x4bcf88[_0x4dab42(0x1a7)](_0x588555);}},'resolveActivationId':async _0xe0eb65=>{const _0x110508=_0xc04307,_0xb8fa02=_0xd8b8ef[_0x110508(0x15d)](_0xe0eb65);if(_0xb8fa02)return _0xb8fa02;if(_0x1edd47['existingJourney']){await _0xa958e7();const _0x64087a=_0xd8b8ef[_0x110508(0x15d)](_0xe0eb65);if(_0x64087a)return _0x64087a;}throw new SDKError(ErrorCode[_0x110508(0x153)],_0x110508(0x19c)+_0xe0eb65+'\x20(referenced\x20in\x20journey\x20'+_0x1edd47[_0x110508(0x1b8)][_0x110508(0x127)]+_0x110508(0x133)+_0x110508(0x1d6));},'resolveEmbeddedActivationId':async(_0x509659,_0x304c93)=>{const _0x29fd5f=_0xc04307,_0x4fdebb=_0xd8b8ef[_0x29fd5f(0x15d)](_0x509659);if(_0x4fdebb)return _0x4fdebb;if(_0x1edd47[_0x29fd5f(0x197)])return _0x4ab885['set'](_0x509659,_0x304c93),createPendingActivationId(_0x509659);if(_0x1edd47[_0x29fd5f(0x131)]){await _0xa958e7();const _0x3fa73d=_0xd8b8ef[_0x29fd5f(0x15d)](_0x304c93[_0x29fd5f(0x127)]);if(_0x3fa73d)return _0xd8b8ef[_0x29fd5f(0x15a)](_0x509659,_0x3fa73d),_0x3fa73d;const _0x7ad549=activationSignature(_0x304c93),_0x21afd8=_0x96485d?.[_0x29fd5f(0x15d)](_0x7ad549);if(_0x21afd8)return _0xd8b8ef[_0x29fd5f(0x15a)](_0x509659,_0x21afd8),_0x21afd8;const _0x4424f0=await _0x57e41(_0x304c93,_0x210b9d[_0x29fd5f(0x17c)]),_0x986bb3={..._0x4424f0,..._0x304c93[_0x29fd5f(0x151)]!==undefined&&{'runAfterJourneyRefresh':_0x304c93[_0x29fd5f(0x151)]}},_0x2dda7a=await _0x18f625[_0x29fd5f(0x1cb)][_0x29fd5f(0x125)](_0x1edd47[_0x29fd5f(0x131)]['id'],_0x986bb3);return _0xd8b8ef[_0x29fd5f(0x15a)](_0x509659,_0x2dda7a['id']),_0x2dda7a['id'];}throw new SDKError(ErrorCode[_0x29fd5f(0x13d)],_0x29fd5f(0x1ff));},'resolveJourneyId':async _0x978824=>{const _0x22d47e=_0xc04307;try{return await _0x18f625['journey'][_0x22d47e(0x1a1)](_0x24243c[_0x22d47e(0x128)],_0x978824);}catch(_0x355105){throw new SDKError(ErrorCode[_0x22d47e(0x153)],'Journey\x20\x27'+_0x978824+_0x22d47e(0x137)+_0x1edd47[_0x22d47e(0x1b8)][_0x22d47e(0x127)]+'\x27)',_0x355105);}},'resolveStageId':async(_0x116a95,_0x3f619e)=>{const _0x2a80ad=_0xc04307,_0x4cf7d3=await _0x18f625[_0x2a80ad(0x1cb)]['getJourney'](_0x116a95),_0x35c869=_0x4cf7d3[_0x2a80ad(0x1af)]['journeyStages'][_0x2a80ad(0x21b)](_0x41c9c8=>_0x41c9c8[_0x2a80ad(0x127)][_0x2a80ad(0x1fc)]()===_0x3f619e[_0x2a80ad(0x1fc)]());if(!_0x35c869?.['id'])throw new SDKError(ErrorCode[_0x2a80ad(0x153)],'Stage\x20\x27'+_0x3f619e+_0x2a80ad(0x154)+(_0x4cf7d3[_0x2a80ad(0x1af)][_0x2a80ad(0x1cc)]||_0x4cf7d3[_0x2a80ad(0x1af)][_0x2a80ad(0x127)])+'\x27');return _0x35c869['id'];}},_0x6c0eff=await _0xe47297(_0x1edd47['yamlConfig'],_0x24243c[_0xc04307(0x128)],_0x998306),_0x47095f=_0x24243c[_0xc04307(0x201)]||_0x24243c[_0xc04307(0x191)];_0x47095f&&(_0x6c0eff[_0xc04307(0x174)]={'parentFolder':{'data':{'id':_0x47095f,'type':'folder'}}});if(_0x1edd47[_0xc04307(0x197)]){if(_0x58494e[_0xc04307(0x15c)]>0x0||_0x4ab885[_0xc04307(0x15c)]>0x0)return await executeThreeStepJourneyCreate(_0x18f625,_0x1edd47,_0x6c0eff,{'pendingEmbeddedSegments':_0x58494e,'pendingEmbeddedActivations':_0x4ab885,'embeddedSegmentNameToId':_0x222ad0,'journeyActivationNameToId':_0xd8b8ef},{..._0x24243c,'effectiveFolderId':_0x47095f},_0x210b9d,_0x151895,_0x464bcb);else{ensureJourneyDefaults(_0x6c0eff[_0xc04307(0x1af)]);const _0x51e2ff=await _0x18f625[_0xc04307(0x1cb)][_0xc04307(0x1ca)](_0x6c0eff);return deletePushRecovery(_0x1edd47[_0xc04307(0x124)]),{'action':_0xc04307(0x1c0),'journeyId':_0x51e2ff['id'],'embeddedSegmentNameToId':_0x222ad0};}}else{if(_0x1edd47[_0xc04307(0x1a3)]&&_0x1edd47['existingJourney'])return ensureJourneyDefaults(_0x6c0eff[_0xc04307(0x1af)]),await _0x18f625[_0xc04307(0x1cb)]['update'](_0x1edd47[_0xc04307(0x131)]['id'],_0x6c0eff),deletePushRecovery(_0x1edd47['absolutePath']),{'action':'updated','journeyId':_0x1edd47[_0xc04307(0x131)]['id'],'embeddedSegmentNameToId':_0x222ad0};}return deletePushRecovery(_0x1edd47['absolutePath']),{'action':_0xc04307(0x14c),'journeyId':_0x1edd47[_0xc04307(0x131)]?.['id'],'embeddedSegmentNameToId':_0x222ad0};}function findSegmentCriteriaLocation(_0x31a566,_0x3ebe81){const _0x507e5b=a114_0x4e41d5,_0x3491de=_0x31a566[_0x507e5b(0x1ea)]||_0x31a566[_0x507e5b(0x17a)]?.[0x0]?.['stages']||[];let _0x494eec='entry',_0x1b81fd=_0x3ebe81;const _0x1bc584=_0x31a566[_0x507e5b(0x1fe)]||_0x31a566[_0x507e5b(0x17a)]?.[0x0]?.[_0x507e5b(0x1fe)];if(_0x1bc584?.[_0x507e5b(0x1a9)]===_0x3ebe81)return{'stageName':'goal','criteriaName':_0x1bc584['name']||_0x3ebe81};_0x353a1b:for(const _0x118f63 of _0x3491de){if(_0x118f63['entry_criteria']?.[_0x507e5b(0x1a9)]===_0x3ebe81){_0x494eec=_0x118f63[_0x507e5b(0x127)],_0x1b81fd=_0x118f63[_0x507e5b(0x1be)][_0x507e5b(0x127)]||_0x3ebe81;break;}if(_0x118f63[_0x507e5b(0x210)])for(const _0x37314c of _0x118f63[_0x507e5b(0x210)]){if(_0x37314c[_0x507e5b(0x18d)]===_0x507e5b(0x1d3)&&_0x37314c[_0x507e5b(0x1b0)]?.[_0x507e5b(0x176)])for(const _0x203d09 of _0x37314c[_0x507e5b(0x1b0)][_0x507e5b(0x176)]){if(_0x203d09[_0x507e5b(0x1a9)]===_0x3ebe81){_0x494eec=_0x118f63[_0x507e5b(0x127)],_0x1b81fd=_0x203d09[_0x507e5b(0x127)]||_0x3ebe81;break _0x353a1b;}}}}return{'stageName':_0x494eec,'criteriaName':_0x1b81fd};}async function executeThreeStepJourneyCreate(_0x43c968,_0x2b71cd,_0x44bacc,_0x169be4,_0x58d298,_0x3f3b65,_0xf62382,_0xe7fae6){const _0x4df0f0=a114_0x4e41d5,{activationDefToCreateRequest:_0xcf92ae,yamlRuleToApi:_0x70b98f}=_0xe7fae6,{pendingEmbeddedSegments:_0x37316e,pendingEmbeddedActivations:_0x2a7584,embeddedSegmentNameToId:_0x56faf8}=_0x169be4,_0x272583=JSON[_0x4df0f0(0x152)](JSON[_0x4df0f0(0x1e4)](_0x44bacc));ensureJourneyDefaults(_0x272583['attributes']),stripPendingIds(_0x272583);const _0x406f9a=await _0x43c968['journey'][_0x4df0f0(0x1ca)](_0x272583),_0x2f7150=_0x406f9a['id'],_0x14a0b1=new Map();for(const _0x20d8c8 of _0x406f9a[_0x4df0f0(0x1af)][_0x4df0f0(0x18b)]){_0x14a0b1['set'](_0x20d8c8[_0x4df0f0(0x127)][_0x4df0f0(0x1fc)](),_0x20d8c8['id']);}recoverSegmentIdsFromPushRecovery(_0x2b71cd,_0x56faf8,_0x3f3b65['segmentNameToId']);for(const [_0x201b45,{definition:_0x2ab100}]of _0x37316e){if(_0x56faf8['has'](_0x201b45)){_0xf62382[_0x4df0f0(0x15f)]?.({'type':_0x4df0f0(0x13b),'journeyName':_0x2b71cd[_0x4df0f0(0x1b8)][_0x4df0f0(0x127)],'segmentName':_0x201b45});continue;}const _0x23a6ce=generateDeterministicJourneySegmentName(_0x2b71cd[_0x4df0f0(0x1b8)][_0x4df0f0(0x127)],_0x201b45);_0xf62382[_0x4df0f0(0x15f)]?.({'type':_0x4df0f0(0x1f5),'journeyName':_0x2b71cd['yamlConfig'][_0x4df0f0(0x127)],'segmentName':_0x201b45});const _0x3f7363=createSegmentIdResolver(_0x3f3b65['segmentNameToId'],_0x201b45),_0x13a4d2=await resolveRuleSegmentIds(_0x2ab100[_0x4df0f0(0x136)],_0x3f7363),_0x11cfa2=await createOrRecoverEmbeddedSegment(_0x43c968,_0x2b71cd,{'localName':_0x201b45,'uniqueSegmentName':_0x23a6ce,'description':_0x2ab100['description']||_0x4df0f0(0x163)+_0x201b45,'journeyId':_0x2f7150,'resolvedRule':_0x13a4d2,'parentId':_0x58d298['parentId'],'folderId':_0x58d298[_0x4df0f0(0x1a8)]||''},_0x70b98f);_0x56faf8[_0x4df0f0(0x15a)](_0x201b45,_0x11cfa2),_0x3f3b65[_0x4df0f0(0x1e8)][_0x4df0f0(0x15a)](_0x201b45,_0x11cfa2),_0xf62382[_0x4df0f0(0x15f)]?.({'type':'embedded_segment_created','journeyName':_0x2b71cd[_0x4df0f0(0x1b8)][_0x4df0f0(0x127)],'segmentName':_0x201b45});}const _0x563ab4=new Map();for(const [_0x155086,_0x2b1bd6]of _0x2a7584){_0xf62382['onProgress']?.({'type':_0x4df0f0(0x219),'journeyName':_0x2b71cd[_0x4df0f0(0x1b8)][_0x4df0f0(0x127)],'activationName':_0x155086});const _0x4bbb6b=await _0xcf92ae(_0x2b1bd6,_0x3f3b65[_0x4df0f0(0x17c)]),_0x32f2f0={..._0x4bbb6b,..._0x2b1bd6[_0x4df0f0(0x151)]!==undefined&&{'runAfterJourneyRefresh':_0x2b1bd6[_0x4df0f0(0x151)]}},_0x4ae53a=await _0x43c968[_0x4df0f0(0x1cb)][_0x4df0f0(0x125)](_0x2f7150,_0x32f2f0);_0x563ab4[_0x4df0f0(0x15a)](_0x155086,_0x4ae53a['id']),_0x169be4[_0x4df0f0(0x1e5)][_0x4df0f0(0x15a)](_0x155086,_0x4ae53a['id']),_0xf62382['onProgress']?.({'type':_0x4df0f0(0x129),'journeyName':_0x2b71cd['yamlConfig'][_0x4df0f0(0x127)],'activationName':_0x155086});}const _0x2e3df7=JSON['parse'](JSON['stringify'](_0x44bacc));return _0x2e3df7['id']=_0x2f7150,ensureJourneyDefaults(_0x2e3df7[_0x4df0f0(0x1af)]),resolvePendingIdsInRequest(_0x2e3df7,_0x44bacc,_0x14a0b1,_0x56faf8,_0x563ab4,_0xf62382),await _0x43c968[_0x4df0f0(0x1cb)][_0x4df0f0(0x1b1)](_0x2f7150,_0x2e3df7),deletePushRecovery(_0x2b71cd[_0x4df0f0(0x124)]),{'action':_0x4df0f0(0x1c0),'journeyId':_0x2f7150,'embeddedSegmentNameToId':_0x56faf8};}export function stripWaitStepPendingIds(_0x18c36a){const _0x2a024c=a114_0x4e41d5,_0x3876a1=_0x18c36a[_0x2a024c(0x1d9)]&&isPendingSegmentId(_0x18c36a[_0x2a024c(0x1d9)]),_0x21ab5e=_0x18c36a[_0x2a024c(0x1b6)]?.[_0x2a024c(0x1a4)](_0x1684e6=>_0x1684e6['segmentId']&&isPendingSegmentId(_0x1684e6[_0x2a024c(0x187)]));(_0x3876a1||_0x21ab5e)&&(_0x18c36a[_0x2a024c(0x1d0)]='Duration',_0x18c36a[_0x2a024c(0x1f8)]=0x1,_0x18c36a[_0x2a024c(0x1a0)]='day',delete _0x18c36a[_0x2a024c(0x1d9)],delete _0x18c36a[_0x2a024c(0x165)],delete _0x18c36a[_0x2a024c(0x12a)],delete _0x18c36a[_0x2a024c(0x1b6)]);}export function resolveWaitStepPendingIds(_0x3d8e8d,_0x45c983,_0x4d7084,_0x50a18e){const _0x34633e=a114_0x4e41d5;if(_0x45c983[_0x34633e(0x1d9)]&&isPendingSegmentId(_0x45c983['conditionSegmentId'])){const _0x5e23a3=_0x4d7084(_0x45c983[_0x34633e(0x1d9)],_0x34633e(0x14f)+_0x50a18e+_0x34633e(0x139));_0x5e23a3&&(_0x3d8e8d['waitStepType']=_0x34633e(0x12e),_0x3d8e8d[_0x34633e(0x1d9)]=_0x5e23a3,delete _0x3d8e8d['waitStep'],delete _0x3d8e8d[_0x34633e(0x1a0)],_0x45c983[_0x34633e(0x165)]!==undefined&&(_0x3d8e8d['conditionTimeoutDuration']=_0x45c983[_0x34633e(0x165)]),_0x45c983[_0x34633e(0x12a)]&&(_0x3d8e8d[_0x34633e(0x12a)]=_0x45c983[_0x34633e(0x12a)]));}if(_0x45c983['conditions']){const _0x5a9cd7=_0x45c983[_0x34633e(0x1b6)][_0x34633e(0x1a4)](_0x4a2bfb=>_0x4a2bfb['segmentId']&&isPendingSegmentId(_0x4a2bfb[_0x34633e(0x187)]));if(_0x5a9cd7){const _0x53e60f=_0x45c983[_0x34633e(0x1b6)][_0x34633e(0x12c)](_0x4b4683=>{const _0x4c9a01=_0x34633e;if(_0x4b4683[_0x4c9a01(0x187)]&&isPendingSegmentId(_0x4b4683[_0x4c9a01(0x187)])){const _0x3cbf21=_0x4d7084(_0x4b4683['segmentId'],_0x4c9a01(0x14f)+_0x50a18e+_0x4c9a01(0x139));return{..._0x4b4683,'segmentId':_0x3cbf21||_0x4b4683[_0x4c9a01(0x187)]};}return{..._0x4b4683};});_0x3d8e8d[_0x34633e(0x1d0)]='Condition',_0x3d8e8d[_0x34633e(0x1b6)]=_0x53e60f,delete _0x3d8e8d[_0x34633e(0x1f8)],delete _0x3d8e8d[_0x34633e(0x1a0)],delete _0x3d8e8d[_0x34633e(0x1d9)],delete _0x3d8e8d[_0x34633e(0x165)],delete _0x3d8e8d[_0x34633e(0x12a)];}}}function stripPendingIds(_0x585152){const _0xa3c722=a114_0x4e41d5;_0x585152[_0xa3c722(0x1af)]['goal']?.[_0xa3c722(0x187)]&&isPendingSegmentId(_0x585152['attributes']['goal'][_0xa3c722(0x187)])&&delete _0x585152['attributes']['goal'];for(const _0x58d9bc of _0x585152['attributes'][_0xa3c722(0x18b)]||[]){_0x58d9bc['entryCriteria']?.[_0xa3c722(0x187)]&&isPendingSegmentId(_0x58d9bc[_0xa3c722(0x1ab)][_0xa3c722(0x187)])&&delete _0x58d9bc[_0xa3c722(0x1ab)];_0x58d9bc[_0xa3c722(0x184)]?.['segmentId']&&isPendingSegmentId(_0x58d9bc[_0xa3c722(0x184)]['segmentId'])&&delete _0x58d9bc[_0xa3c722(0x184)];_0x58d9bc[_0xa3c722(0x17d)]&&(_0x58d9bc['exitCriterias']=_0x58d9bc[_0xa3c722(0x17d)][_0xa3c722(0x19b)](_0x709786=>!_0x709786[_0xa3c722(0x187)]||!isPendingSegmentId(_0x709786['segmentId'])));if(_0x58d9bc[_0xa3c722(0x210)])for(const _0x53335a of Object[_0xa3c722(0x198)](_0x58d9bc[_0xa3c722(0x210)])){const _0x1a913b=_0x58d9bc['steps'][_0x53335a];_0x1a913b[_0xa3c722(0x18d)]===_0xa3c722(0x1dc)&&_0x1a913b['journeyActivationStepId']&&isPendingActivationId(_0x1a913b['journeyActivationStepId'])&&(_0x1a913b[_0xa3c722(0x20c)]='');if(_0x1a913b[_0xa3c722(0x18d)]==='DecisionPoint'&&_0x1a913b['branches'])for(const _0x218573 of _0x1a913b[_0xa3c722(0x176)]){_0x218573[_0xa3c722(0x187)]&&isPendingSegmentId(_0x218573[_0xa3c722(0x187)])&&(_0x218573[_0xa3c722(0x187)]='');}_0x1a913b['type']===_0xa3c722(0x20e)&&stripWaitStepPendingIds(_0x1a913b);}}}function resolvePendingIdsInRequest(_0x2ce0db,_0x241e3d,_0x59815c,_0x4b119e,_0x4190f5,_0x1c5966){const _0x3ab180=a114_0x4e41d5,_0x3fc398=(_0x498d30,_0x35f428)=>{const _0x2d8da1=a114_0x4671;if(!isPendingSegmentId(_0x498d30))return _0x498d30;const _0x218fb5=extractPendingSegmentName(_0x498d30),_0x5adb4f=_0x4b119e[_0x2d8da1(0x15d)](_0x218fb5);return!_0x5adb4f&&_0x1c5966[_0x2d8da1(0x212)]?.(_0x2d8da1(0x14e)+_0x218fb5+_0x2d8da1(0x1cd)+_0x35f428),_0x5adb4f;};if(_0x2ce0db[_0x3ab180(0x1af)]['goal']?.[_0x3ab180(0x187)]&&isPendingSegmentId(_0x2ce0db[_0x3ab180(0x1af)][_0x3ab180(0x1fe)]['segmentId'])){const _0x21970d=_0x3fc398(_0x2ce0db['attributes'][_0x3ab180(0x1fe)][_0x3ab180(0x187)],_0x3ab180(0x157));_0x21970d&&(_0x2ce0db[_0x3ab180(0x1af)][_0x3ab180(0x1fe)]['segmentId']=_0x21970d);}for(const _0x40bdbe of _0x2ce0db['attributes'][_0x3ab180(0x18b)]||[]){const _0x128567=_0x59815c[_0x3ab180(0x15d)](_0x40bdbe['name']['toLowerCase']());_0x128567&&(_0x40bdbe['id']=_0x128567);if(_0x40bdbe[_0x3ab180(0x1ab)]?.[_0x3ab180(0x187)]&&isPendingSegmentId(_0x40bdbe[_0x3ab180(0x1ab)]['segmentId'])){const _0x12a61d=_0x3fc398(_0x40bdbe[_0x3ab180(0x1ab)][_0x3ab180(0x187)],_0x3ab180(0x14f)+_0x40bdbe[_0x3ab180(0x127)]+_0x3ab180(0x194));_0x12a61d&&(_0x40bdbe['entryCriteria']['segmentId']=_0x12a61d);}if(_0x40bdbe[_0x3ab180(0x17d)])for(const _0x12730f of _0x40bdbe[_0x3ab180(0x17d)]){if(_0x12730f['segmentId']&&isPendingSegmentId(_0x12730f['segmentId'])){const _0x43f0cb=_0x3fc398(_0x12730f[_0x3ab180(0x187)],'stage\x20\x27'+_0x40bdbe[_0x3ab180(0x127)]+_0x3ab180(0x178));_0x43f0cb&&(_0x12730f['segmentId']=_0x43f0cb);}}if(_0x40bdbe['milestone']?.[_0x3ab180(0x187)]&&isPendingSegmentId(_0x40bdbe[_0x3ab180(0x184)]['segmentId'])){const _0x4123f4=_0x3fc398(_0x40bdbe['milestone'][_0x3ab180(0x187)],_0x3ab180(0x14f)+_0x40bdbe[_0x3ab180(0x127)]+_0x3ab180(0x1f1));_0x4123f4&&(_0x40bdbe['milestone']['segmentId']=_0x4123f4);}if(_0x40bdbe[_0x3ab180(0x210)]){const _0x1e95cc=_0x1d67ef=>_0x241e3d[_0x3ab180(0x1af)][_0x3ab180(0x18b)]?.[_0x3ab180(0x21b)](_0x44ca1e=>_0x44ca1e[_0x3ab180(0x127)][_0x3ab180(0x1fc)]()===_0x40bdbe[_0x3ab180(0x127)][_0x3ab180(0x1fc)]())?.['steps']?.[_0x1d67ef];for(const _0x38944b of Object[_0x3ab180(0x198)](_0x40bdbe['steps'])){const _0x3ff946=_0x40bdbe[_0x3ab180(0x210)][_0x38944b],_0x201ad6=_0x1e95cc(_0x38944b);if(_0x3ff946[_0x3ab180(0x18d)]===_0x3ab180(0x1dc)&&_0x3ff946[_0x3ab180(0x20c)]&&(isPendingActivationId(_0x3ff946[_0x3ab180(0x20c)])||_0x3ff946[_0x3ab180(0x20c)]==='')){if(_0x201ad6?.[_0x3ab180(0x20c)]&&isPendingActivationId(_0x201ad6[_0x3ab180(0x20c)])){const _0x186843=extractPendingActivationName(_0x201ad6[_0x3ab180(0x20c)]),_0x1c4751=_0x4190f5[_0x3ab180(0x15d)](_0x186843);_0x1c4751&&(_0x3ff946[_0x3ab180(0x20c)]=_0x1c4751);}}if(_0x3ff946[_0x3ab180(0x18d)]===_0x3ab180(0x18e)&&_0x3ff946['branches']&&_0x201ad6?.[_0x3ab180(0x176)])for(let _0x105a37=0x0;_0x105a37<_0x3ff946[_0x3ab180(0x176)][_0x3ab180(0x1f6)];_0x105a37++){const _0x3a5e3c=_0x3ff946['branches'][_0x105a37],_0x419831=_0x201ad6[_0x3ab180(0x176)][_0x105a37];if(_0x419831?.[_0x3ab180(0x187)]&&isPendingSegmentId(_0x419831[_0x3ab180(0x187)])){const _0x4ce5a6=_0x3fc398(_0x419831[_0x3ab180(0x187)],'stage\x20\x27'+_0x40bdbe['name']+_0x3ab180(0x185)+(_0x3a5e3c[_0x3ab180(0x127)]||_0x105a37)+'\x27');_0x4ce5a6&&(_0x3a5e3c[_0x3ab180(0x187)]=_0x4ce5a6);}}_0x3ff946[_0x3ab180(0x18d)]===_0x3ab180(0x20e)&&_0x201ad6?.[_0x3ab180(0x18d)]===_0x3ab180(0x20e)&&resolveWaitStepPendingIds(_0x3ff946,_0x201ad6,_0x3fc398,_0x40bdbe[_0x3ab180(0x127)]);}}}}
|
|
1
|
+
const a114_0x33ddfe=a114_0x1937;(function(_0xbf680,_0x113e97){const _0x5d52d4=a114_0x1937,_0x7d5d00=_0xbf680();while(!![]){try{const _0x58ceae=-parseInt(_0x5d52d4(0x112))/0x1*(-parseInt(_0x5d52d4(0x1dd))/0x2)+parseInt(_0x5d52d4(0x19e))/0x3*(parseInt(_0x5d52d4(0x1c9))/0x4)+parseInt(_0x5d52d4(0x15b))/0x5*(-parseInt(_0x5d52d4(0x1d2))/0x6)+parseInt(_0x5d52d4(0x195))/0x7+-parseInt(_0x5d52d4(0x104))/0x8+parseInt(_0x5d52d4(0x161))/0x9*(parseInt(_0x5d52d4(0x152))/0xa)+parseInt(_0x5d52d4(0x14f))/0xb*(-parseInt(_0x5d52d4(0x19a))/0xc);if(_0x58ceae===_0x113e97)break;else _0x7d5d00['push'](_0x7d5d00['shift']());}catch(_0x478343){_0x7d5d00['push'](_0x7d5d00['shift']());}}}(a114_0x40f3,0x75497));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a114_0x33ddfe(0x1cd));export const PENDING_SEGMENT_PREFIX=a114_0x33ddfe(0x119);export const PENDING_ACTIVATION_PREFIX=a114_0x33ddfe(0x178);export function createPendingSegmentId(_0x34e7f5){return''+PENDING_SEGMENT_PREFIX+_0x34e7f5+'__';}export function isPendingSegmentId(_0x3c5df4){const _0x193448=a114_0x33ddfe;return _0x3c5df4[_0x193448(0x1a1)](PENDING_SEGMENT_PREFIX)&&!_0x3c5df4[_0x193448(0x1a1)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x5af05f){return _0x5af05f['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x26c316){return''+PENDING_ACTIVATION_PREFIX+_0x26c316+'__';}export function isPendingActivationId(_0x1de9c0){return _0x1de9c0['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xb4e08d){const _0x465da9=a114_0x33ddfe;return _0xb4e08d[_0x465da9(0x15e)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x501abe,_0x23f05e){const _0x4eb591=a114_0x33ddfe,_0x584aa6=_0x501abe+'::'+(_0x23f05e['trim']()||_0x4eb591(0x10c)),_0x1b8ad5=createHash(_0x4eb591(0x13c))[_0x4eb591(0x190)](_0x584aa6)[_0x4eb591(0x118)](_0x4eb591(0x1ba))[_0x4eb591(0x1af)](0x0,0xc);return _0x4eb591(0x11e)+_0x1b8ad5;}export function ensureJourneyDefaults(_0xed45b1){const _0x1fe5bd=a114_0x33ddfe;!_0xed45b1[_0x1fe5bd(0x1a8)]&&(_0xed45b1[_0x1fe5bd(0x1a8)]=''),!_0xed45b1[_0x1fe5bd(0x18b)]&&(_0xed45b1[_0x1fe5bd(0x18b)]='draft');}export function resolveTDFolderPath(_0x3a8e4f,_0x3482a2,_0x444125){const _0x340347=a114_0x33ddfe;if(!_0x3482a2)return _0x3a8e4f;if(_0x3a8e4f===_0x444125||_0x3a8e4f[_0x340347(0x1a1)](_0x444125+'/'))return _0x3a8e4f;return _0x3a8e4f?_0x444125+'/'+_0x3a8e4f:_0x444125;}export function addFoldersToCreate(_0x1278cf,_0x5eb3eb,_0x52dbe3){const _0x4add4e=a114_0x33ddfe;if(!_0x1278cf)return;if(_0x5eb3eb['has'](_0x1278cf))return;const _0x2b9059=_0x1278cf[_0x4add4e(0x17d)]('/');let _0x48d776='';for(const _0x4d8fa7 of _0x2b9059){_0x48d776=_0x48d776?_0x48d776+'/'+_0x4d8fa7:_0x4d8fa7,!_0x5eb3eb[_0x4add4e(0x121)](_0x48d776)&&_0x52dbe3[_0x4add4e(0x1c4)](_0x48d776);}}import*as a114_0x98dcd3 from'yaml';import{readFileSync}from'fs';function a114_0x1937(_0x3b7927,_0x1267f5){_0x3b7927=_0x3b7927-0xfb;const _0x40f398=a114_0x40f3();let _0x19378e=_0x40f398[_0x3b7927];return _0x19378e;}import a114_0x5e6eb0 from'path';import{isJourneyDef,parseYamlString as a114_0x4963c4,toYamlString as a114_0x372d40,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(_0x2765bb){const _0x3e9f79=a114_0x33ddfe;if(Array[_0x3e9f79(0x10b)](_0x2765bb))return'['+_0x2765bb[_0x3e9f79(0x1db)](_0x4440a0=>stableStringify(_0x4440a0))[_0x3e9f79(0x106)](',')+']';if(_0x2765bb&&typeof _0x2765bb===_0x3e9f79(0x13e)){const _0x2d105d=_0x2765bb,_0x4751be=Object[_0x3e9f79(0x171)](_0x2d105d)[_0x3e9f79(0x199)](),_0x3e3a98=_0x4751be['map'](_0x211dfc=>'\x22'+_0x211dfc+'\x22:'+stableStringify(_0x2d105d[_0x211dfc]));return'{'+_0x3e3a98[_0x3e9f79(0x106)](',')+'}';}const _0x4c264f=JSON[_0x3e9f79(0x12a)](_0x2765bb);return _0x4c264f===undefined?_0x3e9f79(0x146):_0x4c264f;}function activationSignature(_0x278e6f){const _0x3f9486=a114_0x33ddfe,_0x211a80={'connection':_0x278e6f[_0x3f9486(0x1c5)],..._0x278e6f[_0x3f9486(0x184)]!==undefined&&{'all_columns':_0x278e6f['all_columns']},..._0x278e6f[_0x3f9486(0x136)]!==undefined&&{'columns':_0x278e6f['columns']},..._0x278e6f[_0x3f9486(0x151)]!==undefined&&{'behavior':_0x278e6f[_0x3f9486(0x151)]},..._0x278e6f[_0x3f9486(0x1aa)]!==undefined&&{'schedule':_0x278e6f[_0x3f9486(0x1aa)]},..._0x278e6f[_0x3f9486(0x191)]!==undefined&&{'notification':_0x278e6f[_0x3f9486(0x191)]},..._0x278e6f[_0x3f9486(0x1f4)]!==undefined&&{'connector_config':_0x278e6f[_0x3f9486(0x1f4)]},..._0x278e6f[_0x3f9486(0x107)]!==undefined&&{'activation_template_id':_0x278e6f['activation_template_id']}};return stableStringify(_0x211a80);}async function fetchSegment(_0x164ccb,_0x5c578c,_0xa2581f,_0x4cfc90){const _0x2a0a66=a114_0x33ddfe,_0x1afe2e=_0x4cfc90?.[_0x2a0a66(0xfd)](_0x501a68=>_0x501a68['id']===_0xa2581f);if(_0x1afe2e)return _0x1afe2e;try{return await _0x164ccb[_0x2a0a66(0x10c)][_0x2a0a66(0x12d)](_0x5c578c,_0xa2581f);}catch(_0x2f0288){logger[_0x2a0a66(0x1c0)](_0x2a0a66(0x138)+_0xa2581f+_0x2a0a66(0x1a2)+_0x2f0288);try{return await _0x164ccb[_0x2a0a66(0x10c)][_0x2a0a66(0x143)](_0xa2581f);}catch(_0x31af46){return logger['debug'](_0x2a0a66(0x153)+_0xa2581f+':\x20'+_0x31af46),null;}}}function recoverSegmentIdsFromPushRecovery(_0x12d427,_0x25f4a5,_0x3186d2){const _0x706baa=a114_0x33ddfe,_0x3c8b90=readPushRecovery(_0x12d427[_0x706baa(0x1e0)]);if(_0x3c8b90?.[_0x706baa(0x141)]===_0x12d427[_0x706baa(0x1f1)][_0x706baa(0x127)])for(const [_0x12e3d7,_0x274a27]of Object['entries'](_0x3c8b90[_0x706baa(0x1d6)])){const _0x5e1eda=generateDeterministicJourneySegmentName(_0x12d427[_0x706baa(0x1f1)][_0x706baa(0x127)],_0x12e3d7);_0x274a27[_0x706baa(0x1ce)]===_0x5e1eda&&(_0x25f4a5['set'](_0x12e3d7,_0x274a27['segmentId']),_0x3186d2['set'](_0x12e3d7,_0x274a27['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x38c09c,_0x49b9ab,_0x452e17,_0x10c770){const _0x22caeb=a114_0x33ddfe;let _0x4e8b9f;try{_0x4e8b9f=await _0x38c09c[_0x22caeb(0x10c)][_0x22caeb(0x1c8)]({'name':_0x452e17[_0x22caeb(0x158)],'description':_0x452e17[_0x22caeb(0x1a8)],'journeyId':_0x452e17[_0x22caeb(0x1a7)],'rule':_0x10c770(_0x452e17[_0x22caeb(0x162)],!![]),'countPopulation':!![],'parentFolderId':_0x452e17[_0x22caeb(0x163)],'audienceId':_0x452e17[_0x22caeb(0x1f2)]});}catch(_0x36178e){const _0x52cb74=_0x36178e instanceof Error&&_0x36178e[_0x22caeb(0x1a3)][_0x22caeb(0x15c)]('Name\x20has\x20already\x20been\x20taken');if(_0x52cb74){const _0x69685b=readPushRecovery(_0x49b9ab['absolutePath']),_0x2a1f0c=_0x69685b?.[_0x22caeb(0x141)]===_0x49b9ab[_0x22caeb(0x1f1)][_0x22caeb(0x127)]?_0x69685b[_0x22caeb(0x1d6)][_0x452e17[_0x22caeb(0x18f)]]:undefined;if(_0x2a1f0c?.['uniqueServerName']===_0x452e17[_0x22caeb(0x158)])await _0x38c09c[_0x22caeb(0x10c)][_0x22caeb(0x113)](_0x452e17['parentId'],_0x2a1f0c['segmentId'],{'description':_0x452e17[_0x22caeb(0x1a8)],'rule':_0x10c770(_0x452e17[_0x22caeb(0x162)],!![]),'countPopulation':!![]}),_0x4e8b9f=_0x2a1f0c[_0x22caeb(0x19b)];else throw new SDKError(ErrorCode[_0x22caeb(0x117)],'Embedded\x20segment\x20\x27'+_0x452e17['localName']+_0x22caeb(0x18c)+(_0x22caeb(0x194)+_0x49b9ab[_0x22caeb(0x1e0)][_0x22caeb(0x15e)](/([^/]+)$/,_0x22caeb(0x1c3))+')\x20')+_0x22caeb(0x168),_0x36178e);}else throw _0x36178e;}return saveSegmentToPushRecovery(_0x49b9ab[_0x22caeb(0x1e0)],_0x49b9ab['yamlConfig'][_0x22caeb(0x127)],_0x452e17['localName'],{'segmentId':_0x4e8b9f,'uniqueServerName':_0x452e17['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x4e8b9f;}export async function prepareSegmentFiles(_0x5a9a6b,_0x38142a,_0x30bdce,_0x13060c,_0x22181c){const _0x1701fe=a114_0x33ddfe,{activationDefToCreateRequest:_0x280a41}=await import(_0x1701fe(0xfc)),_0x49458e=[],_0x71f908=new Set();for(const {yamlConfig:_0xef31aa,folderPath:_0x2ee385,sourcePath:_0x1556a9}of _0x5a9a6b){const _0x10f5b9=resolveTDFolderPath(_0x2ee385,_0x13060c,_0x22181c),_0x187702=_0x10f5b9+':'+_0xef31aa[_0x1701fe(0x127)],_0x3b07a0=_0x38142a[_0x1701fe(0xfb)][_0x1701fe(0x1fc)](_0x187702),_0x5a417a=_0x3b07a0?_0x38142a[_0x1701fe(0x1bd)][_0x1701fe(0x1fc)](_0x3b07a0['id'])||[]:[];addFoldersToCreate(_0x10f5b9,_0x38142a[_0x1701fe(0x169)],_0x71f908);const _0x314458=calculateActivationActions(_0xef31aa['activations']||[],_0x5a417a,_0x38142a[_0x1701fe(0x159)],_0x38142a['connectionIdToNameMap']);for(const _0x554954 of _0x314458){(_0x554954[_0x1701fe(0x1b6)]==='create'||_0x554954[_0x1701fe(0x1b6)]===_0x1701fe(0x190))&&_0x554954[_0x1701fe(0x139)]&&(_0x554954[_0x1701fe(0x1e5)]=await _0x280a41(_0x554954[_0x1701fe(0x139)],_0x30bdce));}const _0x862a85=calculateSegmentDiff(_0xef31aa,_0x3b07a0,_0x5a417a,_0x38142a[_0x1701fe(0x159)],_0x38142a[_0x1701fe(0x1ea)]);_0x49458e[_0x1701fe(0x150)]({'relativePath':_0xef31aa[_0x1701fe(0x127)],'absolutePath':_0x1556a9,'yamlConfig':_0xef31aa,'folderPath':_0x10f5b9,'existingSegment':_0x3b07a0,'existingActivations':_0x5a417a,'isNew':_0x862a85['isNew'],'hasChanges':_0x862a85['hasChanges'],'diff':_0x862a85[_0x1701fe(0x165)],'activationActions':_0x314458});}return{'segmentFiles':_0x49458e,'foldersToCreate':_0x71f908};}export async function prepareJourneyFiles(_0x593eac,_0x28229a,_0x18c378,_0x5945e9){const _0x449405=a114_0x33ddfe,_0x5c16db=[],_0x57944c=new Set();for(const {yamlConfig:_0x262f1d,folderPath:_0x4d8fb8,sourcePath:_0x51869b}of _0x593eac){const _0x1268b1=resolveTDFolderPath(_0x4d8fb8,_0x18c378,_0x5945e9),_0x436fa6=_0x1268b1+':'+_0x262f1d['name'],_0x3156d1=_0x28229a[_0x449405(0x1c7)][_0x449405(0x1fc)](_0x436fa6);let _0x419039,_0x56a1ce;if(_0x3156d1&&_0x3156d1[_0x449405(0x18e)]>0x0){const _0xfafcb7=buildLocalExpandedRuleMappings(_0x262f1d),{createYamlContext:_0x157e21,prefetchJourneySegments:_0x5900dd}=createPushYamlContextForBundle(_0x28229a[_0x449405(0x1e2)],_0x28229a['parentId'],_0x28229a[_0x449405(0x1f7)],_0xfafcb7,_0x28229a[_0x449405(0x159)],_0x28229a[_0x449405(0x1ea)],_0x28229a[_0x449405(0x1c6)],_0x28229a['journeyById']);await _0x5900dd(_0x3156d1[_0x449405(0x1db)](_0xff0df3=>_0xff0df3['id']));const _0x2cb8a9=hasMultipleVersions(_0x262f1d),_0x342ff5=async _0x10a55b=>{const _0x2c5cf1=_0x449405,_0x3809c8=_0x28229a[_0x2c5cf1(0x18d)]?.[_0x2c5cf1(0x1fc)](_0x10a55b);if(_0x3809c8)return _0x3809c8;return _0x28229a[_0x2c5cf1(0x1b5)]({'journeyId':_0x10a55b,'journeyName':_0x262f1d[_0x2c5cf1(0x127)],'isMultiVersion':_0x3156d1[_0x2c5cf1(0x18e)]>0x1});};if(_0x2cb8a9&&_0x3156d1['length']>0x1){const _0x5adecf=[];for(const _0x34bce2 of _0x3156d1){const _0x4db545=_0x34bce2['versionNumber']||0x1;_0x28229a['progress']?.[_0x449405(0x190)](_0x449405(0x1f0)+_0x262f1d['name']+'\x20v'+_0x4db545);const _0x253bb0=await _0x342ff5(_0x34bce2['id']),_0x23a110=_0x157e21(_0x34bce2['id']),_0x564204=await journeyResponseToDef(_0x253bb0,_0x23a110);_0x5adecf[_0x449405(0x150)]({'item':_0x34bce2,'yaml':_0x564204});}const _0x52c502=buildLocalRuleToNameMappingFromJourney(_0x262f1d);_0x56a1ce=buildMergedJourneyDef(_0x5adecf,_0x52c502);const _0x125824=Math['max'](..._0x5adecf[_0x449405(0x1db)](_0x292f60=>_0x292f60['item'][_0x449405(0x1ec)]||0x0)),_0x34155b=_0x3156d1[_0x449405(0xfd)](_0x54233b=>(_0x54233b[_0x449405(0x1ec)]||0x0)===_0x125824);_0x34155b&&(_0x28229a[_0x449405(0x196)]?.[_0x449405(0x190)]('Fetching\x20'+_0x262f1d[_0x449405(0x127)]+'\x20v'+_0x125824),_0x419039=await _0x342ff5(_0x34155b['id']));}else{const _0x295046=_0x3156d1[_0x3156d1[_0x449405(0x18e)]-0x1];_0x28229a[_0x449405(0x196)]?.[_0x449405(0x190)](_0x449405(0x1f0)+_0x262f1d[_0x449405(0x127)]),_0x419039=await _0x342ff5(_0x295046['id']);const _0x2594a5=_0x157e21(_0x295046['id']),_0x5a09b1=await journeyResponseToDef(_0x419039,_0x2594a5),_0x120278=buildLocalRuleToNameMappingFromJourney(_0x262f1d);_0x56a1ce=buildMergedJourneyDef([{'item':_0x295046,'yaml':_0x5a09b1}],_0x120278);}}addFoldersToCreate(_0x1268b1,_0x28229a[_0x449405(0x169)],_0x57944c);const _0xe7bd63=calculateJourneyDiff(_0x262f1d,_0x56a1ce);_0x5c16db[_0x449405(0x150)]({'relativePath':_0x262f1d[_0x449405(0x127)],'absolutePath':_0x51869b,'yamlConfig':_0x262f1d,'folderPath':_0x1268b1,'existingJourney':_0x419039,'isNew':_0xe7bd63[_0x449405(0x14c)],'hasChanges':_0xe7bd63[_0x449405(0x170)],'diff':_0xe7bd63[_0x449405(0x165)]});}return{'journeyFiles':_0x5c16db,'foldersToCreate':_0x57944c};}export function calculateActivationActions(_0x32f128,_0x32c1cc,_0x5cb60c,_0x54e157){const _0x34c8a0=a114_0x33ddfe,_0x46e7fc=[],_0x2f1192=new Map();for(const _0x3d5361 of _0x32c1cc){_0x2f1192['set'](_0x3d5361[_0x34c8a0(0x127)],_0x3d5361);}const _0x41cb05=new Map();for(const _0x2f6fc6 of _0x32f128){_0x41cb05[_0x34c8a0(0x160)](_0x2f6fc6['name'],_0x2f6fc6);}for(const _0x3920df of _0x32f128){const _0x1ff30b=_0x2f1192[_0x34c8a0(0x1fc)](_0x3920df[_0x34c8a0(0x127)]);if(!_0x1ff30b)_0x46e7fc[_0x34c8a0(0x150)]({'type':_0x34c8a0(0x192),'name':_0x3920df[_0x34c8a0(0x127)],'yamlActivation':_0x3920df});else{const _0x5ba315=activationResponseToDef(_0x1ff30b,_0x5cb60c,_0x54e157),_0x5263f4=a114_0x98dcd3[_0x34c8a0(0x12a)](_0x5ba315),_0x2b23ca=a114_0x98dcd3[_0x34c8a0(0x12a)](_0x3920df);_0x5263f4!==_0x2b23ca&&_0x46e7fc[_0x34c8a0(0x150)]({'type':_0x34c8a0(0x190),'name':_0x3920df[_0x34c8a0(0x127)],'yamlActivation':_0x3920df,'existingActivation':_0x1ff30b});}}for(const _0x4b0d1b of _0x32c1cc){!_0x41cb05[_0x34c8a0(0x121)](_0x4b0d1b[_0x34c8a0(0x127)])&&_0x46e7fc[_0x34c8a0(0x150)]({'type':_0x34c8a0(0x1bb),'name':_0x4b0d1b['name'],'existingActivation':_0x4b0d1b});}return _0x46e7fc;}function calculateYamlDiff(_0x172842,_0x1fb44b){if(_0x1fb44b){const _0x3933f7=generateDiff(_0x1fb44b,_0x172842),_0xed74f9=hasChanges(_0x3933f7);return{'isNew':![],'hasChanges':_0xed74f9,'diff':_0xed74f9?formatDiffWithColors(_0x3933f7):undefined};}const _0x98cb85=generateDiff('',_0x172842);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x98cb85)};}export function calculateSegmentDiff(_0x4149b3,_0x47521b,_0x4586dd,_0x4de904,_0x5c667c){const _0x353fe2=segmentToYamlString(_0x4149b3),_0x4772db=_0x47521b?segmentToYamlString(segmentWithActivationsToYaml(_0x47521b,_0x4586dd,undefined,_0x4de904,_0x5c667c)):undefined;return calculateYamlDiff(_0x353fe2,_0x4772db);}export function calculateJourneyDiff(_0x3261c8,_0x250501){const _0x1f9b47=normalizeJourneyDef(_0x3261c8,_0x3261c8),_0x40aa13=a114_0x372d40(_0x1f9b47),_0x18b8fd=_0x250501?a114_0x372d40(normalizeJourneyDef(_0x250501,_0x3261c8)):undefined;return calculateYamlDiff(_0x40aa13,_0x18b8fd);}export function findSegmentsToDelete(_0x11bc27,_0x5534b9,_0x305fa0,_0x38e0c8,_0x12b54e){const _0x39ff34=a114_0x33ddfe,_0x495134=new Set();for(const {yamlConfig:_0x1b9508,folderPath:_0x2a1635}of _0x5534b9){_0x495134[_0x39ff34(0x1c4)](_0x2a1635+':'+_0x1b9508['name']);}return _0x11bc27[_0x39ff34(0x17a)](_0x2ac59d=>{const _0x2800f6=_0x39ff34,_0x17716a=_0x2ac59d[_0x2800f6(0x1ef)]?_0x305fa0['get'](_0x2ac59d['segmentFolderId'][_0x2800f6(0x1c2)]())||'':'',_0x3556a4=_0x17716a+':'+_0x2ac59d[_0x2800f6(0x127)];if(_0x495134[_0x2800f6(0x121)](_0x3556a4))return![];if(_0x12b54e)return _0x17716a===_0x38e0c8||_0x17716a[_0x2800f6(0x1a1)](_0x38e0c8+'/');return!![];});}export function findJourneysToDelete(_0x1a6657,_0x5d27bf,_0x4218bb,_0x260147,_0x19a828){const _0x1383ec=a114_0x33ddfe,_0x1fb483=new Set();for(const {yamlConfig:_0x4d4fdc,folderPath:_0x554be6}of _0x5d27bf){_0x1fb483[_0x1383ec(0x1c4)](_0x554be6+':'+_0x4d4fdc['name']);}return _0x1a6657[_0x1383ec(0x17a)](_0x218f8a=>{const _0x205a2f=_0x1383ec,_0x239e2d=_0x218f8a[_0x205a2f(0x163)]?_0x4218bb[_0x205a2f(0x1fc)](_0x218f8a['folderId'])||'':'',_0x36dc62=_0x239e2d+':'+_0x218f8a[_0x205a2f(0x15f)];if(_0x1fb483[_0x205a2f(0x121)](_0x36dc62))return![];if(_0x19a828)return _0x239e2d===_0x260147||_0x239e2d[_0x205a2f(0x1a1)](_0x260147+'/');return!![];});}function a114_0x40f3(){const _0x2448a0=['JOURNEY_UPDATE_ERROR','Deleted\x20activation\x20\x27','updated','uniqueSegmentName','idToEmailMap','activation_creating','590CIfuHD','includes','INTERNAL','replace','journeyBundleName','set','1019727WqJQVo','resolvedRule','folderId','ACTIVATION_SYNTAX_ERROR','diff','activation_','Created\x20segment\x20\x27','and\x20the\x20server\x20segment,\x20then\x20retry.','folderPathToId','buildUserMaps','resolveSegment','activation_updated','activation_updating','Updating\x20segment\x20\x27','\x27\x20from\x20file:\x20','hasChanges','keys','Failed\x20to\x20fetch\x20referenced\x20segment\x20','Created\x20journey\x20\x27','created','):\x20','all','relationships','__pending_act_','Creating\x20activation\x20\x27','filter','segment_deleted','segment_deleting','split','folderPath','SEGMENT_NOT_FOUND','Journey\x20\x27','existingSegment','entryCriteria','waitStepUnit','all_columns','JOURNEY_SYNTAX_ERROR','embedded_activation_created','conditionSegmentId','WaitStep','onProgress','toLowerCase','state','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','journeyById','length','localName','update','notification','create','logWarning','Delete\x20the\x20push\x20recovery\x20file\x20(','4673942fgOqBr','progress','journeyActivationStepId','conditionTimeoutUnit','sort','132EfEkSk','segmentId','waitStepType','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','105fSFiGu','from','logDeleted','startsWith',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','message','index','stages','activationContext','journeyId','description','Failed\x20to\x20resolve\x20activation\x20','schedule','\x20error(s)','relative','journeyStages','run_after_journey_refresh','slice','rootFolderId','conditionTimeoutDuration','\x27\x20entry\x20criteria','kind','dirname','fetchJourney','type','createActivation','conditions','Creating\x20folder\x20\x27','hex','delete','entries','activationsBySegmentId','parse','\x20segment\x20from\x20file:\x20','debug','existingJourney','toString','.$1.push-recovery.json','add','connection','activationStepsById','journeyBundlesByFolderAndName','createJourneySegment','8344KxYNQA','deleted','Condition','entry_criteria','tdx.sdk.push-workflow','uniqueServerName','deleteSegment','parseDocument','listActivations','25434iglgPT','Created\x20activation\x20\x27','Segment\x20not\x20found','../../utils/async.js','segments','rule','\x20activation\x20\x27','activationActions','decision_point','map','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','64606AqYUab','deleteActivation','steps','absolutePath','toISOString','deps','max','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','validatedRequest','updateActivation','size','withProgress','logSuccess','connectionIdToNameMap','Stage\x20\x27','versionNumber','idToName','Activation','segmentFolderId','Fetching\x20','yamlConfig','parentId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','connector_config','segment_updating','attributes','existingSegments','segment_creating','createdSegmentId','journey_updating','goal\x20criteria','get','segment_created','segmentByFolderAndName','./child-segment-yaml.js','find','flatMap','exitCriterias','parentFolder','effectiveFolderId','data','unchanged','1178120zgNjwb','DecisionPoint','join','activation_template_id',').\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','\x0a\x20\x20','isArray','segment','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journey_updated','createFolder','goal','milestone','25BJabwu','updateSegmentById','activations','resolveJourneyId','embedded_segment_created','SEGMENT_UPDATE_ERROR','digest','__pending_','folder_created','getJourney','branches','SEGMENT_SYNTAX_ERROR','journey_entry_criteria_','\x20(referenced\x20in\x20journey\x20','Duration','has','existingActivation','journey','Creating\x20segment\x20\x27','segmentNameToId','waitStep','name','valid','Entry\x20criteria:\x20','stringify','journey_created','Failed\x20to\x20resolve\x20segment\x20','getSegment','user','embeddedSegmentNameToId','verbose','action','stage\x20\x27','NOT_FOUND','results','Created\x20folder\x20\x27','columns','segment_updated','getSegment\x20failed\x20for\x20','yamlActivation','errors','\x27\x20for\x20','sha1','\x27\x20wait\x20condition','object','ACTIVATION_UPDATE_ERROR','Failed\x20to\x20','journeyName','Deleted\x20segment\x20\x27','getSegmentEntity','Updating\x20activation\x20\x27','journeys','null','values','entry','Activation\x20not\x20found:\x20','utf-8','Segment\x20not\x20found:\x20','isNew','\x27...','createdSegmentIds','533720PSGwxM','push','behavior','10QphNCv','getSegmentEntity\x20also\x20failed\x20for\x20','some'];a114_0x40f3=function(){return _0x2448a0;};return a114_0x40f3();}export function buildSegmentLookupMap(_0x3d4e26,_0xd4c0d2){const _0x4088e9=a114_0x33ddfe,_0x2485c1=new Map();for(const _0x52fe92 of _0x3d4e26){const _0x3ad67b=_0x52fe92[_0x4088e9(0x1ef)]?_0xd4c0d2[_0x4088e9(0x1fc)](_0x52fe92[_0x4088e9(0x1ef)][_0x4088e9(0x1c2)]())||'':'',_0x3d8ba6=_0x3ad67b+':'+_0x52fe92[_0x4088e9(0x127)];_0x2485c1[_0x4088e9(0x160)](_0x3d8ba6,_0x52fe92);}return _0x2485c1;}export function buildSegmentNameToIdMap(_0x2f19ef){const _0x43fc59=a114_0x33ddfe,_0x2d5c1e=new Map();for(const _0x3cd722 of _0x2f19ef){_0x2d5c1e[_0x43fc59(0x160)](_0x3cd722['name'],_0x3cd722['id']);}return _0x2d5c1e;}export function buildJourneyBundleLookupMap(_0x2e4c5c,_0x3a7678){const _0x399b3e=a114_0x33ddfe,_0xd7265=new Map();for(const _0x405d7d of _0x2e4c5c){const _0x2271ea=_0x405d7d['folderId']?_0x3a7678[_0x399b3e(0x1fc)](_0x405d7d['folderId'])||'':'',_0x29fa40=_0x2271ea+':'+_0x405d7d[_0x399b3e(0x15f)];!_0xd7265[_0x399b3e(0x121)](_0x29fa40)&&_0xd7265[_0x399b3e(0x160)](_0x29fa40,[]),_0xd7265[_0x399b3e(0x1fc)](_0x29fa40)[_0x399b3e(0x150)](_0x405d7d);}for(const _0x5cb143 of _0xd7265[_0x399b3e(0x147)]()){_0x5cb143[_0x399b3e(0x199)]((_0x296952,_0x315c3b)=>(_0x296952[_0x399b3e(0x1ec)]||0x0)-(_0x315c3b[_0x399b3e(0x1ec)]||0x0));}return _0xd7265;}export function collectFoldersToCreate(_0x41767e,_0x1079df){const _0x10c714=a114_0x33ddfe,_0x3e5583=new Set();for(const _0xc9300d of _0x41767e){if(!_0xc9300d)continue;if(_0x1079df[_0x10c714(0x121)](_0xc9300d))continue;const _0x5553cc=_0xc9300d[_0x10c714(0x17d)]('/');let _0x4ff933='';for(const _0x26b7a0 of _0x5553cc){_0x4ff933=_0x4ff933?_0x4ff933+'/'+_0x26b7a0:_0x26b7a0,!_0x1079df['has'](_0x4ff933)&&_0x3e5583[_0x10c714(0x1c4)](_0x4ff933);}}return _0x3e5583;}export function parseAndClassifyYamlFiles(_0x1499f0,_0x1a6137,_0x41e17e){const _0x5818ee=a114_0x33ddfe,_0x53aa34=[],_0x2dbed4=[];for(const _0x4a4e8f of _0x1499f0){const _0x51bbd1=a114_0x5e6eb0[_0x5818ee(0x1ac)](_0x1a6137,a114_0x5e6eb0[_0x5818ee(0x1b4)](_0x4a4e8f)),_0x82e9cc=_0x51bbd1==='.'?'':_0x51bbd1,_0x18d17f=readFileSync(_0x4a4e8f,'utf-8'),_0x44c321=a114_0x98dcd3[_0x5818ee(0x1be)](_0x18d17f);if(isJourneyDef(_0x44c321)){const _0x3ad49a=a114_0x4963c4(_0x18d17f);_0x2dbed4[_0x5818ee(0x150)]({'yamlConfig':_0x3ad49a,'folderPath':_0x82e9cc,'sourcePath':_0x4a4e8f});}else{if(!_0x41e17e?.['skipSegments']){const _0x2e4131=parseSegmentYamlFile(_0x18d17f),_0x9ee996=normalizeChildSegmentYaml(_0x2e4131);_0x53aa34[_0x5818ee(0x150)]({'yamlConfig':_0x9ee996,'folderPath':_0x82e9cc,'sourcePath':_0x4a4e8f});}}}return{'segments':_0x53aa34,'journeys':_0x2dbed4};}export function validateParsedFiles(_0x2280f1,_0x4a3d8a){const _0x1e8e65=a114_0x33ddfe,_0x3691db=[];for(const {yamlConfig:_0x5884a7,sourcePath:_0x469b58}of _0x2280f1[_0x1e8e65(0x1d6)]){const _0xfbb14e=readFileSync(_0x469b58,_0x1e8e65(0x14a)),_0x1bdacc=a114_0x98dcd3[_0x1e8e65(0x1d0)](_0xfbb14e),_0x451ecf=validateSegmentDef(_0x5884a7,{'source':_0xfbb14e,'document':_0x1bdacc});if(!_0x451ecf['valid']){const _0x52e432=a114_0x5e6eb0[_0x1e8e65(0x1ac)](_0x4a3d8a,_0x469b58);_0x3691db[_0x1e8e65(0x150)]({'filePath':_0x52e432,'source':_0xfbb14e,'result':_0x451ecf,'isJourney':![]});}}for(const {yamlConfig:_0x3c02ac,sourcePath:_0xbe9a96}of _0x2280f1[_0x1e8e65(0x145)]){const _0x9803c2=readFileSync(_0xbe9a96,_0x1e8e65(0x14a)),_0x2298c2=a114_0x98dcd3['parseDocument'](_0x9803c2),_0x34b84c=validateJourneyDef(_0x3c02ac,{'source':_0x9803c2,'document':_0x2298c2});if(!_0x34b84c[_0x1e8e65(0x128)]){const _0x93f356=a114_0x5e6eb0[_0x1e8e65(0x1ac)](_0x4a3d8a,_0xbe9a96);_0x3691db[_0x1e8e65(0x150)]({'filePath':_0x93f356,'source':_0x9803c2,'result':_0x34b84c,'isJourney':!![]});}}return _0x3691db;}export function formatValidationErrors(_0x267997){const _0x346e9b=a114_0x33ddfe,_0x18a4af=[];for(const {filePath:_0x3c1d78,source:_0x39c5c4,result:_0x22e481,isJourney:_0x567af9}of _0x267997){const _0x5e616b=_0x567af9?'journey':_0x346e9b(0x10c);_0x18a4af[_0x346e9b(0x150)]('\x0a'+_0x3c1d78+'\x20('+_0x5e616b+_0x346e9b(0x175)+_0x22e481[_0x346e9b(0x13a)][_0x346e9b(0x18e)]+_0x346e9b(0x1ab)),_0x18a4af['push'](formatValidationResult(_0x22e481,_0x39c5c4,_0x3c1d78));}return _0x18a4af['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x172a75){const _0x10c7fa=a114_0x33ddfe,_0x50f63b=new Set(),_0x45c3fc=new Map(),_0x31770b=collectSegmentUsageCounts(_0x172a75);if(_0x172a75['segments'])for(const [_0x44c531,_0x581d93]of Object[_0x10c7fa(0x1bc)](_0x172a75[_0x10c7fa(0x1d6)])){_0x50f63b[_0x10c7fa(0x1c4)](_0x44c531);if(_0x581d93['rule']){const _0x2126f3=yamlRuleToApi(_0x581d93[_0x10c7fa(0x1d7)]),_0x405055=apiRuleToYaml(_0x2126f3);_0x45c3fc[_0x10c7fa(0x160)](_0x44c531,_0x405055);}}const _0x549e1a=new Map();let _0x559605=0x0;for(const [_0x76fb5c,_0x379a35]of _0x45c3fc){const _0x159c7c=serializeExpandedRule(_0x379a35,_0x45c3fc),_0x186f4c=_0x549e1a[_0x10c7fa(0x1fc)](_0x159c7c)||[];_0x186f4c[_0x10c7fa(0x150)]({'name':_0x76fb5c,'index':_0x559605}),_0x549e1a[_0x10c7fa(0x160)](_0x159c7c,_0x186f4c),_0x559605++;}const _0x4dc6e2=new Map();for(const [_0x1f1e5,_0x58c072]of _0x549e1a){const _0x1efb85=_0x58c072['slice']()[_0x10c7fa(0x199)]((_0x39e922,_0x234e82)=>{const _0x560b7d=_0x10c7fa,_0x404e70=_0x31770b[_0x560b7d(0x1fc)](_0x39e922['name'])||0x0,_0x1d5722=_0x31770b[_0x560b7d(0x1fc)](_0x234e82['name'])||0x0;if(_0x404e70!==_0x1d5722)return _0x1d5722-_0x404e70;return _0x39e922[_0x560b7d(0x1a4)]-_0x234e82['index'];})[_0x10c7fa(0x1db)](_0x3b7880=>_0x3b7880[_0x10c7fa(0x127)]),_0x2adae8=[];for(const _0x48c990 of _0x1efb85){const _0x75c6de=_0x31770b[_0x10c7fa(0x1fc)](_0x48c990)||0x0,_0x14bf1f=Math[_0x10c7fa(0x1e3)](_0x75c6de,0x1);for(let _0x14c2c8=0x0;_0x14c2c8<_0x14bf1f;_0x14c2c8++){_0x2adae8['push'](_0x48c990);}}_0x4dc6e2['set'](_0x1f1e5,_0x2adae8);}return{'existingLocalSegmentNames':_0x50f63b,'localSegmentRules':_0x45c3fc,'localExpandedRuleToNames':_0x4dc6e2};}export function createSegmentIdResolver(_0x243e2d,_0x40ef24){return async _0x422e58=>{const _0x200ef9=a114_0x1937,_0x5c325f=_0x243e2d[_0x200ef9(0x1fc)](_0x422e58);if(!_0x5c325f)throw new SDKError(ErrorCode[_0x200ef9(0x17f)],_0x200ef9(0x14b)+_0x422e58+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x40ef24+'\x27)');return _0x5c325f;};}export function extractRootFolderId(_0x5c14f6){const _0x14d4d7=a114_0x33ddfe;return _0x5c14f6[_0x14d4d7(0x177)]?.['parentSegmentFolder']?.['data']?.['id']||_0x5c14f6['relationships']?.[_0x14d4d7(0x100)]?.[_0x14d4d7(0x102)]?.['id'];}export function buildConnectionMaps(_0x591a23){const _0x427462=a114_0x33ddfe,_0x2f78d1=new Map(),_0x5d7c05=new Map(),_0x8a6dcf=new Map();for(const _0x2149c7 of _0x591a23){_0x2f78d1[_0x427462(0x160)](_0x2149c7[_0x427462(0x127)],parseInt(_0x2149c7['id'],0xa)),_0x5d7c05['set'](_0x2149c7['id'],_0x2149c7[_0x427462(0x127)]),_0x8a6dcf['set'](_0x2149c7['name'],_0x2149c7[_0x427462(0x1b6)]);}return{'nameToId':_0x2f78d1,'idToName':_0x5d7c05,'nameToType':_0x8a6dcf};}export function calculatePushStats(_0x162a76,_0x20b0ce,_0x1b3dd5,_0x256334,_0xbfaa0d,_0x2835ae,_0x4c8d32){const _0x43b48c=a114_0x33ddfe,_0x4b4497=_0x162a76[_0x43b48c(0x17a)](_0x2d1b37=>_0x2d1b37['isNew']),_0x166df1=_0x162a76[_0x43b48c(0x17a)](_0x314c15=>!_0x314c15[_0x43b48c(0x14c)]&&_0x314c15[_0x43b48c(0x170)]),_0x24ec77=_0x162a76[_0x43b48c(0x17a)](_0x5741f8=>!_0x5741f8[_0x43b48c(0x14c)]&&!_0x5741f8[_0x43b48c(0x170)]),_0x2aeea4=_0x2835ae?_0x256334:[],_0x18a930=_0x20b0ce[_0x43b48c(0x17a)](_0x354e7d=>_0x354e7d[_0x43b48c(0x14c)]),_0x3915d0=_0x20b0ce[_0x43b48c(0x17a)](_0x2f6795=>!_0x2f6795['isNew']&&_0x2f6795[_0x43b48c(0x170)]),_0x302b60=_0x20b0ce[_0x43b48c(0x17a)](_0x17f8ba=>!_0x17f8ba[_0x43b48c(0x14c)]&&!_0x17f8ba[_0x43b48c(0x170)]),_0x35d408=_0x2835ae?_0xbfaa0d:[],_0x3d6c95=_0x162a76[_0x43b48c(0xfe)](_0x95563d=>_0x95563d[_0x43b48c(0x1d9)]),_0x85fcb9=_0x3d6c95[_0x43b48c(0x17a)](_0x3b6ccb=>_0x3b6ccb[_0x43b48c(0x1b6)]===_0x43b48c(0x192)),_0x546d2f=_0x3d6c95[_0x43b48c(0x17a)](_0x301645=>_0x301645[_0x43b48c(0x1b6)]===_0x43b48c(0x190)),_0x423c5f=_0x3d6c95[_0x43b48c(0x17a)](_0xa1bd3e=>_0xa1bd3e[_0x43b48c(0x1b6)]===_0x43b48c(0x1bb)),_0x337b88=Array[_0x43b48c(0x19f)](_0x1b3dd5)['sort'](),_0x30583a=_0x4c8d32?![]:_0x4b4497[_0x43b48c(0x18e)]>0x0||_0x166df1['length']>0x0||_0x2aeea4[_0x43b48c(0x18e)]>0x0,_0x2a4b02=_0x18a930[_0x43b48c(0x18e)]>0x0||_0x3915d0[_0x43b48c(0x18e)]>0x0||_0x35d408[_0x43b48c(0x18e)]>0x0,_0x628bbf=_0x4c8d32?![]:_0x3d6c95[_0x43b48c(0x18e)]>0x0,_0x4ead38=_0x337b88[_0x43b48c(0x18e)]>0x0;return{'segments':{'new':_0x4b4497,'changed':_0x166df1,'unchanged':_0x24ec77,'toDelete':_0x2aeea4},'journeys':{'new':_0x18a930,'changed':_0x3915d0,'unchanged':_0x302b60,'toDelete':_0x35d408},'activations':{'all':_0x3d6c95,'toCreate':_0x85fcb9,'toUpdate':_0x546d2f,'toDelete':_0x423c5f},'folders':{'toCreate':_0x337b88},'counts':{'segments':{'new':_0x4b4497['length'],'changed':_0x166df1['length'],'unchanged':_0x24ec77[_0x43b48c(0x18e)],'toDelete':_0x2aeea4[_0x43b48c(0x18e)]},'journeys':{'new':_0x18a930[_0x43b48c(0x18e)],'changed':_0x3915d0['length'],'unchanged':_0x302b60[_0x43b48c(0x18e)],'toDelete':_0x35d408[_0x43b48c(0x18e)]},'activations':{'create':_0x85fcb9[_0x43b48c(0x18e)],'update':_0x546d2f[_0x43b48c(0x18e)],'delete':_0x423c5f[_0x43b48c(0x18e)]},'folders':_0x337b88['length']},'hasChanges':_0x30583a||_0x2a4b02||_0x628bbf||_0x4ead38};}export async function buildPushExecutionContext(_0x347867,_0x274bd6,_0x5a740f,_0x31538f,_0x12b453,_0x5b1623){const _0x400477=a114_0x33ddfe,_0x449aa0=extractRootFolderId(_0x5a740f),{pathToId:_0x1ab82b,idToPath:_0x617b51}=buildFolderMaps(_0x12b453),_0x4241a6=buildSegmentNameToIdMap(_0x31538f),_0x46cc63=new Map(),{batchAsync:_0xd91f8c}=await import(_0x400477(0x1d5)),[_0x1f264f,_0x5416e5]=await Promise[_0x400477(0x176)]([_0x347867[_0x400477(0x12e)][_0x400477(0x16a)](),_0x347867[_0x400477(0x1c5)]['list'](),((async()=>{!_0x5b1623&&_0x31538f['length']>0x0&&await _0xd91f8c(_0x31538f,async _0x1e8778=>{const _0x38a986=a114_0x1937,_0x24a69a=await _0x347867[_0x38a986(0x10c)][_0x38a986(0x1d1)](_0x274bd6,_0x1e8778['id']);_0x46cc63[_0x38a986(0x160)](_0x1e8778['id'],_0x24a69a);});})())]),{emailToId:_0x178a61,idToEmail:_0x567574}=_0x1f264f,_0x13902f=buildConnectionMaps(_0x5416e5);return{'rootFolderId':_0x449aa0,'folderPathToId':_0x1ab82b,'folderIdToPath':_0x617b51,'segmentNameToId':_0x4241a6,'activationsBySegmentId':_0x46cc63,'emailToIdMap':_0x178a61,'idToEmailMap':_0x567574,'connectionNameToIdMap':_0x13902f['nameToId'],'connectionIdToNameMap':_0x13902f[_0x400477(0x1ed)],'connectionNameToTypeMap':_0x13902f['nameToType']};}export function createPushYamlContextForBundle(_0x412241,_0x57aa9f,_0x4013f9,_0x532284,_0x264d4f,_0x2d08dc,_0x237088,_0x5d4979){const {existingLocalSegmentNames:_0x1223a6,localExpandedRuleToNames:_0x54b973}=_0x532284,_0x2b1d15=new Set(),_0x272233=new Map(),_0x41ba1e=new Map(),_0x4e9b72=new Map(),_0x5ee40d=createJumpTargetCache(),_0x3d198b=new Map(),_0x73381f=new Map(),_0x8086ed=new Set();let _0x295360;const _0x10e6d7=_0x414620=>{const _0x4ef662={'resolveSegment':async _0x2a83cf=>{const _0x2be6ae=a114_0x1937,_0x273d49=_0x4e9b72[_0x2be6ae(0x1fc)](_0x2a83cf);if(_0x273d49!==undefined)return{'name':_0x273d49,'isJourneyLocal':!![]};try{const _0x317bd1=await fetchSegment(_0x412241,_0x57aa9f,_0x2a83cf,_0x4013f9);if(!_0x317bd1)throw new Error(_0x2be6ae(0x1d4));const _0x1c1033=generateJourneyLocalName(_0x317bd1[_0x2be6ae(0x127)]),_0x161cbc=_0x317bd1[_0x2be6ae(0x1b3)]===SEGMENT_KIND_JOURNEY&&_0x1c1033!==undefined;let _0xb4f3a5=_0x317bd1[_0x2be6ae(0x127)],_0x5adf8c;if(_0x161cbc&&_0x317bd1[_0x2be6ae(0x1d7)]){const _0x3bac26=apiRuleToYaml(_0x317bd1[_0x2be6ae(0x1d7)]);_0x73381f[_0x2be6ae(0x160)](_0x2a83cf,_0x3bac26);const _0x2f8310=async _0x5c6955=>{const _0xc4e4cc=_0x2be6ae,_0x2b7344=collectSegmentRefsFromRule(_0x5c6955);for(const _0x4965e8 of _0x2b7344){if(!_0x73381f[_0xc4e4cc(0x121)](_0x4965e8))try{const _0x5ad403=await fetchSegment(_0x412241,_0x57aa9f,_0x4965e8,_0x4013f9);if(_0x5ad403?.[_0xc4e4cc(0x1d7)]){const _0x53a58e=apiRuleToYaml(_0x5ad403[_0xc4e4cc(0x1d7)]);_0x73381f['set'](_0x4965e8,_0x53a58e),await _0x2f8310(_0x53a58e);}}catch(_0x228273){logger[_0xc4e4cc(0x1c0)](_0xc4e4cc(0x172)+_0x4965e8+':\x20'+_0x228273);}}};await _0x2f8310(_0x3bac26);const _0x4b8e24=serializeExpandedRule(_0x3bac26,_0x73381f),_0x4ed342=_0x54b973[_0x2be6ae(0x1fc)](_0x4b8e24);if(_0x4ed342&&_0x4ed342[_0x2be6ae(0x18e)]>0x0){const _0xf8fca6=_0x272233[_0x2be6ae(0x1fc)](_0x4b8e24)||0x0,_0x2e2fe8=_0x4ed342[_0xf8fca6]||_0x4ed342[_0x4ed342[_0x2be6ae(0x18e)]-0x1];_0x272233['set'](_0x4b8e24,_0xf8fca6+0x1),_0xb4f3a5=_0x2e2fe8,_0x2b1d15[_0x2be6ae(0x1c4)](_0xb4f3a5),_0x4e9b72[_0x2be6ae(0x160)](_0x2a83cf,_0xb4f3a5);const _0x202315=await resolveRuleSegmentRefs(_0x3bac26,async _0xd886e0=>{const _0x4af5be=_0x2be6ae,_0x131395=_0x4e9b72[_0x4af5be(0x1fc)](_0xd886e0);if(_0x131395)return _0x131395;const _0x321327=await _0x295360[_0x4af5be(0x16b)](_0xd886e0);return _0x321327[_0x4af5be(0x127)];});_0x5adf8c={'description':_0x317bd1[_0x2be6ae(0x1a8)],'rule':_0x202315};}else{const _0x983c38=_0x3d198b[_0x2be6ae(0x1fc)](_0x4b8e24);if(_0x983c38)_0xb4f3a5=_0x983c38,_0x4e9b72[_0x2be6ae(0x160)](_0x2a83cf,_0xb4f3a5);else{if(_0x1c1033){let _0x35bbd6=_0x1c1033,_0x92127f=0x2;while(_0x2b1d15['has'](_0x35bbd6)||_0x1223a6[_0x2be6ae(0x121)](_0x35bbd6)){_0x35bbd6=_0x1c1033+'_'+_0x92127f,_0x92127f++;}_0x2b1d15[_0x2be6ae(0x1c4)](_0x35bbd6),_0xb4f3a5=_0x35bbd6;}_0x4e9b72['set'](_0x2a83cf,_0xb4f3a5),_0x3d198b['set'](_0x4b8e24,_0xb4f3a5);const _0x4e80c5=await resolveRuleSegmentRefs(_0x3bac26,async _0x328ec2=>{const _0x81490c=_0x2be6ae,_0x41e1a0=_0x4e9b72[_0x81490c(0x1fc)](_0x328ec2);if(_0x41e1a0)return _0x41e1a0;const _0x285ae7=await _0x295360[_0x81490c(0x16b)](_0x328ec2);return _0x285ae7[_0x81490c(0x127)];});_0x5adf8c={'description':_0x317bd1[_0x2be6ae(0x1a8)],'rule':_0x4e80c5};}}}return{'name':_0xb4f3a5,'isJourneyLocal':_0x161cbc,'definition':_0x5adf8c};}catch(_0x2db025){return logger[_0x2be6ae(0x1c0)](_0x2be6ae(0x12c)+_0x2a83cf+':\x20'+_0x2db025),{'name':_0x2a83cf,'isJourneyLocal':![]};}},'resolveActivation':async _0x3fff96=>{const _0x18b510=a114_0x1937,_0x1ad807=_0x41ba1e['get'](_0x3fff96);if(_0x1ad807!==undefined)return{'name':_0x1ad807,'isJourneyLocal':!![]};try{let _0x3b1668=_0x237088?.[_0x18b510(0x1fc)](_0x3fff96);!_0x3b1668&&(_0x3b1668=await _0x412241[_0x18b510(0x123)]['getActivation'](_0x414620,_0x3fff96));const _0x91d04a=_0x3b1668[_0x18b510(0x1f6)]['activationParams'][_0x18b510(0x127)]||_0x3fff96,_0x83c751=sanitizeYamlKey(_0x91d04a)||_0x18b510(0x166)+_0x3fff96,_0x1024b8=_0x83c751;_0x41ba1e['set'](_0x3fff96,_0x1024b8);const _0x3cf551=journeyActivationStepToYaml(_0x3b1668,_0x264d4f,_0x2d08dc);return{'name':_0x1024b8,'isJourneyLocal':!![],'definition':_0x3cf551};}catch(_0x57aede){return logger[_0x18b510(0x1c0)](_0x18b510(0x1a9)+_0x3fff96+':\x20'+_0x57aede),{'name':_0x3fff96,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x22c510,_0xbf1c79)=>resolveJumpTarget(_0x22c510,_0xbf1c79,_0x5ee40d,async _0x28629f=>{const _0x40be33=a114_0x1937,_0x495d63=_0x5d4979?.[_0x40be33(0x1fc)](_0x28629f);if(_0x495d63)return _0x495d63;return _0x412241[_0x40be33(0x123)][_0x40be33(0x11b)](_0x28629f);})};return _0x295360=_0x4ef662,_0x4ef662;},_0x4057ac=async _0x3c7905=>{const _0x173cea=a114_0x1937,{collectSegmentIdsFromJourneyApi:_0x2da99d}=await import('./journey-yaml.js'),{batchAsync:_0x37dafb}=await import(_0x173cea(0x1d5)),_0x240255=new Set();for(const _0xa3344f of _0x3c7905){let _0x4f7b2d=_0x5d4979?.[_0x173cea(0x1fc)](_0xa3344f);!_0x4f7b2d&&(_0x4f7b2d=await _0x412241[_0x173cea(0x123)][_0x173cea(0x11b)](_0xa3344f));const _0xe7c7c2=_0x2da99d(_0x4f7b2d);for(const _0x43c85e of _0xe7c7c2){_0x240255['add'](_0x43c85e);}}let _0x5d4b99=Array['from'](_0x240255);while(_0x5d4b99[_0x173cea(0x18e)]>0x0){const _0x1b4009=_0x5d4b99[_0x173cea(0x17a)](_0x23f5d0=>!_0x8086ed[_0x173cea(0x121)](_0x23f5d0));if(_0x1b4009[_0x173cea(0x18e)]===0x0)break;const _0x2a94b4=await _0x37dafb(_0x1b4009,async _0x2658ba=>{_0x8086ed['add'](_0x2658ba);const _0x3c8d52=await fetchSegment(_0x412241,_0x57aa9f,_0x2658ba,_0x4013f9);if(!_0x3c8d52)return null;return{'segmentId':_0x2658ba,'segment':_0x3c8d52};},0xa),_0x4ca382=new Set();for(const _0x5d940a of _0x2a94b4){if(!_0x5d940a?.[_0x173cea(0x10c)]?.[_0x173cea(0x1d7)])continue;const _0x1d5b6d=apiRuleToYaml(_0x5d940a[_0x173cea(0x10c)]['rule']);_0x73381f['set'](_0x5d940a[_0x173cea(0x19b)],_0x1d5b6d);const _0x6709d=collectSegmentRefsFromRule(_0x1d5b6d);for(const _0x331c86 of _0x6709d){!_0x8086ed['has'](_0x331c86)&&_0x4ca382[_0x173cea(0x1c4)](_0x331c86);}}_0x5d4b99=Array[_0x173cea(0x19f)](_0x4ca382);}};return{'createYamlContext':_0x10e6d7,'prefetchJourneySegments':_0x4057ac};}export async function executePushSegments(_0x4623b7,_0x2ed7d6,_0x46bcc8,_0x2f804d,_0x1ab23a){const _0x563de5=a114_0x33ddfe,{segmentDefToCreateRequest:_0x5b0a04,segmentDefToUpdateRequest:_0x131c60}=await import(_0x563de5(0xfc)),_0x3ebb7e=_0x46bcc8[_0x563de5(0x169)],_0x3a1623=0x5,_0x11c403=async _0x53490a=>{const _0x42dedc=_0x563de5,_0x18ab5c=_0x53490a[_0x42dedc(0x17e)]?_0x3ebb7e[_0x42dedc(0x1fc)](_0x53490a[_0x42dedc(0x17e)]):undefined;let _0x49e2f8;const _0xcc5df2={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x53490a[_0x42dedc(0x14c)]){_0x1ab23a[_0x42dedc(0x189)]?.({'type':_0x42dedc(0x1f8),'name':_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]});const _0x72f723=_0x5b0a04(_0x53490a[_0x42dedc(0x1f1)],_0x18ab5c),_0x4b3cfe=await _0x1ab23a['withProgress'](_0x42dedc(0x124)+_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]+'\x27...',()=>_0x4623b7['segment']['createSegment'](_0x2f804d['parentId'],_0x72f723));_0x49e2f8=_0x4b3cfe[_0x42dedc(0x102)]['id'],_0xcc5df2[_0x42dedc(0x1f9)]={'name':_0x53490a[_0x42dedc(0x1f1)]['name'],'id':_0x49e2f8},_0x1ab23a['onProgress']?.({'type':_0x42dedc(0x1fd),'name':_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)],'segmentId':_0x49e2f8}),_0x1ab23a['logSuccess']?.(_0x42dedc(0x167)+_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]+'\x27'),_0xcc5df2[_0x42dedc(0x174)]=0x1;}else{if(_0x53490a['hasChanges']){_0x1ab23a[_0x42dedc(0x189)]?.({'type':_0x42dedc(0x1f5),'name':_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]});const _0x3a9bb7=_0x131c60(_0x53490a[_0x42dedc(0x1f1)]);_0x18ab5c!==_0x53490a[_0x42dedc(0x181)]?.['segmentFolderId']&&(_0x3a9bb7['segmentFolderId']=_0x18ab5c?parseInt(_0x18ab5c,0xa):undefined),await _0x1ab23a['withProgress'](_0x42dedc(0x16e)+_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]+_0x42dedc(0x14d),()=>_0x4623b7[_0x42dedc(0x10c)][_0x42dedc(0x113)](_0x2f804d[_0x42dedc(0x1f2)],_0x53490a[_0x42dedc(0x181)]['id'],_0x3a9bb7)),_0x49e2f8=_0x53490a[_0x42dedc(0x181)]['id'],_0x1ab23a[_0x42dedc(0x189)]?.({'type':_0x42dedc(0x137),'name':_0x53490a['yamlConfig'][_0x42dedc(0x127)]}),_0x1ab23a['logSuccess']?.('Updated\x20segment\x20\x27'+_0x53490a[_0x42dedc(0x1f1)]['name']+'\x27'),_0xcc5df2[_0x42dedc(0x157)]=0x1;}else _0x49e2f8=_0x53490a[_0x42dedc(0x181)]['id'];}}catch(_0x45dba8){const _0xaa36e4=isHttp400Error(_0x45dba8),_0x31acf7=_0xaa36e4?ErrorCode[_0x42dedc(0x11d)]:ErrorCode[_0x42dedc(0x117)],_0x5d04b9=getErrorMessage(_0x45dba8);throw new SDKError(_0x31acf7,'Failed\x20to\x20'+(_0x53490a[_0x42dedc(0x14c)]?_0x42dedc(0x192):_0x42dedc(0x190))+_0x42dedc(0x1bf)+_0x53490a['absolutePath']+_0x42dedc(0x10a)+_0x5d04b9,_0x45dba8);}try{const _0x4d271d=await syncActivationsForSegment(_0x4623b7,_0x2f804d[_0x42dedc(0x1f2)],_0x49e2f8,_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)],_0x53490a[_0x42dedc(0x1d9)],_0x1ab23a,_0x53490a[_0x42dedc(0x1e0)]);_0xcc5df2['activations']=_0x4d271d;}catch(_0x3954b6){if(_0x3954b6 instanceof SDKError)throw _0x3954b6;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x42dedc(0x10d)+_0x53490a[_0x42dedc(0x1f1)][_0x42dedc(0x127)]+_0x42dedc(0x16f)+_0x53490a[_0x42dedc(0x1e0)]+'\x0a\x20\x20'+getErrorMessage(_0x3954b6),_0x3954b6);}return _0xcc5df2;},_0x429a72=await batchAsync(_0x2ed7d6,_0x11c403,_0x3a1623),_0x1130f2={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xe51480 of _0x429a72){_0x1130f2[_0x563de5(0x174)]+=_0xe51480[_0x563de5(0x174)],_0x1130f2[_0x563de5(0x157)]+=_0xe51480[_0x563de5(0x157)],_0xe51480[_0x563de5(0x1f9)]&&_0x1130f2[_0x563de5(0x14e)][_0x563de5(0x160)](_0xe51480[_0x563de5(0x1f9)]['name'],_0xe51480[_0x563de5(0x1f9)]['id']),_0x1130f2[_0x563de5(0x114)][_0x563de5(0x174)]+=_0xe51480[_0x563de5(0x114)]['created'],_0x1130f2[_0x563de5(0x114)][_0x563de5(0x157)]+=_0xe51480[_0x563de5(0x114)][_0x563de5(0x157)],_0x1130f2['activations']['deleted']+=_0xe51480[_0x563de5(0x114)][_0x563de5(0x1ca)];}return _0x1130f2;}async function syncActivationsForSegment(_0x49f2a5,_0x49d39b,_0xeafb52,_0x23500c,_0xe598b2,_0x27e19d,_0x17caa8){const _0x1e073e=a114_0x33ddfe,_0x3cfddb={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x202dbe of _0xe598b2){try{if(_0x202dbe[_0x1e073e(0x1b6)]===_0x1e073e(0x192)&&_0x202dbe[_0x1e073e(0x1e5)])_0x27e19d[_0x1e073e(0x189)]?.({'type':_0x1e073e(0x15a),'segmentName':_0x23500c,'activationName':_0x202dbe[_0x1e073e(0x127)]}),await _0x27e19d[_0x1e073e(0x1e8)](_0x1e073e(0x179)+_0x202dbe[_0x1e073e(0x127)]+_0x1e073e(0x14d),()=>_0x49f2a5[_0x1e073e(0x10c)][_0x1e073e(0x1b7)](_0x49d39b,_0xeafb52,_0x202dbe[_0x1e073e(0x1e5)])),_0x27e19d[_0x1e073e(0x189)]?.({'type':'activation_created','segmentName':_0x23500c,'activationName':_0x202dbe['name']}),_0x27e19d[_0x1e073e(0x1e9)]?.(_0x1e073e(0x1d3)+_0x202dbe['name']+'\x27'),_0x3cfddb[_0x1e073e(0x174)]++;else{if(_0x202dbe[_0x1e073e(0x1b6)]===_0x1e073e(0x190)&&_0x202dbe['validatedRequest']&&_0x202dbe['existingActivation'])_0x27e19d[_0x1e073e(0x189)]?.({'type':_0x1e073e(0x16d),'segmentName':_0x23500c,'activationName':_0x202dbe[_0x1e073e(0x127)]}),await _0x27e19d[_0x1e073e(0x1e8)](_0x1e073e(0x144)+_0x202dbe[_0x1e073e(0x127)]+_0x1e073e(0x14d),()=>_0x49f2a5[_0x1e073e(0x10c)][_0x1e073e(0x1e6)](_0x49d39b,_0xeafb52,_0x202dbe['existingActivation']['id'],_0x202dbe[_0x1e073e(0x1e5)])),_0x27e19d[_0x1e073e(0x189)]?.({'type':_0x1e073e(0x16c),'segmentName':_0x23500c,'activationName':_0x202dbe[_0x1e073e(0x127)]}),_0x27e19d[_0x1e073e(0x1e9)]?.('Updated\x20activation\x20\x27'+_0x202dbe[_0x1e073e(0x127)]+'\x27'),_0x3cfddb[_0x1e073e(0x157)]++;else _0x202dbe[_0x1e073e(0x1b6)]===_0x1e073e(0x1bb)&&_0x202dbe['existingActivation']&&(_0x27e19d[_0x1e073e(0x189)]?.({'type':'activation_deleting','segmentName':_0x23500c,'activationName':_0x202dbe[_0x1e073e(0x127)]}),await _0x27e19d[_0x1e073e(0x1e8)]('Deleting\x20activation\x20\x27'+_0x202dbe[_0x1e073e(0x127)]+_0x1e073e(0x14d),()=>_0x49f2a5['segment'][_0x1e073e(0x1de)](_0x49d39b,_0xeafb52,_0x202dbe[_0x1e073e(0x122)]['id'])),_0x27e19d['onProgress']?.({'type':'activation_deleted','segmentName':_0x23500c,'activationName':_0x202dbe['name']}),_0x27e19d[_0x1e073e(0x1a0)]?.(_0x1e073e(0x156)+_0x202dbe[_0x1e073e(0x127)]+'\x27'),_0x3cfddb['deleted']++);}}catch(_0x54416a){const _0x20c2cd=isHttp400Error(_0x54416a),_0x3a198e=_0x20c2cd?ErrorCode[_0x1e073e(0x164)]:ErrorCode[_0x1e073e(0x13f)],_0x27fded=getErrorMessage(_0x54416a);throw new SDKError(_0x3a198e,_0x1e073e(0x140)+_0x202dbe['type']+_0x1e073e(0x1d8)+_0x202dbe[_0x1e073e(0x127)]+'\x27\x20from\x20file:\x20'+_0x17caa8+_0x1e073e(0x10a)+_0x27fded,_0x54416a);}}return _0x3cfddb;}export async function executePushFolders(_0x5de3cf,_0x4af0e4,_0x56401f,_0x25bcf3,_0x392561){const _0x2b1282=a114_0x33ddfe,_0x1d1258=new Map(_0x56401f);for(const _0x240bf6 of _0x4af0e4){const _0x44f9fc=_0x240bf6[_0x2b1282(0x17d)]('/'),_0x4697c2=_0x44f9fc[_0x44f9fc['length']-0x1],_0x4f03f4=_0x44f9fc[_0x2b1282(0x1af)](0x0,-0x1)[_0x2b1282(0x106)]('/'),_0x4d23a7=_0x1d1258[_0x2b1282(0x1fc)](_0x4f03f4);_0x392561[_0x2b1282(0x189)]?.({'type':'folder_creating','folder':_0x240bf6});const _0x3f354e={'name':_0x4697c2,'parentFolderId':_0x4d23a7},_0x4b8d8a=await _0x392561[_0x2b1282(0x1e8)](_0x2b1282(0x1b9)+_0x240bf6+_0x2b1282(0x14d),()=>_0x5de3cf[_0x2b1282(0x10c)][_0x2b1282(0x10f)](_0x25bcf3[_0x2b1282(0x1f2)],_0x3f354e));_0x1d1258[_0x2b1282(0x160)](_0x240bf6,_0x4b8d8a[_0x2b1282(0x102)]['id']),_0x392561[_0x2b1282(0x189)]?.({'type':_0x2b1282(0x11a),'folder':_0x240bf6,'folderId':_0x4b8d8a[_0x2b1282(0x102)]['id']}),_0x392561['logInfo']?.(_0x2b1282(0x135)+_0x240bf6+'\x27');}return _0x1d1258;}export async function executePushSegmentDeletions(_0x161523,_0x1b66cf,_0x26d43c){const _0x236764=a114_0x33ddfe;if(_0x1b66cf[_0x236764(0x18e)]===0x0)return 0x0;const {batchAsync:_0x2b8d28}=await import(_0x236764(0x1d5)),_0x111908=0x5,_0x4e4032=await _0x2b8d28(_0x1b66cf,async _0x2fd9bb=>{const _0x3a3782=_0x236764;return _0x26d43c[_0x3a3782(0x189)]?.({'type':_0x3a3782(0x17c),'name':_0x2fd9bb[_0x3a3782(0x127)]}),await _0x161523[_0x3a3782(0x10c)][_0x3a3782(0x1cf)](_0x2fd9bb['id']),_0x26d43c[_0x3a3782(0x189)]?.({'type':_0x3a3782(0x17b),'name':_0x2fd9bb[_0x3a3782(0x127)]}),_0x26d43c[_0x3a3782(0x1a0)]?.(_0x3a3782(0x142)+_0x2fd9bb[_0x3a3782(0x127)]+'\x27'),0x1;},_0x111908);return _0x4e4032['reduce']((_0x3d78c1,_0x537075)=>_0x3d78c1+_0x537075,0x0);}export async function executePushJourneys(_0x3e8514,_0x1094e3,_0x404447,_0xa1110b,_0x2eaa9a){const _0x3d8b88=a114_0x33ddfe,{journeyDefToRequest:_0x37ae32}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x5867d8,yamlRuleToApi:_0x1f47ab,validateSegmentRule:_0xfd3621}=await import(_0x3d8b88(0xfc)),_0x33115b={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x16c834=new Map(_0x404447[_0x3d8b88(0x125)]),_0x38d59b=0x5;for(let _0x510966=0x0;_0x510966<_0x1094e3[_0x3d8b88(0x18e)];_0x510966+=_0x38d59b){const _0xd50833=_0x1094e3[_0x3d8b88(0x1af)](_0x510966,_0x510966+_0x38d59b),_0x4eed43=await Promise['all'](_0xd50833['map'](async _0x4f6172=>{const _0x39273c=_0x3d8b88;if(!_0x4f6172[_0x39273c(0x14c)]&&!_0x4f6172[_0x39273c(0x170)])return{'action':_0x39273c(0x103),'name':_0x4f6172[_0x39273c(0x1f1)][_0x39273c(0x127)],'journeyId':_0x4f6172[_0x39273c(0x1c1)]?.['id']};const _0x56e618=_0x4f6172[_0x39273c(0x17e)]?_0x404447['folderPathToId'][_0x39273c(0x1fc)](_0x4f6172[_0x39273c(0x17e)]):undefined;_0x2eaa9a[_0x39273c(0x189)]?.({'type':_0x4f6172[_0x39273c(0x14c)]?'journey_creating':_0x39273c(0x1fa),'name':_0x4f6172[_0x39273c(0x1f1)][_0x39273c(0x127)]});try{const _0x1e3511=await executeSingleJourneyPush(_0x3e8514,_0x4f6172,{..._0x404447,'segmentNameToId':_0x16c834},{'parentId':_0xa1110b[_0x39273c(0x1f2)],'rootFolderId':_0xa1110b[_0x39273c(0x1b0)],'folderId':_0x56e618,'verbose':_0xa1110b[_0x39273c(0x130)]},_0x2eaa9a,{'journeyDefToRequest':_0x37ae32,'activationDefToCreateRequest':_0x5867d8,'yamlRuleToApi':_0x1f47ab,'validateSegmentRule':_0xfd3621});for(const [_0x22d05b,_0x3e8bdc]of _0x1e3511['embeddedSegmentNameToId']){_0x16c834[_0x39273c(0x160)](_0x22d05b,_0x3e8bdc),_0x33115b[_0x39273c(0x12f)][_0x39273c(0x160)](_0x22d05b,_0x3e8bdc);}if(_0x1e3511['action']===_0x39273c(0x174))_0x2eaa9a[_0x39273c(0x189)]?.({'type':_0x39273c(0x12b),'name':_0x4f6172[_0x39273c(0x1f1)][_0x39273c(0x127)],'journeyId':_0x1e3511[_0x39273c(0x1a7)]}),_0x2eaa9a[_0x39273c(0x1e9)]?.(_0x39273c(0x173)+_0x4f6172[_0x39273c(0x1f1)][_0x39273c(0x127)]+'\x27'),_0x33115b[_0x39273c(0x174)]++;else _0x1e3511[_0x39273c(0x131)]===_0x39273c(0x157)&&(_0x2eaa9a[_0x39273c(0x189)]?.({'type':_0x39273c(0x10e),'name':_0x4f6172[_0x39273c(0x1f1)]['name']}),_0x2eaa9a['logSuccess']?.('Updated\x20journey\x20\x27'+_0x4f6172['yamlConfig'][_0x39273c(0x127)]+'\x27'),_0x33115b['updated']++);return{'action':_0x1e3511['action'],'name':_0x4f6172[_0x39273c(0x1f1)]['name'],'journeyId':_0x1e3511[_0x39273c(0x1a7)]};}catch(_0x115fba){const _0x38deed=isHttp400Error(_0x115fba),_0xc60d64=_0x38deed?ErrorCode[_0x39273c(0x185)]:ErrorCode[_0x39273c(0x155)],_0x44f07b=getErrorMessage(_0x115fba);throw new SDKError(_0xc60d64,_0x39273c(0x140)+(_0x4f6172[_0x39273c(0x14c)]?_0x39273c(0x192):_0x39273c(0x190))+'\x20journey\x20from\x20file:\x20'+_0x4f6172['absolutePath']+_0x39273c(0x10a)+_0x44f07b,_0x115fba);}}));_0x33115b[_0x3d8b88(0x134)]['push'](..._0x4eed43);}return _0x33115b;}async function matchExistingJourneySegments(_0x15d854,_0x265de9,_0x27319d,_0x1b1c2e,_0x1c99f7){const _0x1a1196=a114_0x33ddfe;if(!_0x265de9[_0x1a1196(0x1c1)]||!_0x265de9[_0x1a1196(0x1f1)][_0x1a1196(0x1d6)])return;const _0x3d2b8a=new Map();for(const _0x56151b of Object[_0x1a1196(0x171)](_0x265de9[_0x1a1196(0x1f1)][_0x1a1196(0x1d6)])){const _0x33f6c2=generateDeterministicJourneySegmentName(_0x265de9[_0x1a1196(0x1f1)]['name'],_0x56151b);_0x3d2b8a[_0x1a1196(0x160)](_0x33f6c2,_0x56151b);}const _0x2ac9bc=collectSegmentIdsFromJourneyApi(_0x265de9[_0x1a1196(0x1c1)]);for(const _0x1b9483 of _0x2ac9bc){const _0x35124e=await fetchSegment(_0x15d854,_0x27319d,_0x1b9483,_0x1b1c2e);if(!_0x35124e?.[_0x1a1196(0x127)])continue;const _0xd51f9a=_0x3d2b8a['get'](_0x35124e['name']);_0xd51f9a&&_0x1c99f7[_0x1a1196(0x160)](_0xd51f9a,_0x1b9483);}}async function executeSingleJourneyPush(_0x50025e,_0x148a2e,_0xa4dcaa,_0x3f0744,_0x5808d3,_0x5aa891){const _0x4d6d6f=a114_0x33ddfe,{journeyDefToRequest:_0x29953d,activationDefToCreateRequest:_0x571653,yamlRuleToApi:_0x2446f4,validateSegmentRule:_0x590fc0}=_0x5aa891,_0x3bed37=new Map(),_0x41ed0a=new Map();recoverSegmentIdsFromPushRecovery(_0x148a2e,_0x3bed37,_0xa4dcaa[_0x4d6d6f(0x125)]);const _0xd66310=new Map(),_0x3bfd07=new Map(),_0x242f27=new Map();let _0x4fd8eb;const _0x1c7def=async()=>{const _0x564232=_0x4d6d6f;if(_0x4fd8eb)return;_0x4fd8eb=new Map();if(!_0x148a2e[_0x564232(0x1c1)])return;const _0x2108ed=await _0x50025e[_0x564232(0x123)][_0x564232(0x1d1)](_0x148a2e[_0x564232(0x1c1)]['id']);for(const _0x527440 of _0x2108ed){const _0x41586e=journeyActivationStepToYaml(_0x527440,_0xa4dcaa[_0x564232(0x159)],_0xa4dcaa[_0x564232(0x1ea)]),_0x1a98c2=activationSignature(_0x41586e);!_0x4fd8eb['has'](_0x1a98c2)&&_0x4fd8eb['set'](_0x1a98c2,_0x527440['id']),_0x41586e[_0x564232(0x127)]&&_0x41ed0a[_0x564232(0x160)](_0x41586e['name'],_0x527440['id']);}};await matchExistingJourneySegments(_0x50025e,_0x148a2e,_0x3f0744[_0x4d6d6f(0x1f2)],_0xa4dcaa[_0x4d6d6f(0x1f7)],_0xa4dcaa[_0x4d6d6f(0x125)]);const _0x153595={'resolveSegmentId':async _0x3812c2=>{const _0x5a8a8c=_0x4d6d6f,_0x41f5c5=_0xa4dcaa[_0x5a8a8c(0x125)][_0x5a8a8c(0x1fc)](_0x3812c2);if(!_0x41f5c5)throw new SDKError(ErrorCode[_0x5a8a8c(0x17f)],_0x5a8a8c(0x14b)+_0x3812c2+_0x5a8a8c(0x11f)+_0x148a2e['yamlConfig']['name']+')');return _0x41f5c5;},'resolveEmbeddedSegmentId':async(_0x375f42,_0x565c09)=>{const _0x4e6bb9=_0x4d6d6f,_0x1df69d=_0xa4dcaa[_0x4e6bb9(0x125)][_0x4e6bb9(0x1fc)](_0x375f42);if(_0x1df69d)return _0x1df69d;const _0xe7f94c=_0xa4dcaa['existingSegments'][_0x4e6bb9(0xfd)](_0x485f8a=>_0x485f8a['name']===_0x375f42);if(_0xe7f94c)return _0xa4dcaa[_0x4e6bb9(0x125)][_0x4e6bb9(0x160)](_0x375f42,_0xe7f94c['id']),_0xe7f94c['id'];if(_0x148a2e[_0x4e6bb9(0x14c)]){const {stageName:_0x4de63e,criteriaName:_0x2f5b63}=findSegmentCriteriaLocation(_0x148a2e[_0x4e6bb9(0x1f1)],_0x375f42);return _0x590fc0(_0x375f42,_0x565c09['rule']),_0x3bfd07[_0x4e6bb9(0x160)](_0x375f42,{'definition':_0x565c09,'stageName':_0x4de63e,'criteriaName':_0x2f5b63}),createPendingSegmentId(_0x375f42);}const _0x500ee6=_0x148a2e['existingJourney']?.['id'];if(!_0x500ee6)throw new SDKError(ErrorCode[_0x4e6bb9(0x15d)],_0x4e6bb9(0x1dc));const _0x4cfe3e=_0xd66310[_0x4e6bb9(0x1fc)](_0x375f42);if(_0x4cfe3e)return _0x4cfe3e;const _0x1771cc=((async()=>{const _0x5b1244=_0x4e6bb9;_0x590fc0(_0x375f42,_0x565c09['rule']);const _0x4b225b=generateDeterministicJourneySegmentName(_0x148a2e[_0x5b1244(0x1f1)][_0x5b1244(0x127)],_0x375f42),_0x99cc0f=_0xa4dcaa['existingSegments']['find'](_0x22dfe5=>_0x22dfe5[_0x5b1244(0x127)]===_0x4b225b),_0x474bb1=createSegmentIdResolver(_0xa4dcaa[_0x5b1244(0x125)],_0x375f42),_0x24fd3e=await resolveRuleSegmentIds(_0x565c09[_0x5b1244(0x1d7)],_0x474bb1);let _0x24cab9;return _0x99cc0f?(await _0x50025e['segment'][_0x5b1244(0x113)](_0x3f0744[_0x5b1244(0x1f2)],_0x99cc0f['id'],{'description':_0x565c09[_0x5b1244(0x1a8)]||_0x5b1244(0x129)+_0x375f42,'rule':_0x2446f4(_0x24fd3e,!![]),'countPopulation':!![]}),_0x24cab9=_0x99cc0f['id'],saveSegmentToPushRecovery(_0x148a2e['absolutePath'],_0x148a2e[_0x5b1244(0x1f1)]['name'],_0x375f42,{'segmentId':_0x24cab9,'uniqueServerName':_0x4b225b,'createdAt':new Date()[_0x5b1244(0x1e1)]()})):_0x24cab9=await createOrRecoverEmbeddedSegment(_0x50025e,_0x148a2e,{'localName':_0x375f42,'uniqueSegmentName':_0x4b225b,'description':_0x565c09['description']||_0x5b1244(0x129)+_0x375f42,'journeyId':_0x500ee6,'resolvedRule':_0x24fd3e,'parentId':_0x3f0744[_0x5b1244(0x1f2)],'folderId':_0x3f0744[_0x5b1244(0x1b0)]||''},_0x2446f4),_0xa4dcaa['segmentNameToId'][_0x5b1244(0x160)](_0x375f42,_0x24cab9),_0x3bed37[_0x5b1244(0x160)](_0x375f42,_0x24cab9),_0x24cab9;})());_0xd66310[_0x4e6bb9(0x160)](_0x375f42,_0x1771cc);try{return await _0x1771cc;}finally{_0xd66310['delete'](_0x375f42);}},'resolveActivationId':async _0x3db995=>{const _0x4dd861=_0x4d6d6f,_0x35c1cc=_0x41ed0a[_0x4dd861(0x1fc)](_0x3db995);if(_0x35c1cc)return _0x35c1cc;if(_0x148a2e[_0x4dd861(0x1c1)]){await _0x1c7def();const _0x5759aa=_0x41ed0a['get'](_0x3db995);if(_0x5759aa)return _0x5759aa;}throw new SDKError(ErrorCode[_0x4dd861(0x133)],_0x4dd861(0x149)+_0x3db995+'\x20(referenced\x20in\x20journey\x20'+_0x148a2e[_0x4dd861(0x1f1)][_0x4dd861(0x127)]+_0x4dd861(0x108)+_0x4dd861(0x1e4));},'resolveEmbeddedActivationId':async(_0x18bdca,_0x25215f)=>{const _0x371733=_0x4d6d6f,_0x285d4d=_0x41ed0a[_0x371733(0x1fc)](_0x18bdca);if(_0x285d4d)return _0x285d4d;if(_0x148a2e[_0x371733(0x14c)])return _0x242f27[_0x371733(0x160)](_0x18bdca,_0x25215f),createPendingActivationId(_0x18bdca);if(_0x148a2e[_0x371733(0x1c1)]){await _0x1c7def();const _0x31569f=_0x41ed0a[_0x371733(0x1fc)](_0x25215f[_0x371733(0x127)]);if(_0x31569f)return _0x41ed0a[_0x371733(0x160)](_0x18bdca,_0x31569f),_0x31569f;const _0x19aeed=activationSignature(_0x25215f),_0x3a0205=_0x4fd8eb?.[_0x371733(0x1fc)](_0x19aeed);if(_0x3a0205)return _0x41ed0a['set'](_0x18bdca,_0x3a0205),_0x3a0205;const _0x135cd6=await _0x571653(_0x25215f,_0xa4dcaa[_0x371733(0x1a6)]),_0x1fab1e={..._0x135cd6,..._0x25215f[_0x371733(0x1ae)]!==undefined&&{'runAfterJourneyRefresh':_0x25215f['run_after_journey_refresh']}},_0xdc9ac3=await _0x50025e[_0x371733(0x123)][_0x371733(0x1b7)](_0x148a2e['existingJourney']['id'],_0x1fab1e);return _0x41ed0a[_0x371733(0x160)](_0x18bdca,_0xdc9ac3['id']),_0xdc9ac3['id'];}throw new SDKError(ErrorCode[_0x371733(0x15d)],_0x371733(0x19d));},'resolveJourneyId':async _0x2728a7=>{const _0x47ee76=_0x4d6d6f;try{return await _0x50025e[_0x47ee76(0x123)][_0x47ee76(0x115)](_0x3f0744['parentId'],_0x2728a7);}catch(_0x2c708b){throw new SDKError(ErrorCode[_0x47ee76(0x133)],_0x47ee76(0x180)+_0x2728a7+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x148a2e[_0x47ee76(0x1f1)]['name']+'\x27)',_0x2c708b);}},'resolveStageId':async(_0x58dd5d,_0xa6683a)=>{const _0x533234=_0x4d6d6f,_0x4cfe97=await _0x50025e[_0x533234(0x123)]['getJourney'](_0x58dd5d),_0x5c259c=_0x4cfe97['attributes'][_0x533234(0x1ad)][_0x533234(0xfd)](_0x2d16b5=>_0x2d16b5[_0x533234(0x127)][_0x533234(0x18a)]()===_0xa6683a['toLowerCase']());if(!_0x5c259c?.['id'])throw new SDKError(ErrorCode[_0x533234(0x133)],_0x533234(0x1eb)+_0xa6683a+_0x533234(0x109)+(_0x4cfe97[_0x533234(0x1f6)][_0x533234(0x15f)]||_0x4cfe97[_0x533234(0x1f6)][_0x533234(0x127)])+'\x27');return _0x5c259c['id'];}},_0x441136=await _0x29953d(_0x148a2e[_0x4d6d6f(0x1f1)],_0x3f0744[_0x4d6d6f(0x1f2)],_0x153595),_0x56b9a1=_0x3f0744[_0x4d6d6f(0x163)]||_0x3f0744[_0x4d6d6f(0x1b0)];_0x56b9a1&&(_0x441136[_0x4d6d6f(0x177)]={'parentFolder':{'data':{'id':_0x56b9a1,'type':'folder'}}});if(_0x148a2e['isNew']){if(_0x3bfd07['size']>0x0||_0x242f27[_0x4d6d6f(0x1e7)]>0x0)return await executeThreeStepJourneyCreate(_0x50025e,_0x148a2e,_0x441136,{'pendingEmbeddedSegments':_0x3bfd07,'pendingEmbeddedActivations':_0x242f27,'embeddedSegmentNameToId':_0x3bed37,'journeyActivationNameToId':_0x41ed0a},{..._0x3f0744,'effectiveFolderId':_0x56b9a1},_0xa4dcaa,_0x5808d3,_0x5aa891);else{ensureJourneyDefaults(_0x441136[_0x4d6d6f(0x1f6)]);const _0x15a8db=await _0x50025e[_0x4d6d6f(0x123)][_0x4d6d6f(0x192)](_0x441136);return deletePushRecovery(_0x148a2e[_0x4d6d6f(0x1e0)]),{'action':_0x4d6d6f(0x174),'journeyId':_0x15a8db['id'],'embeddedSegmentNameToId':_0x3bed37};}}else{if(_0x148a2e[_0x4d6d6f(0x170)]&&_0x148a2e[_0x4d6d6f(0x1c1)])return ensureJourneyDefaults(_0x441136[_0x4d6d6f(0x1f6)]),await _0x50025e[_0x4d6d6f(0x123)][_0x4d6d6f(0x190)](_0x148a2e[_0x4d6d6f(0x1c1)]['id'],_0x441136),deletePushRecovery(_0x148a2e[_0x4d6d6f(0x1e0)]),{'action':_0x4d6d6f(0x157),'journeyId':_0x148a2e[_0x4d6d6f(0x1c1)]['id'],'embeddedSegmentNameToId':_0x3bed37};}return deletePushRecovery(_0x148a2e[_0x4d6d6f(0x1e0)]),{'action':_0x4d6d6f(0x103),'journeyId':_0x148a2e['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x3bed37};}function findSegmentCriteriaLocation(_0x1ec0a6,_0x328dc8){const _0x2e6153=a114_0x33ddfe,_0x233159=_0x1ec0a6[_0x2e6153(0x1a5)]||_0x1ec0a6[_0x2e6153(0x145)]?.[0x0]?.[_0x2e6153(0x1a5)]||[];let _0x6c7bbc=_0x2e6153(0x148),_0x4d2fb8=_0x328dc8;const _0x2c3d33=_0x1ec0a6[_0x2e6153(0x110)]||_0x1ec0a6[_0x2e6153(0x145)]?.[0x0]?.[_0x2e6153(0x110)];if(_0x2c3d33?.[_0x2e6153(0x10c)]===_0x328dc8)return{'stageName':_0x2e6153(0x110),'criteriaName':_0x2c3d33[_0x2e6153(0x127)]||_0x328dc8};_0x1a9c84:for(const _0x38ac55 of _0x233159){if(_0x38ac55['entry_criteria']?.[_0x2e6153(0x10c)]===_0x328dc8){_0x6c7bbc=_0x38ac55[_0x2e6153(0x127)],_0x4d2fb8=_0x38ac55[_0x2e6153(0x1cc)][_0x2e6153(0x127)]||_0x328dc8;break;}if(_0x38ac55[_0x2e6153(0x1df)])for(const _0x22083c of _0x38ac55['steps']){if(_0x22083c[_0x2e6153(0x1b6)]===_0x2e6153(0x1da)&&_0x22083c['with']?.['branches'])for(const _0x508d29 of _0x22083c['with'][_0x2e6153(0x11c)]){if(_0x508d29[_0x2e6153(0x10c)]===_0x328dc8){_0x6c7bbc=_0x38ac55[_0x2e6153(0x127)],_0x4d2fb8=_0x508d29['name']||_0x328dc8;break _0x1a9c84;}}}}return{'stageName':_0x6c7bbc,'criteriaName':_0x4d2fb8};}async function executeThreeStepJourneyCreate(_0xb47415,_0x12ebe2,_0xa74cb6,_0xf4f0eb,_0x4c3524,_0x1a2e3b,_0x2a3393,_0x213c9c){const _0x5aa119=a114_0x33ddfe,{activationDefToCreateRequest:_0x36f004,yamlRuleToApi:_0x26160e}=_0x213c9c,{pendingEmbeddedSegments:_0x33e23e,pendingEmbeddedActivations:_0x5a864b,embeddedSegmentNameToId:_0x2f4755}=_0xf4f0eb,_0x5c6fee=JSON[_0x5aa119(0x1be)](JSON[_0x5aa119(0x12a)](_0xa74cb6));ensureJourneyDefaults(_0x5c6fee[_0x5aa119(0x1f6)]),stripPendingIds(_0x5c6fee);const _0x1ec4c1=await _0xb47415[_0x5aa119(0x123)][_0x5aa119(0x192)](_0x5c6fee),_0x5d154d=_0x1ec4c1['id'],_0x1fe0a5=new Map();for(const _0x217902 of _0x1ec4c1[_0x5aa119(0x1f6)][_0x5aa119(0x1ad)]){_0x1fe0a5['set'](_0x217902[_0x5aa119(0x127)][_0x5aa119(0x18a)](),_0x217902['id']);}recoverSegmentIdsFromPushRecovery(_0x12ebe2,_0x2f4755,_0x1a2e3b['segmentNameToId']);for(const [_0x2e43b8,{definition:_0xbcef43}]of _0x33e23e){if(_0x2f4755['has'](_0x2e43b8)){_0x2a3393[_0x5aa119(0x189)]?.({'type':_0x5aa119(0x116),'journeyName':_0x12ebe2[_0x5aa119(0x1f1)][_0x5aa119(0x127)],'segmentName':_0x2e43b8});continue;}const _0x35272c=generateDeterministicJourneySegmentName(_0x12ebe2[_0x5aa119(0x1f1)][_0x5aa119(0x127)],_0x2e43b8);_0x2a3393['onProgress']?.({'type':'embedded_segment_creating','journeyName':_0x12ebe2[_0x5aa119(0x1f1)][_0x5aa119(0x127)],'segmentName':_0x2e43b8});const _0x1cbbd2=createSegmentIdResolver(_0x1a2e3b[_0x5aa119(0x125)],_0x2e43b8),_0x476cd5=await resolveRuleSegmentIds(_0xbcef43[_0x5aa119(0x1d7)],_0x1cbbd2),_0x486736=await createOrRecoverEmbeddedSegment(_0xb47415,_0x12ebe2,{'localName':_0x2e43b8,'uniqueSegmentName':_0x35272c,'description':_0xbcef43[_0x5aa119(0x1a8)]||_0x5aa119(0x129)+_0x2e43b8,'journeyId':_0x5d154d,'resolvedRule':_0x476cd5,'parentId':_0x4c3524['parentId'],'folderId':_0x4c3524[_0x5aa119(0x101)]||''},_0x26160e);_0x2f4755[_0x5aa119(0x160)](_0x2e43b8,_0x486736),_0x1a2e3b['segmentNameToId']['set'](_0x2e43b8,_0x486736),_0x2a3393[_0x5aa119(0x189)]?.({'type':_0x5aa119(0x116),'journeyName':_0x12ebe2[_0x5aa119(0x1f1)][_0x5aa119(0x127)],'segmentName':_0x2e43b8});}const _0x490f55=new Map();for(const [_0x2e8ffa,_0x1dd9d0]of _0x5a864b){_0x2a3393['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x12ebe2['yamlConfig']['name'],'activationName':_0x2e8ffa});const _0x107c84=await _0x36f004(_0x1dd9d0,_0x1a2e3b[_0x5aa119(0x1a6)]),_0x11e36a={..._0x107c84,..._0x1dd9d0[_0x5aa119(0x1ae)]!==undefined&&{'runAfterJourneyRefresh':_0x1dd9d0[_0x5aa119(0x1ae)]}},_0x532fda=await _0xb47415['journey'][_0x5aa119(0x1b7)](_0x5d154d,_0x11e36a);_0x490f55[_0x5aa119(0x160)](_0x2e8ffa,_0x532fda['id']),_0xf4f0eb['journeyActivationNameToId'][_0x5aa119(0x160)](_0x2e8ffa,_0x532fda['id']),_0x2a3393[_0x5aa119(0x189)]?.({'type':_0x5aa119(0x186),'journeyName':_0x12ebe2[_0x5aa119(0x1f1)][_0x5aa119(0x127)],'activationName':_0x2e8ffa});}const _0x12c5df=JSON[_0x5aa119(0x1be)](JSON[_0x5aa119(0x12a)](_0xa74cb6));return _0x12c5df['id']=_0x5d154d,ensureJourneyDefaults(_0x12c5df[_0x5aa119(0x1f6)]),resolvePendingIdsInRequest(_0x12c5df,_0xa74cb6,_0x1fe0a5,_0x2f4755,_0x490f55,_0x2a3393),await _0xb47415[_0x5aa119(0x123)]['update'](_0x5d154d,_0x12c5df),deletePushRecovery(_0x12ebe2[_0x5aa119(0x1e0)]),{'action':'created','journeyId':_0x5d154d,'embeddedSegmentNameToId':_0x2f4755};}export function stripWaitStepPendingIds(_0x3b4d6c){const _0x1a7e1a=a114_0x33ddfe,_0x3e37b7=_0x3b4d6c[_0x1a7e1a(0x187)]&&isPendingSegmentId(_0x3b4d6c['conditionSegmentId']),_0x5c4384=_0x3b4d6c[_0x1a7e1a(0x1b8)]?.[_0x1a7e1a(0x154)](_0x326b94=>_0x326b94[_0x1a7e1a(0x19b)]&&isPendingSegmentId(_0x326b94['segmentId']));(_0x3e37b7||_0x5c4384)&&(_0x3b4d6c[_0x1a7e1a(0x19c)]=_0x1a7e1a(0x120),_0x3b4d6c[_0x1a7e1a(0x126)]=0x1,_0x3b4d6c['waitStepUnit']='day',delete _0x3b4d6c[_0x1a7e1a(0x187)],delete _0x3b4d6c['conditionTimeoutDuration'],delete _0x3b4d6c[_0x1a7e1a(0x198)],delete _0x3b4d6c[_0x1a7e1a(0x1b8)]);}export function resolveWaitStepPendingIds(_0x4aacb2,_0x17508f,_0x5c84c0,_0xabb33){const _0x144249=a114_0x33ddfe;if(_0x17508f[_0x144249(0x187)]&&isPendingSegmentId(_0x17508f[_0x144249(0x187)])){const _0x390fb1=_0x5c84c0(_0x17508f[_0x144249(0x187)],_0x144249(0x132)+_0xabb33+'\x27\x20wait\x20condition');_0x390fb1&&(_0x4aacb2['waitStepType']=_0x144249(0x1cb),_0x4aacb2[_0x144249(0x187)]=_0x390fb1,delete _0x4aacb2[_0x144249(0x126)],delete _0x4aacb2[_0x144249(0x183)],_0x17508f[_0x144249(0x1b1)]!==undefined&&(_0x4aacb2[_0x144249(0x1b1)]=_0x17508f[_0x144249(0x1b1)]),_0x17508f[_0x144249(0x198)]&&(_0x4aacb2[_0x144249(0x198)]=_0x17508f[_0x144249(0x198)]));}if(_0x17508f[_0x144249(0x1b8)]){const _0x5a7825=_0x17508f[_0x144249(0x1b8)][_0x144249(0x154)](_0x2615f1=>_0x2615f1[_0x144249(0x19b)]&&isPendingSegmentId(_0x2615f1[_0x144249(0x19b)]));if(_0x5a7825){const _0x10177d=_0x17508f[_0x144249(0x1b8)]['map'](_0x1d1732=>{const _0x36bf32=_0x144249;if(_0x1d1732[_0x36bf32(0x19b)]&&isPendingSegmentId(_0x1d1732[_0x36bf32(0x19b)])){const _0x3818f1=_0x5c84c0(_0x1d1732[_0x36bf32(0x19b)],_0x36bf32(0x132)+_0xabb33+_0x36bf32(0x13d));return{..._0x1d1732,'segmentId':_0x3818f1||_0x1d1732['segmentId']};}return{..._0x1d1732};});_0x4aacb2[_0x144249(0x19c)]='Condition',_0x4aacb2[_0x144249(0x1b8)]=_0x10177d,delete _0x4aacb2[_0x144249(0x126)],delete _0x4aacb2[_0x144249(0x183)],delete _0x4aacb2[_0x144249(0x187)],delete _0x4aacb2['conditionTimeoutDuration'],delete _0x4aacb2[_0x144249(0x198)];}}}function stripPendingIds(_0x57cf96){const _0x4a1d79=a114_0x33ddfe;_0x57cf96[_0x4a1d79(0x1f6)][_0x4a1d79(0x110)]?.[_0x4a1d79(0x19b)]&&isPendingSegmentId(_0x57cf96[_0x4a1d79(0x1f6)][_0x4a1d79(0x110)][_0x4a1d79(0x19b)])&&delete _0x57cf96[_0x4a1d79(0x1f6)][_0x4a1d79(0x110)];for(const _0x29ae09 of _0x57cf96['attributes'][_0x4a1d79(0x1ad)]||[]){_0x29ae09[_0x4a1d79(0x182)]?.[_0x4a1d79(0x19b)]&&isPendingSegmentId(_0x29ae09['entryCriteria'][_0x4a1d79(0x19b)])&&delete _0x29ae09[_0x4a1d79(0x182)];_0x29ae09[_0x4a1d79(0x111)]?.['segmentId']&&isPendingSegmentId(_0x29ae09[_0x4a1d79(0x111)][_0x4a1d79(0x19b)])&&delete _0x29ae09['milestone'];_0x29ae09['exitCriterias']&&(_0x29ae09[_0x4a1d79(0xff)]=_0x29ae09['exitCriterias'][_0x4a1d79(0x17a)](_0x55d043=>!_0x55d043[_0x4a1d79(0x19b)]||!isPendingSegmentId(_0x55d043[_0x4a1d79(0x19b)])));if(_0x29ae09[_0x4a1d79(0x1df)])for(const _0x5e99eb of Object[_0x4a1d79(0x171)](_0x29ae09[_0x4a1d79(0x1df)])){const _0x4a529c=_0x29ae09[_0x4a1d79(0x1df)][_0x5e99eb];_0x4a529c[_0x4a1d79(0x1b6)]===_0x4a1d79(0x1ee)&&_0x4a529c[_0x4a1d79(0x197)]&&isPendingActivationId(_0x4a529c[_0x4a1d79(0x197)])&&(_0x4a529c[_0x4a1d79(0x197)]='');if(_0x4a529c[_0x4a1d79(0x1b6)]===_0x4a1d79(0x105)&&_0x4a529c[_0x4a1d79(0x11c)])for(const _0x1888b3 of _0x4a529c[_0x4a1d79(0x11c)]){_0x1888b3[_0x4a1d79(0x19b)]&&isPendingSegmentId(_0x1888b3['segmentId'])&&(_0x1888b3[_0x4a1d79(0x19b)]='');}_0x4a529c[_0x4a1d79(0x1b6)]===_0x4a1d79(0x188)&&stripWaitStepPendingIds(_0x4a529c);}}}function resolvePendingIdsInRequest(_0x77a1b1,_0x245fd9,_0x2b7dee,_0x51b05f,_0xeccf04,_0x5a4098){const _0xbb95bc=a114_0x33ddfe,_0x6ee0d2=(_0x2cd82b,_0x1f3af6)=>{const _0x543ef8=a114_0x1937;if(!isPendingSegmentId(_0x2cd82b))return _0x2cd82b;const _0x43ec65=extractPendingSegmentName(_0x2cd82b),_0x4a85a3=_0x51b05f[_0x543ef8(0x1fc)](_0x43ec65);return!_0x4a85a3&&_0x5a4098[_0x543ef8(0x193)]?.(_0x543ef8(0x1f3)+_0x43ec65+_0x543ef8(0x13b)+_0x1f3af6),_0x4a85a3;};if(_0x77a1b1[_0xbb95bc(0x1f6)]['goal']?.[_0xbb95bc(0x19b)]&&isPendingSegmentId(_0x77a1b1['attributes'][_0xbb95bc(0x110)][_0xbb95bc(0x19b)])){const _0x2e8c10=_0x6ee0d2(_0x77a1b1[_0xbb95bc(0x1f6)][_0xbb95bc(0x110)][_0xbb95bc(0x19b)],_0xbb95bc(0x1fb));_0x2e8c10&&(_0x77a1b1[_0xbb95bc(0x1f6)][_0xbb95bc(0x110)]['segmentId']=_0x2e8c10);}for(const _0x38a1ba of _0x77a1b1[_0xbb95bc(0x1f6)][_0xbb95bc(0x1ad)]||[]){const _0x2424f1=_0x2b7dee[_0xbb95bc(0x1fc)](_0x38a1ba[_0xbb95bc(0x127)][_0xbb95bc(0x18a)]());_0x2424f1&&(_0x38a1ba['id']=_0x2424f1);if(_0x38a1ba['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x38a1ba[_0xbb95bc(0x182)][_0xbb95bc(0x19b)])){const _0x1e5da0=_0x6ee0d2(_0x38a1ba[_0xbb95bc(0x182)]['segmentId'],'stage\x20\x27'+_0x38a1ba[_0xbb95bc(0x127)]+_0xbb95bc(0x1b2));_0x1e5da0&&(_0x38a1ba[_0xbb95bc(0x182)][_0xbb95bc(0x19b)]=_0x1e5da0);}if(_0x38a1ba['exitCriterias'])for(const _0x1aad6d of _0x38a1ba[_0xbb95bc(0xff)]){if(_0x1aad6d[_0xbb95bc(0x19b)]&&isPendingSegmentId(_0x1aad6d[_0xbb95bc(0x19b)])){const _0x33ad91=_0x6ee0d2(_0x1aad6d[_0xbb95bc(0x19b)],_0xbb95bc(0x132)+_0x38a1ba[_0xbb95bc(0x127)]+'\x27\x20exit\x20criteria');_0x33ad91&&(_0x1aad6d[_0xbb95bc(0x19b)]=_0x33ad91);}}if(_0x38a1ba[_0xbb95bc(0x111)]?.['segmentId']&&isPendingSegmentId(_0x38a1ba[_0xbb95bc(0x111)][_0xbb95bc(0x19b)])){const _0xfa0b1d=_0x6ee0d2(_0x38a1ba[_0xbb95bc(0x111)][_0xbb95bc(0x19b)],'stage\x20\x27'+_0x38a1ba[_0xbb95bc(0x127)]+'\x27\x20milestone');_0xfa0b1d&&(_0x38a1ba['milestone'][_0xbb95bc(0x19b)]=_0xfa0b1d);}if(_0x38a1ba[_0xbb95bc(0x1df)]){const _0x1f280b=_0x1a9769=>_0x245fd9[_0xbb95bc(0x1f6)]['journeyStages']?.[_0xbb95bc(0xfd)](_0xd60719=>_0xd60719['name'][_0xbb95bc(0x18a)]()===_0x38a1ba[_0xbb95bc(0x127)]['toLowerCase']())?.[_0xbb95bc(0x1df)]?.[_0x1a9769];for(const _0x321a75 of Object[_0xbb95bc(0x171)](_0x38a1ba[_0xbb95bc(0x1df)])){const _0x2ae9fe=_0x38a1ba[_0xbb95bc(0x1df)][_0x321a75],_0x40f07c=_0x1f280b(_0x321a75);if(_0x2ae9fe[_0xbb95bc(0x1b6)]==='Activation'&&_0x2ae9fe[_0xbb95bc(0x197)]&&(isPendingActivationId(_0x2ae9fe['journeyActivationStepId'])||_0x2ae9fe[_0xbb95bc(0x197)]==='')){if(_0x40f07c?.[_0xbb95bc(0x197)]&&isPendingActivationId(_0x40f07c['journeyActivationStepId'])){const _0x159414=extractPendingActivationName(_0x40f07c[_0xbb95bc(0x197)]),_0x28b4b1=_0xeccf04['get'](_0x159414);_0x28b4b1&&(_0x2ae9fe[_0xbb95bc(0x197)]=_0x28b4b1);}}if(_0x2ae9fe[_0xbb95bc(0x1b6)]===_0xbb95bc(0x105)&&_0x2ae9fe[_0xbb95bc(0x11c)]&&_0x40f07c?.[_0xbb95bc(0x11c)])for(let _0x29b155=0x0;_0x29b155<_0x2ae9fe[_0xbb95bc(0x11c)][_0xbb95bc(0x18e)];_0x29b155++){const _0x4afa80=_0x2ae9fe['branches'][_0x29b155],_0x530a26=_0x40f07c[_0xbb95bc(0x11c)][_0x29b155];if(_0x530a26?.[_0xbb95bc(0x19b)]&&isPendingSegmentId(_0x530a26[_0xbb95bc(0x19b)])){const _0x515884=_0x6ee0d2(_0x530a26[_0xbb95bc(0x19b)],_0xbb95bc(0x132)+_0x38a1ba[_0xbb95bc(0x127)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x4afa80[_0xbb95bc(0x127)]||_0x29b155)+'\x27');_0x515884&&(_0x4afa80['segmentId']=_0x515884);}}_0x2ae9fe[_0xbb95bc(0x1b6)]===_0xbb95bc(0x188)&&_0x40f07c?.[_0xbb95bc(0x1b6)]===_0xbb95bc(0x188)&&resolveWaitStepPendingIds(_0x2ae9fe,_0x40f07c,_0x6ee0d2,_0x38a1ba[_0xbb95bc(0x127)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a115_0x2696(){const _0x509b5b=['147229SUgyiv','209250IfvIkS','3gDUvlY','206084cHVxYC','35AoOTiI','976462kLznaa','name','1624959wnyRgr','104WkcayF','set','get','8092220RNoBMf','1012896BJLwxU','has','parentFolderId'];a115_0x2696=function(){return _0x509b5b;};return a115_0x2696();}(function(_0x5864a2,_0x29199d){const _0x2e62a2=a115_0x23e6,_0x1a26bf=_0x5864a2();while(!![]){try{const _0x10242d=-parseInt(_0x2e62a2(0x170))/0x1+parseInt(_0x2e62a2(0x175))/0x2*(-parseInt(_0x2e62a2(0x172))/0x3)+parseInt(_0x2e62a2(0x173))/0x4*(parseInt(_0x2e62a2(0x174))/0x5)+-parseInt(_0x2e62a2(0x16d))/0x6+parseInt(_0x2e62a2(0x177))/0x7+-parseInt(_0x2e62a2(0x169))/0x8*(parseInt(_0x2e62a2(0x171))/0x9)+parseInt(_0x2e62a2(0x16c))/0xa;if(_0x10242d===_0x29199d)break;else _0x1a26bf['push'](_0x1a26bf['shift']());}catch(_0x2407de){_0x1a26bf['push'](_0x1a26bf['shift']());}}}(a115_0x2696,0x48238));export function buildFolderIdToPathMap(_0xb87f7e){const _0x4e77c2=new Map(),_0x2a829c=new Map();for(const _0x376dd2 of _0xb87f7e){_0x2a829c['set'](_0x376dd2['id'],_0x376dd2);}const _0x59658f=new Set();for(const _0x2c7525 of _0xb87f7e){!_0x2c7525['parentFolderId']&&_0x59658f['add'](_0x2c7525['id']);}function _0x464e68(_0x32fe2e){const _0xc24b2e=a115_0x23e6;if(_0x4e77c2[_0xc24b2e(0x16e)](_0x32fe2e['id']))return _0x4e77c2['get'](_0x32fe2e['id']);if(_0x59658f['has'](_0x32fe2e['id']))return _0x4e77c2[_0xc24b2e(0x16a)](_0x32fe2e['id'],''),'';if(_0x32fe2e[_0xc24b2e(0x16f)]){const _0x42ad9d=_0x2a829c[_0xc24b2e(0x16b)](_0x32fe2e[_0xc24b2e(0x16f)]);if(_0x42ad9d){const _0x570a25=_0x464e68(_0x42ad9d),_0x15ab5f=_0x570a25?_0x570a25+'/'+_0x32fe2e[_0xc24b2e(0x176)]:_0x32fe2e['name'];return _0x4e77c2['set'](_0x32fe2e['id'],_0x15ab5f),_0x15ab5f;}}const _0x21f5b2=_0x32fe2e['name'];return _0x4e77c2[_0xc24b2e(0x16a)](_0x32fe2e['id'],_0x21f5b2),_0x21f5b2;}for(const _0x570949 of _0xb87f7e){_0x464e68(_0x570949);}return _0x4e77c2;}export function buildFolderPathToIdMap(_0x4e347b){const _0x4eb678=a115_0x23e6,_0x2a4c03=new Map(),_0x24fe5c=new Map();for(const _0x21d0cd of _0x4e347b){_0x24fe5c[_0x4eb678(0x16a)](_0x21d0cd['id'],_0x21d0cd);}const _0x4e1805=new Set();for(const _0x4a79df of _0x4e347b){!_0x4a79df['parentFolderId']&&_0x4e1805['add'](_0x4a79df['id']);}function _0x4ba1e0(_0x26d129){const _0x5ec796=_0x4eb678;if(_0x4e1805[_0x5ec796(0x16e)](_0x26d129['id']))return'';if(_0x26d129[_0x5ec796(0x16f)]){const _0x2ae236=_0x24fe5c[_0x5ec796(0x16b)](_0x26d129[_0x5ec796(0x16f)]);if(_0x2ae236){const _0x3080ab=_0x4ba1e0(_0x2ae236);return _0x3080ab?_0x3080ab+'/'+_0x26d129[_0x5ec796(0x176)]:_0x26d129[_0x5ec796(0x176)];}}return _0x26d129[_0x5ec796(0x176)];}for(const _0x99bd36 of _0x4e347b){const _0x1e5b4d=_0x4ba1e0(_0x99bd36);_0x2a4c03[_0x4eb678(0x16a)](_0x1e5b4d,_0x99bd36['id']);}return _0x2a4c03;}export function buildFolderMaps(_0x13fa9f){const _0x55bd02=a115_0x23e6,_0x58c6e0=buildFolderIdToPathMap(_0x13fa9f),_0x58fccd=new Map();for(const [_0xbdcc20,_0x1e6013]of _0x58c6e0){_0x58fccd[_0x55bd02(0x16a)](_0x1e6013,_0xbdcc20);}return{'idToPath':_0x58c6e0,'pathToId':_0x58fccd};}function a115_0x23e6(_0x52b913,_0x425d5b){_0x52b913=_0x52b913-0x169;const _0x2696f4=a115_0x2696();let _0x23e60b=_0x2696f4[_0x52b913];return _0x23e60b;}export function getFolderPath(_0x313324,_0xac7703){const _0x5f16ba=a115_0x23e6;if(!_0x313324)return'';return _0xac7703[_0x5f16ba(0x16b)](_0x313324)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f8ea7,_0x63f180){const _0x5895ad=a116_0x32da,_0x12b381=_0x2f8ea7();while(!![]){try{const _0x45f95b=parseInt(_0x5895ad(0x110))/0x1+-parseInt(_0x5895ad(0x102))/0x2*(-parseInt(_0x5895ad(0x10e))/0x3)+parseInt(_0x5895ad(0xf6))/0x4*(-parseInt(_0x5895ad(0xed))/0x5)+parseInt(_0x5895ad(0x117))/0x6+-parseInt(_0x5895ad(0x10c))/0x7+-parseInt(_0x5895ad(0x118))/0x8+parseInt(_0x5895ad(0x108))/0x9;if(_0x45f95b===_0x63f180)break;else _0x12b381['push'](_0x12b381['shift']());}catch(_0x20f897){_0x12b381['push'](_0x12b381['shift']());}}}(a116_0x2fdb,0x5c08c));import a116_0x5f5abb from'path';import{parse as a116_0x45a917}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a116_0x32da(_0x2a75a2,_0x200711){_0x2a75a2=_0x2a75a2-0xea;const _0x2fdbcc=a116_0x2fdb();let _0x32dab3=_0x2fdbcc[_0x2a75a2];return _0x32dab3;}export function parsePath(_0x4d27f3){const _0x467098=a116_0x32da;if(!_0x4d27f3||_0x4d27f3[_0x467098(0x111)]()==='')throw new Error(_0x467098(0x112));const _0x5ccfb1=_0x4d27f3[_0x467098(0x111)]();if(_0x5ccfb1==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x4d27f3};const _0x2ef351=_0x5ccfb1['startsWith']('/')?_0x5ccfb1[_0x467098(0x114)](0x1):_0x5ccfb1,_0x57d49f=_0x2ef351['split']('/')[_0x467098(0xfd)](_0x5c5199=>_0x5c5199!=='');if(_0x57d49f['length']===0x0)throw new Error(_0x467098(0xff));const _0x593904=_0x5ccfb1[_0x467098(0x107)]('/')||!isRelativePathSegment(_0x57d49f[0x0]);for(const _0x108aac of _0x57d49f){validatePathSegment(_0x108aac);}return{'segments':_0x57d49f,'isAbsolute':_0x593904,'raw':_0x4d27f3};}function isRelativePathSegment(_0xefc31f){return _0xefc31f==='.'||_0xefc31f==='..';}function validatePathSegment(_0x4c6ba7){const _0x24e23c=a116_0x32da;if(_0x4c6ba7==='')throw new Error(_0x24e23c(0x10f));if(_0x4c6ba7==='.'||_0x4c6ba7==='..')return;if(/[\x00-\x1F\x7F]/[_0x24e23c(0xf8)](_0x4c6ba7))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x4c6ba7);if(_0x4c6ba7!==_0x4c6ba7['trim']()){}}export function validatePath(_0xf8bfc1){const _0x5ef2be=a116_0x32da;if(_0xf8bfc1[_0x5ef2be(0xf4)]['length']===0x0&&!_0xf8bfc1[_0x5ef2be(0x106)])throw new Error(_0x5ef2be(0x104));if(_0xf8bfc1[_0x5ef2be(0x106)]){if(_0xf8bfc1['segments'][0x0]==='..')throw new Error(_0x5ef2be(0x103));let _0x36b71f=0x0;for(const _0x49a672 of _0xf8bfc1[_0x5ef2be(0xf4)]){if(_0x49a672==='..'){if(_0x36b71f===0x0)throw new Error(_0x5ef2be(0xfe));_0x36b71f--;}else _0x49a672!=='.'&&_0x36b71f++;}}}export function joinPaths(_0x383900,_0x136a33){const _0xd5d6be=a116_0x32da;if(!_0x383900||_0x383900==='/')return _0x136a33;if(!_0x136a33||_0x136a33==='.')return _0x383900;if(_0x136a33['startsWith']('/'))return _0x136a33;const _0x2aa1cc=parsePath(_0x383900),_0x1f2f31=parsePath(_0x136a33),_0x59bed2=[..._0x2aa1cc[_0xd5d6be(0xf4)]];for(const _0x2ccf7c of _0x1f2f31[_0xd5d6be(0xf4)]){if(_0x2ccf7c==='.')continue;else{if(_0x2ccf7c==='..'){if(_0x59bed2[_0xd5d6be(0x116)]===0x0)throw new Error(_0xd5d6be(0xf3));_0x59bed2[_0xd5d6be(0xfa)]();}else _0x59bed2[_0xd5d6be(0x101)](_0x2ccf7c);}}const _0x21e6da=_0x59bed2['join']('/');return _0x2aa1cc[_0xd5d6be(0xf9)]['startsWith']('/')?'/'+_0x21e6da:_0x21e6da;}export function normalizePath(_0x3cf319){const _0x62b6c7=a116_0x32da,_0x33d4c3=parsePath(_0x3cf319),_0x37f145=[];for(const _0x2cee52 of _0x33d4c3[_0x62b6c7(0xf4)]){if(_0x2cee52==='.')continue;else{if(_0x2cee52==='..'){if(_0x37f145[_0x62b6c7(0x116)]===0x0){if(_0x33d4c3[_0x62b6c7(0x106)])throw new Error(_0x62b6c7(0xf3));_0x37f145['push']('..');}else _0x37f145[_0x37f145['length']-0x1]==='..'?_0x37f145[_0x62b6c7(0x101)]('..'):_0x37f145[_0x62b6c7(0xfa)]();}else _0x37f145[_0x62b6c7(0x101)](_0x2cee52);}}if(_0x37f145[_0x62b6c7(0x116)]===0x0)return _0x33d4c3[_0x62b6c7(0x106)]?'/':'.';const _0x537f04=_0x37f145['join']('/');return _0x33d4c3[_0x62b6c7(0xf9)][_0x62b6c7(0x107)]('/')?'/'+_0x537f04:_0x537f04;}export function getParentPath(_0x50745b){const _0x92c851=a116_0x32da,_0x3eccfa=parsePath(_0x50745b);if(_0x3eccfa['segments'][_0x92c851(0x116)]<=0x1)return'/';const _0x13d2bd=_0x3eccfa[_0x92c851(0xf4)][_0x92c851(0x10d)](0x0,-0x1)[_0x92c851(0xeb)]('/');return _0x3eccfa[_0x92c851(0xf9)][_0x92c851(0x107)]('/')?'/'+_0x13d2bd:_0x13d2bd;}export function getBaseName(_0x213042){const _0x5bc51c=a116_0x32da,_0x5411c4=parsePath(_0x213042);return _0x5411c4[_0x5bc51c(0xf4)][_0x5411c4[_0x5bc51c(0xf4)][_0x5bc51c(0x116)]-0x1]||'';}export function isChildPath(_0x5136ce,_0x2e4812){const _0x54e058=a116_0x32da,_0x1b0b35=parsePath(_0x5136ce),_0x1ad73e=parsePath(_0x2e4812);if(_0x1b0b35[_0x54e058(0xf4)]['length']<=_0x1ad73e[_0x54e058(0xf4)][_0x54e058(0x116)])return![];for(let _0x532773=0x0;_0x532773<_0x1ad73e[_0x54e058(0xf4)][_0x54e058(0x116)];_0x532773++){if(_0x1b0b35[_0x54e058(0xf4)][_0x532773]!==_0x1ad73e['segments'][_0x532773])return![];}return!![];}export function splitPath(_0x5df25d){const _0x1015d9=a116_0x32da,_0x2b9697=parsePath(_0x5df25d);if(_0x2b9697['segments']['length']===0x0)throw new Error(_0x1015d9(0x10a));if(_0x2b9697[_0x1015d9(0xf4)][_0x1015d9(0x116)]===0x1)return{'parent':_0x2b9697[_0x1015d9(0xf4)][0x0]};return{'parent':_0x2b9697[_0x1015d9(0xf4)][0x0],'child':_0x2b9697[_0x1015d9(0xf4)][_0x1015d9(0x10d)](0x1)[_0x1015d9(0xeb)]('/')};}function a116_0x2fdb(){const _0x4e6f71=['Path\x20must\x20contain\x20at\x20least\x20one\x20segment','exists','push','17330nfSIQW','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Relative\x20path\x20cannot\x20be\x20empty','relative','isAbsolute','startsWith','2145438GDQPAj','type','Cannot\x20split\x20empty\x20path','parent_segment','3829924KLuAfV','slice','57ZDbbvb','Path\x20segment\x20cannot\x20be\x20empty','431623GBtyXw','trim','Path\x20cannot\x20be\x20empty','root','substring','No\x20tdx.json\x20found\x20for\x20file:\x20','length','3086724NBYwaW','2629488kFYRZU','name','join','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','20gJqBXv','.yml','.yaml','endsWith','File\x20not\x20found:\x20','dirname','Cannot\x20navigate\x20above\x20root','segments','readFile','96304hoqPPE','parse','test','raw','pop','journey','segment','filter','Path\x20attempts\x20to\x20navigate\x20above\x20root'];a116_0x2fdb=function(){return _0x4e6f71;};return a116_0x2fdb();}export function isYamlFilePath(_0x2612cd){const _0x44f5d0=a116_0x32da;return _0x2612cd['endsWith'](_0x44f5d0(0xee))||_0x2612cd[_0x44f5d0(0xf0)](_0x44f5d0(0xef));}export async function resolveYamlFilePath(_0xca3539,_0x48c9df=nodeFileSystem){const _0x32018d=a116_0x32da,_0x3c2984=a116_0x5f5abb['resolve'](_0xca3539);if(!await _0x48c9df[_0x32018d(0x100)](_0x3c2984))throw new Error(_0x32018d(0xf1)+_0xca3539);let _0x5f0d1f=a116_0x5f5abb[_0x32018d(0xf2)](_0x3c2984),_0x40c88b=null,_0x25e689=null;const _0x2f073c=a116_0x5f5abb['parse'](_0x5f0d1f)[_0x32018d(0x113)];while(_0x5f0d1f!==_0x2f073c){const _0x3979ca=a116_0x5f5abb[_0x32018d(0xeb)](_0x5f0d1f,'tdx.json');if(await _0x48c9df[_0x32018d(0x100)](_0x3979ca)){_0x40c88b=_0x3979ca,_0x25e689=_0x5f0d1f;break;}_0x5f0d1f=a116_0x5f5abb['dirname'](_0x5f0d1f);}if(!_0x40c88b||!_0x25e689)throw new Error(_0x32018d(0x115)+_0xca3539);const _0x4b4a18=await _0x48c9df['readFile'](_0x40c88b),_0x161359=JSON[_0x32018d(0xf7)](_0x4b4a18),_0x545172=_0x161359[_0x32018d(0x10b)];if(!_0x545172)throw new Error(_0x32018d(0xec));const _0xe80002=await _0x48c9df[_0x32018d(0xf5)](_0x3c2984),_0x18b389=a116_0x45a917(_0xe80002),_0x2cba28=_0x18b389[_0x32018d(0xea)];if(!_0x2cba28)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0xca3539);const _0x3ea79a=_0x18b389[_0x32018d(0x109)]===_0x32018d(0xfb)?_0x32018d(0xfb):_0x32018d(0xfc),_0xc6179e=a116_0x5f5abb[_0x32018d(0x105)](_0x25e689,_0x3c2984),_0x18551d=a116_0x5f5abb[_0x32018d(0xf2)](_0xc6179e),_0x16dd8b=_0x18551d==='.'?'':_0x18551d['replace'](/\\/g,'/'),_0x1af4ae=_0x16dd8b?_0x545172+'/'+_0x16dd8b+'/'+_0x2cba28:_0x545172+'/'+_0x2cba28;return{'parentSegment':_0x545172,'segmentName':_0x2cba28,'folderPath':_0x16dd8b,'fullPath':_0x1af4ae,'resourceType':_0x3ea79a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xa23d4b,_0x3f42da){const _0x3934de=a117_0x2dd8,_0x2d8215=_0xa23d4b();while(!![]){try{const _0x450bf0=parseInt(_0x3934de(0x1df))/0x1+-parseInt(_0x3934de(0x1dc))/0x2*(parseInt(_0x3934de(0x1e1))/0x3)+-parseInt(_0x3934de(0x1de))/0x4+parseInt(_0x3934de(0x1e9))/0x5*(parseInt(_0x3934de(0x1e5))/0x6)+parseInt(_0x3934de(0x1e8))/0x7*(parseInt(_0x3934de(0x1e3))/0x8)+-parseInt(_0x3934de(0x1e4))/0x9+parseInt(_0x3934de(0x1db))/0xa*(parseInt(_0x3934de(0x1dd))/0xb);if(_0x450bf0===_0x3f42da)break;else _0x2d8215['push'](_0x2d8215['shift']());}catch(_0x4213b9){_0x2d8215['push'](_0x2d8215['shift']());}}}(a117_0x16eb,0x54f77));function a117_0x2dd8(_0x47be9f,_0x25b759){_0x47be9f=_0x47be9f-0x1db;const _0x16eb08=a117_0x16eb();let _0x2dd8f2=_0x16eb08[_0x47be9f];return _0x2dd8f2;}function a117_0x16eb(){const _0xb32800=['40430zECCms','3958FqaVAq','1397lYnJxz','641524RifIBH','379613QwRSXX','Invalid\x20segment\x20reference\x20format:\x20','831Izbnww','indexOf','8agfiID','1275822ZKSpQG','457746uLPgyS','.\x20Parent\x20name\x20cannot\x20be\x20empty','.\x20Child\x20name\x20cannot\x20be\x20empty','749OxjJeY','20TtIIXA','substring'];a117_0x16eb=function(){return _0xb32800;};return a117_0x16eb();}export function parseSegmentRef(_0x40e367){const _0x2ccdc4=a117_0x2dd8,_0xa93f31=_0x40e367[_0x2ccdc4(0x1e2)]('/');if(_0xa93f31===-0x1)return{'parentId':_0x40e367};if(_0xa93f31===0x0)throw new Error(_0x2ccdc4(0x1e0)+_0x40e367+_0x2ccdc4(0x1e6));const _0xd021d8=_0x40e367[_0x2ccdc4(0x1ea)](0x0,_0xa93f31),_0x1c705f=_0x40e367[_0x2ccdc4(0x1ea)](_0xa93f31+0x1);if(_0x1c705f==='')throw new Error(_0x2ccdc4(0x1e0)+_0x40e367+_0x2ccdc4(0x1e7));return{'parentId':_0xd021d8,'childId':_0x1c705f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xcc1203,_0x2477f8){const _0x30c974=a118_0x34ba,_0x21d36a=_0xcc1203();while(!![]){try{const _0x3dcd62=-parseInt(_0x30c974(0x188))/0x1+-parseInt(_0x30c974(0x1a0))/0x2+parseInt(_0x30c974(0x17d))/0x3*(parseInt(_0x30c974(0x18f))/0x4)+-parseInt(_0x30c974(0x194))/0x5+-parseInt(_0x30c974(0x19b))/0x6+-parseInt(_0x30c974(0x191))/0x7+parseInt(_0x30c974(0x19e))/0x8;if(_0x3dcd62===_0x2477f8)break;else _0x21d36a['push'](_0x21d36a['shift']());}catch(_0x360a46){_0x21d36a['push'](_0x21d36a['shift']());}}}(a118_0x5565,0x5da70));import a118_0x1771a1 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x48fb5f){const _0xdfc28c=a118_0x34ba;return _0x48fb5f[_0xdfc28c(0x17f)]!==_0xdfc28c(0x196);}export function isScopedResolution(_0x1ef4f0){const _0x145457=a118_0x34ba;return _0x1ef4f0[_0x145457(0x17f)]==='directory'||_0x1ef4f0[_0x145457(0x17f)]===_0x145457(0x177)||_0x1ef4f0[_0x145457(0x17f)]==='context';}function a118_0x5565(){const _0x11f8af=['file_not_found','parent_segment','journey','directory','join','parent_name','startsWith','resourceType','segment','file','tdx.json','isDirectory','folderPath','stat','segmentName','6BtXVWS','readFile','type','Parent\x20segment\x20not\x20specified','No\x20tdx.json\x20found','isScoped','isFile','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','no_parent','Not\x20a\x20YAML\x20file:\x20','match','545264ezmGLS','extname','resolve','message','trim','string','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','711940aEUahQ','parse','5330563HNHoMp','parentSegment','scopedFolderPath','476070LibXog','File\x20not\x20found:\x20','error','No\x20tdx.json\x20found\x20for\x20file:\x20','basename','invalid_yaml','context','783720QiVBfG','cwd','File\x20not\x20found','17064912tDLWDW','dirname','1145754gWoBDb','no_config','replace','exists','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','relative','configDir'];a118_0x5565=function(){return _0x11f8af;};return a118_0x5565();}export function getScopedDetails(_0x489cad){const _0x6a2f11=a118_0x34ba;if(isScopedResolution(_0x489cad))return{'isScoped':_0x489cad[_0x6a2f11(0x182)],'scopedFolderPath':_0x489cad[_0x6a2f11(0x193)]};return undefined;}function a118_0x34ba(_0x2aa514,_0x4d358c){_0x2aa514=_0x2aa514-0x16e;const _0x55652f=a118_0x5565();let _0x34ba94=_0x55652f[_0x2aa514];return _0x34ba94;}async function findTdxConfigAsync(_0x3d45ff,_0x32d6c7){const _0x2e69cd=a118_0x34ba;let _0x381b62=a118_0x1771a1[_0x2e69cd(0x18a)](_0x3d45ff);const _0x329faf=a118_0x1771a1['parse'](_0x381b62)['root'];while(_0x381b62!==_0x329faf){const _0xbf08dc=a118_0x1771a1[_0x2e69cd(0x172)](_0x381b62,_0x2e69cd(0x178));if(await _0x32d6c7[_0x2e69cd(0x1a3)](_0xbf08dc))try{const _0x1f8a7e=await _0x32d6c7[_0x2e69cd(0x17e)](_0xbf08dc),_0x15f97e=JSON[_0x2e69cd(0x190)](_0x1f8a7e);if(_0x15f97e[_0x2e69cd(0x16f)]&&typeof _0x15f97e[_0x2e69cd(0x16f)]===_0x2e69cd(0x18d))return{'configPath':_0xbf08dc,'configDir':_0x381b62,'parentSegment':_0x15f97e['parent_segment']};}catch{}_0x381b62=a118_0x1771a1[_0x2e69cd(0x19f)](_0x381b62);}return null;}function calculateScopedPath(_0x20a59e,_0x45cfb4){const _0x3390ca=a118_0x34ba,_0x1cf018=a118_0x1771a1[_0x3390ca(0x1a5)](_0x45cfb4,_0x20a59e),_0xf3a7f7=_0x1cf018!==''&&_0x1cf018!=='.'&&!_0x1cf018[_0x3390ca(0x174)]('..');return{'isScoped':_0xf3a7f7,'scopedFolderPath':_0xf3a7f7?_0x1cf018[_0x3390ca(0x1a2)](/\\/g,'/'):''};}export async function resolveTarget(_0x1eedf0){const _0x5bbd70=a118_0x34ba,{arg:_0x4584bb,contextParent:_0x15050a,cwd:cwd=process[_0x5bbd70(0x19c)](),fs:fs=nodeFileSystem}=_0x1eedf0;if(_0x4584bb&&isYamlFilePath(_0x4584bb))try{const _0x1dd3c0=await resolveYamlFilePath(_0x4584bb,fs),_0xd77a89=a118_0x1771a1[_0x5bbd70(0x18a)](_0x4584bb),_0x17eaa8=a118_0x1771a1[_0x5bbd70(0x19f)](_0xd77a89),_0x2302ce=await findTdxConfigAsync(_0x17eaa8,fs);if(!_0x2302ce){if(_0x15050a){const _0x527224=a118_0x1771a1[_0x5bbd70(0x19f)](_0xd77a89);return{'type':'file','parentName':_0x15050a,'targetDir':_0x527224,'configRoot':_0x527224,'filePath':_0xd77a89,'resourceName':_0x1dd3c0[_0x5bbd70(0x17c)],'folderPath':_0x1dd3c0['folderPath'],'resourceType':_0x1dd3c0[_0x5bbd70(0x175)],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x5bbd70(0x1a1),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x4584bb,'arg':_0x4584bb,'helpText':_0x5bbd70(0x1a4)};}const _0x232ae3=calculateScopedPath(_0x17eaa8,_0x2302ce['configDir']);return{'type':_0x5bbd70(0x177),'parentName':_0x2302ce[_0x5bbd70(0x192)],'targetDir':_0x2302ce['configDir'],'configRoot':_0x2302ce[_0x5bbd70(0x1a6)],'filePath':_0xd77a89,'resourceName':_0x1dd3c0['segmentName'],'folderPath':_0x1dd3c0[_0x5bbd70(0x17a)],'resourceType':_0x1dd3c0[_0x5bbd70(0x175)],'isScoped':_0x232ae3[_0x5bbd70(0x182)],'scopedFolderPath':_0x232ae3[_0x5bbd70(0x193)]};}catch(_0x524c4d){const _0x324a61=_0x524c4d instanceof Error?_0x524c4d[_0x5bbd70(0x18b)]:String(_0x524c4d);if(_0x324a61['includes'](_0x5bbd70(0x19d)))return{'type':_0x5bbd70(0x196),'errorCode':_0x5bbd70(0x16e),'message':_0x5bbd70(0x195)+_0x4584bb,'arg':_0x4584bb};if(_0x324a61['includes'](_0x5bbd70(0x181))){if(_0x15050a){const _0x2a3198=a118_0x1771a1[_0x5bbd70(0x18a)](_0x4584bb);if(await fs[_0x5bbd70(0x1a3)](_0x2a3198)){const _0x2cf7a0=a118_0x1771a1[_0x5bbd70(0x19f)](_0x2a3198),_0x390c94=await fs[_0x5bbd70(0x17e)](_0x2a3198),_0x635139=_0x390c94[_0x5bbd70(0x187)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x25469a=_0x390c94['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x26a5db=_0x635139?_0x635139[0x1]['trim']():a118_0x1771a1[_0x5bbd70(0x198)](_0x4584bb,a118_0x1771a1[_0x5bbd70(0x189)](_0x4584bb)),_0x2ba42d=_0x25469a&&_0x25469a[0x1][_0x5bbd70(0x18c)]()===_0x5bbd70(0x170)?_0x5bbd70(0x170):_0x5bbd70(0x176);return{'type':_0x5bbd70(0x177),'parentName':_0x15050a,'targetDir':_0x2cf7a0,'configRoot':_0x2cf7a0,'filePath':_0x2a3198,'resourceName':_0x26a5db,'folderPath':'','resourceType':_0x2ba42d,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0x5bbd70(0x1a1),'message':_0x5bbd70(0x197)+_0x4584bb,'arg':_0x4584bb,'helpText':_0x5bbd70(0x1a4)};}return{'type':_0x5bbd70(0x196),'errorCode':_0x5bbd70(0x199),'message':_0x324a61,'arg':_0x4584bb};}if(_0x4584bb){const _0x160695=a118_0x1771a1[_0x5bbd70(0x18a)](cwd,_0x4584bb);let _0x4cbf01=null;try{_0x4cbf01=await fs[_0x5bbd70(0x17b)](_0x160695);}catch{}if(_0x4cbf01?.[_0x5bbd70(0x179)]()){const _0x1ae682=await findTdxConfigAsync(_0x160695,fs);if(_0x1ae682){const _0x4f96c8=calculateScopedPath(_0x160695,_0x1ae682['configDir']);return{'type':_0x5bbd70(0x171),'parentName':_0x1ae682[_0x5bbd70(0x192)],'targetDir':_0x160695,'configRoot':_0x1ae682[_0x5bbd70(0x1a6)],'isScoped':_0x4f96c8[_0x5bbd70(0x182)],'scopedFolderPath':_0x4f96c8[_0x5bbd70(0x193)]};}if(_0x15050a)return{'type':'directory','parentName':_0x15050a,'targetDir':_0x160695,'configRoot':_0x160695,'isScoped':![],'scopedFolderPath':''};return{'type':_0x5bbd70(0x196),'errorCode':_0x5bbd70(0x1a1),'message':_0x5bbd70(0x18e)+_0x4584bb,'arg':_0x4584bb,'helpText':_0x5bbd70(0x1a4)};}if(_0x4cbf01?.[_0x5bbd70(0x183)]())return{'type':_0x5bbd70(0x196),'errorCode':_0x5bbd70(0x199),'message':_0x5bbd70(0x186)+_0x4584bb,'arg':_0x4584bb,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x29ee1c=sanitizeFileName(_0x4584bb),_0x30896c=getSegmentRootDir(_0x29ee1c,cwd);return{'type':_0x5bbd70(0x173),'parentName':_0x4584bb,'targetDir':_0x30896c,'configRoot':_0x30896c};}const _0x1135b1=await findTdxConfigAsync(cwd,fs);if(_0x1135b1){const _0x2675be=calculateScopedPath(cwd,_0x1135b1['configDir']);return{'type':_0x5bbd70(0x19a),'parentName':_0x1135b1[_0x5bbd70(0x192)],'targetDir':cwd,'configRoot':_0x1135b1[_0x5bbd70(0x1a6)],'isScoped':_0x2675be[_0x5bbd70(0x182)],'scopedFolderPath':_0x2675be[_0x5bbd70(0x193)]};}if(_0x15050a){const _0x48d42a=sanitizeFileName(_0x15050a),_0x51439c=getSegmentRootDir(_0x48d42a,cwd);return{'type':_0x5bbd70(0x19a),'parentName':_0x15050a,'targetDir':_0x51439c,'configRoot':_0x51439c,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x5bbd70(0x185),'message':_0x5bbd70(0x180),'helpText':_0x5bbd70(0x184)};}
|