@treasuredata/tdx 2026.3.10 → 2026.3.12
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/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/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
|
+
(function(_0x26708d,_0x5e983a){const _0x1a7ed6=a139_0x47b4,_0x19a909=_0x26708d();while(!![]){try{const _0x31ebeb=-parseInt(_0x1a7ed6(0x12f))/0x1+-parseInt(_0x1a7ed6(0x132))/0x2+-parseInt(_0x1a7ed6(0x135))/0x3+-parseInt(_0x1a7ed6(0x131))/0x4+parseInt(_0x1a7ed6(0x134))/0x5*(parseInt(_0x1a7ed6(0x13f))/0x6)+-parseInt(_0x1a7ed6(0x144))/0x7*(parseInt(_0x1a7ed6(0x133))/0x8)+parseInt(_0x1a7ed6(0x143))/0x9;if(_0x31ebeb===_0x5e983a)break;else _0x19a909['push'](_0x19a909['shift']());}catch(_0x15cae5){_0x19a909['push'](_0x19a909['shift']());}}}(a139_0x6853,0x87e1d));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a139_0x162611 from'path';import{Logger}from'../../utils/logger/index.js';function a139_0x47b4(_0x45566f,_0x1ce82f){_0x45566f=_0x45566f-0x12d;const _0x6853d8=a139_0x6853();let _0x47b40f=_0x6853d8[_0x45566f];return _0x47b40f;}const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x1598f4){const _0xbfc7da=a139_0x47b4,_0x5b8f00=a139_0x162611['dirname'](_0x1598f4),_0xa508ce=a139_0x162611[_0xbfc7da(0x139)](_0x1598f4);return a139_0x162611[_0xbfc7da(0x13a)](_0x5b8f00,'.'+_0xa508ce+_0xbfc7da(0x136));}export function readPushRecovery(_0x4b20d4){const _0x39a7dc=a139_0x47b4,_0x4a1451=getPushRecoveryPath(_0x4b20d4);if(!existsSync(_0x4a1451))return undefined;try{const _0xa0f7be=readFileSync(_0x4a1451,_0x39a7dc(0x141)),_0x4b7bda=JSON['parse'](_0xa0f7be);if(_0x4b7bda?.[_0x39a7dc(0x13b)]!==0x1||typeof _0x4b7bda[_0x39a7dc(0x130)]!==_0x39a7dc(0x12d))return undefined;return _0x4b7bda;}catch(_0x588fbd){return _0x588fbd instanceof SyntaxError?logger[_0x39a7dc(0x137)](_0x39a7dc(0x13e)+_0x588fbd):logger['warn'](_0x39a7dc(0x13d)+_0x588fbd),undefined;}}export function writePushRecovery(_0x390380,_0x18129f){const _0xc9515b=a139_0x47b4,_0x31a21e=getPushRecoveryPath(_0x390380),_0x5e66ac=_0x31a21e+'.tmp';writeFileSync(_0x5e66ac,JSON[_0xc9515b(0x13c)](_0x18129f,null,0x2)+'\x0a','utf-8'),renameSync(_0x5e66ac,_0x31a21e);}export function deletePushRecovery(_0x10e655){const _0x13fe4e=a139_0x47b4,_0x4d8973=getPushRecoveryPath(_0x10e655);try{unlinkSync(_0x4d8973);}catch(_0x3b94be){_0x3b94be[_0x13fe4e(0x140)]!==_0x13fe4e(0x142)&&logger['debug'](_0x13fe4e(0x138)+_0x3b94be);}}export function saveSegmentToPushRecovery(_0x1417a8,_0x1f3b49,_0x2a46bf,_0x5c47f8){const _0x21340a=a139_0x47b4,_0x5eca65=readPushRecovery(_0x1417a8),_0x55260e=_0x5eca65?.['journeyName']===_0x1f3b49?{..._0x5eca65,'updatedAt':new Date()[_0x21340a(0x12e)]()}:{'version':0x1,'journeyName':_0x1f3b49,'updatedAt':new Date()[_0x21340a(0x12e)](),'segments':{}};_0x55260e['segments'][_0x2a46bf]=_0x5c47f8,writePushRecovery(_0x1417a8,_0x55260e);}function a139_0x6853(){const _0x2d503b=['3261159IssKFn','.push-recovery.json','debug','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','basename','join','version','stringify','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','1936428kxpAhv','code','utf-8','ENOENT','22204179TcNwPn','389641qJZJAM','string','toISOString','291794qzjCHu','journeyName','1910944TJPQsd','530774nKtyqz','16uMqxmP','5qNjVjn'];a139_0x6853=function(){return _0x2d503b;};return a139_0x6853();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a140_0x2d1abb=a140_0x4f0a;(function(_0x17d107,_0x5ac681){const _0x4314b4=a140_0x4f0a,_0x25fd71=_0x17d107();while(!![]){try{const _0x2aba09=parseInt(_0x4314b4(0x15c))/0x1*(-parseInt(_0x4314b4(0x19b))/0x2)+parseInt(_0x4314b4(0x154))/0x3+-parseInt(_0x4314b4(0x1b7))/0x4*(-parseInt(_0x4314b4(0x1e5))/0x5)+-parseInt(_0x4314b4(0x1c0))/0x6+parseInt(_0x4314b4(0x235))/0x7+-parseInt(_0x4314b4(0x1b4))/0x8+parseInt(_0x4314b4(0x1ee))/0x9*(-parseInt(_0x4314b4(0x166))/0xa);if(_0x2aba09===_0x5ac681)break;else _0x25fd71['push'](_0x25fd71['shift']());}catch(_0x1cba8f){_0x25fd71['push'](_0x25fd71['shift']());}}}(a140_0x51ab,0x2310b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');function a140_0x4f0a(_0x19048e,_0x1c740a){_0x19048e=_0x19048e-0x14b;const _0x51ab77=a140_0x51ab();let _0x4f0aac=_0x51ab77[_0x19048e];return _0x4f0aac;}export const PENDING_SEGMENT_PREFIX=a140_0x2d1abb(0x217);export const PENDING_ACTIVATION_PREFIX=a140_0x2d1abb(0x1e9);export function createPendingSegmentId(_0x4cb505){return''+PENDING_SEGMENT_PREFIX+_0x4cb505+'__';}export function isPendingSegmentId(_0x39ef9f){return _0x39ef9f['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x39ef9f['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x34aeed){const _0x42d5af=a140_0x2d1abb;return _0x34aeed[_0x42d5af(0x180)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4c8225){return''+PENDING_ACTIVATION_PREFIX+_0x4c8225+'__';}export function isPendingActivationId(_0x21c8fc){return _0x21c8fc['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3100f6){const _0x24e634=a140_0x2d1abb;return _0x3100f6[_0x24e634(0x180)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5cc3b6,_0x316c71){const _0x4f4fa0=a140_0x2d1abb,_0x291c9f=_0x5cc3b6+'::'+(_0x316c71['trim']()||_0x4f4fa0(0x150)),_0x4dfc3f=createHash(_0x4f4fa0(0x14b))[_0x4f4fa0(0x1db)](_0x291c9f)['digest'](_0x4f4fa0(0x1af))[_0x4f4fa0(0x17d)](0x0,0xc);return _0x4f4fa0(0x1c2)+_0x4dfc3f;}export function ensureJourneyDefaults(_0x2a7855){const _0x2a838f=a140_0x2d1abb;!_0x2a7855[_0x2a838f(0x170)]&&(_0x2a7855[_0x2a838f(0x170)]=''),!_0x2a7855[_0x2a838f(0x1e3)]&&(_0x2a7855[_0x2a838f(0x1e3)]='draft');}export function injectExistingStageIds(_0x51ce3b,_0x48eede){const _0x2f1873=a140_0x2d1abb,_0x1d9f5c=new Map(_0x48eede[_0x2f1873(0x1d7)](_0x37f3d1=>[_0x37f3d1[_0x2f1873(0x1d5)],_0x37f3d1['id']]));for(const _0xf76242 of _0x51ce3b){if(!_0xf76242['id']){const _0x1110a6=_0x1d9f5c[_0x2f1873(0x160)](_0xf76242[_0x2f1873(0x1d5)]);_0x1110a6&&(_0xf76242['id']=_0x1110a6);}}}export function resolveTDFolderPath(_0x337673,_0x2a7ba1,_0x26a0c8){const _0x3a1f70=a140_0x2d1abb;if(!_0x2a7ba1)return _0x337673;if(_0x337673===_0x26a0c8||_0x337673[_0x3a1f70(0x19a)](_0x26a0c8+'/'))return _0x337673;return _0x337673?_0x26a0c8+'/'+_0x337673:_0x26a0c8;}export function addFoldersToCreate(_0x1f3986,_0xba9299,_0x29e754){const _0x3649ab=a140_0x2d1abb;if(!_0x1f3986)return;if(_0xba9299['has'](_0x1f3986))return;const _0x1b8226=_0x1f3986[_0x3649ab(0x1b0)]('/');let _0xbcb191='';for(const _0xac21a5 of _0x1b8226){_0xbcb191=_0xbcb191?_0xbcb191+'/'+_0xac21a5:_0xac21a5,!_0xba9299[_0x3649ab(0x1aa)](_0xbcb191)&&_0x29e754[_0x3649ab(0x1c7)](_0xbcb191);}}export function sortFoldersByDepth(_0x3a1ff4){const _0x3b4b33=a140_0x2d1abb;return[..._0x3a1ff4][_0x3b4b33(0x176)]((_0x441ade,_0x2783fe)=>{const _0x16744e=_0x3b4b33,_0x1b81b3=(_0x441ade[_0x16744e(0x22a)](/\//g)||[])[_0x16744e(0x1b5)],_0x41dbf3=(_0x2783fe[_0x16744e(0x22a)](/\//g)||[])[_0x16744e(0x1b5)];return _0x1b81b3-_0x41dbf3;});}import*as a140_0x399a39 from'yaml';import{readFileSync}from'fs';import a140_0x41e71e from'path';import{isJourneyDef,parseYamlString as a140_0x10dfcc,toYamlString as a140_0x5cd287,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(_0x29f385){const _0x44d552=a140_0x2d1abb;if(Array[_0x44d552(0x189)](_0x29f385))return'['+_0x29f385[_0x44d552(0x1d7)](_0x60d66c=>stableStringify(_0x60d66c))[_0x44d552(0x181)](',')+']';if(_0x29f385&&typeof _0x29f385===_0x44d552(0x234)){const _0x275046=_0x29f385,_0x1256dc=Object[_0x44d552(0x244)](_0x275046)[_0x44d552(0x176)](),_0x9ddc4=_0x1256dc[_0x44d552(0x1d7)](_0x243f21=>'\x22'+_0x243f21+'\x22:'+stableStringify(_0x275046[_0x243f21]));return'{'+_0x9ddc4['join'](',')+'}';}const _0x3ecf2e=JSON[_0x44d552(0x21f)](_0x29f385);return _0x3ecf2e===undefined?_0x44d552(0x212):_0x3ecf2e;}function activationSignature(_0x56272d){const _0x161b3a=a140_0x2d1abb,_0x29d988={'connection':_0x56272d[_0x161b3a(0x161)],..._0x56272d['all_columns']!==undefined&&{'all_columns':_0x56272d[_0x161b3a(0x186)]},..._0x56272d[_0x161b3a(0x15e)]!==undefined&&{'columns':_0x56272d[_0x161b3a(0x15e)]},..._0x56272d[_0x161b3a(0x184)]!==undefined&&{'behavior':_0x56272d[_0x161b3a(0x184)]},..._0x56272d[_0x161b3a(0x1ec)]!==undefined&&{'schedule':_0x56272d[_0x161b3a(0x1ec)]},..._0x56272d[_0x161b3a(0x1e4)]!==undefined&&{'notification':_0x56272d[_0x161b3a(0x1e4)]},..._0x56272d[_0x161b3a(0x1a8)]!==undefined&&{'connector_config':_0x56272d[_0x161b3a(0x1a8)]},..._0x56272d[_0x161b3a(0x1b8)]!==undefined&&{'activation_template_id':_0x56272d[_0x161b3a(0x1b8)]}};return stableStringify(_0x29d988);}async function fetchSegment(_0x42c57d,_0x265668,_0x561329,_0x12c67b){const _0x1f3517=a140_0x2d1abb,_0x125e07=_0x12c67b?.[_0x1f3517(0x1ba)](_0x347d45=>_0x347d45['id']===_0x561329);if(_0x125e07)return _0x125e07;try{return await _0x42c57d[_0x1f3517(0x150)][_0x1f3517(0x1cd)](_0x265668,_0x561329);}catch(_0x10f2de){logger[_0x1f3517(0x1ab)](_0x1f3517(0x1da)+_0x561329+_0x1f3517(0x216)+_0x10f2de);try{return await _0x42c57d[_0x1f3517(0x150)][_0x1f3517(0x1ae)](_0x561329);}catch(_0x34435a){return logger[_0x1f3517(0x1ab)](_0x1f3517(0x207)+_0x561329+':\x20'+_0x34435a),null;}}}function recoverSegmentIdsFromPushRecovery(_0x51272c,_0x5314ef,_0x46fb7f){const _0x400571=a140_0x2d1abb,_0x3293e0=readPushRecovery(_0x51272c[_0x400571(0x238)]);if(_0x3293e0?.[_0x400571(0x17a)]===_0x51272c['yamlConfig']['name'])for(const [_0x540d29,_0x5b6164]of Object['entries'](_0x3293e0['segments'])){const _0x1892df=generateDeterministicJourneySegmentName(_0x51272c['yamlConfig'][_0x400571(0x1d5)],_0x540d29);_0x5b6164[_0x400571(0x1bb)]===_0x1892df&&(_0x5314ef['set'](_0x540d29,_0x5b6164[_0x400571(0x231)]),_0x46fb7f[_0x400571(0x1cf)](_0x540d29,_0x5b6164[_0x400571(0x231)]));}}async function createOrRecoverEmbeddedSegment(_0x3711a1,_0x3e2524,_0x3882f1,_0x321a42){const _0xe4877d=a140_0x2d1abb;let _0x55f49c;try{_0x55f49c=await _0x3711a1[_0xe4877d(0x150)]['createJourneySegment']({'name':_0x3882f1[_0xe4877d(0x215)],'description':_0x3882f1[_0xe4877d(0x170)],'journeyId':_0x3882f1[_0xe4877d(0x1fe)],'rule':_0x321a42(_0x3882f1[_0xe4877d(0x204)],!![]),'countPopulation':!![],'parentFolderId':_0x3882f1[_0xe4877d(0x174)],'audienceId':_0x3882f1[_0xe4877d(0x1c5)]});}catch(_0x2d98da){const _0x22162d=_0x2d98da instanceof Error&&_0x2d98da[_0xe4877d(0x1b1)][_0xe4877d(0x1a4)]('Name\x20has\x20already\x20been\x20taken');if(_0x22162d){const _0x23f125=readPushRecovery(_0x3e2524[_0xe4877d(0x238)]),_0x56ec50=_0x23f125?.[_0xe4877d(0x17a)]===_0x3e2524[_0xe4877d(0x165)]['name']?_0x23f125[_0xe4877d(0x1c8)][_0x3882f1['localName']]:undefined;if(_0x56ec50?.[_0xe4877d(0x1bb)]===_0x3882f1['uniqueSegmentName'])await _0x3711a1['segment']['updateSegmentById'](_0x3882f1[_0xe4877d(0x1c5)],_0x56ec50[_0xe4877d(0x231)],{'description':_0x3882f1[_0xe4877d(0x170)],'rule':_0x321a42(_0x3882f1[_0xe4877d(0x204)],!![]),'countPopulation':!![]}),_0x55f49c=_0x56ec50[_0xe4877d(0x231)];else throw new SDKError(ErrorCode[_0xe4877d(0x1eb)],'Embedded\x20segment\x20\x27'+_0x3882f1[_0xe4877d(0x20c)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0xe4877d(0x1c1)+_0x3e2524['absolutePath'][_0xe4877d(0x180)](/([^/]+)$/,_0xe4877d(0x21b))+')\x20')+_0xe4877d(0x17f),_0x2d98da);}else throw _0x2d98da;}return saveSegmentToPushRecovery(_0x3e2524[_0xe4877d(0x238)],_0x3e2524[_0xe4877d(0x165)][_0xe4877d(0x1d5)],_0x3882f1[_0xe4877d(0x20c)],{'segmentId':_0x55f49c,'uniqueServerName':_0x3882f1[_0xe4877d(0x215)],'createdAt':new Date()[_0xe4877d(0x211)]()}),_0x55f49c;}export async function prepareSegmentFiles(_0x38489c,_0x35e42b,_0xf32b9c,_0x43f837,_0x3ed55d){const _0x3550d0=a140_0x2d1abb,{activationDefToCreateRequest:_0x190369}=await import(_0x3550d0(0x205)),_0x3a37f5=[],_0x285166=new Set();for(const {yamlConfig:_0x35436d,folderPath:_0x58bd76,sourcePath:_0x4c4110}of _0x38489c){const _0x8bcf5c=resolveTDFolderPath(_0x58bd76,_0x43f837,_0x3ed55d),_0x2e1fa2=_0x8bcf5c+':'+_0x35436d['name'],_0x492777=_0x35e42b[_0x3550d0(0x1dc)][_0x3550d0(0x160)](_0x2e1fa2),_0x1b63de=_0x492777?_0x35e42b[_0x3550d0(0x20f)][_0x3550d0(0x160)](_0x492777['id'])||[]:[];addFoldersToCreate(_0x8bcf5c,_0x35e42b['folderPathToId'],_0x285166);const _0x760598=calculateActivationActions(_0x35436d['activations']||[],_0x1b63de,_0x35e42b['idToEmailMap'],_0x35e42b[_0x3550d0(0x1a2)]);for(const _0x54063d of _0x760598){(_0x54063d[_0x3550d0(0x19d)]==='create'||_0x54063d[_0x3550d0(0x19d)]===_0x3550d0(0x1db))&&_0x54063d[_0x3550d0(0x224)]&&(_0x54063d['validatedRequest']=await _0x190369(_0x54063d[_0x3550d0(0x224)],_0xf32b9c));}const _0x31159f=calculateSegmentDiff(_0x35436d,_0x492777,_0x1b63de,_0x35e42b[_0x3550d0(0x18e)],_0x35e42b[_0x3550d0(0x1a2)]);_0x3a37f5[_0x3550d0(0x243)]({'relativePath':_0x35436d[_0x3550d0(0x1d5)],'absolutePath':_0x4c4110,'yamlConfig':_0x35436d,'folderPath':_0x8bcf5c,'existingSegment':_0x492777,'existingActivations':_0x1b63de,'isNew':_0x31159f[_0x3550d0(0x17b)],'hasChanges':_0x31159f['hasChanges'],'diff':_0x31159f[_0x3550d0(0x169)],'activationActions':_0x760598});}return{'segmentFiles':_0x3a37f5,'foldersToCreate':_0x285166};}export async function prepareJourneyFiles(_0x315f83,_0xdb0a83,_0xb392dd,_0x2409e9){const _0x4aeb7c=a140_0x2d1abb,_0xd09aa5=[],_0x1278c6=new Set();for(const {yamlConfig:_0x39a6b2,folderPath:_0x4ede34,sourcePath:_0x1ce51a}of _0x315f83){const _0x567d0e=resolveTDFolderPath(_0x4ede34,_0xb392dd,_0x2409e9),_0x561230=_0x567d0e+':'+_0x39a6b2[_0x4aeb7c(0x1d5)],_0x21fbd0=_0xdb0a83[_0x4aeb7c(0x1fa)][_0x4aeb7c(0x160)](_0x561230);let _0x3d0fa8,_0x21099b;if(_0x21fbd0&&_0x21fbd0['length']>0x0){const _0x1908ef=buildLocalExpandedRuleMappings(_0x39a6b2),{createYamlContext:_0x36a3e9,prefetchJourneySegments:_0x13c03d}=createPushYamlContextForBundle(_0xdb0a83[_0x4aeb7c(0x1c6)],_0xdb0a83['parentId'],_0xdb0a83['existingSegments'],_0x1908ef,_0xdb0a83[_0x4aeb7c(0x18e)],_0xdb0a83[_0x4aeb7c(0x1a2)],_0xdb0a83[_0x4aeb7c(0x23a)],_0xdb0a83[_0x4aeb7c(0x226)]);await _0x13c03d(_0x21fbd0['map'](_0x1fb5bf=>_0x1fb5bf['id']));const _0x2c4cc0=await _0xdb0a83[_0x4aeb7c(0x1c6)][_0x4aeb7c(0x151)][_0x4aeb7c(0x15b)](_0x21fbd0[0x0][_0x4aeb7c(0x157)]),_0x34cd59=hasMultipleVersions(_0x39a6b2),_0x1b0936=async _0x428844=>{const _0x40d250=_0x4aeb7c,_0x55a1b1=_0xdb0a83[_0x40d250(0x226)]?.['get'](_0x428844);if(_0x55a1b1)return _0x55a1b1;return _0xdb0a83['fetchJourney']({'journeyId':_0x428844,'journeyName':_0x39a6b2[_0x40d250(0x1d5)],'isMultiVersion':_0x21fbd0[_0x40d250(0x1b5)]>0x1});};if(_0x34cd59&&_0x21fbd0['length']>0x1){const _0x5a1081=[];for(const _0x187181 of _0x21fbd0){const _0x37c510=_0x187181[_0x4aeb7c(0x1bd)]||0x1;_0xdb0a83[_0x4aeb7c(0x14d)]?.['update'](_0x4aeb7c(0x214)+_0x39a6b2[_0x4aeb7c(0x1d5)]+'\x20v'+_0x37c510);const _0xa7d03b=await _0x1b0936(_0x187181['id']),_0xe9b6b1=_0x36a3e9(_0x187181['id']),_0x264bdb=await journeyResponseToDef(_0xa7d03b,_0xe9b6b1);_0x5a1081[_0x4aeb7c(0x243)]({'item':_0x187181,'yaml':_0x264bdb});}const _0x2268d6=buildLocalRuleToNameMappingFromJourney(_0x39a6b2);_0x21099b=buildMergedJourneyDef(_0x5a1081,_0x2268d6,_0x2c4cc0);const _0x5a68d0=Math[_0x4aeb7c(0x1a7)](..._0x5a1081[_0x4aeb7c(0x1d7)](_0x39decf=>_0x39decf[_0x4aeb7c(0x187)]['versionNumber']||0x0)),_0x260e47=_0x21fbd0['find'](_0x14e7d1=>(_0x14e7d1[_0x4aeb7c(0x1bd)]||0x0)===_0x5a68d0);_0x260e47&&(_0xdb0a83[_0x4aeb7c(0x14d)]?.[_0x4aeb7c(0x1db)](_0x4aeb7c(0x214)+_0x39a6b2[_0x4aeb7c(0x1d5)]+'\x20v'+_0x5a68d0),_0x3d0fa8=await _0x1b0936(_0x260e47['id']));}else{const _0x23ac0a=_0x21fbd0[_0x21fbd0[_0x4aeb7c(0x1b5)]-0x1];_0xdb0a83['progress']?.[_0x4aeb7c(0x1db)]('Fetching\x20'+_0x39a6b2[_0x4aeb7c(0x1d5)]),_0x3d0fa8=await _0x1b0936(_0x23ac0a['id']);const _0x34cb58=_0x36a3e9(_0x23ac0a['id']),_0x4e75ac=await journeyResponseToDef(_0x3d0fa8,_0x34cb58),_0xb25070=buildLocalRuleToNameMappingFromJourney(_0x39a6b2);_0x21099b=buildMergedJourneyDef([{'item':_0x23ac0a,'yaml':_0x4e75ac}],_0xb25070,_0x2c4cc0);}}addFoldersToCreate(_0x567d0e,_0xdb0a83[_0x4aeb7c(0x18d)],_0x1278c6);const _0xae0213=calculateJourneyDiff(_0x39a6b2,_0x21099b);_0xd09aa5['push']({'relativePath':_0x39a6b2[_0x4aeb7c(0x1d5)],'absolutePath':_0x1ce51a,'yamlConfig':_0x39a6b2,'folderPath':_0x567d0e,'existingJourney':_0x3d0fa8,'isNew':_0xae0213['isNew'],'hasChanges':_0xae0213[_0x4aeb7c(0x21d)],'diff':_0xae0213[_0x4aeb7c(0x169)]});}return{'journeyFiles':_0xd09aa5,'foldersToCreate':_0x1278c6};}export function calculateActivationActions(_0x25b621,_0x8f7e5f,_0xb05d68,_0x2b4f25){const _0x20e202=a140_0x2d1abb,_0x2ecd5e=[],_0x25db60=new Map();for(const _0x313c01 of _0x8f7e5f){_0x25db60[_0x20e202(0x1cf)](_0x313c01[_0x20e202(0x1d5)],_0x313c01);}const _0x4b234a=new Map();for(const _0x83f8db of _0x25b621){_0x4b234a[_0x20e202(0x1cf)](_0x83f8db[_0x20e202(0x1d5)],_0x83f8db);}for(const _0x4ee322 of _0x25b621){const _0x1c08ba=_0x25db60[_0x20e202(0x160)](_0x4ee322[_0x20e202(0x1d5)]);if(!_0x1c08ba)_0x2ecd5e['push']({'type':'create','name':_0x4ee322[_0x20e202(0x1d5)],'yamlActivation':_0x4ee322});else{const _0x45be25=activationResponseToDef(_0x1c08ba,_0xb05d68,_0x2b4f25),_0x8cd9c4=a140_0x399a39[_0x20e202(0x21f)](_0x45be25),_0x1688ba=a140_0x399a39[_0x20e202(0x21f)](_0x4ee322);_0x8cd9c4!==_0x1688ba&&_0x2ecd5e['push']({'type':_0x20e202(0x1db),'name':_0x4ee322[_0x20e202(0x1d5)],'yamlActivation':_0x4ee322,'existingActivation':_0x1c08ba});}}for(const _0x484818 of _0x8f7e5f){!_0x4b234a[_0x20e202(0x1aa)](_0x484818['name'])&&_0x2ecd5e[_0x20e202(0x243)]({'type':_0x20e202(0x22b),'name':_0x484818[_0x20e202(0x1d5)],'existingActivation':_0x484818});}return _0x2ecd5e;}function calculateYamlDiff(_0x5eb8ce,_0xdea241){if(_0xdea241){const _0x277967=generateDiff(_0xdea241,_0x5eb8ce),_0x1d6eb2=hasChanges(_0x277967);return{'isNew':![],'hasChanges':_0x1d6eb2,'diff':_0x1d6eb2?formatDiffWithColors(_0x277967):undefined};}const _0x1215f3=generateDiff('',_0x5eb8ce);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1215f3)};}export function calculateSegmentDiff(_0x4c0845,_0x19a54d,_0x34c59c,_0x39caf5,_0x10e428){const _0x4dff77=segmentToYamlString(_0x4c0845),_0x8c9dd7=_0x19a54d?segmentToYamlString(segmentWithActivationsToYaml(_0x19a54d,_0x34c59c,undefined,_0x39caf5,_0x10e428)):undefined;return calculateYamlDiff(_0x4dff77,_0x8c9dd7);}export function calculateJourneyDiff(_0x5ec0b3,_0x45796f){const _0x331b5e=normalizeJourneyDef(_0x5ec0b3,_0x5ec0b3),_0x433646=a140_0x5cd287(_0x331b5e),_0xd29c20=_0x45796f?a140_0x5cd287(normalizeJourneyDef(_0x45796f,_0x5ec0b3)):undefined;return calculateYamlDiff(_0x433646,_0xd29c20);}export function findSegmentsToDelete(_0x4d9319,_0x366758,_0xc323a1,_0x1dceae,_0x50ff27){const _0x235f8c=a140_0x2d1abb,_0x437c70=new Set();for(const {yamlConfig:_0x4bc0f1,folderPath:_0x3c1710}of _0x366758){_0x437c70[_0x235f8c(0x1c7)](_0x3c1710+':'+_0x4bc0f1[_0x235f8c(0x1d5)]);}return _0x4d9319[_0x235f8c(0x177)](_0x95a200=>{const _0x29c419=_0x235f8c,_0x5a6021=_0x95a200[_0x29c419(0x1e8)]?_0xc323a1[_0x29c419(0x160)](_0x95a200['segmentFolderId'][_0x29c419(0x1f9)]())||'':'',_0x5ee9f7=_0x5a6021+':'+_0x95a200[_0x29c419(0x1d5)];if(_0x437c70[_0x29c419(0x1aa)](_0x5ee9f7))return![];if(_0x50ff27)return _0x5a6021===_0x1dceae||_0x5a6021[_0x29c419(0x19a)](_0x1dceae+'/');return!![];});}export function findJourneysToDelete(_0x236e1a,_0x381632,_0x481be7,_0x1a6933,_0x59bdff){const _0x5b570f=a140_0x2d1abb,_0x53d94d=new Set();for(const {yamlConfig:_0x3202d8,folderPath:_0x1f1b22}of _0x381632){_0x53d94d[_0x5b570f(0x1c7)](_0x1f1b22+':'+_0x3202d8['name']);}return _0x236e1a[_0x5b570f(0x177)](_0x2503f6=>{const _0x159e5d=_0x5b570f,_0x115488=_0x2503f6['folderId']?_0x481be7[_0x159e5d(0x160)](_0x2503f6[_0x159e5d(0x174)])||'':'',_0x54d671=_0x115488+':'+_0x2503f6['journeyBundleName'];if(_0x53d94d['has'](_0x54d671))return![];if(_0x59bdff)return _0x115488===_0x1a6933||_0x115488[_0x159e5d(0x19a)](_0x1a6933+'/');return!![];});}export function buildSegmentLookupMap(_0x180493,_0x28fdb9){const _0x1e4473=a140_0x2d1abb,_0x21dae8=new Map();for(const _0x4f49f9 of _0x180493){const _0x3aaf4b=_0x4f49f9[_0x1e4473(0x1e8)]?_0x28fdb9['get'](_0x4f49f9['segmentFolderId']['toString']())||'':'',_0x55fd88=_0x3aaf4b+':'+_0x4f49f9[_0x1e4473(0x1d5)];_0x21dae8[_0x1e4473(0x1cf)](_0x55fd88,_0x4f49f9);}return _0x21dae8;}export function buildSegmentNameToIdMap(_0x3ed6eb){const _0x5ca1b6=a140_0x2d1abb,_0x1583e1=new Map();for(const _0xa49957 of _0x3ed6eb){_0x1583e1[_0x5ca1b6(0x1cf)](_0xa49957[_0x5ca1b6(0x1d5)],_0xa49957['id']);}return _0x1583e1;}export function buildJourneyBundleLookupMap(_0x46f0f3,_0x501989){const _0x36e604=a140_0x2d1abb,_0x5bc211=new Map();for(const _0x3717b4 of _0x46f0f3){const _0x167abd=_0x3717b4[_0x36e604(0x174)]?_0x501989['get'](_0x3717b4[_0x36e604(0x174)])||'':'',_0x79ce1e=_0x167abd+':'+_0x3717b4[_0x36e604(0x1f4)];!_0x5bc211[_0x36e604(0x1aa)](_0x79ce1e)&&_0x5bc211['set'](_0x79ce1e,[]),_0x5bc211[_0x36e604(0x160)](_0x79ce1e)[_0x36e604(0x243)](_0x3717b4);}for(const _0x2702f4 of _0x5bc211['values']()){_0x2702f4[_0x36e604(0x176)]((_0xe7e349,_0x3bf2ff)=>(_0xe7e349[_0x36e604(0x1bd)]||0x0)-(_0x3bf2ff[_0x36e604(0x1bd)]||0x0));}return _0x5bc211;}export function collectFoldersToCreate(_0x547019,_0x22b17f){const _0x2c47ed=a140_0x2d1abb,_0x62977=new Set();for(const _0x171212 of _0x547019){if(!_0x171212)continue;if(_0x22b17f[_0x2c47ed(0x1aa)](_0x171212))continue;const _0x31455a=_0x171212[_0x2c47ed(0x1b0)]('/');let _0x26280e='';for(const _0x440bed of _0x31455a){_0x26280e=_0x26280e?_0x26280e+'/'+_0x440bed:_0x440bed,!_0x22b17f[_0x2c47ed(0x1aa)](_0x26280e)&&_0x62977[_0x2c47ed(0x1c7)](_0x26280e);}}return _0x62977;}export function parseAndClassifyYamlFiles(_0x369b56,_0x48973a,_0x5ca331){const _0x1e7de3=a140_0x2d1abb,_0x357109=[],_0x3e0953=[];for(const _0x1debe3 of _0x369b56){const _0x541394=a140_0x41e71e[_0x1e7de3(0x23e)](_0x48973a,a140_0x41e71e[_0x1e7de3(0x1e7)](_0x1debe3)),_0x22a67e=_0x541394==='.'?'':_0x541394,_0xe7eab7=readFileSync(_0x1debe3,_0x1e7de3(0x1d4)),_0x54a640=a140_0x399a39[_0x1e7de3(0x1e0)](_0xe7eab7);if(isJourneyDef(_0x54a640)){const _0x34b851=a140_0x10dfcc(_0xe7eab7);_0x3e0953[_0x1e7de3(0x243)]({'yamlConfig':_0x34b851,'folderPath':_0x22a67e,'sourcePath':_0x1debe3});}else{if(!_0x5ca331?.['skipSegments']){const _0x4446cf=parseSegmentYamlFile(_0xe7eab7),_0x125163=normalizeChildSegmentYaml(_0x4446cf);_0x357109[_0x1e7de3(0x243)]({'yamlConfig':_0x125163,'folderPath':_0x22a67e,'sourcePath':_0x1debe3});}}}return{'segments':_0x357109,'journeys':_0x3e0953};}export function validateParsedFiles(_0x10c897,_0x4dee41){const _0x1334f3=a140_0x2d1abb,_0x260ed8=[];for(const {yamlConfig:_0xd48d8,sourcePath:_0x33e531}of _0x10c897['segments']){const _0x50d5f5=readFileSync(_0x33e531,_0x1334f3(0x1d4)),_0x502076=a140_0x399a39['parseDocument'](_0x50d5f5),_0x18ebd6=validateSegmentDef(_0xd48d8,{'source':_0x50d5f5,'document':_0x502076},{'skipSchema':!![]});if(!_0x18ebd6[_0x1334f3(0x213)]){const _0x4edc6f=a140_0x41e71e[_0x1334f3(0x23e)](_0x4dee41,_0x33e531);_0x260ed8[_0x1334f3(0x243)]({'filePath':_0x4edc6f,'source':_0x50d5f5,'result':_0x18ebd6,'isJourney':![]});}}for(const {yamlConfig:_0x31d4c0,sourcePath:_0x1ee092}of _0x10c897[_0x1334f3(0x203)]){const _0x2213ab=readFileSync(_0x1ee092,_0x1334f3(0x1d4)),_0x4a822c=a140_0x399a39[_0x1334f3(0x218)](_0x2213ab),_0x4c3c29=validateJourneyDef(_0x31d4c0,{'source':_0x2213ab,'document':_0x4a822c},{'skipSchema':!![]});if(!_0x4c3c29[_0x1334f3(0x213)]){const _0x3017a5=a140_0x41e71e[_0x1334f3(0x23e)](_0x4dee41,_0x1ee092);_0x260ed8['push']({'filePath':_0x3017a5,'source':_0x2213ab,'result':_0x4c3c29,'isJourney':!![]});}}return _0x260ed8;}export function formatValidationErrors(_0x541271){const _0xc87c85=a140_0x2d1abb,_0x10840a=[];for(const {filePath:_0x2a41a0,source:_0x2a2669,result:_0x164213,isJourney:_0xf4bc6d}of _0x541271){const _0x1c7c51=_0xf4bc6d?'journey':_0xc87c85(0x150);_0x10840a[_0xc87c85(0x243)]('\x0a'+_0x2a41a0+'\x20('+_0x1c7c51+_0xc87c85(0x192)+_0x164213[_0xc87c85(0x1bc)][_0xc87c85(0x1b5)]+_0xc87c85(0x199)),_0x10840a[_0xc87c85(0x243)](formatValidationResult(_0x164213,_0x2a2669,_0x2a41a0));}return _0x10840a[_0xc87c85(0x181)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x15670a){const _0x505341=a140_0x2d1abb,_0xe3ad45=new Set(),_0x4ba868=new Map(),_0x58a477=collectSegmentUsageCounts(_0x15670a);if(_0x15670a[_0x505341(0x1c8)])for(const [_0x813c9f,_0x3d20c9]of Object[_0x505341(0x1ea)](_0x15670a['segments'])){_0xe3ad45[_0x505341(0x1c7)](_0x813c9f);if(_0x3d20c9['rule']){const _0x2a95a1=yamlRuleToApi(_0x3d20c9['rule']),_0x434765=apiRuleToYaml(_0x2a95a1);_0x4ba868[_0x505341(0x1cf)](_0x813c9f,_0x434765);}}const _0x3d2c09=new Map();let _0x3e4e6f=0x0;for(const [_0x2c1cdc,_0x15b0ef]of _0x4ba868){const _0x151480=serializeExpandedRule(_0x15b0ef,_0x4ba868),_0x23d1d9=_0x3d2c09[_0x505341(0x160)](_0x151480)||[];_0x23d1d9['push']({'name':_0x2c1cdc,'index':_0x3e4e6f}),_0x3d2c09['set'](_0x151480,_0x23d1d9),_0x3e4e6f++;}const _0x4693d7=new Map();for(const [_0xaedf49,_0x4db51c]of _0x3d2c09){const _0x386023=_0x4db51c[_0x505341(0x17d)]()[_0x505341(0x176)]((_0x218107,_0x435a25)=>{const _0x1943bc=_0x505341,_0x340cd0=_0x58a477[_0x1943bc(0x160)](_0x218107[_0x1943bc(0x1d5)])||0x0,_0x2edcbb=_0x58a477[_0x1943bc(0x160)](_0x435a25[_0x1943bc(0x1d5)])||0x0;if(_0x340cd0!==_0x2edcbb)return _0x2edcbb-_0x340cd0;return _0x218107[_0x1943bc(0x156)]-_0x435a25[_0x1943bc(0x156)];})[_0x505341(0x1d7)](_0x1705f6=>_0x1705f6[_0x505341(0x1d5)]),_0x38732d=[];for(const _0xebfe35 of _0x386023){const _0x55ac61=_0x58a477['get'](_0xebfe35)||0x0,_0x1226da=Math['max'](_0x55ac61,0x1);for(let _0x25c7c1=0x0;_0x25c7c1<_0x1226da;_0x25c7c1++){_0x38732d[_0x505341(0x243)](_0xebfe35);}}_0x4693d7[_0x505341(0x1cf)](_0xaedf49,_0x38732d);}return{'existingLocalSegmentNames':_0xe3ad45,'localSegmentRules':_0x4ba868,'localExpandedRuleToNames':_0x4693d7};}export function createSegmentIdResolver(_0x10573e,_0x43b6f){return async _0xcae1e9=>{const _0x1018ee=a140_0x4f0a,_0x2ab24a=_0x10573e['get'](_0xcae1e9);if(!_0x2ab24a)throw new SDKError(ErrorCode[_0x1018ee(0x162)],_0x1018ee(0x219)+_0xcae1e9+_0x1018ee(0x152)+_0x43b6f+'\x27)');return _0x2ab24a;};}export function extractRootFolderId(_0x5ccca9){const _0x59ea58=a140_0x2d1abb;return _0x5ccca9[_0x59ea58(0x194)]?.['parentSegmentFolder']?.[_0x59ea58(0x21c)]?.['id']||_0x5ccca9[_0x59ea58(0x194)]?.[_0x59ea58(0x19c)]?.['data']?.['id'];}export function buildConnectionMaps(_0x1209e1){const _0x5d458b=a140_0x2d1abb,_0x37ef4e=new Map(),_0x5ecd81=new Map(),_0x5a761f=new Map();for(const _0x3a7aed of _0x1209e1){_0x37ef4e['set'](_0x3a7aed['name'],parseInt(_0x3a7aed['id'],0xa)),_0x5ecd81['set'](_0x3a7aed['id'],_0x3a7aed[_0x5d458b(0x1d5)]),_0x5a761f['set'](_0x3a7aed[_0x5d458b(0x1d5)],_0x3a7aed[_0x5d458b(0x19d)]);}return{'nameToId':_0x37ef4e,'idToName':_0x5ecd81,'nameToType':_0x5a761f};}export function calculatePushStats(_0x582cae,_0x98ef01,_0x3f2663,_0xcffa3b,_0x2322da,_0x5b6990,_0x1eb0a8){const _0x39c573=a140_0x2d1abb,_0x5b0b8d=_0x582cae[_0x39c573(0x177)](_0x5dec2b=>_0x5dec2b[_0x39c573(0x17b)]),_0x445eb1=_0x582cae[_0x39c573(0x177)](_0x49a734=>!_0x49a734[_0x39c573(0x17b)]&&_0x49a734[_0x39c573(0x21d)]),_0x50725b=_0x582cae['filter'](_0x14fb93=>!_0x14fb93[_0x39c573(0x17b)]&&!_0x14fb93[_0x39c573(0x21d)]),_0x488234=_0x5b6990?_0xcffa3b:[],_0x58ead7=_0x98ef01['filter'](_0x241245=>_0x241245[_0x39c573(0x17b)]),_0x3912e8=_0x98ef01[_0x39c573(0x177)](_0x5e68d8=>!_0x5e68d8[_0x39c573(0x17b)]&&_0x5e68d8[_0x39c573(0x21d)]),_0x1466bf=_0x98ef01[_0x39c573(0x177)](_0x1229bb=>!_0x1229bb[_0x39c573(0x17b)]&&!_0x1229bb[_0x39c573(0x21d)]),_0x462419=_0x5b6990?_0x2322da:[],_0x34e454=_0x582cae[_0x39c573(0x164)](_0x3ad662=>_0x3ad662['activationActions']),_0x191540=_0x34e454[_0x39c573(0x177)](_0x45a7fb=>_0x45a7fb[_0x39c573(0x19d)]===_0x39c573(0x185)),_0x4ecb82=_0x34e454[_0x39c573(0x177)](_0x31ffbc=>_0x31ffbc[_0x39c573(0x19d)]===_0x39c573(0x1db)),_0xfb8f30=_0x34e454[_0x39c573(0x177)](_0x510001=>_0x510001[_0x39c573(0x19d)]==='delete'),_0x1e6870=Array[_0x39c573(0x237)](_0x3f2663)[_0x39c573(0x176)](),_0x44c1a1=_0x1eb0a8?![]:_0x5b0b8d['length']>0x0||_0x445eb1['length']>0x0||_0x488234['length']>0x0,_0x5b1603=_0x58ead7[_0x39c573(0x1b5)]>0x0||_0x3912e8['length']>0x0||_0x462419[_0x39c573(0x1b5)]>0x0,_0xc1dde2=_0x1eb0a8?![]:_0x34e454[_0x39c573(0x1b5)]>0x0,_0x257d9f=_0x1e6870[_0x39c573(0x1b5)]>0x0;return{'segments':{'new':_0x5b0b8d,'changed':_0x445eb1,'unchanged':_0x50725b,'toDelete':_0x488234},'journeys':{'new':_0x58ead7,'changed':_0x3912e8,'unchanged':_0x1466bf,'toDelete':_0x462419},'activations':{'all':_0x34e454,'toCreate':_0x191540,'toUpdate':_0x4ecb82,'toDelete':_0xfb8f30},'folders':{'toCreate':_0x1e6870},'counts':{'segments':{'new':_0x5b0b8d[_0x39c573(0x1b5)],'changed':_0x445eb1[_0x39c573(0x1b5)],'unchanged':_0x50725b['length'],'toDelete':_0x488234[_0x39c573(0x1b5)]},'journeys':{'new':_0x58ead7[_0x39c573(0x1b5)],'changed':_0x3912e8[_0x39c573(0x1b5)],'unchanged':_0x1466bf[_0x39c573(0x1b5)],'toDelete':_0x462419[_0x39c573(0x1b5)]},'activations':{'create':_0x191540['length'],'update':_0x4ecb82[_0x39c573(0x1b5)],'delete':_0xfb8f30[_0x39c573(0x1b5)]},'folders':_0x1e6870[_0x39c573(0x1b5)]},'hasChanges':_0x44c1a1||_0x5b1603||_0xc1dde2||_0x257d9f};}export async function buildPushExecutionContext(_0x212b0f,_0x5f7b40,_0x39fc47,_0x1a1cb5,_0x46a3e4,_0x4fd9b8){const _0x1eac00=a140_0x2d1abb,_0x3018c4=extractRootFolderId(_0x39fc47),{pathToId:_0x1ad758,idToPath:_0x237835}=buildFolderMaps(_0x46a3e4),_0x5d5f31=buildSegmentNameToIdMap(_0x1a1cb5),_0x5cd537=new Map(),{batchAsync:_0x31451d}=await import(_0x1eac00(0x1d6)),[_0x372e1f,_0x2ac4de]=await Promise['all']([_0x212b0f[_0x1eac00(0x18a)][_0x1eac00(0x1ef)](),_0x212b0f[_0x1eac00(0x161)][_0x1eac00(0x1cb)](),((async()=>{const _0x1f5a94=_0x1eac00;!_0x4fd9b8&&_0x1a1cb5[_0x1f5a94(0x1b5)]>0x0&&await _0x31451d(_0x1a1cb5,async _0x57ffec=>{const _0x426b22=_0x1f5a94,_0x850041=await _0x212b0f[_0x426b22(0x150)][_0x426b22(0x1a6)](_0x5f7b40,_0x57ffec['id']);_0x5cd537[_0x426b22(0x1cf)](_0x57ffec['id'],_0x850041);});})())]),{emailToId:_0x4632d9,idToEmail:_0x118181}=_0x372e1f,_0x3fdffc=buildConnectionMaps(_0x2ac4de);return{'rootFolderId':_0x3018c4,'folderPathToId':_0x1ad758,'folderIdToPath':_0x237835,'segmentNameToId':_0x5d5f31,'activationsBySegmentId':_0x5cd537,'emailToIdMap':_0x4632d9,'idToEmailMap':_0x118181,'connectionNameToIdMap':_0x3fdffc[_0x1eac00(0x1dd)],'connectionIdToNameMap':_0x3fdffc[_0x1eac00(0x209)],'connectionNameToTypeMap':_0x3fdffc[_0x1eac00(0x179)]};}export function createPushYamlContextForBundle(_0x4aadab,_0x8a72c0,_0x51c00f,_0x3339b4,_0x5df8f6,_0x2a369e,_0x62af03,_0x3ee8ba){const {existingLocalSegmentNames:_0x32e037,localExpandedRuleToNames:_0x2cca12}=_0x3339b4,_0x56f2d7=new Set(),_0x12fde0=new Map(),_0x3db4b4=new Map(),_0xf51f52=new Map(),_0x142767=createJumpTargetCache(),_0x1bbb79=new Map(),_0x2e6e0a=new Map(),_0x124d5b=new Set();let _0xd8ba13;const _0x59473f=_0x1ff7ee=>{const _0x298a0d={'resolveSegment':async _0x222740=>{const _0x2a1bf7=a140_0x4f0a,_0x35eff5=_0xf51f52[_0x2a1bf7(0x160)](_0x222740);if(_0x35eff5!==undefined)return{'name':_0x35eff5,'isJourneyLocal':!![]};try{const _0x50d98=await fetchSegment(_0x4aadab,_0x8a72c0,_0x222740,_0x51c00f);if(!_0x50d98)throw new Error(_0x2a1bf7(0x18f));const _0x338056=generateJourneyLocalName(_0x50d98[_0x2a1bf7(0x1d5)]),_0x21b267=_0x50d98['kind']===SEGMENT_KIND_JOURNEY&&_0x338056!==undefined;let _0x252ea9=_0x50d98[_0x2a1bf7(0x1d5)],_0x3504a8;if(_0x21b267&&_0x50d98[_0x2a1bf7(0x20b)]){const _0x26b469=apiRuleToYaml(_0x50d98[_0x2a1bf7(0x20b)]);_0x2e6e0a['set'](_0x222740,_0x26b469);const _0x49c6cd=async _0x2d3948=>{const _0x4d442d=_0x2a1bf7,_0x3445ce=collectSegmentRefsFromRule(_0x2d3948);for(const _0x4c8ee2 of _0x3445ce){if(!_0x2e6e0a['has'](_0x4c8ee2))try{const _0x4069e4=await fetchSegment(_0x4aadab,_0x8a72c0,_0x4c8ee2,_0x51c00f);if(_0x4069e4?.[_0x4d442d(0x20b)]){const _0x172032=apiRuleToYaml(_0x4069e4[_0x4d442d(0x20b)]);_0x2e6e0a[_0x4d442d(0x1cf)](_0x4c8ee2,_0x172032),await _0x49c6cd(_0x172032);}}catch(_0x17cf9c){logger['debug'](_0x4d442d(0x1d3)+_0x4c8ee2+':\x20'+_0x17cf9c);}}};await _0x49c6cd(_0x26b469);const _0x442d45=serializeExpandedRule(_0x26b469,_0x2e6e0a),_0x563ff6=_0x2cca12[_0x2a1bf7(0x160)](_0x442d45);if(_0x563ff6&&_0x563ff6[_0x2a1bf7(0x1b5)]>0x0){const _0x3906b7=_0x12fde0['get'](_0x442d45)||0x0,_0x3328e6=_0x563ff6[_0x3906b7]||_0x563ff6[_0x563ff6[_0x2a1bf7(0x1b5)]-0x1];_0x12fde0[_0x2a1bf7(0x1cf)](_0x442d45,_0x3906b7+0x1),_0x252ea9=_0x3328e6,_0x56f2d7[_0x2a1bf7(0x1c7)](_0x252ea9),_0xf51f52[_0x2a1bf7(0x1cf)](_0x222740,_0x252ea9);const _0x37f1eb=await resolveRuleSegmentRefs(_0x26b469,async _0x2204d5=>{const _0x2597e2=_0x2a1bf7,_0x3af689=_0xf51f52[_0x2597e2(0x160)](_0x2204d5);if(_0x3af689)return _0x3af689;const _0x13582a=await _0xd8ba13[_0x2597e2(0x22e)](_0x2204d5);return _0x13582a[_0x2597e2(0x1d5)];});_0x3504a8={'description':_0x50d98['description'],'rule':_0x37f1eb};}else{const _0x3d419b=_0x1bbb79[_0x2a1bf7(0x160)](_0x442d45);if(_0x3d419b)_0x252ea9=_0x3d419b,_0xf51f52[_0x2a1bf7(0x1cf)](_0x222740,_0x252ea9);else{if(_0x338056){let _0x1ca52c=_0x338056,_0xb8069b=0x2;while(_0x56f2d7[_0x2a1bf7(0x1aa)](_0x1ca52c)||_0x32e037[_0x2a1bf7(0x1aa)](_0x1ca52c)){_0x1ca52c=_0x338056+'_'+_0xb8069b,_0xb8069b++;}_0x56f2d7['add'](_0x1ca52c),_0x252ea9=_0x1ca52c;}_0xf51f52[_0x2a1bf7(0x1cf)](_0x222740,_0x252ea9),_0x1bbb79['set'](_0x442d45,_0x252ea9);const _0x5e377e=await resolveRuleSegmentRefs(_0x26b469,async _0x9b0c9c=>{const _0x30e6c6=_0x2a1bf7,_0x5e4c55=_0xf51f52['get'](_0x9b0c9c);if(_0x5e4c55)return _0x5e4c55;const _0xcc5fc8=await _0xd8ba13[_0x30e6c6(0x22e)](_0x9b0c9c);return _0xcc5fc8[_0x30e6c6(0x1d5)];});_0x3504a8={'description':_0x50d98[_0x2a1bf7(0x170)],'rule':_0x5e377e};}}}return{'name':_0x252ea9,'isJourneyLocal':_0x21b267,'definition':_0x3504a8};}catch(_0x253074){return logger[_0x2a1bf7(0x1ab)](_0x2a1bf7(0x1f8)+_0x222740+':\x20'+_0x253074),{'name':_0x222740,'isJourneyLocal':![]};}},'resolveActivation':async _0x18ffec=>{const _0x4386f2=a140_0x4f0a,_0x423ae3=_0x3db4b4['get'](_0x18ffec);if(_0x423ae3!==undefined)return{'name':_0x423ae3,'isJourneyLocal':!![]};try{let _0x3560c9=_0x62af03?.[_0x4386f2(0x160)](_0x18ffec);!_0x3560c9&&(_0x3560c9=await _0x4aadab[_0x4386f2(0x151)][_0x4386f2(0x200)](_0x1ff7ee,_0x18ffec));const _0x5ec4ba=_0x3560c9['attributes'][_0x4386f2(0x222)][_0x4386f2(0x1d5)]||_0x18ffec,_0x28defd=sanitizeYamlKey(_0x5ec4ba)||_0x4386f2(0x1b3)+_0x18ffec,_0xb4da72=_0x28defd;_0x3db4b4[_0x4386f2(0x1cf)](_0x18ffec,_0xb4da72);const _0x2c7db3=journeyActivationStepToYaml(_0x3560c9,_0x5df8f6,_0x2a369e);return{'name':_0xb4da72,'isJourneyLocal':!![],'definition':_0x2c7db3};}catch(_0x29d0d5){return logger[_0x4386f2(0x1ab)](_0x4386f2(0x1f1)+_0x18ffec+':\x20'+_0x29d0d5),{'name':_0x18ffec,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x32a5ff,_0x178e07)=>resolveJumpTarget(_0x32a5ff,_0x178e07,_0x142767,async _0x18f45e=>{const _0x5badbe=a140_0x4f0a,_0x215ed0=_0x3ee8ba?.[_0x5badbe(0x160)](_0x18f45e);if(_0x215ed0)return _0x215ed0;return _0x4aadab[_0x5badbe(0x151)]['getJourney'](_0x18f45e);})};return _0xd8ba13=_0x298a0d,_0x298a0d;},_0x1de0ab=async _0x515b5e=>{const _0x1ce280=a140_0x4f0a,{collectSegmentIdsFromJourneyApi:_0x30631c}=await import(_0x1ce280(0x242)),{batchAsync:_0x43a660}=await import('../../utils/async.js'),_0x246778=new Set();for(const _0x5d115c of _0x515b5e){let _0x1385b4=_0x3ee8ba?.['get'](_0x5d115c);!_0x1385b4&&(_0x1385b4=await _0x4aadab[_0x1ce280(0x151)][_0x1ce280(0x175)](_0x5d115c));const _0x47becf=_0x30631c(_0x1385b4);for(const _0xba54e5 of _0x47becf){_0x246778[_0x1ce280(0x1c7)](_0xba54e5);}}let _0x5da523=Array[_0x1ce280(0x237)](_0x246778);while(_0x5da523[_0x1ce280(0x1b5)]>0x0){const _0x1a0779=_0x5da523[_0x1ce280(0x177)](_0x205635=>!_0x124d5b[_0x1ce280(0x1aa)](_0x205635));if(_0x1a0779['length']===0x0)break;const _0x645f7f=await _0x43a660(_0x1a0779,async _0x24c012=>{const _0x55bfd4=_0x1ce280;_0x124d5b[_0x55bfd4(0x1c7)](_0x24c012);const _0x5cd8da=await fetchSegment(_0x4aadab,_0x8a72c0,_0x24c012,_0x51c00f);if(!_0x5cd8da)return null;return{'segmentId':_0x24c012,'segment':_0x5cd8da};},0xa),_0x31e474=new Set();for(const _0x11e3c1 of _0x645f7f){if(!_0x11e3c1?.[_0x1ce280(0x150)]?.[_0x1ce280(0x20b)])continue;const _0x97e340=apiRuleToYaml(_0x11e3c1[_0x1ce280(0x150)][_0x1ce280(0x20b)]);_0x2e6e0a[_0x1ce280(0x1cf)](_0x11e3c1['segmentId'],_0x97e340);const _0x363197=collectSegmentRefsFromRule(_0x97e340);for(const _0x3ebafa of _0x363197){!_0x124d5b[_0x1ce280(0x1aa)](_0x3ebafa)&&_0x31e474[_0x1ce280(0x1c7)](_0x3ebafa);}}_0x5da523=Array[_0x1ce280(0x237)](_0x31e474);}};return{'createYamlContext':_0x59473f,'prefetchJourneySegments':_0x1de0ab};}export async function executePushSegments(_0x2db870,_0x17b4f0,_0x2cea84,_0x59b582,_0x5cb974){const _0x585387=a140_0x2d1abb,{segmentDefToCreateRequest:_0x5bfaec,segmentDefToUpdateRequest:_0x5066cb}=await import('./child-segment-yaml.js'),_0x11c5a4=_0x2cea84['folderPathToId'],_0x586c3d=0x5,_0x958009=async _0x33a806=>{const _0x17401c=a140_0x4f0a,_0x3064e2=_0x33a806[_0x17401c(0x191)]?_0x11c5a4['get'](_0x33a806[_0x17401c(0x191)]):undefined;let _0x15b927;const _0x5579ba={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x1c370e=_0x33a806['yamlConfig'];if(_0x33a806['yamlConfig']['rule']){const _0x3133be=createSegmentIdResolver(_0x2cea84['segmentNameToId'],_0x33a806[_0x17401c(0x165)]['name']),_0x29c13a=await resolveRuleSegmentIds(_0x33a806[_0x17401c(0x165)][_0x17401c(0x20b)],_0x3133be);_0x1c370e={..._0x33a806['yamlConfig'],'rule':_0x29c13a};}try{if(_0x33a806['isNew']){_0x5cb974['onProgress']?.({'type':_0x17401c(0x178),'name':_0x33a806[_0x17401c(0x165)][_0x17401c(0x1d5)]});const _0x113d0a=_0x5bfaec(_0x1c370e,_0x3064e2),_0x30356c=await _0x5cb974[_0x17401c(0x19e)](_0x17401c(0x159)+_0x33a806['yamlConfig']['name']+'\x27...',()=>_0x2db870[_0x17401c(0x150)][_0x17401c(0x1cc)](_0x59b582[_0x17401c(0x1c5)],_0x113d0a));_0x15b927=_0x30356c[_0x17401c(0x21c)]['id'],_0x2cea84[_0x17401c(0x1f6)][_0x17401c(0x1cf)](_0x33a806[_0x17401c(0x165)]['name'],_0x15b927),_0x5579ba[_0x17401c(0x15d)]={'name':_0x33a806[_0x17401c(0x165)]['name'],'id':_0x15b927},_0x5cb974[_0x17401c(0x236)]?.({'type':'segment_created','name':_0x33a806[_0x17401c(0x165)][_0x17401c(0x1d5)],'segmentId':_0x15b927}),_0x5cb974[_0x17401c(0x1de)]?.(_0x17401c(0x1d8)+_0x33a806[_0x17401c(0x165)]['name']+'\x27'),_0x5579ba['created']=0x1;}else{if(_0x33a806[_0x17401c(0x21d)]){_0x5cb974[_0x17401c(0x236)]?.({'type':_0x17401c(0x210),'name':_0x33a806['yamlConfig'][_0x17401c(0x1d5)]});const _0x3e498c=_0x5066cb(_0x1c370e);_0x3064e2!==_0x33a806[_0x17401c(0x22c)]?.['segmentFolderId']&&(_0x3e498c[_0x17401c(0x1e8)]=_0x3064e2?parseInt(_0x3064e2,0xa):undefined),await _0x5cb974[_0x17401c(0x19e)]('Updating\x20segment\x20\x27'+_0x33a806[_0x17401c(0x165)][_0x17401c(0x1d5)]+_0x17401c(0x1d0),()=>_0x2db870[_0x17401c(0x150)][_0x17401c(0x1e2)](_0x59b582['parentId'],_0x33a806[_0x17401c(0x22c)]['id'],_0x3e498c)),_0x15b927=_0x33a806[_0x17401c(0x22c)]['id'],_0x5cb974[_0x17401c(0x236)]?.({'type':_0x17401c(0x195),'name':_0x33a806[_0x17401c(0x165)]['name']}),_0x5cb974[_0x17401c(0x1de)]?.('Updated\x20segment\x20\x27'+_0x33a806[_0x17401c(0x165)][_0x17401c(0x1d5)]+'\x27'),_0x5579ba['updated']=0x1;}else _0x15b927=_0x33a806['existingSegment']['id'];}}catch(_0x3a332f){const _0x49916d=isHttp400Error(_0x3a332f),_0x4d876e=_0x49916d?ErrorCode[_0x17401c(0x229)]:ErrorCode[_0x17401c(0x1eb)],_0x51ddc6=getErrorMessage(_0x3a332f);throw new SDKError(_0x4d876e,_0x17401c(0x14f)+(_0x33a806[_0x17401c(0x17b)]?'create':_0x17401c(0x1db))+'\x20segment\x20from\x20file:\x20'+_0x33a806[_0x17401c(0x238)]+_0x17401c(0x1ff)+_0x51ddc6,_0x3a332f);}try{const _0x3cf4ea=await syncActivationsForSegment(_0x2db870,_0x59b582[_0x17401c(0x1c5)],_0x15b927,_0x33a806[_0x17401c(0x165)][_0x17401c(0x1d5)],_0x33a806['activationActions'],_0x5cb974,_0x33a806[_0x17401c(0x238)]);_0x5579ba[_0x17401c(0x167)]=_0x3cf4ea;}catch(_0x2a4272){if(_0x2a4272 instanceof SDKError)throw _0x2a4272;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x17401c(0x196)+_0x33a806['yamlConfig'][_0x17401c(0x1d5)]+_0x17401c(0x155)+_0x33a806[_0x17401c(0x238)]+'\x0a\x20\x20'+getErrorMessage(_0x2a4272),_0x2a4272);}return _0x5579ba;},_0x46d311=await batchAsync(_0x17b4f0,_0x958009,_0x586c3d),_0x23aefe={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x50617a of _0x46d311){_0x23aefe[_0x585387(0x1b9)]+=_0x50617a[_0x585387(0x1b9)],_0x23aefe[_0x585387(0x239)]+=_0x50617a['updated'],_0x50617a['createdSegmentId']&&_0x23aefe['createdSegmentIds'][_0x585387(0x1cf)](_0x50617a[_0x585387(0x15d)]['name'],_0x50617a[_0x585387(0x15d)]['id']),_0x23aefe[_0x585387(0x167)][_0x585387(0x1b9)]+=_0x50617a[_0x585387(0x167)][_0x585387(0x1b9)],_0x23aefe[_0x585387(0x167)][_0x585387(0x239)]+=_0x50617a[_0x585387(0x167)][_0x585387(0x239)],_0x23aefe[_0x585387(0x167)]['deleted']+=_0x50617a[_0x585387(0x167)]['deleted'];}return _0x23aefe;}function a140_0x51ab(){const _0x1afac0=['activation_template_id','created','find','uniqueServerName','errors','versionNumber','embedded_activation_created','existingSegments','712782jVKtkV','Delete\x20the\x20push\x20recovery\x20file\x20(','journey_entry_criteria_','action','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','parentId','deps','add','segments','all','journey_creating','list','createSegment','getSegment','activation_deleted','set','\x27...','stages','effectiveFolderId','Failed\x20to\x20fetch\x20referenced\x20segment\x20','utf-8','name','../../utils/async.js','map','Created\x20segment\x20\x27','Matched\x20server\x20segment\x20\x27','getSegment\x20failed\x20for\x20','update','segmentByFolderAndName','nameToId','logSuccess','WaitStep','parse','Deleted\x20segment\x20\x27','updateSegmentById','state','notification','415410ryPIum','conditions','dirname','segmentFolderId','__pending_act_','entries','SEGMENT_UPDATE_ERROR','schedule','conditionTimeoutUnit','9INAozO','buildUserMaps','\x27\x20not\x20found\x20in\x20journey\x20\x27','Failed\x20to\x20resolve\x20activation\x20','\x27\x20decision\x20point\x20branch\x20\x27','embedded_segment_creating','journeyBundleName','Entry\x20criteria:\x20','segmentNameToId','conditionSegmentId','Failed\x20to\x20resolve\x20segment\x20','toString','journeyBundlesByFolderAndName','milestone','Deleting\x20activation\x20\x27','updateActivation','journeyId','\x0a\x20\x20','getActivation','reduce','journeyStages','journeys','resolvedRule','./child-segment-yaml.js','decision_point','getSegmentEntity\x20also\x20failed\x20for\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','idToName','waitStep','rule','localName','\x27\x20exit\x20criteria','\x20journey\x20from\x20file:\x20','activationsBySegmentId','segment_updating','toISOString','null','valid','Fetching\x20','uniqueSegmentName',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','__pending_','parseDocument','Segment\x20not\x20found:\x20','journeyActivationStepId','.$1.push-recovery.json','data','hasChanges','with','stringify','rootFolderId','waitStepUnit','activationParams','some','yamlActivation','attributes','journeyById','Creating\x20activation\x20\x27','NOT_FOUND','SEGMENT_SYNTAX_ERROR','match','delete','existingSegment','Activation','resolveSegment','Duration','Created\x20journey\x20\x27','segmentId','entry_criteria','INTERNAL','object','849352IOMVhQ','onProgress','from','absolutePath','updated','activationStepsById','ACTIVATION_SYNTAX_ERROR','\x27\x20for\x20','existingJourney','relative','existingActivation','logDeleted','unchanged','./journey-yaml.js','push','keys','branches','sha1','activationContext','progress','stage\x20\x27','Failed\x20to\x20','segment','journey','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','\x20(referenced\x20in\x20journey\x20','416982WnlcAv','\x27\x20from\x20file:\x20','index','journeyBundleId',').\x20','Creating\x20segment\x20\x27','Updated\x20activation\x20\x27','getLatestJourneyId','8871TzfNeT','createdSegmentId','columns','entry','get','connection','SEGMENT_NOT_FOUND','toLowerCase','flatMap','yamlConfig','844690IoytUh','activations','folder','diff','\x20activation\x20\x27','entryCriteria','segment_deleting','resolveJourneyId','\x27\x20entry\x20criteria','run_after_journey_refresh','description','Journey\x20\x27','embedded_activation_creating','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','folderId','getJourney','sort','filter','segment_creating','nameToType','journeyName','isNew','waitStepType','slice','validatedRequest','and\x20the\x20server\x20segment,\x20then\x20retry.','replace','join','goal','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','behavior','create','all_columns','item','steps','isArray','user','size','journey_updated','folderPathToId','idToEmailMap','Segment\x20not\x20found','exitCriterias','folderPath','):\x20','\x27\x20to\x20local\x20\x27','relationships','segment_updated','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','conditionTimeoutDuration','DecisionPoint','\x20error(s)','startsWith','14ZYSaFR','parentFolder','type','withProgress','Created\x20folder\x20\x27','Creating\x20folder\x20\x27','journey_created','connectionIdToNameMap','deleted','includes','folder_creating','listActivations','max','connector_config','activation_created','has','debug','goal\x20criteria','Condition','getSegmentEntity','hex','split','message','embedded_segment_created','activation_','804688eqDjus','length','\x27\x20wait\x20condition','12PGyFhm'];a140_0x51ab=function(){return _0x1afac0;};return a140_0x51ab();}async function syncActivationsForSegment(_0x1a1fbb,_0x2b34ea,_0x49189b,_0x59c08f,_0x473116,_0x31d39c,_0x44dd7f){const _0x5a2040=a140_0x2d1abb,_0x6fc63a={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1d8e05 of _0x473116){try{if(_0x1d8e05[_0x5a2040(0x19d)]===_0x5a2040(0x185)&&_0x1d8e05['validatedRequest'])_0x31d39c[_0x5a2040(0x236)]?.({'type':'activation_creating','segmentName':_0x59c08f,'activationName':_0x1d8e05['name']}),await _0x31d39c[_0x5a2040(0x19e)](_0x5a2040(0x227)+_0x1d8e05[_0x5a2040(0x1d5)]+_0x5a2040(0x1d0),()=>_0x1a1fbb[_0x5a2040(0x150)]['createActivation'](_0x2b34ea,_0x49189b,_0x1d8e05[_0x5a2040(0x17e)])),_0x31d39c['onProgress']?.({'type':_0x5a2040(0x1a9),'segmentName':_0x59c08f,'activationName':_0x1d8e05[_0x5a2040(0x1d5)]}),_0x31d39c[_0x5a2040(0x1de)]?.('Created\x20activation\x20\x27'+_0x1d8e05[_0x5a2040(0x1d5)]+'\x27'),_0x6fc63a['created']++;else{if(_0x1d8e05[_0x5a2040(0x19d)]===_0x5a2040(0x1db)&&_0x1d8e05['validatedRequest']&&_0x1d8e05[_0x5a2040(0x23f)])_0x31d39c[_0x5a2040(0x236)]?.({'type':'activation_updating','segmentName':_0x59c08f,'activationName':_0x1d8e05[_0x5a2040(0x1d5)]}),await _0x31d39c[_0x5a2040(0x19e)]('Updating\x20activation\x20\x27'+_0x1d8e05[_0x5a2040(0x1d5)]+_0x5a2040(0x1d0),()=>_0x1a1fbb['segment'][_0x5a2040(0x1fd)](_0x2b34ea,_0x49189b,_0x1d8e05['existingActivation']['id'],_0x1d8e05[_0x5a2040(0x17e)])),_0x31d39c[_0x5a2040(0x236)]?.({'type':'activation_updated','segmentName':_0x59c08f,'activationName':_0x1d8e05[_0x5a2040(0x1d5)]}),_0x31d39c[_0x5a2040(0x1de)]?.(_0x5a2040(0x15a)+_0x1d8e05[_0x5a2040(0x1d5)]+'\x27'),_0x6fc63a[_0x5a2040(0x239)]++;else _0x1d8e05[_0x5a2040(0x19d)]==='delete'&&_0x1d8e05['existingActivation']&&(_0x31d39c['onProgress']?.({'type':'activation_deleting','segmentName':_0x59c08f,'activationName':_0x1d8e05[_0x5a2040(0x1d5)]}),await _0x31d39c[_0x5a2040(0x19e)](_0x5a2040(0x1fc)+_0x1d8e05[_0x5a2040(0x1d5)]+_0x5a2040(0x1d0),()=>_0x1a1fbb[_0x5a2040(0x150)]['deleteActivation'](_0x2b34ea,_0x49189b,_0x1d8e05[_0x5a2040(0x23f)]['id'])),_0x31d39c[_0x5a2040(0x236)]?.({'type':_0x5a2040(0x1ce),'segmentName':_0x59c08f,'activationName':_0x1d8e05[_0x5a2040(0x1d5)]}),_0x31d39c['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x1d8e05[_0x5a2040(0x1d5)]+'\x27'),_0x6fc63a[_0x5a2040(0x1a3)]++);}}catch(_0x57d6ae){const _0x21039c=isHttp400Error(_0x57d6ae),_0x4cfeff=_0x21039c?ErrorCode[_0x5a2040(0x23b)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2066db=getErrorMessage(_0x57d6ae);throw new SDKError(_0x4cfeff,_0x5a2040(0x14f)+_0x1d8e05[_0x5a2040(0x19d)]+_0x5a2040(0x16a)+_0x1d8e05[_0x5a2040(0x1d5)]+_0x5a2040(0x155)+_0x44dd7f+'\x0a\x20\x20'+_0x2066db,_0x57d6ae);}}return _0x6fc63a;}export async function executePushFolders(_0x56d0ae,_0x104bce,_0x422fd6,_0xeb6456,_0x4f884c){const _0x197eb6=a140_0x2d1abb,_0x7ddd99=new Map(_0x422fd6),_0x458dba=sortFoldersByDepth(_0x104bce);for(const _0x11b9d7 of _0x458dba){const _0x24a056=_0x11b9d7[_0x197eb6(0x1b0)]('/'),_0x454033=_0x24a056[_0x24a056[_0x197eb6(0x1b5)]-0x1],_0x76f9bf=_0x24a056[_0x197eb6(0x17d)](0x0,-0x1)[_0x197eb6(0x181)]('/'),_0x5a8a2b=_0x7ddd99[_0x197eb6(0x160)](_0x76f9bf);_0x4f884c[_0x197eb6(0x236)]?.({'type':_0x197eb6(0x1a5),'folder':_0x11b9d7});const _0x15cb42={'name':_0x454033,'parentFolderId':_0x5a8a2b},_0x1f523d=await _0x4f884c[_0x197eb6(0x19e)](_0x197eb6(0x1a0)+_0x11b9d7+_0x197eb6(0x1d0),()=>_0x56d0ae[_0x197eb6(0x150)]['createFolder'](_0xeb6456[_0x197eb6(0x1c5)],_0x15cb42));_0x7ddd99[_0x197eb6(0x1cf)](_0x11b9d7,_0x1f523d['data']['id']),_0x4f884c[_0x197eb6(0x236)]?.({'type':'folder_created','folder':_0x11b9d7,'folderId':_0x1f523d[_0x197eb6(0x21c)]['id']}),_0x4f884c['logInfo']?.(_0x197eb6(0x19f)+_0x11b9d7+'\x27');}return _0x7ddd99;}export async function executePushSegmentDeletions(_0x45fe71,_0x265f65,_0x53ff29){const _0x56a621=a140_0x2d1abb;if(_0x265f65[_0x56a621(0x1b5)]===0x0)return 0x0;const {batchAsync:_0x2903f9}=await import('../../utils/async.js'),_0x26a33e=0x5,_0x2caf2d=await _0x2903f9(_0x265f65,async _0x1a458f=>{const _0x135020=_0x56a621;return _0x53ff29[_0x135020(0x236)]?.({'type':_0x135020(0x16c),'name':_0x1a458f[_0x135020(0x1d5)]}),await _0x45fe71['segment']['deleteSegment'](_0x1a458f['id']),_0x53ff29[_0x135020(0x236)]?.({'type':'segment_deleted','name':_0x1a458f[_0x135020(0x1d5)]}),_0x53ff29[_0x135020(0x240)]?.(_0x135020(0x1e1)+_0x1a458f[_0x135020(0x1d5)]+'\x27'),0x1;},_0x26a33e);return _0x2caf2d[_0x56a621(0x201)]((_0x21dfd3,_0x46b920)=>_0x21dfd3+_0x46b920,0x0);}export async function executePushJourneys(_0x422c5a,_0xf0cbf4,_0x24bad8,_0x371d6f,_0x352bf1){const _0xc0d044=a140_0x2d1abb,{journeyDefToRequest:_0x542d8b}=await import(_0xc0d044(0x242)),{activationDefToCreateRequest:_0x25d752,yamlRuleToApi:_0x50a650,validateSegmentRule:_0x8f4a56}=await import(_0xc0d044(0x205)),_0x2f1459={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x16e4f5=new Map(_0x24bad8[_0xc0d044(0x1f6)]),_0xd8b572=0x5;for(let _0x477b13=0x0;_0x477b13<_0xf0cbf4[_0xc0d044(0x1b5)];_0x477b13+=_0xd8b572){const _0x12e8c7=_0xf0cbf4[_0xc0d044(0x17d)](_0x477b13,_0x477b13+_0xd8b572),_0x17efab=await Promise[_0xc0d044(0x1c9)](_0x12e8c7['map'](async _0x392b7f=>{const _0x1fa314=_0xc0d044;if(!_0x392b7f[_0x1fa314(0x17b)]&&!_0x392b7f[_0x1fa314(0x21d)])return{'action':_0x1fa314(0x241),'name':_0x392b7f[_0x1fa314(0x165)][_0x1fa314(0x1d5)],'journeyId':_0x392b7f[_0x1fa314(0x23d)]?.['id']};const _0x2e74ca=_0x392b7f[_0x1fa314(0x191)]?_0x24bad8[_0x1fa314(0x18d)][_0x1fa314(0x160)](_0x392b7f[_0x1fa314(0x191)]):undefined;_0x352bf1[_0x1fa314(0x236)]?.({'type':_0x392b7f[_0x1fa314(0x17b)]?_0x1fa314(0x1ca):'journey_updating','name':_0x392b7f[_0x1fa314(0x165)][_0x1fa314(0x1d5)]});try{const _0x34dd79=await executeSingleJourneyPush(_0x422c5a,_0x392b7f,{..._0x24bad8,'segmentNameToId':_0x16e4f5},{'parentId':_0x371d6f[_0x1fa314(0x1c5)],'rootFolderId':_0x371d6f['rootFolderId'],'folderId':_0x2e74ca,'verbose':_0x371d6f['verbose']},_0x352bf1,{'journeyDefToRequest':_0x542d8b,'activationDefToCreateRequest':_0x25d752,'yamlRuleToApi':_0x50a650,'validateSegmentRule':_0x8f4a56});for(const [_0x495e7f,_0x22a25d]of _0x34dd79['embeddedSegmentNameToId']){_0x16e4f5['set'](_0x495e7f,_0x22a25d),_0x2f1459['embeddedSegmentNameToId'][_0x1fa314(0x1cf)](_0x495e7f,_0x22a25d);}if(_0x34dd79[_0x1fa314(0x1c3)]===_0x1fa314(0x1b9))_0x352bf1[_0x1fa314(0x236)]?.({'type':_0x1fa314(0x1a1),'name':_0x392b7f[_0x1fa314(0x165)]['name'],'journeyId':_0x34dd79[_0x1fa314(0x1fe)]}),_0x352bf1[_0x1fa314(0x1de)]?.(_0x1fa314(0x230)+_0x392b7f['yamlConfig']['name']+'\x27'),_0x2f1459[_0x1fa314(0x1b9)]++;else _0x34dd79[_0x1fa314(0x1c3)]==='updated'&&(_0x352bf1['onProgress']?.({'type':_0x1fa314(0x18c),'name':_0x392b7f[_0x1fa314(0x165)][_0x1fa314(0x1d5)]}),_0x352bf1['logSuccess']?.('Updated\x20journey\x20\x27'+_0x392b7f[_0x1fa314(0x165)][_0x1fa314(0x1d5)]+'\x27'),_0x2f1459[_0x1fa314(0x239)]++);return{'action':_0x34dd79[_0x1fa314(0x1c3)],'name':_0x392b7f['yamlConfig']['name'],'journeyId':_0x34dd79['journeyId']};}catch(_0x2d691c){const _0x3cb103=isHttp400Error(_0x2d691c),_0x6b2dd1=_0x3cb103?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x38401a=getErrorMessage(_0x2d691c);throw new SDKError(_0x6b2dd1,_0x1fa314(0x14f)+(_0x392b7f[_0x1fa314(0x17b)]?_0x1fa314(0x185):'update')+_0x1fa314(0x20e)+_0x392b7f['absolutePath']+_0x1fa314(0x1ff)+_0x38401a,_0x2d691c);}}));_0x2f1459['results'][_0xc0d044(0x243)](..._0x17efab);}return _0x2f1459;}async function matchExistingJourneySegments(_0x2f801a,_0xcec73c,_0x424d44,_0x739473,_0x5a1d4f){const _0x21c268=a140_0x2d1abb;if(!_0xcec73c['existingJourney']||!_0xcec73c[_0x21c268(0x165)]['segments'])return;const _0x18845b=new Map(),_0x299fb1=new Set();for(const _0x33c3a4 of Object[_0x21c268(0x244)](_0xcec73c[_0x21c268(0x165)]['segments'])){const _0x33a138=generateDeterministicJourneySegmentName(_0xcec73c['yamlConfig'][_0x21c268(0x1d5)],_0x33c3a4);_0x18845b['set'](_0x33a138,_0x33c3a4),_0x299fb1[_0x21c268(0x1c7)](_0x33c3a4);}const _0x9e0f06=[],_0x30ba1d=collectSegmentIdsFromJourneyApi(_0xcec73c['existingJourney']);for(const _0x47a7f7 of _0x30ba1d){const _0x598d31=await fetchSegment(_0x2f801a,_0x424d44,_0x47a7f7,_0x739473);if(!_0x598d31?.[_0x21c268(0x1d5)])continue;const _0x27b2f4=_0x18845b[_0x21c268(0x160)](_0x598d31[_0x21c268(0x1d5)]);_0x27b2f4?(_0x5a1d4f[_0x21c268(0x1cf)](_0x27b2f4,_0x47a7f7),_0x299fb1[_0x21c268(0x22b)](_0x27b2f4)):_0x9e0f06[_0x21c268(0x243)]({'id':_0x47a7f7,'seg':_0x598d31});}if(_0x299fb1['size']>0x0&&_0x9e0f06[_0x21c268(0x1b5)]>0x0){const {localExpandedRuleToNames:_0x762289}=buildLocalExpandedRuleMappings(_0xcec73c[_0x21c268(0x165)]),_0x53c317=new Map();for(const {id:_0x8853de,seg:_0x16d7e6}of _0x9e0f06){if(_0x16d7e6[_0x21c268(0x20b)]){const _0x42fa3a=apiRuleToYaml(_0x16d7e6['rule']);_0x53c317[_0x21c268(0x1cf)](_0x8853de,_0x42fa3a);}}for(const {id:_0x11564a,seg:_0x286c72}of _0x9e0f06){if(!_0x286c72[_0x21c268(0x20b)])continue;const _0x59f468=_0x53c317[_0x21c268(0x160)](_0x11564a);if(!_0x59f468)continue;const _0x27c421=serializeExpandedRule(_0x59f468,_0x53c317),_0x2d6227=_0x762289[_0x21c268(0x160)](_0x27c421);if(_0x2d6227){const _0x137b96=_0x2d6227[_0x21c268(0x1ba)](_0x1ff765=>_0x299fb1[_0x21c268(0x1aa)](_0x1ff765));_0x137b96&&(_0x5a1d4f[_0x21c268(0x1cf)](_0x137b96,_0x11564a),_0x299fb1[_0x21c268(0x22b)](_0x137b96),logger[_0x21c268(0x1ab)](_0x21c268(0x1d9)+_0x286c72['name']+_0x21c268(0x193)+_0x137b96+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x2ff1ad,_0x4f93a4,_0x402972,_0xbc529b,_0x2ed66f,_0x384307){const _0x41f5a8=a140_0x2d1abb,{journeyDefToRequest:_0x4c4505,activationDefToCreateRequest:_0x1cbb8d,yamlRuleToApi:_0x3afb3c,validateSegmentRule:_0x311b03}=_0x384307,_0x1e756c=new Map(),_0x3b590a=new Map();recoverSegmentIdsFromPushRecovery(_0x4f93a4,_0x1e756c,_0x402972[_0x41f5a8(0x1f6)]);const _0x1854fb=new Map(),_0x14c923=new Map(),_0x2de651=new Map();let _0x487e4b;const _0x5ad461=async()=>{const _0x56ab5b=_0x41f5a8;if(_0x487e4b)return;_0x487e4b=new Map();if(!_0x4f93a4['existingJourney'])return;const _0x593658=await _0x2ff1ad[_0x56ab5b(0x151)]['listActivations'](_0x4f93a4['existingJourney']['id']);for(const _0x893df8 of _0x593658){const _0x3c8bf6=journeyActivationStepToYaml(_0x893df8,_0x402972[_0x56ab5b(0x18e)],_0x402972[_0x56ab5b(0x1a2)]),_0x1dc45f=activationSignature(_0x3c8bf6);!_0x487e4b[_0x56ab5b(0x1aa)](_0x1dc45f)&&_0x487e4b[_0x56ab5b(0x1cf)](_0x1dc45f,_0x893df8['id']),_0x3c8bf6['name']&&_0x3b590a[_0x56ab5b(0x1cf)](_0x3c8bf6['name'],_0x893df8['id']);}};await matchExistingJourneySegments(_0x2ff1ad,_0x4f93a4,_0xbc529b[_0x41f5a8(0x1c5)],_0x402972[_0x41f5a8(0x1bf)],_0x402972[_0x41f5a8(0x1f6)]);const _0x5baa20={'resolveSegmentId':async _0x386661=>{const _0x5cac0d=_0x41f5a8,_0x22443b=_0x402972[_0x5cac0d(0x1f6)][_0x5cac0d(0x160)](_0x386661);if(!_0x22443b)throw new SDKError(ErrorCode[_0x5cac0d(0x162)],_0x5cac0d(0x219)+_0x386661+_0x5cac0d(0x153)+_0x4f93a4[_0x5cac0d(0x165)][_0x5cac0d(0x1d5)]+')');return _0x22443b;},'resolveEmbeddedSegmentId':async(_0x9ac6f5,_0xd39e8f)=>{const _0x23650e=_0x41f5a8,_0x346da2=_0x402972['segmentNameToId'][_0x23650e(0x160)](_0x9ac6f5);if(_0x346da2)return _0x346da2;const _0x480a40=_0x402972[_0x23650e(0x1bf)][_0x23650e(0x1ba)](_0x168899=>_0x168899['name']===_0x9ac6f5);if(_0x480a40)return _0x402972[_0x23650e(0x1f6)][_0x23650e(0x1cf)](_0x9ac6f5,_0x480a40['id']),_0x480a40['id'];if(_0x4f93a4[_0x23650e(0x17b)]){const {stageName:_0x4fc723,criteriaName:_0x4370b3}=findSegmentCriteriaLocation(_0x4f93a4['yamlConfig'],_0x9ac6f5);return _0x311b03(_0x9ac6f5,_0xd39e8f[_0x23650e(0x20b)]),_0x14c923[_0x23650e(0x1cf)](_0x9ac6f5,{'definition':_0xd39e8f,'stageName':_0x4fc723,'criteriaName':_0x4370b3}),createPendingSegmentId(_0x9ac6f5);}const _0x21178c=_0x4f93a4[_0x23650e(0x23d)]?.['id'];if(!_0x21178c)throw new SDKError(ErrorCode[_0x23650e(0x233)],_0x23650e(0x208));const _0xee8fcc=_0x1854fb[_0x23650e(0x160)](_0x9ac6f5);if(_0xee8fcc)return _0xee8fcc;const _0x3aff13=((async()=>{const _0x5c536e=_0x23650e;_0x311b03(_0x9ac6f5,_0xd39e8f[_0x5c536e(0x20b)]);const _0x31ac52=generateDeterministicJourneySegmentName(_0x4f93a4[_0x5c536e(0x165)][_0x5c536e(0x1d5)],_0x9ac6f5),_0xb6f59a=_0x402972['existingSegments']['find'](_0x3ac0fa=>_0x3ac0fa[_0x5c536e(0x1d5)]===_0x31ac52),_0x46da20=createSegmentIdResolver(_0x402972[_0x5c536e(0x1f6)],_0x9ac6f5),_0xaf3574=await resolveRuleSegmentIds(_0xd39e8f[_0x5c536e(0x20b)],_0x46da20);let _0x91eeae;return _0xb6f59a?(await _0x2ff1ad[_0x5c536e(0x150)]['updateSegmentById'](_0xbc529b[_0x5c536e(0x1c5)],_0xb6f59a['id'],{'description':_0xd39e8f[_0x5c536e(0x170)]||_0x5c536e(0x1f5)+_0x9ac6f5,'rule':_0x3afb3c(_0xaf3574,!![]),'countPopulation':!![]}),_0x91eeae=_0xb6f59a['id'],saveSegmentToPushRecovery(_0x4f93a4[_0x5c536e(0x238)],_0x4f93a4[_0x5c536e(0x165)]['name'],_0x9ac6f5,{'segmentId':_0x91eeae,'uniqueServerName':_0x31ac52,'createdAt':new Date()[_0x5c536e(0x211)]()})):_0x91eeae=await createOrRecoverEmbeddedSegment(_0x2ff1ad,_0x4f93a4,{'localName':_0x9ac6f5,'uniqueSegmentName':_0x31ac52,'description':_0xd39e8f[_0x5c536e(0x170)]||_0x5c536e(0x1f5)+_0x9ac6f5,'journeyId':_0x21178c,'resolvedRule':_0xaf3574,'parentId':_0xbc529b['parentId'],'folderId':_0xbc529b[_0x5c536e(0x220)]||''},_0x3afb3c),_0x402972[_0x5c536e(0x1f6)][_0x5c536e(0x1cf)](_0x9ac6f5,_0x91eeae),_0x1e756c['set'](_0x9ac6f5,_0x91eeae),_0x91eeae;})());_0x1854fb[_0x23650e(0x1cf)](_0x9ac6f5,_0x3aff13);try{return await _0x3aff13;}finally{_0x1854fb[_0x23650e(0x22b)](_0x9ac6f5);}},'resolveActivationId':async _0x1967b0=>{const _0x2ea8b9=_0x41f5a8,_0x326ec6=_0x3b590a['get'](_0x1967b0);if(_0x326ec6)return _0x326ec6;if(_0x4f93a4[_0x2ea8b9(0x23d)]){await _0x5ad461();const _0x4b8147=_0x3b590a[_0x2ea8b9(0x160)](_0x1967b0);if(_0x4b8147)return _0x4b8147;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x1967b0+_0x2ea8b9(0x153)+_0x4f93a4[_0x2ea8b9(0x165)][_0x2ea8b9(0x1d5)]+_0x2ea8b9(0x158)+_0x2ea8b9(0x183));},'resolveEmbeddedActivationId':async(_0x3d4489,_0x1a16f2)=>{const _0x361317=_0x41f5a8,_0x201fa1=_0x3b590a[_0x361317(0x160)](_0x3d4489);if(_0x201fa1)return _0x201fa1;if(_0x4f93a4[_0x361317(0x17b)])return _0x2de651[_0x361317(0x1cf)](_0x3d4489,_0x1a16f2),createPendingActivationId(_0x3d4489);if(_0x4f93a4[_0x361317(0x23d)]){await _0x5ad461();const _0x5f3291=_0x3b590a[_0x361317(0x160)](_0x1a16f2['name']);if(_0x5f3291)return _0x3b590a[_0x361317(0x1cf)](_0x3d4489,_0x5f3291),_0x5f3291;const _0x293018=activationSignature(_0x1a16f2),_0x2f532c=_0x487e4b?.[_0x361317(0x160)](_0x293018);if(_0x2f532c)return _0x3b590a[_0x361317(0x1cf)](_0x3d4489,_0x2f532c),_0x2f532c;const _0x1dc1ca=await _0x1cbb8d(_0x1a16f2,_0x402972['activationContext']),_0x3b36bd={..._0x1dc1ca,..._0x1a16f2['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x1a16f2[_0x361317(0x16f)]}},_0x2092b0=await _0x2ff1ad[_0x361317(0x151)]['createActivation'](_0x4f93a4[_0x361317(0x23d)]['id'],_0x3b36bd);return _0x3b590a[_0x361317(0x1cf)](_0x3d4489,_0x2092b0['id']),_0x2092b0['id'];}throw new SDKError(ErrorCode[_0x361317(0x233)],_0x361317(0x173));},'resolveJourneyId':async _0x14f080=>{const _0x3cd4ee=_0x41f5a8;try{return await _0x2ff1ad[_0x3cd4ee(0x151)][_0x3cd4ee(0x16d)](_0xbc529b[_0x3cd4ee(0x1c5)],_0x14f080);}catch(_0x1476e9){throw new SDKError(ErrorCode[_0x3cd4ee(0x228)],_0x3cd4ee(0x171)+_0x14f080+_0x3cd4ee(0x1c4)+_0x4f93a4[_0x3cd4ee(0x165)][_0x3cd4ee(0x1d5)]+'\x27)',_0x1476e9);}},'resolveStageId':async(_0x4ef880,_0x4c8961)=>{const _0x52485d=_0x41f5a8,_0x28e1dc=await _0x2ff1ad['journey'][_0x52485d(0x175)](_0x4ef880),_0x2d080e=_0x28e1dc[_0x52485d(0x225)][_0x52485d(0x202)]['find'](_0xe92646=>_0xe92646['name'][_0x52485d(0x163)]()===_0x4c8961[_0x52485d(0x163)]());if(!_0x2d080e?.['id'])throw new SDKError(ErrorCode[_0x52485d(0x228)],'Stage\x20\x27'+_0x4c8961+_0x52485d(0x1f0)+(_0x28e1dc[_0x52485d(0x225)][_0x52485d(0x1f4)]||_0x28e1dc[_0x52485d(0x225)]['name'])+'\x27');return _0x2d080e['id'];}},_0x6dd2a0=await _0x4c4505(_0x4f93a4['yamlConfig'],_0xbc529b[_0x41f5a8(0x1c5)],_0x5baa20),_0x1683d7=_0xbc529b['folderId']||_0xbc529b['rootFolderId'];_0x1683d7&&(_0x6dd2a0[_0x41f5a8(0x194)]={'parentFolder':{'data':{'id':_0x1683d7,'type':_0x41f5a8(0x168)}}});if(_0x4f93a4[_0x41f5a8(0x17b)]){if(_0x14c923['size']>0x0||_0x2de651[_0x41f5a8(0x18b)]>0x0)return await executeThreeStepJourneyCreate(_0x2ff1ad,_0x4f93a4,_0x6dd2a0,{'pendingEmbeddedSegments':_0x14c923,'pendingEmbeddedActivations':_0x2de651,'embeddedSegmentNameToId':_0x1e756c,'journeyActivationNameToId':_0x3b590a},{..._0xbc529b,'effectiveFolderId':_0x1683d7},_0x402972,_0x2ed66f,_0x384307);else{ensureJourneyDefaults(_0x6dd2a0[_0x41f5a8(0x225)]);const _0x4fe429=await _0x2ff1ad[_0x41f5a8(0x151)][_0x41f5a8(0x185)](_0x6dd2a0);return deletePushRecovery(_0x4f93a4['absolutePath']),{'action':_0x41f5a8(0x1b9),'journeyId':_0x4fe429['id'],'embeddedSegmentNameToId':_0x1e756c};}}else{if(_0x4f93a4[_0x41f5a8(0x21d)]&&_0x4f93a4[_0x41f5a8(0x23d)]){_0x6dd2a0['id']=_0x4f93a4[_0x41f5a8(0x23d)]['id'];const _0x3b9fe6=_0x6dd2a0[_0x41f5a8(0x225)];_0x4f93a4[_0x41f5a8(0x23d)][_0x41f5a8(0x225)]?.[_0x41f5a8(0x1f4)]&&(_0x3b9fe6[_0x41f5a8(0x1f4)]=_0x4f93a4['existingJourney']['attributes'][_0x41f5a8(0x1f4)]);const _0x4e2830=_0x4f93a4[_0x41f5a8(0x23d)][_0x41f5a8(0x225)]?.[_0x41f5a8(0x202)];return _0x4e2830&&_0x6dd2a0['attributes']['journeyStages']&&injectExistingStageIds(_0x6dd2a0[_0x41f5a8(0x225)][_0x41f5a8(0x202)],_0x4e2830),ensureJourneyDefaults(_0x3b9fe6),await _0x2ff1ad[_0x41f5a8(0x151)]['update'](_0x4f93a4[_0x41f5a8(0x23d)]['id'],_0x6dd2a0),deletePushRecovery(_0x4f93a4['absolutePath']),{'action':_0x41f5a8(0x239),'journeyId':_0x4f93a4['existingJourney']['id'],'embeddedSegmentNameToId':_0x1e756c};}}return deletePushRecovery(_0x4f93a4[_0x41f5a8(0x238)]),{'action':_0x41f5a8(0x241),'journeyId':_0x4f93a4[_0x41f5a8(0x23d)]?.['id'],'embeddedSegmentNameToId':_0x1e756c};}function findSegmentCriteriaLocation(_0xba82be,_0x5ee658){const _0x4228f6=a140_0x2d1abb,_0x3d318d=_0xba82be[_0x4228f6(0x1d1)]||_0xba82be['journeys']?.[0x0]?.[_0x4228f6(0x1d1)]||[];let _0x3616b2=_0x4228f6(0x15f),_0x2be877=_0x5ee658;const _0x7e2067=_0xba82be[_0x4228f6(0x182)]||_0xba82be[_0x4228f6(0x203)]?.[0x0]?.[_0x4228f6(0x182)];if(_0x7e2067?.[_0x4228f6(0x150)]===_0x5ee658)return{'stageName':_0x4228f6(0x182),'criteriaName':_0x7e2067[_0x4228f6(0x1d5)]||_0x5ee658};_0x1e965d:for(const _0xa31a07 of _0x3d318d){if(_0xa31a07[_0x4228f6(0x232)]?.[_0x4228f6(0x150)]===_0x5ee658){_0x3616b2=_0xa31a07[_0x4228f6(0x1d5)],_0x2be877=_0xa31a07[_0x4228f6(0x232)][_0x4228f6(0x1d5)]||_0x5ee658;break;}if(_0xa31a07[_0x4228f6(0x188)])for(const _0x1e2d56 of _0xa31a07[_0x4228f6(0x188)]){if(_0x1e2d56[_0x4228f6(0x19d)]===_0x4228f6(0x206)&&_0x1e2d56['with']?.[_0x4228f6(0x245)])for(const _0x431bf6 of _0x1e2d56[_0x4228f6(0x21e)][_0x4228f6(0x245)]){if(_0x431bf6[_0x4228f6(0x150)]===_0x5ee658){_0x3616b2=_0xa31a07['name'],_0x2be877=_0x431bf6[_0x4228f6(0x1d5)]||_0x5ee658;break _0x1e965d;}}}}return{'stageName':_0x3616b2,'criteriaName':_0x2be877};}async function executeThreeStepJourneyCreate(_0x5d6a16,_0x22519d,_0x58d146,_0x2562be,_0x54b9fb,_0x16bbbe,_0xe11df2,_0x1b40ff){const _0x5db076=a140_0x2d1abb,{activationDefToCreateRequest:_0x143f06,yamlRuleToApi:_0x541aa2}=_0x1b40ff,{pendingEmbeddedSegments:_0x2e7997,pendingEmbeddedActivations:_0x6ecc9c,embeddedSegmentNameToId:_0x59c92f}=_0x2562be,_0x1722e7=JSON[_0x5db076(0x1e0)](JSON[_0x5db076(0x21f)](_0x58d146));ensureJourneyDefaults(_0x1722e7[_0x5db076(0x225)]),stripPendingIds(_0x1722e7);const _0x4c0466=await _0x5d6a16[_0x5db076(0x151)][_0x5db076(0x185)](_0x1722e7),_0xa74da6=_0x4c0466['id'],_0x58dcba=new Map();for(const _0x3d8454 of _0x4c0466[_0x5db076(0x225)][_0x5db076(0x202)]){_0x58dcba[_0x5db076(0x1cf)](_0x3d8454[_0x5db076(0x1d5)][_0x5db076(0x163)](),_0x3d8454['id']);}recoverSegmentIdsFromPushRecovery(_0x22519d,_0x59c92f,_0x16bbbe[_0x5db076(0x1f6)]);for(const [_0x116796,{definition:_0x3a5045}]of _0x2e7997){if(_0x59c92f['has'](_0x116796)){_0xe11df2[_0x5db076(0x236)]?.({'type':_0x5db076(0x1b2),'journeyName':_0x22519d[_0x5db076(0x165)][_0x5db076(0x1d5)],'segmentName':_0x116796});continue;}const _0x59c9a6=generateDeterministicJourneySegmentName(_0x22519d[_0x5db076(0x165)][_0x5db076(0x1d5)],_0x116796);_0xe11df2[_0x5db076(0x236)]?.({'type':_0x5db076(0x1f3),'journeyName':_0x22519d[_0x5db076(0x165)][_0x5db076(0x1d5)],'segmentName':_0x116796});const _0x319b10=createSegmentIdResolver(_0x16bbbe[_0x5db076(0x1f6)],_0x116796),_0xa3fc80=await resolveRuleSegmentIds(_0x3a5045[_0x5db076(0x20b)],_0x319b10),_0x5522df=await createOrRecoverEmbeddedSegment(_0x5d6a16,_0x22519d,{'localName':_0x116796,'uniqueSegmentName':_0x59c9a6,'description':_0x3a5045['description']||_0x5db076(0x1f5)+_0x116796,'journeyId':_0xa74da6,'resolvedRule':_0xa3fc80,'parentId':_0x54b9fb[_0x5db076(0x1c5)],'folderId':_0x54b9fb[_0x5db076(0x1d2)]||''},_0x541aa2);_0x59c92f['set'](_0x116796,_0x5522df),_0x16bbbe[_0x5db076(0x1f6)]['set'](_0x116796,_0x5522df),_0xe11df2['onProgress']?.({'type':_0x5db076(0x1b2),'journeyName':_0x22519d[_0x5db076(0x165)][_0x5db076(0x1d5)],'segmentName':_0x116796});}const _0x2c74f5=new Map();for(const [_0x3b76ab,_0x4ecb8c]of _0x6ecc9c){_0xe11df2[_0x5db076(0x236)]?.({'type':_0x5db076(0x172),'journeyName':_0x22519d[_0x5db076(0x165)]['name'],'activationName':_0x3b76ab});const _0x29b32a=await _0x143f06(_0x4ecb8c,_0x16bbbe[_0x5db076(0x14c)]),_0x4eeaec={..._0x29b32a,..._0x4ecb8c[_0x5db076(0x16f)]!==undefined&&{'runAfterJourneyRefresh':_0x4ecb8c[_0x5db076(0x16f)]}},_0x30b3e8=await _0x5d6a16[_0x5db076(0x151)]['createActivation'](_0xa74da6,_0x4eeaec);_0x2c74f5['set'](_0x3b76ab,_0x30b3e8['id']),_0x2562be['journeyActivationNameToId'][_0x5db076(0x1cf)](_0x3b76ab,_0x30b3e8['id']),_0xe11df2[_0x5db076(0x236)]?.({'type':_0x5db076(0x1be),'journeyName':_0x22519d['yamlConfig'][_0x5db076(0x1d5)],'activationName':_0x3b76ab});}const _0x3d39b5=JSON['parse'](JSON[_0x5db076(0x21f)](_0x58d146));return _0x3d39b5['id']=_0xa74da6,ensureJourneyDefaults(_0x3d39b5['attributes']),resolvePendingIdsInRequest(_0x3d39b5,_0x58d146,_0x58dcba,_0x59c92f,_0x2c74f5,_0xe11df2),await _0x5d6a16[_0x5db076(0x151)][_0x5db076(0x1db)](_0xa74da6,_0x3d39b5),deletePushRecovery(_0x22519d[_0x5db076(0x238)]),{'action':'created','journeyId':_0xa74da6,'embeddedSegmentNameToId':_0x59c92f};}export function stripWaitStepPendingIds(_0x523c9e){const _0x312561=a140_0x2d1abb,_0x52b1d7=_0x523c9e[_0x312561(0x1f7)]&&isPendingSegmentId(_0x523c9e[_0x312561(0x1f7)]),_0x1fcddb=_0x523c9e[_0x312561(0x1e6)]?.[_0x312561(0x223)](_0x545a04=>_0x545a04[_0x312561(0x231)]&&isPendingSegmentId(_0x545a04[_0x312561(0x231)]));(_0x52b1d7||_0x1fcddb)&&(_0x523c9e[_0x312561(0x17c)]=_0x312561(0x22f),_0x523c9e[_0x312561(0x20a)]=0x1,_0x523c9e['waitStepUnit']='day',delete _0x523c9e[_0x312561(0x1f7)],delete _0x523c9e[_0x312561(0x197)],delete _0x523c9e[_0x312561(0x1ed)],delete _0x523c9e[_0x312561(0x1e6)]);}export function resolveWaitStepPendingIds(_0x24a381,_0x151831,_0x1fba93,_0xb71028){const _0x5200c1=a140_0x2d1abb;if(_0x151831[_0x5200c1(0x1f7)]&&isPendingSegmentId(_0x151831['conditionSegmentId'])){const _0xb9e29=_0x1fba93(_0x151831[_0x5200c1(0x1f7)],_0x5200c1(0x14e)+_0xb71028+_0x5200c1(0x1b6));_0xb9e29&&(_0x24a381[_0x5200c1(0x17c)]=_0x5200c1(0x1ad),_0x24a381['conditionSegmentId']=_0xb9e29,delete _0x24a381[_0x5200c1(0x20a)],delete _0x24a381['waitStepUnit'],_0x151831[_0x5200c1(0x197)]!==undefined&&(_0x24a381['conditionTimeoutDuration']=_0x151831[_0x5200c1(0x197)]),_0x151831[_0x5200c1(0x1ed)]&&(_0x24a381[_0x5200c1(0x1ed)]=_0x151831['conditionTimeoutUnit']));}if(_0x151831[_0x5200c1(0x1e6)]){const _0x9c5991=_0x151831[_0x5200c1(0x1e6)][_0x5200c1(0x223)](_0x2ef0f5=>_0x2ef0f5[_0x5200c1(0x231)]&&isPendingSegmentId(_0x2ef0f5['segmentId']));if(_0x9c5991){const _0xccf930=_0x151831[_0x5200c1(0x1e6)]['map'](_0x4cb27b=>{const _0x780141=_0x5200c1;if(_0x4cb27b[_0x780141(0x231)]&&isPendingSegmentId(_0x4cb27b['segmentId'])){const _0xd514c0=_0x1fba93(_0x4cb27b[_0x780141(0x231)],_0x780141(0x14e)+_0xb71028+_0x780141(0x1b6));return{..._0x4cb27b,'segmentId':_0xd514c0||_0x4cb27b[_0x780141(0x231)]};}return{..._0x4cb27b};});_0x24a381['waitStepType']='Condition',_0x24a381[_0x5200c1(0x1e6)]=_0xccf930,delete _0x24a381['waitStep'],delete _0x24a381[_0x5200c1(0x221)],delete _0x24a381['conditionSegmentId'],delete _0x24a381[_0x5200c1(0x197)],delete _0x24a381[_0x5200c1(0x1ed)];}}}function stripPendingIds(_0x4066f6){const _0x216f15=a140_0x2d1abb;_0x4066f6[_0x216f15(0x225)][_0x216f15(0x182)]?.['segmentId']&&isPendingSegmentId(_0x4066f6[_0x216f15(0x225)][_0x216f15(0x182)][_0x216f15(0x231)])&&delete _0x4066f6[_0x216f15(0x225)]['goal'];for(const _0x1dadde of _0x4066f6['attributes'][_0x216f15(0x202)]||[]){_0x1dadde[_0x216f15(0x16b)]?.[_0x216f15(0x231)]&&isPendingSegmentId(_0x1dadde['entryCriteria'][_0x216f15(0x231)])&&delete _0x1dadde[_0x216f15(0x16b)];_0x1dadde[_0x216f15(0x1fb)]?.[_0x216f15(0x231)]&&isPendingSegmentId(_0x1dadde[_0x216f15(0x1fb)]['segmentId'])&&delete _0x1dadde[_0x216f15(0x1fb)];_0x1dadde[_0x216f15(0x190)]&&(_0x1dadde[_0x216f15(0x190)]=_0x1dadde[_0x216f15(0x190)][_0x216f15(0x177)](_0x3b351e=>!_0x3b351e[_0x216f15(0x231)]||!isPendingSegmentId(_0x3b351e[_0x216f15(0x231)])));if(_0x1dadde[_0x216f15(0x188)])for(const _0x5e7182 of Object[_0x216f15(0x244)](_0x1dadde[_0x216f15(0x188)])){const _0x1518b7=_0x1dadde['steps'][_0x5e7182];_0x1518b7['type']===_0x216f15(0x22d)&&_0x1518b7['journeyActivationStepId']&&isPendingActivationId(_0x1518b7[_0x216f15(0x21a)])&&(_0x1518b7[_0x216f15(0x21a)]='');if(_0x1518b7['type']===_0x216f15(0x198)&&_0x1518b7['branches'])for(const _0xe39a86 of _0x1518b7[_0x216f15(0x245)]){_0xe39a86[_0x216f15(0x231)]&&isPendingSegmentId(_0xe39a86[_0x216f15(0x231)])&&(_0xe39a86[_0x216f15(0x231)]='');}_0x1518b7[_0x216f15(0x19d)]===_0x216f15(0x1df)&&stripWaitStepPendingIds(_0x1518b7);}}}function resolvePendingIdsInRequest(_0x4b01ce,_0x3059a9,_0x13ad51,_0x118226,_0x1c0fd2,_0x3ac669){const _0x34a6a7=a140_0x2d1abb,_0x2e50a4=(_0x5354db,_0x2fb4e9)=>{const _0xe9c746=a140_0x4f0a;if(!isPendingSegmentId(_0x5354db))return _0x5354db;const _0x43a760=extractPendingSegmentName(_0x5354db),_0x417939=_0x118226['get'](_0x43a760);return!_0x417939&&_0x3ac669['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x43a760+_0xe9c746(0x23c)+_0x2fb4e9),_0x417939;};if(_0x4b01ce[_0x34a6a7(0x225)][_0x34a6a7(0x182)]?.['segmentId']&&isPendingSegmentId(_0x4b01ce['attributes'][_0x34a6a7(0x182)][_0x34a6a7(0x231)])){const _0x5dd734=_0x2e50a4(_0x4b01ce[_0x34a6a7(0x225)][_0x34a6a7(0x182)][_0x34a6a7(0x231)],_0x34a6a7(0x1ac));_0x5dd734&&(_0x4b01ce[_0x34a6a7(0x225)][_0x34a6a7(0x182)][_0x34a6a7(0x231)]=_0x5dd734);}for(const _0x2127d1 of _0x4b01ce['attributes']['journeyStages']||[]){const _0x550e3f=_0x13ad51[_0x34a6a7(0x160)](_0x2127d1[_0x34a6a7(0x1d5)][_0x34a6a7(0x163)]());_0x550e3f&&(_0x2127d1['id']=_0x550e3f);if(_0x2127d1[_0x34a6a7(0x16b)]?.[_0x34a6a7(0x231)]&&isPendingSegmentId(_0x2127d1[_0x34a6a7(0x16b)][_0x34a6a7(0x231)])){const _0x5e9303=_0x2e50a4(_0x2127d1[_0x34a6a7(0x16b)][_0x34a6a7(0x231)],_0x34a6a7(0x14e)+_0x2127d1[_0x34a6a7(0x1d5)]+_0x34a6a7(0x16e));_0x5e9303&&(_0x2127d1[_0x34a6a7(0x16b)][_0x34a6a7(0x231)]=_0x5e9303);}if(_0x2127d1[_0x34a6a7(0x190)])for(const _0x9b344f of _0x2127d1[_0x34a6a7(0x190)]){if(_0x9b344f[_0x34a6a7(0x231)]&&isPendingSegmentId(_0x9b344f[_0x34a6a7(0x231)])){const _0x251030=_0x2e50a4(_0x9b344f['segmentId'],_0x34a6a7(0x14e)+_0x2127d1[_0x34a6a7(0x1d5)]+_0x34a6a7(0x20d));_0x251030&&(_0x9b344f[_0x34a6a7(0x231)]=_0x251030);}}if(_0x2127d1[_0x34a6a7(0x1fb)]?.[_0x34a6a7(0x231)]&&isPendingSegmentId(_0x2127d1[_0x34a6a7(0x1fb)][_0x34a6a7(0x231)])){const _0x2c1f3a=_0x2e50a4(_0x2127d1[_0x34a6a7(0x1fb)][_0x34a6a7(0x231)],'stage\x20\x27'+_0x2127d1[_0x34a6a7(0x1d5)]+'\x27\x20milestone');_0x2c1f3a&&(_0x2127d1[_0x34a6a7(0x1fb)][_0x34a6a7(0x231)]=_0x2c1f3a);}if(_0x2127d1[_0x34a6a7(0x188)]){const _0x31eb41=_0x16aa8b=>_0x3059a9[_0x34a6a7(0x225)][_0x34a6a7(0x202)]?.[_0x34a6a7(0x1ba)](_0x5c5cc6=>_0x5c5cc6[_0x34a6a7(0x1d5)]['toLowerCase']()===_0x2127d1[_0x34a6a7(0x1d5)][_0x34a6a7(0x163)]())?.[_0x34a6a7(0x188)]?.[_0x16aa8b];for(const _0x1fa6dd of Object[_0x34a6a7(0x244)](_0x2127d1[_0x34a6a7(0x188)])){const _0x507cbd=_0x2127d1[_0x34a6a7(0x188)][_0x1fa6dd],_0x56310e=_0x31eb41(_0x1fa6dd);if(_0x507cbd[_0x34a6a7(0x19d)]==='Activation'&&_0x507cbd[_0x34a6a7(0x21a)]&&(isPendingActivationId(_0x507cbd[_0x34a6a7(0x21a)])||_0x507cbd[_0x34a6a7(0x21a)]==='')){if(_0x56310e?.[_0x34a6a7(0x21a)]&&isPendingActivationId(_0x56310e[_0x34a6a7(0x21a)])){const _0x38b0ea=extractPendingActivationName(_0x56310e[_0x34a6a7(0x21a)]),_0x385fe3=_0x1c0fd2[_0x34a6a7(0x160)](_0x38b0ea);_0x385fe3&&(_0x507cbd['journeyActivationStepId']=_0x385fe3);}}if(_0x507cbd[_0x34a6a7(0x19d)]===_0x34a6a7(0x198)&&_0x507cbd[_0x34a6a7(0x245)]&&_0x56310e?.['branches'])for(let _0x5cdbb1=0x0;_0x5cdbb1<_0x507cbd[_0x34a6a7(0x245)]['length'];_0x5cdbb1++){const _0x127e26=_0x507cbd[_0x34a6a7(0x245)][_0x5cdbb1],_0x3c6821=_0x56310e[_0x34a6a7(0x245)][_0x5cdbb1];if(_0x3c6821?.['segmentId']&&isPendingSegmentId(_0x3c6821[_0x34a6a7(0x231)])){const _0x18f769=_0x2e50a4(_0x3c6821[_0x34a6a7(0x231)],_0x34a6a7(0x14e)+_0x2127d1[_0x34a6a7(0x1d5)]+_0x34a6a7(0x1f2)+(_0x127e26[_0x34a6a7(0x1d5)]||_0x5cdbb1)+'\x27');_0x18f769&&(_0x127e26[_0x34a6a7(0x231)]=_0x18f769);}}_0x507cbd[_0x34a6a7(0x19d)]===_0x34a6a7(0x1df)&&_0x56310e?.['type']===_0x34a6a7(0x1df)&&resolveWaitStepPendingIds(_0x507cbd,_0x56310e,_0x2e50a4,_0x2127d1['name']);}}}}
|
|
1
|
+
const a140_0x3e4877=a140_0x60ab;(function(_0xa8f6f1,_0x9dcfdd){const _0x16d3a3=a140_0x60ab,_0x362aa3=_0xa8f6f1();while(!![]){try{const _0x4b80b4=parseInt(_0x16d3a3(0x19b))/0x1+parseInt(_0x16d3a3(0x24b))/0x2*(-parseInt(_0x16d3a3(0x223))/0x3)+parseInt(_0x16d3a3(0x25b))/0x4*(parseInt(_0x16d3a3(0x284))/0x5)+-parseInt(_0x16d3a3(0x1ca))/0x6*(parseInt(_0x16d3a3(0x1e4))/0x7)+-parseInt(_0x16d3a3(0x254))/0x8*(-parseInt(_0x16d3a3(0x238))/0x9)+parseInt(_0x16d3a3(0x1be))/0xa*(parseInt(_0x16d3a3(0x1dd))/0xb)+parseInt(_0x16d3a3(0x22a))/0xc*(-parseInt(_0x16d3a3(0x232))/0xd);if(_0x4b80b4===_0x9dcfdd)break;else _0x362aa3['push'](_0x362aa3['shift']());}catch(_0x462d04){_0x362aa3['push'](_0x362aa3['shift']());}}}(a140_0x46b8,0x67ed7));function a140_0x60ab(_0xc0d973,_0x2813d9){_0xc0d973=_0xc0d973-0x184;const _0x46b8dd=a140_0x46b8();let _0x60ab4=_0x46b8dd[_0xc0d973];return _0x60ab4;}import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a140_0x3e4877(0x1bc));export const PENDING_SEGMENT_PREFIX=a140_0x3e4877(0x1b4);export const PENDING_ACTIVATION_PREFIX=a140_0x3e4877(0x289);export function createPendingSegmentId(_0x4b242d){return''+PENDING_SEGMENT_PREFIX+_0x4b242d+'__';}export function isPendingSegmentId(_0x1b997b){const _0x39d0d8=a140_0x3e4877;return _0x1b997b['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x1b997b[_0x39d0d8(0x249)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x3f3ae0){return _0x3f3ae0['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x533baa){return''+PENDING_ACTIVATION_PREFIX+_0x533baa+'__';}export function isPendingActivationId(_0x728356){const _0x2778b8=a140_0x3e4877;return _0x728356[_0x2778b8(0x249)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x2a0cd0){const _0x2b4472=a140_0x3e4877;return _0x2a0cd0[_0x2b4472(0x24c)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x1fbaf4,_0x2d470c){const _0x485d93=a140_0x3e4877,_0x49717f=_0x1fbaf4+'::'+(_0x2d470c[_0x485d93(0x222)]()||_0x485d93(0x26a)),_0x4956b1=createHash(_0x485d93(0x1e6))[_0x485d93(0x19c)](_0x49717f)[_0x485d93(0x1e2)](_0x485d93(0x226))[_0x485d93(0x244)](0x0,0xc);return _0x485d93(0x19d)+_0x4956b1;}export function ensureJourneyDefaults(_0x4c1d96){const _0x14ef07=a140_0x3e4877;!_0x4c1d96['description']&&(_0x4c1d96[_0x14ef07(0x248)]=''),!_0x4c1d96[_0x14ef07(0x20e)]&&(_0x4c1d96[_0x14ef07(0x20e)]='draft');}export function injectExistingStageIds(_0xe28f28,_0x479f41){const _0x4d7351=a140_0x3e4877,_0x45888a=new Map(_0x479f41[_0x4d7351(0x270)](_0x2149c0=>[_0x2149c0[_0x4d7351(0x1d3)],_0x2149c0['id']]));for(const _0x4826c9 of _0xe28f28){if(!_0x4826c9['id']){const _0x554952=_0x45888a[_0x4d7351(0x1aa)](_0x4826c9[_0x4d7351(0x1d3)]);_0x554952&&(_0x4826c9['id']=_0x554952);}}}export function resolveTDFolderPath(_0x3e23fd,_0xc93618,_0x330e74){if(!_0xc93618)return _0x3e23fd;if(_0x3e23fd===_0x330e74||_0x3e23fd['startsWith'](_0x330e74+'/'))return _0x3e23fd;return _0x3e23fd?_0x330e74+'/'+_0x3e23fd:_0x330e74;}function a140_0x46b8(){const _0x598b8e=['createFolder','SEGMENT_SYNTAX_ERROR','Created\x20journey\x20\x27','relationships','resolveJourneyId','yamlActivation','createJourneySegment','activations','trim','6OGflgA','Creating\x20folder\x20\x27','push','hex','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','ACTIVATION_SYNTAX_ERROR','set','94092vhWijT','versionNumber','Segment\x20not\x20found','relative','\x20journey\x20from\x20file:\x20','segmentFolderId','values','\x27...','2327geLpyP','sort','journey_created','parseDocument','max','diff','369ftRhKe','isNew','yamlConfig','waitStep','waitStepType','journeyName',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','Embedded\x20segment\x20\x27','user','segment_deleting','activationParams','\x20(referenced\x20in\x20journey\x20','slice','absolutePath','rule','folderId','description','startsWith','find','588862BgRhwp','replace','SEGMENT_UPDATE_ERROR','reduce','stringify','journeyById','idToEmailMap','Updating\x20activation\x20\x27','Created\x20activation\x20\x27','151592yKGUBO','Stage\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','activationsBySegmentId','has','getSegment\x20failed\x20for\x20','journeyBundleName','1275508oAfbcj','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','resolvedRule','notification','getSegmentEntity','behavior','stages','updateSegmentById','activation_updated','Failed\x20to\x20fetch\x20referenced\x20segment\x20','Fetching\x20','folderPath','connection','Deleted\x20segment\x20\x27','split','segment','errors','rootFolderId','object','size','Failed\x20to\x20resolve\x20activation\x20','map','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Creating\x20segment\x20\x27','valid','null','some','Updated\x20journey\x20\x27','journeyActivationNameToId','and\x20the\x20server\x20segment,\x20then\x20retry.','parentId','Activation\x20not\x20found:\x20','keys','branches','goal','logInfo','created','segments','existingSegments','deleted','../../utils/async.js','10NaUnyg','filter','segmentId','INTERNAL','create','__pending_act_','toString','activation_creating','toLowerCase','.$1.push-recovery.json','list','DecisionPoint','updated','\x27\x20not\x20found\x20in\x20journey\x20\x27','utf-8','activation_created','entry_criteria','journeyId','uniqueServerName','Duration','length','steps','resolveSegment','segment_updated','Updating\x20segment\x20\x27','JOURNEY_UPDATE_ERROR','WaitStep','NOT_FOUND','index','journey_updating','Delete\x20the\x20push\x20recovery\x20file\x20(','activationStepsById','fetchJourney','595578KiPAga','update','journey_entry_criteria_','\x27\x20wait\x20condition','conditionSegmentId','Updated\x20segment\x20\x27','debug','hasChanges','Activation','getSegmentEntity\x20also\x20failed\x20for\x20','getActivation','activation_updating','listActivations','join','conditionTimeoutUnit','get','all','deleteSegment','\x27\x20to\x20local\x20\x27','Condition','add','segmentNameToId','Deleting\x20activation\x20\x27','\x0a\x20\x20','Matched\x20server\x20segment\x20\x27','__pending_','embedded_segment_created','stage\x20\x27','idToName','flatMap','existingJourney','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x27\x20from\x20file:\x20','tdx.sdk.push-workflow','type','2812360gaGoQq','journeyBundlesByFolderAndName','journeys','entry','with','journey','connectionIdToNameMap','logWarning','isArray','segmentByFolderAndName','validatedRequest','logDeleted','185550vBeBAG','createdSegmentId','SEGMENT_NOT_FOUND','conditions','parse','item','activationActions','\x27\x20milestone','connector_config','name','logSuccess','schedule','Name\x20has\x20already\x20been\x20taken','segment_creating','exitCriterias',').\x20','action','verbose','milestone','22EbPOKx','embedded_segment_creating','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Failed\x20to\x20','withProgress','digest','uniqueSegmentName','35GQwKHu','day','sha1','journeyStages','delete','):\x20','createdSegmentIds','entryCriteria','kind','localName','./child-segment-yaml.js','run_after_journey_refresh','Deleted\x20activation\x20\x27','data','\x27\x20entry\x20criteria','folder_created','./journey-yaml.js','nameToId','embedded_activation_created','conditionTimeoutDuration','progress','\x27\x20for\x20','match','columns','createActivation','toISOString','ACTIVATION_UPDATE_ERROR','waitStepUnit','Created\x20folder\x20\x27','Entry\x20criteria:\x20','decision_point','attributes','results','embeddedSegmentNameToId','activation_template_id','all_columns','\x20activation\x20\x27','Segment\x20not\x20found:\x20','\x27\x20exit\x20criteria','entries','journeyActivationStepId','message','state','existingActivation','onProgress','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','journey_updated','existingSegment','folderPathToId','deps','unchanged','\x27\x20decision\x20point\x20branch\x20\x27','Journey\x20\x27','folder'];a140_0x46b8=function(){return _0x598b8e;};return a140_0x46b8();}export function addFoldersToCreate(_0x51761c,_0x1eb184,_0x4792ba){const _0x5f19ed=a140_0x3e4877;if(!_0x51761c)return;if(_0x1eb184[_0x5f19ed(0x258)](_0x51761c))return;const _0x460f59=_0x51761c[_0x5f19ed(0x269)]('/');let _0xa49ff2='';for(const _0x1e591f of _0x460f59){_0xa49ff2=_0xa49ff2?_0xa49ff2+'/'+_0x1e591f:_0x1e591f,!_0x1eb184[_0x5f19ed(0x258)](_0xa49ff2)&&_0x4792ba[_0x5f19ed(0x1af)](_0xa49ff2);}}export function sortFoldersByDepth(_0x4f32f7){const _0xcaf0b9=a140_0x3e4877;return[..._0x4f32f7][_0xcaf0b9(0x233)]((_0x40a286,_0x50a80)=>{const _0x510090=_0xcaf0b9,_0x276ed2=(_0x40a286[_0x510090(0x1fa)](/\//g)||[])[_0x510090(0x18e)],_0x1226c5=(_0x50a80['match'](/\//g)||[])[_0x510090(0x18e)];return _0x276ed2-_0x1226c5;});}import*as a140_0x452187 from'yaml';import{readFileSync}from'fs';import a140_0x48c2f3 from'path';import{isJourneyDef,parseYamlString as a140_0x262bce,toYamlString as a140_0x40be57,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(_0x4ee1ff){const _0x1db8f6=a140_0x3e4877;if(Array[_0x1db8f6(0x1c6)](_0x4ee1ff))return'['+_0x4ee1ff['map'](_0x547148=>stableStringify(_0x547148))[_0x1db8f6(0x1a8)](',')+']';if(_0x4ee1ff&&typeof _0x4ee1ff===_0x1db8f6(0x26d)){const _0x456ec2=_0x4ee1ff,_0x519d33=Object[_0x1db8f6(0x27b)](_0x456ec2)[_0x1db8f6(0x233)](),_0x466103=_0x519d33[_0x1db8f6(0x270)](_0x48af2e=>'\x22'+_0x48af2e+'\x22:'+stableStringify(_0x456ec2[_0x48af2e]));return'{'+_0x466103[_0x1db8f6(0x1a8)](',')+'}';}const _0x3d4e47=JSON[_0x1db8f6(0x24f)](_0x4ee1ff);return _0x3d4e47===undefined?_0x1db8f6(0x274):_0x3d4e47;}function activationSignature(_0x85e6aa){const _0x42b10a=a140_0x3e4877,_0x4a3bf6={'connection':_0x85e6aa[_0x42b10a(0x267)],..._0x85e6aa[_0x42b10a(0x207)]!==undefined&&{'all_columns':_0x85e6aa[_0x42b10a(0x207)]},..._0x85e6aa[_0x42b10a(0x1fb)]!==undefined&&{'columns':_0x85e6aa[_0x42b10a(0x1fb)]},..._0x85e6aa[_0x42b10a(0x260)]!==undefined&&{'behavior':_0x85e6aa[_0x42b10a(0x260)]},..._0x85e6aa['schedule']!==undefined&&{'schedule':_0x85e6aa[_0x42b10a(0x1d5)]},..._0x85e6aa[_0x42b10a(0x25e)]!==undefined&&{'notification':_0x85e6aa['notification']},..._0x85e6aa[_0x42b10a(0x1d2)]!==undefined&&{'connector_config':_0x85e6aa[_0x42b10a(0x1d2)]},..._0x85e6aa[_0x42b10a(0x206)]!==undefined&&{'activation_template_id':_0x85e6aa[_0x42b10a(0x206)]}};return stableStringify(_0x4a3bf6);}async function fetchSegment(_0x2584f0,_0x47f699,_0x33cdf8,_0x437426){const _0x177463=a140_0x3e4877,_0xa3eee0=_0x437426?.[_0x177463(0x24a)](_0x446d49=>_0x446d49['id']===_0x33cdf8);if(_0xa3eee0)return _0xa3eee0;try{return await _0x2584f0[_0x177463(0x26a)]['getSegment'](_0x47f699,_0x33cdf8);}catch(_0x1dd06e){logger[_0x177463(0x1a1)](_0x177463(0x259)+_0x33cdf8+_0x177463(0x23e)+_0x1dd06e);try{return await _0x2584f0[_0x177463(0x26a)][_0x177463(0x25f)](_0x33cdf8);}catch(_0x821fca){return logger[_0x177463(0x1a1)](_0x177463(0x1a4)+_0x33cdf8+':\x20'+_0x821fca),null;}}}function recoverSegmentIdsFromPushRecovery(_0xc73fe1,_0x381e0c,_0x5fcfd9){const _0x56cb42=a140_0x3e4877,_0x4fc7a0=readPushRecovery(_0xc73fe1['absolutePath']);if(_0x4fc7a0?.[_0x56cb42(0x23d)]===_0xc73fe1['yamlConfig'][_0x56cb42(0x1d3)])for(const [_0x4ae250,_0x584ae7]of Object['entries'](_0x4fc7a0[_0x56cb42(0x280)])){const _0x11f96e=generateDeterministicJourneySegmentName(_0xc73fe1[_0x56cb42(0x23a)][_0x56cb42(0x1d3)],_0x4ae250);_0x584ae7[_0x56cb42(0x18c)]===_0x11f96e&&(_0x381e0c[_0x56cb42(0x229)](_0x4ae250,_0x584ae7[_0x56cb42(0x286)]),_0x5fcfd9[_0x56cb42(0x229)](_0x4ae250,_0x584ae7[_0x56cb42(0x286)]));}}async function createOrRecoverEmbeddedSegment(_0x4658f7,_0x29a3b7,_0x428bed,_0x2c4df9){const _0x3cfbd4=a140_0x3e4877;let _0x252e10;try{_0x252e10=await _0x4658f7['segment'][_0x3cfbd4(0x220)]({'name':_0x428bed['uniqueSegmentName'],'description':_0x428bed[_0x3cfbd4(0x248)],'journeyId':_0x428bed[_0x3cfbd4(0x18b)],'rule':_0x2c4df9(_0x428bed[_0x3cfbd4(0x25d)],!![]),'countPopulation':!![],'parentFolderId':_0x428bed[_0x3cfbd4(0x247)],'audienceId':_0x428bed[_0x3cfbd4(0x279)]});}catch(_0x3e0b5e){const _0x37b5bc=_0x3e0b5e instanceof Error&&_0x3e0b5e[_0x3cfbd4(0x20d)]['includes'](_0x3cfbd4(0x1d6));if(_0x37b5bc){const _0x4dbf80=readPushRecovery(_0x29a3b7['absolutePath']),_0x5c8c83=_0x4dbf80?.[_0x3cfbd4(0x23d)]===_0x29a3b7['yamlConfig'][_0x3cfbd4(0x1d3)]?_0x4dbf80[_0x3cfbd4(0x280)][_0x428bed[_0x3cfbd4(0x1ed)]]:undefined;if(_0x5c8c83?.[_0x3cfbd4(0x18c)]===_0x428bed[_0x3cfbd4(0x1e3)])await _0x4658f7[_0x3cfbd4(0x26a)][_0x3cfbd4(0x262)](_0x428bed['parentId'],_0x5c8c83[_0x3cfbd4(0x286)],{'description':_0x428bed[_0x3cfbd4(0x248)],'rule':_0x2c4df9(_0x428bed[_0x3cfbd4(0x25d)],!![]),'countPopulation':!![]}),_0x252e10=_0x5c8c83[_0x3cfbd4(0x286)];else throw new SDKError(ErrorCode[_0x3cfbd4(0x24d)],_0x3cfbd4(0x23f)+_0x428bed['localName']+_0x3cfbd4(0x211)+(_0x3cfbd4(0x198)+_0x29a3b7[_0x3cfbd4(0x245)][_0x3cfbd4(0x24c)](/([^/]+)$/,_0x3cfbd4(0x28d))+')\x20')+_0x3cfbd4(0x278),_0x3e0b5e);}else throw _0x3e0b5e;}return saveSegmentToPushRecovery(_0x29a3b7[_0x3cfbd4(0x245)],_0x29a3b7[_0x3cfbd4(0x23a)][_0x3cfbd4(0x1d3)],_0x428bed['localName'],{'segmentId':_0x252e10,'uniqueServerName':_0x428bed['uniqueSegmentName'],'createdAt':new Date()[_0x3cfbd4(0x1fd)]()}),_0x252e10;}export async function prepareSegmentFiles(_0x1bb176,_0x586fca,_0x3c95db,_0x29e753,_0x3cb4b0){const _0x4f8006=a140_0x3e4877,{activationDefToCreateRequest:_0x3d6736}=await import(_0x4f8006(0x1ee)),_0xe8f35f=[],_0x5deae3=new Set();for(const {yamlConfig:_0x24e513,folderPath:_0x293858,sourcePath:_0x26edb5}of _0x1bb176){const _0x489552=resolveTDFolderPath(_0x293858,_0x29e753,_0x3cb4b0),_0xe8f340=_0x489552+':'+_0x24e513[_0x4f8006(0x1d3)],_0x518860=_0x586fca[_0x4f8006(0x1c7)]['get'](_0xe8f340),_0xd8684d=_0x518860?_0x586fca[_0x4f8006(0x257)]['get'](_0x518860['id'])||[]:[];addFoldersToCreate(_0x489552,_0x586fca['folderPathToId'],_0x5deae3);const _0x323c79=calculateActivationActions(_0x24e513[_0x4f8006(0x221)]||[],_0xd8684d,_0x586fca[_0x4f8006(0x251)],_0x586fca['connectionIdToNameMap']);for(const _0x48b0e1 of _0x323c79){(_0x48b0e1[_0x4f8006(0x1bd)]==='create'||_0x48b0e1[_0x4f8006(0x1bd)]===_0x4f8006(0x19c))&&_0x48b0e1['yamlActivation']&&(_0x48b0e1['validatedRequest']=await _0x3d6736(_0x48b0e1[_0x4f8006(0x21f)],_0x3c95db));}const _0x41a15c=calculateSegmentDiff(_0x24e513,_0x518860,_0xd8684d,_0x586fca[_0x4f8006(0x251)],_0x586fca[_0x4f8006(0x1c4)]);_0xe8f35f['push']({'relativePath':_0x24e513[_0x4f8006(0x1d3)],'absolutePath':_0x26edb5,'yamlConfig':_0x24e513,'folderPath':_0x489552,'existingSegment':_0x518860,'existingActivations':_0xd8684d,'isNew':_0x41a15c['isNew'],'hasChanges':_0x41a15c[_0x4f8006(0x1a2)],'diff':_0x41a15c[_0x4f8006(0x237)],'activationActions':_0x323c79});}return{'segmentFiles':_0xe8f35f,'foldersToCreate':_0x5deae3};}export async function prepareJourneyFiles(_0x16be13,_0xc5cb26,_0x2b2890,_0x55be5c){const _0x28277f=a140_0x3e4877,_0x50dcb6=[],_0x1109cc=new Set();for(const {yamlConfig:_0x4eab76,folderPath:_0x1ea0cd,sourcePath:_0x2ba4ca}of _0x16be13){const _0x5f254d=resolveTDFolderPath(_0x1ea0cd,_0x2b2890,_0x55be5c),_0x36ca6a=_0x5f254d+':'+_0x4eab76[_0x28277f(0x1d3)],_0x55738b=_0xc5cb26[_0x28277f(0x1bf)]['get'](_0x36ca6a);let _0x15dc60,_0x4c3136;if(_0x55738b&&_0x55738b[_0x28277f(0x18e)]>0x0){const _0x158fe9=buildLocalExpandedRuleMappings(_0x4eab76),{createYamlContext:_0x412528,prefetchJourneySegments:_0x458d0a}=createPushYamlContextForBundle(_0xc5cb26['deps'],_0xc5cb26[_0x28277f(0x279)],_0xc5cb26['existingSegments'],_0x158fe9,_0xc5cb26[_0x28277f(0x251)],_0xc5cb26[_0x28277f(0x1c4)],_0xc5cb26[_0x28277f(0x199)],_0xc5cb26[_0x28277f(0x250)]);await _0x458d0a(_0x55738b[_0x28277f(0x270)](_0xf9d88c=>_0xf9d88c['id']));const _0x4005ba=await _0xc5cb26[_0x28277f(0x215)][_0x28277f(0x1c3)]['getLatestJourneyId'](_0x55738b[0x0]['journeyBundleId']),_0x4fd65b=hasMultipleVersions(_0x4eab76),_0x6f4dc5=async _0x264300=>{const _0x2c88eb=_0x28277f,_0x38e7ba=_0xc5cb26[_0x2c88eb(0x250)]?.['get'](_0x264300);if(_0x38e7ba)return _0x38e7ba;return _0xc5cb26[_0x2c88eb(0x19a)]({'journeyId':_0x264300,'journeyName':_0x4eab76[_0x2c88eb(0x1d3)],'isMultiVersion':_0x55738b['length']>0x1});};if(_0x4fd65b&&_0x55738b[_0x28277f(0x18e)]>0x1){const _0x2860c4=[];for(const _0x4c7015 of _0x55738b){const _0x60d7b7=_0x4c7015[_0x28277f(0x22b)]||0x1;_0xc5cb26[_0x28277f(0x1f8)]?.['update'](_0x28277f(0x265)+_0x4eab76['name']+'\x20v'+_0x60d7b7);const _0x49f2f9=await _0x6f4dc5(_0x4c7015['id']),_0x1c9656=_0x412528(_0x4c7015['id']),_0x415a25=await journeyResponseToDef(_0x49f2f9,_0x1c9656);_0x2860c4[_0x28277f(0x225)]({'item':_0x4c7015,'yaml':_0x415a25});}const _0x23845b=buildLocalRuleToNameMappingFromJourney(_0x4eab76);_0x4c3136=buildMergedJourneyDef(_0x2860c4,_0x23845b,_0x4005ba);const _0x1e6fc5=Math[_0x28277f(0x236)](..._0x2860c4[_0x28277f(0x270)](_0x33fddc=>_0x33fddc[_0x28277f(0x1cf)][_0x28277f(0x22b)]||0x0)),_0x30998f=_0x55738b[_0x28277f(0x24a)](_0x224e76=>(_0x224e76[_0x28277f(0x22b)]||0x0)===_0x1e6fc5);_0x30998f&&(_0xc5cb26[_0x28277f(0x1f8)]?.[_0x28277f(0x19c)]('Fetching\x20'+_0x4eab76[_0x28277f(0x1d3)]+'\x20v'+_0x1e6fc5),_0x15dc60=await _0x6f4dc5(_0x30998f['id']));}else{const _0x5d2879=_0x55738b[_0x55738b['length']-0x1];_0xc5cb26['progress']?.[_0x28277f(0x19c)]('Fetching\x20'+_0x4eab76['name']),_0x15dc60=await _0x6f4dc5(_0x5d2879['id']);const _0x5ef939=_0x412528(_0x5d2879['id']),_0xbc14ee=await journeyResponseToDef(_0x15dc60,_0x5ef939),_0x3f4012=buildLocalRuleToNameMappingFromJourney(_0x4eab76);_0x4c3136=buildMergedJourneyDef([{'item':_0x5d2879,'yaml':_0xbc14ee}],_0x3f4012,_0x4005ba);}}addFoldersToCreate(_0x5f254d,_0xc5cb26['folderPathToId'],_0x1109cc);const _0x103fd9=calculateJourneyDiff(_0x4eab76,_0x4c3136);_0x50dcb6[_0x28277f(0x225)]({'relativePath':_0x4eab76[_0x28277f(0x1d3)],'absolutePath':_0x2ba4ca,'yamlConfig':_0x4eab76,'folderPath':_0x5f254d,'existingJourney':_0x15dc60,'isNew':_0x103fd9[_0x28277f(0x239)],'hasChanges':_0x103fd9[_0x28277f(0x1a2)],'diff':_0x103fd9[_0x28277f(0x237)]});}return{'journeyFiles':_0x50dcb6,'foldersToCreate':_0x1109cc};}export function calculateActivationActions(_0x3f4ce9,_0x1408b8,_0xa3ff89,_0x1fb0bf){const _0x23d50f=a140_0x3e4877,_0x5221ee=[],_0x2ab2ea=new Map();for(const _0xed595f of _0x1408b8){_0x2ab2ea['set'](_0xed595f[_0x23d50f(0x1d3)],_0xed595f);}const _0x3e3b6a=new Map();for(const _0x3e6b22 of _0x3f4ce9){_0x3e3b6a['set'](_0x3e6b22[_0x23d50f(0x1d3)],_0x3e6b22);}for(const _0x57bd38 of _0x3f4ce9){const _0x3ff762=_0x2ab2ea[_0x23d50f(0x1aa)](_0x57bd38[_0x23d50f(0x1d3)]);if(!_0x3ff762)_0x5221ee['push']({'type':_0x23d50f(0x288),'name':_0x57bd38['name'],'yamlActivation':_0x57bd38});else{const _0x1b75bf=activationResponseToDef(_0x3ff762,_0xa3ff89,_0x1fb0bf),_0x5750e6=a140_0x452187[_0x23d50f(0x24f)](_0x1b75bf),_0x3a949d=a140_0x452187[_0x23d50f(0x24f)](_0x57bd38);_0x5750e6!==_0x3a949d&&_0x5221ee[_0x23d50f(0x225)]({'type':_0x23d50f(0x19c),'name':_0x57bd38['name'],'yamlActivation':_0x57bd38,'existingActivation':_0x3ff762});}}for(const _0x3167bb of _0x1408b8){!_0x3e3b6a['has'](_0x3167bb[_0x23d50f(0x1d3)])&&_0x5221ee[_0x23d50f(0x225)]({'type':'delete','name':_0x3167bb[_0x23d50f(0x1d3)],'existingActivation':_0x3167bb});}return _0x5221ee;}function calculateYamlDiff(_0x572822,_0x247b60){if(_0x247b60){const _0x491ac3=generateDiff(_0x247b60,_0x572822),_0x3335e7=hasChanges(_0x491ac3);return{'isNew':![],'hasChanges':_0x3335e7,'diff':_0x3335e7?formatDiffWithColors(_0x491ac3):undefined};}const _0x223d12=generateDiff('',_0x572822);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x223d12)};}export function calculateSegmentDiff(_0x4756e0,_0x2ce1f0,_0xb81c79,_0x4e6487,_0x2bdcad){const _0x17e679=segmentToYamlString(_0x4756e0),_0x1fe765=_0x2ce1f0?segmentToYamlString(segmentWithActivationsToYaml(_0x2ce1f0,_0xb81c79,undefined,_0x4e6487,_0x2bdcad)):undefined;return calculateYamlDiff(_0x17e679,_0x1fe765);}export function calculateJourneyDiff(_0xea788f,_0x560f1d){const _0x2c07c9=normalizeJourneyDef(_0xea788f,_0xea788f),_0x5ca59a=a140_0x40be57(_0x2c07c9),_0x437290=_0x560f1d?a140_0x40be57(normalizeJourneyDef(_0x560f1d,_0xea788f)):undefined;return calculateYamlDiff(_0x5ca59a,_0x437290);}export function findSegmentsToDelete(_0x10da9f,_0x1c2ac8,_0x26a2b1,_0x4a168d,_0x4fb1f1){const _0x2d21ff=a140_0x3e4877,_0x102c88=new Set();for(const {yamlConfig:_0x11e5b8,folderPath:_0x3fa60f}of _0x1c2ac8){_0x102c88[_0x2d21ff(0x1af)](_0x3fa60f+':'+_0x11e5b8[_0x2d21ff(0x1d3)]);}return _0x10da9f[_0x2d21ff(0x285)](_0x388aa3=>{const _0x22bcc2=_0x2d21ff,_0x31aea0=_0x388aa3[_0x22bcc2(0x22f)]?_0x26a2b1[_0x22bcc2(0x1aa)](_0x388aa3[_0x22bcc2(0x22f)][_0x22bcc2(0x28a)]())||'':'',_0xf30e4f=_0x31aea0+':'+_0x388aa3[_0x22bcc2(0x1d3)];if(_0x102c88[_0x22bcc2(0x258)](_0xf30e4f))return![];if(_0x4fb1f1)return _0x31aea0===_0x4a168d||_0x31aea0[_0x22bcc2(0x249)](_0x4a168d+'/');return!![];});}export function findJourneysToDelete(_0x432abb,_0x301e1c,_0x42c0d8,_0x112c5b,_0x1e1939){const _0x3b37d1=a140_0x3e4877,_0x1ca717=new Set();for(const {yamlConfig:_0x2c2f17,folderPath:_0x237129}of _0x301e1c){_0x1ca717[_0x3b37d1(0x1af)](_0x237129+':'+_0x2c2f17[_0x3b37d1(0x1d3)]);}return _0x432abb[_0x3b37d1(0x285)](_0x494240=>{const _0x2886cc=_0x3b37d1,_0x247516=_0x494240['folderId']?_0x42c0d8['get'](_0x494240[_0x2886cc(0x247)])||'':'',_0x4bc18c=_0x247516+':'+_0x494240[_0x2886cc(0x25a)];if(_0x1ca717[_0x2886cc(0x258)](_0x4bc18c))return![];if(_0x1e1939)return _0x247516===_0x112c5b||_0x247516[_0x2886cc(0x249)](_0x112c5b+'/');return!![];});}export function buildSegmentLookupMap(_0x29c95d,_0x4aaed6){const _0x2190d4=a140_0x3e4877,_0x39364b=new Map();for(const _0x522bec of _0x29c95d){const _0x11a3f4=_0x522bec[_0x2190d4(0x22f)]?_0x4aaed6[_0x2190d4(0x1aa)](_0x522bec['segmentFolderId'][_0x2190d4(0x28a)]())||'':'',_0x48ddc6=_0x11a3f4+':'+_0x522bec[_0x2190d4(0x1d3)];_0x39364b[_0x2190d4(0x229)](_0x48ddc6,_0x522bec);}return _0x39364b;}export function buildSegmentNameToIdMap(_0x295b25){const _0x18e065=a140_0x3e4877,_0x13148d=new Map();for(const _0x36fd32 of _0x295b25){_0x13148d['set'](_0x36fd32[_0x18e065(0x1d3)],_0x36fd32['id']);}return _0x13148d;}export function buildJourneyBundleLookupMap(_0x4fa4d8,_0x433e77){const _0xf160f4=a140_0x3e4877,_0x1f03c8=new Map();for(const _0x29a153 of _0x4fa4d8){const _0x3d5f31=_0x29a153[_0xf160f4(0x247)]?_0x433e77[_0xf160f4(0x1aa)](_0x29a153[_0xf160f4(0x247)])||'':'',_0x457123=_0x3d5f31+':'+_0x29a153['journeyBundleName'];!_0x1f03c8[_0xf160f4(0x258)](_0x457123)&&_0x1f03c8[_0xf160f4(0x229)](_0x457123,[]),_0x1f03c8[_0xf160f4(0x1aa)](_0x457123)[_0xf160f4(0x225)](_0x29a153);}for(const _0x3b21d4 of _0x1f03c8[_0xf160f4(0x230)]()){_0x3b21d4[_0xf160f4(0x233)]((_0x2248fa,_0x11dfee)=>(_0x2248fa[_0xf160f4(0x22b)]||0x0)-(_0x11dfee[_0xf160f4(0x22b)]||0x0));}return _0x1f03c8;}export function collectFoldersToCreate(_0xc84f29,_0x23ec76){const _0x2e947e=a140_0x3e4877,_0x277ee9=new Set();for(const _0x5dad90 of _0xc84f29){if(!_0x5dad90)continue;if(_0x23ec76[_0x2e947e(0x258)](_0x5dad90))continue;const _0x3904c5=_0x5dad90[_0x2e947e(0x269)]('/');let _0x13ec36='';for(const _0x49421a of _0x3904c5){_0x13ec36=_0x13ec36?_0x13ec36+'/'+_0x49421a:_0x49421a,!_0x23ec76[_0x2e947e(0x258)](_0x13ec36)&&_0x277ee9[_0x2e947e(0x1af)](_0x13ec36);}}return _0x277ee9;}export function parseAndClassifyYamlFiles(_0x195c54,_0x4fe856,_0x185a24){const _0x344109=a140_0x3e4877,_0x415757=[],_0x5914eb=[];for(const _0x56cee7 of _0x195c54){const _0x421f12=a140_0x48c2f3[_0x344109(0x22d)](_0x4fe856,a140_0x48c2f3['dirname'](_0x56cee7)),_0x33fe65=_0x421f12==='.'?'':_0x421f12,_0x5061cd=readFileSync(_0x56cee7,_0x344109(0x188)),_0x51e526=a140_0x452187['parse'](_0x5061cd);if(isJourneyDef(_0x51e526)){const _0x44b14f=a140_0x262bce(_0x5061cd);_0x5914eb[_0x344109(0x225)]({'yamlConfig':_0x44b14f,'folderPath':_0x33fe65,'sourcePath':_0x56cee7});}else{if(!_0x185a24?.['skipSegments']){const _0x4a9528=parseSegmentYamlFile(_0x5061cd),_0x49e011=normalizeChildSegmentYaml(_0x4a9528);_0x415757[_0x344109(0x225)]({'yamlConfig':_0x49e011,'folderPath':_0x33fe65,'sourcePath':_0x56cee7});}}}return{'segments':_0x415757,'journeys':_0x5914eb};}export function validateParsedFiles(_0x5d2f47,_0x55bee9){const _0x248226=a140_0x3e4877,_0x580de3=[];for(const {yamlConfig:_0x417f5c,sourcePath:_0x2e4f1d}of _0x5d2f47[_0x248226(0x280)]){const _0x3bb56b=readFileSync(_0x2e4f1d,_0x248226(0x188)),_0x48acf1=a140_0x452187['parseDocument'](_0x3bb56b),_0x4aee5a=validateSegmentDef(_0x417f5c,{'source':_0x3bb56b,'document':_0x48acf1},{'skipSchema':!![]});if(!_0x4aee5a['valid']){const _0x406e00=a140_0x48c2f3[_0x248226(0x22d)](_0x55bee9,_0x2e4f1d);_0x580de3[_0x248226(0x225)]({'filePath':_0x406e00,'source':_0x3bb56b,'result':_0x4aee5a,'isJourney':![]});}}for(const {yamlConfig:_0x5aa172,sourcePath:_0x1d613a}of _0x5d2f47[_0x248226(0x1c0)]){const _0x51fd5d=readFileSync(_0x1d613a,_0x248226(0x188)),_0x33cbdf=a140_0x452187[_0x248226(0x235)](_0x51fd5d),_0x486dcb=validateJourneyDef(_0x5aa172,{'source':_0x51fd5d,'document':_0x33cbdf},{'skipSchema':!![]});if(!_0x486dcb[_0x248226(0x273)]){const _0x197108=a140_0x48c2f3[_0x248226(0x22d)](_0x55bee9,_0x1d613a);_0x580de3[_0x248226(0x225)]({'filePath':_0x197108,'source':_0x51fd5d,'result':_0x486dcb,'isJourney':!![]});}}return _0x580de3;}export function formatValidationErrors(_0x42ae64){const _0xc947f6=a140_0x3e4877,_0x44480a=[];for(const {filePath:_0x2cce04,source:_0x4c756c,result:_0x232557,isJourney:_0x359a07}of _0x42ae64){const _0x110599=_0x359a07?_0xc947f6(0x1c3):_0xc947f6(0x26a);_0x44480a[_0xc947f6(0x225)]('\x0a'+_0x2cce04+'\x20('+_0x110599+_0xc947f6(0x1e9)+_0x232557[_0xc947f6(0x26b)][_0xc947f6(0x18e)]+'\x20error(s)'),_0x44480a[_0xc947f6(0x225)](formatValidationResult(_0x232557,_0x4c756c,_0x2cce04));}return _0x44480a[_0xc947f6(0x1a8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x34437b){const _0x23cbf5=a140_0x3e4877,_0x413c91=new Set(),_0x568622=new Map(),_0x2d14d3=collectSegmentUsageCounts(_0x34437b);if(_0x34437b[_0x23cbf5(0x280)])for(const [_0x3ccddf,_0x42c2c0]of Object[_0x23cbf5(0x20b)](_0x34437b[_0x23cbf5(0x280)])){_0x413c91[_0x23cbf5(0x1af)](_0x3ccddf);if(_0x42c2c0['rule']){const _0x1fcab9=yamlRuleToApi(_0x42c2c0[_0x23cbf5(0x246)]),_0x47424b=apiRuleToYaml(_0x1fcab9);_0x568622['set'](_0x3ccddf,_0x47424b);}}const _0x5b482=new Map();let _0x2a51a0=0x0;for(const [_0x44254f,_0x3e57df]of _0x568622){const _0x28f10d=serializeExpandedRule(_0x3e57df,_0x568622),_0x48582d=_0x5b482[_0x23cbf5(0x1aa)](_0x28f10d)||[];_0x48582d[_0x23cbf5(0x225)]({'name':_0x44254f,'index':_0x2a51a0}),_0x5b482[_0x23cbf5(0x229)](_0x28f10d,_0x48582d),_0x2a51a0++;}const _0x39e25f=new Map();for(const [_0x459528,_0x2e68cc]of _0x5b482){const _0x53e397=_0x2e68cc['slice']()['sort']((_0x47aff0,_0x3f9680)=>{const _0x19d212=_0x23cbf5,_0xf1a779=_0x2d14d3[_0x19d212(0x1aa)](_0x47aff0[_0x19d212(0x1d3)])||0x0,_0x4c8303=_0x2d14d3[_0x19d212(0x1aa)](_0x3f9680[_0x19d212(0x1d3)])||0x0;if(_0xf1a779!==_0x4c8303)return _0x4c8303-_0xf1a779;return _0x47aff0[_0x19d212(0x196)]-_0x3f9680[_0x19d212(0x196)];})['map'](_0x4856a6=>_0x4856a6[_0x23cbf5(0x1d3)]),_0xcac4=[];for(const _0xf9ed06 of _0x53e397){const _0x19fb4d=_0x2d14d3[_0x23cbf5(0x1aa)](_0xf9ed06)||0x0,_0x2074c6=Math[_0x23cbf5(0x236)](_0x19fb4d,0x1);for(let _0x48017b=0x0;_0x48017b<_0x2074c6;_0x48017b++){_0xcac4[_0x23cbf5(0x225)](_0xf9ed06);}}_0x39e25f[_0x23cbf5(0x229)](_0x459528,_0xcac4);}return{'existingLocalSegmentNames':_0x413c91,'localSegmentRules':_0x568622,'localExpandedRuleToNames':_0x39e25f};}export function createSegmentIdResolver(_0xd47c1a,_0xa28b36){return async _0x242af9=>{const _0x41e600=a140_0x60ab,_0x27ff87=_0xd47c1a[_0x41e600(0x1aa)](_0x242af9);if(!_0x27ff87)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x41e600(0x209)+_0x242af9+_0x41e600(0x271)+_0xa28b36+'\x27)');return _0x27ff87;};}export function extractRootFolderId(_0x10f7b7){const _0x934f96=a140_0x3e4877;return _0x10f7b7['relationships']?.['parentSegmentFolder']?.['data']?.['id']||_0x10f7b7['relationships']?.['parentFolder']?.[_0x934f96(0x1f1)]?.['id'];}export function buildConnectionMaps(_0x1e581a){const _0x58b0fa=a140_0x3e4877,_0x509764=new Map(),_0x4f3b5f=new Map(),_0x504dd2=new Map();for(const _0x47b4e7 of _0x1e581a){_0x509764[_0x58b0fa(0x229)](_0x47b4e7[_0x58b0fa(0x1d3)],parseInt(_0x47b4e7['id'],0xa)),_0x4f3b5f[_0x58b0fa(0x229)](_0x47b4e7['id'],_0x47b4e7[_0x58b0fa(0x1d3)]),_0x504dd2[_0x58b0fa(0x229)](_0x47b4e7['name'],_0x47b4e7[_0x58b0fa(0x1bd)]);}return{'nameToId':_0x509764,'idToName':_0x4f3b5f,'nameToType':_0x504dd2};}export function calculatePushStats(_0x5bcaa9,_0x94408d,_0x5cbc06,_0x205d20,_0x576125,_0x1f1e3c,_0x4bf661){const _0x3aeebf=a140_0x3e4877,_0x287d43=_0x5bcaa9[_0x3aeebf(0x285)](_0x598c5f=>_0x598c5f[_0x3aeebf(0x239)]),_0x57f6cb=_0x5bcaa9[_0x3aeebf(0x285)](_0x538f40=>!_0x538f40[_0x3aeebf(0x239)]&&_0x538f40[_0x3aeebf(0x1a2)]),_0x669ebb=_0x5bcaa9[_0x3aeebf(0x285)](_0x2ade9f=>!_0x2ade9f[_0x3aeebf(0x239)]&&!_0x2ade9f[_0x3aeebf(0x1a2)]),_0x44a52a=_0x1f1e3c?_0x205d20:[],_0x588669=_0x94408d[_0x3aeebf(0x285)](_0x4e1083=>_0x4e1083[_0x3aeebf(0x239)]),_0x3d95f5=_0x94408d[_0x3aeebf(0x285)](_0x42daee=>!_0x42daee[_0x3aeebf(0x239)]&&_0x42daee[_0x3aeebf(0x1a2)]),_0x40f9ab=_0x94408d[_0x3aeebf(0x285)](_0x563268=>!_0x563268[_0x3aeebf(0x239)]&&!_0x563268[_0x3aeebf(0x1a2)]),_0x4bf406=_0x1f1e3c?_0x576125:[],_0x5745da=_0x5bcaa9[_0x3aeebf(0x1b8)](_0xa0e119=>_0xa0e119[_0x3aeebf(0x1d0)]),_0x38f3ca=_0x5745da[_0x3aeebf(0x285)](_0x42221d=>_0x42221d[_0x3aeebf(0x1bd)]===_0x3aeebf(0x288)),_0x5d5a45=_0x5745da[_0x3aeebf(0x285)](_0x145310=>_0x145310['type']===_0x3aeebf(0x19c)),_0xf56805=_0x5745da['filter'](_0xb9c79f=>_0xb9c79f[_0x3aeebf(0x1bd)]===_0x3aeebf(0x1e8)),_0x5987cd=Array['from'](_0x5cbc06)[_0x3aeebf(0x233)](),_0xa7c87d=_0x4bf661?![]:_0x287d43[_0x3aeebf(0x18e)]>0x0||_0x57f6cb[_0x3aeebf(0x18e)]>0x0||_0x44a52a[_0x3aeebf(0x18e)]>0x0,_0x571028=_0x588669[_0x3aeebf(0x18e)]>0x0||_0x3d95f5[_0x3aeebf(0x18e)]>0x0||_0x4bf406['length']>0x0,_0xa24d7c=_0x4bf661?![]:_0x5745da[_0x3aeebf(0x18e)]>0x0,_0x3e94a3=_0x5987cd[_0x3aeebf(0x18e)]>0x0;return{'segments':{'new':_0x287d43,'changed':_0x57f6cb,'unchanged':_0x669ebb,'toDelete':_0x44a52a},'journeys':{'new':_0x588669,'changed':_0x3d95f5,'unchanged':_0x40f9ab,'toDelete':_0x4bf406},'activations':{'all':_0x5745da,'toCreate':_0x38f3ca,'toUpdate':_0x5d5a45,'toDelete':_0xf56805},'folders':{'toCreate':_0x5987cd},'counts':{'segments':{'new':_0x287d43[_0x3aeebf(0x18e)],'changed':_0x57f6cb[_0x3aeebf(0x18e)],'unchanged':_0x669ebb[_0x3aeebf(0x18e)],'toDelete':_0x44a52a[_0x3aeebf(0x18e)]},'journeys':{'new':_0x588669['length'],'changed':_0x3d95f5[_0x3aeebf(0x18e)],'unchanged':_0x40f9ab[_0x3aeebf(0x18e)],'toDelete':_0x4bf406[_0x3aeebf(0x18e)]},'activations':{'create':_0x38f3ca[_0x3aeebf(0x18e)],'update':_0x5d5a45['length'],'delete':_0xf56805[_0x3aeebf(0x18e)]},'folders':_0x5987cd[_0x3aeebf(0x18e)]},'hasChanges':_0xa7c87d||_0x571028||_0xa24d7c||_0x3e94a3};}export async function buildPushExecutionContext(_0x2f6c26,_0x50df90,_0x184945,_0x56a7a5,_0x1b9e84,_0x213d93){const _0x39e509=a140_0x3e4877,_0x85299d=extractRootFolderId(_0x184945),{pathToId:_0x2f1499,idToPath:_0x34020b}=buildFolderMaps(_0x1b9e84),_0x306d4e=buildSegmentNameToIdMap(_0x56a7a5),_0x20ba18=new Map(),{batchAsync:_0x36945e}=await import('../../utils/async.js'),[_0x5a1069,_0x5d524e]=await Promise[_0x39e509(0x1ab)]([_0x2f6c26[_0x39e509(0x240)]['buildUserMaps'](),_0x2f6c26[_0x39e509(0x267)][_0x39e509(0x184)](),((async()=>{!_0x213d93&&_0x56a7a5['length']>0x0&&await _0x36945e(_0x56a7a5,async _0x1564d6=>{const _0x1bbb49=a140_0x60ab,_0x4145c8=await _0x2f6c26[_0x1bbb49(0x26a)][_0x1bbb49(0x1a7)](_0x50df90,_0x1564d6['id']);_0x20ba18['set'](_0x1564d6['id'],_0x4145c8);});})())]),{emailToId:_0x4268fe,idToEmail:_0x4cba06}=_0x5a1069,_0x49fe42=buildConnectionMaps(_0x5d524e);return{'rootFolderId':_0x85299d,'folderPathToId':_0x2f1499,'folderIdToPath':_0x34020b,'segmentNameToId':_0x306d4e,'activationsBySegmentId':_0x20ba18,'emailToIdMap':_0x4268fe,'idToEmailMap':_0x4cba06,'connectionNameToIdMap':_0x49fe42[_0x39e509(0x1f5)],'connectionIdToNameMap':_0x49fe42[_0x39e509(0x1b7)],'connectionNameToTypeMap':_0x49fe42['nameToType']};}export function createPushYamlContextForBundle(_0x240278,_0x3979c0,_0x8347fe,_0x1d8335,_0x3a0c13,_0x3fc158,_0x30254c,_0x3d8323){const {existingLocalSegmentNames:_0x4816b9,localExpandedRuleToNames:_0x16a184}=_0x1d8335,_0xf8f902=new Set(),_0x415013=new Map(),_0x472a81=new Map(),_0x5897a3=new Map(),_0x4fdac1=createJumpTargetCache(),_0xf2edee=new Map(),_0x58535d=new Map(),_0x3c6b15=new Set();let _0xb2fbe8;const _0xde6260=_0x3eba28=>{const _0x3725bd={'resolveSegment':async _0x2a95d8=>{const _0x44f95c=a140_0x60ab,_0x44e3fe=_0x5897a3[_0x44f95c(0x1aa)](_0x2a95d8);if(_0x44e3fe!==undefined)return{'name':_0x44e3fe,'isJourneyLocal':!![]};try{const _0x25d558=await fetchSegment(_0x240278,_0x3979c0,_0x2a95d8,_0x8347fe);if(!_0x25d558)throw new Error(_0x44f95c(0x22c));const _0x2f8b4d=generateJourneyLocalName(_0x25d558[_0x44f95c(0x1d3)]),_0x3a31ae=_0x25d558[_0x44f95c(0x1ec)]===SEGMENT_KIND_JOURNEY&&_0x2f8b4d!==undefined;let _0x59d56a=_0x25d558[_0x44f95c(0x1d3)],_0x502174;if(_0x3a31ae&&_0x25d558[_0x44f95c(0x246)]){const _0x51944a=apiRuleToYaml(_0x25d558['rule']);_0x58535d[_0x44f95c(0x229)](_0x2a95d8,_0x51944a);const _0x1d58ef=async _0x27013a=>{const _0x32e798=_0x44f95c,_0x1b0c32=collectSegmentRefsFromRule(_0x27013a);for(const _0x328dd8 of _0x1b0c32){if(!_0x58535d[_0x32e798(0x258)](_0x328dd8))try{const _0xfc5c9f=await fetchSegment(_0x240278,_0x3979c0,_0x328dd8,_0x8347fe);if(_0xfc5c9f?.[_0x32e798(0x246)]){const _0x389fb3=apiRuleToYaml(_0xfc5c9f[_0x32e798(0x246)]);_0x58535d['set'](_0x328dd8,_0x389fb3),await _0x1d58ef(_0x389fb3);}}catch(_0x1f6b5f){logger[_0x32e798(0x1a1)](_0x32e798(0x264)+_0x328dd8+':\x20'+_0x1f6b5f);}}};await _0x1d58ef(_0x51944a);const _0x5837c1=serializeExpandedRule(_0x51944a,_0x58535d),_0x12a319=_0x16a184[_0x44f95c(0x1aa)](_0x5837c1);if(_0x12a319&&_0x12a319['length']>0x0){const _0x3b7d62=_0x415013[_0x44f95c(0x1aa)](_0x5837c1)||0x0,_0x8dede5=_0x12a319[_0x3b7d62]||_0x12a319[_0x12a319['length']-0x1];_0x415013['set'](_0x5837c1,_0x3b7d62+0x1),_0x59d56a=_0x8dede5,_0xf8f902[_0x44f95c(0x1af)](_0x59d56a),_0x5897a3[_0x44f95c(0x229)](_0x2a95d8,_0x59d56a);const _0x53a6e5=await resolveRuleSegmentRefs(_0x51944a,async _0x36e408=>{const _0x13e731=_0x44f95c,_0x968d82=_0x5897a3[_0x13e731(0x1aa)](_0x36e408);if(_0x968d82)return _0x968d82;const _0x25167f=await _0xb2fbe8[_0x13e731(0x190)](_0x36e408);return _0x25167f['name'];});_0x502174={'description':_0x25d558['description'],'rule':_0x53a6e5};}else{const _0x3fbf39=_0xf2edee[_0x44f95c(0x1aa)](_0x5837c1);if(_0x3fbf39)_0x59d56a=_0x3fbf39,_0x5897a3[_0x44f95c(0x229)](_0x2a95d8,_0x59d56a);else{if(_0x2f8b4d){let _0x590d0c=_0x2f8b4d,_0x2a2cf4=0x2;while(_0xf8f902[_0x44f95c(0x258)](_0x590d0c)||_0x4816b9[_0x44f95c(0x258)](_0x590d0c)){_0x590d0c=_0x2f8b4d+'_'+_0x2a2cf4,_0x2a2cf4++;}_0xf8f902[_0x44f95c(0x1af)](_0x590d0c),_0x59d56a=_0x590d0c;}_0x5897a3[_0x44f95c(0x229)](_0x2a95d8,_0x59d56a),_0xf2edee[_0x44f95c(0x229)](_0x5837c1,_0x59d56a);const _0xf0ba4d=await resolveRuleSegmentRefs(_0x51944a,async _0x1d8797=>{const _0x359f6a=_0x44f95c,_0x13f258=_0x5897a3[_0x359f6a(0x1aa)](_0x1d8797);if(_0x13f258)return _0x13f258;const _0x4fc8fd=await _0xb2fbe8['resolveSegment'](_0x1d8797);return _0x4fc8fd['name'];});_0x502174={'description':_0x25d558['description'],'rule':_0xf0ba4d};}}}return{'name':_0x59d56a,'isJourneyLocal':_0x3a31ae,'definition':_0x502174};}catch(_0x303be7){return logger[_0x44f95c(0x1a1)]('Failed\x20to\x20resolve\x20segment\x20'+_0x2a95d8+':\x20'+_0x303be7),{'name':_0x2a95d8,'isJourneyLocal':![]};}},'resolveActivation':async _0x223862=>{const _0x1b991e=a140_0x60ab,_0x5cd2e4=_0x472a81[_0x1b991e(0x1aa)](_0x223862);if(_0x5cd2e4!==undefined)return{'name':_0x5cd2e4,'isJourneyLocal':!![]};try{let _0x245bda=_0x30254c?.[_0x1b991e(0x1aa)](_0x223862);!_0x245bda&&(_0x245bda=await _0x240278[_0x1b991e(0x1c3)][_0x1b991e(0x1a5)](_0x3eba28,_0x223862));const _0x9d8b73=_0x245bda[_0x1b991e(0x203)][_0x1b991e(0x242)][_0x1b991e(0x1d3)]||_0x223862,_0x51dce8=sanitizeYamlKey(_0x9d8b73)||'activation_'+_0x223862,_0x5dc188=_0x51dce8;_0x472a81[_0x1b991e(0x229)](_0x223862,_0x5dc188);const _0x1df9ca=journeyActivationStepToYaml(_0x245bda,_0x3a0c13,_0x3fc158);return{'name':_0x5dc188,'isJourneyLocal':!![],'definition':_0x1df9ca};}catch(_0x426bbb){return logger['debug'](_0x1b991e(0x26f)+_0x223862+':\x20'+_0x426bbb),{'name':_0x223862,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x266623,_0x751f5)=>resolveJumpTarget(_0x266623,_0x751f5,_0x4fdac1,async _0x73db68=>{const _0x3e76e1=a140_0x60ab,_0x244f4a=_0x3d8323?.[_0x3e76e1(0x1aa)](_0x73db68);if(_0x244f4a)return _0x244f4a;return _0x240278[_0x3e76e1(0x1c3)]['getJourney'](_0x73db68);})};return _0xb2fbe8=_0x3725bd,_0x3725bd;},_0x2c723b=async _0x586d83=>{const _0x4fdd4b=a140_0x60ab,{collectSegmentIdsFromJourneyApi:_0x4f7faa}=await import(_0x4fdd4b(0x1f4)),{batchAsync:_0x25cba3}=await import(_0x4fdd4b(0x283)),_0x46396e=new Set();for(const _0x46c35f of _0x586d83){let _0x5b8495=_0x3d8323?.['get'](_0x46c35f);!_0x5b8495&&(_0x5b8495=await _0x240278[_0x4fdd4b(0x1c3)]['getJourney'](_0x46c35f));const _0x45ecd2=_0x4f7faa(_0x5b8495);for(const _0x2b86d5 of _0x45ecd2){_0x46396e[_0x4fdd4b(0x1af)](_0x2b86d5);}}let _0x264a06=Array['from'](_0x46396e);while(_0x264a06[_0x4fdd4b(0x18e)]>0x0){const _0x48760b=_0x264a06[_0x4fdd4b(0x285)](_0x4509e0=>!_0x3c6b15[_0x4fdd4b(0x258)](_0x4509e0));if(_0x48760b[_0x4fdd4b(0x18e)]===0x0)break;const _0x3adb63=await _0x25cba3(_0x48760b,async _0x1df170=>{const _0x270604=_0x4fdd4b;_0x3c6b15[_0x270604(0x1af)](_0x1df170);const _0x490f87=await fetchSegment(_0x240278,_0x3979c0,_0x1df170,_0x8347fe);if(!_0x490f87)return null;return{'segmentId':_0x1df170,'segment':_0x490f87};},0xa),_0x3d2e2d=new Set();for(const _0x3f7118 of _0x3adb63){if(!_0x3f7118?.['segment']?.[_0x4fdd4b(0x246)])continue;const _0x53657d=apiRuleToYaml(_0x3f7118[_0x4fdd4b(0x26a)][_0x4fdd4b(0x246)]);_0x58535d['set'](_0x3f7118['segmentId'],_0x53657d);const _0x1b5453=collectSegmentRefsFromRule(_0x53657d);for(const _0x1f220d of _0x1b5453){!_0x3c6b15['has'](_0x1f220d)&&_0x3d2e2d[_0x4fdd4b(0x1af)](_0x1f220d);}}_0x264a06=Array['from'](_0x3d2e2d);}};return{'createYamlContext':_0xde6260,'prefetchJourneySegments':_0x2c723b};}export async function executePushSegments(_0x440f0d,_0x3c799a,_0x58fe94,_0xf6aac4,_0x55a812){const _0x429804=a140_0x3e4877,{segmentDefToCreateRequest:_0x3c1a30,segmentDefToUpdateRequest:_0x45960e}=await import(_0x429804(0x1ee)),_0x369d9f=_0x58fe94[_0x429804(0x214)],_0x5e9d59=0x5,_0x593fe9=async _0xbedbc0=>{const _0x567d21=_0x429804,_0x4477bb=_0xbedbc0[_0x567d21(0x266)]?_0x369d9f['get'](_0xbedbc0['folderPath']):undefined;let _0x42dc48;const _0x16fec0={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xe4a4f5=_0xbedbc0[_0x567d21(0x23a)];if(_0xbedbc0[_0x567d21(0x23a)][_0x567d21(0x246)]){const _0x14a227=createSegmentIdResolver(_0x58fe94[_0x567d21(0x1b0)],_0xbedbc0['yamlConfig']['name']),_0x365150=await resolveRuleSegmentIds(_0xbedbc0['yamlConfig'][_0x567d21(0x246)],_0x14a227);_0xe4a4f5={..._0xbedbc0[_0x567d21(0x23a)],'rule':_0x365150};}try{if(_0xbedbc0[_0x567d21(0x239)]){_0x55a812[_0x567d21(0x210)]?.({'type':_0x567d21(0x1d7),'name':_0xbedbc0['yamlConfig'][_0x567d21(0x1d3)]});const _0x16c244=_0x3c1a30(_0xe4a4f5,_0x4477bb),_0x12d5a1=await _0x55a812[_0x567d21(0x1e1)](_0x567d21(0x272)+_0xbedbc0[_0x567d21(0x23a)]['name']+_0x567d21(0x231),()=>_0x440f0d[_0x567d21(0x26a)]['createSegment'](_0xf6aac4[_0x567d21(0x279)],_0x16c244));_0x42dc48=_0x12d5a1['data']['id'],_0x58fe94[_0x567d21(0x1b0)][_0x567d21(0x229)](_0xbedbc0[_0x567d21(0x23a)][_0x567d21(0x1d3)],_0x42dc48),_0x16fec0['createdSegmentId']={'name':_0xbedbc0[_0x567d21(0x23a)][_0x567d21(0x1d3)],'id':_0x42dc48},_0x55a812['onProgress']?.({'type':'segment_created','name':_0xbedbc0['yamlConfig']['name'],'segmentId':_0x42dc48}),_0x55a812[_0x567d21(0x1d4)]?.('Created\x20segment\x20\x27'+_0xbedbc0[_0x567d21(0x23a)][_0x567d21(0x1d3)]+'\x27'),_0x16fec0[_0x567d21(0x27f)]=0x1;}else{if(_0xbedbc0[_0x567d21(0x1a2)]){_0x55a812[_0x567d21(0x210)]?.({'type':'segment_updating','name':_0xbedbc0['yamlConfig'][_0x567d21(0x1d3)]});const _0x42af42=_0x45960e(_0xe4a4f5);_0x4477bb!==_0xbedbc0[_0x567d21(0x213)]?.[_0x567d21(0x22f)]&&(_0x42af42[_0x567d21(0x22f)]=_0x4477bb?parseInt(_0x4477bb,0xa):undefined),await _0x55a812[_0x567d21(0x1e1)](_0x567d21(0x192)+_0xbedbc0[_0x567d21(0x23a)][_0x567d21(0x1d3)]+'\x27...',()=>_0x440f0d['segment'][_0x567d21(0x262)](_0xf6aac4[_0x567d21(0x279)],_0xbedbc0[_0x567d21(0x213)]['id'],_0x42af42)),_0x42dc48=_0xbedbc0[_0x567d21(0x213)]['id'],_0x55a812[_0x567d21(0x210)]?.({'type':_0x567d21(0x191),'name':_0xbedbc0[_0x567d21(0x23a)][_0x567d21(0x1d3)]}),_0x55a812['logSuccess']?.(_0x567d21(0x1a0)+_0xbedbc0[_0x567d21(0x23a)][_0x567d21(0x1d3)]+'\x27'),_0x16fec0['updated']=0x1;}else _0x42dc48=_0xbedbc0[_0x567d21(0x213)]['id'];}}catch(_0x3beec8){const _0x2591e0=isHttp400Error(_0x3beec8),_0x157a0d=_0x2591e0?ErrorCode[_0x567d21(0x21b)]:ErrorCode[_0x567d21(0x24d)],_0x1f4207=getErrorMessage(_0x3beec8);throw new SDKError(_0x157a0d,_0x567d21(0x1e0)+(_0xbedbc0[_0x567d21(0x239)]?_0x567d21(0x288):_0x567d21(0x19c))+'\x20segment\x20from\x20file:\x20'+_0xbedbc0[_0x567d21(0x245)]+'\x0a\x20\x20'+_0x1f4207,_0x3beec8);}try{const _0x1f7908=await syncActivationsForSegment(_0x440f0d,_0xf6aac4[_0x567d21(0x279)],_0x42dc48,_0xbedbc0[_0x567d21(0x23a)][_0x567d21(0x1d3)],_0xbedbc0[_0x567d21(0x1d0)],_0x55a812,_0xbedbc0[_0x567d21(0x245)]);_0x16fec0[_0x567d21(0x221)]=_0x1f7908;}catch(_0x4dbb89){if(_0x4dbb89 instanceof SDKError)throw _0x4dbb89;throw new SDKError(ErrorCode[_0x567d21(0x1fe)],_0x567d21(0x256)+_0xbedbc0[_0x567d21(0x23a)][_0x567d21(0x1d3)]+_0x567d21(0x1bb)+_0xbedbc0[_0x567d21(0x245)]+_0x567d21(0x1b2)+getErrorMessage(_0x4dbb89),_0x4dbb89);}return _0x16fec0;},_0x30cef8=await batchAsync(_0x3c799a,_0x593fe9,_0x5e9d59),_0x1d2630={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x23a6e7 of _0x30cef8){_0x1d2630[_0x429804(0x27f)]+=_0x23a6e7['created'],_0x1d2630[_0x429804(0x186)]+=_0x23a6e7[_0x429804(0x186)],_0x23a6e7[_0x429804(0x1cb)]&&_0x1d2630[_0x429804(0x1ea)][_0x429804(0x229)](_0x23a6e7[_0x429804(0x1cb)][_0x429804(0x1d3)],_0x23a6e7[_0x429804(0x1cb)]['id']),_0x1d2630[_0x429804(0x221)][_0x429804(0x27f)]+=_0x23a6e7[_0x429804(0x221)][_0x429804(0x27f)],_0x1d2630['activations'][_0x429804(0x186)]+=_0x23a6e7['activations'][_0x429804(0x186)],_0x1d2630['activations'][_0x429804(0x282)]+=_0x23a6e7[_0x429804(0x221)]['deleted'];}return _0x1d2630;}async function syncActivationsForSegment(_0x381f95,_0x5154f7,_0x3c01f5,_0x4eb6e1,_0x362dd3,_0x33c272,_0x397a3b){const _0x1cb023=a140_0x3e4877,_0x24b804={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4a306a of _0x362dd3){try{if(_0x4a306a[_0x1cb023(0x1bd)]===_0x1cb023(0x288)&&_0x4a306a['validatedRequest'])_0x33c272[_0x1cb023(0x210)]?.({'type':_0x1cb023(0x28b),'segmentName':_0x4eb6e1,'activationName':_0x4a306a[_0x1cb023(0x1d3)]}),await _0x33c272[_0x1cb023(0x1e1)]('Creating\x20activation\x20\x27'+_0x4a306a['name']+'\x27...',()=>_0x381f95['segment']['createActivation'](_0x5154f7,_0x3c01f5,_0x4a306a[_0x1cb023(0x1c8)])),_0x33c272[_0x1cb023(0x210)]?.({'type':_0x1cb023(0x189),'segmentName':_0x4eb6e1,'activationName':_0x4a306a[_0x1cb023(0x1d3)]}),_0x33c272[_0x1cb023(0x1d4)]?.(_0x1cb023(0x253)+_0x4a306a[_0x1cb023(0x1d3)]+'\x27'),_0x24b804[_0x1cb023(0x27f)]++;else{if(_0x4a306a[_0x1cb023(0x1bd)]===_0x1cb023(0x19c)&&_0x4a306a['validatedRequest']&&_0x4a306a['existingActivation'])_0x33c272[_0x1cb023(0x210)]?.({'type':_0x1cb023(0x1a6),'segmentName':_0x4eb6e1,'activationName':_0x4a306a[_0x1cb023(0x1d3)]}),await _0x33c272['withProgress'](_0x1cb023(0x252)+_0x4a306a['name']+_0x1cb023(0x231),()=>_0x381f95[_0x1cb023(0x26a)]['updateActivation'](_0x5154f7,_0x3c01f5,_0x4a306a[_0x1cb023(0x20f)]['id'],_0x4a306a['validatedRequest'])),_0x33c272[_0x1cb023(0x210)]?.({'type':_0x1cb023(0x263),'segmentName':_0x4eb6e1,'activationName':_0x4a306a[_0x1cb023(0x1d3)]}),_0x33c272['logSuccess']?.('Updated\x20activation\x20\x27'+_0x4a306a[_0x1cb023(0x1d3)]+'\x27'),_0x24b804[_0x1cb023(0x186)]++;else _0x4a306a[_0x1cb023(0x1bd)]===_0x1cb023(0x1e8)&&_0x4a306a['existingActivation']&&(_0x33c272['onProgress']?.({'type':'activation_deleting','segmentName':_0x4eb6e1,'activationName':_0x4a306a['name']}),await _0x33c272[_0x1cb023(0x1e1)](_0x1cb023(0x1b1)+_0x4a306a['name']+_0x1cb023(0x231),()=>_0x381f95[_0x1cb023(0x26a)]['deleteActivation'](_0x5154f7,_0x3c01f5,_0x4a306a[_0x1cb023(0x20f)]['id'])),_0x33c272[_0x1cb023(0x210)]?.({'type':'activation_deleted','segmentName':_0x4eb6e1,'activationName':_0x4a306a['name']}),_0x33c272[_0x1cb023(0x1c9)]?.(_0x1cb023(0x1f0)+_0x4a306a['name']+'\x27'),_0x24b804[_0x1cb023(0x282)]++);}}catch(_0x42e923){const _0x282c77=isHttp400Error(_0x42e923),_0x4c55df=_0x282c77?ErrorCode[_0x1cb023(0x228)]:ErrorCode[_0x1cb023(0x1fe)],_0x4ec243=getErrorMessage(_0x42e923);throw new SDKError(_0x4c55df,_0x1cb023(0x1e0)+_0x4a306a['type']+_0x1cb023(0x208)+_0x4a306a[_0x1cb023(0x1d3)]+_0x1cb023(0x1bb)+_0x397a3b+_0x1cb023(0x1b2)+_0x4ec243,_0x42e923);}}return _0x24b804;}export async function executePushFolders(_0x150f55,_0x4d2956,_0x4f7ea5,_0x10baf5,_0x55ac61){const _0x2e5b89=a140_0x3e4877,_0x228fc6=new Map(_0x4f7ea5),_0x4206c3=sortFoldersByDepth(_0x4d2956);for(const _0x10e225 of _0x4206c3){const _0x1684f4=_0x10e225[_0x2e5b89(0x269)]('/'),_0x4901d8=_0x1684f4[_0x1684f4['length']-0x1],_0x4fc88c=_0x1684f4[_0x2e5b89(0x244)](0x0,-0x1)['join']('/'),_0x125ff9=_0x228fc6[_0x2e5b89(0x1aa)](_0x4fc88c);_0x55ac61[_0x2e5b89(0x210)]?.({'type':'folder_creating','folder':_0x10e225});const _0x1da3c4={'name':_0x4901d8,'parentFolderId':_0x125ff9},_0x4ff276=await _0x55ac61[_0x2e5b89(0x1e1)](_0x2e5b89(0x224)+_0x10e225+_0x2e5b89(0x231),()=>_0x150f55[_0x2e5b89(0x26a)][_0x2e5b89(0x21a)](_0x10baf5[_0x2e5b89(0x279)],_0x1da3c4));_0x228fc6['set'](_0x10e225,_0x4ff276[_0x2e5b89(0x1f1)]['id']),_0x55ac61['onProgress']?.({'type':_0x2e5b89(0x1f3),'folder':_0x10e225,'folderId':_0x4ff276[_0x2e5b89(0x1f1)]['id']}),_0x55ac61[_0x2e5b89(0x27e)]?.(_0x2e5b89(0x200)+_0x10e225+'\x27');}return _0x228fc6;}export async function executePushSegmentDeletions(_0x501c10,_0x5a868d,_0x1c9f53){const _0x4d1204=a140_0x3e4877;if(_0x5a868d['length']===0x0)return 0x0;const {batchAsync:_0x573508}=await import(_0x4d1204(0x283)),_0x8d1165=0x5,_0xaeaca3=await _0x573508(_0x5a868d,async _0x9c42a8=>{const _0x3cb6b6=_0x4d1204;return _0x1c9f53[_0x3cb6b6(0x210)]?.({'type':_0x3cb6b6(0x241),'name':_0x9c42a8['name']}),await _0x501c10[_0x3cb6b6(0x26a)][_0x3cb6b6(0x1ac)](_0x9c42a8['id']),_0x1c9f53[_0x3cb6b6(0x210)]?.({'type':'segment_deleted','name':_0x9c42a8[_0x3cb6b6(0x1d3)]}),_0x1c9f53[_0x3cb6b6(0x1c9)]?.(_0x3cb6b6(0x268)+_0x9c42a8[_0x3cb6b6(0x1d3)]+'\x27'),0x1;},_0x8d1165);return _0xaeaca3[_0x4d1204(0x24e)]((_0x12592a,_0x17c313)=>_0x12592a+_0x17c313,0x0);}export async function executePushJourneys(_0x274d63,_0x3f079d,_0x480c66,_0x10b3cb,_0x43530f){const _0x8bc98d=a140_0x3e4877,{journeyDefToRequest:_0x28121b}=await import(_0x8bc98d(0x1f4)),{activationDefToCreateRequest:_0x2080ab,yamlRuleToApi:_0x3e59c1,validateSegmentRule:_0x4203c9}=await import('./child-segment-yaml.js'),_0x4eaca5={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x11c371=new Map(_0x480c66[_0x8bc98d(0x1b0)]),_0x5aafec=0x5;for(let _0xad8f6f=0x0;_0xad8f6f<_0x3f079d[_0x8bc98d(0x18e)];_0xad8f6f+=_0x5aafec){const _0x590c90=_0x3f079d[_0x8bc98d(0x244)](_0xad8f6f,_0xad8f6f+_0x5aafec),_0x2271cb=await Promise[_0x8bc98d(0x1ab)](_0x590c90[_0x8bc98d(0x270)](async _0x5abd49=>{const _0x4ef31b=_0x8bc98d;if(!_0x5abd49['isNew']&&!_0x5abd49['hasChanges'])return{'action':'unchanged','name':_0x5abd49[_0x4ef31b(0x23a)][_0x4ef31b(0x1d3)],'journeyId':_0x5abd49[_0x4ef31b(0x1b9)]?.['id']};const _0x3097f2=_0x5abd49['folderPath']?_0x480c66[_0x4ef31b(0x214)]['get'](_0x5abd49[_0x4ef31b(0x266)]):undefined;_0x43530f[_0x4ef31b(0x210)]?.({'type':_0x5abd49[_0x4ef31b(0x239)]?'journey_creating':_0x4ef31b(0x197),'name':_0x5abd49[_0x4ef31b(0x23a)][_0x4ef31b(0x1d3)]});try{const _0x184a9d=await executeSingleJourneyPush(_0x274d63,_0x5abd49,{..._0x480c66,'segmentNameToId':_0x11c371},{'parentId':_0x10b3cb[_0x4ef31b(0x279)],'rootFolderId':_0x10b3cb[_0x4ef31b(0x26c)],'folderId':_0x3097f2,'verbose':_0x10b3cb[_0x4ef31b(0x1db)]},_0x43530f,{'journeyDefToRequest':_0x28121b,'activationDefToCreateRequest':_0x2080ab,'yamlRuleToApi':_0x3e59c1,'validateSegmentRule':_0x4203c9});for(const [_0x23557e,_0x24c558]of _0x184a9d[_0x4ef31b(0x205)]){_0x11c371[_0x4ef31b(0x229)](_0x23557e,_0x24c558),_0x4eaca5[_0x4ef31b(0x205)][_0x4ef31b(0x229)](_0x23557e,_0x24c558);}if(_0x184a9d[_0x4ef31b(0x1da)]===_0x4ef31b(0x27f))_0x43530f[_0x4ef31b(0x210)]?.({'type':_0x4ef31b(0x234),'name':_0x5abd49[_0x4ef31b(0x23a)][_0x4ef31b(0x1d3)],'journeyId':_0x184a9d[_0x4ef31b(0x18b)]}),_0x43530f[_0x4ef31b(0x1d4)]?.(_0x4ef31b(0x21c)+_0x5abd49['yamlConfig'][_0x4ef31b(0x1d3)]+'\x27'),_0x4eaca5['created']++;else _0x184a9d[_0x4ef31b(0x1da)]===_0x4ef31b(0x186)&&(_0x43530f['onProgress']?.({'type':_0x4ef31b(0x212),'name':_0x5abd49['yamlConfig'][_0x4ef31b(0x1d3)]}),_0x43530f['logSuccess']?.(_0x4ef31b(0x276)+_0x5abd49[_0x4ef31b(0x23a)][_0x4ef31b(0x1d3)]+'\x27'),_0x4eaca5['updated']++);return{'action':_0x184a9d['action'],'name':_0x5abd49[_0x4ef31b(0x23a)][_0x4ef31b(0x1d3)],'journeyId':_0x184a9d[_0x4ef31b(0x18b)]};}catch(_0x543e57){const _0x217298=isHttp400Error(_0x543e57),_0x11ad4c=_0x217298?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x4ef31b(0x193)],_0x113673=getErrorMessage(_0x543e57);throw new SDKError(_0x11ad4c,_0x4ef31b(0x1e0)+(_0x5abd49[_0x4ef31b(0x239)]?'create':_0x4ef31b(0x19c))+_0x4ef31b(0x22e)+_0x5abd49[_0x4ef31b(0x245)]+_0x4ef31b(0x1b2)+_0x113673,_0x543e57);}}));_0x4eaca5[_0x8bc98d(0x204)][_0x8bc98d(0x225)](..._0x2271cb);}return _0x4eaca5;}async function matchExistingJourneySegments(_0x4190ed,_0x48db9b,_0x2aa64a,_0x263995,_0x4d10b5){const _0x57f31d=a140_0x3e4877;if(!_0x48db9b[_0x57f31d(0x1b9)]||!_0x48db9b[_0x57f31d(0x23a)]['segments'])return;const _0xc88ab7=new Map(),_0x51bf39=new Set();for(const _0x2efd51 of Object['keys'](_0x48db9b[_0x57f31d(0x23a)]['segments'])){const _0x245e35=generateDeterministicJourneySegmentName(_0x48db9b[_0x57f31d(0x23a)][_0x57f31d(0x1d3)],_0x2efd51);_0xc88ab7[_0x57f31d(0x229)](_0x245e35,_0x2efd51),_0x51bf39[_0x57f31d(0x1af)](_0x2efd51);}const _0x5824f0=[],_0xa6e400=collectSegmentIdsFromJourneyApi(_0x48db9b[_0x57f31d(0x1b9)]);for(const _0x44f43b of _0xa6e400){const _0x19123e=await fetchSegment(_0x4190ed,_0x2aa64a,_0x44f43b,_0x263995);if(!_0x19123e?.[_0x57f31d(0x1d3)])continue;const _0x587e41=_0xc88ab7[_0x57f31d(0x1aa)](_0x19123e['name']);_0x587e41?(_0x4d10b5[_0x57f31d(0x229)](_0x587e41,_0x44f43b),_0x51bf39[_0x57f31d(0x1e8)](_0x587e41)):_0x5824f0[_0x57f31d(0x225)]({'id':_0x44f43b,'seg':_0x19123e});}if(_0x51bf39[_0x57f31d(0x26e)]>0x0&&_0x5824f0['length']>0x0){const {localExpandedRuleToNames:_0x32dcbb}=buildLocalExpandedRuleMappings(_0x48db9b[_0x57f31d(0x23a)]),_0x497de7=new Map();for(const {id:_0x409f4f,seg:_0x1d245d}of _0x5824f0){if(_0x1d245d[_0x57f31d(0x246)]){const _0x133251=apiRuleToYaml(_0x1d245d[_0x57f31d(0x246)]);_0x497de7[_0x57f31d(0x229)](_0x409f4f,_0x133251);}}for(const {id:_0x152e5a,seg:_0x39f1bb}of _0x5824f0){if(!_0x39f1bb[_0x57f31d(0x246)])continue;const _0x2e298f=_0x497de7['get'](_0x152e5a);if(!_0x2e298f)continue;const _0x2393f5=serializeExpandedRule(_0x2e298f,_0x497de7),_0x27d0d0=_0x32dcbb[_0x57f31d(0x1aa)](_0x2393f5);if(_0x27d0d0){const _0x547bf2=_0x27d0d0['find'](_0x32436f=>_0x51bf39[_0x57f31d(0x258)](_0x32436f));_0x547bf2&&(_0x4d10b5['set'](_0x547bf2,_0x152e5a),_0x51bf39['delete'](_0x547bf2),logger[_0x57f31d(0x1a1)](_0x57f31d(0x1b3)+_0x39f1bb[_0x57f31d(0x1d3)]+_0x57f31d(0x1ad)+_0x547bf2+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x52e574,_0x4a8e77,_0x3942e7,_0x399ee9,_0x3da4e6,_0x267412){const _0x4db3e1=a140_0x3e4877,{journeyDefToRequest:_0x54f3ac,activationDefToCreateRequest:_0x434558,yamlRuleToApi:_0x3ff24a,validateSegmentRule:_0x147a5f}=_0x267412,_0x29b4a3=new Map(),_0x38d647=new Map();recoverSegmentIdsFromPushRecovery(_0x4a8e77,_0x29b4a3,_0x3942e7[_0x4db3e1(0x1b0)]);const _0x2d2e2e=new Map(),_0x202090=new Map(),_0x1515dd=new Map();let _0x64496;const _0x22a178=async()=>{const _0x1fbb5c=_0x4db3e1;if(_0x64496)return;_0x64496=new Map();if(!_0x4a8e77['existingJourney'])return;const _0x52f695=await _0x52e574[_0x1fbb5c(0x1c3)]['listActivations'](_0x4a8e77[_0x1fbb5c(0x1b9)]['id']);for(const _0x1d8b06 of _0x52f695){const _0x416426=journeyActivationStepToYaml(_0x1d8b06,_0x3942e7['idToEmailMap'],_0x3942e7[_0x1fbb5c(0x1c4)]),_0x544d71=activationSignature(_0x416426);!_0x64496[_0x1fbb5c(0x258)](_0x544d71)&&_0x64496[_0x1fbb5c(0x229)](_0x544d71,_0x1d8b06['id']),_0x416426[_0x1fbb5c(0x1d3)]&&_0x38d647[_0x1fbb5c(0x229)](_0x416426[_0x1fbb5c(0x1d3)],_0x1d8b06['id']);}};await matchExistingJourneySegments(_0x52e574,_0x4a8e77,_0x399ee9[_0x4db3e1(0x279)],_0x3942e7['existingSegments'],_0x3942e7[_0x4db3e1(0x1b0)]);const _0x5c2d6b={'resolveSegmentId':async _0x4eccb2=>{const _0x2aa346=_0x4db3e1,_0x17206d=_0x3942e7[_0x2aa346(0x1b0)]['get'](_0x4eccb2);if(!_0x17206d)throw new SDKError(ErrorCode[_0x2aa346(0x1cc)],'Segment\x20not\x20found:\x20'+_0x4eccb2+_0x2aa346(0x243)+_0x4a8e77[_0x2aa346(0x23a)][_0x2aa346(0x1d3)]+')');return _0x17206d;},'resolveEmbeddedSegmentId':async(_0x2983d9,_0xe552ee)=>{const _0x359b9d=_0x4db3e1,_0x1975c7=_0x3942e7[_0x359b9d(0x1b0)][_0x359b9d(0x1aa)](_0x2983d9);if(_0x1975c7)return _0x1975c7;const _0x580acd=_0x3942e7['existingSegments'][_0x359b9d(0x24a)](_0x2bc7e9=>_0x2bc7e9['name']===_0x2983d9);if(_0x580acd)return _0x3942e7[_0x359b9d(0x1b0)][_0x359b9d(0x229)](_0x2983d9,_0x580acd['id']),_0x580acd['id'];if(_0x4a8e77['isNew']){const {stageName:_0x20e938,criteriaName:_0x39492f}=findSegmentCriteriaLocation(_0x4a8e77[_0x359b9d(0x23a)],_0x2983d9);return _0x147a5f(_0x2983d9,_0xe552ee[_0x359b9d(0x246)]),_0x202090[_0x359b9d(0x229)](_0x2983d9,{'definition':_0xe552ee,'stageName':_0x20e938,'criteriaName':_0x39492f}),createPendingSegmentId(_0x2983d9);}const _0x361b90=_0x4a8e77[_0x359b9d(0x1b9)]?.['id'];if(!_0x361b90)throw new SDKError(ErrorCode['INTERNAL'],_0x359b9d(0x1ba));const _0x5d4bee=_0x2d2e2e[_0x359b9d(0x1aa)](_0x2983d9);if(_0x5d4bee)return _0x5d4bee;const _0x1463ad=((async()=>{const _0x5ea005=_0x359b9d;_0x147a5f(_0x2983d9,_0xe552ee[_0x5ea005(0x246)]);const _0x5c19ee=generateDeterministicJourneySegmentName(_0x4a8e77[_0x5ea005(0x23a)][_0x5ea005(0x1d3)],_0x2983d9),_0x54db3c=_0x3942e7[_0x5ea005(0x281)][_0x5ea005(0x24a)](_0x493047=>_0x493047[_0x5ea005(0x1d3)]===_0x5c19ee),_0x22b7f6=createSegmentIdResolver(_0x3942e7['segmentNameToId'],_0x2983d9),_0x51023c=await resolveRuleSegmentIds(_0xe552ee[_0x5ea005(0x246)],_0x22b7f6);let _0xecf466;return _0x54db3c?(await _0x52e574[_0x5ea005(0x26a)][_0x5ea005(0x262)](_0x399ee9[_0x5ea005(0x279)],_0x54db3c['id'],{'description':_0xe552ee[_0x5ea005(0x248)]||_0x5ea005(0x201)+_0x2983d9,'rule':_0x3ff24a(_0x51023c,!![]),'countPopulation':!![]}),_0xecf466=_0x54db3c['id'],saveSegmentToPushRecovery(_0x4a8e77[_0x5ea005(0x245)],_0x4a8e77['yamlConfig'][_0x5ea005(0x1d3)],_0x2983d9,{'segmentId':_0xecf466,'uniqueServerName':_0x5c19ee,'createdAt':new Date()[_0x5ea005(0x1fd)]()})):_0xecf466=await createOrRecoverEmbeddedSegment(_0x52e574,_0x4a8e77,{'localName':_0x2983d9,'uniqueSegmentName':_0x5c19ee,'description':_0xe552ee[_0x5ea005(0x248)]||_0x5ea005(0x201)+_0x2983d9,'journeyId':_0x361b90,'resolvedRule':_0x51023c,'parentId':_0x399ee9['parentId'],'folderId':_0x399ee9[_0x5ea005(0x26c)]||''},_0x3ff24a),_0x3942e7[_0x5ea005(0x1b0)][_0x5ea005(0x229)](_0x2983d9,_0xecf466),_0x29b4a3[_0x5ea005(0x229)](_0x2983d9,_0xecf466),_0xecf466;})());_0x2d2e2e['set'](_0x2983d9,_0x1463ad);try{return await _0x1463ad;}finally{_0x2d2e2e[_0x359b9d(0x1e8)](_0x2983d9);}},'resolveActivationId':async _0x1bad44=>{const _0x3bce1f=_0x4db3e1,_0x483ac7=_0x38d647[_0x3bce1f(0x1aa)](_0x1bad44);if(_0x483ac7)return _0x483ac7;if(_0x4a8e77[_0x3bce1f(0x1b9)]){await _0x22a178();const _0x3b853d=_0x38d647[_0x3bce1f(0x1aa)](_0x1bad44);if(_0x3b853d)return _0x3b853d;}throw new SDKError(ErrorCode[_0x3bce1f(0x195)],_0x3bce1f(0x27a)+_0x1bad44+_0x3bce1f(0x243)+_0x4a8e77[_0x3bce1f(0x23a)][_0x3bce1f(0x1d3)]+_0x3bce1f(0x1d9)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x198535,_0x10d9e5)=>{const _0x4986f2=_0x4db3e1,_0x1c2cff=_0x38d647['get'](_0x198535);if(_0x1c2cff)return _0x1c2cff;if(_0x4a8e77[_0x4986f2(0x239)])return _0x1515dd[_0x4986f2(0x229)](_0x198535,_0x10d9e5),createPendingActivationId(_0x198535);if(_0x4a8e77[_0x4986f2(0x1b9)]){await _0x22a178();const _0x8fed3f=_0x38d647[_0x4986f2(0x1aa)](_0x10d9e5['name']);if(_0x8fed3f)return _0x38d647['set'](_0x198535,_0x8fed3f),_0x8fed3f;const _0x3cab01=activationSignature(_0x10d9e5),_0x1c3ad8=_0x64496?.['get'](_0x3cab01);if(_0x1c3ad8)return _0x38d647[_0x4986f2(0x229)](_0x198535,_0x1c3ad8),_0x1c3ad8;const _0x3ddcab=await _0x434558(_0x10d9e5,_0x3942e7['activationContext']),_0x467c2d={..._0x3ddcab,..._0x10d9e5[_0x4986f2(0x1ef)]!==undefined&&{'runAfterJourneyRefresh':_0x10d9e5[_0x4986f2(0x1ef)]}},_0x90fbad=await _0x52e574[_0x4986f2(0x1c3)][_0x4986f2(0x1fc)](_0x4a8e77[_0x4986f2(0x1b9)]['id'],_0x467c2d);return _0x38d647[_0x4986f2(0x229)](_0x198535,_0x90fbad['id']),_0x90fbad['id'];}throw new SDKError(ErrorCode[_0x4986f2(0x287)],_0x4986f2(0x1df));},'resolveJourneyId':async _0x353689=>{const _0x29eb85=_0x4db3e1;try{return await _0x52e574[_0x29eb85(0x1c3)][_0x29eb85(0x21e)](_0x399ee9['parentId'],_0x353689);}catch(_0x734c23){throw new SDKError(ErrorCode[_0x29eb85(0x195)],_0x29eb85(0x218)+_0x353689+_0x29eb85(0x227)+_0x4a8e77[_0x29eb85(0x23a)][_0x29eb85(0x1d3)]+'\x27)',_0x734c23);}},'resolveStageId':async(_0x370962,_0x50588a)=>{const _0x41bdf2=_0x4db3e1,_0x214f2a=await _0x52e574['journey']['getJourney'](_0x370962),_0x426c23=_0x214f2a[_0x41bdf2(0x203)][_0x41bdf2(0x1e7)]['find'](_0x35691a=>_0x35691a[_0x41bdf2(0x1d3)]['toLowerCase']()===_0x50588a[_0x41bdf2(0x28c)]());if(!_0x426c23?.['id'])throw new SDKError(ErrorCode[_0x41bdf2(0x195)],_0x41bdf2(0x255)+_0x50588a+_0x41bdf2(0x187)+(_0x214f2a[_0x41bdf2(0x203)][_0x41bdf2(0x25a)]||_0x214f2a[_0x41bdf2(0x203)]['name'])+'\x27');return _0x426c23['id'];}},_0x292e08=await _0x54f3ac(_0x4a8e77[_0x4db3e1(0x23a)],_0x399ee9['parentId'],_0x5c2d6b),_0x1f05ad=_0x399ee9[_0x4db3e1(0x247)]||_0x399ee9[_0x4db3e1(0x26c)];_0x1f05ad&&(_0x292e08[_0x4db3e1(0x21d)]={'parentFolder':{'data':{'id':_0x1f05ad,'type':_0x4db3e1(0x219)}}});if(_0x4a8e77[_0x4db3e1(0x239)]){if(_0x202090['size']>0x0||_0x1515dd['size']>0x0)return await executeThreeStepJourneyCreate(_0x52e574,_0x4a8e77,_0x292e08,{'pendingEmbeddedSegments':_0x202090,'pendingEmbeddedActivations':_0x1515dd,'embeddedSegmentNameToId':_0x29b4a3,'journeyActivationNameToId':_0x38d647},{..._0x399ee9,'effectiveFolderId':_0x1f05ad},_0x3942e7,_0x3da4e6,_0x267412);else{ensureJourneyDefaults(_0x292e08['attributes']);const _0x3bdaaf=await _0x52e574[_0x4db3e1(0x1c3)][_0x4db3e1(0x288)](_0x292e08);return deletePushRecovery(_0x4a8e77['absolutePath']),{'action':_0x4db3e1(0x27f),'journeyId':_0x3bdaaf['id'],'embeddedSegmentNameToId':_0x29b4a3};}}else{if(_0x4a8e77[_0x4db3e1(0x1a2)]&&_0x4a8e77[_0x4db3e1(0x1b9)]){_0x292e08['id']=_0x4a8e77[_0x4db3e1(0x1b9)]['id'];const _0x281929=_0x292e08[_0x4db3e1(0x203)];_0x4a8e77[_0x4db3e1(0x1b9)]['attributes']?.[_0x4db3e1(0x25a)]&&(_0x281929[_0x4db3e1(0x25a)]=_0x4a8e77[_0x4db3e1(0x1b9)][_0x4db3e1(0x203)][_0x4db3e1(0x25a)]);const _0x4bb73a=_0x4a8e77[_0x4db3e1(0x1b9)]['attributes']?.['journeyStages'];return _0x4bb73a&&_0x292e08[_0x4db3e1(0x203)][_0x4db3e1(0x1e7)]&&injectExistingStageIds(_0x292e08['attributes'][_0x4db3e1(0x1e7)],_0x4bb73a),ensureJourneyDefaults(_0x281929),await _0x52e574['journey'][_0x4db3e1(0x19c)](_0x4a8e77[_0x4db3e1(0x1b9)]['id'],_0x292e08),deletePushRecovery(_0x4a8e77[_0x4db3e1(0x245)]),{'action':_0x4db3e1(0x186),'journeyId':_0x4a8e77[_0x4db3e1(0x1b9)]['id'],'embeddedSegmentNameToId':_0x29b4a3};}}return deletePushRecovery(_0x4a8e77[_0x4db3e1(0x245)]),{'action':_0x4db3e1(0x216),'journeyId':_0x4a8e77[_0x4db3e1(0x1b9)]?.['id'],'embeddedSegmentNameToId':_0x29b4a3};}function findSegmentCriteriaLocation(_0x1a3c98,_0x338bcd){const _0x26f8db=a140_0x3e4877,_0x1ed0d6=_0x1a3c98[_0x26f8db(0x261)]||_0x1a3c98[_0x26f8db(0x1c0)]?.[0x0]?.[_0x26f8db(0x261)]||[];let _0x50972c=_0x26f8db(0x1c1),_0x5611d5=_0x338bcd;const _0x3a9a87=_0x1a3c98[_0x26f8db(0x27d)]||_0x1a3c98[_0x26f8db(0x1c0)]?.[0x0]?.[_0x26f8db(0x27d)];if(_0x3a9a87?.[_0x26f8db(0x26a)]===_0x338bcd)return{'stageName':_0x26f8db(0x27d),'criteriaName':_0x3a9a87[_0x26f8db(0x1d3)]||_0x338bcd};_0x4a82af:for(const _0x1773f1 of _0x1ed0d6){if(_0x1773f1[_0x26f8db(0x18a)]?.[_0x26f8db(0x26a)]===_0x338bcd){_0x50972c=_0x1773f1[_0x26f8db(0x1d3)],_0x5611d5=_0x1773f1[_0x26f8db(0x18a)]['name']||_0x338bcd;break;}if(_0x1773f1[_0x26f8db(0x18f)])for(const _0x29ab85 of _0x1773f1['steps']){if(_0x29ab85[_0x26f8db(0x1bd)]===_0x26f8db(0x202)&&_0x29ab85[_0x26f8db(0x1c2)]?.['branches'])for(const _0x4f1bbb of _0x29ab85[_0x26f8db(0x1c2)][_0x26f8db(0x27c)]){if(_0x4f1bbb['segment']===_0x338bcd){_0x50972c=_0x1773f1['name'],_0x5611d5=_0x4f1bbb[_0x26f8db(0x1d3)]||_0x338bcd;break _0x4a82af;}}}}return{'stageName':_0x50972c,'criteriaName':_0x5611d5};}async function executeThreeStepJourneyCreate(_0x219a28,_0x2fff3c,_0x2aadd2,_0x3c899c,_0x244e36,_0x407779,_0x2b7f03,_0x3accd7){const _0x435ee0=a140_0x3e4877,{activationDefToCreateRequest:_0x1b60aa,yamlRuleToApi:_0x4ebd6a}=_0x3accd7,{pendingEmbeddedSegments:_0x5126a1,pendingEmbeddedActivations:_0x1b6713,embeddedSegmentNameToId:_0x164629}=_0x3c899c,_0x657064=JSON[_0x435ee0(0x1ce)](JSON['stringify'](_0x2aadd2));ensureJourneyDefaults(_0x657064[_0x435ee0(0x203)]),stripPendingIds(_0x657064);const _0x351808=await _0x219a28[_0x435ee0(0x1c3)]['create'](_0x657064),_0xb94f84=_0x351808['id'],_0x201bd6=new Map();for(const _0x724774 of _0x351808['attributes']['journeyStages']){_0x201bd6['set'](_0x724774['name'][_0x435ee0(0x28c)](),_0x724774['id']);}recoverSegmentIdsFromPushRecovery(_0x2fff3c,_0x164629,_0x407779[_0x435ee0(0x1b0)]);for(const [_0x2101d5,{definition:_0x2fbc10}]of _0x5126a1){if(_0x164629[_0x435ee0(0x258)](_0x2101d5)){_0x2b7f03['onProgress']?.({'type':_0x435ee0(0x1b5),'journeyName':_0x2fff3c[_0x435ee0(0x23a)]['name'],'segmentName':_0x2101d5});continue;}const _0x22a8e8=generateDeterministicJourneySegmentName(_0x2fff3c[_0x435ee0(0x23a)][_0x435ee0(0x1d3)],_0x2101d5);_0x2b7f03[_0x435ee0(0x210)]?.({'type':_0x435ee0(0x1de),'journeyName':_0x2fff3c[_0x435ee0(0x23a)]['name'],'segmentName':_0x2101d5});const _0x1fa54a=createSegmentIdResolver(_0x407779[_0x435ee0(0x1b0)],_0x2101d5),_0x5767df=await resolveRuleSegmentIds(_0x2fbc10[_0x435ee0(0x246)],_0x1fa54a),_0x140848=await createOrRecoverEmbeddedSegment(_0x219a28,_0x2fff3c,{'localName':_0x2101d5,'uniqueSegmentName':_0x22a8e8,'description':_0x2fbc10[_0x435ee0(0x248)]||_0x435ee0(0x201)+_0x2101d5,'journeyId':_0xb94f84,'resolvedRule':_0x5767df,'parentId':_0x244e36[_0x435ee0(0x279)],'folderId':_0x244e36['effectiveFolderId']||''},_0x4ebd6a);_0x164629[_0x435ee0(0x229)](_0x2101d5,_0x140848),_0x407779[_0x435ee0(0x1b0)][_0x435ee0(0x229)](_0x2101d5,_0x140848),_0x2b7f03[_0x435ee0(0x210)]?.({'type':_0x435ee0(0x1b5),'journeyName':_0x2fff3c[_0x435ee0(0x23a)][_0x435ee0(0x1d3)],'segmentName':_0x2101d5});}const _0x37e3d6=new Map();for(const [_0x589e3f,_0x4a55ed]of _0x1b6713){_0x2b7f03['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x2fff3c[_0x435ee0(0x23a)][_0x435ee0(0x1d3)],'activationName':_0x589e3f});const _0x69cd45=await _0x1b60aa(_0x4a55ed,_0x407779['activationContext']),_0xbafd1={..._0x69cd45,..._0x4a55ed['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x4a55ed['run_after_journey_refresh']}},_0x1fe786=await _0x219a28[_0x435ee0(0x1c3)][_0x435ee0(0x1fc)](_0xb94f84,_0xbafd1);_0x37e3d6[_0x435ee0(0x229)](_0x589e3f,_0x1fe786['id']),_0x3c899c[_0x435ee0(0x277)]['set'](_0x589e3f,_0x1fe786['id']),_0x2b7f03[_0x435ee0(0x210)]?.({'type':_0x435ee0(0x1f6),'journeyName':_0x2fff3c[_0x435ee0(0x23a)][_0x435ee0(0x1d3)],'activationName':_0x589e3f});}const _0x1085be=JSON[_0x435ee0(0x1ce)](JSON[_0x435ee0(0x24f)](_0x2aadd2));return _0x1085be['id']=_0xb94f84,ensureJourneyDefaults(_0x1085be['attributes']),resolvePendingIdsInRequest(_0x1085be,_0x2aadd2,_0x201bd6,_0x164629,_0x37e3d6,_0x2b7f03),await _0x219a28[_0x435ee0(0x1c3)][_0x435ee0(0x19c)](_0xb94f84,_0x1085be),deletePushRecovery(_0x2fff3c[_0x435ee0(0x245)]),{'action':_0x435ee0(0x27f),'journeyId':_0xb94f84,'embeddedSegmentNameToId':_0x164629};}export function stripWaitStepPendingIds(_0x15b4a9){const _0x199354=a140_0x3e4877,_0x43d5c4=_0x15b4a9[_0x199354(0x19f)]&&isPendingSegmentId(_0x15b4a9[_0x199354(0x19f)]),_0x31458c=_0x15b4a9[_0x199354(0x1cd)]?.['some'](_0x41a64c=>_0x41a64c[_0x199354(0x286)]&&isPendingSegmentId(_0x41a64c['segmentId']));(_0x43d5c4||_0x31458c)&&(_0x15b4a9[_0x199354(0x23c)]=_0x199354(0x18d),_0x15b4a9[_0x199354(0x23b)]=0x1,_0x15b4a9[_0x199354(0x1ff)]=_0x199354(0x1e5),delete _0x15b4a9[_0x199354(0x19f)],delete _0x15b4a9[_0x199354(0x1f7)],delete _0x15b4a9['conditionTimeoutUnit'],delete _0x15b4a9['conditions']);}export function resolveWaitStepPendingIds(_0x166fe5,_0x2fbe83,_0x389b2c,_0x431374){const _0x28204d=a140_0x3e4877;if(_0x2fbe83[_0x28204d(0x19f)]&&isPendingSegmentId(_0x2fbe83[_0x28204d(0x19f)])){const _0x1238b4=_0x389b2c(_0x2fbe83['conditionSegmentId'],_0x28204d(0x1b6)+_0x431374+_0x28204d(0x19e));_0x1238b4&&(_0x166fe5[_0x28204d(0x23c)]=_0x28204d(0x1ae),_0x166fe5['conditionSegmentId']=_0x1238b4,delete _0x166fe5['waitStep'],delete _0x166fe5[_0x28204d(0x1ff)],_0x2fbe83['conditionTimeoutDuration']!==undefined&&(_0x166fe5[_0x28204d(0x1f7)]=_0x2fbe83[_0x28204d(0x1f7)]),_0x2fbe83['conditionTimeoutUnit']&&(_0x166fe5[_0x28204d(0x1a9)]=_0x2fbe83['conditionTimeoutUnit']));}if(_0x2fbe83[_0x28204d(0x1cd)]){const _0x3e6c8c=_0x2fbe83[_0x28204d(0x1cd)][_0x28204d(0x275)](_0x47556f=>_0x47556f[_0x28204d(0x286)]&&isPendingSegmentId(_0x47556f[_0x28204d(0x286)]));if(_0x3e6c8c){const _0x198b81=_0x2fbe83[_0x28204d(0x1cd)][_0x28204d(0x270)](_0x2c4e5d=>{const _0x4ddbc4=_0x28204d;if(_0x2c4e5d[_0x4ddbc4(0x286)]&&isPendingSegmentId(_0x2c4e5d['segmentId'])){const _0x3ecae7=_0x389b2c(_0x2c4e5d[_0x4ddbc4(0x286)],_0x4ddbc4(0x1b6)+_0x431374+_0x4ddbc4(0x19e));return{..._0x2c4e5d,'segmentId':_0x3ecae7||_0x2c4e5d[_0x4ddbc4(0x286)]};}return{..._0x2c4e5d};});_0x166fe5['waitStepType']=_0x28204d(0x1ae),_0x166fe5[_0x28204d(0x1cd)]=_0x198b81,delete _0x166fe5[_0x28204d(0x23b)],delete _0x166fe5[_0x28204d(0x1ff)],delete _0x166fe5[_0x28204d(0x19f)],delete _0x166fe5['conditionTimeoutDuration'],delete _0x166fe5[_0x28204d(0x1a9)];}}}function stripPendingIds(_0x34c1b5){const _0x1d0871=a140_0x3e4877;_0x34c1b5[_0x1d0871(0x203)]['goal']?.[_0x1d0871(0x286)]&&isPendingSegmentId(_0x34c1b5[_0x1d0871(0x203)]['goal']['segmentId'])&&delete _0x34c1b5['attributes']['goal'];for(const _0xf39e0c of _0x34c1b5['attributes'][_0x1d0871(0x1e7)]||[]){_0xf39e0c[_0x1d0871(0x1eb)]?.['segmentId']&&isPendingSegmentId(_0xf39e0c[_0x1d0871(0x1eb)][_0x1d0871(0x286)])&&delete _0xf39e0c['entryCriteria'];_0xf39e0c['milestone']?.[_0x1d0871(0x286)]&&isPendingSegmentId(_0xf39e0c[_0x1d0871(0x1dc)][_0x1d0871(0x286)])&&delete _0xf39e0c[_0x1d0871(0x1dc)];_0xf39e0c[_0x1d0871(0x1d8)]&&(_0xf39e0c[_0x1d0871(0x1d8)]=_0xf39e0c[_0x1d0871(0x1d8)][_0x1d0871(0x285)](_0x54fe70=>!_0x54fe70[_0x1d0871(0x286)]||!isPendingSegmentId(_0x54fe70[_0x1d0871(0x286)])));if(_0xf39e0c[_0x1d0871(0x18f)])for(const _0x5a687f of Object[_0x1d0871(0x27b)](_0xf39e0c[_0x1d0871(0x18f)])){const _0x506901=_0xf39e0c[_0x1d0871(0x18f)][_0x5a687f];_0x506901[_0x1d0871(0x1bd)]===_0x1d0871(0x1a3)&&_0x506901[_0x1d0871(0x20c)]&&isPendingActivationId(_0x506901[_0x1d0871(0x20c)])&&(_0x506901['journeyActivationStepId']='');if(_0x506901[_0x1d0871(0x1bd)]==='DecisionPoint'&&_0x506901[_0x1d0871(0x27c)])for(const _0x2caffd of _0x506901['branches']){_0x2caffd[_0x1d0871(0x286)]&&isPendingSegmentId(_0x2caffd['segmentId'])&&(_0x2caffd[_0x1d0871(0x286)]='');}_0x506901[_0x1d0871(0x1bd)]===_0x1d0871(0x194)&&stripWaitStepPendingIds(_0x506901);}}}function resolvePendingIdsInRequest(_0x30ff13,_0x32b2e0,_0x993074,_0x131c57,_0x442d29,_0x49c242){const _0x1d89b5=a140_0x3e4877,_0x1a002c=(_0x43ee2e,_0xe8682e)=>{const _0x263205=a140_0x60ab;if(!isPendingSegmentId(_0x43ee2e))return _0x43ee2e;const _0x4703fc=extractPendingSegmentName(_0x43ee2e),_0x3494e8=_0x131c57[_0x263205(0x1aa)](_0x4703fc);return!_0x3494e8&&_0x49c242[_0x263205(0x1c5)]?.(_0x263205(0x25c)+_0x4703fc+_0x263205(0x1f9)+_0xe8682e),_0x3494e8;};if(_0x30ff13[_0x1d89b5(0x203)]['goal']?.['segmentId']&&isPendingSegmentId(_0x30ff13[_0x1d89b5(0x203)][_0x1d89b5(0x27d)]['segmentId'])){const _0x408b2a=_0x1a002c(_0x30ff13[_0x1d89b5(0x203)][_0x1d89b5(0x27d)][_0x1d89b5(0x286)],'goal\x20criteria');_0x408b2a&&(_0x30ff13[_0x1d89b5(0x203)][_0x1d89b5(0x27d)]['segmentId']=_0x408b2a);}for(const _0x50975c of _0x30ff13[_0x1d89b5(0x203)][_0x1d89b5(0x1e7)]||[]){const _0x2d09f3=_0x993074[_0x1d89b5(0x1aa)](_0x50975c[_0x1d89b5(0x1d3)][_0x1d89b5(0x28c)]());_0x2d09f3&&(_0x50975c['id']=_0x2d09f3);if(_0x50975c['entryCriteria']?.[_0x1d89b5(0x286)]&&isPendingSegmentId(_0x50975c['entryCriteria'][_0x1d89b5(0x286)])){const _0x5148d9=_0x1a002c(_0x50975c[_0x1d89b5(0x1eb)][_0x1d89b5(0x286)],'stage\x20\x27'+_0x50975c[_0x1d89b5(0x1d3)]+_0x1d89b5(0x1f2));_0x5148d9&&(_0x50975c['entryCriteria']['segmentId']=_0x5148d9);}if(_0x50975c[_0x1d89b5(0x1d8)])for(const _0x5f4dec of _0x50975c[_0x1d89b5(0x1d8)]){if(_0x5f4dec[_0x1d89b5(0x286)]&&isPendingSegmentId(_0x5f4dec['segmentId'])){const _0x27dc43=_0x1a002c(_0x5f4dec[_0x1d89b5(0x286)],_0x1d89b5(0x1b6)+_0x50975c[_0x1d89b5(0x1d3)]+_0x1d89b5(0x20a));_0x27dc43&&(_0x5f4dec[_0x1d89b5(0x286)]=_0x27dc43);}}if(_0x50975c['milestone']?.[_0x1d89b5(0x286)]&&isPendingSegmentId(_0x50975c['milestone'][_0x1d89b5(0x286)])){const _0x2924fa=_0x1a002c(_0x50975c[_0x1d89b5(0x1dc)][_0x1d89b5(0x286)],'stage\x20\x27'+_0x50975c[_0x1d89b5(0x1d3)]+_0x1d89b5(0x1d1));_0x2924fa&&(_0x50975c['milestone'][_0x1d89b5(0x286)]=_0x2924fa);}if(_0x50975c[_0x1d89b5(0x18f)]){const _0x3be6f0=_0x568d09=>_0x32b2e0[_0x1d89b5(0x203)][_0x1d89b5(0x1e7)]?.[_0x1d89b5(0x24a)](_0x4bb351=>_0x4bb351[_0x1d89b5(0x1d3)]['toLowerCase']()===_0x50975c[_0x1d89b5(0x1d3)][_0x1d89b5(0x28c)]())?.['steps']?.[_0x568d09];for(const _0x162b42 of Object['keys'](_0x50975c[_0x1d89b5(0x18f)])){const _0xa236e6=_0x50975c[_0x1d89b5(0x18f)][_0x162b42],_0x52742d=_0x3be6f0(_0x162b42);if(_0xa236e6[_0x1d89b5(0x1bd)]===_0x1d89b5(0x1a3)&&_0xa236e6['journeyActivationStepId']&&(isPendingActivationId(_0xa236e6[_0x1d89b5(0x20c)])||_0xa236e6[_0x1d89b5(0x20c)]==='')){if(_0x52742d?.[_0x1d89b5(0x20c)]&&isPendingActivationId(_0x52742d['journeyActivationStepId'])){const _0x9c29cc=extractPendingActivationName(_0x52742d[_0x1d89b5(0x20c)]),_0x266081=_0x442d29[_0x1d89b5(0x1aa)](_0x9c29cc);_0x266081&&(_0xa236e6[_0x1d89b5(0x20c)]=_0x266081);}}if(_0xa236e6['type']===_0x1d89b5(0x185)&&_0xa236e6[_0x1d89b5(0x27c)]&&_0x52742d?.[_0x1d89b5(0x27c)])for(let _0x276e9e=0x0;_0x276e9e<_0xa236e6[_0x1d89b5(0x27c)][_0x1d89b5(0x18e)];_0x276e9e++){const _0x28b6ea=_0xa236e6[_0x1d89b5(0x27c)][_0x276e9e],_0x23e5cf=_0x52742d[_0x1d89b5(0x27c)][_0x276e9e];if(_0x23e5cf?.['segmentId']&&isPendingSegmentId(_0x23e5cf['segmentId'])){const _0x3ba99d=_0x1a002c(_0x23e5cf[_0x1d89b5(0x286)],_0x1d89b5(0x1b6)+_0x50975c[_0x1d89b5(0x1d3)]+_0x1d89b5(0x217)+(_0x28b6ea[_0x1d89b5(0x1d3)]||_0x276e9e)+'\x27');_0x3ba99d&&(_0x28b6ea[_0x1d89b5(0x286)]=_0x3ba99d);}}_0xa236e6[_0x1d89b5(0x1bd)]===_0x1d89b5(0x194)&&_0x52742d?.[_0x1d89b5(0x1bd)]===_0x1d89b5(0x194)&&resolveWaitStepPendingIds(_0xa236e6,_0x52742d,_0x1a002c,_0x50975c[_0x1d89b5(0x1d3)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5c3624,_0x1f97b2){const _0x2b4c0d=a141_0x5ed2,_0x235237=_0x5c3624();while(!![]){try{const _0x2499cb=-parseInt(_0x2b4c0d(0x1a0))/0x1*(parseInt(_0x2b4c0d(0x1a2))/0x2)+-parseInt(_0x2b4c0d(0x19f))/0x3+-parseInt(_0x2b4c0d(0x1a1))/0x4*(-parseInt(_0x2b4c0d(0x19b))/0x5)+parseInt(_0x2b4c0d(0x198))/0x6+-parseInt(_0x2b4c0d(0x19a))/0x7*(-parseInt(_0x2b4c0d(0x1a4))/0x8)+parseInt(_0x2b4c0d(0x1a3))/0x9*(-parseInt(_0x2b4c0d(0x1a5))/0xa)+-parseInt(_0x2b4c0d(0x1a6))/0xb*(-parseInt(_0x2b4c0d(0x1a9))/0xc);if(_0x2499cb===_0x1f97b2)break;else _0x235237['push'](_0x235237['shift']());}catch(_0xcf45f3){_0x235237['push'](_0x235237['shift']());}}}(a141_0x1239,0xa7641));function a141_0x5ed2(_0x406cff,_0x1ad2c4){_0x406cff=_0x406cff-0x198;const _0x123900=a141_0x1239();let _0x5ed200=_0x123900[_0x406cff];return _0x5ed200;}export function buildFolderIdToPathMap(_0x4d5ab1){const _0x29772e=a141_0x5ed2,_0x1d427b=new Map(),_0x382d86=new Map();for(const _0xaab46a of _0x4d5ab1){_0x382d86[_0x29772e(0x19e)](_0xaab46a['id'],_0xaab46a);}const _0x2e4f6b=new Set();for(const _0x335c7b of _0x4d5ab1){!_0x335c7b['parentFolderId']&&_0x2e4f6b[_0x29772e(0x199)](_0x335c7b['id']);}function _0x1fbcc5(_0x100f96){const _0xde002d=_0x29772e;if(_0x1d427b[_0xde002d(0x1a7)](_0x100f96['id']))return _0x1d427b[_0xde002d(0x19c)](_0x100f96['id']);if(_0x2e4f6b[_0xde002d(0x1a7)](_0x100f96['id']))return _0x1d427b[_0xde002d(0x19e)](_0x100f96['id'],''),'';if(_0x100f96[_0xde002d(0x1a8)]){const _0x202fa2=_0x382d86[_0xde002d(0x19c)](_0x100f96[_0xde002d(0x1a8)]);if(_0x202fa2){const _0x1e5a91=_0x1fbcc5(_0x202fa2),_0x491d90=_0x1e5a91?_0x1e5a91+'/'+_0x100f96['name']:_0x100f96[_0xde002d(0x19d)];return _0x1d427b[_0xde002d(0x19e)](_0x100f96['id'],_0x491d90),_0x491d90;}}const _0x59688e=_0x100f96[_0xde002d(0x19d)];return _0x1d427b['set'](_0x100f96['id'],_0x59688e),_0x59688e;}for(const _0x5ce34e of _0x4d5ab1){_0x1fbcc5(_0x5ce34e);}return _0x1d427b;}export function buildFolderPathToIdMap(_0x266e12){const _0x40502a=a141_0x5ed2,_0x5913b2=new Map(),_0x314c90=new Map();for(const _0x3b8dfe of _0x266e12){_0x314c90[_0x40502a(0x19e)](_0x3b8dfe['id'],_0x3b8dfe);}const _0x2e80ca=new Set();for(const _0xe71782 of _0x266e12){!_0xe71782[_0x40502a(0x1a8)]&&_0x2e80ca['add'](_0xe71782['id']);}function _0x4aaf73(_0x5227de){const _0x22c6f9=_0x40502a;if(_0x2e80ca[_0x22c6f9(0x1a7)](_0x5227de['id']))return'';if(_0x5227de[_0x22c6f9(0x1a8)]){const _0x17a28d=_0x314c90[_0x22c6f9(0x19c)](_0x5227de[_0x22c6f9(0x1a8)]);if(_0x17a28d){const _0x3d09c2=_0x4aaf73(_0x17a28d);return _0x3d09c2?_0x3d09c2+'/'+_0x5227de['name']:_0x5227de[_0x22c6f9(0x19d)];}}return _0x5227de['name'];}for(const _0x2fa029 of _0x266e12){const _0x525159=_0x4aaf73(_0x2fa029);_0x5913b2[_0x40502a(0x19e)](_0x525159,_0x2fa029['id']);}return _0x5913b2;}export function buildFolderMaps(_0x283e36){const _0x51bb44=a141_0x5ed2,_0x667a20=buildFolderIdToPathMap(_0x283e36),_0x43b3da=new Map();for(const [_0x5b05f8,_0x26a158]of _0x667a20){_0x43b3da[_0x51bb44(0x19e)](_0x26a158,_0x5b05f8);}return{'idToPath':_0x667a20,'pathToId':_0x43b3da};}function a141_0x1239(){const _0x8a760e=['name','set','3792330DVuNhZ','238081BBGKCQ','4OAOYUz','10jFVUZL','3856689TXhlXT','40xGciLW','10irpgBQ','297zPVWdn','has','parentFolderId','640392DRYHgM','2855094vVzBgs','add','1910349CSpFKn','1437015dUCZgz','get'];a141_0x1239=function(){return _0x8a760e;};return a141_0x1239();}export function getFolderPath(_0x454b15,_0x53409e){const _0x45ab82=a141_0x5ed2;if(!_0x454b15)return'';return _0x53409e[_0x45ab82(0x19c)](_0x454b15)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x39ecb1,_0x14f43d){const _0x2a8360=a142_0x433d,_0x1cef49=_0x39ecb1();while(!![]){try{const _0xd58686=-parseInt(_0x2a8360(0x1e3))/0x1*(-parseInt(_0x2a8360(0x1d6))/0x2)+parseInt(_0x2a8360(0x1cc))/0x3*(parseInt(_0x2a8360(0x1da))/0x4)+-parseInt(_0x2a8360(0x1d5))/0x5*(-parseInt(_0x2a8360(0x1d8))/0x6)+parseInt(_0x2a8360(0x1e4))/0x7*(-parseInt(_0x2a8360(0x1f6))/0x8)+parseInt(_0x2a8360(0x1eb))/0x9*(-parseInt(_0x2a8360(0x1c8))/0xa)+parseInt(_0x2a8360(0x1ce))/0xb+-parseInt(_0x2a8360(0x1e8))/0xc;if(_0xd58686===_0x14f43d)break;else _0x1cef49['push'](_0x1cef49['shift']());}catch(_0x47ba1d){_0x1cef49['push'](_0x1cef49['shift']());}}}(a142_0x3f0b,0x4b62b));import a142_0x43c666 from'path';import{parse as a142_0x12b1d8}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5891d1){const _0x42a02e=a142_0x433d;if(!_0x5891d1||_0x5891d1[_0x42a02e(0x1d1)]()==='')throw new Error(_0x42a02e(0x1ed));const _0x3572f4=_0x5891d1[_0x42a02e(0x1d1)]();if(_0x3572f4==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5891d1};const _0x2058d3=_0x3572f4[_0x42a02e(0x1c7)]('/')?_0x3572f4['substring'](0x1):_0x3572f4,_0x38df61=_0x2058d3['split']('/')[_0x42a02e(0x1e5)](_0x220d55=>_0x220d55!=='');if(_0x38df61['length']===0x0)throw new Error(_0x42a02e(0x1ee));const _0x4da501=_0x3572f4['startsWith']('/')||!isRelativePathSegment(_0x38df61[0x0]);for(const _0x237295 of _0x38df61){validatePathSegment(_0x237295);}return{'segments':_0x38df61,'isAbsolute':_0x4da501,'raw':_0x5891d1};}function isRelativePathSegment(_0x55aa30){return _0x55aa30==='.'||_0x55aa30==='..';}function validatePathSegment(_0x3e2b1d){const _0x15ecb3=a142_0x433d;if(_0x3e2b1d==='')throw new Error(_0x15ecb3(0x1d0));if(_0x3e2b1d==='.'||_0x3e2b1d==='..')return;if(/[\x00-\x1F\x7F]/[_0x15ecb3(0x1f2)](_0x3e2b1d))throw new Error(_0x15ecb3(0x1ec)+_0x3e2b1d);if(_0x3e2b1d!==_0x3e2b1d[_0x15ecb3(0x1d1)]()){}}export function validatePath(_0x5e0296){const _0x1eced3=a142_0x433d;if(_0x5e0296[_0x1eced3(0x1f1)]['length']===0x0&&!_0x5e0296[_0x1eced3(0x1df)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x5e0296[_0x1eced3(0x1df)]){if(_0x5e0296['segments'][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0xdd2b8a=0x0;for(const _0x1c4da4 of _0x5e0296[_0x1eced3(0x1f1)]){if(_0x1c4da4==='..'){if(_0xdd2b8a===0x0)throw new Error(_0x1eced3(0x1cb));_0xdd2b8a--;}else _0x1c4da4!=='.'&&_0xdd2b8a++;}}}export function joinPaths(_0x38a660,_0x76756c){const _0x223c0b=a142_0x433d;if(!_0x38a660||_0x38a660==='/')return _0x76756c;if(!_0x76756c||_0x76756c==='.')return _0x38a660;if(_0x76756c['startsWith']('/'))return _0x76756c;const _0x403c72=parsePath(_0x38a660),_0x41e3bb=parsePath(_0x76756c),_0x9c4dd7=[..._0x403c72[_0x223c0b(0x1f1)]];for(const _0x4c97c9 of _0x41e3bb[_0x223c0b(0x1f1)]){if(_0x4c97c9==='.')continue;else{if(_0x4c97c9==='..'){if(_0x9c4dd7['length']===0x0)throw new Error(_0x223c0b(0x1d7));_0x9c4dd7['pop']();}else _0x9c4dd7[_0x223c0b(0x1f5)](_0x4c97c9);}}const _0x5e7e22=_0x9c4dd7['join']('/');return _0x403c72[_0x223c0b(0x1ef)]['startsWith']('/')?'/'+_0x5e7e22:_0x5e7e22;}export function normalizePath(_0x4d3526){const _0x17e977=a142_0x433d,_0x2110ae=parsePath(_0x4d3526),_0x42c463=[];for(const _0x10029a of _0x2110ae['segments']){if(_0x10029a==='.')continue;else{if(_0x10029a==='..'){if(_0x42c463[_0x17e977(0x1e1)]===0x0){if(_0x2110ae['isAbsolute'])throw new Error(_0x17e977(0x1d7));_0x42c463[_0x17e977(0x1f5)]('..');}else _0x42c463[_0x42c463[_0x17e977(0x1e1)]-0x1]==='..'?_0x42c463[_0x17e977(0x1f5)]('..'):_0x42c463[_0x17e977(0x1dd)]();}else _0x42c463[_0x17e977(0x1f5)](_0x10029a);}}if(_0x42c463[_0x17e977(0x1e1)]===0x0)return _0x2110ae['isAbsolute']?'/':'.';const _0x4f4107=_0x42c463[_0x17e977(0x1de)]('/');return _0x2110ae['raw'][_0x17e977(0x1c7)]('/')?'/'+_0x4f4107:_0x4f4107;}export function getParentPath(_0x44f976){const _0x22e0b1=a142_0x433d,_0xd423e0=parsePath(_0x44f976);if(_0xd423e0[_0x22e0b1(0x1f1)][_0x22e0b1(0x1e1)]<=0x1)return'/';const _0x1bca52=_0xd423e0[_0x22e0b1(0x1f1)][_0x22e0b1(0x1ea)](0x0,-0x1)[_0x22e0b1(0x1de)]('/');return _0xd423e0[_0x22e0b1(0x1ef)][_0x22e0b1(0x1c7)]('/')?'/'+_0x1bca52:_0x1bca52;}function a142_0x3f0b(){const _0x344106=['exists','root','pop','join','isAbsolute','tdx.json','length','replace','2654VYYOdE','1450806LltNPd','filter','parse','endsWith','7684344qkCDgR','journey','slice','13554CANBmL','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Path\x20cannot\x20be\x20empty','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','raw','segment','segments','test','File\x20not\x20found:\x20','relative','push','16Jnaznx','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','startsWith','700pyqOOC','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','.yml','Path\x20attempts\x20to\x20navigate\x20above\x20root','3bZTNxq','dirname','2306502sJehMh','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20cannot\x20be\x20empty','trim','readFile','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','parent_segment','420TwsSTy','274xAaVKP','Cannot\x20navigate\x20above\x20root','40254NFcXpZ','resolve','1328964WWNviq'];a142_0x3f0b=function(){return _0x344106;};return a142_0x3f0b();}export function getBaseName(_0x2e4af0){const _0x596ba5=a142_0x433d,_0x1f7eab=parsePath(_0x2e4af0);return _0x1f7eab[_0x596ba5(0x1f1)][_0x1f7eab[_0x596ba5(0x1f1)]['length']-0x1]||'';}export function isChildPath(_0x5e58a7,_0x107c31){const _0x3b80ed=a142_0x433d,_0x2fa695=parsePath(_0x5e58a7),_0x208c3e=parsePath(_0x107c31);if(_0x2fa695[_0x3b80ed(0x1f1)][_0x3b80ed(0x1e1)]<=_0x208c3e['segments'][_0x3b80ed(0x1e1)])return![];for(let _0x1a7f10=0x0;_0x1a7f10<_0x208c3e[_0x3b80ed(0x1f1)][_0x3b80ed(0x1e1)];_0x1a7f10++){if(_0x2fa695[_0x3b80ed(0x1f1)][_0x1a7f10]!==_0x208c3e[_0x3b80ed(0x1f1)][_0x1a7f10])return![];}return!![];}export function splitPath(_0x2256f7){const _0x425370=a142_0x433d,_0x424c8f=parsePath(_0x2256f7);if(_0x424c8f['segments'][_0x425370(0x1e1)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x424c8f[_0x425370(0x1f1)][_0x425370(0x1e1)]===0x1)return{'parent':_0x424c8f[_0x425370(0x1f1)][0x0]};return{'parent':_0x424c8f[_0x425370(0x1f1)][0x0],'child':_0x424c8f[_0x425370(0x1f1)][_0x425370(0x1ea)](0x1)[_0x425370(0x1de)]('/')};}function a142_0x433d(_0x1f80d9,_0x41209c){_0x1f80d9=_0x1f80d9-0x1c7;const _0x3f0b08=a142_0x3f0b();let _0x433d17=_0x3f0b08[_0x1f80d9];return _0x433d17;}export function isYamlFilePath(_0x17bcbd){const _0x7611f7=a142_0x433d;return _0x17bcbd[_0x7611f7(0x1e7)](_0x7611f7(0x1ca))||_0x17bcbd[_0x7611f7(0x1e7)]('.yaml');}export async function resolveYamlFilePath(_0x300f77,_0x347ffd=nodeFileSystem){const _0xb862b=a142_0x433d,_0x13fa9c=a142_0x43c666[_0xb862b(0x1d9)](_0x300f77);if(!await _0x347ffd[_0xb862b(0x1db)](_0x13fa9c))throw new Error(_0xb862b(0x1f3)+_0x300f77);let _0x2a7983=a142_0x43c666['dirname'](_0x13fa9c),_0x495fdd=null,_0x1d83e5=null;const _0x2ca5b1=a142_0x43c666[_0xb862b(0x1e6)](_0x2a7983)[_0xb862b(0x1dc)];while(_0x2a7983!==_0x2ca5b1){const _0x201563=a142_0x43c666['join'](_0x2a7983,_0xb862b(0x1e0));if(await _0x347ffd[_0xb862b(0x1db)](_0x201563)){_0x495fdd=_0x201563,_0x1d83e5=_0x2a7983;break;}_0x2a7983=a142_0x43c666[_0xb862b(0x1cd)](_0x2a7983);}if(!_0x495fdd||!_0x1d83e5)throw new Error(_0xb862b(0x1cf)+_0x300f77+'\x0a'+_0xb862b(0x1f7));const _0x17fb3d=await _0x347ffd[_0xb862b(0x1d2)](_0x495fdd),_0x2fde41=JSON[_0xb862b(0x1e6)](_0x17fb3d),_0x4634ed=_0x2fde41[_0xb862b(0x1d4)];if(!_0x4634ed)throw new Error(_0xb862b(0x1d3));const _0x29710c=await _0x347ffd[_0xb862b(0x1d2)](_0x13fa9c),_0x42b910=a142_0x12b1d8(_0x29710c),_0x3d4c20=_0x42b910['name'];if(!_0x3d4c20)throw new Error(_0xb862b(0x1c9)+_0x300f77);const _0x47efaa=_0x42b910['type']===_0xb862b(0x1e9)?'journey':_0xb862b(0x1f0),_0x33b4a8=a142_0x43c666[_0xb862b(0x1f4)](_0x1d83e5,_0x13fa9c),_0x95dc33=a142_0x43c666[_0xb862b(0x1cd)](_0x33b4a8),_0x536f2f=_0x95dc33==='.'?'':_0x95dc33[_0xb862b(0x1e2)](/\\/g,'/'),_0x97f7ac=_0x536f2f?_0x4634ed+'/'+_0x536f2f+'/'+_0x3d4c20:_0x4634ed+'/'+_0x3d4c20;return{'parentSegment':_0x4634ed,'segmentName':_0x3d4c20,'folderPath':_0x536f2f,'fullPath':_0x97f7ac,'resourceType':_0x47efaa,'content':_0x29710c};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a143_0x4f77(_0x6836de,_0x437032){_0x6836de=_0x6836de-0x1cf;const _0x3a019a=a143_0x3a01();let _0x4f77e1=_0x3a019a[_0x6836de];return _0x4f77e1;}function a143_0x3a01(){const _0x395ad1=['8bKlQcD','2oDqbZH','2569731BJHbHY','.\x20Child\x20name\x20cannot\x20be\x20empty','46636183OgKqKc','997155HLplid','7994021WGOhjp','Invalid\x20segment\x20reference\x20format:\x20','8GDGWHd','.\x20Parent\x20name\x20cannot\x20be\x20empty','654311jCODvz','indexOf','2746105flPdNn','6KOHKRm','2004640qrFUfn'];a143_0x3a01=function(){return _0x395ad1;};return a143_0x3a01();}(function(_0x368445,_0x1e3cf5){const _0x23bc81=a143_0x4f77,_0x5260df=_0x368445();while(!![]){try{const _0x3cd520=-parseInt(_0x23bc81(0x1d2))/0x1+parseInt(_0x23bc81(0x1d8))/0x2*(-parseInt(_0x23bc81(0x1d9))/0x3)+-parseInt(_0x23bc81(0x1d7))/0x4*(parseInt(_0x23bc81(0x1d4))/0x5)+parseInt(_0x23bc81(0x1d5))/0x6*(-parseInt(_0x23bc81(0x1dd))/0x7)+-parseInt(_0x23bc81(0x1d0))/0x8*(-parseInt(_0x23bc81(0x1dc))/0x9)+parseInt(_0x23bc81(0x1d6))/0xa+parseInt(_0x23bc81(0x1db))/0xb;if(_0x3cd520===_0x1e3cf5)break;else _0x5260df['push'](_0x5260df['shift']());}catch(_0x115143){_0x5260df['push'](_0x5260df['shift']());}}}(a143_0x3a01,0xc335b));export function parseSegmentRef(_0x38d3a9){const _0x7e1a3a=a143_0x4f77,_0x358ae6=_0x38d3a9[_0x7e1a3a(0x1d3)]('/');if(_0x358ae6===-0x1)return{'parentId':_0x38d3a9};if(_0x358ae6===0x0)throw new Error(_0x7e1a3a(0x1cf)+_0x38d3a9+_0x7e1a3a(0x1d1));const _0xd7ead0=_0x38d3a9['substring'](0x0,_0x358ae6),_0x3713ff=_0x38d3a9['substring'](_0x358ae6+0x1);if(_0x3713ff==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x38d3a9+_0x7e1a3a(0x1da));return{'parentId':_0xd7ead0,'childId':_0x3713ff};}
|