@treasuredata/tdx 0.15.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +1 -1
- package/dist/commands/agent-test-command.d.ts.map +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/agent-test-command.js.map +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.d.ts.map +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-config.js.map +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +44 -0
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.d.ts +2 -1
- package/dist/sdk/claude-agent/index.d.ts.map +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/index.js.map +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/claude-agent/types.d.ts +4 -1
- package/dist/sdk/claude-agent/types.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/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 a119_0x5aaea3=a119_0x5cd8;(function(_0x500c20,_0x59a808){const _0x24b052=a119_0x5cd8,_0x137400=_0x500c20();while(!![]){try{const _0x289b3a=parseInt(_0x24b052(0x203))/0x1+-parseInt(_0x24b052(0x28e))/0x2*(-parseInt(_0x24b052(0x276))/0x3)+parseInt(_0x24b052(0x246))/0x4+-parseInt(_0x24b052(0x1c7))/0x5+parseInt(_0x24b052(0x1b6))/0x6*(-parseInt(_0x24b052(0x24d))/0x7)+parseInt(_0x24b052(0x24c))/0x8*(-parseInt(_0x24b052(0x206))/0x9)+parseInt(_0x24b052(0x256))/0xa*(parseInt(_0x24b052(0x1eb))/0xb);if(_0x289b3a===_0x59a808)break;else _0x137400['push'](_0x137400['shift']());}catch(_0x4b9351){_0x137400['push'](_0x137400['shift']());}}}(a119_0x2bac,0x3bc10));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a119_0x5aaea3(0x1c8);export function createPendingSegmentId(_0x5d2a3c){return''+PENDING_SEGMENT_PREFIX+_0x5d2a3c+'__';}export function isPendingSegmentId(_0x4fd0c8){const _0x21cdca=a119_0x5aaea3;return _0x4fd0c8[_0x21cdca(0x1e8)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x188a03){const _0x2b30c1=a119_0x5aaea3;return _0x188a03[_0x2b30c1(0x1bb)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3f5563){return''+PENDING_ACTIVATION_PREFIX+_0x3f5563+'__';}export function isPendingActivationId(_0x92d4e5){return _0x92d4e5['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xfa0bd7){const _0x591d6c=a119_0x5aaea3;return _0xfa0bd7[_0x591d6c(0x1bb)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x5ac174,_0x133762){const _0x33b7cb=a119_0x5aaea3,_0x2315e0=_0x5ac174+'::'+(_0x133762[_0x33b7cb(0x20a)]()||'segment'),_0x46d92b=createHash(_0x33b7cb(0x237))[_0x33b7cb(0x25b)](_0x2315e0)[_0x33b7cb(0x1f4)]('hex')[_0x33b7cb(0x211)](0x0,0xc);return'journey_entry_criteria_'+_0x46d92b;}export function ensureJourneyDefaults(_0x25218a){const _0x32cd7c=a119_0x5aaea3;!_0x25218a[_0x32cd7c(0x21d)]&&(_0x25218a[_0x32cd7c(0x21d)]=''),!_0x25218a[_0x32cd7c(0x1c9)]&&(_0x25218a[_0x32cd7c(0x1c9)]=_0x32cd7c(0x294));}export function resolveTDFolderPath(_0x47dff2,_0x143af7,_0x26cc80){const _0x647f0e=a119_0x5aaea3;if(!_0x143af7)return _0x47dff2;if(_0x47dff2===_0x26cc80||_0x47dff2[_0x647f0e(0x1e8)](_0x26cc80+'/'))return _0x47dff2;return _0x47dff2?_0x26cc80+'/'+_0x47dff2:_0x26cc80;}export function addFoldersToCreate(_0x26d935,_0xb90e47,_0xdb7856){const _0x5bd090=a119_0x5aaea3;if(!_0x26d935)return;if(_0xb90e47[_0x5bd090(0x213)](_0x26d935))return;const _0x4c020c=_0x26d935[_0x5bd090(0x27c)]('/');let _0x46f5e5='';for(const _0x2ba8f1 of _0x4c020c){_0x46f5e5=_0x46f5e5?_0x46f5e5+'/'+_0x2ba8f1:_0x2ba8f1,!_0xb90e47[_0x5bd090(0x213)](_0x46f5e5)&&_0xdb7856[_0x5bd090(0x20b)](_0x46f5e5);}}import*as a119_0x118109 from'yaml';import{readFileSync}from'fs';import a119_0x494925 from'path';import{isJourneyDef,parseYamlString as a119_0x5f2407,toYamlString as a119_0xdbc581,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 a119_0x2bac(){const _0x37de42=['createFolder','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','type','segmentFolderId','goal\x20criteria','folderId','utf-8','activation_created','description','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','idToName','embedded_segment_creating','rootFolderId','filter','../../utils/async.js','WaitStep','journey_updated','max','buildUserMaps','logDeleted','parentId','journey','steps','withProgress','NOT_FOUND','segment_updating','message','toLowerCase','sort','Failed\x20to\x20','activation_','absolutePath','\x20(referenced\x20in\x20journey\x20','keys','sha1','Updated\x20activation\x20\x27','existingJourney','journey_updating','data','stage\x20\x27','entry','activation_updating','updateActivation',').\x20','deleted','deps','Updating\x20segment\x20\x27','activation_creating','parse','1415764udxspV','createdSegmentId','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','entries','attributes','activation_updated','8lVojeI','7ZDuisB','\x27\x20milestone','goal','rule','list','listActivations','Creating\x20activation\x20\x27','segment_updated','getActivation','178430bUcgJH','results','segment_deleted','unchanged','entry_criteria','update','segmentNameToId','journeyById','includes','values','JOURNEY_UPDATE_ERROR','activationParams','\x0a\x20\x20','parseDocument','stages','activations','set','Created\x20activation\x20\x27','Creating\x20segment\x20\x27','ACTIVATION_UPDATE_ERROR','existingActivation','index','parentSegmentFolder','onProgress','waitCondition','all_columns','skipSegments','parentFolder','flatMap','map','JOURNEY_SYNTAX_ERROR','delete','7974VuhVyl','activation_deleting','kind','journey_creating','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','from','split','milestone','updated','\x27\x20for\x20','folderPath','getJourney','DecisionPoint','segmentId','nameToType','yamlConfig','find','Entry\x20criteria:\x20','nameToId','diff','./journey-yaml.js','connector_config','relationships','null','182Sayvmh','Deleting\x20activation\x20\x27','schedule','\x27\x20entry\x20criteria','embedded_segment_created','\x27...','draft','folderPathToId','\x27\x20wait\x20condition','createActivation','Created\x20journey\x20\x27','Creating\x20folder\x20\x27','getSegment','segment_created','./child-segment-yaml.js','object','isNew','\x27\x20not\x20found\x20in\x20journey\x20\x27','create','length','exitCriterias','journeyActivationNameToId','ACTIVATION_SYNTAX_ERROR','SEGMENT_NOT_FOUND','resolveJourneyId','2258058MfwtOd','\x20segment\x20from\x20file:\x20','embedded_activation_created','Segment\x20not\x20found:\x20','\x27\x20decision\x20point\x20branch\x20\x27','replace','push','activationActions','idToEmailMap','Fetching\x20','embeddedSegmentNameToId','Deleted\x20segment\x20\x27','name','segment_deleting','toString','connectionIdToNameMap','connection','454325vrkLoK','__pending_act_','state','segment','existingSegment','SEGMENT_SYNTAX_ERROR','Updated\x20segment\x20\x27','journeyBundleName','SEGMENT_UPDATE_ERROR','all','get','logInfo','):\x20','createJourneySegment','progress','updateSegmentById','versionNumber','journeyStages','created','branches','item','\x27\x20from\x20file:\x20','yamlActivation','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','activationStepsById','dirname','\x20error(s)','hasChanges','INTERNAL','logSuccess','behavior','reduce','embedded_activation_creating','startsWith','Deleted\x20activation\x20\x27','stringify','66vhokfb','effectiveFolderId','createdSegmentIds','Name\x20has\x20already\x20been\x20taken','columns','journeyBundlesByFolderAndName','journeys','activationContext','segments','digest','valid','join','notification','journeyActivationStepId','size','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','journeyId','user','activation_deleted','deleteActivation','activation_template_id','createSegment','\x27\x20exit\x20criteria','entryCriteria','458677GyFbBb','decision_point','relative','4046346tgBxtw','resolveSegment','isArray','validatedRequest','trim','add','Stage\x20\x27','existingSegments','Updating\x20activation\x20\x27','action','fetchJourney','slice','folder_creating','has','activationsBySegmentId'];a119_0x2bac=function(){return _0x37de42;};return a119_0x2bac();}function stableStringify(_0x26c58c){const _0x3cea11=a119_0x5aaea3;if(Array[_0x3cea11(0x208)](_0x26c58c))return'['+_0x26c58c[_0x3cea11(0x273)](_0x59829c=>stableStringify(_0x59829c))[_0x3cea11(0x1f6)](',')+']';if(_0x26c58c&&typeof _0x26c58c===_0x3cea11(0x1ac)){const _0x3f93c1=_0x26c58c,_0x12445c=Object['keys'](_0x3f93c1)['sort'](),_0x336413=_0x12445c[_0x3cea11(0x273)](_0x2f25b4=>'\x22'+_0x2f25b4+'\x22:'+stableStringify(_0x3f93c1[_0x2f25b4]));return'{'+_0x336413[_0x3cea11(0x1f6)](',')+'}';}const _0x334e24=JSON[_0x3cea11(0x1ea)](_0x26c58c);return _0x334e24===undefined?_0x3cea11(0x28d):_0x334e24;}function activationSignature(_0x3ac008){const _0x351cb1=a119_0x5aaea3,_0x750aeb={'connection':_0x3ac008[_0x351cb1(0x1c6)],..._0x3ac008[_0x351cb1(0x26f)]!==undefined&&{'all_columns':_0x3ac008[_0x351cb1(0x26f)]},..._0x3ac008[_0x351cb1(0x1ef)]!==undefined&&{'columns':_0x3ac008[_0x351cb1(0x1ef)]},..._0x3ac008['behavior']!==undefined&&{'behavior':_0x3ac008[_0x351cb1(0x1e5)]},..._0x3ac008['schedule']!==undefined&&{'schedule':_0x3ac008[_0x351cb1(0x290)]},..._0x3ac008[_0x351cb1(0x1f7)]!==undefined&&{'notification':_0x3ac008[_0x351cb1(0x1f7)]},..._0x3ac008[_0x351cb1(0x28b)]!==undefined&&{'connector_config':_0x3ac008[_0x351cb1(0x28b)]},..._0x3ac008[_0x351cb1(0x1ff)]!==undefined&&{'activation_template_id':_0x3ac008[_0x351cb1(0x1ff)]}};return stableStringify(_0x750aeb);}export async function prepareSegmentFiles(_0x339991,_0x20f943,_0x44fddf,_0x1fb93a,_0x1e27e8){const _0x83487e=a119_0x5aaea3,{activationDefToCreateRequest:_0x4e9f47}=await import(_0x83487e(0x29c)),_0x185493=[],_0x5a7164=new Set();for(const {yamlConfig:_0x57c80f,folderPath:_0x3542a5,sourcePath:_0x3509a2}of _0x339991){const _0x834854=resolveTDFolderPath(_0x3542a5,_0x1fb93a,_0x1e27e8),_0x446376=_0x834854+':'+_0x57c80f[_0x83487e(0x1c2)],_0x369d75=_0x20f943['segmentByFolderAndName'][_0x83487e(0x1d1)](_0x446376),_0x390282=_0x369d75?_0x20f943[_0x83487e(0x214)][_0x83487e(0x1d1)](_0x369d75['id'])||[]:[];addFoldersToCreate(_0x834854,_0x20f943[_0x83487e(0x295)],_0x5a7164);const _0x19d6f7=calculateActivationActions(_0x57c80f[_0x83487e(0x265)]||[],_0x390282,_0x20f943[_0x83487e(0x1be)],_0x20f943[_0x83487e(0x1c5)]);for(const _0x3d6cc1 of _0x19d6f7){(_0x3d6cc1[_0x83487e(0x217)]===_0x83487e(0x1af)||_0x3d6cc1[_0x83487e(0x217)]==='update')&&_0x3d6cc1[_0x83487e(0x1dd)]&&(_0x3d6cc1[_0x83487e(0x209)]=await _0x4e9f47(_0x3d6cc1['yamlActivation'],_0x44fddf));}const _0x143c32=calculateSegmentDiff(_0x57c80f,_0x369d75,_0x390282,_0x20f943[_0x83487e(0x1be)],_0x20f943['connectionIdToNameMap']);_0x185493['push']({'relativePath':_0x57c80f['name'],'absolutePath':_0x3509a2,'yamlConfig':_0x57c80f,'folderPath':_0x834854,'existingSegment':_0x369d75,'existingActivations':_0x390282,'isNew':_0x143c32['isNew'],'hasChanges':_0x143c32[_0x83487e(0x1e2)],'diff':_0x143c32[_0x83487e(0x289)],'activationActions':_0x19d6f7});}return{'segmentFiles':_0x185493,'foldersToCreate':_0x5a7164};}export async function prepareJourneyFiles(_0x4bdae2,_0x236e14,_0x40f3b3,_0x351f14){const _0x547606=a119_0x5aaea3,_0x4a7a28=[],_0x312f3f=new Set();for(const {yamlConfig:_0x4ef37f,folderPath:_0x82ca5c,sourcePath:_0xcdc779}of _0x4bdae2){const _0x45a049=resolveTDFolderPath(_0x82ca5c,_0x40f3b3,_0x351f14),_0xddff86=_0x45a049+':'+_0x4ef37f['name'],_0x30950f=_0x236e14[_0x547606(0x1f0)][_0x547606(0x1d1)](_0xddff86);let _0x1b87f3,_0x3e76c7;if(_0x30950f&&_0x30950f[_0x547606(0x1b0)]>0x0){const _0x5d9b5f=buildLocalExpandedRuleMappings(_0x4ef37f),{createYamlContext:_0x39853b,prefetchJourneySegments:_0x4a054b}=createPushYamlContextForBundle(_0x236e14[_0x547606(0x242)],_0x236e14[_0x547606(0x229)],_0x236e14[_0x547606(0x20d)],_0x5d9b5f,_0x236e14['idToEmailMap'],_0x236e14['connectionIdToNameMap'],_0x236e14[_0x547606(0x1df)],_0x236e14[_0x547606(0x25d)]);await _0x4a054b(_0x30950f[_0x547606(0x273)](_0x41ae6c=>_0x41ae6c['id']));const _0x3069f1=hasMultipleVersions(_0x4ef37f),_0x5630a5=async _0x3b6cc5=>{const _0x19155c=_0x547606,_0x50f2ac=_0x236e14[_0x19155c(0x25d)]?.[_0x19155c(0x1d1)](_0x3b6cc5);if(_0x50f2ac)return _0x50f2ac;return _0x236e14[_0x19155c(0x210)]({'journeyId':_0x3b6cc5,'journeyName':_0x4ef37f[_0x19155c(0x1c2)],'isMultiVersion':_0x30950f['length']>0x1});};if(_0x3069f1&&_0x30950f[_0x547606(0x1b0)]>0x1){const _0x51faa9=[];for(const _0x2c133d of _0x30950f){const _0x1e0a50=_0x2c133d['versionNumber']||0x1;_0x236e14['progress']?.['update'](_0x547606(0x1bf)+_0x4ef37f[_0x547606(0x1c2)]+'\x20v'+_0x1e0a50);const _0x5cce50=await _0x5630a5(_0x2c133d['id']),_0x47af40=_0x39853b(_0x2c133d['id']),_0x4bafa1=await journeyResponseToDef(_0x5cce50,_0x47af40);_0x51faa9['push']({'item':_0x2c133d,'yaml':_0x4bafa1});}const _0x445023=buildLocalRuleToNameMappingFromJourney(_0x4ef37f);_0x3e76c7=buildMergedJourneyDef(_0x51faa9,_0x445023);const _0x48c9ad=Math['max'](..._0x51faa9[_0x547606(0x273)](_0x59acd7=>_0x59acd7[_0x547606(0x1db)]['versionNumber']||0x0)),_0x2f8137=_0x30950f[_0x547606(0x286)](_0x9d3a22=>(_0x9d3a22[_0x547606(0x1d7)]||0x0)===_0x48c9ad);_0x2f8137&&(_0x236e14[_0x547606(0x1d5)]?.[_0x547606(0x25b)](_0x547606(0x1bf)+_0x4ef37f[_0x547606(0x1c2)]+'\x20v'+_0x48c9ad),_0x1b87f3=await _0x5630a5(_0x2f8137['id']));}else{const _0x18e6eb=_0x30950f[_0x30950f[_0x547606(0x1b0)]-0x1];_0x236e14[_0x547606(0x1d5)]?.[_0x547606(0x25b)]('Fetching\x20'+_0x4ef37f[_0x547606(0x1c2)]),_0x1b87f3=await _0x5630a5(_0x18e6eb['id']);const _0x48e012=_0x39853b(_0x18e6eb['id']),_0x224940=await journeyResponseToDef(_0x1b87f3,_0x48e012),_0xbefdd5=buildLocalRuleToNameMappingFromJourney(_0x4ef37f);_0x3e76c7=buildMergedJourneyDef([{'item':_0x18e6eb,'yaml':_0x224940}],_0xbefdd5);}}addFoldersToCreate(_0x45a049,_0x236e14[_0x547606(0x295)],_0x312f3f);const _0x57e68e=calculateJourneyDiff(_0x4ef37f,_0x3e76c7);_0x4a7a28[_0x547606(0x1bc)]({'relativePath':_0x4ef37f[_0x547606(0x1c2)],'absolutePath':_0xcdc779,'yamlConfig':_0x4ef37f,'folderPath':_0x45a049,'existingJourney':_0x1b87f3,'isNew':_0x57e68e[_0x547606(0x1ad)],'hasChanges':_0x57e68e[_0x547606(0x1e2)],'diff':_0x57e68e['diff']});}return{'journeyFiles':_0x4a7a28,'foldersToCreate':_0x312f3f};}export function calculateActivationActions(_0x48abde,_0x414a05,_0x214f19,_0x408b34){const _0x5b8b06=a119_0x5aaea3,_0x5d53d6=[],_0x1f6a16=new Map();for(const _0x23213d of _0x414a05){_0x1f6a16[_0x5b8b06(0x266)](_0x23213d['name'],_0x23213d);}const _0x558d4f=new Map();for(const _0x3b9431 of _0x48abde){_0x558d4f[_0x5b8b06(0x266)](_0x3b9431['name'],_0x3b9431);}for(const _0x21e925 of _0x48abde){const _0x380cb2=_0x1f6a16[_0x5b8b06(0x1d1)](_0x21e925['name']);if(!_0x380cb2)_0x5d53d6[_0x5b8b06(0x1bc)]({'type':_0x5b8b06(0x1af),'name':_0x21e925[_0x5b8b06(0x1c2)],'yamlActivation':_0x21e925});else{const _0x1bb64f=activationResponseToDef(_0x380cb2,_0x214f19,_0x408b34),_0x56bf5e=a119_0x118109[_0x5b8b06(0x1ea)](_0x1bb64f),_0x14da83=a119_0x118109[_0x5b8b06(0x1ea)](_0x21e925);_0x56bf5e!==_0x14da83&&_0x5d53d6[_0x5b8b06(0x1bc)]({'type':_0x5b8b06(0x25b),'name':_0x21e925['name'],'yamlActivation':_0x21e925,'existingActivation':_0x380cb2});}}for(const _0x252364 of _0x414a05){!_0x558d4f[_0x5b8b06(0x213)](_0x252364[_0x5b8b06(0x1c2)])&&_0x5d53d6[_0x5b8b06(0x1bc)]({'type':_0x5b8b06(0x275),'name':_0x252364[_0x5b8b06(0x1c2)],'existingActivation':_0x252364});}return _0x5d53d6;}export function calculateSegmentDiff(_0x492081,_0x179b7c,_0x1db689,_0x3e7bfc,_0x3a3321){const _0x10db52=segmentToYamlString(_0x492081);if(_0x179b7c){const _0x18937e=segmentWithActivationsToYaml(_0x179b7c,_0x1db689,undefined,_0x3e7bfc,_0x3a3321),_0x758507=segmentToYamlString(_0x18937e),_0x31d58a=generateDiff(_0x758507,_0x10db52),_0x631456=hasChanges(_0x31d58a);return{'isNew':![],'hasChanges':_0x631456,'diff':_0x631456?formatDiffWithColors(_0x31d58a):undefined};}const _0x1ab541=generateDiff('',_0x10db52);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1ab541)};}export function calculateJourneyDiff(_0x30a1ef,_0x2b1d65){const _0x27540c=normalizeJourneyDef(_0x30a1ef,_0x30a1ef),_0x228939=a119_0xdbc581(_0x27540c);if(_0x2b1d65){const _0x2d5fe0=normalizeJourneyDef(_0x2b1d65,_0x30a1ef),_0x3dde86=a119_0xdbc581(_0x2d5fe0),_0x3dde62=generateDiff(_0x3dde86,_0x228939),_0x59ada7=hasChanges(_0x3dde62);return{'isNew':![],'hasChanges':_0x59ada7,'diff':_0x59ada7?formatDiffWithColors(_0x3dde62):undefined};}const _0x2fefe6=generateDiff('',_0x228939);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2fefe6)};}export function findSegmentsToDelete(_0x3ac820,_0x2fcdcc,_0x38f8fc,_0x3adb12,_0x1fed54){const _0x161273=a119_0x5aaea3,_0x54dca9=new Set();for(const {yamlConfig:_0x4a0655,folderPath:_0x3312eb}of _0x2fcdcc){_0x54dca9[_0x161273(0x20b)](_0x3312eb+':'+_0x4a0655[_0x161273(0x1c2)]);}return _0x3ac820[_0x161273(0x222)](_0x54c85b=>{const _0x2d3abe=_0x161273,_0x117c4d=_0x54c85b[_0x2d3abe(0x218)]?_0x38f8fc['get'](_0x54c85b[_0x2d3abe(0x218)][_0x2d3abe(0x1c4)]())||'':'',_0xbe4c=_0x117c4d+':'+_0x54c85b[_0x2d3abe(0x1c2)];if(_0x54dca9[_0x2d3abe(0x213)](_0xbe4c))return![];if(_0x1fed54)return _0x117c4d===_0x3adb12||_0x117c4d[_0x2d3abe(0x1e8)](_0x3adb12+'/');return!![];});}export function findJourneysToDelete(_0x13440a,_0x201d64,_0x5473fe,_0x34b2cb,_0x144cda){const _0x34dac7=a119_0x5aaea3,_0x3037c7=new Set();for(const {yamlConfig:_0x41afc4,folderPath:_0x3992a6}of _0x201d64){_0x3037c7['add'](_0x3992a6+':'+_0x41afc4[_0x34dac7(0x1c2)]);}return _0x13440a[_0x34dac7(0x222)](_0x1c4850=>{const _0x4c24b8=_0x34dac7,_0x4901fd=_0x1c4850['folderId']?_0x5473fe[_0x4c24b8(0x1d1)](_0x1c4850[_0x4c24b8(0x21a)])||'':'',_0x1c53a=_0x4901fd+':'+_0x1c4850[_0x4c24b8(0x1ce)];if(_0x3037c7[_0x4c24b8(0x213)](_0x1c53a))return![];if(_0x144cda)return _0x4901fd===_0x34b2cb||_0x4901fd[_0x4c24b8(0x1e8)](_0x34b2cb+'/');return!![];});}export function buildSegmentLookupMap(_0x5d7440,_0x4d6b8c){const _0x5678a1=a119_0x5aaea3,_0x1932d8=new Map();for(const _0x565d80 of _0x5d7440){const _0x47ed52=_0x565d80[_0x5678a1(0x218)]?_0x4d6b8c[_0x5678a1(0x1d1)](_0x565d80['segmentFolderId'][_0x5678a1(0x1c4)]())||'':'',_0x3ee24d=_0x47ed52+':'+_0x565d80[_0x5678a1(0x1c2)];_0x1932d8['set'](_0x3ee24d,_0x565d80);}return _0x1932d8;}export function buildSegmentNameToIdMap(_0x46f28d){const _0x7ecda7=a119_0x5aaea3,_0x1693d8=new Map();for(const _0xda0ed0 of _0x46f28d){_0x1693d8[_0x7ecda7(0x266)](_0xda0ed0[_0x7ecda7(0x1c2)],_0xda0ed0['id']);}return _0x1693d8;}export function buildJourneyBundleLookupMap(_0x5b2184,_0x180a72){const _0x2cb208=a119_0x5aaea3,_0x8d35e9=new Map();for(const _0x288a99 of _0x5b2184){const _0x30c743=_0x288a99[_0x2cb208(0x21a)]?_0x180a72[_0x2cb208(0x1d1)](_0x288a99[_0x2cb208(0x21a)])||'':'',_0x2a5c22=_0x30c743+':'+_0x288a99[_0x2cb208(0x1ce)];!_0x8d35e9['has'](_0x2a5c22)&&_0x8d35e9['set'](_0x2a5c22,[]),_0x8d35e9[_0x2cb208(0x1d1)](_0x2a5c22)[_0x2cb208(0x1bc)](_0x288a99);}for(const _0x533a62 of _0x8d35e9[_0x2cb208(0x25f)]()){_0x533a62[_0x2cb208(0x231)]((_0x2dd7b7,_0x4983aa)=>(_0x2dd7b7['versionNumber']||0x0)-(_0x4983aa[_0x2cb208(0x1d7)]||0x0));}return _0x8d35e9;}export function collectFoldersToCreate(_0x4d9462,_0xae2c8e){const _0x42f26c=a119_0x5aaea3,_0x23eaf2=new Set();for(const _0x1d3aed of _0x4d9462){if(!_0x1d3aed)continue;if(_0xae2c8e[_0x42f26c(0x213)](_0x1d3aed))continue;const _0x14f881=_0x1d3aed['split']('/');let _0x53d9f0='';for(const _0x28336b of _0x14f881){_0x53d9f0=_0x53d9f0?_0x53d9f0+'/'+_0x28336b:_0x28336b,!_0xae2c8e[_0x42f26c(0x213)](_0x53d9f0)&&_0x23eaf2[_0x42f26c(0x20b)](_0x53d9f0);}}return _0x23eaf2;}export function parseAndClassifyYamlFiles(_0x2aad26,_0x44dfcb,_0x4f4275){const _0x1449d1=a119_0x5aaea3,_0x98b514=[],_0x15ea9b=[];for(const _0x4464ec of _0x2aad26){const _0x2f5ec5=a119_0x494925[_0x1449d1(0x205)](_0x44dfcb,a119_0x494925[_0x1449d1(0x1e0)](_0x4464ec)),_0x4bc81d=_0x2f5ec5==='.'?'':_0x2f5ec5,_0x355d0b=readFileSync(_0x4464ec,_0x1449d1(0x21b)),_0x2b5369=a119_0x118109['parse'](_0x355d0b);if(isJourneyDef(_0x2b5369)){const _0x24ae69=a119_0x5f2407(_0x355d0b);_0x15ea9b[_0x1449d1(0x1bc)]({'yamlConfig':_0x24ae69,'folderPath':_0x4bc81d,'sourcePath':_0x4464ec});}else{if(!_0x4f4275?.[_0x1449d1(0x270)]){const _0x4a79fb=parseSegmentYamlFile(_0x355d0b),_0x1ad985=normalizeChildSegmentYaml(_0x4a79fb);_0x98b514['push']({'yamlConfig':_0x1ad985,'folderPath':_0x4bc81d,'sourcePath':_0x4464ec});}}}return{'segments':_0x98b514,'journeys':_0x15ea9b};}export function validateParsedFiles(_0x297932,_0x56e747){const _0x5a63d8=a119_0x5aaea3,_0xe0928=[];for(const {yamlConfig:_0x4397f3,sourcePath:_0x366fb2}of _0x297932[_0x5a63d8(0x1f3)]){const _0x42949c=readFileSync(_0x366fb2,_0x5a63d8(0x21b)),_0x2249e6=a119_0x118109[_0x5a63d8(0x263)](_0x42949c),_0xa70ff6=validateSegmentDef(_0x4397f3,{'source':_0x42949c,'document':_0x2249e6});if(!_0xa70ff6[_0x5a63d8(0x1f5)]){const _0x3eac68=a119_0x494925[_0x5a63d8(0x205)](_0x56e747,_0x366fb2);_0xe0928['push']({'filePath':_0x3eac68,'source':_0x42949c,'result':_0xa70ff6,'isJourney':![]});}}for(const {yamlConfig:_0x1c2613,sourcePath:_0x55106d}of _0x297932[_0x5a63d8(0x1f1)]){const _0x346479=readFileSync(_0x55106d,_0x5a63d8(0x21b)),_0x265f05=a119_0x118109[_0x5a63d8(0x263)](_0x346479),_0x59467d=validateJourneyDef(_0x1c2613,{'source':_0x346479,'document':_0x265f05});if(!_0x59467d['valid']){const _0x58e13a=a119_0x494925[_0x5a63d8(0x205)](_0x56e747,_0x55106d);_0xe0928[_0x5a63d8(0x1bc)]({'filePath':_0x58e13a,'source':_0x346479,'result':_0x59467d,'isJourney':!![]});}}return _0xe0928;}export function formatValidationErrors(_0x49d82a){const _0x2b2282=a119_0x5aaea3,_0x280881=[];for(const {filePath:_0x31d946,source:_0x50c7fd,result:_0x468f1e,isJourney:_0xc0f69c}of _0x49d82a){const _0x307166=_0xc0f69c?_0x2b2282(0x22a):'segment';_0x280881[_0x2b2282(0x1bc)]('\x0a'+_0x31d946+'\x20('+_0x307166+_0x2b2282(0x1d3)+_0x468f1e['errors'][_0x2b2282(0x1b0)]+_0x2b2282(0x1e1)),_0x280881[_0x2b2282(0x1bc)](formatValidationResult(_0x468f1e,_0x50c7fd,_0x31d946));}return _0x280881[_0x2b2282(0x1f6)]('\x0a');}function a119_0x5cd8(_0x61092d,_0x215eed){_0x61092d=_0x61092d-0x1ac;const _0x2bac4e=a119_0x2bac();let _0x5cd844=_0x2bac4e[_0x61092d];return _0x5cd844;}export function buildLocalExpandedRuleMappings(_0x367580){const _0x2d2c97=a119_0x5aaea3,_0x1b46e6=new Set(),_0x65a904=new Map(),_0x285752=collectSegmentUsageCounts(_0x367580);if(_0x367580[_0x2d2c97(0x1f3)])for(const [_0xf5f8ff,_0x3104d4]of Object[_0x2d2c97(0x249)](_0x367580[_0x2d2c97(0x1f3)])){_0x1b46e6['add'](_0xf5f8ff);if(_0x3104d4[_0x2d2c97(0x250)]){const _0xe983b4=yamlRuleToApi(_0x3104d4[_0x2d2c97(0x250)]),_0x4ebfb8=apiRuleToYaml(_0xe983b4);_0x65a904[_0x2d2c97(0x266)](_0xf5f8ff,_0x4ebfb8);}}const _0x432958=new Map();let _0x3eafca=0x0;for(const [_0xb2dc60,_0x46fb6f]of _0x65a904){const _0x570d50=serializeExpandedRule(_0x46fb6f,_0x65a904),_0x2e193c=_0x432958[_0x2d2c97(0x1d1)](_0x570d50)||[];_0x2e193c[_0x2d2c97(0x1bc)]({'name':_0xb2dc60,'index':_0x3eafca}),_0x432958[_0x2d2c97(0x266)](_0x570d50,_0x2e193c),_0x3eafca++;}const _0x38bda0=new Map();for(const [_0x1d24a0,_0x2635bf]of _0x432958){const _0x2c839e=_0x2635bf[_0x2d2c97(0x211)]()[_0x2d2c97(0x231)]((_0x41956c,_0x4da91d)=>{const _0x37cf9a=_0x2d2c97,_0x53e63e=_0x285752[_0x37cf9a(0x1d1)](_0x41956c[_0x37cf9a(0x1c2)])||0x0,_0x492038=_0x285752['get'](_0x4da91d['name'])||0x0;if(_0x53e63e!==_0x492038)return _0x492038-_0x53e63e;return _0x41956c[_0x37cf9a(0x26b)]-_0x4da91d[_0x37cf9a(0x26b)];})['map'](_0x14b13d=>_0x14b13d[_0x2d2c97(0x1c2)]),_0xa57957=[];for(const _0x443ff6 of _0x2c839e){const _0x9792bd=_0x285752[_0x2d2c97(0x1d1)](_0x443ff6)||0x0,_0x404c73=Math[_0x2d2c97(0x226)](_0x9792bd,0x1);for(let _0x4faa85=0x0;_0x4faa85<_0x404c73;_0x4faa85++){_0xa57957[_0x2d2c97(0x1bc)](_0x443ff6);}}_0x38bda0[_0x2d2c97(0x266)](_0x1d24a0,_0xa57957);}return{'existingLocalSegmentNames':_0x1b46e6,'localSegmentRules':_0x65a904,'localExpandedRuleToNames':_0x38bda0};}async function buildServerSegmentRuleMap(_0x1aa099,_0x13bbd1,_0x5bb5ec,_0x415b03){const _0x5043c7=new Map(),_0x53ef47=new Set(),_0x51f735=async _0x382ae9=>{const _0x28dc0e=a119_0x5cd8;if(_0x53ef47[_0x28dc0e(0x213)](_0x382ae9))return;_0x53ef47['add'](_0x382ae9);let _0x54e4a6=_0x5bb5ec['find'](_0x53dd94=>_0x53dd94['id']===_0x382ae9);if(!_0x54e4a6)try{_0x54e4a6=await _0x1aa099[_0x28dc0e(0x1ca)][_0x28dc0e(0x29a)](_0x13bbd1,_0x382ae9);}catch{return;}if(!_0x54e4a6?.[_0x28dc0e(0x250)])return;const _0x423a3f=apiRuleToYaml(_0x54e4a6[_0x28dc0e(0x250)]);_0x5043c7[_0x28dc0e(0x266)](_0x382ae9,_0x423a3f);const _0x2fa8b3=collectSegmentRefsFromRule(_0x423a3f);for(const _0x4e7797 of _0x2fa8b3){await _0x51f735(_0x4e7797);}};for(const _0x1b4783 of _0x415b03){await _0x51f735(_0x1b4783);}return _0x5043c7;}export function createSegmentIdResolver(_0xa68959,_0x1567c4){return async _0x399dc7=>{const _0x1e8d5d=a119_0x5cd8,_0x4e4a75=_0xa68959[_0x1e8d5d(0x1d1)](_0x399dc7);if(!_0x4e4a75)throw new SDKError(ErrorCode[_0x1e8d5d(0x1b4)],_0x1e8d5d(0x1b9)+_0x399dc7+_0x1e8d5d(0x1fa)+_0x1567c4+'\x27)');return _0x4e4a75;};}export function extractRootFolderId(_0x413e3c){const _0x56a126=a119_0x5aaea3;return _0x413e3c['relationships']?.[_0x56a126(0x26c)]?.[_0x56a126(0x23b)]?.['id']||_0x413e3c[_0x56a126(0x28c)]?.[_0x56a126(0x271)]?.['data']?.['id'];}export function buildConnectionMaps(_0x1ef53c){const _0x1adf4c=a119_0x5aaea3,_0x368954=new Map(),_0x3e4b3b=new Map(),_0x2db596=new Map();for(const _0x374d5f of _0x1ef53c){_0x368954[_0x1adf4c(0x266)](_0x374d5f[_0x1adf4c(0x1c2)],parseInt(_0x374d5f['id'],0xa)),_0x3e4b3b['set'](_0x374d5f['id'],_0x374d5f['name']),_0x2db596[_0x1adf4c(0x266)](_0x374d5f[_0x1adf4c(0x1c2)],_0x374d5f[_0x1adf4c(0x217)]);}return{'nameToId':_0x368954,'idToName':_0x3e4b3b,'nameToType':_0x2db596};}export function calculatePushStats(_0x17b642,_0x11294b,_0x4f769c,_0x5ea87b,_0x3d4647,_0x279ea8,_0x695312){const _0x4eaa2e=a119_0x5aaea3,_0x593a5b=_0x17b642[_0x4eaa2e(0x222)](_0x3b3533=>_0x3b3533[_0x4eaa2e(0x1ad)]),_0x512349=_0x17b642[_0x4eaa2e(0x222)](_0x26eeec=>!_0x26eeec[_0x4eaa2e(0x1ad)]&&_0x26eeec['hasChanges']),_0x50ebd1=_0x17b642[_0x4eaa2e(0x222)](_0x4137b8=>!_0x4137b8[_0x4eaa2e(0x1ad)]&&!_0x4137b8['hasChanges']),_0x5243e5=_0x279ea8?_0x5ea87b:[],_0x527d0a=_0x11294b[_0x4eaa2e(0x222)](_0x5b7249=>_0x5b7249[_0x4eaa2e(0x1ad)]),_0x3bc95d=_0x11294b['filter'](_0x569f39=>!_0x569f39[_0x4eaa2e(0x1ad)]&&_0x569f39[_0x4eaa2e(0x1e2)]),_0x1187eb=_0x11294b[_0x4eaa2e(0x222)](_0x3f2566=>!_0x3f2566['isNew']&&!_0x3f2566['hasChanges']),_0x26c6d3=_0x279ea8?_0x3d4647:[],_0x540441=_0x17b642[_0x4eaa2e(0x272)](_0x5d5444=>_0x5d5444[_0x4eaa2e(0x1bd)]),_0x47c82d=_0x540441[_0x4eaa2e(0x222)](_0x466f1e=>_0x466f1e[_0x4eaa2e(0x217)]===_0x4eaa2e(0x1af)),_0xc6b8c7=_0x540441['filter'](_0x33ef42=>_0x33ef42['type']===_0x4eaa2e(0x25b)),_0x231eaf=_0x540441[_0x4eaa2e(0x222)](_0x3c1842=>_0x3c1842[_0x4eaa2e(0x217)]===_0x4eaa2e(0x275)),_0x448115=Array[_0x4eaa2e(0x27b)](_0x4f769c)['sort'](),_0x1952b6=_0x695312?![]:_0x593a5b[_0x4eaa2e(0x1b0)]>0x0||_0x512349['length']>0x0||_0x5243e5[_0x4eaa2e(0x1b0)]>0x0,_0x43299d=_0x527d0a[_0x4eaa2e(0x1b0)]>0x0||_0x3bc95d['length']>0x0||_0x26c6d3['length']>0x0,_0x4dba67=_0x695312?![]:_0x540441[_0x4eaa2e(0x1b0)]>0x0,_0x12737b=_0x448115[_0x4eaa2e(0x1b0)]>0x0;return{'segments':{'new':_0x593a5b,'changed':_0x512349,'unchanged':_0x50ebd1,'toDelete':_0x5243e5},'journeys':{'new':_0x527d0a,'changed':_0x3bc95d,'unchanged':_0x1187eb,'toDelete':_0x26c6d3},'activations':{'all':_0x540441,'toCreate':_0x47c82d,'toUpdate':_0xc6b8c7,'toDelete':_0x231eaf},'folders':{'toCreate':_0x448115},'counts':{'segments':{'new':_0x593a5b[_0x4eaa2e(0x1b0)],'changed':_0x512349['length'],'unchanged':_0x50ebd1[_0x4eaa2e(0x1b0)],'toDelete':_0x5243e5[_0x4eaa2e(0x1b0)]},'journeys':{'new':_0x527d0a[_0x4eaa2e(0x1b0)],'changed':_0x3bc95d['length'],'unchanged':_0x1187eb[_0x4eaa2e(0x1b0)],'toDelete':_0x26c6d3[_0x4eaa2e(0x1b0)]},'activations':{'create':_0x47c82d[_0x4eaa2e(0x1b0)],'update':_0xc6b8c7[_0x4eaa2e(0x1b0)],'delete':_0x231eaf[_0x4eaa2e(0x1b0)]},'folders':_0x448115[_0x4eaa2e(0x1b0)]},'hasChanges':_0x1952b6||_0x43299d||_0x4dba67||_0x12737b};}export async function buildPushExecutionContext(_0x2f7a61,_0x3c75c7,_0x9e55f6,_0x27b468,_0x506517,_0x1fa34c){const _0x4ffba3=a119_0x5aaea3,_0x162291=extractRootFolderId(_0x9e55f6),{pathToId:_0x5471af,idToPath:_0x3809b5}=buildFolderMaps(_0x506517),_0x47797b=buildSegmentNameToIdMap(_0x27b468),_0x424e25=new Map(),{batchAsync:_0x48827b}=await import(_0x4ffba3(0x223)),[_0x29b781,_0x5f41e7]=await Promise['all']([_0x2f7a61[_0x4ffba3(0x1fc)][_0x4ffba3(0x227)](),_0x2f7a61[_0x4ffba3(0x1c6)][_0x4ffba3(0x251)](),((async()=>{!_0x1fa34c&&_0x27b468['length']>0x0&&await _0x48827b(_0x27b468,async _0x3f4302=>{const _0x43db51=a119_0x5cd8,_0x13319e=await _0x2f7a61[_0x43db51(0x1ca)]['listActivations'](_0x3c75c7,_0x3f4302['id']);_0x424e25[_0x43db51(0x266)](_0x3f4302['id'],_0x13319e);});})())]),{emailToId:_0x5d1f9a,idToEmail:_0x51cd73}=_0x29b781,_0x7b26b4=buildConnectionMaps(_0x5f41e7);return{'rootFolderId':_0x162291,'folderPathToId':_0x5471af,'folderIdToPath':_0x3809b5,'segmentNameToId':_0x47797b,'activationsBySegmentId':_0x424e25,'emailToIdMap':_0x5d1f9a,'idToEmailMap':_0x51cd73,'connectionNameToIdMap':_0x7b26b4[_0x4ffba3(0x288)],'connectionIdToNameMap':_0x7b26b4[_0x4ffba3(0x21f)],'connectionNameToTypeMap':_0x7b26b4[_0x4ffba3(0x284)]};}export function createPushYamlContextForBundle(_0x234b90,_0x37d6a2,_0xc1d3d9,_0x456e8d,_0x19b088,_0x2dad62,_0x16fd42,_0x10eb8f){const {existingLocalSegmentNames:_0x5d3541,localExpandedRuleToNames:_0x1f6dbb}=_0x456e8d,_0x57b7d4=new Set(),_0x2040a0=new Map(),_0x3662c9=new Map(),_0x288bbc=new Map(),_0xe6fd10=createJumpTargetCache(),_0x388945=new Map(),_0x35d8c0=new Map(),_0x14bc65=new Set();let _0x51afb1;const _0x3c6d11=_0x1a5242=>{const _0x348143={'resolveSegment':async _0x122a54=>{const _0x199ec8=a119_0x5cd8,_0x99192a=_0x288bbc['get'](_0x122a54);if(_0x99192a!==undefined)return{'name':_0x99192a,'isJourneyLocal':!![]};try{let _0xb43a01=_0xc1d3d9[_0x199ec8(0x286)](_0x259ce2=>_0x259ce2['id']===_0x122a54);!_0xb43a01&&(_0xb43a01=await _0x234b90[_0x199ec8(0x1ca)][_0x199ec8(0x29a)](_0x37d6a2,_0x122a54));const _0x5339ef=generateJourneyLocalName(_0xb43a01[_0x199ec8(0x1c2)]),_0x58057b=_0xb43a01[_0x199ec8(0x278)]===SEGMENT_KIND_JOURNEY&&_0x5339ef!==undefined;let _0x2ffc60=_0xb43a01[_0x199ec8(0x1c2)],_0x1eb9f3;if(_0x58057b&&_0xb43a01[_0x199ec8(0x250)]){const _0x4622c4=apiRuleToYaml(_0xb43a01[_0x199ec8(0x250)]);_0x35d8c0[_0x199ec8(0x266)](_0x122a54,_0x4622c4);const _0x57d4a0=async _0x9f3461=>{const _0x479b22=_0x199ec8,_0x33ed44=collectSegmentRefsFromRule(_0x9f3461);for(const _0x441278 of _0x33ed44){if(!_0x35d8c0[_0x479b22(0x213)](_0x441278))try{const _0x37c7cb=await _0x234b90[_0x479b22(0x1ca)]['getSegment'](_0x37d6a2,_0x441278);if(_0x37c7cb?.[_0x479b22(0x250)]){const _0x8ef071=apiRuleToYaml(_0x37c7cb[_0x479b22(0x250)]);_0x35d8c0[_0x479b22(0x266)](_0x441278,_0x8ef071),await _0x57d4a0(_0x8ef071);}}catch{}}};await _0x57d4a0(_0x4622c4);const _0x269b16=serializeExpandedRule(_0x4622c4,_0x35d8c0),_0x3c52b6=_0x1f6dbb[_0x199ec8(0x1d1)](_0x269b16);if(_0x3c52b6&&_0x3c52b6['length']>0x0){const _0x187106=_0x2040a0[_0x199ec8(0x1d1)](_0x269b16)||0x0,_0xe108b4=_0x3c52b6[_0x187106]||_0x3c52b6[_0x3c52b6[_0x199ec8(0x1b0)]-0x1];_0x2040a0[_0x199ec8(0x266)](_0x269b16,_0x187106+0x1),_0x2ffc60=_0xe108b4,_0x57b7d4[_0x199ec8(0x20b)](_0x2ffc60),_0x288bbc[_0x199ec8(0x266)](_0x122a54,_0x2ffc60);const _0x5d7839=await resolveRuleSegmentRefs(_0x4622c4,async _0x3d45f5=>{const _0x14d5f1=_0x199ec8,_0x41fb6d=_0x288bbc[_0x14d5f1(0x1d1)](_0x3d45f5);if(_0x41fb6d)return _0x41fb6d;const _0x2aff25=await _0x51afb1[_0x14d5f1(0x207)](_0x3d45f5);return _0x2aff25['name'];});_0x1eb9f3={'description':_0xb43a01[_0x199ec8(0x21d)],'rule':_0x5d7839};}else{const _0x142253=_0x388945[_0x199ec8(0x1d1)](_0x269b16);if(_0x142253)_0x2ffc60=_0x142253,_0x288bbc[_0x199ec8(0x266)](_0x122a54,_0x2ffc60);else{if(_0x5339ef){let _0x8488e0=_0x5339ef,_0x480765=0x2;while(_0x57b7d4[_0x199ec8(0x213)](_0x8488e0)||_0x5d3541[_0x199ec8(0x213)](_0x8488e0)){_0x8488e0=_0x5339ef+'_'+_0x480765,_0x480765++;}_0x57b7d4[_0x199ec8(0x20b)](_0x8488e0),_0x2ffc60=_0x8488e0;}_0x288bbc[_0x199ec8(0x266)](_0x122a54,_0x2ffc60),_0x388945[_0x199ec8(0x266)](_0x269b16,_0x2ffc60);const _0x42d7ca=await resolveRuleSegmentRefs(_0x4622c4,async _0x4cf44f=>{const _0x406dee=_0x199ec8,_0x1dc510=_0x288bbc[_0x406dee(0x1d1)](_0x4cf44f);if(_0x1dc510)return _0x1dc510;const _0x34691=await _0x51afb1[_0x406dee(0x207)](_0x4cf44f);return _0x34691[_0x406dee(0x1c2)];});_0x1eb9f3={'description':_0xb43a01[_0x199ec8(0x21d)],'rule':_0x42d7ca};}}}return{'name':_0x2ffc60,'isJourneyLocal':_0x58057b,'definition':_0x1eb9f3};}catch{return{'name':_0x122a54,'isJourneyLocal':![]};}},'resolveActivation':async _0x599063=>{const _0x46f7e6=a119_0x5cd8,_0x2c4c38=_0x3662c9[_0x46f7e6(0x1d1)](_0x599063);if(_0x2c4c38!==undefined)return{'name':_0x2c4c38,'isJourneyLocal':!![]};try{let _0xe931cc=_0x16fd42?.[_0x46f7e6(0x1d1)](_0x599063);!_0xe931cc&&(_0xe931cc=await _0x234b90[_0x46f7e6(0x22a)][_0x46f7e6(0x255)](_0x1a5242,_0x599063));const _0x23b92c=_0xe931cc[_0x46f7e6(0x24a)][_0x46f7e6(0x261)]['name']||_0x599063,_0x31646d=sanitizeYamlKey(_0x23b92c)||_0x46f7e6(0x233)+_0x599063,_0x3b40b4=_0x31646d;_0x3662c9['set'](_0x599063,_0x3b40b4);const _0x2e3ef5=journeyActivationStepToYaml(_0xe931cc,_0x19b088,_0x2dad62);return{'name':_0x3b40b4,'isJourneyLocal':!![],'definition':_0x2e3ef5};}catch{return{'name':_0x599063,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x461ecb,_0x5aeb41)=>resolveJumpTarget(_0x461ecb,_0x5aeb41,_0xe6fd10,async _0x4727d8=>{const _0x5274eb=a119_0x5cd8,_0x36af7e=_0x10eb8f?.['get'](_0x4727d8);if(_0x36af7e)return _0x36af7e;return _0x234b90[_0x5274eb(0x22a)][_0x5274eb(0x281)](_0x4727d8);})};return _0x51afb1=_0x348143,_0x348143;},_0x53c51f=async _0xc64557=>{const _0x36b500=a119_0x5cd8,{collectSegmentIdsFromJourneyApi:_0x153eed}=await import('./journey-yaml.js'),{batchAsync:_0x35ee8d}=await import(_0x36b500(0x223)),_0x15854c=new Set();for(const _0x15c5f7 of _0xc64557){let _0x36e7de=_0x10eb8f?.[_0x36b500(0x1d1)](_0x15c5f7);!_0x36e7de&&(_0x36e7de=await _0x234b90[_0x36b500(0x22a)][_0x36b500(0x281)](_0x15c5f7));const _0x50aad6=_0x153eed(_0x36e7de);for(const _0x378ae4 of _0x50aad6){_0x15854c['add'](_0x378ae4);}}let _0x44c540=Array[_0x36b500(0x27b)](_0x15854c);while(_0x44c540[_0x36b500(0x1b0)]>0x0){const _0x5dac6b=_0x44c540[_0x36b500(0x222)](_0x146db5=>!_0x14bc65[_0x36b500(0x213)](_0x146db5));if(_0x5dac6b[_0x36b500(0x1b0)]===0x0)break;const _0x4037aa=await _0x35ee8d(_0x5dac6b,async _0x5ddc45=>{const _0x2e4a86=_0x36b500;_0x14bc65['add'](_0x5ddc45);let _0x5af3e7=_0xc1d3d9[_0x2e4a86(0x286)](_0xb4c7a6=>_0xb4c7a6['id']===_0x5ddc45);if(!_0x5af3e7)try{_0x5af3e7=await _0x234b90[_0x2e4a86(0x1ca)][_0x2e4a86(0x29a)](_0x37d6a2,_0x5ddc45);}catch{return null;}return{'segmentId':_0x5ddc45,'segment':_0x5af3e7};},0xa),_0x35601d=new Set();for(const _0x1707a6 of _0x4037aa){if(!_0x1707a6?.[_0x36b500(0x1ca)]?.['rule'])continue;const _0x2bf15b=apiRuleToYaml(_0x1707a6[_0x36b500(0x1ca)][_0x36b500(0x250)]);_0x35d8c0[_0x36b500(0x266)](_0x1707a6[_0x36b500(0x283)],_0x2bf15b);const _0x3909c8=collectSegmentRefsFromRule(_0x2bf15b);for(const _0x50cbe9 of _0x3909c8){!_0x14bc65[_0x36b500(0x213)](_0x50cbe9)&&_0x35601d[_0x36b500(0x20b)](_0x50cbe9);}}_0x44c540=Array[_0x36b500(0x27b)](_0x35601d);}};return{'createYamlContext':_0x3c6d11,'prefetchJourneySegments':_0x53c51f};}export async function executePushSegments(_0x38ccc3,_0xa4348,_0x38668d,_0x51d6c7,_0x57bddc){const _0x544386=a119_0x5aaea3,{segmentDefToCreateRequest:_0xd4008a,segmentDefToUpdateRequest:_0xc2a599}=await import(_0x544386(0x29c)),_0x3f755b=_0x38668d[_0x544386(0x295)],_0x3a6c8d=0x5,_0x7b469d=async _0x15dc70=>{const _0x2beaba=_0x544386,_0x59bc30=_0x15dc70[_0x2beaba(0x280)]?_0x3f755b[_0x2beaba(0x1d1)](_0x15dc70['folderPath']):undefined;let _0x569011;const _0x5be887={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x15dc70[_0x2beaba(0x1ad)]){_0x57bddc[_0x2beaba(0x26d)]?.({'type':'segment_creating','name':_0x15dc70[_0x2beaba(0x285)]['name']});const _0x47a954=_0xd4008a(_0x15dc70[_0x2beaba(0x285)],_0x59bc30),_0x216ad7=await _0x57bddc[_0x2beaba(0x22c)](_0x2beaba(0x268)+_0x15dc70['yamlConfig']['name']+_0x2beaba(0x293),()=>_0x38ccc3[_0x2beaba(0x1ca)][_0x2beaba(0x200)](_0x51d6c7[_0x2beaba(0x229)],_0x47a954));_0x569011=_0x216ad7[_0x2beaba(0x23b)]['id'],_0x5be887[_0x2beaba(0x247)]={'name':_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)],'id':_0x569011},_0x57bddc[_0x2beaba(0x26d)]?.({'type':_0x2beaba(0x29b),'name':_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)],'segmentId':_0x569011}),_0x57bddc[_0x2beaba(0x1e4)]?.('Created\x20segment\x20\x27'+_0x15dc70['yamlConfig'][_0x2beaba(0x1c2)]+'\x27'),_0x5be887['created']=0x1;}else{if(_0x15dc70[_0x2beaba(0x1e2)]){_0x57bddc[_0x2beaba(0x26d)]?.({'type':_0x2beaba(0x22e),'name':_0x15dc70['yamlConfig'][_0x2beaba(0x1c2)]});const _0x3f99e6=_0xc2a599(_0x15dc70[_0x2beaba(0x285)]);_0x59bc30!==_0x15dc70['existingSegment']?.[_0x2beaba(0x218)]&&(_0x3f99e6[_0x2beaba(0x218)]=_0x59bc30?parseInt(_0x59bc30,0xa):undefined),await _0x57bddc[_0x2beaba(0x22c)](_0x2beaba(0x243)+_0x15dc70[_0x2beaba(0x285)]['name']+_0x2beaba(0x293),()=>_0x38ccc3[_0x2beaba(0x1ca)][_0x2beaba(0x1d6)](_0x51d6c7[_0x2beaba(0x229)],_0x15dc70[_0x2beaba(0x1cb)]['id'],_0x3f99e6)),_0x569011=_0x15dc70[_0x2beaba(0x1cb)]['id'],_0x57bddc[_0x2beaba(0x26d)]?.({'type':_0x2beaba(0x254),'name':_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)]}),_0x57bddc[_0x2beaba(0x1e4)]?.(_0x2beaba(0x1cd)+_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)]+'\x27'),_0x5be887[_0x2beaba(0x27e)]=0x1;}else _0x569011=_0x15dc70[_0x2beaba(0x1cb)]['id'];}}catch(_0x2d2b67){const _0x4701ef=isHttp400Error(_0x2d2b67),_0x33da72=_0x4701ef?ErrorCode[_0x2beaba(0x1cc)]:ErrorCode[_0x2beaba(0x1cf)],_0x48ad97=getErrorMessage(_0x2d2b67);throw new SDKError(_0x33da72,_0x2beaba(0x232)+(_0x15dc70[_0x2beaba(0x1ad)]?_0x2beaba(0x1af):'update')+_0x2beaba(0x1b7)+_0x15dc70[_0x2beaba(0x234)]+_0x2beaba(0x262)+_0x48ad97,_0x2d2b67);}try{const _0x2bab2a=await syncActivationsForSegment(_0x38ccc3,_0x51d6c7[_0x2beaba(0x229)],_0x569011,_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)],_0x15dc70[_0x2beaba(0x1bd)],_0x57bddc,_0x15dc70[_0x2beaba(0x234)]);_0x5be887[_0x2beaba(0x265)]=_0x2bab2a;}catch(_0x44e195){if(_0x44e195 instanceof SDKError)throw _0x44e195;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2beaba(0x248)+_0x15dc70[_0x2beaba(0x285)][_0x2beaba(0x1c2)]+_0x2beaba(0x1dc)+_0x15dc70[_0x2beaba(0x234)]+'\x0a\x20\x20'+getErrorMessage(_0x44e195),_0x44e195);}return _0x5be887;},_0x5b3b58=await batchAsync(_0xa4348,_0x7b469d,_0x3a6c8d),_0x24e5f6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x12fbe0 of _0x5b3b58){_0x24e5f6['created']+=_0x12fbe0[_0x544386(0x1d9)],_0x24e5f6[_0x544386(0x27e)]+=_0x12fbe0['updated'],_0x12fbe0[_0x544386(0x247)]&&_0x24e5f6[_0x544386(0x1ed)]['set'](_0x12fbe0[_0x544386(0x247)][_0x544386(0x1c2)],_0x12fbe0['createdSegmentId']['id']),_0x24e5f6['activations']['created']+=_0x12fbe0[_0x544386(0x265)]['created'],_0x24e5f6['activations'][_0x544386(0x27e)]+=_0x12fbe0[_0x544386(0x265)][_0x544386(0x27e)],_0x24e5f6['activations']['deleted']+=_0x12fbe0['activations'][_0x544386(0x241)];}return _0x24e5f6;}async function syncActivationsForSegment(_0x639dd6,_0x416e04,_0x537102,_0x35ff2d,_0x2c2f85,_0x31f47c,_0xc0cc74){const _0x4005c1=a119_0x5aaea3,_0x31de3e={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5e65c8 of _0x2c2f85){try{if(_0x5e65c8[_0x4005c1(0x217)]===_0x4005c1(0x1af)&&_0x5e65c8[_0x4005c1(0x209)])_0x31f47c[_0x4005c1(0x26d)]?.({'type':_0x4005c1(0x244),'segmentName':_0x35ff2d,'activationName':_0x5e65c8[_0x4005c1(0x1c2)]}),await _0x31f47c[_0x4005c1(0x22c)](_0x4005c1(0x253)+_0x5e65c8['name']+_0x4005c1(0x293),()=>_0x639dd6[_0x4005c1(0x1ca)][_0x4005c1(0x297)](_0x416e04,_0x537102,_0x5e65c8[_0x4005c1(0x209)])),_0x31f47c['onProgress']?.({'type':_0x4005c1(0x21c),'segmentName':_0x35ff2d,'activationName':_0x5e65c8[_0x4005c1(0x1c2)]}),_0x31f47c[_0x4005c1(0x1e4)]?.(_0x4005c1(0x267)+_0x5e65c8['name']+'\x27'),_0x31de3e[_0x4005c1(0x1d9)]++;else{if(_0x5e65c8[_0x4005c1(0x217)]==='update'&&_0x5e65c8['validatedRequest']&&_0x5e65c8[_0x4005c1(0x26a)])_0x31f47c[_0x4005c1(0x26d)]?.({'type':_0x4005c1(0x23e),'segmentName':_0x35ff2d,'activationName':_0x5e65c8[_0x4005c1(0x1c2)]}),await _0x31f47c[_0x4005c1(0x22c)](_0x4005c1(0x20e)+_0x5e65c8['name']+_0x4005c1(0x293),()=>_0x639dd6['segment'][_0x4005c1(0x23f)](_0x416e04,_0x537102,_0x5e65c8['existingActivation']['id'],_0x5e65c8[_0x4005c1(0x209)])),_0x31f47c[_0x4005c1(0x26d)]?.({'type':_0x4005c1(0x24b),'segmentName':_0x35ff2d,'activationName':_0x5e65c8['name']}),_0x31f47c[_0x4005c1(0x1e4)]?.(_0x4005c1(0x238)+_0x5e65c8[_0x4005c1(0x1c2)]+'\x27'),_0x31de3e[_0x4005c1(0x27e)]++;else _0x5e65c8['type']===_0x4005c1(0x275)&&_0x5e65c8[_0x4005c1(0x26a)]&&(_0x31f47c[_0x4005c1(0x26d)]?.({'type':_0x4005c1(0x277),'segmentName':_0x35ff2d,'activationName':_0x5e65c8['name']}),await _0x31f47c['withProgress'](_0x4005c1(0x28f)+_0x5e65c8['name']+_0x4005c1(0x293),()=>_0x639dd6[_0x4005c1(0x1ca)][_0x4005c1(0x1fe)](_0x416e04,_0x537102,_0x5e65c8[_0x4005c1(0x26a)]['id'])),_0x31f47c[_0x4005c1(0x26d)]?.({'type':_0x4005c1(0x1fd),'segmentName':_0x35ff2d,'activationName':_0x5e65c8[_0x4005c1(0x1c2)]}),_0x31f47c[_0x4005c1(0x228)]?.(_0x4005c1(0x1e9)+_0x5e65c8[_0x4005c1(0x1c2)]+'\x27'),_0x31de3e[_0x4005c1(0x241)]++);}}catch(_0x1c2393){const _0x9d867d=isHttp400Error(_0x1c2393),_0x2d6664=_0x9d867d?ErrorCode[_0x4005c1(0x1b3)]:ErrorCode[_0x4005c1(0x269)],_0x44eb48=getErrorMessage(_0x1c2393);throw new SDKError(_0x2d6664,_0x4005c1(0x232)+_0x5e65c8[_0x4005c1(0x217)]+'\x20activation\x20\x27'+_0x5e65c8['name']+_0x4005c1(0x1dc)+_0xc0cc74+_0x4005c1(0x262)+_0x44eb48,_0x1c2393);}}return _0x31de3e;}export async function executePushFolders(_0x2a463f,_0x3e0991,_0x1306e7,_0x1fcdc2,_0x21c8e0){const _0x221527=a119_0x5aaea3,_0x60c4=new Map(_0x1306e7);for(const _0x49b813 of _0x3e0991){const _0x27b407=_0x49b813[_0x221527(0x27c)]('/'),_0x43b819=_0x27b407[_0x27b407['length']-0x1],_0x4da8e1=_0x27b407['slice'](0x0,-0x1)[_0x221527(0x1f6)]('/'),_0x505ebe=_0x60c4[_0x221527(0x1d1)](_0x4da8e1);_0x21c8e0[_0x221527(0x26d)]?.({'type':_0x221527(0x212),'folder':_0x49b813});const _0x1b019d={'name':_0x43b819,'parentFolderId':_0x505ebe},_0x282d8b=await _0x21c8e0[_0x221527(0x22c)](_0x221527(0x299)+_0x49b813+'\x27...',()=>_0x2a463f[_0x221527(0x1ca)][_0x221527(0x215)](_0x1fcdc2[_0x221527(0x229)],_0x1b019d));_0x60c4['set'](_0x49b813,_0x282d8b[_0x221527(0x23b)]['id']),_0x21c8e0['onProgress']?.({'type':'folder_created','folder':_0x49b813,'folderId':_0x282d8b[_0x221527(0x23b)]['id']}),_0x21c8e0[_0x221527(0x1d2)]?.('Created\x20folder\x20\x27'+_0x49b813+'\x27');}return _0x60c4;}export async function executePushSegmentDeletions(_0x36ee81,_0x5124bd,_0x5dc090){const _0x51a552=a119_0x5aaea3;if(_0x5124bd['length']===0x0)return 0x0;const {batchAsync:_0x3c9838}=await import('../../utils/async.js'),_0xcd140c=0x5,_0x15c330=await _0x3c9838(_0x5124bd,async _0x2799a0=>{const _0x2d5414=a119_0x5cd8;return _0x5dc090[_0x2d5414(0x26d)]?.({'type':_0x2d5414(0x1c3),'name':_0x2799a0[_0x2d5414(0x1c2)]}),await _0x36ee81[_0x2d5414(0x1ca)]['deleteSegment'](_0x2799a0['id']),_0x5dc090[_0x2d5414(0x26d)]?.({'type':_0x2d5414(0x258),'name':_0x2799a0[_0x2d5414(0x1c2)]}),_0x5dc090['logDeleted']?.(_0x2d5414(0x1c1)+_0x2799a0['name']+'\x27'),0x1;},_0xcd140c);return _0x15c330[_0x51a552(0x1e6)]((_0x3b730e,_0x1a1904)=>_0x3b730e+_0x1a1904,0x0);}export async function executePushJourneys(_0x49805d,_0x1a8de2,_0x3affe,_0x4603d8,_0xa45f6a){const _0x5b53b3=a119_0x5aaea3,{journeyDefToRequest:_0x3b1e2c}=await import(_0x5b53b3(0x28a)),{activationDefToCreateRequest:_0x4430e2,yamlRuleToApi:_0x579810,validateSegmentRule:_0x18da5b}=await import(_0x5b53b3(0x29c)),_0x31cbe0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x959272=new Map(_0x3affe[_0x5b53b3(0x25c)]),_0xcf4215=0x5;for(let _0x14b251=0x0;_0x14b251<_0x1a8de2[_0x5b53b3(0x1b0)];_0x14b251+=_0xcf4215){const _0xdc6ec=_0x1a8de2[_0x5b53b3(0x211)](_0x14b251,_0x14b251+_0xcf4215),_0x1376b2=await Promise[_0x5b53b3(0x1d0)](_0xdc6ec['map'](async _0x40ed0e=>{const _0x2805a8=_0x5b53b3;if(!_0x40ed0e[_0x2805a8(0x1ad)]&&!_0x40ed0e[_0x2805a8(0x1e2)])return{'action':_0x2805a8(0x259),'name':_0x40ed0e[_0x2805a8(0x285)][_0x2805a8(0x1c2)],'journeyId':_0x40ed0e['existingJourney']?.['id']};const _0x1c0622=_0x40ed0e[_0x2805a8(0x280)]?_0x3affe[_0x2805a8(0x295)]['get'](_0x40ed0e['folderPath']):undefined;_0xa45f6a[_0x2805a8(0x26d)]?.({'type':_0x40ed0e[_0x2805a8(0x1ad)]?_0x2805a8(0x279):_0x2805a8(0x23a),'name':_0x40ed0e[_0x2805a8(0x285)]['name']});try{const _0x5e39e0=await executeSingleJourneyPush(_0x49805d,_0x40ed0e,{..._0x3affe,'segmentNameToId':_0x959272},{'parentId':_0x4603d8['parentId'],'rootFolderId':_0x4603d8[_0x2805a8(0x221)],'folderId':_0x1c0622,'verbose':_0x4603d8['verbose']},_0xa45f6a,{'journeyDefToRequest':_0x3b1e2c,'activationDefToCreateRequest':_0x4430e2,'yamlRuleToApi':_0x579810,'validateSegmentRule':_0x18da5b});for(const [_0x1a3426,_0x4d392d]of _0x5e39e0[_0x2805a8(0x1c0)]){_0x959272[_0x2805a8(0x266)](_0x1a3426,_0x4d392d),_0x31cbe0['embeddedSegmentNameToId'][_0x2805a8(0x266)](_0x1a3426,_0x4d392d);}if(_0x5e39e0[_0x2805a8(0x20f)]===_0x2805a8(0x1d9))_0xa45f6a[_0x2805a8(0x26d)]?.({'type':'journey_created','name':_0x40ed0e[_0x2805a8(0x285)]['name'],'journeyId':_0x5e39e0['journeyId']}),_0xa45f6a[_0x2805a8(0x1e4)]?.(_0x2805a8(0x298)+_0x40ed0e[_0x2805a8(0x285)][_0x2805a8(0x1c2)]+'\x27'),_0x31cbe0[_0x2805a8(0x1d9)]++;else _0x5e39e0[_0x2805a8(0x20f)]==='updated'&&(_0xa45f6a['onProgress']?.({'type':_0x2805a8(0x225),'name':_0x40ed0e[_0x2805a8(0x285)][_0x2805a8(0x1c2)]}),_0xa45f6a[_0x2805a8(0x1e4)]?.('Updated\x20journey\x20\x27'+_0x40ed0e[_0x2805a8(0x285)][_0x2805a8(0x1c2)]+'\x27'),_0x31cbe0[_0x2805a8(0x27e)]++);return{'action':_0x5e39e0['action'],'name':_0x40ed0e[_0x2805a8(0x285)][_0x2805a8(0x1c2)],'journeyId':_0x5e39e0[_0x2805a8(0x1fb)]};}catch(_0x395a0f){const _0x1b97f0=isHttp400Error(_0x395a0f),_0xe76edb=_0x1b97f0?ErrorCode[_0x2805a8(0x274)]:ErrorCode[_0x2805a8(0x260)],_0x20975d=getErrorMessage(_0x395a0f);throw new SDKError(_0xe76edb,_0x2805a8(0x232)+(_0x40ed0e[_0x2805a8(0x1ad)]?_0x2805a8(0x1af):'update')+'\x20journey\x20from\x20file:\x20'+_0x40ed0e[_0x2805a8(0x234)]+_0x2805a8(0x262)+_0x20975d,_0x395a0f);}}));_0x31cbe0[_0x5b53b3(0x257)][_0x5b53b3(0x1bc)](..._0x1376b2);}return _0x31cbe0;}async function executeSingleJourneyPush(_0xc05beb,_0x564c28,_0x42e0c1,_0x1ae742,_0x11037c,_0x52fe72){const _0x4a9599=a119_0x5aaea3,{journeyDefToRequest:_0x4c7e6a,activationDefToCreateRequest:_0x2b70b9,yamlRuleToApi:_0xd2d063,validateSegmentRule:_0x395bc7}=_0x52fe72,_0xdbbbe1=new Map(),_0x499106=new Map(),_0x35e713=new Map(),_0x2f2dcc=new Map(),_0x51054a=new Map();let _0x3677bd;const _0x3e18eb=async()=>{const _0x46cded=a119_0x5cd8;if(_0x3677bd)return;_0x3677bd=new Map();if(!_0x564c28[_0x46cded(0x239)])return;const _0xa1ec09=await _0xc05beb[_0x46cded(0x22a)][_0x46cded(0x252)](_0x564c28[_0x46cded(0x239)]['id']);for(const _0x1cad4a of _0xa1ec09){const _0x584923=journeyActivationStepToYaml(_0x1cad4a,_0x42e0c1[_0x46cded(0x1be)],_0x42e0c1[_0x46cded(0x1c5)]),_0x40144f=activationSignature(_0x584923);!_0x3677bd['has'](_0x40144f)&&_0x3677bd['set'](_0x40144f,_0x1cad4a['id']),_0x584923[_0x46cded(0x1c2)]&&_0x499106['set'](_0x584923['name'],_0x1cad4a['id']);}};if(_0x564c28['existingJourney']&&_0x564c28[_0x4a9599(0x285)][_0x4a9599(0x1f3)]){const _0x5aa588=buildLocalExpandedRuleMappings(_0x564c28[_0x4a9599(0x285)]),_0x52be07=_0x5aa588['localSegmentRules'];if(_0x52be07['size']>0x0){const _0xa91bdc=new Map();for(const [_0x1bb938,_0x20f3e5]of _0x52be07){const _0x27f9a9=serializeExpandedRule(_0x20f3e5,_0x52be07);_0xa91bdc[_0x4a9599(0x266)](_0x1bb938,_0x27f9a9);}const _0x48d6df=collectSegmentIdsFromJourneyApi(_0x564c28['existingJourney']);if(_0x48d6df[_0x4a9599(0x1f9)]>0x0){const _0x559d07=await buildServerSegmentRuleMap(_0xc05beb,_0x1ae742[_0x4a9599(0x229)],_0x42e0c1['existingSegments'],_0x48d6df);if(_0x559d07['size']>0x0){const _0x46c526=new Map();for(const [_0x1ea61a,_0x12adf8]of _0x559d07){const _0x388c06=serializeExpandedRule(_0x12adf8,_0x559d07);!_0x46c526['has'](_0x388c06)&&_0x46c526['set'](_0x388c06,_0x1ea61a);}for(const [_0xd79119,_0x2d30d5]of _0xa91bdc){const _0x5d5907=_0x46c526['get'](_0x2d30d5);_0x5d5907&&(_0x51054a[_0x4a9599(0x266)](_0xd79119,_0x5d5907),_0x42e0c1['segmentNameToId']['set'](_0xd79119,_0x5d5907));}}}}}const _0x588156={'resolveSegmentId':async _0x4295a9=>{const _0x1ffd00=_0x4a9599,_0x1e42f3=_0x42e0c1[_0x1ffd00(0x25c)][_0x1ffd00(0x1d1)](_0x4295a9);if(!_0x1e42f3)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1ffd00(0x1b9)+_0x4295a9+_0x1ffd00(0x235)+_0x564c28[_0x1ffd00(0x285)][_0x1ffd00(0x1c2)]+')');return _0x1e42f3;},'resolveEmbeddedSegmentId':async(_0x3582fa,_0x3dc942)=>{const _0x5ee239=_0x4a9599,_0x4316b6=_0x42e0c1['segmentNameToId'][_0x5ee239(0x1d1)](_0x3582fa);if(_0x4316b6)return _0x4316b6;const _0xc7ec48=_0x51054a[_0x5ee239(0x1d1)](_0x3582fa);if(_0xc7ec48)return _0x42e0c1[_0x5ee239(0x25c)][_0x5ee239(0x266)](_0x3582fa,_0xc7ec48),_0xc7ec48;const _0x353ad6=_0x42e0c1[_0x5ee239(0x20d)]['find'](_0x21a397=>_0x21a397['name']===_0x3582fa);if(_0x353ad6)return _0x42e0c1['segmentNameToId'][_0x5ee239(0x266)](_0x3582fa,_0x353ad6['id']),_0x353ad6['id'];if(_0x564c28[_0x5ee239(0x1ad)]){const {stageName:_0x4ad734,criteriaName:_0x34b934}=findSegmentCriteriaLocation(_0x564c28[_0x5ee239(0x285)],_0x3582fa);return _0x395bc7(_0x3582fa,_0x3dc942[_0x5ee239(0x250)]),_0x35e713['set'](_0x3582fa,{'definition':_0x3dc942,'stageName':_0x4ad734,'criteriaName':_0x34b934}),createPendingSegmentId(_0x3582fa);}const _0x369d56=_0x564c28[_0x5ee239(0x239)]?.['id'];if(!_0x369d56)throw new SDKError(ErrorCode['INTERNAL'],_0x5ee239(0x27a));_0x395bc7(_0x3582fa,_0x3dc942[_0x5ee239(0x250)]);const _0x325049=generateDeterministicJourneySegmentName(_0x564c28[_0x5ee239(0x285)]['name'],_0x3582fa),_0x455f71=_0x42e0c1['existingSegments'][_0x5ee239(0x286)](_0x13a743=>_0x13a743[_0x5ee239(0x1c2)]===_0x325049),_0x11c339=createSegmentIdResolver(_0x42e0c1['segmentNameToId'],_0x3582fa),_0x1794cd=await resolveRuleSegmentIds(_0x3dc942[_0x5ee239(0x250)],_0x11c339);let _0x3a1589;if(_0x455f71)await _0xc05beb[_0x5ee239(0x1ca)][_0x5ee239(0x1d6)](_0x1ae742['parentId'],_0x455f71['id'],{'description':_0x3dc942[_0x5ee239(0x21d)]||_0x5ee239(0x287)+_0x3582fa,'rule':_0xd2d063(_0x1794cd,!![]),'countPopulation':!![]}),_0x3a1589=_0x455f71['id'];else try{_0x3a1589=await _0xc05beb['segment'][_0x5ee239(0x1d4)]({'name':_0x325049,'description':_0x3dc942[_0x5ee239(0x21d)]||_0x5ee239(0x287)+_0x3582fa,'journeyId':_0x369d56,'rule':_0xd2d063(_0x1794cd,!![]),'countPopulation':!![],'parentFolderId':_0x1ae742[_0x5ee239(0x221)]||'','audienceId':_0x1ae742[_0x5ee239(0x229)]});}catch(_0x11cd09){const _0x45f770=_0x11cd09 instanceof Error&&_0x11cd09[_0x5ee239(0x22f)][_0x5ee239(0x25e)](_0x5ee239(0x1ee));if(_0x45f770){const _0x46a3e7=await _0xc05beb['segment']['listSegments'](_0x1ae742[_0x5ee239(0x229)]),_0x2713ea=_0x46a3e7[_0x5ee239(0x286)](_0x4028d9=>_0x4028d9[_0x5ee239(0x1c2)]===_0x325049);if(_0x2713ea)await _0xc05beb[_0x5ee239(0x1ca)]['updateSegmentById'](_0x1ae742[_0x5ee239(0x229)],_0x2713ea['id'],{'description':_0x3dc942[_0x5ee239(0x21d)]||_0x5ee239(0x287)+_0x3582fa,'rule':_0xd2d063(_0x1794cd,!![]),'countPopulation':!![]}),_0x3a1589=_0x2713ea['id'];else throw _0x11cd09;}else throw _0x11cd09;}return _0x42e0c1['segmentNameToId'][_0x5ee239(0x266)](_0x3582fa,_0x3a1589),_0xdbbbe1[_0x5ee239(0x266)](_0x3582fa,_0x3a1589),_0x3a1589;},'resolveActivationId':async _0x1e97ff=>{const _0x552b16=_0x4a9599,_0x31419a=_0x499106[_0x552b16(0x1d1)](_0x1e97ff);if(_0x31419a)return _0x31419a;if(_0x564c28['existingJourney']){await _0x3e18eb();const _0x5bba19=_0x499106[_0x552b16(0x1d1)](_0x1e97ff);if(_0x5bba19)return _0x5bba19;}throw new SDKError(ErrorCode[_0x552b16(0x22d)],'Activation\x20not\x20found:\x20'+_0x1e97ff+_0x552b16(0x235)+_0x564c28[_0x552b16(0x285)][_0x552b16(0x1c2)]+_0x552b16(0x240)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x56a61b,_0x3255cf)=>{const _0x26d113=_0x4a9599,_0x561a7f=_0x499106[_0x26d113(0x1d1)](_0x56a61b);if(_0x561a7f)return _0x561a7f;if(_0x564c28['isNew'])return _0x2f2dcc[_0x26d113(0x266)](_0x56a61b,_0x3255cf),createPendingActivationId(_0x56a61b);if(_0x564c28[_0x26d113(0x239)]){await _0x3e18eb();const _0x23cecd=_0x499106[_0x26d113(0x1d1)](_0x3255cf[_0x26d113(0x1c2)]);if(_0x23cecd)return _0x499106[_0x26d113(0x266)](_0x56a61b,_0x23cecd),_0x23cecd;const _0x2e2978=activationSignature(_0x3255cf),_0x2c0473=_0x3677bd?.[_0x26d113(0x1d1)](_0x2e2978);if(_0x2c0473)return _0x499106[_0x26d113(0x266)](_0x56a61b,_0x2c0473),_0x2c0473;const _0x3f6543=await _0x2b70b9(_0x3255cf,_0x42e0c1['activationContext']),_0x25ce23=await _0xc05beb[_0x26d113(0x22a)][_0x26d113(0x297)](_0x564c28[_0x26d113(0x239)]['id'],_0x3f6543);return _0x499106[_0x26d113(0x266)](_0x56a61b,_0x25ce23['id']),_0x25ce23['id'];}throw new SDKError(ErrorCode[_0x26d113(0x1e3)],_0x26d113(0x21e));},'resolveJourneyId':async _0x578ee9=>{const _0x319e2b=_0x4a9599;try{return await _0xc05beb[_0x319e2b(0x22a)][_0x319e2b(0x1b5)](_0x1ae742[_0x319e2b(0x229)],_0x578ee9);}catch(_0x3f0851){throw new SDKError(ErrorCode[_0x319e2b(0x22d)],'Journey\x20\x27'+_0x578ee9+_0x319e2b(0x216)+_0x564c28[_0x319e2b(0x285)]['name']+'\x27)',_0x3f0851);}},'resolveStageId':async(_0x8566a2,_0x2608dd)=>{const _0x400335=_0x4a9599,_0x382f1a=await _0xc05beb[_0x400335(0x22a)]['getJourney'](_0x8566a2),_0x745d93=_0x382f1a[_0x400335(0x24a)][_0x400335(0x1d8)][_0x400335(0x286)](_0x14f952=>_0x14f952[_0x400335(0x1c2)][_0x400335(0x230)]()===_0x2608dd[_0x400335(0x230)]());if(!_0x745d93?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x400335(0x20c)+_0x2608dd+_0x400335(0x1ae)+(_0x382f1a[_0x400335(0x24a)][_0x400335(0x1ce)]||_0x382f1a[_0x400335(0x24a)][_0x400335(0x1c2)])+'\x27');return _0x745d93['id'];}},_0x164213=await _0x4c7e6a(_0x564c28[_0x4a9599(0x285)],_0x1ae742['parentId'],_0x588156),_0x5e8d82=_0x1ae742[_0x4a9599(0x21a)]||_0x1ae742['rootFolderId'];_0x5e8d82&&(_0x164213[_0x4a9599(0x28c)]={'parentFolder':{'data':{'id':_0x5e8d82,'type':'folder'}}});if(_0x564c28[_0x4a9599(0x1ad)]){if(_0x35e713[_0x4a9599(0x1f9)]>0x0||_0x2f2dcc[_0x4a9599(0x1f9)]>0x0)return await executeThreeStepJourneyCreate(_0xc05beb,_0x564c28,_0x164213,{'pendingEmbeddedSegments':_0x35e713,'pendingEmbeddedActivations':_0x2f2dcc,'embeddedSegmentNameToId':_0xdbbbe1,'journeyActivationNameToId':_0x499106},{..._0x1ae742,'effectiveFolderId':_0x5e8d82},_0x42e0c1,_0x11037c,_0x52fe72);else{ensureJourneyDefaults(_0x164213[_0x4a9599(0x24a)]);const _0x3e693f=await _0xc05beb[_0x4a9599(0x22a)][_0x4a9599(0x1af)](_0x164213);return{'action':'created','journeyId':_0x3e693f['id'],'embeddedSegmentNameToId':_0xdbbbe1};}}else{if(_0x564c28[_0x4a9599(0x1e2)]&&_0x564c28[_0x4a9599(0x239)])return ensureJourneyDefaults(_0x164213['attributes']),await _0xc05beb['journey'][_0x4a9599(0x25b)](_0x564c28[_0x4a9599(0x239)]['id'],_0x164213),{'action':_0x4a9599(0x27e),'journeyId':_0x564c28[_0x4a9599(0x239)]['id'],'embeddedSegmentNameToId':_0xdbbbe1};}return{'action':_0x4a9599(0x259),'journeyId':_0x564c28['existingJourney']?.['id'],'embeddedSegmentNameToId':_0xdbbbe1};}function findSegmentCriteriaLocation(_0x1c5eeb,_0x463b91){const _0x3a474f=a119_0x5aaea3,_0x4e55f9=_0x1c5eeb[_0x3a474f(0x264)]||_0x1c5eeb[_0x3a474f(0x1f1)]?.[0x0]?.[_0x3a474f(0x264)]||[];let _0x5519ba=_0x3a474f(0x23d),_0x195d9f=_0x463b91;const _0x31a3d9=_0x1c5eeb[_0x3a474f(0x24f)]||_0x1c5eeb[_0x3a474f(0x1f1)]?.[0x0]?.['goal'];if(_0x31a3d9?.['segment']===_0x463b91)return{'stageName':_0x3a474f(0x24f),'criteriaName':_0x31a3d9[_0x3a474f(0x1c2)]||_0x463b91};_0x5a996b:for(const _0x108c18 of _0x4e55f9){if(_0x108c18[_0x3a474f(0x25a)]?.[_0x3a474f(0x1ca)]===_0x463b91){_0x5519ba=_0x108c18['name'],_0x195d9f=_0x108c18['entry_criteria'][_0x3a474f(0x1c2)]||_0x463b91;break;}if(_0x108c18[_0x3a474f(0x22b)])for(const _0x22d0ed of _0x108c18[_0x3a474f(0x22b)]){if(_0x22d0ed[_0x3a474f(0x217)]===_0x3a474f(0x204)&&_0x22d0ed['with']?.[_0x3a474f(0x1da)])for(const _0x28cf69 of _0x22d0ed['with'][_0x3a474f(0x1da)]){if(_0x28cf69['segment']===_0x463b91){_0x5519ba=_0x108c18['name'],_0x195d9f=_0x28cf69[_0x3a474f(0x1c2)]||_0x463b91;break _0x5a996b;}}}}return{'stageName':_0x5519ba,'criteriaName':_0x195d9f};}async function executeThreeStepJourneyCreate(_0x4c1a9e,_0x209a50,_0x291897,_0x268037,_0x50d685,_0x3d862b,_0x252251,_0x59149d){const _0x3ec179=a119_0x5aaea3,{activationDefToCreateRequest:_0x42b3aa,yamlRuleToApi:_0xebc55e}=_0x59149d,{pendingEmbeddedSegments:_0x5d4044,pendingEmbeddedActivations:_0x4c890d,embeddedSegmentNameToId:_0x2f4551}=_0x268037,_0x3c4243=JSON[_0x3ec179(0x245)](JSON[_0x3ec179(0x1ea)](_0x291897));ensureJourneyDefaults(_0x3c4243[_0x3ec179(0x24a)]),stripPendingIds(_0x3c4243);const _0xa833a3=await _0x4c1a9e[_0x3ec179(0x22a)]['create'](_0x3c4243),_0x19b5c0=_0xa833a3['id'],_0x3ae094=new Map();for(const _0x4db034 of _0xa833a3['attributes'][_0x3ec179(0x1d8)]){_0x3ae094[_0x3ec179(0x266)](_0x4db034[_0x3ec179(0x1c2)][_0x3ec179(0x230)](),_0x4db034['id']);}for(const [_0x572141,{definition:_0x5859db}]of _0x5d4044){const _0x18b94b=generateDeterministicJourneySegmentName(_0x209a50[_0x3ec179(0x285)]['name'],_0x572141);_0x252251['onProgress']?.({'type':_0x3ec179(0x220),'journeyName':_0x209a50['yamlConfig'][_0x3ec179(0x1c2)],'segmentName':_0x572141});const _0x295b81=createSegmentIdResolver(_0x3d862b[_0x3ec179(0x25c)],_0x572141),_0x12a840=await resolveRuleSegmentIds(_0x5859db[_0x3ec179(0x250)],_0x295b81),_0x8528d8=await _0x4c1a9e['segment'][_0x3ec179(0x1d4)]({'name':_0x18b94b,'description':_0x5859db[_0x3ec179(0x21d)]||_0x3ec179(0x287)+_0x572141,'journeyId':_0x19b5c0,'rule':_0xebc55e(_0x12a840,!![]),'countPopulation':!![],'parentFolderId':_0x50d685[_0x3ec179(0x1ec)]||'','audienceId':_0x50d685[_0x3ec179(0x229)]});_0x2f4551[_0x3ec179(0x266)](_0x572141,_0x8528d8),_0x3d862b[_0x3ec179(0x25c)][_0x3ec179(0x266)](_0x572141,_0x8528d8),_0x252251[_0x3ec179(0x26d)]?.({'type':_0x3ec179(0x292),'journeyName':_0x209a50['yamlConfig'][_0x3ec179(0x1c2)],'segmentName':_0x572141});}const _0x4f3b0b=new Map();for(const [_0x203fad,_0x53e456]of _0x4c890d){_0x252251['onProgress']?.({'type':_0x3ec179(0x1e7),'journeyName':_0x209a50[_0x3ec179(0x285)]['name'],'activationName':_0x203fad});const _0x359418=await _0x42b3aa(_0x53e456,_0x3d862b[_0x3ec179(0x1f2)]),_0x77c67b=await _0x4c1a9e['journey'][_0x3ec179(0x297)](_0x19b5c0,_0x359418);_0x4f3b0b['set'](_0x203fad,_0x77c67b['id']),_0x268037[_0x3ec179(0x1b2)][_0x3ec179(0x266)](_0x203fad,_0x77c67b['id']),_0x252251[_0x3ec179(0x26d)]?.({'type':_0x3ec179(0x1b8),'journeyName':_0x209a50[_0x3ec179(0x285)][_0x3ec179(0x1c2)],'activationName':_0x203fad});}const _0x3f848a=JSON[_0x3ec179(0x245)](JSON['stringify'](_0x291897));return _0x3f848a['id']=_0x19b5c0,ensureJourneyDefaults(_0x3f848a[_0x3ec179(0x24a)]),resolvePendingIdsInRequest(_0x3f848a,_0x291897,_0x3ae094,_0x2f4551,_0x4f3b0b,_0x252251),await _0x4c1a9e['journey'][_0x3ec179(0x25b)](_0x19b5c0,_0x3f848a),{'action':'created','journeyId':_0x19b5c0,'embeddedSegmentNameToId':_0x2f4551};}function stripPendingIds(_0x11e904){const _0x56a257=a119_0x5aaea3;for(const _0x1126a0 of _0x11e904[_0x56a257(0x24a)]['journeyStages']||[]){_0x1126a0['entryCriteria']?.[_0x56a257(0x283)]&&isPendingSegmentId(_0x1126a0[_0x56a257(0x202)][_0x56a257(0x283)])&&delete _0x1126a0[_0x56a257(0x202)];if(_0x1126a0[_0x56a257(0x22b)])for(const _0x478969 of Object[_0x56a257(0x236)](_0x1126a0[_0x56a257(0x22b)])){const _0x173ab4=_0x1126a0['steps'][_0x478969];_0x173ab4[_0x56a257(0x217)]==='Activation'&&_0x173ab4[_0x56a257(0x1f8)]&&isPendingActivationId(_0x173ab4[_0x56a257(0x1f8)])&&(_0x173ab4['journeyActivationStepId']='');if(_0x173ab4[_0x56a257(0x217)]===_0x56a257(0x282)&&_0x173ab4[_0x56a257(0x1da)])for(const _0x3726c6 of _0x173ab4[_0x56a257(0x1da)]){_0x3726c6['segmentId']&&isPendingSegmentId(_0x3726c6[_0x56a257(0x283)])&&(_0x3726c6[_0x56a257(0x283)]='');}_0x173ab4[_0x56a257(0x217)]===_0x56a257(0x224)&&_0x173ab4[_0x56a257(0x26e)]?.[_0x56a257(0x283)]&&isPendingSegmentId(_0x173ab4[_0x56a257(0x26e)][_0x56a257(0x283)])&&(_0x173ab4[_0x56a257(0x26e)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x557cfb,_0x1ee3d3,_0x1961fc,_0x450c48,_0x219e7d,_0x373350){const _0x4aab0f=a119_0x5aaea3,_0x495fee=(_0x697ff0,_0x49357b)=>{const _0x10753e=a119_0x5cd8;if(!isPendingSegmentId(_0x697ff0))return _0x697ff0;const _0x2a2209=extractPendingSegmentName(_0x697ff0),_0x109a8b=_0x450c48[_0x10753e(0x1d1)](_0x2a2209);return!_0x109a8b&&_0x373350['logWarning']?.(_0x10753e(0x1de)+_0x2a2209+_0x10753e(0x27f)+_0x49357b),_0x109a8b;};if(_0x557cfb[_0x4aab0f(0x24a)][_0x4aab0f(0x24f)]?.['segmentId']&&isPendingSegmentId(_0x557cfb[_0x4aab0f(0x24a)][_0x4aab0f(0x24f)][_0x4aab0f(0x283)])){const _0x2fdbf5=_0x495fee(_0x557cfb[_0x4aab0f(0x24a)]['goal']['segmentId'],_0x4aab0f(0x219));_0x2fdbf5&&(_0x557cfb[_0x4aab0f(0x24a)]['goal']['segmentId']=_0x2fdbf5);}for(const _0x285ed7 of _0x557cfb[_0x4aab0f(0x24a)][_0x4aab0f(0x1d8)]||[]){const _0x47c973=_0x1961fc[_0x4aab0f(0x1d1)](_0x285ed7[_0x4aab0f(0x1c2)]['toLowerCase']());_0x47c973&&(_0x285ed7['id']=_0x47c973);if(_0x285ed7[_0x4aab0f(0x202)]?.['segmentId']&&isPendingSegmentId(_0x285ed7[_0x4aab0f(0x202)][_0x4aab0f(0x283)])){const _0x34e135=_0x495fee(_0x285ed7[_0x4aab0f(0x202)]['segmentId'],'stage\x20\x27'+_0x285ed7[_0x4aab0f(0x1c2)]+_0x4aab0f(0x291));_0x34e135&&(_0x285ed7[_0x4aab0f(0x202)]['segmentId']=_0x34e135);}if(_0x285ed7['exitCriterias'])for(const _0x2d9823 of _0x285ed7[_0x4aab0f(0x1b1)]){if(_0x2d9823['segmentId']&&isPendingSegmentId(_0x2d9823['segmentId'])){const _0x360e96=_0x495fee(_0x2d9823[_0x4aab0f(0x283)],_0x4aab0f(0x23c)+_0x285ed7[_0x4aab0f(0x1c2)]+_0x4aab0f(0x201));_0x360e96&&(_0x2d9823[_0x4aab0f(0x283)]=_0x360e96);}}if(_0x285ed7[_0x4aab0f(0x27d)]?.['segmentId']&&isPendingSegmentId(_0x285ed7[_0x4aab0f(0x27d)][_0x4aab0f(0x283)])){const _0x59cff7=_0x495fee(_0x285ed7[_0x4aab0f(0x27d)][_0x4aab0f(0x283)],_0x4aab0f(0x23c)+_0x285ed7[_0x4aab0f(0x1c2)]+_0x4aab0f(0x24e));_0x59cff7&&(_0x285ed7[_0x4aab0f(0x27d)][_0x4aab0f(0x283)]=_0x59cff7);}if(_0x285ed7[_0x4aab0f(0x22b)]){const _0x3d6ad8=_0x48985f=>_0x1ee3d3['attributes'][_0x4aab0f(0x1d8)][_0x4aab0f(0x286)](_0x17f1de=>_0x17f1de['name']['toLowerCase']()===_0x285ed7['name'][_0x4aab0f(0x230)]())?.['steps']?.[_0x48985f];for(const _0x2931cf of Object[_0x4aab0f(0x236)](_0x285ed7[_0x4aab0f(0x22b)])){const _0x4e5913=_0x285ed7['steps'][_0x2931cf],_0x319265=_0x3d6ad8(_0x2931cf);if(_0x4e5913[_0x4aab0f(0x217)]==='Activation'&&_0x4e5913['journeyActivationStepId']&&(isPendingActivationId(_0x4e5913[_0x4aab0f(0x1f8)])||_0x4e5913[_0x4aab0f(0x1f8)]==='')){if(_0x319265?.[_0x4aab0f(0x1f8)]&&isPendingActivationId(_0x319265[_0x4aab0f(0x1f8)])){const _0x1deb9e=extractPendingActivationName(_0x319265[_0x4aab0f(0x1f8)]),_0x2c0f00=_0x219e7d['get'](_0x1deb9e);_0x2c0f00&&(_0x4e5913[_0x4aab0f(0x1f8)]=_0x2c0f00);}}if(_0x4e5913[_0x4aab0f(0x217)]==='DecisionPoint'&&_0x4e5913[_0x4aab0f(0x1da)]&&_0x319265?.[_0x4aab0f(0x1da)])for(let _0x35d84d=0x0;_0x35d84d<_0x4e5913['branches'][_0x4aab0f(0x1b0)];_0x35d84d++){const _0x42c5fc=_0x4e5913[_0x4aab0f(0x1da)][_0x35d84d],_0x3000e8=_0x319265[_0x4aab0f(0x1da)][_0x35d84d];if(_0x3000e8?.[_0x4aab0f(0x283)]&&isPendingSegmentId(_0x3000e8[_0x4aab0f(0x283)])){const _0x5771cf=_0x495fee(_0x3000e8['segmentId'],_0x4aab0f(0x23c)+_0x285ed7[_0x4aab0f(0x1c2)]+_0x4aab0f(0x1ba)+(_0x42c5fc[_0x4aab0f(0x1c2)]||_0x35d84d)+'\x27');_0x5771cf&&(_0x42c5fc[_0x4aab0f(0x283)]=_0x5771cf);}}if(_0x4e5913[_0x4aab0f(0x217)]===_0x4aab0f(0x224)&&_0x4e5913[_0x4aab0f(0x26e)]?.[_0x4aab0f(0x283)]&&_0x319265?.[_0x4aab0f(0x26e)]?.[_0x4aab0f(0x283)]&&isPendingSegmentId(_0x319265[_0x4aab0f(0x26e)][_0x4aab0f(0x283)])){const _0x7bc052=_0x495fee(_0x319265['waitCondition'][_0x4aab0f(0x283)],_0x4aab0f(0x23c)+_0x285ed7[_0x4aab0f(0x1c2)]+_0x4aab0f(0x296));_0x7bc052&&(_0x4e5913[_0x4aab0f(0x26e)][_0x4aab0f(0x283)]=_0x7bc052);}}}}}
|
|
1
|
+
const a119_0x43758d=a119_0x1c83;(function(_0x5371eb,_0x139dbc){const _0x4e0e36=a119_0x1c83,_0x3caa8e=_0x5371eb();while(!![]){try{const _0x545999=parseInt(_0x4e0e36(0x194))/0x1*(-parseInt(_0x4e0e36(0x17b))/0x2)+-parseInt(_0x4e0e36(0x10d))/0x3*(-parseInt(_0x4e0e36(0x181))/0x4)+-parseInt(_0x4e0e36(0x14e))/0x5*(-parseInt(_0x4e0e36(0x127))/0x6)+-parseInt(_0x4e0e36(0xde))/0x7+parseInt(_0x4e0e36(0x19c))/0x8*(-parseInt(_0x4e0e36(0xe1))/0x9)+parseInt(_0x4e0e36(0x10a))/0xa+-parseInt(_0x4e0e36(0xed))/0xb;if(_0x545999===_0x139dbc)break;else _0x3caa8e['push'](_0x3caa8e['shift']());}catch(_0x25c13d){_0x3caa8e['push'](_0x3caa8e['shift']());}}}(a119_0x4aa5,0xd624c));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a119_0x43758d(0xf2);export const PENDING_ACTIVATION_PREFIX=a119_0x43758d(0x14f);export function createPendingSegmentId(_0x5c5ba3){return''+PENDING_SEGMENT_PREFIX+_0x5c5ba3+'__';}export function isPendingSegmentId(_0x33ce94){const _0x3a3428=a119_0x43758d;return _0x33ce94[_0x3a3428(0x137)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x4154b8){const _0x4ad54d=a119_0x43758d;return _0x4154b8[_0x4ad54d(0xc3)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x6ae26d){return''+PENDING_ACTIVATION_PREFIX+_0x6ae26d+'__';}export function isPendingActivationId(_0x30e3c9){const _0x3b7773=a119_0x43758d;return _0x30e3c9[_0x3b7773(0x137)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x254dec){return _0x254dec['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x10fa1e,_0xdc6c81){const _0x1c10f4=a119_0x43758d,_0x562521=_0x10fa1e+'::'+(_0xdc6c81[_0x1c10f4(0x100)]()||'segment'),_0x4ad597=createHash(_0x1c10f4(0x193))[_0x1c10f4(0x13c)](_0x562521)[_0x1c10f4(0xf7)](_0x1c10f4(0xf0))[_0x1c10f4(0x129)](0x0,0xc);return _0x1c10f4(0x119)+_0x4ad597;}export function ensureJourneyDefaults(_0x1d20b8){const _0x4df925=a119_0x43758d;!_0x1d20b8[_0x4df925(0x11a)]&&(_0x1d20b8[_0x4df925(0x11a)]=''),!_0x1d20b8['state']&&(_0x1d20b8[_0x4df925(0xd4)]=_0x4df925(0x1a1));}export function resolveTDFolderPath(_0x3e4cb5,_0x174eb5,_0xbae588){const _0x5f1856=a119_0x43758d;if(!_0x174eb5)return _0x3e4cb5;if(_0x3e4cb5===_0xbae588||_0x3e4cb5[_0x5f1856(0x137)](_0xbae588+'/'))return _0x3e4cb5;return _0x3e4cb5?_0xbae588+'/'+_0x3e4cb5:_0xbae588;}function a119_0x4aa5(){const _0x4cc967=['validatedRequest','state','map','max','../../utils/async.js','list','embeddedSegmentNameToId','connector_config','utf-8','parentId','folder','9887724SUzZGK','index','Fetching\x20','18LlMsrH','isNew','Updated\x20activation\x20\x27','createSegment','connection','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','segmentNameToId','from','includes','rule','idToName','embedded_segment_created','225346UaaWxS','activationActions','deleteActivation','hex','message','__pending_','withProgress','all_columns','segment_deleted','embedded_activation_creating','digest','join','journeyBundlesByFolderAndName','journeyActivationStepId','item','embedded_activation_created','JOURNEY_UPDATE_ERROR','deleteSegment','Created\x20activation\x20\x27','trim','parentFolder','existingSegment','dirname','entry','relationships','segment_creating','split','onProgress','Activation','12697650EFnYvF','existingSegments','Journey\x20\x27','3rAgnvu','ACTIVATION_UPDATE_ERROR','valid','Entry\x20criteria:\x20','parseDocument','hasChanges','set','existingActivation','getJourney','relative','rootFolderId','./child-segment-yaml.js','journey_entry_criteria_','description','listSegments','verbose','resolveSegment','goal\x20criteria','data','updated','type','activationsBySegmentId','\x27\x20not\x20found\x20in\x20journey\x20\x27','isArray','attributes','skipSegments','2130zSHseG','activation_template_id','slice','kind','segment','unchanged','DecisionPoint','localSegmentRules','segmentByFolderAndName','action','getSegment','connectionIdToNameMap','add','logInfo','updateActivation','reduce','startsWith','errors','listActivations','yamlActivation','get','update','NOT_FOUND','Created\x20journey\x20\x27','segment_deleting','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','branches','Name\x20has\x20already\x20been\x20taken','createJourneySegment','stringify','milestone','segmentFolderId','\x20journey\x20from\x20file:\x20','folderPathToId','entryCriteria','journeyId','createActivation','\x20error(s)','SEGMENT_NOT_FOUND','300BYnamd','__pending_act_','activation_deleted','steps','yamlConfig','deleted','Segment\x20not\x20found:\x20','journeys','activations','folder_created','INTERNAL','activation_created','object','waitCondition','created','buildUserMaps','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','idToEmailMap','segmentId','Failed\x20to\x20','embedded_segment_creating','goal','null','Deleting\x20activation\x20\x27','delete','Updating\x20activation\x20\x27','journeyStages','Updated\x20segment\x20\x27','results','\x20(referenced\x20in\x20journey\x20','Updated\x20journey\x20\x27','segments','\x0a\x20\x20','\x27\x20for\x20','absolutePath','diff','schedule','with','create','\x27...','Creating\x20folder\x20\x27','activationContext','activation_updating','filter','progress','10550GnCfQK','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','entries','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Created\x20folder\x20\x27','\x27\x20entry\x20criteria','6223424LaWhVu','updateSegmentById','values','Creating\x20segment\x20\x27','activationParams','journeyBundleName','folderPath','toString','sort','ACTIVATION_SYNTAX_ERROR','Deleted\x20activation\x20\x27','toLowerCase','find','length','name','createdSegmentIds','journey_updated','exitCriterias','sha1','67qhTeeF','Stage\x20\x27','\x27\x20milestone','journeyActivationNameToId','parse','deps','./journey-yaml.js','flatMap','733384WPyjvS','WaitStep','entry_criteria','\x27\x20from\x20file:\x20','journey','draft','JOURNEY_SYNTAX_ERROR','stage\x20\x27','versionNumber','journeyById','createFolder','logDeleted','replace','logSuccess','\x27\x20decision\x20point\x20branch\x20\x27','Activation\x20not\x20found:\x20','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','push','effectiveFolderId','existingJourney','folderId','notification','segment_updating','has','keys','stages','size','createdSegmentId'];a119_0x4aa5=function(){return _0x4cc967;};return a119_0x4aa5();}export function addFoldersToCreate(_0x5b2066,_0x5edfa3,_0x176936){const _0xef86a=a119_0x43758d;if(!_0x5b2066)return;if(_0x5edfa3[_0xef86a(0xce)](_0x5b2066))return;const _0x479652=_0x5b2066[_0xef86a(0x107)]('/');let _0x5ae71c='';for(const _0x2c5446 of _0x479652){_0x5ae71c=_0x5ae71c?_0x5ae71c+'/'+_0x2c5446:_0x2c5446,!_0x5edfa3[_0xef86a(0xce)](_0x5ae71c)&&_0x176936['add'](_0x5ae71c);}}import*as a119_0x5c0b2d from'yaml';import{readFileSync}from'fs';import a119_0x2cece5 from'path';import{isJourneyDef,parseYamlString as a119_0xff0061,toYamlString as a119_0x4bcb51,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(_0x3e3232){const _0x414375=a119_0x43758d;if(Array[_0x414375(0x124)](_0x3e3232))return'['+_0x3e3232[_0x414375(0xd5)](_0x371586=>stableStringify(_0x371586))[_0x414375(0xf8)](',')+']';if(_0x3e3232&&typeof _0x3e3232===_0x414375(0x15a)){const _0xe8b8ee=_0x3e3232,_0x4d8643=Object['keys'](_0xe8b8ee)[_0x414375(0x189)](),_0x2c8ce0=_0x4d8643[_0x414375(0xd5)](_0x17d14c=>'\x22'+_0x17d14c+'\x22:'+stableStringify(_0xe8b8ee[_0x17d14c]));return'{'+_0x2c8ce0['join'](',')+'}';}const _0x75f375=JSON[_0x414375(0x144)](_0x3e3232);return _0x75f375===undefined?_0x414375(0x164):_0x75f375;}function activationSignature(_0x413f85){const _0x4fc03d=a119_0x43758d,_0x11b8c6={'connection':_0x413f85[_0x4fc03d(0xe5)],..._0x413f85[_0x4fc03d(0xf4)]!==undefined&&{'all_columns':_0x413f85[_0x4fc03d(0xf4)]},..._0x413f85['columns']!==undefined&&{'columns':_0x413f85['columns']},..._0x413f85['behavior']!==undefined&&{'behavior':_0x413f85['behavior']},..._0x413f85[_0x4fc03d(0x172)]!==undefined&&{'schedule':_0x413f85[_0x4fc03d(0x172)]},..._0x413f85[_0x4fc03d(0xcc)]!==undefined&&{'notification':_0x413f85[_0x4fc03d(0xcc)]},..._0x413f85[_0x4fc03d(0xda)]!==undefined&&{'connector_config':_0x413f85['connector_config']},..._0x413f85[_0x4fc03d(0x128)]!==undefined&&{'activation_template_id':_0x413f85['activation_template_id']}};return stableStringify(_0x11b8c6);}export async function prepareSegmentFiles(_0x1d35a4,_0x557960,_0x3139c9,_0x3d65f0,_0x5d25c9){const _0x394fca=a119_0x43758d,{activationDefToCreateRequest:_0x4eb392}=await import(_0x394fca(0x118)),_0x37e10a=[],_0x45f386=new Set();for(const {yamlConfig:_0x4caf9b,folderPath:_0x4d8c62,sourcePath:_0x13832f}of _0x1d35a4){const _0x1bbb32=resolveTDFolderPath(_0x4d8c62,_0x3d65f0,_0x5d25c9),_0x1a02bf=_0x1bbb32+':'+_0x4caf9b[_0x394fca(0x18f)],_0x2b55f1=_0x557960[_0x394fca(0x12f)]['get'](_0x1a02bf),_0x28af00=_0x2b55f1?_0x557960[_0x394fca(0x122)][_0x394fca(0x13b)](_0x2b55f1['id'])||[]:[];addFoldersToCreate(_0x1bbb32,_0x557960[_0x394fca(0x148)],_0x45f386);const _0x466da2=calculateActivationActions(_0x4caf9b[_0x394fca(0x156)]||[],_0x28af00,_0x557960['idToEmailMap'],_0x557960['connectionIdToNameMap']);for(const _0x505a4d of _0x466da2){(_0x505a4d[_0x394fca(0x121)]==='create'||_0x505a4d[_0x394fca(0x121)]===_0x394fca(0x13c))&&_0x505a4d[_0x394fca(0x13a)]&&(_0x505a4d[_0x394fca(0xd3)]=await _0x4eb392(_0x505a4d[_0x394fca(0x13a)],_0x3139c9));}const _0x5f42b6=calculateSegmentDiff(_0x4caf9b,_0x2b55f1,_0x28af00,_0x557960[_0x394fca(0x15f)],_0x557960['connectionIdToNameMap']);_0x37e10a[_0x394fca(0xc8)]({'relativePath':_0x4caf9b['name'],'absolutePath':_0x13832f,'yamlConfig':_0x4caf9b,'folderPath':_0x1bbb32,'existingSegment':_0x2b55f1,'existingActivations':_0x28af00,'isNew':_0x5f42b6[_0x394fca(0xe2)],'hasChanges':_0x5f42b6['hasChanges'],'diff':_0x5f42b6[_0x394fca(0x171)],'activationActions':_0x466da2});}return{'segmentFiles':_0x37e10a,'foldersToCreate':_0x45f386};}export async function prepareJourneyFiles(_0x1f4217,_0x3d2d12,_0x3e2dc3,_0x459978){const _0xe52374=a119_0x43758d,_0x264a83=[],_0x38544b=new Set();for(const {yamlConfig:_0x4f33c2,folderPath:_0x354120,sourcePath:_0x1c36ec}of _0x1f4217){const _0xd98116=resolveTDFolderPath(_0x354120,_0x3e2dc3,_0x459978),_0x46d93b=_0xd98116+':'+_0x4f33c2['name'],_0x2b46be=_0x3d2d12[_0xe52374(0xf9)][_0xe52374(0x13b)](_0x46d93b);let _0x1ae2d9,_0x23b5f6;if(_0x2b46be&&_0x2b46be[_0xe52374(0x18e)]>0x0){const _0x2c545f=buildLocalExpandedRuleMappings(_0x4f33c2),{createYamlContext:_0x40639c,prefetchJourneySegments:_0x40388e}=createPushYamlContextForBundle(_0x3d2d12[_0xe52374(0x199)],_0x3d2d12['parentId'],_0x3d2d12[_0xe52374(0x10b)],_0x2c545f,_0x3d2d12['idToEmailMap'],_0x3d2d12[_0xe52374(0x132)],_0x3d2d12['activationStepsById'],_0x3d2d12[_0xe52374(0xc0)]);await _0x40388e(_0x2b46be['map'](_0x29f6c0=>_0x29f6c0['id']));const _0x306488=hasMultipleVersions(_0x4f33c2),_0x2261c5=async _0x3fd66b=>{const _0x29ee8c=_0xe52374,_0x5159a4=_0x3d2d12['journeyById']?.['get'](_0x3fd66b);if(_0x5159a4)return _0x5159a4;return _0x3d2d12['fetchJourney']({'journeyId':_0x3fd66b,'journeyName':_0x4f33c2[_0x29ee8c(0x18f)],'isMultiVersion':_0x2b46be[_0x29ee8c(0x18e)]>0x1});};if(_0x306488&&_0x2b46be[_0xe52374(0x18e)]>0x1){const _0x5d2b80=[];for(const _0x18edf6 of _0x2b46be){const _0x165dee=_0x18edf6['versionNumber']||0x1;_0x3d2d12[_0xe52374(0x17a)]?.[_0xe52374(0x13c)]('Fetching\x20'+_0x4f33c2[_0xe52374(0x18f)]+'\x20v'+_0x165dee);const _0x515b03=await _0x2261c5(_0x18edf6['id']),_0x4d4eef=_0x40639c(_0x18edf6['id']),_0x29862e=await journeyResponseToDef(_0x515b03,_0x4d4eef);_0x5d2b80['push']({'item':_0x18edf6,'yaml':_0x29862e});}const _0x78b12b=buildLocalRuleToNameMappingFromJourney(_0x4f33c2);_0x23b5f6=buildMergedJourneyDef(_0x5d2b80,_0x78b12b);const _0x48dde8=Math[_0xe52374(0xd6)](..._0x5d2b80[_0xe52374(0xd5)](_0x100e87=>_0x100e87[_0xe52374(0xfb)][_0xe52374(0xbf)]||0x0)),_0x14db93=_0x2b46be[_0xe52374(0x18d)](_0xb59c8=>(_0xb59c8[_0xe52374(0xbf)]||0x0)===_0x48dde8);_0x14db93&&(_0x3d2d12[_0xe52374(0x17a)]?.[_0xe52374(0x13c)]('Fetching\x20'+_0x4f33c2[_0xe52374(0x18f)]+'\x20v'+_0x48dde8),_0x1ae2d9=await _0x2261c5(_0x14db93['id']));}else{const _0x288250=_0x2b46be[_0x2b46be[_0xe52374(0x18e)]-0x1];_0x3d2d12[_0xe52374(0x17a)]?.[_0xe52374(0x13c)](_0xe52374(0xe0)+_0x4f33c2[_0xe52374(0x18f)]),_0x1ae2d9=await _0x2261c5(_0x288250['id']);const _0x4775d0=_0x40639c(_0x288250['id']),_0x5e9e99=await journeyResponseToDef(_0x1ae2d9,_0x4775d0),_0x2da7bf=buildLocalRuleToNameMappingFromJourney(_0x4f33c2);_0x23b5f6=buildMergedJourneyDef([{'item':_0x288250,'yaml':_0x5e9e99}],_0x2da7bf);}}addFoldersToCreate(_0xd98116,_0x3d2d12[_0xe52374(0x148)],_0x38544b);const _0x3d1049=calculateJourneyDiff(_0x4f33c2,_0x23b5f6);_0x264a83[_0xe52374(0xc8)]({'relativePath':_0x4f33c2['name'],'absolutePath':_0x1c36ec,'yamlConfig':_0x4f33c2,'folderPath':_0xd98116,'existingJourney':_0x1ae2d9,'isNew':_0x3d1049[_0xe52374(0xe2)],'hasChanges':_0x3d1049['hasChanges'],'diff':_0x3d1049[_0xe52374(0x171)]});}return{'journeyFiles':_0x264a83,'foldersToCreate':_0x38544b};}export function calculateActivationActions(_0x5f230a,_0x38f1c6,_0x27d5af,_0x120530){const _0x3cd34f=a119_0x43758d,_0x176839=[],_0x359b98=new Map();for(const _0x4d8724 of _0x38f1c6){_0x359b98[_0x3cd34f(0x113)](_0x4d8724[_0x3cd34f(0x18f)],_0x4d8724);}const _0x41af6a=new Map();for(const _0x1d8acc of _0x5f230a){_0x41af6a['set'](_0x1d8acc[_0x3cd34f(0x18f)],_0x1d8acc);}for(const _0xdf784a of _0x5f230a){const _0x53a55b=_0x359b98['get'](_0xdf784a[_0x3cd34f(0x18f)]);if(!_0x53a55b)_0x176839['push']({'type':_0x3cd34f(0x174),'name':_0xdf784a[_0x3cd34f(0x18f)],'yamlActivation':_0xdf784a});else{const _0x592b18=activationResponseToDef(_0x53a55b,_0x27d5af,_0x120530),_0x3236e1=a119_0x5c0b2d['stringify'](_0x592b18),_0x4729e6=a119_0x5c0b2d[_0x3cd34f(0x144)](_0xdf784a);_0x3236e1!==_0x4729e6&&_0x176839[_0x3cd34f(0xc8)]({'type':_0x3cd34f(0x13c),'name':_0xdf784a['name'],'yamlActivation':_0xdf784a,'existingActivation':_0x53a55b});}}for(const _0x1268ee of _0x38f1c6){!_0x41af6a[_0x3cd34f(0xce)](_0x1268ee[_0x3cd34f(0x18f)])&&_0x176839[_0x3cd34f(0xc8)]({'type':_0x3cd34f(0x166),'name':_0x1268ee[_0x3cd34f(0x18f)],'existingActivation':_0x1268ee});}return _0x176839;}function a119_0x1c83(_0x3ba591,_0x1cdbd2){_0x3ba591=_0x3ba591-0xbf;const _0x4aa56a=a119_0x4aa5();let _0x1c8364=_0x4aa56a[_0x3ba591];return _0x1c8364;}export function calculateSegmentDiff(_0x28ca5e,_0x54f441,_0x1992ca,_0x3955e7,_0x5c3c97){const _0x156b1e=segmentToYamlString(_0x28ca5e);if(_0x54f441){const _0x31a155=segmentWithActivationsToYaml(_0x54f441,_0x1992ca,undefined,_0x3955e7,_0x5c3c97),_0xb6a3e5=segmentToYamlString(_0x31a155),_0x5b14e1=generateDiff(_0xb6a3e5,_0x156b1e),_0x9a5086=hasChanges(_0x5b14e1);return{'isNew':![],'hasChanges':_0x9a5086,'diff':_0x9a5086?formatDiffWithColors(_0x5b14e1):undefined};}const _0x43be64=generateDiff('',_0x156b1e);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x43be64)};}export function calculateJourneyDiff(_0x756645,_0x3e278c){const _0x5c96e3=normalizeJourneyDef(_0x756645,_0x756645),_0x58cf24=a119_0x4bcb51(_0x5c96e3);if(_0x3e278c){const _0x45bd7d=normalizeJourneyDef(_0x3e278c,_0x756645),_0x453b95=a119_0x4bcb51(_0x45bd7d),_0x57fdd0=generateDiff(_0x453b95,_0x58cf24),_0x57e64e=hasChanges(_0x57fdd0);return{'isNew':![],'hasChanges':_0x57e64e,'diff':_0x57e64e?formatDiffWithColors(_0x57fdd0):undefined};}const _0x5b3d4c=generateDiff('',_0x58cf24);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5b3d4c)};}export function findSegmentsToDelete(_0x33caaf,_0x2a4876,_0x26d6f8,_0x90f26e,_0x3d323b){const _0x177a6a=a119_0x43758d,_0x4c1f3c=new Set();for(const {yamlConfig:_0x4cd442,folderPath:_0x4f2c01}of _0x2a4876){_0x4c1f3c['add'](_0x4f2c01+':'+_0x4cd442[_0x177a6a(0x18f)]);}return _0x33caaf[_0x177a6a(0x179)](_0x4e5207=>{const _0x1a7de2=_0x177a6a,_0xb9d4ff=_0x4e5207['segmentFolderId']?_0x26d6f8[_0x1a7de2(0x13b)](_0x4e5207['segmentFolderId']['toString']())||'':'',_0x54eb84=_0xb9d4ff+':'+_0x4e5207[_0x1a7de2(0x18f)];if(_0x4c1f3c[_0x1a7de2(0xce)](_0x54eb84))return![];if(_0x3d323b)return _0xb9d4ff===_0x90f26e||_0xb9d4ff['startsWith'](_0x90f26e+'/');return!![];});}export function findJourneysToDelete(_0xa2cece,_0x43a0d,_0x4cc233,_0x24b2d6,_0x3f1a00){const _0x3d8abd=a119_0x43758d,_0x2ebec9=new Set();for(const {yamlConfig:_0x40e483,folderPath:_0x3c97b4}of _0x43a0d){_0x2ebec9[_0x3d8abd(0x133)](_0x3c97b4+':'+_0x40e483[_0x3d8abd(0x18f)]);}return _0xa2cece[_0x3d8abd(0x179)](_0x595059=>{const _0x54b5ca=_0x3d8abd,_0x38674b=_0x595059[_0x54b5ca(0xcb)]?_0x4cc233['get'](_0x595059[_0x54b5ca(0xcb)])||'':'',_0x2532de=_0x38674b+':'+_0x595059[_0x54b5ca(0x186)];if(_0x2ebec9[_0x54b5ca(0xce)](_0x2532de))return![];if(_0x3f1a00)return _0x38674b===_0x24b2d6||_0x38674b[_0x54b5ca(0x137)](_0x24b2d6+'/');return!![];});}export function buildSegmentLookupMap(_0x2736ab,_0x66276f){const _0xa2b81c=a119_0x43758d,_0x1cb0f1=new Map();for(const _0x2a5c33 of _0x2736ab){const _0x208237=_0x2a5c33[_0xa2b81c(0x146)]?_0x66276f[_0xa2b81c(0x13b)](_0x2a5c33[_0xa2b81c(0x146)][_0xa2b81c(0x188)]())||'':'',_0x44c3a7=_0x208237+':'+_0x2a5c33['name'];_0x1cb0f1['set'](_0x44c3a7,_0x2a5c33);}return _0x1cb0f1;}export function buildSegmentNameToIdMap(_0x1d2397){const _0x1ef8fa=a119_0x43758d,_0xe607d2=new Map();for(const _0x29295d of _0x1d2397){_0xe607d2['set'](_0x29295d[_0x1ef8fa(0x18f)],_0x29295d['id']);}return _0xe607d2;}export function buildJourneyBundleLookupMap(_0x40d74b,_0x51cdf5){const _0x632930=a119_0x43758d,_0x316ca8=new Map();for(const _0x16e8cf of _0x40d74b){const _0x6bc672=_0x16e8cf['folderId']?_0x51cdf5[_0x632930(0x13b)](_0x16e8cf[_0x632930(0xcb)])||'':'',_0x1e385f=_0x6bc672+':'+_0x16e8cf[_0x632930(0x186)];!_0x316ca8['has'](_0x1e385f)&&_0x316ca8[_0x632930(0x113)](_0x1e385f,[]),_0x316ca8[_0x632930(0x13b)](_0x1e385f)[_0x632930(0xc8)](_0x16e8cf);}for(const _0x363be1 of _0x316ca8[_0x632930(0x183)]()){_0x363be1[_0x632930(0x189)]((_0x5e07e0,_0x464c5b)=>(_0x5e07e0[_0x632930(0xbf)]||0x0)-(_0x464c5b[_0x632930(0xbf)]||0x0));}return _0x316ca8;}export function collectFoldersToCreate(_0x67d722,_0x854845){const _0x3bf94b=a119_0x43758d,_0x2f3c7c=new Set();for(const _0x5b041b of _0x67d722){if(!_0x5b041b)continue;if(_0x854845['has'](_0x5b041b))continue;const _0x59131d=_0x5b041b[_0x3bf94b(0x107)]('/');let _0xce9c93='';for(const _0xcc84e0 of _0x59131d){_0xce9c93=_0xce9c93?_0xce9c93+'/'+_0xcc84e0:_0xcc84e0,!_0x854845[_0x3bf94b(0xce)](_0xce9c93)&&_0x2f3c7c[_0x3bf94b(0x133)](_0xce9c93);}}return _0x2f3c7c;}export function parseAndClassifyYamlFiles(_0x1ee5b5,_0x3a1f4f,_0x18b64c){const _0x4203c9=a119_0x43758d,_0xba0262=[],_0x383fbf=[];for(const _0x56cae1 of _0x1ee5b5){const _0x3d5e82=a119_0x2cece5[_0x4203c9(0x116)](_0x3a1f4f,a119_0x2cece5[_0x4203c9(0x103)](_0x56cae1)),_0x49b183=_0x3d5e82==='.'?'':_0x3d5e82,_0x359eca=readFileSync(_0x56cae1,_0x4203c9(0xdb)),_0x1569cb=a119_0x5c0b2d[_0x4203c9(0x198)](_0x359eca);if(isJourneyDef(_0x1569cb)){const _0x4af9bf=a119_0xff0061(_0x359eca);_0x383fbf[_0x4203c9(0xc8)]({'yamlConfig':_0x4af9bf,'folderPath':_0x49b183,'sourcePath':_0x56cae1});}else{if(!_0x18b64c?.[_0x4203c9(0x126)]){const _0x367f8f=parseSegmentYamlFile(_0x359eca),_0x2a657f=normalizeChildSegmentYaml(_0x367f8f);_0xba0262[_0x4203c9(0xc8)]({'yamlConfig':_0x2a657f,'folderPath':_0x49b183,'sourcePath':_0x56cae1});}}}return{'segments':_0xba0262,'journeys':_0x383fbf};}export function validateParsedFiles(_0x2a73d8,_0x4143ad){const _0x4c3901=a119_0x43758d,_0x58025f=[];for(const {yamlConfig:_0x195025,sourcePath:_0xaf27ef}of _0x2a73d8[_0x4c3901(0x16d)]){const _0x32e898=readFileSync(_0xaf27ef,_0x4c3901(0xdb)),_0x266b9d=a119_0x5c0b2d[_0x4c3901(0x111)](_0x32e898),_0x26c238=validateSegmentDef(_0x195025,{'source':_0x32e898,'document':_0x266b9d});if(!_0x26c238[_0x4c3901(0x10f)]){const _0x231230=a119_0x2cece5['relative'](_0x4143ad,_0xaf27ef);_0x58025f[_0x4c3901(0xc8)]({'filePath':_0x231230,'source':_0x32e898,'result':_0x26c238,'isJourney':![]});}}for(const {yamlConfig:_0x33861f,sourcePath:_0x5b8046}of _0x2a73d8[_0x4c3901(0x155)]){const _0x2511a0=readFileSync(_0x5b8046,_0x4c3901(0xdb)),_0x2d2302=a119_0x5c0b2d[_0x4c3901(0x111)](_0x2511a0),_0x2e29f4=validateJourneyDef(_0x33861f,{'source':_0x2511a0,'document':_0x2d2302});if(!_0x2e29f4['valid']){const _0x1e193e=a119_0x2cece5[_0x4c3901(0x116)](_0x4143ad,_0x5b8046);_0x58025f[_0x4c3901(0xc8)]({'filePath':_0x1e193e,'source':_0x2511a0,'result':_0x2e29f4,'isJourney':!![]});}}return _0x58025f;}export function formatValidationErrors(_0x113d64){const _0x3b7ca6=a119_0x43758d,_0x14f593=[];for(const {filePath:_0x5df5fe,source:_0xaba232,result:_0x255fee,isJourney:_0x2c954e}of _0x113d64){const _0x1180a7=_0x2c954e?_0x3b7ca6(0x1a0):'segment';_0x14f593[_0x3b7ca6(0xc8)]('\x0a'+_0x5df5fe+'\x20('+_0x1180a7+'):\x20'+_0x255fee[_0x3b7ca6(0x138)]['length']+_0x3b7ca6(0x14c)),_0x14f593[_0x3b7ca6(0xc8)](formatValidationResult(_0x255fee,_0xaba232,_0x5df5fe));}return _0x14f593[_0x3b7ca6(0xf8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x49c47f){const _0x549a4d=a119_0x43758d,_0x369379=new Set(),_0x4fe455=new Map(),_0x34ec7d=collectSegmentUsageCounts(_0x49c47f);if(_0x49c47f[_0x549a4d(0x16d)])for(const [_0x53e61b,_0x3cb4b6]of Object[_0x549a4d(0x17d)](_0x49c47f[_0x549a4d(0x16d)])){_0x369379[_0x549a4d(0x133)](_0x53e61b);if(_0x3cb4b6[_0x549a4d(0xea)]){const _0x59004e=yamlRuleToApi(_0x3cb4b6[_0x549a4d(0xea)]),_0x4f4d12=apiRuleToYaml(_0x59004e);_0x4fe455[_0x549a4d(0x113)](_0x53e61b,_0x4f4d12);}}const _0x56900b=new Map();let _0x12f29f=0x0;for(const [_0x592a2c,_0x4c54df]of _0x4fe455){const _0x184951=serializeExpandedRule(_0x4c54df,_0x4fe455),_0x41bbb3=_0x56900b['get'](_0x184951)||[];_0x41bbb3[_0x549a4d(0xc8)]({'name':_0x592a2c,'index':_0x12f29f}),_0x56900b[_0x549a4d(0x113)](_0x184951,_0x41bbb3),_0x12f29f++;}const _0x376d0b=new Map();for(const [_0xe79a16,_0x14e1a9]of _0x56900b){const _0x527596=_0x14e1a9['slice']()[_0x549a4d(0x189)]((_0x59c6b3,_0x475429)=>{const _0x1a31f9=_0x549a4d,_0x236bdb=_0x34ec7d[_0x1a31f9(0x13b)](_0x59c6b3[_0x1a31f9(0x18f)])||0x0,_0x11cf4d=_0x34ec7d[_0x1a31f9(0x13b)](_0x475429[_0x1a31f9(0x18f)])||0x0;if(_0x236bdb!==_0x11cf4d)return _0x11cf4d-_0x236bdb;return _0x59c6b3['index']-_0x475429[_0x1a31f9(0xdf)];})['map'](_0x3ca10c=>_0x3ca10c[_0x549a4d(0x18f)]),_0x8957a5=[];for(const _0x57b932 of _0x527596){const _0x2f3e8e=_0x34ec7d[_0x549a4d(0x13b)](_0x57b932)||0x0,_0x571b5b=Math[_0x549a4d(0xd6)](_0x2f3e8e,0x1);for(let _0x4444a4=0x0;_0x4444a4<_0x571b5b;_0x4444a4++){_0x8957a5['push'](_0x57b932);}}_0x376d0b[_0x549a4d(0x113)](_0xe79a16,_0x8957a5);}return{'existingLocalSegmentNames':_0x369379,'localSegmentRules':_0x4fe455,'localExpandedRuleToNames':_0x376d0b};}async function buildServerSegmentRuleMap(_0x2310c6,_0x1f5e3d,_0x45ea89,_0x2e861e){const _0x3a9268=new Map(),_0x5281e2=new Set(),_0x23718b=async _0x1aa2c7=>{const _0x302c2c=a119_0x1c83;if(_0x5281e2['has'](_0x1aa2c7))return;_0x5281e2[_0x302c2c(0x133)](_0x1aa2c7);let _0x196321=_0x45ea89[_0x302c2c(0x18d)](_0x36d15c=>_0x36d15c['id']===_0x1aa2c7);if(!_0x196321)try{_0x196321=await _0x2310c6[_0x302c2c(0x12b)][_0x302c2c(0x131)](_0x1f5e3d,_0x1aa2c7);}catch{return;}if(!_0x196321?.['rule'])return;const _0x259bf6=apiRuleToYaml(_0x196321[_0x302c2c(0xea)]);_0x3a9268[_0x302c2c(0x113)](_0x1aa2c7,_0x259bf6);const _0x5586db=collectSegmentRefsFromRule(_0x259bf6);for(const _0x4fb34d of _0x5586db){await _0x23718b(_0x4fb34d);}};for(const _0x2d7925 of _0x2e861e){await _0x23718b(_0x2d7925);}return _0x3a9268;}export function createSegmentIdResolver(_0x5b551e,_0x50277c){return async _0x511611=>{const _0x24c6cf=a119_0x1c83,_0x48d783=_0x5b551e[_0x24c6cf(0x13b)](_0x511611);if(!_0x48d783)throw new SDKError(ErrorCode[_0x24c6cf(0x14d)],_0x24c6cf(0x154)+_0x511611+_0x24c6cf(0x17e)+_0x50277c+'\x27)');return _0x48d783;};}export function extractRootFolderId(_0x275dd7){const _0x5e9a39=a119_0x43758d;return _0x275dd7[_0x5e9a39(0x105)]?.['parentSegmentFolder']?.[_0x5e9a39(0x11f)]?.['id']||_0x275dd7[_0x5e9a39(0x105)]?.[_0x5e9a39(0x101)]?.['data']?.['id'];}export function buildConnectionMaps(_0x54db24){const _0x1a3546=a119_0x43758d,_0x5e67a4=new Map(),_0x39f82c=new Map(),_0x4d62f0=new Map();for(const _0xce9a40 of _0x54db24){_0x5e67a4[_0x1a3546(0x113)](_0xce9a40[_0x1a3546(0x18f)],parseInt(_0xce9a40['id'],0xa)),_0x39f82c['set'](_0xce9a40['id'],_0xce9a40[_0x1a3546(0x18f)]),_0x4d62f0[_0x1a3546(0x113)](_0xce9a40[_0x1a3546(0x18f)],_0xce9a40[_0x1a3546(0x121)]);}return{'nameToId':_0x5e67a4,'idToName':_0x39f82c,'nameToType':_0x4d62f0};}export function calculatePushStats(_0x1969a8,_0x41ae4c,_0x95f914,_0x4174d3,_0x1147d6,_0x22e699,_0x3befab){const _0x1efe1c=a119_0x43758d,_0x3c9679=_0x1969a8[_0x1efe1c(0x179)](_0x21e323=>_0x21e323[_0x1efe1c(0xe2)]),_0x21c7b4=_0x1969a8['filter'](_0x2a29e4=>!_0x2a29e4['isNew']&&_0x2a29e4['hasChanges']),_0x313cf0=_0x1969a8['filter'](_0x38d1fd=>!_0x38d1fd[_0x1efe1c(0xe2)]&&!_0x38d1fd[_0x1efe1c(0x112)]),_0x3345aa=_0x22e699?_0x4174d3:[],_0x2d7c15=_0x41ae4c[_0x1efe1c(0x179)](_0x3e6ea7=>_0x3e6ea7[_0x1efe1c(0xe2)]),_0x1f3765=_0x41ae4c['filter'](_0xfea02=>!_0xfea02[_0x1efe1c(0xe2)]&&_0xfea02['hasChanges']),_0x9d0177=_0x41ae4c[_0x1efe1c(0x179)](_0x3229a4=>!_0x3229a4['isNew']&&!_0x3229a4[_0x1efe1c(0x112)]),_0x4431df=_0x22e699?_0x1147d6:[],_0x341937=_0x1969a8[_0x1efe1c(0x19b)](_0x2446b8=>_0x2446b8[_0x1efe1c(0xee)]),_0x1002d8=_0x341937[_0x1efe1c(0x179)](_0x21511e=>_0x21511e['type']===_0x1efe1c(0x174)),_0x37ff3b=_0x341937[_0x1efe1c(0x179)](_0x5b0777=>_0x5b0777['type']===_0x1efe1c(0x13c)),_0x55bd29=_0x341937[_0x1efe1c(0x179)](_0x2feda2=>_0x2feda2[_0x1efe1c(0x121)]===_0x1efe1c(0x166)),_0x717f22=Array[_0x1efe1c(0xe8)](_0x95f914)[_0x1efe1c(0x189)](),_0x4d5e01=_0x3befab?![]:_0x3c9679['length']>0x0||_0x21c7b4[_0x1efe1c(0x18e)]>0x0||_0x3345aa[_0x1efe1c(0x18e)]>0x0,_0x139c12=_0x2d7c15[_0x1efe1c(0x18e)]>0x0||_0x1f3765[_0x1efe1c(0x18e)]>0x0||_0x4431df[_0x1efe1c(0x18e)]>0x0,_0x2d0b30=_0x3befab?![]:_0x341937[_0x1efe1c(0x18e)]>0x0,_0x5916ed=_0x717f22[_0x1efe1c(0x18e)]>0x0;return{'segments':{'new':_0x3c9679,'changed':_0x21c7b4,'unchanged':_0x313cf0,'toDelete':_0x3345aa},'journeys':{'new':_0x2d7c15,'changed':_0x1f3765,'unchanged':_0x9d0177,'toDelete':_0x4431df},'activations':{'all':_0x341937,'toCreate':_0x1002d8,'toUpdate':_0x37ff3b,'toDelete':_0x55bd29},'folders':{'toCreate':_0x717f22},'counts':{'segments':{'new':_0x3c9679['length'],'changed':_0x21c7b4['length'],'unchanged':_0x313cf0[_0x1efe1c(0x18e)],'toDelete':_0x3345aa[_0x1efe1c(0x18e)]},'journeys':{'new':_0x2d7c15['length'],'changed':_0x1f3765['length'],'unchanged':_0x9d0177[_0x1efe1c(0x18e)],'toDelete':_0x4431df[_0x1efe1c(0x18e)]},'activations':{'create':_0x1002d8[_0x1efe1c(0x18e)],'update':_0x37ff3b[_0x1efe1c(0x18e)],'delete':_0x55bd29[_0x1efe1c(0x18e)]},'folders':_0x717f22['length']},'hasChanges':_0x4d5e01||_0x139c12||_0x2d0b30||_0x5916ed};}export async function buildPushExecutionContext(_0x42e8e8,_0x348b7a,_0x33c1a3,_0x14f13d,_0x42cbfd,_0x1290b6){const _0x1de224=a119_0x43758d,_0x48c011=extractRootFolderId(_0x33c1a3),{pathToId:_0x4b45dd,idToPath:_0x519586}=buildFolderMaps(_0x42cbfd),_0x2d3d0c=buildSegmentNameToIdMap(_0x14f13d),_0x293f3b=new Map(),{batchAsync:_0x1397c6}=await import(_0x1de224(0xd7)),[_0x26236e,_0xa320ac]=await Promise['all']([_0x42e8e8['user'][_0x1de224(0x15d)](),_0x42e8e8[_0x1de224(0xe5)][_0x1de224(0xd8)](),((async()=>{const _0x1b0481=_0x1de224;!_0x1290b6&&_0x14f13d[_0x1b0481(0x18e)]>0x0&&await _0x1397c6(_0x14f13d,async _0x42fc3c=>{const _0x20bfdd=_0x1b0481,_0x1546bb=await _0x42e8e8[_0x20bfdd(0x12b)][_0x20bfdd(0x139)](_0x348b7a,_0x42fc3c['id']);_0x293f3b[_0x20bfdd(0x113)](_0x42fc3c['id'],_0x1546bb);});})())]),{emailToId:_0x45666d,idToEmail:_0x25f2ec}=_0x26236e,_0x237a21=buildConnectionMaps(_0xa320ac);return{'rootFolderId':_0x48c011,'folderPathToId':_0x4b45dd,'folderIdToPath':_0x519586,'segmentNameToId':_0x2d3d0c,'activationsBySegmentId':_0x293f3b,'emailToIdMap':_0x45666d,'idToEmailMap':_0x25f2ec,'connectionNameToIdMap':_0x237a21['nameToId'],'connectionIdToNameMap':_0x237a21[_0x1de224(0xeb)],'connectionNameToTypeMap':_0x237a21['nameToType']};}export function createPushYamlContextForBundle(_0x15e6b2,_0x2301fd,_0x51173c,_0x571226,_0x898ed1,_0x2193a1,_0x32cb4b,_0x23bec4){const {existingLocalSegmentNames:_0xeb4943,localExpandedRuleToNames:_0x546b40}=_0x571226,_0x12b2bf=new Set(),_0x1f1f63=new Map(),_0x6a9af4=new Map(),_0x1e6c12=new Map(),_0x32e37a=createJumpTargetCache(),_0x2d2d60=new Map(),_0xcede78=new Map(),_0x1593f0=new Set();let _0x1d8bdd;const _0x3193e8=_0xf9c7f=>{const _0x24258a={'resolveSegment':async _0x477600=>{const _0x22af92=a119_0x1c83,_0x36dd52=_0x1e6c12[_0x22af92(0x13b)](_0x477600);if(_0x36dd52!==undefined)return{'name':_0x36dd52,'isJourneyLocal':!![]};try{let _0x57c53f=_0x51173c[_0x22af92(0x18d)](_0x4aae93=>_0x4aae93['id']===_0x477600);!_0x57c53f&&(_0x57c53f=await _0x15e6b2[_0x22af92(0x12b)][_0x22af92(0x131)](_0x2301fd,_0x477600));const _0x419f79=generateJourneyLocalName(_0x57c53f[_0x22af92(0x18f)]),_0x27d51d=_0x57c53f[_0x22af92(0x12a)]===SEGMENT_KIND_JOURNEY&&_0x419f79!==undefined;let _0xc0df=_0x57c53f[_0x22af92(0x18f)],_0x7c707f;if(_0x27d51d&&_0x57c53f['rule']){const _0x1dd539=apiRuleToYaml(_0x57c53f['rule']);_0xcede78['set'](_0x477600,_0x1dd539);const _0x17a1dd=async _0x1d928f=>{const _0x30a0f1=_0x22af92,_0x1a9e09=collectSegmentRefsFromRule(_0x1d928f);for(const _0x4a7eb0 of _0x1a9e09){if(!_0xcede78[_0x30a0f1(0xce)](_0x4a7eb0))try{const _0x3580f4=await _0x15e6b2[_0x30a0f1(0x12b)][_0x30a0f1(0x131)](_0x2301fd,_0x4a7eb0);if(_0x3580f4?.[_0x30a0f1(0xea)]){const _0x5cd357=apiRuleToYaml(_0x3580f4[_0x30a0f1(0xea)]);_0xcede78['set'](_0x4a7eb0,_0x5cd357),await _0x17a1dd(_0x5cd357);}}catch{}}};await _0x17a1dd(_0x1dd539);const _0x11513c=serializeExpandedRule(_0x1dd539,_0xcede78),_0x2f1b05=_0x546b40[_0x22af92(0x13b)](_0x11513c);if(_0x2f1b05&&_0x2f1b05[_0x22af92(0x18e)]>0x0){const _0x5bed9a=_0x1f1f63[_0x22af92(0x13b)](_0x11513c)||0x0,_0x1d937e=_0x2f1b05[_0x5bed9a]||_0x2f1b05[_0x2f1b05[_0x22af92(0x18e)]-0x1];_0x1f1f63[_0x22af92(0x113)](_0x11513c,_0x5bed9a+0x1),_0xc0df=_0x1d937e,_0x12b2bf[_0x22af92(0x133)](_0xc0df),_0x1e6c12[_0x22af92(0x113)](_0x477600,_0xc0df);const _0x126cd7=await resolveRuleSegmentRefs(_0x1dd539,async _0x27871b=>{const _0x307aa5=_0x22af92,_0x1039b3=_0x1e6c12['get'](_0x27871b);if(_0x1039b3)return _0x1039b3;const _0x270389=await _0x1d8bdd[_0x307aa5(0x11d)](_0x27871b);return _0x270389[_0x307aa5(0x18f)];});_0x7c707f={'description':_0x57c53f[_0x22af92(0x11a)],'rule':_0x126cd7};}else{const _0x5be40b=_0x2d2d60[_0x22af92(0x13b)](_0x11513c);if(_0x5be40b)_0xc0df=_0x5be40b,_0x1e6c12[_0x22af92(0x113)](_0x477600,_0xc0df);else{if(_0x419f79){let _0x16cccb=_0x419f79,_0x97c4b5=0x2;while(_0x12b2bf['has'](_0x16cccb)||_0xeb4943[_0x22af92(0xce)](_0x16cccb)){_0x16cccb=_0x419f79+'_'+_0x97c4b5,_0x97c4b5++;}_0x12b2bf['add'](_0x16cccb),_0xc0df=_0x16cccb;}_0x1e6c12['set'](_0x477600,_0xc0df),_0x2d2d60[_0x22af92(0x113)](_0x11513c,_0xc0df);const _0x267b67=await resolveRuleSegmentRefs(_0x1dd539,async _0xf94fe2=>{const _0x34bf90=_0x22af92,_0x54b1c9=_0x1e6c12[_0x34bf90(0x13b)](_0xf94fe2);if(_0x54b1c9)return _0x54b1c9;const _0x455aae=await _0x1d8bdd[_0x34bf90(0x11d)](_0xf94fe2);return _0x455aae[_0x34bf90(0x18f)];});_0x7c707f={'description':_0x57c53f[_0x22af92(0x11a)],'rule':_0x267b67};}}}return{'name':_0xc0df,'isJourneyLocal':_0x27d51d,'definition':_0x7c707f};}catch{return{'name':_0x477600,'isJourneyLocal':![]};}},'resolveActivation':async _0x4f2d1e=>{const _0x13a2c0=a119_0x1c83,_0x32bb66=_0x6a9af4[_0x13a2c0(0x13b)](_0x4f2d1e);if(_0x32bb66!==undefined)return{'name':_0x32bb66,'isJourneyLocal':!![]};try{let _0x125199=_0x32cb4b?.['get'](_0x4f2d1e);!_0x125199&&(_0x125199=await _0x15e6b2[_0x13a2c0(0x1a0)]['getActivation'](_0xf9c7f,_0x4f2d1e));const _0x1bb0e7=_0x125199[_0x13a2c0(0x125)][_0x13a2c0(0x185)][_0x13a2c0(0x18f)]||_0x4f2d1e,_0x3accf1=sanitizeYamlKey(_0x1bb0e7)||'activation_'+_0x4f2d1e,_0x30017f=_0x3accf1;_0x6a9af4[_0x13a2c0(0x113)](_0x4f2d1e,_0x30017f);const _0x736b8d=journeyActivationStepToYaml(_0x125199,_0x898ed1,_0x2193a1);return{'name':_0x30017f,'isJourneyLocal':!![],'definition':_0x736b8d};}catch{return{'name':_0x4f2d1e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x41cf87,_0x4f0a9d)=>resolveJumpTarget(_0x41cf87,_0x4f0a9d,_0x32e37a,async _0x5c8453=>{const _0x23fbe6=a119_0x1c83,_0x25e811=_0x23bec4?.[_0x23fbe6(0x13b)](_0x5c8453);if(_0x25e811)return _0x25e811;return _0x15e6b2[_0x23fbe6(0x1a0)]['getJourney'](_0x5c8453);})};return _0x1d8bdd=_0x24258a,_0x24258a;},_0x4e6479=async _0x27a919=>{const _0x4bb712=a119_0x1c83,{collectSegmentIdsFromJourneyApi:_0x42f1c9}=await import(_0x4bb712(0x19a)),{batchAsync:_0x3056e5}=await import('../../utils/async.js'),_0x5509bc=new Set();for(const _0x1d2067 of _0x27a919){let _0x2c24de=_0x23bec4?.[_0x4bb712(0x13b)](_0x1d2067);!_0x2c24de&&(_0x2c24de=await _0x15e6b2['journey'][_0x4bb712(0x115)](_0x1d2067));const _0x7dae=_0x42f1c9(_0x2c24de);for(const _0x43a697 of _0x7dae){_0x5509bc['add'](_0x43a697);}}let _0x554aba=Array[_0x4bb712(0xe8)](_0x5509bc);while(_0x554aba['length']>0x0){const _0x4d92df=_0x554aba['filter'](_0x3be8c7=>!_0x1593f0[_0x4bb712(0xce)](_0x3be8c7));if(_0x4d92df[_0x4bb712(0x18e)]===0x0)break;const _0xf94756=await _0x3056e5(_0x4d92df,async _0x173a6a=>{const _0x212fa1=_0x4bb712;_0x1593f0[_0x212fa1(0x133)](_0x173a6a);let _0x3cbcc0=_0x51173c[_0x212fa1(0x18d)](_0x2515ee=>_0x2515ee['id']===_0x173a6a);if(!_0x3cbcc0)try{_0x3cbcc0=await _0x15e6b2[_0x212fa1(0x12b)][_0x212fa1(0x131)](_0x2301fd,_0x173a6a);}catch{return null;}return{'segmentId':_0x173a6a,'segment':_0x3cbcc0};},0xa),_0x2cbc0b=new Set();for(const _0x259f30 of _0xf94756){if(!_0x259f30?.[_0x4bb712(0x12b)]?.[_0x4bb712(0xea)])continue;const _0x3d4a97=apiRuleToYaml(_0x259f30['segment'][_0x4bb712(0xea)]);_0xcede78[_0x4bb712(0x113)](_0x259f30[_0x4bb712(0x160)],_0x3d4a97);const _0x2c83fb=collectSegmentRefsFromRule(_0x3d4a97);for(const _0x4289db of _0x2c83fb){!_0x1593f0[_0x4bb712(0xce)](_0x4289db)&&_0x2cbc0b[_0x4bb712(0x133)](_0x4289db);}}_0x554aba=Array[_0x4bb712(0xe8)](_0x2cbc0b);}};return{'createYamlContext':_0x3193e8,'prefetchJourneySegments':_0x4e6479};}export async function executePushSegments(_0x20ede2,_0x2c3e3a,_0x49bbe2,_0x10aecd,_0x39805a){const _0x1d2575=a119_0x43758d,{segmentDefToCreateRequest:_0x16e030,segmentDefToUpdateRequest:_0x1d7a3d}=await import(_0x1d2575(0x118)),_0x5dff40=_0x49bbe2[_0x1d2575(0x148)],_0xaf298a=0x5,_0x4b9dd0=async _0x22502f=>{const _0x158159=_0x1d2575,_0x544a2c=_0x22502f['folderPath']?_0x5dff40[_0x158159(0x13b)](_0x22502f[_0x158159(0x187)]):undefined;let _0x43336b;const _0x18ebb7={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x22502f[_0x158159(0xe2)]){_0x39805a[_0x158159(0x108)]?.({'type':_0x158159(0x106),'name':_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]});const _0x3391cc=_0x16e030(_0x22502f[_0x158159(0x152)],_0x544a2c),_0x551ce8=await _0x39805a[_0x158159(0xf3)](_0x158159(0x184)+_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]+'\x27...',()=>_0x20ede2[_0x158159(0x12b)][_0x158159(0xe4)](_0x10aecd[_0x158159(0xdc)],_0x3391cc));_0x43336b=_0x551ce8['data']['id'],_0x18ebb7['createdSegmentId']={'name':_0x22502f[_0x158159(0x152)]['name'],'id':_0x43336b},_0x39805a['onProgress']?.({'type':'segment_created','name':_0x22502f[_0x158159(0x152)]['name'],'segmentId':_0x43336b}),_0x39805a[_0x158159(0xc4)]?.('Created\x20segment\x20\x27'+_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]+'\x27'),_0x18ebb7[_0x158159(0x15c)]=0x1;}else{if(_0x22502f['hasChanges']){_0x39805a[_0x158159(0x108)]?.({'type':_0x158159(0xcd),'name':_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]});const _0x4fd16d=_0x1d7a3d(_0x22502f[_0x158159(0x152)]);_0x544a2c!==_0x22502f[_0x158159(0x102)]?.[_0x158159(0x146)]&&(_0x4fd16d[_0x158159(0x146)]=_0x544a2c?parseInt(_0x544a2c,0xa):undefined),await _0x39805a[_0x158159(0xf3)]('Updating\x20segment\x20\x27'+_0x22502f['yamlConfig'][_0x158159(0x18f)]+_0x158159(0x175),()=>_0x20ede2[_0x158159(0x12b)][_0x158159(0x182)](_0x10aecd[_0x158159(0xdc)],_0x22502f[_0x158159(0x102)]['id'],_0x4fd16d)),_0x43336b=_0x22502f[_0x158159(0x102)]['id'],_0x39805a[_0x158159(0x108)]?.({'type':'segment_updated','name':_0x22502f[_0x158159(0x152)]['name']}),_0x39805a[_0x158159(0xc4)]?.(_0x158159(0x169)+_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]+'\x27'),_0x18ebb7['updated']=0x1;}else _0x43336b=_0x22502f[_0x158159(0x102)]['id'];}}catch(_0x2ce552){const _0x55c1b7=isHttp400Error(_0x2ce552),_0x3490d7=_0x55c1b7?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x226ee8=getErrorMessage(_0x2ce552);throw new SDKError(_0x3490d7,'Failed\x20to\x20'+(_0x22502f[_0x158159(0xe2)]?_0x158159(0x174):_0x158159(0x13c))+'\x20segment\x20from\x20file:\x20'+_0x22502f[_0x158159(0x170)]+_0x158159(0x16e)+_0x226ee8,_0x2ce552);}try{const _0x549c0e=await syncActivationsForSegment(_0x20ede2,_0x10aecd['parentId'],_0x43336b,_0x22502f['yamlConfig'][_0x158159(0x18f)],_0x22502f[_0x158159(0xee)],_0x39805a,_0x22502f[_0x158159(0x170)]);_0x18ebb7[_0x158159(0x156)]=_0x549c0e;}catch(_0x4ebeaa){if(_0x4ebeaa instanceof SDKError)throw _0x4ebeaa;throw new SDKError(ErrorCode[_0x158159(0x10e)],_0x158159(0xe6)+_0x22502f[_0x158159(0x152)]['name']+_0x158159(0x19f)+_0x22502f['absolutePath']+_0x158159(0x16e)+getErrorMessage(_0x4ebeaa),_0x4ebeaa);}return _0x18ebb7;},_0x36ecea=await batchAsync(_0x2c3e3a,_0x4b9dd0,_0xaf298a),_0x2ddeab={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5c7fea of _0x36ecea){_0x2ddeab[_0x1d2575(0x15c)]+=_0x5c7fea[_0x1d2575(0x15c)],_0x2ddeab[_0x1d2575(0x120)]+=_0x5c7fea[_0x1d2575(0x120)],_0x5c7fea['createdSegmentId']&&_0x2ddeab[_0x1d2575(0x190)][_0x1d2575(0x113)](_0x5c7fea[_0x1d2575(0xd2)][_0x1d2575(0x18f)],_0x5c7fea['createdSegmentId']['id']),_0x2ddeab[_0x1d2575(0x156)][_0x1d2575(0x15c)]+=_0x5c7fea['activations'][_0x1d2575(0x15c)],_0x2ddeab[_0x1d2575(0x156)]['updated']+=_0x5c7fea['activations'][_0x1d2575(0x120)],_0x2ddeab['activations'][_0x1d2575(0x153)]+=_0x5c7fea[_0x1d2575(0x156)][_0x1d2575(0x153)];}return _0x2ddeab;}async function syncActivationsForSegment(_0x4d4eaa,_0x1815f0,_0x388242,_0x5dcad3,_0x318b1d,_0x50a865,_0x1675bb){const _0xd8a467=a119_0x43758d,_0x19a0b7={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x6605df of _0x318b1d){try{if(_0x6605df['type']===_0xd8a467(0x174)&&_0x6605df[_0xd8a467(0xd3)])_0x50a865['onProgress']?.({'type':'activation_creating','segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),await _0x50a865[_0xd8a467(0xf3)]('Creating\x20activation\x20\x27'+_0x6605df[_0xd8a467(0x18f)]+_0xd8a467(0x175),()=>_0x4d4eaa[_0xd8a467(0x12b)][_0xd8a467(0x14b)](_0x1815f0,_0x388242,_0x6605df[_0xd8a467(0xd3)])),_0x50a865[_0xd8a467(0x108)]?.({'type':_0xd8a467(0x159),'segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),_0x50a865[_0xd8a467(0xc4)]?.(_0xd8a467(0xff)+_0x6605df[_0xd8a467(0x18f)]+'\x27'),_0x19a0b7[_0xd8a467(0x15c)]++;else{if(_0x6605df[_0xd8a467(0x121)]===_0xd8a467(0x13c)&&_0x6605df[_0xd8a467(0xd3)]&&_0x6605df[_0xd8a467(0x114)])_0x50a865['onProgress']?.({'type':_0xd8a467(0x178),'segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),await _0x50a865[_0xd8a467(0xf3)](_0xd8a467(0x167)+_0x6605df[_0xd8a467(0x18f)]+_0xd8a467(0x175),()=>_0x4d4eaa[_0xd8a467(0x12b)][_0xd8a467(0x135)](_0x1815f0,_0x388242,_0x6605df['existingActivation']['id'],_0x6605df[_0xd8a467(0xd3)])),_0x50a865[_0xd8a467(0x108)]?.({'type':'activation_updated','segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),_0x50a865[_0xd8a467(0xc4)]?.(_0xd8a467(0xe3)+_0x6605df[_0xd8a467(0x18f)]+'\x27'),_0x19a0b7['updated']++;else _0x6605df['type']===_0xd8a467(0x166)&&_0x6605df[_0xd8a467(0x114)]&&(_0x50a865[_0xd8a467(0x108)]?.({'type':'activation_deleting','segmentName':_0x5dcad3,'activationName':_0x6605df['name']}),await _0x50a865[_0xd8a467(0xf3)](_0xd8a467(0x165)+_0x6605df['name']+'\x27...',()=>_0x4d4eaa['segment'][_0xd8a467(0xef)](_0x1815f0,_0x388242,_0x6605df[_0xd8a467(0x114)]['id'])),_0x50a865[_0xd8a467(0x108)]?.({'type':_0xd8a467(0x150),'segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),_0x50a865[_0xd8a467(0xc2)]?.(_0xd8a467(0x18b)+_0x6605df[_0xd8a467(0x18f)]+'\x27'),_0x19a0b7[_0xd8a467(0x153)]++);}}catch(_0x87d773){const _0x283472=isHttp400Error(_0x87d773),_0x1baf0b=_0x283472?ErrorCode[_0xd8a467(0x18a)]:ErrorCode[_0xd8a467(0x10e)],_0x342bf3=getErrorMessage(_0x87d773);throw new SDKError(_0x1baf0b,_0xd8a467(0x161)+_0x6605df[_0xd8a467(0x121)]+'\x20activation\x20\x27'+_0x6605df[_0xd8a467(0x18f)]+_0xd8a467(0x19f)+_0x1675bb+_0xd8a467(0x16e)+_0x342bf3,_0x87d773);}}return _0x19a0b7;}export async function executePushFolders(_0x29d616,_0x488ac2,_0x390827,_0x3835b9,_0x1689b5){const _0x2691c7=a119_0x43758d,_0x43e518=new Map(_0x390827);for(const _0x117528 of _0x488ac2){const _0x548dc4=_0x117528[_0x2691c7(0x107)]('/'),_0x3f31ce=_0x548dc4[_0x548dc4[_0x2691c7(0x18e)]-0x1],_0x146753=_0x548dc4[_0x2691c7(0x129)](0x0,-0x1)[_0x2691c7(0xf8)]('/'),_0x9586f=_0x43e518['get'](_0x146753);_0x1689b5[_0x2691c7(0x108)]?.({'type':'folder_creating','folder':_0x117528});const _0x327e78={'name':_0x3f31ce,'parentFolderId':_0x9586f},_0x429aa6=await _0x1689b5[_0x2691c7(0xf3)](_0x2691c7(0x176)+_0x117528+_0x2691c7(0x175),()=>_0x29d616['segment'][_0x2691c7(0xc1)](_0x3835b9[_0x2691c7(0xdc)],_0x327e78));_0x43e518['set'](_0x117528,_0x429aa6[_0x2691c7(0x11f)]['id']),_0x1689b5[_0x2691c7(0x108)]?.({'type':_0x2691c7(0x157),'folder':_0x117528,'folderId':_0x429aa6[_0x2691c7(0x11f)]['id']}),_0x1689b5[_0x2691c7(0x134)]?.(_0x2691c7(0x17f)+_0x117528+'\x27');}return _0x43e518;}export async function executePushSegmentDeletions(_0x3362db,_0x1deaf6,_0x4e4182){const _0x97646d=a119_0x43758d;if(_0x1deaf6[_0x97646d(0x18e)]===0x0)return 0x0;const {batchAsync:_0x12ac5b}=await import(_0x97646d(0xd7)),_0x49fcf8=0x5,_0x10ea73=await _0x12ac5b(_0x1deaf6,async _0xb4c8e8=>{const _0x419498=_0x97646d;return _0x4e4182[_0x419498(0x108)]?.({'type':_0x419498(0x13f),'name':_0xb4c8e8['name']}),await _0x3362db[_0x419498(0x12b)][_0x419498(0xfe)](_0xb4c8e8['id']),_0x4e4182[_0x419498(0x108)]?.({'type':_0x419498(0xf5),'name':_0xb4c8e8['name']}),_0x4e4182[_0x419498(0xc2)]?.('Deleted\x20segment\x20\x27'+_0xb4c8e8[_0x419498(0x18f)]+'\x27'),0x1;},_0x49fcf8);return _0x10ea73[_0x97646d(0x136)]((_0x98658,_0x114b0c)=>_0x98658+_0x114b0c,0x0);}export async function executePushJourneys(_0x31575f,_0x4e3120,_0xee3e3a,_0x184379,_0x1a368c){const _0x2178a9=a119_0x43758d,{journeyDefToRequest:_0x67097c}=await import(_0x2178a9(0x19a)),{activationDefToCreateRequest:_0x5de3d0,yamlRuleToApi:_0x2d3f50,validateSegmentRule:_0x4ac4cd}=await import(_0x2178a9(0x118)),_0x481ffd={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x96491b=new Map(_0xee3e3a[_0x2178a9(0xe7)]),_0x748a68=0x5;for(let _0x376c18=0x0;_0x376c18<_0x4e3120['length'];_0x376c18+=_0x748a68){const _0x9d6e96=_0x4e3120[_0x2178a9(0x129)](_0x376c18,_0x376c18+_0x748a68),_0x5d3a91=await Promise['all'](_0x9d6e96['map'](async _0x114992=>{const _0x58800d=_0x2178a9;if(!_0x114992['isNew']&&!_0x114992['hasChanges'])return{'action':'unchanged','name':_0x114992[_0x58800d(0x152)][_0x58800d(0x18f)],'journeyId':_0x114992[_0x58800d(0xca)]?.['id']};const _0x1aac0e=_0x114992['folderPath']?_0xee3e3a[_0x58800d(0x148)][_0x58800d(0x13b)](_0x114992[_0x58800d(0x187)]):undefined;_0x1a368c[_0x58800d(0x108)]?.({'type':_0x114992['isNew']?'journey_creating':'journey_updating','name':_0x114992['yamlConfig'][_0x58800d(0x18f)]});try{const _0x39deac=await executeSingleJourneyPush(_0x31575f,_0x114992,{..._0xee3e3a,'segmentNameToId':_0x96491b},{'parentId':_0x184379['parentId'],'rootFolderId':_0x184379[_0x58800d(0x117)],'folderId':_0x1aac0e,'verbose':_0x184379[_0x58800d(0x11c)]},_0x1a368c,{'journeyDefToRequest':_0x67097c,'activationDefToCreateRequest':_0x5de3d0,'yamlRuleToApi':_0x2d3f50,'validateSegmentRule':_0x4ac4cd});for(const [_0x271f28,_0x5b18d2]of _0x39deac[_0x58800d(0xd9)]){_0x96491b['set'](_0x271f28,_0x5b18d2),_0x481ffd[_0x58800d(0xd9)]['set'](_0x271f28,_0x5b18d2);}if(_0x39deac['action']===_0x58800d(0x15c))_0x1a368c['onProgress']?.({'type':'journey_created','name':_0x114992[_0x58800d(0x152)][_0x58800d(0x18f)],'journeyId':_0x39deac[_0x58800d(0x14a)]}),_0x1a368c[_0x58800d(0xc4)]?.(_0x58800d(0x13e)+_0x114992[_0x58800d(0x152)]['name']+'\x27'),_0x481ffd[_0x58800d(0x15c)]++;else _0x39deac[_0x58800d(0x130)]===_0x58800d(0x120)&&(_0x1a368c[_0x58800d(0x108)]?.({'type':_0x58800d(0x191),'name':_0x114992['yamlConfig']['name']}),_0x1a368c['logSuccess']?.(_0x58800d(0x16c)+_0x114992['yamlConfig']['name']+'\x27'),_0x481ffd[_0x58800d(0x120)]++);return{'action':_0x39deac['action'],'name':_0x114992[_0x58800d(0x152)][_0x58800d(0x18f)],'journeyId':_0x39deac[_0x58800d(0x14a)]};}catch(_0x57ab4d){const _0x2a3c26=isHttp400Error(_0x57ab4d),_0x1362db=_0x2a3c26?ErrorCode[_0x58800d(0x1a2)]:ErrorCode[_0x58800d(0xfd)],_0x591274=getErrorMessage(_0x57ab4d);throw new SDKError(_0x1362db,_0x58800d(0x161)+(_0x114992[_0x58800d(0xe2)]?_0x58800d(0x174):_0x58800d(0x13c))+_0x58800d(0x147)+_0x114992[_0x58800d(0x170)]+'\x0a\x20\x20'+_0x591274,_0x57ab4d);}}));_0x481ffd[_0x2178a9(0x16a)][_0x2178a9(0xc8)](..._0x5d3a91);}return _0x481ffd;}async function executeSingleJourneyPush(_0x511993,_0x1ca6f9,_0x2565a4,_0x6d88d1,_0x1b6963,_0x40b998){const _0x5d3215=a119_0x43758d,{journeyDefToRequest:_0x43019d,activationDefToCreateRequest:_0x13a9c9,yamlRuleToApi:_0x4ad144,validateSegmentRule:_0x1c53e2}=_0x40b998,_0x10020a=new Map(),_0x10d667=new Map(),_0x283085=new Map(),_0x1c7694=new Map(),_0x40f193=new Map();let _0x25e585;const _0x5a321e=async()=>{const _0x3ec7f8=a119_0x1c83;if(_0x25e585)return;_0x25e585=new Map();if(!_0x1ca6f9['existingJourney'])return;const _0x4935b0=await _0x511993['journey']['listActivations'](_0x1ca6f9[_0x3ec7f8(0xca)]['id']);for(const _0x304d4c of _0x4935b0){const _0x18736d=journeyActivationStepToYaml(_0x304d4c,_0x2565a4['idToEmailMap'],_0x2565a4[_0x3ec7f8(0x132)]),_0x1404d8=activationSignature(_0x18736d);!_0x25e585['has'](_0x1404d8)&&_0x25e585['set'](_0x1404d8,_0x304d4c['id']),_0x18736d[_0x3ec7f8(0x18f)]&&_0x10d667['set'](_0x18736d[_0x3ec7f8(0x18f)],_0x304d4c['id']);}};if(_0x1ca6f9[_0x5d3215(0xca)]&&_0x1ca6f9[_0x5d3215(0x152)]['segments']){const _0xd72da5=buildLocalExpandedRuleMappings(_0x1ca6f9[_0x5d3215(0x152)]),_0x495661=_0xd72da5[_0x5d3215(0x12e)];if(_0x495661[_0x5d3215(0xd1)]>0x0){const _0x51acfc=new Map();for(const [_0x5e11ca,_0x31b7e0]of _0x495661){const _0x1ff5da=serializeExpandedRule(_0x31b7e0,_0x495661);_0x51acfc[_0x5d3215(0x113)](_0x5e11ca,_0x1ff5da);}const _0x33cd73=collectSegmentIdsFromJourneyApi(_0x1ca6f9[_0x5d3215(0xca)]);if(_0x33cd73[_0x5d3215(0xd1)]>0x0){const _0x56c2c4=await buildServerSegmentRuleMap(_0x511993,_0x6d88d1[_0x5d3215(0xdc)],_0x2565a4[_0x5d3215(0x10b)],_0x33cd73);if(_0x56c2c4[_0x5d3215(0xd1)]>0x0){const _0x33a92f=new Map();for(const [_0x59e2dc,_0xacc1c8]of _0x56c2c4){const _0xf9cfdf=serializeExpandedRule(_0xacc1c8,_0x56c2c4);!_0x33a92f[_0x5d3215(0xce)](_0xf9cfdf)&&_0x33a92f[_0x5d3215(0x113)](_0xf9cfdf,_0x59e2dc);}for(const [_0xe391d7,_0x8c58a]of _0x51acfc){const _0x36f6aa=_0x33a92f['get'](_0x8c58a);_0x36f6aa&&(_0x40f193[_0x5d3215(0x113)](_0xe391d7,_0x36f6aa),_0x2565a4[_0x5d3215(0xe7)]['set'](_0xe391d7,_0x36f6aa));}}}}}const _0x38629a={'resolveSegmentId':async _0x3386df=>{const _0x3337a5=_0x5d3215,_0x42a4f1=_0x2565a4[_0x3337a5(0xe7)][_0x3337a5(0x13b)](_0x3386df);if(!_0x42a4f1)throw new SDKError(ErrorCode[_0x3337a5(0x14d)],_0x3337a5(0x154)+_0x3386df+_0x3337a5(0x16b)+_0x1ca6f9[_0x3337a5(0x152)][_0x3337a5(0x18f)]+')');return _0x42a4f1;},'resolveEmbeddedSegmentId':async(_0x2de0fb,_0x15c308)=>{const _0x22c931=_0x5d3215,_0x38fdcc=_0x2565a4[_0x22c931(0xe7)][_0x22c931(0x13b)](_0x2de0fb);if(_0x38fdcc)return _0x38fdcc;const _0x5993e5=_0x40f193[_0x22c931(0x13b)](_0x2de0fb);if(_0x5993e5)return _0x2565a4[_0x22c931(0xe7)][_0x22c931(0x113)](_0x2de0fb,_0x5993e5),_0x5993e5;const _0xebf4b2=_0x2565a4['existingSegments'][_0x22c931(0x18d)](_0x4e86a7=>_0x4e86a7['name']===_0x2de0fb);if(_0xebf4b2)return _0x2565a4[_0x22c931(0xe7)][_0x22c931(0x113)](_0x2de0fb,_0xebf4b2['id']),_0xebf4b2['id'];if(_0x1ca6f9[_0x22c931(0xe2)]){const {stageName:_0x36e8e3,criteriaName:_0x5639c3}=findSegmentCriteriaLocation(_0x1ca6f9['yamlConfig'],_0x2de0fb);return _0x1c53e2(_0x2de0fb,_0x15c308[_0x22c931(0xea)]),_0x283085[_0x22c931(0x113)](_0x2de0fb,{'definition':_0x15c308,'stageName':_0x36e8e3,'criteriaName':_0x5639c3}),createPendingSegmentId(_0x2de0fb);}const _0x359a31=_0x1ca6f9[_0x22c931(0xca)]?.['id'];if(!_0x359a31)throw new SDKError(ErrorCode[_0x22c931(0x158)],_0x22c931(0x15e));_0x1c53e2(_0x2de0fb,_0x15c308[_0x22c931(0xea)]);const _0x176bfa=generateDeterministicJourneySegmentName(_0x1ca6f9['yamlConfig'][_0x22c931(0x18f)],_0x2de0fb),_0x2ba379=_0x2565a4[_0x22c931(0x10b)][_0x22c931(0x18d)](_0x52e61c=>_0x52e61c['name']===_0x176bfa),_0x28f2c4=createSegmentIdResolver(_0x2565a4[_0x22c931(0xe7)],_0x2de0fb),_0x26616b=await resolveRuleSegmentIds(_0x15c308[_0x22c931(0xea)],_0x28f2c4);let _0x4f952a;if(_0x2ba379)await _0x511993[_0x22c931(0x12b)][_0x22c931(0x182)](_0x6d88d1[_0x22c931(0xdc)],_0x2ba379['id'],{'description':_0x15c308['description']||_0x22c931(0x110)+_0x2de0fb,'rule':_0x4ad144(_0x26616b,!![]),'countPopulation':!![]}),_0x4f952a=_0x2ba379['id'];else try{_0x4f952a=await _0x511993[_0x22c931(0x12b)][_0x22c931(0x143)]({'name':_0x176bfa,'description':_0x15c308[_0x22c931(0x11a)]||_0x22c931(0x110)+_0x2de0fb,'journeyId':_0x359a31,'rule':_0x4ad144(_0x26616b,!![]),'countPopulation':!![],'parentFolderId':_0x6d88d1['rootFolderId']||'','audienceId':_0x6d88d1[_0x22c931(0xdc)]});}catch(_0x5c0802){const _0x5385de=_0x5c0802 instanceof Error&&_0x5c0802[_0x22c931(0xf1)][_0x22c931(0xe9)](_0x22c931(0x142));if(_0x5385de){const _0x34bd74=await _0x511993[_0x22c931(0x12b)][_0x22c931(0x11b)](_0x6d88d1[_0x22c931(0xdc)]),_0x39a6d4=_0x34bd74['find'](_0x476aed=>_0x476aed[_0x22c931(0x18f)]===_0x176bfa);if(_0x39a6d4)await _0x511993[_0x22c931(0x12b)][_0x22c931(0x182)](_0x6d88d1['parentId'],_0x39a6d4['id'],{'description':_0x15c308[_0x22c931(0x11a)]||_0x22c931(0x110)+_0x2de0fb,'rule':_0x4ad144(_0x26616b,!![]),'countPopulation':!![]}),_0x4f952a=_0x39a6d4['id'];else throw _0x5c0802;}else throw _0x5c0802;}return _0x2565a4[_0x22c931(0xe7)]['set'](_0x2de0fb,_0x4f952a),_0x10020a[_0x22c931(0x113)](_0x2de0fb,_0x4f952a),_0x4f952a;},'resolveActivationId':async _0xc8ea7e=>{const _0x512862=_0x5d3215,_0x36b5cd=_0x10d667[_0x512862(0x13b)](_0xc8ea7e);if(_0x36b5cd)return _0x36b5cd;if(_0x1ca6f9['existingJourney']){await _0x5a321e();const _0x47719b=_0x10d667[_0x512862(0x13b)](_0xc8ea7e);if(_0x47719b)return _0x47719b;}throw new SDKError(ErrorCode[_0x512862(0x13d)],_0x512862(0xc6)+_0xc8ea7e+_0x512862(0x16b)+_0x1ca6f9[_0x512862(0x152)][_0x512862(0x18f)]+').\x20'+_0x512862(0x17c));},'resolveEmbeddedActivationId':async(_0x4cf26e,_0x1ac26e)=>{const _0x24ee75=_0x5d3215,_0x5c608d=_0x10d667[_0x24ee75(0x13b)](_0x4cf26e);if(_0x5c608d)return _0x5c608d;if(_0x1ca6f9[_0x24ee75(0xe2)])return _0x1c7694[_0x24ee75(0x113)](_0x4cf26e,_0x1ac26e),createPendingActivationId(_0x4cf26e);if(_0x1ca6f9[_0x24ee75(0xca)]){await _0x5a321e();const _0x593018=_0x10d667[_0x24ee75(0x13b)](_0x1ac26e[_0x24ee75(0x18f)]);if(_0x593018)return _0x10d667[_0x24ee75(0x113)](_0x4cf26e,_0x593018),_0x593018;const _0x4bf7be=activationSignature(_0x1ac26e),_0x27eed2=_0x25e585?.[_0x24ee75(0x13b)](_0x4bf7be);if(_0x27eed2)return _0x10d667['set'](_0x4cf26e,_0x27eed2),_0x27eed2;const _0x499a51=await _0x13a9c9(_0x1ac26e,_0x2565a4[_0x24ee75(0x177)]),_0x531eba=await _0x511993['journey'][_0x24ee75(0x14b)](_0x1ca6f9[_0x24ee75(0xca)]['id'],_0x499a51);return _0x10d667[_0x24ee75(0x113)](_0x4cf26e,_0x531eba['id']),_0x531eba['id'];}throw new SDKError(ErrorCode[_0x24ee75(0x158)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x47bb26=>{const _0x49764f=_0x5d3215;try{return await _0x511993[_0x49764f(0x1a0)]['resolveJourneyId'](_0x6d88d1[_0x49764f(0xdc)],_0x47bb26);}catch(_0x488ecf){throw new SDKError(ErrorCode[_0x49764f(0x13d)],_0x49764f(0x10c)+_0x47bb26+_0x49764f(0xc7)+_0x1ca6f9[_0x49764f(0x152)][_0x49764f(0x18f)]+'\x27)',_0x488ecf);}},'resolveStageId':async(_0x598cff,_0x94efcc)=>{const _0x590cfc=_0x5d3215,_0x532620=await _0x511993[_0x590cfc(0x1a0)][_0x590cfc(0x115)](_0x598cff),_0x255fc8=_0x532620[_0x590cfc(0x125)]['journeyStages'][_0x590cfc(0x18d)](_0x5610f8=>_0x5610f8['name']['toLowerCase']()===_0x94efcc[_0x590cfc(0x18c)]());if(!_0x255fc8?.['id'])throw new SDKError(ErrorCode[_0x590cfc(0x13d)],_0x590cfc(0x195)+_0x94efcc+_0x590cfc(0x123)+(_0x532620[_0x590cfc(0x125)][_0x590cfc(0x186)]||_0x532620[_0x590cfc(0x125)][_0x590cfc(0x18f)])+'\x27');return _0x255fc8['id'];}},_0x2a3994=await _0x43019d(_0x1ca6f9[_0x5d3215(0x152)],_0x6d88d1[_0x5d3215(0xdc)],_0x38629a),_0x1cbd91=_0x6d88d1[_0x5d3215(0xcb)]||_0x6d88d1[_0x5d3215(0x117)];_0x1cbd91&&(_0x2a3994['relationships']={'parentFolder':{'data':{'id':_0x1cbd91,'type':_0x5d3215(0xdd)}}});if(_0x1ca6f9['isNew']){if(_0x283085[_0x5d3215(0xd1)]>0x0||_0x1c7694['size']>0x0)return await executeThreeStepJourneyCreate(_0x511993,_0x1ca6f9,_0x2a3994,{'pendingEmbeddedSegments':_0x283085,'pendingEmbeddedActivations':_0x1c7694,'embeddedSegmentNameToId':_0x10020a,'journeyActivationNameToId':_0x10d667},{..._0x6d88d1,'effectiveFolderId':_0x1cbd91},_0x2565a4,_0x1b6963,_0x40b998);else{ensureJourneyDefaults(_0x2a3994[_0x5d3215(0x125)]);const _0x49f59a=await _0x511993[_0x5d3215(0x1a0)][_0x5d3215(0x174)](_0x2a3994);return{'action':_0x5d3215(0x15c),'journeyId':_0x49f59a['id'],'embeddedSegmentNameToId':_0x10020a};}}else{if(_0x1ca6f9[_0x5d3215(0x112)]&&_0x1ca6f9['existingJourney'])return ensureJourneyDefaults(_0x2a3994['attributes']),await _0x511993[_0x5d3215(0x1a0)][_0x5d3215(0x13c)](_0x1ca6f9[_0x5d3215(0xca)]['id'],_0x2a3994),{'action':_0x5d3215(0x120),'journeyId':_0x1ca6f9['existingJourney']['id'],'embeddedSegmentNameToId':_0x10020a};}return{'action':_0x5d3215(0x12c),'journeyId':_0x1ca6f9['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x10020a};}function findSegmentCriteriaLocation(_0x39814c,_0x5c63bb){const _0x5ef1c1=a119_0x43758d,_0x4d259f=_0x39814c[_0x5ef1c1(0xd0)]||_0x39814c[_0x5ef1c1(0x155)]?.[0x0]?.[_0x5ef1c1(0xd0)]||[];let _0x26114f=_0x5ef1c1(0x104),_0x5dcbdd=_0x5c63bb;const _0x104a6f=_0x39814c[_0x5ef1c1(0x163)]||_0x39814c[_0x5ef1c1(0x155)]?.[0x0]?.[_0x5ef1c1(0x163)];if(_0x104a6f?.['segment']===_0x5c63bb)return{'stageName':'goal','criteriaName':_0x104a6f['name']||_0x5c63bb};_0x5c6647:for(const _0x270a01 of _0x4d259f){if(_0x270a01[_0x5ef1c1(0x19e)]?.['segment']===_0x5c63bb){_0x26114f=_0x270a01[_0x5ef1c1(0x18f)],_0x5dcbdd=_0x270a01[_0x5ef1c1(0x19e)][_0x5ef1c1(0x18f)]||_0x5c63bb;break;}if(_0x270a01[_0x5ef1c1(0x151)])for(const _0x179644 of _0x270a01[_0x5ef1c1(0x151)]){if(_0x179644['type']==='decision_point'&&_0x179644[_0x5ef1c1(0x173)]?.[_0x5ef1c1(0x141)])for(const _0x144f44 of _0x179644['with'][_0x5ef1c1(0x141)]){if(_0x144f44[_0x5ef1c1(0x12b)]===_0x5c63bb){_0x26114f=_0x270a01[_0x5ef1c1(0x18f)],_0x5dcbdd=_0x144f44[_0x5ef1c1(0x18f)]||_0x5c63bb;break _0x5c6647;}}}}return{'stageName':_0x26114f,'criteriaName':_0x5dcbdd};}async function executeThreeStepJourneyCreate(_0x2b548d,_0x9cf8f9,_0x24184d,_0x1e15b3,_0x23df1e,_0x16f27a,_0x317e54,_0x53226a){const _0x1a44f2=a119_0x43758d,{activationDefToCreateRequest:_0x26d1e8,yamlRuleToApi:_0x228c48}=_0x53226a,{pendingEmbeddedSegments:_0x22299b,pendingEmbeddedActivations:_0x24e6f2,embeddedSegmentNameToId:_0x2b757f}=_0x1e15b3,_0xb1b1e2=JSON[_0x1a44f2(0x198)](JSON[_0x1a44f2(0x144)](_0x24184d));ensureJourneyDefaults(_0xb1b1e2[_0x1a44f2(0x125)]),stripPendingIds(_0xb1b1e2);const _0x27dacd=await _0x2b548d[_0x1a44f2(0x1a0)][_0x1a44f2(0x174)](_0xb1b1e2),_0x397483=_0x27dacd['id'],_0x1420e0=new Map();for(const _0x368789 of _0x27dacd[_0x1a44f2(0x125)][_0x1a44f2(0x168)]){_0x1420e0[_0x1a44f2(0x113)](_0x368789[_0x1a44f2(0x18f)][_0x1a44f2(0x18c)](),_0x368789['id']);}for(const [_0x435597,{definition:_0x44d6f4}]of _0x22299b){const _0x232df2=generateDeterministicJourneySegmentName(_0x9cf8f9[_0x1a44f2(0x152)]['name'],_0x435597);_0x317e54[_0x1a44f2(0x108)]?.({'type':_0x1a44f2(0x162),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'segmentName':_0x435597});const _0xff672a=createSegmentIdResolver(_0x16f27a['segmentNameToId'],_0x435597),_0x50f3e0=await resolveRuleSegmentIds(_0x44d6f4[_0x1a44f2(0xea)],_0xff672a),_0x2fd3ef=await _0x2b548d['segment'][_0x1a44f2(0x143)]({'name':_0x232df2,'description':_0x44d6f4[_0x1a44f2(0x11a)]||_0x1a44f2(0x110)+_0x435597,'journeyId':_0x397483,'rule':_0x228c48(_0x50f3e0,!![]),'countPopulation':!![],'parentFolderId':_0x23df1e[_0x1a44f2(0xc9)]||'','audienceId':_0x23df1e[_0x1a44f2(0xdc)]});_0x2b757f[_0x1a44f2(0x113)](_0x435597,_0x2fd3ef),_0x16f27a[_0x1a44f2(0xe7)][_0x1a44f2(0x113)](_0x435597,_0x2fd3ef),_0x317e54[_0x1a44f2(0x108)]?.({'type':_0x1a44f2(0xec),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'segmentName':_0x435597});}const _0xe2dcd2=new Map();for(const [_0x35c5b3,_0x2033b2]of _0x24e6f2){_0x317e54[_0x1a44f2(0x108)]?.({'type':_0x1a44f2(0xf6),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'activationName':_0x35c5b3});const _0x25f75a=await _0x26d1e8(_0x2033b2,_0x16f27a[_0x1a44f2(0x177)]),_0x5172ed=await _0x2b548d[_0x1a44f2(0x1a0)]['createActivation'](_0x397483,_0x25f75a);_0xe2dcd2[_0x1a44f2(0x113)](_0x35c5b3,_0x5172ed['id']),_0x1e15b3[_0x1a44f2(0x197)][_0x1a44f2(0x113)](_0x35c5b3,_0x5172ed['id']),_0x317e54['onProgress']?.({'type':_0x1a44f2(0xfc),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'activationName':_0x35c5b3});}const _0x3649f8=JSON['parse'](JSON[_0x1a44f2(0x144)](_0x24184d));return _0x3649f8['id']=_0x397483,ensureJourneyDefaults(_0x3649f8[_0x1a44f2(0x125)]),resolvePendingIdsInRequest(_0x3649f8,_0x24184d,_0x1420e0,_0x2b757f,_0xe2dcd2,_0x317e54),await _0x2b548d[_0x1a44f2(0x1a0)]['update'](_0x397483,_0x3649f8),{'action':_0x1a44f2(0x15c),'journeyId':_0x397483,'embeddedSegmentNameToId':_0x2b757f};}function stripPendingIds(_0x18d90b){const _0xb3c4af=a119_0x43758d;for(const _0x373f06 of _0x18d90b['attributes'][_0xb3c4af(0x168)]||[]){_0x373f06[_0xb3c4af(0x149)]?.[_0xb3c4af(0x160)]&&isPendingSegmentId(_0x373f06['entryCriteria']['segmentId'])&&delete _0x373f06[_0xb3c4af(0x149)];if(_0x373f06[_0xb3c4af(0x151)])for(const _0x5bfa17 of Object[_0xb3c4af(0xcf)](_0x373f06[_0xb3c4af(0x151)])){const _0x3e9a86=_0x373f06[_0xb3c4af(0x151)][_0x5bfa17];_0x3e9a86['type']===_0xb3c4af(0x109)&&_0x3e9a86[_0xb3c4af(0xfa)]&&isPendingActivationId(_0x3e9a86['journeyActivationStepId'])&&(_0x3e9a86[_0xb3c4af(0xfa)]='');if(_0x3e9a86[_0xb3c4af(0x121)]===_0xb3c4af(0x12d)&&_0x3e9a86[_0xb3c4af(0x141)])for(const _0x5676ae of _0x3e9a86[_0xb3c4af(0x141)]){_0x5676ae[_0xb3c4af(0x160)]&&isPendingSegmentId(_0x5676ae[_0xb3c4af(0x160)])&&(_0x5676ae['segmentId']='');}_0x3e9a86[_0xb3c4af(0x121)]===_0xb3c4af(0x19d)&&_0x3e9a86[_0xb3c4af(0x15b)]?.['segmentId']&&isPendingSegmentId(_0x3e9a86[_0xb3c4af(0x15b)][_0xb3c4af(0x160)])&&(_0x3e9a86['waitCondition'][_0xb3c4af(0x160)]='');}}}function resolvePendingIdsInRequest(_0x1f49af,_0x355214,_0x382ed1,_0x2afef3,_0x14c4d1,_0x1a98e3){const _0x241b27=a119_0x43758d,_0xae4814=(_0x421096,_0x2ae4d0)=>{const _0x44c2c4=a119_0x1c83;if(!isPendingSegmentId(_0x421096))return _0x421096;const _0x304b6c=extractPendingSegmentName(_0x421096),_0x177514=_0x2afef3['get'](_0x304b6c);return!_0x177514&&_0x1a98e3['logWarning']?.(_0x44c2c4(0x140)+_0x304b6c+_0x44c2c4(0x16f)+_0x2ae4d0),_0x177514;};if(_0x1f49af[_0x241b27(0x125)][_0x241b27(0x163)]?.[_0x241b27(0x160)]&&isPendingSegmentId(_0x1f49af[_0x241b27(0x125)][_0x241b27(0x163)][_0x241b27(0x160)])){const _0x39adaf=_0xae4814(_0x1f49af[_0x241b27(0x125)][_0x241b27(0x163)]['segmentId'],_0x241b27(0x11e));_0x39adaf&&(_0x1f49af[_0x241b27(0x125)]['goal']['segmentId']=_0x39adaf);}for(const _0xd31562 of _0x1f49af[_0x241b27(0x125)][_0x241b27(0x168)]||[]){const _0xe61d89=_0x382ed1[_0x241b27(0x13b)](_0xd31562[_0x241b27(0x18f)][_0x241b27(0x18c)]());_0xe61d89&&(_0xd31562['id']=_0xe61d89);if(_0xd31562[_0x241b27(0x149)]?.[_0x241b27(0x160)]&&isPendingSegmentId(_0xd31562[_0x241b27(0x149)][_0x241b27(0x160)])){const _0x2b4af8=_0xae4814(_0xd31562['entryCriteria'][_0x241b27(0x160)],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+_0x241b27(0x180));_0x2b4af8&&(_0xd31562[_0x241b27(0x149)][_0x241b27(0x160)]=_0x2b4af8);}if(_0xd31562['exitCriterias'])for(const _0x3537c1 of _0xd31562[_0x241b27(0x192)]){if(_0x3537c1[_0x241b27(0x160)]&&isPendingSegmentId(_0x3537c1['segmentId'])){const _0x2b645a=_0xae4814(_0x3537c1['segmentId'],_0x241b27(0x1a3)+_0xd31562['name']+'\x27\x20exit\x20criteria');_0x2b645a&&(_0x3537c1[_0x241b27(0x160)]=_0x2b645a);}}if(_0xd31562[_0x241b27(0x145)]?.['segmentId']&&isPendingSegmentId(_0xd31562[_0x241b27(0x145)][_0x241b27(0x160)])){const _0x43d995=_0xae4814(_0xd31562[_0x241b27(0x145)][_0x241b27(0x160)],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+_0x241b27(0x196));_0x43d995&&(_0xd31562[_0x241b27(0x145)]['segmentId']=_0x43d995);}if(_0xd31562['steps']){const _0x3f3e76=_0x4bcaab=>_0x355214[_0x241b27(0x125)][_0x241b27(0x168)][_0x241b27(0x18d)](_0x474180=>_0x474180[_0x241b27(0x18f)]['toLowerCase']()===_0xd31562[_0x241b27(0x18f)][_0x241b27(0x18c)]())?.[_0x241b27(0x151)]?.[_0x4bcaab];for(const _0x832613 of Object['keys'](_0xd31562['steps'])){const _0x328c52=_0xd31562[_0x241b27(0x151)][_0x832613],_0x11ff1f=_0x3f3e76(_0x832613);if(_0x328c52[_0x241b27(0x121)]===_0x241b27(0x109)&&_0x328c52[_0x241b27(0xfa)]&&(isPendingActivationId(_0x328c52[_0x241b27(0xfa)])||_0x328c52[_0x241b27(0xfa)]==='')){if(_0x11ff1f?.[_0x241b27(0xfa)]&&isPendingActivationId(_0x11ff1f[_0x241b27(0xfa)])){const _0x1380b8=extractPendingActivationName(_0x11ff1f[_0x241b27(0xfa)]),_0x4d9fa2=_0x14c4d1[_0x241b27(0x13b)](_0x1380b8);_0x4d9fa2&&(_0x328c52[_0x241b27(0xfa)]=_0x4d9fa2);}}if(_0x328c52[_0x241b27(0x121)]==='DecisionPoint'&&_0x328c52[_0x241b27(0x141)]&&_0x11ff1f?.['branches'])for(let _0x4f3b32=0x0;_0x4f3b32<_0x328c52[_0x241b27(0x141)][_0x241b27(0x18e)];_0x4f3b32++){const _0x4b4c4d=_0x328c52[_0x241b27(0x141)][_0x4f3b32],_0x476551=_0x11ff1f[_0x241b27(0x141)][_0x4f3b32];if(_0x476551?.[_0x241b27(0x160)]&&isPendingSegmentId(_0x476551[_0x241b27(0x160)])){const _0x59e172=_0xae4814(_0x476551[_0x241b27(0x160)],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+_0x241b27(0xc5)+(_0x4b4c4d[_0x241b27(0x18f)]||_0x4f3b32)+'\x27');_0x59e172&&(_0x4b4c4d[_0x241b27(0x160)]=_0x59e172);}}if(_0x328c52['type']===_0x241b27(0x19d)&&_0x328c52[_0x241b27(0x15b)]?.[_0x241b27(0x160)]&&_0x11ff1f?.[_0x241b27(0x15b)]?.[_0x241b27(0x160)]&&isPendingSegmentId(_0x11ff1f[_0x241b27(0x15b)][_0x241b27(0x160)])){const _0x11e46b=_0xae4814(_0x11ff1f[_0x241b27(0x15b)]['segmentId'],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+'\x27\x20wait\x20condition');_0x11e46b&&(_0x328c52[_0x241b27(0x15b)][_0x241b27(0x160)]=_0x11e46b);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3dc52b,_0x45837e){const _0x111608=a120_0x124c,_0x574cb0=_0x3dc52b();while(!![]){try{const _0x15e404=-parseInt(_0x111608(0x1a3))/0x1*(-parseInt(_0x111608(0x19f))/0x2)+parseInt(_0x111608(0x19d))/0x3+-parseInt(_0x111608(0x199))/0x4*(parseInt(_0x111608(0x19c))/0x5)+parseInt(_0x111608(0x19e))/0x6+-parseInt(_0x111608(0x1a1))/0x7+-parseInt(_0x111608(0x19a))/0x8+parseInt(_0x111608(0x1a2))/0x9;if(_0x15e404===_0x45837e)break;else _0x574cb0['push'](_0x574cb0['shift']());}catch(_0x5ea8c9){_0x574cb0['push'](_0x574cb0['shift']());}}}(a120_0x39af,0x3dbb1));export function buildFolderIdToPathMap(_0x2751a6){const _0xee2843=a120_0x124c,_0x2ea350=new Map(),_0x1528ab=new Map();for(const _0x45835d of _0x2751a6){_0x1528ab[_0xee2843(0x19b)](_0x45835d['id'],_0x45835d);}const _0x4fa40b=new Set();for(const _0x50f9db of _0x2751a6){!_0x50f9db[_0xee2843(0x1a4)]&&_0x4fa40b['add'](_0x50f9db['id']);}function _0x4bef43(_0x5d1fee){const _0x5c9035=_0xee2843;if(_0x2ea350[_0x5c9035(0x1a0)](_0x5d1fee['id']))return _0x2ea350['get'](_0x5d1fee['id']);if(_0x4fa40b[_0x5c9035(0x1a0)](_0x5d1fee['id']))return _0x2ea350['set'](_0x5d1fee['id'],''),'';if(_0x5d1fee[_0x5c9035(0x1a4)]){const _0xc20da8=_0x1528ab[_0x5c9035(0x1a5)](_0x5d1fee[_0x5c9035(0x1a4)]);if(_0xc20da8){const _0x3fad90=_0x4bef43(_0xc20da8),_0x1a394c=_0x3fad90?_0x3fad90+'/'+_0x5d1fee[_0x5c9035(0x1a6)]:_0x5d1fee[_0x5c9035(0x1a6)];return _0x2ea350[_0x5c9035(0x19b)](_0x5d1fee['id'],_0x1a394c),_0x1a394c;}}const _0x247c0b=_0x5d1fee['name'];return _0x2ea350[_0x5c9035(0x19b)](_0x5d1fee['id'],_0x247c0b),_0x247c0b;}for(const _0x5a86fd of _0x2751a6){_0x4bef43(_0x5a86fd);}return _0x2ea350;}function a120_0x39af(){const _0x34b0e1=['1PtrWEz','parentFolderId','get','name','3824JMVTPs','1525744eUCXav','set','5zoQCYc','118557MrGWXF','1044996RNhkHB','107654CjzzlI','has','2382884wUGLSq','4656807VRpCQC'];a120_0x39af=function(){return _0x34b0e1;};return a120_0x39af();}export function buildFolderPathToIdMap(_0x512d6b){const _0x9f313a=a120_0x124c,_0x185ebe=new Map(),_0x3dcb4d=new Map();for(const _0x12891e of _0x512d6b){_0x3dcb4d['set'](_0x12891e['id'],_0x12891e);}const _0x268fba=new Set();for(const _0x2b2225 of _0x512d6b){!_0x2b2225[_0x9f313a(0x1a4)]&&_0x268fba['add'](_0x2b2225['id']);}function _0x273adf(_0x263960){const _0x410865=_0x9f313a;if(_0x268fba[_0x410865(0x1a0)](_0x263960['id']))return'';if(_0x263960['parentFolderId']){const _0x484e3b=_0x3dcb4d[_0x410865(0x1a5)](_0x263960['parentFolderId']);if(_0x484e3b){const _0x453aa1=_0x273adf(_0x484e3b);return _0x453aa1?_0x453aa1+'/'+_0x263960[_0x410865(0x1a6)]:_0x263960[_0x410865(0x1a6)];}}return _0x263960[_0x410865(0x1a6)];}for(const _0x578865 of _0x512d6b){const _0x4cbe55=_0x273adf(_0x578865);_0x185ebe[_0x9f313a(0x19b)](_0x4cbe55,_0x578865['id']);}return _0x185ebe;}export function buildFolderMaps(_0x494046){const _0x25d74f=a120_0x124c,_0x5b506f=buildFolderIdToPathMap(_0x494046),_0x45c671=new Map();for(const [_0x2ed0ae,_0x909106]of _0x5b506f){_0x45c671[_0x25d74f(0x19b)](_0x909106,_0x2ed0ae);}return{'idToPath':_0x5b506f,'pathToId':_0x45c671};}function a120_0x124c(_0x3ab5aa,_0x5994b0){_0x3ab5aa=_0x3ab5aa-0x199;const _0x39af60=a120_0x39af();let _0x124cb8=_0x39af60[_0x3ab5aa];return _0x124cb8;}export function getFolderPath(_0x137cd8,_0x3deffc){const _0x2ffd8b=a120_0x124c;if(!_0x137cd8)return'';return _0x3deffc[_0x2ffd8b(0x1a5)](_0x137cd8)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5bab4b,_0x2ea0d7){const _0x2e4c9e=a121_0x3cbe,_0x1e6643=_0x5bab4b();while(!![]){try{const _0x5a377c=parseInt(_0x2e4c9e(0x111))/0x1*(parseInt(_0x2e4c9e(0xff))/0x2)+parseInt(_0x2e4c9e(0x110))/0x3*(parseInt(_0x2e4c9e(0xfe))/0x4)+parseInt(_0x2e4c9e(0x112))/0x5+-parseInt(_0x2e4c9e(0x115))/0x6+parseInt(_0x2e4c9e(0x101))/0x7*(-parseInt(_0x2e4c9e(0xf7))/0x8)+parseInt(_0x2e4c9e(0xf5))/0x9+-parseInt(_0x2e4c9e(0x11d))/0xa*(parseInt(_0x2e4c9e(0x102))/0xb);if(_0x5a377c===_0x2ea0d7)break;else _0x1e6643['push'](_0x1e6643['shift']());}catch(_0x15f134){_0x1e6643['push'](_0x1e6643['shift']());}}}(a121_0x5bc2,0x44522));import a121_0x4bc3dc from'path';import{parse as a121_0x190714}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x2c2b4b){const _0x28d982=a121_0x3cbe;if(!_0x2c2b4b||_0x2c2b4b[_0x28d982(0xfc)]()==='')throw new Error(_0x28d982(0x10e));const _0x5f1991=_0x2c2b4b[_0x28d982(0xfc)]();if(_0x5f1991==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x2c2b4b};const _0x18e9a3=_0x5f1991[_0x28d982(0x107)]('/')?_0x5f1991['substring'](0x1):_0x5f1991,_0x30a3d9=_0x18e9a3[_0x28d982(0x113)]('/')[_0x28d982(0xf3)](_0x4e088f=>_0x4e088f!=='');if(_0x30a3d9['length']===0x0)throw new Error(_0x28d982(0x106));const _0x29cce6=_0x5f1991[_0x28d982(0x107)]('/')||!isRelativePathSegment(_0x30a3d9[0x0]);for(const _0x5bce5a of _0x30a3d9){validatePathSegment(_0x5bce5a);}return{'segments':_0x30a3d9,'isAbsolute':_0x29cce6,'raw':_0x2c2b4b};}function isRelativePathSegment(_0x274969){return _0x274969==='.'||_0x274969==='..';}function validatePathSegment(_0x223fcf){const _0x2ccf6c=a121_0x3cbe;if(_0x223fcf==='')throw new Error(_0x2ccf6c(0x109));if(_0x223fcf==='.'||_0x223fcf==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x223fcf))throw new Error(_0x2ccf6c(0x116)+_0x223fcf);if(_0x223fcf!==_0x223fcf[_0x2ccf6c(0xfc)]()){}}function a121_0x3cbe(_0x1fa73c,_0x113cf0){_0x1fa73c=_0x1fa73c-0xf1;const _0x5bc233=a121_0x5bc2();let _0x3cbe70=_0x5bc233[_0x1fa73c];return _0x3cbe70;}export function validatePath(_0x59a546){const _0x351f7c=a121_0x3cbe;if(_0x59a546[_0x351f7c(0x11c)]['length']===0x0&&!_0x59a546[_0x351f7c(0x11f)])throw new Error(_0x351f7c(0x114));if(_0x59a546[_0x351f7c(0x11f)]){if(_0x59a546[_0x351f7c(0x11c)][0x0]==='..')throw new Error(_0x351f7c(0x118));let _0x374bda=0x0;for(const _0x4663a9 of _0x59a546[_0x351f7c(0x11c)]){if(_0x4663a9==='..'){if(_0x374bda===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x374bda--;}else _0x4663a9!=='.'&&_0x374bda++;}}}export function joinPaths(_0x3c8681,_0xea6036){const _0x15bec7=a121_0x3cbe;if(!_0x3c8681||_0x3c8681==='/')return _0xea6036;if(!_0xea6036||_0xea6036==='.')return _0x3c8681;if(_0xea6036['startsWith']('/'))return _0xea6036;const _0x59159e=parsePath(_0x3c8681),_0x35f4f3=parsePath(_0xea6036),_0x3924be=[..._0x59159e['segments']];for(const _0x439bb4 of _0x35f4f3['segments']){if(_0x439bb4==='.')continue;else{if(_0x439bb4==='..'){if(_0x3924be[_0x15bec7(0xfb)]===0x0)throw new Error(_0x15bec7(0xfd));_0x3924be['pop']();}else _0x3924be[_0x15bec7(0x10f)](_0x439bb4);}}const _0x2759b8=_0x3924be[_0x15bec7(0x10c)]('/');return _0x59159e[_0x15bec7(0x119)][_0x15bec7(0x107)]('/')?'/'+_0x2759b8:_0x2759b8;}export function normalizePath(_0x37894b){const _0x94df5e=a121_0x3cbe,_0x137c22=parsePath(_0x37894b),_0x5b73c6=[];for(const _0x5e2405 of _0x137c22[_0x94df5e(0x11c)]){if(_0x5e2405==='.')continue;else{if(_0x5e2405==='..'){if(_0x5b73c6[_0x94df5e(0xfb)]===0x0){if(_0x137c22['isAbsolute'])throw new Error(_0x94df5e(0xfd));_0x5b73c6[_0x94df5e(0x10f)]('..');}else _0x5b73c6[_0x5b73c6[_0x94df5e(0xfb)]-0x1]==='..'?_0x5b73c6[_0x94df5e(0x10f)]('..'):_0x5b73c6[_0x94df5e(0xfa)]();}else _0x5b73c6[_0x94df5e(0x10f)](_0x5e2405);}}if(_0x5b73c6[_0x94df5e(0xfb)]===0x0)return _0x137c22['isAbsolute']?'/':'.';const _0x1525b8=_0x5b73c6['join']('/');return _0x137c22[_0x94df5e(0x119)][_0x94df5e(0x107)]('/')?'/'+_0x1525b8:_0x1525b8;}export function getParentPath(_0x5ec454){const _0xa344d9=a121_0x3cbe,_0x38519c=parsePath(_0x5ec454);if(_0x38519c[_0xa344d9(0x11c)][_0xa344d9(0xfb)]<=0x1)return'/';const _0x491d29=_0x38519c[_0xa344d9(0x11c)][_0xa344d9(0x11e)](0x0,-0x1)['join']('/');return _0x38519c[_0xa344d9(0x119)][_0xa344d9(0x107)]('/')?'/'+_0x491d29:_0x491d29;}export function getBaseName(_0x445b6e){const _0x3a163d=a121_0x3cbe,_0x5162e1=parsePath(_0x445b6e);return _0x5162e1['segments'][_0x5162e1[_0x3a163d(0x11c)]['length']-0x1]||'';}export function isChildPath(_0x51c069,_0x41f9ee){const _0x177125=a121_0x3cbe,_0x3028f1=parsePath(_0x51c069),_0x489fc8=parsePath(_0x41f9ee);if(_0x3028f1[_0x177125(0x11c)]['length']<=_0x489fc8[_0x177125(0x11c)][_0x177125(0xfb)])return![];for(let _0x5c31cd=0x0;_0x5c31cd<_0x489fc8['segments'][_0x177125(0xfb)];_0x5c31cd++){if(_0x3028f1[_0x177125(0x11c)][_0x5c31cd]!==_0x489fc8['segments'][_0x5c31cd])return![];}return!![];}export function splitPath(_0x5e077d){const _0x262aab=a121_0x3cbe,_0x12a576=parsePath(_0x5e077d);if(_0x12a576[_0x262aab(0x11c)][_0x262aab(0xfb)]===0x0)throw new Error(_0x262aab(0x120));if(_0x12a576['segments'][_0x262aab(0xfb)]===0x1)return{'parent':_0x12a576[_0x262aab(0x11c)][0x0]};return{'parent':_0x12a576[_0x262aab(0x11c)][0x0],'child':_0x12a576['segments'][_0x262aab(0x11e)](0x1)['join']('/')};}export function isYamlFilePath(_0x4bdbeb){const _0x2291fb=a121_0x3cbe;return _0x4bdbeb[_0x2291fb(0x104)](_0x2291fb(0xf2))||_0x4bdbeb[_0x2291fb(0x104)](_0x2291fb(0xf4));}function a121_0x5bc2(){const _0x310cd9=['Path\x20must\x20contain\x20at\x20least\x20one\x20segment','startsWith','parent_segment','Path\x20segment\x20cannot\x20be\x20empty','dirname','tdx.json','join','parse','Path\x20cannot\x20be\x20empty','push','27vgoWyq','2599LPInOw','863005Wqwysh','split','Relative\x20path\x20cannot\x20be\x20empty','608712weBzeE','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','journey','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','raw','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','segments','1600wNYrWr','slice','isAbsolute','Cannot\x20split\x20empty\x20path','readFile','.yml','filter','.yaml','4926771pnYVTP','exists','2041120qLshrd','File\x20not\x20found:\x20','segment','pop','length','trim','Cannot\x20navigate\x20above\x20root','213628GhUEtO','378AWkNZO','name','14VHlxxh','55022eIFISp','root','endsWith','replace'];a121_0x5bc2=function(){return _0x310cd9;};return a121_0x5bc2();}export async function resolveYamlFilePath(_0x2ca012,_0x1dcf30=nodeFileSystem){const _0x42d33a=a121_0x3cbe,_0x1f0ca5=a121_0x4bc3dc['resolve'](_0x2ca012);if(!await _0x1dcf30[_0x42d33a(0xf6)](_0x1f0ca5))throw new Error(_0x42d33a(0xf8)+_0x2ca012);let _0x65a0fc=a121_0x4bc3dc[_0x42d33a(0x10a)](_0x1f0ca5),_0x2efad9=null,_0x56d729=null;const _0x79c159=a121_0x4bc3dc[_0x42d33a(0x10d)](_0x65a0fc)[_0x42d33a(0x103)];while(_0x65a0fc!==_0x79c159){const _0x25875f=a121_0x4bc3dc[_0x42d33a(0x10c)](_0x65a0fc,_0x42d33a(0x10b));if(await _0x1dcf30['exists'](_0x25875f)){_0x2efad9=_0x25875f,_0x56d729=_0x65a0fc;break;}_0x65a0fc=a121_0x4bc3dc[_0x42d33a(0x10a)](_0x65a0fc);}if(!_0x2efad9||!_0x56d729)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x2ca012);const _0x1f8092=await _0x1dcf30[_0x42d33a(0xf1)](_0x2efad9),_0x345a03=JSON[_0x42d33a(0x10d)](_0x1f8092),_0x251ddd=_0x345a03[_0x42d33a(0x108)];if(!_0x251ddd)throw new Error(_0x42d33a(0x11b));const _0x547980=await _0x1dcf30[_0x42d33a(0xf1)](_0x1f0ca5),_0x5e300f=a121_0x190714(_0x547980),_0x38953b=_0x5e300f[_0x42d33a(0x100)];if(!_0x38953b)throw new Error(_0x42d33a(0x11a)+_0x2ca012);const _0xdfda01=_0x5e300f['type']==='journey'?_0x42d33a(0x117):_0x42d33a(0xf9),_0x122ab3=a121_0x4bc3dc['relative'](_0x56d729,_0x1f0ca5),_0x1d279a=a121_0x4bc3dc[_0x42d33a(0x10a)](_0x122ab3),_0x108200=_0x1d279a==='.'?'':_0x1d279a[_0x42d33a(0x105)](/\\/g,'/'),_0x354855=_0x108200?_0x251ddd+'/'+_0x108200+'/'+_0x38953b:_0x251ddd+'/'+_0x38953b;return{'parentSegment':_0x251ddd,'segmentName':_0x38953b,'folderPath':_0x108200,'fullPath':_0x354855,'resourceType':_0xdfda01};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a122_0x1708(){const _0x162e62=['64ejVksA','substring','.\x20Child\x20name\x20cannot\x20be\x20empty','5585UNnUfF','Invalid\x20segment\x20reference\x20format:\x20','1410327SYhzgS','.\x20Parent\x20name\x20cannot\x20be\x20empty','1602013lKeJxY','indexOf','34vHfVym','14631iWnFwI','20yliCJd','286040eCWtcN','241604NqAneR','1149222BLxNKU'];a122_0x1708=function(){return _0x162e62;};return a122_0x1708();}(function(_0x38f3cb,_0x1e62e9){const _0x516ea3=a122_0x75a5,_0xfa2588=_0x38f3cb();while(!![]){try{const _0x207108=-parseInt(_0x516ea3(0x138))/0x1+-parseInt(_0x516ea3(0x143))/0x2*(-parseInt(_0x516ea3(0x144))/0x3)+parseInt(_0x516ea3(0x13a))/0x4*(-parseInt(_0x516ea3(0x13d))/0x5)+-parseInt(_0x516ea3(0x139))/0x6+parseInt(_0x516ea3(0x141))/0x7+-parseInt(_0x516ea3(0x137))/0x8+parseInt(_0x516ea3(0x13f))/0x9*(parseInt(_0x516ea3(0x145))/0xa);if(_0x207108===_0x1e62e9)break;else _0xfa2588['push'](_0xfa2588['shift']());}catch(_0x4647be){_0xfa2588['push'](_0xfa2588['shift']());}}}(a122_0x1708,0x21ca6));function a122_0x75a5(_0x42e433,_0x1b4ff0){_0x42e433=_0x42e433-0x137;const _0x1708b0=a122_0x1708();let _0x75a509=_0x1708b0[_0x42e433];return _0x75a509;}export function parseSegmentRef(_0x8acab3){const _0x4cd242=a122_0x75a5,_0x3066a9=_0x8acab3[_0x4cd242(0x142)]('/');if(_0x3066a9===-0x1)return{'parentId':_0x8acab3};if(_0x3066a9===0x0)throw new Error(_0x4cd242(0x13e)+_0x8acab3+_0x4cd242(0x140));const _0x4df298=_0x8acab3[_0x4cd242(0x13b)](0x0,_0x3066a9),_0x1fac42=_0x8acab3[_0x4cd242(0x13b)](_0x3066a9+0x1);if(_0x1fac42==='')throw new Error(_0x4cd242(0x13e)+_0x8acab3+_0x4cd242(0x13c));return{'parentId':_0x4df298,'childId':_0x1fac42};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x369ed3,_0x410c49){const _0x1a518c=a123_0x1ea9,_0x60ae99=_0x369ed3();while(!![]){try{const _0xbd1023=-parseInt(_0x1a518c(0x1f9))/0x1+-parseInt(_0x1a518c(0x209))/0x2*(parseInt(_0x1a518c(0x1fb))/0x3)+-parseInt(_0x1a518c(0x226))/0x4*(-parseInt(_0x1a518c(0x215))/0x5)+parseInt(_0x1a518c(0x205))/0x6*(parseInt(_0x1a518c(0x204))/0x7)+-parseInt(_0x1a518c(0x210))/0x8+-parseInt(_0x1a518c(0x200))/0x9*(parseInt(_0x1a518c(0x203))/0xa)+-parseInt(_0x1a518c(0x219))/0xb*(-parseInt(_0x1a518c(0x20d))/0xc);if(_0xbd1023===_0x410c49)break;else _0x60ae99['push'](_0x60ae99['shift']());}catch(_0x5d4552){_0x60ae99['push'](_0x60ae99['shift']());}}}(a123_0x1834,0x6bbf6));import a123_0x134154 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';function a123_0x1834(){const _0xa5995a=['no_parent','5745580ZtcGGK','1603BODYQC','8970wqhJHZ','exists','Parent\x20segment\x20not\x20specified','type','819386yOITBL','directory','Not\x20a\x20YAML\x20file:\x20','File\x20not\x20found','12HptUoV','file_not_found','replace','6498800TGwZUj','startsWith','parent_name','configDir','no_config','185VNRAot','File\x20not\x20found:\x20','root','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','25157011mqSoJj','invalid_yaml','dirname','parent_segment','isScoped','context','parentSegment','isDirectory','segmentName','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','parse','relative','join','53468fxeBqe','scopedFolderPath','file','string','No\x20tdx.json\x20found','segment','stat','error','includes','basename','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','No\x20tdx.json\x20found\x20for\x20file:\x20','readFile','476307dgILKH','cwd','6IeXcYg','match','resourceType','resolve','trim','9rwZIjI','isFile'];a123_0x1834=function(){return _0xa5995a;};return a123_0x1834();}import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x198cd5){const _0x35d33f=a123_0x1ea9;return _0x198cd5[_0x35d33f(0x208)]!=='error';}export function isScopedResolution(_0x1bdb65){const _0xa270ac=a123_0x1ea9;return _0x1bdb65[_0xa270ac(0x208)]===_0xa270ac(0x20a)||_0x1bdb65[_0xa270ac(0x208)]===_0xa270ac(0x228)||_0x1bdb65[_0xa270ac(0x208)]==='context';}export function getScopedDetails(_0x2e87cb){const _0x15d2db=a123_0x1ea9;if(isScopedResolution(_0x2e87cb))return{'isScoped':_0x2e87cb['isScoped'],'scopedFolderPath':_0x2e87cb[_0x15d2db(0x227)]};return undefined;}async function findTdxConfigAsync(_0x14216a,_0x5820d9){const _0x1447c6=a123_0x1ea9;let _0x4d0794=a123_0x134154['resolve'](_0x14216a);const _0x4c0870=a123_0x134154[_0x1447c6(0x223)](_0x4d0794)[_0x1447c6(0x217)];while(_0x4d0794!==_0x4c0870){const _0x143109=a123_0x134154[_0x1447c6(0x225)](_0x4d0794,'tdx.json');if(await _0x5820d9[_0x1447c6(0x206)](_0x143109))try{const _0x3153ca=await _0x5820d9[_0x1447c6(0x1f8)](_0x143109),_0x23e8cb=JSON['parse'](_0x3153ca);if(_0x23e8cb[_0x1447c6(0x21c)]&&typeof _0x23e8cb[_0x1447c6(0x21c)]===_0x1447c6(0x229))return{'configPath':_0x143109,'configDir':_0x4d0794,'parentSegment':_0x23e8cb[_0x1447c6(0x21c)]};}catch{}_0x4d0794=a123_0x134154[_0x1447c6(0x21b)](_0x4d0794);}return null;}function a123_0x1ea9(_0x494fa4,_0x78912b){_0x494fa4=_0x494fa4-0x1f0;const _0x18347a=a123_0x1834();let _0x1ea9c5=_0x18347a[_0x494fa4];return _0x1ea9c5;}function calculateScopedPath(_0x562eec,_0x205294){const _0x544cf6=a123_0x1ea9,_0x37fae8=a123_0x134154[_0x544cf6(0x224)](_0x205294,_0x562eec),_0xe11120=_0x37fae8!==''&&_0x37fae8!=='.'&&!_0x37fae8[_0x544cf6(0x211)]('..');return{'isScoped':_0xe11120,'scopedFolderPath':_0xe11120?_0x37fae8[_0x544cf6(0x20f)](/\\/g,'/'):''};}export async function resolveTarget(_0x5c482d){const _0x1d16cb=a123_0x1ea9,{arg:_0x13bd6f,contextParent:_0x363382,cwd:cwd=process[_0x1d16cb(0x1fa)](),fs:fs=nodeFileSystem}=_0x5c482d;if(_0x13bd6f&&isYamlFilePath(_0x13bd6f))try{const _0x47e4c4=await resolveYamlFilePath(_0x13bd6f,fs),_0x53e636=a123_0x134154[_0x1d16cb(0x1fe)](_0x13bd6f),_0x5a8b92=a123_0x134154['dirname'](_0x53e636),_0x35a522=await findTdxConfigAsync(_0x5a8b92,fs);if(!_0x35a522){if(_0x363382){const _0xcca33c=a123_0x134154['dirname'](_0x53e636);return{'type':_0x1d16cb(0x228),'parentName':_0x363382,'targetDir':_0xcca33c,'configRoot':_0xcca33c,'filePath':_0x53e636,'resourceName':_0x47e4c4[_0x1d16cb(0x221)],'folderPath':_0x47e4c4['folderPath'],'resourceType':_0x47e4c4[_0x1d16cb(0x1fd)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1d16cb(0x1f3),'errorCode':_0x1d16cb(0x214),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x13bd6f,'arg':_0x13bd6f,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}const _0x4c97a8=calculateScopedPath(_0x5a8b92,_0x35a522['configDir']);return{'type':'file','parentName':_0x35a522['parentSegment'],'targetDir':_0x35a522[_0x1d16cb(0x213)],'configRoot':_0x35a522[_0x1d16cb(0x213)],'filePath':_0x53e636,'resourceName':_0x47e4c4[_0x1d16cb(0x221)],'folderPath':_0x47e4c4['folderPath'],'resourceType':_0x47e4c4[_0x1d16cb(0x1fd)],'isScoped':_0x4c97a8[_0x1d16cb(0x21d)],'scopedFolderPath':_0x4c97a8['scopedFolderPath']};}catch(_0x51834c){const _0x451929=_0x51834c instanceof Error?_0x51834c['message']:String(_0x51834c);if(_0x451929['includes'](_0x1d16cb(0x20c)))return{'type':_0x1d16cb(0x1f3),'errorCode':_0x1d16cb(0x20e),'message':_0x1d16cb(0x216)+_0x13bd6f,'arg':_0x13bd6f};if(_0x451929[_0x1d16cb(0x1f4)](_0x1d16cb(0x1f0))){if(_0x363382){const _0x3d906f=a123_0x134154[_0x1d16cb(0x1fe)](_0x13bd6f);if(await fs[_0x1d16cb(0x206)](_0x3d906f)){const _0x1d0650=a123_0x134154[_0x1d16cb(0x21b)](_0x3d906f),_0x43fea4=await fs['readFile'](_0x3d906f),_0x173a2b=_0x43fea4[_0x1d16cb(0x1fc)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x5f4010=_0x43fea4['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x3f4975=_0x173a2b?_0x173a2b[0x1][_0x1d16cb(0x1ff)]():a123_0x134154[_0x1d16cb(0x1f5)](_0x13bd6f,a123_0x134154['extname'](_0x13bd6f)),_0x5a97f7=_0x5f4010&&_0x5f4010[0x1][_0x1d16cb(0x1ff)]()==='journey'?'journey':_0x1d16cb(0x1f1);return{'type':'file','parentName':_0x363382,'targetDir':_0x1d0650,'configRoot':_0x1d0650,'filePath':_0x3d906f,'resourceName':_0x3f4975,'folderPath':'','resourceType':_0x5a97f7,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x1d16cb(0x1f3),'errorCode':_0x1d16cb(0x214),'message':_0x1d16cb(0x1f7)+_0x13bd6f,'arg':_0x13bd6f,'helpText':_0x1d16cb(0x1f6)};}return{'type':'error','errorCode':_0x1d16cb(0x21a),'message':_0x451929,'arg':_0x13bd6f};}if(_0x13bd6f){const _0xc89ba7=a123_0x134154[_0x1d16cb(0x1fe)](cwd,_0x13bd6f);let _0x42f13a=null;try{_0x42f13a=await fs[_0x1d16cb(0x1f2)](_0xc89ba7);}catch{}if(_0x42f13a?.[_0x1d16cb(0x220)]()){const _0x36d9fa=await findTdxConfigAsync(_0xc89ba7,fs);if(_0x36d9fa){const _0x37b6b9=calculateScopedPath(_0xc89ba7,_0x36d9fa[_0x1d16cb(0x213)]);return{'type':_0x1d16cb(0x20a),'parentName':_0x36d9fa['parentSegment'],'targetDir':_0xc89ba7,'configRoot':_0x36d9fa[_0x1d16cb(0x213)],'isScoped':_0x37b6b9[_0x1d16cb(0x21d)],'scopedFolderPath':_0x37b6b9[_0x1d16cb(0x227)]};}if(_0x363382)return{'type':_0x1d16cb(0x20a),'parentName':_0x363382,'targetDir':_0xc89ba7,'configRoot':_0xc89ba7,'isScoped':![],'scopedFolderPath':''};return{'type':_0x1d16cb(0x1f3),'errorCode':_0x1d16cb(0x214),'message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x13bd6f,'arg':_0x13bd6f,'helpText':_0x1d16cb(0x1f6)};}if(_0x42f13a?.[_0x1d16cb(0x201)]())return{'type':_0x1d16cb(0x1f3),'errorCode':'invalid_yaml','message':_0x1d16cb(0x20b)+_0x13bd6f,'arg':_0x13bd6f,'helpText':_0x1d16cb(0x222)};const _0x19c853=sanitizeFileName(_0x13bd6f),_0x12b957=getSegmentRootDir(_0x19c853,cwd);return{'type':_0x1d16cb(0x212),'parentName':_0x13bd6f,'targetDir':_0x12b957,'configRoot':_0x12b957};}const _0x2143b7=await findTdxConfigAsync(cwd,fs);if(_0x2143b7){const _0x33da11=calculateScopedPath(cwd,_0x2143b7['configDir']);return{'type':_0x1d16cb(0x21e),'parentName':_0x2143b7[_0x1d16cb(0x21f)],'targetDir':cwd,'configRoot':_0x2143b7[_0x1d16cb(0x213)],'isScoped':_0x33da11['isScoped'],'scopedFolderPath':_0x33da11['scopedFolderPath']};}if(_0x363382){const _0x7df999=sanitizeFileName(_0x363382),_0x3eb8ad=getSegmentRootDir(_0x7df999,cwd);return{'type':_0x1d16cb(0x21e),'parentName':_0x363382,'targetDir':_0x3eb8ad,'configRoot':_0x3eb8ad,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1d16cb(0x1f3),'errorCode':_0x1d16cb(0x202),'message':_0x1d16cb(0x207),'helpText':_0x1d16cb(0x218)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a124_0x4029(){const _0x5a0d03=['parent_segment','segments','resolve','utf-8','relative','120140HRMaPU','stringify','string','dirname','68oqkEON','cwd','17913xGSYpl','1991370dpxYlm','1023669VZVFlO','256926RcWGvD','297783RWUChH','join','replace','360WYmGzY','6LuumMf','parse','126125SYthng','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','startsWith','tdx.json','object','Invalid\x20tdx.json:\x20expected\x20object'];a124_0x4029=function(){return _0x5a0d03;};return a124_0x4029();}const a124_0x5518b8=a124_0x490a;function a124_0x490a(_0xfc1920,_0x13f2d6){_0xfc1920=_0xfc1920-0x17f;const _0x4029ac=a124_0x4029();let _0x490a0d=_0x4029ac[_0xfc1920];return _0x490a0d;}(function(_0x59970b,_0x5fadea){const _0xbcfdfa=a124_0x490a,_0x17ec70=_0x59970b();while(!![]){try{const _0x5ac791=-parseInt(_0xbcfdfa(0x18a))/0x1+parseInt(_0xbcfdfa(0x188))/0x2*(parseInt(_0xbcfdfa(0x184))/0x3)+parseInt(_0xbcfdfa(0x199))/0x4*(-parseInt(_0xbcfdfa(0x195))/0x5)+parseInt(_0xbcfdfa(0x183))/0x6+parseInt(_0xbcfdfa(0x180))/0x7*(parseInt(_0xbcfdfa(0x187))/0x8)+parseInt(_0xbcfdfa(0x182))/0x9+parseInt(_0xbcfdfa(0x181))/0xa;if(_0x5ac791===_0x5fadea)break;else _0x17ec70['push'](_0x17ec70['shift']());}catch(_0x517d07){_0x17ec70['push'](_0x17ec70['shift']());}}}(a124_0x4029,0x39234));import{existsSync,readFileSync}from'fs';import a124_0x599a1d from'path';const TDX_CONFIG_FILE=a124_0x5518b8(0x18d),SEGMENTS_DIR=a124_0x5518b8(0x191);export function findTdxConfigPath(_0x5bfa1d=process[a124_0x5518b8(0x17f)]()){const _0x314da8=a124_0x5518b8;let _0x625aaf=a124_0x599a1d[_0x314da8(0x192)](_0x5bfa1d);const _0x3d4cc4=a124_0x599a1d[_0x314da8(0x189)](_0x625aaf)['root'];while(_0x625aaf!==_0x3d4cc4){const _0x2b19c=a124_0x599a1d[_0x314da8(0x185)](_0x625aaf,TDX_CONFIG_FILE);if(existsSync(_0x2b19c))return _0x2b19c;_0x625aaf=a124_0x599a1d[_0x314da8(0x198)](_0x625aaf);}return null;}export function loadTdxConfig(_0x4490f1){const _0x480ed0=a124_0x5518b8,_0x41319e=readFileSync(_0x4490f1,_0x480ed0(0x193));let _0x2148d8;try{_0x2148d8=JSON[_0x480ed0(0x189)](_0x41319e);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x4490f1);}if(!_0x2148d8||typeof _0x2148d8!==_0x480ed0(0x18e))throw new Error(_0x480ed0(0x18f));const _0x540f7a=_0x2148d8;if(!_0x540f7a[_0x480ed0(0x190)]||typeof _0x540f7a[_0x480ed0(0x190)]!==_0x480ed0(0x197))throw new Error(_0x480ed0(0x18b));return{'parent_segment':_0x540f7a[_0x480ed0(0x190)]};}export function findTdxConfig(_0x139972=process[a124_0x5518b8(0x17f)]()){const _0x3be31d=a124_0x5518b8,_0x33fc5a=findTdxConfigPath(_0x139972);if(!_0x33fc5a)throw new Error('No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x355101=loadTdxConfig(_0x33fc5a),_0x5b023d=a124_0x599a1d[_0x3be31d(0x198)](_0x33fc5a);return{'config':_0x355101,'configPath':_0x33fc5a,'configDir':_0x5b023d};}export function tryFindTdxConfig(_0x7dba9f){try{return findTdxConfig(_0x7dba9f);}catch{return null;}}export function getSegmentRootDir(_0x32771a,_0x3f3f50=process[a124_0x5518b8(0x17f)]()){return a124_0x599a1d['join'](_0x3f3f50,SEGMENTS_DIR,_0x32771a);}export function getTdxConfigPath(_0x2282a5,_0x4f9a14=process['cwd']()){const _0xd9e269=a124_0x5518b8;return a124_0x599a1d[_0xd9e269(0x185)](getSegmentRootDir(_0x2282a5,_0x4f9a14),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x57924f,_0x1fb187){const _0x40f1fe=a124_0x5518b8,_0x25de69=a124_0x599a1d[_0x40f1fe(0x192)](_0x57924f),_0x30d693=a124_0x599a1d[_0x40f1fe(0x194)](_0x1fb187,_0x25de69);if(_0x30d693[_0x40f1fe(0x18c)]('..'))return'';return _0x30d693;}export function localPathToTdFolderPath(_0x490bab){const _0x44f919=a124_0x5518b8,_0x42bd84=a124_0x599a1d[_0x44f919(0x198)](_0x490bab);if(_0x42bd84==='.'||_0x42bd84==='')return'';return _0x42bd84[_0x44f919(0x186)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x5e530c,_0x3e5fff){if(!_0x5e530c)return _0x3e5fff;return a124_0x599a1d['join'](_0x3e5fff,_0x5e530c);}export function createTdxConfigContent(_0x1d9a14){const _0x3790ce=a124_0x5518b8,_0x34ce25={'parent_segment':_0x1d9a14};return JSON[_0x3790ce(0x196)](_0x34ce25,null,0x2)+'\x0a';}
|