@treasuredata/tdx 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.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/unset-command.js +1 -1
  41. package/dist/commands/use-command.js +1 -1
  42. package/dist/commands/user-command.js +1 -1
  43. package/dist/commands/workflow-command.js +1 -1
  44. package/dist/core/auth.js +1 -1
  45. package/dist/core/command-output.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/connection-cache.js +1 -1
  48. package/dist/core/constants.js +1 -1
  49. package/dist/core/credential-cache.js +1 -1
  50. package/dist/core/global-context.js +1 -1
  51. package/dist/core/keychain.js +1 -1
  52. package/dist/core/profile.js +1 -1
  53. package/dist/core/project-config.js +1 -1
  54. package/dist/core/session.js +1 -1
  55. package/dist/core/user-cache.js +1 -1
  56. package/dist/core/version.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/mcp/server.js +1 -1
  59. package/dist/mcp/tools/index.js +1 -1
  60. package/dist/mcp/tools/tdx-run.js +1 -1
  61. package/dist/mcp/tools/tdx-search.js +1 -1
  62. package/dist/mcp/utils.js +1 -1
  63. package/dist/proxy/anthropic-adapter.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/context-signature.js +1 -1
  66. package/dist/proxy/conversation-utils.js +1 -1
  67. package/dist/proxy/passthrough-server.js +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/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/api.js +1 -1
  80. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  81. package/dist/sdk/claude-agent/environment.js +1 -1
  82. package/dist/sdk/claude-agent/index.js +1 -1
  83. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  84. package/dist/sdk/client/cdp-api-client.js +1 -1
  85. package/dist/sdk/client/endpoints.js +1 -1
  86. package/dist/sdk/client/engage-api-client.js +1 -1
  87. package/dist/sdk/client/http-client.js +1 -1
  88. package/dist/sdk/client/llm-api-client.js +1 -1
  89. package/dist/sdk/client/rate-limiter.js +1 -1
  90. package/dist/sdk/client/td-api-client.js +1 -1
  91. package/dist/sdk/client/trino-api-client.js +1 -1
  92. package/dist/sdk/client/workflow-client.js +1 -1
  93. package/dist/sdk/connection-validator.js +1 -1
  94. package/dist/sdk/connection.js +1 -1
  95. package/dist/sdk/engage.js +1 -1
  96. package/dist/sdk/errors.js +1 -1
  97. package/dist/sdk/index.js +1 -1
  98. package/dist/sdk/io/index.js +1 -1
  99. package/dist/sdk/io/node-filesystem.js +1 -1
  100. package/dist/sdk/job.js +1 -1
  101. package/dist/sdk/journey.js +1 -1
  102. package/dist/sdk/llm/chat-cache.js +1 -1
  103. package/dist/sdk/llm/index.js +1 -1
  104. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  105. package/dist/sdk/llm/model-aliases.js +1 -1
  106. package/dist/sdk/llm/model-factors.js +1 -1
  107. package/dist/sdk/query/index.js +1 -1
  108. package/dist/sdk/query/sql-parser.js +1 -1
  109. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  110. package/dist/sdk/segment/fields-display.js +1 -1
  111. package/dist/sdk/segment/file-discovery.js +1 -1
  112. package/dist/sdk/segment/journey-utils.js +1 -1
  113. package/dist/sdk/segment/journey-yaml.js +1 -1
  114. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  115. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  116. package/dist/sdk/segment/pull-workflow.js +1 -1
  117. package/dist/sdk/segment/push-workflow.js +1 -1
  118. package/dist/sdk/segment/resolution-context.js +1 -1
  119. package/dist/sdk/segment/segment-path-parser.js +1 -1
  120. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  121. package/dist/sdk/segment/target-resolution.js +1 -1
  122. package/dist/sdk/segment/tdx-config.js +1 -1
  123. package/dist/sdk/segment/validate-files.js +1 -1
  124. package/dist/sdk/segment/yaml-validator.js +1 -1
  125. package/dist/sdk/segment.js +1 -1
  126. package/dist/sdk/types/index.js +1 -1
  127. package/dist/sdk/types/progress.js +1 -1
  128. package/dist/sdk/user.js +1 -1
  129. package/dist/sdk/util/format-detector.js +1 -1
  130. package/dist/sdk/util/formatters.js +1 -1
  131. package/dist/sdk/util/index.js +1 -1
  132. package/dist/sdk/util/tree-formatter.js +1 -1
  133. package/dist/sdk/workflow/clone-workflow.js +1 -1
  134. package/dist/sdk/workflow/index.js +1 -1
  135. package/dist/sdk/workflow/pull-workflow.js +1 -1
  136. package/dist/sdk/workflow/push-workflow.js +1 -1
  137. package/dist/sdk/workflow/tdx-config.js +1 -1
  138. package/dist/sdk/workflow/workflow-utils.js +1 -1
  139. package/dist/utils/async.js +1 -1
  140. package/dist/utils/colors.js +1 -1
  141. package/dist/utils/diff.js +1 -1
  142. package/dist/utils/file-permissions.js +1 -1
  143. package/dist/utils/json-loader.js +1 -1
  144. package/dist/utils/option-validation.js +1 -1
  145. package/dist/utils/port.js +1 -1
  146. package/dist/utils/process.js +1 -1
  147. package/dist/utils/prompt.js +1 -1
  148. package/dist/utils/spinner.js +1 -1
  149. package/dist/utils/sse-parser.js +1 -1
  150. package/dist/utils/string-utils.js +1 -1
  151. package/dist/utils/table-ref-parser.js +1 -1
  152. package/dist/utils/tdx-logger.js +1 -1
  153. package/dist/utils/version-check.js +1 -1
  154. package/package.json +1 -1
