@treasuredata/tdx 0.16.12 → 0.16.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.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/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/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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/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/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 a115_0x1d8f82=a115_0x63bb;(function(_0x586764,_0x5cc211){const _0x294172=a115_0x63bb,_0x189136=_0x586764();while(!![]){try{const _0x9583f3=-parseInt(_0x294172(0xf8))/0x1*(parseInt(_0x294172(0x91))/0x2)+-parseInt(_0x294172(0x14d))/0x3*(parseInt(_0x294172(0x165))/0x4)+-parseInt(_0x294172(0x113))/0x5+-parseInt(_0x294172(0x15c))/0x6*(parseInt(_0x294172(0x144))/0x7)+parseInt(_0x294172(0x162))/0x8+-parseInt(_0x294172(0xd8))/0x9+parseInt(_0x294172(0x134))/0xa;if(_0x9583f3===_0x5cc211)break;else _0x189136['push'](_0x189136['shift']());}catch(_0x41fa82){_0x189136['push'](_0x189136['shift']());}}}(a115_0x1e0f,0x1b7fd));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a115_0x1d8f82(0x109);export const PENDING_ACTIVATION_PREFIX=a115_0x1d8f82(0x126);export function createPendingSegmentId(_0x3fca6d){return''+PENDING_SEGMENT_PREFIX+_0x3fca6d+'__';}export function isPendingSegmentId(_0x3653a7){return _0x3653a7['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5889b1){return _0x5889b1['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x33c487){return''+PENDING_ACTIVATION_PREFIX+_0x33c487+'__';}export function isPendingActivationId(_0xa373a8){const _0x4cb051=a115_0x1d8f82;return _0xa373a8[_0x4cb051(0x92)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x5be809){return _0x5be809['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x22fef6,_0x2e3262){const _0x2a7e65=a115_0x1d8f82,_0x5465c4=_0x22fef6+'::'+(_0x2e3262[_0x2a7e65(0xbd)]()||_0x2a7e65(0xdb)),_0x212c6a=createHash(_0x2a7e65(0xaa))[_0x2a7e65(0x97)](_0x5465c4)['digest']('hex')[_0x2a7e65(0xfe)](0x0,0xc);return _0x2a7e65(0xbe)+_0x212c6a;}export function ensureJourneyDefaults(_0xf072e7){const _0x905112=a115_0x1d8f82;!_0xf072e7[_0x905112(0x106)]&&(_0xf072e7[_0x905112(0x106)]=''),!_0xf072e7['state']&&(_0xf072e7[_0x905112(0x120)]=_0x905112(0xd7));}export function resolveTDFolderPath(_0x1e67a,_0x65d40f,_0x46021f){const _0x338353=a115_0x1d8f82;if(!_0x65d40f)return _0x1e67a;if(_0x1e67a===_0x46021f||_0x1e67a[_0x338353(0x92)](_0x46021f+'/'))return _0x1e67a;return _0x1e67a?_0x46021f+'/'+_0x1e67a:_0x46021f;}export function addFoldersToCreate(_0x1e86a9,_0x38d088,_0x1eba46){const _0x2bcf2f=a115_0x1d8f82;if(!_0x1e86a9)return;if(_0x38d088[_0x2bcf2f(0x13f)](_0x1e86a9))return;const _0x5b217a=_0x1e86a9[_0x2bcf2f(0x15f)]('/');let _0xb5b98e='';for(const _0x5082ab of _0x5b217a){_0xb5b98e=_0xb5b98e?_0xb5b98e+'/'+_0x5082ab:_0x5082ab,!_0x38d088[_0x2bcf2f(0x13f)](_0xb5b98e)&&_0x1eba46[_0x2bcf2f(0xea)](_0xb5b98e);}}import*as a115_0x422b74 from'yaml';import{readFileSync}from'fs';import a115_0x14b265 from'path';import{isJourneyDef,parseYamlString as a115_0x5c32d9,toYamlString as a115_0x32e791,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 a115_0x1e0f(){const _0x1a5b84=['11432gDCDMN','startsWith',').\x20','Updating\x20activation\x20\x27','SEGMENT_UPDATE_ERROR','onProgress','update','folderId','Activation','yamlActivation','decision_point','all_columns','embedded_segment_created','parse','entry','branches','journey','entry_criteria','filter','user','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','existingJourney','embeddedSegmentNameToId','Stage\x20\x27','segmentNameToId','sha1','idToEmailMap','connection','size','connector_config','unchanged','resolveSegment','embedded_segment_creating','existingActivation','journey_created','\x20activation\x20\x27','\x20(referenced\x20in\x20journey\x20','rootFolderId','nameToType','journeyActivationStepId','segment_deleting','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Deleted\x20activation\x20\x27','map','trim','journey_entry_criteria_','notification','journey_creating','milestone','Creating\x20activation\x20\x27','delete','createFolder','NOT_FOUND','journeyById','existingSegments','journey_updating','existingSegment','parentFolder','idToName','data','logWarning','activationContext','connectionIdToNameMap','getSegment','all','withProgress','entryCriteria','journeys','created','Name\x20has\x20already\x20been\x20taken','draft','1566900YWMuAc','DecisionPoint','buildUserMaps','segment','utf-8','\x0a\x20\x20','absolutePath','rule','\x27\x20entry\x20criteria','parentId','relationships','find','parseDocument','segmentByFolderAndName','list','activation_deleting','createSegment','createActivation','add','versionNumber','Failed\x20to\x20','deleteActivation','journeyBundleName','stages','\x27\x20from\x20file:\x20','message','Activation\x20not\x20found:\x20','Deleted\x20segment\x20\x27','Created\x20activation\x20\x27','stringify','relative','diff','7qlVKgS','listActivations','results','skipSegments','folder_creating','nameToId','slice','embedded_activation_created','goal','segments','parentSegmentFolder','yamlConfig','updated','get','description','toLowerCase','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','__pending_','schedule','INTERNAL','getActivation','\x27\x20for\x20','deps','name','set','activation_creating','activationsBySegmentId','794665gyGIwL','Fetching\x20','behavior','stage\x20\x27','journeyId','journeyStages','\x20segment\x20from\x20file:\x20','logDeleted','resolveJourneyId','\x27\x20not\x20found\x20in\x20journey\x20\x27','index','null','segmentFolderId','state','join','folderPathToId','embedded_activation_creating','activation_','createdSegmentId','__pending_act_','\x27\x20decision\x20point\x20branch\x20\x27','ACTIVATION_UPDATE_ERROR','isNew','columns','\x20journey\x20from\x20file:\x20','createJourneySegment','./journey-yaml.js','segment_created','segment_deleted','\x27...','entries','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','valid','5164570YwWzzz','folder_created','steps','dirname','WaitStep','activation_template_id','activation_updating','segmentId','activationActions','kind','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','has','activationStepsById','create','\x27\x20milestone','JOURNEY_UPDATE_ERROR','101437dogmeF','ACTIVATION_SYNTAX_ERROR','attributes','toString','push','journey_updated','Updated\x20journey\x20\x27','activation_updated','effectiveFolderId','6rDslYq','Creating\x20segment\x20\x27','logSuccess','verbose','updateSegmentById','validatedRequest','reduce','./child-segment-yaml.js','logInfo','length','../../utils/async.js','max','SEGMENT_NOT_FOUND','keys','action','6wEthsz','Journey\x20\x27','Created\x20folder\x20\x27','split','activations','with','798512nWNZGH','deleted','errors','232196ugVMUr','waitCondition','Entry\x20criteria:\x20','Created\x20journey\x20\x27','):\x20','from','type','hasChanges','getJourney','sort','localSegmentRules','exitCriterias'];a115_0x1e0f=function(){return _0x1a5b84;};return a115_0x1e0f();}function stableStringify(_0x2b1538){const _0x3adb6d=a115_0x1d8f82;if(Array['isArray'](_0x2b1538))return'['+_0x2b1538[_0x3adb6d(0xbc)](_0x479756=>stableStringify(_0x479756))['join'](',')+']';if(_0x2b1538&&typeof _0x2b1538==='object'){const _0x59295f=_0x2b1538,_0xde0c52=Object[_0x3adb6d(0x15a)](_0x59295f)['sort'](),_0x54e676=_0xde0c52[_0x3adb6d(0xbc)](_0x38db6a=>'\x22'+_0x38db6a+'\x22:'+stableStringify(_0x59295f[_0x38db6a]));return'{'+_0x54e676['join'](',')+'}';}const _0x1900bc=JSON['stringify'](_0x2b1538);return _0x1900bc===undefined?_0x3adb6d(0x11e):_0x1900bc;}function activationSignature(_0x3fae74){const _0x31e07f=a115_0x1d8f82,_0x2a1348={'connection':_0x3fae74[_0x31e07f(0xac)],..._0x3fae74['all_columns']!==undefined&&{'all_columns':_0x3fae74[_0x31e07f(0x9c)]},..._0x3fae74[_0x31e07f(0x12a)]!==undefined&&{'columns':_0x3fae74[_0x31e07f(0x12a)]},..._0x3fae74[_0x31e07f(0x115)]!==undefined&&{'behavior':_0x3fae74[_0x31e07f(0x115)]},..._0x3fae74[_0x31e07f(0x10a)]!==undefined&&{'schedule':_0x3fae74['schedule']},..._0x3fae74[_0x31e07f(0xbf)]!==undefined&&{'notification':_0x3fae74[_0x31e07f(0xbf)]},..._0x3fae74['connector_config']!==undefined&&{'connector_config':_0x3fae74[_0x31e07f(0xae)]},..._0x3fae74[_0x31e07f(0x139)]!==undefined&&{'activation_template_id':_0x3fae74[_0x31e07f(0x139)]}};return stableStringify(_0x2a1348);}export async function prepareSegmentFiles(_0xa5a5e6,_0x34d888,_0xb85d1e,_0x6dbd32,_0x3d039d){const _0xee0edf=a115_0x1d8f82,{activationDefToCreateRequest:_0x1bfb15}=await import(_0xee0edf(0x154)),_0x55a2d6=[],_0x2aa65d=new Set();for(const {yamlConfig:_0x47bdca,folderPath:_0x3a6017,sourcePath:_0x279c70}of _0xa5a5e6){const _0x2964b5=resolveTDFolderPath(_0x3a6017,_0x6dbd32,_0x3d039d),_0x45c34d=_0x2964b5+':'+_0x47bdca[_0xee0edf(0x10f)],_0xb8befc=_0x34d888[_0xee0edf(0xe5)]['get'](_0x45c34d),_0x18770d=_0xb8befc?_0x34d888[_0xee0edf(0x112)][_0xee0edf(0x105)](_0xb8befc['id'])||[]:[];addFoldersToCreate(_0x2964b5,_0x34d888['folderPathToId'],_0x2aa65d);const _0x6c3201=calculateActivationActions(_0x47bdca[_0xee0edf(0x160)]||[],_0x18770d,_0x34d888[_0xee0edf(0xab)],_0x34d888[_0xee0edf(0xcf)]);for(const _0x221971 of _0x6c3201){(_0x221971[_0xee0edf(0x8b)]==='create'||_0x221971[_0xee0edf(0x8b)]===_0xee0edf(0x97))&&_0x221971[_0xee0edf(0x9a)]&&(_0x221971[_0xee0edf(0x152)]=await _0x1bfb15(_0x221971['yamlActivation'],_0xb85d1e));}const _0x330fe1=calculateSegmentDiff(_0x47bdca,_0xb8befc,_0x18770d,_0x34d888[_0xee0edf(0xab)],_0x34d888['connectionIdToNameMap']);_0x55a2d6['push']({'relativePath':_0x47bdca['name'],'absolutePath':_0x279c70,'yamlConfig':_0x47bdca,'folderPath':_0x2964b5,'existingSegment':_0xb8befc,'existingActivations':_0x18770d,'isNew':_0x330fe1['isNew'],'hasChanges':_0x330fe1[_0xee0edf(0x8c)],'diff':_0x330fe1['diff'],'activationActions':_0x6c3201});}return{'segmentFiles':_0x55a2d6,'foldersToCreate':_0x2aa65d};}export async function prepareJourneyFiles(_0x3faf11,_0x3546d8,_0x53acfe,_0x25dc4d){const _0x408b5f=a115_0x1d8f82,_0xfc1445=[],_0x4b0a23=new Set();for(const {yamlConfig:_0x5e1a50,folderPath:_0x2051ac,sourcePath:_0x153237}of _0x3faf11){const _0x1bb845=resolveTDFolderPath(_0x2051ac,_0x53acfe,_0x25dc4d),_0x2d10a6=_0x1bb845+':'+_0x5e1a50['name'],_0x1aca18=_0x3546d8['journeyBundlesByFolderAndName'][_0x408b5f(0x105)](_0x2d10a6);let _0x987777,_0x376d0c;if(_0x1aca18&&_0x1aca18[_0x408b5f(0x156)]>0x0){const _0x471bb0=buildLocalExpandedRuleMappings(_0x5e1a50),{createYamlContext:_0x461a13,prefetchJourneySegments:_0x279556}=createPushYamlContextForBundle(_0x3546d8[_0x408b5f(0x10e)],_0x3546d8['parentId'],_0x3546d8[_0x408b5f(0xc7)],_0x471bb0,_0x3546d8[_0x408b5f(0xab)],_0x3546d8['connectionIdToNameMap'],_0x3546d8[_0x408b5f(0x140)],_0x3546d8[_0x408b5f(0xc6)]);await _0x279556(_0x1aca18[_0x408b5f(0xbc)](_0x18fbf1=>_0x18fbf1['id']));const _0x1e106c=hasMultipleVersions(_0x5e1a50),_0x55f92c=async _0x12b6d4=>{const _0x4ad2a2=_0x408b5f,_0x84aae3=_0x3546d8[_0x4ad2a2(0xc6)]?.['get'](_0x12b6d4);if(_0x84aae3)return _0x84aae3;return _0x3546d8['fetchJourney']({'journeyId':_0x12b6d4,'journeyName':_0x5e1a50[_0x4ad2a2(0x10f)],'isMultiVersion':_0x1aca18[_0x4ad2a2(0x156)]>0x1});};if(_0x1e106c&&_0x1aca18[_0x408b5f(0x156)]>0x1){const _0x53378d=[];for(const _0x15bd4e of _0x1aca18){const _0x2d6c8b=_0x15bd4e[_0x408b5f(0xeb)]||0x1;_0x3546d8['progress']?.['update'](_0x408b5f(0x114)+_0x5e1a50[_0x408b5f(0x10f)]+'\x20v'+_0x2d6c8b);const _0x3d5d7c=await _0x55f92c(_0x15bd4e['id']),_0x195ff2=_0x461a13(_0x15bd4e['id']),_0xb8136e=await journeyResponseToDef(_0x3d5d7c,_0x195ff2);_0x53378d[_0x408b5f(0x148)]({'item':_0x15bd4e,'yaml':_0xb8136e});}const _0xb52721=buildLocalRuleToNameMappingFromJourney(_0x5e1a50);_0x376d0c=buildMergedJourneyDef(_0x53378d,_0xb52721);const _0x52bbe8=Math[_0x408b5f(0x158)](..._0x53378d[_0x408b5f(0xbc)](_0x1c8375=>_0x1c8375['item'][_0x408b5f(0xeb)]||0x0)),_0xe7d9e6=_0x1aca18['find'](_0x3ccaf4=>(_0x3ccaf4[_0x408b5f(0xeb)]||0x0)===_0x52bbe8);_0xe7d9e6&&(_0x3546d8['progress']?.[_0x408b5f(0x97)](_0x408b5f(0x114)+_0x5e1a50[_0x408b5f(0x10f)]+'\x20v'+_0x52bbe8),_0x987777=await _0x55f92c(_0xe7d9e6['id']));}else{const _0x1fb0eb=_0x1aca18[_0x1aca18['length']-0x1];_0x3546d8['progress']?.[_0x408b5f(0x97)](_0x408b5f(0x114)+_0x5e1a50['name']),_0x987777=await _0x55f92c(_0x1fb0eb['id']);const _0x55576d=_0x461a13(_0x1fb0eb['id']),_0x1a4c84=await journeyResponseToDef(_0x987777,_0x55576d),_0x8aeca0=buildLocalRuleToNameMappingFromJourney(_0x5e1a50);_0x376d0c=buildMergedJourneyDef([{'item':_0x1fb0eb,'yaml':_0x1a4c84}],_0x8aeca0);}}addFoldersToCreate(_0x1bb845,_0x3546d8[_0x408b5f(0x122)],_0x4b0a23);const _0x4dfe7d=calculateJourneyDiff(_0x5e1a50,_0x376d0c);_0xfc1445[_0x408b5f(0x148)]({'relativePath':_0x5e1a50[_0x408b5f(0x10f)],'absolutePath':_0x153237,'yamlConfig':_0x5e1a50,'folderPath':_0x1bb845,'existingJourney':_0x987777,'isNew':_0x4dfe7d[_0x408b5f(0x129)],'hasChanges':_0x4dfe7d[_0x408b5f(0x8c)],'diff':_0x4dfe7d[_0x408b5f(0xf7)]});}return{'journeyFiles':_0xfc1445,'foldersToCreate':_0x4b0a23};}export function calculateActivationActions(_0x561394,_0x55b68c,_0x3b1ce3,_0x208db3){const _0x2562b7=a115_0x1d8f82,_0x476aa8=[],_0x4279c1=new Map();for(const _0x51494a of _0x55b68c){_0x4279c1[_0x2562b7(0x110)](_0x51494a[_0x2562b7(0x10f)],_0x51494a);}const _0x4699ef=new Map();for(const _0x128f12 of _0x561394){_0x4699ef[_0x2562b7(0x110)](_0x128f12[_0x2562b7(0x10f)],_0x128f12);}for(const _0x2b0037 of _0x561394){const _0x7051a2=_0x4279c1[_0x2562b7(0x105)](_0x2b0037[_0x2562b7(0x10f)]);if(!_0x7051a2)_0x476aa8['push']({'type':'create','name':_0x2b0037[_0x2562b7(0x10f)],'yamlActivation':_0x2b0037});else{const _0x35549d=activationResponseToDef(_0x7051a2,_0x3b1ce3,_0x208db3),_0x405023=a115_0x422b74[_0x2562b7(0xf5)](_0x35549d),_0x38fd88=a115_0x422b74['stringify'](_0x2b0037);_0x405023!==_0x38fd88&&_0x476aa8[_0x2562b7(0x148)]({'type':_0x2562b7(0x97),'name':_0x2b0037['name'],'yamlActivation':_0x2b0037,'existingActivation':_0x7051a2});}}for(const _0x3ad0bd of _0x55b68c){!_0x4699ef[_0x2562b7(0x13f)](_0x3ad0bd[_0x2562b7(0x10f)])&&_0x476aa8[_0x2562b7(0x148)]({'type':_0x2562b7(0xc3),'name':_0x3ad0bd[_0x2562b7(0x10f)],'existingActivation':_0x3ad0bd});}return _0x476aa8;}export function calculateSegmentDiff(_0x2e025d,_0x467733,_0x3b1200,_0x7e561c,_0x14ee3d){const _0x192f8d=segmentToYamlString(_0x2e025d);if(_0x467733){const _0x3b6063=segmentWithActivationsToYaml(_0x467733,_0x3b1200,undefined,_0x7e561c,_0x14ee3d),_0x2f8ef4=segmentToYamlString(_0x3b6063),_0x2b3643=generateDiff(_0x2f8ef4,_0x192f8d),_0x12fb29=hasChanges(_0x2b3643);return{'isNew':![],'hasChanges':_0x12fb29,'diff':_0x12fb29?formatDiffWithColors(_0x2b3643):undefined};}const _0x1aa733=generateDiff('',_0x192f8d);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1aa733)};}export function calculateJourneyDiff(_0x1803dd,_0x398c9b){const _0x18537d=normalizeJourneyDef(_0x1803dd,_0x1803dd),_0x3ca7b6=a115_0x32e791(_0x18537d);if(_0x398c9b){const _0x25abe5=normalizeJourneyDef(_0x398c9b,_0x1803dd),_0x397664=a115_0x32e791(_0x25abe5),_0x39e1a5=generateDiff(_0x397664,_0x3ca7b6),_0x4c770f=hasChanges(_0x39e1a5);return{'isNew':![],'hasChanges':_0x4c770f,'diff':_0x4c770f?formatDiffWithColors(_0x39e1a5):undefined};}const _0x2fef69=generateDiff('',_0x3ca7b6);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2fef69)};}export function findSegmentsToDelete(_0x1576f7,_0x2d226a,_0x4cdb5d,_0x45ad18,_0x302824){const _0x3251aa=a115_0x1d8f82,_0x326e1c=new Set();for(const {yamlConfig:_0x5a58a1,folderPath:_0x1ffe7d}of _0x2d226a){_0x326e1c[_0x3251aa(0xea)](_0x1ffe7d+':'+_0x5a58a1[_0x3251aa(0x10f)]);}return _0x1576f7[_0x3251aa(0xa3)](_0x15aa11=>{const _0x4e597c=_0x3251aa,_0x191e44=_0x15aa11['segmentFolderId']?_0x4cdb5d[_0x4e597c(0x105)](_0x15aa11[_0x4e597c(0x11f)]['toString']())||'':'',_0x222392=_0x191e44+':'+_0x15aa11[_0x4e597c(0x10f)];if(_0x326e1c[_0x4e597c(0x13f)](_0x222392))return![];if(_0x302824)return _0x191e44===_0x45ad18||_0x191e44[_0x4e597c(0x92)](_0x45ad18+'/');return!![];});}export function findJourneysToDelete(_0x1a9533,_0xe0405c,_0x264245,_0x407c7f,_0x1f8e9e){const _0x19db38=a115_0x1d8f82,_0x1e1094=new Set();for(const {yamlConfig:_0x39ee28,folderPath:_0xb93e12}of _0xe0405c){_0x1e1094[_0x19db38(0xea)](_0xb93e12+':'+_0x39ee28[_0x19db38(0x10f)]);}return _0x1a9533[_0x19db38(0xa3)](_0x4d8c08=>{const _0x2ebfe3=_0x19db38,_0xda8a12=_0x4d8c08[_0x2ebfe3(0x98)]?_0x264245['get'](_0x4d8c08[_0x2ebfe3(0x98)])||'':'',_0x18718f=_0xda8a12+':'+_0x4d8c08['journeyBundleName'];if(_0x1e1094[_0x2ebfe3(0x13f)](_0x18718f))return![];if(_0x1f8e9e)return _0xda8a12===_0x407c7f||_0xda8a12[_0x2ebfe3(0x92)](_0x407c7f+'/');return!![];});}export function buildSegmentLookupMap(_0x2b665f,_0x41297e){const _0x2af6bf=a115_0x1d8f82,_0x51f174=new Map();for(const _0xcefd14 of _0x2b665f){const _0x4847e1=_0xcefd14[_0x2af6bf(0x11f)]?_0x41297e['get'](_0xcefd14[_0x2af6bf(0x11f)][_0x2af6bf(0x147)]())||'':'',_0xb348f3=_0x4847e1+':'+_0xcefd14[_0x2af6bf(0x10f)];_0x51f174[_0x2af6bf(0x110)](_0xb348f3,_0xcefd14);}return _0x51f174;}export function buildSegmentNameToIdMap(_0x57c967){const _0x1a01bf=new Map();for(const _0xce1843 of _0x57c967){_0x1a01bf['set'](_0xce1843['name'],_0xce1843['id']);}return _0x1a01bf;}export function buildJourneyBundleLookupMap(_0x53a944,_0x14d5c8){const _0x4792e0=a115_0x1d8f82,_0x14ce9e=new Map();for(const _0x55cd90 of _0x53a944){const _0x29aad6=_0x55cd90['folderId']?_0x14d5c8[_0x4792e0(0x105)](_0x55cd90[_0x4792e0(0x98)])||'':'',_0x2831bf=_0x29aad6+':'+_0x55cd90[_0x4792e0(0xee)];!_0x14ce9e[_0x4792e0(0x13f)](_0x2831bf)&&_0x14ce9e['set'](_0x2831bf,[]),_0x14ce9e[_0x4792e0(0x105)](_0x2831bf)['push'](_0x55cd90);}for(const _0x34c5ad of _0x14ce9e['values']()){_0x34c5ad[_0x4792e0(0x8e)]((_0x5243d4,_0x32f741)=>(_0x5243d4['versionNumber']||0x0)-(_0x32f741[_0x4792e0(0xeb)]||0x0));}return _0x14ce9e;}export function collectFoldersToCreate(_0x4782ea,_0x15ae2e){const _0x573406=a115_0x1d8f82,_0x39de6f=new Set();for(const _0x5d46e6 of _0x4782ea){if(!_0x5d46e6)continue;if(_0x15ae2e[_0x573406(0x13f)](_0x5d46e6))continue;const _0x4d2804=_0x5d46e6['split']('/');let _0x14c90a='';for(const _0x5447c4 of _0x4d2804){_0x14c90a=_0x14c90a?_0x14c90a+'/'+_0x5447c4:_0x5447c4,!_0x15ae2e[_0x573406(0x13f)](_0x14c90a)&&_0x39de6f[_0x573406(0xea)](_0x14c90a);}}return _0x39de6f;}export function parseAndClassifyYamlFiles(_0x4afac5,_0x2f7e3c,_0x236fb7){const _0x41b5cd=a115_0x1d8f82,_0x5557d7=[],_0x1e42fc=[];for(const _0x1218ee of _0x4afac5){const _0x3ffebc=a115_0x14b265['relative'](_0x2f7e3c,a115_0x14b265[_0x41b5cd(0x137)](_0x1218ee)),_0x13b739=_0x3ffebc==='.'?'':_0x3ffebc,_0xbd9ba6=readFileSync(_0x1218ee,_0x41b5cd(0xdc)),_0x1fc03b=a115_0x422b74[_0x41b5cd(0x9e)](_0xbd9ba6);if(isJourneyDef(_0x1fc03b)){const _0x86086a=a115_0x5c32d9(_0xbd9ba6);_0x1e42fc['push']({'yamlConfig':_0x86086a,'folderPath':_0x13b739,'sourcePath':_0x1218ee});}else{if(!_0x236fb7?.[_0x41b5cd(0xfb)]){const _0x51cc2c=parseSegmentYamlFile(_0xbd9ba6),_0xb391a6=normalizeChildSegmentYaml(_0x51cc2c);_0x5557d7['push']({'yamlConfig':_0xb391a6,'folderPath':_0x13b739,'sourcePath':_0x1218ee});}}}return{'segments':_0x5557d7,'journeys':_0x1e42fc};}export function validateParsedFiles(_0x3e9afb,_0x55d73f){const _0x1992ac=a115_0x1d8f82,_0x2ce2f3=[];for(const {yamlConfig:_0x2cb3a6,sourcePath:_0x27b365}of _0x3e9afb['segments']){const _0x58dd8d=readFileSync(_0x27b365,'utf-8'),_0x4430d4=a115_0x422b74[_0x1992ac(0xe4)](_0x58dd8d),_0x1a4145=validateSegmentDef(_0x2cb3a6,{'source':_0x58dd8d,'document':_0x4430d4});if(!_0x1a4145[_0x1992ac(0x133)]){const _0x96b848=a115_0x14b265[_0x1992ac(0xf6)](_0x55d73f,_0x27b365);_0x2ce2f3[_0x1992ac(0x148)]({'filePath':_0x96b848,'source':_0x58dd8d,'result':_0x1a4145,'isJourney':![]});}}for(const {yamlConfig:_0x130fb8,sourcePath:_0x3519d5}of _0x3e9afb[_0x1992ac(0xd4)]){const _0x4e981d=readFileSync(_0x3519d5,'utf-8'),_0x1b4cde=a115_0x422b74[_0x1992ac(0xe4)](_0x4e981d),_0x5820f4=validateJourneyDef(_0x130fb8,{'source':_0x4e981d,'document':_0x1b4cde});if(!_0x5820f4['valid']){const _0x382f30=a115_0x14b265[_0x1992ac(0xf6)](_0x55d73f,_0x3519d5);_0x2ce2f3[_0x1992ac(0x148)]({'filePath':_0x382f30,'source':_0x4e981d,'result':_0x5820f4,'isJourney':!![]});}}return _0x2ce2f3;}export function formatValidationErrors(_0x5f486b){const _0x3bd6f0=a115_0x1d8f82,_0x5838fe=[];for(const {filePath:_0x4b602b,source:_0x1348a2,result:_0x57205e,isJourney:_0x352a9d}of _0x5f486b){const _0x9e68eb=_0x352a9d?_0x3bd6f0(0xa1):_0x3bd6f0(0xdb);_0x5838fe[_0x3bd6f0(0x148)]('\x0a'+_0x4b602b+'\x20('+_0x9e68eb+_0x3bd6f0(0x89)+_0x57205e[_0x3bd6f0(0x164)]['length']+'\x20error(s)'),_0x5838fe[_0x3bd6f0(0x148)](formatValidationResult(_0x57205e,_0x1348a2,_0x4b602b));}return _0x5838fe[_0x3bd6f0(0x121)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4a97ba){const _0x1b9018=a115_0x1d8f82,_0x22103f=new Set(),_0x39dbef=new Map(),_0x20e28f=collectSegmentUsageCounts(_0x4a97ba);if(_0x4a97ba[_0x1b9018(0x101)])for(const [_0x21f951,_0x3280e7]of Object[_0x1b9018(0x131)](_0x4a97ba[_0x1b9018(0x101)])){_0x22103f[_0x1b9018(0xea)](_0x21f951);if(_0x3280e7[_0x1b9018(0xdf)]){const _0x20bdba=yamlRuleToApi(_0x3280e7['rule']),_0x9aa958=apiRuleToYaml(_0x20bdba);_0x39dbef[_0x1b9018(0x110)](_0x21f951,_0x9aa958);}}const _0x63405e=new Map();let _0x3f82fd=0x0;for(const [_0x3bc276,_0x476fb0]of _0x39dbef){const _0x40cec9=serializeExpandedRule(_0x476fb0,_0x39dbef),_0x58d2ef=_0x63405e['get'](_0x40cec9)||[];_0x58d2ef[_0x1b9018(0x148)]({'name':_0x3bc276,'index':_0x3f82fd}),_0x63405e[_0x1b9018(0x110)](_0x40cec9,_0x58d2ef),_0x3f82fd++;}const _0x2ec214=new Map();for(const [_0xa26dfe,_0x3b395c]of _0x63405e){const _0x10e0c4=_0x3b395c['slice']()[_0x1b9018(0x8e)]((_0x3b53bd,_0x4c9e3b)=>{const _0x13af96=_0x1b9018,_0x1f7b29=_0x20e28f['get'](_0x3b53bd[_0x13af96(0x10f)])||0x0,_0x4a6a50=_0x20e28f['get'](_0x4c9e3b[_0x13af96(0x10f)])||0x0;if(_0x1f7b29!==_0x4a6a50)return _0x4a6a50-_0x1f7b29;return _0x3b53bd[_0x13af96(0x11d)]-_0x4c9e3b[_0x13af96(0x11d)];})['map'](_0x28a373=>_0x28a373['name']),_0x3557b8=[];for(const _0x4b1fcd of _0x10e0c4){const _0x2926eb=_0x20e28f[_0x1b9018(0x105)](_0x4b1fcd)||0x0,_0x11e936=Math[_0x1b9018(0x158)](_0x2926eb,0x1);for(let _0x2721d4=0x0;_0x2721d4<_0x11e936;_0x2721d4++){_0x3557b8[_0x1b9018(0x148)](_0x4b1fcd);}}_0x2ec214[_0x1b9018(0x110)](_0xa26dfe,_0x3557b8);}return{'existingLocalSegmentNames':_0x22103f,'localSegmentRules':_0x39dbef,'localExpandedRuleToNames':_0x2ec214};}async function buildServerSegmentRuleMap(_0x43c06d,_0x25fcb2,_0x53adc2,_0xff0aef){const _0x233e5f=new Map(),_0xcc8c6e=new Set(),_0x5efa9b=async _0x389874=>{const _0x48ee7b=a115_0x63bb;if(_0xcc8c6e['has'](_0x389874))return;_0xcc8c6e['add'](_0x389874);let _0x46c7e8=_0x53adc2[_0x48ee7b(0xe3)](_0x50b9c7=>_0x50b9c7['id']===_0x389874);if(!_0x46c7e8)try{_0x46c7e8=await _0x43c06d['segment'][_0x48ee7b(0xd0)](_0x25fcb2,_0x389874);}catch{return;}if(!_0x46c7e8?.[_0x48ee7b(0xdf)])return;const _0x2203bc=apiRuleToYaml(_0x46c7e8['rule']);_0x233e5f[_0x48ee7b(0x110)](_0x389874,_0x2203bc);const _0xe1c6d7=collectSegmentRefsFromRule(_0x2203bc);for(const _0x589c8a of _0xe1c6d7){await _0x5efa9b(_0x589c8a);}};for(const _0x36a929 of _0xff0aef){await _0x5efa9b(_0x36a929);}return _0x233e5f;}export function createSegmentIdResolver(_0x346e12,_0x1bdc2a){return async _0x42d93b=>{const _0x9848bc=a115_0x63bb,_0x4dd4de=_0x346e12['get'](_0x42d93b);if(!_0x4dd4de)throw new SDKError(ErrorCode[_0x9848bc(0x159)],'Segment\x20not\x20found:\x20'+_0x42d93b+_0x9848bc(0xa5)+_0x1bdc2a+'\x27)');return _0x4dd4de;};}export function extractRootFolderId(_0x5b81f0){const _0x57ccc0=a115_0x1d8f82;return _0x5b81f0[_0x57ccc0(0xe2)]?.[_0x57ccc0(0x102)]?.[_0x57ccc0(0xcc)]?.['id']||_0x5b81f0['relationships']?.[_0x57ccc0(0xca)]?.['data']?.['id'];}export function buildConnectionMaps(_0x5231b7){const _0x1e4b70=a115_0x1d8f82,_0x400fac=new Map(),_0x277d97=new Map(),_0x5ae723=new Map();for(const _0x31b853 of _0x5231b7){_0x400fac['set'](_0x31b853[_0x1e4b70(0x10f)],parseInt(_0x31b853['id'],0xa)),_0x277d97[_0x1e4b70(0x110)](_0x31b853['id'],_0x31b853['name']),_0x5ae723[_0x1e4b70(0x110)](_0x31b853[_0x1e4b70(0x10f)],_0x31b853[_0x1e4b70(0x8b)]);}return{'nameToId':_0x400fac,'idToName':_0x277d97,'nameToType':_0x5ae723};}export function calculatePushStats(_0x3191ad,_0x50e3d0,_0x1eb761,_0x43de67,_0x27e8b5,_0x376c96,_0x4c52db){const _0x58b0b2=a115_0x1d8f82,_0x1d40e9=_0x3191ad[_0x58b0b2(0xa3)](_0x2c9581=>_0x2c9581[_0x58b0b2(0x129)]),_0x237d1d=_0x3191ad['filter'](_0x5ce330=>!_0x5ce330[_0x58b0b2(0x129)]&&_0x5ce330[_0x58b0b2(0x8c)]),_0x266022=_0x3191ad['filter'](_0x220215=>!_0x220215[_0x58b0b2(0x129)]&&!_0x220215[_0x58b0b2(0x8c)]),_0x5c5767=_0x376c96?_0x43de67:[],_0x488950=_0x50e3d0[_0x58b0b2(0xa3)](_0x17b520=>_0x17b520[_0x58b0b2(0x129)]),_0x1fd77d=_0x50e3d0[_0x58b0b2(0xa3)](_0x423c17=>!_0x423c17[_0x58b0b2(0x129)]&&_0x423c17[_0x58b0b2(0x8c)]),_0x1aa97d=_0x50e3d0[_0x58b0b2(0xa3)](_0x3ac175=>!_0x3ac175[_0x58b0b2(0x129)]&&!_0x3ac175[_0x58b0b2(0x8c)]),_0x14e122=_0x376c96?_0x27e8b5:[],_0x5d59c4=_0x3191ad['flatMap'](_0x3a1244=>_0x3a1244['activationActions']),_0x5de09d=_0x5d59c4[_0x58b0b2(0xa3)](_0xaad42c=>_0xaad42c[_0x58b0b2(0x8b)]==='create'),_0x4d75f5=_0x5d59c4[_0x58b0b2(0xa3)](_0x13ab25=>_0x13ab25['type']===_0x58b0b2(0x97)),_0x2211b3=_0x5d59c4[_0x58b0b2(0xa3)](_0x1d4724=>_0x1d4724[_0x58b0b2(0x8b)]===_0x58b0b2(0xc3)),_0x181c34=Array[_0x58b0b2(0x8a)](_0x1eb761)[_0x58b0b2(0x8e)](),_0x110f06=_0x4c52db?![]:_0x1d40e9[_0x58b0b2(0x156)]>0x0||_0x237d1d['length']>0x0||_0x5c5767['length']>0x0,_0x6a2ff2=_0x488950['length']>0x0||_0x1fd77d[_0x58b0b2(0x156)]>0x0||_0x14e122[_0x58b0b2(0x156)]>0x0,_0x461841=_0x4c52db?![]:_0x5d59c4['length']>0x0,_0x4d8ba0=_0x181c34[_0x58b0b2(0x156)]>0x0;return{'segments':{'new':_0x1d40e9,'changed':_0x237d1d,'unchanged':_0x266022,'toDelete':_0x5c5767},'journeys':{'new':_0x488950,'changed':_0x1fd77d,'unchanged':_0x1aa97d,'toDelete':_0x14e122},'activations':{'all':_0x5d59c4,'toCreate':_0x5de09d,'toUpdate':_0x4d75f5,'toDelete':_0x2211b3},'folders':{'toCreate':_0x181c34},'counts':{'segments':{'new':_0x1d40e9[_0x58b0b2(0x156)],'changed':_0x237d1d['length'],'unchanged':_0x266022[_0x58b0b2(0x156)],'toDelete':_0x5c5767[_0x58b0b2(0x156)]},'journeys':{'new':_0x488950[_0x58b0b2(0x156)],'changed':_0x1fd77d[_0x58b0b2(0x156)],'unchanged':_0x1aa97d['length'],'toDelete':_0x14e122[_0x58b0b2(0x156)]},'activations':{'create':_0x5de09d[_0x58b0b2(0x156)],'update':_0x4d75f5[_0x58b0b2(0x156)],'delete':_0x2211b3[_0x58b0b2(0x156)]},'folders':_0x181c34[_0x58b0b2(0x156)]},'hasChanges':_0x110f06||_0x6a2ff2||_0x461841||_0x4d8ba0};}export async function buildPushExecutionContext(_0x2826ca,_0xa32359,_0xb7ab73,_0x36ab7c,_0x14a60c,_0xffa93){const _0x1338fc=a115_0x1d8f82,_0x21b915=extractRootFolderId(_0xb7ab73),{pathToId:_0x3e7486,idToPath:_0x68d11a}=buildFolderMaps(_0x14a60c),_0x565418=buildSegmentNameToIdMap(_0x36ab7c),_0x432f0e=new Map(),{batchAsync:_0x3b2424}=await import(_0x1338fc(0x157)),[_0x21020d,_0x56da16]=await Promise[_0x1338fc(0xd1)]([_0x2826ca[_0x1338fc(0xa4)][_0x1338fc(0xda)](),_0x2826ca[_0x1338fc(0xac)][_0x1338fc(0xe6)](),((async()=>{!_0xffa93&&_0x36ab7c['length']>0x0&&await _0x3b2424(_0x36ab7c,async _0x51ea79=>{const _0x4d7f58=a115_0x63bb,_0x1ce471=await _0x2826ca[_0x4d7f58(0xdb)]['listActivations'](_0xa32359,_0x51ea79['id']);_0x432f0e[_0x4d7f58(0x110)](_0x51ea79['id'],_0x1ce471);});})())]),{emailToId:_0x2a4d86,idToEmail:_0x286c52}=_0x21020d,_0x4e1fdd=buildConnectionMaps(_0x56da16);return{'rootFolderId':_0x21b915,'folderPathToId':_0x3e7486,'folderIdToPath':_0x68d11a,'segmentNameToId':_0x565418,'activationsBySegmentId':_0x432f0e,'emailToIdMap':_0x2a4d86,'idToEmailMap':_0x286c52,'connectionNameToIdMap':_0x4e1fdd[_0x1338fc(0xfd)],'connectionIdToNameMap':_0x4e1fdd[_0x1338fc(0xcb)],'connectionNameToTypeMap':_0x4e1fdd[_0x1338fc(0xb7)]};}export function createPushYamlContextForBundle(_0x53a317,_0x524944,_0x4dac27,_0x1d7d31,_0x5a1733,_0x5cf0c4,_0x32ebdb,_0x33d0c3){const {existingLocalSegmentNames:_0x7fb171,localExpandedRuleToNames:_0x56c05f}=_0x1d7d31,_0xbb89ea=new Set(),_0x43b41e=new Map(),_0x14faae=new Map(),_0x489377=new Map(),_0x5ed496=createJumpTargetCache(),_0x51ab2c=new Map(),_0x2cc556=new Map(),_0x2e7cf4=new Set();let _0xbf5c9f;const _0x2768e6=_0xc7d4ae=>{const _0x1e72ec={'resolveSegment':async _0x214e39=>{const _0x54b358=a115_0x63bb,_0x31cc8f=_0x489377[_0x54b358(0x105)](_0x214e39);if(_0x31cc8f!==undefined)return{'name':_0x31cc8f,'isJourneyLocal':!![]};try{let _0x47f898=_0x4dac27[_0x54b358(0xe3)](_0x2501d0=>_0x2501d0['id']===_0x214e39);!_0x47f898&&(_0x47f898=await _0x53a317[_0x54b358(0xdb)][_0x54b358(0xd0)](_0x524944,_0x214e39));const _0x267455=generateJourneyLocalName(_0x47f898[_0x54b358(0x10f)]),_0x125f93=_0x47f898[_0x54b358(0x13d)]===SEGMENT_KIND_JOURNEY&&_0x267455!==undefined;let _0x49e71f=_0x47f898[_0x54b358(0x10f)],_0x5280f3;if(_0x125f93&&_0x47f898[_0x54b358(0xdf)]){const _0x4d6964=apiRuleToYaml(_0x47f898[_0x54b358(0xdf)]);_0x2cc556['set'](_0x214e39,_0x4d6964);const _0x18ae6c=async _0x3bfb54=>{const _0x5ebb79=_0x54b358,_0x43bb0d=collectSegmentRefsFromRule(_0x3bfb54);for(const _0x48f584 of _0x43bb0d){if(!_0x2cc556[_0x5ebb79(0x13f)](_0x48f584))try{const _0x4baf87=await _0x53a317[_0x5ebb79(0xdb)][_0x5ebb79(0xd0)](_0x524944,_0x48f584);if(_0x4baf87?.[_0x5ebb79(0xdf)]){const _0x38389d=apiRuleToYaml(_0x4baf87[_0x5ebb79(0xdf)]);_0x2cc556[_0x5ebb79(0x110)](_0x48f584,_0x38389d),await _0x18ae6c(_0x38389d);}}catch{}}};await _0x18ae6c(_0x4d6964);const _0x250ca1=serializeExpandedRule(_0x4d6964,_0x2cc556),_0x1ac585=_0x56c05f[_0x54b358(0x105)](_0x250ca1);if(_0x1ac585&&_0x1ac585[_0x54b358(0x156)]>0x0){const _0x53005d=_0x43b41e[_0x54b358(0x105)](_0x250ca1)||0x0,_0x571b73=_0x1ac585[_0x53005d]||_0x1ac585[_0x1ac585['length']-0x1];_0x43b41e['set'](_0x250ca1,_0x53005d+0x1),_0x49e71f=_0x571b73,_0xbb89ea[_0x54b358(0xea)](_0x49e71f),_0x489377[_0x54b358(0x110)](_0x214e39,_0x49e71f);const _0x4ded65=await resolveRuleSegmentRefs(_0x4d6964,async _0x140e45=>{const _0xc19a00=_0x54b358,_0x55c2ca=_0x489377[_0xc19a00(0x105)](_0x140e45);if(_0x55c2ca)return _0x55c2ca;const _0x2147b8=await _0xbf5c9f[_0xc19a00(0xb0)](_0x140e45);return _0x2147b8[_0xc19a00(0x10f)];});_0x5280f3={'description':_0x47f898[_0x54b358(0x106)],'rule':_0x4ded65};}else{const _0x2c029f=_0x51ab2c[_0x54b358(0x105)](_0x250ca1);if(_0x2c029f)_0x49e71f=_0x2c029f,_0x489377[_0x54b358(0x110)](_0x214e39,_0x49e71f);else{if(_0x267455){let _0x598338=_0x267455,_0x274797=0x2;while(_0xbb89ea[_0x54b358(0x13f)](_0x598338)||_0x7fb171['has'](_0x598338)){_0x598338=_0x267455+'_'+_0x274797,_0x274797++;}_0xbb89ea[_0x54b358(0xea)](_0x598338),_0x49e71f=_0x598338;}_0x489377['set'](_0x214e39,_0x49e71f),_0x51ab2c[_0x54b358(0x110)](_0x250ca1,_0x49e71f);const _0x49cb9d=await resolveRuleSegmentRefs(_0x4d6964,async _0x2fd776=>{const _0x2eefef=_0x54b358,_0x3d42b1=_0x489377[_0x2eefef(0x105)](_0x2fd776);if(_0x3d42b1)return _0x3d42b1;const _0x422a43=await _0xbf5c9f[_0x2eefef(0xb0)](_0x2fd776);return _0x422a43[_0x2eefef(0x10f)];});_0x5280f3={'description':_0x47f898[_0x54b358(0x106)],'rule':_0x49cb9d};}}}return{'name':_0x49e71f,'isJourneyLocal':_0x125f93,'definition':_0x5280f3};}catch{return{'name':_0x214e39,'isJourneyLocal':![]};}},'resolveActivation':async _0x4f4b00=>{const _0x4687bd=a115_0x63bb,_0x3887cd=_0x14faae['get'](_0x4f4b00);if(_0x3887cd!==undefined)return{'name':_0x3887cd,'isJourneyLocal':!![]};try{let _0x194023=_0x32ebdb?.[_0x4687bd(0x105)](_0x4f4b00);!_0x194023&&(_0x194023=await _0x53a317[_0x4687bd(0xa1)][_0x4687bd(0x10c)](_0xc7d4ae,_0x4f4b00));const _0x1ffd51=_0x194023[_0x4687bd(0x146)]['activationParams'][_0x4687bd(0x10f)]||_0x4f4b00,_0x1ed7b4=sanitizeYamlKey(_0x1ffd51)||_0x4687bd(0x124)+_0x4f4b00,_0x5b4f86=_0x1ed7b4;_0x14faae[_0x4687bd(0x110)](_0x4f4b00,_0x5b4f86);const _0x3f2158=journeyActivationStepToYaml(_0x194023,_0x5a1733,_0x5cf0c4);return{'name':_0x5b4f86,'isJourneyLocal':!![],'definition':_0x3f2158};}catch{return{'name':_0x4f4b00,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4a1abe,_0x1735a3)=>resolveJumpTarget(_0x4a1abe,_0x1735a3,_0x5ed496,async _0x124791=>{const _0x5c516b=_0x33d0c3?.['get'](_0x124791);if(_0x5c516b)return _0x5c516b;return _0x53a317['journey']['getJourney'](_0x124791);})};return _0xbf5c9f=_0x1e72ec,_0x1e72ec;},_0x1bece7=async _0x1c6ed3=>{const _0xe9aace=a115_0x63bb,{collectSegmentIdsFromJourneyApi:_0x2149eb}=await import(_0xe9aace(0x12d)),{batchAsync:_0x3ce0c3}=await import('../../utils/async.js'),_0x3f36a6=new Set();for(const _0x4f81fc of _0x1c6ed3){let _0x42e0bd=_0x33d0c3?.[_0xe9aace(0x105)](_0x4f81fc);!_0x42e0bd&&(_0x42e0bd=await _0x53a317[_0xe9aace(0xa1)][_0xe9aace(0x8d)](_0x4f81fc));const _0x2537eb=_0x2149eb(_0x42e0bd);for(const _0xc8863f of _0x2537eb){_0x3f36a6[_0xe9aace(0xea)](_0xc8863f);}}let _0x5d6399=Array['from'](_0x3f36a6);while(_0x5d6399[_0xe9aace(0x156)]>0x0){const _0x698e7d=_0x5d6399[_0xe9aace(0xa3)](_0x2d4cb4=>!_0x2e7cf4[_0xe9aace(0x13f)](_0x2d4cb4));if(_0x698e7d[_0xe9aace(0x156)]===0x0)break;const _0x40b467=await _0x3ce0c3(_0x698e7d,async _0x1efb94=>{const _0x400fc0=_0xe9aace;_0x2e7cf4[_0x400fc0(0xea)](_0x1efb94);let _0x57efb8=_0x4dac27['find'](_0x490a6d=>_0x490a6d['id']===_0x1efb94);if(!_0x57efb8)try{_0x57efb8=await _0x53a317[_0x400fc0(0xdb)][_0x400fc0(0xd0)](_0x524944,_0x1efb94);}catch{return null;}return{'segmentId':_0x1efb94,'segment':_0x57efb8};},0xa),_0xb06b01=new Set();for(const _0xeb0ed4 of _0x40b467){if(!_0xeb0ed4?.['segment']?.['rule'])continue;const _0x3bd435=apiRuleToYaml(_0xeb0ed4[_0xe9aace(0xdb)][_0xe9aace(0xdf)]);_0x2cc556[_0xe9aace(0x110)](_0xeb0ed4[_0xe9aace(0x13b)],_0x3bd435);const _0x282f82=collectSegmentRefsFromRule(_0x3bd435);for(const _0x4a065b of _0x282f82){!_0x2e7cf4[_0xe9aace(0x13f)](_0x4a065b)&&_0xb06b01[_0xe9aace(0xea)](_0x4a065b);}}_0x5d6399=Array[_0xe9aace(0x8a)](_0xb06b01);}};return{'createYamlContext':_0x2768e6,'prefetchJourneySegments':_0x1bece7};}export async function executePushSegments(_0x413071,_0x17725d,_0x486153,_0x4d8f3e,_0x2fcdc9){const _0x45e167=a115_0x1d8f82,{segmentDefToCreateRequest:_0x479dbe,segmentDefToUpdateRequest:_0x4c0f65}=await import(_0x45e167(0x154)),_0x248ff5=_0x486153[_0x45e167(0x122)],_0x44c569=0x5,_0xe2340=async _0x5a08cb=>{const _0x276161=_0x45e167,_0x42c258=_0x5a08cb['folderPath']?_0x248ff5['get'](_0x5a08cb['folderPath']):undefined;let _0x370d84;const _0x2838dc={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5a08cb[_0x276161(0x129)]){_0x2fcdc9[_0x276161(0x96)]?.({'type':'segment_creating','name':_0x5a08cb[_0x276161(0x103)]['name']});const _0x58a58a=_0x479dbe(_0x5a08cb[_0x276161(0x103)],_0x42c258),_0x50daa5=await _0x2fcdc9['withProgress'](_0x276161(0x14e)+_0x5a08cb['yamlConfig'][_0x276161(0x10f)]+_0x276161(0x130),()=>_0x413071[_0x276161(0xdb)][_0x276161(0xe8)](_0x4d8f3e[_0x276161(0xe1)],_0x58a58a));_0x370d84=_0x50daa5[_0x276161(0xcc)]['id'],_0x2838dc['createdSegmentId']={'name':_0x5a08cb[_0x276161(0x103)][_0x276161(0x10f)],'id':_0x370d84},_0x2fcdc9[_0x276161(0x96)]?.({'type':_0x276161(0x12e),'name':_0x5a08cb['yamlConfig']['name'],'segmentId':_0x370d84}),_0x2fcdc9[_0x276161(0x14f)]?.('Created\x20segment\x20\x27'+_0x5a08cb['yamlConfig'][_0x276161(0x10f)]+'\x27'),_0x2838dc[_0x276161(0xd5)]=0x1;}else{if(_0x5a08cb[_0x276161(0x8c)]){_0x2fcdc9[_0x276161(0x96)]?.({'type':'segment_updating','name':_0x5a08cb['yamlConfig'][_0x276161(0x10f)]});const _0xbd5a=_0x4c0f65(_0x5a08cb[_0x276161(0x103)]);_0x42c258!==_0x5a08cb[_0x276161(0xc9)]?.['segmentFolderId']&&(_0xbd5a[_0x276161(0x11f)]=_0x42c258?parseInt(_0x42c258,0xa):undefined),await _0x2fcdc9[_0x276161(0xd2)]('Updating\x20segment\x20\x27'+_0x5a08cb[_0x276161(0x103)][_0x276161(0x10f)]+_0x276161(0x130),()=>_0x413071[_0x276161(0xdb)][_0x276161(0x151)](_0x4d8f3e['parentId'],_0x5a08cb[_0x276161(0xc9)]['id'],_0xbd5a)),_0x370d84=_0x5a08cb[_0x276161(0xc9)]['id'],_0x2fcdc9[_0x276161(0x96)]?.({'type':'segment_updated','name':_0x5a08cb[_0x276161(0x103)][_0x276161(0x10f)]}),_0x2fcdc9[_0x276161(0x14f)]?.('Updated\x20segment\x20\x27'+_0x5a08cb[_0x276161(0x103)][_0x276161(0x10f)]+'\x27'),_0x2838dc[_0x276161(0x104)]=0x1;}else _0x370d84=_0x5a08cb[_0x276161(0xc9)]['id'];}}catch(_0x4b63ff){const _0x51309e=isHttp400Error(_0x4b63ff),_0x4bdb10=_0x51309e?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x276161(0x95)],_0x200825=getErrorMessage(_0x4b63ff);throw new SDKError(_0x4bdb10,'Failed\x20to\x20'+(_0x5a08cb[_0x276161(0x129)]?'create':'update')+_0x276161(0x119)+_0x5a08cb['absolutePath']+_0x276161(0xdd)+_0x200825,_0x4b63ff);}try{const _0x53b3fc=await syncActivationsForSegment(_0x413071,_0x4d8f3e['parentId'],_0x370d84,_0x5a08cb[_0x276161(0x103)][_0x276161(0x10f)],_0x5a08cb[_0x276161(0x13c)],_0x2fcdc9,_0x5a08cb[_0x276161(0xde)]);_0x2838dc[_0x276161(0x160)]=_0x53b3fc;}catch(_0x523980){if(_0x523980 instanceof SDKError)throw _0x523980;throw new SDKError(ErrorCode[_0x276161(0x128)],_0x276161(0xba)+_0x5a08cb[_0x276161(0x103)][_0x276161(0x10f)]+_0x276161(0xf0)+_0x5a08cb[_0x276161(0xde)]+_0x276161(0xdd)+getErrorMessage(_0x523980),_0x523980);}return _0x2838dc;},_0x3f9475=await batchAsync(_0x17725d,_0xe2340,_0x44c569),_0x5a4719={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x555e8f of _0x3f9475){_0x5a4719['created']+=_0x555e8f[_0x45e167(0xd5)],_0x5a4719[_0x45e167(0x104)]+=_0x555e8f[_0x45e167(0x104)],_0x555e8f['createdSegmentId']&&_0x5a4719['createdSegmentIds'][_0x45e167(0x110)](_0x555e8f[_0x45e167(0x125)][_0x45e167(0x10f)],_0x555e8f[_0x45e167(0x125)]['id']),_0x5a4719[_0x45e167(0x160)][_0x45e167(0xd5)]+=_0x555e8f[_0x45e167(0x160)][_0x45e167(0xd5)],_0x5a4719['activations'][_0x45e167(0x104)]+=_0x555e8f[_0x45e167(0x160)][_0x45e167(0x104)],_0x5a4719[_0x45e167(0x160)][_0x45e167(0x163)]+=_0x555e8f['activations'][_0x45e167(0x163)];}return _0x5a4719;}async function syncActivationsForSegment(_0x3bd46f,_0xbfaea,_0x36c319,_0x4efcb7,_0x4abfda,_0x2b5930,_0x326dea){const _0x5c6852=a115_0x1d8f82,_0x2cbe8e={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2d920f of _0x4abfda){try{if(_0x2d920f[_0x5c6852(0x8b)]==='create'&&_0x2d920f['validatedRequest'])_0x2b5930['onProgress']?.({'type':_0x5c6852(0x111),'segmentName':_0x4efcb7,'activationName':_0x2d920f[_0x5c6852(0x10f)]}),await _0x2b5930[_0x5c6852(0xd2)](_0x5c6852(0xc2)+_0x2d920f['name']+'\x27...',()=>_0x3bd46f[_0x5c6852(0xdb)][_0x5c6852(0xe9)](_0xbfaea,_0x36c319,_0x2d920f[_0x5c6852(0x152)])),_0x2b5930[_0x5c6852(0x96)]?.({'type':'activation_created','segmentName':_0x4efcb7,'activationName':_0x2d920f[_0x5c6852(0x10f)]}),_0x2b5930[_0x5c6852(0x14f)]?.(_0x5c6852(0xf4)+_0x2d920f[_0x5c6852(0x10f)]+'\x27'),_0x2cbe8e[_0x5c6852(0xd5)]++;else{if(_0x2d920f[_0x5c6852(0x8b)]===_0x5c6852(0x97)&&_0x2d920f[_0x5c6852(0x152)]&&_0x2d920f[_0x5c6852(0xb2)])_0x2b5930[_0x5c6852(0x96)]?.({'type':_0x5c6852(0x13a),'segmentName':_0x4efcb7,'activationName':_0x2d920f[_0x5c6852(0x10f)]}),await _0x2b5930[_0x5c6852(0xd2)](_0x5c6852(0x94)+_0x2d920f[_0x5c6852(0x10f)]+_0x5c6852(0x130),()=>_0x3bd46f[_0x5c6852(0xdb)]['updateActivation'](_0xbfaea,_0x36c319,_0x2d920f['existingActivation']['id'],_0x2d920f['validatedRequest'])),_0x2b5930[_0x5c6852(0x96)]?.({'type':_0x5c6852(0x14b),'segmentName':_0x4efcb7,'activationName':_0x2d920f[_0x5c6852(0x10f)]}),_0x2b5930[_0x5c6852(0x14f)]?.('Updated\x20activation\x20\x27'+_0x2d920f['name']+'\x27'),_0x2cbe8e[_0x5c6852(0x104)]++;else _0x2d920f['type']===_0x5c6852(0xc3)&&_0x2d920f[_0x5c6852(0xb2)]&&(_0x2b5930[_0x5c6852(0x96)]?.({'type':_0x5c6852(0xe7),'segmentName':_0x4efcb7,'activationName':_0x2d920f[_0x5c6852(0x10f)]}),await _0x2b5930[_0x5c6852(0xd2)]('Deleting\x20activation\x20\x27'+_0x2d920f[_0x5c6852(0x10f)]+_0x5c6852(0x130),()=>_0x3bd46f[_0x5c6852(0xdb)][_0x5c6852(0xed)](_0xbfaea,_0x36c319,_0x2d920f[_0x5c6852(0xb2)]['id'])),_0x2b5930['onProgress']?.({'type':'activation_deleted','segmentName':_0x4efcb7,'activationName':_0x2d920f[_0x5c6852(0x10f)]}),_0x2b5930['logDeleted']?.(_0x5c6852(0xbb)+_0x2d920f[_0x5c6852(0x10f)]+'\x27'),_0x2cbe8e['deleted']++);}}catch(_0x40713b){const _0x4990bb=isHttp400Error(_0x40713b),_0x4f499b=_0x4990bb?ErrorCode[_0x5c6852(0x145)]:ErrorCode[_0x5c6852(0x128)],_0x3ad0ec=getErrorMessage(_0x40713b);throw new SDKError(_0x4f499b,_0x5c6852(0xec)+_0x2d920f[_0x5c6852(0x8b)]+_0x5c6852(0xb4)+_0x2d920f[_0x5c6852(0x10f)]+_0x5c6852(0xf0)+_0x326dea+_0x5c6852(0xdd)+_0x3ad0ec,_0x40713b);}}return _0x2cbe8e;}export async function executePushFolders(_0x33efa6,_0x23381f,_0x574dd7,_0x274438,_0x181537){const _0x481d2b=a115_0x1d8f82,_0x27b58b=new Map(_0x574dd7);for(const _0x7523f3 of _0x23381f){const _0x879b06=_0x7523f3[_0x481d2b(0x15f)]('/'),_0x11170c=_0x879b06[_0x879b06[_0x481d2b(0x156)]-0x1],_0x1cdd2d=_0x879b06[_0x481d2b(0xfe)](0x0,-0x1)[_0x481d2b(0x121)]('/'),_0x198300=_0x27b58b[_0x481d2b(0x105)](_0x1cdd2d);_0x181537[_0x481d2b(0x96)]?.({'type':_0x481d2b(0xfc),'folder':_0x7523f3});const _0x1478bf={'name':_0x11170c,'parentFolderId':_0x198300},_0x5ae1b3=await _0x181537[_0x481d2b(0xd2)]('Creating\x20folder\x20\x27'+_0x7523f3+_0x481d2b(0x130),()=>_0x33efa6[_0x481d2b(0xdb)][_0x481d2b(0xc4)](_0x274438[_0x481d2b(0xe1)],_0x1478bf));_0x27b58b['set'](_0x7523f3,_0x5ae1b3[_0x481d2b(0xcc)]['id']),_0x181537['onProgress']?.({'type':_0x481d2b(0x135),'folder':_0x7523f3,'folderId':_0x5ae1b3[_0x481d2b(0xcc)]['id']}),_0x181537[_0x481d2b(0x155)]?.(_0x481d2b(0x15e)+_0x7523f3+'\x27');}return _0x27b58b;}export async function executePushSegmentDeletions(_0x203785,_0x3e3dda,_0x4abe79){const _0x22f3a6=a115_0x1d8f82;if(_0x3e3dda['length']===0x0)return 0x0;const {batchAsync:_0x1ed3b2}=await import(_0x22f3a6(0x157)),_0x5b5367=0x5,_0x2490e1=await _0x1ed3b2(_0x3e3dda,async _0x1c9e17=>{const _0x55ce5d=_0x22f3a6;return _0x4abe79['onProgress']?.({'type':_0x55ce5d(0xb9),'name':_0x1c9e17[_0x55ce5d(0x10f)]}),await _0x203785[_0x55ce5d(0xdb)]['deleteSegment'](_0x1c9e17['id']),_0x4abe79[_0x55ce5d(0x96)]?.({'type':_0x55ce5d(0x12f),'name':_0x1c9e17[_0x55ce5d(0x10f)]}),_0x4abe79[_0x55ce5d(0x11a)]?.(_0x55ce5d(0xf3)+_0x1c9e17[_0x55ce5d(0x10f)]+'\x27'),0x1;},_0x5b5367);return _0x2490e1[_0x22f3a6(0x153)]((_0x150a90,_0x4c73ad)=>_0x150a90+_0x4c73ad,0x0);}function a115_0x63bb(_0x482cd2,_0x1d2708){_0x482cd2=_0x482cd2-0x89;const _0x1e0f39=a115_0x1e0f();let _0x63bb07=_0x1e0f39[_0x482cd2];return _0x63bb07;}export async function executePushJourneys(_0x31d268,_0xcd68af,_0x51a900,_0x33956d,_0x4b55aa){const _0x209b65=a115_0x1d8f82,{journeyDefToRequest:_0x31dde1}=await import(_0x209b65(0x12d)),{activationDefToCreateRequest:_0x38e864,yamlRuleToApi:_0x314e20,validateSegmentRule:_0x5de888}=await import(_0x209b65(0x154)),_0x2ae2a8={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x99e9fe=new Map(_0x51a900['segmentNameToId']),_0x37fedb=0x5;for(let _0xabdeab=0x0;_0xabdeab<_0xcd68af[_0x209b65(0x156)];_0xabdeab+=_0x37fedb){const _0x338ae5=_0xcd68af['slice'](_0xabdeab,_0xabdeab+_0x37fedb),_0xc6a78d=await Promise[_0x209b65(0xd1)](_0x338ae5[_0x209b65(0xbc)](async _0x3c21f8=>{const _0xeefac5=_0x209b65;if(!_0x3c21f8[_0xeefac5(0x129)]&&!_0x3c21f8['hasChanges'])return{'action':_0xeefac5(0xaf),'name':_0x3c21f8[_0xeefac5(0x103)][_0xeefac5(0x10f)],'journeyId':_0x3c21f8[_0xeefac5(0xa6)]?.['id']};const _0x375a9f=_0x3c21f8['folderPath']?_0x51a900['folderPathToId']['get'](_0x3c21f8['folderPath']):undefined;_0x4b55aa[_0xeefac5(0x96)]?.({'type':_0x3c21f8[_0xeefac5(0x129)]?_0xeefac5(0xc0):_0xeefac5(0xc8),'name':_0x3c21f8[_0xeefac5(0x103)]['name']});try{const _0x2ab7fb=await executeSingleJourneyPush(_0x31d268,_0x3c21f8,{..._0x51a900,'segmentNameToId':_0x99e9fe},{'parentId':_0x33956d['parentId'],'rootFolderId':_0x33956d[_0xeefac5(0xb6)],'folderId':_0x375a9f,'verbose':_0x33956d[_0xeefac5(0x150)]},_0x4b55aa,{'journeyDefToRequest':_0x31dde1,'activationDefToCreateRequest':_0x38e864,'yamlRuleToApi':_0x314e20,'validateSegmentRule':_0x5de888});for(const [_0x18eb40,_0x3be80f]of _0x2ab7fb['embeddedSegmentNameToId']){_0x99e9fe[_0xeefac5(0x110)](_0x18eb40,_0x3be80f),_0x2ae2a8[_0xeefac5(0xa7)][_0xeefac5(0x110)](_0x18eb40,_0x3be80f);}if(_0x2ab7fb[_0xeefac5(0x15b)]===_0xeefac5(0xd5))_0x4b55aa[_0xeefac5(0x96)]?.({'type':_0xeefac5(0xb3),'name':_0x3c21f8[_0xeefac5(0x103)]['name'],'journeyId':_0x2ab7fb['journeyId']}),_0x4b55aa[_0xeefac5(0x14f)]?.(_0xeefac5(0x168)+_0x3c21f8[_0xeefac5(0x103)][_0xeefac5(0x10f)]+'\x27'),_0x2ae2a8['created']++;else _0x2ab7fb['action']===_0xeefac5(0x104)&&(_0x4b55aa['onProgress']?.({'type':_0xeefac5(0x149),'name':_0x3c21f8['yamlConfig'][_0xeefac5(0x10f)]}),_0x4b55aa[_0xeefac5(0x14f)]?.(_0xeefac5(0x14a)+_0x3c21f8[_0xeefac5(0x103)][_0xeefac5(0x10f)]+'\x27'),_0x2ae2a8['updated']++);return{'action':_0x2ab7fb[_0xeefac5(0x15b)],'name':_0x3c21f8[_0xeefac5(0x103)][_0xeefac5(0x10f)],'journeyId':_0x2ab7fb[_0xeefac5(0x117)]};}catch(_0x4f9f09){const _0x2600b2=isHttp400Error(_0x4f9f09),_0x13e73f=_0x2600b2?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0xeefac5(0x143)],_0x3eb229=getErrorMessage(_0x4f9f09);throw new SDKError(_0x13e73f,'Failed\x20to\x20'+(_0x3c21f8['isNew']?_0xeefac5(0x141):'update')+_0xeefac5(0x12b)+_0x3c21f8[_0xeefac5(0xde)]+'\x0a\x20\x20'+_0x3eb229,_0x4f9f09);}}));_0x2ae2a8[_0x209b65(0xfa)][_0x209b65(0x148)](..._0xc6a78d);}return _0x2ae2a8;}async function executeSingleJourneyPush(_0x2d2f2a,_0x2e9484,_0x3c13cc,_0x4763ea,_0x2aa514,_0x31bf12){const _0x646193=a115_0x1d8f82,{journeyDefToRequest:_0x1cff8b,activationDefToCreateRequest:_0x1bbcbc,yamlRuleToApi:_0x1dd644,validateSegmentRule:_0x448d8f}=_0x31bf12,_0x54317f=new Map(),_0x5e0c76=new Map(),_0x1f1d06=new Map(),_0x468e29=new Map(),_0xa4eebb=new Map();let _0x218b59;const _0x4adaf6=async()=>{const _0x56d1a8=a115_0x63bb;if(_0x218b59)return;_0x218b59=new Map();if(!_0x2e9484[_0x56d1a8(0xa6)])return;const _0x90308b=await _0x2d2f2a[_0x56d1a8(0xa1)][_0x56d1a8(0xf9)](_0x2e9484[_0x56d1a8(0xa6)]['id']);for(const _0x486e4e of _0x90308b){const _0x50f417=journeyActivationStepToYaml(_0x486e4e,_0x3c13cc[_0x56d1a8(0xab)],_0x3c13cc[_0x56d1a8(0xcf)]),_0x1652d6=activationSignature(_0x50f417);!_0x218b59[_0x56d1a8(0x13f)](_0x1652d6)&&_0x218b59[_0x56d1a8(0x110)](_0x1652d6,_0x486e4e['id']),_0x50f417[_0x56d1a8(0x10f)]&&_0x5e0c76[_0x56d1a8(0x110)](_0x50f417[_0x56d1a8(0x10f)],_0x486e4e['id']);}};if(_0x2e9484['existingJourney']&&_0x2e9484[_0x646193(0x103)]['segments']){const _0x4bb713=buildLocalExpandedRuleMappings(_0x2e9484[_0x646193(0x103)]),_0x5a1670=_0x4bb713[_0x646193(0x8f)];if(_0x5a1670[_0x646193(0xad)]>0x0){const _0x38ecbb=new Map();for(const [_0x19cb22,_0x45ef0f]of _0x5a1670){const _0x2fad29=serializeExpandedRule(_0x45ef0f,_0x5a1670);_0x38ecbb[_0x646193(0x110)](_0x19cb22,_0x2fad29);}const _0x48ddca=collectSegmentIdsFromJourneyApi(_0x2e9484['existingJourney']);if(_0x48ddca[_0x646193(0xad)]>0x0){const _0x9aee3d=await buildServerSegmentRuleMap(_0x2d2f2a,_0x4763ea[_0x646193(0xe1)],_0x3c13cc[_0x646193(0xc7)],_0x48ddca);if(_0x9aee3d[_0x646193(0xad)]>0x0){const _0x5e91f8=new Map();for(const [_0x3c625f,_0x29655e]of _0x9aee3d){const _0xecc921=serializeExpandedRule(_0x29655e,_0x9aee3d);!_0x5e91f8[_0x646193(0x13f)](_0xecc921)&&_0x5e91f8['set'](_0xecc921,_0x3c625f);}for(const [_0x31e3c0,_0x2539dd]of _0x38ecbb){const _0x4cfbe9=_0x5e91f8[_0x646193(0x105)](_0x2539dd);_0x4cfbe9&&(_0xa4eebb['set'](_0x31e3c0,_0x4cfbe9),_0x3c13cc[_0x646193(0xa9)][_0x646193(0x110)](_0x31e3c0,_0x4cfbe9));}}}}}const _0x403fea={'resolveSegmentId':async _0x3841d3=>{const _0xaa217e=_0x646193,_0x2c2aa4=_0x3c13cc['segmentNameToId']['get'](_0x3841d3);if(!_0x2c2aa4)throw new SDKError(ErrorCode[_0xaa217e(0x159)],'Segment\x20not\x20found:\x20'+_0x3841d3+'\x20(referenced\x20in\x20journey\x20'+_0x2e9484[_0xaa217e(0x103)][_0xaa217e(0x10f)]+')');return _0x2c2aa4;},'resolveEmbeddedSegmentId':async(_0x15c59b,_0x5994ab)=>{const _0x24d83d=_0x646193,_0x3114db=_0x3c13cc[_0x24d83d(0xa9)][_0x24d83d(0x105)](_0x15c59b);if(_0x3114db)return _0x3114db;const _0x3e98c7=_0xa4eebb['get'](_0x15c59b);if(_0x3e98c7)return _0x3c13cc['segmentNameToId'][_0x24d83d(0x110)](_0x15c59b,_0x3e98c7),_0x3e98c7;const _0x2a878e=_0x3c13cc[_0x24d83d(0xc7)][_0x24d83d(0xe3)](_0x55241f=>_0x55241f[_0x24d83d(0x10f)]===_0x15c59b);if(_0x2a878e)return _0x3c13cc[_0x24d83d(0xa9)][_0x24d83d(0x110)](_0x15c59b,_0x2a878e['id']),_0x2a878e['id'];if(_0x2e9484[_0x24d83d(0x129)]){const {stageName:_0x12153b,criteriaName:_0x69f734}=findSegmentCriteriaLocation(_0x2e9484[_0x24d83d(0x103)],_0x15c59b);return _0x448d8f(_0x15c59b,_0x5994ab[_0x24d83d(0xdf)]),_0x1f1d06[_0x24d83d(0x110)](_0x15c59b,{'definition':_0x5994ab,'stageName':_0x12153b,'criteriaName':_0x69f734}),createPendingSegmentId(_0x15c59b);}const _0x57d070=_0x2e9484[_0x24d83d(0xa6)]?.['id'];if(!_0x57d070)throw new SDKError(ErrorCode[_0x24d83d(0x10b)],_0x24d83d(0x132));_0x448d8f(_0x15c59b,_0x5994ab[_0x24d83d(0xdf)]);const _0x53b9e8=generateDeterministicJourneySegmentName(_0x2e9484[_0x24d83d(0x103)][_0x24d83d(0x10f)],_0x15c59b),_0x10c5fd=_0x3c13cc[_0x24d83d(0xc7)][_0x24d83d(0xe3)](_0x5d488c=>_0x5d488c['name']===_0x53b9e8),_0x5f1c9f=createSegmentIdResolver(_0x3c13cc[_0x24d83d(0xa9)],_0x15c59b),_0x530735=await resolveRuleSegmentIds(_0x5994ab[_0x24d83d(0xdf)],_0x5f1c9f);let _0xf16ab8;if(_0x10c5fd)await _0x2d2f2a[_0x24d83d(0xdb)]['updateSegmentById'](_0x4763ea['parentId'],_0x10c5fd['id'],{'description':_0x5994ab['description']||_0x24d83d(0x167)+_0x15c59b,'rule':_0x1dd644(_0x530735,!![]),'countPopulation':!![]}),_0xf16ab8=_0x10c5fd['id'];else try{_0xf16ab8=await _0x2d2f2a['segment'][_0x24d83d(0x12c)]({'name':_0x53b9e8,'description':_0x5994ab[_0x24d83d(0x106)]||_0x24d83d(0x167)+_0x15c59b,'journeyId':_0x57d070,'rule':_0x1dd644(_0x530735,!![]),'countPopulation':!![],'parentFolderId':_0x4763ea[_0x24d83d(0xb6)]||'','audienceId':_0x4763ea[_0x24d83d(0xe1)]});}catch(_0x98d652){const _0x1a776e=_0x98d652 instanceof Error&&_0x98d652[_0x24d83d(0xf1)]['includes'](_0x24d83d(0xd6));if(_0x1a776e){const _0x166b7f=await _0x2d2f2a[_0x24d83d(0xdb)]['listSegments'](_0x4763ea[_0x24d83d(0xe1)]),_0x269ae9=_0x166b7f[_0x24d83d(0xe3)](_0x283372=>_0x283372[_0x24d83d(0x10f)]===_0x53b9e8);if(_0x269ae9)await _0x2d2f2a[_0x24d83d(0xdb)][_0x24d83d(0x151)](_0x4763ea[_0x24d83d(0xe1)],_0x269ae9['id'],{'description':_0x5994ab[_0x24d83d(0x106)]||'Entry\x20criteria:\x20'+_0x15c59b,'rule':_0x1dd644(_0x530735,!![]),'countPopulation':!![]}),_0xf16ab8=_0x269ae9['id'];else throw _0x98d652;}else throw _0x98d652;}return _0x3c13cc[_0x24d83d(0xa9)]['set'](_0x15c59b,_0xf16ab8),_0x54317f['set'](_0x15c59b,_0xf16ab8),_0xf16ab8;},'resolveActivationId':async _0x41b062=>{const _0x4dbb0b=_0x646193,_0x5be04b=_0x5e0c76['get'](_0x41b062);if(_0x5be04b)return _0x5be04b;if(_0x2e9484[_0x4dbb0b(0xa6)]){await _0x4adaf6();const _0x1cdd15=_0x5e0c76[_0x4dbb0b(0x105)](_0x41b062);if(_0x1cdd15)return _0x1cdd15;}throw new SDKError(ErrorCode[_0x4dbb0b(0xc5)],_0x4dbb0b(0xf2)+_0x41b062+_0x4dbb0b(0xb5)+_0x2e9484[_0x4dbb0b(0x103)][_0x4dbb0b(0x10f)]+_0x4dbb0b(0x93)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x3825cf,_0x397ce2)=>{const _0x4d969a=_0x646193,_0x11c1e7=_0x5e0c76[_0x4d969a(0x105)](_0x3825cf);if(_0x11c1e7)return _0x11c1e7;if(_0x2e9484[_0x4d969a(0x129)])return _0x468e29[_0x4d969a(0x110)](_0x3825cf,_0x397ce2),createPendingActivationId(_0x3825cf);if(_0x2e9484['existingJourney']){await _0x4adaf6();const _0x4bb9e2=_0x5e0c76[_0x4d969a(0x105)](_0x397ce2[_0x4d969a(0x10f)]);if(_0x4bb9e2)return _0x5e0c76[_0x4d969a(0x110)](_0x3825cf,_0x4bb9e2),_0x4bb9e2;const _0x1c3060=activationSignature(_0x397ce2),_0x4bac85=_0x218b59?.[_0x4d969a(0x105)](_0x1c3060);if(_0x4bac85)return _0x5e0c76[_0x4d969a(0x110)](_0x3825cf,_0x4bac85),_0x4bac85;const _0x19f4c1=await _0x1bbcbc(_0x397ce2,_0x3c13cc['activationContext']),_0x270a8c=await _0x2d2f2a[_0x4d969a(0xa1)]['createActivation'](_0x2e9484[_0x4d969a(0xa6)]['id'],_0x19f4c1);return _0x5e0c76[_0x4d969a(0x110)](_0x3825cf,_0x270a8c['id']),_0x270a8c['id'];}throw new SDKError(ErrorCode[_0x4d969a(0x10b)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x396da9=>{const _0x360b60=_0x646193;try{return await _0x2d2f2a['journey'][_0x360b60(0x11b)](_0x4763ea[_0x360b60(0xe1)],_0x396da9);}catch(_0x2bdb5c){throw new SDKError(ErrorCode['NOT_FOUND'],_0x360b60(0x15d)+_0x396da9+_0x360b60(0x108)+_0x2e9484[_0x360b60(0x103)][_0x360b60(0x10f)]+'\x27)',_0x2bdb5c);}},'resolveStageId':async(_0x46cc7a,_0x31a412)=>{const _0x5e6605=_0x646193,_0x569e05=await _0x2d2f2a[_0x5e6605(0xa1)][_0x5e6605(0x8d)](_0x46cc7a),_0x43e864=_0x569e05[_0x5e6605(0x146)]['journeyStages'][_0x5e6605(0xe3)](_0xb1b593=>_0xb1b593[_0x5e6605(0x10f)][_0x5e6605(0x107)]()===_0x31a412[_0x5e6605(0x107)]());if(!_0x43e864?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x5e6605(0xa8)+_0x31a412+_0x5e6605(0x11c)+(_0x569e05['attributes'][_0x5e6605(0xee)]||_0x569e05['attributes']['name'])+'\x27');return _0x43e864['id'];}},_0x5e6e3a=await _0x1cff8b(_0x2e9484[_0x646193(0x103)],_0x4763ea[_0x646193(0xe1)],_0x403fea),_0x381182=_0x4763ea[_0x646193(0x98)]||_0x4763ea[_0x646193(0xb6)];_0x381182&&(_0x5e6e3a[_0x646193(0xe2)]={'parentFolder':{'data':{'id':_0x381182,'type':'folder'}}});if(_0x2e9484[_0x646193(0x129)]){if(_0x1f1d06[_0x646193(0xad)]>0x0||_0x468e29[_0x646193(0xad)]>0x0)return await executeThreeStepJourneyCreate(_0x2d2f2a,_0x2e9484,_0x5e6e3a,{'pendingEmbeddedSegments':_0x1f1d06,'pendingEmbeddedActivations':_0x468e29,'embeddedSegmentNameToId':_0x54317f,'journeyActivationNameToId':_0x5e0c76},{..._0x4763ea,'effectiveFolderId':_0x381182},_0x3c13cc,_0x2aa514,_0x31bf12);else{ensureJourneyDefaults(_0x5e6e3a[_0x646193(0x146)]);const _0x44e261=await _0x2d2f2a[_0x646193(0xa1)][_0x646193(0x141)](_0x5e6e3a);return{'action':'created','journeyId':_0x44e261['id'],'embeddedSegmentNameToId':_0x54317f};}}else{if(_0x2e9484[_0x646193(0x8c)]&&_0x2e9484['existingJourney'])return ensureJourneyDefaults(_0x5e6e3a['attributes']),await _0x2d2f2a['journey']['update'](_0x2e9484[_0x646193(0xa6)]['id'],_0x5e6e3a),{'action':_0x646193(0x104),'journeyId':_0x2e9484[_0x646193(0xa6)]['id'],'embeddedSegmentNameToId':_0x54317f};}return{'action':_0x646193(0xaf),'journeyId':_0x2e9484[_0x646193(0xa6)]?.['id'],'embeddedSegmentNameToId':_0x54317f};}function findSegmentCriteriaLocation(_0x51f535,_0x3f3b90){const _0x580810=a115_0x1d8f82,_0x228da3=_0x51f535[_0x580810(0xef)]||_0x51f535[_0x580810(0xd4)]?.[0x0]?.['stages']||[];let _0x4cf5d3=_0x580810(0x9f),_0x4f4416=_0x3f3b90;const _0x3de9c3=_0x51f535[_0x580810(0x100)]||_0x51f535[_0x580810(0xd4)]?.[0x0]?.[_0x580810(0x100)];if(_0x3de9c3?.['segment']===_0x3f3b90)return{'stageName':_0x580810(0x100),'criteriaName':_0x3de9c3['name']||_0x3f3b90};_0x409c32:for(const _0x109787 of _0x228da3){if(_0x109787[_0x580810(0xa2)]?.[_0x580810(0xdb)]===_0x3f3b90){_0x4cf5d3=_0x109787[_0x580810(0x10f)],_0x4f4416=_0x109787[_0x580810(0xa2)][_0x580810(0x10f)]||_0x3f3b90;break;}if(_0x109787['steps'])for(const _0x56f093 of _0x109787['steps']){if(_0x56f093[_0x580810(0x8b)]===_0x580810(0x9b)&&_0x56f093[_0x580810(0x161)]?.[_0x580810(0xa0)])for(const _0x27114b of _0x56f093[_0x580810(0x161)][_0x580810(0xa0)]){if(_0x27114b[_0x580810(0xdb)]===_0x3f3b90){_0x4cf5d3=_0x109787[_0x580810(0x10f)],_0x4f4416=_0x27114b[_0x580810(0x10f)]||_0x3f3b90;break _0x409c32;}}}}return{'stageName':_0x4cf5d3,'criteriaName':_0x4f4416};}async function executeThreeStepJourneyCreate(_0x12858f,_0x49eb72,_0x1d99db,_0xe3b46f,_0x459659,_0x58b23f,_0x389d4f,_0x2f7d5b){const _0x160a00=a115_0x1d8f82,{activationDefToCreateRequest:_0x46e74a,yamlRuleToApi:_0x1213a3}=_0x2f7d5b,{pendingEmbeddedSegments:_0x17cc54,pendingEmbeddedActivations:_0x5628e6,embeddedSegmentNameToId:_0x5e0f9e}=_0xe3b46f,_0x96fa59=JSON[_0x160a00(0x9e)](JSON[_0x160a00(0xf5)](_0x1d99db));ensureJourneyDefaults(_0x96fa59[_0x160a00(0x146)]),stripPendingIds(_0x96fa59);const _0x1daf92=await _0x12858f[_0x160a00(0xa1)]['create'](_0x96fa59),_0x24df5f=_0x1daf92['id'],_0x49f474=new Map();for(const _0x93ac5f of _0x1daf92[_0x160a00(0x146)][_0x160a00(0x118)]){_0x49f474[_0x160a00(0x110)](_0x93ac5f[_0x160a00(0x10f)][_0x160a00(0x107)](),_0x93ac5f['id']);}for(const [_0x441559,{definition:_0x1b85e3}]of _0x17cc54){const _0x258fd0=generateDeterministicJourneySegmentName(_0x49eb72[_0x160a00(0x103)]['name'],_0x441559);_0x389d4f[_0x160a00(0x96)]?.({'type':_0x160a00(0xb1),'journeyName':_0x49eb72[_0x160a00(0x103)][_0x160a00(0x10f)],'segmentName':_0x441559});const _0x1bdf09=createSegmentIdResolver(_0x58b23f['segmentNameToId'],_0x441559),_0x424dcb=await resolveRuleSegmentIds(_0x1b85e3[_0x160a00(0xdf)],_0x1bdf09),_0x5274ca=await _0x12858f[_0x160a00(0xdb)][_0x160a00(0x12c)]({'name':_0x258fd0,'description':_0x1b85e3[_0x160a00(0x106)]||'Entry\x20criteria:\x20'+_0x441559,'journeyId':_0x24df5f,'rule':_0x1213a3(_0x424dcb,!![]),'countPopulation':!![],'parentFolderId':_0x459659[_0x160a00(0x14c)]||'','audienceId':_0x459659[_0x160a00(0xe1)]});_0x5e0f9e[_0x160a00(0x110)](_0x441559,_0x5274ca),_0x58b23f['segmentNameToId'][_0x160a00(0x110)](_0x441559,_0x5274ca),_0x389d4f[_0x160a00(0x96)]?.({'type':_0x160a00(0x9d),'journeyName':_0x49eb72[_0x160a00(0x103)]['name'],'segmentName':_0x441559});}const _0x209d66=new Map();for(const [_0x4a6fe3,_0x55ee2f]of _0x5628e6){_0x389d4f[_0x160a00(0x96)]?.({'type':_0x160a00(0x123),'journeyName':_0x49eb72[_0x160a00(0x103)][_0x160a00(0x10f)],'activationName':_0x4a6fe3});const _0x40b5a8=await _0x46e74a(_0x55ee2f,_0x58b23f[_0x160a00(0xce)]),_0x577a2b=await _0x12858f[_0x160a00(0xa1)]['createActivation'](_0x24df5f,_0x40b5a8);_0x209d66[_0x160a00(0x110)](_0x4a6fe3,_0x577a2b['id']),_0xe3b46f['journeyActivationNameToId'][_0x160a00(0x110)](_0x4a6fe3,_0x577a2b['id']),_0x389d4f[_0x160a00(0x96)]?.({'type':_0x160a00(0xff),'journeyName':_0x49eb72[_0x160a00(0x103)][_0x160a00(0x10f)],'activationName':_0x4a6fe3});}const _0x4d6621=JSON['parse'](JSON['stringify'](_0x1d99db));return _0x4d6621['id']=_0x24df5f,ensureJourneyDefaults(_0x4d6621[_0x160a00(0x146)]),resolvePendingIdsInRequest(_0x4d6621,_0x1d99db,_0x49f474,_0x5e0f9e,_0x209d66,_0x389d4f),await _0x12858f[_0x160a00(0xa1)][_0x160a00(0x97)](_0x24df5f,_0x4d6621),{'action':_0x160a00(0xd5),'journeyId':_0x24df5f,'embeddedSegmentNameToId':_0x5e0f9e};}function stripPendingIds(_0x5ec209){const _0x50df4c=a115_0x1d8f82;for(const _0x510b46 of _0x5ec209[_0x50df4c(0x146)][_0x50df4c(0x118)]||[]){_0x510b46[_0x50df4c(0xd3)]?.[_0x50df4c(0x13b)]&&isPendingSegmentId(_0x510b46[_0x50df4c(0xd3)][_0x50df4c(0x13b)])&&delete _0x510b46['entryCriteria'];if(_0x510b46[_0x50df4c(0x136)])for(const _0x1504c5 of Object[_0x50df4c(0x15a)](_0x510b46['steps'])){const _0x53d8ef=_0x510b46[_0x50df4c(0x136)][_0x1504c5];_0x53d8ef[_0x50df4c(0x8b)]==='Activation'&&_0x53d8ef[_0x50df4c(0xb8)]&&isPendingActivationId(_0x53d8ef[_0x50df4c(0xb8)])&&(_0x53d8ef[_0x50df4c(0xb8)]='');if(_0x53d8ef[_0x50df4c(0x8b)]===_0x50df4c(0xd9)&&_0x53d8ef[_0x50df4c(0xa0)])for(const _0x43315b of _0x53d8ef[_0x50df4c(0xa0)]){_0x43315b[_0x50df4c(0x13b)]&&isPendingSegmentId(_0x43315b['segmentId'])&&(_0x43315b[_0x50df4c(0x13b)]='');}_0x53d8ef[_0x50df4c(0x8b)]===_0x50df4c(0x138)&&_0x53d8ef[_0x50df4c(0x166)]?.[_0x50df4c(0x13b)]&&isPendingSegmentId(_0x53d8ef['waitCondition']['segmentId'])&&(_0x53d8ef['waitCondition'][_0x50df4c(0x13b)]='');}}}function resolvePendingIdsInRequest(_0x22977b,_0x56c224,_0x1b0eae,_0x3e77d7,_0x126fb9,_0x70a908){const _0x3ecde6=a115_0x1d8f82,_0x569c47=(_0x301fee,_0x4eae02)=>{const _0x99950c=a115_0x63bb;if(!isPendingSegmentId(_0x301fee))return _0x301fee;const _0x4a7fbd=extractPendingSegmentName(_0x301fee),_0x2be6aa=_0x3e77d7[_0x99950c(0x105)](_0x4a7fbd);return!_0x2be6aa&&_0x70a908[_0x99950c(0xcd)]?.(_0x99950c(0x13e)+_0x4a7fbd+_0x99950c(0x10d)+_0x4eae02),_0x2be6aa;};if(_0x22977b[_0x3ecde6(0x146)][_0x3ecde6(0x100)]?.[_0x3ecde6(0x13b)]&&isPendingSegmentId(_0x22977b[_0x3ecde6(0x146)][_0x3ecde6(0x100)][_0x3ecde6(0x13b)])){const _0x2cdd97=_0x569c47(_0x22977b[_0x3ecde6(0x146)][_0x3ecde6(0x100)][_0x3ecde6(0x13b)],'goal\x20criteria');_0x2cdd97&&(_0x22977b[_0x3ecde6(0x146)]['goal'][_0x3ecde6(0x13b)]=_0x2cdd97);}for(const _0x58f2fc of _0x22977b[_0x3ecde6(0x146)][_0x3ecde6(0x118)]||[]){const _0x22360f=_0x1b0eae[_0x3ecde6(0x105)](_0x58f2fc['name'][_0x3ecde6(0x107)]());_0x22360f&&(_0x58f2fc['id']=_0x22360f);if(_0x58f2fc['entryCriteria']?.[_0x3ecde6(0x13b)]&&isPendingSegmentId(_0x58f2fc['entryCriteria'][_0x3ecde6(0x13b)])){const _0x13521a=_0x569c47(_0x58f2fc[_0x3ecde6(0xd3)][_0x3ecde6(0x13b)],_0x3ecde6(0x116)+_0x58f2fc[_0x3ecde6(0x10f)]+_0x3ecde6(0xe0));_0x13521a&&(_0x58f2fc[_0x3ecde6(0xd3)]['segmentId']=_0x13521a);}if(_0x58f2fc[_0x3ecde6(0x90)])for(const _0x37d008 of _0x58f2fc['exitCriterias']){if(_0x37d008[_0x3ecde6(0x13b)]&&isPendingSegmentId(_0x37d008[_0x3ecde6(0x13b)])){const _0x32b244=_0x569c47(_0x37d008['segmentId'],_0x3ecde6(0x116)+_0x58f2fc[_0x3ecde6(0x10f)]+'\x27\x20exit\x20criteria');_0x32b244&&(_0x37d008[_0x3ecde6(0x13b)]=_0x32b244);}}if(_0x58f2fc[_0x3ecde6(0xc1)]?.[_0x3ecde6(0x13b)]&&isPendingSegmentId(_0x58f2fc[_0x3ecde6(0xc1)][_0x3ecde6(0x13b)])){const _0x813895=_0x569c47(_0x58f2fc[_0x3ecde6(0xc1)][_0x3ecde6(0x13b)],_0x3ecde6(0x116)+_0x58f2fc['name']+_0x3ecde6(0x142));_0x813895&&(_0x58f2fc[_0x3ecde6(0xc1)][_0x3ecde6(0x13b)]=_0x813895);}if(_0x58f2fc['steps']){const _0x6a4646=_0x560da2=>_0x56c224['attributes']['journeyStages'][_0x3ecde6(0xe3)](_0x153910=>_0x153910[_0x3ecde6(0x10f)][_0x3ecde6(0x107)]()===_0x58f2fc[_0x3ecde6(0x10f)][_0x3ecde6(0x107)]())?.['steps']?.[_0x560da2];for(const _0x5e2c6c of Object[_0x3ecde6(0x15a)](_0x58f2fc[_0x3ecde6(0x136)])){const _0x1b329c=_0x58f2fc[_0x3ecde6(0x136)][_0x5e2c6c],_0x656ce2=_0x6a4646(_0x5e2c6c);if(_0x1b329c['type']===_0x3ecde6(0x99)&&_0x1b329c[_0x3ecde6(0xb8)]&&(isPendingActivationId(_0x1b329c['journeyActivationStepId'])||_0x1b329c[_0x3ecde6(0xb8)]==='')){if(_0x656ce2?.[_0x3ecde6(0xb8)]&&isPendingActivationId(_0x656ce2[_0x3ecde6(0xb8)])){const _0x2f99ef=extractPendingActivationName(_0x656ce2[_0x3ecde6(0xb8)]),_0x19084c=_0x126fb9[_0x3ecde6(0x105)](_0x2f99ef);_0x19084c&&(_0x1b329c[_0x3ecde6(0xb8)]=_0x19084c);}}if(_0x1b329c[_0x3ecde6(0x8b)]===_0x3ecde6(0xd9)&&_0x1b329c[_0x3ecde6(0xa0)]&&_0x656ce2?.[_0x3ecde6(0xa0)])for(let _0x246317=0x0;_0x246317<_0x1b329c[_0x3ecde6(0xa0)][_0x3ecde6(0x156)];_0x246317++){const _0x1ac4a7=_0x1b329c['branches'][_0x246317],_0x2d99b7=_0x656ce2[_0x3ecde6(0xa0)][_0x246317];if(_0x2d99b7?.[_0x3ecde6(0x13b)]&&isPendingSegmentId(_0x2d99b7[_0x3ecde6(0x13b)])){const _0xd8894c=_0x569c47(_0x2d99b7[_0x3ecde6(0x13b)],'stage\x20\x27'+_0x58f2fc['name']+_0x3ecde6(0x127)+(_0x1ac4a7[_0x3ecde6(0x10f)]||_0x246317)+'\x27');_0xd8894c&&(_0x1ac4a7[_0x3ecde6(0x13b)]=_0xd8894c);}}if(_0x1b329c[_0x3ecde6(0x8b)]===_0x3ecde6(0x138)&&_0x1b329c[_0x3ecde6(0x166)]?.['segmentId']&&_0x656ce2?.[_0x3ecde6(0x166)]?.[_0x3ecde6(0x13b)]&&isPendingSegmentId(_0x656ce2[_0x3ecde6(0x166)]['segmentId'])){const _0x253479=_0x569c47(_0x656ce2[_0x3ecde6(0x166)][_0x3ecde6(0x13b)],_0x3ecde6(0x116)+_0x58f2fc[_0x3ecde6(0x10f)]+'\x27\x20wait\x20condition');_0x253479&&(_0x1b329c[_0x3ecde6(0x166)][_0x3ecde6(0x13b)]=_0x253479);}}}}}
|
|
1
|
+
const a115_0x30712b=a115_0x11f4;(function(_0x45113d,_0x22d279){const _0x4332f7=a115_0x11f4,_0x3a7e73=_0x45113d();while(!![]){try{const _0x56708c=parseInt(_0x4332f7(0x156))/0x1+-parseInt(_0x4332f7(0x19a))/0x2+-parseInt(_0x4332f7(0x115))/0x3+-parseInt(_0x4332f7(0x1ab))/0x4*(parseInt(_0x4332f7(0x198))/0x5)+-parseInt(_0x4332f7(0x194))/0x6+-parseInt(_0x4332f7(0x162))/0x7+-parseInt(_0x4332f7(0x126))/0x8*(-parseInt(_0x4332f7(0x1b7))/0x9);if(_0x56708c===_0x22d279)break;else _0x3a7e73['push'](_0x3a7e73['shift']());}catch(_0xdcb708){_0x3a7e73['push'](_0x3a7e73['shift']());}}}(a115_0x4e14,0x393de));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a115_0x30712b(0x148);export const PENDING_ACTIVATION_PREFIX=a115_0x30712b(0xf8);export function createPendingSegmentId(_0x81dd26){return''+PENDING_SEGMENT_PREFIX+_0x81dd26+'__';}export function isPendingSegmentId(_0x34a438){const _0x31be80=a115_0x30712b;return _0x34a438[_0x31be80(0x173)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x97badd){return _0x97badd['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x172853){return''+PENDING_ACTIVATION_PREFIX+_0x172853+'__';}export function isPendingActivationId(_0x7dfa8f){return _0x7dfa8f['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x261ece){const _0x153a0e=a115_0x30712b;return _0x261ece[_0x153a0e(0x15a)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x3a0ff4,_0x3426ae){const _0x4c21d1=a115_0x30712b,_0x1da032=_0x3a0ff4+'::'+(_0x3426ae['trim']()||_0x4c21d1(0x14c)),_0x4dee35=createHash(_0x4c21d1(0x189))['update'](_0x1da032)['digest'](_0x4c21d1(0x133))['slice'](0x0,0xc);return _0x4c21d1(0x167)+_0x4dee35;}export function ensureJourneyDefaults(_0xa7e5c7){const _0x155b30=a115_0x30712b;!_0xa7e5c7[_0x155b30(0x186)]&&(_0xa7e5c7[_0x155b30(0x186)]=''),!_0xa7e5c7[_0x155b30(0x166)]&&(_0xa7e5c7['state']=_0x155b30(0x177));}export function resolveTDFolderPath(_0xf175dd,_0x102084,_0x5d04bb){const _0x5effb2=a115_0x30712b;if(!_0x102084)return _0xf175dd;if(_0xf175dd===_0x5d04bb||_0xf175dd[_0x5effb2(0x173)](_0x5d04bb+'/'))return _0xf175dd;return _0xf175dd?_0x5d04bb+'/'+_0xf175dd:_0x5d04bb;}export function addFoldersToCreate(_0x1f4ef0,_0x54af93,_0x2aaf80){const _0x589650=a115_0x30712b;if(!_0x1f4ef0)return;if(_0x54af93[_0x589650(0x180)](_0x1f4ef0))return;const _0x27928a=_0x1f4ef0[_0x589650(0x14b)]('/');let _0x2094a6='';for(const _0xa8054f of _0x27928a){_0x2094a6=_0x2094a6?_0x2094a6+'/'+_0xa8054f:_0xa8054f,!_0x54af93[_0x589650(0x180)](_0x2094a6)&&_0x2aaf80[_0x589650(0x182)](_0x2094a6);}}import*as a115_0x4f86a5 from'yaml';import{readFileSync}from'fs';import a115_0x42bca9 from'path';import{isJourneyDef,parseYamlString as a115_0x5e7415,toYamlString as a115_0xd61c01,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';function a115_0x4e14(){const _0x3526b9=['waitCondition','milestone',').\x20','all','object','createSegment','absolutePath','hex','length','yamlActivation','list','parentFolder','parentId','behavior','get','getJourney','\x27\x20exit\x20criteria','updated','existingJourney','dirname','Fetching\x20','Updated\x20activation\x20\x27','Activation\x20not\x20found:\x20','updateSegmentById','created','Journey\x20\x27','buildUserMaps','includes','__pending_','validatedRequest','set','split','segment','\x27\x20not\x20found\x20in\x20journey\x20\x27','join','Stage\x20\x27','resolveSegment','segment_deleted','notification','idToName','deps','activationActions','213547bwGHQl','index','sort','values','replace','SEGMENT_UPDATE_ERROR','delete','createdSegmentId','segmentFolderId','\x27\x20milestone','progress','Segment\x20not\x20found:\x20','3039995dsUhCB','unchanged','Updating\x20segment\x20\x27','embedded_activation_creating','state','journey_entry_criteria_','Created\x20journey\x20\x27','columns','message','connectionIdToNameMap','filter','update','parseDocument','entryCriteria','WaitStep','activation_updating','Failed\x20to\x20','startsWith','embeddedSegmentNameToId','journeyById','ACTIVATION_SYNTAX_ERROR','draft','versionNumber','segmentByFolderAndName','existingSegment','user','localSegmentRules','parentSegmentFolder','journeys','name','has','embedded_activation_created','add','logDeleted','exitCriterias','\x20error(s)','description','existingActivation','attributes','sha1','branches','NOT_FOUND','nameToId','Deleted\x20segment\x20\x27','activations','stages','goal\x20criteria','journey_creating','relationships','journey_updating','312948GuJuSl','hasChanges','segment_deleting','journeyBundleName','17725PeiCwz','Entry\x20criteria:\x20','764912YjxiKW','SEGMENT_NOT_FOUND','folderId','size','\x27\x20from\x20file:\x20','activationStepsById','folder_creating','action','push','segment_created','segmentId','journey_updated','embedded_segment_created','map','null','stringify','\x0a\x20\x20','28yxRgDj','segmentNameToId','nameToType','Created\x20activation\x20\x27','segment_updating','goal','activation_creating','Activation','INTERNAL','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Updated\x20journey\x20\x27','DecisionPoint','9hJmwsp','create','connector_config','toString','all_columns','Created\x20folder\x20\x27','skipSegments','existingSegments','find','isNew','getActivation','./child-segment-yaml.js','activationContext','deleted','logSuccess','journeyStages','folderPath','diff','parse','yamlConfig','with','activationParams','Deleted\x20activation\x20\x27','journey','activation_created','data','\x27...','journeyId','type','\x27\x20decision\x20point\x20branch\x20\x27','__pending_act_','segment_updated','utf-8','valid','entry_criteria','reduce','deleteActivation','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','from','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','createActivation','onProgress','keys','createdSegmentIds','rule','\x20(referenced\x20in\x20journey\x20','SEGMENT_SYNTAX_ERROR','segments','fetchJourney','../../utils/async.js','decision_point','relative','folderPathToId','idToEmailMap','embedded_segment_creating','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','getSegment','createJourneySegment','rootFolderId','91308WyxroT','toLowerCase','journeyBundlesByFolderAndName','connection','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','withProgress','\x20journey\x20from\x20file:\x20','journeyActivationStepId','activation_updated','Created\x20segment\x20\x27','activation_deleting','max','kind','Name\x20has\x20already\x20been\x20taken','Creating\x20activation\x20\x27','ACTIVATION_UPDATE_ERROR','stage\x20\x27','7560520fddCmC','./journey-yaml.js','folder_created','item','listActivations','steps'];a115_0x4e14=function(){return _0x3526b9;};return a115_0x4e14();}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(_0x366ef5){const _0x1394c6=a115_0x30712b;if(Array['isArray'](_0x366ef5))return'['+_0x366ef5[_0x1394c6(0x1a7)](_0x164680=>stableStringify(_0x164680))['join'](',')+']';if(_0x366ef5&&typeof _0x366ef5===_0x1394c6(0x130)){const _0x21dd0e=_0x366ef5,_0x13d7ce=Object[_0x1394c6(0x104)](_0x21dd0e)[_0x1394c6(0x158)](),_0x415ff6=_0x13d7ce['map'](_0x1b3d4f=>'\x22'+_0x1b3d4f+'\x22:'+stableStringify(_0x21dd0e[_0x1b3d4f]));return'{'+_0x415ff6[_0x1394c6(0x14e)](',')+'}';}const _0x4ec9c8=JSON[_0x1394c6(0x1a9)](_0x366ef5);return _0x4ec9c8===undefined?_0x1394c6(0x1a8):_0x4ec9c8;}function activationSignature(_0x13b3bf){const _0x1192d9=a115_0x30712b,_0x4ae353={'connection':_0x13b3bf[_0x1192d9(0x118)],..._0x13b3bf[_0x1192d9(0x1bb)]!==undefined&&{'all_columns':_0x13b3bf[_0x1192d9(0x1bb)]},..._0x13b3bf[_0x1192d9(0x169)]!==undefined&&{'columns':_0x13b3bf[_0x1192d9(0x169)]},..._0x13b3bf[_0x1192d9(0x139)]!==undefined&&{'behavior':_0x13b3bf[_0x1192d9(0x139)]},..._0x13b3bf['schedule']!==undefined&&{'schedule':_0x13b3bf['schedule']},..._0x13b3bf[_0x1192d9(0x152)]!==undefined&&{'notification':_0x13b3bf[_0x1192d9(0x152)]},..._0x13b3bf[_0x1192d9(0x1b9)]!==undefined&&{'connector_config':_0x13b3bf[_0x1192d9(0x1b9)]},..._0x13b3bf['activation_template_id']!==undefined&&{'activation_template_id':_0x13b3bf['activation_template_id']}};return stableStringify(_0x4ae353);}export async function prepareSegmentFiles(_0x28441a,_0x4709c2,_0x1bf433,_0x55092a,_0x303fc2){const _0x104d1d=a115_0x30712b,{activationDefToCreateRequest:_0x4da11f}=await import(_0x104d1d(0x1c2)),_0x1d6394=[],_0x440ac2=new Set();for(const {yamlConfig:_0x1e9c66,folderPath:_0x43351e,sourcePath:_0x51e044}of _0x28441a){const _0x2efaeb=resolveTDFolderPath(_0x43351e,_0x55092a,_0x303fc2),_0x43cf06=_0x2efaeb+':'+_0x1e9c66[_0x104d1d(0x17f)],_0x37efa2=_0x4709c2[_0x104d1d(0x179)][_0x104d1d(0x13a)](_0x43cf06),_0x38804a=_0x37efa2?_0x4709c2['activationsBySegmentId']['get'](_0x37efa2['id'])||[]:[];addFoldersToCreate(_0x2efaeb,_0x4709c2[_0x104d1d(0x10e)],_0x440ac2);const _0x1e9b13=calculateActivationActions(_0x1e9c66[_0x104d1d(0x18e)]||[],_0x38804a,_0x4709c2[_0x104d1d(0x10f)],_0x4709c2['connectionIdToNameMap']);for(const _0x1d00f3 of _0x1e9b13){(_0x1d00f3[_0x104d1d(0xf6)]==='create'||_0x1d00f3[_0x104d1d(0xf6)]==='update')&&_0x1d00f3[_0x104d1d(0x135)]&&(_0x1d00f3[_0x104d1d(0x149)]=await _0x4da11f(_0x1d00f3[_0x104d1d(0x135)],_0x1bf433));}const _0x4d7516=calculateSegmentDiff(_0x1e9c66,_0x37efa2,_0x38804a,_0x4709c2[_0x104d1d(0x10f)],_0x4709c2[_0x104d1d(0x16b)]);_0x1d6394[_0x104d1d(0x1a2)]({'relativePath':_0x1e9c66[_0x104d1d(0x17f)],'absolutePath':_0x51e044,'yamlConfig':_0x1e9c66,'folderPath':_0x2efaeb,'existingSegment':_0x37efa2,'existingActivations':_0x38804a,'isNew':_0x4d7516[_0x104d1d(0x1c0)],'hasChanges':_0x4d7516[_0x104d1d(0x195)],'diff':_0x4d7516[_0x104d1d(0xeb)],'activationActions':_0x1e9b13});}return{'segmentFiles':_0x1d6394,'foldersToCreate':_0x440ac2};}export async function prepareJourneyFiles(_0x44cd08,_0x4bf4d4,_0x218589,_0x17156a){const _0x2489b9=a115_0x30712b,_0xb2e3b8=[],_0x5b12c8=new Set();for(const {yamlConfig:_0xd86061,folderPath:_0x223c89,sourcePath:_0xddcb63}of _0x44cd08){const _0x109ebb=resolveTDFolderPath(_0x223c89,_0x218589,_0x17156a),_0x294a4a=_0x109ebb+':'+_0xd86061[_0x2489b9(0x17f)],_0x36bd09=_0x4bf4d4[_0x2489b9(0x117)][_0x2489b9(0x13a)](_0x294a4a);let _0x3194fd,_0x361792;if(_0x36bd09&&_0x36bd09[_0x2489b9(0x134)]>0x0){const _0x2d7a94=buildLocalExpandedRuleMappings(_0xd86061),{createYamlContext:_0x47b42e,prefetchJourneySegments:_0x3df687}=createPushYamlContextForBundle(_0x4bf4d4[_0x2489b9(0x154)],_0x4bf4d4[_0x2489b9(0x138)],_0x4bf4d4[_0x2489b9(0x1be)],_0x2d7a94,_0x4bf4d4['idToEmailMap'],_0x4bf4d4['connectionIdToNameMap'],_0x4bf4d4[_0x2489b9(0x19f)],_0x4bf4d4[_0x2489b9(0x175)]);await _0x3df687(_0x36bd09[_0x2489b9(0x1a7)](_0x14fc05=>_0x14fc05['id']));const _0xf1c757=hasMultipleVersions(_0xd86061),_0x4a725a=async _0x122577=>{const _0x102071=_0x2489b9,_0x587911=_0x4bf4d4[_0x102071(0x175)]?.[_0x102071(0x13a)](_0x122577);if(_0x587911)return _0x587911;return _0x4bf4d4[_0x102071(0x10a)]({'journeyId':_0x122577,'journeyName':_0xd86061[_0x102071(0x17f)],'isMultiVersion':_0x36bd09[_0x102071(0x134)]>0x1});};if(_0xf1c757&&_0x36bd09[_0x2489b9(0x134)]>0x1){const _0x337d28=[];for(const _0x257c35 of _0x36bd09){const _0x26f8cf=_0x257c35['versionNumber']||0x1;_0x4bf4d4['progress']?.[_0x2489b9(0x16d)](_0x2489b9(0x140)+_0xd86061[_0x2489b9(0x17f)]+'\x20v'+_0x26f8cf);const _0x3e9691=await _0x4a725a(_0x257c35['id']),_0x31f6d6=_0x47b42e(_0x257c35['id']),_0x735c7a=await journeyResponseToDef(_0x3e9691,_0x31f6d6);_0x337d28['push']({'item':_0x257c35,'yaml':_0x735c7a});}const _0xa37747=buildLocalRuleToNameMappingFromJourney(_0xd86061);_0x361792=buildMergedJourneyDef(_0x337d28,_0xa37747);const _0x1f1a35=Math[_0x2489b9(0x120)](..._0x337d28[_0x2489b9(0x1a7)](_0x3fc691=>_0x3fc691[_0x2489b9(0x129)][_0x2489b9(0x178)]||0x0)),_0x2f22c0=_0x36bd09[_0x2489b9(0x1bf)](_0x544e9a=>(_0x544e9a[_0x2489b9(0x178)]||0x0)===_0x1f1a35);_0x2f22c0&&(_0x4bf4d4[_0x2489b9(0x160)]?.[_0x2489b9(0x16d)](_0x2489b9(0x140)+_0xd86061['name']+'\x20v'+_0x1f1a35),_0x3194fd=await _0x4a725a(_0x2f22c0['id']));}else{const _0xb40226=_0x36bd09[_0x36bd09[_0x2489b9(0x134)]-0x1];_0x4bf4d4[_0x2489b9(0x160)]?.[_0x2489b9(0x16d)](_0x2489b9(0x140)+_0xd86061[_0x2489b9(0x17f)]),_0x3194fd=await _0x4a725a(_0xb40226['id']);const _0x4962fb=_0x47b42e(_0xb40226['id']),_0x55b19f=await journeyResponseToDef(_0x3194fd,_0x4962fb),_0x4c4704=buildLocalRuleToNameMappingFromJourney(_0xd86061);_0x361792=buildMergedJourneyDef([{'item':_0xb40226,'yaml':_0x55b19f}],_0x4c4704);}}addFoldersToCreate(_0x109ebb,_0x4bf4d4[_0x2489b9(0x10e)],_0x5b12c8);const _0x2e0d21=calculateJourneyDiff(_0xd86061,_0x361792);_0xb2e3b8[_0x2489b9(0x1a2)]({'relativePath':_0xd86061[_0x2489b9(0x17f)],'absolutePath':_0xddcb63,'yamlConfig':_0xd86061,'folderPath':_0x109ebb,'existingJourney':_0x3194fd,'isNew':_0x2e0d21[_0x2489b9(0x1c0)],'hasChanges':_0x2e0d21[_0x2489b9(0x195)],'diff':_0x2e0d21[_0x2489b9(0xeb)]});}return{'journeyFiles':_0xb2e3b8,'foldersToCreate':_0x5b12c8};}export function calculateActivationActions(_0x1204e1,_0x512706,_0x21a5f4,_0x9145b6){const _0x2fa455=a115_0x30712b,_0x508251=[],_0x41cc30=new Map();for(const _0x2c4e91 of _0x512706){_0x41cc30[_0x2fa455(0x14a)](_0x2c4e91[_0x2fa455(0x17f)],_0x2c4e91);}const _0x5e1d7b=new Map();for(const _0x43ccab of _0x1204e1){_0x5e1d7b['set'](_0x43ccab[_0x2fa455(0x17f)],_0x43ccab);}for(const _0x1ed73e of _0x1204e1){const _0x3dc854=_0x41cc30['get'](_0x1ed73e[_0x2fa455(0x17f)]);if(!_0x3dc854)_0x508251[_0x2fa455(0x1a2)]({'type':_0x2fa455(0x1b8),'name':_0x1ed73e[_0x2fa455(0x17f)],'yamlActivation':_0x1ed73e});else{const _0x2100fd=activationResponseToDef(_0x3dc854,_0x21a5f4,_0x9145b6),_0x40eb62=a115_0x4f86a5[_0x2fa455(0x1a9)](_0x2100fd),_0x72b2c5=a115_0x4f86a5[_0x2fa455(0x1a9)](_0x1ed73e);_0x40eb62!==_0x72b2c5&&_0x508251[_0x2fa455(0x1a2)]({'type':_0x2fa455(0x16d),'name':_0x1ed73e['name'],'yamlActivation':_0x1ed73e,'existingActivation':_0x3dc854});}}for(const _0x12187e of _0x512706){!_0x5e1d7b['has'](_0x12187e[_0x2fa455(0x17f)])&&_0x508251['push']({'type':'delete','name':_0x12187e['name'],'existingActivation':_0x12187e});}return _0x508251;}export function calculateSegmentDiff(_0x4533f8,_0x547637,_0x59ffce,_0x4abcae,_0x2edb7b){const _0xbe9263=segmentToYamlString(_0x4533f8);if(_0x547637){const _0x276850=segmentWithActivationsToYaml(_0x547637,_0x59ffce,undefined,_0x4abcae,_0x2edb7b),_0x349402=segmentToYamlString(_0x276850),_0x452968=generateDiff(_0x349402,_0xbe9263),_0xadc3f6=hasChanges(_0x452968);return{'isNew':![],'hasChanges':_0xadc3f6,'diff':_0xadc3f6?formatDiffWithColors(_0x452968):undefined};}const _0x1c7311=generateDiff('',_0xbe9263);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1c7311)};}export function calculateJourneyDiff(_0x35f545,_0xb6e0aa){const _0xa44963=normalizeJourneyDef(_0x35f545,_0x35f545),_0x1965c8=a115_0xd61c01(_0xa44963);if(_0xb6e0aa){const _0x414e12=normalizeJourneyDef(_0xb6e0aa,_0x35f545),_0x5a269f=a115_0xd61c01(_0x414e12),_0xeef707=generateDiff(_0x5a269f,_0x1965c8),_0x40e6ca=hasChanges(_0xeef707);return{'isNew':![],'hasChanges':_0x40e6ca,'diff':_0x40e6ca?formatDiffWithColors(_0xeef707):undefined};}const _0x704180=generateDiff('',_0x1965c8);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x704180)};}export function findSegmentsToDelete(_0x1fecb2,_0x4d1737,_0x26898d,_0x49393d,_0x2d5a83){const _0x399b84=a115_0x30712b,_0x46f227=new Set();for(const {yamlConfig:_0x3f4144,folderPath:_0x238d4e}of _0x4d1737){_0x46f227[_0x399b84(0x182)](_0x238d4e+':'+_0x3f4144[_0x399b84(0x17f)]);}return _0x1fecb2[_0x399b84(0x16c)](_0x33b4e7=>{const _0x3c3742=_0x399b84,_0x44e478=_0x33b4e7[_0x3c3742(0x15e)]?_0x26898d[_0x3c3742(0x13a)](_0x33b4e7[_0x3c3742(0x15e)][_0x3c3742(0x1ba)]())||'':'',_0x30e4b5=_0x44e478+':'+_0x33b4e7[_0x3c3742(0x17f)];if(_0x46f227[_0x3c3742(0x180)](_0x30e4b5))return![];if(_0x2d5a83)return _0x44e478===_0x49393d||_0x44e478[_0x3c3742(0x173)](_0x49393d+'/');return!![];});}function a115_0x11f4(_0x5d9b59,_0x3918e6){_0x5d9b59=_0x5d9b59-0xea;const _0x4e14f4=a115_0x4e14();let _0x11f412=_0x4e14f4[_0x5d9b59];return _0x11f412;}export function findJourneysToDelete(_0x2d0be2,_0x42a71e,_0x5d1cb2,_0x9037af,_0xbc5c61){const _0x5c0db5=a115_0x30712b,_0x23ef72=new Set();for(const {yamlConfig:_0x281ad1,folderPath:_0x17632d}of _0x42a71e){_0x23ef72['add'](_0x17632d+':'+_0x281ad1['name']);}return _0x2d0be2[_0x5c0db5(0x16c)](_0x281d81=>{const _0x35761d=_0x5c0db5,_0x45cc51=_0x281d81[_0x35761d(0x19c)]?_0x5d1cb2[_0x35761d(0x13a)](_0x281d81[_0x35761d(0x19c)])||'':'',_0x34dd8a=_0x45cc51+':'+_0x281d81[_0x35761d(0x197)];if(_0x23ef72[_0x35761d(0x180)](_0x34dd8a))return![];if(_0xbc5c61)return _0x45cc51===_0x9037af||_0x45cc51[_0x35761d(0x173)](_0x9037af+'/');return!![];});}export function buildSegmentLookupMap(_0x278d99,_0x69df22){const _0x576e9c=a115_0x30712b,_0x4206a2=new Map();for(const _0x5410c2 of _0x278d99){const _0x54e8af=_0x5410c2[_0x576e9c(0x15e)]?_0x69df22[_0x576e9c(0x13a)](_0x5410c2['segmentFolderId'][_0x576e9c(0x1ba)]())||'':'',_0x289762=_0x54e8af+':'+_0x5410c2[_0x576e9c(0x17f)];_0x4206a2[_0x576e9c(0x14a)](_0x289762,_0x5410c2);}return _0x4206a2;}export function buildSegmentNameToIdMap(_0x51ca40){const _0x480cb9=a115_0x30712b,_0x457217=new Map();for(const _0x39c449 of _0x51ca40){_0x457217[_0x480cb9(0x14a)](_0x39c449[_0x480cb9(0x17f)],_0x39c449['id']);}return _0x457217;}export function buildJourneyBundleLookupMap(_0x3c837a,_0x44665a){const _0xa14999=a115_0x30712b,_0x763f78=new Map();for(const _0x4cd0fd of _0x3c837a){const _0x34eca4=_0x4cd0fd[_0xa14999(0x19c)]?_0x44665a['get'](_0x4cd0fd['folderId'])||'':'',_0x488443=_0x34eca4+':'+_0x4cd0fd[_0xa14999(0x197)];!_0x763f78[_0xa14999(0x180)](_0x488443)&&_0x763f78[_0xa14999(0x14a)](_0x488443,[]),_0x763f78['get'](_0x488443)[_0xa14999(0x1a2)](_0x4cd0fd);}for(const _0x343d46 of _0x763f78[_0xa14999(0x159)]()){_0x343d46[_0xa14999(0x158)]((_0x4bc1ba,_0x47c7a9)=>(_0x4bc1ba[_0xa14999(0x178)]||0x0)-(_0x47c7a9[_0xa14999(0x178)]||0x0));}return _0x763f78;}export function collectFoldersToCreate(_0x34c0af,_0x34156a){const _0x199147=a115_0x30712b,_0x586b54=new Set();for(const _0x444b14 of _0x34c0af){if(!_0x444b14)continue;if(_0x34156a[_0x199147(0x180)](_0x444b14))continue;const _0xefa661=_0x444b14[_0x199147(0x14b)]('/');let _0x512e49='';for(const _0xfe8be6 of _0xefa661){_0x512e49=_0x512e49?_0x512e49+'/'+_0xfe8be6:_0xfe8be6,!_0x34156a[_0x199147(0x180)](_0x512e49)&&_0x586b54[_0x199147(0x182)](_0x512e49);}}return _0x586b54;}export function parseAndClassifyYamlFiles(_0x11b07b,_0x4aad0c,_0x1046c9){const _0x2e362d=a115_0x30712b,_0x46d0a7=[],_0x6a187d=[];for(const _0x59cf17 of _0x11b07b){const _0x1312e3=a115_0x42bca9[_0x2e362d(0x10d)](_0x4aad0c,a115_0x42bca9[_0x2e362d(0x13f)](_0x59cf17)),_0x2a8beb=_0x1312e3==='.'?'':_0x1312e3,_0x1f72ac=readFileSync(_0x59cf17,'utf-8'),_0x5b5f48=a115_0x4f86a5[_0x2e362d(0xec)](_0x1f72ac);if(isJourneyDef(_0x5b5f48)){const _0x3bc959=a115_0x5e7415(_0x1f72ac);_0x6a187d[_0x2e362d(0x1a2)]({'yamlConfig':_0x3bc959,'folderPath':_0x2a8beb,'sourcePath':_0x59cf17});}else{if(!_0x1046c9?.[_0x2e362d(0x1bd)]){const _0x987275=parseSegmentYamlFile(_0x1f72ac),_0x30bf4e=normalizeChildSegmentYaml(_0x987275);_0x46d0a7['push']({'yamlConfig':_0x30bf4e,'folderPath':_0x2a8beb,'sourcePath':_0x59cf17});}}}return{'segments':_0x46d0a7,'journeys':_0x6a187d};}export function validateParsedFiles(_0x2f1462,_0xb16d6e){const _0x391661=a115_0x30712b,_0xbc2f02=[];for(const {yamlConfig:_0x52b894,sourcePath:_0x1d506d}of _0x2f1462[_0x391661(0x109)]){const _0x55ff83=readFileSync(_0x1d506d,'utf-8'),_0xce2d3f=a115_0x4f86a5[_0x391661(0x16e)](_0x55ff83),_0x267e2f=validateSegmentDef(_0x52b894,{'source':_0x55ff83,'document':_0xce2d3f});if(!_0x267e2f[_0x391661(0xfb)]){const _0x19ba52=a115_0x42bca9['relative'](_0xb16d6e,_0x1d506d);_0xbc2f02['push']({'filePath':_0x19ba52,'source':_0x55ff83,'result':_0x267e2f,'isJourney':![]});}}for(const {yamlConfig:_0x5e3852,sourcePath:_0x136103}of _0x2f1462['journeys']){const _0xaa40db=readFileSync(_0x136103,_0x391661(0xfa)),_0x2c4dd9=a115_0x4f86a5[_0x391661(0x16e)](_0xaa40db),_0x5325c9=validateJourneyDef(_0x5e3852,{'source':_0xaa40db,'document':_0x2c4dd9});if(!_0x5325c9[_0x391661(0xfb)]){const _0x48ab45=a115_0x42bca9['relative'](_0xb16d6e,_0x136103);_0xbc2f02[_0x391661(0x1a2)]({'filePath':_0x48ab45,'source':_0xaa40db,'result':_0x5325c9,'isJourney':!![]});}}return _0xbc2f02;}export function formatValidationErrors(_0x7f64b){const _0x59679a=a115_0x30712b,_0x42ab44=[];for(const {filePath:_0x5618f8,source:_0x25bb9d,result:_0x5daa7c,isJourney:_0x3f554e}of _0x7f64b){const _0x311482=_0x3f554e?'journey':_0x59679a(0x14c);_0x42ab44[_0x59679a(0x1a2)]('\x0a'+_0x5618f8+'\x20('+_0x311482+'):\x20'+_0x5daa7c['errors']['length']+_0x59679a(0x185)),_0x42ab44[_0x59679a(0x1a2)](formatValidationResult(_0x5daa7c,_0x25bb9d,_0x5618f8));}return _0x42ab44[_0x59679a(0x14e)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4f8681){const _0x3b8d91=a115_0x30712b,_0x9e9a2e=new Set(),_0x165061=new Map(),_0x429007=collectSegmentUsageCounts(_0x4f8681);if(_0x4f8681[_0x3b8d91(0x109)])for(const [_0x2ec15a,_0x268e8b]of Object['entries'](_0x4f8681[_0x3b8d91(0x109)])){_0x9e9a2e[_0x3b8d91(0x182)](_0x2ec15a);if(_0x268e8b['rule']){const _0x32a93b=yamlRuleToApi(_0x268e8b[_0x3b8d91(0x106)]),_0x515a68=apiRuleToYaml(_0x32a93b);_0x165061['set'](_0x2ec15a,_0x515a68);}}const _0x1683d2=new Map();let _0x2208c5=0x0;for(const [_0x325e53,_0x3f7cd4]of _0x165061){const _0x3971ea=serializeExpandedRule(_0x3f7cd4,_0x165061),_0x36f90c=_0x1683d2[_0x3b8d91(0x13a)](_0x3971ea)||[];_0x36f90c['push']({'name':_0x325e53,'index':_0x2208c5}),_0x1683d2[_0x3b8d91(0x14a)](_0x3971ea,_0x36f90c),_0x2208c5++;}const _0xa4b0e0=new Map();for(const [_0x1394f4,_0x3b9e1e]of _0x1683d2){const _0x2e8fb2=_0x3b9e1e['slice']()['sort']((_0x3dd450,_0x184b2b)=>{const _0x272a24=_0x3b8d91,_0x4cde9e=_0x429007[_0x272a24(0x13a)](_0x3dd450[_0x272a24(0x17f)])||0x0,_0x5439ca=_0x429007[_0x272a24(0x13a)](_0x184b2b[_0x272a24(0x17f)])||0x0;if(_0x4cde9e!==_0x5439ca)return _0x5439ca-_0x4cde9e;return _0x3dd450[_0x272a24(0x157)]-_0x184b2b[_0x272a24(0x157)];})[_0x3b8d91(0x1a7)](_0x298140=>_0x298140[_0x3b8d91(0x17f)]),_0x5d4654=[];for(const _0x2f0ca5 of _0x2e8fb2){const _0x52a754=_0x429007[_0x3b8d91(0x13a)](_0x2f0ca5)||0x0,_0x259092=Math[_0x3b8d91(0x120)](_0x52a754,0x1);for(let _0x23cb03=0x0;_0x23cb03<_0x259092;_0x23cb03++){_0x5d4654['push'](_0x2f0ca5);}}_0xa4b0e0['set'](_0x1394f4,_0x5d4654);}return{'existingLocalSegmentNames':_0x9e9a2e,'localSegmentRules':_0x165061,'localExpandedRuleToNames':_0xa4b0e0};}async function buildServerSegmentRuleMap(_0x41f314,_0x50aaa4,_0x5188f8,_0x19f64b){const _0x44010f=new Map(),_0xd7733b=new Set(),_0x49d423=async _0x5223f7=>{const _0x55cd61=a115_0x11f4;if(_0xd7733b[_0x55cd61(0x180)](_0x5223f7))return;_0xd7733b['add'](_0x5223f7);let _0x39bfb4=_0x5188f8['find'](_0x2d73c3=>_0x2d73c3['id']===_0x5223f7);if(!_0x39bfb4)try{_0x39bfb4=await _0x41f314['segment'][_0x55cd61(0x112)](_0x50aaa4,_0x5223f7);}catch{return;}if(!_0x39bfb4?.[_0x55cd61(0x106)])return;const _0x29f973=apiRuleToYaml(_0x39bfb4['rule']);_0x44010f[_0x55cd61(0x14a)](_0x5223f7,_0x29f973);const _0x335209=collectSegmentRefsFromRule(_0x29f973);for(const _0x25903c of _0x335209){await _0x49d423(_0x25903c);}};for(const _0x4ed483 of _0x19f64b){await _0x49d423(_0x4ed483);}return _0x44010f;}export function createSegmentIdResolver(_0x49d23d,_0x278eaf){return async _0x12bbeb=>{const _0x594ee6=a115_0x11f4,_0x19fef8=_0x49d23d[_0x594ee6(0x13a)](_0x12bbeb);if(!_0x19fef8)throw new SDKError(ErrorCode[_0x594ee6(0x19b)],_0x594ee6(0x161)+_0x12bbeb+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x278eaf+'\x27)');return _0x19fef8;};}export function extractRootFolderId(_0x366d74){const _0x37903c=a115_0x30712b;return _0x366d74[_0x37903c(0x192)]?.[_0x37903c(0x17d)]?.[_0x37903c(0xf3)]?.['id']||_0x366d74['relationships']?.[_0x37903c(0x137)]?.[_0x37903c(0xf3)]?.['id'];}export function buildConnectionMaps(_0x14efa7){const _0x3e24b4=a115_0x30712b,_0x3245cf=new Map(),_0x2e749b=new Map(),_0x143634=new Map();for(const _0x3cf81d of _0x14efa7){_0x3245cf[_0x3e24b4(0x14a)](_0x3cf81d[_0x3e24b4(0x17f)],parseInt(_0x3cf81d['id'],0xa)),_0x2e749b['set'](_0x3cf81d['id'],_0x3cf81d[_0x3e24b4(0x17f)]),_0x143634[_0x3e24b4(0x14a)](_0x3cf81d[_0x3e24b4(0x17f)],_0x3cf81d['type']);}return{'nameToId':_0x3245cf,'idToName':_0x2e749b,'nameToType':_0x143634};}export function calculatePushStats(_0x216cc0,_0x3b9b90,_0x1a509b,_0x4731d,_0x367711,_0x599dbc,_0x2e823d){const _0xabd75b=a115_0x30712b,_0x15f343=_0x216cc0[_0xabd75b(0x16c)](_0x243bbd=>_0x243bbd['isNew']),_0x5a0f13=_0x216cc0[_0xabd75b(0x16c)](_0x4f1ba9=>!_0x4f1ba9[_0xabd75b(0x1c0)]&&_0x4f1ba9[_0xabd75b(0x195)]),_0x557c7a=_0x216cc0[_0xabd75b(0x16c)](_0x1058ae=>!_0x1058ae[_0xabd75b(0x1c0)]&&!_0x1058ae[_0xabd75b(0x195)]),_0x381af2=_0x599dbc?_0x4731d:[],_0x4e3eac=_0x3b9b90[_0xabd75b(0x16c)](_0x3135de=>_0x3135de[_0xabd75b(0x1c0)]),_0x110356=_0x3b9b90[_0xabd75b(0x16c)](_0x37551f=>!_0x37551f[_0xabd75b(0x1c0)]&&_0x37551f[_0xabd75b(0x195)]),_0x3e123a=_0x3b9b90['filter'](_0x38bf15=>!_0x38bf15[_0xabd75b(0x1c0)]&&!_0x38bf15[_0xabd75b(0x195)]),_0x4d3734=_0x599dbc?_0x367711:[],_0x3d8ffb=_0x216cc0['flatMap'](_0x15616b=>_0x15616b[_0xabd75b(0x155)]),_0x1196d9=_0x3d8ffb['filter'](_0x58379a=>_0x58379a['type']===_0xabd75b(0x1b8)),_0x204fad=_0x3d8ffb['filter'](_0x50f3df=>_0x50f3df[_0xabd75b(0xf6)]===_0xabd75b(0x16d)),_0x3d593b=_0x3d8ffb[_0xabd75b(0x16c)](_0x3c4154=>_0x3c4154['type']===_0xabd75b(0x15c)),_0x347c4a=Array[_0xabd75b(0x100)](_0x1a509b)[_0xabd75b(0x158)](),_0x10f9b6=_0x2e823d?![]:_0x15f343['length']>0x0||_0x5a0f13[_0xabd75b(0x134)]>0x0||_0x381af2['length']>0x0,_0x4e91d8=_0x4e3eac[_0xabd75b(0x134)]>0x0||_0x110356['length']>0x0||_0x4d3734[_0xabd75b(0x134)]>0x0,_0x54726c=_0x2e823d?![]:_0x3d8ffb[_0xabd75b(0x134)]>0x0,_0x220652=_0x347c4a[_0xabd75b(0x134)]>0x0;return{'segments':{'new':_0x15f343,'changed':_0x5a0f13,'unchanged':_0x557c7a,'toDelete':_0x381af2},'journeys':{'new':_0x4e3eac,'changed':_0x110356,'unchanged':_0x3e123a,'toDelete':_0x4d3734},'activations':{'all':_0x3d8ffb,'toCreate':_0x1196d9,'toUpdate':_0x204fad,'toDelete':_0x3d593b},'folders':{'toCreate':_0x347c4a},'counts':{'segments':{'new':_0x15f343[_0xabd75b(0x134)],'changed':_0x5a0f13[_0xabd75b(0x134)],'unchanged':_0x557c7a[_0xabd75b(0x134)],'toDelete':_0x381af2[_0xabd75b(0x134)]},'journeys':{'new':_0x4e3eac['length'],'changed':_0x110356[_0xabd75b(0x134)],'unchanged':_0x3e123a['length'],'toDelete':_0x4d3734[_0xabd75b(0x134)]},'activations':{'create':_0x1196d9[_0xabd75b(0x134)],'update':_0x204fad['length'],'delete':_0x3d593b['length']},'folders':_0x347c4a[_0xabd75b(0x134)]},'hasChanges':_0x10f9b6||_0x4e91d8||_0x54726c||_0x220652};}export async function buildPushExecutionContext(_0x43a71b,_0x282543,_0x1b3756,_0x57de81,_0x2bc82d,_0x2fe017){const _0x5c27b0=a115_0x30712b,_0x263088=extractRootFolderId(_0x1b3756),{pathToId:_0x49c6c2,idToPath:_0x4f733b}=buildFolderMaps(_0x2bc82d),_0x12d17f=buildSegmentNameToIdMap(_0x57de81),_0x265ab6=new Map(),{batchAsync:_0x3f9eb7}=await import('../../utils/async.js'),[_0x18df28,_0x1b80ea]=await Promise[_0x5c27b0(0x12f)]([_0x43a71b[_0x5c27b0(0x17b)][_0x5c27b0(0x146)](),_0x43a71b[_0x5c27b0(0x118)][_0x5c27b0(0x136)](),((async()=>{const _0x5e40f3=_0x5c27b0;!_0x2fe017&&_0x57de81[_0x5e40f3(0x134)]>0x0&&await _0x3f9eb7(_0x57de81,async _0x4b5a70=>{const _0x3bf403=_0x5e40f3,_0x465274=await _0x43a71b[_0x3bf403(0x14c)][_0x3bf403(0x12a)](_0x282543,_0x4b5a70['id']);_0x265ab6[_0x3bf403(0x14a)](_0x4b5a70['id'],_0x465274);});})())]),{emailToId:_0x51a627,idToEmail:_0x96f0dc}=_0x18df28,_0x11c2ea=buildConnectionMaps(_0x1b80ea);return{'rootFolderId':_0x263088,'folderPathToId':_0x49c6c2,'folderIdToPath':_0x4f733b,'segmentNameToId':_0x12d17f,'activationsBySegmentId':_0x265ab6,'emailToIdMap':_0x51a627,'idToEmailMap':_0x96f0dc,'connectionNameToIdMap':_0x11c2ea[_0x5c27b0(0x18c)],'connectionIdToNameMap':_0x11c2ea[_0x5c27b0(0x153)],'connectionNameToTypeMap':_0x11c2ea[_0x5c27b0(0x1ad)]};}export function createPushYamlContextForBundle(_0x4d1c37,_0x4d298a,_0x54f9cd,_0x5a5b8d,_0x58de53,_0x5c8834,_0x1968bb,_0xb91b7b){const {existingLocalSegmentNames:_0x291008,localExpandedRuleToNames:_0x5e0d7b}=_0x5a5b8d,_0x1017bd=new Set(),_0x2dd97e=new Map(),_0x798069=new Map(),_0x3059fb=new Map(),_0x108314=createJumpTargetCache(),_0x334213=new Map(),_0xa31114=new Map(),_0x5afc85=new Set();let _0x16d1b9;const _0x3f2b4f=_0x424019=>{const _0x27639f={'resolveSegment':async _0x209adf=>{const _0x468864=a115_0x11f4,_0x2f6be7=_0x3059fb['get'](_0x209adf);if(_0x2f6be7!==undefined)return{'name':_0x2f6be7,'isJourneyLocal':!![]};try{let _0x16534=_0x54f9cd[_0x468864(0x1bf)](_0x113f9d=>_0x113f9d['id']===_0x209adf);!_0x16534&&(_0x16534=await _0x4d1c37[_0x468864(0x14c)][_0x468864(0x112)](_0x4d298a,_0x209adf));const _0x105a2e=generateJourneyLocalName(_0x16534[_0x468864(0x17f)]),_0x16046a=_0x16534[_0x468864(0x121)]===SEGMENT_KIND_JOURNEY&&_0x105a2e!==undefined;let _0x5cec2f=_0x16534[_0x468864(0x17f)],_0x3dd1e2;if(_0x16046a&&_0x16534[_0x468864(0x106)]){const _0x18e3e6=apiRuleToYaml(_0x16534[_0x468864(0x106)]);_0xa31114['set'](_0x209adf,_0x18e3e6);const _0x4c6f58=async _0xf973a9=>{const _0x410e63=_0x468864,_0xaf419e=collectSegmentRefsFromRule(_0xf973a9);for(const _0x2cfc24 of _0xaf419e){if(!_0xa31114[_0x410e63(0x180)](_0x2cfc24))try{const _0x2ef29a=await _0x4d1c37[_0x410e63(0x14c)][_0x410e63(0x112)](_0x4d298a,_0x2cfc24);if(_0x2ef29a?.[_0x410e63(0x106)]){const _0x5839b1=apiRuleToYaml(_0x2ef29a[_0x410e63(0x106)]);_0xa31114[_0x410e63(0x14a)](_0x2cfc24,_0x5839b1),await _0x4c6f58(_0x5839b1);}}catch{}}};await _0x4c6f58(_0x18e3e6);const _0x55a4b5=serializeExpandedRule(_0x18e3e6,_0xa31114),_0x5862df=_0x5e0d7b[_0x468864(0x13a)](_0x55a4b5);if(_0x5862df&&_0x5862df[_0x468864(0x134)]>0x0){const _0x203c4a=_0x2dd97e[_0x468864(0x13a)](_0x55a4b5)||0x0,_0x1492eb=_0x5862df[_0x203c4a]||_0x5862df[_0x5862df['length']-0x1];_0x2dd97e['set'](_0x55a4b5,_0x203c4a+0x1),_0x5cec2f=_0x1492eb,_0x1017bd['add'](_0x5cec2f),_0x3059fb['set'](_0x209adf,_0x5cec2f);const _0x257c5e=await resolveRuleSegmentRefs(_0x18e3e6,async _0x530397=>{const _0x318f95=_0x468864,_0x3bdc2c=_0x3059fb[_0x318f95(0x13a)](_0x530397);if(_0x3bdc2c)return _0x3bdc2c;const _0x24c96a=await _0x16d1b9[_0x318f95(0x150)](_0x530397);return _0x24c96a[_0x318f95(0x17f)];});_0x3dd1e2={'description':_0x16534[_0x468864(0x186)],'rule':_0x257c5e};}else{const _0x4ea99e=_0x334213[_0x468864(0x13a)](_0x55a4b5);if(_0x4ea99e)_0x5cec2f=_0x4ea99e,_0x3059fb[_0x468864(0x14a)](_0x209adf,_0x5cec2f);else{if(_0x105a2e){let _0x24aec9=_0x105a2e,_0x3ce9d4=0x2;while(_0x1017bd[_0x468864(0x180)](_0x24aec9)||_0x291008[_0x468864(0x180)](_0x24aec9)){_0x24aec9=_0x105a2e+'_'+_0x3ce9d4,_0x3ce9d4++;}_0x1017bd[_0x468864(0x182)](_0x24aec9),_0x5cec2f=_0x24aec9;}_0x3059fb[_0x468864(0x14a)](_0x209adf,_0x5cec2f),_0x334213[_0x468864(0x14a)](_0x55a4b5,_0x5cec2f);const _0x17db82=await resolveRuleSegmentRefs(_0x18e3e6,async _0x2cd794=>{const _0x37ca1c=_0x468864,_0x4aa3ba=_0x3059fb['get'](_0x2cd794);if(_0x4aa3ba)return _0x4aa3ba;const _0x2e9057=await _0x16d1b9[_0x37ca1c(0x150)](_0x2cd794);return _0x2e9057[_0x37ca1c(0x17f)];});_0x3dd1e2={'description':_0x16534[_0x468864(0x186)],'rule':_0x17db82};}}}return{'name':_0x5cec2f,'isJourneyLocal':_0x16046a,'definition':_0x3dd1e2};}catch{return{'name':_0x209adf,'isJourneyLocal':![]};}},'resolveActivation':async _0x6a9368=>{const _0x720376=a115_0x11f4,_0x48d1c0=_0x798069[_0x720376(0x13a)](_0x6a9368);if(_0x48d1c0!==undefined)return{'name':_0x48d1c0,'isJourneyLocal':!![]};try{let _0x658786=_0x1968bb?.['get'](_0x6a9368);!_0x658786&&(_0x658786=await _0x4d1c37[_0x720376(0xf1)][_0x720376(0x1c1)](_0x424019,_0x6a9368));const _0x1f6f70=_0x658786[_0x720376(0x188)][_0x720376(0xef)][_0x720376(0x17f)]||_0x6a9368,_0x15759a=sanitizeYamlKey(_0x1f6f70)||'activation_'+_0x6a9368,_0x4e8483=_0x15759a;_0x798069[_0x720376(0x14a)](_0x6a9368,_0x4e8483);const _0xf4a62b=journeyActivationStepToYaml(_0x658786,_0x58de53,_0x5c8834);return{'name':_0x4e8483,'isJourneyLocal':!![],'definition':_0xf4a62b};}catch{return{'name':_0x6a9368,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x180bfb,_0x5b517e)=>resolveJumpTarget(_0x180bfb,_0x5b517e,_0x108314,async _0x39ccfb=>{const _0x437069=a115_0x11f4,_0x52f53f=_0xb91b7b?.[_0x437069(0x13a)](_0x39ccfb);if(_0x52f53f)return _0x52f53f;return _0x4d1c37[_0x437069(0xf1)][_0x437069(0x13b)](_0x39ccfb);})};return _0x16d1b9=_0x27639f,_0x27639f;},_0x27cad8=async _0x5dd4e5=>{const _0x3a07fd=a115_0x11f4,{collectSegmentIdsFromJourneyApi:_0x6f8ec0}=await import(_0x3a07fd(0x127)),{batchAsync:_0x123b13}=await import(_0x3a07fd(0x10b)),_0x2da823=new Set();for(const _0x11bb4d of _0x5dd4e5){let _0x5a3046=_0xb91b7b?.['get'](_0x11bb4d);!_0x5a3046&&(_0x5a3046=await _0x4d1c37[_0x3a07fd(0xf1)]['getJourney'](_0x11bb4d));const _0x3f0143=_0x6f8ec0(_0x5a3046);for(const _0x4a6e93 of _0x3f0143){_0x2da823['add'](_0x4a6e93);}}let _0x3dac5d=Array[_0x3a07fd(0x100)](_0x2da823);while(_0x3dac5d[_0x3a07fd(0x134)]>0x0){const _0x119810=_0x3dac5d['filter'](_0x2e018c=>!_0x5afc85[_0x3a07fd(0x180)](_0x2e018c));if(_0x119810['length']===0x0)break;const _0x3f8836=await _0x123b13(_0x119810,async _0x228e2c=>{const _0x29aab6=_0x3a07fd;_0x5afc85[_0x29aab6(0x182)](_0x228e2c);let _0x36c51a=_0x54f9cd[_0x29aab6(0x1bf)](_0x547649=>_0x547649['id']===_0x228e2c);if(!_0x36c51a)try{_0x36c51a=await _0x4d1c37[_0x29aab6(0x14c)]['getSegment'](_0x4d298a,_0x228e2c);}catch{return null;}return{'segmentId':_0x228e2c,'segment':_0x36c51a};},0xa),_0x4bf892=new Set();for(const _0x4fc9da of _0x3f8836){if(!_0x4fc9da?.[_0x3a07fd(0x14c)]?.[_0x3a07fd(0x106)])continue;const _0x431a5e=apiRuleToYaml(_0x4fc9da[_0x3a07fd(0x14c)][_0x3a07fd(0x106)]);_0xa31114['set'](_0x4fc9da[_0x3a07fd(0x1a4)],_0x431a5e);const _0x21ebae=collectSegmentRefsFromRule(_0x431a5e);for(const _0x52858c of _0x21ebae){!_0x5afc85[_0x3a07fd(0x180)](_0x52858c)&&_0x4bf892['add'](_0x52858c);}}_0x3dac5d=Array[_0x3a07fd(0x100)](_0x4bf892);}};return{'createYamlContext':_0x3f2b4f,'prefetchJourneySegments':_0x27cad8};}export async function executePushSegments(_0x1e551c,_0x24ace5,_0xaa212a,_0x1fc363,_0x41be2a){const _0x5cea47=a115_0x30712b,{segmentDefToCreateRequest:_0x45a402,segmentDefToUpdateRequest:_0x3d94a6}=await import(_0x5cea47(0x1c2)),_0x56c4ea=_0xaa212a[_0x5cea47(0x10e)],_0x5d958d=0x5,_0x3783bb=async _0xa6d93a=>{const _0x3a6017=_0x5cea47,_0x5efe62=_0xa6d93a[_0x3a6017(0xea)]?_0x56c4ea[_0x3a6017(0x13a)](_0xa6d93a['folderPath']):undefined;let _0x288337;const _0x4596cb={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0xa6d93a['isNew']){_0x41be2a[_0x3a6017(0x103)]?.({'type':'segment_creating','name':_0xa6d93a[_0x3a6017(0xed)]['name']});const _0x173402=_0x45a402(_0xa6d93a[_0x3a6017(0xed)],_0x5efe62),_0x402487=await _0x41be2a[_0x3a6017(0x11a)]('Creating\x20segment\x20\x27'+_0xa6d93a['yamlConfig']['name']+_0x3a6017(0xf4),()=>_0x1e551c[_0x3a6017(0x14c)][_0x3a6017(0x131)](_0x1fc363[_0x3a6017(0x138)],_0x173402));_0x288337=_0x402487[_0x3a6017(0xf3)]['id'],_0x4596cb['createdSegmentId']={'name':_0xa6d93a[_0x3a6017(0xed)]['name'],'id':_0x288337},_0x41be2a[_0x3a6017(0x103)]?.({'type':_0x3a6017(0x1a3),'name':_0xa6d93a[_0x3a6017(0xed)][_0x3a6017(0x17f)],'segmentId':_0x288337}),_0x41be2a[_0x3a6017(0x1c5)]?.(_0x3a6017(0x11e)+_0xa6d93a['yamlConfig'][_0x3a6017(0x17f)]+'\x27'),_0x4596cb[_0x3a6017(0x144)]=0x1;}else{if(_0xa6d93a[_0x3a6017(0x195)]){_0x41be2a['onProgress']?.({'type':_0x3a6017(0x1af),'name':_0xa6d93a[_0x3a6017(0xed)][_0x3a6017(0x17f)]});const _0x245b09=_0x3d94a6(_0xa6d93a[_0x3a6017(0xed)]);_0x5efe62!==_0xa6d93a[_0x3a6017(0x17a)]?.['segmentFolderId']&&(_0x245b09[_0x3a6017(0x15e)]=_0x5efe62?parseInt(_0x5efe62,0xa):undefined),await _0x41be2a['withProgress'](_0x3a6017(0x164)+_0xa6d93a[_0x3a6017(0xed)][_0x3a6017(0x17f)]+_0x3a6017(0xf4),()=>_0x1e551c['segment'][_0x3a6017(0x143)](_0x1fc363['parentId'],_0xa6d93a[_0x3a6017(0x17a)]['id'],_0x245b09)),_0x288337=_0xa6d93a[_0x3a6017(0x17a)]['id'],_0x41be2a[_0x3a6017(0x103)]?.({'type':_0x3a6017(0xf9),'name':_0xa6d93a['yamlConfig'][_0x3a6017(0x17f)]}),_0x41be2a[_0x3a6017(0x1c5)]?.('Updated\x20segment\x20\x27'+_0xa6d93a[_0x3a6017(0xed)][_0x3a6017(0x17f)]+'\x27'),_0x4596cb[_0x3a6017(0x13d)]=0x1;}else _0x288337=_0xa6d93a[_0x3a6017(0x17a)]['id'];}}catch(_0x14f5be){const _0x1685f0=isHttp400Error(_0x14f5be),_0x102c36=_0x1685f0?ErrorCode[_0x3a6017(0x108)]:ErrorCode[_0x3a6017(0x15b)],_0x583b4b=getErrorMessage(_0x14f5be);throw new SDKError(_0x102c36,_0x3a6017(0x172)+(_0xa6d93a[_0x3a6017(0x1c0)]?'create':_0x3a6017(0x16d))+'\x20segment\x20from\x20file:\x20'+_0xa6d93a['absolutePath']+_0x3a6017(0x1aa)+_0x583b4b,_0x14f5be);}try{const _0x44b54f=await syncActivationsForSegment(_0x1e551c,_0x1fc363[_0x3a6017(0x138)],_0x288337,_0xa6d93a['yamlConfig'][_0x3a6017(0x17f)],_0xa6d93a[_0x3a6017(0x155)],_0x41be2a,_0xa6d93a['absolutePath']);_0x4596cb[_0x3a6017(0x18e)]=_0x44b54f;}catch(_0xc12196){if(_0xc12196 instanceof SDKError)throw _0xc12196;throw new SDKError(ErrorCode[_0x3a6017(0x124)],_0x3a6017(0x111)+_0xa6d93a[_0x3a6017(0xed)]['name']+_0x3a6017(0x19e)+_0xa6d93a[_0x3a6017(0x132)]+_0x3a6017(0x1aa)+getErrorMessage(_0xc12196),_0xc12196);}return _0x4596cb;},_0x2313de=await batchAsync(_0x24ace5,_0x3783bb,_0x5d958d),_0x17f2e6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5db2a1 of _0x2313de){_0x17f2e6['created']+=_0x5db2a1[_0x5cea47(0x144)],_0x17f2e6[_0x5cea47(0x13d)]+=_0x5db2a1[_0x5cea47(0x13d)],_0x5db2a1[_0x5cea47(0x15d)]&&_0x17f2e6[_0x5cea47(0x105)][_0x5cea47(0x14a)](_0x5db2a1[_0x5cea47(0x15d)][_0x5cea47(0x17f)],_0x5db2a1[_0x5cea47(0x15d)]['id']),_0x17f2e6[_0x5cea47(0x18e)][_0x5cea47(0x144)]+=_0x5db2a1[_0x5cea47(0x18e)]['created'],_0x17f2e6['activations'][_0x5cea47(0x13d)]+=_0x5db2a1[_0x5cea47(0x18e)][_0x5cea47(0x13d)],_0x17f2e6[_0x5cea47(0x18e)][_0x5cea47(0x1c4)]+=_0x5db2a1['activations'][_0x5cea47(0x1c4)];}return _0x17f2e6;}async function syncActivationsForSegment(_0x2fe6e5,_0x502fc,_0x1b1ca5,_0x5e655b,_0x4cabe7,_0x221115,_0x286c33){const _0x396d99=a115_0x30712b,_0x10840d={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3fec2a of _0x4cabe7){try{if(_0x3fec2a[_0x396d99(0xf6)]===_0x396d99(0x1b8)&&_0x3fec2a['validatedRequest'])_0x221115['onProgress']?.({'type':_0x396d99(0x1b1),'segmentName':_0x5e655b,'activationName':_0x3fec2a[_0x396d99(0x17f)]}),await _0x221115['withProgress'](_0x396d99(0x123)+_0x3fec2a['name']+'\x27...',()=>_0x2fe6e5[_0x396d99(0x14c)]['createActivation'](_0x502fc,_0x1b1ca5,_0x3fec2a[_0x396d99(0x149)])),_0x221115[_0x396d99(0x103)]?.({'type':_0x396d99(0xf2),'segmentName':_0x5e655b,'activationName':_0x3fec2a['name']}),_0x221115[_0x396d99(0x1c5)]?.(_0x396d99(0x1ae)+_0x3fec2a['name']+'\x27'),_0x10840d['created']++;else{if(_0x3fec2a[_0x396d99(0xf6)]===_0x396d99(0x16d)&&_0x3fec2a[_0x396d99(0x149)]&&_0x3fec2a[_0x396d99(0x187)])_0x221115[_0x396d99(0x103)]?.({'type':_0x396d99(0x171),'segmentName':_0x5e655b,'activationName':_0x3fec2a[_0x396d99(0x17f)]}),await _0x221115[_0x396d99(0x11a)]('Updating\x20activation\x20\x27'+_0x3fec2a['name']+'\x27...',()=>_0x2fe6e5[_0x396d99(0x14c)]['updateActivation'](_0x502fc,_0x1b1ca5,_0x3fec2a['existingActivation']['id'],_0x3fec2a[_0x396d99(0x149)])),_0x221115['onProgress']?.({'type':_0x396d99(0x11d),'segmentName':_0x5e655b,'activationName':_0x3fec2a[_0x396d99(0x17f)]}),_0x221115['logSuccess']?.(_0x396d99(0x141)+_0x3fec2a[_0x396d99(0x17f)]+'\x27'),_0x10840d[_0x396d99(0x13d)]++;else _0x3fec2a[_0x396d99(0xf6)]===_0x396d99(0x15c)&&_0x3fec2a[_0x396d99(0x187)]&&(_0x221115['onProgress']?.({'type':_0x396d99(0x11f),'segmentName':_0x5e655b,'activationName':_0x3fec2a['name']}),await _0x221115[_0x396d99(0x11a)]('Deleting\x20activation\x20\x27'+_0x3fec2a[_0x396d99(0x17f)]+_0x396d99(0xf4),()=>_0x2fe6e5[_0x396d99(0x14c)][_0x396d99(0xfe)](_0x502fc,_0x1b1ca5,_0x3fec2a[_0x396d99(0x187)]['id'])),_0x221115['onProgress']?.({'type':'activation_deleted','segmentName':_0x5e655b,'activationName':_0x3fec2a[_0x396d99(0x17f)]}),_0x221115[_0x396d99(0x183)]?.(_0x396d99(0xf0)+_0x3fec2a[_0x396d99(0x17f)]+'\x27'),_0x10840d['deleted']++);}}catch(_0x5e602b){const _0x40932c=isHttp400Error(_0x5e602b),_0x479815=_0x40932c?ErrorCode[_0x396d99(0x176)]:ErrorCode[_0x396d99(0x124)],_0x52746d=getErrorMessage(_0x5e602b);throw new SDKError(_0x479815,_0x396d99(0x172)+_0x3fec2a[_0x396d99(0xf6)]+'\x20activation\x20\x27'+_0x3fec2a[_0x396d99(0x17f)]+'\x27\x20from\x20file:\x20'+_0x286c33+_0x396d99(0x1aa)+_0x52746d,_0x5e602b);}}return _0x10840d;}export async function executePushFolders(_0x14eae5,_0x3ba916,_0x3ed07b,_0x2ecbed,_0xa0475d){const _0x577895=a115_0x30712b,_0x193e14=new Map(_0x3ed07b);for(const _0x47e910 of _0x3ba916){const _0x94355a=_0x47e910[_0x577895(0x14b)]('/'),_0x54bfe4=_0x94355a[_0x94355a[_0x577895(0x134)]-0x1],_0x46ee6c=_0x94355a['slice'](0x0,-0x1)[_0x577895(0x14e)]('/'),_0x380f4a=_0x193e14[_0x577895(0x13a)](_0x46ee6c);_0xa0475d[_0x577895(0x103)]?.({'type':_0x577895(0x1a0),'folder':_0x47e910});const _0x380a3f={'name':_0x54bfe4,'parentFolderId':_0x380f4a},_0x350653=await _0xa0475d[_0x577895(0x11a)]('Creating\x20folder\x20\x27'+_0x47e910+_0x577895(0xf4),()=>_0x14eae5['segment']['createFolder'](_0x2ecbed[_0x577895(0x138)],_0x380a3f));_0x193e14[_0x577895(0x14a)](_0x47e910,_0x350653[_0x577895(0xf3)]['id']),_0xa0475d[_0x577895(0x103)]?.({'type':_0x577895(0x128),'folder':_0x47e910,'folderId':_0x350653[_0x577895(0xf3)]['id']}),_0xa0475d['logInfo']?.(_0x577895(0x1bc)+_0x47e910+'\x27');}return _0x193e14;}export async function executePushSegmentDeletions(_0x4cfb6b,_0x5066c8,_0x291a67){const _0x3fbcdc=a115_0x30712b;if(_0x5066c8[_0x3fbcdc(0x134)]===0x0)return 0x0;const {batchAsync:_0x35554e}=await import(_0x3fbcdc(0x10b)),_0xb8154=0x5,_0x110a57=await _0x35554e(_0x5066c8,async _0x4e3bc0=>{const _0x4db7e2=_0x3fbcdc;return _0x291a67['onProgress']?.({'type':_0x4db7e2(0x196),'name':_0x4e3bc0['name']}),await _0x4cfb6b['segment']['deleteSegment'](_0x4e3bc0['id']),_0x291a67[_0x4db7e2(0x103)]?.({'type':_0x4db7e2(0x151),'name':_0x4e3bc0[_0x4db7e2(0x17f)]}),_0x291a67[_0x4db7e2(0x183)]?.(_0x4db7e2(0x18d)+_0x4e3bc0[_0x4db7e2(0x17f)]+'\x27'),0x1;},_0xb8154);return _0x110a57[_0x3fbcdc(0xfd)]((_0x521bfe,_0x184069)=>_0x521bfe+_0x184069,0x0);}export async function executePushJourneys(_0x13c14f,_0x19022b,_0x26f58a,_0x1eecb6,_0x35f423){const _0x5394c1=a115_0x30712b,{journeyDefToRequest:_0x5a3f13}=await import(_0x5394c1(0x127)),{activationDefToCreateRequest:_0x456918,yamlRuleToApi:_0x5b912e,validateSegmentRule:_0x49d1e8}=await import(_0x5394c1(0x1c2)),_0x2608d1={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x580764=new Map(_0x26f58a[_0x5394c1(0x1ac)]),_0x30786e=0x5;for(let _0x192849=0x0;_0x192849<_0x19022b[_0x5394c1(0x134)];_0x192849+=_0x30786e){const _0x317d87=_0x19022b['slice'](_0x192849,_0x192849+_0x30786e),_0x4963c0=await Promise['all'](_0x317d87['map'](async _0x169aca=>{const _0x38d18f=_0x5394c1;if(!_0x169aca[_0x38d18f(0x1c0)]&&!_0x169aca[_0x38d18f(0x195)])return{'action':'unchanged','name':_0x169aca[_0x38d18f(0xed)][_0x38d18f(0x17f)],'journeyId':_0x169aca[_0x38d18f(0x13e)]?.['id']};const _0x543933=_0x169aca[_0x38d18f(0xea)]?_0x26f58a[_0x38d18f(0x10e)]['get'](_0x169aca['folderPath']):undefined;_0x35f423[_0x38d18f(0x103)]?.({'type':_0x169aca[_0x38d18f(0x1c0)]?_0x38d18f(0x191):_0x38d18f(0x193),'name':_0x169aca[_0x38d18f(0xed)][_0x38d18f(0x17f)]});try{const _0x1ecc44=await executeSingleJourneyPush(_0x13c14f,_0x169aca,{..._0x26f58a,'segmentNameToId':_0x580764},{'parentId':_0x1eecb6[_0x38d18f(0x138)],'rootFolderId':_0x1eecb6[_0x38d18f(0x114)],'folderId':_0x543933,'verbose':_0x1eecb6['verbose']},_0x35f423,{'journeyDefToRequest':_0x5a3f13,'activationDefToCreateRequest':_0x456918,'yamlRuleToApi':_0x5b912e,'validateSegmentRule':_0x49d1e8});for(const [_0x16e2f3,_0x440c62]of _0x1ecc44[_0x38d18f(0x174)]){_0x580764[_0x38d18f(0x14a)](_0x16e2f3,_0x440c62),_0x2608d1[_0x38d18f(0x174)][_0x38d18f(0x14a)](_0x16e2f3,_0x440c62);}if(_0x1ecc44[_0x38d18f(0x1a1)]==='created')_0x35f423['onProgress']?.({'type':'journey_created','name':_0x169aca[_0x38d18f(0xed)]['name'],'journeyId':_0x1ecc44[_0x38d18f(0xf5)]}),_0x35f423[_0x38d18f(0x1c5)]?.(_0x38d18f(0x168)+_0x169aca[_0x38d18f(0xed)][_0x38d18f(0x17f)]+'\x27'),_0x2608d1['created']++;else _0x1ecc44[_0x38d18f(0x1a1)]===_0x38d18f(0x13d)&&(_0x35f423[_0x38d18f(0x103)]?.({'type':_0x38d18f(0x1a5),'name':_0x169aca['yamlConfig'][_0x38d18f(0x17f)]}),_0x35f423[_0x38d18f(0x1c5)]?.(_0x38d18f(0x1b5)+_0x169aca[_0x38d18f(0xed)][_0x38d18f(0x17f)]+'\x27'),_0x2608d1['updated']++);return{'action':_0x1ecc44['action'],'name':_0x169aca['yamlConfig'][_0x38d18f(0x17f)],'journeyId':_0x1ecc44[_0x38d18f(0xf5)]};}catch(_0x105b50){const _0x5831c7=isHttp400Error(_0x105b50),_0x3f41c8=_0x5831c7?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x102041=getErrorMessage(_0x105b50);throw new SDKError(_0x3f41c8,_0x38d18f(0x172)+(_0x169aca[_0x38d18f(0x1c0)]?_0x38d18f(0x1b8):_0x38d18f(0x16d))+_0x38d18f(0x11b)+_0x169aca[_0x38d18f(0x132)]+_0x38d18f(0x1aa)+_0x102041,_0x105b50);}}));_0x2608d1['results']['push'](..._0x4963c0);}return _0x2608d1;}async function executeSingleJourneyPush(_0x20627a,_0x4b4be8,_0x2611f0,_0x5a8464,_0x14fe49,_0x408e23){const _0x4db17b=a115_0x30712b,{journeyDefToRequest:_0x36551b,activationDefToCreateRequest:_0x68a89b,yamlRuleToApi:_0x41c7c8,validateSegmentRule:_0x21c939}=_0x408e23,_0x311cb6=new Map(),_0x585f72=new Map(),_0x561fc4=new Map(),_0x4aefaa=new Map(),_0x3a8056=new Map();let _0x396248;const _0x4fcb05=async()=>{const _0x8b220f=a115_0x11f4;if(_0x396248)return;_0x396248=new Map();if(!_0x4b4be8[_0x8b220f(0x13e)])return;const _0x4f4d2d=await _0x20627a[_0x8b220f(0xf1)][_0x8b220f(0x12a)](_0x4b4be8[_0x8b220f(0x13e)]['id']);for(const _0x57ba8a of _0x4f4d2d){const _0x3c66bc=journeyActivationStepToYaml(_0x57ba8a,_0x2611f0[_0x8b220f(0x10f)],_0x2611f0[_0x8b220f(0x16b)]),_0x2459fc=activationSignature(_0x3c66bc);!_0x396248['has'](_0x2459fc)&&_0x396248[_0x8b220f(0x14a)](_0x2459fc,_0x57ba8a['id']),_0x3c66bc['name']&&_0x585f72[_0x8b220f(0x14a)](_0x3c66bc[_0x8b220f(0x17f)],_0x57ba8a['id']);}};if(_0x4b4be8[_0x4db17b(0x13e)]&&_0x4b4be8[_0x4db17b(0xed)][_0x4db17b(0x109)]){const _0x505cf8=buildLocalExpandedRuleMappings(_0x4b4be8[_0x4db17b(0xed)]),_0x45c21e=_0x505cf8[_0x4db17b(0x17c)];if(_0x45c21e[_0x4db17b(0x19d)]>0x0){const _0x436f65=new Map();for(const [_0x3ed4ae,_0x1e74cc]of _0x45c21e){const _0x4ef42b=serializeExpandedRule(_0x1e74cc,_0x45c21e);_0x436f65[_0x4db17b(0x14a)](_0x3ed4ae,_0x4ef42b);}const _0x28315a=collectSegmentIdsFromJourneyApi(_0x4b4be8[_0x4db17b(0x13e)]);if(_0x28315a[_0x4db17b(0x19d)]>0x0){const _0x13a611=await buildServerSegmentRuleMap(_0x20627a,_0x5a8464[_0x4db17b(0x138)],_0x2611f0[_0x4db17b(0x1be)],_0x28315a);if(_0x13a611[_0x4db17b(0x19d)]>0x0){const _0xcc7a52=new Map();for(const [_0x375872,_0x2a3351]of _0x13a611){const _0x3f2df8=serializeExpandedRule(_0x2a3351,_0x13a611);!_0xcc7a52[_0x4db17b(0x180)](_0x3f2df8)&&_0xcc7a52[_0x4db17b(0x14a)](_0x3f2df8,_0x375872);}for(const [_0x3a212c,_0x2677f1]of _0x436f65){const _0x361b75=_0xcc7a52[_0x4db17b(0x13a)](_0x2677f1);_0x361b75&&(_0x3a8056['set'](_0x3a212c,_0x361b75),_0x2611f0[_0x4db17b(0x1ac)]['set'](_0x3a212c,_0x361b75));}}}}}const _0x14f9f2={'resolveSegmentId':async _0x738b58=>{const _0x11ba26=_0x4db17b,_0x15abb8=_0x2611f0['segmentNameToId'][_0x11ba26(0x13a)](_0x738b58);if(!_0x15abb8)throw new SDKError(ErrorCode[_0x11ba26(0x19b)],_0x11ba26(0x161)+_0x738b58+_0x11ba26(0x107)+_0x4b4be8[_0x11ba26(0xed)][_0x11ba26(0x17f)]+')');return _0x15abb8;},'resolveEmbeddedSegmentId':async(_0x3087a0,_0x52fc77)=>{const _0x4e13e4=_0x4db17b,_0x43a72f=_0x2611f0['segmentNameToId'][_0x4e13e4(0x13a)](_0x3087a0);if(_0x43a72f)return _0x43a72f;const _0x17035e=_0x3a8056['get'](_0x3087a0);if(_0x17035e)return _0x2611f0[_0x4e13e4(0x1ac)][_0x4e13e4(0x14a)](_0x3087a0,_0x17035e),_0x17035e;const _0x4a12b0=_0x2611f0[_0x4e13e4(0x1be)]['find'](_0x3fb47e=>_0x3fb47e[_0x4e13e4(0x17f)]===_0x3087a0);if(_0x4a12b0)return _0x2611f0[_0x4e13e4(0x1ac)]['set'](_0x3087a0,_0x4a12b0['id']),_0x4a12b0['id'];if(_0x4b4be8[_0x4e13e4(0x1c0)]){const {stageName:_0x399ac3,criteriaName:_0xc32a3d}=findSegmentCriteriaLocation(_0x4b4be8[_0x4e13e4(0xed)],_0x3087a0);return _0x21c939(_0x3087a0,_0x52fc77[_0x4e13e4(0x106)]),_0x561fc4[_0x4e13e4(0x14a)](_0x3087a0,{'definition':_0x52fc77,'stageName':_0x399ac3,'criteriaName':_0xc32a3d}),createPendingSegmentId(_0x3087a0);}const _0x3c1999=_0x4b4be8[_0x4e13e4(0x13e)]?.['id'];if(!_0x3c1999)throw new SDKError(ErrorCode[_0x4e13e4(0x1b3)],_0x4e13e4(0xff));_0x21c939(_0x3087a0,_0x52fc77[_0x4e13e4(0x106)]);const _0x47b50d=generateDeterministicJourneySegmentName(_0x4b4be8['yamlConfig'][_0x4e13e4(0x17f)],_0x3087a0),_0x2b701e=_0x2611f0[_0x4e13e4(0x1be)][_0x4e13e4(0x1bf)](_0x138594=>_0x138594[_0x4e13e4(0x17f)]===_0x47b50d),_0x364bb2=createSegmentIdResolver(_0x2611f0[_0x4e13e4(0x1ac)],_0x3087a0),_0x1abad6=await resolveRuleSegmentIds(_0x52fc77[_0x4e13e4(0x106)],_0x364bb2);let _0x1e5b2d;if(_0x2b701e)await _0x20627a[_0x4e13e4(0x14c)]['updateSegmentById'](_0x5a8464[_0x4e13e4(0x138)],_0x2b701e['id'],{'description':_0x52fc77[_0x4e13e4(0x186)]||_0x4e13e4(0x199)+_0x3087a0,'rule':_0x41c7c8(_0x1abad6,!![]),'countPopulation':!![]}),_0x1e5b2d=_0x2b701e['id'];else try{_0x1e5b2d=await _0x20627a[_0x4e13e4(0x14c)][_0x4e13e4(0x113)]({'name':_0x47b50d,'description':_0x52fc77[_0x4e13e4(0x186)]||'Entry\x20criteria:\x20'+_0x3087a0,'journeyId':_0x3c1999,'rule':_0x41c7c8(_0x1abad6,!![]),'countPopulation':!![],'parentFolderId':_0x5a8464[_0x4e13e4(0x114)]||'','audienceId':_0x5a8464[_0x4e13e4(0x138)]});}catch(_0x43c50b){const _0x124afb=_0x43c50b instanceof Error&&_0x43c50b[_0x4e13e4(0x16a)][_0x4e13e4(0x147)](_0x4e13e4(0x122));if(_0x124afb){const _0x153f35=await _0x20627a[_0x4e13e4(0x14c)]['listSegments'](_0x5a8464['parentId']),_0x54de5e=_0x153f35[_0x4e13e4(0x1bf)](_0x39ba79=>_0x39ba79['name']===_0x47b50d);if(_0x54de5e)await _0x20627a[_0x4e13e4(0x14c)][_0x4e13e4(0x143)](_0x5a8464[_0x4e13e4(0x138)],_0x54de5e['id'],{'description':_0x52fc77['description']||_0x4e13e4(0x199)+_0x3087a0,'rule':_0x41c7c8(_0x1abad6,!![]),'countPopulation':!![]}),_0x1e5b2d=_0x54de5e['id'];else throw _0x43c50b;}else throw _0x43c50b;}return _0x2611f0[_0x4e13e4(0x1ac)][_0x4e13e4(0x14a)](_0x3087a0,_0x1e5b2d),_0x311cb6[_0x4e13e4(0x14a)](_0x3087a0,_0x1e5b2d),_0x1e5b2d;},'resolveActivationId':async _0x46241b=>{const _0x3e9883=_0x4db17b,_0x5b814e=_0x585f72[_0x3e9883(0x13a)](_0x46241b);if(_0x5b814e)return _0x5b814e;if(_0x4b4be8[_0x3e9883(0x13e)]){await _0x4fcb05();const _0x3f58aa=_0x585f72['get'](_0x46241b);if(_0x3f58aa)return _0x3f58aa;}throw new SDKError(ErrorCode[_0x3e9883(0x18b)],_0x3e9883(0x142)+_0x46241b+_0x3e9883(0x107)+_0x4b4be8['yamlConfig'][_0x3e9883(0x17f)]+_0x3e9883(0x12e)+_0x3e9883(0x101));},'resolveEmbeddedActivationId':async(_0x417e9b,_0xab3c0f)=>{const _0x1c058d=_0x4db17b,_0x1e6500=_0x585f72[_0x1c058d(0x13a)](_0x417e9b);if(_0x1e6500)return _0x1e6500;if(_0x4b4be8['isNew'])return _0x4aefaa['set'](_0x417e9b,_0xab3c0f),createPendingActivationId(_0x417e9b);if(_0x4b4be8[_0x1c058d(0x13e)]){await _0x4fcb05();const _0x22fde1=_0x585f72[_0x1c058d(0x13a)](_0xab3c0f[_0x1c058d(0x17f)]);if(_0x22fde1)return _0x585f72[_0x1c058d(0x14a)](_0x417e9b,_0x22fde1),_0x22fde1;const _0x55cfa2=activationSignature(_0xab3c0f),_0x5dbefa=_0x396248?.[_0x1c058d(0x13a)](_0x55cfa2);if(_0x5dbefa)return _0x585f72[_0x1c058d(0x14a)](_0x417e9b,_0x5dbefa),_0x5dbefa;const _0x4612b0=await _0x68a89b(_0xab3c0f,_0x2611f0[_0x1c058d(0x1c3)]),_0x48e5d3=await _0x20627a[_0x1c058d(0xf1)][_0x1c058d(0x102)](_0x4b4be8[_0x1c058d(0x13e)]['id'],_0x4612b0);return _0x585f72[_0x1c058d(0x14a)](_0x417e9b,_0x48e5d3['id']),_0x48e5d3['id'];}throw new SDKError(ErrorCode[_0x1c058d(0x1b3)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x1d3b55=>{const _0x2d9661=_0x4db17b;try{return await _0x20627a[_0x2d9661(0xf1)]['resolveJourneyId'](_0x5a8464['parentId'],_0x1d3b55);}catch(_0x3289e3){throw new SDKError(ErrorCode[_0x2d9661(0x18b)],_0x2d9661(0x145)+_0x1d3b55+_0x2d9661(0x1b4)+_0x4b4be8['yamlConfig'][_0x2d9661(0x17f)]+'\x27)',_0x3289e3);}},'resolveStageId':async(_0x359658,_0x28e8fa)=>{const _0x480394=_0x4db17b,_0x58c9da=await _0x20627a[_0x480394(0xf1)][_0x480394(0x13b)](_0x359658),_0x4160e8=_0x58c9da[_0x480394(0x188)][_0x480394(0x1c6)][_0x480394(0x1bf)](_0x3b7849=>_0x3b7849[_0x480394(0x17f)][_0x480394(0x116)]()===_0x28e8fa['toLowerCase']());if(!_0x4160e8?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x480394(0x14f)+_0x28e8fa+_0x480394(0x14d)+(_0x58c9da[_0x480394(0x188)][_0x480394(0x197)]||_0x58c9da[_0x480394(0x188)]['name'])+'\x27');return _0x4160e8['id'];}},_0x120595=await _0x36551b(_0x4b4be8[_0x4db17b(0xed)],_0x5a8464[_0x4db17b(0x138)],_0x14f9f2),_0x2ce82b=_0x5a8464['folderId']||_0x5a8464[_0x4db17b(0x114)];_0x2ce82b&&(_0x120595[_0x4db17b(0x192)]={'parentFolder':{'data':{'id':_0x2ce82b,'type':'folder'}}});if(_0x4b4be8[_0x4db17b(0x1c0)]){if(_0x561fc4[_0x4db17b(0x19d)]>0x0||_0x4aefaa[_0x4db17b(0x19d)]>0x0)return await executeThreeStepJourneyCreate(_0x20627a,_0x4b4be8,_0x120595,{'pendingEmbeddedSegments':_0x561fc4,'pendingEmbeddedActivations':_0x4aefaa,'embeddedSegmentNameToId':_0x311cb6,'journeyActivationNameToId':_0x585f72},{..._0x5a8464,'effectiveFolderId':_0x2ce82b},_0x2611f0,_0x14fe49,_0x408e23);else{ensureJourneyDefaults(_0x120595['attributes']);const _0x2693d7=await _0x20627a[_0x4db17b(0xf1)][_0x4db17b(0x1b8)](_0x120595);return{'action':_0x4db17b(0x144),'journeyId':_0x2693d7['id'],'embeddedSegmentNameToId':_0x311cb6};}}else{if(_0x4b4be8[_0x4db17b(0x195)]&&_0x4b4be8[_0x4db17b(0x13e)])return ensureJourneyDefaults(_0x120595[_0x4db17b(0x188)]),await _0x20627a[_0x4db17b(0xf1)]['update'](_0x4b4be8[_0x4db17b(0x13e)]['id'],_0x120595),{'action':_0x4db17b(0x13d),'journeyId':_0x4b4be8[_0x4db17b(0x13e)]['id'],'embeddedSegmentNameToId':_0x311cb6};}return{'action':_0x4db17b(0x163),'journeyId':_0x4b4be8['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x311cb6};}function findSegmentCriteriaLocation(_0x51685a,_0x4f4087){const _0x1aaa21=a115_0x30712b,_0x4a43a0=_0x51685a[_0x1aaa21(0x18f)]||_0x51685a[_0x1aaa21(0x17e)]?.[0x0]?.[_0x1aaa21(0x18f)]||[];let _0x495d05='entry',_0x2b06f7=_0x4f4087;const _0x54167b=_0x51685a[_0x1aaa21(0x1b0)]||_0x51685a['journeys']?.[0x0]?.[_0x1aaa21(0x1b0)];if(_0x54167b?.['segment']===_0x4f4087)return{'stageName':_0x1aaa21(0x1b0),'criteriaName':_0x54167b['name']||_0x4f4087};_0x1f0655:for(const _0x2ea319 of _0x4a43a0){if(_0x2ea319[_0x1aaa21(0xfc)]?.['segment']===_0x4f4087){_0x495d05=_0x2ea319[_0x1aaa21(0x17f)],_0x2b06f7=_0x2ea319[_0x1aaa21(0xfc)][_0x1aaa21(0x17f)]||_0x4f4087;break;}if(_0x2ea319[_0x1aaa21(0x12b)])for(const _0x544f86 of _0x2ea319[_0x1aaa21(0x12b)]){if(_0x544f86[_0x1aaa21(0xf6)]===_0x1aaa21(0x10c)&&_0x544f86[_0x1aaa21(0xee)]?.[_0x1aaa21(0x18a)])for(const _0x7c4165 of _0x544f86[_0x1aaa21(0xee)][_0x1aaa21(0x18a)]){if(_0x7c4165[_0x1aaa21(0x14c)]===_0x4f4087){_0x495d05=_0x2ea319[_0x1aaa21(0x17f)],_0x2b06f7=_0x7c4165[_0x1aaa21(0x17f)]||_0x4f4087;break _0x1f0655;}}}}return{'stageName':_0x495d05,'criteriaName':_0x2b06f7};}async function executeThreeStepJourneyCreate(_0x4660a5,_0x3a72b5,_0x333db7,_0x317922,_0x57b605,_0x8c8701,_0x2d81e8,_0x5e3c66){const _0x3eeee1=a115_0x30712b,{activationDefToCreateRequest:_0x217f56,yamlRuleToApi:_0x1b4d3e}=_0x5e3c66,{pendingEmbeddedSegments:_0x4cd491,pendingEmbeddedActivations:_0x17857f,embeddedSegmentNameToId:_0x43fbf9}=_0x317922,_0x2163f5=JSON[_0x3eeee1(0xec)](JSON[_0x3eeee1(0x1a9)](_0x333db7));ensureJourneyDefaults(_0x2163f5[_0x3eeee1(0x188)]),stripPendingIds(_0x2163f5);const _0x57c76f=await _0x4660a5[_0x3eeee1(0xf1)][_0x3eeee1(0x1b8)](_0x2163f5),_0x5cee27=_0x57c76f['id'],_0x5012d7=new Map();for(const _0x35d4ae of _0x57c76f['attributes']['journeyStages']){_0x5012d7[_0x3eeee1(0x14a)](_0x35d4ae[_0x3eeee1(0x17f)][_0x3eeee1(0x116)](),_0x35d4ae['id']);}for(const [_0x58f42a,{definition:_0x120a7c}]of _0x4cd491){const _0x16fcd1=generateDeterministicJourneySegmentName(_0x3a72b5[_0x3eeee1(0xed)]['name'],_0x58f42a);_0x2d81e8[_0x3eeee1(0x103)]?.({'type':_0x3eeee1(0x110),'journeyName':_0x3a72b5[_0x3eeee1(0xed)][_0x3eeee1(0x17f)],'segmentName':_0x58f42a});const _0x56ce18=createSegmentIdResolver(_0x8c8701['segmentNameToId'],_0x58f42a),_0x5a685d=await resolveRuleSegmentIds(_0x120a7c['rule'],_0x56ce18),_0x3918ae=await _0x4660a5[_0x3eeee1(0x14c)][_0x3eeee1(0x113)]({'name':_0x16fcd1,'description':_0x120a7c[_0x3eeee1(0x186)]||'Entry\x20criteria:\x20'+_0x58f42a,'journeyId':_0x5cee27,'rule':_0x1b4d3e(_0x5a685d,!![]),'countPopulation':!![],'parentFolderId':_0x57b605['effectiveFolderId']||'','audienceId':_0x57b605['parentId']});_0x43fbf9[_0x3eeee1(0x14a)](_0x58f42a,_0x3918ae),_0x8c8701[_0x3eeee1(0x1ac)][_0x3eeee1(0x14a)](_0x58f42a,_0x3918ae),_0x2d81e8[_0x3eeee1(0x103)]?.({'type':_0x3eeee1(0x1a6),'journeyName':_0x3a72b5[_0x3eeee1(0xed)][_0x3eeee1(0x17f)],'segmentName':_0x58f42a});}const _0x332645=new Map();for(const [_0x2bcd8a,_0x2e6886]of _0x17857f){_0x2d81e8[_0x3eeee1(0x103)]?.({'type':_0x3eeee1(0x165),'journeyName':_0x3a72b5[_0x3eeee1(0xed)]['name'],'activationName':_0x2bcd8a});const _0x1fa73d=await _0x217f56(_0x2e6886,_0x8c8701['activationContext']),_0x5ec2be=await _0x4660a5[_0x3eeee1(0xf1)]['createActivation'](_0x5cee27,_0x1fa73d);_0x332645[_0x3eeee1(0x14a)](_0x2bcd8a,_0x5ec2be['id']),_0x317922['journeyActivationNameToId'][_0x3eeee1(0x14a)](_0x2bcd8a,_0x5ec2be['id']),_0x2d81e8[_0x3eeee1(0x103)]?.({'type':_0x3eeee1(0x181),'journeyName':_0x3a72b5[_0x3eeee1(0xed)][_0x3eeee1(0x17f)],'activationName':_0x2bcd8a});}const _0x1cb850=JSON['parse'](JSON[_0x3eeee1(0x1a9)](_0x333db7));return _0x1cb850['id']=_0x5cee27,ensureJourneyDefaults(_0x1cb850['attributes']),resolvePendingIdsInRequest(_0x1cb850,_0x333db7,_0x5012d7,_0x43fbf9,_0x332645,_0x2d81e8),await _0x4660a5[_0x3eeee1(0xf1)][_0x3eeee1(0x16d)](_0x5cee27,_0x1cb850),{'action':_0x3eeee1(0x144),'journeyId':_0x5cee27,'embeddedSegmentNameToId':_0x43fbf9};}function stripPendingIds(_0x250123){const _0x27d394=a115_0x30712b;for(const _0x371b9e of _0x250123['attributes'][_0x27d394(0x1c6)]||[]){_0x371b9e[_0x27d394(0x16f)]?.[_0x27d394(0x1a4)]&&isPendingSegmentId(_0x371b9e['entryCriteria'][_0x27d394(0x1a4)])&&delete _0x371b9e[_0x27d394(0x16f)];if(_0x371b9e[_0x27d394(0x12b)])for(const _0x366d7a of Object[_0x27d394(0x104)](_0x371b9e[_0x27d394(0x12b)])){const _0x3011d8=_0x371b9e[_0x27d394(0x12b)][_0x366d7a];_0x3011d8['type']===_0x27d394(0x1b2)&&_0x3011d8[_0x27d394(0x11c)]&&isPendingActivationId(_0x3011d8[_0x27d394(0x11c)])&&(_0x3011d8[_0x27d394(0x11c)]='');if(_0x3011d8[_0x27d394(0xf6)]===_0x27d394(0x1b6)&&_0x3011d8[_0x27d394(0x18a)])for(const _0x817b60 of _0x3011d8[_0x27d394(0x18a)]){_0x817b60[_0x27d394(0x1a4)]&&isPendingSegmentId(_0x817b60[_0x27d394(0x1a4)])&&(_0x817b60['segmentId']='');}_0x3011d8[_0x27d394(0xf6)]===_0x27d394(0x170)&&_0x3011d8['waitCondition']?.[_0x27d394(0x1a4)]&&isPendingSegmentId(_0x3011d8['waitCondition']['segmentId'])&&(_0x3011d8[_0x27d394(0x12c)][_0x27d394(0x1a4)]='');}}}function resolvePendingIdsInRequest(_0xd4acd6,_0x40e312,_0x1d8b38,_0x3be8e9,_0x2bad9c,_0x508402){const _0xa3473d=a115_0x30712b,_0x4edcec=(_0x2942b7,_0x24d82c)=>{const _0xc85d94=a115_0x11f4;if(!isPendingSegmentId(_0x2942b7))return _0x2942b7;const _0x1fc48f=extractPendingSegmentName(_0x2942b7),_0x3fdfb5=_0x3be8e9[_0xc85d94(0x13a)](_0x1fc48f);return!_0x3fdfb5&&_0x508402['logWarning']?.(_0xc85d94(0x119)+_0x1fc48f+'\x27\x20for\x20'+_0x24d82c),_0x3fdfb5;};if(_0xd4acd6[_0xa3473d(0x188)][_0xa3473d(0x1b0)]?.['segmentId']&&isPendingSegmentId(_0xd4acd6[_0xa3473d(0x188)][_0xa3473d(0x1b0)][_0xa3473d(0x1a4)])){const _0x224094=_0x4edcec(_0xd4acd6[_0xa3473d(0x188)][_0xa3473d(0x1b0)]['segmentId'],_0xa3473d(0x190));_0x224094&&(_0xd4acd6[_0xa3473d(0x188)][_0xa3473d(0x1b0)][_0xa3473d(0x1a4)]=_0x224094);}for(const _0x39384a of _0xd4acd6[_0xa3473d(0x188)][_0xa3473d(0x1c6)]||[]){const _0x46e3bf=_0x1d8b38[_0xa3473d(0x13a)](_0x39384a[_0xa3473d(0x17f)][_0xa3473d(0x116)]());_0x46e3bf&&(_0x39384a['id']=_0x46e3bf);if(_0x39384a['entryCriteria']?.[_0xa3473d(0x1a4)]&&isPendingSegmentId(_0x39384a[_0xa3473d(0x16f)][_0xa3473d(0x1a4)])){const _0x94a623=_0x4edcec(_0x39384a[_0xa3473d(0x16f)][_0xa3473d(0x1a4)],'stage\x20\x27'+_0x39384a[_0xa3473d(0x17f)]+'\x27\x20entry\x20criteria');_0x94a623&&(_0x39384a[_0xa3473d(0x16f)]['segmentId']=_0x94a623);}if(_0x39384a[_0xa3473d(0x184)])for(const _0x7a7b4c of _0x39384a[_0xa3473d(0x184)]){if(_0x7a7b4c[_0xa3473d(0x1a4)]&&isPendingSegmentId(_0x7a7b4c[_0xa3473d(0x1a4)])){const _0x5ce4c8=_0x4edcec(_0x7a7b4c[_0xa3473d(0x1a4)],_0xa3473d(0x125)+_0x39384a['name']+_0xa3473d(0x13c));_0x5ce4c8&&(_0x7a7b4c[_0xa3473d(0x1a4)]=_0x5ce4c8);}}if(_0x39384a[_0xa3473d(0x12d)]?.[_0xa3473d(0x1a4)]&&isPendingSegmentId(_0x39384a[_0xa3473d(0x12d)]['segmentId'])){const _0x21d882=_0x4edcec(_0x39384a[_0xa3473d(0x12d)][_0xa3473d(0x1a4)],_0xa3473d(0x125)+_0x39384a[_0xa3473d(0x17f)]+_0xa3473d(0x15f));_0x21d882&&(_0x39384a[_0xa3473d(0x12d)][_0xa3473d(0x1a4)]=_0x21d882);}if(_0x39384a[_0xa3473d(0x12b)]){const _0x3fbe9a=_0x5646cc=>_0x40e312['attributes']['journeyStages'][_0xa3473d(0x1bf)](_0x31ea5a=>_0x31ea5a['name']['toLowerCase']()===_0x39384a[_0xa3473d(0x17f)]['toLowerCase']())?.[_0xa3473d(0x12b)]?.[_0x5646cc];for(const _0x4039dc of Object[_0xa3473d(0x104)](_0x39384a[_0xa3473d(0x12b)])){const _0x3cf781=_0x39384a[_0xa3473d(0x12b)][_0x4039dc],_0x3da163=_0x3fbe9a(_0x4039dc);if(_0x3cf781[_0xa3473d(0xf6)]===_0xa3473d(0x1b2)&&_0x3cf781[_0xa3473d(0x11c)]&&(isPendingActivationId(_0x3cf781[_0xa3473d(0x11c)])||_0x3cf781[_0xa3473d(0x11c)]==='')){if(_0x3da163?.[_0xa3473d(0x11c)]&&isPendingActivationId(_0x3da163[_0xa3473d(0x11c)])){const _0x24f76d=extractPendingActivationName(_0x3da163[_0xa3473d(0x11c)]),_0x431e4a=_0x2bad9c[_0xa3473d(0x13a)](_0x24f76d);_0x431e4a&&(_0x3cf781[_0xa3473d(0x11c)]=_0x431e4a);}}if(_0x3cf781[_0xa3473d(0xf6)]==='DecisionPoint'&&_0x3cf781['branches']&&_0x3da163?.[_0xa3473d(0x18a)])for(let _0x36a50c=0x0;_0x36a50c<_0x3cf781[_0xa3473d(0x18a)][_0xa3473d(0x134)];_0x36a50c++){const _0x13dfc2=_0x3cf781[_0xa3473d(0x18a)][_0x36a50c],_0x9b7e12=_0x3da163[_0xa3473d(0x18a)][_0x36a50c];if(_0x9b7e12?.[_0xa3473d(0x1a4)]&&isPendingSegmentId(_0x9b7e12[_0xa3473d(0x1a4)])){const _0x3e523f=_0x4edcec(_0x9b7e12[_0xa3473d(0x1a4)],_0xa3473d(0x125)+_0x39384a[_0xa3473d(0x17f)]+_0xa3473d(0xf7)+(_0x13dfc2[_0xa3473d(0x17f)]||_0x36a50c)+'\x27');_0x3e523f&&(_0x13dfc2['segmentId']=_0x3e523f);}}if(_0x3cf781[_0xa3473d(0xf6)]===_0xa3473d(0x170)&&_0x3cf781[_0xa3473d(0x12c)]?.[_0xa3473d(0x1a4)]&&_0x3da163?.['waitCondition']?.[_0xa3473d(0x1a4)]&&isPendingSegmentId(_0x3da163['waitCondition']['segmentId'])){const _0xf22452=_0x4edcec(_0x3da163[_0xa3473d(0x12c)][_0xa3473d(0x1a4)],_0xa3473d(0x125)+_0x39384a[_0xa3473d(0x17f)]+'\x27\x20wait\x20condition');_0xf22452&&(_0x3cf781[_0xa3473d(0x12c)][_0xa3473d(0x1a4)]=_0xf22452);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xb1a2e1,_0x44e25b){const _0x4fbbf7=a116_0x3d36,_0x5502af=_0xb1a2e1();while(!![]){try{const _0x461a1b=-parseInt(_0x4fbbf7(0x14a))/0x1*(parseInt(_0x4fbbf7(0x151))/0x2)+-parseInt(_0x4fbbf7(0x149))/0x3+parseInt(_0x4fbbf7(0x14b))/0x4+parseInt(_0x4fbbf7(0x14d))/0x5*(parseInt(_0x4fbbf7(0x14f))/0x6)+parseInt(_0x4fbbf7(0x150))/0x7*(-parseInt(_0x4fbbf7(0x147))/0x8)+parseInt(_0x4fbbf7(0x142))/0x9*(parseInt(_0x4fbbf7(0x14e))/0xa)+parseInt(_0x4fbbf7(0x143))/0xb;if(_0x461a1b===_0x44e25b)break;else _0x5502af['push'](_0x5502af['shift']());}catch(_0x59a7bb){_0x5502af['push'](_0x5502af['shift']());}}}(a116_0x2d13,0x6358b));export function buildFolderIdToPathMap(_0x338df3){const _0x11ac20=a116_0x3d36,_0x1c0094=new Map(),_0x2ba81f=new Map();for(const _0x15b93b of _0x338df3){_0x2ba81f['set'](_0x15b93b['id'],_0x15b93b);}const _0x2f7473=new Set();for(const _0x341bfd of _0x338df3){!_0x341bfd[_0x11ac20(0x144)]&&_0x2f7473[_0x11ac20(0x148)](_0x341bfd['id']);}function _0x1c5a73(_0x8d378d){const _0x1e519d=_0x11ac20;if(_0x1c0094[_0x1e519d(0x14c)](_0x8d378d['id']))return _0x1c0094['get'](_0x8d378d['id']);if(_0x2f7473[_0x1e519d(0x14c)](_0x8d378d['id']))return _0x1c0094['set'](_0x8d378d['id'],''),'';if(_0x8d378d['parentFolderId']){const _0x5d2c44=_0x2ba81f[_0x1e519d(0x145)](_0x8d378d['parentFolderId']);if(_0x5d2c44){const _0x2b9d7d=_0x1c5a73(_0x5d2c44),_0x10a249=_0x2b9d7d?_0x2b9d7d+'/'+_0x8d378d['name']:_0x8d378d[_0x1e519d(0x141)];return _0x1c0094['set'](_0x8d378d['id'],_0x10a249),_0x10a249;}}const _0x144580=_0x8d378d['name'];return _0x1c0094[_0x1e519d(0x146)](_0x8d378d['id'],_0x144580),_0x144580;}for(const _0x247eb9 of _0x338df3){_0x1c5a73(_0x247eb9);}return _0x1c0094;}export function buildFolderPathToIdMap(_0x13e49b){const _0x47e937=a116_0x3d36,_0x4268b1=new Map(),_0x47cfc6=new Map();for(const _0x552426 of _0x13e49b){_0x47cfc6[_0x47e937(0x146)](_0x552426['id'],_0x552426);}const _0x1d781c=new Set();for(const _0x123336 of _0x13e49b){!_0x123336[_0x47e937(0x144)]&&_0x1d781c['add'](_0x123336['id']);}function _0xf67f9d(_0x1c9cfd){const _0x3bbf5f=_0x47e937;if(_0x1d781c[_0x3bbf5f(0x14c)](_0x1c9cfd['id']))return'';if(_0x1c9cfd[_0x3bbf5f(0x144)]){const _0x4d5ddf=_0x47cfc6[_0x3bbf5f(0x145)](_0x1c9cfd[_0x3bbf5f(0x144)]);if(_0x4d5ddf){const _0x5db791=_0xf67f9d(_0x4d5ddf);return _0x5db791?_0x5db791+'/'+_0x1c9cfd['name']:_0x1c9cfd[_0x3bbf5f(0x141)];}}return _0x1c9cfd[_0x3bbf5f(0x141)];}for(const _0x4405b2 of _0x13e49b){const _0x1e379c=_0xf67f9d(_0x4405b2);_0x4268b1[_0x47e937(0x146)](_0x1e379c,_0x4405b2['id']);}return _0x4268b1;}export function buildFolderMaps(_0x334e4c){const _0x5dab55=a116_0x3d36,_0x380748=buildFolderIdToPathMap(_0x334e4c),_0x35b61c=new Map();for(const [_0x215846,_0x577727]of _0x380748){_0x35b61c[_0x5dab55(0x146)](_0x577727,_0x215846);}return{'idToPath':_0x380748,'pathToId':_0x35b61c};}function a116_0x3d36(_0x3dc9e6,_0x420375){_0x3dc9e6=_0x3dc9e6-0x141;const _0x2d13db=a116_0x2d13();let _0x3d3632=_0x2d13db[_0x3dc9e6];return _0x3d3632;}export function getFolderPath(_0x339af4,_0x5f13f8){const _0x3cab63=a116_0x3d36;if(!_0x339af4)return'';return _0x5f13f8[_0x3cab63(0x145)](_0x339af4)??'';}function a116_0x2d13(){const _0x3436ed=['12taaFxf','7zEZQah','4hOXeHH','name','52443ZCohFt','691570GFXpZW','parentFolderId','get','set','999272aNAxqN','add','1083609lbopWL','295624nKHnSn','2453728SmqhXk','has','315555sCVnmW','1170rjVynw'];a116_0x2d13=function(){return _0x3436ed;};return a116_0x2d13();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a117_0x5be5(){const _0x3a02ea=['parse','93799XwfpxP','root','49108ATOyHL','103068CSGhGK','Cannot\x20split\x20empty\x20path','File\x20not\x20found:\x20','split','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','exists','endsWith','Path\x20segment\x20cannot\x20be\x20empty','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','22DsGHHn','push','dirname','81DszCwo','name','.yaml','Relative\x20path\x20cannot\x20be\x20empty','segments','isAbsolute','43613508afDErj','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','replace','No\x20tdx.json\x20found\x20for\x20file:\x20','length','raw','3866390XpUJVV','22IVBzDp','1369263itLlLo','Path\x20attempts\x20to\x20navigate\x20above\x20root','Path\x20cannot\x20be\x20empty','resolve','72ZIDGLd','Cannot\x20navigate\x20above\x20root','4223511LjHEgm','join','trim','tdx.json','startsWith','515oHWEEp','pop','segment','slice','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','readFile','type'];a117_0x5be5=function(){return _0x3a02ea;};return a117_0x5be5();}(function(_0x96e0ee,_0x3ca1bc){const _0x298c81=a117_0x3ffe,_0x39c5db=_0x96e0ee();while(!![]){try{const _0x951543=-parseInt(_0x298c81(0x8a))/0x1*(-parseInt(_0x298c81(0x76))/0x2)+-parseInt(_0x298c81(0x99))/0x3*(-parseInt(_0x298c81(0x8c))/0x4)+parseInt(_0x298c81(0x82))/0x5*(parseInt(_0x298c81(0x8d))/0x6)+-parseInt(_0x298c81(0x77))/0x7*(-parseInt(_0x298c81(0x7b))/0x8)+parseInt(_0x298c81(0x7d))/0x9+parseInt(_0x298c81(0xa5))/0xa*(-parseInt(_0x298c81(0x96))/0xb)+-parseInt(_0x298c81(0x9f))/0xc;if(_0x951543===_0x3ca1bc)break;else _0x39c5db['push'](_0x39c5db['shift']());}catch(_0x355a47){_0x39c5db['push'](_0x39c5db['shift']());}}}(a117_0x5be5,0xe9101));import a117_0x27ad2c from'path';import{parse as a117_0x1047eb}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a117_0x3ffe(_0x569660,_0x2d8421){_0x569660=_0x569660-0x76;const _0x5be591=a117_0x5be5();let _0x3ffe09=_0x5be591[_0x569660];return _0x3ffe09;}export function parsePath(_0x19bf7c){const _0x3c890e=a117_0x3ffe;if(!_0x19bf7c||_0x19bf7c[_0x3c890e(0x7f)]()==='')throw new Error(_0x3c890e(0x79));const _0x503453=_0x19bf7c[_0x3c890e(0x7f)]();if(_0x503453==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x19bf7c};const _0x1274de=_0x503453['startsWith']('/')?_0x503453['substring'](0x1):_0x503453,_0x5d3f22=_0x1274de[_0x3c890e(0x90)]('/')['filter'](_0x441408=>_0x441408!=='');if(_0x5d3f22[_0x3c890e(0xa3)]===0x0)throw new Error(_0x3c890e(0x91));const _0x233362=_0x503453[_0x3c890e(0x81)]('/')||!isRelativePathSegment(_0x5d3f22[0x0]);for(const _0x57a2f5 of _0x5d3f22){validatePathSegment(_0x57a2f5);}return{'segments':_0x5d3f22,'isAbsolute':_0x233362,'raw':_0x19bf7c};}function isRelativePathSegment(_0x2bb222){return _0x2bb222==='.'||_0x2bb222==='..';}function validatePathSegment(_0x13f234){const _0x16bd98=a117_0x3ffe;if(_0x13f234==='')throw new Error(_0x16bd98(0x94));if(_0x13f234==='.'||_0x13f234==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x13f234))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x13f234);if(_0x13f234!==_0x13f234[_0x16bd98(0x7f)]()){}}export function validatePath(_0x414165){const _0x3c4cc4=a117_0x3ffe;if(_0x414165[_0x3c4cc4(0x9d)][_0x3c4cc4(0xa3)]===0x0&&!_0x414165[_0x3c4cc4(0x9e)])throw new Error(_0x3c4cc4(0x9c));if(_0x414165[_0x3c4cc4(0x9e)]){if(_0x414165[_0x3c4cc4(0x9d)][0x0]==='..')throw new Error(_0x3c4cc4(0xa0));let _0x4e7b71=0x0;for(const _0x56e025 of _0x414165[_0x3c4cc4(0x9d)]){if(_0x56e025==='..'){if(_0x4e7b71===0x0)throw new Error(_0x3c4cc4(0x78));_0x4e7b71--;}else _0x56e025!=='.'&&_0x4e7b71++;}}}export function joinPaths(_0x2fb526,_0x56493a){const _0x46bbab=a117_0x3ffe;if(!_0x2fb526||_0x2fb526==='/')return _0x56493a;if(!_0x56493a||_0x56493a==='.')return _0x2fb526;if(_0x56493a[_0x46bbab(0x81)]('/'))return _0x56493a;const _0x100d8d=parsePath(_0x2fb526),_0x6486c3=parsePath(_0x56493a),_0x3b2b47=[..._0x100d8d[_0x46bbab(0x9d)]];for(const _0x2e448b of _0x6486c3[_0x46bbab(0x9d)]){if(_0x2e448b==='.')continue;else{if(_0x2e448b==='..'){if(_0x3b2b47[_0x46bbab(0xa3)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x3b2b47[_0x46bbab(0x83)]();}else _0x3b2b47['push'](_0x2e448b);}}const _0x1f95bf=_0x3b2b47[_0x46bbab(0x7e)]('/');return _0x100d8d[_0x46bbab(0xa4)][_0x46bbab(0x81)]('/')?'/'+_0x1f95bf:_0x1f95bf;}export function normalizePath(_0x52c2b4){const _0x5edaa6=a117_0x3ffe,_0x161582=parsePath(_0x52c2b4),_0x3a9640=[];for(const _0x2e7755 of _0x161582[_0x5edaa6(0x9d)]){if(_0x2e7755==='.')continue;else{if(_0x2e7755==='..'){if(_0x3a9640[_0x5edaa6(0xa3)]===0x0){if(_0x161582[_0x5edaa6(0x9e)])throw new Error(_0x5edaa6(0x7c));_0x3a9640[_0x5edaa6(0x97)]('..');}else _0x3a9640[_0x3a9640[_0x5edaa6(0xa3)]-0x1]==='..'?_0x3a9640[_0x5edaa6(0x97)]('..'):_0x3a9640[_0x5edaa6(0x83)]();}else _0x3a9640[_0x5edaa6(0x97)](_0x2e7755);}}if(_0x3a9640[_0x5edaa6(0xa3)]===0x0)return _0x161582[_0x5edaa6(0x9e)]?'/':'.';const _0x17feb2=_0x3a9640[_0x5edaa6(0x7e)]('/');return _0x161582[_0x5edaa6(0xa4)][_0x5edaa6(0x81)]('/')?'/'+_0x17feb2:_0x17feb2;}export function getParentPath(_0x199905){const _0x2147da=a117_0x3ffe,_0x1d4010=parsePath(_0x199905);if(_0x1d4010[_0x2147da(0x9d)][_0x2147da(0xa3)]<=0x1)return'/';const _0x1ba802=_0x1d4010[_0x2147da(0x9d)]['slice'](0x0,-0x1)['join']('/');return _0x1d4010[_0x2147da(0xa4)][_0x2147da(0x81)]('/')?'/'+_0x1ba802:_0x1ba802;}export function getBaseName(_0x484b7e){const _0x3271ff=a117_0x3ffe,_0x5ab51c=parsePath(_0x484b7e);return _0x5ab51c[_0x3271ff(0x9d)][_0x5ab51c[_0x3271ff(0x9d)][_0x3271ff(0xa3)]-0x1]||'';}export function isChildPath(_0x4065d2,_0x248b97){const _0x4e9fe9=a117_0x3ffe,_0x512ddb=parsePath(_0x4065d2),_0x2479d8=parsePath(_0x248b97);if(_0x512ddb['segments']['length']<=_0x2479d8[_0x4e9fe9(0x9d)]['length'])return![];for(let _0x3918dd=0x0;_0x3918dd<_0x2479d8[_0x4e9fe9(0x9d)][_0x4e9fe9(0xa3)];_0x3918dd++){if(_0x512ddb[_0x4e9fe9(0x9d)][_0x3918dd]!==_0x2479d8[_0x4e9fe9(0x9d)][_0x3918dd])return![];}return!![];}export function splitPath(_0x234706){const _0x4e4e84=a117_0x3ffe,_0x378abc=parsePath(_0x234706);if(_0x378abc['segments'][_0x4e4e84(0xa3)]===0x0)throw new Error(_0x4e4e84(0x8e));if(_0x378abc[_0x4e4e84(0x9d)][_0x4e4e84(0xa3)]===0x1)return{'parent':_0x378abc['segments'][0x0]};return{'parent':_0x378abc['segments'][0x0],'child':_0x378abc['segments'][_0x4e4e84(0x85)](0x1)[_0x4e4e84(0x7e)]('/')};}export function isYamlFilePath(_0x344381){const _0x196dea=a117_0x3ffe;return _0x344381[_0x196dea(0x93)]('.yml')||_0x344381[_0x196dea(0x93)](_0x196dea(0x9b));}export async function resolveYamlFilePath(_0x55ff52,_0x2ed5e2=nodeFileSystem){const _0x368afe=a117_0x3ffe,_0x4328d7=a117_0x27ad2c[_0x368afe(0x7a)](_0x55ff52);if(!await _0x2ed5e2[_0x368afe(0x92)](_0x4328d7))throw new Error(_0x368afe(0x8f)+_0x55ff52);let _0x541cec=a117_0x27ad2c[_0x368afe(0x98)](_0x4328d7),_0x554906=null,_0x5c767d=null;const _0x32891d=a117_0x27ad2c['parse'](_0x541cec)[_0x368afe(0x8b)];while(_0x541cec!==_0x32891d){const _0x5a2f0b=a117_0x27ad2c[_0x368afe(0x7e)](_0x541cec,_0x368afe(0x80));if(await _0x2ed5e2[_0x368afe(0x92)](_0x5a2f0b)){_0x554906=_0x5a2f0b,_0x5c767d=_0x541cec;break;}_0x541cec=a117_0x27ad2c[_0x368afe(0x98)](_0x541cec);}if(!_0x554906||!_0x5c767d)throw new Error(_0x368afe(0xa2)+_0x55ff52);const _0x532a7d=await _0x2ed5e2[_0x368afe(0x87)](_0x554906),_0x338162=JSON[_0x368afe(0x89)](_0x532a7d),_0x1e6338=_0x338162['parent_segment'];if(!_0x1e6338)throw new Error(_0x368afe(0x86));const _0x29164d=await _0x2ed5e2[_0x368afe(0x87)](_0x4328d7),_0x9dd5f7=a117_0x1047eb(_0x29164d),_0x11a075=_0x9dd5f7[_0x368afe(0x9a)];if(!_0x11a075)throw new Error(_0x368afe(0x95)+_0x55ff52);const _0x6305a4=_0x9dd5f7[_0x368afe(0x88)]==='journey'?'journey':_0x368afe(0x84),_0x950c39=a117_0x27ad2c['relative'](_0x5c767d,_0x4328d7),_0x4eec02=a117_0x27ad2c[_0x368afe(0x98)](_0x950c39),_0x29b44b=_0x4eec02==='.'?'':_0x4eec02[_0x368afe(0xa1)](/\\/g,'/'),_0x4d13fc=_0x29b44b?_0x1e6338+'/'+_0x29b44b+'/'+_0x11a075:_0x1e6338+'/'+_0x11a075;return{'parentSegment':_0x1e6338,'segmentName':_0x11a075,'folderPath':_0x29b44b,'fullPath':_0x4d13fc,'resourceType':_0x6305a4};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38b0a8,_0x36af1a){const _0x3d6bb8=a118_0x33d7,_0xdae667=_0x38b0a8();while(!![]){try{const _0x4536a9=parseInt(_0x3d6bb8(0x118))/0x1+parseInt(_0x3d6bb8(0x10f))/0x2*(parseInt(_0x3d6bb8(0x116))/0x3)+-parseInt(_0x3d6bb8(0x115))/0x4*(parseInt(_0x3d6bb8(0x10e))/0x5)+-parseInt(_0x3d6bb8(0x111))/0x6+parseInt(_0x3d6bb8(0x110))/0x7+-parseInt(_0x3d6bb8(0x112))/0x8+-parseInt(_0x3d6bb8(0x11a))/0x9*(-parseInt(_0x3d6bb8(0x119))/0xa);if(_0x4536a9===_0x36af1a)break;else _0xdae667['push'](_0xdae667['shift']());}catch(_0x47050f){_0xdae667['push'](_0xdae667['shift']());}}}(a118_0x1bb4,0x5a1be));function a118_0x33d7(_0x1b45ac,_0x2d3bad){_0x1b45ac=_0x1b45ac-0x10c;const _0x1bb47f=a118_0x1bb4();let _0x33d719=_0x1bb47f[_0x1b45ac];return _0x33d719;}export function parseSegmentRef(_0x5b95bd){const _0x25fbea=a118_0x33d7,_0x47a70d=_0x5b95bd[_0x25fbea(0x10d)]('/');if(_0x47a70d===-0x1)return{'parentId':_0x5b95bd};if(_0x47a70d===0x0)throw new Error(_0x25fbea(0x117)+_0x5b95bd+_0x25fbea(0x10c));const _0x99da8d=_0x5b95bd[_0x25fbea(0x113)](0x0,_0x47a70d),_0xa8daef=_0x5b95bd[_0x25fbea(0x113)](_0x47a70d+0x1);if(_0xa8daef==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x5b95bd+_0x25fbea(0x114));return{'parentId':_0x99da8d,'childId':_0xa8daef};}function a118_0x1bb4(){const _0x4a4255=['.\x20Parent\x20name\x20cannot\x20be\x20empty','indexOf','20GOPaXw','4Rxqqvc','3236681TTmRdv','1249386XqxeBZ','2227752qJWeRv','substring','.\x20Child\x20name\x20cannot\x20be\x20empty','563580SSxKPZ','417762GFDQQC','Invalid\x20segment\x20reference\x20format:\x20','399506gisfKg','10ScuzuD','2510721CEKACt'];a118_0x1bb4=function(){return _0x4a4255;};return a118_0x1bb4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2309f1,_0x191bb7){const _0x49124f=a119_0x2867,_0x215ab1=_0x2309f1();while(!![]){try{const _0x380813=-parseInt(_0x49124f(0x1d8))/0x1*(-parseInt(_0x49124f(0x1bb))/0x2)+-parseInt(_0x49124f(0x1cb))/0x3+-parseInt(_0x49124f(0x1bf))/0x4+parseInt(_0x49124f(0x1c8))/0x5*(-parseInt(_0x49124f(0x1e0))/0x6)+parseInt(_0x49124f(0x1b8))/0x7*(parseInt(_0x49124f(0x1db))/0x8)+parseInt(_0x49124f(0x1de))/0x9+parseInt(_0x49124f(0x1b9))/0xa;if(_0x380813===_0x191bb7)break;else _0x215ab1['push'](_0x215ab1['shift']());}catch(_0x11d0a5){_0x215ab1['push'](_0x215ab1['shift']());}}}(a119_0x2bff,0xd6aa3));import a119_0x2e381c from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x27fd53){const _0x279085=a119_0x2867;return _0x27fd53['type']!==_0x279085(0x1d4);}export function isScopedResolution(_0x4be188){const _0x30c8f6=a119_0x2867;return _0x4be188['type']==='directory'||_0x4be188[_0x30c8f6(0x1df)]===_0x30c8f6(0x1d6)||_0x4be188[_0x30c8f6(0x1df)]===_0x30c8f6(0x1c3);}export function getScopedDetails(_0x3c373d){const _0x2e18b6=a119_0x2867;if(isScopedResolution(_0x3c373d))return{'isScoped':_0x3c373d[_0x2e18b6(0x1d7)],'scopedFolderPath':_0x3c373d[_0x2e18b6(0x1c7)]};return undefined;}async function findTdxConfigAsync(_0x4a11c3,_0x48ecac){const _0x41401e=a119_0x2867;let _0x310e50=a119_0x2e381c[_0x41401e(0x1bc)](_0x4a11c3);const _0x5ecd95=a119_0x2e381c[_0x41401e(0x1e1)](_0x310e50)['root'];while(_0x310e50!==_0x5ecd95){const _0x280383=a119_0x2e381c['join'](_0x310e50,'tdx.json');if(await _0x48ecac[_0x41401e(0x1d2)](_0x280383))try{const _0x27fd29=await _0x48ecac[_0x41401e(0x1c0)](_0x280383),_0x36ce39=JSON[_0x41401e(0x1e1)](_0x27fd29);if(_0x36ce39['parent_segment']&&typeof _0x36ce39[_0x41401e(0x1c1)]===_0x41401e(0x1b7))return{'configPath':_0x280383,'configDir':_0x310e50,'parentSegment':_0x36ce39[_0x41401e(0x1c1)]};}catch{}_0x310e50=a119_0x2e381c[_0x41401e(0x1b2)](_0x310e50);}return null;}function a119_0x2867(_0x3785c3,_0x2263be){_0x3785c3=_0x3785c3-0x1ae;const _0x2bfff7=a119_0x2bff();let _0x2867bf=_0x2bfff7[_0x3785c3];return _0x2867bf;}function calculateScopedPath(_0x468def,_0x49849d){const _0x459d49=a119_0x2867,_0x41f046=a119_0x2e381c[_0x459d49(0x1d0)](_0x49849d,_0x468def),_0x217c84=_0x41f046!==''&&_0x41f046!=='.'&&!_0x41f046[_0x459d49(0x1b3)]('..');return{'isScoped':_0x217c84,'scopedFolderPath':_0x217c84?_0x41f046['replace'](/\\/g,'/'):''};}function a119_0x2bff(){const _0x2e24f9=['parent_segment','file_not_found','context','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','File\x20not\x20found','No\x20tdx.json\x20found\x20for\x20file:\x20','scopedFolderPath','6195hNgbLN','File\x20not\x20found:\x20','trim','2708889DjOfQP','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','folderPath','parentSegment','directory','relative','stat','exists','includes','error','basename','file','isScoped','47rOxyof','no_config','match','744rITFym','journey','Parent\x20segment\x20not\x20specified','798012IQAjVn','type','660HrUpAX','parse','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','isFile','invalid_yaml','segmentName','dirname','startsWith','No\x20tdx.json\x20found','no_parent','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','string','20993cAGREV','10661670PdcjDG','configDir','65798InWjXS','resolve','resourceType','parent_name','4245900MXUEEC','readFile'];a119_0x2bff=function(){return _0x2e24f9;};return a119_0x2bff();}export async function resolveTarget(_0xff844b){const _0x3e172d=a119_0x2867,{arg:_0x27f9df,contextParent:_0x5e7ae5,cwd:cwd=process['cwd'](),fs:fs=nodeFileSystem}=_0xff844b;if(_0x27f9df&&isYamlFilePath(_0x27f9df))try{const _0x951649=await resolveYamlFilePath(_0x27f9df,fs),_0x12373f=a119_0x2e381c['resolve'](_0x27f9df),_0x23e2bf=a119_0x2e381c[_0x3e172d(0x1b2)](_0x12373f),_0x3f050c=await findTdxConfigAsync(_0x23e2bf,fs);if(!_0x3f050c){if(_0x5e7ae5){const _0x2db3ab=a119_0x2e381c[_0x3e172d(0x1b2)](_0x12373f);return{'type':_0x3e172d(0x1d6),'parentName':_0x5e7ae5,'targetDir':_0x2db3ab,'configRoot':_0x2db3ab,'filePath':_0x12373f,'resourceName':_0x951649['segmentName'],'folderPath':_0x951649[_0x3e172d(0x1cd)],'resourceType':_0x951649[_0x3e172d(0x1bd)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x3e172d(0x1d4),'errorCode':_0x3e172d(0x1d9),'message':_0x3e172d(0x1c6)+_0x27f9df,'arg':_0x27f9df,'helpText':_0x3e172d(0x1c4)};}const _0x1eded2=calculateScopedPath(_0x23e2bf,_0x3f050c[_0x3e172d(0x1ba)]);return{'type':_0x3e172d(0x1d6),'parentName':_0x3f050c[_0x3e172d(0x1ce)],'targetDir':_0x3f050c[_0x3e172d(0x1ba)],'configRoot':_0x3f050c[_0x3e172d(0x1ba)],'filePath':_0x12373f,'resourceName':_0x951649[_0x3e172d(0x1b1)],'folderPath':_0x951649[_0x3e172d(0x1cd)],'resourceType':_0x951649['resourceType'],'isScoped':_0x1eded2[_0x3e172d(0x1d7)],'scopedFolderPath':_0x1eded2[_0x3e172d(0x1c7)]};}catch(_0xa46c70){const _0x2fd687=_0xa46c70 instanceof Error?_0xa46c70['message']:String(_0xa46c70);if(_0x2fd687[_0x3e172d(0x1d3)](_0x3e172d(0x1c5)))return{'type':_0x3e172d(0x1d4),'errorCode':_0x3e172d(0x1c2),'message':_0x3e172d(0x1c9)+_0x27f9df,'arg':_0x27f9df};if(_0x2fd687[_0x3e172d(0x1d3)](_0x3e172d(0x1b4))){if(_0x5e7ae5){const _0x188cba=a119_0x2e381c[_0x3e172d(0x1bc)](_0x27f9df);if(await fs[_0x3e172d(0x1d2)](_0x188cba)){const _0x37a67f=a119_0x2e381c['dirname'](_0x188cba),_0x138421=await fs['readFile'](_0x188cba),_0x299654=_0x138421[_0x3e172d(0x1da)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x59df2c=_0x138421[_0x3e172d(0x1da)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x2ec8e9=_0x299654?_0x299654[0x1][_0x3e172d(0x1ca)]():a119_0x2e381c[_0x3e172d(0x1d5)](_0x27f9df,a119_0x2e381c['extname'](_0x27f9df)),_0x22464a=_0x59df2c&&_0x59df2c[0x1][_0x3e172d(0x1ca)]()===_0x3e172d(0x1dc)?_0x3e172d(0x1dc):'segment';return{'type':_0x3e172d(0x1d6),'parentName':_0x5e7ae5,'targetDir':_0x37a67f,'configRoot':_0x37a67f,'filePath':_0x188cba,'resourceName':_0x2ec8e9,'folderPath':'','resourceType':_0x22464a,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x3e172d(0x1d4),'errorCode':_0x3e172d(0x1d9),'message':_0x3e172d(0x1c6)+_0x27f9df,'arg':_0x27f9df,'helpText':_0x3e172d(0x1c4)};}return{'type':_0x3e172d(0x1d4),'errorCode':_0x3e172d(0x1b0),'message':_0x2fd687,'arg':_0x27f9df};}if(_0x27f9df){const _0x18037e=a119_0x2e381c[_0x3e172d(0x1bc)](cwd,_0x27f9df);let _0x346476=null;try{_0x346476=await fs[_0x3e172d(0x1d1)](_0x18037e);}catch{}if(_0x346476?.['isDirectory']()){const _0x5cf050=await findTdxConfigAsync(_0x18037e,fs);if(_0x5cf050){const _0x12d8b3=calculateScopedPath(_0x18037e,_0x5cf050[_0x3e172d(0x1ba)]);return{'type':_0x3e172d(0x1cf),'parentName':_0x5cf050[_0x3e172d(0x1ce)],'targetDir':_0x18037e,'configRoot':_0x5cf050['configDir'],'isScoped':_0x12d8b3[_0x3e172d(0x1d7)],'scopedFolderPath':_0x12d8b3[_0x3e172d(0x1c7)]};}if(_0x5e7ae5)return{'type':_0x3e172d(0x1cf),'parentName':_0x5e7ae5,'targetDir':_0x18037e,'configRoot':_0x18037e,'isScoped':![],'scopedFolderPath':''};return{'type':_0x3e172d(0x1d4),'errorCode':'no_config','message':_0x3e172d(0x1b6)+_0x27f9df,'arg':_0x27f9df,'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(_0x346476?.[_0x3e172d(0x1af)]())return{'type':_0x3e172d(0x1d4),'errorCode':_0x3e172d(0x1b0),'message':'Not\x20a\x20YAML\x20file:\x20'+_0x27f9df,'arg':_0x27f9df,'helpText':_0x3e172d(0x1ae)};const _0x48e0da=sanitizeFileName(_0x27f9df),_0x3c2981=getSegmentRootDir(_0x48e0da,cwd);return{'type':_0x3e172d(0x1be),'parentName':_0x27f9df,'targetDir':_0x3c2981,'configRoot':_0x3c2981};}const _0x1002cf=await findTdxConfigAsync(cwd,fs);if(_0x1002cf){const _0x3fcae6=calculateScopedPath(cwd,_0x1002cf[_0x3e172d(0x1ba)]);return{'type':_0x3e172d(0x1c3),'parentName':_0x1002cf[_0x3e172d(0x1ce)],'targetDir':cwd,'configRoot':_0x1002cf[_0x3e172d(0x1ba)],'isScoped':_0x3fcae6['isScoped'],'scopedFolderPath':_0x3fcae6[_0x3e172d(0x1c7)]};}if(_0x5e7ae5){const _0x30dfa3=sanitizeFileName(_0x5e7ae5),_0x163008=getSegmentRootDir(_0x30dfa3,cwd);return{'type':_0x3e172d(0x1c3),'parentName':_0x5e7ae5,'targetDir':_0x163008,'configRoot':_0x163008,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x3e172d(0x1d4),'errorCode':_0x3e172d(0x1b5),'message':_0x3e172d(0x1dd),'helpText':_0x3e172d(0x1cc)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a120_0x2fdbe2=a120_0x232f;(function(_0x324546,_0x4eedc7){const _0x4800f2=a120_0x232f,_0x39b7b7=_0x324546();while(!![]){try{const _0x1ebf61=-parseInt(_0x4800f2(0x14c))/0x1+parseInt(_0x4800f2(0x14e))/0x2*(parseInt(_0x4800f2(0x156))/0x3)+-parseInt(_0x4800f2(0x142))/0x4*(parseInt(_0x4800f2(0x14b))/0x5)+-parseInt(_0x4800f2(0x144))/0x6*(parseInt(_0x4800f2(0x159))/0x7)+parseInt(_0x4800f2(0x141))/0x8+-parseInt(_0x4800f2(0x14d))/0x9+parseInt(_0x4800f2(0x147))/0xa;if(_0x1ebf61===_0x4eedc7)break;else _0x39b7b7['push'](_0x39b7b7['shift']());}catch(_0x3b0b67){_0x39b7b7['push'](_0x39b7b7['shift']());}}}(a120_0x4acb,0xba1bd));import{existsSync,readFileSync}from'fs';function a120_0x4acb(){const _0x470e37=['segments','1102557oZBABJ','root','parent_segment','364nnkqTU','cwd','5110152MgLyzY','1092iDpWcz','join','55074ShOQtZ','parse','Invalid\x20tdx.json:\x20expected\x20object','827050jKErdi','resolve','startsWith','dirname','635fmWvPa','157064fmQeVf','3534183BLCOjU','6osrtuf','stringify','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','tdx.json','Invalid\x20JSON\x20in\x20','replace','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field'];a120_0x4acb=function(){return _0x470e37;};return a120_0x4acb();}import a120_0x160b4a from'path';const TDX_CONFIG_FILE=a120_0x2fdbe2(0x151),SEGMENTS_DIR=a120_0x2fdbe2(0x155);export function findTdxConfigPath(_0x393794=process[a120_0x2fdbe2(0x140)]()){const _0x26ef81=a120_0x2fdbe2;let _0x25ee4e=a120_0x160b4a[_0x26ef81(0x148)](_0x393794);const _0xea1141=a120_0x160b4a[_0x26ef81(0x145)](_0x25ee4e)[_0x26ef81(0x157)];while(_0x25ee4e!==_0xea1141){const _0x3eb164=a120_0x160b4a[_0x26ef81(0x143)](_0x25ee4e,TDX_CONFIG_FILE);if(existsSync(_0x3eb164))return _0x3eb164;_0x25ee4e=a120_0x160b4a[_0x26ef81(0x14a)](_0x25ee4e);}return null;}export function loadTdxConfig(_0x5ecd7d){const _0x3a89d1=a120_0x2fdbe2,_0x49c295=readFileSync(_0x5ecd7d,'utf-8');let _0x18b243;try{_0x18b243=JSON[_0x3a89d1(0x145)](_0x49c295);}catch{throw new Error(_0x3a89d1(0x152)+_0x5ecd7d);}if(!_0x18b243||typeof _0x18b243!=='object')throw new Error(_0x3a89d1(0x146));const _0x53140a=_0x18b243;if(!_0x53140a[_0x3a89d1(0x158)]||typeof _0x53140a[_0x3a89d1(0x158)]!=='string')throw new Error(_0x3a89d1(0x154));return{'parent_segment':_0x53140a[_0x3a89d1(0x158)]};}export function findTdxConfig(_0x5de27b=process[a120_0x2fdbe2(0x140)]()){const _0x37b427=a120_0x2fdbe2,_0x4f2567=findTdxConfigPath(_0x5de27b);if(!_0x4f2567)throw new Error(_0x37b427(0x150));const _0x205b72=loadTdxConfig(_0x4f2567),_0x150d70=a120_0x160b4a[_0x37b427(0x14a)](_0x4f2567);return{'config':_0x205b72,'configPath':_0x4f2567,'configDir':_0x150d70};}function a120_0x232f(_0x10abb3,_0x5dc268){_0x10abb3=_0x10abb3-0x140;const _0x4acb92=a120_0x4acb();let _0x232f43=_0x4acb92[_0x10abb3];return _0x232f43;}export function tryFindTdxConfig(_0x55121c){try{return findTdxConfig(_0x55121c);}catch{return null;}}export function getSegmentRootDir(_0x2a61fc,_0x4037d8=process['cwd']()){const _0x37744e=a120_0x2fdbe2;return a120_0x160b4a[_0x37744e(0x143)](_0x4037d8,SEGMENTS_DIR,_0x2a61fc);}export function getTdxConfigPath(_0x351087,_0x4d01f0=process['cwd']()){const _0x5df532=a120_0x2fdbe2;return a120_0x160b4a[_0x5df532(0x143)](getSegmentRootDir(_0x351087,_0x4d01f0),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x3b9841,_0x4b47db){const _0x46a61d=a120_0x2fdbe2,_0x3e5f86=a120_0x160b4a[_0x46a61d(0x148)](_0x3b9841),_0x384d29=a120_0x160b4a['relative'](_0x4b47db,_0x3e5f86);if(_0x384d29[_0x46a61d(0x149)]('..'))return'';return _0x384d29;}export function localPathToTdFolderPath(_0xcc6038){const _0xbc0863=a120_0x2fdbe2,_0x407369=a120_0x160b4a[_0xbc0863(0x14a)](_0xcc6038);if(_0x407369==='.'||_0x407369==='')return'';return _0x407369[_0xbc0863(0x153)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x17cd01,_0x2ac585){const _0x54d7b1=a120_0x2fdbe2;if(!_0x17cd01)return _0x2ac585;return a120_0x160b4a[_0x54d7b1(0x143)](_0x2ac585,_0x17cd01);}export function createTdxConfigContent(_0xab90e6){const _0x2654b1=a120_0x2fdbe2,_0x382624={'parent_segment':_0xab90e6};return JSON[_0x2654b1(0x14f)](_0x382624,null,0x2)+'\x0a';}
|