@treasuredata/tdx 0.11.0 → 0.12.0
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 +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/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/context-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/parent-segment-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/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +39 -5
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +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/index.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/server.js +1 -1
- package/dist/proxy/session-cache.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/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +8 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +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.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +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.d.ts +80 -0
- package/dist/sdk/workflow/clone-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/clone-workflow.js +1 -0
- package/dist/sdk/workflow/clone-workflow.js.map +1 -0
- package/dist/sdk/workflow/index.d.ts +94 -0
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.d.ts +77 -0
- package/dist/sdk/workflow/pull-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/pull-workflow.js +1 -0
- package/dist/sdk/workflow/pull-workflow.js.map +1 -0
- package/dist/sdk/workflow/push-workflow.d.ts +66 -0
- package/dist/sdk/workflow/push-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/push-workflow.js +1 -0
- package/dist/sdk/workflow/push-workflow.js.map +1 -0
- package/dist/sdk/workflow/tdx-config.d.ts +110 -0
- package/dist/sdk/workflow/tdx-config.d.ts.map +1 -0
- package/dist/sdk/workflow/tdx-config.js +1 -0
- package/dist/sdk/workflow/tdx-config.js.map +1 -0
- package/dist/sdk/workflow/workflow-utils.d.ts +10 -7
- package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js.map +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/json-loader.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 a97_0x560ff4=a97_0x1212;(function(_0x4c1880,_0x587964){const _0x6a83ec=a97_0x1212,_0x4e7ca9=_0x4c1880();while(!![]){try{const _0x1d73f3=-parseInt(_0x6a83ec(0x1f3))/0x1+-parseInt(_0x6a83ec(0x18c))/0x2+-parseInt(_0x6a83ec(0x1ac))/0x3*(parseInt(_0x6a83ec(0x1de))/0x4)+parseInt(_0x6a83ec(0x21e))/0x5*(parseInt(_0x6a83ec(0x20f))/0x6)+-parseInt(_0x6a83ec(0x21c))/0x7+-parseInt(_0x6a83ec(0x1c5))/0x8+parseInt(_0x6a83ec(0x212))/0x9;if(_0x1d73f3===_0x587964)break;else _0x4e7ca9['push'](_0x4e7ca9['shift']());}catch(_0x28c9c9){_0x4e7ca9['push'](_0x4e7ca9['shift']());}}}(a97_0x5250,0x9b75e));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a97_0x560ff4(0x1b1);export function createPendingSegmentId(_0x32db08){return''+PENDING_SEGMENT_PREFIX+_0x32db08+'__';}export function isPendingSegmentId(_0x22bda4){const _0x74343a=a97_0x560ff4;return _0x22bda4[_0x74343a(0x152)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x245202){const _0x3619f0=a97_0x560ff4;return _0x245202[_0x3619f0(0x199)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x231542){return''+PENDING_ACTIVATION_PREFIX+_0x231542+'__';}export function isPendingActivationId(_0x251252){const _0xbbf0fe=a97_0x560ff4;return _0x251252[_0xbbf0fe(0x152)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x39f9ab){const _0x4cbc74=a97_0x560ff4;return _0x39f9ab[_0x4cbc74(0x199)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x50ac73,_0x58939f){const _0x423d33=a97_0x560ff4,_0x30610=_0x50ac73+'::'+(_0x58939f[_0x423d33(0x201)]()||_0x423d33(0x22f)),_0x4b40d7=createHash(_0x423d33(0x19a))[_0x423d33(0x1be)](_0x30610)[_0x423d33(0x1c4)](_0x423d33(0x237))['slice'](0x0,0xc);return _0x423d33(0x1ec)+_0x4b40d7;}export function ensureJourneyDefaults(_0x2f1a6b){const _0xc15899=a97_0x560ff4;!_0x2f1a6b[_0xc15899(0x15a)]&&(_0x2f1a6b['description']=''),!_0x2f1a6b[_0xc15899(0x1bd)]&&(_0x2f1a6b['state']=_0xc15899(0x210));}export function resolveTDFolderPath(_0x35a21a,_0x24a45a,_0x6d87f5){const _0x1d9526=a97_0x560ff4;if(!_0x24a45a)return _0x35a21a;if(_0x35a21a===_0x6d87f5||_0x35a21a[_0x1d9526(0x152)](_0x6d87f5+'/'))return _0x35a21a;return _0x35a21a?_0x6d87f5+'/'+_0x35a21a:_0x6d87f5;}export function addFoldersToCreate(_0x2bef1c,_0x2f512d,_0x1a6b52){const _0x4194c2=a97_0x560ff4;if(!_0x2bef1c)return;if(_0x2f512d['has'](_0x2bef1c))return;const _0x1178e4=_0x2bef1c['split']('/');let _0x1b9638='';for(const _0x1429e1 of _0x1178e4){_0x1b9638=_0x1b9638?_0x1b9638+'/'+_0x1429e1:_0x1429e1,!_0x2f512d[_0x4194c2(0x219)](_0x1b9638)&&_0x1a6b52[_0x4194c2(0x188)](_0x1b9638);}}import*as a97_0xb8392 from'yaml';import{readFileSync}from'fs';import a97_0x2db96c from'path';import{isJourneyDef,parseYamlString as a97_0x549390,toYamlString as a97_0x2102e8,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x4aef2e){const _0x7fa3a3=a97_0x560ff4;if(Array['isArray'](_0x4aef2e))return'['+_0x4aef2e[_0x7fa3a3(0x1b2)](_0x475bd8=>stableStringify(_0x475bd8))[_0x7fa3a3(0x239)](',')+']';if(_0x4aef2e&&typeof _0x4aef2e===_0x7fa3a3(0x1a3)){const _0x2d67ba=_0x4aef2e,_0x535a62=Object['keys'](_0x2d67ba)[_0x7fa3a3(0x1ee)](),_0x29f5dd=_0x535a62['map'](_0x50fb6e=>'\x22'+_0x50fb6e+'\x22:'+stableStringify(_0x2d67ba[_0x50fb6e]));return'{'+_0x29f5dd['join'](',')+'}';}const _0x5dce0a=JSON['stringify'](_0x4aef2e);return _0x5dce0a===undefined?_0x7fa3a3(0x1ea):_0x5dce0a;}function activationSignature(_0x29f343){const _0x1ed725=a97_0x560ff4,_0x50214f={'connection':_0x29f343['connection'],..._0x29f343[_0x1ed725(0x174)]!==undefined&&{'all_columns':_0x29f343['all_columns']},..._0x29f343[_0x1ed725(0x168)]!==undefined&&{'columns':_0x29f343[_0x1ed725(0x168)]},..._0x29f343['behavior']!==undefined&&{'behavior':_0x29f343[_0x1ed725(0x181)]},..._0x29f343[_0x1ed725(0x1b3)]!==undefined&&{'schedule':_0x29f343[_0x1ed725(0x1b3)]},..._0x29f343['notification']!==undefined&&{'notification':_0x29f343[_0x1ed725(0x21b)]},..._0x29f343['connector_config']!==undefined&&{'connector_config':_0x29f343[_0x1ed725(0x213)]},..._0x29f343[_0x1ed725(0x222)]!==undefined&&{'activation_template_id':_0x29f343[_0x1ed725(0x222)]}};return stableStringify(_0x50214f);}export async function prepareSegmentFiles(_0x1415ff,_0x1222e6,_0xf4c7b8,_0x29f32f,_0x464b53){const _0x286a39=a97_0x560ff4,{activationDefToCreateRequest:_0x35b708}=await import(_0x286a39(0x205)),_0x42bd9f=[],_0x494962=new Set();for(const {yamlConfig:_0x3ccf5e,folderPath:_0x3c7ea5,sourcePath:_0x5ea5ec}of _0x1415ff){const _0x5661f7=resolveTDFolderPath(_0x3c7ea5,_0x29f32f,_0x464b53),_0x598750=_0x5661f7+':'+_0x3ccf5e[_0x286a39(0x1eb)],_0x3ea006=_0x1222e6['segmentByFolderAndName'][_0x286a39(0x1e0)](_0x598750),_0x5adfb7=_0x3ea006?_0x1222e6['activationsBySegmentId']['get'](_0x3ea006['id'])||[]:[];addFoldersToCreate(_0x5661f7,_0x1222e6[_0x286a39(0x158)],_0x494962);const _0x96c30c=calculateActivationActions(_0x3ccf5e[_0x286a39(0x218)]||[],_0x5adfb7,_0x1222e6[_0x286a39(0x1ef)],_0x1222e6[_0x286a39(0x1fa)]);for(const _0xbfc212 of _0x96c30c){(_0xbfc212['type']===_0x286a39(0x220)||_0xbfc212[_0x286a39(0x1f7)]===_0x286a39(0x1be))&&_0xbfc212['yamlActivation']&&(_0xbfc212[_0x286a39(0x231)]=await _0x35b708(_0xbfc212[_0x286a39(0x1c8)],_0xf4c7b8));}const _0xd59372=calculateSegmentDiff(_0x3ccf5e,_0x3ea006,_0x5adfb7,_0x1222e6[_0x286a39(0x1ef)],_0x1222e6['connectionIdToNameMap']);_0x42bd9f[_0x286a39(0x1e3)]({'relativePath':_0x3ccf5e[_0x286a39(0x1eb)],'absolutePath':_0x5ea5ec,'yamlConfig':_0x3ccf5e,'folderPath':_0x5661f7,'existingSegment':_0x3ea006,'existingActivations':_0x5adfb7,'isNew':_0xd59372[_0x286a39(0x20b)],'hasChanges':_0xd59372[_0x286a39(0x203)],'diff':_0xd59372['diff'],'activationActions':_0x96c30c});}return{'segmentFiles':_0x42bd9f,'foldersToCreate':_0x494962};}export async function prepareJourneyFiles(_0x3e3b7b,_0x22cd29,_0x230110,_0x1e7562){const _0x586e68=a97_0x560ff4,_0xb6929a=[],_0x501664=new Set();for(const {yamlConfig:_0x1bcab1,folderPath:_0x1c0fd2,sourcePath:_0x211261}of _0x3e3b7b){const _0xd351ed=resolveTDFolderPath(_0x1c0fd2,_0x230110,_0x1e7562),_0x2ebadf=_0xd351ed+':'+_0x1bcab1[_0x586e68(0x1eb)],_0x5a55b8=_0x22cd29[_0x586e68(0x1d9)][_0x586e68(0x1e0)](_0x2ebadf);let _0x4d8c8c,_0x458247;if(_0x5a55b8&&_0x5a55b8[_0x586e68(0x1fc)]>0x0){const _0x19afdb=buildLocalExpandedRuleMappings(_0x1bcab1),{createYamlContext:_0xeed26,prefetchJourneySegments:_0x14bafe}=createPushYamlContextForBundle(_0x22cd29[_0x586e68(0x1c3)],_0x22cd29[_0x586e68(0x226)],_0x22cd29[_0x586e68(0x15f)],_0x19afdb,_0x22cd29[_0x586e68(0x1ef)],_0x22cd29['connectionIdToNameMap'],_0x22cd29['activationStepsById'],_0x22cd29[_0x586e68(0x177)]);await _0x14bafe(_0x5a55b8[_0x586e68(0x1b2)](_0x277c88=>_0x277c88['id']));const _0x385a11=hasMultipleVersions(_0x1bcab1),_0xdeb046=async _0x93f3cd=>{const _0x141f44=_0x586e68,_0x1f8a3b=_0x22cd29[_0x141f44(0x177)]?.['get'](_0x93f3cd);if(_0x1f8a3b)return _0x1f8a3b;return _0x22cd29[_0x141f44(0x159)]({'journeyId':_0x93f3cd,'journeyName':_0x1bcab1['name'],'isMultiVersion':_0x5a55b8['length']>0x1});};if(_0x385a11&&_0x5a55b8[_0x586e68(0x1fc)]>0x1){const _0x1f5bfd=[];for(const _0x1c14b2 of _0x5a55b8){const _0x2e6bd0=_0x1c14b2[_0x586e68(0x238)]||0x1;_0x22cd29[_0x586e68(0x21f)]?.['update'](_0x586e68(0x1f4)+_0x1bcab1['name']+'\x20v'+_0x2e6bd0);const _0x2a8b3c=await _0xdeb046(_0x1c14b2['id']),_0x283746=_0xeed26(_0x1c14b2['id']),_0x52c2d5=await journeyResponseToDef(_0x2a8b3c,_0x283746);_0x1f5bfd['push']({'item':_0x1c14b2,'yaml':_0x52c2d5});}const _0x24707f=buildLocalRuleToNameMappingFromJourney(_0x1bcab1);_0x458247=buildMergedJourneyDef(_0x1f5bfd,_0x24707f);const _0x718147=Math[_0x586e68(0x229)](..._0x1f5bfd[_0x586e68(0x1b2)](_0x6bc99f=>_0x6bc99f[_0x586e68(0x228)][_0x586e68(0x238)]||0x0)),_0x34c782=_0x5a55b8['find'](_0x3d6422=>(_0x3d6422['versionNumber']||0x0)===_0x718147);_0x34c782&&(_0x22cd29[_0x586e68(0x21f)]?.[_0x586e68(0x1be)](_0x586e68(0x1f4)+_0x1bcab1[_0x586e68(0x1eb)]+'\x20v'+_0x718147),_0x4d8c8c=await _0xdeb046(_0x34c782['id']));}else{const _0x2da55a=_0x5a55b8[_0x5a55b8[_0x586e68(0x1fc)]-0x1];_0x22cd29[_0x586e68(0x21f)]?.[_0x586e68(0x1be)](_0x586e68(0x1f4)+_0x1bcab1[_0x586e68(0x1eb)]),_0x4d8c8c=await _0xdeb046(_0x2da55a['id']);const _0x1ec109=_0xeed26(_0x2da55a['id']),_0xb5e8d1=await journeyResponseToDef(_0x4d8c8c,_0x1ec109),_0x450ca0=buildLocalRuleToNameMappingFromJourney(_0x1bcab1);_0x458247=buildMergedJourneyDef([{'item':_0x2da55a,'yaml':_0xb5e8d1}],_0x450ca0);}}addFoldersToCreate(_0xd351ed,_0x22cd29['folderPathToId'],_0x501664);const _0x30d291=calculateJourneyDiff(_0x1bcab1,_0x458247);_0xb6929a[_0x586e68(0x1e3)]({'relativePath':_0x1bcab1['name'],'absolutePath':_0x211261,'yamlConfig':_0x1bcab1,'folderPath':_0xd351ed,'existingJourney':_0x4d8c8c,'isNew':_0x30d291[_0x586e68(0x20b)],'hasChanges':_0x30d291[_0x586e68(0x203)],'diff':_0x30d291[_0x586e68(0x17e)]});}return{'journeyFiles':_0xb6929a,'foldersToCreate':_0x501664};}export function calculateActivationActions(_0x264637,_0x30c090,_0x1a26c1,_0x565f3d){const _0x5bbb72=a97_0x560ff4,_0x3d1f07=[],_0x124970=new Map();for(const _0x4539a8 of _0x30c090){_0x124970[_0x5bbb72(0x1dc)](_0x4539a8[_0x5bbb72(0x1eb)],_0x4539a8);}const _0x3a29e1=new Map();for(const _0x1b0e17 of _0x264637){_0x3a29e1[_0x5bbb72(0x1dc)](_0x1b0e17[_0x5bbb72(0x1eb)],_0x1b0e17);}for(const _0x42eb94 of _0x264637){const _0x416219=_0x124970['get'](_0x42eb94['name']);if(!_0x416219)_0x3d1f07[_0x5bbb72(0x1e3)]({'type':_0x5bbb72(0x220),'name':_0x42eb94[_0x5bbb72(0x1eb)],'yamlActivation':_0x42eb94});else{const _0x6d93ce=activationResponseToDef(_0x416219,_0x1a26c1,_0x565f3d),_0x1559af=a97_0xb8392[_0x5bbb72(0x171)](_0x6d93ce),_0x23a266=a97_0xb8392[_0x5bbb72(0x171)](_0x42eb94);_0x1559af!==_0x23a266&&_0x3d1f07['push']({'type':'update','name':_0x42eb94[_0x5bbb72(0x1eb)],'yamlActivation':_0x42eb94,'existingActivation':_0x416219});}}for(const _0x291943 of _0x30c090){!_0x3a29e1['has'](_0x291943[_0x5bbb72(0x1eb)])&&_0x3d1f07[_0x5bbb72(0x1e3)]({'type':_0x5bbb72(0x1ba),'name':_0x291943[_0x5bbb72(0x1eb)],'existingActivation':_0x291943});}return _0x3d1f07;}export function calculateSegmentDiff(_0x3c43e4,_0x1d0e76,_0x52a5fc,_0x392a36,_0x139e00){const _0x1f83e7=segmentToYamlString(_0x3c43e4);if(_0x1d0e76){const _0x2fac99=segmentWithActivationsToYaml(_0x1d0e76,_0x52a5fc,undefined,_0x392a36,_0x139e00),_0x34361e=segmentToYamlString(_0x2fac99),_0x5b579e=generateDiff(_0x34361e,_0x1f83e7),_0x1d2ae5=hasChanges(_0x5b579e);return{'isNew':![],'hasChanges':_0x1d2ae5,'diff':_0x1d2ae5?formatDiffWithColors(_0x5b579e):undefined};}const _0x21a461=generateDiff('',_0x1f83e7);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x21a461)};}export function calculateJourneyDiff(_0x3c908f,_0x4fcdea){const _0x51ee51=normalizeJourneyDef(_0x3c908f,_0x3c908f),_0x30fa21=a97_0x2102e8(_0x51ee51);if(_0x4fcdea){const _0x2aa852=normalizeJourneyDef(_0x4fcdea,_0x3c908f),_0x45ce8f=a97_0x2102e8(_0x2aa852),_0x2887c4=generateDiff(_0x45ce8f,_0x30fa21),_0x479d95=hasChanges(_0x2887c4);return{'isNew':![],'hasChanges':_0x479d95,'diff':_0x479d95?formatDiffWithColors(_0x2887c4):undefined};}const _0x145415=generateDiff('',_0x30fa21);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x145415)};}export function findSegmentsToDelete(_0x3f0117,_0x339c3e,_0x12286f,_0x3719f4,_0x57d561){const _0x5c7e40=a97_0x560ff4,_0x3aa199=new Set();for(const {yamlConfig:_0x3079c8,folderPath:_0x1d9c1d}of _0x339c3e){_0x3aa199[_0x5c7e40(0x188)](_0x1d9c1d+':'+_0x3079c8[_0x5c7e40(0x1eb)]);}return _0x3f0117[_0x5c7e40(0x207)](_0x25009d=>{const _0x9d821e=_0x5c7e40,_0x5ea117=_0x25009d[_0x9d821e(0x185)]?_0x12286f[_0x9d821e(0x1e0)](_0x25009d['segmentFolderId'][_0x9d821e(0x19d)]())||'':'',_0xe9073f=_0x5ea117+':'+_0x25009d['name'];if(_0x3aa199['has'](_0xe9073f))return![];if(_0x57d561)return _0x5ea117===_0x3719f4||_0x5ea117[_0x9d821e(0x152)](_0x3719f4+'/');return!![];});}export function findJourneysToDelete(_0x5196e3,_0x3fc073,_0x3f266a,_0x3e94c9,_0x3e1925){const _0x2dc3ea=a97_0x560ff4,_0x15f486=new Set();for(const {yamlConfig:_0x1f3f61,folderPath:_0x638c8c}of _0x3fc073){_0x15f486['add'](_0x638c8c+':'+_0x1f3f61[_0x2dc3ea(0x1eb)]);}return _0x5196e3[_0x2dc3ea(0x207)](_0x4ee722=>{const _0x18de69=_0x2dc3ea,_0x50d68d=_0x4ee722[_0x18de69(0x1dd)]?_0x3f266a[_0x18de69(0x1e0)](_0x4ee722[_0x18de69(0x1dd)])||'':'',_0x377177=_0x50d68d+':'+_0x4ee722['journeyBundleName'];if(_0x15f486[_0x18de69(0x219)](_0x377177))return![];if(_0x3e1925)return _0x50d68d===_0x3e94c9||_0x50d68d['startsWith'](_0x3e94c9+'/');return!![];});}export function buildSegmentLookupMap(_0x3ac4bc,_0x169ecd){const _0x41b742=a97_0x560ff4,_0x41d48c=new Map();for(const _0x2cb70e of _0x3ac4bc){const _0x548b92=_0x2cb70e[_0x41b742(0x185)]?_0x169ecd[_0x41b742(0x1e0)](_0x2cb70e[_0x41b742(0x185)][_0x41b742(0x19d)]())||'':'',_0x546a67=_0x548b92+':'+_0x2cb70e['name'];_0x41d48c[_0x41b742(0x1dc)](_0x546a67,_0x2cb70e);}return _0x41d48c;}export function buildSegmentNameToIdMap(_0x5e5264){const _0x3bed8f=a97_0x560ff4,_0x17598a=new Map();for(const _0x42e0ff of _0x5e5264){_0x17598a[_0x3bed8f(0x1dc)](_0x42e0ff['name'],_0x42e0ff['id']);}return _0x17598a;}export function buildJourneyBundleLookupMap(_0x4188d1,_0x2f207){const _0x5e1e2e=a97_0x560ff4,_0x3e2807=new Map();for(const _0x5054ff of _0x4188d1){const _0x9b070d=_0x5054ff[_0x5e1e2e(0x1dd)]?_0x2f207['get'](_0x5054ff[_0x5e1e2e(0x1dd)])||'':'',_0x3535bb=_0x9b070d+':'+_0x5054ff[_0x5e1e2e(0x16b)];!_0x3e2807['has'](_0x3535bb)&&_0x3e2807['set'](_0x3535bb,[]),_0x3e2807['get'](_0x3535bb)[_0x5e1e2e(0x1e3)](_0x5054ff);}for(const _0x219fd7 of _0x3e2807['values']()){_0x219fd7[_0x5e1e2e(0x1ee)]((_0x4aa529,_0x285886)=>(_0x4aa529[_0x5e1e2e(0x238)]||0x0)-(_0x285886[_0x5e1e2e(0x238)]||0x0));}return _0x3e2807;}export function collectFoldersToCreate(_0x2ff323,_0x25a833){const _0x19772d=a97_0x560ff4,_0x318df3=new Set();for(const _0x5c4f38 of _0x2ff323){if(!_0x5c4f38)continue;if(_0x25a833[_0x19772d(0x219)](_0x5c4f38))continue;const _0xe148bd=_0x5c4f38[_0x19772d(0x163)]('/');let _0x2eda42='';for(const _0x189bfd of _0xe148bd){_0x2eda42=_0x2eda42?_0x2eda42+'/'+_0x189bfd:_0x189bfd,!_0x25a833['has'](_0x2eda42)&&_0x318df3[_0x19772d(0x188)](_0x2eda42);}}return _0x318df3;}export function parseAndClassifyYamlFiles(_0x45e547,_0x534690,_0x55863b){const _0x431953=a97_0x560ff4,_0x4705eb=[],_0x260653=[];for(const _0x900b9b of _0x45e547){const _0x65e1b0=a97_0x2db96c['relative'](_0x534690,a97_0x2db96c[_0x431953(0x1cc)](_0x900b9b)),_0x481f1a=_0x65e1b0==='.'?'':_0x65e1b0,_0x5f04cf=readFileSync(_0x900b9b,_0x431953(0x236)),_0x433641=a97_0xb8392[_0x431953(0x1a1)](_0x5f04cf);if(isJourneyDef(_0x433641)){const _0x1c1610=a97_0x549390(_0x5f04cf);_0x260653['push']({'yamlConfig':_0x1c1610,'folderPath':_0x481f1a,'sourcePath':_0x900b9b});}else{if(!_0x55863b?.[_0x431953(0x1e7)]){const _0x846256=parseSegmentYamlFile(_0x5f04cf),_0x5a4ebf=normalizeChildSegmentYaml(_0x846256);_0x4705eb[_0x431953(0x1e3)]({'yamlConfig':_0x5a4ebf,'folderPath':_0x481f1a,'sourcePath':_0x900b9b});}}}return{'segments':_0x4705eb,'journeys':_0x260653};}export function validateParsedFiles(_0x1a9cd3,_0x110447){const _0x3cf9f5=a97_0x560ff4,_0x5bf0ec=[];for(const {yamlConfig:_0x42add8,sourcePath:_0x117609}of _0x1a9cd3[_0x3cf9f5(0x1a6)]){const _0x187280=readFileSync(_0x117609,_0x3cf9f5(0x236)),_0xdfa143=a97_0xb8392[_0x3cf9f5(0x1b9)](_0x187280),_0x39f798=validateSegmentDef(_0x42add8,{'source':_0x187280,'document':_0xdfa143});if(!_0x39f798[_0x3cf9f5(0x216)]){const _0x23b515=a97_0x2db96c[_0x3cf9f5(0x1f2)](_0x110447,_0x117609);_0x5bf0ec[_0x3cf9f5(0x1e3)]({'filePath':_0x23b515,'source':_0x187280,'result':_0x39f798,'isJourney':![]});}}for(const {yamlConfig:_0x22b1bf,sourcePath:_0x42451a}of _0x1a9cd3[_0x3cf9f5(0x1d8)]){const _0x542fb6=readFileSync(_0x42451a,_0x3cf9f5(0x236)),_0x403fd5=a97_0xb8392[_0x3cf9f5(0x1b9)](_0x542fb6),_0x325d42=validateJourneyDef(_0x22b1bf,{'source':_0x542fb6,'document':_0x403fd5});if(!_0x325d42[_0x3cf9f5(0x216)]){const _0x23dab1=a97_0x2db96c[_0x3cf9f5(0x1f2)](_0x110447,_0x42451a);_0x5bf0ec[_0x3cf9f5(0x1e3)]({'filePath':_0x23dab1,'source':_0x542fb6,'result':_0x325d42,'isJourney':!![]});}}return _0x5bf0ec;}export function formatValidationErrors(_0x25a323){const _0x7cfdd6=a97_0x560ff4,_0x5b1c9c=[];for(const {filePath:_0x51161b,source:_0x58eca1,result:_0x30d348,isJourney:_0x27b320}of _0x25a323){const _0x30ee21=_0x27b320?_0x7cfdd6(0x22a):_0x7cfdd6(0x22f);_0x5b1c9c[_0x7cfdd6(0x1e3)]('\x0a'+_0x51161b+'\x20('+_0x30ee21+_0x7cfdd6(0x22d)+_0x30d348[_0x7cfdd6(0x18e)][_0x7cfdd6(0x1fc)]+_0x7cfdd6(0x1f8)),_0x5b1c9c[_0x7cfdd6(0x1e3)](formatValidationResult(_0x30d348,_0x58eca1,_0x51161b));}return _0x5b1c9c['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x2bf80d){const _0x510885=a97_0x560ff4,_0x3c784c=new Set(),_0x10f391=new Map(),_0x440ad0=collectSegmentUsageCounts(_0x2bf80d);if(_0x2bf80d[_0x510885(0x1a6)])for(const [_0xc0fab2,_0x3a75c1]of Object[_0x510885(0x1f0)](_0x2bf80d[_0x510885(0x1a6)])){_0x3c784c[_0x510885(0x188)](_0xc0fab2);if(_0x3a75c1[_0x510885(0x1f1)]){const _0x2b5835=yamlRuleToApi(_0x3a75c1[_0x510885(0x1f1)]),_0x23ec00=apiRuleToYaml(_0x2b5835);_0x10f391[_0x510885(0x1dc)](_0xc0fab2,_0x23ec00);}}const _0x168883=new Map();let _0x17794a=0x0;for(const [_0x4e60c5,_0x373d6c]of _0x10f391){const _0x33e381=serializeExpandedRule(_0x373d6c,_0x10f391),_0x5776c4=_0x168883[_0x510885(0x1e0)](_0x33e381)||[];_0x5776c4[_0x510885(0x1e3)]({'name':_0x4e60c5,'index':_0x17794a}),_0x168883[_0x510885(0x1dc)](_0x33e381,_0x5776c4),_0x17794a++;}const _0x34b5de=new Map();for(const [_0x2eec24,_0x1ebd6c]of _0x168883){const _0x585c9=_0x1ebd6c[_0x510885(0x223)]()['sort']((_0x298cf4,_0x11722f)=>{const _0x5d69ac=_0x510885,_0xc0a177=_0x440ad0[_0x5d69ac(0x1e0)](_0x298cf4[_0x5d69ac(0x1eb)])||0x0,_0x3f72c1=_0x440ad0['get'](_0x11722f[_0x5d69ac(0x1eb)])||0x0;if(_0xc0a177!==_0x3f72c1)return _0x3f72c1-_0xc0a177;return _0x298cf4[_0x5d69ac(0x190)]-_0x11722f[_0x5d69ac(0x190)];})[_0x510885(0x1b2)](_0x231f11=>_0x231f11[_0x510885(0x1eb)]),_0x13c58c=[];for(const _0x2f3ef6 of _0x585c9){const _0x3a18ef=_0x440ad0['get'](_0x2f3ef6)||0x0,_0x539906=Math[_0x510885(0x229)](_0x3a18ef,0x1);for(let _0x4060d6=0x0;_0x4060d6<_0x539906;_0x4060d6++){_0x13c58c[_0x510885(0x1e3)](_0x2f3ef6);}}_0x34b5de[_0x510885(0x1dc)](_0x2eec24,_0x13c58c);}return{'existingLocalSegmentNames':_0x3c784c,'localSegmentRules':_0x10f391,'localExpandedRuleToNames':_0x34b5de};}async function buildServerSegmentRuleMap(_0x534005,_0x58ca4c,_0x119e86,_0x1ad652){const _0x1dd72c=new Map(),_0x3a86d3=new Set(),_0x371b5b=async _0x698588=>{const _0x256dcf=a97_0x1212;if(_0x3a86d3[_0x256dcf(0x219)](_0x698588))return;_0x3a86d3[_0x256dcf(0x188)](_0x698588);let _0x224a4a=_0x119e86['find'](_0x17d6b4=>_0x17d6b4['id']===_0x698588);if(!_0x224a4a)try{_0x224a4a=await _0x534005[_0x256dcf(0x22f)][_0x256dcf(0x1d6)](_0x58ca4c,_0x698588);}catch{return;}if(!_0x224a4a?.['rule'])return;const _0x55324c=apiRuleToYaml(_0x224a4a[_0x256dcf(0x1f1)]);_0x1dd72c['set'](_0x698588,_0x55324c);const _0x25955e=collectSegmentRefsFromRule(_0x55324c);for(const _0x3204fe of _0x25955e){await _0x371b5b(_0x3204fe);}};for(const _0x26e9dc of _0x1ad652){await _0x371b5b(_0x26e9dc);}return _0x1dd72c;}export function createSegmentIdResolver(_0x5aeb48,_0x4b0063){return async _0x4d22b8=>{const _0x51790b=a97_0x1212,_0x3db8cc=_0x5aeb48[_0x51790b(0x1e0)](_0x4d22b8);if(!_0x3db8cc)throw new SDKError(ErrorCode[_0x51790b(0x161)],_0x51790b(0x1a4)+_0x4d22b8+_0x51790b(0x1e5)+_0x4b0063+'\x27)');return _0x3db8cc;};}export function extractRootFolderId(_0x42e494){const _0x130d28=a97_0x560ff4;return _0x42e494['relationships']?.[_0x130d28(0x1fe)]?.[_0x130d28(0x154)]?.['id']||_0x42e494[_0x130d28(0x166)]?.[_0x130d28(0x1b8)]?.['data']?.['id'];}export function buildConnectionMaps(_0x120cc0){const _0x153253=a97_0x560ff4,_0x48f753=new Map(),_0x3a3351=new Map(),_0x197abf=new Map();for(const _0x47f254 of _0x120cc0){_0x48f753[_0x153253(0x1dc)](_0x47f254[_0x153253(0x1eb)],parseInt(_0x47f254['id'],0xa)),_0x3a3351[_0x153253(0x1dc)](_0x47f254['id'],_0x47f254[_0x153253(0x1eb)]),_0x197abf[_0x153253(0x1dc)](_0x47f254[_0x153253(0x1eb)],_0x47f254[_0x153253(0x1f7)]);}return{'nameToId':_0x48f753,'idToName':_0x3a3351,'nameToType':_0x197abf};}export function calculatePushStats(_0x5a0750,_0xdd14d7,_0x2337ed,_0x3c2a32,_0x2b12a7,_0x3888d8,_0x359da8){const _0xd896a8=a97_0x560ff4,_0x4fe4ce=_0x5a0750[_0xd896a8(0x207)](_0x20b319=>_0x20b319[_0xd896a8(0x20b)]),_0x1173c6=_0x5a0750[_0xd896a8(0x207)](_0x27ffee=>!_0x27ffee['isNew']&&_0x27ffee['hasChanges']),_0x32b5f2=_0x5a0750['filter'](_0x43205b=>!_0x43205b[_0xd896a8(0x20b)]&&!_0x43205b['hasChanges']),_0xa67c1e=_0x3888d8?_0x3c2a32:[],_0x5e1675=_0xdd14d7[_0xd896a8(0x207)](_0x356d02=>_0x356d02[_0xd896a8(0x20b)]),_0x23b922=_0xdd14d7[_0xd896a8(0x207)](_0x556d55=>!_0x556d55['isNew']&&_0x556d55[_0xd896a8(0x203)]),_0x3d38f1=_0xdd14d7[_0xd896a8(0x207)](_0x43f00b=>!_0x43f00b[_0xd896a8(0x20b)]&&!_0x43f00b[_0xd896a8(0x203)]),_0xf9e8a5=_0x3888d8?_0x2b12a7:[],_0x223f1a=_0x5a0750[_0xd896a8(0x221)](_0x25f0a7=>_0x25f0a7[_0xd896a8(0x235)]),_0x399abe=_0x223f1a['filter'](_0x5a68ba=>_0x5a68ba[_0xd896a8(0x1f7)]===_0xd896a8(0x220)),_0x18d834=_0x223f1a['filter'](_0x49ea52=>_0x49ea52[_0xd896a8(0x1f7)]===_0xd896a8(0x1be)),_0x3f0c16=_0x223f1a[_0xd896a8(0x207)](_0x5abb68=>_0x5abb68[_0xd896a8(0x1f7)]==='delete'),_0x2c2b88=Array[_0xd896a8(0x178)](_0x2337ed)[_0xd896a8(0x1ee)](),_0x1c6372=_0x359da8?![]:_0x4fe4ce['length']>0x0||_0x1173c6[_0xd896a8(0x1fc)]>0x0||_0xa67c1e[_0xd896a8(0x1fc)]>0x0,_0x16e5b3=_0x5e1675[_0xd896a8(0x1fc)]>0x0||_0x23b922['length']>0x0||_0xf9e8a5[_0xd896a8(0x1fc)]>0x0,_0x10d45f=_0x359da8?![]:_0x223f1a[_0xd896a8(0x1fc)]>0x0,_0x4c5644=_0x2c2b88['length']>0x0;return{'segments':{'new':_0x4fe4ce,'changed':_0x1173c6,'unchanged':_0x32b5f2,'toDelete':_0xa67c1e},'journeys':{'new':_0x5e1675,'changed':_0x23b922,'unchanged':_0x3d38f1,'toDelete':_0xf9e8a5},'activations':{'all':_0x223f1a,'toCreate':_0x399abe,'toUpdate':_0x18d834,'toDelete':_0x3f0c16},'folders':{'toCreate':_0x2c2b88},'counts':{'segments':{'new':_0x4fe4ce[_0xd896a8(0x1fc)],'changed':_0x1173c6['length'],'unchanged':_0x32b5f2['length'],'toDelete':_0xa67c1e[_0xd896a8(0x1fc)]},'journeys':{'new':_0x5e1675['length'],'changed':_0x23b922[_0xd896a8(0x1fc)],'unchanged':_0x3d38f1[_0xd896a8(0x1fc)],'toDelete':_0xf9e8a5[_0xd896a8(0x1fc)]},'activations':{'create':_0x399abe[_0xd896a8(0x1fc)],'update':_0x18d834[_0xd896a8(0x1fc)],'delete':_0x3f0c16['length']},'folders':_0x2c2b88[_0xd896a8(0x1fc)]},'hasChanges':_0x1c6372||_0x16e5b3||_0x10d45f||_0x4c5644};}export async function buildPushExecutionContext(_0x356962,_0x842a40,_0x50d738,_0x11f436,_0x335fe2,_0x1dc97d){const _0x49d8f9=a97_0x560ff4,_0x1c1cdb=extractRootFolderId(_0x50d738),{pathToId:_0x4e2735,idToPath:_0x2afb90}=buildFolderMaps(_0x335fe2),_0x8786d5=buildSegmentNameToIdMap(_0x11f436),_0x378df5=new Map(),{batchAsync:_0xf91aea}=await import(_0x49d8f9(0x1d7)),[_0x1922be,_0x23a06a]=await Promise[_0x49d8f9(0x160)]([_0x356962[_0x49d8f9(0x214)][_0x49d8f9(0x179)](),_0x356962[_0x49d8f9(0x1ae)][_0x49d8f9(0x1c7)](),((async()=>{const _0x5eed9b=_0x49d8f9;!_0x1dc97d&&_0x11f436[_0x5eed9b(0x1fc)]>0x0&&await _0xf91aea(_0x11f436,async _0x387f36=>{const _0x545bda=_0x5eed9b,_0x4379df=await _0x356962[_0x545bda(0x22f)]['listActivations'](_0x842a40,_0x387f36['id']);_0x378df5[_0x545bda(0x1dc)](_0x387f36['id'],_0x4379df);});})())]),{emailToId:_0xf506b4,idToEmail:_0x3d51c2}=_0x1922be,_0x264212=buildConnectionMaps(_0x23a06a);return{'rootFolderId':_0x1c1cdb,'folderPathToId':_0x4e2735,'folderIdToPath':_0x2afb90,'segmentNameToId':_0x8786d5,'activationsBySegmentId':_0x378df5,'emailToIdMap':_0xf506b4,'idToEmailMap':_0x3d51c2,'connectionNameToIdMap':_0x264212[_0x49d8f9(0x1ff)],'connectionIdToNameMap':_0x264212['idToName'],'connectionNameToTypeMap':_0x264212[_0x49d8f9(0x17a)]};}export function createPushYamlContextForBundle(_0x391d43,_0x4ce54e,_0xfda393,_0x3f5064,_0x2ebb4d,_0x4cee59,_0x497795,_0xe1ae82){const {existingLocalSegmentNames:_0x1d9a4e,localExpandedRuleToNames:_0x4c91ca}=_0x3f5064,_0x14d525=new Set(),_0x693b33=new Map(),_0x1cdafc=new Set(),_0x4b6a32=new Map(),_0x1925fa=new Map(),_0x456989=createJumpTargetCache(),_0x4f1525=new Map(),_0x443ba1=new Map(),_0x23c676=new Set();let _0x57ac18;const _0x2a6500=_0x5a85b9=>{const _0x343e15={'resolveSegment':async _0x84207f=>{const _0x68f589=a97_0x1212,_0x4e593f=_0x1925fa[_0x68f589(0x1e0)](_0x84207f);if(_0x4e593f!==undefined)return{'name':_0x4e593f,'isJourneyLocal':!![]};try{let _0x51850a=_0xfda393[_0x68f589(0x16e)](_0x4ec7f2=>_0x4ec7f2['id']===_0x84207f);!_0x51850a&&(_0x51850a=await _0x391d43[_0x68f589(0x22f)][_0x68f589(0x1d6)](_0x4ce54e,_0x84207f));const _0x5c6628=generateJourneyLocalName(_0x51850a[_0x68f589(0x1eb)]),_0x42f01d=_0x51850a[_0x68f589(0x19b)]===SEGMENT_KIND_JOURNEY&&_0x5c6628!==undefined;let _0x26a0b8=_0x51850a[_0x68f589(0x1eb)],_0x486460;if(_0x42f01d&&_0x51850a['rule']){const _0x57b71c=apiRuleToYaml(_0x51850a['rule']);_0x443ba1[_0x68f589(0x1dc)](_0x84207f,_0x57b71c);const _0x4a61cc=async _0x31936a=>{const _0x2916d6=_0x68f589,_0x9bed2d=collectSegmentRefsFromRule(_0x31936a);for(const _0x45ab37 of _0x9bed2d){if(!_0x443ba1['has'](_0x45ab37))try{const _0x5adb5d=await _0x391d43[_0x2916d6(0x22f)][_0x2916d6(0x1d6)](_0x4ce54e,_0x45ab37);if(_0x5adb5d?.['rule']){const _0x4dfc34=apiRuleToYaml(_0x5adb5d[_0x2916d6(0x1f1)]);_0x443ba1[_0x2916d6(0x1dc)](_0x45ab37,_0x4dfc34),await _0x4a61cc(_0x4dfc34);}}catch{}}};await _0x4a61cc(_0x57b71c);const _0x1ee747=serializeExpandedRule(_0x57b71c,_0x443ba1),_0x31c223=_0x4c91ca[_0x68f589(0x1e0)](_0x1ee747);if(_0x31c223&&_0x31c223[_0x68f589(0x1fc)]>0x0){const _0x5c6ef3=_0x693b33[_0x68f589(0x1e0)](_0x1ee747)||0x0,_0x26bfe6=_0x31c223[_0x5c6ef3]||_0x31c223[_0x31c223[_0x68f589(0x1fc)]-0x1];_0x693b33['set'](_0x1ee747,_0x5c6ef3+0x1),_0x26a0b8=_0x26bfe6,_0x14d525[_0x68f589(0x188)](_0x26a0b8),_0x1925fa['set'](_0x84207f,_0x26a0b8);const _0x38a7ff=await resolveRuleSegmentRefs(_0x57b71c,async _0x3c9915=>{const _0x5275a9=_0x68f589,_0x56c3ab=_0x1925fa['get'](_0x3c9915);if(_0x56c3ab)return _0x56c3ab;const _0x4e8e19=await _0x57ac18[_0x5275a9(0x1c0)](_0x3c9915);return _0x4e8e19[_0x5275a9(0x1eb)];});_0x486460={'description':_0x51850a[_0x68f589(0x15a)],'rule':_0x38a7ff};}else{const _0x1ebedb=_0x4f1525['get'](_0x1ee747);if(_0x1ebedb)_0x26a0b8=_0x1ebedb,_0x1925fa[_0x68f589(0x1dc)](_0x84207f,_0x26a0b8);else{if(_0x5c6628){let _0x4b504f=_0x5c6628,_0x777c43=0x2;while(_0x14d525[_0x68f589(0x219)](_0x4b504f)||_0x1d9a4e[_0x68f589(0x219)](_0x4b504f)){_0x4b504f=_0x5c6628+'_'+_0x777c43,_0x777c43++;}_0x14d525[_0x68f589(0x188)](_0x4b504f),_0x26a0b8=_0x4b504f;}_0x1925fa[_0x68f589(0x1dc)](_0x84207f,_0x26a0b8),_0x4f1525['set'](_0x1ee747,_0x26a0b8);const _0x113512=await resolveRuleSegmentRefs(_0x57b71c,async _0x3ef2b9=>{const _0x3caaf0=_0x68f589,_0x17bc2b=_0x1925fa[_0x3caaf0(0x1e0)](_0x3ef2b9);if(_0x17bc2b)return _0x17bc2b;const _0xef1e5=await _0x57ac18[_0x3caaf0(0x1c0)](_0x3ef2b9);return _0xef1e5['name'];});_0x486460={'description':_0x51850a[_0x68f589(0x15a)],'rule':_0x113512};}}}return{'name':_0x26a0b8,'isJourneyLocal':_0x42f01d,'definition':_0x486460};}catch{return{'name':_0x84207f,'isJourneyLocal':![]};}},'resolveActivation':async _0x47235c=>{const _0x1bf3ed=a97_0x1212,_0x44281f=_0x4b6a32[_0x1bf3ed(0x1e0)](_0x47235c);if(_0x44281f!==undefined)return{'name':_0x44281f,'isJourneyLocal':!![]};try{let _0x2f0eb6=_0x497795?.[_0x1bf3ed(0x1e0)](_0x47235c);!_0x2f0eb6&&(_0x2f0eb6=await _0x391d43[_0x1bf3ed(0x22a)]['getActivation'](_0x5a85b9,_0x47235c));const _0x2f5604=_0x2f0eb6[_0x1bf3ed(0x1bc)][_0x1bf3ed(0x184)][_0x1bf3ed(0x1eb)]||_0x47235c,_0x5413d1=sanitizeYamlKey(_0x2f5604)||'activation_'+_0x47235c;let _0x48e01f=_0x5413d1,_0x3e1eb2=0x2;while(_0x1cdafc[_0x1bf3ed(0x219)](_0x48e01f)){_0x48e01f=_0x5413d1+'_'+_0x3e1eb2,_0x3e1eb2++;}_0x1cdafc[_0x1bf3ed(0x188)](_0x48e01f),_0x4b6a32[_0x1bf3ed(0x1dc)](_0x47235c,_0x48e01f);const _0x249bcb=journeyActivationStepToYaml(_0x2f0eb6,_0x2ebb4d,_0x4cee59);return{'name':_0x48e01f,'isJourneyLocal':!![],'definition':_0x249bcb};}catch{return{'name':_0x47235c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x14d32c,_0x3816a4)=>resolveJumpTarget(_0x14d32c,_0x3816a4,_0x456989,async _0x49d576=>{const _0x533449=a97_0x1212,_0x221542=_0xe1ae82?.[_0x533449(0x1e0)](_0x49d576);if(_0x221542)return _0x221542;return _0x391d43[_0x533449(0x22a)][_0x533449(0x172)](_0x49d576);})};return _0x57ac18=_0x343e15,_0x343e15;},_0x3b346d=async _0x74ab31=>{const _0x3a0891=a97_0x1212,{collectSegmentIdsFromJourneyApi:_0x17af12}=await import(_0x3a0891(0x155)),{batchAsync:_0xb3278a}=await import(_0x3a0891(0x1d7)),_0x538fa8=new Set();for(const _0xbeca48 of _0x74ab31){let _0x3c6f4a=_0xe1ae82?.['get'](_0xbeca48);!_0x3c6f4a&&(_0x3c6f4a=await _0x391d43[_0x3a0891(0x22a)][_0x3a0891(0x172)](_0xbeca48));const _0x213919=_0x17af12(_0x3c6f4a);for(const _0x559150 of _0x213919){_0x538fa8[_0x3a0891(0x188)](_0x559150);}}let _0x3e3abd=Array[_0x3a0891(0x178)](_0x538fa8);while(_0x3e3abd[_0x3a0891(0x1fc)]>0x0){const _0x268e8a=_0x3e3abd[_0x3a0891(0x207)](_0x5dc85b=>!_0x23c676['has'](_0x5dc85b));if(_0x268e8a[_0x3a0891(0x1fc)]===0x0)break;const _0x154723=await _0xb3278a(_0x268e8a,async _0x268232=>{const _0x305d1f=_0x3a0891;_0x23c676[_0x305d1f(0x188)](_0x268232);let _0x545c7e=_0xfda393[_0x305d1f(0x16e)](_0x7f695f=>_0x7f695f['id']===_0x268232);if(!_0x545c7e)try{_0x545c7e=await _0x391d43['segment'][_0x305d1f(0x1d6)](_0x4ce54e,_0x268232);}catch{return null;}return{'segmentId':_0x268232,'segment':_0x545c7e};},0xa),_0x1b9388=new Set();for(const _0x2f4ad6 of _0x154723){if(!_0x2f4ad6?.[_0x3a0891(0x22f)]?.['rule'])continue;const _0x4601b8=apiRuleToYaml(_0x2f4ad6[_0x3a0891(0x22f)]['rule']);_0x443ba1[_0x3a0891(0x1dc)](_0x2f4ad6[_0x3a0891(0x17b)],_0x4601b8);const _0x25d35a=collectSegmentRefsFromRule(_0x4601b8);for(const _0x4b50d1 of _0x25d35a){!_0x23c676[_0x3a0891(0x219)](_0x4b50d1)&&_0x1b9388[_0x3a0891(0x188)](_0x4b50d1);}}_0x3e3abd=Array['from'](_0x1b9388);}};return{'createYamlContext':_0x2a6500,'prefetchJourneySegments':_0x3b346d};}export async function executePushSegments(_0x237086,_0x3d8685,_0x10e2a4,_0xe68e60,_0x179af4){const _0x3b3b05=a97_0x560ff4,{segmentDefToCreateRequest:_0x2807c7,segmentDefToUpdateRequest:_0xdf6594}=await import(_0x3b3b05(0x205)),_0x46a043=_0x10e2a4[_0x3b3b05(0x158)],_0x551c41=0x5,_0x5e76ad=async _0x40012a=>{const _0x2f8836=_0x3b3b05,_0x45f2f5=_0x40012a[_0x2f8836(0x194)]?_0x46a043['get'](_0x40012a[_0x2f8836(0x194)]):undefined;let _0x545fb1;const _0x2ea72f={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x40012a[_0x2f8836(0x20b)]){_0x179af4[_0x2f8836(0x15c)]?.({'type':'segment_creating','name':_0x40012a['yamlConfig']['name']});const _0x454752=_0x2807c7(_0x40012a[_0x2f8836(0x1a5)],_0x45f2f5),_0x5b3cd4=await _0x179af4[_0x2f8836(0x18f)](_0x2f8836(0x1cf)+_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)]+_0x2f8836(0x224),()=>_0x237086[_0x2f8836(0x22f)][_0x2f8836(0x208)](_0xe68e60[_0x2f8836(0x226)],_0x454752));_0x545fb1=_0x5b3cd4[_0x2f8836(0x154)]['id'],_0x2ea72f[_0x2f8836(0x164)]={'name':_0x40012a['yamlConfig'][_0x2f8836(0x1eb)],'id':_0x545fb1},_0x179af4[_0x2f8836(0x15c)]?.({'type':_0x2f8836(0x234),'name':_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)],'segmentId':_0x545fb1}),_0x179af4['logSuccess']?.(_0x2f8836(0x1fb)+_0x40012a[_0x2f8836(0x1a5)]['name']+'\x27'),_0x2ea72f[_0x2f8836(0x162)]=0x1;}else{if(_0x40012a[_0x2f8836(0x203)]){_0x179af4['onProgress']?.({'type':_0x2f8836(0x195),'name':_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)]});const _0xfeb70d=_0xdf6594(_0x40012a[_0x2f8836(0x1a5)]);_0x45f2f5!==_0x40012a['existingSegment']?.[_0x2f8836(0x185)]&&(_0xfeb70d[_0x2f8836(0x185)]=_0x45f2f5?parseInt(_0x45f2f5,0xa):undefined),await _0x179af4['withProgress']('Updating\x20segment\x20\x27'+_0x40012a['yamlConfig'][_0x2f8836(0x1eb)]+_0x2f8836(0x224),()=>_0x237086[_0x2f8836(0x22f)][_0x2f8836(0x1d2)](_0xe68e60[_0x2f8836(0x226)],_0x40012a[_0x2f8836(0x16c)]['id'],_0xfeb70d)),_0x545fb1=_0x40012a[_0x2f8836(0x16c)]['id'],_0x179af4['onProgress']?.({'type':_0x2f8836(0x1c1),'name':_0x40012a['yamlConfig'][_0x2f8836(0x1eb)]}),_0x179af4[_0x2f8836(0x1c6)]?.('Updated\x20segment\x20\x27'+_0x40012a[_0x2f8836(0x1a5)]['name']+'\x27'),_0x2ea72f[_0x2f8836(0x1e6)]=0x1;}else _0x545fb1=_0x40012a['existingSegment']['id'];}}catch(_0x29445f){const _0x500320=isHttp400Error(_0x29445f),_0x564ad6=_0x500320?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x2f8836(0x1cb)],_0x11d4d6=getErrorMessage(_0x29445f);throw new SDKError(_0x564ad6,_0x2f8836(0x230)+(_0x40012a[_0x2f8836(0x20b)]?_0x2f8836(0x220):_0x2f8836(0x1be))+'\x20segment\x20from\x20file:\x20'+_0x40012a[_0x2f8836(0x156)]+_0x2f8836(0x1ce)+_0x11d4d6,_0x29445f);}try{const _0x36672b=await syncActivationsForSegment(_0x237086,_0xe68e60[_0x2f8836(0x226)],_0x545fb1,_0x40012a['yamlConfig']['name'],_0x40012a[_0x2f8836(0x235)],_0x179af4,_0x40012a['absolutePath']);_0x2ea72f[_0x2f8836(0x218)]=_0x36672b;}catch(_0x4ad1a3){if(_0x4ad1a3 instanceof SDKError)throw _0x4ad1a3;throw new SDKError(ErrorCode[_0x2f8836(0x22b)],_0x2f8836(0x1a8)+_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)]+_0x2f8836(0x16d)+_0x40012a[_0x2f8836(0x156)]+'\x0a\x20\x20'+getErrorMessage(_0x4ad1a3),_0x4ad1a3);}return _0x2ea72f;},_0x288cd0=await batchAsync(_0x3d8685,_0x5e76ad,_0x551c41),_0x10de56={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x21dfdd of _0x288cd0){_0x10de56[_0x3b3b05(0x162)]+=_0x21dfdd[_0x3b3b05(0x162)],_0x10de56[_0x3b3b05(0x1e6)]+=_0x21dfdd['updated'],_0x21dfdd[_0x3b3b05(0x164)]&&_0x10de56[_0x3b3b05(0x20c)][_0x3b3b05(0x1dc)](_0x21dfdd[_0x3b3b05(0x164)][_0x3b3b05(0x1eb)],_0x21dfdd[_0x3b3b05(0x164)]['id']),_0x10de56[_0x3b3b05(0x218)][_0x3b3b05(0x162)]+=_0x21dfdd[_0x3b3b05(0x218)][_0x3b3b05(0x162)],_0x10de56['activations'][_0x3b3b05(0x1e6)]+=_0x21dfdd[_0x3b3b05(0x218)][_0x3b3b05(0x1e6)],_0x10de56[_0x3b3b05(0x218)][_0x3b3b05(0x1a7)]+=_0x21dfdd[_0x3b3b05(0x218)][_0x3b3b05(0x1a7)];}return _0x10de56;}async function syncActivationsForSegment(_0x51e575,_0x3c5fcc,_0x33bc63,_0x5702d3,_0x2110ed,_0x2d77d3,_0x20e595){const _0x4ceb60=a97_0x560ff4,_0x4881e2={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x26f601 of _0x2110ed){try{if(_0x26f601[_0x4ceb60(0x1f7)]===_0x4ceb60(0x220)&&_0x26f601[_0x4ceb60(0x231)])_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':'activation_creating','segmentName':_0x5702d3,'activationName':_0x26f601['name']}),await _0x2d77d3['withProgress']('Creating\x20activation\x20\x27'+_0x26f601[_0x4ceb60(0x1eb)]+_0x4ceb60(0x224),()=>_0x51e575[_0x4ceb60(0x22f)]['createActivation'](_0x3c5fcc,_0x33bc63,_0x26f601['validatedRequest'])),_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':_0x4ceb60(0x19f),'segmentName':_0x5702d3,'activationName':_0x26f601['name']}),_0x2d77d3[_0x4ceb60(0x1c6)]?.('Created\x20activation\x20\x27'+_0x26f601[_0x4ceb60(0x1eb)]+'\x27'),_0x4881e2[_0x4ceb60(0x162)]++;else{if(_0x26f601[_0x4ceb60(0x1f7)]===_0x4ceb60(0x1be)&&_0x26f601[_0x4ceb60(0x231)]&&_0x26f601['existingActivation'])_0x2d77d3['onProgress']?.({'type':_0x4ceb60(0x202),'segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),await _0x2d77d3[_0x4ceb60(0x18f)](_0x4ceb60(0x232)+_0x26f601['name']+_0x4ceb60(0x224),()=>_0x51e575['segment'][_0x4ceb60(0x1c2)](_0x3c5fcc,_0x33bc63,_0x26f601[_0x4ceb60(0x15b)]['id'],_0x26f601[_0x4ceb60(0x231)])),_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':'activation_updated','segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),_0x2d77d3['logSuccess']?.(_0x4ceb60(0x1ca)+_0x26f601['name']+'\x27'),_0x4881e2[_0x4ceb60(0x1e6)]++;else _0x26f601[_0x4ceb60(0x1f7)]===_0x4ceb60(0x1ba)&&_0x26f601[_0x4ceb60(0x15b)]&&(_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':_0x4ceb60(0x21a),'segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),await _0x2d77d3['withProgress'](_0x4ceb60(0x186)+_0x26f601[_0x4ceb60(0x1eb)]+_0x4ceb60(0x224),()=>_0x51e575[_0x4ceb60(0x22f)][_0x4ceb60(0x21d)](_0x3c5fcc,_0x33bc63,_0x26f601[_0x4ceb60(0x15b)]['id'])),_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':_0x4ceb60(0x151),'segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),_0x2d77d3['logDeleted']?.(_0x4ceb60(0x197)+_0x26f601['name']+'\x27'),_0x4881e2['deleted']++);}}catch(_0x3b8caf){const _0x3ec439=isHttp400Error(_0x3b8caf),_0x15819c=_0x3ec439?ErrorCode[_0x4ceb60(0x16f)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x531b41=getErrorMessage(_0x3b8caf);throw new SDKError(_0x15819c,_0x4ceb60(0x230)+_0x26f601['type']+_0x4ceb60(0x20d)+_0x26f601[_0x4ceb60(0x1eb)]+_0x4ceb60(0x16d)+_0x20e595+'\x0a\x20\x20'+_0x531b41,_0x3b8caf);}}return _0x4881e2;}export async function executePushFolders(_0x115a22,_0x19ebd2,_0xa28377,_0x1422c9,_0x5ccafb){const _0x3eb588=a97_0x560ff4,_0x3abd6f=new Map(_0xa28377);for(const _0x403b8f of _0x19ebd2){const _0x581f9a=_0x403b8f['split']('/'),_0x2714e2=_0x581f9a[_0x581f9a[_0x3eb588(0x1fc)]-0x1],_0x38f44b=_0x581f9a['slice'](0x0,-0x1)[_0x3eb588(0x239)]('/'),_0x4ec414=_0x3abd6f['get'](_0x38f44b);_0x5ccafb['onProgress']?.({'type':_0x3eb588(0x153),'folder':_0x403b8f});const _0x393e93={'name':_0x2714e2,'parentFolderId':_0x4ec414},_0x58cd15=await _0x5ccafb[_0x3eb588(0x18f)](_0x3eb588(0x169)+_0x403b8f+_0x3eb588(0x224),()=>_0x115a22[_0x3eb588(0x22f)][_0x3eb588(0x1e2)](_0x1422c9[_0x3eb588(0x226)],_0x393e93));_0x3abd6f[_0x3eb588(0x1dc)](_0x403b8f,_0x58cd15[_0x3eb588(0x154)]['id']),_0x5ccafb[_0x3eb588(0x15c)]?.({'type':'folder_created','folder':_0x403b8f,'folderId':_0x58cd15[_0x3eb588(0x154)]['id']}),_0x5ccafb[_0x3eb588(0x1bf)]?.(_0x3eb588(0x1d4)+_0x403b8f+'\x27');}return _0x3abd6f;}export async function executePushSegmentDeletions(_0x18ca53,_0x510fef,_0x1fe888){const _0x40c683=a97_0x560ff4;if(_0x510fef[_0x40c683(0x1fc)]===0x0)return 0x0;const {batchAsync:_0x4b0483}=await import(_0x40c683(0x1d7)),_0x144e23=0x5,_0x140298=await _0x4b0483(_0x510fef,async _0x56686c=>{const _0x2e0ca5=_0x40c683;return _0x1fe888[_0x2e0ca5(0x15c)]?.({'type':_0x2e0ca5(0x17d),'name':_0x56686c[_0x2e0ca5(0x1eb)]}),await _0x18ca53['segment'][_0x2e0ca5(0x1c9)](_0x56686c['id']),_0x1fe888['onProgress']?.({'type':_0x2e0ca5(0x19c),'name':_0x56686c[_0x2e0ca5(0x1eb)]}),_0x1fe888[_0x2e0ca5(0x191)]?.(_0x2e0ca5(0x165)+_0x56686c[_0x2e0ca5(0x1eb)]+'\x27'),0x1;},_0x144e23);return _0x140298[_0x40c683(0x175)]((_0xd1422b,_0x139f26)=>_0xd1422b+_0x139f26,0x0);}function a97_0x5250(){const _0x11ed1e=['__pending_act_','map','schedule','journeyActivationStepId','JOURNEY_UPDATE_ERROR','INTERNAL','\x27\x20milestone','parentFolder','parseDocument','delete','embedded_segment_creating','attributes','state','update','logInfo','resolveSegment','segment_updated','updateActivation','deps','digest','10128168eeGHIj','logSuccess','list','yamlActivation','deleteSegment','Updated\x20activation\x20\x27','SEGMENT_UPDATE_ERROR','dirname','\x20(referenced\x20in\x20journey\x20','\x0a\x20\x20','Creating\x20segment\x20\x27','stages','listActivations','updateSegmentById','activationContext','Created\x20folder\x20\x27','listSegments','getSegment','../../utils/async.js','journeys','journeyBundlesByFolderAndName','\x27\x20decision\x20point\x20branch\x20\x27','verbose','set','folderId','4yiUkaJ','steps','get',').\x20','createFolder','push','results','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','updated','skipSegments','journey_updated','Activation\x20not\x20found:\x20','null','name','journey_entry_criteria_','entryCriteria','sort','idToEmailMap','entries','rule','relative','274768biWlOp','Fetching\x20','journeyStages','toLowerCase','type','\x20error(s)','embedded_activation_creating','connectionIdToNameMap','Created\x20segment\x20\x27','length','createJourneySegment','parentSegmentFolder','nameToId','journey_created','trim','activation_updating','hasChanges','resolveJourneyId','./child-segment-yaml.js','branches','filter','createSegment','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Created\x20journey\x20\x27','isNew','createdSegmentIds','\x20activation\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','1630272jIsyQV','draft','effectiveFolderId','40577823bFJoxo','connector_config','user','folder','valid','goal\x20criteria','activations','has','activation_deleting','notification','8028230SyKSuP','deleteActivation','20RURVYL','progress','create','flatMap','activation_template_id','slice','\x27...','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','parentId','message','item','max','journey','ACTIVATION_UPDATE_ERROR','NOT_FOUND','):\x20','entry_criteria','segment','Failed\x20to\x20','validatedRequest','Updating\x20activation\x20\x27','createActivation','segment_created','activationActions','utf-8','hex','versionNumber','join','activation_deleted','startsWith','folder_creating','data','./journey-yaml.js','absolutePath','segmentNameToId','folderPathToId','fetchJourney','description','existingActivation','onProgress','\x27\x20entry\x20criteria','journeyId','existingSegments','all','SEGMENT_NOT_FOUND','created','split','createdSegmentId','Deleted\x20segment\x20\x27','relationships','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','columns','Creating\x20folder\x20\x27','with','journeyBundleName','existingSegment','\x27\x20from\x20file:\x20','find','ACTIVATION_SYNTAX_ERROR','\x20journey\x20from\x20file:\x20','stringify','getJourney','embeddedSegmentNameToId','all_columns','reduce','exitCriterias','journeyById','from','buildUserMaps','nameToType','segmentId','action','segment_deleting','diff','Activation','decision_point','behavior','entry','Stage\x20\x27','activationParams','segmentFolderId','Deleting\x20activation\x20\x27','stage\x20\x27','add','existingJourney','goal','unchanged','2108568ozSwgV','embedded_segment_created','errors','withProgress','index','logDeleted','milestone','embedded_activation_created','folderPath','segment_updating','DecisionPoint','Deleted\x20activation\x20\x27','Name\x20has\x20already\x20been\x20taken','replace','sha1','kind','segment_deleted','toString','journeyActivationNameToId','activation_created','logWarning','parse','Entry\x20criteria:\x20','object','Segment\x20not\x20found:\x20','yamlConfig','segments','deleted','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','size','JOURNEY_SYNTAX_ERROR','rootFolderId','3650298XtagTw','journey_updating','connection','includes','Updated\x20journey\x20\x27'];a97_0x5250=function(){return _0x11ed1e;};return a97_0x5250();}export async function executePushJourneys(_0x770291,_0x4b9ab2,_0x1b3e27,_0x2e71ed,_0xb432f7){const _0x31591b=a97_0x560ff4,{journeyDefToRequest:_0x45655c}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0xe58d4a,yamlRuleToApi:_0x4e19c8,validateSegmentRule:_0x20bba6}=await import('./child-segment-yaml.js'),_0x34d8fd={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3618de=new Map(_0x1b3e27[_0x31591b(0x157)]),_0x21ef5a=0x5;for(let _0x3da41a=0x0;_0x3da41a<_0x4b9ab2['length'];_0x3da41a+=_0x21ef5a){const _0x346734=_0x4b9ab2[_0x31591b(0x223)](_0x3da41a,_0x3da41a+_0x21ef5a),_0x10a8e0=await Promise[_0x31591b(0x160)](_0x346734[_0x31591b(0x1b2)](async _0x4bc995=>{const _0x2ffbb9=_0x31591b;if(!_0x4bc995[_0x2ffbb9(0x20b)]&&!_0x4bc995[_0x2ffbb9(0x203)])return{'action':_0x2ffbb9(0x18b),'name':_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)],'journeyId':_0x4bc995[_0x2ffbb9(0x189)]?.['id']};const _0x231a3a=_0x4bc995[_0x2ffbb9(0x194)]?_0x1b3e27[_0x2ffbb9(0x158)][_0x2ffbb9(0x1e0)](_0x4bc995['folderPath']):undefined;_0xb432f7[_0x2ffbb9(0x15c)]?.({'type':_0x4bc995[_0x2ffbb9(0x20b)]?'journey_creating':_0x2ffbb9(0x1ad),'name':_0x4bc995[_0x2ffbb9(0x1a5)]['name']});try{const _0x1851b9=await executeSingleJourneyPush(_0x770291,_0x4bc995,{..._0x1b3e27,'segmentNameToId':_0x3618de},{'parentId':_0x2e71ed[_0x2ffbb9(0x226)],'rootFolderId':_0x2e71ed[_0x2ffbb9(0x1ab)],'folderId':_0x231a3a,'verbose':_0x2e71ed[_0x2ffbb9(0x1db)]},_0xb432f7,{'journeyDefToRequest':_0x45655c,'activationDefToCreateRequest':_0xe58d4a,'yamlRuleToApi':_0x4e19c8,'validateSegmentRule':_0x20bba6});for(const [_0x37b6de,_0xe5bf1b]of _0x1851b9[_0x2ffbb9(0x173)]){_0x3618de[_0x2ffbb9(0x1dc)](_0x37b6de,_0xe5bf1b),_0x34d8fd[_0x2ffbb9(0x173)][_0x2ffbb9(0x1dc)](_0x37b6de,_0xe5bf1b);}if(_0x1851b9['action']===_0x2ffbb9(0x162))_0xb432f7[_0x2ffbb9(0x15c)]?.({'type':_0x2ffbb9(0x200),'name':_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)],'journeyId':_0x1851b9[_0x2ffbb9(0x15e)]}),_0xb432f7[_0x2ffbb9(0x1c6)]?.(_0x2ffbb9(0x20a)+_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)]+'\x27'),_0x34d8fd[_0x2ffbb9(0x162)]++;else _0x1851b9[_0x2ffbb9(0x17c)]===_0x2ffbb9(0x1e6)&&(_0xb432f7[_0x2ffbb9(0x15c)]?.({'type':_0x2ffbb9(0x1e8),'name':_0x4bc995[_0x2ffbb9(0x1a5)]['name']}),_0xb432f7[_0x2ffbb9(0x1c6)]?.(_0x2ffbb9(0x1b0)+_0x4bc995[_0x2ffbb9(0x1a5)]['name']+'\x27'),_0x34d8fd[_0x2ffbb9(0x1e6)]++);return{'action':_0x1851b9[_0x2ffbb9(0x17c)],'name':_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)],'journeyId':_0x1851b9[_0x2ffbb9(0x15e)]};}catch(_0x1d2410){const _0xcdafa=isHttp400Error(_0x1d2410),_0x3d31f7=_0xcdafa?ErrorCode[_0x2ffbb9(0x1aa)]:ErrorCode[_0x2ffbb9(0x1b5)],_0x4826f8=getErrorMessage(_0x1d2410);throw new SDKError(_0x3d31f7,_0x2ffbb9(0x230)+(_0x4bc995[_0x2ffbb9(0x20b)]?'create':_0x2ffbb9(0x1be))+_0x2ffbb9(0x170)+_0x4bc995['absolutePath']+'\x0a\x20\x20'+_0x4826f8,_0x1d2410);}}));_0x34d8fd[_0x31591b(0x1e4)][_0x31591b(0x1e3)](..._0x10a8e0);}return _0x34d8fd;}async function executeSingleJourneyPush(_0x36392d,_0x1e9664,_0x25c162,_0x4aa9d6,_0x395183,_0x303aa3){const _0x1cab7f=a97_0x560ff4,{journeyDefToRequest:_0x1687c2,activationDefToCreateRequest:_0x3d3318,yamlRuleToApi:_0x44cd90,validateSegmentRule:_0x5bd22b}=_0x303aa3,_0x282f74=new Map(),_0x265d28=new Map(),_0x203e3f=new Map(),_0x174888=new Map(),_0x130828=new Map();let _0x28e735;const _0x4a2786=async()=>{const _0x4d56af=a97_0x1212;if(_0x28e735)return;_0x28e735=new Map();if(!_0x1e9664['existingJourney'])return;const _0x2c7b31=await _0x36392d[_0x4d56af(0x22a)][_0x4d56af(0x1d1)](_0x1e9664[_0x4d56af(0x189)]['id']);for(const _0x53a1c7 of _0x2c7b31){const _0x4c1548=journeyActivationStepToYaml(_0x53a1c7,_0x25c162[_0x4d56af(0x1ef)],_0x25c162['connectionIdToNameMap']),_0x3013dd=activationSignature(_0x4c1548);!_0x28e735['has'](_0x3013dd)&&_0x28e735[_0x4d56af(0x1dc)](_0x3013dd,_0x53a1c7['id']),_0x4c1548[_0x4d56af(0x1eb)]&&_0x265d28[_0x4d56af(0x1dc)](_0x4c1548[_0x4d56af(0x1eb)],_0x53a1c7['id']);}};if(_0x1e9664['existingJourney']&&_0x1e9664['yamlConfig']['segments']){const _0x2a49e0=buildLocalExpandedRuleMappings(_0x1e9664['yamlConfig']),_0xe583ce=_0x2a49e0['localSegmentRules'];if(_0xe583ce[_0x1cab7f(0x1a9)]>0x0){const _0x511129=new Map();for(const [_0x26253d,_0x28924d]of _0xe583ce){const _0x125971=serializeExpandedRule(_0x28924d,_0xe583ce);_0x511129[_0x1cab7f(0x1dc)](_0x26253d,_0x125971);}const _0x468e4b=collectSegmentIdsFromJourneyApi(_0x1e9664[_0x1cab7f(0x189)]);if(_0x468e4b[_0x1cab7f(0x1a9)]>0x0){const _0x36482f=await buildServerSegmentRuleMap(_0x36392d,_0x4aa9d6[_0x1cab7f(0x226)],_0x25c162[_0x1cab7f(0x15f)],_0x468e4b);if(_0x36482f[_0x1cab7f(0x1a9)]>0x0){const _0x1a34d1=new Map();for(const [_0x3640b1,_0x3ff790]of _0x36482f){const _0x2cfc09=serializeExpandedRule(_0x3ff790,_0x36482f);!_0x1a34d1[_0x1cab7f(0x219)](_0x2cfc09)&&_0x1a34d1['set'](_0x2cfc09,_0x3640b1);}for(const [_0x24ac7a,_0x825b3f]of _0x511129){const _0x1eb817=_0x1a34d1[_0x1cab7f(0x1e0)](_0x825b3f);_0x1eb817&&(_0x130828[_0x1cab7f(0x1dc)](_0x24ac7a,_0x1eb817),_0x25c162[_0x1cab7f(0x157)][_0x1cab7f(0x1dc)](_0x24ac7a,_0x1eb817));}}}}}const _0x19edf3={'resolveSegmentId':async _0x277cd9=>{const _0x47110a=_0x1cab7f,_0x2a6a87=_0x25c162[_0x47110a(0x157)][_0x47110a(0x1e0)](_0x277cd9);if(!_0x2a6a87)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x277cd9+_0x47110a(0x1cd)+_0x1e9664[_0x47110a(0x1a5)][_0x47110a(0x1eb)]+')');return _0x2a6a87;},'resolveEmbeddedSegmentId':async(_0x5ab852,_0x5ef114)=>{const _0x5497b8=_0x1cab7f,_0x103e8d=_0x25c162[_0x5497b8(0x157)][_0x5497b8(0x1e0)](_0x5ab852);if(_0x103e8d)return _0x103e8d;const _0x2648f0=_0x130828['get'](_0x5ab852);if(_0x2648f0)return _0x25c162[_0x5497b8(0x157)][_0x5497b8(0x1dc)](_0x5ab852,_0x2648f0),_0x2648f0;const _0x31852f=_0x25c162[_0x5497b8(0x15f)][_0x5497b8(0x16e)](_0x1b3056=>_0x1b3056[_0x5497b8(0x1eb)]===_0x5ab852);if(_0x31852f)return _0x25c162['segmentNameToId']['set'](_0x5ab852,_0x31852f['id']),_0x31852f['id'];if(_0x1e9664['isNew']){const {stageName:_0x5ee4a4,criteriaName:_0x12f1ff}=findSegmentCriteriaLocation(_0x1e9664['yamlConfig'],_0x5ab852);return _0x5bd22b(_0x5ab852,_0x5ef114[_0x5497b8(0x1f1)]),_0x203e3f[_0x5497b8(0x1dc)](_0x5ab852,{'definition':_0x5ef114,'stageName':_0x5ee4a4,'criteriaName':_0x12f1ff}),createPendingSegmentId(_0x5ab852);}const _0x45dc07=_0x1e9664[_0x5497b8(0x189)]?.['id'];if(!_0x45dc07)throw new SDKError(ErrorCode[_0x5497b8(0x1b6)],_0x5497b8(0x20e));_0x5bd22b(_0x5ab852,_0x5ef114['rule']);const _0x991e2c=generateDeterministicJourneySegmentName(_0x1e9664['yamlConfig'][_0x5497b8(0x1eb)],_0x5ab852),_0x2de7a8=_0x25c162[_0x5497b8(0x15f)][_0x5497b8(0x16e)](_0x2cb58f=>_0x2cb58f['name']===_0x991e2c),_0x4e1e27=createSegmentIdResolver(_0x25c162['segmentNameToId'],_0x5ab852),_0x1567a5=await resolveRuleSegmentIds(_0x5ef114[_0x5497b8(0x1f1)],_0x4e1e27);let _0x528a08;if(_0x2de7a8)await _0x36392d['segment'][_0x5497b8(0x1d2)](_0x4aa9d6[_0x5497b8(0x226)],_0x2de7a8['id'],{'description':_0x5ef114[_0x5497b8(0x15a)]||_0x5497b8(0x1a2)+_0x5ab852,'rule':_0x44cd90(_0x1567a5,!![]),'countPopulation':!![]}),_0x528a08=_0x2de7a8['id'];else try{_0x528a08=await _0x36392d['segment']['createJourneySegment']({'name':_0x991e2c,'description':_0x5ef114['description']||_0x5497b8(0x1a2)+_0x5ab852,'journeyId':_0x45dc07,'rule':_0x44cd90(_0x1567a5,!![]),'countPopulation':!![],'parentFolderId':_0x4aa9d6['rootFolderId']||'','audienceId':_0x4aa9d6['parentId']});}catch(_0x37f989){const _0x11599a=_0x37f989 instanceof Error&&_0x37f989[_0x5497b8(0x227)][_0x5497b8(0x1af)](_0x5497b8(0x198));if(_0x11599a){const _0x51da76=await _0x36392d[_0x5497b8(0x22f)][_0x5497b8(0x1d5)](_0x4aa9d6[_0x5497b8(0x226)]),_0x41a757=_0x51da76['find'](_0x225713=>_0x225713[_0x5497b8(0x1eb)]===_0x991e2c);if(_0x41a757)await _0x36392d[_0x5497b8(0x22f)][_0x5497b8(0x1d2)](_0x4aa9d6[_0x5497b8(0x226)],_0x41a757['id'],{'description':_0x5ef114[_0x5497b8(0x15a)]||_0x5497b8(0x1a2)+_0x5ab852,'rule':_0x44cd90(_0x1567a5,!![]),'countPopulation':!![]}),_0x528a08=_0x41a757['id'];else throw _0x37f989;}else throw _0x37f989;}return _0x25c162[_0x5497b8(0x157)][_0x5497b8(0x1dc)](_0x5ab852,_0x528a08),_0x282f74[_0x5497b8(0x1dc)](_0x5ab852,_0x528a08),_0x528a08;},'resolveActivationId':async _0x3a13a5=>{const _0x316208=_0x1cab7f,_0x33b65a=_0x265d28[_0x316208(0x1e0)](_0x3a13a5);if(_0x33b65a)return _0x33b65a;if(_0x1e9664[_0x316208(0x189)]){await _0x4a2786();const _0x13c1ea=_0x265d28['get'](_0x3a13a5);if(_0x13c1ea)return _0x13c1ea;}throw new SDKError(ErrorCode[_0x316208(0x22c)],_0x316208(0x1e9)+_0x3a13a5+_0x316208(0x1cd)+_0x1e9664[_0x316208(0x1a5)][_0x316208(0x1eb)]+_0x316208(0x1e1)+_0x316208(0x209));},'resolveEmbeddedActivationId':async(_0x1622e1,_0x25ee78)=>{const _0xf03413=_0x1cab7f,_0x3849a7=_0x265d28['get'](_0x1622e1);if(_0x3849a7)return _0x3849a7;if(_0x1e9664[_0xf03413(0x20b)])return _0x174888['set'](_0x1622e1,_0x25ee78),createPendingActivationId(_0x1622e1);if(_0x1e9664[_0xf03413(0x189)]){await _0x4a2786();const _0x109463=_0x265d28['get'](_0x25ee78[_0xf03413(0x1eb)]);if(_0x109463)return _0x265d28['set'](_0x1622e1,_0x109463),_0x109463;const _0x47c28d=activationSignature(_0x25ee78),_0x3db397=_0x28e735?.[_0xf03413(0x1e0)](_0x47c28d);if(_0x3db397)return _0x265d28[_0xf03413(0x1dc)](_0x1622e1,_0x3db397),_0x3db397;const _0x306e77=await _0x3d3318(_0x25ee78,_0x25c162[_0xf03413(0x1d3)]),_0x5ee6b2=await _0x36392d[_0xf03413(0x22a)][_0xf03413(0x233)](_0x1e9664[_0xf03413(0x189)]['id'],_0x306e77);return _0x265d28[_0xf03413(0x1dc)](_0x1622e1,_0x5ee6b2['id']),_0x5ee6b2['id'];}throw new SDKError(ErrorCode[_0xf03413(0x1b6)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x1e3528=>{const _0x49e997=_0x1cab7f;try{return await _0x36392d[_0x49e997(0x22a)][_0x49e997(0x204)](_0x4aa9d6['parentId'],_0x1e3528);}catch(_0x3a9f44){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x1e3528+_0x49e997(0x167)+_0x1e9664[_0x49e997(0x1a5)][_0x49e997(0x1eb)]+'\x27)',_0x3a9f44);}},'resolveStageId':async(_0x1902e9,_0x332bc6)=>{const _0x2d74bb=_0x1cab7f,_0x15e5d3=await _0x36392d[_0x2d74bb(0x22a)][_0x2d74bb(0x172)](_0x1902e9),_0x52fec0=_0x15e5d3[_0x2d74bb(0x1bc)]['journeyStages'][_0x2d74bb(0x16e)](_0x51f126=>_0x51f126[_0x2d74bb(0x1eb)][_0x2d74bb(0x1f6)]()===_0x332bc6['toLowerCase']());if(!_0x52fec0?.['id'])throw new SDKError(ErrorCode[_0x2d74bb(0x22c)],_0x2d74bb(0x183)+_0x332bc6+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x15e5d3[_0x2d74bb(0x1bc)][_0x2d74bb(0x16b)]||_0x15e5d3['attributes'][_0x2d74bb(0x1eb)])+'\x27');return _0x52fec0['id'];}},_0x220184=await _0x1687c2(_0x1e9664['yamlConfig'],_0x4aa9d6[_0x1cab7f(0x226)],_0x19edf3),_0xdd3374=_0x4aa9d6[_0x1cab7f(0x1dd)]||_0x4aa9d6['rootFolderId'];_0xdd3374&&(_0x220184['relationships']={'parentFolder':{'data':{'id':_0xdd3374,'type':_0x1cab7f(0x215)}}});if(_0x1e9664[_0x1cab7f(0x20b)]){if(_0x203e3f[_0x1cab7f(0x1a9)]>0x0||_0x174888['size']>0x0)return await executeThreeStepJourneyCreate(_0x36392d,_0x1e9664,_0x220184,{'pendingEmbeddedSegments':_0x203e3f,'pendingEmbeddedActivations':_0x174888,'embeddedSegmentNameToId':_0x282f74,'journeyActivationNameToId':_0x265d28},{..._0x4aa9d6,'effectiveFolderId':_0xdd3374},_0x25c162,_0x395183,_0x303aa3);else{ensureJourneyDefaults(_0x220184['attributes']);const _0xf86542=await _0x36392d[_0x1cab7f(0x22a)][_0x1cab7f(0x220)](_0x220184);return{'action':_0x1cab7f(0x162),'journeyId':_0xf86542['id'],'embeddedSegmentNameToId':_0x282f74};}}else{if(_0x1e9664['hasChanges']&&_0x1e9664['existingJourney'])return ensureJourneyDefaults(_0x220184[_0x1cab7f(0x1bc)]),await _0x36392d[_0x1cab7f(0x22a)][_0x1cab7f(0x1be)](_0x1e9664[_0x1cab7f(0x189)]['id'],_0x220184),{'action':_0x1cab7f(0x1e6),'journeyId':_0x1e9664[_0x1cab7f(0x189)]['id'],'embeddedSegmentNameToId':_0x282f74};}return{'action':'unchanged','journeyId':_0x1e9664[_0x1cab7f(0x189)]?.['id'],'embeddedSegmentNameToId':_0x282f74};}function findSegmentCriteriaLocation(_0x56c2d5,_0x14b79c){const _0x3b835e=a97_0x560ff4,_0x19fb97=_0x56c2d5[_0x3b835e(0x1d0)]||_0x56c2d5['journeys']?.[0x0]?.[_0x3b835e(0x1d0)]||[];let _0x3f9f62=_0x3b835e(0x182),_0x48ae3c=_0x14b79c;const _0x689841=_0x56c2d5[_0x3b835e(0x18a)]||_0x56c2d5[_0x3b835e(0x1d8)]?.[0x0]?.[_0x3b835e(0x18a)];if(_0x689841?.[_0x3b835e(0x22f)]===_0x14b79c)return{'stageName':_0x3b835e(0x18a),'criteriaName':_0x689841[_0x3b835e(0x1eb)]||_0x14b79c};_0x5d1069:for(const _0x572c33 of _0x19fb97){if(_0x572c33[_0x3b835e(0x22e)]?.[_0x3b835e(0x22f)]===_0x14b79c){_0x3f9f62=_0x572c33['name'],_0x48ae3c=_0x572c33[_0x3b835e(0x22e)][_0x3b835e(0x1eb)]||_0x14b79c;break;}if(_0x572c33[_0x3b835e(0x1df)])for(const _0x26c129 of _0x572c33[_0x3b835e(0x1df)]){if(_0x26c129['type']===_0x3b835e(0x180)&&_0x26c129[_0x3b835e(0x16a)]?.['branches'])for(const _0x10ce99 of _0x26c129['with'][_0x3b835e(0x206)]){if(_0x10ce99[_0x3b835e(0x22f)]===_0x14b79c){_0x3f9f62=_0x572c33[_0x3b835e(0x1eb)],_0x48ae3c=_0x10ce99[_0x3b835e(0x1eb)]||_0x14b79c;break _0x5d1069;}}}}return{'stageName':_0x3f9f62,'criteriaName':_0x48ae3c};}function a97_0x1212(_0x505e1f,_0x57162b){_0x505e1f=_0x505e1f-0x151;const _0x52501d=a97_0x5250();let _0x1212d3=_0x52501d[_0x505e1f];return _0x1212d3;}async function executeThreeStepJourneyCreate(_0x28708a,_0xba003e,_0x128636,_0x377d97,_0x2168a7,_0x391ca3,_0x204db2,_0x2fc421){const _0x417c11=a97_0x560ff4,{activationDefToCreateRequest:_0x4a4112,yamlRuleToApi:_0x1b7c0c}=_0x2fc421,{pendingEmbeddedSegments:_0x25aed9,pendingEmbeddedActivations:_0x43f4cc,embeddedSegmentNameToId:_0x31c5f7}=_0x377d97,_0x3bd6e2=JSON['parse'](JSON[_0x417c11(0x171)](_0x128636));ensureJourneyDefaults(_0x3bd6e2[_0x417c11(0x1bc)]),stripPendingIds(_0x3bd6e2);const _0x3067a2=await _0x28708a[_0x417c11(0x22a)]['create'](_0x3bd6e2),_0x370e50=_0x3067a2['id'],_0x3e629a=new Map();for(const _0x159442 of _0x3067a2[_0x417c11(0x1bc)][_0x417c11(0x1f5)]){_0x3e629a[_0x417c11(0x1dc)](_0x159442['name']['toLowerCase'](),_0x159442['id']);}for(const [_0x40e58c,{definition:_0x5545f8}]of _0x25aed9){const _0x19cd6f=generateDeterministicJourneySegmentName(_0xba003e[_0x417c11(0x1a5)][_0x417c11(0x1eb)],_0x40e58c);_0x204db2[_0x417c11(0x15c)]?.({'type':_0x417c11(0x1bb),'journeyName':_0xba003e[_0x417c11(0x1a5)]['name'],'segmentName':_0x40e58c});const _0x2cd6d3=createSegmentIdResolver(_0x391ca3[_0x417c11(0x157)],_0x40e58c),_0x3a2c18=await resolveRuleSegmentIds(_0x5545f8[_0x417c11(0x1f1)],_0x2cd6d3),_0x43d8d4=await _0x28708a[_0x417c11(0x22f)][_0x417c11(0x1fd)]({'name':_0x19cd6f,'description':_0x5545f8[_0x417c11(0x15a)]||_0x417c11(0x1a2)+_0x40e58c,'journeyId':_0x370e50,'rule':_0x1b7c0c(_0x3a2c18,!![]),'countPopulation':!![],'parentFolderId':_0x2168a7[_0x417c11(0x211)]||'','audienceId':_0x2168a7[_0x417c11(0x226)]});_0x31c5f7[_0x417c11(0x1dc)](_0x40e58c,_0x43d8d4),_0x391ca3[_0x417c11(0x157)][_0x417c11(0x1dc)](_0x40e58c,_0x43d8d4),_0x204db2['onProgress']?.({'type':_0x417c11(0x18d),'journeyName':_0xba003e[_0x417c11(0x1a5)][_0x417c11(0x1eb)],'segmentName':_0x40e58c});}const _0x516755=new Map();for(const [_0x1dca31,_0x3b965b]of _0x43f4cc){_0x204db2[_0x417c11(0x15c)]?.({'type':_0x417c11(0x1f9),'journeyName':_0xba003e['yamlConfig'][_0x417c11(0x1eb)],'activationName':_0x1dca31});const _0x44a853=await _0x4a4112(_0x3b965b,_0x391ca3[_0x417c11(0x1d3)]),_0x4a0bd1=await _0x28708a['journey'][_0x417c11(0x233)](_0x370e50,_0x44a853);_0x516755[_0x417c11(0x1dc)](_0x1dca31,_0x4a0bd1['id']),_0x377d97[_0x417c11(0x19e)][_0x417c11(0x1dc)](_0x1dca31,_0x4a0bd1['id']),_0x204db2[_0x417c11(0x15c)]?.({'type':_0x417c11(0x193),'journeyName':_0xba003e[_0x417c11(0x1a5)][_0x417c11(0x1eb)],'activationName':_0x1dca31});}const _0xf3c1ec=JSON[_0x417c11(0x1a1)](JSON[_0x417c11(0x171)](_0x128636));return _0xf3c1ec['id']=_0x370e50,ensureJourneyDefaults(_0xf3c1ec['attributes']),resolvePendingIdsInRequest(_0xf3c1ec,_0x128636,_0x3e629a,_0x31c5f7,_0x516755,_0x204db2),await _0x28708a[_0x417c11(0x22a)]['update'](_0x370e50,_0xf3c1ec),{'action':_0x417c11(0x162),'journeyId':_0x370e50,'embeddedSegmentNameToId':_0x31c5f7};}function stripPendingIds(_0x3411b7){const _0x45998e=a97_0x560ff4;for(const _0x2394d0 of _0x3411b7[_0x45998e(0x1bc)][_0x45998e(0x1f5)]||[]){_0x2394d0[_0x45998e(0x1ed)]?.['segmentId']&&isPendingSegmentId(_0x2394d0['entryCriteria'][_0x45998e(0x17b)])&&delete _0x2394d0[_0x45998e(0x1ed)];if(_0x2394d0[_0x45998e(0x1df)])for(const _0x2072ba of Object['keys'](_0x2394d0[_0x45998e(0x1df)])){const _0x32ddf3=_0x2394d0[_0x45998e(0x1df)][_0x2072ba];_0x32ddf3[_0x45998e(0x1f7)]===_0x45998e(0x17f)&&_0x32ddf3['journeyActivationStepId']&&isPendingActivationId(_0x32ddf3[_0x45998e(0x1b4)])&&(_0x32ddf3['journeyActivationStepId']='');if(_0x32ddf3[_0x45998e(0x1f7)]==='DecisionPoint'&&_0x32ddf3[_0x45998e(0x206)])for(const _0x1a9503 of _0x32ddf3[_0x45998e(0x206)]){_0x1a9503[_0x45998e(0x17b)]&&isPendingSegmentId(_0x1a9503[_0x45998e(0x17b)])&&(_0x1a9503[_0x45998e(0x17b)]='');}}}}function resolvePendingIdsInRequest(_0x3c7fea,_0x2c6a3d,_0x2b3144,_0x4a173e,_0xaaee22,_0x3602a1){const _0x294278=a97_0x560ff4,_0x1c2c5d=(_0x393f9a,_0x3e74a4)=>{const _0xb34eb5=a97_0x1212;if(!isPendingSegmentId(_0x393f9a))return _0x393f9a;const _0x67dd59=extractPendingSegmentName(_0x393f9a),_0x27fd37=_0x4a173e['get'](_0x67dd59);return!_0x27fd37&&_0x3602a1[_0xb34eb5(0x1a0)]?.(_0xb34eb5(0x225)+_0x67dd59+'\x27\x20for\x20'+_0x3e74a4),_0x27fd37;};if(_0x3c7fea[_0x294278(0x1bc)][_0x294278(0x18a)]?.[_0x294278(0x17b)]&&isPendingSegmentId(_0x3c7fea[_0x294278(0x1bc)][_0x294278(0x18a)][_0x294278(0x17b)])){const _0x50b436=_0x1c2c5d(_0x3c7fea[_0x294278(0x1bc)][_0x294278(0x18a)][_0x294278(0x17b)],_0x294278(0x217));_0x50b436&&(_0x3c7fea[_0x294278(0x1bc)]['goal'][_0x294278(0x17b)]=_0x50b436);}for(const _0x45a0b8 of _0x3c7fea[_0x294278(0x1bc)][_0x294278(0x1f5)]||[]){const _0x4c7410=_0x2b3144[_0x294278(0x1e0)](_0x45a0b8[_0x294278(0x1eb)][_0x294278(0x1f6)]());_0x4c7410&&(_0x45a0b8['id']=_0x4c7410);if(_0x45a0b8[_0x294278(0x1ed)]?.[_0x294278(0x17b)]&&isPendingSegmentId(_0x45a0b8[_0x294278(0x1ed)][_0x294278(0x17b)])){const _0x2fb77e=_0x1c2c5d(_0x45a0b8[_0x294278(0x1ed)][_0x294278(0x17b)],'stage\x20\x27'+_0x45a0b8[_0x294278(0x1eb)]+_0x294278(0x15d));_0x2fb77e&&(_0x45a0b8['entryCriteria']['segmentId']=_0x2fb77e);}if(_0x45a0b8[_0x294278(0x176)])for(const _0x83a810 of _0x45a0b8[_0x294278(0x176)]){if(_0x83a810[_0x294278(0x17b)]&&isPendingSegmentId(_0x83a810['segmentId'])){const _0x182900=_0x1c2c5d(_0x83a810[_0x294278(0x17b)],_0x294278(0x187)+_0x45a0b8['name']+'\x27\x20exit\x20criteria');_0x182900&&(_0x83a810[_0x294278(0x17b)]=_0x182900);}}if(_0x45a0b8[_0x294278(0x192)]?.[_0x294278(0x17b)]&&isPendingSegmentId(_0x45a0b8[_0x294278(0x192)][_0x294278(0x17b)])){const _0x503fc7=_0x1c2c5d(_0x45a0b8[_0x294278(0x192)]['segmentId'],_0x294278(0x187)+_0x45a0b8['name']+_0x294278(0x1b7));_0x503fc7&&(_0x45a0b8[_0x294278(0x192)][_0x294278(0x17b)]=_0x503fc7);}if(_0x45a0b8[_0x294278(0x1df)]){const _0x76bc31=_0x7796cd=>_0x2c6a3d['attributes'][_0x294278(0x1f5)][_0x294278(0x16e)](_0x1cb030=>_0x1cb030['name'][_0x294278(0x1f6)]()===_0x45a0b8[_0x294278(0x1eb)]['toLowerCase']())?.[_0x294278(0x1df)]?.[_0x7796cd];for(const _0x3c475d of Object['keys'](_0x45a0b8[_0x294278(0x1df)])){const _0x2f8f19=_0x45a0b8['steps'][_0x3c475d],_0x181723=_0x76bc31(_0x3c475d);if(_0x2f8f19['type']==='Activation'&&_0x2f8f19[_0x294278(0x1b4)]&&(isPendingActivationId(_0x2f8f19[_0x294278(0x1b4)])||_0x2f8f19[_0x294278(0x1b4)]==='')){if(_0x181723?.[_0x294278(0x1b4)]&&isPendingActivationId(_0x181723[_0x294278(0x1b4)])){const _0x14b97c=extractPendingActivationName(_0x181723[_0x294278(0x1b4)]),_0x36febe=_0xaaee22[_0x294278(0x1e0)](_0x14b97c);_0x36febe&&(_0x2f8f19['journeyActivationStepId']=_0x36febe);}}if(_0x2f8f19[_0x294278(0x1f7)]===_0x294278(0x196)&&_0x2f8f19['branches']&&_0x181723?.['branches'])for(let _0x58ba60=0x0;_0x58ba60<_0x2f8f19[_0x294278(0x206)]['length'];_0x58ba60++){const _0xed8109=_0x2f8f19[_0x294278(0x206)][_0x58ba60],_0x5019a0=_0x181723['branches'][_0x58ba60];if(_0x5019a0?.['segmentId']&&isPendingSegmentId(_0x5019a0[_0x294278(0x17b)])){const _0x48ffe6=_0x1c2c5d(_0x5019a0['segmentId'],_0x294278(0x187)+_0x45a0b8[_0x294278(0x1eb)]+_0x294278(0x1da)+(_0xed8109[_0x294278(0x1eb)]||_0x58ba60)+'\x27');_0x48ffe6&&(_0xed8109[_0x294278(0x17b)]=_0x48ffe6);}}}}}}
|
|
1
|
+
const a97_0xce8e14=a97_0x3eba;(function(_0x340df5,_0x15cab5){const _0x18337a=a97_0x3eba,_0x45923f=_0x340df5();while(!![]){try{const _0x2a3681=-parseInt(_0x18337a(0x1ec))/0x1*(parseInt(_0x18337a(0x1db))/0x2)+parseInt(_0x18337a(0x12f))/0x3+parseInt(_0x18337a(0x12b))/0x4+parseInt(_0x18337a(0x14a))/0x5*(-parseInt(_0x18337a(0x1c6))/0x6)+-parseInt(_0x18337a(0x15d))/0x7+parseInt(_0x18337a(0x174))/0x8+parseInt(_0x18337a(0x1aa))/0x9;if(_0x2a3681===_0x15cab5)break;else _0x45923f['push'](_0x45923f['shift']());}catch(_0x24276f){_0x45923f['push'](_0x45923f['shift']());}}}(a97_0x50ca,0x91991));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a97_0xce8e14(0x10b);export const PENDING_ACTIVATION_PREFIX=a97_0xce8e14(0x1b7);export function createPendingSegmentId(_0x30a771){return''+PENDING_SEGMENT_PREFIX+_0x30a771+'__';}export function isPendingSegmentId(_0x40e961){const _0x315358=a97_0xce8e14;return _0x40e961[_0x315358(0x13a)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x210909){return _0x210909['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4512ce){return''+PENDING_ACTIVATION_PREFIX+_0x4512ce+'__';}export function isPendingActivationId(_0x1b1edc){const _0x2d7afc=a97_0xce8e14;return _0x1b1edc[_0x2d7afc(0x13a)](PENDING_ACTIVATION_PREFIX);}function a97_0x50ca(){const _0x459a6e=['connectionIdToNameMap','delete','item','nameToId','__pending_','getJourney','parse','stringify','action','Updated\x20segment\x20\x27','replace','deleteSegment','segmentNameToId','createJourneySegment','\x27\x20from\x20file:\x20','filter','user','segmentId','push','type','listActivations','embedded_segment_creating','resolveSegment','utf-8','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','relationships','hasChanges','connection','journey_created','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','embeddedSegmentNameToId','flatMap','journey','segment_deleted','trim','Failed\x20to\x20','1625800AKNncQ','Entry\x20criteria:\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','embedded_segment_created','1137309xLegSY','progress','\x27\x20for\x20','Activation\x20not\x20found:\x20','Segment\x20not\x20found:\x20','columns','./child-segment-yaml.js','SEGMENT_UPDATE_ERROR','./journey-yaml.js','yamlConfig','goal','startsWith','NOT_FOUND','getSegment','journeyBundleName','\x27\x20entry\x20criteria','stage\x20\x27','Journey\x20\x27','entry_criteria','activationContext','logInfo','existingJourney','Created\x20journey\x20\x27','listSegments','journeyActivationNameToId','\x27...','Created\x20folder\x20\x27','20620jCAxjh','DecisionPoint','results','resolveJourneyId','journeyId','name','Fetching\x20','Creating\x20segment\x20\x27','message','size','exitCriterias','entry','activationActions','slice','parentSegmentFolder','Deleted\x20segment\x20\x27','toLowerCase','activation_deleted','\x20journey\x20from\x20file:\x20','1091174OtWxkD','attributes','length','with','description','journeyActivationStepId','set','JOURNEY_UPDATE_ERROR','validatedRequest','activation_updating','versionNumber','):\x20','valid','Updated\x20activation\x20\x27','has','steps','segment','folder','digest','segment_creating','reduce','logSuccess','localSegmentRules','1530120WwWgHh','\x20(referenced\x20in\x20journey\x20','Deleted\x20activation\x20\x27','idToEmailMap','data','\x20activation\x20\x27','\x27\x20decision\x20point\x20branch\x20\x27','activation_','logWarning','createActivation','folderPath','unchanged','idToName','embedded_activation_created','activationParams','entryCriteria','deleteActivation','find','createdSegmentId','list','null','journeys','updateActivation','createFolder','activations','createSegment','object','parseDocument','behavior','isNew','\x0a\x20\x20','draft','segment_created','diff','relative','split','Activation','Updating\x20activation\x20\x27','add','parentFolder','Name\x20has\x20already\x20been\x20taken','journeyStages','get','index','existingActivation','keys','activation_deleting','Creating\x20folder\x20\x27','errors','absolutePath','Created\x20segment\x20\x27','Created\x20activation\x20\x27','folderPathToId','rule','15118416gYmwcd','ACTIVATION_SYNTAX_ERROR','created','update','updated','activation_creating','activationsBySegmentId','all_columns','folderId','state','activation_template_id','segments','segment_updated','__pending_act_','withProgress','INTERNAL','decision_point','all','journeyBundlesByFolderAndName','updateSegmentById','\x20error(s)','deleted','parentId','yamlActivation','onProgress','connector_config','milestone','notification','1374SRcMSq','Deleting\x20activation\x20\x27','sort','rootFolderId','schedule',').\x20','journey_updated','journeyById','ACTIVATION_UPDATE_ERROR','existingSegments','segmentFolderId','sha1','Updated\x20journey\x20\x27','stages','\x27\x20milestone','effectiveFolderId','kind','segment_updating','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','map','activationStepsById','2tAdZDE','from','toString','createdSegmentIds','fetchJourney','logDeleted','activation_updated','\x27\x20exit\x20criteria','../../utils/async.js','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journey_entry_criteria_','create','verbose','branches','join','SEGMENT_NOT_FOUND','max','959995iatAaY','deps','existingSegment','SEGMENT_SYNTAX_ERROR'];a97_0x50ca=function(){return _0x459a6e;};return a97_0x50ca();}export function extractPendingActivationName(_0x2e2986){const _0x2197da=a97_0xce8e14;return _0x2e2986[_0x2197da(0x111)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x3b7da1,_0x3afcc9){const _0x3b8bcf=a97_0xce8e14,_0x16d34f=_0x3b7da1+'::'+(_0x3afcc9[_0x3b8bcf(0x129)]()||_0x3b8bcf(0x16d)),_0x4a6191=createHash(_0x3b8bcf(0x1d1))[_0x3b8bcf(0x1ad)](_0x16d34f)[_0x3b8bcf(0x16f)]('hex')['slice'](0x0,0xc);return _0x3b8bcf(0x1e5)+_0x4a6191;}export function ensureJourneyDefaults(_0x2cb13e){const _0x2ff20c=a97_0xce8e14;!_0x2cb13e['description']&&(_0x2cb13e[_0x2ff20c(0x161)]=''),!_0x2cb13e[_0x2ff20c(0x1b3)]&&(_0x2cb13e[_0x2ff20c(0x1b3)]=_0x2ff20c(0x193));}export function resolveTDFolderPath(_0x48acf4,_0x2dc275,_0x38d158){if(!_0x2dc275)return _0x48acf4;if(_0x48acf4===_0x38d158||_0x48acf4['startsWith'](_0x38d158+'/'))return _0x48acf4;return _0x48acf4?_0x38d158+'/'+_0x48acf4:_0x38d158;}export function addFoldersToCreate(_0x7d0693,_0x79b370,_0xfd924e){const _0x3d156b=a97_0xce8e14;if(!_0x7d0693)return;if(_0x79b370[_0x3d156b(0x16b)](_0x7d0693))return;const _0x5012c3=_0x7d0693['split']('/');let _0x20ceca='';for(const _0x185c13 of _0x5012c3){_0x20ceca=_0x20ceca?_0x20ceca+'/'+_0x185c13:_0x185c13,!_0x79b370[_0x3d156b(0x16b)](_0x20ceca)&&_0xfd924e[_0x3d156b(0x19a)](_0x20ceca);}}import*as a97_0x58dbed from'yaml';import{readFileSync}from'fs';import a97_0x5ba372 from'path';import{isJourneyDef,parseYamlString as a97_0x364a9b,toYamlString as a97_0x21b7c9,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x3a2e0e){const _0x2a6963=a97_0xce8e14;if(Array['isArray'](_0x3a2e0e))return'['+_0x3a2e0e[_0x2a6963(0x1d9)](_0x1b0c0b=>stableStringify(_0x1b0c0b))[_0x2a6963(0x1e9)](',')+']';if(_0x3a2e0e&&typeof _0x3a2e0e===_0x2a6963(0x18e)){const _0x4e569a=_0x3a2e0e,_0x3da666=Object['keys'](_0x4e569a)[_0x2a6963(0x1c8)](),_0x50b4ee=_0x3da666[_0x2a6963(0x1d9)](_0x2472de=>'\x22'+_0x2472de+'\x22:'+stableStringify(_0x4e569a[_0x2472de]));return'{'+_0x50b4ee[_0x2a6963(0x1e9)](',')+'}';}const _0x50800c=JSON[_0x2a6963(0x10e)](_0x3a2e0e);return _0x50800c===undefined?_0x2a6963(0x188):_0x50800c;}function activationSignature(_0x14e9e3){const _0x1dfd7e=a97_0xce8e14,_0x1bf07f={'connection':_0x14e9e3[_0x1dfd7e(0x122)],..._0x14e9e3[_0x1dfd7e(0x1b1)]!==undefined&&{'all_columns':_0x14e9e3[_0x1dfd7e(0x1b1)]},..._0x14e9e3[_0x1dfd7e(0x134)]!==undefined&&{'columns':_0x14e9e3['columns']},..._0x14e9e3[_0x1dfd7e(0x190)]!==undefined&&{'behavior':_0x14e9e3['behavior']},..._0x14e9e3['schedule']!==undefined&&{'schedule':_0x14e9e3[_0x1dfd7e(0x1ca)]},..._0x14e9e3[_0x1dfd7e(0x1c5)]!==undefined&&{'notification':_0x14e9e3[_0x1dfd7e(0x1c5)]},..._0x14e9e3['connector_config']!==undefined&&{'connector_config':_0x14e9e3[_0x1dfd7e(0x1c3)]},..._0x14e9e3[_0x1dfd7e(0x1b4)]!==undefined&&{'activation_template_id':_0x14e9e3[_0x1dfd7e(0x1b4)]}};return stableStringify(_0x1bf07f);}export async function prepareSegmentFiles(_0x5eb8a5,_0x259672,_0x1c92b5,_0x22de57,_0x42ba4f){const _0x167756=a97_0xce8e14,{activationDefToCreateRequest:_0x459c9a}=await import(_0x167756(0x135)),_0x21cfc8=[],_0x2dd4ea=new Set();for(const {yamlConfig:_0x2fe0bc,folderPath:_0x16f755,sourcePath:_0x5cd9f3}of _0x5eb8a5){const _0x4ed750=resolveTDFolderPath(_0x16f755,_0x22de57,_0x42ba4f),_0x3e70ce=_0x4ed750+':'+_0x2fe0bc[_0x167756(0x14f)],_0x4250d8=_0x259672['segmentByFolderAndName'][_0x167756(0x19e)](_0x3e70ce),_0x14e30d=_0x4250d8?_0x259672[_0x167756(0x1b0)][_0x167756(0x19e)](_0x4250d8['id'])||[]:[];addFoldersToCreate(_0x4ed750,_0x259672['folderPathToId'],_0x2dd4ea);const _0xec6072=calculateActivationActions(_0x2fe0bc[_0x167756(0x18c)]||[],_0x14e30d,_0x259672[_0x167756(0x177)],_0x259672[_0x167756(0x107)]);for(const _0x27ede9 of _0xec6072){(_0x27ede9[_0x167756(0x11a)]==='create'||_0x27ede9['type']===_0x167756(0x1ad))&&_0x27ede9[_0x167756(0x1c1)]&&(_0x27ede9['validatedRequest']=await _0x459c9a(_0x27ede9[_0x167756(0x1c1)],_0x1c92b5));}const _0x255780=calculateSegmentDiff(_0x2fe0bc,_0x4250d8,_0x14e30d,_0x259672[_0x167756(0x177)],_0x259672[_0x167756(0x107)]);_0x21cfc8['push']({'relativePath':_0x2fe0bc[_0x167756(0x14f)],'absolutePath':_0x5cd9f3,'yamlConfig':_0x2fe0bc,'folderPath':_0x4ed750,'existingSegment':_0x4250d8,'existingActivations':_0x14e30d,'isNew':_0x255780[_0x167756(0x191)],'hasChanges':_0x255780[_0x167756(0x121)],'diff':_0x255780[_0x167756(0x195)],'activationActions':_0xec6072});}return{'segmentFiles':_0x21cfc8,'foldersToCreate':_0x2dd4ea};}export async function prepareJourneyFiles(_0x4d8f18,_0x4cc084,_0x24f0e0,_0x2199e6){const _0xef6425=a97_0xce8e14,_0xf01a0d=[],_0x4cd147=new Set();for(const {yamlConfig:_0x4ac378,folderPath:_0x118ad1,sourcePath:_0xa9e9c9}of _0x4d8f18){const _0x548db9=resolveTDFolderPath(_0x118ad1,_0x24f0e0,_0x2199e6),_0x229715=_0x548db9+':'+_0x4ac378['name'],_0x182e08=_0x4cc084[_0xef6425(0x1bc)][_0xef6425(0x19e)](_0x229715);let _0x56cadf,_0x1d5e39;if(_0x182e08&&_0x182e08['length']>0x0){const _0x440189=buildLocalExpandedRuleMappings(_0x4ac378),{createYamlContext:_0x48d14a,prefetchJourneySegments:_0x18f535}=createPushYamlContextForBundle(_0x4cc084[_0xef6425(0x1ed)],_0x4cc084['parentId'],_0x4cc084[_0xef6425(0x1cf)],_0x440189,_0x4cc084[_0xef6425(0x177)],_0x4cc084[_0xef6425(0x107)],_0x4cc084[_0xef6425(0x1da)],_0x4cc084[_0xef6425(0x1cd)]);await _0x18f535(_0x182e08[_0xef6425(0x1d9)](_0x1f77b1=>_0x1f77b1['id']));const _0x51fa53=hasMultipleVersions(_0x4ac378),_0x2781d9=async _0x58340c=>{const _0x8777e4=_0xef6425,_0x45d1ef=_0x4cc084[_0x8777e4(0x1cd)]?.['get'](_0x58340c);if(_0x45d1ef)return _0x45d1ef;return _0x4cc084[_0x8777e4(0x1df)]({'journeyId':_0x58340c,'journeyName':_0x4ac378['name'],'isMultiVersion':_0x182e08[_0x8777e4(0x15f)]>0x1});};if(_0x51fa53&&_0x182e08[_0xef6425(0x15f)]>0x1){const _0x247b6e=[];for(const _0x25209a of _0x182e08){const _0x2b1db2=_0x25209a[_0xef6425(0x167)]||0x1;_0x4cc084[_0xef6425(0x130)]?.['update'](_0xef6425(0x150)+_0x4ac378[_0xef6425(0x14f)]+'\x20v'+_0x2b1db2);const _0x6e5ead=await _0x2781d9(_0x25209a['id']),_0x577ca0=_0x48d14a(_0x25209a['id']),_0x235e0d=await journeyResponseToDef(_0x6e5ead,_0x577ca0);_0x247b6e['push']({'item':_0x25209a,'yaml':_0x235e0d});}const _0x263c3a=buildLocalRuleToNameMappingFromJourney(_0x4ac378);_0x1d5e39=buildMergedJourneyDef(_0x247b6e,_0x263c3a);const _0x5e8814=Math[_0xef6425(0x1eb)](..._0x247b6e[_0xef6425(0x1d9)](_0x3e7819=>_0x3e7819[_0xef6425(0x109)][_0xef6425(0x167)]||0x0)),_0x44755b=_0x182e08[_0xef6425(0x185)](_0x4d86a7=>(_0x4d86a7[_0xef6425(0x167)]||0x0)===_0x5e8814);_0x44755b&&(_0x4cc084[_0xef6425(0x130)]?.[_0xef6425(0x1ad)](_0xef6425(0x150)+_0x4ac378['name']+'\x20v'+_0x5e8814),_0x56cadf=await _0x2781d9(_0x44755b['id']));}else{const _0x1bc4a5=_0x182e08[_0x182e08['length']-0x1];_0x4cc084[_0xef6425(0x130)]?.[_0xef6425(0x1ad)](_0xef6425(0x150)+_0x4ac378[_0xef6425(0x14f)]),_0x56cadf=await _0x2781d9(_0x1bc4a5['id']);const _0x5ba369=_0x48d14a(_0x1bc4a5['id']),_0xc1c07=await journeyResponseToDef(_0x56cadf,_0x5ba369),_0x31d4ca=buildLocalRuleToNameMappingFromJourney(_0x4ac378);_0x1d5e39=buildMergedJourneyDef([{'item':_0x1bc4a5,'yaml':_0xc1c07}],_0x31d4ca);}}addFoldersToCreate(_0x548db9,_0x4cc084['folderPathToId'],_0x4cd147);const _0x24d9e6=calculateJourneyDiff(_0x4ac378,_0x1d5e39);_0xf01a0d[_0xef6425(0x119)]({'relativePath':_0x4ac378[_0xef6425(0x14f)],'absolutePath':_0xa9e9c9,'yamlConfig':_0x4ac378,'folderPath':_0x548db9,'existingJourney':_0x56cadf,'isNew':_0x24d9e6[_0xef6425(0x191)],'hasChanges':_0x24d9e6[_0xef6425(0x121)],'diff':_0x24d9e6[_0xef6425(0x195)]});}return{'journeyFiles':_0xf01a0d,'foldersToCreate':_0x4cd147};}export function calculateActivationActions(_0x45dad5,_0x5651a9,_0x2bfad2,_0x548215){const _0x352dd9=a97_0xce8e14,_0x4d34a9=[],_0x23a998=new Map();for(const _0xb1d28d of _0x5651a9){_0x23a998['set'](_0xb1d28d['name'],_0xb1d28d);}const _0x52c97f=new Map();for(const _0x429e1b of _0x45dad5){_0x52c97f[_0x352dd9(0x163)](_0x429e1b['name'],_0x429e1b);}for(const _0xd023a1 of _0x45dad5){const _0x119689=_0x23a998[_0x352dd9(0x19e)](_0xd023a1[_0x352dd9(0x14f)]);if(!_0x119689)_0x4d34a9[_0x352dd9(0x119)]({'type':'create','name':_0xd023a1[_0x352dd9(0x14f)],'yamlActivation':_0xd023a1});else{const _0x5c1fc4=activationResponseToDef(_0x119689,_0x2bfad2,_0x548215),_0x3bd2ac=a97_0x58dbed[_0x352dd9(0x10e)](_0x5c1fc4),_0x594112=a97_0x58dbed['stringify'](_0xd023a1);_0x3bd2ac!==_0x594112&&_0x4d34a9[_0x352dd9(0x119)]({'type':_0x352dd9(0x1ad),'name':_0xd023a1['name'],'yamlActivation':_0xd023a1,'existingActivation':_0x119689});}}for(const _0x4ce08f of _0x5651a9){!_0x52c97f[_0x352dd9(0x16b)](_0x4ce08f['name'])&&_0x4d34a9[_0x352dd9(0x119)]({'type':_0x352dd9(0x108),'name':_0x4ce08f['name'],'existingActivation':_0x4ce08f});}return _0x4d34a9;}export function calculateSegmentDiff(_0x43ffa1,_0x3e376c,_0x53fc1f,_0x49b5f4,_0xeda65){const _0xf9b245=segmentToYamlString(_0x43ffa1);if(_0x3e376c){const _0x2a408e=segmentWithActivationsToYaml(_0x3e376c,_0x53fc1f,undefined,_0x49b5f4,_0xeda65),_0x578ff8=segmentToYamlString(_0x2a408e),_0x56a6b3=generateDiff(_0x578ff8,_0xf9b245),_0xb432bf=hasChanges(_0x56a6b3);return{'isNew':![],'hasChanges':_0xb432bf,'diff':_0xb432bf?formatDiffWithColors(_0x56a6b3):undefined};}const _0x55a177=generateDiff('',_0xf9b245);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x55a177)};}export function calculateJourneyDiff(_0x1b1ceb,_0x277bf3){const _0x59ddfb=normalizeJourneyDef(_0x1b1ceb,_0x1b1ceb),_0x569904=a97_0x21b7c9(_0x59ddfb);if(_0x277bf3){const _0x23a5e3=normalizeJourneyDef(_0x277bf3,_0x1b1ceb),_0x4dd748=a97_0x21b7c9(_0x23a5e3),_0x2e5f5d=generateDiff(_0x4dd748,_0x569904),_0x643cc1=hasChanges(_0x2e5f5d);return{'isNew':![],'hasChanges':_0x643cc1,'diff':_0x643cc1?formatDiffWithColors(_0x2e5f5d):undefined};}const _0x5d370d=generateDiff('',_0x569904);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5d370d)};}export function findSegmentsToDelete(_0x3fd3e7,_0xa69458,_0x946b34,_0x2b77c4,_0x34b131){const _0xf20b5c=a97_0xce8e14,_0x58d871=new Set();for(const {yamlConfig:_0x2c3ca1,folderPath:_0x351b97}of _0xa69458){_0x58d871[_0xf20b5c(0x19a)](_0x351b97+':'+_0x2c3ca1[_0xf20b5c(0x14f)]);}return _0x3fd3e7[_0xf20b5c(0x116)](_0x46fed1=>{const _0x5126be=_0xf20b5c,_0x2ff9cd=_0x46fed1[_0x5126be(0x1d0)]?_0x946b34[_0x5126be(0x19e)](_0x46fed1['segmentFolderId'][_0x5126be(0x1dd)]())||'':'',_0x1bff3f=_0x2ff9cd+':'+_0x46fed1[_0x5126be(0x14f)];if(_0x58d871['has'](_0x1bff3f))return![];if(_0x34b131)return _0x2ff9cd===_0x2b77c4||_0x2ff9cd[_0x5126be(0x13a)](_0x2b77c4+'/');return!![];});}export function findJourneysToDelete(_0x4fffbc,_0x234776,_0x2b4e8c,_0x321558,_0x354385){const _0x37938b=a97_0xce8e14,_0x39cdca=new Set();for(const {yamlConfig:_0x3983d7,folderPath:_0x168b5a}of _0x234776){_0x39cdca['add'](_0x168b5a+':'+_0x3983d7[_0x37938b(0x14f)]);}return _0x4fffbc['filter'](_0x2c54ba=>{const _0x2e50e1=_0x37938b,_0x2b0f01=_0x2c54ba[_0x2e50e1(0x1b2)]?_0x2b4e8c[_0x2e50e1(0x19e)](_0x2c54ba[_0x2e50e1(0x1b2)])||'':'',_0x5037aa=_0x2b0f01+':'+_0x2c54ba[_0x2e50e1(0x13d)];if(_0x39cdca[_0x2e50e1(0x16b)](_0x5037aa))return![];if(_0x354385)return _0x2b0f01===_0x321558||_0x2b0f01[_0x2e50e1(0x13a)](_0x321558+'/');return!![];});}export function buildSegmentLookupMap(_0x4e4aa3,_0x613810){const _0x3bc54b=a97_0xce8e14,_0x55ecb2=new Map();for(const _0x5b4a88 of _0x4e4aa3){const _0x13c79a=_0x5b4a88[_0x3bc54b(0x1d0)]?_0x613810[_0x3bc54b(0x19e)](_0x5b4a88[_0x3bc54b(0x1d0)][_0x3bc54b(0x1dd)]())||'':'',_0x1bad36=_0x13c79a+':'+_0x5b4a88[_0x3bc54b(0x14f)];_0x55ecb2[_0x3bc54b(0x163)](_0x1bad36,_0x5b4a88);}return _0x55ecb2;}export function buildSegmentNameToIdMap(_0x2c79d2){const _0x51394b=a97_0xce8e14,_0x29ce31=new Map();for(const _0xe0bd7e of _0x2c79d2){_0x29ce31[_0x51394b(0x163)](_0xe0bd7e[_0x51394b(0x14f)],_0xe0bd7e['id']);}return _0x29ce31;}export function buildJourneyBundleLookupMap(_0x5aca3d,_0x34dc2c){const _0x40eb5c=a97_0xce8e14,_0x3a165f=new Map();for(const _0x433570 of _0x5aca3d){const _0x58b553=_0x433570['folderId']?_0x34dc2c[_0x40eb5c(0x19e)](_0x433570['folderId'])||'':'',_0x3205c1=_0x58b553+':'+_0x433570[_0x40eb5c(0x13d)];!_0x3a165f[_0x40eb5c(0x16b)](_0x3205c1)&&_0x3a165f['set'](_0x3205c1,[]),_0x3a165f[_0x40eb5c(0x19e)](_0x3205c1)[_0x40eb5c(0x119)](_0x433570);}for(const _0x1416ef of _0x3a165f['values']()){_0x1416ef[_0x40eb5c(0x1c8)]((_0x5ddc6a,_0x358b95)=>(_0x5ddc6a[_0x40eb5c(0x167)]||0x0)-(_0x358b95['versionNumber']||0x0));}return _0x3a165f;}export function collectFoldersToCreate(_0xf97455,_0x4eb6e0){const _0x316a40=a97_0xce8e14,_0x53515d=new Set();for(const _0x42c879 of _0xf97455){if(!_0x42c879)continue;if(_0x4eb6e0[_0x316a40(0x16b)](_0x42c879))continue;const _0x2ff270=_0x42c879['split']('/');let _0x299c59='';for(const _0x16d11a of _0x2ff270){_0x299c59=_0x299c59?_0x299c59+'/'+_0x16d11a:_0x16d11a,!_0x4eb6e0[_0x316a40(0x16b)](_0x299c59)&&_0x53515d[_0x316a40(0x19a)](_0x299c59);}}return _0x53515d;}export function parseAndClassifyYamlFiles(_0x20c08a,_0x26ab34,_0x2f37ad){const _0x54aa62=a97_0xce8e14,_0x27def6=[],_0x19e81a=[];for(const _0x255199 of _0x20c08a){const _0x29ef63=a97_0x5ba372[_0x54aa62(0x196)](_0x26ab34,a97_0x5ba372['dirname'](_0x255199)),_0x3cf550=_0x29ef63==='.'?'':_0x29ef63,_0x537863=readFileSync(_0x255199,'utf-8'),_0x4ccb76=a97_0x58dbed[_0x54aa62(0x10d)](_0x537863);if(isJourneyDef(_0x4ccb76)){const _0x5ad77=a97_0x364a9b(_0x537863);_0x19e81a[_0x54aa62(0x119)]({'yamlConfig':_0x5ad77,'folderPath':_0x3cf550,'sourcePath':_0x255199});}else{if(!_0x2f37ad?.['skipSegments']){const _0x174207=parseSegmentYamlFile(_0x537863),_0x1dae61=normalizeChildSegmentYaml(_0x174207);_0x27def6['push']({'yamlConfig':_0x1dae61,'folderPath':_0x3cf550,'sourcePath':_0x255199});}}}return{'segments':_0x27def6,'journeys':_0x19e81a};}export function validateParsedFiles(_0x104e66,_0x50428c){const _0x5ecd9e=a97_0xce8e14,_0x5405f4=[];for(const {yamlConfig:_0x1425c8,sourcePath:_0x5e87bc}of _0x104e66['segments']){const _0x413d35=readFileSync(_0x5e87bc,_0x5ecd9e(0x11e)),_0x5db2d4=a97_0x58dbed[_0x5ecd9e(0x18f)](_0x413d35),_0x3ec434=validateSegmentDef(_0x1425c8,{'source':_0x413d35,'document':_0x5db2d4});if(!_0x3ec434[_0x5ecd9e(0x169)]){const _0x404410=a97_0x5ba372[_0x5ecd9e(0x196)](_0x50428c,_0x5e87bc);_0x5405f4[_0x5ecd9e(0x119)]({'filePath':_0x404410,'source':_0x413d35,'result':_0x3ec434,'isJourney':![]});}}for(const {yamlConfig:_0x4262a2,sourcePath:_0x16778c}of _0x104e66[_0x5ecd9e(0x189)]){const _0x500179=readFileSync(_0x16778c,_0x5ecd9e(0x11e)),_0x2565f5=a97_0x58dbed[_0x5ecd9e(0x18f)](_0x500179),_0x3c368f=validateJourneyDef(_0x4262a2,{'source':_0x500179,'document':_0x2565f5});if(!_0x3c368f[_0x5ecd9e(0x169)]){const _0x533f0e=a97_0x5ba372['relative'](_0x50428c,_0x16778c);_0x5405f4[_0x5ecd9e(0x119)]({'filePath':_0x533f0e,'source':_0x500179,'result':_0x3c368f,'isJourney':!![]});}}return _0x5405f4;}export function formatValidationErrors(_0x3a29e6){const _0x582443=a97_0xce8e14,_0x3d602c=[];for(const {filePath:_0x839e05,source:_0x3621e1,result:_0x5555fb,isJourney:_0x9e9dbc}of _0x3a29e6){const _0x3cab25=_0x9e9dbc?_0x582443(0x127):_0x582443(0x16d);_0x3d602c[_0x582443(0x119)]('\x0a'+_0x839e05+'\x20('+_0x3cab25+_0x582443(0x168)+_0x5555fb[_0x582443(0x1a4)][_0x582443(0x15f)]+_0x582443(0x1be)),_0x3d602c[_0x582443(0x119)](formatValidationResult(_0x5555fb,_0x3621e1,_0x839e05));}return _0x3d602c[_0x582443(0x1e9)]('\x0a');}export function buildLocalExpandedRuleMappings(_0xe1811d){const _0xa26b5c=a97_0xce8e14,_0x2260a0=new Set(),_0x36b1a9=new Map(),_0xcab6a2=collectSegmentUsageCounts(_0xe1811d);if(_0xe1811d[_0xa26b5c(0x1b5)])for(const [_0xa1030b,_0x58373a]of Object['entries'](_0xe1811d[_0xa26b5c(0x1b5)])){_0x2260a0['add'](_0xa1030b);if(_0x58373a[_0xa26b5c(0x1a9)]){const _0xc19289=yamlRuleToApi(_0x58373a['rule']),_0x3edc00=apiRuleToYaml(_0xc19289);_0x36b1a9[_0xa26b5c(0x163)](_0xa1030b,_0x3edc00);}}const _0x1456dd=new Map();let _0x5e4729=0x0;for(const [_0x264d38,_0x558817]of _0x36b1a9){const _0x2b80b3=serializeExpandedRule(_0x558817,_0x36b1a9),_0x5c6aa8=_0x1456dd[_0xa26b5c(0x19e)](_0x2b80b3)||[];_0x5c6aa8[_0xa26b5c(0x119)]({'name':_0x264d38,'index':_0x5e4729}),_0x1456dd[_0xa26b5c(0x163)](_0x2b80b3,_0x5c6aa8),_0x5e4729++;}const _0x4f4505=new Map();for(const [_0x19657d,_0x2049fa]of _0x1456dd){const _0xe15453=_0x2049fa[_0xa26b5c(0x157)]()[_0xa26b5c(0x1c8)]((_0x31560b,_0x5138ff)=>{const _0x1d5625=_0xa26b5c,_0x2945f9=_0xcab6a2[_0x1d5625(0x19e)](_0x31560b[_0x1d5625(0x14f)])||0x0,_0xc29f6a=_0xcab6a2[_0x1d5625(0x19e)](_0x5138ff['name'])||0x0;if(_0x2945f9!==_0xc29f6a)return _0xc29f6a-_0x2945f9;return _0x31560b['index']-_0x5138ff[_0x1d5625(0x19f)];})[_0xa26b5c(0x1d9)](_0x2eba96=>_0x2eba96[_0xa26b5c(0x14f)]),_0x1c8bbc=[];for(const _0x456b2d of _0xe15453){const _0x10f600=_0xcab6a2[_0xa26b5c(0x19e)](_0x456b2d)||0x0,_0x3ec912=Math['max'](_0x10f600,0x1);for(let _0x328702=0x0;_0x328702<_0x3ec912;_0x328702++){_0x1c8bbc[_0xa26b5c(0x119)](_0x456b2d);}}_0x4f4505[_0xa26b5c(0x163)](_0x19657d,_0x1c8bbc);}return{'existingLocalSegmentNames':_0x2260a0,'localSegmentRules':_0x36b1a9,'localExpandedRuleToNames':_0x4f4505};}async function buildServerSegmentRuleMap(_0x39ac62,_0x4c9b69,_0x503db3,_0x402f32){const _0x3765ad=new Map(),_0x399a1e=new Set(),_0x15afa9=async _0xd0a5cc=>{const _0x3afd9c=a97_0x3eba;if(_0x399a1e['has'](_0xd0a5cc))return;_0x399a1e['add'](_0xd0a5cc);let _0x38c5b2=_0x503db3[_0x3afd9c(0x185)](_0x5061b0=>_0x5061b0['id']===_0xd0a5cc);if(!_0x38c5b2)try{_0x38c5b2=await _0x39ac62['segment']['getSegment'](_0x4c9b69,_0xd0a5cc);}catch{return;}if(!_0x38c5b2?.[_0x3afd9c(0x1a9)])return;const _0x2dc4e7=apiRuleToYaml(_0x38c5b2[_0x3afd9c(0x1a9)]);_0x3765ad[_0x3afd9c(0x163)](_0xd0a5cc,_0x2dc4e7);const _0x1e3381=collectSegmentRefsFromRule(_0x2dc4e7);for(const _0x1f45a7 of _0x1e3381){await _0x15afa9(_0x1f45a7);}};for(const _0x409f43 of _0x402f32){await _0x15afa9(_0x409f43);}return _0x3765ad;}export function createSegmentIdResolver(_0x3300cf,_0x4de56f){return async _0x31bb00=>{const _0x45af2b=a97_0x3eba,_0x14d83d=_0x3300cf[_0x45af2b(0x19e)](_0x31bb00);if(!_0x14d83d)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x45af2b(0x133)+_0x31bb00+_0x45af2b(0x1d8)+_0x4de56f+'\x27)');return _0x14d83d;};}export function extractRootFolderId(_0x3657f1){const _0x45b0ef=a97_0xce8e14;return _0x3657f1['relationships']?.[_0x45b0ef(0x158)]?.[_0x45b0ef(0x178)]?.['id']||_0x3657f1['relationships']?.[_0x45b0ef(0x19b)]?.[_0x45b0ef(0x178)]?.['id'];}export function buildConnectionMaps(_0x4893b0){const _0x393a84=a97_0xce8e14,_0xf33aa9=new Map(),_0x171613=new Map(),_0x229dc0=new Map();for(const _0x43f81b of _0x4893b0){_0xf33aa9[_0x393a84(0x163)](_0x43f81b['name'],parseInt(_0x43f81b['id'],0xa)),_0x171613['set'](_0x43f81b['id'],_0x43f81b['name']),_0x229dc0['set'](_0x43f81b[_0x393a84(0x14f)],_0x43f81b[_0x393a84(0x11a)]);}return{'nameToId':_0xf33aa9,'idToName':_0x171613,'nameToType':_0x229dc0};}export function calculatePushStats(_0x47657f,_0x4cc393,_0x24655b,_0x48494f,_0x47ee3a,_0x3098c9,_0x51f47d){const _0x2b96c2=a97_0xce8e14,_0x322035=_0x47657f[_0x2b96c2(0x116)](_0x3f3de3=>_0x3f3de3['isNew']),_0x33b144=_0x47657f[_0x2b96c2(0x116)](_0x1fce3a=>!_0x1fce3a[_0x2b96c2(0x191)]&&_0x1fce3a['hasChanges']),_0x14e4f6=_0x47657f['filter'](_0x517c1e=>!_0x517c1e[_0x2b96c2(0x191)]&&!_0x517c1e[_0x2b96c2(0x121)]),_0x55457d=_0x3098c9?_0x48494f:[],_0x48ac81=_0x4cc393[_0x2b96c2(0x116)](_0x5609a7=>_0x5609a7['isNew']),_0xdba12e=_0x4cc393['filter'](_0x47739e=>!_0x47739e[_0x2b96c2(0x191)]&&_0x47739e['hasChanges']),_0x572f1b=_0x4cc393[_0x2b96c2(0x116)](_0x483267=>!_0x483267[_0x2b96c2(0x191)]&&!_0x483267[_0x2b96c2(0x121)]),_0x558310=_0x3098c9?_0x47ee3a:[],_0x4d985c=_0x47657f[_0x2b96c2(0x126)](_0x161790=>_0x161790[_0x2b96c2(0x156)]),_0x44ba0f=_0x4d985c['filter'](_0x5bdec8=>_0x5bdec8[_0x2b96c2(0x11a)]===_0x2b96c2(0x1e6)),_0xbfc2f9=_0x4d985c[_0x2b96c2(0x116)](_0xa99065=>_0xa99065['type']===_0x2b96c2(0x1ad)),_0x32b4c7=_0x4d985c[_0x2b96c2(0x116)](_0x721b7b=>_0x721b7b[_0x2b96c2(0x11a)]===_0x2b96c2(0x108)),_0x1437d2=Array[_0x2b96c2(0x1dc)](_0x24655b)[_0x2b96c2(0x1c8)](),_0x5e25c1=_0x51f47d?![]:_0x322035[_0x2b96c2(0x15f)]>0x0||_0x33b144[_0x2b96c2(0x15f)]>0x0||_0x55457d[_0x2b96c2(0x15f)]>0x0,_0x166824=_0x48ac81['length']>0x0||_0xdba12e[_0x2b96c2(0x15f)]>0x0||_0x558310[_0x2b96c2(0x15f)]>0x0,_0x312d35=_0x51f47d?![]:_0x4d985c['length']>0x0,_0x385329=_0x1437d2[_0x2b96c2(0x15f)]>0x0;return{'segments':{'new':_0x322035,'changed':_0x33b144,'unchanged':_0x14e4f6,'toDelete':_0x55457d},'journeys':{'new':_0x48ac81,'changed':_0xdba12e,'unchanged':_0x572f1b,'toDelete':_0x558310},'activations':{'all':_0x4d985c,'toCreate':_0x44ba0f,'toUpdate':_0xbfc2f9,'toDelete':_0x32b4c7},'folders':{'toCreate':_0x1437d2},'counts':{'segments':{'new':_0x322035[_0x2b96c2(0x15f)],'changed':_0x33b144[_0x2b96c2(0x15f)],'unchanged':_0x14e4f6['length'],'toDelete':_0x55457d[_0x2b96c2(0x15f)]},'journeys':{'new':_0x48ac81[_0x2b96c2(0x15f)],'changed':_0xdba12e[_0x2b96c2(0x15f)],'unchanged':_0x572f1b[_0x2b96c2(0x15f)],'toDelete':_0x558310[_0x2b96c2(0x15f)]},'activations':{'create':_0x44ba0f[_0x2b96c2(0x15f)],'update':_0xbfc2f9[_0x2b96c2(0x15f)],'delete':_0x32b4c7[_0x2b96c2(0x15f)]},'folders':_0x1437d2['length']},'hasChanges':_0x5e25c1||_0x166824||_0x312d35||_0x385329};}export async function buildPushExecutionContext(_0x4c6395,_0x541086,_0x3ca62c,_0x165a89,_0x59be25,_0x532aaa){const _0x345930=a97_0xce8e14,_0x2b8b0c=extractRootFolderId(_0x3ca62c),{pathToId:_0x434fb4,idToPath:_0x116516}=buildFolderMaps(_0x59be25),_0x2b50c9=buildSegmentNameToIdMap(_0x165a89),_0x3b6e9b=new Map(),{batchAsync:_0x1277f3}=await import('../../utils/async.js'),[_0x27471e,_0x2fa334]=await Promise['all']([_0x4c6395[_0x345930(0x117)]['buildUserMaps'](),_0x4c6395[_0x345930(0x122)][_0x345930(0x187)](),((async()=>{const _0x3e7dcc=_0x345930;!_0x532aaa&&_0x165a89[_0x3e7dcc(0x15f)]>0x0&&await _0x1277f3(_0x165a89,async _0x43ebfc=>{const _0xf96e53=_0x3e7dcc,_0xaf0567=await _0x4c6395[_0xf96e53(0x16d)][_0xf96e53(0x11b)](_0x541086,_0x43ebfc['id']);_0x3b6e9b[_0xf96e53(0x163)](_0x43ebfc['id'],_0xaf0567);});})())]),{emailToId:_0x2a4047,idToEmail:_0x2f1285}=_0x27471e,_0x5bdfbc=buildConnectionMaps(_0x2fa334);return{'rootFolderId':_0x2b8b0c,'folderPathToId':_0x434fb4,'folderIdToPath':_0x116516,'segmentNameToId':_0x2b50c9,'activationsBySegmentId':_0x3b6e9b,'emailToIdMap':_0x2a4047,'idToEmailMap':_0x2f1285,'connectionNameToIdMap':_0x5bdfbc[_0x345930(0x10a)],'connectionIdToNameMap':_0x5bdfbc[_0x345930(0x180)],'connectionNameToTypeMap':_0x5bdfbc['nameToType']};}export function createPushYamlContextForBundle(_0x9e652c,_0x20ad5e,_0x5a5640,_0x36ece3,_0x52330a,_0xc6d698,_0x1744a6,_0x4bf9e3){const {existingLocalSegmentNames:_0xa30a59,localExpandedRuleToNames:_0x209055}=_0x36ece3,_0x54b319=new Set(),_0x10ae65=new Map(),_0x4e91b9=new Set(),_0x2ef96a=new Map(),_0x4571e0=new Map(),_0x24c1ce=createJumpTargetCache(),_0x4a513a=new Map(),_0x447952=new Map(),_0x1dd4a0=new Set();let _0xfcfc75;const _0x4277c1=_0x5d5ab0=>{const _0x5851be={'resolveSegment':async _0x4abb60=>{const _0x2dd313=a97_0x3eba,_0x2494b7=_0x4571e0[_0x2dd313(0x19e)](_0x4abb60);if(_0x2494b7!==undefined)return{'name':_0x2494b7,'isJourneyLocal':!![]};try{let _0x251db6=_0x5a5640[_0x2dd313(0x185)](_0xab3fa9=>_0xab3fa9['id']===_0x4abb60);!_0x251db6&&(_0x251db6=await _0x9e652c[_0x2dd313(0x16d)][_0x2dd313(0x13c)](_0x20ad5e,_0x4abb60));const _0x411e55=generateJourneyLocalName(_0x251db6[_0x2dd313(0x14f)]),_0x2d2e26=_0x251db6[_0x2dd313(0x1d6)]===SEGMENT_KIND_JOURNEY&&_0x411e55!==undefined;let _0x23f7ec=_0x251db6[_0x2dd313(0x14f)],_0x4e7f2a;if(_0x2d2e26&&_0x251db6[_0x2dd313(0x1a9)]){const _0x50e4a4=apiRuleToYaml(_0x251db6[_0x2dd313(0x1a9)]);_0x447952['set'](_0x4abb60,_0x50e4a4);const _0x3046ec=async _0xe4e17c=>{const _0x43df9a=_0x2dd313,_0x416c04=collectSegmentRefsFromRule(_0xe4e17c);for(const _0x412832 of _0x416c04){if(!_0x447952['has'](_0x412832))try{const _0x5ab26c=await _0x9e652c[_0x43df9a(0x16d)][_0x43df9a(0x13c)](_0x20ad5e,_0x412832);if(_0x5ab26c?.[_0x43df9a(0x1a9)]){const _0x44a165=apiRuleToYaml(_0x5ab26c[_0x43df9a(0x1a9)]);_0x447952[_0x43df9a(0x163)](_0x412832,_0x44a165),await _0x3046ec(_0x44a165);}}catch{}}};await _0x3046ec(_0x50e4a4);const _0x46a5d0=serializeExpandedRule(_0x50e4a4,_0x447952),_0x2a9744=_0x209055[_0x2dd313(0x19e)](_0x46a5d0);if(_0x2a9744&&_0x2a9744[_0x2dd313(0x15f)]>0x0){const _0x16c8ac=_0x10ae65[_0x2dd313(0x19e)](_0x46a5d0)||0x0,_0x358657=_0x2a9744[_0x16c8ac]||_0x2a9744[_0x2a9744['length']-0x1];_0x10ae65[_0x2dd313(0x163)](_0x46a5d0,_0x16c8ac+0x1),_0x23f7ec=_0x358657,_0x54b319[_0x2dd313(0x19a)](_0x23f7ec),_0x4571e0[_0x2dd313(0x163)](_0x4abb60,_0x23f7ec);const _0x3f97e9=await resolveRuleSegmentRefs(_0x50e4a4,async _0x234842=>{const _0x22aeb3=_0x2dd313,_0x33c7da=_0x4571e0[_0x22aeb3(0x19e)](_0x234842);if(_0x33c7da)return _0x33c7da;const _0x2c4071=await _0xfcfc75[_0x22aeb3(0x11d)](_0x234842);return _0x2c4071[_0x22aeb3(0x14f)];});_0x4e7f2a={'description':_0x251db6['description'],'rule':_0x3f97e9};}else{const _0xe12cd6=_0x4a513a['get'](_0x46a5d0);if(_0xe12cd6)_0x23f7ec=_0xe12cd6,_0x4571e0[_0x2dd313(0x163)](_0x4abb60,_0x23f7ec);else{if(_0x411e55){let _0x83d2f7=_0x411e55,_0x1afc74=0x2;while(_0x54b319[_0x2dd313(0x16b)](_0x83d2f7)||_0xa30a59[_0x2dd313(0x16b)](_0x83d2f7)){_0x83d2f7=_0x411e55+'_'+_0x1afc74,_0x1afc74++;}_0x54b319[_0x2dd313(0x19a)](_0x83d2f7),_0x23f7ec=_0x83d2f7;}_0x4571e0[_0x2dd313(0x163)](_0x4abb60,_0x23f7ec),_0x4a513a[_0x2dd313(0x163)](_0x46a5d0,_0x23f7ec);const _0x14649e=await resolveRuleSegmentRefs(_0x50e4a4,async _0x2be4c7=>{const _0x1b5818=_0x2dd313,_0x224ff5=_0x4571e0[_0x1b5818(0x19e)](_0x2be4c7);if(_0x224ff5)return _0x224ff5;const _0x318277=await _0xfcfc75[_0x1b5818(0x11d)](_0x2be4c7);return _0x318277[_0x1b5818(0x14f)];});_0x4e7f2a={'description':_0x251db6[_0x2dd313(0x161)],'rule':_0x14649e};}}}return{'name':_0x23f7ec,'isJourneyLocal':_0x2d2e26,'definition':_0x4e7f2a};}catch{return{'name':_0x4abb60,'isJourneyLocal':![]};}},'resolveActivation':async _0x42c2c1=>{const _0x47a35a=a97_0x3eba,_0x4204c6=_0x2ef96a['get'](_0x42c2c1);if(_0x4204c6!==undefined)return{'name':_0x4204c6,'isJourneyLocal':!![]};try{let _0x300e65=_0x1744a6?.['get'](_0x42c2c1);!_0x300e65&&(_0x300e65=await _0x9e652c['journey']['getActivation'](_0x5d5ab0,_0x42c2c1));const _0x41d324=_0x300e65[_0x47a35a(0x15e)][_0x47a35a(0x182)][_0x47a35a(0x14f)]||_0x42c2c1,_0x133054=sanitizeYamlKey(_0x41d324)||_0x47a35a(0x17b)+_0x42c2c1;let _0x2a0771=_0x133054,_0x4f556b=0x2;while(_0x4e91b9[_0x47a35a(0x16b)](_0x2a0771)){_0x2a0771=_0x133054+'_'+_0x4f556b,_0x4f556b++;}_0x4e91b9['add'](_0x2a0771),_0x2ef96a['set'](_0x42c2c1,_0x2a0771);const _0x102111=journeyActivationStepToYaml(_0x300e65,_0x52330a,_0xc6d698);return{'name':_0x2a0771,'isJourneyLocal':!![],'definition':_0x102111};}catch{return{'name':_0x42c2c1,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x11bc14,_0x4bbf34)=>resolveJumpTarget(_0x11bc14,_0x4bbf34,_0x24c1ce,async _0x1fcce8=>{const _0x1b14f6=a97_0x3eba,_0x3ef680=_0x4bf9e3?.[_0x1b14f6(0x19e)](_0x1fcce8);if(_0x3ef680)return _0x3ef680;return _0x9e652c[_0x1b14f6(0x127)][_0x1b14f6(0x10c)](_0x1fcce8);})};return _0xfcfc75=_0x5851be,_0x5851be;},_0x505bed=async _0x363ae5=>{const _0x5ce358=a97_0x3eba,{collectSegmentIdsFromJourneyApi:_0x1f7c8f}=await import(_0x5ce358(0x137)),{batchAsync:_0x82858c}=await import(_0x5ce358(0x1e3)),_0x5c6335=new Set();for(const _0x13f79c of _0x363ae5){let _0x5d93d8=_0x4bf9e3?.[_0x5ce358(0x19e)](_0x13f79c);!_0x5d93d8&&(_0x5d93d8=await _0x9e652c['journey']['getJourney'](_0x13f79c));const _0xb1673e=_0x1f7c8f(_0x5d93d8);for(const _0x514543 of _0xb1673e){_0x5c6335[_0x5ce358(0x19a)](_0x514543);}}let _0x593950=Array[_0x5ce358(0x1dc)](_0x5c6335);while(_0x593950[_0x5ce358(0x15f)]>0x0){const _0xd903de=_0x593950[_0x5ce358(0x116)](_0xbafb86=>!_0x1dd4a0[_0x5ce358(0x16b)](_0xbafb86));if(_0xd903de[_0x5ce358(0x15f)]===0x0)break;const _0x2b1d85=await _0x82858c(_0xd903de,async _0x38060b=>{const _0x12b544=_0x5ce358;_0x1dd4a0[_0x12b544(0x19a)](_0x38060b);let _0xb63f71=_0x5a5640[_0x12b544(0x185)](_0x505a8d=>_0x505a8d['id']===_0x38060b);if(!_0xb63f71)try{_0xb63f71=await _0x9e652c[_0x12b544(0x16d)][_0x12b544(0x13c)](_0x20ad5e,_0x38060b);}catch{return null;}return{'segmentId':_0x38060b,'segment':_0xb63f71};},0xa),_0x57f8ae=new Set();for(const _0x1ee5a9 of _0x2b1d85){if(!_0x1ee5a9?.[_0x5ce358(0x16d)]?.[_0x5ce358(0x1a9)])continue;const _0x2ac518=apiRuleToYaml(_0x1ee5a9[_0x5ce358(0x16d)][_0x5ce358(0x1a9)]);_0x447952[_0x5ce358(0x163)](_0x1ee5a9[_0x5ce358(0x118)],_0x2ac518);const _0xfa5f43=collectSegmentRefsFromRule(_0x2ac518);for(const _0x5f4a51 of _0xfa5f43){!_0x1dd4a0['has'](_0x5f4a51)&&_0x57f8ae[_0x5ce358(0x19a)](_0x5f4a51);}}_0x593950=Array[_0x5ce358(0x1dc)](_0x57f8ae);}};return{'createYamlContext':_0x4277c1,'prefetchJourneySegments':_0x505bed};}export async function executePushSegments(_0x186af9,_0x45d295,_0x5506a6,_0x2b672e,_0x241064){const _0x410733=a97_0xce8e14,{segmentDefToCreateRequest:_0x27304e,segmentDefToUpdateRequest:_0xf36eb1}=await import(_0x410733(0x135)),_0x40c8b3=_0x5506a6[_0x410733(0x1a8)],_0x33cc6a=0x5,_0x2da98b=async _0x17df88=>{const _0x50d1d9=_0x410733,_0x2a6f8e=_0x17df88[_0x50d1d9(0x17e)]?_0x40c8b3[_0x50d1d9(0x19e)](_0x17df88[_0x50d1d9(0x17e)]):undefined;let _0x2b1903;const _0x3ee046={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x17df88[_0x50d1d9(0x191)]){_0x241064[_0x50d1d9(0x1c2)]?.({'type':_0x50d1d9(0x170),'name':_0x17df88['yamlConfig'][_0x50d1d9(0x14f)]});const _0x543c9b=_0x27304e(_0x17df88[_0x50d1d9(0x138)],_0x2a6f8e),_0x2ec33c=await _0x241064[_0x50d1d9(0x1b8)](_0x50d1d9(0x151)+_0x17df88[_0x50d1d9(0x138)][_0x50d1d9(0x14f)]+_0x50d1d9(0x148),()=>_0x186af9[_0x50d1d9(0x16d)][_0x50d1d9(0x18d)](_0x2b672e[_0x50d1d9(0x1c0)],_0x543c9b));_0x2b1903=_0x2ec33c[_0x50d1d9(0x178)]['id'],_0x3ee046['createdSegmentId']={'name':_0x17df88[_0x50d1d9(0x138)][_0x50d1d9(0x14f)],'id':_0x2b1903},_0x241064[_0x50d1d9(0x1c2)]?.({'type':_0x50d1d9(0x194),'name':_0x17df88[_0x50d1d9(0x138)][_0x50d1d9(0x14f)],'segmentId':_0x2b1903}),_0x241064['logSuccess']?.(_0x50d1d9(0x1a6)+_0x17df88[_0x50d1d9(0x138)][_0x50d1d9(0x14f)]+'\x27'),_0x3ee046[_0x50d1d9(0x1ac)]=0x1;}else{if(_0x17df88[_0x50d1d9(0x121)]){_0x241064[_0x50d1d9(0x1c2)]?.({'type':_0x50d1d9(0x1d7),'name':_0x17df88[_0x50d1d9(0x138)][_0x50d1d9(0x14f)]});const _0x5a9443=_0xf36eb1(_0x17df88[_0x50d1d9(0x138)]);_0x2a6f8e!==_0x17df88[_0x50d1d9(0x105)]?.[_0x50d1d9(0x1d0)]&&(_0x5a9443[_0x50d1d9(0x1d0)]=_0x2a6f8e?parseInt(_0x2a6f8e,0xa):undefined),await _0x241064[_0x50d1d9(0x1b8)]('Updating\x20segment\x20\x27'+_0x17df88[_0x50d1d9(0x138)]['name']+_0x50d1d9(0x148),()=>_0x186af9[_0x50d1d9(0x16d)][_0x50d1d9(0x1bd)](_0x2b672e[_0x50d1d9(0x1c0)],_0x17df88[_0x50d1d9(0x105)]['id'],_0x5a9443)),_0x2b1903=_0x17df88[_0x50d1d9(0x105)]['id'],_0x241064[_0x50d1d9(0x1c2)]?.({'type':_0x50d1d9(0x1b6),'name':_0x17df88[_0x50d1d9(0x138)]['name']}),_0x241064['logSuccess']?.(_0x50d1d9(0x110)+_0x17df88[_0x50d1d9(0x138)][_0x50d1d9(0x14f)]+'\x27'),_0x3ee046[_0x50d1d9(0x1ae)]=0x1;}else _0x2b1903=_0x17df88[_0x50d1d9(0x105)]['id'];}}catch(_0x3cb5db){const _0x77b3ad=isHttp400Error(_0x3cb5db),_0x684367=_0x77b3ad?ErrorCode[_0x50d1d9(0x106)]:ErrorCode[_0x50d1d9(0x136)],_0x11a6d4=getErrorMessage(_0x3cb5db);throw new SDKError(_0x684367,'Failed\x20to\x20'+(_0x17df88[_0x50d1d9(0x191)]?_0x50d1d9(0x1e6):_0x50d1d9(0x1ad))+'\x20segment\x20from\x20file:\x20'+_0x17df88[_0x50d1d9(0x1a5)]+_0x50d1d9(0x192)+_0x11a6d4,_0x3cb5db);}try{const _0x3f226=await syncActivationsForSegment(_0x186af9,_0x2b672e[_0x50d1d9(0x1c0)],_0x2b1903,_0x17df88[_0x50d1d9(0x138)][_0x50d1d9(0x14f)],_0x17df88['activationActions'],_0x241064,_0x17df88[_0x50d1d9(0x1a5)]);_0x3ee046[_0x50d1d9(0x18c)]=_0x3f226;}catch(_0x388238){if(_0x388238 instanceof SDKError)throw _0x388238;throw new SDKError(ErrorCode[_0x50d1d9(0x1ce)],_0x50d1d9(0x1e4)+_0x17df88['yamlConfig']['name']+_0x50d1d9(0x115)+_0x17df88[_0x50d1d9(0x1a5)]+_0x50d1d9(0x192)+getErrorMessage(_0x388238),_0x388238);}return _0x3ee046;},_0x1c9cbb=await batchAsync(_0x45d295,_0x2da98b,_0x33cc6a),_0x240c7d={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4ede4a of _0x1c9cbb){_0x240c7d['created']+=_0x4ede4a['created'],_0x240c7d[_0x410733(0x1ae)]+=_0x4ede4a[_0x410733(0x1ae)],_0x4ede4a['createdSegmentId']&&_0x240c7d[_0x410733(0x1de)][_0x410733(0x163)](_0x4ede4a[_0x410733(0x186)][_0x410733(0x14f)],_0x4ede4a[_0x410733(0x186)]['id']),_0x240c7d['activations'][_0x410733(0x1ac)]+=_0x4ede4a['activations'][_0x410733(0x1ac)],_0x240c7d[_0x410733(0x18c)][_0x410733(0x1ae)]+=_0x4ede4a[_0x410733(0x18c)]['updated'],_0x240c7d[_0x410733(0x18c)][_0x410733(0x1bf)]+=_0x4ede4a[_0x410733(0x18c)][_0x410733(0x1bf)];}return _0x240c7d;}async function syncActivationsForSegment(_0x7bae2a,_0x496ca6,_0x44eb4a,_0x4c14ee,_0x3ecef2,_0x3fc5da,_0x28db4a){const _0x13623c=a97_0xce8e14,_0xcfe434={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x428cbf of _0x3ecef2){try{if(_0x428cbf[_0x13623c(0x11a)]===_0x13623c(0x1e6)&&_0x428cbf[_0x13623c(0x165)])_0x3fc5da[_0x13623c(0x1c2)]?.({'type':_0x13623c(0x1af),'segmentName':_0x4c14ee,'activationName':_0x428cbf[_0x13623c(0x14f)]}),await _0x3fc5da[_0x13623c(0x1b8)]('Creating\x20activation\x20\x27'+_0x428cbf['name']+_0x13623c(0x148),()=>_0x7bae2a[_0x13623c(0x16d)][_0x13623c(0x17d)](_0x496ca6,_0x44eb4a,_0x428cbf['validatedRequest'])),_0x3fc5da[_0x13623c(0x1c2)]?.({'type':'activation_created','segmentName':_0x4c14ee,'activationName':_0x428cbf[_0x13623c(0x14f)]}),_0x3fc5da['logSuccess']?.(_0x13623c(0x1a7)+_0x428cbf[_0x13623c(0x14f)]+'\x27'),_0xcfe434[_0x13623c(0x1ac)]++;else{if(_0x428cbf[_0x13623c(0x11a)]===_0x13623c(0x1ad)&&_0x428cbf[_0x13623c(0x165)]&&_0x428cbf[_0x13623c(0x1a0)])_0x3fc5da[_0x13623c(0x1c2)]?.({'type':_0x13623c(0x166),'segmentName':_0x4c14ee,'activationName':_0x428cbf[_0x13623c(0x14f)]}),await _0x3fc5da[_0x13623c(0x1b8)](_0x13623c(0x199)+_0x428cbf[_0x13623c(0x14f)]+'\x27...',()=>_0x7bae2a[_0x13623c(0x16d)][_0x13623c(0x18a)](_0x496ca6,_0x44eb4a,_0x428cbf[_0x13623c(0x1a0)]['id'],_0x428cbf[_0x13623c(0x165)])),_0x3fc5da[_0x13623c(0x1c2)]?.({'type':_0x13623c(0x1e1),'segmentName':_0x4c14ee,'activationName':_0x428cbf['name']}),_0x3fc5da[_0x13623c(0x172)]?.(_0x13623c(0x16a)+_0x428cbf[_0x13623c(0x14f)]+'\x27'),_0xcfe434[_0x13623c(0x1ae)]++;else _0x428cbf[_0x13623c(0x11a)]===_0x13623c(0x108)&&_0x428cbf[_0x13623c(0x1a0)]&&(_0x3fc5da['onProgress']?.({'type':_0x13623c(0x1a2),'segmentName':_0x4c14ee,'activationName':_0x428cbf['name']}),await _0x3fc5da['withProgress'](_0x13623c(0x1c7)+_0x428cbf[_0x13623c(0x14f)]+_0x13623c(0x148),()=>_0x7bae2a[_0x13623c(0x16d)][_0x13623c(0x184)](_0x496ca6,_0x44eb4a,_0x428cbf[_0x13623c(0x1a0)]['id'])),_0x3fc5da[_0x13623c(0x1c2)]?.({'type':_0x13623c(0x15b),'segmentName':_0x4c14ee,'activationName':_0x428cbf['name']}),_0x3fc5da['logDeleted']?.(_0x13623c(0x176)+_0x428cbf['name']+'\x27'),_0xcfe434['deleted']++);}}catch(_0x29504c){const _0x3113d4=isHttp400Error(_0x29504c),_0x22898a=_0x3113d4?ErrorCode[_0x13623c(0x1ab)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x441cef=getErrorMessage(_0x29504c);throw new SDKError(_0x22898a,_0x13623c(0x12a)+_0x428cbf[_0x13623c(0x11a)]+_0x13623c(0x179)+_0x428cbf[_0x13623c(0x14f)]+_0x13623c(0x115)+_0x28db4a+_0x13623c(0x192)+_0x441cef,_0x29504c);}}return _0xcfe434;}export async function executePushFolders(_0x583a5c,_0xc3db1e,_0x296b49,_0x364ae2,_0x39b258){const _0x50ad04=a97_0xce8e14,_0x3c2614=new Map(_0x296b49);for(const _0xae9ab6 of _0xc3db1e){const _0x361a67=_0xae9ab6[_0x50ad04(0x197)]('/'),_0x1417b4=_0x361a67[_0x361a67[_0x50ad04(0x15f)]-0x1],_0x35953e=_0x361a67[_0x50ad04(0x157)](0x0,-0x1)['join']('/'),_0x2b661d=_0x3c2614[_0x50ad04(0x19e)](_0x35953e);_0x39b258[_0x50ad04(0x1c2)]?.({'type':'folder_creating','folder':_0xae9ab6});const _0x4b6f84={'name':_0x1417b4,'parentFolderId':_0x2b661d},_0x19c0b6=await _0x39b258[_0x50ad04(0x1b8)](_0x50ad04(0x1a3)+_0xae9ab6+_0x50ad04(0x148),()=>_0x583a5c[_0x50ad04(0x16d)][_0x50ad04(0x18b)](_0x364ae2[_0x50ad04(0x1c0)],_0x4b6f84));_0x3c2614['set'](_0xae9ab6,_0x19c0b6[_0x50ad04(0x178)]['id']),_0x39b258[_0x50ad04(0x1c2)]?.({'type':'folder_created','folder':_0xae9ab6,'folderId':_0x19c0b6[_0x50ad04(0x178)]['id']}),_0x39b258[_0x50ad04(0x143)]?.(_0x50ad04(0x149)+_0xae9ab6+'\x27');}return _0x3c2614;}export async function executePushSegmentDeletions(_0x4a99ba,_0xc43331,_0x4a198a){const _0x243e3d=a97_0xce8e14;if(_0xc43331['length']===0x0)return 0x0;const {batchAsync:_0x717e0a}=await import(_0x243e3d(0x1e3)),_0x4d6b48=0x5,_0x5d82f6=await _0x717e0a(_0xc43331,async _0x69d307=>{const _0x31f7ea=_0x243e3d;return _0x4a198a['onProgress']?.({'type':'segment_deleting','name':_0x69d307[_0x31f7ea(0x14f)]}),await _0x4a99ba['segment'][_0x31f7ea(0x112)](_0x69d307['id']),_0x4a198a[_0x31f7ea(0x1c2)]?.({'type':_0x31f7ea(0x128),'name':_0x69d307[_0x31f7ea(0x14f)]}),_0x4a198a[_0x31f7ea(0x1e0)]?.(_0x31f7ea(0x159)+_0x69d307[_0x31f7ea(0x14f)]+'\x27'),0x1;},_0x4d6b48);return _0x5d82f6[_0x243e3d(0x171)]((_0x4cbbe5,_0xb3b2c3)=>_0x4cbbe5+_0xb3b2c3,0x0);}export async function executePushJourneys(_0x33f37b,_0x422084,_0x4a855c,_0x1868be,_0xe19a22){const _0x517fa3=a97_0xce8e14,{journeyDefToRequest:_0x412416}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x5855ab,yamlRuleToApi:_0x59af94,validateSegmentRule:_0x372e8f}=await import(_0x517fa3(0x135)),_0xa899b6={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x41285c=new Map(_0x4a855c[_0x517fa3(0x113)]),_0x286f3d=0x5;for(let _0x3fddde=0x0;_0x3fddde<_0x422084[_0x517fa3(0x15f)];_0x3fddde+=_0x286f3d){const _0x32f922=_0x422084[_0x517fa3(0x157)](_0x3fddde,_0x3fddde+_0x286f3d),_0x27d8d2=await Promise[_0x517fa3(0x1bb)](_0x32f922['map'](async _0x34975f=>{const _0x4a6405=_0x517fa3;if(!_0x34975f[_0x4a6405(0x191)]&&!_0x34975f['hasChanges'])return{'action':'unchanged','name':_0x34975f[_0x4a6405(0x138)]['name'],'journeyId':_0x34975f[_0x4a6405(0x144)]?.['id']};const _0x19518f=_0x34975f[_0x4a6405(0x17e)]?_0x4a855c[_0x4a6405(0x1a8)]['get'](_0x34975f['folderPath']):undefined;_0xe19a22[_0x4a6405(0x1c2)]?.({'type':_0x34975f[_0x4a6405(0x191)]?'journey_creating':'journey_updating','name':_0x34975f[_0x4a6405(0x138)][_0x4a6405(0x14f)]});try{const _0x4820bf=await executeSingleJourneyPush(_0x33f37b,_0x34975f,{..._0x4a855c,'segmentNameToId':_0x41285c},{'parentId':_0x1868be[_0x4a6405(0x1c0)],'rootFolderId':_0x1868be[_0x4a6405(0x1c9)],'folderId':_0x19518f,'verbose':_0x1868be[_0x4a6405(0x1e7)]},_0xe19a22,{'journeyDefToRequest':_0x412416,'activationDefToCreateRequest':_0x5855ab,'yamlRuleToApi':_0x59af94,'validateSegmentRule':_0x372e8f});for(const [_0x4409f8,_0x3df83e]of _0x4820bf[_0x4a6405(0x125)]){_0x41285c['set'](_0x4409f8,_0x3df83e),_0xa899b6[_0x4a6405(0x125)][_0x4a6405(0x163)](_0x4409f8,_0x3df83e);}if(_0x4820bf[_0x4a6405(0x10f)]==='created')_0xe19a22[_0x4a6405(0x1c2)]?.({'type':_0x4a6405(0x123),'name':_0x34975f['yamlConfig'][_0x4a6405(0x14f)],'journeyId':_0x4820bf[_0x4a6405(0x14e)]}),_0xe19a22[_0x4a6405(0x172)]?.(_0x4a6405(0x145)+_0x34975f['yamlConfig'][_0x4a6405(0x14f)]+'\x27'),_0xa899b6['created']++;else _0x4820bf['action']===_0x4a6405(0x1ae)&&(_0xe19a22['onProgress']?.({'type':_0x4a6405(0x1cc),'name':_0x34975f[_0x4a6405(0x138)][_0x4a6405(0x14f)]}),_0xe19a22[_0x4a6405(0x172)]?.(_0x4a6405(0x1d2)+_0x34975f[_0x4a6405(0x138)]['name']+'\x27'),_0xa899b6['updated']++);return{'action':_0x4820bf[_0x4a6405(0x10f)],'name':_0x34975f[_0x4a6405(0x138)]['name'],'journeyId':_0x4820bf[_0x4a6405(0x14e)]};}catch(_0x100b2e){const _0x251584=isHttp400Error(_0x100b2e),_0x3609c9=_0x251584?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x4a6405(0x164)],_0x3da4c4=getErrorMessage(_0x100b2e);throw new SDKError(_0x3609c9,'Failed\x20to\x20'+(_0x34975f['isNew']?_0x4a6405(0x1e6):'update')+_0x4a6405(0x15c)+_0x34975f[_0x4a6405(0x1a5)]+_0x4a6405(0x192)+_0x3da4c4,_0x100b2e);}}));_0xa899b6[_0x517fa3(0x14c)][_0x517fa3(0x119)](..._0x27d8d2);}return _0xa899b6;}async function executeSingleJourneyPush(_0x11a966,_0x2a8c51,_0x595d6e,_0x1d5e1f,_0x3495f9,_0x46cbd0){const _0x54c5ae=a97_0xce8e14,{journeyDefToRequest:_0x435367,activationDefToCreateRequest:_0x35479a,yamlRuleToApi:_0x141eb0,validateSegmentRule:_0x304094}=_0x46cbd0,_0x1824de=new Map(),_0x3cfef6=new Map(),_0x28385d=new Map(),_0x2f2635=new Map(),_0x18a159=new Map();let _0x3568d7;const _0x5e0498=async()=>{const _0x9ba321=a97_0x3eba;if(_0x3568d7)return;_0x3568d7=new Map();if(!_0x2a8c51[_0x9ba321(0x144)])return;const _0x301889=await _0x11a966[_0x9ba321(0x127)][_0x9ba321(0x11b)](_0x2a8c51[_0x9ba321(0x144)]['id']);for(const _0x12831b of _0x301889){const _0x523589=journeyActivationStepToYaml(_0x12831b,_0x595d6e['idToEmailMap'],_0x595d6e[_0x9ba321(0x107)]),_0x16e343=activationSignature(_0x523589);!_0x3568d7[_0x9ba321(0x16b)](_0x16e343)&&_0x3568d7[_0x9ba321(0x163)](_0x16e343,_0x12831b['id']),_0x523589[_0x9ba321(0x14f)]&&_0x3cfef6[_0x9ba321(0x163)](_0x523589['name'],_0x12831b['id']);}};if(_0x2a8c51[_0x54c5ae(0x144)]&&_0x2a8c51['yamlConfig']['segments']){const _0x5e8d1b=buildLocalExpandedRuleMappings(_0x2a8c51[_0x54c5ae(0x138)]),_0x474163=_0x5e8d1b[_0x54c5ae(0x173)];if(_0x474163[_0x54c5ae(0x153)]>0x0){const _0x212a06=new Map();for(const [_0x4981b4,_0x5774a0]of _0x474163){const _0x473692=serializeExpandedRule(_0x5774a0,_0x474163);_0x212a06[_0x54c5ae(0x163)](_0x4981b4,_0x473692);}const _0x20fe20=collectSegmentIdsFromJourneyApi(_0x2a8c51[_0x54c5ae(0x144)]);if(_0x20fe20[_0x54c5ae(0x153)]>0x0){const _0x197de2=await buildServerSegmentRuleMap(_0x11a966,_0x1d5e1f[_0x54c5ae(0x1c0)],_0x595d6e[_0x54c5ae(0x1cf)],_0x20fe20);if(_0x197de2['size']>0x0){const _0x43b194=new Map();for(const [_0x14006e,_0x3f6ec6]of _0x197de2){const _0x33209a=serializeExpandedRule(_0x3f6ec6,_0x197de2);!_0x43b194[_0x54c5ae(0x16b)](_0x33209a)&&_0x43b194[_0x54c5ae(0x163)](_0x33209a,_0x14006e);}for(const [_0x350617,_0x43448b]of _0x212a06){const _0x17702b=_0x43b194[_0x54c5ae(0x19e)](_0x43448b);_0x17702b&&(_0x18a159[_0x54c5ae(0x163)](_0x350617,_0x17702b),_0x595d6e[_0x54c5ae(0x113)]['set'](_0x350617,_0x17702b));}}}}}const _0x45205f={'resolveSegmentId':async _0x1a1d25=>{const _0x1b977c=_0x54c5ae,_0x4de204=_0x595d6e[_0x1b977c(0x113)][_0x1b977c(0x19e)](_0x1a1d25);if(!_0x4de204)throw new SDKError(ErrorCode[_0x1b977c(0x1ea)],_0x1b977c(0x133)+_0x1a1d25+_0x1b977c(0x175)+_0x2a8c51['yamlConfig'][_0x1b977c(0x14f)]+')');return _0x4de204;},'resolveEmbeddedSegmentId':async(_0x4d87cf,_0x36b8fa)=>{const _0x523506=_0x54c5ae,_0x359151=_0x595d6e[_0x523506(0x113)][_0x523506(0x19e)](_0x4d87cf);if(_0x359151)return _0x359151;const _0x33d616=_0x18a159[_0x523506(0x19e)](_0x4d87cf);if(_0x33d616)return _0x595d6e[_0x523506(0x113)][_0x523506(0x163)](_0x4d87cf,_0x33d616),_0x33d616;const _0x362f6a=_0x595d6e[_0x523506(0x1cf)][_0x523506(0x185)](_0xbe9d7=>_0xbe9d7['name']===_0x4d87cf);if(_0x362f6a)return _0x595d6e[_0x523506(0x113)][_0x523506(0x163)](_0x4d87cf,_0x362f6a['id']),_0x362f6a['id'];if(_0x2a8c51[_0x523506(0x191)]){const {stageName:_0x348879,criteriaName:_0x5897d1}=findSegmentCriteriaLocation(_0x2a8c51[_0x523506(0x138)],_0x4d87cf);return _0x304094(_0x4d87cf,_0x36b8fa['rule']),_0x28385d[_0x523506(0x163)](_0x4d87cf,{'definition':_0x36b8fa,'stageName':_0x348879,'criteriaName':_0x5897d1}),createPendingSegmentId(_0x4d87cf);}const _0xafb11a=_0x2a8c51[_0x523506(0x144)]?.['id'];if(!_0xafb11a)throw new SDKError(ErrorCode[_0x523506(0x1b9)],_0x523506(0x124));_0x304094(_0x4d87cf,_0x36b8fa[_0x523506(0x1a9)]);const _0x186b4e=generateDeterministicJourneySegmentName(_0x2a8c51[_0x523506(0x138)][_0x523506(0x14f)],_0x4d87cf),_0x1cbc48=_0x595d6e[_0x523506(0x1cf)][_0x523506(0x185)](_0x2beede=>_0x2beede[_0x523506(0x14f)]===_0x186b4e),_0x3ef391=createSegmentIdResolver(_0x595d6e[_0x523506(0x113)],_0x4d87cf),_0x56457f=await resolveRuleSegmentIds(_0x36b8fa['rule'],_0x3ef391);let _0x48962f;if(_0x1cbc48)await _0x11a966[_0x523506(0x16d)][_0x523506(0x1bd)](_0x1d5e1f['parentId'],_0x1cbc48['id'],{'description':_0x36b8fa['description']||_0x523506(0x12c)+_0x4d87cf,'rule':_0x141eb0(_0x56457f,!![]),'countPopulation':!![]}),_0x48962f=_0x1cbc48['id'];else try{_0x48962f=await _0x11a966[_0x523506(0x16d)][_0x523506(0x114)]({'name':_0x186b4e,'description':_0x36b8fa[_0x523506(0x161)]||'Entry\x20criteria:\x20'+_0x4d87cf,'journeyId':_0xafb11a,'rule':_0x141eb0(_0x56457f,!![]),'countPopulation':!![],'parentFolderId':_0x1d5e1f[_0x523506(0x1c9)]||'','audienceId':_0x1d5e1f[_0x523506(0x1c0)]});}catch(_0x121782){const _0x261cad=_0x121782 instanceof Error&&_0x121782[_0x523506(0x152)]['includes'](_0x523506(0x19c));if(_0x261cad){const _0x3e7e30=await _0x11a966[_0x523506(0x16d)][_0x523506(0x146)](_0x1d5e1f['parentId']),_0x365534=_0x3e7e30[_0x523506(0x185)](_0x17242c=>_0x17242c[_0x523506(0x14f)]===_0x186b4e);if(_0x365534)await _0x11a966[_0x523506(0x16d)][_0x523506(0x1bd)](_0x1d5e1f['parentId'],_0x365534['id'],{'description':_0x36b8fa[_0x523506(0x161)]||'Entry\x20criteria:\x20'+_0x4d87cf,'rule':_0x141eb0(_0x56457f,!![]),'countPopulation':!![]}),_0x48962f=_0x365534['id'];else throw _0x121782;}else throw _0x121782;}return _0x595d6e[_0x523506(0x113)][_0x523506(0x163)](_0x4d87cf,_0x48962f),_0x1824de[_0x523506(0x163)](_0x4d87cf,_0x48962f),_0x48962f;},'resolveActivationId':async _0x46ff63=>{const _0x53e475=_0x54c5ae,_0x185e1b=_0x3cfef6['get'](_0x46ff63);if(_0x185e1b)return _0x185e1b;if(_0x2a8c51[_0x53e475(0x144)]){await _0x5e0498();const _0x388989=_0x3cfef6[_0x53e475(0x19e)](_0x46ff63);if(_0x388989)return _0x388989;}throw new SDKError(ErrorCode[_0x53e475(0x13b)],_0x53e475(0x132)+_0x46ff63+_0x53e475(0x175)+_0x2a8c51[_0x53e475(0x138)][_0x53e475(0x14f)]+_0x53e475(0x1cb)+_0x53e475(0x12d));},'resolveEmbeddedActivationId':async(_0x56b7e3,_0x519549)=>{const _0x3b65f5=_0x54c5ae,_0x471417=_0x3cfef6[_0x3b65f5(0x19e)](_0x56b7e3);if(_0x471417)return _0x471417;if(_0x2a8c51['isNew'])return _0x2f2635[_0x3b65f5(0x163)](_0x56b7e3,_0x519549),createPendingActivationId(_0x56b7e3);if(_0x2a8c51['existingJourney']){await _0x5e0498();const _0x310bfd=_0x3cfef6[_0x3b65f5(0x19e)](_0x519549[_0x3b65f5(0x14f)]);if(_0x310bfd)return _0x3cfef6[_0x3b65f5(0x163)](_0x56b7e3,_0x310bfd),_0x310bfd;const _0x5bc896=activationSignature(_0x519549),_0x86f6ee=_0x3568d7?.[_0x3b65f5(0x19e)](_0x5bc896);if(_0x86f6ee)return _0x3cfef6[_0x3b65f5(0x163)](_0x56b7e3,_0x86f6ee),_0x86f6ee;const _0x14b309=await _0x35479a(_0x519549,_0x595d6e[_0x3b65f5(0x142)]),_0x7a3560=await _0x11a966[_0x3b65f5(0x127)]['createActivation'](_0x2a8c51[_0x3b65f5(0x144)]['id'],_0x14b309);return _0x3cfef6[_0x3b65f5(0x163)](_0x56b7e3,_0x7a3560['id']),_0x7a3560['id'];}throw new SDKError(ErrorCode[_0x3b65f5(0x1b9)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x19366e=>{const _0x40d597=_0x54c5ae;try{return await _0x11a966[_0x40d597(0x127)][_0x40d597(0x14d)](_0x1d5e1f[_0x40d597(0x1c0)],_0x19366e);}catch(_0x35c7ee){throw new SDKError(ErrorCode['NOT_FOUND'],_0x40d597(0x140)+_0x19366e+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x2a8c51[_0x40d597(0x138)][_0x40d597(0x14f)]+'\x27)',_0x35c7ee);}},'resolveStageId':async(_0x31dc6b,_0x1d5751)=>{const _0x459a50=_0x54c5ae,_0x331ce=await _0x11a966[_0x459a50(0x127)][_0x459a50(0x10c)](_0x31dc6b),_0xc4f4fc=_0x331ce[_0x459a50(0x15e)][_0x459a50(0x19d)][_0x459a50(0x185)](_0x55b2e5=>_0x55b2e5['name'][_0x459a50(0x15a)]()===_0x1d5751['toLowerCase']());if(!_0xc4f4fc?.['id'])throw new SDKError(ErrorCode[_0x459a50(0x13b)],'Stage\x20\x27'+_0x1d5751+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x331ce[_0x459a50(0x15e)][_0x459a50(0x13d)]||_0x331ce['attributes'][_0x459a50(0x14f)])+'\x27');return _0xc4f4fc['id'];}},_0x2ff6d2=await _0x435367(_0x2a8c51[_0x54c5ae(0x138)],_0x1d5e1f['parentId'],_0x45205f),_0x5ced33=_0x1d5e1f[_0x54c5ae(0x1b2)]||_0x1d5e1f[_0x54c5ae(0x1c9)];_0x5ced33&&(_0x2ff6d2[_0x54c5ae(0x120)]={'parentFolder':{'data':{'id':_0x5ced33,'type':_0x54c5ae(0x16e)}}});if(_0x2a8c51[_0x54c5ae(0x191)]){if(_0x28385d[_0x54c5ae(0x153)]>0x0||_0x2f2635[_0x54c5ae(0x153)]>0x0)return await executeThreeStepJourneyCreate(_0x11a966,_0x2a8c51,_0x2ff6d2,{'pendingEmbeddedSegments':_0x28385d,'pendingEmbeddedActivations':_0x2f2635,'embeddedSegmentNameToId':_0x1824de,'journeyActivationNameToId':_0x3cfef6},{..._0x1d5e1f,'effectiveFolderId':_0x5ced33},_0x595d6e,_0x3495f9,_0x46cbd0);else{ensureJourneyDefaults(_0x2ff6d2[_0x54c5ae(0x15e)]);const _0x100c68=await _0x11a966[_0x54c5ae(0x127)][_0x54c5ae(0x1e6)](_0x2ff6d2);return{'action':'created','journeyId':_0x100c68['id'],'embeddedSegmentNameToId':_0x1824de};}}else{if(_0x2a8c51[_0x54c5ae(0x121)]&&_0x2a8c51['existingJourney'])return ensureJourneyDefaults(_0x2ff6d2[_0x54c5ae(0x15e)]),await _0x11a966[_0x54c5ae(0x127)][_0x54c5ae(0x1ad)](_0x2a8c51[_0x54c5ae(0x144)]['id'],_0x2ff6d2),{'action':_0x54c5ae(0x1ae),'journeyId':_0x2a8c51[_0x54c5ae(0x144)]['id'],'embeddedSegmentNameToId':_0x1824de};}return{'action':_0x54c5ae(0x17f),'journeyId':_0x2a8c51[_0x54c5ae(0x144)]?.['id'],'embeddedSegmentNameToId':_0x1824de};}function findSegmentCriteriaLocation(_0x562ee2,_0x355da7){const _0x391e4c=a97_0xce8e14,_0x20e430=_0x562ee2[_0x391e4c(0x1d3)]||_0x562ee2['journeys']?.[0x0]?.[_0x391e4c(0x1d3)]||[];let _0x41ed07=_0x391e4c(0x155),_0x2d5eb8=_0x355da7;const _0x513938=_0x562ee2[_0x391e4c(0x139)]||_0x562ee2[_0x391e4c(0x189)]?.[0x0]?.[_0x391e4c(0x139)];if(_0x513938?.[_0x391e4c(0x16d)]===_0x355da7)return{'stageName':_0x391e4c(0x139),'criteriaName':_0x513938[_0x391e4c(0x14f)]||_0x355da7};_0x40a274:for(const _0xcfd3fa of _0x20e430){if(_0xcfd3fa[_0x391e4c(0x141)]?.[_0x391e4c(0x16d)]===_0x355da7){_0x41ed07=_0xcfd3fa['name'],_0x2d5eb8=_0xcfd3fa[_0x391e4c(0x141)][_0x391e4c(0x14f)]||_0x355da7;break;}if(_0xcfd3fa[_0x391e4c(0x16c)])for(const _0x16511a of _0xcfd3fa[_0x391e4c(0x16c)]){if(_0x16511a['type']===_0x391e4c(0x1ba)&&_0x16511a[_0x391e4c(0x160)]?.[_0x391e4c(0x1e8)])for(const _0x415a77 of _0x16511a[_0x391e4c(0x160)][_0x391e4c(0x1e8)]){if(_0x415a77[_0x391e4c(0x16d)]===_0x355da7){_0x41ed07=_0xcfd3fa[_0x391e4c(0x14f)],_0x2d5eb8=_0x415a77['name']||_0x355da7;break _0x40a274;}}}}return{'stageName':_0x41ed07,'criteriaName':_0x2d5eb8};}async function executeThreeStepJourneyCreate(_0x51be7d,_0x58a789,_0x15de3c,_0x9e4bda,_0x4e4082,_0x1efac1,_0x5338ba,_0x5f3050){const _0x1ede21=a97_0xce8e14,{activationDefToCreateRequest:_0x5eebc0,yamlRuleToApi:_0x163714}=_0x5f3050,{pendingEmbeddedSegments:_0x2fc147,pendingEmbeddedActivations:_0x47ffeb,embeddedSegmentNameToId:_0x13b8c5}=_0x9e4bda,_0xef7d81=JSON[_0x1ede21(0x10d)](JSON[_0x1ede21(0x10e)](_0x15de3c));ensureJourneyDefaults(_0xef7d81[_0x1ede21(0x15e)]),stripPendingIds(_0xef7d81);const _0x26123c=await _0x51be7d[_0x1ede21(0x127)][_0x1ede21(0x1e6)](_0xef7d81),_0x3e9b0b=_0x26123c['id'],_0x2a3b1c=new Map();for(const _0xbba89d of _0x26123c[_0x1ede21(0x15e)][_0x1ede21(0x19d)]){_0x2a3b1c[_0x1ede21(0x163)](_0xbba89d[_0x1ede21(0x14f)][_0x1ede21(0x15a)](),_0xbba89d['id']);}for(const [_0x53c25d,{definition:_0x2e0be2}]of _0x2fc147){const _0x43b8e8=generateDeterministicJourneySegmentName(_0x58a789[_0x1ede21(0x138)][_0x1ede21(0x14f)],_0x53c25d);_0x5338ba[_0x1ede21(0x1c2)]?.({'type':_0x1ede21(0x11c),'journeyName':_0x58a789['yamlConfig'][_0x1ede21(0x14f)],'segmentName':_0x53c25d});const _0x13ec60=createSegmentIdResolver(_0x1efac1['segmentNameToId'],_0x53c25d),_0x44c01a=await resolveRuleSegmentIds(_0x2e0be2['rule'],_0x13ec60),_0x5a2217=await _0x51be7d['segment']['createJourneySegment']({'name':_0x43b8e8,'description':_0x2e0be2[_0x1ede21(0x161)]||_0x1ede21(0x12c)+_0x53c25d,'journeyId':_0x3e9b0b,'rule':_0x163714(_0x44c01a,!![]),'countPopulation':!![],'parentFolderId':_0x4e4082[_0x1ede21(0x1d5)]||'','audienceId':_0x4e4082[_0x1ede21(0x1c0)]});_0x13b8c5[_0x1ede21(0x163)](_0x53c25d,_0x5a2217),_0x1efac1[_0x1ede21(0x113)][_0x1ede21(0x163)](_0x53c25d,_0x5a2217),_0x5338ba[_0x1ede21(0x1c2)]?.({'type':_0x1ede21(0x12e),'journeyName':_0x58a789[_0x1ede21(0x138)][_0x1ede21(0x14f)],'segmentName':_0x53c25d});}const _0x2bce0b=new Map();for(const [_0x9329d1,_0x3e7fe0]of _0x47ffeb){_0x5338ba[_0x1ede21(0x1c2)]?.({'type':'embedded_activation_creating','journeyName':_0x58a789[_0x1ede21(0x138)][_0x1ede21(0x14f)],'activationName':_0x9329d1});const _0x1ff910=await _0x5eebc0(_0x3e7fe0,_0x1efac1[_0x1ede21(0x142)]),_0x1592b0=await _0x51be7d['journey'][_0x1ede21(0x17d)](_0x3e9b0b,_0x1ff910);_0x2bce0b[_0x1ede21(0x163)](_0x9329d1,_0x1592b0['id']),_0x9e4bda[_0x1ede21(0x147)]['set'](_0x9329d1,_0x1592b0['id']),_0x5338ba[_0x1ede21(0x1c2)]?.({'type':_0x1ede21(0x181),'journeyName':_0x58a789[_0x1ede21(0x138)][_0x1ede21(0x14f)],'activationName':_0x9329d1});}const _0x49a798=JSON[_0x1ede21(0x10d)](JSON[_0x1ede21(0x10e)](_0x15de3c));return _0x49a798['id']=_0x3e9b0b,ensureJourneyDefaults(_0x49a798[_0x1ede21(0x15e)]),resolvePendingIdsInRequest(_0x49a798,_0x15de3c,_0x2a3b1c,_0x13b8c5,_0x2bce0b,_0x5338ba),await _0x51be7d[_0x1ede21(0x127)][_0x1ede21(0x1ad)](_0x3e9b0b,_0x49a798),{'action':_0x1ede21(0x1ac),'journeyId':_0x3e9b0b,'embeddedSegmentNameToId':_0x13b8c5};}function stripPendingIds(_0x2d1ff4){const _0x598781=a97_0xce8e14;for(const _0x1f2182 of _0x2d1ff4[_0x598781(0x15e)][_0x598781(0x19d)]||[]){_0x1f2182[_0x598781(0x183)]?.[_0x598781(0x118)]&&isPendingSegmentId(_0x1f2182[_0x598781(0x183)]['segmentId'])&&delete _0x1f2182['entryCriteria'];if(_0x1f2182[_0x598781(0x16c)])for(const _0xb8110e of Object[_0x598781(0x1a1)](_0x1f2182[_0x598781(0x16c)])){const _0x40bfbf=_0x1f2182[_0x598781(0x16c)][_0xb8110e];_0x40bfbf[_0x598781(0x11a)]===_0x598781(0x198)&&_0x40bfbf[_0x598781(0x162)]&&isPendingActivationId(_0x40bfbf[_0x598781(0x162)])&&(_0x40bfbf[_0x598781(0x162)]='');if(_0x40bfbf[_0x598781(0x11a)]===_0x598781(0x14b)&&_0x40bfbf[_0x598781(0x1e8)])for(const _0x560c1e of _0x40bfbf[_0x598781(0x1e8)]){_0x560c1e[_0x598781(0x118)]&&isPendingSegmentId(_0x560c1e['segmentId'])&&(_0x560c1e[_0x598781(0x118)]='');}}}}function a97_0x3eba(_0x4c9049,_0x21a65e){_0x4c9049=_0x4c9049-0x105;const _0x50caf6=a97_0x50ca();let _0x3eba6c=_0x50caf6[_0x4c9049];return _0x3eba6c;}function resolvePendingIdsInRequest(_0x2a2ed3,_0x1dd7fa,_0x29ca9d,_0x2d4afb,_0x307623,_0x3f16a5){const _0x487691=a97_0xce8e14,_0x26d907=(_0x6efabf,_0x324c0c)=>{const _0x34e4b2=a97_0x3eba;if(!isPendingSegmentId(_0x6efabf))return _0x6efabf;const _0x5e34de=extractPendingSegmentName(_0x6efabf),_0x46ea18=_0x2d4afb[_0x34e4b2(0x19e)](_0x5e34de);return!_0x46ea18&&_0x3f16a5[_0x34e4b2(0x17c)]?.(_0x34e4b2(0x11f)+_0x5e34de+_0x34e4b2(0x131)+_0x324c0c),_0x46ea18;};if(_0x2a2ed3[_0x487691(0x15e)][_0x487691(0x139)]?.[_0x487691(0x118)]&&isPendingSegmentId(_0x2a2ed3[_0x487691(0x15e)][_0x487691(0x139)][_0x487691(0x118)])){const _0x1e5b37=_0x26d907(_0x2a2ed3['attributes']['goal'][_0x487691(0x118)],'goal\x20criteria');_0x1e5b37&&(_0x2a2ed3[_0x487691(0x15e)][_0x487691(0x139)][_0x487691(0x118)]=_0x1e5b37);}for(const _0x2eb507 of _0x2a2ed3['attributes'][_0x487691(0x19d)]||[]){const _0xe28fa4=_0x29ca9d[_0x487691(0x19e)](_0x2eb507[_0x487691(0x14f)][_0x487691(0x15a)]());_0xe28fa4&&(_0x2eb507['id']=_0xe28fa4);if(_0x2eb507[_0x487691(0x183)]?.[_0x487691(0x118)]&&isPendingSegmentId(_0x2eb507['entryCriteria'][_0x487691(0x118)])){const _0x59a93d=_0x26d907(_0x2eb507['entryCriteria']['segmentId'],_0x487691(0x13f)+_0x2eb507[_0x487691(0x14f)]+_0x487691(0x13e));_0x59a93d&&(_0x2eb507[_0x487691(0x183)][_0x487691(0x118)]=_0x59a93d);}if(_0x2eb507[_0x487691(0x154)])for(const _0x591af8 of _0x2eb507[_0x487691(0x154)]){if(_0x591af8[_0x487691(0x118)]&&isPendingSegmentId(_0x591af8[_0x487691(0x118)])){const _0x3dc585=_0x26d907(_0x591af8['segmentId'],_0x487691(0x13f)+_0x2eb507[_0x487691(0x14f)]+_0x487691(0x1e2));_0x3dc585&&(_0x591af8['segmentId']=_0x3dc585);}}if(_0x2eb507[_0x487691(0x1c4)]?.[_0x487691(0x118)]&&isPendingSegmentId(_0x2eb507[_0x487691(0x1c4)][_0x487691(0x118)])){const _0x56c657=_0x26d907(_0x2eb507[_0x487691(0x1c4)]['segmentId'],'stage\x20\x27'+_0x2eb507[_0x487691(0x14f)]+_0x487691(0x1d4));_0x56c657&&(_0x2eb507[_0x487691(0x1c4)][_0x487691(0x118)]=_0x56c657);}if(_0x2eb507[_0x487691(0x16c)]){const _0x2af74a=_0x315cf0=>_0x1dd7fa['attributes'][_0x487691(0x19d)][_0x487691(0x185)](_0x5ea19f=>_0x5ea19f[_0x487691(0x14f)]['toLowerCase']()===_0x2eb507[_0x487691(0x14f)][_0x487691(0x15a)]())?.[_0x487691(0x16c)]?.[_0x315cf0];for(const _0x27008f of Object['keys'](_0x2eb507[_0x487691(0x16c)])){const _0xb197ba=_0x2eb507[_0x487691(0x16c)][_0x27008f],_0x173f6c=_0x2af74a(_0x27008f);if(_0xb197ba[_0x487691(0x11a)]==='Activation'&&_0xb197ba[_0x487691(0x162)]&&(isPendingActivationId(_0xb197ba['journeyActivationStepId'])||_0xb197ba['journeyActivationStepId']==='')){if(_0x173f6c?.[_0x487691(0x162)]&&isPendingActivationId(_0x173f6c[_0x487691(0x162)])){const _0x2a842f=extractPendingActivationName(_0x173f6c[_0x487691(0x162)]),_0x5b4d44=_0x307623['get'](_0x2a842f);_0x5b4d44&&(_0xb197ba['journeyActivationStepId']=_0x5b4d44);}}if(_0xb197ba[_0x487691(0x11a)]===_0x487691(0x14b)&&_0xb197ba[_0x487691(0x1e8)]&&_0x173f6c?.[_0x487691(0x1e8)])for(let _0x3c68f8=0x0;_0x3c68f8<_0xb197ba[_0x487691(0x1e8)][_0x487691(0x15f)];_0x3c68f8++){const _0x25c645=_0xb197ba['branches'][_0x3c68f8],_0x441e85=_0x173f6c[_0x487691(0x1e8)][_0x3c68f8];if(_0x441e85?.['segmentId']&&isPendingSegmentId(_0x441e85[_0x487691(0x118)])){const _0x13afeb=_0x26d907(_0x441e85[_0x487691(0x118)],_0x487691(0x13f)+_0x2eb507[_0x487691(0x14f)]+_0x487691(0x17a)+(_0x25c645[_0x487691(0x14f)]||_0x3c68f8)+'\x27');_0x13afeb&&(_0x25c645[_0x487691(0x118)]=_0x13afeb);}}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a448d,_0x26b06f){const _0x4c56d3=a98_0x4eb7,_0x3ed7d1=_0x2a448d();while(!![]){try{const _0x4b7803=parseInt(_0x4c56d3(0x112))/0x1*(-parseInt(_0x4c56d3(0x10d))/0x2)+parseInt(_0x4c56d3(0x111))/0x3*(parseInt(_0x4c56d3(0x108))/0x4)+-parseInt(_0x4c56d3(0x110))/0x5*(-parseInt(_0x4c56d3(0x113))/0x6)+-parseInt(_0x4c56d3(0x109))/0x7+-parseInt(_0x4c56d3(0x114))/0x8+-parseInt(_0x4c56d3(0x10a))/0x9*(parseInt(_0x4c56d3(0x10c))/0xa)+parseInt(_0x4c56d3(0x10e))/0xb;if(_0x4b7803===_0x26b06f)break;else _0x3ed7d1['push'](_0x3ed7d1['shift']());}catch(_0x8f9f30){_0x3ed7d1['push'](_0x3ed7d1['shift']());}}}(a98_0x5488,0x18841));export function buildFolderIdToPathMap(_0x1e363d){const _0x5e2eac=a98_0x4eb7,_0x17b1d7=new Map(),_0x52a934=new Map();for(const _0x25a840 of _0x1e363d){_0x52a934[_0x5e2eac(0x10b)](_0x25a840['id'],_0x25a840);}const _0x243027=new Set();for(const _0x3ce46a of _0x1e363d){!_0x3ce46a[_0x5e2eac(0x107)]&&_0x243027[_0x5e2eac(0x106)](_0x3ce46a['id']);}function _0x3c7718(_0x5dee8b){const _0x3b06f9=_0x5e2eac;if(_0x17b1d7['has'](_0x5dee8b['id']))return _0x17b1d7[_0x3b06f9(0x10f)](_0x5dee8b['id']);if(_0x243027[_0x3b06f9(0x115)](_0x5dee8b['id']))return _0x17b1d7[_0x3b06f9(0x10b)](_0x5dee8b['id'],''),'';if(_0x5dee8b['parentFolderId']){const _0x3c69f5=_0x52a934['get'](_0x5dee8b[_0x3b06f9(0x107)]);if(_0x3c69f5){const _0x3da480=_0x3c7718(_0x3c69f5),_0x8619c3=_0x3da480?_0x3da480+'/'+_0x5dee8b['name']:_0x5dee8b[_0x3b06f9(0x105)];return _0x17b1d7['set'](_0x5dee8b['id'],_0x8619c3),_0x8619c3;}}const _0x5d237d=_0x5dee8b[_0x3b06f9(0x105)];return _0x17b1d7[_0x3b06f9(0x10b)](_0x5dee8b['id'],_0x5d237d),_0x5d237d;}for(const _0x4b4ac6 of _0x1e363d){_0x3c7718(_0x4b4ac6);}return _0x17b1d7;}function a98_0x4eb7(_0x1b9b66,_0x47b63b){_0x1b9b66=_0x1b9b66-0x105;const _0x5488bd=a98_0x5488();let _0x4eb7a7=_0x5488bd[_0x1b9b66];return _0x4eb7a7;}export function buildFolderPathToIdMap(_0x2f5245){const _0x1e220e=a98_0x4eb7,_0x1bd039=new Map(),_0x2f981d=new Map();for(const _0x1073c9 of _0x2f5245){_0x2f981d[_0x1e220e(0x10b)](_0x1073c9['id'],_0x1073c9);}const _0x4e6147=new Set();for(const _0x2436f9 of _0x2f5245){!_0x2436f9['parentFolderId']&&_0x4e6147[_0x1e220e(0x106)](_0x2436f9['id']);}function _0x2f321e(_0x174a10){const _0xff0eec=_0x1e220e;if(_0x4e6147[_0xff0eec(0x115)](_0x174a10['id']))return'';if(_0x174a10[_0xff0eec(0x107)]){const _0x28180d=_0x2f981d[_0xff0eec(0x10f)](_0x174a10[_0xff0eec(0x107)]);if(_0x28180d){const _0x2fbf0a=_0x2f321e(_0x28180d);return _0x2fbf0a?_0x2fbf0a+'/'+_0x174a10[_0xff0eec(0x105)]:_0x174a10[_0xff0eec(0x105)];}}return _0x174a10[_0xff0eec(0x105)];}for(const _0xfd5765 of _0x2f5245){const _0x1e9194=_0x2f321e(_0xfd5765);_0x1bd039['set'](_0x1e9194,_0xfd5765['id']);}return _0x1bd039;}export function buildFolderMaps(_0x3f8389){const _0x54fc73=a98_0x4eb7,_0x3964a0=buildFolderIdToPathMap(_0x3f8389),_0x285895=new Map();for(const [_0x2dd4d6,_0x1776dc]of _0x3964a0){_0x285895[_0x54fc73(0x10b)](_0x1776dc,_0x2dd4d6);}return{'idToPath':_0x3964a0,'pathToId':_0x285895};}function a98_0x5488(){const _0x497bc1=['90zcoixk','907616LwSIGQ','has','name','add','parentFolderId','12WGmCMJ','1188698ywpVXJ','2772fdWVnK','set','2740lGjbyb','390452jWXrSq','4193354KusAYG','get','45930TNoBzP','144297XuZNAT','1DbrfCw'];a98_0x5488=function(){return _0x497bc1;};return a98_0x5488();}export function getFolderPath(_0x2fee1a,_0x9d9f97){const _0x5fad9d=a98_0x4eb7;if(!_0x2fee1a)return'';return _0x9d9f97[_0x5fad9d(0x10f)](_0x2fee1a)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x52dc41,_0x296922){const _0x29bbb9=a99_0x3edf,_0x52462e=_0x52dc41();while(!![]){try{const _0x3f00aa=-parseInt(_0x29bbb9(0x120))/0x1+parseInt(_0x29bbb9(0x100))/0x2+-parseInt(_0x29bbb9(0x104))/0x3+-parseInt(_0x29bbb9(0x105))/0x4+-parseInt(_0x29bbb9(0x107))/0x5*(-parseInt(_0x29bbb9(0x118))/0x6)+-parseInt(_0x29bbb9(0x125))/0x7*(-parseInt(_0x29bbb9(0x117))/0x8)+parseInt(_0x29bbb9(0x10d))/0x9;if(_0x3f00aa===_0x296922)break;else _0x52462e['push'](_0x52462e['shift']());}catch(_0x2922fd){_0x52462e['push'](_0x52462e['shift']());}}}(a99_0xc6e1,0xd47d6));import a99_0x3d88d0 from'path';import{parse as a99_0x57e94f}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5281c3){const _0x2c3f0c=a99_0x3edf;if(!_0x5281c3||_0x5281c3[_0x2c3f0c(0x108)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0xeec6c7=_0x5281c3[_0x2c3f0c(0x108)]();if(_0xeec6c7==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5281c3};const _0x167cd9=_0xeec6c7['startsWith']('/')?_0xeec6c7[_0x2c3f0c(0x113)](0x1):_0xeec6c7,_0x477583=_0x167cd9[_0x2c3f0c(0x111)]('/')[_0x2c3f0c(0x122)](_0x3cff96=>_0x3cff96!=='');if(_0x477583[_0x2c3f0c(0x106)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x4f903c=_0xeec6c7[_0x2c3f0c(0x10c)]('/')||!isRelativePathSegment(_0x477583[0x0]);for(const _0x5331d9 of _0x477583){validatePathSegment(_0x5331d9);}return{'segments':_0x477583,'isAbsolute':_0x4f903c,'raw':_0x5281c3};}function a99_0xc6e1(){const _0x110adb=['test','2144366JGHkPy','segment','dirname','join','5164737UfOQXW','2130048FJwcmb','length','10dzmjPZ','trim','name','parent_segment','type','startsWith','8812719wUSbxj','endsWith','push','Path\x20attempts\x20to\x20navigate\x20above\x20root','split','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','substring','Cannot\x20split\x20empty\x20path','parse','pop','8EvVSxD','3460314FtUyPl','.yaml','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','slice','No\x20tdx.json\x20found\x20for\x20file:\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','raw','replace','373393DlqHCd','journey','filter','readFile','exists','2051210TnCMku','segments','Path\x20segment\x20cannot\x20be\x20empty','relative','Cannot\x20navigate\x20above\x20root','isAbsolute','Relative\x20path\x20cannot\x20be\x20empty','File\x20not\x20found:\x20'];a99_0xc6e1=function(){return _0x110adb;};return a99_0xc6e1();}function isRelativePathSegment(_0xa4f4da){return _0xa4f4da==='.'||_0xa4f4da==='..';}function validatePathSegment(_0x288e47){const _0x2d333d=a99_0x3edf;if(_0x288e47==='')throw new Error(_0x2d333d(0x127));if(_0x288e47==='.'||_0x288e47==='..')return;if(/[\x00-\x1F\x7F]/[_0x2d333d(0xff)](_0x288e47))throw new Error(_0x2d333d(0x11a)+_0x288e47);if(_0x288e47!==_0x288e47[_0x2d333d(0x108)]()){}}export function validatePath(_0x241be7){const _0x565895=a99_0x3edf;if(_0x241be7[_0x565895(0x126)][_0x565895(0x106)]===0x0&&!_0x241be7[_0x565895(0xfc)])throw new Error(_0x565895(0xfd));if(_0x241be7[_0x565895(0xfc)]){if(_0x241be7[_0x565895(0x126)][0x0]==='..')throw new Error(_0x565895(0x112));let _0x3d5ef0=0x0;for(const _0xf6e830 of _0x241be7['segments']){if(_0xf6e830==='..'){if(_0x3d5ef0===0x0)throw new Error(_0x565895(0x110));_0x3d5ef0--;}else _0xf6e830!=='.'&&_0x3d5ef0++;}}}export function joinPaths(_0xdc944c,_0x2f3bd1){const _0x44cd03=a99_0x3edf;if(!_0xdc944c||_0xdc944c==='/')return _0x2f3bd1;if(!_0x2f3bd1||_0x2f3bd1==='.')return _0xdc944c;if(_0x2f3bd1[_0x44cd03(0x10c)]('/'))return _0x2f3bd1;const _0x44464b=parsePath(_0xdc944c),_0x2a3b2a=parsePath(_0x2f3bd1),_0x19a9eb=[..._0x44464b['segments']];for(const _0x51a478 of _0x2a3b2a['segments']){if(_0x51a478==='.')continue;else{if(_0x51a478==='..'){if(_0x19a9eb[_0x44cd03(0x106)]===0x0)throw new Error(_0x44cd03(0xfb));_0x19a9eb['pop']();}else _0x19a9eb[_0x44cd03(0x10f)](_0x51a478);}}const _0x2541ab=_0x19a9eb[_0x44cd03(0x103)]('/');return _0x44464b[_0x44cd03(0x11e)][_0x44cd03(0x10c)]('/')?'/'+_0x2541ab:_0x2541ab;}export function normalizePath(_0x2d51bf){const _0x4d2458=a99_0x3edf,_0x5629bd=parsePath(_0x2d51bf),_0x1162b3=[];for(const _0x61e74 of _0x5629bd[_0x4d2458(0x126)]){if(_0x61e74==='.')continue;else{if(_0x61e74==='..'){if(_0x1162b3['length']===0x0){if(_0x5629bd[_0x4d2458(0xfc)])throw new Error(_0x4d2458(0xfb));_0x1162b3['push']('..');}else _0x1162b3[_0x1162b3[_0x4d2458(0x106)]-0x1]==='..'?_0x1162b3[_0x4d2458(0x10f)]('..'):_0x1162b3[_0x4d2458(0x116)]();}else _0x1162b3['push'](_0x61e74);}}if(_0x1162b3['length']===0x0)return _0x5629bd[_0x4d2458(0xfc)]?'/':'.';const _0x2d20b0=_0x1162b3[_0x4d2458(0x103)]('/');return _0x5629bd['raw'][_0x4d2458(0x10c)]('/')?'/'+_0x2d20b0:_0x2d20b0;}export function getParentPath(_0x55af91){const _0x47a9f4=a99_0x3edf,_0x5519a9=parsePath(_0x55af91);if(_0x5519a9['segments'][_0x47a9f4(0x106)]<=0x1)return'/';const _0x481d04=_0x5519a9[_0x47a9f4(0x126)][_0x47a9f4(0x11b)](0x0,-0x1)[_0x47a9f4(0x103)]('/');return _0x5519a9['raw'][_0x47a9f4(0x10c)]('/')?'/'+_0x481d04:_0x481d04;}export function getBaseName(_0x2c74d6){const _0x3529e8=a99_0x3edf,_0xc8d539=parsePath(_0x2c74d6);return _0xc8d539[_0x3529e8(0x126)][_0xc8d539[_0x3529e8(0x126)][_0x3529e8(0x106)]-0x1]||'';}export function isChildPath(_0x4ed7b0,_0x4d2152){const _0x4c35b7=a99_0x3edf,_0x5eb818=parsePath(_0x4ed7b0),_0x3f35ab=parsePath(_0x4d2152);if(_0x5eb818[_0x4c35b7(0x126)][_0x4c35b7(0x106)]<=_0x3f35ab[_0x4c35b7(0x126)][_0x4c35b7(0x106)])return![];for(let _0xfd7749=0x0;_0xfd7749<_0x3f35ab[_0x4c35b7(0x126)][_0x4c35b7(0x106)];_0xfd7749++){if(_0x5eb818[_0x4c35b7(0x126)][_0xfd7749]!==_0x3f35ab['segments'][_0xfd7749])return![];}return!![];}export function splitPath(_0x1ff884){const _0x3126d7=a99_0x3edf,_0x4ece57=parsePath(_0x1ff884);if(_0x4ece57[_0x3126d7(0x126)][_0x3126d7(0x106)]===0x0)throw new Error(_0x3126d7(0x114));if(_0x4ece57[_0x3126d7(0x126)]['length']===0x1)return{'parent':_0x4ece57[_0x3126d7(0x126)][0x0]};return{'parent':_0x4ece57[_0x3126d7(0x126)][0x0],'child':_0x4ece57['segments']['slice'](0x1)[_0x3126d7(0x103)]('/')};}export function isYamlFilePath(_0x2ad20d){const _0x321a82=a99_0x3edf;return _0x2ad20d[_0x321a82(0x10e)]('.yml')||_0x2ad20d['endsWith'](_0x321a82(0x119));}function a99_0x3edf(_0x3a9137,_0x285aac){_0x3a9137=_0x3a9137-0xfb;const _0xc6e124=a99_0xc6e1();let _0x3edfb0=_0xc6e124[_0x3a9137];return _0x3edfb0;}export async function resolveYamlFilePath(_0x5dee63,_0x4832a1=nodeFileSystem){const _0x1babb8=a99_0x3edf,_0x3ff69b=a99_0x3d88d0['resolve'](_0x5dee63);if(!await _0x4832a1[_0x1babb8(0x124)](_0x3ff69b))throw new Error(_0x1babb8(0xfe)+_0x5dee63);let _0x475031=a99_0x3d88d0[_0x1babb8(0x102)](_0x3ff69b),_0x3f7937=null,_0xee82b1=null;const _0x1f7f24=a99_0x3d88d0[_0x1babb8(0x115)](_0x475031)['root'];while(_0x475031!==_0x1f7f24){const _0x6e58d1=a99_0x3d88d0[_0x1babb8(0x103)](_0x475031,'tdx.json');if(await _0x4832a1[_0x1babb8(0x124)](_0x6e58d1)){_0x3f7937=_0x6e58d1,_0xee82b1=_0x475031;break;}_0x475031=a99_0x3d88d0[_0x1babb8(0x102)](_0x475031);}if(!_0x3f7937||!_0xee82b1)throw new Error(_0x1babb8(0x11c)+_0x5dee63);const _0x3d2fdb=await _0x4832a1['readFile'](_0x3f7937),_0x30d0d6=JSON[_0x1babb8(0x115)](_0x3d2fdb),_0x362997=_0x30d0d6[_0x1babb8(0x10a)];if(!_0x362997)throw new Error(_0x1babb8(0x11d));const _0x227f68=await _0x4832a1[_0x1babb8(0x123)](_0x3ff69b),_0x37c1b6=a99_0x57e94f(_0x227f68),_0x2d65b8=_0x37c1b6[_0x1babb8(0x109)];if(!_0x2d65b8)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x5dee63);const _0x1a1ed4=_0x37c1b6[_0x1babb8(0x10b)]==='journey'?_0x1babb8(0x121):_0x1babb8(0x101),_0x19d8e4=a99_0x3d88d0[_0x1babb8(0x128)](_0xee82b1,_0x3ff69b),_0x509fdd=a99_0x3d88d0[_0x1babb8(0x102)](_0x19d8e4),_0x1c74e1=_0x509fdd==='.'?'':_0x509fdd[_0x1babb8(0x11f)](/\\/g,'/'),_0x2b52a9=_0x1c74e1?_0x362997+'/'+_0x1c74e1+'/'+_0x2d65b8:_0x362997+'/'+_0x2d65b8;return{'parentSegment':_0x362997,'segmentName':_0x2d65b8,'folderPath':_0x1c74e1,'fullPath':_0x2b52a9,'resourceType':_0x1a1ed4};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29a8ac,_0x1816fb){const _0x2d1635=a100_0x474f,_0x174309=_0x29a8ac();while(!![]){try{const _0x4c6777=parseInt(_0x2d1635(0xb6))/0x1+-parseInt(_0x2d1635(0xb3))/0x2*(parseInt(_0x2d1635(0xb7))/0x3)+parseInt(_0x2d1635(0xb1))/0x4+-parseInt(_0x2d1635(0xad))/0x5*(parseInt(_0x2d1635(0xb4))/0x6)+parseInt(_0x2d1635(0xb5))/0x7*(-parseInt(_0x2d1635(0xb0))/0x8)+-parseInt(_0x2d1635(0xb2))/0x9+parseInt(_0x2d1635(0xaf))/0xa*(parseInt(_0x2d1635(0xac))/0xb);if(_0x4c6777===_0x1816fb)break;else _0x174309['push'](_0x174309['shift']());}catch(_0x32d12b){_0x174309['push'](_0x174309['shift']());}}}(a100_0x4d3c,0x1888d));function a100_0x4d3c(){const _0x31b2ce=['70209qoBtNK','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring','7799nOKkFv','15110omYHhk','Invalid\x20segment\x20reference\x20format:\x20','140BLJiLO','8KMolAk','665752QeQBEJ','1046394SKPIlK','10MxPNGQ','30tpVNhB','10220EOjHSa','173980nTCWvf'];a100_0x4d3c=function(){return _0x31b2ce;};return a100_0x4d3c();}function a100_0x474f(_0x1120ca,_0x2601dd){_0x1120ca=_0x1120ca-0xac;const _0x4d3c29=a100_0x4d3c();let _0x474f5c=_0x4d3c29[_0x1120ca];return _0x474f5c;}export function parseSegmentRef(_0x303b4d){const _0x492f3f=a100_0x474f,_0x20db20=_0x303b4d['indexOf']('/');if(_0x20db20===-0x1)return{'parentId':_0x303b4d};if(_0x20db20===0x0)throw new Error(_0x492f3f(0xae)+_0x303b4d+_0x492f3f(0xb8));const _0x30ac82=_0x303b4d[_0x492f3f(0xb9)](0x0,_0x20db20),_0x34a284=_0x303b4d[_0x492f3f(0xb9)](_0x20db20+0x1);if(_0x34a284==='')throw new Error(_0x492f3f(0xae)+_0x303b4d+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x30ac82,'childId':_0x34a284};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1dd9d6,_0x540f45){const _0x33a125=a101_0x31fd,_0x3e694e=_0x1dd9d6();while(!![]){try{const _0x15931a=parseInt(_0x33a125(0x1fe))/0x1*(parseInt(_0x33a125(0x1d3))/0x2)+-parseInt(_0x33a125(0x20b))/0x3*(parseInt(_0x33a125(0x1d5))/0x4)+-parseInt(_0x33a125(0x208))/0x5*(parseInt(_0x33a125(0x1fd))/0x6)+-parseInt(_0x33a125(0x1d1))/0x7+-parseInt(_0x33a125(0x1e0))/0x8+parseInt(_0x33a125(0x203))/0x9*(parseInt(_0x33a125(0x1eb))/0xa)+-parseInt(_0x33a125(0x1e3))/0xb*(-parseInt(_0x33a125(0x1ec))/0xc);if(_0x15931a===_0x540f45)break;else _0x3e694e['push'](_0x3e694e['shift']());}catch(_0xf96e38){_0x3e694e['push'](_0x3e694e['shift']());}}}(a101_0xfbf4,0x95cfc));import a101_0x3cd256 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(_0x5b0ea2){const _0x499bd4=a101_0x31fd;return _0x5b0ea2[_0x499bd4(0x1f0)]!=='error';}function a101_0xfbf4(){const _0x47ed42=['tdx.json','basename','dirname','isFile','file_not_found','764648thxTRU','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','trim','77583mpnjxy','readFile','segment','no_config','File\x20not\x20found','parent_segment','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','stat','10VrTmNs','1236AvtCqg','exists','context','relative','type','folderPath','isDirectory','segmentName','join','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','resourceType','parse','string','journey','Parent\x20segment\x20not\x20specified','isScoped','parent_name','7674qQEEFC','704015gPyXCg','Not\x20a\x20YAML\x20file:\x20','match','configDir','replace','10662489DxTyJc','directory','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','cwd','extname','55qNYnpT','file','parentSegment','6vIigky','scopedFolderPath','5719133AFPYpn','invalid_yaml','2HwZYFW','resolve','2149796wyXEYd','startsWith','message','includes','File\x20not\x20found:\x20','error'];a101_0xfbf4=function(){return _0x47ed42;};return a101_0xfbf4();}export function isScopedResolution(_0x3b18ed){const _0xd54775=a101_0x31fd;return _0x3b18ed['type']==='directory'||_0x3b18ed[_0xd54775(0x1f0)]==='file'||_0x3b18ed[_0xd54775(0x1f0)]==='context';}export function getScopedDetails(_0x5b4c97){const _0x4edef3=a101_0x31fd;if(isScopedResolution(_0x5b4c97))return{'isScoped':_0x5b4c97[_0x4edef3(0x1fb)],'scopedFolderPath':_0x5b4c97[_0x4edef3(0x1d0)]};return undefined;}function a101_0x31fd(_0x1df104,_0x71e7b){_0x1df104=_0x1df104-0x1d0;const _0xfbf457=a101_0xfbf4();let _0x31fdf4=_0xfbf457[_0x1df104];return _0x31fdf4;}async function findTdxConfigAsync(_0xd0be7e,_0x410d08){const _0x1a2ce6=a101_0x31fd;let _0x3ee178=a101_0x3cd256[_0x1a2ce6(0x1d4)](_0xd0be7e);const _0x425e7f=a101_0x3cd256[_0x1a2ce6(0x1f7)](_0x3ee178)['root'];while(_0x3ee178!==_0x425e7f){const _0x20ef7b=a101_0x3cd256[_0x1a2ce6(0x1f4)](_0x3ee178,_0x1a2ce6(0x1db));if(await _0x410d08['exists'](_0x20ef7b))try{const _0x1d386a=await _0x410d08[_0x1a2ce6(0x1e4)](_0x20ef7b),_0x16d4c4=JSON[_0x1a2ce6(0x1f7)](_0x1d386a);if(_0x16d4c4[_0x1a2ce6(0x1e8)]&&typeof _0x16d4c4['parent_segment']===_0x1a2ce6(0x1f8))return{'configPath':_0x20ef7b,'configDir':_0x3ee178,'parentSegment':_0x16d4c4[_0x1a2ce6(0x1e8)]};}catch{}_0x3ee178=a101_0x3cd256[_0x1a2ce6(0x1dd)](_0x3ee178);}return null;}function calculateScopedPath(_0x4066f7,_0x5346a2){const _0x93cb32=a101_0x31fd,_0x2a0bea=a101_0x3cd256[_0x93cb32(0x1ef)](_0x5346a2,_0x4066f7),_0x5e0639=_0x2a0bea!==''&&_0x2a0bea!=='.'&&!_0x2a0bea[_0x93cb32(0x1d6)]('..');return{'isScoped':_0x5e0639,'scopedFolderPath':_0x5e0639?_0x2a0bea[_0x93cb32(0x202)](/\\/g,'/'):''};}export async function resolveTarget(_0x5d4d0c){const _0x51c984=a101_0x31fd,{arg:_0x5c7819,contextParent:_0x1dbe79,cwd:cwd=process[_0x51c984(0x206)](),fs:fs=nodeFileSystem}=_0x5d4d0c;if(_0x5c7819&&isYamlFilePath(_0x5c7819))try{const _0x58178f=await resolveYamlFilePath(_0x5c7819,fs),_0x393a60=a101_0x3cd256['resolve'](_0x5c7819),_0x493a1f=a101_0x3cd256[_0x51c984(0x1dd)](_0x393a60),_0xdaee4e=await findTdxConfigAsync(_0x493a1f,fs);if(!_0xdaee4e){if(_0x1dbe79){const _0x36ee5c=a101_0x3cd256[_0x51c984(0x1dd)](_0x393a60);return{'type':_0x51c984(0x209),'parentName':_0x1dbe79,'targetDir':_0x36ee5c,'configRoot':_0x36ee5c,'filePath':_0x393a60,'resourceName':_0x58178f[_0x51c984(0x1f3)],'folderPath':_0x58178f[_0x51c984(0x1f1)],'resourceType':_0x58178f[_0x51c984(0x1f6)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x51c984(0x1da),'errorCode':'no_config','message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x5c7819,'arg':_0x5c7819,'helpText':_0x51c984(0x1e9)};}const _0x495311=calculateScopedPath(_0x493a1f,_0xdaee4e[_0x51c984(0x201)]);return{'type':_0x51c984(0x209),'parentName':_0xdaee4e[_0x51c984(0x20a)],'targetDir':_0xdaee4e[_0x51c984(0x201)],'configRoot':_0xdaee4e[_0x51c984(0x201)],'filePath':_0x393a60,'resourceName':_0x58178f[_0x51c984(0x1f3)],'folderPath':_0x58178f[_0x51c984(0x1f1)],'resourceType':_0x58178f['resourceType'],'isScoped':_0x495311[_0x51c984(0x1fb)],'scopedFolderPath':_0x495311['scopedFolderPath']};}catch(_0x54eea7){const _0x5544db=_0x54eea7 instanceof Error?_0x54eea7[_0x51c984(0x1d7)]:String(_0x54eea7);if(_0x5544db['includes'](_0x51c984(0x1e7)))return{'type':_0x51c984(0x1da),'errorCode':_0x51c984(0x1df),'message':_0x51c984(0x1d9)+_0x5c7819,'arg':_0x5c7819};if(_0x5544db[_0x51c984(0x1d8)]('No\x20tdx.json\x20found')){if(_0x1dbe79){const _0xb66ae4=a101_0x3cd256[_0x51c984(0x1d4)](_0x5c7819);if(await fs[_0x51c984(0x1ed)](_0xb66ae4)){const _0x59da36=a101_0x3cd256[_0x51c984(0x1dd)](_0xb66ae4),_0xc9940c=await fs[_0x51c984(0x1e4)](_0xb66ae4),_0x249d32=_0xc9940c[_0x51c984(0x200)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x1012b6=_0xc9940c[_0x51c984(0x200)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x138454=_0x249d32?_0x249d32[0x1]['trim']():a101_0x3cd256[_0x51c984(0x1dc)](_0x5c7819,a101_0x3cd256[_0x51c984(0x207)](_0x5c7819)),_0x3683bd=_0x1012b6&&_0x1012b6[0x1][_0x51c984(0x1e2)]()==='journey'?_0x51c984(0x1f9):_0x51c984(0x1e5);return{'type':'file','parentName':_0x1dbe79,'targetDir':_0x59da36,'configRoot':_0x59da36,'filePath':_0xb66ae4,'resourceName':_0x138454,'folderPath':'','resourceType':_0x3683bd,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0x51c984(0x1e6),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x5c7819,'arg':_0x5c7819,'helpText':_0x51c984(0x1e9)};}return{'type':_0x51c984(0x1da),'errorCode':'invalid_yaml','message':_0x5544db,'arg':_0x5c7819};}if(_0x5c7819){const _0x2a8e11=a101_0x3cd256['resolve'](cwd,_0x5c7819);let _0x1de8cf=null;try{_0x1de8cf=await fs[_0x51c984(0x1ea)](_0x2a8e11);}catch{}if(_0x1de8cf?.[_0x51c984(0x1f2)]()){const _0x3ca466=await findTdxConfigAsync(_0x2a8e11,fs);if(_0x3ca466){const _0xea0025=calculateScopedPath(_0x2a8e11,_0x3ca466[_0x51c984(0x201)]);return{'type':_0x51c984(0x204),'parentName':_0x3ca466[_0x51c984(0x20a)],'targetDir':_0x2a8e11,'configRoot':_0x3ca466[_0x51c984(0x201)],'isScoped':_0xea0025[_0x51c984(0x1fb)],'scopedFolderPath':_0xea0025[_0x51c984(0x1d0)]};}if(_0x1dbe79)return{'type':_0x51c984(0x204),'parentName':_0x1dbe79,'targetDir':_0x2a8e11,'configRoot':_0x2a8e11,'isScoped':![],'scopedFolderPath':''};return{'type':_0x51c984(0x1da),'errorCode':_0x51c984(0x1e6),'message':_0x51c984(0x205)+_0x5c7819,'arg':_0x5c7819,'helpText':_0x51c984(0x1e9)};}if(_0x1de8cf?.[_0x51c984(0x1de)]())return{'type':'error','errorCode':_0x51c984(0x1d2),'message':_0x51c984(0x1ff)+_0x5c7819,'arg':_0x5c7819,'helpText':_0x51c984(0x1e1)};const _0x2fec05=sanitizeFileName(_0x5c7819),_0x9f6145=getSegmentRootDir(_0x2fec05,cwd);return{'type':_0x51c984(0x1fc),'parentName':_0x5c7819,'targetDir':_0x9f6145,'configRoot':_0x9f6145};}const _0x194ad5=await findTdxConfigAsync(cwd,fs);if(_0x194ad5){const _0x34afcd=calculateScopedPath(cwd,_0x194ad5[_0x51c984(0x201)]);return{'type':_0x51c984(0x1ee),'parentName':_0x194ad5[_0x51c984(0x20a)],'targetDir':cwd,'configRoot':_0x194ad5[_0x51c984(0x201)],'isScoped':_0x34afcd[_0x51c984(0x1fb)],'scopedFolderPath':_0x34afcd[_0x51c984(0x1d0)]};}if(_0x1dbe79){const _0x1b4e5a=sanitizeFileName(_0x1dbe79),_0x5af8dd=getSegmentRootDir(_0x1b4e5a,cwd);return{'type':_0x51c984(0x1ee),'parentName':_0x1dbe79,'targetDir':_0x5af8dd,'configRoot':_0x5af8dd,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x51c984(0x1da),'errorCode':'no_parent','message':_0x51c984(0x1fa),'helpText':_0x51c984(0x1f5)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a102_0x30e5b9=a102_0x205b;(function(_0x1a5574,_0x587c34){const _0x172ba2=a102_0x205b,_0x508a98=_0x1a5574();while(!![]){try{const _0x52c2db=parseInt(_0x172ba2(0x13c))/0x1+parseInt(_0x172ba2(0x12e))/0x2+-parseInt(_0x172ba2(0x13b))/0x3+-parseInt(_0x172ba2(0x12d))/0x4+-parseInt(_0x172ba2(0x129))/0x5+parseInt(_0x172ba2(0x12c))/0x6*(parseInt(_0x172ba2(0x132))/0x7)+parseInt(_0x172ba2(0x126))/0x8*(parseInt(_0x172ba2(0x138))/0x9);if(_0x52c2db===_0x587c34)break;else _0x508a98['push'](_0x508a98['shift']());}catch(_0x17580f){_0x508a98['push'](_0x508a98['shift']());}}}(a102_0x8be8,0x841a3));import{existsSync,readFileSync}from'fs';import a102_0x48389b from'path';const TDX_CONFIG_FILE='tdx.json',SEGMENTS_DIR=a102_0x30e5b9(0x128);export function findTdxConfigPath(_0x12a659=process[a102_0x30e5b9(0x137)]()){const _0x27bff9=a102_0x30e5b9;let _0x43a113=a102_0x48389b[_0x27bff9(0x131)](_0x12a659);const _0x1c2cb2=a102_0x48389b[_0x27bff9(0x13a)](_0x43a113)['root'];while(_0x43a113!==_0x1c2cb2){const _0x3f6b82=a102_0x48389b[_0x27bff9(0x130)](_0x43a113,TDX_CONFIG_FILE);if(existsSync(_0x3f6b82))return _0x3f6b82;_0x43a113=a102_0x48389b[_0x27bff9(0x135)](_0x43a113);}return null;}export function loadTdxConfig(_0x53762a){const _0x4fbc87=a102_0x30e5b9,_0xef39ec=readFileSync(_0x53762a,_0x4fbc87(0x139));let _0x4e2b5f;try{_0x4e2b5f=JSON[_0x4fbc87(0x13a)](_0xef39ec);}catch{throw new Error(_0x4fbc87(0x136)+_0x53762a);}if(!_0x4e2b5f||typeof _0x4e2b5f!==_0x4fbc87(0x134))throw new Error(_0x4fbc87(0x127));const _0x4a1482=_0x4e2b5f;if(!_0x4a1482['parent_segment']||typeof _0x4a1482[_0x4fbc87(0x12a)]!==_0x4fbc87(0x12b))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field');return{'parent_segment':_0x4a1482[_0x4fbc87(0x12a)]};}export function findTdxConfig(_0x31cb99=process[a102_0x30e5b9(0x137)]()){const _0x2b0b00=a102_0x30e5b9,_0x174bfe=findTdxConfigPath(_0x31cb99);if(!_0x174bfe)throw new Error(_0x2b0b00(0x125));const _0x25aa20=loadTdxConfig(_0x174bfe),_0x3468ce=a102_0x48389b[_0x2b0b00(0x135)](_0x174bfe);return{'config':_0x25aa20,'configPath':_0x174bfe,'configDir':_0x3468ce};}function a102_0x8be8(){const _0x48a7be=['Invalid\x20tdx.json:\x20expected\x20object','segments','5236035TnsBQx','parent_segment','string','597642vsOyOR','2000192ppqCrF','1062820UytUHQ','replace','join','resolve','28MfEniC','startsWith','object','dirname','Invalid\x20JSON\x20in\x20','cwd','2278062bzMrFg','utf-8','parse','1509423ZigFnD','649177rEDOFY','relative','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','32BsoYSO'];a102_0x8be8=function(){return _0x48a7be;};return a102_0x8be8();}function a102_0x205b(_0x4c3bb8,_0x1a33ef){_0x4c3bb8=_0x4c3bb8-0x124;const _0x8be89b=a102_0x8be8();let _0x205b0f=_0x8be89b[_0x4c3bb8];return _0x205b0f;}export function tryFindTdxConfig(_0x10f9f9){try{return findTdxConfig(_0x10f9f9);}catch{return null;}}export function getSegmentRootDir(_0x19702a,_0x4e7796=process[a102_0x30e5b9(0x137)]()){const _0x10a28a=a102_0x30e5b9;return a102_0x48389b[_0x10a28a(0x130)](_0x4e7796,SEGMENTS_DIR,_0x19702a);}export function getTdxConfigPath(_0x2ef0c5,_0x1671e1=process[a102_0x30e5b9(0x137)]()){const _0x5afff5=a102_0x30e5b9;return a102_0x48389b[_0x5afff5(0x130)](getSegmentRootDir(_0x2ef0c5,_0x1671e1),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x481995,_0x1e5873){const _0x5cd415=a102_0x30e5b9,_0x4a4265=a102_0x48389b[_0x5cd415(0x131)](_0x481995),_0x565a0e=a102_0x48389b[_0x5cd415(0x124)](_0x1e5873,_0x4a4265);if(_0x565a0e[_0x5cd415(0x133)]('..'))return'';return _0x565a0e;}export function localPathToTdFolderPath(_0x290973){const _0x434c3e=a102_0x30e5b9,_0x34f883=a102_0x48389b[_0x434c3e(0x135)](_0x290973);if(_0x34f883==='.'||_0x34f883==='')return'';return _0x34f883[_0x434c3e(0x12f)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0xc365c,_0x18acd1){if(!_0xc365c)return _0x18acd1;return a102_0x48389b['join'](_0x18acd1,_0xc365c);}export function createTdxConfigContent(_0x64d977){const _0x2cac03={'parent_segment':_0x64d977};return JSON['stringify'](_0x2cac03,null,0x2)+'\x0a';}
|