@treasuredata/tdx 0.14.2 → 0.14.3

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 (145) 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/api-command.js +1 -1
  8. package/dist/commands/auth-command.d.ts.map +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-command.js.map +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-command.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/journey-command.js +1 -1
  22. package/dist/commands/journey-validate-command.js +1 -1
  23. package/dist/commands/llm-command.js +1 -1
  24. package/dist/commands/llm-proxy.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-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/tables.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.js +1 -1
  43. package/dist/core/auth.js +1 -1
  44. package/dist/core/command-output.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/connection-cache.js +1 -1
  47. package/dist/core/constants.js +1 -1
  48. package/dist/core/credential-cache.js +1 -1
  49. package/dist/core/global-context.js +1 -1
  50. package/dist/core/keychain.js +1 -1
  51. package/dist/core/profile.d.ts +15 -0
  52. package/dist/core/profile.d.ts.map +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/profile.js.map +1 -1
  55. package/dist/core/project-config.js +1 -1
  56. package/dist/core/session.js +1 -1
  57. package/dist/core/user-cache.js +1 -1
  58. package/dist/core/version.js +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/proxy/anthropic-adapter.js +1 -1
  61. package/dist/proxy/claude-usage-tracker.js +1 -1
  62. package/dist/proxy/context-signature.js +1 -1
  63. package/dist/proxy/conversation-utils.js +1 -1
  64. package/dist/proxy/passthrough-server.d.ts +13 -2
  65. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  66. package/dist/proxy/passthrough-server.js +1 -1
  67. package/dist/proxy/passthrough-server.js.map +1 -1
  68. package/dist/proxy/server.js +1 -1
  69. package/dist/proxy/session-cache.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/api.js +1 -1
  75. package/dist/sdk/client/cdp-api-client.js +1 -1
  76. package/dist/sdk/client/endpoints.js +1 -1
  77. package/dist/sdk/client/engage-api-client.js +1 -1
  78. package/dist/sdk/client/http-client.js +1 -1
  79. package/dist/sdk/client/llm-api-client.js +1 -1
  80. package/dist/sdk/client/rate-limiter.js +1 -1
  81. package/dist/sdk/client/td-api-client.js +1 -1
  82. package/dist/sdk/client/trino-api-client.js +1 -1
  83. package/dist/sdk/client/workflow-client.js +1 -1
  84. package/dist/sdk/connection-validator.js +1 -1
  85. package/dist/sdk/connection.js +1 -1
  86. package/dist/sdk/engage.js +1 -1
  87. package/dist/sdk/errors.js +1 -1
  88. package/dist/sdk/index.js +1 -1
  89. package/dist/sdk/io/index.js +1 -1
  90. package/dist/sdk/io/node-filesystem.js +1 -1
  91. package/dist/sdk/job.js +1 -1
  92. package/dist/sdk/journey.js +1 -1
  93. package/dist/sdk/llm/chat-cache.js +1 -1
  94. package/dist/sdk/llm/index.js +1 -1
  95. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  96. package/dist/sdk/llm/model-aliases.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/segment/child-segment-yaml.js +1 -1
  101. package/dist/sdk/segment/fields-display.js +1 -1
  102. package/dist/sdk/segment/file-discovery.js +1 -1
  103. package/dist/sdk/segment/journey-utils.js +1 -1
  104. package/dist/sdk/segment/journey-yaml.js +1 -1
  105. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  106. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  107. package/dist/sdk/segment/pull-workflow.js +1 -1
  108. package/dist/sdk/segment/push-workflow.js +1 -1
  109. package/dist/sdk/segment/resolution-context.js +1 -1
  110. package/dist/sdk/segment/segment-path-parser.js +1 -1
  111. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  112. package/dist/sdk/segment/target-resolution.js +1 -1
  113. package/dist/sdk/segment/tdx-config.js +1 -1
  114. package/dist/sdk/segment/validate-files.js +1 -1
  115. package/dist/sdk/segment/yaml-validator.js +1 -1
  116. package/dist/sdk/segment.js +1 -1
  117. package/dist/sdk/types/index.js +1 -1
  118. package/dist/sdk/types/progress.js +1 -1
  119. package/dist/sdk/user.js +1 -1
  120. package/dist/sdk/util/format-detector.js +1 -1
  121. package/dist/sdk/util/formatters.js +1 -1
  122. package/dist/sdk/util/index.js +1 -1
  123. package/dist/sdk/util/tree-formatter.js +1 -1
  124. package/dist/sdk/workflow/clone-workflow.js +1 -1
  125. package/dist/sdk/workflow/index.js +1 -1
  126. package/dist/sdk/workflow/pull-workflow.js +1 -1
  127. package/dist/sdk/workflow/push-workflow.js +1 -1
  128. package/dist/sdk/workflow/tdx-config.js +1 -1
  129. package/dist/sdk/workflow/workflow-utils.js +1 -1
  130. package/dist/utils/async.js +1 -1
  131. package/dist/utils/colors.js +1 -1
  132. package/dist/utils/diff.js +1 -1
  133. package/dist/utils/file-permissions.js +1 -1
  134. package/dist/utils/json-loader.js +1 -1
  135. package/dist/utils/option-validation.js +1 -1
  136. package/dist/utils/port.js +1 -1
  137. package/dist/utils/process.js +1 -1
  138. package/dist/utils/prompt.js +1 -1
  139. package/dist/utils/spinner.js +1 -1
  140. package/dist/utils/sse-parser.js +1 -1
  141. package/dist/utils/string-utils.js +1 -1
  142. package/dist/utils/table-ref-parser.js +1 -1
  143. package/dist/utils/tdx-logger.js +1 -1
  144. package/dist/utils/version-check.js +1 -1
  145. package/package.json +1 -1
