@treasuredata/tdx 0.23.0 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/schedule.js +1 -1
  101. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  102. package/dist/sdk/segment/fields-display.js +1 -1
  103. package/dist/sdk/segment/file-discovery.js +1 -1
  104. package/dist/sdk/segment/journey-utils.js +1 -1
  105. package/dist/sdk/segment/journey-yaml.js +1 -1
  106. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  107. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  108. package/dist/sdk/segment/pull-workflow.js +1 -1
  109. package/dist/sdk/segment/push-workflow.js +1 -1
  110. package/dist/sdk/segment/resolution-context.js +1 -1
  111. package/dist/sdk/segment/segment-path-parser.js +1 -1
  112. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  113. package/dist/sdk/segment/target-resolution.js +1 -1
  114. package/dist/sdk/segment/tdx-config.js +1 -1
  115. package/dist/sdk/segment/validate-files.js +1 -1
  116. package/dist/sdk/segment/yaml-validator.js +1 -1
  117. package/dist/sdk/segment.js +1 -1
  118. package/dist/sdk/types/index.js +1 -1
  119. package/dist/sdk/types/progress.js +1 -1
  120. package/dist/sdk/user.js +1 -1
  121. package/dist/sdk/util/format-detector.js +1 -1
  122. package/dist/sdk/util/formatters.js +1 -1
  123. package/dist/sdk/util/index.js +1 -1
  124. package/dist/sdk/util/tree-formatter.js +1 -1
  125. package/dist/sdk/workflow/archive-validation.js +1 -1
  126. package/dist/sdk/workflow/clone-workflow.js +1 -1
  127. package/dist/sdk/workflow/index.js +1 -1
  128. package/dist/sdk/workflow/pull-workflow.js +1 -1
  129. package/dist/sdk/workflow/push-workflow.js +1 -1
  130. package/dist/sdk/workflow/tdx-config.js +1 -1
  131. package/dist/sdk/workflow/workflow-utils.js +1 -1
  132. package/dist/test-utils/command-runner.js +1 -1
  133. package/dist/test-utils/factories.js +1 -1
  134. package/dist/test-utils/fixtures.js +1 -1
  135. package/dist/test-utils/http-mock.js +1 -1
  136. package/dist/test-utils/index.js +1 -1
  137. package/dist/utils/async.js +1 -1
  138. package/dist/utils/colors.js +1 -1
  139. package/dist/utils/diff.js +1 -1
  140. package/dist/utils/file-permissions.js +1 -1
  141. package/dist/utils/global-cache.js +1 -1
  142. package/dist/utils/json-loader.js +1 -1
  143. package/dist/utils/local-cache.js +1 -1
  144. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  145. package/dist/utils/logger/formatters/index.js +1 -1
  146. package/dist/utils/logger/handlers/console-handler.js +1 -1
  147. package/dist/utils/logger/handlers/file-handler.js +1 -1
  148. package/dist/utils/logger/handlers/index.js +1 -1
  149. package/dist/utils/logger/handlers/null-handler.js +1 -1
  150. package/dist/utils/logger/index.js +1 -1
  151. package/dist/utils/logger/logger.js +1 -1
  152. package/dist/utils/logger/types.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/prompt.js +1 -1
  157. package/dist/utils/spinner.js +1 -1
  158. package/dist/utils/sse-parser.js +1 -1
  159. package/dist/utils/string-utils.js +1 -1
  160. package/dist/utils/table-ref-parser.js +1 -1
  161. package/dist/utils/tdx-logger.js +1 -1
  162. package/dist/utils/version-check.js +1 -1
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- const a110_0xefe081=a110_0x50ad;(function(_0x40857c,_0x27f14a){const _0x28e62d=a110_0x50ad,_0x27117a=_0x40857c();while(!![]){try{const _0x4fbb77=parseInt(_0x28e62d(0xb0))/0x1+-parseInt(_0x28e62d(0x143))/0x2+-parseInt(_0x28e62d(0x102))/0x3+parseInt(_0x28e62d(0x7f))/0x4*(parseInt(_0x28e62d(0x113))/0x5)+-parseInt(_0x28e62d(0x118))/0x6+parseInt(_0x28e62d(0x85))/0x7+parseInt(_0x28e62d(0x11f))/0x8;if(_0x4fbb77===_0x27f14a)break;else _0x27117a['push'](_0x27117a['shift']());}catch(_0x446653){_0x27117a['push'](_0x27117a['shift']());}}}(a110_0x1273,0x884a4));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a110_0xefe081(0x13f);export const PENDING_ACTIVATION_PREFIX=a110_0xefe081(0xa2);export function createPendingSegmentId(_0x2e7793){return''+PENDING_SEGMENT_PREFIX+_0x2e7793+'__';}export function isPendingSegmentId(_0x4fc32d){return _0x4fc32d['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x1a7c91){const _0x3eca93=a110_0xefe081;return _0x1a7c91[_0x3eca93(0x134)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xe2e9f7){return''+PENDING_ACTIVATION_PREFIX+_0xe2e9f7+'__';}export function isPendingActivationId(_0x26a6d6){return _0x26a6d6['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3bb0a6){const _0x33fa55=a110_0xefe081;return _0x3bb0a6[_0x33fa55(0x134)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x16bc4d,_0x3cec5a){const _0x410ffe=a110_0xefe081,_0x4c56e2=_0x16bc4d+'::'+(_0x3cec5a[_0x410ffe(0x12c)]()||_0x410ffe(0xa6)),_0x2c929a=createHash(_0x410ffe(0x13a))[_0x410ffe(0xe1)](_0x4c56e2)[_0x410ffe(0xe3)](_0x410ffe(0x9e))[_0x410ffe(0xea)](0x0,0xc);return _0x410ffe(0x155)+_0x2c929a;}function a110_0x1273(){const _0x1e866a=['4602606rRTZgC','Entry\x20criteria:\x20','includes','relative','WaitStep','embedded_activation_creating','action','7090512dWJzjQ','keys','existingJourney','message','skipSegments','hasChanges','segment_updating','milestone','Journey\x20\x27','localSegmentRules','segment_deleted','updated','goal','trim','Activation','journeyById','draft','versionNumber','Creating\x20segment\x20\x27','sort','segmentNameToId','replace','getJourney','embedded_activation_created','SEGMENT_NOT_FOUND','connection','create','sha1','toString','\x27...','progress','segmentId','__pending_','Failed\x20to\x20','has','all','1703580ebRhaD','activations','existingSegments','Created\x20activation\x20\x27','SEGMENT_UPDATE_ERROR','columns','logDeleted','journeyStages','folderPathToId','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','SEGMENT_SYNTAX_ERROR','JOURNEY_SYNTAX_ERROR','\x20activation\x20\x27','\x27\x20from\x20file:\x20','\x27\x20for\x20','journey_created','activation_deleted','Created\x20folder\x20\x27','journey_entry_criteria_','logSuccess','results','map','find','\x27\x20exit\x20criteria','push','item','logInfo','from','activation_updated','length','updateActivation','with','14932dsdjJZ','\x20(referenced\x20in\x20journey\x20','goal\x20criteria','journeys','description','entries','6679827eYXxYL','add','onProgress','getSegment','journeyActivationStepId','data','folder','listSegments','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','entryCriteria','parentId','NOT_FOUND','ACTIVATION_SYNTAX_ERROR','parse','folder_creating','all_columns','activationContext','\x27\x20not\x20found\x20in\x20journey\x20\x27','rootFolderId','absolutePath','Created\x20journey\x20\x27','journeyBundleName','activation_template_id','join','activationsBySegmentId','hex','notification','resolveSegment','set','__pending_act_','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','folder_created','createFolder','segment','listActivations','steps','parentSegmentFolder','object','attributes','stringify','ACTIVATION_UPDATE_ERROR','\x0a\x20\x20','validatedRequest','392451rxLpAh','resolveJourneyId','yamlActivation','INTERNAL','folderId','errors','Updating\x20segment\x20\x27','./journey-yaml.js','Deleted\x20activation\x20\x27','journey','nameToType','utf-8','journey_updating','list','activation_creating','entry','./child-segment-yaml.js','isNew','JOURNEY_UPDATE_ERROR','Fetching\x20','diff','segment_creating','existingActivation','updateSegmentById','Creating\x20folder\x20\x27','connector_config','get','Segment\x20not\x20found:\x20','Deleted\x20segment\x20\x27','index','filter','activationStepsById','Updated\x20journey\x20\x27','deps','journeyBundlesByFolderAndName','stage\x20\x27','type','existingSegment','valid','unchanged','waitCondition','Updating\x20activation\x20\x27','toLowerCase','../../utils/async.js','name','\x20segment\x20from\x20file:\x20','yamlConfig','segment_created','rule','update','schedule','digest','branches','createJourneySegment','createSegment','created','state','null','slice','behavior','Creating\x20activation\x20\x27','deleted','embedded_segment_created','connectionIdToNameMap','createActivation','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','DecisionPoint','\x20journey\x20from\x20file:\x20','segment_deleting','idToEmailMap','createdSegmentIds','folderPath','embeddedSegmentNameToId','split','size','segmentFolderId','logWarning','segments','createdSegmentId','delete','startsWith','isArray','1209180rsLXkK','segmentByFolderAndName','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','fetchJourney','exitCriterias','Activation\x20not\x20found:\x20','Name\x20has\x20already\x20been\x20taken','idToName','withProgress','journey_creating','reduce','stages','relationships','getActivation','dirname','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','activation_created','465XMemGy','journey_updated','flatMap','entry_criteria','activation_updating'];a110_0x1273=function(){return _0x1e866a;};return a110_0x1273();}export function ensureJourneyDefaults(_0xda56e7){const _0xde8026=a110_0xefe081;!_0xda56e7[_0xde8026(0x83)]&&(_0xda56e7[_0xde8026(0x83)]=''),!_0xda56e7['state']&&(_0xda56e7[_0xde8026(0xe8)]=_0xde8026(0x12f));}export function resolveTDFolderPath(_0x1227a0,_0x12ddb3,_0x4caa6b){const _0x46464e=a110_0xefe081;if(!_0x12ddb3)return _0x1227a0;if(_0x1227a0===_0x4caa6b||_0x1227a0[_0x46464e(0x100)](_0x4caa6b+'/'))return _0x1227a0;return _0x1227a0?_0x4caa6b+'/'+_0x1227a0:_0x4caa6b;}export function addFoldersToCreate(_0x3217bd,_0x298306,_0x4b6cbd){const _0x371081=a110_0xefe081;if(!_0x3217bd)return;if(_0x298306[_0x371081(0x141)](_0x3217bd))return;const _0x87514b=_0x3217bd[_0x371081(0xf9)]('/');let _0x2ba103='';for(const _0x64c8f4 of _0x87514b){_0x2ba103=_0x2ba103?_0x2ba103+'/'+_0x64c8f4:_0x64c8f4,!_0x298306['has'](_0x2ba103)&&_0x4b6cbd[_0x371081(0x86)](_0x2ba103);}}import*as a110_0x3aaf13 from'yaml';import{readFileSync}from'fs';import a110_0x2492cc from'path';import{isJourneyDef,parseYamlString as a110_0x164b4a,toYamlString as a110_0x5798ea,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(_0x399daf){const _0x347467=a110_0xefe081;if(Array[_0x347467(0x101)](_0x399daf))return'['+_0x399daf[_0x347467(0x158)](_0x59b18f=>stableStringify(_0x59b18f))[_0x347467(0x9c)](',')+']';if(_0x399daf&&typeof _0x399daf===_0x347467(0xaa)){const _0x1d5f9e=_0x399daf,_0x3c2876=Object[_0x347467(0x120)](_0x1d5f9e)[_0x347467(0x132)](),_0x55d3bc=_0x3c2876[_0x347467(0x158)](_0x35bd8d=>'\x22'+_0x35bd8d+'\x22:'+stableStringify(_0x1d5f9e[_0x35bd8d]));return'{'+_0x55d3bc[_0x347467(0x9c)](',')+'}';}const _0x48457b=JSON[_0x347467(0xac)](_0x399daf);return _0x48457b===undefined?_0x347467(0xe9):_0x48457b;}function activationSignature(_0x450915){const _0x223bdd=a110_0xefe081,_0x4b354e={'connection':_0x450915['connection'],..._0x450915['all_columns']!==undefined&&{'all_columns':_0x450915[_0x223bdd(0x94)]},..._0x450915[_0x223bdd(0x148)]!==undefined&&{'columns':_0x450915['columns']},..._0x450915[_0x223bdd(0xeb)]!==undefined&&{'behavior':_0x450915[_0x223bdd(0xeb)]},..._0x450915[_0x223bdd(0xe2)]!==undefined&&{'schedule':_0x450915[_0x223bdd(0xe2)]},..._0x450915[_0x223bdd(0x9f)]!==undefined&&{'notification':_0x450915[_0x223bdd(0x9f)]},..._0x450915[_0x223bdd(0xc9)]!==undefined&&{'connector_config':_0x450915[_0x223bdd(0xc9)]},..._0x450915[_0x223bdd(0x9b)]!==undefined&&{'activation_template_id':_0x450915['activation_template_id']}};return stableStringify(_0x4b354e);}export async function prepareSegmentFiles(_0x4977a3,_0x1b651f,_0x12bde8,_0x3e7d72,_0x54b7d5){const _0x76e6ba=a110_0xefe081,{activationDefToCreateRequest:_0x5102cf}=await import(_0x76e6ba(0xc0)),_0xbb6959=[],_0x20403e=new Set();for(const {yamlConfig:_0x2eda79,folderPath:_0x598633,sourcePath:_0x1f1d97}of _0x4977a3){const _0x4416f2=resolveTDFolderPath(_0x598633,_0x3e7d72,_0x54b7d5),_0x4bb4d7=_0x4416f2+':'+_0x2eda79['name'],_0x5b3568=_0x1b651f[_0x76e6ba(0x103)][_0x76e6ba(0xca)](_0x4bb4d7),_0x5cd645=_0x5b3568?_0x1b651f[_0x76e6ba(0x9d)][_0x76e6ba(0xca)](_0x5b3568['id'])||[]:[];addFoldersToCreate(_0x4416f2,_0x1b651f[_0x76e6ba(0x14b)],_0x20403e);const _0x59a805=calculateActivationActions(_0x2eda79[_0x76e6ba(0x144)]||[],_0x5cd645,_0x1b651f[_0x76e6ba(0xf5)],_0x1b651f[_0x76e6ba(0xef)]);for(const _0x597e0c of _0x59a805){(_0x597e0c[_0x76e6ba(0xd4)]===_0x76e6ba(0x139)||_0x597e0c['type']===_0x76e6ba(0xe1))&&_0x597e0c[_0x76e6ba(0xb2)]&&(_0x597e0c[_0x76e6ba(0xaf)]=await _0x5102cf(_0x597e0c[_0x76e6ba(0xb2)],_0x12bde8));}const _0xa84a9e=calculateSegmentDiff(_0x2eda79,_0x5b3568,_0x5cd645,_0x1b651f[_0x76e6ba(0xf5)],_0x1b651f[_0x76e6ba(0xef)]);_0xbb6959[_0x76e6ba(0x15b)]({'relativePath':_0x2eda79[_0x76e6ba(0xdc)],'absolutePath':_0x1f1d97,'yamlConfig':_0x2eda79,'folderPath':_0x4416f2,'existingSegment':_0x5b3568,'existingActivations':_0x5cd645,'isNew':_0xa84a9e['isNew'],'hasChanges':_0xa84a9e[_0x76e6ba(0x124)],'diff':_0xa84a9e[_0x76e6ba(0xc4)],'activationActions':_0x59a805});}return{'segmentFiles':_0xbb6959,'foldersToCreate':_0x20403e};}function a110_0x50ad(_0x2ee583,_0x4b517b){_0x2ee583=_0x2ee583-0x7c;const _0x1273ca=a110_0x1273();let _0x50adbe=_0x1273ca[_0x2ee583];return _0x50adbe;}export async function prepareJourneyFiles(_0x2f1db6,_0x189920,_0x6357e8,_0x3392bd){const _0x3a51b8=a110_0xefe081,_0x1305a2=[],_0x786fae=new Set();for(const {yamlConfig:_0xb72e43,folderPath:_0x3137c1,sourcePath:_0xc473c1}of _0x2f1db6){const _0x1bd4a1=resolveTDFolderPath(_0x3137c1,_0x6357e8,_0x3392bd),_0x130852=_0x1bd4a1+':'+_0xb72e43[_0x3a51b8(0xdc)],_0x4b9053=_0x189920[_0x3a51b8(0xd2)][_0x3a51b8(0xca)](_0x130852);let _0x11c9ae,_0x40105f;if(_0x4b9053&&_0x4b9053[_0x3a51b8(0x7c)]>0x0){const _0x1c3ed9=buildLocalExpandedRuleMappings(_0xb72e43),{createYamlContext:_0x2b5181,prefetchJourneySegments:_0x56dde7}=createPushYamlContextForBundle(_0x189920[_0x3a51b8(0xd1)],_0x189920['parentId'],_0x189920[_0x3a51b8(0x145)],_0x1c3ed9,_0x189920[_0x3a51b8(0xf5)],_0x189920[_0x3a51b8(0xef)],_0x189920[_0x3a51b8(0xcf)],_0x189920[_0x3a51b8(0x12e)]);await _0x56dde7(_0x4b9053[_0x3a51b8(0x158)](_0x1cd029=>_0x1cd029['id']));const _0x245ea9=hasMultipleVersions(_0xb72e43),_0x313bf3=async _0x10f51a=>{const _0x27da46=_0x3a51b8,_0x2f9552=_0x189920[_0x27da46(0x12e)]?.[_0x27da46(0xca)](_0x10f51a);if(_0x2f9552)return _0x2f9552;return _0x189920[_0x27da46(0x105)]({'journeyId':_0x10f51a,'journeyName':_0xb72e43['name'],'isMultiVersion':_0x4b9053[_0x27da46(0x7c)]>0x1});};if(_0x245ea9&&_0x4b9053[_0x3a51b8(0x7c)]>0x1){const _0x1d87fc=[];for(const _0x422169 of _0x4b9053){const _0x98ee35=_0x422169['versionNumber']||0x1;_0x189920[_0x3a51b8(0x13d)]?.[_0x3a51b8(0xe1)]('Fetching\x20'+_0xb72e43[_0x3a51b8(0xdc)]+'\x20v'+_0x98ee35);const _0x409c8e=await _0x313bf3(_0x422169['id']),_0x39d494=_0x2b5181(_0x422169['id']),_0x533167=await journeyResponseToDef(_0x409c8e,_0x39d494);_0x1d87fc[_0x3a51b8(0x15b)]({'item':_0x422169,'yaml':_0x533167});}const _0x388b5c=buildLocalRuleToNameMappingFromJourney(_0xb72e43);_0x40105f=buildMergedJourneyDef(_0x1d87fc,_0x388b5c);const _0xa3d15a=Math['max'](..._0x1d87fc[_0x3a51b8(0x158)](_0x198187=>_0x198187[_0x3a51b8(0x15c)][_0x3a51b8(0x130)]||0x0)),_0x3771cc=_0x4b9053[_0x3a51b8(0x159)](_0x47689b=>(_0x47689b[_0x3a51b8(0x130)]||0x0)===_0xa3d15a);_0x3771cc&&(_0x189920['progress']?.[_0x3a51b8(0xe1)](_0x3a51b8(0xc3)+_0xb72e43[_0x3a51b8(0xdc)]+'\x20v'+_0xa3d15a),_0x11c9ae=await _0x313bf3(_0x3771cc['id']));}else{const _0x4e93c3=_0x4b9053[_0x4b9053['length']-0x1];_0x189920[_0x3a51b8(0x13d)]?.[_0x3a51b8(0xe1)]('Fetching\x20'+_0xb72e43[_0x3a51b8(0xdc)]),_0x11c9ae=await _0x313bf3(_0x4e93c3['id']);const _0x2e8c9d=_0x2b5181(_0x4e93c3['id']),_0x364bd5=await journeyResponseToDef(_0x11c9ae,_0x2e8c9d),_0x8d6608=buildLocalRuleToNameMappingFromJourney(_0xb72e43);_0x40105f=buildMergedJourneyDef([{'item':_0x4e93c3,'yaml':_0x364bd5}],_0x8d6608);}}addFoldersToCreate(_0x1bd4a1,_0x189920[_0x3a51b8(0x14b)],_0x786fae);const _0x43418b=calculateJourneyDiff(_0xb72e43,_0x40105f);_0x1305a2[_0x3a51b8(0x15b)]({'relativePath':_0xb72e43[_0x3a51b8(0xdc)],'absolutePath':_0xc473c1,'yamlConfig':_0xb72e43,'folderPath':_0x1bd4a1,'existingJourney':_0x11c9ae,'isNew':_0x43418b[_0x3a51b8(0xc1)],'hasChanges':_0x43418b[_0x3a51b8(0x124)],'diff':_0x43418b[_0x3a51b8(0xc4)]});}return{'journeyFiles':_0x1305a2,'foldersToCreate':_0x786fae};}export function calculateActivationActions(_0xb3de1e,_0x5122b2,_0x4775c2,_0xead24f){const _0x23055c=a110_0xefe081,_0x44d30f=[],_0x176cf1=new Map();for(const _0x118f9a of _0x5122b2){_0x176cf1['set'](_0x118f9a[_0x23055c(0xdc)],_0x118f9a);}const _0x139a49=new Map();for(const _0x427ade of _0xb3de1e){_0x139a49['set'](_0x427ade['name'],_0x427ade);}for(const _0x1fe0b9 of _0xb3de1e){const _0x13df69=_0x176cf1[_0x23055c(0xca)](_0x1fe0b9[_0x23055c(0xdc)]);if(!_0x13df69)_0x44d30f[_0x23055c(0x15b)]({'type':_0x23055c(0x139),'name':_0x1fe0b9[_0x23055c(0xdc)],'yamlActivation':_0x1fe0b9});else{const _0x28d418=activationResponseToDef(_0x13df69,_0x4775c2,_0xead24f),_0x39a213=a110_0x3aaf13['stringify'](_0x28d418),_0x1feb36=a110_0x3aaf13[_0x23055c(0xac)](_0x1fe0b9);_0x39a213!==_0x1feb36&&_0x44d30f['push']({'type':_0x23055c(0xe1),'name':_0x1fe0b9['name'],'yamlActivation':_0x1fe0b9,'existingActivation':_0x13df69});}}for(const _0x2af572 of _0x5122b2){!_0x139a49[_0x23055c(0x141)](_0x2af572[_0x23055c(0xdc)])&&_0x44d30f[_0x23055c(0x15b)]({'type':_0x23055c(0xff),'name':_0x2af572['name'],'existingActivation':_0x2af572});}return _0x44d30f;}export function calculateSegmentDiff(_0x5e63af,_0xafa34b,_0x24c94c,_0xbf3370,_0x10c77d){const _0x291ee6=segmentToYamlString(_0x5e63af);if(_0xafa34b){const _0x213784=segmentWithActivationsToYaml(_0xafa34b,_0x24c94c,undefined,_0xbf3370,_0x10c77d),_0x5caea7=segmentToYamlString(_0x213784),_0x1c78ce=generateDiff(_0x5caea7,_0x291ee6),_0x302992=hasChanges(_0x1c78ce);return{'isNew':![],'hasChanges':_0x302992,'diff':_0x302992?formatDiffWithColors(_0x1c78ce):undefined};}const _0x319c93=generateDiff('',_0x291ee6);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x319c93)};}export function calculateJourneyDiff(_0x3e5d58,_0x47f10a){const _0x4d69ec=normalizeJourneyDef(_0x3e5d58,_0x3e5d58),_0x1da524=a110_0x5798ea(_0x4d69ec);if(_0x47f10a){const _0x549f3f=normalizeJourneyDef(_0x47f10a,_0x3e5d58),_0x1d4c46=a110_0x5798ea(_0x549f3f),_0x31ef69=generateDiff(_0x1d4c46,_0x1da524),_0x4eace8=hasChanges(_0x31ef69);return{'isNew':![],'hasChanges':_0x4eace8,'diff':_0x4eace8?formatDiffWithColors(_0x31ef69):undefined};}const _0x6c6160=generateDiff('',_0x1da524);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x6c6160)};}export function findSegmentsToDelete(_0x5a5a9f,_0x4c9e75,_0x2cf503,_0x92cd5a,_0x46b94e){const _0x3e623f=a110_0xefe081,_0x4b482a=new Set();for(const {yamlConfig:_0x26387e,folderPath:_0x31803e}of _0x4c9e75){_0x4b482a[_0x3e623f(0x86)](_0x31803e+':'+_0x26387e[_0x3e623f(0xdc)]);}return _0x5a5a9f[_0x3e623f(0xce)](_0x45304a=>{const _0x3eeba4=_0x3e623f,_0x17230c=_0x45304a[_0x3eeba4(0xfb)]?_0x2cf503['get'](_0x45304a[_0x3eeba4(0xfb)][_0x3eeba4(0x13b)]())||'':'',_0x304458=_0x17230c+':'+_0x45304a['name'];if(_0x4b482a[_0x3eeba4(0x141)](_0x304458))return![];if(_0x46b94e)return _0x17230c===_0x92cd5a||_0x17230c[_0x3eeba4(0x100)](_0x92cd5a+'/');return!![];});}export function findJourneysToDelete(_0x5438e9,_0x1bbc25,_0x885361,_0x150868,_0x142413){const _0x346780=a110_0xefe081,_0x214a80=new Set();for(const {yamlConfig:_0x3fd830,folderPath:_0x1d9e3b}of _0x1bbc25){_0x214a80[_0x346780(0x86)](_0x1d9e3b+':'+_0x3fd830[_0x346780(0xdc)]);}return _0x5438e9[_0x346780(0xce)](_0x287935=>{const _0x5501fb=_0x346780,_0x14d0a4=_0x287935[_0x5501fb(0xb4)]?_0x885361[_0x5501fb(0xca)](_0x287935[_0x5501fb(0xb4)])||'':'',_0x4f433c=_0x14d0a4+':'+_0x287935[_0x5501fb(0x9a)];if(_0x214a80[_0x5501fb(0x141)](_0x4f433c))return![];if(_0x142413)return _0x14d0a4===_0x150868||_0x14d0a4[_0x5501fb(0x100)](_0x150868+'/');return!![];});}export function buildSegmentLookupMap(_0x5d8d5e,_0x12fd67){const _0x24361a=a110_0xefe081,_0x2d4c65=new Map();for(const _0x46df3d of _0x5d8d5e){const _0x3d8872=_0x46df3d[_0x24361a(0xfb)]?_0x12fd67['get'](_0x46df3d[_0x24361a(0xfb)][_0x24361a(0x13b)]())||'':'',_0x23f39b=_0x3d8872+':'+_0x46df3d['name'];_0x2d4c65['set'](_0x23f39b,_0x46df3d);}return _0x2d4c65;}export function buildSegmentNameToIdMap(_0x362a34){const _0x13ca2e=a110_0xefe081,_0x193162=new Map();for(const _0x357dd2 of _0x362a34){_0x193162[_0x13ca2e(0xa1)](_0x357dd2[_0x13ca2e(0xdc)],_0x357dd2['id']);}return _0x193162;}export function buildJourneyBundleLookupMap(_0x160c74,_0x36b152){const _0xad8d95=a110_0xefe081,_0x4bcff7=new Map();for(const _0x1b22c5 of _0x160c74){const _0x3bd641=_0x1b22c5['folderId']?_0x36b152[_0xad8d95(0xca)](_0x1b22c5['folderId'])||'':'',_0x36f50c=_0x3bd641+':'+_0x1b22c5['journeyBundleName'];!_0x4bcff7['has'](_0x36f50c)&&_0x4bcff7['set'](_0x36f50c,[]),_0x4bcff7['get'](_0x36f50c)[_0xad8d95(0x15b)](_0x1b22c5);}for(const _0x354123 of _0x4bcff7['values']()){_0x354123['sort']((_0x41234f,_0x56ef5d)=>(_0x41234f[_0xad8d95(0x130)]||0x0)-(_0x56ef5d['versionNumber']||0x0));}return _0x4bcff7;}export function collectFoldersToCreate(_0x5211bb,_0x424160){const _0x26b96c=a110_0xefe081,_0xd4cc28=new Set();for(const _0x3f0967 of _0x5211bb){if(!_0x3f0967)continue;if(_0x424160[_0x26b96c(0x141)](_0x3f0967))continue;const _0x5725e2=_0x3f0967[_0x26b96c(0xf9)]('/');let _0x37d937='';for(const _0x2d9975 of _0x5725e2){_0x37d937=_0x37d937?_0x37d937+'/'+_0x2d9975:_0x2d9975,!_0x424160[_0x26b96c(0x141)](_0x37d937)&&_0xd4cc28[_0x26b96c(0x86)](_0x37d937);}}return _0xd4cc28;}export function parseAndClassifyYamlFiles(_0x13d786,_0x440f58,_0x211fed){const _0x2feee8=a110_0xefe081,_0x33b88d=[],_0x5dc4db=[];for(const _0x4574b4 of _0x13d786){const _0x5decd9=a110_0x2492cc[_0x2feee8(0x11b)](_0x440f58,a110_0x2492cc[_0x2feee8(0x110)](_0x4574b4)),_0x33cecb=_0x5decd9==='.'?'':_0x5decd9,_0x5591bf=readFileSync(_0x4574b4,_0x2feee8(0xbb)),_0x2cb4ff=a110_0x3aaf13['parse'](_0x5591bf);if(isJourneyDef(_0x2cb4ff)){const _0x471b63=a110_0x164b4a(_0x5591bf);_0x5dc4db['push']({'yamlConfig':_0x471b63,'folderPath':_0x33cecb,'sourcePath':_0x4574b4});}else{if(!_0x211fed?.[_0x2feee8(0x123)]){const _0x143601=parseSegmentYamlFile(_0x5591bf),_0x3c9f8d=normalizeChildSegmentYaml(_0x143601);_0x33b88d[_0x2feee8(0x15b)]({'yamlConfig':_0x3c9f8d,'folderPath':_0x33cecb,'sourcePath':_0x4574b4});}}}return{'segments':_0x33b88d,'journeys':_0x5dc4db};}export function validateParsedFiles(_0x9907da,_0x17071b){const _0x232a6d=a110_0xefe081,_0x999d1=[];for(const {yamlConfig:_0x1bbffd,sourcePath:_0x378390}of _0x9907da[_0x232a6d(0xfd)]){const _0x1a1ef1=readFileSync(_0x378390,_0x232a6d(0xbb)),_0x53ef17=a110_0x3aaf13['parseDocument'](_0x1a1ef1),_0x2637ba=validateSegmentDef(_0x1bbffd,{'source':_0x1a1ef1,'document':_0x53ef17});if(!_0x2637ba[_0x232a6d(0xd6)]){const _0x53a152=a110_0x2492cc['relative'](_0x17071b,_0x378390);_0x999d1[_0x232a6d(0x15b)]({'filePath':_0x53a152,'source':_0x1a1ef1,'result':_0x2637ba,'isJourney':![]});}}for(const {yamlConfig:_0xfbe7bf,sourcePath:_0x531d4e}of _0x9907da[_0x232a6d(0x82)]){const _0x46bef2=readFileSync(_0x531d4e,'utf-8'),_0x333c08=a110_0x3aaf13['parseDocument'](_0x46bef2),_0x1f5d86=validateJourneyDef(_0xfbe7bf,{'source':_0x46bef2,'document':_0x333c08});if(!_0x1f5d86['valid']){const _0x28bbf6=a110_0x2492cc[_0x232a6d(0x11b)](_0x17071b,_0x531d4e);_0x999d1[_0x232a6d(0x15b)]({'filePath':_0x28bbf6,'source':_0x46bef2,'result':_0x1f5d86,'isJourney':!![]});}}return _0x999d1;}export function formatValidationErrors(_0xb9ab1d){const _0x275b8c=a110_0xefe081,_0x10c960=[];for(const {filePath:_0x5b9e46,source:_0x2ae735,result:_0x3da076,isJourney:_0x1945ee}of _0xb9ab1d){const _0x43a2a5=_0x1945ee?_0x275b8c(0xb9):_0x275b8c(0xa6);_0x10c960[_0x275b8c(0x15b)]('\x0a'+_0x5b9e46+'\x20('+_0x43a2a5+'):\x20'+_0x3da076[_0x275b8c(0xb5)][_0x275b8c(0x7c)]+'\x20error(s)'),_0x10c960[_0x275b8c(0x15b)](formatValidationResult(_0x3da076,_0x2ae735,_0x5b9e46));}return _0x10c960['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x4900dc){const _0x1840d5=a110_0xefe081,_0x4a3876=new Set(),_0x319374=new Map(),_0x1d6cdd=collectSegmentUsageCounts(_0x4900dc);if(_0x4900dc[_0x1840d5(0xfd)])for(const [_0x2ee9ff,_0x34ab15]of Object[_0x1840d5(0x84)](_0x4900dc[_0x1840d5(0xfd)])){_0x4a3876['add'](_0x2ee9ff);if(_0x34ab15[_0x1840d5(0xe0)]){const _0x279e66=yamlRuleToApi(_0x34ab15[_0x1840d5(0xe0)]),_0x2e8ade=apiRuleToYaml(_0x279e66);_0x319374[_0x1840d5(0xa1)](_0x2ee9ff,_0x2e8ade);}}const _0x2271bb=new Map();let _0x59ed12=0x0;for(const [_0x2ea75c,_0x3397ee]of _0x319374){const _0x444b5c=serializeExpandedRule(_0x3397ee,_0x319374),_0x3f2712=_0x2271bb[_0x1840d5(0xca)](_0x444b5c)||[];_0x3f2712[_0x1840d5(0x15b)]({'name':_0x2ea75c,'index':_0x59ed12}),_0x2271bb['set'](_0x444b5c,_0x3f2712),_0x59ed12++;}const _0x530ce5=new Map();for(const [_0x14d56c,_0x312664]of _0x2271bb){const _0x527833=_0x312664[_0x1840d5(0xea)]()[_0x1840d5(0x132)]((_0x267ca2,_0x594e17)=>{const _0x450f48=_0x1840d5,_0x58d0eb=_0x1d6cdd[_0x450f48(0xca)](_0x267ca2[_0x450f48(0xdc)])||0x0,_0x34bb67=_0x1d6cdd[_0x450f48(0xca)](_0x594e17[_0x450f48(0xdc)])||0x0;if(_0x58d0eb!==_0x34bb67)return _0x34bb67-_0x58d0eb;return _0x267ca2['index']-_0x594e17[_0x450f48(0xcd)];})['map'](_0x50ce6f=>_0x50ce6f[_0x1840d5(0xdc)]),_0xeb37e9=[];for(const _0x29aeb5 of _0x527833){const _0x434310=_0x1d6cdd['get'](_0x29aeb5)||0x0,_0x4c9761=Math['max'](_0x434310,0x1);for(let _0x476527=0x0;_0x476527<_0x4c9761;_0x476527++){_0xeb37e9['push'](_0x29aeb5);}}_0x530ce5[_0x1840d5(0xa1)](_0x14d56c,_0xeb37e9);}return{'existingLocalSegmentNames':_0x4a3876,'localSegmentRules':_0x319374,'localExpandedRuleToNames':_0x530ce5};}async function buildServerSegmentRuleMap(_0x30026a,_0x5e50b4,_0x5c9d86,_0x224edd){const _0xc8ca31=new Map(),_0x357c65=new Set(),_0xa2a9df=async _0x7e26e6=>{const _0x2a2fa6=a110_0x50ad;if(_0x357c65[_0x2a2fa6(0x141)](_0x7e26e6))return;_0x357c65['add'](_0x7e26e6);let _0x54750b=_0x5c9d86[_0x2a2fa6(0x159)](_0x5c134b=>_0x5c134b['id']===_0x7e26e6);if(!_0x54750b)try{_0x54750b=await _0x30026a['segment'][_0x2a2fa6(0x88)](_0x5e50b4,_0x7e26e6);}catch{return;}if(!_0x54750b?.['rule'])return;const _0x25bdab=apiRuleToYaml(_0x54750b[_0x2a2fa6(0xe0)]);_0xc8ca31[_0x2a2fa6(0xa1)](_0x7e26e6,_0x25bdab);const _0x1b6e47=collectSegmentRefsFromRule(_0x25bdab);for(const _0x6c98ec of _0x1b6e47){await _0xa2a9df(_0x6c98ec);}};for(const _0xcc2af0 of _0x224edd){await _0xa2a9df(_0xcc2af0);}return _0xc8ca31;}export function createSegmentIdResolver(_0x526a1e,_0x204897){return async _0x19b001=>{const _0x50ecaa=a110_0x50ad,_0x24eff9=_0x526a1e[_0x50ecaa(0xca)](_0x19b001);if(!_0x24eff9)throw new SDKError(ErrorCode[_0x50ecaa(0x137)],_0x50ecaa(0xcb)+_0x19b001+_0x50ecaa(0x8d)+_0x204897+'\x27)');return _0x24eff9;};}export function extractRootFolderId(_0x48ba54){const _0x220d1e=a110_0xefe081;return _0x48ba54[_0x220d1e(0x10e)]?.[_0x220d1e(0xa9)]?.[_0x220d1e(0x8a)]?.['id']||_0x48ba54[_0x220d1e(0x10e)]?.['parentFolder']?.['data']?.['id'];}export function buildConnectionMaps(_0x214171){const _0xb32eb2=a110_0xefe081,_0x2bb672=new Map(),_0x54fe4a=new Map(),_0x3ed2a3=new Map();for(const _0x489508 of _0x214171){_0x2bb672['set'](_0x489508[_0xb32eb2(0xdc)],parseInt(_0x489508['id'],0xa)),_0x54fe4a[_0xb32eb2(0xa1)](_0x489508['id'],_0x489508[_0xb32eb2(0xdc)]),_0x3ed2a3[_0xb32eb2(0xa1)](_0x489508[_0xb32eb2(0xdc)],_0x489508[_0xb32eb2(0xd4)]);}return{'nameToId':_0x2bb672,'idToName':_0x54fe4a,'nameToType':_0x3ed2a3};}export function calculatePushStats(_0x4ef5fc,_0xa59e72,_0x291d12,_0x1a55d2,_0x3f8ddf,_0x30f8fa,_0x3425be){const _0x27c8eb=a110_0xefe081,_0x3a35de=_0x4ef5fc[_0x27c8eb(0xce)](_0x316364=>_0x316364[_0x27c8eb(0xc1)]),_0x81306b=_0x4ef5fc[_0x27c8eb(0xce)](_0x544a69=>!_0x544a69['isNew']&&_0x544a69[_0x27c8eb(0x124)]),_0x1b0e05=_0x4ef5fc[_0x27c8eb(0xce)](_0xd7ae7e=>!_0xd7ae7e[_0x27c8eb(0xc1)]&&!_0xd7ae7e[_0x27c8eb(0x124)]),_0x27a524=_0x30f8fa?_0x1a55d2:[],_0x43fae0=_0xa59e72[_0x27c8eb(0xce)](_0x5df61d=>_0x5df61d[_0x27c8eb(0xc1)]),_0x1f4a39=_0xa59e72[_0x27c8eb(0xce)](_0x18a1a2=>!_0x18a1a2[_0x27c8eb(0xc1)]&&_0x18a1a2['hasChanges']),_0x2fc7dc=_0xa59e72[_0x27c8eb(0xce)](_0x10f1f4=>!_0x10f1f4[_0x27c8eb(0xc1)]&&!_0x10f1f4[_0x27c8eb(0x124)]),_0x2d908f=_0x30f8fa?_0x3f8ddf:[],_0x2594b7=_0x4ef5fc[_0x27c8eb(0x115)](_0x369bdd=>_0x369bdd['activationActions']),_0x4e1245=_0x2594b7['filter'](_0x4e49ed=>_0x4e49ed[_0x27c8eb(0xd4)]===_0x27c8eb(0x139)),_0x49f1d8=_0x2594b7['filter'](_0x3fa5ac=>_0x3fa5ac[_0x27c8eb(0xd4)]===_0x27c8eb(0xe1)),_0x1be77d=_0x2594b7['filter'](_0x4d130b=>_0x4d130b[_0x27c8eb(0xd4)]===_0x27c8eb(0xff)),_0x2c687f=Array[_0x27c8eb(0x15e)](_0x291d12)[_0x27c8eb(0x132)](),_0x16a274=_0x3425be?![]:_0x3a35de['length']>0x0||_0x81306b['length']>0x0||_0x27a524[_0x27c8eb(0x7c)]>0x0,_0x40c227=_0x43fae0[_0x27c8eb(0x7c)]>0x0||_0x1f4a39[_0x27c8eb(0x7c)]>0x0||_0x2d908f['length']>0x0,_0x5bcbd4=_0x3425be?![]:_0x2594b7[_0x27c8eb(0x7c)]>0x0,_0x55b386=_0x2c687f[_0x27c8eb(0x7c)]>0x0;return{'segments':{'new':_0x3a35de,'changed':_0x81306b,'unchanged':_0x1b0e05,'toDelete':_0x27a524},'journeys':{'new':_0x43fae0,'changed':_0x1f4a39,'unchanged':_0x2fc7dc,'toDelete':_0x2d908f},'activations':{'all':_0x2594b7,'toCreate':_0x4e1245,'toUpdate':_0x49f1d8,'toDelete':_0x1be77d},'folders':{'toCreate':_0x2c687f},'counts':{'segments':{'new':_0x3a35de[_0x27c8eb(0x7c)],'changed':_0x81306b['length'],'unchanged':_0x1b0e05[_0x27c8eb(0x7c)],'toDelete':_0x27a524['length']},'journeys':{'new':_0x43fae0[_0x27c8eb(0x7c)],'changed':_0x1f4a39[_0x27c8eb(0x7c)],'unchanged':_0x2fc7dc[_0x27c8eb(0x7c)],'toDelete':_0x2d908f['length']},'activations':{'create':_0x4e1245[_0x27c8eb(0x7c)],'update':_0x49f1d8[_0x27c8eb(0x7c)],'delete':_0x1be77d[_0x27c8eb(0x7c)]},'folders':_0x2c687f[_0x27c8eb(0x7c)]},'hasChanges':_0x16a274||_0x40c227||_0x5bcbd4||_0x55b386};}export async function buildPushExecutionContext(_0x50535d,_0x3aaa29,_0x4e847f,_0x35e7cd,_0x5ca17f,_0x5c5c20){const _0x854956=a110_0xefe081,_0x2edb13=extractRootFolderId(_0x4e847f),{pathToId:_0x27c47a,idToPath:_0x50156d}=buildFolderMaps(_0x5ca17f),_0x6e97ca=buildSegmentNameToIdMap(_0x35e7cd),_0x20dc17=new Map(),{batchAsync:_0x3735d6}=await import(_0x854956(0xdb)),[_0x489f89,_0x31ff78]=await Promise[_0x854956(0x142)]([_0x50535d['user']['buildUserMaps'](),_0x50535d[_0x854956(0x138)][_0x854956(0xbd)](),((async()=>{const _0x3923f4=_0x854956;!_0x5c5c20&&_0x35e7cd[_0x3923f4(0x7c)]>0x0&&await _0x3735d6(_0x35e7cd,async _0x2939fd=>{const _0x357605=_0x3923f4,_0x43b157=await _0x50535d[_0x357605(0xa6)]['listActivations'](_0x3aaa29,_0x2939fd['id']);_0x20dc17['set'](_0x2939fd['id'],_0x43b157);});})())]),{emailToId:_0x59de46,idToEmail:_0x148a56}=_0x489f89,_0x4a2964=buildConnectionMaps(_0x31ff78);return{'rootFolderId':_0x2edb13,'folderPathToId':_0x27c47a,'folderIdToPath':_0x50156d,'segmentNameToId':_0x6e97ca,'activationsBySegmentId':_0x20dc17,'emailToIdMap':_0x59de46,'idToEmailMap':_0x148a56,'connectionNameToIdMap':_0x4a2964['nameToId'],'connectionIdToNameMap':_0x4a2964[_0x854956(0x109)],'connectionNameToTypeMap':_0x4a2964[_0x854956(0xba)]};}export function createPushYamlContextForBundle(_0x2dd0,_0xe3a4e7,_0x4a201a,_0x4d9f39,_0x2c7840,_0x497e45,_0x172459,_0x25a89b){const {existingLocalSegmentNames:_0x1fdc7f,localExpandedRuleToNames:_0x25ef85}=_0x4d9f39,_0x3cb886=new Set(),_0x1f372f=new Map(),_0x4d33f2=new Map(),_0x1287d3=new Map(),_0x2dcfbd=createJumpTargetCache(),_0x5a4ccd=new Map(),_0x10867b=new Map(),_0x42c659=new Set();let _0x1d6814;const _0x556232=_0x28e457=>{const _0xb2a71f={'resolveSegment':async _0xf1918d=>{const _0x17a50c=a110_0x50ad,_0x8a9013=_0x1287d3['get'](_0xf1918d);if(_0x8a9013!==undefined)return{'name':_0x8a9013,'isJourneyLocal':!![]};try{let _0x4de3ff=_0x4a201a[_0x17a50c(0x159)](_0x498873=>_0x498873['id']===_0xf1918d);!_0x4de3ff&&(_0x4de3ff=await _0x2dd0[_0x17a50c(0xa6)][_0x17a50c(0x88)](_0xe3a4e7,_0xf1918d));const _0x4a4163=generateJourneyLocalName(_0x4de3ff[_0x17a50c(0xdc)]),_0x350c87=_0x4de3ff['kind']===SEGMENT_KIND_JOURNEY&&_0x4a4163!==undefined;let _0x4792c6=_0x4de3ff[_0x17a50c(0xdc)],_0x31536f;if(_0x350c87&&_0x4de3ff['rule']){const _0x3b3960=apiRuleToYaml(_0x4de3ff[_0x17a50c(0xe0)]);_0x10867b[_0x17a50c(0xa1)](_0xf1918d,_0x3b3960);const _0x3b8168=async _0x3f30a0=>{const _0x507585=_0x17a50c,_0x535b9d=collectSegmentRefsFromRule(_0x3f30a0);for(const _0x37c937 of _0x535b9d){if(!_0x10867b[_0x507585(0x141)](_0x37c937))try{const _0x2401a=await _0x2dd0['segment'][_0x507585(0x88)](_0xe3a4e7,_0x37c937);if(_0x2401a?.['rule']){const _0x5bc039=apiRuleToYaml(_0x2401a['rule']);_0x10867b[_0x507585(0xa1)](_0x37c937,_0x5bc039),await _0x3b8168(_0x5bc039);}}catch{}}};await _0x3b8168(_0x3b3960);const _0x5db0ee=serializeExpandedRule(_0x3b3960,_0x10867b),_0x142360=_0x25ef85['get'](_0x5db0ee);if(_0x142360&&_0x142360['length']>0x0){const _0x221b8f=_0x1f372f[_0x17a50c(0xca)](_0x5db0ee)||0x0,_0x312da9=_0x142360[_0x221b8f]||_0x142360[_0x142360['length']-0x1];_0x1f372f[_0x17a50c(0xa1)](_0x5db0ee,_0x221b8f+0x1),_0x4792c6=_0x312da9,_0x3cb886[_0x17a50c(0x86)](_0x4792c6),_0x1287d3['set'](_0xf1918d,_0x4792c6);const _0x3f4165=await resolveRuleSegmentRefs(_0x3b3960,async _0x525e9c=>{const _0x4669c7=_0x17a50c,_0x1d4559=_0x1287d3[_0x4669c7(0xca)](_0x525e9c);if(_0x1d4559)return _0x1d4559;const _0xf0bdbc=await _0x1d6814[_0x4669c7(0xa0)](_0x525e9c);return _0xf0bdbc[_0x4669c7(0xdc)];});_0x31536f={'description':_0x4de3ff[_0x17a50c(0x83)],'rule':_0x3f4165};}else{const _0x4ffb04=_0x5a4ccd[_0x17a50c(0xca)](_0x5db0ee);if(_0x4ffb04)_0x4792c6=_0x4ffb04,_0x1287d3[_0x17a50c(0xa1)](_0xf1918d,_0x4792c6);else{if(_0x4a4163){let _0x3e1eb6=_0x4a4163,_0x2f6a01=0x2;while(_0x3cb886[_0x17a50c(0x141)](_0x3e1eb6)||_0x1fdc7f[_0x17a50c(0x141)](_0x3e1eb6)){_0x3e1eb6=_0x4a4163+'_'+_0x2f6a01,_0x2f6a01++;}_0x3cb886[_0x17a50c(0x86)](_0x3e1eb6),_0x4792c6=_0x3e1eb6;}_0x1287d3[_0x17a50c(0xa1)](_0xf1918d,_0x4792c6),_0x5a4ccd[_0x17a50c(0xa1)](_0x5db0ee,_0x4792c6);const _0x1ddd12=await resolveRuleSegmentRefs(_0x3b3960,async _0x43d74f=>{const _0x3ae447=_0x17a50c,_0x73344f=_0x1287d3['get'](_0x43d74f);if(_0x73344f)return _0x73344f;const _0x25903d=await _0x1d6814[_0x3ae447(0xa0)](_0x43d74f);return _0x25903d[_0x3ae447(0xdc)];});_0x31536f={'description':_0x4de3ff[_0x17a50c(0x83)],'rule':_0x1ddd12};}}}return{'name':_0x4792c6,'isJourneyLocal':_0x350c87,'definition':_0x31536f};}catch{return{'name':_0xf1918d,'isJourneyLocal':![]};}},'resolveActivation':async _0xda9721=>{const _0x59ae07=a110_0x50ad,_0x5d2912=_0x4d33f2[_0x59ae07(0xca)](_0xda9721);if(_0x5d2912!==undefined)return{'name':_0x5d2912,'isJourneyLocal':!![]};try{let _0x282f9f=_0x172459?.[_0x59ae07(0xca)](_0xda9721);!_0x282f9f&&(_0x282f9f=await _0x2dd0[_0x59ae07(0xb9)][_0x59ae07(0x10f)](_0x28e457,_0xda9721));const _0x3fe0fc=_0x282f9f[_0x59ae07(0xab)]['activationParams'][_0x59ae07(0xdc)]||_0xda9721,_0x497bd0=sanitizeYamlKey(_0x3fe0fc)||'activation_'+_0xda9721,_0x406acb=_0x497bd0;_0x4d33f2[_0x59ae07(0xa1)](_0xda9721,_0x406acb);const _0x1158f5=journeyActivationStepToYaml(_0x282f9f,_0x2c7840,_0x497e45);return{'name':_0x406acb,'isJourneyLocal':!![],'definition':_0x1158f5};}catch{return{'name':_0xda9721,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3e0a2c,_0x5677f2)=>resolveJumpTarget(_0x3e0a2c,_0x5677f2,_0x2dcfbd,async _0x19d227=>{const _0x433e94=a110_0x50ad,_0x13aaeb=_0x25a89b?.[_0x433e94(0xca)](_0x19d227);if(_0x13aaeb)return _0x13aaeb;return _0x2dd0['journey']['getJourney'](_0x19d227);})};return _0x1d6814=_0xb2a71f,_0xb2a71f;},_0xf0a4f8=async _0x2a7f02=>{const _0x3166a2=a110_0x50ad,{collectSegmentIdsFromJourneyApi:_0x924918}=await import(_0x3166a2(0xb7)),{batchAsync:_0x3d55d2}=await import(_0x3166a2(0xdb)),_0x535c6c=new Set();for(const _0xb6de8b of _0x2a7f02){let _0x177d76=_0x25a89b?.[_0x3166a2(0xca)](_0xb6de8b);!_0x177d76&&(_0x177d76=await _0x2dd0[_0x3166a2(0xb9)]['getJourney'](_0xb6de8b));const _0x491d9a=_0x924918(_0x177d76);for(const _0x11607d of _0x491d9a){_0x535c6c[_0x3166a2(0x86)](_0x11607d);}}let _0x4982e7=Array['from'](_0x535c6c);while(_0x4982e7[_0x3166a2(0x7c)]>0x0){const _0x3293df=_0x4982e7[_0x3166a2(0xce)](_0x2af41c=>!_0x42c659[_0x3166a2(0x141)](_0x2af41c));if(_0x3293df[_0x3166a2(0x7c)]===0x0)break;const _0x3f4365=await _0x3d55d2(_0x3293df,async _0x699d38=>{const _0x425af4=_0x3166a2;_0x42c659['add'](_0x699d38);let _0x3c325d=_0x4a201a[_0x425af4(0x159)](_0x232c92=>_0x232c92['id']===_0x699d38);if(!_0x3c325d)try{_0x3c325d=await _0x2dd0[_0x425af4(0xa6)]['getSegment'](_0xe3a4e7,_0x699d38);}catch{return null;}return{'segmentId':_0x699d38,'segment':_0x3c325d};},0xa),_0x522e89=new Set();for(const _0x318f00 of _0x3f4365){if(!_0x318f00?.['segment']?.[_0x3166a2(0xe0)])continue;const _0x382582=apiRuleToYaml(_0x318f00[_0x3166a2(0xa6)][_0x3166a2(0xe0)]);_0x10867b[_0x3166a2(0xa1)](_0x318f00['segmentId'],_0x382582);const _0x52d1cf=collectSegmentRefsFromRule(_0x382582);for(const _0xece3f0 of _0x52d1cf){!_0x42c659[_0x3166a2(0x141)](_0xece3f0)&&_0x522e89[_0x3166a2(0x86)](_0xece3f0);}}_0x4982e7=Array['from'](_0x522e89);}};return{'createYamlContext':_0x556232,'prefetchJourneySegments':_0xf0a4f8};}export async function executePushSegments(_0x41e871,_0x3d8de3,_0x3076c0,_0x16963f,_0x1525e7){const _0x321001=a110_0xefe081,{segmentDefToCreateRequest:_0x565ebd,segmentDefToUpdateRequest:_0x4622f4}=await import(_0x321001(0xc0)),_0x581062=_0x3076c0['folderPathToId'],_0x14e576=0x5,_0xb0ebe7=async _0x3ddde2=>{const _0x2ec9c6=_0x321001,_0x48580d=_0x3ddde2[_0x2ec9c6(0xf7)]?_0x581062[_0x2ec9c6(0xca)](_0x3ddde2[_0x2ec9c6(0xf7)]):undefined;let _0x4f0b2c;const _0x1ab089={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x3ddde2[_0x2ec9c6(0xc1)]){_0x1525e7[_0x2ec9c6(0x87)]?.({'type':_0x2ec9c6(0xc5),'name':_0x3ddde2[_0x2ec9c6(0xde)][_0x2ec9c6(0xdc)]});const _0x5bb720=_0x565ebd(_0x3ddde2[_0x2ec9c6(0xde)],_0x48580d),_0x148898=await _0x1525e7[_0x2ec9c6(0x10a)](_0x2ec9c6(0x131)+_0x3ddde2[_0x2ec9c6(0xde)][_0x2ec9c6(0xdc)]+_0x2ec9c6(0x13c),()=>_0x41e871['segment'][_0x2ec9c6(0xe6)](_0x16963f[_0x2ec9c6(0x8f)],_0x5bb720));_0x4f0b2c=_0x148898[_0x2ec9c6(0x8a)]['id'],_0x1ab089[_0x2ec9c6(0xfe)]={'name':_0x3ddde2[_0x2ec9c6(0xde)][_0x2ec9c6(0xdc)],'id':_0x4f0b2c},_0x1525e7[_0x2ec9c6(0x87)]?.({'type':_0x2ec9c6(0xdf),'name':_0x3ddde2['yamlConfig']['name'],'segmentId':_0x4f0b2c}),_0x1525e7[_0x2ec9c6(0x156)]?.('Created\x20segment\x20\x27'+_0x3ddde2['yamlConfig'][_0x2ec9c6(0xdc)]+'\x27'),_0x1ab089[_0x2ec9c6(0xe7)]=0x1;}else{if(_0x3ddde2[_0x2ec9c6(0x124)]){_0x1525e7[_0x2ec9c6(0x87)]?.({'type':_0x2ec9c6(0x125),'name':_0x3ddde2[_0x2ec9c6(0xde)][_0x2ec9c6(0xdc)]});const _0x34fc68=_0x4622f4(_0x3ddde2[_0x2ec9c6(0xde)]);_0x48580d!==_0x3ddde2[_0x2ec9c6(0xd5)]?.['segmentFolderId']&&(_0x34fc68[_0x2ec9c6(0xfb)]=_0x48580d?parseInt(_0x48580d,0xa):undefined),await _0x1525e7[_0x2ec9c6(0x10a)](_0x2ec9c6(0xb6)+_0x3ddde2[_0x2ec9c6(0xde)][_0x2ec9c6(0xdc)]+_0x2ec9c6(0x13c),()=>_0x41e871[_0x2ec9c6(0xa6)][_0x2ec9c6(0xc7)](_0x16963f[_0x2ec9c6(0x8f)],_0x3ddde2[_0x2ec9c6(0xd5)]['id'],_0x34fc68)),_0x4f0b2c=_0x3ddde2['existingSegment']['id'],_0x1525e7[_0x2ec9c6(0x87)]?.({'type':'segment_updated','name':_0x3ddde2[_0x2ec9c6(0xde)][_0x2ec9c6(0xdc)]}),_0x1525e7[_0x2ec9c6(0x156)]?.('Updated\x20segment\x20\x27'+_0x3ddde2[_0x2ec9c6(0xde)][_0x2ec9c6(0xdc)]+'\x27'),_0x1ab089[_0x2ec9c6(0x12a)]=0x1;}else _0x4f0b2c=_0x3ddde2[_0x2ec9c6(0xd5)]['id'];}}catch(_0x54a067){const _0x8ced3f=isHttp400Error(_0x54a067),_0x448f82=_0x8ced3f?ErrorCode[_0x2ec9c6(0x14d)]:ErrorCode[_0x2ec9c6(0x147)],_0x23de16=getErrorMessage(_0x54a067);throw new SDKError(_0x448f82,'Failed\x20to\x20'+(_0x3ddde2[_0x2ec9c6(0xc1)]?_0x2ec9c6(0x139):'update')+_0x2ec9c6(0xdd)+_0x3ddde2['absolutePath']+_0x2ec9c6(0xae)+_0x23de16,_0x54a067);}try{const _0x3da925=await syncActivationsForSegment(_0x41e871,_0x16963f[_0x2ec9c6(0x8f)],_0x4f0b2c,_0x3ddde2[_0x2ec9c6(0xde)][_0x2ec9c6(0xdc)],_0x3ddde2['activationActions'],_0x1525e7,_0x3ddde2[_0x2ec9c6(0x98)]);_0x1ab089[_0x2ec9c6(0x144)]=_0x3da925;}catch(_0x527da2){if(_0x527da2 instanceof SDKError)throw _0x527da2;throw new SDKError(ErrorCode[_0x2ec9c6(0xad)],_0x2ec9c6(0xf1)+_0x3ddde2['yamlConfig']['name']+_0x2ec9c6(0x150)+_0x3ddde2[_0x2ec9c6(0x98)]+_0x2ec9c6(0xae)+getErrorMessage(_0x527da2),_0x527da2);}return _0x1ab089;},_0x3652c4=await batchAsync(_0x3d8de3,_0xb0ebe7,_0x14e576),_0x315d46={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x308378 of _0x3652c4){_0x315d46[_0x321001(0xe7)]+=_0x308378[_0x321001(0xe7)],_0x315d46[_0x321001(0x12a)]+=_0x308378[_0x321001(0x12a)],_0x308378['createdSegmentId']&&_0x315d46[_0x321001(0xf6)][_0x321001(0xa1)](_0x308378[_0x321001(0xfe)]['name'],_0x308378[_0x321001(0xfe)]['id']),_0x315d46[_0x321001(0x144)][_0x321001(0xe7)]+=_0x308378[_0x321001(0x144)][_0x321001(0xe7)],_0x315d46[_0x321001(0x144)][_0x321001(0x12a)]+=_0x308378[_0x321001(0x144)]['updated'],_0x315d46['activations']['deleted']+=_0x308378[_0x321001(0x144)][_0x321001(0xed)];}return _0x315d46;}async function syncActivationsForSegment(_0x222ac9,_0x36476e,_0x192f97,_0x24ff26,_0x307bb3,_0x35c75b,_0x3e9464){const _0x84fc3=a110_0xefe081,_0x157931={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3238b2 of _0x307bb3){try{if(_0x3238b2[_0x84fc3(0xd4)]===_0x84fc3(0x139)&&_0x3238b2[_0x84fc3(0xaf)])_0x35c75b[_0x84fc3(0x87)]?.({'type':_0x84fc3(0xbe),'segmentName':_0x24ff26,'activationName':_0x3238b2['name']}),await _0x35c75b[_0x84fc3(0x10a)](_0x84fc3(0xec)+_0x3238b2[_0x84fc3(0xdc)]+_0x84fc3(0x13c),()=>_0x222ac9[_0x84fc3(0xa6)][_0x84fc3(0xf0)](_0x36476e,_0x192f97,_0x3238b2[_0x84fc3(0xaf)])),_0x35c75b[_0x84fc3(0x87)]?.({'type':_0x84fc3(0x112),'segmentName':_0x24ff26,'activationName':_0x3238b2[_0x84fc3(0xdc)]}),_0x35c75b[_0x84fc3(0x156)]?.(_0x84fc3(0x146)+_0x3238b2[_0x84fc3(0xdc)]+'\x27'),_0x157931[_0x84fc3(0xe7)]++;else{if(_0x3238b2[_0x84fc3(0xd4)]===_0x84fc3(0xe1)&&_0x3238b2[_0x84fc3(0xaf)]&&_0x3238b2[_0x84fc3(0xc6)])_0x35c75b[_0x84fc3(0x87)]?.({'type':_0x84fc3(0x117),'segmentName':_0x24ff26,'activationName':_0x3238b2[_0x84fc3(0xdc)]}),await _0x35c75b[_0x84fc3(0x10a)](_0x84fc3(0xd9)+_0x3238b2[_0x84fc3(0xdc)]+_0x84fc3(0x13c),()=>_0x222ac9['segment'][_0x84fc3(0x7d)](_0x36476e,_0x192f97,_0x3238b2[_0x84fc3(0xc6)]['id'],_0x3238b2[_0x84fc3(0xaf)])),_0x35c75b[_0x84fc3(0x87)]?.({'type':_0x84fc3(0x15f),'segmentName':_0x24ff26,'activationName':_0x3238b2['name']}),_0x35c75b['logSuccess']?.('Updated\x20activation\x20\x27'+_0x3238b2[_0x84fc3(0xdc)]+'\x27'),_0x157931[_0x84fc3(0x12a)]++;else _0x3238b2[_0x84fc3(0xd4)]==='delete'&&_0x3238b2[_0x84fc3(0xc6)]&&(_0x35c75b[_0x84fc3(0x87)]?.({'type':'activation_deleting','segmentName':_0x24ff26,'activationName':_0x3238b2[_0x84fc3(0xdc)]}),await _0x35c75b['withProgress']('Deleting\x20activation\x20\x27'+_0x3238b2[_0x84fc3(0xdc)]+'\x27...',()=>_0x222ac9[_0x84fc3(0xa6)]['deleteActivation'](_0x36476e,_0x192f97,_0x3238b2[_0x84fc3(0xc6)]['id'])),_0x35c75b['onProgress']?.({'type':_0x84fc3(0x153),'segmentName':_0x24ff26,'activationName':_0x3238b2[_0x84fc3(0xdc)]}),_0x35c75b['logDeleted']?.(_0x84fc3(0xb8)+_0x3238b2[_0x84fc3(0xdc)]+'\x27'),_0x157931[_0x84fc3(0xed)]++);}}catch(_0xe0090c){const _0x5144dc=isHttp400Error(_0xe0090c),_0x5eaa86=_0x5144dc?ErrorCode[_0x84fc3(0x91)]:ErrorCode[_0x84fc3(0xad)],_0x42ad80=getErrorMessage(_0xe0090c);throw new SDKError(_0x5eaa86,_0x84fc3(0x140)+_0x3238b2['type']+_0x84fc3(0x14f)+_0x3238b2[_0x84fc3(0xdc)]+_0x84fc3(0x150)+_0x3e9464+_0x84fc3(0xae)+_0x42ad80,_0xe0090c);}}return _0x157931;}export async function executePushFolders(_0x446c90,_0x44c629,_0x3b09d1,_0x3bb584,_0x6fcf22){const _0xe8918a=a110_0xefe081,_0x50b350=new Map(_0x3b09d1);for(const _0x4d59d9 of _0x44c629){const _0x1bff76=_0x4d59d9[_0xe8918a(0xf9)]('/'),_0x4b56a3=_0x1bff76[_0x1bff76[_0xe8918a(0x7c)]-0x1],_0x29c6f0=_0x1bff76[_0xe8918a(0xea)](0x0,-0x1)[_0xe8918a(0x9c)]('/'),_0xf2e36d=_0x50b350['get'](_0x29c6f0);_0x6fcf22['onProgress']?.({'type':_0xe8918a(0x93),'folder':_0x4d59d9});const _0x53ca6b={'name':_0x4b56a3,'parentFolderId':_0xf2e36d},_0x1cf05b=await _0x6fcf22['withProgress'](_0xe8918a(0xc8)+_0x4d59d9+_0xe8918a(0x13c),()=>_0x446c90['segment'][_0xe8918a(0xa5)](_0x3bb584[_0xe8918a(0x8f)],_0x53ca6b));_0x50b350[_0xe8918a(0xa1)](_0x4d59d9,_0x1cf05b['data']['id']),_0x6fcf22['onProgress']?.({'type':_0xe8918a(0xa4),'folder':_0x4d59d9,'folderId':_0x1cf05b['data']['id']}),_0x6fcf22[_0xe8918a(0x15d)]?.(_0xe8918a(0x154)+_0x4d59d9+'\x27');}return _0x50b350;}export async function executePushSegmentDeletions(_0x4aacde,_0x177a21,_0x2ae700){const _0x55578d=a110_0xefe081;if(_0x177a21[_0x55578d(0x7c)]===0x0)return 0x0;const {batchAsync:_0x49bcae}=await import('../../utils/async.js'),_0x2e3d28=0x5,_0x9806e6=await _0x49bcae(_0x177a21,async _0x46baa8=>{const _0x5d719f=_0x55578d;return _0x2ae700[_0x5d719f(0x87)]?.({'type':_0x5d719f(0xf4),'name':_0x46baa8[_0x5d719f(0xdc)]}),await _0x4aacde['segment']['deleteSegment'](_0x46baa8['id']),_0x2ae700[_0x5d719f(0x87)]?.({'type':_0x5d719f(0x129),'name':_0x46baa8[_0x5d719f(0xdc)]}),_0x2ae700[_0x5d719f(0x149)]?.(_0x5d719f(0xcc)+_0x46baa8[_0x5d719f(0xdc)]+'\x27'),0x1;},_0x2e3d28);return _0x9806e6[_0x55578d(0x10c)]((_0x293f7e,_0x1141ad)=>_0x293f7e+_0x1141ad,0x0);}export async function executePushJourneys(_0x2fb7fc,_0x256f68,_0x42d02d,_0x526948,_0x3b65a3){const _0x5c871a=a110_0xefe081,{journeyDefToRequest:_0x477f0c}=await import(_0x5c871a(0xb7)),{activationDefToCreateRequest:_0x23ac85,yamlRuleToApi:_0x1d95b2,validateSegmentRule:_0x5a5339}=await import(_0x5c871a(0xc0)),_0x548f3a={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x531b16=new Map(_0x42d02d['segmentNameToId']),_0x3c17d0=0x5;for(let _0x173152=0x0;_0x173152<_0x256f68[_0x5c871a(0x7c)];_0x173152+=_0x3c17d0){const _0x32ec4a=_0x256f68[_0x5c871a(0xea)](_0x173152,_0x173152+_0x3c17d0),_0x1bd73d=await Promise['all'](_0x32ec4a[_0x5c871a(0x158)](async _0x5341dc=>{const _0x4edc18=_0x5c871a;if(!_0x5341dc[_0x4edc18(0xc1)]&&!_0x5341dc['hasChanges'])return{'action':'unchanged','name':_0x5341dc['yamlConfig'][_0x4edc18(0xdc)],'journeyId':_0x5341dc[_0x4edc18(0x121)]?.['id']};const _0x208e52=_0x5341dc[_0x4edc18(0xf7)]?_0x42d02d[_0x4edc18(0x14b)][_0x4edc18(0xca)](_0x5341dc[_0x4edc18(0xf7)]):undefined;_0x3b65a3[_0x4edc18(0x87)]?.({'type':_0x5341dc[_0x4edc18(0xc1)]?_0x4edc18(0x10b):_0x4edc18(0xbc),'name':_0x5341dc['yamlConfig'][_0x4edc18(0xdc)]});try{const _0x5ba76d=await executeSingleJourneyPush(_0x2fb7fc,_0x5341dc,{..._0x42d02d,'segmentNameToId':_0x531b16},{'parentId':_0x526948[_0x4edc18(0x8f)],'rootFolderId':_0x526948[_0x4edc18(0x97)],'folderId':_0x208e52,'verbose':_0x526948['verbose']},_0x3b65a3,{'journeyDefToRequest':_0x477f0c,'activationDefToCreateRequest':_0x23ac85,'yamlRuleToApi':_0x1d95b2,'validateSegmentRule':_0x5a5339});for(const [_0x464f70,_0x1070fc]of _0x5ba76d[_0x4edc18(0xf8)]){_0x531b16[_0x4edc18(0xa1)](_0x464f70,_0x1070fc),_0x548f3a['embeddedSegmentNameToId'][_0x4edc18(0xa1)](_0x464f70,_0x1070fc);}if(_0x5ba76d[_0x4edc18(0x11e)]===_0x4edc18(0xe7))_0x3b65a3['onProgress']?.({'type':_0x4edc18(0x152),'name':_0x5341dc[_0x4edc18(0xde)][_0x4edc18(0xdc)],'journeyId':_0x5ba76d['journeyId']}),_0x3b65a3['logSuccess']?.(_0x4edc18(0x99)+_0x5341dc[_0x4edc18(0xde)]['name']+'\x27'),_0x548f3a[_0x4edc18(0xe7)]++;else _0x5ba76d[_0x4edc18(0x11e)]===_0x4edc18(0x12a)&&(_0x3b65a3[_0x4edc18(0x87)]?.({'type':_0x4edc18(0x114),'name':_0x5341dc[_0x4edc18(0xde)][_0x4edc18(0xdc)]}),_0x3b65a3[_0x4edc18(0x156)]?.(_0x4edc18(0xd0)+_0x5341dc[_0x4edc18(0xde)][_0x4edc18(0xdc)]+'\x27'),_0x548f3a[_0x4edc18(0x12a)]++);return{'action':_0x5ba76d[_0x4edc18(0x11e)],'name':_0x5341dc['yamlConfig'][_0x4edc18(0xdc)],'journeyId':_0x5ba76d['journeyId']};}catch(_0x4f9434){const _0x13a4da=isHttp400Error(_0x4f9434),_0x3783e0=_0x13a4da?ErrorCode[_0x4edc18(0x14e)]:ErrorCode[_0x4edc18(0xc2)],_0x2549ed=getErrorMessage(_0x4f9434);throw new SDKError(_0x3783e0,_0x4edc18(0x140)+(_0x5341dc[_0x4edc18(0xc1)]?_0x4edc18(0x139):'update')+_0x4edc18(0xf3)+_0x5341dc['absolutePath']+'\x0a\x20\x20'+_0x2549ed,_0x4f9434);}}));_0x548f3a[_0x5c871a(0x157)][_0x5c871a(0x15b)](..._0x1bd73d);}return _0x548f3a;}async function executeSingleJourneyPush(_0x350f83,_0x2c32bc,_0x2f1364,_0x5859a6,_0x2032e0,_0x4932bc){const _0x122d4b=a110_0xefe081,{journeyDefToRequest:_0x53977c,activationDefToCreateRequest:_0xd0f9d9,yamlRuleToApi:_0x5a4938,validateSegmentRule:_0x17f2fd}=_0x4932bc,_0x8c04fd=new Map(),_0x3990da=new Map(),_0x466bed=new Map(),_0x25d80c=new Map(),_0x16530c=new Map();let _0x50543c;const _0x2251b9=async()=>{const _0x79c69f=a110_0x50ad;if(_0x50543c)return;_0x50543c=new Map();if(!_0x2c32bc[_0x79c69f(0x121)])return;const _0x127ad9=await _0x350f83[_0x79c69f(0xb9)][_0x79c69f(0xa7)](_0x2c32bc[_0x79c69f(0x121)]['id']);for(const _0x542eaa of _0x127ad9){const _0xdcd48e=journeyActivationStepToYaml(_0x542eaa,_0x2f1364[_0x79c69f(0xf5)],_0x2f1364[_0x79c69f(0xef)]),_0x4af19b=activationSignature(_0xdcd48e);!_0x50543c[_0x79c69f(0x141)](_0x4af19b)&&_0x50543c[_0x79c69f(0xa1)](_0x4af19b,_0x542eaa['id']),_0xdcd48e[_0x79c69f(0xdc)]&&_0x3990da[_0x79c69f(0xa1)](_0xdcd48e[_0x79c69f(0xdc)],_0x542eaa['id']);}};if(_0x2c32bc[_0x122d4b(0x121)]&&_0x2c32bc[_0x122d4b(0xde)]['segments']){const _0xb87259=buildLocalExpandedRuleMappings(_0x2c32bc[_0x122d4b(0xde)]),_0x1500d8=_0xb87259[_0x122d4b(0x128)];if(_0x1500d8[_0x122d4b(0xfa)]>0x0){const _0x345b0a=new Map();for(const [_0xe3f3e5,_0x3a3918]of _0x1500d8){const _0x11ef96=serializeExpandedRule(_0x3a3918,_0x1500d8);_0x345b0a['set'](_0xe3f3e5,_0x11ef96);}const _0x12c1f2=collectSegmentIdsFromJourneyApi(_0x2c32bc['existingJourney']);if(_0x12c1f2[_0x122d4b(0xfa)]>0x0){const _0x2db4e7=await buildServerSegmentRuleMap(_0x350f83,_0x5859a6[_0x122d4b(0x8f)],_0x2f1364[_0x122d4b(0x145)],_0x12c1f2);if(_0x2db4e7[_0x122d4b(0xfa)]>0x0){const _0x98d628=new Map();for(const [_0x59e370,_0xc7c829]of _0x2db4e7){const _0x3d854c=serializeExpandedRule(_0xc7c829,_0x2db4e7);!_0x98d628[_0x122d4b(0x141)](_0x3d854c)&&_0x98d628[_0x122d4b(0xa1)](_0x3d854c,_0x59e370);}for(const [_0x2607fa,_0x2f9e6b]of _0x345b0a){const _0x162f9e=_0x98d628[_0x122d4b(0xca)](_0x2f9e6b);_0x162f9e&&(_0x16530c[_0x122d4b(0xa1)](_0x2607fa,_0x162f9e),_0x2f1364[_0x122d4b(0x133)][_0x122d4b(0xa1)](_0x2607fa,_0x162f9e));}}}}}const _0x33ab02={'resolveSegmentId':async _0x2bf4c2=>{const _0x4d1164=_0x122d4b,_0x43b712=_0x2f1364['segmentNameToId'][_0x4d1164(0xca)](_0x2bf4c2);if(!_0x43b712)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4d1164(0xcb)+_0x2bf4c2+_0x4d1164(0x80)+_0x2c32bc['yamlConfig']['name']+')');return _0x43b712;},'resolveEmbeddedSegmentId':async(_0x50d2fc,_0x1976da)=>{const _0x173c9b=_0x122d4b,_0x4ed20a=_0x2f1364['segmentNameToId'][_0x173c9b(0xca)](_0x50d2fc);if(_0x4ed20a)return _0x4ed20a;const _0x3d4fcb=_0x16530c[_0x173c9b(0xca)](_0x50d2fc);if(_0x3d4fcb)return _0x2f1364[_0x173c9b(0x133)][_0x173c9b(0xa1)](_0x50d2fc,_0x3d4fcb),_0x3d4fcb;const _0x4089be=_0x2f1364['existingSegments'][_0x173c9b(0x159)](_0x39b13d=>_0x39b13d['name']===_0x50d2fc);if(_0x4089be)return _0x2f1364[_0x173c9b(0x133)][_0x173c9b(0xa1)](_0x50d2fc,_0x4089be['id']),_0x4089be['id'];if(_0x2c32bc[_0x173c9b(0xc1)]){const {stageName:_0x3f9fa1,criteriaName:_0x2de2bc}=findSegmentCriteriaLocation(_0x2c32bc[_0x173c9b(0xde)],_0x50d2fc);return _0x17f2fd(_0x50d2fc,_0x1976da['rule']),_0x466bed['set'](_0x50d2fc,{'definition':_0x1976da,'stageName':_0x3f9fa1,'criteriaName':_0x2de2bc}),createPendingSegmentId(_0x50d2fc);}const _0x1784b6=_0x2c32bc['existingJourney']?.['id'];if(!_0x1784b6)throw new SDKError(ErrorCode[_0x173c9b(0xb3)],_0x173c9b(0x111));_0x17f2fd(_0x50d2fc,_0x1976da[_0x173c9b(0xe0)]);const _0x356ca6=generateDeterministicJourneySegmentName(_0x2c32bc[_0x173c9b(0xde)][_0x173c9b(0xdc)],_0x50d2fc),_0x2601cd=_0x2f1364[_0x173c9b(0x145)][_0x173c9b(0x159)](_0x45e7dc=>_0x45e7dc[_0x173c9b(0xdc)]===_0x356ca6),_0x22fa72=createSegmentIdResolver(_0x2f1364[_0x173c9b(0x133)],_0x50d2fc),_0x4d8819=await resolveRuleSegmentIds(_0x1976da['rule'],_0x22fa72);let _0x2d7401;if(_0x2601cd)await _0x350f83[_0x173c9b(0xa6)]['updateSegmentById'](_0x5859a6['parentId'],_0x2601cd['id'],{'description':_0x1976da['description']||_0x173c9b(0x119)+_0x50d2fc,'rule':_0x5a4938(_0x4d8819,!![]),'countPopulation':!![]}),_0x2d7401=_0x2601cd['id'];else try{_0x2d7401=await _0x350f83['segment']['createJourneySegment']({'name':_0x356ca6,'description':_0x1976da[_0x173c9b(0x83)]||'Entry\x20criteria:\x20'+_0x50d2fc,'journeyId':_0x1784b6,'rule':_0x5a4938(_0x4d8819,!![]),'countPopulation':!![],'parentFolderId':_0x5859a6[_0x173c9b(0x97)]||'','audienceId':_0x5859a6[_0x173c9b(0x8f)]});}catch(_0x416c9d){const _0x1b3ed9=_0x416c9d instanceof Error&&_0x416c9d[_0x173c9b(0x122)][_0x173c9b(0x11a)](_0x173c9b(0x108));if(_0x1b3ed9){const _0x4380e0=await _0x350f83[_0x173c9b(0xa6)][_0x173c9b(0x8c)](_0x5859a6[_0x173c9b(0x8f)]),_0x3bb23d=_0x4380e0[_0x173c9b(0x159)](_0x3c1563=>_0x3c1563[_0x173c9b(0xdc)]===_0x356ca6);if(_0x3bb23d)await _0x350f83[_0x173c9b(0xa6)]['updateSegmentById'](_0x5859a6[_0x173c9b(0x8f)],_0x3bb23d['id'],{'description':_0x1976da[_0x173c9b(0x83)]||'Entry\x20criteria:\x20'+_0x50d2fc,'rule':_0x5a4938(_0x4d8819,!![]),'countPopulation':!![]}),_0x2d7401=_0x3bb23d['id'];else throw _0x416c9d;}else throw _0x416c9d;}return _0x2f1364['segmentNameToId']['set'](_0x50d2fc,_0x2d7401),_0x8c04fd[_0x173c9b(0xa1)](_0x50d2fc,_0x2d7401),_0x2d7401;},'resolveActivationId':async _0x581b3f=>{const _0x1bb362=_0x122d4b,_0x1c41ce=_0x3990da[_0x1bb362(0xca)](_0x581b3f);if(_0x1c41ce)return _0x1c41ce;if(_0x2c32bc[_0x1bb362(0x121)]){await _0x2251b9();const _0x444c7d=_0x3990da['get'](_0x581b3f);if(_0x444c7d)return _0x444c7d;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x1bb362(0x107)+_0x581b3f+_0x1bb362(0x80)+_0x2c32bc[_0x1bb362(0xde)][_0x1bb362(0xdc)]+').\x20'+_0x1bb362(0xa3));},'resolveEmbeddedActivationId':async(_0x35079b,_0x51e77b)=>{const _0x3561a0=_0x122d4b,_0x2fe091=_0x3990da[_0x3561a0(0xca)](_0x35079b);if(_0x2fe091)return _0x2fe091;if(_0x2c32bc[_0x3561a0(0xc1)])return _0x25d80c[_0x3561a0(0xa1)](_0x35079b,_0x51e77b),createPendingActivationId(_0x35079b);if(_0x2c32bc[_0x3561a0(0x121)]){await _0x2251b9();const _0x5311b0=_0x3990da[_0x3561a0(0xca)](_0x51e77b[_0x3561a0(0xdc)]);if(_0x5311b0)return _0x3990da[_0x3561a0(0xa1)](_0x35079b,_0x5311b0),_0x5311b0;const _0x125579=activationSignature(_0x51e77b),_0x1ae8eb=_0x50543c?.[_0x3561a0(0xca)](_0x125579);if(_0x1ae8eb)return _0x3990da[_0x3561a0(0xa1)](_0x35079b,_0x1ae8eb),_0x1ae8eb;const _0x2c5af4=await _0xd0f9d9(_0x51e77b,_0x2f1364[_0x3561a0(0x95)]),_0x41a8fb=await _0x350f83[_0x3561a0(0xb9)][_0x3561a0(0xf0)](_0x2c32bc['existingJourney']['id'],_0x2c5af4);return _0x3990da[_0x3561a0(0xa1)](_0x35079b,_0x41a8fb['id']),_0x41a8fb['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x3561a0(0x14c));},'resolveJourneyId':async _0x44a65f=>{const _0x796da0=_0x122d4b;try{return await _0x350f83[_0x796da0(0xb9)][_0x796da0(0xb1)](_0x5859a6[_0x796da0(0x8f)],_0x44a65f);}catch(_0x39587f){throw new SDKError(ErrorCode[_0x796da0(0x90)],_0x796da0(0x127)+_0x44a65f+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x2c32bc['yamlConfig']['name']+'\x27)',_0x39587f);}},'resolveStageId':async(_0x4ccac5,_0x41c398)=>{const _0x12b7e9=_0x122d4b,_0x249dcd=await _0x350f83[_0x12b7e9(0xb9)][_0x12b7e9(0x135)](_0x4ccac5),_0x26f645=_0x249dcd[_0x12b7e9(0xab)]['journeyStages'][_0x12b7e9(0x159)](_0x580743=>_0x580743[_0x12b7e9(0xdc)][_0x12b7e9(0xda)]()===_0x41c398[_0x12b7e9(0xda)]());if(!_0x26f645?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x41c398+_0x12b7e9(0x96)+(_0x249dcd[_0x12b7e9(0xab)][_0x12b7e9(0x9a)]||_0x249dcd[_0x12b7e9(0xab)]['name'])+'\x27');return _0x26f645['id'];}},_0x5bebca=await _0x53977c(_0x2c32bc[_0x122d4b(0xde)],_0x5859a6[_0x122d4b(0x8f)],_0x33ab02),_0xb31e2f=_0x5859a6[_0x122d4b(0xb4)]||_0x5859a6[_0x122d4b(0x97)];_0xb31e2f&&(_0x5bebca[_0x122d4b(0x10e)]={'parentFolder':{'data':{'id':_0xb31e2f,'type':_0x122d4b(0x8b)}}});if(_0x2c32bc[_0x122d4b(0xc1)]){if(_0x466bed['size']>0x0||_0x25d80c[_0x122d4b(0xfa)]>0x0)return await executeThreeStepJourneyCreate(_0x350f83,_0x2c32bc,_0x5bebca,{'pendingEmbeddedSegments':_0x466bed,'pendingEmbeddedActivations':_0x25d80c,'embeddedSegmentNameToId':_0x8c04fd,'journeyActivationNameToId':_0x3990da},{..._0x5859a6,'effectiveFolderId':_0xb31e2f},_0x2f1364,_0x2032e0,_0x4932bc);else{ensureJourneyDefaults(_0x5bebca[_0x122d4b(0xab)]);const _0xc01b22=await _0x350f83[_0x122d4b(0xb9)][_0x122d4b(0x139)](_0x5bebca);return{'action':'created','journeyId':_0xc01b22['id'],'embeddedSegmentNameToId':_0x8c04fd};}}else{if(_0x2c32bc[_0x122d4b(0x124)]&&_0x2c32bc[_0x122d4b(0x121)])return ensureJourneyDefaults(_0x5bebca[_0x122d4b(0xab)]),await _0x350f83[_0x122d4b(0xb9)][_0x122d4b(0xe1)](_0x2c32bc[_0x122d4b(0x121)]['id'],_0x5bebca),{'action':_0x122d4b(0x12a),'journeyId':_0x2c32bc['existingJourney']['id'],'embeddedSegmentNameToId':_0x8c04fd};}return{'action':_0x122d4b(0xd7),'journeyId':_0x2c32bc[_0x122d4b(0x121)]?.['id'],'embeddedSegmentNameToId':_0x8c04fd};}function findSegmentCriteriaLocation(_0x488bf6,_0x861808){const _0x4e7b06=a110_0xefe081,_0x5daecf=_0x488bf6[_0x4e7b06(0x10d)]||_0x488bf6[_0x4e7b06(0x82)]?.[0x0]?.[_0x4e7b06(0x10d)]||[];let _0x338007=_0x4e7b06(0xbf),_0x2f11ab=_0x861808;const _0x23d0d6=_0x488bf6['goal']||_0x488bf6['journeys']?.[0x0]?.['goal'];if(_0x23d0d6?.['segment']===_0x861808)return{'stageName':_0x4e7b06(0x12b),'criteriaName':_0x23d0d6[_0x4e7b06(0xdc)]||_0x861808};_0x520ead:for(const _0x469527 of _0x5daecf){if(_0x469527[_0x4e7b06(0x116)]?.[_0x4e7b06(0xa6)]===_0x861808){_0x338007=_0x469527[_0x4e7b06(0xdc)],_0x2f11ab=_0x469527[_0x4e7b06(0x116)][_0x4e7b06(0xdc)]||_0x861808;break;}if(_0x469527[_0x4e7b06(0xa8)])for(const _0xac4215 of _0x469527[_0x4e7b06(0xa8)]){if(_0xac4215[_0x4e7b06(0xd4)]==='decision_point'&&_0xac4215[_0x4e7b06(0x7e)]?.['branches'])for(const _0x413011 of _0xac4215[_0x4e7b06(0x7e)][_0x4e7b06(0xe4)]){if(_0x413011[_0x4e7b06(0xa6)]===_0x861808){_0x338007=_0x469527[_0x4e7b06(0xdc)],_0x2f11ab=_0x413011['name']||_0x861808;break _0x520ead;}}}}return{'stageName':_0x338007,'criteriaName':_0x2f11ab};}async function executeThreeStepJourneyCreate(_0x1b9dcf,_0x47f6b8,_0x4ced45,_0x536dcc,_0x347c06,_0x3e2462,_0x409e6a,_0x1090c1){const _0x3d471f=a110_0xefe081,{activationDefToCreateRequest:_0xd55613,yamlRuleToApi:_0x11525e}=_0x1090c1,{pendingEmbeddedSegments:_0xe91438,pendingEmbeddedActivations:_0x22fd57,embeddedSegmentNameToId:_0x48d976}=_0x536dcc,_0x520054=JSON[_0x3d471f(0x92)](JSON[_0x3d471f(0xac)](_0x4ced45));ensureJourneyDefaults(_0x520054['attributes']),stripPendingIds(_0x520054);const _0x12907a=await _0x1b9dcf[_0x3d471f(0xb9)][_0x3d471f(0x139)](_0x520054),_0x4bcd6b=_0x12907a['id'],_0xe4648c=new Map();for(const _0x458e87 of _0x12907a[_0x3d471f(0xab)]['journeyStages']){_0xe4648c['set'](_0x458e87['name'][_0x3d471f(0xda)](),_0x458e87['id']);}for(const [_0x309b89,{definition:_0x1d656a}]of _0xe91438){const _0x13a81b=generateDeterministicJourneySegmentName(_0x47f6b8['yamlConfig'][_0x3d471f(0xdc)],_0x309b89);_0x409e6a['onProgress']?.({'type':'embedded_segment_creating','journeyName':_0x47f6b8[_0x3d471f(0xde)]['name'],'segmentName':_0x309b89});const _0x320633=createSegmentIdResolver(_0x3e2462['segmentNameToId'],_0x309b89),_0x441175=await resolveRuleSegmentIds(_0x1d656a['rule'],_0x320633),_0x14aef5=await _0x1b9dcf['segment'][_0x3d471f(0xe5)]({'name':_0x13a81b,'description':_0x1d656a[_0x3d471f(0x83)]||_0x3d471f(0x119)+_0x309b89,'journeyId':_0x4bcd6b,'rule':_0x11525e(_0x441175,!![]),'countPopulation':!![],'parentFolderId':_0x347c06['effectiveFolderId']||'','audienceId':_0x347c06[_0x3d471f(0x8f)]});_0x48d976['set'](_0x309b89,_0x14aef5),_0x3e2462[_0x3d471f(0x133)]['set'](_0x309b89,_0x14aef5),_0x409e6a[_0x3d471f(0x87)]?.({'type':_0x3d471f(0xee),'journeyName':_0x47f6b8[_0x3d471f(0xde)][_0x3d471f(0xdc)],'segmentName':_0x309b89});}const _0x202e32=new Map();for(const [_0x2d475d,_0x192798]of _0x22fd57){_0x409e6a[_0x3d471f(0x87)]?.({'type':_0x3d471f(0x11d),'journeyName':_0x47f6b8['yamlConfig'][_0x3d471f(0xdc)],'activationName':_0x2d475d});const _0x4e1f93=await _0xd55613(_0x192798,_0x3e2462[_0x3d471f(0x95)]),_0x4d1dd8=await _0x1b9dcf[_0x3d471f(0xb9)][_0x3d471f(0xf0)](_0x4bcd6b,_0x4e1f93);_0x202e32[_0x3d471f(0xa1)](_0x2d475d,_0x4d1dd8['id']),_0x536dcc['journeyActivationNameToId'][_0x3d471f(0xa1)](_0x2d475d,_0x4d1dd8['id']),_0x409e6a[_0x3d471f(0x87)]?.({'type':_0x3d471f(0x136),'journeyName':_0x47f6b8[_0x3d471f(0xde)][_0x3d471f(0xdc)],'activationName':_0x2d475d});}const _0x101d2a=JSON[_0x3d471f(0x92)](JSON[_0x3d471f(0xac)](_0x4ced45));return _0x101d2a['id']=_0x4bcd6b,ensureJourneyDefaults(_0x101d2a[_0x3d471f(0xab)]),resolvePendingIdsInRequest(_0x101d2a,_0x4ced45,_0xe4648c,_0x48d976,_0x202e32,_0x409e6a),await _0x1b9dcf[_0x3d471f(0xb9)][_0x3d471f(0xe1)](_0x4bcd6b,_0x101d2a),{'action':_0x3d471f(0xe7),'journeyId':_0x4bcd6b,'embeddedSegmentNameToId':_0x48d976};}function stripPendingIds(_0xf810d2){const _0x59a698=a110_0xefe081;for(const _0x4e6488 of _0xf810d2[_0x59a698(0xab)][_0x59a698(0x14a)]||[]){_0x4e6488[_0x59a698(0x8e)]?.[_0x59a698(0x13e)]&&isPendingSegmentId(_0x4e6488[_0x59a698(0x8e)][_0x59a698(0x13e)])&&delete _0x4e6488['entryCriteria'];if(_0x4e6488[_0x59a698(0xa8)])for(const _0x430744 of Object[_0x59a698(0x120)](_0x4e6488[_0x59a698(0xa8)])){const _0x14de00=_0x4e6488[_0x59a698(0xa8)][_0x430744];_0x14de00[_0x59a698(0xd4)]===_0x59a698(0x12d)&&_0x14de00[_0x59a698(0x89)]&&isPendingActivationId(_0x14de00[_0x59a698(0x89)])&&(_0x14de00[_0x59a698(0x89)]='');if(_0x14de00['type']===_0x59a698(0xf2)&&_0x14de00[_0x59a698(0xe4)])for(const _0x3fad37 of _0x14de00['branches']){_0x3fad37[_0x59a698(0x13e)]&&isPendingSegmentId(_0x3fad37['segmentId'])&&(_0x3fad37['segmentId']='');}_0x14de00[_0x59a698(0xd4)]===_0x59a698(0x11c)&&_0x14de00['waitCondition']?.['segmentId']&&isPendingSegmentId(_0x14de00[_0x59a698(0xd8)][_0x59a698(0x13e)])&&(_0x14de00[_0x59a698(0xd8)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x380250,_0x298fb5,_0x18da4b,_0x77cdff,_0x1bf0d9,_0x5327ce){const _0x2fc143=a110_0xefe081,_0x3db0fe=(_0x1ff762,_0x3d2f5b)=>{const _0x305f26=a110_0x50ad;if(!isPendingSegmentId(_0x1ff762))return _0x1ff762;const _0x7e187c=extractPendingSegmentName(_0x1ff762),_0x2ce01c=_0x77cdff[_0x305f26(0xca)](_0x7e187c);return!_0x2ce01c&&_0x5327ce[_0x305f26(0xfc)]?.(_0x305f26(0x104)+_0x7e187c+_0x305f26(0x151)+_0x3d2f5b),_0x2ce01c;};if(_0x380250[_0x2fc143(0xab)][_0x2fc143(0x12b)]?.['segmentId']&&isPendingSegmentId(_0x380250[_0x2fc143(0xab)][_0x2fc143(0x12b)][_0x2fc143(0x13e)])){const _0x2212c3=_0x3db0fe(_0x380250['attributes'][_0x2fc143(0x12b)][_0x2fc143(0x13e)],_0x2fc143(0x81));_0x2212c3&&(_0x380250['attributes']['goal'][_0x2fc143(0x13e)]=_0x2212c3);}for(const _0x217ea7 of _0x380250['attributes']['journeyStages']||[]){const _0x2797fa=_0x18da4b[_0x2fc143(0xca)](_0x217ea7[_0x2fc143(0xdc)][_0x2fc143(0xda)]());_0x2797fa&&(_0x217ea7['id']=_0x2797fa);if(_0x217ea7[_0x2fc143(0x8e)]?.[_0x2fc143(0x13e)]&&isPendingSegmentId(_0x217ea7[_0x2fc143(0x8e)]['segmentId'])){const _0x3623f9=_0x3db0fe(_0x217ea7['entryCriteria']['segmentId'],_0x2fc143(0xd3)+_0x217ea7[_0x2fc143(0xdc)]+'\x27\x20entry\x20criteria');_0x3623f9&&(_0x217ea7[_0x2fc143(0x8e)][_0x2fc143(0x13e)]=_0x3623f9);}if(_0x217ea7[_0x2fc143(0x106)])for(const _0x4a939e of _0x217ea7[_0x2fc143(0x106)]){if(_0x4a939e[_0x2fc143(0x13e)]&&isPendingSegmentId(_0x4a939e[_0x2fc143(0x13e)])){const _0x3b40c6=_0x3db0fe(_0x4a939e[_0x2fc143(0x13e)],'stage\x20\x27'+_0x217ea7[_0x2fc143(0xdc)]+_0x2fc143(0x15a));_0x3b40c6&&(_0x4a939e['segmentId']=_0x3b40c6);}}if(_0x217ea7[_0x2fc143(0x126)]?.[_0x2fc143(0x13e)]&&isPendingSegmentId(_0x217ea7[_0x2fc143(0x126)][_0x2fc143(0x13e)])){const _0x12ff50=_0x3db0fe(_0x217ea7[_0x2fc143(0x126)]['segmentId'],_0x2fc143(0xd3)+_0x217ea7['name']+'\x27\x20milestone');_0x12ff50&&(_0x217ea7['milestone'][_0x2fc143(0x13e)]=_0x12ff50);}if(_0x217ea7[_0x2fc143(0xa8)]){const _0x3f73da=_0xce0d69=>_0x298fb5[_0x2fc143(0xab)][_0x2fc143(0x14a)][_0x2fc143(0x159)](_0x38fa18=>_0x38fa18[_0x2fc143(0xdc)][_0x2fc143(0xda)]()===_0x217ea7[_0x2fc143(0xdc)]['toLowerCase']())?.[_0x2fc143(0xa8)]?.[_0xce0d69];for(const _0x47029a of Object[_0x2fc143(0x120)](_0x217ea7[_0x2fc143(0xa8)])){const _0x35b5f7=_0x217ea7[_0x2fc143(0xa8)][_0x47029a],_0x2ed684=_0x3f73da(_0x47029a);if(_0x35b5f7[_0x2fc143(0xd4)]===_0x2fc143(0x12d)&&_0x35b5f7[_0x2fc143(0x89)]&&(isPendingActivationId(_0x35b5f7['journeyActivationStepId'])||_0x35b5f7[_0x2fc143(0x89)]==='')){if(_0x2ed684?.[_0x2fc143(0x89)]&&isPendingActivationId(_0x2ed684['journeyActivationStepId'])){const _0x392aea=extractPendingActivationName(_0x2ed684['journeyActivationStepId']),_0x4c843d=_0x1bf0d9[_0x2fc143(0xca)](_0x392aea);_0x4c843d&&(_0x35b5f7['journeyActivationStepId']=_0x4c843d);}}if(_0x35b5f7[_0x2fc143(0xd4)]==='DecisionPoint'&&_0x35b5f7['branches']&&_0x2ed684?.[_0x2fc143(0xe4)])for(let _0x526d17=0x0;_0x526d17<_0x35b5f7[_0x2fc143(0xe4)]['length'];_0x526d17++){const _0x8bd0da=_0x35b5f7[_0x2fc143(0xe4)][_0x526d17],_0x329aab=_0x2ed684[_0x2fc143(0xe4)][_0x526d17];if(_0x329aab?.[_0x2fc143(0x13e)]&&isPendingSegmentId(_0x329aab[_0x2fc143(0x13e)])){const _0x572728=_0x3db0fe(_0x329aab[_0x2fc143(0x13e)],_0x2fc143(0xd3)+_0x217ea7[_0x2fc143(0xdc)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x8bd0da[_0x2fc143(0xdc)]||_0x526d17)+'\x27');_0x572728&&(_0x8bd0da[_0x2fc143(0x13e)]=_0x572728);}}if(_0x35b5f7[_0x2fc143(0xd4)]==='WaitStep'&&_0x35b5f7['waitCondition']?.[_0x2fc143(0x13e)]&&_0x2ed684?.[_0x2fc143(0xd8)]?.[_0x2fc143(0x13e)]&&isPendingSegmentId(_0x2ed684['waitCondition']['segmentId'])){const _0x142962=_0x3db0fe(_0x2ed684[_0x2fc143(0xd8)]['segmentId'],'stage\x20\x27'+_0x217ea7[_0x2fc143(0xdc)]+'\x27\x20wait\x20condition');_0x142962&&(_0x35b5f7[_0x2fc143(0xd8)][_0x2fc143(0x13e)]=_0x142962);}}}}}
1
+ const a110_0x40c26b=a110_0x371e;(function(_0x38fe1f,_0x388c0c){const _0x1c814e=a110_0x371e,_0x400867=_0x38fe1f();while(!![]){try{const _0x51421d=-parseInt(_0x1c814e(0xf5))/0x1*(parseInt(_0x1c814e(0xd6))/0x2)+-parseInt(_0x1c814e(0x155))/0x3*(-parseInt(_0x1c814e(0x146))/0x4)+parseInt(_0x1c814e(0x12c))/0x5*(parseInt(_0x1c814e(0xc6))/0x6)+parseInt(_0x1c814e(0xba))/0x7+parseInt(_0x1c814e(0x98))/0x8*(parseInt(_0x1c814e(0x142))/0x9)+parseInt(_0x1c814e(0x122))/0xa+-parseInt(_0x1c814e(0x163))/0xb;if(_0x51421d===_0x388c0c)break;else _0x400867['push'](_0x400867['shift']());}catch(_0x21ab9b){_0x400867['push'](_0x400867['shift']());}}}(a110_0x2253,0x3477b));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a110_0x40c26b(0xd3);export function createPendingSegmentId(_0x4b45e2){return''+PENDING_SEGMENT_PREFIX+_0x4b45e2+'__';}export function isPendingSegmentId(_0x4ec188){return _0x4ec188['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5bb410){const _0x367365=a110_0x40c26b;return _0x5bb410[_0x367365(0x150)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1ed91d){return''+PENDING_ACTIVATION_PREFIX+_0x1ed91d+'__';}export function isPendingActivationId(_0x17131f){const _0x11d538=a110_0x40c26b;return _0x17131f[_0x11d538(0x168)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1eb424){return _0x1eb424['replace'](/^__pending_act_(.+)__$/,'$1');}function a110_0x371e(_0x214e95,_0x30f97e){_0x214e95=_0x214e95-0x84;const _0x225317=a110_0x2253();let _0x371ea0=_0x225317[_0x214e95];return _0x371ea0;}function generateDeterministicJourneySegmentName(_0x54a162,_0x378f82){const _0x54af5f=a110_0x40c26b,_0x367546=_0x54a162+'::'+(_0x378f82['trim']()||_0x54af5f(0x10b)),_0x13168b=createHash('sha1')[_0x54af5f(0xb9)](_0x367546)[_0x54af5f(0x160)](_0x54af5f(0xfe))['slice'](0x0,0xc);return _0x54af5f(0xfa)+_0x13168b;}export function ensureJourneyDefaults(_0x7ba53a){const _0x36fe9e=a110_0x40c26b;!_0x7ba53a[_0x36fe9e(0x135)]&&(_0x7ba53a['description']=''),!_0x7ba53a[_0x36fe9e(0x105)]&&(_0x7ba53a[_0x36fe9e(0x105)]=_0x36fe9e(0x137));}export function resolveTDFolderPath(_0x55a27d,_0x1984ad,_0x6df61c){if(!_0x1984ad)return _0x55a27d;if(_0x55a27d===_0x6df61c||_0x55a27d['startsWith'](_0x6df61c+'/'))return _0x55a27d;return _0x55a27d?_0x6df61c+'/'+_0x55a27d:_0x6df61c;}export function addFoldersToCreate(_0x512a4b,_0x5f572f,_0x19343e){const _0x5cfe23=a110_0x40c26b;if(!_0x512a4b)return;if(_0x5f572f[_0x5cfe23(0x167)](_0x512a4b))return;const _0x99025c=_0x512a4b[_0x5cfe23(0x159)]('/');let _0x503933='';for(const _0xc20a91 of _0x99025c){_0x503933=_0x503933?_0x503933+'/'+_0xc20a91:_0xc20a91,!_0x5f572f[_0x5cfe23(0x167)](_0x503933)&&_0x19343e[_0x5cfe23(0xb6)](_0x503933);}}import*as a110_0x345e85 from'yaml';import{readFileSync}from'fs';import a110_0x2f9800 from'path';import{isJourneyDef,parseYamlString as a110_0x17e757,toYamlString as a110_0x33704e,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(_0x1d3827){const _0x31aa97=a110_0x40c26b;if(Array[_0x31aa97(0x129)](_0x1d3827))return'['+_0x1d3827['map'](_0x504c45=>stableStringify(_0x504c45))[_0x31aa97(0x92)](',')+']';if(_0x1d3827&&typeof _0x1d3827===_0x31aa97(0xdb)){const _0x958d4c=_0x1d3827,_0xbefd76=Object['keys'](_0x958d4c)['sort'](),_0x3428c2=_0xbefd76[_0x31aa97(0x115)](_0x3380b6=>'\x22'+_0x3380b6+'\x22:'+stableStringify(_0x958d4c[_0x3380b6]));return'{'+_0x3428c2[_0x31aa97(0x92)](',')+'}';}const _0x53ce01=JSON[_0x31aa97(0x15c)](_0x1d3827);return _0x53ce01===undefined?_0x31aa97(0x154):_0x53ce01;}function activationSignature(_0x402e61){const _0x3da27e=a110_0x40c26b,_0x12c3bb={'connection':_0x402e61[_0x3da27e(0x11f)],..._0x402e61[_0x3da27e(0xe9)]!==undefined&&{'all_columns':_0x402e61[_0x3da27e(0xe9)]},..._0x402e61[_0x3da27e(0x8c)]!==undefined&&{'columns':_0x402e61[_0x3da27e(0x8c)]},..._0x402e61[_0x3da27e(0x165)]!==undefined&&{'behavior':_0x402e61[_0x3da27e(0x165)]},..._0x402e61[_0x3da27e(0xfc)]!==undefined&&{'schedule':_0x402e61[_0x3da27e(0xfc)]},..._0x402e61[_0x3da27e(0xdf)]!==undefined&&{'notification':_0x402e61[_0x3da27e(0xdf)]},..._0x402e61[_0x3da27e(0x8d)]!==undefined&&{'connector_config':_0x402e61[_0x3da27e(0x8d)]},..._0x402e61[_0x3da27e(0xce)]!==undefined&&{'activation_template_id':_0x402e61[_0x3da27e(0xce)]}};return stableStringify(_0x12c3bb);}export async function prepareSegmentFiles(_0x22fb2f,_0x169b91,_0x9a9e31,_0x25d8e9,_0x476b18){const _0x4daebc=a110_0x40c26b,{activationDefToCreateRequest:_0x9c0b29}=await import(_0x4daebc(0x158)),_0x54a6d7=[],_0x28e25f=new Set();for(const {yamlConfig:_0x28522f,folderPath:_0x4257e7,sourcePath:_0x56f86d}of _0x22fb2f){const _0x109de5=resolveTDFolderPath(_0x4257e7,_0x25d8e9,_0x476b18),_0x1dec21=_0x109de5+':'+_0x28522f[_0x4daebc(0x15d)],_0x3bc791=_0x169b91[_0x4daebc(0x10e)][_0x4daebc(0x109)](_0x1dec21),_0x3b89e3=_0x3bc791?_0x169b91[_0x4daebc(0xee)]['get'](_0x3bc791['id'])||[]:[];addFoldersToCreate(_0x109de5,_0x169b91[_0x4daebc(0x14b)],_0x28e25f);const _0x154191=calculateActivationActions(_0x28522f['activations']||[],_0x3b89e3,_0x169b91[_0x4daebc(0xc7)],_0x169b91[_0x4daebc(0x169)]);for(const _0xca13e3 of _0x154191){(_0xca13e3[_0x4daebc(0x162)]==='create'||_0xca13e3[_0x4daebc(0x162)]===_0x4daebc(0xb9))&&_0xca13e3[_0x4daebc(0xbf)]&&(_0xca13e3['validatedRequest']=await _0x9c0b29(_0xca13e3[_0x4daebc(0xbf)],_0x9a9e31));}const _0x373d4c=calculateSegmentDiff(_0x28522f,_0x3bc791,_0x3b89e3,_0x169b91[_0x4daebc(0xc7)],_0x169b91[_0x4daebc(0x169)]);_0x54a6d7[_0x4daebc(0x145)]({'relativePath':_0x28522f['name'],'absolutePath':_0x56f86d,'yamlConfig':_0x28522f,'folderPath':_0x109de5,'existingSegment':_0x3bc791,'existingActivations':_0x3b89e3,'isNew':_0x373d4c[_0x4daebc(0x164)],'hasChanges':_0x373d4c['hasChanges'],'diff':_0x373d4c[_0x4daebc(0x161)],'activationActions':_0x154191});}return{'segmentFiles':_0x54a6d7,'foldersToCreate':_0x28e25f};}export async function prepareJourneyFiles(_0x3d9a62,_0x55abb8,_0x2a0d27,_0x39edf0){const _0x3cfe35=a110_0x40c26b,_0x40d59b=[],_0x4d9d48=new Set();for(const {yamlConfig:_0x15988f,folderPath:_0x1d4a65,sourcePath:_0x63cec1}of _0x3d9a62){const _0x2a11b5=resolveTDFolderPath(_0x1d4a65,_0x2a0d27,_0x39edf0),_0x5ddc14=_0x2a11b5+':'+_0x15988f[_0x3cfe35(0x15d)],_0x349d4a=_0x55abb8[_0x3cfe35(0x84)][_0x3cfe35(0x109)](_0x5ddc14);let _0x95515f,_0x1c6414;if(_0x349d4a&&_0x349d4a[_0x3cfe35(0x106)]>0x0){const _0x130349=buildLocalExpandedRuleMappings(_0x15988f),{createYamlContext:_0x1bc584,prefetchJourneySegments:_0x3b600b}=createPushYamlContextForBundle(_0x55abb8['deps'],_0x55abb8['parentId'],_0x55abb8['existingSegments'],_0x130349,_0x55abb8[_0x3cfe35(0xc7)],_0x55abb8[_0x3cfe35(0x169)],_0x55abb8[_0x3cfe35(0x139)],_0x55abb8[_0x3cfe35(0xab)]);await _0x3b600b(_0x349d4a['map'](_0x2e3890=>_0x2e3890['id']));const _0x4af101=hasMultipleVersions(_0x15988f),_0x1902b7=async _0x5854a4=>{const _0x1979fc=_0x3cfe35,_0x165ca9=_0x55abb8[_0x1979fc(0xab)]?.[_0x1979fc(0x109)](_0x5854a4);if(_0x165ca9)return _0x165ca9;return _0x55abb8[_0x1979fc(0xf1)]({'journeyId':_0x5854a4,'journeyName':_0x15988f[_0x1979fc(0x15d)],'isMultiVersion':_0x349d4a[_0x1979fc(0x106)]>0x1});};if(_0x4af101&&_0x349d4a['length']>0x1){const _0x4cdfcc=[];for(const _0xab5f7a of _0x349d4a){const _0x1a54c4=_0xab5f7a[_0x3cfe35(0xbd)]||0x1;_0x55abb8[_0x3cfe35(0xeb)]?.['update']('Fetching\x20'+_0x15988f['name']+'\x20v'+_0x1a54c4);const _0x5a86f5=await _0x1902b7(_0xab5f7a['id']),_0x248026=_0x1bc584(_0xab5f7a['id']),_0x13c357=await journeyResponseToDef(_0x5a86f5,_0x248026);_0x4cdfcc[_0x3cfe35(0x145)]({'item':_0xab5f7a,'yaml':_0x13c357});}const _0x21eac2=buildLocalRuleToNameMappingFromJourney(_0x15988f);_0x1c6414=buildMergedJourneyDef(_0x4cdfcc,_0x21eac2);const _0x2263e6=Math[_0x3cfe35(0x8a)](..._0x4cdfcc[_0x3cfe35(0x115)](_0x35577e=>_0x35577e[_0x3cfe35(0xc9)][_0x3cfe35(0xbd)]||0x0)),_0x455c4f=_0x349d4a[_0x3cfe35(0xd0)](_0x32ff29=>(_0x32ff29[_0x3cfe35(0xbd)]||0x0)===_0x2263e6);_0x455c4f&&(_0x55abb8[_0x3cfe35(0xeb)]?.['update']('Fetching\x20'+_0x15988f[_0x3cfe35(0x15d)]+'\x20v'+_0x2263e6),_0x95515f=await _0x1902b7(_0x455c4f['id']));}else{const _0x1595af=_0x349d4a[_0x349d4a[_0x3cfe35(0x106)]-0x1];_0x55abb8[_0x3cfe35(0xeb)]?.[_0x3cfe35(0xb9)](_0x3cfe35(0xc0)+_0x15988f['name']),_0x95515f=await _0x1902b7(_0x1595af['id']);const _0x3f6d1e=_0x1bc584(_0x1595af['id']),_0x310506=await journeyResponseToDef(_0x95515f,_0x3f6d1e),_0x268440=buildLocalRuleToNameMappingFromJourney(_0x15988f);_0x1c6414=buildMergedJourneyDef([{'item':_0x1595af,'yaml':_0x310506}],_0x268440);}}addFoldersToCreate(_0x2a11b5,_0x55abb8[_0x3cfe35(0x14b)],_0x4d9d48);const _0x15b8ef=calculateJourneyDiff(_0x15988f,_0x1c6414);_0x40d59b['push']({'relativePath':_0x15988f[_0x3cfe35(0x15d)],'absolutePath':_0x63cec1,'yamlConfig':_0x15988f,'folderPath':_0x2a11b5,'existingJourney':_0x95515f,'isNew':_0x15b8ef[_0x3cfe35(0x164)],'hasChanges':_0x15b8ef[_0x3cfe35(0x9e)],'diff':_0x15b8ef['diff']});}return{'journeyFiles':_0x40d59b,'foldersToCreate':_0x4d9d48};}export function calculateActivationActions(_0x2466ed,_0xf02486,_0x30e6e4,_0x3c02b9){const _0x310f50=a110_0x40c26b,_0x3f34fa=[],_0x238c0a=new Map();for(const _0x4ab198 of _0xf02486){_0x238c0a[_0x310f50(0xb4)](_0x4ab198[_0x310f50(0x15d)],_0x4ab198);}const _0x526d03=new Map();for(const _0x1ce3ca of _0x2466ed){_0x526d03[_0x310f50(0xb4)](_0x1ce3ca[_0x310f50(0x15d)],_0x1ce3ca);}for(const _0x5de6d0 of _0x2466ed){const _0x7e791b=_0x238c0a[_0x310f50(0x109)](_0x5de6d0[_0x310f50(0x15d)]);if(!_0x7e791b)_0x3f34fa[_0x310f50(0x145)]({'type':'create','name':_0x5de6d0[_0x310f50(0x15d)],'yamlActivation':_0x5de6d0});else{const _0x32984d=activationResponseToDef(_0x7e791b,_0x30e6e4,_0x3c02b9),_0x46f61b=a110_0x345e85[_0x310f50(0x15c)](_0x32984d),_0x2566df=a110_0x345e85['stringify'](_0x5de6d0);_0x46f61b!==_0x2566df&&_0x3f34fa[_0x310f50(0x145)]({'type':_0x310f50(0xb9),'name':_0x5de6d0['name'],'yamlActivation':_0x5de6d0,'existingActivation':_0x7e791b});}}for(const _0x338bb7 of _0xf02486){!_0x526d03[_0x310f50(0x167)](_0x338bb7[_0x310f50(0x15d)])&&_0x3f34fa[_0x310f50(0x145)]({'type':_0x310f50(0x9f),'name':_0x338bb7['name'],'existingActivation':_0x338bb7});}return _0x3f34fa;}function a110_0x2253(){const _0xfd7469=['filter','./child-segment-yaml.js','split','all','\x27\x20entry\x20criteria','stringify','name','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','folderPath','digest','diff','type','8598821RMuVGl','isNew','behavior','relative','has','startsWith','connectionIdToNameMap','journeyBundlesByFolderAndName','listSegments','utf-8','../../utils/async.js','ACTIVATION_UPDATE_ERROR','Updated\x20journey\x20\x27','max','segmentId','columns','connector_config','results','journey_created','activationActions','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','join','toString','activation_deleting','\x20journey\x20from\x20file:\x20','create','Deleted\x20activation\x20\x27','64mauCoj','activation_','getActivation','with','Entry\x20criteria:\x20','\x20(referenced\x20in\x20journey\x20','hasChanges','delete','nameToType','embedded_segment_created','updateSegmentById','embedded_segment_creating','reduce','existingSegments','segment_created','keys','\x27\x20exit\x20criteria','slice','flatMap','journeyById','createJourneySegment','folderId','segment_deleted','createActivation','deleteActivation','parentSegmentFolder','attributes','SEGMENT_UPDATE_ERROR','set','resolveJourneyId','add','kind','WaitStep','update','2383906PuiAXc','parentFolder','updated','versionNumber','Journey\x20\x27','yamlActivation','Fetching\x20','activations',').\x20','existingActivation','activation_updated','values','99066POOfrB','idToEmailMap','segment_deleting','item','NOT_FOUND','index','Name\x20has\x20already\x20been\x20taken','journeyBundleName','activation_template_id','logWarning','find','createSegment','Segment\x20not\x20found:\x20','__pending_act_','Updating\x20activation\x20\x27','getJourney','449534GDzxdS','verbose','unchanged','stage\x20\x27','folder_created','object','journey_creating','parse','goal','notification','\x27\x20not\x20found\x20in\x20journey\x20\x27','toLowerCase','Failed\x20to\x20','\x27\x20for\x20','relationships','existingJourney','activation_creating','entry','onProgress','all_columns','SEGMENT_SYNTAX_ERROR','progress','milestone','errors','activationsBySegmentId','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','effectiveFolderId','fetchJourney','buildUserMaps','localSegmentRules','size','1PffkoA','Deleted\x20segment\x20\x27','journeyStages','journeyActivationNameToId','\x27...','journey_entry_criteria_','sort','schedule','list','hex','segments','logSuccess','createdSegmentId','\x27\x20milestone','Creating\x20folder\x20\x27','Updated\x20segment\x20\x27','state','length','\x27\x20decision\x20point\x20branch\x20\x27','embeddedSegmentNameToId','get','journeyId','segment','validatedRequest','\x27\x20from\x20file:\x20','segmentByFolderAndName','SEGMENT_NOT_FOUND','created','JOURNEY_SYNTAX_ERROR','Created\x20activation\x20\x27','Created\x20journey\x20\x27','segment_updating','map','withProgress','from','Activation','waitCondition','activationContext','entry_criteria','createdSegmentIds','journey','INTERNAL','connection','\x20activation\x20\x27','rule','174240wsGKVQ','journeyActivationStepId','Created\x20segment\x20\x27','ACTIVATION_SYNTAX_ERROR','stages','logDeleted','folder_creating','isArray','Updated\x20activation\x20\x27','steps','75kRbeBz','getSegment','Created\x20folder\x20\x27','action','Updating\x20segment\x20\x27','yamlConfig','logInfo','absolutePath','\x0a\x20\x20','description','segmentFolderId','draft','Creating\x20segment\x20\x27','activationStepsById','journeys','embedded_activation_created','dirname','deleteSegment','entryCriteria','rootFolderId','./journey-yaml.js','valid','462798FFAaGJ','listActivations','user','push','408724jvVnWH','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','parentId','existingSegment','createFolder','folderPathToId','data','goal\x20criteria','segmentNameToId','branches','replace','DecisionPoint','skipSegments','deleted','null','6KaFSbq','exitCriterias'];a110_0x2253=function(){return _0xfd7469;};return a110_0x2253();}export function calculateSegmentDiff(_0x551802,_0x9aba93,_0x56bd5e,_0x3ea8db,_0x26a0b3){const _0x19e457=segmentToYamlString(_0x551802);if(_0x9aba93){const _0x2b8ef=segmentWithActivationsToYaml(_0x9aba93,_0x56bd5e,undefined,_0x3ea8db,_0x26a0b3),_0x23f943=segmentToYamlString(_0x2b8ef),_0x5c126e=generateDiff(_0x23f943,_0x19e457),_0x1222ae=hasChanges(_0x5c126e);return{'isNew':![],'hasChanges':_0x1222ae,'diff':_0x1222ae?formatDiffWithColors(_0x5c126e):undefined};}const _0x31f29f=generateDiff('',_0x19e457);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x31f29f)};}export function calculateJourneyDiff(_0x5aa6e1,_0x41c3b8){const _0x29c15d=normalizeJourneyDef(_0x5aa6e1,_0x5aa6e1),_0x28904b=a110_0x33704e(_0x29c15d);if(_0x41c3b8){const _0x18feac=normalizeJourneyDef(_0x41c3b8,_0x5aa6e1),_0x54bccb=a110_0x33704e(_0x18feac),_0x2454b5=generateDiff(_0x54bccb,_0x28904b),_0x3e32ef=hasChanges(_0x2454b5);return{'isNew':![],'hasChanges':_0x3e32ef,'diff':_0x3e32ef?formatDiffWithColors(_0x2454b5):undefined};}const _0x5a91c0=generateDiff('',_0x28904b);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5a91c0)};}export function findSegmentsToDelete(_0x382670,_0x32866b,_0xa71ffa,_0x80d08c,_0x49cee8){const _0x1705ee=a110_0x40c26b,_0x5bc423=new Set();for(const {yamlConfig:_0x3bd653,folderPath:_0x16c580}of _0x32866b){_0x5bc423[_0x1705ee(0xb6)](_0x16c580+':'+_0x3bd653[_0x1705ee(0x15d)]);}return _0x382670[_0x1705ee(0x157)](_0x17ab35=>{const _0x533a63=_0x1705ee,_0x42db24=_0x17ab35[_0x533a63(0x136)]?_0xa71ffa[_0x533a63(0x109)](_0x17ab35[_0x533a63(0x136)]['toString']())||'':'',_0x402252=_0x42db24+':'+_0x17ab35[_0x533a63(0x15d)];if(_0x5bc423[_0x533a63(0x167)](_0x402252))return![];if(_0x49cee8)return _0x42db24===_0x80d08c||_0x42db24[_0x533a63(0x168)](_0x80d08c+'/');return!![];});}export function findJourneysToDelete(_0x4af1d4,_0x4150d4,_0x50b40e,_0x5513cc,_0x45e43f){const _0x42f07e=a110_0x40c26b,_0x2dc5ee=new Set();for(const {yamlConfig:_0x3a97c5,folderPath:_0x14d6d7}of _0x4150d4){_0x2dc5ee['add'](_0x14d6d7+':'+_0x3a97c5['name']);}return _0x4af1d4[_0x42f07e(0x157)](_0x387fed=>{const _0x2b8e48=_0x42f07e,_0x1b4db1=_0x387fed[_0x2b8e48(0xad)]?_0x50b40e[_0x2b8e48(0x109)](_0x387fed[_0x2b8e48(0xad)])||'':'',_0x5b3922=_0x1b4db1+':'+_0x387fed[_0x2b8e48(0xcd)];if(_0x2dc5ee['has'](_0x5b3922))return![];if(_0x45e43f)return _0x1b4db1===_0x5513cc||_0x1b4db1[_0x2b8e48(0x168)](_0x5513cc+'/');return!![];});}export function buildSegmentLookupMap(_0x1b85de,_0xa658b1){const _0x2e83c8=a110_0x40c26b,_0x2a233b=new Map();for(const _0x17af93 of _0x1b85de){const _0x1b306f=_0x17af93[_0x2e83c8(0x136)]?_0xa658b1[_0x2e83c8(0x109)](_0x17af93['segmentFolderId'][_0x2e83c8(0x93)]())||'':'',_0x4b2d48=_0x1b306f+':'+_0x17af93['name'];_0x2a233b[_0x2e83c8(0xb4)](_0x4b2d48,_0x17af93);}return _0x2a233b;}export function buildSegmentNameToIdMap(_0x21b5ec){const _0x2a939c=a110_0x40c26b,_0x46b19f=new Map();for(const _0x352c80 of _0x21b5ec){_0x46b19f[_0x2a939c(0xb4)](_0x352c80['name'],_0x352c80['id']);}return _0x46b19f;}export function buildJourneyBundleLookupMap(_0x3f7b04,_0x282bcd){const _0x40d99c=a110_0x40c26b,_0x2db627=new Map();for(const _0x3696dc of _0x3f7b04){const _0x3360c7=_0x3696dc['folderId']?_0x282bcd[_0x40d99c(0x109)](_0x3696dc['folderId'])||'':'',_0x22e1f8=_0x3360c7+':'+_0x3696dc[_0x40d99c(0xcd)];!_0x2db627[_0x40d99c(0x167)](_0x22e1f8)&&_0x2db627['set'](_0x22e1f8,[]),_0x2db627[_0x40d99c(0x109)](_0x22e1f8)[_0x40d99c(0x145)](_0x3696dc);}for(const _0x2649a9 of _0x2db627[_0x40d99c(0xc5)]()){_0x2649a9['sort']((_0x153b6,_0x4e277d)=>(_0x153b6[_0x40d99c(0xbd)]||0x0)-(_0x4e277d[_0x40d99c(0xbd)]||0x0));}return _0x2db627;}export function collectFoldersToCreate(_0x54ee42,_0x12ea29){const _0x15ce2d=a110_0x40c26b,_0x27309c=new Set();for(const _0x4704dc of _0x54ee42){if(!_0x4704dc)continue;if(_0x12ea29[_0x15ce2d(0x167)](_0x4704dc))continue;const _0x2c6a2f=_0x4704dc['split']('/');let _0x5ba7a4='';for(const _0x1520bf of _0x2c6a2f){_0x5ba7a4=_0x5ba7a4?_0x5ba7a4+'/'+_0x1520bf:_0x1520bf,!_0x12ea29[_0x15ce2d(0x167)](_0x5ba7a4)&&_0x27309c[_0x15ce2d(0xb6)](_0x5ba7a4);}}return _0x27309c;}export function parseAndClassifyYamlFiles(_0x16b1df,_0x182eb7,_0x56ad96){const _0x1f07f4=a110_0x40c26b,_0x2e9b38=[],_0x5fab0=[];for(const _0xb2212b of _0x16b1df){const _0x552a40=a110_0x2f9800[_0x1f07f4(0x166)](_0x182eb7,a110_0x2f9800[_0x1f07f4(0x13c)](_0xb2212b)),_0xda353d=_0x552a40==='.'?'':_0x552a40,_0x49c01e=readFileSync(_0xb2212b,'utf-8'),_0x40492c=a110_0x345e85['parse'](_0x49c01e);if(isJourneyDef(_0x40492c)){const _0x2ceb02=a110_0x17e757(_0x49c01e);_0x5fab0['push']({'yamlConfig':_0x2ceb02,'folderPath':_0xda353d,'sourcePath':_0xb2212b});}else{if(!_0x56ad96?.[_0x1f07f4(0x152)]){const _0x327e60=parseSegmentYamlFile(_0x49c01e),_0xeab2ee=normalizeChildSegmentYaml(_0x327e60);_0x2e9b38[_0x1f07f4(0x145)]({'yamlConfig':_0xeab2ee,'folderPath':_0xda353d,'sourcePath':_0xb2212b});}}}return{'segments':_0x2e9b38,'journeys':_0x5fab0};}export function validateParsedFiles(_0x3ea969,_0x23a073){const _0x57d9c5=a110_0x40c26b,_0x513cdf=[];for(const {yamlConfig:_0x32baae,sourcePath:_0xd28681}of _0x3ea969['segments']){const _0xd3a564=readFileSync(_0xd28681,_0x57d9c5(0x86)),_0x20a5f4=a110_0x345e85['parseDocument'](_0xd3a564),_0x577e97=validateSegmentDef(_0x32baae,{'source':_0xd3a564,'document':_0x20a5f4});if(!_0x577e97[_0x57d9c5(0x141)]){const _0x36a7bf=a110_0x2f9800[_0x57d9c5(0x166)](_0x23a073,_0xd28681);_0x513cdf[_0x57d9c5(0x145)]({'filePath':_0x36a7bf,'source':_0xd3a564,'result':_0x577e97,'isJourney':![]});}}for(const {yamlConfig:_0x432250,sourcePath:_0x25b38a}of _0x3ea969[_0x57d9c5(0x13a)]){const _0x2b6283=readFileSync(_0x25b38a,_0x57d9c5(0x86)),_0x6e2917=a110_0x345e85['parseDocument'](_0x2b6283),_0x3cdc95=validateJourneyDef(_0x432250,{'source':_0x2b6283,'document':_0x6e2917});if(!_0x3cdc95[_0x57d9c5(0x141)]){const _0x7eb157=a110_0x2f9800['relative'](_0x23a073,_0x25b38a);_0x513cdf[_0x57d9c5(0x145)]({'filePath':_0x7eb157,'source':_0x2b6283,'result':_0x3cdc95,'isJourney':!![]});}}return _0x513cdf;}export function formatValidationErrors(_0x14aa47){const _0x34e0f0=a110_0x40c26b,_0x1d351b=[];for(const {filePath:_0x1a283f,source:_0x434e22,result:_0xb74d65,isJourney:_0x4f8505}of _0x14aa47){const _0x4de038=_0x4f8505?'journey':'segment';_0x1d351b[_0x34e0f0(0x145)]('\x0a'+_0x1a283f+'\x20('+_0x4de038+'):\x20'+_0xb74d65[_0x34e0f0(0xed)]['length']+'\x20error(s)'),_0x1d351b[_0x34e0f0(0x145)](formatValidationResult(_0xb74d65,_0x434e22,_0x1a283f));}return _0x1d351b[_0x34e0f0(0x92)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x12f758){const _0x595f83=a110_0x40c26b,_0x3fa5c6=new Set(),_0x3e3132=new Map(),_0x2d1c26=collectSegmentUsageCounts(_0x12f758);if(_0x12f758[_0x595f83(0xff)])for(const [_0x126473,_0x33169f]of Object['entries'](_0x12f758[_0x595f83(0xff)])){_0x3fa5c6[_0x595f83(0xb6)](_0x126473);if(_0x33169f[_0x595f83(0x121)]){const _0x4708c0=yamlRuleToApi(_0x33169f['rule']),_0x5579a5=apiRuleToYaml(_0x4708c0);_0x3e3132['set'](_0x126473,_0x5579a5);}}const _0x4d33a2=new Map();let _0xe47309=0x0;for(const [_0x390950,_0x384d29]of _0x3e3132){const _0x1c4f2c=serializeExpandedRule(_0x384d29,_0x3e3132),_0x52326b=_0x4d33a2['get'](_0x1c4f2c)||[];_0x52326b[_0x595f83(0x145)]({'name':_0x390950,'index':_0xe47309}),_0x4d33a2[_0x595f83(0xb4)](_0x1c4f2c,_0x52326b),_0xe47309++;}const _0x2b5942=new Map();for(const [_0x4b9cd7,_0x41f27b]of _0x4d33a2){const _0x389036=_0x41f27b[_0x595f83(0xa9)]()['sort']((_0x463c34,_0x2ed6b6)=>{const _0x182775=_0x595f83,_0x289033=_0x2d1c26[_0x182775(0x109)](_0x463c34[_0x182775(0x15d)])||0x0,_0x400ba2=_0x2d1c26['get'](_0x2ed6b6[_0x182775(0x15d)])||0x0;if(_0x289033!==_0x400ba2)return _0x400ba2-_0x289033;return _0x463c34[_0x182775(0xcb)]-_0x2ed6b6['index'];})[_0x595f83(0x115)](_0x619474=>_0x619474[_0x595f83(0x15d)]),_0x38089f=[];for(const _0x1c3e92 of _0x389036){const _0x55c122=_0x2d1c26[_0x595f83(0x109)](_0x1c3e92)||0x0,_0x27e544=Math[_0x595f83(0x8a)](_0x55c122,0x1);for(let _0x4e3e21=0x0;_0x4e3e21<_0x27e544;_0x4e3e21++){_0x38089f[_0x595f83(0x145)](_0x1c3e92);}}_0x2b5942['set'](_0x4b9cd7,_0x38089f);}return{'existingLocalSegmentNames':_0x3fa5c6,'localSegmentRules':_0x3e3132,'localExpandedRuleToNames':_0x2b5942};}async function buildServerSegmentRuleMap(_0x59e7a6,_0x26a939,_0x3cb7ac,_0x2544cb){const _0x892d65=new Map(),_0x34deb1=new Set(),_0x18cad7=async _0x37c45f=>{const _0x3b0ea0=a110_0x371e;if(_0x34deb1['has'](_0x37c45f))return;_0x34deb1[_0x3b0ea0(0xb6)](_0x37c45f);let _0xcfabad=_0x3cb7ac['find'](_0x580eb=>_0x580eb['id']===_0x37c45f);if(!_0xcfabad)try{_0xcfabad=await _0x59e7a6[_0x3b0ea0(0x10b)][_0x3b0ea0(0x12d)](_0x26a939,_0x37c45f);}catch{return;}if(!_0xcfabad?.[_0x3b0ea0(0x121)])return;const _0x4b30a4=apiRuleToYaml(_0xcfabad['rule']);_0x892d65[_0x3b0ea0(0xb4)](_0x37c45f,_0x4b30a4);const _0x135b0d=collectSegmentRefsFromRule(_0x4b30a4);for(const _0xabbe4f of _0x135b0d){await _0x18cad7(_0xabbe4f);}};for(const _0x1bd35d of _0x2544cb){await _0x18cad7(_0x1bd35d);}return _0x892d65;}export function createSegmentIdResolver(_0x3b48d8,_0x38630c){return async _0x57e0e6=>{const _0x3407d7=a110_0x371e,_0x536dc6=_0x3b48d8[_0x3407d7(0x109)](_0x57e0e6);if(!_0x536dc6)throw new SDKError(ErrorCode[_0x3407d7(0x10f)],_0x3407d7(0xd2)+_0x57e0e6+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x38630c+'\x27)');return _0x536dc6;};}export function extractRootFolderId(_0x2854e7){const _0x50ceb1=a110_0x40c26b;return _0x2854e7[_0x50ceb1(0xe4)]?.[_0x50ceb1(0xb1)]?.['data']?.['id']||_0x2854e7[_0x50ceb1(0xe4)]?.[_0x50ceb1(0xbb)]?.[_0x50ceb1(0x14c)]?.['id'];}export function buildConnectionMaps(_0x1c72fa){const _0x54a8c4=a110_0x40c26b,_0x44ba79=new Map(),_0x17580a=new Map(),_0x20a73d=new Map();for(const _0x56256c of _0x1c72fa){_0x44ba79[_0x54a8c4(0xb4)](_0x56256c[_0x54a8c4(0x15d)],parseInt(_0x56256c['id'],0xa)),_0x17580a[_0x54a8c4(0xb4)](_0x56256c['id'],_0x56256c[_0x54a8c4(0x15d)]),_0x20a73d[_0x54a8c4(0xb4)](_0x56256c[_0x54a8c4(0x15d)],_0x56256c[_0x54a8c4(0x162)]);}return{'nameToId':_0x44ba79,'idToName':_0x17580a,'nameToType':_0x20a73d};}export function calculatePushStats(_0x3822fb,_0x1d671d,_0x5317fa,_0x350b75,_0x19cae0,_0xa5036b,_0x26231a){const _0x3c3cbd=a110_0x40c26b,_0x414d93=_0x3822fb['filter'](_0x271506=>_0x271506[_0x3c3cbd(0x164)]),_0x4d528a=_0x3822fb[_0x3c3cbd(0x157)](_0x2846d8=>!_0x2846d8[_0x3c3cbd(0x164)]&&_0x2846d8['hasChanges']),_0x3d2bfd=_0x3822fb[_0x3c3cbd(0x157)](_0x4ba755=>!_0x4ba755[_0x3c3cbd(0x164)]&&!_0x4ba755[_0x3c3cbd(0x9e)]),_0x150f60=_0xa5036b?_0x350b75:[],_0x1c346f=_0x1d671d[_0x3c3cbd(0x157)](_0x396d50=>_0x396d50[_0x3c3cbd(0x164)]),_0x2f2448=_0x1d671d[_0x3c3cbd(0x157)](_0x46cb64=>!_0x46cb64[_0x3c3cbd(0x164)]&&_0x46cb64[_0x3c3cbd(0x9e)]),_0x4180fb=_0x1d671d[_0x3c3cbd(0x157)](_0x31c7a0=>!_0x31c7a0[_0x3c3cbd(0x164)]&&!_0x31c7a0['hasChanges']),_0x1a43a8=_0xa5036b?_0x19cae0:[],_0x4dd9bd=_0x3822fb[_0x3c3cbd(0xaa)](_0x54fb7f=>_0x54fb7f[_0x3c3cbd(0x90)]),_0x1ec28f=_0x4dd9bd[_0x3c3cbd(0x157)](_0x23dcfd=>_0x23dcfd[_0x3c3cbd(0x162)]==='create'),_0x5829bf=_0x4dd9bd[_0x3c3cbd(0x157)](_0x3430e7=>_0x3430e7['type']===_0x3c3cbd(0xb9)),_0x36e515=_0x4dd9bd[_0x3c3cbd(0x157)](_0x3044bb=>_0x3044bb[_0x3c3cbd(0x162)]===_0x3c3cbd(0x9f)),_0x4446b2=Array[_0x3c3cbd(0x117)](_0x5317fa)[_0x3c3cbd(0xfb)](),_0x493666=_0x26231a?![]:_0x414d93[_0x3c3cbd(0x106)]>0x0||_0x4d528a[_0x3c3cbd(0x106)]>0x0||_0x150f60['length']>0x0,_0x37eb30=_0x1c346f['length']>0x0||_0x2f2448[_0x3c3cbd(0x106)]>0x0||_0x1a43a8['length']>0x0,_0x25bb8d=_0x26231a?![]:_0x4dd9bd[_0x3c3cbd(0x106)]>0x0,_0x4888c8=_0x4446b2[_0x3c3cbd(0x106)]>0x0;return{'segments':{'new':_0x414d93,'changed':_0x4d528a,'unchanged':_0x3d2bfd,'toDelete':_0x150f60},'journeys':{'new':_0x1c346f,'changed':_0x2f2448,'unchanged':_0x4180fb,'toDelete':_0x1a43a8},'activations':{'all':_0x4dd9bd,'toCreate':_0x1ec28f,'toUpdate':_0x5829bf,'toDelete':_0x36e515},'folders':{'toCreate':_0x4446b2},'counts':{'segments':{'new':_0x414d93[_0x3c3cbd(0x106)],'changed':_0x4d528a[_0x3c3cbd(0x106)],'unchanged':_0x3d2bfd[_0x3c3cbd(0x106)],'toDelete':_0x150f60['length']},'journeys':{'new':_0x1c346f['length'],'changed':_0x2f2448[_0x3c3cbd(0x106)],'unchanged':_0x4180fb[_0x3c3cbd(0x106)],'toDelete':_0x1a43a8[_0x3c3cbd(0x106)]},'activations':{'create':_0x1ec28f['length'],'update':_0x5829bf[_0x3c3cbd(0x106)],'delete':_0x36e515['length']},'folders':_0x4446b2['length']},'hasChanges':_0x493666||_0x37eb30||_0x25bb8d||_0x4888c8};}export async function buildPushExecutionContext(_0x12c454,_0x13d065,_0x9fbdbc,_0x463e4c,_0x1bd469,_0x6a1c7a){const _0x47567c=a110_0x40c26b,_0xf5a36f=extractRootFolderId(_0x9fbdbc),{pathToId:_0x1db68c,idToPath:_0x2a60fc}=buildFolderMaps(_0x1bd469),_0x10fd74=buildSegmentNameToIdMap(_0x463e4c),_0x13e419=new Map(),{batchAsync:_0x1de0e2}=await import('../../utils/async.js'),[_0x3d37f1,_0x25bbd2]=await Promise[_0x47567c(0x15a)]([_0x12c454[_0x47567c(0x144)][_0x47567c(0xf2)](),_0x12c454['connection'][_0x47567c(0xfd)](),((async()=>{const _0x551271=_0x47567c;!_0x6a1c7a&&_0x463e4c[_0x551271(0x106)]>0x0&&await _0x1de0e2(_0x463e4c,async _0x4a9e68=>{const _0x3dea53=_0x551271,_0x56f338=await _0x12c454[_0x3dea53(0x10b)][_0x3dea53(0x143)](_0x13d065,_0x4a9e68['id']);_0x13e419[_0x3dea53(0xb4)](_0x4a9e68['id'],_0x56f338);});})())]),{emailToId:_0x1a33a4,idToEmail:_0x5dedf7}=_0x3d37f1,_0x1d174f=buildConnectionMaps(_0x25bbd2);return{'rootFolderId':_0xf5a36f,'folderPathToId':_0x1db68c,'folderIdToPath':_0x2a60fc,'segmentNameToId':_0x10fd74,'activationsBySegmentId':_0x13e419,'emailToIdMap':_0x1a33a4,'idToEmailMap':_0x5dedf7,'connectionNameToIdMap':_0x1d174f['nameToId'],'connectionIdToNameMap':_0x1d174f['idToName'],'connectionNameToTypeMap':_0x1d174f[_0x47567c(0xa0)]};}export function createPushYamlContextForBundle(_0x25adcc,_0x351e9c,_0x4b8207,_0xf45510,_0x15c27e,_0x78885c,_0x51321c,_0x449a2e){const {existingLocalSegmentNames:_0x487461,localExpandedRuleToNames:_0xf1bb7c}=_0xf45510,_0x200271=new Set(),_0x4a8407=new Map(),_0x39da07=new Map(),_0x4066e5=new Map(),_0x4ddf6d=createJumpTargetCache(),_0x5875f9=new Map(),_0x68753c=new Map(),_0x188cb1=new Set();let _0x55f05f;const _0x125bee=_0x211599=>{const _0x45c8a5={'resolveSegment':async _0x366990=>{const _0x4f6f4d=a110_0x371e,_0x3fdb16=_0x4066e5[_0x4f6f4d(0x109)](_0x366990);if(_0x3fdb16!==undefined)return{'name':_0x3fdb16,'isJourneyLocal':!![]};try{let _0x5c5d6d=_0x4b8207[_0x4f6f4d(0xd0)](_0x27af20=>_0x27af20['id']===_0x366990);!_0x5c5d6d&&(_0x5c5d6d=await _0x25adcc[_0x4f6f4d(0x10b)][_0x4f6f4d(0x12d)](_0x351e9c,_0x366990));const _0x5378fa=generateJourneyLocalName(_0x5c5d6d[_0x4f6f4d(0x15d)]),_0x8bcc81=_0x5c5d6d[_0x4f6f4d(0xb7)]===SEGMENT_KIND_JOURNEY&&_0x5378fa!==undefined;let _0x29dc59=_0x5c5d6d['name'],_0x5bc787;if(_0x8bcc81&&_0x5c5d6d[_0x4f6f4d(0x121)]){const _0x229b63=apiRuleToYaml(_0x5c5d6d['rule']);_0x68753c[_0x4f6f4d(0xb4)](_0x366990,_0x229b63);const _0x2749f0=async _0x2efeff=>{const _0x3dd996=_0x4f6f4d,_0x321616=collectSegmentRefsFromRule(_0x2efeff);for(const _0x3f6975 of _0x321616){if(!_0x68753c[_0x3dd996(0x167)](_0x3f6975))try{const _0x5d6350=await _0x25adcc['segment'][_0x3dd996(0x12d)](_0x351e9c,_0x3f6975);if(_0x5d6350?.[_0x3dd996(0x121)]){const _0x188028=apiRuleToYaml(_0x5d6350[_0x3dd996(0x121)]);_0x68753c[_0x3dd996(0xb4)](_0x3f6975,_0x188028),await _0x2749f0(_0x188028);}}catch{}}};await _0x2749f0(_0x229b63);const _0x49aa63=serializeExpandedRule(_0x229b63,_0x68753c),_0x4c8aeb=_0xf1bb7c[_0x4f6f4d(0x109)](_0x49aa63);if(_0x4c8aeb&&_0x4c8aeb['length']>0x0){const _0x31b7a9=_0x4a8407[_0x4f6f4d(0x109)](_0x49aa63)||0x0,_0x4512b0=_0x4c8aeb[_0x31b7a9]||_0x4c8aeb[_0x4c8aeb[_0x4f6f4d(0x106)]-0x1];_0x4a8407['set'](_0x49aa63,_0x31b7a9+0x1),_0x29dc59=_0x4512b0,_0x200271['add'](_0x29dc59),_0x4066e5[_0x4f6f4d(0xb4)](_0x366990,_0x29dc59);const _0x1171a2=await resolveRuleSegmentRefs(_0x229b63,async _0x1ca339=>{const _0x34c088=_0x4066e5['get'](_0x1ca339);if(_0x34c088)return _0x34c088;const _0x4487fd=await _0x55f05f['resolveSegment'](_0x1ca339);return _0x4487fd['name'];});_0x5bc787={'description':_0x5c5d6d['description'],'rule':_0x1171a2};}else{const _0x37f3c6=_0x5875f9['get'](_0x49aa63);if(_0x37f3c6)_0x29dc59=_0x37f3c6,_0x4066e5['set'](_0x366990,_0x29dc59);else{if(_0x5378fa){let _0x72b921=_0x5378fa,_0x12f2e3=0x2;while(_0x200271[_0x4f6f4d(0x167)](_0x72b921)||_0x487461[_0x4f6f4d(0x167)](_0x72b921)){_0x72b921=_0x5378fa+'_'+_0x12f2e3,_0x12f2e3++;}_0x200271[_0x4f6f4d(0xb6)](_0x72b921),_0x29dc59=_0x72b921;}_0x4066e5[_0x4f6f4d(0xb4)](_0x366990,_0x29dc59),_0x5875f9[_0x4f6f4d(0xb4)](_0x49aa63,_0x29dc59);const _0x4cfc23=await resolveRuleSegmentRefs(_0x229b63,async _0x37ab44=>{const _0x1dbca6=_0x4066e5['get'](_0x37ab44);if(_0x1dbca6)return _0x1dbca6;const _0x1b3feb=await _0x55f05f['resolveSegment'](_0x37ab44);return _0x1b3feb['name'];});_0x5bc787={'description':_0x5c5d6d['description'],'rule':_0x4cfc23};}}}return{'name':_0x29dc59,'isJourneyLocal':_0x8bcc81,'definition':_0x5bc787};}catch{return{'name':_0x366990,'isJourneyLocal':![]};}},'resolveActivation':async _0x59bc53=>{const _0x4d5e73=a110_0x371e,_0x4252e4=_0x39da07[_0x4d5e73(0x109)](_0x59bc53);if(_0x4252e4!==undefined)return{'name':_0x4252e4,'isJourneyLocal':!![]};try{let _0x1fedfc=_0x51321c?.[_0x4d5e73(0x109)](_0x59bc53);!_0x1fedfc&&(_0x1fedfc=await _0x25adcc[_0x4d5e73(0x11d)][_0x4d5e73(0x9a)](_0x211599,_0x59bc53));const _0x3ae7cf=_0x1fedfc['attributes']['activationParams'][_0x4d5e73(0x15d)]||_0x59bc53,_0x37a2e7=sanitizeYamlKey(_0x3ae7cf)||_0x4d5e73(0x99)+_0x59bc53,_0x6f53b0=_0x37a2e7;_0x39da07[_0x4d5e73(0xb4)](_0x59bc53,_0x6f53b0);const _0x7b2701=journeyActivationStepToYaml(_0x1fedfc,_0x15c27e,_0x78885c);return{'name':_0x6f53b0,'isJourneyLocal':!![],'definition':_0x7b2701};}catch{return{'name':_0x59bc53,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3a5235,_0x5f420c)=>resolveJumpTarget(_0x3a5235,_0x5f420c,_0x4ddf6d,async _0x1c9299=>{const _0x50554d=a110_0x371e,_0x204d37=_0x449a2e?.[_0x50554d(0x109)](_0x1c9299);if(_0x204d37)return _0x204d37;return _0x25adcc[_0x50554d(0x11d)]['getJourney'](_0x1c9299);})};return _0x55f05f=_0x45c8a5,_0x45c8a5;},_0x3a27a3=async _0x35ced3=>{const _0x4e7663=a110_0x371e,{collectSegmentIdsFromJourneyApi:_0xe9767a}=await import('./journey-yaml.js'),{batchAsync:_0x5214c9}=await import('../../utils/async.js'),_0x28eea3=new Set();for(const _0x3ec9f1 of _0x35ced3){let _0x20926c=_0x449a2e?.['get'](_0x3ec9f1);!_0x20926c&&(_0x20926c=await _0x25adcc[_0x4e7663(0x11d)][_0x4e7663(0xd5)](_0x3ec9f1));const _0x2bf5ee=_0xe9767a(_0x20926c);for(const _0x14645a of _0x2bf5ee){_0x28eea3[_0x4e7663(0xb6)](_0x14645a);}}let _0x1a8a67=Array[_0x4e7663(0x117)](_0x28eea3);while(_0x1a8a67[_0x4e7663(0x106)]>0x0){const _0x19e3e0=_0x1a8a67[_0x4e7663(0x157)](_0x14f4b4=>!_0x188cb1['has'](_0x14f4b4));if(_0x19e3e0['length']===0x0)break;const _0x5551e0=await _0x5214c9(_0x19e3e0,async _0x13e3d2=>{const _0x5b61b4=_0x4e7663;_0x188cb1[_0x5b61b4(0xb6)](_0x13e3d2);let _0x1dc3e2=_0x4b8207[_0x5b61b4(0xd0)](_0xa2d590=>_0xa2d590['id']===_0x13e3d2);if(!_0x1dc3e2)try{_0x1dc3e2=await _0x25adcc[_0x5b61b4(0x10b)][_0x5b61b4(0x12d)](_0x351e9c,_0x13e3d2);}catch{return null;}return{'segmentId':_0x13e3d2,'segment':_0x1dc3e2};},0xa),_0x46bfbb=new Set();for(const _0x526c2e of _0x5551e0){if(!_0x526c2e?.[_0x4e7663(0x10b)]?.[_0x4e7663(0x121)])continue;const _0x19c7d4=apiRuleToYaml(_0x526c2e['segment']['rule']);_0x68753c[_0x4e7663(0xb4)](_0x526c2e[_0x4e7663(0x8b)],_0x19c7d4);const _0x22c9a9=collectSegmentRefsFromRule(_0x19c7d4);for(const _0x21156c of _0x22c9a9){!_0x188cb1[_0x4e7663(0x167)](_0x21156c)&&_0x46bfbb['add'](_0x21156c);}}_0x1a8a67=Array[_0x4e7663(0x117)](_0x46bfbb);}};return{'createYamlContext':_0x125bee,'prefetchJourneySegments':_0x3a27a3};}export async function executePushSegments(_0x9f6b73,_0x5ab520,_0x3ca9a1,_0x5b4e62,_0x2191d1){const _0x2a1766=a110_0x40c26b,{segmentDefToCreateRequest:_0x48e32e,segmentDefToUpdateRequest:_0x59ab19}=await import(_0x2a1766(0x158)),_0x1699cf=_0x3ca9a1['folderPathToId'],_0x5ce059=0x5,_0x8045d9=async _0x2da982=>{const _0x2ce50a=_0x2a1766,_0x2c33f9=_0x2da982[_0x2ce50a(0x15f)]?_0x1699cf['get'](_0x2da982['folderPath']):undefined;let _0xe6d757;const _0x1bbcf9={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x2da982[_0x2ce50a(0x164)]){_0x2191d1['onProgress']?.({'type':'segment_creating','name':_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]});const _0x1be9b1=_0x48e32e(_0x2da982[_0x2ce50a(0x131)],_0x2c33f9),_0x3bb11e=await _0x2191d1[_0x2ce50a(0x116)](_0x2ce50a(0x138)+_0x2da982['yamlConfig']['name']+_0x2ce50a(0xf9),()=>_0x9f6b73[_0x2ce50a(0x10b)][_0x2ce50a(0xd1)](_0x5b4e62[_0x2ce50a(0x148)],_0x1be9b1));_0xe6d757=_0x3bb11e[_0x2ce50a(0x14c)]['id'],_0x1bbcf9[_0x2ce50a(0x101)]={'name':_0x2da982['yamlConfig'][_0x2ce50a(0x15d)],'id':_0xe6d757},_0x2191d1[_0x2ce50a(0xe8)]?.({'type':_0x2ce50a(0xa6),'name':_0x2da982['yamlConfig'][_0x2ce50a(0x15d)],'segmentId':_0xe6d757}),_0x2191d1[_0x2ce50a(0x100)]?.(_0x2ce50a(0x124)+_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]+'\x27'),_0x1bbcf9[_0x2ce50a(0x110)]=0x1;}else{if(_0x2da982[_0x2ce50a(0x9e)]){_0x2191d1[_0x2ce50a(0xe8)]?.({'type':_0x2ce50a(0x114),'name':_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]});const _0x2760b5=_0x59ab19(_0x2da982[_0x2ce50a(0x131)]);_0x2c33f9!==_0x2da982['existingSegment']?.[_0x2ce50a(0x136)]&&(_0x2760b5[_0x2ce50a(0x136)]=_0x2c33f9?parseInt(_0x2c33f9,0xa):undefined),await _0x2191d1[_0x2ce50a(0x116)](_0x2ce50a(0x130)+_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]+_0x2ce50a(0xf9),()=>_0x9f6b73['segment'][_0x2ce50a(0xa2)](_0x5b4e62[_0x2ce50a(0x148)],_0x2da982[_0x2ce50a(0x149)]['id'],_0x2760b5)),_0xe6d757=_0x2da982['existingSegment']['id'],_0x2191d1['onProgress']?.({'type':'segment_updated','name':_0x2da982['yamlConfig']['name']}),_0x2191d1[_0x2ce50a(0x100)]?.(_0x2ce50a(0x104)+_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]+'\x27'),_0x1bbcf9['updated']=0x1;}else _0xe6d757=_0x2da982[_0x2ce50a(0x149)]['id'];}}catch(_0x628b43){const _0x4aca53=isHttp400Error(_0x628b43),_0x1b8a05=_0x4aca53?ErrorCode[_0x2ce50a(0xea)]:ErrorCode[_0x2ce50a(0xb3)],_0x116c7b=getErrorMessage(_0x628b43);throw new SDKError(_0x1b8a05,'Failed\x20to\x20'+(_0x2da982[_0x2ce50a(0x164)]?'create':'update')+'\x20segment\x20from\x20file:\x20'+_0x2da982[_0x2ce50a(0x133)]+'\x0a\x20\x20'+_0x116c7b,_0x628b43);}try{const _0x58668f=await syncActivationsForSegment(_0x9f6b73,_0x5b4e62[_0x2ce50a(0x148)],_0xe6d757,_0x2da982[_0x2ce50a(0x131)]['name'],_0x2da982[_0x2ce50a(0x90)],_0x2191d1,_0x2da982[_0x2ce50a(0x133)]);_0x1bbcf9[_0x2ce50a(0xc1)]=_0x58668f;}catch(_0x19f716){if(_0x19f716 instanceof SDKError)throw _0x19f716;throw new SDKError(ErrorCode[_0x2ce50a(0x88)],_0x2ce50a(0x91)+_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]+_0x2ce50a(0x10d)+_0x2da982[_0x2ce50a(0x133)]+_0x2ce50a(0x134)+getErrorMessage(_0x19f716),_0x19f716);}return _0x1bbcf9;},_0x3720d4=await batchAsync(_0x5ab520,_0x8045d9,_0x5ce059),_0x28fc1d={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x27820f of _0x3720d4){_0x28fc1d[_0x2a1766(0x110)]+=_0x27820f['created'],_0x28fc1d[_0x2a1766(0xbc)]+=_0x27820f[_0x2a1766(0xbc)],_0x27820f[_0x2a1766(0x101)]&&_0x28fc1d[_0x2a1766(0x11c)][_0x2a1766(0xb4)](_0x27820f['createdSegmentId'][_0x2a1766(0x15d)],_0x27820f[_0x2a1766(0x101)]['id']),_0x28fc1d[_0x2a1766(0xc1)]['created']+=_0x27820f['activations'][_0x2a1766(0x110)],_0x28fc1d[_0x2a1766(0xc1)][_0x2a1766(0xbc)]+=_0x27820f['activations'][_0x2a1766(0xbc)],_0x28fc1d['activations']['deleted']+=_0x27820f[_0x2a1766(0xc1)][_0x2a1766(0x153)];}return _0x28fc1d;}async function syncActivationsForSegment(_0x26973a,_0xbcc1f3,_0x56a307,_0x36d44d,_0x261e6c,_0x39e13f,_0x5da963){const _0x4b9847=a110_0x40c26b,_0x3c3c09={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4be1ba of _0x261e6c){try{if(_0x4be1ba['type']==='create'&&_0x4be1ba[_0x4b9847(0x10c)])_0x39e13f[_0x4b9847(0xe8)]?.({'type':_0x4b9847(0xe6),'segmentName':_0x36d44d,'activationName':_0x4be1ba[_0x4b9847(0x15d)]}),await _0x39e13f[_0x4b9847(0x116)]('Creating\x20activation\x20\x27'+_0x4be1ba[_0x4b9847(0x15d)]+_0x4b9847(0xf9),()=>_0x26973a['segment'][_0x4b9847(0xaf)](_0xbcc1f3,_0x56a307,_0x4be1ba[_0x4b9847(0x10c)])),_0x39e13f[_0x4b9847(0xe8)]?.({'type':'activation_created','segmentName':_0x36d44d,'activationName':_0x4be1ba['name']}),_0x39e13f['logSuccess']?.(_0x4b9847(0x112)+_0x4be1ba[_0x4b9847(0x15d)]+'\x27'),_0x3c3c09['created']++;else{if(_0x4be1ba[_0x4b9847(0x162)]===_0x4b9847(0xb9)&&_0x4be1ba[_0x4b9847(0x10c)]&&_0x4be1ba[_0x4b9847(0xc3)])_0x39e13f[_0x4b9847(0xe8)]?.({'type':'activation_updating','segmentName':_0x36d44d,'activationName':_0x4be1ba[_0x4b9847(0x15d)]}),await _0x39e13f[_0x4b9847(0x116)](_0x4b9847(0xd4)+_0x4be1ba[_0x4b9847(0x15d)]+_0x4b9847(0xf9),()=>_0x26973a[_0x4b9847(0x10b)]['updateActivation'](_0xbcc1f3,_0x56a307,_0x4be1ba[_0x4b9847(0xc3)]['id'],_0x4be1ba[_0x4b9847(0x10c)])),_0x39e13f[_0x4b9847(0xe8)]?.({'type':_0x4b9847(0xc4),'segmentName':_0x36d44d,'activationName':_0x4be1ba[_0x4b9847(0x15d)]}),_0x39e13f[_0x4b9847(0x100)]?.(_0x4b9847(0x12a)+_0x4be1ba[_0x4b9847(0x15d)]+'\x27'),_0x3c3c09['updated']++;else _0x4be1ba[_0x4b9847(0x162)]==='delete'&&_0x4be1ba[_0x4b9847(0xc3)]&&(_0x39e13f['onProgress']?.({'type':_0x4b9847(0x94),'segmentName':_0x36d44d,'activationName':_0x4be1ba[_0x4b9847(0x15d)]}),await _0x39e13f[_0x4b9847(0x116)]('Deleting\x20activation\x20\x27'+_0x4be1ba['name']+_0x4b9847(0xf9),()=>_0x26973a[_0x4b9847(0x10b)][_0x4b9847(0xb0)](_0xbcc1f3,_0x56a307,_0x4be1ba['existingActivation']['id'])),_0x39e13f[_0x4b9847(0xe8)]?.({'type':'activation_deleted','segmentName':_0x36d44d,'activationName':_0x4be1ba[_0x4b9847(0x15d)]}),_0x39e13f[_0x4b9847(0x127)]?.(_0x4b9847(0x97)+_0x4be1ba['name']+'\x27'),_0x3c3c09['deleted']++);}}catch(_0x164212){const _0x2bf69b=isHttp400Error(_0x164212),_0x142fd2=_0x2bf69b?ErrorCode[_0x4b9847(0x125)]:ErrorCode[_0x4b9847(0x88)],_0x4010d5=getErrorMessage(_0x164212);throw new SDKError(_0x142fd2,_0x4b9847(0xe2)+_0x4be1ba[_0x4b9847(0x162)]+_0x4b9847(0x120)+_0x4be1ba[_0x4b9847(0x15d)]+'\x27\x20from\x20file:\x20'+_0x5da963+'\x0a\x20\x20'+_0x4010d5,_0x164212);}}return _0x3c3c09;}export async function executePushFolders(_0x4f0154,_0x5b3055,_0x552efd,_0x2fc75a,_0x1529e9){const _0x1a9f61=a110_0x40c26b,_0xef0210=new Map(_0x552efd);for(const _0x11c4e2 of _0x5b3055){const _0x3b9038=_0x11c4e2[_0x1a9f61(0x159)]('/'),_0x4b068c=_0x3b9038[_0x3b9038[_0x1a9f61(0x106)]-0x1],_0x3f28f5=_0x3b9038[_0x1a9f61(0xa9)](0x0,-0x1)['join']('/'),_0x5782bf=_0xef0210[_0x1a9f61(0x109)](_0x3f28f5);_0x1529e9['onProgress']?.({'type':_0x1a9f61(0x128),'folder':_0x11c4e2});const _0xade784={'name':_0x4b068c,'parentFolderId':_0x5782bf},_0x5d2881=await _0x1529e9['withProgress'](_0x1a9f61(0x103)+_0x11c4e2+_0x1a9f61(0xf9),()=>_0x4f0154[_0x1a9f61(0x10b)][_0x1a9f61(0x14a)](_0x2fc75a[_0x1a9f61(0x148)],_0xade784));_0xef0210[_0x1a9f61(0xb4)](_0x11c4e2,_0x5d2881[_0x1a9f61(0x14c)]['id']),_0x1529e9[_0x1a9f61(0xe8)]?.({'type':_0x1a9f61(0xda),'folder':_0x11c4e2,'folderId':_0x5d2881['data']['id']}),_0x1529e9[_0x1a9f61(0x132)]?.(_0x1a9f61(0x12e)+_0x11c4e2+'\x27');}return _0xef0210;}export async function executePushSegmentDeletions(_0x1e9729,_0x15acff,_0x4e6f4e){const _0x2bf789=a110_0x40c26b;if(_0x15acff[_0x2bf789(0x106)]===0x0)return 0x0;const {batchAsync:_0x5b9248}=await import(_0x2bf789(0x87)),_0x4ca2a0=0x5,_0x54d319=await _0x5b9248(_0x15acff,async _0x5264dd=>{const _0x8dbdc1=_0x2bf789;return _0x4e6f4e[_0x8dbdc1(0xe8)]?.({'type':_0x8dbdc1(0xc8),'name':_0x5264dd[_0x8dbdc1(0x15d)]}),await _0x1e9729[_0x8dbdc1(0x10b)][_0x8dbdc1(0x13d)](_0x5264dd['id']),_0x4e6f4e[_0x8dbdc1(0xe8)]?.({'type':_0x8dbdc1(0xae),'name':_0x5264dd[_0x8dbdc1(0x15d)]}),_0x4e6f4e[_0x8dbdc1(0x127)]?.(_0x8dbdc1(0xf6)+_0x5264dd['name']+'\x27'),0x1;},_0x4ca2a0);return _0x54d319[_0x2bf789(0xa4)]((_0x651d82,_0x29e5ba)=>_0x651d82+_0x29e5ba,0x0);}export async function executePushJourneys(_0x16cf43,_0xb2284d,_0x1e98bd,_0x450a1e,_0x61b20){const _0x2aee78=a110_0x40c26b,{journeyDefToRequest:_0x1858f1}=await import(_0x2aee78(0x140)),{activationDefToCreateRequest:_0x537478,yamlRuleToApi:_0x157630,validateSegmentRule:_0x14f79e}=await import(_0x2aee78(0x158)),_0x2ef1e8={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x39ee83=new Map(_0x1e98bd[_0x2aee78(0x14e)]),_0x527d91=0x5;for(let _0x351afa=0x0;_0x351afa<_0xb2284d[_0x2aee78(0x106)];_0x351afa+=_0x527d91){const _0x4cb4f1=_0xb2284d[_0x2aee78(0xa9)](_0x351afa,_0x351afa+_0x527d91),_0x9f5f99=await Promise[_0x2aee78(0x15a)](_0x4cb4f1['map'](async _0x283e67=>{const _0x306e1f=_0x2aee78;if(!_0x283e67[_0x306e1f(0x164)]&&!_0x283e67[_0x306e1f(0x9e)])return{'action':_0x306e1f(0xd8),'name':_0x283e67[_0x306e1f(0x131)]['name'],'journeyId':_0x283e67[_0x306e1f(0xe5)]?.['id']};const _0x336b80=_0x283e67[_0x306e1f(0x15f)]?_0x1e98bd['folderPathToId']['get'](_0x283e67[_0x306e1f(0x15f)]):undefined;_0x61b20[_0x306e1f(0xe8)]?.({'type':_0x283e67['isNew']?_0x306e1f(0xdc):'journey_updating','name':_0x283e67[_0x306e1f(0x131)][_0x306e1f(0x15d)]});try{const _0x2ea88d=await executeSingleJourneyPush(_0x16cf43,_0x283e67,{..._0x1e98bd,'segmentNameToId':_0x39ee83},{'parentId':_0x450a1e[_0x306e1f(0x148)],'rootFolderId':_0x450a1e[_0x306e1f(0x13f)],'folderId':_0x336b80,'verbose':_0x450a1e[_0x306e1f(0xd7)]},_0x61b20,{'journeyDefToRequest':_0x1858f1,'activationDefToCreateRequest':_0x537478,'yamlRuleToApi':_0x157630,'validateSegmentRule':_0x14f79e});for(const [_0x53adff,_0x221cc6]of _0x2ea88d[_0x306e1f(0x108)]){_0x39ee83[_0x306e1f(0xb4)](_0x53adff,_0x221cc6),_0x2ef1e8[_0x306e1f(0x108)][_0x306e1f(0xb4)](_0x53adff,_0x221cc6);}if(_0x2ea88d['action']===_0x306e1f(0x110))_0x61b20[_0x306e1f(0xe8)]?.({'type':_0x306e1f(0x8f),'name':_0x283e67['yamlConfig'][_0x306e1f(0x15d)],'journeyId':_0x2ea88d[_0x306e1f(0x10a)]}),_0x61b20[_0x306e1f(0x100)]?.(_0x306e1f(0x113)+_0x283e67['yamlConfig'][_0x306e1f(0x15d)]+'\x27'),_0x2ef1e8['created']++;else _0x2ea88d[_0x306e1f(0x12f)]===_0x306e1f(0xbc)&&(_0x61b20['onProgress']?.({'type':'journey_updated','name':_0x283e67[_0x306e1f(0x131)][_0x306e1f(0x15d)]}),_0x61b20[_0x306e1f(0x100)]?.(_0x306e1f(0x89)+_0x283e67['yamlConfig']['name']+'\x27'),_0x2ef1e8[_0x306e1f(0xbc)]++);return{'action':_0x2ea88d[_0x306e1f(0x12f)],'name':_0x283e67[_0x306e1f(0x131)][_0x306e1f(0x15d)],'journeyId':_0x2ea88d[_0x306e1f(0x10a)]};}catch(_0x5d347f){const _0x395837=isHttp400Error(_0x5d347f),_0x419aeb=_0x395837?ErrorCode[_0x306e1f(0x111)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x267647=getErrorMessage(_0x5d347f);throw new SDKError(_0x419aeb,_0x306e1f(0xe2)+(_0x283e67[_0x306e1f(0x164)]?_0x306e1f(0x96):_0x306e1f(0xb9))+_0x306e1f(0x95)+_0x283e67[_0x306e1f(0x133)]+_0x306e1f(0x134)+_0x267647,_0x5d347f);}}));_0x2ef1e8[_0x2aee78(0x8e)][_0x2aee78(0x145)](..._0x9f5f99);}return _0x2ef1e8;}async function executeSingleJourneyPush(_0x1629bb,_0x2ed488,_0x5b12ef,_0x3b5db1,_0x5ebdd7,_0xedbc19){const _0x4b636f=a110_0x40c26b,{journeyDefToRequest:_0x32c202,activationDefToCreateRequest:_0x5f48c4,yamlRuleToApi:_0x397a97,validateSegmentRule:_0x498eea}=_0xedbc19,_0x252ebf=new Map(),_0x5f3a52=new Map(),_0x52cf0a=new Map(),_0x431463=new Map(),_0x5feb65=new Map();let _0x51cccb;const _0x2443f0=async()=>{const _0x931060=a110_0x371e;if(_0x51cccb)return;_0x51cccb=new Map();if(!_0x2ed488[_0x931060(0xe5)])return;const _0x13583e=await _0x1629bb['journey'][_0x931060(0x143)](_0x2ed488['existingJourney']['id']);for(const _0x5a4e3c of _0x13583e){const _0x1a71ea=journeyActivationStepToYaml(_0x5a4e3c,_0x5b12ef[_0x931060(0xc7)],_0x5b12ef[_0x931060(0x169)]),_0xe80ad6=activationSignature(_0x1a71ea);!_0x51cccb['has'](_0xe80ad6)&&_0x51cccb[_0x931060(0xb4)](_0xe80ad6,_0x5a4e3c['id']),_0x1a71ea[_0x931060(0x15d)]&&_0x5f3a52[_0x931060(0xb4)](_0x1a71ea[_0x931060(0x15d)],_0x5a4e3c['id']);}};if(_0x2ed488[_0x4b636f(0xe5)]&&_0x2ed488['yamlConfig'][_0x4b636f(0xff)]){const _0x1c999d=buildLocalExpandedRuleMappings(_0x2ed488[_0x4b636f(0x131)]),_0xdf95e4=_0x1c999d[_0x4b636f(0xf3)];if(_0xdf95e4[_0x4b636f(0xf4)]>0x0){const _0x595eab=new Map();for(const [_0x43013c,_0x2365e9]of _0xdf95e4){const _0x537b26=serializeExpandedRule(_0x2365e9,_0xdf95e4);_0x595eab[_0x4b636f(0xb4)](_0x43013c,_0x537b26);}const _0x222aeb=collectSegmentIdsFromJourneyApi(_0x2ed488[_0x4b636f(0xe5)]);if(_0x222aeb[_0x4b636f(0xf4)]>0x0){const _0x1f9e2f=await buildServerSegmentRuleMap(_0x1629bb,_0x3b5db1['parentId'],_0x5b12ef[_0x4b636f(0xa5)],_0x222aeb);if(_0x1f9e2f['size']>0x0){const _0x287db6=new Map();for(const [_0x1b6426,_0x378607]of _0x1f9e2f){const _0x59a597=serializeExpandedRule(_0x378607,_0x1f9e2f);!_0x287db6[_0x4b636f(0x167)](_0x59a597)&&_0x287db6[_0x4b636f(0xb4)](_0x59a597,_0x1b6426);}for(const [_0x5e847f,_0x37ad69]of _0x595eab){const _0x4c81ff=_0x287db6['get'](_0x37ad69);_0x4c81ff&&(_0x5feb65[_0x4b636f(0xb4)](_0x5e847f,_0x4c81ff),_0x5b12ef[_0x4b636f(0x14e)][_0x4b636f(0xb4)](_0x5e847f,_0x4c81ff));}}}}}const _0xbed600={'resolveSegmentId':async _0x1ccaf3=>{const _0x1a65d2=_0x4b636f,_0x4eb317=_0x5b12ef['segmentNameToId'][_0x1a65d2(0x109)](_0x1ccaf3);if(!_0x4eb317)throw new SDKError(ErrorCode[_0x1a65d2(0x10f)],'Segment\x20not\x20found:\x20'+_0x1ccaf3+_0x1a65d2(0x9d)+_0x2ed488[_0x1a65d2(0x131)][_0x1a65d2(0x15d)]+')');return _0x4eb317;},'resolveEmbeddedSegmentId':async(_0x48c153,_0x3b01bc)=>{const _0x4cad24=_0x4b636f,_0x4ea81e=_0x5b12ef[_0x4cad24(0x14e)][_0x4cad24(0x109)](_0x48c153);if(_0x4ea81e)return _0x4ea81e;const _0x5e3a6b=_0x5feb65[_0x4cad24(0x109)](_0x48c153);if(_0x5e3a6b)return _0x5b12ef[_0x4cad24(0x14e)][_0x4cad24(0xb4)](_0x48c153,_0x5e3a6b),_0x5e3a6b;const _0x1bec9c=_0x5b12ef[_0x4cad24(0xa5)][_0x4cad24(0xd0)](_0x33f8a4=>_0x33f8a4[_0x4cad24(0x15d)]===_0x48c153);if(_0x1bec9c)return _0x5b12ef[_0x4cad24(0x14e)][_0x4cad24(0xb4)](_0x48c153,_0x1bec9c['id']),_0x1bec9c['id'];if(_0x2ed488[_0x4cad24(0x164)]){const {stageName:_0x1832fc,criteriaName:_0x369420}=findSegmentCriteriaLocation(_0x2ed488['yamlConfig'],_0x48c153);return _0x498eea(_0x48c153,_0x3b01bc[_0x4cad24(0x121)]),_0x52cf0a[_0x4cad24(0xb4)](_0x48c153,{'definition':_0x3b01bc,'stageName':_0x1832fc,'criteriaName':_0x369420}),createPendingSegmentId(_0x48c153);}const _0x465415=_0x2ed488[_0x4cad24(0xe5)]?.['id'];if(!_0x465415)throw new SDKError(ErrorCode['INTERNAL'],_0x4cad24(0x147));_0x498eea(_0x48c153,_0x3b01bc['rule']);const _0x42f2f2=generateDeterministicJourneySegmentName(_0x2ed488[_0x4cad24(0x131)][_0x4cad24(0x15d)],_0x48c153),_0x484189=_0x5b12ef[_0x4cad24(0xa5)]['find'](_0x4f774d=>_0x4f774d[_0x4cad24(0x15d)]===_0x42f2f2),_0x4c96ab=createSegmentIdResolver(_0x5b12ef[_0x4cad24(0x14e)],_0x48c153),_0x20f18f=await resolveRuleSegmentIds(_0x3b01bc[_0x4cad24(0x121)],_0x4c96ab);let _0x1a9422;if(_0x484189)await _0x1629bb[_0x4cad24(0x10b)][_0x4cad24(0xa2)](_0x3b5db1[_0x4cad24(0x148)],_0x484189['id'],{'description':_0x3b01bc[_0x4cad24(0x135)]||_0x4cad24(0x9c)+_0x48c153,'rule':_0x397a97(_0x20f18f,!![]),'countPopulation':!![]}),_0x1a9422=_0x484189['id'];else try{_0x1a9422=await _0x1629bb[_0x4cad24(0x10b)][_0x4cad24(0xac)]({'name':_0x42f2f2,'description':_0x3b01bc['description']||_0x4cad24(0x9c)+_0x48c153,'journeyId':_0x465415,'rule':_0x397a97(_0x20f18f,!![]),'countPopulation':!![],'parentFolderId':_0x3b5db1[_0x4cad24(0x13f)]||'','audienceId':_0x3b5db1[_0x4cad24(0x148)]});}catch(_0x49a7e){const _0x2aac97=_0x49a7e instanceof Error&&_0x49a7e['message']['includes'](_0x4cad24(0xcc));if(_0x2aac97){const _0x254918=await _0x1629bb[_0x4cad24(0x10b)][_0x4cad24(0x85)](_0x3b5db1[_0x4cad24(0x148)]),_0x1d099e=_0x254918['find'](_0x13d6c6=>_0x13d6c6[_0x4cad24(0x15d)]===_0x42f2f2);if(_0x1d099e)await _0x1629bb['segment'][_0x4cad24(0xa2)](_0x3b5db1['parentId'],_0x1d099e['id'],{'description':_0x3b01bc['description']||_0x4cad24(0x9c)+_0x48c153,'rule':_0x397a97(_0x20f18f,!![]),'countPopulation':!![]}),_0x1a9422=_0x1d099e['id'];else throw _0x49a7e;}else throw _0x49a7e;}return _0x5b12ef['segmentNameToId']['set'](_0x48c153,_0x1a9422),_0x252ebf['set'](_0x48c153,_0x1a9422),_0x1a9422;},'resolveActivationId':async _0x54ce99=>{const _0xe3d712=_0x4b636f,_0x46735b=_0x5f3a52[_0xe3d712(0x109)](_0x54ce99);if(_0x46735b)return _0x46735b;if(_0x2ed488[_0xe3d712(0xe5)]){await _0x2443f0();const _0x3765fe=_0x5f3a52[_0xe3d712(0x109)](_0x54ce99);if(_0x3765fe)return _0x3765fe;}throw new SDKError(ErrorCode[_0xe3d712(0xca)],'Activation\x20not\x20found:\x20'+_0x54ce99+'\x20(referenced\x20in\x20journey\x20'+_0x2ed488[_0xe3d712(0x131)][_0xe3d712(0x15d)]+_0xe3d712(0xc2)+_0xe3d712(0xef));},'resolveEmbeddedActivationId':async(_0x575272,_0x4a4ce4)=>{const _0x5eb113=_0x4b636f,_0x3365e0=_0x5f3a52[_0x5eb113(0x109)](_0x575272);if(_0x3365e0)return _0x3365e0;if(_0x2ed488['isNew'])return _0x431463[_0x5eb113(0xb4)](_0x575272,_0x4a4ce4),createPendingActivationId(_0x575272);if(_0x2ed488[_0x5eb113(0xe5)]){await _0x2443f0();const _0xe579d4=_0x5f3a52[_0x5eb113(0x109)](_0x4a4ce4[_0x5eb113(0x15d)]);if(_0xe579d4)return _0x5f3a52['set'](_0x575272,_0xe579d4),_0xe579d4;const _0x13eae7=activationSignature(_0x4a4ce4),_0x3ba9c3=_0x51cccb?.['get'](_0x13eae7);if(_0x3ba9c3)return _0x5f3a52[_0x5eb113(0xb4)](_0x575272,_0x3ba9c3),_0x3ba9c3;const _0x2e88b9=await _0x5f48c4(_0x4a4ce4,_0x5b12ef['activationContext']),_0xdcb418=await _0x1629bb[_0x5eb113(0x11d)][_0x5eb113(0xaf)](_0x2ed488[_0x5eb113(0xe5)]['id'],_0x2e88b9);return _0x5f3a52[_0x5eb113(0xb4)](_0x575272,_0xdcb418['id']),_0xdcb418['id'];}throw new SDKError(ErrorCode[_0x5eb113(0x11e)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x4330db=>{const _0x780442=_0x4b636f;try{return await _0x1629bb[_0x780442(0x11d)][_0x780442(0xb5)](_0x3b5db1[_0x780442(0x148)],_0x4330db);}catch(_0x8dff79){throw new SDKError(ErrorCode[_0x780442(0xca)],_0x780442(0xbe)+_0x4330db+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x2ed488[_0x780442(0x131)][_0x780442(0x15d)]+'\x27)',_0x8dff79);}},'resolveStageId':async(_0xd52e7,_0x261939)=>{const _0x38d49d=_0x4b636f,_0x1353ec=await _0x1629bb[_0x38d49d(0x11d)][_0x38d49d(0xd5)](_0xd52e7),_0x180607=_0x1353ec[_0x38d49d(0xb2)][_0x38d49d(0xf7)][_0x38d49d(0xd0)](_0x1b03bf=>_0x1b03bf[_0x38d49d(0x15d)][_0x38d49d(0xe1)]()===_0x261939[_0x38d49d(0xe1)]());if(!_0x180607?.['id'])throw new SDKError(ErrorCode[_0x38d49d(0xca)],'Stage\x20\x27'+_0x261939+_0x38d49d(0xe0)+(_0x1353ec[_0x38d49d(0xb2)][_0x38d49d(0xcd)]||_0x1353ec['attributes']['name'])+'\x27');return _0x180607['id'];}},_0x433858=await _0x32c202(_0x2ed488[_0x4b636f(0x131)],_0x3b5db1[_0x4b636f(0x148)],_0xbed600),_0x13a96b=_0x3b5db1['folderId']||_0x3b5db1[_0x4b636f(0x13f)];_0x13a96b&&(_0x433858['relationships']={'parentFolder':{'data':{'id':_0x13a96b,'type':'folder'}}});if(_0x2ed488[_0x4b636f(0x164)]){if(_0x52cf0a[_0x4b636f(0xf4)]>0x0||_0x431463[_0x4b636f(0xf4)]>0x0)return await executeThreeStepJourneyCreate(_0x1629bb,_0x2ed488,_0x433858,{'pendingEmbeddedSegments':_0x52cf0a,'pendingEmbeddedActivations':_0x431463,'embeddedSegmentNameToId':_0x252ebf,'journeyActivationNameToId':_0x5f3a52},{..._0x3b5db1,'effectiveFolderId':_0x13a96b},_0x5b12ef,_0x5ebdd7,_0xedbc19);else{ensureJourneyDefaults(_0x433858['attributes']);const _0x2ba386=await _0x1629bb[_0x4b636f(0x11d)][_0x4b636f(0x96)](_0x433858);return{'action':_0x4b636f(0x110),'journeyId':_0x2ba386['id'],'embeddedSegmentNameToId':_0x252ebf};}}else{if(_0x2ed488[_0x4b636f(0x9e)]&&_0x2ed488[_0x4b636f(0xe5)])return ensureJourneyDefaults(_0x433858[_0x4b636f(0xb2)]),await _0x1629bb[_0x4b636f(0x11d)][_0x4b636f(0xb9)](_0x2ed488['existingJourney']['id'],_0x433858),{'action':_0x4b636f(0xbc),'journeyId':_0x2ed488[_0x4b636f(0xe5)]['id'],'embeddedSegmentNameToId':_0x252ebf};}return{'action':_0x4b636f(0xd8),'journeyId':_0x2ed488[_0x4b636f(0xe5)]?.['id'],'embeddedSegmentNameToId':_0x252ebf};}function findSegmentCriteriaLocation(_0x218c5e,_0x32bd71){const _0x51d70a=a110_0x40c26b,_0x36bc98=_0x218c5e[_0x51d70a(0x126)]||_0x218c5e[_0x51d70a(0x13a)]?.[0x0]?.[_0x51d70a(0x126)]||[];let _0x502ab3=_0x51d70a(0xe7),_0xbf9b42=_0x32bd71;const _0x11a6ee=_0x218c5e['goal']||_0x218c5e[_0x51d70a(0x13a)]?.[0x0]?.['goal'];if(_0x11a6ee?.[_0x51d70a(0x10b)]===_0x32bd71)return{'stageName':'goal','criteriaName':_0x11a6ee[_0x51d70a(0x15d)]||_0x32bd71};_0x5f5945:for(const _0xe9bf85 of _0x36bc98){if(_0xe9bf85[_0x51d70a(0x11b)]?.['segment']===_0x32bd71){_0x502ab3=_0xe9bf85['name'],_0xbf9b42=_0xe9bf85['entry_criteria'][_0x51d70a(0x15d)]||_0x32bd71;break;}if(_0xe9bf85[_0x51d70a(0x12b)])for(const _0x402c0f of _0xe9bf85[_0x51d70a(0x12b)]){if(_0x402c0f[_0x51d70a(0x162)]==='decision_point'&&_0x402c0f[_0x51d70a(0x9b)]?.[_0x51d70a(0x14f)])for(const _0x278165 of _0x402c0f[_0x51d70a(0x9b)][_0x51d70a(0x14f)]){if(_0x278165[_0x51d70a(0x10b)]===_0x32bd71){_0x502ab3=_0xe9bf85[_0x51d70a(0x15d)],_0xbf9b42=_0x278165[_0x51d70a(0x15d)]||_0x32bd71;break _0x5f5945;}}}}return{'stageName':_0x502ab3,'criteriaName':_0xbf9b42};}async function executeThreeStepJourneyCreate(_0x398279,_0x3c266c,_0x3f4129,_0x1ef57e,_0x30ed0d,_0x45fcdf,_0x4b4ab4,_0x31f8aa){const _0x161f0f=a110_0x40c26b,{activationDefToCreateRequest:_0x21caec,yamlRuleToApi:_0x4aa34e}=_0x31f8aa,{pendingEmbeddedSegments:_0x37de0c,pendingEmbeddedActivations:_0x16ee30,embeddedSegmentNameToId:_0x322f77}=_0x1ef57e,_0x2fa61f=JSON[_0x161f0f(0xdd)](JSON[_0x161f0f(0x15c)](_0x3f4129));ensureJourneyDefaults(_0x2fa61f[_0x161f0f(0xb2)]),stripPendingIds(_0x2fa61f);const _0x50d485=await _0x398279[_0x161f0f(0x11d)][_0x161f0f(0x96)](_0x2fa61f),_0x71531b=_0x50d485['id'],_0x421e69=new Map();for(const _0x39635d of _0x50d485[_0x161f0f(0xb2)][_0x161f0f(0xf7)]){_0x421e69['set'](_0x39635d[_0x161f0f(0x15d)][_0x161f0f(0xe1)](),_0x39635d['id']);}for(const [_0x509f7d,{definition:_0x35518b}]of _0x37de0c){const _0x4fefec=generateDeterministicJourneySegmentName(_0x3c266c[_0x161f0f(0x131)][_0x161f0f(0x15d)],_0x509f7d);_0x4b4ab4[_0x161f0f(0xe8)]?.({'type':_0x161f0f(0xa3),'journeyName':_0x3c266c[_0x161f0f(0x131)][_0x161f0f(0x15d)],'segmentName':_0x509f7d});const _0x34220b=createSegmentIdResolver(_0x45fcdf[_0x161f0f(0x14e)],_0x509f7d),_0x5ed9d2=await resolveRuleSegmentIds(_0x35518b[_0x161f0f(0x121)],_0x34220b),_0x3bc211=await _0x398279[_0x161f0f(0x10b)][_0x161f0f(0xac)]({'name':_0x4fefec,'description':_0x35518b['description']||_0x161f0f(0x9c)+_0x509f7d,'journeyId':_0x71531b,'rule':_0x4aa34e(_0x5ed9d2,!![]),'countPopulation':!![],'parentFolderId':_0x30ed0d[_0x161f0f(0xf0)]||'','audienceId':_0x30ed0d[_0x161f0f(0x148)]});_0x322f77[_0x161f0f(0xb4)](_0x509f7d,_0x3bc211),_0x45fcdf[_0x161f0f(0x14e)][_0x161f0f(0xb4)](_0x509f7d,_0x3bc211),_0x4b4ab4[_0x161f0f(0xe8)]?.({'type':_0x161f0f(0xa1),'journeyName':_0x3c266c[_0x161f0f(0x131)][_0x161f0f(0x15d)],'segmentName':_0x509f7d});}const _0x39e825=new Map();for(const [_0x55db27,_0x472768]of _0x16ee30){_0x4b4ab4[_0x161f0f(0xe8)]?.({'type':'embedded_activation_creating','journeyName':_0x3c266c['yamlConfig'][_0x161f0f(0x15d)],'activationName':_0x55db27});const _0x4aab08=await _0x21caec(_0x472768,_0x45fcdf[_0x161f0f(0x11a)]),_0x23531a=await _0x398279[_0x161f0f(0x11d)]['createActivation'](_0x71531b,_0x4aab08);_0x39e825[_0x161f0f(0xb4)](_0x55db27,_0x23531a['id']),_0x1ef57e[_0x161f0f(0xf8)][_0x161f0f(0xb4)](_0x55db27,_0x23531a['id']),_0x4b4ab4[_0x161f0f(0xe8)]?.({'type':_0x161f0f(0x13b),'journeyName':_0x3c266c[_0x161f0f(0x131)][_0x161f0f(0x15d)],'activationName':_0x55db27});}const _0x1c0a9f=JSON['parse'](JSON[_0x161f0f(0x15c)](_0x3f4129));return _0x1c0a9f['id']=_0x71531b,ensureJourneyDefaults(_0x1c0a9f['attributes']),resolvePendingIdsInRequest(_0x1c0a9f,_0x3f4129,_0x421e69,_0x322f77,_0x39e825,_0x4b4ab4),await _0x398279[_0x161f0f(0x11d)][_0x161f0f(0xb9)](_0x71531b,_0x1c0a9f),{'action':'created','journeyId':_0x71531b,'embeddedSegmentNameToId':_0x322f77};}function stripPendingIds(_0x12890f){const _0x1e93bf=a110_0x40c26b;for(const _0x4a860f of _0x12890f[_0x1e93bf(0xb2)]['journeyStages']||[]){_0x4a860f[_0x1e93bf(0x13e)]?.[_0x1e93bf(0x8b)]&&isPendingSegmentId(_0x4a860f[_0x1e93bf(0x13e)][_0x1e93bf(0x8b)])&&delete _0x4a860f[_0x1e93bf(0x13e)];if(_0x4a860f[_0x1e93bf(0x12b)])for(const _0x49117e of Object[_0x1e93bf(0xa7)](_0x4a860f[_0x1e93bf(0x12b)])){const _0x34b591=_0x4a860f[_0x1e93bf(0x12b)][_0x49117e];_0x34b591['type']===_0x1e93bf(0x118)&&_0x34b591[_0x1e93bf(0x123)]&&isPendingActivationId(_0x34b591[_0x1e93bf(0x123)])&&(_0x34b591['journeyActivationStepId']='');if(_0x34b591[_0x1e93bf(0x162)]===_0x1e93bf(0x151)&&_0x34b591[_0x1e93bf(0x14f)])for(const _0x1715f8 of _0x34b591[_0x1e93bf(0x14f)]){_0x1715f8[_0x1e93bf(0x8b)]&&isPendingSegmentId(_0x1715f8[_0x1e93bf(0x8b)])&&(_0x1715f8['segmentId']='');}_0x34b591['type']==='WaitStep'&&_0x34b591['waitCondition']?.[_0x1e93bf(0x8b)]&&isPendingSegmentId(_0x34b591[_0x1e93bf(0x119)][_0x1e93bf(0x8b)])&&(_0x34b591[_0x1e93bf(0x119)][_0x1e93bf(0x8b)]='');}}}function resolvePendingIdsInRequest(_0x206072,_0x18e05a,_0x376e19,_0x147bd8,_0x17fa0b,_0x4cad52){const _0x2480d7=a110_0x40c26b,_0xdc856a=(_0x48674d,_0x3be2a5)=>{const _0x210734=a110_0x371e;if(!isPendingSegmentId(_0x48674d))return _0x48674d;const _0x39876c=extractPendingSegmentName(_0x48674d),_0x24d20d=_0x147bd8['get'](_0x39876c);return!_0x24d20d&&_0x4cad52[_0x210734(0xcf)]?.(_0x210734(0x15e)+_0x39876c+_0x210734(0xe3)+_0x3be2a5),_0x24d20d;};if(_0x206072['attributes'][_0x2480d7(0xde)]?.['segmentId']&&isPendingSegmentId(_0x206072[_0x2480d7(0xb2)][_0x2480d7(0xde)]['segmentId'])){const _0x331542=_0xdc856a(_0x206072['attributes'][_0x2480d7(0xde)][_0x2480d7(0x8b)],_0x2480d7(0x14d));_0x331542&&(_0x206072[_0x2480d7(0xb2)]['goal'][_0x2480d7(0x8b)]=_0x331542);}for(const _0x42eb37 of _0x206072[_0x2480d7(0xb2)][_0x2480d7(0xf7)]||[]){const _0x33cb95=_0x376e19[_0x2480d7(0x109)](_0x42eb37[_0x2480d7(0x15d)][_0x2480d7(0xe1)]());_0x33cb95&&(_0x42eb37['id']=_0x33cb95);if(_0x42eb37[_0x2480d7(0x13e)]?.[_0x2480d7(0x8b)]&&isPendingSegmentId(_0x42eb37['entryCriteria']['segmentId'])){const _0x3a83a7=_0xdc856a(_0x42eb37[_0x2480d7(0x13e)]['segmentId'],_0x2480d7(0xd9)+_0x42eb37[_0x2480d7(0x15d)]+_0x2480d7(0x15b));_0x3a83a7&&(_0x42eb37[_0x2480d7(0x13e)][_0x2480d7(0x8b)]=_0x3a83a7);}if(_0x42eb37[_0x2480d7(0x156)])for(const _0x81348e of _0x42eb37[_0x2480d7(0x156)]){if(_0x81348e['segmentId']&&isPendingSegmentId(_0x81348e[_0x2480d7(0x8b)])){const _0x374253=_0xdc856a(_0x81348e[_0x2480d7(0x8b)],_0x2480d7(0xd9)+_0x42eb37['name']+_0x2480d7(0xa8));_0x374253&&(_0x81348e[_0x2480d7(0x8b)]=_0x374253);}}if(_0x42eb37[_0x2480d7(0xec)]?.[_0x2480d7(0x8b)]&&isPendingSegmentId(_0x42eb37[_0x2480d7(0xec)][_0x2480d7(0x8b)])){const _0x98298e=_0xdc856a(_0x42eb37[_0x2480d7(0xec)]['segmentId'],_0x2480d7(0xd9)+_0x42eb37['name']+_0x2480d7(0x102));_0x98298e&&(_0x42eb37[_0x2480d7(0xec)][_0x2480d7(0x8b)]=_0x98298e);}if(_0x42eb37['steps']){const _0x515bd8=_0x33b13c=>_0x18e05a[_0x2480d7(0xb2)][_0x2480d7(0xf7)][_0x2480d7(0xd0)](_0x4abf5b=>_0x4abf5b[_0x2480d7(0x15d)]['toLowerCase']()===_0x42eb37[_0x2480d7(0x15d)][_0x2480d7(0xe1)]())?.[_0x2480d7(0x12b)]?.[_0x33b13c];for(const _0x39ef96 of Object[_0x2480d7(0xa7)](_0x42eb37['steps'])){const _0x518622=_0x42eb37[_0x2480d7(0x12b)][_0x39ef96],_0x5f586e=_0x515bd8(_0x39ef96);if(_0x518622['type']==='Activation'&&_0x518622['journeyActivationStepId']&&(isPendingActivationId(_0x518622['journeyActivationStepId'])||_0x518622['journeyActivationStepId']==='')){if(_0x5f586e?.[_0x2480d7(0x123)]&&isPendingActivationId(_0x5f586e[_0x2480d7(0x123)])){const _0x144d97=extractPendingActivationName(_0x5f586e[_0x2480d7(0x123)]),_0x23aebe=_0x17fa0b[_0x2480d7(0x109)](_0x144d97);_0x23aebe&&(_0x518622[_0x2480d7(0x123)]=_0x23aebe);}}if(_0x518622[_0x2480d7(0x162)]==='DecisionPoint'&&_0x518622[_0x2480d7(0x14f)]&&_0x5f586e?.[_0x2480d7(0x14f)])for(let _0x2a9517=0x0;_0x2a9517<_0x518622[_0x2480d7(0x14f)]['length'];_0x2a9517++){const _0x5c5030=_0x518622[_0x2480d7(0x14f)][_0x2a9517],_0x1a7b9e=_0x5f586e[_0x2480d7(0x14f)][_0x2a9517];if(_0x1a7b9e?.[_0x2480d7(0x8b)]&&isPendingSegmentId(_0x1a7b9e[_0x2480d7(0x8b)])){const _0x2275b6=_0xdc856a(_0x1a7b9e[_0x2480d7(0x8b)],_0x2480d7(0xd9)+_0x42eb37[_0x2480d7(0x15d)]+_0x2480d7(0x107)+(_0x5c5030[_0x2480d7(0x15d)]||_0x2a9517)+'\x27');_0x2275b6&&(_0x5c5030[_0x2480d7(0x8b)]=_0x2275b6);}}if(_0x518622[_0x2480d7(0x162)]===_0x2480d7(0xb8)&&_0x518622[_0x2480d7(0x119)]?.['segmentId']&&_0x5f586e?.[_0x2480d7(0x119)]?.[_0x2480d7(0x8b)]&&isPendingSegmentId(_0x5f586e[_0x2480d7(0x119)][_0x2480d7(0x8b)])){const _0x292ea0=_0xdc856a(_0x5f586e[_0x2480d7(0x119)]['segmentId'],_0x2480d7(0xd9)+_0x42eb37['name']+'\x27\x20wait\x20condition');_0x292ea0&&(_0x518622[_0x2480d7(0x119)][_0x2480d7(0x8b)]=_0x292ea0);}}}}}
@@ -1 +1 @@
1
- function a111_0x5be9(){const _0x1180c4=['parentFolderId','add','2134620wvIkSz','name','574569qXLJwX','4461230osQgZD','set','has','3980010qVKRwu','14999301pSSeqn','4aENDYM','3393704siOiux','get','7owELKV','1934302vXJlWV'];a111_0x5be9=function(){return _0x1180c4;};return a111_0x5be9();}(function(_0xcf2137,_0x245427){const _0x5a15d3=a111_0x46ef,_0x2452b4=_0xcf2137();while(!![]){try{const _0x5bc90b=parseInt(_0x5a15d3(0x9e))/0x1+parseInt(_0x5a15d3(0x99))/0x2+-parseInt(_0x5a15d3(0x9c))/0x3+parseInt(_0x5a15d3(0x95))/0x4*(-parseInt(_0x5a15d3(0x9f))/0x5)+-parseInt(_0x5a15d3(0xa2))/0x6*(parseInt(_0x5a15d3(0x98))/0x7)+-parseInt(_0x5a15d3(0x96))/0x8+parseInt(_0x5a15d3(0xa3))/0x9;if(_0x5bc90b===_0x245427)break;else _0x2452b4['push'](_0x2452b4['shift']());}catch(_0x448b0f){_0x2452b4['push'](_0x2452b4['shift']());}}}(a111_0x5be9,0x7e36f));function a111_0x46ef(_0x27a917,_0x1fb046){_0x27a917=_0x27a917-0x95;const _0x5be91f=a111_0x5be9();let _0x46efdb=_0x5be91f[_0x27a917];return _0x46efdb;}export function buildFolderIdToPathMap(_0x63555b){const _0x5afa6b=a111_0x46ef,_0x3c1e21=new Map(),_0x5a6d63=new Map();for(const _0x54b4d8 of _0x63555b){_0x5a6d63[_0x5afa6b(0xa0)](_0x54b4d8['id'],_0x54b4d8);}const _0xba197b=new Set();for(const _0x55815e of _0x63555b){!_0x55815e[_0x5afa6b(0x9a)]&&_0xba197b[_0x5afa6b(0x9b)](_0x55815e['id']);}function _0x5b4840(_0x4f7b22){const _0x343517=_0x5afa6b;if(_0x3c1e21[_0x343517(0xa1)](_0x4f7b22['id']))return _0x3c1e21['get'](_0x4f7b22['id']);if(_0xba197b[_0x343517(0xa1)](_0x4f7b22['id']))return _0x3c1e21[_0x343517(0xa0)](_0x4f7b22['id'],''),'';if(_0x4f7b22[_0x343517(0x9a)]){const _0x29dfe0=_0x5a6d63[_0x343517(0x97)](_0x4f7b22[_0x343517(0x9a)]);if(_0x29dfe0){const _0x55a66d=_0x5b4840(_0x29dfe0),_0x3a850f=_0x55a66d?_0x55a66d+'/'+_0x4f7b22['name']:_0x4f7b22[_0x343517(0x9d)];return _0x3c1e21['set'](_0x4f7b22['id'],_0x3a850f),_0x3a850f;}}const _0x140a56=_0x4f7b22[_0x343517(0x9d)];return _0x3c1e21[_0x343517(0xa0)](_0x4f7b22['id'],_0x140a56),_0x140a56;}for(const _0x4a7ca6 of _0x63555b){_0x5b4840(_0x4a7ca6);}return _0x3c1e21;}export function buildFolderPathToIdMap(_0x5f2739){const _0x3b460d=a111_0x46ef,_0x2d9d7a=new Map(),_0x18ed7b=new Map();for(const _0x41f509 of _0x5f2739){_0x18ed7b[_0x3b460d(0xa0)](_0x41f509['id'],_0x41f509);}const _0x4a1b2d=new Set();for(const _0x2a06fc of _0x5f2739){!_0x2a06fc[_0x3b460d(0x9a)]&&_0x4a1b2d['add'](_0x2a06fc['id']);}function _0x1d636b(_0x35d534){const _0x6dc7a=_0x3b460d;if(_0x4a1b2d[_0x6dc7a(0xa1)](_0x35d534['id']))return'';if(_0x35d534['parentFolderId']){const _0x1c9374=_0x18ed7b[_0x6dc7a(0x97)](_0x35d534[_0x6dc7a(0x9a)]);if(_0x1c9374){const _0x27ed43=_0x1d636b(_0x1c9374);return _0x27ed43?_0x27ed43+'/'+_0x35d534[_0x6dc7a(0x9d)]:_0x35d534['name'];}}return _0x35d534['name'];}for(const _0x468f79 of _0x5f2739){const _0x9d0739=_0x1d636b(_0x468f79);_0x2d9d7a['set'](_0x9d0739,_0x468f79['id']);}return _0x2d9d7a;}export function buildFolderMaps(_0x548190){const _0x1f5f91=a111_0x46ef,_0xb9aefd=buildFolderIdToPathMap(_0x548190),_0x57344d=new Map();for(const [_0x4b82f2,_0xb9dc1f]of _0xb9aefd){_0x57344d[_0x1f5f91(0xa0)](_0xb9dc1f,_0x4b82f2);}return{'idToPath':_0xb9aefd,'pathToId':_0x57344d};}export function getFolderPath(_0x3662d4,_0x31a464){const _0x1d7de6=a111_0x46ef;if(!_0x3662d4)return'';return _0x31a464[_0x1d7de6(0x97)](_0x3662d4)??'';}
1
+ (function(_0x5aafe2,_0xfffc66){const _0x2da14e=a111_0x390f,_0x42e3bb=_0x5aafe2();while(!![]){try{const _0x13247f=parseInt(_0x2da14e(0x150))/0x1*(-parseInt(_0x2da14e(0x147))/0x2)+-parseInt(_0x2da14e(0x148))/0x3+parseInt(_0x2da14e(0x142))/0x4*(parseInt(_0x2da14e(0x14e))/0x5)+-parseInt(_0x2da14e(0x14b))/0x6*(parseInt(_0x2da14e(0x14c))/0x7)+-parseInt(_0x2da14e(0x14d))/0x8*(-parseInt(_0x2da14e(0x145))/0x9)+-parseInt(_0x2da14e(0x146))/0xa+parseInt(_0x2da14e(0x151))/0xb;if(_0x13247f===_0xfffc66)break;else _0x42e3bb['push'](_0x42e3bb['shift']());}catch(_0x661435){_0x42e3bb['push'](_0x42e3bb['shift']());}}}(a111_0x2378,0x962c6));export function buildFolderIdToPathMap(_0x2dc751){const _0x27d2e8=a111_0x390f,_0x4ca110=new Map(),_0x497cdd=new Map();for(const _0x36901c of _0x2dc751){_0x497cdd[_0x27d2e8(0x149)](_0x36901c['id'],_0x36901c);}const _0x16f1c7=new Set();for(const _0x2bbe96 of _0x2dc751){!_0x2bbe96[_0x27d2e8(0x14f)]&&_0x16f1c7[_0x27d2e8(0x141)](_0x2bbe96['id']);}function _0x4ff77a(_0x591b32){const _0x130327=_0x27d2e8;if(_0x4ca110[_0x130327(0x144)](_0x591b32['id']))return _0x4ca110['get'](_0x591b32['id']);if(_0x16f1c7[_0x130327(0x144)](_0x591b32['id']))return _0x4ca110['set'](_0x591b32['id'],''),'';if(_0x591b32[_0x130327(0x14f)]){const _0x4dee74=_0x497cdd['get'](_0x591b32['parentFolderId']);if(_0x4dee74){const _0x5a8144=_0x4ff77a(_0x4dee74),_0x5a7101=_0x5a8144?_0x5a8144+'/'+_0x591b32[_0x130327(0x143)]:_0x591b32['name'];return _0x4ca110['set'](_0x591b32['id'],_0x5a7101),_0x5a7101;}}const _0x8954e4=_0x591b32[_0x130327(0x143)];return _0x4ca110[_0x130327(0x149)](_0x591b32['id'],_0x8954e4),_0x8954e4;}for(const _0x1244d2 of _0x2dc751){_0x4ff77a(_0x1244d2);}return _0x4ca110;}function a111_0x390f(_0x1fc0bf,_0x2e8b14){_0x1fc0bf=_0x1fc0bf-0x141;const _0x2378a5=a111_0x2378();let _0x390f51=_0x2378a5[_0x1fc0bf];return _0x390f51;}export function buildFolderPathToIdMap(_0x1b2717){const _0x6a8d6a=a111_0x390f,_0x61b07=new Map(),_0xcd1e5c=new Map();for(const _0x2618bb of _0x1b2717){_0xcd1e5c[_0x6a8d6a(0x149)](_0x2618bb['id'],_0x2618bb);}const _0x455a1d=new Set();for(const _0x3ab2b8 of _0x1b2717){!_0x3ab2b8['parentFolderId']&&_0x455a1d['add'](_0x3ab2b8['id']);}function _0x14c665(_0x513a2a){const _0x5e6b1b=_0x6a8d6a;if(_0x455a1d[_0x5e6b1b(0x144)](_0x513a2a['id']))return'';if(_0x513a2a['parentFolderId']){const _0x3084a0=_0xcd1e5c[_0x5e6b1b(0x14a)](_0x513a2a[_0x5e6b1b(0x14f)]);if(_0x3084a0){const _0x54e722=_0x14c665(_0x3084a0);return _0x54e722?_0x54e722+'/'+_0x513a2a['name']:_0x513a2a[_0x5e6b1b(0x143)];}}return _0x513a2a['name'];}for(const _0x41a98e of _0x1b2717){const _0x51c97f=_0x14c665(_0x41a98e);_0x61b07[_0x6a8d6a(0x149)](_0x51c97f,_0x41a98e['id']);}return _0x61b07;}export function buildFolderMaps(_0x47db3a){const _0x49a2d0=a111_0x390f,_0x2d966f=buildFolderIdToPathMap(_0x47db3a),_0x5564f3=new Map();for(const [_0x3f633b,_0x445be4]of _0x2d966f){_0x5564f3[_0x49a2d0(0x149)](_0x445be4,_0x3f633b);}return{'idToPath':_0x2d966f,'pathToId':_0x5564f3};}export function getFolderPath(_0x4d62a9,_0x4e0533){if(!_0x4d62a9)return'';return _0x4e0533['get'](_0x4d62a9)??'';}function a111_0x2378(){const _0x219da9=['3EwNGEc','34723524QnRzMu','add','2409904QVQTvE','name','has','60552TSGFRv','9573570aSXkgH','363754ioQkNz','3236268sfUTsf','set','get','30yMyuBz','1616118VKsxhu','704ipMvIB','5RvXLcp','parentFolderId'];a111_0x2378=function(){return _0x219da9;};return a111_0x2378();}
@@ -1 +1 @@
1
- (function(_0x3639f7,_0x169e0e){const _0x15b82f=a112_0x4173,_0x18b5c7=_0x3639f7();while(!![]){try{const _0xb03f2=parseInt(_0x15b82f(0x196))/0x1+-parseInt(_0x15b82f(0x1aa))/0x2+parseInt(_0x15b82f(0x186))/0x3*(parseInt(_0x15b82f(0x183))/0x4)+parseInt(_0x15b82f(0x1a7))/0x5+-parseInt(_0x15b82f(0x19a))/0x6+parseInt(_0x15b82f(0x1ad))/0x7+-parseInt(_0x15b82f(0x19e))/0x8;if(_0xb03f2===_0x169e0e)break;else _0x18b5c7['push'](_0x18b5c7['shift']());}catch(_0xeeed27){_0x18b5c7['push'](_0x18b5c7['shift']());}}}(a112_0x2e49,0x6a815));import a112_0xaf8dcc from'path';import{parse as a112_0x3e2415}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x588f12){const _0x1c89e4=a112_0x4173;if(!_0x588f12||_0x588f12[_0x1c89e4(0x1a2)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x1d0592=_0x588f12[_0x1c89e4(0x1a2)]();if(_0x1d0592==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x588f12};const _0xd48d08=_0x1d0592[_0x1c89e4(0x185)]('/')?_0x1d0592[_0x1c89e4(0x1a0)](0x1):_0x1d0592,_0x22a9a7=_0xd48d08[_0x1c89e4(0x1a8)]('/')[_0x1c89e4(0x19f)](_0x43257=>_0x43257!=='');if(_0x22a9a7[_0x1c89e4(0x18b)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x28cf89=_0x1d0592['startsWith']('/')||!isRelativePathSegment(_0x22a9a7[0x0]);for(const _0x34edee of _0x22a9a7){validatePathSegment(_0x34edee);}return{'segments':_0x22a9a7,'isAbsolute':_0x28cf89,'raw':_0x588f12};}function a112_0x2e49(){const _0x4aea1c=['587588bKgRRB','dirname','segments','5059670QHWXSp','tdx.json','389764NuXiFc','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','startsWith','3GbNDKl','segment','raw','test','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','length','File\x20not\x20found:\x20','parse','type','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','join','journey','Cannot\x20split\x20empty\x20path','Cannot\x20navigate\x20above\x20root','endsWith','slice','25801EGBIYU','root','.yml','Relative\x20path\x20cannot\x20be\x20empty','2167182NJHxrL','push','isAbsolute','readFile','3653752XqhgbB','filter','substring','parent_segment','trim','exists','resolve','relative','pop','3509515lVvSmI','split','name'];a112_0x2e49=function(){return _0x4aea1c;};return a112_0x2e49();}function isRelativePathSegment(_0x389ac3){return _0x389ac3==='.'||_0x389ac3==='..';}function validatePathSegment(_0x54566c){const _0x28436f=a112_0x4173;if(_0x54566c==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x54566c==='.'||_0x54566c==='..')return;if(/[\x00-\x1F\x7F]/[_0x28436f(0x189)](_0x54566c))throw new Error(_0x28436f(0x18f)+_0x54566c);if(_0x54566c!==_0x54566c[_0x28436f(0x1a2)]()){}}export function validatePath(_0x160a7e){const _0x3c6cda=a112_0x4173;if(_0x160a7e[_0x3c6cda(0x1ac)]['length']===0x0&&!_0x160a7e[_0x3c6cda(0x19c)])throw new Error(_0x3c6cda(0x199));if(_0x160a7e['isAbsolute']){if(_0x160a7e[_0x3c6cda(0x1ac)][0x0]==='..')throw new Error(_0x3c6cda(0x184));let _0x34ccea=0x0;for(const _0x36d488 of _0x160a7e[_0x3c6cda(0x1ac)]){if(_0x36d488==='..'){if(_0x34ccea===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x34ccea--;}else _0x36d488!=='.'&&_0x34ccea++;}}}export function joinPaths(_0xbce3a5,_0x3c4cba){const _0x25e8fc=a112_0x4173;if(!_0xbce3a5||_0xbce3a5==='/')return _0x3c4cba;if(!_0x3c4cba||_0x3c4cba==='.')return _0xbce3a5;if(_0x3c4cba[_0x25e8fc(0x185)]('/'))return _0x3c4cba;const _0x5be56c=parsePath(_0xbce3a5),_0x9c511e=parsePath(_0x3c4cba),_0x16505a=[..._0x5be56c['segments']];for(const _0x2f10fb of _0x9c511e[_0x25e8fc(0x1ac)]){if(_0x2f10fb==='.')continue;else{if(_0x2f10fb==='..'){if(_0x16505a[_0x25e8fc(0x18b)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x16505a[_0x25e8fc(0x1a6)]();}else _0x16505a['push'](_0x2f10fb);}}const _0x11b0eb=_0x16505a[_0x25e8fc(0x190)]('/');return _0x5be56c[_0x25e8fc(0x188)]['startsWith']('/')?'/'+_0x11b0eb:_0x11b0eb;}export function normalizePath(_0x224270){const _0x2601ee=a112_0x4173,_0x77b69f=parsePath(_0x224270),_0x509153=[];for(const _0x101e3b of _0x77b69f[_0x2601ee(0x1ac)]){if(_0x101e3b==='.')continue;else{if(_0x101e3b==='..'){if(_0x509153[_0x2601ee(0x18b)]===0x0){if(_0x77b69f[_0x2601ee(0x19c)])throw new Error(_0x2601ee(0x193));_0x509153['push']('..');}else _0x509153[_0x509153[_0x2601ee(0x18b)]-0x1]==='..'?_0x509153[_0x2601ee(0x19b)]('..'):_0x509153[_0x2601ee(0x1a6)]();}else _0x509153[_0x2601ee(0x19b)](_0x101e3b);}}if(_0x509153['length']===0x0)return _0x77b69f[_0x2601ee(0x19c)]?'/':'.';const _0x187262=_0x509153[_0x2601ee(0x190)]('/');return _0x77b69f[_0x2601ee(0x188)][_0x2601ee(0x185)]('/')?'/'+_0x187262:_0x187262;}export function getParentPath(_0x1e5d28){const _0x2f9ceb=a112_0x4173,_0x29b74b=parsePath(_0x1e5d28);if(_0x29b74b['segments'][_0x2f9ceb(0x18b)]<=0x1)return'/';const _0x113df2=_0x29b74b['segments'][_0x2f9ceb(0x195)](0x0,-0x1)[_0x2f9ceb(0x190)]('/');return _0x29b74b[_0x2f9ceb(0x188)][_0x2f9ceb(0x185)]('/')?'/'+_0x113df2:_0x113df2;}export function getBaseName(_0xa02bd2){const _0x2902de=a112_0x4173,_0x42554b=parsePath(_0xa02bd2);return _0x42554b[_0x2902de(0x1ac)][_0x42554b[_0x2902de(0x1ac)]['length']-0x1]||'';}function a112_0x4173(_0xfac985,_0x5eb4e4){_0xfac985=_0xfac985-0x182;const _0x2e4947=a112_0x2e49();let _0x4173e8=_0x2e4947[_0xfac985];return _0x4173e8;}export function isChildPath(_0x454c78,_0x50e14d){const _0x23d369=a112_0x4173,_0x3790d5=parsePath(_0x454c78),_0x4fa07a=parsePath(_0x50e14d);if(_0x3790d5['segments']['length']<=_0x4fa07a['segments'][_0x23d369(0x18b)])return![];for(let _0x1bb619=0x0;_0x1bb619<_0x4fa07a[_0x23d369(0x1ac)][_0x23d369(0x18b)];_0x1bb619++){if(_0x3790d5[_0x23d369(0x1ac)][_0x1bb619]!==_0x4fa07a[_0x23d369(0x1ac)][_0x1bb619])return![];}return!![];}export function splitPath(_0x404743){const _0x586f63=a112_0x4173,_0x51f2c6=parsePath(_0x404743);if(_0x51f2c6[_0x586f63(0x1ac)][_0x586f63(0x18b)]===0x0)throw new Error(_0x586f63(0x192));if(_0x51f2c6[_0x586f63(0x1ac)]['length']===0x1)return{'parent':_0x51f2c6[_0x586f63(0x1ac)][0x0]};return{'parent':_0x51f2c6[_0x586f63(0x1ac)][0x0],'child':_0x51f2c6['segments']['slice'](0x1)[_0x586f63(0x190)]('/')};}export function isYamlFilePath(_0x5e77b8){const _0x16aca0=a112_0x4173;return _0x5e77b8['endsWith'](_0x16aca0(0x198))||_0x5e77b8[_0x16aca0(0x194)]('.yaml');}export async function resolveYamlFilePath(_0x88ad46,_0x24e44d=nodeFileSystem){const _0x2b337a=a112_0x4173,_0x4c6295=a112_0xaf8dcc[_0x2b337a(0x1a4)](_0x88ad46);if(!await _0x24e44d[_0x2b337a(0x1a3)](_0x4c6295))throw new Error(_0x2b337a(0x18c)+_0x88ad46);let _0x28e43f=a112_0xaf8dcc[_0x2b337a(0x1ab)](_0x4c6295),_0x58aa9c=null,_0x59a5c7=null;const _0x59403e=a112_0xaf8dcc[_0x2b337a(0x18d)](_0x28e43f)[_0x2b337a(0x197)];while(_0x28e43f!==_0x59403e){const _0x47d8f4=a112_0xaf8dcc['join'](_0x28e43f,_0x2b337a(0x182));if(await _0x24e44d[_0x2b337a(0x1a3)](_0x47d8f4)){_0x58aa9c=_0x47d8f4,_0x59a5c7=_0x28e43f;break;}_0x28e43f=a112_0xaf8dcc['dirname'](_0x28e43f);}if(!_0x58aa9c||!_0x59a5c7)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x88ad46);const _0x3f5700=await _0x24e44d[_0x2b337a(0x19d)](_0x58aa9c),_0x3c0692=JSON[_0x2b337a(0x18d)](_0x3f5700),_0x3ee3cb=_0x3c0692[_0x2b337a(0x1a1)];if(!_0x3ee3cb)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x4a6a16=await _0x24e44d[_0x2b337a(0x19d)](_0x4c6295),_0x438779=a112_0x3e2415(_0x4a6a16),_0xe955ca=_0x438779[_0x2b337a(0x1a9)];if(!_0xe955ca)throw new Error(_0x2b337a(0x18a)+_0x88ad46);const _0x4b295=_0x438779[_0x2b337a(0x18e)]===_0x2b337a(0x191)?_0x2b337a(0x191):_0x2b337a(0x187),_0x2522df=a112_0xaf8dcc[_0x2b337a(0x1a5)](_0x59a5c7,_0x4c6295),_0x519282=a112_0xaf8dcc[_0x2b337a(0x1ab)](_0x2522df),_0x3f2f95=_0x519282==='.'?'':_0x519282['replace'](/\\/g,'/'),_0x5d2851=_0x3f2f95?_0x3ee3cb+'/'+_0x3f2f95+'/'+_0xe955ca:_0x3ee3cb+'/'+_0xe955ca;return{'parentSegment':_0x3ee3cb,'segmentName':_0xe955ca,'folderPath':_0x3f2f95,'fullPath':_0x5d2851,'resourceType':_0x4b295};}
1
+ (function(_0x2f2e64,_0x5d6a98){const _0x36d0d5=a112_0x1e23,_0x1be65=_0x2f2e64();while(!![]){try{const _0x299644=-parseInt(_0x36d0d5(0xef))/0x1*(-parseInt(_0x36d0d5(0xe3))/0x2)+parseInt(_0x36d0d5(0xc2))/0x3*(-parseInt(_0x36d0d5(0xca))/0x4)+-parseInt(_0x36d0d5(0xe6))/0x5+-parseInt(_0x36d0d5(0xee))/0x6*(-parseInt(_0x36d0d5(0xc8))/0x7)+-parseInt(_0x36d0d5(0xf1))/0x8+-parseInt(_0x36d0d5(0xed))/0x9*(-parseInt(_0x36d0d5(0xdb))/0xa)+parseInt(_0x36d0d5(0xd7))/0xb;if(_0x299644===_0x5d6a98)break;else _0x1be65['push'](_0x1be65['shift']());}catch(_0x52527e){_0x1be65['push'](_0x1be65['shift']());}}}(a112_0x35f1,0x4d02a));import a112_0x53a190 from'path';import{parse as a112_0x59dc06}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x457618){const _0x1c229e=a112_0x1e23;if(!_0x457618||_0x457618['trim']()==='')throw new Error(_0x1c229e(0xea));const _0x49c747=_0x457618['trim']();if(_0x49c747==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x457618};const _0x35cab4=_0x49c747['startsWith']('/')?_0x49c747[_0x1c229e(0xe1)](0x1):_0x49c747,_0x2d7b21=_0x35cab4[_0x1c229e(0xcf)]('/')[_0x1c229e(0xd6)](_0xcf8dae=>_0xcf8dae!=='');if(_0x2d7b21['length']===0x0)throw new Error(_0x1c229e(0xdc));const _0x201bd2=_0x49c747[_0x1c229e(0xe0)]('/')||!isRelativePathSegment(_0x2d7b21[0x0]);for(const _0x279134 of _0x2d7b21){validatePathSegment(_0x279134);}return{'segments':_0x2d7b21,'isAbsolute':_0x201bd2,'raw':_0x457618};}function isRelativePathSegment(_0x16ceb5){return _0x16ceb5==='.'||_0x16ceb5==='..';}function validatePathSegment(_0x118e64){const _0x31537b=a112_0x1e23;if(_0x118e64==='')throw new Error(_0x31537b(0xf3));if(_0x118e64==='.'||_0x118e64==='..')return;if(/[\x00-\x1F\x7F]/[_0x31537b(0xc3)](_0x118e64))throw new Error(_0x31537b(0xc6)+_0x118e64);if(_0x118e64!==_0x118e64[_0x31537b(0xd0)]()){}}export function validatePath(_0x26eb2a){const _0x420e06=a112_0x1e23;if(_0x26eb2a['segments']['length']===0x0&&!_0x26eb2a[_0x420e06(0xe7)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x26eb2a[_0x420e06(0xe7)]){if(_0x26eb2a[_0x420e06(0xd5)][0x0]==='..')throw new Error(_0x420e06(0xcd));let _0x47fe7d=0x0;for(const _0x18fb81 of _0x26eb2a[_0x420e06(0xd5)]){if(_0x18fb81==='..'){if(_0x47fe7d===0x0)throw new Error(_0x420e06(0xdd));_0x47fe7d--;}else _0x18fb81!=='.'&&_0x47fe7d++;}}}export function joinPaths(_0x15eef9,_0xe7ebcf){const _0x429617=a112_0x1e23;if(!_0x15eef9||_0x15eef9==='/')return _0xe7ebcf;if(!_0xe7ebcf||_0xe7ebcf==='.')return _0x15eef9;if(_0xe7ebcf[_0x429617(0xe0)]('/'))return _0xe7ebcf;const _0x1040f9=parsePath(_0x15eef9),_0x26d45a=parsePath(_0xe7ebcf),_0x3f7159=[..._0x1040f9[_0x429617(0xd5)]];for(const _0x3c0b60 of _0x26d45a[_0x429617(0xd5)]){if(_0x3c0b60==='.')continue;else{if(_0x3c0b60==='..'){if(_0x3f7159['length']===0x0)throw new Error(_0x429617(0xe5));_0x3f7159[_0x429617(0xf2)]();}else _0x3f7159[_0x429617(0xcb)](_0x3c0b60);}}const _0x2a61e0=_0x3f7159[_0x429617(0xd4)]('/');return _0x1040f9['raw'][_0x429617(0xe0)]('/')?'/'+_0x2a61e0:_0x2a61e0;}export function normalizePath(_0x4e6b5a){const _0x31af34=a112_0x1e23,_0x3e53a2=parsePath(_0x4e6b5a),_0xa54b19=[];for(const _0x5a60ee of _0x3e53a2[_0x31af34(0xd5)]){if(_0x5a60ee==='.')continue;else{if(_0x5a60ee==='..'){if(_0xa54b19[_0x31af34(0xf0)]===0x0){if(_0x3e53a2[_0x31af34(0xe7)])throw new Error(_0x31af34(0xe5));_0xa54b19['push']('..');}else _0xa54b19[_0xa54b19[_0x31af34(0xf0)]-0x1]==='..'?_0xa54b19[_0x31af34(0xcb)]('..'):_0xa54b19[_0x31af34(0xf2)]();}else _0xa54b19[_0x31af34(0xcb)](_0x5a60ee);}}if(_0xa54b19['length']===0x0)return _0x3e53a2[_0x31af34(0xe7)]?'/':'.';const _0x48c8e9=_0xa54b19[_0x31af34(0xd4)]('/');return _0x3e53a2[_0x31af34(0xeb)][_0x31af34(0xe0)]('/')?'/'+_0x48c8e9:_0x48c8e9;}export function getParentPath(_0x367c8c){const _0x916b6d=a112_0x1e23,_0x352280=parsePath(_0x367c8c);if(_0x352280[_0x916b6d(0xd5)][_0x916b6d(0xf0)]<=0x1)return'/';const _0x37edc9=_0x352280['segments']['slice'](0x0,-0x1)[_0x916b6d(0xd4)]('/');return _0x352280[_0x916b6d(0xeb)][_0x916b6d(0xe0)]('/')?'/'+_0x37edc9:_0x37edc9;}export function getBaseName(_0x151bd0){const _0x2f07fd=a112_0x1e23,_0x22166a=parsePath(_0x151bd0);return _0x22166a[_0x2f07fd(0xd5)][_0x22166a[_0x2f07fd(0xd5)][_0x2f07fd(0xf0)]-0x1]||'';}function a112_0x1e23(_0x3a5b60,_0x523df8){_0x3a5b60=_0x3a5b60-0xc1;const _0x35f118=a112_0x35f1();let _0x1e232d=_0x35f118[_0x3a5b60];return _0x1e232d;}export function isChildPath(_0xfd5315,_0xa47c0c){const _0x75dab7=a112_0x1e23,_0x548746=parsePath(_0xfd5315),_0x1e3085=parsePath(_0xa47c0c);if(_0x548746[_0x75dab7(0xd5)][_0x75dab7(0xf0)]<=_0x1e3085[_0x75dab7(0xd5)]['length'])return![];for(let _0x4a8833=0x0;_0x4a8833<_0x1e3085[_0x75dab7(0xd5)]['length'];_0x4a8833++){if(_0x548746[_0x75dab7(0xd5)][_0x4a8833]!==_0x1e3085[_0x75dab7(0xd5)][_0x4a8833])return![];}return!![];}export function splitPath(_0x37444f){const _0x215e9a=a112_0x1e23,_0xab0d9=parsePath(_0x37444f);if(_0xab0d9[_0x215e9a(0xd5)][_0x215e9a(0xf0)]===0x0)throw new Error(_0x215e9a(0xd3));if(_0xab0d9[_0x215e9a(0xd5)][_0x215e9a(0xf0)]===0x1)return{'parent':_0xab0d9[_0x215e9a(0xd5)][0x0]};return{'parent':_0xab0d9[_0x215e9a(0xd5)][0x0],'child':_0xab0d9[_0x215e9a(0xd5)]['slice'](0x1)[_0x215e9a(0xd4)]('/')};}export function isYamlFilePath(_0x4c71e5){const _0x1cc02e=a112_0x1e23;return _0x4c71e5[_0x1cc02e(0xc1)](_0x1cc02e(0xde))||_0x4c71e5[_0x1cc02e(0xc1)](_0x1cc02e(0xce));}export async function resolveYamlFilePath(_0x58e3e2,_0x4d253a=nodeFileSystem){const _0x7a006b=a112_0x1e23,_0x2c7394=a112_0x53a190[_0x7a006b(0xec)](_0x58e3e2);if(!await _0x4d253a['exists'](_0x2c7394))throw new Error(_0x7a006b(0xc4)+_0x58e3e2);let _0x2c5bbb=a112_0x53a190[_0x7a006b(0xdf)](_0x2c7394),_0x4c62cb=null,_0x544604=null;const _0x4a3790=a112_0x53a190[_0x7a006b(0xd8)](_0x2c5bbb)['root'];while(_0x2c5bbb!==_0x4a3790){const _0x5bf2fb=a112_0x53a190['join'](_0x2c5bbb,_0x7a006b(0xc5));if(await _0x4d253a['exists'](_0x5bf2fb)){_0x4c62cb=_0x5bf2fb,_0x544604=_0x2c5bbb;break;}_0x2c5bbb=a112_0x53a190[_0x7a006b(0xdf)](_0x2c5bbb);}if(!_0x4c62cb||!_0x544604)throw new Error(_0x7a006b(0xc7)+_0x58e3e2);const _0xcdf8a5=await _0x4d253a[_0x7a006b(0xd9)](_0x4c62cb),_0x9311d6=JSON[_0x7a006b(0xd8)](_0xcdf8a5),_0x4952ce=_0x9311d6[_0x7a006b(0xc9)];if(!_0x4952ce)throw new Error(_0x7a006b(0xe8));const _0x2ee26c=await _0x4d253a[_0x7a006b(0xd9)](_0x2c7394),_0x3ed8b1=a112_0x59dc06(_0x2ee26c),_0x4e5721=_0x3ed8b1[_0x7a006b(0xcc)];if(!_0x4e5721)throw new Error(_0x7a006b(0xe9)+_0x58e3e2);const _0x37b26f=_0x3ed8b1[_0x7a006b(0xd1)]===_0x7a006b(0xda)?'journey':_0x7a006b(0xe4),_0x7e27a2=a112_0x53a190[_0x7a006b(0xd2)](_0x544604,_0x2c7394),_0x191f1c=a112_0x53a190['dirname'](_0x7e27a2),_0x484a3f=_0x191f1c==='.'?'':_0x191f1c[_0x7a006b(0xe2)](/\\/g,'/'),_0x3931dc=_0x484a3f?_0x4952ce+'/'+_0x484a3f+'/'+_0x4e5721:_0x4952ce+'/'+_0x4e5721;return{'parentSegment':_0x4952ce,'segmentName':_0x4e5721,'folderPath':_0x484a3f,'fullPath':_0x3931dc,'resourceType':_0x37b26f};}function a112_0x35f1(){const _0x5f07bb=['replace','214678ZxSyDE','segment','Cannot\x20navigate\x20above\x20root','1606630sXquQa','isAbsolute','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Path\x20cannot\x20be\x20empty','raw','resolve','354231MYkWbq','66VeNVnC','1VGKZIE','length','3631024yytLbk','pop','Path\x20segment\x20cannot\x20be\x20empty','endsWith','3bpOdct','test','File\x20not\x20found:\x20','tdx.json','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','No\x20tdx.json\x20found\x20for\x20file:\x20','141918kEDpwG','parent_segment','1592404kAQlfb','push','name','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','.yaml','split','trim','type','relative','Cannot\x20split\x20empty\x20path','join','segments','filter','7979807jCRKlh','parse','readFile','journey','110psTmaT','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Path\x20attempts\x20to\x20navigate\x20above\x20root','.yml','dirname','startsWith','substring'];a112_0x35f1=function(){return _0x5f07bb;};return a112_0x35f1();}
@@ -1 +1 @@
1
- function a113_0x2797(){const _0x441df5=['indexOf','.\x20Parent\x20name\x20cannot\x20be\x20empty','55wmGoOI','substring','571865UvllKv','13317832RGRhBb','18sJdJBj','1666279rtyrQa','.\x20Child\x20name\x20cannot\x20be\x20empty','20WtySsa','15453XkekAj','4758417zGGLcQ','8152XYzWRq','1866384uWjjbp','Invalid\x20segment\x20reference\x20format:\x20','186968fqTDRz'];a113_0x2797=function(){return _0x441df5;};return a113_0x2797();}(function(_0x56b918,_0x17e77b){const _0x3cca98=a113_0x3147,_0x300ef3=_0x56b918();while(!![]){try{const _0xea41c5=parseInt(_0x3cca98(0xd6))/0x1+-parseInt(_0x3cca98(0xcc))/0x2+parseInt(_0x3cca98(0xca))/0x3+-parseInt(_0x3cca98(0xce))/0x4*(parseInt(_0x3cca98(0xd1))/0x5)+-parseInt(_0x3cca98(0xd5))/0x6*(parseInt(_0x3cca98(0xd3))/0x7)+parseInt(_0x3cca98(0xcb))/0x8*(parseInt(_0x3cca98(0xc9))/0x9)+-parseInt(_0x3cca98(0xd8))/0xa*(parseInt(_0x3cca98(0xd4))/0xb);if(_0xea41c5===_0x17e77b)break;else _0x300ef3['push'](_0x300ef3['shift']());}catch(_0x390ad4){_0x300ef3['push'](_0x300ef3['shift']());}}}(a113_0x2797,0xd8d72));function a113_0x3147(_0x3e2999,_0x463e6a){_0x3e2999=_0x3e2999-0xc9;const _0x279748=a113_0x2797();let _0x31470d=_0x279748[_0x3e2999];return _0x31470d;}export function parseSegmentRef(_0x2efdc6){const _0x2df8e4=a113_0x3147,_0x2f93a4=_0x2efdc6[_0x2df8e4(0xcf)]('/');if(_0x2f93a4===-0x1)return{'parentId':_0x2efdc6};if(_0x2f93a4===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2efdc6+_0x2df8e4(0xd0));const _0x4e3681=_0x2efdc6[_0x2df8e4(0xd2)](0x0,_0x2f93a4),_0x42d0b6=_0x2efdc6['substring'](_0x2f93a4+0x1);if(_0x42d0b6==='')throw new Error(_0x2df8e4(0xcd)+_0x2efdc6+_0x2df8e4(0xd7));return{'parentId':_0x4e3681,'childId':_0x42d0b6};}
1
+ function a113_0x2535(_0x1aa6d5,_0x454113){_0x1aa6d5=_0x1aa6d5-0x1dc;const _0x5d61da=a113_0x5d61();let _0x2535c1=_0x5d61da[_0x1aa6d5];return _0x2535c1;}(function(_0x139a7d,_0x519673){const _0x53501e=a113_0x2535,_0x99ed4f=_0x139a7d();while(!![]){try{const _0x4f7066=-parseInt(_0x53501e(0x1dc))/0x1+parseInt(_0x53501e(0x1e7))/0x2+parseInt(_0x53501e(0x1e3))/0x3+-parseInt(_0x53501e(0x1de))/0x4+-parseInt(_0x53501e(0x1e1))/0x5+parseInt(_0x53501e(0x1e2))/0x6+parseInt(_0x53501e(0x1e0))/0x7*(-parseInt(_0x53501e(0x1e4))/0x8);if(_0x4f7066===_0x519673)break;else _0x99ed4f['push'](_0x99ed4f['shift']());}catch(_0x35f29b){_0x99ed4f['push'](_0x99ed4f['shift']());}}}(a113_0x5d61,0x8ce88));export function parseSegmentRef(_0x10dd56){const _0x2f5cce=a113_0x2535,_0x41afce=_0x10dd56[_0x2f5cce(0x1e6)]('/');if(_0x41afce===-0x1)return{'parentId':_0x10dd56};if(_0x41afce===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x10dd56+_0x2f5cce(0x1dd));const _0x5d4f20=_0x10dd56['substring'](0x0,_0x41afce),_0x41450a=_0x10dd56[_0x2f5cce(0x1df)](_0x41afce+0x1);if(_0x41450a==='')throw new Error(_0x2f5cce(0x1e5)+_0x10dd56+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x5d4f20,'childId':_0x41450a};}function a113_0x5d61(){const _0x3ff7e8=['4437365UNQsny','6764244gHiRWf','663336ybBobF','57192JDAYBS','Invalid\x20segment\x20reference\x20format:\x20','indexOf','1964558QtvxdH','780798nkLnoO','.\x20Parent\x20name\x20cannot\x20be\x20empty','112568rQoish','substring','56TqttVP'];a113_0x5d61=function(){return _0x3ff7e8;};return a113_0x5d61();}
@@ -1 +1 @@
1
- (function(_0xe8e9be,_0x382811){const _0x136725=a114_0x2e95,_0x3d9d73=_0xe8e9be();while(!![]){try{const _0x387cdc=-parseInt(_0x136725(0x68))/0x1*(-parseInt(_0x136725(0x99))/0x2)+-parseInt(_0x136725(0x92))/0x3*(parseInt(_0x136725(0x9f))/0x4)+-parseInt(_0x136725(0x74))/0x5*(-parseInt(_0x136725(0x91))/0x6)+-parseInt(_0x136725(0x9c))/0x7*(parseInt(_0x136725(0x83))/0x8)+-parseInt(_0x136725(0x77))/0x9*(parseInt(_0x136725(0x8f))/0xa)+parseInt(_0x136725(0x7f))/0xb*(-parseInt(_0x136725(0x75))/0xc)+parseInt(_0x136725(0x89))/0xd*(parseInt(_0x136725(0x8b))/0xe);if(_0x387cdc===_0x382811)break;else _0x3d9d73['push'](_0x3d9d73['shift']());}catch(_0x4d1e21){_0x3d9d73['push'](_0x3d9d73['shift']());}}}(a114_0x2270,0xa99cf));import a114_0x2c4799 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(_0x1d4ae5){const _0x19d79a=a114_0x2e95;return _0x1d4ae5[_0x19d79a(0x88)]!==_0x19d79a(0x86);}export function isScopedResolution(_0x3c5f2a){const _0x529796=a114_0x2e95;return _0x3c5f2a[_0x529796(0x88)]===_0x529796(0x71)||_0x3c5f2a[_0x529796(0x88)]===_0x529796(0x9b)||_0x3c5f2a[_0x529796(0x88)]===_0x529796(0x94);}export function getScopedDetails(_0x211a23){const _0x38dfd1=a114_0x2e95;if(isScopedResolution(_0x211a23))return{'isScoped':_0x211a23[_0x38dfd1(0x72)],'scopedFolderPath':_0x211a23[_0x38dfd1(0x70)]};return undefined;}function a114_0x2e95(_0x5be4fe,_0x559afc){_0x5be4fe=_0x5be4fe-0x66;const _0x227042=a114_0x2270();let _0x2e9567=_0x227042[_0x5be4fe];return _0x2e9567;}function a114_0x2270(){const _0x21b7a1=['error','parent_name','type','6617xruOWY','trim','77350zfhYBn','File\x20not\x20found:\x20','parse','tdx.json','196310UKuQEO','extname','6mDHrCV','11739BACLyL','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','context','string','segmentName','join','parentSegment','636394AcPhqG','root','file','7yinTsv','Not\x20a\x20YAML\x20file:\x20','readFile','1288Tvzmus','configDir','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','dirname','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','invalid_yaml','2uUcxex','match','message','resourceType','segment','no_parent','parent_segment','No\x20tdx.json\x20found\x20for\x20file:\x20','scopedFolderPath','directory','isScoped','journey','966010cqcgRO','3230808bvudzZ','isFile','495WjHnHt','folderPath','exists','stat','No\x20tdx.json\x20found','startsWith','File\x20not\x20found','resolve','11iogBEq','Parent\x20segment\x20not\x20specified','isDirectory','cwd','2705288tqMDjs','no_config','relative'];a114_0x2270=function(){return _0x21b7a1;};return a114_0x2270();}async function findTdxConfigAsync(_0x97cad5,_0x48c62f){const _0x25650d=a114_0x2e95;let _0x6e7c0=a114_0x2c4799[_0x25650d(0x7e)](_0x97cad5);const _0x3e4483=a114_0x2c4799[_0x25650d(0x8d)](_0x6e7c0)[_0x25650d(0x9a)];while(_0x6e7c0!==_0x3e4483){const _0x2ed4dc=a114_0x2c4799[_0x25650d(0x97)](_0x6e7c0,_0x25650d(0x8e));if(await _0x48c62f[_0x25650d(0x79)](_0x2ed4dc))try{const _0x49cc1a=await _0x48c62f[_0x25650d(0x9e)](_0x2ed4dc),_0x74df1=JSON['parse'](_0x49cc1a);if(_0x74df1[_0x25650d(0x6e)]&&typeof _0x74df1['parent_segment']===_0x25650d(0x95))return{'configPath':_0x2ed4dc,'configDir':_0x6e7c0,'parentSegment':_0x74df1[_0x25650d(0x6e)]};}catch{}_0x6e7c0=a114_0x2c4799[_0x25650d(0xa2)](_0x6e7c0);}return null;}function calculateScopedPath(_0x9a4136,_0x174d36){const _0x11588a=a114_0x2e95,_0x3bd17c=a114_0x2c4799[_0x11588a(0x85)](_0x174d36,_0x9a4136),_0x5439b1=_0x3bd17c!==''&&_0x3bd17c!=='.'&&!_0x3bd17c[_0x11588a(0x7c)]('..');return{'isScoped':_0x5439b1,'scopedFolderPath':_0x5439b1?_0x3bd17c['replace'](/\\/g,'/'):''};}export async function resolveTarget(_0x56932b){const _0x51f712=a114_0x2e95,{arg:_0x3bdede,contextParent:_0x499b8f,cwd:cwd=process[_0x51f712(0x82)](),fs:fs=nodeFileSystem}=_0x56932b;if(_0x3bdede&&isYamlFilePath(_0x3bdede))try{const _0x513353=await resolveYamlFilePath(_0x3bdede,fs),_0x29e7e9=a114_0x2c4799[_0x51f712(0x7e)](_0x3bdede),_0x5660e9=a114_0x2c4799['dirname'](_0x29e7e9),_0x11908d=await findTdxConfigAsync(_0x5660e9,fs);if(!_0x11908d){if(_0x499b8f){const _0x1319ad=a114_0x2c4799[_0x51f712(0xa2)](_0x29e7e9);return{'type':_0x51f712(0x9b),'parentName':_0x499b8f,'targetDir':_0x1319ad,'configRoot':_0x1319ad,'filePath':_0x29e7e9,'resourceName':_0x513353[_0x51f712(0x96)],'folderPath':_0x513353[_0x51f712(0x78)],'resourceType':_0x513353['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x51f712(0x86),'errorCode':'no_config','message':_0x51f712(0x6f)+_0x3bdede,'arg':_0x3bdede,'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 _0x24afb2=calculateScopedPath(_0x5660e9,_0x11908d[_0x51f712(0xa0)]);return{'type':_0x51f712(0x9b),'parentName':_0x11908d[_0x51f712(0x98)],'targetDir':_0x11908d['configDir'],'configRoot':_0x11908d['configDir'],'filePath':_0x29e7e9,'resourceName':_0x513353['segmentName'],'folderPath':_0x513353['folderPath'],'resourceType':_0x513353[_0x51f712(0x6b)],'isScoped':_0x24afb2[_0x51f712(0x72)],'scopedFolderPath':_0x24afb2[_0x51f712(0x70)]};}catch(_0xe22672){const _0x2181c8=_0xe22672 instanceof Error?_0xe22672[_0x51f712(0x6a)]:String(_0xe22672);if(_0x2181c8['includes'](_0x51f712(0x7d)))return{'type':_0x51f712(0x86),'errorCode':'file_not_found','message':_0x51f712(0x8c)+_0x3bdede,'arg':_0x3bdede};if(_0x2181c8['includes'](_0x51f712(0x7b))){if(_0x499b8f){const _0x2e3825=a114_0x2c4799['resolve'](_0x3bdede);if(await fs[_0x51f712(0x79)](_0x2e3825)){const _0x35cc98=a114_0x2c4799['dirname'](_0x2e3825),_0x3861e8=await fs[_0x51f712(0x9e)](_0x2e3825),_0x47cb65=_0x3861e8[_0x51f712(0x69)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x30c727=_0x3861e8[_0x51f712(0x69)](/^type:\s*["']?([^"'\n]+)["']?/m),_0xed05f8=_0x47cb65?_0x47cb65[0x1][_0x51f712(0x8a)]():a114_0x2c4799['basename'](_0x3bdede,a114_0x2c4799[_0x51f712(0x90)](_0x3bdede)),_0x17cd82=_0x30c727&&_0x30c727[0x1][_0x51f712(0x8a)]()==='journey'?_0x51f712(0x73):_0x51f712(0x6c);return{'type':_0x51f712(0x9b),'parentName':_0x499b8f,'targetDir':_0x35cc98,'configRoot':_0x35cc98,'filePath':_0x2e3825,'resourceName':_0xed05f8,'folderPath':'','resourceType':_0x17cd82,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x51f712(0x86),'errorCode':'no_config','message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x3bdede,'arg':_0x3bdede,'helpText':_0x51f712(0xa1)};}return{'type':_0x51f712(0x86),'errorCode':_0x51f712(0x67),'message':_0x2181c8,'arg':_0x3bdede};}if(_0x3bdede){const _0x3369c9=a114_0x2c4799['resolve'](cwd,_0x3bdede);let _0x3272e9=null;try{_0x3272e9=await fs[_0x51f712(0x7a)](_0x3369c9);}catch{}if(_0x3272e9?.[_0x51f712(0x81)]()){const _0x3cd64d=await findTdxConfigAsync(_0x3369c9,fs);if(_0x3cd64d){const _0x273beb=calculateScopedPath(_0x3369c9,_0x3cd64d[_0x51f712(0xa0)]);return{'type':_0x51f712(0x71),'parentName':_0x3cd64d[_0x51f712(0x98)],'targetDir':_0x3369c9,'configRoot':_0x3cd64d[_0x51f712(0xa0)],'isScoped':_0x273beb[_0x51f712(0x72)],'scopedFolderPath':_0x273beb[_0x51f712(0x70)]};}if(_0x499b8f)return{'type':_0x51f712(0x71),'parentName':_0x499b8f,'targetDir':_0x3369c9,'configRoot':_0x3369c9,'isScoped':![],'scopedFolderPath':''};return{'type':_0x51f712(0x86),'errorCode':_0x51f712(0x84),'message':_0x51f712(0x66)+_0x3bdede,'arg':_0x3bdede,'helpText':_0x51f712(0xa1)};}if(_0x3272e9?.[_0x51f712(0x76)]())return{'type':'error','errorCode':'invalid_yaml','message':_0x51f712(0x9d)+_0x3bdede,'arg':_0x3bdede,'helpText':_0x51f712(0x93)};const _0x523040=sanitizeFileName(_0x3bdede),_0xba5255=getSegmentRootDir(_0x523040,cwd);return{'type':_0x51f712(0x87),'parentName':_0x3bdede,'targetDir':_0xba5255,'configRoot':_0xba5255};}const _0x3c8740=await findTdxConfigAsync(cwd,fs);if(_0x3c8740){const _0x488464=calculateScopedPath(cwd,_0x3c8740[_0x51f712(0xa0)]);return{'type':_0x51f712(0x94),'parentName':_0x3c8740[_0x51f712(0x98)],'targetDir':cwd,'configRoot':_0x3c8740[_0x51f712(0xa0)],'isScoped':_0x488464['isScoped'],'scopedFolderPath':_0x488464[_0x51f712(0x70)]};}if(_0x499b8f){const _0x2b4f6c=sanitizeFileName(_0x499b8f),_0x2a6df0=getSegmentRootDir(_0x2b4f6c,cwd);return{'type':_0x51f712(0x94),'parentName':_0x499b8f,'targetDir':_0x2a6df0,'configRoot':_0x2a6df0,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x51f712(0x6d),'message':_0x51f712(0x80),'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
+ (function(_0x4c36a9,_0x241aa3){const _0x5edb41=a114_0x4dbe,_0x11aa98=_0x4c36a9();while(!![]){try{const _0x783ac7=parseInt(_0x5edb41(0xdc))/0x1*(-parseInt(_0x5edb41(0xbd))/0x2)+-parseInt(_0x5edb41(0xc9))/0x3+parseInt(_0x5edb41(0xe0))/0x4+parseInt(_0x5edb41(0xd2))/0x5+-parseInt(_0x5edb41(0xd0))/0x6*(parseInt(_0x5edb41(0xc4))/0x7)+parseInt(_0x5edb41(0xb5))/0x8+-parseInt(_0x5edb41(0xdf))/0x9*(-parseInt(_0x5edb41(0xcb))/0xa);if(_0x783ac7===_0x241aa3)break;else _0x11aa98['push'](_0x11aa98['shift']());}catch(_0x12a6e8){_0x11aa98['push'](_0x11aa98['shift']());}}}(a114_0x28c1,0x4a304));import a114_0x2c2b29 from'path';function a114_0x4dbe(_0x4813be,_0x35f81a){_0x4813be=_0x4813be-0xb4;const _0x28c10e=a114_0x28c1();let _0x4dbe4c=_0x28c10e[_0x4813be];return _0x4dbe4c;}import{sanitizeFileName}from'../../utils/string-utils.js';function a114_0x28c1(){const _0x55dafc=['message','no_parent','extname','file','Not\x20a\x20YAML\x20file:\x20','type','24jjhIOZ','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','parent_name','context','isDirectory','journey','resourceType','7itMYyK','resolve','parse','No\x20tdx.json\x20found','segmentName','590925GdURuk','includes','10PadEsL','string','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','isScoped','match','313644BQZdUS','join','1331315YekocO','replace','segment','File\x20not\x20found','folderPath','configDir','Parent\x20segment\x20not\x20specified','File\x20not\x20found:\x20','No\x20tdx.json\x20found\x20for\x20file:\x20','dirname','19387GXhVLg','trim','invalid_yaml','699912GgIQHQ','615652OWLZhV','root','scopedFolderPath','parent_segment','parentSegment','cwd','exists','tdx.json','error','2302600bzRwGr','no_config'];a114_0x28c1=function(){return _0x55dafc;};return a114_0x28c1();}import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0xb2422a){const _0x4c412d=a114_0x4dbe;return _0xb2422a[_0x4c412d(0xbc)]!==_0x4c412d(0xb4);}export function isScopedResolution(_0x6ac7d8){const _0x21505f=a114_0x4dbe;return _0x6ac7d8[_0x21505f(0xbc)]==='directory'||_0x6ac7d8[_0x21505f(0xbc)]===_0x21505f(0xba)||_0x6ac7d8['type']===_0x21505f(0xc0);}export function getScopedDetails(_0x13fdaf){const _0x22cb26=a114_0x4dbe;if(isScopedResolution(_0x13fdaf))return{'isScoped':_0x13fdaf[_0x22cb26(0xce)],'scopedFolderPath':_0x13fdaf[_0x22cb26(0xe2)]};return undefined;}async function findTdxConfigAsync(_0x3d0354,_0x34f0ba){const _0x383a9d=a114_0x4dbe;let _0x29f252=a114_0x2c2b29[_0x383a9d(0xc5)](_0x3d0354);const _0x456959=a114_0x2c2b29[_0x383a9d(0xc6)](_0x29f252)[_0x383a9d(0xe1)];while(_0x29f252!==_0x456959){const _0x5df71f=a114_0x2c2b29[_0x383a9d(0xd1)](_0x29f252,_0x383a9d(0xe7));if(await _0x34f0ba[_0x383a9d(0xe6)](_0x5df71f))try{const _0x559017=await _0x34f0ba['readFile'](_0x5df71f),_0x4c8bec=JSON[_0x383a9d(0xc6)](_0x559017);if(_0x4c8bec[_0x383a9d(0xe3)]&&typeof _0x4c8bec[_0x383a9d(0xe3)]===_0x383a9d(0xcc))return{'configPath':_0x5df71f,'configDir':_0x29f252,'parentSegment':_0x4c8bec['parent_segment']};}catch{}_0x29f252=a114_0x2c2b29['dirname'](_0x29f252);}return null;}function calculateScopedPath(_0x1bc814,_0x419203){const _0x54484b=a114_0x4dbe,_0x4cc247=a114_0x2c2b29['relative'](_0x419203,_0x1bc814),_0x3e821e=_0x4cc247!==''&&_0x4cc247!=='.'&&!_0x4cc247['startsWith']('..');return{'isScoped':_0x3e821e,'scopedFolderPath':_0x3e821e?_0x4cc247[_0x54484b(0xd3)](/\\/g,'/'):''};}export async function resolveTarget(_0x515556){const _0x16f5c0=a114_0x4dbe,{arg:_0x4df769,contextParent:_0xaecac0,cwd:cwd=process[_0x16f5c0(0xe5)](),fs:fs=nodeFileSystem}=_0x515556;if(_0x4df769&&isYamlFilePath(_0x4df769))try{const _0x1be11e=await resolveYamlFilePath(_0x4df769,fs),_0x49b31e=a114_0x2c2b29[_0x16f5c0(0xc5)](_0x4df769),_0x286299=a114_0x2c2b29['dirname'](_0x49b31e),_0xe16b5=await findTdxConfigAsync(_0x286299,fs);if(!_0xe16b5){if(_0xaecac0){const _0x206f5e=a114_0x2c2b29[_0x16f5c0(0xdb)](_0x49b31e);return{'type':'file','parentName':_0xaecac0,'targetDir':_0x206f5e,'configRoot':_0x206f5e,'filePath':_0x49b31e,'resourceName':_0x1be11e[_0x16f5c0(0xc8)],'folderPath':_0x1be11e[_0x16f5c0(0xd6)],'resourceType':_0x1be11e[_0x16f5c0(0xc3)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x16f5c0(0xb4),'errorCode':_0x16f5c0(0xb6),'message':_0x16f5c0(0xda)+_0x4df769,'arg':_0x4df769,'helpText':_0x16f5c0(0xcd)};}const _0x11438f=calculateScopedPath(_0x286299,_0xe16b5[_0x16f5c0(0xd7)]);return{'type':_0x16f5c0(0xba),'parentName':_0xe16b5['parentSegment'],'targetDir':_0xe16b5[_0x16f5c0(0xd7)],'configRoot':_0xe16b5['configDir'],'filePath':_0x49b31e,'resourceName':_0x1be11e['segmentName'],'folderPath':_0x1be11e['folderPath'],'resourceType':_0x1be11e['resourceType'],'isScoped':_0x11438f[_0x16f5c0(0xce)],'scopedFolderPath':_0x11438f[_0x16f5c0(0xe2)]};}catch(_0x8f694d){const _0x348f41=_0x8f694d instanceof Error?_0x8f694d[_0x16f5c0(0xb7)]:String(_0x8f694d);if(_0x348f41[_0x16f5c0(0xca)](_0x16f5c0(0xd5)))return{'type':_0x16f5c0(0xb4),'errorCode':'file_not_found','message':_0x16f5c0(0xd9)+_0x4df769,'arg':_0x4df769};if(_0x348f41[_0x16f5c0(0xca)](_0x16f5c0(0xc7))){if(_0xaecac0){const _0x30ce2b=a114_0x2c2b29[_0x16f5c0(0xc5)](_0x4df769);if(await fs[_0x16f5c0(0xe6)](_0x30ce2b)){const _0x4ac539=a114_0x2c2b29[_0x16f5c0(0xdb)](_0x30ce2b),_0x4fef0d=await fs['readFile'](_0x30ce2b),_0x556662=_0x4fef0d[_0x16f5c0(0xcf)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x5cbef1=_0x4fef0d['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x299758=_0x556662?_0x556662[0x1][_0x16f5c0(0xdd)]():a114_0x2c2b29['basename'](_0x4df769,a114_0x2c2b29[_0x16f5c0(0xb9)](_0x4df769)),_0x1f4535=_0x5cbef1&&_0x5cbef1[0x1][_0x16f5c0(0xdd)]()==='journey'?_0x16f5c0(0xc2):_0x16f5c0(0xd4);return{'type':_0x16f5c0(0xba),'parentName':_0xaecac0,'targetDir':_0x4ac539,'configRoot':_0x4ac539,'filePath':_0x30ce2b,'resourceName':_0x299758,'folderPath':'','resourceType':_0x1f4535,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x16f5c0(0xb4),'errorCode':_0x16f5c0(0xb6),'message':_0x16f5c0(0xda)+_0x4df769,'arg':_0x4df769,'helpText':_0x16f5c0(0xcd)};}return{'type':'error','errorCode':_0x16f5c0(0xde),'message':_0x348f41,'arg':_0x4df769};}if(_0x4df769){const _0x14ee86=a114_0x2c2b29[_0x16f5c0(0xc5)](cwd,_0x4df769);let _0x485f19=null;try{_0x485f19=await fs['stat'](_0x14ee86);}catch{}if(_0x485f19?.[_0x16f5c0(0xc1)]()){const _0x4eb5b3=await findTdxConfigAsync(_0x14ee86,fs);if(_0x4eb5b3){const _0x467d92=calculateScopedPath(_0x14ee86,_0x4eb5b3[_0x16f5c0(0xd7)]);return{'type':'directory','parentName':_0x4eb5b3[_0x16f5c0(0xe4)],'targetDir':_0x14ee86,'configRoot':_0x4eb5b3[_0x16f5c0(0xd7)],'isScoped':_0x467d92[_0x16f5c0(0xce)],'scopedFolderPath':_0x467d92['scopedFolderPath']};}if(_0xaecac0)return{'type':'directory','parentName':_0xaecac0,'targetDir':_0x14ee86,'configRoot':_0x14ee86,'isScoped':![],'scopedFolderPath':''};return{'type':_0x16f5c0(0xb4),'errorCode':_0x16f5c0(0xb6),'message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x4df769,'arg':_0x4df769,'helpText':_0x16f5c0(0xcd)};}if(_0x485f19?.['isFile']())return{'type':_0x16f5c0(0xb4),'errorCode':'invalid_yaml','message':_0x16f5c0(0xbb)+_0x4df769,'arg':_0x4df769,'helpText':_0x16f5c0(0xbe)};const _0x63b655=sanitizeFileName(_0x4df769),_0x40e214=getSegmentRootDir(_0x63b655,cwd);return{'type':_0x16f5c0(0xbf),'parentName':_0x4df769,'targetDir':_0x40e214,'configRoot':_0x40e214};}const _0x2f40d8=await findTdxConfigAsync(cwd,fs);if(_0x2f40d8){const _0x78d9aa=calculateScopedPath(cwd,_0x2f40d8['configDir']);return{'type':_0x16f5c0(0xc0),'parentName':_0x2f40d8[_0x16f5c0(0xe4)],'targetDir':cwd,'configRoot':_0x2f40d8[_0x16f5c0(0xd7)],'isScoped':_0x78d9aa[_0x16f5c0(0xce)],'scopedFolderPath':_0x78d9aa[_0x16f5c0(0xe2)]};}if(_0xaecac0){const _0x1abaf5=sanitizeFileName(_0xaecac0),_0x3228e1=getSegmentRootDir(_0x1abaf5,cwd);return{'type':'context','parentName':_0xaecac0,'targetDir':_0x3228e1,'configRoot':_0x3228e1,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x16f5c0(0xb4),'errorCode':_0x16f5c0(0xb8),'message':_0x16f5c0(0xd8),'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 a115_0x70dae6=a115_0x401b;(function(_0x4535d1,_0x40942e){const _0x550edc=a115_0x401b,_0xfeddb4=_0x4535d1();while(!![]){try{const _0x9bf0c7=-parseInt(_0x550edc(0x150))/0x1+-parseInt(_0x550edc(0x14d))/0x2+parseInt(_0x550edc(0x152))/0x3*(-parseInt(_0x550edc(0x143))/0x4)+parseInt(_0x550edc(0x156))/0x5*(-parseInt(_0x550edc(0x157))/0x6)+parseInt(_0x550edc(0x141))/0x7*(-parseInt(_0x550edc(0x149))/0x8)+-parseInt(_0x550edc(0x147))/0x9+-parseInt(_0x550edc(0x155))/0xa*(-parseInt(_0x550edc(0x144))/0xb);if(_0x9bf0c7===_0x40942e)break;else _0xfeddb4['push'](_0xfeddb4['shift']());}catch(_0x29798e){_0xfeddb4['push'](_0xfeddb4['shift']());}}}(a115_0x4d8c,0x86c74));import{existsSync,readFileSync}from'fs';import a115_0xd91c63 from'path';const TDX_CONFIG_FILE=a115_0x70dae6(0x14e),SEGMENTS_DIR=a115_0x70dae6(0x154);export function findTdxConfigPath(_0x3d6210=process[a115_0x70dae6(0x140)]()){const _0x44bbc5=a115_0x70dae6;let _0x425b9b=a115_0xd91c63[_0x44bbc5(0x151)](_0x3d6210);const _0x58c86c=a115_0xd91c63['parse'](_0x425b9b)[_0x44bbc5(0x159)];while(_0x425b9b!==_0x58c86c){const _0x413480=a115_0xd91c63[_0x44bbc5(0x15a)](_0x425b9b,TDX_CONFIG_FILE);if(existsSync(_0x413480))return _0x413480;_0x425b9b=a115_0xd91c63[_0x44bbc5(0x13f)](_0x425b9b);}return null;}export function loadTdxConfig(_0x20cc03){const _0xb9cd44=a115_0x70dae6,_0x33f9e6=readFileSync(_0x20cc03,'utf-8');let _0x4ed195;try{_0x4ed195=JSON['parse'](_0x33f9e6);}catch{throw new Error(_0xb9cd44(0x14b)+_0x20cc03);}if(!_0x4ed195||typeof _0x4ed195!==_0xb9cd44(0x146))throw new Error('Invalid\x20tdx.json:\x20expected\x20object');const _0x688b63=_0x4ed195;if(!_0x688b63[_0xb9cd44(0x148)]||typeof _0x688b63[_0xb9cd44(0x148)]!==_0xb9cd44(0x153))throw new Error(_0xb9cd44(0x142));return{'parent_segment':_0x688b63['parent_segment']};}export function findTdxConfig(_0x434abf=process[a115_0x70dae6(0x140)]()){const _0x9cdb7b=a115_0x70dae6,_0x30b3b8=findTdxConfigPath(_0x434abf);if(!_0x30b3b8)throw new Error(_0x9cdb7b(0x145));const _0x2477b6=loadTdxConfig(_0x30b3b8),_0x441c3b=a115_0xd91c63[_0x9cdb7b(0x13f)](_0x30b3b8);return{'config':_0x2477b6,'configPath':_0x30b3b8,'configDir':_0x441c3b};}export function tryFindTdxConfig(_0xb24200){try{return findTdxConfig(_0xb24200);}catch{return null;}}export function getSegmentRootDir(_0x4933cd,_0x1f5f4e=process[a115_0x70dae6(0x140)]()){const _0x5056df=a115_0x70dae6;return a115_0xd91c63[_0x5056df(0x15a)](_0x1f5f4e,SEGMENTS_DIR,_0x4933cd);}export function getTdxConfigPath(_0x24afcd,_0x44f35a=process[a115_0x70dae6(0x140)]()){const _0x1c805d=a115_0x70dae6;return a115_0xd91c63[_0x1c805d(0x15a)](getSegmentRootDir(_0x24afcd,_0x44f35a),TDX_CONFIG_FILE);}function a115_0x401b(_0x3a1db2,_0x13cc5a){_0x3a1db2=_0x3a1db2-0x13f;const _0x4d8cc6=a115_0x4d8c();let _0x401be2=_0x4d8cc6[_0x3a1db2];return _0x401be2;}function a115_0x4d8c(){const _0x5955e9=['543128nLJZSG','resolve','1927779CrwWoZ','string','segments','43043330FSTqvd','5GJvYzF','2653212ovHBim','startsWith','root','join','dirname','cwd','293951GnQkXz','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','4WsoiMi','11VuvWNp','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','object','4667445NVoWcG','parent_segment','176pJLwwi','stringify','Invalid\x20JSON\x20in\x20','relative','1363814SzxPHt','tdx.json','replace'];a115_0x4d8c=function(){return _0x5955e9;};return a115_0x4d8c();}export function getRelativePathFromConfig(_0x50c792,_0x583834){const _0xb72586=a115_0x70dae6,_0x117d04=a115_0xd91c63['resolve'](_0x50c792),_0x15c516=a115_0xd91c63[_0xb72586(0x14c)](_0x583834,_0x117d04);if(_0x15c516[_0xb72586(0x158)]('..'))return'';return _0x15c516;}export function localPathToTdFolderPath(_0x1a2592){const _0x2a1242=a115_0x70dae6,_0xb35e67=a115_0xd91c63[_0x2a1242(0x13f)](_0x1a2592);if(_0xb35e67==='.'||_0xb35e67==='')return'';return _0xb35e67[_0x2a1242(0x14f)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x4d8aed,_0xd1da7d){const _0x4f2672=a115_0x70dae6;if(!_0x4d8aed)return _0xd1da7d;return a115_0xd91c63[_0x4f2672(0x15a)](_0xd1da7d,_0x4d8aed);}export function createTdxConfigContent(_0x15fcdc){const _0x422b5f=a115_0x70dae6,_0x3bbf66={'parent_segment':_0x15fcdc};return JSON[_0x422b5f(0x14a)](_0x3bbf66,null,0x2)+'\x0a';}
1
+ const a115_0xc3178e=a115_0x378b;(function(_0x7c6026,_0x15d80a){const _0x7030f9=a115_0x378b,_0x388bec=_0x7c6026();while(!![]){try{const _0x47967c=-parseInt(_0x7030f9(0x1e9))/0x1*(-parseInt(_0x7030f9(0x1f6))/0x2)+-parseInt(_0x7030f9(0x200))/0x3*(parseInt(_0x7030f9(0x1fd))/0x4)+parseInt(_0x7030f9(0x1ea))/0x5*(-parseInt(_0x7030f9(0x1f4))/0x6)+parseInt(_0x7030f9(0x1ef))/0x7+-parseInt(_0x7030f9(0x1e7))/0x8+parseInt(_0x7030f9(0x1fa))/0x9*(-parseInt(_0x7030f9(0x1f8))/0xa)+parseInt(_0x7030f9(0x1f5))/0xb;if(_0x47967c===_0x15d80a)break;else _0x388bec['push'](_0x388bec['shift']());}catch(_0x1ae7b4){_0x388bec['push'](_0x388bec['shift']());}}}(a115_0x39df,0xd2c76));import{existsSync,readFileSync}from'fs';import a115_0x1be7e7 from'path';const TDX_CONFIG_FILE=a115_0xc3178e(0x1f1),SEGMENTS_DIR=a115_0xc3178e(0x1e6);export function findTdxConfigPath(_0x36c6ab=process[a115_0xc3178e(0x1ed)]()){const _0x41cb39=a115_0xc3178e;let _0x3b6034=a115_0x1be7e7[_0x41cb39(0x1ec)](_0x36c6ab);const _0x550440=a115_0x1be7e7[_0x41cb39(0x1f3)](_0x3b6034)[_0x41cb39(0x1e5)];while(_0x3b6034!==_0x550440){const _0x19dbf6=a115_0x1be7e7['join'](_0x3b6034,TDX_CONFIG_FILE);if(existsSync(_0x19dbf6))return _0x19dbf6;_0x3b6034=a115_0x1be7e7['dirname'](_0x3b6034);}return null;}export function loadTdxConfig(_0x190980){const _0x527802=a115_0xc3178e,_0x2cc11d=readFileSync(_0x190980,_0x527802(0x1ee));let _0xd1c9db;try{_0xd1c9db=JSON[_0x527802(0x1f3)](_0x2cc11d);}catch{throw new Error(_0x527802(0x1f0)+_0x190980);}if(!_0xd1c9db||typeof _0xd1c9db!==_0x527802(0x1f9))throw new Error(_0x527802(0x1fe));const _0x2d2926=_0xd1c9db;if(!_0x2d2926[_0x527802(0x1fb)]||typeof _0x2d2926[_0x527802(0x1fb)]!==_0x527802(0x1f7))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field');return{'parent_segment':_0x2d2926[_0x527802(0x1fb)]};}export function findTdxConfig(_0x92d08b=process[a115_0xc3178e(0x1ed)]()){const _0x26ce87=a115_0xc3178e,_0x385c32=findTdxConfigPath(_0x92d08b);if(!_0x385c32)throw new Error(_0x26ce87(0x1ff));const _0x226ffd=loadTdxConfig(_0x385c32),_0x48ec9e=a115_0x1be7e7['dirname'](_0x385c32);return{'config':_0x226ffd,'configPath':_0x385c32,'configDir':_0x48ec9e};}export function tryFindTdxConfig(_0x5622af){try{return findTdxConfig(_0x5622af);}catch{return null;}}function a115_0x378b(_0x5224a0,_0x2e621a){_0x5224a0=_0x5224a0-0x1e5;const _0x39df71=a115_0x39df();let _0x378b94=_0x39df71[_0x5224a0];return _0x378b94;}export function getSegmentRootDir(_0x4344a0,_0x56bf3a=process[a115_0xc3178e(0x1ed)]()){return a115_0x1be7e7['join'](_0x56bf3a,SEGMENTS_DIR,_0x4344a0);}export function getTdxConfigPath(_0x2459d0,_0x586172=process[a115_0xc3178e(0x1ed)]()){const _0x4a7e6e=a115_0xc3178e;return a115_0x1be7e7[_0x4a7e6e(0x1fc)](getSegmentRootDir(_0x2459d0,_0x586172),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x312112,_0x2ff54a){const _0x5794d4=a115_0xc3178e,_0x330ab5=a115_0x1be7e7['resolve'](_0x312112),_0x1bf88a=a115_0x1be7e7[_0x5794d4(0x1f2)](_0x2ff54a,_0x330ab5);if(_0x1bf88a['startsWith']('..'))return'';return _0x1bf88a;}export function localPathToTdFolderPath(_0x7d5c75){const _0x2f6e2e=a115_0xc3178e,_0x3234b7=a115_0x1be7e7[_0x2f6e2e(0x1e8)](_0x7d5c75);if(_0x3234b7==='.'||_0x3234b7==='')return'';return _0x3234b7['replace'](/\\/g,'/');}function a115_0x39df(){const _0x4d0be1=['utf-8','1095731qHFtVF','Invalid\x20JSON\x20in\x20','tdx.json','relative','parse','216UCSdAO','43903970YXgamD','2096DlPDZX','string','117710QtnHtp','object','810waViYk','parent_segment','join','8cErDhw','Invalid\x20tdx.json:\x20expected\x20object','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','1791993EFlQMQ','root','segments','7585576neCKmw','dirname','734JcmBbU','118255FFHPSM','stringify','resolve','cwd'];a115_0x39df=function(){return _0x4d0be1;};return a115_0x39df();}export function tdFolderPathToLocalPath(_0x2146c2,_0x328b64){const _0x440fd3=a115_0xc3178e;if(!_0x2146c2)return _0x328b64;return a115_0x1be7e7[_0x440fd3(0x1fc)](_0x328b64,_0x2146c2);}export function createTdxConfigContent(_0x1a6286){const _0x293b77=a115_0xc3178e,_0x1ce808={'parent_segment':_0x1a6286};return JSON[_0x293b77(0x1eb)](_0x1ce808,null,0x2)+'\x0a';}