@treasuredata/tdx 2026.3.25 → 2026.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.d.ts +5 -0
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +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(_0x42ed21,_0x18297c){const _0x1a6a4b=a141_0x4164,_0x22d8f0=_0x42ed21();while(!![]){try{const _0x167d3c=-parseInt(_0x1a6a4b(0x1c6))/0x1+parseInt(_0x1a6a4b(0x1c5))/0x2+-parseInt(_0x1a6a4b(0x1b4))/0x3+parseInt(_0x1a6a4b(0x1bc))/0x4+-parseInt(_0x1a6a4b(0x1b9))/0x5+parseInt(_0x1a6a4b(0x1be))/0x6+parseInt(_0x1a6a4b(0x1bf))/0x7;if(_0x167d3c===_0x18297c)break;else _0x22d8f0['push'](_0x22d8f0['shift']());}catch(_0x5ac051){_0x22d8f0['push'](_0x22d8f0['shift']());}}}(a141_0x74b1,0x80e1d));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x180a5a from'path';import{Logger}from'../../utils/logger/index.js';function a141_0x4164(_0x5910ff,_0x2d4042){_0x5910ff=_0x5910ff-0x1b2;const _0x74b114=a141_0x74b1();let _0x4164cd=_0x74b114[_0x5910ff];return _0x4164cd;}const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x14e127){const _0x503f34=a141_0x4164,_0x4501fb=a141_0x180a5a[_0x503f34(0x1b2)](_0x14e127),_0x1a063f=a141_0x180a5a[_0x503f34(0x1ba)](_0x14e127);return a141_0x180a5a[_0x503f34(0x1c4)](_0x4501fb,'.'+_0x1a063f+_0x503f34(0x1c2));}function a141_0x74b1(){const _0x535369=['stringify','.push-recovery.json','ENOENT','join','2023730dMQgCI','973308DmeSNq','dirname','toISOString','2257083ggcIXr','string','parse','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','utf-8','4754945WYSINF','basename','debug','949660aKQOgL','warn','2675424wySamz','10565625VYAiJv','journeyName'];a141_0x74b1=function(){return _0x535369;};return a141_0x74b1();}export function readPushRecovery(_0x3382dc){const _0x32054e=a141_0x4164,_0xc11f9d=getPushRecoveryPath(_0x3382dc);if(!existsSync(_0xc11f9d))return undefined;try{const _0x2b916d=readFileSync(_0xc11f9d,'utf-8'),_0x4beea5=JSON[_0x32054e(0x1b6)](_0x2b916d);if(_0x4beea5?.['version']!==0x1||typeof _0x4beea5['journeyName']!==_0x32054e(0x1b5))return undefined;return _0x4beea5;}catch(_0x95942d){return _0x95942d instanceof SyntaxError?logger[_0x32054e(0x1bb)](_0x32054e(0x1b7)+_0x95942d):logger[_0x32054e(0x1bd)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x95942d),undefined;}}export function writePushRecovery(_0x13f794,_0x5d4bbc){const _0x136bb2=a141_0x4164,_0x104180=getPushRecoveryPath(_0x13f794),_0x235c3c=_0x104180+'.tmp';writeFileSync(_0x235c3c,JSON[_0x136bb2(0x1c1)](_0x5d4bbc,null,0x2)+'\x0a',_0x136bb2(0x1b8)),renameSync(_0x235c3c,_0x104180);}export function deletePushRecovery(_0x237246){const _0x159a30=a141_0x4164,_0x2b8c0a=getPushRecoveryPath(_0x237246);try{unlinkSync(_0x2b8c0a);}catch(_0x5c7fba){_0x5c7fba['code']!==_0x159a30(0x1c3)&&logger[_0x159a30(0x1bb)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x5c7fba);}}export function saveSegmentToPushRecovery(_0x398e9b,_0x308786,_0x5dbb33,_0xee4854){const _0x2b376c=a141_0x4164,_0x4fa474=readPushRecovery(_0x398e9b),_0x2212bc=_0x4fa474?.[_0x2b376c(0x1c0)]===_0x308786?{..._0x4fa474,'updatedAt':new Date()[_0x2b376c(0x1b3)]()}:{'version':0x1,'journeyName':_0x308786,'updatedAt':new Date()[_0x2b376c(0x1b3)](),'segments':{}};_0x2212bc['segments'][_0x5dbb33]=_0xee4854,writePushRecovery(_0x398e9b,_0x2212bc);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a142_0x2ccdb5=a142_0x48cb;(function(_0x279447,_0x7312cb){const _0x9e18cd=a142_0x48cb,_0x2ce644=_0x279447();while(!![]){try{const _0x242e8d=parseInt(_0x9e18cd(0x15b))/0x1*(parseInt(_0x9e18cd(0x128))/0x2)+-parseInt(_0x9e18cd(0x153))/0x3+parseInt(_0x9e18cd(0xbe))/0x4+-parseInt(_0x9e18cd(0xa8))/0x5*(-parseInt(_0x9e18cd(0x144))/0x6)+-parseInt(_0x9e18cd(0x123))/0x7+parseInt(_0x9e18cd(0x151))/0x8+-parseInt(_0x9e18cd(0xb6))/0x9;if(_0x242e8d===_0x7312cb)break;else _0x2ce644['push'](_0x2ce644['shift']());}catch(_0x42642c){_0x2ce644['push'](_0x2ce644['shift']());}}}(a142_0x1adc,0x7dd35));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a142_0x2ccdb5(0xd4);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x14cbc6){return''+PENDING_SEGMENT_PREFIX+_0x14cbc6+'__';}export function isPendingSegmentId(_0x5d88cf){const _0x5de874=a142_0x2ccdb5;return _0x5d88cf['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x5d88cf[_0x5de874(0x181)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x2b8c3c){const _0x36be61=a142_0x2ccdb5;return _0x2b8c3c[_0x36be61(0x190)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4e1930){return''+PENDING_ACTIVATION_PREFIX+_0x4e1930+'__';}export function isPendingActivationId(_0x327fab){return _0x327fab['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x324cf7){return _0x324cf7['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x37abde,_0x5181a2){const _0x212b8c=a142_0x2ccdb5,_0x452983=_0x37abde+'::'+(_0x5181a2[_0x212b8c(0x174)]()||_0x212b8c(0xaa)),_0x4cd7a7=createHash(_0x212b8c(0xda))[_0x212b8c(0xc0)](_0x452983)[_0x212b8c(0x156)](_0x212b8c(0xeb))[_0x212b8c(0xb7)](0x0,0xc);return _0x212b8c(0x125)+_0x4cd7a7;}export function ensureJourneyDefaults(_0x1bf84e){const _0x28d800=a142_0x2ccdb5;!_0x1bf84e[_0x28d800(0x10d)]&&(_0x1bf84e[_0x28d800(0x10d)]=''),!_0x1bf84e[_0x28d800(0x157)]&&(_0x1bf84e[_0x28d800(0x157)]=_0x28d800(0x134));}export function injectExistingStageIds(_0xe02864,_0x3ad764){const _0x38b4d0=a142_0x2ccdb5,_0x30c1bd=new Map(_0x3ad764[_0x38b4d0(0x122)](_0x32ba82=>[_0x32ba82[_0x38b4d0(0xed)],_0x32ba82['id']]));for(const _0x2d4ccd of _0xe02864){if(!_0x2d4ccd['id']){const _0x2459df=_0x30c1bd['get'](_0x2d4ccd[_0x38b4d0(0xed)]);_0x2459df&&(_0x2d4ccd['id']=_0x2459df);}}}export function resolveTDFolderPath(_0x276e4c,_0x338141,_0x56b94e){const _0x2969b6=a142_0x2ccdb5;if(!_0x338141)return _0x276e4c;if(_0x276e4c===_0x56b94e||_0x276e4c[_0x2969b6(0x181)](_0x56b94e+'/'))return _0x276e4c;return _0x276e4c?_0x56b94e+'/'+_0x276e4c:_0x56b94e;}export function addFoldersToCreate(_0x1a2ffe,_0x139c50,_0x19e74e){const _0x683ae2=a142_0x2ccdb5;if(!_0x1a2ffe)return;if(_0x139c50[_0x683ae2(0x105)](_0x1a2ffe))return;const _0x522c98=_0x1a2ffe[_0x683ae2(0xbd)]('/');let _0x32d0c6='';for(const _0x45c6f5 of _0x522c98){_0x32d0c6=_0x32d0c6?_0x32d0c6+'/'+_0x45c6f5:_0x45c6f5,!_0x139c50['has'](_0x32d0c6)&&_0x19e74e['add'](_0x32d0c6);}}function a142_0x1adc(){const _0x3e37c9=['15449229xCgWZd','slice','WaitStep','journey_updating','withProgress','includes','createJourneySegment','split','4113320svBffg','Failed\x20to\x20fetch\x20referenced\x20segment\x20','update','diff','flatMap','DecisionPoint','Fetching\x20','activation_deleting','\x27\x20not\x20found\x20in\x20journey\x20\x27','Created\x20activation\x20\x27','waitStep','./journey-yaml.js','segmentFolderId','from','existingJourney','index','conditionTimeoutDuration','behavior','max','\x20journey\x20from\x20file:\x20','folder','Segment\x20not\x20found:\x20','__pending_','existingSegment','goal','isNew','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','size','sha1','Segment\x20not\x20found','Failed\x20to\x20','match','segments','journeyActivationStepId','\x27\x20by\x20rule\x20content','kind','run_after_journey_refresh','debug','parse','values','\x27\x20to\x20local\x20\x27','waitStepUnit','journeyId','journeyBundleId','hasChanges','hex','getJourney','name','journeys','embedded_activation_created','\x27...','rootFolderId','journeyBundleName','dirname','ACTIVATION_UPDATE_ERROR','deleteSegment','conditions','type','journeyActivationNameToId','updated','data','parentFolder','INTERNAL','localName','parseDocument','resolveSegment','Deleted\x20activation\x20\x27','Activation\x20not\x20found:\x20','Creating\x20segment\x20\x27','getLatestJourneyId','segmentNameToId','has','\x27\x20from\x20file:\x20','folder_created','filter','deps','folder_creating','SEGMENT_UPDATE_ERROR','decision_point','description','embeddedSegmentNameToId','activationContext','activationStepsById','toISOString','segmentId','journeyBundlesByFolderAndName','delete','activationActions','entry_criteria','updateSegmentById','add','folderPath','some','reduce','Entry\x20criteria:\x20','notification','yamlConfig','createdSegmentIds','goal\x20criteria','list','map','2177826yytmrD','null','journey_entry_criteria_','created','keys','1319504qOHyoi','JOURNEY_UPDATE_ERROR','valid','journey_created','activation_deleted','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Updated\x20journey\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','\x27\x20decision\x20point\x20branch\x20\x27','relative','journeyStages','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','draft','existingSegments','branches','Condition','uniqueServerName','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Activation','attributes','journey_creating','fetchJourney','uniqueSegmentName','segment_deleting','folderPathToId','deleted','\x27\x20exit\x20criteria','getSegment','12738DTnJDf','versionNumber','activations','deleteActivation','resolveJourneyId','activation_updating','push','absolutePath','\x27\x20milestone','exitCriterias','getSegmentEntity','SEGMENT_SYNTAX_ERROR','milestone','1785864zqGizn','createActivation','747840OlWXoq','\x20activation\x20\x27','SEGMENT_NOT_FOUND','digest','state','conditionSegmentId','createdSegmentId','../../utils/async.js','1cloRAz','JOURNEY_SYNTAX_ERROR','all_columns','utf-8','journeyById','activationsBySegmentId','yamlActivation','stringify','and\x20the\x20server\x20segment,\x20then\x20retry.','activation_creating','validatedRequest','Deleting\x20activation\x20\x27','Failed\x20to\x20resolve\x20activation\x20','Deleted\x20segment\x20\x27','createFolder','idToName','updateActivation',').\x20','connector_config','logWarning','parentId','Duration','entryCriteria','onProgress','listActivations','trim','activation_updated','object','resolvedRule','schedule','journeyName','activation_','Delete\x20the\x20push\x20recovery\x20file\x20(','getSegment\x20failed\x20for\x20','find','Updated\x20segment\x20\x27','activation_created','./child-segment-yaml.js','startsWith','action','buildUserMaps','stages','get','user','activation_template_id','journey','\x0a\x20\x20','logInfo','sort','segmentByFolderAndName','columns','logSuccess','results','replace','Created\x20journey\x20\x27','idToEmailMap','rule','segment_updating','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','stage\x20\x27','existingActivation','relationships',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','createSegment','\x20error(s)','embedded_segment_created','length','entry','\x27\x20entry\x20criteria','waitStepType','Stage\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','toString','\x27\x20wait\x20condition','steps','folderId','conditionTimeoutUnit','2075hMBLkM','create','segment','toLowerCase','nameToType','with','.$1.push-recovery.json','connection','connectionIdToNameMap','embedded_activation_creating','NOT_FOUND','join','set','Journey\x20\x27'];a142_0x1adc=function(){return _0x3e37c9;};return a142_0x1adc();}export function sortFoldersByDepth(_0x110de6){return[..._0x110de6]['sort']((_0x34055c,_0x5b0a6e)=>{const _0x3d3899=a142_0x48cb,_0x52e258=(_0x34055c[_0x3d3899(0xdd)](/\//g)||[])[_0x3d3899(0x19d)],_0x1c9657=(_0x5b0a6e[_0x3d3899(0xdd)](/\//g)||[])['length'];return _0x52e258-_0x1c9657;});}import*as a142_0x79a98e from'yaml';import{readFileSync}from'fs';import a142_0x232f03 from'path';import{isJourneyDef,parseYamlString as a142_0x401a86,toYamlString as a142_0x94e2bd,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';function a142_0x48cb(_0x3f606c,_0x274e6c){_0x3f606c=_0x3f606c-0x9e;const _0x1adcdd=a142_0x1adc();let _0x48cb92=_0x1adcdd[_0x3f606c];return _0x48cb92;}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(_0x330caf){const _0xd9646=a142_0x2ccdb5;if(Array['isArray'](_0x330caf))return'['+_0x330caf[_0xd9646(0x122)](_0x4f4c90=>stableStringify(_0x4f4c90))['join'](',')+']';if(_0x330caf&&typeof _0x330caf===_0xd9646(0x176)){const _0x38be69=_0x330caf,_0x21ed87=Object[_0xd9646(0x127)](_0x38be69)[_0xd9646(0x18b)](),_0x603699=_0x21ed87['map'](_0x81f6fc=>'\x22'+_0x81f6fc+'\x22:'+stableStringify(_0x38be69[_0x81f6fc]));return'{'+_0x603699[_0xd9646(0xb3)](',')+'}';}const _0xe8d876=JSON[_0xd9646(0x162)](_0x330caf);return _0xe8d876===undefined?_0xd9646(0x124):_0xe8d876;}function activationSignature(_0x542416){const _0x3d4aa4=a142_0x2ccdb5,_0x4503cc={'connection':_0x542416[_0x3d4aa4(0xaf)],..._0x542416[_0x3d4aa4(0x15d)]!==undefined&&{'all_columns':_0x542416[_0x3d4aa4(0x15d)]},..._0x542416[_0x3d4aa4(0x18d)]!==undefined&&{'columns':_0x542416[_0x3d4aa4(0x18d)]},..._0x542416[_0x3d4aa4(0xcf)]!==undefined&&{'behavior':_0x542416['behavior']},..._0x542416[_0x3d4aa4(0x178)]!==undefined&&{'schedule':_0x542416[_0x3d4aa4(0x178)]},..._0x542416['notification']!==undefined&&{'notification':_0x542416[_0x3d4aa4(0x11d)]},..._0x542416[_0x3d4aa4(0x16d)]!==undefined&&{'connector_config':_0x542416[_0x3d4aa4(0x16d)]},..._0x542416['activation_template_id']!==undefined&&{'activation_template_id':_0x542416[_0x3d4aa4(0x187)]}};return stableStringify(_0x4503cc);}async function fetchSegment(_0x14a785,_0x348bc3,_0x44781c,_0x80c6e4){const _0xdefd79=a142_0x2ccdb5,_0x3a910c=_0x80c6e4?.[_0xdefd79(0x17d)](_0x63b29c=>_0x63b29c['id']===_0x44781c);if(_0x3a910c)return _0x3a910c;try{return await _0x14a785[_0xdefd79(0xaa)][_0xdefd79(0x143)](_0x348bc3,_0x44781c);}catch(_0x1f6728){logger[_0xdefd79(0xe3)](_0xdefd79(0x17c)+_0x44781c+_0xdefd79(0x199)+_0x1f6728);try{return await _0x14a785[_0xdefd79(0xaa)][_0xdefd79(0x14e)](_0x44781c);}catch(_0x250404){return logger['debug']('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x44781c+':\x20'+_0x250404),null;}}}function recoverSegmentIdsFromPushRecovery(_0x41a812,_0x3d3f21,_0x2c0b4b){const _0x42c9e9=a142_0x2ccdb5,_0x42cb49=readPushRecovery(_0x41a812['absolutePath']);if(_0x42cb49?.[_0x42c9e9(0x179)]===_0x41a812[_0x42c9e9(0x11e)][_0x42c9e9(0xed)])for(const [_0x10184c,_0x3d05dd]of Object['entries'](_0x42cb49[_0x42c9e9(0xde)])){const _0x4f7ae8=generateDeterministicJourneySegmentName(_0x41a812[_0x42c9e9(0x11e)][_0x42c9e9(0xed)],_0x10184c);_0x3d05dd[_0x42c9e9(0x138)]===_0x4f7ae8&&(_0x3d3f21[_0x42c9e9(0xb4)](_0x10184c,_0x3d05dd[_0x42c9e9(0x112)]),_0x2c0b4b[_0x42c9e9(0xb4)](_0x10184c,_0x3d05dd[_0x42c9e9(0x112)]));}}async function createOrRecoverEmbeddedSegment(_0x196dd3,_0x4e35b5,_0x374ebe,_0x5da0f7){const _0x399806=a142_0x2ccdb5;let _0x306f9e;try{_0x306f9e=await _0x196dd3[_0x399806(0xaa)][_0x399806(0xbc)]({'name':_0x374ebe[_0x399806(0x13e)],'description':_0x374ebe[_0x399806(0x10d)],'journeyId':_0x374ebe[_0x399806(0xe8)],'rule':_0x5da0f7(_0x374ebe[_0x399806(0x177)],!![]),'countPopulation':!![],'parentFolderId':_0x374ebe[_0x399806(0xa6)],'audienceId':_0x374ebe['parentId']});}catch(_0x3ef711){const _0x45ae00=_0x3ef711 instanceof Error&&_0x3ef711['message'][_0x399806(0xbb)]('Name\x20has\x20already\x20been\x20taken');if(_0x45ae00){const _0x56fb03=readPushRecovery(_0x4e35b5[_0x399806(0x14b)]),_0x49b188=_0x56fb03?.[_0x399806(0x179)]===_0x4e35b5['yamlConfig'][_0x399806(0xed)]?_0x56fb03[_0x399806(0xde)][_0x374ebe[_0x399806(0xfd)]]:undefined;if(_0x49b188?.[_0x399806(0x138)]===_0x374ebe[_0x399806(0x13e)])await _0x196dd3[_0x399806(0xaa)][_0x399806(0x117)](_0x374ebe[_0x399806(0x16f)],_0x49b188[_0x399806(0x112)],{'description':_0x374ebe[_0x399806(0x10d)],'rule':_0x5da0f7(_0x374ebe[_0x399806(0x177)],!![]),'countPopulation':!![]}),_0x306f9e=_0x49b188[_0x399806(0x112)];else throw new SDKError(ErrorCode[_0x399806(0x10b)],'Embedded\x20segment\x20\x27'+_0x374ebe[_0x399806(0xfd)]+_0x399806(0x133)+(_0x399806(0x17b)+_0x4e35b5[_0x399806(0x14b)][_0x399806(0x190)](/([^/]+)$/,_0x399806(0xae))+')\x20')+_0x399806(0x163),_0x3ef711);}else throw _0x3ef711;}return saveSegmentToPushRecovery(_0x4e35b5['absolutePath'],_0x4e35b5[_0x399806(0x11e)][_0x399806(0xed)],_0x374ebe[_0x399806(0xfd)],{'segmentId':_0x306f9e,'uniqueServerName':_0x374ebe['uniqueSegmentName'],'createdAt':new Date()[_0x399806(0x111)]()}),_0x306f9e;}export async function prepareSegmentFiles(_0x543ab6,_0x4170e1,_0x8f5bc1,_0x133240,_0x565598){const _0x18e29f=a142_0x2ccdb5,{activationDefToCreateRequest:_0x1ebbf4}=await import('./child-segment-yaml.js'),_0x15aeb4=[],_0x2864b7=new Set();for(const {yamlConfig:_0x29b541,folderPath:_0x404b59,sourcePath:_0x3ed0e9}of _0x543ab6){const _0x221dc9=resolveTDFolderPath(_0x404b59,_0x133240,_0x565598),_0x332d89=_0x221dc9+':'+_0x29b541['name'],_0x4605f6=_0x4170e1[_0x18e29f(0x18c)][_0x18e29f(0x185)](_0x332d89),_0x464cc8=_0x4605f6?_0x4170e1[_0x18e29f(0x160)][_0x18e29f(0x185)](_0x4605f6['id'])||[]:[];addFoldersToCreate(_0x221dc9,_0x4170e1[_0x18e29f(0x140)],_0x2864b7);const _0x27c816=calculateActivationActions(_0x29b541['activations']||[],_0x464cc8,_0x4170e1[_0x18e29f(0x192)],_0x4170e1['connectionIdToNameMap']);for(const _0x38acd1 of _0x27c816){(_0x38acd1[_0x18e29f(0xf7)]==='create'||_0x38acd1['type']===_0x18e29f(0xc0))&&_0x38acd1[_0x18e29f(0x161)]&&(_0x38acd1[_0x18e29f(0x165)]=await _0x1ebbf4(_0x38acd1['yamlActivation'],_0x8f5bc1));}const _0x2b1c75=calculateSegmentDiff(_0x29b541,_0x4605f6,_0x464cc8,_0x4170e1[_0x18e29f(0x192)],_0x4170e1[_0x18e29f(0xb0)]);_0x15aeb4[_0x18e29f(0x14a)]({'relativePath':_0x29b541[_0x18e29f(0xed)],'absolutePath':_0x3ed0e9,'yamlConfig':_0x29b541,'folderPath':_0x221dc9,'existingSegment':_0x4605f6,'existingActivations':_0x464cc8,'isNew':_0x2b1c75[_0x18e29f(0xd7)],'hasChanges':_0x2b1c75['hasChanges'],'diff':_0x2b1c75[_0x18e29f(0xc1)],'activationActions':_0x27c816});}return{'segmentFiles':_0x15aeb4,'foldersToCreate':_0x2864b7};}export async function prepareJourneyFiles(_0x1a45a3,_0x42e5fc,_0x2b2abb,_0x278220){const _0x223927=a142_0x2ccdb5,_0x340ec7=[],_0x1fd269=new Set();for(const {yamlConfig:_0x86d2de,folderPath:_0x35066b,sourcePath:_0x2a1222}of _0x1a45a3){const _0x4d8a98=resolveTDFolderPath(_0x35066b,_0x2b2abb,_0x278220),_0x462d69=_0x4d8a98+':'+_0x86d2de['name'],_0x3838dd=_0x42e5fc[_0x223927(0x113)]['get'](_0x462d69);let _0x16bd4a,_0x505a89;if(_0x3838dd&&_0x3838dd[_0x223927(0x19d)]>0x0){const _0x4e05bc=buildLocalExpandedRuleMappings(_0x86d2de),{createYamlContext:_0x2b6483,prefetchJourneySegments:_0x40a9fd}=createPushYamlContextForBundle(_0x42e5fc[_0x223927(0x109)],_0x42e5fc['parentId'],_0x42e5fc[_0x223927(0x135)],_0x4e05bc,_0x42e5fc[_0x223927(0x192)],_0x42e5fc[_0x223927(0xb0)],_0x42e5fc[_0x223927(0x110)],_0x42e5fc[_0x223927(0x15f)]);await _0x40a9fd(_0x3838dd[_0x223927(0x122)](_0xbea250=>_0xbea250['id']));const _0x2fb278=await _0x42e5fc[_0x223927(0x109)][_0x223927(0x188)][_0x223927(0x103)](_0x3838dd[0x0][_0x223927(0xe9)]),_0xab6ae8=hasMultipleVersions(_0x86d2de),_0x520459=async _0x2a20a5=>{const _0x2d713e=_0x223927,_0x1a2e18=_0x42e5fc['journeyById']?.[_0x2d713e(0x185)](_0x2a20a5);if(_0x1a2e18)return _0x1a2e18;return _0x42e5fc[_0x2d713e(0x13d)]({'journeyId':_0x2a20a5,'journeyName':_0x86d2de[_0x2d713e(0xed)],'isMultiVersion':_0x3838dd[_0x2d713e(0x19d)]>0x1});};if(_0xab6ae8&&_0x3838dd['length']>0x1){const _0x397350=[];for(const _0x16ff41 of _0x3838dd){const _0x11f4a2=_0x16ff41[_0x223927(0x145)]||0x1;_0x42e5fc['progress']?.[_0x223927(0xc0)](_0x223927(0xc4)+_0x86d2de[_0x223927(0xed)]+'\x20v'+_0x11f4a2);const _0x534a69=await _0x520459(_0x16ff41['id']),_0x56dbc1=_0x2b6483(_0x16ff41['id']),_0x505eb9=await journeyResponseToDef(_0x534a69,_0x56dbc1);_0x397350[_0x223927(0x14a)]({'item':_0x16ff41,'yaml':_0x505eb9});}const _0x2fc6c7=buildLocalRuleToNameMappingFromJourney(_0x86d2de);_0x505a89=buildMergedJourneyDef(_0x397350,_0x2fc6c7,_0x2fb278);const _0x111cd0=Math[_0x223927(0xd0)](..._0x397350[_0x223927(0x122)](_0x1fdeb7=>_0x1fdeb7['item'][_0x223927(0x145)]||0x0)),_0x39236e=_0x3838dd['find'](_0x50ebb1=>(_0x50ebb1[_0x223927(0x145)]||0x0)===_0x111cd0);_0x39236e&&(_0x42e5fc['progress']?.[_0x223927(0xc0)](_0x223927(0xc4)+_0x86d2de['name']+'\x20v'+_0x111cd0),_0x16bd4a=await _0x520459(_0x39236e['id']));}else{const _0x449b20=_0x3838dd[_0x3838dd[_0x223927(0x19d)]-0x1];_0x42e5fc['progress']?.[_0x223927(0xc0)](_0x223927(0xc4)+_0x86d2de['name']),_0x16bd4a=await _0x520459(_0x449b20['id']);const _0x5ace31=_0x2b6483(_0x449b20['id']),_0x208790=await journeyResponseToDef(_0x16bd4a,_0x5ace31),_0x29884a=buildLocalRuleToNameMappingFromJourney(_0x86d2de);_0x505a89=buildMergedJourneyDef([{'item':_0x449b20,'yaml':_0x208790}],_0x29884a,_0x2fb278);}}addFoldersToCreate(_0x4d8a98,_0x42e5fc[_0x223927(0x140)],_0x1fd269);const _0x3ea940=calculateJourneyDiff(_0x86d2de,_0x505a89);_0x340ec7[_0x223927(0x14a)]({'relativePath':_0x86d2de['name'],'absolutePath':_0x2a1222,'yamlConfig':_0x86d2de,'folderPath':_0x4d8a98,'existingJourney':_0x16bd4a,'isNew':_0x3ea940['isNew'],'hasChanges':_0x3ea940['hasChanges'],'diff':_0x3ea940['diff']});}return{'journeyFiles':_0x340ec7,'foldersToCreate':_0x1fd269};}export function calculateActivationActions(_0x9fb89d,_0x1df68f,_0x204d34,_0x15f2db){const _0x588d9e=a142_0x2ccdb5,_0x32a236=[],_0xd5b334=new Map();for(const _0x4c8fb8 of _0x1df68f){_0xd5b334['set'](_0x4c8fb8[_0x588d9e(0xed)],_0x4c8fb8);}const _0x2c65aa=new Map();for(const _0x530704 of _0x9fb89d){_0x2c65aa[_0x588d9e(0xb4)](_0x530704[_0x588d9e(0xed)],_0x530704);}for(const _0xe28c10 of _0x9fb89d){const _0x5bff25=_0xd5b334[_0x588d9e(0x185)](_0xe28c10['name']);if(!_0x5bff25)_0x32a236[_0x588d9e(0x14a)]({'type':_0x588d9e(0xa9),'name':_0xe28c10['name'],'yamlActivation':_0xe28c10});else{const _0x49b31f=activationResponseToDef(_0x5bff25,_0x204d34,_0x15f2db),_0x4f4326=a142_0x79a98e[_0x588d9e(0x162)](_0x49b31f),_0x4c0ef6=a142_0x79a98e[_0x588d9e(0x162)](_0xe28c10);_0x4f4326!==_0x4c0ef6&&_0x32a236[_0x588d9e(0x14a)]({'type':_0x588d9e(0xc0),'name':_0xe28c10['name'],'yamlActivation':_0xe28c10,'existingActivation':_0x5bff25});}}for(const _0x5aae8d of _0x1df68f){!_0x2c65aa[_0x588d9e(0x105)](_0x5aae8d[_0x588d9e(0xed)])&&_0x32a236[_0x588d9e(0x14a)]({'type':_0x588d9e(0x114),'name':_0x5aae8d[_0x588d9e(0xed)],'existingActivation':_0x5aae8d});}return _0x32a236;}function calculateYamlDiff(_0x345e46,_0x137abe){if(_0x137abe){const _0x47103d=generateDiff(_0x137abe,_0x345e46),_0x11678a=hasChanges(_0x47103d);return{'isNew':![],'hasChanges':_0x11678a,'diff':_0x11678a?formatDiffWithColors(_0x47103d):undefined};}const _0x76de43=generateDiff('',_0x345e46);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x76de43)};}export function calculateSegmentDiff(_0x56f14d,_0x4a4328,_0x83ac99,_0x323362,_0x5210cd){const _0x4f83f7=segmentToYamlString(_0x56f14d),_0x421964=_0x4a4328?segmentToYamlString(segmentWithActivationsToYaml(_0x4a4328,_0x83ac99,undefined,_0x323362,_0x5210cd)):undefined;return calculateYamlDiff(_0x4f83f7,_0x421964);}export function calculateJourneyDiff(_0x5bf314,_0x4e9605){const _0xd58bf8=normalizeJourneyDef(_0x5bf314,_0x5bf314),_0x17f8fb=a142_0x94e2bd(_0xd58bf8),_0x46bf19=_0x4e9605?a142_0x94e2bd(normalizeJourneyDef(_0x4e9605,_0x5bf314)):undefined;return calculateYamlDiff(_0x17f8fb,_0x46bf19);}export function findSegmentsToDelete(_0x2b7183,_0x17163f,_0x51d65c,_0x4aeac6,_0x18a373){const _0x5cf217=a142_0x2ccdb5,_0x4d7a9d=new Set();for(const {yamlConfig:_0x2e5654,folderPath:_0x332dc9}of _0x17163f){_0x4d7a9d['add'](_0x332dc9+':'+_0x2e5654[_0x5cf217(0xed)]);}return _0x2b7183[_0x5cf217(0x108)](_0x20a7a1=>{const _0x13591f=_0x5cf217,_0x2fa38e=_0x20a7a1[_0x13591f(0xca)]?_0x51d65c[_0x13591f(0x185)](_0x20a7a1[_0x13591f(0xca)]['toString']())||'':'',_0xdcf2f0=_0x2fa38e+':'+_0x20a7a1[_0x13591f(0xed)];if(_0x4d7a9d[_0x13591f(0x105)](_0xdcf2f0))return![];if(_0x18a373)return _0x2fa38e===_0x4aeac6||_0x2fa38e['startsWith'](_0x4aeac6+'/');return!![];});}export function findJourneysToDelete(_0x1cd498,_0x57a213,_0x16e7b3,_0x46abdf,_0x4f06bf){const _0x493cd5=a142_0x2ccdb5,_0x2a36b6=new Set();for(const {yamlConfig:_0x4c8d47,folderPath:_0x3f7f93}of _0x57a213){_0x2a36b6[_0x493cd5(0x118)](_0x3f7f93+':'+_0x4c8d47[_0x493cd5(0xed)]);}return _0x1cd498['filter'](_0x2e5c3b=>{const _0x20bd20=_0x493cd5,_0x1bdc7d=_0x2e5c3b[_0x20bd20(0xa6)]?_0x16e7b3[_0x20bd20(0x185)](_0x2e5c3b[_0x20bd20(0xa6)])||'':'',_0x53f897=_0x1bdc7d+':'+_0x2e5c3b['journeyBundleName'];if(_0x2a36b6[_0x20bd20(0x105)](_0x53f897))return![];if(_0x4f06bf)return _0x1bdc7d===_0x46abdf||_0x1bdc7d[_0x20bd20(0x181)](_0x46abdf+'/');return!![];});}export function buildSegmentLookupMap(_0x1e6a92,_0x5900c6){const _0x9927ee=a142_0x2ccdb5,_0x11cb25=new Map();for(const _0x4f9de3 of _0x1e6a92){const _0x24d90d=_0x4f9de3[_0x9927ee(0xca)]?_0x5900c6[_0x9927ee(0x185)](_0x4f9de3[_0x9927ee(0xca)][_0x9927ee(0xa3)]())||'':'',_0x54a8ee=_0x24d90d+':'+_0x4f9de3[_0x9927ee(0xed)];_0x11cb25[_0x9927ee(0xb4)](_0x54a8ee,_0x4f9de3);}return _0x11cb25;}export function buildSegmentNameToIdMap(_0x25b953){const _0x2ca5b1=a142_0x2ccdb5,_0x41944b=new Map();for(const _0x350772 of _0x25b953){_0x41944b[_0x2ca5b1(0xb4)](_0x350772[_0x2ca5b1(0xed)],_0x350772['id']);}return _0x41944b;}export function buildJourneyBundleLookupMap(_0x40d02c,_0x35184b){const _0x5f32ca=a142_0x2ccdb5,_0x27dc60=new Map();for(const _0x1390a1 of _0x40d02c){const _0x579f15=_0x1390a1['folderId']?_0x35184b[_0x5f32ca(0x185)](_0x1390a1[_0x5f32ca(0xa6)])||'':'',_0x26fcff=_0x579f15+':'+_0x1390a1[_0x5f32ca(0xf2)];!_0x27dc60['has'](_0x26fcff)&&_0x27dc60[_0x5f32ca(0xb4)](_0x26fcff,[]),_0x27dc60['get'](_0x26fcff)[_0x5f32ca(0x14a)](_0x1390a1);}for(const _0x411a20 of _0x27dc60[_0x5f32ca(0xe5)]()){_0x411a20[_0x5f32ca(0x18b)]((_0x5dba9c,_0x2c236b)=>(_0x5dba9c[_0x5f32ca(0x145)]||0x0)-(_0x2c236b[_0x5f32ca(0x145)]||0x0));}return _0x27dc60;}export function collectFoldersToCreate(_0xb297a6,_0x3497c8){const _0x1a41d5=a142_0x2ccdb5,_0x2813b2=new Set();for(const _0x715361 of _0xb297a6){if(!_0x715361)continue;if(_0x3497c8[_0x1a41d5(0x105)](_0x715361))continue;const _0x2fac1c=_0x715361[_0x1a41d5(0xbd)]('/');let _0x14d571='';for(const _0x151602 of _0x2fac1c){_0x14d571=_0x14d571?_0x14d571+'/'+_0x151602:_0x151602,!_0x3497c8[_0x1a41d5(0x105)](_0x14d571)&&_0x2813b2['add'](_0x14d571);}}return _0x2813b2;}export function parseAndClassifyYamlFiles(_0x1cf621,_0x29349e,_0x48b266){const _0x312154=a142_0x2ccdb5,_0x2eff16=[],_0x3e3cf1=[];for(const _0x1523e4 of _0x1cf621){const _0x38aeef=a142_0x232f03['relative'](_0x29349e,a142_0x232f03[_0x312154(0xf3)](_0x1523e4)),_0x392d84=_0x38aeef==='.'?'':_0x38aeef,_0x5358b3=readFileSync(_0x1523e4,_0x312154(0x15e)),_0x2b1020=a142_0x79a98e['parse'](_0x5358b3);if(isJourneyDef(_0x2b1020)){const _0x2bf6eb=a142_0x401a86(_0x5358b3);_0x3e3cf1[_0x312154(0x14a)]({'yamlConfig':_0x2bf6eb,'folderPath':_0x392d84,'sourcePath':_0x1523e4});}else{if(!_0x48b266?.['skipSegments']){const _0x2c8d7a=parseSegmentYamlFile(_0x5358b3),_0x50f387=normalizeChildSegmentYaml(_0x2c8d7a);_0x2eff16['push']({'yamlConfig':_0x50f387,'folderPath':_0x392d84,'sourcePath':_0x1523e4});}}}return{'segments':_0x2eff16,'journeys':_0x3e3cf1};}export function validateParsedFiles(_0x44ccd3,_0x5975e8){const _0x3a6617=a142_0x2ccdb5,_0x14b0bb=[];for(const {yamlConfig:_0x513dfa,sourcePath:_0x4d2b2b}of _0x44ccd3[_0x3a6617(0xde)]){const _0x5b19fc=readFileSync(_0x4d2b2b,_0x3a6617(0x15e)),_0x5636c9=a142_0x79a98e[_0x3a6617(0xfe)](_0x5b19fc),_0x5780a4=validateSegmentDef(_0x513dfa,{'source':_0x5b19fc,'document':_0x5636c9},{'skipSchema':!![]});if(!_0x5780a4['valid']){const _0x4022f0=a142_0x232f03['relative'](_0x5975e8,_0x4d2b2b);_0x14b0bb[_0x3a6617(0x14a)]({'filePath':_0x4022f0,'source':_0x5b19fc,'result':_0x5780a4,'isJourney':![]});}}for(const {yamlConfig:_0x1e2131,sourcePath:_0x273f80}of _0x44ccd3['journeys']){const _0x1601f=readFileSync(_0x273f80,'utf-8'),_0x5e5335=a142_0x79a98e[_0x3a6617(0xfe)](_0x1601f),_0x320b48=validateJourneyDef(_0x1e2131,{'source':_0x1601f,'document':_0x5e5335},{'skipSchema':!![]});if(!_0x320b48[_0x3a6617(0x12a)]){const _0xd2d024=a142_0x232f03[_0x3a6617(0x131)](_0x5975e8,_0x273f80);_0x14b0bb[_0x3a6617(0x14a)]({'filePath':_0xd2d024,'source':_0x1601f,'result':_0x320b48,'isJourney':!![]});}}return _0x14b0bb;}export function formatValidationErrors(_0xdfab6f){const _0x401a91=a142_0x2ccdb5,_0x57475f=[];for(const {filePath:_0x3745bc,source:_0x42f2a1,result:_0x9e683a,isJourney:_0x15d991}of _0xdfab6f){const _0x43f785=_0x15d991?_0x401a91(0x188):'segment';_0x57475f[_0x401a91(0x14a)]('\x0a'+_0x3745bc+'\x20('+_0x43f785+'):\x20'+_0x9e683a['errors'][_0x401a91(0x19d)]+_0x401a91(0x19b)),_0x57475f[_0x401a91(0x14a)](formatValidationResult(_0x9e683a,_0x42f2a1,_0x3745bc));}return _0x57475f[_0x401a91(0xb3)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x56654d){const _0x594a2d=a142_0x2ccdb5,_0x465f1c=new Set(),_0x61efff=new Map(),_0x13c3d1=collectSegmentUsageCounts(_0x56654d);if(_0x56654d[_0x594a2d(0xde)])for(const [_0x5e34c9,_0x598808]of Object['entries'](_0x56654d[_0x594a2d(0xde)])){_0x465f1c['add'](_0x5e34c9);if(_0x598808[_0x594a2d(0x193)]){const _0x46faaa=yamlRuleToApi(_0x598808[_0x594a2d(0x193)]),_0x47b5b7=apiRuleToYaml(_0x46faaa);_0x61efff[_0x594a2d(0xb4)](_0x5e34c9,_0x47b5b7);}}const _0x5f06dc=new Map();let _0x1f6311=0x0;for(const [_0x2b37ef,_0xb7fb9d]of _0x61efff){const _0x53454b=serializeExpandedRule(_0xb7fb9d,_0x61efff),_0x336b92=_0x5f06dc[_0x594a2d(0x185)](_0x53454b)||[];_0x336b92[_0x594a2d(0x14a)]({'name':_0x2b37ef,'index':_0x1f6311}),_0x5f06dc['set'](_0x53454b,_0x336b92),_0x1f6311++;}const _0x2b1fd0=new Map();for(const [_0x49c7a8,_0x3cd95c]of _0x5f06dc){const _0x1ffd74=_0x3cd95c[_0x594a2d(0xb7)]()['sort']((_0x472732,_0x5787ad)=>{const _0x37d7aa=_0x594a2d,_0x46d092=_0x13c3d1[_0x37d7aa(0x185)](_0x472732['name'])||0x0,_0x442823=_0x13c3d1[_0x37d7aa(0x185)](_0x5787ad[_0x37d7aa(0xed)])||0x0;if(_0x46d092!==_0x442823)return _0x442823-_0x46d092;return _0x472732[_0x37d7aa(0xcd)]-_0x5787ad[_0x37d7aa(0xcd)];})[_0x594a2d(0x122)](_0x44374f=>_0x44374f[_0x594a2d(0xed)]),_0x35ca66=[];for(const _0x15bfba of _0x1ffd74){const _0x28955a=_0x13c3d1['get'](_0x15bfba)||0x0,_0x1e527b=Math['max'](_0x28955a,0x1);for(let _0x2ff88b=0x0;_0x2ff88b<_0x1e527b;_0x2ff88b++){_0x35ca66['push'](_0x15bfba);}}_0x2b1fd0[_0x594a2d(0xb4)](_0x49c7a8,_0x35ca66);}return{'existingLocalSegmentNames':_0x465f1c,'localSegmentRules':_0x61efff,'localExpandedRuleToNames':_0x2b1fd0};}export function createSegmentIdResolver(_0x447db3,_0x37a570){return async _0x1a4623=>{const _0x11a085=a142_0x48cb,_0x27111a=_0x447db3[_0x11a085(0x185)](_0x1a4623);if(!_0x27111a)throw new SDKError(ErrorCode[_0x11a085(0x155)],'Segment\x20not\x20found:\x20'+_0x1a4623+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x37a570+'\x27)');return _0x27111a;};}export function extractRootFolderId(_0x146327){const _0x2fa0fe=a142_0x2ccdb5;return _0x146327[_0x2fa0fe(0x198)]?.['parentSegmentFolder']?.[_0x2fa0fe(0xfa)]?.['id']||_0x146327[_0x2fa0fe(0x198)]?.[_0x2fa0fe(0xfb)]?.['data']?.['id'];}export function buildConnectionMaps(_0x3ace90){const _0x34a080=a142_0x2ccdb5,_0x4279d2=new Map(),_0x54c913=new Map(),_0x98619f=new Map();for(const _0x4d1432 of _0x3ace90){_0x4279d2[_0x34a080(0xb4)](_0x4d1432[_0x34a080(0xed)],parseInt(_0x4d1432['id'],0xa)),_0x54c913[_0x34a080(0xb4)](_0x4d1432['id'],_0x4d1432[_0x34a080(0xed)]),_0x98619f[_0x34a080(0xb4)](_0x4d1432['name'],_0x4d1432[_0x34a080(0xf7)]);}return{'nameToId':_0x4279d2,'idToName':_0x54c913,'nameToType':_0x98619f};}export function calculatePushStats(_0x238579,_0xb8e5db,_0x548a34,_0x5d1673,_0x348c3e,_0x10bf79,_0xd428de){const _0x249431=a142_0x2ccdb5,_0x3e74af=_0x238579[_0x249431(0x108)](_0x380020=>_0x380020['isNew']),_0x312ac2=_0x238579[_0x249431(0x108)](_0x55c5c4=>!_0x55c5c4[_0x249431(0xd7)]&&_0x55c5c4[_0x249431(0xea)]),_0x483bd9=_0x238579[_0x249431(0x108)](_0x269e19=>!_0x269e19[_0x249431(0xd7)]&&!_0x269e19['hasChanges']),_0x49ebd4=_0x10bf79?_0x5d1673:[],_0x4ca0=_0xb8e5db[_0x249431(0x108)](_0x1215f8=>_0x1215f8[_0x249431(0xd7)]),_0x3b8210=_0xb8e5db[_0x249431(0x108)](_0xaf46f1=>!_0xaf46f1[_0x249431(0xd7)]&&_0xaf46f1['hasChanges']),_0x50f741=_0xb8e5db[_0x249431(0x108)](_0x5bc4c0=>!_0x5bc4c0['isNew']&&!_0x5bc4c0[_0x249431(0xea)]),_0x12ed6b=_0x10bf79?_0x348c3e:[],_0x5b7fce=_0x238579[_0x249431(0xc2)](_0x16eef7=>_0x16eef7[_0x249431(0x115)]),_0x44abaa=_0x5b7fce[_0x249431(0x108)](_0x17f334=>_0x17f334[_0x249431(0xf7)]===_0x249431(0xa9)),_0x192824=_0x5b7fce['filter'](_0x5b49a6=>_0x5b49a6[_0x249431(0xf7)]===_0x249431(0xc0)),_0x2166fe=_0x5b7fce[_0x249431(0x108)](_0x333afa=>_0x333afa[_0x249431(0xf7)]===_0x249431(0x114)),_0x36aaca=Array[_0x249431(0xcb)](_0x548a34)[_0x249431(0x18b)](),_0x45231b=_0xd428de?![]:_0x3e74af[_0x249431(0x19d)]>0x0||_0x312ac2['length']>0x0||_0x49ebd4['length']>0x0,_0x562124=_0x4ca0['length']>0x0||_0x3b8210[_0x249431(0x19d)]>0x0||_0x12ed6b[_0x249431(0x19d)]>0x0,_0x6223b5=_0xd428de?![]:_0x5b7fce[_0x249431(0x19d)]>0x0,_0x33f266=_0x36aaca['length']>0x0;return{'segments':{'new':_0x3e74af,'changed':_0x312ac2,'unchanged':_0x483bd9,'toDelete':_0x49ebd4},'journeys':{'new':_0x4ca0,'changed':_0x3b8210,'unchanged':_0x50f741,'toDelete':_0x12ed6b},'activations':{'all':_0x5b7fce,'toCreate':_0x44abaa,'toUpdate':_0x192824,'toDelete':_0x2166fe},'folders':{'toCreate':_0x36aaca},'counts':{'segments':{'new':_0x3e74af[_0x249431(0x19d)],'changed':_0x312ac2[_0x249431(0x19d)],'unchanged':_0x483bd9['length'],'toDelete':_0x49ebd4[_0x249431(0x19d)]},'journeys':{'new':_0x4ca0[_0x249431(0x19d)],'changed':_0x3b8210[_0x249431(0x19d)],'unchanged':_0x50f741[_0x249431(0x19d)],'toDelete':_0x12ed6b['length']},'activations':{'create':_0x44abaa[_0x249431(0x19d)],'update':_0x192824[_0x249431(0x19d)],'delete':_0x2166fe[_0x249431(0x19d)]},'folders':_0x36aaca[_0x249431(0x19d)]},'hasChanges':_0x45231b||_0x562124||_0x6223b5||_0x33f266};}export async function buildPushExecutionContext(_0x1406f3,_0x2a5f6a,_0x381fb1,_0x3137ba,_0x3dfb3f,_0x502505){const _0x29294a=a142_0x2ccdb5,_0xa71fc4=extractRootFolderId(_0x381fb1),{pathToId:_0x14559a,idToPath:_0x10b14e}=buildFolderMaps(_0x3dfb3f),_0x1357e8=buildSegmentNameToIdMap(_0x3137ba),_0x57a91a=new Map(),{batchAsync:_0x41e4ef}=await import(_0x29294a(0x15a)),[_0x5ed814,_0x2abb51]=await Promise['all']([_0x1406f3[_0x29294a(0x186)][_0x29294a(0x183)](),_0x1406f3[_0x29294a(0xaf)][_0x29294a(0x121)](),((async()=>{const _0x20fab9=_0x29294a;!_0x502505&&_0x3137ba[_0x20fab9(0x19d)]>0x0&&await _0x41e4ef(_0x3137ba,async _0x5c071c=>{const _0x55ac9e=_0x20fab9,_0x5a3e10=await _0x1406f3[_0x55ac9e(0xaa)][_0x55ac9e(0x173)](_0x2a5f6a,_0x5c071c['id']);_0x57a91a[_0x55ac9e(0xb4)](_0x5c071c['id'],_0x5a3e10);});})())]),{emailToId:_0xfee1cd,idToEmail:_0x3f9590}=_0x5ed814,_0x83fcc6=buildConnectionMaps(_0x2abb51);return{'rootFolderId':_0xa71fc4,'folderPathToId':_0x14559a,'folderIdToPath':_0x10b14e,'segmentNameToId':_0x1357e8,'activationsBySegmentId':_0x57a91a,'emailToIdMap':_0xfee1cd,'idToEmailMap':_0x3f9590,'connectionNameToIdMap':_0x83fcc6['nameToId'],'connectionIdToNameMap':_0x83fcc6[_0x29294a(0x16a)],'connectionNameToTypeMap':_0x83fcc6[_0x29294a(0xac)]};}export function createPushYamlContextForBundle(_0x504a3f,_0x283cc1,_0x107730,_0x548463,_0x16681f,_0x19336b,_0x30da38,_0x30e829){const {existingLocalSegmentNames:_0x1fc4d3,localExpandedRuleToNames:_0xb40a1d}=_0x548463,_0x4e0f34=new Set(),_0x2d0216=new Map(),_0x86b2cf=new Map(),_0x51cc94=new Map(),_0x5acfaa=createJumpTargetCache(),_0x1ba82b=new Map(),_0x36151=new Map(),_0x318850=new Set();let _0x5a2313;const _0x4fc202=_0xa44ac8=>{const _0x38f216={'resolveSegment':async _0x7565f2=>{const _0x13d75a=a142_0x48cb,_0x3774ff=_0x51cc94[_0x13d75a(0x185)](_0x7565f2);if(_0x3774ff!==undefined)return{'name':_0x3774ff,'isJourneyLocal':!![]};try{const _0x494212=await fetchSegment(_0x504a3f,_0x283cc1,_0x7565f2,_0x107730);if(!_0x494212)throw new Error(_0x13d75a(0xdb));const _0x18f905=generateJourneyLocalName(_0x494212[_0x13d75a(0xed)]),_0x110509=_0x494212[_0x13d75a(0xe1)]===SEGMENT_KIND_JOURNEY&&_0x18f905!==undefined;let _0x492f9f=_0x494212[_0x13d75a(0xed)],_0x2d17fb;if(_0x110509&&_0x494212[_0x13d75a(0x193)]){const _0x4bd203=apiRuleToYaml(_0x494212[_0x13d75a(0x193)]);_0x36151[_0x13d75a(0xb4)](_0x7565f2,_0x4bd203);const _0x33a96b=async _0x3d35dd=>{const _0x53333a=_0x13d75a,_0x493edc=collectSegmentRefsFromRule(_0x3d35dd);for(const _0xd929c3 of _0x493edc){if(!_0x36151[_0x53333a(0x105)](_0xd929c3))try{const _0x3ecfcb=await fetchSegment(_0x504a3f,_0x283cc1,_0xd929c3,_0x107730);if(_0x3ecfcb?.['rule']){const _0x515def=apiRuleToYaml(_0x3ecfcb[_0x53333a(0x193)]);_0x36151['set'](_0xd929c3,_0x515def),await _0x33a96b(_0x515def);}}catch(_0x1ae14b){logger[_0x53333a(0xe3)](_0x53333a(0xbf)+_0xd929c3+':\x20'+_0x1ae14b);}}};await _0x33a96b(_0x4bd203);const _0x52e463=serializeExpandedRule(_0x4bd203,_0x36151),_0x4fae48=_0xb40a1d[_0x13d75a(0x185)](_0x52e463);if(_0x4fae48&&_0x4fae48[_0x13d75a(0x19d)]>0x0){const _0x4e68e6=_0x2d0216['get'](_0x52e463)||0x0,_0x53f8fc=_0x4fae48[_0x4e68e6]||_0x4fae48[_0x4fae48['length']-0x1];_0x2d0216['set'](_0x52e463,_0x4e68e6+0x1),_0x492f9f=_0x53f8fc,_0x4e0f34[_0x13d75a(0x118)](_0x492f9f),_0x51cc94['set'](_0x7565f2,_0x492f9f);const _0x55f208=await resolveRuleSegmentRefs(_0x4bd203,async _0x319173=>{const _0x191165=_0x13d75a,_0x496873=_0x51cc94['get'](_0x319173);if(_0x496873)return _0x496873;const _0x4a47ac=await _0x5a2313[_0x191165(0xff)](_0x319173);return _0x4a47ac[_0x191165(0xed)];});_0x2d17fb={'description':_0x494212[_0x13d75a(0x10d)],'rule':_0x55f208};}else{const _0x2f4f2d=_0x1ba82b[_0x13d75a(0x185)](_0x52e463);if(_0x2f4f2d)_0x492f9f=_0x2f4f2d,_0x51cc94['set'](_0x7565f2,_0x492f9f);else{if(_0x18f905){let _0x38a79d=_0x18f905,_0x5a7113=0x2;while(_0x4e0f34['has'](_0x38a79d)||_0x1fc4d3[_0x13d75a(0x105)](_0x38a79d)){_0x38a79d=_0x18f905+'_'+_0x5a7113,_0x5a7113++;}_0x4e0f34['add'](_0x38a79d),_0x492f9f=_0x38a79d;}_0x51cc94[_0x13d75a(0xb4)](_0x7565f2,_0x492f9f),_0x1ba82b['set'](_0x52e463,_0x492f9f);const _0x4b1a26=await resolveRuleSegmentRefs(_0x4bd203,async _0xc8852a=>{const _0x35756b=_0x13d75a,_0x1b919b=_0x51cc94['get'](_0xc8852a);if(_0x1b919b)return _0x1b919b;const _0x4e520d=await _0x5a2313[_0x35756b(0xff)](_0xc8852a);return _0x4e520d[_0x35756b(0xed)];});_0x2d17fb={'description':_0x494212[_0x13d75a(0x10d)],'rule':_0x4b1a26};}}}return{'name':_0x492f9f,'isJourneyLocal':_0x110509,'definition':_0x2d17fb};}catch(_0x21cba6){return logger[_0x13d75a(0xe3)]('Failed\x20to\x20resolve\x20segment\x20'+_0x7565f2+':\x20'+_0x21cba6),{'name':_0x7565f2,'isJourneyLocal':![]};}},'resolveActivation':async _0x831fb3=>{const _0x2aec23=a142_0x48cb,_0x3abcfa=_0x86b2cf[_0x2aec23(0x185)](_0x831fb3);if(_0x3abcfa!==undefined)return{'name':_0x3abcfa,'isJourneyLocal':!![]};try{let _0x2ec141=_0x30da38?.[_0x2aec23(0x185)](_0x831fb3);!_0x2ec141&&(_0x2ec141=await _0x504a3f[_0x2aec23(0x188)]['getActivation'](_0xa44ac8,_0x831fb3));const _0x14ba8c=_0x2ec141[_0x2aec23(0x13b)]['activationParams'][_0x2aec23(0xed)]||_0x831fb3,_0x207733=sanitizeYamlKey(_0x14ba8c)||_0x2aec23(0x17a)+_0x831fb3,_0x51fa56=_0x207733;_0x86b2cf[_0x2aec23(0xb4)](_0x831fb3,_0x51fa56);const _0x226fe9=journeyActivationStepToYaml(_0x2ec141,_0x16681f,_0x19336b);return{'name':_0x51fa56,'isJourneyLocal':!![],'definition':_0x226fe9};}catch(_0x133f29){return logger['debug'](_0x2aec23(0x167)+_0x831fb3+':\x20'+_0x133f29),{'name':_0x831fb3,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5705a2,_0x3af5c0)=>resolveJumpTarget(_0x5705a2,_0x3af5c0,_0x5acfaa,async _0x9023c8=>{const _0x3b093f=a142_0x48cb,_0x457b31=_0x30e829?.[_0x3b093f(0x185)](_0x9023c8);if(_0x457b31)return _0x457b31;return _0x504a3f[_0x3b093f(0x188)][_0x3b093f(0xec)](_0x9023c8);})};return _0x5a2313=_0x38f216,_0x38f216;},_0x3df1c1=async _0x16aee2=>{const _0x2ba5e4=a142_0x48cb,{collectSegmentIdsFromJourneyApi:_0x3a1729}=await import(_0x2ba5e4(0xc9)),{batchAsync:_0x15634f}=await import(_0x2ba5e4(0x15a)),_0x25d098=new Set();for(const _0x2f80ed of _0x16aee2){let _0x372ad9=_0x30e829?.[_0x2ba5e4(0x185)](_0x2f80ed);!_0x372ad9&&(_0x372ad9=await _0x504a3f['journey'][_0x2ba5e4(0xec)](_0x2f80ed));const _0x18af1a=_0x3a1729(_0x372ad9);for(const _0x1223e3 of _0x18af1a){_0x25d098['add'](_0x1223e3);}}let _0x34d2cb=Array['from'](_0x25d098);while(_0x34d2cb['length']>0x0){const _0x5b2748=_0x34d2cb[_0x2ba5e4(0x108)](_0x1c7911=>!_0x318850['has'](_0x1c7911));if(_0x5b2748[_0x2ba5e4(0x19d)]===0x0)break;const _0x11cfd6=await _0x15634f(_0x5b2748,async _0x1d20e0=>{const _0xd78dc6=_0x2ba5e4;_0x318850[_0xd78dc6(0x118)](_0x1d20e0);const _0x479c85=await fetchSegment(_0x504a3f,_0x283cc1,_0x1d20e0,_0x107730);if(!_0x479c85)return null;return{'segmentId':_0x1d20e0,'segment':_0x479c85};},0xa),_0x338032=new Set();for(const _0x4ce449 of _0x11cfd6){if(!_0x4ce449?.[_0x2ba5e4(0xaa)]?.[_0x2ba5e4(0x193)])continue;const _0x4b3210=apiRuleToYaml(_0x4ce449['segment'][_0x2ba5e4(0x193)]);_0x36151[_0x2ba5e4(0xb4)](_0x4ce449[_0x2ba5e4(0x112)],_0x4b3210);const _0x4b10f1=collectSegmentRefsFromRule(_0x4b3210);for(const _0x4fa6d5 of _0x4b10f1){!_0x318850[_0x2ba5e4(0x105)](_0x4fa6d5)&&_0x338032[_0x2ba5e4(0x118)](_0x4fa6d5);}}_0x34d2cb=Array[_0x2ba5e4(0xcb)](_0x338032);}};return{'createYamlContext':_0x4fc202,'prefetchJourneySegments':_0x3df1c1};}export async function executePushSegments(_0x3f752c,_0x3bc1d7,_0x14135d,_0x4c930f,_0xf19740){const _0x26d103=a142_0x2ccdb5,{segmentDefToCreateRequest:_0x552817,segmentDefToUpdateRequest:_0x3dc78b}=await import(_0x26d103(0x180)),_0x4b7f83=_0x14135d[_0x26d103(0x140)],_0x2e2737=0x5,_0x5b6eef=async _0x1d5546=>{const _0x278163=_0x26d103,_0x1c77d0=_0x1d5546[_0x278163(0x119)]?_0x4b7f83[_0x278163(0x185)](_0x1d5546[_0x278163(0x119)]):undefined;let _0x7e0a08;const _0x2b6375={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x5b0416=_0x1d5546[_0x278163(0x11e)];if(_0x1d5546['yamlConfig']['rule']){const _0x321a88=createSegmentIdResolver(_0x14135d[_0x278163(0x104)],_0x1d5546['yamlConfig']['name']),_0xd6bee8=await resolveRuleSegmentIds(_0x1d5546['yamlConfig'][_0x278163(0x193)],_0x321a88);_0x5b0416={..._0x1d5546['yamlConfig'],'rule':_0xd6bee8};}try{if(_0x1d5546['isNew']){_0xf19740[_0x278163(0x172)]?.({'type':'segment_creating','name':_0x1d5546[_0x278163(0x11e)]['name']});const _0x100d3f=_0x552817(_0x5b0416,_0x1c77d0),_0x4fc25b=await _0xf19740[_0x278163(0xba)](_0x278163(0x102)+_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]+'\x27...',()=>_0x3f752c[_0x278163(0xaa)][_0x278163(0x19a)](_0x4c930f[_0x278163(0x16f)],_0x100d3f));_0x7e0a08=_0x4fc25b['data']['id'],_0x14135d[_0x278163(0x104)]['set'](_0x1d5546['yamlConfig']['name'],_0x7e0a08),_0x2b6375[_0x278163(0x159)]={'name':_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)],'id':_0x7e0a08},_0xf19740[_0x278163(0x172)]?.({'type':'segment_created','name':_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)],'segmentId':_0x7e0a08}),_0xf19740[_0x278163(0x18e)]?.('Created\x20segment\x20\x27'+_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]+'\x27'),_0x2b6375[_0x278163(0x126)]=0x1;}else{if(_0x1d5546[_0x278163(0xea)]){_0xf19740[_0x278163(0x172)]?.({'type':_0x278163(0x194),'name':_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]});const _0x34423d=_0x3dc78b(_0x5b0416);_0x1c77d0!==_0x1d5546[_0x278163(0xd5)]?.[_0x278163(0xca)]&&(_0x34423d[_0x278163(0xca)]=_0x1c77d0?parseInt(_0x1c77d0,0xa):undefined),await _0xf19740[_0x278163(0xba)]('Updating\x20segment\x20\x27'+_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]+_0x278163(0xf0),()=>_0x3f752c['segment'][_0x278163(0x117)](_0x4c930f['parentId'],_0x1d5546[_0x278163(0xd5)]['id'],_0x34423d)),_0x7e0a08=_0x1d5546[_0x278163(0xd5)]['id'],_0xf19740['onProgress']?.({'type':'segment_updated','name':_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]}),_0xf19740[_0x278163(0x18e)]?.(_0x278163(0x17e)+_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]+'\x27'),_0x2b6375[_0x278163(0xf9)]=0x1;}else _0x7e0a08=_0x1d5546['existingSegment']['id'];}}catch(_0x38c4e0){const _0x4237ee=isHttp400Error(_0x38c4e0),_0x225d5e=_0x4237ee?ErrorCode[_0x278163(0x14f)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x44b3da=getErrorMessage(_0x38c4e0);throw new SDKError(_0x225d5e,_0x278163(0xdc)+(_0x1d5546[_0x278163(0xd7)]?_0x278163(0xa9):_0x278163(0xc0))+'\x20segment\x20from\x20file:\x20'+_0x1d5546[_0x278163(0x14b)]+_0x278163(0x189)+_0x44b3da,_0x38c4e0);}try{const _0x218c6f=await syncActivationsForSegment(_0x3f752c,_0x4c930f[_0x278163(0x16f)],_0x7e0a08,_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)],_0x1d5546['activationActions'],_0xf19740,_0x1d5546[_0x278163(0x14b)]);_0x2b6375[_0x278163(0x146)]=_0x218c6f;}catch(_0x1d0894){if(_0x1d0894 instanceof SDKError)throw _0x1d0894;throw new SDKError(ErrorCode[_0x278163(0xf4)],_0x278163(0xa2)+_0x1d5546[_0x278163(0x11e)][_0x278163(0xed)]+_0x278163(0x106)+_0x1d5546['absolutePath']+_0x278163(0x189)+getErrorMessage(_0x1d0894),_0x1d0894);}return _0x2b6375;},_0xc70c8c=await batchAsync(_0x3bc1d7,_0x5b6eef,_0x2e2737),_0x41eb24={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2fa594 of _0xc70c8c){_0x41eb24[_0x26d103(0x126)]+=_0x2fa594[_0x26d103(0x126)],_0x41eb24[_0x26d103(0xf9)]+=_0x2fa594[_0x26d103(0xf9)],_0x2fa594[_0x26d103(0x159)]&&_0x41eb24[_0x26d103(0x11f)][_0x26d103(0xb4)](_0x2fa594['createdSegmentId'][_0x26d103(0xed)],_0x2fa594[_0x26d103(0x159)]['id']),_0x41eb24[_0x26d103(0x146)][_0x26d103(0x126)]+=_0x2fa594[_0x26d103(0x146)][_0x26d103(0x126)],_0x41eb24[_0x26d103(0x146)][_0x26d103(0xf9)]+=_0x2fa594['activations'][_0x26d103(0xf9)],_0x41eb24[_0x26d103(0x146)]['deleted']+=_0x2fa594[_0x26d103(0x146)][_0x26d103(0x141)];}return _0x41eb24;}async function syncActivationsForSegment(_0x3db0d3,_0x1fcc6f,_0x193a6b,_0x3035c9,_0x5421e4,_0x3298a7,_0x8e9833){const _0x37ca20=a142_0x2ccdb5,_0x18acfc={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1a5549 of _0x5421e4){try{if(_0x1a5549[_0x37ca20(0xf7)]===_0x37ca20(0xa9)&&_0x1a5549[_0x37ca20(0x165)])_0x3298a7['onProgress']?.({'type':_0x37ca20(0x164),'segmentName':_0x3035c9,'activationName':_0x1a5549[_0x37ca20(0xed)]}),await _0x3298a7[_0x37ca20(0xba)]('Creating\x20activation\x20\x27'+_0x1a5549[_0x37ca20(0xed)]+_0x37ca20(0xf0),()=>_0x3db0d3[_0x37ca20(0xaa)]['createActivation'](_0x1fcc6f,_0x193a6b,_0x1a5549[_0x37ca20(0x165)])),_0x3298a7['onProgress']?.({'type':_0x37ca20(0x17f),'segmentName':_0x3035c9,'activationName':_0x1a5549[_0x37ca20(0xed)]}),_0x3298a7[_0x37ca20(0x18e)]?.(_0x37ca20(0xc7)+_0x1a5549[_0x37ca20(0xed)]+'\x27'),_0x18acfc[_0x37ca20(0x126)]++;else{if(_0x1a5549[_0x37ca20(0xf7)]===_0x37ca20(0xc0)&&_0x1a5549['validatedRequest']&&_0x1a5549[_0x37ca20(0x197)])_0x3298a7[_0x37ca20(0x172)]?.({'type':_0x37ca20(0x149),'segmentName':_0x3035c9,'activationName':_0x1a5549[_0x37ca20(0xed)]}),await _0x3298a7[_0x37ca20(0xba)]('Updating\x20activation\x20\x27'+_0x1a5549[_0x37ca20(0xed)]+_0x37ca20(0xf0),()=>_0x3db0d3[_0x37ca20(0xaa)][_0x37ca20(0x16b)](_0x1fcc6f,_0x193a6b,_0x1a5549[_0x37ca20(0x197)]['id'],_0x1a5549['validatedRequest'])),_0x3298a7[_0x37ca20(0x172)]?.({'type':_0x37ca20(0x175),'segmentName':_0x3035c9,'activationName':_0x1a5549[_0x37ca20(0xed)]}),_0x3298a7[_0x37ca20(0x18e)]?.('Updated\x20activation\x20\x27'+_0x1a5549[_0x37ca20(0xed)]+'\x27'),_0x18acfc[_0x37ca20(0xf9)]++;else _0x1a5549[_0x37ca20(0xf7)]===_0x37ca20(0x114)&&_0x1a5549[_0x37ca20(0x197)]&&(_0x3298a7[_0x37ca20(0x172)]?.({'type':_0x37ca20(0xc5),'segmentName':_0x3035c9,'activationName':_0x1a5549[_0x37ca20(0xed)]}),await _0x3298a7['withProgress'](_0x37ca20(0x166)+_0x1a5549['name']+_0x37ca20(0xf0),()=>_0x3db0d3['segment'][_0x37ca20(0x147)](_0x1fcc6f,_0x193a6b,_0x1a5549['existingActivation']['id'])),_0x3298a7[_0x37ca20(0x172)]?.({'type':_0x37ca20(0x12c),'segmentName':_0x3035c9,'activationName':_0x1a5549['name']}),_0x3298a7['logDeleted']?.(_0x37ca20(0x100)+_0x1a5549['name']+'\x27'),_0x18acfc[_0x37ca20(0x141)]++);}}catch(_0x99334c){const _0x22dfec=isHttp400Error(_0x99334c),_0x59a02f=_0x22dfec?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x37ca20(0xf4)],_0x346bd1=getErrorMessage(_0x99334c);throw new SDKError(_0x59a02f,_0x37ca20(0xdc)+_0x1a5549[_0x37ca20(0xf7)]+_0x37ca20(0x154)+_0x1a5549[_0x37ca20(0xed)]+_0x37ca20(0x106)+_0x8e9833+_0x37ca20(0x189)+_0x346bd1,_0x99334c);}}return _0x18acfc;}export async function executePushFolders(_0x404dab,_0x5627fb,_0x53dcfe,_0x4d6d4c,_0x24bf13){const _0x29b362=a142_0x2ccdb5,_0x4d1a32=new Map(_0x53dcfe),_0x2ee878=sortFoldersByDepth(_0x5627fb);for(const _0x1451b3 of _0x2ee878){const _0x4332ac=_0x1451b3[_0x29b362(0xbd)]('/'),_0x2563d3=_0x4332ac[_0x4332ac[_0x29b362(0x19d)]-0x1],_0x5a4caf=_0x4332ac[_0x29b362(0xb7)](0x0,-0x1)[_0x29b362(0xb3)]('/'),_0x40fbac=_0x4d1a32['get'](_0x5a4caf);_0x24bf13['onProgress']?.({'type':_0x29b362(0x10a),'folder':_0x1451b3});const _0x2cbcf9={'name':_0x2563d3,'parentFolderId':_0x40fbac},_0x4eaea1=await _0x24bf13['withProgress']('Creating\x20folder\x20\x27'+_0x1451b3+_0x29b362(0xf0),()=>_0x404dab['segment'][_0x29b362(0x169)](_0x4d6d4c[_0x29b362(0x16f)],_0x2cbcf9));_0x4d1a32[_0x29b362(0xb4)](_0x1451b3,_0x4eaea1[_0x29b362(0xfa)]['id']),_0x24bf13[_0x29b362(0x172)]?.({'type':_0x29b362(0x107),'folder':_0x1451b3,'folderId':_0x4eaea1[_0x29b362(0xfa)]['id']}),_0x24bf13[_0x29b362(0x18a)]?.('Created\x20folder\x20\x27'+_0x1451b3+'\x27');}return _0x4d1a32;}export async function executePushSegmentDeletions(_0x51629f,_0x4273e2,_0x260ca2){const _0xe73fb=a142_0x2ccdb5;if(_0x4273e2[_0xe73fb(0x19d)]===0x0)return 0x0;const {batchAsync:_0x48612d}=await import(_0xe73fb(0x15a)),_0xaad3a0=0x5,_0x1b761f=await _0x48612d(_0x4273e2,async _0x56bfd2=>{const _0x243569=_0xe73fb;return _0x260ca2['onProgress']?.({'type':_0x243569(0x13f),'name':_0x56bfd2[_0x243569(0xed)]}),await _0x51629f[_0x243569(0xaa)][_0x243569(0xf5)](_0x56bfd2['id']),_0x260ca2[_0x243569(0x172)]?.({'type':'segment_deleted','name':_0x56bfd2[_0x243569(0xed)]}),_0x260ca2['logDeleted']?.(_0x243569(0x168)+_0x56bfd2[_0x243569(0xed)]+'\x27'),0x1;},_0xaad3a0);return _0x1b761f[_0xe73fb(0x11b)]((_0x191c42,_0x3bc66b)=>_0x191c42+_0x3bc66b,0x0);}export async function executePushJourneys(_0x134fd0,_0x199273,_0x387204,_0x5ca7f0,_0x3293cc){const _0x59f00d=a142_0x2ccdb5,{journeyDefToRequest:_0x729ea3}=await import(_0x59f00d(0xc9)),{activationDefToCreateRequest:_0x1911bd,yamlRuleToApi:_0x41ab52,validateSegmentRule:_0x4d11d2}=await import(_0x59f00d(0x180)),_0x5d491a={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x9976f=new Map(_0x387204['segmentNameToId']),_0x19d62b=0x5;for(let _0x318d6d=0x0;_0x318d6d<_0x199273[_0x59f00d(0x19d)];_0x318d6d+=_0x19d62b){const _0x250d18=_0x199273[_0x59f00d(0xb7)](_0x318d6d,_0x318d6d+_0x19d62b),_0x1e769f=await Promise['all'](_0x250d18[_0x59f00d(0x122)](async _0x1998df=>{const _0x31cbd7=_0x59f00d;if(!_0x1998df[_0x31cbd7(0xd7)]&&!_0x1998df[_0x31cbd7(0xea)])return{'action':'unchanged','name':_0x1998df[_0x31cbd7(0x11e)][_0x31cbd7(0xed)],'journeyId':_0x1998df[_0x31cbd7(0xcc)]?.['id']};const _0x5b98bf=_0x1998df['folderPath']?_0x387204[_0x31cbd7(0x140)][_0x31cbd7(0x185)](_0x1998df[_0x31cbd7(0x119)]):undefined;_0x3293cc[_0x31cbd7(0x172)]?.({'type':_0x1998df[_0x31cbd7(0xd7)]?_0x31cbd7(0x13c):_0x31cbd7(0xb9),'name':_0x1998df[_0x31cbd7(0x11e)][_0x31cbd7(0xed)]});try{const _0x2ea198=await executeSingleJourneyPush(_0x134fd0,_0x1998df,{..._0x387204,'segmentNameToId':_0x9976f},{'parentId':_0x5ca7f0[_0x31cbd7(0x16f)],'rootFolderId':_0x5ca7f0[_0x31cbd7(0xf1)],'folderId':_0x5b98bf,'verbose':_0x5ca7f0['verbose']},_0x3293cc,{'journeyDefToRequest':_0x729ea3,'activationDefToCreateRequest':_0x1911bd,'yamlRuleToApi':_0x41ab52,'validateSegmentRule':_0x4d11d2});for(const [_0x33bda7,_0x12d4f4]of _0x2ea198[_0x31cbd7(0x10e)]){_0x9976f['set'](_0x33bda7,_0x12d4f4),_0x5d491a[_0x31cbd7(0x10e)][_0x31cbd7(0xb4)](_0x33bda7,_0x12d4f4);}if(_0x2ea198[_0x31cbd7(0x182)]===_0x31cbd7(0x126))_0x3293cc[_0x31cbd7(0x172)]?.({'type':_0x31cbd7(0x12b),'name':_0x1998df[_0x31cbd7(0x11e)]['name'],'journeyId':_0x2ea198[_0x31cbd7(0xe8)]}),_0x3293cc['logSuccess']?.(_0x31cbd7(0x191)+_0x1998df[_0x31cbd7(0x11e)][_0x31cbd7(0xed)]+'\x27'),_0x5d491a[_0x31cbd7(0x126)]++;else _0x2ea198['action']===_0x31cbd7(0xf9)&&(_0x3293cc['onProgress']?.({'type':'journey_updated','name':_0x1998df[_0x31cbd7(0x11e)]['name']}),_0x3293cc[_0x31cbd7(0x18e)]?.(_0x31cbd7(0x12e)+_0x1998df[_0x31cbd7(0x11e)][_0x31cbd7(0xed)]+'\x27'),_0x5d491a[_0x31cbd7(0xf9)]++);return{'action':_0x2ea198[_0x31cbd7(0x182)],'name':_0x1998df[_0x31cbd7(0x11e)][_0x31cbd7(0xed)],'journeyId':_0x2ea198[_0x31cbd7(0xe8)]};}catch(_0xf6b755){const _0x41bf1e=isHttp400Error(_0xf6b755),_0x408776=_0x41bf1e?ErrorCode[_0x31cbd7(0x15c)]:ErrorCode[_0x31cbd7(0x129)],_0xcac4b9=getErrorMessage(_0xf6b755);throw new SDKError(_0x408776,'Failed\x20to\x20'+(_0x1998df[_0x31cbd7(0xd7)]?'create':_0x31cbd7(0xc0))+_0x31cbd7(0xd1)+_0x1998df[_0x31cbd7(0x14b)]+_0x31cbd7(0x189)+_0xcac4b9,_0xf6b755);}}));_0x5d491a[_0x59f00d(0x18f)][_0x59f00d(0x14a)](..._0x1e769f);}return _0x5d491a;}async function matchExistingJourneySegments(_0xaed2fc,_0x15130a,_0x35c169,_0x581944,_0x4f7e09){const _0x3b0998=a142_0x2ccdb5;if(!_0x15130a[_0x3b0998(0xcc)]||!_0x15130a[_0x3b0998(0x11e)][_0x3b0998(0xde)])return;const _0x59b6e5=new Map(),_0x4931cd=new Set();for(const _0x771887 of Object[_0x3b0998(0x127)](_0x15130a[_0x3b0998(0x11e)]['segments'])){const _0x28c430=generateDeterministicJourneySegmentName(_0x15130a['yamlConfig']['name'],_0x771887);_0x59b6e5[_0x3b0998(0xb4)](_0x28c430,_0x771887),_0x4931cd['add'](_0x771887);}const _0x963894=[],_0x217b33=collectSegmentIdsFromJourneyApi(_0x15130a[_0x3b0998(0xcc)]);for(const _0x20cac9 of _0x217b33){const _0x24e4b4=await fetchSegment(_0xaed2fc,_0x35c169,_0x20cac9,_0x581944);if(!_0x24e4b4?.['name'])continue;const _0x514730=_0x59b6e5[_0x3b0998(0x185)](_0x24e4b4[_0x3b0998(0xed)]);_0x514730?(_0x4f7e09['set'](_0x514730,_0x20cac9),_0x4931cd[_0x3b0998(0x114)](_0x514730)):_0x963894['push']({'id':_0x20cac9,'seg':_0x24e4b4});}if(_0x4931cd[_0x3b0998(0xd9)]>0x0&&_0x963894[_0x3b0998(0x19d)]>0x0){const {localExpandedRuleToNames:_0x17daeb}=buildLocalExpandedRuleMappings(_0x15130a[_0x3b0998(0x11e)]),_0x50beff=new Map();for(const {id:_0x556b56,seg:_0x14fbd4}of _0x963894){if(_0x14fbd4[_0x3b0998(0x193)]){const _0x1e75d5=apiRuleToYaml(_0x14fbd4[_0x3b0998(0x193)]);_0x50beff[_0x3b0998(0xb4)](_0x556b56,_0x1e75d5);}}for(const {id:_0x3a5e47,seg:_0x7ac8de}of _0x963894){if(!_0x7ac8de['rule'])continue;const _0x14c93c=_0x50beff[_0x3b0998(0x185)](_0x3a5e47);if(!_0x14c93c)continue;const _0x238b2b=serializeExpandedRule(_0x14c93c,_0x50beff),_0x4a2bfa=_0x17daeb[_0x3b0998(0x185)](_0x238b2b);if(_0x4a2bfa){const _0x17fc1f=_0x4a2bfa[_0x3b0998(0x17d)](_0x3c171e=>_0x4931cd[_0x3b0998(0x105)](_0x3c171e));_0x17fc1f&&(_0x4f7e09[_0x3b0998(0xb4)](_0x17fc1f,_0x3a5e47),_0x4931cd[_0x3b0998(0x114)](_0x17fc1f),logger[_0x3b0998(0xe3)]('Matched\x20server\x20segment\x20\x27'+_0x7ac8de[_0x3b0998(0xed)]+_0x3b0998(0xe6)+_0x17fc1f+_0x3b0998(0xe0)));}}}}async function executeSingleJourneyPush(_0x1ce689,_0x326089,_0x4eea23,_0x19e553,_0xe133b9,_0x19ff29){const _0x2372da=a142_0x2ccdb5,{journeyDefToRequest:_0xef77c4,activationDefToCreateRequest:_0x138dc4,yamlRuleToApi:_0x48f44d,validateSegmentRule:_0x560d40}=_0x19ff29,_0x35a7e9=new Map(),_0x33cff4=new Map();recoverSegmentIdsFromPushRecovery(_0x326089,_0x35a7e9,_0x4eea23[_0x2372da(0x104)]);const _0x42fcaf=new Map(),_0x264490=new Map(),_0x57e62f=new Map();let _0x38ec5b;const _0x5a6b6e=async()=>{const _0x52e56b=_0x2372da;if(_0x38ec5b)return;_0x38ec5b=new Map();if(!_0x326089[_0x52e56b(0xcc)])return;const _0x6ba8ba=await _0x1ce689[_0x52e56b(0x188)][_0x52e56b(0x173)](_0x326089[_0x52e56b(0xcc)]['id']);for(const _0x2f58a7 of _0x6ba8ba){const _0xa7c322=journeyActivationStepToYaml(_0x2f58a7,_0x4eea23[_0x52e56b(0x192)],_0x4eea23['connectionIdToNameMap']),_0x36764a=activationSignature(_0xa7c322);!_0x38ec5b[_0x52e56b(0x105)](_0x36764a)&&_0x38ec5b['set'](_0x36764a,_0x2f58a7['id']),_0xa7c322[_0x52e56b(0xed)]&&_0x33cff4[_0x52e56b(0xb4)](_0xa7c322[_0x52e56b(0xed)],_0x2f58a7['id']);}};await matchExistingJourneySegments(_0x1ce689,_0x326089,_0x19e553[_0x2372da(0x16f)],_0x4eea23['existingSegments'],_0x4eea23[_0x2372da(0x104)]);const _0x3c30ff={'resolveSegmentId':async _0x326e2b=>{const _0x5a2f4f=_0x2372da,_0x455286=_0x4eea23[_0x5a2f4f(0x104)]['get'](_0x326e2b);if(!_0x455286)throw new SDKError(ErrorCode[_0x5a2f4f(0x155)],_0x5a2f4f(0xd3)+_0x326e2b+'\x20(referenced\x20in\x20journey\x20'+_0x326089['yamlConfig'][_0x5a2f4f(0xed)]+')');return _0x455286;},'resolveEmbeddedSegmentId':async(_0x14f5a1,_0x5e1df3)=>{const _0x280260=_0x2372da,_0x1185ba=_0x4eea23[_0x280260(0x104)][_0x280260(0x185)](_0x14f5a1);if(_0x1185ba)return _0x1185ba;const _0x1e469a=_0x4eea23['existingSegments']['find'](_0x13b423=>_0x13b423[_0x280260(0xed)]===_0x14f5a1);if(_0x1e469a)return _0x4eea23[_0x280260(0x104)][_0x280260(0xb4)](_0x14f5a1,_0x1e469a['id']),_0x1e469a['id'];if(_0x326089[_0x280260(0xd7)]){const {stageName:_0x1f2339,criteriaName:_0x2a1522}=findSegmentCriteriaLocation(_0x326089['yamlConfig'],_0x14f5a1);return _0x560d40(_0x14f5a1,_0x5e1df3['rule']),_0x264490[_0x280260(0xb4)](_0x14f5a1,{'definition':_0x5e1df3,'stageName':_0x1f2339,'criteriaName':_0x2a1522}),createPendingSegmentId(_0x14f5a1);}const _0x2cb827=_0x326089[_0x280260(0xcc)]?.['id'];if(!_0x2cb827)throw new SDKError(ErrorCode[_0x280260(0xfc)],_0x280260(0xd8));const _0x6b98ae=_0x42fcaf['get'](_0x14f5a1);if(_0x6b98ae)return _0x6b98ae;const _0x1f3960=((async()=>{const _0x4eef2f=_0x280260;_0x560d40(_0x14f5a1,_0x5e1df3[_0x4eef2f(0x193)]);const _0x4c4920=generateDeterministicJourneySegmentName(_0x326089[_0x4eef2f(0x11e)]['name'],_0x14f5a1),_0x124cab=_0x4eea23[_0x4eef2f(0x135)][_0x4eef2f(0x17d)](_0x37c601=>_0x37c601[_0x4eef2f(0xed)]===_0x4c4920),_0x4c5609=createSegmentIdResolver(_0x4eea23['segmentNameToId'],_0x14f5a1),_0x218152=await resolveRuleSegmentIds(_0x5e1df3[_0x4eef2f(0x193)],_0x4c5609);let _0x5875de;return _0x124cab?(await _0x1ce689['segment'][_0x4eef2f(0x117)](_0x19e553[_0x4eef2f(0x16f)],_0x124cab['id'],{'description':_0x5e1df3['description']||_0x4eef2f(0x11c)+_0x14f5a1,'rule':_0x48f44d(_0x218152,!![]),'countPopulation':!![]}),_0x5875de=_0x124cab['id'],saveSegmentToPushRecovery(_0x326089[_0x4eef2f(0x14b)],_0x326089[_0x4eef2f(0x11e)]['name'],_0x14f5a1,{'segmentId':_0x5875de,'uniqueServerName':_0x4c4920,'createdAt':new Date()['toISOString']()})):_0x5875de=await createOrRecoverEmbeddedSegment(_0x1ce689,_0x326089,{'localName':_0x14f5a1,'uniqueSegmentName':_0x4c4920,'description':_0x5e1df3[_0x4eef2f(0x10d)]||_0x4eef2f(0x11c)+_0x14f5a1,'journeyId':_0x2cb827,'resolvedRule':_0x218152,'parentId':_0x19e553[_0x4eef2f(0x16f)],'folderId':_0x19e553[_0x4eef2f(0xf1)]||''},_0x48f44d),_0x4eea23[_0x4eef2f(0x104)][_0x4eef2f(0xb4)](_0x14f5a1,_0x5875de),_0x35a7e9['set'](_0x14f5a1,_0x5875de),_0x5875de;})());_0x42fcaf[_0x280260(0xb4)](_0x14f5a1,_0x1f3960);try{return await _0x1f3960;}finally{_0x42fcaf[_0x280260(0x114)](_0x14f5a1);}},'resolveActivationId':async _0x17ef5b=>{const _0x228715=_0x2372da,_0x554cfc=_0x33cff4[_0x228715(0x185)](_0x17ef5b);if(_0x554cfc)return _0x554cfc;if(_0x326089[_0x228715(0xcc)]){await _0x5a6b6e();const _0x38ea2b=_0x33cff4[_0x228715(0x185)](_0x17ef5b);if(_0x38ea2b)return _0x38ea2b;}throw new SDKError(ErrorCode[_0x228715(0xb2)],_0x228715(0x101)+_0x17ef5b+'\x20(referenced\x20in\x20journey\x20'+_0x326089[_0x228715(0x11e)][_0x228715(0xed)]+_0x228715(0x16c)+_0x228715(0x12d));},'resolveEmbeddedActivationId':async(_0x292818,_0x2cdaa5)=>{const _0x1a83a1=_0x2372da,_0x1487df=_0x33cff4[_0x1a83a1(0x185)](_0x292818);if(_0x1487df)return _0x1487df;if(_0x326089[_0x1a83a1(0xd7)])return _0x57e62f[_0x1a83a1(0xb4)](_0x292818,_0x2cdaa5),createPendingActivationId(_0x292818);if(_0x326089[_0x1a83a1(0xcc)]){await _0x5a6b6e();const _0x464984=_0x33cff4[_0x1a83a1(0x185)](_0x2cdaa5[_0x1a83a1(0xed)]);if(_0x464984)return _0x33cff4['set'](_0x292818,_0x464984),_0x464984;const _0x134bdd=activationSignature(_0x2cdaa5),_0x31fa6f=_0x38ec5b?.[_0x1a83a1(0x185)](_0x134bdd);if(_0x31fa6f)return _0x33cff4[_0x1a83a1(0xb4)](_0x292818,_0x31fa6f),_0x31fa6f;const _0x39336b=await _0x138dc4(_0x2cdaa5,_0x4eea23[_0x1a83a1(0x10f)]),_0x24276d={..._0x39336b,..._0x2cdaa5['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x2cdaa5[_0x1a83a1(0xe2)]}},_0x202913=await _0x1ce689[_0x1a83a1(0x188)][_0x1a83a1(0x152)](_0x326089[_0x1a83a1(0xcc)]['id'],_0x24276d);return _0x33cff4[_0x1a83a1(0xb4)](_0x292818,_0x202913['id']),_0x202913['id'];}throw new SDKError(ErrorCode[_0x1a83a1(0xfc)],_0x1a83a1(0x12f));},'resolveJourneyId':async _0x50d8aa=>{const _0x19e3b2=_0x2372da;try{return await _0x1ce689[_0x19e3b2(0x188)][_0x19e3b2(0x148)](_0x19e553[_0x19e3b2(0x16f)],_0x50d8aa);}catch(_0x5bfab1){throw new SDKError(ErrorCode['NOT_FOUND'],_0x19e3b2(0xb5)+_0x50d8aa+_0x19e3b2(0x139)+_0x326089[_0x19e3b2(0x11e)][_0x19e3b2(0xed)]+'\x27)',_0x5bfab1);}},'resolveStageId':async(_0x95b9cc,_0x4c9892)=>{const _0x3d5344=_0x2372da,_0x2b4112=await _0x1ce689[_0x3d5344(0x188)][_0x3d5344(0xec)](_0x95b9cc),_0x5adc0e=_0x2b4112[_0x3d5344(0x13b)][_0x3d5344(0x132)]['find'](_0x23b177=>_0x23b177[_0x3d5344(0xed)][_0x3d5344(0xab)]()===_0x4c9892[_0x3d5344(0xab)]());if(!_0x5adc0e?.['id'])throw new SDKError(ErrorCode[_0x3d5344(0xb2)],_0x3d5344(0xa1)+_0x4c9892+_0x3d5344(0xc6)+(_0x2b4112['attributes']['journeyBundleName']||_0x2b4112[_0x3d5344(0x13b)][_0x3d5344(0xed)])+'\x27');return _0x5adc0e['id'];}},_0x3b0d9a=await _0xef77c4(_0x326089[_0x2372da(0x11e)],_0x19e553[_0x2372da(0x16f)],_0x3c30ff),_0x13f0d5=_0x19e553[_0x2372da(0xa6)]||_0x19e553[_0x2372da(0xf1)];_0x13f0d5&&(_0x3b0d9a[_0x2372da(0x198)]={'parentFolder':{'data':{'id':_0x13f0d5,'type':_0x2372da(0xd2)}}});if(_0x326089[_0x2372da(0xd7)]){if(_0x264490['size']>0x0||_0x57e62f[_0x2372da(0xd9)]>0x0)return await executeThreeStepJourneyCreate(_0x1ce689,_0x326089,_0x3b0d9a,{'pendingEmbeddedSegments':_0x264490,'pendingEmbeddedActivations':_0x57e62f,'embeddedSegmentNameToId':_0x35a7e9,'journeyActivationNameToId':_0x33cff4},{..._0x19e553,'effectiveFolderId':_0x13f0d5},_0x4eea23,_0xe133b9,_0x19ff29);else{ensureJourneyDefaults(_0x3b0d9a['attributes']);const _0x57d860=await _0x1ce689[_0x2372da(0x188)][_0x2372da(0xa9)](_0x3b0d9a);return deletePushRecovery(_0x326089['absolutePath']),{'action':_0x2372da(0x126),'journeyId':_0x57d860['id'],'embeddedSegmentNameToId':_0x35a7e9};}}else{if(_0x326089[_0x2372da(0xea)]&&_0x326089['existingJourney']){_0x3b0d9a['id']=_0x326089['existingJourney']['id'];const _0x4abc6c=_0x3b0d9a['attributes'];_0x326089[_0x2372da(0xcc)]['attributes']?.['journeyBundleName']&&(_0x4abc6c[_0x2372da(0xf2)]=_0x326089[_0x2372da(0xcc)][_0x2372da(0x13b)][_0x2372da(0xf2)]);const _0x7f215c=_0x326089[_0x2372da(0xcc)][_0x2372da(0x13b)]?.[_0x2372da(0x132)];return _0x7f215c&&_0x3b0d9a[_0x2372da(0x13b)][_0x2372da(0x132)]&&injectExistingStageIds(_0x3b0d9a[_0x2372da(0x13b)][_0x2372da(0x132)],_0x7f215c),ensureJourneyDefaults(_0x4abc6c),await _0x1ce689['journey'][_0x2372da(0xc0)](_0x326089[_0x2372da(0xcc)]['id'],_0x3b0d9a),deletePushRecovery(_0x326089['absolutePath']),{'action':_0x2372da(0xf9),'journeyId':_0x326089[_0x2372da(0xcc)]['id'],'embeddedSegmentNameToId':_0x35a7e9};}}return deletePushRecovery(_0x326089[_0x2372da(0x14b)]),{'action':'unchanged','journeyId':_0x326089[_0x2372da(0xcc)]?.['id'],'embeddedSegmentNameToId':_0x35a7e9};}function findSegmentCriteriaLocation(_0x447467,_0x4e295f){const _0x44418b=a142_0x2ccdb5,_0x186a9b=_0x447467[_0x44418b(0x184)]||_0x447467[_0x44418b(0xee)]?.[0x0]?.[_0x44418b(0x184)]||[];let _0x4ecb01=_0x44418b(0x9e),_0x41aded=_0x4e295f;const _0x54a02b=_0x447467[_0x44418b(0xd6)]||_0x447467[_0x44418b(0xee)]?.[0x0]?.[_0x44418b(0xd6)];if(_0x54a02b?.[_0x44418b(0xaa)]===_0x4e295f)return{'stageName':_0x44418b(0xd6),'criteriaName':_0x54a02b['name']||_0x4e295f};_0x398421:for(const _0x36234b of _0x186a9b){if(_0x36234b[_0x44418b(0x116)]?.[_0x44418b(0xaa)]===_0x4e295f){_0x4ecb01=_0x36234b['name'],_0x41aded=_0x36234b[_0x44418b(0x116)][_0x44418b(0xed)]||_0x4e295f;break;}if(_0x36234b[_0x44418b(0xa5)])for(const _0x2b3eab of _0x36234b[_0x44418b(0xa5)]){if(_0x2b3eab[_0x44418b(0xf7)]===_0x44418b(0x10c)&&_0x2b3eab[_0x44418b(0xad)]?.['branches'])for(const _0x3f4d82 of _0x2b3eab[_0x44418b(0xad)][_0x44418b(0x136)]){if(_0x3f4d82[_0x44418b(0xaa)]===_0x4e295f){_0x4ecb01=_0x36234b[_0x44418b(0xed)],_0x41aded=_0x3f4d82[_0x44418b(0xed)]||_0x4e295f;break _0x398421;}}}}return{'stageName':_0x4ecb01,'criteriaName':_0x41aded};}async function executeThreeStepJourneyCreate(_0x10ab3f,_0x3fa907,_0x2b370e,_0x396acf,_0x36cdfe,_0xef70ed,_0x4fc2ab,_0x1f4eca){const _0x59c201=a142_0x2ccdb5,{activationDefToCreateRequest:_0x2e217a,yamlRuleToApi:_0xf06245}=_0x1f4eca,{pendingEmbeddedSegments:_0x381521,pendingEmbeddedActivations:_0x5831c9,embeddedSegmentNameToId:_0x35ad48}=_0x396acf,_0x373ef3=JSON[_0x59c201(0xe4)](JSON[_0x59c201(0x162)](_0x2b370e));ensureJourneyDefaults(_0x373ef3['attributes']),stripPendingIds(_0x373ef3);const _0x1f552f=await _0x10ab3f[_0x59c201(0x188)]['create'](_0x373ef3),_0x21f2d0=_0x1f552f['id'],_0x51a4e8=new Map();for(const _0x2c1451 of _0x1f552f[_0x59c201(0x13b)]['journeyStages']){_0x51a4e8[_0x59c201(0xb4)](_0x2c1451[_0x59c201(0xed)][_0x59c201(0xab)](),_0x2c1451['id']);}recoverSegmentIdsFromPushRecovery(_0x3fa907,_0x35ad48,_0xef70ed['segmentNameToId']);for(const [_0x1a51c3,{definition:_0x230156}]of _0x381521){if(_0x35ad48[_0x59c201(0x105)](_0x1a51c3)){_0x4fc2ab[_0x59c201(0x172)]?.({'type':'embedded_segment_created','journeyName':_0x3fa907[_0x59c201(0x11e)][_0x59c201(0xed)],'segmentName':_0x1a51c3});continue;}const _0x34f34f=generateDeterministicJourneySegmentName(_0x3fa907[_0x59c201(0x11e)][_0x59c201(0xed)],_0x1a51c3);_0x4fc2ab[_0x59c201(0x172)]?.({'type':'embedded_segment_creating','journeyName':_0x3fa907[_0x59c201(0x11e)][_0x59c201(0xed)],'segmentName':_0x1a51c3});const _0x51a5e1=createSegmentIdResolver(_0xef70ed[_0x59c201(0x104)],_0x1a51c3),_0x3fa508=await resolveRuleSegmentIds(_0x230156['rule'],_0x51a5e1),_0x3674a3=await createOrRecoverEmbeddedSegment(_0x10ab3f,_0x3fa907,{'localName':_0x1a51c3,'uniqueSegmentName':_0x34f34f,'description':_0x230156[_0x59c201(0x10d)]||_0x59c201(0x11c)+_0x1a51c3,'journeyId':_0x21f2d0,'resolvedRule':_0x3fa508,'parentId':_0x36cdfe[_0x59c201(0x16f)],'folderId':_0x36cdfe['effectiveFolderId']||''},_0xf06245);_0x35ad48[_0x59c201(0xb4)](_0x1a51c3,_0x3674a3),_0xef70ed[_0x59c201(0x104)][_0x59c201(0xb4)](_0x1a51c3,_0x3674a3),_0x4fc2ab[_0x59c201(0x172)]?.({'type':_0x59c201(0x19c),'journeyName':_0x3fa907[_0x59c201(0x11e)][_0x59c201(0xed)],'segmentName':_0x1a51c3});}const _0x3e5fda=new Map();for(const [_0xdd4d89,_0x4d1603]of _0x5831c9){_0x4fc2ab['onProgress']?.({'type':_0x59c201(0xb1),'journeyName':_0x3fa907[_0x59c201(0x11e)][_0x59c201(0xed)],'activationName':_0xdd4d89});const _0x4a032e=await _0x2e217a(_0x4d1603,_0xef70ed[_0x59c201(0x10f)]),_0x41fcb4={..._0x4a032e,..._0x4d1603['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x4d1603[_0x59c201(0xe2)]}},_0x1f248c=await _0x10ab3f['journey'][_0x59c201(0x152)](_0x21f2d0,_0x41fcb4);_0x3e5fda[_0x59c201(0xb4)](_0xdd4d89,_0x1f248c['id']),_0x396acf[_0x59c201(0xf8)][_0x59c201(0xb4)](_0xdd4d89,_0x1f248c['id']),_0x4fc2ab['onProgress']?.({'type':_0x59c201(0xef),'journeyName':_0x3fa907[_0x59c201(0x11e)]['name'],'activationName':_0xdd4d89});}const _0x3a299e=JSON[_0x59c201(0xe4)](JSON[_0x59c201(0x162)](_0x2b370e));return _0x3a299e['id']=_0x21f2d0,ensureJourneyDefaults(_0x3a299e[_0x59c201(0x13b)]),resolvePendingIdsInRequest(_0x3a299e,_0x2b370e,_0x51a4e8,_0x35ad48,_0x3e5fda,_0x4fc2ab),await _0x10ab3f[_0x59c201(0x188)][_0x59c201(0xc0)](_0x21f2d0,_0x3a299e),deletePushRecovery(_0x3fa907[_0x59c201(0x14b)]),{'action':_0x59c201(0x126),'journeyId':_0x21f2d0,'embeddedSegmentNameToId':_0x35ad48};}export function stripWaitStepPendingIds(_0x1a7d0c){const _0x2bbbfe=a142_0x2ccdb5,_0x144541=_0x1a7d0c[_0x2bbbfe(0x158)]&&isPendingSegmentId(_0x1a7d0c[_0x2bbbfe(0x158)]),_0x2d2854=_0x1a7d0c[_0x2bbbfe(0xf6)]?.[_0x2bbbfe(0x11a)](_0x293a1c=>_0x293a1c[_0x2bbbfe(0x112)]&&isPendingSegmentId(_0x293a1c[_0x2bbbfe(0x112)]));(_0x144541||_0x2d2854)&&(_0x1a7d0c[_0x2bbbfe(0xa0)]=_0x2bbbfe(0x170),_0x1a7d0c[_0x2bbbfe(0xc8)]=0x1,_0x1a7d0c['waitStepUnit']='day',delete _0x1a7d0c[_0x2bbbfe(0x158)],delete _0x1a7d0c[_0x2bbbfe(0xce)],delete _0x1a7d0c[_0x2bbbfe(0xa7)],delete _0x1a7d0c['conditions']);}export function resolveWaitStepPendingIds(_0xc7b3b7,_0xdae6dd,_0x132656,_0x17fe9a){const _0x217f48=a142_0x2ccdb5;if(_0xdae6dd['conditionSegmentId']&&isPendingSegmentId(_0xdae6dd[_0x217f48(0x158)])){const _0x52e870=_0x132656(_0xdae6dd[_0x217f48(0x158)],_0x217f48(0x196)+_0x17fe9a+_0x217f48(0xa4));_0x52e870&&(_0xc7b3b7[_0x217f48(0xa0)]=_0x217f48(0x137),_0xc7b3b7[_0x217f48(0x158)]=_0x52e870,delete _0xc7b3b7[_0x217f48(0xc8)],delete _0xc7b3b7['waitStepUnit'],_0xdae6dd['conditionTimeoutDuration']!==undefined&&(_0xc7b3b7[_0x217f48(0xce)]=_0xdae6dd[_0x217f48(0xce)]),_0xdae6dd[_0x217f48(0xa7)]&&(_0xc7b3b7[_0x217f48(0xa7)]=_0xdae6dd['conditionTimeoutUnit']));}if(_0xdae6dd[_0x217f48(0xf6)]){const _0x28136c=_0xdae6dd[_0x217f48(0xf6)][_0x217f48(0x11a)](_0x4921fd=>_0x4921fd[_0x217f48(0x112)]&&isPendingSegmentId(_0x4921fd[_0x217f48(0x112)]));if(_0x28136c){const _0x50e5b0=_0xdae6dd['conditions'][_0x217f48(0x122)](_0x3bf19e=>{const _0x2ae8a9=_0x217f48;if(_0x3bf19e[_0x2ae8a9(0x112)]&&isPendingSegmentId(_0x3bf19e['segmentId'])){const _0x2c6416=_0x132656(_0x3bf19e[_0x2ae8a9(0x112)],_0x2ae8a9(0x196)+_0x17fe9a+_0x2ae8a9(0xa4));return{..._0x3bf19e,'segmentId':_0x2c6416||_0x3bf19e[_0x2ae8a9(0x112)]};}return{..._0x3bf19e};});_0xc7b3b7['waitStepType']=_0x217f48(0x137),_0xc7b3b7[_0x217f48(0xf6)]=_0x50e5b0,delete _0xc7b3b7['waitStep'],delete _0xc7b3b7[_0x217f48(0xe7)],delete _0xc7b3b7[_0x217f48(0x158)],delete _0xc7b3b7[_0x217f48(0xce)],delete _0xc7b3b7[_0x217f48(0xa7)];}}}function stripPendingIds(_0x20d3e8){const _0x1aec7a=a142_0x2ccdb5;_0x20d3e8[_0x1aec7a(0x13b)][_0x1aec7a(0xd6)]?.[_0x1aec7a(0x112)]&&isPendingSegmentId(_0x20d3e8[_0x1aec7a(0x13b)][_0x1aec7a(0xd6)][_0x1aec7a(0x112)])&&delete _0x20d3e8[_0x1aec7a(0x13b)]['goal'];for(const _0x49ec9a of _0x20d3e8[_0x1aec7a(0x13b)][_0x1aec7a(0x132)]||[]){_0x49ec9a[_0x1aec7a(0x171)]?.[_0x1aec7a(0x112)]&&isPendingSegmentId(_0x49ec9a['entryCriteria'][_0x1aec7a(0x112)])&&delete _0x49ec9a[_0x1aec7a(0x171)];_0x49ec9a[_0x1aec7a(0x150)]?.[_0x1aec7a(0x112)]&&isPendingSegmentId(_0x49ec9a[_0x1aec7a(0x150)]['segmentId'])&&delete _0x49ec9a['milestone'];_0x49ec9a['exitCriterias']&&(_0x49ec9a[_0x1aec7a(0x14d)]=_0x49ec9a['exitCriterias'][_0x1aec7a(0x108)](_0x2128cc=>!_0x2128cc[_0x1aec7a(0x112)]||!isPendingSegmentId(_0x2128cc[_0x1aec7a(0x112)])));if(_0x49ec9a['steps'])for(const _0xfe088 of Object[_0x1aec7a(0x127)](_0x49ec9a['steps'])){const _0x519e22=_0x49ec9a[_0x1aec7a(0xa5)][_0xfe088];_0x519e22['type']===_0x1aec7a(0x13a)&&_0x519e22[_0x1aec7a(0xdf)]&&isPendingActivationId(_0x519e22[_0x1aec7a(0xdf)])&&(_0x519e22['journeyActivationStepId']='');if(_0x519e22[_0x1aec7a(0xf7)]===_0x1aec7a(0xc3)&&_0x519e22['branches'])for(const _0x4f737d of _0x519e22[_0x1aec7a(0x136)]){_0x4f737d[_0x1aec7a(0x112)]&&isPendingSegmentId(_0x4f737d[_0x1aec7a(0x112)])&&(_0x4f737d[_0x1aec7a(0x112)]='');}_0x519e22['type']===_0x1aec7a(0xb8)&&stripWaitStepPendingIds(_0x519e22);}}}function resolvePendingIdsInRequest(_0x5bf2c,_0x5d38f9,_0x2703a7,_0x5503f8,_0x23c4dc,_0x41357c){const _0x55cba9=a142_0x2ccdb5,_0x32f201=(_0x4adcdc,_0x4e3fc9)=>{const _0x3fbe59=a142_0x48cb;if(!isPendingSegmentId(_0x4adcdc))return _0x4adcdc;const _0x339f6e=extractPendingSegmentName(_0x4adcdc),_0x407488=_0x5503f8[_0x3fbe59(0x185)](_0x339f6e);return!_0x407488&&_0x41357c[_0x3fbe59(0x16e)]?.(_0x3fbe59(0x195)+_0x339f6e+'\x27\x20for\x20'+_0x4e3fc9),_0x407488;};if(_0x5bf2c['attributes']['goal']?.[_0x55cba9(0x112)]&&isPendingSegmentId(_0x5bf2c[_0x55cba9(0x13b)][_0x55cba9(0xd6)][_0x55cba9(0x112)])){const _0x2d4473=_0x32f201(_0x5bf2c[_0x55cba9(0x13b)][_0x55cba9(0xd6)]['segmentId'],_0x55cba9(0x120));_0x2d4473&&(_0x5bf2c['attributes'][_0x55cba9(0xd6)][_0x55cba9(0x112)]=_0x2d4473);}for(const _0x4277df of _0x5bf2c[_0x55cba9(0x13b)]['journeyStages']||[]){const _0x18817b=_0x2703a7['get'](_0x4277df[_0x55cba9(0xed)]['toLowerCase']());_0x18817b&&(_0x4277df['id']=_0x18817b);if(_0x4277df[_0x55cba9(0x171)]?.[_0x55cba9(0x112)]&&isPendingSegmentId(_0x4277df[_0x55cba9(0x171)]['segmentId'])){const _0x2ca077=_0x32f201(_0x4277df[_0x55cba9(0x171)][_0x55cba9(0x112)],_0x55cba9(0x196)+_0x4277df[_0x55cba9(0xed)]+_0x55cba9(0x9f));_0x2ca077&&(_0x4277df[_0x55cba9(0x171)]['segmentId']=_0x2ca077);}if(_0x4277df['exitCriterias'])for(const _0x3a3eff of _0x4277df[_0x55cba9(0x14d)]){if(_0x3a3eff[_0x55cba9(0x112)]&&isPendingSegmentId(_0x3a3eff[_0x55cba9(0x112)])){const _0x213969=_0x32f201(_0x3a3eff[_0x55cba9(0x112)],_0x55cba9(0x196)+_0x4277df[_0x55cba9(0xed)]+_0x55cba9(0x142));_0x213969&&(_0x3a3eff[_0x55cba9(0x112)]=_0x213969);}}if(_0x4277df[_0x55cba9(0x150)]?.[_0x55cba9(0x112)]&&isPendingSegmentId(_0x4277df['milestone']['segmentId'])){const _0x45f459=_0x32f201(_0x4277df['milestone'][_0x55cba9(0x112)],_0x55cba9(0x196)+_0x4277df['name']+_0x55cba9(0x14c));_0x45f459&&(_0x4277df[_0x55cba9(0x150)][_0x55cba9(0x112)]=_0x45f459);}if(_0x4277df[_0x55cba9(0xa5)]){const _0x19bb5a=_0x155fe9=>_0x5d38f9['attributes'][_0x55cba9(0x132)]?.['find'](_0x391d2d=>_0x391d2d[_0x55cba9(0xed)][_0x55cba9(0xab)]()===_0x4277df[_0x55cba9(0xed)]['toLowerCase']())?.['steps']?.[_0x155fe9];for(const _0x2cee54 of Object['keys'](_0x4277df['steps'])){const _0x1b62fa=_0x4277df[_0x55cba9(0xa5)][_0x2cee54],_0xec6453=_0x19bb5a(_0x2cee54);if(_0x1b62fa[_0x55cba9(0xf7)]===_0x55cba9(0x13a)&&_0x1b62fa[_0x55cba9(0xdf)]&&(isPendingActivationId(_0x1b62fa[_0x55cba9(0xdf)])||_0x1b62fa[_0x55cba9(0xdf)]==='')){if(_0xec6453?.['journeyActivationStepId']&&isPendingActivationId(_0xec6453[_0x55cba9(0xdf)])){const _0x26e0bc=extractPendingActivationName(_0xec6453[_0x55cba9(0xdf)]),_0x58fb60=_0x23c4dc[_0x55cba9(0x185)](_0x26e0bc);_0x58fb60&&(_0x1b62fa[_0x55cba9(0xdf)]=_0x58fb60);}}if(_0x1b62fa[_0x55cba9(0xf7)]===_0x55cba9(0xc3)&&_0x1b62fa[_0x55cba9(0x136)]&&_0xec6453?.[_0x55cba9(0x136)])for(let _0x371b32=0x0;_0x371b32<_0x1b62fa[_0x55cba9(0x136)][_0x55cba9(0x19d)];_0x371b32++){const _0x5409aa=_0x1b62fa[_0x55cba9(0x136)][_0x371b32],_0x119765=_0xec6453[_0x55cba9(0x136)][_0x371b32];if(_0x119765?.[_0x55cba9(0x112)]&&isPendingSegmentId(_0x119765['segmentId'])){const _0x258a23=_0x32f201(_0x119765[_0x55cba9(0x112)],'stage\x20\x27'+_0x4277df[_0x55cba9(0xed)]+_0x55cba9(0x130)+(_0x5409aa['name']||_0x371b32)+'\x27');_0x258a23&&(_0x5409aa[_0x55cba9(0x112)]=_0x258a23);}}_0x1b62fa[_0x55cba9(0xf7)]===_0x55cba9(0xb8)&&_0xec6453?.[_0x55cba9(0xf7)]===_0x55cba9(0xb8)&&resolveWaitStepPendingIds(_0x1b62fa,_0xec6453,_0x32f201,_0x4277df[_0x55cba9(0xed)]);}}}}
|
|
1
|
+
const a142_0x469651=a142_0x3aac;(function(_0x53595a,_0x4fe9bd){const _0x4e0a4e=a142_0x3aac,_0xb5a311=_0x53595a();while(!![]){try{const _0x39b7dc=-parseInt(_0x4e0a4e(0x1df))/0x1+parseInt(_0x4e0a4e(0x173))/0x2+-parseInt(_0x4e0a4e(0x1fe))/0x3+parseInt(_0x4e0a4e(0x114))/0x4*(parseInt(_0x4e0a4e(0x199))/0x5)+parseInt(_0x4e0a4e(0x202))/0x6*(parseInt(_0x4e0a4e(0x1a4))/0x7)+parseInt(_0x4e0a4e(0x129))/0x8*(-parseInt(_0x4e0a4e(0x1b7))/0x9)+-parseInt(_0x4e0a4e(0x12f))/0xa*(-parseInt(_0x4e0a4e(0x11a))/0xb);if(_0x39b7dc===_0x4fe9bd)break;else _0xb5a311['push'](_0xb5a311['shift']());}catch(_0x4041d1){_0xb5a311['push'](_0xb5a311['shift']());}}}(a142_0x5e0e,0x6534c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x469651(0x146));export const PENDING_SEGMENT_PREFIX=a142_0x469651(0x124);export const PENDING_ACTIVATION_PREFIX=a142_0x469651(0x12a);export function createPendingSegmentId(_0x2d1baa){return''+PENDING_SEGMENT_PREFIX+_0x2d1baa+'__';}export function isPendingSegmentId(_0x99468){const _0x1470a2=a142_0x469651;return _0x99468[_0x1470a2(0x1b4)](PENDING_SEGMENT_PREFIX)&&!_0x99468[_0x1470a2(0x1b4)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x457c7e){const _0x3140cc=a142_0x469651;return _0x457c7e[_0x3140cc(0x12c)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xbff275){return''+PENDING_ACTIVATION_PREFIX+_0xbff275+'__';}export function isPendingActivationId(_0x4299ce){const _0xd4ec53=a142_0x469651;return _0x4299ce[_0xd4ec53(0x1b4)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x55149c){return _0x55149c['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x9cb6fc,_0x526ada){const _0x526705=a142_0x469651,_0x4aa2f7=_0x9cb6fc+'::'+(_0x526ada['trim']()||'segment'),_0x2c6838=createHash(_0x526705(0x13d))['update'](_0x4aa2f7)[_0x526705(0x1a8)](_0x526705(0x156))['slice'](0x0,0xc);return _0x526705(0x145)+_0x2c6838;}export function ensureJourneyDefaults(_0x52250c){const _0x3435be=a142_0x469651;!_0x52250c[_0x3435be(0x1dc)]&&(_0x52250c[_0x3435be(0x1dc)]=''),!_0x52250c[_0x3435be(0x1f7)]&&(_0x52250c[_0x3435be(0x1f7)]='draft');}export function injectExistingStageIds(_0x87730a,_0x4c119f){const _0x4513d2=a142_0x469651,_0x522e90=new Map(_0x4c119f['map'](_0x401e62=>[_0x401e62['name'],_0x401e62['id']]));for(const _0x24dfec of _0x87730a){if(!_0x24dfec['id']){const _0x5a251b=_0x522e90[_0x4513d2(0x15d)](_0x24dfec[_0x4513d2(0x169)]);_0x5a251b&&(_0x24dfec['id']=_0x5a251b);}}}export function resolveTDFolderPath(_0x201672,_0x4e6d0f,_0x54b0a0){const _0x6e57a4=a142_0x469651;if(!_0x4e6d0f)return _0x201672;if(_0x201672===_0x54b0a0||_0x201672[_0x6e57a4(0x1b4)](_0x54b0a0+'/'))return _0x201672;return _0x201672?_0x54b0a0+'/'+_0x201672:_0x54b0a0;}export function addFoldersToCreate(_0xa103c1,_0x421e89,_0x13cb67){const _0x5439e7=a142_0x469651;if(!_0xa103c1)return;if(_0x421e89[_0x5439e7(0x1b3)](_0xa103c1))return;const _0x3292c7=_0xa103c1['split']('/');let _0x2676cd='';for(const _0x4243fe of _0x3292c7){_0x2676cd=_0x2676cd?_0x2676cd+'/'+_0x4243fe:_0x4243fe,!_0x421e89[_0x5439e7(0x1b3)](_0x2676cd)&&_0x13cb67[_0x5439e7(0x1f4)](_0x2676cd);}}export function sortFoldersByDepth(_0x5a77fc){const _0x23bcdf=a142_0x469651;return[..._0x5a77fc][_0x23bcdf(0x113)]((_0x4601ab,_0x576c21)=>{const _0x277e8d=_0x23bcdf,_0x473a42=(_0x4601ab[_0x277e8d(0x1f8)](/\//g)||[])[_0x277e8d(0x163)],_0xe81cdd=(_0x576c21[_0x277e8d(0x1f8)](/\//g)||[])[_0x277e8d(0x163)];return _0x473a42-_0xe81cdd;});}import*as a142_0x324021 from'yaml';import{readFileSync}from'fs';import a142_0x2c8ea3 from'path';import{isJourneyDef,parseYamlString as a142_0x505a2c,toYamlString as a142_0x334139,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(_0x1e8ec7){const _0x31f81a=a142_0x469651;if(Array[_0x31f81a(0x18f)](_0x1e8ec7))return'['+_0x1e8ec7['map'](_0xb831da=>stableStringify(_0xb831da))['join'](',')+']';if(_0x1e8ec7&&typeof _0x1e8ec7==='object'){const _0x2ddb71=_0x1e8ec7,_0x4c95e8=Object[_0x31f81a(0x11f)](_0x2ddb71)[_0x31f81a(0x113)](),_0x1b85dd=_0x4c95e8[_0x31f81a(0x1a9)](_0x58f209=>'\x22'+_0x58f209+'\x22:'+stableStringify(_0x2ddb71[_0x58f209]));return'{'+_0x1b85dd[_0x31f81a(0x1c0)](',')+'}';}const _0x4a1151=JSON[_0x31f81a(0x11b)](_0x1e8ec7);return _0x4a1151===undefined?_0x31f81a(0x1b5):_0x4a1151;}function activationSignature(_0x3b51a0){const _0x35acec=a142_0x469651,_0x135c79={'connection':_0x3b51a0[_0x35acec(0x120)],..._0x3b51a0[_0x35acec(0x134)]!==undefined&&{'all_columns':_0x3b51a0['all_columns']},..._0x3b51a0[_0x35acec(0x203)]!==undefined&&{'columns':_0x3b51a0['columns']},..._0x3b51a0[_0x35acec(0x192)]!==undefined&&{'behavior':_0x3b51a0[_0x35acec(0x192)]},..._0x3b51a0[_0x35acec(0x1ee)]!==undefined&&{'schedule':_0x3b51a0[_0x35acec(0x1ee)]},..._0x3b51a0[_0x35acec(0x161)]!==undefined&&{'notification':_0x3b51a0[_0x35acec(0x161)]},..._0x3b51a0[_0x35acec(0x16d)]!==undefined&&{'connector_config':_0x3b51a0[_0x35acec(0x16d)]},..._0x3b51a0[_0x35acec(0x153)]!==undefined&&{'activation_template_id':_0x3b51a0[_0x35acec(0x153)]}};return stableStringify(_0x135c79);}async function fetchSegment(_0x2ad254,_0x493897,_0x4a8295,_0x15de74){const _0x53cdcc=a142_0x469651,_0x2a7a5a=_0x15de74?.[_0x53cdcc(0x13c)](_0x211e00=>_0x211e00['id']===_0x4a8295);if(_0x2a7a5a)return _0x2a7a5a;try{return await _0x2ad254[_0x53cdcc(0x1c9)]['getSegment'](_0x493897,_0x4a8295);}catch(_0x2cfcc7){logger[_0x53cdcc(0x140)]('getSegment\x20failed\x20for\x20'+_0x4a8295+_0x53cdcc(0x20a)+_0x2cfcc7);try{return await _0x2ad254['segment'][_0x53cdcc(0x11e)](_0x4a8295);}catch(_0x40890e){return logger[_0x53cdcc(0x140)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x4a8295+':\x20'+_0x40890e),null;}}}function recoverSegmentIdsFromPushRecovery(_0x46b289,_0x5121f5,_0x3d4d7c){const _0x2359a5=a142_0x469651,_0x4e13b9=readPushRecovery(_0x46b289[_0x2359a5(0x135)]);if(_0x4e13b9?.['journeyName']===_0x46b289[_0x2359a5(0x1b1)][_0x2359a5(0x169)])for(const [_0x47aa4c,_0x37297d]of Object[_0x2359a5(0x188)](_0x4e13b9[_0x2359a5(0x208)])){const _0x532e45=generateDeterministicJourneySegmentName(_0x46b289[_0x2359a5(0x1b1)][_0x2359a5(0x169)],_0x47aa4c);_0x37297d[_0x2359a5(0x1de)]===_0x532e45&&(_0x5121f5['set'](_0x47aa4c,_0x37297d[_0x2359a5(0x207)]),_0x3d4d7c['set'](_0x47aa4c,_0x37297d[_0x2359a5(0x207)]));}}async function createOrRecoverEmbeddedSegment(_0xf58401,_0x538207,_0x5cb579,_0xbc80db){const _0x4d9aa8=a142_0x469651;let _0x3078b8;try{_0x3078b8=await _0xf58401[_0x4d9aa8(0x1c9)][_0x4d9aa8(0x159)]({'name':_0x5cb579[_0x4d9aa8(0x16c)],'description':_0x5cb579['description'],'journeyId':_0x5cb579[_0x4d9aa8(0x175)],'rule':_0xbc80db(_0x5cb579[_0x4d9aa8(0x1ca)],!![]),'countPopulation':!![],'parentFolderId':_0x5cb579[_0x4d9aa8(0x11d)],'audienceId':_0x5cb579['parentId']});}catch(_0x37e0e7){const _0x4ee024=_0x37e0e7 instanceof Error&&_0x37e0e7[_0x4d9aa8(0x1e1)][_0x4d9aa8(0x171)](_0x4d9aa8(0x1b6));if(_0x4ee024){const _0x4bdd4f=readPushRecovery(_0x538207[_0x4d9aa8(0x135)]),_0xb80682=_0x4bdd4f?.[_0x4d9aa8(0x1bc)]===_0x538207[_0x4d9aa8(0x1b1)][_0x4d9aa8(0x169)]?_0x4bdd4f['segments'][_0x5cb579[_0x4d9aa8(0x1e2)]]:undefined;if(_0xb80682?.['uniqueServerName']===_0x5cb579[_0x4d9aa8(0x16c)])await _0xf58401['segment'][_0x4d9aa8(0x142)](_0x5cb579[_0x4d9aa8(0x1e9)],_0xb80682[_0x4d9aa8(0x207)],{'description':_0x5cb579[_0x4d9aa8(0x1dc)],'rule':_0xbc80db(_0x5cb579[_0x4d9aa8(0x1ca)],!![]),'countPopulation':!![]}),_0x3078b8=_0xb80682[_0x4d9aa8(0x207)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4d9aa8(0x182)+_0x5cb579[_0x4d9aa8(0x1e2)]+_0x4d9aa8(0x14a)+(_0x4d9aa8(0x215)+_0x538207['absolutePath']['replace'](/([^/]+)$/,_0x4d9aa8(0x1e6))+')\x20')+_0x4d9aa8(0x138),_0x37e0e7);}else throw _0x37e0e7;}return saveSegmentToPushRecovery(_0x538207['absolutePath'],_0x538207[_0x4d9aa8(0x1b1)][_0x4d9aa8(0x169)],_0x5cb579[_0x4d9aa8(0x1e2)],{'segmentId':_0x3078b8,'uniqueServerName':_0x5cb579[_0x4d9aa8(0x16c)],'createdAt':new Date()[_0x4d9aa8(0x1cc)]()}),_0x3078b8;}export async function prepareSegmentFiles(_0x2d8bd4,_0x45294d,_0x5c0f99,_0x165bce,_0x3b66ef){const _0x452590=a142_0x469651,{activationDefToCreateRequest:_0x5013ce}=await import('./child-segment-yaml.js'),_0x4ee814=[],_0x1254dd=new Set();for(const {yamlConfig:_0x22a55b,folderPath:_0x22ebde,sourcePath:_0x433a7b}of _0x2d8bd4){const _0x4bc02b=resolveTDFolderPath(_0x22ebde,_0x165bce,_0x3b66ef),_0x58a46c=_0x4bc02b+':'+_0x22a55b[_0x452590(0x169)],_0x471731=_0x45294d['segmentByFolderAndName']['get'](_0x58a46c),_0x4c7d1c=_0x471731?_0x45294d[_0x452590(0x1fd)][_0x452590(0x15d)](_0x471731['id'])||[]:[];addFoldersToCreate(_0x4bc02b,_0x45294d[_0x452590(0x168)],_0x1254dd);const _0x5c3994=calculateActivationActions(_0x22a55b[_0x452590(0x116)]||[],_0x4c7d1c,_0x45294d[_0x452590(0x12e)],_0x45294d['connectionIdToNameMap']);for(const _0x585941 of _0x5c3994){(_0x585941[_0x452590(0x17d)]===_0x452590(0x1be)||_0x585941['type']===_0x452590(0x1c7))&&_0x585941[_0x452590(0x1d9)]&&(_0x585941[_0x452590(0x128)]=await _0x5013ce(_0x585941[_0x452590(0x1d9)],_0x5c0f99));}const _0x90ac8=calculateSegmentDiff(_0x22a55b,_0x471731,_0x4c7d1c,_0x45294d['idToEmailMap'],_0x45294d['connectionIdToNameMap']);_0x4ee814[_0x452590(0x1cf)]({'relativePath':_0x22a55b['name'],'absolutePath':_0x433a7b,'yamlConfig':_0x22a55b,'folderPath':_0x4bc02b,'existingSegment':_0x471731,'existingActivations':_0x4c7d1c,'isNew':_0x90ac8[_0x452590(0x213)],'hasChanges':_0x90ac8[_0x452590(0x1c6)],'diff':_0x90ac8[_0x452590(0x12d)],'activationActions':_0x5c3994});}return{'segmentFiles':_0x4ee814,'foldersToCreate':_0x1254dd};}export async function prepareJourneyFiles(_0x3b6c77,_0x5075a6,_0x3958e4,_0x4cc364){const _0x106524=a142_0x469651,_0x2ca9a9=[],_0x5488da=new Set();for(const {yamlConfig:_0x5c5e19,folderPath:_0x24796b,sourcePath:_0x21ca79}of _0x3b6c77){const _0x25889b=resolveTDFolderPath(_0x24796b,_0x3958e4,_0x4cc364),_0xb69cd4=_0x25889b+':'+_0x5c5e19[_0x106524(0x169)],_0x325800=_0x5075a6['journeyBundlesByFolderAndName'][_0x106524(0x15d)](_0xb69cd4);let _0x39c8bc,_0x7deaa;if(_0x325800&&_0x325800['length']>0x0){const _0x4739a0=buildLocalExpandedRuleMappings(_0x5c5e19),{createYamlContext:_0x18e3dc,prefetchJourneySegments:_0x57d5fa}=createPushYamlContextForBundle(_0x5075a6[_0x106524(0x167)],_0x5075a6['parentId'],_0x5075a6[_0x106524(0x127)],_0x4739a0,_0x5075a6[_0x106524(0x12e)],_0x5075a6['connectionIdToNameMap'],_0x5075a6[_0x106524(0x160)],_0x5075a6[_0x106524(0x18e)]);await _0x57d5fa(_0x325800[_0x106524(0x1a9)](_0x2d9ac4=>_0x2d9ac4['id']));const _0x324d8b=await _0x5075a6[_0x106524(0x167)][_0x106524(0x130)][_0x106524(0x148)](_0x325800[0x0][_0x106524(0x1f0)]),_0xc801f2=hasMultipleVersions(_0x5c5e19),_0x544971=async _0x570b6e=>{const _0x340b3c=_0x106524,_0x497fee=_0x5075a6[_0x340b3c(0x18e)]?.[_0x340b3c(0x15d)](_0x570b6e);if(_0x497fee)return _0x497fee;return _0x5075a6[_0x340b3c(0x1f5)]({'journeyId':_0x570b6e,'journeyName':_0x5c5e19['name'],'isMultiVersion':_0x325800[_0x340b3c(0x163)]>0x1});};if(_0xc801f2&&_0x325800[_0x106524(0x163)]>0x1){const _0x2b169e=[];for(const _0x2d17f3 of _0x325800){const _0xc9f8a8=_0x2d17f3['versionNumber']||0x1;_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)]('Fetching\x20'+_0x5c5e19['name']+'\x20v'+_0xc9f8a8);const _0x1792e9=await _0x544971(_0x2d17f3['id']),_0x3c0584=_0x18e3dc(_0x2d17f3['id']),_0x1d9732=await journeyResponseToDef(_0x1792e9,_0x3c0584);_0x2b169e[_0x106524(0x1cf)]({'item':_0x2d17f3,'yaml':_0x1d9732});}const _0x3834be=buildLocalRuleToNameMappingFromJourney(_0x5c5e19);_0x7deaa=buildMergedJourneyDef(_0x2b169e,_0x3834be,_0x324d8b);const _0x4a8064=Math[_0x106524(0x185)](..._0x2b169e[_0x106524(0x1a9)](_0x3e6061=>_0x3e6061[_0x106524(0x122)][_0x106524(0x166)]||0x0)),_0xd05f73=_0x325800[_0x106524(0x13c)](_0x35ef17=>(_0x35ef17[_0x106524(0x166)]||0x0)===_0x4a8064);_0xd05f73&&(_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)](_0x106524(0x1a3)+_0x5c5e19[_0x106524(0x169)]+'\x20v'+_0x4a8064),_0x39c8bc=await _0x544971(_0xd05f73['id']));}else{const _0x154689=_0x325800[_0x325800[_0x106524(0x163)]-0x1];_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)]('Fetching\x20'+_0x5c5e19[_0x106524(0x169)]),_0x39c8bc=await _0x544971(_0x154689['id']);const _0x20f47c=_0x18e3dc(_0x154689['id']),_0x4a5b8e=await journeyResponseToDef(_0x39c8bc,_0x20f47c),_0x2b57b0=buildLocalRuleToNameMappingFromJourney(_0x5c5e19);_0x7deaa=buildMergedJourneyDef([{'item':_0x154689,'yaml':_0x4a5b8e}],_0x2b57b0,_0x324d8b);}}addFoldersToCreate(_0x25889b,_0x5075a6['folderPathToId'],_0x5488da);const _0x52618a=calculateJourneyDiff(_0x5c5e19,_0x7deaa);_0x2ca9a9[_0x106524(0x1cf)]({'relativePath':_0x5c5e19['name'],'absolutePath':_0x21ca79,'yamlConfig':_0x5c5e19,'folderPath':_0x25889b,'existingJourney':_0x39c8bc,'isNew':_0x52618a[_0x106524(0x213)],'hasChanges':_0x52618a[_0x106524(0x1c6)],'diff':_0x52618a[_0x106524(0x12d)]});}return{'journeyFiles':_0x2ca9a9,'foldersToCreate':_0x5488da};}export function calculateActivationActions(_0x4f9d71,_0x462ce2,_0x252036,_0x37055d){const _0x3b6e67=a142_0x469651,_0x598f2d=[],_0x46f5c1=new Map();for(const _0x525988 of _0x462ce2){_0x46f5c1[_0x3b6e67(0x17c)](_0x525988['name'],_0x525988);}const _0x3e0321=new Map();for(const _0x89a0fd of _0x4f9d71){_0x3e0321['set'](_0x89a0fd[_0x3b6e67(0x169)],_0x89a0fd);}for(const _0x48c086 of _0x4f9d71){const _0x23781e=_0x46f5c1[_0x3b6e67(0x15d)](_0x48c086[_0x3b6e67(0x169)]);if(!_0x23781e)_0x598f2d[_0x3b6e67(0x1cf)]({'type':'create','name':_0x48c086[_0x3b6e67(0x169)],'yamlActivation':_0x48c086});else{const _0x34edb3=activationResponseToDef(_0x23781e,_0x252036,_0x37055d),_0x230884=a142_0x324021[_0x3b6e67(0x11b)](_0x34edb3),_0x42b268=a142_0x324021[_0x3b6e67(0x11b)](_0x48c086);_0x230884!==_0x42b268&&_0x598f2d[_0x3b6e67(0x1cf)]({'type':_0x3b6e67(0x1c7),'name':_0x48c086[_0x3b6e67(0x169)],'yamlActivation':_0x48c086,'existingActivation':_0x23781e});}}for(const _0x4e3948 of _0x462ce2){!_0x3e0321[_0x3b6e67(0x1b3)](_0x4e3948[_0x3b6e67(0x169)])&&_0x598f2d['push']({'type':_0x3b6e67(0x1dd),'name':_0x4e3948[_0x3b6e67(0x169)],'existingActivation':_0x4e3948});}return _0x598f2d;}function calculateYamlDiff(_0x20a9e5,_0x1029fe){if(_0x1029fe){const _0x525da6=generateDiff(_0x1029fe,_0x20a9e5),_0x1841e0=hasChanges(_0x525da6);return{'isNew':![],'hasChanges':_0x1841e0,'diff':_0x1841e0?formatDiffWithColors(_0x525da6):undefined};}const _0x29c07c=generateDiff('',_0x20a9e5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x29c07c)};}export function calculateSegmentDiff(_0x21a487,_0x231fc8,_0x524287,_0x33638a,_0x1d02f0){const _0xadea68=segmentToYamlString(_0x21a487),_0x4aca86=_0x231fc8?segmentToYamlString(segmentWithActivationsToYaml(_0x231fc8,_0x524287,undefined,_0x33638a,_0x1d02f0)):undefined;return calculateYamlDiff(_0xadea68,_0x4aca86);}export function calculateJourneyDiff(_0x44228e,_0x524437){const _0x4b1f49=normalizeJourneyDef(_0x44228e,_0x44228e),_0x42049a=a142_0x334139(_0x4b1f49),_0x123ad1=_0x524437?a142_0x334139(normalizeJourneyDef(_0x524437,_0x44228e)):undefined;return calculateYamlDiff(_0x42049a,_0x123ad1);}export function findSegmentsToDelete(_0x46f04a,_0x1a7a7d,_0x53772a,_0x35a555,_0xd4a685){const _0x20f763=a142_0x469651,_0x3ec932=new Set();for(const {yamlConfig:_0x4b9ad9,folderPath:_0x279c36}of _0x1a7a7d){_0x3ec932['add'](_0x279c36+':'+_0x4b9ad9[_0x20f763(0x169)]);}return _0x46f04a['filter'](_0x5974c8=>{const _0x150ad9=_0x20f763,_0x3e006c=_0x5974c8[_0x150ad9(0x1eb)]?_0x53772a['get'](_0x5974c8[_0x150ad9(0x1eb)]['toString']())||'':'',_0x4205d8=_0x3e006c+':'+_0x5974c8[_0x150ad9(0x169)];if(_0x3ec932[_0x150ad9(0x1b3)](_0x4205d8))return![];if(_0xd4a685)return _0x3e006c===_0x35a555||_0x3e006c[_0x150ad9(0x1b4)](_0x35a555+'/');return!![];});}export function findJourneysToDelete(_0x6af268,_0x52d09f,_0x513c6c,_0x3c9091,_0x3d143f){const _0x3710ef=a142_0x469651,_0xde9ae4=new Set();for(const {yamlConfig:_0x4987a2,folderPath:_0x7f70b1}of _0x52d09f){_0xde9ae4[_0x3710ef(0x1f4)](_0x7f70b1+':'+_0x4987a2['name']);}return _0x6af268[_0x3710ef(0x19c)](_0x13e0da=>{const _0x1f28bc=_0x3710ef,_0x5b1ffb=_0x13e0da[_0x1f28bc(0x11d)]?_0x513c6c[_0x1f28bc(0x15d)](_0x13e0da[_0x1f28bc(0x11d)])||'':'',_0xc042d6=_0x5b1ffb+':'+_0x13e0da[_0x1f28bc(0x17e)];if(_0xde9ae4['has'](_0xc042d6))return![];if(_0x3d143f)return _0x5b1ffb===_0x3c9091||_0x5b1ffb[_0x1f28bc(0x1b4)](_0x3c9091+'/');return!![];});}export function buildSegmentLookupMap(_0x59fc59,_0x5c97f6){const _0x335145=a142_0x469651,_0x11c99b=new Map();for(const _0xf1bbfe of _0x59fc59){const _0x3bff59=_0xf1bbfe[_0x335145(0x1eb)]?_0x5c97f6[_0x335145(0x15d)](_0xf1bbfe[_0x335145(0x1eb)]['toString']())||'':'',_0x4391b6=_0x3bff59+':'+_0xf1bbfe[_0x335145(0x169)];_0x11c99b[_0x335145(0x17c)](_0x4391b6,_0xf1bbfe);}return _0x11c99b;}export function buildSegmentNameToIdMap(_0x54930b){const _0x371868=a142_0x469651,_0x54095e=new Map();for(const _0x4500cb of _0x54930b){_0x54095e[_0x371868(0x17c)](_0x4500cb[_0x371868(0x169)],_0x4500cb['id']);}return _0x54095e;}export function buildJourneyBundleLookupMap(_0x421f9b,_0x1d7d1f){const _0xef661e=a142_0x469651,_0x5d6a08=new Map();for(const _0x46db5f of _0x421f9b){const _0x3c5443=_0x46db5f[_0xef661e(0x11d)]?_0x1d7d1f[_0xef661e(0x15d)](_0x46db5f[_0xef661e(0x11d)])||'':'',_0x4b1859=_0x3c5443+':'+_0x46db5f[_0xef661e(0x17e)];!_0x5d6a08[_0xef661e(0x1b3)](_0x4b1859)&&_0x5d6a08[_0xef661e(0x17c)](_0x4b1859,[]),_0x5d6a08[_0xef661e(0x15d)](_0x4b1859)[_0xef661e(0x1cf)](_0x46db5f);}for(const _0x4db898 of _0x5d6a08[_0xef661e(0x20f)]()){_0x4db898['sort']((_0x2c2d72,_0x2cc121)=>(_0x2c2d72['versionNumber']||0x0)-(_0x2cc121[_0xef661e(0x166)]||0x0));}return _0x5d6a08;}export function collectFoldersToCreate(_0xae2e3e,_0x4afc32){const _0xc3a7c8=a142_0x469651,_0x287181=new Set();for(const _0x1e8bfe of _0xae2e3e){if(!_0x1e8bfe)continue;if(_0x4afc32['has'](_0x1e8bfe))continue;const _0x3cc8a6=_0x1e8bfe[_0xc3a7c8(0x214)]('/');let _0x38b027='';for(const _0x4120c0 of _0x3cc8a6){_0x38b027=_0x38b027?_0x38b027+'/'+_0x4120c0:_0x4120c0,!_0x4afc32[_0xc3a7c8(0x1b3)](_0x38b027)&&_0x287181[_0xc3a7c8(0x1f4)](_0x38b027);}}return _0x287181;}export function parseAndClassifyYamlFiles(_0x326afa,_0x381af3,_0x6fddb8){const _0x5adc3f=a142_0x469651,_0x12a801=[],_0x6ef763=[];for(const _0x2f3bbd of _0x326afa){const _0x362c75=a142_0x2c8ea3[_0x5adc3f(0x1b0)](_0x381af3,a142_0x2c8ea3['dirname'](_0x2f3bbd)),_0x5ebeba=_0x362c75==='.'?'':_0x362c75,_0x558b06=readFileSync(_0x2f3bbd,_0x5adc3f(0x1d8)),_0x39224b=a142_0x324021['parse'](_0x558b06);if(isJourneyDef(_0x39224b)){const _0x13140f=a142_0x505a2c(_0x558b06);_0x6ef763['push']({'yamlConfig':_0x13140f,'folderPath':_0x5ebeba,'sourcePath':_0x2f3bbd});}else{if(!_0x6fddb8?.[_0x5adc3f(0x152)]){const _0x392247=parseSegmentYamlFile(_0x558b06),_0x27ff97=normalizeChildSegmentYaml(_0x392247);_0x12a801[_0x5adc3f(0x1cf)]({'yamlConfig':_0x27ff97,'folderPath':_0x5ebeba,'sourcePath':_0x2f3bbd});}}}return{'segments':_0x12a801,'journeys':_0x6ef763};}export function validateParsedFiles(_0x43e818,_0x7b9ef){const _0x1eba61=a142_0x469651,_0x192146=[];for(const {yamlConfig:_0x5b93df,sourcePath:_0x1b63e8}of _0x43e818[_0x1eba61(0x208)]){const _0x3fe749=readFileSync(_0x1b63e8,_0x1eba61(0x1d8)),_0x2ce464=a142_0x324021[_0x1eba61(0x1c4)](_0x3fe749),_0x1f6ad5=validateSegmentDef(_0x5b93df,{'source':_0x3fe749,'document':_0x2ce464},{'skipSchema':!![]});if(!_0x1f6ad5[_0x1eba61(0x1d2)]){const _0xd0add8=a142_0x2c8ea3['relative'](_0x7b9ef,_0x1b63e8);_0x192146[_0x1eba61(0x1cf)]({'filePath':_0xd0add8,'source':_0x3fe749,'result':_0x1f6ad5,'isJourney':![]});}}for(const {yamlConfig:_0x44cb1e,sourcePath:_0x299f46}of _0x43e818[_0x1eba61(0x1e5)]){const _0x38b827=readFileSync(_0x299f46,_0x1eba61(0x1d8)),_0x410a1f=a142_0x324021[_0x1eba61(0x1c4)](_0x38b827),_0x13e245=validateJourneyDef(_0x44cb1e,{'source':_0x38b827,'document':_0x410a1f},{'skipSchema':!![]});if(!_0x13e245[_0x1eba61(0x1d2)]){const _0x222797=a142_0x2c8ea3['relative'](_0x7b9ef,_0x299f46);_0x192146[_0x1eba61(0x1cf)]({'filePath':_0x222797,'source':_0x38b827,'result':_0x13e245,'isJourney':!![]});}}return _0x192146;}export function formatValidationErrors(_0x2af6fd){const _0x433bc9=a142_0x469651,_0x293541=[];for(const {filePath:_0x157f3d,source:_0x4eb649,result:_0x50f282,isJourney:_0x25b0c5}of _0x2af6fd){const _0x15a52a=_0x25b0c5?_0x433bc9(0x130):_0x433bc9(0x1c9);_0x293541[_0x433bc9(0x1cf)]('\x0a'+_0x157f3d+'\x20('+_0x15a52a+'):\x20'+_0x50f282['errors'][_0x433bc9(0x163)]+'\x20error(s)'),_0x293541[_0x433bc9(0x1cf)](formatValidationResult(_0x50f282,_0x4eb649,_0x157f3d));}return _0x293541[_0x433bc9(0x1c0)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x37f0e7){const _0xed1367=a142_0x469651,_0x46e995=new Set(),_0x444d25=new Map(),_0x53632b=collectSegmentUsageCounts(_0x37f0e7);if(_0x37f0e7[_0xed1367(0x208)])for(const [_0x597538,_0xe0555d]of Object[_0xed1367(0x188)](_0x37f0e7[_0xed1367(0x208)])){_0x46e995[_0xed1367(0x1f4)](_0x597538);if(_0xe0555d[_0xed1367(0x1a0)]){const _0xad3e48=yamlRuleToApi(_0xe0555d['rule']),_0x5a377c=apiRuleToYaml(_0xad3e48);_0x444d25[_0xed1367(0x17c)](_0x597538,_0x5a377c);}}const _0x7b6306=new Map();let _0xf67142=0x0;for(const [_0x509f62,_0x1e4c93]of _0x444d25){const _0xa9ad5c=serializeExpandedRule(_0x1e4c93,_0x444d25),_0x26b8cf=_0x7b6306[_0xed1367(0x15d)](_0xa9ad5c)||[];_0x26b8cf[_0xed1367(0x1cf)]({'name':_0x509f62,'index':_0xf67142}),_0x7b6306['set'](_0xa9ad5c,_0x26b8cf),_0xf67142++;}const _0xcc7199=new Map();for(const [_0x55e698,_0x34b681]of _0x7b6306){const _0x14d6f1=_0x34b681[_0xed1367(0x19b)]()[_0xed1367(0x113)]((_0x5c1483,_0x2f3576)=>{const _0x50e278=_0xed1367,_0x37a616=_0x53632b[_0x50e278(0x15d)](_0x5c1483[_0x50e278(0x169)])||0x0,_0x474aea=_0x53632b['get'](_0x2f3576[_0x50e278(0x169)])||0x0;if(_0x37a616!==_0x474aea)return _0x474aea-_0x37a616;return _0x5c1483['index']-_0x2f3576[_0x50e278(0x123)];})[_0xed1367(0x1a9)](_0x14c017=>_0x14c017['name']),_0x222b82=[];for(const _0x3cf16b of _0x14d6f1){const _0x4147fc=_0x53632b[_0xed1367(0x15d)](_0x3cf16b)||0x0,_0x1427cd=Math[_0xed1367(0x185)](_0x4147fc,0x1);for(let _0x2b4596=0x0;_0x2b4596<_0x1427cd;_0x2b4596++){_0x222b82['push'](_0x3cf16b);}}_0xcc7199['set'](_0x55e698,_0x222b82);}return{'existingLocalSegmentNames':_0x46e995,'localSegmentRules':_0x444d25,'localExpandedRuleToNames':_0xcc7199};}export function createSegmentIdResolver(_0x574a46,_0x3e0d8d){return async _0x28699f=>{const _0x312993=a142_0x3aac,_0x370d22=_0x574a46[_0x312993(0x15d)](_0x28699f);if(!_0x370d22)throw new SDKError(ErrorCode[_0x312993(0x212)],_0x312993(0x1d1)+_0x28699f+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x3e0d8d+'\x27)');return _0x370d22;};}export function extractRootFolderId(_0x581a07){const _0xcd6592=a142_0x469651;return _0x581a07['relationships']?.[_0xcd6592(0x1a5)]?.[_0xcd6592(0x143)]?.['id']||_0x581a07['relationships']?.[_0xcd6592(0x1ae)]?.[_0xcd6592(0x143)]?.['id'];}export function buildConnectionMaps(_0x3a1f34){const _0x43a9da=a142_0x469651,_0x2acb0d=new Map(),_0x2b0171=new Map(),_0x2d3ceb=new Map();for(const _0x5260d3 of _0x3a1f34){_0x2acb0d[_0x43a9da(0x17c)](_0x5260d3[_0x43a9da(0x169)],parseInt(_0x5260d3['id'],0xa)),_0x2b0171[_0x43a9da(0x17c)](_0x5260d3['id'],_0x5260d3['name']),_0x2d3ceb[_0x43a9da(0x17c)](_0x5260d3[_0x43a9da(0x169)],_0x5260d3[_0x43a9da(0x17d)]);}return{'nameToId':_0x2acb0d,'idToName':_0x2b0171,'nameToType':_0x2d3ceb};}export function calculatePushStats(_0x26ab9f,_0x4e96cb,_0x34715e,_0x41448f,_0x3f56de,_0x235c62,_0x584868){const _0x3040ff=a142_0x469651,_0x384ec1=_0x26ab9f[_0x3040ff(0x19c)](_0x272fda=>_0x272fda[_0x3040ff(0x213)]),_0x691cf6=_0x26ab9f[_0x3040ff(0x19c)](_0x2197bf=>!_0x2197bf[_0x3040ff(0x213)]&&_0x2197bf[_0x3040ff(0x1c6)]),_0x4ac0ef=_0x26ab9f[_0x3040ff(0x19c)](_0x4d99e2=>!_0x4d99e2[_0x3040ff(0x213)]&&!_0x4d99e2[_0x3040ff(0x1c6)]),_0x547d2f=_0x235c62?_0x41448f:[],_0x39f31a=_0x4e96cb[_0x3040ff(0x19c)](_0x4a5558=>_0x4a5558[_0x3040ff(0x213)]),_0x542821=_0x4e96cb[_0x3040ff(0x19c)](_0x4bc055=>!_0x4bc055[_0x3040ff(0x213)]&&_0x4bc055[_0x3040ff(0x1c6)]),_0x39c178=_0x4e96cb[_0x3040ff(0x19c)](_0xf9e720=>!_0xf9e720[_0x3040ff(0x213)]&&!_0xf9e720['hasChanges']),_0x16c463=_0x235c62?_0x3f56de:[],_0x41f170=_0x26ab9f[_0x3040ff(0x1e7)](_0x5ca6fb=>_0x5ca6fb['activationActions']),_0x5f7727=_0x41f170[_0x3040ff(0x19c)](_0x159048=>_0x159048['type']==='create'),_0x431eb4=_0x41f170[_0x3040ff(0x19c)](_0x321cd6=>_0x321cd6['type']==='update'),_0x6d0d46=_0x41f170['filter'](_0xa7661b=>_0xa7661b[_0x3040ff(0x17d)]===_0x3040ff(0x1dd)),_0x5e7049=Array[_0x3040ff(0x1c2)](_0x34715e)[_0x3040ff(0x113)](),_0x23996f=_0x584868?![]:_0x384ec1[_0x3040ff(0x163)]>0x0||_0x691cf6[_0x3040ff(0x163)]>0x0||_0x547d2f[_0x3040ff(0x163)]>0x0,_0x5188c2=_0x39f31a[_0x3040ff(0x163)]>0x0||_0x542821[_0x3040ff(0x163)]>0x0||_0x16c463[_0x3040ff(0x163)]>0x0,_0x2a1db7=_0x584868?![]:_0x41f170['length']>0x0,_0x45e8dc=_0x5e7049['length']>0x0;return{'segments':{'new':_0x384ec1,'changed':_0x691cf6,'unchanged':_0x4ac0ef,'toDelete':_0x547d2f},'journeys':{'new':_0x39f31a,'changed':_0x542821,'unchanged':_0x39c178,'toDelete':_0x16c463},'activations':{'all':_0x41f170,'toCreate':_0x5f7727,'toUpdate':_0x431eb4,'toDelete':_0x6d0d46},'folders':{'toCreate':_0x5e7049},'counts':{'segments':{'new':_0x384ec1[_0x3040ff(0x163)],'changed':_0x691cf6[_0x3040ff(0x163)],'unchanged':_0x4ac0ef[_0x3040ff(0x163)],'toDelete':_0x547d2f[_0x3040ff(0x163)]},'journeys':{'new':_0x39f31a[_0x3040ff(0x163)],'changed':_0x542821['length'],'unchanged':_0x39c178[_0x3040ff(0x163)],'toDelete':_0x16c463['length']},'activations':{'create':_0x5f7727[_0x3040ff(0x163)],'update':_0x431eb4[_0x3040ff(0x163)],'delete':_0x6d0d46[_0x3040ff(0x163)]},'folders':_0x5e7049[_0x3040ff(0x163)]},'hasChanges':_0x23996f||_0x5188c2||_0x2a1db7||_0x45e8dc};}export async function buildPushExecutionContext(_0x4ff57d,_0x241dc8,_0x3ddbbe,_0x5a029a,_0x558d97,_0xa7a9f9){const _0x4f1539=a142_0x469651,_0x4dacc3=extractRootFolderId(_0x3ddbbe),{pathToId:_0xd0618b,idToPath:_0x213072}=buildFolderMaps(_0x558d97),_0x580208=buildSegmentNameToIdMap(_0x5a029a),_0x2a47f8=new Map(),{batchAsync:_0x10a276}=await import(_0x4f1539(0x162)),[_0x3cf348,_0x585819]=await Promise[_0x4f1539(0x14f)]([_0x4ff57d[_0x4f1539(0x121)]['buildUserMaps'](),_0x4ff57d[_0x4f1539(0x120)][_0x4f1539(0x1d0)](),((async()=>{const _0x26b2f3=_0x4f1539;!_0xa7a9f9&&_0x5a029a[_0x26b2f3(0x163)]>0x0&&await _0x10a276(_0x5a029a,async _0x4a3b28=>{const _0x418baa=_0x26b2f3,_0x5b63cf=await _0x4ff57d[_0x418baa(0x1c9)]['listActivations'](_0x241dc8,_0x4a3b28['id']);_0x2a47f8[_0x418baa(0x17c)](_0x4a3b28['id'],_0x5b63cf);});})())]),{emailToId:_0xc7fe42,idToEmail:_0x36fb6b}=_0x3cf348,_0x57b654=buildConnectionMaps(_0x585819);return{'rootFolderId':_0x4dacc3,'folderPathToId':_0xd0618b,'folderIdToPath':_0x213072,'segmentNameToId':_0x580208,'activationsBySegmentId':_0x2a47f8,'emailToIdMap':_0xc7fe42,'idToEmailMap':_0x36fb6b,'connectionNameToIdMap':_0x57b654[_0x4f1539(0x179)],'connectionIdToNameMap':_0x57b654[_0x4f1539(0x136)],'connectionNameToTypeMap':_0x57b654[_0x4f1539(0x165)]};}export function createPushYamlContextForBundle(_0x52e753,_0x44f456,_0x13a2c9,_0x414b2b,_0x1f3450,_0x4cd951,_0x214826,_0x4d07dc){const {existingLocalSegmentNames:_0x346be9,localExpandedRuleToNames:_0x3f390e}=_0x414b2b,_0x546a05=new Set(),_0x35701f=new Map(),_0xd610d3=new Map(),_0x5b151b=new Map(),_0x336fac=createJumpTargetCache(),_0x399272=new Map(),_0x503a8f=new Map(),_0x2a8c0f=new Set();let _0x37966e;const _0xcf52e6=_0x142f40=>{const _0x473d05={'resolveSegment':async _0x4a9420=>{const _0x594161=a142_0x3aac,_0x12746a=_0x5b151b[_0x594161(0x15d)](_0x4a9420);if(_0x12746a!==undefined)return{'name':_0x12746a,'isJourneyLocal':!![]};try{const _0x2340f4=await fetchSegment(_0x52e753,_0x44f456,_0x4a9420,_0x13a2c9);if(!_0x2340f4)throw new Error(_0x594161(0x20c));const _0x3c5d0c=generateJourneyLocalName(_0x2340f4['name']),_0x12c74d=_0x2340f4['kind']===SEGMENT_KIND_JOURNEY&&_0x3c5d0c!==undefined;let _0x3173cf=_0x2340f4[_0x594161(0x169)],_0x25d86a;if(_0x12c74d&&_0x2340f4[_0x594161(0x1a0)]){const _0x281677=apiRuleToYaml(_0x2340f4[_0x594161(0x1a0)]);_0x503a8f[_0x594161(0x17c)](_0x4a9420,_0x281677);const _0x2a9c2f=async _0x27691e=>{const _0x2179bf=_0x594161,_0x5e5325=collectSegmentRefsFromRule(_0x27691e);for(const _0x10c832 of _0x5e5325){if(!_0x503a8f[_0x2179bf(0x1b3)](_0x10c832))try{const _0x3ed453=await fetchSegment(_0x52e753,_0x44f456,_0x10c832,_0x13a2c9);if(_0x3ed453?.[_0x2179bf(0x1a0)]){const _0xc1dbc0=apiRuleToYaml(_0x3ed453[_0x2179bf(0x1a0)]);_0x503a8f[_0x2179bf(0x17c)](_0x10c832,_0xc1dbc0),await _0x2a9c2f(_0xc1dbc0);}}catch(_0x204b8d){logger[_0x2179bf(0x140)](_0x2179bf(0x201)+_0x10c832+':\x20'+_0x204b8d);}}};await _0x2a9c2f(_0x281677);const _0x157668=serializeExpandedRule(_0x281677,_0x503a8f),_0x2d87a1=_0x3f390e['get'](_0x157668);if(_0x2d87a1&&_0x2d87a1[_0x594161(0x163)]>0x0){const _0x3bcfb1=_0x35701f[_0x594161(0x15d)](_0x157668)||0x0,_0x40d99c=_0x2d87a1[_0x3bcfb1]||_0x2d87a1[_0x2d87a1[_0x594161(0x163)]-0x1];_0x35701f['set'](_0x157668,_0x3bcfb1+0x1),_0x3173cf=_0x40d99c,_0x546a05['add'](_0x3173cf),_0x5b151b[_0x594161(0x17c)](_0x4a9420,_0x3173cf);const _0x2947e7=await resolveRuleSegmentRefs(_0x281677,async _0x26d491=>{const _0x43e65d=_0x594161,_0x3fe8f6=_0x5b151b['get'](_0x26d491);if(_0x3fe8f6)return _0x3fe8f6;const _0x717791=await _0x37966e['resolveSegment'](_0x26d491);return _0x717791[_0x43e65d(0x169)];});_0x25d86a={'description':_0x2340f4[_0x594161(0x1dc)],'rule':_0x2947e7};}else{const _0x2eb804=_0x399272[_0x594161(0x15d)](_0x157668);if(_0x2eb804)_0x3173cf=_0x2eb804,_0x5b151b['set'](_0x4a9420,_0x3173cf);else{if(_0x3c5d0c){let _0x21985c=_0x3c5d0c,_0x9997ba=0x2;while(_0x546a05[_0x594161(0x1b3)](_0x21985c)||_0x346be9[_0x594161(0x1b3)](_0x21985c)){_0x21985c=_0x3c5d0c+'_'+_0x9997ba,_0x9997ba++;}_0x546a05[_0x594161(0x1f4)](_0x21985c),_0x3173cf=_0x21985c;}_0x5b151b[_0x594161(0x17c)](_0x4a9420,_0x3173cf),_0x399272[_0x594161(0x17c)](_0x157668,_0x3173cf);const _0x59ad22=await resolveRuleSegmentRefs(_0x281677,async _0x24bdf=>{const _0x965c41=_0x594161,_0x46c29a=_0x5b151b[_0x965c41(0x15d)](_0x24bdf);if(_0x46c29a)return _0x46c29a;const _0x21c1d8=await _0x37966e[_0x965c41(0x118)](_0x24bdf);return _0x21c1d8['name'];});_0x25d86a={'description':_0x2340f4[_0x594161(0x1dc)],'rule':_0x59ad22};}}}return{'name':_0x3173cf,'isJourneyLocal':_0x12c74d,'definition':_0x25d86a};}catch(_0x5a8361){return logger[_0x594161(0x140)]('Failed\x20to\x20resolve\x20segment\x20'+_0x4a9420+':\x20'+_0x5a8361),{'name':_0x4a9420,'isJourneyLocal':![]};}},'resolveActivation':async _0x40c177=>{const _0x4bf2ad=a142_0x3aac,_0x48ccd3=_0xd610d3[_0x4bf2ad(0x15d)](_0x40c177);if(_0x48ccd3!==undefined)return{'name':_0x48ccd3,'isJourneyLocal':!![]};try{let _0x5a75f9=_0x214826?.[_0x4bf2ad(0x15d)](_0x40c177);!_0x5a75f9&&(_0x5a75f9=await _0x52e753[_0x4bf2ad(0x130)][_0x4bf2ad(0x15f)](_0x142f40,_0x40c177));const _0x5ec464=_0x5a75f9[_0x4bf2ad(0x1ab)][_0x4bf2ad(0x144)][_0x4bf2ad(0x169)]||_0x40c177,_0x118e32=sanitizeYamlKey(_0x5ec464)||_0x4bf2ad(0x1c1)+_0x40c177,_0x2df384=_0x118e32;_0xd610d3[_0x4bf2ad(0x17c)](_0x40c177,_0x2df384);const _0x35e11e=journeyActivationStepToYaml(_0x5a75f9,_0x1f3450,_0x4cd951);return{'name':_0x2df384,'isJourneyLocal':!![],'definition':_0x35e11e};}catch(_0x20f0c4){return logger[_0x4bf2ad(0x140)](_0x4bf2ad(0x18d)+_0x40c177+':\x20'+_0x20f0c4),{'name':_0x40c177,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xa2fef0,_0x1e1347)=>resolveJumpTarget(_0xa2fef0,_0x1e1347,_0x336fac,async _0x11572d=>{const _0x8ab498=a142_0x3aac,_0xd811be=_0x4d07dc?.[_0x8ab498(0x15d)](_0x11572d);if(_0xd811be)return _0xd811be;return _0x52e753[_0x8ab498(0x130)][_0x8ab498(0x190)](_0x11572d);})};return _0x37966e=_0x473d05,_0x473d05;},_0x79b02=async _0x210c0f=>{const _0x3fbefe=a142_0x3aac,{collectSegmentIdsFromJourneyApi:_0x1f0f74}=await import('./journey-yaml.js'),{batchAsync:_0xdae00b}=await import(_0x3fbefe(0x162)),_0x3e4eef=new Set();for(const _0x57a561 of _0x210c0f){let _0x260a6e=_0x4d07dc?.['get'](_0x57a561);!_0x260a6e&&(_0x260a6e=await _0x52e753[_0x3fbefe(0x130)][_0x3fbefe(0x190)](_0x57a561));const _0x1691a8=_0x1f0f74(_0x260a6e);for(const _0xc6ab13 of _0x1691a8){_0x3e4eef[_0x3fbefe(0x1f4)](_0xc6ab13);}}let _0x45b591=Array[_0x3fbefe(0x1c2)](_0x3e4eef);while(_0x45b591[_0x3fbefe(0x163)]>0x0){const _0x2e227b=_0x45b591[_0x3fbefe(0x19c)](_0x5eb641=>!_0x2a8c0f[_0x3fbefe(0x1b3)](_0x5eb641));if(_0x2e227b['length']===0x0)break;const _0x2a2b42=await _0xdae00b(_0x2e227b,async _0x3a0484=>{const _0x4886e2=_0x3fbefe;_0x2a8c0f[_0x4886e2(0x1f4)](_0x3a0484);const _0x3e3850=await fetchSegment(_0x52e753,_0x44f456,_0x3a0484,_0x13a2c9);if(!_0x3e3850)return null;return{'segmentId':_0x3a0484,'segment':_0x3e3850};},0xa),_0x323a25=new Set();for(const _0x8c1c5f of _0x2a2b42){if(!_0x8c1c5f?.[_0x3fbefe(0x1c9)]?.[_0x3fbefe(0x1a0)])continue;const _0x1adf6e=apiRuleToYaml(_0x8c1c5f[_0x3fbefe(0x1c9)][_0x3fbefe(0x1a0)]);_0x503a8f['set'](_0x8c1c5f[_0x3fbefe(0x207)],_0x1adf6e);const _0x13aefb=collectSegmentRefsFromRule(_0x1adf6e);for(const _0x5f29ee of _0x13aefb){!_0x2a8c0f['has'](_0x5f29ee)&&_0x323a25[_0x3fbefe(0x1f4)](_0x5f29ee);}}_0x45b591=Array['from'](_0x323a25);}};return{'createYamlContext':_0xcf52e6,'prefetchJourneySegments':_0x79b02};}export async function executePushSegments(_0x102277,_0x3b5718,_0x50abbd,_0x527134,_0x58999a){const _0x210b15=a142_0x469651,{segmentDefToCreateRequest:_0x462cb7,segmentDefToUpdateRequest:_0xb84c38}=await import(_0x210b15(0x119)),_0x43f3cf=_0x50abbd[_0x210b15(0x168)],_0x24c29c=0x5,_0x5708eb=async _0x59feb2=>{const _0x3a30b0=_0x210b15,_0x33e088=_0x59feb2['folderPath']?_0x43f3cf[_0x3a30b0(0x15d)](_0x59feb2[_0x3a30b0(0x183)]):undefined;let _0x5b0f72;const _0x39b8f6={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x19415e=_0x59feb2[_0x3a30b0(0x1b1)];if(_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x1a0)]){const _0x10c21f=createSegmentIdResolver(_0x50abbd['segmentNameToId'],_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]),_0x24a674=await resolveRuleSegmentIds(_0x59feb2['yamlConfig']['rule'],_0x10c21f);_0x19415e={..._0x59feb2[_0x3a30b0(0x1b1)],'rule':_0x24a674};}try{if(_0x59feb2[_0x3a30b0(0x213)]){_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x1ba),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]});const _0x418813=_0x462cb7(_0x19415e,_0x33e088),_0x347d16=await _0x58999a[_0x3a30b0(0x1da)](_0x3a30b0(0x115)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+_0x3a30b0(0x15e),()=>_0x102277['segment'][_0x3a30b0(0x1d3)](_0x527134['parentId'],_0x418813));_0x5b0f72=_0x347d16[_0x3a30b0(0x143)]['id'],_0x50abbd[_0x3a30b0(0x176)][_0x3a30b0(0x17c)](_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],_0x5b0f72),_0x39b8f6[_0x3a30b0(0x172)]={'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],'id':_0x5b0f72},_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x11c),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],'segmentId':_0x5b0f72}),_0x58999a['logSuccess']?.(_0x3a30b0(0x197)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+'\x27'),_0x39b8f6[_0x3a30b0(0x147)]=0x1;}else{if(_0x59feb2[_0x3a30b0(0x1c6)]){_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x1ec),'name':_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]});const _0x17de15=_0xb84c38(_0x19415e);_0x33e088!==_0x59feb2[_0x3a30b0(0x16e)]?.[_0x3a30b0(0x1eb)]&&(_0x17de15['segmentFolderId']=_0x33e088?parseInt(_0x33e088,0xa):undefined),await _0x58999a[_0x3a30b0(0x1da)](_0x3a30b0(0x1bf)+_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]+'\x27...',()=>_0x102277[_0x3a30b0(0x1c9)]['updateSegmentById'](_0x527134[_0x3a30b0(0x1e9)],_0x59feb2[_0x3a30b0(0x16e)]['id'],_0x17de15)),_0x5b0f72=_0x59feb2['existingSegment']['id'],_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x14b),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]}),_0x58999a['logSuccess']?.(_0x3a30b0(0x125)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+'\x27'),_0x39b8f6[_0x3a30b0(0x1ea)]=0x1;}else _0x5b0f72=_0x59feb2[_0x3a30b0(0x16e)]['id'];}}catch(_0xbf39bb){const _0x5c8039=isHttp400Error(_0xbf39bb),_0x5c7bb=_0x5c8039?ErrorCode[_0x3a30b0(0x211)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x117fdd=getErrorMessage(_0xbf39bb);throw new SDKError(_0x5c7bb,_0x3a30b0(0x139)+(_0x59feb2['isNew']?'create':_0x3a30b0(0x1c7))+_0x3a30b0(0x1fa)+_0x59feb2[_0x3a30b0(0x135)]+_0x3a30b0(0x216)+_0x117fdd,_0xbf39bb);}try{const _0x35a56e=await syncActivationsForSegment(_0x102277,_0x527134[_0x3a30b0(0x1e9)],_0x5b0f72,_0x59feb2['yamlConfig'][_0x3a30b0(0x169)],_0x59feb2[_0x3a30b0(0x1f9)],_0x58999a,_0x59feb2[_0x3a30b0(0x135)]);_0x39b8f6[_0x3a30b0(0x116)]=_0x35a56e;}catch(_0x312482){if(_0x312482 instanceof SDKError)throw _0x312482;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+_0x3a30b0(0x158)+_0x59feb2[_0x3a30b0(0x135)]+_0x3a30b0(0x216)+getErrorMessage(_0x312482),_0x312482);}return _0x39b8f6;},_0x141130=await batchAsync(_0x3b5718,_0x5708eb,_0x24c29c),_0x215be9={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x24b0d5 of _0x141130){_0x215be9[_0x210b15(0x147)]+=_0x24b0d5[_0x210b15(0x147)],_0x215be9[_0x210b15(0x1ea)]+=_0x24b0d5[_0x210b15(0x1ea)],_0x24b0d5['createdSegmentId']&&_0x215be9[_0x210b15(0x150)][_0x210b15(0x17c)](_0x24b0d5['createdSegmentId'][_0x210b15(0x169)],_0x24b0d5[_0x210b15(0x172)]['id']),_0x215be9[_0x210b15(0x116)][_0x210b15(0x147)]+=_0x24b0d5['activations'][_0x210b15(0x147)],_0x215be9[_0x210b15(0x116)][_0x210b15(0x1ea)]+=_0x24b0d5[_0x210b15(0x116)][_0x210b15(0x1ea)],_0x215be9[_0x210b15(0x116)][_0x210b15(0x13e)]+=_0x24b0d5[_0x210b15(0x116)]['deleted'];}return _0x215be9;}async function syncActivationsForSegment(_0x41cd76,_0xd63a9f,_0x139df7,_0x2e08a5,_0x343277,_0x31b436,_0x2d600b){const _0x5a3acd=a142_0x469651,_0x56f907={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x403f46 of _0x343277){try{if(_0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1be)&&_0x403f46[_0x5a3acd(0x128)])_0x31b436['onProgress']?.({'type':_0x5a3acd(0x170),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x1e0)+_0x403f46[_0x5a3acd(0x169)]+_0x5a3acd(0x15e),()=>_0x41cd76[_0x5a3acd(0x1c9)][_0x5a3acd(0x198)](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x128)])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x151),'segmentName':_0x2e08a5,'activationName':_0x403f46['name']}),_0x31b436[_0x5a3acd(0x13f)]?.(_0x5a3acd(0x1f6)+_0x403f46[_0x5a3acd(0x169)]+'\x27'),_0x56f907['created']++;else{if(_0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1c7)&&_0x403f46[_0x5a3acd(0x128)]&&_0x403f46['existingActivation'])_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x141),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x126)+_0x403f46[_0x5a3acd(0x169)]+_0x5a3acd(0x15e),()=>_0x41cd76[_0x5a3acd(0x1c9)]['updateActivation'](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x19a)]['id'],_0x403f46[_0x5a3acd(0x128)])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x16b),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),_0x31b436['logSuccess']?.(_0x5a3acd(0x194)+_0x403f46['name']+'\x27'),_0x56f907['updated']++;else _0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1dd)&&_0x403f46[_0x5a3acd(0x19a)]&&(_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x20d),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x1a7)+_0x403f46['name']+_0x5a3acd(0x15e),()=>_0x41cd76['segment'][_0x5a3acd(0x20b)](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x19a)]['id'])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x131),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),_0x31b436['logDeleted']?.(_0x5a3acd(0x1d4)+_0x403f46['name']+'\x27'),_0x56f907[_0x5a3acd(0x13e)]++);}}catch(_0xec65ef){const _0x59ebe0=isHttp400Error(_0xec65ef),_0x2dc913=_0x59ebe0?ErrorCode[_0x5a3acd(0x1f3)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x26dc05=getErrorMessage(_0xec65ef);throw new SDKError(_0x2dc913,'Failed\x20to\x20'+_0x403f46[_0x5a3acd(0x17d)]+'\x20activation\x20\x27'+_0x403f46[_0x5a3acd(0x169)]+'\x27\x20from\x20file:\x20'+_0x2d600b+'\x0a\x20\x20'+_0x26dc05,_0xec65ef);}}return _0x56f907;}export async function executePushFolders(_0x78b3ac,_0x5e3c42,_0x2f1e2d,_0x28998e,_0x4874ba){const _0x31fcdb=a142_0x469651,_0x29b49e=new Map(_0x2f1e2d),_0x1bb309=sortFoldersByDepth(_0x5e3c42);for(const _0x2b1c90 of _0x1bb309){const _0x3f15d4=_0x2b1c90[_0x31fcdb(0x214)]('/'),_0x803694=_0x3f15d4[_0x3f15d4['length']-0x1],_0x317a9f=_0x3f15d4[_0x31fcdb(0x19b)](0x0,-0x1)[_0x31fcdb(0x1c0)]('/'),_0x50eda4=_0x29b49e[_0x31fcdb(0x15d)](_0x317a9f);_0x4874ba[_0x31fcdb(0x189)]?.({'type':_0x31fcdb(0x1ef),'folder':_0x2b1c90});const _0x1e1675={'name':_0x803694,'parentFolderId':_0x50eda4},_0x549fb1=await _0x4874ba['withProgress'](_0x31fcdb(0x186)+_0x2b1c90+_0x31fcdb(0x15e),()=>_0x78b3ac[_0x31fcdb(0x1c9)]['createFolder'](_0x28998e[_0x31fcdb(0x1e9)],_0x1e1675));_0x29b49e[_0x31fcdb(0x17c)](_0x2b1c90,_0x549fb1[_0x31fcdb(0x143)]['id']),_0x4874ba[_0x31fcdb(0x189)]?.({'type':_0x31fcdb(0x1ff),'folder':_0x2b1c90,'folderId':_0x549fb1[_0x31fcdb(0x143)]['id']}),_0x4874ba[_0x31fcdb(0x1e3)]?.(_0x31fcdb(0x1fc)+_0x2b1c90+'\x27');}return _0x29b49e;}export async function executePushSegmentDeletions(_0x22170f,_0x15ee79,_0x19ec0b){const _0x2d1ddb=a142_0x469651;if(_0x15ee79[_0x2d1ddb(0x163)]===0x0)return 0x0;const {batchAsync:_0x341c17}=await import('../../utils/async.js'),_0x4b3198=0x5,_0x40dbac=await _0x341c17(_0x15ee79,async _0x13176b=>{const _0x319caf=_0x2d1ddb;return _0x19ec0b[_0x319caf(0x189)]?.({'type':'segment_deleting','name':_0x13176b[_0x319caf(0x169)]}),await _0x22170f[_0x319caf(0x1c9)][_0x319caf(0x1cb)](_0x13176b['id']),_0x19ec0b[_0x319caf(0x189)]?.({'type':_0x319caf(0x1c8),'name':_0x13176b[_0x319caf(0x169)]}),_0x19ec0b[_0x319caf(0x1d7)]?.(_0x319caf(0x19d)+_0x13176b['name']+'\x27'),0x1;},_0x4b3198);return _0x40dbac['reduce']((_0xf9c909,_0xa28a33)=>_0xf9c909+_0xa28a33,0x0);}export async function executePushJourneys(_0x465a1f,_0x3819f2,_0x57f1c5,_0x559fed,_0x22d484){const _0x117db9=a142_0x469651,{journeyDefToRequest:_0x441766}=await import(_0x117db9(0x1a2)),{activationDefToCreateRequest:_0x5c83b0,yamlRuleToApi:_0x2b70c6,validateSegmentRule:_0x476e99}=await import(_0x117db9(0x119)),_0x908a3d={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2578c0=new Map(_0x57f1c5[_0x117db9(0x176)]),_0x36af2b=0x5;for(let _0x2bc760=0x0;_0x2bc760<_0x3819f2[_0x117db9(0x163)];_0x2bc760+=_0x36af2b){const _0x2310a0=_0x3819f2[_0x117db9(0x19b)](_0x2bc760,_0x2bc760+_0x36af2b),_0x1bb139=await Promise[_0x117db9(0x14f)](_0x2310a0['map'](async _0x940c30=>{const _0x1fc042=_0x117db9;if(!_0x940c30[_0x1fc042(0x213)]&&!_0x940c30[_0x1fc042(0x1c6)])return{'action':_0x1fc042(0x117),'name':_0x940c30[_0x1fc042(0x1b1)]['name'],'journeyId':_0x940c30[_0x1fc042(0x1ce)]?.['id']};const _0x17669e=_0x940c30[_0x1fc042(0x183)]?_0x57f1c5[_0x1fc042(0x168)]['get'](_0x940c30['folderPath']):undefined;_0x22d484[_0x1fc042(0x189)]?.({'type':_0x940c30[_0x1fc042(0x213)]?_0x1fc042(0x1b2):_0x1fc042(0x1a6),'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)]});try{const _0x55884e=await executeSingleJourneyPush(_0x465a1f,_0x940c30,{..._0x57f1c5,'segmentNameToId':_0x2578c0},{'parentId':_0x559fed[_0x1fc042(0x1e9)],'rootFolderId':_0x559fed[_0x1fc042(0x19e)],'folderId':_0x17669e,'verbose':_0x559fed[_0x1fc042(0x1e8)]},_0x22d484,{'journeyDefToRequest':_0x441766,'activationDefToCreateRequest':_0x5c83b0,'yamlRuleToApi':_0x2b70c6,'validateSegmentRule':_0x476e99});for(const [_0x58d672,_0x4af458]of _0x55884e[_0x1fc042(0x209)]){_0x2578c0['set'](_0x58d672,_0x4af458),_0x908a3d[_0x1fc042(0x209)]['set'](_0x58d672,_0x4af458);}if(_0x55884e[_0x1fc042(0x1d6)]===_0x1fc042(0x147))_0x22d484[_0x1fc042(0x189)]?.({'type':_0x1fc042(0x20e),'name':_0x940c30[_0x1fc042(0x1b1)]['name'],'journeyId':_0x55884e[_0x1fc042(0x175)]}),_0x22d484['logSuccess']?.(_0x1fc042(0x1bd)+_0x940c30['yamlConfig'][_0x1fc042(0x169)]+'\x27'),_0x908a3d[_0x1fc042(0x147)]++;else _0x55884e[_0x1fc042(0x1d6)]===_0x1fc042(0x1ea)&&(_0x22d484[_0x1fc042(0x189)]?.({'type':_0x1fc042(0x18c),'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)]}),_0x22d484[_0x1fc042(0x13f)]?.('Updated\x20journey\x20\x27'+_0x940c30['yamlConfig'][_0x1fc042(0x169)]+'\x27'),_0x908a3d[_0x1fc042(0x1ea)]++);return{'action':_0x55884e[_0x1fc042(0x1d6)],'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)],'journeyId':_0x55884e[_0x1fc042(0x175)]};}catch(_0x58f887){const _0x1d697d=isHttp400Error(_0x58f887),_0x1dd67d=_0x1d697d?ErrorCode[_0x1fc042(0x15b)]:ErrorCode[_0x1fc042(0x1fb)],_0x365785=getErrorMessage(_0x58f887);throw new SDKError(_0x1dd67d,_0x1fc042(0x139)+(_0x940c30[_0x1fc042(0x213)]?_0x1fc042(0x1be):'update')+_0x1fc042(0x16f)+_0x940c30[_0x1fc042(0x135)]+_0x1fc042(0x216)+_0x365785,_0x58f887);}}));_0x908a3d[_0x117db9(0x205)]['push'](..._0x1bb139);}return _0x908a3d;}function a142_0x5e0e(){const _0x25158c=['push','list','Segment\x20not\x20found:\x20','valid','createSegment','Deleted\x20activation\x20\x27','toLowerCase','action','logDeleted','utf-8','yamlActivation','withProgress','Activation','description','delete','uniqueServerName','651783QIlbTg','Creating\x20activation\x20\x27','message','localName','logInfo','entry_criteria','journeys','.$1.push-recovery.json','flatMap','verbose','parentId','updated','segmentFolderId','segment_updating','connectionIdToNameMap','schedule','folder_creating','journeyBundleId','relationships','DecisionPoint','ACTIVATION_SYNTAX_ERROR','add','fetchJourney','Created\x20activation\x20\x27','state','match','activationActions','\x20segment\x20from\x20file:\x20','JOURNEY_UPDATE_ERROR','Created\x20folder\x20\x27','activationsBySegmentId','1341150QahPEo','folder_created','run_after_journey_refresh','Failed\x20to\x20fetch\x20referenced\x20segment\x20','36sMAWPn','columns','Matched\x20server\x20segment\x20\x27','results','journeyStages','segmentId','segments','embeddedSegmentNameToId',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','deleteActivation','Segment\x20not\x20found','activation_deleting','journey_created','values','stages','SEGMENT_SYNTAX_ERROR','SEGMENT_NOT_FOUND','isNew','split','Delete\x20the\x20push\x20recovery\x20file\x20(','\x0a\x20\x20','NOT_FOUND','Activation\x20not\x20found:\x20','sort','1173260LSxdtC','Creating\x20segment\x20\x27','activations','unchanged','resolveSegment','./child-segment-yaml.js','3058xuRnuk','stringify','segment_created','folderId','getSegmentEntity','keys','connection','user','item','index','__pending_','Updated\x20segment\x20\x27','Updating\x20activation\x20\x27','existingSegments','validatedRequest','104lCWlXq','__pending_act_','conditionTimeoutDuration','replace','diff','idToEmailMap','26880luKBBE','journey','activation_deleted','parse','\x27\x20decision\x20point\x20branch\x20\x27','all_columns','absolutePath','idToName','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','and\x20the\x20server\x20segment,\x20then\x20retry.','Failed\x20to\x20','INTERNAL','entryCriteria','find','sha1','deleted','logSuccess','debug','activation_updating','updateSegmentById','data','activationParams','journey_entry_criteria_','tdx.sdk.push-workflow','created','getLatestJourneyId','stage\x20\x27','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','segment_updated','\x27\x20milestone','\x27\x20not\x20found\x20in\x20journey\x20\x27','Entry\x20criteria:\x20','all','createdSegmentIds','activation_created','skipSegments','activation_template_id','goal','branches','hex','\x27\x20exit\x20criteria','\x27\x20from\x20file:\x20','createJourneySegment','size','JOURNEY_SYNTAX_ERROR','entry','get','\x27...','getActivation','activationStepsById','notification','../../utils/async.js','length','Condition','nameToType','versionNumber','deps','folderPathToId','name','waitStepType','activation_updated','uniqueSegmentName','connector_config','existingSegment','\x20journey\x20from\x20file:\x20','activation_creating','includes','createdSegmentId','145192eliHSl','milestone','journeyId','segmentNameToId','\x27\x20wait\x20condition','waitStep','nameToId','embedded_segment_created','\x27\x20to\x20local\x20\x27','set','type','journeyBundleName','\x20(referenced\x20in\x20journey\x20','day','\x27\x20for\x20','Embedded\x20segment\x20\x27','folderPath','goal\x20criteria','max','Creating\x20folder\x20\x27','progress','entries','onProgress','embedded_segment_creating','with','journey_updated','Failed\x20to\x20resolve\x20activation\x20','journeyById','isArray','getJourney','Stage\x20\x27','behavior','activationContext','Updated\x20activation\x20\x27','listActivations','journeyActivationStepId','Created\x20segment\x20\x27','createActivation','10iCkJqs','existingActivation','slice','filter','Deleted\x20segment\x20\x27','rootFolderId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','rule','decision_point','./journey-yaml.js','Fetching\x20','394891pjvbxw','parentSegmentFolder','journey_updating','Deleting\x20activation\x20\x27','digest','map','conditionSegmentId','attributes','conditionTimeoutUnit','conditions','parentFolder','waitStepUnit','relative','yamlConfig','journey_creating','has','startsWith','null','Name\x20has\x20already\x20been\x20taken','160335owsVRQ','WaitStep','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','segment_creating','steps','journeyName','Created\x20journey\x20\x27','create','Updating\x20segment\x20\x27','join','activation_','from','exitCriterias','parseDocument','some','hasChanges','update','segment_deleted','segment','resolvedRule','deleteSegment','toISOString','Journey\x20\x27','existingJourney'];a142_0x5e0e=function(){return _0x25158c;};return a142_0x5e0e();}async function matchExistingJourneySegments(_0xacf75e,_0x5d2b72,_0x3d6e70,_0x1ad67f,_0x551aa4){const _0x20dd8f=a142_0x469651;if(!_0x5d2b72[_0x20dd8f(0x1ce)]||!_0x5d2b72[_0x20dd8f(0x1b1)][_0x20dd8f(0x208)])return;const _0x3e2036=new Map(),_0x4c512f=new Set();for(const _0x2b4555 of Object[_0x20dd8f(0x11f)](_0x5d2b72['yamlConfig']['segments'])){const _0x5659a5=generateDeterministicJourneySegmentName(_0x5d2b72[_0x20dd8f(0x1b1)][_0x20dd8f(0x169)],_0x2b4555);_0x3e2036[_0x20dd8f(0x17c)](_0x5659a5,_0x2b4555),_0x4c512f[_0x20dd8f(0x1f4)](_0x2b4555);}const _0x96a302=[],_0xd2ef4d=collectSegmentIdsFromJourneyApi(_0x5d2b72[_0x20dd8f(0x1ce)]);for(const _0x28d909 of _0xd2ef4d){const _0x503c95=await fetchSegment(_0xacf75e,_0x3d6e70,_0x28d909,_0x1ad67f);if(!_0x503c95?.['name'])continue;const _0x4cccc7=_0x3e2036[_0x20dd8f(0x15d)](_0x503c95[_0x20dd8f(0x169)]);_0x4cccc7?(_0x551aa4[_0x20dd8f(0x17c)](_0x4cccc7,_0x28d909),_0x4c512f[_0x20dd8f(0x1dd)](_0x4cccc7)):_0x96a302['push']({'id':_0x28d909,'seg':_0x503c95});}if(_0x4c512f[_0x20dd8f(0x15a)]>0x0&&_0x96a302['length']>0x0){const {localExpandedRuleToNames:_0x40339d}=buildLocalExpandedRuleMappings(_0x5d2b72['yamlConfig']),_0x3cc84d=new Map();for(const {id:_0x986fa7,seg:_0x420576}of _0x96a302){if(_0x420576[_0x20dd8f(0x1a0)]){const _0x55c860=apiRuleToYaml(_0x420576[_0x20dd8f(0x1a0)]);_0x3cc84d['set'](_0x986fa7,_0x55c860);}}for(const {id:_0x2ca11b,seg:_0xbded35}of _0x96a302){if(!_0xbded35[_0x20dd8f(0x1a0)])continue;const _0x297c62=_0x3cc84d['get'](_0x2ca11b);if(!_0x297c62)continue;const _0x402a2a=serializeExpandedRule(_0x297c62,_0x3cc84d),_0x2aad22=_0x40339d[_0x20dd8f(0x15d)](_0x402a2a);if(_0x2aad22){const _0x54f287=_0x2aad22[_0x20dd8f(0x13c)](_0x338ea2=>_0x4c512f['has'](_0x338ea2));_0x54f287&&(_0x551aa4['set'](_0x54f287,_0x2ca11b),_0x4c512f[_0x20dd8f(0x1dd)](_0x54f287),logger[_0x20dd8f(0x140)](_0x20dd8f(0x204)+_0xbded35['name']+_0x20dd8f(0x17b)+_0x54f287+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x5208b1,_0xc79c30,_0x56c4a5,_0x31089b,_0xadf956,_0x89e34){const _0x5c31f1=a142_0x469651,{journeyDefToRequest:_0x80555,activationDefToCreateRequest:_0x2d280b,yamlRuleToApi:_0x3f5555,validateSegmentRule:_0x25cc2a}=_0x89e34,_0x3c572f=new Map(),_0x134d4f=new Map();recoverSegmentIdsFromPushRecovery(_0xc79c30,_0x3c572f,_0x56c4a5[_0x5c31f1(0x176)]);const _0x30a32b=new Map(),_0x588975=new Map(),_0x3d79d1=new Map();let _0x48fadc;const _0x20e9cc=async()=>{const _0x51a6b4=_0x5c31f1;if(_0x48fadc)return;_0x48fadc=new Map();if(!_0xc79c30['existingJourney'])return;const _0x3951b0=await _0x5208b1[_0x51a6b4(0x130)][_0x51a6b4(0x195)](_0xc79c30[_0x51a6b4(0x1ce)]['id']);for(const _0x93e678 of _0x3951b0){const _0x1754ff=journeyActivationStepToYaml(_0x93e678,_0x56c4a5[_0x51a6b4(0x12e)],_0x56c4a5[_0x51a6b4(0x1ed)]),_0x92e7d4=activationSignature(_0x1754ff);!_0x48fadc[_0x51a6b4(0x1b3)](_0x92e7d4)&&_0x48fadc[_0x51a6b4(0x17c)](_0x92e7d4,_0x93e678['id']),_0x1754ff['name']&&_0x134d4f[_0x51a6b4(0x17c)](_0x1754ff['name'],_0x93e678['id']);}};await matchExistingJourneySegments(_0x5208b1,_0xc79c30,_0x31089b[_0x5c31f1(0x1e9)],_0x56c4a5[_0x5c31f1(0x127)],_0x56c4a5[_0x5c31f1(0x176)]);const _0x5ef7b5={'resolveSegmentId':async _0x49f5bb=>{const _0x10be93=_0x5c31f1,_0x46f6fe=_0x56c4a5[_0x10be93(0x176)][_0x10be93(0x15d)](_0x49f5bb);if(!_0x46f6fe)throw new SDKError(ErrorCode[_0x10be93(0x212)],_0x10be93(0x1d1)+_0x49f5bb+_0x10be93(0x17f)+_0xc79c30[_0x10be93(0x1b1)][_0x10be93(0x169)]+')');return _0x46f6fe;},'resolveEmbeddedSegmentId':async(_0x2e684d,_0x4d343c)=>{const _0x2eaaf1=_0x5c31f1,_0x151146=_0x56c4a5[_0x2eaaf1(0x176)][_0x2eaaf1(0x15d)](_0x2e684d);if(_0x151146)return _0x151146;const _0x5b5ef3=_0x56c4a5[_0x2eaaf1(0x127)]['find'](_0x244848=>_0x244848[_0x2eaaf1(0x169)]===_0x2e684d);if(_0x5b5ef3)return _0x56c4a5[_0x2eaaf1(0x176)][_0x2eaaf1(0x17c)](_0x2e684d,_0x5b5ef3['id']),_0x5b5ef3['id'];if(_0xc79c30['isNew']){const {stageName:_0x41f0c5,criteriaName:_0x1748d1}=findSegmentCriteriaLocation(_0xc79c30[_0x2eaaf1(0x1b1)],_0x2e684d);return _0x25cc2a(_0x2e684d,_0x4d343c[_0x2eaaf1(0x1a0)]),_0x588975[_0x2eaaf1(0x17c)](_0x2e684d,{'definition':_0x4d343c,'stageName':_0x41f0c5,'criteriaName':_0x1748d1}),createPendingSegmentId(_0x2e684d);}const _0x3c86b2=_0xc79c30[_0x2eaaf1(0x1ce)]?.['id'];if(!_0x3c86b2)throw new SDKError(ErrorCode[_0x2eaaf1(0x13a)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x300292=_0x30a32b[_0x2eaaf1(0x15d)](_0x2e684d);if(_0x300292)return _0x300292;const _0x1a3d4a=((async()=>{const _0x4ad744=_0x2eaaf1;_0x25cc2a(_0x2e684d,_0x4d343c['rule']);const _0x4b4c99=generateDeterministicJourneySegmentName(_0xc79c30[_0x4ad744(0x1b1)][_0x4ad744(0x169)],_0x2e684d),_0xcbca0a=_0x56c4a5[_0x4ad744(0x127)][_0x4ad744(0x13c)](_0x249f59=>_0x249f59[_0x4ad744(0x169)]===_0x4b4c99),_0x24c567=createSegmentIdResolver(_0x56c4a5['segmentNameToId'],_0x2e684d),_0xe3d121=await resolveRuleSegmentIds(_0x4d343c[_0x4ad744(0x1a0)],_0x24c567);let _0x320e40;return _0xcbca0a?(await _0x5208b1['segment'][_0x4ad744(0x142)](_0x31089b[_0x4ad744(0x1e9)],_0xcbca0a['id'],{'description':_0x4d343c[_0x4ad744(0x1dc)]||'Entry\x20criteria:\x20'+_0x2e684d,'rule':_0x3f5555(_0xe3d121,!![]),'countPopulation':!![]}),_0x320e40=_0xcbca0a['id'],saveSegmentToPushRecovery(_0xc79c30['absolutePath'],_0xc79c30[_0x4ad744(0x1b1)][_0x4ad744(0x169)],_0x2e684d,{'segmentId':_0x320e40,'uniqueServerName':_0x4b4c99,'createdAt':new Date()['toISOString']()})):_0x320e40=await createOrRecoverEmbeddedSegment(_0x5208b1,_0xc79c30,{'localName':_0x2e684d,'uniqueSegmentName':_0x4b4c99,'description':_0x4d343c[_0x4ad744(0x1dc)]||_0x4ad744(0x14e)+_0x2e684d,'journeyId':_0x3c86b2,'resolvedRule':_0xe3d121,'parentId':_0x31089b[_0x4ad744(0x1e9)],'folderId':_0x31089b[_0x4ad744(0x19e)]||''},_0x3f5555),_0x56c4a5['segmentNameToId'][_0x4ad744(0x17c)](_0x2e684d,_0x320e40),_0x3c572f[_0x4ad744(0x17c)](_0x2e684d,_0x320e40),_0x320e40;})());_0x30a32b[_0x2eaaf1(0x17c)](_0x2e684d,_0x1a3d4a);try{return await _0x1a3d4a;}finally{_0x30a32b['delete'](_0x2e684d);}},'resolveActivationId':async _0x556c26=>{const _0x440125=_0x5c31f1,_0xd04d3d=_0x134d4f[_0x440125(0x15d)](_0x556c26);if(_0xd04d3d)return _0xd04d3d;if(_0xc79c30[_0x440125(0x1ce)]){await _0x20e9cc();const _0x5c20a9=_0x134d4f[_0x440125(0x15d)](_0x556c26);if(_0x5c20a9)return _0x5c20a9;}throw new SDKError(ErrorCode[_0x440125(0x217)],_0x440125(0x112)+_0x556c26+_0x440125(0x17f)+_0xc79c30['yamlConfig'][_0x440125(0x169)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x3f008,_0x3ba41d)=>{const _0x7fc5be=_0x5c31f1,_0x302501=_0x134d4f[_0x7fc5be(0x15d)](_0x3f008);if(_0x302501)return _0x302501;if(_0xc79c30[_0x7fc5be(0x213)])return _0x3d79d1[_0x7fc5be(0x17c)](_0x3f008,_0x3ba41d),createPendingActivationId(_0x3f008);if(_0xc79c30[_0x7fc5be(0x1ce)]){await _0x20e9cc();const _0x4fa23e=_0x134d4f[_0x7fc5be(0x15d)](_0x3ba41d[_0x7fc5be(0x169)]);if(_0x4fa23e)return _0x134d4f[_0x7fc5be(0x17c)](_0x3f008,_0x4fa23e),_0x4fa23e;const _0x170f1d=activationSignature(_0x3ba41d),_0x39cfef=_0x48fadc?.['get'](_0x170f1d);if(_0x39cfef)return _0x134d4f['set'](_0x3f008,_0x39cfef),_0x39cfef;const _0x44e295=await _0x2d280b(_0x3ba41d,_0x56c4a5[_0x7fc5be(0x193)]),_0xbf2f4c={..._0x44e295,..._0x3ba41d[_0x7fc5be(0x200)]!==undefined&&{'runAfterJourneyRefresh':_0x3ba41d[_0x7fc5be(0x200)]}},_0x1efc2a=await _0x5208b1[_0x7fc5be(0x130)][_0x7fc5be(0x198)](_0xc79c30[_0x7fc5be(0x1ce)]['id'],_0xbf2f4c);return _0x134d4f[_0x7fc5be(0x17c)](_0x3f008,_0x1efc2a['id']),_0x1efc2a['id'];}throw new SDKError(ErrorCode[_0x7fc5be(0x13a)],_0x7fc5be(0x137));},'resolveJourneyId':async _0x17928f=>{const _0x8f1720=_0x5c31f1;try{return await _0x5208b1[_0x8f1720(0x130)]['resolveJourneyId'](_0x31089b[_0x8f1720(0x1e9)],_0x17928f);}catch(_0xd1bea){throw new SDKError(ErrorCode[_0x8f1720(0x217)],_0x8f1720(0x1cd)+_0x17928f+_0x8f1720(0x1b9)+_0xc79c30[_0x8f1720(0x1b1)][_0x8f1720(0x169)]+'\x27)',_0xd1bea);}},'resolveStageId':async(_0x61ca62,_0x18509a)=>{const _0x1cef65=_0x5c31f1,_0x5df8b1=await _0x5208b1[_0x1cef65(0x130)]['getJourney'](_0x61ca62),_0x38996f=_0x5df8b1['attributes']['journeyStages'][_0x1cef65(0x13c)](_0x473b11=>_0x473b11['name'][_0x1cef65(0x1d5)]()===_0x18509a[_0x1cef65(0x1d5)]());if(!_0x38996f?.['id'])throw new SDKError(ErrorCode[_0x1cef65(0x217)],_0x1cef65(0x191)+_0x18509a+_0x1cef65(0x14d)+(_0x5df8b1[_0x1cef65(0x1ab)][_0x1cef65(0x17e)]||_0x5df8b1[_0x1cef65(0x1ab)]['name'])+'\x27');return _0x38996f['id'];}},_0x1ef27e=await _0x80555(_0xc79c30[_0x5c31f1(0x1b1)],_0x31089b[_0x5c31f1(0x1e9)],_0x5ef7b5),_0xf53c10=_0x31089b[_0x5c31f1(0x11d)]||_0x31089b[_0x5c31f1(0x19e)];_0xf53c10&&(_0x1ef27e[_0x5c31f1(0x1f1)]={'parentFolder':{'data':{'id':_0xf53c10,'type':'folder'}}});if(_0xc79c30[_0x5c31f1(0x213)]){if(_0x588975[_0x5c31f1(0x15a)]>0x0||_0x3d79d1[_0x5c31f1(0x15a)]>0x0)return await executeThreeStepJourneyCreate(_0x5208b1,_0xc79c30,_0x1ef27e,{'pendingEmbeddedSegments':_0x588975,'pendingEmbeddedActivations':_0x3d79d1,'embeddedSegmentNameToId':_0x3c572f,'journeyActivationNameToId':_0x134d4f},{..._0x31089b,'effectiveFolderId':_0xf53c10},_0x56c4a5,_0xadf956,_0x89e34);else{ensureJourneyDefaults(_0x1ef27e[_0x5c31f1(0x1ab)]);const _0x4c571d=await _0x5208b1[_0x5c31f1(0x130)][_0x5c31f1(0x1be)](_0x1ef27e);return deletePushRecovery(_0xc79c30[_0x5c31f1(0x135)]),{'action':_0x5c31f1(0x147),'journeyId':_0x4c571d['id'],'embeddedSegmentNameToId':_0x3c572f};}}else{if(_0xc79c30[_0x5c31f1(0x1c6)]&&_0xc79c30[_0x5c31f1(0x1ce)]){_0x1ef27e['id']=_0xc79c30['existingJourney']['id'];const _0x128fe6=_0x1ef27e[_0x5c31f1(0x1ab)];_0xc79c30['existingJourney'][_0x5c31f1(0x1ab)]?.[_0x5c31f1(0x17e)]&&(_0x128fe6[_0x5c31f1(0x17e)]=_0xc79c30['existingJourney']['attributes'][_0x5c31f1(0x17e)]);const _0x3e4fac=_0xc79c30[_0x5c31f1(0x1ce)][_0x5c31f1(0x1ab)]?.[_0x5c31f1(0x206)];return _0x3e4fac&&_0x1ef27e[_0x5c31f1(0x1ab)][_0x5c31f1(0x206)]&&injectExistingStageIds(_0x1ef27e[_0x5c31f1(0x1ab)][_0x5c31f1(0x206)],_0x3e4fac),ensureJourneyDefaults(_0x128fe6),await _0x5208b1[_0x5c31f1(0x130)]['update'](_0xc79c30[_0x5c31f1(0x1ce)]['id'],_0x1ef27e),deletePushRecovery(_0xc79c30[_0x5c31f1(0x135)]),{'action':_0x5c31f1(0x1ea),'journeyId':_0xc79c30['existingJourney']['id'],'embeddedSegmentNameToId':_0x3c572f};}}return deletePushRecovery(_0xc79c30['absolutePath']),{'action':_0x5c31f1(0x117),'journeyId':_0xc79c30[_0x5c31f1(0x1ce)]?.['id'],'embeddedSegmentNameToId':_0x3c572f};}function findSegmentCriteriaLocation(_0x43f4e6,_0x134e2c){const _0x391154=a142_0x469651,_0x65b639=_0x43f4e6[_0x391154(0x210)]||_0x43f4e6[_0x391154(0x1e5)]?.[0x0]?.['stages']||[];let _0x474a9a=_0x391154(0x15c),_0x4551bb=_0x134e2c;const _0xd4dc28=_0x43f4e6[_0x391154(0x154)]||_0x43f4e6[_0x391154(0x1e5)]?.[0x0]?.[_0x391154(0x154)];if(_0xd4dc28?.[_0x391154(0x1c9)]===_0x134e2c)return{'stageName':_0x391154(0x154),'criteriaName':_0xd4dc28[_0x391154(0x169)]||_0x134e2c};_0x40ad69:for(const _0x3074f0 of _0x65b639){if(_0x3074f0[_0x391154(0x1e4)]?.[_0x391154(0x1c9)]===_0x134e2c){_0x474a9a=_0x3074f0['name'],_0x4551bb=_0x3074f0['entry_criteria'][_0x391154(0x169)]||_0x134e2c;break;}if(_0x3074f0['steps'])for(const _0x526134 of _0x3074f0[_0x391154(0x1bb)]){if(_0x526134['type']===_0x391154(0x1a1)&&_0x526134['with']?.[_0x391154(0x155)])for(const _0x3b2417 of _0x526134[_0x391154(0x18b)][_0x391154(0x155)]){if(_0x3b2417[_0x391154(0x1c9)]===_0x134e2c){_0x474a9a=_0x3074f0[_0x391154(0x169)],_0x4551bb=_0x3b2417['name']||_0x134e2c;break _0x40ad69;}}}}return{'stageName':_0x474a9a,'criteriaName':_0x4551bb};}async function executeThreeStepJourneyCreate(_0x3dc8e3,_0x1a7c1c,_0x570033,_0x5d5e55,_0x2fea0f,_0x531a4c,_0x34cf38,_0x4ccb75){const _0xd9d129=a142_0x469651,{activationDefToCreateRequest:_0x4de568,yamlRuleToApi:_0x5be04c}=_0x4ccb75,{pendingEmbeddedSegments:_0x4cd59b,pendingEmbeddedActivations:_0x477c39,embeddedSegmentNameToId:_0x4c4771}=_0x5d5e55,_0x42aefa=JSON['parse'](JSON[_0xd9d129(0x11b)](_0x570033));ensureJourneyDefaults(_0x42aefa[_0xd9d129(0x1ab)]),stripPendingIds(_0x42aefa);const _0x56c634=await _0x3dc8e3['journey'][_0xd9d129(0x1be)](_0x42aefa),_0x129956=_0x56c634['id'],_0x373a04=new Map();for(const _0x29e8ae of _0x56c634[_0xd9d129(0x1ab)]['journeyStages']){_0x373a04[_0xd9d129(0x17c)](_0x29e8ae[_0xd9d129(0x169)][_0xd9d129(0x1d5)](),_0x29e8ae['id']);}recoverSegmentIdsFromPushRecovery(_0x1a7c1c,_0x4c4771,_0x531a4c['segmentNameToId']);for(const [_0x37a118,{definition:_0x5de882}]of _0x4cd59b){if(_0x4c4771[_0xd9d129(0x1b3)](_0x37a118)){_0x34cf38['onProgress']?.({'type':_0xd9d129(0x17a),'journeyName':_0x1a7c1c[_0xd9d129(0x1b1)]['name'],'segmentName':_0x37a118});continue;}const _0x5395f4=generateDeterministicJourneySegmentName(_0x1a7c1c['yamlConfig'][_0xd9d129(0x169)],_0x37a118);_0x34cf38[_0xd9d129(0x189)]?.({'type':_0xd9d129(0x18a),'journeyName':_0x1a7c1c['yamlConfig']['name'],'segmentName':_0x37a118});const _0x337c50=createSegmentIdResolver(_0x531a4c[_0xd9d129(0x176)],_0x37a118),_0x2acf27=await resolveRuleSegmentIds(_0x5de882[_0xd9d129(0x1a0)],_0x337c50),_0x581d99=await createOrRecoverEmbeddedSegment(_0x3dc8e3,_0x1a7c1c,{'localName':_0x37a118,'uniqueSegmentName':_0x5395f4,'description':_0x5de882[_0xd9d129(0x1dc)]||'Entry\x20criteria:\x20'+_0x37a118,'journeyId':_0x129956,'resolvedRule':_0x2acf27,'parentId':_0x2fea0f[_0xd9d129(0x1e9)],'folderId':_0x2fea0f['effectiveFolderId']||''},_0x5be04c);_0x4c4771[_0xd9d129(0x17c)](_0x37a118,_0x581d99),_0x531a4c[_0xd9d129(0x176)]['set'](_0x37a118,_0x581d99),_0x34cf38[_0xd9d129(0x189)]?.({'type':_0xd9d129(0x17a),'journeyName':_0x1a7c1c[_0xd9d129(0x1b1)][_0xd9d129(0x169)],'segmentName':_0x37a118});}const _0x216d96=new Map();for(const [_0x5c6194,_0x307c72]of _0x477c39){_0x34cf38[_0xd9d129(0x189)]?.({'type':'embedded_activation_creating','journeyName':_0x1a7c1c[_0xd9d129(0x1b1)]['name'],'activationName':_0x5c6194});const _0x4fccfa=await _0x4de568(_0x307c72,_0x531a4c[_0xd9d129(0x193)]),_0x1b7974={..._0x4fccfa,..._0x307c72[_0xd9d129(0x200)]!==undefined&&{'runAfterJourneyRefresh':_0x307c72[_0xd9d129(0x200)]}},_0xca1eb5=await _0x3dc8e3[_0xd9d129(0x130)][_0xd9d129(0x198)](_0x129956,_0x1b7974);_0x216d96[_0xd9d129(0x17c)](_0x5c6194,_0xca1eb5['id']),_0x5d5e55['journeyActivationNameToId'][_0xd9d129(0x17c)](_0x5c6194,_0xca1eb5['id']),_0x34cf38[_0xd9d129(0x189)]?.({'type':'embedded_activation_created','journeyName':_0x1a7c1c[_0xd9d129(0x1b1)][_0xd9d129(0x169)],'activationName':_0x5c6194});}const _0x7fccc7=JSON[_0xd9d129(0x132)](JSON[_0xd9d129(0x11b)](_0x570033));return _0x7fccc7['id']=_0x129956,ensureJourneyDefaults(_0x7fccc7[_0xd9d129(0x1ab)]),resolvePendingIdsInRequest(_0x7fccc7,_0x570033,_0x373a04,_0x4c4771,_0x216d96,_0x34cf38),await _0x3dc8e3['journey'][_0xd9d129(0x1c7)](_0x129956,_0x7fccc7),deletePushRecovery(_0x1a7c1c[_0xd9d129(0x135)]),{'action':_0xd9d129(0x147),'journeyId':_0x129956,'embeddedSegmentNameToId':_0x4c4771};}export function stripWaitStepPendingIds(_0x3bc1a0){const _0x5202d9=a142_0x469651,_0x1b8348=_0x3bc1a0[_0x5202d9(0x1aa)]&&isPendingSegmentId(_0x3bc1a0[_0x5202d9(0x1aa)]),_0x507871=_0x3bc1a0[_0x5202d9(0x1ad)]?.[_0x5202d9(0x1c5)](_0x58b6a0=>_0x58b6a0[_0x5202d9(0x207)]&&isPendingSegmentId(_0x58b6a0['segmentId']));(_0x1b8348||_0x507871)&&(_0x3bc1a0[_0x5202d9(0x16a)]='Duration',_0x3bc1a0[_0x5202d9(0x178)]=0x1,_0x3bc1a0[_0x5202d9(0x1af)]=_0x5202d9(0x180),delete _0x3bc1a0['conditionSegmentId'],delete _0x3bc1a0['conditionTimeoutDuration'],delete _0x3bc1a0[_0x5202d9(0x1ac)],delete _0x3bc1a0[_0x5202d9(0x1ad)]);}function a142_0x3aac(_0x2b98f2,_0x3c4d93){_0x2b98f2=_0x2b98f2-0x112;const _0x5e0eb0=a142_0x5e0e();let _0x3aac58=_0x5e0eb0[_0x2b98f2];return _0x3aac58;}export function resolveWaitStepPendingIds(_0x314f77,_0x42675c,_0x3e68ad,_0x4266a5){const _0xe8a821=a142_0x469651;if(_0x42675c[_0xe8a821(0x1aa)]&&isPendingSegmentId(_0x42675c[_0xe8a821(0x1aa)])){const _0x267553=_0x3e68ad(_0x42675c['conditionSegmentId'],_0xe8a821(0x149)+_0x4266a5+_0xe8a821(0x177));_0x267553&&(_0x314f77[_0xe8a821(0x16a)]=_0xe8a821(0x164),_0x314f77[_0xe8a821(0x1aa)]=_0x267553,delete _0x314f77[_0xe8a821(0x178)],delete _0x314f77['waitStepUnit'],_0x42675c[_0xe8a821(0x12b)]!==undefined&&(_0x314f77[_0xe8a821(0x12b)]=_0x42675c['conditionTimeoutDuration']),_0x42675c[_0xe8a821(0x1ac)]&&(_0x314f77[_0xe8a821(0x1ac)]=_0x42675c[_0xe8a821(0x1ac)]));}if(_0x42675c[_0xe8a821(0x1ad)]){const _0x59fa05=_0x42675c['conditions'][_0xe8a821(0x1c5)](_0x428f88=>_0x428f88[_0xe8a821(0x207)]&&isPendingSegmentId(_0x428f88[_0xe8a821(0x207)]));if(_0x59fa05){const _0x422f46=_0x42675c['conditions'][_0xe8a821(0x1a9)](_0x5b9ad3=>{const _0x476360=_0xe8a821;if(_0x5b9ad3['segmentId']&&isPendingSegmentId(_0x5b9ad3['segmentId'])){const _0x40a4a=_0x3e68ad(_0x5b9ad3[_0x476360(0x207)],'stage\x20\x27'+_0x4266a5+_0x476360(0x177));return{..._0x5b9ad3,'segmentId':_0x40a4a||_0x5b9ad3[_0x476360(0x207)]};}return{..._0x5b9ad3};});_0x314f77[_0xe8a821(0x16a)]=_0xe8a821(0x164),_0x314f77[_0xe8a821(0x1ad)]=_0x422f46,delete _0x314f77[_0xe8a821(0x178)],delete _0x314f77[_0xe8a821(0x1af)],delete _0x314f77[_0xe8a821(0x1aa)],delete _0x314f77[_0xe8a821(0x12b)],delete _0x314f77[_0xe8a821(0x1ac)];}}}function stripPendingIds(_0x162071){const _0x4ee1a5=a142_0x469651;_0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)]?.[_0x4ee1a5(0x207)]&&isPendingSegmentId(_0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)][_0x4ee1a5(0x207)])&&delete _0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)];for(const _0x1c7d14 of _0x162071['attributes'][_0x4ee1a5(0x206)]||[]){_0x1c7d14[_0x4ee1a5(0x13b)]?.[_0x4ee1a5(0x207)]&&isPendingSegmentId(_0x1c7d14[_0x4ee1a5(0x13b)][_0x4ee1a5(0x207)])&&delete _0x1c7d14[_0x4ee1a5(0x13b)];_0x1c7d14[_0x4ee1a5(0x174)]?.['segmentId']&&isPendingSegmentId(_0x1c7d14[_0x4ee1a5(0x174)][_0x4ee1a5(0x207)])&&delete _0x1c7d14[_0x4ee1a5(0x174)];_0x1c7d14[_0x4ee1a5(0x1c3)]&&(_0x1c7d14['exitCriterias']=_0x1c7d14[_0x4ee1a5(0x1c3)][_0x4ee1a5(0x19c)](_0x18687f=>!_0x18687f['segmentId']||!isPendingSegmentId(_0x18687f[_0x4ee1a5(0x207)])));if(_0x1c7d14[_0x4ee1a5(0x1bb)])for(const _0x25ce59 of Object['keys'](_0x1c7d14[_0x4ee1a5(0x1bb)])){const _0x5e0c80=_0x1c7d14[_0x4ee1a5(0x1bb)][_0x25ce59];_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1db)&&_0x5e0c80['journeyActivationStepId']&&isPendingActivationId(_0x5e0c80[_0x4ee1a5(0x196)])&&(_0x5e0c80[_0x4ee1a5(0x196)]='');if(_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1f2)&&_0x5e0c80['branches'])for(const _0x215704 of _0x5e0c80[_0x4ee1a5(0x155)]){_0x215704['segmentId']&&isPendingSegmentId(_0x215704[_0x4ee1a5(0x207)])&&(_0x215704[_0x4ee1a5(0x207)]='');}_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1b8)&&stripWaitStepPendingIds(_0x5e0c80);}}}function resolvePendingIdsInRequest(_0x59eb7e,_0x72bd,_0x292a9a,_0x826b22,_0x323967,_0x487459){const _0x552240=a142_0x469651,_0x333cfa=(_0x563959,_0x41cdf8)=>{const _0x57e520=a142_0x3aac;if(!isPendingSegmentId(_0x563959))return _0x563959;const _0x452bac=extractPendingSegmentName(_0x563959),_0x46251c=_0x826b22[_0x57e520(0x15d)](_0x452bac);return!_0x46251c&&_0x487459['logWarning']?.(_0x57e520(0x19f)+_0x452bac+_0x57e520(0x181)+_0x41cdf8),_0x46251c;};if(_0x59eb7e[_0x552240(0x1ab)][_0x552240(0x154)]?.['segmentId']&&isPendingSegmentId(_0x59eb7e[_0x552240(0x1ab)]['goal'][_0x552240(0x207)])){const _0x187bc5=_0x333cfa(_0x59eb7e['attributes'][_0x552240(0x154)][_0x552240(0x207)],_0x552240(0x184));_0x187bc5&&(_0x59eb7e[_0x552240(0x1ab)][_0x552240(0x154)][_0x552240(0x207)]=_0x187bc5);}for(const _0x570098 of _0x59eb7e[_0x552240(0x1ab)]['journeyStages']||[]){const _0x5ed57e=_0x292a9a['get'](_0x570098['name'][_0x552240(0x1d5)]());_0x5ed57e&&(_0x570098['id']=_0x5ed57e);if(_0x570098[_0x552240(0x13b)]?.[_0x552240(0x207)]&&isPendingSegmentId(_0x570098[_0x552240(0x13b)][_0x552240(0x207)])){const _0x5e4f10=_0x333cfa(_0x570098['entryCriteria'][_0x552240(0x207)],'stage\x20\x27'+_0x570098['name']+'\x27\x20entry\x20criteria');_0x5e4f10&&(_0x570098[_0x552240(0x13b)][_0x552240(0x207)]=_0x5e4f10);}if(_0x570098['exitCriterias'])for(const _0x410532 of _0x570098['exitCriterias']){if(_0x410532[_0x552240(0x207)]&&isPendingSegmentId(_0x410532[_0x552240(0x207)])){const _0x4c7336=_0x333cfa(_0x410532[_0x552240(0x207)],'stage\x20\x27'+_0x570098[_0x552240(0x169)]+_0x552240(0x157));_0x4c7336&&(_0x410532[_0x552240(0x207)]=_0x4c7336);}}if(_0x570098[_0x552240(0x174)]?.['segmentId']&&isPendingSegmentId(_0x570098['milestone']['segmentId'])){const _0x5beb82=_0x333cfa(_0x570098[_0x552240(0x174)]['segmentId'],_0x552240(0x149)+_0x570098[_0x552240(0x169)]+_0x552240(0x14c));_0x5beb82&&(_0x570098[_0x552240(0x174)]['segmentId']=_0x5beb82);}if(_0x570098[_0x552240(0x1bb)]){const _0x6767cc=_0x550e46=>_0x72bd[_0x552240(0x1ab)][_0x552240(0x206)]?.[_0x552240(0x13c)](_0x1a58c0=>_0x1a58c0[_0x552240(0x169)][_0x552240(0x1d5)]()===_0x570098[_0x552240(0x169)][_0x552240(0x1d5)]())?.[_0x552240(0x1bb)]?.[_0x550e46];for(const _0x164f60 of Object[_0x552240(0x11f)](_0x570098[_0x552240(0x1bb)])){const _0x3cd428=_0x570098[_0x552240(0x1bb)][_0x164f60],_0x32ac7f=_0x6767cc(_0x164f60);if(_0x3cd428['type']==='Activation'&&_0x3cd428['journeyActivationStepId']&&(isPendingActivationId(_0x3cd428[_0x552240(0x196)])||_0x3cd428[_0x552240(0x196)]==='')){if(_0x32ac7f?.[_0x552240(0x196)]&&isPendingActivationId(_0x32ac7f[_0x552240(0x196)])){const _0x23360b=extractPendingActivationName(_0x32ac7f[_0x552240(0x196)]),_0x1ce41c=_0x323967['get'](_0x23360b);_0x1ce41c&&(_0x3cd428[_0x552240(0x196)]=_0x1ce41c);}}if(_0x3cd428[_0x552240(0x17d)]===_0x552240(0x1f2)&&_0x3cd428['branches']&&_0x32ac7f?.[_0x552240(0x155)])for(let _0x6b6d59=0x0;_0x6b6d59<_0x3cd428[_0x552240(0x155)][_0x552240(0x163)];_0x6b6d59++){const _0x1d2b86=_0x3cd428[_0x552240(0x155)][_0x6b6d59],_0x4e23bb=_0x32ac7f['branches'][_0x6b6d59];if(_0x4e23bb?.[_0x552240(0x207)]&&isPendingSegmentId(_0x4e23bb[_0x552240(0x207)])){const _0xd2b383=_0x333cfa(_0x4e23bb[_0x552240(0x207)],_0x552240(0x149)+_0x570098[_0x552240(0x169)]+_0x552240(0x133)+(_0x1d2b86[_0x552240(0x169)]||_0x6b6d59)+'\x27');_0xd2b383&&(_0x1d2b86[_0x552240(0x207)]=_0xd2b383);}}_0x3cd428['type']===_0x552240(0x1b8)&&_0x32ac7f?.[_0x552240(0x17d)]==='WaitStep'&&resolveWaitStepPendingIds(_0x3cd428,_0x32ac7f,_0x333cfa,_0x570098['name']);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a143_0x54e1(_0x4da9ec,_0x2a9330){_0x4da9ec=_0x4da9ec-0xc3;const _0x57ddd7=a143_0x57dd();let _0x54e15c=_0x57ddd7[_0x4da9ec];return _0x54e15c;}(function(_0xba1141,_0x4e504c){const _0x49783b=a143_0x54e1,_0x13ad42=_0xba1141();while(!![]){try{const _0x4064f3=-parseInt(_0x49783b(0xd1))/0x1*(-parseInt(_0x49783b(0xc6))/0x2)+parseInt(_0x49783b(0xc4))/0x3*(parseInt(_0x49783b(0xce))/0x4)+-parseInt(_0x49783b(0xc9))/0x5+-parseInt(_0x49783b(0xcd))/0x6*(parseInt(_0x49783b(0xcb))/0x7)+-parseInt(_0x49783b(0xd2))/0x8+parseInt(_0x49783b(0xcc))/0x9+parseInt(_0x49783b(0xca))/0xa;if(_0x4064f3===_0x4e504c)break;else _0x13ad42['push'](_0x13ad42['shift']());}catch(_0x43424e){_0x13ad42['push'](_0x13ad42['shift']());}}}(a143_0x57dd,0x94ac2));function a143_0x57dd(){const _0xab8ebf=['has','add','2482410XFglEU','3430560pAtyYQ','4087489Eohzhc','8646129acNPGs','6xEdFqo','1170164SfICVR','set','name','505pwKrwj','8898200BzJbhb','parentFolderId','12hEfHiy','get','1298aFZaSQ'];a143_0x57dd=function(){return _0xab8ebf;};return a143_0x57dd();}export function buildFolderIdToPathMap(_0x3a7e0d){const _0x22f533=a143_0x54e1,_0x5d578f=new Map(),_0x417fe6=new Map();for(const _0x5b63b9 of _0x3a7e0d){_0x417fe6[_0x22f533(0xcf)](_0x5b63b9['id'],_0x5b63b9);}const _0x43483e=new Set();for(const _0x3e2896 of _0x3a7e0d){!_0x3e2896[_0x22f533(0xc3)]&&_0x43483e[_0x22f533(0xc8)](_0x3e2896['id']);}function _0x2791d2(_0x2a1a94){const _0x3e2297=_0x22f533;if(_0x5d578f['has'](_0x2a1a94['id']))return _0x5d578f[_0x3e2297(0xc5)](_0x2a1a94['id']);if(_0x43483e[_0x3e2297(0xc7)](_0x2a1a94['id']))return _0x5d578f['set'](_0x2a1a94['id'],''),'';if(_0x2a1a94[_0x3e2297(0xc3)]){const _0x1f5b10=_0x417fe6[_0x3e2297(0xc5)](_0x2a1a94[_0x3e2297(0xc3)]);if(_0x1f5b10){const _0x37a1be=_0x2791d2(_0x1f5b10),_0x422052=_0x37a1be?_0x37a1be+'/'+_0x2a1a94[_0x3e2297(0xd0)]:_0x2a1a94[_0x3e2297(0xd0)];return _0x5d578f[_0x3e2297(0xcf)](_0x2a1a94['id'],_0x422052),_0x422052;}}const _0x1631f0=_0x2a1a94[_0x3e2297(0xd0)];return _0x5d578f[_0x3e2297(0xcf)](_0x2a1a94['id'],_0x1631f0),_0x1631f0;}for(const _0x34d997 of _0x3a7e0d){_0x2791d2(_0x34d997);}return _0x5d578f;}export function buildFolderPathToIdMap(_0x3c4dd8){const _0x12131b=a143_0x54e1,_0x5263af=new Map(),_0x52dcb0=new Map();for(const _0xa0d6af of _0x3c4dd8){_0x52dcb0[_0x12131b(0xcf)](_0xa0d6af['id'],_0xa0d6af);}const _0x164ce8=new Set();for(const _0x4708d0 of _0x3c4dd8){!_0x4708d0[_0x12131b(0xc3)]&&_0x164ce8['add'](_0x4708d0['id']);}function _0x134528(_0xbc3d63){const _0x4d00ea=_0x12131b;if(_0x164ce8[_0x4d00ea(0xc7)](_0xbc3d63['id']))return'';if(_0xbc3d63[_0x4d00ea(0xc3)]){const _0x16a0e3=_0x52dcb0['get'](_0xbc3d63['parentFolderId']);if(_0x16a0e3){const _0x5983d7=_0x134528(_0x16a0e3);return _0x5983d7?_0x5983d7+'/'+_0xbc3d63[_0x4d00ea(0xd0)]:_0xbc3d63[_0x4d00ea(0xd0)];}}return _0xbc3d63['name'];}for(const _0x572355 of _0x3c4dd8){const _0x51f74a=_0x134528(_0x572355);_0x5263af[_0x12131b(0xcf)](_0x51f74a,_0x572355['id']);}return _0x5263af;}export function buildFolderMaps(_0x3ff2dd){const _0x236238=a143_0x54e1,_0x2af94d=buildFolderIdToPathMap(_0x3ff2dd),_0x3c1205=new Map();for(const [_0x129358,_0x2ba121]of _0x2af94d){_0x3c1205[_0x236238(0xcf)](_0x2ba121,_0x129358);}return{'idToPath':_0x2af94d,'pathToId':_0x3c1205};}export function getFolderPath(_0x335d64,_0x4bf948){const _0x387de7=a143_0x54e1;if(!_0x335d64)return'';return _0x4bf948[_0x387de7(0xc5)](_0x335d64)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x694631,_0x2d97af){const _0x5dda67=a144_0x3c03,_0x2d59bc=_0x694631();while(!![]){try{const _0x54809b=-parseInt(_0x5dda67(0x98))/0x1*(-parseInt(_0x5dda67(0x73))/0x2)+-parseInt(_0x5dda67(0x82))/0x3*(-parseInt(_0x5dda67(0x74))/0x4)+parseInt(_0x5dda67(0x87))/0x5*(parseInt(_0x5dda67(0x99))/0x6)+parseInt(_0x5dda67(0x7a))/0x7+-parseInt(_0x5dda67(0x91))/0x8+-parseInt(_0x5dda67(0x80))/0x9+parseInt(_0x5dda67(0x7c))/0xa*(-parseInt(_0x5dda67(0x8a))/0xb);if(_0x54809b===_0x2d97af)break;else _0x2d59bc['push'](_0x2d59bc['shift']());}catch(_0x31fc37){_0x2d59bc['push'](_0x2d59bc['shift']());}}}(a144_0x3de9,0x34c4a));import a144_0x3bbd29 from'path';import{parse as a144_0x3c12f0}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x1f6e36){const _0x217084=a144_0x3c03;if(!_0x1f6e36||_0x1f6e36[_0x217084(0x7f)]()==='')throw new Error(_0x217084(0x97));const _0x538a3d=_0x1f6e36[_0x217084(0x7f)]();if(_0x538a3d==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x1f6e36};const _0x108735=_0x538a3d[_0x217084(0x93)]('/')?_0x538a3d[_0x217084(0x89)](0x1):_0x538a3d,_0x3b64b4=_0x108735['split']('/')[_0x217084(0x78)](_0x496186=>_0x496186!=='');if(_0x3b64b4[_0x217084(0x9b)]===0x0)throw new Error(_0x217084(0x83));const _0x21c38c=_0x538a3d['startsWith']('/')||!isRelativePathSegment(_0x3b64b4[0x0]);for(const _0xdf891 of _0x3b64b4){validatePathSegment(_0xdf891);}return{'segments':_0x3b64b4,'isAbsolute':_0x21c38c,'raw':_0x1f6e36};}function a144_0x3de9(){const _0x23e9e9=['6XMDjVC','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','exists','parse','journey','10tpIZbK','pop','substring','4110227yOeegQ','type','readFile','resolve','Relative\x20path\x20cannot\x20be\x20empty','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','33912lXuweG','Path\x20segment\x20cannot\x20be\x20empty','startsWith','tdx.json','No\x20tdx.json\x20found\x20for\x20file:\x20','push','Path\x20cannot\x20be\x20empty','378413jbvZmW','823002ZoHUbY','.yml','length','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','raw','join','isAbsolute','parent_segment','2ydHrer','504440vxTEBu','dirname','Cannot\x20navigate\x20above\x20root','relative','filter','File\x20not\x20found:\x20','2139123tVgwrj','segments','20VkjNWO','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','.yaml','trim','2185785nqLbVM','endsWith'];a144_0x3de9=function(){return _0x23e9e9;};return a144_0x3de9();}function isRelativePathSegment(_0xa77d8d){return _0xa77d8d==='.'||_0xa77d8d==='..';}function a144_0x3c03(_0x1a70f8,_0x458cec){_0x1a70f8=_0x1a70f8-0x6f;const _0x3de902=a144_0x3de9();let _0x3c0373=_0x3de902[_0x1a70f8];return _0x3c0373;}function validatePathSegment(_0x19546f){const _0x35b843=a144_0x3c03;if(_0x19546f==='')throw new Error(_0x35b843(0x92));if(_0x19546f==='.'||_0x19546f==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x19546f))throw new Error(_0x35b843(0x8f)+_0x19546f);if(_0x19546f!==_0x19546f[_0x35b843(0x7f)]()){}}export function validatePath(_0x520f7d){const _0x36af3a=a144_0x3c03;if(_0x520f7d['segments'][_0x36af3a(0x9b)]===0x0&&!_0x520f7d['isAbsolute'])throw new Error(_0x36af3a(0x8e));if(_0x520f7d[_0x36af3a(0x71)]){if(_0x520f7d[_0x36af3a(0x7b)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x342562=0x0;for(const _0xfa79a2 of _0x520f7d[_0x36af3a(0x7b)]){if(_0xfa79a2==='..'){if(_0x342562===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x342562--;}else _0xfa79a2!=='.'&&_0x342562++;}}}export function joinPaths(_0x273b1c,_0x2f54c0){const _0x3b9d48=a144_0x3c03;if(!_0x273b1c||_0x273b1c==='/')return _0x2f54c0;if(!_0x2f54c0||_0x2f54c0==='.')return _0x273b1c;if(_0x2f54c0[_0x3b9d48(0x93)]('/'))return _0x2f54c0;const _0x3fcc65=parsePath(_0x273b1c),_0x1ec047=parsePath(_0x2f54c0),_0x2bc7c8=[..._0x3fcc65[_0x3b9d48(0x7b)]];for(const _0x3fe649 of _0x1ec047[_0x3b9d48(0x7b)]){if(_0x3fe649==='.')continue;else{if(_0x3fe649==='..'){if(_0x2bc7c8[_0x3b9d48(0x9b)]===0x0)throw new Error(_0x3b9d48(0x76));_0x2bc7c8[_0x3b9d48(0x88)]();}else _0x2bc7c8[_0x3b9d48(0x96)](_0x3fe649);}}const _0x339708=_0x2bc7c8['join']('/');return _0x3fcc65[_0x3b9d48(0x6f)][_0x3b9d48(0x93)]('/')?'/'+_0x339708:_0x339708;}export function normalizePath(_0x3acee3){const _0x5100ac=a144_0x3c03,_0x1d2892=parsePath(_0x3acee3),_0x52e015=[];for(const _0x33268b of _0x1d2892[_0x5100ac(0x7b)]){if(_0x33268b==='.')continue;else{if(_0x33268b==='..'){if(_0x52e015[_0x5100ac(0x9b)]===0x0){if(_0x1d2892[_0x5100ac(0x71)])throw new Error(_0x5100ac(0x76));_0x52e015[_0x5100ac(0x96)]('..');}else _0x52e015[_0x52e015[_0x5100ac(0x9b)]-0x1]==='..'?_0x52e015[_0x5100ac(0x96)]('..'):_0x52e015[_0x5100ac(0x88)]();}else _0x52e015[_0x5100ac(0x96)](_0x33268b);}}if(_0x52e015[_0x5100ac(0x9b)]===0x0)return _0x1d2892[_0x5100ac(0x71)]?'/':'.';const _0x542ed4=_0x52e015['join']('/');return _0x1d2892[_0x5100ac(0x6f)][_0x5100ac(0x93)]('/')?'/'+_0x542ed4:_0x542ed4;}export function getParentPath(_0x2c06d9){const _0x337e98=a144_0x3c03,_0x43daae=parsePath(_0x2c06d9);if(_0x43daae[_0x337e98(0x7b)][_0x337e98(0x9b)]<=0x1)return'/';const _0x48e127=_0x43daae[_0x337e98(0x7b)]['slice'](0x0,-0x1)[_0x337e98(0x70)]('/');return _0x43daae[_0x337e98(0x6f)][_0x337e98(0x93)]('/')?'/'+_0x48e127:_0x48e127;}export function getBaseName(_0x30548a){const _0x4017a1=a144_0x3c03,_0x4b4244=parsePath(_0x30548a);return _0x4b4244[_0x4017a1(0x7b)][_0x4b4244[_0x4017a1(0x7b)][_0x4017a1(0x9b)]-0x1]||'';}export function isChildPath(_0x1df960,_0x5738ce){const _0x3944e5=a144_0x3c03,_0x4a537=parsePath(_0x1df960),_0x288da6=parsePath(_0x5738ce);if(_0x4a537[_0x3944e5(0x7b)][_0x3944e5(0x9b)]<=_0x288da6[_0x3944e5(0x7b)][_0x3944e5(0x9b)])return![];for(let _0x382f63=0x0;_0x382f63<_0x288da6[_0x3944e5(0x7b)][_0x3944e5(0x9b)];_0x382f63++){if(_0x4a537[_0x3944e5(0x7b)][_0x382f63]!==_0x288da6['segments'][_0x382f63])return![];}return!![];}export function splitPath(_0x516f7a){const _0x5084e4=a144_0x3c03,_0x1028bb=parsePath(_0x516f7a);if(_0x1028bb[_0x5084e4(0x7b)]['length']===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x1028bb[_0x5084e4(0x7b)][_0x5084e4(0x9b)]===0x1)return{'parent':_0x1028bb[_0x5084e4(0x7b)][0x0]};return{'parent':_0x1028bb['segments'][0x0],'child':_0x1028bb[_0x5084e4(0x7b)]['slice'](0x1)[_0x5084e4(0x70)]('/')};}export function isYamlFilePath(_0xa37ac8){const _0x4e112d=a144_0x3c03;return _0xa37ac8['endsWith'](_0x4e112d(0x9a))||_0xa37ac8[_0x4e112d(0x81)](_0x4e112d(0x7e));}export async function resolveYamlFilePath(_0x5f5622,_0x118ceb=nodeFileSystem){const _0x5e4e3e=a144_0x3c03,_0x5e0809=a144_0x3bbd29[_0x5e4e3e(0x8d)](_0x5f5622);if(!await _0x118ceb[_0x5e4e3e(0x84)](_0x5e0809))throw new Error(_0x5e4e3e(0x79)+_0x5f5622);let _0x33328e=a144_0x3bbd29['dirname'](_0x5e0809),_0x13d295=null,_0x19082b=null;const _0x39084d=a144_0x3bbd29[_0x5e4e3e(0x85)](_0x33328e)['root'];while(_0x33328e!==_0x39084d){const _0x2d9562=a144_0x3bbd29[_0x5e4e3e(0x70)](_0x33328e,_0x5e4e3e(0x94));if(await _0x118ceb[_0x5e4e3e(0x84)](_0x2d9562)){_0x13d295=_0x2d9562,_0x19082b=_0x33328e;break;}_0x33328e=a144_0x3bbd29[_0x5e4e3e(0x75)](_0x33328e);}if(!_0x13d295||!_0x19082b)throw new Error(_0x5e4e3e(0x95)+_0x5f5622+'\x0a'+_0x5e4e3e(0x9c));const _0x4d5d2e=await _0x118ceb[_0x5e4e3e(0x8c)](_0x13d295),_0x27f305=JSON['parse'](_0x4d5d2e),_0x357a18=_0x27f305[_0x5e4e3e(0x72)];if(!_0x357a18)throw new Error(_0x5e4e3e(0x90));const _0x439c33=await _0x118ceb[_0x5e4e3e(0x8c)](_0x5e0809),_0x1d73ea=a144_0x3c12f0(_0x439c33),_0x549718=_0x1d73ea['name'];if(!_0x549718)throw new Error(_0x5e4e3e(0x7d)+_0x5f5622);const _0x2b429b=_0x1d73ea[_0x5e4e3e(0x8b)]===_0x5e4e3e(0x86)?_0x5e4e3e(0x86):'segment',_0x54b0f9=a144_0x3bbd29[_0x5e4e3e(0x77)](_0x19082b,_0x5e0809),_0x425dfe=a144_0x3bbd29['dirname'](_0x54b0f9),_0x4ab2d9=_0x425dfe==='.'?'':_0x425dfe['replace'](/\\/g,'/'),_0x2d5030=_0x4ab2d9?_0x357a18+'/'+_0x4ab2d9+'/'+_0x549718:_0x357a18+'/'+_0x549718;return{'parentSegment':_0x357a18,'segmentName':_0x549718,'folderPath':_0x4ab2d9,'fullPath':_0x2d5030,'resourceType':_0x2b429b,'content':_0x439c33};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e51ab,_0x3be020){const _0x299d79=a145_0x4769,_0xc4eb98=_0x4e51ab();while(!![]){try{const _0x2a32e1=parseInt(_0x299d79(0x1ef))/0x1+-parseInt(_0x299d79(0x1f1))/0x2*(parseInt(_0x299d79(0x1f2))/0x3)+parseInt(_0x299d79(0x1e5))/0x4+parseInt(_0x299d79(0x1e6))/0x5+parseInt(_0x299d79(0x1f0))/0x6*(parseInt(_0x299d79(0x1ee))/0x7)+parseInt(_0x299d79(0x1ed))/0x8*(parseInt(_0x299d79(0x1ea))/0x9)+-parseInt(_0x299d79(0x1e8))/0xa*(parseInt(_0x299d79(0x1f3))/0xb);if(_0x2a32e1===_0x3be020)break;else _0xc4eb98['push'](_0xc4eb98['shift']());}catch(_0x5b5957){_0xc4eb98['push'](_0xc4eb98['shift']());}}}(a145_0x3308,0xb8f32));export function parseSegmentRef(_0x3aec31){const _0x5ddd4=a145_0x4769,_0x556ac6=_0x3aec31[_0x5ddd4(0x1ec)]('/');if(_0x556ac6===-0x1)return{'parentId':_0x3aec31};if(_0x556ac6===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x3aec31+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x23447f=_0x3aec31[_0x5ddd4(0x1e9)](0x0,_0x556ac6),_0x4dc3ab=_0x3aec31[_0x5ddd4(0x1e9)](_0x556ac6+0x1);if(_0x4dc3ab==='')throw new Error(_0x5ddd4(0x1e7)+_0x3aec31+_0x5ddd4(0x1eb));return{'parentId':_0x23447f,'childId':_0x4dc3ab};}function a145_0x4769(_0x25d77e,_0x5ec459){_0x25d77e=_0x25d77e-0x1e5;const _0x33080b=a145_0x3308();let _0x47696a=_0x33080b[_0x25d77e];return _0x47696a;}function a145_0x3308(){const _0x4703bb=['1088098LMnTCZ','3TsdKTs','121649mPGizM','5900512OrvVQy','6928520QqXlzi','Invalid\x20segment\x20reference\x20format:\x20','3170CEJugZ','substring','9sHgDIn','.\x20Child\x20name\x20cannot\x20be\x20empty','indexOf','1385768jqdqPH','14CbLkeT','1222841FcjUUj','1651236AqPCcy'];a145_0x3308=function(){return _0x4703bb;};return a145_0x3308();}
|