@@ -1 +1 @@
1
- function a100_0x5482(_0x2b5ddd,_0x2e8470){_0x2b5ddd=_0x2b5ddd-0xd2;const _0x303639=a100_0x3036();let _0x54823e=_0x303639[_0x2b5ddd];return _0x54823e;}const a100_0x525e79=a100_0x5482;(function(_0x16ffb5,_0x599daa){const _0x57d061=a100_0x5482,_0x18fd95=_0x16ffb5();while(!![]){try{const _0x2a2121=parseInt(_0x57d061(0x158))/0x1*(parseInt(_0x57d061(0x111))/0x2)+-parseInt(_0x57d061(0xe7))/0x3*(parseInt(_0x57d061(0x133))/0x4)+parseInt(_0x57d061(0x132))/0x5+-parseInt(_0x57d061(0x173))/0x6+-parseInt(_0x57d061(0x121))/0x7*(parseInt(_0x57d061(0xee))/0x8)+parseInt(_0x57d061(0x194))/0x9*(parseInt(_0x57d061(0xfc))/0xa)+parseInt(_0x57d061(0x191))/0xb*(parseInt(_0x57d061(0x190))/0xc);if(_0x2a2121===_0x599daa)break;else _0x18fd95['push'](_0x18fd95['shift']());}catch(_0xe22a48){_0x18fd95['push'](_0x18fd95['shift']());}}}(a100_0x3036,0xcd4f4));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a100_0x525e79(0x119);export const PENDING_ACTIVATION_PREFIX=a100_0x525e79(0xe5);export function createPendingSegmentId(_0x18d795){return''+PENDING_SEGMENT_PREFIX+_0x18d795+'__';}export function isPendingSegmentId(_0x3d087d){const _0x2f1faa=a100_0x525e79;return _0x3d087d[_0x2f1faa(0x16b)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5483ec){const _0x5c20f5=a100_0x525e79;return _0x5483ec[_0x5c20f5(0x105)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x32f828){return''+PENDING_ACTIVATION_PREFIX+_0x32f828+'__';}export function isPendingActivationId(_0x48fd25){const _0x5dca6a=a100_0x525e79;return _0x48fd25[_0x5dca6a(0x16b)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x522beb){return _0x522beb['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x2a8d2e,_0x119216){const _0x3aa9e2=a100_0x525e79,_0x3e69c8=_0x2a8d2e+'::'+(_0x119216[_0x3aa9e2(0x126)]()||_0x3aa9e2(0x157)),_0x89a486=createHash(_0x3aa9e2(0xde))[_0x3aa9e2(0x168)](_0x3e69c8)[_0x3aa9e2(0x169)]('hex')['slice'](0x0,0xc);return _0x3aa9e2(0xf0)+_0x89a486;}export function ensureJourneyDefaults(_0x2f1642){const _0xa09752=a100_0x525e79;!_0x2f1642[_0xa09752(0x124)]&&(_0x2f1642[_0xa09752(0x124)]=''),!_0x2f1642[_0xa09752(0x128)]&&(_0x2f1642[_0xa09752(0x128)]=_0xa09752(0x184));}export function resolveTDFolderPath(_0x2dff36,_0x3f8d72,_0x5cc9fa){const _0x1cfd7a=a100_0x525e79;if(!_0x3f8d72)return _0x2dff36;if(_0x2dff36===_0x5cc9fa||_0x2dff36[_0x1cfd7a(0x16b)](_0x5cc9fa+'/'))return _0x2dff36;return _0x2dff36?_0x5cc9fa+'/'+_0x2dff36:_0x5cc9fa;}export function addFoldersToCreate(_0x44c058,_0x37e8df,_0x17e130){const _0xcc2941=a100_0x525e79;if(!_0x44c058)return;if(_0x37e8df[_0xcc2941(0x18b)](_0x44c058))return;const _0x32f5f0=_0x44c058['split']('/');let _0x34b49a='';for(const _0x13e957 of _0x32f5f0){_0x34b49a=_0x34b49a?_0x34b49a+'/'+_0x13e957:_0x13e957,!_0x37e8df[_0xcc2941(0x18b)](_0x34b49a)&&_0x17e130[_0xcc2941(0x125)](_0x34b49a);}}import*as a100_0x931458 from'yaml';import{readFileSync}from'fs';import a100_0x2084fa from'path';import{isJourneyDef,parseYamlString as a100_0x327f5d,toYamlString as a100_0x1a6bed,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(_0x28d5b6){const _0x45158d=a100_0x525e79;if(Array[_0x45158d(0xda)](_0x28d5b6))return'['+_0x28d5b6[_0x45158d(0x199)](_0x1aee53=>stableStringify(_0x1aee53))[_0x45158d(0x149)](',')+']';if(_0x28d5b6&&typeof _0x28d5b6===_0x45158d(0x103)){const _0x36c571=_0x28d5b6,_0x4c4d74=Object[_0x45158d(0x12e)](_0x36c571)[_0x45158d(0xe4)](),_0x16d5ea=_0x4c4d74[_0x45158d(0x199)](_0x4139a9=>'\x22'+_0x4139a9+'\x22:'+stableStringify(_0x36c571[_0x4139a9]));return'{'+_0x16d5ea[_0x45158d(0x149)](',')+'}';}const _0x464166=JSON[_0x45158d(0x11e)](_0x28d5b6);return _0x464166===undefined?'null':_0x464166;}function activationSignature(_0x35cc8d){const _0x41d854=a100_0x525e79,_0x2c1fd7={'connection':_0x35cc8d['connection'],..._0x35cc8d['all_columns']!==undefined&&{'all_columns':_0x35cc8d[_0x41d854(0xef)]},..._0x35cc8d[_0x41d854(0x186)]!==undefined&&{'columns':_0x35cc8d['columns']},..._0x35cc8d[_0x41d854(0xec)]!==undefined&&{'behavior':_0x35cc8d['behavior']},..._0x35cc8d[_0x41d854(0x198)]!==undefined&&{'schedule':_0x35cc8d[_0x41d854(0x198)]},..._0x35cc8d[_0x41d854(0x11d)]!==undefined&&{'notification':_0x35cc8d[_0x41d854(0x11d)]},..._0x35cc8d[_0x41d854(0x139)]!==undefined&&{'connector_config':_0x35cc8d['connector_config']},..._0x35cc8d['activation_template_id']!==undefined&&{'activation_template_id':_0x35cc8d[_0x41d854(0x13c)]}};return stableStringify(_0x2c1fd7);}export async function prepareSegmentFiles(_0x5754ec,_0x546c1d,_0x2e171a,_0x944466,_0x3ec9e3){const _0x3a08d6=a100_0x525e79,{activationDefToCreateRequest:_0x42e80a}=await import('./child-segment-yaml.js'),_0x4ad9af=[],_0x2f95b5=new Set();for(const {yamlConfig:_0x1031db,folderPath:_0x2ed790,sourcePath:_0x3b34e9}of _0x5754ec){const _0xe67444=resolveTDFolderPath(_0x2ed790,_0x944466,_0x3ec9e3),_0x35a61a=_0xe67444+':'+_0x1031db[_0x3a08d6(0x16d)],_0x4e4531=_0x546c1d[_0x3a08d6(0x14e)][_0x3a08d6(0x1ae)](_0x35a61a),_0x14f5fb=_0x4e4531?_0x546c1d[_0x3a08d6(0x17f)][_0x3a08d6(0x1ae)](_0x4e4531['id'])||[]:[];addFoldersToCreate(_0xe67444,_0x546c1d[_0x3a08d6(0x175)],_0x2f95b5);const _0x299249=calculateActivationActions(_0x1031db[_0x3a08d6(0x177)]||[],_0x14f5fb,_0x546c1d['idToEmailMap'],_0x546c1d['connectionIdToNameMap']);for(const _0x1e861f of _0x299249){(_0x1e861f[_0x3a08d6(0x183)]===_0x3a08d6(0x17a)||_0x1e861f[_0x3a08d6(0x183)]===_0x3a08d6(0x168))&&_0x1e861f[_0x3a08d6(0x109)]&&(_0x1e861f['validatedRequest']=await _0x42e80a(_0x1e861f[_0x3a08d6(0x109)],_0x2e171a));}const _0x45fa84=calculateSegmentDiff(_0x1031db,_0x4e4531,_0x14f5fb,_0x546c1d[_0x3a08d6(0x112)],_0x546c1d['connectionIdToNameMap']);_0x4ad9af[_0x3a08d6(0xdf)]({'relativePath':_0x1031db['name'],'absolutePath':_0x3b34e9,'yamlConfig':_0x1031db,'folderPath':_0xe67444,'existingSegment':_0x4e4531,'existingActivations':_0x14f5fb,'isNew':_0x45fa84[_0x3a08d6(0x185)],'hasChanges':_0x45fa84[_0x3a08d6(0x15d)],'diff':_0x45fa84[_0x3a08d6(0xfd)],'activationActions':_0x299249});}return{'segmentFiles':_0x4ad9af,'foldersToCreate':_0x2f95b5};}export async function prepareJourneyFiles(_0x128d22,_0x37eaa8,_0x4e9b41,_0x37b092){const _0x3ab91a=a100_0x525e79,_0x593e73=[],_0x1267cb=new Set();for(const {yamlConfig:_0x5409a2,folderPath:_0x10c385,sourcePath:_0x303bb6}of _0x128d22){const _0x16a0b8=resolveTDFolderPath(_0x10c385,_0x4e9b41,_0x37b092),_0x1fb673=_0x16a0b8+':'+_0x5409a2[_0x3ab91a(0x16d)],_0x411147=_0x37eaa8['journeyBundlesByFolderAndName'][_0x3ab91a(0x1ae)](_0x1fb673);let _0x7994b4,_0x2aac0c;if(_0x411147&&_0x411147[_0x3ab91a(0x104)]>0x0){const _0x4b258b=buildLocalExpandedRuleMappings(_0x5409a2),{createYamlContext:_0x10cc0,prefetchJourneySegments:_0x39fa8b}=createPushYamlContextForBundle(_0x37eaa8[_0x3ab91a(0x156)],_0x37eaa8['parentId'],_0x37eaa8[_0x3ab91a(0x1a8)],_0x4b258b,_0x37eaa8[_0x3ab91a(0x112)],_0x37eaa8[_0x3ab91a(0x166)],_0x37eaa8[_0x3ab91a(0x1a4)],_0x37eaa8[_0x3ab91a(0xe3)]);await _0x39fa8b(_0x411147['map'](_0x44a59b=>_0x44a59b['id']));const _0x1eee00=hasMultipleVersions(_0x5409a2),_0x266d35=async _0x3bbef3=>{const _0x3a1bc7=_0x3ab91a,_0x4dd789=_0x37eaa8[_0x3a1bc7(0xe3)]?.[_0x3a1bc7(0x1ae)](_0x3bbef3);if(_0x4dd789)return _0x4dd789;return _0x37eaa8[_0x3a1bc7(0x13b)]({'journeyId':_0x3bbef3,'journeyName':_0x5409a2[_0x3a1bc7(0x16d)],'isMultiVersion':_0x411147[_0x3a1bc7(0x104)]>0x1});};if(_0x1eee00&&_0x411147[_0x3ab91a(0x104)]>0x1){const _0x2e2375=[];for(const _0xe33e81 of _0x411147){const _0x3b0bc1=_0xe33e81[_0x3ab91a(0x182)]||0x1;_0x37eaa8['progress']?.[_0x3ab91a(0x168)](_0x3ab91a(0x10a)+_0x5409a2[_0x3ab91a(0x16d)]+'\x20v'+_0x3b0bc1);const _0x23d069=await _0x266d35(_0xe33e81['id']),_0x46d73a=_0x10cc0(_0xe33e81['id']),_0x203955=await journeyResponseToDef(_0x23d069,_0x46d73a);_0x2e2375[_0x3ab91a(0xdf)]({'item':_0xe33e81,'yaml':_0x203955});}const _0x145c16=buildLocalRuleToNameMappingFromJourney(_0x5409a2);_0x2aac0c=buildMergedJourneyDef(_0x2e2375,_0x145c16);const _0x549b48=Math[_0x3ab91a(0x159)](..._0x2e2375['map'](_0x1e6021=>_0x1e6021[_0x3ab91a(0x12f)][_0x3ab91a(0x182)]||0x0)),_0x30fc21=_0x411147[_0x3ab91a(0x14d)](_0x16ed85=>(_0x16ed85[_0x3ab91a(0x182)]||0x0)===_0x549b48);_0x30fc21&&(_0x37eaa8['progress']?.[_0x3ab91a(0x168)](_0x3ab91a(0x10a)+_0x5409a2[_0x3ab91a(0x16d)]+'\x20v'+_0x549b48),_0x7994b4=await _0x266d35(_0x30fc21['id']));}else{const _0x206ad8=_0x411147[_0x411147[_0x3ab91a(0x104)]-0x1];_0x37eaa8[_0x3ab91a(0xd8)]?.[_0x3ab91a(0x168)](_0x3ab91a(0x10a)+_0x5409a2['name']),_0x7994b4=await _0x266d35(_0x206ad8['id']);const _0x46cca5=_0x10cc0(_0x206ad8['id']),_0x1cad5d=await journeyResponseToDef(_0x7994b4,_0x46cca5),_0x5ed5e7=buildLocalRuleToNameMappingFromJourney(_0x5409a2);_0x2aac0c=buildMergedJourneyDef([{'item':_0x206ad8,'yaml':_0x1cad5d}],_0x5ed5e7);}}addFoldersToCreate(_0x16a0b8,_0x37eaa8[_0x3ab91a(0x175)],_0x1267cb);const _0x5d6cca=calculateJourneyDiff(_0x5409a2,_0x2aac0c);_0x593e73[_0x3ab91a(0xdf)]({'relativePath':_0x5409a2[_0x3ab91a(0x16d)],'absolutePath':_0x303bb6,'yamlConfig':_0x5409a2,'folderPath':_0x16a0b8,'existingJourney':_0x7994b4,'isNew':_0x5d6cca[_0x3ab91a(0x185)],'hasChanges':_0x5d6cca[_0x3ab91a(0x15d)],'diff':_0x5d6cca[_0x3ab91a(0xfd)]});}return{'journeyFiles':_0x593e73,'foldersToCreate':_0x1267cb};}export function calculateActivationActions(_0x5d8861,_0x503c43,_0x23117b,_0x41c063){const _0x437156=a100_0x525e79,_0x5915d9=[],_0x4838a9=new Map();for(const _0x34ed37 of _0x503c43){_0x4838a9[_0x437156(0x189)](_0x34ed37[_0x437156(0x16d)],_0x34ed37);}const _0x4fc992=new Map();for(const _0xb8d755 of _0x5d8861){_0x4fc992[_0x437156(0x189)](_0xb8d755[_0x437156(0x16d)],_0xb8d755);}for(const _0x5cced1 of _0x5d8861){const _0x17cffd=_0x4838a9[_0x437156(0x1ae)](_0x5cced1['name']);if(!_0x17cffd)_0x5915d9[_0x437156(0xdf)]({'type':'create','name':_0x5cced1[_0x437156(0x16d)],'yamlActivation':_0x5cced1});else{const _0x4c2ba0=activationResponseToDef(_0x17cffd,_0x23117b,_0x41c063),_0x56d836=a100_0x931458[_0x437156(0x11e)](_0x4c2ba0),_0x5f476c=a100_0x931458['stringify'](_0x5cced1);_0x56d836!==_0x5f476c&&_0x5915d9[_0x437156(0xdf)]({'type':_0x437156(0x168),'name':_0x5cced1[_0x437156(0x16d)],'yamlActivation':_0x5cced1,'existingActivation':_0x17cffd});}}for(const _0x4284bd of _0x503c43){!_0x4fc992['has'](_0x4284bd[_0x437156(0x16d)])&&_0x5915d9['push']({'type':_0x437156(0x19b),'name':_0x4284bd[_0x437156(0x16d)],'existingActivation':_0x4284bd});}return _0x5915d9;}export function calculateSegmentDiff(_0x1c08e2,_0x4bd2e0,_0x360760,_0xaf1777,_0x1df965){const _0x4f85b8=segmentToYamlString(_0x1c08e2);if(_0x4bd2e0){const _0x1507d2=segmentWithActivationsToYaml(_0x4bd2e0,_0x360760,undefined,_0xaf1777,_0x1df965),_0x532bcb=segmentToYamlString(_0x1507d2),_0x542b78=generateDiff(_0x532bcb,_0x4f85b8),_0x4f3c6c=hasChanges(_0x542b78);return{'isNew':![],'hasChanges':_0x4f3c6c,'diff':_0x4f3c6c?formatDiffWithColors(_0x542b78):undefined};}const _0x5cc04f=generateDiff('',_0x4f85b8);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5cc04f)};}export function calculateJourneyDiff(_0x1a3b41,_0x4e6dd6){const _0x11cd57=normalizeJourneyDef(_0x1a3b41,_0x1a3b41),_0x2dbd26=a100_0x1a6bed(_0x11cd57);if(_0x4e6dd6){const _0x261b26=normalizeJourneyDef(_0x4e6dd6,_0x1a3b41),_0xdb2e9d=a100_0x1a6bed(_0x261b26),_0xed77c7=generateDiff(_0xdb2e9d,_0x2dbd26),_0x4bdd52=hasChanges(_0xed77c7);return{'isNew':![],'hasChanges':_0x4bdd52,'diff':_0x4bdd52?formatDiffWithColors(_0xed77c7):undefined};}const _0x1903b4=generateDiff('',_0x2dbd26);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1903b4)};}export function findSegmentsToDelete(_0x4b4bd5,_0x274d4f,_0x558c6e,_0xcdbf8e,_0x3f10e4){const _0x183c2b=a100_0x525e79,_0x95dfc5=new Set();for(const {yamlConfig:_0x494b4e,folderPath:_0x3846c5}of _0x274d4f){_0x95dfc5[_0x183c2b(0x125)](_0x3846c5+':'+_0x494b4e[_0x183c2b(0x16d)]);}return _0x4b4bd5[_0x183c2b(0x1a0)](_0x402c17=>{const _0x5dc0e0=_0x183c2b,_0x1d6c77=_0x402c17[_0x5dc0e0(0xd2)]?_0x558c6e['get'](_0x402c17[_0x5dc0e0(0xd2)]['toString']())||'':'',_0xa15a8c=_0x1d6c77+':'+_0x402c17[_0x5dc0e0(0x16d)];if(_0x95dfc5['has'](_0xa15a8c))return![];if(_0x3f10e4)return _0x1d6c77===_0xcdbf8e||_0x1d6c77[_0x5dc0e0(0x16b)](_0xcdbf8e+'/');return!![];});}export function findJourneysToDelete(_0x4c2fb4,_0x21a99e,_0x29a3d9,_0x5da7c6,_0x171fc9){const _0x5d139d=a100_0x525e79,_0x11aa89=new Set();for(const {yamlConfig:_0x25f686,folderPath:_0x14fa38}of _0x21a99e){_0x11aa89[_0x5d139d(0x125)](_0x14fa38+':'+_0x25f686[_0x5d139d(0x16d)]);}return _0x4c2fb4[_0x5d139d(0x1a0)](_0x2109e8=>{const _0x3d4207=_0x5d139d,_0xae1dfd=_0x2109e8[_0x3d4207(0x12d)]?_0x29a3d9[_0x3d4207(0x1ae)](_0x2109e8[_0x3d4207(0x12d)])||'':'',_0x517dc6=_0xae1dfd+':'+_0x2109e8[_0x3d4207(0x1a7)];if(_0x11aa89['has'](_0x517dc6))return![];if(_0x171fc9)return _0xae1dfd===_0x5da7c6||_0xae1dfd[_0x3d4207(0x16b)](_0x5da7c6+'/');return!![];});}export function buildSegmentLookupMap(_0xa4a6fc,_0x18b863){const _0xcdbfe9=a100_0x525e79,_0x54d575=new Map();for(const _0x21645b of _0xa4a6fc){const _0x247821=_0x21645b[_0xcdbfe9(0xd2)]?_0x18b863[_0xcdbfe9(0x1ae)](_0x21645b[_0xcdbfe9(0xd2)][_0xcdbfe9(0x138)]())||'':'',_0x53e8de=_0x247821+':'+_0x21645b[_0xcdbfe9(0x16d)];_0x54d575[_0xcdbfe9(0x189)](_0x53e8de,_0x21645b);}return _0x54d575;}export function buildSegmentNameToIdMap(_0x1e88d3){const _0x384a20=a100_0x525e79,_0x2a2388=new Map();for(const _0x195a76 of _0x1e88d3){_0x2a2388['set'](_0x195a76[_0x384a20(0x16d)],_0x195a76['id']);}return _0x2a2388;}export function buildJourneyBundleLookupMap(_0x36a567,_0x10e86a){const _0x4036c7=a100_0x525e79,_0x29ecb8=new Map();for(const _0x3652a8 of _0x36a567){const _0x310fe3=_0x3652a8['folderId']?_0x10e86a[_0x4036c7(0x1ae)](_0x3652a8['folderId'])||'':'',_0x41f32e=_0x310fe3+':'+_0x3652a8[_0x4036c7(0x1a7)];!_0x29ecb8['has'](_0x41f32e)&&_0x29ecb8[_0x4036c7(0x189)](_0x41f32e,[]),_0x29ecb8[_0x4036c7(0x1ae)](_0x41f32e)[_0x4036c7(0xdf)](_0x3652a8);}for(const _0x4b2df3 of _0x29ecb8['values']()){_0x4b2df3['sort']((_0x1ff893,_0x3d161c)=>(_0x1ff893[_0x4036c7(0x182)]||0x0)-(_0x3d161c[_0x4036c7(0x182)]||0x0));}return _0x29ecb8;}export function collectFoldersToCreate(_0x18a59b,_0x30c2be){const _0x1a2cf2=a100_0x525e79,_0x56c818=new Set();for(const _0x1275c3 of _0x18a59b){if(!_0x1275c3)continue;if(_0x30c2be[_0x1a2cf2(0x18b)](_0x1275c3))continue;const _0x100560=_0x1275c3[_0x1a2cf2(0x1a9)]('/');let _0xaaa542='';for(const _0x7552ec of _0x100560){_0xaaa542=_0xaaa542?_0xaaa542+'/'+_0x7552ec:_0x7552ec,!_0x30c2be[_0x1a2cf2(0x18b)](_0xaaa542)&&_0x56c818['add'](_0xaaa542);}}return _0x56c818;}export function parseAndClassifyYamlFiles(_0x1c048e,_0x13b4dc,_0x382e42){const _0x2a93f8=a100_0x525e79,_0x5ada6a=[],_0x1e035d=[];for(const _0x1cfdb3 of _0x1c048e){const _0xdad03c=a100_0x2084fa[_0x2a93f8(0x14f)](_0x13b4dc,a100_0x2084fa[_0x2a93f8(0x16f)](_0x1cfdb3)),_0x14d5a8=_0xdad03c==='.'?'':_0xdad03c,_0xc545ac=readFileSync(_0x1cfdb3,'utf-8'),_0x352fbd=a100_0x931458[_0x2a93f8(0xed)](_0xc545ac);if(isJourneyDef(_0x352fbd)){const _0x1f1745=a100_0x327f5d(_0xc545ac);_0x1e035d[_0x2a93f8(0xdf)]({'yamlConfig':_0x1f1745,'folderPath':_0x14d5a8,'sourcePath':_0x1cfdb3});}else{if(!_0x382e42?.[_0x2a93f8(0xf6)]){const _0x2835f4=parseSegmentYamlFile(_0xc545ac),_0x3cdee3=normalizeChildSegmentYaml(_0x2835f4);_0x5ada6a[_0x2a93f8(0xdf)]({'yamlConfig':_0x3cdee3,'folderPath':_0x14d5a8,'sourcePath':_0x1cfdb3});}}}return{'segments':_0x5ada6a,'journeys':_0x1e035d};}function a100_0x3036(){const _0x35373b=['Updated\x20journey\x20\x27','create','\x27\x20exit\x20criteria','yamlConfig','JOURNEY_SYNTAX_ERROR','Updated\x20activation\x20\x27','activationsBySegmentId','existingActivation','JOURNEY_UPDATE_ERROR','versionNumber','type','draft','isNew','columns','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','attributes','set','embeddedSegmentNameToId','has','milestone','updated','createdSegmentId','valid','9536856TuGRiG','22chfOek','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','createSegment','198zReAln','segment_updated','activation_updated','localSegmentRules','schedule','map','onProgress','delete','Activation\x20not\x20found:\x20','logInfo','\x27\x20from\x20file:\x20','journeyActivationStepId','filter','activation_deleting','Entry\x20criteria:\x20','activation_created','activationStepsById','activationContext','rule','journeyBundleName','existingSegments','split','existingJourney','Created\x20folder\x20\x27','Activation','NOT_FOUND','get','segmentFolderId','journey_created','with','activation_deleted','\x27...','withProgress','progress','stage\x20\x27','isArray','idToName','./child-segment-yaml.js','slice','sha1','push','unchanged','journeyId','createJourneySegment','journeyById','sort','__pending_act_','listActivations','9RFUSOY','\x20error(s)','reduce','Name\x20has\x20already\x20been\x20taken','ACTIVATION_UPDATE_ERROR','behavior','parse','48VtGsFg','all_columns','journey_entry_criteria_','\x0a\x20\x20','folder_created','absolutePath','parseDocument','deleteSegment','skipSegments','updateSegmentById','SEGMENT_SYNTAX_ERROR','segment_created','entryCriteria','action','625460UchlrO','diff','resolveSegment','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','created','flatMap','../../utils/async.js','object','length','replace','Deleting\x20activation\x20\x27','entry_criteria','stages','yamlActivation','Fetching\x20','Stage\x20\x27','all','listSegments','journeys','journey_creating','createActivation','387062idDULY','idToEmailMap','./journey-yaml.js','activationParams','segments','segment_deleted','\x27\x20decision\x20point\x20branch\x20\x27','verbose','__pending_','SEGMENT_NOT_FOUND','activation_','activation_updating','notification','stringify','logSuccess','parentId','1692131lOcMfo','validatedRequest','journeyStages','description','add','trim','toLowerCase','state','segmentId','index','segment_updating','relationships','folderId','keys','item','from','createdSegmentIds','5580320OzljGY','1789884diIJQx','utf-8','getJourney','createFolder','goal','toString','connector_config','journey','fetchJourney','activation_template_id','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','kind','\x27\x20wait\x20condition','user','Creating\x20activation\x20\x27','Failed\x20to\x20','Deleted\x20activation\x20\x27','\x20activation\x20\x27','steps','folderPath','WaitStep','DecisionPoint','join','\x20(referenced\x20in\x20journey\x20','Updated\x20segment\x20\x27','errors','find','segmentByFolderAndName','relative','segmentNameToId','deleted','folder_creating','Created\x20segment\x20\x27','existingSegment','ACTIVATION_SYNTAX_ERROR','deps','segment','5MPjMHd','max','activationActions','size','goal\x20criteria','hasChanges','decision_point','segment_deleting','includes','embedded_activation_creating','rootFolderId','SEGMENT_UPDATE_ERROR','getSegment','\x27\x20not\x20found\x20in\x20journey\x20\x27','connectionIdToNameMap','waitCondition','update','digest','Created\x20activation\x20\x27','startsWith','exitCriterias','name','branches','dirname','Segment\x20not\x20found:\x20','data','embedded_segment_created','8492688CPGinD','embedded_segment_creating','folderPathToId','folder','activations','embedded_activation_created'];a100_0x3036=function(){return _0x35373b;};return a100_0x3036();}export function validateParsedFiles(_0x34859a,_0x4eed29){const _0x5c15e1=a100_0x525e79,_0x326c49=[];for(const {yamlConfig:_0x2c6600,sourcePath:_0x3b7cae}of _0x34859a[_0x5c15e1(0x115)]){const _0x43dd52=readFileSync(_0x3b7cae,_0x5c15e1(0x134)),_0x2934b3=a100_0x931458[_0x5c15e1(0xf4)](_0x43dd52),_0x4d269c=validateSegmentDef(_0x2c6600,{'source':_0x43dd52,'document':_0x2934b3});if(!_0x4d269c['valid']){const _0x234267=a100_0x2084fa[_0x5c15e1(0x14f)](_0x4eed29,_0x3b7cae);_0x326c49[_0x5c15e1(0xdf)]({'filePath':_0x234267,'source':_0x43dd52,'result':_0x4d269c,'isJourney':![]});}}for(const {yamlConfig:_0x577c84,sourcePath:_0x252ade}of _0x34859a[_0x5c15e1(0x10e)]){const _0x1e3cc8=readFileSync(_0x252ade,_0x5c15e1(0x134)),_0x3d56d0=a100_0x931458[_0x5c15e1(0xf4)](_0x1e3cc8),_0x472909=validateJourneyDef(_0x577c84,{'source':_0x1e3cc8,'document':_0x3d56d0});if(!_0x472909[_0x5c15e1(0x18f)]){const _0x2b83fa=a100_0x2084fa[_0x5c15e1(0x14f)](_0x4eed29,_0x252ade);_0x326c49[_0x5c15e1(0xdf)]({'filePath':_0x2b83fa,'source':_0x1e3cc8,'result':_0x472909,'isJourney':!![]});}}return _0x326c49;}export function formatValidationErrors(_0x20d56e){const _0x1b660e=a100_0x525e79,_0x44cb10=[];for(const {filePath:_0x2244e0,source:_0x5a82d3,result:_0x5bc00f,isJourney:_0x4bde6e}of _0x20d56e){const _0x5cbea6=_0x4bde6e?_0x1b660e(0x13a):_0x1b660e(0x157);_0x44cb10[_0x1b660e(0xdf)]('\x0a'+_0x2244e0+'\x20('+_0x5cbea6+'):\x20'+_0x5bc00f[_0x1b660e(0x14c)]['length']+_0x1b660e(0xe8)),_0x44cb10[_0x1b660e(0xdf)](formatValidationResult(_0x5bc00f,_0x5a82d3,_0x2244e0));}return _0x44cb10[_0x1b660e(0x149)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x896a93){const _0x261736=a100_0x525e79,_0x2ee704=new Set(),_0x4b140b=new Map(),_0x4552f1=collectSegmentUsageCounts(_0x896a93);if(_0x896a93['segments'])for(const [_0x453843,_0x3e4f41]of Object['entries'](_0x896a93[_0x261736(0x115)])){_0x2ee704[_0x261736(0x125)](_0x453843);if(_0x3e4f41[_0x261736(0x1a6)]){const _0x274596=yamlRuleToApi(_0x3e4f41[_0x261736(0x1a6)]),_0xf672f6=apiRuleToYaml(_0x274596);_0x4b140b['set'](_0x453843,_0xf672f6);}}const _0xa320a5=new Map();let _0x5ae64a=0x0;for(const [_0x1405e0,_0x2e74d7]of _0x4b140b){const _0x29e473=serializeExpandedRule(_0x2e74d7,_0x4b140b),_0x513775=_0xa320a5[_0x261736(0x1ae)](_0x29e473)||[];_0x513775[_0x261736(0xdf)]({'name':_0x1405e0,'index':_0x5ae64a}),_0xa320a5[_0x261736(0x189)](_0x29e473,_0x513775),_0x5ae64a++;}const _0x475378=new Map();for(const [_0x2bd85b,_0x470eab]of _0xa320a5){const _0x3dc562=_0x470eab[_0x261736(0xdd)]()[_0x261736(0xe4)]((_0x225ba9,_0x2b22a1)=>{const _0x49915a=_0x261736,_0x29bf57=_0x4552f1[_0x49915a(0x1ae)](_0x225ba9[_0x49915a(0x16d)])||0x0,_0x450793=_0x4552f1['get'](_0x2b22a1[_0x49915a(0x16d)])||0x0;if(_0x29bf57!==_0x450793)return _0x450793-_0x29bf57;return _0x225ba9[_0x49915a(0x12a)]-_0x2b22a1[_0x49915a(0x12a)];})[_0x261736(0x199)](_0x28e9fa=>_0x28e9fa['name']),_0x325124=[];for(const _0x3c75cd of _0x3dc562){const _0x3d191e=_0x4552f1['get'](_0x3c75cd)||0x0,_0x2221b4=Math[_0x261736(0x159)](_0x3d191e,0x1);for(let _0x14f857=0x0;_0x14f857<_0x2221b4;_0x14f857++){_0x325124[_0x261736(0xdf)](_0x3c75cd);}}_0x475378[_0x261736(0x189)](_0x2bd85b,_0x325124);}return{'existingLocalSegmentNames':_0x2ee704,'localSegmentRules':_0x4b140b,'localExpandedRuleToNames':_0x475378};}async function buildServerSegmentRuleMap(_0x444b34,_0x226033,_0x83d741,_0x3a333e){const _0x547284=new Map(),_0x282dd1=new Set(),_0x380802=async _0x53ebba=>{const _0x571640=a100_0x5482;if(_0x282dd1[_0x571640(0x18b)](_0x53ebba))return;_0x282dd1[_0x571640(0x125)](_0x53ebba);let _0x30d03d=_0x83d741[_0x571640(0x14d)](_0x527f14=>_0x527f14['id']===_0x53ebba);if(!_0x30d03d)try{_0x30d03d=await _0x444b34[_0x571640(0x157)][_0x571640(0x164)](_0x226033,_0x53ebba);}catch{return;}if(!_0x30d03d?.[_0x571640(0x1a6)])return;const _0x1b39fa=apiRuleToYaml(_0x30d03d['rule']);_0x547284[_0x571640(0x189)](_0x53ebba,_0x1b39fa);const _0x16d739=collectSegmentRefsFromRule(_0x1b39fa);for(const _0x5c8f34 of _0x16d739){await _0x380802(_0x5c8f34);}};for(const _0x57bda8 of _0x3a333e){await _0x380802(_0x57bda8);}return _0x547284;}export function createSegmentIdResolver(_0x55447b,_0x16b080){return async _0x507166=>{const _0x4aec09=a100_0x5482,_0x42e78f=_0x55447b[_0x4aec09(0x1ae)](_0x507166);if(!_0x42e78f)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4aec09(0x170)+_0x507166+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x16b080+'\x27)');return _0x42e78f;};}export function extractRootFolderId(_0x33758b){const _0x549b88=a100_0x525e79;return _0x33758b[_0x549b88(0x12c)]?.['parentSegmentFolder']?.[_0x549b88(0x171)]?.['id']||_0x33758b[_0x549b88(0x12c)]?.['parentFolder']?.[_0x549b88(0x171)]?.['id'];}export function buildConnectionMaps(_0x540ed1){const _0x21d67d=a100_0x525e79,_0x2b1dc2=new Map(),_0x232c6b=new Map(),_0x6e6906=new Map();for(const _0x5bfcb6 of _0x540ed1){_0x2b1dc2[_0x21d67d(0x189)](_0x5bfcb6[_0x21d67d(0x16d)],parseInt(_0x5bfcb6['id'],0xa)),_0x232c6b[_0x21d67d(0x189)](_0x5bfcb6['id'],_0x5bfcb6[_0x21d67d(0x16d)]),_0x6e6906['set'](_0x5bfcb6['name'],_0x5bfcb6['type']);}return{'nameToId':_0x2b1dc2,'idToName':_0x232c6b,'nameToType':_0x6e6906};}export function calculatePushStats(_0x5e1278,_0x69da60,_0x3aad73,_0x4f5ca4,_0x455bc5,_0x2e122b,_0x56a64e){const _0x62a650=a100_0x525e79,_0x50ba74=_0x5e1278[_0x62a650(0x1a0)](_0x2f72f7=>_0x2f72f7[_0x62a650(0x185)]),_0x54a8e6=_0x5e1278[_0x62a650(0x1a0)](_0x513b74=>!_0x513b74[_0x62a650(0x185)]&&_0x513b74[_0x62a650(0x15d)]),_0x4044fa=_0x5e1278[_0x62a650(0x1a0)](_0x492bda=>!_0x492bda['isNew']&&!_0x492bda[_0x62a650(0x15d)]),_0x56cff1=_0x2e122b?_0x4f5ca4:[],_0x360727=_0x69da60['filter'](_0x4bf905=>_0x4bf905['isNew']),_0x464992=_0x69da60[_0x62a650(0x1a0)](_0x5cfb1e=>!_0x5cfb1e[_0x62a650(0x185)]&&_0x5cfb1e[_0x62a650(0x15d)]),_0x127b9f=_0x69da60[_0x62a650(0x1a0)](_0xd19c70=>!_0xd19c70[_0x62a650(0x185)]&&!_0xd19c70['hasChanges']),_0x17b469=_0x2e122b?_0x455bc5:[],_0xdbcaf5=_0x5e1278[_0x62a650(0x101)](_0x19262d=>_0x19262d[_0x62a650(0x15a)]),_0x2947ef=_0xdbcaf5[_0x62a650(0x1a0)](_0x1a1e25=>_0x1a1e25[_0x62a650(0x183)]===_0x62a650(0x17a)),_0x4a324e=_0xdbcaf5['filter'](_0x3e0c0b=>_0x3e0c0b[_0x62a650(0x183)]===_0x62a650(0x168)),_0x1094d9=_0xdbcaf5[_0x62a650(0x1a0)](_0x17976a=>_0x17976a[_0x62a650(0x183)]===_0x62a650(0x19b)),_0x329f4f=Array[_0x62a650(0x130)](_0x3aad73)[_0x62a650(0xe4)](),_0x5055c9=_0x56a64e?![]:_0x50ba74[_0x62a650(0x104)]>0x0||_0x54a8e6[_0x62a650(0x104)]>0x0||_0x56cff1['length']>0x0,_0x4c8093=_0x360727[_0x62a650(0x104)]>0x0||_0x464992[_0x62a650(0x104)]>0x0||_0x17b469[_0x62a650(0x104)]>0x0,_0x3df273=_0x56a64e?![]:_0xdbcaf5[_0x62a650(0x104)]>0x0,_0x20a4f6=_0x329f4f[_0x62a650(0x104)]>0x0;return{'segments':{'new':_0x50ba74,'changed':_0x54a8e6,'unchanged':_0x4044fa,'toDelete':_0x56cff1},'journeys':{'new':_0x360727,'changed':_0x464992,'unchanged':_0x127b9f,'toDelete':_0x17b469},'activations':{'all':_0xdbcaf5,'toCreate':_0x2947ef,'toUpdate':_0x4a324e,'toDelete':_0x1094d9},'folders':{'toCreate':_0x329f4f},'counts':{'segments':{'new':_0x50ba74[_0x62a650(0x104)],'changed':_0x54a8e6[_0x62a650(0x104)],'unchanged':_0x4044fa['length'],'toDelete':_0x56cff1['length']},'journeys':{'new':_0x360727[_0x62a650(0x104)],'changed':_0x464992[_0x62a650(0x104)],'unchanged':_0x127b9f[_0x62a650(0x104)],'toDelete':_0x17b469[_0x62a650(0x104)]},'activations':{'create':_0x2947ef['length'],'update':_0x4a324e[_0x62a650(0x104)],'delete':_0x1094d9[_0x62a650(0x104)]},'folders':_0x329f4f[_0x62a650(0x104)]},'hasChanges':_0x5055c9||_0x4c8093||_0x3df273||_0x20a4f6};}export async function buildPushExecutionContext(_0x2785d9,_0x456852,_0x5cc423,_0x17352b,_0x383f0f,_0x2938f1){const _0x5b5eb8=a100_0x525e79,_0x39c77a=extractRootFolderId(_0x5cc423),{pathToId:_0x11c7dd,idToPath:_0x3fa7bc}=buildFolderMaps(_0x383f0f),_0x102357=buildSegmentNameToIdMap(_0x17352b),_0x35a61d=new Map(),{batchAsync:_0x4a31a7}=await import(_0x5b5eb8(0x102)),[_0x9d51e7,_0x4e0983]=await Promise['all']([_0x2785d9[_0x5b5eb8(0x140)]['buildUserMaps'](),_0x2785d9['connection']['list'](),((async()=>{const _0x579d4e=_0x5b5eb8;!_0x2938f1&&_0x17352b[_0x579d4e(0x104)]>0x0&&await _0x4a31a7(_0x17352b,async _0x18f59a=>{const _0x148d07=_0x579d4e,_0x9b28aa=await _0x2785d9['segment'][_0x148d07(0xe6)](_0x456852,_0x18f59a['id']);_0x35a61d[_0x148d07(0x189)](_0x18f59a['id'],_0x9b28aa);});})())]),{emailToId:_0xc8d2c9,idToEmail:_0x585bb7}=_0x9d51e7,_0x48dd6d=buildConnectionMaps(_0x4e0983);return{'rootFolderId':_0x39c77a,'folderPathToId':_0x11c7dd,'folderIdToPath':_0x3fa7bc,'segmentNameToId':_0x102357,'activationsBySegmentId':_0x35a61d,'emailToIdMap':_0xc8d2c9,'idToEmailMap':_0x585bb7,'connectionNameToIdMap':_0x48dd6d['nameToId'],'connectionIdToNameMap':_0x48dd6d[_0x5b5eb8(0xdb)],'connectionNameToTypeMap':_0x48dd6d['nameToType']};}export function createPushYamlContextForBundle(_0xf9d3c1,_0x53503b,_0x219d99,_0xf64c5a,_0x5e80f8,_0x24bf33,_0xc02559,_0x30892c){const {existingLocalSegmentNames:_0xab8ea2,localExpandedRuleToNames:_0x460b6f}=_0xf64c5a,_0x3fcc29=new Set(),_0x1912df=new Map(),_0x3d9fa1=new Map(),_0x5506ac=new Map(),_0x5f339d=createJumpTargetCache(),_0x5ce158=new Map(),_0x4c962a=new Map(),_0x20285c=new Set();let _0x253a32;const _0xf38a44=_0x146b22=>{const _0x466c72={'resolveSegment':async _0x4c7abe=>{const _0x246f53=a100_0x5482,_0x1cebbb=_0x5506ac[_0x246f53(0x1ae)](_0x4c7abe);if(_0x1cebbb!==undefined)return{'name':_0x1cebbb,'isJourneyLocal':!![]};try{let _0x385133=_0x219d99[_0x246f53(0x14d)](_0x58917b=>_0x58917b['id']===_0x4c7abe);!_0x385133&&(_0x385133=await _0xf9d3c1[_0x246f53(0x157)][_0x246f53(0x164)](_0x53503b,_0x4c7abe));const _0x42f5ae=generateJourneyLocalName(_0x385133[_0x246f53(0x16d)]),_0x472802=_0x385133[_0x246f53(0x13e)]===SEGMENT_KIND_JOURNEY&&_0x42f5ae!==undefined;let _0x4972bb=_0x385133[_0x246f53(0x16d)],_0x3ec765;if(_0x472802&&_0x385133['rule']){const _0x1a924e=apiRuleToYaml(_0x385133[_0x246f53(0x1a6)]);_0x4c962a[_0x246f53(0x189)](_0x4c7abe,_0x1a924e);const _0x10c194=async _0x1b327c=>{const _0x492017=_0x246f53,_0x57747c=collectSegmentRefsFromRule(_0x1b327c);for(const _0x12e8ca of _0x57747c){if(!_0x4c962a[_0x492017(0x18b)](_0x12e8ca))try{const _0x11a3c9=await _0xf9d3c1[_0x492017(0x157)][_0x492017(0x164)](_0x53503b,_0x12e8ca);if(_0x11a3c9?.[_0x492017(0x1a6)]){const _0x184aaa=apiRuleToYaml(_0x11a3c9[_0x492017(0x1a6)]);_0x4c962a[_0x492017(0x189)](_0x12e8ca,_0x184aaa),await _0x10c194(_0x184aaa);}}catch{}}};await _0x10c194(_0x1a924e);const _0x228fb4=serializeExpandedRule(_0x1a924e,_0x4c962a),_0x259378=_0x460b6f[_0x246f53(0x1ae)](_0x228fb4);if(_0x259378&&_0x259378['length']>0x0){const _0x4f4a93=_0x1912df[_0x246f53(0x1ae)](_0x228fb4)||0x0,_0x277bbd=_0x259378[_0x4f4a93]||_0x259378[_0x259378[_0x246f53(0x104)]-0x1];_0x1912df['set'](_0x228fb4,_0x4f4a93+0x1),_0x4972bb=_0x277bbd,_0x3fcc29[_0x246f53(0x125)](_0x4972bb),_0x5506ac['set'](_0x4c7abe,_0x4972bb);const _0x115fa6=await resolveRuleSegmentRefs(_0x1a924e,async _0x506c5e=>{const _0x3ca9d5=_0x246f53,_0x523139=_0x5506ac[_0x3ca9d5(0x1ae)](_0x506c5e);if(_0x523139)return _0x523139;const _0x324081=await _0x253a32[_0x3ca9d5(0xfe)](_0x506c5e);return _0x324081['name'];});_0x3ec765={'description':_0x385133['description'],'rule':_0x115fa6};}else{const _0xd23d96=_0x5ce158[_0x246f53(0x1ae)](_0x228fb4);if(_0xd23d96)_0x4972bb=_0xd23d96,_0x5506ac[_0x246f53(0x189)](_0x4c7abe,_0x4972bb);else{if(_0x42f5ae){let _0x3ad1ea=_0x42f5ae,_0x26908a=0x2;while(_0x3fcc29[_0x246f53(0x18b)](_0x3ad1ea)||_0xab8ea2[_0x246f53(0x18b)](_0x3ad1ea)){_0x3ad1ea=_0x42f5ae+'_'+_0x26908a,_0x26908a++;}_0x3fcc29[_0x246f53(0x125)](_0x3ad1ea),_0x4972bb=_0x3ad1ea;}_0x5506ac[_0x246f53(0x189)](_0x4c7abe,_0x4972bb),_0x5ce158['set'](_0x228fb4,_0x4972bb);const _0x2e38d=await resolveRuleSegmentRefs(_0x1a924e,async _0x321f94=>{const _0xd34ef7=_0x246f53,_0x43bf7e=_0x5506ac[_0xd34ef7(0x1ae)](_0x321f94);if(_0x43bf7e)return _0x43bf7e;const _0x89e588=await _0x253a32[_0xd34ef7(0xfe)](_0x321f94);return _0x89e588[_0xd34ef7(0x16d)];});_0x3ec765={'description':_0x385133['description'],'rule':_0x2e38d};}}}return{'name':_0x4972bb,'isJourneyLocal':_0x472802,'definition':_0x3ec765};}catch{return{'name':_0x4c7abe,'isJourneyLocal':![]};}},'resolveActivation':async _0xa3390c=>{const _0x3d4a19=a100_0x5482,_0x5d62f7=_0x3d9fa1[_0x3d4a19(0x1ae)](_0xa3390c);if(_0x5d62f7!==undefined)return{'name':_0x5d62f7,'isJourneyLocal':!![]};try{let _0x5e860b=_0xc02559?.[_0x3d4a19(0x1ae)](_0xa3390c);!_0x5e860b&&(_0x5e860b=await _0xf9d3c1[_0x3d4a19(0x13a)]['getActivation'](_0x146b22,_0xa3390c));const _0x32cc06=_0x5e860b['attributes'][_0x3d4a19(0x114)][_0x3d4a19(0x16d)]||_0xa3390c,_0x885914=sanitizeYamlKey(_0x32cc06)||_0x3d4a19(0x11b)+_0xa3390c,_0x4d53b4=_0x885914;_0x3d9fa1['set'](_0xa3390c,_0x4d53b4);const _0xbc4ed5=journeyActivationStepToYaml(_0x5e860b,_0x5e80f8,_0x24bf33);return{'name':_0x4d53b4,'isJourneyLocal':!![],'definition':_0xbc4ed5};}catch{return{'name':_0xa3390c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1f4ff5,_0x28717f)=>resolveJumpTarget(_0x1f4ff5,_0x28717f,_0x5f339d,async _0x13b8b1=>{const _0x257076=a100_0x5482,_0x41c847=_0x30892c?.['get'](_0x13b8b1);if(_0x41c847)return _0x41c847;return _0xf9d3c1[_0x257076(0x13a)][_0x257076(0x135)](_0x13b8b1);})};return _0x253a32=_0x466c72,_0x466c72;},_0x201824=async _0x53f578=>{const _0x41978f=a100_0x5482,{collectSegmentIdsFromJourneyApi:_0x272b33}=await import(_0x41978f(0x113)),{batchAsync:_0x1b82b7}=await import(_0x41978f(0x102)),_0x5dddee=new Set();for(const _0x2f70f7 of _0x53f578){let _0x35c2af=_0x30892c?.[_0x41978f(0x1ae)](_0x2f70f7);!_0x35c2af&&(_0x35c2af=await _0xf9d3c1[_0x41978f(0x13a)]['getJourney'](_0x2f70f7));const _0xea52e6=_0x272b33(_0x35c2af);for(const _0x8f235b of _0xea52e6){_0x5dddee[_0x41978f(0x125)](_0x8f235b);}}let _0x411fe0=Array[_0x41978f(0x130)](_0x5dddee);while(_0x411fe0['length']>0x0){const _0x548d04=_0x411fe0[_0x41978f(0x1a0)](_0x549511=>!_0x20285c[_0x41978f(0x18b)](_0x549511));if(_0x548d04['length']===0x0)break;const _0x2008ea=await _0x1b82b7(_0x548d04,async _0x2b6a19=>{const _0x43e72d=_0x41978f;_0x20285c['add'](_0x2b6a19);let _0x3cad5c=_0x219d99[_0x43e72d(0x14d)](_0x346b11=>_0x346b11['id']===_0x2b6a19);if(!_0x3cad5c)try{_0x3cad5c=await _0xf9d3c1['segment'][_0x43e72d(0x164)](_0x53503b,_0x2b6a19);}catch{return null;}return{'segmentId':_0x2b6a19,'segment':_0x3cad5c};},0xa),_0x12c7b7=new Set();for(const _0xaae5aa of _0x2008ea){if(!_0xaae5aa?.['segment']?.[_0x41978f(0x1a6)])continue;const _0x3ef3c7=apiRuleToYaml(_0xaae5aa[_0x41978f(0x157)][_0x41978f(0x1a6)]);_0x4c962a[_0x41978f(0x189)](_0xaae5aa[_0x41978f(0x129)],_0x3ef3c7);const _0x594be1=collectSegmentRefsFromRule(_0x3ef3c7);for(const _0x1d5cc3 of _0x594be1){!_0x20285c[_0x41978f(0x18b)](_0x1d5cc3)&&_0x12c7b7[_0x41978f(0x125)](_0x1d5cc3);}}_0x411fe0=Array[_0x41978f(0x130)](_0x12c7b7);}};return{'createYamlContext':_0xf38a44,'prefetchJourneySegments':_0x201824};}export async function executePushSegments(_0x33a856,_0x4f4689,_0x15619d,_0x4a33e8,_0x46bcf2){const _0x39d023=a100_0x525e79,{segmentDefToCreateRequest:_0x582056,segmentDefToUpdateRequest:_0x6c6d51}=await import(_0x39d023(0xdc)),_0x1b280b=_0x15619d[_0x39d023(0x175)],_0x3fe5fd=0x5,_0x5520a8=async _0x41a07b=>{const _0x44848c=_0x39d023,_0x2107e8=_0x41a07b[_0x44848c(0x146)]?_0x1b280b[_0x44848c(0x1ae)](_0x41a07b[_0x44848c(0x146)]):undefined;let _0x42d9ca;const _0x22adaf={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x41a07b[_0x44848c(0x185)]){_0x46bcf2[_0x44848c(0x19a)]?.({'type':'segment_creating','name':_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]});const _0x111782=_0x582056(_0x41a07b['yamlConfig'],_0x2107e8),_0x2eb3a7=await _0x46bcf2[_0x44848c(0xd7)]('Creating\x20segment\x20\x27'+_0x41a07b['yamlConfig']['name']+_0x44848c(0xd6),()=>_0x33a856[_0x44848c(0x157)][_0x44848c(0x193)](_0x4a33e8[_0x44848c(0x120)],_0x111782));_0x42d9ca=_0x2eb3a7[_0x44848c(0x171)]['id'],_0x22adaf[_0x44848c(0x18e)]={'name':_0x41a07b['yamlConfig'][_0x44848c(0x16d)],'id':_0x42d9ca},_0x46bcf2['onProgress']?.({'type':_0x44848c(0xf9),'name':_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)],'segmentId':_0x42d9ca}),_0x46bcf2['logSuccess']?.(_0x44848c(0x153)+_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]+'\x27'),_0x22adaf['created']=0x1;}else{if(_0x41a07b[_0x44848c(0x15d)]){_0x46bcf2[_0x44848c(0x19a)]?.({'type':_0x44848c(0x12b),'name':_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]});const _0x1bb628=_0x6c6d51(_0x41a07b[_0x44848c(0x17c)]);_0x2107e8!==_0x41a07b['existingSegment']?.[_0x44848c(0xd2)]&&(_0x1bb628[_0x44848c(0xd2)]=_0x2107e8?parseInt(_0x2107e8,0xa):undefined),await _0x46bcf2[_0x44848c(0xd7)]('Updating\x20segment\x20\x27'+_0x41a07b['yamlConfig'][_0x44848c(0x16d)]+_0x44848c(0xd6),()=>_0x33a856[_0x44848c(0x157)][_0x44848c(0xf7)](_0x4a33e8[_0x44848c(0x120)],_0x41a07b[_0x44848c(0x154)]['id'],_0x1bb628)),_0x42d9ca=_0x41a07b[_0x44848c(0x154)]['id'],_0x46bcf2[_0x44848c(0x19a)]?.({'type':_0x44848c(0x195),'name':_0x41a07b['yamlConfig']['name']}),_0x46bcf2[_0x44848c(0x11f)]?.(_0x44848c(0x14b)+_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]+'\x27'),_0x22adaf[_0x44848c(0x18d)]=0x1;}else _0x42d9ca=_0x41a07b[_0x44848c(0x154)]['id'];}}catch(_0x49f2ec){const _0x755011=isHttp400Error(_0x49f2ec),_0x4b4767=_0x755011?ErrorCode[_0x44848c(0xf8)]:ErrorCode[_0x44848c(0x163)],_0x38d38=getErrorMessage(_0x49f2ec);throw new SDKError(_0x4b4767,_0x44848c(0x142)+(_0x41a07b[_0x44848c(0x185)]?_0x44848c(0x17a):'update')+'\x20segment\x20from\x20file:\x20'+_0x41a07b[_0x44848c(0xf3)]+_0x44848c(0xf1)+_0x38d38,_0x49f2ec);}try{const _0x13e9f5=await syncActivationsForSegment(_0x33a856,_0x4a33e8[_0x44848c(0x120)],_0x42d9ca,_0x41a07b['yamlConfig'][_0x44848c(0x16d)],_0x41a07b['activationActions'],_0x46bcf2,_0x41a07b['absolutePath']);_0x22adaf[_0x44848c(0x177)]=_0x13e9f5;}catch(_0x30c533){if(_0x30c533 instanceof SDKError)throw _0x30c533;throw new SDKError(ErrorCode[_0x44848c(0xeb)],_0x44848c(0x192)+_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]+_0x44848c(0x19e)+_0x41a07b[_0x44848c(0xf3)]+'\x0a\x20\x20'+getErrorMessage(_0x30c533),_0x30c533);}return _0x22adaf;},_0x404c5e=await batchAsync(_0x4f4689,_0x5520a8,_0x3fe5fd),_0x14c97f={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x47e7c0 of _0x404c5e){_0x14c97f[_0x39d023(0x100)]+=_0x47e7c0['created'],_0x14c97f[_0x39d023(0x18d)]+=_0x47e7c0[_0x39d023(0x18d)],_0x47e7c0['createdSegmentId']&&_0x14c97f[_0x39d023(0x131)]['set'](_0x47e7c0[_0x39d023(0x18e)][_0x39d023(0x16d)],_0x47e7c0[_0x39d023(0x18e)]['id']),_0x14c97f[_0x39d023(0x177)][_0x39d023(0x100)]+=_0x47e7c0[_0x39d023(0x177)][_0x39d023(0x100)],_0x14c97f[_0x39d023(0x177)][_0x39d023(0x18d)]+=_0x47e7c0[_0x39d023(0x177)][_0x39d023(0x18d)],_0x14c97f['activations'][_0x39d023(0x151)]+=_0x47e7c0['activations'][_0x39d023(0x151)];}return _0x14c97f;}async function syncActivationsForSegment(_0x425eb2,_0x25f04f,_0x5c9770,_0x42f779,_0x5b6548,_0x3a9ea5,_0x12a678){const _0x3e2c4b=a100_0x525e79,_0x1f6f3d={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4f7b88 of _0x5b6548){try{if(_0x4f7b88[_0x3e2c4b(0x183)]==='create'&&_0x4f7b88['validatedRequest'])_0x3a9ea5['onProgress']?.({'type':'activation_creating','segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),await _0x3a9ea5['withProgress'](_0x3e2c4b(0x141)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27...',()=>_0x425eb2[_0x3e2c4b(0x157)][_0x3e2c4b(0x110)](_0x25f04f,_0x5c9770,_0x4f7b88[_0x3e2c4b(0x122)])),_0x3a9ea5['onProgress']?.({'type':_0x3e2c4b(0x1a3),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),_0x3a9ea5[_0x3e2c4b(0x11f)]?.(_0x3e2c4b(0x16a)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27'),_0x1f6f3d[_0x3e2c4b(0x100)]++;else{if(_0x4f7b88[_0x3e2c4b(0x183)]==='update'&&_0x4f7b88[_0x3e2c4b(0x122)]&&_0x4f7b88[_0x3e2c4b(0x180)])_0x3a9ea5[_0x3e2c4b(0x19a)]?.({'type':_0x3e2c4b(0x11c),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),await _0x3a9ea5[_0x3e2c4b(0xd7)]('Updating\x20activation\x20\x27'+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27...',()=>_0x425eb2[_0x3e2c4b(0x157)]['updateActivation'](_0x25f04f,_0x5c9770,_0x4f7b88[_0x3e2c4b(0x180)]['id'],_0x4f7b88[_0x3e2c4b(0x122)])),_0x3a9ea5['onProgress']?.({'type':_0x3e2c4b(0x196),'segmentName':_0x42f779,'activationName':_0x4f7b88['name']}),_0x3a9ea5[_0x3e2c4b(0x11f)]?.(_0x3e2c4b(0x17e)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27'),_0x1f6f3d[_0x3e2c4b(0x18d)]++;else _0x4f7b88['type']===_0x3e2c4b(0x19b)&&_0x4f7b88[_0x3e2c4b(0x180)]&&(_0x3a9ea5['onProgress']?.({'type':_0x3e2c4b(0x1a1),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),await _0x3a9ea5[_0x3e2c4b(0xd7)](_0x3e2c4b(0x106)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27...',()=>_0x425eb2['segment']['deleteActivation'](_0x25f04f,_0x5c9770,_0x4f7b88[_0x3e2c4b(0x180)]['id'])),_0x3a9ea5[_0x3e2c4b(0x19a)]?.({'type':_0x3e2c4b(0xd5),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),_0x3a9ea5['logDeleted']?.(_0x3e2c4b(0x143)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27'),_0x1f6f3d[_0x3e2c4b(0x151)]++);}}catch(_0xd366f8){const _0x228ca2=isHttp400Error(_0xd366f8),_0x1f664=_0x228ca2?ErrorCode[_0x3e2c4b(0x155)]:ErrorCode[_0x3e2c4b(0xeb)],_0x5ca2c3=getErrorMessage(_0xd366f8);throw new SDKError(_0x1f664,_0x3e2c4b(0x142)+_0x4f7b88[_0x3e2c4b(0x183)]+_0x3e2c4b(0x144)+_0x4f7b88['name']+_0x3e2c4b(0x19e)+_0x12a678+_0x3e2c4b(0xf1)+_0x5ca2c3,_0xd366f8);}}return _0x1f6f3d;}export async function executePushFolders(_0x41c210,_0x5166f4,_0x29cf6,_0x565200,_0x1e000f){const _0x11e0bd=a100_0x525e79,_0x3e1cb7=new Map(_0x29cf6);for(const _0x524721 of _0x5166f4){const _0x3e2d13=_0x524721[_0x11e0bd(0x1a9)]('/'),_0x1688f8=_0x3e2d13[_0x3e2d13[_0x11e0bd(0x104)]-0x1],_0xeb1aa1=_0x3e2d13['slice'](0x0,-0x1)['join']('/'),_0x2a8e94=_0x3e1cb7['get'](_0xeb1aa1);_0x1e000f[_0x11e0bd(0x19a)]?.({'type':_0x11e0bd(0x152),'folder':_0x524721});const _0x14cd1b={'name':_0x1688f8,'parentFolderId':_0x2a8e94},_0xd23d06=await _0x1e000f['withProgress']('Creating\x20folder\x20\x27'+_0x524721+_0x11e0bd(0xd6),()=>_0x41c210[_0x11e0bd(0x157)][_0x11e0bd(0x136)](_0x565200['parentId'],_0x14cd1b));_0x3e1cb7[_0x11e0bd(0x189)](_0x524721,_0xd23d06[_0x11e0bd(0x171)]['id']),_0x1e000f[_0x11e0bd(0x19a)]?.({'type':_0x11e0bd(0xf2),'folder':_0x524721,'folderId':_0xd23d06[_0x11e0bd(0x171)]['id']}),_0x1e000f[_0x11e0bd(0x19d)]?.(_0x11e0bd(0x1ab)+_0x524721+'\x27');}return _0x3e1cb7;}export async function executePushSegmentDeletions(_0x4a8e2b,_0x75a350,_0xcd8135){const _0x1aadf6=a100_0x525e79;if(_0x75a350[_0x1aadf6(0x104)]===0x0)return 0x0;const {batchAsync:_0x4bac86}=await import(_0x1aadf6(0x102)),_0x2d1220=0x5,_0x4ccc2a=await _0x4bac86(_0x75a350,async _0x5f30de=>{const _0x2c6f95=_0x1aadf6;return _0xcd8135['onProgress']?.({'type':_0x2c6f95(0x15f),'name':_0x5f30de['name']}),await _0x4a8e2b[_0x2c6f95(0x157)][_0x2c6f95(0xf5)](_0x5f30de['id']),_0xcd8135[_0x2c6f95(0x19a)]?.({'type':_0x2c6f95(0x116),'name':_0x5f30de[_0x2c6f95(0x16d)]}),_0xcd8135['logDeleted']?.('Deleted\x20segment\x20\x27'+_0x5f30de['name']+'\x27'),0x1;},_0x2d1220);return _0x4ccc2a[_0x1aadf6(0xe9)]((_0x468268,_0x2533bb)=>_0x468268+_0x2533bb,0x0);}export async function executePushJourneys(_0x261a14,_0x354e3f,_0x589f09,_0x1faede,_0x173b93){const _0x29455d=a100_0x525e79,{journeyDefToRequest:_0x363fd7}=await import(_0x29455d(0x113)),{activationDefToCreateRequest:_0x240a49,yamlRuleToApi:_0x37de6c,validateSegmentRule:_0x3537b9}=await import(_0x29455d(0xdc)),_0x301a05={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x232db8=new Map(_0x589f09[_0x29455d(0x150)]),_0x456248=0x5;for(let _0x1d52ff=0x0;_0x1d52ff<_0x354e3f['length'];_0x1d52ff+=_0x456248){const _0x5912f5=_0x354e3f[_0x29455d(0xdd)](_0x1d52ff,_0x1d52ff+_0x456248),_0x35afd1=await Promise[_0x29455d(0x10c)](_0x5912f5['map'](async _0x2adb3c=>{const _0xc0b6c3=_0x29455d;if(!_0x2adb3c[_0xc0b6c3(0x185)]&&!_0x2adb3c['hasChanges'])return{'action':_0xc0b6c3(0xe0),'name':_0x2adb3c[_0xc0b6c3(0x17c)][_0xc0b6c3(0x16d)],'journeyId':_0x2adb3c['existingJourney']?.['id']};const _0x3c3f5b=_0x2adb3c[_0xc0b6c3(0x146)]?_0x589f09[_0xc0b6c3(0x175)][_0xc0b6c3(0x1ae)](_0x2adb3c[_0xc0b6c3(0x146)]):undefined;_0x173b93['onProgress']?.({'type':_0x2adb3c[_0xc0b6c3(0x185)]?_0xc0b6c3(0x10f):'journey_updating','name':_0x2adb3c['yamlConfig'][_0xc0b6c3(0x16d)]});try{const _0x380ed4=await executeSingleJourneyPush(_0x261a14,_0x2adb3c,{..._0x589f09,'segmentNameToId':_0x232db8},{'parentId':_0x1faede[_0xc0b6c3(0x120)],'rootFolderId':_0x1faede[_0xc0b6c3(0x162)],'folderId':_0x3c3f5b,'verbose':_0x1faede[_0xc0b6c3(0x118)]},_0x173b93,{'journeyDefToRequest':_0x363fd7,'activationDefToCreateRequest':_0x240a49,'yamlRuleToApi':_0x37de6c,'validateSegmentRule':_0x3537b9});for(const [_0x51892a,_0x2a2644]of _0x380ed4[_0xc0b6c3(0x18a)]){_0x232db8[_0xc0b6c3(0x189)](_0x51892a,_0x2a2644),_0x301a05[_0xc0b6c3(0x18a)][_0xc0b6c3(0x189)](_0x51892a,_0x2a2644);}if(_0x380ed4[_0xc0b6c3(0xfb)]===_0xc0b6c3(0x100))_0x173b93[_0xc0b6c3(0x19a)]?.({'type':_0xc0b6c3(0xd3),'name':_0x2adb3c[_0xc0b6c3(0x17c)]['name'],'journeyId':_0x380ed4[_0xc0b6c3(0xe1)]}),_0x173b93[_0xc0b6c3(0x11f)]?.('Created\x20journey\x20\x27'+_0x2adb3c[_0xc0b6c3(0x17c)]['name']+'\x27'),_0x301a05[_0xc0b6c3(0x100)]++;else _0x380ed4[_0xc0b6c3(0xfb)]===_0xc0b6c3(0x18d)&&(_0x173b93[_0xc0b6c3(0x19a)]?.({'type':'journey_updated','name':_0x2adb3c[_0xc0b6c3(0x17c)]['name']}),_0x173b93[_0xc0b6c3(0x11f)]?.(_0xc0b6c3(0x179)+_0x2adb3c[_0xc0b6c3(0x17c)][_0xc0b6c3(0x16d)]+'\x27'),_0x301a05[_0xc0b6c3(0x18d)]++);return{'action':_0x380ed4[_0xc0b6c3(0xfb)],'name':_0x2adb3c[_0xc0b6c3(0x17c)]['name'],'journeyId':_0x380ed4[_0xc0b6c3(0xe1)]};}catch(_0x427744){const _0x2b1492=isHttp400Error(_0x427744),_0x36ea7f=_0x2b1492?ErrorCode[_0xc0b6c3(0x17d)]:ErrorCode[_0xc0b6c3(0x181)],_0x4c884b=getErrorMessage(_0x427744);throw new SDKError(_0x36ea7f,_0xc0b6c3(0x142)+(_0x2adb3c[_0xc0b6c3(0x185)]?_0xc0b6c3(0x17a):_0xc0b6c3(0x168))+'\x20journey\x20from\x20file:\x20'+_0x2adb3c['absolutePath']+'\x0a\x20\x20'+_0x4c884b,_0x427744);}}));_0x301a05['results']['push'](..._0x35afd1);}return _0x301a05;}async function executeSingleJourneyPush(_0x5a54ca,_0x5de177,_0x478e01,_0x26cc52,_0x3e9efb,_0x514bb5){const _0x333814=a100_0x525e79,{journeyDefToRequest:_0x197285,activationDefToCreateRequest:_0x26908c,yamlRuleToApi:_0x3de5bc,validateSegmentRule:_0x341873}=_0x514bb5,_0xb3e0e3=new Map(),_0x13ef7a=new Map(),_0x50db20=new Map(),_0x5c6300=new Map(),_0x564f4b=new Map();let _0x30e351;const _0x222af5=async()=>{const _0x1be8d3=a100_0x5482;if(_0x30e351)return;_0x30e351=new Map();if(!_0x5de177[_0x1be8d3(0x1aa)])return;const _0x43afc9=await _0x5a54ca[_0x1be8d3(0x13a)][_0x1be8d3(0xe6)](_0x5de177['existingJourney']['id']);for(const _0x78b496 of _0x43afc9){const _0x417848=journeyActivationStepToYaml(_0x78b496,_0x478e01[_0x1be8d3(0x112)],_0x478e01['connectionIdToNameMap']),_0x4dcc7a=activationSignature(_0x417848);!_0x30e351[_0x1be8d3(0x18b)](_0x4dcc7a)&&_0x30e351['set'](_0x4dcc7a,_0x78b496['id']),_0x417848[_0x1be8d3(0x16d)]&&_0x13ef7a[_0x1be8d3(0x189)](_0x417848[_0x1be8d3(0x16d)],_0x78b496['id']);}};if(_0x5de177['existingJourney']&&_0x5de177[_0x333814(0x17c)][_0x333814(0x115)]){const _0x50bf35=buildLocalExpandedRuleMappings(_0x5de177[_0x333814(0x17c)]),_0x57cafc=_0x50bf35[_0x333814(0x197)];if(_0x57cafc[_0x333814(0x15b)]>0x0){const _0x5bbae0=new Map();for(const [_0x27c57d,_0x38a7ab]of _0x57cafc){const _0x5e4d0d=serializeExpandedRule(_0x38a7ab,_0x57cafc);_0x5bbae0[_0x333814(0x189)](_0x27c57d,_0x5e4d0d);}const _0x25b252=collectSegmentIdsFromJourneyApi(_0x5de177[_0x333814(0x1aa)]);if(_0x25b252[_0x333814(0x15b)]>0x0){const _0x1c6317=await buildServerSegmentRuleMap(_0x5a54ca,_0x26cc52[_0x333814(0x120)],_0x478e01[_0x333814(0x1a8)],_0x25b252);if(_0x1c6317[_0x333814(0x15b)]>0x0){const _0x5b5604=new Map();for(const [_0x415ed0,_0x4a4eee]of _0x1c6317){const _0x420bf9=serializeExpandedRule(_0x4a4eee,_0x1c6317);!_0x5b5604[_0x333814(0x18b)](_0x420bf9)&&_0x5b5604[_0x333814(0x189)](_0x420bf9,_0x415ed0);}for(const [_0x25dcb1,_0x28e14c]of _0x5bbae0){const _0x24188e=_0x5b5604[_0x333814(0x1ae)](_0x28e14c);_0x24188e&&(_0x564f4b[_0x333814(0x189)](_0x25dcb1,_0x24188e),_0x478e01[_0x333814(0x150)][_0x333814(0x189)](_0x25dcb1,_0x24188e));}}}}}const _0x2ebb38={'resolveSegmentId':async _0x5bfd24=>{const _0x27ade3=_0x333814,_0x2a4d4c=_0x478e01[_0x27ade3(0x150)][_0x27ade3(0x1ae)](_0x5bfd24);if(!_0x2a4d4c)throw new SDKError(ErrorCode[_0x27ade3(0x11a)],_0x27ade3(0x170)+_0x5bfd24+'\x20(referenced\x20in\x20journey\x20'+_0x5de177[_0x27ade3(0x17c)]['name']+')');return _0x2a4d4c;},'resolveEmbeddedSegmentId':async(_0x29e9db,_0x509f48)=>{const _0x399fe9=_0x333814,_0x3be3b8=_0x478e01[_0x399fe9(0x150)]['get'](_0x29e9db);if(_0x3be3b8)return _0x3be3b8;const _0x2dbc44=_0x564f4b[_0x399fe9(0x1ae)](_0x29e9db);if(_0x2dbc44)return _0x478e01[_0x399fe9(0x150)]['set'](_0x29e9db,_0x2dbc44),_0x2dbc44;const _0x4c6b5c=_0x478e01[_0x399fe9(0x1a8)][_0x399fe9(0x14d)](_0x3b8f55=>_0x3b8f55[_0x399fe9(0x16d)]===_0x29e9db);if(_0x4c6b5c)return _0x478e01[_0x399fe9(0x150)][_0x399fe9(0x189)](_0x29e9db,_0x4c6b5c['id']),_0x4c6b5c['id'];if(_0x5de177[_0x399fe9(0x185)]){const {stageName:_0x341367,criteriaName:_0x1690ef}=findSegmentCriteriaLocation(_0x5de177[_0x399fe9(0x17c)],_0x29e9db);return _0x341873(_0x29e9db,_0x509f48[_0x399fe9(0x1a6)]),_0x50db20[_0x399fe9(0x189)](_0x29e9db,{'definition':_0x509f48,'stageName':_0x341367,'criteriaName':_0x1690ef}),createPendingSegmentId(_0x29e9db);}const _0x1bd2d2=_0x5de177[_0x399fe9(0x1aa)]?.['id'];if(!_0x1bd2d2)throw new SDKError(ErrorCode['INTERNAL'],_0x399fe9(0x13d));_0x341873(_0x29e9db,_0x509f48[_0x399fe9(0x1a6)]);const _0xca50d1=generateDeterministicJourneySegmentName(_0x5de177[_0x399fe9(0x17c)][_0x399fe9(0x16d)],_0x29e9db),_0x413741=_0x478e01['existingSegments'][_0x399fe9(0x14d)](_0x3e539a=>_0x3e539a['name']===_0xca50d1),_0x53bd81=createSegmentIdResolver(_0x478e01['segmentNameToId'],_0x29e9db),_0x1d4564=await resolveRuleSegmentIds(_0x509f48[_0x399fe9(0x1a6)],_0x53bd81);let _0x112a05;if(_0x413741)await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0xf7)](_0x26cc52[_0x399fe9(0x120)],_0x413741['id'],{'description':_0x509f48[_0x399fe9(0x124)]||'Entry\x20criteria:\x20'+_0x29e9db,'rule':_0x3de5bc(_0x1d4564,!![]),'countPopulation':!![]}),_0x112a05=_0x413741['id'];else try{_0x112a05=await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0xe2)]({'name':_0xca50d1,'description':_0x509f48[_0x399fe9(0x124)]||_0x399fe9(0x1a2)+_0x29e9db,'journeyId':_0x1bd2d2,'rule':_0x3de5bc(_0x1d4564,!![]),'countPopulation':!![],'parentFolderId':_0x26cc52[_0x399fe9(0x162)]||'','audienceId':_0x26cc52[_0x399fe9(0x120)]});}catch(_0x1b21d4){const _0x2fc96b=_0x1b21d4 instanceof Error&&_0x1b21d4['message'][_0x399fe9(0x160)](_0x399fe9(0xea));if(_0x2fc96b){const _0xaf6ef9=await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0x10d)](_0x26cc52[_0x399fe9(0x120)]),_0x3541ac=_0xaf6ef9[_0x399fe9(0x14d)](_0x363f98=>_0x363f98[_0x399fe9(0x16d)]===_0xca50d1);if(_0x3541ac)await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0xf7)](_0x26cc52['parentId'],_0x3541ac['id'],{'description':_0x509f48[_0x399fe9(0x124)]||_0x399fe9(0x1a2)+_0x29e9db,'rule':_0x3de5bc(_0x1d4564,!![]),'countPopulation':!![]}),_0x112a05=_0x3541ac['id'];else throw _0x1b21d4;}else throw _0x1b21d4;}return _0x478e01[_0x399fe9(0x150)]['set'](_0x29e9db,_0x112a05),_0xb3e0e3[_0x399fe9(0x189)](_0x29e9db,_0x112a05),_0x112a05;},'resolveActivationId':async _0x4e588c=>{const _0x3d3406=_0x333814,_0x2c5bce=_0x13ef7a[_0x3d3406(0x1ae)](_0x4e588c);if(_0x2c5bce)return _0x2c5bce;if(_0x5de177[_0x3d3406(0x1aa)]){await _0x222af5();const _0x45426f=_0x13ef7a[_0x3d3406(0x1ae)](_0x4e588c);if(_0x45426f)return _0x45426f;}throw new SDKError(ErrorCode[_0x3d3406(0x1ad)],_0x3d3406(0x19c)+_0x4e588c+_0x3d3406(0x14a)+_0x5de177[_0x3d3406(0x17c)][_0x3d3406(0x16d)]+').\x20'+_0x3d3406(0x187));},'resolveEmbeddedActivationId':async(_0x944b24,_0x1c274e)=>{const _0x47f86d=_0x333814,_0x5e0c5d=_0x13ef7a[_0x47f86d(0x1ae)](_0x944b24);if(_0x5e0c5d)return _0x5e0c5d;if(_0x5de177[_0x47f86d(0x185)])return _0x5c6300['set'](_0x944b24,_0x1c274e),createPendingActivationId(_0x944b24);if(_0x5de177['existingJourney']){await _0x222af5();const _0x5f4c70=_0x13ef7a[_0x47f86d(0x1ae)](_0x1c274e[_0x47f86d(0x16d)]);if(_0x5f4c70)return _0x13ef7a[_0x47f86d(0x189)](_0x944b24,_0x5f4c70),_0x5f4c70;const _0x4dcbab=activationSignature(_0x1c274e),_0x8fbc=_0x30e351?.[_0x47f86d(0x1ae)](_0x4dcbab);if(_0x8fbc)return _0x13ef7a['set'](_0x944b24,_0x8fbc),_0x8fbc;const _0x2b455e=await _0x26908c(_0x1c274e,_0x478e01[_0x47f86d(0x1a5)]),_0x4feeee=await _0x5a54ca[_0x47f86d(0x13a)][_0x47f86d(0x110)](_0x5de177['existingJourney']['id'],_0x2b455e);return _0x13ef7a[_0x47f86d(0x189)](_0x944b24,_0x4feeee['id']),_0x4feeee['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x47f86d(0xff));},'resolveJourneyId':async _0x26d048=>{const _0x539416=_0x333814;try{return await _0x5a54ca[_0x539416(0x13a)]['resolveJourneyId'](_0x26cc52[_0x539416(0x120)],_0x26d048);}catch(_0x24bfa4){throw new SDKError(ErrorCode[_0x539416(0x1ad)],'Journey\x20\x27'+_0x26d048+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x5de177[_0x539416(0x17c)][_0x539416(0x16d)]+'\x27)',_0x24bfa4);}},'resolveStageId':async(_0x31711d,_0x1255ea)=>{const _0x509040=_0x333814,_0x588e0b=await _0x5a54ca['journey'][_0x509040(0x135)](_0x31711d),_0x1806f8=_0x588e0b['attributes']['journeyStages']['find'](_0x137f31=>_0x137f31[_0x509040(0x16d)]['toLowerCase']()===_0x1255ea[_0x509040(0x127)]());if(!_0x1806f8?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x509040(0x10b)+_0x1255ea+_0x509040(0x165)+(_0x588e0b['attributes'][_0x509040(0x1a7)]||_0x588e0b[_0x509040(0x188)][_0x509040(0x16d)])+'\x27');return _0x1806f8['id'];}},_0x732590=await _0x197285(_0x5de177[_0x333814(0x17c)],_0x26cc52[_0x333814(0x120)],_0x2ebb38),_0x3cdb36=_0x26cc52[_0x333814(0x12d)]||_0x26cc52['rootFolderId'];_0x3cdb36&&(_0x732590[_0x333814(0x12c)]={'parentFolder':{'data':{'id':_0x3cdb36,'type':_0x333814(0x176)}}});if(_0x5de177[_0x333814(0x185)]){if(_0x50db20[_0x333814(0x15b)]>0x0||_0x5c6300['size']>0x0)return await executeThreeStepJourneyCreate(_0x5a54ca,_0x5de177,_0x732590,{'pendingEmbeddedSegments':_0x50db20,'pendingEmbeddedActivations':_0x5c6300,'embeddedSegmentNameToId':_0xb3e0e3,'journeyActivationNameToId':_0x13ef7a},{..._0x26cc52,'effectiveFolderId':_0x3cdb36},_0x478e01,_0x3e9efb,_0x514bb5);else{ensureJourneyDefaults(_0x732590['attributes']);const _0x4c231a=await _0x5a54ca['journey'][_0x333814(0x17a)](_0x732590);return{'action':_0x333814(0x100),'journeyId':_0x4c231a['id'],'embeddedSegmentNameToId':_0xb3e0e3};}}else{if(_0x5de177[_0x333814(0x15d)]&&_0x5de177['existingJourney'])return ensureJourneyDefaults(_0x732590[_0x333814(0x188)]),await _0x5a54ca[_0x333814(0x13a)][_0x333814(0x168)](_0x5de177[_0x333814(0x1aa)]['id'],_0x732590),{'action':_0x333814(0x18d),'journeyId':_0x5de177[_0x333814(0x1aa)]['id'],'embeddedSegmentNameToId':_0xb3e0e3};}return{'action':_0x333814(0xe0),'journeyId':_0x5de177[_0x333814(0x1aa)]?.['id'],'embeddedSegmentNameToId':_0xb3e0e3};}function findSegmentCriteriaLocation(_0x2db317,_0x101330){const _0x1e9a0e=a100_0x525e79,_0x48cae7=_0x2db317[_0x1e9a0e(0x108)]||_0x2db317[_0x1e9a0e(0x10e)]?.[0x0]?.[_0x1e9a0e(0x108)]||[];let _0x41842f='entry',_0x2570f7=_0x101330;const _0x510cb1=_0x2db317[_0x1e9a0e(0x137)]||_0x2db317[_0x1e9a0e(0x10e)]?.[0x0]?.['goal'];if(_0x510cb1?.[_0x1e9a0e(0x157)]===_0x101330)return{'stageName':_0x1e9a0e(0x137),'criteriaName':_0x510cb1[_0x1e9a0e(0x16d)]||_0x101330};_0x598dad:for(const _0x323739 of _0x48cae7){if(_0x323739[_0x1e9a0e(0x107)]?.[_0x1e9a0e(0x157)]===_0x101330){_0x41842f=_0x323739['name'],_0x2570f7=_0x323739[_0x1e9a0e(0x107)][_0x1e9a0e(0x16d)]||_0x101330;break;}if(_0x323739[_0x1e9a0e(0x145)])for(const _0xb45c2d of _0x323739[_0x1e9a0e(0x145)]){if(_0xb45c2d[_0x1e9a0e(0x183)]===_0x1e9a0e(0x15e)&&_0xb45c2d[_0x1e9a0e(0xd4)]?.['branches'])for(const _0x11d510 of _0xb45c2d[_0x1e9a0e(0xd4)][_0x1e9a0e(0x16e)]){if(_0x11d510[_0x1e9a0e(0x157)]===_0x101330){_0x41842f=_0x323739[_0x1e9a0e(0x16d)],_0x2570f7=_0x11d510[_0x1e9a0e(0x16d)]||_0x101330;break _0x598dad;}}}}return{'stageName':_0x41842f,'criteriaName':_0x2570f7};}async function executeThreeStepJourneyCreate(_0x59a3d2,_0x3d8161,_0x420794,_0x5ba96a,_0x2a1e72,_0x5c327b,_0x52c9bf,_0x31d19){const _0x11e3fa=a100_0x525e79,{activationDefToCreateRequest:_0x5961a6,yamlRuleToApi:_0x3cdce0}=_0x31d19,{pendingEmbeddedSegments:_0x57d281,pendingEmbeddedActivations:_0x437ee1,embeddedSegmentNameToId:_0x5b8d6b}=_0x5ba96a,_0x34cc2d=JSON[_0x11e3fa(0xed)](JSON['stringify'](_0x420794));ensureJourneyDefaults(_0x34cc2d[_0x11e3fa(0x188)]),stripPendingIds(_0x34cc2d);const _0x52fb6a=await _0x59a3d2[_0x11e3fa(0x13a)][_0x11e3fa(0x17a)](_0x34cc2d),_0x92734b=_0x52fb6a['id'],_0xcc5d62=new Map();for(const _0x343cc6 of _0x52fb6a[_0x11e3fa(0x188)][_0x11e3fa(0x123)]){_0xcc5d62[_0x11e3fa(0x189)](_0x343cc6[_0x11e3fa(0x16d)]['toLowerCase'](),_0x343cc6['id']);}for(const [_0x576a65,{definition:_0x2b4fa3}]of _0x57d281){const _0x331947=generateDeterministicJourneySegmentName(_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],_0x576a65);_0x52c9bf['onProgress']?.({'type':_0x11e3fa(0x174),'journeyName':_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],'segmentName':_0x576a65});const _0x2aeaf8=createSegmentIdResolver(_0x5c327b[_0x11e3fa(0x150)],_0x576a65),_0xdbebcc=await resolveRuleSegmentIds(_0x2b4fa3[_0x11e3fa(0x1a6)],_0x2aeaf8),_0x59be01=await _0x59a3d2[_0x11e3fa(0x157)][_0x11e3fa(0xe2)]({'name':_0x331947,'description':_0x2b4fa3[_0x11e3fa(0x124)]||_0x11e3fa(0x1a2)+_0x576a65,'journeyId':_0x92734b,'rule':_0x3cdce0(_0xdbebcc,!![]),'countPopulation':!![],'parentFolderId':_0x2a1e72['effectiveFolderId']||'','audienceId':_0x2a1e72[_0x11e3fa(0x120)]});_0x5b8d6b[_0x11e3fa(0x189)](_0x576a65,_0x59be01),_0x5c327b[_0x11e3fa(0x150)][_0x11e3fa(0x189)](_0x576a65,_0x59be01),_0x52c9bf[_0x11e3fa(0x19a)]?.({'type':_0x11e3fa(0x172),'journeyName':_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],'segmentName':_0x576a65});}const _0x362ad5=new Map();for(const [_0x3cfb33,_0x479d64]of _0x437ee1){_0x52c9bf[_0x11e3fa(0x19a)]?.({'type':_0x11e3fa(0x161),'journeyName':_0x3d8161['yamlConfig'][_0x11e3fa(0x16d)],'activationName':_0x3cfb33});const _0x3e5f58=await _0x5961a6(_0x479d64,_0x5c327b['activationContext']),_0x43c4c0=await _0x59a3d2[_0x11e3fa(0x13a)][_0x11e3fa(0x110)](_0x92734b,_0x3e5f58);_0x362ad5['set'](_0x3cfb33,_0x43c4c0['id']),_0x5ba96a['journeyActivationNameToId'][_0x11e3fa(0x189)](_0x3cfb33,_0x43c4c0['id']),_0x52c9bf['onProgress']?.({'type':_0x11e3fa(0x178),'journeyName':_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],'activationName':_0x3cfb33});}const _0x123f31=JSON[_0x11e3fa(0xed)](JSON[_0x11e3fa(0x11e)](_0x420794));return _0x123f31['id']=_0x92734b,ensureJourneyDefaults(_0x123f31[_0x11e3fa(0x188)]),resolvePendingIdsInRequest(_0x123f31,_0x420794,_0xcc5d62,_0x5b8d6b,_0x362ad5,_0x52c9bf),await _0x59a3d2[_0x11e3fa(0x13a)][_0x11e3fa(0x168)](_0x92734b,_0x123f31),{'action':_0x11e3fa(0x100),'journeyId':_0x92734b,'embeddedSegmentNameToId':_0x5b8d6b};}function stripPendingIds(_0x3fcf7c){const _0x574771=a100_0x525e79;for(const _0x54deed of _0x3fcf7c[_0x574771(0x188)][_0x574771(0x123)]||[]){_0x54deed[_0x574771(0xfa)]?.[_0x574771(0x129)]&&isPendingSegmentId(_0x54deed[_0x574771(0xfa)]['segmentId'])&&delete _0x54deed[_0x574771(0xfa)];if(_0x54deed['steps'])for(const _0xed99c of Object[_0x574771(0x12e)](_0x54deed[_0x574771(0x145)])){const _0x3fd71d=_0x54deed[_0x574771(0x145)][_0xed99c];_0x3fd71d['type']==='Activation'&&_0x3fd71d[_0x574771(0x19f)]&&isPendingActivationId(_0x3fd71d['journeyActivationStepId'])&&(_0x3fd71d[_0x574771(0x19f)]='');if(_0x3fd71d[_0x574771(0x183)]===_0x574771(0x148)&&_0x3fd71d[_0x574771(0x16e)])for(const _0x2c68fc of _0x3fd71d[_0x574771(0x16e)]){_0x2c68fc[_0x574771(0x129)]&&isPendingSegmentId(_0x2c68fc[_0x574771(0x129)])&&(_0x2c68fc['segmentId']='');}_0x3fd71d['type']===_0x574771(0x147)&&_0x3fd71d[_0x574771(0x167)]?.[_0x574771(0x129)]&&isPendingSegmentId(_0x3fd71d[_0x574771(0x167)][_0x574771(0x129)])&&(_0x3fd71d[_0x574771(0x167)][_0x574771(0x129)]='');}}}function resolvePendingIdsInRequest(_0x2c80e3,_0x49067a,_0x13ec4a,_0x1f013c,_0x2de1ec,_0x465285){const _0x207ddf=a100_0x525e79,_0x444d5b=(_0x456ab0,_0x417e69)=>{const _0x481913=a100_0x5482;if(!isPendingSegmentId(_0x456ab0))return _0x456ab0;const _0x5018f9=extractPendingSegmentName(_0x456ab0),_0xe85ae2=_0x1f013c[_0x481913(0x1ae)](_0x5018f9);return!_0xe85ae2&&_0x465285['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x5018f9+'\x27\x20for\x20'+_0x417e69),_0xe85ae2;};if(_0x2c80e3[_0x207ddf(0x188)][_0x207ddf(0x137)]?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0x2c80e3[_0x207ddf(0x188)][_0x207ddf(0x137)][_0x207ddf(0x129)])){const _0x389c0d=_0x444d5b(_0x2c80e3['attributes'][_0x207ddf(0x137)][_0x207ddf(0x129)],_0x207ddf(0x15c));_0x389c0d&&(_0x2c80e3['attributes']['goal'][_0x207ddf(0x129)]=_0x389c0d);}for(const _0xadc552 of _0x2c80e3[_0x207ddf(0x188)][_0x207ddf(0x123)]||[]){const _0x2b31c2=_0x13ec4a['get'](_0xadc552[_0x207ddf(0x16d)][_0x207ddf(0x127)]());_0x2b31c2&&(_0xadc552['id']=_0x2b31c2);if(_0xadc552['entryCriteria']?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0xadc552[_0x207ddf(0xfa)]['segmentId'])){const _0x16647e=_0x444d5b(_0xadc552['entryCriteria'][_0x207ddf(0x129)],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+'\x27\x20entry\x20criteria');_0x16647e&&(_0xadc552[_0x207ddf(0xfa)]['segmentId']=_0x16647e);}if(_0xadc552['exitCriterias'])for(const _0xbe1c07 of _0xadc552[_0x207ddf(0x16c)]){if(_0xbe1c07[_0x207ddf(0x129)]&&isPendingSegmentId(_0xbe1c07[_0x207ddf(0x129)])){const _0x2f9c1c=_0x444d5b(_0xbe1c07['segmentId'],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+_0x207ddf(0x17b));_0x2f9c1c&&(_0xbe1c07[_0x207ddf(0x129)]=_0x2f9c1c);}}if(_0xadc552[_0x207ddf(0x18c)]?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0xadc552[_0x207ddf(0x18c)][_0x207ddf(0x129)])){const _0x242561=_0x444d5b(_0xadc552['milestone'][_0x207ddf(0x129)],'stage\x20\x27'+_0xadc552[_0x207ddf(0x16d)]+'\x27\x20milestone');_0x242561&&(_0xadc552[_0x207ddf(0x18c)][_0x207ddf(0x129)]=_0x242561);}if(_0xadc552[_0x207ddf(0x145)]){const _0x1954cd=_0x24f5ff=>_0x49067a[_0x207ddf(0x188)][_0x207ddf(0x123)][_0x207ddf(0x14d)](_0x4e6d76=>_0x4e6d76[_0x207ddf(0x16d)][_0x207ddf(0x127)]()===_0xadc552[_0x207ddf(0x16d)][_0x207ddf(0x127)]())?.[_0x207ddf(0x145)]?.[_0x24f5ff];for(const _0x2941d1 of Object[_0x207ddf(0x12e)](_0xadc552['steps'])){const _0x938b15=_0xadc552[_0x207ddf(0x145)][_0x2941d1],_0x188965=_0x1954cd(_0x2941d1);if(_0x938b15['type']===_0x207ddf(0x1ac)&&_0x938b15['journeyActivationStepId']&&(isPendingActivationId(_0x938b15['journeyActivationStepId'])||_0x938b15[_0x207ddf(0x19f)]==='')){if(_0x188965?.[_0x207ddf(0x19f)]&&isPendingActivationId(_0x188965[_0x207ddf(0x19f)])){const _0x2d47a9=extractPendingActivationName(_0x188965[_0x207ddf(0x19f)]),_0x34318a=_0x2de1ec[_0x207ddf(0x1ae)](_0x2d47a9);_0x34318a&&(_0x938b15[_0x207ddf(0x19f)]=_0x34318a);}}if(_0x938b15[_0x207ddf(0x183)]===_0x207ddf(0x148)&&_0x938b15['branches']&&_0x188965?.[_0x207ddf(0x16e)])for(let _0x400a2b=0x0;_0x400a2b<_0x938b15[_0x207ddf(0x16e)][_0x207ddf(0x104)];_0x400a2b++){const _0x4415fb=_0x938b15[_0x207ddf(0x16e)][_0x400a2b],_0x2a9ddb=_0x188965[_0x207ddf(0x16e)][_0x400a2b];if(_0x2a9ddb?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0x2a9ddb[_0x207ddf(0x129)])){const _0x349071=_0x444d5b(_0x2a9ddb[_0x207ddf(0x129)],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+_0x207ddf(0x117)+(_0x4415fb[_0x207ddf(0x16d)]||_0x400a2b)+'\x27');_0x349071&&(_0x4415fb[_0x207ddf(0x129)]=_0x349071);}}if(_0x938b15[_0x207ddf(0x183)]===_0x207ddf(0x147)&&_0x938b15['waitCondition']?.[_0x207ddf(0x129)]&&_0x188965?.['waitCondition']?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0x188965[_0x207ddf(0x167)][_0x207ddf(0x129)])){const _0x191a25=_0x444d5b(_0x188965[_0x207ddf(0x167)][_0x207ddf(0x129)],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+_0x207ddf(0x13f));_0x191a25&&(_0x938b15[_0x207ddf(0x167)]['segmentId']=_0x191a25);}}}}}
1
+ const a100_0x2c6966=a100_0x1a9a;(function(_0x3a961a,_0x572702){const _0x29c3dc=a100_0x1a9a,_0x177069=_0x3a961a();while(!![]){try{const _0x561e0b=parseInt(_0x29c3dc(0x151))/0x1+parseInt(_0x29c3dc(0x168))/0x2*(-parseInt(_0x29c3dc(0x18f))/0x3)+-parseInt(_0x29c3dc(0x1c4))/0x4*(parseInt(_0x29c3dc(0x18a))/0x5)+parseInt(_0x29c3dc(0x1ff))/0x6+parseInt(_0x29c3dc(0x136))/0x7+-parseInt(_0x29c3dc(0x1bd))/0x8+parseInt(_0x29c3dc(0x183))/0x9;if(_0x561e0b===_0x572702)break;else _0x177069['push'](_0x177069['shift']());}catch(_0x2ee8c1){_0x177069['push'](_0x177069['shift']());}}}(a100_0xc29c,0xd67d3));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a100_0x2c6966(0x12a);export const PENDING_ACTIVATION_PREFIX=a100_0x2c6966(0x14f);export function createPendingSegmentId(_0x2a4199){return''+PENDING_SEGMENT_PREFIX+_0x2a4199+'__';}export function isPendingSegmentId(_0x570305){const _0x4c6cd8=a100_0x2c6966;return _0x570305[_0x4c6cd8(0x1bb)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x4d8cb8){const _0x3c04e3=a100_0x2c6966;return _0x4d8cb8[_0x3c04e3(0x1f6)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3ee1bb){return''+PENDING_ACTIVATION_PREFIX+_0x3ee1bb+'__';}export function isPendingActivationId(_0x547c4c){const _0x449578=a100_0x2c6966;return _0x547c4c[_0x449578(0x1bb)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x419ea8){const _0x375cd1=a100_0x2c6966;return _0x419ea8[_0x375cd1(0x1f6)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x2c3f33,_0x5c92e5){const _0xf01964=a100_0x2c6966,_0xd6acb9=_0x2c3f33+'::'+(_0x5c92e5[_0xf01964(0x1bf)]()||'segment'),_0x1a4623=createHash(_0xf01964(0x1b7))[_0xf01964(0x1a7)](_0xd6acb9)['digest']('hex')[_0xf01964(0x1e9)](0x0,0xc);return _0xf01964(0x155)+_0x1a4623;}export function ensureJourneyDefaults(_0x30dab2){const _0x5c48a9=a100_0x2c6966;!_0x30dab2[_0x5c48a9(0x132)]&&(_0x30dab2[_0x5c48a9(0x132)]=''),!_0x30dab2['state']&&(_0x30dab2['state']='draft');}export function resolveTDFolderPath(_0x37a827,_0x2115c2,_0x415fbb){const _0x4e8087=a100_0x2c6966;if(!_0x2115c2)return _0x37a827;if(_0x37a827===_0x415fbb||_0x37a827[_0x4e8087(0x1bb)](_0x415fbb+'/'))return _0x37a827;return _0x37a827?_0x415fbb+'/'+_0x37a827:_0x415fbb;}export function addFoldersToCreate(_0x168337,_0x10305f,_0x342364){const _0x1954ac=a100_0x2c6966;if(!_0x168337)return;if(_0x10305f[_0x1954ac(0x1c3)](_0x168337))return;const _0x3de62e=_0x168337[_0x1954ac(0x13a)]('/');let _0x32da81='';for(const _0x53183d of _0x3de62e){_0x32da81=_0x32da81?_0x32da81+'/'+_0x53183d:_0x53183d,!_0x10305f[_0x1954ac(0x1c3)](_0x32da81)&&_0x342364[_0x1954ac(0x18c)](_0x32da81);}}import*as a100_0x4d5033 from'yaml';import{readFileSync}from'fs';function a100_0x1a9a(_0x2c8a54,_0x3a7dd6){_0x2c8a54=_0x2c8a54-0x11e;const _0xc29c8a=a100_0xc29c();let _0x1a9af6=_0xc29c8a[_0x2c8a54];return _0x1a9af6;}import a100_0x2afdb9 from'path';import{isJourneyDef,parseYamlString as a100_0x31baf0,toYamlString as a100_0x5d57b2,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(_0x53d02c){const _0x5dde57=a100_0x2c6966;if(Array['isArray'](_0x53d02c))return'['+_0x53d02c[_0x5dde57(0x1b5)](_0xd89f45=>stableStringify(_0xd89f45))[_0x5dde57(0x120)](',')+']';if(_0x53d02c&&typeof _0x53d02c===_0x5dde57(0x1e5)){const _0x3d15dc=_0x53d02c,_0x56a4cd=Object[_0x5dde57(0x1d3)](_0x3d15dc)['sort'](),_0x353c3d=_0x56a4cd[_0x5dde57(0x1b5)](_0x59d5b2=>'\x22'+_0x59d5b2+'\x22:'+stableStringify(_0x3d15dc[_0x59d5b2]));return'{'+_0x353c3d[_0x5dde57(0x120)](',')+'}';}const _0x4de6ee=JSON[_0x5dde57(0x158)](_0x53d02c);return _0x4de6ee===undefined?_0x5dde57(0x14e):_0x4de6ee;}function activationSignature(_0x2c8f28){const _0x554f99=a100_0x2c6966,_0x4e5ccd={'connection':_0x2c8f28['connection'],..._0x2c8f28[_0x554f99(0x19b)]!==undefined&&{'all_columns':_0x2c8f28['all_columns']},..._0x2c8f28[_0x554f99(0x16d)]!==undefined&&{'columns':_0x2c8f28[_0x554f99(0x16d)]},..._0x2c8f28[_0x554f99(0x1a9)]!==undefined&&{'behavior':_0x2c8f28[_0x554f99(0x1a9)]},..._0x2c8f28[_0x554f99(0x1cb)]!==undefined&&{'schedule':_0x2c8f28[_0x554f99(0x1cb)]},..._0x2c8f28[_0x554f99(0x178)]!==undefined&&{'notification':_0x2c8f28[_0x554f99(0x178)]},..._0x2c8f28[_0x554f99(0x169)]!==undefined&&{'connector_config':_0x2c8f28[_0x554f99(0x169)]},..._0x2c8f28['activation_template_id']!==undefined&&{'activation_template_id':_0x2c8f28[_0x554f99(0x12b)]}};return stableStringify(_0x4e5ccd);}export async function prepareSegmentFiles(_0x9f9869,_0x541422,_0x5c5aab,_0x117fe8,_0x4e7b5c){const _0x1b370e=a100_0x2c6966,{activationDefToCreateRequest:_0x2dfd51}=await import('./child-segment-yaml.js'),_0x2cd76c=[],_0x5b78db=new Set();for(const {yamlConfig:_0x51d93b,folderPath:_0x354d76,sourcePath:_0xb6d58f}of _0x9f9869){const _0x57f339=resolveTDFolderPath(_0x354d76,_0x117fe8,_0x4e7b5c),_0x22797b=_0x57f339+':'+_0x51d93b[_0x1b370e(0x141)],_0x248d07=_0x541422[_0x1b370e(0x148)][_0x1b370e(0x15b)](_0x22797b),_0x36db52=_0x248d07?_0x541422['activationsBySegmentId'][_0x1b370e(0x15b)](_0x248d07['id'])||[]:[];addFoldersToCreate(_0x57f339,_0x541422[_0x1b370e(0x135)],_0x5b78db);const _0x3a9e18=calculateActivationActions(_0x51d93b[_0x1b370e(0x13d)]||[],_0x36db52,_0x541422[_0x1b370e(0x124)],_0x541422[_0x1b370e(0x1a0)]);for(const _0x1dc16e of _0x3a9e18){(_0x1dc16e[_0x1b370e(0x134)]===_0x1b370e(0x17f)||_0x1dc16e['type']===_0x1b370e(0x1a7))&&_0x1dc16e[_0x1b370e(0x1c6)]&&(_0x1dc16e[_0x1b370e(0x157)]=await _0x2dfd51(_0x1dc16e[_0x1b370e(0x1c6)],_0x5c5aab));}const _0x321633=calculateSegmentDiff(_0x51d93b,_0x248d07,_0x36db52,_0x541422['idToEmailMap'],_0x541422[_0x1b370e(0x1a0)]);_0x2cd76c[_0x1b370e(0x1e2)]({'relativePath':_0x51d93b[_0x1b370e(0x141)],'absolutePath':_0xb6d58f,'yamlConfig':_0x51d93b,'folderPath':_0x57f339,'existingSegment':_0x248d07,'existingActivations':_0x36db52,'isNew':_0x321633[_0x1b370e(0x1fe)],'hasChanges':_0x321633[_0x1b370e(0x162)],'diff':_0x321633['diff'],'activationActions':_0x3a9e18});}return{'segmentFiles':_0x2cd76c,'foldersToCreate':_0x5b78db};}export async function prepareJourneyFiles(_0x4fe46a,_0x52d7a5,_0x32b2c4,_0x1c2816){const _0x2d7eef=a100_0x2c6966,_0x511f5f=[],_0x42e692=new Set();for(const {yamlConfig:_0x2c45e6,folderPath:_0x4d34dc,sourcePath:_0x546235}of _0x4fe46a){const _0x2456e6=resolveTDFolderPath(_0x4d34dc,_0x32b2c4,_0x1c2816),_0x2b009c=_0x2456e6+':'+_0x2c45e6[_0x2d7eef(0x141)],_0x365bd3=_0x52d7a5[_0x2d7eef(0x122)][_0x2d7eef(0x15b)](_0x2b009c);let _0x5fc2a,_0xa624f1;if(_0x365bd3&&_0x365bd3[_0x2d7eef(0x1d8)]>0x0){const _0x597d89=buildLocalExpandedRuleMappings(_0x2c45e6),{createYamlContext:_0x3a8f33,prefetchJourneySegments:_0x3c5a2c}=createPushYamlContextForBundle(_0x52d7a5['deps'],_0x52d7a5['parentId'],_0x52d7a5['existingSegments'],_0x597d89,_0x52d7a5['idToEmailMap'],_0x52d7a5[_0x2d7eef(0x1a0)],_0x52d7a5[_0x2d7eef(0x1c2)],_0x52d7a5[_0x2d7eef(0x1fa)]);await _0x3c5a2c(_0x365bd3[_0x2d7eef(0x1b5)](_0x4765fb=>_0x4765fb['id']));const _0x338a28=hasMultipleVersions(_0x2c45e6),_0x142efa=async _0x221e7e=>{const _0x4b4399=_0x2d7eef,_0x504ca7=_0x52d7a5['journeyById']?.[_0x4b4399(0x15b)](_0x221e7e);if(_0x504ca7)return _0x504ca7;return _0x52d7a5[_0x4b4399(0x172)]({'journeyId':_0x221e7e,'journeyName':_0x2c45e6[_0x4b4399(0x141)],'isMultiVersion':_0x365bd3['length']>0x1});};if(_0x338a28&&_0x365bd3[_0x2d7eef(0x1d8)]>0x1){const _0x27ad1e=[];for(const _0x568071 of _0x365bd3){const _0x19eb95=_0x568071[_0x2d7eef(0x1eb)]||0x1;_0x52d7a5[_0x2d7eef(0x1b3)]?.[_0x2d7eef(0x1a7)]('Fetching\x20'+_0x2c45e6[_0x2d7eef(0x141)]+'\x20v'+_0x19eb95);const _0x4b736e=await _0x142efa(_0x568071['id']),_0x420cf8=_0x3a8f33(_0x568071['id']),_0x56f54c=await journeyResponseToDef(_0x4b736e,_0x420cf8);_0x27ad1e['push']({'item':_0x568071,'yaml':_0x56f54c});}const _0x164fe3=buildLocalRuleToNameMappingFromJourney(_0x2c45e6);_0xa624f1=buildMergedJourneyDef(_0x27ad1e,_0x164fe3);const _0x598207=Math['max'](..._0x27ad1e[_0x2d7eef(0x1b5)](_0x28f687=>_0x28f687[_0x2d7eef(0x1ce)][_0x2d7eef(0x1eb)]||0x0)),_0x122f92=_0x365bd3[_0x2d7eef(0x133)](_0x18aba3=>(_0x18aba3[_0x2d7eef(0x1eb)]||0x0)===_0x598207);_0x122f92&&(_0x52d7a5['progress']?.[_0x2d7eef(0x1a7)]('Fetching\x20'+_0x2c45e6[_0x2d7eef(0x141)]+'\x20v'+_0x598207),_0x5fc2a=await _0x142efa(_0x122f92['id']));}else{const _0x335122=_0x365bd3[_0x365bd3[_0x2d7eef(0x1d8)]-0x1];_0x52d7a5['progress']?.['update'](_0x2d7eef(0x164)+_0x2c45e6[_0x2d7eef(0x141)]),_0x5fc2a=await _0x142efa(_0x335122['id']);const _0x3dd5d4=_0x3a8f33(_0x335122['id']),_0x3b583f=await journeyResponseToDef(_0x5fc2a,_0x3dd5d4),_0x13b8df=buildLocalRuleToNameMappingFromJourney(_0x2c45e6);_0xa624f1=buildMergedJourneyDef([{'item':_0x335122,'yaml':_0x3b583f}],_0x13b8df);}}addFoldersToCreate(_0x2456e6,_0x52d7a5[_0x2d7eef(0x135)],_0x42e692);const _0x1c86c9=calculateJourneyDiff(_0x2c45e6,_0xa624f1);_0x511f5f[_0x2d7eef(0x1e2)]({'relativePath':_0x2c45e6['name'],'absolutePath':_0x546235,'yamlConfig':_0x2c45e6,'folderPath':_0x2456e6,'existingJourney':_0x5fc2a,'isNew':_0x1c86c9[_0x2d7eef(0x1fe)],'hasChanges':_0x1c86c9[_0x2d7eef(0x162)],'diff':_0x1c86c9[_0x2d7eef(0x204)]});}return{'journeyFiles':_0x511f5f,'foldersToCreate':_0x42e692};}export function calculateActivationActions(_0x10ce7d,_0x30e9d4,_0x126e7e,_0x5014ae){const _0x1fd88d=a100_0x2c6966,_0x25d527=[],_0x2b02a2=new Map();for(const _0x1cef90 of _0x30e9d4){_0x2b02a2[_0x1fd88d(0x1f0)](_0x1cef90[_0x1fd88d(0x141)],_0x1cef90);}const _0x501323=new Map();for(const _0x53699c of _0x10ce7d){_0x501323[_0x1fd88d(0x1f0)](_0x53699c[_0x1fd88d(0x141)],_0x53699c);}for(const _0x1f7b99 of _0x10ce7d){const _0x391d98=_0x2b02a2[_0x1fd88d(0x15b)](_0x1f7b99[_0x1fd88d(0x141)]);if(!_0x391d98)_0x25d527['push']({'type':_0x1fd88d(0x17f),'name':_0x1f7b99[_0x1fd88d(0x141)],'yamlActivation':_0x1f7b99});else{const _0x700ef0=activationResponseToDef(_0x391d98,_0x126e7e,_0x5014ae),_0x3e328c=a100_0x4d5033[_0x1fd88d(0x158)](_0x700ef0),_0x2f7a01=a100_0x4d5033[_0x1fd88d(0x158)](_0x1f7b99);_0x3e328c!==_0x2f7a01&&_0x25d527['push']({'type':'update','name':_0x1f7b99[_0x1fd88d(0x141)],'yamlActivation':_0x1f7b99,'existingActivation':_0x391d98});}}for(const _0x1680ac of _0x30e9d4){!_0x501323[_0x1fd88d(0x1c3)](_0x1680ac[_0x1fd88d(0x141)])&&_0x25d527[_0x1fd88d(0x1e2)]({'type':_0x1fd88d(0x1e8),'name':_0x1680ac[_0x1fd88d(0x141)],'existingActivation':_0x1680ac});}return _0x25d527;}export function calculateSegmentDiff(_0x41b2b2,_0x4572ef,_0x397fcf,_0x67cfe5,_0x51e633){const _0xfbbb91=segmentToYamlString(_0x41b2b2);if(_0x4572ef){const _0x588b10=segmentWithActivationsToYaml(_0x4572ef,_0x397fcf,undefined,_0x67cfe5,_0x51e633),_0x5eb22=segmentToYamlString(_0x588b10),_0x4b3271=generateDiff(_0x5eb22,_0xfbbb91),_0x37727a=hasChanges(_0x4b3271);return{'isNew':![],'hasChanges':_0x37727a,'diff':_0x37727a?formatDiffWithColors(_0x4b3271):undefined};}const _0x550a0a=generateDiff('',_0xfbbb91);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x550a0a)};}export function calculateJourneyDiff(_0x1bd5c2,_0x5564ea){const _0x37fc5b=normalizeJourneyDef(_0x1bd5c2,_0x1bd5c2),_0x112a57=a100_0x5d57b2(_0x37fc5b);if(_0x5564ea){const _0x211a4e=normalizeJourneyDef(_0x5564ea,_0x1bd5c2),_0x544fe7=a100_0x5d57b2(_0x211a4e),_0x3bea3b=generateDiff(_0x544fe7,_0x112a57),_0x4dd332=hasChanges(_0x3bea3b);return{'isNew':![],'hasChanges':_0x4dd332,'diff':_0x4dd332?formatDiffWithColors(_0x3bea3b):undefined};}const _0x30ffc8=generateDiff('',_0x112a57);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x30ffc8)};}export function findSegmentsToDelete(_0x24bad7,_0x5cf907,_0x449c7a,_0x32983e,_0x49518d){const _0x4cd0ac=a100_0x2c6966,_0x4f6968=new Set();for(const {yamlConfig:_0x54faf2,folderPath:_0x5c4090}of _0x5cf907){_0x4f6968[_0x4cd0ac(0x18c)](_0x5c4090+':'+_0x54faf2['name']);}return _0x24bad7[_0x4cd0ac(0x1e3)](_0x421ba0=>{const _0x555897=_0x4cd0ac,_0x475c28=_0x421ba0[_0x555897(0x126)]?_0x449c7a[_0x555897(0x15b)](_0x421ba0[_0x555897(0x126)][_0x555897(0x1a8)]())||'':'',_0x7327f1=_0x475c28+':'+_0x421ba0[_0x555897(0x141)];if(_0x4f6968[_0x555897(0x1c3)](_0x7327f1))return![];if(_0x49518d)return _0x475c28===_0x32983e||_0x475c28['startsWith'](_0x32983e+'/');return!![];});}function a100_0xc29c(){const _0x3dd3a3=['folderPathToId','643727GzppJe','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','NOT_FOUND','split','user','segments','activations','journey_updating','Activation\x20not\x20found:\x20','journeyStages','name','Updating\x20activation\x20\x27','size','folderPath','Stage\x20\x27','\x27\x20for\x20','journeys','segmentByFolderAndName','parentSegmentFolder','createdSegmentId','activation_','parse','Creating\x20activation\x20\x27','null','__pending_act_','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','129467OTiljD','getActivation','journey_creating','Deleting\x20activation\x20\x27','journey_entry_criteria_','nameToType','validatedRequest','stringify','existingSegment','parentId','get','DecisionPoint','folder_created','yamlConfig','Activation','existingActivation','connection','hasChanges','existingSegments','Fetching\x20','journey','WaitStep','activation_deleting','104462nZOFhS','connector_config','localSegmentRules','created','unchanged','columns','from','relative','):\x20','./journey-yaml.js','fetchJourney','getJourney','entryCriteria','resolveSegment','Updated\x20activation\x20\x27','reduce','notification','logSuccess','updateSegmentById','deleteActivation','segmentId','journeyBundleName','Created\x20journey\x20\x27','create','segmentNameToId','entry_criteria','Updating\x20segment\x20\x27','13997070BejPZo','entries','Failed\x20to\x20','max','rootFolderId','list','logWarning','901800dEcGrC','segment_updated','add','errors','attributes','42zrMELG','parentFolder','updateActivation','embedded_segment_creating','activation_created','activationContext','valid','deleted','createdSegmentIds','\x27\x20from\x20file:\x20','journeyId','onProgress','all_columns','JOURNEY_UPDATE_ERROR','ACTIVATION_UPDATE_ERROR','activation_updated','nameToId','connectionIdToNameMap','\x20journey\x20from\x20file:\x20','activation_deleted','createFolder','createSegment','activationActions','existingJourney','update','toString','behavior','Created\x20activation\x20\x27','deleteSegment','folderId','journeyActivationNameToId','stage\x20\x27','Entry\x20criteria:\x20','flatMap','Deleted\x20segment\x20\x27','kind','progress','exitCriterias','map','embeddedSegmentNameToId','sha1','\x0a\x20\x20','action','Updated\x20segment\x20\x27','startsWith','goal','2560272EPoOIv','listActivations','trim','updated','withProgress','activationStepsById','has','20eLjBKj','Updated\x20journey\x20\x27','yamlActivation','JOURNEY_SYNTAX_ERROR','Deleted\x20activation\x20\x27','results','logDeleted','schedule','parseDocument','Creating\x20folder\x20\x27','item','rule','INTERNAL','verbose','segment_deleted','keys','\x27\x20not\x20found\x20in\x20journey\x20\x27','milestone','idToName','embedded_activation_creating','length','segment_deleting','Created\x20folder\x20\x27','createActivation','message','\x20(referenced\x20in\x20journey\x20','logInfo','journeyActivationStepId','stages','journey_updated','push','filter',').\x20','object','sort','branches','delete','slice','folder_creating','versionNumber','\x27\x20entry\x20criteria','segment','decision_point','waitCondition','set','dirname','SEGMENT_UPDATE_ERROR','relationships','SEGMENT_NOT_FOUND','segment_updating','replace','resolveJourneyId','steps','index','journeyById','skipSegments','includes','\x20activation\x20\x27','isNew','6329742JdbQss','data','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','absolutePath','getSegment','diff','\x27\x20wait\x20condition','Name\x20has\x20already\x20been\x20taken','Journey\x20\x27','join','SEGMENT_SYNTAX_ERROR','journeyBundlesByFolderAndName','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','idToEmailMap','\x27...','segmentFolderId','effectiveFolderId','../../utils/async.js','journey_created','__pending_','activation_template_id','activation_updating','Segment\x20not\x20found:\x20','toLowerCase','createJourneySegment','\x20segment\x20from\x20file:\x20','utf-8','description','find','type'];a100_0xc29c=function(){return _0x3dd3a3;};return a100_0xc29c();}export function findJourneysToDelete(_0x405051,_0x49aed2,_0x3d10bc,_0x340576,_0x40a849){const _0x581156=a100_0x2c6966,_0x26958d=new Set();for(const {yamlConfig:_0x179b64,folderPath:_0x347a1d}of _0x49aed2){_0x26958d[_0x581156(0x18c)](_0x347a1d+':'+_0x179b64[_0x581156(0x141)]);}return _0x405051['filter'](_0x59ecc4=>{const _0x2fc9c0=_0x581156,_0x29920f=_0x59ecc4[_0x2fc9c0(0x1ac)]?_0x3d10bc[_0x2fc9c0(0x15b)](_0x59ecc4[_0x2fc9c0(0x1ac)])||'':'',_0x4234b7=_0x29920f+':'+_0x59ecc4[_0x2fc9c0(0x17d)];if(_0x26958d[_0x2fc9c0(0x1c3)](_0x4234b7))return![];if(_0x40a849)return _0x29920f===_0x340576||_0x29920f[_0x2fc9c0(0x1bb)](_0x340576+'/');return!![];});}export function buildSegmentLookupMap(_0x2fc0e8,_0x4f50ca){const _0x30352c=a100_0x2c6966,_0x40f4a3=new Map();for(const _0x1eb5b8 of _0x2fc0e8){const _0xc9af2e=_0x1eb5b8[_0x30352c(0x126)]?_0x4f50ca[_0x30352c(0x15b)](_0x1eb5b8[_0x30352c(0x126)][_0x30352c(0x1a8)]())||'':'',_0x594c86=_0xc9af2e+':'+_0x1eb5b8[_0x30352c(0x141)];_0x40f4a3[_0x30352c(0x1f0)](_0x594c86,_0x1eb5b8);}return _0x40f4a3;}export function buildSegmentNameToIdMap(_0x4f3a92){const _0x58a033=new Map();for(const _0x460379 of _0x4f3a92){_0x58a033['set'](_0x460379['name'],_0x460379['id']);}return _0x58a033;}export function buildJourneyBundleLookupMap(_0x3fc685,_0x2b4758){const _0x183acb=a100_0x2c6966,_0x2bfe73=new Map();for(const _0x2baf28 of _0x3fc685){const _0x2f9469=_0x2baf28[_0x183acb(0x1ac)]?_0x2b4758['get'](_0x2baf28[_0x183acb(0x1ac)])||'':'',_0x4a9d85=_0x2f9469+':'+_0x2baf28[_0x183acb(0x17d)];!_0x2bfe73[_0x183acb(0x1c3)](_0x4a9d85)&&_0x2bfe73[_0x183acb(0x1f0)](_0x4a9d85,[]),_0x2bfe73[_0x183acb(0x15b)](_0x4a9d85)[_0x183acb(0x1e2)](_0x2baf28);}for(const _0x23d609 of _0x2bfe73['values']()){_0x23d609[_0x183acb(0x1e6)]((_0x410ed6,_0x461477)=>(_0x410ed6['versionNumber']||0x0)-(_0x461477[_0x183acb(0x1eb)]||0x0));}return _0x2bfe73;}export function collectFoldersToCreate(_0x5769b3,_0x142782){const _0x4e296f=a100_0x2c6966,_0x566e5f=new Set();for(const _0xc6b7fb of _0x5769b3){if(!_0xc6b7fb)continue;if(_0x142782['has'](_0xc6b7fb))continue;const _0x1a47f1=_0xc6b7fb[_0x4e296f(0x13a)]('/');let _0x3ca88e='';for(const _0x4dcb45 of _0x1a47f1){_0x3ca88e=_0x3ca88e?_0x3ca88e+'/'+_0x4dcb45:_0x4dcb45,!_0x142782['has'](_0x3ca88e)&&_0x566e5f['add'](_0x3ca88e);}}return _0x566e5f;}export function parseAndClassifyYamlFiles(_0x48bb48,_0x4f4d85,_0x5992ff){const _0x48c3cf=a100_0x2c6966,_0x73cd73=[],_0x5004fc=[];for(const _0x2b6451 of _0x48bb48){const _0x58ede7=a100_0x2afdb9[_0x48c3cf(0x16f)](_0x4f4d85,a100_0x2afdb9[_0x48c3cf(0x1f1)](_0x2b6451)),_0x49ac6f=_0x58ede7==='.'?'':_0x58ede7,_0xf812d7=readFileSync(_0x2b6451,_0x48c3cf(0x131)),_0x17e0d3=a100_0x4d5033[_0x48c3cf(0x14c)](_0xf812d7);if(isJourneyDef(_0x17e0d3)){const _0x309801=a100_0x31baf0(_0xf812d7);_0x5004fc['push']({'yamlConfig':_0x309801,'folderPath':_0x49ac6f,'sourcePath':_0x2b6451});}else{if(!_0x5992ff?.[_0x48c3cf(0x1fb)]){const _0x266bf9=parseSegmentYamlFile(_0xf812d7),_0x501599=normalizeChildSegmentYaml(_0x266bf9);_0x73cd73[_0x48c3cf(0x1e2)]({'yamlConfig':_0x501599,'folderPath':_0x49ac6f,'sourcePath':_0x2b6451});}}}return{'segments':_0x73cd73,'journeys':_0x5004fc};}export function validateParsedFiles(_0x59ce4e,_0x455acd){const _0x54db29=a100_0x2c6966,_0x175b89=[];for(const {yamlConfig:_0x2cd831,sourcePath:_0x5f050d}of _0x59ce4e[_0x54db29(0x13c)]){const _0x3738e3=readFileSync(_0x5f050d,_0x54db29(0x131)),_0x34ffe7=a100_0x4d5033[_0x54db29(0x1cc)](_0x3738e3),_0x204151=validateSegmentDef(_0x2cd831,{'source':_0x3738e3,'document':_0x34ffe7});if(!_0x204151[_0x54db29(0x195)]){const _0x119c9a=a100_0x2afdb9[_0x54db29(0x16f)](_0x455acd,_0x5f050d);_0x175b89['push']({'filePath':_0x119c9a,'source':_0x3738e3,'result':_0x204151,'isJourney':![]});}}for(const {yamlConfig:_0x16e817,sourcePath:_0x35c427}of _0x59ce4e['journeys']){const _0x490a1a=readFileSync(_0x35c427,_0x54db29(0x131)),_0x3a80c0=a100_0x4d5033[_0x54db29(0x1cc)](_0x490a1a),_0x535e4d=validateJourneyDef(_0x16e817,{'source':_0x490a1a,'document':_0x3a80c0});if(!_0x535e4d['valid']){const _0x2575ee=a100_0x2afdb9[_0x54db29(0x16f)](_0x455acd,_0x35c427);_0x175b89[_0x54db29(0x1e2)]({'filePath':_0x2575ee,'source':_0x490a1a,'result':_0x535e4d,'isJourney':!![]});}}return _0x175b89;}export function formatValidationErrors(_0x33674b){const _0x665e61=a100_0x2c6966,_0x277816=[];for(const {filePath:_0xb14679,source:_0x3efd3b,result:_0x5a1f2e,isJourney:_0x43c5f5}of _0x33674b){const _0x340e8b=_0x43c5f5?_0x665e61(0x165):_0x665e61(0x1ed);_0x277816[_0x665e61(0x1e2)]('\x0a'+_0xb14679+'\x20('+_0x340e8b+_0x665e61(0x170)+_0x5a1f2e[_0x665e61(0x18d)]['length']+'\x20error(s)'),_0x277816[_0x665e61(0x1e2)](formatValidationResult(_0x5a1f2e,_0x3efd3b,_0xb14679));}return _0x277816['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x181688){const _0x76bba3=a100_0x2c6966,_0x17dda3=new Set(),_0x176165=new Map(),_0x4f4328=collectSegmentUsageCounts(_0x181688);if(_0x181688[_0x76bba3(0x13c)])for(const [_0x597bc9,_0x344055]of Object[_0x76bba3(0x184)](_0x181688['segments'])){_0x17dda3[_0x76bba3(0x18c)](_0x597bc9);if(_0x344055[_0x76bba3(0x1cf)]){const _0x441870=yamlRuleToApi(_0x344055['rule']),_0x40e8ff=apiRuleToYaml(_0x441870);_0x176165[_0x76bba3(0x1f0)](_0x597bc9,_0x40e8ff);}}const _0x48753b=new Map();let _0x47e397=0x0;for(const [_0x249246,_0x98e36f]of _0x176165){const _0x9fbda2=serializeExpandedRule(_0x98e36f,_0x176165),_0x5354be=_0x48753b[_0x76bba3(0x15b)](_0x9fbda2)||[];_0x5354be[_0x76bba3(0x1e2)]({'name':_0x249246,'index':_0x47e397}),_0x48753b[_0x76bba3(0x1f0)](_0x9fbda2,_0x5354be),_0x47e397++;}const _0x14dcac=new Map();for(const [_0x308968,_0x1acc55]of _0x48753b){const _0x1d3c5b=_0x1acc55[_0x76bba3(0x1e9)]()[_0x76bba3(0x1e6)]((_0xc91148,_0x54baf6)=>{const _0x237838=_0x76bba3,_0x267218=_0x4f4328[_0x237838(0x15b)](_0xc91148[_0x237838(0x141)])||0x0,_0xa88ab0=_0x4f4328[_0x237838(0x15b)](_0x54baf6[_0x237838(0x141)])||0x0;if(_0x267218!==_0xa88ab0)return _0xa88ab0-_0x267218;return _0xc91148[_0x237838(0x1f9)]-_0x54baf6['index'];})[_0x76bba3(0x1b5)](_0x35e4df=>_0x35e4df['name']),_0x5c3e93=[];for(const _0x1bc31f of _0x1d3c5b){const _0x5b1aa8=_0x4f4328[_0x76bba3(0x15b)](_0x1bc31f)||0x0,_0x16d6e3=Math[_0x76bba3(0x186)](_0x5b1aa8,0x1);for(let _0x4a629e=0x0;_0x4a629e<_0x16d6e3;_0x4a629e++){_0x5c3e93[_0x76bba3(0x1e2)](_0x1bc31f);}}_0x14dcac[_0x76bba3(0x1f0)](_0x308968,_0x5c3e93);}return{'existingLocalSegmentNames':_0x17dda3,'localSegmentRules':_0x176165,'localExpandedRuleToNames':_0x14dcac};}async function buildServerSegmentRuleMap(_0xe923f6,_0x3b92f2,_0x217f43,_0x31baba){const _0x16d1aa=new Map(),_0x4e8b4d=new Set(),_0x57e489=async _0x170d96=>{const _0x49dc0d=a100_0x1a9a;if(_0x4e8b4d[_0x49dc0d(0x1c3)](_0x170d96))return;_0x4e8b4d['add'](_0x170d96);let _0x37a11a=_0x217f43[_0x49dc0d(0x133)](_0x13d12f=>_0x13d12f['id']===_0x170d96);if(!_0x37a11a)try{_0x37a11a=await _0xe923f6[_0x49dc0d(0x1ed)][_0x49dc0d(0x203)](_0x3b92f2,_0x170d96);}catch{return;}if(!_0x37a11a?.[_0x49dc0d(0x1cf)])return;const _0x38766a=apiRuleToYaml(_0x37a11a[_0x49dc0d(0x1cf)]);_0x16d1aa[_0x49dc0d(0x1f0)](_0x170d96,_0x38766a);const _0x10b227=collectSegmentRefsFromRule(_0x38766a);for(const _0x2bc660 of _0x10b227){await _0x57e489(_0x2bc660);}};for(const _0x4550f5 of _0x31baba){await _0x57e489(_0x4550f5);}return _0x16d1aa;}export function createSegmentIdResolver(_0x542a50,_0x535e19){return async _0x34d329=>{const _0x2fe15d=a100_0x1a9a,_0x4a3631=_0x542a50[_0x2fe15d(0x15b)](_0x34d329);if(!_0x4a3631)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2fe15d(0x12d)+_0x34d329+_0x2fe15d(0x123)+_0x535e19+'\x27)');return _0x4a3631;};}export function extractRootFolderId(_0x47a155){const _0x33c9fd=a100_0x2c6966;return _0x47a155['relationships']?.[_0x33c9fd(0x149)]?.['data']?.['id']||_0x47a155[_0x33c9fd(0x1f3)]?.[_0x33c9fd(0x190)]?.[_0x33c9fd(0x200)]?.['id'];}export function buildConnectionMaps(_0x4189ff){const _0x5b3019=a100_0x2c6966,_0x55c0a4=new Map(),_0x2196de=new Map(),_0x5b2288=new Map();for(const _0x2c65c3 of _0x4189ff){_0x55c0a4[_0x5b3019(0x1f0)](_0x2c65c3[_0x5b3019(0x141)],parseInt(_0x2c65c3['id'],0xa)),_0x2196de[_0x5b3019(0x1f0)](_0x2c65c3['id'],_0x2c65c3[_0x5b3019(0x141)]),_0x5b2288['set'](_0x2c65c3['name'],_0x2c65c3['type']);}return{'nameToId':_0x55c0a4,'idToName':_0x2196de,'nameToType':_0x5b2288};}export function calculatePushStats(_0x5db953,_0x4c17b4,_0x99d5dd,_0x4976e8,_0x36d7fd,_0x32e070,_0x1c038f){const _0x59151=a100_0x2c6966,_0x109394=_0x5db953[_0x59151(0x1e3)](_0x420223=>_0x420223[_0x59151(0x1fe)]),_0x45d844=_0x5db953[_0x59151(0x1e3)](_0x42ccc9=>!_0x42ccc9['isNew']&&_0x42ccc9[_0x59151(0x162)]),_0x12b18f=_0x5db953[_0x59151(0x1e3)](_0xe66fbc=>!_0xe66fbc[_0x59151(0x1fe)]&&!_0xe66fbc['hasChanges']),_0x29f608=_0x32e070?_0x4976e8:[],_0x56a827=_0x4c17b4[_0x59151(0x1e3)](_0x59238d=>_0x59238d[_0x59151(0x1fe)]),_0xe2b0c=_0x4c17b4[_0x59151(0x1e3)](_0x6735a3=>!_0x6735a3[_0x59151(0x1fe)]&&_0x6735a3[_0x59151(0x162)]),_0xd17fa2=_0x4c17b4[_0x59151(0x1e3)](_0x528389=>!_0x528389[_0x59151(0x1fe)]&&!_0x528389[_0x59151(0x162)]),_0x23b378=_0x32e070?_0x36d7fd:[],_0x4a3e74=_0x5db953[_0x59151(0x1b0)](_0x5736d8=>_0x5736d8[_0x59151(0x1a5)]),_0x499e28=_0x4a3e74[_0x59151(0x1e3)](_0x1cf1d9=>_0x1cf1d9[_0x59151(0x134)]===_0x59151(0x17f)),_0x14213b=_0x4a3e74[_0x59151(0x1e3)](_0x54570c=>_0x54570c[_0x59151(0x134)]===_0x59151(0x1a7)),_0xaebe83=_0x4a3e74['filter'](_0x15b2e1=>_0x15b2e1[_0x59151(0x134)]==='delete'),_0x8130cd=Array[_0x59151(0x16e)](_0x99d5dd)['sort'](),_0x35fc6b=_0x1c038f?![]:_0x109394[_0x59151(0x1d8)]>0x0||_0x45d844[_0x59151(0x1d8)]>0x0||_0x29f608[_0x59151(0x1d8)]>0x0,_0x301fb4=_0x56a827[_0x59151(0x1d8)]>0x0||_0xe2b0c['length']>0x0||_0x23b378[_0x59151(0x1d8)]>0x0,_0xaf62ee=_0x1c038f?![]:_0x4a3e74[_0x59151(0x1d8)]>0x0,_0x55bf72=_0x8130cd[_0x59151(0x1d8)]>0x0;return{'segments':{'new':_0x109394,'changed':_0x45d844,'unchanged':_0x12b18f,'toDelete':_0x29f608},'journeys':{'new':_0x56a827,'changed':_0xe2b0c,'unchanged':_0xd17fa2,'toDelete':_0x23b378},'activations':{'all':_0x4a3e74,'toCreate':_0x499e28,'toUpdate':_0x14213b,'toDelete':_0xaebe83},'folders':{'toCreate':_0x8130cd},'counts':{'segments':{'new':_0x109394[_0x59151(0x1d8)],'changed':_0x45d844['length'],'unchanged':_0x12b18f[_0x59151(0x1d8)],'toDelete':_0x29f608[_0x59151(0x1d8)]},'journeys':{'new':_0x56a827[_0x59151(0x1d8)],'changed':_0xe2b0c[_0x59151(0x1d8)],'unchanged':_0xd17fa2['length'],'toDelete':_0x23b378[_0x59151(0x1d8)]},'activations':{'create':_0x499e28[_0x59151(0x1d8)],'update':_0x14213b[_0x59151(0x1d8)],'delete':_0xaebe83[_0x59151(0x1d8)]},'folders':_0x8130cd['length']},'hasChanges':_0x35fc6b||_0x301fb4||_0xaf62ee||_0x55bf72};}export async function buildPushExecutionContext(_0x550c3a,_0x3750fd,_0x34cdce,_0x36cd8e,_0x542c84,_0x4d35d3){const _0x10404a=a100_0x2c6966,_0x38c27a=extractRootFolderId(_0x34cdce),{pathToId:_0x540db,idToPath:_0x2f4ae1}=buildFolderMaps(_0x542c84),_0x557db4=buildSegmentNameToIdMap(_0x36cd8e),_0x43e659=new Map(),{batchAsync:_0x18790d}=await import(_0x10404a(0x128)),[_0x486eb6,_0x43da40]=await Promise['all']([_0x550c3a[_0x10404a(0x13b)]['buildUserMaps'](),_0x550c3a[_0x10404a(0x161)][_0x10404a(0x188)](),((async()=>{!_0x4d35d3&&_0x36cd8e['length']>0x0&&await _0x18790d(_0x36cd8e,async _0x19008f=>{const _0x2819e0=a100_0x1a9a,_0x27c654=await _0x550c3a['segment'][_0x2819e0(0x1be)](_0x3750fd,_0x19008f['id']);_0x43e659[_0x2819e0(0x1f0)](_0x19008f['id'],_0x27c654);});})())]),{emailToId:_0x20dec5,idToEmail:_0x586d8d}=_0x486eb6,_0x3de31b=buildConnectionMaps(_0x43da40);return{'rootFolderId':_0x38c27a,'folderPathToId':_0x540db,'folderIdToPath':_0x2f4ae1,'segmentNameToId':_0x557db4,'activationsBySegmentId':_0x43e659,'emailToIdMap':_0x20dec5,'idToEmailMap':_0x586d8d,'connectionNameToIdMap':_0x3de31b[_0x10404a(0x19f)],'connectionIdToNameMap':_0x3de31b[_0x10404a(0x1d6)],'connectionNameToTypeMap':_0x3de31b[_0x10404a(0x156)]};}export function createPushYamlContextForBundle(_0x2839fb,_0x726bdf,_0x413e7d,_0x35f02e,_0x102c17,_0x40ef97,_0x3e0075,_0x1721c2){const {existingLocalSegmentNames:_0x1c7463,localExpandedRuleToNames:_0x284dba}=_0x35f02e,_0x285720=new Set(),_0x20e751=new Map(),_0x17a420=new Map(),_0x26b65d=new Map(),_0x12b90b=createJumpTargetCache(),_0x52c99f=new Map(),_0x568233=new Map(),_0x2a0089=new Set();let _0x54ec88;const _0x5b85ff=_0x214cc9=>{const _0x4e33a4={'resolveSegment':async _0x24ffe5=>{const _0x5e9db4=a100_0x1a9a,_0x44e583=_0x26b65d[_0x5e9db4(0x15b)](_0x24ffe5);if(_0x44e583!==undefined)return{'name':_0x44e583,'isJourneyLocal':!![]};try{let _0x307394=_0x413e7d[_0x5e9db4(0x133)](_0x25dc34=>_0x25dc34['id']===_0x24ffe5);!_0x307394&&(_0x307394=await _0x2839fb[_0x5e9db4(0x1ed)][_0x5e9db4(0x203)](_0x726bdf,_0x24ffe5));const _0x22d281=generateJourneyLocalName(_0x307394[_0x5e9db4(0x141)]),_0x5e31bf=_0x307394[_0x5e9db4(0x1b2)]===SEGMENT_KIND_JOURNEY&&_0x22d281!==undefined;let _0x166f4d=_0x307394[_0x5e9db4(0x141)],_0x2b1875;if(_0x5e31bf&&_0x307394[_0x5e9db4(0x1cf)]){const _0x13c08f=apiRuleToYaml(_0x307394[_0x5e9db4(0x1cf)]);_0x568233[_0x5e9db4(0x1f0)](_0x24ffe5,_0x13c08f);const _0x7f8d46=async _0x2a1607=>{const _0x4336be=_0x5e9db4,_0xf8922=collectSegmentRefsFromRule(_0x2a1607);for(const _0x411d07 of _0xf8922){if(!_0x568233[_0x4336be(0x1c3)](_0x411d07))try{const _0x5beaeb=await _0x2839fb[_0x4336be(0x1ed)]['getSegment'](_0x726bdf,_0x411d07);if(_0x5beaeb?.[_0x4336be(0x1cf)]){const _0x4870e6=apiRuleToYaml(_0x5beaeb[_0x4336be(0x1cf)]);_0x568233['set'](_0x411d07,_0x4870e6),await _0x7f8d46(_0x4870e6);}}catch{}}};await _0x7f8d46(_0x13c08f);const _0x45e68d=serializeExpandedRule(_0x13c08f,_0x568233),_0x4f88fd=_0x284dba[_0x5e9db4(0x15b)](_0x45e68d);if(_0x4f88fd&&_0x4f88fd[_0x5e9db4(0x1d8)]>0x0){const _0x2af351=_0x20e751['get'](_0x45e68d)||0x0,_0x1c4664=_0x4f88fd[_0x2af351]||_0x4f88fd[_0x4f88fd[_0x5e9db4(0x1d8)]-0x1];_0x20e751['set'](_0x45e68d,_0x2af351+0x1),_0x166f4d=_0x1c4664,_0x285720[_0x5e9db4(0x18c)](_0x166f4d),_0x26b65d[_0x5e9db4(0x1f0)](_0x24ffe5,_0x166f4d);const _0x1feec6=await resolveRuleSegmentRefs(_0x13c08f,async _0x3adde8=>{const _0x5272dc=_0x5e9db4,_0x193cae=_0x26b65d[_0x5272dc(0x15b)](_0x3adde8);if(_0x193cae)return _0x193cae;const _0x5be809=await _0x54ec88[_0x5272dc(0x175)](_0x3adde8);return _0x5be809[_0x5272dc(0x141)];});_0x2b1875={'description':_0x307394['description'],'rule':_0x1feec6};}else{const _0x2fbbf1=_0x52c99f[_0x5e9db4(0x15b)](_0x45e68d);if(_0x2fbbf1)_0x166f4d=_0x2fbbf1,_0x26b65d['set'](_0x24ffe5,_0x166f4d);else{if(_0x22d281){let _0x2f06d2=_0x22d281,_0x136b8f=0x2;while(_0x285720[_0x5e9db4(0x1c3)](_0x2f06d2)||_0x1c7463['has'](_0x2f06d2)){_0x2f06d2=_0x22d281+'_'+_0x136b8f,_0x136b8f++;}_0x285720[_0x5e9db4(0x18c)](_0x2f06d2),_0x166f4d=_0x2f06d2;}_0x26b65d['set'](_0x24ffe5,_0x166f4d),_0x52c99f[_0x5e9db4(0x1f0)](_0x45e68d,_0x166f4d);const _0x37a15f=await resolveRuleSegmentRefs(_0x13c08f,async _0x5a48c0=>{const _0x22daff=_0x5e9db4,_0x35a6c3=_0x26b65d[_0x22daff(0x15b)](_0x5a48c0);if(_0x35a6c3)return _0x35a6c3;const _0x5bce13=await _0x54ec88[_0x22daff(0x175)](_0x5a48c0);return _0x5bce13[_0x22daff(0x141)];});_0x2b1875={'description':_0x307394['description'],'rule':_0x37a15f};}}}return{'name':_0x166f4d,'isJourneyLocal':_0x5e31bf,'definition':_0x2b1875};}catch{return{'name':_0x24ffe5,'isJourneyLocal':![]};}},'resolveActivation':async _0x474ba3=>{const _0x3f91b1=a100_0x1a9a,_0x162f00=_0x17a420[_0x3f91b1(0x15b)](_0x474ba3);if(_0x162f00!==undefined)return{'name':_0x162f00,'isJourneyLocal':!![]};try{let _0x480f05=_0x3e0075?.['get'](_0x474ba3);!_0x480f05&&(_0x480f05=await _0x2839fb[_0x3f91b1(0x165)][_0x3f91b1(0x152)](_0x214cc9,_0x474ba3));const _0x528feb=_0x480f05[_0x3f91b1(0x18e)]['activationParams'][_0x3f91b1(0x141)]||_0x474ba3,_0x52389f=sanitizeYamlKey(_0x528feb)||_0x3f91b1(0x14b)+_0x474ba3,_0x47ea7e=_0x52389f;_0x17a420[_0x3f91b1(0x1f0)](_0x474ba3,_0x47ea7e);const _0x34d30e=journeyActivationStepToYaml(_0x480f05,_0x102c17,_0x40ef97);return{'name':_0x47ea7e,'isJourneyLocal':!![],'definition':_0x34d30e};}catch{return{'name':_0x474ba3,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x508292,_0x2c401a)=>resolveJumpTarget(_0x508292,_0x2c401a,_0x12b90b,async _0x361f4f=>{const _0x128fbe=a100_0x1a9a,_0x3e1936=_0x1721c2?.[_0x128fbe(0x15b)](_0x361f4f);if(_0x3e1936)return _0x3e1936;return _0x2839fb[_0x128fbe(0x165)][_0x128fbe(0x173)](_0x361f4f);})};return _0x54ec88=_0x4e33a4,_0x4e33a4;},_0x5bffe9=async _0x107f01=>{const _0x2ff62b=a100_0x1a9a,{collectSegmentIdsFromJourneyApi:_0x30ac08}=await import(_0x2ff62b(0x171)),{batchAsync:_0x3f041b}=await import(_0x2ff62b(0x128)),_0x22ca48=new Set();for(const _0xdc2f2b of _0x107f01){let _0x36b2f6=_0x1721c2?.[_0x2ff62b(0x15b)](_0xdc2f2b);!_0x36b2f6&&(_0x36b2f6=await _0x2839fb[_0x2ff62b(0x165)][_0x2ff62b(0x173)](_0xdc2f2b));const _0x125afa=_0x30ac08(_0x36b2f6);for(const _0x43d959 of _0x125afa){_0x22ca48[_0x2ff62b(0x18c)](_0x43d959);}}let _0x976323=Array[_0x2ff62b(0x16e)](_0x22ca48);while(_0x976323[_0x2ff62b(0x1d8)]>0x0){const _0x642fdb=_0x976323[_0x2ff62b(0x1e3)](_0xdcf912=>!_0x2a0089[_0x2ff62b(0x1c3)](_0xdcf912));if(_0x642fdb[_0x2ff62b(0x1d8)]===0x0)break;const _0xb0bef9=await _0x3f041b(_0x642fdb,async _0xfd2ed6=>{const _0x41fd1d=_0x2ff62b;_0x2a0089[_0x41fd1d(0x18c)](_0xfd2ed6);let _0x3ae1ce=_0x413e7d[_0x41fd1d(0x133)](_0x1ea704=>_0x1ea704['id']===_0xfd2ed6);if(!_0x3ae1ce)try{_0x3ae1ce=await _0x2839fb['segment'][_0x41fd1d(0x203)](_0x726bdf,_0xfd2ed6);}catch{return null;}return{'segmentId':_0xfd2ed6,'segment':_0x3ae1ce};},0xa),_0xee5e1c=new Set();for(const _0x175825 of _0xb0bef9){if(!_0x175825?.[_0x2ff62b(0x1ed)]?.[_0x2ff62b(0x1cf)])continue;const _0x53f6e4=apiRuleToYaml(_0x175825[_0x2ff62b(0x1ed)][_0x2ff62b(0x1cf)]);_0x568233[_0x2ff62b(0x1f0)](_0x175825['segmentId'],_0x53f6e4);const _0x128cc1=collectSegmentRefsFromRule(_0x53f6e4);for(const _0x55e877 of _0x128cc1){!_0x2a0089[_0x2ff62b(0x1c3)](_0x55e877)&&_0xee5e1c[_0x2ff62b(0x18c)](_0x55e877);}}_0x976323=Array[_0x2ff62b(0x16e)](_0xee5e1c);}};return{'createYamlContext':_0x5b85ff,'prefetchJourneySegments':_0x5bffe9};}export async function executePushSegments(_0x3050cf,_0x35f422,_0x290fc8,_0x46be33,_0x21a96b){const _0x4bec79=a100_0x2c6966,{segmentDefToCreateRequest:_0x5bf96c,segmentDefToUpdateRequest:_0xceb7ed}=await import('./child-segment-yaml.js'),_0x33ff1e=_0x290fc8[_0x4bec79(0x135)],_0x285d2c=0x5,_0x52a029=async _0x4a5271=>{const _0xf355ff=_0x4bec79,_0x2701c4=_0x4a5271['folderPath']?_0x33ff1e['get'](_0x4a5271['folderPath']):undefined;let _0x219d53;const _0x39964a={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x4a5271['isNew']){_0x21a96b['onProgress']?.({'type':'segment_creating','name':_0x4a5271['yamlConfig']['name']});const _0x423e8e=_0x5bf96c(_0x4a5271['yamlConfig'],_0x2701c4),_0x7f2188=await _0x21a96b[_0xf355ff(0x1c1)]('Creating\x20segment\x20\x27'+_0x4a5271['yamlConfig'][_0xf355ff(0x141)]+'\x27...',()=>_0x3050cf[_0xf355ff(0x1ed)][_0xf355ff(0x1a4)](_0x46be33[_0xf355ff(0x15a)],_0x423e8e));_0x219d53=_0x7f2188[_0xf355ff(0x200)]['id'],_0x39964a[_0xf355ff(0x14a)]={'name':_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)],'id':_0x219d53},_0x21a96b[_0xf355ff(0x19a)]?.({'type':'segment_created','name':_0x4a5271['yamlConfig']['name'],'segmentId':_0x219d53}),_0x21a96b[_0xf355ff(0x179)]?.('Created\x20segment\x20\x27'+_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]+'\x27'),_0x39964a[_0xf355ff(0x16b)]=0x1;}else{if(_0x4a5271['hasChanges']){_0x21a96b['onProgress']?.({'type':_0xf355ff(0x1f5),'name':_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]});const _0x5c4258=_0xceb7ed(_0x4a5271[_0xf355ff(0x15e)]);_0x2701c4!==_0x4a5271['existingSegment']?.[_0xf355ff(0x126)]&&(_0x5c4258['segmentFolderId']=_0x2701c4?parseInt(_0x2701c4,0xa):undefined),await _0x21a96b[_0xf355ff(0x1c1)](_0xf355ff(0x182)+_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]+_0xf355ff(0x125),()=>_0x3050cf[_0xf355ff(0x1ed)][_0xf355ff(0x17a)](_0x46be33[_0xf355ff(0x15a)],_0x4a5271[_0xf355ff(0x159)]['id'],_0x5c4258)),_0x219d53=_0x4a5271[_0xf355ff(0x159)]['id'],_0x21a96b[_0xf355ff(0x19a)]?.({'type':_0xf355ff(0x18b),'name':_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]}),_0x21a96b[_0xf355ff(0x179)]?.(_0xf355ff(0x1ba)+_0x4a5271[_0xf355ff(0x15e)][_0xf355ff(0x141)]+'\x27'),_0x39964a['updated']=0x1;}else _0x219d53=_0x4a5271[_0xf355ff(0x159)]['id'];}}catch(_0x3c9986){const _0x520a4e=isHttp400Error(_0x3c9986),_0x41ae7a=_0x520a4e?ErrorCode[_0xf355ff(0x121)]:ErrorCode[_0xf355ff(0x1f2)],_0x2afff5=getErrorMessage(_0x3c9986);throw new SDKError(_0x41ae7a,_0xf355ff(0x185)+(_0x4a5271['isNew']?_0xf355ff(0x17f):_0xf355ff(0x1a7))+_0xf355ff(0x130)+_0x4a5271[_0xf355ff(0x202)]+_0xf355ff(0x1b8)+_0x2afff5,_0x3c9986);}try{const _0x5ca10f=await syncActivationsForSegment(_0x3050cf,_0x46be33[_0xf355ff(0x15a)],_0x219d53,_0x4a5271['yamlConfig'][_0xf355ff(0x141)],_0x4a5271[_0xf355ff(0x1a5)],_0x21a96b,_0x4a5271['absolutePath']);_0x39964a[_0xf355ff(0x13d)]=_0x5ca10f;}catch(_0x1fd7cc){if(_0x1fd7cc instanceof SDKError)throw _0x1fd7cc;throw new SDKError(ErrorCode[_0xf355ff(0x19d)],_0xf355ff(0x201)+_0x4a5271['yamlConfig'][_0xf355ff(0x141)]+_0xf355ff(0x198)+_0x4a5271[_0xf355ff(0x202)]+_0xf355ff(0x1b8)+getErrorMessage(_0x1fd7cc),_0x1fd7cc);}return _0x39964a;},_0x4c7465=await batchAsync(_0x35f422,_0x52a029,_0x285d2c),_0x562fa6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x19e8f4 of _0x4c7465){_0x562fa6[_0x4bec79(0x16b)]+=_0x19e8f4[_0x4bec79(0x16b)],_0x562fa6[_0x4bec79(0x1c0)]+=_0x19e8f4['updated'],_0x19e8f4[_0x4bec79(0x14a)]&&_0x562fa6[_0x4bec79(0x197)][_0x4bec79(0x1f0)](_0x19e8f4[_0x4bec79(0x14a)][_0x4bec79(0x141)],_0x19e8f4[_0x4bec79(0x14a)]['id']),_0x562fa6['activations'][_0x4bec79(0x16b)]+=_0x19e8f4[_0x4bec79(0x13d)][_0x4bec79(0x16b)],_0x562fa6[_0x4bec79(0x13d)][_0x4bec79(0x1c0)]+=_0x19e8f4[_0x4bec79(0x13d)][_0x4bec79(0x1c0)],_0x562fa6[_0x4bec79(0x13d)][_0x4bec79(0x196)]+=_0x19e8f4[_0x4bec79(0x13d)][_0x4bec79(0x196)];}return _0x562fa6;}async function syncActivationsForSegment(_0x31c8d1,_0x26b714,_0x643687,_0x1dc78e,_0x45ec5d,_0x3ffa3b,_0x4d61a4){const _0x189d60=a100_0x2c6966,_0x12a559={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1c9abc of _0x45ec5d){try{if(_0x1c9abc[_0x189d60(0x134)]===_0x189d60(0x17f)&&_0x1c9abc[_0x189d60(0x157)])_0x3ffa3b['onProgress']?.({'type':'activation_creating','segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),await _0x3ffa3b[_0x189d60(0x1c1)](_0x189d60(0x14d)+_0x1c9abc['name']+'\x27...',()=>_0x31c8d1[_0x189d60(0x1ed)][_0x189d60(0x1db)](_0x26b714,_0x643687,_0x1c9abc[_0x189d60(0x157)])),_0x3ffa3b[_0x189d60(0x19a)]?.({'type':_0x189d60(0x193),'segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),_0x3ffa3b['logSuccess']?.(_0x189d60(0x1aa)+_0x1c9abc[_0x189d60(0x141)]+'\x27'),_0x12a559[_0x189d60(0x16b)]++;else{if(_0x1c9abc[_0x189d60(0x134)]==='update'&&_0x1c9abc[_0x189d60(0x157)]&&_0x1c9abc[_0x189d60(0x160)])_0x3ffa3b['onProgress']?.({'type':_0x189d60(0x12c),'segmentName':_0x1dc78e,'activationName':_0x1c9abc['name']}),await _0x3ffa3b['withProgress'](_0x189d60(0x142)+_0x1c9abc[_0x189d60(0x141)]+'\x27...',()=>_0x31c8d1[_0x189d60(0x1ed)][_0x189d60(0x191)](_0x26b714,_0x643687,_0x1c9abc[_0x189d60(0x160)]['id'],_0x1c9abc[_0x189d60(0x157)])),_0x3ffa3b['onProgress']?.({'type':_0x189d60(0x19e),'segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),_0x3ffa3b[_0x189d60(0x179)]?.(_0x189d60(0x176)+_0x1c9abc[_0x189d60(0x141)]+'\x27'),_0x12a559[_0x189d60(0x1c0)]++;else _0x1c9abc['type']===_0x189d60(0x1e8)&&_0x1c9abc[_0x189d60(0x160)]&&(_0x3ffa3b[_0x189d60(0x19a)]?.({'type':_0x189d60(0x167),'segmentName':_0x1dc78e,'activationName':_0x1c9abc['name']}),await _0x3ffa3b[_0x189d60(0x1c1)](_0x189d60(0x154)+_0x1c9abc[_0x189d60(0x141)]+_0x189d60(0x125),()=>_0x31c8d1[_0x189d60(0x1ed)][_0x189d60(0x17b)](_0x26b714,_0x643687,_0x1c9abc[_0x189d60(0x160)]['id'])),_0x3ffa3b['onProgress']?.({'type':_0x189d60(0x1a2),'segmentName':_0x1dc78e,'activationName':_0x1c9abc[_0x189d60(0x141)]}),_0x3ffa3b[_0x189d60(0x1ca)]?.(_0x189d60(0x1c8)+_0x1c9abc[_0x189d60(0x141)]+'\x27'),_0x12a559[_0x189d60(0x196)]++);}}catch(_0x59a2e1){const _0x4bd094=isHttp400Error(_0x59a2e1),_0x2e9072=_0x4bd094?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x189d60(0x19d)],_0x36ce53=getErrorMessage(_0x59a2e1);throw new SDKError(_0x2e9072,_0x189d60(0x185)+_0x1c9abc[_0x189d60(0x134)]+_0x189d60(0x1fd)+_0x1c9abc[_0x189d60(0x141)]+_0x189d60(0x198)+_0x4d61a4+_0x189d60(0x1b8)+_0x36ce53,_0x59a2e1);}}return _0x12a559;}export async function executePushFolders(_0x5706c1,_0x566a17,_0x1396cd,_0x5e29a5,_0x388914){const _0x176c03=a100_0x2c6966,_0x42a2b1=new Map(_0x1396cd);for(const _0x371d8c of _0x566a17){const _0x4cc009=_0x371d8c[_0x176c03(0x13a)]('/'),_0xb75d00=_0x4cc009[_0x4cc009[_0x176c03(0x1d8)]-0x1],_0x36be52=_0x4cc009[_0x176c03(0x1e9)](0x0,-0x1)[_0x176c03(0x120)]('/'),_0x3c635c=_0x42a2b1[_0x176c03(0x15b)](_0x36be52);_0x388914[_0x176c03(0x19a)]?.({'type':_0x176c03(0x1ea),'folder':_0x371d8c});const _0x3c68d9={'name':_0xb75d00,'parentFolderId':_0x3c635c},_0x45881d=await _0x388914['withProgress'](_0x176c03(0x1cd)+_0x371d8c+'\x27...',()=>_0x5706c1[_0x176c03(0x1ed)][_0x176c03(0x1a3)](_0x5e29a5[_0x176c03(0x15a)],_0x3c68d9));_0x42a2b1[_0x176c03(0x1f0)](_0x371d8c,_0x45881d[_0x176c03(0x200)]['id']),_0x388914[_0x176c03(0x19a)]?.({'type':_0x176c03(0x15d),'folder':_0x371d8c,'folderId':_0x45881d[_0x176c03(0x200)]['id']}),_0x388914[_0x176c03(0x1de)]?.(_0x176c03(0x1da)+_0x371d8c+'\x27');}return _0x42a2b1;}export async function executePushSegmentDeletions(_0x431a16,_0x57e6fb,_0x58a16c){const _0x1f34b2=a100_0x2c6966;if(_0x57e6fb[_0x1f34b2(0x1d8)]===0x0)return 0x0;const {batchAsync:_0x27f931}=await import('../../utils/async.js'),_0x3425dd=0x5,_0xb7bd25=await _0x27f931(_0x57e6fb,async _0x495efd=>{const _0x457349=_0x1f34b2;return _0x58a16c[_0x457349(0x19a)]?.({'type':_0x457349(0x1d9),'name':_0x495efd['name']}),await _0x431a16['segment'][_0x457349(0x1ab)](_0x495efd['id']),_0x58a16c[_0x457349(0x19a)]?.({'type':_0x457349(0x1d2),'name':_0x495efd[_0x457349(0x141)]}),_0x58a16c[_0x457349(0x1ca)]?.(_0x457349(0x1b1)+_0x495efd[_0x457349(0x141)]+'\x27'),0x1;},_0x3425dd);return _0xb7bd25[_0x1f34b2(0x177)]((_0x2289bb,_0x516b5a)=>_0x2289bb+_0x516b5a,0x0);}export async function executePushJourneys(_0x3a8195,_0x2b0179,_0x6166f0,_0x23cf29,_0x30ff57){const _0x126740=a100_0x2c6966,{journeyDefToRequest:_0x119da5}=await import(_0x126740(0x171)),{activationDefToCreateRequest:_0x48adbe,yamlRuleToApi:_0x2a8b31,validateSegmentRule:_0x1bd02c}=await import('./child-segment-yaml.js'),_0x271ddb={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2ac277=new Map(_0x6166f0[_0x126740(0x180)]),_0x2e2139=0x5;for(let _0x593dfb=0x0;_0x593dfb<_0x2b0179['length'];_0x593dfb+=_0x2e2139){const _0x293f82=_0x2b0179[_0x126740(0x1e9)](_0x593dfb,_0x593dfb+_0x2e2139),_0xa9c5a8=await Promise['all'](_0x293f82[_0x126740(0x1b5)](async _0x975dfa=>{const _0x590bbe=_0x126740;if(!_0x975dfa['isNew']&&!_0x975dfa['hasChanges'])return{'action':_0x590bbe(0x16c),'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)],'journeyId':_0x975dfa[_0x590bbe(0x1a6)]?.['id']};const _0x56ed6c=_0x975dfa[_0x590bbe(0x144)]?_0x6166f0[_0x590bbe(0x135)][_0x590bbe(0x15b)](_0x975dfa[_0x590bbe(0x144)]):undefined;_0x30ff57['onProgress']?.({'type':_0x975dfa[_0x590bbe(0x1fe)]?_0x590bbe(0x153):_0x590bbe(0x13e),'name':_0x975dfa[_0x590bbe(0x15e)]['name']});try{const _0x3fd08b=await executeSingleJourneyPush(_0x3a8195,_0x975dfa,{..._0x6166f0,'segmentNameToId':_0x2ac277},{'parentId':_0x23cf29['parentId'],'rootFolderId':_0x23cf29[_0x590bbe(0x187)],'folderId':_0x56ed6c,'verbose':_0x23cf29[_0x590bbe(0x1d1)]},_0x30ff57,{'journeyDefToRequest':_0x119da5,'activationDefToCreateRequest':_0x48adbe,'yamlRuleToApi':_0x2a8b31,'validateSegmentRule':_0x1bd02c});for(const [_0x47fd03,_0x50d13e]of _0x3fd08b[_0x590bbe(0x1b6)]){_0x2ac277[_0x590bbe(0x1f0)](_0x47fd03,_0x50d13e),_0x271ddb['embeddedSegmentNameToId']['set'](_0x47fd03,_0x50d13e);}if(_0x3fd08b[_0x590bbe(0x1b9)]==='created')_0x30ff57[_0x590bbe(0x19a)]?.({'type':_0x590bbe(0x129),'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)],'journeyId':_0x3fd08b[_0x590bbe(0x199)]}),_0x30ff57[_0x590bbe(0x179)]?.(_0x590bbe(0x17e)+_0x975dfa[_0x590bbe(0x15e)]['name']+'\x27'),_0x271ddb['created']++;else _0x3fd08b[_0x590bbe(0x1b9)]===_0x590bbe(0x1c0)&&(_0x30ff57['onProgress']?.({'type':_0x590bbe(0x1e1),'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)]}),_0x30ff57[_0x590bbe(0x179)]?.(_0x590bbe(0x1c5)+_0x975dfa['yamlConfig']['name']+'\x27'),_0x271ddb[_0x590bbe(0x1c0)]++);return{'action':_0x3fd08b[_0x590bbe(0x1b9)],'name':_0x975dfa[_0x590bbe(0x15e)][_0x590bbe(0x141)],'journeyId':_0x3fd08b['journeyId']};}catch(_0x1ac44a){const _0x575c5c=isHttp400Error(_0x1ac44a),_0xbc6596=_0x575c5c?ErrorCode[_0x590bbe(0x1c7)]:ErrorCode[_0x590bbe(0x19c)],_0x20478d=getErrorMessage(_0x1ac44a);throw new SDKError(_0xbc6596,_0x590bbe(0x185)+(_0x975dfa['isNew']?'create':'update')+_0x590bbe(0x1a1)+_0x975dfa[_0x590bbe(0x202)]+_0x590bbe(0x1b8)+_0x20478d,_0x1ac44a);}}));_0x271ddb[_0x126740(0x1c9)][_0x126740(0x1e2)](..._0xa9c5a8);}return _0x271ddb;}async function executeSingleJourneyPush(_0x1dd739,_0x24363e,_0x12ad65,_0xebdff0,_0x59d71f,_0x43d818){const _0x836d45=a100_0x2c6966,{journeyDefToRequest:_0x233812,activationDefToCreateRequest:_0x4b7627,yamlRuleToApi:_0x4f09e3,validateSegmentRule:_0x58be5f}=_0x43d818,_0xb29fc1=new Map(),_0x1b899b=new Map(),_0x4c71cc=new Map(),_0x52ad30=new Map(),_0x448c55=new Map();let _0x1c82b5;const _0xdf1dd5=async()=>{const _0x2f19e0=a100_0x1a9a;if(_0x1c82b5)return;_0x1c82b5=new Map();if(!_0x24363e['existingJourney'])return;const _0x374860=await _0x1dd739[_0x2f19e0(0x165)][_0x2f19e0(0x1be)](_0x24363e[_0x2f19e0(0x1a6)]['id']);for(const _0x2d87e5 of _0x374860){const _0x59bd23=journeyActivationStepToYaml(_0x2d87e5,_0x12ad65['idToEmailMap'],_0x12ad65[_0x2f19e0(0x1a0)]),_0xd9fc4d=activationSignature(_0x59bd23);!_0x1c82b5['has'](_0xd9fc4d)&&_0x1c82b5[_0x2f19e0(0x1f0)](_0xd9fc4d,_0x2d87e5['id']),_0x59bd23['name']&&_0x1b899b[_0x2f19e0(0x1f0)](_0x59bd23[_0x2f19e0(0x141)],_0x2d87e5['id']);}};if(_0x24363e['existingJourney']&&_0x24363e[_0x836d45(0x15e)]['segments']){const _0x500de4=buildLocalExpandedRuleMappings(_0x24363e['yamlConfig']),_0x4ce74c=_0x500de4[_0x836d45(0x16a)];if(_0x4ce74c[_0x836d45(0x143)]>0x0){const _0x2cfe2e=new Map();for(const [_0x5a1025,_0xc6597a]of _0x4ce74c){const _0x2c2aba=serializeExpandedRule(_0xc6597a,_0x4ce74c);_0x2cfe2e[_0x836d45(0x1f0)](_0x5a1025,_0x2c2aba);}const _0x44e005=collectSegmentIdsFromJourneyApi(_0x24363e[_0x836d45(0x1a6)]);if(_0x44e005['size']>0x0){const _0xa251f8=await buildServerSegmentRuleMap(_0x1dd739,_0xebdff0[_0x836d45(0x15a)],_0x12ad65[_0x836d45(0x163)],_0x44e005);if(_0xa251f8['size']>0x0){const _0x19f5c3=new Map();for(const [_0x110359,_0x11c998]of _0xa251f8){const _0x2f2385=serializeExpandedRule(_0x11c998,_0xa251f8);!_0x19f5c3[_0x836d45(0x1c3)](_0x2f2385)&&_0x19f5c3[_0x836d45(0x1f0)](_0x2f2385,_0x110359);}for(const [_0x1701e2,_0x2176ed]of _0x2cfe2e){const _0x3e2bdc=_0x19f5c3[_0x836d45(0x15b)](_0x2176ed);_0x3e2bdc&&(_0x448c55[_0x836d45(0x1f0)](_0x1701e2,_0x3e2bdc),_0x12ad65[_0x836d45(0x180)][_0x836d45(0x1f0)](_0x1701e2,_0x3e2bdc));}}}}}const _0x107dfe={'resolveSegmentId':async _0x58dcde=>{const _0x4996ce=_0x836d45,_0x3e2e17=_0x12ad65[_0x4996ce(0x180)]['get'](_0x58dcde);if(!_0x3e2e17)throw new SDKError(ErrorCode[_0x4996ce(0x1f4)],'Segment\x20not\x20found:\x20'+_0x58dcde+_0x4996ce(0x1dd)+_0x24363e[_0x4996ce(0x15e)][_0x4996ce(0x141)]+')');return _0x3e2e17;},'resolveEmbeddedSegmentId':async(_0x2113ac,_0x21b19e)=>{const _0x1eed3b=_0x836d45,_0x1def99=_0x12ad65['segmentNameToId'][_0x1eed3b(0x15b)](_0x2113ac);if(_0x1def99)return _0x1def99;const _0x3a4cc8=_0x448c55[_0x1eed3b(0x15b)](_0x2113ac);if(_0x3a4cc8)return _0x12ad65[_0x1eed3b(0x180)][_0x1eed3b(0x1f0)](_0x2113ac,_0x3a4cc8),_0x3a4cc8;const _0x5cce52=_0x12ad65['existingSegments'][_0x1eed3b(0x133)](_0x8e34bd=>_0x8e34bd[_0x1eed3b(0x141)]===_0x2113ac);if(_0x5cce52)return _0x12ad65[_0x1eed3b(0x180)][_0x1eed3b(0x1f0)](_0x2113ac,_0x5cce52['id']),_0x5cce52['id'];if(_0x24363e[_0x1eed3b(0x1fe)]){const {stageName:_0x227c01,criteriaName:_0x334eef}=findSegmentCriteriaLocation(_0x24363e['yamlConfig'],_0x2113ac);return _0x58be5f(_0x2113ac,_0x21b19e[_0x1eed3b(0x1cf)]),_0x4c71cc['set'](_0x2113ac,{'definition':_0x21b19e,'stageName':_0x227c01,'criteriaName':_0x334eef}),createPendingSegmentId(_0x2113ac);}const _0x524087=_0x24363e[_0x1eed3b(0x1a6)]?.['id'];if(!_0x524087)throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x58be5f(_0x2113ac,_0x21b19e[_0x1eed3b(0x1cf)]);const _0x29dd1d=generateDeterministicJourneySegmentName(_0x24363e[_0x1eed3b(0x15e)][_0x1eed3b(0x141)],_0x2113ac),_0xd06867=_0x12ad65[_0x1eed3b(0x163)]['find'](_0x45caca=>_0x45caca[_0x1eed3b(0x141)]===_0x29dd1d),_0x500859=createSegmentIdResolver(_0x12ad65[_0x1eed3b(0x180)],_0x2113ac),_0x1350ac=await resolveRuleSegmentIds(_0x21b19e[_0x1eed3b(0x1cf)],_0x500859);let _0x535272;if(_0xd06867)await _0x1dd739[_0x1eed3b(0x1ed)][_0x1eed3b(0x17a)](_0xebdff0[_0x1eed3b(0x15a)],_0xd06867['id'],{'description':_0x21b19e[_0x1eed3b(0x132)]||_0x1eed3b(0x1af)+_0x2113ac,'rule':_0x4f09e3(_0x1350ac,!![]),'countPopulation':!![]}),_0x535272=_0xd06867['id'];else try{_0x535272=await _0x1dd739[_0x1eed3b(0x1ed)][_0x1eed3b(0x12f)]({'name':_0x29dd1d,'description':_0x21b19e[_0x1eed3b(0x132)]||_0x1eed3b(0x1af)+_0x2113ac,'journeyId':_0x524087,'rule':_0x4f09e3(_0x1350ac,!![]),'countPopulation':!![],'parentFolderId':_0xebdff0[_0x1eed3b(0x187)]||'','audienceId':_0xebdff0[_0x1eed3b(0x15a)]});}catch(_0x6d485d){const _0x1e1d1a=_0x6d485d instanceof Error&&_0x6d485d[_0x1eed3b(0x1dc)][_0x1eed3b(0x1fc)](_0x1eed3b(0x11e));if(_0x1e1d1a){const _0x41a950=await _0x1dd739[_0x1eed3b(0x1ed)]['listSegments'](_0xebdff0[_0x1eed3b(0x15a)]),_0x580725=_0x41a950[_0x1eed3b(0x133)](_0x50de4f=>_0x50de4f[_0x1eed3b(0x141)]===_0x29dd1d);if(_0x580725)await _0x1dd739[_0x1eed3b(0x1ed)][_0x1eed3b(0x17a)](_0xebdff0[_0x1eed3b(0x15a)],_0x580725['id'],{'description':_0x21b19e[_0x1eed3b(0x132)]||_0x1eed3b(0x1af)+_0x2113ac,'rule':_0x4f09e3(_0x1350ac,!![]),'countPopulation':!![]}),_0x535272=_0x580725['id'];else throw _0x6d485d;}else throw _0x6d485d;}return _0x12ad65[_0x1eed3b(0x180)]['set'](_0x2113ac,_0x535272),_0xb29fc1[_0x1eed3b(0x1f0)](_0x2113ac,_0x535272),_0x535272;},'resolveActivationId':async _0x5b83b3=>{const _0x58456=_0x836d45,_0x5636e9=_0x1b899b[_0x58456(0x15b)](_0x5b83b3);if(_0x5636e9)return _0x5636e9;if(_0x24363e[_0x58456(0x1a6)]){await _0xdf1dd5();const _0x5c4c1b=_0x1b899b[_0x58456(0x15b)](_0x5b83b3);if(_0x5c4c1b)return _0x5c4c1b;}throw new SDKError(ErrorCode[_0x58456(0x139)],_0x58456(0x13f)+_0x5b83b3+_0x58456(0x1dd)+_0x24363e[_0x58456(0x15e)][_0x58456(0x141)]+_0x58456(0x1e4)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x4eeab7,_0x1197ec)=>{const _0x334aa9=_0x836d45,_0x4fd6a0=_0x1b899b[_0x334aa9(0x15b)](_0x4eeab7);if(_0x4fd6a0)return _0x4fd6a0;if(_0x24363e[_0x334aa9(0x1fe)])return _0x52ad30['set'](_0x4eeab7,_0x1197ec),createPendingActivationId(_0x4eeab7);if(_0x24363e[_0x334aa9(0x1a6)]){await _0xdf1dd5();const _0x2dbf16=_0x1b899b['get'](_0x1197ec[_0x334aa9(0x141)]);if(_0x2dbf16)return _0x1b899b[_0x334aa9(0x1f0)](_0x4eeab7,_0x2dbf16),_0x2dbf16;const _0x9a9214=activationSignature(_0x1197ec),_0x25b982=_0x1c82b5?.['get'](_0x9a9214);if(_0x25b982)return _0x1b899b['set'](_0x4eeab7,_0x25b982),_0x25b982;const _0x1535d4=await _0x4b7627(_0x1197ec,_0x12ad65[_0x334aa9(0x194)]),_0x215e37=await _0x1dd739['journey'][_0x334aa9(0x1db)](_0x24363e[_0x334aa9(0x1a6)]['id'],_0x1535d4);return _0x1b899b[_0x334aa9(0x1f0)](_0x4eeab7,_0x215e37['id']),_0x215e37['id'];}throw new SDKError(ErrorCode[_0x334aa9(0x1d0)],_0x334aa9(0x138));},'resolveJourneyId':async _0x3d1d64=>{const _0xf6df62=_0x836d45;try{return await _0x1dd739['journey'][_0xf6df62(0x1f7)](_0xebdff0['parentId'],_0x3d1d64);}catch(_0x2284fd){throw new SDKError(ErrorCode['NOT_FOUND'],_0xf6df62(0x11f)+_0x3d1d64+_0xf6df62(0x137)+_0x24363e[_0xf6df62(0x15e)][_0xf6df62(0x141)]+'\x27)',_0x2284fd);}},'resolveStageId':async(_0x548589,_0x366548)=>{const _0x350c3f=_0x836d45,_0x39a6c4=await _0x1dd739[_0x350c3f(0x165)][_0x350c3f(0x173)](_0x548589),_0x67e00b=_0x39a6c4[_0x350c3f(0x18e)][_0x350c3f(0x140)][_0x350c3f(0x133)](_0x5e83b8=>_0x5e83b8['name'][_0x350c3f(0x12e)]()===_0x366548[_0x350c3f(0x12e)]());if(!_0x67e00b?.['id'])throw new SDKError(ErrorCode[_0x350c3f(0x139)],_0x350c3f(0x145)+_0x366548+_0x350c3f(0x1d4)+(_0x39a6c4['attributes']['journeyBundleName']||_0x39a6c4[_0x350c3f(0x18e)][_0x350c3f(0x141)])+'\x27');return _0x67e00b['id'];}},_0x5d41b4=await _0x233812(_0x24363e[_0x836d45(0x15e)],_0xebdff0[_0x836d45(0x15a)],_0x107dfe),_0x3bfe5e=_0xebdff0['folderId']||_0xebdff0[_0x836d45(0x187)];_0x3bfe5e&&(_0x5d41b4[_0x836d45(0x1f3)]={'parentFolder':{'data':{'id':_0x3bfe5e,'type':'folder'}}});if(_0x24363e['isNew']){if(_0x4c71cc[_0x836d45(0x143)]>0x0||_0x52ad30['size']>0x0)return await executeThreeStepJourneyCreate(_0x1dd739,_0x24363e,_0x5d41b4,{'pendingEmbeddedSegments':_0x4c71cc,'pendingEmbeddedActivations':_0x52ad30,'embeddedSegmentNameToId':_0xb29fc1,'journeyActivationNameToId':_0x1b899b},{..._0xebdff0,'effectiveFolderId':_0x3bfe5e},_0x12ad65,_0x59d71f,_0x43d818);else{ensureJourneyDefaults(_0x5d41b4[_0x836d45(0x18e)]);const _0x1cb309=await _0x1dd739[_0x836d45(0x165)][_0x836d45(0x17f)](_0x5d41b4);return{'action':'created','journeyId':_0x1cb309['id'],'embeddedSegmentNameToId':_0xb29fc1};}}else{if(_0x24363e[_0x836d45(0x162)]&&_0x24363e['existingJourney'])return ensureJourneyDefaults(_0x5d41b4[_0x836d45(0x18e)]),await _0x1dd739['journey'][_0x836d45(0x1a7)](_0x24363e[_0x836d45(0x1a6)]['id'],_0x5d41b4),{'action':_0x836d45(0x1c0),'journeyId':_0x24363e['existingJourney']['id'],'embeddedSegmentNameToId':_0xb29fc1};}return{'action':'unchanged','journeyId':_0x24363e[_0x836d45(0x1a6)]?.['id'],'embeddedSegmentNameToId':_0xb29fc1};}function findSegmentCriteriaLocation(_0x40380d,_0x2680ae){const _0x2f6b0a=a100_0x2c6966,_0x2899f2=_0x40380d[_0x2f6b0a(0x1e0)]||_0x40380d['journeys']?.[0x0]?.[_0x2f6b0a(0x1e0)]||[];let _0x5c473e='entry',_0x5953b3=_0x2680ae;const _0x3ab3cc=_0x40380d['goal']||_0x40380d[_0x2f6b0a(0x147)]?.[0x0]?.[_0x2f6b0a(0x1bc)];if(_0x3ab3cc?.[_0x2f6b0a(0x1ed)]===_0x2680ae)return{'stageName':_0x2f6b0a(0x1bc),'criteriaName':_0x3ab3cc[_0x2f6b0a(0x141)]||_0x2680ae};_0x3c73a2:for(const _0x28c213 of _0x2899f2){if(_0x28c213[_0x2f6b0a(0x181)]?.[_0x2f6b0a(0x1ed)]===_0x2680ae){_0x5c473e=_0x28c213[_0x2f6b0a(0x141)],_0x5953b3=_0x28c213[_0x2f6b0a(0x181)][_0x2f6b0a(0x141)]||_0x2680ae;break;}if(_0x28c213[_0x2f6b0a(0x1f8)])for(const _0x3ba48f of _0x28c213[_0x2f6b0a(0x1f8)]){if(_0x3ba48f[_0x2f6b0a(0x134)]===_0x2f6b0a(0x1ee)&&_0x3ba48f['with']?.[_0x2f6b0a(0x1e7)])for(const _0x15a84c of _0x3ba48f['with'][_0x2f6b0a(0x1e7)]){if(_0x15a84c[_0x2f6b0a(0x1ed)]===_0x2680ae){_0x5c473e=_0x28c213['name'],_0x5953b3=_0x15a84c[_0x2f6b0a(0x141)]||_0x2680ae;break _0x3c73a2;}}}}return{'stageName':_0x5c473e,'criteriaName':_0x5953b3};}async function executeThreeStepJourneyCreate(_0x6f0bc9,_0x5221ea,_0x4f6f91,_0x11367b,_0x21b289,_0x48d84d,_0x35e990,_0x10ab39){const _0xeb0cc8=a100_0x2c6966,{activationDefToCreateRequest:_0xcb1695,yamlRuleToApi:_0x5b0365}=_0x10ab39,{pendingEmbeddedSegments:_0x9422a,pendingEmbeddedActivations:_0x148a78,embeddedSegmentNameToId:_0x25e227}=_0x11367b,_0x49f164=JSON[_0xeb0cc8(0x14c)](JSON[_0xeb0cc8(0x158)](_0x4f6f91));ensureJourneyDefaults(_0x49f164['attributes']),stripPendingIds(_0x49f164);const _0x4fb092=await _0x6f0bc9['journey'][_0xeb0cc8(0x17f)](_0x49f164),_0x111e13=_0x4fb092['id'],_0x3c59eb=new Map();for(const _0x33de5c of _0x4fb092[_0xeb0cc8(0x18e)]['journeyStages']){_0x3c59eb[_0xeb0cc8(0x1f0)](_0x33de5c[_0xeb0cc8(0x141)][_0xeb0cc8(0x12e)](),_0x33de5c['id']);}for(const [_0x55f29c,{definition:_0x5addda}]of _0x9422a){const _0x4dd65b=generateDeterministicJourneySegmentName(_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],_0x55f29c);_0x35e990[_0xeb0cc8(0x19a)]?.({'type':_0xeb0cc8(0x192),'journeyName':_0x5221ea['yamlConfig'][_0xeb0cc8(0x141)],'segmentName':_0x55f29c});const _0x1d93fa=createSegmentIdResolver(_0x48d84d['segmentNameToId'],_0x55f29c),_0x3f093c=await resolveRuleSegmentIds(_0x5addda[_0xeb0cc8(0x1cf)],_0x1d93fa),_0x50b82c=await _0x6f0bc9['segment']['createJourneySegment']({'name':_0x4dd65b,'description':_0x5addda['description']||_0xeb0cc8(0x1af)+_0x55f29c,'journeyId':_0x111e13,'rule':_0x5b0365(_0x3f093c,!![]),'countPopulation':!![],'parentFolderId':_0x21b289[_0xeb0cc8(0x127)]||'','audienceId':_0x21b289[_0xeb0cc8(0x15a)]});_0x25e227[_0xeb0cc8(0x1f0)](_0x55f29c,_0x50b82c),_0x48d84d['segmentNameToId'][_0xeb0cc8(0x1f0)](_0x55f29c,_0x50b82c),_0x35e990[_0xeb0cc8(0x19a)]?.({'type':'embedded_segment_created','journeyName':_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],'segmentName':_0x55f29c});}const _0x423fe0=new Map();for(const [_0x59c2b2,_0x13cabf]of _0x148a78){_0x35e990['onProgress']?.({'type':_0xeb0cc8(0x1d7),'journeyName':_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],'activationName':_0x59c2b2});const _0x409241=await _0xcb1695(_0x13cabf,_0x48d84d['activationContext']),_0x4fdeb4=await _0x6f0bc9[_0xeb0cc8(0x165)][_0xeb0cc8(0x1db)](_0x111e13,_0x409241);_0x423fe0[_0xeb0cc8(0x1f0)](_0x59c2b2,_0x4fdeb4['id']),_0x11367b[_0xeb0cc8(0x1ad)][_0xeb0cc8(0x1f0)](_0x59c2b2,_0x4fdeb4['id']),_0x35e990['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x5221ea[_0xeb0cc8(0x15e)][_0xeb0cc8(0x141)],'activationName':_0x59c2b2});}const _0x2a5eb5=JSON[_0xeb0cc8(0x14c)](JSON[_0xeb0cc8(0x158)](_0x4f6f91));return _0x2a5eb5['id']=_0x111e13,ensureJourneyDefaults(_0x2a5eb5[_0xeb0cc8(0x18e)]),resolvePendingIdsInRequest(_0x2a5eb5,_0x4f6f91,_0x3c59eb,_0x25e227,_0x423fe0,_0x35e990),await _0x6f0bc9[_0xeb0cc8(0x165)][_0xeb0cc8(0x1a7)](_0x111e13,_0x2a5eb5),{'action':_0xeb0cc8(0x16b),'journeyId':_0x111e13,'embeddedSegmentNameToId':_0x25e227};}function stripPendingIds(_0x3e01da){const _0x7eb1c6=a100_0x2c6966;for(const _0x56890a of _0x3e01da[_0x7eb1c6(0x18e)][_0x7eb1c6(0x140)]||[]){_0x56890a['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x56890a[_0x7eb1c6(0x174)][_0x7eb1c6(0x17c)])&&delete _0x56890a[_0x7eb1c6(0x174)];if(_0x56890a[_0x7eb1c6(0x1f8)])for(const _0x4afc5e of Object['keys'](_0x56890a[_0x7eb1c6(0x1f8)])){const _0x50983a=_0x56890a['steps'][_0x4afc5e];_0x50983a[_0x7eb1c6(0x134)]==='Activation'&&_0x50983a[_0x7eb1c6(0x1df)]&&isPendingActivationId(_0x50983a['journeyActivationStepId'])&&(_0x50983a['journeyActivationStepId']='');if(_0x50983a[_0x7eb1c6(0x134)]===_0x7eb1c6(0x15c)&&_0x50983a[_0x7eb1c6(0x1e7)])for(const _0x2c857a of _0x50983a[_0x7eb1c6(0x1e7)]){_0x2c857a[_0x7eb1c6(0x17c)]&&isPendingSegmentId(_0x2c857a['segmentId'])&&(_0x2c857a[_0x7eb1c6(0x17c)]='');}_0x50983a[_0x7eb1c6(0x134)]==='WaitStep'&&_0x50983a[_0x7eb1c6(0x1ef)]?.['segmentId']&&isPendingSegmentId(_0x50983a['waitCondition'][_0x7eb1c6(0x17c)])&&(_0x50983a[_0x7eb1c6(0x1ef)][_0x7eb1c6(0x17c)]='');}}}function resolvePendingIdsInRequest(_0x1c9932,_0xdad995,_0xa9c69b,_0x5cf8d4,_0x5c5429,_0xddf14b){const _0x1e8877=a100_0x2c6966,_0x335053=(_0x54b476,_0x2b100b)=>{const _0x561e08=a100_0x1a9a;if(!isPendingSegmentId(_0x54b476))return _0x54b476;const _0x79946a=extractPendingSegmentName(_0x54b476),_0x3df8f7=_0x5cf8d4[_0x561e08(0x15b)](_0x79946a);return!_0x3df8f7&&_0xddf14b[_0x561e08(0x189)]?.(_0x561e08(0x150)+_0x79946a+_0x561e08(0x146)+_0x2b100b),_0x3df8f7;};if(_0x1c9932[_0x1e8877(0x18e)][_0x1e8877(0x1bc)]?.['segmentId']&&isPendingSegmentId(_0x1c9932[_0x1e8877(0x18e)][_0x1e8877(0x1bc)][_0x1e8877(0x17c)])){const _0x1f9f44=_0x335053(_0x1c9932['attributes'][_0x1e8877(0x1bc)][_0x1e8877(0x17c)],'goal\x20criteria');_0x1f9f44&&(_0x1c9932[_0x1e8877(0x18e)]['goal'][_0x1e8877(0x17c)]=_0x1f9f44);}for(const _0x476265 of _0x1c9932[_0x1e8877(0x18e)][_0x1e8877(0x140)]||[]){const _0x3aa6cb=_0xa9c69b['get'](_0x476265[_0x1e8877(0x141)][_0x1e8877(0x12e)]());_0x3aa6cb&&(_0x476265['id']=_0x3aa6cb);if(_0x476265['entryCriteria']?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x476265['entryCriteria'][_0x1e8877(0x17c)])){const _0x2e63ff=_0x335053(_0x476265[_0x1e8877(0x174)][_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265[_0x1e8877(0x141)]+_0x1e8877(0x1ec));_0x2e63ff&&(_0x476265[_0x1e8877(0x174)][_0x1e8877(0x17c)]=_0x2e63ff);}if(_0x476265[_0x1e8877(0x1b4)])for(const _0x1a923f of _0x476265['exitCriterias']){if(_0x1a923f[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x1a923f[_0x1e8877(0x17c)])){const _0x2345f8=_0x335053(_0x1a923f[_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265[_0x1e8877(0x141)]+'\x27\x20exit\x20criteria');_0x2345f8&&(_0x1a923f[_0x1e8877(0x17c)]=_0x2345f8);}}if(_0x476265[_0x1e8877(0x1d5)]?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x476265[_0x1e8877(0x1d5)][_0x1e8877(0x17c)])){const _0x131977=_0x335053(_0x476265[_0x1e8877(0x1d5)][_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265['name']+'\x27\x20milestone');_0x131977&&(_0x476265['milestone'][_0x1e8877(0x17c)]=_0x131977);}if(_0x476265[_0x1e8877(0x1f8)]){const _0x325829=_0x11ade4=>_0xdad995['attributes'][_0x1e8877(0x140)]['find'](_0x570376=>_0x570376[_0x1e8877(0x141)][_0x1e8877(0x12e)]()===_0x476265[_0x1e8877(0x141)][_0x1e8877(0x12e)]())?.[_0x1e8877(0x1f8)]?.[_0x11ade4];for(const _0x56203e of Object[_0x1e8877(0x1d3)](_0x476265[_0x1e8877(0x1f8)])){const _0x5ec06c=_0x476265[_0x1e8877(0x1f8)][_0x56203e],_0x2c32b1=_0x325829(_0x56203e);if(_0x5ec06c[_0x1e8877(0x134)]===_0x1e8877(0x15f)&&_0x5ec06c['journeyActivationStepId']&&(isPendingActivationId(_0x5ec06c['journeyActivationStepId'])||_0x5ec06c['journeyActivationStepId']==='')){if(_0x2c32b1?.['journeyActivationStepId']&&isPendingActivationId(_0x2c32b1[_0x1e8877(0x1df)])){const _0x1e50db=extractPendingActivationName(_0x2c32b1[_0x1e8877(0x1df)]),_0x23d2db=_0x5c5429['get'](_0x1e50db);_0x23d2db&&(_0x5ec06c[_0x1e8877(0x1df)]=_0x23d2db);}}if(_0x5ec06c['type']===_0x1e8877(0x15c)&&_0x5ec06c[_0x1e8877(0x1e7)]&&_0x2c32b1?.[_0x1e8877(0x1e7)])for(let _0x107c14=0x0;_0x107c14<_0x5ec06c['branches'][_0x1e8877(0x1d8)];_0x107c14++){const _0x1061f2=_0x5ec06c['branches'][_0x107c14],_0x3766a3=_0x2c32b1[_0x1e8877(0x1e7)][_0x107c14];if(_0x3766a3?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x3766a3[_0x1e8877(0x17c)])){const _0x4e99f6=_0x335053(_0x3766a3[_0x1e8877(0x17c)],'stage\x20\x27'+_0x476265[_0x1e8877(0x141)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x1061f2[_0x1e8877(0x141)]||_0x107c14)+'\x27');_0x4e99f6&&(_0x1061f2[_0x1e8877(0x17c)]=_0x4e99f6);}}if(_0x5ec06c['type']===_0x1e8877(0x166)&&_0x5ec06c[_0x1e8877(0x1ef)]?.[_0x1e8877(0x17c)]&&_0x2c32b1?.[_0x1e8877(0x1ef)]?.[_0x1e8877(0x17c)]&&isPendingSegmentId(_0x2c32b1[_0x1e8877(0x1ef)][_0x1e8877(0x17c)])){const _0x2bbda1=_0x335053(_0x2c32b1[_0x1e8877(0x1ef)][_0x1e8877(0x17c)],_0x1e8877(0x1ae)+_0x476265[_0x1e8877(0x141)]+_0x1e8877(0x205));_0x2bbda1&&(_0x5ec06c[_0x1e8877(0x1ef)][_0x1e8877(0x17c)]=_0x2bbda1);}}}}}
@@ -1 +1 @@
1
- (function(_0x17fdfd,_0x55b7eb){const _0x6104a5=a101_0x4a4d,_0x31c32f=_0x17fdfd();while(!![]){try{const _0xa8ce8=parseInt(_0x6104a5(0xa5))/0x1+-parseInt(_0x6104a5(0x99))/0x2*(-parseInt(_0x6104a5(0xa3))/0x3)+parseInt(_0x6104a5(0xa6))/0x4+-parseInt(_0x6104a5(0x9e))/0x5+-parseInt(_0x6104a5(0x9d))/0x6+-parseInt(_0x6104a5(0x9a))/0x7+-parseInt(_0x6104a5(0xa1))/0x8*(-parseInt(_0x6104a5(0xa4))/0x9);if(_0xa8ce8===_0x55b7eb)break;else _0x31c32f['push'](_0x31c32f['shift']());}catch(_0x267a9e){_0x31c32f['push'](_0x31c32f['shift']());}}}(a101_0x307b,0xca6a4));function a101_0x307b(){const _0x2ea3b2=['910556vfuaZR','4865496UnEXlI','parentFolderId','24974jpImgY','4955027unHVww','set','has','7917588ftoZoM','2033850kxrZXO','get','add','3996432fjcUMe','name','153xucXoc','9LviQfZ'];a101_0x307b=function(){return _0x2ea3b2;};return a101_0x307b();}export function buildFolderIdToPathMap(_0x256850){const _0x5c18c9=a101_0x4a4d,_0x4a37c4=new Map(),_0x1033c4=new Map();for(const _0xde9d76 of _0x256850){_0x1033c4[_0x5c18c9(0x9b)](_0xde9d76['id'],_0xde9d76);}const _0x2e66b7=new Set();for(const _0x14d583 of _0x256850){!_0x14d583[_0x5c18c9(0x98)]&&_0x2e66b7[_0x5c18c9(0xa0)](_0x14d583['id']);}function _0x45e08f(_0x18a03f){const _0x2c5655=_0x5c18c9;if(_0x4a37c4['has'](_0x18a03f['id']))return _0x4a37c4['get'](_0x18a03f['id']);if(_0x2e66b7[_0x2c5655(0x9c)](_0x18a03f['id']))return _0x4a37c4[_0x2c5655(0x9b)](_0x18a03f['id'],''),'';if(_0x18a03f[_0x2c5655(0x98)]){const _0x42c98b=_0x1033c4[_0x2c5655(0x9f)](_0x18a03f['parentFolderId']);if(_0x42c98b){const _0x55b72a=_0x45e08f(_0x42c98b),_0xd075a1=_0x55b72a?_0x55b72a+'/'+_0x18a03f[_0x2c5655(0xa2)]:_0x18a03f[_0x2c5655(0xa2)];return _0x4a37c4[_0x2c5655(0x9b)](_0x18a03f['id'],_0xd075a1),_0xd075a1;}}const _0x5823f8=_0x18a03f[_0x2c5655(0xa2)];return _0x4a37c4[_0x2c5655(0x9b)](_0x18a03f['id'],_0x5823f8),_0x5823f8;}for(const _0x443830 of _0x256850){_0x45e08f(_0x443830);}return _0x4a37c4;}function a101_0x4a4d(_0xd32013,_0x28bab4){_0xd32013=_0xd32013-0x98;const _0x307bb9=a101_0x307b();let _0x4a4d0e=_0x307bb9[_0xd32013];return _0x4a4d0e;}export function buildFolderPathToIdMap(_0x95f2be){const _0x24afdc=a101_0x4a4d,_0x3c0a51=new Map(),_0x183a0d=new Map();for(const _0x581d0d of _0x95f2be){_0x183a0d['set'](_0x581d0d['id'],_0x581d0d);}const _0x2a3ff8=new Set();for(const _0x80d749 of _0x95f2be){!_0x80d749[_0x24afdc(0x98)]&&_0x2a3ff8[_0x24afdc(0xa0)](_0x80d749['id']);}function _0x5ed6c6(_0xa7cf44){const _0x35c96f=_0x24afdc;if(_0x2a3ff8['has'](_0xa7cf44['id']))return'';if(_0xa7cf44[_0x35c96f(0x98)]){const _0x18f88e=_0x183a0d[_0x35c96f(0x9f)](_0xa7cf44[_0x35c96f(0x98)]);if(_0x18f88e){const _0x3dec75=_0x5ed6c6(_0x18f88e);return _0x3dec75?_0x3dec75+'/'+_0xa7cf44[_0x35c96f(0xa2)]:_0xa7cf44[_0x35c96f(0xa2)];}}return _0xa7cf44[_0x35c96f(0xa2)];}for(const _0x2bd5e3 of _0x95f2be){const _0x30f6b6=_0x5ed6c6(_0x2bd5e3);_0x3c0a51[_0x24afdc(0x9b)](_0x30f6b6,_0x2bd5e3['id']);}return _0x3c0a51;}export function buildFolderMaps(_0x1de4be){const _0x12cacd=a101_0x4a4d,_0x224e45=buildFolderIdToPathMap(_0x1de4be),_0x2b3c67=new Map();for(const [_0x12d4c5,_0x4d6f04]of _0x224e45){_0x2b3c67[_0x12cacd(0x9b)](_0x4d6f04,_0x12d4c5);}return{'idToPath':_0x224e45,'pathToId':_0x2b3c67};}export function getFolderPath(_0x10ec00,_0x453bd1){if(!_0x10ec00)return'';return _0x453bd1['get'](_0x10ec00)??'';}
1
+ (function(_0xe4646,_0x439e5b){const _0x5ae4c6=a101_0x5629,_0x5cb5f6=_0xe4646();while(!![]){try{const _0x5ada03=-parseInt(_0x5ae4c6(0x198))/0x1+-parseInt(_0x5ae4c6(0x190))/0x2*(-parseInt(_0x5ae4c6(0x192))/0x3)+-parseInt(_0x5ae4c6(0x199))/0x4+parseInt(_0x5ae4c6(0x18c))/0x5+parseInt(_0x5ae4c6(0x196))/0x6+-parseInt(_0x5ae4c6(0x194))/0x7+parseInt(_0x5ae4c6(0x193))/0x8;if(_0x5ada03===_0x439e5b)break;else _0x5cb5f6['push'](_0x5cb5f6['shift']());}catch(_0x3b9da0){_0x5cb5f6['push'](_0x5cb5f6['shift']());}}}(a101_0x3101,0x3c9df));export function buildFolderIdToPathMap(_0xed2ac0){const _0x54bb7c=a101_0x5629,_0x3ca991=new Map(),_0x1c06e4=new Map();for(const _0x50b138 of _0xed2ac0){_0x1c06e4['set'](_0x50b138['id'],_0x50b138);}const _0x489ccc=new Set();for(const _0x42eadd of _0xed2ac0){!_0x42eadd[_0x54bb7c(0x197)]&&_0x489ccc[_0x54bb7c(0x18d)](_0x42eadd['id']);}function _0x446e18(_0x151067){const _0x3b5f48=_0x54bb7c;if(_0x3ca991[_0x3b5f48(0x191)](_0x151067['id']))return _0x3ca991[_0x3b5f48(0x18f)](_0x151067['id']);if(_0x489ccc['has'](_0x151067['id']))return _0x3ca991[_0x3b5f48(0x195)](_0x151067['id'],''),'';if(_0x151067[_0x3b5f48(0x197)]){const _0xe8b445=_0x1c06e4[_0x3b5f48(0x18f)](_0x151067[_0x3b5f48(0x197)]);if(_0xe8b445){const _0x33682e=_0x446e18(_0xe8b445),_0x474dd7=_0x33682e?_0x33682e+'/'+_0x151067[_0x3b5f48(0x18e)]:_0x151067['name'];return _0x3ca991[_0x3b5f48(0x195)](_0x151067['id'],_0x474dd7),_0x474dd7;}}const _0x5992ce=_0x151067[_0x3b5f48(0x18e)];return _0x3ca991[_0x3b5f48(0x195)](_0x151067['id'],_0x5992ce),_0x5992ce;}for(const _0xcecefc of _0xed2ac0){_0x446e18(_0xcecefc);}return _0x3ca991;}export function buildFolderPathToIdMap(_0x2e35e2){const _0x2dd215=a101_0x5629,_0x55fe25=new Map(),_0x406835=new Map();for(const _0xabb325 of _0x2e35e2){_0x406835['set'](_0xabb325['id'],_0xabb325);}const _0x1aa482=new Set();for(const _0x5c66b0 of _0x2e35e2){!_0x5c66b0['parentFolderId']&&_0x1aa482[_0x2dd215(0x18d)](_0x5c66b0['id']);}function _0x5e216e(_0x42bfe5){const _0x3136d7=_0x2dd215;if(_0x1aa482[_0x3136d7(0x191)](_0x42bfe5['id']))return'';if(_0x42bfe5[_0x3136d7(0x197)]){const _0x262aae=_0x406835[_0x3136d7(0x18f)](_0x42bfe5['parentFolderId']);if(_0x262aae){const _0x411d87=_0x5e216e(_0x262aae);return _0x411d87?_0x411d87+'/'+_0x42bfe5[_0x3136d7(0x18e)]:_0x42bfe5['name'];}}return _0x42bfe5[_0x3136d7(0x18e)];}for(const _0x2b3149 of _0x2e35e2){const _0x13f16a=_0x5e216e(_0x2b3149);_0x55fe25['set'](_0x13f16a,_0x2b3149['id']);}return _0x55fe25;}function a101_0x5629(_0xcec7af,_0x35b2ce){_0xcec7af=_0xcec7af-0x18c;const _0x3101e7=a101_0x3101();let _0x562921=_0x3101e7[_0xcec7af];return _0x562921;}function a101_0x3101(){const _0x3b92f6=['set','565710kLFuXN','parentFolderId','214885hJRxQg','46748WRbmhq','1660435nqdZMt','add','name','get','4hwGAxE','has','464469FXIXIP','1813968Ytxekm','3415335KVMhaS'];a101_0x3101=function(){return _0x3b92f6;};return a101_0x3101();}export function buildFolderMaps(_0x1db7ce){const _0x30a84c=buildFolderIdToPathMap(_0x1db7ce),_0x509989=new Map();for(const [_0x4431ea,_0x531b4e]of _0x30a84c){_0x509989['set'](_0x531b4e,_0x4431ea);}return{'idToPath':_0x30a84c,'pathToId':_0x509989};}export function getFolderPath(_0x5f1a83,_0x3ee848){const _0x20d792=a101_0x5629;if(!_0x5f1a83)return'';return _0x3ee848[_0x20d792(0x18f)](_0x5f1a83)??'';}
@@ -1 +1 @@
1
- (function(_0x8ea438,_0x415762){const _0x1b35d6=a102_0x16b8,_0x1dcd9c=_0x8ea438();while(!![]){try{const _0x2aef0e=parseInt(_0x1b35d6(0x196))/0x1*(parseInt(_0x1b35d6(0x1ac))/0x2)+-parseInt(_0x1b35d6(0x1b0))/0x3+-parseInt(_0x1b35d6(0x19d))/0x4+-parseInt(_0x1b35d6(0x1a9))/0x5*(parseInt(_0x1b35d6(0x197))/0x6)+parseInt(_0x1b35d6(0x1aa))/0x7*(-parseInt(_0x1b35d6(0x1a7))/0x8)+parseInt(_0x1b35d6(0x1b4))/0x9+parseInt(_0x1b35d6(0x193))/0xa*(parseInt(_0x1b35d6(0x1bf))/0xb);if(_0x2aef0e===_0x415762)break;else _0x1dcd9c['push'](_0x1dcd9c['shift']());}catch(_0x3ccf1d){_0x1dcd9c['push'](_0x1dcd9c['shift']());}}}(a102_0x569f,0x71f8e));import a102_0x2cf6d2 from'path';import{parse as a102_0x33ad7e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x706630){const _0x49c209=a102_0x16b8;if(!_0x706630||_0x706630[_0x49c209(0x1b1)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x539ff4=_0x706630['trim']();if(_0x539ff4==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x706630};const _0x41bdfe=_0x539ff4['startsWith']('/')?_0x539ff4[_0x49c209(0x194)](0x1):_0x539ff4,_0x4deb63=_0x41bdfe[_0x49c209(0x1b3)]('/')[_0x49c209(0x1b2)](_0x3aacde=>_0x3aacde!=='');if(_0x4deb63[_0x49c209(0x1b7)]===0x0)throw new Error(_0x49c209(0x199));const _0x326f6d=_0x539ff4['startsWith']('/')||!isRelativePathSegment(_0x4deb63[0x0]);for(const _0x4bbf36 of _0x4deb63){validatePathSegment(_0x4bbf36);}return{'segments':_0x4deb63,'isAbsolute':_0x326f6d,'raw':_0x706630};}function isRelativePathSegment(_0x152926){return _0x152926==='.'||_0x152926==='..';}function validatePathSegment(_0x4831e9){const _0xfa6ec2=a102_0x16b8;if(_0x4831e9==='')throw new Error(_0xfa6ec2(0x1ba));if(_0x4831e9==='.'||_0x4831e9==='..')return;if(/[\x00-\x1F\x7F]/[_0xfa6ec2(0x19f)](_0x4831e9))throw new Error(_0xfa6ec2(0x195)+_0x4831e9);if(_0x4831e9!==_0x4831e9[_0xfa6ec2(0x1b1)]()){}}export function validatePath(_0x56d513){const _0x5ecc92=a102_0x16b8;if(_0x56d513[_0x5ecc92(0x1b6)]['length']===0x0&&!_0x56d513['isAbsolute'])throw new Error(_0x5ecc92(0x19c));if(_0x56d513['isAbsolute']){if(_0x56d513['segments'][0x0]==='..')throw new Error(_0x5ecc92(0x1a5));let _0x4474cb=0x0;for(const _0x4af7f8 of _0x56d513[_0x5ecc92(0x1b6)]){if(_0x4af7f8==='..'){if(_0x4474cb===0x0)throw new Error(_0x5ecc92(0x1ab));_0x4474cb--;}else _0x4af7f8!=='.'&&_0x4474cb++;}}}export function joinPaths(_0xc386eb,_0x3787a2){const _0x2f2b27=a102_0x16b8;if(!_0xc386eb||_0xc386eb==='/')return _0x3787a2;if(!_0x3787a2||_0x3787a2==='.')return _0xc386eb;if(_0x3787a2[_0x2f2b27(0x1bb)]('/'))return _0x3787a2;const _0x478b15=parsePath(_0xc386eb),_0x5afc61=parsePath(_0x3787a2),_0x544e12=[..._0x478b15[_0x2f2b27(0x1b6)]];for(const _0x1de7cb of _0x5afc61[_0x2f2b27(0x1b6)]){if(_0x1de7cb==='.')continue;else{if(_0x1de7cb==='..'){if(_0x544e12[_0x2f2b27(0x1b7)]===0x0)throw new Error(_0x2f2b27(0x1ae));_0x544e12[_0x2f2b27(0x1bc)]();}else _0x544e12['push'](_0x1de7cb);}}const _0x45fbfd=_0x544e12[_0x2f2b27(0x1b8)]('/');return _0x478b15[_0x2f2b27(0x1c2)]['startsWith']('/')?'/'+_0x45fbfd:_0x45fbfd;}export function normalizePath(_0x16c4ea){const _0x1aa507=a102_0x16b8,_0x313cd1=parsePath(_0x16c4ea),_0x4c1086=[];for(const _0x53db95 of _0x313cd1[_0x1aa507(0x1b6)]){if(_0x53db95==='.')continue;else{if(_0x53db95==='..'){if(_0x4c1086[_0x1aa507(0x1b7)]===0x0){if(_0x313cd1[_0x1aa507(0x1a6)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x4c1086[_0x1aa507(0x1a1)]('..');}else _0x4c1086[_0x4c1086['length']-0x1]==='..'?_0x4c1086['push']('..'):_0x4c1086['pop']();}else _0x4c1086[_0x1aa507(0x1a1)](_0x53db95);}}if(_0x4c1086[_0x1aa507(0x1b7)]===0x0)return _0x313cd1[_0x1aa507(0x1a6)]?'/':'.';const _0x48b7a1=_0x4c1086[_0x1aa507(0x1b8)]('/');return _0x313cd1[_0x1aa507(0x1c2)][_0x1aa507(0x1bb)]('/')?'/'+_0x48b7a1:_0x48b7a1;}export function getParentPath(_0x341466){const _0x237808=a102_0x16b8,_0x244808=parsePath(_0x341466);if(_0x244808[_0x237808(0x1b6)][_0x237808(0x1b7)]<=0x1)return'/';const _0x1d2232=_0x244808[_0x237808(0x1b6)][_0x237808(0x1af)](0x0,-0x1)['join']('/');return _0x244808[_0x237808(0x1c2)][_0x237808(0x1bb)]('/')?'/'+_0x1d2232:_0x1d2232;}export function getBaseName(_0x2e9740){const _0x240a7a=a102_0x16b8,_0x23c7bb=parsePath(_0x2e9740);return _0x23c7bb[_0x240a7a(0x1b6)][_0x23c7bb['segments'][_0x240a7a(0x1b7)]-0x1]||'';}function a102_0x569f(){const _0x38ac78=['endsWith','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','raw','.yml','20auHvOl','substring','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','603854ZpqgiS','36XZLEGh','segment','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','resolve','relative','Relative\x20path\x20cannot\x20be\x20empty','1542368lkfwex','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','test','root','push','Cannot\x20split\x20empty\x20path','exists','parent_segment','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','isAbsolute','66024DVlnaE','parse','499265UrWMUv','203MFausi','Path\x20attempts\x20to\x20navigate\x20above\x20root','2JiBWmf','name','Cannot\x20navigate\x20above\x20root','slice','151227yXoIEE','trim','filter','split','1335834RSlEWl','dirname','segments','length','join','readFile','Path\x20segment\x20cannot\x20be\x20empty','startsWith','pop','tdx.json','replace','5439533VCKwHx'];a102_0x569f=function(){return _0x38ac78;};return a102_0x569f();}function a102_0x16b8(_0x1428ce,_0x162930){_0x1428ce=_0x1428ce-0x192;const _0x569f6f=a102_0x569f();let _0x16b865=_0x569f6f[_0x1428ce];return _0x16b865;}export function isChildPath(_0x13521d,_0x52a73f){const _0x47ad6a=a102_0x16b8,_0x2eeb26=parsePath(_0x13521d),_0x31510c=parsePath(_0x52a73f);if(_0x2eeb26['segments'][_0x47ad6a(0x1b7)]<=_0x31510c[_0x47ad6a(0x1b6)][_0x47ad6a(0x1b7)])return![];for(let _0x44833e=0x0;_0x44833e<_0x31510c['segments'][_0x47ad6a(0x1b7)];_0x44833e++){if(_0x2eeb26[_0x47ad6a(0x1b6)][_0x44833e]!==_0x31510c[_0x47ad6a(0x1b6)][_0x44833e])return![];}return!![];}export function splitPath(_0x3091ae){const _0x422caa=a102_0x16b8,_0x4cd71b=parsePath(_0x3091ae);if(_0x4cd71b[_0x422caa(0x1b6)][_0x422caa(0x1b7)]===0x0)throw new Error(_0x422caa(0x1a2));if(_0x4cd71b[_0x422caa(0x1b6)]['length']===0x1)return{'parent':_0x4cd71b[_0x422caa(0x1b6)][0x0]};return{'parent':_0x4cd71b[_0x422caa(0x1b6)][0x0],'child':_0x4cd71b['segments'][_0x422caa(0x1af)](0x1)['join']('/')};}export function isYamlFilePath(_0x2692c4){const _0x118ba6=a102_0x16b8;return _0x2692c4[_0x118ba6(0x1c0)](_0x118ba6(0x192))||_0x2692c4[_0x118ba6(0x1c0)]('.yaml');}export async function resolveYamlFilePath(_0x11ea28,_0x49f4e8=nodeFileSystem){const _0x2794ed=a102_0x16b8,_0x3d5a9d=a102_0x2cf6d2[_0x2794ed(0x19a)](_0x11ea28);if(!await _0x49f4e8[_0x2794ed(0x1a3)](_0x3d5a9d))throw new Error('File\x20not\x20found:\x20'+_0x11ea28);let _0x5479c9=a102_0x2cf6d2[_0x2794ed(0x1b5)](_0x3d5a9d),_0xd2a5ae=null,_0x1dd5d3=null;const _0x43038e=a102_0x2cf6d2[_0x2794ed(0x1a8)](_0x5479c9)[_0x2794ed(0x1a0)];while(_0x5479c9!==_0x43038e){const _0x45bd13=a102_0x2cf6d2['join'](_0x5479c9,_0x2794ed(0x1bd));if(await _0x49f4e8[_0x2794ed(0x1a3)](_0x45bd13)){_0xd2a5ae=_0x45bd13,_0x1dd5d3=_0x5479c9;break;}_0x5479c9=a102_0x2cf6d2[_0x2794ed(0x1b5)](_0x5479c9);}if(!_0xd2a5ae||!_0x1dd5d3)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x11ea28);const _0x3bf96e=await _0x49f4e8['readFile'](_0xd2a5ae),_0x4f19db=JSON[_0x2794ed(0x1a8)](_0x3bf96e),_0xe899cb=_0x4f19db[_0x2794ed(0x1a4)];if(!_0xe899cb)throw new Error(_0x2794ed(0x1c1));const _0x487af4=await _0x49f4e8[_0x2794ed(0x1b9)](_0x3d5a9d),_0x38769c=a102_0x33ad7e(_0x487af4),_0x153f38=_0x38769c[_0x2794ed(0x1ad)];if(!_0x153f38)throw new Error(_0x2794ed(0x19e)+_0x11ea28);const _0x38696e=_0x38769c['type']==='journey'?'journey':_0x2794ed(0x198),_0x173d9e=a102_0x2cf6d2[_0x2794ed(0x19b)](_0x1dd5d3,_0x3d5a9d),_0x295ca3=a102_0x2cf6d2[_0x2794ed(0x1b5)](_0x173d9e),_0x1bc695=_0x295ca3==='.'?'':_0x295ca3[_0x2794ed(0x1be)](/\\/g,'/'),_0x41506a=_0x1bc695?_0xe899cb+'/'+_0x1bc695+'/'+_0x153f38:_0xe899cb+'/'+_0x153f38;return{'parentSegment':_0xe899cb,'segmentName':_0x153f38,'folderPath':_0x1bc695,'fullPath':_0x41506a,'resourceType':_0x38696e};}
1
+ (function(_0x44b29c,_0x1f33e5){const _0x3241bc=a102_0x567e,_0x3b712a=_0x44b29c();while(!![]){try{const _0x4bc0b2=parseInt(_0x3241bc(0xd9))/0x1+-parseInt(_0x3241bc(0xd7))/0x2+parseInt(_0x3241bc(0xc5))/0x3+parseInt(_0x3241bc(0xc2))/0x4*(-parseInt(_0x3241bc(0xeb))/0x5)+parseInt(_0x3241bc(0xc1))/0x6*(-parseInt(_0x3241bc(0xd2))/0x7)+-parseInt(_0x3241bc(0xda))/0x8+parseInt(_0x3241bc(0xbf))/0x9*(parseInt(_0x3241bc(0xcd))/0xa);if(_0x4bc0b2===_0x1f33e5)break;else _0x3b712a['push'](_0x3b712a['shift']());}catch(_0x5f0dcd){_0x3b712a['push'](_0x3b712a['shift']());}}}(a102_0x94e8,0x25bbf));import a102_0xa1b348 from'path';import{parse as a102_0x28c8ef}from'yaml';function a102_0x567e(_0x4e697f,_0x4dee39){_0x4e697f=_0x4e697f-0xbf;const _0x94e89d=a102_0x94e8();let _0x567e9d=_0x94e89d[_0x4e697f];return _0x567e9d;}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x3b1b14){const _0x4f8abd=a102_0x567e;if(!_0x3b1b14||_0x3b1b14[_0x4f8abd(0xe0)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x33883c=_0x3b1b14[_0x4f8abd(0xe0)]();if(_0x33883c==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x3b1b14};const _0x16a757=_0x33883c[_0x4f8abd(0xe4)]('/')?_0x33883c[_0x4f8abd(0xdf)](0x1):_0x33883c,_0x3c59d2=_0x16a757[_0x4f8abd(0xc3)]('/')[_0x4f8abd(0xe8)](_0x49c07f=>_0x49c07f!=='');if(_0x3c59d2[_0x4f8abd(0xc9)]===0x0)throw new Error(_0x4f8abd(0xc8));const _0x541db1=_0x33883c['startsWith']('/')||!isRelativePathSegment(_0x3c59d2[0x0]);for(const _0x169989 of _0x3c59d2){validatePathSegment(_0x169989);}return{'segments':_0x3c59d2,'isAbsolute':_0x541db1,'raw':_0x3b1b14};}function isRelativePathSegment(_0x1e3b65){return _0x1e3b65==='.'||_0x1e3b65==='..';}function validatePathSegment(_0x279e6a){const _0x352998=a102_0x567e;if(_0x279e6a==='')throw new Error(_0x352998(0xcb));if(_0x279e6a==='.'||_0x279e6a==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x279e6a))throw new Error(_0x352998(0xed)+_0x279e6a);if(_0x279e6a!==_0x279e6a[_0x352998(0xe0)]()){}}export function validatePath(_0x498682){const _0x41645b=a102_0x567e;if(_0x498682[_0x41645b(0xe1)][_0x41645b(0xc9)]===0x0&&!_0x498682['isAbsolute'])throw new Error(_0x41645b(0xe5));if(_0x498682[_0x41645b(0xc6)]){if(_0x498682[_0x41645b(0xe1)][0x0]==='..')throw new Error(_0x41645b(0xe9));let _0x55948c=0x0;for(const _0x30866f of _0x498682[_0x41645b(0xe1)]){if(_0x30866f==='..'){if(_0x55948c===0x0)throw new Error(_0x41645b(0xca));_0x55948c--;}else _0x30866f!=='.'&&_0x55948c++;}}}export function joinPaths(_0x140708,_0x21ce32){const _0x14d575=a102_0x567e;if(!_0x140708||_0x140708==='/')return _0x21ce32;if(!_0x21ce32||_0x21ce32==='.')return _0x140708;if(_0x21ce32['startsWith']('/'))return _0x21ce32;const _0xebb467=parsePath(_0x140708),_0x197762=parsePath(_0x21ce32),_0x467336=[..._0xebb467[_0x14d575(0xe1)]];for(const _0xdeb1d of _0x197762[_0x14d575(0xe1)]){if(_0xdeb1d==='.')continue;else{if(_0xdeb1d==='..'){if(_0x467336['length']===0x0)throw new Error(_0x14d575(0xdb));_0x467336[_0x14d575(0xd8)]();}else _0x467336[_0x14d575(0xe2)](_0xdeb1d);}}const _0x23a8ea=_0x467336[_0x14d575(0xd5)]('/');return _0xebb467[_0x14d575(0xec)][_0x14d575(0xe4)]('/')?'/'+_0x23a8ea:_0x23a8ea;}export function normalizePath(_0x23335b){const _0x354627=a102_0x567e,_0x2e9c40=parsePath(_0x23335b),_0x2e7a92=[];for(const _0x464d0d of _0x2e9c40[_0x354627(0xe1)]){if(_0x464d0d==='.')continue;else{if(_0x464d0d==='..'){if(_0x2e7a92[_0x354627(0xc9)]===0x0){if(_0x2e9c40[_0x354627(0xc6)])throw new Error(_0x354627(0xdb));_0x2e7a92[_0x354627(0xe2)]('..');}else _0x2e7a92[_0x2e7a92[_0x354627(0xc9)]-0x1]==='..'?_0x2e7a92[_0x354627(0xe2)]('..'):_0x2e7a92[_0x354627(0xd8)]();}else _0x2e7a92[_0x354627(0xe2)](_0x464d0d);}}if(_0x2e7a92[_0x354627(0xc9)]===0x0)return _0x2e9c40['isAbsolute']?'/':'.';const _0x4ed61e=_0x2e7a92[_0x354627(0xd5)]('/');return _0x2e9c40['raw'][_0x354627(0xe4)]('/')?'/'+_0x4ed61e:_0x4ed61e;}export function getParentPath(_0x5c265f){const _0x213e4d=a102_0x567e,_0x15238a=parsePath(_0x5c265f);if(_0x15238a['segments']['length']<=0x1)return'/';const _0x3690b6=_0x15238a[_0x213e4d(0xe1)]['slice'](0x0,-0x1)[_0x213e4d(0xd5)]('/');return _0x15238a[_0x213e4d(0xec)][_0x213e4d(0xe4)]('/')?'/'+_0x3690b6:_0x3690b6;}export function getBaseName(_0xcf862f){const _0x1587f1=a102_0x567e,_0x8021f6=parsePath(_0xcf862f);return _0x8021f6['segments'][_0x8021f6[_0x1587f1(0xe1)][_0x1587f1(0xc9)]-0x1]||'';}function a102_0x94e8(){const _0x3a9cce=['1349930PXfLAh','raw','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','18lrEmpU','readFile','11208DpnnOO','4jiFrPJ','split','parse','148446rtRxhG','isAbsolute','File\x20not\x20found:\x20','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','length','Path\x20attempts\x20to\x20navigate\x20above\x20root','Path\x20segment\x20cannot\x20be\x20empty','type','3341570MprnCk','segment','tdx.json','journey','endsWith','497rALVZk','.yaml','dirname','join','.yml','336794nkrxbU','pop','103624YHeXoQ','766800jBeghN','Cannot\x20navigate\x20above\x20root','root','replace','Cannot\x20split\x20empty\x20path','substring','trim','segments','push','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','startsWith','Relative\x20path\x20cannot\x20be\x20empty','resolve','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','filter','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','exists'];a102_0x94e8=function(){return _0x3a9cce;};return a102_0x94e8();}export function isChildPath(_0x47ad51,_0x51b41b){const _0x5b8a0e=a102_0x567e,_0xd27eb7=parsePath(_0x47ad51),_0x364e1d=parsePath(_0x51b41b);if(_0xd27eb7[_0x5b8a0e(0xe1)][_0x5b8a0e(0xc9)]<=_0x364e1d[_0x5b8a0e(0xe1)][_0x5b8a0e(0xc9)])return![];for(let _0x6ca322=0x0;_0x6ca322<_0x364e1d[_0x5b8a0e(0xe1)][_0x5b8a0e(0xc9)];_0x6ca322++){if(_0xd27eb7['segments'][_0x6ca322]!==_0x364e1d[_0x5b8a0e(0xe1)][_0x6ca322])return![];}return!![];}export function splitPath(_0x13326e){const _0x160193=a102_0x567e,_0x106e0c=parsePath(_0x13326e);if(_0x106e0c['segments'][_0x160193(0xc9)]===0x0)throw new Error(_0x160193(0xde));if(_0x106e0c['segments']['length']===0x1)return{'parent':_0x106e0c['segments'][0x0]};return{'parent':_0x106e0c[_0x160193(0xe1)][0x0],'child':_0x106e0c[_0x160193(0xe1)]['slice'](0x1)[_0x160193(0xd5)]('/')};}export function isYamlFilePath(_0x60662c){const _0x2b8f45=a102_0x567e;return _0x60662c[_0x2b8f45(0xd1)](_0x2b8f45(0xd6))||_0x60662c['endsWith'](_0x2b8f45(0xd3));}export async function resolveYamlFilePath(_0x25e5d6,_0x1f09eb=nodeFileSystem){const _0x225368=a102_0x567e,_0x3cff1a=a102_0xa1b348[_0x225368(0xe6)](_0x25e5d6);if(!await _0x1f09eb['exists'](_0x3cff1a))throw new Error(_0x225368(0xc7)+_0x25e5d6);let _0x195575=a102_0xa1b348[_0x225368(0xd4)](_0x3cff1a),_0x5ca6e1=null,_0x36db10=null;const _0x2a2fc2=a102_0xa1b348[_0x225368(0xc4)](_0x195575)[_0x225368(0xdc)];while(_0x195575!==_0x2a2fc2){const _0x1552d9=a102_0xa1b348[_0x225368(0xd5)](_0x195575,_0x225368(0xcf));if(await _0x1f09eb[_0x225368(0xea)](_0x1552d9)){_0x5ca6e1=_0x1552d9,_0x36db10=_0x195575;break;}_0x195575=a102_0xa1b348[_0x225368(0xd4)](_0x195575);}if(!_0x5ca6e1||!_0x36db10)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x25e5d6);const _0x3c3eaf=await _0x1f09eb[_0x225368(0xc0)](_0x5ca6e1),_0x2a1efd=JSON[_0x225368(0xc4)](_0x3c3eaf),_0x32c3da=_0x2a1efd['parent_segment'];if(!_0x32c3da)throw new Error(_0x225368(0xe7));const _0x562ab9=await _0x1f09eb[_0x225368(0xc0)](_0x3cff1a),_0x5cb609=a102_0x28c8ef(_0x562ab9),_0x21cf6f=_0x5cb609['name'];if(!_0x21cf6f)throw new Error(_0x225368(0xe3)+_0x25e5d6);const _0x4bda6a=_0x5cb609[_0x225368(0xcc)]===_0x225368(0xd0)?_0x225368(0xd0):_0x225368(0xce),_0x5de5ce=a102_0xa1b348['relative'](_0x36db10,_0x3cff1a),_0x156bd3=a102_0xa1b348['dirname'](_0x5de5ce),_0x449805=_0x156bd3==='.'?'':_0x156bd3[_0x225368(0xdd)](/\\/g,'/'),_0x8a46e3=_0x449805?_0x32c3da+'/'+_0x449805+'/'+_0x21cf6f:_0x32c3da+'/'+_0x21cf6f;return{'parentSegment':_0x32c3da,'segmentName':_0x21cf6f,'folderPath':_0x449805,'fullPath':_0x8a46e3,'resourceType':_0x4bda6a};}
@@ -1 +1 @@
1
- (function(_0x179ebe,_0x2f29ed){const _0x2110f0=a103_0x8119,_0x4f9352=_0x179ebe();while(!![]){try{const _0x21d37a=parseInt(_0x2110f0(0x103))/0x1*(parseInt(_0x2110f0(0xfa))/0x2)+-parseInt(_0x2110f0(0xf7))/0x3+-parseInt(_0x2110f0(0x102))/0x4+parseInt(_0x2110f0(0xf9))/0x5*(-parseInt(_0x2110f0(0xfe))/0x6)+parseInt(_0x2110f0(0xfd))/0x7*(-parseInt(_0x2110f0(0xf5))/0x8)+parseInt(_0x2110f0(0xf3))/0x9*(-parseInt(_0x2110f0(0x100))/0xa)+-parseInt(_0x2110f0(0xfc))/0xb*(-parseInt(_0x2110f0(0xff))/0xc);if(_0x21d37a===_0x2f29ed)break;else _0x4f9352['push'](_0x4f9352['shift']());}catch(_0x1f9813){_0x4f9352['push'](_0x4f9352['shift']());}}}(a103_0x133f,0x6438b));function a103_0x8119(_0xdd00e9,_0x36f573){_0xdd00e9=_0xdd00e9-0xf3;const _0x133f97=a103_0x133f();let _0x811919=_0x133f97[_0xdd00e9];return _0x811919;}function a103_0x133f(){const _0x1c6a05=['substring','3734320URkMlN','.\x20Parent\x20name\x20cannot\x20be\x20empty','1243452XXvQqF','indexOf','37275mjUXNK','2EVkZZY','Invalid\x20segment\x20reference\x20format:\x20','22329901lPAXgX','7DeuFee','468EAMUrt','12nfGeqI','10WErRLD','.\x20Child\x20name\x20cannot\x20be\x20empty','2913912VDObzi','633409ERZolR','554859LbzAsi'];a103_0x133f=function(){return _0x1c6a05;};return a103_0x133f();}export function parseSegmentRef(_0xf98a9d){const _0xb46775=a103_0x8119,_0x1b6098=_0xf98a9d[_0xb46775(0xf8)]('/');if(_0x1b6098===-0x1)return{'parentId':_0xf98a9d};if(_0x1b6098===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0xf98a9d+_0xb46775(0xf6));const _0x1a769f=_0xf98a9d[_0xb46775(0xf4)](0x0,_0x1b6098),_0xe09ccd=_0xf98a9d[_0xb46775(0xf4)](_0x1b6098+0x1);if(_0xe09ccd==='')throw new Error(_0xb46775(0xfb)+_0xf98a9d+_0xb46775(0x101));return{'parentId':_0x1a769f,'childId':_0xe09ccd};}
1
+ function a103_0x2933(_0x456204,_0x465d58){_0x456204=_0x456204-0x113;const _0x333640=a103_0x3336();let _0x2933a7=_0x333640[_0x456204];return _0x2933a7;}(function(_0x196070,_0x13648c){const _0x394c57=a103_0x2933,_0x2bf1f3=_0x196070();while(!![]){try{const _0x4ae25e=-parseInt(_0x394c57(0x118))/0x1+-parseInt(_0x394c57(0x115))/0x2+parseInt(_0x394c57(0x11b))/0x3+-parseInt(_0x394c57(0x113))/0x4+parseInt(_0x394c57(0x114))/0x5+-parseInt(_0x394c57(0x11e))/0x6*(-parseInt(_0x394c57(0x117))/0x7)+parseInt(_0x394c57(0x11f))/0x8;if(_0x4ae25e===_0x13648c)break;else _0x2bf1f3['push'](_0x2bf1f3['shift']());}catch(_0x131e6a){_0x2bf1f3['push'](_0x2bf1f3['shift']());}}}(a103_0x3336,0x83893));export function parseSegmentRef(_0x101c37){const _0x2b9446=a103_0x2933,_0x33e301=_0x101c37[_0x2b9446(0x119)]('/');if(_0x33e301===-0x1)return{'parentId':_0x101c37};if(_0x33e301===0x0)throw new Error(_0x2b9446(0x116)+_0x101c37+_0x2b9446(0x11c));const _0x3ded61=_0x101c37[_0x2b9446(0x11d)](0x0,_0x33e301),_0x5ced79=_0x101c37['substring'](_0x33e301+0x1);if(_0x5ced79==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x101c37+_0x2b9446(0x11a));return{'parentId':_0x3ded61,'childId':_0x5ced79};}function a103_0x3336(){const _0x2e3568=['48nxKaaD','5388608tizmcQ','4157908oeaSNg','2963030LyLRBn','371360VgXIJQ','Invalid\x20segment\x20reference\x20format:\x20','603652vEEMZo','390317vnldss','indexOf','.\x20Child\x20name\x20cannot\x20be\x20empty','594525zUsklz','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring'];a103_0x3336=function(){return _0x2e3568;};return a103_0x3336();}
@@ -1 +1 @@
1
- (function(_0x2d816a,_0x3d6542){const _0x44c5db=a104_0x578b,_0x2bebb9=_0x2d816a();while(!![]){try{const _0x38001b=parseInt(_0x44c5db(0xe5))/0x1*(-parseInt(_0x44c5db(0xc3))/0x2)+-parseInt(_0x44c5db(0xbc))/0x3*(-parseInt(_0x44c5db(0xb9))/0x4)+parseInt(_0x44c5db(0xb8))/0x5*(-parseInt(_0x44c5db(0xe0))/0x6)+parseInt(_0x44c5db(0xd7))/0x7+parseInt(_0x44c5db(0xdb))/0x8+parseInt(_0x44c5db(0xdc))/0x9+-parseInt(_0x44c5db(0xbf))/0xa;if(_0x38001b===_0x3d6542)break;else _0x2bebb9['push'](_0x2bebb9['shift']());}catch(_0x1cc33d){_0x2bebb9['push'](_0x2bebb9['shift']());}}}(a104_0x179f,0xce02d));import a104_0xf064be 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(_0x3f8b79){return _0x3f8b79['type']!=='error';}function a104_0x578b(_0x5adac1,_0xbb9f6e){_0x5adac1=_0x5adac1-0xb4;const _0x179fda=a104_0x179f();let _0x578b48=_0x179fda[_0x5adac1];return _0x578b48;}export function isScopedResolution(_0x3547ca){const _0x463c9d=a104_0x578b;return _0x3547ca[_0x463c9d(0xcf)]===_0x463c9d(0xe8)||_0x3547ca[_0x463c9d(0xcf)]===_0x463c9d(0xbb)||_0x3547ca[_0x463c9d(0xcf)]==='context';}export function getScopedDetails(_0x3e4a9f){const _0x15e90f=a104_0x578b;if(isScopedResolution(_0x3e4a9f))return{'isScoped':_0x3e4a9f['isScoped'],'scopedFolderPath':_0x3e4a9f[_0x15e90f(0xc1)]};return undefined;}async function findTdxConfigAsync(_0x230bb1,_0x1a76e4){const _0x534b06=a104_0x578b;let _0xab1683=a104_0xf064be[_0x534b06(0xb6)](_0x230bb1);const _0x43e87c=a104_0xf064be['parse'](_0xab1683)['root'];while(_0xab1683!==_0x43e87c){const _0x3a613d=a104_0xf064be[_0x534b06(0xc4)](_0xab1683,'tdx.json');if(await _0x1a76e4[_0x534b06(0xd5)](_0x3a613d))try{const _0x2c4a02=await _0x1a76e4['readFile'](_0x3a613d),_0x129335=JSON[_0x534b06(0xc5)](_0x2c4a02);if(_0x129335['parent_segment']&&typeof _0x129335['parent_segment']==='string')return{'configPath':_0x3a613d,'configDir':_0xab1683,'parentSegment':_0x129335['parent_segment']};}catch{}_0xab1683=a104_0xf064be['dirname'](_0xab1683);}return null;}function calculateScopedPath(_0x398e21,_0x3dade8){const _0x4deb16=a104_0x578b,_0x18bb49=a104_0xf064be['relative'](_0x3dade8,_0x398e21),_0x2f092f=_0x18bb49!==''&&_0x18bb49!=='.'&&!_0x18bb49[_0x4deb16(0xea)]('..');return{'isScoped':_0x2f092f,'scopedFolderPath':_0x2f092f?_0x18bb49[_0x4deb16(0xca)](/\\/g,'/'):''};}function a104_0x179f(){const _0x2e9b8e=['exists','error','11090380SWDPiX','No\x20tdx.json\x20found\x20for\x20file:\x20','parent_name','File\x20not\x20found:\x20','9506928BiOppk','13858542oKSFtJ','context','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','No\x20tdx.json\x20found','6mIxINN','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','resourceType','basename','journey','9137vIbXXi','isFile','match','directory','includes','startsWith','invalid_yaml','dirname','segment','resolve','File\x20not\x20found','8108140jQdEIJ','6113732jIJkmp','extname','file','3atWSwX','cwd','Not\x20a\x20YAML\x20file:\x20','18496490MxzuEu','trim','scopedFolderPath','folderPath','334LLnAMu','join','parse','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parentSegment','isDirectory','replace','configDir','readFile','segmentName','file_not_found','type','no_config','Parent\x20segment\x20not\x20specified','stat','isScoped','message'];a104_0x179f=function(){return _0x2e9b8e;};return a104_0x179f();}export async function resolveTarget(_0x2038af){const _0x217dc2=a104_0x578b,{arg:_0x5e89fc,contextParent:_0xcfcfae,cwd:cwd=process[_0x217dc2(0xbd)](),fs:fs=nodeFileSystem}=_0x2038af;if(_0x5e89fc&&isYamlFilePath(_0x5e89fc))try{const _0x472ea6=await resolveYamlFilePath(_0x5e89fc,fs),_0x3cc29c=a104_0xf064be['resolve'](_0x5e89fc),_0x57b46f=a104_0xf064be[_0x217dc2(0xb4)](_0x3cc29c),_0x3a472e=await findTdxConfigAsync(_0x57b46f,fs);if(!_0x3a472e){if(_0xcfcfae){const _0x4b5bd0=a104_0xf064be['dirname'](_0x3cc29c);return{'type':_0x217dc2(0xbb),'parentName':_0xcfcfae,'targetDir':_0x4b5bd0,'configRoot':_0x4b5bd0,'filePath':_0x3cc29c,'resourceName':_0x472ea6[_0x217dc2(0xcd)],'folderPath':_0x472ea6[_0x217dc2(0xc2)],'resourceType':_0x472ea6[_0x217dc2(0xe2)],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x217dc2(0xd0),'message':_0x217dc2(0xd8)+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xde)};}const _0x5d8dde=calculateScopedPath(_0x57b46f,_0x3a472e[_0x217dc2(0xcb)]);return{'type':'file','parentName':_0x3a472e[_0x217dc2(0xc8)],'targetDir':_0x3a472e[_0x217dc2(0xcb)],'configRoot':_0x3a472e['configDir'],'filePath':_0x3cc29c,'resourceName':_0x472ea6[_0x217dc2(0xcd)],'folderPath':_0x472ea6['folderPath'],'resourceType':_0x472ea6[_0x217dc2(0xe2)],'isScoped':_0x5d8dde[_0x217dc2(0xd3)],'scopedFolderPath':_0x5d8dde[_0x217dc2(0xc1)]};}catch(_0x410cbb){const _0x28aa7b=_0x410cbb instanceof Error?_0x410cbb[_0x217dc2(0xd4)]:String(_0x410cbb);if(_0x28aa7b[_0x217dc2(0xe9)](_0x217dc2(0xb7)))return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xce),'message':_0x217dc2(0xda)+_0x5e89fc,'arg':_0x5e89fc};if(_0x28aa7b[_0x217dc2(0xe9)](_0x217dc2(0xdf))){if(_0xcfcfae){const _0x351ea8=a104_0xf064be[_0x217dc2(0xb6)](_0x5e89fc);if(await fs['exists'](_0x351ea8)){const _0x1e20ba=a104_0xf064be[_0x217dc2(0xb4)](_0x351ea8),_0x5ef000=await fs[_0x217dc2(0xcc)](_0x351ea8),_0x3bb633=_0x5ef000['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x19eba4=_0x5ef000[_0x217dc2(0xe7)](/^type:\s*["']?([^"'\n]+)["']?/m),_0xb51e44=_0x3bb633?_0x3bb633[0x1]['trim']():a104_0xf064be[_0x217dc2(0xe3)](_0x5e89fc,a104_0xf064be[_0x217dc2(0xba)](_0x5e89fc)),_0x51cf49=_0x19eba4&&_0x19eba4[0x1][_0x217dc2(0xc0)]()===_0x217dc2(0xe4)?'journey':_0x217dc2(0xb5);return{'type':_0x217dc2(0xbb),'parentName':_0xcfcfae,'targetDir':_0x1e20ba,'configRoot':_0x1e20ba,'filePath':_0x351ea8,'resourceName':_0xb51e44,'folderPath':'','resourceType':_0x51cf49,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xd0),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xde)};}return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xeb),'message':_0x28aa7b,'arg':_0x5e89fc};}if(_0x5e89fc){const _0x1a6326=a104_0xf064be[_0x217dc2(0xb6)](cwd,_0x5e89fc);let _0x2640d0=null;try{_0x2640d0=await fs[_0x217dc2(0xd2)](_0x1a6326);}catch{}if(_0x2640d0?.[_0x217dc2(0xc9)]()){const _0x381b8e=await findTdxConfigAsync(_0x1a6326,fs);if(_0x381b8e){const _0x4a0e74=calculateScopedPath(_0x1a6326,_0x381b8e[_0x217dc2(0xcb)]);return{'type':'directory','parentName':_0x381b8e['parentSegment'],'targetDir':_0x1a6326,'configRoot':_0x381b8e[_0x217dc2(0xcb)],'isScoped':_0x4a0e74[_0x217dc2(0xd3)],'scopedFolderPath':_0x4a0e74[_0x217dc2(0xc1)]};}if(_0xcfcfae)return{'type':_0x217dc2(0xe8),'parentName':_0xcfcfae,'targetDir':_0x1a6326,'configRoot':_0x1a6326,'isScoped':![],'scopedFolderPath':''};return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xd0),'message':_0x217dc2(0xc7)+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xde)};}if(_0x2640d0?.[_0x217dc2(0xe6)]())return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xeb),'message':_0x217dc2(0xbe)+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xc6)};const _0x19c8a5=sanitizeFileName(_0x5e89fc),_0x18a0f5=getSegmentRootDir(_0x19c8a5,cwd);return{'type':_0x217dc2(0xd9),'parentName':_0x5e89fc,'targetDir':_0x18a0f5,'configRoot':_0x18a0f5};}const _0x477ca3=await findTdxConfigAsync(cwd,fs);if(_0x477ca3){const _0x4e0404=calculateScopedPath(cwd,_0x477ca3['configDir']);return{'type':_0x217dc2(0xdd),'parentName':_0x477ca3[_0x217dc2(0xc8)],'targetDir':cwd,'configRoot':_0x477ca3[_0x217dc2(0xcb)],'isScoped':_0x4e0404[_0x217dc2(0xd3)],'scopedFolderPath':_0x4e0404[_0x217dc2(0xc1)]};}if(_0xcfcfae){const _0x532f91=sanitizeFileName(_0xcfcfae),_0x21c6da=getSegmentRootDir(_0x532f91,cwd);return{'type':_0x217dc2(0xdd),'parentName':_0xcfcfae,'targetDir':_0x21c6da,'configRoot':_0x21c6da,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':'no_parent','message':_0x217dc2(0xd1),'helpText':_0x217dc2(0xe1)};}
1
+ (function(_0x20e867,_0x55e60b){const _0x4dcd7a=a104_0x1ed7,_0x117659=_0x20e867();while(!![]){try{const _0x57faac=parseInt(_0x4dcd7a(0x141))/0x1*(parseInt(_0x4dcd7a(0x14e))/0x2)+-parseInt(_0x4dcd7a(0x13b))/0x3*(parseInt(_0x4dcd7a(0x118))/0x4)+-parseInt(_0x4dcd7a(0x128))/0x5+parseInt(_0x4dcd7a(0x13a))/0x6*(-parseInt(_0x4dcd7a(0x12c))/0x7)+parseInt(_0x4dcd7a(0x135))/0x8*(-parseInt(_0x4dcd7a(0x13c))/0x9)+parseInt(_0x4dcd7a(0x124))/0xa+-parseInt(_0x4dcd7a(0x133))/0xb*(-parseInt(_0x4dcd7a(0x126))/0xc);if(_0x57faac===_0x55e60b)break;else _0x117659['push'](_0x117659['shift']());}catch(_0x3b831d){_0x117659['push'](_0x117659['shift']());}}}(a104_0x1a36,0xa2ce5));import a104_0x195a8e 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(_0x3f926b){const _0xb375d5=a104_0x1ed7;return _0x3f926b[_0xb375d5(0x14a)]!=='error';}export function isScopedResolution(_0x18cd5d){const _0x239f5c=a104_0x1ed7;return _0x18cd5d[_0x239f5c(0x14a)]==='directory'||_0x18cd5d[_0x239f5c(0x14a)]===_0x239f5c(0x12e)||_0x18cd5d[_0x239f5c(0x14a)]===_0x239f5c(0x13d);}function a104_0x1a36(){const _0xd04229=['directory','Parent\x20segment\x20not\x20specified','parentSegment','Not\x20a\x20YAML\x20file:\x20','isDirectory','no_config','1933940bfqHRB','exists','1668GqlLSg','no_parent','6035000fFWqFG','isScoped','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','resolve','7yfNnle','extname','file','dirname','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','relative','journey','309397TRLWSj','folderPath','529248VGVLCr','resourceType','trim','segmentName','root','5937528NIZcUb','12goYVJh','180AEAEKN','context','readFile','segment','error','30hXlNJM','basename','cwd','parse','File\x20not\x20found','parent_segment','replace','invalid_yaml','scopedFolderPath','type','configDir','file_not_found','match','33574uFDBRu','No\x20tdx.json\x20found','string','includes','420096jFOsWv','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','join','isFile','No\x20tdx.json\x20found\x20for\x20file:\x20','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'];a104_0x1a36=function(){return _0xd04229;};return a104_0x1a36();}export function getScopedDetails(_0x279df9){const _0x320711=a104_0x1ed7;if(isScopedResolution(_0x279df9))return{'isScoped':_0x279df9[_0x320711(0x129)],'scopedFolderPath':_0x279df9[_0x320711(0x149)]};return undefined;}function a104_0x1ed7(_0x21bf13,_0x2db8c0){_0x21bf13=_0x21bf13-0x118;const _0x1a36f5=a104_0x1a36();let _0x1ed7fa=_0x1a36f5[_0x21bf13];return _0x1ed7fa;}async function findTdxConfigAsync(_0x210385,_0x2de6df){const _0x5bc83a=a104_0x1ed7;let _0x1f11c8=a104_0x195a8e[_0x5bc83a(0x12b)](_0x210385);const _0xb3f346=a104_0x195a8e[_0x5bc83a(0x144)](_0x1f11c8)[_0x5bc83a(0x139)];while(_0x1f11c8!==_0xb3f346){const _0x41f2ae=a104_0x195a8e[_0x5bc83a(0x11a)](_0x1f11c8,'tdx.json');if(await _0x2de6df[_0x5bc83a(0x125)](_0x41f2ae))try{const _0x180b98=await _0x2de6df[_0x5bc83a(0x13e)](_0x41f2ae),_0x2c7600=JSON[_0x5bc83a(0x144)](_0x180b98);if(_0x2c7600[_0x5bc83a(0x146)]&&typeof _0x2c7600[_0x5bc83a(0x146)]===_0x5bc83a(0x150))return{'configPath':_0x41f2ae,'configDir':_0x1f11c8,'parentSegment':_0x2c7600[_0x5bc83a(0x146)]};}catch{}_0x1f11c8=a104_0x195a8e[_0x5bc83a(0x12f)](_0x1f11c8);}return null;}function calculateScopedPath(_0x4b6fa4,_0x54d663){const _0x2d548d=a104_0x1ed7,_0x105065=a104_0x195a8e[_0x2d548d(0x131)](_0x54d663,_0x4b6fa4),_0x37125f=_0x105065!==''&&_0x105065!=='.'&&!_0x105065['startsWith']('..');return{'isScoped':_0x37125f,'scopedFolderPath':_0x37125f?_0x105065[_0x2d548d(0x147)](/\\/g,'/'):''};}export async function resolveTarget(_0x3fb3e2){const _0x5916eb=a104_0x1ed7,{arg:_0x470489,contextParent:_0x4115bf,cwd:cwd=process[_0x5916eb(0x143)](),fs:fs=nodeFileSystem}=_0x3fb3e2;if(_0x470489&&isYamlFilePath(_0x470489))try{const _0x5531d2=await resolveYamlFilePath(_0x470489,fs),_0x4dae50=a104_0x195a8e[_0x5916eb(0x12b)](_0x470489),_0x25b5d3=a104_0x195a8e['dirname'](_0x4dae50),_0x4bc086=await findTdxConfigAsync(_0x25b5d3,fs);if(!_0x4bc086){if(_0x4115bf){const _0x2d9892=a104_0x195a8e[_0x5916eb(0x12f)](_0x4dae50);return{'type':_0x5916eb(0x12e),'parentName':_0x4115bf,'targetDir':_0x2d9892,'configRoot':_0x2d9892,'filePath':_0x4dae50,'resourceName':_0x5531d2[_0x5916eb(0x138)],'folderPath':_0x5531d2[_0x5916eb(0x134)],'resourceType':_0x5531d2[_0x5916eb(0x136)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5916eb(0x140),'errorCode':_0x5916eb(0x123),'message':_0x5916eb(0x11c)+_0x470489,'arg':_0x470489,'helpText':_0x5916eb(0x119)};}const _0x131f11=calculateScopedPath(_0x25b5d3,_0x4bc086['configDir']);return{'type':_0x5916eb(0x12e),'parentName':_0x4bc086[_0x5916eb(0x120)],'targetDir':_0x4bc086[_0x5916eb(0x14b)],'configRoot':_0x4bc086[_0x5916eb(0x14b)],'filePath':_0x4dae50,'resourceName':_0x5531d2['segmentName'],'folderPath':_0x5531d2[_0x5916eb(0x134)],'resourceType':_0x5531d2[_0x5916eb(0x136)],'isScoped':_0x131f11['isScoped'],'scopedFolderPath':_0x131f11[_0x5916eb(0x149)]};}catch(_0x2d1c17){const _0x3955df=_0x2d1c17 instanceof Error?_0x2d1c17['message']:String(_0x2d1c17);if(_0x3955df[_0x5916eb(0x151)](_0x5916eb(0x145)))return{'type':_0x5916eb(0x140),'errorCode':_0x5916eb(0x14c),'message':'File\x20not\x20found:\x20'+_0x470489,'arg':_0x470489};if(_0x3955df[_0x5916eb(0x151)](_0x5916eb(0x14f))){if(_0x4115bf){const _0x3016c8=a104_0x195a8e[_0x5916eb(0x12b)](_0x470489);if(await fs[_0x5916eb(0x125)](_0x3016c8)){const _0x37290b=a104_0x195a8e[_0x5916eb(0x12f)](_0x3016c8),_0x5e54d9=await fs['readFile'](_0x3016c8),_0x5bcfb7=_0x5e54d9[_0x5916eb(0x14d)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x1dea7f=_0x5e54d9['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4df7e7=_0x5bcfb7?_0x5bcfb7[0x1][_0x5916eb(0x137)]():a104_0x195a8e[_0x5916eb(0x142)](_0x470489,a104_0x195a8e[_0x5916eb(0x12d)](_0x470489)),_0x2d9fc8=_0x1dea7f&&_0x1dea7f[0x1][_0x5916eb(0x137)]()===_0x5916eb(0x132)?'journey':_0x5916eb(0x13f);return{'type':_0x5916eb(0x12e),'parentName':_0x4115bf,'targetDir':_0x37290b,'configRoot':_0x37290b,'filePath':_0x3016c8,'resourceName':_0x4df7e7,'folderPath':'','resourceType':_0x2d9fc8,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':'no_config','message':_0x5916eb(0x11c)+_0x470489,'arg':_0x470489,'helpText':_0x5916eb(0x119)};}return{'type':'error','errorCode':'invalid_yaml','message':_0x3955df,'arg':_0x470489};}if(_0x470489){const _0x8ba626=a104_0x195a8e[_0x5916eb(0x12b)](cwd,_0x470489);let _0x1e655a=null;try{_0x1e655a=await fs['stat'](_0x8ba626);}catch{}if(_0x1e655a?.[_0x5916eb(0x122)]()){const _0x16a443=await findTdxConfigAsync(_0x8ba626,fs);if(_0x16a443){const _0x5911b1=calculateScopedPath(_0x8ba626,_0x16a443[_0x5916eb(0x14b)]);return{'type':'directory','parentName':_0x16a443[_0x5916eb(0x120)],'targetDir':_0x8ba626,'configRoot':_0x16a443[_0x5916eb(0x14b)],'isScoped':_0x5911b1[_0x5916eb(0x129)],'scopedFolderPath':_0x5911b1[_0x5916eb(0x149)]};}if(_0x4115bf)return{'type':_0x5916eb(0x11e),'parentName':_0x4115bf,'targetDir':_0x8ba626,'configRoot':_0x8ba626,'isScoped':![],'scopedFolderPath':''};return{'type':_0x5916eb(0x140),'errorCode':_0x5916eb(0x123),'message':_0x5916eb(0x130)+_0x470489,'arg':_0x470489,'helpText':_0x5916eb(0x119)};}if(_0x1e655a?.[_0x5916eb(0x11b)]())return{'type':'error','errorCode':_0x5916eb(0x148),'message':_0x5916eb(0x121)+_0x470489,'arg':_0x470489,'helpText':_0x5916eb(0x11d)};const _0x27c5e5=sanitizeFileName(_0x470489),_0x369919=getSegmentRootDir(_0x27c5e5,cwd);return{'type':'parent_name','parentName':_0x470489,'targetDir':_0x369919,'configRoot':_0x369919};}const _0x4d7ae5=await findTdxConfigAsync(cwd,fs);if(_0x4d7ae5){const _0x12efd1=calculateScopedPath(cwd,_0x4d7ae5['configDir']);return{'type':_0x5916eb(0x13d),'parentName':_0x4d7ae5['parentSegment'],'targetDir':cwd,'configRoot':_0x4d7ae5[_0x5916eb(0x14b)],'isScoped':_0x12efd1['isScoped'],'scopedFolderPath':_0x12efd1[_0x5916eb(0x149)]};}if(_0x4115bf){const _0x1677b5=sanitizeFileName(_0x4115bf),_0x592533=getSegmentRootDir(_0x1677b5,cwd);return{'type':'context','parentName':_0x4115bf,'targetDir':_0x592533,'configRoot':_0x592533,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x5916eb(0x127),'message':_0x5916eb(0x11f),'helpText':_0x5916eb(0x12a)};}
@@ -1 +1 @@
1
- const a105_0x250f50=a105_0xf7ea;function a105_0x4f72(){const _0x394fe5=['186FNizGl','join','resolve','parse','cwd','root','parent_segment','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','752159FSBLDE','tdx.json','91085uNoAjQ','12343200UDVUqI','156062dsWWri','Invalid\x20tdx.json:\x20expected\x20object','10842671DWabGy','string','relative','3787636MhrmiK','14509080IuDtlJ','startsWith','replace','Invalid\x20JSON\x20in\x20','segments','dirname','object','9JUuBqQ'];a105_0x4f72=function(){return _0x394fe5;};return a105_0x4f72();}(function(_0x363740,_0x5aad0a){const _0xbaa576=a105_0xf7ea,_0x1c2eb9=_0x363740();while(!![]){try{const _0x5c2449=parseInt(_0xbaa576(0x7d))/0x1+-parseInt(_0xbaa576(0x81))/0x2*(-parseInt(_0xbaa576(0x74))/0x3)+parseInt(_0xbaa576(0x86))/0x4+parseInt(_0xbaa576(0x7f))/0x5*(parseInt(_0xbaa576(0x75))/0x6)+-parseInt(_0xbaa576(0x83))/0x7+parseInt(_0xbaa576(0x80))/0x8+-parseInt(_0xbaa576(0x87))/0x9;if(_0x5c2449===_0x5aad0a)break;else _0x1c2eb9['push'](_0x1c2eb9['shift']());}catch(_0x933e7e){_0x1c2eb9['push'](_0x1c2eb9['shift']());}}}(a105_0x4f72,0xd6c63));import{existsSync,readFileSync}from'fs';import a105_0x15b02b from'path';const TDX_CONFIG_FILE=a105_0x250f50(0x7e),SEGMENTS_DIR=a105_0x250f50(0x71);export function findTdxConfigPath(_0x12b74d=process[a105_0x250f50(0x79)]()){const _0x5d9fac=a105_0x250f50;let _0x3ecac3=a105_0x15b02b[_0x5d9fac(0x77)](_0x12b74d);const _0x27f128=a105_0x15b02b[_0x5d9fac(0x78)](_0x3ecac3)[_0x5d9fac(0x7a)];while(_0x3ecac3!==_0x27f128){const _0x51fd60=a105_0x15b02b['join'](_0x3ecac3,TDX_CONFIG_FILE);if(existsSync(_0x51fd60))return _0x51fd60;_0x3ecac3=a105_0x15b02b[_0x5d9fac(0x72)](_0x3ecac3);}return null;}export function loadTdxConfig(_0x3df654){const _0x33f4ea=a105_0x250f50,_0x24330a=readFileSync(_0x3df654,'utf-8');let _0x13f5d4;try{_0x13f5d4=JSON[_0x33f4ea(0x78)](_0x24330a);}catch{throw new Error(_0x33f4ea(0x70)+_0x3df654);}if(!_0x13f5d4||typeof _0x13f5d4!==_0x33f4ea(0x73))throw new Error(_0x33f4ea(0x82));const _0x1f5015=_0x13f5d4;if(!_0x1f5015[_0x33f4ea(0x7b)]||typeof _0x1f5015[_0x33f4ea(0x7b)]!==_0x33f4ea(0x84))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field');return{'parent_segment':_0x1f5015['parent_segment']};}export function findTdxConfig(_0x145364=process['cwd']()){const _0x351787=a105_0x250f50,_0x58e593=findTdxConfigPath(_0x145364);if(!_0x58e593)throw new Error(_0x351787(0x7c));const _0x2841e6=loadTdxConfig(_0x58e593),_0x1db334=a105_0x15b02b[_0x351787(0x72)](_0x58e593);return{'config':_0x2841e6,'configPath':_0x58e593,'configDir':_0x1db334};}export function tryFindTdxConfig(_0x4ae7d5){try{return findTdxConfig(_0x4ae7d5);}catch{return null;}}export function getSegmentRootDir(_0x54dcb6,_0x2e5f56=process[a105_0x250f50(0x79)]()){const _0x2109a9=a105_0x250f50;return a105_0x15b02b[_0x2109a9(0x76)](_0x2e5f56,SEGMENTS_DIR,_0x54dcb6);}export function getTdxConfigPath(_0x20d090,_0x230166=process[a105_0x250f50(0x79)]()){const _0xc8300c=a105_0x250f50;return a105_0x15b02b[_0xc8300c(0x76)](getSegmentRootDir(_0x20d090,_0x230166),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x2765f0,_0x11ebad){const _0x58555e=a105_0x250f50,_0x40fd3a=a105_0x15b02b[_0x58555e(0x77)](_0x2765f0),_0x455786=a105_0x15b02b[_0x58555e(0x85)](_0x11ebad,_0x40fd3a);if(_0x455786[_0x58555e(0x6e)]('..'))return'';return _0x455786;}export function localPathToTdFolderPath(_0x1dafbf){const _0x425abc=a105_0x250f50,_0x13583e=a105_0x15b02b[_0x425abc(0x72)](_0x1dafbf);if(_0x13583e==='.'||_0x13583e==='')return'';return _0x13583e[_0x425abc(0x6f)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x3d93db,_0x2fe3a1){const _0x468cae=a105_0x250f50;if(!_0x3d93db)return _0x2fe3a1;return a105_0x15b02b[_0x468cae(0x76)](_0x2fe3a1,_0x3d93db);}function a105_0xf7ea(_0x228c83,_0x923f75){_0x228c83=_0x228c83-0x6e;const _0x4f72c9=a105_0x4f72();let _0xf7ea05=_0x4f72c9[_0x228c83];return _0xf7ea05;}export function createTdxConfigContent(_0x489862){const _0x50cb8a={'parent_segment':_0x489862};return JSON['stringify'](_0x50cb8a,null,0x2)+'\x0a';}
1
+ const a105_0x368c97=a105_0x109d;(function(_0x2508d4,_0x146864){const _0x5619dd=a105_0x109d,_0x358933=_0x2508d4();while(!![]){try{const _0x1a4e0c=-parseInt(_0x5619dd(0x149))/0x1+parseInt(_0x5619dd(0x141))/0x2+parseInt(_0x5619dd(0x12c))/0x3*(parseInt(_0x5619dd(0x12e))/0x4)+-parseInt(_0x5619dd(0x144))/0x5*(parseInt(_0x5619dd(0x143))/0x6)+-parseInt(_0x5619dd(0x13b))/0x7+-parseInt(_0x5619dd(0x137))/0x8*(-parseInt(_0x5619dd(0x136))/0x9)+-parseInt(_0x5619dd(0x13f))/0xa*(-parseInt(_0x5619dd(0x140))/0xb);if(_0x1a4e0c===_0x146864)break;else _0x358933['push'](_0x358933['shift']());}catch(_0x5802de){_0x358933['push'](_0x358933['shift']());}}}(a105_0x5e31,0xe6dd6));import{existsSync,readFileSync}from'fs';import a105_0x115afc from'path';const TDX_CONFIG_FILE=a105_0x368c97(0x130),SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x26bef7=process[a105_0x368c97(0x13a)]()){const _0x4691ac=a105_0x368c97;let _0x33b1dc=a105_0x115afc[_0x4691ac(0x131)](_0x26bef7);const _0x54bcdc=a105_0x115afc[_0x4691ac(0x147)](_0x33b1dc)[_0x4691ac(0x132)];while(_0x33b1dc!==_0x54bcdc){const _0x350c56=a105_0x115afc['join'](_0x33b1dc,TDX_CONFIG_FILE);if(existsSync(_0x350c56))return _0x350c56;_0x33b1dc=a105_0x115afc[_0x4691ac(0x146)](_0x33b1dc);}return null;}export function loadTdxConfig(_0x59674f){const _0xd11369=a105_0x368c97,_0x5758bf=readFileSync(_0x59674f,_0xd11369(0x13c));let _0x4591b0;try{_0x4591b0=JSON[_0xd11369(0x147)](_0x5758bf);}catch{throw new Error(_0xd11369(0x135)+_0x59674f);}if(!_0x4591b0||typeof _0x4591b0!==_0xd11369(0x139))throw new Error(_0xd11369(0x138));const _0x49e495=_0x4591b0;if(!_0x49e495['parent_segment']||typeof _0x49e495[_0xd11369(0x134)]!==_0xd11369(0x142))throw new Error(_0xd11369(0x12d));return{'parent_segment':_0x49e495['parent_segment']};}export function findTdxConfig(_0x13f56d=process[a105_0x368c97(0x13a)]()){const _0x96ec1f=a105_0x368c97,_0x48bca5=findTdxConfigPath(_0x13f56d);if(!_0x48bca5)throw new Error(_0x96ec1f(0x145));const _0x295cc1=loadTdxConfig(_0x48bca5),_0x23f234=a105_0x115afc[_0x96ec1f(0x146)](_0x48bca5);return{'config':_0x295cc1,'configPath':_0x48bca5,'configDir':_0x23f234};}export function tryFindTdxConfig(_0x4f39e3){try{return findTdxConfig(_0x4f39e3);}catch{return null;}}export function getSegmentRootDir(_0x52fc9e,_0x517545=process['cwd']()){const _0x9474b=a105_0x368c97;return a105_0x115afc[_0x9474b(0x12f)](_0x517545,SEGMENTS_DIR,_0x52fc9e);}export function getTdxConfigPath(_0x287504,_0x333954=process['cwd']()){const _0x38f2a1=a105_0x368c97;return a105_0x115afc[_0x38f2a1(0x12f)](getSegmentRootDir(_0x287504,_0x333954),TDX_CONFIG_FILE);}function a105_0x109d(_0x7e08cd,_0x5ee89f){_0x7e08cd=_0x7e08cd-0x12c;const _0x5e31de=a105_0x5e31();let _0x109d00=_0x5e31de[_0x7e08cd];return _0x109d00;}function a105_0x5e31(){const _0xd2ed74=['dirname','parse','stringify','239791oDXdfj','108KCwRQe','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','94496pQPTWl','join','tdx.json','resolve','root','replace','parent_segment','Invalid\x20JSON\x20in\x20','921231ilqkOS','32wzcQQu','Invalid\x20tdx.json:\x20expected\x20object','object','cwd','3900316FTMiMi','utf-8','startsWith','relative','11339310ublXPF','11XydTag','1783618IwiBfD','string','9258234rNgAQR','5zBZpyV','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.'];a105_0x5e31=function(){return _0xd2ed74;};return a105_0x5e31();}export function getRelativePathFromConfig(_0x517f06,_0x44a99d){const _0x2fa3a7=a105_0x368c97,_0x31b3d7=a105_0x115afc[_0x2fa3a7(0x131)](_0x517f06),_0x473e52=a105_0x115afc[_0x2fa3a7(0x13e)](_0x44a99d,_0x31b3d7);if(_0x473e52[_0x2fa3a7(0x13d)]('..'))return'';return _0x473e52;}export function localPathToTdFolderPath(_0x29d514){const _0x223939=a105_0x368c97,_0x1efa06=a105_0x115afc[_0x223939(0x146)](_0x29d514);if(_0x1efa06==='.'||_0x1efa06==='')return'';return _0x1efa06[_0x223939(0x133)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x4118f0,_0x225237){const _0x4a266b=a105_0x368c97;if(!_0x4118f0)return _0x225237;return a105_0x115afc[_0x4a266b(0x12f)](_0x225237,_0x4118f0);}export function createTdxConfigContent(_0x395236){const _0x9c1f8a=a105_0x368c97,_0x138ec5={'parent_segment':_0x395236};return JSON[_0x9c1f8a(0x148)](_0x138ec5,null,0x2)+'\x0a';}