@treasuredata/tdx 2026.3.22 → 2026.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a141_0x2cafae=a141_0x372a;(function(_0x304033,_0x41a26b){const _0xaa6287=a141_0x372a,_0x3946a3=_0x304033();while(!![]){try{const _0x524b2f=-parseInt(_0xaa6287(0x1da))/0x1*(-parseInt(_0xaa6287(0x1e5))/0x2)+-parseInt(_0xaa6287(0x1d2))/0x3+parseInt(_0xaa6287(0x1dd))/0x4*(-parseInt(_0xaa6287(0x1d0))/0x5)+-parseInt(_0xaa6287(0x1dc))/0x6*(-parseInt(_0xaa6287(0x1d6))/0x7)+parseInt(_0xaa6287(0x1e3))/0x8+parseInt(_0xaa6287(0x1db))/0x9+parseInt(_0xaa6287(0x1cb))/0xa;if(_0x524b2f===_0x41a26b)break;else _0x3946a3['push'](_0x3946a3['shift']());}catch(_0x305729){_0x3946a3['push'](_0x3946a3['shift']());}}}(a141_0x124b,0xc8e6a));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x12b1d8 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a141_0x2cafae(0x1d1));export function getPushRecoveryPath(_0x1d3066){const _0x34c623=a141_0x2cafae,_0x38b6af=a141_0x12b1d8[_0x34c623(0x1df)](_0x1d3066),_0x1cf306=a141_0x12b1d8[_0x34c623(0x1d7)](_0x1d3066);return a141_0x12b1d8[_0x34c623(0x1e4)](_0x38b6af,'.'+_0x1cf306+_0x34c623(0x1d3));}export function readPushRecovery(_0x31f2e4){const _0x545a3a=a141_0x2cafae,_0x4849b8=getPushRecoveryPath(_0x31f2e4);if(!existsSync(_0x4849b8))return undefined;try{const _0x338a2f=readFileSync(_0x4849b8,_0x545a3a(0x1d8)),_0x54feb7=JSON[_0x545a3a(0x1e2)](_0x338a2f);if(_0x54feb7?.[_0x545a3a(0x1d4)]!==0x1||typeof _0x54feb7[_0x545a3a(0x1d9)]!=='string')return undefined;return _0x54feb7;}catch(_0xaa68d8){return _0xaa68d8 instanceof SyntaxError?logger[_0x545a3a(0x1cf)](_0x545a3a(0x1de)+_0xaa68d8):logger[_0x545a3a(0x1d5)](_0x545a3a(0x1cd)+_0xaa68d8),undefined;}}function a141_0x372a(_0x5d8463,_0xf9aab6){_0x5d8463=_0x5d8463-0x1c9;const _0x124b20=a141_0x124b();let _0x372a08=_0x124b20[_0x5d8463];return _0x372a08;}export function writePushRecovery(_0x1af673,_0x38ddeb){const _0x13dfc7=a141_0x2cafae,_0x319832=getPushRecoveryPath(_0x1af673),_0x4d8393=_0x319832+_0x13dfc7(0x1e0);writeFileSync(_0x4d8393,JSON[_0x13dfc7(0x1ca)](_0x38ddeb,null,0x2)+'\x0a',_0x13dfc7(0x1d8)),renameSync(_0x4d8393,_0x319832);}export function deletePushRecovery(_0x14f963){const _0x225abf=a141_0x2cafae,_0x4a1ee5=getPushRecoveryPath(_0x14f963);try{unlinkSync(_0x4a1ee5);}catch(_0x511eb5){_0x511eb5[_0x225abf(0x1e1)]!==_0x225abf(0x1c9)&&logger[_0x225abf(0x1cf)](_0x225abf(0x1cc)+_0x511eb5);}}function a141_0x124b(){const _0x2098d0=['10138992tKvYXl','join','220750fvNlwQ','ENOENT','stringify','736280VmHOtB','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','toISOString','debug','3786655piZoae','tdx.sdk.push-recovery','2903412QFwnly','.push-recovery.json','version','warn','203rReZEZ','basename','utf-8','journeyName','9SjDwOC','5161023DhRNzP','82248JcFsiQ','8gRuMCl','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','dirname','.tmp','code','parse'];a141_0x124b=function(){return _0x2098d0;};return a141_0x124b();}export function saveSegmentToPushRecovery(_0xae16e8,_0x1670aa,_0x23ffb3,_0x436733){const _0x44f00a=a141_0x2cafae,_0x2c859e=readPushRecovery(_0xae16e8),_0x5cc49a=_0x2c859e?.[_0x44f00a(0x1d9)]===_0x1670aa?{..._0x2c859e,'updatedAt':new Date()[_0x44f00a(0x1ce)]()}:{'version':0x1,'journeyName':_0x1670aa,'updatedAt':new Date()[_0x44f00a(0x1ce)](),'segments':{}};_0x5cc49a['segments'][_0x23ffb3]=_0x436733,writePushRecovery(_0xae16e8,_0x5cc49a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a142_0x420e71=a142_0x1102;(function(_0x412528,_0x14e260){const _0xda0a69=a142_0x1102,_0x13b2dc=_0x412528();while(!![]){try{const _0x2f8ca4=-parseInt(_0xda0a69(0x11b))/0x1+-parseInt(_0xda0a69(0x14a))/0x2*(parseInt(_0xda0a69(0x15e))/0x3)+-parseInt(_0xda0a69(0x20d))/0x4+-parseInt(_0xda0a69(0x1f2))/0x5+-parseInt(_0xda0a69(0x18d))/0x6+parseInt(_0xda0a69(0x1df))/0x7*(-parseInt(_0xda0a69(0x175))/0x8)+parseInt(_0xda0a69(0x1a8))/0x9*(parseInt(_0xda0a69(0x204))/0xa);if(_0x2f8ca4===_0x14e260)break;else _0x13b2dc['push'](_0x13b2dc['shift']());}catch(_0xe291fb){_0x13b2dc['push'](_0x13b2dc['shift']());}}}(a142_0x161b,0xef82f));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a142_0x420e71(0x1ee);export function createPendingSegmentId(_0x20303d){return''+PENDING_SEGMENT_PREFIX+_0x20303d+'__';}export function isPendingSegmentId(_0x24dd54){const _0x3e4c87=a142_0x420e71;return _0x24dd54['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x24dd54[_0x3e4c87(0x194)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x54f6dc){const _0x3b57f7=a142_0x420e71;return _0x54f6dc[_0x3b57f7(0x1cc)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5316e2){return''+PENDING_ACTIVATION_PREFIX+_0x5316e2+'__';}export function isPendingActivationId(_0x2340e2){const _0x32978c=a142_0x420e71;return _0x2340e2[_0x32978c(0x194)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x486d67){const _0x246140=a142_0x420e71;return _0x486d67[_0x246140(0x1cc)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0xd79b0e,_0x59e768){const _0x3ee0cd=a142_0x420e71,_0xdff49b=_0xd79b0e+'::'+(_0x59e768[_0x3ee0cd(0x145)]()||_0x3ee0cd(0x1e2)),_0xc48be0=createHash(_0x3ee0cd(0x191))['update'](_0xdff49b)[_0x3ee0cd(0x186)](_0x3ee0cd(0x140))[_0x3ee0cd(0x1ec)](0x0,0xc);return _0x3ee0cd(0x152)+_0xc48be0;}export function ensureJourneyDefaults(_0x52544b){const _0x22c2b5=a142_0x420e71;!_0x52544b[_0x22c2b5(0x131)]&&(_0x52544b['description']=''),!_0x52544b['state']&&(_0x52544b['state']=_0x22c2b5(0x1fa));}export function injectExistingStageIds(_0x1e11e4,_0x4dd1d3){const _0x13a950=a142_0x420e71,_0x108165=new Map(_0x4dd1d3['map'](_0x26a0d4=>[_0x26a0d4['name'],_0x26a0d4['id']]));for(const _0x5e29f8 of _0x1e11e4){if(!_0x5e29f8['id']){const _0x4cca69=_0x108165[_0x13a950(0x11c)](_0x5e29f8[_0x13a950(0x203)]);_0x4cca69&&(_0x5e29f8['id']=_0x4cca69);}}}export function resolveTDFolderPath(_0x3af5a9,_0x34c048,_0x10be1a){const _0x121700=a142_0x420e71;if(!_0x34c048)return _0x3af5a9;if(_0x3af5a9===_0x10be1a||_0x3af5a9[_0x121700(0x194)](_0x10be1a+'/'))return _0x3af5a9;return _0x3af5a9?_0x10be1a+'/'+_0x3af5a9:_0x10be1a;}export function addFoldersToCreate(_0x37db9b,_0x426229,_0x512c93){const _0x95c86c=a142_0x420e71;if(!_0x37db9b)return;if(_0x426229['has'](_0x37db9b))return;const _0x287c41=_0x37db9b[_0x95c86c(0x1c5)]('/');let _0x33bd92='';for(const _0x35faef of _0x287c41){_0x33bd92=_0x33bd92?_0x33bd92+'/'+_0x35faef:_0x35faef,!_0x426229['has'](_0x33bd92)&&_0x512c93[_0x95c86c(0x166)](_0x33bd92);}}export function sortFoldersByDepth(_0x12b25c){const _0x52ac1d=a142_0x420e71;return[..._0x12b25c][_0x52ac1d(0x1f4)]((_0x3841e0,_0x28c98e)=>{const _0x1fe76b=_0x52ac1d,_0x3c1630=(_0x3841e0[_0x1fe76b(0x1ad)](/\//g)||[])['length'],_0x355306=(_0x28c98e[_0x1fe76b(0x1ad)](/\//g)||[])['length'];return _0x3c1630-_0x355306;});}import*as a142_0x18c254 from'yaml';import{readFileSync}from'fs';import a142_0x30d89b from'path';import{isJourneyDef,parseYamlString as a142_0x55284e,toYamlString as a142_0x5bf15a,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(_0x474a1a){const _0x13ab0a=a142_0x420e71;if(Array[_0x13ab0a(0x12d)](_0x474a1a))return'['+_0x474a1a[_0x13ab0a(0x209)](_0xdf2a8=>stableStringify(_0xdf2a8))[_0x13ab0a(0x1f5)](',')+']';if(_0x474a1a&&typeof _0x474a1a==='object'){const _0xf212d6=_0x474a1a,_0x4412d2=Object[_0x13ab0a(0x14c)](_0xf212d6)[_0x13ab0a(0x1f4)](),_0x19e418=_0x4412d2[_0x13ab0a(0x209)](_0x5015e8=>'\x22'+_0x5015e8+'\x22:'+stableStringify(_0xf212d6[_0x5015e8]));return'{'+_0x19e418[_0x13ab0a(0x1f5)](',')+'}';}const _0x4a1959=JSON[_0x13ab0a(0x1e3)](_0x474a1a);return _0x4a1959===undefined?'null':_0x4a1959;}function activationSignature(_0x2a506f){const _0x523230=a142_0x420e71,_0x234edb={'connection':_0x2a506f[_0x523230(0x19d)],..._0x2a506f['all_columns']!==undefined&&{'all_columns':_0x2a506f['all_columns']},..._0x2a506f[_0x523230(0x127)]!==undefined&&{'columns':_0x2a506f['columns']},..._0x2a506f[_0x523230(0x1d7)]!==undefined&&{'behavior':_0x2a506f['behavior']},..._0x2a506f['schedule']!==undefined&&{'schedule':_0x2a506f[_0x523230(0x156)]},..._0x2a506f[_0x523230(0x183)]!==undefined&&{'notification':_0x2a506f[_0x523230(0x183)]},..._0x2a506f[_0x523230(0x1bd)]!==undefined&&{'connector_config':_0x2a506f[_0x523230(0x1bd)]},..._0x2a506f[_0x523230(0x178)]!==undefined&&{'activation_template_id':_0x2a506f[_0x523230(0x178)]}};return stableStringify(_0x234edb);}function a142_0x1102(_0x151eef,_0x36e3d8){_0x151eef=_0x151eef-0x117;const _0x161bb9=a142_0x161b();let _0x1102d4=_0x161bb9[_0x151eef];return _0x1102d4;}async function fetchSegment(_0x34198f,_0x548df9,_0x69a0fb,_0x52c659){const _0x48758d=a142_0x420e71,_0x32172a=_0x52c659?.[_0x48758d(0x172)](_0x1348cc=>_0x1348cc['id']===_0x69a0fb);if(_0x32172a)return _0x32172a;try{return await _0x34198f['segment'][_0x48758d(0x182)](_0x548df9,_0x69a0fb);}catch(_0x4c0502){logger[_0x48758d(0x1e7)](_0x48758d(0x144)+_0x69a0fb+_0x48758d(0x1a4)+_0x4c0502);try{return await _0x34198f[_0x48758d(0x1e2)]['getSegmentEntity'](_0x69a0fb);}catch(_0x51da59){return logger['debug'](_0x48758d(0x205)+_0x69a0fb+':\x20'+_0x51da59),null;}}}function recoverSegmentIdsFromPushRecovery(_0x57b4e8,_0x15aafa,_0x1e50c9){const _0x12517e=a142_0x420e71,_0x248559=readPushRecovery(_0x57b4e8[_0x12517e(0x180)]);if(_0x248559?.['journeyName']===_0x57b4e8[_0x12517e(0x159)][_0x12517e(0x203)])for(const [_0x4b2b90,_0x19fca5]of Object[_0x12517e(0x1ab)](_0x248559['segments'])){const _0x160bf3=generateDeterministicJourneySegmentName(_0x57b4e8[_0x12517e(0x159)][_0x12517e(0x203)],_0x4b2b90);_0x19fca5[_0x12517e(0x208)]===_0x160bf3&&(_0x15aafa[_0x12517e(0x1f9)](_0x4b2b90,_0x19fca5[_0x12517e(0x20a)]),_0x1e50c9[_0x12517e(0x1f9)](_0x4b2b90,_0x19fca5[_0x12517e(0x20a)]));}}async function createOrRecoverEmbeddedSegment(_0x9da904,_0x4e8111,_0x3e0fa7,_0x1e8fc1){const _0x1af0c6=a142_0x420e71;let _0x32ab69;try{_0x32ab69=await _0x9da904[_0x1af0c6(0x1e2)][_0x1af0c6(0x1b9)]({'name':_0x3e0fa7[_0x1af0c6(0x1bc)],'description':_0x3e0fa7[_0x1af0c6(0x131)],'journeyId':_0x3e0fa7[_0x1af0c6(0x147)],'rule':_0x1e8fc1(_0x3e0fa7[_0x1af0c6(0x1d5)],!![]),'countPopulation':!![],'parentFolderId':_0x3e0fa7[_0x1af0c6(0x201)],'audienceId':_0x3e0fa7[_0x1af0c6(0x1f3)]});}catch(_0x3a66e2){const _0x3d7b80=_0x3a66e2 instanceof Error&&_0x3a66e2[_0x1af0c6(0x1f1)][_0x1af0c6(0x14f)](_0x1af0c6(0x157));if(_0x3d7b80){const _0xb72998=readPushRecovery(_0x4e8111[_0x1af0c6(0x180)]),_0x1453a7=_0xb72998?.[_0x1af0c6(0x176)]===_0x4e8111[_0x1af0c6(0x159)][_0x1af0c6(0x203)]?_0xb72998[_0x1af0c6(0x19c)][_0x3e0fa7[_0x1af0c6(0x1aa)]]:undefined;if(_0x1453a7?.['uniqueServerName']===_0x3e0fa7[_0x1af0c6(0x1bc)])await _0x9da904[_0x1af0c6(0x1e2)][_0x1af0c6(0x177)](_0x3e0fa7[_0x1af0c6(0x1f3)],_0x1453a7['segmentId'],{'description':_0x3e0fa7[_0x1af0c6(0x131)],'rule':_0x1e8fc1(_0x3e0fa7[_0x1af0c6(0x1d5)],!![]),'countPopulation':!![]}),_0x32ab69=_0x1453a7['segmentId'];else throw new SDKError(ErrorCode[_0x1af0c6(0x1c9)],'Embedded\x20segment\x20\x27'+_0x3e0fa7['localName']+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x1af0c6(0x188)+_0x4e8111[_0x1af0c6(0x180)][_0x1af0c6(0x1cc)](/([^/]+)$/,_0x1af0c6(0x136))+')\x20')+_0x1af0c6(0x1ef),_0x3a66e2);}else throw _0x3a66e2;}return saveSegmentToPushRecovery(_0x4e8111['absolutePath'],_0x4e8111[_0x1af0c6(0x159)]['name'],_0x3e0fa7[_0x1af0c6(0x1aa)],{'segmentId':_0x32ab69,'uniqueServerName':_0x3e0fa7[_0x1af0c6(0x1bc)],'createdAt':new Date()[_0x1af0c6(0x11d)]()}),_0x32ab69;}export async function prepareSegmentFiles(_0x275009,_0x23adf5,_0x27bdbf,_0x41c317,_0x2963e3){const _0x53aeef=a142_0x420e71,{activationDefToCreateRequest:_0x34e1e1}=await import(_0x53aeef(0x125)),_0x347b81=[],_0x3df52f=new Set();for(const {yamlConfig:_0x3817e1,folderPath:_0x5956fe,sourcePath:_0x5cc731}of _0x275009){const _0x992707=resolveTDFolderPath(_0x5956fe,_0x41c317,_0x2963e3),_0x3a8a2a=_0x992707+':'+_0x3817e1['name'],_0x30a67d=_0x23adf5[_0x53aeef(0x17e)][_0x53aeef(0x11c)](_0x3a8a2a),_0x39138b=_0x30a67d?_0x23adf5[_0x53aeef(0x1d4)][_0x53aeef(0x11c)](_0x30a67d['id'])||[]:[];addFoldersToCreate(_0x992707,_0x23adf5['folderPathToId'],_0x3df52f);const _0xf8af33=calculateActivationActions(_0x3817e1[_0x53aeef(0x1fc)]||[],_0x39138b,_0x23adf5[_0x53aeef(0x143)],_0x23adf5['connectionIdToNameMap']);for(const _0x5817cb of _0xf8af33){(_0x5817cb[_0x53aeef(0x167)]===_0x53aeef(0x132)||_0x5817cb[_0x53aeef(0x167)]==='update')&&_0x5817cb[_0x53aeef(0x15c)]&&(_0x5817cb[_0x53aeef(0x169)]=await _0x34e1e1(_0x5817cb[_0x53aeef(0x15c)],_0x27bdbf));}const _0x11b30a=calculateSegmentDiff(_0x3817e1,_0x30a67d,_0x39138b,_0x23adf5['idToEmailMap'],_0x23adf5[_0x53aeef(0x1af)]);_0x347b81[_0x53aeef(0x170)]({'relativePath':_0x3817e1['name'],'absolutePath':_0x5cc731,'yamlConfig':_0x3817e1,'folderPath':_0x992707,'existingSegment':_0x30a67d,'existingActivations':_0x39138b,'isNew':_0x11b30a['isNew'],'hasChanges':_0x11b30a[_0x53aeef(0x1b0)],'diff':_0x11b30a[_0x53aeef(0x1c6)],'activationActions':_0xf8af33});}return{'segmentFiles':_0x347b81,'foldersToCreate':_0x3df52f};}export async function prepareJourneyFiles(_0x4108ed,_0x3b284d,_0x499695,_0x301b44){const _0x1c0912=a142_0x420e71,_0x24b412=[],_0x21c269=new Set();for(const {yamlConfig:_0xe8eff9,folderPath:_0x7f0ad0,sourcePath:_0x44eb82}of _0x4108ed){const _0x5a6d44=resolveTDFolderPath(_0x7f0ad0,_0x499695,_0x301b44),_0x57b6c3=_0x5a6d44+':'+_0xe8eff9['name'],_0x310d2b=_0x3b284d[_0x1c0912(0x18f)]['get'](_0x57b6c3);let _0x577ff1,_0x1ad54e;if(_0x310d2b&&_0x310d2b[_0x1c0912(0x118)]>0x0){const _0x155bc2=buildLocalExpandedRuleMappings(_0xe8eff9),{createYamlContext:_0x572ad4,prefetchJourneySegments:_0x112314}=createPushYamlContextForBundle(_0x3b284d[_0x1c0912(0x1e9)],_0x3b284d[_0x1c0912(0x1f3)],_0x3b284d[_0x1c0912(0x199)],_0x155bc2,_0x3b284d[_0x1c0912(0x143)],_0x3b284d[_0x1c0912(0x1af)],_0x3b284d[_0x1c0912(0x1fe)],_0x3b284d[_0x1c0912(0x189)]);await _0x112314(_0x310d2b['map'](_0x1e8582=>_0x1e8582['id']));const _0x57a8ae=await _0x3b284d['deps']['journey']['getLatestJourneyId'](_0x310d2b[0x0][_0x1c0912(0x1ac)]),_0x5ae37c=hasMultipleVersions(_0xe8eff9),_0x5ce0d1=async _0x5a6efa=>{const _0x3f160d=_0x1c0912,_0x55d19b=_0x3b284d[_0x3f160d(0x189)]?.[_0x3f160d(0x11c)](_0x5a6efa);if(_0x55d19b)return _0x55d19b;return _0x3b284d['fetchJourney']({'journeyId':_0x5a6efa,'journeyName':_0xe8eff9[_0x3f160d(0x203)],'isMultiVersion':_0x310d2b['length']>0x1});};if(_0x5ae37c&&_0x310d2b[_0x1c0912(0x118)]>0x1){const _0x4d4e73=[];for(const _0x135b3d of _0x310d2b){const _0x363905=_0x135b3d['versionNumber']||0x1;_0x3b284d[_0x1c0912(0x15f)]?.[_0x1c0912(0x192)](_0x1c0912(0x129)+_0xe8eff9[_0x1c0912(0x203)]+'\x20v'+_0x363905);const _0x457408=await _0x5ce0d1(_0x135b3d['id']),_0x349703=_0x572ad4(_0x135b3d['id']),_0x50964d=await journeyResponseToDef(_0x457408,_0x349703);_0x4d4e73[_0x1c0912(0x170)]({'item':_0x135b3d,'yaml':_0x50964d});}const _0xd98c6b=buildLocalRuleToNameMappingFromJourney(_0xe8eff9);_0x1ad54e=buildMergedJourneyDef(_0x4d4e73,_0xd98c6b,_0x57a8ae);const _0x1fcc14=Math[_0x1c0912(0x120)](..._0x4d4e73[_0x1c0912(0x209)](_0x5bd658=>_0x5bd658[_0x1c0912(0x207)]['versionNumber']||0x0)),_0x1960ec=_0x310d2b[_0x1c0912(0x172)](_0x1bf475=>(_0x1bf475[_0x1c0912(0x213)]||0x0)===_0x1fcc14);_0x1960ec&&(_0x3b284d[_0x1c0912(0x15f)]?.[_0x1c0912(0x192)](_0x1c0912(0x129)+_0xe8eff9['name']+'\x20v'+_0x1fcc14),_0x577ff1=await _0x5ce0d1(_0x1960ec['id']));}else{const _0x5e1083=_0x310d2b[_0x310d2b[_0x1c0912(0x118)]-0x1];_0x3b284d['progress']?.['update'](_0x1c0912(0x129)+_0xe8eff9[_0x1c0912(0x203)]),_0x577ff1=await _0x5ce0d1(_0x5e1083['id']);const _0x47eaf3=_0x572ad4(_0x5e1083['id']),_0x21681c=await journeyResponseToDef(_0x577ff1,_0x47eaf3),_0x5b7eee=buildLocalRuleToNameMappingFromJourney(_0xe8eff9);_0x1ad54e=buildMergedJourneyDef([{'item':_0x5e1083,'yaml':_0x21681c}],_0x5b7eee,_0x57a8ae);}}addFoldersToCreate(_0x5a6d44,_0x3b284d[_0x1c0912(0x1c1)],_0x21c269);const _0x17fd70=calculateJourneyDiff(_0xe8eff9,_0x1ad54e);_0x24b412[_0x1c0912(0x170)]({'relativePath':_0xe8eff9[_0x1c0912(0x203)],'absolutePath':_0x44eb82,'yamlConfig':_0xe8eff9,'folderPath':_0x5a6d44,'existingJourney':_0x577ff1,'isNew':_0x17fd70[_0x1c0912(0x1d1)],'hasChanges':_0x17fd70[_0x1c0912(0x1b0)],'diff':_0x17fd70[_0x1c0912(0x1c6)]});}return{'journeyFiles':_0x24b412,'foldersToCreate':_0x21c269};}export function calculateActivationActions(_0x124d60,_0x49003e,_0x379d09,_0x314395){const _0x3746ef=a142_0x420e71,_0xb54738=[],_0x1b87fa=new Map();for(const _0x2f19ab of _0x49003e){_0x1b87fa[_0x3746ef(0x1f9)](_0x2f19ab[_0x3746ef(0x203)],_0x2f19ab);}const _0x3e567f=new Map();for(const _0x435bd2 of _0x124d60){_0x3e567f['set'](_0x435bd2['name'],_0x435bd2);}for(const _0x497d61 of _0x124d60){const _0x4b78bd=_0x1b87fa[_0x3746ef(0x11c)](_0x497d61[_0x3746ef(0x203)]);if(!_0x4b78bd)_0xb54738[_0x3746ef(0x170)]({'type':'create','name':_0x497d61[_0x3746ef(0x203)],'yamlActivation':_0x497d61});else{const _0xdd389d=activationResponseToDef(_0x4b78bd,_0x379d09,_0x314395),_0x5230c7=a142_0x18c254[_0x3746ef(0x1e3)](_0xdd389d),_0x103c38=a142_0x18c254[_0x3746ef(0x1e3)](_0x497d61);_0x5230c7!==_0x103c38&&_0xb54738[_0x3746ef(0x170)]({'type':'update','name':_0x497d61['name'],'yamlActivation':_0x497d61,'existingActivation':_0x4b78bd});}}for(const _0x1f7ae3 of _0x49003e){!_0x3e567f[_0x3746ef(0x1c2)](_0x1f7ae3[_0x3746ef(0x203)])&&_0xb54738[_0x3746ef(0x170)]({'type':'delete','name':_0x1f7ae3[_0x3746ef(0x203)],'existingActivation':_0x1f7ae3});}return _0xb54738;}function calculateYamlDiff(_0x432b7c,_0x1cef0f){if(_0x1cef0f){const _0x41cc4d=generateDiff(_0x1cef0f,_0x432b7c),_0x16b638=hasChanges(_0x41cc4d);return{'isNew':![],'hasChanges':_0x16b638,'diff':_0x16b638?formatDiffWithColors(_0x41cc4d):undefined};}const _0x543922=generateDiff('',_0x432b7c);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x543922)};}export function calculateSegmentDiff(_0xe674d9,_0x1ec535,_0x205838,_0x28b631,_0x318be8){const _0x7b5755=segmentToYamlString(_0xe674d9),_0x2fd346=_0x1ec535?segmentToYamlString(segmentWithActivationsToYaml(_0x1ec535,_0x205838,undefined,_0x28b631,_0x318be8)):undefined;return calculateYamlDiff(_0x7b5755,_0x2fd346);}export function calculateJourneyDiff(_0x4f7a2f,_0x30f6f7){const _0x41228f=normalizeJourneyDef(_0x4f7a2f,_0x4f7a2f),_0x209803=a142_0x5bf15a(_0x41228f),_0x5e998d=_0x30f6f7?a142_0x5bf15a(normalizeJourneyDef(_0x30f6f7,_0x4f7a2f)):undefined;return calculateYamlDiff(_0x209803,_0x5e998d);}export function findSegmentsToDelete(_0x29e393,_0x4fb34c,_0x4d8684,_0x5af005,_0x1290d1){const _0x153c6f=a142_0x420e71,_0x520716=new Set();for(const {yamlConfig:_0x40bf20,folderPath:_0x558e33}of _0x4fb34c){_0x520716['add'](_0x558e33+':'+_0x40bf20[_0x153c6f(0x203)]);}return _0x29e393[_0x153c6f(0x1be)](_0x55432b=>{const _0x4ecc43=_0x153c6f,_0x22d995=_0x55432b[_0x4ecc43(0x18a)]?_0x4d8684[_0x4ecc43(0x11c)](_0x55432b[_0x4ecc43(0x18a)][_0x4ecc43(0x13f)]())||'':'',_0x474d0c=_0x22d995+':'+_0x55432b[_0x4ecc43(0x203)];if(_0x520716['has'](_0x474d0c))return![];if(_0x1290d1)return _0x22d995===_0x5af005||_0x22d995[_0x4ecc43(0x194)](_0x5af005+'/');return!![];});}export function findJourneysToDelete(_0x4aa63e,_0x4fa933,_0x3f864b,_0x12f492,_0x28253d){const _0x3136e7=a142_0x420e71,_0x52cb57=new Set();for(const {yamlConfig:_0x418a81,folderPath:_0x36c6a5}of _0x4fa933){_0x52cb57[_0x3136e7(0x166)](_0x36c6a5+':'+_0x418a81[_0x3136e7(0x203)]);}return _0x4aa63e[_0x3136e7(0x1be)](_0x1651f7=>{const _0x3c5311=_0x3136e7,_0x17b5d0=_0x1651f7[_0x3c5311(0x201)]?_0x3f864b[_0x3c5311(0x11c)](_0x1651f7[_0x3c5311(0x201)])||'':'',_0x3ea6b9=_0x17b5d0+':'+_0x1651f7['journeyBundleName'];if(_0x52cb57['has'](_0x3ea6b9))return![];if(_0x28253d)return _0x17b5d0===_0x12f492||_0x17b5d0[_0x3c5311(0x194)](_0x12f492+'/');return!![];});}export function buildSegmentLookupMap(_0x19b8b6,_0x648a2a){const _0xae3953=a142_0x420e71,_0x42b3cc=new Map();for(const _0x49211b of _0x19b8b6){const _0x3a8313=_0x49211b['segmentFolderId']?_0x648a2a[_0xae3953(0x11c)](_0x49211b[_0xae3953(0x18a)][_0xae3953(0x13f)]())||'':'',_0x289af3=_0x3a8313+':'+_0x49211b[_0xae3953(0x203)];_0x42b3cc[_0xae3953(0x1f9)](_0x289af3,_0x49211b);}return _0x42b3cc;}export function buildSegmentNameToIdMap(_0x5ba87f){const _0x2fcf0a=a142_0x420e71,_0x38b05a=new Map();for(const _0x46e8e2 of _0x5ba87f){_0x38b05a[_0x2fcf0a(0x1f9)](_0x46e8e2['name'],_0x46e8e2['id']);}return _0x38b05a;}export function buildJourneyBundleLookupMap(_0x6f9294,_0x2cfb69){const _0x3f5873=a142_0x420e71,_0x40c59a=new Map();for(const _0x378183 of _0x6f9294){const _0x1ad3c6=_0x378183['folderId']?_0x2cfb69[_0x3f5873(0x11c)](_0x378183[_0x3f5873(0x201)])||'':'',_0xbff86d=_0x1ad3c6+':'+_0x378183[_0x3f5873(0x117)];!_0x40c59a[_0x3f5873(0x1c2)](_0xbff86d)&&_0x40c59a['set'](_0xbff86d,[]),_0x40c59a['get'](_0xbff86d)[_0x3f5873(0x170)](_0x378183);}for(const _0x34b6ef of _0x40c59a[_0x3f5873(0x16b)]()){_0x34b6ef[_0x3f5873(0x1f4)]((_0x2a0e17,_0xa363f0)=>(_0x2a0e17[_0x3f5873(0x213)]||0x0)-(_0xa363f0['versionNumber']||0x0));}return _0x40c59a;}export function collectFoldersToCreate(_0x3c43e7,_0x1d2b63){const _0x4ee87f=a142_0x420e71,_0x425984=new Set();for(const _0x215196 of _0x3c43e7){if(!_0x215196)continue;if(_0x1d2b63[_0x4ee87f(0x1c2)](_0x215196))continue;const _0xae2b0f=_0x215196[_0x4ee87f(0x1c5)]('/');let _0xf6c544='';for(const _0xf768a3 of _0xae2b0f){_0xf6c544=_0xf6c544?_0xf6c544+'/'+_0xf768a3:_0xf768a3,!_0x1d2b63[_0x4ee87f(0x1c2)](_0xf6c544)&&_0x425984['add'](_0xf6c544);}}return _0x425984;}export function parseAndClassifyYamlFiles(_0x5981a9,_0x292858,_0x310d42){const _0x5ce327=a142_0x420e71,_0x22e90c=[],_0xde3586=[];for(const _0x2cad3a of _0x5981a9){const _0x21b4cd=a142_0x30d89b[_0x5ce327(0x1d9)](_0x292858,a142_0x30d89b[_0x5ce327(0x1dd)](_0x2cad3a)),_0x26c67d=_0x21b4cd==='.'?'':_0x21b4cd,_0x4b4873=readFileSync(_0x2cad3a,_0x5ce327(0x195)),_0x55cd4a=a142_0x18c254[_0x5ce327(0x1ff)](_0x4b4873);if(isJourneyDef(_0x55cd4a)){const _0x4ecbdd=a142_0x55284e(_0x4b4873);_0xde3586[_0x5ce327(0x170)]({'yamlConfig':_0x4ecbdd,'folderPath':_0x26c67d,'sourcePath':_0x2cad3a});}else{if(!_0x310d42?.[_0x5ce327(0x11a)]){const _0x631bed=parseSegmentYamlFile(_0x4b4873),_0x3dd1b2=normalizeChildSegmentYaml(_0x631bed);_0x22e90c[_0x5ce327(0x170)]({'yamlConfig':_0x3dd1b2,'folderPath':_0x26c67d,'sourcePath':_0x2cad3a});}}}return{'segments':_0x22e90c,'journeys':_0xde3586};}export function validateParsedFiles(_0x3cae3b,_0x17ded4){const _0x38d360=a142_0x420e71,_0x144459=[];for(const {yamlConfig:_0x44cd32,sourcePath:_0x1aaafa}of _0x3cae3b[_0x38d360(0x19c)]){const _0x31595=readFileSync(_0x1aaafa,'utf-8'),_0x2f8d2c=a142_0x18c254[_0x38d360(0x1ea)](_0x31595),_0x13e29a=validateSegmentDef(_0x44cd32,{'source':_0x31595,'document':_0x2f8d2c},{'skipSchema':!![]});if(!_0x13e29a[_0x38d360(0x1d3)]){const _0x3adc5f=a142_0x30d89b[_0x38d360(0x1d9)](_0x17ded4,_0x1aaafa);_0x144459[_0x38d360(0x170)]({'filePath':_0x3adc5f,'source':_0x31595,'result':_0x13e29a,'isJourney':![]});}}for(const {yamlConfig:_0x49c54d,sourcePath:_0x1ad2db}of _0x3cae3b[_0x38d360(0x12a)]){const _0x269f55=readFileSync(_0x1ad2db,_0x38d360(0x195)),_0x2ffda8=a142_0x18c254[_0x38d360(0x1ea)](_0x269f55),_0x21a236=validateJourneyDef(_0x49c54d,{'source':_0x269f55,'document':_0x2ffda8},{'skipSchema':!![]});if(!_0x21a236[_0x38d360(0x1d3)]){const _0x390c0a=a142_0x30d89b[_0x38d360(0x1d9)](_0x17ded4,_0x1ad2db);_0x144459[_0x38d360(0x170)]({'filePath':_0x390c0a,'source':_0x269f55,'result':_0x21a236,'isJourney':!![]});}}return _0x144459;}export function formatValidationErrors(_0x77af82){const _0x58ec7c=a142_0x420e71,_0x3d7050=[];for(const {filePath:_0x3e8b53,source:_0x327c9d,result:_0x9d1a7a,isJourney:_0x236dab}of _0x77af82){const _0x1a33b5=_0x236dab?_0x58ec7c(0x16c):_0x58ec7c(0x1e2);_0x3d7050[_0x58ec7c(0x170)]('\x0a'+_0x3e8b53+'\x20('+_0x1a33b5+_0x58ec7c(0x168)+_0x9d1a7a['errors'][_0x58ec7c(0x118)]+'\x20error(s)'),_0x3d7050[_0x58ec7c(0x170)](formatValidationResult(_0x9d1a7a,_0x327c9d,_0x3e8b53));}return _0x3d7050[_0x58ec7c(0x1f5)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x46ee7f){const _0x549132=a142_0x420e71,_0x12d77c=new Set(),_0x49fc7a=new Map(),_0x142176=collectSegmentUsageCounts(_0x46ee7f);if(_0x46ee7f[_0x549132(0x19c)])for(const [_0x14c1f4,_0x5cbe1e]of Object['entries'](_0x46ee7f['segments'])){_0x12d77c[_0x549132(0x166)](_0x14c1f4);if(_0x5cbe1e[_0x549132(0x196)]){const _0x220cba=yamlRuleToApi(_0x5cbe1e[_0x549132(0x196)]),_0x482c59=apiRuleToYaml(_0x220cba);_0x49fc7a[_0x549132(0x1f9)](_0x14c1f4,_0x482c59);}}const _0x481536=new Map();let _0x519f6f=0x0;for(const [_0x4bf0f1,_0x24f719]of _0x49fc7a){const _0x46388c=serializeExpandedRule(_0x24f719,_0x49fc7a),_0x33f3a5=_0x481536[_0x549132(0x11c)](_0x46388c)||[];_0x33f3a5[_0x549132(0x170)]({'name':_0x4bf0f1,'index':_0x519f6f}),_0x481536[_0x549132(0x1f9)](_0x46388c,_0x33f3a5),_0x519f6f++;}const _0x334485=new Map();for(const [_0x242b56,_0x2e4897]of _0x481536){const _0x2e48af=_0x2e4897[_0x549132(0x1ec)]()['sort']((_0x5bc85b,_0x58c88e)=>{const _0xc451c0=_0x549132,_0x238dd1=_0x142176[_0xc451c0(0x11c)](_0x5bc85b[_0xc451c0(0x203)])||0x0,_0x3824ae=_0x142176[_0xc451c0(0x11c)](_0x58c88e[_0xc451c0(0x203)])||0x0;if(_0x238dd1!==_0x3824ae)return _0x3824ae-_0x238dd1;return _0x5bc85b[_0xc451c0(0x1eb)]-_0x58c88e[_0xc451c0(0x1eb)];})[_0x549132(0x209)](_0x528699=>_0x528699[_0x549132(0x203)]),_0x46c31d=[];for(const _0x5ed4fa of _0x2e48af){const _0x13c7b5=_0x142176[_0x549132(0x11c)](_0x5ed4fa)||0x0,_0x3ff610=Math[_0x549132(0x120)](_0x13c7b5,0x1);for(let _0x2ae82f=0x0;_0x2ae82f<_0x3ff610;_0x2ae82f++){_0x46c31d[_0x549132(0x170)](_0x5ed4fa);}}_0x334485['set'](_0x242b56,_0x46c31d);}return{'existingLocalSegmentNames':_0x12d77c,'localSegmentRules':_0x49fc7a,'localExpandedRuleToNames':_0x334485};}export function createSegmentIdResolver(_0x370b7b,_0x4f68b3){return async _0x508a7a=>{const _0x37192a=a142_0x1102,_0x6b14c8=_0x370b7b[_0x37192a(0x11c)](_0x508a7a);if(!_0x6b14c8)throw new SDKError(ErrorCode[_0x37192a(0x1fb)],'Segment\x20not\x20found:\x20'+_0x508a7a+_0x37192a(0x155)+_0x4f68b3+'\x27)');return _0x6b14c8;};}export function extractRootFolderId(_0x27c454){const _0x1be72f=a142_0x420e71;return _0x27c454['relationships']?.['parentSegmentFolder']?.[_0x1be72f(0x19a)]?.['id']||_0x27c454['relationships']?.['parentFolder']?.[_0x1be72f(0x19a)]?.['id'];}export function buildConnectionMaps(_0x219058){const _0x22ac23=a142_0x420e71,_0x2f4ca6=new Map(),_0x5511b6=new Map(),_0x575155=new Map();for(const _0x19a682 of _0x219058){_0x2f4ca6['set'](_0x19a682[_0x22ac23(0x203)],parseInt(_0x19a682['id'],0xa)),_0x5511b6[_0x22ac23(0x1f9)](_0x19a682['id'],_0x19a682[_0x22ac23(0x203)]),_0x575155[_0x22ac23(0x1f9)](_0x19a682['name'],_0x19a682['type']);}return{'nameToId':_0x2f4ca6,'idToName':_0x5511b6,'nameToType':_0x575155};}export function calculatePushStats(_0x2ddb96,_0xc8951f,_0x3538d5,_0x401278,_0x1c2ea8,_0x2c08bd,_0x32ae63){const _0x1e02e2=a142_0x420e71,_0x506b42=_0x2ddb96[_0x1e02e2(0x1be)](_0x97c6fc=>_0x97c6fc[_0x1e02e2(0x1d1)]),_0x2eb955=_0x2ddb96[_0x1e02e2(0x1be)](_0x3b29ec=>!_0x3b29ec['isNew']&&_0x3b29ec[_0x1e02e2(0x1b0)]),_0x168c6e=_0x2ddb96[_0x1e02e2(0x1be)](_0x2f11a5=>!_0x2f11a5[_0x1e02e2(0x1d1)]&&!_0x2f11a5[_0x1e02e2(0x1b0)]),_0x1c8957=_0x2c08bd?_0x401278:[],_0x3cbb51=_0xc8951f[_0x1e02e2(0x1be)](_0x2cbe83=>_0x2cbe83[_0x1e02e2(0x1d1)]),_0x4cda5c=_0xc8951f[_0x1e02e2(0x1be)](_0x508e0d=>!_0x508e0d[_0x1e02e2(0x1d1)]&&_0x508e0d[_0x1e02e2(0x1b0)]),_0x379602=_0xc8951f[_0x1e02e2(0x1be)](_0x519b43=>!_0x519b43[_0x1e02e2(0x1d1)]&&!_0x519b43[_0x1e02e2(0x1b0)]),_0xf1a664=_0x2c08bd?_0x1c2ea8:[],_0x190d23=_0x2ddb96[_0x1e02e2(0x158)](_0x5af5c8=>_0x5af5c8[_0x1e02e2(0x11e)]),_0x2958df=_0x190d23[_0x1e02e2(0x1be)](_0x550e92=>_0x550e92['type']===_0x1e02e2(0x132)),_0x58205d=_0x190d23[_0x1e02e2(0x1be)](_0x5ba225=>_0x5ba225[_0x1e02e2(0x167)]===_0x1e02e2(0x192)),_0x3687a3=_0x190d23[_0x1e02e2(0x1be)](_0x2db4f5=>_0x2db4f5[_0x1e02e2(0x167)]===_0x1e02e2(0x20f)),_0x22d68f=Array[_0x1e02e2(0x1b3)](_0x3538d5)[_0x1e02e2(0x1f4)](),_0x5356c7=_0x32ae63?![]:_0x506b42[_0x1e02e2(0x118)]>0x0||_0x2eb955['length']>0x0||_0x1c8957[_0x1e02e2(0x118)]>0x0,_0x7a3071=_0x3cbb51['length']>0x0||_0x4cda5c[_0x1e02e2(0x118)]>0x0||_0xf1a664[_0x1e02e2(0x118)]>0x0,_0x52699d=_0x32ae63?![]:_0x190d23['length']>0x0,_0x71f945=_0x22d68f['length']>0x0;return{'segments':{'new':_0x506b42,'changed':_0x2eb955,'unchanged':_0x168c6e,'toDelete':_0x1c8957},'journeys':{'new':_0x3cbb51,'changed':_0x4cda5c,'unchanged':_0x379602,'toDelete':_0xf1a664},'activations':{'all':_0x190d23,'toCreate':_0x2958df,'toUpdate':_0x58205d,'toDelete':_0x3687a3},'folders':{'toCreate':_0x22d68f},'counts':{'segments':{'new':_0x506b42[_0x1e02e2(0x118)],'changed':_0x2eb955['length'],'unchanged':_0x168c6e[_0x1e02e2(0x118)],'toDelete':_0x1c8957[_0x1e02e2(0x118)]},'journeys':{'new':_0x3cbb51['length'],'changed':_0x4cda5c[_0x1e02e2(0x118)],'unchanged':_0x379602[_0x1e02e2(0x118)],'toDelete':_0xf1a664['length']},'activations':{'create':_0x2958df[_0x1e02e2(0x118)],'update':_0x58205d['length'],'delete':_0x3687a3[_0x1e02e2(0x118)]},'folders':_0x22d68f['length']},'hasChanges':_0x5356c7||_0x7a3071||_0x52699d||_0x71f945};}export async function buildPushExecutionContext(_0xc58d3e,_0x5a80d3,_0x4d52b1,_0x29f32d,_0x35e71a,_0x57b89a){const _0x1e4b26=a142_0x420e71,_0x1f4bb9=extractRootFolderId(_0x4d52b1),{pathToId:_0x23e7d1,idToPath:_0x35ba8d}=buildFolderMaps(_0x35e71a),_0xcd41dc=buildSegmentNameToIdMap(_0x29f32d),_0x4f649e=new Map(),{batchAsync:_0x156253}=await import(_0x1e4b26(0x202)),[_0x5096fd,_0x3821a0]=await Promise['all']([_0xc58d3e[_0x1e4b26(0x1a5)]['buildUserMaps'](),_0xc58d3e[_0x1e4b26(0x19d)]['list'](),((async()=>{const _0x3682a8=_0x1e4b26;!_0x57b89a&&_0x29f32d[_0x3682a8(0x118)]>0x0&&await _0x156253(_0x29f32d,async _0x25b514=>{const _0x24d266=_0x3682a8,_0x11ef3a=await _0xc58d3e[_0x24d266(0x1e2)]['listActivations'](_0x5a80d3,_0x25b514['id']);_0x4f649e[_0x24d266(0x1f9)](_0x25b514['id'],_0x11ef3a);});})())]),{emailToId:_0x3927d5,idToEmail:_0x54021d}=_0x5096fd,_0x138613=buildConnectionMaps(_0x3821a0);return{'rootFolderId':_0x1f4bb9,'folderPathToId':_0x23e7d1,'folderIdToPath':_0x35ba8d,'segmentNameToId':_0xcd41dc,'activationsBySegmentId':_0x4f649e,'emailToIdMap':_0x3927d5,'idToEmailMap':_0x54021d,'connectionNameToIdMap':_0x138613['nameToId'],'connectionIdToNameMap':_0x138613[_0x1e4b26(0x1dc)],'connectionNameToTypeMap':_0x138613[_0x1e4b26(0x1c4)]};}export function createPushYamlContextForBundle(_0x199562,_0x3b3a62,_0x3e5d17,_0x2faf51,_0x537bcc,_0x3eae36,_0x3022d9,_0x436d79){const {existingLocalSegmentNames:_0x184e5c,localExpandedRuleToNames:_0x1885f1}=_0x2faf51,_0x510201=new Set(),_0x565ab4=new Map(),_0x1d682a=new Map(),_0x5ec651=new Map(),_0x571870=createJumpTargetCache(),_0x2b4942=new Map(),_0x4a6533=new Map(),_0xa422d8=new Set();let _0x3d077b;const _0x43f900=_0x24f462=>{const _0x41f7a9={'resolveSegment':async _0x3acc42=>{const _0x4fb995=a142_0x1102,_0x36de97=_0x5ec651[_0x4fb995(0x11c)](_0x3acc42);if(_0x36de97!==undefined)return{'name':_0x36de97,'isJourneyLocal':!![]};try{const _0x3c67e0=await fetchSegment(_0x199562,_0x3b3a62,_0x3acc42,_0x3e5d17);if(!_0x3c67e0)throw new Error('Segment\x20not\x20found');const _0x42e16d=generateJourneyLocalName(_0x3c67e0[_0x4fb995(0x203)]),_0x3ccace=_0x3c67e0[_0x4fb995(0x18e)]===SEGMENT_KIND_JOURNEY&&_0x42e16d!==undefined;let _0x4c06a1=_0x3c67e0[_0x4fb995(0x203)],_0xb15bb6;if(_0x3ccace&&_0x3c67e0['rule']){const _0x31fe4d=apiRuleToYaml(_0x3c67e0[_0x4fb995(0x196)]);_0x4a6533[_0x4fb995(0x1f9)](_0x3acc42,_0x31fe4d);const _0x45ca7b=async _0x26394a=>{const _0x388d0c=_0x4fb995,_0x415c4b=collectSegmentRefsFromRule(_0x26394a);for(const _0xa2b10f of _0x415c4b){if(!_0x4a6533['has'](_0xa2b10f))try{const _0x4ae324=await fetchSegment(_0x199562,_0x3b3a62,_0xa2b10f,_0x3e5d17);if(_0x4ae324?.[_0x388d0c(0x196)]){const _0x3bc87a=apiRuleToYaml(_0x4ae324[_0x388d0c(0x196)]);_0x4a6533['set'](_0xa2b10f,_0x3bc87a),await _0x45ca7b(_0x3bc87a);}}catch(_0x3c66eb){logger['debug'](_0x388d0c(0x135)+_0xa2b10f+':\x20'+_0x3c66eb);}}};await _0x45ca7b(_0x31fe4d);const _0x78997f=serializeExpandedRule(_0x31fe4d,_0x4a6533),_0x456712=_0x1885f1[_0x4fb995(0x11c)](_0x78997f);if(_0x456712&&_0x456712['length']>0x0){const _0x5ace2f=_0x565ab4[_0x4fb995(0x11c)](_0x78997f)||0x0,_0x34a016=_0x456712[_0x5ace2f]||_0x456712[_0x456712[_0x4fb995(0x118)]-0x1];_0x565ab4[_0x4fb995(0x1f9)](_0x78997f,_0x5ace2f+0x1),_0x4c06a1=_0x34a016,_0x510201[_0x4fb995(0x166)](_0x4c06a1),_0x5ec651[_0x4fb995(0x1f9)](_0x3acc42,_0x4c06a1);const _0x1041d9=await resolveRuleSegmentRefs(_0x31fe4d,async _0x1a3044=>{const _0x58a924=_0x4fb995,_0x7cabad=_0x5ec651['get'](_0x1a3044);if(_0x7cabad)return _0x7cabad;const _0x5d0602=await _0x3d077b['resolveSegment'](_0x1a3044);return _0x5d0602[_0x58a924(0x203)];});_0xb15bb6={'description':_0x3c67e0['description'],'rule':_0x1041d9};}else{const _0x32396d=_0x2b4942['get'](_0x78997f);if(_0x32396d)_0x4c06a1=_0x32396d,_0x5ec651[_0x4fb995(0x1f9)](_0x3acc42,_0x4c06a1);else{if(_0x42e16d){let _0x235188=_0x42e16d,_0x3c18e3=0x2;while(_0x510201[_0x4fb995(0x1c2)](_0x235188)||_0x184e5c[_0x4fb995(0x1c2)](_0x235188)){_0x235188=_0x42e16d+'_'+_0x3c18e3,_0x3c18e3++;}_0x510201[_0x4fb995(0x166)](_0x235188),_0x4c06a1=_0x235188;}_0x5ec651[_0x4fb995(0x1f9)](_0x3acc42,_0x4c06a1),_0x2b4942['set'](_0x78997f,_0x4c06a1);const _0x4f3020=await resolveRuleSegmentRefs(_0x31fe4d,async _0x53ed38=>{const _0x126e1b=_0x4fb995,_0x1f2fda=_0x5ec651[_0x126e1b(0x11c)](_0x53ed38);if(_0x1f2fda)return _0x1f2fda;const _0x4b8de9=await _0x3d077b[_0x126e1b(0x119)](_0x53ed38);return _0x4b8de9[_0x126e1b(0x203)];});_0xb15bb6={'description':_0x3c67e0[_0x4fb995(0x131)],'rule':_0x4f3020};}}}return{'name':_0x4c06a1,'isJourneyLocal':_0x3ccace,'definition':_0xb15bb6};}catch(_0x571e87){return logger[_0x4fb995(0x1e7)]('Failed\x20to\x20resolve\x20segment\x20'+_0x3acc42+':\x20'+_0x571e87),{'name':_0x3acc42,'isJourneyLocal':![]};}},'resolveActivation':async _0x13dbcc=>{const _0x18aef3=a142_0x1102,_0x2f78d4=_0x1d682a[_0x18aef3(0x11c)](_0x13dbcc);if(_0x2f78d4!==undefined)return{'name':_0x2f78d4,'isJourneyLocal':!![]};try{let _0x5157ea=_0x3022d9?.[_0x18aef3(0x11c)](_0x13dbcc);!_0x5157ea&&(_0x5157ea=await _0x199562[_0x18aef3(0x16c)][_0x18aef3(0x1e0)](_0x24f462,_0x13dbcc));const _0x57c869=_0x5157ea[_0x18aef3(0x161)][_0x18aef3(0x153)][_0x18aef3(0x203)]||_0x13dbcc,_0x4fe737=sanitizeYamlKey(_0x57c869)||_0x18aef3(0x121)+_0x13dbcc,_0x2d3009=_0x4fe737;_0x1d682a[_0x18aef3(0x1f9)](_0x13dbcc,_0x2d3009);const _0x484ab2=journeyActivationStepToYaml(_0x5157ea,_0x537bcc,_0x3eae36);return{'name':_0x2d3009,'isJourneyLocal':!![],'definition':_0x484ab2};}catch(_0x529d25){return logger[_0x18aef3(0x1e7)](_0x18aef3(0x1e1)+_0x13dbcc+':\x20'+_0x529d25),{'name':_0x13dbcc,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4f1b4a,_0x400db8)=>resolveJumpTarget(_0x4f1b4a,_0x400db8,_0x571870,async _0x332ede=>{const _0x14cc02=a142_0x1102,_0x5e6d44=_0x436d79?.[_0x14cc02(0x11c)](_0x332ede);if(_0x5e6d44)return _0x5e6d44;return _0x199562[_0x14cc02(0x16c)][_0x14cc02(0x1db)](_0x332ede);})};return _0x3d077b=_0x41f7a9,_0x41f7a9;},_0x3cf66b=async _0x2f3b50=>{const _0x1d0213=a142_0x1102,{collectSegmentIdsFromJourneyApi:_0x12f729}=await import(_0x1d0213(0x15d)),{batchAsync:_0x2b97a6}=await import(_0x1d0213(0x202)),_0x18409b=new Set();for(const _0x3dbe24 of _0x2f3b50){let _0x2d5b08=_0x436d79?.[_0x1d0213(0x11c)](_0x3dbe24);!_0x2d5b08&&(_0x2d5b08=await _0x199562[_0x1d0213(0x16c)][_0x1d0213(0x1db)](_0x3dbe24));const _0x4ce878=_0x12f729(_0x2d5b08);for(const _0x167d64 of _0x4ce878){_0x18409b[_0x1d0213(0x166)](_0x167d64);}}let _0x5400bc=Array['from'](_0x18409b);while(_0x5400bc[_0x1d0213(0x118)]>0x0){const _0x115545=_0x5400bc['filter'](_0x554552=>!_0xa422d8[_0x1d0213(0x1c2)](_0x554552));if(_0x115545['length']===0x0)break;const _0x23f3cf=await _0x2b97a6(_0x115545,async _0x2f7934=>{const _0x168e2c=_0x1d0213;_0xa422d8[_0x168e2c(0x166)](_0x2f7934);const _0x20f44b=await fetchSegment(_0x199562,_0x3b3a62,_0x2f7934,_0x3e5d17);if(!_0x20f44b)return null;return{'segmentId':_0x2f7934,'segment':_0x20f44b};},0xa),_0x644e8e=new Set();for(const _0x3ad7b3 of _0x23f3cf){if(!_0x3ad7b3?.[_0x1d0213(0x1e2)]?.[_0x1d0213(0x196)])continue;const _0x3fd7c7=apiRuleToYaml(_0x3ad7b3['segment']['rule']);_0x4a6533[_0x1d0213(0x1f9)](_0x3ad7b3['segmentId'],_0x3fd7c7);const _0x2f11d9=collectSegmentRefsFromRule(_0x3fd7c7);for(const _0x546a67 of _0x2f11d9){!_0xa422d8[_0x1d0213(0x1c2)](_0x546a67)&&_0x644e8e[_0x1d0213(0x166)](_0x546a67);}}_0x5400bc=Array[_0x1d0213(0x1b3)](_0x644e8e);}};return{'createYamlContext':_0x43f900,'prefetchJourneySegments':_0x3cf66b};}export async function executePushSegments(_0x5787af,_0x1a3c54,_0x24466d,_0x38fece,_0x5741e0){const _0x2f0b67=a142_0x420e71,{segmentDefToCreateRequest:_0x11f3bb,segmentDefToUpdateRequest:_0x3b46cb}=await import(_0x2f0b67(0x125)),_0x52582e=_0x24466d['folderPathToId'],_0x4267f7=0x5,_0x52108e=async _0x30d372=>{const _0x4918c8=_0x2f0b67,_0x173cda=_0x30d372[_0x4918c8(0x134)]?_0x52582e[_0x4918c8(0x11c)](_0x30d372[_0x4918c8(0x134)]):undefined;let _0x423d7;const _0x248b5e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x38f2e3=_0x30d372['yamlConfig'];if(_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x196)]){const _0x1eea9a=createSegmentIdResolver(_0x24466d[_0x4918c8(0x212)],_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)]),_0x56e3aa=await resolveRuleSegmentIds(_0x30d372[_0x4918c8(0x159)]['rule'],_0x1eea9a);_0x38f2e3={..._0x30d372[_0x4918c8(0x159)],'rule':_0x56e3aa};}try{if(_0x30d372['isNew']){_0x5741e0[_0x4918c8(0x1de)]?.({'type':_0x4918c8(0x1bb),'name':_0x30d372[_0x4918c8(0x159)]['name']});const _0x4071eb=_0x11f3bb(_0x38f2e3,_0x173cda),_0x29783e=await _0x5741e0[_0x4918c8(0x13e)](_0x4918c8(0x1ba)+_0x30d372['yamlConfig']['name']+_0x4918c8(0x215),()=>_0x5787af[_0x4918c8(0x1e2)][_0x4918c8(0x163)](_0x38fece[_0x4918c8(0x1f3)],_0x4071eb));_0x423d7=_0x29783e[_0x4918c8(0x19a)]['id'],_0x24466d[_0x4918c8(0x212)]['set'](_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)],_0x423d7),_0x248b5e[_0x4918c8(0x13d)]={'name':_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)],'id':_0x423d7},_0x5741e0['onProgress']?.({'type':_0x4918c8(0x1d2),'name':_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)],'segmentId':_0x423d7}),_0x5741e0[_0x4918c8(0x1d6)]?.('Created\x20segment\x20\x27'+_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)]+'\x27'),_0x248b5e[_0x4918c8(0x1a3)]=0x1;}else{if(_0x30d372['hasChanges']){_0x5741e0[_0x4918c8(0x1de)]?.({'type':_0x4918c8(0x193),'name':_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)]});const _0x17398a=_0x3b46cb(_0x38f2e3);_0x173cda!==_0x30d372['existingSegment']?.[_0x4918c8(0x18a)]&&(_0x17398a[_0x4918c8(0x18a)]=_0x173cda?parseInt(_0x173cda,0xa):undefined),await _0x5741e0[_0x4918c8(0x13e)](_0x4918c8(0x1b4)+_0x30d372[_0x4918c8(0x159)]['name']+_0x4918c8(0x215),()=>_0x5787af[_0x4918c8(0x1e2)][_0x4918c8(0x177)](_0x38fece[_0x4918c8(0x1f3)],_0x30d372['existingSegment']['id'],_0x17398a)),_0x423d7=_0x30d372[_0x4918c8(0x17c)]['id'],_0x5741e0[_0x4918c8(0x1de)]?.({'type':'segment_updated','name':_0x30d372['yamlConfig'][_0x4918c8(0x203)]}),_0x5741e0[_0x4918c8(0x1d6)]?.(_0x4918c8(0x14d)+_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)]+'\x27'),_0x248b5e['updated']=0x1;}else _0x423d7=_0x30d372[_0x4918c8(0x17c)]['id'];}}catch(_0x22e377){const _0x3f2475=isHttp400Error(_0x22e377),_0x4ddfda=_0x3f2475?ErrorCode[_0x4918c8(0x13b)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x17c822=getErrorMessage(_0x22e377);throw new SDKError(_0x4ddfda,_0x4918c8(0x1d0)+(_0x30d372['isNew']?_0x4918c8(0x132):'update')+'\x20segment\x20from\x20file:\x20'+_0x30d372[_0x4918c8(0x180)]+_0x4918c8(0x187)+_0x17c822,_0x22e377);}try{const _0x8b8f24=await syncActivationsForSegment(_0x5787af,_0x38fece[_0x4918c8(0x1f3)],_0x423d7,_0x30d372[_0x4918c8(0x159)]['name'],_0x30d372[_0x4918c8(0x11e)],_0x5741e0,_0x30d372[_0x4918c8(0x180)]);_0x248b5e[_0x4918c8(0x1fc)]=_0x8b8f24;}catch(_0x12092d){if(_0x12092d instanceof SDKError)throw _0x12092d;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x4918c8(0x162)+_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)]+_0x4918c8(0x154)+_0x30d372['absolutePath']+_0x4918c8(0x187)+getErrorMessage(_0x12092d),_0x12092d);}return _0x248b5e;},_0x578f61=await batchAsync(_0x1a3c54,_0x52108e,_0x4267f7),_0x158c91={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x358b3c of _0x578f61){_0x158c91[_0x2f0b67(0x1a3)]+=_0x358b3c['created'],_0x158c91[_0x2f0b67(0x20e)]+=_0x358b3c[_0x2f0b67(0x20e)],_0x358b3c[_0x2f0b67(0x13d)]&&_0x158c91[_0x2f0b67(0x130)]['set'](_0x358b3c[_0x2f0b67(0x13d)][_0x2f0b67(0x203)],_0x358b3c[_0x2f0b67(0x13d)]['id']),_0x158c91[_0x2f0b67(0x1fc)][_0x2f0b67(0x1a3)]+=_0x358b3c[_0x2f0b67(0x1fc)][_0x2f0b67(0x1a3)],_0x158c91[_0x2f0b67(0x1fc)][_0x2f0b67(0x20e)]+=_0x358b3c[_0x2f0b67(0x1fc)][_0x2f0b67(0x20e)],_0x158c91['activations']['deleted']+=_0x358b3c[_0x2f0b67(0x1fc)][_0x2f0b67(0x1c8)];}return _0x158c91;}async function syncActivationsForSegment(_0x3ef9fa,_0x8bbb0a,_0x5b7d20,_0x2c4179,_0x498142,_0x3f9ab8,_0x101a02){const _0x3b229c=a142_0x420e71,_0x1e1a93={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3d56bf of _0x498142){try{if(_0x3d56bf[_0x3b229c(0x167)]===_0x3b229c(0x132)&&_0x3d56bf[_0x3b229c(0x169)])_0x3f9ab8[_0x3b229c(0x1de)]?.({'type':_0x3b229c(0x1c0),'segmentName':_0x2c4179,'activationName':_0x3d56bf[_0x3b229c(0x203)]}),await _0x3f9ab8[_0x3b229c(0x13e)](_0x3b229c(0x1cb)+_0x3d56bf[_0x3b229c(0x203)]+_0x3b229c(0x215),()=>_0x3ef9fa[_0x3b229c(0x1e2)][_0x3b229c(0x210)](_0x8bbb0a,_0x5b7d20,_0x3d56bf['validatedRequest'])),_0x3f9ab8['onProgress']?.({'type':_0x3b229c(0x1c3),'segmentName':_0x2c4179,'activationName':_0x3d56bf[_0x3b229c(0x203)]}),_0x3f9ab8[_0x3b229c(0x1d6)]?.(_0x3b229c(0x1ca)+_0x3d56bf[_0x3b229c(0x203)]+'\x27'),_0x1e1a93[_0x3b229c(0x1a3)]++;else{if(_0x3d56bf[_0x3b229c(0x167)]===_0x3b229c(0x192)&&_0x3d56bf[_0x3b229c(0x169)]&&_0x3d56bf[_0x3b229c(0x137)])_0x3f9ab8[_0x3b229c(0x1de)]?.({'type':_0x3b229c(0x1a1),'segmentName':_0x2c4179,'activationName':_0x3d56bf[_0x3b229c(0x203)]}),await _0x3f9ab8[_0x3b229c(0x13e)]('Updating\x20activation\x20\x27'+_0x3d56bf[_0x3b229c(0x203)]+_0x3b229c(0x215),()=>_0x3ef9fa['segment'][_0x3b229c(0x1cd)](_0x8bbb0a,_0x5b7d20,_0x3d56bf[_0x3b229c(0x137)]['id'],_0x3d56bf['validatedRequest'])),_0x3f9ab8[_0x3b229c(0x1de)]?.({'type':_0x3b229c(0x211),'segmentName':_0x2c4179,'activationName':_0x3d56bf['name']}),_0x3f9ab8['logSuccess']?.(_0x3b229c(0x11f)+_0x3d56bf['name']+'\x27'),_0x1e1a93['updated']++;else _0x3d56bf[_0x3b229c(0x167)]==='delete'&&_0x3d56bf[_0x3b229c(0x137)]&&(_0x3f9ab8[_0x3b229c(0x1de)]?.({'type':_0x3b229c(0x160),'segmentName':_0x2c4179,'activationName':_0x3d56bf[_0x3b229c(0x203)]}),await _0x3f9ab8[_0x3b229c(0x13e)](_0x3b229c(0x139)+_0x3d56bf[_0x3b229c(0x203)]+_0x3b229c(0x215),()=>_0x3ef9fa['segment'][_0x3b229c(0x14e)](_0x8bbb0a,_0x5b7d20,_0x3d56bf[_0x3b229c(0x137)]['id'])),_0x3f9ab8[_0x3b229c(0x1de)]?.({'type':_0x3b229c(0x1bf),'segmentName':_0x2c4179,'activationName':_0x3d56bf[_0x3b229c(0x203)]}),_0x3f9ab8[_0x3b229c(0x174)]?.(_0x3b229c(0x1ae)+_0x3d56bf[_0x3b229c(0x203)]+'\x27'),_0x1e1a93[_0x3b229c(0x1c8)]++);}}catch(_0x2dada6){const _0x36566b=isHttp400Error(_0x2dada6),_0x143366=_0x36566b?ErrorCode[_0x3b229c(0x138)]:ErrorCode[_0x3b229c(0x133)],_0x591904=getErrorMessage(_0x2dada6);throw new SDKError(_0x143366,_0x3b229c(0x1d0)+_0x3d56bf[_0x3b229c(0x167)]+'\x20activation\x20\x27'+_0x3d56bf[_0x3b229c(0x203)]+_0x3b229c(0x154)+_0x101a02+_0x3b229c(0x187)+_0x591904,_0x2dada6);}}return _0x1e1a93;}export async function executePushFolders(_0x593ffe,_0x23d6da,_0x25c5fc,_0xf3caa,_0xcd6d39){const _0xf24bd5=a142_0x420e71,_0x1f80a8=new Map(_0x25c5fc),_0x3346e9=sortFoldersByDepth(_0x23d6da);for(const _0x2430f3 of _0x3346e9){const _0x5de689=_0x2430f3[_0xf24bd5(0x1c5)]('/'),_0x5d2c8d=_0x5de689[_0x5de689['length']-0x1],_0x57d6a2=_0x5de689['slice'](0x0,-0x1)[_0xf24bd5(0x1f5)]('/'),_0x5b26c7=_0x1f80a8[_0xf24bd5(0x11c)](_0x57d6a2);_0xcd6d39[_0xf24bd5(0x1de)]?.({'type':_0xf24bd5(0x123),'folder':_0x2430f3});const _0x2ad23f={'name':_0x5d2c8d,'parentFolderId':_0x5b26c7},_0x1a22df=await _0xcd6d39[_0xf24bd5(0x13e)]('Creating\x20folder\x20\x27'+_0x2430f3+_0xf24bd5(0x215),()=>_0x593ffe[_0xf24bd5(0x1e2)][_0xf24bd5(0x122)](_0xf3caa[_0xf24bd5(0x1f3)],_0x2ad23f));_0x1f80a8[_0xf24bd5(0x1f9)](_0x2430f3,_0x1a22df['data']['id']),_0xcd6d39[_0xf24bd5(0x1de)]?.({'type':'folder_created','folder':_0x2430f3,'folderId':_0x1a22df[_0xf24bd5(0x19a)]['id']}),_0xcd6d39[_0xf24bd5(0x1a0)]?.('Created\x20folder\x20\x27'+_0x2430f3+'\x27');}return _0x1f80a8;}export async function executePushSegmentDeletions(_0x574146,_0x1cd00f,_0x367774){const _0x13556=a142_0x420e71;if(_0x1cd00f[_0x13556(0x118)]===0x0)return 0x0;const {batchAsync:_0x3eb2d6}=await import('../../utils/async.js'),_0x3cde0f=0x5,_0x241a02=await _0x3eb2d6(_0x1cd00f,async _0x119c79=>{const _0x4ceb5e=_0x13556;return _0x367774[_0x4ceb5e(0x1de)]?.({'type':_0x4ceb5e(0x1f6),'name':_0x119c79[_0x4ceb5e(0x203)]}),await _0x574146[_0x4ceb5e(0x1e2)][_0x4ceb5e(0x1e8)](_0x119c79['id']),_0x367774[_0x4ceb5e(0x1de)]?.({'type':_0x4ceb5e(0x16d),'name':_0x119c79['name']}),_0x367774[_0x4ceb5e(0x174)]?.(_0x4ceb5e(0x19e)+_0x119c79[_0x4ceb5e(0x203)]+'\x27'),0x1;},_0x3cde0f);return _0x241a02[_0x13556(0x18c)]((_0x45a277,_0x4c45d6)=>_0x45a277+_0x4c45d6,0x0);}export async function executePushJourneys(_0x4a7ab2,_0x4e2808,_0x27c811,_0x4271b0,_0x544948){const _0x176ea7=a142_0x420e71,{journeyDefToRequest:_0x11f858}=await import(_0x176ea7(0x15d)),{activationDefToCreateRequest:_0x8c7b03,yamlRuleToApi:_0xdfa3f0,validateSegmentRule:_0x1d0003}=await import(_0x176ea7(0x125)),_0x16aa18={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0xa6a5f8=new Map(_0x27c811[_0x176ea7(0x212)]),_0x2aac3a=0x5;for(let _0x14cd45=0x0;_0x14cd45<_0x4e2808[_0x176ea7(0x118)];_0x14cd45+=_0x2aac3a){const _0x4a4aba=_0x4e2808[_0x176ea7(0x1ec)](_0x14cd45,_0x14cd45+_0x2aac3a),_0x175fa6=await Promise['all'](_0x4a4aba[_0x176ea7(0x209)](async _0x72b4e5=>{const _0xe2c4b3=_0x176ea7;if(!_0x72b4e5[_0xe2c4b3(0x1d1)]&&!_0x72b4e5[_0xe2c4b3(0x1b0)])return{'action':_0xe2c4b3(0x149),'name':_0x72b4e5['yamlConfig'][_0xe2c4b3(0x203)],'journeyId':_0x72b4e5[_0xe2c4b3(0x1fd)]?.['id']};const _0x169a20=_0x72b4e5['folderPath']?_0x27c811[_0xe2c4b3(0x1c1)]['get'](_0x72b4e5[_0xe2c4b3(0x134)]):undefined;_0x544948['onProgress']?.({'type':_0x72b4e5[_0xe2c4b3(0x1d1)]?'journey_creating':'journey_updating','name':_0x72b4e5['yamlConfig']['name']});try{const _0x5ba374=await executeSingleJourneyPush(_0x4a7ab2,_0x72b4e5,{..._0x27c811,'segmentNameToId':_0xa6a5f8},{'parentId':_0x4271b0[_0xe2c4b3(0x1f3)],'rootFolderId':_0x4271b0[_0xe2c4b3(0x1b1)],'folderId':_0x169a20,'verbose':_0x4271b0['verbose']},_0x544948,{'journeyDefToRequest':_0x11f858,'activationDefToCreateRequest':_0x8c7b03,'yamlRuleToApi':_0xdfa3f0,'validateSegmentRule':_0x1d0003});for(const [_0x580f46,_0x2440e9]of _0x5ba374[_0xe2c4b3(0x1ce)]){_0xa6a5f8[_0xe2c4b3(0x1f9)](_0x580f46,_0x2440e9),_0x16aa18[_0xe2c4b3(0x1ce)]['set'](_0x580f46,_0x2440e9);}if(_0x5ba374[_0xe2c4b3(0x185)]===_0xe2c4b3(0x1a3))_0x544948['onProgress']?.({'type':_0xe2c4b3(0x1e5),'name':_0x72b4e5[_0xe2c4b3(0x159)]['name'],'journeyId':_0x5ba374[_0xe2c4b3(0x147)]}),_0x544948['logSuccess']?.(_0xe2c4b3(0x184)+_0x72b4e5[_0xe2c4b3(0x159)][_0xe2c4b3(0x203)]+'\x27'),_0x16aa18[_0xe2c4b3(0x1a3)]++;else _0x5ba374[_0xe2c4b3(0x185)]===_0xe2c4b3(0x20e)&&(_0x544948[_0xe2c4b3(0x1de)]?.({'type':_0xe2c4b3(0x19f),'name':_0x72b4e5[_0xe2c4b3(0x159)][_0xe2c4b3(0x203)]}),_0x544948['logSuccess']?.(_0xe2c4b3(0x1a7)+_0x72b4e5[_0xe2c4b3(0x159)][_0xe2c4b3(0x203)]+'\x27'),_0x16aa18[_0xe2c4b3(0x20e)]++);return{'action':_0x5ba374['action'],'name':_0x72b4e5[_0xe2c4b3(0x159)][_0xe2c4b3(0x203)],'journeyId':_0x5ba374['journeyId']};}catch(_0x43f4c6){const _0x5121fa=isHttp400Error(_0x43f4c6),_0x1a8eba=_0x5121fa?ErrorCode[_0xe2c4b3(0x1a9)]:ErrorCode[_0xe2c4b3(0x13c)],_0x53e571=getErrorMessage(_0x43f4c6);throw new SDKError(_0x1a8eba,_0xe2c4b3(0x1d0)+(_0x72b4e5[_0xe2c4b3(0x1d1)]?_0xe2c4b3(0x132):_0xe2c4b3(0x192))+_0xe2c4b3(0x16f)+_0x72b4e5[_0xe2c4b3(0x180)]+_0xe2c4b3(0x187)+_0x53e571,_0x43f4c6);}}));_0x16aa18[_0x176ea7(0x1e6)]['push'](..._0x175fa6);}return _0x16aa18;}async function matchExistingJourneySegments(_0x29ac10,_0x4139df,_0x5f581c,_0x3a12c6,_0x265966){const _0x2f84e2=a142_0x420e71;if(!_0x4139df[_0x2f84e2(0x1fd)]||!_0x4139df[_0x2f84e2(0x159)][_0x2f84e2(0x19c)])return;const _0xb25962=new Map(),_0x557442=new Set();for(const _0x43bb24 of Object['keys'](_0x4139df[_0x2f84e2(0x159)][_0x2f84e2(0x19c)])){const _0x275516=generateDeterministicJourneySegmentName(_0x4139df[_0x2f84e2(0x159)][_0x2f84e2(0x203)],_0x43bb24);_0xb25962[_0x2f84e2(0x1f9)](_0x275516,_0x43bb24),_0x557442['add'](_0x43bb24);}const _0x5360c3=[],_0x4213bb=collectSegmentIdsFromJourneyApi(_0x4139df[_0x2f84e2(0x1fd)]);for(const _0x2485f3 of _0x4213bb){const _0x385ca7=await fetchSegment(_0x29ac10,_0x5f581c,_0x2485f3,_0x3a12c6);if(!_0x385ca7?.[_0x2f84e2(0x203)])continue;const _0x1a79e5=_0xb25962[_0x2f84e2(0x11c)](_0x385ca7[_0x2f84e2(0x203)]);_0x1a79e5?(_0x265966['set'](_0x1a79e5,_0x2485f3),_0x557442[_0x2f84e2(0x20f)](_0x1a79e5)):_0x5360c3[_0x2f84e2(0x170)]({'id':_0x2485f3,'seg':_0x385ca7});}if(_0x557442[_0x2f84e2(0x12c)]>0x0&&_0x5360c3[_0x2f84e2(0x118)]>0x0){const {localExpandedRuleToNames:_0x32454c}=buildLocalExpandedRuleMappings(_0x4139df['yamlConfig']),_0x1464c0=new Map();for(const {id:_0x42f8e2,seg:_0x14034b}of _0x5360c3){if(_0x14034b[_0x2f84e2(0x196)]){const _0x4feb49=apiRuleToYaml(_0x14034b['rule']);_0x1464c0[_0x2f84e2(0x1f9)](_0x42f8e2,_0x4feb49);}}for(const {id:_0x423596,seg:_0x5ec53c}of _0x5360c3){if(!_0x5ec53c['rule'])continue;const _0xba2cb0=_0x1464c0[_0x2f84e2(0x11c)](_0x423596);if(!_0xba2cb0)continue;const _0x4190a2=serializeExpandedRule(_0xba2cb0,_0x1464c0),_0xbbc2e9=_0x32454c[_0x2f84e2(0x11c)](_0x4190a2);if(_0xbbc2e9){const _0x56ef71=_0xbbc2e9[_0x2f84e2(0x172)](_0x344ac7=>_0x557442[_0x2f84e2(0x1c2)](_0x344ac7));_0x56ef71&&(_0x265966['set'](_0x56ef71,_0x423596),_0x557442['delete'](_0x56ef71),logger['debug'](_0x2f84e2(0x1f8)+_0x5ec53c[_0x2f84e2(0x203)]+_0x2f84e2(0x198)+_0x56ef71+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0xb6b45a,_0x5df031,_0x1152ec,_0x66ad3c,_0x221b81,_0x3f3bbd){const _0x24ec14=a142_0x420e71,{journeyDefToRequest:_0x22bdc5,activationDefToCreateRequest:_0x2d34c9,yamlRuleToApi:_0x1a0e1f,validateSegmentRule:_0x253f50}=_0x3f3bbd,_0x5a8eed=new Map(),_0x49bbda=new Map();recoverSegmentIdsFromPushRecovery(_0x5df031,_0x5a8eed,_0x1152ec[_0x24ec14(0x212)]);const _0x8e455d=new Map(),_0x36f8dd=new Map(),_0x55508f=new Map();let _0x47e46f;const _0x27890f=async()=>{const _0x158db4=_0x24ec14;if(_0x47e46f)return;_0x47e46f=new Map();if(!_0x5df031['existingJourney'])return;const _0xb1f328=await _0xb6b45a[_0x158db4(0x16c)][_0x158db4(0x17f)](_0x5df031['existingJourney']['id']);for(const _0x499a80 of _0xb1f328){const _0x29aa17=journeyActivationStepToYaml(_0x499a80,_0x1152ec[_0x158db4(0x143)],_0x1152ec[_0x158db4(0x1af)]),_0xc4195d=activationSignature(_0x29aa17);!_0x47e46f[_0x158db4(0x1c2)](_0xc4195d)&&_0x47e46f[_0x158db4(0x1f9)](_0xc4195d,_0x499a80['id']),_0x29aa17[_0x158db4(0x203)]&&_0x49bbda[_0x158db4(0x1f9)](_0x29aa17[_0x158db4(0x203)],_0x499a80['id']);}};await matchExistingJourneySegments(_0xb6b45a,_0x5df031,_0x66ad3c[_0x24ec14(0x1f3)],_0x1152ec[_0x24ec14(0x199)],_0x1152ec['segmentNameToId']);const _0x3de4e3={'resolveSegmentId':async _0x54a782=>{const _0xf48f4=_0x24ec14,_0x4b5ad2=_0x1152ec[_0xf48f4(0x212)][_0xf48f4(0x11c)](_0x54a782);if(!_0x4b5ad2)throw new SDKError(ErrorCode[_0xf48f4(0x1fb)],_0xf48f4(0x141)+_0x54a782+_0xf48f4(0x15b)+_0x5df031[_0xf48f4(0x159)][_0xf48f4(0x203)]+')');return _0x4b5ad2;},'resolveEmbeddedSegmentId':async(_0x35ced3,_0x4ae4f3)=>{const _0x51c2e6=_0x24ec14,_0x398e92=_0x1152ec[_0x51c2e6(0x212)]['get'](_0x35ced3);if(_0x398e92)return _0x398e92;const _0x252e82=_0x1152ec['existingSegments'][_0x51c2e6(0x172)](_0x1d812b=>_0x1d812b[_0x51c2e6(0x203)]===_0x35ced3);if(_0x252e82)return _0x1152ec[_0x51c2e6(0x212)]['set'](_0x35ced3,_0x252e82['id']),_0x252e82['id'];if(_0x5df031[_0x51c2e6(0x1d1)]){const {stageName:_0x55ecf5,criteriaName:_0x1371db}=findSegmentCriteriaLocation(_0x5df031[_0x51c2e6(0x159)],_0x35ced3);return _0x253f50(_0x35ced3,_0x4ae4f3[_0x51c2e6(0x196)]),_0x36f8dd['set'](_0x35ced3,{'definition':_0x4ae4f3,'stageName':_0x55ecf5,'criteriaName':_0x1371db}),createPendingSegmentId(_0x35ced3);}const _0x171848=_0x5df031[_0x51c2e6(0x1fd)]?.['id'];if(!_0x171848)throw new SDKError(ErrorCode['INTERNAL'],_0x51c2e6(0x164));const _0x394a39=_0x8e455d[_0x51c2e6(0x11c)](_0x35ced3);if(_0x394a39)return _0x394a39;const _0x540710=((async()=>{const _0x29f330=_0x51c2e6;_0x253f50(_0x35ced3,_0x4ae4f3['rule']);const _0x4cf12e=generateDeterministicJourneySegmentName(_0x5df031[_0x29f330(0x159)][_0x29f330(0x203)],_0x35ced3),_0x3b8d2e=_0x1152ec[_0x29f330(0x199)][_0x29f330(0x172)](_0x49efd7=>_0x49efd7[_0x29f330(0x203)]===_0x4cf12e),_0x5467ad=createSegmentIdResolver(_0x1152ec[_0x29f330(0x212)],_0x35ced3),_0x2a4921=await resolveRuleSegmentIds(_0x4ae4f3[_0x29f330(0x196)],_0x5467ad);let _0x374f18;return _0x3b8d2e?(await _0xb6b45a['segment'][_0x29f330(0x177)](_0x66ad3c[_0x29f330(0x1f3)],_0x3b8d2e['id'],{'description':_0x4ae4f3[_0x29f330(0x131)]||'Entry\x20criteria:\x20'+_0x35ced3,'rule':_0x1a0e1f(_0x2a4921,!![]),'countPopulation':!![]}),_0x374f18=_0x3b8d2e['id'],saveSegmentToPushRecovery(_0x5df031[_0x29f330(0x180)],_0x5df031[_0x29f330(0x159)][_0x29f330(0x203)],_0x35ced3,{'segmentId':_0x374f18,'uniqueServerName':_0x4cf12e,'createdAt':new Date()['toISOString']()})):_0x374f18=await createOrRecoverEmbeddedSegment(_0xb6b45a,_0x5df031,{'localName':_0x35ced3,'uniqueSegmentName':_0x4cf12e,'description':_0x4ae4f3['description']||_0x29f330(0x151)+_0x35ced3,'journeyId':_0x171848,'resolvedRule':_0x2a4921,'parentId':_0x66ad3c[_0x29f330(0x1f3)],'folderId':_0x66ad3c[_0x29f330(0x1b1)]||''},_0x1a0e1f),_0x1152ec['segmentNameToId'][_0x29f330(0x1f9)](_0x35ced3,_0x374f18),_0x5a8eed['set'](_0x35ced3,_0x374f18),_0x374f18;})());_0x8e455d['set'](_0x35ced3,_0x540710);try{return await _0x540710;}finally{_0x8e455d[_0x51c2e6(0x20f)](_0x35ced3);}},'resolveActivationId':async _0x510ead=>{const _0x115907=_0x24ec14,_0x58c8a8=_0x49bbda[_0x115907(0x11c)](_0x510ead);if(_0x58c8a8)return _0x58c8a8;if(_0x5df031[_0x115907(0x1fd)]){await _0x27890f();const _0xccbd0=_0x49bbda[_0x115907(0x11c)](_0x510ead);if(_0xccbd0)return _0xccbd0;}throw new SDKError(ErrorCode[_0x115907(0x1a2)],'Activation\x20not\x20found:\x20'+_0x510ead+_0x115907(0x15b)+_0x5df031[_0x115907(0x159)][_0x115907(0x203)]+_0x115907(0x1f0)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x52f4b8,_0x34e72e)=>{const _0x587eac=_0x24ec14,_0x1532cf=_0x49bbda[_0x587eac(0x11c)](_0x52f4b8);if(_0x1532cf)return _0x1532cf;if(_0x5df031[_0x587eac(0x1d1)])return _0x55508f[_0x587eac(0x1f9)](_0x52f4b8,_0x34e72e),createPendingActivationId(_0x52f4b8);if(_0x5df031[_0x587eac(0x1fd)]){await _0x27890f();const _0x1d2931=_0x49bbda['get'](_0x34e72e['name']);if(_0x1d2931)return _0x49bbda[_0x587eac(0x1f9)](_0x52f4b8,_0x1d2931),_0x1d2931;const _0x1a32e1=activationSignature(_0x34e72e),_0x491683=_0x47e46f?.[_0x587eac(0x11c)](_0x1a32e1);if(_0x491683)return _0x49bbda[_0x587eac(0x1f9)](_0x52f4b8,_0x491683),_0x491683;const _0x1bf069=await _0x2d34c9(_0x34e72e,_0x1152ec['activationContext']),_0x427c37={..._0x1bf069,..._0x34e72e[_0x587eac(0x16a)]!==undefined&&{'runAfterJourneyRefresh':_0x34e72e['run_after_journey_refresh']}},_0x58817a=await _0xb6b45a[_0x587eac(0x16c)][_0x587eac(0x210)](_0x5df031[_0x587eac(0x1fd)]['id'],_0x427c37);return _0x49bbda[_0x587eac(0x1f9)](_0x52f4b8,_0x58817a['id']),_0x58817a['id'];}throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x1d2a50=>{const _0x1ab3cc=_0x24ec14;try{return await _0xb6b45a['journey'][_0x1ab3cc(0x171)](_0x66ad3c['parentId'],_0x1d2a50);}catch(_0x1a9fe8){throw new SDKError(ErrorCode[_0x1ab3cc(0x1a2)],_0x1ab3cc(0x128)+_0x1d2a50+_0x1ab3cc(0x20b)+_0x5df031[_0x1ab3cc(0x159)][_0x1ab3cc(0x203)]+'\x27)',_0x1a9fe8);}},'resolveStageId':async(_0x19a2b2,_0x3d8061)=>{const _0x107ee5=_0x24ec14,_0x3ea3ac=await _0xb6b45a['journey'][_0x107ee5(0x1db)](_0x19a2b2),_0x4182d5=_0x3ea3ac['attributes'][_0x107ee5(0x1b2)][_0x107ee5(0x172)](_0x4c39b3=>_0x4c39b3[_0x107ee5(0x203)][_0x107ee5(0x179)]()===_0x3d8061[_0x107ee5(0x179)]());if(!_0x4182d5?.['id'])throw new SDKError(ErrorCode[_0x107ee5(0x1a2)],_0x107ee5(0x19b)+_0x3d8061+_0x107ee5(0x190)+(_0x3ea3ac[_0x107ee5(0x161)]['journeyBundleName']||_0x3ea3ac[_0x107ee5(0x161)][_0x107ee5(0x203)])+'\x27');return _0x4182d5['id'];}},_0x1c54f9=await _0x22bdc5(_0x5df031[_0x24ec14(0x159)],_0x66ad3c['parentId'],_0x3de4e3),_0x13061e=_0x66ad3c[_0x24ec14(0x201)]||_0x66ad3c['rootFolderId'];_0x13061e&&(_0x1c54f9[_0x24ec14(0x13a)]={'parentFolder':{'data':{'id':_0x13061e,'type':'folder'}}});if(_0x5df031[_0x24ec14(0x1d1)]){if(_0x36f8dd['size']>0x0||_0x55508f[_0x24ec14(0x12c)]>0x0)return await executeThreeStepJourneyCreate(_0xb6b45a,_0x5df031,_0x1c54f9,{'pendingEmbeddedSegments':_0x36f8dd,'pendingEmbeddedActivations':_0x55508f,'embeddedSegmentNameToId':_0x5a8eed,'journeyActivationNameToId':_0x49bbda},{..._0x66ad3c,'effectiveFolderId':_0x13061e},_0x1152ec,_0x221b81,_0x3f3bbd);else{ensureJourneyDefaults(_0x1c54f9[_0x24ec14(0x161)]);const _0x314b3a=await _0xb6b45a[_0x24ec14(0x16c)][_0x24ec14(0x132)](_0x1c54f9);return deletePushRecovery(_0x5df031[_0x24ec14(0x180)]),{'action':'created','journeyId':_0x314b3a['id'],'embeddedSegmentNameToId':_0x5a8eed};}}else{if(_0x5df031['hasChanges']&&_0x5df031[_0x24ec14(0x1fd)]){_0x1c54f9['id']=_0x5df031[_0x24ec14(0x1fd)]['id'];const _0x4cdc00=_0x1c54f9[_0x24ec14(0x161)];_0x5df031['existingJourney'][_0x24ec14(0x161)]?.[_0x24ec14(0x117)]&&(_0x4cdc00[_0x24ec14(0x117)]=_0x5df031['existingJourney']['attributes'][_0x24ec14(0x117)]);const _0x2bdff2=_0x5df031[_0x24ec14(0x1fd)][_0x24ec14(0x161)]?.['journeyStages'];return _0x2bdff2&&_0x1c54f9[_0x24ec14(0x161)][_0x24ec14(0x1b2)]&&injectExistingStageIds(_0x1c54f9[_0x24ec14(0x161)]['journeyStages'],_0x2bdff2),ensureJourneyDefaults(_0x4cdc00),await _0xb6b45a['journey']['update'](_0x5df031['existingJourney']['id'],_0x1c54f9),deletePushRecovery(_0x5df031['absolutePath']),{'action':_0x24ec14(0x20e),'journeyId':_0x5df031[_0x24ec14(0x1fd)]['id'],'embeddedSegmentNameToId':_0x5a8eed};}}return deletePushRecovery(_0x5df031[_0x24ec14(0x180)]),{'action':_0x24ec14(0x149),'journeyId':_0x5df031[_0x24ec14(0x1fd)]?.['id'],'embeddedSegmentNameToId':_0x5a8eed};}function findSegmentCriteriaLocation(_0x42db25,_0x2c31b3){const _0x5a4cfd=a142_0x420e71,_0x194c03=_0x42db25[_0x5a4cfd(0x12b)]||_0x42db25[_0x5a4cfd(0x12a)]?.[0x0]?.[_0x5a4cfd(0x12b)]||[];let _0x4730e5=_0x5a4cfd(0x1b5),_0x1d0f08=_0x2c31b3;const _0x5bd7a1=_0x42db25[_0x5a4cfd(0x146)]||_0x42db25['journeys']?.[0x0]?.[_0x5a4cfd(0x146)];if(_0x5bd7a1?.[_0x5a4cfd(0x1e2)]===_0x2c31b3)return{'stageName':'goal','criteriaName':_0x5bd7a1['name']||_0x2c31b3};_0x7261ac:for(const _0x3cbe57 of _0x194c03){if(_0x3cbe57[_0x5a4cfd(0x214)]?.['segment']===_0x2c31b3){_0x4730e5=_0x3cbe57[_0x5a4cfd(0x203)],_0x1d0f08=_0x3cbe57[_0x5a4cfd(0x214)][_0x5a4cfd(0x203)]||_0x2c31b3;break;}if(_0x3cbe57[_0x5a4cfd(0x1da)])for(const _0x203023 of _0x3cbe57[_0x5a4cfd(0x1da)]){if(_0x203023[_0x5a4cfd(0x167)]==='decision_point'&&_0x203023['with']?.[_0x5a4cfd(0x1d8)])for(const _0x5e590d of _0x203023[_0x5a4cfd(0x200)][_0x5a4cfd(0x1d8)]){if(_0x5e590d[_0x5a4cfd(0x1e2)]===_0x2c31b3){_0x4730e5=_0x3cbe57[_0x5a4cfd(0x203)],_0x1d0f08=_0x5e590d[_0x5a4cfd(0x203)]||_0x2c31b3;break _0x7261ac;}}}}return{'stageName':_0x4730e5,'criteriaName':_0x1d0f08};}async function executeThreeStepJourneyCreate(_0x580b53,_0x118a21,_0x3f48b1,_0x134bb6,_0x51f307,_0x174d46,_0x28dfcd,_0x462b1c){const _0x17a593=a142_0x420e71,{activationDefToCreateRequest:_0x373a33,yamlRuleToApi:_0x26e149}=_0x462b1c,{pendingEmbeddedSegments:_0x2b87e7,pendingEmbeddedActivations:_0x1fc038,embeddedSegmentNameToId:_0x2bbef6}=_0x134bb6,_0x54f468=JSON[_0x17a593(0x1ff)](JSON[_0x17a593(0x1e3)](_0x3f48b1));ensureJourneyDefaults(_0x54f468['attributes']),stripPendingIds(_0x54f468);const _0x442803=await _0x580b53[_0x17a593(0x16c)][_0x17a593(0x132)](_0x54f468),_0x2639d3=_0x442803['id'],_0x5b0110=new Map();for(const _0x447cba of _0x442803[_0x17a593(0x161)]['journeyStages']){_0x5b0110[_0x17a593(0x1f9)](_0x447cba[_0x17a593(0x203)][_0x17a593(0x179)](),_0x447cba['id']);}recoverSegmentIdsFromPushRecovery(_0x118a21,_0x2bbef6,_0x174d46[_0x17a593(0x212)]);for(const [_0x29d810,{definition:_0x4bdc91}]of _0x2b87e7){if(_0x2bbef6[_0x17a593(0x1c2)](_0x29d810)){_0x28dfcd[_0x17a593(0x1de)]?.({'type':_0x17a593(0x12e),'journeyName':_0x118a21['yamlConfig'][_0x17a593(0x203)],'segmentName':_0x29d810});continue;}const _0x4f9a98=generateDeterministicJourneySegmentName(_0x118a21['yamlConfig']['name'],_0x29d810);_0x28dfcd['onProgress']?.({'type':_0x17a593(0x165),'journeyName':_0x118a21[_0x17a593(0x159)][_0x17a593(0x203)],'segmentName':_0x29d810});const _0x3a9da3=createSegmentIdResolver(_0x174d46[_0x17a593(0x212)],_0x29d810),_0x36debc=await resolveRuleSegmentIds(_0x4bdc91[_0x17a593(0x196)],_0x3a9da3),_0x2cc067=await createOrRecoverEmbeddedSegment(_0x580b53,_0x118a21,{'localName':_0x29d810,'uniqueSegmentName':_0x4f9a98,'description':_0x4bdc91['description']||'Entry\x20criteria:\x20'+_0x29d810,'journeyId':_0x2639d3,'resolvedRule':_0x36debc,'parentId':_0x51f307[_0x17a593(0x1f3)],'folderId':_0x51f307[_0x17a593(0x173)]||''},_0x26e149);_0x2bbef6[_0x17a593(0x1f9)](_0x29d810,_0x2cc067),_0x174d46[_0x17a593(0x212)][_0x17a593(0x1f9)](_0x29d810,_0x2cc067),_0x28dfcd['onProgress']?.({'type':_0x17a593(0x12e),'journeyName':_0x118a21[_0x17a593(0x159)]['name'],'segmentName':_0x29d810});}const _0x2fb20d=new Map();for(const [_0x54abd7,_0x44d8d3]of _0x1fc038){_0x28dfcd[_0x17a593(0x1de)]?.({'type':_0x17a593(0x1f7),'journeyName':_0x118a21[_0x17a593(0x159)][_0x17a593(0x203)],'activationName':_0x54abd7});const _0x1cc7c8=await _0x373a33(_0x44d8d3,_0x174d46[_0x17a593(0x1b8)]),_0x27e504={..._0x1cc7c8,..._0x44d8d3[_0x17a593(0x16a)]!==undefined&&{'runAfterJourneyRefresh':_0x44d8d3[_0x17a593(0x16a)]}},_0x4be451=await _0x580b53[_0x17a593(0x16c)][_0x17a593(0x210)](_0x2639d3,_0x27e504);_0x2fb20d[_0x17a593(0x1f9)](_0x54abd7,_0x4be451['id']),_0x134bb6[_0x17a593(0x17d)][_0x17a593(0x1f9)](_0x54abd7,_0x4be451['id']),_0x28dfcd[_0x17a593(0x1de)]?.({'type':_0x17a593(0x1a6),'journeyName':_0x118a21[_0x17a593(0x159)][_0x17a593(0x203)],'activationName':_0x54abd7});}const _0x3e57d1=JSON['parse'](JSON[_0x17a593(0x1e3)](_0x3f48b1));return _0x3e57d1['id']=_0x2639d3,ensureJourneyDefaults(_0x3e57d1[_0x17a593(0x161)]),resolvePendingIdsInRequest(_0x3e57d1,_0x3f48b1,_0x5b0110,_0x2bbef6,_0x2fb20d,_0x28dfcd),await _0x580b53['journey'][_0x17a593(0x192)](_0x2639d3,_0x3e57d1),deletePushRecovery(_0x118a21[_0x17a593(0x180)]),{'action':_0x17a593(0x1a3),'journeyId':_0x2639d3,'embeddedSegmentNameToId':_0x2bbef6};}export function stripWaitStepPendingIds(_0xa1fed5){const _0x243e83=a142_0x420e71,_0x59eddd=_0xa1fed5[_0x243e83(0x150)]&&isPendingSegmentId(_0xa1fed5[_0x243e83(0x150)]),_0x13f480=_0xa1fed5[_0x243e83(0x15a)]?.[_0x243e83(0x1b6)](_0x477a30=>_0x477a30[_0x243e83(0x20a)]&&isPendingSegmentId(_0x477a30[_0x243e83(0x20a)]));(_0x59eddd||_0x13f480)&&(_0xa1fed5[_0x243e83(0x1cf)]='Duration',_0xa1fed5['waitStep']=0x1,_0xa1fed5[_0x243e83(0x197)]='day',delete _0xa1fed5[_0x243e83(0x150)],delete _0xa1fed5[_0x243e83(0x17b)],delete _0xa1fed5[_0x243e83(0x1b7)],delete _0xa1fed5[_0x243e83(0x15a)]);}export function resolveWaitStepPendingIds(_0x3d2caa,_0x2c4a9b,_0x10c679,_0x541b18){const _0x1bf571=a142_0x420e71;if(_0x2c4a9b['conditionSegmentId']&&isPendingSegmentId(_0x2c4a9b['conditionSegmentId'])){const _0x15ff2d=_0x10c679(_0x2c4a9b[_0x1bf571(0x150)],'stage\x20\x27'+_0x541b18+'\x27\x20wait\x20condition');_0x15ff2d&&(_0x3d2caa[_0x1bf571(0x1cf)]=_0x1bf571(0x148),_0x3d2caa[_0x1bf571(0x150)]=_0x15ff2d,delete _0x3d2caa['waitStep'],delete _0x3d2caa[_0x1bf571(0x197)],_0x2c4a9b[_0x1bf571(0x17b)]!==undefined&&(_0x3d2caa[_0x1bf571(0x17b)]=_0x2c4a9b[_0x1bf571(0x17b)]),_0x2c4a9b['conditionTimeoutUnit']&&(_0x3d2caa['conditionTimeoutUnit']=_0x2c4a9b[_0x1bf571(0x1b7)]));}if(_0x2c4a9b[_0x1bf571(0x15a)]){const _0x4c0e78=_0x2c4a9b[_0x1bf571(0x15a)]['some'](_0x186e97=>_0x186e97['segmentId']&&isPendingSegmentId(_0x186e97[_0x1bf571(0x20a)]));if(_0x4c0e78){const _0x3b15e7=_0x2c4a9b[_0x1bf571(0x15a)][_0x1bf571(0x209)](_0x5c9676=>{const _0x4d9417=_0x1bf571;if(_0x5c9676[_0x4d9417(0x20a)]&&isPendingSegmentId(_0x5c9676['segmentId'])){const _0x455536=_0x10c679(_0x5c9676['segmentId'],_0x4d9417(0x20c)+_0x541b18+'\x27\x20wait\x20condition');return{..._0x5c9676,'segmentId':_0x455536||_0x5c9676[_0x4d9417(0x20a)]};}return{..._0x5c9676};});_0x3d2caa[_0x1bf571(0x1cf)]=_0x1bf571(0x148),_0x3d2caa[_0x1bf571(0x15a)]=_0x3b15e7,delete _0x3d2caa['waitStep'],delete _0x3d2caa[_0x1bf571(0x197)],delete _0x3d2caa[_0x1bf571(0x150)],delete _0x3d2caa[_0x1bf571(0x17b)],delete _0x3d2caa[_0x1bf571(0x1b7)];}}}function stripPendingIds(_0x41fde7){const _0x51312b=a142_0x420e71;_0x41fde7['attributes'][_0x51312b(0x146)]?.['segmentId']&&isPendingSegmentId(_0x41fde7[_0x51312b(0x161)][_0x51312b(0x146)][_0x51312b(0x20a)])&&delete _0x41fde7[_0x51312b(0x161)]['goal'];for(const _0xa32129 of _0x41fde7['attributes'][_0x51312b(0x1b2)]||[]){_0xa32129[_0x51312b(0x1ed)]?.[_0x51312b(0x20a)]&&isPendingSegmentId(_0xa32129[_0x51312b(0x1ed)][_0x51312b(0x20a)])&&delete _0xa32129['entryCriteria'];_0xa32129[_0x51312b(0x124)]?.[_0x51312b(0x20a)]&&isPendingSegmentId(_0xa32129[_0x51312b(0x124)][_0x51312b(0x20a)])&&delete _0xa32129[_0x51312b(0x124)];_0xa32129[_0x51312b(0x1c7)]&&(_0xa32129[_0x51312b(0x1c7)]=_0xa32129['exitCriterias'][_0x51312b(0x1be)](_0x53d1ee=>!_0x53d1ee['segmentId']||!isPendingSegmentId(_0x53d1ee[_0x51312b(0x20a)])));if(_0xa32129[_0x51312b(0x1da)])for(const _0x3ae480 of Object[_0x51312b(0x14c)](_0xa32129[_0x51312b(0x1da)])){const _0x8bbf0e=_0xa32129[_0x51312b(0x1da)][_0x3ae480];_0x8bbf0e[_0x51312b(0x167)]===_0x51312b(0x181)&&_0x8bbf0e['journeyActivationStepId']&&isPendingActivationId(_0x8bbf0e['journeyActivationStepId'])&&(_0x8bbf0e[_0x51312b(0x18b)]='');if(_0x8bbf0e[_0x51312b(0x167)]==='DecisionPoint'&&_0x8bbf0e['branches'])for(const _0xbd781 of _0x8bbf0e[_0x51312b(0x1d8)]){_0xbd781[_0x51312b(0x20a)]&&isPendingSegmentId(_0xbd781['segmentId'])&&(_0xbd781[_0x51312b(0x20a)]='');}_0x8bbf0e[_0x51312b(0x167)]==='WaitStep'&&stripWaitStepPendingIds(_0x8bbf0e);}}}function resolvePendingIdsInRequest(_0x583db0,_0x37031e,_0x5c56e8,_0x259704,_0x35b9d3,_0x1d57c5){const _0x4b32e3=a142_0x420e71,_0x1fdd07=(_0x36255d,_0x30e1f8)=>{const _0x2048c7=a142_0x1102;if(!isPendingSegmentId(_0x36255d))return _0x36255d;const _0x99bb6f=extractPendingSegmentName(_0x36255d),_0x2c2376=_0x259704[_0x2048c7(0x11c)](_0x99bb6f);return!_0x2c2376&&_0x1d57c5[_0x2048c7(0x126)]?.(_0x2048c7(0x14b)+_0x99bb6f+_0x2048c7(0x206)+_0x30e1f8),_0x2c2376;};if(_0x583db0[_0x4b32e3(0x161)][_0x4b32e3(0x146)]?.[_0x4b32e3(0x20a)]&&isPendingSegmentId(_0x583db0['attributes']['goal'][_0x4b32e3(0x20a)])){const _0x5deaed=_0x1fdd07(_0x583db0[_0x4b32e3(0x161)][_0x4b32e3(0x146)][_0x4b32e3(0x20a)],_0x4b32e3(0x142));_0x5deaed&&(_0x583db0[_0x4b32e3(0x161)][_0x4b32e3(0x146)][_0x4b32e3(0x20a)]=_0x5deaed);}for(const _0x2b4fd4 of _0x583db0[_0x4b32e3(0x161)][_0x4b32e3(0x1b2)]||[]){const _0x31702c=_0x5c56e8[_0x4b32e3(0x11c)](_0x2b4fd4[_0x4b32e3(0x203)]['toLowerCase']());_0x31702c&&(_0x2b4fd4['id']=_0x31702c);if(_0x2b4fd4['entryCriteria']?.[_0x4b32e3(0x20a)]&&isPendingSegmentId(_0x2b4fd4['entryCriteria']['segmentId'])){const _0x202f69=_0x1fdd07(_0x2b4fd4[_0x4b32e3(0x1ed)][_0x4b32e3(0x20a)],_0x4b32e3(0x20c)+_0x2b4fd4[_0x4b32e3(0x203)]+_0x4b32e3(0x1e4));_0x202f69&&(_0x2b4fd4[_0x4b32e3(0x1ed)][_0x4b32e3(0x20a)]=_0x202f69);}if(_0x2b4fd4[_0x4b32e3(0x1c7)])for(const _0x2ee71c of _0x2b4fd4['exitCriterias']){if(_0x2ee71c[_0x4b32e3(0x20a)]&&isPendingSegmentId(_0x2ee71c[_0x4b32e3(0x20a)])){const _0x5deb3a=_0x1fdd07(_0x2ee71c[_0x4b32e3(0x20a)],_0x4b32e3(0x20c)+_0x2b4fd4[_0x4b32e3(0x203)]+'\x27\x20exit\x20criteria');_0x5deb3a&&(_0x2ee71c[_0x4b32e3(0x20a)]=_0x5deb3a);}}if(_0x2b4fd4[_0x4b32e3(0x124)]?.[_0x4b32e3(0x20a)]&&isPendingSegmentId(_0x2b4fd4[_0x4b32e3(0x124)]['segmentId'])){const _0x1bc653=_0x1fdd07(_0x2b4fd4['milestone'][_0x4b32e3(0x20a)],_0x4b32e3(0x20c)+_0x2b4fd4[_0x4b32e3(0x203)]+_0x4b32e3(0x17a));_0x1bc653&&(_0x2b4fd4['milestone'][_0x4b32e3(0x20a)]=_0x1bc653);}if(_0x2b4fd4[_0x4b32e3(0x1da)]){const _0x49d71e=_0x4b7998=>_0x37031e[_0x4b32e3(0x161)][_0x4b32e3(0x1b2)]?.[_0x4b32e3(0x172)](_0x2ce4ac=>_0x2ce4ac[_0x4b32e3(0x203)][_0x4b32e3(0x179)]()===_0x2b4fd4[_0x4b32e3(0x203)][_0x4b32e3(0x179)]())?.[_0x4b32e3(0x1da)]?.[_0x4b7998];for(const _0x367f89 of Object[_0x4b32e3(0x14c)](_0x2b4fd4[_0x4b32e3(0x1da)])){const _0x57b99c=_0x2b4fd4['steps'][_0x367f89],_0x5d1428=_0x49d71e(_0x367f89);if(_0x57b99c['type']===_0x4b32e3(0x181)&&_0x57b99c[_0x4b32e3(0x18b)]&&(isPendingActivationId(_0x57b99c[_0x4b32e3(0x18b)])||_0x57b99c[_0x4b32e3(0x18b)]==='')){if(_0x5d1428?.[_0x4b32e3(0x18b)]&&isPendingActivationId(_0x5d1428[_0x4b32e3(0x18b)])){const _0x200579=extractPendingActivationName(_0x5d1428[_0x4b32e3(0x18b)]),_0xbf1afc=_0x35b9d3[_0x4b32e3(0x11c)](_0x200579);_0xbf1afc&&(_0x57b99c[_0x4b32e3(0x18b)]=_0xbf1afc);}}if(_0x57b99c['type']===_0x4b32e3(0x16e)&&_0x57b99c[_0x4b32e3(0x1d8)]&&_0x5d1428?.['branches'])for(let _0x5f26c7=0x0;_0x5f26c7<_0x57b99c[_0x4b32e3(0x1d8)][_0x4b32e3(0x118)];_0x5f26c7++){const _0x2025ae=_0x57b99c[_0x4b32e3(0x1d8)][_0x5f26c7],_0x2e8f88=_0x5d1428[_0x4b32e3(0x1d8)][_0x5f26c7];if(_0x2e8f88?.[_0x4b32e3(0x20a)]&&isPendingSegmentId(_0x2e8f88['segmentId'])){const _0x16739c=_0x1fdd07(_0x2e8f88['segmentId'],'stage\x20\x27'+_0x2b4fd4['name']+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x2025ae['name']||_0x5f26c7)+'\x27');_0x16739c&&(_0x2025ae[_0x4b32e3(0x20a)]=_0x16739c);}}_0x57b99c['type']==='WaitStep'&&_0x5d1428?.[_0x4b32e3(0x167)]===_0x4b32e3(0x12f)&&resolveWaitStepPendingIds(_0x57b99c,_0x5d1428,_0x1fdd07,_0x2b4fd4['name']);}}}}function a142_0x161b(){const _0x3abbb1=['localName','entries','journeyBundleId','match','Deleted\x20activation\x20\x27','connectionIdToNameMap','hasChanges','rootFolderId','journeyStages','from','Updating\x20segment\x20\x27','entry','some','conditionTimeoutUnit','activationContext','createJourneySegment','Creating\x20segment\x20\x27','segment_creating','uniqueSegmentName','connector_config','filter','activation_deleted','activation_creating','folderPathToId','has','activation_created','nameToType','split','diff','exitCriterias','deleted','SEGMENT_UPDATE_ERROR','Created\x20activation\x20\x27','Creating\x20activation\x20\x27','replace','updateActivation','embeddedSegmentNameToId','waitStepType','Failed\x20to\x20','isNew','segment_created','valid','activationsBySegmentId','resolvedRule','logSuccess','behavior','branches','relative','steps','getJourney','idToName','dirname','onProgress','7ODXynN','getActivation','Failed\x20to\x20resolve\x20activation\x20','segment','stringify','\x27\x20entry\x20criteria','journey_created','results','debug','deleteSegment','deps','parseDocument','index','slice','entryCriteria','__pending_act_','and\x20the\x20server\x20segment,\x20then\x20retry.',').\x20','message','6919855TBFdrm','parentId','sort','join','segment_deleting','embedded_activation_creating','Matched\x20server\x20segment\x20\x27','set','draft','SEGMENT_NOT_FOUND','activations','existingJourney','activationStepsById','parse','with','folderId','../../utils/async.js','name','84610AyypRi','getSegmentEntity\x20also\x20failed\x20for\x20','\x27\x20for\x20','item','uniqueServerName','map','segmentId','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','stage\x20\x27','7595004IwaSFo','updated','delete','createActivation','activation_updated','segmentNameToId','versionNumber','entry_criteria','\x27...','journeyBundleName','length','resolveSegment','skipSegments','1882581PNIIWu','get','toISOString','activationActions','Updated\x20activation\x20\x27','max','activation_','createFolder','folder_creating','milestone','./child-segment-yaml.js','logWarning','columns','Journey\x20\x27','Fetching\x20','journeys','stages','size','isArray','embedded_segment_created','WaitStep','createdSegmentIds','description','create','ACTIVATION_UPDATE_ERROR','folderPath','Failed\x20to\x20fetch\x20referenced\x20segment\x20','.$1.push-recovery.json','existingActivation','ACTIVATION_SYNTAX_ERROR','Deleting\x20activation\x20\x27','relationships','SEGMENT_SYNTAX_ERROR','JOURNEY_UPDATE_ERROR','createdSegmentId','withProgress','toString','hex','Segment\x20not\x20found:\x20','goal\x20criteria','idToEmailMap','getSegment\x20failed\x20for\x20','trim','goal','journeyId','Condition','unchanged','52988BVbLvK','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','keys','Updated\x20segment\x20\x27','deleteActivation','includes','conditionSegmentId','Entry\x20criteria:\x20','journey_entry_criteria_','activationParams','\x27\x20from\x20file:\x20','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','schedule','Name\x20has\x20already\x20been\x20taken','flatMap','yamlConfig','conditions','\x20(referenced\x20in\x20journey\x20','yamlActivation','./journey-yaml.js','27WfEBqd','progress','activation_deleting','attributes','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','createSegment','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','embedded_segment_creating','add','type','):\x20','validatedRequest','run_after_journey_refresh','values','journey','segment_deleted','DecisionPoint','\x20journey\x20from\x20file:\x20','push','resolveJourneyId','find','effectiveFolderId','logDeleted','8463704GCUyTe','journeyName','updateSegmentById','activation_template_id','toLowerCase','\x27\x20milestone','conditionTimeoutDuration','existingSegment','journeyActivationNameToId','segmentByFolderAndName','listActivations','absolutePath','Activation','getSegment','notification','Created\x20journey\x20\x27','action','digest','\x0a\x20\x20','Delete\x20the\x20push\x20recovery\x20file\x20(','journeyById','segmentFolderId','journeyActivationStepId','reduce','1439022pmeglM','kind','journeyBundlesByFolderAndName','\x27\x20not\x20found\x20in\x20journey\x20\x27','sha1','update','segment_updating','startsWith','utf-8','rule','waitStepUnit','\x27\x20to\x20local\x20\x27','existingSegments','data','Stage\x20\x27','segments','connection','Deleted\x20segment\x20\x27','journey_updated','logInfo','activation_updating','NOT_FOUND','created',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','user','embedded_activation_created','Updated\x20journey\x20\x27','8172cKaPDZ','JOURNEY_SYNTAX_ERROR'];a142_0x161b=function(){return _0x3abbb1;};return a142_0x161b();}
|
|
1
|
+
const a142_0x3ef9cf=a142_0x3bff;(function(_0x554a80,_0x3216c9){const _0x544678=a142_0x3bff,_0x2c8489=_0x554a80();while(!![]){try{const _0x55a6ae=parseInt(_0x544678(0x21d))/0x1*(-parseInt(_0x544678(0x277))/0x2)+-parseInt(_0x544678(0x1cf))/0x3+-parseInt(_0x544678(0x1e0))/0x4+-parseInt(_0x544678(0x1de))/0x5*(-parseInt(_0x544678(0x22c))/0x6)+-parseInt(_0x544678(0x1eb))/0x7*(-parseInt(_0x544678(0x233))/0x8)+parseInt(_0x544678(0x232))/0x9+parseInt(_0x544678(0x1d3))/0xa;if(_0x55a6ae===_0x3216c9)break;else _0x2c8489['push'](_0x2c8489['shift']());}catch(_0x350141){_0x2c8489['push'](_0x2c8489['shift']());}}}(a142_0x570e,0x4c840));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x3ef9cf(0x2a0));export const PENDING_SEGMENT_PREFIX=a142_0x3ef9cf(0x296);export const PENDING_ACTIVATION_PREFIX=a142_0x3ef9cf(0x22b);export function createPendingSegmentId(_0x358f42){return''+PENDING_SEGMENT_PREFIX+_0x358f42+'__';}export function isPendingSegmentId(_0x4f67f6){const _0x3d3c34=a142_0x3ef9cf;return _0x4f67f6[_0x3d3c34(0x207)](PENDING_SEGMENT_PREFIX)&&!_0x4f67f6[_0x3d3c34(0x207)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x23a6b5){const _0x444785=a142_0x3ef9cf;return _0x23a6b5[_0x444785(0x275)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x17378f){return''+PENDING_ACTIVATION_PREFIX+_0x17378f+'__';}export function isPendingActivationId(_0x1e2954){return _0x1e2954['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x5839d0){const _0xb743bb=a142_0x3ef9cf;return _0x5839d0[_0xb743bb(0x275)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3dd469,_0x16e630){const _0xdc2d0a=a142_0x3ef9cf,_0x3ff77b=_0x3dd469+'::'+(_0x16e630[_0xdc2d0a(0x266)]()||_0xdc2d0a(0x1c7)),_0x2ca757=createHash('sha1')[_0xdc2d0a(0x26c)](_0x3ff77b)[_0xdc2d0a(0x28c)](_0xdc2d0a(0x1e4))[_0xdc2d0a(0x212)](0x0,0xc);return'journey_entry_criteria_'+_0x2ca757;}export function ensureJourneyDefaults(_0x23af51){const _0x119e00=a142_0x3ef9cf;!_0x23af51[_0x119e00(0x23e)]&&(_0x23af51[_0x119e00(0x23e)]=''),!_0x23af51[_0x119e00(0x1ca)]&&(_0x23af51[_0x119e00(0x1ca)]=_0x119e00(0x287));}export function injectExistingStageIds(_0x4c00ff,_0x44ee94){const _0xced3b7=a142_0x3ef9cf,_0x18e7bc=new Map(_0x44ee94[_0xced3b7(0x209)](_0xf6a41c=>[_0xf6a41c['name'],_0xf6a41c['id']]));for(const _0x446f92 of _0x4c00ff){if(!_0x446f92['id']){const _0x5612d1=_0x18e7bc['get'](_0x446f92[_0xced3b7(0x26e)]);_0x5612d1&&(_0x446f92['id']=_0x5612d1);}}}export function resolveTDFolderPath(_0x2ae020,_0x3612c2,_0x3fa3b6){const _0x4a1b80=a142_0x3ef9cf;if(!_0x3612c2)return _0x2ae020;if(_0x2ae020===_0x3fa3b6||_0x2ae020[_0x4a1b80(0x207)](_0x3fa3b6+'/'))return _0x2ae020;return _0x2ae020?_0x3fa3b6+'/'+_0x2ae020:_0x3fa3b6;}export function addFoldersToCreate(_0x5cea0b,_0x33fe4c,_0xb99772){const _0x124ba3=a142_0x3ef9cf;if(!_0x5cea0b)return;if(_0x33fe4c[_0x124ba3(0x1d5)](_0x5cea0b))return;const _0x4160d3=_0x5cea0b['split']('/');let _0x5f198d='';for(const _0x3b6b7e of _0x4160d3){_0x5f198d=_0x5f198d?_0x5f198d+'/'+_0x3b6b7e:_0x3b6b7e,!_0x33fe4c[_0x124ba3(0x1d5)](_0x5f198d)&&_0xb99772['add'](_0x5f198d);}}export function sortFoldersByDepth(_0x24fb24){return[..._0x24fb24]['sort']((_0x19388f,_0x17c0da)=>{const _0x265a48=a142_0x3bff,_0x21b1f4=(_0x19388f[_0x265a48(0x1ac)](/\//g)||[])['length'],_0x1b2d2e=(_0x17c0da[_0x265a48(0x1ac)](/\//g)||[])[_0x265a48(0x1f4)];return _0x21b1f4-_0x1b2d2e;});}import*as a142_0x4a29a2 from'yaml';import{readFileSync}from'fs';import a142_0x3c5b6d from'path';import{isJourneyDef,parseYamlString as a142_0x4a5f14,toYamlString as a142_0x2c1878,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(_0x371f39){const _0x37d65a=a142_0x3ef9cf;if(Array[_0x37d65a(0x272)](_0x371f39))return'['+_0x371f39[_0x37d65a(0x209)](_0x49f73d=>stableStringify(_0x49f73d))['join'](',')+']';if(_0x371f39&&typeof _0x371f39===_0x37d65a(0x248)){const _0x1feaee=_0x371f39,_0xd6dc49=Object[_0x37d65a(0x294)](_0x1feaee)[_0x37d65a(0x1d0)](),_0x557ae4=_0xd6dc49[_0x37d65a(0x209)](_0x2a7a60=>'\x22'+_0x2a7a60+'\x22:'+stableStringify(_0x1feaee[_0x2a7a60]));return'{'+_0x557ae4['join'](',')+'}';}const _0x567307=JSON[_0x37d65a(0x216)](_0x371f39);return _0x567307===undefined?'null':_0x567307;}function activationSignature(_0x5e9895){const _0x192a49=a142_0x3ef9cf,_0x342d17={'connection':_0x5e9895[_0x192a49(0x1f2)],..._0x5e9895['all_columns']!==undefined&&{'all_columns':_0x5e9895[_0x192a49(0x205)]},..._0x5e9895['columns']!==undefined&&{'columns':_0x5e9895[_0x192a49(0x21e)]},..._0x5e9895['behavior']!==undefined&&{'behavior':_0x5e9895[_0x192a49(0x1d6)]},..._0x5e9895[_0x192a49(0x242)]!==undefined&&{'schedule':_0x5e9895['schedule']},..._0x5e9895['notification']!==undefined&&{'notification':_0x5e9895[_0x192a49(0x1ab)]},..._0x5e9895[_0x192a49(0x280)]!==undefined&&{'connector_config':_0x5e9895[_0x192a49(0x280)]},..._0x5e9895[_0x192a49(0x1f7)]!==undefined&&{'activation_template_id':_0x5e9895[_0x192a49(0x1f7)]}};return stableStringify(_0x342d17);}async function fetchSegment(_0x5f02d9,_0x281f56,_0x59149d,_0x4add08){const _0x43cb94=a142_0x3ef9cf,_0x294b99=_0x4add08?.[_0x43cb94(0x1d9)](_0x31a52f=>_0x31a52f['id']===_0x59149d);if(_0x294b99)return _0x294b99;try{return await _0x5f02d9[_0x43cb94(0x1c7)]['getSegment'](_0x281f56,_0x59149d);}catch(_0xd8d4ea){logger[_0x43cb94(0x270)]('getSegment\x20failed\x20for\x20'+_0x59149d+_0x43cb94(0x241)+_0xd8d4ea);try{return await _0x5f02d9[_0x43cb94(0x1c7)][_0x43cb94(0x224)](_0x59149d);}catch(_0x1261ae){return logger[_0x43cb94(0x270)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x59149d+':\x20'+_0x1261ae),null;}}}function recoverSegmentIdsFromPushRecovery(_0x399c6d,_0x39e025,_0xc1ef12){const _0x2bb764=a142_0x3ef9cf,_0x4aa918=readPushRecovery(_0x399c6d[_0x2bb764(0x27a)]);if(_0x4aa918?.[_0x2bb764(0x1b3)]===_0x399c6d[_0x2bb764(0x24a)][_0x2bb764(0x26e)])for(const [_0x14e49f,_0x3762ad]of Object['entries'](_0x4aa918[_0x2bb764(0x25b)])){const _0x2f63d0=generateDeterministicJourneySegmentName(_0x399c6d[_0x2bb764(0x24a)]['name'],_0x14e49f);_0x3762ad[_0x2bb764(0x1ec)]===_0x2f63d0&&(_0x39e025[_0x2bb764(0x21b)](_0x14e49f,_0x3762ad[_0x2bb764(0x221)]),_0xc1ef12[_0x2bb764(0x21b)](_0x14e49f,_0x3762ad[_0x2bb764(0x221)]));}}async function createOrRecoverEmbeddedSegment(_0x29a66a,_0x20ac3d,_0x8efa6,_0x236fbc){const _0x45040a=a142_0x3ef9cf;let _0x5019c5;try{_0x5019c5=await _0x29a66a[_0x45040a(0x1c7)][_0x45040a(0x293)]({'name':_0x8efa6['uniqueSegmentName'],'description':_0x8efa6[_0x45040a(0x23e)],'journeyId':_0x8efa6[_0x45040a(0x215)],'rule':_0x236fbc(_0x8efa6[_0x45040a(0x1e6)],!![]),'countPopulation':!![],'parentFolderId':_0x8efa6[_0x45040a(0x25e)],'audienceId':_0x8efa6[_0x45040a(0x23b)]});}catch(_0x46e390){const _0x29a3ee=_0x46e390 instanceof Error&&_0x46e390[_0x45040a(0x1da)][_0x45040a(0x1e2)](_0x45040a(0x1ea));if(_0x29a3ee){const _0x2a6c2d=readPushRecovery(_0x20ac3d['absolutePath']),_0x40620b=_0x2a6c2d?.[_0x45040a(0x1b3)]===_0x20ac3d[_0x45040a(0x24a)][_0x45040a(0x26e)]?_0x2a6c2d[_0x45040a(0x25b)][_0x8efa6[_0x45040a(0x267)]]:undefined;if(_0x40620b?.[_0x45040a(0x1ec)]===_0x8efa6['uniqueSegmentName'])await _0x29a66a['segment']['updateSegmentById'](_0x8efa6[_0x45040a(0x23b)],_0x40620b[_0x45040a(0x221)],{'description':_0x8efa6[_0x45040a(0x23e)],'rule':_0x236fbc(_0x8efa6[_0x45040a(0x1e6)],!![]),'countPopulation':!![]}),_0x5019c5=_0x40620b[_0x45040a(0x221)];else throw new SDKError(ErrorCode[_0x45040a(0x299)],_0x45040a(0x29c)+_0x8efa6['localName']+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x45040a(0x1d1)+_0x20ac3d[_0x45040a(0x27a)][_0x45040a(0x275)](/([^/]+)$/,_0x45040a(0x25a))+')\x20')+_0x45040a(0x253),_0x46e390);}else throw _0x46e390;}return saveSegmentToPushRecovery(_0x20ac3d[_0x45040a(0x27a)],_0x20ac3d[_0x45040a(0x24a)][_0x45040a(0x26e)],_0x8efa6[_0x45040a(0x267)],{'segmentId':_0x5019c5,'uniqueServerName':_0x8efa6[_0x45040a(0x24c)],'createdAt':new Date()['toISOString']()}),_0x5019c5;}export async function prepareSegmentFiles(_0x40cf55,_0x15a4e8,_0x1e2548,_0x575919,_0x50d19f){const _0x31b50b=a142_0x3ef9cf,{activationDefToCreateRequest:_0x124188}=await import(_0x31b50b(0x201)),_0x5b4b14=[],_0x2b7fe9=new Set();for(const {yamlConfig:_0x4938c4,folderPath:_0x333b85,sourcePath:_0x178f2f}of _0x40cf55){const _0x9d79e3=resolveTDFolderPath(_0x333b85,_0x575919,_0x50d19f),_0x31571f=_0x9d79e3+':'+_0x4938c4[_0x31b50b(0x26e)],_0x671ca3=_0x15a4e8['segmentByFolderAndName']['get'](_0x31571f),_0x2f516c=_0x671ca3?_0x15a4e8[_0x31b50b(0x238)]['get'](_0x671ca3['id'])||[]:[];addFoldersToCreate(_0x9d79e3,_0x15a4e8[_0x31b50b(0x27f)],_0x2b7fe9);const _0x49fe0f=calculateActivationActions(_0x4938c4['activations']||[],_0x2f516c,_0x15a4e8[_0x31b50b(0x298)],_0x15a4e8['connectionIdToNameMap']);for(const _0x18d803 of _0x49fe0f){(_0x18d803[_0x31b50b(0x21a)]==='create'||_0x18d803['type']===_0x31b50b(0x26c))&&_0x18d803[_0x31b50b(0x24d)]&&(_0x18d803[_0x31b50b(0x22f)]=await _0x124188(_0x18d803['yamlActivation'],_0x1e2548));}const _0x29191c=calculateSegmentDiff(_0x4938c4,_0x671ca3,_0x2f516c,_0x15a4e8['idToEmailMap'],_0x15a4e8['connectionIdToNameMap']);_0x5b4b14[_0x31b50b(0x1a4)]({'relativePath':_0x4938c4[_0x31b50b(0x26e)],'absolutePath':_0x178f2f,'yamlConfig':_0x4938c4,'folderPath':_0x9d79e3,'existingSegment':_0x671ca3,'existingActivations':_0x2f516c,'isNew':_0x29191c[_0x31b50b(0x279)],'hasChanges':_0x29191c[_0x31b50b(0x1e3)],'diff':_0x29191c['diff'],'activationActions':_0x49fe0f});}return{'segmentFiles':_0x5b4b14,'foldersToCreate':_0x2b7fe9};}export async function prepareJourneyFiles(_0x3ef1b1,_0x41d667,_0x5266c3,_0x508b38){const _0x50358b=a142_0x3ef9cf,_0x36bd0c=[],_0x3574f0=new Set();for(const {yamlConfig:_0x5e05d6,folderPath:_0x21209e,sourcePath:_0x241ff7}of _0x3ef1b1){const _0x21356=resolveTDFolderPath(_0x21209e,_0x5266c3,_0x508b38),_0x3c6268=_0x21356+':'+_0x5e05d6[_0x50358b(0x26e)],_0x3c8b8c=_0x41d667[_0x50358b(0x1b7)]['get'](_0x3c6268);let _0x1aff22,_0x206d6c;if(_0x3c8b8c&&_0x3c8b8c[_0x50358b(0x1f4)]>0x0){const _0x4a1d8d=buildLocalExpandedRuleMappings(_0x5e05d6),{createYamlContext:_0x508a22,prefetchJourneySegments:_0x4cfc70}=createPushYamlContextForBundle(_0x41d667[_0x50358b(0x240)],_0x41d667[_0x50358b(0x23b)],_0x41d667[_0x50358b(0x222)],_0x4a1d8d,_0x41d667[_0x50358b(0x298)],_0x41d667['connectionIdToNameMap'],_0x41d667['activationStepsById'],_0x41d667[_0x50358b(0x1ed)]);await _0x4cfc70(_0x3c8b8c[_0x50358b(0x209)](_0x3c2555=>_0x3c2555['id']));const _0x3c34b8=await _0x41d667[_0x50358b(0x240)]['journey'][_0x50358b(0x265)](_0x3c8b8c[0x0][_0x50358b(0x23c)]),_0x48fac3=hasMultipleVersions(_0x5e05d6),_0x123aa0=async _0x3007eb=>{const _0x3ae20c=_0x50358b,_0x18a564=_0x41d667['journeyById']?.['get'](_0x3007eb);if(_0x18a564)return _0x18a564;return _0x41d667[_0x3ae20c(0x26d)]({'journeyId':_0x3007eb,'journeyName':_0x5e05d6[_0x3ae20c(0x26e)],'isMultiVersion':_0x3c8b8c['length']>0x1});};if(_0x48fac3&&_0x3c8b8c['length']>0x1){const _0x39a913=[];for(const _0x57c1d2 of _0x3c8b8c){const _0x39e3c2=_0x57c1d2[_0x50358b(0x210)]||0x1;_0x41d667['progress']?.[_0x50358b(0x26c)](_0x50358b(0x202)+_0x5e05d6[_0x50358b(0x26e)]+'\x20v'+_0x39e3c2);const _0x2e0246=await _0x123aa0(_0x57c1d2['id']),_0x26dbc6=_0x508a22(_0x57c1d2['id']),_0x17a79b=await journeyResponseToDef(_0x2e0246,_0x26dbc6);_0x39a913[_0x50358b(0x1a4)]({'item':_0x57c1d2,'yaml':_0x17a79b});}const _0x17be42=buildLocalRuleToNameMappingFromJourney(_0x5e05d6);_0x206d6c=buildMergedJourneyDef(_0x39a913,_0x17be42,_0x3c34b8);const _0xdacdfa=Math[_0x50358b(0x285)](..._0x39a913[_0x50358b(0x209)](_0x8c33fe=>_0x8c33fe[_0x50358b(0x251)][_0x50358b(0x210)]||0x0)),_0x39eb01=_0x3c8b8c[_0x50358b(0x1d9)](_0x1ef212=>(_0x1ef212['versionNumber']||0x0)===_0xdacdfa);_0x39eb01&&(_0x41d667[_0x50358b(0x1e1)]?.[_0x50358b(0x26c)]('Fetching\x20'+_0x5e05d6['name']+'\x20v'+_0xdacdfa),_0x1aff22=await _0x123aa0(_0x39eb01['id']));}else{const _0x4273fc=_0x3c8b8c[_0x3c8b8c[_0x50358b(0x1f4)]-0x1];_0x41d667['progress']?.['update'](_0x50358b(0x202)+_0x5e05d6[_0x50358b(0x26e)]),_0x1aff22=await _0x123aa0(_0x4273fc['id']);const _0x7ad1e9=_0x508a22(_0x4273fc['id']),_0x5ae31a=await journeyResponseToDef(_0x1aff22,_0x7ad1e9),_0x40c906=buildLocalRuleToNameMappingFromJourney(_0x5e05d6);_0x206d6c=buildMergedJourneyDef([{'item':_0x4273fc,'yaml':_0x5ae31a}],_0x40c906,_0x3c34b8);}}addFoldersToCreate(_0x21356,_0x41d667[_0x50358b(0x27f)],_0x3574f0);const _0x3f8a02=calculateJourneyDiff(_0x5e05d6,_0x206d6c);_0x36bd0c[_0x50358b(0x1a4)]({'relativePath':_0x5e05d6[_0x50358b(0x26e)],'absolutePath':_0x241ff7,'yamlConfig':_0x5e05d6,'folderPath':_0x21356,'existingJourney':_0x1aff22,'isNew':_0x3f8a02[_0x50358b(0x279)],'hasChanges':_0x3f8a02[_0x50358b(0x1e3)],'diff':_0x3f8a02[_0x50358b(0x1d2)]});}return{'journeyFiles':_0x36bd0c,'foldersToCreate':_0x3574f0};}export function calculateActivationActions(_0x47b983,_0x41372e,_0x31ea45,_0x12efa7){const _0x1edf35=a142_0x3ef9cf,_0x593d76=[],_0x223aa3=new Map();for(const _0xb9bb6e of _0x41372e){_0x223aa3[_0x1edf35(0x21b)](_0xb9bb6e[_0x1edf35(0x26e)],_0xb9bb6e);}const _0x9259f=new Map();for(const _0x1fbbaa of _0x47b983){_0x9259f['set'](_0x1fbbaa[_0x1edf35(0x26e)],_0x1fbbaa);}for(const _0x56855c of _0x47b983){const _0x1637b0=_0x223aa3['get'](_0x56855c[_0x1edf35(0x26e)]);if(!_0x1637b0)_0x593d76[_0x1edf35(0x1a4)]({'type':'create','name':_0x56855c[_0x1edf35(0x26e)],'yamlActivation':_0x56855c});else{const _0x27c091=activationResponseToDef(_0x1637b0,_0x31ea45,_0x12efa7),_0x2163bc=a142_0x4a29a2[_0x1edf35(0x216)](_0x27c091),_0xa2751=a142_0x4a29a2[_0x1edf35(0x216)](_0x56855c);_0x2163bc!==_0xa2751&&_0x593d76[_0x1edf35(0x1a4)]({'type':_0x1edf35(0x26c),'name':_0x56855c[_0x1edf35(0x26e)],'yamlActivation':_0x56855c,'existingActivation':_0x1637b0});}}for(const _0x166d73 of _0x41372e){!_0x9259f[_0x1edf35(0x1d5)](_0x166d73[_0x1edf35(0x26e)])&&_0x593d76[_0x1edf35(0x1a4)]({'type':_0x1edf35(0x1f9),'name':_0x166d73['name'],'existingActivation':_0x166d73});}return _0x593d76;}function calculateYamlDiff(_0x1a0237,_0x110a8e){if(_0x110a8e){const _0x5872f6=generateDiff(_0x110a8e,_0x1a0237),_0x2cf5cd=hasChanges(_0x5872f6);return{'isNew':![],'hasChanges':_0x2cf5cd,'diff':_0x2cf5cd?formatDiffWithColors(_0x5872f6):undefined};}const _0x220fa5=generateDiff('',_0x1a0237);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x220fa5)};}export function calculateSegmentDiff(_0x396c56,_0x36c1d0,_0x531544,_0xa64b62,_0x575cf7){const _0x3e11d1=segmentToYamlString(_0x396c56),_0x4f57d8=_0x36c1d0?segmentToYamlString(segmentWithActivationsToYaml(_0x36c1d0,_0x531544,undefined,_0xa64b62,_0x575cf7)):undefined;return calculateYamlDiff(_0x3e11d1,_0x4f57d8);}export function calculateJourneyDiff(_0x2614f1,_0x5cf900){const _0x389595=normalizeJourneyDef(_0x2614f1,_0x2614f1),_0x4cee39=a142_0x2c1878(_0x389595),_0x35ef69=_0x5cf900?a142_0x2c1878(normalizeJourneyDef(_0x5cf900,_0x2614f1)):undefined;return calculateYamlDiff(_0x4cee39,_0x35ef69);}function a142_0x570e(){const _0x27af4e=['debug','join','isArray','segment_updated','deleteSegment','replace','WaitStep','12jXipVF','dirname','isNew','absolutePath','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','results','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','\x20error(s)','folderPathToId','connector_config','journey_created','conditions','folder_created','folder','max','list','draft','parentSegmentFolder','activation_deleted','\x20activation\x20\x27','create','digest','activationContext','entry_criteria','listActivations','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Creating\x20folder\x20\x27','journey','createJourneySegment','keys','Creating\x20segment\x20\x27','__pending_','run_after_journey_refresh','idToEmailMap','SEGMENT_UPDATE_ERROR','conditionSegmentId','createActivation','Embedded\x20segment\x20\x27','activation_','filter','createdSegmentId','tdx.sdk.push-workflow','activation_creating','rule','rootFolderId','activations','):\x20','journeys','waitStepUnit','push','\x20(referenced\x20in\x20journey\x20','steps','deleteActivation','journey_updating','\x27...','connectionIdToNameMap','notification','match','exitCriterias','embedded_activation_creating','Updating\x20segment\x20\x27','Updating\x20activation\x20\x27','JOURNEY_UPDATE_ERROR','reduce','journeyName','activationActions','updated','activation_updating','journeyBundlesByFolderAndName','journeyBundleName','existingSegment','folderPath','parseDocument','activation_created','toString','embedded_activation_created','journeyActivationNameToId','Created\x20journey\x20\x27','getActivation','conditionTimeoutUnit','journey_updated','Activation\x20not\x20found:\x20','unchanged','with','segment','Stage\x20\x27','logDeleted','state','createSegment','existingActivation','activation_deleting','split','297660BTEkDB','sort','Delete\x20the\x20push\x20recovery\x20file\x20(','diff','6427540burXJe','segmentFolderId','has','behavior','values','buildUserMaps','find','message','valid','parse','Updated\x20segment\x20\x27','2005645bFjLBR','relative','1854340ZnUHWD','progress','includes','hasChanges','hex','embedded_segment_created','resolvedRule','created','getJourney','Activation','Name\x20has\x20already\x20been\x20taken','15393HeUaDj','uniqueServerName','journeyById','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x27\x20not\x20found\x20in\x20journey\x20\x27','createFolder','existingJourney','connection','logSuccess','length','Entry\x20criteria:\x20','relationships','activation_template_id','Failed\x20to\x20resolve\x20activation\x20','delete','Deleted\x20activation\x20\x27','index','segmentNameToId','stages','attributes','\x20journey\x20from\x20file:\x20','updateSegmentById','./child-segment-yaml.js','Fetching\x20','SEGMENT_NOT_FOUND','Created\x20activation\x20\x27','all_columns','\x27\x20for\x20','startsWith','day','map','Updated\x20journey\x20\x27','Segment\x20not\x20found:\x20','stage\x20\x27','journeyActivationStepId','entryCriteria','all','versionNumber','conditionTimeoutDuration','slice','toISOString','ACTIVATION_UPDATE_ERROR','journeyId','stringify','errors','add','Deleted\x20segment\x20\x27','type','set','\x27\x20decision\x20point\x20branch\x20\x27','104018rRkkOi','columns','journeyStages','SEGMENT_SYNTAX_ERROR','segmentId','existingSegments','./journey-yaml.js','getSegmentEntity','\x0a\x20\x20','utf-8','size','onProgress','resolveSegment','deleted','__pending_act_','6fISXEG','../../utils/async.js','waitStep','validatedRequest','Failed\x20to\x20','nameToType','3177765rfyDtB','376ELBQgR','verbose','withProgress','milestone','Created\x20segment\x20\x27','activationsBySegmentId','get','nameToId','parentId','journeyBundleId','Journey\x20\x27','description','INTERNAL','deps',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','schedule','some','ACTIVATION_SYNTAX_ERROR','branches','from','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','object','createdSegmentIds','yamlConfig','toLowerCase','uniqueSegmentName','yamlActivation','entry','\x27\x20exit\x20criteria','activation_updated','item','Creating\x20activation\x20\x27','and\x20the\x20server\x20segment,\x20then\x20retry.','segment_created','action','\x27\x20from\x20file:\x20',').\x20','JOURNEY_SYNTAX_ERROR','Updated\x20activation\x20\x27','.$1.push-recovery.json','segments','Failed\x20to\x20resolve\x20segment\x20','updateActivation','folderId','activationParams','NOT_FOUND','data','waitStepType','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','\x27\x20wait\x20condition','getLatestJourneyId','trim','localName','flatMap','goal','embeddedSegmentNameToId','DecisionPoint','update','fetchJourney','name','\x20segment\x20from\x20file:\x20'];a142_0x570e=function(){return _0x27af4e;};return a142_0x570e();}export function findSegmentsToDelete(_0x33a1f5,_0x1388c2,_0x437af8,_0x4de174,_0x2b1e51){const _0x1e25e2=a142_0x3ef9cf,_0x2ff9c5=new Set();for(const {yamlConfig:_0x455b29,folderPath:_0x47a75e}of _0x1388c2){_0x2ff9c5['add'](_0x47a75e+':'+_0x455b29[_0x1e25e2(0x26e)]);}return _0x33a1f5[_0x1e25e2(0x29e)](_0x4590ed=>{const _0x48090f=_0x1e25e2,_0x52e94b=_0x4590ed['segmentFolderId']?_0x437af8['get'](_0x4590ed[_0x48090f(0x1d4)]['toString']())||'':'',_0x39f2f5=_0x52e94b+':'+_0x4590ed[_0x48090f(0x26e)];if(_0x2ff9c5[_0x48090f(0x1d5)](_0x39f2f5))return![];if(_0x2b1e51)return _0x52e94b===_0x4de174||_0x52e94b[_0x48090f(0x207)](_0x4de174+'/');return!![];});}export function findJourneysToDelete(_0xd2c845,_0x4172b8,_0x12bd70,_0x381b63,_0x210c70){const _0x4c0f02=a142_0x3ef9cf,_0x4ff9aa=new Set();for(const {yamlConfig:_0x5aab86,folderPath:_0x5a0fe6}of _0x4172b8){_0x4ff9aa[_0x4c0f02(0x218)](_0x5a0fe6+':'+_0x5aab86[_0x4c0f02(0x26e)]);}return _0xd2c845[_0x4c0f02(0x29e)](_0x7c25e2=>{const _0x1600d3=_0x4c0f02,_0x3fd7fe=_0x7c25e2['folderId']?_0x12bd70[_0x1600d3(0x239)](_0x7c25e2[_0x1600d3(0x25e)])||'':'',_0x5b70e9=_0x3fd7fe+':'+_0x7c25e2[_0x1600d3(0x1b8)];if(_0x4ff9aa[_0x1600d3(0x1d5)](_0x5b70e9))return![];if(_0x210c70)return _0x3fd7fe===_0x381b63||_0x3fd7fe[_0x1600d3(0x207)](_0x381b63+'/');return!![];});}export function buildSegmentLookupMap(_0x238649,_0x317c0c){const _0x549f85=a142_0x3ef9cf,_0x4cbd45=new Map();for(const _0x7bd865 of _0x238649){const _0x3eeeb4=_0x7bd865[_0x549f85(0x1d4)]?_0x317c0c[_0x549f85(0x239)](_0x7bd865[_0x549f85(0x1d4)][_0x549f85(0x1bd)]())||'':'',_0x1cd77e=_0x3eeeb4+':'+_0x7bd865[_0x549f85(0x26e)];_0x4cbd45[_0x549f85(0x21b)](_0x1cd77e,_0x7bd865);}return _0x4cbd45;}function a142_0x3bff(_0x1b776c,_0x143ee8){_0x1b776c=_0x1b776c-0x1a4;const _0x570e97=a142_0x570e();let _0x3bff15=_0x570e97[_0x1b776c];return _0x3bff15;}export function buildSegmentNameToIdMap(_0x139b51){const _0x4b1f62=a142_0x3ef9cf,_0x3f8afe=new Map();for(const _0x5319db of _0x139b51){_0x3f8afe[_0x4b1f62(0x21b)](_0x5319db[_0x4b1f62(0x26e)],_0x5319db['id']);}return _0x3f8afe;}export function buildJourneyBundleLookupMap(_0x178ddf,_0x53fda8){const _0x7bf2af=a142_0x3ef9cf,_0x10cfa1=new Map();for(const _0x2e2e4a of _0x178ddf){const _0x51b74e=_0x2e2e4a['folderId']?_0x53fda8['get'](_0x2e2e4a[_0x7bf2af(0x25e)])||'':'',_0x53fc05=_0x51b74e+':'+_0x2e2e4a[_0x7bf2af(0x1b8)];!_0x10cfa1[_0x7bf2af(0x1d5)](_0x53fc05)&&_0x10cfa1[_0x7bf2af(0x21b)](_0x53fc05,[]),_0x10cfa1[_0x7bf2af(0x239)](_0x53fc05)[_0x7bf2af(0x1a4)](_0x2e2e4a);}for(const _0x44857d of _0x10cfa1[_0x7bf2af(0x1d7)]()){_0x44857d[_0x7bf2af(0x1d0)]((_0x5e8e73,_0x31368e)=>(_0x5e8e73['versionNumber']||0x0)-(_0x31368e[_0x7bf2af(0x210)]||0x0));}return _0x10cfa1;}export function collectFoldersToCreate(_0x4521c7,_0x2fb469){const _0x574c94=a142_0x3ef9cf,_0x3508d5=new Set();for(const _0x80ffd4 of _0x4521c7){if(!_0x80ffd4)continue;if(_0x2fb469[_0x574c94(0x1d5)](_0x80ffd4))continue;const _0x3a6972=_0x80ffd4[_0x574c94(0x1ce)]('/');let _0x1709f6='';for(const _0x18e14d of _0x3a6972){_0x1709f6=_0x1709f6?_0x1709f6+'/'+_0x18e14d:_0x18e14d,!_0x2fb469[_0x574c94(0x1d5)](_0x1709f6)&&_0x3508d5[_0x574c94(0x218)](_0x1709f6);}}return _0x3508d5;}export function parseAndClassifyYamlFiles(_0x1702e6,_0x5a63a1,_0x332427){const _0x9c5754=a142_0x3ef9cf,_0x184e1f=[],_0x41c5bc=[];for(const _0x453e67 of _0x1702e6){const _0x576c68=a142_0x3c5b6d['relative'](_0x5a63a1,a142_0x3c5b6d[_0x9c5754(0x278)](_0x453e67)),_0x4b3159=_0x576c68==='.'?'':_0x576c68,_0xb06802=readFileSync(_0x453e67,'utf-8'),_0x32831d=a142_0x4a29a2[_0x9c5754(0x1dc)](_0xb06802);if(isJourneyDef(_0x32831d)){const _0x5f4f5b=a142_0x4a5f14(_0xb06802);_0x41c5bc['push']({'yamlConfig':_0x5f4f5b,'folderPath':_0x4b3159,'sourcePath':_0x453e67});}else{if(!_0x332427?.['skipSegments']){const _0x42622b=parseSegmentYamlFile(_0xb06802),_0x4297a2=normalizeChildSegmentYaml(_0x42622b);_0x184e1f[_0x9c5754(0x1a4)]({'yamlConfig':_0x4297a2,'folderPath':_0x4b3159,'sourcePath':_0x453e67});}}}return{'segments':_0x184e1f,'journeys':_0x41c5bc};}export function validateParsedFiles(_0x374afe,_0x376e3c){const _0x8c0e09=a142_0x3ef9cf,_0x2cd0ce=[];for(const {yamlConfig:_0x173472,sourcePath:_0x3f6d29}of _0x374afe[_0x8c0e09(0x25b)]){const _0x14c1d2=readFileSync(_0x3f6d29,_0x8c0e09(0x226)),_0x1c6d34=a142_0x4a29a2[_0x8c0e09(0x1bb)](_0x14c1d2),_0x5971d1=validateSegmentDef(_0x173472,{'source':_0x14c1d2,'document':_0x1c6d34},{'skipSchema':!![]});if(!_0x5971d1['valid']){const _0x46a348=a142_0x3c5b6d['relative'](_0x376e3c,_0x3f6d29);_0x2cd0ce['push']({'filePath':_0x46a348,'source':_0x14c1d2,'result':_0x5971d1,'isJourney':![]});}}for(const {yamlConfig:_0x18c92d,sourcePath:_0x3044c2}of _0x374afe[_0x8c0e09(0x2a6)]){const _0x5c6992=readFileSync(_0x3044c2,_0x8c0e09(0x226)),_0x37cb9b=a142_0x4a29a2[_0x8c0e09(0x1bb)](_0x5c6992),_0x466d62=validateJourneyDef(_0x18c92d,{'source':_0x5c6992,'document':_0x37cb9b},{'skipSchema':!![]});if(!_0x466d62[_0x8c0e09(0x1db)]){const _0x2fc8f3=a142_0x3c5b6d[_0x8c0e09(0x1df)](_0x376e3c,_0x3044c2);_0x2cd0ce[_0x8c0e09(0x1a4)]({'filePath':_0x2fc8f3,'source':_0x5c6992,'result':_0x466d62,'isJourney':!![]});}}return _0x2cd0ce;}export function formatValidationErrors(_0x5f2adb){const _0x214c8b=a142_0x3ef9cf,_0x2d3502=[];for(const {filePath:_0xf13c3c,source:_0x3c5e84,result:_0x489ee9,isJourney:_0x35c890}of _0x5f2adb){const _0xb3267d=_0x35c890?_0x214c8b(0x292):_0x214c8b(0x1c7);_0x2d3502[_0x214c8b(0x1a4)]('\x0a'+_0xf13c3c+'\x20('+_0xb3267d+_0x214c8b(0x2a5)+_0x489ee9[_0x214c8b(0x217)]['length']+_0x214c8b(0x27e)),_0x2d3502[_0x214c8b(0x1a4)](formatValidationResult(_0x489ee9,_0x3c5e84,_0xf13c3c));}return _0x2d3502[_0x214c8b(0x271)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x328e47){const _0x35179b=a142_0x3ef9cf,_0x336371=new Set(),_0x43a277=new Map(),_0x127949=collectSegmentUsageCounts(_0x328e47);if(_0x328e47[_0x35179b(0x25b)])for(const [_0x39b242,_0x2ebb1f]of Object['entries'](_0x328e47[_0x35179b(0x25b)])){_0x336371[_0x35179b(0x218)](_0x39b242);if(_0x2ebb1f[_0x35179b(0x2a2)]){const _0x46fca0=yamlRuleToApi(_0x2ebb1f[_0x35179b(0x2a2)]),_0x10a7f6=apiRuleToYaml(_0x46fca0);_0x43a277[_0x35179b(0x21b)](_0x39b242,_0x10a7f6);}}const _0x36cd2c=new Map();let _0x580575=0x0;for(const [_0x420f23,_0xccab7f]of _0x43a277){const _0x66a5f9=serializeExpandedRule(_0xccab7f,_0x43a277),_0x3246bf=_0x36cd2c[_0x35179b(0x239)](_0x66a5f9)||[];_0x3246bf['push']({'name':_0x420f23,'index':_0x580575}),_0x36cd2c['set'](_0x66a5f9,_0x3246bf),_0x580575++;}const _0x566104=new Map();for(const [_0x4c69c4,_0x5b3047]of _0x36cd2c){const _0x990c0f=_0x5b3047[_0x35179b(0x212)]()[_0x35179b(0x1d0)]((_0x14770a,_0x5b4461)=>{const _0x342ce7=_0x35179b,_0x126e0a=_0x127949['get'](_0x14770a[_0x342ce7(0x26e)])||0x0,_0x3febcb=_0x127949['get'](_0x5b4461[_0x342ce7(0x26e)])||0x0;if(_0x126e0a!==_0x3febcb)return _0x3febcb-_0x126e0a;return _0x14770a[_0x342ce7(0x1fb)]-_0x5b4461[_0x342ce7(0x1fb)];})['map'](_0x495280=>_0x495280[_0x35179b(0x26e)]),_0x33d07d=[];for(const _0x1e79e8 of _0x990c0f){const _0x4f96b8=_0x127949['get'](_0x1e79e8)||0x0,_0xcebba8=Math[_0x35179b(0x285)](_0x4f96b8,0x1);for(let _0x3884f2=0x0;_0x3884f2<_0xcebba8;_0x3884f2++){_0x33d07d[_0x35179b(0x1a4)](_0x1e79e8);}}_0x566104[_0x35179b(0x21b)](_0x4c69c4,_0x33d07d);}return{'existingLocalSegmentNames':_0x336371,'localSegmentRules':_0x43a277,'localExpandedRuleToNames':_0x566104};}export function createSegmentIdResolver(_0x36bd57,_0x4f4fb9){return async _0x398b42=>{const _0x4e8806=a142_0x3bff,_0x2f10d4=_0x36bd57[_0x4e8806(0x239)](_0x398b42);if(!_0x2f10d4)throw new SDKError(ErrorCode[_0x4e8806(0x203)],_0x4e8806(0x20b)+_0x398b42+_0x4e8806(0x27b)+_0x4f4fb9+'\x27)');return _0x2f10d4;};}export function extractRootFolderId(_0x1d1451){const _0x2a2679=a142_0x3ef9cf;return _0x1d1451[_0x2a2679(0x1f6)]?.[_0x2a2679(0x288)]?.[_0x2a2679(0x261)]?.['id']||_0x1d1451['relationships']?.['parentFolder']?.[_0x2a2679(0x261)]?.['id'];}export function buildConnectionMaps(_0x5290ef){const _0x67a573=a142_0x3ef9cf,_0x5dbbdd=new Map(),_0x20abd8=new Map(),_0x23086f=new Map();for(const _0x4227d4 of _0x5290ef){_0x5dbbdd[_0x67a573(0x21b)](_0x4227d4['name'],parseInt(_0x4227d4['id'],0xa)),_0x20abd8[_0x67a573(0x21b)](_0x4227d4['id'],_0x4227d4[_0x67a573(0x26e)]),_0x23086f[_0x67a573(0x21b)](_0x4227d4[_0x67a573(0x26e)],_0x4227d4['type']);}return{'nameToId':_0x5dbbdd,'idToName':_0x20abd8,'nameToType':_0x23086f};}export function calculatePushStats(_0x14ab0a,_0x2d0425,_0x4a3c3f,_0x58dcfe,_0x218877,_0x3a5860,_0x279ba0){const _0x5b2d58=a142_0x3ef9cf,_0x3a48f9=_0x14ab0a['filter'](_0x53c074=>_0x53c074['isNew']),_0x52cd3f=_0x14ab0a[_0x5b2d58(0x29e)](_0x7bca4f=>!_0x7bca4f[_0x5b2d58(0x279)]&&_0x7bca4f['hasChanges']),_0x3fde8c=_0x14ab0a['filter'](_0x304114=>!_0x304114[_0x5b2d58(0x279)]&&!_0x304114[_0x5b2d58(0x1e3)]),_0x5a39ff=_0x3a5860?_0x58dcfe:[],_0x1327ac=_0x2d0425['filter'](_0x24780e=>_0x24780e[_0x5b2d58(0x279)]),_0x335ab9=_0x2d0425[_0x5b2d58(0x29e)](_0x5d6461=>!_0x5d6461[_0x5b2d58(0x279)]&&_0x5d6461[_0x5b2d58(0x1e3)]),_0xa4de92=_0x2d0425[_0x5b2d58(0x29e)](_0x3ba9b9=>!_0x3ba9b9[_0x5b2d58(0x279)]&&!_0x3ba9b9[_0x5b2d58(0x1e3)]),_0x3228e6=_0x3a5860?_0x218877:[],_0x56776c=_0x14ab0a[_0x5b2d58(0x268)](_0x15ed34=>_0x15ed34['activationActions']),_0x28b94d=_0x56776c['filter'](_0x8fe17f=>_0x8fe17f[_0x5b2d58(0x21a)]==='create'),_0x26de2a=_0x56776c[_0x5b2d58(0x29e)](_0x426b5b=>_0x426b5b[_0x5b2d58(0x21a)]===_0x5b2d58(0x26c)),_0x161501=_0x56776c[_0x5b2d58(0x29e)](_0x44cc3c=>_0x44cc3c['type']===_0x5b2d58(0x1f9)),_0x3002ca=Array[_0x5b2d58(0x246)](_0x4a3c3f)['sort'](),_0x5a4c29=_0x279ba0?![]:_0x3a48f9[_0x5b2d58(0x1f4)]>0x0||_0x52cd3f['length']>0x0||_0x5a39ff[_0x5b2d58(0x1f4)]>0x0,_0x566b35=_0x1327ac[_0x5b2d58(0x1f4)]>0x0||_0x335ab9[_0x5b2d58(0x1f4)]>0x0||_0x3228e6['length']>0x0,_0x51c454=_0x279ba0?![]:_0x56776c['length']>0x0,_0x2f030b=_0x3002ca[_0x5b2d58(0x1f4)]>0x0;return{'segments':{'new':_0x3a48f9,'changed':_0x52cd3f,'unchanged':_0x3fde8c,'toDelete':_0x5a39ff},'journeys':{'new':_0x1327ac,'changed':_0x335ab9,'unchanged':_0xa4de92,'toDelete':_0x3228e6},'activations':{'all':_0x56776c,'toCreate':_0x28b94d,'toUpdate':_0x26de2a,'toDelete':_0x161501},'folders':{'toCreate':_0x3002ca},'counts':{'segments':{'new':_0x3a48f9[_0x5b2d58(0x1f4)],'changed':_0x52cd3f[_0x5b2d58(0x1f4)],'unchanged':_0x3fde8c['length'],'toDelete':_0x5a39ff[_0x5b2d58(0x1f4)]},'journeys':{'new':_0x1327ac[_0x5b2d58(0x1f4)],'changed':_0x335ab9['length'],'unchanged':_0xa4de92[_0x5b2d58(0x1f4)],'toDelete':_0x3228e6['length']},'activations':{'create':_0x28b94d[_0x5b2d58(0x1f4)],'update':_0x26de2a[_0x5b2d58(0x1f4)],'delete':_0x161501['length']},'folders':_0x3002ca[_0x5b2d58(0x1f4)]},'hasChanges':_0x5a4c29||_0x566b35||_0x51c454||_0x2f030b};}export async function buildPushExecutionContext(_0xa56521,_0x1d95bf,_0x29d094,_0x5e43b3,_0x5364bb,_0x1a86e0){const _0xe1b4ce=a142_0x3ef9cf,_0x2bee9a=extractRootFolderId(_0x29d094),{pathToId:_0x337dca,idToPath:_0x4d0c4c}=buildFolderMaps(_0x5364bb),_0x3cde21=buildSegmentNameToIdMap(_0x5e43b3),_0x2066f6=new Map(),{batchAsync:_0x36bb4d}=await import(_0xe1b4ce(0x22d)),[_0x25fc6f,_0x4aaeff]=await Promise[_0xe1b4ce(0x20f)]([_0xa56521['user'][_0xe1b4ce(0x1d8)](),_0xa56521['connection'][_0xe1b4ce(0x286)](),((async()=>{const _0x3f84ad=_0xe1b4ce;!_0x1a86e0&&_0x5e43b3[_0x3f84ad(0x1f4)]>0x0&&await _0x36bb4d(_0x5e43b3,async _0x8cbc31=>{const _0xa8a093=_0x3f84ad,_0x437486=await _0xa56521['segment'][_0xa8a093(0x28f)](_0x1d95bf,_0x8cbc31['id']);_0x2066f6[_0xa8a093(0x21b)](_0x8cbc31['id'],_0x437486);});})())]),{emailToId:_0x4dafc9,idToEmail:_0x162c44}=_0x25fc6f,_0x5de609=buildConnectionMaps(_0x4aaeff);return{'rootFolderId':_0x2bee9a,'folderPathToId':_0x337dca,'folderIdToPath':_0x4d0c4c,'segmentNameToId':_0x3cde21,'activationsBySegmentId':_0x2066f6,'emailToIdMap':_0x4dafc9,'idToEmailMap':_0x162c44,'connectionNameToIdMap':_0x5de609[_0xe1b4ce(0x23a)],'connectionIdToNameMap':_0x5de609['idToName'],'connectionNameToTypeMap':_0x5de609[_0xe1b4ce(0x231)]};}export function createPushYamlContextForBundle(_0x3a9e98,_0x29f84a,_0x387cab,_0x3e8933,_0xa22d7b,_0x32bf2d,_0x107666,_0x2568e4){const {existingLocalSegmentNames:_0x4bbae4,localExpandedRuleToNames:_0x3c6b7f}=_0x3e8933,_0x13de0d=new Set(),_0x327203=new Map(),_0x1cc531=new Map(),_0x565804=new Map(),_0x42312d=createJumpTargetCache(),_0x45cbae=new Map(),_0x4cc3b9=new Map(),_0x270b2e=new Set();let _0x5484d9;const _0x568907=_0x181843=>{const _0x33368c={'resolveSegment':async _0x2b5984=>{const _0x39df6e=a142_0x3bff,_0x5b9db9=_0x565804[_0x39df6e(0x239)](_0x2b5984);if(_0x5b9db9!==undefined)return{'name':_0x5b9db9,'isJourneyLocal':!![]};try{const _0x3bee38=await fetchSegment(_0x3a9e98,_0x29f84a,_0x2b5984,_0x387cab);if(!_0x3bee38)throw new Error('Segment\x20not\x20found');const _0x112aa1=generateJourneyLocalName(_0x3bee38['name']),_0x1d7f9c=_0x3bee38['kind']===SEGMENT_KIND_JOURNEY&&_0x112aa1!==undefined;let _0x1900c5=_0x3bee38[_0x39df6e(0x26e)],_0x1f1590;if(_0x1d7f9c&&_0x3bee38[_0x39df6e(0x2a2)]){const _0x5194e9=apiRuleToYaml(_0x3bee38[_0x39df6e(0x2a2)]);_0x4cc3b9['set'](_0x2b5984,_0x5194e9);const _0x27abb7=async _0x79eaed=>{const _0x3ed4e8=_0x39df6e,_0x49f498=collectSegmentRefsFromRule(_0x79eaed);for(const _0x5f2dc6 of _0x49f498){if(!_0x4cc3b9[_0x3ed4e8(0x1d5)](_0x5f2dc6))try{const _0x3dd3c2=await fetchSegment(_0x3a9e98,_0x29f84a,_0x5f2dc6,_0x387cab);if(_0x3dd3c2?.[_0x3ed4e8(0x2a2)]){const _0x3ef4cf=apiRuleToYaml(_0x3dd3c2[_0x3ed4e8(0x2a2)]);_0x4cc3b9['set'](_0x5f2dc6,_0x3ef4cf),await _0x27abb7(_0x3ef4cf);}}catch(_0x5eded8){logger[_0x3ed4e8(0x270)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x5f2dc6+':\x20'+_0x5eded8);}}};await _0x27abb7(_0x5194e9);const _0x29bbef=serializeExpandedRule(_0x5194e9,_0x4cc3b9),_0x54413c=_0x3c6b7f['get'](_0x29bbef);if(_0x54413c&&_0x54413c['length']>0x0){const _0x21c96e=_0x327203[_0x39df6e(0x239)](_0x29bbef)||0x0,_0x4ff1ea=_0x54413c[_0x21c96e]||_0x54413c[_0x54413c[_0x39df6e(0x1f4)]-0x1];_0x327203[_0x39df6e(0x21b)](_0x29bbef,_0x21c96e+0x1),_0x1900c5=_0x4ff1ea,_0x13de0d[_0x39df6e(0x218)](_0x1900c5),_0x565804[_0x39df6e(0x21b)](_0x2b5984,_0x1900c5);const _0x1fb98b=await resolveRuleSegmentRefs(_0x5194e9,async _0x41dc25=>{const _0x5d603c=_0x39df6e,_0x1c9694=_0x565804['get'](_0x41dc25);if(_0x1c9694)return _0x1c9694;const _0x366d86=await _0x5484d9['resolveSegment'](_0x41dc25);return _0x366d86[_0x5d603c(0x26e)];});_0x1f1590={'description':_0x3bee38[_0x39df6e(0x23e)],'rule':_0x1fb98b};}else{const _0x82a6eb=_0x45cbae[_0x39df6e(0x239)](_0x29bbef);if(_0x82a6eb)_0x1900c5=_0x82a6eb,_0x565804[_0x39df6e(0x21b)](_0x2b5984,_0x1900c5);else{if(_0x112aa1){let _0x283185=_0x112aa1,_0x21bf8b=0x2;while(_0x13de0d[_0x39df6e(0x1d5)](_0x283185)||_0x4bbae4[_0x39df6e(0x1d5)](_0x283185)){_0x283185=_0x112aa1+'_'+_0x21bf8b,_0x21bf8b++;}_0x13de0d[_0x39df6e(0x218)](_0x283185),_0x1900c5=_0x283185;}_0x565804['set'](_0x2b5984,_0x1900c5),_0x45cbae['set'](_0x29bbef,_0x1900c5);const _0x22ec3e=await resolveRuleSegmentRefs(_0x5194e9,async _0x172a59=>{const _0x448abf=_0x39df6e,_0x58b92b=_0x565804[_0x448abf(0x239)](_0x172a59);if(_0x58b92b)return _0x58b92b;const _0x867c25=await _0x5484d9[_0x448abf(0x229)](_0x172a59);return _0x867c25['name'];});_0x1f1590={'description':_0x3bee38[_0x39df6e(0x23e)],'rule':_0x22ec3e};}}}return{'name':_0x1900c5,'isJourneyLocal':_0x1d7f9c,'definition':_0x1f1590};}catch(_0x37062a){return logger['debug'](_0x39df6e(0x25c)+_0x2b5984+':\x20'+_0x37062a),{'name':_0x2b5984,'isJourneyLocal':![]};}},'resolveActivation':async _0x57ab07=>{const _0x257636=a142_0x3bff,_0x59ca3f=_0x1cc531[_0x257636(0x239)](_0x57ab07);if(_0x59ca3f!==undefined)return{'name':_0x59ca3f,'isJourneyLocal':!![]};try{let _0x2d44d0=_0x107666?.[_0x257636(0x239)](_0x57ab07);!_0x2d44d0&&(_0x2d44d0=await _0x3a9e98['journey'][_0x257636(0x1c1)](_0x181843,_0x57ab07));const _0x3c7539=_0x2d44d0['attributes'][_0x257636(0x25f)]['name']||_0x57ab07,_0x2c3129=sanitizeYamlKey(_0x3c7539)||_0x257636(0x29d)+_0x57ab07,_0x235c17=_0x2c3129;_0x1cc531[_0x257636(0x21b)](_0x57ab07,_0x235c17);const _0x30002e=journeyActivationStepToYaml(_0x2d44d0,_0xa22d7b,_0x32bf2d);return{'name':_0x235c17,'isJourneyLocal':!![],'definition':_0x30002e};}catch(_0x53d189){return logger['debug'](_0x257636(0x1f8)+_0x57ab07+':\x20'+_0x53d189),{'name':_0x57ab07,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x34df31,_0x19d8ef)=>resolveJumpTarget(_0x34df31,_0x19d8ef,_0x42312d,async _0x5b0b31=>{const _0x416ae0=a142_0x3bff,_0x1e9cd7=_0x2568e4?.[_0x416ae0(0x239)](_0x5b0b31);if(_0x1e9cd7)return _0x1e9cd7;return _0x3a9e98[_0x416ae0(0x292)][_0x416ae0(0x1e8)](_0x5b0b31);})};return _0x5484d9=_0x33368c,_0x33368c;},_0x2f3876=async _0x347a81=>{const _0x4a186f=a142_0x3bff,{collectSegmentIdsFromJourneyApi:_0x691994}=await import(_0x4a186f(0x223)),{batchAsync:_0x3df0a2}=await import('../../utils/async.js'),_0x499c51=new Set();for(const _0x174f64 of _0x347a81){let _0xa4dddc=_0x2568e4?.['get'](_0x174f64);!_0xa4dddc&&(_0xa4dddc=await _0x3a9e98['journey'][_0x4a186f(0x1e8)](_0x174f64));const _0x18fc1f=_0x691994(_0xa4dddc);for(const _0x1c5d2b of _0x18fc1f){_0x499c51[_0x4a186f(0x218)](_0x1c5d2b);}}let _0x2f39dd=Array[_0x4a186f(0x246)](_0x499c51);while(_0x2f39dd[_0x4a186f(0x1f4)]>0x0){const _0x479fa2=_0x2f39dd[_0x4a186f(0x29e)](_0x40c743=>!_0x270b2e[_0x4a186f(0x1d5)](_0x40c743));if(_0x479fa2[_0x4a186f(0x1f4)]===0x0)break;const _0x553a1e=await _0x3df0a2(_0x479fa2,async _0xcacf25=>{const _0x264aac=_0x4a186f;_0x270b2e[_0x264aac(0x218)](_0xcacf25);const _0x5c05eb=await fetchSegment(_0x3a9e98,_0x29f84a,_0xcacf25,_0x387cab);if(!_0x5c05eb)return null;return{'segmentId':_0xcacf25,'segment':_0x5c05eb};},0xa),_0x4c29bd=new Set();for(const _0x5d2b3f of _0x553a1e){if(!_0x5d2b3f?.[_0x4a186f(0x1c7)]?.[_0x4a186f(0x2a2)])continue;const _0x3e1296=apiRuleToYaml(_0x5d2b3f[_0x4a186f(0x1c7)]['rule']);_0x4cc3b9[_0x4a186f(0x21b)](_0x5d2b3f[_0x4a186f(0x221)],_0x3e1296);const _0x4467bc=collectSegmentRefsFromRule(_0x3e1296);for(const _0x1c00d3 of _0x4467bc){!_0x270b2e['has'](_0x1c00d3)&&_0x4c29bd[_0x4a186f(0x218)](_0x1c00d3);}}_0x2f39dd=Array[_0x4a186f(0x246)](_0x4c29bd);}};return{'createYamlContext':_0x568907,'prefetchJourneySegments':_0x2f3876};}export async function executePushSegments(_0x515cf4,_0x85c758,_0x3178e4,_0x264d2e,_0x3aa130){const _0xeb6e8f=a142_0x3ef9cf,{segmentDefToCreateRequest:_0x5a61e0,segmentDefToUpdateRequest:_0x37b3a8}=await import(_0xeb6e8f(0x201)),_0x4fb077=_0x3178e4[_0xeb6e8f(0x27f)],_0x94706f=0x5,_0xfa4156=async _0x34e0f1=>{const _0x38c83d=_0xeb6e8f,_0x1c3d45=_0x34e0f1[_0x38c83d(0x1ba)]?_0x4fb077['get'](_0x34e0f1[_0x38c83d(0x1ba)]):undefined;let _0x5e0f50;const _0x45559f={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x1edce6=_0x34e0f1[_0x38c83d(0x24a)];if(_0x34e0f1['yamlConfig'][_0x38c83d(0x2a2)]){const _0x5e4513=createSegmentIdResolver(_0x3178e4['segmentNameToId'],_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]),_0x4dabe3=await resolveRuleSegmentIds(_0x34e0f1['yamlConfig'][_0x38c83d(0x2a2)],_0x5e4513);_0x1edce6={..._0x34e0f1['yamlConfig'],'rule':_0x4dabe3};}try{if(_0x34e0f1[_0x38c83d(0x279)]){_0x3aa130[_0x38c83d(0x228)]?.({'type':'segment_creating','name':_0x34e0f1['yamlConfig'][_0x38c83d(0x26e)]});const _0x53edf4=_0x5a61e0(_0x1edce6,_0x1c3d45),_0x3f7a25=await _0x3aa130[_0x38c83d(0x235)](_0x38c83d(0x295)+_0x34e0f1[_0x38c83d(0x24a)]['name']+_0x38c83d(0x1a9),()=>_0x515cf4[_0x38c83d(0x1c7)][_0x38c83d(0x1cb)](_0x264d2e[_0x38c83d(0x23b)],_0x53edf4));_0x5e0f50=_0x3f7a25[_0x38c83d(0x261)]['id'],_0x3178e4['segmentNameToId'][_0x38c83d(0x21b)](_0x34e0f1['yamlConfig']['name'],_0x5e0f50),_0x45559f[_0x38c83d(0x29f)]={'name':_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)],'id':_0x5e0f50},_0x3aa130[_0x38c83d(0x228)]?.({'type':_0x38c83d(0x254),'name':_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)],'segmentId':_0x5e0f50}),_0x3aa130[_0x38c83d(0x1f3)]?.(_0x38c83d(0x237)+_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]+'\x27'),_0x45559f[_0x38c83d(0x1e7)]=0x1;}else{if(_0x34e0f1[_0x38c83d(0x1e3)]){_0x3aa130['onProgress']?.({'type':'segment_updating','name':_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]});const _0xc0bcc=_0x37b3a8(_0x1edce6);_0x1c3d45!==_0x34e0f1[_0x38c83d(0x1b9)]?.[_0x38c83d(0x1d4)]&&(_0xc0bcc[_0x38c83d(0x1d4)]=_0x1c3d45?parseInt(_0x1c3d45,0xa):undefined),await _0x3aa130[_0x38c83d(0x235)](_0x38c83d(0x1af)+_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]+_0x38c83d(0x1a9),()=>_0x515cf4[_0x38c83d(0x1c7)][_0x38c83d(0x200)](_0x264d2e[_0x38c83d(0x23b)],_0x34e0f1[_0x38c83d(0x1b9)]['id'],_0xc0bcc)),_0x5e0f50=_0x34e0f1[_0x38c83d(0x1b9)]['id'],_0x3aa130[_0x38c83d(0x228)]?.({'type':_0x38c83d(0x273),'name':_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]}),_0x3aa130['logSuccess']?.(_0x38c83d(0x1dd)+_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]+'\x27'),_0x45559f[_0x38c83d(0x1b5)]=0x1;}else _0x5e0f50=_0x34e0f1[_0x38c83d(0x1b9)]['id'];}}catch(_0x13fc7a){const _0x25479d=isHttp400Error(_0x13fc7a),_0x223b43=_0x25479d?ErrorCode[_0x38c83d(0x220)]:ErrorCode[_0x38c83d(0x299)],_0x86cb0b=getErrorMessage(_0x13fc7a);throw new SDKError(_0x223b43,_0x38c83d(0x230)+(_0x34e0f1['isNew']?_0x38c83d(0x28b):_0x38c83d(0x26c))+_0x38c83d(0x26f)+_0x34e0f1[_0x38c83d(0x27a)]+_0x38c83d(0x225)+_0x86cb0b,_0x13fc7a);}try{const _0x38767a=await syncActivationsForSegment(_0x515cf4,_0x264d2e[_0x38c83d(0x23b)],_0x5e0f50,_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)],_0x34e0f1[_0x38c83d(0x1b4)],_0x3aa130,_0x34e0f1['absolutePath']);_0x45559f[_0x38c83d(0x2a4)]=_0x38767a;}catch(_0x453449){if(_0x453449 instanceof SDKError)throw _0x453449;throw new SDKError(ErrorCode[_0x38c83d(0x214)],_0x38c83d(0x290)+_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]+_0x38c83d(0x256)+_0x34e0f1[_0x38c83d(0x27a)]+_0x38c83d(0x225)+getErrorMessage(_0x453449),_0x453449);}return _0x45559f;},_0x101e57=await batchAsync(_0x85c758,_0xfa4156,_0x94706f),_0x282c8d={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5c20dc of _0x101e57){_0x282c8d['created']+=_0x5c20dc[_0xeb6e8f(0x1e7)],_0x282c8d[_0xeb6e8f(0x1b5)]+=_0x5c20dc[_0xeb6e8f(0x1b5)],_0x5c20dc[_0xeb6e8f(0x29f)]&&_0x282c8d[_0xeb6e8f(0x249)][_0xeb6e8f(0x21b)](_0x5c20dc['createdSegmentId'][_0xeb6e8f(0x26e)],_0x5c20dc[_0xeb6e8f(0x29f)]['id']),_0x282c8d[_0xeb6e8f(0x2a4)][_0xeb6e8f(0x1e7)]+=_0x5c20dc[_0xeb6e8f(0x2a4)][_0xeb6e8f(0x1e7)],_0x282c8d['activations'][_0xeb6e8f(0x1b5)]+=_0x5c20dc[_0xeb6e8f(0x2a4)]['updated'],_0x282c8d['activations'][_0xeb6e8f(0x22a)]+=_0x5c20dc[_0xeb6e8f(0x2a4)][_0xeb6e8f(0x22a)];}return _0x282c8d;}async function syncActivationsForSegment(_0x5d3f3d,_0x19e6eb,_0x3f6b7b,_0xa4f5bd,_0x59d10d,_0x10e1d9,_0x3ceb17){const _0x259b75=a142_0x3ef9cf,_0x29be11={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x361c6a of _0x59d10d){try{if(_0x361c6a[_0x259b75(0x21a)]===_0x259b75(0x28b)&&_0x361c6a[_0x259b75(0x22f)])_0x10e1d9[_0x259b75(0x228)]?.({'type':_0x259b75(0x2a1),'segmentName':_0xa4f5bd,'activationName':_0x361c6a['name']}),await _0x10e1d9[_0x259b75(0x235)](_0x259b75(0x252)+_0x361c6a[_0x259b75(0x26e)]+_0x259b75(0x1a9),()=>_0x5d3f3d['segment']['createActivation'](_0x19e6eb,_0x3f6b7b,_0x361c6a[_0x259b75(0x22f)])),_0x10e1d9[_0x259b75(0x228)]?.({'type':_0x259b75(0x1bc),'segmentName':_0xa4f5bd,'activationName':_0x361c6a[_0x259b75(0x26e)]}),_0x10e1d9[_0x259b75(0x1f3)]?.(_0x259b75(0x204)+_0x361c6a[_0x259b75(0x26e)]+'\x27'),_0x29be11[_0x259b75(0x1e7)]++;else{if(_0x361c6a['type']===_0x259b75(0x26c)&&_0x361c6a[_0x259b75(0x22f)]&&_0x361c6a[_0x259b75(0x1cc)])_0x10e1d9[_0x259b75(0x228)]?.({'type':_0x259b75(0x1b6),'segmentName':_0xa4f5bd,'activationName':_0x361c6a[_0x259b75(0x26e)]}),await _0x10e1d9['withProgress'](_0x259b75(0x1b0)+_0x361c6a[_0x259b75(0x26e)]+_0x259b75(0x1a9),()=>_0x5d3f3d[_0x259b75(0x1c7)][_0x259b75(0x25d)](_0x19e6eb,_0x3f6b7b,_0x361c6a[_0x259b75(0x1cc)]['id'],_0x361c6a[_0x259b75(0x22f)])),_0x10e1d9[_0x259b75(0x228)]?.({'type':_0x259b75(0x250),'segmentName':_0xa4f5bd,'activationName':_0x361c6a[_0x259b75(0x26e)]}),_0x10e1d9[_0x259b75(0x1f3)]?.(_0x259b75(0x259)+_0x361c6a[_0x259b75(0x26e)]+'\x27'),_0x29be11['updated']++;else _0x361c6a[_0x259b75(0x21a)]==='delete'&&_0x361c6a[_0x259b75(0x1cc)]&&(_0x10e1d9['onProgress']?.({'type':_0x259b75(0x1cd),'segmentName':_0xa4f5bd,'activationName':_0x361c6a[_0x259b75(0x26e)]}),await _0x10e1d9[_0x259b75(0x235)]('Deleting\x20activation\x20\x27'+_0x361c6a['name']+'\x27...',()=>_0x5d3f3d[_0x259b75(0x1c7)][_0x259b75(0x1a7)](_0x19e6eb,_0x3f6b7b,_0x361c6a[_0x259b75(0x1cc)]['id'])),_0x10e1d9[_0x259b75(0x228)]?.({'type':_0x259b75(0x289),'segmentName':_0xa4f5bd,'activationName':_0x361c6a['name']}),_0x10e1d9[_0x259b75(0x1c9)]?.(_0x259b75(0x1fa)+_0x361c6a[_0x259b75(0x26e)]+'\x27'),_0x29be11[_0x259b75(0x22a)]++);}}catch(_0x45391b){const _0x1b4077=isHttp400Error(_0x45391b),_0x360f5e=_0x1b4077?ErrorCode[_0x259b75(0x244)]:ErrorCode[_0x259b75(0x214)],_0xd2b069=getErrorMessage(_0x45391b);throw new SDKError(_0x360f5e,'Failed\x20to\x20'+_0x361c6a[_0x259b75(0x21a)]+_0x259b75(0x28a)+_0x361c6a[_0x259b75(0x26e)]+'\x27\x20from\x20file:\x20'+_0x3ceb17+_0x259b75(0x225)+_0xd2b069,_0x45391b);}}return _0x29be11;}export async function executePushFolders(_0x3dc75c,_0x1c4e58,_0x724a67,_0x1c7c56,_0xef1eb0){const _0x4a80c1=a142_0x3ef9cf,_0x2137d8=new Map(_0x724a67),_0x37e1f6=sortFoldersByDepth(_0x1c4e58);for(const _0x28c332 of _0x37e1f6){const _0x37eea9=_0x28c332[_0x4a80c1(0x1ce)]('/'),_0x4d7014=_0x37eea9[_0x37eea9[_0x4a80c1(0x1f4)]-0x1],_0x8fe0b9=_0x37eea9[_0x4a80c1(0x212)](0x0,-0x1)[_0x4a80c1(0x271)]('/'),_0x24fd31=_0x2137d8[_0x4a80c1(0x239)](_0x8fe0b9);_0xef1eb0[_0x4a80c1(0x228)]?.({'type':'folder_creating','folder':_0x28c332});const _0x2eca18={'name':_0x4d7014,'parentFolderId':_0x24fd31},_0x39be64=await _0xef1eb0[_0x4a80c1(0x235)](_0x4a80c1(0x291)+_0x28c332+'\x27...',()=>_0x3dc75c[_0x4a80c1(0x1c7)][_0x4a80c1(0x1f0)](_0x1c7c56[_0x4a80c1(0x23b)],_0x2eca18));_0x2137d8['set'](_0x28c332,_0x39be64[_0x4a80c1(0x261)]['id']),_0xef1eb0['onProgress']?.({'type':_0x4a80c1(0x283),'folder':_0x28c332,'folderId':_0x39be64[_0x4a80c1(0x261)]['id']}),_0xef1eb0['logInfo']?.('Created\x20folder\x20\x27'+_0x28c332+'\x27');}return _0x2137d8;}export async function executePushSegmentDeletions(_0x5abd9e,_0x371803,_0x130695){const _0x326e08=a142_0x3ef9cf;if(_0x371803[_0x326e08(0x1f4)]===0x0)return 0x0;const {batchAsync:_0x3f6c82}=await import(_0x326e08(0x22d)),_0xb7b576=0x5,_0xa3c567=await _0x3f6c82(_0x371803,async _0x8dafe5=>{const _0x446ace=_0x326e08;return _0x130695['onProgress']?.({'type':'segment_deleting','name':_0x8dafe5[_0x446ace(0x26e)]}),await _0x5abd9e[_0x446ace(0x1c7)][_0x446ace(0x274)](_0x8dafe5['id']),_0x130695[_0x446ace(0x228)]?.({'type':'segment_deleted','name':_0x8dafe5['name']}),_0x130695[_0x446ace(0x1c9)]?.(_0x446ace(0x219)+_0x8dafe5['name']+'\x27'),0x1;},_0xb7b576);return _0xa3c567[_0x326e08(0x1b2)]((_0x13a7d0,_0x12cf1f)=>_0x13a7d0+_0x12cf1f,0x0);}export async function executePushJourneys(_0x39c8cf,_0x411c9f,_0x3e4b9e,_0x157f70,_0x10d8fc){const _0x1561fa=a142_0x3ef9cf,{journeyDefToRequest:_0x4ed490}=await import(_0x1561fa(0x223)),{activationDefToCreateRequest:_0x2dca40,yamlRuleToApi:_0x2723c6,validateSegmentRule:_0x470ef6}=await import(_0x1561fa(0x201)),_0x5209c9={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5ee96e=new Map(_0x3e4b9e[_0x1561fa(0x1fc)]),_0x269afd=0x5;for(let _0x1274b2=0x0;_0x1274b2<_0x411c9f[_0x1561fa(0x1f4)];_0x1274b2+=_0x269afd){const _0x2e70eb=_0x411c9f['slice'](_0x1274b2,_0x1274b2+_0x269afd),_0x46c3ac=await Promise[_0x1561fa(0x20f)](_0x2e70eb[_0x1561fa(0x209)](async _0xba54b6=>{const _0x19ed66=_0x1561fa;if(!_0xba54b6[_0x19ed66(0x279)]&&!_0xba54b6[_0x19ed66(0x1e3)])return{'action':_0x19ed66(0x1c5),'name':_0xba54b6[_0x19ed66(0x24a)][_0x19ed66(0x26e)],'journeyId':_0xba54b6['existingJourney']?.['id']};const _0x30af03=_0xba54b6[_0x19ed66(0x1ba)]?_0x3e4b9e['folderPathToId'][_0x19ed66(0x239)](_0xba54b6[_0x19ed66(0x1ba)]):undefined;_0x10d8fc[_0x19ed66(0x228)]?.({'type':_0xba54b6[_0x19ed66(0x279)]?'journey_creating':_0x19ed66(0x1a8),'name':_0xba54b6[_0x19ed66(0x24a)]['name']});try{const _0x56a322=await executeSingleJourneyPush(_0x39c8cf,_0xba54b6,{..._0x3e4b9e,'segmentNameToId':_0x5ee96e},{'parentId':_0x157f70[_0x19ed66(0x23b)],'rootFolderId':_0x157f70[_0x19ed66(0x2a3)],'folderId':_0x30af03,'verbose':_0x157f70[_0x19ed66(0x234)]},_0x10d8fc,{'journeyDefToRequest':_0x4ed490,'activationDefToCreateRequest':_0x2dca40,'yamlRuleToApi':_0x2723c6,'validateSegmentRule':_0x470ef6});for(const [_0x25f90e,_0x5e540b]of _0x56a322['embeddedSegmentNameToId']){_0x5ee96e[_0x19ed66(0x21b)](_0x25f90e,_0x5e540b),_0x5209c9[_0x19ed66(0x26a)][_0x19ed66(0x21b)](_0x25f90e,_0x5e540b);}if(_0x56a322[_0x19ed66(0x255)]==='created')_0x10d8fc['onProgress']?.({'type':_0x19ed66(0x281),'name':_0xba54b6[_0x19ed66(0x24a)]['name'],'journeyId':_0x56a322[_0x19ed66(0x215)]}),_0x10d8fc[_0x19ed66(0x1f3)]?.(_0x19ed66(0x1c0)+_0xba54b6['yamlConfig'][_0x19ed66(0x26e)]+'\x27'),_0x5209c9[_0x19ed66(0x1e7)]++;else _0x56a322[_0x19ed66(0x255)]===_0x19ed66(0x1b5)&&(_0x10d8fc[_0x19ed66(0x228)]?.({'type':_0x19ed66(0x1c3),'name':_0xba54b6[_0x19ed66(0x24a)][_0x19ed66(0x26e)]}),_0x10d8fc[_0x19ed66(0x1f3)]?.(_0x19ed66(0x20a)+_0xba54b6[_0x19ed66(0x24a)][_0x19ed66(0x26e)]+'\x27'),_0x5209c9[_0x19ed66(0x1b5)]++);return{'action':_0x56a322[_0x19ed66(0x255)],'name':_0xba54b6[_0x19ed66(0x24a)]['name'],'journeyId':_0x56a322[_0x19ed66(0x215)]};}catch(_0x50b348){const _0x42fd14=isHttp400Error(_0x50b348),_0x1bd7fe=_0x42fd14?ErrorCode[_0x19ed66(0x258)]:ErrorCode[_0x19ed66(0x1b1)],_0x32da06=getErrorMessage(_0x50b348);throw new SDKError(_0x1bd7fe,_0x19ed66(0x230)+(_0xba54b6['isNew']?_0x19ed66(0x28b):_0x19ed66(0x26c))+_0x19ed66(0x1ff)+_0xba54b6['absolutePath']+_0x19ed66(0x225)+_0x32da06,_0x50b348);}}));_0x5209c9[_0x1561fa(0x27c)][_0x1561fa(0x1a4)](..._0x46c3ac);}return _0x5209c9;}async function matchExistingJourneySegments(_0x48d0cd,_0x29d426,_0x455e1d,_0x1944d9,_0x5d923e){const _0x86a001=a142_0x3ef9cf;if(!_0x29d426[_0x86a001(0x1f1)]||!_0x29d426[_0x86a001(0x24a)][_0x86a001(0x25b)])return;const _0x4cedb0=new Map(),_0x8c0ad4=new Set();for(const _0x1f4500 of Object[_0x86a001(0x294)](_0x29d426[_0x86a001(0x24a)]['segments'])){const _0x4bc281=generateDeterministicJourneySegmentName(_0x29d426[_0x86a001(0x24a)][_0x86a001(0x26e)],_0x1f4500);_0x4cedb0['set'](_0x4bc281,_0x1f4500),_0x8c0ad4[_0x86a001(0x218)](_0x1f4500);}const _0x2d66fa=[],_0x3dabfe=collectSegmentIdsFromJourneyApi(_0x29d426[_0x86a001(0x1f1)]);for(const _0x32bf43 of _0x3dabfe){const _0x512019=await fetchSegment(_0x48d0cd,_0x455e1d,_0x32bf43,_0x1944d9);if(!_0x512019?.[_0x86a001(0x26e)])continue;const _0x474985=_0x4cedb0['get'](_0x512019['name']);_0x474985?(_0x5d923e['set'](_0x474985,_0x32bf43),_0x8c0ad4[_0x86a001(0x1f9)](_0x474985)):_0x2d66fa[_0x86a001(0x1a4)]({'id':_0x32bf43,'seg':_0x512019});}if(_0x8c0ad4[_0x86a001(0x227)]>0x0&&_0x2d66fa[_0x86a001(0x1f4)]>0x0){const {localExpandedRuleToNames:_0x5ee4bf}=buildLocalExpandedRuleMappings(_0x29d426['yamlConfig']),_0x3158ca=new Map();for(const {id:_0x5ee772,seg:_0x1df42b}of _0x2d66fa){if(_0x1df42b[_0x86a001(0x2a2)]){const _0x366d75=apiRuleToYaml(_0x1df42b[_0x86a001(0x2a2)]);_0x3158ca[_0x86a001(0x21b)](_0x5ee772,_0x366d75);}}for(const {id:_0x3bce3c,seg:_0xf47c5f}of _0x2d66fa){if(!_0xf47c5f[_0x86a001(0x2a2)])continue;const _0x5892a1=_0x3158ca[_0x86a001(0x239)](_0x3bce3c);if(!_0x5892a1)continue;const _0x327850=serializeExpandedRule(_0x5892a1,_0x3158ca),_0xfdd2=_0x5ee4bf['get'](_0x327850);if(_0xfdd2){const _0x31a12a=_0xfdd2['find'](_0x520372=>_0x8c0ad4['has'](_0x520372));_0x31a12a&&(_0x5d923e['set'](_0x31a12a,_0x3bce3c),_0x8c0ad4[_0x86a001(0x1f9)](_0x31a12a),logger[_0x86a001(0x270)]('Matched\x20server\x20segment\x20\x27'+_0xf47c5f[_0x86a001(0x26e)]+'\x27\x20to\x20local\x20\x27'+_0x31a12a+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x2cabea,_0x26a4e7,_0x16c207,_0x3127b6,_0x5c90a6,_0x1c341a){const _0x41c72f=a142_0x3ef9cf,{journeyDefToRequest:_0x1bb1d9,activationDefToCreateRequest:_0x454e50,yamlRuleToApi:_0x4893e3,validateSegmentRule:_0x24b7c5}=_0x1c341a,_0x314f02=new Map(),_0x20f161=new Map();recoverSegmentIdsFromPushRecovery(_0x26a4e7,_0x314f02,_0x16c207[_0x41c72f(0x1fc)]);const _0xc7d9c8=new Map(),_0x24c57a=new Map(),_0x41c48e=new Map();let _0x46abb7;const _0x5bdaa1=async()=>{const _0x295e91=_0x41c72f;if(_0x46abb7)return;_0x46abb7=new Map();if(!_0x26a4e7['existingJourney'])return;const _0x58779e=await _0x2cabea[_0x295e91(0x292)][_0x295e91(0x28f)](_0x26a4e7['existingJourney']['id']);for(const _0x1763a5 of _0x58779e){const _0x484f32=journeyActivationStepToYaml(_0x1763a5,_0x16c207[_0x295e91(0x298)],_0x16c207[_0x295e91(0x1aa)]),_0x8dab28=activationSignature(_0x484f32);!_0x46abb7['has'](_0x8dab28)&&_0x46abb7['set'](_0x8dab28,_0x1763a5['id']),_0x484f32['name']&&_0x20f161['set'](_0x484f32[_0x295e91(0x26e)],_0x1763a5['id']);}};await matchExistingJourneySegments(_0x2cabea,_0x26a4e7,_0x3127b6['parentId'],_0x16c207[_0x41c72f(0x222)],_0x16c207['segmentNameToId']);const _0x331143={'resolveSegmentId':async _0x27242b=>{const _0x31e0a4=_0x41c72f,_0x5e5bb8=_0x16c207[_0x31e0a4(0x1fc)][_0x31e0a4(0x239)](_0x27242b);if(!_0x5e5bb8)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x27242b+_0x31e0a4(0x1a5)+_0x26a4e7['yamlConfig'][_0x31e0a4(0x26e)]+')');return _0x5e5bb8;},'resolveEmbeddedSegmentId':async(_0x30363c,_0x1ec0be)=>{const _0xabfca8=_0x41c72f,_0x24c569=_0x16c207['segmentNameToId'][_0xabfca8(0x239)](_0x30363c);if(_0x24c569)return _0x24c569;const _0x592181=_0x16c207[_0xabfca8(0x222)][_0xabfca8(0x1d9)](_0x46abea=>_0x46abea[_0xabfca8(0x26e)]===_0x30363c);if(_0x592181)return _0x16c207['segmentNameToId']['set'](_0x30363c,_0x592181['id']),_0x592181['id'];if(_0x26a4e7[_0xabfca8(0x279)]){const {stageName:_0x26c2f5,criteriaName:_0x5cba0f}=findSegmentCriteriaLocation(_0x26a4e7[_0xabfca8(0x24a)],_0x30363c);return _0x24b7c5(_0x30363c,_0x1ec0be[_0xabfca8(0x2a2)]),_0x24c57a[_0xabfca8(0x21b)](_0x30363c,{'definition':_0x1ec0be,'stageName':_0x26c2f5,'criteriaName':_0x5cba0f}),createPendingSegmentId(_0x30363c);}const _0x5d9804=_0x26a4e7[_0xabfca8(0x1f1)]?.['id'];if(!_0x5d9804)throw new SDKError(ErrorCode[_0xabfca8(0x23f)],_0xabfca8(0x1ee));const _0x1b1400=_0xc7d9c8[_0xabfca8(0x239)](_0x30363c);if(_0x1b1400)return _0x1b1400;const _0x43c190=((async()=>{const _0xcd0e0b=_0xabfca8;_0x24b7c5(_0x30363c,_0x1ec0be[_0xcd0e0b(0x2a2)]);const _0x202343=generateDeterministicJourneySegmentName(_0x26a4e7['yamlConfig']['name'],_0x30363c),_0x46d78c=_0x16c207[_0xcd0e0b(0x222)]['find'](_0xf6b213=>_0xf6b213[_0xcd0e0b(0x26e)]===_0x202343),_0x509757=createSegmentIdResolver(_0x16c207['segmentNameToId'],_0x30363c),_0xf1b700=await resolveRuleSegmentIds(_0x1ec0be[_0xcd0e0b(0x2a2)],_0x509757);let _0x3b09a4;return _0x46d78c?(await _0x2cabea[_0xcd0e0b(0x1c7)][_0xcd0e0b(0x200)](_0x3127b6[_0xcd0e0b(0x23b)],_0x46d78c['id'],{'description':_0x1ec0be[_0xcd0e0b(0x23e)]||_0xcd0e0b(0x1f5)+_0x30363c,'rule':_0x4893e3(_0xf1b700,!![]),'countPopulation':!![]}),_0x3b09a4=_0x46d78c['id'],saveSegmentToPushRecovery(_0x26a4e7[_0xcd0e0b(0x27a)],_0x26a4e7[_0xcd0e0b(0x24a)][_0xcd0e0b(0x26e)],_0x30363c,{'segmentId':_0x3b09a4,'uniqueServerName':_0x202343,'createdAt':new Date()[_0xcd0e0b(0x213)]()})):_0x3b09a4=await createOrRecoverEmbeddedSegment(_0x2cabea,_0x26a4e7,{'localName':_0x30363c,'uniqueSegmentName':_0x202343,'description':_0x1ec0be[_0xcd0e0b(0x23e)]||_0xcd0e0b(0x1f5)+_0x30363c,'journeyId':_0x5d9804,'resolvedRule':_0xf1b700,'parentId':_0x3127b6[_0xcd0e0b(0x23b)],'folderId':_0x3127b6[_0xcd0e0b(0x2a3)]||''},_0x4893e3),_0x16c207['segmentNameToId'][_0xcd0e0b(0x21b)](_0x30363c,_0x3b09a4),_0x314f02[_0xcd0e0b(0x21b)](_0x30363c,_0x3b09a4),_0x3b09a4;})());_0xc7d9c8['set'](_0x30363c,_0x43c190);try{return await _0x43c190;}finally{_0xc7d9c8[_0xabfca8(0x1f9)](_0x30363c);}},'resolveActivationId':async _0x1e6c4e=>{const _0x16fded=_0x41c72f,_0x517921=_0x20f161['get'](_0x1e6c4e);if(_0x517921)return _0x517921;if(_0x26a4e7[_0x16fded(0x1f1)]){await _0x5bdaa1();const _0x39817c=_0x20f161['get'](_0x1e6c4e);if(_0x39817c)return _0x39817c;}throw new SDKError(ErrorCode[_0x16fded(0x260)],_0x16fded(0x1c4)+_0x1e6c4e+'\x20(referenced\x20in\x20journey\x20'+_0x26a4e7[_0x16fded(0x24a)][_0x16fded(0x26e)]+_0x16fded(0x257)+_0x16fded(0x263));},'resolveEmbeddedActivationId':async(_0x4ec618,_0x2bde49)=>{const _0x1fe719=_0x41c72f,_0x287781=_0x20f161[_0x1fe719(0x239)](_0x4ec618);if(_0x287781)return _0x287781;if(_0x26a4e7[_0x1fe719(0x279)])return _0x41c48e[_0x1fe719(0x21b)](_0x4ec618,_0x2bde49),createPendingActivationId(_0x4ec618);if(_0x26a4e7['existingJourney']){await _0x5bdaa1();const _0x34f922=_0x20f161[_0x1fe719(0x239)](_0x2bde49['name']);if(_0x34f922)return _0x20f161[_0x1fe719(0x21b)](_0x4ec618,_0x34f922),_0x34f922;const _0x47513d=activationSignature(_0x2bde49),_0x3b3246=_0x46abb7?.[_0x1fe719(0x239)](_0x47513d);if(_0x3b3246)return _0x20f161[_0x1fe719(0x21b)](_0x4ec618,_0x3b3246),_0x3b3246;const _0x374d7b=await _0x454e50(_0x2bde49,_0x16c207[_0x1fe719(0x28d)]),_0x5615da={..._0x374d7b,..._0x2bde49[_0x1fe719(0x297)]!==undefined&&{'runAfterJourneyRefresh':_0x2bde49[_0x1fe719(0x297)]}},_0x2ad5da=await _0x2cabea[_0x1fe719(0x292)][_0x1fe719(0x29b)](_0x26a4e7[_0x1fe719(0x1f1)]['id'],_0x5615da);return _0x20f161[_0x1fe719(0x21b)](_0x4ec618,_0x2ad5da['id']),_0x2ad5da['id'];}throw new SDKError(ErrorCode[_0x1fe719(0x23f)],_0x1fe719(0x27d));},'resolveJourneyId':async _0x5ee2df=>{const _0x5cd087=_0x41c72f;try{return await _0x2cabea[_0x5cd087(0x292)]['resolveJourneyId'](_0x3127b6[_0x5cd087(0x23b)],_0x5ee2df);}catch(_0x443ca2){throw new SDKError(ErrorCode['NOT_FOUND'],_0x5cd087(0x23d)+_0x5ee2df+_0x5cd087(0x247)+_0x26a4e7[_0x5cd087(0x24a)][_0x5cd087(0x26e)]+'\x27)',_0x443ca2);}},'resolveStageId':async(_0x198bf1,_0x3a13e1)=>{const _0x2b7e37=_0x41c72f,_0x2cebf4=await _0x2cabea[_0x2b7e37(0x292)][_0x2b7e37(0x1e8)](_0x198bf1),_0x3d4f89=_0x2cebf4[_0x2b7e37(0x1fe)][_0x2b7e37(0x21f)][_0x2b7e37(0x1d9)](_0x46d7db=>_0x46d7db[_0x2b7e37(0x26e)][_0x2b7e37(0x24b)]()===_0x3a13e1[_0x2b7e37(0x24b)]());if(!_0x3d4f89?.['id'])throw new SDKError(ErrorCode[_0x2b7e37(0x260)],_0x2b7e37(0x1c8)+_0x3a13e1+_0x2b7e37(0x1ef)+(_0x2cebf4[_0x2b7e37(0x1fe)][_0x2b7e37(0x1b8)]||_0x2cebf4[_0x2b7e37(0x1fe)][_0x2b7e37(0x26e)])+'\x27');return _0x3d4f89['id'];}},_0x2b3b34=await _0x1bb1d9(_0x26a4e7[_0x41c72f(0x24a)],_0x3127b6[_0x41c72f(0x23b)],_0x331143),_0x21a3d0=_0x3127b6[_0x41c72f(0x25e)]||_0x3127b6[_0x41c72f(0x2a3)];_0x21a3d0&&(_0x2b3b34[_0x41c72f(0x1f6)]={'parentFolder':{'data':{'id':_0x21a3d0,'type':_0x41c72f(0x284)}}});if(_0x26a4e7['isNew']){if(_0x24c57a[_0x41c72f(0x227)]>0x0||_0x41c48e[_0x41c72f(0x227)]>0x0)return await executeThreeStepJourneyCreate(_0x2cabea,_0x26a4e7,_0x2b3b34,{'pendingEmbeddedSegments':_0x24c57a,'pendingEmbeddedActivations':_0x41c48e,'embeddedSegmentNameToId':_0x314f02,'journeyActivationNameToId':_0x20f161},{..._0x3127b6,'effectiveFolderId':_0x21a3d0},_0x16c207,_0x5c90a6,_0x1c341a);else{ensureJourneyDefaults(_0x2b3b34[_0x41c72f(0x1fe)]);const _0x564046=await _0x2cabea[_0x41c72f(0x292)]['create'](_0x2b3b34);return deletePushRecovery(_0x26a4e7['absolutePath']),{'action':'created','journeyId':_0x564046['id'],'embeddedSegmentNameToId':_0x314f02};}}else{if(_0x26a4e7[_0x41c72f(0x1e3)]&&_0x26a4e7['existingJourney']){_0x2b3b34['id']=_0x26a4e7['existingJourney']['id'];const _0x1b6571=_0x2b3b34[_0x41c72f(0x1fe)];_0x26a4e7[_0x41c72f(0x1f1)][_0x41c72f(0x1fe)]?.['journeyBundleName']&&(_0x1b6571[_0x41c72f(0x1b8)]=_0x26a4e7['existingJourney'][_0x41c72f(0x1fe)][_0x41c72f(0x1b8)]);const _0x2cfb2b=_0x26a4e7['existingJourney'][_0x41c72f(0x1fe)]?.['journeyStages'];return _0x2cfb2b&&_0x2b3b34[_0x41c72f(0x1fe)][_0x41c72f(0x21f)]&&injectExistingStageIds(_0x2b3b34['attributes'][_0x41c72f(0x21f)],_0x2cfb2b),ensureJourneyDefaults(_0x1b6571),await _0x2cabea['journey']['update'](_0x26a4e7[_0x41c72f(0x1f1)]['id'],_0x2b3b34),deletePushRecovery(_0x26a4e7['absolutePath']),{'action':_0x41c72f(0x1b5),'journeyId':_0x26a4e7[_0x41c72f(0x1f1)]['id'],'embeddedSegmentNameToId':_0x314f02};}}return deletePushRecovery(_0x26a4e7[_0x41c72f(0x27a)]),{'action':_0x41c72f(0x1c5),'journeyId':_0x26a4e7[_0x41c72f(0x1f1)]?.['id'],'embeddedSegmentNameToId':_0x314f02};}function findSegmentCriteriaLocation(_0x8e14f8,_0x4d815){const _0x1b6966=a142_0x3ef9cf,_0x4eb3b1=_0x8e14f8['stages']||_0x8e14f8[_0x1b6966(0x2a6)]?.[0x0]?.[_0x1b6966(0x1fd)]||[];let _0x2dfdc8=_0x1b6966(0x24e),_0x94c08f=_0x4d815;const _0x33350a=_0x8e14f8[_0x1b6966(0x269)]||_0x8e14f8[_0x1b6966(0x2a6)]?.[0x0]?.['goal'];if(_0x33350a?.[_0x1b6966(0x1c7)]===_0x4d815)return{'stageName':_0x1b6966(0x269),'criteriaName':_0x33350a[_0x1b6966(0x26e)]||_0x4d815};_0x28eae6:for(const _0x5c06d5 of _0x4eb3b1){if(_0x5c06d5[_0x1b6966(0x28e)]?.[_0x1b6966(0x1c7)]===_0x4d815){_0x2dfdc8=_0x5c06d5[_0x1b6966(0x26e)],_0x94c08f=_0x5c06d5['entry_criteria'][_0x1b6966(0x26e)]||_0x4d815;break;}if(_0x5c06d5[_0x1b6966(0x1a6)])for(const _0x22eef7 of _0x5c06d5['steps']){if(_0x22eef7[_0x1b6966(0x21a)]==='decision_point'&&_0x22eef7[_0x1b6966(0x1c6)]?.[_0x1b6966(0x245)])for(const _0x46c1e5 of _0x22eef7[_0x1b6966(0x1c6)][_0x1b6966(0x245)]){if(_0x46c1e5['segment']===_0x4d815){_0x2dfdc8=_0x5c06d5['name'],_0x94c08f=_0x46c1e5['name']||_0x4d815;break _0x28eae6;}}}}return{'stageName':_0x2dfdc8,'criteriaName':_0x94c08f};}async function executeThreeStepJourneyCreate(_0x1f968d,_0x16419c,_0x2db39b,_0x45ecc5,_0x350a61,_0x1d7529,_0x3598cf,_0x3c4ece){const _0x8d9cc1=a142_0x3ef9cf,{activationDefToCreateRequest:_0x471e03,yamlRuleToApi:_0x336715}=_0x3c4ece,{pendingEmbeddedSegments:_0xc2fb0d,pendingEmbeddedActivations:_0x1ab618,embeddedSegmentNameToId:_0x34af2c}=_0x45ecc5,_0x1c5b81=JSON[_0x8d9cc1(0x1dc)](JSON['stringify'](_0x2db39b));ensureJourneyDefaults(_0x1c5b81[_0x8d9cc1(0x1fe)]),stripPendingIds(_0x1c5b81);const _0x4c4ba7=await _0x1f968d[_0x8d9cc1(0x292)][_0x8d9cc1(0x28b)](_0x1c5b81),_0x33abf7=_0x4c4ba7['id'],_0x3286e4=new Map();for(const _0x4a73ce of _0x4c4ba7[_0x8d9cc1(0x1fe)][_0x8d9cc1(0x21f)]){_0x3286e4[_0x8d9cc1(0x21b)](_0x4a73ce['name'][_0x8d9cc1(0x24b)](),_0x4a73ce['id']);}recoverSegmentIdsFromPushRecovery(_0x16419c,_0x34af2c,_0x1d7529[_0x8d9cc1(0x1fc)]);for(const [_0x22dbaa,{definition:_0x253027}]of _0xc2fb0d){if(_0x34af2c[_0x8d9cc1(0x1d5)](_0x22dbaa)){_0x3598cf[_0x8d9cc1(0x228)]?.({'type':_0x8d9cc1(0x1e5),'journeyName':_0x16419c[_0x8d9cc1(0x24a)][_0x8d9cc1(0x26e)],'segmentName':_0x22dbaa});continue;}const _0x199a39=generateDeterministicJourneySegmentName(_0x16419c[_0x8d9cc1(0x24a)][_0x8d9cc1(0x26e)],_0x22dbaa);_0x3598cf[_0x8d9cc1(0x228)]?.({'type':'embedded_segment_creating','journeyName':_0x16419c['yamlConfig'][_0x8d9cc1(0x26e)],'segmentName':_0x22dbaa});const _0x3e7307=createSegmentIdResolver(_0x1d7529['segmentNameToId'],_0x22dbaa),_0x3c4098=await resolveRuleSegmentIds(_0x253027[_0x8d9cc1(0x2a2)],_0x3e7307),_0x4f784c=await createOrRecoverEmbeddedSegment(_0x1f968d,_0x16419c,{'localName':_0x22dbaa,'uniqueSegmentName':_0x199a39,'description':_0x253027[_0x8d9cc1(0x23e)]||_0x8d9cc1(0x1f5)+_0x22dbaa,'journeyId':_0x33abf7,'resolvedRule':_0x3c4098,'parentId':_0x350a61['parentId'],'folderId':_0x350a61['effectiveFolderId']||''},_0x336715);_0x34af2c[_0x8d9cc1(0x21b)](_0x22dbaa,_0x4f784c),_0x1d7529[_0x8d9cc1(0x1fc)][_0x8d9cc1(0x21b)](_0x22dbaa,_0x4f784c),_0x3598cf[_0x8d9cc1(0x228)]?.({'type':'embedded_segment_created','journeyName':_0x16419c[_0x8d9cc1(0x24a)][_0x8d9cc1(0x26e)],'segmentName':_0x22dbaa});}const _0x3221f4=new Map();for(const [_0x222694,_0x32302b]of _0x1ab618){_0x3598cf[_0x8d9cc1(0x228)]?.({'type':_0x8d9cc1(0x1ae),'journeyName':_0x16419c['yamlConfig'][_0x8d9cc1(0x26e)],'activationName':_0x222694});const _0x465c69=await _0x471e03(_0x32302b,_0x1d7529[_0x8d9cc1(0x28d)]),_0x38ed47={..._0x465c69,..._0x32302b[_0x8d9cc1(0x297)]!==undefined&&{'runAfterJourneyRefresh':_0x32302b['run_after_journey_refresh']}},_0x44be69=await _0x1f968d[_0x8d9cc1(0x292)][_0x8d9cc1(0x29b)](_0x33abf7,_0x38ed47);_0x3221f4[_0x8d9cc1(0x21b)](_0x222694,_0x44be69['id']),_0x45ecc5[_0x8d9cc1(0x1bf)]['set'](_0x222694,_0x44be69['id']),_0x3598cf[_0x8d9cc1(0x228)]?.({'type':_0x8d9cc1(0x1be),'journeyName':_0x16419c[_0x8d9cc1(0x24a)]['name'],'activationName':_0x222694});}const _0x590b19=JSON[_0x8d9cc1(0x1dc)](JSON[_0x8d9cc1(0x216)](_0x2db39b));return _0x590b19['id']=_0x33abf7,ensureJourneyDefaults(_0x590b19[_0x8d9cc1(0x1fe)]),resolvePendingIdsInRequest(_0x590b19,_0x2db39b,_0x3286e4,_0x34af2c,_0x3221f4,_0x3598cf),await _0x1f968d[_0x8d9cc1(0x292)][_0x8d9cc1(0x26c)](_0x33abf7,_0x590b19),deletePushRecovery(_0x16419c['absolutePath']),{'action':'created','journeyId':_0x33abf7,'embeddedSegmentNameToId':_0x34af2c};}export function stripWaitStepPendingIds(_0x225598){const _0x450c5d=a142_0x3ef9cf,_0x1b3b6a=_0x225598['conditionSegmentId']&&isPendingSegmentId(_0x225598[_0x450c5d(0x29a)]),_0x38c9ba=_0x225598[_0x450c5d(0x282)]?.[_0x450c5d(0x243)](_0x502d2e=>_0x502d2e[_0x450c5d(0x221)]&&isPendingSegmentId(_0x502d2e[_0x450c5d(0x221)]));(_0x1b3b6a||_0x38c9ba)&&(_0x225598[_0x450c5d(0x262)]='Duration',_0x225598[_0x450c5d(0x22e)]=0x1,_0x225598['waitStepUnit']=_0x450c5d(0x208),delete _0x225598[_0x450c5d(0x29a)],delete _0x225598[_0x450c5d(0x211)],delete _0x225598[_0x450c5d(0x1c2)],delete _0x225598[_0x450c5d(0x282)]);}export function resolveWaitStepPendingIds(_0x78135e,_0x11c531,_0x383f7f,_0xe1b83a){const _0x5e9149=a142_0x3ef9cf;if(_0x11c531[_0x5e9149(0x29a)]&&isPendingSegmentId(_0x11c531[_0x5e9149(0x29a)])){const _0x158253=_0x383f7f(_0x11c531[_0x5e9149(0x29a)],_0x5e9149(0x20c)+_0xe1b83a+_0x5e9149(0x264));_0x158253&&(_0x78135e[_0x5e9149(0x262)]='Condition',_0x78135e[_0x5e9149(0x29a)]=_0x158253,delete _0x78135e[_0x5e9149(0x22e)],delete _0x78135e[_0x5e9149(0x2a7)],_0x11c531[_0x5e9149(0x211)]!==undefined&&(_0x78135e[_0x5e9149(0x211)]=_0x11c531[_0x5e9149(0x211)]),_0x11c531[_0x5e9149(0x1c2)]&&(_0x78135e['conditionTimeoutUnit']=_0x11c531[_0x5e9149(0x1c2)]));}if(_0x11c531[_0x5e9149(0x282)]){const _0x3515ff=_0x11c531[_0x5e9149(0x282)]['some'](_0x27aa4f=>_0x27aa4f[_0x5e9149(0x221)]&&isPendingSegmentId(_0x27aa4f['segmentId']));if(_0x3515ff){const _0x4461d8=_0x11c531[_0x5e9149(0x282)][_0x5e9149(0x209)](_0x44b248=>{const _0x48abaf=_0x5e9149;if(_0x44b248['segmentId']&&isPendingSegmentId(_0x44b248[_0x48abaf(0x221)])){const _0x258c92=_0x383f7f(_0x44b248[_0x48abaf(0x221)],'stage\x20\x27'+_0xe1b83a+_0x48abaf(0x264));return{..._0x44b248,'segmentId':_0x258c92||_0x44b248[_0x48abaf(0x221)]};}return{..._0x44b248};});_0x78135e[_0x5e9149(0x262)]='Condition',_0x78135e[_0x5e9149(0x282)]=_0x4461d8,delete _0x78135e[_0x5e9149(0x22e)],delete _0x78135e['waitStepUnit'],delete _0x78135e[_0x5e9149(0x29a)],delete _0x78135e[_0x5e9149(0x211)],delete _0x78135e[_0x5e9149(0x1c2)];}}}function stripPendingIds(_0x4a925c){const _0x582a94=a142_0x3ef9cf;_0x4a925c['attributes']['goal']?.[_0x582a94(0x221)]&&isPendingSegmentId(_0x4a925c[_0x582a94(0x1fe)][_0x582a94(0x269)][_0x582a94(0x221)])&&delete _0x4a925c[_0x582a94(0x1fe)][_0x582a94(0x269)];for(const _0x19ae9f of _0x4a925c['attributes'][_0x582a94(0x21f)]||[]){_0x19ae9f['entryCriteria']?.[_0x582a94(0x221)]&&isPendingSegmentId(_0x19ae9f['entryCriteria'][_0x582a94(0x221)])&&delete _0x19ae9f[_0x582a94(0x20e)];_0x19ae9f[_0x582a94(0x236)]?.[_0x582a94(0x221)]&&isPendingSegmentId(_0x19ae9f['milestone']['segmentId'])&&delete _0x19ae9f[_0x582a94(0x236)];_0x19ae9f['exitCriterias']&&(_0x19ae9f[_0x582a94(0x1ad)]=_0x19ae9f[_0x582a94(0x1ad)][_0x582a94(0x29e)](_0x461d66=>!_0x461d66['segmentId']||!isPendingSegmentId(_0x461d66[_0x582a94(0x221)])));if(_0x19ae9f[_0x582a94(0x1a6)])for(const _0x4405e0 of Object[_0x582a94(0x294)](_0x19ae9f['steps'])){const _0x594ea1=_0x19ae9f[_0x582a94(0x1a6)][_0x4405e0];_0x594ea1[_0x582a94(0x21a)]==='Activation'&&_0x594ea1[_0x582a94(0x20d)]&&isPendingActivationId(_0x594ea1[_0x582a94(0x20d)])&&(_0x594ea1[_0x582a94(0x20d)]='');if(_0x594ea1[_0x582a94(0x21a)]==='DecisionPoint'&&_0x594ea1['branches'])for(const _0x11cb78 of _0x594ea1[_0x582a94(0x245)]){_0x11cb78[_0x582a94(0x221)]&&isPendingSegmentId(_0x11cb78[_0x582a94(0x221)])&&(_0x11cb78[_0x582a94(0x221)]='');}_0x594ea1['type']===_0x582a94(0x276)&&stripWaitStepPendingIds(_0x594ea1);}}}function resolvePendingIdsInRequest(_0x28a5b7,_0x510f82,_0x50325b,_0x49a709,_0x317a4c,_0x2ba210){const _0x3fc064=a142_0x3ef9cf,_0x13f962=(_0x521d79,_0x530d60)=>{const _0x2156b8=a142_0x3bff;if(!isPendingSegmentId(_0x521d79))return _0x521d79;const _0x4e683a=extractPendingSegmentName(_0x521d79),_0x3313db=_0x49a709['get'](_0x4e683a);return!_0x3313db&&_0x2ba210['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x4e683a+_0x2156b8(0x206)+_0x530d60),_0x3313db;};if(_0x28a5b7['attributes'][_0x3fc064(0x269)]?.['segmentId']&&isPendingSegmentId(_0x28a5b7[_0x3fc064(0x1fe)]['goal']['segmentId'])){const _0x2e6ab0=_0x13f962(_0x28a5b7[_0x3fc064(0x1fe)]['goal'][_0x3fc064(0x221)],'goal\x20criteria');_0x2e6ab0&&(_0x28a5b7[_0x3fc064(0x1fe)][_0x3fc064(0x269)][_0x3fc064(0x221)]=_0x2e6ab0);}for(const _0x5bd20f of _0x28a5b7[_0x3fc064(0x1fe)][_0x3fc064(0x21f)]||[]){const _0x3d0baf=_0x50325b[_0x3fc064(0x239)](_0x5bd20f[_0x3fc064(0x26e)]['toLowerCase']());_0x3d0baf&&(_0x5bd20f['id']=_0x3d0baf);if(_0x5bd20f['entryCriteria']?.[_0x3fc064(0x221)]&&isPendingSegmentId(_0x5bd20f[_0x3fc064(0x20e)]['segmentId'])){const _0x13b3a9=_0x13f962(_0x5bd20f['entryCriteria'][_0x3fc064(0x221)],'stage\x20\x27'+_0x5bd20f[_0x3fc064(0x26e)]+'\x27\x20entry\x20criteria');_0x13b3a9&&(_0x5bd20f['entryCriteria'][_0x3fc064(0x221)]=_0x13b3a9);}if(_0x5bd20f[_0x3fc064(0x1ad)])for(const _0x55f958 of _0x5bd20f[_0x3fc064(0x1ad)]){if(_0x55f958['segmentId']&&isPendingSegmentId(_0x55f958['segmentId'])){const _0x12318b=_0x13f962(_0x55f958['segmentId'],'stage\x20\x27'+_0x5bd20f['name']+_0x3fc064(0x24f));_0x12318b&&(_0x55f958[_0x3fc064(0x221)]=_0x12318b);}}if(_0x5bd20f[_0x3fc064(0x236)]?.[_0x3fc064(0x221)]&&isPendingSegmentId(_0x5bd20f[_0x3fc064(0x236)]['segmentId'])){const _0x4a8dfb=_0x13f962(_0x5bd20f[_0x3fc064(0x236)][_0x3fc064(0x221)],_0x3fc064(0x20c)+_0x5bd20f[_0x3fc064(0x26e)]+'\x27\x20milestone');_0x4a8dfb&&(_0x5bd20f['milestone'][_0x3fc064(0x221)]=_0x4a8dfb);}if(_0x5bd20f['steps']){const _0x215284=_0x13dcf7=>_0x510f82[_0x3fc064(0x1fe)][_0x3fc064(0x21f)]?.[_0x3fc064(0x1d9)](_0x3c8b48=>_0x3c8b48[_0x3fc064(0x26e)][_0x3fc064(0x24b)]()===_0x5bd20f[_0x3fc064(0x26e)]['toLowerCase']())?.[_0x3fc064(0x1a6)]?.[_0x13dcf7];for(const _0x561bee of Object[_0x3fc064(0x294)](_0x5bd20f['steps'])){const _0xf81985=_0x5bd20f[_0x3fc064(0x1a6)][_0x561bee],_0x1c5022=_0x215284(_0x561bee);if(_0xf81985[_0x3fc064(0x21a)]===_0x3fc064(0x1e9)&&_0xf81985[_0x3fc064(0x20d)]&&(isPendingActivationId(_0xf81985['journeyActivationStepId'])||_0xf81985[_0x3fc064(0x20d)]==='')){if(_0x1c5022?.['journeyActivationStepId']&&isPendingActivationId(_0x1c5022['journeyActivationStepId'])){const _0x3a6a60=extractPendingActivationName(_0x1c5022['journeyActivationStepId']),_0x451da7=_0x317a4c[_0x3fc064(0x239)](_0x3a6a60);_0x451da7&&(_0xf81985[_0x3fc064(0x20d)]=_0x451da7);}}if(_0xf81985['type']===_0x3fc064(0x26b)&&_0xf81985['branches']&&_0x1c5022?.[_0x3fc064(0x245)])for(let _0x5170b7=0x0;_0x5170b7<_0xf81985['branches'][_0x3fc064(0x1f4)];_0x5170b7++){const _0x52e6f5=_0xf81985[_0x3fc064(0x245)][_0x5170b7],_0x10e105=_0x1c5022[_0x3fc064(0x245)][_0x5170b7];if(_0x10e105?.['segmentId']&&isPendingSegmentId(_0x10e105['segmentId'])){const _0x1db6a0=_0x13f962(_0x10e105[_0x3fc064(0x221)],'stage\x20\x27'+_0x5bd20f[_0x3fc064(0x26e)]+_0x3fc064(0x21c)+(_0x52e6f5[_0x3fc064(0x26e)]||_0x5170b7)+'\x27');_0x1db6a0&&(_0x52e6f5[_0x3fc064(0x221)]=_0x1db6a0);}}_0xf81985[_0x3fc064(0x21a)]===_0x3fc064(0x276)&&_0x1c5022?.[_0x3fc064(0x21a)]===_0x3fc064(0x276)&&resolveWaitStepPendingIds(_0xf81985,_0x1c5022,_0x13f962,_0x5bd20f[_0x3fc064(0x26e)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x58dc76,_0xf3f362){const _0x27ec8d=a143_0x2298,_0x5b12bb=_0x58dc76();while(!![]){try{const _0x31638a=-parseInt(_0x27ec8d(0xde))/0x1+parseInt(_0x27ec8d(0xd5))/0x2+-parseInt(_0x27ec8d(0xe4))/0x3+-parseInt(_0x27ec8d(0xe0))/0x4*(-parseInt(_0x27ec8d(0xdd))/0x5)+-parseInt(_0x27ec8d(0xd7))/0x6+parseInt(_0x27ec8d(0xe1))/0x7*(parseInt(_0x27ec8d(0xdc))/0x8)+-parseInt(_0x27ec8d(0xdf))/0x9*(parseInt(_0x27ec8d(0xda))/0xa);if(_0x31638a===_0xf3f362)break;else _0x5b12bb['push'](_0x5b12bb['shift']());}catch(_0x12d07e){_0x5b12bb['push'](_0x5b12bb['shift']());}}}(a143_0x555c,0x70836));export function buildFolderIdToPathMap(_0x4edab2){const _0x1684b6=new Map(),_0x30a7d6=new Map();for(const _0x4a8cbd of _0x4edab2){_0x30a7d6['set'](_0x4a8cbd['id'],_0x4a8cbd);}const _0xa7303c=new Set();for(const _0x43d883 of _0x4edab2){!_0x43d883['parentFolderId']&&_0xa7303c['add'](_0x43d883['id']);}function _0x5501c4(_0x1f92be){const _0x245960=a143_0x2298;if(_0x1684b6[_0x245960(0xd6)](_0x1f92be['id']))return _0x1684b6['get'](_0x1f92be['id']);if(_0xa7303c['has'](_0x1f92be['id']))return _0x1684b6[_0x245960(0xe3)](_0x1f92be['id'],''),'';if(_0x1f92be['parentFolderId']){const _0x63127d=_0x30a7d6['get'](_0x1f92be['parentFolderId']);if(_0x63127d){const _0x474178=_0x5501c4(_0x63127d),_0x220658=_0x474178?_0x474178+'/'+_0x1f92be[_0x245960(0xd8)]:_0x1f92be[_0x245960(0xd8)];return _0x1684b6['set'](_0x1f92be['id'],_0x220658),_0x220658;}}const _0x3fec9e=_0x1f92be[_0x245960(0xd8)];return _0x1684b6[_0x245960(0xe3)](_0x1f92be['id'],_0x3fec9e),_0x3fec9e;}for(const _0x3dab19 of _0x4edab2){_0x5501c4(_0x3dab19);}return _0x1684b6;}export function buildFolderPathToIdMap(_0x3b838c){const _0x576fb1=a143_0x2298,_0x437dbb=new Map(),_0x39aa94=new Map();for(const _0x545b86 of _0x3b838c){_0x39aa94[_0x576fb1(0xe3)](_0x545b86['id'],_0x545b86);}const _0x3c08a9=new Set();for(const _0x36b72a of _0x3b838c){!_0x36b72a[_0x576fb1(0xd9)]&&_0x3c08a9[_0x576fb1(0xe2)](_0x36b72a['id']);}function _0x2d32e5(_0x58c352){const _0x1f8e6c=_0x576fb1;if(_0x3c08a9['has'](_0x58c352['id']))return'';if(_0x58c352[_0x1f8e6c(0xd9)]){const _0xcb1d74=_0x39aa94[_0x1f8e6c(0xdb)](_0x58c352[_0x1f8e6c(0xd9)]);if(_0xcb1d74){const _0x4c6176=_0x2d32e5(_0xcb1d74);return _0x4c6176?_0x4c6176+'/'+_0x58c352[_0x1f8e6c(0xd8)]:_0x58c352[_0x1f8e6c(0xd8)];}}return _0x58c352[_0x1f8e6c(0xd8)];}for(const _0x3cb2bd of _0x3b838c){const _0x3266f3=_0x2d32e5(_0x3cb2bd);_0x437dbb[_0x576fb1(0xe3)](_0x3266f3,_0x3cb2bd['id']);}return _0x437dbb;}export function buildFolderMaps(_0x31c37a){const _0x312b5f=a143_0x2298,_0x43ae71=buildFolderIdToPathMap(_0x31c37a),_0x36e52d=new Map();for(const [_0x3e67b4,_0x3769da]of _0x43ae71){_0x36e52d[_0x312b5f(0xe3)](_0x3769da,_0x3e67b4);}return{'idToPath':_0x43ae71,'pathToId':_0x36e52d};}function a143_0x2298(_0x18733d,_0x1880f5){_0x18733d=_0x18733d-0xd5;const _0x555c78=a143_0x555c();let _0x2298a7=_0x555c78[_0x18733d];return _0x2298a7;}function a143_0x555c(){const _0x3326d8=['651425bFcLQW','45axmxNp','8FlRBUE','6003893fcMVUZ','add','set','2427999gRPAPT','1824440ERwjXD','has','1628904NLJNxB','name','parentFolderId','158410ibHsOf','get','8UEbqXL','1255955FYTHtp'];a143_0x555c=function(){return _0x3326d8;};return a143_0x555c();}export function getFolderPath(_0x47e15f,_0x17a44a){const _0x4499dc=a143_0x2298;if(!_0x47e15f)return'';return _0x17a44a[_0x4499dc(0xdb)](_0x47e15f)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4dd94d,_0xb12f83){const _0x25b50f=a144_0x106d,_0xad60f5=_0x4dd94d();while(!![]){try{const _0xec7b9c=-parseInt(_0x25b50f(0x131))/0x1+-parseInt(_0x25b50f(0x12f))/0x2*(-parseInt(_0x25b50f(0x122))/0x3)+parseInt(_0x25b50f(0x13e))/0x4+-parseInt(_0x25b50f(0x12e))/0x5*(-parseInt(_0x25b50f(0x144))/0x6)+-parseInt(_0x25b50f(0x13a))/0x7*(-parseInt(_0x25b50f(0x139))/0x8)+parseInt(_0x25b50f(0x137))/0x9+-parseInt(_0x25b50f(0x14a))/0xa;if(_0xec7b9c===_0xb12f83)break;else _0xad60f5['push'](_0xad60f5['shift']());}catch(_0x25a24d){_0xad60f5['push'](_0xad60f5['shift']());}}}(a144_0x1361,0xa70e1));import a144_0x5632e8 from'path';import{parse as a144_0x16818f}from'yaml';function a144_0x1361(){const _0x3d1ebf=['259770eYLqQV','Path\x20cannot\x20be\x20empty','name','Cannot\x20split\x20empty\x20path','raw','filter','root','substring','endsWith','test','isAbsolute','type','485dWoyCT','2ewjnNL','tdx.json','622305gvWeLQ','Cannot\x20navigate\x20above\x20root','trim','segments','readFile','relative','1546326KJVlhH','startsWith','518632vSzshE','77lHPXdN','join','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','length','1646224sxsfAS','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','resolve','push','.yml','Relative\x20path\x20cannot\x20be\x20empty','84192DxpHNk','replace','split','parse','pop','No\x20tdx.json\x20found\x20for\x20file:\x20','14376210qDHkxb','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','exists','slice','Path\x20segment\x20cannot\x20be\x20empty','journey'];a144_0x1361=function(){return _0x3d1ebf;};return a144_0x1361();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x215979){const _0x64d8e7=a144_0x106d;if(!_0x215979||_0x215979['trim']()==='')throw new Error(_0x64d8e7(0x123));const _0x1cbdc7=_0x215979[_0x64d8e7(0x133)]();if(_0x1cbdc7==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x215979};const _0x504b5e=_0x1cbdc7[_0x64d8e7(0x138)]('/')?_0x1cbdc7[_0x64d8e7(0x129)](0x1):_0x1cbdc7,_0x515701=_0x504b5e[_0x64d8e7(0x146)]('/')[_0x64d8e7(0x127)](_0x5e0f53=>_0x5e0f53!=='');if(_0x515701['length']===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x55f58b=_0x1cbdc7[_0x64d8e7(0x138)]('/')||!isRelativePathSegment(_0x515701[0x0]);for(const _0xac43f0 of _0x515701){validatePathSegment(_0xac43f0);}return{'segments':_0x515701,'isAbsolute':_0x55f58b,'raw':_0x215979};}function isRelativePathSegment(_0x22b14b){return _0x22b14b==='.'||_0x22b14b==='..';}function validatePathSegment(_0x4db287){const _0xf3e5d2=a144_0x106d;if(_0x4db287==='')throw new Error(_0xf3e5d2(0x120));if(_0x4db287==='.'||_0x4db287==='..')return;if(/[\x00-\x1F\x7F]/[_0xf3e5d2(0x12b)](_0x4db287))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x4db287);if(_0x4db287!==_0x4db287[_0xf3e5d2(0x133)]()){}}export function validatePath(_0x58c2ce){const _0x4c5f48=a144_0x106d;if(_0x58c2ce[_0x4c5f48(0x134)][_0x4c5f48(0x13d)]===0x0&&!_0x58c2ce[_0x4c5f48(0x12c)])throw new Error(_0x4c5f48(0x143));if(_0x58c2ce[_0x4c5f48(0x12c)]){if(_0x58c2ce[_0x4c5f48(0x134)][0x0]==='..')throw new Error(_0x4c5f48(0x14b));let _0x339bfe=0x0;for(const _0x219eec of _0x58c2ce[_0x4c5f48(0x134)]){if(_0x219eec==='..'){if(_0x339bfe===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x339bfe--;}else _0x219eec!=='.'&&_0x339bfe++;}}}function a144_0x106d(_0x2b9f2b,_0x3f446b){_0x2b9f2b=_0x2b9f2b-0x11f;const _0x1361bd=a144_0x1361();let _0x106dc4=_0x1361bd[_0x2b9f2b];return _0x106dc4;}export function joinPaths(_0x738496,_0x7fb17f){const _0x1f86a5=a144_0x106d;if(!_0x738496||_0x738496==='/')return _0x7fb17f;if(!_0x7fb17f||_0x7fb17f==='.')return _0x738496;if(_0x7fb17f[_0x1f86a5(0x138)]('/'))return _0x7fb17f;const _0x32df24=parsePath(_0x738496),_0x105258=parsePath(_0x7fb17f),_0x51f3c4=[..._0x32df24[_0x1f86a5(0x134)]];for(const _0x151e1e of _0x105258[_0x1f86a5(0x134)]){if(_0x151e1e==='.')continue;else{if(_0x151e1e==='..'){if(_0x51f3c4[_0x1f86a5(0x13d)]===0x0)throw new Error(_0x1f86a5(0x132));_0x51f3c4[_0x1f86a5(0x148)]();}else _0x51f3c4[_0x1f86a5(0x141)](_0x151e1e);}}const _0x28c61c=_0x51f3c4[_0x1f86a5(0x13b)]('/');return _0x32df24['raw']['startsWith']('/')?'/'+_0x28c61c:_0x28c61c;}export function normalizePath(_0x3b4a24){const _0x1d92e5=a144_0x106d,_0x13b2b8=parsePath(_0x3b4a24),_0x251547=[];for(const _0x17adda of _0x13b2b8[_0x1d92e5(0x134)]){if(_0x17adda==='.')continue;else{if(_0x17adda==='..'){if(_0x251547[_0x1d92e5(0x13d)]===0x0){if(_0x13b2b8[_0x1d92e5(0x12c)])throw new Error(_0x1d92e5(0x132));_0x251547[_0x1d92e5(0x141)]('..');}else _0x251547[_0x251547[_0x1d92e5(0x13d)]-0x1]==='..'?_0x251547[_0x1d92e5(0x141)]('..'):_0x251547[_0x1d92e5(0x148)]();}else _0x251547['push'](_0x17adda);}}if(_0x251547[_0x1d92e5(0x13d)]===0x0)return _0x13b2b8[_0x1d92e5(0x12c)]?'/':'.';const _0x3c8807=_0x251547['join']('/');return _0x13b2b8[_0x1d92e5(0x126)][_0x1d92e5(0x138)]('/')?'/'+_0x3c8807:_0x3c8807;}export function getParentPath(_0x15a9d2){const _0x18be58=a144_0x106d,_0x3ae165=parsePath(_0x15a9d2);if(_0x3ae165['segments'][_0x18be58(0x13d)]<=0x1)return'/';const _0x13d314=_0x3ae165[_0x18be58(0x134)][_0x18be58(0x11f)](0x0,-0x1)['join']('/');return _0x3ae165['raw'][_0x18be58(0x138)]('/')?'/'+_0x13d314:_0x13d314;}export function getBaseName(_0x5e7890){const _0x44ff46=a144_0x106d,_0x5645d2=parsePath(_0x5e7890);return _0x5645d2[_0x44ff46(0x134)][_0x5645d2['segments'][_0x44ff46(0x13d)]-0x1]||'';}export function isChildPath(_0x1f31f5,_0x16f107){const _0x35f891=a144_0x106d,_0xbcc8ec=parsePath(_0x1f31f5),_0x5761a5=parsePath(_0x16f107);if(_0xbcc8ec[_0x35f891(0x134)][_0x35f891(0x13d)]<=_0x5761a5[_0x35f891(0x134)][_0x35f891(0x13d)])return![];for(let _0x4fca1e=0x0;_0x4fca1e<_0x5761a5[_0x35f891(0x134)][_0x35f891(0x13d)];_0x4fca1e++){if(_0xbcc8ec[_0x35f891(0x134)][_0x4fca1e]!==_0x5761a5['segments'][_0x4fca1e])return![];}return!![];}export function splitPath(_0x1c6133){const _0x1d8a98=a144_0x106d,_0x1d4e48=parsePath(_0x1c6133);if(_0x1d4e48[_0x1d8a98(0x134)][_0x1d8a98(0x13d)]===0x0)throw new Error(_0x1d8a98(0x125));if(_0x1d4e48['segments'][_0x1d8a98(0x13d)]===0x1)return{'parent':_0x1d4e48['segments'][0x0]};return{'parent':_0x1d4e48[_0x1d8a98(0x134)][0x0],'child':_0x1d4e48[_0x1d8a98(0x134)][_0x1d8a98(0x11f)](0x1)[_0x1d8a98(0x13b)]('/')};}export function isYamlFilePath(_0x2e4f09){const _0x5302f3=a144_0x106d;return _0x2e4f09[_0x5302f3(0x12a)](_0x5302f3(0x142))||_0x2e4f09[_0x5302f3(0x12a)]('.yaml');}export async function resolveYamlFilePath(_0x5ce7a5,_0xcaa8=nodeFileSystem){const _0x27258d=a144_0x106d,_0x2a413d=a144_0x5632e8[_0x27258d(0x140)](_0x5ce7a5);if(!await _0xcaa8['exists'](_0x2a413d))throw new Error('File\x20not\x20found:\x20'+_0x5ce7a5);let _0x23df54=a144_0x5632e8['dirname'](_0x2a413d),_0x209e20=null,_0x32287a=null;const _0x55bad0=a144_0x5632e8[_0x27258d(0x147)](_0x23df54)[_0x27258d(0x128)];while(_0x23df54!==_0x55bad0){const _0x391d60=a144_0x5632e8[_0x27258d(0x13b)](_0x23df54,_0x27258d(0x130));if(await _0xcaa8[_0x27258d(0x14c)](_0x391d60)){_0x209e20=_0x391d60,_0x32287a=_0x23df54;break;}_0x23df54=a144_0x5632e8['dirname'](_0x23df54);}if(!_0x209e20||!_0x32287a)throw new Error(_0x27258d(0x149)+_0x5ce7a5+'\x0a'+_0x27258d(0x13c));const _0x37d4a3=await _0xcaa8['readFile'](_0x209e20),_0x2f5f92=JSON[_0x27258d(0x147)](_0x37d4a3),_0x25fb64=_0x2f5f92['parent_segment'];if(!_0x25fb64)throw new Error(_0x27258d(0x13f));const _0x181c97=await _0xcaa8[_0x27258d(0x135)](_0x2a413d),_0xacd358=a144_0x16818f(_0x181c97),_0x590f65=_0xacd358[_0x27258d(0x124)];if(!_0x590f65)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x5ce7a5);const _0x274b96=_0xacd358[_0x27258d(0x12d)]===_0x27258d(0x121)?_0x27258d(0x121):'segment',_0x10d25e=a144_0x5632e8[_0x27258d(0x136)](_0x32287a,_0x2a413d),_0x4362d0=a144_0x5632e8['dirname'](_0x10d25e),_0x5d822b=_0x4362d0==='.'?'':_0x4362d0[_0x27258d(0x145)](/\\/g,'/'),_0x546d05=_0x5d822b?_0x25fb64+'/'+_0x5d822b+'/'+_0x590f65:_0x25fb64+'/'+_0x590f65;return{'parentSegment':_0x25fb64,'segmentName':_0x590f65,'folderPath':_0x5d822b,'fullPath':_0x546d05,'resourceType':_0x274b96,'content':_0x181c97};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x202621,_0x388872){const _0x36464e=a145_0x4178,_0x1e1a5f=_0x202621();while(!![]){try{const _0x8fbe38=-parseInt(_0x36464e(0x1ca))/0x1+-parseInt(_0x36464e(0x1c8))/0x2*(parseInt(_0x36464e(0x1c7))/0x3)+parseInt(_0x36464e(0x1c2))/0x4+-parseInt(_0x36464e(0x1c6))/0x5*(-parseInt(_0x36464e(0x1c9))/0x6)+parseInt(_0x36464e(0x1c1))/0x7+-parseInt(_0x36464e(0x1c4))/0x8*(-parseInt(_0x36464e(0x1cd))/0x9)+-parseInt(_0x36464e(0x1c5))/0xa;if(_0x8fbe38===_0x388872)break;else _0x1e1a5f['push'](_0x1e1a5f['shift']());}catch(_0x3f1d01){_0x1e1a5f['push'](_0x1e1a5f['shift']());}}}(a145_0x27b2,0x6f139));function a145_0x4178(_0x33cf80,_0x288565){_0x33cf80=_0x33cf80-0x1c1;const _0x27b239=a145_0x27b2();let _0x417886=_0x27b239[_0x33cf80];return _0x417886;}function a145_0x27b2(){const _0x23488c=['825186KhWIia','Invalid\x20segment\x20reference\x20format:\x20','.\x20Child\x20name\x20cannot\x20be\x20empty','121833pAlxip','6051395FRDXJa','1543600BYGXFV','substring','168SNXasq','7775460SZiAhv','1938375EKVaYg','573NxyOix','2642fnLfzv','12KEJTnU'];a145_0x27b2=function(){return _0x23488c;};return a145_0x27b2();}export function parseSegmentRef(_0x266d9c){const _0x18503a=a145_0x4178,_0xc95caa=_0x266d9c['indexOf']('/');if(_0xc95caa===-0x1)return{'parentId':_0x266d9c};if(_0xc95caa===0x0)throw new Error(_0x18503a(0x1cb)+_0x266d9c+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x2e6523=_0x266d9c[_0x18503a(0x1c3)](0x0,_0xc95caa),_0x5d2529=_0x266d9c[_0x18503a(0x1c3)](_0xc95caa+0x1);if(_0x5d2529==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x266d9c+_0x18503a(0x1cc));return{'parentId':_0x2e6523,'childId':_0x5d2529};}
|