@@ -1 +1 @@
1
- function a119_0x54fc(_0x581a75,_0x320b6e){_0x581a75=_0x581a75-0xe9;const _0x75ee99=a119_0x75ee();let _0x54fc6e=_0x75ee99[_0x581a75];return _0x54fc6e;}const a119_0x2de80c=a119_0x54fc;(function(_0x24aa1f,_0x10eba9){const _0x428014=a119_0x54fc,_0x2bdc67=_0x24aa1f();while(!![]){try{const _0x4205ad=parseInt(_0x428014(0x16e))/0x1*(parseInt(_0x428014(0x1b4))/0x2)+parseInt(_0x428014(0x15c))/0x3+-parseInt(_0x428014(0xfe))/0x4*(parseInt(_0x428014(0x14c))/0x5)+-parseInt(_0x428014(0x14d))/0x6*(parseInt(_0x428014(0x15e))/0x7)+parseInt(_0x428014(0x1b3))/0x8*(parseInt(_0x428014(0x1c8))/0x9)+parseInt(_0x428014(0x19f))/0xa+-parseInt(_0x428014(0xfd))/0xb;if(_0x4205ad===_0x10eba9)break;else _0x2bdc67['push'](_0x2bdc67['shift']());}catch(_0x4b9c1c){_0x2bdc67['push'](_0x2bdc67['shift']());}}}(a119_0x75ee,0x33b36));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a119_0x2de80c(0x13f);export function createPendingSegmentId(_0x391e4d){return''+PENDING_SEGMENT_PREFIX+_0x391e4d+'__';}export function isPendingSegmentId(_0x4b02ff){const _0x17c104=a119_0x2de80c;return _0x4b02ff[_0x17c104(0x141)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5d625c){const _0x4f34c7=a119_0x2de80c;return _0x5d625c[_0x4f34c7(0x195)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x338c3d){return''+PENDING_ACTIVATION_PREFIX+_0x338c3d+'__';}export function isPendingActivationId(_0x1c76b9){const _0x44a0af=a119_0x2de80c;return _0x1c76b9[_0x44a0af(0x141)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x176463){const _0x26fac9=a119_0x2de80c;return _0x176463[_0x26fac9(0x195)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x987ad8,_0x421c13){const _0x137b0f=a119_0x2de80c,_0x4136f5=_0x987ad8+'::'+(_0x421c13[_0x137b0f(0x196)]()||'segment'),_0x1ff9a8=createHash(_0x137b0f(0x11e))[_0x137b0f(0x1c9)](_0x4136f5)[_0x137b0f(0x13b)]('hex')[_0x137b0f(0x18f)](0x0,0xc);return'journey_entry_criteria_'+_0x1ff9a8;}export function ensureJourneyDefaults(_0x857378){const _0x359d84=a119_0x2de80c;!_0x857378[_0x359d84(0x16d)]&&(_0x857378[_0x359d84(0x16d)]=''),!_0x857378[_0x359d84(0x117)]&&(_0x857378['state']='draft');}export function resolveTDFolderPath(_0x39616e,_0x20279d,_0x552529){const _0x33f2df=a119_0x2de80c;if(!_0x20279d)return _0x39616e;if(_0x39616e===_0x552529||_0x39616e[_0x33f2df(0x141)](_0x552529+'/'))return _0x39616e;return _0x39616e?_0x552529+'/'+_0x39616e:_0x552529;}export function addFoldersToCreate(_0x10a0aa,_0x13beb3,_0x4c3b63){const _0x3e8909=a119_0x2de80c;if(!_0x10a0aa)return;if(_0x13beb3[_0x3e8909(0x1be)](_0x10a0aa))return;const _0x52b819=_0x10a0aa['split']('/');let _0x218fda='';for(const _0x5672dd of _0x52b819){_0x218fda=_0x218fda?_0x218fda+'/'+_0x5672dd:_0x5672dd,!_0x13beb3[_0x3e8909(0x1be)](_0x218fda)&&_0x4c3b63['add'](_0x218fda);}}import*as a119_0x355cd7 from'yaml';import{readFileSync}from'fs';import a119_0x41fba8 from'path';import{isJourneyDef,parseYamlString as a119_0x56b82d,toYamlString as a119_0x2488fd,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(_0x2b4ddc){const _0x5437b2=a119_0x2de80c;if(Array[_0x5437b2(0x162)](_0x2b4ddc))return'['+_0x2b4ddc[_0x5437b2(0x15f)](_0x43bd2f=>stableStringify(_0x43bd2f))[_0x5437b2(0x168)](',')+']';if(_0x2b4ddc&&typeof _0x2b4ddc===_0x5437b2(0x177)){const _0x108115=_0x2b4ddc,_0x28ec13=Object[_0x5437b2(0x15b)](_0x108115)[_0x5437b2(0x172)](),_0x5854de=_0x28ec13[_0x5437b2(0x15f)](_0x475b0f=>'\x22'+_0x475b0f+'\x22:'+stableStringify(_0x108115[_0x475b0f]));return'{'+_0x5854de[_0x5437b2(0x168)](',')+'}';}const _0x230336=JSON['stringify'](_0x2b4ddc);return _0x230336===undefined?'null':_0x230336;}function activationSignature(_0x5914a2){const _0x5b61c0=a119_0x2de80c,_0x4b601f={'connection':_0x5914a2[_0x5b61c0(0x143)],..._0x5914a2[_0x5b61c0(0x1ad)]!==undefined&&{'all_columns':_0x5914a2[_0x5b61c0(0x1ad)]},..._0x5914a2['columns']!==undefined&&{'columns':_0x5914a2[_0x5b61c0(0x192)]},..._0x5914a2[_0x5b61c0(0x101)]!==undefined&&{'behavior':_0x5914a2[_0x5b61c0(0x101)]},..._0x5914a2[_0x5b61c0(0x1c1)]!==undefined&&{'schedule':_0x5914a2[_0x5b61c0(0x1c1)]},..._0x5914a2[_0x5b61c0(0x149)]!==undefined&&{'notification':_0x5914a2['notification']},..._0x5914a2[_0x5b61c0(0x194)]!==undefined&&{'connector_config':_0x5914a2['connector_config']},..._0x5914a2[_0x5b61c0(0xef)]!==undefined&&{'activation_template_id':_0x5914a2['activation_template_id']}};return stableStringify(_0x4b601f);}export async function prepareSegmentFiles(_0x18e4da,_0x38fb0f,_0x491cdf,_0xa84989,_0x1b5143){const _0x4bdfb2=a119_0x2de80c,{activationDefToCreateRequest:_0x2f0605}=await import('./child-segment-yaml.js'),_0xf7fcce=[],_0x38e37f=new Set();for(const {yamlConfig:_0xe05e81,folderPath:_0x52edd3,sourcePath:_0x4236a4}of _0x18e4da){const _0x450954=resolveTDFolderPath(_0x52edd3,_0xa84989,_0x1b5143),_0x197591=_0x450954+':'+_0xe05e81['name'],_0x2fe2d6=_0x38fb0f[_0x4bdfb2(0x19e)][_0x4bdfb2(0x151)](_0x197591),_0x3c9d94=_0x2fe2d6?_0x38fb0f[_0x4bdfb2(0x170)][_0x4bdfb2(0x151)](_0x2fe2d6['id'])||[]:[];addFoldersToCreate(_0x450954,_0x38fb0f[_0x4bdfb2(0x1a1)],_0x38e37f);const _0x87253c=calculateActivationActions(_0xe05e81[_0x4bdfb2(0x126)]||[],_0x3c9d94,_0x38fb0f[_0x4bdfb2(0x1c3)],_0x38fb0f['connectionIdToNameMap']);for(const _0x452d34 of _0x87253c){(_0x452d34[_0x4bdfb2(0xff)]===_0x4bdfb2(0xfc)||_0x452d34[_0x4bdfb2(0xff)]===_0x4bdfb2(0x1c9))&&_0x452d34[_0x4bdfb2(0x193)]&&(_0x452d34[_0x4bdfb2(0x1ba)]=await _0x2f0605(_0x452d34['yamlActivation'],_0x491cdf));}const _0xd3349d=calculateSegmentDiff(_0xe05e81,_0x2fe2d6,_0x3c9d94,_0x38fb0f[_0x4bdfb2(0x1c3)],_0x38fb0f[_0x4bdfb2(0x110)]);_0xf7fcce[_0x4bdfb2(0x12d)]({'relativePath':_0xe05e81[_0x4bdfb2(0xf2)],'absolutePath':_0x4236a4,'yamlConfig':_0xe05e81,'folderPath':_0x450954,'existingSegment':_0x2fe2d6,'existingActivations':_0x3c9d94,'isNew':_0xd3349d[_0x4bdfb2(0x1b2)],'hasChanges':_0xd3349d[_0x4bdfb2(0x12a)],'diff':_0xd3349d['diff'],'activationActions':_0x87253c});}return{'segmentFiles':_0xf7fcce,'foldersToCreate':_0x38e37f};}export async function prepareJourneyFiles(_0xe7bffa,_0x2bf6b9,_0x3493d8,_0x4de677){const _0x33066c=a119_0x2de80c,_0x54f302=[],_0xc4aa02=new Set();for(const {yamlConfig:_0x58087e,folderPath:_0x7df99a,sourcePath:_0x2ece1f}of _0xe7bffa){const _0x38195d=resolveTDFolderPath(_0x7df99a,_0x3493d8,_0x4de677),_0x120576=_0x38195d+':'+_0x58087e['name'],_0x375611=_0x2bf6b9[_0x33066c(0x17b)][_0x33066c(0x151)](_0x120576);let _0x5efd72,_0xc0ae83;if(_0x375611&&_0x375611[_0x33066c(0x175)]>0x0){const _0x165122=buildLocalExpandedRuleMappings(_0x58087e),{createYamlContext:_0xe7e392,prefetchJourneySegments:_0x35bf3e}=createPushYamlContextForBundle(_0x2bf6b9[_0x33066c(0xe9)],_0x2bf6b9[_0x33066c(0x108)],_0x2bf6b9[_0x33066c(0x123)],_0x165122,_0x2bf6b9[_0x33066c(0x1c3)],_0x2bf6b9['connectionIdToNameMap'],_0x2bf6b9[_0x33066c(0x140)],_0x2bf6b9[_0x33066c(0x132)]);await _0x35bf3e(_0x375611['map'](_0x2aa867=>_0x2aa867['id']));const _0x10e707=hasMultipleVersions(_0x58087e),_0x39162c=async _0x458e9a=>{const _0x22b07b=_0x33066c,_0x16cebb=_0x2bf6b9[_0x22b07b(0x132)]?.['get'](_0x458e9a);if(_0x16cebb)return _0x16cebb;return _0x2bf6b9[_0x22b07b(0x1d0)]({'journeyId':_0x458e9a,'journeyName':_0x58087e[_0x22b07b(0xf2)],'isMultiVersion':_0x375611[_0x22b07b(0x175)]>0x1});};if(_0x10e707&&_0x375611[_0x33066c(0x175)]>0x1){const _0x18f332=[];for(const _0x4313f1 of _0x375611){const _0x432140=_0x4313f1[_0x33066c(0x112)]||0x1;_0x2bf6b9[_0x33066c(0x1cb)]?.[_0x33066c(0x1c9)](_0x33066c(0x12b)+_0x58087e['name']+'\x20v'+_0x432140);const _0x25d027=await _0x39162c(_0x4313f1['id']),_0x5cfe04=_0xe7e392(_0x4313f1['id']),_0x5e5589=await journeyResponseToDef(_0x25d027,_0x5cfe04);_0x18f332[_0x33066c(0x12d)]({'item':_0x4313f1,'yaml':_0x5e5589});}const _0x5a8140=buildLocalRuleToNameMappingFromJourney(_0x58087e);_0xc0ae83=buildMergedJourneyDef(_0x18f332,_0x5a8140);const _0x584599=Math['max'](..._0x18f332[_0x33066c(0x15f)](_0x5e12b8=>_0x5e12b8[_0x33066c(0x1a8)][_0x33066c(0x112)]||0x0)),_0x4a185e=_0x375611[_0x33066c(0x1aa)](_0x164587=>(_0x164587['versionNumber']||0x0)===_0x584599);_0x4a185e&&(_0x2bf6b9[_0x33066c(0x1cb)]?.[_0x33066c(0x1c9)](_0x33066c(0x12b)+_0x58087e[_0x33066c(0xf2)]+'\x20v'+_0x584599),_0x5efd72=await _0x39162c(_0x4a185e['id']));}else{const _0x57b24f=_0x375611[_0x375611['length']-0x1];_0x2bf6b9[_0x33066c(0x1cb)]?.[_0x33066c(0x1c9)](_0x33066c(0x12b)+_0x58087e[_0x33066c(0xf2)]),_0x5efd72=await _0x39162c(_0x57b24f['id']);const _0x569503=_0xe7e392(_0x57b24f['id']),_0x1fe02e=await journeyResponseToDef(_0x5efd72,_0x569503),_0x3a98d7=buildLocalRuleToNameMappingFromJourney(_0x58087e);_0xc0ae83=buildMergedJourneyDef([{'item':_0x57b24f,'yaml':_0x1fe02e}],_0x3a98d7);}}addFoldersToCreate(_0x38195d,_0x2bf6b9[_0x33066c(0x1a1)],_0xc4aa02);const _0x78634d=calculateJourneyDiff(_0x58087e,_0xc0ae83);_0x54f302[_0x33066c(0x12d)]({'relativePath':_0x58087e['name'],'absolutePath':_0x2ece1f,'yamlConfig':_0x58087e,'folderPath':_0x38195d,'existingJourney':_0x5efd72,'isNew':_0x78634d[_0x33066c(0x1b2)],'hasChanges':_0x78634d[_0x33066c(0x12a)],'diff':_0x78634d[_0x33066c(0xf9)]});}return{'journeyFiles':_0x54f302,'foldersToCreate':_0xc4aa02};}export function calculateActivationActions(_0x45b5f4,_0x1e097d,_0x4e26f7,_0x2b61b0){const _0x41f6f6=a119_0x2de80c,_0x2830a6=[],_0x349af3=new Map();for(const _0x89e840 of _0x1e097d){_0x349af3[_0x41f6f6(0x17d)](_0x89e840[_0x41f6f6(0xf2)],_0x89e840);}const _0x5f3319=new Map();for(const _0x6a337c of _0x45b5f4){_0x5f3319[_0x41f6f6(0x17d)](_0x6a337c[_0x41f6f6(0xf2)],_0x6a337c);}for(const _0x20c5e4 of _0x45b5f4){const _0x3eb232=_0x349af3[_0x41f6f6(0x151)](_0x20c5e4[_0x41f6f6(0xf2)]);if(!_0x3eb232)_0x2830a6[_0x41f6f6(0x12d)]({'type':_0x41f6f6(0xfc),'name':_0x20c5e4[_0x41f6f6(0xf2)],'yamlActivation':_0x20c5e4});else{const _0x33cdbb=activationResponseToDef(_0x3eb232,_0x4e26f7,_0x2b61b0),_0x3d6c9f=a119_0x355cd7[_0x41f6f6(0x13e)](_0x33cdbb),_0x46aeda=a119_0x355cd7[_0x41f6f6(0x13e)](_0x20c5e4);_0x3d6c9f!==_0x46aeda&&_0x2830a6['push']({'type':_0x41f6f6(0x1c9),'name':_0x20c5e4[_0x41f6f6(0xf2)],'yamlActivation':_0x20c5e4,'existingActivation':_0x3eb232});}}for(const _0x7f7164 of _0x1e097d){!_0x5f3319[_0x41f6f6(0x1be)](_0x7f7164[_0x41f6f6(0xf2)])&&_0x2830a6[_0x41f6f6(0x12d)]({'type':_0x41f6f6(0x1cc),'name':_0x7f7164[_0x41f6f6(0xf2)],'existingActivation':_0x7f7164});}return _0x2830a6;}export function calculateSegmentDiff(_0x497d0c,_0xdb7deb,_0x470980,_0x18baca,_0x1ad834){const _0x560ca3=segmentToYamlString(_0x497d0c);if(_0xdb7deb){const _0x37bc96=segmentWithActivationsToYaml(_0xdb7deb,_0x470980,undefined,_0x18baca,_0x1ad834),_0x3b5b1d=segmentToYamlString(_0x37bc96),_0xd2d6e1=generateDiff(_0x3b5b1d,_0x560ca3),_0x5954cc=hasChanges(_0xd2d6e1);return{'isNew':![],'hasChanges':_0x5954cc,'diff':_0x5954cc?formatDiffWithColors(_0xd2d6e1):undefined};}const _0x5152b1=generateDiff('',_0x560ca3);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5152b1)};}export function calculateJourneyDiff(_0x5128ad,_0x3d5b46){const _0x4a8273=normalizeJourneyDef(_0x5128ad,_0x5128ad),_0x107868=a119_0x2488fd(_0x4a8273);if(_0x3d5b46){const _0x777907=normalizeJourneyDef(_0x3d5b46,_0x5128ad),_0x40e3ab=a119_0x2488fd(_0x777907),_0x2123dd=generateDiff(_0x40e3ab,_0x107868),_0xb1c51b=hasChanges(_0x2123dd);return{'isNew':![],'hasChanges':_0xb1c51b,'diff':_0xb1c51b?formatDiffWithColors(_0x2123dd):undefined};}const _0x1f4839=generateDiff('',_0x107868);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1f4839)};}export function findSegmentsToDelete(_0x32255d,_0x1f6672,_0x55c876,_0x565393,_0x3a4160){const _0x4f579e=a119_0x2de80c,_0x27cd85=new Set();for(const {yamlConfig:_0x4e7b54,folderPath:_0x47ecfa}of _0x1f6672){_0x27cd85[_0x4f579e(0x147)](_0x47ecfa+':'+_0x4e7b54[_0x4f579e(0xf2)]);}return _0x32255d['filter'](_0x154f62=>{const _0x389d41=_0x4f579e,_0x1da677=_0x154f62[_0x389d41(0xee)]?_0x55c876[_0x389d41(0x151)](_0x154f62[_0x389d41(0xee)][_0x389d41(0x122)]())||'':'',_0x31f733=_0x1da677+':'+_0x154f62[_0x389d41(0xf2)];if(_0x27cd85[_0x389d41(0x1be)](_0x31f733))return![];if(_0x3a4160)return _0x1da677===_0x565393||_0x1da677[_0x389d41(0x141)](_0x565393+'/');return!![];});}export function findJourneysToDelete(_0x49f919,_0x415fa2,_0x5dc290,_0x4da325,_0x360409){const _0x5601ad=a119_0x2de80c,_0x4b3a69=new Set();for(const {yamlConfig:_0x2d8eb0,folderPath:_0x2a3256}of _0x415fa2){_0x4b3a69[_0x5601ad(0x147)](_0x2a3256+':'+_0x2d8eb0[_0x5601ad(0xf2)]);}return _0x49f919[_0x5601ad(0x1b7)](_0x1a192f=>{const _0x4dd26e=_0x5601ad,_0x4aa193=_0x1a192f[_0x4dd26e(0xf6)]?_0x5dc290[_0x4dd26e(0x151)](_0x1a192f[_0x4dd26e(0xf6)])||'':'',_0x473276=_0x4aa193+':'+_0x1a192f['journeyBundleName'];if(_0x4b3a69[_0x4dd26e(0x1be)](_0x473276))return![];if(_0x360409)return _0x4aa193===_0x4da325||_0x4aa193[_0x4dd26e(0x141)](_0x4da325+'/');return!![];});}export function buildSegmentLookupMap(_0x12ee8b,_0x59356b){const _0x4901f9=a119_0x2de80c,_0x5de123=new Map();for(const _0x50a1b0 of _0x12ee8b){const _0x4ae52e=_0x50a1b0['segmentFolderId']?_0x59356b[_0x4901f9(0x151)](_0x50a1b0[_0x4901f9(0xee)][_0x4901f9(0x122)]())||'':'',_0x406268=_0x4ae52e+':'+_0x50a1b0['name'];_0x5de123[_0x4901f9(0x17d)](_0x406268,_0x50a1b0);}return _0x5de123;}export function buildSegmentNameToIdMap(_0x39e0d5){const _0x25ad84=a119_0x2de80c,_0x27b1d0=new Map();for(const _0xcad19 of _0x39e0d5){_0x27b1d0[_0x25ad84(0x17d)](_0xcad19[_0x25ad84(0xf2)],_0xcad19['id']);}return _0x27b1d0;}export function buildJourneyBundleLookupMap(_0x544f25,_0x23b6de){const _0x411fa4=a119_0x2de80c,_0x4f747d=new Map();for(const _0x3ed5c9 of _0x544f25){const _0x53120e=_0x3ed5c9['folderId']?_0x23b6de[_0x411fa4(0x151)](_0x3ed5c9[_0x411fa4(0xf6)])||'':'',_0x4634cb=_0x53120e+':'+_0x3ed5c9[_0x411fa4(0x164)];!_0x4f747d[_0x411fa4(0x1be)](_0x4634cb)&&_0x4f747d[_0x411fa4(0x17d)](_0x4634cb,[]),_0x4f747d[_0x411fa4(0x151)](_0x4634cb)['push'](_0x3ed5c9);}for(const _0x575005 of _0x4f747d[_0x411fa4(0x125)]()){_0x575005[_0x411fa4(0x172)]((_0x430993,_0x5c046a)=>(_0x430993[_0x411fa4(0x112)]||0x0)-(_0x5c046a[_0x411fa4(0x112)]||0x0));}return _0x4f747d;}export function collectFoldersToCreate(_0x16823d,_0x2883f4){const _0x288767=a119_0x2de80c,_0x4b4090=new Set();for(const _0x7bfc2e of _0x16823d){if(!_0x7bfc2e)continue;if(_0x2883f4[_0x288767(0x1be)](_0x7bfc2e))continue;const _0x20eb15=_0x7bfc2e['split']('/');let _0x45cae1='';for(const _0x457a68 of _0x20eb15){_0x45cae1=_0x45cae1?_0x45cae1+'/'+_0x457a68:_0x457a68,!_0x2883f4[_0x288767(0x1be)](_0x45cae1)&&_0x4b4090[_0x288767(0x147)](_0x45cae1);}}return _0x4b4090;}export function parseAndClassifyYamlFiles(_0x50327c,_0x1e3c5a,_0x3dc37c){const _0x215324=a119_0x2de80c,_0x3c11dd=[],_0x48d85a=[];for(const _0x10e049 of _0x50327c){const _0x43008a=a119_0x41fba8[_0x215324(0x163)](_0x1e3c5a,a119_0x41fba8[_0x215324(0x1c6)](_0x10e049)),_0x308d5d=_0x43008a==='.'?'':_0x43008a,_0x4b7cc1=readFileSync(_0x10e049,_0x215324(0x11d)),_0x4bc756=a119_0x355cd7[_0x215324(0x102)](_0x4b7cc1);if(isJourneyDef(_0x4bc756)){const _0x2e1a30=a119_0x56b82d(_0x4b7cc1);_0x48d85a['push']({'yamlConfig':_0x2e1a30,'folderPath':_0x308d5d,'sourcePath':_0x10e049});}else{if(!_0x3dc37c?.[_0x215324(0x15d)]){const _0x3f10e1=parseSegmentYamlFile(_0x4b7cc1),_0x4f70c2=normalizeChildSegmentYaml(_0x3f10e1);_0x3c11dd[_0x215324(0x12d)]({'yamlConfig':_0x4f70c2,'folderPath':_0x308d5d,'sourcePath':_0x10e049});}}}return{'segments':_0x3c11dd,'journeys':_0x48d85a};}export function validateParsedFiles(_0x2f9a45,_0x386e62){const _0x11f94c=a119_0x2de80c,_0x5adf9e=[];for(const {yamlConfig:_0x2794af,sourcePath:_0x5da85e}of _0x2f9a45[_0x11f94c(0x14f)]){const _0xcca8a8=readFileSync(_0x5da85e,_0x11f94c(0x11d)),_0x36ec1e=a119_0x355cd7[_0x11f94c(0x107)](_0xcca8a8),_0x299acb=validateSegmentDef(_0x2794af,{'source':_0xcca8a8,'document':_0x36ec1e});if(!_0x299acb[_0x11f94c(0x137)]){const _0x4aeb7d=a119_0x41fba8[_0x11f94c(0x163)](_0x386e62,_0x5da85e);_0x5adf9e[_0x11f94c(0x12d)]({'filePath':_0x4aeb7d,'source':_0xcca8a8,'result':_0x299acb,'isJourney':![]});}}for(const {yamlConfig:_0x560723,sourcePath:_0x1795f5}of _0x2f9a45['journeys']){const _0x268f59=readFileSync(_0x1795f5,_0x11f94c(0x11d)),_0x5ac45f=a119_0x355cd7[_0x11f94c(0x107)](_0x268f59),_0x106eaf=validateJourneyDef(_0x560723,{'source':_0x268f59,'document':_0x5ac45f});if(!_0x106eaf['valid']){const _0x2952ef=a119_0x41fba8[_0x11f94c(0x163)](_0x386e62,_0x1795f5);_0x5adf9e[_0x11f94c(0x12d)]({'filePath':_0x2952ef,'source':_0x268f59,'result':_0x106eaf,'isJourney':!![]});}}return _0x5adf9e;}export function formatValidationErrors(_0x1be55f){const _0x234cfa=a119_0x2de80c,_0x27f719=[];for(const {filePath:_0x346bcb,source:_0x28ee70,result:_0x195379,isJourney:_0x18bcf0}of _0x1be55f){const _0x250756=_0x18bcf0?_0x234cfa(0x109):'segment';_0x27f719[_0x234cfa(0x12d)]('\x0a'+_0x346bcb+'\x20('+_0x250756+_0x234cfa(0x124)+_0x195379['errors'][_0x234cfa(0x175)]+_0x234cfa(0x199)),_0x27f719[_0x234cfa(0x12d)](formatValidationResult(_0x195379,_0x28ee70,_0x346bcb));}return _0x27f719[_0x234cfa(0x168)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x45dfcd){const _0x4bebc5=a119_0x2de80c,_0x44dedc=new Set(),_0x5a66d0=new Map(),_0x48acd3=collectSegmentUsageCounts(_0x45dfcd);if(_0x45dfcd['segments'])for(const [_0x24e6c9,_0x29efc7]of Object[_0x4bebc5(0x14b)](_0x45dfcd[_0x4bebc5(0x14f)])){_0x44dedc[_0x4bebc5(0x147)](_0x24e6c9);if(_0x29efc7[_0x4bebc5(0x148)]){const _0x53bce7=yamlRuleToApi(_0x29efc7['rule']),_0xc8196c=apiRuleToYaml(_0x53bce7);_0x5a66d0[_0x4bebc5(0x17d)](_0x24e6c9,_0xc8196c);}}const _0x447aa2=new Map();let _0x22b536=0x0;for(const [_0x35217d,_0x1b9690]of _0x5a66d0){const _0x279d1d=serializeExpandedRule(_0x1b9690,_0x5a66d0),_0x5a8382=_0x447aa2[_0x4bebc5(0x151)](_0x279d1d)||[];_0x5a8382['push']({'name':_0x35217d,'index':_0x22b536}),_0x447aa2['set'](_0x279d1d,_0x5a8382),_0x22b536++;}const _0x2f6d4f=new Map();for(const [_0x5c7035,_0x3b0f7c]of _0x447aa2){const _0x5661ca=_0x3b0f7c[_0x4bebc5(0x18f)]()[_0x4bebc5(0x172)]((_0x26d404,_0x5928be)=>{const _0x4078d4=_0x4bebc5,_0x3c5d96=_0x48acd3[_0x4078d4(0x151)](_0x26d404[_0x4078d4(0xf2)])||0x0,_0x3ea8e2=_0x48acd3[_0x4078d4(0x151)](_0x5928be[_0x4078d4(0xf2)])||0x0;if(_0x3c5d96!==_0x3ea8e2)return _0x3ea8e2-_0x3c5d96;return _0x26d404[_0x4078d4(0x1cf)]-_0x5928be[_0x4078d4(0x1cf)];})[_0x4bebc5(0x15f)](_0x8d3963=>_0x8d3963['name']),_0x1dbc77=[];for(const _0x3211bc of _0x5661ca){const _0x4e2a63=_0x48acd3[_0x4bebc5(0x151)](_0x3211bc)||0x0,_0x457fc9=Math[_0x4bebc5(0x16f)](_0x4e2a63,0x1);for(let _0x38fd68=0x0;_0x38fd68<_0x457fc9;_0x38fd68++){_0x1dbc77[_0x4bebc5(0x12d)](_0x3211bc);}}_0x2f6d4f['set'](_0x5c7035,_0x1dbc77);}return{'existingLocalSegmentNames':_0x44dedc,'localSegmentRules':_0x5a66d0,'localExpandedRuleToNames':_0x2f6d4f};}async function buildServerSegmentRuleMap(_0x304fca,_0x2655f6,_0x4b5f4e,_0x75b01e){const _0x47bb61=new Map(),_0x519392=new Set(),_0x130b9b=async _0x3b9871=>{const _0x29de29=a119_0x54fc;if(_0x519392[_0x29de29(0x1be)](_0x3b9871))return;_0x519392[_0x29de29(0x147)](_0x3b9871);let _0x3faf0b=_0x4b5f4e[_0x29de29(0x1aa)](_0x3b428e=>_0x3b428e['id']===_0x3b9871);if(!_0x3faf0b)try{_0x3faf0b=await _0x304fca[_0x29de29(0x17f)]['getSegment'](_0x2655f6,_0x3b9871);}catch{return;}if(!_0x3faf0b?.[_0x29de29(0x148)])return;const _0x1881d1=apiRuleToYaml(_0x3faf0b[_0x29de29(0x148)]);_0x47bb61['set'](_0x3b9871,_0x1881d1);const _0x31ff68=collectSegmentRefsFromRule(_0x1881d1);for(const _0x3389b3 of _0x31ff68){await _0x130b9b(_0x3389b3);}};for(const _0x42a77a of _0x75b01e){await _0x130b9b(_0x42a77a);}return _0x47bb61;}export function createSegmentIdResolver(_0x305651,_0x520eae){return async _0x4a4622=>{const _0x4fda21=a119_0x54fc,_0x277ad7=_0x305651[_0x4fda21(0x151)](_0x4a4622);if(!_0x277ad7)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x4a4622+_0x4fda21(0x174)+_0x520eae+'\x27)');return _0x277ad7;};}export function extractRootFolderId(_0x307a26){const _0x4086a2=a119_0x2de80c;return _0x307a26[_0x4086a2(0x18e)]?.[_0x4086a2(0x1ac)]?.[_0x4086a2(0x1b0)]?.['id']||_0x307a26[_0x4086a2(0x18e)]?.[_0x4086a2(0x166)]?.[_0x4086a2(0x1b0)]?.['id'];}export function buildConnectionMaps(_0x5a52be){const _0x2f530b=a119_0x2de80c,_0x32d864=new Map(),_0x16c1bc=new Map(),_0x23cc9d=new Map();for(const _0x1c7e0f of _0x5a52be){_0x32d864[_0x2f530b(0x17d)](_0x1c7e0f['name'],parseInt(_0x1c7e0f['id'],0xa)),_0x16c1bc['set'](_0x1c7e0f['id'],_0x1c7e0f[_0x2f530b(0xf2)]),_0x23cc9d[_0x2f530b(0x17d)](_0x1c7e0f[_0x2f530b(0xf2)],_0x1c7e0f[_0x2f530b(0xff)]);}return{'nameToId':_0x32d864,'idToName':_0x16c1bc,'nameToType':_0x23cc9d};}export function calculatePushStats(_0x4b394f,_0x3f78dd,_0x238686,_0x43e96b,_0x120515,_0x568dc7,_0x4b906b){const _0x2d90f9=a119_0x2de80c,_0x41a821=_0x4b394f[_0x2d90f9(0x1b7)](_0x6ce3c3=>_0x6ce3c3['isNew']),_0x4945b1=_0x4b394f['filter'](_0x1c05c3=>!_0x1c05c3[_0x2d90f9(0x1b2)]&&_0x1c05c3[_0x2d90f9(0x12a)]),_0x9ba15a=_0x4b394f[_0x2d90f9(0x1b7)](_0x49702e=>!_0x49702e[_0x2d90f9(0x1b2)]&&!_0x49702e['hasChanges']),_0x5824f0=_0x568dc7?_0x43e96b:[],_0x5ceb82=_0x3f78dd[_0x2d90f9(0x1b7)](_0x2ec34e=>_0x2ec34e[_0x2d90f9(0x1b2)]),_0x5ef063=_0x3f78dd[_0x2d90f9(0x1b7)](_0x27331a=>!_0x27331a[_0x2d90f9(0x1b2)]&&_0x27331a[_0x2d90f9(0x12a)]),_0x42808a=_0x3f78dd['filter'](_0x7f47c8=>!_0x7f47c8[_0x2d90f9(0x1b2)]&&!_0x7f47c8[_0x2d90f9(0x12a)]),_0x2a98fe=_0x568dc7?_0x120515:[],_0x21d0f1=_0x4b394f[_0x2d90f9(0x189)](_0x118f97=>_0x118f97[_0x2d90f9(0x17e)]),_0xc89922=_0x21d0f1[_0x2d90f9(0x1b7)](_0x32e48a=>_0x32e48a[_0x2d90f9(0xff)]==='create'),_0x21c13a=_0x21d0f1[_0x2d90f9(0x1b7)](_0x3b0a25=>_0x3b0a25[_0x2d90f9(0xff)]==='update'),_0x21f2c4=_0x21d0f1['filter'](_0x2cd5ba=>_0x2cd5ba[_0x2d90f9(0xff)]===_0x2d90f9(0x1cc)),_0x27a4fc=Array[_0x2d90f9(0x150)](_0x238686)[_0x2d90f9(0x172)](),_0x3aab41=_0x4b906b?![]:_0x41a821[_0x2d90f9(0x175)]>0x0||_0x4945b1[_0x2d90f9(0x175)]>0x0||_0x5824f0[_0x2d90f9(0x175)]>0x0,_0x3def70=_0x5ceb82[_0x2d90f9(0x175)]>0x0||_0x5ef063[_0x2d90f9(0x175)]>0x0||_0x2a98fe[_0x2d90f9(0x175)]>0x0,_0x452e42=_0x4b906b?![]:_0x21d0f1[_0x2d90f9(0x175)]>0x0,_0x43d6b8=_0x27a4fc[_0x2d90f9(0x175)]>0x0;return{'segments':{'new':_0x41a821,'changed':_0x4945b1,'unchanged':_0x9ba15a,'toDelete':_0x5824f0},'journeys':{'new':_0x5ceb82,'changed':_0x5ef063,'unchanged':_0x42808a,'toDelete':_0x2a98fe},'activations':{'all':_0x21d0f1,'toCreate':_0xc89922,'toUpdate':_0x21c13a,'toDelete':_0x21f2c4},'folders':{'toCreate':_0x27a4fc},'counts':{'segments':{'new':_0x41a821[_0x2d90f9(0x175)],'changed':_0x4945b1[_0x2d90f9(0x175)],'unchanged':_0x9ba15a[_0x2d90f9(0x175)],'toDelete':_0x5824f0[_0x2d90f9(0x175)]},'journeys':{'new':_0x5ceb82[_0x2d90f9(0x175)],'changed':_0x5ef063['length'],'unchanged':_0x42808a['length'],'toDelete':_0x2a98fe[_0x2d90f9(0x175)]},'activations':{'create':_0xc89922[_0x2d90f9(0x175)],'update':_0x21c13a[_0x2d90f9(0x175)],'delete':_0x21f2c4[_0x2d90f9(0x175)]},'folders':_0x27a4fc[_0x2d90f9(0x175)]},'hasChanges':_0x3aab41||_0x3def70||_0x452e42||_0x43d6b8};}export async function buildPushExecutionContext(_0x36fd80,_0x15231d,_0x33550c,_0x4fe223,_0x716085,_0x3a58cd){const _0x2098b0=a119_0x2de80c,_0x127468=extractRootFolderId(_0x33550c),{pathToId:_0x572686,idToPath:_0x1af974}=buildFolderMaps(_0x716085),_0x20806a=buildSegmentNameToIdMap(_0x4fe223),_0x3fd6c6=new Map(),{batchAsync:_0x7a1500}=await import('../../utils/async.js'),[_0x37d4e6,_0x34b195]=await Promise[_0x2098b0(0x10f)]([_0x36fd80['user'][_0x2098b0(0x15a)](),_0x36fd80[_0x2098b0(0x143)][_0x2098b0(0x1af)](),((async()=>{!_0x3a58cd&&_0x4fe223['length']>0x0&&await _0x7a1500(_0x4fe223,async _0x1b9f4d=>{const _0x306bc0=a119_0x54fc,_0x4b0dbf=await _0x36fd80['segment'][_0x306bc0(0x1a0)](_0x15231d,_0x1b9f4d['id']);_0x3fd6c6[_0x306bc0(0x17d)](_0x1b9f4d['id'],_0x4b0dbf);});})())]),{emailToId:_0x48701d,idToEmail:_0x4b839d}=_0x37d4e6,_0x5ea3b9=buildConnectionMaps(_0x34b195);return{'rootFolderId':_0x127468,'folderPathToId':_0x572686,'folderIdToPath':_0x1af974,'segmentNameToId':_0x20806a,'activationsBySegmentId':_0x3fd6c6,'emailToIdMap':_0x48701d,'idToEmailMap':_0x4b839d,'connectionNameToIdMap':_0x5ea3b9[_0x2098b0(0x12f)],'connectionIdToNameMap':_0x5ea3b9[_0x2098b0(0x10c)],'connectionNameToTypeMap':_0x5ea3b9[_0x2098b0(0x197)]};}function a119_0x75ee(){const _0x21a7b9=['journeyActivationNameToId','schedule','Stage\x20\x27','idToEmailMap','updateSegmentById','getSegment','dirname','Journey\x20\x27','879057gvJfRz','update','createActivation','progress','delete','goal','includes','index','fetchJourney','deps','Failed\x20to\x20','onProgress','absolutePath','createFolder','segmentFolderId','activation_template_id','attributes','Segment\x20not\x20found:\x20','name','ACTIVATION_SYNTAX_ERROR','embedded_segment_created','toLowerCase','folderId','DecisionPoint','\x20activation\x20\x27','diff','deleted','Deleted\x20activation\x20\x27','create','396737Obuehc','39988aorqpl','type','logWarning','behavior','parse','action','existingActivation','Deleted\x20segment\x20\x27','\x27\x20from\x20file:\x20','parseDocument','parentId','journey','Activation\x20not\x20found:\x20','embedded_activation_created','idToName','Updated\x20segment\x20\x27','segment_updating','all','connectionIdToNameMap','localSegmentRules','versionNumber','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','../../utils/async.js','NOT_FOUND','Updated\x20journey\x20\x27','state','journeyActivationStepId','stages','journeyId','journey_created','Creating\x20segment\x20\x27','utf-8','sha1','withProgress','milestone','segmentId','toString','existingSegments','):\x20','values','activations','activationContext','\x20segment\x20from\x20file:\x20','Deleting\x20activation\x20\x27','hasChanges','Fetching\x20','updated','push','activation_created','nameToId','Activation','Creating\x20folder\x20\x27','journeyById','results','\x27\x20milestone','createdSegmentId','JOURNEY_SYNTAX_ERROR','valid','\x27\x20for\x20','journeys','resolveSegment','digest','folderPath','steps','stringify','__pending_act_','activationStepsById','startsWith','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','connection','rootFolderId','WaitStep','activationParams','add','rule','notification','segment_deleted','entries','195MbkGUv','6qYoFhA','goal\x20criteria','segments','from','get','unchanged','logDeleted','updateActivation','decision_point','split','embeddedSegmentNameToId','Created\x20folder\x20\x27','waitCondition','buildUserMaps','keys','848364PcjXqu','skipSegments','2521099GMZegE','map','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','kind','isArray','relative','journeyBundleName','segment_created','parentFolder','Creating\x20activation\x20\x27','join','getActivation','stage\x20\x27','createJourneySegment','./child-segment-yaml.js','description','4783UnKcqT','max','activationsBySegmentId','\x27\x20wait\x20condition','sort','existingSegment','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','length','Created\x20journey\x20\x27','object','journey_updated','journey_updating','Updating\x20activation\x20\x27','journeyBundlesByFolderAndName','INTERNAL','set','activationActions','segment','entry_criteria','getJourney','folder_created','createdSegmentIds','\x20(referenced\x20in\x20journey\x20','logInfo','activation_deleted','JOURNEY_UPDATE_ERROR','size','flatMap','Updated\x20activation\x20\x27','segmentNameToId','verbose','Entry\x20criteria:\x20','relationships','slice','message','activation_updated','columns','yamlActivation','connector_config','replace','trim','nameToType','exitCriterias','\x20error(s)','created','segment_updated','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','branches','segmentByFolderAndName','3332020FVcvYa','listActivations','folderPathToId','embedded_activation_creating','yamlConfig','logSuccess','activation_','createSegment','Updating\x20segment\x20\x27','item','\x0a\x20\x20','find','effectiveFolderId','parentSegmentFolder','all_columns','entryCriteria','list','data','journeyStages','isNew','16znUKpL','78jxLdmS','activation_deleting','./journey-yaml.js','filter','SEGMENT_UPDATE_ERROR','segment_deleting','validatedRequest','folder','existingJourney','\x27...','has','ACTIVATION_UPDATE_ERROR'];a119_0x75ee=function(){return _0x21a7b9;};return a119_0x75ee();}export function createPushYamlContextForBundle(_0x1137d9,_0x2a37e1,_0x54b16d,_0x31971d,_0x13a1a8,_0xed43d6,_0x2304f1,_0x2b57eb){const {existingLocalSegmentNames:_0x47cdd0,localExpandedRuleToNames:_0x91e719}=_0x31971d,_0x5d4a06=new Set(),_0x4d51ec=new Map(),_0x38cd3b=new Map(),_0x42d8e1=new Map(),_0xe3ebdd=createJumpTargetCache(),_0x21d51a=new Map(),_0x5a7ea8=new Map(),_0x206f7a=new Set();let _0x484840;const _0x10f4ce=_0x5098a4=>{const _0x45bd93={'resolveSegment':async _0x2f6960=>{const _0x33f26a=a119_0x54fc,_0x3f10c0=_0x42d8e1[_0x33f26a(0x151)](_0x2f6960);if(_0x3f10c0!==undefined)return{'name':_0x3f10c0,'isJourneyLocal':!![]};try{let _0x5156c0=_0x54b16d[_0x33f26a(0x1aa)](_0x347030=>_0x347030['id']===_0x2f6960);!_0x5156c0&&(_0x5156c0=await _0x1137d9[_0x33f26a(0x17f)]['getSegment'](_0x2a37e1,_0x2f6960));const _0x2cea1c=generateJourneyLocalName(_0x5156c0[_0x33f26a(0xf2)]),_0x1555d0=_0x5156c0[_0x33f26a(0x161)]===SEGMENT_KIND_JOURNEY&&_0x2cea1c!==undefined;let _0x20edb1=_0x5156c0['name'],_0x2e5319;if(_0x1555d0&&_0x5156c0[_0x33f26a(0x148)]){const _0x31bca5=apiRuleToYaml(_0x5156c0[_0x33f26a(0x148)]);_0x5a7ea8[_0x33f26a(0x17d)](_0x2f6960,_0x31bca5);const _0x175e8c=async _0x344756=>{const _0x14c433=_0x33f26a,_0x201e56=collectSegmentRefsFromRule(_0x344756);for(const _0x1036df of _0x201e56){if(!_0x5a7ea8[_0x14c433(0x1be)](_0x1036df))try{const _0x19a4a5=await _0x1137d9[_0x14c433(0x17f)]['getSegment'](_0x2a37e1,_0x1036df);if(_0x19a4a5?.[_0x14c433(0x148)]){const _0x3db61d=apiRuleToYaml(_0x19a4a5[_0x14c433(0x148)]);_0x5a7ea8[_0x14c433(0x17d)](_0x1036df,_0x3db61d),await _0x175e8c(_0x3db61d);}}catch{}}};await _0x175e8c(_0x31bca5);const _0x9b4af2=serializeExpandedRule(_0x31bca5,_0x5a7ea8),_0x236b13=_0x91e719[_0x33f26a(0x151)](_0x9b4af2);if(_0x236b13&&_0x236b13['length']>0x0){const _0x36be78=_0x4d51ec[_0x33f26a(0x151)](_0x9b4af2)||0x0,_0x8b145d=_0x236b13[_0x36be78]||_0x236b13[_0x236b13[_0x33f26a(0x175)]-0x1];_0x4d51ec['set'](_0x9b4af2,_0x36be78+0x1),_0x20edb1=_0x8b145d,_0x5d4a06[_0x33f26a(0x147)](_0x20edb1),_0x42d8e1['set'](_0x2f6960,_0x20edb1);const _0x546dbd=await resolveRuleSegmentRefs(_0x31bca5,async _0x43e87a=>{const _0x9d5c54=_0x33f26a,_0x5d1273=_0x42d8e1[_0x9d5c54(0x151)](_0x43e87a);if(_0x5d1273)return _0x5d1273;const _0x355457=await _0x484840[_0x9d5c54(0x13a)](_0x43e87a);return _0x355457[_0x9d5c54(0xf2)];});_0x2e5319={'description':_0x5156c0[_0x33f26a(0x16d)],'rule':_0x546dbd};}else{const _0x3a86a7=_0x21d51a[_0x33f26a(0x151)](_0x9b4af2);if(_0x3a86a7)_0x20edb1=_0x3a86a7,_0x42d8e1['set'](_0x2f6960,_0x20edb1);else{if(_0x2cea1c){let _0x1586eb=_0x2cea1c,_0x3f934a=0x2;while(_0x5d4a06['has'](_0x1586eb)||_0x47cdd0[_0x33f26a(0x1be)](_0x1586eb)){_0x1586eb=_0x2cea1c+'_'+_0x3f934a,_0x3f934a++;}_0x5d4a06[_0x33f26a(0x147)](_0x1586eb),_0x20edb1=_0x1586eb;}_0x42d8e1[_0x33f26a(0x17d)](_0x2f6960,_0x20edb1),_0x21d51a[_0x33f26a(0x17d)](_0x9b4af2,_0x20edb1);const _0x180ae3=await resolveRuleSegmentRefs(_0x31bca5,async _0x359371=>{const _0x21f0e1=_0x33f26a,_0x280a2d=_0x42d8e1[_0x21f0e1(0x151)](_0x359371);if(_0x280a2d)return _0x280a2d;const _0x3ee1b6=await _0x484840['resolveSegment'](_0x359371);return _0x3ee1b6[_0x21f0e1(0xf2)];});_0x2e5319={'description':_0x5156c0[_0x33f26a(0x16d)],'rule':_0x180ae3};}}}return{'name':_0x20edb1,'isJourneyLocal':_0x1555d0,'definition':_0x2e5319};}catch{return{'name':_0x2f6960,'isJourneyLocal':![]};}},'resolveActivation':async _0x367e0c=>{const _0x228f25=a119_0x54fc,_0x3690d9=_0x38cd3b[_0x228f25(0x151)](_0x367e0c);if(_0x3690d9!==undefined)return{'name':_0x3690d9,'isJourneyLocal':!![]};try{let _0x16be70=_0x2304f1?.[_0x228f25(0x151)](_0x367e0c);!_0x16be70&&(_0x16be70=await _0x1137d9[_0x228f25(0x109)][_0x228f25(0x169)](_0x5098a4,_0x367e0c));const _0x53d813=_0x16be70['attributes'][_0x228f25(0x146)][_0x228f25(0xf2)]||_0x367e0c,_0x59a9ba=sanitizeYamlKey(_0x53d813)||_0x228f25(0x1a5)+_0x367e0c,_0x843da5=_0x59a9ba;_0x38cd3b[_0x228f25(0x17d)](_0x367e0c,_0x843da5);const _0x4d9dcc=journeyActivationStepToYaml(_0x16be70,_0x13a1a8,_0xed43d6);return{'name':_0x843da5,'isJourneyLocal':!![],'definition':_0x4d9dcc};}catch{return{'name':_0x367e0c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x9051f6,_0x29addc)=>resolveJumpTarget(_0x9051f6,_0x29addc,_0xe3ebdd,async _0x5b2ca3=>{const _0x45fdf4=a119_0x54fc,_0x14c0b3=_0x2b57eb?.[_0x45fdf4(0x151)](_0x5b2ca3);if(_0x14c0b3)return _0x14c0b3;return _0x1137d9[_0x45fdf4(0x109)][_0x45fdf4(0x181)](_0x5b2ca3);})};return _0x484840=_0x45bd93,_0x45bd93;},_0x25b10e=async _0x503250=>{const _0x26305d=a119_0x54fc,{collectSegmentIdsFromJourneyApi:_0x5b7eb0}=await import(_0x26305d(0x1b6)),{batchAsync:_0x378db8}=await import('../../utils/async.js'),_0x507464=new Set();for(const _0x4c8041 of _0x503250){let _0x39b1ea=_0x2b57eb?.[_0x26305d(0x151)](_0x4c8041);!_0x39b1ea&&(_0x39b1ea=await _0x1137d9[_0x26305d(0x109)][_0x26305d(0x181)](_0x4c8041));const _0x31e9a0=_0x5b7eb0(_0x39b1ea);for(const _0x36ac94 of _0x31e9a0){_0x507464[_0x26305d(0x147)](_0x36ac94);}}let _0x4fcea0=Array[_0x26305d(0x150)](_0x507464);while(_0x4fcea0[_0x26305d(0x175)]>0x0){const _0x1d4236=_0x4fcea0['filter'](_0x5615a6=>!_0x206f7a[_0x26305d(0x1be)](_0x5615a6));if(_0x1d4236[_0x26305d(0x175)]===0x0)break;const _0x4140bf=await _0x378db8(_0x1d4236,async _0x10397d=>{const _0x3c4818=_0x26305d;_0x206f7a[_0x3c4818(0x147)](_0x10397d);let _0x4ac4a5=_0x54b16d[_0x3c4818(0x1aa)](_0x127a25=>_0x127a25['id']===_0x10397d);if(!_0x4ac4a5)try{_0x4ac4a5=await _0x1137d9[_0x3c4818(0x17f)][_0x3c4818(0x1c5)](_0x2a37e1,_0x10397d);}catch{return null;}return{'segmentId':_0x10397d,'segment':_0x4ac4a5};},0xa),_0x4b4ce0=new Set();for(const _0x4e52bc of _0x4140bf){if(!_0x4e52bc?.['segment']?.[_0x26305d(0x148)])continue;const _0x20cfd2=apiRuleToYaml(_0x4e52bc[_0x26305d(0x17f)][_0x26305d(0x148)]);_0x5a7ea8[_0x26305d(0x17d)](_0x4e52bc[_0x26305d(0x121)],_0x20cfd2);const _0x34a50c=collectSegmentRefsFromRule(_0x20cfd2);for(const _0x1535df of _0x34a50c){!_0x206f7a['has'](_0x1535df)&&_0x4b4ce0[_0x26305d(0x147)](_0x1535df);}}_0x4fcea0=Array[_0x26305d(0x150)](_0x4b4ce0);}};return{'createYamlContext':_0x10f4ce,'prefetchJourneySegments':_0x25b10e};}export async function executePushSegments(_0x17a58c,_0x395537,_0x7bc392,_0x82465f,_0x557c68){const _0x381b15=a119_0x2de80c,{segmentDefToCreateRequest:_0x3493bf,segmentDefToUpdateRequest:_0x3d4798}=await import(_0x381b15(0x16c)),_0x5c9b0c=_0x7bc392[_0x381b15(0x1a1)],_0x160735=0x5,_0x2c5c9f=async _0x5ca8de=>{const _0x1558d9=_0x381b15,_0x68fdca=_0x5ca8de['folderPath']?_0x5c9b0c[_0x1558d9(0x151)](_0x5ca8de[_0x1558d9(0x13c)]):undefined;let _0x161f8c;const _0x15a65={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5ca8de[_0x1558d9(0x1b2)]){_0x557c68['onProgress']?.({'type':'segment_creating','name':_0x5ca8de['yamlConfig']['name']});const _0x5d968a=_0x3493bf(_0x5ca8de[_0x1558d9(0x1a3)],_0x68fdca),_0x271d08=await _0x557c68['withProgress'](_0x1558d9(0x11c)+_0x5ca8de['yamlConfig'][_0x1558d9(0xf2)]+_0x1558d9(0x1bd),()=>_0x17a58c[_0x1558d9(0x17f)][_0x1558d9(0x1a6)](_0x82465f[_0x1558d9(0x108)],_0x5d968a));_0x161f8c=_0x271d08[_0x1558d9(0x1b0)]['id'],_0x15a65[_0x1558d9(0x135)]={'name':_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)],'id':_0x161f8c},_0x557c68[_0x1558d9(0xeb)]?.({'type':_0x1558d9(0x165),'name':_0x5ca8de['yamlConfig']['name'],'segmentId':_0x161f8c}),_0x557c68[_0x1558d9(0x1a4)]?.('Created\x20segment\x20\x27'+_0x5ca8de[_0x1558d9(0x1a3)]['name']+'\x27'),_0x15a65[_0x1558d9(0x19a)]=0x1;}else{if(_0x5ca8de[_0x1558d9(0x12a)]){_0x557c68[_0x1558d9(0xeb)]?.({'type':_0x1558d9(0x10e),'name':_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)]});const _0x323470=_0x3d4798(_0x5ca8de[_0x1558d9(0x1a3)]);_0x68fdca!==_0x5ca8de[_0x1558d9(0x173)]?.['segmentFolderId']&&(_0x323470[_0x1558d9(0xee)]=_0x68fdca?parseInt(_0x68fdca,0xa):undefined),await _0x557c68[_0x1558d9(0x11f)](_0x1558d9(0x1a7)+_0x5ca8de['yamlConfig'][_0x1558d9(0xf2)]+_0x1558d9(0x1bd),()=>_0x17a58c[_0x1558d9(0x17f)][_0x1558d9(0x1c4)](_0x82465f[_0x1558d9(0x108)],_0x5ca8de['existingSegment']['id'],_0x323470)),_0x161f8c=_0x5ca8de[_0x1558d9(0x173)]['id'],_0x557c68['onProgress']?.({'type':_0x1558d9(0x19b),'name':_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)]}),_0x557c68[_0x1558d9(0x1a4)]?.(_0x1558d9(0x10d)+_0x5ca8de[_0x1558d9(0x1a3)]['name']+'\x27'),_0x15a65[_0x1558d9(0x12c)]=0x1;}else _0x161f8c=_0x5ca8de['existingSegment']['id'];}}catch(_0x2f07e2){const _0x6ae7f8=isHttp400Error(_0x2f07e2),_0x4f52d3=_0x6ae7f8?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1558d9(0x1b8)],_0x2e340d=getErrorMessage(_0x2f07e2);throw new SDKError(_0x4f52d3,_0x1558d9(0xea)+(_0x5ca8de[_0x1558d9(0x1b2)]?_0x1558d9(0xfc):_0x1558d9(0x1c9))+_0x1558d9(0x128)+_0x5ca8de['absolutePath']+_0x1558d9(0x1a9)+_0x2e340d,_0x2f07e2);}try{const _0x1d6c13=await syncActivationsForSegment(_0x17a58c,_0x82465f['parentId'],_0x161f8c,_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)],_0x5ca8de['activationActions'],_0x557c68,_0x5ca8de[_0x1558d9(0xec)]);_0x15a65['activations']=_0x1d6c13;}catch(_0xa5d926){if(_0xa5d926 instanceof SDKError)throw _0xa5d926;throw new SDKError(ErrorCode[_0x1558d9(0x1bf)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x5ca8de[_0x1558d9(0x1a3)][_0x1558d9(0xf2)]+_0x1558d9(0x106)+_0x5ca8de['absolutePath']+_0x1558d9(0x1a9)+getErrorMessage(_0xa5d926),_0xa5d926);}return _0x15a65;},_0x2b91b8=await batchAsync(_0x395537,_0x2c5c9f,_0x160735),_0x42e800={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5daf42 of _0x2b91b8){_0x42e800[_0x381b15(0x19a)]+=_0x5daf42['created'],_0x42e800[_0x381b15(0x12c)]+=_0x5daf42[_0x381b15(0x12c)],_0x5daf42[_0x381b15(0x135)]&&_0x42e800[_0x381b15(0x183)][_0x381b15(0x17d)](_0x5daf42[_0x381b15(0x135)]['name'],_0x5daf42['createdSegmentId']['id']),_0x42e800['activations'][_0x381b15(0x19a)]+=_0x5daf42[_0x381b15(0x126)][_0x381b15(0x19a)],_0x42e800['activations'][_0x381b15(0x12c)]+=_0x5daf42[_0x381b15(0x126)]['updated'],_0x42e800[_0x381b15(0x126)][_0x381b15(0xfa)]+=_0x5daf42[_0x381b15(0x126)][_0x381b15(0xfa)];}return _0x42e800;}async function syncActivationsForSegment(_0x542446,_0x115886,_0x1232dc,_0x1c10db,_0x3c15a0,_0x13fb8b,_0x45ea78){const _0x449833=a119_0x2de80c,_0x18d114={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xbf6041 of _0x3c15a0){try{if(_0xbf6041[_0x449833(0xff)]===_0x449833(0xfc)&&_0xbf6041[_0x449833(0x1ba)])_0x13fb8b[_0x449833(0xeb)]?.({'type':'activation_creating','segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),await _0x13fb8b[_0x449833(0x11f)](_0x449833(0x167)+_0xbf6041[_0x449833(0xf2)]+'\x27...',()=>_0x542446[_0x449833(0x17f)][_0x449833(0x1ca)](_0x115886,_0x1232dc,_0xbf6041[_0x449833(0x1ba)])),_0x13fb8b['onProgress']?.({'type':_0x449833(0x12e),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),_0x13fb8b[_0x449833(0x1a4)]?.('Created\x20activation\x20\x27'+_0xbf6041['name']+'\x27'),_0x18d114[_0x449833(0x19a)]++;else{if(_0xbf6041[_0x449833(0xff)]===_0x449833(0x1c9)&&_0xbf6041[_0x449833(0x1ba)]&&_0xbf6041['existingActivation'])_0x13fb8b[_0x449833(0xeb)]?.({'type':'activation_updating','segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),await _0x13fb8b[_0x449833(0x11f)](_0x449833(0x17a)+_0xbf6041[_0x449833(0xf2)]+_0x449833(0x1bd),()=>_0x542446[_0x449833(0x17f)][_0x449833(0x154)](_0x115886,_0x1232dc,_0xbf6041[_0x449833(0x104)]['id'],_0xbf6041['validatedRequest'])),_0x13fb8b[_0x449833(0xeb)]?.({'type':_0x449833(0x191),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),_0x13fb8b[_0x449833(0x1a4)]?.(_0x449833(0x18a)+_0xbf6041[_0x449833(0xf2)]+'\x27'),_0x18d114['updated']++;else _0xbf6041[_0x449833(0xff)]===_0x449833(0x1cc)&&_0xbf6041[_0x449833(0x104)]&&(_0x13fb8b[_0x449833(0xeb)]?.({'type':_0x449833(0x1b5),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),await _0x13fb8b['withProgress'](_0x449833(0x129)+_0xbf6041[_0x449833(0xf2)]+_0x449833(0x1bd),()=>_0x542446['segment']['deleteActivation'](_0x115886,_0x1232dc,_0xbf6041[_0x449833(0x104)]['id'])),_0x13fb8b[_0x449833(0xeb)]?.({'type':_0x449833(0x186),'segmentName':_0x1c10db,'activationName':_0xbf6041[_0x449833(0xf2)]}),_0x13fb8b[_0x449833(0x153)]?.(_0x449833(0xfb)+_0xbf6041['name']+'\x27'),_0x18d114['deleted']++);}}catch(_0x21ffb7){const _0x184acc=isHttp400Error(_0x21ffb7),_0x209499=_0x184acc?ErrorCode[_0x449833(0xf3)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x4082c4=getErrorMessage(_0x21ffb7);throw new SDKError(_0x209499,_0x449833(0xea)+_0xbf6041[_0x449833(0xff)]+_0x449833(0xf8)+_0xbf6041[_0x449833(0xf2)]+_0x449833(0x106)+_0x45ea78+'\x0a\x20\x20'+_0x4082c4,_0x21ffb7);}}return _0x18d114;}export async function executePushFolders(_0x20eb8f,_0x44402e,_0x13b952,_0x391483,_0x260eec){const _0x291379=a119_0x2de80c,_0x27b508=new Map(_0x13b952);for(const _0x21fe58 of _0x44402e){const _0x1ade53=_0x21fe58[_0x291379(0x156)]('/'),_0x2cfb14=_0x1ade53[_0x1ade53['length']-0x1],_0x49cef8=_0x1ade53['slice'](0x0,-0x1)[_0x291379(0x168)]('/'),_0x56a726=_0x27b508[_0x291379(0x151)](_0x49cef8);_0x260eec['onProgress']?.({'type':'folder_creating','folder':_0x21fe58});const _0x10d671={'name':_0x2cfb14,'parentFolderId':_0x56a726},_0x13b7a7=await _0x260eec[_0x291379(0x11f)](_0x291379(0x131)+_0x21fe58+_0x291379(0x1bd),()=>_0x20eb8f[_0x291379(0x17f)][_0x291379(0xed)](_0x391483[_0x291379(0x108)],_0x10d671));_0x27b508[_0x291379(0x17d)](_0x21fe58,_0x13b7a7['data']['id']),_0x260eec[_0x291379(0xeb)]?.({'type':_0x291379(0x182),'folder':_0x21fe58,'folderId':_0x13b7a7[_0x291379(0x1b0)]['id']}),_0x260eec[_0x291379(0x185)]?.(_0x291379(0x158)+_0x21fe58+'\x27');}return _0x27b508;}export async function executePushSegmentDeletions(_0x515bcc,_0x1bf1e6,_0x2a9f6d){const _0xacdff7=a119_0x2de80c;if(_0x1bf1e6[_0xacdff7(0x175)]===0x0)return 0x0;const {batchAsync:_0x914f60}=await import(_0xacdff7(0x114)),_0x5b9a9f=0x5,_0x4547d2=await _0x914f60(_0x1bf1e6,async _0x4244dc=>{const _0x2d1c67=_0xacdff7;return _0x2a9f6d[_0x2d1c67(0xeb)]?.({'type':_0x2d1c67(0x1b9),'name':_0x4244dc[_0x2d1c67(0xf2)]}),await _0x515bcc[_0x2d1c67(0x17f)]['deleteSegment'](_0x4244dc['id']),_0x2a9f6d[_0x2d1c67(0xeb)]?.({'type':_0x2d1c67(0x14a),'name':_0x4244dc[_0x2d1c67(0xf2)]}),_0x2a9f6d[_0x2d1c67(0x153)]?.(_0x2d1c67(0x105)+_0x4244dc[_0x2d1c67(0xf2)]+'\x27'),0x1;},_0x5b9a9f);return _0x4547d2['reduce']((_0x29463b,_0x570271)=>_0x29463b+_0x570271,0x0);}export async function executePushJourneys(_0x81a46f,_0x56de91,_0x9fb815,_0x4924da,_0x571f5a){const _0x6301=a119_0x2de80c,{journeyDefToRequest:_0x487688}=await import(_0x6301(0x1b6)),{activationDefToCreateRequest:_0x1bdfc9,yamlRuleToApi:_0x3f44c6,validateSegmentRule:_0x39a799}=await import('./child-segment-yaml.js'),_0x4b08f1={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4e3a6f=new Map(_0x9fb815[_0x6301(0x18b)]),_0x5c33e9=0x5;for(let _0x1ccc0c=0x0;_0x1ccc0c<_0x56de91['length'];_0x1ccc0c+=_0x5c33e9){const _0x3702be=_0x56de91[_0x6301(0x18f)](_0x1ccc0c,_0x1ccc0c+_0x5c33e9),_0x50659e=await Promise[_0x6301(0x10f)](_0x3702be['map'](async _0x2f8968=>{const _0x5a0dcf=_0x6301;if(!_0x2f8968[_0x5a0dcf(0x1b2)]&&!_0x2f8968[_0x5a0dcf(0x12a)])return{'action':_0x5a0dcf(0x152),'name':_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)],'journeyId':_0x2f8968[_0x5a0dcf(0x1bc)]?.['id']};const _0x293d36=_0x2f8968[_0x5a0dcf(0x13c)]?_0x9fb815[_0x5a0dcf(0x1a1)][_0x5a0dcf(0x151)](_0x2f8968[_0x5a0dcf(0x13c)]):undefined;_0x571f5a[_0x5a0dcf(0xeb)]?.({'type':_0x2f8968[_0x5a0dcf(0x1b2)]?'journey_creating':_0x5a0dcf(0x179),'name':_0x2f8968['yamlConfig'][_0x5a0dcf(0xf2)]});try{const _0xf8ca9c=await executeSingleJourneyPush(_0x81a46f,_0x2f8968,{..._0x9fb815,'segmentNameToId':_0x4e3a6f},{'parentId':_0x4924da[_0x5a0dcf(0x108)],'rootFolderId':_0x4924da[_0x5a0dcf(0x144)],'folderId':_0x293d36,'verbose':_0x4924da[_0x5a0dcf(0x18c)]},_0x571f5a,{'journeyDefToRequest':_0x487688,'activationDefToCreateRequest':_0x1bdfc9,'yamlRuleToApi':_0x3f44c6,'validateSegmentRule':_0x39a799});for(const [_0xa129d5,_0x1693eb]of _0xf8ca9c[_0x5a0dcf(0x157)]){_0x4e3a6f[_0x5a0dcf(0x17d)](_0xa129d5,_0x1693eb),_0x4b08f1['embeddedSegmentNameToId'][_0x5a0dcf(0x17d)](_0xa129d5,_0x1693eb);}if(_0xf8ca9c[_0x5a0dcf(0x103)]==='created')_0x571f5a[_0x5a0dcf(0xeb)]?.({'type':_0x5a0dcf(0x11b),'name':_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)],'journeyId':_0xf8ca9c[_0x5a0dcf(0x11a)]}),_0x571f5a[_0x5a0dcf(0x1a4)]?.(_0x5a0dcf(0x176)+_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)]+'\x27'),_0x4b08f1[_0x5a0dcf(0x19a)]++;else _0xf8ca9c[_0x5a0dcf(0x103)]===_0x5a0dcf(0x12c)&&(_0x571f5a[_0x5a0dcf(0xeb)]?.({'type':_0x5a0dcf(0x178),'name':_0x2f8968['yamlConfig']['name']}),_0x571f5a[_0x5a0dcf(0x1a4)]?.(_0x5a0dcf(0x116)+_0x2f8968[_0x5a0dcf(0x1a3)][_0x5a0dcf(0xf2)]+'\x27'),_0x4b08f1[_0x5a0dcf(0x12c)]++);return{'action':_0xf8ca9c[_0x5a0dcf(0x103)],'name':_0x2f8968[_0x5a0dcf(0x1a3)]['name'],'journeyId':_0xf8ca9c[_0x5a0dcf(0x11a)]};}catch(_0x3a7729){const _0xb3458e=isHttp400Error(_0x3a7729),_0x550805=_0xb3458e?ErrorCode[_0x5a0dcf(0x136)]:ErrorCode[_0x5a0dcf(0x187)],_0x5bf7a5=getErrorMessage(_0x3a7729);throw new SDKError(_0x550805,_0x5a0dcf(0xea)+(_0x2f8968['isNew']?'create':_0x5a0dcf(0x1c9))+'\x20journey\x20from\x20file:\x20'+_0x2f8968[_0x5a0dcf(0xec)]+_0x5a0dcf(0x1a9)+_0x5bf7a5,_0x3a7729);}}));_0x4b08f1[_0x6301(0x133)][_0x6301(0x12d)](..._0x50659e);}return _0x4b08f1;}async function executeSingleJourneyPush(_0x207369,_0x28a179,_0x32bf96,_0x3f1c2f,_0x46db3a,_0xf15e72){const _0x364caf=a119_0x2de80c,{journeyDefToRequest:_0x43f9f3,activationDefToCreateRequest:_0x369369,yamlRuleToApi:_0x18efa2,validateSegmentRule:_0x507651}=_0xf15e72,_0x4d5116=new Map(),_0xae56d4=new Map(),_0x2e333c=new Map(),_0x27f239=new Map(),_0x5606da=new Map();let _0x67a2ff;const _0x22a625=async()=>{const _0x11f621=a119_0x54fc;if(_0x67a2ff)return;_0x67a2ff=new Map();if(!_0x28a179[_0x11f621(0x1bc)])return;const _0x44d533=await _0x207369['journey'][_0x11f621(0x1a0)](_0x28a179[_0x11f621(0x1bc)]['id']);for(const _0x1d2e90 of _0x44d533){const _0x5d1d42=journeyActivationStepToYaml(_0x1d2e90,_0x32bf96[_0x11f621(0x1c3)],_0x32bf96['connectionIdToNameMap']),_0x4cf7f9=activationSignature(_0x5d1d42);!_0x67a2ff[_0x11f621(0x1be)](_0x4cf7f9)&&_0x67a2ff[_0x11f621(0x17d)](_0x4cf7f9,_0x1d2e90['id']),_0x5d1d42['name']&&_0xae56d4[_0x11f621(0x17d)](_0x5d1d42[_0x11f621(0xf2)],_0x1d2e90['id']);}};if(_0x28a179[_0x364caf(0x1bc)]&&_0x28a179['yamlConfig'][_0x364caf(0x14f)]){const _0x49e1f5=buildLocalExpandedRuleMappings(_0x28a179[_0x364caf(0x1a3)]),_0x186889=_0x49e1f5[_0x364caf(0x111)];if(_0x186889[_0x364caf(0x188)]>0x0){const _0xe2dbc4=new Map();for(const [_0x487550,_0x34d2fb]of _0x186889){const _0x40f5a3=serializeExpandedRule(_0x34d2fb,_0x186889);_0xe2dbc4['set'](_0x487550,_0x40f5a3);}const _0x1dbb43=collectSegmentIdsFromJourneyApi(_0x28a179['existingJourney']);if(_0x1dbb43[_0x364caf(0x188)]>0x0){const _0x5e10f5=await buildServerSegmentRuleMap(_0x207369,_0x3f1c2f[_0x364caf(0x108)],_0x32bf96['existingSegments'],_0x1dbb43);if(_0x5e10f5['size']>0x0){const _0x1e0c66=new Map();for(const [_0x215f1c,_0x555584]of _0x5e10f5){const _0xec16ae=serializeExpandedRule(_0x555584,_0x5e10f5);!_0x1e0c66[_0x364caf(0x1be)](_0xec16ae)&&_0x1e0c66[_0x364caf(0x17d)](_0xec16ae,_0x215f1c);}for(const [_0x31d63e,_0x1aac73]of _0xe2dbc4){const _0x1e3866=_0x1e0c66[_0x364caf(0x151)](_0x1aac73);_0x1e3866&&(_0x5606da[_0x364caf(0x17d)](_0x31d63e,_0x1e3866),_0x32bf96[_0x364caf(0x18b)][_0x364caf(0x17d)](_0x31d63e,_0x1e3866));}}}}}const _0x3e6982={'resolveSegmentId':async _0x208bf8=>{const _0x484a74=_0x364caf,_0x18111a=_0x32bf96[_0x484a74(0x18b)]['get'](_0x208bf8);if(!_0x18111a)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x484a74(0xf1)+_0x208bf8+_0x484a74(0x184)+_0x28a179[_0x484a74(0x1a3)][_0x484a74(0xf2)]+')');return _0x18111a;},'resolveEmbeddedSegmentId':async(_0x2cbf92,_0x409e00)=>{const _0x5a0a2c=_0x364caf,_0x309443=_0x32bf96[_0x5a0a2c(0x18b)][_0x5a0a2c(0x151)](_0x2cbf92);if(_0x309443)return _0x309443;const _0x1e5445=_0x5606da['get'](_0x2cbf92);if(_0x1e5445)return _0x32bf96[_0x5a0a2c(0x18b)][_0x5a0a2c(0x17d)](_0x2cbf92,_0x1e5445),_0x1e5445;const _0x4e7dfc=_0x32bf96['existingSegments'][_0x5a0a2c(0x1aa)](_0xd96c0b=>_0xd96c0b[_0x5a0a2c(0xf2)]===_0x2cbf92);if(_0x4e7dfc)return _0x32bf96[_0x5a0a2c(0x18b)]['set'](_0x2cbf92,_0x4e7dfc['id']),_0x4e7dfc['id'];if(_0x28a179[_0x5a0a2c(0x1b2)]){const {stageName:_0x88cc89,criteriaName:_0x5643a2}=findSegmentCriteriaLocation(_0x28a179['yamlConfig'],_0x2cbf92);return _0x507651(_0x2cbf92,_0x409e00[_0x5a0a2c(0x148)]),_0x2e333c[_0x5a0a2c(0x17d)](_0x2cbf92,{'definition':_0x409e00,'stageName':_0x88cc89,'criteriaName':_0x5643a2}),createPendingSegmentId(_0x2cbf92);}const _0x261989=_0x28a179[_0x5a0a2c(0x1bc)]?.['id'];if(!_0x261989)throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x507651(_0x2cbf92,_0x409e00[_0x5a0a2c(0x148)]);const _0x10bbcf=generateDeterministicJourneySegmentName(_0x28a179[_0x5a0a2c(0x1a3)]['name'],_0x2cbf92),_0x551785=_0x32bf96[_0x5a0a2c(0x123)]['find'](_0x185c01=>_0x185c01[_0x5a0a2c(0xf2)]===_0x10bbcf),_0x26986b=createSegmentIdResolver(_0x32bf96[_0x5a0a2c(0x18b)],_0x2cbf92),_0x32954c=await resolveRuleSegmentIds(_0x409e00[_0x5a0a2c(0x148)],_0x26986b);let _0x323809;if(_0x551785)await _0x207369[_0x5a0a2c(0x17f)][_0x5a0a2c(0x1c4)](_0x3f1c2f['parentId'],_0x551785['id'],{'description':_0x409e00['description']||'Entry\x20criteria:\x20'+_0x2cbf92,'rule':_0x18efa2(_0x32954c,!![]),'countPopulation':!![]}),_0x323809=_0x551785['id'];else try{_0x323809=await _0x207369['segment'][_0x5a0a2c(0x16b)]({'name':_0x10bbcf,'description':_0x409e00[_0x5a0a2c(0x16d)]||_0x5a0a2c(0x18d)+_0x2cbf92,'journeyId':_0x261989,'rule':_0x18efa2(_0x32954c,!![]),'countPopulation':!![],'parentFolderId':_0x3f1c2f[_0x5a0a2c(0x144)]||'','audienceId':_0x3f1c2f['parentId']});}catch(_0x542e2e){const _0x6cec91=_0x542e2e instanceof Error&&_0x542e2e[_0x5a0a2c(0x190)][_0x5a0a2c(0x1ce)]('Name\x20has\x20already\x20been\x20taken');if(_0x6cec91){const _0xc1d6be=await _0x207369[_0x5a0a2c(0x17f)]['listSegments'](_0x3f1c2f[_0x5a0a2c(0x108)]),_0x36885c=_0xc1d6be[_0x5a0a2c(0x1aa)](_0x6e70f2=>_0x6e70f2[_0x5a0a2c(0xf2)]===_0x10bbcf);if(_0x36885c)await _0x207369[_0x5a0a2c(0x17f)][_0x5a0a2c(0x1c4)](_0x3f1c2f[_0x5a0a2c(0x108)],_0x36885c['id'],{'description':_0x409e00[_0x5a0a2c(0x16d)]||_0x5a0a2c(0x18d)+_0x2cbf92,'rule':_0x18efa2(_0x32954c,!![]),'countPopulation':!![]}),_0x323809=_0x36885c['id'];else throw _0x542e2e;}else throw _0x542e2e;}return _0x32bf96[_0x5a0a2c(0x18b)][_0x5a0a2c(0x17d)](_0x2cbf92,_0x323809),_0x4d5116[_0x5a0a2c(0x17d)](_0x2cbf92,_0x323809),_0x323809;},'resolveActivationId':async _0x37283e=>{const _0x1bc1f2=_0x364caf,_0x1277b9=_0xae56d4[_0x1bc1f2(0x151)](_0x37283e);if(_0x1277b9)return _0x1277b9;if(_0x28a179[_0x1bc1f2(0x1bc)]){await _0x22a625();const _0x418e6c=_0xae56d4['get'](_0x37283e);if(_0x418e6c)return _0x418e6c;}throw new SDKError(ErrorCode[_0x1bc1f2(0x115)],_0x1bc1f2(0x10a)+_0x37283e+_0x1bc1f2(0x184)+_0x28a179['yamlConfig'][_0x1bc1f2(0xf2)]+').\x20'+_0x1bc1f2(0x160));},'resolveEmbeddedActivationId':async(_0x4c6c47,_0x2800e8)=>{const _0x4986f9=_0x364caf,_0x22bff4=_0xae56d4[_0x4986f9(0x151)](_0x4c6c47);if(_0x22bff4)return _0x22bff4;if(_0x28a179[_0x4986f9(0x1b2)])return _0x27f239[_0x4986f9(0x17d)](_0x4c6c47,_0x2800e8),createPendingActivationId(_0x4c6c47);if(_0x28a179[_0x4986f9(0x1bc)]){await _0x22a625();const _0x27fac8=_0xae56d4[_0x4986f9(0x151)](_0x2800e8[_0x4986f9(0xf2)]);if(_0x27fac8)return _0xae56d4[_0x4986f9(0x17d)](_0x4c6c47,_0x27fac8),_0x27fac8;const _0x56bb24=activationSignature(_0x2800e8),_0x4b9102=_0x67a2ff?.[_0x4986f9(0x151)](_0x56bb24);if(_0x4b9102)return _0xae56d4[_0x4986f9(0x17d)](_0x4c6c47,_0x4b9102),_0x4b9102;const _0x288fb4=await _0x369369(_0x2800e8,_0x32bf96['activationContext']),_0x4cb7bc=await _0x207369[_0x4986f9(0x109)][_0x4986f9(0x1ca)](_0x28a179[_0x4986f9(0x1bc)]['id'],_0x288fb4);return _0xae56d4[_0x4986f9(0x17d)](_0x4c6c47,_0x4cb7bc['id']),_0x4cb7bc['id'];}throw new SDKError(ErrorCode[_0x4986f9(0x17c)],_0x4986f9(0x142));},'resolveJourneyId':async _0x4c0ba6=>{const _0x582b94=_0x364caf;try{return await _0x207369['journey']['resolveJourneyId'](_0x3f1c2f[_0x582b94(0x108)],_0x4c0ba6);}catch(_0x49d434){throw new SDKError(ErrorCode[_0x582b94(0x115)],_0x582b94(0x1c7)+_0x4c0ba6+_0x582b94(0x113)+_0x28a179[_0x582b94(0x1a3)][_0x582b94(0xf2)]+'\x27)',_0x49d434);}},'resolveStageId':async(_0x4655b8,_0x16e8c7)=>{const _0x28f50c=_0x364caf,_0xb22157=await _0x207369[_0x28f50c(0x109)][_0x28f50c(0x181)](_0x4655b8),_0x3954c3=_0xb22157[_0x28f50c(0xf0)][_0x28f50c(0x1b1)][_0x28f50c(0x1aa)](_0x3a4c81=>_0x3a4c81[_0x28f50c(0xf2)]['toLowerCase']()===_0x16e8c7[_0x28f50c(0xf5)]());if(!_0x3954c3?.['id'])throw new SDKError(ErrorCode[_0x28f50c(0x115)],_0x28f50c(0x1c2)+_0x16e8c7+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0xb22157[_0x28f50c(0xf0)]['journeyBundleName']||_0xb22157[_0x28f50c(0xf0)][_0x28f50c(0xf2)])+'\x27');return _0x3954c3['id'];}},_0x16b280=await _0x43f9f3(_0x28a179[_0x364caf(0x1a3)],_0x3f1c2f[_0x364caf(0x108)],_0x3e6982),_0x1f2c60=_0x3f1c2f[_0x364caf(0xf6)]||_0x3f1c2f['rootFolderId'];_0x1f2c60&&(_0x16b280[_0x364caf(0x18e)]={'parentFolder':{'data':{'id':_0x1f2c60,'type':_0x364caf(0x1bb)}}});if(_0x28a179['isNew']){if(_0x2e333c['size']>0x0||_0x27f239[_0x364caf(0x188)]>0x0)return await executeThreeStepJourneyCreate(_0x207369,_0x28a179,_0x16b280,{'pendingEmbeddedSegments':_0x2e333c,'pendingEmbeddedActivations':_0x27f239,'embeddedSegmentNameToId':_0x4d5116,'journeyActivationNameToId':_0xae56d4},{..._0x3f1c2f,'effectiveFolderId':_0x1f2c60},_0x32bf96,_0x46db3a,_0xf15e72);else{ensureJourneyDefaults(_0x16b280[_0x364caf(0xf0)]);const _0x362508=await _0x207369[_0x364caf(0x109)]['create'](_0x16b280);return{'action':_0x364caf(0x19a),'journeyId':_0x362508['id'],'embeddedSegmentNameToId':_0x4d5116};}}else{if(_0x28a179[_0x364caf(0x12a)]&&_0x28a179[_0x364caf(0x1bc)])return ensureJourneyDefaults(_0x16b280[_0x364caf(0xf0)]),await _0x207369[_0x364caf(0x109)]['update'](_0x28a179[_0x364caf(0x1bc)]['id'],_0x16b280),{'action':_0x364caf(0x12c),'journeyId':_0x28a179['existingJourney']['id'],'embeddedSegmentNameToId':_0x4d5116};}return{'action':_0x364caf(0x152),'journeyId':_0x28a179[_0x364caf(0x1bc)]?.['id'],'embeddedSegmentNameToId':_0x4d5116};}function findSegmentCriteriaLocation(_0x126f15,_0x110f0b){const _0x22eca6=a119_0x2de80c,_0x16e233=_0x126f15['stages']||_0x126f15[_0x22eca6(0x139)]?.[0x0]?.[_0x22eca6(0x119)]||[];let _0x30c61c='entry',_0x3a63e1=_0x110f0b;const _0x18cb4f=_0x126f15['goal']||_0x126f15[_0x22eca6(0x139)]?.[0x0]?.[_0x22eca6(0x1cd)];if(_0x18cb4f?.['segment']===_0x110f0b)return{'stageName':_0x22eca6(0x1cd),'criteriaName':_0x18cb4f[_0x22eca6(0xf2)]||_0x110f0b};_0x532854:for(const _0xe049d8 of _0x16e233){if(_0xe049d8[_0x22eca6(0x180)]?.['segment']===_0x110f0b){_0x30c61c=_0xe049d8[_0x22eca6(0xf2)],_0x3a63e1=_0xe049d8['entry_criteria'][_0x22eca6(0xf2)]||_0x110f0b;break;}if(_0xe049d8[_0x22eca6(0x13d)])for(const _0x4440b5 of _0xe049d8[_0x22eca6(0x13d)]){if(_0x4440b5[_0x22eca6(0xff)]===_0x22eca6(0x155)&&_0x4440b5['with']?.['branches'])for(const _0x2872be of _0x4440b5['with']['branches']){if(_0x2872be[_0x22eca6(0x17f)]===_0x110f0b){_0x30c61c=_0xe049d8[_0x22eca6(0xf2)],_0x3a63e1=_0x2872be[_0x22eca6(0xf2)]||_0x110f0b;break _0x532854;}}}}return{'stageName':_0x30c61c,'criteriaName':_0x3a63e1};}async function executeThreeStepJourneyCreate(_0x586f20,_0x562f48,_0xa2c906,_0x4d2413,_0x6fe0bf,_0x301158,_0xb8662d,_0x304eb7){const _0x1d2175=a119_0x2de80c,{activationDefToCreateRequest:_0x16f2f2,yamlRuleToApi:_0x3bdd1b}=_0x304eb7,{pendingEmbeddedSegments:_0x18795d,pendingEmbeddedActivations:_0x4f31d2,embeddedSegmentNameToId:_0x570067}=_0x4d2413,_0x797362=JSON[_0x1d2175(0x102)](JSON[_0x1d2175(0x13e)](_0xa2c906));ensureJourneyDefaults(_0x797362['attributes']),stripPendingIds(_0x797362);const _0x314c97=await _0x586f20['journey'][_0x1d2175(0xfc)](_0x797362),_0x139873=_0x314c97['id'],_0x41f398=new Map();for(const _0x15ee47 of _0x314c97[_0x1d2175(0xf0)][_0x1d2175(0x1b1)]){_0x41f398[_0x1d2175(0x17d)](_0x15ee47[_0x1d2175(0xf2)][_0x1d2175(0xf5)](),_0x15ee47['id']);}for(const [_0x4e9ce6,{definition:_0x1cf93e}]of _0x18795d){const _0x27a344=generateDeterministicJourneySegmentName(_0x562f48['yamlConfig']['name'],_0x4e9ce6);_0xb8662d['onProgress']?.({'type':'embedded_segment_creating','journeyName':_0x562f48['yamlConfig'][_0x1d2175(0xf2)],'segmentName':_0x4e9ce6});const _0x17df46=createSegmentIdResolver(_0x301158[_0x1d2175(0x18b)],_0x4e9ce6),_0x344591=await resolveRuleSegmentIds(_0x1cf93e[_0x1d2175(0x148)],_0x17df46),_0x442767=await _0x586f20[_0x1d2175(0x17f)][_0x1d2175(0x16b)]({'name':_0x27a344,'description':_0x1cf93e[_0x1d2175(0x16d)]||_0x1d2175(0x18d)+_0x4e9ce6,'journeyId':_0x139873,'rule':_0x3bdd1b(_0x344591,!![]),'countPopulation':!![],'parentFolderId':_0x6fe0bf[_0x1d2175(0x1ab)]||'','audienceId':_0x6fe0bf[_0x1d2175(0x108)]});_0x570067[_0x1d2175(0x17d)](_0x4e9ce6,_0x442767),_0x301158[_0x1d2175(0x18b)][_0x1d2175(0x17d)](_0x4e9ce6,_0x442767),_0xb8662d[_0x1d2175(0xeb)]?.({'type':_0x1d2175(0xf4),'journeyName':_0x562f48['yamlConfig'][_0x1d2175(0xf2)],'segmentName':_0x4e9ce6});}const _0x4d919e=new Map();for(const [_0xfe184a,_0x27120e]of _0x4f31d2){_0xb8662d['onProgress']?.({'type':_0x1d2175(0x1a2),'journeyName':_0x562f48[_0x1d2175(0x1a3)][_0x1d2175(0xf2)],'activationName':_0xfe184a});const _0x4e4166=await _0x16f2f2(_0x27120e,_0x301158[_0x1d2175(0x127)]),_0x50a1d8=await _0x586f20[_0x1d2175(0x109)][_0x1d2175(0x1ca)](_0x139873,_0x4e4166);_0x4d919e['set'](_0xfe184a,_0x50a1d8['id']),_0x4d2413[_0x1d2175(0x1c0)][_0x1d2175(0x17d)](_0xfe184a,_0x50a1d8['id']),_0xb8662d[_0x1d2175(0xeb)]?.({'type':_0x1d2175(0x10b),'journeyName':_0x562f48['yamlConfig'][_0x1d2175(0xf2)],'activationName':_0xfe184a});}const _0x397d85=JSON[_0x1d2175(0x102)](JSON[_0x1d2175(0x13e)](_0xa2c906));return _0x397d85['id']=_0x139873,ensureJourneyDefaults(_0x397d85['attributes']),resolvePendingIdsInRequest(_0x397d85,_0xa2c906,_0x41f398,_0x570067,_0x4d919e,_0xb8662d),await _0x586f20[_0x1d2175(0x109)][_0x1d2175(0x1c9)](_0x139873,_0x397d85),{'action':_0x1d2175(0x19a),'journeyId':_0x139873,'embeddedSegmentNameToId':_0x570067};}function stripPendingIds(_0x3d8834){const _0x55f2d7=a119_0x2de80c;for(const _0x507218 of _0x3d8834[_0x55f2d7(0xf0)][_0x55f2d7(0x1b1)]||[]){_0x507218[_0x55f2d7(0x1ae)]?.[_0x55f2d7(0x121)]&&isPendingSegmentId(_0x507218[_0x55f2d7(0x1ae)][_0x55f2d7(0x121)])&&delete _0x507218['entryCriteria'];if(_0x507218['steps'])for(const _0x411543 of Object[_0x55f2d7(0x15b)](_0x507218[_0x55f2d7(0x13d)])){const _0x146442=_0x507218[_0x55f2d7(0x13d)][_0x411543];_0x146442[_0x55f2d7(0xff)]===_0x55f2d7(0x130)&&_0x146442['journeyActivationStepId']&&isPendingActivationId(_0x146442[_0x55f2d7(0x118)])&&(_0x146442[_0x55f2d7(0x118)]='');if(_0x146442[_0x55f2d7(0xff)]===_0x55f2d7(0xf7)&&_0x146442[_0x55f2d7(0x19d)])for(const _0x10914e of _0x146442['branches']){_0x10914e['segmentId']&&isPendingSegmentId(_0x10914e['segmentId'])&&(_0x10914e[_0x55f2d7(0x121)]='');}_0x146442[_0x55f2d7(0xff)]===_0x55f2d7(0x145)&&_0x146442[_0x55f2d7(0x159)]?.['segmentId']&&isPendingSegmentId(_0x146442[_0x55f2d7(0x159)][_0x55f2d7(0x121)])&&(_0x146442[_0x55f2d7(0x159)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x3bd4e0,_0x2c0ebf,_0x36cef1,_0x3e11af,_0x1d3307,_0x4d6634){const _0x1c6a63=a119_0x2de80c,_0x1f6e8e=(_0x45ead4,_0x29bed0)=>{const _0x1458a4=a119_0x54fc;if(!isPendingSegmentId(_0x45ead4))return _0x45ead4;const _0x14bf0c=extractPendingSegmentName(_0x45ead4),_0x1bafb8=_0x3e11af[_0x1458a4(0x151)](_0x14bf0c);return!_0x1bafb8&&_0x4d6634[_0x1458a4(0x100)]?.(_0x1458a4(0x19c)+_0x14bf0c+_0x1458a4(0x138)+_0x29bed0),_0x1bafb8;};if(_0x3bd4e0[_0x1c6a63(0xf0)]['goal']?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x3bd4e0['attributes'][_0x1c6a63(0x1cd)][_0x1c6a63(0x121)])){const _0x10aeae=_0x1f6e8e(_0x3bd4e0[_0x1c6a63(0xf0)][_0x1c6a63(0x1cd)][_0x1c6a63(0x121)],_0x1c6a63(0x14e));_0x10aeae&&(_0x3bd4e0[_0x1c6a63(0xf0)][_0x1c6a63(0x1cd)][_0x1c6a63(0x121)]=_0x10aeae);}for(const _0x2ea0a3 of _0x3bd4e0[_0x1c6a63(0xf0)][_0x1c6a63(0x1b1)]||[]){const _0x339d32=_0x36cef1[_0x1c6a63(0x151)](_0x2ea0a3[_0x1c6a63(0xf2)][_0x1c6a63(0xf5)]());_0x339d32&&(_0x2ea0a3['id']=_0x339d32);if(_0x2ea0a3[_0x1c6a63(0x1ae)]?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x2ea0a3[_0x1c6a63(0x1ae)][_0x1c6a63(0x121)])){const _0x3bceef=_0x1f6e8e(_0x2ea0a3['entryCriteria']['segmentId'],'stage\x20\x27'+_0x2ea0a3[_0x1c6a63(0xf2)]+'\x27\x20entry\x20criteria');_0x3bceef&&(_0x2ea0a3[_0x1c6a63(0x1ae)][_0x1c6a63(0x121)]=_0x3bceef);}if(_0x2ea0a3[_0x1c6a63(0x198)])for(const _0x498f49 of _0x2ea0a3[_0x1c6a63(0x198)]){if(_0x498f49[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x498f49[_0x1c6a63(0x121)])){const _0x57cada=_0x1f6e8e(_0x498f49[_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+'\x27\x20exit\x20criteria');_0x57cada&&(_0x498f49[_0x1c6a63(0x121)]=_0x57cada);}}if(_0x2ea0a3['milestone']?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x2ea0a3[_0x1c6a63(0x120)][_0x1c6a63(0x121)])){const _0x254d60=_0x1f6e8e(_0x2ea0a3[_0x1c6a63(0x120)][_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+_0x1c6a63(0x134));_0x254d60&&(_0x2ea0a3['milestone']['segmentId']=_0x254d60);}if(_0x2ea0a3[_0x1c6a63(0x13d)]){const _0x402450=_0x4a7787=>_0x2c0ebf[_0x1c6a63(0xf0)][_0x1c6a63(0x1b1)][_0x1c6a63(0x1aa)](_0x493a71=>_0x493a71[_0x1c6a63(0xf2)]['toLowerCase']()===_0x2ea0a3[_0x1c6a63(0xf2)][_0x1c6a63(0xf5)]())?.[_0x1c6a63(0x13d)]?.[_0x4a7787];for(const _0x120851 of Object[_0x1c6a63(0x15b)](_0x2ea0a3['steps'])){const _0x3ddd88=_0x2ea0a3[_0x1c6a63(0x13d)][_0x120851],_0x5cbf1d=_0x402450(_0x120851);if(_0x3ddd88[_0x1c6a63(0xff)]===_0x1c6a63(0x130)&&_0x3ddd88[_0x1c6a63(0x118)]&&(isPendingActivationId(_0x3ddd88['journeyActivationStepId'])||_0x3ddd88[_0x1c6a63(0x118)]==='')){if(_0x5cbf1d?.[_0x1c6a63(0x118)]&&isPendingActivationId(_0x5cbf1d[_0x1c6a63(0x118)])){const _0x59fe2d=extractPendingActivationName(_0x5cbf1d[_0x1c6a63(0x118)]),_0x2592c5=_0x1d3307['get'](_0x59fe2d);_0x2592c5&&(_0x3ddd88[_0x1c6a63(0x118)]=_0x2592c5);}}if(_0x3ddd88[_0x1c6a63(0xff)]===_0x1c6a63(0xf7)&&_0x3ddd88[_0x1c6a63(0x19d)]&&_0x5cbf1d?.['branches'])for(let _0x3ed7d6=0x0;_0x3ed7d6<_0x3ddd88[_0x1c6a63(0x19d)]['length'];_0x3ed7d6++){const _0x5ef6e7=_0x3ddd88['branches'][_0x3ed7d6],_0x4e4699=_0x5cbf1d['branches'][_0x3ed7d6];if(_0x4e4699?.['segmentId']&&isPendingSegmentId(_0x4e4699[_0x1c6a63(0x121)])){const _0x31ce5b=_0x1f6e8e(_0x4e4699[_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x5ef6e7[_0x1c6a63(0xf2)]||_0x3ed7d6)+'\x27');_0x31ce5b&&(_0x5ef6e7['segmentId']=_0x31ce5b);}}if(_0x3ddd88[_0x1c6a63(0xff)]===_0x1c6a63(0x145)&&_0x3ddd88[_0x1c6a63(0x159)]?.[_0x1c6a63(0x121)]&&_0x5cbf1d?.[_0x1c6a63(0x159)]?.[_0x1c6a63(0x121)]&&isPendingSegmentId(_0x5cbf1d[_0x1c6a63(0x159)][_0x1c6a63(0x121)])){const _0x249039=_0x1f6e8e(_0x5cbf1d[_0x1c6a63(0x159)][_0x1c6a63(0x121)],_0x1c6a63(0x16a)+_0x2ea0a3[_0x1c6a63(0xf2)]+_0x1c6a63(0x171));_0x249039&&(_0x3ddd88[_0x1c6a63(0x159)]['segmentId']=_0x249039);}}}}}
1
+ const a119_0x43758d=a119_0x1c83;(function(_0x5371eb,_0x139dbc){const _0x4e0e36=a119_0x1c83,_0x3caa8e=_0x5371eb();while(!![]){try{const _0x545999=parseInt(_0x4e0e36(0x194))/0x1*(-parseInt(_0x4e0e36(0x17b))/0x2)+-parseInt(_0x4e0e36(0x10d))/0x3*(-parseInt(_0x4e0e36(0x181))/0x4)+-parseInt(_0x4e0e36(0x14e))/0x5*(-parseInt(_0x4e0e36(0x127))/0x6)+-parseInt(_0x4e0e36(0xde))/0x7+parseInt(_0x4e0e36(0x19c))/0x8*(-parseInt(_0x4e0e36(0xe1))/0x9)+parseInt(_0x4e0e36(0x10a))/0xa+-parseInt(_0x4e0e36(0xed))/0xb;if(_0x545999===_0x139dbc)break;else _0x3caa8e['push'](_0x3caa8e['shift']());}catch(_0x25c13d){_0x3caa8e['push'](_0x3caa8e['shift']());}}}(a119_0x4aa5,0xd624c));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a119_0x43758d(0xf2);export const PENDING_ACTIVATION_PREFIX=a119_0x43758d(0x14f);export function createPendingSegmentId(_0x5c5ba3){return''+PENDING_SEGMENT_PREFIX+_0x5c5ba3+'__';}export function isPendingSegmentId(_0x33ce94){const _0x3a3428=a119_0x43758d;return _0x33ce94[_0x3a3428(0x137)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x4154b8){const _0x4ad54d=a119_0x43758d;return _0x4154b8[_0x4ad54d(0xc3)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x6ae26d){return''+PENDING_ACTIVATION_PREFIX+_0x6ae26d+'__';}export function isPendingActivationId(_0x30e3c9){const _0x3b7773=a119_0x43758d;return _0x30e3c9[_0x3b7773(0x137)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x254dec){return _0x254dec['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x10fa1e,_0xdc6c81){const _0x1c10f4=a119_0x43758d,_0x562521=_0x10fa1e+'::'+(_0xdc6c81[_0x1c10f4(0x100)]()||'segment'),_0x4ad597=createHash(_0x1c10f4(0x193))[_0x1c10f4(0x13c)](_0x562521)[_0x1c10f4(0xf7)](_0x1c10f4(0xf0))[_0x1c10f4(0x129)](0x0,0xc);return _0x1c10f4(0x119)+_0x4ad597;}export function ensureJourneyDefaults(_0x1d20b8){const _0x4df925=a119_0x43758d;!_0x1d20b8[_0x4df925(0x11a)]&&(_0x1d20b8[_0x4df925(0x11a)]=''),!_0x1d20b8['state']&&(_0x1d20b8[_0x4df925(0xd4)]=_0x4df925(0x1a1));}export function resolveTDFolderPath(_0x3e4cb5,_0x174eb5,_0xbae588){const _0x5f1856=a119_0x43758d;if(!_0x174eb5)return _0x3e4cb5;if(_0x3e4cb5===_0xbae588||_0x3e4cb5[_0x5f1856(0x137)](_0xbae588+'/'))return _0x3e4cb5;return _0x3e4cb5?_0xbae588+'/'+_0x3e4cb5:_0xbae588;}function a119_0x4aa5(){const _0x4cc967=['validatedRequest','state','map','max','../../utils/async.js','list','embeddedSegmentNameToId','connector_config','utf-8','parentId','folder','9887724SUzZGK','index','Fetching\x20','18LlMsrH','isNew','Updated\x20activation\x20\x27','createSegment','connection','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','segmentNameToId','from','includes','rule','idToName','embedded_segment_created','225346UaaWxS','activationActions','deleteActivation','hex','message','__pending_','withProgress','all_columns','segment_deleted','embedded_activation_creating','digest','join','journeyBundlesByFolderAndName','journeyActivationStepId','item','embedded_activation_created','JOURNEY_UPDATE_ERROR','deleteSegment','Created\x20activation\x20\x27','trim','parentFolder','existingSegment','dirname','entry','relationships','segment_creating','split','onProgress','Activation','12697650EFnYvF','existingSegments','Journey\x20\x27','3rAgnvu','ACTIVATION_UPDATE_ERROR','valid','Entry\x20criteria:\x20','parseDocument','hasChanges','set','existingActivation','getJourney','relative','rootFolderId','./child-segment-yaml.js','journey_entry_criteria_','description','listSegments','verbose','resolveSegment','goal\x20criteria','data','updated','type','activationsBySegmentId','\x27\x20not\x20found\x20in\x20journey\x20\x27','isArray','attributes','skipSegments','2130zSHseG','activation_template_id','slice','kind','segment','unchanged','DecisionPoint','localSegmentRules','segmentByFolderAndName','action','getSegment','connectionIdToNameMap','add','logInfo','updateActivation','reduce','startsWith','errors','listActivations','yamlActivation','get','update','NOT_FOUND','Created\x20journey\x20\x27','segment_deleting','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','branches','Name\x20has\x20already\x20been\x20taken','createJourneySegment','stringify','milestone','segmentFolderId','\x20journey\x20from\x20file:\x20','folderPathToId','entryCriteria','journeyId','createActivation','\x20error(s)','SEGMENT_NOT_FOUND','300BYnamd','__pending_act_','activation_deleted','steps','yamlConfig','deleted','Segment\x20not\x20found:\x20','journeys','activations','folder_created','INTERNAL','activation_created','object','waitCondition','created','buildUserMaps','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','idToEmailMap','segmentId','Failed\x20to\x20','embedded_segment_creating','goal','null','Deleting\x20activation\x20\x27','delete','Updating\x20activation\x20\x27','journeyStages','Updated\x20segment\x20\x27','results','\x20(referenced\x20in\x20journey\x20','Updated\x20journey\x20\x27','segments','\x0a\x20\x20','\x27\x20for\x20','absolutePath','diff','schedule','with','create','\x27...','Creating\x20folder\x20\x27','activationContext','activation_updating','filter','progress','10550GnCfQK','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','entries','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Created\x20folder\x20\x27','\x27\x20entry\x20criteria','6223424LaWhVu','updateSegmentById','values','Creating\x20segment\x20\x27','activationParams','journeyBundleName','folderPath','toString','sort','ACTIVATION_SYNTAX_ERROR','Deleted\x20activation\x20\x27','toLowerCase','find','length','name','createdSegmentIds','journey_updated','exitCriterias','sha1','67qhTeeF','Stage\x20\x27','\x27\x20milestone','journeyActivationNameToId','parse','deps','./journey-yaml.js','flatMap','733384WPyjvS','WaitStep','entry_criteria','\x27\x20from\x20file:\x20','journey','draft','JOURNEY_SYNTAX_ERROR','stage\x20\x27','versionNumber','journeyById','createFolder','logDeleted','replace','logSuccess','\x27\x20decision\x20point\x20branch\x20\x27','Activation\x20not\x20found:\x20','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','push','effectiveFolderId','existingJourney','folderId','notification','segment_updating','has','keys','stages','size','createdSegmentId'];a119_0x4aa5=function(){return _0x4cc967;};return a119_0x4aa5();}export function addFoldersToCreate(_0x5b2066,_0x5edfa3,_0x176936){const _0xef86a=a119_0x43758d;if(!_0x5b2066)return;if(_0x5edfa3[_0xef86a(0xce)](_0x5b2066))return;const _0x479652=_0x5b2066[_0xef86a(0x107)]('/');let _0x5ae71c='';for(const _0x2c5446 of _0x479652){_0x5ae71c=_0x5ae71c?_0x5ae71c+'/'+_0x2c5446:_0x2c5446,!_0x5edfa3[_0xef86a(0xce)](_0x5ae71c)&&_0x176936['add'](_0x5ae71c);}}import*as a119_0x5c0b2d from'yaml';import{readFileSync}from'fs';import a119_0x2cece5 from'path';import{isJourneyDef,parseYamlString as a119_0xff0061,toYamlString as a119_0x4bcb51,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x3e3232){const _0x414375=a119_0x43758d;if(Array[_0x414375(0x124)](_0x3e3232))return'['+_0x3e3232[_0x414375(0xd5)](_0x371586=>stableStringify(_0x371586))[_0x414375(0xf8)](',')+']';if(_0x3e3232&&typeof _0x3e3232===_0x414375(0x15a)){const _0xe8b8ee=_0x3e3232,_0x4d8643=Object['keys'](_0xe8b8ee)[_0x414375(0x189)](),_0x2c8ce0=_0x4d8643[_0x414375(0xd5)](_0x17d14c=>'\x22'+_0x17d14c+'\x22:'+stableStringify(_0xe8b8ee[_0x17d14c]));return'{'+_0x2c8ce0['join'](',')+'}';}const _0x75f375=JSON[_0x414375(0x144)](_0x3e3232);return _0x75f375===undefined?_0x414375(0x164):_0x75f375;}function activationSignature(_0x413f85){const _0x4fc03d=a119_0x43758d,_0x11b8c6={'connection':_0x413f85[_0x4fc03d(0xe5)],..._0x413f85[_0x4fc03d(0xf4)]!==undefined&&{'all_columns':_0x413f85[_0x4fc03d(0xf4)]},..._0x413f85['columns']!==undefined&&{'columns':_0x413f85['columns']},..._0x413f85['behavior']!==undefined&&{'behavior':_0x413f85['behavior']},..._0x413f85[_0x4fc03d(0x172)]!==undefined&&{'schedule':_0x413f85[_0x4fc03d(0x172)]},..._0x413f85[_0x4fc03d(0xcc)]!==undefined&&{'notification':_0x413f85[_0x4fc03d(0xcc)]},..._0x413f85[_0x4fc03d(0xda)]!==undefined&&{'connector_config':_0x413f85['connector_config']},..._0x413f85[_0x4fc03d(0x128)]!==undefined&&{'activation_template_id':_0x413f85['activation_template_id']}};return stableStringify(_0x11b8c6);}export async function prepareSegmentFiles(_0x1d35a4,_0x557960,_0x3139c9,_0x3d65f0,_0x5d25c9){const _0x394fca=a119_0x43758d,{activationDefToCreateRequest:_0x4eb392}=await import(_0x394fca(0x118)),_0x37e10a=[],_0x45f386=new Set();for(const {yamlConfig:_0x4caf9b,folderPath:_0x4d8c62,sourcePath:_0x13832f}of _0x1d35a4){const _0x1bbb32=resolveTDFolderPath(_0x4d8c62,_0x3d65f0,_0x5d25c9),_0x1a02bf=_0x1bbb32+':'+_0x4caf9b[_0x394fca(0x18f)],_0x2b55f1=_0x557960[_0x394fca(0x12f)]['get'](_0x1a02bf),_0x28af00=_0x2b55f1?_0x557960[_0x394fca(0x122)][_0x394fca(0x13b)](_0x2b55f1['id'])||[]:[];addFoldersToCreate(_0x1bbb32,_0x557960[_0x394fca(0x148)],_0x45f386);const _0x466da2=calculateActivationActions(_0x4caf9b[_0x394fca(0x156)]||[],_0x28af00,_0x557960['idToEmailMap'],_0x557960['connectionIdToNameMap']);for(const _0x505a4d of _0x466da2){(_0x505a4d[_0x394fca(0x121)]==='create'||_0x505a4d[_0x394fca(0x121)]===_0x394fca(0x13c))&&_0x505a4d[_0x394fca(0x13a)]&&(_0x505a4d[_0x394fca(0xd3)]=await _0x4eb392(_0x505a4d[_0x394fca(0x13a)],_0x3139c9));}const _0x5f42b6=calculateSegmentDiff(_0x4caf9b,_0x2b55f1,_0x28af00,_0x557960[_0x394fca(0x15f)],_0x557960['connectionIdToNameMap']);_0x37e10a[_0x394fca(0xc8)]({'relativePath':_0x4caf9b['name'],'absolutePath':_0x13832f,'yamlConfig':_0x4caf9b,'folderPath':_0x1bbb32,'existingSegment':_0x2b55f1,'existingActivations':_0x28af00,'isNew':_0x5f42b6[_0x394fca(0xe2)],'hasChanges':_0x5f42b6['hasChanges'],'diff':_0x5f42b6[_0x394fca(0x171)],'activationActions':_0x466da2});}return{'segmentFiles':_0x37e10a,'foldersToCreate':_0x45f386};}export async function prepareJourneyFiles(_0x1f4217,_0x3d2d12,_0x3e2dc3,_0x459978){const _0xe52374=a119_0x43758d,_0x264a83=[],_0x38544b=new Set();for(const {yamlConfig:_0x4f33c2,folderPath:_0x354120,sourcePath:_0x1c36ec}of _0x1f4217){const _0xd98116=resolveTDFolderPath(_0x354120,_0x3e2dc3,_0x459978),_0x46d93b=_0xd98116+':'+_0x4f33c2['name'],_0x2b46be=_0x3d2d12[_0xe52374(0xf9)][_0xe52374(0x13b)](_0x46d93b);let _0x1ae2d9,_0x23b5f6;if(_0x2b46be&&_0x2b46be[_0xe52374(0x18e)]>0x0){const _0x2c545f=buildLocalExpandedRuleMappings(_0x4f33c2),{createYamlContext:_0x40639c,prefetchJourneySegments:_0x40388e}=createPushYamlContextForBundle(_0x3d2d12[_0xe52374(0x199)],_0x3d2d12['parentId'],_0x3d2d12[_0xe52374(0x10b)],_0x2c545f,_0x3d2d12['idToEmailMap'],_0x3d2d12[_0xe52374(0x132)],_0x3d2d12['activationStepsById'],_0x3d2d12[_0xe52374(0xc0)]);await _0x40388e(_0x2b46be['map'](_0x29f6c0=>_0x29f6c0['id']));const _0x306488=hasMultipleVersions(_0x4f33c2),_0x2261c5=async _0x3fd66b=>{const _0x29ee8c=_0xe52374,_0x5159a4=_0x3d2d12['journeyById']?.['get'](_0x3fd66b);if(_0x5159a4)return _0x5159a4;return _0x3d2d12['fetchJourney']({'journeyId':_0x3fd66b,'journeyName':_0x4f33c2[_0x29ee8c(0x18f)],'isMultiVersion':_0x2b46be[_0x29ee8c(0x18e)]>0x1});};if(_0x306488&&_0x2b46be[_0xe52374(0x18e)]>0x1){const _0x5d2b80=[];for(const _0x18edf6 of _0x2b46be){const _0x165dee=_0x18edf6['versionNumber']||0x1;_0x3d2d12[_0xe52374(0x17a)]?.[_0xe52374(0x13c)]('Fetching\x20'+_0x4f33c2[_0xe52374(0x18f)]+'\x20v'+_0x165dee);const _0x515b03=await _0x2261c5(_0x18edf6['id']),_0x4d4eef=_0x40639c(_0x18edf6['id']),_0x29862e=await journeyResponseToDef(_0x515b03,_0x4d4eef);_0x5d2b80['push']({'item':_0x18edf6,'yaml':_0x29862e});}const _0x78b12b=buildLocalRuleToNameMappingFromJourney(_0x4f33c2);_0x23b5f6=buildMergedJourneyDef(_0x5d2b80,_0x78b12b);const _0x48dde8=Math[_0xe52374(0xd6)](..._0x5d2b80[_0xe52374(0xd5)](_0x100e87=>_0x100e87[_0xe52374(0xfb)][_0xe52374(0xbf)]||0x0)),_0x14db93=_0x2b46be[_0xe52374(0x18d)](_0xb59c8=>(_0xb59c8[_0xe52374(0xbf)]||0x0)===_0x48dde8);_0x14db93&&(_0x3d2d12[_0xe52374(0x17a)]?.[_0xe52374(0x13c)]('Fetching\x20'+_0x4f33c2[_0xe52374(0x18f)]+'\x20v'+_0x48dde8),_0x1ae2d9=await _0x2261c5(_0x14db93['id']));}else{const _0x288250=_0x2b46be[_0x2b46be[_0xe52374(0x18e)]-0x1];_0x3d2d12[_0xe52374(0x17a)]?.[_0xe52374(0x13c)](_0xe52374(0xe0)+_0x4f33c2[_0xe52374(0x18f)]),_0x1ae2d9=await _0x2261c5(_0x288250['id']);const _0x4775d0=_0x40639c(_0x288250['id']),_0x5e9e99=await journeyResponseToDef(_0x1ae2d9,_0x4775d0),_0x2da7bf=buildLocalRuleToNameMappingFromJourney(_0x4f33c2);_0x23b5f6=buildMergedJourneyDef([{'item':_0x288250,'yaml':_0x5e9e99}],_0x2da7bf);}}addFoldersToCreate(_0xd98116,_0x3d2d12[_0xe52374(0x148)],_0x38544b);const _0x3d1049=calculateJourneyDiff(_0x4f33c2,_0x23b5f6);_0x264a83[_0xe52374(0xc8)]({'relativePath':_0x4f33c2['name'],'absolutePath':_0x1c36ec,'yamlConfig':_0x4f33c2,'folderPath':_0xd98116,'existingJourney':_0x1ae2d9,'isNew':_0x3d1049[_0xe52374(0xe2)],'hasChanges':_0x3d1049['hasChanges'],'diff':_0x3d1049[_0xe52374(0x171)]});}return{'journeyFiles':_0x264a83,'foldersToCreate':_0x38544b};}export function calculateActivationActions(_0x5f230a,_0x38f1c6,_0x27d5af,_0x120530){const _0x3cd34f=a119_0x43758d,_0x176839=[],_0x359b98=new Map();for(const _0x4d8724 of _0x38f1c6){_0x359b98[_0x3cd34f(0x113)](_0x4d8724[_0x3cd34f(0x18f)],_0x4d8724);}const _0x41af6a=new Map();for(const _0x1d8acc of _0x5f230a){_0x41af6a['set'](_0x1d8acc[_0x3cd34f(0x18f)],_0x1d8acc);}for(const _0xdf784a of _0x5f230a){const _0x53a55b=_0x359b98['get'](_0xdf784a[_0x3cd34f(0x18f)]);if(!_0x53a55b)_0x176839['push']({'type':_0x3cd34f(0x174),'name':_0xdf784a[_0x3cd34f(0x18f)],'yamlActivation':_0xdf784a});else{const _0x592b18=activationResponseToDef(_0x53a55b,_0x27d5af,_0x120530),_0x3236e1=a119_0x5c0b2d['stringify'](_0x592b18),_0x4729e6=a119_0x5c0b2d[_0x3cd34f(0x144)](_0xdf784a);_0x3236e1!==_0x4729e6&&_0x176839[_0x3cd34f(0xc8)]({'type':_0x3cd34f(0x13c),'name':_0xdf784a['name'],'yamlActivation':_0xdf784a,'existingActivation':_0x53a55b});}}for(const _0x1268ee of _0x38f1c6){!_0x41af6a[_0x3cd34f(0xce)](_0x1268ee[_0x3cd34f(0x18f)])&&_0x176839[_0x3cd34f(0xc8)]({'type':_0x3cd34f(0x166),'name':_0x1268ee[_0x3cd34f(0x18f)],'existingActivation':_0x1268ee});}return _0x176839;}function a119_0x1c83(_0x3ba591,_0x1cdbd2){_0x3ba591=_0x3ba591-0xbf;const _0x4aa56a=a119_0x4aa5();let _0x1c8364=_0x4aa56a[_0x3ba591];return _0x1c8364;}export function calculateSegmentDiff(_0x28ca5e,_0x54f441,_0x1992ca,_0x3955e7,_0x5c3c97){const _0x156b1e=segmentToYamlString(_0x28ca5e);if(_0x54f441){const _0x31a155=segmentWithActivationsToYaml(_0x54f441,_0x1992ca,undefined,_0x3955e7,_0x5c3c97),_0xb6a3e5=segmentToYamlString(_0x31a155),_0x5b14e1=generateDiff(_0xb6a3e5,_0x156b1e),_0x9a5086=hasChanges(_0x5b14e1);return{'isNew':![],'hasChanges':_0x9a5086,'diff':_0x9a5086?formatDiffWithColors(_0x5b14e1):undefined};}const _0x43be64=generateDiff('',_0x156b1e);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x43be64)};}export function calculateJourneyDiff(_0x756645,_0x3e278c){const _0x5c96e3=normalizeJourneyDef(_0x756645,_0x756645),_0x58cf24=a119_0x4bcb51(_0x5c96e3);if(_0x3e278c){const _0x45bd7d=normalizeJourneyDef(_0x3e278c,_0x756645),_0x453b95=a119_0x4bcb51(_0x45bd7d),_0x57fdd0=generateDiff(_0x453b95,_0x58cf24),_0x57e64e=hasChanges(_0x57fdd0);return{'isNew':![],'hasChanges':_0x57e64e,'diff':_0x57e64e?formatDiffWithColors(_0x57fdd0):undefined};}const _0x5b3d4c=generateDiff('',_0x58cf24);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5b3d4c)};}export function findSegmentsToDelete(_0x33caaf,_0x2a4876,_0x26d6f8,_0x90f26e,_0x3d323b){const _0x177a6a=a119_0x43758d,_0x4c1f3c=new Set();for(const {yamlConfig:_0x4cd442,folderPath:_0x4f2c01}of _0x2a4876){_0x4c1f3c['add'](_0x4f2c01+':'+_0x4cd442[_0x177a6a(0x18f)]);}return _0x33caaf[_0x177a6a(0x179)](_0x4e5207=>{const _0x1a7de2=_0x177a6a,_0xb9d4ff=_0x4e5207['segmentFolderId']?_0x26d6f8[_0x1a7de2(0x13b)](_0x4e5207['segmentFolderId']['toString']())||'':'',_0x54eb84=_0xb9d4ff+':'+_0x4e5207[_0x1a7de2(0x18f)];if(_0x4c1f3c[_0x1a7de2(0xce)](_0x54eb84))return![];if(_0x3d323b)return _0xb9d4ff===_0x90f26e||_0xb9d4ff['startsWith'](_0x90f26e+'/');return!![];});}export function findJourneysToDelete(_0xa2cece,_0x43a0d,_0x4cc233,_0x24b2d6,_0x3f1a00){const _0x3d8abd=a119_0x43758d,_0x2ebec9=new Set();for(const {yamlConfig:_0x40e483,folderPath:_0x3c97b4}of _0x43a0d){_0x2ebec9[_0x3d8abd(0x133)](_0x3c97b4+':'+_0x40e483[_0x3d8abd(0x18f)]);}return _0xa2cece[_0x3d8abd(0x179)](_0x595059=>{const _0x54b5ca=_0x3d8abd,_0x38674b=_0x595059[_0x54b5ca(0xcb)]?_0x4cc233['get'](_0x595059[_0x54b5ca(0xcb)])||'':'',_0x2532de=_0x38674b+':'+_0x595059[_0x54b5ca(0x186)];if(_0x2ebec9[_0x54b5ca(0xce)](_0x2532de))return![];if(_0x3f1a00)return _0x38674b===_0x24b2d6||_0x38674b[_0x54b5ca(0x137)](_0x24b2d6+'/');return!![];});}export function buildSegmentLookupMap(_0x2736ab,_0x66276f){const _0xa2b81c=a119_0x43758d,_0x1cb0f1=new Map();for(const _0x2a5c33 of _0x2736ab){const _0x208237=_0x2a5c33[_0xa2b81c(0x146)]?_0x66276f[_0xa2b81c(0x13b)](_0x2a5c33[_0xa2b81c(0x146)][_0xa2b81c(0x188)]())||'':'',_0x44c3a7=_0x208237+':'+_0x2a5c33['name'];_0x1cb0f1['set'](_0x44c3a7,_0x2a5c33);}return _0x1cb0f1;}export function buildSegmentNameToIdMap(_0x1d2397){const _0x1ef8fa=a119_0x43758d,_0xe607d2=new Map();for(const _0x29295d of _0x1d2397){_0xe607d2['set'](_0x29295d[_0x1ef8fa(0x18f)],_0x29295d['id']);}return _0xe607d2;}export function buildJourneyBundleLookupMap(_0x40d74b,_0x51cdf5){const _0x632930=a119_0x43758d,_0x316ca8=new Map();for(const _0x16e8cf of _0x40d74b){const _0x6bc672=_0x16e8cf['folderId']?_0x51cdf5[_0x632930(0x13b)](_0x16e8cf[_0x632930(0xcb)])||'':'',_0x1e385f=_0x6bc672+':'+_0x16e8cf[_0x632930(0x186)];!_0x316ca8['has'](_0x1e385f)&&_0x316ca8[_0x632930(0x113)](_0x1e385f,[]),_0x316ca8[_0x632930(0x13b)](_0x1e385f)[_0x632930(0xc8)](_0x16e8cf);}for(const _0x363be1 of _0x316ca8[_0x632930(0x183)]()){_0x363be1[_0x632930(0x189)]((_0x5e07e0,_0x464c5b)=>(_0x5e07e0[_0x632930(0xbf)]||0x0)-(_0x464c5b[_0x632930(0xbf)]||0x0));}return _0x316ca8;}export function collectFoldersToCreate(_0x67d722,_0x854845){const _0x3bf94b=a119_0x43758d,_0x2f3c7c=new Set();for(const _0x5b041b of _0x67d722){if(!_0x5b041b)continue;if(_0x854845['has'](_0x5b041b))continue;const _0x59131d=_0x5b041b[_0x3bf94b(0x107)]('/');let _0xce9c93='';for(const _0xcc84e0 of _0x59131d){_0xce9c93=_0xce9c93?_0xce9c93+'/'+_0xcc84e0:_0xcc84e0,!_0x854845[_0x3bf94b(0xce)](_0xce9c93)&&_0x2f3c7c[_0x3bf94b(0x133)](_0xce9c93);}}return _0x2f3c7c;}export function parseAndClassifyYamlFiles(_0x1ee5b5,_0x3a1f4f,_0x18b64c){const _0x4203c9=a119_0x43758d,_0xba0262=[],_0x383fbf=[];for(const _0x56cae1 of _0x1ee5b5){const _0x3d5e82=a119_0x2cece5[_0x4203c9(0x116)](_0x3a1f4f,a119_0x2cece5[_0x4203c9(0x103)](_0x56cae1)),_0x49b183=_0x3d5e82==='.'?'':_0x3d5e82,_0x359eca=readFileSync(_0x56cae1,_0x4203c9(0xdb)),_0x1569cb=a119_0x5c0b2d[_0x4203c9(0x198)](_0x359eca);if(isJourneyDef(_0x1569cb)){const _0x4af9bf=a119_0xff0061(_0x359eca);_0x383fbf[_0x4203c9(0xc8)]({'yamlConfig':_0x4af9bf,'folderPath':_0x49b183,'sourcePath':_0x56cae1});}else{if(!_0x18b64c?.[_0x4203c9(0x126)]){const _0x367f8f=parseSegmentYamlFile(_0x359eca),_0x2a657f=normalizeChildSegmentYaml(_0x367f8f);_0xba0262[_0x4203c9(0xc8)]({'yamlConfig':_0x2a657f,'folderPath':_0x49b183,'sourcePath':_0x56cae1});}}}return{'segments':_0xba0262,'journeys':_0x383fbf};}export function validateParsedFiles(_0x2a73d8,_0x4143ad){const _0x4c3901=a119_0x43758d,_0x58025f=[];for(const {yamlConfig:_0x195025,sourcePath:_0xaf27ef}of _0x2a73d8[_0x4c3901(0x16d)]){const _0x32e898=readFileSync(_0xaf27ef,_0x4c3901(0xdb)),_0x266b9d=a119_0x5c0b2d[_0x4c3901(0x111)](_0x32e898),_0x26c238=validateSegmentDef(_0x195025,{'source':_0x32e898,'document':_0x266b9d});if(!_0x26c238[_0x4c3901(0x10f)]){const _0x231230=a119_0x2cece5['relative'](_0x4143ad,_0xaf27ef);_0x58025f[_0x4c3901(0xc8)]({'filePath':_0x231230,'source':_0x32e898,'result':_0x26c238,'isJourney':![]});}}for(const {yamlConfig:_0x33861f,sourcePath:_0x5b8046}of _0x2a73d8[_0x4c3901(0x155)]){const _0x2511a0=readFileSync(_0x5b8046,_0x4c3901(0xdb)),_0x2d2302=a119_0x5c0b2d[_0x4c3901(0x111)](_0x2511a0),_0x2e29f4=validateJourneyDef(_0x33861f,{'source':_0x2511a0,'document':_0x2d2302});if(!_0x2e29f4['valid']){const _0x1e193e=a119_0x2cece5[_0x4c3901(0x116)](_0x4143ad,_0x5b8046);_0x58025f[_0x4c3901(0xc8)]({'filePath':_0x1e193e,'source':_0x2511a0,'result':_0x2e29f4,'isJourney':!![]});}}return _0x58025f;}export function formatValidationErrors(_0x113d64){const _0x3b7ca6=a119_0x43758d,_0x14f593=[];for(const {filePath:_0x5df5fe,source:_0xaba232,result:_0x255fee,isJourney:_0x2c954e}of _0x113d64){const _0x1180a7=_0x2c954e?_0x3b7ca6(0x1a0):'segment';_0x14f593[_0x3b7ca6(0xc8)]('\x0a'+_0x5df5fe+'\x20('+_0x1180a7+'):\x20'+_0x255fee[_0x3b7ca6(0x138)]['length']+_0x3b7ca6(0x14c)),_0x14f593[_0x3b7ca6(0xc8)](formatValidationResult(_0x255fee,_0xaba232,_0x5df5fe));}return _0x14f593[_0x3b7ca6(0xf8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x49c47f){const _0x549a4d=a119_0x43758d,_0x369379=new Set(),_0x4fe455=new Map(),_0x34ec7d=collectSegmentUsageCounts(_0x49c47f);if(_0x49c47f[_0x549a4d(0x16d)])for(const [_0x53e61b,_0x3cb4b6]of Object[_0x549a4d(0x17d)](_0x49c47f[_0x549a4d(0x16d)])){_0x369379[_0x549a4d(0x133)](_0x53e61b);if(_0x3cb4b6[_0x549a4d(0xea)]){const _0x59004e=yamlRuleToApi(_0x3cb4b6[_0x549a4d(0xea)]),_0x4f4d12=apiRuleToYaml(_0x59004e);_0x4fe455[_0x549a4d(0x113)](_0x53e61b,_0x4f4d12);}}const _0x56900b=new Map();let _0x12f29f=0x0;for(const [_0x592a2c,_0x4c54df]of _0x4fe455){const _0x184951=serializeExpandedRule(_0x4c54df,_0x4fe455),_0x41bbb3=_0x56900b['get'](_0x184951)||[];_0x41bbb3[_0x549a4d(0xc8)]({'name':_0x592a2c,'index':_0x12f29f}),_0x56900b[_0x549a4d(0x113)](_0x184951,_0x41bbb3),_0x12f29f++;}const _0x376d0b=new Map();for(const [_0xe79a16,_0x14e1a9]of _0x56900b){const _0x527596=_0x14e1a9['slice']()[_0x549a4d(0x189)]((_0x59c6b3,_0x475429)=>{const _0x1a31f9=_0x549a4d,_0x236bdb=_0x34ec7d[_0x1a31f9(0x13b)](_0x59c6b3[_0x1a31f9(0x18f)])||0x0,_0x11cf4d=_0x34ec7d[_0x1a31f9(0x13b)](_0x475429[_0x1a31f9(0x18f)])||0x0;if(_0x236bdb!==_0x11cf4d)return _0x11cf4d-_0x236bdb;return _0x59c6b3['index']-_0x475429[_0x1a31f9(0xdf)];})['map'](_0x3ca10c=>_0x3ca10c[_0x549a4d(0x18f)]),_0x8957a5=[];for(const _0x57b932 of _0x527596){const _0x2f3e8e=_0x34ec7d[_0x549a4d(0x13b)](_0x57b932)||0x0,_0x571b5b=Math[_0x549a4d(0xd6)](_0x2f3e8e,0x1);for(let _0x4444a4=0x0;_0x4444a4<_0x571b5b;_0x4444a4++){_0x8957a5['push'](_0x57b932);}}_0x376d0b[_0x549a4d(0x113)](_0xe79a16,_0x8957a5);}return{'existingLocalSegmentNames':_0x369379,'localSegmentRules':_0x4fe455,'localExpandedRuleToNames':_0x376d0b};}async function buildServerSegmentRuleMap(_0x2310c6,_0x1f5e3d,_0x45ea89,_0x2e861e){const _0x3a9268=new Map(),_0x5281e2=new Set(),_0x23718b=async _0x1aa2c7=>{const _0x302c2c=a119_0x1c83;if(_0x5281e2['has'](_0x1aa2c7))return;_0x5281e2[_0x302c2c(0x133)](_0x1aa2c7);let _0x196321=_0x45ea89[_0x302c2c(0x18d)](_0x36d15c=>_0x36d15c['id']===_0x1aa2c7);if(!_0x196321)try{_0x196321=await _0x2310c6[_0x302c2c(0x12b)][_0x302c2c(0x131)](_0x1f5e3d,_0x1aa2c7);}catch{return;}if(!_0x196321?.['rule'])return;const _0x259bf6=apiRuleToYaml(_0x196321[_0x302c2c(0xea)]);_0x3a9268[_0x302c2c(0x113)](_0x1aa2c7,_0x259bf6);const _0x5586db=collectSegmentRefsFromRule(_0x259bf6);for(const _0x4fb34d of _0x5586db){await _0x23718b(_0x4fb34d);}};for(const _0x2d7925 of _0x2e861e){await _0x23718b(_0x2d7925);}return _0x3a9268;}export function createSegmentIdResolver(_0x5b551e,_0x50277c){return async _0x511611=>{const _0x24c6cf=a119_0x1c83,_0x48d783=_0x5b551e[_0x24c6cf(0x13b)](_0x511611);if(!_0x48d783)throw new SDKError(ErrorCode[_0x24c6cf(0x14d)],_0x24c6cf(0x154)+_0x511611+_0x24c6cf(0x17e)+_0x50277c+'\x27)');return _0x48d783;};}export function extractRootFolderId(_0x275dd7){const _0x5e9a39=a119_0x43758d;return _0x275dd7[_0x5e9a39(0x105)]?.['parentSegmentFolder']?.[_0x5e9a39(0x11f)]?.['id']||_0x275dd7[_0x5e9a39(0x105)]?.[_0x5e9a39(0x101)]?.['data']?.['id'];}export function buildConnectionMaps(_0x54db24){const _0x1a3546=a119_0x43758d,_0x5e67a4=new Map(),_0x39f82c=new Map(),_0x4d62f0=new Map();for(const _0xce9a40 of _0x54db24){_0x5e67a4[_0x1a3546(0x113)](_0xce9a40[_0x1a3546(0x18f)],parseInt(_0xce9a40['id'],0xa)),_0x39f82c['set'](_0xce9a40['id'],_0xce9a40[_0x1a3546(0x18f)]),_0x4d62f0[_0x1a3546(0x113)](_0xce9a40[_0x1a3546(0x18f)],_0xce9a40[_0x1a3546(0x121)]);}return{'nameToId':_0x5e67a4,'idToName':_0x39f82c,'nameToType':_0x4d62f0};}export function calculatePushStats(_0x1969a8,_0x41ae4c,_0x95f914,_0x4174d3,_0x1147d6,_0x22e699,_0x3befab){const _0x1efe1c=a119_0x43758d,_0x3c9679=_0x1969a8[_0x1efe1c(0x179)](_0x21e323=>_0x21e323[_0x1efe1c(0xe2)]),_0x21c7b4=_0x1969a8['filter'](_0x2a29e4=>!_0x2a29e4['isNew']&&_0x2a29e4['hasChanges']),_0x313cf0=_0x1969a8['filter'](_0x38d1fd=>!_0x38d1fd[_0x1efe1c(0xe2)]&&!_0x38d1fd[_0x1efe1c(0x112)]),_0x3345aa=_0x22e699?_0x4174d3:[],_0x2d7c15=_0x41ae4c[_0x1efe1c(0x179)](_0x3e6ea7=>_0x3e6ea7[_0x1efe1c(0xe2)]),_0x1f3765=_0x41ae4c['filter'](_0xfea02=>!_0xfea02[_0x1efe1c(0xe2)]&&_0xfea02['hasChanges']),_0x9d0177=_0x41ae4c[_0x1efe1c(0x179)](_0x3229a4=>!_0x3229a4['isNew']&&!_0x3229a4[_0x1efe1c(0x112)]),_0x4431df=_0x22e699?_0x1147d6:[],_0x341937=_0x1969a8[_0x1efe1c(0x19b)](_0x2446b8=>_0x2446b8[_0x1efe1c(0xee)]),_0x1002d8=_0x341937[_0x1efe1c(0x179)](_0x21511e=>_0x21511e['type']===_0x1efe1c(0x174)),_0x37ff3b=_0x341937[_0x1efe1c(0x179)](_0x5b0777=>_0x5b0777['type']===_0x1efe1c(0x13c)),_0x55bd29=_0x341937[_0x1efe1c(0x179)](_0x2feda2=>_0x2feda2[_0x1efe1c(0x121)]===_0x1efe1c(0x166)),_0x717f22=Array[_0x1efe1c(0xe8)](_0x95f914)[_0x1efe1c(0x189)](),_0x4d5e01=_0x3befab?![]:_0x3c9679['length']>0x0||_0x21c7b4[_0x1efe1c(0x18e)]>0x0||_0x3345aa[_0x1efe1c(0x18e)]>0x0,_0x139c12=_0x2d7c15[_0x1efe1c(0x18e)]>0x0||_0x1f3765[_0x1efe1c(0x18e)]>0x0||_0x4431df[_0x1efe1c(0x18e)]>0x0,_0x2d0b30=_0x3befab?![]:_0x341937[_0x1efe1c(0x18e)]>0x0,_0x5916ed=_0x717f22[_0x1efe1c(0x18e)]>0x0;return{'segments':{'new':_0x3c9679,'changed':_0x21c7b4,'unchanged':_0x313cf0,'toDelete':_0x3345aa},'journeys':{'new':_0x2d7c15,'changed':_0x1f3765,'unchanged':_0x9d0177,'toDelete':_0x4431df},'activations':{'all':_0x341937,'toCreate':_0x1002d8,'toUpdate':_0x37ff3b,'toDelete':_0x55bd29},'folders':{'toCreate':_0x717f22},'counts':{'segments':{'new':_0x3c9679['length'],'changed':_0x21c7b4['length'],'unchanged':_0x313cf0[_0x1efe1c(0x18e)],'toDelete':_0x3345aa[_0x1efe1c(0x18e)]},'journeys':{'new':_0x2d7c15['length'],'changed':_0x1f3765['length'],'unchanged':_0x9d0177[_0x1efe1c(0x18e)],'toDelete':_0x4431df[_0x1efe1c(0x18e)]},'activations':{'create':_0x1002d8[_0x1efe1c(0x18e)],'update':_0x37ff3b[_0x1efe1c(0x18e)],'delete':_0x55bd29[_0x1efe1c(0x18e)]},'folders':_0x717f22['length']},'hasChanges':_0x4d5e01||_0x139c12||_0x2d0b30||_0x5916ed};}export async function buildPushExecutionContext(_0x42e8e8,_0x348b7a,_0x33c1a3,_0x14f13d,_0x42cbfd,_0x1290b6){const _0x1de224=a119_0x43758d,_0x48c011=extractRootFolderId(_0x33c1a3),{pathToId:_0x4b45dd,idToPath:_0x519586}=buildFolderMaps(_0x42cbfd),_0x2d3d0c=buildSegmentNameToIdMap(_0x14f13d),_0x293f3b=new Map(),{batchAsync:_0x1397c6}=await import(_0x1de224(0xd7)),[_0x26236e,_0xa320ac]=await Promise['all']([_0x42e8e8['user'][_0x1de224(0x15d)](),_0x42e8e8[_0x1de224(0xe5)][_0x1de224(0xd8)](),((async()=>{const _0x1b0481=_0x1de224;!_0x1290b6&&_0x14f13d[_0x1b0481(0x18e)]>0x0&&await _0x1397c6(_0x14f13d,async _0x42fc3c=>{const _0x20bfdd=_0x1b0481,_0x1546bb=await _0x42e8e8[_0x20bfdd(0x12b)][_0x20bfdd(0x139)](_0x348b7a,_0x42fc3c['id']);_0x293f3b[_0x20bfdd(0x113)](_0x42fc3c['id'],_0x1546bb);});})())]),{emailToId:_0x45666d,idToEmail:_0x25f2ec}=_0x26236e,_0x237a21=buildConnectionMaps(_0xa320ac);return{'rootFolderId':_0x48c011,'folderPathToId':_0x4b45dd,'folderIdToPath':_0x519586,'segmentNameToId':_0x2d3d0c,'activationsBySegmentId':_0x293f3b,'emailToIdMap':_0x45666d,'idToEmailMap':_0x25f2ec,'connectionNameToIdMap':_0x237a21['nameToId'],'connectionIdToNameMap':_0x237a21[_0x1de224(0xeb)],'connectionNameToTypeMap':_0x237a21['nameToType']};}export function createPushYamlContextForBundle(_0x15e6b2,_0x2301fd,_0x51173c,_0x571226,_0x898ed1,_0x2193a1,_0x32cb4b,_0x23bec4){const {existingLocalSegmentNames:_0xeb4943,localExpandedRuleToNames:_0x546b40}=_0x571226,_0x12b2bf=new Set(),_0x1f1f63=new Map(),_0x6a9af4=new Map(),_0x1e6c12=new Map(),_0x32e37a=createJumpTargetCache(),_0x2d2d60=new Map(),_0xcede78=new Map(),_0x1593f0=new Set();let _0x1d8bdd;const _0x3193e8=_0xf9c7f=>{const _0x24258a={'resolveSegment':async _0x477600=>{const _0x22af92=a119_0x1c83,_0x36dd52=_0x1e6c12[_0x22af92(0x13b)](_0x477600);if(_0x36dd52!==undefined)return{'name':_0x36dd52,'isJourneyLocal':!![]};try{let _0x57c53f=_0x51173c[_0x22af92(0x18d)](_0x4aae93=>_0x4aae93['id']===_0x477600);!_0x57c53f&&(_0x57c53f=await _0x15e6b2[_0x22af92(0x12b)][_0x22af92(0x131)](_0x2301fd,_0x477600));const _0x419f79=generateJourneyLocalName(_0x57c53f[_0x22af92(0x18f)]),_0x27d51d=_0x57c53f[_0x22af92(0x12a)]===SEGMENT_KIND_JOURNEY&&_0x419f79!==undefined;let _0xc0df=_0x57c53f[_0x22af92(0x18f)],_0x7c707f;if(_0x27d51d&&_0x57c53f['rule']){const _0x1dd539=apiRuleToYaml(_0x57c53f['rule']);_0xcede78['set'](_0x477600,_0x1dd539);const _0x17a1dd=async _0x1d928f=>{const _0x30a0f1=_0x22af92,_0x1a9e09=collectSegmentRefsFromRule(_0x1d928f);for(const _0x4a7eb0 of _0x1a9e09){if(!_0xcede78[_0x30a0f1(0xce)](_0x4a7eb0))try{const _0x3580f4=await _0x15e6b2[_0x30a0f1(0x12b)][_0x30a0f1(0x131)](_0x2301fd,_0x4a7eb0);if(_0x3580f4?.[_0x30a0f1(0xea)]){const _0x5cd357=apiRuleToYaml(_0x3580f4[_0x30a0f1(0xea)]);_0xcede78['set'](_0x4a7eb0,_0x5cd357),await _0x17a1dd(_0x5cd357);}}catch{}}};await _0x17a1dd(_0x1dd539);const _0x11513c=serializeExpandedRule(_0x1dd539,_0xcede78),_0x2f1b05=_0x546b40[_0x22af92(0x13b)](_0x11513c);if(_0x2f1b05&&_0x2f1b05[_0x22af92(0x18e)]>0x0){const _0x5bed9a=_0x1f1f63[_0x22af92(0x13b)](_0x11513c)||0x0,_0x1d937e=_0x2f1b05[_0x5bed9a]||_0x2f1b05[_0x2f1b05[_0x22af92(0x18e)]-0x1];_0x1f1f63[_0x22af92(0x113)](_0x11513c,_0x5bed9a+0x1),_0xc0df=_0x1d937e,_0x12b2bf[_0x22af92(0x133)](_0xc0df),_0x1e6c12[_0x22af92(0x113)](_0x477600,_0xc0df);const _0x126cd7=await resolveRuleSegmentRefs(_0x1dd539,async _0x27871b=>{const _0x307aa5=_0x22af92,_0x1039b3=_0x1e6c12['get'](_0x27871b);if(_0x1039b3)return _0x1039b3;const _0x270389=await _0x1d8bdd[_0x307aa5(0x11d)](_0x27871b);return _0x270389[_0x307aa5(0x18f)];});_0x7c707f={'description':_0x57c53f[_0x22af92(0x11a)],'rule':_0x126cd7};}else{const _0x5be40b=_0x2d2d60[_0x22af92(0x13b)](_0x11513c);if(_0x5be40b)_0xc0df=_0x5be40b,_0x1e6c12[_0x22af92(0x113)](_0x477600,_0xc0df);else{if(_0x419f79){let _0x16cccb=_0x419f79,_0x97c4b5=0x2;while(_0x12b2bf['has'](_0x16cccb)||_0xeb4943[_0x22af92(0xce)](_0x16cccb)){_0x16cccb=_0x419f79+'_'+_0x97c4b5,_0x97c4b5++;}_0x12b2bf['add'](_0x16cccb),_0xc0df=_0x16cccb;}_0x1e6c12['set'](_0x477600,_0xc0df),_0x2d2d60[_0x22af92(0x113)](_0x11513c,_0xc0df);const _0x267b67=await resolveRuleSegmentRefs(_0x1dd539,async _0xf94fe2=>{const _0x34bf90=_0x22af92,_0x54b1c9=_0x1e6c12[_0x34bf90(0x13b)](_0xf94fe2);if(_0x54b1c9)return _0x54b1c9;const _0x455aae=await _0x1d8bdd[_0x34bf90(0x11d)](_0xf94fe2);return _0x455aae[_0x34bf90(0x18f)];});_0x7c707f={'description':_0x57c53f[_0x22af92(0x11a)],'rule':_0x267b67};}}}return{'name':_0xc0df,'isJourneyLocal':_0x27d51d,'definition':_0x7c707f};}catch{return{'name':_0x477600,'isJourneyLocal':![]};}},'resolveActivation':async _0x4f2d1e=>{const _0x13a2c0=a119_0x1c83,_0x32bb66=_0x6a9af4[_0x13a2c0(0x13b)](_0x4f2d1e);if(_0x32bb66!==undefined)return{'name':_0x32bb66,'isJourneyLocal':!![]};try{let _0x125199=_0x32cb4b?.['get'](_0x4f2d1e);!_0x125199&&(_0x125199=await _0x15e6b2[_0x13a2c0(0x1a0)]['getActivation'](_0xf9c7f,_0x4f2d1e));const _0x1bb0e7=_0x125199[_0x13a2c0(0x125)][_0x13a2c0(0x185)][_0x13a2c0(0x18f)]||_0x4f2d1e,_0x3accf1=sanitizeYamlKey(_0x1bb0e7)||'activation_'+_0x4f2d1e,_0x30017f=_0x3accf1;_0x6a9af4[_0x13a2c0(0x113)](_0x4f2d1e,_0x30017f);const _0x736b8d=journeyActivationStepToYaml(_0x125199,_0x898ed1,_0x2193a1);return{'name':_0x30017f,'isJourneyLocal':!![],'definition':_0x736b8d};}catch{return{'name':_0x4f2d1e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x41cf87,_0x4f0a9d)=>resolveJumpTarget(_0x41cf87,_0x4f0a9d,_0x32e37a,async _0x5c8453=>{const _0x23fbe6=a119_0x1c83,_0x25e811=_0x23bec4?.[_0x23fbe6(0x13b)](_0x5c8453);if(_0x25e811)return _0x25e811;return _0x15e6b2[_0x23fbe6(0x1a0)]['getJourney'](_0x5c8453);})};return _0x1d8bdd=_0x24258a,_0x24258a;},_0x4e6479=async _0x27a919=>{const _0x4bb712=a119_0x1c83,{collectSegmentIdsFromJourneyApi:_0x42f1c9}=await import(_0x4bb712(0x19a)),{batchAsync:_0x3056e5}=await import('../../utils/async.js'),_0x5509bc=new Set();for(const _0x1d2067 of _0x27a919){let _0x2c24de=_0x23bec4?.[_0x4bb712(0x13b)](_0x1d2067);!_0x2c24de&&(_0x2c24de=await _0x15e6b2['journey'][_0x4bb712(0x115)](_0x1d2067));const _0x7dae=_0x42f1c9(_0x2c24de);for(const _0x43a697 of _0x7dae){_0x5509bc['add'](_0x43a697);}}let _0x554aba=Array[_0x4bb712(0xe8)](_0x5509bc);while(_0x554aba['length']>0x0){const _0x4d92df=_0x554aba['filter'](_0x3be8c7=>!_0x1593f0[_0x4bb712(0xce)](_0x3be8c7));if(_0x4d92df[_0x4bb712(0x18e)]===0x0)break;const _0xf94756=await _0x3056e5(_0x4d92df,async _0x173a6a=>{const _0x212fa1=_0x4bb712;_0x1593f0[_0x212fa1(0x133)](_0x173a6a);let _0x3cbcc0=_0x51173c[_0x212fa1(0x18d)](_0x2515ee=>_0x2515ee['id']===_0x173a6a);if(!_0x3cbcc0)try{_0x3cbcc0=await _0x15e6b2[_0x212fa1(0x12b)][_0x212fa1(0x131)](_0x2301fd,_0x173a6a);}catch{return null;}return{'segmentId':_0x173a6a,'segment':_0x3cbcc0};},0xa),_0x2cbc0b=new Set();for(const _0x259f30 of _0xf94756){if(!_0x259f30?.[_0x4bb712(0x12b)]?.[_0x4bb712(0xea)])continue;const _0x3d4a97=apiRuleToYaml(_0x259f30['segment'][_0x4bb712(0xea)]);_0xcede78[_0x4bb712(0x113)](_0x259f30[_0x4bb712(0x160)],_0x3d4a97);const _0x2c83fb=collectSegmentRefsFromRule(_0x3d4a97);for(const _0x4289db of _0x2c83fb){!_0x1593f0[_0x4bb712(0xce)](_0x4289db)&&_0x2cbc0b[_0x4bb712(0x133)](_0x4289db);}}_0x554aba=Array[_0x4bb712(0xe8)](_0x2cbc0b);}};return{'createYamlContext':_0x3193e8,'prefetchJourneySegments':_0x4e6479};}export async function executePushSegments(_0x20ede2,_0x2c3e3a,_0x49bbe2,_0x10aecd,_0x39805a){const _0x1d2575=a119_0x43758d,{segmentDefToCreateRequest:_0x16e030,segmentDefToUpdateRequest:_0x1d7a3d}=await import(_0x1d2575(0x118)),_0x5dff40=_0x49bbe2[_0x1d2575(0x148)],_0xaf298a=0x5,_0x4b9dd0=async _0x22502f=>{const _0x158159=_0x1d2575,_0x544a2c=_0x22502f['folderPath']?_0x5dff40[_0x158159(0x13b)](_0x22502f[_0x158159(0x187)]):undefined;let _0x43336b;const _0x18ebb7={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x22502f[_0x158159(0xe2)]){_0x39805a[_0x158159(0x108)]?.({'type':_0x158159(0x106),'name':_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]});const _0x3391cc=_0x16e030(_0x22502f[_0x158159(0x152)],_0x544a2c),_0x551ce8=await _0x39805a[_0x158159(0xf3)](_0x158159(0x184)+_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]+'\x27...',()=>_0x20ede2[_0x158159(0x12b)][_0x158159(0xe4)](_0x10aecd[_0x158159(0xdc)],_0x3391cc));_0x43336b=_0x551ce8['data']['id'],_0x18ebb7['createdSegmentId']={'name':_0x22502f[_0x158159(0x152)]['name'],'id':_0x43336b},_0x39805a['onProgress']?.({'type':'segment_created','name':_0x22502f[_0x158159(0x152)]['name'],'segmentId':_0x43336b}),_0x39805a[_0x158159(0xc4)]?.('Created\x20segment\x20\x27'+_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]+'\x27'),_0x18ebb7[_0x158159(0x15c)]=0x1;}else{if(_0x22502f['hasChanges']){_0x39805a[_0x158159(0x108)]?.({'type':_0x158159(0xcd),'name':_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]});const _0x4fd16d=_0x1d7a3d(_0x22502f[_0x158159(0x152)]);_0x544a2c!==_0x22502f[_0x158159(0x102)]?.[_0x158159(0x146)]&&(_0x4fd16d[_0x158159(0x146)]=_0x544a2c?parseInt(_0x544a2c,0xa):undefined),await _0x39805a[_0x158159(0xf3)]('Updating\x20segment\x20\x27'+_0x22502f['yamlConfig'][_0x158159(0x18f)]+_0x158159(0x175),()=>_0x20ede2[_0x158159(0x12b)][_0x158159(0x182)](_0x10aecd[_0x158159(0xdc)],_0x22502f[_0x158159(0x102)]['id'],_0x4fd16d)),_0x43336b=_0x22502f[_0x158159(0x102)]['id'],_0x39805a[_0x158159(0x108)]?.({'type':'segment_updated','name':_0x22502f[_0x158159(0x152)]['name']}),_0x39805a[_0x158159(0xc4)]?.(_0x158159(0x169)+_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]+'\x27'),_0x18ebb7['updated']=0x1;}else _0x43336b=_0x22502f[_0x158159(0x102)]['id'];}}catch(_0x2ce552){const _0x55c1b7=isHttp400Error(_0x2ce552),_0x3490d7=_0x55c1b7?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x226ee8=getErrorMessage(_0x2ce552);throw new SDKError(_0x3490d7,'Failed\x20to\x20'+(_0x22502f[_0x158159(0xe2)]?_0x158159(0x174):_0x158159(0x13c))+'\x20segment\x20from\x20file:\x20'+_0x22502f[_0x158159(0x170)]+_0x158159(0x16e)+_0x226ee8,_0x2ce552);}try{const _0x549c0e=await syncActivationsForSegment(_0x20ede2,_0x10aecd['parentId'],_0x43336b,_0x22502f['yamlConfig'][_0x158159(0x18f)],_0x22502f[_0x158159(0xee)],_0x39805a,_0x22502f[_0x158159(0x170)]);_0x18ebb7[_0x158159(0x156)]=_0x549c0e;}catch(_0x4ebeaa){if(_0x4ebeaa instanceof SDKError)throw _0x4ebeaa;throw new SDKError(ErrorCode[_0x158159(0x10e)],_0x158159(0xe6)+_0x22502f[_0x158159(0x152)]['name']+_0x158159(0x19f)+_0x22502f['absolutePath']+_0x158159(0x16e)+getErrorMessage(_0x4ebeaa),_0x4ebeaa);}return _0x18ebb7;},_0x36ecea=await batchAsync(_0x2c3e3a,_0x4b9dd0,_0xaf298a),_0x2ddeab={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5c7fea of _0x36ecea){_0x2ddeab[_0x1d2575(0x15c)]+=_0x5c7fea[_0x1d2575(0x15c)],_0x2ddeab[_0x1d2575(0x120)]+=_0x5c7fea[_0x1d2575(0x120)],_0x5c7fea['createdSegmentId']&&_0x2ddeab[_0x1d2575(0x190)][_0x1d2575(0x113)](_0x5c7fea[_0x1d2575(0xd2)][_0x1d2575(0x18f)],_0x5c7fea['createdSegmentId']['id']),_0x2ddeab[_0x1d2575(0x156)][_0x1d2575(0x15c)]+=_0x5c7fea['activations'][_0x1d2575(0x15c)],_0x2ddeab[_0x1d2575(0x156)]['updated']+=_0x5c7fea['activations'][_0x1d2575(0x120)],_0x2ddeab['activations'][_0x1d2575(0x153)]+=_0x5c7fea[_0x1d2575(0x156)][_0x1d2575(0x153)];}return _0x2ddeab;}async function syncActivationsForSegment(_0x4d4eaa,_0x1815f0,_0x388242,_0x5dcad3,_0x318b1d,_0x50a865,_0x1675bb){const _0xd8a467=a119_0x43758d,_0x19a0b7={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x6605df of _0x318b1d){try{if(_0x6605df['type']===_0xd8a467(0x174)&&_0x6605df[_0xd8a467(0xd3)])_0x50a865['onProgress']?.({'type':'activation_creating','segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),await _0x50a865[_0xd8a467(0xf3)]('Creating\x20activation\x20\x27'+_0x6605df[_0xd8a467(0x18f)]+_0xd8a467(0x175),()=>_0x4d4eaa[_0xd8a467(0x12b)][_0xd8a467(0x14b)](_0x1815f0,_0x388242,_0x6605df[_0xd8a467(0xd3)])),_0x50a865[_0xd8a467(0x108)]?.({'type':_0xd8a467(0x159),'segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),_0x50a865[_0xd8a467(0xc4)]?.(_0xd8a467(0xff)+_0x6605df[_0xd8a467(0x18f)]+'\x27'),_0x19a0b7[_0xd8a467(0x15c)]++;else{if(_0x6605df[_0xd8a467(0x121)]===_0xd8a467(0x13c)&&_0x6605df[_0xd8a467(0xd3)]&&_0x6605df[_0xd8a467(0x114)])_0x50a865['onProgress']?.({'type':_0xd8a467(0x178),'segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),await _0x50a865[_0xd8a467(0xf3)](_0xd8a467(0x167)+_0x6605df[_0xd8a467(0x18f)]+_0xd8a467(0x175),()=>_0x4d4eaa[_0xd8a467(0x12b)][_0xd8a467(0x135)](_0x1815f0,_0x388242,_0x6605df['existingActivation']['id'],_0x6605df[_0xd8a467(0xd3)])),_0x50a865[_0xd8a467(0x108)]?.({'type':'activation_updated','segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),_0x50a865[_0xd8a467(0xc4)]?.(_0xd8a467(0xe3)+_0x6605df[_0xd8a467(0x18f)]+'\x27'),_0x19a0b7['updated']++;else _0x6605df['type']===_0xd8a467(0x166)&&_0x6605df[_0xd8a467(0x114)]&&(_0x50a865[_0xd8a467(0x108)]?.({'type':'activation_deleting','segmentName':_0x5dcad3,'activationName':_0x6605df['name']}),await _0x50a865[_0xd8a467(0xf3)](_0xd8a467(0x165)+_0x6605df['name']+'\x27...',()=>_0x4d4eaa['segment'][_0xd8a467(0xef)](_0x1815f0,_0x388242,_0x6605df[_0xd8a467(0x114)]['id'])),_0x50a865[_0xd8a467(0x108)]?.({'type':_0xd8a467(0x150),'segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),_0x50a865[_0xd8a467(0xc2)]?.(_0xd8a467(0x18b)+_0x6605df[_0xd8a467(0x18f)]+'\x27'),_0x19a0b7[_0xd8a467(0x153)]++);}}catch(_0x87d773){const _0x283472=isHttp400Error(_0x87d773),_0x1baf0b=_0x283472?ErrorCode[_0xd8a467(0x18a)]:ErrorCode[_0xd8a467(0x10e)],_0x342bf3=getErrorMessage(_0x87d773);throw new SDKError(_0x1baf0b,_0xd8a467(0x161)+_0x6605df[_0xd8a467(0x121)]+'\x20activation\x20\x27'+_0x6605df[_0xd8a467(0x18f)]+_0xd8a467(0x19f)+_0x1675bb+_0xd8a467(0x16e)+_0x342bf3,_0x87d773);}}return _0x19a0b7;}export async function executePushFolders(_0x29d616,_0x488ac2,_0x390827,_0x3835b9,_0x1689b5){const _0x2691c7=a119_0x43758d,_0x43e518=new Map(_0x390827);for(const _0x117528 of _0x488ac2){const _0x548dc4=_0x117528[_0x2691c7(0x107)]('/'),_0x3f31ce=_0x548dc4[_0x548dc4[_0x2691c7(0x18e)]-0x1],_0x146753=_0x548dc4[_0x2691c7(0x129)](0x0,-0x1)[_0x2691c7(0xf8)]('/'),_0x9586f=_0x43e518['get'](_0x146753);_0x1689b5[_0x2691c7(0x108)]?.({'type':'folder_creating','folder':_0x117528});const _0x327e78={'name':_0x3f31ce,'parentFolderId':_0x9586f},_0x429aa6=await _0x1689b5[_0x2691c7(0xf3)](_0x2691c7(0x176)+_0x117528+_0x2691c7(0x175),()=>_0x29d616['segment'][_0x2691c7(0xc1)](_0x3835b9[_0x2691c7(0xdc)],_0x327e78));_0x43e518['set'](_0x117528,_0x429aa6[_0x2691c7(0x11f)]['id']),_0x1689b5[_0x2691c7(0x108)]?.({'type':_0x2691c7(0x157),'folder':_0x117528,'folderId':_0x429aa6[_0x2691c7(0x11f)]['id']}),_0x1689b5[_0x2691c7(0x134)]?.(_0x2691c7(0x17f)+_0x117528+'\x27');}return _0x43e518;}export async function executePushSegmentDeletions(_0x3362db,_0x1deaf6,_0x4e4182){const _0x97646d=a119_0x43758d;if(_0x1deaf6[_0x97646d(0x18e)]===0x0)return 0x0;const {batchAsync:_0x12ac5b}=await import(_0x97646d(0xd7)),_0x49fcf8=0x5,_0x10ea73=await _0x12ac5b(_0x1deaf6,async _0xb4c8e8=>{const _0x419498=_0x97646d;return _0x4e4182[_0x419498(0x108)]?.({'type':_0x419498(0x13f),'name':_0xb4c8e8['name']}),await _0x3362db[_0x419498(0x12b)][_0x419498(0xfe)](_0xb4c8e8['id']),_0x4e4182[_0x419498(0x108)]?.({'type':_0x419498(0xf5),'name':_0xb4c8e8['name']}),_0x4e4182[_0x419498(0xc2)]?.('Deleted\x20segment\x20\x27'+_0xb4c8e8[_0x419498(0x18f)]+'\x27'),0x1;},_0x49fcf8);return _0x10ea73[_0x97646d(0x136)]((_0x98658,_0x114b0c)=>_0x98658+_0x114b0c,0x0);}export async function executePushJourneys(_0x31575f,_0x4e3120,_0xee3e3a,_0x184379,_0x1a368c){const _0x2178a9=a119_0x43758d,{journeyDefToRequest:_0x67097c}=await import(_0x2178a9(0x19a)),{activationDefToCreateRequest:_0x5de3d0,yamlRuleToApi:_0x2d3f50,validateSegmentRule:_0x4ac4cd}=await import(_0x2178a9(0x118)),_0x481ffd={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x96491b=new Map(_0xee3e3a[_0x2178a9(0xe7)]),_0x748a68=0x5;for(let _0x376c18=0x0;_0x376c18<_0x4e3120['length'];_0x376c18+=_0x748a68){const _0x9d6e96=_0x4e3120[_0x2178a9(0x129)](_0x376c18,_0x376c18+_0x748a68),_0x5d3a91=await Promise['all'](_0x9d6e96['map'](async _0x114992=>{const _0x58800d=_0x2178a9;if(!_0x114992['isNew']&&!_0x114992['hasChanges'])return{'action':'unchanged','name':_0x114992[_0x58800d(0x152)][_0x58800d(0x18f)],'journeyId':_0x114992[_0x58800d(0xca)]?.['id']};const _0x1aac0e=_0x114992['folderPath']?_0xee3e3a[_0x58800d(0x148)][_0x58800d(0x13b)](_0x114992[_0x58800d(0x187)]):undefined;_0x1a368c[_0x58800d(0x108)]?.({'type':_0x114992['isNew']?'journey_creating':'journey_updating','name':_0x114992['yamlConfig'][_0x58800d(0x18f)]});try{const _0x39deac=await executeSingleJourneyPush(_0x31575f,_0x114992,{..._0xee3e3a,'segmentNameToId':_0x96491b},{'parentId':_0x184379['parentId'],'rootFolderId':_0x184379[_0x58800d(0x117)],'folderId':_0x1aac0e,'verbose':_0x184379[_0x58800d(0x11c)]},_0x1a368c,{'journeyDefToRequest':_0x67097c,'activationDefToCreateRequest':_0x5de3d0,'yamlRuleToApi':_0x2d3f50,'validateSegmentRule':_0x4ac4cd});for(const [_0x271f28,_0x5b18d2]of _0x39deac[_0x58800d(0xd9)]){_0x96491b['set'](_0x271f28,_0x5b18d2),_0x481ffd[_0x58800d(0xd9)]['set'](_0x271f28,_0x5b18d2);}if(_0x39deac['action']===_0x58800d(0x15c))_0x1a368c['onProgress']?.({'type':'journey_created','name':_0x114992[_0x58800d(0x152)][_0x58800d(0x18f)],'journeyId':_0x39deac[_0x58800d(0x14a)]}),_0x1a368c[_0x58800d(0xc4)]?.(_0x58800d(0x13e)+_0x114992[_0x58800d(0x152)]['name']+'\x27'),_0x481ffd[_0x58800d(0x15c)]++;else _0x39deac[_0x58800d(0x130)]===_0x58800d(0x120)&&(_0x1a368c[_0x58800d(0x108)]?.({'type':_0x58800d(0x191),'name':_0x114992['yamlConfig']['name']}),_0x1a368c['logSuccess']?.(_0x58800d(0x16c)+_0x114992['yamlConfig']['name']+'\x27'),_0x481ffd[_0x58800d(0x120)]++);return{'action':_0x39deac['action'],'name':_0x114992[_0x58800d(0x152)][_0x58800d(0x18f)],'journeyId':_0x39deac[_0x58800d(0x14a)]};}catch(_0x57ab4d){const _0x2a3c26=isHttp400Error(_0x57ab4d),_0x1362db=_0x2a3c26?ErrorCode[_0x58800d(0x1a2)]:ErrorCode[_0x58800d(0xfd)],_0x591274=getErrorMessage(_0x57ab4d);throw new SDKError(_0x1362db,_0x58800d(0x161)+(_0x114992[_0x58800d(0xe2)]?_0x58800d(0x174):_0x58800d(0x13c))+_0x58800d(0x147)+_0x114992[_0x58800d(0x170)]+'\x0a\x20\x20'+_0x591274,_0x57ab4d);}}));_0x481ffd[_0x2178a9(0x16a)][_0x2178a9(0xc8)](..._0x5d3a91);}return _0x481ffd;}async function executeSingleJourneyPush(_0x511993,_0x1ca6f9,_0x2565a4,_0x6d88d1,_0x1b6963,_0x40b998){const _0x5d3215=a119_0x43758d,{journeyDefToRequest:_0x43019d,activationDefToCreateRequest:_0x13a9c9,yamlRuleToApi:_0x4ad144,validateSegmentRule:_0x1c53e2}=_0x40b998,_0x10020a=new Map(),_0x10d667=new Map(),_0x283085=new Map(),_0x1c7694=new Map(),_0x40f193=new Map();let _0x25e585;const _0x5a321e=async()=>{const _0x3ec7f8=a119_0x1c83;if(_0x25e585)return;_0x25e585=new Map();if(!_0x1ca6f9['existingJourney'])return;const _0x4935b0=await _0x511993['journey']['listActivations'](_0x1ca6f9[_0x3ec7f8(0xca)]['id']);for(const _0x304d4c of _0x4935b0){const _0x18736d=journeyActivationStepToYaml(_0x304d4c,_0x2565a4['idToEmailMap'],_0x2565a4[_0x3ec7f8(0x132)]),_0x1404d8=activationSignature(_0x18736d);!_0x25e585['has'](_0x1404d8)&&_0x25e585['set'](_0x1404d8,_0x304d4c['id']),_0x18736d[_0x3ec7f8(0x18f)]&&_0x10d667['set'](_0x18736d[_0x3ec7f8(0x18f)],_0x304d4c['id']);}};if(_0x1ca6f9[_0x5d3215(0xca)]&&_0x1ca6f9[_0x5d3215(0x152)]['segments']){const _0xd72da5=buildLocalExpandedRuleMappings(_0x1ca6f9[_0x5d3215(0x152)]),_0x495661=_0xd72da5[_0x5d3215(0x12e)];if(_0x495661[_0x5d3215(0xd1)]>0x0){const _0x51acfc=new Map();for(const [_0x5e11ca,_0x31b7e0]of _0x495661){const _0x1ff5da=serializeExpandedRule(_0x31b7e0,_0x495661);_0x51acfc[_0x5d3215(0x113)](_0x5e11ca,_0x1ff5da);}const _0x33cd73=collectSegmentIdsFromJourneyApi(_0x1ca6f9[_0x5d3215(0xca)]);if(_0x33cd73[_0x5d3215(0xd1)]>0x0){const _0x56c2c4=await buildServerSegmentRuleMap(_0x511993,_0x6d88d1[_0x5d3215(0xdc)],_0x2565a4[_0x5d3215(0x10b)],_0x33cd73);if(_0x56c2c4[_0x5d3215(0xd1)]>0x0){const _0x33a92f=new Map();for(const [_0x59e2dc,_0xacc1c8]of _0x56c2c4){const _0xf9cfdf=serializeExpandedRule(_0xacc1c8,_0x56c2c4);!_0x33a92f[_0x5d3215(0xce)](_0xf9cfdf)&&_0x33a92f[_0x5d3215(0x113)](_0xf9cfdf,_0x59e2dc);}for(const [_0xe391d7,_0x8c58a]of _0x51acfc){const _0x36f6aa=_0x33a92f['get'](_0x8c58a);_0x36f6aa&&(_0x40f193[_0x5d3215(0x113)](_0xe391d7,_0x36f6aa),_0x2565a4[_0x5d3215(0xe7)]['set'](_0xe391d7,_0x36f6aa));}}}}}const _0x38629a={'resolveSegmentId':async _0x3386df=>{const _0x3337a5=_0x5d3215,_0x42a4f1=_0x2565a4[_0x3337a5(0xe7)][_0x3337a5(0x13b)](_0x3386df);if(!_0x42a4f1)throw new SDKError(ErrorCode[_0x3337a5(0x14d)],_0x3337a5(0x154)+_0x3386df+_0x3337a5(0x16b)+_0x1ca6f9[_0x3337a5(0x152)][_0x3337a5(0x18f)]+')');return _0x42a4f1;},'resolveEmbeddedSegmentId':async(_0x2de0fb,_0x15c308)=>{const _0x22c931=_0x5d3215,_0x38fdcc=_0x2565a4[_0x22c931(0xe7)][_0x22c931(0x13b)](_0x2de0fb);if(_0x38fdcc)return _0x38fdcc;const _0x5993e5=_0x40f193[_0x22c931(0x13b)](_0x2de0fb);if(_0x5993e5)return _0x2565a4[_0x22c931(0xe7)][_0x22c931(0x113)](_0x2de0fb,_0x5993e5),_0x5993e5;const _0xebf4b2=_0x2565a4['existingSegments'][_0x22c931(0x18d)](_0x4e86a7=>_0x4e86a7['name']===_0x2de0fb);if(_0xebf4b2)return _0x2565a4[_0x22c931(0xe7)][_0x22c931(0x113)](_0x2de0fb,_0xebf4b2['id']),_0xebf4b2['id'];if(_0x1ca6f9[_0x22c931(0xe2)]){const {stageName:_0x36e8e3,criteriaName:_0x5639c3}=findSegmentCriteriaLocation(_0x1ca6f9['yamlConfig'],_0x2de0fb);return _0x1c53e2(_0x2de0fb,_0x15c308[_0x22c931(0xea)]),_0x283085[_0x22c931(0x113)](_0x2de0fb,{'definition':_0x15c308,'stageName':_0x36e8e3,'criteriaName':_0x5639c3}),createPendingSegmentId(_0x2de0fb);}const _0x359a31=_0x1ca6f9[_0x22c931(0xca)]?.['id'];if(!_0x359a31)throw new SDKError(ErrorCode[_0x22c931(0x158)],_0x22c931(0x15e));_0x1c53e2(_0x2de0fb,_0x15c308[_0x22c931(0xea)]);const _0x176bfa=generateDeterministicJourneySegmentName(_0x1ca6f9['yamlConfig'][_0x22c931(0x18f)],_0x2de0fb),_0x2ba379=_0x2565a4[_0x22c931(0x10b)][_0x22c931(0x18d)](_0x52e61c=>_0x52e61c['name']===_0x176bfa),_0x28f2c4=createSegmentIdResolver(_0x2565a4[_0x22c931(0xe7)],_0x2de0fb),_0x26616b=await resolveRuleSegmentIds(_0x15c308[_0x22c931(0xea)],_0x28f2c4);let _0x4f952a;if(_0x2ba379)await _0x511993[_0x22c931(0x12b)][_0x22c931(0x182)](_0x6d88d1[_0x22c931(0xdc)],_0x2ba379['id'],{'description':_0x15c308['description']||_0x22c931(0x110)+_0x2de0fb,'rule':_0x4ad144(_0x26616b,!![]),'countPopulation':!![]}),_0x4f952a=_0x2ba379['id'];else try{_0x4f952a=await _0x511993[_0x22c931(0x12b)][_0x22c931(0x143)]({'name':_0x176bfa,'description':_0x15c308[_0x22c931(0x11a)]||_0x22c931(0x110)+_0x2de0fb,'journeyId':_0x359a31,'rule':_0x4ad144(_0x26616b,!![]),'countPopulation':!![],'parentFolderId':_0x6d88d1['rootFolderId']||'','audienceId':_0x6d88d1[_0x22c931(0xdc)]});}catch(_0x5c0802){const _0x5385de=_0x5c0802 instanceof Error&&_0x5c0802[_0x22c931(0xf1)][_0x22c931(0xe9)](_0x22c931(0x142));if(_0x5385de){const _0x34bd74=await _0x511993[_0x22c931(0x12b)][_0x22c931(0x11b)](_0x6d88d1[_0x22c931(0xdc)]),_0x39a6d4=_0x34bd74['find'](_0x476aed=>_0x476aed[_0x22c931(0x18f)]===_0x176bfa);if(_0x39a6d4)await _0x511993[_0x22c931(0x12b)][_0x22c931(0x182)](_0x6d88d1['parentId'],_0x39a6d4['id'],{'description':_0x15c308[_0x22c931(0x11a)]||_0x22c931(0x110)+_0x2de0fb,'rule':_0x4ad144(_0x26616b,!![]),'countPopulation':!![]}),_0x4f952a=_0x39a6d4['id'];else throw _0x5c0802;}else throw _0x5c0802;}return _0x2565a4[_0x22c931(0xe7)]['set'](_0x2de0fb,_0x4f952a),_0x10020a[_0x22c931(0x113)](_0x2de0fb,_0x4f952a),_0x4f952a;},'resolveActivationId':async _0xc8ea7e=>{const _0x512862=_0x5d3215,_0x36b5cd=_0x10d667[_0x512862(0x13b)](_0xc8ea7e);if(_0x36b5cd)return _0x36b5cd;if(_0x1ca6f9['existingJourney']){await _0x5a321e();const _0x47719b=_0x10d667[_0x512862(0x13b)](_0xc8ea7e);if(_0x47719b)return _0x47719b;}throw new SDKError(ErrorCode[_0x512862(0x13d)],_0x512862(0xc6)+_0xc8ea7e+_0x512862(0x16b)+_0x1ca6f9[_0x512862(0x152)][_0x512862(0x18f)]+').\x20'+_0x512862(0x17c));},'resolveEmbeddedActivationId':async(_0x4cf26e,_0x1ac26e)=>{const _0x24ee75=_0x5d3215,_0x5c608d=_0x10d667[_0x24ee75(0x13b)](_0x4cf26e);if(_0x5c608d)return _0x5c608d;if(_0x1ca6f9[_0x24ee75(0xe2)])return _0x1c7694[_0x24ee75(0x113)](_0x4cf26e,_0x1ac26e),createPendingActivationId(_0x4cf26e);if(_0x1ca6f9[_0x24ee75(0xca)]){await _0x5a321e();const _0x593018=_0x10d667[_0x24ee75(0x13b)](_0x1ac26e[_0x24ee75(0x18f)]);if(_0x593018)return _0x10d667[_0x24ee75(0x113)](_0x4cf26e,_0x593018),_0x593018;const _0x4bf7be=activationSignature(_0x1ac26e),_0x27eed2=_0x25e585?.[_0x24ee75(0x13b)](_0x4bf7be);if(_0x27eed2)return _0x10d667['set'](_0x4cf26e,_0x27eed2),_0x27eed2;const _0x499a51=await _0x13a9c9(_0x1ac26e,_0x2565a4[_0x24ee75(0x177)]),_0x531eba=await _0x511993['journey'][_0x24ee75(0x14b)](_0x1ca6f9[_0x24ee75(0xca)]['id'],_0x499a51);return _0x10d667[_0x24ee75(0x113)](_0x4cf26e,_0x531eba['id']),_0x531eba['id'];}throw new SDKError(ErrorCode[_0x24ee75(0x158)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x47bb26=>{const _0x49764f=_0x5d3215;try{return await _0x511993[_0x49764f(0x1a0)]['resolveJourneyId'](_0x6d88d1[_0x49764f(0xdc)],_0x47bb26);}catch(_0x488ecf){throw new SDKError(ErrorCode[_0x49764f(0x13d)],_0x49764f(0x10c)+_0x47bb26+_0x49764f(0xc7)+_0x1ca6f9[_0x49764f(0x152)][_0x49764f(0x18f)]+'\x27)',_0x488ecf);}},'resolveStageId':async(_0x598cff,_0x94efcc)=>{const _0x590cfc=_0x5d3215,_0x532620=await _0x511993[_0x590cfc(0x1a0)][_0x590cfc(0x115)](_0x598cff),_0x255fc8=_0x532620[_0x590cfc(0x125)]['journeyStages'][_0x590cfc(0x18d)](_0x5610f8=>_0x5610f8['name']['toLowerCase']()===_0x94efcc[_0x590cfc(0x18c)]());if(!_0x255fc8?.['id'])throw new SDKError(ErrorCode[_0x590cfc(0x13d)],_0x590cfc(0x195)+_0x94efcc+_0x590cfc(0x123)+(_0x532620[_0x590cfc(0x125)][_0x590cfc(0x186)]||_0x532620[_0x590cfc(0x125)][_0x590cfc(0x18f)])+'\x27');return _0x255fc8['id'];}},_0x2a3994=await _0x43019d(_0x1ca6f9[_0x5d3215(0x152)],_0x6d88d1[_0x5d3215(0xdc)],_0x38629a),_0x1cbd91=_0x6d88d1[_0x5d3215(0xcb)]||_0x6d88d1[_0x5d3215(0x117)];_0x1cbd91&&(_0x2a3994['relationships']={'parentFolder':{'data':{'id':_0x1cbd91,'type':_0x5d3215(0xdd)}}});if(_0x1ca6f9['isNew']){if(_0x283085[_0x5d3215(0xd1)]>0x0||_0x1c7694['size']>0x0)return await executeThreeStepJourneyCreate(_0x511993,_0x1ca6f9,_0x2a3994,{'pendingEmbeddedSegments':_0x283085,'pendingEmbeddedActivations':_0x1c7694,'embeddedSegmentNameToId':_0x10020a,'journeyActivationNameToId':_0x10d667},{..._0x6d88d1,'effectiveFolderId':_0x1cbd91},_0x2565a4,_0x1b6963,_0x40b998);else{ensureJourneyDefaults(_0x2a3994[_0x5d3215(0x125)]);const _0x49f59a=await _0x511993[_0x5d3215(0x1a0)][_0x5d3215(0x174)](_0x2a3994);return{'action':_0x5d3215(0x15c),'journeyId':_0x49f59a['id'],'embeddedSegmentNameToId':_0x10020a};}}else{if(_0x1ca6f9[_0x5d3215(0x112)]&&_0x1ca6f9['existingJourney'])return ensureJourneyDefaults(_0x2a3994['attributes']),await _0x511993[_0x5d3215(0x1a0)][_0x5d3215(0x13c)](_0x1ca6f9[_0x5d3215(0xca)]['id'],_0x2a3994),{'action':_0x5d3215(0x120),'journeyId':_0x1ca6f9['existingJourney']['id'],'embeddedSegmentNameToId':_0x10020a};}return{'action':_0x5d3215(0x12c),'journeyId':_0x1ca6f9['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x10020a};}function findSegmentCriteriaLocation(_0x39814c,_0x5c63bb){const _0x5ef1c1=a119_0x43758d,_0x4d259f=_0x39814c[_0x5ef1c1(0xd0)]||_0x39814c[_0x5ef1c1(0x155)]?.[0x0]?.[_0x5ef1c1(0xd0)]||[];let _0x26114f=_0x5ef1c1(0x104),_0x5dcbdd=_0x5c63bb;const _0x104a6f=_0x39814c[_0x5ef1c1(0x163)]||_0x39814c[_0x5ef1c1(0x155)]?.[0x0]?.[_0x5ef1c1(0x163)];if(_0x104a6f?.['segment']===_0x5c63bb)return{'stageName':'goal','criteriaName':_0x104a6f['name']||_0x5c63bb};_0x5c6647:for(const _0x270a01 of _0x4d259f){if(_0x270a01[_0x5ef1c1(0x19e)]?.['segment']===_0x5c63bb){_0x26114f=_0x270a01[_0x5ef1c1(0x18f)],_0x5dcbdd=_0x270a01[_0x5ef1c1(0x19e)][_0x5ef1c1(0x18f)]||_0x5c63bb;break;}if(_0x270a01[_0x5ef1c1(0x151)])for(const _0x179644 of _0x270a01[_0x5ef1c1(0x151)]){if(_0x179644['type']==='decision_point'&&_0x179644[_0x5ef1c1(0x173)]?.[_0x5ef1c1(0x141)])for(const _0x144f44 of _0x179644['with'][_0x5ef1c1(0x141)]){if(_0x144f44[_0x5ef1c1(0x12b)]===_0x5c63bb){_0x26114f=_0x270a01[_0x5ef1c1(0x18f)],_0x5dcbdd=_0x144f44[_0x5ef1c1(0x18f)]||_0x5c63bb;break _0x5c6647;}}}}return{'stageName':_0x26114f,'criteriaName':_0x5dcbdd};}async function executeThreeStepJourneyCreate(_0x2b548d,_0x9cf8f9,_0x24184d,_0x1e15b3,_0x23df1e,_0x16f27a,_0x317e54,_0x53226a){const _0x1a44f2=a119_0x43758d,{activationDefToCreateRequest:_0x26d1e8,yamlRuleToApi:_0x228c48}=_0x53226a,{pendingEmbeddedSegments:_0x22299b,pendingEmbeddedActivations:_0x24e6f2,embeddedSegmentNameToId:_0x2b757f}=_0x1e15b3,_0xb1b1e2=JSON[_0x1a44f2(0x198)](JSON[_0x1a44f2(0x144)](_0x24184d));ensureJourneyDefaults(_0xb1b1e2[_0x1a44f2(0x125)]),stripPendingIds(_0xb1b1e2);const _0x27dacd=await _0x2b548d[_0x1a44f2(0x1a0)][_0x1a44f2(0x174)](_0xb1b1e2),_0x397483=_0x27dacd['id'],_0x1420e0=new Map();for(const _0x368789 of _0x27dacd[_0x1a44f2(0x125)][_0x1a44f2(0x168)]){_0x1420e0[_0x1a44f2(0x113)](_0x368789[_0x1a44f2(0x18f)][_0x1a44f2(0x18c)](),_0x368789['id']);}for(const [_0x435597,{definition:_0x44d6f4}]of _0x22299b){const _0x232df2=generateDeterministicJourneySegmentName(_0x9cf8f9[_0x1a44f2(0x152)]['name'],_0x435597);_0x317e54[_0x1a44f2(0x108)]?.({'type':_0x1a44f2(0x162),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'segmentName':_0x435597});const _0xff672a=createSegmentIdResolver(_0x16f27a['segmentNameToId'],_0x435597),_0x50f3e0=await resolveRuleSegmentIds(_0x44d6f4[_0x1a44f2(0xea)],_0xff672a),_0x2fd3ef=await _0x2b548d['segment'][_0x1a44f2(0x143)]({'name':_0x232df2,'description':_0x44d6f4[_0x1a44f2(0x11a)]||_0x1a44f2(0x110)+_0x435597,'journeyId':_0x397483,'rule':_0x228c48(_0x50f3e0,!![]),'countPopulation':!![],'parentFolderId':_0x23df1e[_0x1a44f2(0xc9)]||'','audienceId':_0x23df1e[_0x1a44f2(0xdc)]});_0x2b757f[_0x1a44f2(0x113)](_0x435597,_0x2fd3ef),_0x16f27a[_0x1a44f2(0xe7)][_0x1a44f2(0x113)](_0x435597,_0x2fd3ef),_0x317e54[_0x1a44f2(0x108)]?.({'type':_0x1a44f2(0xec),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'segmentName':_0x435597});}const _0xe2dcd2=new Map();for(const [_0x35c5b3,_0x2033b2]of _0x24e6f2){_0x317e54[_0x1a44f2(0x108)]?.({'type':_0x1a44f2(0xf6),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'activationName':_0x35c5b3});const _0x25f75a=await _0x26d1e8(_0x2033b2,_0x16f27a[_0x1a44f2(0x177)]),_0x5172ed=await _0x2b548d[_0x1a44f2(0x1a0)]['createActivation'](_0x397483,_0x25f75a);_0xe2dcd2[_0x1a44f2(0x113)](_0x35c5b3,_0x5172ed['id']),_0x1e15b3[_0x1a44f2(0x197)][_0x1a44f2(0x113)](_0x35c5b3,_0x5172ed['id']),_0x317e54['onProgress']?.({'type':_0x1a44f2(0xfc),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'activationName':_0x35c5b3});}const _0x3649f8=JSON['parse'](JSON[_0x1a44f2(0x144)](_0x24184d));return _0x3649f8['id']=_0x397483,ensureJourneyDefaults(_0x3649f8[_0x1a44f2(0x125)]),resolvePendingIdsInRequest(_0x3649f8,_0x24184d,_0x1420e0,_0x2b757f,_0xe2dcd2,_0x317e54),await _0x2b548d[_0x1a44f2(0x1a0)]['update'](_0x397483,_0x3649f8),{'action':_0x1a44f2(0x15c),'journeyId':_0x397483,'embeddedSegmentNameToId':_0x2b757f};}function stripPendingIds(_0x18d90b){const _0xb3c4af=a119_0x43758d;for(const _0x373f06 of _0x18d90b['attributes'][_0xb3c4af(0x168)]||[]){_0x373f06[_0xb3c4af(0x149)]?.[_0xb3c4af(0x160)]&&isPendingSegmentId(_0x373f06['entryCriteria']['segmentId'])&&delete _0x373f06[_0xb3c4af(0x149)];if(_0x373f06[_0xb3c4af(0x151)])for(const _0x5bfa17 of Object[_0xb3c4af(0xcf)](_0x373f06[_0xb3c4af(0x151)])){const _0x3e9a86=_0x373f06[_0xb3c4af(0x151)][_0x5bfa17];_0x3e9a86['type']===_0xb3c4af(0x109)&&_0x3e9a86[_0xb3c4af(0xfa)]&&isPendingActivationId(_0x3e9a86['journeyActivationStepId'])&&(_0x3e9a86[_0xb3c4af(0xfa)]='');if(_0x3e9a86[_0xb3c4af(0x121)]===_0xb3c4af(0x12d)&&_0x3e9a86[_0xb3c4af(0x141)])for(const _0x5676ae of _0x3e9a86[_0xb3c4af(0x141)]){_0x5676ae[_0xb3c4af(0x160)]&&isPendingSegmentId(_0x5676ae[_0xb3c4af(0x160)])&&(_0x5676ae['segmentId']='');}_0x3e9a86[_0xb3c4af(0x121)]===_0xb3c4af(0x19d)&&_0x3e9a86[_0xb3c4af(0x15b)]?.['segmentId']&&isPendingSegmentId(_0x3e9a86[_0xb3c4af(0x15b)][_0xb3c4af(0x160)])&&(_0x3e9a86['waitCondition'][_0xb3c4af(0x160)]='');}}}function resolvePendingIdsInRequest(_0x1f49af,_0x355214,_0x382ed1,_0x2afef3,_0x14c4d1,_0x1a98e3){const _0x241b27=a119_0x43758d,_0xae4814=(_0x421096,_0x2ae4d0)=>{const _0x44c2c4=a119_0x1c83;if(!isPendingSegmentId(_0x421096))return _0x421096;const _0x304b6c=extractPendingSegmentName(_0x421096),_0x177514=_0x2afef3['get'](_0x304b6c);return!_0x177514&&_0x1a98e3['logWarning']?.(_0x44c2c4(0x140)+_0x304b6c+_0x44c2c4(0x16f)+_0x2ae4d0),_0x177514;};if(_0x1f49af[_0x241b27(0x125)][_0x241b27(0x163)]?.[_0x241b27(0x160)]&&isPendingSegmentId(_0x1f49af[_0x241b27(0x125)][_0x241b27(0x163)][_0x241b27(0x160)])){const _0x39adaf=_0xae4814(_0x1f49af[_0x241b27(0x125)][_0x241b27(0x163)]['segmentId'],_0x241b27(0x11e));_0x39adaf&&(_0x1f49af[_0x241b27(0x125)]['goal']['segmentId']=_0x39adaf);}for(const _0xd31562 of _0x1f49af[_0x241b27(0x125)][_0x241b27(0x168)]||[]){const _0xe61d89=_0x382ed1[_0x241b27(0x13b)](_0xd31562[_0x241b27(0x18f)][_0x241b27(0x18c)]());_0xe61d89&&(_0xd31562['id']=_0xe61d89);if(_0xd31562[_0x241b27(0x149)]?.[_0x241b27(0x160)]&&isPendingSegmentId(_0xd31562[_0x241b27(0x149)][_0x241b27(0x160)])){const _0x2b4af8=_0xae4814(_0xd31562['entryCriteria'][_0x241b27(0x160)],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+_0x241b27(0x180));_0x2b4af8&&(_0xd31562[_0x241b27(0x149)][_0x241b27(0x160)]=_0x2b4af8);}if(_0xd31562['exitCriterias'])for(const _0x3537c1 of _0xd31562[_0x241b27(0x192)]){if(_0x3537c1[_0x241b27(0x160)]&&isPendingSegmentId(_0x3537c1['segmentId'])){const _0x2b645a=_0xae4814(_0x3537c1['segmentId'],_0x241b27(0x1a3)+_0xd31562['name']+'\x27\x20exit\x20criteria');_0x2b645a&&(_0x3537c1[_0x241b27(0x160)]=_0x2b645a);}}if(_0xd31562[_0x241b27(0x145)]?.['segmentId']&&isPendingSegmentId(_0xd31562[_0x241b27(0x145)][_0x241b27(0x160)])){const _0x43d995=_0xae4814(_0xd31562[_0x241b27(0x145)][_0x241b27(0x160)],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+_0x241b27(0x196));_0x43d995&&(_0xd31562[_0x241b27(0x145)]['segmentId']=_0x43d995);}if(_0xd31562['steps']){const _0x3f3e76=_0x4bcaab=>_0x355214[_0x241b27(0x125)][_0x241b27(0x168)][_0x241b27(0x18d)](_0x474180=>_0x474180[_0x241b27(0x18f)]['toLowerCase']()===_0xd31562[_0x241b27(0x18f)][_0x241b27(0x18c)]())?.[_0x241b27(0x151)]?.[_0x4bcaab];for(const _0x832613 of Object['keys'](_0xd31562['steps'])){const _0x328c52=_0xd31562[_0x241b27(0x151)][_0x832613],_0x11ff1f=_0x3f3e76(_0x832613);if(_0x328c52[_0x241b27(0x121)]===_0x241b27(0x109)&&_0x328c52[_0x241b27(0xfa)]&&(isPendingActivationId(_0x328c52[_0x241b27(0xfa)])||_0x328c52[_0x241b27(0xfa)]==='')){if(_0x11ff1f?.[_0x241b27(0xfa)]&&isPendingActivationId(_0x11ff1f[_0x241b27(0xfa)])){const _0x1380b8=extractPendingActivationName(_0x11ff1f[_0x241b27(0xfa)]),_0x4d9fa2=_0x14c4d1[_0x241b27(0x13b)](_0x1380b8);_0x4d9fa2&&(_0x328c52[_0x241b27(0xfa)]=_0x4d9fa2);}}if(_0x328c52[_0x241b27(0x121)]==='DecisionPoint'&&_0x328c52[_0x241b27(0x141)]&&_0x11ff1f?.['branches'])for(let _0x4f3b32=0x0;_0x4f3b32<_0x328c52[_0x241b27(0x141)][_0x241b27(0x18e)];_0x4f3b32++){const _0x4b4c4d=_0x328c52[_0x241b27(0x141)][_0x4f3b32],_0x476551=_0x11ff1f[_0x241b27(0x141)][_0x4f3b32];if(_0x476551?.[_0x241b27(0x160)]&&isPendingSegmentId(_0x476551[_0x241b27(0x160)])){const _0x59e172=_0xae4814(_0x476551[_0x241b27(0x160)],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+_0x241b27(0xc5)+(_0x4b4c4d[_0x241b27(0x18f)]||_0x4f3b32)+'\x27');_0x59e172&&(_0x4b4c4d[_0x241b27(0x160)]=_0x59e172);}}if(_0x328c52['type']===_0x241b27(0x19d)&&_0x328c52[_0x241b27(0x15b)]?.[_0x241b27(0x160)]&&_0x11ff1f?.[_0x241b27(0x15b)]?.[_0x241b27(0x160)]&&isPendingSegmentId(_0x11ff1f[_0x241b27(0x15b)][_0x241b27(0x160)])){const _0x11e46b=_0xae4814(_0x11ff1f[_0x241b27(0x15b)]['segmentId'],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+'\x27\x20wait\x20condition');_0x11e46b&&(_0x328c52[_0x241b27(0x15b)][_0x241b27(0x160)]=_0x11e46b);}}}}}
@@ -1 +1 @@
1
- (function(_0x156df5,_0x128000){const _0x5d182b=a120_0x2bfa,_0x1bbc85=_0x156df5();while(!![]){try{const _0x423005=-parseInt(_0x5d182b(0x1e4))/0x1+parseInt(_0x5d182b(0x1de))/0x2+parseInt(_0x5d182b(0x1df))/0x3+parseInt(_0x5d182b(0x1e1))/0x4*(parseInt(_0x5d182b(0x1ea))/0x5)+-parseInt(_0x5d182b(0x1e3))/0x6*(parseInt(_0x5d182b(0x1e5))/0x7)+parseInt(_0x5d182b(0x1ed))/0x8+parseInt(_0x5d182b(0x1e2))/0x9*(parseInt(_0x5d182b(0x1e9))/0xa);if(_0x423005===_0x128000)break;else _0x1bbc85['push'](_0x1bbc85['shift']());}catch(_0x1e7fad){_0x1bbc85['push'](_0x1bbc85['shift']());}}}(a120_0x4ac8,0xb94fe));export function buildFolderIdToPathMap(_0x15c94a){const _0x42052e=a120_0x2bfa,_0x2afb9b=new Map(),_0x1bd4a0=new Map();for(const _0x2007cd of _0x15c94a){_0x1bd4a0[_0x42052e(0x1eb)](_0x2007cd['id'],_0x2007cd);}const _0x2acaab=new Set();for(const _0x3ee145 of _0x15c94a){!_0x3ee145[_0x42052e(0x1e7)]&&_0x2acaab[_0x42052e(0x1ec)](_0x3ee145['id']);}function _0x3a50ea(_0x4d5d0d){const _0x596e4e=_0x42052e;if(_0x2afb9b[_0x596e4e(0x1e6)](_0x4d5d0d['id']))return _0x2afb9b['get'](_0x4d5d0d['id']);if(_0x2acaab[_0x596e4e(0x1e6)](_0x4d5d0d['id']))return _0x2afb9b['set'](_0x4d5d0d['id'],''),'';if(_0x4d5d0d[_0x596e4e(0x1e7)]){const _0x56e6d7=_0x1bd4a0['get'](_0x4d5d0d[_0x596e4e(0x1e7)]);if(_0x56e6d7){const _0x1588f6=_0x3a50ea(_0x56e6d7),_0x8978a6=_0x1588f6?_0x1588f6+'/'+_0x4d5d0d[_0x596e4e(0x1e0)]:_0x4d5d0d[_0x596e4e(0x1e0)];return _0x2afb9b['set'](_0x4d5d0d['id'],_0x8978a6),_0x8978a6;}}const _0x51a079=_0x4d5d0d[_0x596e4e(0x1e0)];return _0x2afb9b[_0x596e4e(0x1eb)](_0x4d5d0d['id'],_0x51a079),_0x51a079;}for(const _0x429c8b of _0x15c94a){_0x3a50ea(_0x429c8b);}return _0x2afb9b;}function a120_0x4ac8(){const _0x490397=['name','8PLezwe','18110376fTWOrk','6AVOwxS','1426549nmbsFZ','10238459YldAuM','has','parentFolderId','get','10QCjTVf','666560FfFkLB','set','add','3793832idvYOh','533890HQpIqm','1884486EvpRfy'];a120_0x4ac8=function(){return _0x490397;};return a120_0x4ac8();}export function buildFolderPathToIdMap(_0x574ea1){const _0x51fd63=a120_0x2bfa,_0x51e795=new Map(),_0x27a6a1=new Map();for(const _0x1e4fba of _0x574ea1){_0x27a6a1[_0x51fd63(0x1eb)](_0x1e4fba['id'],_0x1e4fba);}const _0x48dfc3=new Set();for(const _0x5a4171 of _0x574ea1){!_0x5a4171[_0x51fd63(0x1e7)]&&_0x48dfc3[_0x51fd63(0x1ec)](_0x5a4171['id']);}function _0x118658(_0x152ff0){const _0xd1611=_0x51fd63;if(_0x48dfc3[_0xd1611(0x1e6)](_0x152ff0['id']))return'';if(_0x152ff0[_0xd1611(0x1e7)]){const _0x12b632=_0x27a6a1[_0xd1611(0x1e8)](_0x152ff0['parentFolderId']);if(_0x12b632){const _0x3e6273=_0x118658(_0x12b632);return _0x3e6273?_0x3e6273+'/'+_0x152ff0[_0xd1611(0x1e0)]:_0x152ff0[_0xd1611(0x1e0)];}}return _0x152ff0[_0xd1611(0x1e0)];}for(const _0x5e0de3 of _0x574ea1){const _0x26f083=_0x118658(_0x5e0de3);_0x51e795[_0x51fd63(0x1eb)](_0x26f083,_0x5e0de3['id']);}return _0x51e795;}function a120_0x2bfa(_0x327a76,_0x4ac72d){_0x327a76=_0x327a76-0x1de;const _0x4ac8c1=a120_0x4ac8();let _0x2bfaac=_0x4ac8c1[_0x327a76];return _0x2bfaac;}export function buildFolderMaps(_0x31bfb8){const _0x5089dd=a120_0x2bfa,_0x5d0b5b=buildFolderIdToPathMap(_0x31bfb8),_0x1c5ed5=new Map();for(const [_0x1acf2,_0xb1cef7]of _0x5d0b5b){_0x1c5ed5[_0x5089dd(0x1eb)](_0xb1cef7,_0x1acf2);}return{'idToPath':_0x5d0b5b,'pathToId':_0x1c5ed5};}export function getFolderPath(_0x386923,_0x4e4d36){const _0x4adc98=a120_0x2bfa;if(!_0x386923)return'';return _0x4e4d36[_0x4adc98(0x1e8)](_0x386923)??'';}
1
+ (function(_0x3dc52b,_0x45837e){const _0x111608=a120_0x124c,_0x574cb0=_0x3dc52b();while(!![]){try{const _0x15e404=-parseInt(_0x111608(0x1a3))/0x1*(-parseInt(_0x111608(0x19f))/0x2)+parseInt(_0x111608(0x19d))/0x3+-parseInt(_0x111608(0x199))/0x4*(parseInt(_0x111608(0x19c))/0x5)+parseInt(_0x111608(0x19e))/0x6+-parseInt(_0x111608(0x1a1))/0x7+-parseInt(_0x111608(0x19a))/0x8+parseInt(_0x111608(0x1a2))/0x9;if(_0x15e404===_0x45837e)break;else _0x574cb0['push'](_0x574cb0['shift']());}catch(_0x5ea8c9){_0x574cb0['push'](_0x574cb0['shift']());}}}(a120_0x39af,0x3dbb1));export function buildFolderIdToPathMap(_0x2751a6){const _0xee2843=a120_0x124c,_0x2ea350=new Map(),_0x1528ab=new Map();for(const _0x45835d of _0x2751a6){_0x1528ab[_0xee2843(0x19b)](_0x45835d['id'],_0x45835d);}const _0x4fa40b=new Set();for(const _0x50f9db of _0x2751a6){!_0x50f9db[_0xee2843(0x1a4)]&&_0x4fa40b['add'](_0x50f9db['id']);}function _0x4bef43(_0x5d1fee){const _0x5c9035=_0xee2843;if(_0x2ea350[_0x5c9035(0x1a0)](_0x5d1fee['id']))return _0x2ea350['get'](_0x5d1fee['id']);if(_0x4fa40b[_0x5c9035(0x1a0)](_0x5d1fee['id']))return _0x2ea350['set'](_0x5d1fee['id'],''),'';if(_0x5d1fee[_0x5c9035(0x1a4)]){const _0xc20da8=_0x1528ab[_0x5c9035(0x1a5)](_0x5d1fee[_0x5c9035(0x1a4)]);if(_0xc20da8){const _0x3fad90=_0x4bef43(_0xc20da8),_0x1a394c=_0x3fad90?_0x3fad90+'/'+_0x5d1fee[_0x5c9035(0x1a6)]:_0x5d1fee[_0x5c9035(0x1a6)];return _0x2ea350[_0x5c9035(0x19b)](_0x5d1fee['id'],_0x1a394c),_0x1a394c;}}const _0x247c0b=_0x5d1fee['name'];return _0x2ea350[_0x5c9035(0x19b)](_0x5d1fee['id'],_0x247c0b),_0x247c0b;}for(const _0x5a86fd of _0x2751a6){_0x4bef43(_0x5a86fd);}return _0x2ea350;}function a120_0x39af(){const _0x34b0e1=['1PtrWEz','parentFolderId','get','name','3824JMVTPs','1525744eUCXav','set','5zoQCYc','118557MrGWXF','1044996RNhkHB','107654CjzzlI','has','2382884wUGLSq','4656807VRpCQC'];a120_0x39af=function(){return _0x34b0e1;};return a120_0x39af();}export function buildFolderPathToIdMap(_0x512d6b){const _0x9f313a=a120_0x124c,_0x185ebe=new Map(),_0x3dcb4d=new Map();for(const _0x12891e of _0x512d6b){_0x3dcb4d['set'](_0x12891e['id'],_0x12891e);}const _0x268fba=new Set();for(const _0x2b2225 of _0x512d6b){!_0x2b2225[_0x9f313a(0x1a4)]&&_0x268fba['add'](_0x2b2225['id']);}function _0x273adf(_0x263960){const _0x410865=_0x9f313a;if(_0x268fba[_0x410865(0x1a0)](_0x263960['id']))return'';if(_0x263960['parentFolderId']){const _0x484e3b=_0x3dcb4d[_0x410865(0x1a5)](_0x263960['parentFolderId']);if(_0x484e3b){const _0x453aa1=_0x273adf(_0x484e3b);return _0x453aa1?_0x453aa1+'/'+_0x263960[_0x410865(0x1a6)]:_0x263960[_0x410865(0x1a6)];}}return _0x263960[_0x410865(0x1a6)];}for(const _0x578865 of _0x512d6b){const _0x4cbe55=_0x273adf(_0x578865);_0x185ebe[_0x9f313a(0x19b)](_0x4cbe55,_0x578865['id']);}return _0x185ebe;}export function buildFolderMaps(_0x494046){const _0x25d74f=a120_0x124c,_0x5b506f=buildFolderIdToPathMap(_0x494046),_0x45c671=new Map();for(const [_0x2ed0ae,_0x909106]of _0x5b506f){_0x45c671[_0x25d74f(0x19b)](_0x909106,_0x2ed0ae);}return{'idToPath':_0x5b506f,'pathToId':_0x45c671};}function a120_0x124c(_0x3ab5aa,_0x5994b0){_0x3ab5aa=_0x3ab5aa-0x199;const _0x39af60=a120_0x39af();let _0x124cb8=_0x39af60[_0x3ab5aa];return _0x124cb8;}export function getFolderPath(_0x137cd8,_0x3deffc){const _0x2ffd8b=a120_0x124c;if(!_0x137cd8)return'';return _0x3deffc[_0x2ffd8b(0x1a5)](_0x137cd8)??'';}
@@ -1 +1 @@
1
- (function(_0x511166,_0x5bf493){const _0x233055=a121_0x50ce,_0x1e7fd8=_0x511166();while(!![]){try{const _0x106675=parseInt(_0x233055(0xaa))/0x1+parseInt(_0x233055(0xc4))/0x2+parseInt(_0x233055(0xc7))/0x3+parseInt(_0x233055(0xbc))/0x4+-parseInt(_0x233055(0xc2))/0x5+parseInt(_0x233055(0xba))/0x6*(-parseInt(_0x233055(0xbb))/0x7)+-parseInt(_0x233055(0xce))/0x8*(parseInt(_0x233055(0xc3))/0x9);if(_0x106675===_0x5bf493)break;else _0x1e7fd8['push'](_0x1e7fd8['shift']());}catch(_0x4a1537){_0x1e7fd8['push'](_0x1e7fd8['shift']());}}}(a121_0x3377,0xd1710));import a121_0x2ad30c from'path';import{parse as a121_0x87ca5e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x25a784){const _0x252207=a121_0x50ce;if(!_0x25a784||_0x25a784[_0x252207(0xb3)]()==='')throw new Error(_0x252207(0xb0));const _0x2af440=_0x25a784['trim']();if(_0x2af440==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x25a784};const _0x10ef4f=_0x2af440[_0x252207(0xa1)]('/')?_0x2af440[_0x252207(0xcf)](0x1):_0x2af440,_0x444820=_0x10ef4f[_0x252207(0xad)]('/')[_0x252207(0xbf)](_0x20b6eb=>_0x20b6eb!=='');if(_0x444820[_0x252207(0xb7)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0xb83f00=_0x2af440[_0x252207(0xa1)]('/')||!isRelativePathSegment(_0x444820[0x0]);for(const _0x5e4ad2 of _0x444820){validatePathSegment(_0x5e4ad2);}return{'segments':_0x444820,'isAbsolute':_0xb83f00,'raw':_0x25a784};}function isRelativePathSegment(_0x5cac60){return _0x5cac60==='.'||_0x5cac60==='..';}function a121_0x3377(){const _0x2ece88=['2186634Eamcyf','relative','No\x20tdx.json\x20found\x20for\x20file:\x20','isAbsolute','Path\x20attempts\x20to\x20navigate\x20above\x20root','push','.yaml','134096rIUnNp','substring','startsWith','exists','segments','segment','name','.yml','pop','replace','Cannot\x20split\x20empty\x20path','835002WeoeSQ','journey','endsWith','split','join','parse','Path\x20cannot\x20be\x20empty','Path\x20segment\x20cannot\x20be\x20empty','parent_segment','trim','readFile','root','dirname','length','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','14694dSLkEd','1638cbwVUl','3998520PZaBih','raw','type','filter','File\x20not\x20found:\x20','Cannot\x20navigate\x20above\x20root','4820980prjwfR','387RMVgRr','1104780SfwfKG','resolve','tdx.json'];a121_0x3377=function(){return _0x2ece88;};return a121_0x3377();}function validatePathSegment(_0x4cfd58){const _0x13ca7b=a121_0x50ce;if(_0x4cfd58==='')throw new Error(_0x13ca7b(0xb1));if(_0x4cfd58==='.'||_0x4cfd58==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x4cfd58))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x4cfd58);if(_0x4cfd58!==_0x4cfd58[_0x13ca7b(0xb3)]()){}}export function validatePath(_0x313894){const _0x406edf=a121_0x50ce;if(_0x313894[_0x406edf(0xa3)][_0x406edf(0xb7)]===0x0&&!_0x313894[_0x406edf(0xca)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x313894['isAbsolute']){if(_0x313894[_0x406edf(0xa3)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x4e7753=0x0;for(const _0x542afb of _0x313894[_0x406edf(0xa3)]){if(_0x542afb==='..'){if(_0x4e7753===0x0)throw new Error(_0x406edf(0xcb));_0x4e7753--;}else _0x542afb!=='.'&&_0x4e7753++;}}}export function joinPaths(_0x48b296,_0x4272fe){const _0x174c7b=a121_0x50ce;if(!_0x48b296||_0x48b296==='/')return _0x4272fe;if(!_0x4272fe||_0x4272fe==='.')return _0x48b296;if(_0x4272fe[_0x174c7b(0xa1)]('/'))return _0x4272fe;const _0x1e3223=parsePath(_0x48b296),_0x12e198=parsePath(_0x4272fe),_0x5871bf=[..._0x1e3223[_0x174c7b(0xa3)]];for(const _0xfc9a74 of _0x12e198['segments']){if(_0xfc9a74==='.')continue;else{if(_0xfc9a74==='..'){if(_0x5871bf[_0x174c7b(0xb7)]===0x0)throw new Error(_0x174c7b(0xc1));_0x5871bf[_0x174c7b(0xa7)]();}else _0x5871bf['push'](_0xfc9a74);}}const _0x3130b3=_0x5871bf[_0x174c7b(0xae)]('/');return _0x1e3223[_0x174c7b(0xbd)][_0x174c7b(0xa1)]('/')?'/'+_0x3130b3:_0x3130b3;}function a121_0x50ce(_0x423eeb,_0x54db2e){_0x423eeb=_0x423eeb-0xa1;const _0x337716=a121_0x3377();let _0x50ce6a=_0x337716[_0x423eeb];return _0x50ce6a;}export function normalizePath(_0x43725b){const _0x52be99=a121_0x50ce,_0x1debab=parsePath(_0x43725b),_0xb5aa2c=[];for(const _0x50c55a of _0x1debab['segments']){if(_0x50c55a==='.')continue;else{if(_0x50c55a==='..'){if(_0xb5aa2c['length']===0x0){if(_0x1debab[_0x52be99(0xca)])throw new Error(_0x52be99(0xc1));_0xb5aa2c[_0x52be99(0xcc)]('..');}else _0xb5aa2c[_0xb5aa2c[_0x52be99(0xb7)]-0x1]==='..'?_0xb5aa2c[_0x52be99(0xcc)]('..'):_0xb5aa2c[_0x52be99(0xa7)]();}else _0xb5aa2c['push'](_0x50c55a);}}if(_0xb5aa2c[_0x52be99(0xb7)]===0x0)return _0x1debab[_0x52be99(0xca)]?'/':'.';const _0x5acd98=_0xb5aa2c[_0x52be99(0xae)]('/');return _0x1debab['raw'][_0x52be99(0xa1)]('/')?'/'+_0x5acd98:_0x5acd98;}export function getParentPath(_0x390453){const _0x605125=a121_0x50ce,_0x12d7b7=parsePath(_0x390453);if(_0x12d7b7[_0x605125(0xa3)][_0x605125(0xb7)]<=0x1)return'/';const _0x101a63=_0x12d7b7[_0x605125(0xa3)]['slice'](0x0,-0x1)[_0x605125(0xae)]('/');return _0x12d7b7[_0x605125(0xbd)][_0x605125(0xa1)]('/')?'/'+_0x101a63:_0x101a63;}export function getBaseName(_0x958ebe){const _0x594543=a121_0x50ce,_0x19ed7a=parsePath(_0x958ebe);return _0x19ed7a['segments'][_0x19ed7a[_0x594543(0xa3)][_0x594543(0xb7)]-0x1]||'';}export function isChildPath(_0xaa8622,_0x46d182){const _0x5618c8=a121_0x50ce,_0x8694fe=parsePath(_0xaa8622),_0x52cd58=parsePath(_0x46d182);if(_0x8694fe['segments'][_0x5618c8(0xb7)]<=_0x52cd58[_0x5618c8(0xa3)][_0x5618c8(0xb7)])return![];for(let _0xa69cd2=0x0;_0xa69cd2<_0x52cd58[_0x5618c8(0xa3)][_0x5618c8(0xb7)];_0xa69cd2++){if(_0x8694fe[_0x5618c8(0xa3)][_0xa69cd2]!==_0x52cd58[_0x5618c8(0xa3)][_0xa69cd2])return![];}return!![];}export function splitPath(_0x26ddd7){const _0x2c424f=a121_0x50ce,_0x15f7c9=parsePath(_0x26ddd7);if(_0x15f7c9[_0x2c424f(0xa3)]['length']===0x0)throw new Error(_0x2c424f(0xa9));if(_0x15f7c9['segments'][_0x2c424f(0xb7)]===0x1)return{'parent':_0x15f7c9[_0x2c424f(0xa3)][0x0]};return{'parent':_0x15f7c9[_0x2c424f(0xa3)][0x0],'child':_0x15f7c9[_0x2c424f(0xa3)]['slice'](0x1)[_0x2c424f(0xae)]('/')};}export function isYamlFilePath(_0xf12d){const _0x2aa8cd=a121_0x50ce;return _0xf12d[_0x2aa8cd(0xac)](_0x2aa8cd(0xa6))||_0xf12d[_0x2aa8cd(0xac)](_0x2aa8cd(0xcd));}export async function resolveYamlFilePath(_0x25d454,_0x3423b4=nodeFileSystem){const _0x44e61f=a121_0x50ce,_0xeed52=a121_0x2ad30c[_0x44e61f(0xc5)](_0x25d454);if(!await _0x3423b4[_0x44e61f(0xa2)](_0xeed52))throw new Error(_0x44e61f(0xc0)+_0x25d454);let _0x5633a6=a121_0x2ad30c['dirname'](_0xeed52),_0xb8aa53=null,_0x3f3068=null;const _0x536c2a=a121_0x2ad30c[_0x44e61f(0xaf)](_0x5633a6)[_0x44e61f(0xb5)];while(_0x5633a6!==_0x536c2a){const _0x27447c=a121_0x2ad30c['join'](_0x5633a6,_0x44e61f(0xc6));if(await _0x3423b4[_0x44e61f(0xa2)](_0x27447c)){_0xb8aa53=_0x27447c,_0x3f3068=_0x5633a6;break;}_0x5633a6=a121_0x2ad30c['dirname'](_0x5633a6);}if(!_0xb8aa53||!_0x3f3068)throw new Error(_0x44e61f(0xc9)+_0x25d454);const _0x2b93b9=await _0x3423b4['readFile'](_0xb8aa53),_0x55abb9=JSON[_0x44e61f(0xaf)](_0x2b93b9),_0x10c97f=_0x55abb9[_0x44e61f(0xb2)];if(!_0x10c97f)throw new Error(_0x44e61f(0xb9));const _0x6b279d=await _0x3423b4[_0x44e61f(0xb4)](_0xeed52),_0x53532b=a121_0x87ca5e(_0x6b279d),_0x511a40=_0x53532b[_0x44e61f(0xa5)];if(!_0x511a40)throw new Error(_0x44e61f(0xb8)+_0x25d454);const _0x4719cc=_0x53532b[_0x44e61f(0xbe)]===_0x44e61f(0xab)?'journey':_0x44e61f(0xa4),_0x5b974e=a121_0x2ad30c[_0x44e61f(0xc8)](_0x3f3068,_0xeed52),_0x2bf839=a121_0x2ad30c[_0x44e61f(0xb6)](_0x5b974e),_0x155321=_0x2bf839==='.'?'':_0x2bf839[_0x44e61f(0xa8)](/\\/g,'/'),_0x381e0a=_0x155321?_0x10c97f+'/'+_0x155321+'/'+_0x511a40:_0x10c97f+'/'+_0x511a40;return{'parentSegment':_0x10c97f,'segmentName':_0x511a40,'folderPath':_0x155321,'fullPath':_0x381e0a,'resourceType':_0x4719cc};}
1
+ (function(_0x5bab4b,_0x2ea0d7){const _0x2e4c9e=a121_0x3cbe,_0x1e6643=_0x5bab4b();while(!![]){try{const _0x5a377c=parseInt(_0x2e4c9e(0x111))/0x1*(parseInt(_0x2e4c9e(0xff))/0x2)+parseInt(_0x2e4c9e(0x110))/0x3*(parseInt(_0x2e4c9e(0xfe))/0x4)+parseInt(_0x2e4c9e(0x112))/0x5+-parseInt(_0x2e4c9e(0x115))/0x6+parseInt(_0x2e4c9e(0x101))/0x7*(-parseInt(_0x2e4c9e(0xf7))/0x8)+parseInt(_0x2e4c9e(0xf5))/0x9+-parseInt(_0x2e4c9e(0x11d))/0xa*(parseInt(_0x2e4c9e(0x102))/0xb);if(_0x5a377c===_0x2ea0d7)break;else _0x1e6643['push'](_0x1e6643['shift']());}catch(_0x15f134){_0x1e6643['push'](_0x1e6643['shift']());}}}(a121_0x5bc2,0x44522));import a121_0x4bc3dc from'path';import{parse as a121_0x190714}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x2c2b4b){const _0x28d982=a121_0x3cbe;if(!_0x2c2b4b||_0x2c2b4b[_0x28d982(0xfc)]()==='')throw new Error(_0x28d982(0x10e));const _0x5f1991=_0x2c2b4b[_0x28d982(0xfc)]();if(_0x5f1991==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x2c2b4b};const _0x18e9a3=_0x5f1991[_0x28d982(0x107)]('/')?_0x5f1991['substring'](0x1):_0x5f1991,_0x30a3d9=_0x18e9a3[_0x28d982(0x113)]('/')[_0x28d982(0xf3)](_0x4e088f=>_0x4e088f!=='');if(_0x30a3d9['length']===0x0)throw new Error(_0x28d982(0x106));const _0x29cce6=_0x5f1991[_0x28d982(0x107)]('/')||!isRelativePathSegment(_0x30a3d9[0x0]);for(const _0x5bce5a of _0x30a3d9){validatePathSegment(_0x5bce5a);}return{'segments':_0x30a3d9,'isAbsolute':_0x29cce6,'raw':_0x2c2b4b};}function isRelativePathSegment(_0x274969){return _0x274969==='.'||_0x274969==='..';}function validatePathSegment(_0x223fcf){const _0x2ccf6c=a121_0x3cbe;if(_0x223fcf==='')throw new Error(_0x2ccf6c(0x109));if(_0x223fcf==='.'||_0x223fcf==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x223fcf))throw new Error(_0x2ccf6c(0x116)+_0x223fcf);if(_0x223fcf!==_0x223fcf[_0x2ccf6c(0xfc)]()){}}function a121_0x3cbe(_0x1fa73c,_0x113cf0){_0x1fa73c=_0x1fa73c-0xf1;const _0x5bc233=a121_0x5bc2();let _0x3cbe70=_0x5bc233[_0x1fa73c];return _0x3cbe70;}export function validatePath(_0x59a546){const _0x351f7c=a121_0x3cbe;if(_0x59a546[_0x351f7c(0x11c)]['length']===0x0&&!_0x59a546[_0x351f7c(0x11f)])throw new Error(_0x351f7c(0x114));if(_0x59a546[_0x351f7c(0x11f)]){if(_0x59a546[_0x351f7c(0x11c)][0x0]==='..')throw new Error(_0x351f7c(0x118));let _0x374bda=0x0;for(const _0x4663a9 of _0x59a546[_0x351f7c(0x11c)]){if(_0x4663a9==='..'){if(_0x374bda===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x374bda--;}else _0x4663a9!=='.'&&_0x374bda++;}}}export function joinPaths(_0x3c8681,_0xea6036){const _0x15bec7=a121_0x3cbe;if(!_0x3c8681||_0x3c8681==='/')return _0xea6036;if(!_0xea6036||_0xea6036==='.')return _0x3c8681;if(_0xea6036['startsWith']('/'))return _0xea6036;const _0x59159e=parsePath(_0x3c8681),_0x35f4f3=parsePath(_0xea6036),_0x3924be=[..._0x59159e['segments']];for(const _0x439bb4 of _0x35f4f3['segments']){if(_0x439bb4==='.')continue;else{if(_0x439bb4==='..'){if(_0x3924be[_0x15bec7(0xfb)]===0x0)throw new Error(_0x15bec7(0xfd));_0x3924be['pop']();}else _0x3924be[_0x15bec7(0x10f)](_0x439bb4);}}const _0x2759b8=_0x3924be[_0x15bec7(0x10c)]('/');return _0x59159e[_0x15bec7(0x119)][_0x15bec7(0x107)]('/')?'/'+_0x2759b8:_0x2759b8;}export function normalizePath(_0x37894b){const _0x94df5e=a121_0x3cbe,_0x137c22=parsePath(_0x37894b),_0x5b73c6=[];for(const _0x5e2405 of _0x137c22[_0x94df5e(0x11c)]){if(_0x5e2405==='.')continue;else{if(_0x5e2405==='..'){if(_0x5b73c6[_0x94df5e(0xfb)]===0x0){if(_0x137c22['isAbsolute'])throw new Error(_0x94df5e(0xfd));_0x5b73c6[_0x94df5e(0x10f)]('..');}else _0x5b73c6[_0x5b73c6[_0x94df5e(0xfb)]-0x1]==='..'?_0x5b73c6[_0x94df5e(0x10f)]('..'):_0x5b73c6[_0x94df5e(0xfa)]();}else _0x5b73c6[_0x94df5e(0x10f)](_0x5e2405);}}if(_0x5b73c6[_0x94df5e(0xfb)]===0x0)return _0x137c22['isAbsolute']?'/':'.';const _0x1525b8=_0x5b73c6['join']('/');return _0x137c22[_0x94df5e(0x119)][_0x94df5e(0x107)]('/')?'/'+_0x1525b8:_0x1525b8;}export function getParentPath(_0x5ec454){const _0xa344d9=a121_0x3cbe,_0x38519c=parsePath(_0x5ec454);if(_0x38519c[_0xa344d9(0x11c)][_0xa344d9(0xfb)]<=0x1)return'/';const _0x491d29=_0x38519c[_0xa344d9(0x11c)][_0xa344d9(0x11e)](0x0,-0x1)['join']('/');return _0x38519c[_0xa344d9(0x119)][_0xa344d9(0x107)]('/')?'/'+_0x491d29:_0x491d29;}export function getBaseName(_0x445b6e){const _0x3a163d=a121_0x3cbe,_0x5162e1=parsePath(_0x445b6e);return _0x5162e1['segments'][_0x5162e1[_0x3a163d(0x11c)]['length']-0x1]||'';}export function isChildPath(_0x51c069,_0x41f9ee){const _0x177125=a121_0x3cbe,_0x3028f1=parsePath(_0x51c069),_0x489fc8=parsePath(_0x41f9ee);if(_0x3028f1[_0x177125(0x11c)]['length']<=_0x489fc8[_0x177125(0x11c)][_0x177125(0xfb)])return![];for(let _0x5c31cd=0x0;_0x5c31cd<_0x489fc8['segments'][_0x177125(0xfb)];_0x5c31cd++){if(_0x3028f1[_0x177125(0x11c)][_0x5c31cd]!==_0x489fc8['segments'][_0x5c31cd])return![];}return!![];}export function splitPath(_0x5e077d){const _0x262aab=a121_0x3cbe,_0x12a576=parsePath(_0x5e077d);if(_0x12a576[_0x262aab(0x11c)][_0x262aab(0xfb)]===0x0)throw new Error(_0x262aab(0x120));if(_0x12a576['segments'][_0x262aab(0xfb)]===0x1)return{'parent':_0x12a576[_0x262aab(0x11c)][0x0]};return{'parent':_0x12a576[_0x262aab(0x11c)][0x0],'child':_0x12a576['segments'][_0x262aab(0x11e)](0x1)['join']('/')};}export function isYamlFilePath(_0x4bdbeb){const _0x2291fb=a121_0x3cbe;return _0x4bdbeb[_0x2291fb(0x104)](_0x2291fb(0xf2))||_0x4bdbeb[_0x2291fb(0x104)](_0x2291fb(0xf4));}function a121_0x5bc2(){const _0x310cd9=['Path\x20must\x20contain\x20at\x20least\x20one\x20segment','startsWith','parent_segment','Path\x20segment\x20cannot\x20be\x20empty','dirname','tdx.json','join','parse','Path\x20cannot\x20be\x20empty','push','27vgoWyq','2599LPInOw','863005Wqwysh','split','Relative\x20path\x20cannot\x20be\x20empty','608712weBzeE','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','journey','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','raw','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','segments','1600wNYrWr','slice','isAbsolute','Cannot\x20split\x20empty\x20path','readFile','.yml','filter','.yaml','4926771pnYVTP','exists','2041120qLshrd','File\x20not\x20found:\x20','segment','pop','length','trim','Cannot\x20navigate\x20above\x20root','213628GhUEtO','378AWkNZO','name','14VHlxxh','55022eIFISp','root','endsWith','replace'];a121_0x5bc2=function(){return _0x310cd9;};return a121_0x5bc2();}export async function resolveYamlFilePath(_0x2ca012,_0x1dcf30=nodeFileSystem){const _0x42d33a=a121_0x3cbe,_0x1f0ca5=a121_0x4bc3dc['resolve'](_0x2ca012);if(!await _0x1dcf30[_0x42d33a(0xf6)](_0x1f0ca5))throw new Error(_0x42d33a(0xf8)+_0x2ca012);let _0x65a0fc=a121_0x4bc3dc[_0x42d33a(0x10a)](_0x1f0ca5),_0x2efad9=null,_0x56d729=null;const _0x79c159=a121_0x4bc3dc[_0x42d33a(0x10d)](_0x65a0fc)[_0x42d33a(0x103)];while(_0x65a0fc!==_0x79c159){const _0x25875f=a121_0x4bc3dc[_0x42d33a(0x10c)](_0x65a0fc,_0x42d33a(0x10b));if(await _0x1dcf30['exists'](_0x25875f)){_0x2efad9=_0x25875f,_0x56d729=_0x65a0fc;break;}_0x65a0fc=a121_0x4bc3dc[_0x42d33a(0x10a)](_0x65a0fc);}if(!_0x2efad9||!_0x56d729)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x2ca012);const _0x1f8092=await _0x1dcf30[_0x42d33a(0xf1)](_0x2efad9),_0x345a03=JSON[_0x42d33a(0x10d)](_0x1f8092),_0x251ddd=_0x345a03[_0x42d33a(0x108)];if(!_0x251ddd)throw new Error(_0x42d33a(0x11b));const _0x547980=await _0x1dcf30[_0x42d33a(0xf1)](_0x1f0ca5),_0x5e300f=a121_0x190714(_0x547980),_0x38953b=_0x5e300f[_0x42d33a(0x100)];if(!_0x38953b)throw new Error(_0x42d33a(0x11a)+_0x2ca012);const _0xdfda01=_0x5e300f['type']==='journey'?_0x42d33a(0x117):_0x42d33a(0xf9),_0x122ab3=a121_0x4bc3dc['relative'](_0x56d729,_0x1f0ca5),_0x1d279a=a121_0x4bc3dc[_0x42d33a(0x10a)](_0x122ab3),_0x108200=_0x1d279a==='.'?'':_0x1d279a[_0x42d33a(0x105)](/\\/g,'/'),_0x354855=_0x108200?_0x251ddd+'/'+_0x108200+'/'+_0x38953b:_0x251ddd+'/'+_0x38953b;return{'parentSegment':_0x251ddd,'segmentName':_0x38953b,'folderPath':_0x108200,'fullPath':_0x354855,'resourceType':_0xdfda01};}
@@ -1 +1 @@
1
- function a122_0x3e36(_0x16915f,_0x4951d5){_0x16915f=_0x16915f-0x123;const _0x450ef0=a122_0x450e();let _0x3e3645=_0x450ef0[_0x16915f];return _0x3e3645;}function a122_0x450e(){const _0x1d110e=['4274928ZOFFVg','893704obiONl','22LcHgpL','24pybQfi','358404rKqKYh','377199MQlcEA','70hyJruj','214012QIpKHK','199367VzhSLQ','371370cAPTmX','Invalid\x20segment\x20reference\x20format:\x20','substring','3Qxbqgz','8ncHFEC','.\x20Parent\x20name\x20cannot\x20be\x20empty'];a122_0x450e=function(){return _0x1d110e;};return a122_0x450e();}(function(_0x12215a,_0x180b35){const _0x3c140c=a122_0x3e36,_0x45edca=_0x12215a();while(!![]){try{const _0x96da80=-parseInt(_0x3c140c(0x12d))/0x1+-parseInt(_0x3c140c(0x130))/0x2*(-parseInt(_0x3c140c(0x126))/0x3)+-parseInt(_0x3c140c(0x12a))/0x4+-parseInt(_0x3c140c(0x123))/0x5*(parseInt(_0x3c140c(0x12c))/0x6)+-parseInt(_0x3c140c(0x131))/0x7*(parseInt(_0x3c140c(0x127))/0x8)+-parseInt(_0x3c140c(0x12e))/0x9*(-parseInt(_0x3c140c(0x12f))/0xa)+parseInt(_0x3c140c(0x12b))/0xb*(parseInt(_0x3c140c(0x129))/0xc);if(_0x96da80===_0x180b35)break;else _0x45edca['push'](_0x45edca['shift']());}catch(_0x106a38){_0x45edca['push'](_0x45edca['shift']());}}}(a122_0x450e,0x32298));export function parseSegmentRef(_0xc699d9){const _0x2489e5=a122_0x3e36,_0x2c3269=_0xc699d9['indexOf']('/');if(_0x2c3269===-0x1)return{'parentId':_0xc699d9};if(_0x2c3269===0x0)throw new Error(_0x2489e5(0x124)+_0xc699d9+_0x2489e5(0x128));const _0x100d9a=_0xc699d9[_0x2489e5(0x125)](0x0,_0x2c3269),_0x3a6684=_0xc699d9['substring'](_0x2c3269+0x1);if(_0x3a6684==='')throw new Error(_0x2489e5(0x124)+_0xc699d9+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x100d9a,'childId':_0x3a6684};}
1
+ function a122_0x1708(){const _0x162e62=['64ejVksA','substring','.\x20Child\x20name\x20cannot\x20be\x20empty','5585UNnUfF','Invalid\x20segment\x20reference\x20format:\x20','1410327SYhzgS','.\x20Parent\x20name\x20cannot\x20be\x20empty','1602013lKeJxY','indexOf','34vHfVym','14631iWnFwI','20yliCJd','286040eCWtcN','241604NqAneR','1149222BLxNKU'];a122_0x1708=function(){return _0x162e62;};return a122_0x1708();}(function(_0x38f3cb,_0x1e62e9){const _0x516ea3=a122_0x75a5,_0xfa2588=_0x38f3cb();while(!![]){try{const _0x207108=-parseInt(_0x516ea3(0x138))/0x1+-parseInt(_0x516ea3(0x143))/0x2*(-parseInt(_0x516ea3(0x144))/0x3)+parseInt(_0x516ea3(0x13a))/0x4*(-parseInt(_0x516ea3(0x13d))/0x5)+-parseInt(_0x516ea3(0x139))/0x6+parseInt(_0x516ea3(0x141))/0x7+-parseInt(_0x516ea3(0x137))/0x8+parseInt(_0x516ea3(0x13f))/0x9*(parseInt(_0x516ea3(0x145))/0xa);if(_0x207108===_0x1e62e9)break;else _0xfa2588['push'](_0xfa2588['shift']());}catch(_0x4647be){_0xfa2588['push'](_0xfa2588['shift']());}}}(a122_0x1708,0x21ca6));function a122_0x75a5(_0x42e433,_0x1b4ff0){_0x42e433=_0x42e433-0x137;const _0x1708b0=a122_0x1708();let _0x75a509=_0x1708b0[_0x42e433];return _0x75a509;}export function parseSegmentRef(_0x8acab3){const _0x4cd242=a122_0x75a5,_0x3066a9=_0x8acab3[_0x4cd242(0x142)]('/');if(_0x3066a9===-0x1)return{'parentId':_0x8acab3};if(_0x3066a9===0x0)throw new Error(_0x4cd242(0x13e)+_0x8acab3+_0x4cd242(0x140));const _0x4df298=_0x8acab3[_0x4cd242(0x13b)](0x0,_0x3066a9),_0x1fac42=_0x8acab3[_0x4cd242(0x13b)](_0x3066a9+0x1);if(_0x1fac42==='')throw new Error(_0x4cd242(0x13e)+_0x8acab3+_0x4cd242(0x13c));return{'parentId':_0x4df298,'childId':_0x1fac42};}
@@ -1 +1 @@
1
- (function(_0x3ddeb6,_0x38272a){const _0x35ca75=a123_0x3407,_0x4ecbd4=_0x3ddeb6();while(!![]){try{const _0x10d82c=parseInt(_0x35ca75(0x1d5))/0x1+-parseInt(_0x35ca75(0x1b4))/0x2*(parseInt(_0x35ca75(0x1ac))/0x3)+parseInt(_0x35ca75(0x1aa))/0x4*(-parseInt(_0x35ca75(0x1c5))/0x5)+parseInt(_0x35ca75(0x1c9))/0x6+-parseInt(_0x35ca75(0x1b1))/0x7+-parseInt(_0x35ca75(0x1b7))/0x8*(parseInt(_0x35ca75(0x1be))/0x9)+parseInt(_0x35ca75(0x1cd))/0xa;if(_0x10d82c===_0x38272a)break;else _0x4ecbd4['push'](_0x4ecbd4['shift']());}catch(_0x413652){_0x4ecbd4['push'](_0x4ecbd4['shift']());}}}(a123_0x1e29,0xcc927));import a123_0x5a6beb from'path';function a123_0x1e29(){const _0x18184c=['folderPath','directory','parse','18KrYlvn','parent_name','exists','Parent\x20segment\x20not\x20specified','stat','File\x20not\x20found:\x20','type','8980TZnBIH','isDirectory','no_parent','segment','3934020WbeDZf','extname','tdx.json','error','52836210OTVCxQ','isScoped','trim','parent_segment','replace','basename','resourceType','segmentName','481276wRcPBg','startsWith','invalid_yaml','includes','match','parentSegment','scopedFolderPath','File\x20not\x20found','file','resolve','journey','isFile','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','3156nHrdVw','file_not_found','60594vMmYRD','dirname','readFile','no_config','relative','11381930StpQeK','No\x20tdx.json\x20found\x20for\x20file:\x20','configDir','140vywbuZ','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','4502984yHpqEN','cwd','message','string'];a123_0x1e29=function(){return _0x18184c;};return a123_0x1e29();}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(_0x27a4d8){const _0x4a0146=a123_0x3407;return _0x27a4d8[_0x4a0146(0x1c4)]!==_0x4a0146(0x1cc);}export function isScopedResolution(_0x48e998){const _0xea4401=a123_0x3407;return _0x48e998[_0xea4401(0x1c4)]===_0xea4401(0x1bc)||_0x48e998[_0xea4401(0x1c4)]===_0xea4401(0x1a5)||_0x48e998['type']===_0xea4401(0x1b5);}export function getScopedDetails(_0x169c68){if(isScopedResolution(_0x169c68))return{'isScoped':_0x169c68['isScoped'],'scopedFolderPath':_0x169c68['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x3521f4,_0x2de1de){const _0x55136b=a123_0x3407;let _0x2b5892=a123_0x5a6beb['resolve'](_0x3521f4);const _0x1397e0=a123_0x5a6beb['parse'](_0x2b5892)['root'];while(_0x2b5892!==_0x1397e0){const _0x5f2b52=a123_0x5a6beb['join'](_0x2b5892,_0x55136b(0x1cb));if(await _0x2de1de['exists'](_0x5f2b52))try{const _0x30baa5=await _0x2de1de[_0x55136b(0x1ae)](_0x5f2b52),_0x44984e=JSON[_0x55136b(0x1bd)](_0x30baa5);if(_0x44984e[_0x55136b(0x1d0)]&&typeof _0x44984e[_0x55136b(0x1d0)]===_0x55136b(0x1ba))return{'configPath':_0x5f2b52,'configDir':_0x2b5892,'parentSegment':_0x44984e[_0x55136b(0x1d0)]};}catch{}_0x2b5892=a123_0x5a6beb['dirname'](_0x2b5892);}return null;}function a123_0x3407(_0x2d80e4,_0x17c576){_0x2d80e4=_0x2d80e4-0x1a1;const _0x1e29e9=a123_0x1e29();let _0x340781=_0x1e29e9[_0x2d80e4];return _0x340781;}function calculateScopedPath(_0x1f7d7a,_0x4a0b30){const _0x4a7639=a123_0x3407,_0x9f5f8c=a123_0x5a6beb[_0x4a7639(0x1b0)](_0x4a0b30,_0x1f7d7a),_0x16b7cc=_0x9f5f8c!==''&&_0x9f5f8c!=='.'&&!_0x9f5f8c[_0x4a7639(0x1d6)]('..');return{'isScoped':_0x16b7cc,'scopedFolderPath':_0x16b7cc?_0x9f5f8c[_0x4a7639(0x1d1)](/\\/g,'/'):''};}export async function resolveTarget(_0x3d9371){const _0x4a3b36=a123_0x3407,{arg:_0x573496,contextParent:_0x4e1475,cwd:cwd=process[_0x4a3b36(0x1b8)](),fs:fs=nodeFileSystem}=_0x3d9371;if(_0x573496&&isYamlFilePath(_0x573496))try{const _0x2a512f=await resolveYamlFilePath(_0x573496,fs),_0x3d2497=a123_0x5a6beb[_0x4a3b36(0x1a6)](_0x573496),_0xe06eba=a123_0x5a6beb[_0x4a3b36(0x1ad)](_0x3d2497),_0xd9a180=await findTdxConfigAsync(_0xe06eba,fs);if(!_0xd9a180){if(_0x4e1475){const _0x5d330f=a123_0x5a6beb['dirname'](_0x3d2497);return{'type':'file','parentName':_0x4e1475,'targetDir':_0x5d330f,'configRoot':_0x5d330f,'filePath':_0x3d2497,'resourceName':_0x2a512f[_0x4a3b36(0x1d4)],'folderPath':_0x2a512f[_0x4a3b36(0x1bb)],'resourceType':_0x2a512f[_0x4a3b36(0x1d3)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1af),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x573496,'arg':_0x573496,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}const _0x4a271a=calculateScopedPath(_0xe06eba,_0xd9a180[_0x4a3b36(0x1b3)]);return{'type':_0x4a3b36(0x1a5),'parentName':_0xd9a180[_0x4a3b36(0x1a2)],'targetDir':_0xd9a180[_0x4a3b36(0x1b3)],'configRoot':_0xd9a180[_0x4a3b36(0x1b3)],'filePath':_0x3d2497,'resourceName':_0x2a512f[_0x4a3b36(0x1d4)],'folderPath':_0x2a512f[_0x4a3b36(0x1bb)],'resourceType':_0x2a512f['resourceType'],'isScoped':_0x4a271a['isScoped'],'scopedFolderPath':_0x4a271a['scopedFolderPath']};}catch(_0x10c589){const _0x41f602=_0x10c589 instanceof Error?_0x10c589[_0x4a3b36(0x1b9)]:String(_0x10c589);if(_0x41f602['includes'](_0x4a3b36(0x1a4)))return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1ab),'message':_0x4a3b36(0x1c3)+_0x573496,'arg':_0x573496};if(_0x41f602[_0x4a3b36(0x1d8)]('No\x20tdx.json\x20found')){if(_0x4e1475){const _0xd45816=a123_0x5a6beb[_0x4a3b36(0x1a6)](_0x573496);if(await fs[_0x4a3b36(0x1c0)](_0xd45816)){const _0x5a6163=a123_0x5a6beb[_0x4a3b36(0x1ad)](_0xd45816),_0x3825ef=await fs[_0x4a3b36(0x1ae)](_0xd45816),_0x1b2691=_0x3825ef['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0xeaddda=_0x3825ef[_0x4a3b36(0x1a1)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x1a0ff0=_0x1b2691?_0x1b2691[0x1][_0x4a3b36(0x1cf)]():a123_0x5a6beb[_0x4a3b36(0x1d2)](_0x573496,a123_0x5a6beb[_0x4a3b36(0x1ca)](_0x573496)),_0x141e6a=_0xeaddda&&_0xeaddda[0x1][_0x4a3b36(0x1cf)]()===_0x4a3b36(0x1a7)?_0x4a3b36(0x1a7):_0x4a3b36(0x1c8);return{'type':'file','parentName':_0x4e1475,'targetDir':_0x5a6163,'configRoot':_0x5a6163,'filePath':_0xd45816,'resourceName':_0x1a0ff0,'folderPath':'','resourceType':_0x141e6a,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x4a3b36(0x1cc),'errorCode':'no_config','message':_0x4a3b36(0x1b2)+_0x573496,'arg':_0x573496,'helpText':_0x4a3b36(0x1b6)};}return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1d7),'message':_0x41f602,'arg':_0x573496};}if(_0x573496){const _0xa9ad71=a123_0x5a6beb[_0x4a3b36(0x1a6)](cwd,_0x573496);let _0x1fc3aa=null;try{_0x1fc3aa=await fs[_0x4a3b36(0x1c2)](_0xa9ad71);}catch{}if(_0x1fc3aa?.[_0x4a3b36(0x1c6)]()){const _0x169b4e=await findTdxConfigAsync(_0xa9ad71,fs);if(_0x169b4e){const _0x388d16=calculateScopedPath(_0xa9ad71,_0x169b4e['configDir']);return{'type':_0x4a3b36(0x1bc),'parentName':_0x169b4e[_0x4a3b36(0x1a2)],'targetDir':_0xa9ad71,'configRoot':_0x169b4e['configDir'],'isScoped':_0x388d16[_0x4a3b36(0x1ce)],'scopedFolderPath':_0x388d16[_0x4a3b36(0x1a3)]};}if(_0x4e1475)return{'type':'directory','parentName':_0x4e1475,'targetDir':_0xa9ad71,'configRoot':_0xa9ad71,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x4a3b36(0x1af),'message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x573496,'arg':_0x573496,'helpText':_0x4a3b36(0x1b6)};}if(_0x1fc3aa?.[_0x4a3b36(0x1a8)]())return{'type':_0x4a3b36(0x1cc),'errorCode':'invalid_yaml','message':'Not\x20a\x20YAML\x20file:\x20'+_0x573496,'arg':_0x573496,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x502a09=sanitizeFileName(_0x573496),_0x4dd464=getSegmentRootDir(_0x502a09,cwd);return{'type':_0x4a3b36(0x1bf),'parentName':_0x573496,'targetDir':_0x4dd464,'configRoot':_0x4dd464};}const _0x21d39f=await findTdxConfigAsync(cwd,fs);if(_0x21d39f){const _0x2de4b5=calculateScopedPath(cwd,_0x21d39f[_0x4a3b36(0x1b3)]);return{'type':_0x4a3b36(0x1b5),'parentName':_0x21d39f[_0x4a3b36(0x1a2)],'targetDir':cwd,'configRoot':_0x21d39f[_0x4a3b36(0x1b3)],'isScoped':_0x2de4b5[_0x4a3b36(0x1ce)],'scopedFolderPath':_0x2de4b5['scopedFolderPath']};}if(_0x4e1475){const _0x53586c=sanitizeFileName(_0x4e1475),_0x3ac17d=getSegmentRootDir(_0x53586c,cwd);return{'type':_0x4a3b36(0x1b5),'parentName':_0x4e1475,'targetDir':_0x3ac17d,'configRoot':_0x3ac17d,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x4a3b36(0x1cc),'errorCode':_0x4a3b36(0x1c7),'message':_0x4a3b36(0x1c1),'helpText':_0x4a3b36(0x1a9)};}
1
+ (function(_0x369ed3,_0x410c49){const _0x1a518c=a123_0x1ea9,_0x60ae99=_0x369ed3();while(!![]){try{const _0xbd1023=-parseInt(_0x1a518c(0x1f9))/0x1+-parseInt(_0x1a518c(0x209))/0x2*(parseInt(_0x1a518c(0x1fb))/0x3)+-parseInt(_0x1a518c(0x226))/0x4*(-parseInt(_0x1a518c(0x215))/0x5)+parseInt(_0x1a518c(0x205))/0x6*(parseInt(_0x1a518c(0x204))/0x7)+-parseInt(_0x1a518c(0x210))/0x8+-parseInt(_0x1a518c(0x200))/0x9*(parseInt(_0x1a518c(0x203))/0xa)+-parseInt(_0x1a518c(0x219))/0xb*(-parseInt(_0x1a518c(0x20d))/0xc);if(_0xbd1023===_0x410c49)break;else _0x60ae99['push'](_0x60ae99['shift']());}catch(_0x5d4552){_0x60ae99['push'](_0x60ae99['shift']());}}}(a123_0x1834,0x6bbf6));import a123_0x134154 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';function a123_0x1834(){const _0xa5995a=['no_parent','5745580ZtcGGK','1603BODYQC','8970wqhJHZ','exists','Parent\x20segment\x20not\x20specified','type','819386yOITBL','directory','Not\x20a\x20YAML\x20file:\x20','File\x20not\x20found','12HptUoV','file_not_found','replace','6498800TGwZUj','startsWith','parent_name','configDir','no_config','185VNRAot','File\x20not\x20found:\x20','root','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','25157011mqSoJj','invalid_yaml','dirname','parent_segment','isScoped','context','parentSegment','isDirectory','segmentName','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','parse','relative','join','53468fxeBqe','scopedFolderPath','file','string','No\x20tdx.json\x20found','segment','stat','error','includes','basename','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','No\x20tdx.json\x20found\x20for\x20file:\x20','readFile','476307dgILKH','cwd','6IeXcYg','match','resourceType','resolve','trim','9rwZIjI','isFile'];a123_0x1834=function(){return _0xa5995a;};return a123_0x1834();}import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x198cd5){const _0x35d33f=a123_0x1ea9;return _0x198cd5[_0x35d33f(0x208)]!=='error';}export function isScopedResolution(_0x1bdb65){const _0xa270ac=a123_0x1ea9;return _0x1bdb65[_0xa270ac(0x208)]===_0xa270ac(0x20a)||_0x1bdb65[_0xa270ac(0x208)]===_0xa270ac(0x228)||_0x1bdb65[_0xa270ac(0x208)]==='context';}export function getScopedDetails(_0x2e87cb){const _0x15d2db=a123_0x1ea9;if(isScopedResolution(_0x2e87cb))return{'isScoped':_0x2e87cb['isScoped'],'scopedFolderPath':_0x2e87cb[_0x15d2db(0x227)]};return undefined;}async function findTdxConfigAsync(_0x14216a,_0x5820d9){const _0x1447c6=a123_0x1ea9;let _0x4d0794=a123_0x134154['resolve'](_0x14216a);const _0x4c0870=a123_0x134154[_0x1447c6(0x223)](_0x4d0794)[_0x1447c6(0x217)];while(_0x4d0794!==_0x4c0870){const _0x143109=a123_0x134154[_0x1447c6(0x225)](_0x4d0794,'tdx.json');if(await _0x5820d9[_0x1447c6(0x206)](_0x143109))try{const _0x3153ca=await _0x5820d9[_0x1447c6(0x1f8)](_0x143109),_0x23e8cb=JSON['parse'](_0x3153ca);if(_0x23e8cb[_0x1447c6(0x21c)]&&typeof _0x23e8cb[_0x1447c6(0x21c)]===_0x1447c6(0x229))return{'configPath':_0x143109,'configDir':_0x4d0794,'parentSegment':_0x23e8cb[_0x1447c6(0x21c)]};}catch{}_0x4d0794=a123_0x134154[_0x1447c6(0x21b)](_0x4d0794);}return null;}function a123_0x1ea9(_0x494fa4,_0x78912b){_0x494fa4=_0x494fa4-0x1f0;const _0x18347a=a123_0x1834();let _0x1ea9c5=_0x18347a[_0x494fa4];return _0x1ea9c5;}function calculateScopedPath(_0x562eec,_0x205294){const _0x544cf6=a123_0x1ea9,_0x37fae8=a123_0x134154[_0x544cf6(0x224)](_0x205294,_0x562eec),_0xe11120=_0x37fae8!==''&&_0x37fae8!=='.'&&!_0x37fae8[_0x544cf6(0x211)]('..');return{'isScoped':_0xe11120,'scopedFolderPath':_0xe11120?_0x37fae8[_0x544cf6(0x20f)](/\\/g,'/'):''};}export async function resolveTarget(_0x5c482d){const _0x1d16cb=a123_0x1ea9,{arg:_0x13bd6f,contextParent:_0x363382,cwd:cwd=process[_0x1d16cb(0x1fa)](),fs:fs=nodeFileSystem}=_0x5c482d;if(_0x13bd6f&&isYamlFilePath(_0x13bd6f))try{const _0x47e4c4=await resolveYamlFilePath(_0x13bd6f,fs),_0x53e636=a123_0x134154[_0x1d16cb(0x1fe)](_0x13bd6f),_0x5a8b92=a123_0x134154['dirname'](_0x53e636),_0x35a522=await findTdxConfigAsync(_0x5a8b92,fs);if(!_0x35a522){if(_0x363382){const _0xcca33c=a123_0x134154['dirname'](_0x53e636);return{'type':_0x1d16cb(0x228),'parentName':_0x363382,'targetDir':_0xcca33c,'configRoot':_0xcca33c,'filePath':_0x53e636,'resourceName':_0x47e4c4[_0x1d16cb(0x221)],'folderPath':_0x47e4c4['folderPath'],'resourceType':_0x47e4c4[_0x1d16cb(0x1fd)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1d16cb(0x1f3),'errorCode':_0x1d16cb(0x214),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x13bd6f,'arg':_0x13bd6f,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}const _0x4c97a8=calculateScopedPath(_0x5a8b92,_0x35a522['configDir']);return{'type':'file','parentName':_0x35a522['parentSegment'],'targetDir':_0x35a522[_0x1d16cb(0x213)],'configRoot':_0x35a522[_0x1d16cb(0x213)],'filePath':_0x53e636,'resourceName':_0x47e4c4[_0x1d16cb(0x221)],'folderPath':_0x47e4c4['folderPath'],'resourceType':_0x47e4c4[_0x1d16cb(0x1fd)],'isScoped':_0x4c97a8[_0x1d16cb(0x21d)],'scopedFolderPath':_0x4c97a8['scopedFolderPath']};}catch(_0x51834c){const _0x451929=_0x51834c instanceof Error?_0x51834c['message']:String(_0x51834c);if(_0x451929['includes'](_0x1d16cb(0x20c)))return{'type':_0x1d16cb(0x1f3),'errorCode':_0x1d16cb(0x20e),'message':_0x1d16cb(0x216)+_0x13bd6f,'arg':_0x13bd6f};if(_0x451929[_0x1d16cb(0x1f4)](_0x1d16cb(0x1f0))){if(_0x363382){const _0x3d906f=a123_0x134154[_0x1d16cb(0x1fe)](_0x13bd6f);if(await fs[_0x1d16cb(0x206)](_0x3d906f)){const _0x1d0650=a123_0x134154[_0x1d16cb(0x21b)](_0x3d906f),_0x43fea4=await fs['readFile'](_0x3d906f),_0x173a2b=_0x43fea4[_0x1d16cb(0x1fc)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x5f4010=_0x43fea4['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x3f4975=_0x173a2b?_0x173a2b[0x1][_0x1d16cb(0x1ff)]():a123_0x134154[_0x1d16cb(0x1f5)](_0x13bd6f,a123_0x134154['extname'](_0x13bd6f)),_0x5a97f7=_0x5f4010&&_0x5f4010[0x1][_0x1d16cb(0x1ff)]()==='journey'?'journey':_0x1d16cb(0x1f1);return{'type':'file','parentName':_0x363382,'targetDir':_0x1d0650,'configRoot':_0x1d0650,'filePath':_0x3d906f,'resourceName':_0x3f4975,'folderPath':'','resourceType':_0x5a97f7,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x1d16cb(0x1f3),'errorCode':_0x1d16cb(0x214),'message':_0x1d16cb(0x1f7)+_0x13bd6f,'arg':_0x13bd6f,'helpText':_0x1d16cb(0x1f6)};}return{'type':'error','errorCode':_0x1d16cb(0x21a),'message':_0x451929,'arg':_0x13bd6f};}if(_0x13bd6f){const _0xc89ba7=a123_0x134154[_0x1d16cb(0x1fe)](cwd,_0x13bd6f);let _0x42f13a=null;try{_0x42f13a=await fs[_0x1d16cb(0x1f2)](_0xc89ba7);}catch{}if(_0x42f13a?.[_0x1d16cb(0x220)]()){const _0x36d9fa=await findTdxConfigAsync(_0xc89ba7,fs);if(_0x36d9fa){const _0x37b6b9=calculateScopedPath(_0xc89ba7,_0x36d9fa[_0x1d16cb(0x213)]);return{'type':_0x1d16cb(0x20a),'parentName':_0x36d9fa['parentSegment'],'targetDir':_0xc89ba7,'configRoot':_0x36d9fa[_0x1d16cb(0x213)],'isScoped':_0x37b6b9[_0x1d16cb(0x21d)],'scopedFolderPath':_0x37b6b9[_0x1d16cb(0x227)]};}if(_0x363382)return{'type':_0x1d16cb(0x20a),'parentName':_0x363382,'targetDir':_0xc89ba7,'configRoot':_0xc89ba7,'isScoped':![],'scopedFolderPath':''};return{'type':_0x1d16cb(0x1f3),'errorCode':_0x1d16cb(0x214),'message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x13bd6f,'arg':_0x13bd6f,'helpText':_0x1d16cb(0x1f6)};}if(_0x42f13a?.[_0x1d16cb(0x201)]())return{'type':_0x1d16cb(0x1f3),'errorCode':'invalid_yaml','message':_0x1d16cb(0x20b)+_0x13bd6f,'arg':_0x13bd6f,'helpText':_0x1d16cb(0x222)};const _0x19c853=sanitizeFileName(_0x13bd6f),_0x12b957=getSegmentRootDir(_0x19c853,cwd);return{'type':_0x1d16cb(0x212),'parentName':_0x13bd6f,'targetDir':_0x12b957,'configRoot':_0x12b957};}const _0x2143b7=await findTdxConfigAsync(cwd,fs);if(_0x2143b7){const _0x33da11=calculateScopedPath(cwd,_0x2143b7['configDir']);return{'type':_0x1d16cb(0x21e),'parentName':_0x2143b7[_0x1d16cb(0x21f)],'targetDir':cwd,'configRoot':_0x2143b7[_0x1d16cb(0x213)],'isScoped':_0x33da11['isScoped'],'scopedFolderPath':_0x33da11['scopedFolderPath']};}if(_0x363382){const _0x7df999=sanitizeFileName(_0x363382),_0x3eb8ad=getSegmentRootDir(_0x7df999,cwd);return{'type':_0x1d16cb(0x21e),'parentName':_0x363382,'targetDir':_0x3eb8ad,'configRoot':_0x3eb8ad,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1d16cb(0x1f3),'errorCode':_0x1d16cb(0x202),'message':_0x1d16cb(0x207),'helpText':_0x1d16cb(0x218)};}
@@ -1 +1 @@
1
- function a124_0x2d21(){const _0x2d2d81=['370HjBVSd','object','startsWith','154656HFbHkr','root','stringify','191640xaCkUf','dirname','2847713NVvyhi','8eIeIwp','77777LSGicV','utf-8','cwd','parse','resolve','segments','tdx.json','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','2970276jDyKJR','315miAkMf','parent_segment','replace','Invalid\x20JSON\x20in\x20','70932ADCXFh','11188ujMKoQ','join','relative','string','296QHZVjb','Invalid\x20tdx.json:\x20expected\x20object','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field'];a124_0x2d21=function(){return _0x2d2d81;};return a124_0x2d21();}const a124_0x24683d=a124_0x4a2c;(function(_0x5b5ecc,_0x6c6590){const _0x2eb3a2=a124_0x4a2c,_0x4a8da6=_0x5b5ecc();while(!![]){try{const _0x458384=-parseInt(_0x2eb3a2(0x1a1))/0x1+-parseInt(_0x2eb3a2(0x185))/0x2*(parseInt(_0x2eb3a2(0x193))/0x3)+-parseInt(_0x2eb3a2(0x194))/0x4*(-parseInt(_0x2eb3a2(0x18f))/0x5)+parseInt(_0x2eb3a2(0x18e))/0x6+parseInt(_0x2eb3a2(0x186))/0x7*(-parseInt(_0x2eb3a2(0x198))/0x8)+parseInt(_0x2eb3a2(0x19e))/0x9*(parseInt(_0x2eb3a2(0x19b))/0xa)+-parseInt(_0x2eb3a2(0x184))/0xb;if(_0x458384===_0x6c6590)break;else _0x4a8da6['push'](_0x4a8da6['shift']());}catch(_0x538a06){_0x4a8da6['push'](_0x4a8da6['shift']());}}}(a124_0x2d21,0x55a8b));import{existsSync,readFileSync}from'fs';import a124_0xecb9fc from'path';const TDX_CONFIG_FILE=a124_0x24683d(0x18c),SEGMENTS_DIR=a124_0x24683d(0x18b);export function findTdxConfigPath(_0x1824d0=process[a124_0x24683d(0x188)]()){const _0x1af8cd=a124_0x24683d;let _0x5d2dec=a124_0xecb9fc[_0x1af8cd(0x18a)](_0x1824d0);const _0x37e29e=a124_0xecb9fc[_0x1af8cd(0x189)](_0x5d2dec)[_0x1af8cd(0x19f)];while(_0x5d2dec!==_0x37e29e){const _0xb1f1c2=a124_0xecb9fc[_0x1af8cd(0x195)](_0x5d2dec,TDX_CONFIG_FILE);if(existsSync(_0xb1f1c2))return _0xb1f1c2;_0x5d2dec=a124_0xecb9fc[_0x1af8cd(0x183)](_0x5d2dec);}return null;}function a124_0x4a2c(_0x26911d,_0x86b07f){_0x26911d=_0x26911d-0x183;const _0x2d211b=a124_0x2d21();let _0x4a2cf8=_0x2d211b[_0x26911d];return _0x4a2cf8;}export function loadTdxConfig(_0x4ec2f4){const _0x258a92=a124_0x24683d,_0x4b35d5=readFileSync(_0x4ec2f4,_0x258a92(0x187));let _0x55acfc;try{_0x55acfc=JSON['parse'](_0x4b35d5);}catch{throw new Error(_0x258a92(0x192)+_0x4ec2f4);}if(!_0x55acfc||typeof _0x55acfc!==_0x258a92(0x19c))throw new Error(_0x258a92(0x199));const _0x693c69=_0x55acfc;if(!_0x693c69[_0x258a92(0x190)]||typeof _0x693c69['parent_segment']!==_0x258a92(0x197))throw new Error(_0x258a92(0x19a));return{'parent_segment':_0x693c69[_0x258a92(0x190)]};}export function findTdxConfig(_0x3b0ec6=process[a124_0x24683d(0x188)]()){const _0x25405a=a124_0x24683d,_0xf762a7=findTdxConfigPath(_0x3b0ec6);if(!_0xf762a7)throw new Error(_0x25405a(0x18d));const _0x273957=loadTdxConfig(_0xf762a7),_0x410c94=a124_0xecb9fc[_0x25405a(0x183)](_0xf762a7);return{'config':_0x273957,'configPath':_0xf762a7,'configDir':_0x410c94};}export function tryFindTdxConfig(_0x2c9769){try{return findTdxConfig(_0x2c9769);}catch{return null;}}export function getSegmentRootDir(_0x3db9b1,_0x114635=process[a124_0x24683d(0x188)]()){return a124_0xecb9fc['join'](_0x114635,SEGMENTS_DIR,_0x3db9b1);}export function getTdxConfigPath(_0x18e9a9,_0x44898f=process[a124_0x24683d(0x188)]()){const _0x5c8e2e=a124_0x24683d;return a124_0xecb9fc[_0x5c8e2e(0x195)](getSegmentRootDir(_0x18e9a9,_0x44898f),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x41b21b,_0x1b5600){const _0x3cf2d1=a124_0x24683d,_0x5166c7=a124_0xecb9fc[_0x3cf2d1(0x18a)](_0x41b21b),_0x196481=a124_0xecb9fc[_0x3cf2d1(0x196)](_0x1b5600,_0x5166c7);if(_0x196481[_0x3cf2d1(0x19d)]('..'))return'';return _0x196481;}export function localPathToTdFolderPath(_0x45aa46){const _0x37c74d=a124_0x24683d,_0x440555=a124_0xecb9fc[_0x37c74d(0x183)](_0x45aa46);if(_0x440555==='.'||_0x440555==='')return'';return _0x440555[_0x37c74d(0x191)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x577f69,_0x317936){if(!_0x577f69)return _0x317936;return a124_0xecb9fc['join'](_0x317936,_0x577f69);}export function createTdxConfigContent(_0x249034){const _0x282f89=a124_0x24683d,_0x471336={'parent_segment':_0x249034};return JSON[_0x282f89(0x1a0)](_0x471336,null,0x2)+'\x0a';}
1
+ function a124_0x4029(){const _0x5a0d03=['parent_segment','segments','resolve','utf-8','relative','120140HRMaPU','stringify','string','dirname','68oqkEON','cwd','17913xGSYpl','1991370dpxYlm','1023669VZVFlO','256926RcWGvD','297783RWUChH','join','replace','360WYmGzY','6LuumMf','parse','126125SYthng','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','startsWith','tdx.json','object','Invalid\x20tdx.json:\x20expected\x20object'];a124_0x4029=function(){return _0x5a0d03;};return a124_0x4029();}const a124_0x5518b8=a124_0x490a;function a124_0x490a(_0xfc1920,_0x13f2d6){_0xfc1920=_0xfc1920-0x17f;const _0x4029ac=a124_0x4029();let _0x490a0d=_0x4029ac[_0xfc1920];return _0x490a0d;}(function(_0x59970b,_0x5fadea){const _0xbcfdfa=a124_0x490a,_0x17ec70=_0x59970b();while(!![]){try{const _0x5ac791=-parseInt(_0xbcfdfa(0x18a))/0x1+parseInt(_0xbcfdfa(0x188))/0x2*(parseInt(_0xbcfdfa(0x184))/0x3)+parseInt(_0xbcfdfa(0x199))/0x4*(-parseInt(_0xbcfdfa(0x195))/0x5)+parseInt(_0xbcfdfa(0x183))/0x6+parseInt(_0xbcfdfa(0x180))/0x7*(parseInt(_0xbcfdfa(0x187))/0x8)+parseInt(_0xbcfdfa(0x182))/0x9+parseInt(_0xbcfdfa(0x181))/0xa;if(_0x5ac791===_0x5fadea)break;else _0x17ec70['push'](_0x17ec70['shift']());}catch(_0x517d07){_0x17ec70['push'](_0x17ec70['shift']());}}}(a124_0x4029,0x39234));import{existsSync,readFileSync}from'fs';import a124_0x599a1d from'path';const TDX_CONFIG_FILE=a124_0x5518b8(0x18d),SEGMENTS_DIR=a124_0x5518b8(0x191);export function findTdxConfigPath(_0x5bfa1d=process[a124_0x5518b8(0x17f)]()){const _0x314da8=a124_0x5518b8;let _0x625aaf=a124_0x599a1d[_0x314da8(0x192)](_0x5bfa1d);const _0x3d4cc4=a124_0x599a1d[_0x314da8(0x189)](_0x625aaf)['root'];while(_0x625aaf!==_0x3d4cc4){const _0x2b19c=a124_0x599a1d[_0x314da8(0x185)](_0x625aaf,TDX_CONFIG_FILE);if(existsSync(_0x2b19c))return _0x2b19c;_0x625aaf=a124_0x599a1d[_0x314da8(0x198)](_0x625aaf);}return null;}export function loadTdxConfig(_0x4490f1){const _0x480ed0=a124_0x5518b8,_0x41319e=readFileSync(_0x4490f1,_0x480ed0(0x193));let _0x2148d8;try{_0x2148d8=JSON[_0x480ed0(0x189)](_0x41319e);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x4490f1);}if(!_0x2148d8||typeof _0x2148d8!==_0x480ed0(0x18e))throw new Error(_0x480ed0(0x18f));const _0x540f7a=_0x2148d8;if(!_0x540f7a[_0x480ed0(0x190)]||typeof _0x540f7a[_0x480ed0(0x190)]!==_0x480ed0(0x197))throw new Error(_0x480ed0(0x18b));return{'parent_segment':_0x540f7a[_0x480ed0(0x190)]};}export function findTdxConfig(_0x139972=process[a124_0x5518b8(0x17f)]()){const _0x3be31d=a124_0x5518b8,_0x33fc5a=findTdxConfigPath(_0x139972);if(!_0x33fc5a)throw new Error('No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x355101=loadTdxConfig(_0x33fc5a),_0x5b023d=a124_0x599a1d[_0x3be31d(0x198)](_0x33fc5a);return{'config':_0x355101,'configPath':_0x33fc5a,'configDir':_0x5b023d};}export function tryFindTdxConfig(_0x7dba9f){try{return findTdxConfig(_0x7dba9f);}catch{return null;}}export function getSegmentRootDir(_0x32771a,_0x3f3f50=process[a124_0x5518b8(0x17f)]()){return a124_0x599a1d['join'](_0x3f3f50,SEGMENTS_DIR,_0x32771a);}export function getTdxConfigPath(_0x2282a5,_0x4f9a14=process['cwd']()){const _0xd9e269=a124_0x5518b8;return a124_0x599a1d[_0xd9e269(0x185)](getSegmentRootDir(_0x2282a5,_0x4f9a14),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x57924f,_0x1fb187){const _0x40f1fe=a124_0x5518b8,_0x25de69=a124_0x599a1d[_0x40f1fe(0x192)](_0x57924f),_0x30d693=a124_0x599a1d[_0x40f1fe(0x194)](_0x1fb187,_0x25de69);if(_0x30d693[_0x40f1fe(0x18c)]('..'))return'';return _0x30d693;}export function localPathToTdFolderPath(_0x490bab){const _0x44f919=a124_0x5518b8,_0x42bd84=a124_0x599a1d[_0x44f919(0x198)](_0x490bab);if(_0x42bd84==='.'||_0x42bd84==='')return'';return _0x42bd84[_0x44f919(0x186)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x5e530c,_0x3e5fff){if(!_0x5e530c)return _0x3e5fff;return a124_0x599a1d['join'](_0x3e5fff,_0x5e530c);}export function createTdxConfigContent(_0x1d9a14){const _0x3790ce=a124_0x5518b8,_0x34ce25={'parent_segment':_0x1d9a14};return JSON[_0x3790ce(0x196)](_0x34ce25,null,0x2)+'\x0a';}