@treasuredata/tdx 0.24.0 → 0.25.1
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.d.ts +14 -3
- package/dist/commands/chat-command.d.ts.map +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/chat-command.js.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +4 -4
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-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-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/llm.d.ts +1 -0
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a110_0x3fa165=a110_0x3a2b;(function(_0x1fe507,_0x306e50){const _0x4a5053=a110_0x3a2b,_0x2a9383=_0x1fe507();while(!![]){try{const _0x2b2af9=parseInt(_0x4a5053(0x194))/0x1+parseInt(_0x4a5053(0x1c6))/0x2+-parseInt(_0x4a5053(0x24a))/0x3+parseInt(_0x4a5053(0x1c4))/0x4+parseInt(_0x4a5053(0x1ad))/0x5+parseInt(_0x4a5053(0x240))/0x6+-parseInt(_0x4a5053(0x1fe))/0x7*(parseInt(_0x4a5053(0x1e3))/0x8);if(_0x2b2af9===_0x306e50)break;else _0x2a9383['push'](_0x2a9383['shift']());}catch(_0xf9dd9b){_0x2a9383['push'](_0x2a9383['shift']());}}}(a110_0x4dbd,0xf2c12));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a110_0x3fa165(0x1b5);export const PENDING_ACTIVATION_PREFIX=a110_0x3fa165(0x1da);export function createPendingSegmentId(_0x1b089b){return''+PENDING_SEGMENT_PREFIX+_0x1b089b+'__';}export function isPendingSegmentId(_0x198283){const _0x3225c2=a110_0x3fa165;return _0x198283[_0x3225c2(0x214)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0xa42de1){const _0xdd80b=a110_0x3fa165;return _0xa42de1[_0xdd80b(0x20f)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1d1cb3){return''+PENDING_ACTIVATION_PREFIX+_0x1d1cb3+'__';}export function isPendingActivationId(_0x226270){return _0x226270['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4ef709){const _0x4f5252=a110_0x3fa165;return _0x4ef709[_0x4f5252(0x20f)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x416daa,_0x2c67ac){const _0x173862=a110_0x3fa165,_0x33d6fa=_0x416daa+'::'+(_0x2c67ac[_0x173862(0x175)]()||_0x173862(0x20e)),_0x4816b9=createHash(_0x173862(0x1a6))['update'](_0x33d6fa)[_0x173862(0x245)](_0x173862(0x20d))[_0x173862(0x1c5)](0x0,0xc);return _0x173862(0x1d2)+_0x4816b9;}export function ensureJourneyDefaults(_0x142ca0){const _0x36ec63=a110_0x3fa165;!_0x142ca0[_0x36ec63(0x19d)]&&(_0x142ca0[_0x36ec63(0x19d)]=''),!_0x142ca0[_0x36ec63(0x195)]&&(_0x142ca0['state']=_0x36ec63(0x17d));}export function resolveTDFolderPath(_0x3b833a,_0x4ed206,_0x394406){const _0x3f8dcf=a110_0x3fa165;if(!_0x4ed206)return _0x3b833a;if(_0x3b833a===_0x394406||_0x3b833a[_0x3f8dcf(0x214)](_0x394406+'/'))return _0x3b833a;return _0x3b833a?_0x394406+'/'+_0x3b833a:_0x394406;}function a110_0x4dbd(){const _0x95473f=['Activation','folderId','keys','segment_creating','size','sha1','\x20(referenced\x20in\x20journey\x20','deleted','decision_point','Updated\x20journey\x20\x27','createdSegmentId','Failed\x20to\x20','4487585fQqSUv','Created\x20activation\x20\x27','logInfo','index','\x20segment\x20from\x20file:\x20','INTERNAL','deleteActivation','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','__pending_','Created\x20journey\x20\x27','toString','map','createFolder','activationsBySegmentId','reduce','\x27\x20from\x20file:\x20','flatMap','logSuccess','journeyId','parse','from','goal','isArray','1543276ZxJyMz','slice','497636RPYXeg','isNew','SEGMENT_NOT_FOUND','Deleted\x20segment\x20\x27','set','Created\x20folder\x20\x27','embedded_segment_created','journey_creating','existingJourney','journey','add','journeyBundleName','journey_entry_criteria_','\x20journey\x20from\x20file:\x20','push','journeyActivationStepId','parseDocument','filter','validatedRequest','length','__pending_act_','\x27\x20for\x20','action','max','folderPathToId','\x27...','stringify','with','has','258360qKbeze','versionNumber','stages','type','journeyById','Segment\x20not\x20found:\x20','Activation\x20not\x20found:\x20','Creating\x20activation\x20\x27','split','activation_deleted','localSegmentRules','embedded_activation_created','activationContext','activation_updating','embeddedSegmentNameToId','waitCondition','unchanged','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','data','listActivations','create','errors','activation_creating','activationActions','absolutePath','journeys','existingSegment','133MsNtCJ','deleteSegment','rule','stage\x20\x27','activationParams','\x27\x20exit\x20criteria','NOT_FOUND','utf-8','segmentNameToId','nameToType','JOURNEY_SYNTAX_ERROR','connector_config','delete','relationships','Updated\x20activation\x20\x27','hex','segment','replace','\x27\x20entry\x20criteria','sort','updated','Entry\x20criteria:\x20','startsWith','journeyBundlesByFolderAndName','Updating\x20segment\x20\x27','attributes','idToEmailMap','Updated\x20segment\x20\x27','DecisionPoint','includes','relative','createSegment','\x27\x20milestone','notification','getActivation','hasChanges','onProgress','listSegments','activation_template_id','journey_created','null','SEGMENT_UPDATE_ERROR','withProgress','milestone','createdSegmentIds','exitCriterias','connectionIdToNameMap','entry_criteria','journey_updating','resolveSegment','columns','logDeleted','created','./journey-yaml.js','Journey\x20\x27','parentId','journeyStages','activation_deleting','folderPath','schedule','steps','\x20activation\x20\x27','folder_creating','diff','):\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','1545156GBVEzd','progress','journeyActivationNameToId','rootFolderId','./child-segment-yaml.js','digest','entry','idToName','nameToId','toLowerCase','4526484heOlcN','\x0a\x20\x20','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','yamlConfig','folder','embedded_activation_creating','get','entryCriteria','../../utils/async.js','trim','all_columns','getJourney','message','WaitStep','Fetching\x20','segmentFolderId','join','draft','name','parentFolder','existingSegments','find','createJourneySegment','existingActivation','segmentId','updateSegmentById','results','Deleting\x20activation\x20\x27','parentSegmentFolder','values','deps','getSegment','ACTIVATION_UPDATE_ERROR','connection','createActivation','segments','Creating\x20segment\x20\x27','branches','fetchJourney','effectiveFolderId','1327075LwAvfQ','state','activation_created','behavior','update','\x27\x20wait\x20condition','activations','segment_deleted','skipSegments','description','Creating\x20folder\x20\x27','resolveJourneyId','all'];a110_0x4dbd=function(){return _0x95473f;};return a110_0x4dbd();}export function addFoldersToCreate(_0x3c7200,_0x45089f,_0x32684b){const _0x4b50f6=a110_0x3fa165;if(!_0x3c7200)return;if(_0x45089f['has'](_0x3c7200))return;const _0x24554e=_0x3c7200['split']('/');let _0x19919b='';for(const _0x428679 of _0x24554e){_0x19919b=_0x19919b?_0x19919b+'/'+_0x428679:_0x428679,!_0x45089f[_0x4b50f6(0x1e2)](_0x19919b)&&_0x32684b['add'](_0x19919b);}}import*as a110_0x2d76ab from'yaml';import{readFileSync}from'fs';import a110_0x3e4ea7 from'path';import{isJourneyDef,parseYamlString as a110_0x6afbf,toYamlString as a110_0x2bb947,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x503912){const _0x13a7d0=a110_0x3fa165;if(Array[_0x13a7d0(0x1c3)](_0x503912))return'['+_0x503912['map'](_0x41f9b6=>stableStringify(_0x41f9b6))['join'](',')+']';if(_0x503912&&typeof _0x503912==='object'){const _0x1b69db=_0x503912,_0x218ffe=Object[_0x13a7d0(0x1a3)](_0x1b69db)[_0x13a7d0(0x211)](),_0x3361a6=_0x218ffe[_0x13a7d0(0x1b8)](_0x46905f=>'\x22'+_0x46905f+'\x22:'+stableStringify(_0x1b69db[_0x46905f]));return'{'+_0x3361a6['join'](',')+'}';}const _0x22807d=JSON[_0x13a7d0(0x1e0)](_0x503912);return _0x22807d===undefined?_0x13a7d0(0x226):_0x22807d;}function activationSignature(_0x1c6ece){const _0x3e7f33=a110_0x3fa165,_0x1f660c={'connection':_0x1c6ece[_0x3e7f33(0x18d)],..._0x1c6ece[_0x3e7f33(0x176)]!==undefined&&{'all_columns':_0x1c6ece[_0x3e7f33(0x176)]},..._0x1c6ece[_0x3e7f33(0x230)]!==undefined&&{'columns':_0x1c6ece[_0x3e7f33(0x230)]},..._0x1c6ece[_0x3e7f33(0x197)]!==undefined&&{'behavior':_0x1c6ece[_0x3e7f33(0x197)]},..._0x1c6ece[_0x3e7f33(0x239)]!==undefined&&{'schedule':_0x1c6ece[_0x3e7f33(0x239)]},..._0x1c6ece['notification']!==undefined&&{'notification':_0x1c6ece[_0x3e7f33(0x21f)]},..._0x1c6ece[_0x3e7f33(0x209)]!==undefined&&{'connector_config':_0x1c6ece[_0x3e7f33(0x209)]},..._0x1c6ece[_0x3e7f33(0x224)]!==undefined&&{'activation_template_id':_0x1c6ece[_0x3e7f33(0x224)]}};return stableStringify(_0x1f660c);}export async function prepareSegmentFiles(_0x1ccd45,_0xe796f8,_0x214079,_0x3dbfbd,_0xc51fce){const _0x2bd3cd=a110_0x3fa165,{activationDefToCreateRequest:_0x3256c9}=await import(_0x2bd3cd(0x244)),_0x361fc0=[],_0x18617b=new Set();for(const {yamlConfig:_0x2dde59,folderPath:_0xcb3687,sourcePath:_0x1b2be1}of _0x1ccd45){const _0x2cc23f=resolveTDFolderPath(_0xcb3687,_0x3dbfbd,_0xc51fce),_0x2eebd1=_0x2cc23f+':'+_0x2dde59[_0x2bd3cd(0x17e)],_0x410892=_0xe796f8['segmentByFolderAndName']['get'](_0x2eebd1),_0x4d4026=_0x410892?_0xe796f8[_0x2bd3cd(0x1ba)][_0x2bd3cd(0x172)](_0x410892['id'])||[]:[];addFoldersToCreate(_0x2cc23f,_0xe796f8['folderPathToId'],_0x18617b);const _0x4aaaa2=calculateActivationActions(_0x2dde59[_0x2bd3cd(0x19a)]||[],_0x4d4026,_0xe796f8['idToEmailMap'],_0xe796f8[_0x2bd3cd(0x22c)]);for(const _0x37ea0d of _0x4aaaa2){(_0x37ea0d[_0x2bd3cd(0x1e6)]===_0x2bd3cd(0x1f7)||_0x37ea0d[_0x2bd3cd(0x1e6)]===_0x2bd3cd(0x198))&&_0x37ea0d['yamlActivation']&&(_0x37ea0d['validatedRequest']=await _0x3256c9(_0x37ea0d['yamlActivation'],_0x214079));}const _0x2837be=calculateSegmentDiff(_0x2dde59,_0x410892,_0x4d4026,_0xe796f8[_0x2bd3cd(0x218)],_0xe796f8[_0x2bd3cd(0x22c)]);_0x361fc0[_0x2bd3cd(0x1d4)]({'relativePath':_0x2dde59['name'],'absolutePath':_0x1b2be1,'yamlConfig':_0x2dde59,'folderPath':_0x2cc23f,'existingSegment':_0x410892,'existingActivations':_0x4d4026,'isNew':_0x2837be[_0x2bd3cd(0x1c7)],'hasChanges':_0x2837be['hasChanges'],'diff':_0x2837be[_0x2bd3cd(0x23d)],'activationActions':_0x4aaaa2});}return{'segmentFiles':_0x361fc0,'foldersToCreate':_0x18617b};}export async function prepareJourneyFiles(_0x5c968b,_0x56efaf,_0x3033b4,_0x263eae){const _0x147015=a110_0x3fa165,_0xc788e2=[],_0x4a6900=new Set();for(const {yamlConfig:_0x1beac4,folderPath:_0x6e72e,sourcePath:_0x22d202}of _0x5c968b){const _0x4f6396=resolveTDFolderPath(_0x6e72e,_0x3033b4,_0x263eae),_0xf5998=_0x4f6396+':'+_0x1beac4[_0x147015(0x17e)],_0x4a57b6=_0x56efaf[_0x147015(0x215)]['get'](_0xf5998);let _0x1fa9e7,_0x6fd9d6;if(_0x4a57b6&&_0x4a57b6[_0x147015(0x1d9)]>0x0){const _0x188f55=buildLocalExpandedRuleMappings(_0x1beac4),{createYamlContext:_0x40dd0a,prefetchJourneySegments:_0xf2152d}=createPushYamlContextForBundle(_0x56efaf[_0x147015(0x18a)],_0x56efaf[_0x147015(0x235)],_0x56efaf['existingSegments'],_0x188f55,_0x56efaf[_0x147015(0x218)],_0x56efaf[_0x147015(0x22c)],_0x56efaf['activationStepsById'],_0x56efaf['journeyById']);await _0xf2152d(_0x4a57b6[_0x147015(0x1b8)](_0x12b668=>_0x12b668['id']));const _0x2310d4=hasMultipleVersions(_0x1beac4),_0x5a79ad=async _0x403a7c=>{const _0x51f9d6=_0x147015,_0x53d375=_0x56efaf[_0x51f9d6(0x1e7)]?.[_0x51f9d6(0x172)](_0x403a7c);if(_0x53d375)return _0x53d375;return _0x56efaf[_0x51f9d6(0x192)]({'journeyId':_0x403a7c,'journeyName':_0x1beac4['name'],'isMultiVersion':_0x4a57b6[_0x51f9d6(0x1d9)]>0x1});};if(_0x2310d4&&_0x4a57b6[_0x147015(0x1d9)]>0x1){const _0x572748=[];for(const _0x49c9e7 of _0x4a57b6){const _0x303eab=_0x49c9e7['versionNumber']||0x1;_0x56efaf[_0x147015(0x241)]?.[_0x147015(0x198)](_0x147015(0x17a)+_0x1beac4[_0x147015(0x17e)]+'\x20v'+_0x303eab);const _0x5956e6=await _0x5a79ad(_0x49c9e7['id']),_0x3083bc=_0x40dd0a(_0x49c9e7['id']),_0x49b598=await journeyResponseToDef(_0x5956e6,_0x3083bc);_0x572748[_0x147015(0x1d4)]({'item':_0x49c9e7,'yaml':_0x49b598});}const _0x5ef7ce=buildLocalRuleToNameMappingFromJourney(_0x1beac4);_0x6fd9d6=buildMergedJourneyDef(_0x572748,_0x5ef7ce);const _0x21b6d8=Math[_0x147015(0x1dd)](..._0x572748['map'](_0x39882a=>_0x39882a['item'][_0x147015(0x1e4)]||0x0)),_0x33ce22=_0x4a57b6[_0x147015(0x181)](_0x119f03=>(_0x119f03[_0x147015(0x1e4)]||0x0)===_0x21b6d8);_0x33ce22&&(_0x56efaf['progress']?.[_0x147015(0x198)](_0x147015(0x17a)+_0x1beac4[_0x147015(0x17e)]+'\x20v'+_0x21b6d8),_0x1fa9e7=await _0x5a79ad(_0x33ce22['id']));}else{const _0x14f7fe=_0x4a57b6[_0x4a57b6['length']-0x1];_0x56efaf[_0x147015(0x241)]?.[_0x147015(0x198)](_0x147015(0x17a)+_0x1beac4[_0x147015(0x17e)]),_0x1fa9e7=await _0x5a79ad(_0x14f7fe['id']);const _0x3d5ba2=_0x40dd0a(_0x14f7fe['id']),_0xf27ed2=await journeyResponseToDef(_0x1fa9e7,_0x3d5ba2),_0x178e3a=buildLocalRuleToNameMappingFromJourney(_0x1beac4);_0x6fd9d6=buildMergedJourneyDef([{'item':_0x14f7fe,'yaml':_0xf27ed2}],_0x178e3a);}}addFoldersToCreate(_0x4f6396,_0x56efaf[_0x147015(0x1de)],_0x4a6900);const _0x18f1a8=calculateJourneyDiff(_0x1beac4,_0x6fd9d6);_0xc788e2[_0x147015(0x1d4)]({'relativePath':_0x1beac4['name'],'absolutePath':_0x22d202,'yamlConfig':_0x1beac4,'folderPath':_0x4f6396,'existingJourney':_0x1fa9e7,'isNew':_0x18f1a8[_0x147015(0x1c7)],'hasChanges':_0x18f1a8['hasChanges'],'diff':_0x18f1a8[_0x147015(0x23d)]});}return{'journeyFiles':_0xc788e2,'foldersToCreate':_0x4a6900};}export function calculateActivationActions(_0x5bac55,_0x4bf756,_0x1d7c0e,_0x32ecaf){const _0x26e235=a110_0x3fa165,_0x280bc9=[],_0x146aef=new Map();for(const _0x2e8282 of _0x4bf756){_0x146aef[_0x26e235(0x1ca)](_0x2e8282[_0x26e235(0x17e)],_0x2e8282);}const _0x324767=new Map();for(const _0x2b8c9d of _0x5bac55){_0x324767[_0x26e235(0x1ca)](_0x2b8c9d[_0x26e235(0x17e)],_0x2b8c9d);}for(const _0x36901d of _0x5bac55){const _0x2686cf=_0x146aef['get'](_0x36901d[_0x26e235(0x17e)]);if(!_0x2686cf)_0x280bc9[_0x26e235(0x1d4)]({'type':_0x26e235(0x1f7),'name':_0x36901d[_0x26e235(0x17e)],'yamlActivation':_0x36901d});else{const _0x4f01d9=activationResponseToDef(_0x2686cf,_0x1d7c0e,_0x32ecaf),_0x14cd21=a110_0x2d76ab[_0x26e235(0x1e0)](_0x4f01d9),_0x83a2f9=a110_0x2d76ab[_0x26e235(0x1e0)](_0x36901d);_0x14cd21!==_0x83a2f9&&_0x280bc9['push']({'type':_0x26e235(0x198),'name':_0x36901d[_0x26e235(0x17e)],'yamlActivation':_0x36901d,'existingActivation':_0x2686cf});}}for(const _0xbd7659 of _0x4bf756){!_0x324767['has'](_0xbd7659[_0x26e235(0x17e)])&&_0x280bc9[_0x26e235(0x1d4)]({'type':'delete','name':_0xbd7659[_0x26e235(0x17e)],'existingActivation':_0xbd7659});}return _0x280bc9;}export function calculateSegmentDiff(_0x5c71d8,_0x365fea,_0x56d094,_0x23dab5,_0x3a03ed){const _0x558904=segmentToYamlString(_0x5c71d8);if(_0x365fea){const _0x3742e6=segmentWithActivationsToYaml(_0x365fea,_0x56d094,undefined,_0x23dab5,_0x3a03ed),_0x12aa3b=segmentToYamlString(_0x3742e6),_0x17b4d9=generateDiff(_0x12aa3b,_0x558904),_0x294b76=hasChanges(_0x17b4d9);return{'isNew':![],'hasChanges':_0x294b76,'diff':_0x294b76?formatDiffWithColors(_0x17b4d9):undefined};}const _0x33c108=generateDiff('',_0x558904);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x33c108)};}export function calculateJourneyDiff(_0x1e7c36,_0x103ad8){const _0x10d65a=normalizeJourneyDef(_0x1e7c36,_0x1e7c36),_0x531804=a110_0x2bb947(_0x10d65a);if(_0x103ad8){const _0x4440a1=normalizeJourneyDef(_0x103ad8,_0x1e7c36),_0x40cb4b=a110_0x2bb947(_0x4440a1),_0xd612c0=generateDiff(_0x40cb4b,_0x531804),_0x386c32=hasChanges(_0xd612c0);return{'isNew':![],'hasChanges':_0x386c32,'diff':_0x386c32?formatDiffWithColors(_0xd612c0):undefined};}const _0x1f6bd2=generateDiff('',_0x531804);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1f6bd2)};}export function findSegmentsToDelete(_0x82ee5e,_0x588b0d,_0x3aa70c,_0x593f77,_0x59c44d){const _0xc47fef=a110_0x3fa165,_0x55c8e7=new Set();for(const {yamlConfig:_0x15c9e5,folderPath:_0x5e0774}of _0x588b0d){_0x55c8e7[_0xc47fef(0x1d0)](_0x5e0774+':'+_0x15c9e5[_0xc47fef(0x17e)]);}return _0x82ee5e[_0xc47fef(0x1d7)](_0x5cada3=>{const _0x1af1d2=_0xc47fef,_0x20fca6=_0x5cada3['segmentFolderId']?_0x3aa70c['get'](_0x5cada3[_0x1af1d2(0x17b)]['toString']())||'':'',_0x5ea3c7=_0x20fca6+':'+_0x5cada3[_0x1af1d2(0x17e)];if(_0x55c8e7[_0x1af1d2(0x1e2)](_0x5ea3c7))return![];if(_0x59c44d)return _0x20fca6===_0x593f77||_0x20fca6[_0x1af1d2(0x214)](_0x593f77+'/');return!![];});}export function findJourneysToDelete(_0x48de51,_0x52d2be,_0x5731b4,_0x375158,_0x442401){const _0xb3d2a2=a110_0x3fa165,_0x2b9a73=new Set();for(const {yamlConfig:_0x410bfe,folderPath:_0x126b1e}of _0x52d2be){_0x2b9a73['add'](_0x126b1e+':'+_0x410bfe['name']);}return _0x48de51[_0xb3d2a2(0x1d7)](_0x3ef5e8=>{const _0x30c35e=_0xb3d2a2,_0x2aa5e5=_0x3ef5e8[_0x30c35e(0x1a2)]?_0x5731b4[_0x30c35e(0x172)](_0x3ef5e8[_0x30c35e(0x1a2)])||'':'',_0x17d9a2=_0x2aa5e5+':'+_0x3ef5e8[_0x30c35e(0x1d1)];if(_0x2b9a73[_0x30c35e(0x1e2)](_0x17d9a2))return![];if(_0x442401)return _0x2aa5e5===_0x375158||_0x2aa5e5[_0x30c35e(0x214)](_0x375158+'/');return!![];});}export function buildSegmentLookupMap(_0xffc785,_0x2912d5){const _0x18d5a2=a110_0x3fa165,_0x4fae1e=new Map();for(const _0x4de95d of _0xffc785){const _0x3eabbc=_0x4de95d[_0x18d5a2(0x17b)]?_0x2912d5['get'](_0x4de95d[_0x18d5a2(0x17b)][_0x18d5a2(0x1b7)]())||'':'',_0x476a27=_0x3eabbc+':'+_0x4de95d[_0x18d5a2(0x17e)];_0x4fae1e[_0x18d5a2(0x1ca)](_0x476a27,_0x4de95d);}return _0x4fae1e;}export function buildSegmentNameToIdMap(_0x501d49){const _0x445494=a110_0x3fa165,_0x3a15be=new Map();for(const _0x28e887 of _0x501d49){_0x3a15be['set'](_0x28e887[_0x445494(0x17e)],_0x28e887['id']);}return _0x3a15be;}export function buildJourneyBundleLookupMap(_0x2dcdff,_0xea0baf){const _0x4d36d3=a110_0x3fa165,_0x8337c6=new Map();for(const _0x3f4229 of _0x2dcdff){const _0x199396=_0x3f4229[_0x4d36d3(0x1a2)]?_0xea0baf[_0x4d36d3(0x172)](_0x3f4229[_0x4d36d3(0x1a2)])||'':'',_0x33360f=_0x199396+':'+_0x3f4229[_0x4d36d3(0x1d1)];!_0x8337c6[_0x4d36d3(0x1e2)](_0x33360f)&&_0x8337c6[_0x4d36d3(0x1ca)](_0x33360f,[]),_0x8337c6['get'](_0x33360f)[_0x4d36d3(0x1d4)](_0x3f4229);}for(const _0x290d05 of _0x8337c6[_0x4d36d3(0x189)]()){_0x290d05[_0x4d36d3(0x211)]((_0x270135,_0x2202e4)=>(_0x270135[_0x4d36d3(0x1e4)]||0x0)-(_0x2202e4[_0x4d36d3(0x1e4)]||0x0));}return _0x8337c6;}export function collectFoldersToCreate(_0x3b03ac,_0x17eb1b){const _0x3087e9=a110_0x3fa165,_0x495223=new Set();for(const _0x40b434 of _0x3b03ac){if(!_0x40b434)continue;if(_0x17eb1b[_0x3087e9(0x1e2)](_0x40b434))continue;const _0x3388e4=_0x40b434[_0x3087e9(0x1eb)]('/');let _0x478d1d='';for(const _0x4d2f24 of _0x3388e4){_0x478d1d=_0x478d1d?_0x478d1d+'/'+_0x4d2f24:_0x4d2f24,!_0x17eb1b[_0x3087e9(0x1e2)](_0x478d1d)&&_0x495223['add'](_0x478d1d);}}return _0x495223;}export function parseAndClassifyYamlFiles(_0x42544b,_0x17e2d3,_0x4fce3b){const _0x5dcd90=a110_0x3fa165,_0x4e8580=[],_0x3a4fec=[];for(const _0x4108d4 of _0x42544b){const _0x58fe11=a110_0x3e4ea7[_0x5dcd90(0x21c)](_0x17e2d3,a110_0x3e4ea7['dirname'](_0x4108d4)),_0x3b6772=_0x58fe11==='.'?'':_0x58fe11,_0x3657e7=readFileSync(_0x4108d4,_0x5dcd90(0x205)),_0x14ab1c=a110_0x2d76ab['parse'](_0x3657e7);if(isJourneyDef(_0x14ab1c)){const _0x135c3a=a110_0x6afbf(_0x3657e7);_0x3a4fec[_0x5dcd90(0x1d4)]({'yamlConfig':_0x135c3a,'folderPath':_0x3b6772,'sourcePath':_0x4108d4});}else{if(!_0x4fce3b?.[_0x5dcd90(0x19c)]){const _0x30c00e=parseSegmentYamlFile(_0x3657e7),_0x36d788=normalizeChildSegmentYaml(_0x30c00e);_0x4e8580[_0x5dcd90(0x1d4)]({'yamlConfig':_0x36d788,'folderPath':_0x3b6772,'sourcePath':_0x4108d4});}}}return{'segments':_0x4e8580,'journeys':_0x3a4fec};}export function validateParsedFiles(_0x15cbb8,_0x3c9f48){const _0x5cb778=a110_0x3fa165,_0x200f84=[];for(const {yamlConfig:_0x36a709,sourcePath:_0x43c8bd}of _0x15cbb8[_0x5cb778(0x18f)]){const _0x41ed80=readFileSync(_0x43c8bd,'utf-8'),_0x22674b=a110_0x2d76ab['parseDocument'](_0x41ed80),_0xe8b41a=validateSegmentDef(_0x36a709,{'source':_0x41ed80,'document':_0x22674b});if(!_0xe8b41a['valid']){const _0xd5013b=a110_0x3e4ea7[_0x5cb778(0x21c)](_0x3c9f48,_0x43c8bd);_0x200f84[_0x5cb778(0x1d4)]({'filePath':_0xd5013b,'source':_0x41ed80,'result':_0xe8b41a,'isJourney':![]});}}for(const {yamlConfig:_0xb8989b,sourcePath:_0x3e02a9}of _0x15cbb8[_0x5cb778(0x1fc)]){const _0x461438=readFileSync(_0x3e02a9,_0x5cb778(0x205)),_0x3bb2c8=a110_0x2d76ab[_0x5cb778(0x1d6)](_0x461438),_0x2c1279=validateJourneyDef(_0xb8989b,{'source':_0x461438,'document':_0x3bb2c8});if(!_0x2c1279['valid']){const _0x1e81f2=a110_0x3e4ea7[_0x5cb778(0x21c)](_0x3c9f48,_0x3e02a9);_0x200f84[_0x5cb778(0x1d4)]({'filePath':_0x1e81f2,'source':_0x461438,'result':_0x2c1279,'isJourney':!![]});}}return _0x200f84;}export function formatValidationErrors(_0x5922a2){const _0x5ee92e=a110_0x3fa165,_0x181006=[];for(const {filePath:_0x5d2670,source:_0x50dcd7,result:_0x2b23c9,isJourney:_0x2ed8e9}of _0x5922a2){const _0x35aed0=_0x2ed8e9?_0x5ee92e(0x1cf):_0x5ee92e(0x20e);_0x181006[_0x5ee92e(0x1d4)]('\x0a'+_0x5d2670+'\x20('+_0x35aed0+_0x5ee92e(0x23e)+_0x2b23c9[_0x5ee92e(0x1f8)][_0x5ee92e(0x1d9)]+'\x20error(s)'),_0x181006[_0x5ee92e(0x1d4)](formatValidationResult(_0x2b23c9,_0x50dcd7,_0x5d2670));}return _0x181006[_0x5ee92e(0x17c)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x39a42a){const _0xe88875=a110_0x3fa165,_0x66b926=new Set(),_0x19a515=new Map(),_0x1cf7d2=collectSegmentUsageCounts(_0x39a42a);if(_0x39a42a[_0xe88875(0x18f)])for(const [_0x1fe57f,_0x4764bb]of Object['entries'](_0x39a42a[_0xe88875(0x18f)])){_0x66b926['add'](_0x1fe57f);if(_0x4764bb['rule']){const _0xd763de=yamlRuleToApi(_0x4764bb[_0xe88875(0x200)]),_0x3a2a4a=apiRuleToYaml(_0xd763de);_0x19a515['set'](_0x1fe57f,_0x3a2a4a);}}const _0xc14f46=new Map();let _0x233ef9=0x0;for(const [_0x29aa0c,_0x3227d8]of _0x19a515){const _0x594243=serializeExpandedRule(_0x3227d8,_0x19a515),_0xc42184=_0xc14f46[_0xe88875(0x172)](_0x594243)||[];_0xc42184['push']({'name':_0x29aa0c,'index':_0x233ef9}),_0xc14f46[_0xe88875(0x1ca)](_0x594243,_0xc42184),_0x233ef9++;}const _0x2cc247=new Map();for(const [_0x3fbfe9,_0x168c19]of _0xc14f46){const _0x468d6a=_0x168c19[_0xe88875(0x1c5)]()['sort']((_0x47dda2,_0x5825f5)=>{const _0x5a1679=_0xe88875,_0x6cc2ac=_0x1cf7d2[_0x5a1679(0x172)](_0x47dda2[_0x5a1679(0x17e)])||0x0,_0x474336=_0x1cf7d2[_0x5a1679(0x172)](_0x5825f5[_0x5a1679(0x17e)])||0x0;if(_0x6cc2ac!==_0x474336)return _0x474336-_0x6cc2ac;return _0x47dda2[_0x5a1679(0x1b0)]-_0x5825f5[_0x5a1679(0x1b0)];})[_0xe88875(0x1b8)](_0x106313=>_0x106313[_0xe88875(0x17e)]),_0x4076a3=[];for(const _0xef5b60 of _0x468d6a){const _0x43c6f0=_0x1cf7d2[_0xe88875(0x172)](_0xef5b60)||0x0,_0x4f2bf1=Math[_0xe88875(0x1dd)](_0x43c6f0,0x1);for(let _0x501515=0x0;_0x501515<_0x4f2bf1;_0x501515++){_0x4076a3[_0xe88875(0x1d4)](_0xef5b60);}}_0x2cc247[_0xe88875(0x1ca)](_0x3fbfe9,_0x4076a3);}return{'existingLocalSegmentNames':_0x66b926,'localSegmentRules':_0x19a515,'localExpandedRuleToNames':_0x2cc247};}async function buildServerSegmentRuleMap(_0x220a3e,_0x1a5f65,_0x312e46,_0x39585a){const _0x110751=new Map(),_0x4c7066=new Set(),_0x46fe78=async _0x2c342c=>{const _0x80e19c=a110_0x3a2b;if(_0x4c7066[_0x80e19c(0x1e2)](_0x2c342c))return;_0x4c7066['add'](_0x2c342c);let _0x25909b=_0x312e46[_0x80e19c(0x181)](_0x288a7f=>_0x288a7f['id']===_0x2c342c);if(!_0x25909b)try{_0x25909b=await _0x220a3e[_0x80e19c(0x20e)][_0x80e19c(0x18b)](_0x1a5f65,_0x2c342c);}catch{return;}if(!_0x25909b?.[_0x80e19c(0x200)])return;const _0xa511dd=apiRuleToYaml(_0x25909b['rule']);_0x110751[_0x80e19c(0x1ca)](_0x2c342c,_0xa511dd);const _0x1f1a82=collectSegmentRefsFromRule(_0xa511dd);for(const _0x41a68c of _0x1f1a82){await _0x46fe78(_0x41a68c);}};for(const _0x3301a2 of _0x39585a){await _0x46fe78(_0x3301a2);}return _0x110751;}export function createSegmentIdResolver(_0x177c81,_0x4b9d94){return async _0xaac5f8=>{const _0x10ca33=a110_0x3a2b,_0xb7c63b=_0x177c81[_0x10ca33(0x172)](_0xaac5f8);if(!_0xb7c63b)throw new SDKError(ErrorCode[_0x10ca33(0x1c8)],_0x10ca33(0x1e8)+_0xaac5f8+_0x10ca33(0x16e)+_0x4b9d94+'\x27)');return _0xb7c63b;};}export function extractRootFolderId(_0x162fd9){const _0x165314=a110_0x3fa165;return _0x162fd9[_0x165314(0x20b)]?.[_0x165314(0x188)]?.[_0x165314(0x1f5)]?.['id']||_0x162fd9[_0x165314(0x20b)]?.[_0x165314(0x17f)]?.[_0x165314(0x1f5)]?.['id'];}export function buildConnectionMaps(_0xce4f80){const _0x387634=a110_0x3fa165,_0x441ff2=new Map(),_0x5dbd58=new Map(),_0x391ecf=new Map();for(const _0x5e9e98 of _0xce4f80){_0x441ff2[_0x387634(0x1ca)](_0x5e9e98['name'],parseInt(_0x5e9e98['id'],0xa)),_0x5dbd58[_0x387634(0x1ca)](_0x5e9e98['id'],_0x5e9e98[_0x387634(0x17e)]),_0x391ecf[_0x387634(0x1ca)](_0x5e9e98[_0x387634(0x17e)],_0x5e9e98['type']);}return{'nameToId':_0x441ff2,'idToName':_0x5dbd58,'nameToType':_0x391ecf};}export function calculatePushStats(_0x218429,_0x209385,_0x2c6fd4,_0x34fa4c,_0x2e8e57,_0x5e6bad,_0x4322b5){const _0x494cc1=a110_0x3fa165,_0x448a78=_0x218429[_0x494cc1(0x1d7)](_0x387280=>_0x387280[_0x494cc1(0x1c7)]),_0xa278ad=_0x218429[_0x494cc1(0x1d7)](_0x1b05e2=>!_0x1b05e2[_0x494cc1(0x1c7)]&&_0x1b05e2[_0x494cc1(0x221)]),_0x3a97e2=_0x218429[_0x494cc1(0x1d7)](_0x1d180e=>!_0x1d180e[_0x494cc1(0x1c7)]&&!_0x1d180e[_0x494cc1(0x221)]),_0x4215d9=_0x5e6bad?_0x34fa4c:[],_0x5b7307=_0x209385[_0x494cc1(0x1d7)](_0x2b0a99=>_0x2b0a99[_0x494cc1(0x1c7)]),_0x58695f=_0x209385[_0x494cc1(0x1d7)](_0x33a4a5=>!_0x33a4a5[_0x494cc1(0x1c7)]&&_0x33a4a5[_0x494cc1(0x221)]),_0x276fb8=_0x209385[_0x494cc1(0x1d7)](_0x4f1c8b=>!_0x4f1c8b['isNew']&&!_0x4f1c8b[_0x494cc1(0x221)]),_0xf84307=_0x5e6bad?_0x2e8e57:[],_0x13a652=_0x218429[_0x494cc1(0x1bd)](_0x5ea865=>_0x5ea865['activationActions']),_0x1dee63=_0x13a652['filter'](_0xa51f35=>_0xa51f35[_0x494cc1(0x1e6)]===_0x494cc1(0x1f7)),_0x263abc=_0x13a652['filter'](_0x393472=>_0x393472[_0x494cc1(0x1e6)]==='update'),_0x1d095a=_0x13a652[_0x494cc1(0x1d7)](_0x1a4975=>_0x1a4975['type']===_0x494cc1(0x20a)),_0x3d7fe7=Array[_0x494cc1(0x1c1)](_0x2c6fd4)['sort'](),_0x2fcdee=_0x4322b5?![]:_0x448a78['length']>0x0||_0xa278ad[_0x494cc1(0x1d9)]>0x0||_0x4215d9[_0x494cc1(0x1d9)]>0x0,_0x1bcf9c=_0x5b7307['length']>0x0||_0x58695f[_0x494cc1(0x1d9)]>0x0||_0xf84307['length']>0x0,_0x3f158a=_0x4322b5?![]:_0x13a652[_0x494cc1(0x1d9)]>0x0,_0x551c50=_0x3d7fe7['length']>0x0;return{'segments':{'new':_0x448a78,'changed':_0xa278ad,'unchanged':_0x3a97e2,'toDelete':_0x4215d9},'journeys':{'new':_0x5b7307,'changed':_0x58695f,'unchanged':_0x276fb8,'toDelete':_0xf84307},'activations':{'all':_0x13a652,'toCreate':_0x1dee63,'toUpdate':_0x263abc,'toDelete':_0x1d095a},'folders':{'toCreate':_0x3d7fe7},'counts':{'segments':{'new':_0x448a78[_0x494cc1(0x1d9)],'changed':_0xa278ad[_0x494cc1(0x1d9)],'unchanged':_0x3a97e2[_0x494cc1(0x1d9)],'toDelete':_0x4215d9[_0x494cc1(0x1d9)]},'journeys':{'new':_0x5b7307['length'],'changed':_0x58695f[_0x494cc1(0x1d9)],'unchanged':_0x276fb8['length'],'toDelete':_0xf84307['length']},'activations':{'create':_0x1dee63[_0x494cc1(0x1d9)],'update':_0x263abc['length'],'delete':_0x1d095a[_0x494cc1(0x1d9)]},'folders':_0x3d7fe7[_0x494cc1(0x1d9)]},'hasChanges':_0x2fcdee||_0x1bcf9c||_0x3f158a||_0x551c50};}function a110_0x3a2b(_0x3cd9d6,_0x2122a8){_0x3cd9d6=_0x3cd9d6-0x16d;const _0x4dbdb6=a110_0x4dbd();let _0x3a2b94=_0x4dbdb6[_0x3cd9d6];return _0x3a2b94;}export async function buildPushExecutionContext(_0x4e03f7,_0x1cb85b,_0x55e9ab,_0x765978,_0x220e27,_0x448b2f){const _0xbc86b9=a110_0x3fa165,_0x4ad815=extractRootFolderId(_0x55e9ab),{pathToId:_0x51f6e7,idToPath:_0x34b7d0}=buildFolderMaps(_0x220e27),_0x51ccd7=buildSegmentNameToIdMap(_0x765978),_0x171dd2=new Map(),{batchAsync:_0x305b2c}=await import(_0xbc86b9(0x174)),[_0x28e5e3,_0x2d598a]=await Promise[_0xbc86b9(0x1a0)]([_0x4e03f7['user']['buildUserMaps'](),_0x4e03f7[_0xbc86b9(0x18d)]['list'](),((async()=>{const _0x2e62dc=_0xbc86b9;!_0x448b2f&&_0x765978[_0x2e62dc(0x1d9)]>0x0&&await _0x305b2c(_0x765978,async _0x43dbf7=>{const _0x29b255=_0x2e62dc,_0x1e0b27=await _0x4e03f7[_0x29b255(0x20e)][_0x29b255(0x1f6)](_0x1cb85b,_0x43dbf7['id']);_0x171dd2['set'](_0x43dbf7['id'],_0x1e0b27);});})())]),{emailToId:_0x50ef48,idToEmail:_0x5c03d8}=_0x28e5e3,_0xb30bd4=buildConnectionMaps(_0x2d598a);return{'rootFolderId':_0x4ad815,'folderPathToId':_0x51f6e7,'folderIdToPath':_0x34b7d0,'segmentNameToId':_0x51ccd7,'activationsBySegmentId':_0x171dd2,'emailToIdMap':_0x50ef48,'idToEmailMap':_0x5c03d8,'connectionNameToIdMap':_0xb30bd4[_0xbc86b9(0x248)],'connectionIdToNameMap':_0xb30bd4[_0xbc86b9(0x247)],'connectionNameToTypeMap':_0xb30bd4[_0xbc86b9(0x207)]};}export function createPushYamlContextForBundle(_0x3c7c4d,_0x428e38,_0x230a33,_0x31bc45,_0x639647,_0xec7827,_0x3d0a9e,_0x2cf11c){const {existingLocalSegmentNames:_0x33133,localExpandedRuleToNames:_0x7a4ee}=_0x31bc45,_0x587dbd=new Set(),_0x2b8136=new Map(),_0x35e29b=new Map(),_0x29fa9d=new Map(),_0x1044ad=createJumpTargetCache(),_0x5747d3=new Map(),_0x373963=new Map(),_0x402574=new Set();let _0x288104;const _0x11f188=_0x429fbd=>{const _0xd928fe={'resolveSegment':async _0xb1f622=>{const _0x1a9009=a110_0x3a2b,_0x598cf3=_0x29fa9d[_0x1a9009(0x172)](_0xb1f622);if(_0x598cf3!==undefined)return{'name':_0x598cf3,'isJourneyLocal':!![]};try{let _0x13cbf6=_0x230a33[_0x1a9009(0x181)](_0x16e407=>_0x16e407['id']===_0xb1f622);!_0x13cbf6&&(_0x13cbf6=await _0x3c7c4d['segment'][_0x1a9009(0x18b)](_0x428e38,_0xb1f622));const _0x3343a5=generateJourneyLocalName(_0x13cbf6[_0x1a9009(0x17e)]),_0x5b0bff=_0x13cbf6['kind']===SEGMENT_KIND_JOURNEY&&_0x3343a5!==undefined;let _0x3df4c5=_0x13cbf6['name'],_0x9fb4df;if(_0x5b0bff&&_0x13cbf6[_0x1a9009(0x200)]){const _0x1d13e6=apiRuleToYaml(_0x13cbf6[_0x1a9009(0x200)]);_0x373963[_0x1a9009(0x1ca)](_0xb1f622,_0x1d13e6);const _0x48233b=async _0x360eb5=>{const _0x216717=_0x1a9009,_0x56c711=collectSegmentRefsFromRule(_0x360eb5);for(const _0x2d9fa0 of _0x56c711){if(!_0x373963['has'](_0x2d9fa0))try{const _0x225c77=await _0x3c7c4d['segment'][_0x216717(0x18b)](_0x428e38,_0x2d9fa0);if(_0x225c77?.[_0x216717(0x200)]){const _0x1ab563=apiRuleToYaml(_0x225c77['rule']);_0x373963['set'](_0x2d9fa0,_0x1ab563),await _0x48233b(_0x1ab563);}}catch{}}};await _0x48233b(_0x1d13e6);const _0x451ac6=serializeExpandedRule(_0x1d13e6,_0x373963),_0x56138c=_0x7a4ee['get'](_0x451ac6);if(_0x56138c&&_0x56138c[_0x1a9009(0x1d9)]>0x0){const _0x20279d=_0x2b8136[_0x1a9009(0x172)](_0x451ac6)||0x0,_0x119ba6=_0x56138c[_0x20279d]||_0x56138c[_0x56138c[_0x1a9009(0x1d9)]-0x1];_0x2b8136[_0x1a9009(0x1ca)](_0x451ac6,_0x20279d+0x1),_0x3df4c5=_0x119ba6,_0x587dbd['add'](_0x3df4c5),_0x29fa9d[_0x1a9009(0x1ca)](_0xb1f622,_0x3df4c5);const _0x54893f=await resolveRuleSegmentRefs(_0x1d13e6,async _0x42f503=>{const _0x58a3fb=_0x1a9009,_0x404390=_0x29fa9d[_0x58a3fb(0x172)](_0x42f503);if(_0x404390)return _0x404390;const _0x744798=await _0x288104[_0x58a3fb(0x22f)](_0x42f503);return _0x744798['name'];});_0x9fb4df={'description':_0x13cbf6[_0x1a9009(0x19d)],'rule':_0x54893f};}else{const _0x387cf0=_0x5747d3[_0x1a9009(0x172)](_0x451ac6);if(_0x387cf0)_0x3df4c5=_0x387cf0,_0x29fa9d[_0x1a9009(0x1ca)](_0xb1f622,_0x3df4c5);else{if(_0x3343a5){let _0x4df927=_0x3343a5,_0x1ff1bb=0x2;while(_0x587dbd['has'](_0x4df927)||_0x33133[_0x1a9009(0x1e2)](_0x4df927)){_0x4df927=_0x3343a5+'_'+_0x1ff1bb,_0x1ff1bb++;}_0x587dbd['add'](_0x4df927),_0x3df4c5=_0x4df927;}_0x29fa9d['set'](_0xb1f622,_0x3df4c5),_0x5747d3[_0x1a9009(0x1ca)](_0x451ac6,_0x3df4c5);const _0x105c9c=await resolveRuleSegmentRefs(_0x1d13e6,async _0x3b42f2=>{const _0x4ef59e=_0x1a9009,_0x316d0c=_0x29fa9d[_0x4ef59e(0x172)](_0x3b42f2);if(_0x316d0c)return _0x316d0c;const _0x5337db=await _0x288104[_0x4ef59e(0x22f)](_0x3b42f2);return _0x5337db['name'];});_0x9fb4df={'description':_0x13cbf6[_0x1a9009(0x19d)],'rule':_0x105c9c};}}}return{'name':_0x3df4c5,'isJourneyLocal':_0x5b0bff,'definition':_0x9fb4df};}catch{return{'name':_0xb1f622,'isJourneyLocal':![]};}},'resolveActivation':async _0x37e804=>{const _0x4708e5=a110_0x3a2b,_0x41948d=_0x35e29b[_0x4708e5(0x172)](_0x37e804);if(_0x41948d!==undefined)return{'name':_0x41948d,'isJourneyLocal':!![]};try{let _0x5d3bf0=_0x3d0a9e?.[_0x4708e5(0x172)](_0x37e804);!_0x5d3bf0&&(_0x5d3bf0=await _0x3c7c4d[_0x4708e5(0x1cf)][_0x4708e5(0x220)](_0x429fbd,_0x37e804));const _0x1acf35=_0x5d3bf0[_0x4708e5(0x217)][_0x4708e5(0x202)]['name']||_0x37e804,_0x22c816=sanitizeYamlKey(_0x1acf35)||'activation_'+_0x37e804,_0x4e20eb=_0x22c816;_0x35e29b[_0x4708e5(0x1ca)](_0x37e804,_0x4e20eb);const _0x4afd2b=journeyActivationStepToYaml(_0x5d3bf0,_0x639647,_0xec7827);return{'name':_0x4e20eb,'isJourneyLocal':!![],'definition':_0x4afd2b};}catch{return{'name':_0x37e804,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x282e83,_0x95d88e)=>resolveJumpTarget(_0x282e83,_0x95d88e,_0x1044ad,async _0x2b7da6=>{const _0x4d218f=a110_0x3a2b,_0x466d09=_0x2cf11c?.[_0x4d218f(0x172)](_0x2b7da6);if(_0x466d09)return _0x466d09;return _0x3c7c4d['journey']['getJourney'](_0x2b7da6);})};return _0x288104=_0xd928fe,_0xd928fe;},_0x233f54=async _0x20d9c3=>{const _0x18a5f8=a110_0x3a2b,{collectSegmentIdsFromJourneyApi:_0x5a5317}=await import(_0x18a5f8(0x233)),{batchAsync:_0x3f0faf}=await import(_0x18a5f8(0x174)),_0x1bf38e=new Set();for(const _0x1a81b3 of _0x20d9c3){let _0x428684=_0x2cf11c?.[_0x18a5f8(0x172)](_0x1a81b3);!_0x428684&&(_0x428684=await _0x3c7c4d[_0x18a5f8(0x1cf)]['getJourney'](_0x1a81b3));const _0x234710=_0x5a5317(_0x428684);for(const _0x310b33 of _0x234710){_0x1bf38e['add'](_0x310b33);}}let _0x288da8=Array[_0x18a5f8(0x1c1)](_0x1bf38e);while(_0x288da8[_0x18a5f8(0x1d9)]>0x0){const _0x5606dc=_0x288da8[_0x18a5f8(0x1d7)](_0x5b0cee=>!_0x402574[_0x18a5f8(0x1e2)](_0x5b0cee));if(_0x5606dc[_0x18a5f8(0x1d9)]===0x0)break;const _0x3879a7=await _0x3f0faf(_0x5606dc,async _0x332fa8=>{const _0x16e39c=_0x18a5f8;_0x402574['add'](_0x332fa8);let _0x575b4d=_0x230a33['find'](_0x47bc7a=>_0x47bc7a['id']===_0x332fa8);if(!_0x575b4d)try{_0x575b4d=await _0x3c7c4d[_0x16e39c(0x20e)]['getSegment'](_0x428e38,_0x332fa8);}catch{return null;}return{'segmentId':_0x332fa8,'segment':_0x575b4d};},0xa),_0x23c3b3=new Set();for(const _0x360b13 of _0x3879a7){if(!_0x360b13?.[_0x18a5f8(0x20e)]?.[_0x18a5f8(0x200)])continue;const _0x5a7690=apiRuleToYaml(_0x360b13[_0x18a5f8(0x20e)][_0x18a5f8(0x200)]);_0x373963['set'](_0x360b13[_0x18a5f8(0x184)],_0x5a7690);const _0x23f1c7=collectSegmentRefsFromRule(_0x5a7690);for(const _0x4ecc90 of _0x23f1c7){!_0x402574[_0x18a5f8(0x1e2)](_0x4ecc90)&&_0x23c3b3[_0x18a5f8(0x1d0)](_0x4ecc90);}}_0x288da8=Array[_0x18a5f8(0x1c1)](_0x23c3b3);}};return{'createYamlContext':_0x11f188,'prefetchJourneySegments':_0x233f54};}export async function executePushSegments(_0x1f7dd8,_0x2570d8,_0x405f95,_0x27f88b,_0x3cbf41){const _0x47cbf7=a110_0x3fa165,{segmentDefToCreateRequest:_0x31d92b,segmentDefToUpdateRequest:_0x5ab716}=await import(_0x47cbf7(0x244)),_0x57a6c5=_0x405f95[_0x47cbf7(0x1de)],_0x26a27b=0x5,_0x4c2dfc=async _0x3845d4=>{const _0x3f6c89=_0x47cbf7,_0x5210e7=_0x3845d4[_0x3f6c89(0x238)]?_0x57a6c5[_0x3f6c89(0x172)](_0x3845d4['folderPath']):undefined;let _0x925fd2;const _0x25507e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x3845d4[_0x3f6c89(0x1c7)]){_0x3cbf41[_0x3f6c89(0x222)]?.({'type':_0x3f6c89(0x1a4),'name':_0x3845d4[_0x3f6c89(0x16f)][_0x3f6c89(0x17e)]});const _0x1db2ee=_0x31d92b(_0x3845d4[_0x3f6c89(0x16f)],_0x5210e7),_0xddd1b3=await _0x3cbf41['withProgress'](_0x3f6c89(0x190)+_0x3845d4['yamlConfig'][_0x3f6c89(0x17e)]+_0x3f6c89(0x1df),()=>_0x1f7dd8[_0x3f6c89(0x20e)][_0x3f6c89(0x21d)](_0x27f88b['parentId'],_0x1db2ee));_0x925fd2=_0xddd1b3[_0x3f6c89(0x1f5)]['id'],_0x25507e[_0x3f6c89(0x1ab)]={'name':_0x3845d4['yamlConfig'][_0x3f6c89(0x17e)],'id':_0x925fd2},_0x3cbf41['onProgress']?.({'type':'segment_created','name':_0x3845d4['yamlConfig']['name'],'segmentId':_0x925fd2}),_0x3cbf41[_0x3f6c89(0x1be)]?.('Created\x20segment\x20\x27'+_0x3845d4[_0x3f6c89(0x16f)][_0x3f6c89(0x17e)]+'\x27'),_0x25507e[_0x3f6c89(0x232)]=0x1;}else{if(_0x3845d4[_0x3f6c89(0x221)]){_0x3cbf41['onProgress']?.({'type':'segment_updating','name':_0x3845d4[_0x3f6c89(0x16f)][_0x3f6c89(0x17e)]});const _0x3c394c=_0x5ab716(_0x3845d4[_0x3f6c89(0x16f)]);_0x5210e7!==_0x3845d4[_0x3f6c89(0x1fd)]?.[_0x3f6c89(0x17b)]&&(_0x3c394c['segmentFolderId']=_0x5210e7?parseInt(_0x5210e7,0xa):undefined),await _0x3cbf41[_0x3f6c89(0x228)](_0x3f6c89(0x216)+_0x3845d4[_0x3f6c89(0x16f)]['name']+'\x27...',()=>_0x1f7dd8['segment'][_0x3f6c89(0x185)](_0x27f88b['parentId'],_0x3845d4[_0x3f6c89(0x1fd)]['id'],_0x3c394c)),_0x925fd2=_0x3845d4['existingSegment']['id'],_0x3cbf41[_0x3f6c89(0x222)]?.({'type':'segment_updated','name':_0x3845d4[_0x3f6c89(0x16f)][_0x3f6c89(0x17e)]}),_0x3cbf41['logSuccess']?.(_0x3f6c89(0x219)+_0x3845d4[_0x3f6c89(0x16f)]['name']+'\x27'),_0x25507e[_0x3f6c89(0x212)]=0x1;}else _0x925fd2=_0x3845d4[_0x3f6c89(0x1fd)]['id'];}}catch(_0x1ba00d){const _0x532053=isHttp400Error(_0x1ba00d),_0x45dfd4=_0x532053?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x3f6c89(0x227)],_0x416fcb=getErrorMessage(_0x1ba00d);throw new SDKError(_0x45dfd4,'Failed\x20to\x20'+(_0x3845d4[_0x3f6c89(0x1c7)]?'create':_0x3f6c89(0x198))+_0x3f6c89(0x1b1)+_0x3845d4[_0x3f6c89(0x1fb)]+'\x0a\x20\x20'+_0x416fcb,_0x1ba00d);}try{const _0x929318=await syncActivationsForSegment(_0x1f7dd8,_0x27f88b[_0x3f6c89(0x235)],_0x925fd2,_0x3845d4[_0x3f6c89(0x16f)][_0x3f6c89(0x17e)],_0x3845d4[_0x3f6c89(0x1fa)],_0x3cbf41,_0x3845d4['absolutePath']);_0x25507e[_0x3f6c89(0x19a)]=_0x929318;}catch(_0x5cf45d){if(_0x5cf45d instanceof SDKError)throw _0x5cf45d;throw new SDKError(ErrorCode[_0x3f6c89(0x18c)],_0x3f6c89(0x1f4)+_0x3845d4['yamlConfig'][_0x3f6c89(0x17e)]+_0x3f6c89(0x1bc)+_0x3845d4['absolutePath']+_0x3f6c89(0x16d)+getErrorMessage(_0x5cf45d),_0x5cf45d);}return _0x25507e;},_0x495f80=await batchAsync(_0x2570d8,_0x4c2dfc,_0x26a27b),_0x1e8ede={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3fb81e of _0x495f80){_0x1e8ede[_0x47cbf7(0x232)]+=_0x3fb81e[_0x47cbf7(0x232)],_0x1e8ede[_0x47cbf7(0x212)]+=_0x3fb81e[_0x47cbf7(0x212)],_0x3fb81e[_0x47cbf7(0x1ab)]&&_0x1e8ede[_0x47cbf7(0x22a)]['set'](_0x3fb81e[_0x47cbf7(0x1ab)]['name'],_0x3fb81e[_0x47cbf7(0x1ab)]['id']),_0x1e8ede[_0x47cbf7(0x19a)][_0x47cbf7(0x232)]+=_0x3fb81e[_0x47cbf7(0x19a)][_0x47cbf7(0x232)],_0x1e8ede[_0x47cbf7(0x19a)][_0x47cbf7(0x212)]+=_0x3fb81e[_0x47cbf7(0x19a)]['updated'],_0x1e8ede['activations'][_0x47cbf7(0x1a8)]+=_0x3fb81e[_0x47cbf7(0x19a)][_0x47cbf7(0x1a8)];}return _0x1e8ede;}async function syncActivationsForSegment(_0x3f5484,_0x1ed7e7,_0xb57d97,_0xd371b9,_0x55e3d5,_0x1ed410,_0x12744f){const _0x39d105=a110_0x3fa165,_0x2165fd={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xd6d3d4 of _0x55e3d5){try{if(_0xd6d3d4[_0x39d105(0x1e6)]===_0x39d105(0x1f7)&&_0xd6d3d4[_0x39d105(0x1d8)])_0x1ed410['onProgress']?.({'type':_0x39d105(0x1f9),'segmentName':_0xd371b9,'activationName':_0xd6d3d4[_0x39d105(0x17e)]}),await _0x1ed410[_0x39d105(0x228)](_0x39d105(0x1ea)+_0xd6d3d4[_0x39d105(0x17e)]+_0x39d105(0x1df),()=>_0x3f5484[_0x39d105(0x20e)][_0x39d105(0x18e)](_0x1ed7e7,_0xb57d97,_0xd6d3d4[_0x39d105(0x1d8)])),_0x1ed410[_0x39d105(0x222)]?.({'type':_0x39d105(0x196),'segmentName':_0xd371b9,'activationName':_0xd6d3d4[_0x39d105(0x17e)]}),_0x1ed410[_0x39d105(0x1be)]?.(_0x39d105(0x1ae)+_0xd6d3d4['name']+'\x27'),_0x2165fd[_0x39d105(0x232)]++;else{if(_0xd6d3d4['type']===_0x39d105(0x198)&&_0xd6d3d4[_0x39d105(0x1d8)]&&_0xd6d3d4[_0x39d105(0x183)])_0x1ed410[_0x39d105(0x222)]?.({'type':_0x39d105(0x1f0),'segmentName':_0xd371b9,'activationName':_0xd6d3d4[_0x39d105(0x17e)]}),await _0x1ed410[_0x39d105(0x228)]('Updating\x20activation\x20\x27'+_0xd6d3d4['name']+_0x39d105(0x1df),()=>_0x3f5484[_0x39d105(0x20e)]['updateActivation'](_0x1ed7e7,_0xb57d97,_0xd6d3d4[_0x39d105(0x183)]['id'],_0xd6d3d4[_0x39d105(0x1d8)])),_0x1ed410['onProgress']?.({'type':'activation_updated','segmentName':_0xd371b9,'activationName':_0xd6d3d4[_0x39d105(0x17e)]}),_0x1ed410['logSuccess']?.(_0x39d105(0x20c)+_0xd6d3d4[_0x39d105(0x17e)]+'\x27'),_0x2165fd[_0x39d105(0x212)]++;else _0xd6d3d4['type']===_0x39d105(0x20a)&&_0xd6d3d4[_0x39d105(0x183)]&&(_0x1ed410[_0x39d105(0x222)]?.({'type':_0x39d105(0x237),'segmentName':_0xd371b9,'activationName':_0xd6d3d4[_0x39d105(0x17e)]}),await _0x1ed410[_0x39d105(0x228)](_0x39d105(0x187)+_0xd6d3d4[_0x39d105(0x17e)]+'\x27...',()=>_0x3f5484[_0x39d105(0x20e)][_0x39d105(0x1b3)](_0x1ed7e7,_0xb57d97,_0xd6d3d4[_0x39d105(0x183)]['id'])),_0x1ed410['onProgress']?.({'type':_0x39d105(0x1ec),'segmentName':_0xd371b9,'activationName':_0xd6d3d4['name']}),_0x1ed410[_0x39d105(0x231)]?.('Deleted\x20activation\x20\x27'+_0xd6d3d4[_0x39d105(0x17e)]+'\x27'),_0x2165fd[_0x39d105(0x1a8)]++);}}catch(_0x2bb80e){const _0x23e1cd=isHttp400Error(_0x2bb80e),_0x217f39=_0x23e1cd?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x4681d8=getErrorMessage(_0x2bb80e);throw new SDKError(_0x217f39,'Failed\x20to\x20'+_0xd6d3d4[_0x39d105(0x1e6)]+_0x39d105(0x23b)+_0xd6d3d4[_0x39d105(0x17e)]+_0x39d105(0x1bc)+_0x12744f+'\x0a\x20\x20'+_0x4681d8,_0x2bb80e);}}return _0x2165fd;}export async function executePushFolders(_0x5694bc,_0x72a629,_0x170216,_0x2c1c14,_0x3b6ab3){const _0x595d82=a110_0x3fa165,_0x46a668=new Map(_0x170216);for(const _0x383bf of _0x72a629){const _0x3f2c57=_0x383bf[_0x595d82(0x1eb)]('/'),_0x19151a=_0x3f2c57[_0x3f2c57[_0x595d82(0x1d9)]-0x1],_0x1cea78=_0x3f2c57[_0x595d82(0x1c5)](0x0,-0x1)['join']('/'),_0x3cb1b9=_0x46a668[_0x595d82(0x172)](_0x1cea78);_0x3b6ab3[_0x595d82(0x222)]?.({'type':_0x595d82(0x23c),'folder':_0x383bf});const _0x495a5f={'name':_0x19151a,'parentFolderId':_0x3cb1b9},_0xb19b5=await _0x3b6ab3[_0x595d82(0x228)](_0x595d82(0x19e)+_0x383bf+_0x595d82(0x1df),()=>_0x5694bc['segment'][_0x595d82(0x1b9)](_0x2c1c14[_0x595d82(0x235)],_0x495a5f));_0x46a668[_0x595d82(0x1ca)](_0x383bf,_0xb19b5[_0x595d82(0x1f5)]['id']),_0x3b6ab3[_0x595d82(0x222)]?.({'type':'folder_created','folder':_0x383bf,'folderId':_0xb19b5[_0x595d82(0x1f5)]['id']}),_0x3b6ab3[_0x595d82(0x1af)]?.(_0x595d82(0x1cb)+_0x383bf+'\x27');}return _0x46a668;}export async function executePushSegmentDeletions(_0x1dfa10,_0xf64d62,_0x11408d){const _0x21b31e=a110_0x3fa165;if(_0xf64d62[_0x21b31e(0x1d9)]===0x0)return 0x0;const {batchAsync:_0x34f54b}=await import(_0x21b31e(0x174)),_0x25ed04=0x5,_0x32634e=await _0x34f54b(_0xf64d62,async _0x4face1=>{const _0x501b47=_0x21b31e;return _0x11408d[_0x501b47(0x222)]?.({'type':'segment_deleting','name':_0x4face1[_0x501b47(0x17e)]}),await _0x1dfa10[_0x501b47(0x20e)][_0x501b47(0x1ff)](_0x4face1['id']),_0x11408d['onProgress']?.({'type':_0x501b47(0x19b),'name':_0x4face1[_0x501b47(0x17e)]}),_0x11408d[_0x501b47(0x231)]?.(_0x501b47(0x1c9)+_0x4face1['name']+'\x27'),0x1;},_0x25ed04);return _0x32634e[_0x21b31e(0x1bb)]((_0x18a73e,_0x559c38)=>_0x18a73e+_0x559c38,0x0);}export async function executePushJourneys(_0x1280ea,_0xf9bed3,_0x2628d7,_0x2ebd65,_0x3cb63d){const _0x50ccfd=a110_0x3fa165,{journeyDefToRequest:_0xa6beb}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x4bc9f9,yamlRuleToApi:_0x33de99,validateSegmentRule:_0x4d2ed9}=await import(_0x50ccfd(0x244)),_0x10c098={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2146dc=new Map(_0x2628d7['segmentNameToId']),_0x3207d1=0x5;for(let _0x3156ce=0x0;_0x3156ce<_0xf9bed3[_0x50ccfd(0x1d9)];_0x3156ce+=_0x3207d1){const _0x383082=_0xf9bed3[_0x50ccfd(0x1c5)](_0x3156ce,_0x3156ce+_0x3207d1),_0x4d18b6=await Promise[_0x50ccfd(0x1a0)](_0x383082[_0x50ccfd(0x1b8)](async _0x41980f=>{const _0x12abcf=_0x50ccfd;if(!_0x41980f[_0x12abcf(0x1c7)]&&!_0x41980f[_0x12abcf(0x221)])return{'action':_0x12abcf(0x1f3),'name':_0x41980f['yamlConfig'][_0x12abcf(0x17e)],'journeyId':_0x41980f['existingJourney']?.['id']};const _0x17f764=_0x41980f['folderPath']?_0x2628d7[_0x12abcf(0x1de)]['get'](_0x41980f['folderPath']):undefined;_0x3cb63d['onProgress']?.({'type':_0x41980f['isNew']?_0x12abcf(0x1cd):_0x12abcf(0x22e),'name':_0x41980f[_0x12abcf(0x16f)]['name']});try{const _0x2f8351=await executeSingleJourneyPush(_0x1280ea,_0x41980f,{..._0x2628d7,'segmentNameToId':_0x2146dc},{'parentId':_0x2ebd65['parentId'],'rootFolderId':_0x2ebd65[_0x12abcf(0x243)],'folderId':_0x17f764,'verbose':_0x2ebd65['verbose']},_0x3cb63d,{'journeyDefToRequest':_0xa6beb,'activationDefToCreateRequest':_0x4bc9f9,'yamlRuleToApi':_0x33de99,'validateSegmentRule':_0x4d2ed9});for(const [_0x369986,_0x2cd06d]of _0x2f8351[_0x12abcf(0x1f1)]){_0x2146dc[_0x12abcf(0x1ca)](_0x369986,_0x2cd06d),_0x10c098['embeddedSegmentNameToId']['set'](_0x369986,_0x2cd06d);}if(_0x2f8351[_0x12abcf(0x1dc)]===_0x12abcf(0x232))_0x3cb63d['onProgress']?.({'type':_0x12abcf(0x225),'name':_0x41980f[_0x12abcf(0x16f)]['name'],'journeyId':_0x2f8351[_0x12abcf(0x1bf)]}),_0x3cb63d[_0x12abcf(0x1be)]?.(_0x12abcf(0x1b6)+_0x41980f[_0x12abcf(0x16f)]['name']+'\x27'),_0x10c098[_0x12abcf(0x232)]++;else _0x2f8351[_0x12abcf(0x1dc)]===_0x12abcf(0x212)&&(_0x3cb63d[_0x12abcf(0x222)]?.({'type':'journey_updated','name':_0x41980f[_0x12abcf(0x16f)][_0x12abcf(0x17e)]}),_0x3cb63d['logSuccess']?.(_0x12abcf(0x1aa)+_0x41980f[_0x12abcf(0x16f)]['name']+'\x27'),_0x10c098[_0x12abcf(0x212)]++);return{'action':_0x2f8351[_0x12abcf(0x1dc)],'name':_0x41980f[_0x12abcf(0x16f)][_0x12abcf(0x17e)],'journeyId':_0x2f8351[_0x12abcf(0x1bf)]};}catch(_0x4b389d){const _0x47dde6=isHttp400Error(_0x4b389d),_0x5a3cf3=_0x47dde6?ErrorCode[_0x12abcf(0x208)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x201f53=getErrorMessage(_0x4b389d);throw new SDKError(_0x5a3cf3,_0x12abcf(0x1ac)+(_0x41980f[_0x12abcf(0x1c7)]?'create':'update')+_0x12abcf(0x1d3)+_0x41980f[_0x12abcf(0x1fb)]+_0x12abcf(0x16d)+_0x201f53,_0x4b389d);}}));_0x10c098[_0x50ccfd(0x186)][_0x50ccfd(0x1d4)](..._0x4d18b6);}return _0x10c098;}async function executeSingleJourneyPush(_0x330a6f,_0x2ca680,_0x56d236,_0x24fd2d,_0x1b30b7,_0x21269c){const _0x2a807d=a110_0x3fa165,{journeyDefToRequest:_0x16d8b4,activationDefToCreateRequest:_0x17b68b,yamlRuleToApi:_0x43ba0c,validateSegmentRule:_0x3c98ad}=_0x21269c,_0x4a31a6=new Map(),_0x4866c8=new Map(),_0x37bb1e=new Map(),_0x46ba64=new Map(),_0x3cb54c=new Map();let _0x1a6a6d;const _0x4aa67f=async()=>{const _0x5ed2cc=a110_0x3a2b;if(_0x1a6a6d)return;_0x1a6a6d=new Map();if(!_0x2ca680[_0x5ed2cc(0x1ce)])return;const _0x421ad5=await _0x330a6f['journey'][_0x5ed2cc(0x1f6)](_0x2ca680['existingJourney']['id']);for(const _0x5df310 of _0x421ad5){const _0x274919=journeyActivationStepToYaml(_0x5df310,_0x56d236['idToEmailMap'],_0x56d236['connectionIdToNameMap']),_0x265e54=activationSignature(_0x274919);!_0x1a6a6d[_0x5ed2cc(0x1e2)](_0x265e54)&&_0x1a6a6d[_0x5ed2cc(0x1ca)](_0x265e54,_0x5df310['id']),_0x274919[_0x5ed2cc(0x17e)]&&_0x4866c8[_0x5ed2cc(0x1ca)](_0x274919[_0x5ed2cc(0x17e)],_0x5df310['id']);}};if(_0x2ca680[_0x2a807d(0x1ce)]&&_0x2ca680[_0x2a807d(0x16f)][_0x2a807d(0x18f)]){const _0x1c9511=buildLocalExpandedRuleMappings(_0x2ca680[_0x2a807d(0x16f)]),_0x5e5893=_0x1c9511[_0x2a807d(0x1ed)];if(_0x5e5893[_0x2a807d(0x1a5)]>0x0){const _0x43b14e=new Map();for(const [_0x2910e7,_0x18b837]of _0x5e5893){const _0x4122e3=serializeExpandedRule(_0x18b837,_0x5e5893);_0x43b14e['set'](_0x2910e7,_0x4122e3);}const _0x2aed0c=collectSegmentIdsFromJourneyApi(_0x2ca680['existingJourney']);if(_0x2aed0c[_0x2a807d(0x1a5)]>0x0){const _0x56aefc=await buildServerSegmentRuleMap(_0x330a6f,_0x24fd2d[_0x2a807d(0x235)],_0x56d236[_0x2a807d(0x180)],_0x2aed0c);if(_0x56aefc[_0x2a807d(0x1a5)]>0x0){const _0x285f9c=new Map();for(const [_0x5cfeae,_0x2814a6]of _0x56aefc){const _0x3b48b6=serializeExpandedRule(_0x2814a6,_0x56aefc);!_0x285f9c[_0x2a807d(0x1e2)](_0x3b48b6)&&_0x285f9c[_0x2a807d(0x1ca)](_0x3b48b6,_0x5cfeae);}for(const [_0x2e2046,_0x1bbf7b]of _0x43b14e){const _0x35a093=_0x285f9c[_0x2a807d(0x172)](_0x1bbf7b);_0x35a093&&(_0x3cb54c[_0x2a807d(0x1ca)](_0x2e2046,_0x35a093),_0x56d236['segmentNameToId']['set'](_0x2e2046,_0x35a093));}}}}}const _0x201f9={'resolveSegmentId':async _0x36a3fb=>{const _0x5e2972=_0x2a807d,_0x5a764f=_0x56d236[_0x5e2972(0x206)][_0x5e2972(0x172)](_0x36a3fb);if(!_0x5a764f)throw new SDKError(ErrorCode[_0x5e2972(0x1c8)],'Segment\x20not\x20found:\x20'+_0x36a3fb+_0x5e2972(0x1a7)+_0x2ca680[_0x5e2972(0x16f)]['name']+')');return _0x5a764f;},'resolveEmbeddedSegmentId':async(_0x2c2ee0,_0x3ac191)=>{const _0x402532=_0x2a807d,_0x571e4b=_0x56d236[_0x402532(0x206)][_0x402532(0x172)](_0x2c2ee0);if(_0x571e4b)return _0x571e4b;const _0x26312d=_0x3cb54c[_0x402532(0x172)](_0x2c2ee0);if(_0x26312d)return _0x56d236[_0x402532(0x206)][_0x402532(0x1ca)](_0x2c2ee0,_0x26312d),_0x26312d;const _0x13f032=_0x56d236['existingSegments'][_0x402532(0x181)](_0x20562a=>_0x20562a[_0x402532(0x17e)]===_0x2c2ee0);if(_0x13f032)return _0x56d236['segmentNameToId'][_0x402532(0x1ca)](_0x2c2ee0,_0x13f032['id']),_0x13f032['id'];if(_0x2ca680[_0x402532(0x1c7)]){const {stageName:_0x4fb2ee,criteriaName:_0x1c4083}=findSegmentCriteriaLocation(_0x2ca680['yamlConfig'],_0x2c2ee0);return _0x3c98ad(_0x2c2ee0,_0x3ac191[_0x402532(0x200)]),_0x37bb1e['set'](_0x2c2ee0,{'definition':_0x3ac191,'stageName':_0x4fb2ee,'criteriaName':_0x1c4083}),createPendingSegmentId(_0x2c2ee0);}const _0x451855=_0x2ca680[_0x402532(0x1ce)]?.['id'];if(!_0x451855)throw new SDKError(ErrorCode[_0x402532(0x1b2)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x3c98ad(_0x2c2ee0,_0x3ac191[_0x402532(0x200)]);const _0x10b9e4=generateDeterministicJourneySegmentName(_0x2ca680[_0x402532(0x16f)][_0x402532(0x17e)],_0x2c2ee0),_0x20f949=_0x56d236[_0x402532(0x180)][_0x402532(0x181)](_0x3fe51f=>_0x3fe51f[_0x402532(0x17e)]===_0x10b9e4),_0x16ff63=createSegmentIdResolver(_0x56d236[_0x402532(0x206)],_0x2c2ee0),_0x424008=await resolveRuleSegmentIds(_0x3ac191[_0x402532(0x200)],_0x16ff63);let _0x5539d7;if(_0x20f949)await _0x330a6f['segment'][_0x402532(0x185)](_0x24fd2d['parentId'],_0x20f949['id'],{'description':_0x3ac191[_0x402532(0x19d)]||_0x402532(0x213)+_0x2c2ee0,'rule':_0x43ba0c(_0x424008,!![]),'countPopulation':!![]}),_0x5539d7=_0x20f949['id'];else try{_0x5539d7=await _0x330a6f['segment'][_0x402532(0x182)]({'name':_0x10b9e4,'description':_0x3ac191['description']||_0x402532(0x213)+_0x2c2ee0,'journeyId':_0x451855,'rule':_0x43ba0c(_0x424008,!![]),'countPopulation':!![],'parentFolderId':_0x24fd2d['rootFolderId']||'','audienceId':_0x24fd2d[_0x402532(0x235)]});}catch(_0x5eecb8){const _0x509085=_0x5eecb8 instanceof Error&&_0x5eecb8[_0x402532(0x178)][_0x402532(0x21b)]('Name\x20has\x20already\x20been\x20taken');if(_0x509085){const _0x3e2987=await _0x330a6f[_0x402532(0x20e)][_0x402532(0x223)](_0x24fd2d[_0x402532(0x235)]),_0x29fa17=_0x3e2987['find'](_0x5672c8=>_0x5672c8[_0x402532(0x17e)]===_0x10b9e4);if(_0x29fa17)await _0x330a6f[_0x402532(0x20e)][_0x402532(0x185)](_0x24fd2d[_0x402532(0x235)],_0x29fa17['id'],{'description':_0x3ac191['description']||'Entry\x20criteria:\x20'+_0x2c2ee0,'rule':_0x43ba0c(_0x424008,!![]),'countPopulation':!![]}),_0x5539d7=_0x29fa17['id'];else throw _0x5eecb8;}else throw _0x5eecb8;}return _0x56d236[_0x402532(0x206)]['set'](_0x2c2ee0,_0x5539d7),_0x4a31a6['set'](_0x2c2ee0,_0x5539d7),_0x5539d7;},'resolveActivationId':async _0x51b3ce=>{const _0x1ec051=_0x2a807d,_0x4c53b4=_0x4866c8[_0x1ec051(0x172)](_0x51b3ce);if(_0x4c53b4)return _0x4c53b4;if(_0x2ca680['existingJourney']){await _0x4aa67f();const _0xcb6a26=_0x4866c8[_0x1ec051(0x172)](_0x51b3ce);if(_0xcb6a26)return _0xcb6a26;}throw new SDKError(ErrorCode[_0x1ec051(0x204)],_0x1ec051(0x1e9)+_0x51b3ce+_0x1ec051(0x1a7)+_0x2ca680[_0x1ec051(0x16f)][_0x1ec051(0x17e)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x394427,_0x18e936)=>{const _0x22ce38=_0x2a807d,_0x1f776c=_0x4866c8[_0x22ce38(0x172)](_0x394427);if(_0x1f776c)return _0x1f776c;if(_0x2ca680['isNew'])return _0x46ba64['set'](_0x394427,_0x18e936),createPendingActivationId(_0x394427);if(_0x2ca680[_0x22ce38(0x1ce)]){await _0x4aa67f();const _0x5665d3=_0x4866c8[_0x22ce38(0x172)](_0x18e936[_0x22ce38(0x17e)]);if(_0x5665d3)return _0x4866c8[_0x22ce38(0x1ca)](_0x394427,_0x5665d3),_0x5665d3;const _0x542bac=activationSignature(_0x18e936),_0x333c43=_0x1a6a6d?.[_0x22ce38(0x172)](_0x542bac);if(_0x333c43)return _0x4866c8[_0x22ce38(0x1ca)](_0x394427,_0x333c43),_0x333c43;const _0xe86961=await _0x17b68b(_0x18e936,_0x56d236[_0x22ce38(0x1ef)]),_0x44fc3b=await _0x330a6f[_0x22ce38(0x1cf)][_0x22ce38(0x18e)](_0x2ca680[_0x22ce38(0x1ce)]['id'],_0xe86961);return _0x4866c8[_0x22ce38(0x1ca)](_0x394427,_0x44fc3b['id']),_0x44fc3b['id'];}throw new SDKError(ErrorCode[_0x22ce38(0x1b2)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x2d2254=>{const _0x44aeec=_0x2a807d;try{return await _0x330a6f[_0x44aeec(0x1cf)][_0x44aeec(0x19f)](_0x24fd2d['parentId'],_0x2d2254);}catch(_0x541e4){throw new SDKError(ErrorCode[_0x44aeec(0x204)],_0x44aeec(0x234)+_0x2d2254+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x2ca680['yamlConfig']['name']+'\x27)',_0x541e4);}},'resolveStageId':async(_0x29d45b,_0x450a1d)=>{const _0x4e0c25=_0x2a807d,_0x1effdb=await _0x330a6f['journey'][_0x4e0c25(0x177)](_0x29d45b),_0x225964=_0x1effdb[_0x4e0c25(0x217)][_0x4e0c25(0x236)][_0x4e0c25(0x181)](_0x30dab2=>_0x30dab2[_0x4e0c25(0x17e)][_0x4e0c25(0x249)]()===_0x450a1d[_0x4e0c25(0x249)]());if(!_0x225964?.['id'])throw new SDKError(ErrorCode[_0x4e0c25(0x204)],'Stage\x20\x27'+_0x450a1d+_0x4e0c25(0x23f)+(_0x1effdb[_0x4e0c25(0x217)][_0x4e0c25(0x1d1)]||_0x1effdb[_0x4e0c25(0x217)][_0x4e0c25(0x17e)])+'\x27');return _0x225964['id'];}},_0x4d46bd=await _0x16d8b4(_0x2ca680[_0x2a807d(0x16f)],_0x24fd2d['parentId'],_0x201f9),_0x8fc24=_0x24fd2d['folderId']||_0x24fd2d[_0x2a807d(0x243)];_0x8fc24&&(_0x4d46bd[_0x2a807d(0x20b)]={'parentFolder':{'data':{'id':_0x8fc24,'type':_0x2a807d(0x170)}}});if(_0x2ca680[_0x2a807d(0x1c7)]){if(_0x37bb1e[_0x2a807d(0x1a5)]>0x0||_0x46ba64[_0x2a807d(0x1a5)]>0x0)return await executeThreeStepJourneyCreate(_0x330a6f,_0x2ca680,_0x4d46bd,{'pendingEmbeddedSegments':_0x37bb1e,'pendingEmbeddedActivations':_0x46ba64,'embeddedSegmentNameToId':_0x4a31a6,'journeyActivationNameToId':_0x4866c8},{..._0x24fd2d,'effectiveFolderId':_0x8fc24},_0x56d236,_0x1b30b7,_0x21269c);else{ensureJourneyDefaults(_0x4d46bd[_0x2a807d(0x217)]);const _0x5e373e=await _0x330a6f[_0x2a807d(0x1cf)][_0x2a807d(0x1f7)](_0x4d46bd);return{'action':_0x2a807d(0x232),'journeyId':_0x5e373e['id'],'embeddedSegmentNameToId':_0x4a31a6};}}else{if(_0x2ca680[_0x2a807d(0x221)]&&_0x2ca680[_0x2a807d(0x1ce)])return ensureJourneyDefaults(_0x4d46bd['attributes']),await _0x330a6f[_0x2a807d(0x1cf)][_0x2a807d(0x198)](_0x2ca680[_0x2a807d(0x1ce)]['id'],_0x4d46bd),{'action':'updated','journeyId':_0x2ca680[_0x2a807d(0x1ce)]['id'],'embeddedSegmentNameToId':_0x4a31a6};}return{'action':_0x2a807d(0x1f3),'journeyId':_0x2ca680[_0x2a807d(0x1ce)]?.['id'],'embeddedSegmentNameToId':_0x4a31a6};}function findSegmentCriteriaLocation(_0x50bd3f,_0x1e368f){const _0x5efaab=a110_0x3fa165,_0x4fbc7c=_0x50bd3f[_0x5efaab(0x1e5)]||_0x50bd3f[_0x5efaab(0x1fc)]?.[0x0]?.[_0x5efaab(0x1e5)]||[];let _0x1ca337=_0x5efaab(0x246),_0x1a3827=_0x1e368f;const _0x214591=_0x50bd3f[_0x5efaab(0x1c2)]||_0x50bd3f['journeys']?.[0x0]?.['goal'];if(_0x214591?.[_0x5efaab(0x20e)]===_0x1e368f)return{'stageName':_0x5efaab(0x1c2),'criteriaName':_0x214591[_0x5efaab(0x17e)]||_0x1e368f};_0x1eaedb:for(const _0x1eb441 of _0x4fbc7c){if(_0x1eb441['entry_criteria']?.[_0x5efaab(0x20e)]===_0x1e368f){_0x1ca337=_0x1eb441[_0x5efaab(0x17e)],_0x1a3827=_0x1eb441[_0x5efaab(0x22d)][_0x5efaab(0x17e)]||_0x1e368f;break;}if(_0x1eb441[_0x5efaab(0x23a)])for(const _0xbbfce8 of _0x1eb441[_0x5efaab(0x23a)]){if(_0xbbfce8[_0x5efaab(0x1e6)]===_0x5efaab(0x1a9)&&_0xbbfce8[_0x5efaab(0x1e1)]?.['branches'])for(const _0x3bb077 of _0xbbfce8[_0x5efaab(0x1e1)][_0x5efaab(0x191)]){if(_0x3bb077['segment']===_0x1e368f){_0x1ca337=_0x1eb441['name'],_0x1a3827=_0x3bb077[_0x5efaab(0x17e)]||_0x1e368f;break _0x1eaedb;}}}}return{'stageName':_0x1ca337,'criteriaName':_0x1a3827};}async function executeThreeStepJourneyCreate(_0x8f4962,_0x2a90b2,_0x4f82bc,_0x48074c,_0x574016,_0x3cdb91,_0x34122e,_0x12da38){const _0x189fe9=a110_0x3fa165,{activationDefToCreateRequest:_0x266964,yamlRuleToApi:_0x390e59}=_0x12da38,{pendingEmbeddedSegments:_0x4b3166,pendingEmbeddedActivations:_0x139e6c,embeddedSegmentNameToId:_0x39d02b}=_0x48074c,_0x8b6b9d=JSON[_0x189fe9(0x1c0)](JSON[_0x189fe9(0x1e0)](_0x4f82bc));ensureJourneyDefaults(_0x8b6b9d[_0x189fe9(0x217)]),stripPendingIds(_0x8b6b9d);const _0x3d77c9=await _0x8f4962[_0x189fe9(0x1cf)][_0x189fe9(0x1f7)](_0x8b6b9d),_0x5ae603=_0x3d77c9['id'],_0x1ac710=new Map();for(const _0x268b54 of _0x3d77c9[_0x189fe9(0x217)][_0x189fe9(0x236)]){_0x1ac710[_0x189fe9(0x1ca)](_0x268b54[_0x189fe9(0x17e)][_0x189fe9(0x249)](),_0x268b54['id']);}for(const [_0x232d78,{definition:_0xe26001}]of _0x4b3166){const _0x1da1bb=generateDeterministicJourneySegmentName(_0x2a90b2['yamlConfig'][_0x189fe9(0x17e)],_0x232d78);_0x34122e[_0x189fe9(0x222)]?.({'type':'embedded_segment_creating','journeyName':_0x2a90b2[_0x189fe9(0x16f)][_0x189fe9(0x17e)],'segmentName':_0x232d78});const _0x169897=createSegmentIdResolver(_0x3cdb91[_0x189fe9(0x206)],_0x232d78),_0x5f1e66=await resolveRuleSegmentIds(_0xe26001['rule'],_0x169897),_0x38d51a=await _0x8f4962[_0x189fe9(0x20e)][_0x189fe9(0x182)]({'name':_0x1da1bb,'description':_0xe26001[_0x189fe9(0x19d)]||'Entry\x20criteria:\x20'+_0x232d78,'journeyId':_0x5ae603,'rule':_0x390e59(_0x5f1e66,!![]),'countPopulation':!![],'parentFolderId':_0x574016[_0x189fe9(0x193)]||'','audienceId':_0x574016[_0x189fe9(0x235)]});_0x39d02b[_0x189fe9(0x1ca)](_0x232d78,_0x38d51a),_0x3cdb91[_0x189fe9(0x206)][_0x189fe9(0x1ca)](_0x232d78,_0x38d51a),_0x34122e['onProgress']?.({'type':_0x189fe9(0x1cc),'journeyName':_0x2a90b2[_0x189fe9(0x16f)][_0x189fe9(0x17e)],'segmentName':_0x232d78});}const _0x1309d1=new Map();for(const [_0x274e13,_0x4d4a37]of _0x139e6c){_0x34122e[_0x189fe9(0x222)]?.({'type':_0x189fe9(0x171),'journeyName':_0x2a90b2[_0x189fe9(0x16f)]['name'],'activationName':_0x274e13});const _0x449ea0=await _0x266964(_0x4d4a37,_0x3cdb91[_0x189fe9(0x1ef)]),_0x20c3c0=await _0x8f4962[_0x189fe9(0x1cf)][_0x189fe9(0x18e)](_0x5ae603,_0x449ea0);_0x1309d1['set'](_0x274e13,_0x20c3c0['id']),_0x48074c[_0x189fe9(0x242)]['set'](_0x274e13,_0x20c3c0['id']),_0x34122e['onProgress']?.({'type':_0x189fe9(0x1ee),'journeyName':_0x2a90b2[_0x189fe9(0x16f)][_0x189fe9(0x17e)],'activationName':_0x274e13});}const _0x2bff07=JSON[_0x189fe9(0x1c0)](JSON[_0x189fe9(0x1e0)](_0x4f82bc));return _0x2bff07['id']=_0x5ae603,ensureJourneyDefaults(_0x2bff07[_0x189fe9(0x217)]),resolvePendingIdsInRequest(_0x2bff07,_0x4f82bc,_0x1ac710,_0x39d02b,_0x1309d1,_0x34122e),await _0x8f4962[_0x189fe9(0x1cf)][_0x189fe9(0x198)](_0x5ae603,_0x2bff07),{'action':_0x189fe9(0x232),'journeyId':_0x5ae603,'embeddedSegmentNameToId':_0x39d02b};}function stripPendingIds(_0x9d547f){const _0x45cee6=a110_0x3fa165;for(const _0x29addf of _0x9d547f['attributes'][_0x45cee6(0x236)]||[]){_0x29addf[_0x45cee6(0x173)]?.['segmentId']&&isPendingSegmentId(_0x29addf[_0x45cee6(0x173)]['segmentId'])&&delete _0x29addf[_0x45cee6(0x173)];if(_0x29addf[_0x45cee6(0x23a)])for(const _0x591e47 of Object[_0x45cee6(0x1a3)](_0x29addf[_0x45cee6(0x23a)])){const _0x463ee0=_0x29addf[_0x45cee6(0x23a)][_0x591e47];_0x463ee0['type']===_0x45cee6(0x1a1)&&_0x463ee0[_0x45cee6(0x1d5)]&&isPendingActivationId(_0x463ee0[_0x45cee6(0x1d5)])&&(_0x463ee0[_0x45cee6(0x1d5)]='');if(_0x463ee0['type']===_0x45cee6(0x21a)&&_0x463ee0[_0x45cee6(0x191)])for(const _0x933cd2 of _0x463ee0[_0x45cee6(0x191)]){_0x933cd2[_0x45cee6(0x184)]&&isPendingSegmentId(_0x933cd2[_0x45cee6(0x184)])&&(_0x933cd2['segmentId']='');}_0x463ee0[_0x45cee6(0x1e6)]===_0x45cee6(0x179)&&_0x463ee0[_0x45cee6(0x1f2)]?.[_0x45cee6(0x184)]&&isPendingSegmentId(_0x463ee0[_0x45cee6(0x1f2)][_0x45cee6(0x184)])&&(_0x463ee0['waitCondition']['segmentId']='');}}}function resolvePendingIdsInRequest(_0x5e9f68,_0x486722,_0x2789e7,_0x34221a,_0xe53240,_0x1f45db){const _0x38fc7c=a110_0x3fa165,_0x5c6529=(_0x4b08d1,_0x5ac08b)=>{const _0x3754e3=a110_0x3a2b;if(!isPendingSegmentId(_0x4b08d1))return _0x4b08d1;const _0x57c8ac=extractPendingSegmentName(_0x4b08d1),_0x3d069e=_0x34221a[_0x3754e3(0x172)](_0x57c8ac);return!_0x3d069e&&_0x1f45db['logWarning']?.(_0x3754e3(0x1b4)+_0x57c8ac+_0x3754e3(0x1db)+_0x5ac08b),_0x3d069e;};if(_0x5e9f68[_0x38fc7c(0x217)][_0x38fc7c(0x1c2)]?.['segmentId']&&isPendingSegmentId(_0x5e9f68[_0x38fc7c(0x217)][_0x38fc7c(0x1c2)][_0x38fc7c(0x184)])){const _0x90571e=_0x5c6529(_0x5e9f68['attributes'][_0x38fc7c(0x1c2)][_0x38fc7c(0x184)],'goal\x20criteria');_0x90571e&&(_0x5e9f68[_0x38fc7c(0x217)][_0x38fc7c(0x1c2)][_0x38fc7c(0x184)]=_0x90571e);}for(const _0x4a0401 of _0x5e9f68['attributes']['journeyStages']||[]){const _0x37a625=_0x2789e7[_0x38fc7c(0x172)](_0x4a0401[_0x38fc7c(0x17e)][_0x38fc7c(0x249)]());_0x37a625&&(_0x4a0401['id']=_0x37a625);if(_0x4a0401[_0x38fc7c(0x173)]?.[_0x38fc7c(0x184)]&&isPendingSegmentId(_0x4a0401[_0x38fc7c(0x173)]['segmentId'])){const _0x4b89ed=_0x5c6529(_0x4a0401[_0x38fc7c(0x173)][_0x38fc7c(0x184)],_0x38fc7c(0x201)+_0x4a0401[_0x38fc7c(0x17e)]+_0x38fc7c(0x210));_0x4b89ed&&(_0x4a0401[_0x38fc7c(0x173)]['segmentId']=_0x4b89ed);}if(_0x4a0401[_0x38fc7c(0x22b)])for(const _0x2d4e05 of _0x4a0401[_0x38fc7c(0x22b)]){if(_0x2d4e05[_0x38fc7c(0x184)]&&isPendingSegmentId(_0x2d4e05[_0x38fc7c(0x184)])){const _0x5921a1=_0x5c6529(_0x2d4e05['segmentId'],_0x38fc7c(0x201)+_0x4a0401[_0x38fc7c(0x17e)]+_0x38fc7c(0x203));_0x5921a1&&(_0x2d4e05[_0x38fc7c(0x184)]=_0x5921a1);}}if(_0x4a0401[_0x38fc7c(0x229)]?.[_0x38fc7c(0x184)]&&isPendingSegmentId(_0x4a0401['milestone'][_0x38fc7c(0x184)])){const _0x5ee517=_0x5c6529(_0x4a0401[_0x38fc7c(0x229)]['segmentId'],_0x38fc7c(0x201)+_0x4a0401[_0x38fc7c(0x17e)]+_0x38fc7c(0x21e));_0x5ee517&&(_0x4a0401[_0x38fc7c(0x229)][_0x38fc7c(0x184)]=_0x5ee517);}if(_0x4a0401[_0x38fc7c(0x23a)]){const _0x2c99ff=_0x270d93=>_0x486722[_0x38fc7c(0x217)]['journeyStages'][_0x38fc7c(0x181)](_0x51434a=>_0x51434a[_0x38fc7c(0x17e)][_0x38fc7c(0x249)]()===_0x4a0401[_0x38fc7c(0x17e)][_0x38fc7c(0x249)]())?.[_0x38fc7c(0x23a)]?.[_0x270d93];for(const _0x5d5951 of Object[_0x38fc7c(0x1a3)](_0x4a0401[_0x38fc7c(0x23a)])){const _0x2013dd=_0x4a0401[_0x38fc7c(0x23a)][_0x5d5951],_0x1a5788=_0x2c99ff(_0x5d5951);if(_0x2013dd['type']===_0x38fc7c(0x1a1)&&_0x2013dd[_0x38fc7c(0x1d5)]&&(isPendingActivationId(_0x2013dd[_0x38fc7c(0x1d5)])||_0x2013dd[_0x38fc7c(0x1d5)]==='')){if(_0x1a5788?.[_0x38fc7c(0x1d5)]&&isPendingActivationId(_0x1a5788[_0x38fc7c(0x1d5)])){const _0x2b31c8=extractPendingActivationName(_0x1a5788['journeyActivationStepId']),_0x1af44f=_0xe53240['get'](_0x2b31c8);_0x1af44f&&(_0x2013dd[_0x38fc7c(0x1d5)]=_0x1af44f);}}if(_0x2013dd[_0x38fc7c(0x1e6)]===_0x38fc7c(0x21a)&&_0x2013dd['branches']&&_0x1a5788?.[_0x38fc7c(0x191)])for(let _0x54705e=0x0;_0x54705e<_0x2013dd[_0x38fc7c(0x191)][_0x38fc7c(0x1d9)];_0x54705e++){const _0x10e923=_0x2013dd[_0x38fc7c(0x191)][_0x54705e],_0x4c6660=_0x1a5788[_0x38fc7c(0x191)][_0x54705e];if(_0x4c6660?.[_0x38fc7c(0x184)]&&isPendingSegmentId(_0x4c6660[_0x38fc7c(0x184)])){const _0x2ab5fb=_0x5c6529(_0x4c6660[_0x38fc7c(0x184)],'stage\x20\x27'+_0x4a0401[_0x38fc7c(0x17e)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x10e923[_0x38fc7c(0x17e)]||_0x54705e)+'\x27');_0x2ab5fb&&(_0x10e923[_0x38fc7c(0x184)]=_0x2ab5fb);}}if(_0x2013dd['type']===_0x38fc7c(0x179)&&_0x2013dd['waitCondition']?.[_0x38fc7c(0x184)]&&_0x1a5788?.['waitCondition']?.[_0x38fc7c(0x184)]&&isPendingSegmentId(_0x1a5788['waitCondition'][_0x38fc7c(0x184)])){const _0x1dbba2=_0x5c6529(_0x1a5788[_0x38fc7c(0x1f2)]['segmentId'],_0x38fc7c(0x201)+_0x4a0401['name']+_0x38fc7c(0x199));_0x1dbba2&&(_0x2013dd[_0x38fc7c(0x1f2)][_0x38fc7c(0x184)]=_0x1dbba2);}}}}}
|
|
1
|
+
(function(_0x24b027,_0x46d0e5){const _0xf57cf6=a110_0xe770,_0x12a275=_0x24b027();while(!![]){try{const _0x4df7f2=-parseInt(_0xf57cf6(0x21e))/0x1*(parseInt(_0xf57cf6(0x226))/0x2)+-parseInt(_0xf57cf6(0x20d))/0x3*(-parseInt(_0xf57cf6(0x267))/0x4)+parseInt(_0xf57cf6(0x20e))/0x5*(-parseInt(_0xf57cf6(0x206))/0x6)+-parseInt(_0xf57cf6(0x1ac))/0x7*(-parseInt(_0xf57cf6(0x25d))/0x8)+-parseInt(_0xf57cf6(0x1e2))/0x9+-parseInt(_0xf57cf6(0x239))/0xa*(parseInt(_0xf57cf6(0x253))/0xb)+parseInt(_0xf57cf6(0x213))/0xc;if(_0x4df7f2===_0x46d0e5)break;else _0x12a275['push'](_0x12a275['shift']());}catch(_0x52a852){_0x12a275['push'](_0x12a275['shift']());}}}(a110_0x23d9,0x280a7));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x4f8c11){return''+PENDING_SEGMENT_PREFIX+_0x4f8c11+'__';}export function isPendingSegmentId(_0xead5b5){const _0x964974=a110_0xe770;return _0xead5b5[_0x964974(0x1b3)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0xb10964){const _0xead6b=a110_0xe770;return _0xb10964[_0xead6b(0x211)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xdb9522){return''+PENDING_ACTIVATION_PREFIX+_0xdb9522+'__';}export function isPendingActivationId(_0x38a26c){return _0x38a26c['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1e6cb2){const _0x5a2fc9=a110_0xe770;return _0x1e6cb2[_0x5a2fc9(0x211)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x5672d2,_0x470852){const _0x578de0=a110_0xe770,_0x20622f=_0x5672d2+'::'+(_0x470852[_0x578de0(0x1c4)]()||_0x578de0(0x20f)),_0x499ddb=createHash(_0x578de0(0x1c9))[_0x578de0(0x27f)](_0x20622f)[_0x578de0(0x1a4)]('hex')[_0x578de0(0x284)](0x0,0xc);return _0x578de0(0x1b6)+_0x499ddb;}export function ensureJourneyDefaults(_0xa447c3){const _0x28e7b4=a110_0xe770;!_0xa447c3[_0x28e7b4(0x25e)]&&(_0xa447c3['description']=''),!_0xa447c3[_0x28e7b4(0x1e4)]&&(_0xa447c3[_0x28e7b4(0x1e4)]=_0x28e7b4(0x259));}export function resolveTDFolderPath(_0x163a27,_0x1fce58,_0x243598){const _0x172b25=a110_0xe770;if(!_0x1fce58)return _0x163a27;if(_0x163a27===_0x243598||_0x163a27[_0x172b25(0x1b3)](_0x243598+'/'))return _0x163a27;return _0x163a27?_0x243598+'/'+_0x163a27:_0x243598;}export function addFoldersToCreate(_0x32a3bb,_0xf6ef7f,_0x24a9e2){const _0x54564e=a110_0xe770;if(!_0x32a3bb)return;if(_0xf6ef7f['has'](_0x32a3bb))return;const _0x5579e2=_0x32a3bb[_0x54564e(0x265)]('/');let _0xfe7627='';for(const _0x5e925e of _0x5579e2){_0xfe7627=_0xfe7627?_0xfe7627+'/'+_0x5e925e:_0x5e925e,!_0xf6ef7f[_0x54564e(0x201)](_0xfe7627)&&_0x24a9e2[_0x54564e(0x257)](_0xfe7627);}}import*as a110_0x3c7318 from'yaml';import{readFileSync}from'fs';import a110_0x350486 from'path';import{isJourneyDef,parseYamlString as a110_0x58e05f,toYamlString as a110_0x26f9fb,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x1dc9e1){const _0x49e04a=a110_0xe770;if(Array[_0x49e04a(0x1d4)](_0x1dc9e1))return'['+_0x1dc9e1[_0x49e04a(0x287)](_0x3481b3=>stableStringify(_0x3481b3))[_0x49e04a(0x1ba)](',')+']';if(_0x1dc9e1&&typeof _0x1dc9e1===_0x49e04a(0x1d2)){const _0x1b69e4=_0x1dc9e1,_0x14f7c1=Object['keys'](_0x1b69e4)[_0x49e04a(0x250)](),_0x6c9a96=_0x14f7c1[_0x49e04a(0x287)](_0x5398c1=>'\x22'+_0x5398c1+'\x22:'+stableStringify(_0x1b69e4[_0x5398c1]));return'{'+_0x6c9a96['join'](',')+'}';}const _0xd7077b=JSON['stringify'](_0x1dc9e1);return _0xd7077b===undefined?_0x49e04a(0x1d5):_0xd7077b;}function activationSignature(_0x253245){const _0x1d3709=a110_0xe770,_0x2d3114={'connection':_0x253245[_0x1d3709(0x1cc)],..._0x253245[_0x1d3709(0x255)]!==undefined&&{'all_columns':_0x253245[_0x1d3709(0x255)]},..._0x253245[_0x1d3709(0x262)]!==undefined&&{'columns':_0x253245[_0x1d3709(0x262)]},..._0x253245['behavior']!==undefined&&{'behavior':_0x253245[_0x1d3709(0x25c)]},..._0x253245[_0x1d3709(0x1b0)]!==undefined&&{'schedule':_0x253245['schedule']},..._0x253245['notification']!==undefined&&{'notification':_0x253245[_0x1d3709(0x1dd)]},..._0x253245[_0x1d3709(0x268)]!==undefined&&{'connector_config':_0x253245[_0x1d3709(0x268)]},..._0x253245[_0x1d3709(0x1b4)]!==undefined&&{'activation_template_id':_0x253245[_0x1d3709(0x1b4)]}};return stableStringify(_0x2d3114);}export async function prepareSegmentFiles(_0x6d83ec,_0x1f3b7c,_0x10bc0e,_0x281c11,_0x1bafb8){const _0x239b21=a110_0xe770,{activationDefToCreateRequest:_0x32444f}=await import(_0x239b21(0x1fd)),_0x68d14e=[],_0x239584=new Set();for(const {yamlConfig:_0x52024f,folderPath:_0x5a3987,sourcePath:_0x37e83f}of _0x6d83ec){const _0x20a3bf=resolveTDFolderPath(_0x5a3987,_0x281c11,_0x1bafb8),_0x3f736d=_0x20a3bf+':'+_0x52024f[_0x239b21(0x244)],_0x319ff9=_0x1f3b7c[_0x239b21(0x1c7)]['get'](_0x3f736d),_0x23e94c=_0x319ff9?_0x1f3b7c['activationsBySegmentId'][_0x239b21(0x223)](_0x319ff9['id'])||[]:[];addFoldersToCreate(_0x20a3bf,_0x1f3b7c[_0x239b21(0x252)],_0x239584);const _0x4a76ba=calculateActivationActions(_0x52024f[_0x239b21(0x20b)]||[],_0x23e94c,_0x1f3b7c['idToEmailMap'],_0x1f3b7c['connectionIdToNameMap']);for(const _0x2d3e9b of _0x4a76ba){(_0x2d3e9b[_0x239b21(0x1b8)]===_0x239b21(0x1fe)||_0x2d3e9b['type']==='update')&&_0x2d3e9b[_0x239b21(0x1b5)]&&(_0x2d3e9b[_0x239b21(0x24d)]=await _0x32444f(_0x2d3e9b[_0x239b21(0x1b5)],_0x10bc0e));}const _0x339c36=calculateSegmentDiff(_0x52024f,_0x319ff9,_0x23e94c,_0x1f3b7c[_0x239b21(0x26e)],_0x1f3b7c[_0x239b21(0x1a7)]);_0x68d14e['push']({'relativePath':_0x52024f[_0x239b21(0x244)],'absolutePath':_0x37e83f,'yamlConfig':_0x52024f,'folderPath':_0x20a3bf,'existingSegment':_0x319ff9,'existingActivations':_0x23e94c,'isNew':_0x339c36[_0x239b21(0x1f5)],'hasChanges':_0x339c36[_0x239b21(0x21a)],'diff':_0x339c36['diff'],'activationActions':_0x4a76ba});}return{'segmentFiles':_0x68d14e,'foldersToCreate':_0x239584};}export async function prepareJourneyFiles(_0x5c3dcf,_0x55c174,_0x27de2c,_0x5b9a8f){const _0x4f12bb=a110_0xe770,_0x2eebeb=[],_0x58f389=new Set();for(const {yamlConfig:_0x24024e,folderPath:_0x531868,sourcePath:_0x3a89ea}of _0x5c3dcf){const _0x3fefb6=resolveTDFolderPath(_0x531868,_0x27de2c,_0x5b9a8f),_0x59f7ef=_0x3fefb6+':'+_0x24024e[_0x4f12bb(0x244)],_0x4c1343=_0x55c174['journeyBundlesByFolderAndName'][_0x4f12bb(0x223)](_0x59f7ef);let _0x292868,_0x57593b;if(_0x4c1343&&_0x4c1343[_0x4f12bb(0x281)]>0x0){const _0x2126e8=buildLocalExpandedRuleMappings(_0x24024e),{createYamlContext:_0x1b7e5e,prefetchJourneySegments:_0x261584}=createPushYamlContextForBundle(_0x55c174[_0x4f12bb(0x1da)],_0x55c174['parentId'],_0x55c174[_0x4f12bb(0x236)],_0x2126e8,_0x55c174[_0x4f12bb(0x26e)],_0x55c174[_0x4f12bb(0x1a7)],_0x55c174[_0x4f12bb(0x238)],_0x55c174[_0x4f12bb(0x1ed)]);await _0x261584(_0x4c1343[_0x4f12bb(0x287)](_0x47ae44=>_0x47ae44['id']));const _0xfad359=hasMultipleVersions(_0x24024e),_0x2361f1=async _0x12f147=>{const _0x62b816=_0x4f12bb,_0x546724=_0x55c174[_0x62b816(0x1ed)]?.[_0x62b816(0x223)](_0x12f147);if(_0x546724)return _0x546724;return _0x55c174[_0x62b816(0x24c)]({'journeyId':_0x12f147,'journeyName':_0x24024e[_0x62b816(0x244)],'isMultiVersion':_0x4c1343[_0x62b816(0x281)]>0x1});};if(_0xfad359&&_0x4c1343[_0x4f12bb(0x281)]>0x1){const _0x468007=[];for(const _0x173856 of _0x4c1343){const _0x190b9a=_0x173856['versionNumber']||0x1;_0x55c174[_0x4f12bb(0x232)]?.[_0x4f12bb(0x27f)](_0x4f12bb(0x26b)+_0x24024e[_0x4f12bb(0x244)]+'\x20v'+_0x190b9a);const _0x322ef7=await _0x2361f1(_0x173856['id']),_0x24a2ef=_0x1b7e5e(_0x173856['id']),_0x2def7f=await journeyResponseToDef(_0x322ef7,_0x24a2ef);_0x468007[_0x4f12bb(0x241)]({'item':_0x173856,'yaml':_0x2def7f});}const _0x173fb2=buildLocalRuleToNameMappingFromJourney(_0x24024e);_0x57593b=buildMergedJourneyDef(_0x468007,_0x173fb2);const _0x587485=Math[_0x4f12bb(0x266)](..._0x468007[_0x4f12bb(0x287)](_0x167e3e=>_0x167e3e[_0x4f12bb(0x1f3)][_0x4f12bb(0x1d1)]||0x0)),_0x404308=_0x4c1343[_0x4f12bb(0x210)](_0x19cef9=>(_0x19cef9[_0x4f12bb(0x1d1)]||0x0)===_0x587485);_0x404308&&(_0x55c174['progress']?.[_0x4f12bb(0x27f)]('Fetching\x20'+_0x24024e[_0x4f12bb(0x244)]+'\x20v'+_0x587485),_0x292868=await _0x2361f1(_0x404308['id']));}else{const _0x513f9c=_0x4c1343[_0x4c1343[_0x4f12bb(0x281)]-0x1];_0x55c174[_0x4f12bb(0x232)]?.[_0x4f12bb(0x27f)]('Fetching\x20'+_0x24024e[_0x4f12bb(0x244)]),_0x292868=await _0x2361f1(_0x513f9c['id']);const _0x1af90b=_0x1b7e5e(_0x513f9c['id']),_0x3ba39e=await journeyResponseToDef(_0x292868,_0x1af90b),_0x1ad0d0=buildLocalRuleToNameMappingFromJourney(_0x24024e);_0x57593b=buildMergedJourneyDef([{'item':_0x513f9c,'yaml':_0x3ba39e}],_0x1ad0d0);}}addFoldersToCreate(_0x3fefb6,_0x55c174['folderPathToId'],_0x58f389);const _0x1c07b6=calculateJourneyDiff(_0x24024e,_0x57593b);_0x2eebeb[_0x4f12bb(0x241)]({'relativePath':_0x24024e[_0x4f12bb(0x244)],'absolutePath':_0x3a89ea,'yamlConfig':_0x24024e,'folderPath':_0x3fefb6,'existingJourney':_0x292868,'isNew':_0x1c07b6['isNew'],'hasChanges':_0x1c07b6[_0x4f12bb(0x21a)],'diff':_0x1c07b6['diff']});}return{'journeyFiles':_0x2eebeb,'foldersToCreate':_0x58f389};}export function calculateActivationActions(_0x46cba6,_0x3f845e,_0x5b5a35,_0x5794ce){const _0x728b2f=a110_0xe770,_0xa11bc9=[],_0x263871=new Map();for(const _0x54abd7 of _0x3f845e){_0x263871[_0x728b2f(0x219)](_0x54abd7['name'],_0x54abd7);}const _0x3dfe2d=new Map();for(const _0x145276 of _0x46cba6){_0x3dfe2d[_0x728b2f(0x219)](_0x145276[_0x728b2f(0x244)],_0x145276);}for(const _0x476f03 of _0x46cba6){const _0x242bd7=_0x263871[_0x728b2f(0x223)](_0x476f03[_0x728b2f(0x244)]);if(!_0x242bd7)_0xa11bc9[_0x728b2f(0x241)]({'type':_0x728b2f(0x1fe),'name':_0x476f03[_0x728b2f(0x244)],'yamlActivation':_0x476f03});else{const _0x44bc00=activationResponseToDef(_0x242bd7,_0x5b5a35,_0x5794ce),_0xab73ac=a110_0x3c7318['stringify'](_0x44bc00),_0x3f486d=a110_0x3c7318[_0x728b2f(0x1c1)](_0x476f03);_0xab73ac!==_0x3f486d&&_0xa11bc9[_0x728b2f(0x241)]({'type':_0x728b2f(0x27f),'name':_0x476f03[_0x728b2f(0x244)],'yamlActivation':_0x476f03,'existingActivation':_0x242bd7});}}for(const _0x2c4736 of _0x3f845e){!_0x3dfe2d[_0x728b2f(0x201)](_0x2c4736['name'])&&_0xa11bc9[_0x728b2f(0x241)]({'type':_0x728b2f(0x1be),'name':_0x2c4736[_0x728b2f(0x244)],'existingActivation':_0x2c4736});}return _0xa11bc9;}export function calculateSegmentDiff(_0x55f3f7,_0x4f2f58,_0x4c190c,_0x40edb4,_0x132b38){const _0x1b5b09=segmentToYamlString(_0x55f3f7);if(_0x4f2f58){const _0x121dd2=segmentWithActivationsToYaml(_0x4f2f58,_0x4c190c,undefined,_0x40edb4,_0x132b38),_0x395f95=segmentToYamlString(_0x121dd2),_0x5f1072=generateDiff(_0x395f95,_0x1b5b09),_0xdb86c9=hasChanges(_0x5f1072);return{'isNew':![],'hasChanges':_0xdb86c9,'diff':_0xdb86c9?formatDiffWithColors(_0x5f1072):undefined};}const _0x5c8fac=generateDiff('',_0x1b5b09);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5c8fac)};}export function calculateJourneyDiff(_0x24fc6d,_0x4dc9e2){const _0x36a504=normalizeJourneyDef(_0x24fc6d,_0x24fc6d),_0x47fa24=a110_0x26f9fb(_0x36a504);if(_0x4dc9e2){const _0x487d90=normalizeJourneyDef(_0x4dc9e2,_0x24fc6d),_0x5a7c2a=a110_0x26f9fb(_0x487d90),_0x205e19=generateDiff(_0x5a7c2a,_0x47fa24),_0x746117=hasChanges(_0x205e19);return{'isNew':![],'hasChanges':_0x746117,'diff':_0x746117?formatDiffWithColors(_0x205e19):undefined};}const _0x4ea098=generateDiff('',_0x47fa24);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4ea098)};}export function findSegmentsToDelete(_0x4ad7c0,_0x29000d,_0x4a49f1,_0x373caf,_0x9500eb){const _0x33cfa9=a110_0xe770,_0x1e5412=new Set();for(const {yamlConfig:_0x5240ad,folderPath:_0x8b3d1a}of _0x29000d){_0x1e5412['add'](_0x8b3d1a+':'+_0x5240ad[_0x33cfa9(0x244)]);}return _0x4ad7c0[_0x33cfa9(0x1d7)](_0x1392ba=>{const _0x3ac615=_0x33cfa9,_0x593287=_0x1392ba[_0x3ac615(0x200)]?_0x4a49f1[_0x3ac615(0x223)](_0x1392ba[_0x3ac615(0x200)]['toString']())||'':'',_0x13b84f=_0x593287+':'+_0x1392ba[_0x3ac615(0x244)];if(_0x1e5412[_0x3ac615(0x201)](_0x13b84f))return![];if(_0x9500eb)return _0x593287===_0x373caf||_0x593287[_0x3ac615(0x1b3)](_0x373caf+'/');return!![];});}export function findJourneysToDelete(_0xc68b95,_0x1cb248,_0x34d7b0,_0x59ed3b,_0x16e5b1){const _0x41d0b5=a110_0xe770,_0x1c5f18=new Set();for(const {yamlConfig:_0x78d0,folderPath:_0x18abc5}of _0x1cb248){_0x1c5f18['add'](_0x18abc5+':'+_0x78d0[_0x41d0b5(0x244)]);}return _0xc68b95[_0x41d0b5(0x1d7)](_0x4baca2=>{const _0x57bb1f=_0x41d0b5,_0x6f88a5=_0x4baca2[_0x57bb1f(0x1e6)]?_0x34d7b0[_0x57bb1f(0x223)](_0x4baca2[_0x57bb1f(0x1e6)])||'':'',_0x1dbb30=_0x6f88a5+':'+_0x4baca2[_0x57bb1f(0x1e9)];if(_0x1c5f18[_0x57bb1f(0x201)](_0x1dbb30))return![];if(_0x16e5b1)return _0x6f88a5===_0x59ed3b||_0x6f88a5[_0x57bb1f(0x1b3)](_0x59ed3b+'/');return!![];});}export function buildSegmentLookupMap(_0x31e5e4,_0x5bfd28){const _0xe49fe7=a110_0xe770,_0x2d25b2=new Map();for(const _0x3a8541 of _0x31e5e4){const _0x3351c7=_0x3a8541['segmentFolderId']?_0x5bfd28[_0xe49fe7(0x223)](_0x3a8541['segmentFolderId'][_0xe49fe7(0x217)]())||'':'',_0x5c9eb4=_0x3351c7+':'+_0x3a8541['name'];_0x2d25b2['set'](_0x5c9eb4,_0x3a8541);}return _0x2d25b2;}export function buildSegmentNameToIdMap(_0x38ca02){const _0x2127c0=a110_0xe770,_0x4668e3=new Map();for(const _0x538cf1 of _0x38ca02){_0x4668e3[_0x2127c0(0x219)](_0x538cf1[_0x2127c0(0x244)],_0x538cf1['id']);}return _0x4668e3;}export function buildJourneyBundleLookupMap(_0x52970b,_0x437869){const _0x452d58=a110_0xe770,_0x155de3=new Map();for(const _0x12d631 of _0x52970b){const _0x416550=_0x12d631[_0x452d58(0x1e6)]?_0x437869['get'](_0x12d631[_0x452d58(0x1e6)])||'':'',_0x55281d=_0x416550+':'+_0x12d631[_0x452d58(0x1e9)];!_0x155de3['has'](_0x55281d)&&_0x155de3[_0x452d58(0x219)](_0x55281d,[]),_0x155de3[_0x452d58(0x223)](_0x55281d)[_0x452d58(0x241)](_0x12d631);}for(const _0x71d070 of _0x155de3[_0x452d58(0x1a8)]()){_0x71d070['sort']((_0x578506,_0x102bec)=>(_0x578506[_0x452d58(0x1d1)]||0x0)-(_0x102bec['versionNumber']||0x0));}return _0x155de3;}export function collectFoldersToCreate(_0x1e54f6,_0x489ea2){const _0x5e8a39=a110_0xe770,_0x371f9e=new Set();for(const _0x326a53 of _0x1e54f6){if(!_0x326a53)continue;if(_0x489ea2[_0x5e8a39(0x201)](_0x326a53))continue;const _0x59a33d=_0x326a53[_0x5e8a39(0x265)]('/');let _0x327ce3='';for(const _0x2d5f7c of _0x59a33d){_0x327ce3=_0x327ce3?_0x327ce3+'/'+_0x2d5f7c:_0x2d5f7c,!_0x489ea2['has'](_0x327ce3)&&_0x371f9e[_0x5e8a39(0x257)](_0x327ce3);}}return _0x371f9e;}function a110_0x23d9(){const _0x93387f=['getSegment','sha1','./journey-yaml.js','Creating\x20activation\x20\x27','connection','relationships','effectiveFolderId','NOT_FOUND','journey','versionNumber','object','all','isArray','null','createdSegmentIds','filter','createActivation','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','deps','getJourney','updateSegmentById','notification','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','journeys','verbose','folderPath','1397961WEKNbh','Activation','state','list','folderId','keys','Creating\x20folder\x20\x27','journeyBundleName','activation_','with','):\x20','journeyById','segment_updated','\x27\x20from\x20file:\x20','relative','branches','yamlConfig','item','segments','isNew','utf-8','errors','segmentId','existingActivation','activationParams','withProgress','flatMap','./child-segment-yaml.js','create','from','segmentFolderId','has','createJourneySegment','logInfo','segmentNameToId','folder_creating','6PUvqoZ','Failed\x20to\x20','existingJourney','DecisionPoint','../../utils/async.js','activations','skipSegments','32304IPkoqv','1559515vxMRTX','segment','find','replace','\x20activation\x20\x27','5066856XfxFEO','absolutePath','size','onProgress','toString','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','set','hasChanges','rule','Segment\x20not\x20found:\x20','Updating\x20activation\x20\x27','105568jvYtrQ','entry_criteria','SEGMENT_UPDATE_ERROR','journey_updating','stages','get','goal','logDeleted','2ijYYPt','Creating\x20segment\x20\x27','segment_creating','activation_creating','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','results','Deleted\x20segment\x20\x27','dirname','toLowerCase','Journey\x20\x27','valid','folder','progress','Updated\x20segment\x20\x27','SEGMENT_NOT_FOUND','getActivation','existingSegments','Updated\x20journey\x20\x27','activationStepsById','60oXPhUU','resolveSegment','segment_updating','updateActivation','decision_point','deleted','existingSegment','parseDocument','push','goal\x20criteria','logWarning','name','action','folder_created','Activation\x20not\x20found:\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','user','message','exitCriterias','fetchJourney','validatedRequest','rootFolderId','nameToId','sort','kind','folderPathToId','187638sBVVxs','segment_created','all_columns','\x27\x20wait\x20condition','add','buildUserMaps','draft','\x20(referenced\x20in\x20journey\x20','parentFolder','behavior','24trUWbu','description','embedded_activation_creating','parse','index','columns','data','created','split','max','52EFoEYm','connector_config','\x20journey\x20from\x20file:\x20','\x27\x20exit\x20criteria','Fetching\x20','Entry\x20criteria:\x20','INTERNAL','idToEmailMap','activation_deleted','\x20segment\x20from\x20file:\x20','entryCriteria','embedded_segment_created','entry','idToName','Created\x20folder\x20\x27','Deleting\x20activation\x20\x27','listActivations','milestone','activation_deleting','parentId','journeyActivationStepId','\x27\x20entry\x20criteria','logSuccess','stage\x20\x27','update','steps','length','Created\x20segment\x20\x27','journeyStages','slice','waitCondition','Created\x20activation\x20\x27','map','updated','digest','\x27...','attributes','connectionIdToNameMap','values','createdSegmentId','\x0a\x20\x20','segment_deleting','646177ODrAYt','\x27\x20decision\x20point\x20branch\x20\x27','listSegments','activation_created','schedule','WaitStep','segment_deleted','startsWith','activation_template_id','yamlActivation','journey_entry_criteria_','parentSegmentFolder','type','\x27\x20milestone','join','entries','unchanged','includes','delete','Updated\x20activation\x20\x27','Updating\x20segment\x20\x27','stringify','embeddedSegmentNameToId','ACTIVATION_UPDATE_ERROR','trim','activation_updating','journey_updated','segmentByFolderAndName'];a110_0x23d9=function(){return _0x93387f;};return a110_0x23d9();}export function parseAndClassifyYamlFiles(_0x2f051b,_0x2b878f,_0x2cb764){const _0x2f6679=a110_0xe770,_0x3bf67d=[],_0x4ef5a5=[];for(const _0x5445d9 of _0x2f051b){const _0x3eb297=a110_0x350486[_0x2f6679(0x1f0)](_0x2b878f,a110_0x350486[_0x2f6679(0x22d)](_0x5445d9)),_0x5d0e1c=_0x3eb297==='.'?'':_0x3eb297,_0x5e83b5=readFileSync(_0x5445d9,_0x2f6679(0x1f6)),_0x239b93=a110_0x3c7318[_0x2f6679(0x260)](_0x5e83b5);if(isJourneyDef(_0x239b93)){const _0x115c0a=a110_0x58e05f(_0x5e83b5);_0x4ef5a5[_0x2f6679(0x241)]({'yamlConfig':_0x115c0a,'folderPath':_0x5d0e1c,'sourcePath':_0x5445d9});}else{if(!_0x2cb764?.[_0x2f6679(0x20c)]){const _0x1ca6d5=parseSegmentYamlFile(_0x5e83b5),_0x4ab401=normalizeChildSegmentYaml(_0x1ca6d5);_0x3bf67d[_0x2f6679(0x241)]({'yamlConfig':_0x4ab401,'folderPath':_0x5d0e1c,'sourcePath':_0x5445d9});}}}return{'segments':_0x3bf67d,'journeys':_0x4ef5a5};}export function validateParsedFiles(_0x17d163,_0x3d44f4){const _0x5e634a=a110_0xe770,_0x54b818=[];for(const {yamlConfig:_0x29737f,sourcePath:_0x420f03}of _0x17d163['segments']){const _0x29d635=readFileSync(_0x420f03,_0x5e634a(0x1f6)),_0x3da7df=a110_0x3c7318[_0x5e634a(0x240)](_0x29d635),_0x4942ba=validateSegmentDef(_0x29737f,{'source':_0x29d635,'document':_0x3da7df});if(!_0x4942ba[_0x5e634a(0x230)]){const _0x5717e8=a110_0x350486['relative'](_0x3d44f4,_0x420f03);_0x54b818[_0x5e634a(0x241)]({'filePath':_0x5717e8,'source':_0x29d635,'result':_0x4942ba,'isJourney':![]});}}for(const {yamlConfig:_0x1fe4e1,sourcePath:_0x45690d}of _0x17d163['journeys']){const _0x260ef3=readFileSync(_0x45690d,_0x5e634a(0x1f6)),_0x776df9=a110_0x3c7318[_0x5e634a(0x240)](_0x260ef3),_0x23580a=validateJourneyDef(_0x1fe4e1,{'source':_0x260ef3,'document':_0x776df9});if(!_0x23580a[_0x5e634a(0x230)]){const _0x53ba56=a110_0x350486[_0x5e634a(0x1f0)](_0x3d44f4,_0x45690d);_0x54b818['push']({'filePath':_0x53ba56,'source':_0x260ef3,'result':_0x23580a,'isJourney':!![]});}}return _0x54b818;}export function formatValidationErrors(_0x1bca85){const _0x62e7b2=a110_0xe770,_0xc95162=[];for(const {filePath:_0x4441d3,source:_0x393f39,result:_0x4ca959,isJourney:_0x5c9616}of _0x1bca85){const _0x449a2a=_0x5c9616?_0x62e7b2(0x1d0):_0x62e7b2(0x20f);_0xc95162['push']('\x0a'+_0x4441d3+'\x20('+_0x449a2a+_0x62e7b2(0x1ec)+_0x4ca959[_0x62e7b2(0x1f7)][_0x62e7b2(0x281)]+'\x20error(s)'),_0xc95162[_0x62e7b2(0x241)](formatValidationResult(_0x4ca959,_0x393f39,_0x4441d3));}return _0xc95162[_0x62e7b2(0x1ba)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4b6e84){const _0x4f07b5=a110_0xe770,_0x180a5b=new Set(),_0x51415d=new Map(),_0x5c597e=collectSegmentUsageCounts(_0x4b6e84);if(_0x4b6e84[_0x4f07b5(0x1f4)])for(const [_0xac8c07,_0x3cc272]of Object[_0x4f07b5(0x1bb)](_0x4b6e84[_0x4f07b5(0x1f4)])){_0x180a5b[_0x4f07b5(0x257)](_0xac8c07);if(_0x3cc272[_0x4f07b5(0x21b)]){const _0x5e8e96=yamlRuleToApi(_0x3cc272['rule']),_0x5110e4=apiRuleToYaml(_0x5e8e96);_0x51415d[_0x4f07b5(0x219)](_0xac8c07,_0x5110e4);}}const _0x5f51f6=new Map();let _0x39539a=0x0;for(const [_0xbfdeb0,_0x3c8034]of _0x51415d){const _0x34d63f=serializeExpandedRule(_0x3c8034,_0x51415d),_0x3100ae=_0x5f51f6[_0x4f07b5(0x223)](_0x34d63f)||[];_0x3100ae['push']({'name':_0xbfdeb0,'index':_0x39539a}),_0x5f51f6[_0x4f07b5(0x219)](_0x34d63f,_0x3100ae),_0x39539a++;}const _0x28e5d4=new Map();for(const [_0x5c0018,_0x10b930]of _0x5f51f6){const _0x400f5c=_0x10b930[_0x4f07b5(0x284)]()[_0x4f07b5(0x250)]((_0x39d82c,_0x2d969b)=>{const _0x212474=_0x4f07b5,_0x384bdf=_0x5c597e[_0x212474(0x223)](_0x39d82c[_0x212474(0x244)])||0x0,_0x29172b=_0x5c597e['get'](_0x2d969b['name'])||0x0;if(_0x384bdf!==_0x29172b)return _0x29172b-_0x384bdf;return _0x39d82c[_0x212474(0x261)]-_0x2d969b[_0x212474(0x261)];})['map'](_0x11aed1=>_0x11aed1[_0x4f07b5(0x244)]),_0x33ca12=[];for(const _0x4b4eb1 of _0x400f5c){const _0x2fa060=_0x5c597e[_0x4f07b5(0x223)](_0x4b4eb1)||0x0,_0xdbe5e1=Math['max'](_0x2fa060,0x1);for(let _0xb78569=0x0;_0xb78569<_0xdbe5e1;_0xb78569++){_0x33ca12[_0x4f07b5(0x241)](_0x4b4eb1);}}_0x28e5d4[_0x4f07b5(0x219)](_0x5c0018,_0x33ca12);}return{'existingLocalSegmentNames':_0x180a5b,'localSegmentRules':_0x51415d,'localExpandedRuleToNames':_0x28e5d4};}async function buildServerSegmentRuleMap(_0x53bbaa,_0x1a613e,_0x422132,_0x5a3547){const _0x132c26=new Map(),_0x388a50=new Set(),_0x2d69c3=async _0x1a3028=>{const _0x1465a3=a110_0xe770;if(_0x388a50[_0x1465a3(0x201)](_0x1a3028))return;_0x388a50[_0x1465a3(0x257)](_0x1a3028);let _0xb580b=_0x422132['find'](_0x2e167e=>_0x2e167e['id']===_0x1a3028);if(!_0xb580b)try{_0xb580b=await _0x53bbaa[_0x1465a3(0x20f)]['getSegment'](_0x1a613e,_0x1a3028);}catch{return;}if(!_0xb580b?.[_0x1465a3(0x21b)])return;const _0x15a860=apiRuleToYaml(_0xb580b[_0x1465a3(0x21b)]);_0x132c26[_0x1465a3(0x219)](_0x1a3028,_0x15a860);const _0xf0676a=collectSegmentRefsFromRule(_0x15a860);for(const _0x24bc1d of _0xf0676a){await _0x2d69c3(_0x24bc1d);}};for(const _0x25f8ba of _0x5a3547){await _0x2d69c3(_0x25f8ba);}return _0x132c26;}export function createSegmentIdResolver(_0xab12b0,_0xc451ec){return async _0x528eae=>{const _0x422182=a110_0xe770,_0xf56015=_0xab12b0[_0x422182(0x223)](_0x528eae);if(!_0xf56015)throw new SDKError(ErrorCode[_0x422182(0x234)],'Segment\x20not\x20found:\x20'+_0x528eae+_0x422182(0x1de)+_0xc451ec+'\x27)');return _0xf56015;};}export function extractRootFolderId(_0x30041a){const _0x5ad1c8=a110_0xe770;return _0x30041a['relationships']?.[_0x5ad1c8(0x1b7)]?.[_0x5ad1c8(0x263)]?.['id']||_0x30041a[_0x5ad1c8(0x1cd)]?.[_0x5ad1c8(0x25b)]?.[_0x5ad1c8(0x263)]?.['id'];}export function buildConnectionMaps(_0x39e18a){const _0x5224aa=a110_0xe770,_0x29f83c=new Map(),_0x3d1b65=new Map(),_0x400c9a=new Map();for(const _0x571226 of _0x39e18a){_0x29f83c['set'](_0x571226[_0x5224aa(0x244)],parseInt(_0x571226['id'],0xa)),_0x3d1b65[_0x5224aa(0x219)](_0x571226['id'],_0x571226[_0x5224aa(0x244)]),_0x400c9a[_0x5224aa(0x219)](_0x571226[_0x5224aa(0x244)],_0x571226[_0x5224aa(0x1b8)]);}return{'nameToId':_0x29f83c,'idToName':_0x3d1b65,'nameToType':_0x400c9a};}export function calculatePushStats(_0x23fbcb,_0x3c5fc2,_0x485a00,_0x29ae46,_0x50f6d6,_0x50ebda,_0x2ac1c0){const _0x56e40b=a110_0xe770,_0xecbb38=_0x23fbcb[_0x56e40b(0x1d7)](_0xb6385f=>_0xb6385f[_0x56e40b(0x1f5)]),_0x69f77f=_0x23fbcb[_0x56e40b(0x1d7)](_0x473e09=>!_0x473e09[_0x56e40b(0x1f5)]&&_0x473e09['hasChanges']),_0x19375f=_0x23fbcb[_0x56e40b(0x1d7)](_0x28f511=>!_0x28f511[_0x56e40b(0x1f5)]&&!_0x28f511[_0x56e40b(0x21a)]),_0x2812e7=_0x50ebda?_0x29ae46:[],_0x480367=_0x3c5fc2['filter'](_0x23c994=>_0x23c994['isNew']),_0x3144e=_0x3c5fc2[_0x56e40b(0x1d7)](_0x536481=>!_0x536481[_0x56e40b(0x1f5)]&&_0x536481['hasChanges']),_0x13709d=_0x3c5fc2[_0x56e40b(0x1d7)](_0xb2e13e=>!_0xb2e13e['isNew']&&!_0xb2e13e[_0x56e40b(0x21a)]),_0x3bbd84=_0x50ebda?_0x50f6d6:[],_0x15764c=_0x23fbcb[_0x56e40b(0x1fc)](_0x57d9ab=>_0x57d9ab['activationActions']),_0x45f057=_0x15764c['filter'](_0x4a673c=>_0x4a673c[_0x56e40b(0x1b8)]===_0x56e40b(0x1fe)),_0x1e277d=_0x15764c['filter'](_0x498dbd=>_0x498dbd[_0x56e40b(0x1b8)]==='update'),_0x160973=_0x15764c[_0x56e40b(0x1d7)](_0x751ec5=>_0x751ec5[_0x56e40b(0x1b8)]===_0x56e40b(0x1be)),_0x32b338=Array[_0x56e40b(0x1ff)](_0x485a00)[_0x56e40b(0x250)](),_0xb339da=_0x2ac1c0?![]:_0xecbb38[_0x56e40b(0x281)]>0x0||_0x69f77f['length']>0x0||_0x2812e7[_0x56e40b(0x281)]>0x0,_0x2f7b1a=_0x480367[_0x56e40b(0x281)]>0x0||_0x3144e[_0x56e40b(0x281)]>0x0||_0x3bbd84[_0x56e40b(0x281)]>0x0,_0x32cc82=_0x2ac1c0?![]:_0x15764c[_0x56e40b(0x281)]>0x0,_0x2b4218=_0x32b338['length']>0x0;return{'segments':{'new':_0xecbb38,'changed':_0x69f77f,'unchanged':_0x19375f,'toDelete':_0x2812e7},'journeys':{'new':_0x480367,'changed':_0x3144e,'unchanged':_0x13709d,'toDelete':_0x3bbd84},'activations':{'all':_0x15764c,'toCreate':_0x45f057,'toUpdate':_0x1e277d,'toDelete':_0x160973},'folders':{'toCreate':_0x32b338},'counts':{'segments':{'new':_0xecbb38[_0x56e40b(0x281)],'changed':_0x69f77f['length'],'unchanged':_0x19375f[_0x56e40b(0x281)],'toDelete':_0x2812e7[_0x56e40b(0x281)]},'journeys':{'new':_0x480367['length'],'changed':_0x3144e[_0x56e40b(0x281)],'unchanged':_0x13709d[_0x56e40b(0x281)],'toDelete':_0x3bbd84[_0x56e40b(0x281)]},'activations':{'create':_0x45f057[_0x56e40b(0x281)],'update':_0x1e277d[_0x56e40b(0x281)],'delete':_0x160973[_0x56e40b(0x281)]},'folders':_0x32b338['length']},'hasChanges':_0xb339da||_0x2f7b1a||_0x32cc82||_0x2b4218};}export async function buildPushExecutionContext(_0x457449,_0x122f31,_0x1663be,_0x49da7b,_0x52e7c5,_0x447882){const _0x3bd08c=a110_0xe770,_0x31304d=extractRootFolderId(_0x1663be),{pathToId:_0x2cf4ae,idToPath:_0x3e4a71}=buildFolderMaps(_0x52e7c5),_0x2a8bfd=buildSegmentNameToIdMap(_0x49da7b),_0x1c85db=new Map(),{batchAsync:_0x4dbf4e}=await import('../../utils/async.js'),[_0x4599ab,_0x49999a]=await Promise['all']([_0x457449[_0x3bd08c(0x249)][_0x3bd08c(0x258)](),_0x457449[_0x3bd08c(0x1cc)][_0x3bd08c(0x1e5)](),((async()=>{!_0x447882&&_0x49da7b['length']>0x0&&await _0x4dbf4e(_0x49da7b,async _0x112e6c=>{const _0x3a6a78=a110_0xe770,_0x65eb6d=await _0x457449[_0x3a6a78(0x20f)][_0x3a6a78(0x277)](_0x122f31,_0x112e6c['id']);_0x1c85db['set'](_0x112e6c['id'],_0x65eb6d);});})())]),{emailToId:_0x5b06c7,idToEmail:_0x2156d8}=_0x4599ab,_0x584ca9=buildConnectionMaps(_0x49999a);return{'rootFolderId':_0x31304d,'folderPathToId':_0x2cf4ae,'folderIdToPath':_0x3e4a71,'segmentNameToId':_0x2a8bfd,'activationsBySegmentId':_0x1c85db,'emailToIdMap':_0x5b06c7,'idToEmailMap':_0x2156d8,'connectionNameToIdMap':_0x584ca9[_0x3bd08c(0x24f)],'connectionIdToNameMap':_0x584ca9[_0x3bd08c(0x274)],'connectionNameToTypeMap':_0x584ca9['nameToType']};}export function createPushYamlContextForBundle(_0x152fce,_0x819546,_0x5a7ac3,_0x4fea8f,_0x7142e4,_0xa6247a,_0x1327c3,_0x26f212){const {existingLocalSegmentNames:_0x1e672e,localExpandedRuleToNames:_0x7706f8}=_0x4fea8f,_0x45437c=new Set(),_0x52e549=new Map(),_0x438349=new Map(),_0xeebe50=new Map(),_0x401927=createJumpTargetCache(),_0x371977=new Map(),_0x1ccf5d=new Map(),_0xb390a5=new Set();let _0x3676e4;const _0x2a0b6a=_0x150e1a=>{const _0x6ca74d={'resolveSegment':async _0x327101=>{const _0x386257=a110_0xe770,_0xec069b=_0xeebe50[_0x386257(0x223)](_0x327101);if(_0xec069b!==undefined)return{'name':_0xec069b,'isJourneyLocal':!![]};try{let _0xdaee38=_0x5a7ac3[_0x386257(0x210)](_0x62a526=>_0x62a526['id']===_0x327101);!_0xdaee38&&(_0xdaee38=await _0x152fce[_0x386257(0x20f)][_0x386257(0x1c8)](_0x819546,_0x327101));const _0x75cc28=generateJourneyLocalName(_0xdaee38[_0x386257(0x244)]),_0x3a7111=_0xdaee38[_0x386257(0x251)]===SEGMENT_KIND_JOURNEY&&_0x75cc28!==undefined;let _0xc6911=_0xdaee38[_0x386257(0x244)],_0xbc0489;if(_0x3a7111&&_0xdaee38['rule']){const _0x5b7f40=apiRuleToYaml(_0xdaee38[_0x386257(0x21b)]);_0x1ccf5d[_0x386257(0x219)](_0x327101,_0x5b7f40);const _0x2413c5=async _0x1bc865=>{const _0x43e7a3=_0x386257,_0x4d46fa=collectSegmentRefsFromRule(_0x1bc865);for(const _0x18ac1f of _0x4d46fa){if(!_0x1ccf5d[_0x43e7a3(0x201)](_0x18ac1f))try{const _0x408600=await _0x152fce[_0x43e7a3(0x20f)][_0x43e7a3(0x1c8)](_0x819546,_0x18ac1f);if(_0x408600?.['rule']){const _0x9bcfad=apiRuleToYaml(_0x408600[_0x43e7a3(0x21b)]);_0x1ccf5d['set'](_0x18ac1f,_0x9bcfad),await _0x2413c5(_0x9bcfad);}}catch{}}};await _0x2413c5(_0x5b7f40);const _0x522619=serializeExpandedRule(_0x5b7f40,_0x1ccf5d),_0x30f953=_0x7706f8[_0x386257(0x223)](_0x522619);if(_0x30f953&&_0x30f953[_0x386257(0x281)]>0x0){const _0x3cdb53=_0x52e549[_0x386257(0x223)](_0x522619)||0x0,_0x3d8ff7=_0x30f953[_0x3cdb53]||_0x30f953[_0x30f953[_0x386257(0x281)]-0x1];_0x52e549['set'](_0x522619,_0x3cdb53+0x1),_0xc6911=_0x3d8ff7,_0x45437c[_0x386257(0x257)](_0xc6911),_0xeebe50['set'](_0x327101,_0xc6911);const _0x1f3a26=await resolveRuleSegmentRefs(_0x5b7f40,async _0x466747=>{const _0x36624c=_0x386257,_0x4a5a21=_0xeebe50[_0x36624c(0x223)](_0x466747);if(_0x4a5a21)return _0x4a5a21;const _0x42a099=await _0x3676e4[_0x36624c(0x23a)](_0x466747);return _0x42a099[_0x36624c(0x244)];});_0xbc0489={'description':_0xdaee38[_0x386257(0x25e)],'rule':_0x1f3a26};}else{const _0x2a8a60=_0x371977['get'](_0x522619);if(_0x2a8a60)_0xc6911=_0x2a8a60,_0xeebe50[_0x386257(0x219)](_0x327101,_0xc6911);else{if(_0x75cc28){let _0x1e619e=_0x75cc28,_0x2afb4a=0x2;while(_0x45437c[_0x386257(0x201)](_0x1e619e)||_0x1e672e['has'](_0x1e619e)){_0x1e619e=_0x75cc28+'_'+_0x2afb4a,_0x2afb4a++;}_0x45437c[_0x386257(0x257)](_0x1e619e),_0xc6911=_0x1e619e;}_0xeebe50[_0x386257(0x219)](_0x327101,_0xc6911),_0x371977[_0x386257(0x219)](_0x522619,_0xc6911);const _0x570f09=await resolveRuleSegmentRefs(_0x5b7f40,async _0x12e915=>{const _0x1fdeb2=_0x386257,_0x41b0d1=_0xeebe50['get'](_0x12e915);if(_0x41b0d1)return _0x41b0d1;const _0x6dadac=await _0x3676e4[_0x1fdeb2(0x23a)](_0x12e915);return _0x6dadac[_0x1fdeb2(0x244)];});_0xbc0489={'description':_0xdaee38['description'],'rule':_0x570f09};}}}return{'name':_0xc6911,'isJourneyLocal':_0x3a7111,'definition':_0xbc0489};}catch{return{'name':_0x327101,'isJourneyLocal':![]};}},'resolveActivation':async _0x175d89=>{const _0x313d81=a110_0xe770,_0x99ca93=_0x438349[_0x313d81(0x223)](_0x175d89);if(_0x99ca93!==undefined)return{'name':_0x99ca93,'isJourneyLocal':!![]};try{let _0x228f5b=_0x1327c3?.[_0x313d81(0x223)](_0x175d89);!_0x228f5b&&(_0x228f5b=await _0x152fce[_0x313d81(0x1d0)][_0x313d81(0x235)](_0x150e1a,_0x175d89));const _0x5a0cd7=_0x228f5b['attributes'][_0x313d81(0x1fa)]['name']||_0x175d89,_0x4f55ab=sanitizeYamlKey(_0x5a0cd7)||_0x313d81(0x1ea)+_0x175d89,_0x462eed=_0x4f55ab;_0x438349[_0x313d81(0x219)](_0x175d89,_0x462eed);const _0x1c2d8a=journeyActivationStepToYaml(_0x228f5b,_0x7142e4,_0xa6247a);return{'name':_0x462eed,'isJourneyLocal':!![],'definition':_0x1c2d8a};}catch{return{'name':_0x175d89,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x589707,_0x2cada8)=>resolveJumpTarget(_0x589707,_0x2cada8,_0x401927,async _0x2e24a2=>{const _0x2e0029=a110_0xe770,_0x2f17ae=_0x26f212?.['get'](_0x2e24a2);if(_0x2f17ae)return _0x2f17ae;return _0x152fce['journey'][_0x2e0029(0x1db)](_0x2e24a2);})};return _0x3676e4=_0x6ca74d,_0x6ca74d;},_0x7f6474=async _0x5317ac=>{const _0x525e2a=a110_0xe770,{collectSegmentIdsFromJourneyApi:_0xc9dc7}=await import(_0x525e2a(0x1ca)),{batchAsync:_0x13692}=await import(_0x525e2a(0x20a)),_0x3e336e=new Set();for(const _0x260c86 of _0x5317ac){let _0x46389b=_0x26f212?.['get'](_0x260c86);!_0x46389b&&(_0x46389b=await _0x152fce[_0x525e2a(0x1d0)][_0x525e2a(0x1db)](_0x260c86));const _0x465716=_0xc9dc7(_0x46389b);for(const _0x5df6db of _0x465716){_0x3e336e['add'](_0x5df6db);}}let _0x559214=Array['from'](_0x3e336e);while(_0x559214['length']>0x0){const _0x28a3b6=_0x559214['filter'](_0x3bbfba=>!_0xb390a5[_0x525e2a(0x201)](_0x3bbfba));if(_0x28a3b6[_0x525e2a(0x281)]===0x0)break;const _0x57a2e0=await _0x13692(_0x28a3b6,async _0x3ae00a=>{const _0x5d6ca2=_0x525e2a;_0xb390a5[_0x5d6ca2(0x257)](_0x3ae00a);let _0x1c4fea=_0x5a7ac3[_0x5d6ca2(0x210)](_0x1ab6cf=>_0x1ab6cf['id']===_0x3ae00a);if(!_0x1c4fea)try{_0x1c4fea=await _0x152fce[_0x5d6ca2(0x20f)][_0x5d6ca2(0x1c8)](_0x819546,_0x3ae00a);}catch{return null;}return{'segmentId':_0x3ae00a,'segment':_0x1c4fea};},0xa),_0x1e4b5a=new Set();for(const _0x3d2c04 of _0x57a2e0){if(!_0x3d2c04?.['segment']?.['rule'])continue;const _0x198c51=apiRuleToYaml(_0x3d2c04[_0x525e2a(0x20f)]['rule']);_0x1ccf5d[_0x525e2a(0x219)](_0x3d2c04['segmentId'],_0x198c51);const _0x489bc5=collectSegmentRefsFromRule(_0x198c51);for(const _0x51f7cb of _0x489bc5){!_0xb390a5[_0x525e2a(0x201)](_0x51f7cb)&&_0x1e4b5a[_0x525e2a(0x257)](_0x51f7cb);}}_0x559214=Array[_0x525e2a(0x1ff)](_0x1e4b5a);}};return{'createYamlContext':_0x2a0b6a,'prefetchJourneySegments':_0x7f6474};}export async function executePushSegments(_0x5ce358,_0xb31aea,_0x47093d,_0x43c785,_0x57fb87){const _0x5d6a58=a110_0xe770,{segmentDefToCreateRequest:_0x2a5e8e,segmentDefToUpdateRequest:_0xa0fa30}=await import(_0x5d6a58(0x1fd)),_0xf1f6d6=_0x47093d[_0x5d6a58(0x252)],_0x442ca1=0x5,_0x5504d9=async _0x2f577d=>{const _0x2fb54d=_0x5d6a58,_0x1223de=_0x2f577d['folderPath']?_0xf1f6d6['get'](_0x2f577d[_0x2fb54d(0x1e1)]):undefined;let _0x1b1e94;const _0x3b5baf={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x2f577d[_0x2fb54d(0x1f5)]){_0x57fb87[_0x2fb54d(0x216)]?.({'type':_0x2fb54d(0x228),'name':_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]});const _0x295c30=_0x2a5e8e(_0x2f577d[_0x2fb54d(0x1f2)],_0x1223de),_0x2c8007=await _0x57fb87[_0x2fb54d(0x1fb)](_0x2fb54d(0x227)+_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]+_0x2fb54d(0x1a5),()=>_0x5ce358[_0x2fb54d(0x20f)]['createSegment'](_0x43c785[_0x2fb54d(0x27a)],_0x295c30));_0x1b1e94=_0x2c8007['data']['id'],_0x3b5baf[_0x2fb54d(0x1a9)]={'name':_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)],'id':_0x1b1e94},_0x57fb87[_0x2fb54d(0x216)]?.({'type':_0x2fb54d(0x254),'name':_0x2f577d['yamlConfig'][_0x2fb54d(0x244)],'segmentId':_0x1b1e94}),_0x57fb87['logSuccess']?.(_0x2fb54d(0x282)+_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]+'\x27'),_0x3b5baf[_0x2fb54d(0x264)]=0x1;}else{if(_0x2f577d[_0x2fb54d(0x21a)]){_0x57fb87[_0x2fb54d(0x216)]?.({'type':_0x2fb54d(0x23b),'name':_0x2f577d[_0x2fb54d(0x1f2)]['name']});const _0x1fc3da=_0xa0fa30(_0x2f577d[_0x2fb54d(0x1f2)]);_0x1223de!==_0x2f577d['existingSegment']?.[_0x2fb54d(0x200)]&&(_0x1fc3da['segmentFolderId']=_0x1223de?parseInt(_0x1223de,0xa):undefined),await _0x57fb87[_0x2fb54d(0x1fb)](_0x2fb54d(0x1c0)+_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]+_0x2fb54d(0x1a5),()=>_0x5ce358[_0x2fb54d(0x20f)][_0x2fb54d(0x1dc)](_0x43c785[_0x2fb54d(0x27a)],_0x2f577d[_0x2fb54d(0x23f)]['id'],_0x1fc3da)),_0x1b1e94=_0x2f577d[_0x2fb54d(0x23f)]['id'],_0x57fb87[_0x2fb54d(0x216)]?.({'type':_0x2fb54d(0x1ee),'name':_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]}),_0x57fb87[_0x2fb54d(0x27d)]?.(_0x2fb54d(0x233)+_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]+'\x27'),_0x3b5baf['updated']=0x1;}else _0x1b1e94=_0x2f577d['existingSegment']['id'];}}catch(_0x5e7875){const _0x4e8a73=isHttp400Error(_0x5e7875),_0x2a6831=_0x4e8a73?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x2fb54d(0x220)],_0x5a85fd=getErrorMessage(_0x5e7875);throw new SDKError(_0x2a6831,'Failed\x20to\x20'+(_0x2f577d[_0x2fb54d(0x1f5)]?_0x2fb54d(0x1fe):'update')+_0x2fb54d(0x270)+_0x2f577d[_0x2fb54d(0x214)]+_0x2fb54d(0x1aa)+_0x5a85fd,_0x5e7875);}try{const _0x46bde9=await syncActivationsForSegment(_0x5ce358,_0x43c785[_0x2fb54d(0x27a)],_0x1b1e94,_0x2f577d[_0x2fb54d(0x1f2)]['name'],_0x2f577d['activationActions'],_0x57fb87,_0x2f577d[_0x2fb54d(0x214)]);_0x3b5baf[_0x2fb54d(0x20b)]=_0x46bde9;}catch(_0x1002d1){if(_0x1002d1 instanceof SDKError)throw _0x1002d1;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2fb54d(0x218)+_0x2f577d['yamlConfig'][_0x2fb54d(0x244)]+_0x2fb54d(0x1ef)+_0x2f577d[_0x2fb54d(0x214)]+_0x2fb54d(0x1aa)+getErrorMessage(_0x1002d1),_0x1002d1);}return _0x3b5baf;},_0x15c5ef=await batchAsync(_0xb31aea,_0x5504d9,_0x442ca1),_0x4a93e={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x299e68 of _0x15c5ef){_0x4a93e[_0x5d6a58(0x264)]+=_0x299e68[_0x5d6a58(0x264)],_0x4a93e[_0x5d6a58(0x288)]+=_0x299e68[_0x5d6a58(0x288)],_0x299e68[_0x5d6a58(0x1a9)]&&_0x4a93e[_0x5d6a58(0x1d6)][_0x5d6a58(0x219)](_0x299e68['createdSegmentId']['name'],_0x299e68[_0x5d6a58(0x1a9)]['id']),_0x4a93e['activations']['created']+=_0x299e68[_0x5d6a58(0x20b)][_0x5d6a58(0x264)],_0x4a93e[_0x5d6a58(0x20b)]['updated']+=_0x299e68[_0x5d6a58(0x20b)]['updated'],_0x4a93e[_0x5d6a58(0x20b)][_0x5d6a58(0x23e)]+=_0x299e68['activations']['deleted'];}return _0x4a93e;}async function syncActivationsForSegment(_0x5187d9,_0x4a4ad6,_0xb1e240,_0x206ec4,_0x30b553,_0x226467,_0x269c28){const _0x515319=a110_0xe770,_0x594e30={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x21a38b of _0x30b553){try{if(_0x21a38b[_0x515319(0x1b8)]===_0x515319(0x1fe)&&_0x21a38b[_0x515319(0x24d)])_0x226467[_0x515319(0x216)]?.({'type':_0x515319(0x229),'segmentName':_0x206ec4,'activationName':_0x21a38b[_0x515319(0x244)]}),await _0x226467[_0x515319(0x1fb)](_0x515319(0x1cb)+_0x21a38b[_0x515319(0x244)]+'\x27...',()=>_0x5187d9['segment'][_0x515319(0x1d8)](_0x4a4ad6,_0xb1e240,_0x21a38b[_0x515319(0x24d)])),_0x226467[_0x515319(0x216)]?.({'type':_0x515319(0x1af),'segmentName':_0x206ec4,'activationName':_0x21a38b['name']}),_0x226467['logSuccess']?.(_0x515319(0x286)+_0x21a38b[_0x515319(0x244)]+'\x27'),_0x594e30[_0x515319(0x264)]++;else{if(_0x21a38b['type']===_0x515319(0x27f)&&_0x21a38b[_0x515319(0x24d)]&&_0x21a38b[_0x515319(0x1f9)])_0x226467['onProgress']?.({'type':_0x515319(0x1c5),'segmentName':_0x206ec4,'activationName':_0x21a38b['name']}),await _0x226467[_0x515319(0x1fb)](_0x515319(0x21d)+_0x21a38b[_0x515319(0x244)]+'\x27...',()=>_0x5187d9[_0x515319(0x20f)][_0x515319(0x23c)](_0x4a4ad6,_0xb1e240,_0x21a38b[_0x515319(0x1f9)]['id'],_0x21a38b[_0x515319(0x24d)])),_0x226467['onProgress']?.({'type':'activation_updated','segmentName':_0x206ec4,'activationName':_0x21a38b['name']}),_0x226467[_0x515319(0x27d)]?.(_0x515319(0x1bf)+_0x21a38b['name']+'\x27'),_0x594e30['updated']++;else _0x21a38b[_0x515319(0x1b8)]===_0x515319(0x1be)&&_0x21a38b[_0x515319(0x1f9)]&&(_0x226467[_0x515319(0x216)]?.({'type':_0x515319(0x279),'segmentName':_0x206ec4,'activationName':_0x21a38b[_0x515319(0x244)]}),await _0x226467[_0x515319(0x1fb)](_0x515319(0x276)+_0x21a38b['name']+'\x27...',()=>_0x5187d9[_0x515319(0x20f)]['deleteActivation'](_0x4a4ad6,_0xb1e240,_0x21a38b['existingActivation']['id'])),_0x226467[_0x515319(0x216)]?.({'type':_0x515319(0x26f),'segmentName':_0x206ec4,'activationName':_0x21a38b[_0x515319(0x244)]}),_0x226467[_0x515319(0x225)]?.('Deleted\x20activation\x20\x27'+_0x21a38b['name']+'\x27'),_0x594e30['deleted']++);}}catch(_0x5a71bb){const _0x21d881=isHttp400Error(_0x5a71bb),_0x3da0b4=_0x21d881?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x515319(0x1c3)],_0x20f91c=getErrorMessage(_0x5a71bb);throw new SDKError(_0x3da0b4,_0x515319(0x207)+_0x21a38b[_0x515319(0x1b8)]+_0x515319(0x212)+_0x21a38b['name']+_0x515319(0x1ef)+_0x269c28+'\x0a\x20\x20'+_0x20f91c,_0x5a71bb);}}return _0x594e30;}export async function executePushFolders(_0x10ecd5,_0x3e2da8,_0x33d79e,_0x1c9612,_0x54afef){const _0x3ed53c=a110_0xe770,_0x2cd1c8=new Map(_0x33d79e);for(const _0x4db854 of _0x3e2da8){const _0x312fe2=_0x4db854[_0x3ed53c(0x265)]('/'),_0x56fa0b=_0x312fe2[_0x312fe2['length']-0x1],_0x2fae84=_0x312fe2[_0x3ed53c(0x284)](0x0,-0x1)['join']('/'),_0x19bfa6=_0x2cd1c8[_0x3ed53c(0x223)](_0x2fae84);_0x54afef[_0x3ed53c(0x216)]?.({'type':_0x3ed53c(0x205),'folder':_0x4db854});const _0xa76426={'name':_0x56fa0b,'parentFolderId':_0x19bfa6},_0x581ef0=await _0x54afef[_0x3ed53c(0x1fb)](_0x3ed53c(0x1e8)+_0x4db854+_0x3ed53c(0x1a5),()=>_0x10ecd5[_0x3ed53c(0x20f)]['createFolder'](_0x1c9612[_0x3ed53c(0x27a)],_0xa76426));_0x2cd1c8[_0x3ed53c(0x219)](_0x4db854,_0x581ef0[_0x3ed53c(0x263)]['id']),_0x54afef['onProgress']?.({'type':_0x3ed53c(0x246),'folder':_0x4db854,'folderId':_0x581ef0['data']['id']}),_0x54afef[_0x3ed53c(0x203)]?.(_0x3ed53c(0x275)+_0x4db854+'\x27');}return _0x2cd1c8;}export async function executePushSegmentDeletions(_0x4d8a9e,_0x2460fe,_0x4de22b){if(_0x2460fe['length']===0x0)return 0x0;const {batchAsync:_0x1091fe}=await import('../../utils/async.js'),_0x493102=0x5,_0x3cc96a=await _0x1091fe(_0x2460fe,async _0x3b7ab3=>{const _0x1effa0=a110_0xe770;return _0x4de22b['onProgress']?.({'type':_0x1effa0(0x1ab),'name':_0x3b7ab3[_0x1effa0(0x244)]}),await _0x4d8a9e['segment']['deleteSegment'](_0x3b7ab3['id']),_0x4de22b[_0x1effa0(0x216)]?.({'type':_0x1effa0(0x1b2),'name':_0x3b7ab3['name']}),_0x4de22b[_0x1effa0(0x225)]?.(_0x1effa0(0x22c)+_0x3b7ab3[_0x1effa0(0x244)]+'\x27'),0x1;},_0x493102);return _0x3cc96a['reduce']((_0x4e7eae,_0x57511d)=>_0x4e7eae+_0x57511d,0x0);}function a110_0xe770(_0x3825d9,_0xb8a87c){_0x3825d9=_0x3825d9-0x1a4;const _0x23d95f=a110_0x23d9();let _0xe770a9=_0x23d95f[_0x3825d9];return _0xe770a9;}export async function executePushJourneys(_0x10b1a3,_0xaf4980,_0x48daab,_0x5ad8f1,_0x40d29d){const _0x135f17=a110_0xe770,{journeyDefToRequest:_0x186e89}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x50aec3,yamlRuleToApi:_0x237e12,validateSegmentRule:_0x478aa2}=await import(_0x135f17(0x1fd)),_0x2e3448={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x23c785=new Map(_0x48daab['segmentNameToId']),_0x18094b=0x5;for(let _0x589cf4=0x0;_0x589cf4<_0xaf4980[_0x135f17(0x281)];_0x589cf4+=_0x18094b){const _0x53ec81=_0xaf4980[_0x135f17(0x284)](_0x589cf4,_0x589cf4+_0x18094b),_0x56bee7=await Promise[_0x135f17(0x1d3)](_0x53ec81[_0x135f17(0x287)](async _0x193982=>{const _0x451ac5=_0x135f17;if(!_0x193982[_0x451ac5(0x1f5)]&&!_0x193982[_0x451ac5(0x21a)])return{'action':_0x451ac5(0x1bc),'name':_0x193982[_0x451ac5(0x1f2)]['name'],'journeyId':_0x193982[_0x451ac5(0x208)]?.['id']};const _0x3f960b=_0x193982[_0x451ac5(0x1e1)]?_0x48daab[_0x451ac5(0x252)]['get'](_0x193982['folderPath']):undefined;_0x40d29d[_0x451ac5(0x216)]?.({'type':_0x193982[_0x451ac5(0x1f5)]?'journey_creating':_0x451ac5(0x221),'name':_0x193982['yamlConfig']['name']});try{const _0x489cdf=await executeSingleJourneyPush(_0x10b1a3,_0x193982,{..._0x48daab,'segmentNameToId':_0x23c785},{'parentId':_0x5ad8f1['parentId'],'rootFolderId':_0x5ad8f1[_0x451ac5(0x24e)],'folderId':_0x3f960b,'verbose':_0x5ad8f1[_0x451ac5(0x1e0)]},_0x40d29d,{'journeyDefToRequest':_0x186e89,'activationDefToCreateRequest':_0x50aec3,'yamlRuleToApi':_0x237e12,'validateSegmentRule':_0x478aa2});for(const [_0x2ee652,_0x36e4ec]of _0x489cdf[_0x451ac5(0x1c2)]){_0x23c785[_0x451ac5(0x219)](_0x2ee652,_0x36e4ec),_0x2e3448['embeddedSegmentNameToId'][_0x451ac5(0x219)](_0x2ee652,_0x36e4ec);}if(_0x489cdf[_0x451ac5(0x245)]===_0x451ac5(0x264))_0x40d29d['onProgress']?.({'type':'journey_created','name':_0x193982[_0x451ac5(0x1f2)][_0x451ac5(0x244)],'journeyId':_0x489cdf['journeyId']}),_0x40d29d[_0x451ac5(0x27d)]?.('Created\x20journey\x20\x27'+_0x193982[_0x451ac5(0x1f2)][_0x451ac5(0x244)]+'\x27'),_0x2e3448[_0x451ac5(0x264)]++;else _0x489cdf['action']==='updated'&&(_0x40d29d[_0x451ac5(0x216)]?.({'type':_0x451ac5(0x1c6),'name':_0x193982[_0x451ac5(0x1f2)][_0x451ac5(0x244)]}),_0x40d29d[_0x451ac5(0x27d)]?.(_0x451ac5(0x237)+_0x193982[_0x451ac5(0x1f2)]['name']+'\x27'),_0x2e3448['updated']++);return{'action':_0x489cdf[_0x451ac5(0x245)],'name':_0x193982['yamlConfig'][_0x451ac5(0x244)],'journeyId':_0x489cdf['journeyId']};}catch(_0x3dcc64){const _0x106c97=isHttp400Error(_0x3dcc64),_0x125571=_0x106c97?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x4f9ef9=getErrorMessage(_0x3dcc64);throw new SDKError(_0x125571,_0x451ac5(0x207)+(_0x193982[_0x451ac5(0x1f5)]?_0x451ac5(0x1fe):_0x451ac5(0x27f))+_0x451ac5(0x269)+_0x193982[_0x451ac5(0x214)]+_0x451ac5(0x1aa)+_0x4f9ef9,_0x3dcc64);}}));_0x2e3448[_0x135f17(0x22b)][_0x135f17(0x241)](..._0x56bee7);}return _0x2e3448;}async function executeSingleJourneyPush(_0x472503,_0x288f8c,_0x52b4bd,_0x284507,_0xcf48c5,_0x3aee61){const _0xc113ac=a110_0xe770,{journeyDefToRequest:_0x5d0446,activationDefToCreateRequest:_0x2b0f64,yamlRuleToApi:_0x599890,validateSegmentRule:_0x8b9ce2}=_0x3aee61,_0x1ec0d4=new Map(),_0x3cda6a=new Map(),_0x56d4b8=new Map(),_0x525e3a=new Map(),_0x414aa0=new Map();let _0x2e4be4;const _0x18c7f2=async()=>{const _0x258c0b=a110_0xe770;if(_0x2e4be4)return;_0x2e4be4=new Map();if(!_0x288f8c[_0x258c0b(0x208)])return;const _0x5e7657=await _0x472503['journey'][_0x258c0b(0x277)](_0x288f8c[_0x258c0b(0x208)]['id']);for(const _0x2fe9df of _0x5e7657){const _0x3138e3=journeyActivationStepToYaml(_0x2fe9df,_0x52b4bd[_0x258c0b(0x26e)],_0x52b4bd[_0x258c0b(0x1a7)]),_0x32163d=activationSignature(_0x3138e3);!_0x2e4be4[_0x258c0b(0x201)](_0x32163d)&&_0x2e4be4['set'](_0x32163d,_0x2fe9df['id']),_0x3138e3[_0x258c0b(0x244)]&&_0x3cda6a[_0x258c0b(0x219)](_0x3138e3[_0x258c0b(0x244)],_0x2fe9df['id']);}};if(_0x288f8c[_0xc113ac(0x208)]&&_0x288f8c['yamlConfig'][_0xc113ac(0x1f4)]){const _0x158635=buildLocalExpandedRuleMappings(_0x288f8c['yamlConfig']),_0xa3e9d1=_0x158635['localSegmentRules'];if(_0xa3e9d1['size']>0x0){const _0x100173=new Map();for(const [_0xb88afd,_0x44c6d8]of _0xa3e9d1){const _0x47d79e=serializeExpandedRule(_0x44c6d8,_0xa3e9d1);_0x100173['set'](_0xb88afd,_0x47d79e);}const _0x249f81=collectSegmentIdsFromJourneyApi(_0x288f8c[_0xc113ac(0x208)]);if(_0x249f81[_0xc113ac(0x215)]>0x0){const _0x58eb81=await buildServerSegmentRuleMap(_0x472503,_0x284507['parentId'],_0x52b4bd[_0xc113ac(0x236)],_0x249f81);if(_0x58eb81['size']>0x0){const _0x4509ca=new Map();for(const [_0x3442fd,_0x59e951]of _0x58eb81){const _0x413871=serializeExpandedRule(_0x59e951,_0x58eb81);!_0x4509ca[_0xc113ac(0x201)](_0x413871)&&_0x4509ca[_0xc113ac(0x219)](_0x413871,_0x3442fd);}for(const [_0x2b64e2,_0x3d8754]of _0x100173){const _0x404278=_0x4509ca[_0xc113ac(0x223)](_0x3d8754);_0x404278&&(_0x414aa0['set'](_0x2b64e2,_0x404278),_0x52b4bd[_0xc113ac(0x204)][_0xc113ac(0x219)](_0x2b64e2,_0x404278));}}}}}const _0x546826={'resolveSegmentId':async _0x3b371e=>{const _0xe67fcc=_0xc113ac,_0x4c76f3=_0x52b4bd[_0xe67fcc(0x204)][_0xe67fcc(0x223)](_0x3b371e);if(!_0x4c76f3)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xe67fcc(0x21c)+_0x3b371e+'\x20(referenced\x20in\x20journey\x20'+_0x288f8c[_0xe67fcc(0x1f2)][_0xe67fcc(0x244)]+')');return _0x4c76f3;},'resolveEmbeddedSegmentId':async(_0x15f0f8,_0x2b8071)=>{const _0x10e3f2=_0xc113ac,_0x14c81b=_0x52b4bd['segmentNameToId'][_0x10e3f2(0x223)](_0x15f0f8);if(_0x14c81b)return _0x14c81b;const _0x679072=_0x414aa0[_0x10e3f2(0x223)](_0x15f0f8);if(_0x679072)return _0x52b4bd[_0x10e3f2(0x204)][_0x10e3f2(0x219)](_0x15f0f8,_0x679072),_0x679072;const _0x8a6f0f=_0x52b4bd[_0x10e3f2(0x236)][_0x10e3f2(0x210)](_0x51a962=>_0x51a962['name']===_0x15f0f8);if(_0x8a6f0f)return _0x52b4bd[_0x10e3f2(0x204)]['set'](_0x15f0f8,_0x8a6f0f['id']),_0x8a6f0f['id'];if(_0x288f8c[_0x10e3f2(0x1f5)]){const {stageName:_0x4959f9,criteriaName:_0x5840e1}=findSegmentCriteriaLocation(_0x288f8c[_0x10e3f2(0x1f2)],_0x15f0f8);return _0x8b9ce2(_0x15f0f8,_0x2b8071[_0x10e3f2(0x21b)]),_0x56d4b8[_0x10e3f2(0x219)](_0x15f0f8,{'definition':_0x2b8071,'stageName':_0x4959f9,'criteriaName':_0x5840e1}),createPendingSegmentId(_0x15f0f8);}const _0x54e02a=_0x288f8c[_0x10e3f2(0x208)]?.['id'];if(!_0x54e02a)throw new SDKError(ErrorCode[_0x10e3f2(0x26d)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x8b9ce2(_0x15f0f8,_0x2b8071[_0x10e3f2(0x21b)]);const _0x49ae36=generateDeterministicJourneySegmentName(_0x288f8c['yamlConfig'][_0x10e3f2(0x244)],_0x15f0f8),_0x4c419b=_0x52b4bd['existingSegments'][_0x10e3f2(0x210)](_0x26abaa=>_0x26abaa[_0x10e3f2(0x244)]===_0x49ae36),_0x1b94b5=createSegmentIdResolver(_0x52b4bd[_0x10e3f2(0x204)],_0x15f0f8),_0x5b7eeb=await resolveRuleSegmentIds(_0x2b8071['rule'],_0x1b94b5);let _0x4dfdf4;if(_0x4c419b)await _0x472503[_0x10e3f2(0x20f)]['updateSegmentById'](_0x284507[_0x10e3f2(0x27a)],_0x4c419b['id'],{'description':_0x2b8071[_0x10e3f2(0x25e)]||_0x10e3f2(0x26c)+_0x15f0f8,'rule':_0x599890(_0x5b7eeb,!![]),'countPopulation':!![]}),_0x4dfdf4=_0x4c419b['id'];else try{_0x4dfdf4=await _0x472503['segment'][_0x10e3f2(0x202)]({'name':_0x49ae36,'description':_0x2b8071['description']||'Entry\x20criteria:\x20'+_0x15f0f8,'journeyId':_0x54e02a,'rule':_0x599890(_0x5b7eeb,!![]),'countPopulation':!![],'parentFolderId':_0x284507[_0x10e3f2(0x24e)]||'','audienceId':_0x284507[_0x10e3f2(0x27a)]});}catch(_0x11c84f){const _0x4cd8ff=_0x11c84f instanceof Error&&_0x11c84f[_0x10e3f2(0x24a)][_0x10e3f2(0x1bd)]('Name\x20has\x20already\x20been\x20taken');if(_0x4cd8ff){const _0x26fe38=await _0x472503[_0x10e3f2(0x20f)][_0x10e3f2(0x1ae)](_0x284507['parentId']),_0x241cc9=_0x26fe38['find'](_0x20a53f=>_0x20a53f[_0x10e3f2(0x244)]===_0x49ae36);if(_0x241cc9)await _0x472503[_0x10e3f2(0x20f)][_0x10e3f2(0x1dc)](_0x284507['parentId'],_0x241cc9['id'],{'description':_0x2b8071[_0x10e3f2(0x25e)]||_0x10e3f2(0x26c)+_0x15f0f8,'rule':_0x599890(_0x5b7eeb,!![]),'countPopulation':!![]}),_0x4dfdf4=_0x241cc9['id'];else throw _0x11c84f;}else throw _0x11c84f;}return _0x52b4bd[_0x10e3f2(0x204)]['set'](_0x15f0f8,_0x4dfdf4),_0x1ec0d4[_0x10e3f2(0x219)](_0x15f0f8,_0x4dfdf4),_0x4dfdf4;},'resolveActivationId':async _0x5d99f9=>{const _0x5ea6ad=_0xc113ac,_0x134331=_0x3cda6a[_0x5ea6ad(0x223)](_0x5d99f9);if(_0x134331)return _0x134331;if(_0x288f8c['existingJourney']){await _0x18c7f2();const _0x414872=_0x3cda6a[_0x5ea6ad(0x223)](_0x5d99f9);if(_0x414872)return _0x414872;}throw new SDKError(ErrorCode[_0x5ea6ad(0x1cf)],_0x5ea6ad(0x247)+_0x5d99f9+_0x5ea6ad(0x25a)+_0x288f8c[_0x5ea6ad(0x1f2)][_0x5ea6ad(0x244)]+').\x20'+_0x5ea6ad(0x22a));},'resolveEmbeddedActivationId':async(_0x10335d,_0x5e17e7)=>{const _0x5237bf=_0xc113ac,_0x378cf4=_0x3cda6a[_0x5237bf(0x223)](_0x10335d);if(_0x378cf4)return _0x378cf4;if(_0x288f8c[_0x5237bf(0x1f5)])return _0x525e3a[_0x5237bf(0x219)](_0x10335d,_0x5e17e7),createPendingActivationId(_0x10335d);if(_0x288f8c[_0x5237bf(0x208)]){await _0x18c7f2();const _0x5b723a=_0x3cda6a[_0x5237bf(0x223)](_0x5e17e7['name']);if(_0x5b723a)return _0x3cda6a[_0x5237bf(0x219)](_0x10335d,_0x5b723a),_0x5b723a;const _0x3d3b92=activationSignature(_0x5e17e7),_0x3048fe=_0x2e4be4?.[_0x5237bf(0x223)](_0x3d3b92);if(_0x3048fe)return _0x3cda6a[_0x5237bf(0x219)](_0x10335d,_0x3048fe),_0x3048fe;const _0x29cec7=await _0x2b0f64(_0x5e17e7,_0x52b4bd['activationContext']),_0xae3228=await _0x472503['journey'][_0x5237bf(0x1d8)](_0x288f8c['existingJourney']['id'],_0x29cec7);return _0x3cda6a[_0x5237bf(0x219)](_0x10335d,_0xae3228['id']),_0xae3228['id'];}throw new SDKError(ErrorCode[_0x5237bf(0x26d)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x5cdb8b=>{const _0x8f0090=_0xc113ac;try{return await _0x472503['journey']['resolveJourneyId'](_0x284507['parentId'],_0x5cdb8b);}catch(_0x186e9e){throw new SDKError(ErrorCode[_0x8f0090(0x1cf)],_0x8f0090(0x22f)+_0x5cdb8b+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x288f8c[_0x8f0090(0x1f2)][_0x8f0090(0x244)]+'\x27)',_0x186e9e);}},'resolveStageId':async(_0x14cc97,_0x235c12)=>{const _0x2cd8f5=_0xc113ac,_0x45957b=await _0x472503[_0x2cd8f5(0x1d0)][_0x2cd8f5(0x1db)](_0x14cc97),_0x48ae0e=_0x45957b[_0x2cd8f5(0x1a6)][_0x2cd8f5(0x283)][_0x2cd8f5(0x210)](_0x5311a5=>_0x5311a5[_0x2cd8f5(0x244)][_0x2cd8f5(0x22e)]()===_0x235c12[_0x2cd8f5(0x22e)]());if(!_0x48ae0e?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x235c12+_0x2cd8f5(0x248)+(_0x45957b['attributes']['journeyBundleName']||_0x45957b[_0x2cd8f5(0x1a6)][_0x2cd8f5(0x244)])+'\x27');return _0x48ae0e['id'];}},_0x41b80f=await _0x5d0446(_0x288f8c[_0xc113ac(0x1f2)],_0x284507[_0xc113ac(0x27a)],_0x546826),_0x3e38f4=_0x284507['folderId']||_0x284507[_0xc113ac(0x24e)];_0x3e38f4&&(_0x41b80f['relationships']={'parentFolder':{'data':{'id':_0x3e38f4,'type':_0xc113ac(0x231)}}});if(_0x288f8c[_0xc113ac(0x1f5)]){if(_0x56d4b8[_0xc113ac(0x215)]>0x0||_0x525e3a['size']>0x0)return await executeThreeStepJourneyCreate(_0x472503,_0x288f8c,_0x41b80f,{'pendingEmbeddedSegments':_0x56d4b8,'pendingEmbeddedActivations':_0x525e3a,'embeddedSegmentNameToId':_0x1ec0d4,'journeyActivationNameToId':_0x3cda6a},{..._0x284507,'effectiveFolderId':_0x3e38f4},_0x52b4bd,_0xcf48c5,_0x3aee61);else{ensureJourneyDefaults(_0x41b80f[_0xc113ac(0x1a6)]);const _0x1f7989=await _0x472503[_0xc113ac(0x1d0)][_0xc113ac(0x1fe)](_0x41b80f);return{'action':_0xc113ac(0x264),'journeyId':_0x1f7989['id'],'embeddedSegmentNameToId':_0x1ec0d4};}}else{if(_0x288f8c['hasChanges']&&_0x288f8c[_0xc113ac(0x208)])return ensureJourneyDefaults(_0x41b80f[_0xc113ac(0x1a6)]),await _0x472503[_0xc113ac(0x1d0)][_0xc113ac(0x27f)](_0x288f8c['existingJourney']['id'],_0x41b80f),{'action':_0xc113ac(0x288),'journeyId':_0x288f8c[_0xc113ac(0x208)]['id'],'embeddedSegmentNameToId':_0x1ec0d4};}return{'action':_0xc113ac(0x1bc),'journeyId':_0x288f8c[_0xc113ac(0x208)]?.['id'],'embeddedSegmentNameToId':_0x1ec0d4};}function findSegmentCriteriaLocation(_0x3e28c7,_0x2aed50){const _0x2cb1e9=a110_0xe770,_0x630e29=_0x3e28c7[_0x2cb1e9(0x222)]||_0x3e28c7[_0x2cb1e9(0x1df)]?.[0x0]?.[_0x2cb1e9(0x222)]||[];let _0x2d7234=_0x2cb1e9(0x273),_0x47d62c=_0x2aed50;const _0x5d62b0=_0x3e28c7[_0x2cb1e9(0x224)]||_0x3e28c7['journeys']?.[0x0]?.['goal'];if(_0x5d62b0?.['segment']===_0x2aed50)return{'stageName':'goal','criteriaName':_0x5d62b0[_0x2cb1e9(0x244)]||_0x2aed50};_0x1ffd0c:for(const _0x46335e of _0x630e29){if(_0x46335e[_0x2cb1e9(0x21f)]?.[_0x2cb1e9(0x20f)]===_0x2aed50){_0x2d7234=_0x46335e[_0x2cb1e9(0x244)],_0x47d62c=_0x46335e[_0x2cb1e9(0x21f)][_0x2cb1e9(0x244)]||_0x2aed50;break;}if(_0x46335e[_0x2cb1e9(0x280)])for(const _0x298f21 of _0x46335e[_0x2cb1e9(0x280)]){if(_0x298f21[_0x2cb1e9(0x1b8)]===_0x2cb1e9(0x23d)&&_0x298f21[_0x2cb1e9(0x1eb)]?.[_0x2cb1e9(0x1f1)])for(const _0xf854d3 of _0x298f21[_0x2cb1e9(0x1eb)][_0x2cb1e9(0x1f1)]){if(_0xf854d3[_0x2cb1e9(0x20f)]===_0x2aed50){_0x2d7234=_0x46335e[_0x2cb1e9(0x244)],_0x47d62c=_0xf854d3[_0x2cb1e9(0x244)]||_0x2aed50;break _0x1ffd0c;}}}}return{'stageName':_0x2d7234,'criteriaName':_0x47d62c};}async function executeThreeStepJourneyCreate(_0x1eb3e3,_0x1528b0,_0x1f6e9d,_0x56cf4e,_0x13877d,_0x395420,_0x49349d,_0x29a13f){const _0x3ccf68=a110_0xe770,{activationDefToCreateRequest:_0x5daa9e,yamlRuleToApi:_0xbe7ece}=_0x29a13f,{pendingEmbeddedSegments:_0x39998b,pendingEmbeddedActivations:_0x1906c7,embeddedSegmentNameToId:_0x105d5b}=_0x56cf4e,_0x18e8b1=JSON[_0x3ccf68(0x260)](JSON[_0x3ccf68(0x1c1)](_0x1f6e9d));ensureJourneyDefaults(_0x18e8b1['attributes']),stripPendingIds(_0x18e8b1);const _0x51a9a7=await _0x1eb3e3[_0x3ccf68(0x1d0)]['create'](_0x18e8b1),_0x44f3cd=_0x51a9a7['id'],_0x2d3ae7=new Map();for(const _0x145ded of _0x51a9a7[_0x3ccf68(0x1a6)][_0x3ccf68(0x283)]){_0x2d3ae7[_0x3ccf68(0x219)](_0x145ded[_0x3ccf68(0x244)][_0x3ccf68(0x22e)](),_0x145ded['id']);}for(const [_0x24af89,{definition:_0x16a52e}]of _0x39998b){const _0x4f4d35=generateDeterministicJourneySegmentName(_0x1528b0[_0x3ccf68(0x1f2)]['name'],_0x24af89);_0x49349d[_0x3ccf68(0x216)]?.({'type':'embedded_segment_creating','journeyName':_0x1528b0[_0x3ccf68(0x1f2)][_0x3ccf68(0x244)],'segmentName':_0x24af89});const _0x1472b5=createSegmentIdResolver(_0x395420[_0x3ccf68(0x204)],_0x24af89),_0x3d4e0a=await resolveRuleSegmentIds(_0x16a52e[_0x3ccf68(0x21b)],_0x1472b5),_0xb07c03=await _0x1eb3e3[_0x3ccf68(0x20f)]['createJourneySegment']({'name':_0x4f4d35,'description':_0x16a52e['description']||_0x3ccf68(0x26c)+_0x24af89,'journeyId':_0x44f3cd,'rule':_0xbe7ece(_0x3d4e0a,!![]),'countPopulation':!![],'parentFolderId':_0x13877d[_0x3ccf68(0x1ce)]||'','audienceId':_0x13877d[_0x3ccf68(0x27a)]});_0x105d5b[_0x3ccf68(0x219)](_0x24af89,_0xb07c03),_0x395420[_0x3ccf68(0x204)]['set'](_0x24af89,_0xb07c03),_0x49349d['onProgress']?.({'type':_0x3ccf68(0x272),'journeyName':_0x1528b0['yamlConfig']['name'],'segmentName':_0x24af89});}const _0x2d0a29=new Map();for(const [_0x1f5a4e,_0x2d94b4]of _0x1906c7){_0x49349d[_0x3ccf68(0x216)]?.({'type':_0x3ccf68(0x25f),'journeyName':_0x1528b0[_0x3ccf68(0x1f2)]['name'],'activationName':_0x1f5a4e});const _0x35e6b7=await _0x5daa9e(_0x2d94b4,_0x395420['activationContext']),_0x2ab9a2=await _0x1eb3e3[_0x3ccf68(0x1d0)]['createActivation'](_0x44f3cd,_0x35e6b7);_0x2d0a29[_0x3ccf68(0x219)](_0x1f5a4e,_0x2ab9a2['id']),_0x56cf4e['journeyActivationNameToId'][_0x3ccf68(0x219)](_0x1f5a4e,_0x2ab9a2['id']),_0x49349d[_0x3ccf68(0x216)]?.({'type':'embedded_activation_created','journeyName':_0x1528b0[_0x3ccf68(0x1f2)][_0x3ccf68(0x244)],'activationName':_0x1f5a4e});}const _0x4177f0=JSON['parse'](JSON[_0x3ccf68(0x1c1)](_0x1f6e9d));return _0x4177f0['id']=_0x44f3cd,ensureJourneyDefaults(_0x4177f0['attributes']),resolvePendingIdsInRequest(_0x4177f0,_0x1f6e9d,_0x2d3ae7,_0x105d5b,_0x2d0a29,_0x49349d),await _0x1eb3e3[_0x3ccf68(0x1d0)]['update'](_0x44f3cd,_0x4177f0),{'action':_0x3ccf68(0x264),'journeyId':_0x44f3cd,'embeddedSegmentNameToId':_0x105d5b};}function stripPendingIds(_0x31627a){const _0xf2f33e=a110_0xe770;for(const _0x3332fb of _0x31627a[_0xf2f33e(0x1a6)][_0xf2f33e(0x283)]||[]){_0x3332fb[_0xf2f33e(0x271)]?.[_0xf2f33e(0x1f8)]&&isPendingSegmentId(_0x3332fb[_0xf2f33e(0x271)]['segmentId'])&&delete _0x3332fb[_0xf2f33e(0x271)];if(_0x3332fb['steps'])for(const _0x5db026 of Object[_0xf2f33e(0x1e7)](_0x3332fb['steps'])){const _0x36e14d=_0x3332fb[_0xf2f33e(0x280)][_0x5db026];_0x36e14d[_0xf2f33e(0x1b8)]===_0xf2f33e(0x1e3)&&_0x36e14d[_0xf2f33e(0x27b)]&&isPendingActivationId(_0x36e14d[_0xf2f33e(0x27b)])&&(_0x36e14d[_0xf2f33e(0x27b)]='');if(_0x36e14d['type']===_0xf2f33e(0x209)&&_0x36e14d[_0xf2f33e(0x1f1)])for(const _0x3a01ad of _0x36e14d[_0xf2f33e(0x1f1)]){_0x3a01ad[_0xf2f33e(0x1f8)]&&isPendingSegmentId(_0x3a01ad[_0xf2f33e(0x1f8)])&&(_0x3a01ad[_0xf2f33e(0x1f8)]='');}_0x36e14d[_0xf2f33e(0x1b8)]===_0xf2f33e(0x1b1)&&_0x36e14d[_0xf2f33e(0x285)]?.[_0xf2f33e(0x1f8)]&&isPendingSegmentId(_0x36e14d['waitCondition'][_0xf2f33e(0x1f8)])&&(_0x36e14d['waitCondition'][_0xf2f33e(0x1f8)]='');}}}function resolvePendingIdsInRequest(_0x79bee3,_0x4502a4,_0x2a6fb0,_0x4b03f9,_0x3d1cfc,_0x23ca61){const _0x36b642=a110_0xe770,_0x56545b=(_0x5150e1,_0x2e1e08)=>{const _0x4ec3b1=a110_0xe770;if(!isPendingSegmentId(_0x5150e1))return _0x5150e1;const _0x452e9a=extractPendingSegmentName(_0x5150e1),_0xd5befd=_0x4b03f9['get'](_0x452e9a);return!_0xd5befd&&_0x23ca61[_0x4ec3b1(0x243)]?.(_0x4ec3b1(0x1d9)+_0x452e9a+'\x27\x20for\x20'+_0x2e1e08),_0xd5befd;};if(_0x79bee3[_0x36b642(0x1a6)][_0x36b642(0x224)]?.[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x79bee3['attributes']['goal'][_0x36b642(0x1f8)])){const _0x12c38d=_0x56545b(_0x79bee3[_0x36b642(0x1a6)][_0x36b642(0x224)][_0x36b642(0x1f8)],_0x36b642(0x242));_0x12c38d&&(_0x79bee3['attributes'][_0x36b642(0x224)]['segmentId']=_0x12c38d);}for(const _0x213363 of _0x79bee3[_0x36b642(0x1a6)][_0x36b642(0x283)]||[]){const _0x37dc98=_0x2a6fb0[_0x36b642(0x223)](_0x213363[_0x36b642(0x244)][_0x36b642(0x22e)]());_0x37dc98&&(_0x213363['id']=_0x37dc98);if(_0x213363['entryCriteria']?.[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x213363['entryCriteria'][_0x36b642(0x1f8)])){const _0x478d09=_0x56545b(_0x213363[_0x36b642(0x271)][_0x36b642(0x1f8)],'stage\x20\x27'+_0x213363[_0x36b642(0x244)]+_0x36b642(0x27c));_0x478d09&&(_0x213363['entryCriteria'][_0x36b642(0x1f8)]=_0x478d09);}if(_0x213363[_0x36b642(0x24b)])for(const _0x5d0099 of _0x213363['exitCriterias']){if(_0x5d0099[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x5d0099[_0x36b642(0x1f8)])){const _0x3c9e9c=_0x56545b(_0x5d0099[_0x36b642(0x1f8)],_0x36b642(0x27e)+_0x213363[_0x36b642(0x244)]+_0x36b642(0x26a));_0x3c9e9c&&(_0x5d0099[_0x36b642(0x1f8)]=_0x3c9e9c);}}if(_0x213363['milestone']?.[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x213363[_0x36b642(0x278)][_0x36b642(0x1f8)])){const _0x900f7c=_0x56545b(_0x213363[_0x36b642(0x278)]['segmentId'],_0x36b642(0x27e)+_0x213363[_0x36b642(0x244)]+_0x36b642(0x1b9));_0x900f7c&&(_0x213363[_0x36b642(0x278)]['segmentId']=_0x900f7c);}if(_0x213363[_0x36b642(0x280)]){const _0x5eb350=_0x4912a9=>_0x4502a4[_0x36b642(0x1a6)][_0x36b642(0x283)][_0x36b642(0x210)](_0x49ae33=>_0x49ae33[_0x36b642(0x244)][_0x36b642(0x22e)]()===_0x213363[_0x36b642(0x244)][_0x36b642(0x22e)]())?.['steps']?.[_0x4912a9];for(const _0x42d023 of Object['keys'](_0x213363[_0x36b642(0x280)])){const _0x3d68e6=_0x213363['steps'][_0x42d023],_0x104bf2=_0x5eb350(_0x42d023);if(_0x3d68e6[_0x36b642(0x1b8)]==='Activation'&&_0x3d68e6[_0x36b642(0x27b)]&&(isPendingActivationId(_0x3d68e6[_0x36b642(0x27b)])||_0x3d68e6[_0x36b642(0x27b)]==='')){if(_0x104bf2?.['journeyActivationStepId']&&isPendingActivationId(_0x104bf2[_0x36b642(0x27b)])){const _0x8e590c=extractPendingActivationName(_0x104bf2['journeyActivationStepId']),_0x1f3683=_0x3d1cfc[_0x36b642(0x223)](_0x8e590c);_0x1f3683&&(_0x3d68e6['journeyActivationStepId']=_0x1f3683);}}if(_0x3d68e6[_0x36b642(0x1b8)]===_0x36b642(0x209)&&_0x3d68e6[_0x36b642(0x1f1)]&&_0x104bf2?.[_0x36b642(0x1f1)])for(let _0x3e0996=0x0;_0x3e0996<_0x3d68e6['branches']['length'];_0x3e0996++){const _0x347df2=_0x3d68e6[_0x36b642(0x1f1)][_0x3e0996],_0x5531e2=_0x104bf2[_0x36b642(0x1f1)][_0x3e0996];if(_0x5531e2?.[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x5531e2[_0x36b642(0x1f8)])){const _0x504334=_0x56545b(_0x5531e2['segmentId'],_0x36b642(0x27e)+_0x213363['name']+_0x36b642(0x1ad)+(_0x347df2[_0x36b642(0x244)]||_0x3e0996)+'\x27');_0x504334&&(_0x347df2[_0x36b642(0x1f8)]=_0x504334);}}if(_0x3d68e6[_0x36b642(0x1b8)]==='WaitStep'&&_0x3d68e6[_0x36b642(0x285)]?.[_0x36b642(0x1f8)]&&_0x104bf2?.[_0x36b642(0x285)]?.[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x104bf2[_0x36b642(0x285)][_0x36b642(0x1f8)])){const _0x22bb2c=_0x56545b(_0x104bf2[_0x36b642(0x285)][_0x36b642(0x1f8)],_0x36b642(0x27e)+_0x213363[_0x36b642(0x244)]+_0x36b642(0x256));_0x22bb2c&&(_0x3d68e6[_0x36b642(0x285)][_0x36b642(0x1f8)]=_0x22bb2c);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x503f43,_0x9b7a7a){const _0x1efee6=a111_0x4f92,_0x33d348=_0x503f43();while(!![]){try{const _0x1ef3fc=-parseInt(_0x1efee6(0xd9))/0x1+-parseInt(_0x1efee6(0xe7))/0x2+parseInt(_0x1efee6(0xdc))/0x3+parseInt(_0x1efee6(0xdd))/0x4*(-parseInt(_0x1efee6(0xe0))/0x5)+-parseInt(_0x1efee6(0xe3))/0x6*(parseInt(_0x1efee6(0xe4))/0x7)+-parseInt(_0x1efee6(0xe6))/0x8+-parseInt(_0x1efee6(0xde))/0x9*(-parseInt(_0x1efee6(0xda))/0xa);if(_0x1ef3fc===_0x9b7a7a)break;else _0x33d348['push'](_0x33d348['shift']());}catch(_0x3361b3){_0x33d348['push'](_0x33d348['shift']());}}}(a111_0x1336,0x6e9e0));export function buildFolderIdToPathMap(_0x203f36){const _0x2db26a=a111_0x4f92,_0x12a257=new Map(),_0x2e5243=new Map();for(const _0x5cb7f3 of _0x203f36){_0x2e5243[_0x2db26a(0xd8)](_0x5cb7f3['id'],_0x5cb7f3);}const _0x318505=new Set();for(const _0x32fdeb of _0x203f36){!_0x32fdeb[_0x2db26a(0xe2)]&&_0x318505[_0x2db26a(0xdb)](_0x32fdeb['id']);}function _0x5ad0a8(_0x33be6f){const _0x5f1b19=_0x2db26a;if(_0x12a257[_0x5f1b19(0xe5)](_0x33be6f['id']))return _0x12a257[_0x5f1b19(0xe1)](_0x33be6f['id']);if(_0x318505[_0x5f1b19(0xe5)](_0x33be6f['id']))return _0x12a257[_0x5f1b19(0xd8)](_0x33be6f['id'],''),'';if(_0x33be6f[_0x5f1b19(0xe2)]){const _0x1609a8=_0x2e5243[_0x5f1b19(0xe1)](_0x33be6f[_0x5f1b19(0xe2)]);if(_0x1609a8){const _0x2b168c=_0x5ad0a8(_0x1609a8),_0x2f4bd9=_0x2b168c?_0x2b168c+'/'+_0x33be6f[_0x5f1b19(0xdf)]:_0x33be6f[_0x5f1b19(0xdf)];return _0x12a257[_0x5f1b19(0xd8)](_0x33be6f['id'],_0x2f4bd9),_0x2f4bd9;}}const _0x5c086f=_0x33be6f['name'];return _0x12a257[_0x5f1b19(0xd8)](_0x33be6f['id'],_0x5c086f),_0x5c086f;}for(const _0x320e1d of _0x203f36){_0x5ad0a8(_0x320e1d);}return _0x12a257;}function a111_0x4f92(_0x4fb0e6,_0x2eaaf5){_0x4fb0e6=_0x4fb0e6-0xd8;const _0x1336da=a111_0x1336();let _0x4f926a=_0x1336da[_0x4fb0e6];return _0x4f926a;}function a111_0x1336(){const _0x2a358b=['3184690lfHzhO','add','1896948LSDZwd','14292bocWfT','45oRPzxy','name','105EpmIcZ','get','parentFolderId','3723690ESdoIK','7EouOED','has','7134472ZguNwt','150226IcgwYw','set','109003KFALxp'];a111_0x1336=function(){return _0x2a358b;};return a111_0x1336();}export function buildFolderPathToIdMap(_0x54a786){const _0x3112ad=a111_0x4f92,_0x22d5cf=new Map(),_0x2ff3c5=new Map();for(const _0x1a6295 of _0x54a786){_0x2ff3c5[_0x3112ad(0xd8)](_0x1a6295['id'],_0x1a6295);}const _0x3284ca=new Set();for(const _0x1feb6e of _0x54a786){!_0x1feb6e[_0x3112ad(0xe2)]&&_0x3284ca[_0x3112ad(0xdb)](_0x1feb6e['id']);}function _0x11d9b2(_0x33796f){const _0x5ce71e=_0x3112ad;if(_0x3284ca[_0x5ce71e(0xe5)](_0x33796f['id']))return'';if(_0x33796f[_0x5ce71e(0xe2)]){const _0x1a22ab=_0x2ff3c5['get'](_0x33796f[_0x5ce71e(0xe2)]);if(_0x1a22ab){const _0x4c1544=_0x11d9b2(_0x1a22ab);return _0x4c1544?_0x4c1544+'/'+_0x33796f[_0x5ce71e(0xdf)]:_0x33796f['name'];}}return _0x33796f[_0x5ce71e(0xdf)];}for(const _0x478688 of _0x54a786){const _0x10b757=_0x11d9b2(_0x478688);_0x22d5cf[_0x3112ad(0xd8)](_0x10b757,_0x478688['id']);}return _0x22d5cf;}export function buildFolderMaps(_0x5128ab){const _0x59c44f=buildFolderIdToPathMap(_0x5128ab),_0x3a6a59=new Map();for(const [_0x321854,_0x1c30f5]of _0x59c44f){_0x3a6a59['set'](_0x1c30f5,_0x321854);}return{'idToPath':_0x59c44f,'pathToId':_0x3a6a59};}export function getFolderPath(_0x48fb1b,_0x4aeeca){const _0x32999b=a111_0x4f92;if(!_0x48fb1b)return'';return _0x4aeeca[_0x32999b(0xe1)](_0x48fb1b)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x955eaa,_0x516b8c){const _0x5e2e56=a112_0x28b3,_0x53e78d=_0x955eaa();while(!![]){try{const _0x333b2e=parseInt(_0x5e2e56(0xfe))/0x1*(-parseInt(_0x5e2e56(0x125))/0x2)+-parseInt(_0x5e2e56(0x10d))/0x3*(-parseInt(_0x5e2e56(0x115))/0x4)+parseInt(_0x5e2e56(0x116))/0x5+-parseInt(_0x5e2e56(0x10b))/0x6+-parseInt(_0x5e2e56(0x10c))/0x7+parseInt(_0x5e2e56(0x126))/0x8*(-parseInt(_0x5e2e56(0x118))/0x9)+parseInt(_0x5e2e56(0x10f))/0xa;if(_0x333b2e===_0x516b8c)break;else _0x53e78d['push'](_0x53e78d['shift']());}catch(_0xe437f0){_0x53e78d['push'](_0x53e78d['shift']());}}}(a112_0x30e7,0x68096));import a112_0x41ac20 from'path';function a112_0x28b3(_0x3c9f7e,_0x96caeb){_0x3c9f7e=_0x3c9f7e-0xfc;const _0x30e777=a112_0x30e7();let _0x28b3c5=_0x30e777[_0x3c9f7e];return _0x28b3c5;}import{parse as a112_0x426e94}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x3451f0){const _0x49df5c=a112_0x28b3;if(!_0x3451f0||_0x3451f0[_0x49df5c(0x104)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x3966f6=_0x3451f0['trim']();if(_0x3966f6==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x3451f0};const _0x354603=_0x3966f6['startsWith']('/')?_0x3966f6['substring'](0x1):_0x3966f6,_0x256895=_0x354603[_0x49df5c(0xfd)]('/')[_0x49df5c(0x109)](_0x121b83=>_0x121b83!=='');if(_0x256895[_0x49df5c(0x11d)]===0x0)throw new Error(_0x49df5c(0xff));const _0x1d8b75=_0x3966f6[_0x49df5c(0x113)]('/')||!isRelativePathSegment(_0x256895[0x0]);for(const _0x430a6d of _0x256895){validatePathSegment(_0x430a6d);}return{'segments':_0x256895,'isAbsolute':_0x1d8b75,'raw':_0x3451f0};}function isRelativePathSegment(_0x649d0a){return _0x649d0a==='.'||_0x649d0a==='..';}function validatePathSegment(_0x2d2020){const _0x10c3c4=a112_0x28b3;if(_0x2d2020==='')throw new Error(_0x10c3c4(0x11c));if(_0x2d2020==='.'||_0x2d2020==='..')return;if(/[\x00-\x1F\x7F]/[_0x10c3c4(0x111)](_0x2d2020))throw new Error(_0x10c3c4(0x128)+_0x2d2020);if(_0x2d2020!==_0x2d2020[_0x10c3c4(0x104)]()){}}export function validatePath(_0x1b67ff){const _0x1cecc1=a112_0x28b3;if(_0x1b67ff[_0x1cecc1(0x119)]['length']===0x0&&!_0x1b67ff[_0x1cecc1(0x107)])throw new Error(_0x1cecc1(0x100));if(_0x1b67ff[_0x1cecc1(0x107)]){if(_0x1b67ff[_0x1cecc1(0x119)][0x0]==='..')throw new Error(_0x1cecc1(0x121));let _0x55807c=0x0;for(const _0x37c7eb of _0x1b67ff[_0x1cecc1(0x119)]){if(_0x37c7eb==='..'){if(_0x55807c===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x55807c--;}else _0x37c7eb!=='.'&&_0x55807c++;}}}export function joinPaths(_0x23cb53,_0x57507d){const _0x2a4e78=a112_0x28b3;if(!_0x23cb53||_0x23cb53==='/')return _0x57507d;if(!_0x57507d||_0x57507d==='.')return _0x23cb53;if(_0x57507d[_0x2a4e78(0x113)]('/'))return _0x57507d;const _0x287502=parsePath(_0x23cb53),_0x29ec9b=parsePath(_0x57507d),_0x2a0c75=[..._0x287502[_0x2a4e78(0x119)]];for(const _0x598741 of _0x29ec9b[_0x2a4e78(0x119)]){if(_0x598741==='.')continue;else{if(_0x598741==='..'){if(_0x2a0c75['length']===0x0)throw new Error(_0x2a4e78(0x114));_0x2a0c75[_0x2a4e78(0x105)]();}else _0x2a0c75[_0x2a4e78(0x117)](_0x598741);}}const _0xf53892=_0x2a0c75[_0x2a4e78(0x120)]('/');return _0x287502[_0x2a4e78(0x11b)][_0x2a4e78(0x113)]('/')?'/'+_0xf53892:_0xf53892;}export function normalizePath(_0x5d57db){const _0x367a79=a112_0x28b3,_0x55c98f=parsePath(_0x5d57db),_0x33720c=[];for(const _0x40b277 of _0x55c98f['segments']){if(_0x40b277==='.')continue;else{if(_0x40b277==='..'){if(_0x33720c[_0x367a79(0x11d)]===0x0){if(_0x55c98f[_0x367a79(0x107)])throw new Error(_0x367a79(0x114));_0x33720c[_0x367a79(0x117)]('..');}else _0x33720c[_0x33720c['length']-0x1]==='..'?_0x33720c[_0x367a79(0x117)]('..'):_0x33720c[_0x367a79(0x105)]();}else _0x33720c[_0x367a79(0x117)](_0x40b277);}}if(_0x33720c[_0x367a79(0x11d)]===0x0)return _0x55c98f[_0x367a79(0x107)]?'/':'.';const _0x3e4d73=_0x33720c[_0x367a79(0x120)]('/');return _0x55c98f[_0x367a79(0x11b)][_0x367a79(0x113)]('/')?'/'+_0x3e4d73:_0x3e4d73;}export function getParentPath(_0x34ae53){const _0x39880b=a112_0x28b3,_0x191bf5=parsePath(_0x34ae53);if(_0x191bf5[_0x39880b(0x119)][_0x39880b(0x11d)]<=0x1)return'/';const _0x3e5d9d=_0x191bf5[_0x39880b(0x119)][_0x39880b(0x124)](0x0,-0x1)[_0x39880b(0x120)]('/');return _0x191bf5[_0x39880b(0x11b)][_0x39880b(0x113)]('/')?'/'+_0x3e5d9d:_0x3e5d9d;}export function getBaseName(_0x313ce1){const _0x11b549=a112_0x28b3,_0x52e4d0=parsePath(_0x313ce1);return _0x52e4d0[_0x11b549(0x119)][_0x52e4d0['segments'][_0x11b549(0x11d)]-0x1]||'';}export function isChildPath(_0x40192b,_0x42dbe8){const _0x3ff605=a112_0x28b3,_0x4dfc88=parsePath(_0x40192b),_0x93cc3a=parsePath(_0x42dbe8);if(_0x4dfc88[_0x3ff605(0x119)]['length']<=_0x93cc3a[_0x3ff605(0x119)][_0x3ff605(0x11d)])return![];for(let _0x1036b3=0x0;_0x1036b3<_0x93cc3a[_0x3ff605(0x119)][_0x3ff605(0x11d)];_0x1036b3++){if(_0x4dfc88[_0x3ff605(0x119)][_0x1036b3]!==_0x93cc3a[_0x3ff605(0x119)][_0x1036b3])return![];}return!![];}export function splitPath(_0x7f6185){const _0x2bf33a=a112_0x28b3,_0x56f68e=parsePath(_0x7f6185);if(_0x56f68e[_0x2bf33a(0x119)]['length']===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x56f68e[_0x2bf33a(0x119)][_0x2bf33a(0x11d)]===0x1)return{'parent':_0x56f68e[_0x2bf33a(0x119)][0x0]};return{'parent':_0x56f68e[_0x2bf33a(0x119)][0x0],'child':_0x56f68e['segments'][_0x2bf33a(0x124)](0x1)[_0x2bf33a(0x120)]('/')};}export function isYamlFilePath(_0x298a28){const _0x1c5e79=a112_0x28b3;return _0x298a28['endsWith'](_0x1c5e79(0x123))||_0x298a28[_0x1c5e79(0x106)](_0x1c5e79(0x11a));}function a112_0x30e7(){const _0x45142d=['Path\x20segment\x20cannot\x20be\x20empty','length','segment','parent_segment','join','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','readFile','.yml','slice','2fJCVTn','296IcxJyA','exists','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','dirname','split','111907qHthyg','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Relative\x20path\x20cannot\x20be\x20empty','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','replace','relative','trim','pop','endsWith','isAbsolute','name','filter','resolve','923988ZjIXnL','812112xyMKak','3wPtTHt','root','7117170vVBvwD','type','test','parse','startsWith','Cannot\x20navigate\x20above\x20root','1239848aMhZdp','267580hSUFWF','push','64980OoTLqo','segments','.yaml','raw'];a112_0x30e7=function(){return _0x45142d;};return a112_0x30e7();}export async function resolveYamlFilePath(_0x7345ff,_0x165706=nodeFileSystem){const _0x43e2bc=a112_0x28b3,_0x3f7614=a112_0x41ac20[_0x43e2bc(0x10a)](_0x7345ff);if(!await _0x165706[_0x43e2bc(0x127)](_0x3f7614))throw new Error('File\x20not\x20found:\x20'+_0x7345ff);let _0x2bfe65=a112_0x41ac20[_0x43e2bc(0xfc)](_0x3f7614),_0x5d9df6=null,_0x535d45=null;const _0x1ed876=a112_0x41ac20[_0x43e2bc(0x112)](_0x2bfe65)[_0x43e2bc(0x10e)];while(_0x2bfe65!==_0x1ed876){const _0x439c50=a112_0x41ac20[_0x43e2bc(0x120)](_0x2bfe65,'tdx.json');if(await _0x165706['exists'](_0x439c50)){_0x5d9df6=_0x439c50,_0x535d45=_0x2bfe65;break;}_0x2bfe65=a112_0x41ac20[_0x43e2bc(0xfc)](_0x2bfe65);}if(!_0x5d9df6||!_0x535d45)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x7345ff);const _0x1aa570=await _0x165706[_0x43e2bc(0x122)](_0x5d9df6),_0x14d3a6=JSON[_0x43e2bc(0x112)](_0x1aa570),_0x57e2b5=_0x14d3a6[_0x43e2bc(0x11f)];if(!_0x57e2b5)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x201764=await _0x165706[_0x43e2bc(0x122)](_0x3f7614),_0x515826=a112_0x426e94(_0x201764),_0x2a033c=_0x515826[_0x43e2bc(0x108)];if(!_0x2a033c)throw new Error(_0x43e2bc(0x101)+_0x7345ff);const _0x46d318=_0x515826[_0x43e2bc(0x110)]==='journey'?'journey':_0x43e2bc(0x11e),_0x43e065=a112_0x41ac20[_0x43e2bc(0x103)](_0x535d45,_0x3f7614),_0x24d549=a112_0x41ac20[_0x43e2bc(0xfc)](_0x43e065),_0x56b61c=_0x24d549==='.'?'':_0x24d549[_0x43e2bc(0x102)](/\\/g,'/'),_0xb9a423=_0x56b61c?_0x57e2b5+'/'+_0x56b61c+'/'+_0x2a033c:_0x57e2b5+'/'+_0x2a033c;return{'parentSegment':_0x57e2b5,'segmentName':_0x2a033c,'folderPath':_0x56b61c,'fullPath':_0xb9a423,'resourceType':_0x46d318};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a113_0x5076(){const _0x302ea3=['.\x20Child\x20name\x20cannot\x20be\x20empty','3970OsQOAv','substring','930Qmqryl','20jdEgAD','671832szAcVj','4059819AABDNn','30tuenwp','1184392ACTqqX','2973760Mvejzc','indexOf','1578525ivDOgi','118937TRrQPo','Invalid\x20segment\x20reference\x20format:\x20','.\x20Parent\x20name\x20cannot\x20be\x20empty'];a113_0x5076=function(){return _0x302ea3;};return a113_0x5076();}function a113_0x29cb(_0xb298c1,_0x570441){_0xb298c1=_0xb298c1-0x13f;const _0x5076b5=a113_0x5076();let _0x29cb59=_0x5076b5[_0xb298c1];return _0x29cb59;}(function(_0x255c12,_0x5839ca){const _0x27c8e3=a113_0x29cb,_0x1add71=_0x255c12();while(!![]){try{const _0x365f87=parseInt(_0x27c8e3(0x149))/0x1+-parseInt(_0x27c8e3(0x145))/0x2*(parseInt(_0x27c8e3(0x147))/0x3)+parseInt(_0x27c8e3(0x14d))/0x4+parseInt(_0x27c8e3(0x140))/0x5+parseInt(_0x27c8e3(0x14b))/0x6*(parseInt(_0x27c8e3(0x141))/0x7)+parseInt(_0x27c8e3(0x14c))/0x8+parseInt(_0x27c8e3(0x14a))/0x9*(-parseInt(_0x27c8e3(0x148))/0xa);if(_0x365f87===_0x5839ca)break;else _0x1add71['push'](_0x1add71['shift']());}catch(_0x1e924a){_0x1add71['push'](_0x1add71['shift']());}}}(a113_0x5076,0x6cff1));export function parseSegmentRef(_0x327e13){const _0x2466dd=a113_0x29cb,_0x731f68=_0x327e13[_0x2466dd(0x13f)]('/');if(_0x731f68===-0x1)return{'parentId':_0x327e13};if(_0x731f68===0x0)throw new Error(_0x2466dd(0x142)+_0x327e13+_0x2466dd(0x143));const _0x4c28fc=_0x327e13[_0x2466dd(0x146)](0x0,_0x731f68),_0x40b213=_0x327e13['substring'](_0x731f68+0x1);if(_0x40b213==='')throw new Error(_0x2466dd(0x142)+_0x327e13+_0x2466dd(0x144));return{'parentId':_0x4c28fc,'childId':_0x40b213};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xabce2,_0x432c69){const _0x4f2e4a=a114_0x5e6a,_0x4628c8=_0xabce2();while(!![]){try{const _0xecfc29=parseInt(_0x4f2e4a(0x149))/0x1+parseInt(_0x4f2e4a(0x166))/0x2*(parseInt(_0x4f2e4a(0x15f))/0x3)+-parseInt(_0x4f2e4a(0x148))/0x4+-parseInt(_0x4f2e4a(0x176))/0x5*(-parseInt(_0x4f2e4a(0x174))/0x6)+parseInt(_0x4f2e4a(0x14c))/0x7+-parseInt(_0x4f2e4a(0x16a))/0x8+-parseInt(_0x4f2e4a(0x151))/0x9*(-parseInt(_0x4f2e4a(0x167))/0xa);if(_0xecfc29===_0x432c69)break;else _0x4628c8['push'](_0x4628c8['shift']());}catch(_0x13f8de){_0x4628c8['push'](_0x4628c8['shift']());}}}(a114_0x345a,0x94057));import a114_0x2e9d52 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';function a114_0x5e6a(_0x29e40a,_0x3770b7){_0x29e40a=_0x29e40a-0x141;const _0x345a8b=a114_0x345a();let _0x5e6a6a=_0x345a8b[_0x29e40a];return _0x5e6a6a;}import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x6fb658){const _0x32163b=a114_0x5e6a;return _0x6fb658[_0x32163b(0x179)]!==_0x32163b(0x147);}export function isScopedResolution(_0x4d8c89){const _0x345727=a114_0x5e6a;return _0x4d8c89[_0x345727(0x179)]==='directory'||_0x4d8c89[_0x345727(0x179)]==='file'||_0x4d8c89[_0x345727(0x179)]===_0x345727(0x15c);}export function getScopedDetails(_0x2823a1){const _0x185756=a114_0x5e6a;if(isScopedResolution(_0x2823a1))return{'isScoped':_0x2823a1['isScoped'],'scopedFolderPath':_0x2823a1[_0x185756(0x16f)]};return undefined;}function a114_0x345a(){const _0x1bb3ce=['373962WvCLyM','File\x20not\x20found','75XFMCTH','journey','readFile','type','basename','file_not_found','parent_name','includes','replace','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','exists','resourceType','error','4476428CKsXgO','552773gdsocO','dirname','File\x20not\x20found:\x20','4477830QXrSEV','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','message','Parent\x20segment\x20not\x20specified','no_config','560457XMkyUS','extname','segment','parentSegment','trim','stat','parse','join','startsWith','directory','isDirectory','context','string','isFile','1299066qUdwZw','cwd','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','segmentName','file','isScoped','no_parent','2EqAzLP','10URalqO','match','No\x20tdx.json\x20found\x20for\x20file:\x20','7178088rYmqOs','parent_segment','invalid_yaml','resolve','configDir','scopedFolderPath','folderPath','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','Not\x20a\x20YAML\x20file:\x20','relative'];a114_0x345a=function(){return _0x1bb3ce;};return a114_0x345a();}async function findTdxConfigAsync(_0xd17f9,_0x386be4){const _0x1a11c8=a114_0x5e6a;let _0x5d24b1=a114_0x2e9d52['resolve'](_0xd17f9);const _0x498e6d=a114_0x2e9d52[_0x1a11c8(0x157)](_0x5d24b1)['root'];while(_0x5d24b1!==_0x498e6d){const _0x467031=a114_0x2e9d52[_0x1a11c8(0x158)](_0x5d24b1,'tdx.json');if(await _0x386be4[_0x1a11c8(0x145)](_0x467031))try{const _0x56e3a5=await _0x386be4['readFile'](_0x467031),_0x4c8987=JSON[_0x1a11c8(0x157)](_0x56e3a5);if(_0x4c8987[_0x1a11c8(0x16b)]&&typeof _0x4c8987[_0x1a11c8(0x16b)]===_0x1a11c8(0x15d))return{'configPath':_0x467031,'configDir':_0x5d24b1,'parentSegment':_0x4c8987[_0x1a11c8(0x16b)]};}catch{}_0x5d24b1=a114_0x2e9d52[_0x1a11c8(0x14a)](_0x5d24b1);}return null;}function calculateScopedPath(_0x43d953,_0x2d773d){const _0x152b1b=a114_0x5e6a,_0x4e7da6=a114_0x2e9d52[_0x152b1b(0x173)](_0x2d773d,_0x43d953),_0x20af1d=_0x4e7da6!==''&&_0x4e7da6!=='.'&&!_0x4e7da6[_0x152b1b(0x159)]('..');return{'isScoped':_0x20af1d,'scopedFolderPath':_0x20af1d?_0x4e7da6[_0x152b1b(0x143)](/\\/g,'/'):''};}export async function resolveTarget(_0x4d240e){const _0x20042d=a114_0x5e6a,{arg:_0x4193c3,contextParent:_0x134547,cwd:cwd=process[_0x20042d(0x160)](),fs:fs=nodeFileSystem}=_0x4d240e;if(_0x4193c3&&isYamlFilePath(_0x4193c3))try{const _0x148a8c=await resolveYamlFilePath(_0x4193c3,fs),_0x583950=a114_0x2e9d52[_0x20042d(0x16d)](_0x4193c3),_0x2af082=a114_0x2e9d52[_0x20042d(0x14a)](_0x583950),_0x6ae097=await findTdxConfigAsync(_0x2af082,fs);if(!_0x6ae097){if(_0x134547){const _0xc0f10e=a114_0x2e9d52['dirname'](_0x583950);return{'type':_0x20042d(0x163),'parentName':_0x134547,'targetDir':_0xc0f10e,'configRoot':_0xc0f10e,'filePath':_0x583950,'resourceName':_0x148a8c[_0x20042d(0x162)],'folderPath':_0x148a8c['folderPath'],'resourceType':_0x148a8c[_0x20042d(0x146)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x20042d(0x147),'errorCode':'no_config','message':_0x20042d(0x169)+_0x4193c3,'arg':_0x4193c3,'helpText':_0x20042d(0x14d)};}const _0x486ca2=calculateScopedPath(_0x2af082,_0x6ae097[_0x20042d(0x16e)]);return{'type':_0x20042d(0x163),'parentName':_0x6ae097[_0x20042d(0x154)],'targetDir':_0x6ae097['configDir'],'configRoot':_0x6ae097[_0x20042d(0x16e)],'filePath':_0x583950,'resourceName':_0x148a8c[_0x20042d(0x162)],'folderPath':_0x148a8c[_0x20042d(0x170)],'resourceType':_0x148a8c[_0x20042d(0x146)],'isScoped':_0x486ca2[_0x20042d(0x164)],'scopedFolderPath':_0x486ca2[_0x20042d(0x16f)]};}catch(_0x479c20){const _0x279592=_0x479c20 instanceof Error?_0x479c20[_0x20042d(0x14e)]:String(_0x479c20);if(_0x279592[_0x20042d(0x142)](_0x20042d(0x175)))return{'type':_0x20042d(0x147),'errorCode':_0x20042d(0x17b),'message':_0x20042d(0x14b)+_0x4193c3,'arg':_0x4193c3};if(_0x279592[_0x20042d(0x142)]('No\x20tdx.json\x20found')){if(_0x134547){const _0x413990=a114_0x2e9d52[_0x20042d(0x16d)](_0x4193c3);if(await fs[_0x20042d(0x145)](_0x413990)){const _0x1bf260=a114_0x2e9d52[_0x20042d(0x14a)](_0x413990),_0x36523b=await fs[_0x20042d(0x178)](_0x413990),_0x1aa35d=_0x36523b[_0x20042d(0x168)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x13a143=_0x36523b[_0x20042d(0x168)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x49b0ef=_0x1aa35d?_0x1aa35d[0x1][_0x20042d(0x155)]():a114_0x2e9d52[_0x20042d(0x17a)](_0x4193c3,a114_0x2e9d52[_0x20042d(0x152)](_0x4193c3)),_0x149a7f=_0x13a143&&_0x13a143[0x1][_0x20042d(0x155)]()===_0x20042d(0x177)?_0x20042d(0x177):_0x20042d(0x153);return{'type':_0x20042d(0x163),'parentName':_0x134547,'targetDir':_0x1bf260,'configRoot':_0x1bf260,'filePath':_0x413990,'resourceName':_0x49b0ef,'folderPath':'','resourceType':_0x149a7f,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x20042d(0x147),'errorCode':'no_config','message':_0x20042d(0x169)+_0x4193c3,'arg':_0x4193c3,'helpText':_0x20042d(0x14d)};}return{'type':_0x20042d(0x147),'errorCode':'invalid_yaml','message':_0x279592,'arg':_0x4193c3};}if(_0x4193c3){const _0x5b75c0=a114_0x2e9d52['resolve'](cwd,_0x4193c3);let _0x44950e=null;try{_0x44950e=await fs[_0x20042d(0x156)](_0x5b75c0);}catch{}if(_0x44950e?.[_0x20042d(0x15b)]()){const _0x345b8d=await findTdxConfigAsync(_0x5b75c0,fs);if(_0x345b8d){const _0x1636bd=calculateScopedPath(_0x5b75c0,_0x345b8d[_0x20042d(0x16e)]);return{'type':_0x20042d(0x15a),'parentName':_0x345b8d[_0x20042d(0x154)],'targetDir':_0x5b75c0,'configRoot':_0x345b8d[_0x20042d(0x16e)],'isScoped':_0x1636bd[_0x20042d(0x164)],'scopedFolderPath':_0x1636bd[_0x20042d(0x16f)]};}if(_0x134547)return{'type':_0x20042d(0x15a),'parentName':_0x134547,'targetDir':_0x5b75c0,'configRoot':_0x5b75c0,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x20042d(0x150),'message':_0x20042d(0x144)+_0x4193c3,'arg':_0x4193c3,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}if(_0x44950e?.[_0x20042d(0x15e)]())return{'type':'error','errorCode':_0x20042d(0x16c),'message':_0x20042d(0x172)+_0x4193c3,'arg':_0x4193c3,'helpText':_0x20042d(0x161)};const _0x2d758f=sanitizeFileName(_0x4193c3),_0xecf7fd=getSegmentRootDir(_0x2d758f,cwd);return{'type':_0x20042d(0x141),'parentName':_0x4193c3,'targetDir':_0xecf7fd,'configRoot':_0xecf7fd};}const _0x10c61c=await findTdxConfigAsync(cwd,fs);if(_0x10c61c){const _0x311a0c=calculateScopedPath(cwd,_0x10c61c[_0x20042d(0x16e)]);return{'type':_0x20042d(0x15c),'parentName':_0x10c61c[_0x20042d(0x154)],'targetDir':cwd,'configRoot':_0x10c61c['configDir'],'isScoped':_0x311a0c[_0x20042d(0x164)],'scopedFolderPath':_0x311a0c[_0x20042d(0x16f)]};}if(_0x134547){const _0x5b783b=sanitizeFileName(_0x134547),_0x22c633=getSegmentRootDir(_0x5b783b,cwd);return{'type':_0x20042d(0x15c),'parentName':_0x134547,'targetDir':_0x22c633,'configRoot':_0x22c633,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x20042d(0x147),'errorCode':_0x20042d(0x165),'message':_0x20042d(0x14f),'helpText':_0x20042d(0x171)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a115_0x3783fe=a115_0x428f;(function(_0xc5f9ee,_0x2df336){const _0x1b3707=a115_0x428f,_0x12443d=_0xc5f9ee();while(!![]){try{const _0x4d55cc=-parseInt(_0x1b3707(0xf0))/0x1+parseInt(_0x1b3707(0xe7))/0x2+parseInt(_0x1b3707(0xf8))/0x3+parseInt(_0x1b3707(0xe4))/0x4*(-parseInt(_0x1b3707(0xf2))/0x5)+parseInt(_0x1b3707(0xfa))/0x6+-parseInt(_0x1b3707(0xeb))/0x7+parseInt(_0x1b3707(0xf7))/0x8;if(_0x4d55cc===_0x2df336)break;else _0x12443d['push'](_0x12443d['shift']());}catch(_0x5b3410){_0x12443d['push'](_0x12443d['shift']());}}}(a115_0x4788,0x7630c));import{existsSync,readFileSync}from'fs';import a115_0x430ed6 from'path';function a115_0x4788(){const _0x17b675=['Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','parent_segment','Invalid\x20tdx.json:\x20expected\x20object','2825571Vxxjsp','utf-8','segments','cwd','resolve','334914TDtgbY','root','7745hwlkmS','parse','join','stringify','object','782176ksTqlA','2298234VAqzBI','string','5362896RCpnMA','1932stkpty','dirname','tdx.json','426352HYYezh'];a115_0x4788=function(){return _0x17b675;};return a115_0x4788();}function a115_0x428f(_0x2b9097,_0x34a53d){_0x2b9097=_0x2b9097-0xe4;const _0x478869=a115_0x4788();let _0x428f5a=_0x478869[_0x2b9097];return _0x428f5a;}const TDX_CONFIG_FILE=a115_0x3783fe(0xe6),SEGMENTS_DIR=a115_0x3783fe(0xed);export function findTdxConfigPath(_0x113057=process[a115_0x3783fe(0xee)]()){const _0x23c2d5=a115_0x3783fe;let _0x19969d=a115_0x430ed6['resolve'](_0x113057);const _0x15c919=a115_0x430ed6[_0x23c2d5(0xf3)](_0x19969d)[_0x23c2d5(0xf1)];while(_0x19969d!==_0x15c919){const _0x475530=a115_0x430ed6[_0x23c2d5(0xf4)](_0x19969d,TDX_CONFIG_FILE);if(existsSync(_0x475530))return _0x475530;_0x19969d=a115_0x430ed6['dirname'](_0x19969d);}return null;}export function loadTdxConfig(_0x47d57e){const _0x18c796=a115_0x3783fe,_0x3514d1=readFileSync(_0x47d57e,_0x18c796(0xec));let _0x52d237;try{_0x52d237=JSON[_0x18c796(0xf3)](_0x3514d1);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x47d57e);}if(!_0x52d237||typeof _0x52d237!==_0x18c796(0xf6))throw new Error(_0x18c796(0xea));const _0x545aa9=_0x52d237;if(!_0x545aa9[_0x18c796(0xe9)]||typeof _0x545aa9['parent_segment']!==_0x18c796(0xf9))throw new Error(_0x18c796(0xe8));return{'parent_segment':_0x545aa9[_0x18c796(0xe9)]};}export function findTdxConfig(_0x312f78=process[a115_0x3783fe(0xee)]()){const _0x8e0bea=a115_0x3783fe,_0x1712fc=findTdxConfigPath(_0x312f78);if(!_0x1712fc)throw new Error('No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x5b21f5=loadTdxConfig(_0x1712fc),_0x5e69fb=a115_0x430ed6[_0x8e0bea(0xe5)](_0x1712fc);return{'config':_0x5b21f5,'configPath':_0x1712fc,'configDir':_0x5e69fb};}export function tryFindTdxConfig(_0x3e85f1){try{return findTdxConfig(_0x3e85f1);}catch{return null;}}export function getSegmentRootDir(_0xab4065,_0x341422=process[a115_0x3783fe(0xee)]()){const _0x1a1fa9=a115_0x3783fe;return a115_0x430ed6[_0x1a1fa9(0xf4)](_0x341422,SEGMENTS_DIR,_0xab4065);}export function getTdxConfigPath(_0x358687,_0x100ef7=process[a115_0x3783fe(0xee)]()){return a115_0x430ed6['join'](getSegmentRootDir(_0x358687,_0x100ef7),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x4e6c1e,_0x160d10){const _0x2ea7ce=a115_0x3783fe,_0x419e6d=a115_0x430ed6[_0x2ea7ce(0xef)](_0x4e6c1e),_0x109290=a115_0x430ed6['relative'](_0x160d10,_0x419e6d);if(_0x109290['startsWith']('..'))return'';return _0x109290;}export function localPathToTdFolderPath(_0x33d54f){const _0x4a7045=a115_0x3783fe,_0x3aa35e=a115_0x430ed6[_0x4a7045(0xe5)](_0x33d54f);if(_0x3aa35e==='.'||_0x3aa35e==='')return'';return _0x3aa35e['replace'](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x3b14e3,_0x1c1632){if(!_0x3b14e3)return _0x1c1632;return a115_0x430ed6['join'](_0x1c1632,_0x3b14e3);}export function createTdxConfigContent(_0x5ae0d4){const _0x19692f=a115_0x3783fe,_0x397bef={'parent_segment':_0x5ae0d4};return JSON[_0x19692f(0xf5)](_0x397bef,null,0x2)+'\x0a';}
|