@treasuredata/tdx 0.14.5 → 0.14.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/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.d.ts +0 -4
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +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/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/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +3 -2
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/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.d.ts +21 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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 a101_0x9e7797=a101_0x3b5e;(function(_0x1edb1d,_0x143c2d){const _0x24ec57=a101_0x3b5e,_0x10e389=_0x1edb1d();while(!![]){try{const _0x24caad=-parseInt(_0x24ec57(0x235))/0x1*(parseInt(_0x24ec57(0x29d))/0x2)+-parseInt(_0x24ec57(0x1ec))/0x3+parseInt(_0x24ec57(0x2ad))/0x4*(parseInt(_0x24ec57(0x267))/0x5)+-parseInt(_0x24ec57(0x25b))/0x6+-parseInt(_0x24ec57(0x222))/0x7+parseInt(_0x24ec57(0x23e))/0x8*(-parseInt(_0x24ec57(0x286))/0x9)+-parseInt(_0x24ec57(0x228))/0xa*(-parseInt(_0x24ec57(0x1e5))/0xb);if(_0x24caad===_0x143c2d)break;else _0x10e389['push'](_0x10e389['shift']());}catch(_0x504e03){_0x10e389['push'](_0x10e389['shift']());}}}(a101_0x5aa1,0xa868c));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a101_0x9e7797(0x241);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x4e3ac8){return''+PENDING_SEGMENT_PREFIX+_0x4e3ac8+'__';}export function isPendingSegmentId(_0x101b66){const _0x33f70a=a101_0x9e7797;return _0x101b66[_0x33f70a(0x216)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x21b804){const _0x43d7dc=a101_0x9e7797;return _0x21b804[_0x43d7dc(0x255)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x2d53bb){return''+PENDING_ACTIVATION_PREFIX+_0x2d53bb+'__';}export function isPendingActivationId(_0x296b7c){const _0x52b018=a101_0x9e7797;return _0x296b7c[_0x52b018(0x216)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x192cd0){return _0x192cd0['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x5e5423,_0x1db301){const _0x52a658=a101_0x9e7797,_0x2a91ed=_0x5e5423+'::'+(_0x1db301[_0x52a658(0x2bb)]()||_0x52a658(0x209)),_0x253f39=createHash(_0x52a658(0x21e))[_0x52a658(0x245)](_0x2a91ed)[_0x52a658(0x24a)](_0x52a658(0x2a0))[_0x52a658(0x20b)](0x0,0xc);return _0x52a658(0x261)+_0x253f39;}export function ensureJourneyDefaults(_0x53a33e){const _0x24a3b3=a101_0x9e7797;!_0x53a33e[_0x24a3b3(0x2a5)]&&(_0x53a33e[_0x24a3b3(0x2a5)]=''),!_0x53a33e[_0x24a3b3(0x29e)]&&(_0x53a33e[_0x24a3b3(0x29e)]='draft');}export function resolveTDFolderPath(_0x49b626,_0x577914,_0x2746ba){const _0xfab8f7=a101_0x9e7797;if(!_0x577914)return _0x49b626;if(_0x49b626===_0x2746ba||_0x49b626[_0xfab8f7(0x216)](_0x2746ba+'/'))return _0x49b626;return _0x49b626?_0x2746ba+'/'+_0x49b626:_0x2746ba;}export function addFoldersToCreate(_0x578ff1,_0x123e58,_0x5dc46f){const _0x530a41=a101_0x9e7797;if(!_0x578ff1)return;if(_0x123e58[_0x530a41(0x211)](_0x578ff1))return;const _0x305faa=_0x578ff1[_0x530a41(0x1fe)]('/');let _0x301010='';for(const _0x479fdf of _0x305faa){_0x301010=_0x301010?_0x301010+'/'+_0x479fdf:_0x479fdf,!_0x123e58[_0x530a41(0x211)](_0x301010)&&_0x5dc46f[_0x530a41(0x281)](_0x301010);}}import*as a101_0x1cd690 from'yaml';import{readFileSync}from'fs';import a101_0x3071cc from'path';import{isJourneyDef,parseYamlString as a101_0x526b21,toYamlString as a101_0x112909,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';function a101_0x5aa1(){const _0x3cd48c=['activationStepsById','Updated\x20journey\x20\x27','behavior','goal','type','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','createdSegmentIds','user','push','\x20activation\x20\x27','folderPath','embedded_segment_created','onProgress','Activation\x20not\x20found:\x20','from','item','folder_created','parentId','steps','milestone','activation_created','add','journeys','action','results','all','794664udjoDv','index','\x20(referenced\x20in\x20journey\x20','schedule','embedded_segment_creating','WaitStep','waitCondition','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','segment_deleting','segment_created','stages','activation_deleted','utf-8','stage\x20\x27','logSuccess','updateSegmentById','\x27\x20decision\x20point\x20branch\x20\x27','embeddedSegmentNameToId','getSegment','existingActivation','getJourney','activation_deleting','folderPathToId','2byLtdO','state','):\x20','hex','\x27\x20from\x20file:\x20','\x27\x20exit\x20criteria','kind','Created\x20segment\x20\x27','description','segment_deleted','diff','size','skipSegments','relationships','max','with','157928TfaZWw','branches','entries','createJourneySegment','Deleted\x20activation\x20\x27','folderId','Creating\x20segment\x20\x27','INTERNAL','segments','map','folder_creating','Created\x20journey\x20\x27','activation_','Segment\x20not\x20found:\x20','trim','segment_creating','create','createdSegmentId','JOURNEY_SYNTAX_ERROR','columns','values','\x27\x20milestone','decision_point','Journey\x20\x27','activations',').\x20','deleteActivation','connection','validatedRequest','createActivation','journeyStages','segmentByFolderAndName','\x20error(s)','23277837tDCPhF','message','DecisionPoint','reduce','existingSegments','resolveSegment','absolutePath','3660696jERhWx','getActivation','SEGMENT_UPDATE_ERROR','Fetching\x20','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','ACTIVATION_SYNTAX_ERROR','withProgress','get','\x27\x20entry\x20criteria','\x20journey\x20from\x20file:\x20','isArray','created','journey_created','filter','\x0a\x20\x20','createSegment','Creating\x20folder\x20\x27','Deleted\x20segment\x20\x27','split','unchanged','activation_updated','journey_updated','entry_criteria','segmentId','rule','join','segmentNameToId','segment_updated','object','segment','deleteSegment','slice','activationsBySegmentId','localSegmentRules','JOURNEY_UPDATE_ERROR','set','segmentFolderId','has','entry','Failed\x20to\x20','versionNumber','journeyBundlesByFolderAndName','startsWith','embedded_activation_creating','progress','existingSegment','\x27...','activationActions','name','SEGMENT_NOT_FOUND','sha1','logDeleted','isNew','journeyActivationStepId','2651012UHwGJn','Activation','entryCriteria','length','\x27\x20wait\x20condition','activation_updating','10zNnfdv','parentFolder','NOT_FOUND','\x27\x20for\x20','Stage\x20\x27','verbose','Deleting\x20activation\x20\x27','Entry\x20criteria:\x20','idToEmailMap','Name\x20has\x20already\x20been\x20taken','\x20segment\x20from\x20file:\x20','keys','list','330218fNxTiU','activationParams','activationContext','journeyById','Created\x20folder\x20\x27','exitCriterias','../../utils/async.js','Created\x20activation\x20\x27','parseDocument','8kBABYh','createFolder','./journey-yaml.js','__pending_','errors','SEGMENT_SYNTAX_ERROR','connectionIdToNameMap','update','existingJourney','journeyBundleName','journey','./child-segment-yaml.js','digest','toLowerCase','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','sort','goal\x20criteria','updated','data','find','null','resolveJourneyId','dirname','replace','attributes','all_columns','notification','rootFolderId','ACTIVATION_UPDATE_ERROR','243678OcOMcS','activation_creating','parse','embedded_activation_created','journeyActivationNameToId','hasChanges','journey_entry_criteria_','idToName','listActivations','valid','delete','yamlConfig','80qraeFp','stringify','deps','activation_template_id','deleted'];a101_0x5aa1=function(){return _0x3cd48c;};return a101_0x5aa1();}import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x32ac6c){const _0x225099=a101_0x9e7797;if(Array[_0x225099(0x1f6)](_0x32ac6c))return'['+_0x32ac6c[_0x225099(0x2b6)](_0x5e4ebe=>stableStringify(_0x5e4ebe))[_0x225099(0x205)](',')+']';if(_0x32ac6c&&typeof _0x32ac6c===_0x225099(0x208)){const _0x18bf74=_0x32ac6c,_0x5947e8=Object[_0x225099(0x233)](_0x18bf74)[_0x225099(0x24d)](),_0x18db5f=_0x5947e8['map'](_0x50580d=>'\x22'+_0x50580d+'\x22:'+stableStringify(_0x18bf74[_0x50580d]));return'{'+_0x18db5f[_0x225099(0x205)](',')+'}';}const _0x483f41=JSON[_0x225099(0x268)](_0x32ac6c);return _0x483f41===undefined?_0x225099(0x252):_0x483f41;}function activationSignature(_0x1bcc1f){const _0x428458=a101_0x9e7797,_0x1817c3={'connection':_0x1bcc1f['connection'],..._0x1bcc1f[_0x428458(0x257)]!==undefined&&{'all_columns':_0x1bcc1f[_0x428458(0x257)]},..._0x1bcc1f[_0x428458(0x2c0)]!==undefined&&{'columns':_0x1bcc1f[_0x428458(0x2c0)]},..._0x1bcc1f[_0x428458(0x26e)]!==undefined&&{'behavior':_0x1bcc1f[_0x428458(0x26e)]},..._0x1bcc1f[_0x428458(0x289)]!==undefined&&{'schedule':_0x1bcc1f[_0x428458(0x289)]},..._0x1bcc1f['notification']!==undefined&&{'notification':_0x1bcc1f[_0x428458(0x258)]},..._0x1bcc1f['connector_config']!==undefined&&{'connector_config':_0x1bcc1f['connector_config']},..._0x1bcc1f[_0x428458(0x26a)]!==undefined&&{'activation_template_id':_0x1bcc1f['activation_template_id']}};return stableStringify(_0x1817c3);}function a101_0x3b5e(_0x132ddd,_0x5ae65e){_0x132ddd=_0x132ddd-0x1e1;const _0x5aa1d2=a101_0x5aa1();let _0x3b5e6d=_0x5aa1d2[_0x132ddd];return _0x3b5e6d;}export async function prepareSegmentFiles(_0x33394b,_0x238db4,_0x4ace23,_0x1021cc,_0x5bd944){const _0x97a358=a101_0x9e7797,{activationDefToCreateRequest:_0x518e89}=await import(_0x97a358(0x249)),_0x33b326=[],_0x3a26b1=new Set();for(const {yamlConfig:_0x7c16d1,folderPath:_0x19d96b,sourcePath:_0x167d53}of _0x33394b){const _0x2c1a29=resolveTDFolderPath(_0x19d96b,_0x1021cc,_0x5bd944),_0xbb4a00=_0x2c1a29+':'+_0x7c16d1[_0x97a358(0x21c)],_0x1cec06=_0x238db4[_0x97a358(0x1e3)][_0x97a358(0x1f3)](_0xbb4a00),_0x2c1392=_0x1cec06?_0x238db4[_0x97a358(0x20c)][_0x97a358(0x1f3)](_0x1cec06['id'])||[]:[];addFoldersToCreate(_0x2c1a29,_0x238db4['folderPathToId'],_0x3a26b1);const _0xee37a9=calculateActivationActions(_0x7c16d1[_0x97a358(0x2c5)]||[],_0x2c1392,_0x238db4[_0x97a358(0x230)],_0x238db4[_0x97a358(0x244)]);for(const _0x508009 of _0xee37a9){(_0x508009[_0x97a358(0x270)]===_0x97a358(0x2bd)||_0x508009['type']===_0x97a358(0x245))&&_0x508009['yamlActivation']&&(_0x508009[_0x97a358(0x2c9)]=await _0x518e89(_0x508009['yamlActivation'],_0x4ace23));}const _0x48c014=calculateSegmentDiff(_0x7c16d1,_0x1cec06,_0x2c1392,_0x238db4['idToEmailMap'],_0x238db4['connectionIdToNameMap']);_0x33b326[_0x97a358(0x274)]({'relativePath':_0x7c16d1[_0x97a358(0x21c)],'absolutePath':_0x167d53,'yamlConfig':_0x7c16d1,'folderPath':_0x2c1a29,'existingSegment':_0x1cec06,'existingActivations':_0x2c1392,'isNew':_0x48c014[_0x97a358(0x220)],'hasChanges':_0x48c014[_0x97a358(0x260)],'diff':_0x48c014[_0x97a358(0x2a7)],'activationActions':_0xee37a9});}return{'segmentFiles':_0x33b326,'foldersToCreate':_0x3a26b1};}export async function prepareJourneyFiles(_0x450854,_0x590038,_0x4d18b0,_0x5a60d1){const _0x2fdc2a=a101_0x9e7797,_0x4f24e6=[],_0x238b22=new Set();for(const {yamlConfig:_0x143444,folderPath:_0x44dc1a,sourcePath:_0x3c0bda}of _0x450854){const _0x5dd499=resolveTDFolderPath(_0x44dc1a,_0x4d18b0,_0x5a60d1),_0x26ae73=_0x5dd499+':'+_0x143444[_0x2fdc2a(0x21c)],_0x4a4a76=_0x590038[_0x2fdc2a(0x215)]['get'](_0x26ae73);let _0x2ecd97,_0x4783ff;if(_0x4a4a76&&_0x4a4a76[_0x2fdc2a(0x225)]>0x0){const _0x40e770=buildLocalExpandedRuleMappings(_0x143444),{createYamlContext:_0x3ac4d3,prefetchJourneySegments:_0x31ba6e}=createPushYamlContextForBundle(_0x590038[_0x2fdc2a(0x269)],_0x590038[_0x2fdc2a(0x27d)],_0x590038[_0x2fdc2a(0x1e9)],_0x40e770,_0x590038[_0x2fdc2a(0x230)],_0x590038[_0x2fdc2a(0x244)],_0x590038[_0x2fdc2a(0x26c)],_0x590038[_0x2fdc2a(0x238)]);await _0x31ba6e(_0x4a4a76[_0x2fdc2a(0x2b6)](_0x5c4857=>_0x5c4857['id']));const _0x6ba9ec=hasMultipleVersions(_0x143444),_0x26dab5=async _0x4b0a4b=>{const _0xc18e3=_0x2fdc2a,_0x2392fd=_0x590038[_0xc18e3(0x238)]?.['get'](_0x4b0a4b);if(_0x2392fd)return _0x2392fd;return _0x590038['fetchJourney']({'journeyId':_0x4b0a4b,'journeyName':_0x143444[_0xc18e3(0x21c)],'isMultiVersion':_0x4a4a76[_0xc18e3(0x225)]>0x1});};if(_0x6ba9ec&&_0x4a4a76[_0x2fdc2a(0x225)]>0x1){const _0x5d6914=[];for(const _0x4c390e of _0x4a4a76){const _0x1b8ed1=_0x4c390e['versionNumber']||0x1;_0x590038[_0x2fdc2a(0x218)]?.[_0x2fdc2a(0x245)]('Fetching\x20'+_0x143444['name']+'\x20v'+_0x1b8ed1);const _0x365679=await _0x26dab5(_0x4c390e['id']),_0x1ce60a=_0x3ac4d3(_0x4c390e['id']),_0x553181=await journeyResponseToDef(_0x365679,_0x1ce60a);_0x5d6914['push']({'item':_0x4c390e,'yaml':_0x553181});}const _0x246946=buildLocalRuleToNameMappingFromJourney(_0x143444);_0x4783ff=buildMergedJourneyDef(_0x5d6914,_0x246946);const _0x62aecf=Math[_0x2fdc2a(0x2ab)](..._0x5d6914['map'](_0xc6b4db=>_0xc6b4db[_0x2fdc2a(0x27b)][_0x2fdc2a(0x214)]||0x0)),_0x473c65=_0x4a4a76[_0x2fdc2a(0x251)](_0x433c92=>(_0x433c92['versionNumber']||0x0)===_0x62aecf);_0x473c65&&(_0x590038[_0x2fdc2a(0x218)]?.['update'](_0x2fdc2a(0x1ef)+_0x143444[_0x2fdc2a(0x21c)]+'\x20v'+_0x62aecf),_0x2ecd97=await _0x26dab5(_0x473c65['id']));}else{const _0x193d2f=_0x4a4a76[_0x4a4a76[_0x2fdc2a(0x225)]-0x1];_0x590038[_0x2fdc2a(0x218)]?.[_0x2fdc2a(0x245)](_0x2fdc2a(0x1ef)+_0x143444['name']),_0x2ecd97=await _0x26dab5(_0x193d2f['id']);const _0xf1968f=_0x3ac4d3(_0x193d2f['id']),_0x353f30=await journeyResponseToDef(_0x2ecd97,_0xf1968f),_0x4e9d1a=buildLocalRuleToNameMappingFromJourney(_0x143444);_0x4783ff=buildMergedJourneyDef([{'item':_0x193d2f,'yaml':_0x353f30}],_0x4e9d1a);}}addFoldersToCreate(_0x5dd499,_0x590038[_0x2fdc2a(0x29c)],_0x238b22);const _0x11230b=calculateJourneyDiff(_0x143444,_0x4783ff);_0x4f24e6[_0x2fdc2a(0x274)]({'relativePath':_0x143444['name'],'absolutePath':_0x3c0bda,'yamlConfig':_0x143444,'folderPath':_0x5dd499,'existingJourney':_0x2ecd97,'isNew':_0x11230b[_0x2fdc2a(0x220)],'hasChanges':_0x11230b['hasChanges'],'diff':_0x11230b['diff']});}return{'journeyFiles':_0x4f24e6,'foldersToCreate':_0x238b22};}export function calculateActivationActions(_0x4621c1,_0x5c1e0,_0x3829cb,_0x456638){const _0x3800c0=a101_0x9e7797,_0x25fc54=[],_0x3b2b17=new Map();for(const _0x1360e0 of _0x5c1e0){_0x3b2b17[_0x3800c0(0x20f)](_0x1360e0[_0x3800c0(0x21c)],_0x1360e0);}const _0x1f05a6=new Map();for(const _0x16294e of _0x4621c1){_0x1f05a6[_0x3800c0(0x20f)](_0x16294e['name'],_0x16294e);}for(const _0x23b480 of _0x4621c1){const _0x59d698=_0x3b2b17[_0x3800c0(0x1f3)](_0x23b480[_0x3800c0(0x21c)]);if(!_0x59d698)_0x25fc54[_0x3800c0(0x274)]({'type':'create','name':_0x23b480['name'],'yamlActivation':_0x23b480});else{const _0x2c810f=activationResponseToDef(_0x59d698,_0x3829cb,_0x456638),_0x42284d=a101_0x1cd690[_0x3800c0(0x268)](_0x2c810f),_0x596a09=a101_0x1cd690[_0x3800c0(0x268)](_0x23b480);_0x42284d!==_0x596a09&&_0x25fc54[_0x3800c0(0x274)]({'type':_0x3800c0(0x245),'name':_0x23b480[_0x3800c0(0x21c)],'yamlActivation':_0x23b480,'existingActivation':_0x59d698});}}for(const _0x76c8d5 of _0x5c1e0){!_0x1f05a6[_0x3800c0(0x211)](_0x76c8d5[_0x3800c0(0x21c)])&&_0x25fc54[_0x3800c0(0x274)]({'type':_0x3800c0(0x265),'name':_0x76c8d5[_0x3800c0(0x21c)],'existingActivation':_0x76c8d5});}return _0x25fc54;}export function calculateSegmentDiff(_0x4618e7,_0xaa0cc0,_0x5f08ce,_0x1b5775,_0x13614b){const _0x37d201=segmentToYamlString(_0x4618e7);if(_0xaa0cc0){const _0x2e4d1d=segmentWithActivationsToYaml(_0xaa0cc0,_0x5f08ce,undefined,_0x1b5775,_0x13614b),_0x48d6e6=segmentToYamlString(_0x2e4d1d),_0x1853ac=generateDiff(_0x48d6e6,_0x37d201),_0x3e6a39=hasChanges(_0x1853ac);return{'isNew':![],'hasChanges':_0x3e6a39,'diff':_0x3e6a39?formatDiffWithColors(_0x1853ac):undefined};}const _0x4cc464=generateDiff('',_0x37d201);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4cc464)};}export function calculateJourneyDiff(_0xc2c909,_0xa00bec){const _0x490298=normalizeJourneyDef(_0xc2c909,_0xc2c909),_0x81ff0d=a101_0x112909(_0x490298);if(_0xa00bec){const _0x34d97c=normalizeJourneyDef(_0xa00bec,_0xc2c909),_0x98dd56=a101_0x112909(_0x34d97c),_0x86490c=generateDiff(_0x98dd56,_0x81ff0d),_0x150932=hasChanges(_0x86490c);return{'isNew':![],'hasChanges':_0x150932,'diff':_0x150932?formatDiffWithColors(_0x86490c):undefined};}const _0x1f928a=generateDiff('',_0x81ff0d);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1f928a)};}export function findSegmentsToDelete(_0xc20bf6,_0x24aaf8,_0x33ca3f,_0x253733,_0x36448e){const _0x2a8289=a101_0x9e7797,_0x2cf746=new Set();for(const {yamlConfig:_0x1297d4,folderPath:_0x43692a}of _0x24aaf8){_0x2cf746['add'](_0x43692a+':'+_0x1297d4[_0x2a8289(0x21c)]);}return _0xc20bf6[_0x2a8289(0x1f9)](_0x3db04b=>{const _0x22ab74=_0x2a8289,_0x48ee4b=_0x3db04b[_0x22ab74(0x210)]?_0x33ca3f[_0x22ab74(0x1f3)](_0x3db04b['segmentFolderId']['toString']())||'':'',_0x4863ea=_0x48ee4b+':'+_0x3db04b[_0x22ab74(0x21c)];if(_0x2cf746[_0x22ab74(0x211)](_0x4863ea))return![];if(_0x36448e)return _0x48ee4b===_0x253733||_0x48ee4b[_0x22ab74(0x216)](_0x253733+'/');return!![];});}export function findJourneysToDelete(_0x12cd0e,_0x252fed,_0x4e094e,_0x156fa9,_0x2f0dd8){const _0x46409d=a101_0x9e7797,_0x4ca106=new Set();for(const {yamlConfig:_0x29b83f,folderPath:_0x5641a4}of _0x252fed){_0x4ca106[_0x46409d(0x281)](_0x5641a4+':'+_0x29b83f[_0x46409d(0x21c)]);}return _0x12cd0e[_0x46409d(0x1f9)](_0xf8e6e=>{const _0x252492=_0x46409d,_0xf865d0=_0xf8e6e[_0x252492(0x2b2)]?_0x4e094e[_0x252492(0x1f3)](_0xf8e6e[_0x252492(0x2b2)])||'':'',_0x3b47eb=_0xf865d0+':'+_0xf8e6e[_0x252492(0x247)];if(_0x4ca106[_0x252492(0x211)](_0x3b47eb))return![];if(_0x2f0dd8)return _0xf865d0===_0x156fa9||_0xf865d0[_0x252492(0x216)](_0x156fa9+'/');return!![];});}export function buildSegmentLookupMap(_0x10aa1c,_0xf3cd81){const _0x2741ed=a101_0x9e7797,_0x2e447f=new Map();for(const _0x3d697a of _0x10aa1c){const _0x36d62e=_0x3d697a[_0x2741ed(0x210)]?_0xf3cd81[_0x2741ed(0x1f3)](_0x3d697a[_0x2741ed(0x210)]['toString']())||'':'',_0x5e0f0e=_0x36d62e+':'+_0x3d697a[_0x2741ed(0x21c)];_0x2e447f[_0x2741ed(0x20f)](_0x5e0f0e,_0x3d697a);}return _0x2e447f;}export function buildSegmentNameToIdMap(_0x1aede9){const _0x23bc63=a101_0x9e7797,_0x49f8b0=new Map();for(const _0x14a871 of _0x1aede9){_0x49f8b0[_0x23bc63(0x20f)](_0x14a871[_0x23bc63(0x21c)],_0x14a871['id']);}return _0x49f8b0;}export function buildJourneyBundleLookupMap(_0x4c01fa,_0x32d84c){const _0x234145=a101_0x9e7797,_0x34cb9b=new Map();for(const _0x4c2aea of _0x4c01fa){const _0x577ae7=_0x4c2aea[_0x234145(0x2b2)]?_0x32d84c[_0x234145(0x1f3)](_0x4c2aea[_0x234145(0x2b2)])||'':'',_0x261c2f=_0x577ae7+':'+_0x4c2aea['journeyBundleName'];!_0x34cb9b['has'](_0x261c2f)&&_0x34cb9b[_0x234145(0x20f)](_0x261c2f,[]),_0x34cb9b[_0x234145(0x1f3)](_0x261c2f)[_0x234145(0x274)](_0x4c2aea);}for(const _0x7dc336 of _0x34cb9b[_0x234145(0x2c1)]()){_0x7dc336[_0x234145(0x24d)]((_0x396a37,_0x400da4)=>(_0x396a37[_0x234145(0x214)]||0x0)-(_0x400da4['versionNumber']||0x0));}return _0x34cb9b;}export function collectFoldersToCreate(_0x356a2b,_0x5e1552){const _0x5b1267=a101_0x9e7797,_0x11cbfa=new Set();for(const _0x24dff9 of _0x356a2b){if(!_0x24dff9)continue;if(_0x5e1552[_0x5b1267(0x211)](_0x24dff9))continue;const _0x47dd0f=_0x24dff9[_0x5b1267(0x1fe)]('/');let _0x19e7ac='';for(const _0x1d95b3 of _0x47dd0f){_0x19e7ac=_0x19e7ac?_0x19e7ac+'/'+_0x1d95b3:_0x1d95b3,!_0x5e1552[_0x5b1267(0x211)](_0x19e7ac)&&_0x11cbfa[_0x5b1267(0x281)](_0x19e7ac);}}return _0x11cbfa;}export function parseAndClassifyYamlFiles(_0x425852,_0x88add3,_0x583281){const _0x2eea70=a101_0x9e7797,_0x454ad5=[],_0xa20618=[];for(const _0x2ec255 of _0x425852){const _0x3b2b10=a101_0x3071cc['relative'](_0x88add3,a101_0x3071cc[_0x2eea70(0x254)](_0x2ec255)),_0x878e73=_0x3b2b10==='.'?'':_0x3b2b10,_0x6cc827=readFileSync(_0x2ec255,_0x2eea70(0x292)),_0xfe9994=a101_0x1cd690[_0x2eea70(0x25d)](_0x6cc827);if(isJourneyDef(_0xfe9994)){const _0x259295=a101_0x526b21(_0x6cc827);_0xa20618[_0x2eea70(0x274)]({'yamlConfig':_0x259295,'folderPath':_0x878e73,'sourcePath':_0x2ec255});}else{if(!_0x583281?.[_0x2eea70(0x2a9)]){const _0x161465=parseSegmentYamlFile(_0x6cc827),_0x2275d7=normalizeChildSegmentYaml(_0x161465);_0x454ad5['push']({'yamlConfig':_0x2275d7,'folderPath':_0x878e73,'sourcePath':_0x2ec255});}}}return{'segments':_0x454ad5,'journeys':_0xa20618};}export function validateParsedFiles(_0x37dbfd,_0x2bfd56){const _0x2bb77c=a101_0x9e7797,_0x3fe101=[];for(const {yamlConfig:_0x14bcda,sourcePath:_0x1c2535}of _0x37dbfd['segments']){const _0x5792ef=readFileSync(_0x1c2535,_0x2bb77c(0x292)),_0x28076a=a101_0x1cd690[_0x2bb77c(0x23d)](_0x5792ef),_0x729c5e=validateSegmentDef(_0x14bcda,{'source':_0x5792ef,'document':_0x28076a});if(!_0x729c5e[_0x2bb77c(0x264)]){const _0x4769e3=a101_0x3071cc['relative'](_0x2bfd56,_0x1c2535);_0x3fe101[_0x2bb77c(0x274)]({'filePath':_0x4769e3,'source':_0x5792ef,'result':_0x729c5e,'isJourney':![]});}}for(const {yamlConfig:_0x381e9a,sourcePath:_0x40a226}of _0x37dbfd[_0x2bb77c(0x282)]){const _0x216028=readFileSync(_0x40a226,_0x2bb77c(0x292)),_0xc4eb9d=a101_0x1cd690[_0x2bb77c(0x23d)](_0x216028),_0x3ff3b0=validateJourneyDef(_0x381e9a,{'source':_0x216028,'document':_0xc4eb9d});if(!_0x3ff3b0[_0x2bb77c(0x264)]){const _0x3e013c=a101_0x3071cc['relative'](_0x2bfd56,_0x40a226);_0x3fe101['push']({'filePath':_0x3e013c,'source':_0x216028,'result':_0x3ff3b0,'isJourney':!![]});}}return _0x3fe101;}export function formatValidationErrors(_0x11a396){const _0x7d1623=a101_0x9e7797,_0x2fb76c=[];for(const {filePath:_0x4655e,source:_0x270044,result:_0x1b274b,isJourney:_0x3ccb7a}of _0x11a396){const _0x394963=_0x3ccb7a?'journey':_0x7d1623(0x209);_0x2fb76c[_0x7d1623(0x274)]('\x0a'+_0x4655e+'\x20('+_0x394963+_0x7d1623(0x29f)+_0x1b274b[_0x7d1623(0x242)][_0x7d1623(0x225)]+_0x7d1623(0x1e4)),_0x2fb76c[_0x7d1623(0x274)](formatValidationResult(_0x1b274b,_0x270044,_0x4655e));}return _0x2fb76c[_0x7d1623(0x205)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x3b7801){const _0x3ae961=a101_0x9e7797,_0x4b590b=new Set(),_0x3af0b8=new Map(),_0x4809df=collectSegmentUsageCounts(_0x3b7801);if(_0x3b7801[_0x3ae961(0x2b5)])for(const [_0x56b961,_0x4230e4]of Object[_0x3ae961(0x2af)](_0x3b7801[_0x3ae961(0x2b5)])){_0x4b590b['add'](_0x56b961);if(_0x4230e4[_0x3ae961(0x204)]){const _0x174005=yamlRuleToApi(_0x4230e4['rule']),_0x9d74fe=apiRuleToYaml(_0x174005);_0x3af0b8[_0x3ae961(0x20f)](_0x56b961,_0x9d74fe);}}const _0xec023c=new Map();let _0x4567f7=0x0;for(const [_0x421406,_0x4d3f46]of _0x3af0b8){const _0x5c96e5=serializeExpandedRule(_0x4d3f46,_0x3af0b8),_0x50eb1c=_0xec023c[_0x3ae961(0x1f3)](_0x5c96e5)||[];_0x50eb1c[_0x3ae961(0x274)]({'name':_0x421406,'index':_0x4567f7}),_0xec023c[_0x3ae961(0x20f)](_0x5c96e5,_0x50eb1c),_0x4567f7++;}const _0x344821=new Map();for(const [_0x318fa6,_0x9dd780]of _0xec023c){const _0x2023ac=_0x9dd780['slice']()['sort']((_0x26512e,_0x2d131f)=>{const _0x403e77=_0x3ae961,_0x1a1444=_0x4809df['get'](_0x26512e[_0x403e77(0x21c)])||0x0,_0x3f2ecc=_0x4809df[_0x403e77(0x1f3)](_0x2d131f[_0x403e77(0x21c)])||0x0;if(_0x1a1444!==_0x3f2ecc)return _0x3f2ecc-_0x1a1444;return _0x26512e[_0x403e77(0x287)]-_0x2d131f[_0x403e77(0x287)];})['map'](_0x255b91=>_0x255b91[_0x3ae961(0x21c)]),_0x18cf2a=[];for(const _0x2f3530 of _0x2023ac){const _0x47b33c=_0x4809df[_0x3ae961(0x1f3)](_0x2f3530)||0x0,_0x57a552=Math[_0x3ae961(0x2ab)](_0x47b33c,0x1);for(let _0xb008b2=0x0;_0xb008b2<_0x57a552;_0xb008b2++){_0x18cf2a['push'](_0x2f3530);}}_0x344821[_0x3ae961(0x20f)](_0x318fa6,_0x18cf2a);}return{'existingLocalSegmentNames':_0x4b590b,'localSegmentRules':_0x3af0b8,'localExpandedRuleToNames':_0x344821};}async function buildServerSegmentRuleMap(_0x5bf349,_0x442b8a,_0x3516e4,_0x296614){const _0x3df7af=new Map(),_0x4f29ec=new Set(),_0x18515c=async _0x17164e=>{const _0x1cee32=a101_0x3b5e;if(_0x4f29ec[_0x1cee32(0x211)](_0x17164e))return;_0x4f29ec[_0x1cee32(0x281)](_0x17164e);let _0x12dfcc=_0x3516e4[_0x1cee32(0x251)](_0x3e36f6=>_0x3e36f6['id']===_0x17164e);if(!_0x12dfcc)try{_0x12dfcc=await _0x5bf349[_0x1cee32(0x209)][_0x1cee32(0x298)](_0x442b8a,_0x17164e);}catch{return;}if(!_0x12dfcc?.[_0x1cee32(0x204)])return;const _0x525352=apiRuleToYaml(_0x12dfcc[_0x1cee32(0x204)]);_0x3df7af['set'](_0x17164e,_0x525352);const _0x4af307=collectSegmentRefsFromRule(_0x525352);for(const _0x19d377 of _0x4af307){await _0x18515c(_0x19d377);}};for(const _0x17797f of _0x296614){await _0x18515c(_0x17797f);}return _0x3df7af;}export function createSegmentIdResolver(_0x44ae9e,_0x46675f){return async _0x58a232=>{const _0x21b232=a101_0x3b5e,_0x15d8d9=_0x44ae9e[_0x21b232(0x1f3)](_0x58a232);if(!_0x15d8d9)throw new SDKError(ErrorCode[_0x21b232(0x21d)],_0x21b232(0x2ba)+_0x58a232+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x46675f+'\x27)');return _0x15d8d9;};}export function extractRootFolderId(_0x350938){const _0x14fafe=a101_0x9e7797;return _0x350938[_0x14fafe(0x2aa)]?.['parentSegmentFolder']?.[_0x14fafe(0x250)]?.['id']||_0x350938[_0x14fafe(0x2aa)]?.[_0x14fafe(0x229)]?.[_0x14fafe(0x250)]?.['id'];}export function buildConnectionMaps(_0x54aabd){const _0x3f700d=a101_0x9e7797,_0x1d148d=new Map(),_0x420c8a=new Map(),_0x4e7415=new Map();for(const _0x12f4ab of _0x54aabd){_0x1d148d['set'](_0x12f4ab['name'],parseInt(_0x12f4ab['id'],0xa)),_0x420c8a[_0x3f700d(0x20f)](_0x12f4ab['id'],_0x12f4ab[_0x3f700d(0x21c)]),_0x4e7415[_0x3f700d(0x20f)](_0x12f4ab[_0x3f700d(0x21c)],_0x12f4ab[_0x3f700d(0x270)]);}return{'nameToId':_0x1d148d,'idToName':_0x420c8a,'nameToType':_0x4e7415};}export function calculatePushStats(_0x1e733d,_0x5842f5,_0x4e0735,_0x51984d,_0x4c97f2,_0x514aaa,_0xc2a950){const _0x341971=a101_0x9e7797,_0x314c35=_0x1e733d[_0x341971(0x1f9)](_0x316147=>_0x316147['isNew']),_0x52ef1c=_0x1e733d[_0x341971(0x1f9)](_0x48f7c0=>!_0x48f7c0[_0x341971(0x220)]&&_0x48f7c0[_0x341971(0x260)]),_0x3a6161=_0x1e733d[_0x341971(0x1f9)](_0xcd9cf3=>!_0xcd9cf3['isNew']&&!_0xcd9cf3[_0x341971(0x260)]),_0x468b02=_0x514aaa?_0x51984d:[],_0x461d3e=_0x5842f5[_0x341971(0x1f9)](_0x1a8a17=>_0x1a8a17[_0x341971(0x220)]),_0x2c2b9b=_0x5842f5[_0x341971(0x1f9)](_0x43f47e=>!_0x43f47e[_0x341971(0x220)]&&_0x43f47e[_0x341971(0x260)]),_0x9ddfe9=_0x5842f5[_0x341971(0x1f9)](_0x2eedac=>!_0x2eedac[_0x341971(0x220)]&&!_0x2eedac[_0x341971(0x260)]),_0x37565d=_0x514aaa?_0x4c97f2:[],_0x51910d=_0x1e733d['flatMap'](_0x41c807=>_0x41c807[_0x341971(0x21b)]),_0x32edfe=_0x51910d[_0x341971(0x1f9)](_0x46327d=>_0x46327d[_0x341971(0x270)]===_0x341971(0x2bd)),_0x5c495a=_0x51910d[_0x341971(0x1f9)](_0xb53461=>_0xb53461[_0x341971(0x270)]===_0x341971(0x245)),_0x5df955=_0x51910d['filter'](_0x5693b3=>_0x5693b3[_0x341971(0x270)]===_0x341971(0x265)),_0x474d4a=Array['from'](_0x4e0735)['sort'](),_0xe69717=_0xc2a950?![]:_0x314c35[_0x341971(0x225)]>0x0||_0x52ef1c[_0x341971(0x225)]>0x0||_0x468b02[_0x341971(0x225)]>0x0,_0x127b48=_0x461d3e['length']>0x0||_0x2c2b9b[_0x341971(0x225)]>0x0||_0x37565d[_0x341971(0x225)]>0x0,_0x290353=_0xc2a950?![]:_0x51910d[_0x341971(0x225)]>0x0,_0x1cc738=_0x474d4a[_0x341971(0x225)]>0x0;return{'segments':{'new':_0x314c35,'changed':_0x52ef1c,'unchanged':_0x3a6161,'toDelete':_0x468b02},'journeys':{'new':_0x461d3e,'changed':_0x2c2b9b,'unchanged':_0x9ddfe9,'toDelete':_0x37565d},'activations':{'all':_0x51910d,'toCreate':_0x32edfe,'toUpdate':_0x5c495a,'toDelete':_0x5df955},'folders':{'toCreate':_0x474d4a},'counts':{'segments':{'new':_0x314c35['length'],'changed':_0x52ef1c[_0x341971(0x225)],'unchanged':_0x3a6161[_0x341971(0x225)],'toDelete':_0x468b02[_0x341971(0x225)]},'journeys':{'new':_0x461d3e['length'],'changed':_0x2c2b9b[_0x341971(0x225)],'unchanged':_0x9ddfe9[_0x341971(0x225)],'toDelete':_0x37565d['length']},'activations':{'create':_0x32edfe[_0x341971(0x225)],'update':_0x5c495a[_0x341971(0x225)],'delete':_0x5df955[_0x341971(0x225)]},'folders':_0x474d4a['length']},'hasChanges':_0xe69717||_0x127b48||_0x290353||_0x1cc738};}export async function buildPushExecutionContext(_0x53c3c0,_0x55f9e5,_0x55f692,_0x5662de,_0x2c73f2,_0x279724){const _0x3af9b6=a101_0x9e7797,_0x1333d0=extractRootFolderId(_0x55f692),{pathToId:_0x5eec86,idToPath:_0x22bfcd}=buildFolderMaps(_0x2c73f2),_0x440274=buildSegmentNameToIdMap(_0x5662de),_0x41e8b0=new Map(),{batchAsync:_0x5a5371}=await import(_0x3af9b6(0x23b)),[_0x2cf723,_0x5d46fb]=await Promise[_0x3af9b6(0x285)]([_0x53c3c0[_0x3af9b6(0x273)]['buildUserMaps'](),_0x53c3c0[_0x3af9b6(0x2c8)][_0x3af9b6(0x234)](),((async()=>{!_0x279724&&_0x5662de['length']>0x0&&await _0x5a5371(_0x5662de,async _0x4b8ddc=>{const _0x25e799=a101_0x3b5e,_0x197769=await _0x53c3c0[_0x25e799(0x209)][_0x25e799(0x263)](_0x55f9e5,_0x4b8ddc['id']);_0x41e8b0[_0x25e799(0x20f)](_0x4b8ddc['id'],_0x197769);});})())]),{emailToId:_0x1924a3,idToEmail:_0x43e5bc}=_0x2cf723,_0x518f07=buildConnectionMaps(_0x5d46fb);return{'rootFolderId':_0x1333d0,'folderPathToId':_0x5eec86,'folderIdToPath':_0x22bfcd,'segmentNameToId':_0x440274,'activationsBySegmentId':_0x41e8b0,'emailToIdMap':_0x1924a3,'idToEmailMap':_0x43e5bc,'connectionNameToIdMap':_0x518f07['nameToId'],'connectionIdToNameMap':_0x518f07[_0x3af9b6(0x262)],'connectionNameToTypeMap':_0x518f07['nameToType']};}export function createPushYamlContextForBundle(_0x6ae831,_0x33cc01,_0x20c4fa,_0x3e70ee,_0x46c120,_0x3f78fd,_0x1e58fc,_0x37f01c){const {existingLocalSegmentNames:_0x1d8c4d,localExpandedRuleToNames:_0x1ee81f}=_0x3e70ee,_0x4dde65=new Set(),_0x2e56af=new Map(),_0x25a59e=new Map(),_0x787f55=new Map(),_0x1027f5=createJumpTargetCache(),_0x2f135c=new Map(),_0x27727a=new Map(),_0x408754=new Set();let _0x322d19;const _0x1c3eb3=_0x1c6949=>{const _0x201a43={'resolveSegment':async _0x5024a6=>{const _0x11e1b2=a101_0x3b5e,_0x4ccd43=_0x787f55['get'](_0x5024a6);if(_0x4ccd43!==undefined)return{'name':_0x4ccd43,'isJourneyLocal':!![]};try{let _0x225615=_0x20c4fa[_0x11e1b2(0x251)](_0x1d5729=>_0x1d5729['id']===_0x5024a6);!_0x225615&&(_0x225615=await _0x6ae831[_0x11e1b2(0x209)]['getSegment'](_0x33cc01,_0x5024a6));const _0xaaea34=generateJourneyLocalName(_0x225615[_0x11e1b2(0x21c)]),_0x3ddd9c=_0x225615[_0x11e1b2(0x2a3)]===SEGMENT_KIND_JOURNEY&&_0xaaea34!==undefined;let _0x12ed48=_0x225615[_0x11e1b2(0x21c)],_0x319dba;if(_0x3ddd9c&&_0x225615[_0x11e1b2(0x204)]){const _0x373d1d=apiRuleToYaml(_0x225615[_0x11e1b2(0x204)]);_0x27727a['set'](_0x5024a6,_0x373d1d);const _0x46fb47=async _0x5a87e8=>{const _0x13deab=_0x11e1b2,_0x1dad4e=collectSegmentRefsFromRule(_0x5a87e8);for(const _0xd7c3a0 of _0x1dad4e){if(!_0x27727a[_0x13deab(0x211)](_0xd7c3a0))try{const _0x52c681=await _0x6ae831['segment'][_0x13deab(0x298)](_0x33cc01,_0xd7c3a0);if(_0x52c681?.[_0x13deab(0x204)]){const _0x120140=apiRuleToYaml(_0x52c681[_0x13deab(0x204)]);_0x27727a[_0x13deab(0x20f)](_0xd7c3a0,_0x120140),await _0x46fb47(_0x120140);}}catch{}}};await _0x46fb47(_0x373d1d);const _0x5edb6f=serializeExpandedRule(_0x373d1d,_0x27727a),_0xadfc0d=_0x1ee81f[_0x11e1b2(0x1f3)](_0x5edb6f);if(_0xadfc0d&&_0xadfc0d[_0x11e1b2(0x225)]>0x0){const _0x5243b8=_0x2e56af[_0x11e1b2(0x1f3)](_0x5edb6f)||0x0,_0x1b6474=_0xadfc0d[_0x5243b8]||_0xadfc0d[_0xadfc0d[_0x11e1b2(0x225)]-0x1];_0x2e56af[_0x11e1b2(0x20f)](_0x5edb6f,_0x5243b8+0x1),_0x12ed48=_0x1b6474,_0x4dde65[_0x11e1b2(0x281)](_0x12ed48),_0x787f55[_0x11e1b2(0x20f)](_0x5024a6,_0x12ed48);const _0x38209f=await resolveRuleSegmentRefs(_0x373d1d,async _0x38e576=>{const _0x5935ff=_0x11e1b2,_0x2089ec=_0x787f55[_0x5935ff(0x1f3)](_0x38e576);if(_0x2089ec)return _0x2089ec;const _0x9072e8=await _0x322d19[_0x5935ff(0x1ea)](_0x38e576);return _0x9072e8[_0x5935ff(0x21c)];});_0x319dba={'description':_0x225615['description'],'rule':_0x38209f};}else{const _0xd0142b=_0x2f135c['get'](_0x5edb6f);if(_0xd0142b)_0x12ed48=_0xd0142b,_0x787f55[_0x11e1b2(0x20f)](_0x5024a6,_0x12ed48);else{if(_0xaaea34){let _0x2ecb1a=_0xaaea34,_0x361081=0x2;while(_0x4dde65['has'](_0x2ecb1a)||_0x1d8c4d['has'](_0x2ecb1a)){_0x2ecb1a=_0xaaea34+'_'+_0x361081,_0x361081++;}_0x4dde65[_0x11e1b2(0x281)](_0x2ecb1a),_0x12ed48=_0x2ecb1a;}_0x787f55['set'](_0x5024a6,_0x12ed48),_0x2f135c['set'](_0x5edb6f,_0x12ed48);const _0x3d72dd=await resolveRuleSegmentRefs(_0x373d1d,async _0x7181bb=>{const _0xe1c60c=_0x11e1b2,_0x5d3aae=_0x787f55[_0xe1c60c(0x1f3)](_0x7181bb);if(_0x5d3aae)return _0x5d3aae;const _0x4aa469=await _0x322d19['resolveSegment'](_0x7181bb);return _0x4aa469[_0xe1c60c(0x21c)];});_0x319dba={'description':_0x225615[_0x11e1b2(0x2a5)],'rule':_0x3d72dd};}}}return{'name':_0x12ed48,'isJourneyLocal':_0x3ddd9c,'definition':_0x319dba};}catch{return{'name':_0x5024a6,'isJourneyLocal':![]};}},'resolveActivation':async _0x8cbb34=>{const _0x4894f2=a101_0x3b5e,_0x2d3776=_0x25a59e[_0x4894f2(0x1f3)](_0x8cbb34);if(_0x2d3776!==undefined)return{'name':_0x2d3776,'isJourneyLocal':!![]};try{let _0x46604e=_0x1e58fc?.[_0x4894f2(0x1f3)](_0x8cbb34);!_0x46604e&&(_0x46604e=await _0x6ae831['journey'][_0x4894f2(0x1ed)](_0x1c6949,_0x8cbb34));const _0x586678=_0x46604e[_0x4894f2(0x256)][_0x4894f2(0x236)]['name']||_0x8cbb34,_0x51f1dd=sanitizeYamlKey(_0x586678)||_0x4894f2(0x2b9)+_0x8cbb34,_0x410b50=_0x51f1dd;_0x25a59e[_0x4894f2(0x20f)](_0x8cbb34,_0x410b50);const _0x3364e9=journeyActivationStepToYaml(_0x46604e,_0x46c120,_0x3f78fd);return{'name':_0x410b50,'isJourneyLocal':!![],'definition':_0x3364e9};}catch{return{'name':_0x8cbb34,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x581995,_0x478c56)=>resolveJumpTarget(_0x581995,_0x478c56,_0x1027f5,async _0x2047f2=>{const _0x4b36d4=a101_0x3b5e,_0x2b5878=_0x37f01c?.[_0x4b36d4(0x1f3)](_0x2047f2);if(_0x2b5878)return _0x2b5878;return _0x6ae831[_0x4b36d4(0x248)]['getJourney'](_0x2047f2);})};return _0x322d19=_0x201a43,_0x201a43;},_0x39f21d=async _0x21e5a4=>{const _0x4ffe77=a101_0x3b5e,{collectSegmentIdsFromJourneyApi:_0x350039}=await import(_0x4ffe77(0x240)),{batchAsync:_0x6b90dc}=await import(_0x4ffe77(0x23b)),_0x105be6=new Set();for(const _0x1713f1 of _0x21e5a4){let _0x26ee4d=_0x37f01c?.[_0x4ffe77(0x1f3)](_0x1713f1);!_0x26ee4d&&(_0x26ee4d=await _0x6ae831['journey'][_0x4ffe77(0x29a)](_0x1713f1));const _0x22b7cc=_0x350039(_0x26ee4d);for(const _0x181193 of _0x22b7cc){_0x105be6[_0x4ffe77(0x281)](_0x181193);}}let _0x21e871=Array[_0x4ffe77(0x27a)](_0x105be6);while(_0x21e871[_0x4ffe77(0x225)]>0x0){const _0x7e1542=_0x21e871[_0x4ffe77(0x1f9)](_0x16f4e5=>!_0x408754['has'](_0x16f4e5));if(_0x7e1542[_0x4ffe77(0x225)]===0x0)break;const _0x1f4224=await _0x6b90dc(_0x7e1542,async _0x18aad3=>{const _0x16c5fa=_0x4ffe77;_0x408754[_0x16c5fa(0x281)](_0x18aad3);let _0xe11a43=_0x20c4fa[_0x16c5fa(0x251)](_0x3e7264=>_0x3e7264['id']===_0x18aad3);if(!_0xe11a43)try{_0xe11a43=await _0x6ae831['segment'][_0x16c5fa(0x298)](_0x33cc01,_0x18aad3);}catch{return null;}return{'segmentId':_0x18aad3,'segment':_0xe11a43};},0xa),_0x171883=new Set();for(const _0x556944 of _0x1f4224){if(!_0x556944?.[_0x4ffe77(0x209)]?.[_0x4ffe77(0x204)])continue;const _0x1f2708=apiRuleToYaml(_0x556944[_0x4ffe77(0x209)]['rule']);_0x27727a['set'](_0x556944[_0x4ffe77(0x203)],_0x1f2708);const _0x420720=collectSegmentRefsFromRule(_0x1f2708);for(const _0x54f0b8 of _0x420720){!_0x408754[_0x4ffe77(0x211)](_0x54f0b8)&&_0x171883['add'](_0x54f0b8);}}_0x21e871=Array[_0x4ffe77(0x27a)](_0x171883);}};return{'createYamlContext':_0x1c3eb3,'prefetchJourneySegments':_0x39f21d};}export async function executePushSegments(_0x5d31ca,_0x3025fd,_0x29f333,_0x395e28,_0x41235b){const _0xbb32b7=a101_0x9e7797,{segmentDefToCreateRequest:_0x49dbff,segmentDefToUpdateRequest:_0x382bbd}=await import(_0xbb32b7(0x249)),_0xd80967=_0x29f333[_0xbb32b7(0x29c)],_0x2348be=0x5,_0x5e59f8=async _0x2b3653=>{const _0x1afa35=_0xbb32b7,_0x3cabee=_0x2b3653[_0x1afa35(0x276)]?_0xd80967['get'](_0x2b3653[_0x1afa35(0x276)]):undefined;let _0x475ecf;const _0x575d4b={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x2b3653[_0x1afa35(0x220)]){_0x41235b[_0x1afa35(0x278)]?.({'type':_0x1afa35(0x2bc),'name':_0x2b3653[_0x1afa35(0x266)][_0x1afa35(0x21c)]});const _0xba68cf=_0x49dbff(_0x2b3653[_0x1afa35(0x266)],_0x3cabee),_0x28766e=await _0x41235b[_0x1afa35(0x1f2)](_0x1afa35(0x2b3)+_0x2b3653[_0x1afa35(0x266)][_0x1afa35(0x21c)]+_0x1afa35(0x21a),()=>_0x5d31ca[_0x1afa35(0x209)][_0x1afa35(0x1fb)](_0x395e28['parentId'],_0xba68cf));_0x475ecf=_0x28766e[_0x1afa35(0x250)]['id'],_0x575d4b[_0x1afa35(0x2be)]={'name':_0x2b3653[_0x1afa35(0x266)][_0x1afa35(0x21c)],'id':_0x475ecf},_0x41235b['onProgress']?.({'type':_0x1afa35(0x28f),'name':_0x2b3653[_0x1afa35(0x266)][_0x1afa35(0x21c)],'segmentId':_0x475ecf}),_0x41235b[_0x1afa35(0x294)]?.(_0x1afa35(0x2a4)+_0x2b3653[_0x1afa35(0x266)][_0x1afa35(0x21c)]+'\x27'),_0x575d4b[_0x1afa35(0x1f7)]=0x1;}else{if(_0x2b3653[_0x1afa35(0x260)]){_0x41235b[_0x1afa35(0x278)]?.({'type':'segment_updating','name':_0x2b3653[_0x1afa35(0x266)][_0x1afa35(0x21c)]});const _0x118370=_0x382bbd(_0x2b3653['yamlConfig']);_0x3cabee!==_0x2b3653[_0x1afa35(0x219)]?.['segmentFolderId']&&(_0x118370[_0x1afa35(0x210)]=_0x3cabee?parseInt(_0x3cabee,0xa):undefined),await _0x41235b['withProgress']('Updating\x20segment\x20\x27'+_0x2b3653[_0x1afa35(0x266)][_0x1afa35(0x21c)]+'\x27...',()=>_0x5d31ca[_0x1afa35(0x209)]['updateSegmentById'](_0x395e28[_0x1afa35(0x27d)],_0x2b3653[_0x1afa35(0x219)]['id'],_0x118370)),_0x475ecf=_0x2b3653[_0x1afa35(0x219)]['id'],_0x41235b[_0x1afa35(0x278)]?.({'type':_0x1afa35(0x207),'name':_0x2b3653[_0x1afa35(0x266)][_0x1afa35(0x21c)]}),_0x41235b[_0x1afa35(0x294)]?.('Updated\x20segment\x20\x27'+_0x2b3653[_0x1afa35(0x266)][_0x1afa35(0x21c)]+'\x27'),_0x575d4b[_0x1afa35(0x24f)]=0x1;}else _0x475ecf=_0x2b3653['existingSegment']['id'];}}catch(_0x1b420c){const _0x22475e=isHttp400Error(_0x1b420c),_0x2edd23=_0x22475e?ErrorCode[_0x1afa35(0x243)]:ErrorCode[_0x1afa35(0x1ee)],_0x25ffe7=getErrorMessage(_0x1b420c);throw new SDKError(_0x2edd23,'Failed\x20to\x20'+(_0x2b3653[_0x1afa35(0x220)]?_0x1afa35(0x2bd):_0x1afa35(0x245))+_0x1afa35(0x232)+_0x2b3653[_0x1afa35(0x1eb)]+_0x1afa35(0x1fa)+_0x25ffe7,_0x1b420c);}try{const _0x2dcaae=await syncActivationsForSegment(_0x5d31ca,_0x395e28[_0x1afa35(0x27d)],_0x475ecf,_0x2b3653[_0x1afa35(0x266)][_0x1afa35(0x21c)],_0x2b3653[_0x1afa35(0x21b)],_0x41235b,_0x2b3653[_0x1afa35(0x1eb)]);_0x575d4b[_0x1afa35(0x2c5)]=_0x2dcaae;}catch(_0x52f61e){if(_0x52f61e instanceof SDKError)throw _0x52f61e;throw new SDKError(ErrorCode[_0x1afa35(0x25a)],_0x1afa35(0x1f0)+_0x2b3653['yamlConfig'][_0x1afa35(0x21c)]+_0x1afa35(0x2a1)+_0x2b3653[_0x1afa35(0x1eb)]+_0x1afa35(0x1fa)+getErrorMessage(_0x52f61e),_0x52f61e);}return _0x575d4b;},_0xebcecb=await batchAsync(_0x3025fd,_0x5e59f8,_0x2348be),_0x388af6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1fda0e of _0xebcecb){_0x388af6['created']+=_0x1fda0e[_0xbb32b7(0x1f7)],_0x388af6['updated']+=_0x1fda0e['updated'],_0x1fda0e[_0xbb32b7(0x2be)]&&_0x388af6[_0xbb32b7(0x272)]['set'](_0x1fda0e[_0xbb32b7(0x2be)]['name'],_0x1fda0e[_0xbb32b7(0x2be)]['id']),_0x388af6[_0xbb32b7(0x2c5)][_0xbb32b7(0x1f7)]+=_0x1fda0e[_0xbb32b7(0x2c5)][_0xbb32b7(0x1f7)],_0x388af6['activations'][_0xbb32b7(0x24f)]+=_0x1fda0e[_0xbb32b7(0x2c5)]['updated'],_0x388af6[_0xbb32b7(0x2c5)][_0xbb32b7(0x26b)]+=_0x1fda0e[_0xbb32b7(0x2c5)][_0xbb32b7(0x26b)];}return _0x388af6;}async function syncActivationsForSegment(_0x3e8d30,_0x42138d,_0x3dc6e0,_0x3bf4c0,_0x42dcc7,_0x2f703f,_0x249c33){const _0x29671b=a101_0x9e7797,_0x4d94cc={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2d1dc0 of _0x42dcc7){try{if(_0x2d1dc0[_0x29671b(0x270)]===_0x29671b(0x2bd)&&_0x2d1dc0[_0x29671b(0x2c9)])_0x2f703f['onProgress']?.({'type':_0x29671b(0x25c),'segmentName':_0x3bf4c0,'activationName':_0x2d1dc0[_0x29671b(0x21c)]}),await _0x2f703f[_0x29671b(0x1f2)]('Creating\x20activation\x20\x27'+_0x2d1dc0[_0x29671b(0x21c)]+_0x29671b(0x21a),()=>_0x3e8d30[_0x29671b(0x209)][_0x29671b(0x1e1)](_0x42138d,_0x3dc6e0,_0x2d1dc0[_0x29671b(0x2c9)])),_0x2f703f[_0x29671b(0x278)]?.({'type':_0x29671b(0x280),'segmentName':_0x3bf4c0,'activationName':_0x2d1dc0[_0x29671b(0x21c)]}),_0x2f703f[_0x29671b(0x294)]?.(_0x29671b(0x23c)+_0x2d1dc0[_0x29671b(0x21c)]+'\x27'),_0x4d94cc[_0x29671b(0x1f7)]++;else{if(_0x2d1dc0[_0x29671b(0x270)]===_0x29671b(0x245)&&_0x2d1dc0[_0x29671b(0x2c9)]&&_0x2d1dc0[_0x29671b(0x299)])_0x2f703f[_0x29671b(0x278)]?.({'type':_0x29671b(0x227),'segmentName':_0x3bf4c0,'activationName':_0x2d1dc0[_0x29671b(0x21c)]}),await _0x2f703f[_0x29671b(0x1f2)]('Updating\x20activation\x20\x27'+_0x2d1dc0[_0x29671b(0x21c)]+_0x29671b(0x21a),()=>_0x3e8d30[_0x29671b(0x209)]['updateActivation'](_0x42138d,_0x3dc6e0,_0x2d1dc0[_0x29671b(0x299)]['id'],_0x2d1dc0[_0x29671b(0x2c9)])),_0x2f703f['onProgress']?.({'type':_0x29671b(0x200),'segmentName':_0x3bf4c0,'activationName':_0x2d1dc0[_0x29671b(0x21c)]}),_0x2f703f[_0x29671b(0x294)]?.('Updated\x20activation\x20\x27'+_0x2d1dc0[_0x29671b(0x21c)]+'\x27'),_0x4d94cc[_0x29671b(0x24f)]++;else _0x2d1dc0[_0x29671b(0x270)]==='delete'&&_0x2d1dc0[_0x29671b(0x299)]&&(_0x2f703f[_0x29671b(0x278)]?.({'type':_0x29671b(0x29b),'segmentName':_0x3bf4c0,'activationName':_0x2d1dc0[_0x29671b(0x21c)]}),await _0x2f703f[_0x29671b(0x1f2)](_0x29671b(0x22e)+_0x2d1dc0[_0x29671b(0x21c)]+_0x29671b(0x21a),()=>_0x3e8d30[_0x29671b(0x209)][_0x29671b(0x2c7)](_0x42138d,_0x3dc6e0,_0x2d1dc0[_0x29671b(0x299)]['id'])),_0x2f703f[_0x29671b(0x278)]?.({'type':_0x29671b(0x291),'segmentName':_0x3bf4c0,'activationName':_0x2d1dc0[_0x29671b(0x21c)]}),_0x2f703f[_0x29671b(0x21f)]?.(_0x29671b(0x2b1)+_0x2d1dc0[_0x29671b(0x21c)]+'\x27'),_0x4d94cc['deleted']++);}}catch(_0x30bb97){const _0x505589=isHttp400Error(_0x30bb97),_0x21f46e=_0x505589?ErrorCode[_0x29671b(0x1f1)]:ErrorCode[_0x29671b(0x25a)],_0x3de55c=getErrorMessage(_0x30bb97);throw new SDKError(_0x21f46e,_0x29671b(0x213)+_0x2d1dc0['type']+_0x29671b(0x275)+_0x2d1dc0[_0x29671b(0x21c)]+'\x27\x20from\x20file:\x20'+_0x249c33+_0x29671b(0x1fa)+_0x3de55c,_0x30bb97);}}return _0x4d94cc;}export async function executePushFolders(_0x4cf5f7,_0x1d10ff,_0x505713,_0x1c7e41,_0x1faaef){const _0x477a4b=a101_0x9e7797,_0x174a95=new Map(_0x505713);for(const _0xde872 of _0x1d10ff){const _0x3b969=_0xde872['split']('/'),_0x51106f=_0x3b969[_0x3b969['length']-0x1],_0x4e9820=_0x3b969[_0x477a4b(0x20b)](0x0,-0x1)['join']('/'),_0x3882e5=_0x174a95['get'](_0x4e9820);_0x1faaef[_0x477a4b(0x278)]?.({'type':_0x477a4b(0x2b7),'folder':_0xde872});const _0xc73931={'name':_0x51106f,'parentFolderId':_0x3882e5},_0x2c0028=await _0x1faaef[_0x477a4b(0x1f2)](_0x477a4b(0x1fc)+_0xde872+_0x477a4b(0x21a),()=>_0x4cf5f7[_0x477a4b(0x209)][_0x477a4b(0x23f)](_0x1c7e41[_0x477a4b(0x27d)],_0xc73931));_0x174a95[_0x477a4b(0x20f)](_0xde872,_0x2c0028[_0x477a4b(0x250)]['id']),_0x1faaef['onProgress']?.({'type':_0x477a4b(0x27c),'folder':_0xde872,'folderId':_0x2c0028[_0x477a4b(0x250)]['id']}),_0x1faaef['logInfo']?.(_0x477a4b(0x239)+_0xde872+'\x27');}return _0x174a95;}export async function executePushSegmentDeletions(_0x362117,_0x459cf8,_0x5dbf28){const _0x33faae=a101_0x9e7797;if(_0x459cf8[_0x33faae(0x225)]===0x0)return 0x0;const {batchAsync:_0x51f4c3}=await import(_0x33faae(0x23b)),_0x59f6a6=0x5,_0x5677b1=await _0x51f4c3(_0x459cf8,async _0x37a1fe=>{const _0xa774f8=_0x33faae;return _0x5dbf28['onProgress']?.({'type':_0xa774f8(0x28e),'name':_0x37a1fe[_0xa774f8(0x21c)]}),await _0x362117[_0xa774f8(0x209)][_0xa774f8(0x20a)](_0x37a1fe['id']),_0x5dbf28['onProgress']?.({'type':_0xa774f8(0x2a6),'name':_0x37a1fe['name']}),_0x5dbf28[_0xa774f8(0x21f)]?.(_0xa774f8(0x1fd)+_0x37a1fe['name']+'\x27'),0x1;},_0x59f6a6);return _0x5677b1[_0x33faae(0x1e8)]((_0x325a3b,_0x690328)=>_0x325a3b+_0x690328,0x0);}export async function executePushJourneys(_0x38f378,_0x5b0d48,_0x4f0291,_0x2a40da,_0x4b26b8){const _0x5af15e=a101_0x9e7797,{journeyDefToRequest:_0x312271}=await import(_0x5af15e(0x240)),{activationDefToCreateRequest:_0x608665,yamlRuleToApi:_0x32f114,validateSegmentRule:_0x266f9f}=await import(_0x5af15e(0x249)),_0x10a53e={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4aebd3=new Map(_0x4f0291[_0x5af15e(0x206)]),_0x540046=0x5;for(let _0x3e740f=0x0;_0x3e740f<_0x5b0d48[_0x5af15e(0x225)];_0x3e740f+=_0x540046){const _0x204541=_0x5b0d48[_0x5af15e(0x20b)](_0x3e740f,_0x3e740f+_0x540046),_0x250fdf=await Promise['all'](_0x204541['map'](async _0x4e6429=>{const _0x13c5b4=_0x5af15e;if(!_0x4e6429[_0x13c5b4(0x220)]&&!_0x4e6429[_0x13c5b4(0x260)])return{'action':_0x13c5b4(0x1ff),'name':_0x4e6429[_0x13c5b4(0x266)][_0x13c5b4(0x21c)],'journeyId':_0x4e6429[_0x13c5b4(0x246)]?.['id']};const _0x246074=_0x4e6429[_0x13c5b4(0x276)]?_0x4f0291[_0x13c5b4(0x29c)]['get'](_0x4e6429['folderPath']):undefined;_0x4b26b8[_0x13c5b4(0x278)]?.({'type':_0x4e6429[_0x13c5b4(0x220)]?'journey_creating':'journey_updating','name':_0x4e6429[_0x13c5b4(0x266)][_0x13c5b4(0x21c)]});try{const _0x5d7846=await executeSingleJourneyPush(_0x38f378,_0x4e6429,{..._0x4f0291,'segmentNameToId':_0x4aebd3},{'parentId':_0x2a40da['parentId'],'rootFolderId':_0x2a40da[_0x13c5b4(0x259)],'folderId':_0x246074,'verbose':_0x2a40da[_0x13c5b4(0x22d)]},_0x4b26b8,{'journeyDefToRequest':_0x312271,'activationDefToCreateRequest':_0x608665,'yamlRuleToApi':_0x32f114,'validateSegmentRule':_0x266f9f});for(const [_0x2bd1f7,_0x21d170]of _0x5d7846[_0x13c5b4(0x297)]){_0x4aebd3['set'](_0x2bd1f7,_0x21d170),_0x10a53e[_0x13c5b4(0x297)][_0x13c5b4(0x20f)](_0x2bd1f7,_0x21d170);}if(_0x5d7846[_0x13c5b4(0x283)]===_0x13c5b4(0x1f7))_0x4b26b8[_0x13c5b4(0x278)]?.({'type':_0x13c5b4(0x1f8),'name':_0x4e6429[_0x13c5b4(0x266)]['name'],'journeyId':_0x5d7846['journeyId']}),_0x4b26b8[_0x13c5b4(0x294)]?.(_0x13c5b4(0x2b8)+_0x4e6429[_0x13c5b4(0x266)][_0x13c5b4(0x21c)]+'\x27'),_0x10a53e[_0x13c5b4(0x1f7)]++;else _0x5d7846['action']===_0x13c5b4(0x24f)&&(_0x4b26b8[_0x13c5b4(0x278)]?.({'type':_0x13c5b4(0x201),'name':_0x4e6429['yamlConfig'][_0x13c5b4(0x21c)]}),_0x4b26b8[_0x13c5b4(0x294)]?.(_0x13c5b4(0x26d)+_0x4e6429[_0x13c5b4(0x266)][_0x13c5b4(0x21c)]+'\x27'),_0x10a53e[_0x13c5b4(0x24f)]++);return{'action':_0x5d7846[_0x13c5b4(0x283)],'name':_0x4e6429[_0x13c5b4(0x266)][_0x13c5b4(0x21c)],'journeyId':_0x5d7846['journeyId']};}catch(_0x6ec6c1){const _0x283ba8=isHttp400Error(_0x6ec6c1),_0x556888=_0x283ba8?ErrorCode[_0x13c5b4(0x2bf)]:ErrorCode[_0x13c5b4(0x20e)],_0x3c34bc=getErrorMessage(_0x6ec6c1);throw new SDKError(_0x556888,_0x13c5b4(0x213)+(_0x4e6429[_0x13c5b4(0x220)]?_0x13c5b4(0x2bd):_0x13c5b4(0x245))+_0x13c5b4(0x1f5)+_0x4e6429['absolutePath']+_0x13c5b4(0x1fa)+_0x3c34bc,_0x6ec6c1);}}));_0x10a53e[_0x5af15e(0x284)][_0x5af15e(0x274)](..._0x250fdf);}return _0x10a53e;}async function executeSingleJourneyPush(_0x450e56,_0x132bae,_0x5ca66e,_0x7a05dc,_0x35b2e8,_0x3176d5){const _0x18f879=a101_0x9e7797,{journeyDefToRequest:_0x406623,activationDefToCreateRequest:_0x2a1dc9,yamlRuleToApi:_0xc56868,validateSegmentRule:_0x53ed9e}=_0x3176d5,_0x56fc5e=new Map(),_0x3295b4=new Map(),_0x5e7003=new Map(),_0x54475c=new Map(),_0x7213bd=new Map();let _0x6487df;const _0x2a619f=async()=>{const _0x592a6c=a101_0x3b5e;if(_0x6487df)return;_0x6487df=new Map();if(!_0x132bae[_0x592a6c(0x246)])return;const _0x366d2d=await _0x450e56[_0x592a6c(0x248)]['listActivations'](_0x132bae[_0x592a6c(0x246)]['id']);for(const _0x49a639 of _0x366d2d){const _0x23dc63=journeyActivationStepToYaml(_0x49a639,_0x5ca66e[_0x592a6c(0x230)],_0x5ca66e['connectionIdToNameMap']),_0x275f98=activationSignature(_0x23dc63);!_0x6487df[_0x592a6c(0x211)](_0x275f98)&&_0x6487df[_0x592a6c(0x20f)](_0x275f98,_0x49a639['id']),_0x23dc63[_0x592a6c(0x21c)]&&_0x3295b4[_0x592a6c(0x20f)](_0x23dc63[_0x592a6c(0x21c)],_0x49a639['id']);}};if(_0x132bae[_0x18f879(0x246)]&&_0x132bae[_0x18f879(0x266)][_0x18f879(0x2b5)]){const _0x525825=buildLocalExpandedRuleMappings(_0x132bae['yamlConfig']),_0x3e29e8=_0x525825[_0x18f879(0x20d)];if(_0x3e29e8['size']>0x0){const _0x137187=new Map();for(const [_0x2808e8,_0xe37ab7]of _0x3e29e8){const _0x3c0491=serializeExpandedRule(_0xe37ab7,_0x3e29e8);_0x137187[_0x18f879(0x20f)](_0x2808e8,_0x3c0491);}const _0x3952a3=collectSegmentIdsFromJourneyApi(_0x132bae[_0x18f879(0x246)]);if(_0x3952a3[_0x18f879(0x2a8)]>0x0){const _0x130964=await buildServerSegmentRuleMap(_0x450e56,_0x7a05dc[_0x18f879(0x27d)],_0x5ca66e[_0x18f879(0x1e9)],_0x3952a3);if(_0x130964[_0x18f879(0x2a8)]>0x0){const _0xba0843=new Map();for(const [_0x1de174,_0x2daa09]of _0x130964){const _0x5d5c23=serializeExpandedRule(_0x2daa09,_0x130964);!_0xba0843['has'](_0x5d5c23)&&_0xba0843['set'](_0x5d5c23,_0x1de174);}for(const [_0x36378f,_0x126fa5]of _0x137187){const _0x4f7beb=_0xba0843[_0x18f879(0x1f3)](_0x126fa5);_0x4f7beb&&(_0x7213bd[_0x18f879(0x20f)](_0x36378f,_0x4f7beb),_0x5ca66e[_0x18f879(0x206)][_0x18f879(0x20f)](_0x36378f,_0x4f7beb));}}}}}const _0x299ca1={'resolveSegmentId':async _0x4f6137=>{const _0xc3ab33=_0x18f879,_0x1f1d1b=_0x5ca66e['segmentNameToId'][_0xc3ab33(0x1f3)](_0x4f6137);if(!_0x1f1d1b)throw new SDKError(ErrorCode[_0xc3ab33(0x21d)],'Segment\x20not\x20found:\x20'+_0x4f6137+_0xc3ab33(0x288)+_0x132bae['yamlConfig'][_0xc3ab33(0x21c)]+')');return _0x1f1d1b;},'resolveEmbeddedSegmentId':async(_0x1d749a,_0x324801)=>{const _0x1edb7b=_0x18f879,_0x38b828=_0x5ca66e[_0x1edb7b(0x206)][_0x1edb7b(0x1f3)](_0x1d749a);if(_0x38b828)return _0x38b828;const _0x4a5243=_0x7213bd[_0x1edb7b(0x1f3)](_0x1d749a);if(_0x4a5243)return _0x5ca66e['segmentNameToId']['set'](_0x1d749a,_0x4a5243),_0x4a5243;const _0xed71b8=_0x5ca66e[_0x1edb7b(0x1e9)][_0x1edb7b(0x251)](_0x3b6b32=>_0x3b6b32[_0x1edb7b(0x21c)]===_0x1d749a);if(_0xed71b8)return _0x5ca66e[_0x1edb7b(0x206)][_0x1edb7b(0x20f)](_0x1d749a,_0xed71b8['id']),_0xed71b8['id'];if(_0x132bae['isNew']){const {stageName:_0x37310a,criteriaName:_0x581b0}=findSegmentCriteriaLocation(_0x132bae[_0x1edb7b(0x266)],_0x1d749a);return _0x53ed9e(_0x1d749a,_0x324801[_0x1edb7b(0x204)]),_0x5e7003[_0x1edb7b(0x20f)](_0x1d749a,{'definition':_0x324801,'stageName':_0x37310a,'criteriaName':_0x581b0}),createPendingSegmentId(_0x1d749a);}const _0x3e3f73=_0x132bae[_0x1edb7b(0x246)]?.['id'];if(!_0x3e3f73)throw new SDKError(ErrorCode[_0x1edb7b(0x2b4)],_0x1edb7b(0x271));_0x53ed9e(_0x1d749a,_0x324801[_0x1edb7b(0x204)]);const _0x18b8b6=generateDeterministicJourneySegmentName(_0x132bae[_0x1edb7b(0x266)]['name'],_0x1d749a),_0x23eafb=_0x5ca66e[_0x1edb7b(0x1e9)][_0x1edb7b(0x251)](_0x4846b9=>_0x4846b9['name']===_0x18b8b6),_0x1a3e98=createSegmentIdResolver(_0x5ca66e['segmentNameToId'],_0x1d749a),_0x31fd2c=await resolveRuleSegmentIds(_0x324801[_0x1edb7b(0x204)],_0x1a3e98);let _0x54af63;if(_0x23eafb)await _0x450e56[_0x1edb7b(0x209)][_0x1edb7b(0x295)](_0x7a05dc[_0x1edb7b(0x27d)],_0x23eafb['id'],{'description':_0x324801['description']||_0x1edb7b(0x22f)+_0x1d749a,'rule':_0xc56868(_0x31fd2c,!![]),'countPopulation':!![]}),_0x54af63=_0x23eafb['id'];else try{_0x54af63=await _0x450e56[_0x1edb7b(0x209)][_0x1edb7b(0x2b0)]({'name':_0x18b8b6,'description':_0x324801[_0x1edb7b(0x2a5)]||_0x1edb7b(0x22f)+_0x1d749a,'journeyId':_0x3e3f73,'rule':_0xc56868(_0x31fd2c,!![]),'countPopulation':!![],'parentFolderId':_0x7a05dc['rootFolderId']||'','audienceId':_0x7a05dc[_0x1edb7b(0x27d)]});}catch(_0x4bfaf1){const _0x1a7edd=_0x4bfaf1 instanceof Error&&_0x4bfaf1[_0x1edb7b(0x1e6)]['includes'](_0x1edb7b(0x231));if(_0x1a7edd){const _0x5ac6d3=await _0x450e56[_0x1edb7b(0x209)]['listSegments'](_0x7a05dc[_0x1edb7b(0x27d)]),_0x1e400e=_0x5ac6d3['find'](_0x4654ef=>_0x4654ef[_0x1edb7b(0x21c)]===_0x18b8b6);if(_0x1e400e)await _0x450e56['segment'][_0x1edb7b(0x295)](_0x7a05dc[_0x1edb7b(0x27d)],_0x1e400e['id'],{'description':_0x324801[_0x1edb7b(0x2a5)]||_0x1edb7b(0x22f)+_0x1d749a,'rule':_0xc56868(_0x31fd2c,!![]),'countPopulation':!![]}),_0x54af63=_0x1e400e['id'];else throw _0x4bfaf1;}else throw _0x4bfaf1;}return _0x5ca66e['segmentNameToId']['set'](_0x1d749a,_0x54af63),_0x56fc5e[_0x1edb7b(0x20f)](_0x1d749a,_0x54af63),_0x54af63;},'resolveActivationId':async _0x4911f3=>{const _0x547d36=_0x18f879,_0x1458fa=_0x3295b4['get'](_0x4911f3);if(_0x1458fa)return _0x1458fa;if(_0x132bae[_0x547d36(0x246)]){await _0x2a619f();const _0x4224c7=_0x3295b4[_0x547d36(0x1f3)](_0x4911f3);if(_0x4224c7)return _0x4224c7;}throw new SDKError(ErrorCode[_0x547d36(0x22a)],_0x547d36(0x279)+_0x4911f3+'\x20(referenced\x20in\x20journey\x20'+_0x132bae[_0x547d36(0x266)][_0x547d36(0x21c)]+_0x547d36(0x2c6)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x3039ac,_0x4a9792)=>{const _0x465efb=_0x18f879,_0x3c054a=_0x3295b4[_0x465efb(0x1f3)](_0x3039ac);if(_0x3c054a)return _0x3c054a;if(_0x132bae['isNew'])return _0x54475c['set'](_0x3039ac,_0x4a9792),createPendingActivationId(_0x3039ac);if(_0x132bae[_0x465efb(0x246)]){await _0x2a619f();const _0x501919=_0x3295b4[_0x465efb(0x1f3)](_0x4a9792[_0x465efb(0x21c)]);if(_0x501919)return _0x3295b4[_0x465efb(0x20f)](_0x3039ac,_0x501919),_0x501919;const _0x46381a=activationSignature(_0x4a9792),_0x395308=_0x6487df?.[_0x465efb(0x1f3)](_0x46381a);if(_0x395308)return _0x3295b4['set'](_0x3039ac,_0x395308),_0x395308;const _0x15eddb=await _0x2a1dc9(_0x4a9792,_0x5ca66e[_0x465efb(0x237)]),_0x367ddf=await _0x450e56[_0x465efb(0x248)][_0x465efb(0x1e1)](_0x132bae[_0x465efb(0x246)]['id'],_0x15eddb);return _0x3295b4[_0x465efb(0x20f)](_0x3039ac,_0x367ddf['id']),_0x367ddf['id'];}throw new SDKError(ErrorCode[_0x465efb(0x2b4)],_0x465efb(0x24c));},'resolveJourneyId':async _0x2fd1c5=>{const _0xcf3ae4=_0x18f879;try{return await _0x450e56[_0xcf3ae4(0x248)][_0xcf3ae4(0x253)](_0x7a05dc[_0xcf3ae4(0x27d)],_0x2fd1c5);}catch(_0x44eba6){throw new SDKError(ErrorCode[_0xcf3ae4(0x22a)],_0xcf3ae4(0x2c4)+_0x2fd1c5+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x132bae[_0xcf3ae4(0x266)][_0xcf3ae4(0x21c)]+'\x27)',_0x44eba6);}},'resolveStageId':async(_0x26586b,_0x42f940)=>{const _0x27a74d=_0x18f879,_0x2dbbeb=await _0x450e56['journey'][_0x27a74d(0x29a)](_0x26586b),_0x426541=_0x2dbbeb['attributes'][_0x27a74d(0x1e2)][_0x27a74d(0x251)](_0x58780b=>_0x58780b[_0x27a74d(0x21c)][_0x27a74d(0x24b)]()===_0x42f940[_0x27a74d(0x24b)]());if(!_0x426541?.['id'])throw new SDKError(ErrorCode[_0x27a74d(0x22a)],_0x27a74d(0x22c)+_0x42f940+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x2dbbeb[_0x27a74d(0x256)][_0x27a74d(0x247)]||_0x2dbbeb[_0x27a74d(0x256)]['name'])+'\x27');return _0x426541['id'];}},_0x17a2df=await _0x406623(_0x132bae[_0x18f879(0x266)],_0x7a05dc[_0x18f879(0x27d)],_0x299ca1),_0x480e9a=_0x7a05dc[_0x18f879(0x2b2)]||_0x7a05dc[_0x18f879(0x259)];_0x480e9a&&(_0x17a2df[_0x18f879(0x2aa)]={'parentFolder':{'data':{'id':_0x480e9a,'type':'folder'}}});if(_0x132bae[_0x18f879(0x220)]){if(_0x5e7003[_0x18f879(0x2a8)]>0x0||_0x54475c['size']>0x0)return await executeThreeStepJourneyCreate(_0x450e56,_0x132bae,_0x17a2df,{'pendingEmbeddedSegments':_0x5e7003,'pendingEmbeddedActivations':_0x54475c,'embeddedSegmentNameToId':_0x56fc5e,'journeyActivationNameToId':_0x3295b4},{..._0x7a05dc,'effectiveFolderId':_0x480e9a},_0x5ca66e,_0x35b2e8,_0x3176d5);else{ensureJourneyDefaults(_0x17a2df[_0x18f879(0x256)]);const _0x40c0a0=await _0x450e56[_0x18f879(0x248)][_0x18f879(0x2bd)](_0x17a2df);return{'action':_0x18f879(0x1f7),'journeyId':_0x40c0a0['id'],'embeddedSegmentNameToId':_0x56fc5e};}}else{if(_0x132bae[_0x18f879(0x260)]&&_0x132bae[_0x18f879(0x246)])return ensureJourneyDefaults(_0x17a2df[_0x18f879(0x256)]),await _0x450e56[_0x18f879(0x248)]['update'](_0x132bae[_0x18f879(0x246)]['id'],_0x17a2df),{'action':_0x18f879(0x24f),'journeyId':_0x132bae['existingJourney']['id'],'embeddedSegmentNameToId':_0x56fc5e};}return{'action':_0x18f879(0x1ff),'journeyId':_0x132bae['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x56fc5e};}function findSegmentCriteriaLocation(_0x58a19f,_0x5cdce5){const _0x1437be=a101_0x9e7797,_0x553793=_0x58a19f[_0x1437be(0x290)]||_0x58a19f[_0x1437be(0x282)]?.[0x0]?.['stages']||[];let _0x5e78cd=_0x1437be(0x212),_0x1424f2=_0x5cdce5;const _0x3321a5=_0x58a19f[_0x1437be(0x26f)]||_0x58a19f[_0x1437be(0x282)]?.[0x0]?.[_0x1437be(0x26f)];if(_0x3321a5?.['segment']===_0x5cdce5)return{'stageName':_0x1437be(0x26f),'criteriaName':_0x3321a5[_0x1437be(0x21c)]||_0x5cdce5};_0x195b91:for(const _0x433eda of _0x553793){if(_0x433eda[_0x1437be(0x202)]?.[_0x1437be(0x209)]===_0x5cdce5){_0x5e78cd=_0x433eda[_0x1437be(0x21c)],_0x1424f2=_0x433eda[_0x1437be(0x202)][_0x1437be(0x21c)]||_0x5cdce5;break;}if(_0x433eda['steps'])for(const _0xc4575f of _0x433eda[_0x1437be(0x27e)]){if(_0xc4575f[_0x1437be(0x270)]===_0x1437be(0x2c3)&&_0xc4575f[_0x1437be(0x2ac)]?.[_0x1437be(0x2ae)])for(const _0xeada14 of _0xc4575f['with']['branches']){if(_0xeada14[_0x1437be(0x209)]===_0x5cdce5){_0x5e78cd=_0x433eda[_0x1437be(0x21c)],_0x1424f2=_0xeada14[_0x1437be(0x21c)]||_0x5cdce5;break _0x195b91;}}}}return{'stageName':_0x5e78cd,'criteriaName':_0x1424f2};}async function executeThreeStepJourneyCreate(_0x255c14,_0x454b15,_0x319a3a,_0x68c29,_0x6b6dc,_0x2e2d0e,_0x29992d,_0x5d1b0e){const _0x3a9c42=a101_0x9e7797,{activationDefToCreateRequest:_0x1800bc,yamlRuleToApi:_0x351b0a}=_0x5d1b0e,{pendingEmbeddedSegments:_0x5cc584,pendingEmbeddedActivations:_0x13ce0c,embeddedSegmentNameToId:_0x20293d}=_0x68c29,_0x82aaad=JSON[_0x3a9c42(0x25d)](JSON[_0x3a9c42(0x268)](_0x319a3a));ensureJourneyDefaults(_0x82aaad[_0x3a9c42(0x256)]),stripPendingIds(_0x82aaad);const _0x3a6d42=await _0x255c14[_0x3a9c42(0x248)]['create'](_0x82aaad),_0x4752bc=_0x3a6d42['id'],_0x2e04aa=new Map();for(const _0x5bf8f0 of _0x3a6d42[_0x3a9c42(0x256)]['journeyStages']){_0x2e04aa[_0x3a9c42(0x20f)](_0x5bf8f0[_0x3a9c42(0x21c)][_0x3a9c42(0x24b)](),_0x5bf8f0['id']);}for(const [_0x3fc8e8,{definition:_0x512aa1}]of _0x5cc584){const _0x41af3e=generateDeterministicJourneySegmentName(_0x454b15[_0x3a9c42(0x266)]['name'],_0x3fc8e8);_0x29992d['onProgress']?.({'type':_0x3a9c42(0x28a),'journeyName':_0x454b15['yamlConfig'][_0x3a9c42(0x21c)],'segmentName':_0x3fc8e8});const _0x320b1f=createSegmentIdResolver(_0x2e2d0e[_0x3a9c42(0x206)],_0x3fc8e8),_0x642fc2=await resolveRuleSegmentIds(_0x512aa1[_0x3a9c42(0x204)],_0x320b1f),_0x549027=await _0x255c14['segment'][_0x3a9c42(0x2b0)]({'name':_0x41af3e,'description':_0x512aa1[_0x3a9c42(0x2a5)]||_0x3a9c42(0x22f)+_0x3fc8e8,'journeyId':_0x4752bc,'rule':_0x351b0a(_0x642fc2,!![]),'countPopulation':!![],'parentFolderId':_0x6b6dc['effectiveFolderId']||'','audienceId':_0x6b6dc['parentId']});_0x20293d[_0x3a9c42(0x20f)](_0x3fc8e8,_0x549027),_0x2e2d0e[_0x3a9c42(0x206)]['set'](_0x3fc8e8,_0x549027),_0x29992d[_0x3a9c42(0x278)]?.({'type':_0x3a9c42(0x277),'journeyName':_0x454b15[_0x3a9c42(0x266)]['name'],'segmentName':_0x3fc8e8});}const _0x12832b=new Map();for(const [_0x17bb1d,_0xa8f2bd]of _0x13ce0c){_0x29992d['onProgress']?.({'type':_0x3a9c42(0x217),'journeyName':_0x454b15[_0x3a9c42(0x266)][_0x3a9c42(0x21c)],'activationName':_0x17bb1d});const _0x4c8f88=await _0x1800bc(_0xa8f2bd,_0x2e2d0e[_0x3a9c42(0x237)]),_0x2bfe28=await _0x255c14[_0x3a9c42(0x248)][_0x3a9c42(0x1e1)](_0x4752bc,_0x4c8f88);_0x12832b[_0x3a9c42(0x20f)](_0x17bb1d,_0x2bfe28['id']),_0x68c29[_0x3a9c42(0x25f)][_0x3a9c42(0x20f)](_0x17bb1d,_0x2bfe28['id']),_0x29992d[_0x3a9c42(0x278)]?.({'type':_0x3a9c42(0x25e),'journeyName':_0x454b15['yamlConfig'][_0x3a9c42(0x21c)],'activationName':_0x17bb1d});}const _0x36b963=JSON['parse'](JSON['stringify'](_0x319a3a));return _0x36b963['id']=_0x4752bc,ensureJourneyDefaults(_0x36b963[_0x3a9c42(0x256)]),resolvePendingIdsInRequest(_0x36b963,_0x319a3a,_0x2e04aa,_0x20293d,_0x12832b,_0x29992d),await _0x255c14[_0x3a9c42(0x248)][_0x3a9c42(0x245)](_0x4752bc,_0x36b963),{'action':'created','journeyId':_0x4752bc,'embeddedSegmentNameToId':_0x20293d};}function stripPendingIds(_0x55ae99){const _0x3e4a8c=a101_0x9e7797;for(const _0x50ae2d of _0x55ae99['attributes'][_0x3e4a8c(0x1e2)]||[]){_0x50ae2d[_0x3e4a8c(0x224)]?.[_0x3e4a8c(0x203)]&&isPendingSegmentId(_0x50ae2d[_0x3e4a8c(0x224)]['segmentId'])&&delete _0x50ae2d[_0x3e4a8c(0x224)];if(_0x50ae2d['steps'])for(const _0x4b1aef of Object[_0x3e4a8c(0x233)](_0x50ae2d[_0x3e4a8c(0x27e)])){const _0x18e163=_0x50ae2d[_0x3e4a8c(0x27e)][_0x4b1aef];_0x18e163[_0x3e4a8c(0x270)]==='Activation'&&_0x18e163[_0x3e4a8c(0x221)]&&isPendingActivationId(_0x18e163[_0x3e4a8c(0x221)])&&(_0x18e163[_0x3e4a8c(0x221)]='');if(_0x18e163[_0x3e4a8c(0x270)]===_0x3e4a8c(0x1e7)&&_0x18e163[_0x3e4a8c(0x2ae)])for(const _0x197675 of _0x18e163[_0x3e4a8c(0x2ae)]){_0x197675[_0x3e4a8c(0x203)]&&isPendingSegmentId(_0x197675[_0x3e4a8c(0x203)])&&(_0x197675[_0x3e4a8c(0x203)]='');}_0x18e163[_0x3e4a8c(0x270)]==='WaitStep'&&_0x18e163[_0x3e4a8c(0x28c)]?.[_0x3e4a8c(0x203)]&&isPendingSegmentId(_0x18e163['waitCondition'][_0x3e4a8c(0x203)])&&(_0x18e163[_0x3e4a8c(0x28c)][_0x3e4a8c(0x203)]='');}}}function resolvePendingIdsInRequest(_0x33c3d8,_0x4ad598,_0x58bd37,_0x43de58,_0x8a9256,_0x43a71a){const _0x4322fa=a101_0x9e7797,_0x4503c7=(_0x32d23c,_0x4481d8)=>{const _0x7c22db=a101_0x3b5e;if(!isPendingSegmentId(_0x32d23c))return _0x32d23c;const _0x4877f2=extractPendingSegmentName(_0x32d23c),_0x1ea46c=_0x43de58[_0x7c22db(0x1f3)](_0x4877f2);return!_0x1ea46c&&_0x43a71a['logWarning']?.(_0x7c22db(0x28d)+_0x4877f2+_0x7c22db(0x22b)+_0x4481d8),_0x1ea46c;};if(_0x33c3d8[_0x4322fa(0x256)][_0x4322fa(0x26f)]?.[_0x4322fa(0x203)]&&isPendingSegmentId(_0x33c3d8[_0x4322fa(0x256)]['goal'][_0x4322fa(0x203)])){const _0x1bf6e1=_0x4503c7(_0x33c3d8['attributes'][_0x4322fa(0x26f)][_0x4322fa(0x203)],_0x4322fa(0x24e));_0x1bf6e1&&(_0x33c3d8[_0x4322fa(0x256)][_0x4322fa(0x26f)][_0x4322fa(0x203)]=_0x1bf6e1);}for(const _0x18e783 of _0x33c3d8[_0x4322fa(0x256)][_0x4322fa(0x1e2)]||[]){const _0x2d8865=_0x58bd37[_0x4322fa(0x1f3)](_0x18e783[_0x4322fa(0x21c)][_0x4322fa(0x24b)]());_0x2d8865&&(_0x18e783['id']=_0x2d8865);if(_0x18e783[_0x4322fa(0x224)]?.['segmentId']&&isPendingSegmentId(_0x18e783[_0x4322fa(0x224)][_0x4322fa(0x203)])){const _0x36fd7e=_0x4503c7(_0x18e783[_0x4322fa(0x224)][_0x4322fa(0x203)],_0x4322fa(0x293)+_0x18e783['name']+_0x4322fa(0x1f4));_0x36fd7e&&(_0x18e783['entryCriteria']['segmentId']=_0x36fd7e);}if(_0x18e783[_0x4322fa(0x23a)])for(const _0xe6cf90 of _0x18e783[_0x4322fa(0x23a)]){if(_0xe6cf90[_0x4322fa(0x203)]&&isPendingSegmentId(_0xe6cf90[_0x4322fa(0x203)])){const _0x38d936=_0x4503c7(_0xe6cf90['segmentId'],_0x4322fa(0x293)+_0x18e783[_0x4322fa(0x21c)]+_0x4322fa(0x2a2));_0x38d936&&(_0xe6cf90[_0x4322fa(0x203)]=_0x38d936);}}if(_0x18e783['milestone']?.[_0x4322fa(0x203)]&&isPendingSegmentId(_0x18e783[_0x4322fa(0x27f)]['segmentId'])){const _0x4445dd=_0x4503c7(_0x18e783[_0x4322fa(0x27f)][_0x4322fa(0x203)],'stage\x20\x27'+_0x18e783[_0x4322fa(0x21c)]+_0x4322fa(0x2c2));_0x4445dd&&(_0x18e783[_0x4322fa(0x27f)]['segmentId']=_0x4445dd);}if(_0x18e783[_0x4322fa(0x27e)]){const _0x4be760=_0x50eb72=>_0x4ad598[_0x4322fa(0x256)][_0x4322fa(0x1e2)][_0x4322fa(0x251)](_0x2f607b=>_0x2f607b[_0x4322fa(0x21c)]['toLowerCase']()===_0x18e783[_0x4322fa(0x21c)][_0x4322fa(0x24b)]())?.[_0x4322fa(0x27e)]?.[_0x50eb72];for(const _0x179c67 of Object[_0x4322fa(0x233)](_0x18e783[_0x4322fa(0x27e)])){const _0x39a16c=_0x18e783[_0x4322fa(0x27e)][_0x179c67],_0x5d19f9=_0x4be760(_0x179c67);if(_0x39a16c['type']===_0x4322fa(0x223)&&_0x39a16c[_0x4322fa(0x221)]&&(isPendingActivationId(_0x39a16c[_0x4322fa(0x221)])||_0x39a16c[_0x4322fa(0x221)]==='')){if(_0x5d19f9?.['journeyActivationStepId']&&isPendingActivationId(_0x5d19f9[_0x4322fa(0x221)])){const _0x1ca4ba=extractPendingActivationName(_0x5d19f9[_0x4322fa(0x221)]),_0x1bb537=_0x8a9256[_0x4322fa(0x1f3)](_0x1ca4ba);_0x1bb537&&(_0x39a16c['journeyActivationStepId']=_0x1bb537);}}if(_0x39a16c[_0x4322fa(0x270)]===_0x4322fa(0x1e7)&&_0x39a16c['branches']&&_0x5d19f9?.[_0x4322fa(0x2ae)])for(let _0x37c197=0x0;_0x37c197<_0x39a16c[_0x4322fa(0x2ae)][_0x4322fa(0x225)];_0x37c197++){const _0xc6827e=_0x39a16c[_0x4322fa(0x2ae)][_0x37c197],_0x19178c=_0x5d19f9[_0x4322fa(0x2ae)][_0x37c197];if(_0x19178c?.[_0x4322fa(0x203)]&&isPendingSegmentId(_0x19178c[_0x4322fa(0x203)])){const _0x636ca3=_0x4503c7(_0x19178c[_0x4322fa(0x203)],_0x4322fa(0x293)+_0x18e783[_0x4322fa(0x21c)]+_0x4322fa(0x296)+(_0xc6827e[_0x4322fa(0x21c)]||_0x37c197)+'\x27');_0x636ca3&&(_0xc6827e[_0x4322fa(0x203)]=_0x636ca3);}}if(_0x39a16c[_0x4322fa(0x270)]===_0x4322fa(0x28b)&&_0x39a16c[_0x4322fa(0x28c)]?.[_0x4322fa(0x203)]&&_0x5d19f9?.[_0x4322fa(0x28c)]?.[_0x4322fa(0x203)]&&isPendingSegmentId(_0x5d19f9[_0x4322fa(0x28c)][_0x4322fa(0x203)])){const _0xcbd93b=_0x4503c7(_0x5d19f9[_0x4322fa(0x28c)][_0x4322fa(0x203)],_0x4322fa(0x293)+_0x18e783['name']+_0x4322fa(0x226));_0xcbd93b&&(_0x39a16c[_0x4322fa(0x28c)]['segmentId']=_0xcbd93b);}}}}}
|
|
1
|
+
const a101_0x109af2=a101_0x383a;(function(_0x2bfb5e,_0x145085){const _0x302078=a101_0x383a,_0x29f7d5=_0x2bfb5e();while(!![]){try{const _0x1ee9f9=parseInt(_0x302078(0x1bf))/0x1+-parseInt(_0x302078(0x1fd))/0x2+parseInt(_0x302078(0x1e7))/0x3+parseInt(_0x302078(0x1f7))/0x4*(-parseInt(_0x302078(0x199))/0x5)+parseInt(_0x302078(0x182))/0x6*(parseInt(_0x302078(0x20b))/0x7)+-parseInt(_0x302078(0x1d1))/0x8+-parseInt(_0x302078(0x1d3))/0x9*(-parseInt(_0x302078(0x231))/0xa);if(_0x1ee9f9===_0x145085)break;else _0x29f7d5['push'](_0x29f7d5['shift']());}catch(_0x31b599){_0x29f7d5['push'](_0x29f7d5['shift']());}}}(a101_0x41db,0xa1773));import{createHash}from'crypto';function a101_0x383a(_0x335569,_0x10a914){_0x335569=_0x335569-0x178;const _0x41dbbe=a101_0x41db();let _0x383afd=_0x41dbbe[_0x335569];return _0x383afd;}export const PENDING_SEGMENT_PREFIX=a101_0x109af2(0x1dd);export const PENDING_ACTIVATION_PREFIX=a101_0x109af2(0x1d6);export function createPendingSegmentId(_0x1ca4c8){return''+PENDING_SEGMENT_PREFIX+_0x1ca4c8+'__';}export function isPendingSegmentId(_0x4fecc6){const _0x1384fc=a101_0x109af2;return _0x4fecc6[_0x1384fc(0x21d)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x3d8364){const _0x2817bd=a101_0x109af2;return _0x3d8364[_0x2817bd(0x1c0)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x995da2){return''+PENDING_ACTIVATION_PREFIX+_0x995da2+'__';}export function isPendingActivationId(_0x1f2ca3){const _0x2a994d=a101_0x109af2;return _0x1f2ca3[_0x2a994d(0x21d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x565bec){return _0x565bec['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x2c6f2a,_0x189cd8){const _0x27a27c=a101_0x109af2,_0x2b174a=_0x2c6f2a+'::'+(_0x189cd8['trim']()||_0x27a27c(0x22b)),_0x3d150c=createHash(_0x27a27c(0x1cd))['update'](_0x2b174a)[_0x27a27c(0x1ea)](_0x27a27c(0x185))['slice'](0x0,0xc);return _0x27a27c(0x20f)+_0x3d150c;}export function ensureJourneyDefaults(_0x2f87f6){const _0x4cc7f0=a101_0x109af2;!_0x2f87f6[_0x4cc7f0(0x19c)]&&(_0x2f87f6[_0x4cc7f0(0x19c)]=''),!_0x2f87f6[_0x4cc7f0(0x215)]&&(_0x2f87f6[_0x4cc7f0(0x215)]=_0x4cc7f0(0x23a));}export function resolveTDFolderPath(_0x1de752,_0x29ccc2,_0x50fe3c){if(!_0x29ccc2)return _0x1de752;if(_0x1de752===_0x50fe3c||_0x1de752['startsWith'](_0x50fe3c+'/'))return _0x1de752;return _0x1de752?_0x50fe3c+'/'+_0x1de752:_0x50fe3c;}export function addFoldersToCreate(_0x906fcd,_0x4b91cd,_0x1accc0){const _0x47f57f=a101_0x109af2;if(!_0x906fcd)return;if(_0x4b91cd[_0x47f57f(0x21f)](_0x906fcd))return;const _0x4d05a4=_0x906fcd[_0x47f57f(0x240)]('/');let _0x394ca6='';for(const _0x4f21b8 of _0x4d05a4){_0x394ca6=_0x394ca6?_0x394ca6+'/'+_0x4f21b8:_0x4f21b8,!_0x4b91cd['has'](_0x394ca6)&&_0x1accc0[_0x47f57f(0x238)](_0x394ca6);}}import*as a101_0x373ffc from'yaml';import{readFileSync}from'fs';import a101_0x1034f4 from'path';import{isJourneyDef,parseYamlString as a101_0x402c83,toYamlString as a101_0x5ead0b,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(_0x379ea9){const _0x16bf67=a101_0x109af2;if(Array[_0x16bf67(0x1ad)](_0x379ea9))return'['+_0x379ea9[_0x16bf67(0x1ee)](_0x5b118a=>stableStringify(_0x5b118a))[_0x16bf67(0x1fe)](',')+']';if(_0x379ea9&&typeof _0x379ea9===_0x16bf67(0x251)){const _0x5d2f83=_0x379ea9,_0x4826eb=Object['keys'](_0x5d2f83)[_0x16bf67(0x21e)](),_0x1beb04=_0x4826eb[_0x16bf67(0x1ee)](_0xd8abb3=>'\x22'+_0xd8abb3+'\x22:'+stableStringify(_0x5d2f83[_0xd8abb3]));return'{'+_0x1beb04[_0x16bf67(0x1fe)](',')+'}';}const _0x596419=JSON[_0x16bf67(0x226)](_0x379ea9);return _0x596419===undefined?'null':_0x596419;}function activationSignature(_0x31db59){const _0x5c75fe=a101_0x109af2,_0x5e787a={'connection':_0x31db59[_0x5c75fe(0x1bb)],..._0x31db59[_0x5c75fe(0x1c5)]!==undefined&&{'all_columns':_0x31db59[_0x5c75fe(0x1c5)]},..._0x31db59[_0x5c75fe(0x1b7)]!==undefined&&{'columns':_0x31db59[_0x5c75fe(0x1b7)]},..._0x31db59[_0x5c75fe(0x1c9)]!==undefined&&{'behavior':_0x31db59[_0x5c75fe(0x1c9)]},..._0x31db59['schedule']!==undefined&&{'schedule':_0x31db59['schedule']},..._0x31db59['notification']!==undefined&&{'notification':_0x31db59[_0x5c75fe(0x1ed)]},..._0x31db59[_0x5c75fe(0x22d)]!==undefined&&{'connector_config':_0x31db59[_0x5c75fe(0x22d)]},..._0x31db59[_0x5c75fe(0x217)]!==undefined&&{'activation_template_id':_0x31db59[_0x5c75fe(0x217)]}};return stableStringify(_0x5e787a);}export async function prepareSegmentFiles(_0x4ce8b6,_0x4465b7,_0x502c97,_0x991322,_0x4e12ab){const _0x1457d2=a101_0x109af2,{activationDefToCreateRequest:_0x2cd3bb}=await import(_0x1457d2(0x1d5)),_0x5bf307=[],_0x2c39cc=new Set();for(const {yamlConfig:_0x252fe9,folderPath:_0x35a1f9,sourcePath:_0x583cdc}of _0x4ce8b6){const _0x3800f7=resolveTDFolderPath(_0x35a1f9,_0x991322,_0x4e12ab),_0x5bbb90=_0x3800f7+':'+_0x252fe9[_0x1457d2(0x19e)],_0x50b6c2=_0x4465b7[_0x1457d2(0x244)][_0x1457d2(0x1bd)](_0x5bbb90),_0x4dc54f=_0x50b6c2?_0x4465b7['activationsBySegmentId'][_0x1457d2(0x1bd)](_0x50b6c2['id'])||[]:[];addFoldersToCreate(_0x3800f7,_0x4465b7['folderPathToId'],_0x2c39cc);const _0x51f8ca=calculateActivationActions(_0x252fe9[_0x1457d2(0x1ef)]||[],_0x4dc54f,_0x4465b7['idToEmailMap'],_0x4465b7[_0x1457d2(0x24b)]);for(const _0x4cf593 of _0x51f8ca){(_0x4cf593[_0x1457d2(0x1b0)]==='create'||_0x4cf593['type']===_0x1457d2(0x210))&&_0x4cf593[_0x1457d2(0x191)]&&(_0x4cf593[_0x1457d2(0x1a2)]=await _0x2cd3bb(_0x4cf593[_0x1457d2(0x191)],_0x502c97));}const _0x2d2c55=calculateSegmentDiff(_0x252fe9,_0x50b6c2,_0x4dc54f,_0x4465b7[_0x1457d2(0x193)],_0x4465b7[_0x1457d2(0x24b)]);_0x5bf307[_0x1457d2(0x228)]({'relativePath':_0x252fe9['name'],'absolutePath':_0x583cdc,'yamlConfig':_0x252fe9,'folderPath':_0x3800f7,'existingSegment':_0x50b6c2,'existingActivations':_0x4dc54f,'isNew':_0x2d2c55['isNew'],'hasChanges':_0x2d2c55[_0x1457d2(0x1fa)],'diff':_0x2d2c55['diff'],'activationActions':_0x51f8ca});}return{'segmentFiles':_0x5bf307,'foldersToCreate':_0x2c39cc};}export async function prepareJourneyFiles(_0x32e094,_0x250919,_0x283a78,_0x825f58){const _0x33fb27=a101_0x109af2,_0x1c281a=[],_0x2f9391=new Set();for(const {yamlConfig:_0x454fe2,folderPath:_0x2c0c1c,sourcePath:_0x29917b}of _0x32e094){const _0x49584c=resolveTDFolderPath(_0x2c0c1c,_0x283a78,_0x825f58),_0x181341=_0x49584c+':'+_0x454fe2[_0x33fb27(0x19e)],_0x52a9d0=_0x250919[_0x33fb27(0x209)][_0x33fb27(0x1bd)](_0x181341);let _0x4fa579,_0x38e78a;if(_0x52a9d0&&_0x52a9d0[_0x33fb27(0x242)]>0x0){const _0x23855d=buildLocalExpandedRuleMappings(_0x454fe2),{createYamlContext:_0x2fc2b5,prefetchJourneySegments:_0x14e750}=createPushYamlContextForBundle(_0x250919['deps'],_0x250919[_0x33fb27(0x1ab)],_0x250919[_0x33fb27(0x201)],_0x23855d,_0x250919['idToEmailMap'],_0x250919['connectionIdToNameMap'],_0x250919[_0x33fb27(0x1b8)],_0x250919[_0x33fb27(0x241)]);await _0x14e750(_0x52a9d0[_0x33fb27(0x1ee)](_0x305b65=>_0x305b65['id']));const _0x1f40cd=hasMultipleVersions(_0x454fe2),_0x3b6edb=async _0x429a61=>{const _0x2f8e1d=_0x33fb27,_0x3f571a=_0x250919[_0x2f8e1d(0x241)]?.['get'](_0x429a61);if(_0x3f571a)return _0x3f571a;return _0x250919['fetchJourney']({'journeyId':_0x429a61,'journeyName':_0x454fe2['name'],'isMultiVersion':_0x52a9d0[_0x2f8e1d(0x242)]>0x1});};if(_0x1f40cd&&_0x52a9d0['length']>0x1){const _0x2efa96=[];for(const _0x3c2f12 of _0x52a9d0){const _0x521002=_0x3c2f12[_0x33fb27(0x21a)]||0x1;_0x250919[_0x33fb27(0x183)]?.[_0x33fb27(0x210)](_0x33fb27(0x1f9)+_0x454fe2[_0x33fb27(0x19e)]+'\x20v'+_0x521002);const _0x59f938=await _0x3b6edb(_0x3c2f12['id']),_0x1e2b48=_0x2fc2b5(_0x3c2f12['id']),_0x3ac6d8=await journeyResponseToDef(_0x59f938,_0x1e2b48);_0x2efa96[_0x33fb27(0x228)]({'item':_0x3c2f12,'yaml':_0x3ac6d8});}const _0x18c81b=buildLocalRuleToNameMappingFromJourney(_0x454fe2);_0x38e78a=buildMergedJourneyDef(_0x2efa96,_0x18c81b);const _0x33dbfc=Math[_0x33fb27(0x1e1)](..._0x2efa96['map'](_0x1e3c3d=>_0x1e3c3d[_0x33fb27(0x1eb)][_0x33fb27(0x21a)]||0x0)),_0x4f2343=_0x52a9d0[_0x33fb27(0x17c)](_0x3d51f5=>(_0x3d51f5[_0x33fb27(0x21a)]||0x0)===_0x33dbfc);_0x4f2343&&(_0x250919[_0x33fb27(0x183)]?.[_0x33fb27(0x210)](_0x33fb27(0x1f9)+_0x454fe2[_0x33fb27(0x19e)]+'\x20v'+_0x33dbfc),_0x4fa579=await _0x3b6edb(_0x4f2343['id']));}else{const _0x20dcd8=_0x52a9d0[_0x52a9d0[_0x33fb27(0x242)]-0x1];_0x250919[_0x33fb27(0x183)]?.['update']('Fetching\x20'+_0x454fe2[_0x33fb27(0x19e)]),_0x4fa579=await _0x3b6edb(_0x20dcd8['id']);const _0x2bb43d=_0x2fc2b5(_0x20dcd8['id']),_0x5d5713=await journeyResponseToDef(_0x4fa579,_0x2bb43d),_0x364ab3=buildLocalRuleToNameMappingFromJourney(_0x454fe2);_0x38e78a=buildMergedJourneyDef([{'item':_0x20dcd8,'yaml':_0x5d5713}],_0x364ab3);}}addFoldersToCreate(_0x49584c,_0x250919[_0x33fb27(0x24f)],_0x2f9391);const _0x4a25e5=calculateJourneyDiff(_0x454fe2,_0x38e78a);_0x1c281a[_0x33fb27(0x228)]({'relativePath':_0x454fe2['name'],'absolutePath':_0x29917b,'yamlConfig':_0x454fe2,'folderPath':_0x49584c,'existingJourney':_0x4fa579,'isNew':_0x4a25e5[_0x33fb27(0x225)],'hasChanges':_0x4a25e5[_0x33fb27(0x1fa)],'diff':_0x4a25e5[_0x33fb27(0x23d)]});}return{'journeyFiles':_0x1c281a,'foldersToCreate':_0x2f9391};}export function calculateActivationActions(_0x175470,_0x4b64bf,_0x2e7a52,_0x1065db){const _0x38c0fe=a101_0x109af2,_0x19dfe7=[],_0x263beb=new Map();for(const _0x5da660 of _0x4b64bf){_0x263beb['set'](_0x5da660[_0x38c0fe(0x19e)],_0x5da660);}const _0x369aa6=new Map();for(const _0x53b474 of _0x175470){_0x369aa6[_0x38c0fe(0x1de)](_0x53b474[_0x38c0fe(0x19e)],_0x53b474);}for(const _0x57923f of _0x175470){const _0x2a56aa=_0x263beb['get'](_0x57923f[_0x38c0fe(0x19e)]);if(!_0x2a56aa)_0x19dfe7['push']({'type':_0x38c0fe(0x207),'name':_0x57923f[_0x38c0fe(0x19e)],'yamlActivation':_0x57923f});else{const _0xdc652f=activationResponseToDef(_0x2a56aa,_0x2e7a52,_0x1065db),_0x458900=a101_0x373ffc['stringify'](_0xdc652f),_0x4949a0=a101_0x373ffc[_0x38c0fe(0x226)](_0x57923f);_0x458900!==_0x4949a0&&_0x19dfe7[_0x38c0fe(0x228)]({'type':'update','name':_0x57923f[_0x38c0fe(0x19e)],'yamlActivation':_0x57923f,'existingActivation':_0x2a56aa});}}for(const _0x5abcbb of _0x4b64bf){!_0x369aa6[_0x38c0fe(0x21f)](_0x5abcbb[_0x38c0fe(0x19e)])&&_0x19dfe7[_0x38c0fe(0x228)]({'type':'delete','name':_0x5abcbb[_0x38c0fe(0x19e)],'existingActivation':_0x5abcbb});}return _0x19dfe7;}function a101_0x41db(){const _0x218101=['map','activations','keys','\x27\x20for\x20','WaitStep','Created\x20segment\x20\x27','stages','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','filter','104VgjdnY','\x27...','Fetching\x20','hasChanges','Deleted\x20activation\x20\x27','journeyBundleName','1138928smHUhX','join','errors','journey_created','existingSegments','segment_updated','skipSegments','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Stage\x20\x27','Name\x20has\x20already\x20been\x20taken','create','Activation','journeyBundlesByFolderAndName','embeddedSegmentNameToId','105952YGPZvW','Segment\x20not\x20found:\x20','goal\x20criteria','embedded_segment_creating','journey_entry_criteria_','update','activation_updated','Journey\x20\x27','valid','\x27\x20exit\x20criteria','state','steps','activation_template_id','journey','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','versionNumber','listSegments','stage\x20\x27','startsWith','sort','has','listActivations','updateSegmentById','Created\x20folder\x20\x27','journeyActivationNameToId','journey_creating','isNew','stringify','index','push','folderId','logSuccess','segment','./journey-yaml.js','connector_config','journeyStages','segmentNameToId','attributes','2388530DeGLUs','NOT_FOUND','utf-8','createActivation','ACTIVATION_SYNTAX_ERROR','activation_updating','dirname','add','entryCriteria','draft','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','INTERNAL','diff','journeyActivationStepId','with','split','journeyById','length','segment_created','segmentByFolderAndName','withProgress','branches','results','effectiveFolderId','existingActivation','action','connectionIdToNameMap','journeyId','activation_deleting','segmentId','folderPathToId','parse','object','entry','entry_criteria','onProgress','SEGMENT_SYNTAX_ERROR','activation_','folder_created','find','existingJourney','activationContext','getSegment','goal','yamlConfig','174StrDYF','progress','verbose','hex','journeys','parentFolder','folder','nameToType','buildUserMaps','resolveSegment','logWarning','milestone','JOURNEY_UPDATE_ERROR','Creating\x20activation\x20\x27','\x27\x20wait\x20condition','yamlActivation','resolveJourneyId','idToEmailMap','\x27\x20milestone','ACTIVATION_UPDATE_ERROR','createSegment','all','folder_creating','78035seKhqv','absolutePath','rule','description','toString','name','SEGMENT_NOT_FOUND','user','Creating\x20folder\x20\x27','validatedRequest','updated','createFolder','Updating\x20segment\x20\x27','logInfo','data','deleted','getJourney','segment_creating','parentId','created','isArray','message','):\x20','type','nameToId','../../utils/async.js','DecisionPoint','toLowerCase','slice','Failed\x20to\x20','columns','activationStepsById','delete','from','connection','embedded_segment_created','get','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','1053529cwowCT','replace','size','waitCondition','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','all_columns','exitCriterias','Updated\x20segment\x20\x27','segmentFolderId','behavior','activation_created','\x27\x20decision\x20point\x20branch\x20\x27','includes','sha1','\x20(referenced\x20in\x20journey\x20','\x0a\x20\x20','relationships','10258336erjOof','Deleted\x20segment\x20\x27','9oYmfLy','relative','./child-segment-yaml.js','__pending_act_','segments','folderPath','JOURNEY_SYNTAX_ERROR','createdSegmentId','Entry\x20criteria:\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','__pending_','set','activationParams','existingSegment','max','getActivation','logDeleted','Activation\x20not\x20found:\x20','Creating\x20segment\x20\x27','kind','3562725BAGfqG','activationActions','segment_deleted','digest','item','reduce','notification'];a101_0x41db=function(){return _0x218101;};return a101_0x41db();}export function calculateSegmentDiff(_0x908254,_0x57ffa1,_0xa449c2,_0x13e63f,_0xfebe63){const _0xb737f5=segmentToYamlString(_0x908254);if(_0x57ffa1){const _0x3049f5=segmentWithActivationsToYaml(_0x57ffa1,_0xa449c2,undefined,_0x13e63f,_0xfebe63),_0x536194=segmentToYamlString(_0x3049f5),_0x3ad323=generateDiff(_0x536194,_0xb737f5),_0x2ce6e7=hasChanges(_0x3ad323);return{'isNew':![],'hasChanges':_0x2ce6e7,'diff':_0x2ce6e7?formatDiffWithColors(_0x3ad323):undefined};}const _0xb42ed2=generateDiff('',_0xb737f5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xb42ed2)};}export function calculateJourneyDiff(_0x1703fd,_0x5db44e){const _0xa24688=normalizeJourneyDef(_0x1703fd,_0x1703fd),_0x40ba24=a101_0x5ead0b(_0xa24688);if(_0x5db44e){const _0x5b9d68=normalizeJourneyDef(_0x5db44e,_0x1703fd),_0x5cc81b=a101_0x5ead0b(_0x5b9d68),_0x5e5a31=generateDiff(_0x5cc81b,_0x40ba24),_0x20b20d=hasChanges(_0x5e5a31);return{'isNew':![],'hasChanges':_0x20b20d,'diff':_0x20b20d?formatDiffWithColors(_0x5e5a31):undefined};}const _0x249d53=generateDiff('',_0x40ba24);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x249d53)};}export function findSegmentsToDelete(_0x1e222a,_0x19836e,_0x3cae45,_0x4b6463,_0xdde2f9){const _0x5649b0=a101_0x109af2,_0x4c3af1=new Set();for(const {yamlConfig:_0x32c18b,folderPath:_0x13db5e}of _0x19836e){_0x4c3af1[_0x5649b0(0x238)](_0x13db5e+':'+_0x32c18b[_0x5649b0(0x19e)]);}return _0x1e222a[_0x5649b0(0x1f6)](_0x37e47a=>{const _0x47fb71=_0x5649b0,_0x448bae=_0x37e47a[_0x47fb71(0x1c8)]?_0x3cae45['get'](_0x37e47a[_0x47fb71(0x1c8)][_0x47fb71(0x19d)]())||'':'',_0x1aa918=_0x448bae+':'+_0x37e47a[_0x47fb71(0x19e)];if(_0x4c3af1[_0x47fb71(0x21f)](_0x1aa918))return![];if(_0xdde2f9)return _0x448bae===_0x4b6463||_0x448bae[_0x47fb71(0x21d)](_0x4b6463+'/');return!![];});}export function findJourneysToDelete(_0x4ec16d,_0x1e8f9b,_0x42538b,_0x4eb48f,_0x471449){const _0x1c2697=a101_0x109af2,_0x18e988=new Set();for(const {yamlConfig:_0x2e2b51,folderPath:_0x460afa}of _0x1e8f9b){_0x18e988['add'](_0x460afa+':'+_0x2e2b51['name']);}return _0x4ec16d[_0x1c2697(0x1f6)](_0x2d0e23=>{const _0xa75e0b=_0x1c2697,_0x36d7c3=_0x2d0e23[_0xa75e0b(0x229)]?_0x42538b['get'](_0x2d0e23[_0xa75e0b(0x229)])||'':'',_0x438d37=_0x36d7c3+':'+_0x2d0e23[_0xa75e0b(0x1fc)];if(_0x18e988[_0xa75e0b(0x21f)](_0x438d37))return![];if(_0x471449)return _0x36d7c3===_0x4eb48f||_0x36d7c3['startsWith'](_0x4eb48f+'/');return!![];});}export function buildSegmentLookupMap(_0x3b231c,_0x26efdd){const _0x5960b4=a101_0x109af2,_0x5b8d61=new Map();for(const _0x41f252 of _0x3b231c){const _0x53aa60=_0x41f252[_0x5960b4(0x1c8)]?_0x26efdd[_0x5960b4(0x1bd)](_0x41f252[_0x5960b4(0x1c8)][_0x5960b4(0x19d)]())||'':'',_0x42c99d=_0x53aa60+':'+_0x41f252[_0x5960b4(0x19e)];_0x5b8d61[_0x5960b4(0x1de)](_0x42c99d,_0x41f252);}return _0x5b8d61;}export function buildSegmentNameToIdMap(_0x5d267e){const _0x2ddc5b=a101_0x109af2,_0x561e67=new Map();for(const _0x2db53 of _0x5d267e){_0x561e67[_0x2ddc5b(0x1de)](_0x2db53[_0x2ddc5b(0x19e)],_0x2db53['id']);}return _0x561e67;}export function buildJourneyBundleLookupMap(_0x1644d5,_0x4422b7){const _0x66cccf=a101_0x109af2,_0x4b0b80=new Map();for(const _0x179ac1 of _0x1644d5){const _0x3c3f8d=_0x179ac1[_0x66cccf(0x229)]?_0x4422b7[_0x66cccf(0x1bd)](_0x179ac1[_0x66cccf(0x229)])||'':'',_0x57eda3=_0x3c3f8d+':'+_0x179ac1['journeyBundleName'];!_0x4b0b80['has'](_0x57eda3)&&_0x4b0b80['set'](_0x57eda3,[]),_0x4b0b80[_0x66cccf(0x1bd)](_0x57eda3)[_0x66cccf(0x228)](_0x179ac1);}for(const _0x1caa0a of _0x4b0b80['values']()){_0x1caa0a[_0x66cccf(0x21e)]((_0x207a5a,_0x3a05d9)=>(_0x207a5a['versionNumber']||0x0)-(_0x3a05d9[_0x66cccf(0x21a)]||0x0));}return _0x4b0b80;}export function collectFoldersToCreate(_0x4398c1,_0x3828d2){const _0xc9106=a101_0x109af2,_0x9a25df=new Set();for(const _0x4e8936 of _0x4398c1){if(!_0x4e8936)continue;if(_0x3828d2['has'](_0x4e8936))continue;const _0x59c1d3=_0x4e8936['split']('/');let _0x294709='';for(const _0x23e61e of _0x59c1d3){_0x294709=_0x294709?_0x294709+'/'+_0x23e61e:_0x23e61e,!_0x3828d2[_0xc9106(0x21f)](_0x294709)&&_0x9a25df[_0xc9106(0x238)](_0x294709);}}return _0x9a25df;}export function parseAndClassifyYamlFiles(_0x16139b,_0x429605,_0x21c43e){const _0x595c23=a101_0x109af2,_0x795df=[],_0x35e31e=[];for(const _0x748a02 of _0x16139b){const _0x498d2a=a101_0x1034f4[_0x595c23(0x1d4)](_0x429605,a101_0x1034f4[_0x595c23(0x237)](_0x748a02)),_0x20ed48=_0x498d2a==='.'?'':_0x498d2a,_0x5e61e1=readFileSync(_0x748a02,_0x595c23(0x233)),_0x25af2b=a101_0x373ffc[_0x595c23(0x250)](_0x5e61e1);if(isJourneyDef(_0x25af2b)){const _0x1f43b2=a101_0x402c83(_0x5e61e1);_0x35e31e['push']({'yamlConfig':_0x1f43b2,'folderPath':_0x20ed48,'sourcePath':_0x748a02});}else{if(!_0x21c43e?.[_0x595c23(0x203)]){const _0x256e16=parseSegmentYamlFile(_0x5e61e1),_0x1f7fe3=normalizeChildSegmentYaml(_0x256e16);_0x795df['push']({'yamlConfig':_0x1f7fe3,'folderPath':_0x20ed48,'sourcePath':_0x748a02});}}}return{'segments':_0x795df,'journeys':_0x35e31e};}export function validateParsedFiles(_0x4eb39b,_0x170d18){const _0x3c7609=a101_0x109af2,_0x1fdd1e=[];for(const {yamlConfig:_0x43e0f6,sourcePath:_0x4e6032}of _0x4eb39b['segments']){const _0x576b25=readFileSync(_0x4e6032,_0x3c7609(0x233)),_0xde47dc=a101_0x373ffc['parseDocument'](_0x576b25),_0x23bab1=validateSegmentDef(_0x43e0f6,{'source':_0x576b25,'document':_0xde47dc});if(!_0x23bab1[_0x3c7609(0x213)]){const _0x52b7ce=a101_0x1034f4['relative'](_0x170d18,_0x4e6032);_0x1fdd1e[_0x3c7609(0x228)]({'filePath':_0x52b7ce,'source':_0x576b25,'result':_0x23bab1,'isJourney':![]});}}for(const {yamlConfig:_0x58d53c,sourcePath:_0x509915}of _0x4eb39b['journeys']){const _0x9fbeb6=readFileSync(_0x509915,_0x3c7609(0x233)),_0x5b8bf1=a101_0x373ffc['parseDocument'](_0x9fbeb6),_0x377429=validateJourneyDef(_0x58d53c,{'source':_0x9fbeb6,'document':_0x5b8bf1});if(!_0x377429['valid']){const _0xb38d36=a101_0x1034f4[_0x3c7609(0x1d4)](_0x170d18,_0x509915);_0x1fdd1e['push']({'filePath':_0xb38d36,'source':_0x9fbeb6,'result':_0x377429,'isJourney':!![]});}}return _0x1fdd1e;}export function formatValidationErrors(_0xfd3c7e){const _0x37f6b3=a101_0x109af2,_0x4778d4=[];for(const {filePath:_0xdca4f,source:_0x5e9f71,result:_0x1c0127,isJourney:_0x62f6ca}of _0xfd3c7e){const _0x2a5192=_0x62f6ca?_0x37f6b3(0x218):_0x37f6b3(0x22b);_0x4778d4[_0x37f6b3(0x228)]('\x0a'+_0xdca4f+'\x20('+_0x2a5192+_0x37f6b3(0x1af)+_0x1c0127[_0x37f6b3(0x1ff)]['length']+'\x20error(s)'),_0x4778d4[_0x37f6b3(0x228)](formatValidationResult(_0x1c0127,_0x5e9f71,_0xdca4f));}return _0x4778d4[_0x37f6b3(0x1fe)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2e04b4){const _0xeb604f=a101_0x109af2,_0x321415=new Set(),_0x41a654=new Map(),_0x322893=collectSegmentUsageCounts(_0x2e04b4);if(_0x2e04b4[_0xeb604f(0x1d7)])for(const [_0x3b6bd4,_0x4dfff5]of Object['entries'](_0x2e04b4[_0xeb604f(0x1d7)])){_0x321415[_0xeb604f(0x238)](_0x3b6bd4);if(_0x4dfff5[_0xeb604f(0x19b)]){const _0x127d2f=yamlRuleToApi(_0x4dfff5['rule']),_0x3bbb14=apiRuleToYaml(_0x127d2f);_0x41a654[_0xeb604f(0x1de)](_0x3b6bd4,_0x3bbb14);}}const _0x42d18c=new Map();let _0x54b6a7=0x0;for(const [_0x543908,_0x2cd142]of _0x41a654){const _0x45800e=serializeExpandedRule(_0x2cd142,_0x41a654),_0x35f04f=_0x42d18c[_0xeb604f(0x1bd)](_0x45800e)||[];_0x35f04f[_0xeb604f(0x228)]({'name':_0x543908,'index':_0x54b6a7}),_0x42d18c[_0xeb604f(0x1de)](_0x45800e,_0x35f04f),_0x54b6a7++;}const _0x273511=new Map();for(const [_0xcdb6a4,_0x206531]of _0x42d18c){const _0x339380=_0x206531[_0xeb604f(0x1b5)]()['sort']((_0xdbb9a7,_0x107d4a)=>{const _0x8613d8=_0xeb604f,_0x2508ca=_0x322893[_0x8613d8(0x1bd)](_0xdbb9a7[_0x8613d8(0x19e)])||0x0,_0x211efa=_0x322893[_0x8613d8(0x1bd)](_0x107d4a[_0x8613d8(0x19e)])||0x0;if(_0x2508ca!==_0x211efa)return _0x211efa-_0x2508ca;return _0xdbb9a7[_0x8613d8(0x227)]-_0x107d4a[_0x8613d8(0x227)];})[_0xeb604f(0x1ee)](_0x5dc60f=>_0x5dc60f[_0xeb604f(0x19e)]),_0x33c2db=[];for(const _0x33f6ee of _0x339380){const _0x22026f=_0x322893[_0xeb604f(0x1bd)](_0x33f6ee)||0x0,_0x57389a=Math[_0xeb604f(0x1e1)](_0x22026f,0x1);for(let _0x3e16da=0x0;_0x3e16da<_0x57389a;_0x3e16da++){_0x33c2db[_0xeb604f(0x228)](_0x33f6ee);}}_0x273511['set'](_0xcdb6a4,_0x33c2db);}return{'existingLocalSegmentNames':_0x321415,'localSegmentRules':_0x41a654,'localExpandedRuleToNames':_0x273511};}async function buildServerSegmentRuleMap(_0x56c05b,_0x2845b2,_0x15685e,_0x5a2114){const _0x39e9e6=new Map(),_0x1aaf90=new Set(),_0x3f5f08=async _0x532e49=>{const _0x57ca39=a101_0x383a;if(_0x1aaf90[_0x57ca39(0x21f)](_0x532e49))return;_0x1aaf90[_0x57ca39(0x238)](_0x532e49);let _0x1fe6d3=_0x15685e['find'](_0x37bf03=>_0x37bf03['id']===_0x532e49);if(!_0x1fe6d3)try{_0x1fe6d3=await _0x56c05b['segment']['getSegment'](_0x2845b2,_0x532e49);}catch{return;}if(!_0x1fe6d3?.[_0x57ca39(0x19b)])return;const _0x13071c=apiRuleToYaml(_0x1fe6d3['rule']);_0x39e9e6['set'](_0x532e49,_0x13071c);const _0x4c4053=collectSegmentRefsFromRule(_0x13071c);for(const _0x31a0b2 of _0x4c4053){await _0x3f5f08(_0x31a0b2);}};for(const _0x434fe4 of _0x5a2114){await _0x3f5f08(_0x434fe4);}return _0x39e9e6;}export function createSegmentIdResolver(_0x182dae,_0x16b699){return async _0x10ae37=>{const _0x38a718=a101_0x383a,_0x417eef=_0x182dae[_0x38a718(0x1bd)](_0x10ae37);if(!_0x417eef)throw new SDKError(ErrorCode[_0x38a718(0x19f)],_0x38a718(0x20c)+_0x10ae37+_0x38a718(0x1f5)+_0x16b699+'\x27)');return _0x417eef;};}export function extractRootFolderId(_0x2164d9){const _0x4a0be1=a101_0x109af2;return _0x2164d9[_0x4a0be1(0x1d0)]?.['parentSegmentFolder']?.[_0x4a0be1(0x1a7)]?.['id']||_0x2164d9[_0x4a0be1(0x1d0)]?.[_0x4a0be1(0x187)]?.[_0x4a0be1(0x1a7)]?.['id'];}export function buildConnectionMaps(_0x493144){const _0x175c82=a101_0x109af2,_0x534508=new Map(),_0x2b12b7=new Map(),_0x55bccc=new Map();for(const _0x326d9b of _0x493144){_0x534508[_0x175c82(0x1de)](_0x326d9b[_0x175c82(0x19e)],parseInt(_0x326d9b['id'],0xa)),_0x2b12b7[_0x175c82(0x1de)](_0x326d9b['id'],_0x326d9b[_0x175c82(0x19e)]),_0x55bccc[_0x175c82(0x1de)](_0x326d9b['name'],_0x326d9b['type']);}return{'nameToId':_0x534508,'idToName':_0x2b12b7,'nameToType':_0x55bccc};}export function calculatePushStats(_0x22cdfd,_0x5f5b0b,_0x431af8,_0xca4b70,_0x278ebc,_0x404b76,_0x26ee04){const _0x4cba94=a101_0x109af2,_0x21e87=_0x22cdfd[_0x4cba94(0x1f6)](_0x541629=>_0x541629[_0x4cba94(0x225)]),_0xc86e64=_0x22cdfd[_0x4cba94(0x1f6)](_0x33a485=>!_0x33a485[_0x4cba94(0x225)]&&_0x33a485['hasChanges']),_0x17900e=_0x22cdfd['filter'](_0x26d95a=>!_0x26d95a[_0x4cba94(0x225)]&&!_0x26d95a[_0x4cba94(0x1fa)]),_0x31c16f=_0x404b76?_0xca4b70:[],_0x3fdf88=_0x5f5b0b['filter'](_0x56cee1=>_0x56cee1['isNew']),_0xf6ca6=_0x5f5b0b['filter'](_0x868133=>!_0x868133['isNew']&&_0x868133[_0x4cba94(0x1fa)]),_0xc4dfc4=_0x5f5b0b[_0x4cba94(0x1f6)](_0x45d99e=>!_0x45d99e[_0x4cba94(0x225)]&&!_0x45d99e[_0x4cba94(0x1fa)]),_0x12a2c4=_0x404b76?_0x278ebc:[],_0x46053a=_0x22cdfd['flatMap'](_0xe19004=>_0xe19004[_0x4cba94(0x1e8)]),_0x29e2c3=_0x46053a[_0x4cba94(0x1f6)](_0x490a3f=>_0x490a3f['type']===_0x4cba94(0x207)),_0x50eecd=_0x46053a[_0x4cba94(0x1f6)](_0x48b0e3=>_0x48b0e3['type']===_0x4cba94(0x210)),_0x38cbd6=_0x46053a[_0x4cba94(0x1f6)](_0x2f9f6f=>_0x2f9f6f[_0x4cba94(0x1b0)]===_0x4cba94(0x1b9)),_0x2c549a=Array[_0x4cba94(0x1ba)](_0x431af8)[_0x4cba94(0x21e)](),_0x57ad6d=_0x26ee04?![]:_0x21e87[_0x4cba94(0x242)]>0x0||_0xc86e64[_0x4cba94(0x242)]>0x0||_0x31c16f[_0x4cba94(0x242)]>0x0,_0x61368b=_0x3fdf88[_0x4cba94(0x242)]>0x0||_0xf6ca6['length']>0x0||_0x12a2c4['length']>0x0,_0x5d077c=_0x26ee04?![]:_0x46053a[_0x4cba94(0x242)]>0x0,_0xe6bde1=_0x2c549a[_0x4cba94(0x242)]>0x0;return{'segments':{'new':_0x21e87,'changed':_0xc86e64,'unchanged':_0x17900e,'toDelete':_0x31c16f},'journeys':{'new':_0x3fdf88,'changed':_0xf6ca6,'unchanged':_0xc4dfc4,'toDelete':_0x12a2c4},'activations':{'all':_0x46053a,'toCreate':_0x29e2c3,'toUpdate':_0x50eecd,'toDelete':_0x38cbd6},'folders':{'toCreate':_0x2c549a},'counts':{'segments':{'new':_0x21e87[_0x4cba94(0x242)],'changed':_0xc86e64[_0x4cba94(0x242)],'unchanged':_0x17900e[_0x4cba94(0x242)],'toDelete':_0x31c16f[_0x4cba94(0x242)]},'journeys':{'new':_0x3fdf88['length'],'changed':_0xf6ca6[_0x4cba94(0x242)],'unchanged':_0xc4dfc4['length'],'toDelete':_0x12a2c4[_0x4cba94(0x242)]},'activations':{'create':_0x29e2c3[_0x4cba94(0x242)],'update':_0x50eecd[_0x4cba94(0x242)],'delete':_0x38cbd6['length']},'folders':_0x2c549a[_0x4cba94(0x242)]},'hasChanges':_0x57ad6d||_0x61368b||_0x5d077c||_0xe6bde1};}export async function buildPushExecutionContext(_0x30aff7,_0x342414,_0x16ed84,_0x1882e8,_0x4d1d0b,_0x25b868){const _0x52eef5=a101_0x109af2,_0x521df8=extractRootFolderId(_0x16ed84),{pathToId:_0x5d7327,idToPath:_0x5cfc7e}=buildFolderMaps(_0x4d1d0b),_0x1dd2da=buildSegmentNameToIdMap(_0x1882e8),_0x59a437=new Map(),{batchAsync:_0x5af6f6}=await import(_0x52eef5(0x1b2)),[_0x28b80a,_0x219f4b]=await Promise[_0x52eef5(0x197)]([_0x30aff7[_0x52eef5(0x1a0)][_0x52eef5(0x18a)](),_0x30aff7[_0x52eef5(0x1bb)]['list'](),((async()=>{!_0x25b868&&_0x1882e8['length']>0x0&&await _0x5af6f6(_0x1882e8,async _0x239acf=>{const _0xe762f0=a101_0x383a,_0x477123=await _0x30aff7[_0xe762f0(0x22b)]['listActivations'](_0x342414,_0x239acf['id']);_0x59a437['set'](_0x239acf['id'],_0x477123);});})())]),{emailToId:_0x312b20,idToEmail:_0x2d20b9}=_0x28b80a,_0x23a815=buildConnectionMaps(_0x219f4b);return{'rootFolderId':_0x521df8,'folderPathToId':_0x5d7327,'folderIdToPath':_0x5cfc7e,'segmentNameToId':_0x1dd2da,'activationsBySegmentId':_0x59a437,'emailToIdMap':_0x312b20,'idToEmailMap':_0x2d20b9,'connectionNameToIdMap':_0x23a815[_0x52eef5(0x1b1)],'connectionIdToNameMap':_0x23a815['idToName'],'connectionNameToTypeMap':_0x23a815[_0x52eef5(0x189)]};}export function createPushYamlContextForBundle(_0x9f338f,_0x38c989,_0x1aea91,_0xc993cb,_0x187be7,_0x517299,_0x4390e0,_0x1604cb){const {existingLocalSegmentNames:_0x1ece68,localExpandedRuleToNames:_0x161d6d}=_0xc993cb,_0x84002a=new Set(),_0x232012=new Map(),_0x5ba897=new Map(),_0xd8a7ee=new Map(),_0x2908a4=createJumpTargetCache(),_0x12df9b=new Map(),_0x31521e=new Map(),_0xcb1a01=new Set();let _0x10b374;const _0x2cd521=_0xd584c1=>{const _0xb362c={'resolveSegment':async _0xc19d0b=>{const _0x48dec7=a101_0x383a,_0x4c4499=_0xd8a7ee[_0x48dec7(0x1bd)](_0xc19d0b);if(_0x4c4499!==undefined)return{'name':_0x4c4499,'isJourneyLocal':!![]};try{let _0x4ad80b=_0x1aea91[_0x48dec7(0x17c)](_0x38e27c=>_0x38e27c['id']===_0xc19d0b);!_0x4ad80b&&(_0x4ad80b=await _0x9f338f[_0x48dec7(0x22b)][_0x48dec7(0x17f)](_0x38c989,_0xc19d0b));const _0x26b427=generateJourneyLocalName(_0x4ad80b[_0x48dec7(0x19e)]),_0x3911e9=_0x4ad80b[_0x48dec7(0x1e6)]===SEGMENT_KIND_JOURNEY&&_0x26b427!==undefined;let _0x465006=_0x4ad80b['name'],_0x543cd8;if(_0x3911e9&&_0x4ad80b[_0x48dec7(0x19b)]){const _0x52a1e2=apiRuleToYaml(_0x4ad80b[_0x48dec7(0x19b)]);_0x31521e['set'](_0xc19d0b,_0x52a1e2);const _0x58d8fd=async _0x132ea9=>{const _0xfacf33=_0x48dec7,_0x35cded=collectSegmentRefsFromRule(_0x132ea9);for(const _0x1427ad of _0x35cded){if(!_0x31521e[_0xfacf33(0x21f)](_0x1427ad))try{const _0x2e7433=await _0x9f338f[_0xfacf33(0x22b)][_0xfacf33(0x17f)](_0x38c989,_0x1427ad);if(_0x2e7433?.['rule']){const _0x3a0bb4=apiRuleToYaml(_0x2e7433[_0xfacf33(0x19b)]);_0x31521e[_0xfacf33(0x1de)](_0x1427ad,_0x3a0bb4),await _0x58d8fd(_0x3a0bb4);}}catch{}}};await _0x58d8fd(_0x52a1e2);const _0x488bf1=serializeExpandedRule(_0x52a1e2,_0x31521e),_0x45186c=_0x161d6d[_0x48dec7(0x1bd)](_0x488bf1);if(_0x45186c&&_0x45186c[_0x48dec7(0x242)]>0x0){const _0x5d746e=_0x232012[_0x48dec7(0x1bd)](_0x488bf1)||0x0,_0x20e8b1=_0x45186c[_0x5d746e]||_0x45186c[_0x45186c[_0x48dec7(0x242)]-0x1];_0x232012[_0x48dec7(0x1de)](_0x488bf1,_0x5d746e+0x1),_0x465006=_0x20e8b1,_0x84002a[_0x48dec7(0x238)](_0x465006),_0xd8a7ee[_0x48dec7(0x1de)](_0xc19d0b,_0x465006);const _0x235b62=await resolveRuleSegmentRefs(_0x52a1e2,async _0x5cc22e=>{const _0x34215a=_0x48dec7,_0x1a76a5=_0xd8a7ee[_0x34215a(0x1bd)](_0x5cc22e);if(_0x1a76a5)return _0x1a76a5;const _0x228cdb=await _0x10b374['resolveSegment'](_0x5cc22e);return _0x228cdb['name'];});_0x543cd8={'description':_0x4ad80b['description'],'rule':_0x235b62};}else{const _0x38a05d=_0x12df9b['get'](_0x488bf1);if(_0x38a05d)_0x465006=_0x38a05d,_0xd8a7ee[_0x48dec7(0x1de)](_0xc19d0b,_0x465006);else{if(_0x26b427){let _0x3ab711=_0x26b427,_0x4b167d=0x2;while(_0x84002a[_0x48dec7(0x21f)](_0x3ab711)||_0x1ece68[_0x48dec7(0x21f)](_0x3ab711)){_0x3ab711=_0x26b427+'_'+_0x4b167d,_0x4b167d++;}_0x84002a[_0x48dec7(0x238)](_0x3ab711),_0x465006=_0x3ab711;}_0xd8a7ee[_0x48dec7(0x1de)](_0xc19d0b,_0x465006),_0x12df9b[_0x48dec7(0x1de)](_0x488bf1,_0x465006);const _0x440cf8=await resolveRuleSegmentRefs(_0x52a1e2,async _0x338371=>{const _0x24f586=_0x48dec7,_0x2bf4bc=_0xd8a7ee[_0x24f586(0x1bd)](_0x338371);if(_0x2bf4bc)return _0x2bf4bc;const _0x3f2ad8=await _0x10b374[_0x24f586(0x18b)](_0x338371);return _0x3f2ad8[_0x24f586(0x19e)];});_0x543cd8={'description':_0x4ad80b['description'],'rule':_0x440cf8};}}}return{'name':_0x465006,'isJourneyLocal':_0x3911e9,'definition':_0x543cd8};}catch{return{'name':_0xc19d0b,'isJourneyLocal':![]};}},'resolveActivation':async _0xec0706=>{const _0x1a1626=a101_0x383a,_0x8f67e4=_0x5ba897['get'](_0xec0706);if(_0x8f67e4!==undefined)return{'name':_0x8f67e4,'isJourneyLocal':!![]};try{let _0x5e7a2e=_0x4390e0?.[_0x1a1626(0x1bd)](_0xec0706);!_0x5e7a2e&&(_0x5e7a2e=await _0x9f338f[_0x1a1626(0x218)][_0x1a1626(0x1e2)](_0xd584c1,_0xec0706));const _0x57d696=_0x5e7a2e[_0x1a1626(0x230)][_0x1a1626(0x1df)][_0x1a1626(0x19e)]||_0xec0706,_0x1b469e=sanitizeYamlKey(_0x57d696)||_0x1a1626(0x17a)+_0xec0706,_0x1e265b=_0x1b469e;_0x5ba897[_0x1a1626(0x1de)](_0xec0706,_0x1e265b);const _0x13a404=journeyActivationStepToYaml(_0x5e7a2e,_0x187be7,_0x517299);return{'name':_0x1e265b,'isJourneyLocal':!![],'definition':_0x13a404};}catch{return{'name':_0xec0706,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2f5c75,_0x3b2913)=>resolveJumpTarget(_0x2f5c75,_0x3b2913,_0x2908a4,async _0x4212b2=>{const _0x2508c3=a101_0x383a,_0x212187=_0x1604cb?.['get'](_0x4212b2);if(_0x212187)return _0x212187;return _0x9f338f[_0x2508c3(0x218)][_0x2508c3(0x1a9)](_0x4212b2);})};return _0x10b374=_0xb362c,_0xb362c;},_0x545e8c=async _0x2b076f=>{const _0xa7fb4a=a101_0x383a,{collectSegmentIdsFromJourneyApi:_0x31b1a8}=await import(_0xa7fb4a(0x22c)),{batchAsync:_0x2fd5c1}=await import(_0xa7fb4a(0x1b2)),_0x4191cb=new Set();for(const _0x442826 of _0x2b076f){let _0x2b4f68=_0x1604cb?.['get'](_0x442826);!_0x2b4f68&&(_0x2b4f68=await _0x9f338f[_0xa7fb4a(0x218)][_0xa7fb4a(0x1a9)](_0x442826));const _0x5c9329=_0x31b1a8(_0x2b4f68);for(const _0x4e7f1d of _0x5c9329){_0x4191cb[_0xa7fb4a(0x238)](_0x4e7f1d);}}let _0x4041b1=Array[_0xa7fb4a(0x1ba)](_0x4191cb);while(_0x4041b1['length']>0x0){const _0x4b0f60=_0x4041b1[_0xa7fb4a(0x1f6)](_0x5eb025=>!_0xcb1a01[_0xa7fb4a(0x21f)](_0x5eb025));if(_0x4b0f60[_0xa7fb4a(0x242)]===0x0)break;const _0x1030d8=await _0x2fd5c1(_0x4b0f60,async _0x2a3ead=>{const _0x9c3bce=_0xa7fb4a;_0xcb1a01[_0x9c3bce(0x238)](_0x2a3ead);let _0x20cb0b=_0x1aea91[_0x9c3bce(0x17c)](_0x1cca38=>_0x1cca38['id']===_0x2a3ead);if(!_0x20cb0b)try{_0x20cb0b=await _0x9f338f[_0x9c3bce(0x22b)][_0x9c3bce(0x17f)](_0x38c989,_0x2a3ead);}catch{return null;}return{'segmentId':_0x2a3ead,'segment':_0x20cb0b};},0xa),_0x27e91f=new Set();for(const _0x444d51 of _0x1030d8){if(!_0x444d51?.[_0xa7fb4a(0x22b)]?.['rule'])continue;const _0x50ce3b=apiRuleToYaml(_0x444d51[_0xa7fb4a(0x22b)][_0xa7fb4a(0x19b)]);_0x31521e[_0xa7fb4a(0x1de)](_0x444d51['segmentId'],_0x50ce3b);const _0x147366=collectSegmentRefsFromRule(_0x50ce3b);for(const _0x14b7b2 of _0x147366){!_0xcb1a01['has'](_0x14b7b2)&&_0x27e91f[_0xa7fb4a(0x238)](_0x14b7b2);}}_0x4041b1=Array[_0xa7fb4a(0x1ba)](_0x27e91f);}};return{'createYamlContext':_0x2cd521,'prefetchJourneySegments':_0x545e8c};}export async function executePushSegments(_0x1e7cc8,_0x2dfb7c,_0x297d1a,_0x4e673b,_0x19f17e){const _0x3c12cf=a101_0x109af2,{segmentDefToCreateRequest:_0x173f0c,segmentDefToUpdateRequest:_0x28df62}=await import('./child-segment-yaml.js'),_0x1ec420=_0x297d1a['folderPathToId'],_0x144844=0x5,_0x478426=async _0x60457f=>{const _0xdd4530=a101_0x383a,_0x13f7c2=_0x60457f[_0xdd4530(0x1d8)]?_0x1ec420[_0xdd4530(0x1bd)](_0x60457f[_0xdd4530(0x1d8)]):undefined;let _0x436278;const _0x54f9ad={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x60457f[_0xdd4530(0x225)]){_0x19f17e[_0xdd4530(0x178)]?.({'type':_0xdd4530(0x1aa),'name':_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]});const _0x523d95=_0x173f0c(_0x60457f[_0xdd4530(0x181)],_0x13f7c2),_0x248ab4=await _0x19f17e[_0xdd4530(0x245)](_0xdd4530(0x1e5)+_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]+_0xdd4530(0x1f8),()=>_0x1e7cc8[_0xdd4530(0x22b)][_0xdd4530(0x196)](_0x4e673b[_0xdd4530(0x1ab)],_0x523d95));_0x436278=_0x248ab4['data']['id'],_0x54f9ad[_0xdd4530(0x1da)]={'name':_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)],'id':_0x436278},_0x19f17e[_0xdd4530(0x178)]?.({'type':_0xdd4530(0x243),'name':_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)],'segmentId':_0x436278}),_0x19f17e[_0xdd4530(0x22a)]?.(_0xdd4530(0x1f3)+_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]+'\x27'),_0x54f9ad['created']=0x1;}else{if(_0x60457f[_0xdd4530(0x1fa)]){_0x19f17e[_0xdd4530(0x178)]?.({'type':'segment_updating','name':_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]});const _0x36eaf5=_0x28df62(_0x60457f[_0xdd4530(0x181)]);_0x13f7c2!==_0x60457f[_0xdd4530(0x1e0)]?.['segmentFolderId']&&(_0x36eaf5[_0xdd4530(0x1c8)]=_0x13f7c2?parseInt(_0x13f7c2,0xa):undefined),await _0x19f17e[_0xdd4530(0x245)](_0xdd4530(0x1a5)+_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]+'\x27...',()=>_0x1e7cc8['segment']['updateSegmentById'](_0x4e673b[_0xdd4530(0x1ab)],_0x60457f['existingSegment']['id'],_0x36eaf5)),_0x436278=_0x60457f[_0xdd4530(0x1e0)]['id'],_0x19f17e[_0xdd4530(0x178)]?.({'type':_0xdd4530(0x202),'name':_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]}),_0x19f17e[_0xdd4530(0x22a)]?.(_0xdd4530(0x1c7)+_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]+'\x27'),_0x54f9ad[_0xdd4530(0x1a3)]=0x1;}else _0x436278=_0x60457f[_0xdd4530(0x1e0)]['id'];}}catch(_0x295459){const _0x3516c9=isHttp400Error(_0x295459),_0x2d4afc=_0x3516c9?ErrorCode[_0xdd4530(0x179)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x406ffb=getErrorMessage(_0x295459);throw new SDKError(_0x2d4afc,_0xdd4530(0x1b6)+(_0x60457f[_0xdd4530(0x225)]?'create':'update')+'\x20segment\x20from\x20file:\x20'+_0x60457f['absolutePath']+_0xdd4530(0x1cf)+_0x406ffb,_0x295459);}try{const _0x2ad202=await syncActivationsForSegment(_0x1e7cc8,_0x4e673b[_0xdd4530(0x1ab)],_0x436278,_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)],_0x60457f[_0xdd4530(0x1e8)],_0x19f17e,_0x60457f[_0xdd4530(0x19a)]);_0x54f9ad[_0xdd4530(0x1ef)]=_0x2ad202;}catch(_0x44aa37){if(_0x44aa37 instanceof SDKError)throw _0x44aa37;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xdd4530(0x204)+_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]+'\x27\x20from\x20file:\x20'+_0x60457f[_0xdd4530(0x19a)]+_0xdd4530(0x1cf)+getErrorMessage(_0x44aa37),_0x44aa37);}return _0x54f9ad;},_0x397a79=await batchAsync(_0x2dfb7c,_0x478426,_0x144844),_0xc10ec9={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3da26b of _0x397a79){_0xc10ec9[_0x3c12cf(0x1ac)]+=_0x3da26b[_0x3c12cf(0x1ac)],_0xc10ec9[_0x3c12cf(0x1a3)]+=_0x3da26b[_0x3c12cf(0x1a3)],_0x3da26b[_0x3c12cf(0x1da)]&&_0xc10ec9['createdSegmentIds'][_0x3c12cf(0x1de)](_0x3da26b[_0x3c12cf(0x1da)][_0x3c12cf(0x19e)],_0x3da26b[_0x3c12cf(0x1da)]['id']),_0xc10ec9[_0x3c12cf(0x1ef)][_0x3c12cf(0x1ac)]+=_0x3da26b[_0x3c12cf(0x1ef)]['created'],_0xc10ec9[_0x3c12cf(0x1ef)]['updated']+=_0x3da26b[_0x3c12cf(0x1ef)][_0x3c12cf(0x1a3)],_0xc10ec9[_0x3c12cf(0x1ef)][_0x3c12cf(0x1a8)]+=_0x3da26b['activations'][_0x3c12cf(0x1a8)];}return _0xc10ec9;}async function syncActivationsForSegment(_0x4d6159,_0x4aa800,_0x153f48,_0x38b844,_0x14ef03,_0x5e639b,_0x3ad70d){const _0x472aa1=a101_0x109af2,_0x2e145b={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3a8ef2 of _0x14ef03){try{if(_0x3a8ef2[_0x472aa1(0x1b0)]===_0x472aa1(0x207)&&_0x3a8ef2[_0x472aa1(0x1a2)])_0x5e639b['onProgress']?.({'type':'activation_creating','segmentName':_0x38b844,'activationName':_0x3a8ef2[_0x472aa1(0x19e)]}),await _0x5e639b[_0x472aa1(0x245)](_0x472aa1(0x18f)+_0x3a8ef2['name']+_0x472aa1(0x1f8),()=>_0x4d6159[_0x472aa1(0x22b)][_0x472aa1(0x234)](_0x4aa800,_0x153f48,_0x3a8ef2[_0x472aa1(0x1a2)])),_0x5e639b['onProgress']?.({'type':_0x472aa1(0x1ca),'segmentName':_0x38b844,'activationName':_0x3a8ef2['name']}),_0x5e639b[_0x472aa1(0x22a)]?.('Created\x20activation\x20\x27'+_0x3a8ef2[_0x472aa1(0x19e)]+'\x27'),_0x2e145b['created']++;else{if(_0x3a8ef2[_0x472aa1(0x1b0)]==='update'&&_0x3a8ef2[_0x472aa1(0x1a2)]&&_0x3a8ef2[_0x472aa1(0x249)])_0x5e639b[_0x472aa1(0x178)]?.({'type':_0x472aa1(0x236),'segmentName':_0x38b844,'activationName':_0x3a8ef2['name']}),await _0x5e639b[_0x472aa1(0x245)]('Updating\x20activation\x20\x27'+_0x3a8ef2[_0x472aa1(0x19e)]+'\x27...',()=>_0x4d6159[_0x472aa1(0x22b)]['updateActivation'](_0x4aa800,_0x153f48,_0x3a8ef2[_0x472aa1(0x249)]['id'],_0x3a8ef2[_0x472aa1(0x1a2)])),_0x5e639b[_0x472aa1(0x178)]?.({'type':_0x472aa1(0x211),'segmentName':_0x38b844,'activationName':_0x3a8ef2[_0x472aa1(0x19e)]}),_0x5e639b['logSuccess']?.('Updated\x20activation\x20\x27'+_0x3a8ef2['name']+'\x27'),_0x2e145b[_0x472aa1(0x1a3)]++;else _0x3a8ef2[_0x472aa1(0x1b0)]===_0x472aa1(0x1b9)&&_0x3a8ef2[_0x472aa1(0x249)]&&(_0x5e639b[_0x472aa1(0x178)]?.({'type':_0x472aa1(0x24d),'segmentName':_0x38b844,'activationName':_0x3a8ef2[_0x472aa1(0x19e)]}),await _0x5e639b[_0x472aa1(0x245)]('Deleting\x20activation\x20\x27'+_0x3a8ef2[_0x472aa1(0x19e)]+_0x472aa1(0x1f8),()=>_0x4d6159['segment']['deleteActivation'](_0x4aa800,_0x153f48,_0x3a8ef2['existingActivation']['id'])),_0x5e639b['onProgress']?.({'type':'activation_deleted','segmentName':_0x38b844,'activationName':_0x3a8ef2[_0x472aa1(0x19e)]}),_0x5e639b[_0x472aa1(0x1e3)]?.(_0x472aa1(0x1fb)+_0x3a8ef2[_0x472aa1(0x19e)]+'\x27'),_0x2e145b['deleted']++);}}catch(_0xe41c9e){const _0x44fd90=isHttp400Error(_0xe41c9e),_0x2125d6=_0x44fd90?ErrorCode[_0x472aa1(0x235)]:ErrorCode[_0x472aa1(0x195)],_0x49a0f3=getErrorMessage(_0xe41c9e);throw new SDKError(_0x2125d6,_0x472aa1(0x1b6)+_0x3a8ef2[_0x472aa1(0x1b0)]+'\x20activation\x20\x27'+_0x3a8ef2[_0x472aa1(0x19e)]+'\x27\x20from\x20file:\x20'+_0x3ad70d+_0x472aa1(0x1cf)+_0x49a0f3,_0xe41c9e);}}return _0x2e145b;}export async function executePushFolders(_0x37aa19,_0x5f1007,_0x44f719,_0x504508,_0x2ea1d5){const _0x56749a=a101_0x109af2,_0x163d4b=new Map(_0x44f719);for(const _0x3d6c1e of _0x5f1007){const _0x273c3c=_0x3d6c1e[_0x56749a(0x240)]('/'),_0x26f81c=_0x273c3c[_0x273c3c['length']-0x1],_0x25f1aa=_0x273c3c[_0x56749a(0x1b5)](0x0,-0x1)['join']('/'),_0x30a1d8=_0x163d4b[_0x56749a(0x1bd)](_0x25f1aa);_0x2ea1d5[_0x56749a(0x178)]?.({'type':_0x56749a(0x198),'folder':_0x3d6c1e});const _0x8dde94={'name':_0x26f81c,'parentFolderId':_0x30a1d8},_0x15baa5=await _0x2ea1d5['withProgress'](_0x56749a(0x1a1)+_0x3d6c1e+_0x56749a(0x1f8),()=>_0x37aa19[_0x56749a(0x22b)][_0x56749a(0x1a4)](_0x504508[_0x56749a(0x1ab)],_0x8dde94));_0x163d4b['set'](_0x3d6c1e,_0x15baa5['data']['id']),_0x2ea1d5[_0x56749a(0x178)]?.({'type':_0x56749a(0x17b),'folder':_0x3d6c1e,'folderId':_0x15baa5[_0x56749a(0x1a7)]['id']}),_0x2ea1d5[_0x56749a(0x1a6)]?.(_0x56749a(0x222)+_0x3d6c1e+'\x27');}return _0x163d4b;}export async function executePushSegmentDeletions(_0x2c9a06,_0x130545,_0x49dd99){const _0x444bbe=a101_0x109af2;if(_0x130545[_0x444bbe(0x242)]===0x0)return 0x0;const {batchAsync:_0x7ecd}=await import(_0x444bbe(0x1b2)),_0x12e3cd=0x5,_0x1dc36b=await _0x7ecd(_0x130545,async _0x425b0f=>{const _0x31ece7=_0x444bbe;return _0x49dd99[_0x31ece7(0x178)]?.({'type':'segment_deleting','name':_0x425b0f[_0x31ece7(0x19e)]}),await _0x2c9a06[_0x31ece7(0x22b)]['deleteSegment'](_0x425b0f['id']),_0x49dd99['onProgress']?.({'type':_0x31ece7(0x1e9),'name':_0x425b0f[_0x31ece7(0x19e)]}),_0x49dd99[_0x31ece7(0x1e3)]?.(_0x31ece7(0x1d2)+_0x425b0f[_0x31ece7(0x19e)]+'\x27'),0x1;},_0x12e3cd);return _0x1dc36b[_0x444bbe(0x1ec)]((_0xe26f2c,_0x52d98d)=>_0xe26f2c+_0x52d98d,0x0);}export async function executePushJourneys(_0x599253,_0x414c84,_0x4335c5,_0x5e22ce,_0x635f29){const _0x41e1d3=a101_0x109af2,{journeyDefToRequest:_0x122b12}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x14f1b4,yamlRuleToApi:_0x2b3c49,validateSegmentRule:_0x543ce3}=await import(_0x41e1d3(0x1d5)),_0x175526={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x53846f=new Map(_0x4335c5[_0x41e1d3(0x22f)]),_0x65e1bb=0x5;for(let _0x127928=0x0;_0x127928<_0x414c84[_0x41e1d3(0x242)];_0x127928+=_0x65e1bb){const _0x41e1e2=_0x414c84[_0x41e1d3(0x1b5)](_0x127928,_0x127928+_0x65e1bb),_0x4fcc0c=await Promise['all'](_0x41e1e2[_0x41e1d3(0x1ee)](async _0x52aaf4=>{const _0x57c0de=_0x41e1d3;if(!_0x52aaf4[_0x57c0de(0x225)]&&!_0x52aaf4[_0x57c0de(0x1fa)])return{'action':'unchanged','name':_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)],'journeyId':_0x52aaf4[_0x57c0de(0x17d)]?.['id']};const _0x5c56c3=_0x52aaf4[_0x57c0de(0x1d8)]?_0x4335c5['folderPathToId'][_0x57c0de(0x1bd)](_0x52aaf4['folderPath']):undefined;_0x635f29[_0x57c0de(0x178)]?.({'type':_0x52aaf4[_0x57c0de(0x225)]?_0x57c0de(0x224):'journey_updating','name':_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)]});try{const _0x120e00=await executeSingleJourneyPush(_0x599253,_0x52aaf4,{..._0x4335c5,'segmentNameToId':_0x53846f},{'parentId':_0x5e22ce[_0x57c0de(0x1ab)],'rootFolderId':_0x5e22ce['rootFolderId'],'folderId':_0x5c56c3,'verbose':_0x5e22ce[_0x57c0de(0x184)]},_0x635f29,{'journeyDefToRequest':_0x122b12,'activationDefToCreateRequest':_0x14f1b4,'yamlRuleToApi':_0x2b3c49,'validateSegmentRule':_0x543ce3});for(const [_0x4bf876,_0xdbb2f7]of _0x120e00[_0x57c0de(0x20a)]){_0x53846f[_0x57c0de(0x1de)](_0x4bf876,_0xdbb2f7),_0x175526[_0x57c0de(0x20a)][_0x57c0de(0x1de)](_0x4bf876,_0xdbb2f7);}if(_0x120e00[_0x57c0de(0x24a)]===_0x57c0de(0x1ac))_0x635f29[_0x57c0de(0x178)]?.({'type':_0x57c0de(0x200),'name':_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)],'journeyId':_0x120e00[_0x57c0de(0x24c)]}),_0x635f29[_0x57c0de(0x22a)]?.('Created\x20journey\x20\x27'+_0x52aaf4[_0x57c0de(0x181)]['name']+'\x27'),_0x175526[_0x57c0de(0x1ac)]++;else _0x120e00[_0x57c0de(0x24a)]===_0x57c0de(0x1a3)&&(_0x635f29['onProgress']?.({'type':'journey_updated','name':_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)]}),_0x635f29[_0x57c0de(0x22a)]?.('Updated\x20journey\x20\x27'+_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)]+'\x27'),_0x175526[_0x57c0de(0x1a3)]++);return{'action':_0x120e00[_0x57c0de(0x24a)],'name':_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)],'journeyId':_0x120e00['journeyId']};}catch(_0x3dfb85){const _0x23ff06=isHttp400Error(_0x3dfb85),_0x3dcfa0=_0x23ff06?ErrorCode[_0x57c0de(0x1d9)]:ErrorCode[_0x57c0de(0x18e)],_0x4b4a76=getErrorMessage(_0x3dfb85);throw new SDKError(_0x3dcfa0,_0x57c0de(0x1b6)+(_0x52aaf4[_0x57c0de(0x225)]?_0x57c0de(0x207):_0x57c0de(0x210))+'\x20journey\x20from\x20file:\x20'+_0x52aaf4[_0x57c0de(0x19a)]+_0x57c0de(0x1cf)+_0x4b4a76,_0x3dfb85);}}));_0x175526[_0x41e1d3(0x247)][_0x41e1d3(0x228)](..._0x4fcc0c);}return _0x175526;}async function executeSingleJourneyPush(_0x4bf59d,_0x2fa15a,_0xa73651,_0x40b266,_0x5cf2f3,_0x54b520){const _0x62cfa5=a101_0x109af2,{journeyDefToRequest:_0x2aa6e5,activationDefToCreateRequest:_0x3dba68,yamlRuleToApi:_0xedda1a,validateSegmentRule:_0x5904ce}=_0x54b520,_0x252342=new Map(),_0x231256=new Map(),_0x5b0044=new Map(),_0x28bbc1=new Map(),_0x30c476=new Map();let _0x355293;const _0x37daec=async()=>{const _0x5741f1=a101_0x383a;if(_0x355293)return;_0x355293=new Map();if(!_0x2fa15a['existingJourney'])return;const _0x3fae6f=await _0x4bf59d[_0x5741f1(0x218)][_0x5741f1(0x220)](_0x2fa15a[_0x5741f1(0x17d)]['id']);for(const _0x999eec of _0x3fae6f){const _0x55e5d5=journeyActivationStepToYaml(_0x999eec,_0xa73651['idToEmailMap'],_0xa73651[_0x5741f1(0x24b)]),_0x25a88b=activationSignature(_0x55e5d5);!_0x355293[_0x5741f1(0x21f)](_0x25a88b)&&_0x355293[_0x5741f1(0x1de)](_0x25a88b,_0x999eec['id']),_0x55e5d5[_0x5741f1(0x19e)]&&_0x231256['set'](_0x55e5d5[_0x5741f1(0x19e)],_0x999eec['id']);}};if(_0x2fa15a[_0x62cfa5(0x17d)]&&_0x2fa15a[_0x62cfa5(0x181)]['segments']){const _0x4a8e64=buildLocalExpandedRuleMappings(_0x2fa15a[_0x62cfa5(0x181)]),_0xfe573f=_0x4a8e64['localSegmentRules'];if(_0xfe573f[_0x62cfa5(0x1c1)]>0x0){const _0x381309=new Map();for(const [_0x47857a,_0x17187b]of _0xfe573f){const _0x43f5c7=serializeExpandedRule(_0x17187b,_0xfe573f);_0x381309[_0x62cfa5(0x1de)](_0x47857a,_0x43f5c7);}const _0x494c05=collectSegmentIdsFromJourneyApi(_0x2fa15a[_0x62cfa5(0x17d)]);if(_0x494c05[_0x62cfa5(0x1c1)]>0x0){const _0xcc9bde=await buildServerSegmentRuleMap(_0x4bf59d,_0x40b266['parentId'],_0xa73651[_0x62cfa5(0x201)],_0x494c05);if(_0xcc9bde[_0x62cfa5(0x1c1)]>0x0){const _0x397f39=new Map();for(const [_0x13cfa9,_0xd15338]of _0xcc9bde){const _0x313b05=serializeExpandedRule(_0xd15338,_0xcc9bde);!_0x397f39[_0x62cfa5(0x21f)](_0x313b05)&&_0x397f39[_0x62cfa5(0x1de)](_0x313b05,_0x13cfa9);}for(const [_0x4e6781,_0x5f0c28]of _0x381309){const _0x5375bd=_0x397f39[_0x62cfa5(0x1bd)](_0x5f0c28);_0x5375bd&&(_0x30c476['set'](_0x4e6781,_0x5375bd),_0xa73651[_0x62cfa5(0x22f)][_0x62cfa5(0x1de)](_0x4e6781,_0x5375bd));}}}}}const _0x569414={'resolveSegmentId':async _0x5e192b=>{const _0x489588=_0x62cfa5,_0x5c7b03=_0xa73651['segmentNameToId']['get'](_0x5e192b);if(!_0x5c7b03)throw new SDKError(ErrorCode[_0x489588(0x19f)],_0x489588(0x20c)+_0x5e192b+_0x489588(0x1ce)+_0x2fa15a[_0x489588(0x181)][_0x489588(0x19e)]+')');return _0x5c7b03;},'resolveEmbeddedSegmentId':async(_0x1713f5,_0x1281d8)=>{const _0x3f3d92=_0x62cfa5,_0x1e65f6=_0xa73651[_0x3f3d92(0x22f)][_0x3f3d92(0x1bd)](_0x1713f5);if(_0x1e65f6)return _0x1e65f6;const _0x4b1f89=_0x30c476['get'](_0x1713f5);if(_0x4b1f89)return _0xa73651['segmentNameToId'][_0x3f3d92(0x1de)](_0x1713f5,_0x4b1f89),_0x4b1f89;const _0x3521ed=_0xa73651[_0x3f3d92(0x201)]['find'](_0x351523=>_0x351523[_0x3f3d92(0x19e)]===_0x1713f5);if(_0x3521ed)return _0xa73651[_0x3f3d92(0x22f)]['set'](_0x1713f5,_0x3521ed['id']),_0x3521ed['id'];if(_0x2fa15a[_0x3f3d92(0x225)]){const {stageName:_0x59c5a3,criteriaName:_0x50b527}=findSegmentCriteriaLocation(_0x2fa15a[_0x3f3d92(0x181)],_0x1713f5);return _0x5904ce(_0x1713f5,_0x1281d8[_0x3f3d92(0x19b)]),_0x5b0044[_0x3f3d92(0x1de)](_0x1713f5,{'definition':_0x1281d8,'stageName':_0x59c5a3,'criteriaName':_0x50b527}),createPendingSegmentId(_0x1713f5);}const _0x53ef87=_0x2fa15a['existingJourney']?.['id'];if(!_0x53ef87)throw new SDKError(ErrorCode[_0x3f3d92(0x23c)],_0x3f3d92(0x1be));_0x5904ce(_0x1713f5,_0x1281d8[_0x3f3d92(0x19b)]);const _0x3b908f=generateDeterministicJourneySegmentName(_0x2fa15a[_0x3f3d92(0x181)][_0x3f3d92(0x19e)],_0x1713f5),_0x287b7b=_0xa73651[_0x3f3d92(0x201)][_0x3f3d92(0x17c)](_0x6a458f=>_0x6a458f[_0x3f3d92(0x19e)]===_0x3b908f),_0x288b08=createSegmentIdResolver(_0xa73651[_0x3f3d92(0x22f)],_0x1713f5),_0x178229=await resolveRuleSegmentIds(_0x1281d8[_0x3f3d92(0x19b)],_0x288b08);let _0x55421f;if(_0x287b7b)await _0x4bf59d[_0x3f3d92(0x22b)]['updateSegmentById'](_0x40b266[_0x3f3d92(0x1ab)],_0x287b7b['id'],{'description':_0x1281d8['description']||_0x3f3d92(0x1db)+_0x1713f5,'rule':_0xedda1a(_0x178229,!![]),'countPopulation':!![]}),_0x55421f=_0x287b7b['id'];else try{_0x55421f=await _0x4bf59d['segment']['createJourneySegment']({'name':_0x3b908f,'description':_0x1281d8[_0x3f3d92(0x19c)]||_0x3f3d92(0x1db)+_0x1713f5,'journeyId':_0x53ef87,'rule':_0xedda1a(_0x178229,!![]),'countPopulation':!![],'parentFolderId':_0x40b266['rootFolderId']||'','audienceId':_0x40b266[_0x3f3d92(0x1ab)]});}catch(_0x21a160){const _0x5b4431=_0x21a160 instanceof Error&&_0x21a160[_0x3f3d92(0x1ae)][_0x3f3d92(0x1cc)](_0x3f3d92(0x206));if(_0x5b4431){const _0x242f4c=await _0x4bf59d[_0x3f3d92(0x22b)][_0x3f3d92(0x21b)](_0x40b266[_0x3f3d92(0x1ab)]),_0x2c9bdf=_0x242f4c[_0x3f3d92(0x17c)](_0x543443=>_0x543443[_0x3f3d92(0x19e)]===_0x3b908f);if(_0x2c9bdf)await _0x4bf59d[_0x3f3d92(0x22b)][_0x3f3d92(0x221)](_0x40b266['parentId'],_0x2c9bdf['id'],{'description':_0x1281d8[_0x3f3d92(0x19c)]||_0x3f3d92(0x1db)+_0x1713f5,'rule':_0xedda1a(_0x178229,!![]),'countPopulation':!![]}),_0x55421f=_0x2c9bdf['id'];else throw _0x21a160;}else throw _0x21a160;}return _0xa73651[_0x3f3d92(0x22f)][_0x3f3d92(0x1de)](_0x1713f5,_0x55421f),_0x252342[_0x3f3d92(0x1de)](_0x1713f5,_0x55421f),_0x55421f;},'resolveActivationId':async _0x5469db=>{const _0x5d5e84=_0x62cfa5,_0x2133b8=_0x231256['get'](_0x5469db);if(_0x2133b8)return _0x2133b8;if(_0x2fa15a[_0x5d5e84(0x17d)]){await _0x37daec();const _0x5d2b08=_0x231256[_0x5d5e84(0x1bd)](_0x5469db);if(_0x5d2b08)return _0x5d2b08;}throw new SDKError(ErrorCode[_0x5d5e84(0x232)],_0x5d5e84(0x1e4)+_0x5469db+_0x5d5e84(0x1ce)+_0x2fa15a[_0x5d5e84(0x181)][_0x5d5e84(0x19e)]+').\x20'+_0x5d5e84(0x1c3));},'resolveEmbeddedActivationId':async(_0x4a244d,_0x2bd862)=>{const _0x48df42=_0x62cfa5,_0xbe0339=_0x231256[_0x48df42(0x1bd)](_0x4a244d);if(_0xbe0339)return _0xbe0339;if(_0x2fa15a[_0x48df42(0x225)])return _0x28bbc1[_0x48df42(0x1de)](_0x4a244d,_0x2bd862),createPendingActivationId(_0x4a244d);if(_0x2fa15a['existingJourney']){await _0x37daec();const _0x1405a2=_0x231256[_0x48df42(0x1bd)](_0x2bd862['name']);if(_0x1405a2)return _0x231256[_0x48df42(0x1de)](_0x4a244d,_0x1405a2),_0x1405a2;const _0x316bc1=activationSignature(_0x2bd862),_0x3789c4=_0x355293?.[_0x48df42(0x1bd)](_0x316bc1);if(_0x3789c4)return _0x231256[_0x48df42(0x1de)](_0x4a244d,_0x3789c4),_0x3789c4;const _0x395cbc=await _0x3dba68(_0x2bd862,_0xa73651[_0x48df42(0x17e)]),_0x281bc8=await _0x4bf59d[_0x48df42(0x218)]['createActivation'](_0x2fa15a[_0x48df42(0x17d)]['id'],_0x395cbc);return _0x231256[_0x48df42(0x1de)](_0x4a244d,_0x281bc8['id']),_0x281bc8['id'];}throw new SDKError(ErrorCode[_0x48df42(0x23c)],_0x48df42(0x23b));},'resolveJourneyId':async _0x12ebd0=>{const _0x4d536d=_0x62cfa5;try{return await _0x4bf59d[_0x4d536d(0x218)][_0x4d536d(0x192)](_0x40b266[_0x4d536d(0x1ab)],_0x12ebd0);}catch(_0x4f7310){throw new SDKError(ErrorCode['NOT_FOUND'],_0x4d536d(0x212)+_0x12ebd0+_0x4d536d(0x219)+_0x2fa15a[_0x4d536d(0x181)]['name']+'\x27)',_0x4f7310);}},'resolveStageId':async(_0x17b2f1,_0x33d2ea)=>{const _0x13025b=_0x62cfa5,_0x318745=await _0x4bf59d[_0x13025b(0x218)][_0x13025b(0x1a9)](_0x17b2f1),_0x11e66a=_0x318745[_0x13025b(0x230)][_0x13025b(0x22e)]['find'](_0x4315c4=>_0x4315c4[_0x13025b(0x19e)]['toLowerCase']()===_0x33d2ea[_0x13025b(0x1b4)]());if(!_0x11e66a?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x13025b(0x205)+_0x33d2ea+_0x13025b(0x1dc)+(_0x318745[_0x13025b(0x230)]['journeyBundleName']||_0x318745[_0x13025b(0x230)][_0x13025b(0x19e)])+'\x27');return _0x11e66a['id'];}},_0x103755=await _0x2aa6e5(_0x2fa15a[_0x62cfa5(0x181)],_0x40b266['parentId'],_0x569414),_0x94c81=_0x40b266[_0x62cfa5(0x229)]||_0x40b266['rootFolderId'];_0x94c81&&(_0x103755[_0x62cfa5(0x1d0)]={'parentFolder':{'data':{'id':_0x94c81,'type':_0x62cfa5(0x188)}}});if(_0x2fa15a['isNew']){if(_0x5b0044[_0x62cfa5(0x1c1)]>0x0||_0x28bbc1[_0x62cfa5(0x1c1)]>0x0)return await executeThreeStepJourneyCreate(_0x4bf59d,_0x2fa15a,_0x103755,{'pendingEmbeddedSegments':_0x5b0044,'pendingEmbeddedActivations':_0x28bbc1,'embeddedSegmentNameToId':_0x252342,'journeyActivationNameToId':_0x231256},{..._0x40b266,'effectiveFolderId':_0x94c81},_0xa73651,_0x5cf2f3,_0x54b520);else{ensureJourneyDefaults(_0x103755['attributes']);const _0x13aa00=await _0x4bf59d[_0x62cfa5(0x218)][_0x62cfa5(0x207)](_0x103755);return{'action':_0x62cfa5(0x1ac),'journeyId':_0x13aa00['id'],'embeddedSegmentNameToId':_0x252342};}}else{if(_0x2fa15a[_0x62cfa5(0x1fa)]&&_0x2fa15a['existingJourney'])return ensureJourneyDefaults(_0x103755[_0x62cfa5(0x230)]),await _0x4bf59d[_0x62cfa5(0x218)][_0x62cfa5(0x210)](_0x2fa15a[_0x62cfa5(0x17d)]['id'],_0x103755),{'action':'updated','journeyId':_0x2fa15a[_0x62cfa5(0x17d)]['id'],'embeddedSegmentNameToId':_0x252342};}return{'action':'unchanged','journeyId':_0x2fa15a[_0x62cfa5(0x17d)]?.['id'],'embeddedSegmentNameToId':_0x252342};}function findSegmentCriteriaLocation(_0x23b4cc,_0xf89e6a){const _0x3b6a82=a101_0x109af2,_0x40aee5=_0x23b4cc[_0x3b6a82(0x1f4)]||_0x23b4cc['journeys']?.[0x0]?.[_0x3b6a82(0x1f4)]||[];let _0x1a48cc=_0x3b6a82(0x252),_0x2879cc=_0xf89e6a;const _0x139dfb=_0x23b4cc[_0x3b6a82(0x180)]||_0x23b4cc[_0x3b6a82(0x186)]?.[0x0]?.[_0x3b6a82(0x180)];if(_0x139dfb?.[_0x3b6a82(0x22b)]===_0xf89e6a)return{'stageName':_0x3b6a82(0x180),'criteriaName':_0x139dfb[_0x3b6a82(0x19e)]||_0xf89e6a};_0x4bce79:for(const _0x25dccd of _0x40aee5){if(_0x25dccd[_0x3b6a82(0x253)]?.[_0x3b6a82(0x22b)]===_0xf89e6a){_0x1a48cc=_0x25dccd[_0x3b6a82(0x19e)],_0x2879cc=_0x25dccd[_0x3b6a82(0x253)][_0x3b6a82(0x19e)]||_0xf89e6a;break;}if(_0x25dccd[_0x3b6a82(0x216)])for(const _0x1002f0 of _0x25dccd[_0x3b6a82(0x216)]){if(_0x1002f0[_0x3b6a82(0x1b0)]==='decision_point'&&_0x1002f0[_0x3b6a82(0x23f)]?.['branches'])for(const _0x4ee642 of _0x1002f0[_0x3b6a82(0x23f)][_0x3b6a82(0x246)]){if(_0x4ee642[_0x3b6a82(0x22b)]===_0xf89e6a){_0x1a48cc=_0x25dccd[_0x3b6a82(0x19e)],_0x2879cc=_0x4ee642[_0x3b6a82(0x19e)]||_0xf89e6a;break _0x4bce79;}}}}return{'stageName':_0x1a48cc,'criteriaName':_0x2879cc};}async function executeThreeStepJourneyCreate(_0x4df074,_0x1b3041,_0x175e2a,_0x40d035,_0x5ad487,_0xa29d31,_0x5b4809,_0x11cdfb){const _0x308762=a101_0x109af2,{activationDefToCreateRequest:_0x8cef71,yamlRuleToApi:_0x98d49b}=_0x11cdfb,{pendingEmbeddedSegments:_0x39c123,pendingEmbeddedActivations:_0x56d35a,embeddedSegmentNameToId:_0x394abb}=_0x40d035,_0x4828d9=JSON['parse'](JSON[_0x308762(0x226)](_0x175e2a));ensureJourneyDefaults(_0x4828d9[_0x308762(0x230)]),stripPendingIds(_0x4828d9);const _0x3b807b=await _0x4df074[_0x308762(0x218)][_0x308762(0x207)](_0x4828d9),_0x58917b=_0x3b807b['id'],_0x3cf4ba=new Map();for(const _0x1c494b of _0x3b807b[_0x308762(0x230)][_0x308762(0x22e)]){_0x3cf4ba['set'](_0x1c494b['name'][_0x308762(0x1b4)](),_0x1c494b['id']);}for(const [_0x5b915f,{definition:_0x4161cc}]of _0x39c123){const _0x4a4179=generateDeterministicJourneySegmentName(_0x1b3041[_0x308762(0x181)][_0x308762(0x19e)],_0x5b915f);_0x5b4809[_0x308762(0x178)]?.({'type':_0x308762(0x20e),'journeyName':_0x1b3041['yamlConfig']['name'],'segmentName':_0x5b915f});const _0x7cefc=createSegmentIdResolver(_0xa29d31[_0x308762(0x22f)],_0x5b915f),_0x167499=await resolveRuleSegmentIds(_0x4161cc['rule'],_0x7cefc),_0x5eee43=await _0x4df074[_0x308762(0x22b)]['createJourneySegment']({'name':_0x4a4179,'description':_0x4161cc[_0x308762(0x19c)]||_0x308762(0x1db)+_0x5b915f,'journeyId':_0x58917b,'rule':_0x98d49b(_0x167499,!![]),'countPopulation':!![],'parentFolderId':_0x5ad487[_0x308762(0x248)]||'','audienceId':_0x5ad487[_0x308762(0x1ab)]});_0x394abb[_0x308762(0x1de)](_0x5b915f,_0x5eee43),_0xa29d31['segmentNameToId']['set'](_0x5b915f,_0x5eee43),_0x5b4809[_0x308762(0x178)]?.({'type':_0x308762(0x1bc),'journeyName':_0x1b3041[_0x308762(0x181)][_0x308762(0x19e)],'segmentName':_0x5b915f});}const _0x2f0ad2=new Map();for(const [_0x344c6a,_0xdae58b]of _0x56d35a){_0x5b4809['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x1b3041[_0x308762(0x181)][_0x308762(0x19e)],'activationName':_0x344c6a});const _0x10072d=await _0x8cef71(_0xdae58b,_0xa29d31[_0x308762(0x17e)]),_0xd75cbc=await _0x4df074['journey'][_0x308762(0x234)](_0x58917b,_0x10072d);_0x2f0ad2[_0x308762(0x1de)](_0x344c6a,_0xd75cbc['id']),_0x40d035[_0x308762(0x223)]['set'](_0x344c6a,_0xd75cbc['id']),_0x5b4809[_0x308762(0x178)]?.({'type':'embedded_activation_created','journeyName':_0x1b3041[_0x308762(0x181)]['name'],'activationName':_0x344c6a});}const _0x4b4ebe=JSON[_0x308762(0x250)](JSON['stringify'](_0x175e2a));return _0x4b4ebe['id']=_0x58917b,ensureJourneyDefaults(_0x4b4ebe['attributes']),resolvePendingIdsInRequest(_0x4b4ebe,_0x175e2a,_0x3cf4ba,_0x394abb,_0x2f0ad2,_0x5b4809),await _0x4df074[_0x308762(0x218)][_0x308762(0x210)](_0x58917b,_0x4b4ebe),{'action':'created','journeyId':_0x58917b,'embeddedSegmentNameToId':_0x394abb};}function stripPendingIds(_0x433082){const _0x16687f=a101_0x109af2;for(const _0x5a7539 of _0x433082[_0x16687f(0x230)][_0x16687f(0x22e)]||[]){_0x5a7539['entryCriteria']?.[_0x16687f(0x24e)]&&isPendingSegmentId(_0x5a7539['entryCriteria'][_0x16687f(0x24e)])&&delete _0x5a7539[_0x16687f(0x239)];if(_0x5a7539['steps'])for(const _0x4c642d of Object['keys'](_0x5a7539['steps'])){const _0x455f8f=_0x5a7539[_0x16687f(0x216)][_0x4c642d];_0x455f8f[_0x16687f(0x1b0)]===_0x16687f(0x208)&&_0x455f8f[_0x16687f(0x23e)]&&isPendingActivationId(_0x455f8f[_0x16687f(0x23e)])&&(_0x455f8f[_0x16687f(0x23e)]='');if(_0x455f8f[_0x16687f(0x1b0)]===_0x16687f(0x1b3)&&_0x455f8f['branches'])for(const _0x4ec413 of _0x455f8f[_0x16687f(0x246)]){_0x4ec413[_0x16687f(0x24e)]&&isPendingSegmentId(_0x4ec413[_0x16687f(0x24e)])&&(_0x4ec413[_0x16687f(0x24e)]='');}_0x455f8f[_0x16687f(0x1b0)]===_0x16687f(0x1f2)&&_0x455f8f[_0x16687f(0x1c2)]?.[_0x16687f(0x24e)]&&isPendingSegmentId(_0x455f8f['waitCondition']['segmentId'])&&(_0x455f8f[_0x16687f(0x1c2)][_0x16687f(0x24e)]='');}}}function resolvePendingIdsInRequest(_0x4644f2,_0x425fe5,_0x29f19d,_0x322be1,_0xdaf25,_0x296a89){const _0x4e21b2=a101_0x109af2,_0x4d191a=(_0x24beba,_0x4382fc)=>{const _0x26e97f=a101_0x383a;if(!isPendingSegmentId(_0x24beba))return _0x24beba;const _0x88a564=extractPendingSegmentName(_0x24beba),_0xb30bc8=_0x322be1['get'](_0x88a564);return!_0xb30bc8&&_0x296a89[_0x26e97f(0x18c)]?.(_0x26e97f(0x1c4)+_0x88a564+_0x26e97f(0x1f1)+_0x4382fc),_0xb30bc8;};if(_0x4644f2[_0x4e21b2(0x230)][_0x4e21b2(0x180)]?.[_0x4e21b2(0x24e)]&&isPendingSegmentId(_0x4644f2[_0x4e21b2(0x230)][_0x4e21b2(0x180)][_0x4e21b2(0x24e)])){const _0x3af999=_0x4d191a(_0x4644f2[_0x4e21b2(0x230)][_0x4e21b2(0x180)][_0x4e21b2(0x24e)],_0x4e21b2(0x20d));_0x3af999&&(_0x4644f2['attributes'][_0x4e21b2(0x180)][_0x4e21b2(0x24e)]=_0x3af999);}for(const _0x32dcef of _0x4644f2[_0x4e21b2(0x230)][_0x4e21b2(0x22e)]||[]){const _0x449d99=_0x29f19d[_0x4e21b2(0x1bd)](_0x32dcef[_0x4e21b2(0x19e)][_0x4e21b2(0x1b4)]());_0x449d99&&(_0x32dcef['id']=_0x449d99);if(_0x32dcef[_0x4e21b2(0x239)]?.['segmentId']&&isPendingSegmentId(_0x32dcef['entryCriteria'][_0x4e21b2(0x24e)])){const _0x400fb9=_0x4d191a(_0x32dcef['entryCriteria']['segmentId'],_0x4e21b2(0x21c)+_0x32dcef[_0x4e21b2(0x19e)]+'\x27\x20entry\x20criteria');_0x400fb9&&(_0x32dcef[_0x4e21b2(0x239)]['segmentId']=_0x400fb9);}if(_0x32dcef[_0x4e21b2(0x1c6)])for(const _0x5d8b82 of _0x32dcef['exitCriterias']){if(_0x5d8b82['segmentId']&&isPendingSegmentId(_0x5d8b82['segmentId'])){const _0x55a0b2=_0x4d191a(_0x5d8b82['segmentId'],'stage\x20\x27'+_0x32dcef[_0x4e21b2(0x19e)]+_0x4e21b2(0x214));_0x55a0b2&&(_0x5d8b82[_0x4e21b2(0x24e)]=_0x55a0b2);}}if(_0x32dcef['milestone']?.['segmentId']&&isPendingSegmentId(_0x32dcef[_0x4e21b2(0x18d)][_0x4e21b2(0x24e)])){const _0x1cb915=_0x4d191a(_0x32dcef['milestone'][_0x4e21b2(0x24e)],_0x4e21b2(0x21c)+_0x32dcef[_0x4e21b2(0x19e)]+_0x4e21b2(0x194));_0x1cb915&&(_0x32dcef[_0x4e21b2(0x18d)][_0x4e21b2(0x24e)]=_0x1cb915);}if(_0x32dcef['steps']){const _0x532798=_0x4b3053=>_0x425fe5[_0x4e21b2(0x230)][_0x4e21b2(0x22e)][_0x4e21b2(0x17c)](_0x33959e=>_0x33959e['name']['toLowerCase']()===_0x32dcef[_0x4e21b2(0x19e)][_0x4e21b2(0x1b4)]())?.[_0x4e21b2(0x216)]?.[_0x4b3053];for(const _0x4b2c6e of Object[_0x4e21b2(0x1f0)](_0x32dcef[_0x4e21b2(0x216)])){const _0xa36b1c=_0x32dcef[_0x4e21b2(0x216)][_0x4b2c6e],_0x192130=_0x532798(_0x4b2c6e);if(_0xa36b1c['type']===_0x4e21b2(0x208)&&_0xa36b1c[_0x4e21b2(0x23e)]&&(isPendingActivationId(_0xa36b1c[_0x4e21b2(0x23e)])||_0xa36b1c[_0x4e21b2(0x23e)]==='')){if(_0x192130?.[_0x4e21b2(0x23e)]&&isPendingActivationId(_0x192130[_0x4e21b2(0x23e)])){const _0x5e0317=extractPendingActivationName(_0x192130['journeyActivationStepId']),_0x5c21bb=_0xdaf25[_0x4e21b2(0x1bd)](_0x5e0317);_0x5c21bb&&(_0xa36b1c[_0x4e21b2(0x23e)]=_0x5c21bb);}}if(_0xa36b1c[_0x4e21b2(0x1b0)]===_0x4e21b2(0x1b3)&&_0xa36b1c[_0x4e21b2(0x246)]&&_0x192130?.[_0x4e21b2(0x246)])for(let _0x579a46=0x0;_0x579a46<_0xa36b1c[_0x4e21b2(0x246)][_0x4e21b2(0x242)];_0x579a46++){const _0x3df8ae=_0xa36b1c[_0x4e21b2(0x246)][_0x579a46],_0x3e494e=_0x192130['branches'][_0x579a46];if(_0x3e494e?.[_0x4e21b2(0x24e)]&&isPendingSegmentId(_0x3e494e[_0x4e21b2(0x24e)])){const _0x4887d2=_0x4d191a(_0x3e494e[_0x4e21b2(0x24e)],_0x4e21b2(0x21c)+_0x32dcef[_0x4e21b2(0x19e)]+_0x4e21b2(0x1cb)+(_0x3df8ae[_0x4e21b2(0x19e)]||_0x579a46)+'\x27');_0x4887d2&&(_0x3df8ae[_0x4e21b2(0x24e)]=_0x4887d2);}}if(_0xa36b1c[_0x4e21b2(0x1b0)]==='WaitStep'&&_0xa36b1c[_0x4e21b2(0x1c2)]?.['segmentId']&&_0x192130?.['waitCondition']?.[_0x4e21b2(0x24e)]&&isPendingSegmentId(_0x192130[_0x4e21b2(0x1c2)][_0x4e21b2(0x24e)])){const _0x394f8d=_0x4d191a(_0x192130['waitCondition'][_0x4e21b2(0x24e)],_0x4e21b2(0x21c)+_0x32dcef[_0x4e21b2(0x19e)]+_0x4e21b2(0x190));_0x394f8d&&(_0xa36b1c[_0x4e21b2(0x1c2)][_0x4e21b2(0x24e)]=_0x394f8d);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x14b4db,_0x3029b5){const _0x19e18f=a102_0x4034,_0x3f5aec=_0x14b4db();while(!![]){try{const _0x1ecc99=parseInt(_0x19e18f(0x114))/0x1+-parseInt(_0x19e18f(0x119))/0x2+-parseInt(_0x19e18f(0x118))/0x3+parseInt(_0x19e18f(0x11c))/0x4+-parseInt(_0x19e18f(0x117))/0x5+-parseInt(_0x19e18f(0x116))/0x6*(-parseInt(_0x19e18f(0x11b))/0x7)+-parseInt(_0x19e18f(0x11e))/0x8;if(_0x1ecc99===_0x3029b5)break;else _0x3f5aec['push'](_0x3f5aec['shift']());}catch(_0x44b2b8){_0x3f5aec['push'](_0x3f5aec['shift']());}}}(a102_0x197d,0x1d3cc));export function buildFolderIdToPathMap(_0x30666c){const _0x38f10a=a102_0x4034,_0x39c5b3=new Map(),_0x115d68=new Map();for(const _0x10849b of _0x30666c){_0x115d68[_0x38f10a(0x113)](_0x10849b['id'],_0x10849b);}const _0xbcf4cb=new Set();for(const _0x58f63e of _0x30666c){!_0x58f63e[_0x38f10a(0x11d)]&&_0xbcf4cb[_0x38f10a(0x115)](_0x58f63e['id']);}function _0x1fe282(_0x42b903){const _0x2e4542=_0x38f10a;if(_0x39c5b3[_0x2e4542(0x11f)](_0x42b903['id']))return _0x39c5b3[_0x2e4542(0x11a)](_0x42b903['id']);if(_0xbcf4cb['has'](_0x42b903['id']))return _0x39c5b3[_0x2e4542(0x113)](_0x42b903['id'],''),'';if(_0x42b903[_0x2e4542(0x11d)]){const _0x24a151=_0x115d68[_0x2e4542(0x11a)](_0x42b903[_0x2e4542(0x11d)]);if(_0x24a151){const _0x42f8d3=_0x1fe282(_0x24a151),_0x32af4e=_0x42f8d3?_0x42f8d3+'/'+_0x42b903[_0x2e4542(0x112)]:_0x42b903['name'];return _0x39c5b3[_0x2e4542(0x113)](_0x42b903['id'],_0x32af4e),_0x32af4e;}}const _0x56eea9=_0x42b903[_0x2e4542(0x112)];return _0x39c5b3[_0x2e4542(0x113)](_0x42b903['id'],_0x56eea9),_0x56eea9;}for(const _0x4f539e of _0x30666c){_0x1fe282(_0x4f539e);}return _0x39c5b3;}function a102_0x197d(){const _0x14a9f9=['get','7NbAhSe','679576SOFUpv','parentFolderId','319096YqLRlA','has','name','set','48934kCJzMF','add','1184916ICJpeM','227470YaMImi','53700XiNgbD','386554ppGAYL'];a102_0x197d=function(){return _0x14a9f9;};return a102_0x197d();}export function buildFolderPathToIdMap(_0x3d8655){const _0xa0bea0=a102_0x4034,_0x1a1022=new Map(),_0x4f8fc0=new Map();for(const _0x5cdda3 of _0x3d8655){_0x4f8fc0[_0xa0bea0(0x113)](_0x5cdda3['id'],_0x5cdda3);}const _0x384df1=new Set();for(const _0x2a5047 of _0x3d8655){!_0x2a5047[_0xa0bea0(0x11d)]&&_0x384df1[_0xa0bea0(0x115)](_0x2a5047['id']);}function _0x183160(_0x35d90b){const _0x3a849e=_0xa0bea0;if(_0x384df1[_0x3a849e(0x11f)](_0x35d90b['id']))return'';if(_0x35d90b[_0x3a849e(0x11d)]){const _0x238e07=_0x4f8fc0[_0x3a849e(0x11a)](_0x35d90b[_0x3a849e(0x11d)]);if(_0x238e07){const _0x1dc51e=_0x183160(_0x238e07);return _0x1dc51e?_0x1dc51e+'/'+_0x35d90b[_0x3a849e(0x112)]:_0x35d90b[_0x3a849e(0x112)];}}return _0x35d90b['name'];}for(const _0x516b0a of _0x3d8655){const _0x4b92dc=_0x183160(_0x516b0a);_0x1a1022[_0xa0bea0(0x113)](_0x4b92dc,_0x516b0a['id']);}return _0x1a1022;}function a102_0x4034(_0x36ecfa,_0x41113c){_0x36ecfa=_0x36ecfa-0x112;const _0x197d0b=a102_0x197d();let _0x4034fd=_0x197d0b[_0x36ecfa];return _0x4034fd;}export function buildFolderMaps(_0x327edc){const _0x1ed26e=a102_0x4034,_0x4d9a18=buildFolderIdToPathMap(_0x327edc),_0x4f143c=new Map();for(const [_0x3d40d2,_0x228983]of _0x4d9a18){_0x4f143c[_0x1ed26e(0x113)](_0x228983,_0x3d40d2);}return{'idToPath':_0x4d9a18,'pathToId':_0x4f143c};}export function getFolderPath(_0x59bc91,_0x56d668){const _0x29bfa2=a102_0x4034;if(!_0x59bc91)return'';return _0x56d668[_0x29bfa2(0x11a)](_0x59bc91)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2e1dbc,_0x1c9521){const _0x100dc3=a103_0x5be8,_0x552251=_0x2e1dbc();while(!![]){try{const _0x3ff1a2=parseInt(_0x100dc3(0x18f))/0x1*(parseInt(_0x100dc3(0x17b))/0x2)+parseInt(_0x100dc3(0x180))/0x3*(parseInt(_0x100dc3(0x172))/0x4)+-parseInt(_0x100dc3(0x16e))/0x5*(parseInt(_0x100dc3(0x18d))/0x6)+parseInt(_0x100dc3(0x16c))/0x7+parseInt(_0x100dc3(0x170))/0x8*(-parseInt(_0x100dc3(0x182))/0x9)+-parseInt(_0x100dc3(0x16d))/0xa+parseInt(_0x100dc3(0x19f))/0xb*(-parseInt(_0x100dc3(0x17a))/0xc);if(_0x3ff1a2===_0x1c9521)break;else _0x552251['push'](_0x552251['shift']());}catch(_0x108d11){_0x552251['push'](_0x552251['shift']());}}}(a103_0x2c72,0x9543d));import a103_0x3b572e from'path';import{parse as a103_0x5c8ac4}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a103_0x5be8(_0x26bfd4,_0x344bf8){_0x26bfd4=_0x26bfd4-0x16c;const _0x2c720c=a103_0x2c72();let _0x5be8ed=_0x2c720c[_0x26bfd4];return _0x5be8ed;}function a103_0x2c72(){const _0x3b902c=['2476jZHsDa','replace','length','Cannot\x20navigate\x20above\x20root','slice','split','startsWith','Path\x20segment\x20cannot\x20be\x20empty','24OCsjCo','6ScPbxv','endsWith','join','filter','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','4857VXdFCD','resolve','6183666BhUdnd','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Path\x20attempts\x20to\x20navigate\x20above\x20root','type','parse','name','root','relative','segments','push','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','963162xMMppC','No\x20tdx.json\x20found\x20for\x20file:\x20','365683KGpnZW','raw','trim','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','readFile','isAbsolute','Path\x20cannot\x20be\x20empty','pop','tdx.json','substring','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','parent_segment','dirname','test','.yaml','journey','1878547ZNHsCX','exists','6254143quBYpm','2289530QxIEUW','35uNnNuW','segment','8yGgyYM','.yml'];a103_0x2c72=function(){return _0x3b902c;};return a103_0x2c72();}export function parsePath(_0x710e96){const _0x4d99c8=a103_0x5be8;if(!_0x710e96||_0x710e96[_0x4d99c8(0x191)]()==='')throw new Error(_0x4d99c8(0x195));const _0x22b5e7=_0x710e96['trim']();if(_0x22b5e7==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x710e96};const _0x4dcaec=_0x22b5e7['startsWith']('/')?_0x22b5e7[_0x4d99c8(0x198)](0x1):_0x22b5e7,_0x57376a=_0x4dcaec[_0x4d99c8(0x177)]('/')[_0x4d99c8(0x17e)](_0xbc3f0f=>_0xbc3f0f!=='');if(_0x57376a[_0x4d99c8(0x174)]===0x0)throw new Error(_0x4d99c8(0x18c));const _0x10d552=_0x22b5e7[_0x4d99c8(0x178)]('/')||!isRelativePathSegment(_0x57376a[0x0]);for(const _0x37da0b of _0x57376a){validatePathSegment(_0x37da0b);}return{'segments':_0x57376a,'isAbsolute':_0x10d552,'raw':_0x710e96};}function isRelativePathSegment(_0xd4bc8a){return _0xd4bc8a==='.'||_0xd4bc8a==='..';}function validatePathSegment(_0x346a7e){const _0x54ccb5=a103_0x5be8;if(_0x346a7e==='')throw new Error(_0x54ccb5(0x179));if(_0x346a7e==='.'||_0x346a7e==='..')return;if(/[\x00-\x1F\x7F]/[_0x54ccb5(0x19c)](_0x346a7e))throw new Error(_0x54ccb5(0x192)+_0x346a7e);if(_0x346a7e!==_0x346a7e[_0x54ccb5(0x191)]()){}}export function validatePath(_0x66cafe){const _0x223211=a103_0x5be8;if(_0x66cafe['segments'][_0x223211(0x174)]===0x0&&!_0x66cafe[_0x223211(0x194)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x66cafe[_0x223211(0x194)]){if(_0x66cafe[_0x223211(0x18a)][0x0]==='..')throw new Error(_0x223211(0x199));let _0x100a0c=0x0;for(const _0x514b4c of _0x66cafe[_0x223211(0x18a)]){if(_0x514b4c==='..'){if(_0x100a0c===0x0)throw new Error(_0x223211(0x184));_0x100a0c--;}else _0x514b4c!=='.'&&_0x100a0c++;}}}export function joinPaths(_0x186953,_0x1d4098){const _0xb57147=a103_0x5be8;if(!_0x186953||_0x186953==='/')return _0x1d4098;if(!_0x1d4098||_0x1d4098==='.')return _0x186953;if(_0x1d4098[_0xb57147(0x178)]('/'))return _0x1d4098;const _0x462894=parsePath(_0x186953),_0x415066=parsePath(_0x1d4098),_0x59ec68=[..._0x462894[_0xb57147(0x18a)]];for(const _0x3f970d of _0x415066[_0xb57147(0x18a)]){if(_0x3f970d==='.')continue;else{if(_0x3f970d==='..'){if(_0x59ec68[_0xb57147(0x174)]===0x0)throw new Error(_0xb57147(0x175));_0x59ec68[_0xb57147(0x196)]();}else _0x59ec68['push'](_0x3f970d);}}const _0x2bdd18=_0x59ec68[_0xb57147(0x17d)]('/');return _0x462894[_0xb57147(0x190)]['startsWith']('/')?'/'+_0x2bdd18:_0x2bdd18;}export function normalizePath(_0x42b1f2){const _0x2d2119=a103_0x5be8,_0x4165f7=parsePath(_0x42b1f2),_0x5c2e9d=[];for(const _0x3500ea of _0x4165f7[_0x2d2119(0x18a)]){if(_0x3500ea==='.')continue;else{if(_0x3500ea==='..'){if(_0x5c2e9d['length']===0x0){if(_0x4165f7[_0x2d2119(0x194)])throw new Error(_0x2d2119(0x175));_0x5c2e9d[_0x2d2119(0x18b)]('..');}else _0x5c2e9d[_0x5c2e9d[_0x2d2119(0x174)]-0x1]==='..'?_0x5c2e9d[_0x2d2119(0x18b)]('..'):_0x5c2e9d[_0x2d2119(0x196)]();}else _0x5c2e9d[_0x2d2119(0x18b)](_0x3500ea);}}if(_0x5c2e9d[_0x2d2119(0x174)]===0x0)return _0x4165f7[_0x2d2119(0x194)]?'/':'.';const _0x50dd2d=_0x5c2e9d[_0x2d2119(0x17d)]('/');return _0x4165f7[_0x2d2119(0x190)][_0x2d2119(0x178)]('/')?'/'+_0x50dd2d:_0x50dd2d;}export function getParentPath(_0x360fc7){const _0x22db04=a103_0x5be8,_0x4a0499=parsePath(_0x360fc7);if(_0x4a0499[_0x22db04(0x18a)][_0x22db04(0x174)]<=0x1)return'/';const _0x406f83=_0x4a0499[_0x22db04(0x18a)]['slice'](0x0,-0x1)[_0x22db04(0x17d)]('/');return _0x4a0499[_0x22db04(0x190)][_0x22db04(0x178)]('/')?'/'+_0x406f83:_0x406f83;}export function getBaseName(_0x5f4edc){const _0x4d6911=a103_0x5be8,_0x7faf29=parsePath(_0x5f4edc);return _0x7faf29['segments'][_0x7faf29[_0x4d6911(0x18a)][_0x4d6911(0x174)]-0x1]||'';}export function isChildPath(_0x3fb3ef,_0x416f51){const _0x5b98ea=a103_0x5be8,_0x5a59c9=parsePath(_0x3fb3ef),_0x1a4190=parsePath(_0x416f51);if(_0x5a59c9['segments'][_0x5b98ea(0x174)]<=_0x1a4190[_0x5b98ea(0x18a)][_0x5b98ea(0x174)])return![];for(let _0x1d39c9=0x0;_0x1d39c9<_0x1a4190[_0x5b98ea(0x18a)][_0x5b98ea(0x174)];_0x1d39c9++){if(_0x5a59c9[_0x5b98ea(0x18a)][_0x1d39c9]!==_0x1a4190[_0x5b98ea(0x18a)][_0x1d39c9])return![];}return!![];}export function splitPath(_0x137e86){const _0x5f3182=a103_0x5be8,_0x2d862e=parsePath(_0x137e86);if(_0x2d862e[_0x5f3182(0x18a)][_0x5f3182(0x174)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x2d862e[_0x5f3182(0x18a)][_0x5f3182(0x174)]===0x1)return{'parent':_0x2d862e['segments'][0x0]};return{'parent':_0x2d862e[_0x5f3182(0x18a)][0x0],'child':_0x2d862e['segments'][_0x5f3182(0x176)](0x1)[_0x5f3182(0x17d)]('/')};}export function isYamlFilePath(_0x152391){const _0x47fc48=a103_0x5be8;return _0x152391[_0x47fc48(0x17c)](_0x47fc48(0x171))||_0x152391[_0x47fc48(0x17c)](_0x47fc48(0x19d));}export async function resolveYamlFilePath(_0x2de8cd,_0x42914d=nodeFileSystem){const _0x28c5b4=a103_0x5be8,_0x212f8b=a103_0x3b572e[_0x28c5b4(0x181)](_0x2de8cd);if(!await _0x42914d['exists'](_0x212f8b))throw new Error('File\x20not\x20found:\x20'+_0x2de8cd);let _0x1fb575=a103_0x3b572e[_0x28c5b4(0x19b)](_0x212f8b),_0x1cb5ad=null,_0x329bdd=null;const _0x5dbf57=a103_0x3b572e['parse'](_0x1fb575)[_0x28c5b4(0x188)];while(_0x1fb575!==_0x5dbf57){const _0x125234=a103_0x3b572e[_0x28c5b4(0x17d)](_0x1fb575,_0x28c5b4(0x197));if(await _0x42914d[_0x28c5b4(0x1a0)](_0x125234)){_0x1cb5ad=_0x125234,_0x329bdd=_0x1fb575;break;}_0x1fb575=a103_0x3b572e[_0x28c5b4(0x19b)](_0x1fb575);}if(!_0x1cb5ad||!_0x329bdd)throw new Error(_0x28c5b4(0x18e)+_0x2de8cd);const _0x1281aa=await _0x42914d['readFile'](_0x1cb5ad),_0x4328e4=JSON[_0x28c5b4(0x186)](_0x1281aa),_0x55ead4=_0x4328e4[_0x28c5b4(0x19a)];if(!_0x55ead4)throw new Error(_0x28c5b4(0x17f));const _0x25b9ba=await _0x42914d[_0x28c5b4(0x193)](_0x212f8b),_0x416356=a103_0x5c8ac4(_0x25b9ba),_0x35e8d2=_0x416356[_0x28c5b4(0x187)];if(!_0x35e8d2)throw new Error(_0x28c5b4(0x183)+_0x2de8cd);const _0x236833=_0x416356[_0x28c5b4(0x185)]===_0x28c5b4(0x19e)?_0x28c5b4(0x19e):_0x28c5b4(0x16f),_0x525418=a103_0x3b572e[_0x28c5b4(0x189)](_0x329bdd,_0x212f8b),_0x3586ef=a103_0x3b572e[_0x28c5b4(0x19b)](_0x525418),_0x5e20ea=_0x3586ef==='.'?'':_0x3586ef[_0x28c5b4(0x173)](/\\/g,'/'),_0x28f5a0=_0x5e20ea?_0x55ead4+'/'+_0x5e20ea+'/'+_0x35e8d2:_0x55ead4+'/'+_0x35e8d2;return{'parentSegment':_0x55ead4,'segmentName':_0x35e8d2,'folderPath':_0x5e20ea,'fullPath':_0x28f5a0,'resourceType':_0x236833};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x40928a,_0x592df8){const _0x34b818=a104_0x4079,_0xdbd12d=_0x40928a();while(!![]){try{const _0x144c0d=-parseInt(_0x34b818(0x13b))/0x1+parseInt(_0x34b818(0x13d))/0x2*(-parseInt(_0x34b818(0x130))/0x3)+-parseInt(_0x34b818(0x137))/0x4+parseInt(_0x34b818(0x131))/0x5*(-parseInt(_0x34b818(0x133))/0x6)+parseInt(_0x34b818(0x135))/0x7+parseInt(_0x34b818(0x13c))/0x8*(parseInt(_0x34b818(0x139))/0x9)+parseInt(_0x34b818(0x134))/0xa*(parseInt(_0x34b818(0x136))/0xb);if(_0x144c0d===_0x592df8)break;else _0xdbd12d['push'](_0xdbd12d['shift']());}catch(_0x3008a0){_0xdbd12d['push'](_0xdbd12d['shift']());}}}(a104_0x2c37,0xb0ebb));function a104_0x2c37(){const _0x4be2c0=['336VpwYzp','790694RWDkHn','Invalid\x20segment\x20reference\x20format:\x20','3bDTsRi','5RIpKFY','.\x20Child\x20name\x20cannot\x20be\x20empty','5494098zIOAYK','13810tiTcwh','3229751ilceTd','12023enSoIS','939344htsUDP','.\x20Parent\x20name\x20cannot\x20be\x20empty','89550AyojfV','substring','118193kbsOng'];a104_0x2c37=function(){return _0x4be2c0;};return a104_0x2c37();}function a104_0x4079(_0x5c5f1e,_0x52d0e2){_0x5c5f1e=_0x5c5f1e-0x130;const _0x2c3793=a104_0x2c37();let _0x4079d2=_0x2c3793[_0x5c5f1e];return _0x4079d2;}export function parseSegmentRef(_0x57c693){const _0x300098=a104_0x4079,_0x684def=_0x57c693['indexOf']('/');if(_0x684def===-0x1)return{'parentId':_0x57c693};if(_0x684def===0x0)throw new Error(_0x300098(0x13e)+_0x57c693+_0x300098(0x138));const _0x37941c=_0x57c693['substring'](0x0,_0x684def),_0x5947b2=_0x57c693[_0x300098(0x13a)](_0x684def+0x1);if(_0x5947b2==='')throw new Error(_0x300098(0x13e)+_0x57c693+_0x300098(0x132));return{'parentId':_0x37941c,'childId':_0x5947b2};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x39838b,_0x5dca25){const _0x4715fa=a105_0x53aa,_0x41a406=_0x39838b();while(!![]){try{const _0x2c2d75=parseInt(_0x4715fa(0x17f))/0x1+-parseInt(_0x4715fa(0x16b))/0x2+-parseInt(_0x4715fa(0x182))/0x3+-parseInt(_0x4715fa(0x15f))/0x4+-parseInt(_0x4715fa(0x162))/0x5+-parseInt(_0x4715fa(0x178))/0x6*(-parseInt(_0x4715fa(0x169))/0x7)+-parseInt(_0x4715fa(0x163))/0x8*(-parseInt(_0x4715fa(0x177))/0x9);if(_0x2c2d75===_0x5dca25)break;else _0x41a406['push'](_0x41a406['shift']());}catch(_0x534c11){_0x41a406['push'](_0x41a406['shift']());}}}(a105_0x34be,0x7e72a));import a105_0x174a45 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0xd9ded1){const _0x55d4d2=a105_0x53aa;return _0xd9ded1[_0x55d4d2(0x164)]!==_0x55d4d2(0x188);}export function isScopedResolution(_0x6de9f8){const _0x412baa=a105_0x53aa;return _0x6de9f8['type']===_0x412baa(0x170)||_0x6de9f8[_0x412baa(0x164)]===_0x412baa(0x187)||_0x6de9f8[_0x412baa(0x164)]===_0x412baa(0x16d);}export function getScopedDetails(_0x39ae7d){const _0x6e8f01=a105_0x53aa;if(isScopedResolution(_0x39ae7d))return{'isScoped':_0x39ae7d[_0x6e8f01(0x165)],'scopedFolderPath':_0x39ae7d[_0x6e8f01(0x15d)]};return undefined;}function a105_0x34be(){const _0x2e88c9=['Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','message','scopedFolderPath','segmentName','1101332wvxAzD','folderPath','join','3515150PwafVR','121496LaMmNI','type','isScoped','parentSegment','trim','File\x20not\x20found:\x20','973aVgVhj','extname','363724hXnFkk','Parent\x20segment\x20not\x20specified','context','parse','invalid_yaml','directory','segment','tdx.json','resourceType','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parent_segment','basename','486vcYNaq','31716GeAtGZ','configDir','no_config','isFile','dirname','readFile','isDirectory','435217XGTbMa','match','exists','935742falGWq','includes','relative','resolve','replace','file','error','journey','No\x20tdx.json\x20found','startsWith','root','No\x20tdx.json\x20found\x20for\x20file:\x20','parent_name'];a105_0x34be=function(){return _0x2e88c9;};return a105_0x34be();}async function findTdxConfigAsync(_0x206411,_0x2f022c){const _0x48f631=a105_0x53aa;let _0x53b2bd=a105_0x174a45[_0x48f631(0x185)](_0x206411);const _0x35875f=a105_0x174a45[_0x48f631(0x16e)](_0x53b2bd)[_0x48f631(0x158)];while(_0x53b2bd!==_0x35875f){const _0x4aaaa6=a105_0x174a45[_0x48f631(0x161)](_0x53b2bd,_0x48f631(0x172));if(await _0x2f022c[_0x48f631(0x181)](_0x4aaaa6))try{const _0x8d37e0=await _0x2f022c[_0x48f631(0x17d)](_0x4aaaa6),_0x110b1f=JSON[_0x48f631(0x16e)](_0x8d37e0);if(_0x110b1f[_0x48f631(0x175)]&&typeof _0x110b1f[_0x48f631(0x175)]==='string')return{'configPath':_0x4aaaa6,'configDir':_0x53b2bd,'parentSegment':_0x110b1f[_0x48f631(0x175)]};}catch{}_0x53b2bd=a105_0x174a45[_0x48f631(0x17c)](_0x53b2bd);}return null;}function calculateScopedPath(_0x4cf1f8,_0x5d74ce){const _0x428ccb=a105_0x53aa,_0x38e61e=a105_0x174a45[_0x428ccb(0x184)](_0x5d74ce,_0x4cf1f8),_0x23d5b0=_0x38e61e!==''&&_0x38e61e!=='.'&&!_0x38e61e[_0x428ccb(0x157)]('..');return{'isScoped':_0x23d5b0,'scopedFolderPath':_0x23d5b0?_0x38e61e[_0x428ccb(0x186)](/\\/g,'/'):''};}function a105_0x53aa(_0x3e5aa0,_0x552a45){_0x3e5aa0=_0x3e5aa0-0x156;const _0x34be13=a105_0x34be();let _0x53aa48=_0x34be13[_0x3e5aa0];return _0x53aa48;}export async function resolveTarget(_0x1bedc7){const _0x4f350f=a105_0x53aa,{arg:_0xc7c93c,contextParent:_0x402e6c,cwd:cwd=process['cwd'](),fs:fs=nodeFileSystem}=_0x1bedc7;if(_0xc7c93c&&isYamlFilePath(_0xc7c93c))try{const _0x40410f=await resolveYamlFilePath(_0xc7c93c,fs),_0x391db5=a105_0x174a45[_0x4f350f(0x185)](_0xc7c93c),_0x8a1b9d=a105_0x174a45['dirname'](_0x391db5),_0x46c1c1=await findTdxConfigAsync(_0x8a1b9d,fs);if(!_0x46c1c1){if(_0x402e6c){const _0x448849=a105_0x174a45[_0x4f350f(0x17c)](_0x391db5);return{'type':'file','parentName':_0x402e6c,'targetDir':_0x448849,'configRoot':_0x448849,'filePath':_0x391db5,'resourceName':_0x40410f['segmentName'],'folderPath':_0x40410f[_0x4f350f(0x160)],'resourceType':_0x40410f[_0x4f350f(0x173)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x4f350f(0x188),'errorCode':_0x4f350f(0x17a),'message':_0x4f350f(0x159)+_0xc7c93c,'arg':_0xc7c93c,'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 _0x5191a1=calculateScopedPath(_0x8a1b9d,_0x46c1c1[_0x4f350f(0x179)]);return{'type':_0x4f350f(0x187),'parentName':_0x46c1c1[_0x4f350f(0x166)],'targetDir':_0x46c1c1[_0x4f350f(0x179)],'configRoot':_0x46c1c1[_0x4f350f(0x179)],'filePath':_0x391db5,'resourceName':_0x40410f[_0x4f350f(0x15e)],'folderPath':_0x40410f['folderPath'],'resourceType':_0x40410f[_0x4f350f(0x173)],'isScoped':_0x5191a1[_0x4f350f(0x165)],'scopedFolderPath':_0x5191a1[_0x4f350f(0x15d)]};}catch(_0x39c14d){const _0xd10e0d=_0x39c14d instanceof Error?_0x39c14d[_0x4f350f(0x15c)]:String(_0x39c14d);if(_0xd10e0d[_0x4f350f(0x183)]('File\x20not\x20found'))return{'type':_0x4f350f(0x188),'errorCode':'file_not_found','message':_0x4f350f(0x168)+_0xc7c93c,'arg':_0xc7c93c};if(_0xd10e0d[_0x4f350f(0x183)](_0x4f350f(0x156))){if(_0x402e6c){const _0x5167d6=a105_0x174a45['resolve'](_0xc7c93c);if(await fs[_0x4f350f(0x181)](_0x5167d6)){const _0x44a187=a105_0x174a45[_0x4f350f(0x17c)](_0x5167d6),_0xed1d40=await fs[_0x4f350f(0x17d)](_0x5167d6),_0x941b60=_0xed1d40['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x2b49d5=_0xed1d40[_0x4f350f(0x180)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x471f82=_0x941b60?_0x941b60[0x1]['trim']():a105_0x174a45[_0x4f350f(0x176)](_0xc7c93c,a105_0x174a45[_0x4f350f(0x16a)](_0xc7c93c)),_0x4de858=_0x2b49d5&&_0x2b49d5[0x1][_0x4f350f(0x167)]()===_0x4f350f(0x189)?_0x4f350f(0x189):_0x4f350f(0x171);return{'type':'file','parentName':_0x402e6c,'targetDir':_0x44a187,'configRoot':_0x44a187,'filePath':_0x5167d6,'resourceName':_0x471f82,'folderPath':'','resourceType':_0x4de858,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x4f350f(0x188),'errorCode':'no_config','message':_0x4f350f(0x159)+_0xc7c93c,'arg':_0xc7c93c,'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'};}return{'type':_0x4f350f(0x188),'errorCode':_0x4f350f(0x16f),'message':_0xd10e0d,'arg':_0xc7c93c};}if(_0xc7c93c){const _0xbbb8ae=a105_0x174a45[_0x4f350f(0x185)](cwd,_0xc7c93c);let _0x1fcce3=null;try{_0x1fcce3=await fs['stat'](_0xbbb8ae);}catch{}if(_0x1fcce3?.[_0x4f350f(0x17e)]()){const _0x9f96da=await findTdxConfigAsync(_0xbbb8ae,fs);if(_0x9f96da){const _0x134dc7=calculateScopedPath(_0xbbb8ae,_0x9f96da[_0x4f350f(0x179)]);return{'type':_0x4f350f(0x170),'parentName':_0x9f96da[_0x4f350f(0x166)],'targetDir':_0xbbb8ae,'configRoot':_0x9f96da[_0x4f350f(0x179)],'isScoped':_0x134dc7[_0x4f350f(0x165)],'scopedFolderPath':_0x134dc7[_0x4f350f(0x15d)]};}if(_0x402e6c)return{'type':_0x4f350f(0x170),'parentName':_0x402e6c,'targetDir':_0xbbb8ae,'configRoot':_0xbbb8ae,'isScoped':![],'scopedFolderPath':''};return{'type':_0x4f350f(0x188),'errorCode':_0x4f350f(0x17a),'message':_0x4f350f(0x174)+_0xc7c93c,'arg':_0xc7c93c,'helpText':_0x4f350f(0x15b)};}if(_0x1fcce3?.[_0x4f350f(0x17b)]())return{'type':'error','errorCode':_0x4f350f(0x16f),'message':'Not\x20a\x20YAML\x20file:\x20'+_0xc7c93c,'arg':_0xc7c93c,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x4f9085=sanitizeFileName(_0xc7c93c),_0x110496=getSegmentRootDir(_0x4f9085,cwd);return{'type':_0x4f350f(0x15a),'parentName':_0xc7c93c,'targetDir':_0x110496,'configRoot':_0x110496};}const _0x1c2eeb=await findTdxConfigAsync(cwd,fs);if(_0x1c2eeb){const _0x26f360=calculateScopedPath(cwd,_0x1c2eeb[_0x4f350f(0x179)]);return{'type':_0x4f350f(0x16d),'parentName':_0x1c2eeb['parentSegment'],'targetDir':cwd,'configRoot':_0x1c2eeb['configDir'],'isScoped':_0x26f360[_0x4f350f(0x165)],'scopedFolderPath':_0x26f360['scopedFolderPath']};}if(_0x402e6c){const _0x298d94=sanitizeFileName(_0x402e6c),_0x2c830b=getSegmentRootDir(_0x298d94,cwd);return{'type':_0x4f350f(0x16d),'parentName':_0x402e6c,'targetDir':_0x2c830b,'configRoot':_0x2c830b,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x4f350f(0x188),'errorCode':'no_parent','message':_0x4f350f(0x16c),'helpText':'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'};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a106_0x32d7(){const _0x112dcc=['tdx.json','cwd','parent_segment','root','dirname','235XcHiRb','629082WheMtg','join','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','replace','resolve','string','46148QEmtlW','Invalid\x20tdx.json:\x20expected\x20object','2228976hKTOfD','stringify','6449844dHDsdz','7XEnXXG','startsWith','parse','segments','29033847zuyHku','277034TTLFPV','5281401TWYmGn','Invalid\x20JSON\x20in\x20'];a106_0x32d7=function(){return _0x112dcc;};return a106_0x32d7();}function a106_0x4bc8(_0x45a1ec,_0x2cc605){_0x45a1ec=_0x45a1ec-0x1e9;const _0x32d794=a106_0x32d7();let _0x4bc83f=_0x32d794[_0x45a1ec];return _0x4bc83f;}const a106_0x55819c=a106_0x4bc8;(function(_0x579d0d,_0x4d3f99){const _0x3e8cca=a106_0x4bc8,_0xc57f5a=_0x579d0d();while(!![]){try{const _0x20d702=parseInt(_0x3e8cca(0x1fa))/0x1+parseInt(_0x3e8cca(0x1f1))/0x2+-parseInt(_0x3e8cca(0x1f2))/0x3+-parseInt(_0x3e8cca(0x200))/0x4*(parseInt(_0x3e8cca(0x1f9))/0x5)+-parseInt(_0x3e8cca(0x1eb))/0x6*(parseInt(_0x3e8cca(0x1ec))/0x7)+parseInt(_0x3e8cca(0x1e9))/0x8+parseInt(_0x3e8cca(0x1f0))/0x9;if(_0x20d702===_0x4d3f99)break;else _0xc57f5a['push'](_0xc57f5a['shift']());}catch(_0x48081b){_0xc57f5a['push'](_0xc57f5a['shift']());}}}(a106_0x32d7,0xda63c));import{existsSync,readFileSync}from'fs';import a106_0x3342a6 from'path';const TDX_CONFIG_FILE=a106_0x55819c(0x1f4),SEGMENTS_DIR=a106_0x55819c(0x1ef);export function findTdxConfigPath(_0x3ef899=process[a106_0x55819c(0x1f5)]()){const _0x183dfb=a106_0x55819c;let _0x4e4ace=a106_0x3342a6[_0x183dfb(0x1fe)](_0x3ef899);const _0x1a0267=a106_0x3342a6['parse'](_0x4e4ace)[_0x183dfb(0x1f7)];while(_0x4e4ace!==_0x1a0267){const _0x1b6455=a106_0x3342a6[_0x183dfb(0x1fb)](_0x4e4ace,TDX_CONFIG_FILE);if(existsSync(_0x1b6455))return _0x1b6455;_0x4e4ace=a106_0x3342a6[_0x183dfb(0x1f8)](_0x4e4ace);}return null;}export function loadTdxConfig(_0x3784a8){const _0x4f2d02=a106_0x55819c,_0x3b2450=readFileSync(_0x3784a8,'utf-8');let _0x5466d4;try{_0x5466d4=JSON[_0x4f2d02(0x1ee)](_0x3b2450);}catch{throw new Error(_0x4f2d02(0x1f3)+_0x3784a8);}if(!_0x5466d4||typeof _0x5466d4!=='object')throw new Error(_0x4f2d02(0x201));const _0x1cd0e6=_0x5466d4;if(!_0x1cd0e6[_0x4f2d02(0x1f6)]||typeof _0x1cd0e6['parent_segment']!==_0x4f2d02(0x1ff))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field');return{'parent_segment':_0x1cd0e6[_0x4f2d02(0x1f6)]};}export function findTdxConfig(_0xde12a3=process[a106_0x55819c(0x1f5)]()){const _0x3ef1ca=a106_0x55819c,_0x3d60f7=findTdxConfigPath(_0xde12a3);if(!_0x3d60f7)throw new Error(_0x3ef1ca(0x1fc));const _0x5970ab=loadTdxConfig(_0x3d60f7),_0x4ab7ab=a106_0x3342a6[_0x3ef1ca(0x1f8)](_0x3d60f7);return{'config':_0x5970ab,'configPath':_0x3d60f7,'configDir':_0x4ab7ab};}export function tryFindTdxConfig(_0xe34735){try{return findTdxConfig(_0xe34735);}catch{return null;}}export function getSegmentRootDir(_0x20d7c8,_0x273e95=process[a106_0x55819c(0x1f5)]()){return a106_0x3342a6['join'](_0x273e95,SEGMENTS_DIR,_0x20d7c8);}export function getTdxConfigPath(_0x3d3385,_0x8c1602=process['cwd']()){const _0x5762e5=a106_0x55819c;return a106_0x3342a6[_0x5762e5(0x1fb)](getSegmentRootDir(_0x3d3385,_0x8c1602),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0xb55a41,_0x3c8169){const _0x190cb4=a106_0x55819c,_0x4ab5b8=a106_0x3342a6['resolve'](_0xb55a41),_0x5dfeb1=a106_0x3342a6['relative'](_0x3c8169,_0x4ab5b8);if(_0x5dfeb1[_0x190cb4(0x1ed)]('..'))return'';return _0x5dfeb1;}export function localPathToTdFolderPath(_0x330e91){const _0xe14071=a106_0x55819c,_0x51f518=a106_0x3342a6[_0xe14071(0x1f8)](_0x330e91);if(_0x51f518==='.'||_0x51f518==='')return'';return _0x51f518[_0xe14071(0x1fd)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x16a196,_0x309ab9){const _0x21f09d=a106_0x55819c;if(!_0x16a196)return _0x309ab9;return a106_0x3342a6[_0x21f09d(0x1fb)](_0x309ab9,_0x16a196);}export function createTdxConfigContent(_0xfa624e){const _0x253c58=a106_0x55819c,_0x4cd882={'parent_segment':_0xfa624e};return JSON[_0x253c58(0x1ea)](_0x4cd882,null,0x2)+'\x0a';}
|