@treasuredata/tdx 0.19.2 → 0.20.0

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 (182) 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/schedule-command.js +1 -1
  30. package/dist/commands/segment-command.js +1 -1
  31. package/dist/commands/segment-create-command.js +1 -1
  32. package/dist/commands/segment-fields-command.js +1 -1
  33. package/dist/commands/segment-pull-command.js +1 -1
  34. package/dist/commands/segment-push-command.js +1 -1
  35. package/dist/commands/segment-update-command.js +1 -1
  36. package/dist/commands/segment-use-command.js +1 -1
  37. package/dist/commands/segment-validate-command.js +1 -1
  38. package/dist/commands/segments.js +1 -1
  39. package/dist/commands/show.js +1 -1
  40. package/dist/commands/status-command.d.ts.map +1 -1
  41. package/dist/commands/status-command.js +1 -1
  42. package/dist/commands/status-command.js.map +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/unset-command.js +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/user-command.js +1 -1
  47. package/dist/commands/workflow-command.js +1 -1
  48. package/dist/core/auth.d.ts +2 -2
  49. package/dist/core/auth.d.ts.map +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/auth.js.map +1 -1
  52. package/dist/core/command-output.js +1 -1
  53. package/dist/core/config.d.ts +12 -20
  54. package/dist/core/config.d.ts.map +1 -1
  55. package/dist/core/config.js +1 -1
  56. package/dist/core/config.js.map +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.d.ts +3 -0
  61. package/dist/core/global-context.d.ts.map +1 -1
  62. package/dist/core/global-context.js +1 -1
  63. package/dist/core/global-context.js.map +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/anthropic-adapter.js +1 -1
  77. package/dist/proxy/claude-usage-tracker.js +1 -1
  78. package/dist/proxy/context-signature.js +1 -1
  79. package/dist/proxy/conversation-utils.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/server.js +1 -1
  82. package/dist/proxy/session-cache.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/client/cdp-api-client.js +1 -1
  94. package/dist/sdk/client/endpoints.js +1 -1
  95. package/dist/sdk/client/engage-api-client.js +1 -1
  96. package/dist/sdk/client/http-client.js +1 -1
  97. package/dist/sdk/client/llm-api-client.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/engage.js +1 -1
  105. package/dist/sdk/errors.js +1 -1
  106. package/dist/sdk/index.js +1 -1
  107. package/dist/sdk/index.js.map +1 -1
  108. package/dist/sdk/io/index.js +1 -1
  109. package/dist/sdk/io/node-filesystem.js +1 -1
  110. package/dist/sdk/job.js +1 -1
  111. package/dist/sdk/journey.js +1 -1
  112. package/dist/sdk/llm/chat-cache.js +1 -1
  113. package/dist/sdk/llm/index.js +1 -1
  114. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  115. package/dist/sdk/llm/model-aliases.js +1 -1
  116. package/dist/sdk/llm/model-factors.js +1 -1
  117. package/dist/sdk/query/index.js +1 -1
  118. package/dist/sdk/query/sql-parser.js +1 -1
  119. package/dist/sdk/schedule.js +1 -1
  120. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  121. package/dist/sdk/segment/fields-display.js +1 -1
  122. package/dist/sdk/segment/file-discovery.js +1 -1
  123. package/dist/sdk/segment/journey-utils.js +1 -1
  124. package/dist/sdk/segment/journey-yaml.js +1 -1
  125. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  126. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  127. package/dist/sdk/segment/pull-workflow.js +1 -1
  128. package/dist/sdk/segment/push-workflow.js +1 -1
  129. package/dist/sdk/segment/resolution-context.js +1 -1
  130. package/dist/sdk/segment/segment-path-parser.js +1 -1
  131. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  132. package/dist/sdk/segment/target-resolution.js +1 -1
  133. package/dist/sdk/segment/tdx-config.js +1 -1
  134. package/dist/sdk/segment/validate-files.js +1 -1
  135. package/dist/sdk/segment/yaml-validator.js +1 -1
  136. package/dist/sdk/segment.js +1 -1
  137. package/dist/sdk/types/index.js +1 -1
  138. package/dist/sdk/types/progress.js +1 -1
  139. package/dist/sdk/user.js +1 -1
  140. package/dist/sdk/util/format-detector.js +1 -1
  141. package/dist/sdk/util/formatters.js +1 -1
  142. package/dist/sdk/util/index.js +1 -1
  143. package/dist/sdk/util/tree-formatter.js +1 -1
  144. package/dist/sdk/workflow/archive-validation.js +1 -1
  145. package/dist/sdk/workflow/clone-workflow.js +1 -1
  146. package/dist/sdk/workflow/index.js +1 -1
  147. package/dist/sdk/workflow/pull-workflow.js +1 -1
  148. package/dist/sdk/workflow/push-workflow.js +1 -1
  149. package/dist/sdk/workflow/tdx-config.js +1 -1
  150. package/dist/sdk/workflow/workflow-utils.js +1 -1
  151. package/dist/test-utils/command-runner.js +1 -1
  152. package/dist/test-utils/factories.js +1 -1
  153. package/dist/test-utils/fixtures.js +1 -1
  154. package/dist/test-utils/http-mock.js +1 -1
  155. package/dist/test-utils/index.js +1 -1
  156. package/dist/utils/async.js +1 -1
  157. package/dist/utils/colors.js +1 -1
  158. package/dist/utils/diff.js +1 -1
  159. package/dist/utils/file-permissions.js +1 -1
  160. package/dist/utils/global-cache.js +1 -1
  161. package/dist/utils/json-loader.js +1 -1
  162. package/dist/utils/local-cache.js +1 -1
  163. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  164. package/dist/utils/logger/formatters/index.js +1 -1
  165. package/dist/utils/logger/handlers/console-handler.js +1 -1
  166. package/dist/utils/logger/handlers/file-handler.js +1 -1
  167. package/dist/utils/logger/handlers/index.js +1 -1
  168. package/dist/utils/logger/handlers/null-handler.js +1 -1
  169. package/dist/utils/logger/index.js +1 -1
  170. package/dist/utils/logger/logger.js +1 -1
  171. package/dist/utils/logger/types.js +1 -1
  172. package/dist/utils/option-validation.js +1 -1
  173. package/dist/utils/port.js +1 -1
  174. package/dist/utils/process.js +1 -1
  175. package/dist/utils/prompt.js +1 -1
  176. package/dist/utils/spinner.js +1 -1
  177. package/dist/utils/sse-parser.js +1 -1
  178. package/dist/utils/string-utils.js +1 -1
  179. package/dist/utils/table-ref-parser.js +1 -1
  180. package/dist/utils/tdx-logger.js +1 -1
  181. package/dist/utils/version-check.js +1 -1
  182. package/package.json +1 -1
@@ -1 +1 @@
1
- const a117_0x12b611=a117_0x19e4;(function(_0x23976b,_0x4cb093){const _0xb08662=a117_0x19e4,_0x5d6db9=_0x23976b();while(!![]){try{const _0x3a07fa=parseInt(_0xb08662(0x1a7))/0x1+-parseInt(_0xb08662(0x164))/0x2*(-parseInt(_0xb08662(0x184))/0x3)+-parseInt(_0xb08662(0x16c))/0x4+parseInt(_0xb08662(0x1bc))/0x5*(-parseInt(_0xb08662(0x1a4))/0x6)+parseInt(_0xb08662(0x18f))/0x7+-parseInt(_0xb08662(0x1d6))/0x8*(-parseInt(_0xb08662(0x148))/0x9)+-parseInt(_0xb08662(0x1c5))/0xa;if(_0x3a07fa===_0x4cb093)break;else _0x5d6db9['push'](_0x5d6db9['shift']());}catch(_0x4368e9){_0x5d6db9['push'](_0x5d6db9['shift']());}}}(a117_0x3d85,0xd5f33));function a117_0x19e4(_0x495d2c,_0xaf3154){_0x495d2c=_0x495d2c-0x118;const _0x3d851f=a117_0x3d85();let _0x19e45a=_0x3d851f[_0x495d2c];return _0x19e45a;}import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a117_0x12b611(0x18d);export const PENDING_ACTIVATION_PREFIX=a117_0x12b611(0x11b);export function createPendingSegmentId(_0x460593){return''+PENDING_SEGMENT_PREFIX+_0x460593+'__';}export function isPendingSegmentId(_0x59abfc){const _0x3e37a5=a117_0x12b611;return _0x59abfc[_0x3e37a5(0x1c9)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0xf00a21){const _0x4b6e2f=a117_0x12b611;return _0xf00a21[_0x4b6e2f(0x167)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3cc49c){return''+PENDING_ACTIVATION_PREFIX+_0x3cc49c+'__';}export function isPendingActivationId(_0x1f1884){return _0x1f1884['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x2e656a){const _0x729770=a117_0x12b611;return _0x2e656a[_0x729770(0x167)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x4cb2d8,_0x4fbf7b){const _0x24b27c=a117_0x12b611,_0x340f96=_0x4cb2d8+'::'+(_0x4fbf7b[_0x24b27c(0x179)]()||_0x24b27c(0x147)),_0x393783=createHash(_0x24b27c(0x187))[_0x24b27c(0x161)](_0x340f96)['digest'](_0x24b27c(0x16a))['slice'](0x0,0xc);return _0x24b27c(0x1d8)+_0x393783;}export function ensureJourneyDefaults(_0x232992){const _0x5b1ca1=a117_0x12b611;!_0x232992[_0x5b1ca1(0x15d)]&&(_0x232992[_0x5b1ca1(0x15d)]=''),!_0x232992['state']&&(_0x232992[_0x5b1ca1(0x1a2)]=_0x5b1ca1(0x1df));}export function resolveTDFolderPath(_0x5705f8,_0x1e57ff,_0x24b60b){const _0x4ef150=a117_0x12b611;if(!_0x1e57ff)return _0x5705f8;if(_0x5705f8===_0x24b60b||_0x5705f8[_0x4ef150(0x1c9)](_0x24b60b+'/'))return _0x5705f8;return _0x5705f8?_0x24b60b+'/'+_0x5705f8:_0x24b60b;}export function addFoldersToCreate(_0x5bb3ec,_0x114b09,_0x33a238){const _0x3f421a=a117_0x12b611;if(!_0x5bb3ec)return;if(_0x114b09[_0x3f421a(0x1ed)](_0x5bb3ec))return;const _0xd43c6e=_0x5bb3ec['split']('/');let _0x5ce14f='';for(const _0x4fc1cc of _0xd43c6e){_0x5ce14f=_0x5ce14f?_0x5ce14f+'/'+_0x4fc1cc:_0x4fc1cc,!_0x114b09[_0x3f421a(0x1ed)](_0x5ce14f)&&_0x33a238[_0x3f421a(0x1f8)](_0x5ce14f);}}import*as a117_0x321a0e from'yaml';import{readFileSync}from'fs';import a117_0x11faf5 from'path';import{isJourneyDef,parseYamlString as a117_0x5bf028,toYamlString as a117_0x559dca,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(_0x1151c9){const _0x2b7f3b=a117_0x12b611;if(Array[_0x2b7f3b(0x12a)](_0x1151c9))return'['+_0x1151c9[_0x2b7f3b(0x1aa)](_0x57ced2=>stableStringify(_0x57ced2))['join'](',')+']';if(_0x1151c9&&typeof _0x1151c9===_0x2b7f3b(0x1e8)){const _0x2def09=_0x1151c9,_0x34d8f6=Object[_0x2b7f3b(0x186)](_0x2def09)[_0x2b7f3b(0x1dd)](),_0x2b3847=_0x34d8f6[_0x2b7f3b(0x1aa)](_0x1ad804=>'\x22'+_0x1ad804+'\x22:'+stableStringify(_0x2def09[_0x1ad804]));return'{'+_0x2b3847['join'](',')+'}';}const _0x1608f0=JSON[_0x2b7f3b(0x1d3)](_0x1151c9);return _0x1608f0===undefined?_0x2b7f3b(0x1d4):_0x1608f0;}function activationSignature(_0x4d1910){const _0x5798d4=a117_0x12b611,_0x2e90fd={'connection':_0x4d1910[_0x5798d4(0x1c8)],..._0x4d1910[_0x5798d4(0x1b7)]!==undefined&&{'all_columns':_0x4d1910[_0x5798d4(0x1b7)]},..._0x4d1910[_0x5798d4(0x1a9)]!==undefined&&{'columns':_0x4d1910[_0x5798d4(0x1a9)]},..._0x4d1910[_0x5798d4(0x172)]!==undefined&&{'behavior':_0x4d1910[_0x5798d4(0x172)]},..._0x4d1910['schedule']!==undefined&&{'schedule':_0x4d1910[_0x5798d4(0x140)]},..._0x4d1910[_0x5798d4(0x1ba)]!==undefined&&{'notification':_0x4d1910[_0x5798d4(0x1ba)]},..._0x4d1910['connector_config']!==undefined&&{'connector_config':_0x4d1910[_0x5798d4(0x135)]},..._0x4d1910[_0x5798d4(0x11e)]!==undefined&&{'activation_template_id':_0x4d1910['activation_template_id']}};return stableStringify(_0x2e90fd);}export async function prepareSegmentFiles(_0x1cc024,_0x294acc,_0xcf52f9,_0x3db696,_0x48c44d){const _0x12b9d9=a117_0x12b611,{activationDefToCreateRequest:_0x39110c}=await import('./child-segment-yaml.js'),_0x548456=[],_0x2dbc56=new Set();for(const {yamlConfig:_0xed7b7a,folderPath:_0x2a092f,sourcePath:_0x4ce9dc}of _0x1cc024){const _0x50e1fc=resolveTDFolderPath(_0x2a092f,_0x3db696,_0x48c44d),_0x2d83eb=_0x50e1fc+':'+_0xed7b7a[_0x12b9d9(0x119)],_0x6dc89b=_0x294acc[_0x12b9d9(0x15e)][_0x12b9d9(0x1f2)](_0x2d83eb),_0x5d9f38=_0x6dc89b?_0x294acc[_0x12b9d9(0x180)][_0x12b9d9(0x1f2)](_0x6dc89b['id'])||[]:[];addFoldersToCreate(_0x50e1fc,_0x294acc[_0x12b9d9(0x128)],_0x2dbc56);const _0x59e7f3=calculateActivationActions(_0xed7b7a[_0x12b9d9(0x150)]||[],_0x5d9f38,_0x294acc[_0x12b9d9(0x190)],_0x294acc[_0x12b9d9(0x143)]);for(const _0xc57292 of _0x59e7f3){(_0xc57292[_0x12b9d9(0x162)]===_0x12b9d9(0x118)||_0xc57292[_0x12b9d9(0x162)]===_0x12b9d9(0x161))&&_0xc57292[_0x12b9d9(0x1e0)]&&(_0xc57292[_0x12b9d9(0x1be)]=await _0x39110c(_0xc57292[_0x12b9d9(0x1e0)],_0xcf52f9));}const _0x3e0e39=calculateSegmentDiff(_0xed7b7a,_0x6dc89b,_0x5d9f38,_0x294acc[_0x12b9d9(0x190)],_0x294acc[_0x12b9d9(0x143)]);_0x548456[_0x12b9d9(0x16b)]({'relativePath':_0xed7b7a[_0x12b9d9(0x119)],'absolutePath':_0x4ce9dc,'yamlConfig':_0xed7b7a,'folderPath':_0x50e1fc,'existingSegment':_0x6dc89b,'existingActivations':_0x5d9f38,'isNew':_0x3e0e39['isNew'],'hasChanges':_0x3e0e39[_0x12b9d9(0x1cd)],'diff':_0x3e0e39[_0x12b9d9(0x149)],'activationActions':_0x59e7f3});}return{'segmentFiles':_0x548456,'foldersToCreate':_0x2dbc56};}export async function prepareJourneyFiles(_0x3a0943,_0x1d7e4d,_0x84ffc1,_0xa13ef3){const _0x1d2426=a117_0x12b611,_0x6fe33a=[],_0x3b86cc=new Set();for(const {yamlConfig:_0x3e6a73,folderPath:_0x135cc4,sourcePath:_0x42ca00}of _0x3a0943){const _0x1aa7b6=resolveTDFolderPath(_0x135cc4,_0x84ffc1,_0xa13ef3),_0x5ab909=_0x1aa7b6+':'+_0x3e6a73[_0x1d2426(0x119)],_0x1ab3c3=_0x1d7e4d[_0x1d2426(0x1fb)]['get'](_0x5ab909);let _0x5d8b30,_0x16d867;if(_0x1ab3c3&&_0x1ab3c3[_0x1d2426(0x155)]>0x0){const _0x3061c1=buildLocalExpandedRuleMappings(_0x3e6a73),{createYamlContext:_0x5e572f,prefetchJourneySegments:_0x4e5172}=createPushYamlContextForBundle(_0x1d7e4d['deps'],_0x1d7e4d[_0x1d2426(0x1c0)],_0x1d7e4d[_0x1d2426(0x1cb)],_0x3061c1,_0x1d7e4d['idToEmailMap'],_0x1d7e4d[_0x1d2426(0x143)],_0x1d7e4d['activationStepsById'],_0x1d7e4d['journeyById']);await _0x4e5172(_0x1ab3c3['map'](_0x71ea2f=>_0x71ea2f['id']));const _0x5256e3=hasMultipleVersions(_0x3e6a73),_0x522bc8=async _0xab8850=>{const _0x184dc5=_0x1d2426,_0x23343a=_0x1d7e4d[_0x184dc5(0x18e)]?.[_0x184dc5(0x1f2)](_0xab8850);if(_0x23343a)return _0x23343a;return _0x1d7e4d['fetchJourney']({'journeyId':_0xab8850,'journeyName':_0x3e6a73['name'],'isMultiVersion':_0x1ab3c3[_0x184dc5(0x155)]>0x1});};if(_0x5256e3&&_0x1ab3c3[_0x1d2426(0x155)]>0x1){const _0xf33ea3=[];for(const _0x4d3ab4 of _0x1ab3c3){const _0x93d017=_0x4d3ab4['versionNumber']||0x1;_0x1d7e4d['progress']?.[_0x1d2426(0x161)](_0x1d2426(0x165)+_0x3e6a73[_0x1d2426(0x119)]+'\x20v'+_0x93d017);const _0x3fb152=await _0x522bc8(_0x4d3ab4['id']),_0x4500b1=_0x5e572f(_0x4d3ab4['id']),_0x552e6b=await journeyResponseToDef(_0x3fb152,_0x4500b1);_0xf33ea3[_0x1d2426(0x16b)]({'item':_0x4d3ab4,'yaml':_0x552e6b});}const _0x35fb7e=buildLocalRuleToNameMappingFromJourney(_0x3e6a73);_0x16d867=buildMergedJourneyDef(_0xf33ea3,_0x35fb7e);const _0x523007=Math['max'](..._0xf33ea3[_0x1d2426(0x1aa)](_0x464879=>_0x464879['item']['versionNumber']||0x0)),_0x24db8d=_0x1ab3c3['find'](_0x6f0e2b=>(_0x6f0e2b['versionNumber']||0x0)===_0x523007);_0x24db8d&&(_0x1d7e4d[_0x1d2426(0x14e)]?.[_0x1d2426(0x161)]('Fetching\x20'+_0x3e6a73['name']+'\x20v'+_0x523007),_0x5d8b30=await _0x522bc8(_0x24db8d['id']));}else{const _0x52e31d=_0x1ab3c3[_0x1ab3c3[_0x1d2426(0x155)]-0x1];_0x1d7e4d[_0x1d2426(0x14e)]?.['update'](_0x1d2426(0x165)+_0x3e6a73[_0x1d2426(0x119)]),_0x5d8b30=await _0x522bc8(_0x52e31d['id']);const _0x558f15=_0x5e572f(_0x52e31d['id']),_0x26c938=await journeyResponseToDef(_0x5d8b30,_0x558f15),_0x1c9d93=buildLocalRuleToNameMappingFromJourney(_0x3e6a73);_0x16d867=buildMergedJourneyDef([{'item':_0x52e31d,'yaml':_0x26c938}],_0x1c9d93);}}addFoldersToCreate(_0x1aa7b6,_0x1d7e4d[_0x1d2426(0x128)],_0x3b86cc);const _0x3e500f=calculateJourneyDiff(_0x3e6a73,_0x16d867);_0x6fe33a[_0x1d2426(0x16b)]({'relativePath':_0x3e6a73[_0x1d2426(0x119)],'absolutePath':_0x42ca00,'yamlConfig':_0x3e6a73,'folderPath':_0x1aa7b6,'existingJourney':_0x5d8b30,'isNew':_0x3e500f['isNew'],'hasChanges':_0x3e500f[_0x1d2426(0x1cd)],'diff':_0x3e500f[_0x1d2426(0x149)]});}return{'journeyFiles':_0x6fe33a,'foldersToCreate':_0x3b86cc};}export function calculateActivationActions(_0x4d37d4,_0x394e53,_0x5c19b4,_0x48e4fc){const _0x334df2=a117_0x12b611,_0x11f7a2=[],_0x38b26c=new Map();for(const _0x3d4fe9 of _0x394e53){_0x38b26c[_0x334df2(0x195)](_0x3d4fe9['name'],_0x3d4fe9);}const _0x5d1809=new Map();for(const _0x41a21c of _0x4d37d4){_0x5d1809[_0x334df2(0x195)](_0x41a21c[_0x334df2(0x119)],_0x41a21c);}for(const _0x1b2f32 of _0x4d37d4){const _0x218a16=_0x38b26c[_0x334df2(0x1f2)](_0x1b2f32['name']);if(!_0x218a16)_0x11f7a2['push']({'type':_0x334df2(0x118),'name':_0x1b2f32[_0x334df2(0x119)],'yamlActivation':_0x1b2f32});else{const _0x114093=activationResponseToDef(_0x218a16,_0x5c19b4,_0x48e4fc),_0xbebc02=a117_0x321a0e['stringify'](_0x114093),_0x49d5f1=a117_0x321a0e['stringify'](_0x1b2f32);_0xbebc02!==_0x49d5f1&&_0x11f7a2[_0x334df2(0x16b)]({'type':_0x334df2(0x161),'name':_0x1b2f32[_0x334df2(0x119)],'yamlActivation':_0x1b2f32,'existingActivation':_0x218a16});}}for(const _0x1efc4f of _0x394e53){!_0x5d1809['has'](_0x1efc4f[_0x334df2(0x119)])&&_0x11f7a2[_0x334df2(0x16b)]({'type':_0x334df2(0x14f),'name':_0x1efc4f[_0x334df2(0x119)],'existingActivation':_0x1efc4f});}return _0x11f7a2;}export function calculateSegmentDiff(_0x560dfc,_0x474870,_0x222154,_0x3e852a,_0x454d78){const _0x30750e=segmentToYamlString(_0x560dfc);if(_0x474870){const _0x56bdfd=segmentWithActivationsToYaml(_0x474870,_0x222154,undefined,_0x3e852a,_0x454d78),_0x3fe9b9=segmentToYamlString(_0x56bdfd),_0x29e3d5=generateDiff(_0x3fe9b9,_0x30750e),_0x3865ae=hasChanges(_0x29e3d5);return{'isNew':![],'hasChanges':_0x3865ae,'diff':_0x3865ae?formatDiffWithColors(_0x29e3d5):undefined};}const _0x5434cf=generateDiff('',_0x30750e);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5434cf)};}export function calculateJourneyDiff(_0x54e30f,_0x37d907){const _0x6bcfaa=normalizeJourneyDef(_0x54e30f,_0x54e30f),_0x3fda61=a117_0x559dca(_0x6bcfaa);if(_0x37d907){const _0x3ee43d=normalizeJourneyDef(_0x37d907,_0x54e30f),_0x494275=a117_0x559dca(_0x3ee43d),_0x521577=generateDiff(_0x494275,_0x3fda61),_0x3af4f6=hasChanges(_0x521577);return{'isNew':![],'hasChanges':_0x3af4f6,'diff':_0x3af4f6?formatDiffWithColors(_0x521577):undefined};}const _0x237803=generateDiff('',_0x3fda61);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x237803)};}export function findSegmentsToDelete(_0x4d0f46,_0x52e63b,_0x467f33,_0x4938e5,_0x52793b){const _0x5ef50a=a117_0x12b611,_0xfb8225=new Set();for(const {yamlConfig:_0x42d705,folderPath:_0x5d2b07}of _0x52e63b){_0xfb8225[_0x5ef50a(0x1f8)](_0x5d2b07+':'+_0x42d705['name']);}return _0x4d0f46['filter'](_0xeee36b=>{const _0x1aa253=_0x5ef50a,_0x2aa902=_0xeee36b[_0x1aa253(0x13c)]?_0x467f33[_0x1aa253(0x1f2)](_0xeee36b['segmentFolderId'][_0x1aa253(0x173)]())||'':'',_0x26c4ea=_0x2aa902+':'+_0xeee36b[_0x1aa253(0x119)];if(_0xfb8225[_0x1aa253(0x1ed)](_0x26c4ea))return![];if(_0x52793b)return _0x2aa902===_0x4938e5||_0x2aa902[_0x1aa253(0x1c9)](_0x4938e5+'/');return!![];});}export function findJourneysToDelete(_0x38cb85,_0x2cd757,_0x1e03a7,_0x56b59f,_0xf8634b){const _0x664138=a117_0x12b611,_0x4bb54c=new Set();for(const {yamlConfig:_0x53dae8,folderPath:_0x202d26}of _0x2cd757){_0x4bb54c[_0x664138(0x1f8)](_0x202d26+':'+_0x53dae8[_0x664138(0x119)]);}return _0x38cb85[_0x664138(0x169)](_0x2484b9=>{const _0x24d393=_0x664138,_0x523af1=_0x2484b9['folderId']?_0x1e03a7[_0x24d393(0x1f2)](_0x2484b9[_0x24d393(0x14d)])||'':'',_0x1d6956=_0x523af1+':'+_0x2484b9[_0x24d393(0x166)];if(_0x4bb54c[_0x24d393(0x1ed)](_0x1d6956))return![];if(_0xf8634b)return _0x523af1===_0x56b59f||_0x523af1[_0x24d393(0x1c9)](_0x56b59f+'/');return!![];});}export function buildSegmentLookupMap(_0x15a7fc,_0x4e4049){const _0x147b66=a117_0x12b611,_0x5b16bd=new Map();for(const _0x51ed5d of _0x15a7fc){const _0x5e77d9=_0x51ed5d['segmentFolderId']?_0x4e4049[_0x147b66(0x1f2)](_0x51ed5d[_0x147b66(0x13c)][_0x147b66(0x173)]())||'':'',_0x106908=_0x5e77d9+':'+_0x51ed5d[_0x147b66(0x119)];_0x5b16bd[_0x147b66(0x195)](_0x106908,_0x51ed5d);}return _0x5b16bd;}export function buildSegmentNameToIdMap(_0x41843b){const _0x596d5b=a117_0x12b611,_0x5722b6=new Map();for(const _0x79bc3c of _0x41843b){_0x5722b6[_0x596d5b(0x195)](_0x79bc3c[_0x596d5b(0x119)],_0x79bc3c['id']);}return _0x5722b6;}export function buildJourneyBundleLookupMap(_0x4aeda0,_0x396600){const _0x530506=a117_0x12b611,_0x4078b=new Map();for(const _0xcb4d0a of _0x4aeda0){const _0x30a490=_0xcb4d0a[_0x530506(0x14d)]?_0x396600[_0x530506(0x1f2)](_0xcb4d0a[_0x530506(0x14d)])||'':'',_0x26469c=_0x30a490+':'+_0xcb4d0a[_0x530506(0x166)];!_0x4078b['has'](_0x26469c)&&_0x4078b[_0x530506(0x195)](_0x26469c,[]),_0x4078b[_0x530506(0x1f2)](_0x26469c)[_0x530506(0x16b)](_0xcb4d0a);}for(const _0x564c2e of _0x4078b[_0x530506(0x154)]()){_0x564c2e[_0x530506(0x1dd)]((_0xbbad77,_0x5ceaaf)=>(_0xbbad77['versionNumber']||0x0)-(_0x5ceaaf[_0x530506(0x19e)]||0x0));}return _0x4078b;}export function collectFoldersToCreate(_0x2776f4,_0x21706e){const _0x5339e9=a117_0x12b611,_0x775951=new Set();for(const _0x5afda8 of _0x2776f4){if(!_0x5afda8)continue;if(_0x21706e[_0x5339e9(0x1ed)](_0x5afda8))continue;const _0x49a1d6=_0x5afda8[_0x5339e9(0x1ad)]('/');let _0x3e303b='';for(const _0x39896b of _0x49a1d6){_0x3e303b=_0x3e303b?_0x3e303b+'/'+_0x39896b:_0x39896b,!_0x21706e[_0x5339e9(0x1ed)](_0x3e303b)&&_0x775951[_0x5339e9(0x1f8)](_0x3e303b);}}return _0x775951;}export function parseAndClassifyYamlFiles(_0x4be480,_0x3a9c5b,_0x4eb52e){const _0x1b556f=a117_0x12b611,_0x321a03=[],_0x407b5d=[];for(const _0x2ebfc3 of _0x4be480){const _0x1b5d52=a117_0x11faf5[_0x1b556f(0x19d)](_0x3a9c5b,a117_0x11faf5[_0x1b556f(0x12f)](_0x2ebfc3)),_0x52c23e=_0x1b5d52==='.'?'':_0x1b5d52,_0x424cc8=readFileSync(_0x2ebfc3,_0x1b556f(0x157)),_0x356fcc=a117_0x321a0e[_0x1b556f(0x19c)](_0x424cc8);if(isJourneyDef(_0x356fcc)){const _0xc8be63=a117_0x5bf028(_0x424cc8);_0x407b5d[_0x1b556f(0x16b)]({'yamlConfig':_0xc8be63,'folderPath':_0x52c23e,'sourcePath':_0x2ebfc3});}else{if(!_0x4eb52e?.['skipSegments']){const _0x93ba83=parseSegmentYamlFile(_0x424cc8),_0x4dc415=normalizeChildSegmentYaml(_0x93ba83);_0x321a03['push']({'yamlConfig':_0x4dc415,'folderPath':_0x52c23e,'sourcePath':_0x2ebfc3});}}}return{'segments':_0x321a03,'journeys':_0x407b5d};}export function validateParsedFiles(_0x1ba9b3,_0x53925e){const _0x43cb51=a117_0x12b611,_0x298230=[];for(const {yamlConfig:_0x42618b,sourcePath:_0x57e023}of _0x1ba9b3[_0x43cb51(0x12d)]){const _0x487ada=readFileSync(_0x57e023,'utf-8'),_0x54f267=a117_0x321a0e[_0x43cb51(0x1c2)](_0x487ada),_0x39cb0a=validateSegmentDef(_0x42618b,{'source':_0x487ada,'document':_0x54f267});if(!_0x39cb0a[_0x43cb51(0x139)]){const _0x324435=a117_0x11faf5[_0x43cb51(0x19d)](_0x53925e,_0x57e023);_0x298230[_0x43cb51(0x16b)]({'filePath':_0x324435,'source':_0x487ada,'result':_0x39cb0a,'isJourney':![]});}}for(const {yamlConfig:_0x309283,sourcePath:_0x12f1c6}of _0x1ba9b3[_0x43cb51(0x13e)]){const _0x1d0de1=readFileSync(_0x12f1c6,_0x43cb51(0x157)),_0x4c466f=a117_0x321a0e[_0x43cb51(0x1c2)](_0x1d0de1),_0xc21384=validateJourneyDef(_0x309283,{'source':_0x1d0de1,'document':_0x4c466f});if(!_0xc21384[_0x43cb51(0x139)]){const _0x4173e6=a117_0x11faf5['relative'](_0x53925e,_0x12f1c6);_0x298230[_0x43cb51(0x16b)]({'filePath':_0x4173e6,'source':_0x1d0de1,'result':_0xc21384,'isJourney':!![]});}}return _0x298230;}export function formatValidationErrors(_0x5458b0){const _0x2dc4c2=a117_0x12b611,_0x4090b8=[];for(const {filePath:_0x3d46a8,source:_0x79f4aa,result:_0x507788,isJourney:_0x327c79}of _0x5458b0){const _0x2dcfa8=_0x327c79?_0x2dc4c2(0x1e9):_0x2dc4c2(0x147);_0x4090b8[_0x2dc4c2(0x16b)]('\x0a'+_0x3d46a8+'\x20('+_0x2dcfa8+'):\x20'+_0x507788[_0x2dc4c2(0x124)][_0x2dc4c2(0x155)]+_0x2dc4c2(0x1f9)),_0x4090b8['push'](formatValidationResult(_0x507788,_0x79f4aa,_0x3d46a8));}return _0x4090b8[_0x2dc4c2(0x1c3)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4aafde){const _0x108081=a117_0x12b611,_0x14d03c=new Set(),_0x12e280=new Map(),_0x42ed2b=collectSegmentUsageCounts(_0x4aafde);if(_0x4aafde['segments'])for(const [_0x52ce55,_0x23ce4a]of Object[_0x108081(0x1b0)](_0x4aafde['segments'])){_0x14d03c[_0x108081(0x1f8)](_0x52ce55);if(_0x23ce4a['rule']){const _0x3e98b2=yamlRuleToApi(_0x23ce4a[_0x108081(0x1ef)]),_0x43756f=apiRuleToYaml(_0x3e98b2);_0x12e280[_0x108081(0x195)](_0x52ce55,_0x43756f);}}const _0x462ca3=new Map();let _0x4f600c=0x0;for(const [_0x286075,_0x4ceb57]of _0x12e280){const _0x2d1320=serializeExpandedRule(_0x4ceb57,_0x12e280),_0x40336e=_0x462ca3[_0x108081(0x1f2)](_0x2d1320)||[];_0x40336e['push']({'name':_0x286075,'index':_0x4f600c}),_0x462ca3[_0x108081(0x195)](_0x2d1320,_0x40336e),_0x4f600c++;}const _0x5ee978=new Map();for(const [_0x58dbf7,_0x384f2e]of _0x462ca3){const _0x50b268=_0x384f2e[_0x108081(0x144)]()[_0x108081(0x1dd)]((_0x20de48,_0x5690c2)=>{const _0x44cad5=_0x108081,_0x19b6a4=_0x42ed2b['get'](_0x20de48['name'])||0x0,_0x46c258=_0x42ed2b[_0x44cad5(0x1f2)](_0x5690c2['name'])||0x0;if(_0x19b6a4!==_0x46c258)return _0x46c258-_0x19b6a4;return _0x20de48[_0x44cad5(0x13b)]-_0x5690c2['index'];})[_0x108081(0x1aa)](_0x3cfe60=>_0x3cfe60[_0x108081(0x119)]),_0x376260=[];for(const _0x2001b0 of _0x50b268){const _0x595683=_0x42ed2b['get'](_0x2001b0)||0x0,_0x59c85e=Math[_0x108081(0x16d)](_0x595683,0x1);for(let _0x2df24d=0x0;_0x2df24d<_0x59c85e;_0x2df24d++){_0x376260[_0x108081(0x16b)](_0x2001b0);}}_0x5ee978[_0x108081(0x195)](_0x58dbf7,_0x376260);}return{'existingLocalSegmentNames':_0x14d03c,'localSegmentRules':_0x12e280,'localExpandedRuleToNames':_0x5ee978};}async function buildServerSegmentRuleMap(_0x2c43cd,_0x527228,_0x55483b,_0x22adad){const _0x299dc5=new Map(),_0x40b455=new Set(),_0x540d7d=async _0x2f789b=>{const _0x17175f=a117_0x19e4;if(_0x40b455[_0x17175f(0x1ed)](_0x2f789b))return;_0x40b455['add'](_0x2f789b);let _0x4940cf=_0x55483b[_0x17175f(0x176)](_0x531d4c=>_0x531d4c['id']===_0x2f789b);if(!_0x4940cf)try{_0x4940cf=await _0x2c43cd[_0x17175f(0x147)]['getSegment'](_0x527228,_0x2f789b);}catch{return;}if(!_0x4940cf?.[_0x17175f(0x1ef)])return;const _0x5aa4b5=apiRuleToYaml(_0x4940cf[_0x17175f(0x1ef)]);_0x299dc5['set'](_0x2f789b,_0x5aa4b5);const _0x13689a=collectSegmentRefsFromRule(_0x5aa4b5);for(const _0x21b455 of _0x13689a){await _0x540d7d(_0x21b455);}};for(const _0x4b4f50 of _0x22adad){await _0x540d7d(_0x4b4f50);}return _0x299dc5;}export function createSegmentIdResolver(_0x1b7f1f,_0x1e281f){return async _0x6d28d4=>{const _0x4e09ce=a117_0x19e4,_0x301f80=_0x1b7f1f[_0x4e09ce(0x1f2)](_0x6d28d4);if(!_0x301f80)throw new SDKError(ErrorCode[_0x4e09ce(0x199)],_0x4e09ce(0x196)+_0x6d28d4+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x1e281f+'\x27)');return _0x301f80;};}export function extractRootFolderId(_0x672564){const _0x20acb7=a117_0x12b611;return _0x672564[_0x20acb7(0x181)]?.[_0x20acb7(0x1f6)]?.[_0x20acb7(0x1fa)]?.['id']||_0x672564[_0x20acb7(0x181)]?.['parentFolder']?.[_0x20acb7(0x1fa)]?.['id'];}export function buildConnectionMaps(_0x4da304){const _0x29adfc=a117_0x12b611,_0x167162=new Map(),_0x64e8fa=new Map(),_0x145fe6=new Map();for(const _0x17a83b of _0x4da304){_0x167162[_0x29adfc(0x195)](_0x17a83b['name'],parseInt(_0x17a83b['id'],0xa)),_0x64e8fa[_0x29adfc(0x195)](_0x17a83b['id'],_0x17a83b['name']),_0x145fe6[_0x29adfc(0x195)](_0x17a83b[_0x29adfc(0x119)],_0x17a83b[_0x29adfc(0x162)]);}return{'nameToId':_0x167162,'idToName':_0x64e8fa,'nameToType':_0x145fe6};}export function calculatePushStats(_0x4a8dbf,_0x4c8547,_0x5df098,_0x4c5b49,_0x5129ae,_0x3329be,_0x27e9e4){const _0x18cfe3=a117_0x12b611,_0x548aa1=_0x4a8dbf[_0x18cfe3(0x169)](_0x1b81ef=>_0x1b81ef['isNew']),_0x12803e=_0x4a8dbf['filter'](_0x8cb8e3=>!_0x8cb8e3[_0x18cfe3(0x11c)]&&_0x8cb8e3[_0x18cfe3(0x1cd)]),_0x3d72a1=_0x4a8dbf['filter'](_0xd259e5=>!_0xd259e5[_0x18cfe3(0x11c)]&&!_0xd259e5[_0x18cfe3(0x1cd)]),_0x3f6c49=_0x3329be?_0x4c5b49:[],_0x5953bd=_0x4c8547[_0x18cfe3(0x169)](_0x1770fe=>_0x1770fe['isNew']),_0x1ffd44=_0x4c8547['filter'](_0x42834a=>!_0x42834a[_0x18cfe3(0x11c)]&&_0x42834a[_0x18cfe3(0x1cd)]),_0x220ce1=_0x4c8547[_0x18cfe3(0x169)](_0x36fdc1=>!_0x36fdc1[_0x18cfe3(0x11c)]&&!_0x36fdc1['hasChanges']),_0x11f4f7=_0x3329be?_0x5129ae:[],_0x2b5505=_0x4a8dbf['flatMap'](_0x4c63e7=>_0x4c63e7[_0x18cfe3(0x11f)]),_0x44ad46=_0x2b5505['filter'](_0x490a2c=>_0x490a2c[_0x18cfe3(0x162)]===_0x18cfe3(0x118)),_0x295eae=_0x2b5505[_0x18cfe3(0x169)](_0x3e061a=>_0x3e061a[_0x18cfe3(0x162)]===_0x18cfe3(0x161)),_0x45104a=_0x2b5505[_0x18cfe3(0x169)](_0x4397af=>_0x4397af['type']===_0x18cfe3(0x14f)),_0x1fca1e=Array['from'](_0x5df098)[_0x18cfe3(0x1dd)](),_0x3fe5ad=_0x27e9e4?![]:_0x548aa1['length']>0x0||_0x12803e[_0x18cfe3(0x155)]>0x0||_0x3f6c49[_0x18cfe3(0x155)]>0x0,_0x666277=_0x5953bd[_0x18cfe3(0x155)]>0x0||_0x1ffd44[_0x18cfe3(0x155)]>0x0||_0x11f4f7['length']>0x0,_0x44d319=_0x27e9e4?![]:_0x2b5505[_0x18cfe3(0x155)]>0x0,_0x605716=_0x1fca1e[_0x18cfe3(0x155)]>0x0;return{'segments':{'new':_0x548aa1,'changed':_0x12803e,'unchanged':_0x3d72a1,'toDelete':_0x3f6c49},'journeys':{'new':_0x5953bd,'changed':_0x1ffd44,'unchanged':_0x220ce1,'toDelete':_0x11f4f7},'activations':{'all':_0x2b5505,'toCreate':_0x44ad46,'toUpdate':_0x295eae,'toDelete':_0x45104a},'folders':{'toCreate':_0x1fca1e},'counts':{'segments':{'new':_0x548aa1[_0x18cfe3(0x155)],'changed':_0x12803e['length'],'unchanged':_0x3d72a1['length'],'toDelete':_0x3f6c49[_0x18cfe3(0x155)]},'journeys':{'new':_0x5953bd[_0x18cfe3(0x155)],'changed':_0x1ffd44[_0x18cfe3(0x155)],'unchanged':_0x220ce1[_0x18cfe3(0x155)],'toDelete':_0x11f4f7[_0x18cfe3(0x155)]},'activations':{'create':_0x44ad46['length'],'update':_0x295eae[_0x18cfe3(0x155)],'delete':_0x45104a['length']},'folders':_0x1fca1e['length']},'hasChanges':_0x3fe5ad||_0x666277||_0x44d319||_0x605716};}export async function buildPushExecutionContext(_0x29cb26,_0x1bceff,_0x31a7c1,_0x333593,_0x731ade,_0x4da3fb){const _0xf4123b=a117_0x12b611,_0x108c54=extractRootFolderId(_0x31a7c1),{pathToId:_0x19fd02,idToPath:_0x426bc2}=buildFolderMaps(_0x731ade),_0x18ffcd=buildSegmentNameToIdMap(_0x333593),_0x3c0c1c=new Map(),{batchAsync:_0x11e8f7}=await import(_0xf4123b(0x17a)),[_0x3bcf90,_0x54441c]=await Promise[_0xf4123b(0x1d1)]([_0x29cb26['user'][_0xf4123b(0x168)](),_0x29cb26[_0xf4123b(0x1c8)][_0xf4123b(0x1ce)](),((async()=>{const _0x3b857c=_0xf4123b;!_0x4da3fb&&_0x333593[_0x3b857c(0x155)]>0x0&&await _0x11e8f7(_0x333593,async _0x57f4c1=>{const _0x58c383=_0x3b857c,_0x4511c5=await _0x29cb26[_0x58c383(0x147)]['listActivations'](_0x1bceff,_0x57f4c1['id']);_0x3c0c1c[_0x58c383(0x195)](_0x57f4c1['id'],_0x4511c5);});})())]),{emailToId:_0x4351ba,idToEmail:_0x4cd9f7}=_0x3bcf90,_0x3916e7=buildConnectionMaps(_0x54441c);return{'rootFolderId':_0x108c54,'folderPathToId':_0x19fd02,'folderIdToPath':_0x426bc2,'segmentNameToId':_0x18ffcd,'activationsBySegmentId':_0x3c0c1c,'emailToIdMap':_0x4351ba,'idToEmailMap':_0x4cd9f7,'connectionNameToIdMap':_0x3916e7[_0xf4123b(0x1cc)],'connectionIdToNameMap':_0x3916e7[_0xf4123b(0x1db)],'connectionNameToTypeMap':_0x3916e7[_0xf4123b(0x1a1)]};}export function createPushYamlContextForBundle(_0x2ccd7b,_0x40f673,_0x58c425,_0xcd1190,_0x496248,_0x2d0df7,_0x280f39,_0x393bb1){const {existingLocalSegmentNames:_0x157937,localExpandedRuleToNames:_0x1093bb}=_0xcd1190,_0x324746=new Set(),_0x58cf7a=new Map(),_0x32b07e=new Map(),_0x371386=new Map(),_0x8d2a23=createJumpTargetCache(),_0x9a2e14=new Map(),_0x5d5ebc=new Map(),_0x29c76b=new Set();let _0x48c981;const _0x40e87d=_0x3ff066=>{const _0x3cc72f={'resolveSegment':async _0x4b3cc=>{const _0xe0c32d=a117_0x19e4,_0x5d4bce=_0x371386[_0xe0c32d(0x1f2)](_0x4b3cc);if(_0x5d4bce!==undefined)return{'name':_0x5d4bce,'isJourneyLocal':!![]};try{let _0x41ba13=_0x58c425['find'](_0x38c2ba=>_0x38c2ba['id']===_0x4b3cc);!_0x41ba13&&(_0x41ba13=await _0x2ccd7b[_0xe0c32d(0x147)][_0xe0c32d(0x1e3)](_0x40f673,_0x4b3cc));const _0x3317cd=generateJourneyLocalName(_0x41ba13[_0xe0c32d(0x119)]),_0x900cd1=_0x41ba13[_0xe0c32d(0x156)]===SEGMENT_KIND_JOURNEY&&_0x3317cd!==undefined;let _0x4c6899=_0x41ba13[_0xe0c32d(0x119)],_0xc52617;if(_0x900cd1&&_0x41ba13[_0xe0c32d(0x1ef)]){const _0x55c240=apiRuleToYaml(_0x41ba13[_0xe0c32d(0x1ef)]);_0x5d5ebc['set'](_0x4b3cc,_0x55c240);const _0x5da109=async _0x1bd070=>{const _0x7bd97d=_0xe0c32d,_0x4ea2e9=collectSegmentRefsFromRule(_0x1bd070);for(const _0x4421f4 of _0x4ea2e9){if(!_0x5d5ebc['has'](_0x4421f4))try{const _0x1dfe2d=await _0x2ccd7b[_0x7bd97d(0x147)][_0x7bd97d(0x1e3)](_0x40f673,_0x4421f4);if(_0x1dfe2d?.[_0x7bd97d(0x1ef)]){const _0x1a2d96=apiRuleToYaml(_0x1dfe2d[_0x7bd97d(0x1ef)]);_0x5d5ebc[_0x7bd97d(0x195)](_0x4421f4,_0x1a2d96),await _0x5da109(_0x1a2d96);}}catch{}}};await _0x5da109(_0x55c240);const _0x4f90e4=serializeExpandedRule(_0x55c240,_0x5d5ebc),_0x42d0e1=_0x1093bb[_0xe0c32d(0x1f2)](_0x4f90e4);if(_0x42d0e1&&_0x42d0e1[_0xe0c32d(0x155)]>0x0){const _0x273caa=_0x58cf7a[_0xe0c32d(0x1f2)](_0x4f90e4)||0x0,_0x32e947=_0x42d0e1[_0x273caa]||_0x42d0e1[_0x42d0e1[_0xe0c32d(0x155)]-0x1];_0x58cf7a['set'](_0x4f90e4,_0x273caa+0x1),_0x4c6899=_0x32e947,_0x324746['add'](_0x4c6899),_0x371386[_0xe0c32d(0x195)](_0x4b3cc,_0x4c6899);const _0xaa2ae8=await resolveRuleSegmentRefs(_0x55c240,async _0x3ba863=>{const _0x584ceb=_0xe0c32d,_0x812b02=_0x371386[_0x584ceb(0x1f2)](_0x3ba863);if(_0x812b02)return _0x812b02;const _0x64e32=await _0x48c981[_0x584ceb(0x11a)](_0x3ba863);return _0x64e32[_0x584ceb(0x119)];});_0xc52617={'description':_0x41ba13[_0xe0c32d(0x15d)],'rule':_0xaa2ae8};}else{const _0x3b6178=_0x9a2e14[_0xe0c32d(0x1f2)](_0x4f90e4);if(_0x3b6178)_0x4c6899=_0x3b6178,_0x371386[_0xe0c32d(0x195)](_0x4b3cc,_0x4c6899);else{if(_0x3317cd){let _0x17c7f7=_0x3317cd,_0x3516ed=0x2;while(_0x324746[_0xe0c32d(0x1ed)](_0x17c7f7)||_0x157937[_0xe0c32d(0x1ed)](_0x17c7f7)){_0x17c7f7=_0x3317cd+'_'+_0x3516ed,_0x3516ed++;}_0x324746[_0xe0c32d(0x1f8)](_0x17c7f7),_0x4c6899=_0x17c7f7;}_0x371386['set'](_0x4b3cc,_0x4c6899),_0x9a2e14[_0xe0c32d(0x195)](_0x4f90e4,_0x4c6899);const _0xaf0518=await resolveRuleSegmentRefs(_0x55c240,async _0x43de20=>{const _0x5c9cca=_0xe0c32d,_0x30dd73=_0x371386[_0x5c9cca(0x1f2)](_0x43de20);if(_0x30dd73)return _0x30dd73;const _0xc6caf3=await _0x48c981[_0x5c9cca(0x11a)](_0x43de20);return _0xc6caf3[_0x5c9cca(0x119)];});_0xc52617={'description':_0x41ba13[_0xe0c32d(0x15d)],'rule':_0xaf0518};}}}return{'name':_0x4c6899,'isJourneyLocal':_0x900cd1,'definition':_0xc52617};}catch{return{'name':_0x4b3cc,'isJourneyLocal':![]};}},'resolveActivation':async _0x2d4272=>{const _0x39ff4c=a117_0x19e4,_0x32eea7=_0x32b07e['get'](_0x2d4272);if(_0x32eea7!==undefined)return{'name':_0x32eea7,'isJourneyLocal':!![]};try{let _0x4a00c9=_0x280f39?.['get'](_0x2d4272);!_0x4a00c9&&(_0x4a00c9=await _0x2ccd7b['journey'][_0x39ff4c(0x133)](_0x3ff066,_0x2d4272));const _0x1aa144=_0x4a00c9[_0x39ff4c(0x18a)][_0x39ff4c(0x132)]['name']||_0x2d4272,_0xe16477=sanitizeYamlKey(_0x1aa144)||_0x39ff4c(0x12b)+_0x2d4272,_0x509089=_0xe16477;_0x32b07e['set'](_0x2d4272,_0x509089);const _0xadd537=journeyActivationStepToYaml(_0x4a00c9,_0x496248,_0x2d0df7);return{'name':_0x509089,'isJourneyLocal':!![],'definition':_0xadd537};}catch{return{'name':_0x2d4272,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x9beded,_0x342c46)=>resolveJumpTarget(_0x9beded,_0x342c46,_0x8d2a23,async _0x340c5d=>{const _0x770bce=a117_0x19e4,_0x3a13b1=_0x393bb1?.[_0x770bce(0x1f2)](_0x340c5d);if(_0x3a13b1)return _0x3a13b1;return _0x2ccd7b['journey'][_0x770bce(0x130)](_0x340c5d);})};return _0x48c981=_0x3cc72f,_0x3cc72f;},_0xd4a46a=async _0x56f5e2=>{const _0x46d487=a117_0x19e4,{collectSegmentIdsFromJourneyApi:_0x411091}=await import(_0x46d487(0x1e2)),{batchAsync:_0x4c5a33}=await import(_0x46d487(0x17a)),_0x1555a8=new Set();for(const _0x2e989d of _0x56f5e2){let _0xcf41e4=_0x393bb1?.[_0x46d487(0x1f2)](_0x2e989d);!_0xcf41e4&&(_0xcf41e4=await _0x2ccd7b[_0x46d487(0x1e9)][_0x46d487(0x130)](_0x2e989d));const _0x7d9a18=_0x411091(_0xcf41e4);for(const _0x6c34d0 of _0x7d9a18){_0x1555a8[_0x46d487(0x1f8)](_0x6c34d0);}}let _0x31b614=Array[_0x46d487(0x14a)](_0x1555a8);while(_0x31b614[_0x46d487(0x155)]>0x0){const _0x5d71eb=_0x31b614['filter'](_0x5cfbee=>!_0x29c76b[_0x46d487(0x1ed)](_0x5cfbee));if(_0x5d71eb[_0x46d487(0x155)]===0x0)break;const _0x5d600e=await _0x4c5a33(_0x5d71eb,async _0x2b3509=>{const _0x23b937=_0x46d487;_0x29c76b[_0x23b937(0x1f8)](_0x2b3509);let _0x45981e=_0x58c425[_0x23b937(0x176)](_0x2a1e8=>_0x2a1e8['id']===_0x2b3509);if(!_0x45981e)try{_0x45981e=await _0x2ccd7b[_0x23b937(0x147)][_0x23b937(0x1e3)](_0x40f673,_0x2b3509);}catch{return null;}return{'segmentId':_0x2b3509,'segment':_0x45981e};},0xa),_0x4381f8=new Set();for(const _0x1d8763 of _0x5d600e){if(!_0x1d8763?.[_0x46d487(0x147)]?.[_0x46d487(0x1ef)])continue;const _0x214e4e=apiRuleToYaml(_0x1d8763[_0x46d487(0x147)]['rule']);_0x5d5ebc['set'](_0x1d8763[_0x46d487(0x1e5)],_0x214e4e);const _0x5a9ef0=collectSegmentRefsFromRule(_0x214e4e);for(const _0x5f2707 of _0x5a9ef0){!_0x29c76b[_0x46d487(0x1ed)](_0x5f2707)&&_0x4381f8[_0x46d487(0x1f8)](_0x5f2707);}}_0x31b614=Array[_0x46d487(0x14a)](_0x4381f8);}};return{'createYamlContext':_0x40e87d,'prefetchJourneySegments':_0xd4a46a};}export async function executePushSegments(_0x91bd0c,_0x2572d9,_0x441f81,_0x44aa22,_0x29f9f7){const _0x39198b=a117_0x12b611,{segmentDefToCreateRequest:_0x10c8ed,segmentDefToUpdateRequest:_0x5b98fa}=await import(_0x39198b(0x1a5)),_0x3dc249=_0x441f81[_0x39198b(0x128)],_0x20ccf8=0x5,_0x35975b=async _0x153a09=>{const _0x3b14e7=_0x39198b,_0x2c47ad=_0x153a09[_0x3b14e7(0x182)]?_0x3dc249[_0x3b14e7(0x1f2)](_0x153a09['folderPath']):undefined;let _0xe0ec8;const _0x5e8f07={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x153a09['isNew']){_0x29f9f7['onProgress']?.({'type':_0x3b14e7(0x1fc),'name':_0x153a09[_0x3b14e7(0x1f3)][_0x3b14e7(0x119)]});const _0x4226e6=_0x10c8ed(_0x153a09['yamlConfig'],_0x2c47ad),_0x1fa61a=await _0x29f9f7[_0x3b14e7(0x136)]('Creating\x20segment\x20\x27'+_0x153a09['yamlConfig'][_0x3b14e7(0x119)]+'\x27...',()=>_0x91bd0c[_0x3b14e7(0x147)][_0x3b14e7(0x19b)](_0x44aa22['parentId'],_0x4226e6));_0xe0ec8=_0x1fa61a['data']['id'],_0x5e8f07[_0x3b14e7(0x11d)]={'name':_0x153a09['yamlConfig'][_0x3b14e7(0x119)],'id':_0xe0ec8},_0x29f9f7[_0x3b14e7(0x1e7)]?.({'type':'segment_created','name':_0x153a09[_0x3b14e7(0x1f3)][_0x3b14e7(0x119)],'segmentId':_0xe0ec8}),_0x29f9f7[_0x3b14e7(0x1e6)]?.(_0x3b14e7(0x1c6)+_0x153a09['yamlConfig'][_0x3b14e7(0x119)]+'\x27'),_0x5e8f07[_0x3b14e7(0x188)]=0x1;}else{if(_0x153a09['hasChanges']){_0x29f9f7['onProgress']?.({'type':_0x3b14e7(0x16f),'name':_0x153a09[_0x3b14e7(0x1f3)][_0x3b14e7(0x119)]});const _0xf5280a=_0x5b98fa(_0x153a09[_0x3b14e7(0x1f3)]);_0x2c47ad!==_0x153a09[_0x3b14e7(0x1bd)]?.[_0x3b14e7(0x13c)]&&(_0xf5280a[_0x3b14e7(0x13c)]=_0x2c47ad?parseInt(_0x2c47ad,0xa):undefined),await _0x29f9f7[_0x3b14e7(0x136)](_0x3b14e7(0x170)+_0x153a09[_0x3b14e7(0x1f3)][_0x3b14e7(0x119)]+_0x3b14e7(0x1eb),()=>_0x91bd0c[_0x3b14e7(0x147)][_0x3b14e7(0x17c)](_0x44aa22[_0x3b14e7(0x1c0)],_0x153a09[_0x3b14e7(0x1bd)]['id'],_0xf5280a)),_0xe0ec8=_0x153a09[_0x3b14e7(0x1bd)]['id'],_0x29f9f7['onProgress']?.({'type':_0x3b14e7(0x1ab),'name':_0x153a09['yamlConfig'][_0x3b14e7(0x119)]}),_0x29f9f7[_0x3b14e7(0x1e6)]?.(_0x3b14e7(0x17b)+_0x153a09['yamlConfig'][_0x3b14e7(0x119)]+'\x27'),_0x5e8f07[_0x3b14e7(0x1c7)]=0x1;}else _0xe0ec8=_0x153a09[_0x3b14e7(0x1bd)]['id'];}}catch(_0x2bd165){const _0x163208=isHttp400Error(_0x2bd165),_0x2f50a1=_0x163208?ErrorCode[_0x3b14e7(0x16e)]:ErrorCode[_0x3b14e7(0x174)],_0x5a3625=getErrorMessage(_0x2bd165);throw new SDKError(_0x2f50a1,_0x3b14e7(0x122)+(_0x153a09[_0x3b14e7(0x11c)]?_0x3b14e7(0x118):_0x3b14e7(0x161))+_0x3b14e7(0x177)+_0x153a09[_0x3b14e7(0x151)]+_0x3b14e7(0x12e)+_0x5a3625,_0x2bd165);}try{const _0x3180f1=await syncActivationsForSegment(_0x91bd0c,_0x44aa22[_0x3b14e7(0x1c0)],_0xe0ec8,_0x153a09[_0x3b14e7(0x1f3)][_0x3b14e7(0x119)],_0x153a09[_0x3b14e7(0x11f)],_0x29f9f7,_0x153a09['absolutePath']);_0x5e8f07[_0x3b14e7(0x150)]=_0x3180f1;}catch(_0x38fe3e){if(_0x38fe3e instanceof SDKError)throw _0x38fe3e;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x153a09[_0x3b14e7(0x1f3)][_0x3b14e7(0x119)]+_0x3b14e7(0x1b3)+_0x153a09[_0x3b14e7(0x151)]+_0x3b14e7(0x12e)+getErrorMessage(_0x38fe3e),_0x38fe3e);}return _0x5e8f07;},_0x342e42=await batchAsync(_0x2572d9,_0x35975b,_0x20ccf8),_0x5b63cf={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x7359ab of _0x342e42){_0x5b63cf['created']+=_0x7359ab[_0x39198b(0x188)],_0x5b63cf[_0x39198b(0x1c7)]+=_0x7359ab[_0x39198b(0x1c7)],_0x7359ab['createdSegmentId']&&_0x5b63cf[_0x39198b(0x1b6)]['set'](_0x7359ab[_0x39198b(0x11d)][_0x39198b(0x119)],_0x7359ab['createdSegmentId']['id']),_0x5b63cf[_0x39198b(0x150)][_0x39198b(0x188)]+=_0x7359ab[_0x39198b(0x150)][_0x39198b(0x188)],_0x5b63cf[_0x39198b(0x150)]['updated']+=_0x7359ab[_0x39198b(0x150)][_0x39198b(0x1c7)],_0x5b63cf[_0x39198b(0x150)][_0x39198b(0x1d2)]+=_0x7359ab[_0x39198b(0x150)]['deleted'];}return _0x5b63cf;}async function syncActivationsForSegment(_0x13e01f,_0x4e030a,_0x5abaf7,_0x163c9e,_0x24bddf,_0x399aed,_0xccf146){const _0x3b9aa5=a117_0x12b611,_0x3d68a8={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2d0cdc of _0x24bddf){try{if(_0x2d0cdc[_0x3b9aa5(0x162)]===_0x3b9aa5(0x118)&&_0x2d0cdc[_0x3b9aa5(0x1be)])_0x399aed[_0x3b9aa5(0x1e7)]?.({'type':'activation_creating','segmentName':_0x163c9e,'activationName':_0x2d0cdc['name']}),await _0x399aed['withProgress'](_0x3b9aa5(0x1b5)+_0x2d0cdc[_0x3b9aa5(0x119)]+'\x27...',()=>_0x13e01f['segment'][_0x3b9aa5(0x121)](_0x4e030a,_0x5abaf7,_0x2d0cdc[_0x3b9aa5(0x1be)])),_0x399aed[_0x3b9aa5(0x1e7)]?.({'type':'activation_created','segmentName':_0x163c9e,'activationName':_0x2d0cdc['name']}),_0x399aed[_0x3b9aa5(0x1e6)]?.(_0x3b9aa5(0x1af)+_0x2d0cdc['name']+'\x27'),_0x3d68a8[_0x3b9aa5(0x188)]++;else{if(_0x2d0cdc[_0x3b9aa5(0x162)]===_0x3b9aa5(0x161)&&_0x2d0cdc['validatedRequest']&&_0x2d0cdc[_0x3b9aa5(0x159)])_0x399aed[_0x3b9aa5(0x1e7)]?.({'type':_0x3b9aa5(0x1bb),'segmentName':_0x163c9e,'activationName':_0x2d0cdc[_0x3b9aa5(0x119)]}),await _0x399aed[_0x3b9aa5(0x136)](_0x3b9aa5(0x14b)+_0x2d0cdc[_0x3b9aa5(0x119)]+_0x3b9aa5(0x1eb),()=>_0x13e01f[_0x3b9aa5(0x147)][_0x3b9aa5(0x158)](_0x4e030a,_0x5abaf7,_0x2d0cdc['existingActivation']['id'],_0x2d0cdc['validatedRequest'])),_0x399aed[_0x3b9aa5(0x1e7)]?.({'type':'activation_updated','segmentName':_0x163c9e,'activationName':_0x2d0cdc[_0x3b9aa5(0x119)]}),_0x399aed['logSuccess']?.('Updated\x20activation\x20\x27'+_0x2d0cdc['name']+'\x27'),_0x3d68a8['updated']++;else _0x2d0cdc['type']===_0x3b9aa5(0x14f)&&_0x2d0cdc['existingActivation']&&(_0x399aed[_0x3b9aa5(0x1e7)]?.({'type':'activation_deleting','segmentName':_0x163c9e,'activationName':_0x2d0cdc['name']}),await _0x399aed[_0x3b9aa5(0x136)]('Deleting\x20activation\x20\x27'+_0x2d0cdc[_0x3b9aa5(0x119)]+_0x3b9aa5(0x1eb),()=>_0x13e01f[_0x3b9aa5(0x147)][_0x3b9aa5(0x19a)](_0x4e030a,_0x5abaf7,_0x2d0cdc[_0x3b9aa5(0x159)]['id'])),_0x399aed[_0x3b9aa5(0x1e7)]?.({'type':_0x3b9aa5(0x1da),'segmentName':_0x163c9e,'activationName':_0x2d0cdc[_0x3b9aa5(0x119)]}),_0x399aed[_0x3b9aa5(0x163)]?.(_0x3b9aa5(0x1f7)+_0x2d0cdc['name']+'\x27'),_0x3d68a8[_0x3b9aa5(0x1d2)]++);}}catch(_0x3da01d){const _0x9a58ed=isHttp400Error(_0x3da01d),_0x4c2641=_0x9a58ed?ErrorCode[_0x3b9aa5(0x13f)]:ErrorCode[_0x3b9aa5(0x1f5)],_0x46d43d=getErrorMessage(_0x3da01d);throw new SDKError(_0x4c2641,_0x3b9aa5(0x122)+_0x2d0cdc[_0x3b9aa5(0x162)]+_0x3b9aa5(0x123)+_0x2d0cdc[_0x3b9aa5(0x119)]+_0x3b9aa5(0x1b3)+_0xccf146+_0x3b9aa5(0x12e)+_0x46d43d,_0x3da01d);}}return _0x3d68a8;}export async function executePushFolders(_0x5092de,_0x374f79,_0x76f26a,_0x25128c,_0x383527){const _0x5888c8=a117_0x12b611,_0x50d8f9=new Map(_0x76f26a);for(const _0x5db6d0 of _0x374f79){const _0x4a12a0=_0x5db6d0[_0x5888c8(0x1ad)]('/'),_0x5a1768=_0x4a12a0[_0x4a12a0[_0x5888c8(0x155)]-0x1],_0x1c307c=_0x4a12a0[_0x5888c8(0x144)](0x0,-0x1)['join']('/'),_0x294106=_0x50d8f9[_0x5888c8(0x1f2)](_0x1c307c);_0x383527[_0x5888c8(0x1e7)]?.({'type':_0x5888c8(0x131),'folder':_0x5db6d0});const _0x2e84c6={'name':_0x5a1768,'parentFolderId':_0x294106},_0x16b721=await _0x383527[_0x5888c8(0x136)]('Creating\x20folder\x20\x27'+_0x5db6d0+_0x5888c8(0x1eb),()=>_0x5092de['segment'][_0x5888c8(0x153)](_0x25128c[_0x5888c8(0x1c0)],_0x2e84c6));_0x50d8f9[_0x5888c8(0x195)](_0x5db6d0,_0x16b721[_0x5888c8(0x1fa)]['id']),_0x383527[_0x5888c8(0x1e7)]?.({'type':_0x5888c8(0x141),'folder':_0x5db6d0,'folderId':_0x16b721['data']['id']}),_0x383527['logInfo']?.('Created\x20folder\x20\x27'+_0x5db6d0+'\x27');}return _0x50d8f9;}export async function executePushSegmentDeletions(_0x3a3682,_0x968e1b,_0x1b8be2){const _0x13b375=a117_0x12b611;if(_0x968e1b['length']===0x0)return 0x0;const {batchAsync:_0x54ff33}=await import(_0x13b375(0x17a)),_0x155c71=0x5,_0x35f57a=await _0x54ff33(_0x968e1b,async _0x2e0002=>{const _0x3cf1bc=_0x13b375;return _0x1b8be2[_0x3cf1bc(0x1e7)]?.({'type':_0x3cf1bc(0x142),'name':_0x2e0002[_0x3cf1bc(0x119)]}),await _0x3a3682[_0x3cf1bc(0x147)][_0x3cf1bc(0x1e1)](_0x2e0002['id']),_0x1b8be2[_0x3cf1bc(0x1e7)]?.({'type':_0x3cf1bc(0x1b2),'name':_0x2e0002[_0x3cf1bc(0x119)]}),_0x1b8be2[_0x3cf1bc(0x163)]?.(_0x3cf1bc(0x15a)+_0x2e0002['name']+'\x27'),0x1;},_0x155c71);return _0x35f57a[_0x13b375(0x1b9)]((_0x3e5a6,_0x119c03)=>_0x3e5a6+_0x119c03,0x0);}export async function executePushJourneys(_0x2969cb,_0x235ca2,_0x1adfb6,_0x2f80d2,_0x4898d9){const _0xec256a=a117_0x12b611,{journeyDefToRequest:_0x1ef8b0}=await import(_0xec256a(0x1e2)),{activationDefToCreateRequest:_0x5632c2,yamlRuleToApi:_0x3fa6f0,validateSegmentRule:_0xa16f33}=await import(_0xec256a(0x1a5)),_0x26f104={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x109180=new Map(_0x1adfb6[_0xec256a(0x160)]),_0x268a3e=0x5;for(let _0x25137c=0x0;_0x25137c<_0x235ca2[_0xec256a(0x155)];_0x25137c+=_0x268a3e){const _0x41fbbd=_0x235ca2[_0xec256a(0x144)](_0x25137c,_0x25137c+_0x268a3e),_0x566266=await Promise['all'](_0x41fbbd[_0xec256a(0x1aa)](async _0x47638b=>{const _0x3c8703=_0xec256a;if(!_0x47638b[_0x3c8703(0x11c)]&&!_0x47638b[_0x3c8703(0x1cd)])return{'action':_0x3c8703(0x1d5),'name':_0x47638b[_0x3c8703(0x1f3)][_0x3c8703(0x119)],'journeyId':_0x47638b['existingJourney']?.['id']};const _0xf459fd=_0x47638b[_0x3c8703(0x182)]?_0x1adfb6[_0x3c8703(0x128)][_0x3c8703(0x1f2)](_0x47638b[_0x3c8703(0x182)]):undefined;_0x4898d9[_0x3c8703(0x1e7)]?.({'type':_0x47638b['isNew']?'journey_creating':_0x3c8703(0x189),'name':_0x47638b[_0x3c8703(0x1f3)][_0x3c8703(0x119)]});try{const _0x51d9bc=await executeSingleJourneyPush(_0x2969cb,_0x47638b,{..._0x1adfb6,'segmentNameToId':_0x109180},{'parentId':_0x2f80d2[_0x3c8703(0x1c0)],'rootFolderId':_0x2f80d2[_0x3c8703(0x1ca)],'folderId':_0xf459fd,'verbose':_0x2f80d2[_0x3c8703(0x126)]},_0x4898d9,{'journeyDefToRequest':_0x1ef8b0,'activationDefToCreateRequest':_0x5632c2,'yamlRuleToApi':_0x3fa6f0,'validateSegmentRule':_0xa16f33});for(const [_0x46ff67,_0x5d4ecc]of _0x51d9bc[_0x3c8703(0x12c)]){_0x109180['set'](_0x46ff67,_0x5d4ecc),_0x26f104['embeddedSegmentNameToId'][_0x3c8703(0x195)](_0x46ff67,_0x5d4ecc);}if(_0x51d9bc[_0x3c8703(0x1ea)]==='created')_0x4898d9[_0x3c8703(0x1e7)]?.({'type':_0x3c8703(0x178),'name':_0x47638b['yamlConfig'][_0x3c8703(0x119)],'journeyId':_0x51d9bc['journeyId']}),_0x4898d9['logSuccess']?.(_0x3c8703(0x1b4)+_0x47638b['yamlConfig'][_0x3c8703(0x119)]+'\x27'),_0x26f104['created']++;else _0x51d9bc[_0x3c8703(0x1ea)]==='updated'&&(_0x4898d9[_0x3c8703(0x1e7)]?.({'type':_0x3c8703(0x1de),'name':_0x47638b[_0x3c8703(0x1f3)][_0x3c8703(0x119)]}),_0x4898d9[_0x3c8703(0x1e6)]?.(_0x3c8703(0x146)+_0x47638b['yamlConfig'][_0x3c8703(0x119)]+'\x27'),_0x26f104[_0x3c8703(0x1c7)]++);return{'action':_0x51d9bc['action'],'name':_0x47638b[_0x3c8703(0x1f3)][_0x3c8703(0x119)],'journeyId':_0x51d9bc[_0x3c8703(0x15b)]};}catch(_0x337683){const _0x1f6b7f=isHttp400Error(_0x337683),_0x39e728=_0x1f6b7f?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x131487=getErrorMessage(_0x337683);throw new SDKError(_0x39e728,_0x3c8703(0x122)+(_0x47638b[_0x3c8703(0x11c)]?'create':_0x3c8703(0x161))+'\x20journey\x20from\x20file:\x20'+_0x47638b[_0x3c8703(0x151)]+'\x0a\x20\x20'+_0x131487,_0x337683);}}));_0x26f104[_0xec256a(0x145)][_0xec256a(0x16b)](..._0x566266);}return _0x26f104;}async function executeSingleJourneyPush(_0x42aa5e,_0x44ef6d,_0x19bd1c,_0x40911e,_0x3b0063,_0xeea8b3){const _0x109b00=a117_0x12b611,{journeyDefToRequest:_0x20fbfa,activationDefToCreateRequest:_0x4c89ae,yamlRuleToApi:_0x3aa554,validateSegmentRule:_0x515f8e}=_0xeea8b3,_0x285612=new Map(),_0x15ebf1=new Map(),_0x1835c7=new Map(),_0x2a6451=new Map(),_0x437424=new Map();let _0x4e2717;const _0x507b84=async()=>{const _0x33232a=a117_0x19e4;if(_0x4e2717)return;_0x4e2717=new Map();if(!_0x44ef6d[_0x33232a(0x120)])return;const _0x448424=await _0x42aa5e[_0x33232a(0x1e9)]['listActivations'](_0x44ef6d[_0x33232a(0x120)]['id']);for(const _0x23bc2a of _0x448424){const _0x55733e=journeyActivationStepToYaml(_0x23bc2a,_0x19bd1c[_0x33232a(0x190)],_0x19bd1c['connectionIdToNameMap']),_0x501a6e=activationSignature(_0x55733e);!_0x4e2717[_0x33232a(0x1ed)](_0x501a6e)&&_0x4e2717['set'](_0x501a6e,_0x23bc2a['id']),_0x55733e[_0x33232a(0x119)]&&_0x15ebf1['set'](_0x55733e[_0x33232a(0x119)],_0x23bc2a['id']);}};if(_0x44ef6d[_0x109b00(0x120)]&&_0x44ef6d['yamlConfig'][_0x109b00(0x12d)]){const _0x3fd1e6=buildLocalExpandedRuleMappings(_0x44ef6d[_0x109b00(0x1f3)]),_0x5450fa=_0x3fd1e6['localSegmentRules'];if(_0x5450fa[_0x109b00(0x1cf)]>0x0){const _0x99deb9=new Map();for(const [_0x2a14eb,_0x3bcc34]of _0x5450fa){const _0x41c9cf=serializeExpandedRule(_0x3bcc34,_0x5450fa);_0x99deb9[_0x109b00(0x195)](_0x2a14eb,_0x41c9cf);}const _0x53cefa=collectSegmentIdsFromJourneyApi(_0x44ef6d['existingJourney']);if(_0x53cefa[_0x109b00(0x1cf)]>0x0){const _0x571d21=await buildServerSegmentRuleMap(_0x42aa5e,_0x40911e[_0x109b00(0x1c0)],_0x19bd1c[_0x109b00(0x1cb)],_0x53cefa);if(_0x571d21['size']>0x0){const _0x14b21a=new Map();for(const [_0x39d876,_0x4b1e99]of _0x571d21){const _0xa0a899=serializeExpandedRule(_0x4b1e99,_0x571d21);!_0x14b21a[_0x109b00(0x1ed)](_0xa0a899)&&_0x14b21a[_0x109b00(0x195)](_0xa0a899,_0x39d876);}for(const [_0xb1186c,_0x870594]of _0x99deb9){const _0x504d18=_0x14b21a[_0x109b00(0x1f2)](_0x870594);_0x504d18&&(_0x437424[_0x109b00(0x195)](_0xb1186c,_0x504d18),_0x19bd1c[_0x109b00(0x160)][_0x109b00(0x195)](_0xb1186c,_0x504d18));}}}}}const _0x5031cc={'resolveSegmentId':async _0x2aefd9=>{const _0x218617=_0x109b00,_0x17cd7f=_0x19bd1c[_0x218617(0x160)][_0x218617(0x1f2)](_0x2aefd9);if(!_0x17cd7f)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x218617(0x196)+_0x2aefd9+_0x218617(0x152)+_0x44ef6d[_0x218617(0x1f3)][_0x218617(0x119)]+')');return _0x17cd7f;},'resolveEmbeddedSegmentId':async(_0x25d22f,_0x41b51a)=>{const _0x5521d2=_0x109b00,_0x4f19ff=_0x19bd1c[_0x5521d2(0x160)][_0x5521d2(0x1f2)](_0x25d22f);if(_0x4f19ff)return _0x4f19ff;const _0x502e4a=_0x437424[_0x5521d2(0x1f2)](_0x25d22f);if(_0x502e4a)return _0x19bd1c['segmentNameToId']['set'](_0x25d22f,_0x502e4a),_0x502e4a;const _0x214d80=_0x19bd1c[_0x5521d2(0x1cb)][_0x5521d2(0x176)](_0x4c5cc1=>_0x4c5cc1[_0x5521d2(0x119)]===_0x25d22f);if(_0x214d80)return _0x19bd1c[_0x5521d2(0x160)][_0x5521d2(0x195)](_0x25d22f,_0x214d80['id']),_0x214d80['id'];if(_0x44ef6d[_0x5521d2(0x11c)]){const {stageName:_0x1a57ae,criteriaName:_0x432a28}=findSegmentCriteriaLocation(_0x44ef6d['yamlConfig'],_0x25d22f);return _0x515f8e(_0x25d22f,_0x41b51a[_0x5521d2(0x1ef)]),_0x1835c7[_0x5521d2(0x195)](_0x25d22f,{'definition':_0x41b51a,'stageName':_0x1a57ae,'criteriaName':_0x432a28}),createPendingSegmentId(_0x25d22f);}const _0x13780e=_0x44ef6d[_0x5521d2(0x120)]?.['id'];if(!_0x13780e)throw new SDKError(ErrorCode[_0x5521d2(0x1f1)],_0x5521d2(0x1a0));_0x515f8e(_0x25d22f,_0x41b51a['rule']);const _0x1fb3d1=generateDeterministicJourneySegmentName(_0x44ef6d[_0x5521d2(0x1f3)][_0x5521d2(0x119)],_0x25d22f),_0x261956=_0x19bd1c[_0x5521d2(0x1cb)][_0x5521d2(0x176)](_0xe3ff83=>_0xe3ff83['name']===_0x1fb3d1),_0x10a4b9=createSegmentIdResolver(_0x19bd1c['segmentNameToId'],_0x25d22f),_0x5d3469=await resolveRuleSegmentIds(_0x41b51a[_0x5521d2(0x1ef)],_0x10a4b9);let _0x51c39b;if(_0x261956)await _0x42aa5e[_0x5521d2(0x147)][_0x5521d2(0x17c)](_0x40911e['parentId'],_0x261956['id'],{'description':_0x41b51a[_0x5521d2(0x15d)]||_0x5521d2(0x1c4)+_0x25d22f,'rule':_0x3aa554(_0x5d3469,!![]),'countPopulation':!![]}),_0x51c39b=_0x261956['id'];else try{_0x51c39b=await _0x42aa5e[_0x5521d2(0x147)][_0x5521d2(0x194)]({'name':_0x1fb3d1,'description':_0x41b51a[_0x5521d2(0x15d)]||_0x5521d2(0x1c4)+_0x25d22f,'journeyId':_0x13780e,'rule':_0x3aa554(_0x5d3469,!![]),'countPopulation':!![],'parentFolderId':_0x40911e['rootFolderId']||'','audienceId':_0x40911e[_0x5521d2(0x1c0)]});}catch(_0x4204e9){const _0x5eab69=_0x4204e9 instanceof Error&&_0x4204e9[_0x5521d2(0x15c)][_0x5521d2(0x19f)](_0x5521d2(0x183));if(_0x5eab69){const _0x2c4fa9=await _0x42aa5e[_0x5521d2(0x147)][_0x5521d2(0x1a6)](_0x40911e[_0x5521d2(0x1c0)]),_0x1d3289=_0x2c4fa9[_0x5521d2(0x176)](_0x10aba6=>_0x10aba6[_0x5521d2(0x119)]===_0x1fb3d1);if(_0x1d3289)await _0x42aa5e['segment'][_0x5521d2(0x17c)](_0x40911e['parentId'],_0x1d3289['id'],{'description':_0x41b51a['description']||_0x5521d2(0x1c4)+_0x25d22f,'rule':_0x3aa554(_0x5d3469,!![]),'countPopulation':!![]}),_0x51c39b=_0x1d3289['id'];else throw _0x4204e9;}else throw _0x4204e9;}return _0x19bd1c[_0x5521d2(0x160)][_0x5521d2(0x195)](_0x25d22f,_0x51c39b),_0x285612['set'](_0x25d22f,_0x51c39b),_0x51c39b;},'resolveActivationId':async _0x2e2cdc=>{const _0x41164a=_0x109b00,_0x275fa9=_0x15ebf1[_0x41164a(0x1f2)](_0x2e2cdc);if(_0x275fa9)return _0x275fa9;if(_0x44ef6d['existingJourney']){await _0x507b84();const _0xd3509f=_0x15ebf1['get'](_0x2e2cdc);if(_0xd3509f)return _0xd3509f;}throw new SDKError(ErrorCode[_0x41164a(0x137)],_0x41164a(0x1dc)+_0x2e2cdc+_0x41164a(0x152)+_0x44ef6d[_0x41164a(0x1f3)]['name']+_0x41164a(0x192)+_0x41164a(0x125));},'resolveEmbeddedActivationId':async(_0x290df1,_0x738715)=>{const _0x3a0ed3=_0x109b00,_0x9c2102=_0x15ebf1[_0x3a0ed3(0x1f2)](_0x290df1);if(_0x9c2102)return _0x9c2102;if(_0x44ef6d[_0x3a0ed3(0x11c)])return _0x2a6451[_0x3a0ed3(0x195)](_0x290df1,_0x738715),createPendingActivationId(_0x290df1);if(_0x44ef6d[_0x3a0ed3(0x120)]){await _0x507b84();const _0x7875d3=_0x15ebf1[_0x3a0ed3(0x1f2)](_0x738715['name']);if(_0x7875d3)return _0x15ebf1[_0x3a0ed3(0x195)](_0x290df1,_0x7875d3),_0x7875d3;const _0x4bfa49=activationSignature(_0x738715),_0x5e4dd5=_0x4e2717?.[_0x3a0ed3(0x1f2)](_0x4bfa49);if(_0x5e4dd5)return _0x15ebf1[_0x3a0ed3(0x195)](_0x290df1,_0x5e4dd5),_0x5e4dd5;const _0x2ded03=await _0x4c89ae(_0x738715,_0x19bd1c[_0x3a0ed3(0x1b8)]),_0x254624=await _0x42aa5e['journey'][_0x3a0ed3(0x121)](_0x44ef6d['existingJourney']['id'],_0x2ded03);return _0x15ebf1[_0x3a0ed3(0x195)](_0x290df1,_0x254624['id']),_0x254624['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x3a0ed3(0x138));},'resolveJourneyId':async _0x55efa5=>{const _0x5db42e=_0x109b00;try{return await _0x42aa5e[_0x5db42e(0x1e9)][_0x5db42e(0x1ac)](_0x40911e[_0x5db42e(0x1c0)],_0x55efa5);}catch(_0x5b48be){throw new SDKError(ErrorCode[_0x5db42e(0x137)],_0x5db42e(0x13a)+_0x55efa5+_0x5db42e(0x15f)+_0x44ef6d['yamlConfig'][_0x5db42e(0x119)]+'\x27)',_0x5b48be);}},'resolveStageId':async(_0xe3635d,_0x4dbc1a)=>{const _0x2d9c74=_0x109b00,_0x4f624e=await _0x42aa5e['journey'][_0x2d9c74(0x130)](_0xe3635d),_0x5928db=_0x4f624e['attributes']['journeyStages'][_0x2d9c74(0x176)](_0x157895=>_0x157895['name'][_0x2d9c74(0x191)]()===_0x4dbc1a[_0x2d9c74(0x191)]());if(!_0x5928db?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x4dbc1a+_0x2d9c74(0x134)+(_0x4f624e['attributes'][_0x2d9c74(0x166)]||_0x4f624e['attributes'][_0x2d9c74(0x119)])+'\x27');return _0x5928db['id'];}},_0x1638ae=await _0x20fbfa(_0x44ef6d[_0x109b00(0x1f3)],_0x40911e[_0x109b00(0x1c0)],_0x5031cc),_0x1217e2=_0x40911e[_0x109b00(0x14d)]||_0x40911e[_0x109b00(0x1ca)];_0x1217e2&&(_0x1638ae['relationships']={'parentFolder':{'data':{'id':_0x1217e2,'type':'folder'}}});if(_0x44ef6d[_0x109b00(0x11c)]){if(_0x1835c7[_0x109b00(0x1cf)]>0x0||_0x2a6451[_0x109b00(0x1cf)]>0x0)return await executeThreeStepJourneyCreate(_0x42aa5e,_0x44ef6d,_0x1638ae,{'pendingEmbeddedSegments':_0x1835c7,'pendingEmbeddedActivations':_0x2a6451,'embeddedSegmentNameToId':_0x285612,'journeyActivationNameToId':_0x15ebf1},{..._0x40911e,'effectiveFolderId':_0x1217e2},_0x19bd1c,_0x3b0063,_0xeea8b3);else{ensureJourneyDefaults(_0x1638ae[_0x109b00(0x18a)]);const _0x5dd0f5=await _0x42aa5e[_0x109b00(0x1e9)][_0x109b00(0x118)](_0x1638ae);return{'action':_0x109b00(0x188),'journeyId':_0x5dd0f5['id'],'embeddedSegmentNameToId':_0x285612};}}else{if(_0x44ef6d[_0x109b00(0x1cd)]&&_0x44ef6d['existingJourney'])return ensureJourneyDefaults(_0x1638ae[_0x109b00(0x18a)]),await _0x42aa5e[_0x109b00(0x1e9)][_0x109b00(0x161)](_0x44ef6d[_0x109b00(0x120)]['id'],_0x1638ae),{'action':_0x109b00(0x1c7),'journeyId':_0x44ef6d[_0x109b00(0x120)]['id'],'embeddedSegmentNameToId':_0x285612};}return{'action':_0x109b00(0x1d5),'journeyId':_0x44ef6d['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x285612};}function findSegmentCriteriaLocation(_0x4150f5,_0x11bcb0){const _0x28963e=a117_0x12b611,_0x96c5e3=_0x4150f5['stages']||_0x4150f5[_0x28963e(0x13e)]?.[0x0]?.['stages']||[];let _0x17638a=_0x28963e(0x1f0),_0x373e71=_0x11bcb0;const _0x3f28d7=_0x4150f5[_0x28963e(0x175)]||_0x4150f5[_0x28963e(0x13e)]?.[0x0]?.[_0x28963e(0x175)];if(_0x3f28d7?.[_0x28963e(0x147)]===_0x11bcb0)return{'stageName':_0x28963e(0x175),'criteriaName':_0x3f28d7[_0x28963e(0x119)]||_0x11bcb0};_0x3f4171:for(const _0xa2e35d of _0x96c5e3){if(_0xa2e35d[_0x28963e(0x17f)]?.[_0x28963e(0x147)]===_0x11bcb0){_0x17638a=_0xa2e35d['name'],_0x373e71=_0xa2e35d[_0x28963e(0x17f)][_0x28963e(0x119)]||_0x11bcb0;break;}if(_0xa2e35d[_0x28963e(0x1a3)])for(const _0x73c448 of _0xa2e35d[_0x28963e(0x1a3)]){if(_0x73c448['type']==='decision_point'&&_0x73c448[_0x28963e(0x197)]?.[_0x28963e(0x13d)])for(const _0x408c64 of _0x73c448[_0x28963e(0x197)][_0x28963e(0x13d)]){if(_0x408c64[_0x28963e(0x147)]===_0x11bcb0){_0x17638a=_0xa2e35d[_0x28963e(0x119)],_0x373e71=_0x408c64[_0x28963e(0x119)]||_0x11bcb0;break _0x3f4171;}}}}return{'stageName':_0x17638a,'criteriaName':_0x373e71};}async function executeThreeStepJourneyCreate(_0x441097,_0x4159e1,_0x5bd435,_0x20654c,_0x1ce9e4,_0x302c64,_0x73b493,_0x16f079){const _0x22919d=a117_0x12b611,{activationDefToCreateRequest:_0x53f941,yamlRuleToApi:_0x3f976f}=_0x16f079,{pendingEmbeddedSegments:_0x5b94d5,pendingEmbeddedActivations:_0x7966b9,embeddedSegmentNameToId:_0x154756}=_0x20654c,_0x2ed962=JSON[_0x22919d(0x19c)](JSON[_0x22919d(0x1d3)](_0x5bd435));ensureJourneyDefaults(_0x2ed962[_0x22919d(0x18a)]),stripPendingIds(_0x2ed962);const _0x10af27=await _0x441097[_0x22919d(0x1e9)]['create'](_0x2ed962),_0x35563d=_0x10af27['id'],_0x2441c2=new Map();for(const _0x1287b1 of _0x10af27[_0x22919d(0x18a)][_0x22919d(0x1ec)]){_0x2441c2[_0x22919d(0x195)](_0x1287b1['name'][_0x22919d(0x191)](),_0x1287b1['id']);}for(const [_0x10676b,{definition:_0x14f747}]of _0x5b94d5){const _0x2ff1cd=generateDeterministicJourneySegmentName(_0x4159e1['yamlConfig'][_0x22919d(0x119)],_0x10676b);_0x73b493['onProgress']?.({'type':_0x22919d(0x129),'journeyName':_0x4159e1['yamlConfig']['name'],'segmentName':_0x10676b});const _0x4d2f9c=createSegmentIdResolver(_0x302c64['segmentNameToId'],_0x10676b),_0x233725=await resolveRuleSegmentIds(_0x14f747[_0x22919d(0x1ef)],_0x4d2f9c),_0x3944bf=await _0x441097['segment']['createJourneySegment']({'name':_0x2ff1cd,'description':_0x14f747[_0x22919d(0x15d)]||'Entry\x20criteria:\x20'+_0x10676b,'journeyId':_0x35563d,'rule':_0x3f976f(_0x233725,!![]),'countPopulation':!![],'parentFolderId':_0x1ce9e4[_0x22919d(0x1a8)]||'','audienceId':_0x1ce9e4['parentId']});_0x154756[_0x22919d(0x195)](_0x10676b,_0x3944bf),_0x302c64[_0x22919d(0x160)]['set'](_0x10676b,_0x3944bf),_0x73b493[_0x22919d(0x1e7)]?.({'type':_0x22919d(0x1d7),'journeyName':_0x4159e1[_0x22919d(0x1f3)][_0x22919d(0x119)],'segmentName':_0x10676b});}const _0x1f8a99=new Map();for(const [_0x344711,_0xdba695]of _0x7966b9){_0x73b493[_0x22919d(0x1e7)]?.({'type':_0x22919d(0x127),'journeyName':_0x4159e1[_0x22919d(0x1f3)]['name'],'activationName':_0x344711});const _0x4ebfa0=await _0x53f941(_0xdba695,_0x302c64[_0x22919d(0x1b8)]),_0x1c4eda=await _0x441097['journey'][_0x22919d(0x121)](_0x35563d,_0x4ebfa0);_0x1f8a99[_0x22919d(0x195)](_0x344711,_0x1c4eda['id']),_0x20654c[_0x22919d(0x193)][_0x22919d(0x195)](_0x344711,_0x1c4eda['id']),_0x73b493[_0x22919d(0x1e7)]?.({'type':'embedded_activation_created','journeyName':_0x4159e1[_0x22919d(0x1f3)]['name'],'activationName':_0x344711});}const _0x517575=JSON['parse'](JSON[_0x22919d(0x1d3)](_0x5bd435));return _0x517575['id']=_0x35563d,ensureJourneyDefaults(_0x517575[_0x22919d(0x18a)]),resolvePendingIdsInRequest(_0x517575,_0x5bd435,_0x2441c2,_0x154756,_0x1f8a99,_0x73b493),await _0x441097[_0x22919d(0x1e9)]['update'](_0x35563d,_0x517575),{'action':_0x22919d(0x188),'journeyId':_0x35563d,'embeddedSegmentNameToId':_0x154756};}function a117_0x3d85(){const _0x56a83b=['length','kind','utf-8','updateActivation','existingActivation','Deleted\x20segment\x20\x27','journeyId','message','description','segmentByFolderAndName','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','segmentNameToId','update','type','logDeleted','2618PrBLVV','Fetching\x20','journeyBundleName','replace','buildUserMaps','filter','hex','push','2004352CCHQBZ','max','SEGMENT_SYNTAX_ERROR','segment_updating','Updating\x20segment\x20\x27','entryCriteria','behavior','toString','SEGMENT_UPDATE_ERROR','goal','find','\x20segment\x20from\x20file:\x20','journey_created','trim','../../utils/async.js','Updated\x20segment\x20\x27','updateSegmentById','stage\x20\x27','\x27\x20wait\x20condition','entry_criteria','activationsBySegmentId','relationships','folderPath','Name\x20has\x20already\x20been\x20taken','297iNMNJX','\x27\x20for\x20','keys','sha1','created','journey_updating','attributes','WaitStep','logWarning','__pending_','journeyById','11957246eJRWpP','idToEmailMap','toLowerCase',').\x20','journeyActivationNameToId','createJourneySegment','set','Segment\x20not\x20found:\x20','with','milestone','SEGMENT_NOT_FOUND','deleteActivation','createSegment','parse','relative','versionNumber','includes','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','nameToType','state','steps','47898WQjqVe','./child-segment-yaml.js','listSegments','13321XNZvTO','effectiveFolderId','columns','map','segment_updated','resolveJourneyId','split','Activation','Created\x20activation\x20\x27','entries','\x27\x20decision\x20point\x20branch\x20\x27','segment_deleted','\x27\x20from\x20file:\x20','Created\x20journey\x20\x27','Creating\x20activation\x20\x27','createdSegmentIds','all_columns','activationContext','reduce','notification','activation_updating','565VoSfEq','existingSegment','validatedRequest','DecisionPoint','parentId','journeyActivationStepId','parseDocument','join','Entry\x20criteria:\x20','10436260qNItqO','Created\x20segment\x20\x27','updated','connection','startsWith','rootFolderId','existingSegments','nameToId','hasChanges','list','size','exitCriterias','all','deleted','stringify','null','unchanged','905872DnQdti','embedded_segment_created','journey_entry_criteria_','goal\x20criteria','activation_deleted','idToName','Activation\x20not\x20found:\x20','sort','journey_updated','draft','yamlActivation','deleteSegment','./journey-yaml.js','getSegment','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','segmentId','logSuccess','onProgress','object','journey','action','\x27...','journeyStages','has','waitCondition','rule','entry','INTERNAL','get','yamlConfig','\x27\x20entry\x20criteria','ACTIVATION_UPDATE_ERROR','parentSegmentFolder','Deleted\x20activation\x20\x27','add','\x20error(s)','data','journeyBundlesByFolderAndName','segment_creating','\x27\x20milestone','create','name','resolveSegment','__pending_act_','isNew','createdSegmentId','activation_template_id','activationActions','existingJourney','createActivation','Failed\x20to\x20','\x20activation\x20\x27','errors','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','verbose','embedded_activation_creating','folderPathToId','embedded_segment_creating','isArray','activation_','embeddedSegmentNameToId','segments','\x0a\x20\x20','dirname','getJourney','folder_creating','activationParams','getActivation','\x27\x20not\x20found\x20in\x20journey\x20\x27','connector_config','withProgress','NOT_FOUND','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','valid','Journey\x20\x27','index','segmentFolderId','branches','journeys','ACTIVATION_SYNTAX_ERROR','schedule','folder_created','segment_deleting','connectionIdToNameMap','slice','results','Updated\x20journey\x20\x27','segment','117YVuYBR','diff','from','Updating\x20activation\x20\x27','\x27\x20exit\x20criteria','folderId','progress','delete','activations','absolutePath','\x20(referenced\x20in\x20journey\x20','createFolder','values'];a117_0x3d85=function(){return _0x56a83b;};return a117_0x3d85();}function stripPendingIds(_0x463814){const _0x4d2fa2=a117_0x12b611;for(const _0x104e2e of _0x463814[_0x4d2fa2(0x18a)]['journeyStages']||[]){_0x104e2e[_0x4d2fa2(0x171)]?.[_0x4d2fa2(0x1e5)]&&isPendingSegmentId(_0x104e2e['entryCriteria']['segmentId'])&&delete _0x104e2e['entryCriteria'];if(_0x104e2e['steps'])for(const _0x1ac49c of Object['keys'](_0x104e2e[_0x4d2fa2(0x1a3)])){const _0x5e9507=_0x104e2e[_0x4d2fa2(0x1a3)][_0x1ac49c];_0x5e9507[_0x4d2fa2(0x162)]===_0x4d2fa2(0x1ae)&&_0x5e9507[_0x4d2fa2(0x1c1)]&&isPendingActivationId(_0x5e9507['journeyActivationStepId'])&&(_0x5e9507[_0x4d2fa2(0x1c1)]='');if(_0x5e9507[_0x4d2fa2(0x162)]===_0x4d2fa2(0x1bf)&&_0x5e9507[_0x4d2fa2(0x13d)])for(const _0x1b574e of _0x5e9507[_0x4d2fa2(0x13d)]){_0x1b574e[_0x4d2fa2(0x1e5)]&&isPendingSegmentId(_0x1b574e[_0x4d2fa2(0x1e5)])&&(_0x1b574e['segmentId']='');}_0x5e9507[_0x4d2fa2(0x162)]===_0x4d2fa2(0x18b)&&_0x5e9507['waitCondition']?.[_0x4d2fa2(0x1e5)]&&isPendingSegmentId(_0x5e9507[_0x4d2fa2(0x1ee)][_0x4d2fa2(0x1e5)])&&(_0x5e9507[_0x4d2fa2(0x1ee)][_0x4d2fa2(0x1e5)]='');}}}function resolvePendingIdsInRequest(_0x16481f,_0x401976,_0xa4251e,_0x1d8a3b,_0x3f40c4,_0x5cbe74){const _0x5b3052=a117_0x12b611,_0x23dfc4=(_0x5f4edb,_0x14f20e)=>{const _0x5a0b08=a117_0x19e4;if(!isPendingSegmentId(_0x5f4edb))return _0x5f4edb;const _0x5d6098=extractPendingSegmentName(_0x5f4edb),_0x53a182=_0x1d8a3b[_0x5a0b08(0x1f2)](_0x5d6098);return!_0x53a182&&_0x5cbe74[_0x5a0b08(0x18c)]?.(_0x5a0b08(0x1e4)+_0x5d6098+_0x5a0b08(0x185)+_0x14f20e),_0x53a182;};if(_0x16481f[_0x5b3052(0x18a)][_0x5b3052(0x175)]?.[_0x5b3052(0x1e5)]&&isPendingSegmentId(_0x16481f['attributes'][_0x5b3052(0x175)]['segmentId'])){const _0x4aa83d=_0x23dfc4(_0x16481f[_0x5b3052(0x18a)][_0x5b3052(0x175)][_0x5b3052(0x1e5)],_0x5b3052(0x1d9));_0x4aa83d&&(_0x16481f[_0x5b3052(0x18a)][_0x5b3052(0x175)][_0x5b3052(0x1e5)]=_0x4aa83d);}for(const _0x4a6ff4 of _0x16481f['attributes'][_0x5b3052(0x1ec)]||[]){const _0x47b7cb=_0xa4251e[_0x5b3052(0x1f2)](_0x4a6ff4[_0x5b3052(0x119)][_0x5b3052(0x191)]());_0x47b7cb&&(_0x4a6ff4['id']=_0x47b7cb);if(_0x4a6ff4[_0x5b3052(0x171)]?.['segmentId']&&isPendingSegmentId(_0x4a6ff4[_0x5b3052(0x171)][_0x5b3052(0x1e5)])){const _0x53e799=_0x23dfc4(_0x4a6ff4[_0x5b3052(0x171)][_0x5b3052(0x1e5)],_0x5b3052(0x17d)+_0x4a6ff4[_0x5b3052(0x119)]+_0x5b3052(0x1f4));_0x53e799&&(_0x4a6ff4[_0x5b3052(0x171)]['segmentId']=_0x53e799);}if(_0x4a6ff4['exitCriterias'])for(const _0x22821d of _0x4a6ff4[_0x5b3052(0x1d0)]){if(_0x22821d[_0x5b3052(0x1e5)]&&isPendingSegmentId(_0x22821d['segmentId'])){const _0xf340ad=_0x23dfc4(_0x22821d[_0x5b3052(0x1e5)],_0x5b3052(0x17d)+_0x4a6ff4[_0x5b3052(0x119)]+_0x5b3052(0x14c));_0xf340ad&&(_0x22821d['segmentId']=_0xf340ad);}}if(_0x4a6ff4['milestone']?.['segmentId']&&isPendingSegmentId(_0x4a6ff4[_0x5b3052(0x198)][_0x5b3052(0x1e5)])){const _0xdc945e=_0x23dfc4(_0x4a6ff4[_0x5b3052(0x198)]['segmentId'],_0x5b3052(0x17d)+_0x4a6ff4['name']+_0x5b3052(0x1fd));_0xdc945e&&(_0x4a6ff4[_0x5b3052(0x198)][_0x5b3052(0x1e5)]=_0xdc945e);}if(_0x4a6ff4[_0x5b3052(0x1a3)]){const _0x3b8ccb=_0x2c70d1=>_0x401976['attributes'][_0x5b3052(0x1ec)]['find'](_0x16a7c4=>_0x16a7c4[_0x5b3052(0x119)][_0x5b3052(0x191)]()===_0x4a6ff4[_0x5b3052(0x119)]['toLowerCase']())?.[_0x5b3052(0x1a3)]?.[_0x2c70d1];for(const _0x48528a of Object['keys'](_0x4a6ff4['steps'])){const _0x202230=_0x4a6ff4[_0x5b3052(0x1a3)][_0x48528a],_0x285b3f=_0x3b8ccb(_0x48528a);if(_0x202230['type']==='Activation'&&_0x202230['journeyActivationStepId']&&(isPendingActivationId(_0x202230[_0x5b3052(0x1c1)])||_0x202230[_0x5b3052(0x1c1)]==='')){if(_0x285b3f?.[_0x5b3052(0x1c1)]&&isPendingActivationId(_0x285b3f[_0x5b3052(0x1c1)])){const _0x1cec38=extractPendingActivationName(_0x285b3f['journeyActivationStepId']),_0x5ecac5=_0x3f40c4[_0x5b3052(0x1f2)](_0x1cec38);_0x5ecac5&&(_0x202230[_0x5b3052(0x1c1)]=_0x5ecac5);}}if(_0x202230[_0x5b3052(0x162)]==='DecisionPoint'&&_0x202230['branches']&&_0x285b3f?.['branches'])for(let _0xce4693=0x0;_0xce4693<_0x202230['branches'][_0x5b3052(0x155)];_0xce4693++){const _0x48d291=_0x202230[_0x5b3052(0x13d)][_0xce4693],_0x4f80ec=_0x285b3f['branches'][_0xce4693];if(_0x4f80ec?.[_0x5b3052(0x1e5)]&&isPendingSegmentId(_0x4f80ec['segmentId'])){const _0x39d785=_0x23dfc4(_0x4f80ec['segmentId'],_0x5b3052(0x17d)+_0x4a6ff4[_0x5b3052(0x119)]+_0x5b3052(0x1b1)+(_0x48d291[_0x5b3052(0x119)]||_0xce4693)+'\x27');_0x39d785&&(_0x48d291[_0x5b3052(0x1e5)]=_0x39d785);}}if(_0x202230[_0x5b3052(0x162)]==='WaitStep'&&_0x202230[_0x5b3052(0x1ee)]?.[_0x5b3052(0x1e5)]&&_0x285b3f?.['waitCondition']?.[_0x5b3052(0x1e5)]&&isPendingSegmentId(_0x285b3f['waitCondition']['segmentId'])){const _0x2b2b26=_0x23dfc4(_0x285b3f[_0x5b3052(0x1ee)]['segmentId'],'stage\x20\x27'+_0x4a6ff4[_0x5b3052(0x119)]+_0x5b3052(0x17e));_0x2b2b26&&(_0x202230[_0x5b3052(0x1ee)]['segmentId']=_0x2b2b26);}}}}}
1
+ const a117_0x110a5=a117_0x5c13;(function(_0x43a774,_0x471391){const _0xf784e0=a117_0x5c13,_0x1ecb0d=_0x43a774();while(!![]){try{const _0x4c6f99=parseInt(_0xf784e0(0x1ad))/0x1+-parseInt(_0xf784e0(0x1a2))/0x2+-parseInt(_0xf784e0(0x21b))/0x3*(-parseInt(_0xf784e0(0x145))/0x4)+-parseInt(_0xf784e0(0x14b))/0x5*(-parseInt(_0xf784e0(0x1c4))/0x6)+-parseInt(_0xf784e0(0x1aa))/0x7*(-parseInt(_0xf784e0(0x13f))/0x8)+parseInt(_0xf784e0(0x1fa))/0x9*(-parseInt(_0xf784e0(0x14d))/0xa)+-parseInt(_0xf784e0(0x1f3))/0xb*(-parseInt(_0xf784e0(0x1bf))/0xc);if(_0x4c6f99===_0x471391)break;else _0x1ecb0d['push'](_0x1ecb0d['shift']());}catch(_0x83751c){_0x1ecb0d['push'](_0x1ecb0d['shift']());}}}(a117_0x3b8c,0x76bd3));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a117_0x110a5(0x1d0);export function createPendingSegmentId(_0x5cdda6){return''+PENDING_SEGMENT_PREFIX+_0x5cdda6+'__';}export function isPendingSegmentId(_0x303d04){return _0x303d04['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x597290){const _0x51610d=a117_0x110a5;return _0x597290[_0x51610d(0x1a3)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4536fe){return''+PENDING_ACTIVATION_PREFIX+_0x4536fe+'__';}export function isPendingActivationId(_0x34994d){const _0x239742=a117_0x110a5;return _0x34994d[_0x239742(0x1ce)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1d534a){const _0x2dbb15=a117_0x110a5;return _0x1d534a[_0x2dbb15(0x1a3)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x250787,_0x4df4d1){const _0x3a3b00=a117_0x110a5,_0x25d3c0=_0x250787+'::'+(_0x4df4d1[_0x3a3b00(0x1c0)]()||'segment'),_0x12454e=createHash('sha1')[_0x3a3b00(0x16f)](_0x25d3c0)[_0x3a3b00(0x16b)](_0x3a3b00(0x187))[_0x3a3b00(0x1de)](0x0,0xc);return'journey_entry_criteria_'+_0x12454e;}export function ensureJourneyDefaults(_0x1c93c0){const _0x30de3d=a117_0x110a5;!_0x1c93c0[_0x30de3d(0x149)]&&(_0x1c93c0['description']=''),!_0x1c93c0[_0x30de3d(0x156)]&&(_0x1c93c0[_0x30de3d(0x156)]='draft');}export function resolveTDFolderPath(_0x49008c,_0x2ac7d3,_0xfebf15){const _0x3cf721=a117_0x110a5;if(!_0x2ac7d3)return _0x49008c;if(_0x49008c===_0xfebf15||_0x49008c[_0x3cf721(0x1ce)](_0xfebf15+'/'))return _0x49008c;return _0x49008c?_0xfebf15+'/'+_0x49008c:_0xfebf15;}export function addFoldersToCreate(_0x222af2,_0x2a247b,_0x1c9d91){const _0x34f23e=a117_0x110a5;if(!_0x222af2)return;if(_0x2a247b[_0x34f23e(0x1b5)](_0x222af2))return;const _0x36e50e=_0x222af2[_0x34f23e(0x1e0)]('/');let _0x36ff26='';for(const _0x1eba7d of _0x36e50e){_0x36ff26=_0x36ff26?_0x36ff26+'/'+_0x1eba7d:_0x1eba7d,!_0x2a247b[_0x34f23e(0x1b5)](_0x36ff26)&&_0x1c9d91[_0x34f23e(0x198)](_0x36ff26);}}import*as a117_0x1ce7c7 from'yaml';import{readFileSync}from'fs';import a117_0x227d93 from'path';import{isJourneyDef,parseYamlString as a117_0x16f0f7,toYamlString as a117_0x528669,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(_0x28baec){const _0x3a06d7=a117_0x110a5;if(Array['isArray'](_0x28baec))return'['+_0x28baec[_0x3a06d7(0x1af)](_0x77e91a=>stableStringify(_0x77e91a))['join'](',')+']';if(_0x28baec&&typeof _0x28baec==='object'){const _0x26fa49=_0x28baec,_0x3b7b40=Object[_0x3a06d7(0x178)](_0x26fa49)[_0x3a06d7(0x1f8)](),_0x2674b0=_0x3b7b40[_0x3a06d7(0x1af)](_0x525af6=>'\x22'+_0x525af6+'\x22:'+stableStringify(_0x26fa49[_0x525af6]));return'{'+_0x2674b0[_0x3a06d7(0x137)](',')+'}';}const _0x1fc2cc=JSON[_0x3a06d7(0x136)](_0x28baec);return _0x1fc2cc===undefined?_0x3a06d7(0x1b0):_0x1fc2cc;}function activationSignature(_0x204b4e){const _0x30702a=a117_0x110a5,_0x3e84c9={'connection':_0x204b4e['connection'],..._0x204b4e[_0x30702a(0x212)]!==undefined&&{'all_columns':_0x204b4e[_0x30702a(0x212)]},..._0x204b4e[_0x30702a(0x194)]!==undefined&&{'columns':_0x204b4e[_0x30702a(0x194)]},..._0x204b4e[_0x30702a(0x201)]!==undefined&&{'behavior':_0x204b4e['behavior']},..._0x204b4e[_0x30702a(0x205)]!==undefined&&{'schedule':_0x204b4e['schedule']},..._0x204b4e[_0x30702a(0x1da)]!==undefined&&{'notification':_0x204b4e[_0x30702a(0x1da)]},..._0x204b4e[_0x30702a(0x173)]!==undefined&&{'connector_config':_0x204b4e[_0x30702a(0x173)]},..._0x204b4e['activation_template_id']!==undefined&&{'activation_template_id':_0x204b4e[_0x30702a(0x1c8)]}};return stableStringify(_0x3e84c9);}export async function prepareSegmentFiles(_0x4ba1ca,_0x4ee1f2,_0x2a3ac5,_0x2c0ce3,_0x4354e7){const _0x8284f0=a117_0x110a5,{activationDefToCreateRequest:_0xa1017d}=await import('./child-segment-yaml.js'),_0x27ddf4=[],_0x2105a2=new Set();for(const {yamlConfig:_0x3c339d,folderPath:_0x35e02a,sourcePath:_0x5be457}of _0x4ba1ca){const _0x38a1ee=resolveTDFolderPath(_0x35e02a,_0x2c0ce3,_0x4354e7),_0x43eeeb=_0x38a1ee+':'+_0x3c339d[_0x8284f0(0x20d)],_0x146a27=_0x4ee1f2[_0x8284f0(0x138)][_0x8284f0(0x1ea)](_0x43eeeb),_0x1da409=_0x146a27?_0x4ee1f2[_0x8284f0(0x18d)][_0x8284f0(0x1ea)](_0x146a27['id'])||[]:[];addFoldersToCreate(_0x38a1ee,_0x4ee1f2[_0x8284f0(0x1f0)],_0x2105a2);const _0x27866d=calculateActivationActions(_0x3c339d[_0x8284f0(0x16e)]||[],_0x1da409,_0x4ee1f2[_0x8284f0(0x150)],_0x4ee1f2[_0x8284f0(0x191)]);for(const _0xfa2ed5 of _0x27866d){(_0xfa2ed5[_0x8284f0(0x18b)]===_0x8284f0(0x217)||_0xfa2ed5[_0x8284f0(0x18b)]===_0x8284f0(0x16f))&&_0xfa2ed5['yamlActivation']&&(_0xfa2ed5[_0x8284f0(0x1b3)]=await _0xa1017d(_0xfa2ed5['yamlActivation'],_0x2a3ac5));}const _0x2d2305=calculateSegmentDiff(_0x3c339d,_0x146a27,_0x1da409,_0x4ee1f2['idToEmailMap'],_0x4ee1f2[_0x8284f0(0x191)]);_0x27ddf4[_0x8284f0(0x184)]({'relativePath':_0x3c339d['name'],'absolutePath':_0x5be457,'yamlConfig':_0x3c339d,'folderPath':_0x38a1ee,'existingSegment':_0x146a27,'existingActivations':_0x1da409,'isNew':_0x2d2305['isNew'],'hasChanges':_0x2d2305[_0x8284f0(0x210)],'diff':_0x2d2305[_0x8284f0(0x1c2)],'activationActions':_0x27866d});}return{'segmentFiles':_0x27ddf4,'foldersToCreate':_0x2105a2};}export async function prepareJourneyFiles(_0x4980eb,_0x2165ef,_0x2ea674,_0x27dc18){const _0x1bcf9f=a117_0x110a5,_0x3f0912=[],_0x2aac23=new Set();for(const {yamlConfig:_0x5f2cf4,folderPath:_0x2293a0,sourcePath:_0x336173}of _0x4980eb){const _0x34fb54=resolveTDFolderPath(_0x2293a0,_0x2ea674,_0x27dc18),_0x5678a6=_0x34fb54+':'+_0x5f2cf4[_0x1bcf9f(0x20d)],_0x3c57e0=_0x2165ef[_0x1bcf9f(0x174)][_0x1bcf9f(0x1ea)](_0x5678a6);let _0x26d67f,_0x1d31df;if(_0x3c57e0&&_0x3c57e0[_0x1bcf9f(0x1d2)]>0x0){const _0x4b0c3e=buildLocalExpandedRuleMappings(_0x5f2cf4),{createYamlContext:_0x5babbf,prefetchJourneySegments:_0x294925}=createPushYamlContextForBundle(_0x2165ef[_0x1bcf9f(0x1ff)],_0x2165ef[_0x1bcf9f(0x20e)],_0x2165ef[_0x1bcf9f(0x1c3)],_0x4b0c3e,_0x2165ef[_0x1bcf9f(0x150)],_0x2165ef['connectionIdToNameMap'],_0x2165ef[_0x1bcf9f(0x1e4)],_0x2165ef[_0x1bcf9f(0x1c7)]);await _0x294925(_0x3c57e0[_0x1bcf9f(0x1af)](_0x2d40f4=>_0x2d40f4['id']));const _0x1dae16=hasMultipleVersions(_0x5f2cf4),_0x3d3d6b=async _0x48f012=>{const _0x376141=_0x1bcf9f,_0x5149f3=_0x2165ef[_0x376141(0x1c7)]?.['get'](_0x48f012);if(_0x5149f3)return _0x5149f3;return _0x2165ef[_0x376141(0x164)]({'journeyId':_0x48f012,'journeyName':_0x5f2cf4['name'],'isMultiVersion':_0x3c57e0[_0x376141(0x1d2)]>0x1});};if(_0x1dae16&&_0x3c57e0[_0x1bcf9f(0x1d2)]>0x1){const _0x48fadd=[];for(const _0x1b6bbc of _0x3c57e0){const _0x33be56=_0x1b6bbc[_0x1bcf9f(0x211)]||0x1;_0x2165ef[_0x1bcf9f(0x209)]?.[_0x1bcf9f(0x16f)](_0x1bcf9f(0x179)+_0x5f2cf4['name']+'\x20v'+_0x33be56);const _0x1773db=await _0x3d3d6b(_0x1b6bbc['id']),_0x34ee7d=_0x5babbf(_0x1b6bbc['id']),_0x3bfd38=await journeyResponseToDef(_0x1773db,_0x34ee7d);_0x48fadd[_0x1bcf9f(0x184)]({'item':_0x1b6bbc,'yaml':_0x3bfd38});}const _0x397b11=buildLocalRuleToNameMappingFromJourney(_0x5f2cf4);_0x1d31df=buildMergedJourneyDef(_0x48fadd,_0x397b11);const _0x4e6093=Math['max'](..._0x48fadd[_0x1bcf9f(0x1af)](_0x362e8c=>_0x362e8c[_0x1bcf9f(0x14a)][_0x1bcf9f(0x211)]||0x0)),_0x1dfbab=_0x3c57e0[_0x1bcf9f(0x21a)](_0x1b4c24=>(_0x1b4c24[_0x1bcf9f(0x211)]||0x0)===_0x4e6093);_0x1dfbab&&(_0x2165ef[_0x1bcf9f(0x209)]?.['update']('Fetching\x20'+_0x5f2cf4['name']+'\x20v'+_0x4e6093),_0x26d67f=await _0x3d3d6b(_0x1dfbab['id']));}else{const _0x260069=_0x3c57e0[_0x3c57e0[_0x1bcf9f(0x1d2)]-0x1];_0x2165ef[_0x1bcf9f(0x209)]?.[_0x1bcf9f(0x16f)](_0x1bcf9f(0x179)+_0x5f2cf4[_0x1bcf9f(0x20d)]),_0x26d67f=await _0x3d3d6b(_0x260069['id']);const _0x2939be=_0x5babbf(_0x260069['id']),_0x5efa82=await journeyResponseToDef(_0x26d67f,_0x2939be),_0x3944c4=buildLocalRuleToNameMappingFromJourney(_0x5f2cf4);_0x1d31df=buildMergedJourneyDef([{'item':_0x260069,'yaml':_0x5efa82}],_0x3944c4);}}addFoldersToCreate(_0x34fb54,_0x2165ef[_0x1bcf9f(0x1f0)],_0x2aac23);const _0x81bb31=calculateJourneyDiff(_0x5f2cf4,_0x1d31df);_0x3f0912[_0x1bcf9f(0x184)]({'relativePath':_0x5f2cf4[_0x1bcf9f(0x20d)],'absolutePath':_0x336173,'yamlConfig':_0x5f2cf4,'folderPath':_0x34fb54,'existingJourney':_0x26d67f,'isNew':_0x81bb31[_0x1bcf9f(0x1cf)],'hasChanges':_0x81bb31[_0x1bcf9f(0x210)],'diff':_0x81bb31['diff']});}return{'journeyFiles':_0x3f0912,'foldersToCreate':_0x2aac23};}export function calculateActivationActions(_0x4663c2,_0x1ffb2d,_0x83dfa,_0x4cc22f){const _0x88b906=a117_0x110a5,_0x25f5bd=[],_0x44c079=new Map();for(const _0x33be09 of _0x1ffb2d){_0x44c079[_0x88b906(0x172)](_0x33be09[_0x88b906(0x20d)],_0x33be09);}const _0x31d75c=new Map();for(const _0x3ad330 of _0x4663c2){_0x31d75c[_0x88b906(0x172)](_0x3ad330[_0x88b906(0x20d)],_0x3ad330);}for(const _0x2adb5a of _0x4663c2){const _0x5dfbaf=_0x44c079[_0x88b906(0x1ea)](_0x2adb5a[_0x88b906(0x20d)]);if(!_0x5dfbaf)_0x25f5bd['push']({'type':'create','name':_0x2adb5a['name'],'yamlActivation':_0x2adb5a});else{const _0x3d6e44=activationResponseToDef(_0x5dfbaf,_0x83dfa,_0x4cc22f),_0x2db5c8=a117_0x1ce7c7[_0x88b906(0x136)](_0x3d6e44),_0x46117e=a117_0x1ce7c7['stringify'](_0x2adb5a);_0x2db5c8!==_0x46117e&&_0x25f5bd[_0x88b906(0x184)]({'type':_0x88b906(0x16f),'name':_0x2adb5a[_0x88b906(0x20d)],'yamlActivation':_0x2adb5a,'existingActivation':_0x5dfbaf});}}for(const _0x405dff of _0x1ffb2d){!_0x31d75c[_0x88b906(0x1b5)](_0x405dff['name'])&&_0x25f5bd[_0x88b906(0x184)]({'type':_0x88b906(0x177),'name':_0x405dff['name'],'existingActivation':_0x405dff});}return _0x25f5bd;}export function calculateSegmentDiff(_0x35ef26,_0x3cbc05,_0x123b42,_0x232f29,_0x457515){const _0x41c145=segmentToYamlString(_0x35ef26);if(_0x3cbc05){const _0x1b5caf=segmentWithActivationsToYaml(_0x3cbc05,_0x123b42,undefined,_0x232f29,_0x457515),_0x5c7e8a=segmentToYamlString(_0x1b5caf),_0x24521b=generateDiff(_0x5c7e8a,_0x41c145),_0x546f49=hasChanges(_0x24521b);return{'isNew':![],'hasChanges':_0x546f49,'diff':_0x546f49?formatDiffWithColors(_0x24521b):undefined};}const _0x4d8541=generateDiff('',_0x41c145);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4d8541)};}export function calculateJourneyDiff(_0x62a204,_0x31b0f3){const _0x3872cf=normalizeJourneyDef(_0x62a204,_0x62a204),_0x156c44=a117_0x528669(_0x3872cf);if(_0x31b0f3){const _0x1202b6=normalizeJourneyDef(_0x31b0f3,_0x62a204),_0x646c91=a117_0x528669(_0x1202b6),_0x2e4624=generateDiff(_0x646c91,_0x156c44),_0x42496b=hasChanges(_0x2e4624);return{'isNew':![],'hasChanges':_0x42496b,'diff':_0x42496b?formatDiffWithColors(_0x2e4624):undefined};}const _0x277330=generateDiff('',_0x156c44);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x277330)};}export function findSegmentsToDelete(_0x26ce41,_0x9cf0cb,_0x3fb1b2,_0xa0b360,_0x403853){const _0x24b58b=a117_0x110a5,_0x3790f6=new Set();for(const {yamlConfig:_0x42de32,folderPath:_0x43eb07}of _0x9cf0cb){_0x3790f6[_0x24b58b(0x198)](_0x43eb07+':'+_0x42de32[_0x24b58b(0x20d)]);}return _0x26ce41[_0x24b58b(0x1ca)](_0x2e5a83=>{const _0xb66886=_0x24b58b,_0x337a3d=_0x2e5a83[_0xb66886(0x1ac)]?_0x3fb1b2[_0xb66886(0x1ea)](_0x2e5a83['segmentFolderId'][_0xb66886(0x18e)]())||'':'',_0x2d397c=_0x337a3d+':'+_0x2e5a83[_0xb66886(0x20d)];if(_0x3790f6[_0xb66886(0x1b5)](_0x2d397c))return![];if(_0x403853)return _0x337a3d===_0xa0b360||_0x337a3d[_0xb66886(0x1ce)](_0xa0b360+'/');return!![];});}export function findJourneysToDelete(_0x457972,_0x59ee31,_0x488ed4,_0x5456d9,_0x5ac81b){const _0x34a35d=a117_0x110a5,_0x3241b2=new Set();for(const {yamlConfig:_0x5a650a,folderPath:_0xdf81f1}of _0x59ee31){_0x3241b2[_0x34a35d(0x198)](_0xdf81f1+':'+_0x5a650a[_0x34a35d(0x20d)]);}return _0x457972[_0x34a35d(0x1ca)](_0x55cf77=>{const _0x23ac52=_0x34a35d,_0x2670a7=_0x55cf77[_0x23ac52(0x19e)]?_0x488ed4['get'](_0x55cf77[_0x23ac52(0x19e)])||'':'',_0x8617c8=_0x2670a7+':'+_0x55cf77[_0x23ac52(0x17e)];if(_0x3241b2[_0x23ac52(0x1b5)](_0x8617c8))return![];if(_0x5ac81b)return _0x2670a7===_0x5456d9||_0x2670a7[_0x23ac52(0x1ce)](_0x5456d9+'/');return!![];});}export function buildSegmentLookupMap(_0x1c37e1,_0x4af630){const _0xac4109=a117_0x110a5,_0xedc533=new Map();for(const _0x5e3023 of _0x1c37e1){const _0x34cd7c=_0x5e3023[_0xac4109(0x1ac)]?_0x4af630['get'](_0x5e3023[_0xac4109(0x1ac)]['toString']())||'':'',_0x2bd195=_0x34cd7c+':'+_0x5e3023[_0xac4109(0x20d)];_0xedc533[_0xac4109(0x172)](_0x2bd195,_0x5e3023);}return _0xedc533;}export function buildSegmentNameToIdMap(_0x522500){const _0x89d278=a117_0x110a5,_0x3f3cfb=new Map();for(const _0x166e71 of _0x522500){_0x3f3cfb['set'](_0x166e71[_0x89d278(0x20d)],_0x166e71['id']);}return _0x3f3cfb;}export function buildJourneyBundleLookupMap(_0x2774d3,_0x4f4ef7){const _0x49989c=a117_0x110a5,_0x11c4e5=new Map();for(const _0x4d6714 of _0x2774d3){const _0x3666df=_0x4d6714['folderId']?_0x4f4ef7[_0x49989c(0x1ea)](_0x4d6714[_0x49989c(0x19e)])||'':'',_0x544aea=_0x3666df+':'+_0x4d6714[_0x49989c(0x17e)];!_0x11c4e5[_0x49989c(0x1b5)](_0x544aea)&&_0x11c4e5[_0x49989c(0x172)](_0x544aea,[]),_0x11c4e5[_0x49989c(0x1ea)](_0x544aea)[_0x49989c(0x184)](_0x4d6714);}for(const _0x1eee8d of _0x11c4e5['values']()){_0x1eee8d['sort']((_0x342782,_0x5c7f73)=>(_0x342782[_0x49989c(0x211)]||0x0)-(_0x5c7f73[_0x49989c(0x211)]||0x0));}return _0x11c4e5;}export function collectFoldersToCreate(_0x23cf53,_0x2c729d){const _0x2303a5=a117_0x110a5,_0x240a39=new Set();for(const _0x3f7c3c of _0x23cf53){if(!_0x3f7c3c)continue;if(_0x2c729d[_0x2303a5(0x1b5)](_0x3f7c3c))continue;const _0x3ca981=_0x3f7c3c[_0x2303a5(0x1e0)]('/');let _0x17c2df='';for(const _0xb24d35 of _0x3ca981){_0x17c2df=_0x17c2df?_0x17c2df+'/'+_0xb24d35:_0xb24d35,!_0x2c729d[_0x2303a5(0x1b5)](_0x17c2df)&&_0x240a39[_0x2303a5(0x198)](_0x17c2df);}}return _0x240a39;}function a117_0x5c13(_0x54e48a,_0xb55ad){_0x54e48a=_0x54e48a-0x135;const _0x3b8c29=a117_0x3b8c();let _0x5c138e=_0x3b8c29[_0x54e48a];return _0x5c138e;}export function parseAndClassifyYamlFiles(_0xbc06cf,_0x3ccd1b,_0x6dfd0c){const _0x4cb755=a117_0x110a5,_0x1fa147=[],_0x4a5d0a=[];for(const _0x32cb70 of _0xbc06cf){const _0x2dc625=a117_0x227d93[_0x4cb755(0x202)](_0x3ccd1b,a117_0x227d93[_0x4cb755(0x185)](_0x32cb70)),_0x32a5ab=_0x2dc625==='.'?'':_0x2dc625,_0x369a5f=readFileSync(_0x32cb70,_0x4cb755(0x20a)),_0x46b20a=a117_0x1ce7c7[_0x4cb755(0x20c)](_0x369a5f);if(isJourneyDef(_0x46b20a)){const _0x378df1=a117_0x16f0f7(_0x369a5f);_0x4a5d0a[_0x4cb755(0x184)]({'yamlConfig':_0x378df1,'folderPath':_0x32a5ab,'sourcePath':_0x32cb70});}else{if(!_0x6dfd0c?.['skipSegments']){const _0x59b662=parseSegmentYamlFile(_0x369a5f),_0x36a3bd=normalizeChildSegmentYaml(_0x59b662);_0x1fa147[_0x4cb755(0x184)]({'yamlConfig':_0x36a3bd,'folderPath':_0x32a5ab,'sourcePath':_0x32cb70});}}}return{'segments':_0x1fa147,'journeys':_0x4a5d0a};}export function validateParsedFiles(_0x28ff1a,_0x1bf676){const _0x409144=a117_0x110a5,_0xb6146f=[];for(const {yamlConfig:_0x157a6b,sourcePath:_0x4867d9}of _0x28ff1a[_0x409144(0x18a)]){const _0x4fef9d=readFileSync(_0x4867d9,_0x409144(0x20a)),_0x2cce5d=a117_0x1ce7c7[_0x409144(0x183)](_0x4fef9d),_0xd71651=validateSegmentDef(_0x157a6b,{'source':_0x4fef9d,'document':_0x2cce5d});if(!_0xd71651[_0x409144(0x1c5)]){const _0x50fa37=a117_0x227d93[_0x409144(0x202)](_0x1bf676,_0x4867d9);_0xb6146f[_0x409144(0x184)]({'filePath':_0x50fa37,'source':_0x4fef9d,'result':_0xd71651,'isJourney':![]});}}for(const {yamlConfig:_0x1ab99b,sourcePath:_0x25851d}of _0x28ff1a[_0x409144(0x219)]){const _0x15389c=readFileSync(_0x25851d,'utf-8'),_0x109e3b=a117_0x1ce7c7['parseDocument'](_0x15389c),_0x4e1f53=validateJourneyDef(_0x1ab99b,{'source':_0x15389c,'document':_0x109e3b});if(!_0x4e1f53[_0x409144(0x1c5)]){const _0x2aab83=a117_0x227d93[_0x409144(0x202)](_0x1bf676,_0x25851d);_0xb6146f[_0x409144(0x184)]({'filePath':_0x2aab83,'source':_0x15389c,'result':_0x4e1f53,'isJourney':!![]});}}return _0xb6146f;}export function formatValidationErrors(_0x3d567a){const _0x40cab5=a117_0x110a5,_0x98d04=[];for(const {filePath:_0x580844,source:_0x5b18f6,result:_0x596a7c,isJourney:_0x2a53b7}of _0x3d567a){const _0x6ee4c2=_0x2a53b7?'journey':_0x40cab5(0x135);_0x98d04[_0x40cab5(0x184)]('\x0a'+_0x580844+'\x20('+_0x6ee4c2+_0x40cab5(0x1fc)+_0x596a7c[_0x40cab5(0x215)][_0x40cab5(0x1d2)]+'\x20error(s)'),_0x98d04[_0x40cab5(0x184)](formatValidationResult(_0x596a7c,_0x5b18f6,_0x580844));}return _0x98d04[_0x40cab5(0x137)]('\x0a');}export function buildLocalExpandedRuleMappings(_0xe2ea0e){const _0xcfdb6d=a117_0x110a5,_0x7a7af0=new Set(),_0x472a75=new Map(),_0x12b63a=collectSegmentUsageCounts(_0xe2ea0e);if(_0xe2ea0e['segments'])for(const [_0x3b5ff5,_0x3d3fc8]of Object[_0xcfdb6d(0x181)](_0xe2ea0e[_0xcfdb6d(0x18a)])){_0x7a7af0[_0xcfdb6d(0x198)](_0x3b5ff5);if(_0x3d3fc8['rule']){const _0x3ed80b=yamlRuleToApi(_0x3d3fc8[_0xcfdb6d(0x1cc)]),_0x22be63=apiRuleToYaml(_0x3ed80b);_0x472a75['set'](_0x3b5ff5,_0x22be63);}}const _0x2ee98b=new Map();let _0x45a028=0x0;for(const [_0x240acd,_0x617c7e]of _0x472a75){const _0x582691=serializeExpandedRule(_0x617c7e,_0x472a75),_0x2e7f8a=_0x2ee98b['get'](_0x582691)||[];_0x2e7f8a[_0xcfdb6d(0x184)]({'name':_0x240acd,'index':_0x45a028}),_0x2ee98b['set'](_0x582691,_0x2e7f8a),_0x45a028++;}const _0x5d9915=new Map();for(const [_0xec372d,_0x3ec883]of _0x2ee98b){const _0x4a1518=_0x3ec883[_0xcfdb6d(0x1de)]()[_0xcfdb6d(0x1f8)]((_0x4e859b,_0x12d1b1)=>{const _0xdc21cc=_0xcfdb6d,_0x406f98=_0x12b63a[_0xdc21cc(0x1ea)](_0x4e859b['name'])||0x0,_0xab4ec3=_0x12b63a[_0xdc21cc(0x1ea)](_0x12d1b1[_0xdc21cc(0x20d)])||0x0;if(_0x406f98!==_0xab4ec3)return _0xab4ec3-_0x406f98;return _0x4e859b['index']-_0x12d1b1[_0xdc21cc(0x14c)];})[_0xcfdb6d(0x1af)](_0x2ee549=>_0x2ee549[_0xcfdb6d(0x20d)]),_0x13eee4=[];for(const _0x581cfa of _0x4a1518){const _0x3ac057=_0x12b63a[_0xcfdb6d(0x1ea)](_0x581cfa)||0x0,_0x4770cb=Math[_0xcfdb6d(0x1cd)](_0x3ac057,0x1);for(let _0x4d70f0=0x0;_0x4d70f0<_0x4770cb;_0x4d70f0++){_0x13eee4[_0xcfdb6d(0x184)](_0x581cfa);}}_0x5d9915['set'](_0xec372d,_0x13eee4);}return{'existingLocalSegmentNames':_0x7a7af0,'localSegmentRules':_0x472a75,'localExpandedRuleToNames':_0x5d9915};}async function buildServerSegmentRuleMap(_0x3ca953,_0x1183c6,_0x5225b9,_0x451e26){const _0x25d581=new Map(),_0xe135b8=new Set(),_0xe62a6=async _0x5c9b20=>{const _0x3d0403=a117_0x5c13;if(_0xe135b8[_0x3d0403(0x1b5)](_0x5c9b20))return;_0xe135b8[_0x3d0403(0x198)](_0x5c9b20);let _0x57d8b9=_0x5225b9[_0x3d0403(0x21a)](_0x48f2e3=>_0x48f2e3['id']===_0x5c9b20);if(!_0x57d8b9)try{_0x57d8b9=await _0x3ca953['segment']['getSegment'](_0x1183c6,_0x5c9b20);}catch{return;}if(!_0x57d8b9?.[_0x3d0403(0x1cc)])return;const _0x11fad4=apiRuleToYaml(_0x57d8b9[_0x3d0403(0x1cc)]);_0x25d581[_0x3d0403(0x172)](_0x5c9b20,_0x11fad4);const _0x5df51e=collectSegmentRefsFromRule(_0x11fad4);for(const _0x6728e3 of _0x5df51e){await _0xe62a6(_0x6728e3);}};for(const _0x2b372d of _0x451e26){await _0xe62a6(_0x2b372d);}return _0x25d581;}export function createSegmentIdResolver(_0x4e3886,_0x3bb154){return async _0x135bc9=>{const _0x3f0b94=a117_0x5c13,_0x282d5a=_0x4e3886[_0x3f0b94(0x1ea)](_0x135bc9);if(!_0x282d5a)throw new SDKError(ErrorCode[_0x3f0b94(0x1fe)],_0x3f0b94(0x1b7)+_0x135bc9+_0x3f0b94(0x1b2)+_0x3bb154+'\x27)');return _0x282d5a;};}export function extractRootFolderId(_0x198b2c){const _0x23439e=a117_0x110a5;return _0x198b2c[_0x23439e(0x14f)]?.[_0x23439e(0x158)]?.['data']?.['id']||_0x198b2c[_0x23439e(0x14f)]?.[_0x23439e(0x1d4)]?.[_0x23439e(0x192)]?.['id'];}export function buildConnectionMaps(_0x1856a8){const _0x557290=a117_0x110a5,_0x392986=new Map(),_0x1d7ddd=new Map(),_0x49af92=new Map();for(const _0x4046f1 of _0x1856a8){_0x392986[_0x557290(0x172)](_0x4046f1['name'],parseInt(_0x4046f1['id'],0xa)),_0x1d7ddd[_0x557290(0x172)](_0x4046f1['id'],_0x4046f1[_0x557290(0x20d)]),_0x49af92[_0x557290(0x172)](_0x4046f1[_0x557290(0x20d)],_0x4046f1[_0x557290(0x18b)]);}return{'nameToId':_0x392986,'idToName':_0x1d7ddd,'nameToType':_0x49af92};}export function calculatePushStats(_0x9688b9,_0x449625,_0x1011cc,_0x2d0614,_0x35deb9,_0x8d555b,_0x356f13){const _0x468c83=a117_0x110a5,_0x2b097f=_0x9688b9[_0x468c83(0x1ca)](_0x1f6c89=>_0x1f6c89['isNew']),_0x3a9949=_0x9688b9[_0x468c83(0x1ca)](_0x5445d3=>!_0x5445d3['isNew']&&_0x5445d3['hasChanges']),_0xde4568=_0x9688b9['filter'](_0x3446ff=>!_0x3446ff[_0x468c83(0x1cf)]&&!_0x3446ff[_0x468c83(0x210)]),_0x481411=_0x8d555b?_0x2d0614:[],_0xb6d34a=_0x449625[_0x468c83(0x1ca)](_0x373be9=>_0x373be9['isNew']),_0x5edc08=_0x449625[_0x468c83(0x1ca)](_0x1e407b=>!_0x1e407b['isNew']&&_0x1e407b[_0x468c83(0x210)]),_0x415ef0=_0x449625['filter'](_0x5e2f40=>!_0x5e2f40['isNew']&&!_0x5e2f40['hasChanges']),_0x4558c5=_0x8d555b?_0x35deb9:[],_0x10d308=_0x9688b9[_0x468c83(0x1a5)](_0x52cd97=>_0x52cd97[_0x468c83(0x1f9)]),_0x3604ea=_0x10d308[_0x468c83(0x1ca)](_0x409ff1=>_0x409ff1[_0x468c83(0x18b)]==='create'),_0x4e4f02=_0x10d308[_0x468c83(0x1ca)](_0x221637=>_0x221637[_0x468c83(0x18b)]===_0x468c83(0x16f)),_0x2b3eca=_0x10d308[_0x468c83(0x1ca)](_0x3c45e8=>_0x3c45e8[_0x468c83(0x18b)]==='delete'),_0x1ebd7b=Array[_0x468c83(0x15a)](_0x1011cc)['sort'](),_0x3f4242=_0x356f13?![]:_0x2b097f[_0x468c83(0x1d2)]>0x0||_0x3a9949[_0x468c83(0x1d2)]>0x0||_0x481411[_0x468c83(0x1d2)]>0x0,_0x3bc350=_0xb6d34a[_0x468c83(0x1d2)]>0x0||_0x5edc08[_0x468c83(0x1d2)]>0x0||_0x4558c5['length']>0x0,_0x2bb801=_0x356f13?![]:_0x10d308[_0x468c83(0x1d2)]>0x0,_0x58eac9=_0x1ebd7b[_0x468c83(0x1d2)]>0x0;return{'segments':{'new':_0x2b097f,'changed':_0x3a9949,'unchanged':_0xde4568,'toDelete':_0x481411},'journeys':{'new':_0xb6d34a,'changed':_0x5edc08,'unchanged':_0x415ef0,'toDelete':_0x4558c5},'activations':{'all':_0x10d308,'toCreate':_0x3604ea,'toUpdate':_0x4e4f02,'toDelete':_0x2b3eca},'folders':{'toCreate':_0x1ebd7b},'counts':{'segments':{'new':_0x2b097f[_0x468c83(0x1d2)],'changed':_0x3a9949['length'],'unchanged':_0xde4568[_0x468c83(0x1d2)],'toDelete':_0x481411[_0x468c83(0x1d2)]},'journeys':{'new':_0xb6d34a['length'],'changed':_0x5edc08['length'],'unchanged':_0x415ef0[_0x468c83(0x1d2)],'toDelete':_0x4558c5[_0x468c83(0x1d2)]},'activations':{'create':_0x3604ea[_0x468c83(0x1d2)],'update':_0x4e4f02['length'],'delete':_0x2b3eca['length']},'folders':_0x1ebd7b[_0x468c83(0x1d2)]},'hasChanges':_0x3f4242||_0x3bc350||_0x2bb801||_0x58eac9};}export async function buildPushExecutionContext(_0x11bb8d,_0x6bc8d8,_0x555637,_0x60e1e7,_0x52bad3,_0x53bab2){const _0x182b72=a117_0x110a5,_0x4110da=extractRootFolderId(_0x555637),{pathToId:_0x4991d1,idToPath:_0xf138ef}=buildFolderMaps(_0x52bad3),_0x18a13f=buildSegmentNameToIdMap(_0x60e1e7),_0x40b7fd=new Map(),{batchAsync:_0x4eeffb}=await import(_0x182b72(0x207)),[_0x2a9cf0,_0x371886]=await Promise[_0x182b72(0x1b9)]([_0x11bb8d[_0x182b72(0x14e)]['buildUserMaps'](),_0x11bb8d['connection'][_0x182b72(0x154)](),((async()=>{const _0x524087=_0x182b72;!_0x53bab2&&_0x60e1e7[_0x524087(0x1d2)]>0x0&&await _0x4eeffb(_0x60e1e7,async _0x3934ce=>{const _0x1b51c6=_0x524087,_0x4e83dc=await _0x11bb8d['segment'][_0x1b51c6(0x16d)](_0x6bc8d8,_0x3934ce['id']);_0x40b7fd[_0x1b51c6(0x172)](_0x3934ce['id'],_0x4e83dc);});})())]),{emailToId:_0x5cdf3d,idToEmail:_0x442601}=_0x2a9cf0,_0x14078d=buildConnectionMaps(_0x371886);return{'rootFolderId':_0x4110da,'folderPathToId':_0x4991d1,'folderIdToPath':_0xf138ef,'segmentNameToId':_0x18a13f,'activationsBySegmentId':_0x40b7fd,'emailToIdMap':_0x5cdf3d,'idToEmailMap':_0x442601,'connectionNameToIdMap':_0x14078d[_0x182b72(0x144)],'connectionIdToNameMap':_0x14078d[_0x182b72(0x1e2)],'connectionNameToTypeMap':_0x14078d[_0x182b72(0x19b)]};}export function createPushYamlContextForBundle(_0xe05179,_0x1b2b0c,_0x5f288e,_0x1b286f,_0x5a58ee,_0x183dd5,_0x484d91,_0x81bf33){const {existingLocalSegmentNames:_0xe7b50,localExpandedRuleToNames:_0x53e0ce}=_0x1b286f,_0xe8de06=new Set(),_0x3e6847=new Map(),_0x38441e=new Map(),_0x14b561=new Map(),_0x2505d8=createJumpTargetCache(),_0x630082=new Map(),_0x15bdb8=new Map(),_0x4fca80=new Set();let _0xe574dd;const _0x2be728=_0x5b5e8f=>{const _0x553889={'resolveSegment':async _0x315207=>{const _0x387bfd=a117_0x5c13,_0x29c45f=_0x14b561[_0x387bfd(0x1ea)](_0x315207);if(_0x29c45f!==undefined)return{'name':_0x29c45f,'isJourneyLocal':!![]};try{let _0x226798=_0x5f288e[_0x387bfd(0x21a)](_0x2bdeb0=>_0x2bdeb0['id']===_0x315207);!_0x226798&&(_0x226798=await _0xe05179[_0x387bfd(0x135)][_0x387bfd(0x157)](_0x1b2b0c,_0x315207));const _0x27335a=generateJourneyLocalName(_0x226798['name']),_0x5110da=_0x226798[_0x387bfd(0x1ef)]===SEGMENT_KIND_JOURNEY&&_0x27335a!==undefined;let _0x54108e=_0x226798[_0x387bfd(0x20d)],_0xf508b2;if(_0x5110da&&_0x226798[_0x387bfd(0x1cc)]){const _0x9ad8af=apiRuleToYaml(_0x226798[_0x387bfd(0x1cc)]);_0x15bdb8[_0x387bfd(0x172)](_0x315207,_0x9ad8af);const _0x29f757=async _0x4a52d6=>{const _0x2be66f=_0x387bfd,_0x2963a0=collectSegmentRefsFromRule(_0x4a52d6);for(const _0x20fe65 of _0x2963a0){if(!_0x15bdb8['has'](_0x20fe65))try{const _0x135d07=await _0xe05179['segment']['getSegment'](_0x1b2b0c,_0x20fe65);if(_0x135d07?.['rule']){const _0x491847=apiRuleToYaml(_0x135d07[_0x2be66f(0x1cc)]);_0x15bdb8[_0x2be66f(0x172)](_0x20fe65,_0x491847),await _0x29f757(_0x491847);}}catch{}}};await _0x29f757(_0x9ad8af);const _0x4b66e9=serializeExpandedRule(_0x9ad8af,_0x15bdb8),_0x6063a6=_0x53e0ce[_0x387bfd(0x1ea)](_0x4b66e9);if(_0x6063a6&&_0x6063a6[_0x387bfd(0x1d2)]>0x0){const _0x41214d=_0x3e6847[_0x387bfd(0x1ea)](_0x4b66e9)||0x0,_0x8a42ed=_0x6063a6[_0x41214d]||_0x6063a6[_0x6063a6[_0x387bfd(0x1d2)]-0x1];_0x3e6847['set'](_0x4b66e9,_0x41214d+0x1),_0x54108e=_0x8a42ed,_0xe8de06['add'](_0x54108e),_0x14b561[_0x387bfd(0x172)](_0x315207,_0x54108e);const _0xa8035c=await resolveRuleSegmentRefs(_0x9ad8af,async _0x1193a8=>{const _0x205964=_0x387bfd,_0x3c246d=_0x14b561[_0x205964(0x1ea)](_0x1193a8);if(_0x3c246d)return _0x3c246d;const _0x215545=await _0xe574dd[_0x205964(0x17d)](_0x1193a8);return _0x215545['name'];});_0xf508b2={'description':_0x226798['description'],'rule':_0xa8035c};}else{const _0x497a48=_0x630082[_0x387bfd(0x1ea)](_0x4b66e9);if(_0x497a48)_0x54108e=_0x497a48,_0x14b561[_0x387bfd(0x172)](_0x315207,_0x54108e);else{if(_0x27335a){let _0x27af49=_0x27335a,_0x1702a0=0x2;while(_0xe8de06[_0x387bfd(0x1b5)](_0x27af49)||_0xe7b50[_0x387bfd(0x1b5)](_0x27af49)){_0x27af49=_0x27335a+'_'+_0x1702a0,_0x1702a0++;}_0xe8de06['add'](_0x27af49),_0x54108e=_0x27af49;}_0x14b561[_0x387bfd(0x172)](_0x315207,_0x54108e),_0x630082['set'](_0x4b66e9,_0x54108e);const _0xd5bebb=await resolveRuleSegmentRefs(_0x9ad8af,async _0x5e7d80=>{const _0x3c2414=_0x387bfd,_0x492175=_0x14b561['get'](_0x5e7d80);if(_0x492175)return _0x492175;const _0x37797c=await _0xe574dd[_0x3c2414(0x17d)](_0x5e7d80);return _0x37797c[_0x3c2414(0x20d)];});_0xf508b2={'description':_0x226798[_0x387bfd(0x149)],'rule':_0xd5bebb};}}}return{'name':_0x54108e,'isJourneyLocal':_0x5110da,'definition':_0xf508b2};}catch{return{'name':_0x315207,'isJourneyLocal':![]};}},'resolveActivation':async _0x2892b9=>{const _0x42ed7a=a117_0x5c13,_0x64a3b3=_0x38441e[_0x42ed7a(0x1ea)](_0x2892b9);if(_0x64a3b3!==undefined)return{'name':_0x64a3b3,'isJourneyLocal':!![]};try{let _0x3d5925=_0x484d91?.[_0x42ed7a(0x1ea)](_0x2892b9);!_0x3d5925&&(_0x3d5925=await _0xe05179[_0x42ed7a(0x15f)][_0x42ed7a(0x1e1)](_0x5b5e8f,_0x2892b9));const _0x44a375=_0x3d5925[_0x42ed7a(0x13d)][_0x42ed7a(0x1db)][_0x42ed7a(0x20d)]||_0x2892b9,_0xb58151=sanitizeYamlKey(_0x44a375)||_0x42ed7a(0x166)+_0x2892b9,_0x59f35=_0xb58151;_0x38441e[_0x42ed7a(0x172)](_0x2892b9,_0x59f35);const _0x19f18b=journeyActivationStepToYaml(_0x3d5925,_0x5a58ee,_0x183dd5);return{'name':_0x59f35,'isJourneyLocal':!![],'definition':_0x19f18b};}catch{return{'name':_0x2892b9,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x326b44,_0x18bc89)=>resolveJumpTarget(_0x326b44,_0x18bc89,_0x2505d8,async _0x3d26a3=>{const _0x78b8bf=a117_0x5c13,_0x3d366d=_0x81bf33?.[_0x78b8bf(0x1ea)](_0x3d26a3);if(_0x3d366d)return _0x3d366d;return _0xe05179[_0x78b8bf(0x15f)][_0x78b8bf(0x1d8)](_0x3d26a3);})};return _0xe574dd=_0x553889,_0x553889;},_0x3645e3=async _0x2cf2b8=>{const _0x2e78f7=a117_0x5c13,{collectSegmentIdsFromJourneyApi:_0x46b210}=await import(_0x2e78f7(0x1ee)),{batchAsync:_0xcbf092}=await import(_0x2e78f7(0x207)),_0x47764d=new Set();for(const _0x4ef28c of _0x2cf2b8){let _0x235c9e=_0x81bf33?.[_0x2e78f7(0x1ea)](_0x4ef28c);!_0x235c9e&&(_0x235c9e=await _0xe05179[_0x2e78f7(0x15f)][_0x2e78f7(0x1d8)](_0x4ef28c));const _0x157eed=_0x46b210(_0x235c9e);for(const _0x4beb00 of _0x157eed){_0x47764d[_0x2e78f7(0x198)](_0x4beb00);}}let _0x52a755=Array[_0x2e78f7(0x15a)](_0x47764d);while(_0x52a755[_0x2e78f7(0x1d2)]>0x0){const _0x170eb3=_0x52a755[_0x2e78f7(0x1ca)](_0xe96f17=>!_0x4fca80[_0x2e78f7(0x1b5)](_0xe96f17));if(_0x170eb3[_0x2e78f7(0x1d2)]===0x0)break;const _0x4f24fb=await _0xcbf092(_0x170eb3,async _0x318fa4=>{const _0x5eff4e=_0x2e78f7;_0x4fca80[_0x5eff4e(0x198)](_0x318fa4);let _0x51161f=_0x5f288e[_0x5eff4e(0x21a)](_0x4e7325=>_0x4e7325['id']===_0x318fa4);if(!_0x51161f)try{_0x51161f=await _0xe05179[_0x5eff4e(0x135)][_0x5eff4e(0x157)](_0x1b2b0c,_0x318fa4);}catch{return null;}return{'segmentId':_0x318fa4,'segment':_0x51161f};},0xa),_0x1e6220=new Set();for(const _0x3c51d6 of _0x4f24fb){if(!_0x3c51d6?.[_0x2e78f7(0x135)]?.[_0x2e78f7(0x1cc)])continue;const _0x7a4168=apiRuleToYaml(_0x3c51d6[_0x2e78f7(0x135)][_0x2e78f7(0x1cc)]);_0x15bdb8[_0x2e78f7(0x172)](_0x3c51d6[_0x2e78f7(0x162)],_0x7a4168);const _0x197cf9=collectSegmentRefsFromRule(_0x7a4168);for(const _0x583ac0 of _0x197cf9){!_0x4fca80['has'](_0x583ac0)&&_0x1e6220[_0x2e78f7(0x198)](_0x583ac0);}}_0x52a755=Array[_0x2e78f7(0x15a)](_0x1e6220);}};return{'createYamlContext':_0x2be728,'prefetchJourneySegments':_0x3645e3};}export async function executePushSegments(_0x34a5bc,_0x13f3da,_0x1eebb8,_0x298b75,_0x282db2){const _0x5b147b=a117_0x110a5,{segmentDefToCreateRequest:_0x43ffee,segmentDefToUpdateRequest:_0xe15040}=await import(_0x5b147b(0x16c)),_0x546ac0=_0x1eebb8[_0x5b147b(0x1f0)],_0x197eb8=0x5,_0x3db54e=async _0x5c7b29=>{const _0x17426b=_0x5b147b,_0xf1d381=_0x5c7b29[_0x17426b(0x1e8)]?_0x546ac0[_0x17426b(0x1ea)](_0x5c7b29[_0x17426b(0x1e8)]):undefined;let _0x5123d5;const _0x5bed36={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5c7b29[_0x17426b(0x1cf)]){_0x282db2[_0x17426b(0x1df)]?.({'type':_0x17426b(0x161),'name':_0x5c7b29['yamlConfig'][_0x17426b(0x20d)]});const _0x55e196=_0x43ffee(_0x5c7b29[_0x17426b(0x199)],_0xf1d381),_0x2b0fc1=await _0x282db2[_0x17426b(0x148)]('Creating\x20segment\x20\x27'+_0x5c7b29[_0x17426b(0x199)]['name']+_0x17426b(0x1ab),()=>_0x34a5bc[_0x17426b(0x135)][_0x17426b(0x1a6)](_0x298b75[_0x17426b(0x20e)],_0x55e196));_0x5123d5=_0x2b0fc1[_0x17426b(0x192)]['id'],_0x5bed36[_0x17426b(0x1b4)]={'name':_0x5c7b29[_0x17426b(0x199)]['name'],'id':_0x5123d5},_0x282db2[_0x17426b(0x1df)]?.({'type':_0x17426b(0x17a),'name':_0x5c7b29['yamlConfig'][_0x17426b(0x20d)],'segmentId':_0x5123d5}),_0x282db2[_0x17426b(0x1b1)]?.('Created\x20segment\x20\x27'+_0x5c7b29['yamlConfig'][_0x17426b(0x20d)]+'\x27'),_0x5bed36[_0x17426b(0x188)]=0x1;}else{if(_0x5c7b29[_0x17426b(0x210)]){_0x282db2['onProgress']?.({'type':_0x17426b(0x18f),'name':_0x5c7b29['yamlConfig'][_0x17426b(0x20d)]});const _0x55d86b=_0xe15040(_0x5c7b29['yamlConfig']);_0xf1d381!==_0x5c7b29[_0x17426b(0x1a4)]?.[_0x17426b(0x1ac)]&&(_0x55d86b[_0x17426b(0x1ac)]=_0xf1d381?parseInt(_0xf1d381,0xa):undefined),await _0x282db2[_0x17426b(0x148)](_0x17426b(0x160)+_0x5c7b29[_0x17426b(0x199)]['name']+_0x17426b(0x1ab),()=>_0x34a5bc[_0x17426b(0x135)]['updateSegmentById'](_0x298b75['parentId'],_0x5c7b29['existingSegment']['id'],_0x55d86b)),_0x5123d5=_0x5c7b29['existingSegment']['id'],_0x282db2[_0x17426b(0x1df)]?.({'type':_0x17426b(0x17c),'name':_0x5c7b29[_0x17426b(0x199)][_0x17426b(0x20d)]}),_0x282db2[_0x17426b(0x1b1)]?.('Updated\x20segment\x20\x27'+_0x5c7b29[_0x17426b(0x199)][_0x17426b(0x20d)]+'\x27'),_0x5bed36[_0x17426b(0x171)]=0x1;}else _0x5123d5=_0x5c7b29[_0x17426b(0x1a4)]['id'];}}catch(_0x4425b3){const _0x4def98=isHttp400Error(_0x4425b3),_0x1f3ca0=_0x4def98?ErrorCode[_0x17426b(0x180)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4d1e5e=getErrorMessage(_0x4425b3);throw new SDKError(_0x1f3ca0,'Failed\x20to\x20'+(_0x5c7b29[_0x17426b(0x1cf)]?_0x17426b(0x217):_0x17426b(0x16f))+'\x20segment\x20from\x20file:\x20'+_0x5c7b29['absolutePath']+_0x17426b(0x140)+_0x4d1e5e,_0x4425b3);}try{const _0xae975c=await syncActivationsForSegment(_0x34a5bc,_0x298b75[_0x17426b(0x20e)],_0x5123d5,_0x5c7b29[_0x17426b(0x199)]['name'],_0x5c7b29[_0x17426b(0x1f9)],_0x282db2,_0x5c7b29[_0x17426b(0x1a1)]);_0x5bed36[_0x17426b(0x16e)]=_0xae975c;}catch(_0x51526b){if(_0x51526b instanceof SDKError)throw _0x51526b;throw new SDKError(ErrorCode[_0x17426b(0x17b)],_0x17426b(0x1d1)+_0x5c7b29['yamlConfig']['name']+_0x17426b(0x1a7)+_0x5c7b29[_0x17426b(0x1a1)]+'\x0a\x20\x20'+getErrorMessage(_0x51526b),_0x51526b);}return _0x5bed36;},_0x139a23=await batchAsync(_0x13f3da,_0x3db54e,_0x197eb8),_0x4cee16={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5717fc of _0x139a23){_0x4cee16[_0x5b147b(0x188)]+=_0x5717fc[_0x5b147b(0x188)],_0x4cee16[_0x5b147b(0x171)]+=_0x5717fc[_0x5b147b(0x171)],_0x5717fc['createdSegmentId']&&_0x4cee16[_0x5b147b(0x1c1)][_0x5b147b(0x172)](_0x5717fc[_0x5b147b(0x1b4)]['name'],_0x5717fc[_0x5b147b(0x1b4)]['id']),_0x4cee16[_0x5b147b(0x16e)][_0x5b147b(0x188)]+=_0x5717fc[_0x5b147b(0x16e)][_0x5b147b(0x188)],_0x4cee16['activations']['updated']+=_0x5717fc[_0x5b147b(0x16e)]['updated'],_0x4cee16['activations'][_0x5b147b(0x167)]+=_0x5717fc['activations'][_0x5b147b(0x167)];}return _0x4cee16;}function a117_0x3b8c(){const _0x4f2c04=['segment_updating','entry_criteria','connectionIdToNameMap','data','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','columns','journeyStages','stages','Stage\x20\x27','add','yamlConfig','milestone','nameToType','Updated\x20journey\x20\x27','NOT_FOUND','folderId','entry','embeddedSegmentNameToId','absolutePath','1178860sLKZdU','replace','existingSegment','flatMap','createSegment','\x27\x20from\x20file:\x20','\x20(referenced\x20in\x20journey\x20','Deleting\x20activation\x20\x27','35PFhVzg','\x27...','segmentFolderId','330550esAXwE','logDeleted','map','null','logSuccess','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','validatedRequest','createdSegmentId','has','steps','Segment\x20not\x20found:\x20','action','all','Name\x20has\x20already\x20been\x20taken','JOURNEY_UPDATE_ERROR','\x27\x20for\x20','results','decision_point','30756CPSnuL','trim','createdSegmentIds','diff','existingSegments','3228XeEbet','valid','activation_deleting','journeyById','activation_template_id','\x27\x20not\x20found\x20in\x20journey\x20\x27','filter','\x27\x20entry\x20criteria','rule','max','startsWith','isNew','__pending_act_','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','length','folder_created','parentFolder','activation_updating','with','deleteSegment','getJourney','waitCondition','notification','activationParams','Entry\x20criteria:\x20','Created\x20folder\x20\x27','slice','onProgress','split','getActivation','idToName','createFolder','activationStepsById','JOURNEY_SYNTAX_ERROR','Activation','journey_creating','folderPath','reduce','get','\x20activation\x20\x27','activation_creating','Updating\x20activation\x20\x27','./journey-yaml.js','kind','folderPathToId','createActivation','updateSegmentById','1474mzPrRy','ACTIVATION_SYNTAX_ERROR','activation_created','journeyActivationStepId','Failed\x20to\x20','sort','activationActions','108099FbodiV','entryCriteria','):\x20','rootFolderId','SEGMENT_NOT_FOUND','deps','goal','behavior','relative','embedded_segment_created','unchanged','schedule','activationContext','../../utils/async.js','effectiveFolderId','progress','utf-8','resolveJourneyId','parse','name','parentId','journeyId','hasChanges','versionNumber','all_columns','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','errors','journey_updated','create','segment_deleted','journeys','find','3DiZkLd','segment','stringify','join','segmentByFolderAndName','toLowerCase','segmentNameToId','journey_updating','\x20journey\x20from\x20file:\x20','attributes','Updated\x20activation\x20\x27','811480TmBriy','\x0a\x20\x20','WaitStep','existingJourney','branches','nameToId','522628EtoXNs','folder_creating','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','withProgress','description','item','1490LsVpxq','index','330sgEghQ','user','relationships','idToEmailMap','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27',').\x20','Activation\x20not\x20found:\x20','list','activation_updated','state','getSegment','parentSegmentFolder','\x27\x20exit\x20criteria','from','updateActivation','logInfo','Created\x20activation\x20\x27','stage\x20\x27','journey','Updating\x20segment\x20\x27','segment_creating','segmentId','DecisionPoint','fetchJourney','deleteActivation','activation_','deleted','embedded_activation_creating','size','exitCriterias','digest','./child-segment-yaml.js','listActivations','activations','update','Created\x20journey\x20\x27','updated','set','connector_config','journeyBundlesByFolderAndName','createJourneySegment','goal\x20criteria','delete','keys','Fetching\x20','segment_created','ACTIVATION_UPDATE_ERROR','segment_updated','resolveSegment','journeyBundleName','Creating\x20activation\x20\x27','SEGMENT_SYNTAX_ERROR','entries','message','parseDocument','push','dirname','INTERNAL','hex','created','verbose','segments','type','existingActivation','activationsBySegmentId','toString'];a117_0x3b8c=function(){return _0x4f2c04;};return a117_0x3b8c();}async function syncActivationsForSegment(_0x1e4a57,_0x1b459f,_0x15d26e,_0x3ad843,_0x46e207,_0x152408,_0x30535a){const _0x57e673=a117_0x110a5,_0xeb0923={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4a9351 of _0x46e207){try{if(_0x4a9351[_0x57e673(0x18b)]===_0x57e673(0x217)&&_0x4a9351[_0x57e673(0x1b3)])_0x152408[_0x57e673(0x1df)]?.({'type':_0x57e673(0x1ec),'segmentName':_0x3ad843,'activationName':_0x4a9351[_0x57e673(0x20d)]}),await _0x152408[_0x57e673(0x148)](_0x57e673(0x17f)+_0x4a9351['name']+_0x57e673(0x1ab),()=>_0x1e4a57[_0x57e673(0x135)][_0x57e673(0x1f1)](_0x1b459f,_0x15d26e,_0x4a9351[_0x57e673(0x1b3)])),_0x152408['onProgress']?.({'type':_0x57e673(0x1f5),'segmentName':_0x3ad843,'activationName':_0x4a9351[_0x57e673(0x20d)]}),_0x152408['logSuccess']?.(_0x57e673(0x15d)+_0x4a9351['name']+'\x27'),_0xeb0923[_0x57e673(0x188)]++;else{if(_0x4a9351[_0x57e673(0x18b)]==='update'&&_0x4a9351[_0x57e673(0x1b3)]&&_0x4a9351[_0x57e673(0x18c)])_0x152408[_0x57e673(0x1df)]?.({'type':_0x57e673(0x1d5),'segmentName':_0x3ad843,'activationName':_0x4a9351['name']}),await _0x152408['withProgress'](_0x57e673(0x1ed)+_0x4a9351[_0x57e673(0x20d)]+'\x27...',()=>_0x1e4a57['segment'][_0x57e673(0x15b)](_0x1b459f,_0x15d26e,_0x4a9351[_0x57e673(0x18c)]['id'],_0x4a9351[_0x57e673(0x1b3)])),_0x152408[_0x57e673(0x1df)]?.({'type':_0x57e673(0x155),'segmentName':_0x3ad843,'activationName':_0x4a9351[_0x57e673(0x20d)]}),_0x152408[_0x57e673(0x1b1)]?.(_0x57e673(0x13e)+_0x4a9351['name']+'\x27'),_0xeb0923[_0x57e673(0x171)]++;else _0x4a9351[_0x57e673(0x18b)]===_0x57e673(0x177)&&_0x4a9351[_0x57e673(0x18c)]&&(_0x152408[_0x57e673(0x1df)]?.({'type':_0x57e673(0x1c6),'segmentName':_0x3ad843,'activationName':_0x4a9351['name']}),await _0x152408[_0x57e673(0x148)](_0x57e673(0x1a9)+_0x4a9351[_0x57e673(0x20d)]+_0x57e673(0x1ab),()=>_0x1e4a57['segment'][_0x57e673(0x165)](_0x1b459f,_0x15d26e,_0x4a9351['existingActivation']['id'])),_0x152408[_0x57e673(0x1df)]?.({'type':'activation_deleted','segmentName':_0x3ad843,'activationName':_0x4a9351[_0x57e673(0x20d)]}),_0x152408[_0x57e673(0x1ae)]?.('Deleted\x20activation\x20\x27'+_0x4a9351[_0x57e673(0x20d)]+'\x27'),_0xeb0923['deleted']++);}}catch(_0x1f0b17){const _0x244aa0=isHttp400Error(_0x1f0b17),_0x1e091f=_0x244aa0?ErrorCode[_0x57e673(0x1f4)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xca07db=getErrorMessage(_0x1f0b17);throw new SDKError(_0x1e091f,_0x57e673(0x1f7)+_0x4a9351[_0x57e673(0x18b)]+_0x57e673(0x1eb)+_0x4a9351[_0x57e673(0x20d)]+_0x57e673(0x1a7)+_0x30535a+_0x57e673(0x140)+_0xca07db,_0x1f0b17);}}return _0xeb0923;}export async function executePushFolders(_0x253ddb,_0x51564b,_0x311edd,_0x298e15,_0x77fcf5){const _0x25b519=a117_0x110a5,_0x2cc395=new Map(_0x311edd);for(const _0x536877 of _0x51564b){const _0x16efd6=_0x536877[_0x25b519(0x1e0)]('/'),_0x5c63cc=_0x16efd6[_0x16efd6[_0x25b519(0x1d2)]-0x1],_0x29ed26=_0x16efd6[_0x25b519(0x1de)](0x0,-0x1)[_0x25b519(0x137)]('/'),_0x40523c=_0x2cc395[_0x25b519(0x1ea)](_0x29ed26);_0x77fcf5[_0x25b519(0x1df)]?.({'type':_0x25b519(0x146),'folder':_0x536877});const _0x4edb4b={'name':_0x5c63cc,'parentFolderId':_0x40523c},_0x5c2131=await _0x77fcf5[_0x25b519(0x148)]('Creating\x20folder\x20\x27'+_0x536877+_0x25b519(0x1ab),()=>_0x253ddb[_0x25b519(0x135)][_0x25b519(0x1e3)](_0x298e15[_0x25b519(0x20e)],_0x4edb4b));_0x2cc395[_0x25b519(0x172)](_0x536877,_0x5c2131[_0x25b519(0x192)]['id']),_0x77fcf5['onProgress']?.({'type':_0x25b519(0x1d3),'folder':_0x536877,'folderId':_0x5c2131[_0x25b519(0x192)]['id']}),_0x77fcf5[_0x25b519(0x15c)]?.(_0x25b519(0x1dd)+_0x536877+'\x27');}return _0x2cc395;}export async function executePushSegmentDeletions(_0x2de65e,_0x3db664,_0x45db24){const _0x42aa48=a117_0x110a5;if(_0x3db664['length']===0x0)return 0x0;const {batchAsync:_0x39ce69}=await import(_0x42aa48(0x207)),_0x262481=0x5,_0x3fcc46=await _0x39ce69(_0x3db664,async _0x50e422=>{const _0x5c608d=_0x42aa48;return _0x45db24[_0x5c608d(0x1df)]?.({'type':'segment_deleting','name':_0x50e422[_0x5c608d(0x20d)]}),await _0x2de65e[_0x5c608d(0x135)][_0x5c608d(0x1d7)](_0x50e422['id']),_0x45db24[_0x5c608d(0x1df)]?.({'type':_0x5c608d(0x218),'name':_0x50e422[_0x5c608d(0x20d)]}),_0x45db24[_0x5c608d(0x1ae)]?.('Deleted\x20segment\x20\x27'+_0x50e422[_0x5c608d(0x20d)]+'\x27'),0x1;},_0x262481);return _0x3fcc46[_0x42aa48(0x1e9)]((_0xa8f3b7,_0x47f856)=>_0xa8f3b7+_0x47f856,0x0);}export async function executePushJourneys(_0x3e3c0a,_0x521052,_0x3e43fc,_0x4e8ad2,_0xeb2360){const _0xfde5e4=a117_0x110a5,{journeyDefToRequest:_0x3c1f7c}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x5cb569,yamlRuleToApi:_0x16507f,validateSegmentRule:_0x2aeca1}=await import(_0xfde5e4(0x16c)),_0x27cb58={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x25ab90=new Map(_0x3e43fc['segmentNameToId']),_0x493809=0x5;for(let _0x5939f0=0x0;_0x5939f0<_0x521052['length'];_0x5939f0+=_0x493809){const _0x5ee430=_0x521052['slice'](_0x5939f0,_0x5939f0+_0x493809),_0xfdd4b0=await Promise[_0xfde5e4(0x1b9)](_0x5ee430[_0xfde5e4(0x1af)](async _0x44eb9f=>{const _0x1e5dd6=_0xfde5e4;if(!_0x44eb9f[_0x1e5dd6(0x1cf)]&&!_0x44eb9f[_0x1e5dd6(0x210)])return{'action':_0x1e5dd6(0x204),'name':_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)],'journeyId':_0x44eb9f[_0x1e5dd6(0x142)]?.['id']};const _0x4bbbdb=_0x44eb9f[_0x1e5dd6(0x1e8)]?_0x3e43fc[_0x1e5dd6(0x1f0)][_0x1e5dd6(0x1ea)](_0x44eb9f['folderPath']):undefined;_0xeb2360['onProgress']?.({'type':_0x44eb9f['isNew']?_0x1e5dd6(0x1e7):_0x1e5dd6(0x13b),'name':_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)]});try{const _0x542eb6=await executeSingleJourneyPush(_0x3e3c0a,_0x44eb9f,{..._0x3e43fc,'segmentNameToId':_0x25ab90},{'parentId':_0x4e8ad2[_0x1e5dd6(0x20e)],'rootFolderId':_0x4e8ad2['rootFolderId'],'folderId':_0x4bbbdb,'verbose':_0x4e8ad2[_0x1e5dd6(0x189)]},_0xeb2360,{'journeyDefToRequest':_0x3c1f7c,'activationDefToCreateRequest':_0x5cb569,'yamlRuleToApi':_0x16507f,'validateSegmentRule':_0x2aeca1});for(const [_0x37a0a6,_0x32f805]of _0x542eb6[_0x1e5dd6(0x1a0)]){_0x25ab90['set'](_0x37a0a6,_0x32f805),_0x27cb58['embeddedSegmentNameToId']['set'](_0x37a0a6,_0x32f805);}if(_0x542eb6[_0x1e5dd6(0x1b8)]===_0x1e5dd6(0x188))_0xeb2360[_0x1e5dd6(0x1df)]?.({'type':'journey_created','name':_0x44eb9f['yamlConfig'][_0x1e5dd6(0x20d)],'journeyId':_0x542eb6[_0x1e5dd6(0x20f)]}),_0xeb2360[_0x1e5dd6(0x1b1)]?.(_0x1e5dd6(0x170)+_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)]+'\x27'),_0x27cb58[_0x1e5dd6(0x188)]++;else _0x542eb6['action']===_0x1e5dd6(0x171)&&(_0xeb2360['onProgress']?.({'type':_0x1e5dd6(0x216),'name':_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)]}),_0xeb2360['logSuccess']?.(_0x1e5dd6(0x19c)+_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)]+'\x27'),_0x27cb58['updated']++);return{'action':_0x542eb6[_0x1e5dd6(0x1b8)],'name':_0x44eb9f[_0x1e5dd6(0x199)][_0x1e5dd6(0x20d)],'journeyId':_0x542eb6[_0x1e5dd6(0x20f)]};}catch(_0x324f0b){const _0x124859=isHttp400Error(_0x324f0b),_0x29c830=_0x124859?ErrorCode[_0x1e5dd6(0x1e5)]:ErrorCode[_0x1e5dd6(0x1bb)],_0x1181d7=getErrorMessage(_0x324f0b);throw new SDKError(_0x29c830,_0x1e5dd6(0x1f7)+(_0x44eb9f[_0x1e5dd6(0x1cf)]?_0x1e5dd6(0x217):'update')+_0x1e5dd6(0x13c)+_0x44eb9f['absolutePath']+_0x1e5dd6(0x140)+_0x1181d7,_0x324f0b);}}));_0x27cb58[_0xfde5e4(0x1bd)][_0xfde5e4(0x184)](..._0xfdd4b0);}return _0x27cb58;}async function executeSingleJourneyPush(_0x60ed9f,_0x2933b5,_0x9fc1b7,_0x4dd78e,_0x1b059d,_0x3ee183){const _0x37ab8f=a117_0x110a5,{journeyDefToRequest:_0x55bc77,activationDefToCreateRequest:_0x29f2a3,yamlRuleToApi:_0x2ed28c,validateSegmentRule:_0x2ca8b4}=_0x3ee183,_0x304453=new Map(),_0x593169=new Map(),_0x3aeff7=new Map(),_0x20f1e0=new Map(),_0x189f94=new Map();let _0x3aa527;const _0x4159f9=async()=>{const _0x582f66=a117_0x5c13;if(_0x3aa527)return;_0x3aa527=new Map();if(!_0x2933b5['existingJourney'])return;const _0x3e656e=await _0x60ed9f[_0x582f66(0x15f)][_0x582f66(0x16d)](_0x2933b5[_0x582f66(0x142)]['id']);for(const _0x559ef1 of _0x3e656e){const _0xdc5e07=journeyActivationStepToYaml(_0x559ef1,_0x9fc1b7[_0x582f66(0x150)],_0x9fc1b7[_0x582f66(0x191)]),_0x304449=activationSignature(_0xdc5e07);!_0x3aa527['has'](_0x304449)&&_0x3aa527[_0x582f66(0x172)](_0x304449,_0x559ef1['id']),_0xdc5e07[_0x582f66(0x20d)]&&_0x593169[_0x582f66(0x172)](_0xdc5e07['name'],_0x559ef1['id']);}};if(_0x2933b5[_0x37ab8f(0x142)]&&_0x2933b5[_0x37ab8f(0x199)][_0x37ab8f(0x18a)]){const _0x2077c9=buildLocalExpandedRuleMappings(_0x2933b5[_0x37ab8f(0x199)]),_0x3c8a8a=_0x2077c9['localSegmentRules'];if(_0x3c8a8a[_0x37ab8f(0x169)]>0x0){const _0x2d1776=new Map();for(const [_0x19a68c,_0x35b18a]of _0x3c8a8a){const _0x25f53d=serializeExpandedRule(_0x35b18a,_0x3c8a8a);_0x2d1776['set'](_0x19a68c,_0x25f53d);}const _0x15cab4=collectSegmentIdsFromJourneyApi(_0x2933b5['existingJourney']);if(_0x15cab4[_0x37ab8f(0x169)]>0x0){const _0xd70997=await buildServerSegmentRuleMap(_0x60ed9f,_0x4dd78e[_0x37ab8f(0x20e)],_0x9fc1b7['existingSegments'],_0x15cab4);if(_0xd70997[_0x37ab8f(0x169)]>0x0){const _0x44c736=new Map();for(const [_0x32dcfc,_0x1efd8d]of _0xd70997){const _0x547d8b=serializeExpandedRule(_0x1efd8d,_0xd70997);!_0x44c736[_0x37ab8f(0x1b5)](_0x547d8b)&&_0x44c736[_0x37ab8f(0x172)](_0x547d8b,_0x32dcfc);}for(const [_0x3d839b,_0x40dcca]of _0x2d1776){const _0x554bdf=_0x44c736[_0x37ab8f(0x1ea)](_0x40dcca);_0x554bdf&&(_0x189f94[_0x37ab8f(0x172)](_0x3d839b,_0x554bdf),_0x9fc1b7['segmentNameToId'][_0x37ab8f(0x172)](_0x3d839b,_0x554bdf));}}}}}const _0x5dcd26={'resolveSegmentId':async _0x712b03=>{const _0x1d0b5e=_0x37ab8f,_0x5dc90e=_0x9fc1b7[_0x1d0b5e(0x13a)][_0x1d0b5e(0x1ea)](_0x712b03);if(!_0x5dc90e)throw new SDKError(ErrorCode[_0x1d0b5e(0x1fe)],_0x1d0b5e(0x1b7)+_0x712b03+_0x1d0b5e(0x1a8)+_0x2933b5['yamlConfig'][_0x1d0b5e(0x20d)]+')');return _0x5dc90e;},'resolveEmbeddedSegmentId':async(_0x3f4685,_0x35e5eb)=>{const _0x439c2b=_0x37ab8f,_0xfd87b8=_0x9fc1b7[_0x439c2b(0x13a)]['get'](_0x3f4685);if(_0xfd87b8)return _0xfd87b8;const _0x1d5927=_0x189f94[_0x439c2b(0x1ea)](_0x3f4685);if(_0x1d5927)return _0x9fc1b7[_0x439c2b(0x13a)][_0x439c2b(0x172)](_0x3f4685,_0x1d5927),_0x1d5927;const _0x276712=_0x9fc1b7[_0x439c2b(0x1c3)][_0x439c2b(0x21a)](_0x20c40d=>_0x20c40d[_0x439c2b(0x20d)]===_0x3f4685);if(_0x276712)return _0x9fc1b7[_0x439c2b(0x13a)][_0x439c2b(0x172)](_0x3f4685,_0x276712['id']),_0x276712['id'];if(_0x2933b5[_0x439c2b(0x1cf)]){const {stageName:_0x599a14,criteriaName:_0x20d518}=findSegmentCriteriaLocation(_0x2933b5[_0x439c2b(0x199)],_0x3f4685);return _0x2ca8b4(_0x3f4685,_0x35e5eb[_0x439c2b(0x1cc)]),_0x3aeff7[_0x439c2b(0x172)](_0x3f4685,{'definition':_0x35e5eb,'stageName':_0x599a14,'criteriaName':_0x20d518}),createPendingSegmentId(_0x3f4685);}const _0x1acf6d=_0x2933b5[_0x439c2b(0x142)]?.['id'];if(!_0x1acf6d)throw new SDKError(ErrorCode[_0x439c2b(0x186)],_0x439c2b(0x213));_0x2ca8b4(_0x3f4685,_0x35e5eb[_0x439c2b(0x1cc)]);const _0x4c299e=generateDeterministicJourneySegmentName(_0x2933b5['yamlConfig'][_0x439c2b(0x20d)],_0x3f4685),_0x1d73f3=_0x9fc1b7['existingSegments']['find'](_0x4f8add=>_0x4f8add[_0x439c2b(0x20d)]===_0x4c299e),_0x74ab8=createSegmentIdResolver(_0x9fc1b7[_0x439c2b(0x13a)],_0x3f4685),_0x4eeeb1=await resolveRuleSegmentIds(_0x35e5eb[_0x439c2b(0x1cc)],_0x74ab8);let _0x59c876;if(_0x1d73f3)await _0x60ed9f['segment']['updateSegmentById'](_0x4dd78e['parentId'],_0x1d73f3['id'],{'description':_0x35e5eb[_0x439c2b(0x149)]||_0x439c2b(0x1dc)+_0x3f4685,'rule':_0x2ed28c(_0x4eeeb1,!![]),'countPopulation':!![]}),_0x59c876=_0x1d73f3['id'];else try{_0x59c876=await _0x60ed9f[_0x439c2b(0x135)][_0x439c2b(0x175)]({'name':_0x4c299e,'description':_0x35e5eb['description']||'Entry\x20criteria:\x20'+_0x3f4685,'journeyId':_0x1acf6d,'rule':_0x2ed28c(_0x4eeeb1,!![]),'countPopulation':!![],'parentFolderId':_0x4dd78e['rootFolderId']||'','audienceId':_0x4dd78e[_0x439c2b(0x20e)]});}catch(_0x5b96d7){const _0x3c97c8=_0x5b96d7 instanceof Error&&_0x5b96d7[_0x439c2b(0x182)]['includes'](_0x439c2b(0x1ba));if(_0x3c97c8){const _0x8dd82c=await _0x60ed9f['segment']['listSegments'](_0x4dd78e[_0x439c2b(0x20e)]),_0xd6e31c=_0x8dd82c[_0x439c2b(0x21a)](_0x3bfdc9=>_0x3bfdc9[_0x439c2b(0x20d)]===_0x4c299e);if(_0xd6e31c)await _0x60ed9f[_0x439c2b(0x135)][_0x439c2b(0x1f2)](_0x4dd78e['parentId'],_0xd6e31c['id'],{'description':_0x35e5eb[_0x439c2b(0x149)]||'Entry\x20criteria:\x20'+_0x3f4685,'rule':_0x2ed28c(_0x4eeeb1,!![]),'countPopulation':!![]}),_0x59c876=_0xd6e31c['id'];else throw _0x5b96d7;}else throw _0x5b96d7;}return _0x9fc1b7[_0x439c2b(0x13a)][_0x439c2b(0x172)](_0x3f4685,_0x59c876),_0x304453[_0x439c2b(0x172)](_0x3f4685,_0x59c876),_0x59c876;},'resolveActivationId':async _0x132fc3=>{const _0x15ed23=_0x37ab8f,_0x16bd79=_0x593169['get'](_0x132fc3);if(_0x16bd79)return _0x16bd79;if(_0x2933b5[_0x15ed23(0x142)]){await _0x4159f9();const _0x346e85=_0x593169[_0x15ed23(0x1ea)](_0x132fc3);if(_0x346e85)return _0x346e85;}throw new SDKError(ErrorCode[_0x15ed23(0x19d)],_0x15ed23(0x153)+_0x132fc3+_0x15ed23(0x1a8)+_0x2933b5[_0x15ed23(0x199)][_0x15ed23(0x20d)]+_0x15ed23(0x152)+_0x15ed23(0x214));},'resolveEmbeddedActivationId':async(_0x2d2469,_0x385b17)=>{const _0x484c01=_0x37ab8f,_0x357e75=_0x593169[_0x484c01(0x1ea)](_0x2d2469);if(_0x357e75)return _0x357e75;if(_0x2933b5[_0x484c01(0x1cf)])return _0x20f1e0[_0x484c01(0x172)](_0x2d2469,_0x385b17),createPendingActivationId(_0x2d2469);if(_0x2933b5[_0x484c01(0x142)]){await _0x4159f9();const _0x290ba3=_0x593169[_0x484c01(0x1ea)](_0x385b17[_0x484c01(0x20d)]);if(_0x290ba3)return _0x593169[_0x484c01(0x172)](_0x2d2469,_0x290ba3),_0x290ba3;const _0x4b906c=activationSignature(_0x385b17),_0x583e44=_0x3aa527?.['get'](_0x4b906c);if(_0x583e44)return _0x593169[_0x484c01(0x172)](_0x2d2469,_0x583e44),_0x583e44;const _0x4c9a38=await _0x29f2a3(_0x385b17,_0x9fc1b7[_0x484c01(0x206)]),_0x233893=await _0x60ed9f[_0x484c01(0x15f)][_0x484c01(0x1f1)](_0x2933b5[_0x484c01(0x142)]['id'],_0x4c9a38);return _0x593169[_0x484c01(0x172)](_0x2d2469,_0x233893['id']),_0x233893['id'];}throw new SDKError(ErrorCode[_0x484c01(0x186)],_0x484c01(0x147));},'resolveJourneyId':async _0x5e23bb=>{const _0x369172=_0x37ab8f;try{return await _0x60ed9f['journey'][_0x369172(0x20b)](_0x4dd78e['parentId'],_0x5e23bb);}catch(_0x1558ed){throw new SDKError(ErrorCode[_0x369172(0x19d)],'Journey\x20\x27'+_0x5e23bb+_0x369172(0x151)+_0x2933b5[_0x369172(0x199)][_0x369172(0x20d)]+'\x27)',_0x1558ed);}},'resolveStageId':async(_0xd71b44,_0x160738)=>{const _0x2c8202=_0x37ab8f,_0x2f40d8=await _0x60ed9f[_0x2c8202(0x15f)][_0x2c8202(0x1d8)](_0xd71b44),_0x5e96e4=_0x2f40d8['attributes'][_0x2c8202(0x195)][_0x2c8202(0x21a)](_0x1343fc=>_0x1343fc[_0x2c8202(0x20d)][_0x2c8202(0x139)]()===_0x160738[_0x2c8202(0x139)]());if(!_0x5e96e4?.['id'])throw new SDKError(ErrorCode[_0x2c8202(0x19d)],_0x2c8202(0x197)+_0x160738+_0x2c8202(0x1c9)+(_0x2f40d8[_0x2c8202(0x13d)][_0x2c8202(0x17e)]||_0x2f40d8[_0x2c8202(0x13d)][_0x2c8202(0x20d)])+'\x27');return _0x5e96e4['id'];}},_0x5b4b0a=await _0x55bc77(_0x2933b5[_0x37ab8f(0x199)],_0x4dd78e['parentId'],_0x5dcd26),_0x5f4f34=_0x4dd78e[_0x37ab8f(0x19e)]||_0x4dd78e[_0x37ab8f(0x1fd)];_0x5f4f34&&(_0x5b4b0a['relationships']={'parentFolder':{'data':{'id':_0x5f4f34,'type':'folder'}}});if(_0x2933b5[_0x37ab8f(0x1cf)]){if(_0x3aeff7['size']>0x0||_0x20f1e0[_0x37ab8f(0x169)]>0x0)return await executeThreeStepJourneyCreate(_0x60ed9f,_0x2933b5,_0x5b4b0a,{'pendingEmbeddedSegments':_0x3aeff7,'pendingEmbeddedActivations':_0x20f1e0,'embeddedSegmentNameToId':_0x304453,'journeyActivationNameToId':_0x593169},{..._0x4dd78e,'effectiveFolderId':_0x5f4f34},_0x9fc1b7,_0x1b059d,_0x3ee183);else{ensureJourneyDefaults(_0x5b4b0a['attributes']);const _0x36beba=await _0x60ed9f[_0x37ab8f(0x15f)][_0x37ab8f(0x217)](_0x5b4b0a);return{'action':_0x37ab8f(0x188),'journeyId':_0x36beba['id'],'embeddedSegmentNameToId':_0x304453};}}else{if(_0x2933b5[_0x37ab8f(0x210)]&&_0x2933b5['existingJourney'])return ensureJourneyDefaults(_0x5b4b0a[_0x37ab8f(0x13d)]),await _0x60ed9f[_0x37ab8f(0x15f)]['update'](_0x2933b5[_0x37ab8f(0x142)]['id'],_0x5b4b0a),{'action':_0x37ab8f(0x171),'journeyId':_0x2933b5['existingJourney']['id'],'embeddedSegmentNameToId':_0x304453};}return{'action':'unchanged','journeyId':_0x2933b5[_0x37ab8f(0x142)]?.['id'],'embeddedSegmentNameToId':_0x304453};}function findSegmentCriteriaLocation(_0x49e8ef,_0x3ceb6f){const _0x3398f0=a117_0x110a5,_0xfa2efe=_0x49e8ef['stages']||_0x49e8ef[_0x3398f0(0x219)]?.[0x0]?.[_0x3398f0(0x196)]||[];let _0x5bfcf6=_0x3398f0(0x19f),_0x3f5032=_0x3ceb6f;const _0x12ad9e=_0x49e8ef[_0x3398f0(0x200)]||_0x49e8ef[_0x3398f0(0x219)]?.[0x0]?.['goal'];if(_0x12ad9e?.[_0x3398f0(0x135)]===_0x3ceb6f)return{'stageName':_0x3398f0(0x200),'criteriaName':_0x12ad9e[_0x3398f0(0x20d)]||_0x3ceb6f};_0x227b15:for(const _0x5684d3 of _0xfa2efe){if(_0x5684d3['entry_criteria']?.[_0x3398f0(0x135)]===_0x3ceb6f){_0x5bfcf6=_0x5684d3[_0x3398f0(0x20d)],_0x3f5032=_0x5684d3[_0x3398f0(0x190)][_0x3398f0(0x20d)]||_0x3ceb6f;break;}if(_0x5684d3[_0x3398f0(0x1b6)])for(const _0x56cc20 of _0x5684d3[_0x3398f0(0x1b6)]){if(_0x56cc20[_0x3398f0(0x18b)]===_0x3398f0(0x1be)&&_0x56cc20[_0x3398f0(0x1d6)]?.[_0x3398f0(0x143)])for(const _0xbbbb53 of _0x56cc20['with']['branches']){if(_0xbbbb53[_0x3398f0(0x135)]===_0x3ceb6f){_0x5bfcf6=_0x5684d3['name'],_0x3f5032=_0xbbbb53[_0x3398f0(0x20d)]||_0x3ceb6f;break _0x227b15;}}}}return{'stageName':_0x5bfcf6,'criteriaName':_0x3f5032};}async function executeThreeStepJourneyCreate(_0x260eb5,_0x28e711,_0x29679d,_0x214d9f,_0x25e7bb,_0xa9e28f,_0x453856,_0x4d80b6){const _0x4a824f=a117_0x110a5,{activationDefToCreateRequest:_0x2fd272,yamlRuleToApi:_0x2c62a5}=_0x4d80b6,{pendingEmbeddedSegments:_0x115602,pendingEmbeddedActivations:_0x6c4488,embeddedSegmentNameToId:_0x364245}=_0x214d9f,_0x21ac80=JSON[_0x4a824f(0x20c)](JSON['stringify'](_0x29679d));ensureJourneyDefaults(_0x21ac80['attributes']),stripPendingIds(_0x21ac80);const _0x595d50=await _0x260eb5[_0x4a824f(0x15f)][_0x4a824f(0x217)](_0x21ac80),_0x3d3a93=_0x595d50['id'],_0xd76ecc=new Map();for(const _0x54c29e of _0x595d50['attributes'][_0x4a824f(0x195)]){_0xd76ecc[_0x4a824f(0x172)](_0x54c29e['name'][_0x4a824f(0x139)](),_0x54c29e['id']);}for(const [_0x1d44fb,{definition:_0x580589}]of _0x115602){const _0x9f37a7=generateDeterministicJourneySegmentName(_0x28e711[_0x4a824f(0x199)][_0x4a824f(0x20d)],_0x1d44fb);_0x453856['onProgress']?.({'type':'embedded_segment_creating','journeyName':_0x28e711['yamlConfig'][_0x4a824f(0x20d)],'segmentName':_0x1d44fb});const _0x4c61e7=createSegmentIdResolver(_0xa9e28f[_0x4a824f(0x13a)],_0x1d44fb),_0x387e3d=await resolveRuleSegmentIds(_0x580589[_0x4a824f(0x1cc)],_0x4c61e7),_0x1ec15a=await _0x260eb5[_0x4a824f(0x135)][_0x4a824f(0x175)]({'name':_0x9f37a7,'description':_0x580589[_0x4a824f(0x149)]||'Entry\x20criteria:\x20'+_0x1d44fb,'journeyId':_0x3d3a93,'rule':_0x2c62a5(_0x387e3d,!![]),'countPopulation':!![],'parentFolderId':_0x25e7bb[_0x4a824f(0x208)]||'','audienceId':_0x25e7bb['parentId']});_0x364245[_0x4a824f(0x172)](_0x1d44fb,_0x1ec15a),_0xa9e28f['segmentNameToId'][_0x4a824f(0x172)](_0x1d44fb,_0x1ec15a),_0x453856[_0x4a824f(0x1df)]?.({'type':_0x4a824f(0x203),'journeyName':_0x28e711['yamlConfig'][_0x4a824f(0x20d)],'segmentName':_0x1d44fb});}const _0x35f83e=new Map();for(const [_0x48b000,_0x3bc0fb]of _0x6c4488){_0x453856['onProgress']?.({'type':_0x4a824f(0x168),'journeyName':_0x28e711[_0x4a824f(0x199)][_0x4a824f(0x20d)],'activationName':_0x48b000});const _0x19495a=await _0x2fd272(_0x3bc0fb,_0xa9e28f['activationContext']),_0x4344df=await _0x260eb5[_0x4a824f(0x15f)][_0x4a824f(0x1f1)](_0x3d3a93,_0x19495a);_0x35f83e[_0x4a824f(0x172)](_0x48b000,_0x4344df['id']),_0x214d9f['journeyActivationNameToId'][_0x4a824f(0x172)](_0x48b000,_0x4344df['id']),_0x453856[_0x4a824f(0x1df)]?.({'type':'embedded_activation_created','journeyName':_0x28e711[_0x4a824f(0x199)][_0x4a824f(0x20d)],'activationName':_0x48b000});}const _0x36b505=JSON[_0x4a824f(0x20c)](JSON[_0x4a824f(0x136)](_0x29679d));return _0x36b505['id']=_0x3d3a93,ensureJourneyDefaults(_0x36b505[_0x4a824f(0x13d)]),resolvePendingIdsInRequest(_0x36b505,_0x29679d,_0xd76ecc,_0x364245,_0x35f83e,_0x453856),await _0x260eb5[_0x4a824f(0x15f)][_0x4a824f(0x16f)](_0x3d3a93,_0x36b505),{'action':'created','journeyId':_0x3d3a93,'embeddedSegmentNameToId':_0x364245};}function stripPendingIds(_0xd6064d){const _0x17f03f=a117_0x110a5;for(const _0x40066f of _0xd6064d['attributes'][_0x17f03f(0x195)]||[]){_0x40066f[_0x17f03f(0x1fb)]?.[_0x17f03f(0x162)]&&isPendingSegmentId(_0x40066f[_0x17f03f(0x1fb)]['segmentId'])&&delete _0x40066f[_0x17f03f(0x1fb)];if(_0x40066f['steps'])for(const _0x1279a0 of Object[_0x17f03f(0x178)](_0x40066f[_0x17f03f(0x1b6)])){const _0xe9bb3f=_0x40066f[_0x17f03f(0x1b6)][_0x1279a0];_0xe9bb3f[_0x17f03f(0x18b)]===_0x17f03f(0x1e6)&&_0xe9bb3f[_0x17f03f(0x1f6)]&&isPendingActivationId(_0xe9bb3f[_0x17f03f(0x1f6)])&&(_0xe9bb3f[_0x17f03f(0x1f6)]='');if(_0xe9bb3f[_0x17f03f(0x18b)]===_0x17f03f(0x163)&&_0xe9bb3f['branches'])for(const _0x4ff5af of _0xe9bb3f[_0x17f03f(0x143)]){_0x4ff5af[_0x17f03f(0x162)]&&isPendingSegmentId(_0x4ff5af['segmentId'])&&(_0x4ff5af['segmentId']='');}_0xe9bb3f[_0x17f03f(0x18b)]===_0x17f03f(0x141)&&_0xe9bb3f['waitCondition']?.[_0x17f03f(0x162)]&&isPendingSegmentId(_0xe9bb3f[_0x17f03f(0x1d9)]['segmentId'])&&(_0xe9bb3f[_0x17f03f(0x1d9)][_0x17f03f(0x162)]='');}}}function resolvePendingIdsInRequest(_0x266732,_0x705ceb,_0x9c532,_0x929c87,_0x10d506,_0x3846ed){const _0x181b28=a117_0x110a5,_0x169e69=(_0x2696cd,_0x4827fb)=>{const _0x372d48=a117_0x5c13;if(!isPendingSegmentId(_0x2696cd))return _0x2696cd;const _0x49dc45=extractPendingSegmentName(_0x2696cd),_0x77a96=_0x929c87['get'](_0x49dc45);return!_0x77a96&&_0x3846ed['logWarning']?.(_0x372d48(0x193)+_0x49dc45+_0x372d48(0x1bc)+_0x4827fb),_0x77a96;};if(_0x266732[_0x181b28(0x13d)]['goal']?.[_0x181b28(0x162)]&&isPendingSegmentId(_0x266732['attributes'][_0x181b28(0x200)][_0x181b28(0x162)])){const _0x16161a=_0x169e69(_0x266732[_0x181b28(0x13d)]['goal'][_0x181b28(0x162)],_0x181b28(0x176));_0x16161a&&(_0x266732[_0x181b28(0x13d)][_0x181b28(0x200)][_0x181b28(0x162)]=_0x16161a);}for(const _0xa3f437 of _0x266732[_0x181b28(0x13d)][_0x181b28(0x195)]||[]){const _0x1ee7a0=_0x9c532[_0x181b28(0x1ea)](_0xa3f437['name'][_0x181b28(0x139)]());_0x1ee7a0&&(_0xa3f437['id']=_0x1ee7a0);if(_0xa3f437[_0x181b28(0x1fb)]?.[_0x181b28(0x162)]&&isPendingSegmentId(_0xa3f437[_0x181b28(0x1fb)][_0x181b28(0x162)])){const _0x2002a3=_0x169e69(_0xa3f437[_0x181b28(0x1fb)][_0x181b28(0x162)],_0x181b28(0x15e)+_0xa3f437[_0x181b28(0x20d)]+_0x181b28(0x1cb));_0x2002a3&&(_0xa3f437['entryCriteria'][_0x181b28(0x162)]=_0x2002a3);}if(_0xa3f437[_0x181b28(0x16a)])for(const _0x1de4bf of _0xa3f437[_0x181b28(0x16a)]){if(_0x1de4bf[_0x181b28(0x162)]&&isPendingSegmentId(_0x1de4bf[_0x181b28(0x162)])){const _0x1748c7=_0x169e69(_0x1de4bf[_0x181b28(0x162)],_0x181b28(0x15e)+_0xa3f437['name']+_0x181b28(0x159));_0x1748c7&&(_0x1de4bf[_0x181b28(0x162)]=_0x1748c7);}}if(_0xa3f437['milestone']?.['segmentId']&&isPendingSegmentId(_0xa3f437['milestone'][_0x181b28(0x162)])){const _0x1f2601=_0x169e69(_0xa3f437[_0x181b28(0x19a)][_0x181b28(0x162)],'stage\x20\x27'+_0xa3f437[_0x181b28(0x20d)]+'\x27\x20milestone');_0x1f2601&&(_0xa3f437[_0x181b28(0x19a)][_0x181b28(0x162)]=_0x1f2601);}if(_0xa3f437[_0x181b28(0x1b6)]){const _0x4dd49a=_0x3e9b84=>_0x705ceb['attributes'][_0x181b28(0x195)][_0x181b28(0x21a)](_0x2d04af=>_0x2d04af[_0x181b28(0x20d)][_0x181b28(0x139)]()===_0xa3f437[_0x181b28(0x20d)][_0x181b28(0x139)]())?.['steps']?.[_0x3e9b84];for(const _0xbedbbe of Object['keys'](_0xa3f437[_0x181b28(0x1b6)])){const _0x17dc70=_0xa3f437[_0x181b28(0x1b6)][_0xbedbbe],_0x2e90e6=_0x4dd49a(_0xbedbbe);if(_0x17dc70[_0x181b28(0x18b)]===_0x181b28(0x1e6)&&_0x17dc70[_0x181b28(0x1f6)]&&(isPendingActivationId(_0x17dc70[_0x181b28(0x1f6)])||_0x17dc70[_0x181b28(0x1f6)]==='')){if(_0x2e90e6?.[_0x181b28(0x1f6)]&&isPendingActivationId(_0x2e90e6[_0x181b28(0x1f6)])){const _0x52ee94=extractPendingActivationName(_0x2e90e6[_0x181b28(0x1f6)]),_0x12284a=_0x10d506[_0x181b28(0x1ea)](_0x52ee94);_0x12284a&&(_0x17dc70['journeyActivationStepId']=_0x12284a);}}if(_0x17dc70[_0x181b28(0x18b)]===_0x181b28(0x163)&&_0x17dc70['branches']&&_0x2e90e6?.[_0x181b28(0x143)])for(let _0x4236c0=0x0;_0x4236c0<_0x17dc70[_0x181b28(0x143)]['length'];_0x4236c0++){const _0x456e4c=_0x17dc70[_0x181b28(0x143)][_0x4236c0],_0x347d21=_0x2e90e6['branches'][_0x4236c0];if(_0x347d21?.[_0x181b28(0x162)]&&isPendingSegmentId(_0x347d21[_0x181b28(0x162)])){const _0x12fee9=_0x169e69(_0x347d21['segmentId'],_0x181b28(0x15e)+_0xa3f437[_0x181b28(0x20d)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x456e4c[_0x181b28(0x20d)]||_0x4236c0)+'\x27');_0x12fee9&&(_0x456e4c[_0x181b28(0x162)]=_0x12fee9);}}if(_0x17dc70['type']===_0x181b28(0x141)&&_0x17dc70[_0x181b28(0x1d9)]?.[_0x181b28(0x162)]&&_0x2e90e6?.[_0x181b28(0x1d9)]?.[_0x181b28(0x162)]&&isPendingSegmentId(_0x2e90e6[_0x181b28(0x1d9)][_0x181b28(0x162)])){const _0x42061d=_0x169e69(_0x2e90e6['waitCondition']['segmentId'],_0x181b28(0x15e)+_0xa3f437[_0x181b28(0x20d)]+'\x27\x20wait\x20condition');_0x42061d&&(_0x17dc70[_0x181b28(0x1d9)][_0x181b28(0x162)]=_0x42061d);}}}}}
@@ -1 +1 @@
1
- (function(_0x454ecc,_0x2828d0){const _0x36adf0=a118_0x1ff2,_0x30d75c=_0x454ecc();while(!![]){try{const _0x5b339d=parseInt(_0x36adf0(0x159))/0x1+parseInt(_0x36adf0(0x156))/0x2+-parseInt(_0x36adf0(0x14e))/0x3+-parseInt(_0x36adf0(0x157))/0x4*(-parseInt(_0x36adf0(0x15c))/0x5)+-parseInt(_0x36adf0(0x158))/0x6*(parseInt(_0x36adf0(0x15b))/0x7)+parseInt(_0x36adf0(0x151))/0x8+-parseInt(_0x36adf0(0x155))/0x9*(parseInt(_0x36adf0(0x153))/0xa);if(_0x5b339d===_0x2828d0)break;else _0x30d75c['push'](_0x30d75c['shift']());}catch(_0x3490a5){_0x30d75c['push'](_0x30d75c['shift']());}}}(a118_0x3cea,0x92e6d));export function buildFolderIdToPathMap(_0x343203){const _0x2bc45b=a118_0x1ff2,_0x71ffc0=new Map(),_0x499e9e=new Map();for(const _0x484a06 of _0x343203){_0x499e9e['set'](_0x484a06['id'],_0x484a06);}const _0x2ba7bf=new Set();for(const _0x497037 of _0x343203){!_0x497037[_0x2bc45b(0x15a)]&&_0x2ba7bf[_0x2bc45b(0x14f)](_0x497037['id']);}function _0x4d2bfc(_0x1761f1){const _0x175138=_0x2bc45b;if(_0x71ffc0[_0x175138(0x152)](_0x1761f1['id']))return _0x71ffc0[_0x175138(0x150)](_0x1761f1['id']);if(_0x2ba7bf[_0x175138(0x152)](_0x1761f1['id']))return _0x71ffc0[_0x175138(0x154)](_0x1761f1['id'],''),'';if(_0x1761f1['parentFolderId']){const _0x5d3d99=_0x499e9e['get'](_0x1761f1['parentFolderId']);if(_0x5d3d99){const _0x3da4bc=_0x4d2bfc(_0x5d3d99),_0x1d07a3=_0x3da4bc?_0x3da4bc+'/'+_0x1761f1[_0x175138(0x14d)]:_0x1761f1[_0x175138(0x14d)];return _0x71ffc0[_0x175138(0x154)](_0x1761f1['id'],_0x1d07a3),_0x1d07a3;}}const _0x3844cb=_0x1761f1[_0x175138(0x14d)];return _0x71ffc0[_0x175138(0x154)](_0x1761f1['id'],_0x3844cb),_0x3844cb;}for(const _0x2a5e0d of _0x343203){_0x4d2bfc(_0x2a5e0d);}return _0x71ffc0;}export function buildFolderPathToIdMap(_0x3b407f){const _0x31c65d=a118_0x1ff2,_0x3efbfc=new Map(),_0x3312a7=new Map();for(const _0x466f97 of _0x3b407f){_0x3312a7[_0x31c65d(0x154)](_0x466f97['id'],_0x466f97);}const _0x33be03=new Set();for(const _0x4e775b of _0x3b407f){!_0x4e775b[_0x31c65d(0x15a)]&&_0x33be03['add'](_0x4e775b['id']);}function _0x52cdf4(_0x56b26d){const _0x40df96=_0x31c65d;if(_0x33be03['has'](_0x56b26d['id']))return'';if(_0x56b26d[_0x40df96(0x15a)]){const _0x7e3b41=_0x3312a7[_0x40df96(0x150)](_0x56b26d[_0x40df96(0x15a)]);if(_0x7e3b41){const _0x3cf78e=_0x52cdf4(_0x7e3b41);return _0x3cf78e?_0x3cf78e+'/'+_0x56b26d[_0x40df96(0x14d)]:_0x56b26d[_0x40df96(0x14d)];}}return _0x56b26d[_0x40df96(0x14d)];}for(const _0x4fda9b of _0x3b407f){const _0x18210d=_0x52cdf4(_0x4fda9b);_0x3efbfc[_0x31c65d(0x154)](_0x18210d,_0x4fda9b['id']);}return _0x3efbfc;}function a118_0x1ff2(_0x3333af,_0x5c93e6){_0x3333af=_0x3333af-0x14d;const _0x3ceae0=a118_0x3cea();let _0x1ff2ae=_0x3ceae0[_0x3333af];return _0x1ff2ae;}export function buildFolderMaps(_0x21307a){const _0x31f885=a118_0x1ff2,_0x5d21c5=buildFolderIdToPathMap(_0x21307a),_0xe01912=new Map();for(const [_0x3e370d,_0xaa1bfb]of _0x5d21c5){_0xe01912[_0x31f885(0x154)](_0xaa1bfb,_0x3e370d);}return{'idToPath':_0x5d21c5,'pathToId':_0xe01912};}export function getFolderPath(_0x5a7d65,_0x3cf511){const _0x46a05a=a118_0x1ff2;if(!_0x5a7d65)return'';return _0x3cf511[_0x46a05a(0x150)](_0x5a7d65)??'';}function a118_0x3cea(){const _0x3389c7=['184Fqmups','6MDgIQt','919083gPZHMc','parentFolderId','3160262hSgxjx','44635TRjhES','name','1521000qpCLkF','add','get','5047864isvodW','has','30SptSEE','set','1552671IJXgHU','234048HPLTBf'];a118_0x3cea=function(){return _0x3389c7;};return a118_0x3cea();}
1
+ function a118_0x3936(){const _0x2f015f=['get','6031319ZZARRZ','1274HrxjTH','6TkoZSQ','198NozMWC','add','3326345OOBnjj','1422Ysaicd','parentFolderId','10961995egRSco','3057070baxXaW','84848UnVyrX','name','1244tRukOm','66920SzxNRZ','set','has'];a118_0x3936=function(){return _0x2f015f;};return a118_0x3936();}(function(_0x3253fb,_0x44e65e){const _0x588f54=a118_0x4a42,_0x110094=_0x3253fb();while(!![]){try{const _0x4d46de=parseInt(_0x588f54(0x1be))/0x1*(-parseInt(_0x588f54(0x1b8))/0x2)+parseInt(_0x588f54(0x1c0))/0x3*(-parseInt(_0x588f54(0x1b9))/0x4)+parseInt(_0x588f54(0x1c2))/0x5+parseInt(_0x588f54(0x1bf))/0x6*(-parseInt(_0x588f54(0x1bd))/0x7)+parseInt(_0x588f54(0x1c7))/0x8*(parseInt(_0x588f54(0x1c3))/0x9)+parseInt(_0x588f54(0x1c6))/0xa+parseInt(_0x588f54(0x1c5))/0xb;if(_0x4d46de===_0x44e65e)break;else _0x110094['push'](_0x110094['shift']());}catch(_0x151887){_0x110094['push'](_0x110094['shift']());}}}(a118_0x3936,0xd8134));export function buildFolderIdToPathMap(_0x15a3d3){const _0x59a4ae=a118_0x4a42,_0x3077df=new Map(),_0x7cb6b1=new Map();for(const _0x480ee4 of _0x15a3d3){_0x7cb6b1[_0x59a4ae(0x1ba)](_0x480ee4['id'],_0x480ee4);}const _0x34fea4=new Set();for(const _0x9fb84e of _0x15a3d3){!_0x9fb84e[_0x59a4ae(0x1c4)]&&_0x34fea4[_0x59a4ae(0x1c1)](_0x9fb84e['id']);}function _0x56d401(_0x35050f){const _0x5dd7e5=_0x59a4ae;if(_0x3077df[_0x5dd7e5(0x1bb)](_0x35050f['id']))return _0x3077df[_0x5dd7e5(0x1bc)](_0x35050f['id']);if(_0x34fea4['has'](_0x35050f['id']))return _0x3077df[_0x5dd7e5(0x1ba)](_0x35050f['id'],''),'';if(_0x35050f[_0x5dd7e5(0x1c4)]){const _0x394223=_0x7cb6b1[_0x5dd7e5(0x1bc)](_0x35050f['parentFolderId']);if(_0x394223){const _0x43b595=_0x56d401(_0x394223),_0x9b4f18=_0x43b595?_0x43b595+'/'+_0x35050f[_0x5dd7e5(0x1b7)]:_0x35050f['name'];return _0x3077df[_0x5dd7e5(0x1ba)](_0x35050f['id'],_0x9b4f18),_0x9b4f18;}}const _0x17d9c4=_0x35050f[_0x5dd7e5(0x1b7)];return _0x3077df[_0x5dd7e5(0x1ba)](_0x35050f['id'],_0x17d9c4),_0x17d9c4;}for(const _0x1018e6 of _0x15a3d3){_0x56d401(_0x1018e6);}return _0x3077df;}export function buildFolderPathToIdMap(_0x4874f0){const _0x14346a=a118_0x4a42,_0x26331d=new Map(),_0x53e14c=new Map();for(const _0x3dc4fb of _0x4874f0){_0x53e14c[_0x14346a(0x1ba)](_0x3dc4fb['id'],_0x3dc4fb);}const _0x41796f=new Set();for(const _0x3359f8 of _0x4874f0){!_0x3359f8['parentFolderId']&&_0x41796f[_0x14346a(0x1c1)](_0x3359f8['id']);}function _0x239ef0(_0x416b05){const _0x6c82e7=_0x14346a;if(_0x41796f[_0x6c82e7(0x1bb)](_0x416b05['id']))return'';if(_0x416b05[_0x6c82e7(0x1c4)]){const _0x4eb470=_0x53e14c[_0x6c82e7(0x1bc)](_0x416b05[_0x6c82e7(0x1c4)]);if(_0x4eb470){const _0x65887c=_0x239ef0(_0x4eb470);return _0x65887c?_0x65887c+'/'+_0x416b05['name']:_0x416b05[_0x6c82e7(0x1b7)];}}return _0x416b05[_0x6c82e7(0x1b7)];}for(const _0x4c420e of _0x4874f0){const _0x22a920=_0x239ef0(_0x4c420e);_0x26331d['set'](_0x22a920,_0x4c420e['id']);}return _0x26331d;}function a118_0x4a42(_0x584253,_0x4aee81){_0x584253=_0x584253-0x1b7;const _0x393695=a118_0x3936();let _0x4a42a2=_0x393695[_0x584253];return _0x4a42a2;}export function buildFolderMaps(_0x30d795){const _0x39a1ca=a118_0x4a42,_0x17f04f=buildFolderIdToPathMap(_0x30d795),_0xbceadb=new Map();for(const [_0x16fe5d,_0x33c2f6]of _0x17f04f){_0xbceadb[_0x39a1ca(0x1ba)](_0x33c2f6,_0x16fe5d);}return{'idToPath':_0x17f04f,'pathToId':_0xbceadb};}export function getFolderPath(_0x14f41f,_0x236448){const _0x2fc029=a118_0x4a42;if(!_0x14f41f)return'';return _0x236448[_0x2fc029(0x1bc)](_0x14f41f)??'';}
@@ -1 +1 @@
1
- (function(_0xe935fa,_0x145871){const _0x507aaf=a119_0x6005,_0xe599ea=_0xe935fa();while(!![]){try{const _0x393e2a=-parseInt(_0x507aaf(0x134))/0x1*(-parseInt(_0x507aaf(0x12b))/0x2)+parseInt(_0x507aaf(0x131))/0x3*(parseInt(_0x507aaf(0x12f))/0x4)+-parseInt(_0x507aaf(0x127))/0x5*(parseInt(_0x507aaf(0x11b))/0x6)+-parseInt(_0x507aaf(0x130))/0x7*(parseInt(_0x507aaf(0x112))/0x8)+-parseInt(_0x507aaf(0x120))/0x9+parseInt(_0x507aaf(0x11c))/0xa*(-parseInt(_0x507aaf(0x110))/0xb)+parseInt(_0x507aaf(0x11a))/0xc;if(_0x393e2a===_0x145871)break;else _0xe599ea['push'](_0xe599ea['shift']());}catch(_0x46c878){_0xe599ea['push'](_0xe599ea['shift']());}}}(a119_0x593a,0x9a8c7));import a119_0x456b12 from'path';import{parse as a119_0xac5864}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a119_0x6005(_0x53957b,_0x59bbfb){_0x53957b=_0x53957b-0x110;const _0x593a9a=a119_0x593a();let _0x600567=_0x593a9a[_0x53957b];return _0x600567;}export function parsePath(_0x5db6c4){const _0x210ff7=a119_0x6005;if(!_0x5db6c4||_0x5db6c4[_0x210ff7(0x135)]()==='')throw new Error(_0x210ff7(0x128));const _0x687e48=_0x5db6c4[_0x210ff7(0x135)]();if(_0x687e48==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5db6c4};const _0x3c1f92=_0x687e48[_0x210ff7(0x121)]('/')?_0x687e48['substring'](0x1):_0x687e48,_0x597d23=_0x3c1f92[_0x210ff7(0x11e)]('/')[_0x210ff7(0x11f)](_0x26f4d4=>_0x26f4d4!=='');if(_0x597d23[_0x210ff7(0x118)]===0x0)throw new Error(_0x210ff7(0x123));const _0x4b4aa1=_0x687e48['startsWith']('/')||!isRelativePathSegment(_0x597d23[0x0]);for(const _0x461365 of _0x597d23){validatePathSegment(_0x461365);}return{'segments':_0x597d23,'isAbsolute':_0x4b4aa1,'raw':_0x5db6c4};}function a119_0x593a(){const _0x1c4e08=['relative','8YaPXVt','.yaml','journey','endsWith','Cannot\x20navigate\x20above\x20root','type','length','dirname','26527908IVbPEn','16230bwVjzC','2370zcxYlD','isAbsolute','split','filter','2416113aCwuHt','startsWith','Path\x20segment\x20cannot\x20be\x20empty','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','raw','resolve','No\x20tdx.json\x20found\x20for\x20file:\x20','2155LBRDnb','Path\x20cannot\x20be\x20empty','push','name','166442vPOPJp','join','segments','exists','20bWoQPb','1691277VdzHMT','466461OuHjvN','tdx.json','pop','3nyyfBT','trim','parse','slice','43109rXppTI'];a119_0x593a=function(){return _0x1c4e08;};return a119_0x593a();}function isRelativePathSegment(_0x5405a2){return _0x5405a2==='.'||_0x5405a2==='..';}function validatePathSegment(_0x2be110){const _0x4ffb9f=a119_0x6005;if(_0x2be110==='')throw new Error(_0x4ffb9f(0x122));if(_0x2be110==='.'||_0x2be110==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x2be110))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x2be110);if(_0x2be110!==_0x2be110[_0x4ffb9f(0x135)]()){}}export function validatePath(_0x581f8f){const _0x3282db=a119_0x6005;if(_0x581f8f[_0x3282db(0x12d)][_0x3282db(0x118)]===0x0&&!_0x581f8f[_0x3282db(0x11d)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x581f8f[_0x3282db(0x11d)]){if(_0x581f8f[_0x3282db(0x12d)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x57b1d3=0x0;for(const _0x3c953c of _0x581f8f[_0x3282db(0x12d)]){if(_0x3c953c==='..'){if(_0x57b1d3===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x57b1d3--;}else _0x3c953c!=='.'&&_0x57b1d3++;}}}export function joinPaths(_0x3bc6ac,_0x2c74b6){const _0x538550=a119_0x6005;if(!_0x3bc6ac||_0x3bc6ac==='/')return _0x2c74b6;if(!_0x2c74b6||_0x2c74b6==='.')return _0x3bc6ac;if(_0x2c74b6[_0x538550(0x121)]('/'))return _0x2c74b6;const _0x17d652=parsePath(_0x3bc6ac),_0x24e2c9=parsePath(_0x2c74b6),_0x5de308=[..._0x17d652[_0x538550(0x12d)]];for(const _0x2ebf78 of _0x24e2c9['segments']){if(_0x2ebf78==='.')continue;else{if(_0x2ebf78==='..'){if(_0x5de308['length']===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x5de308[_0x538550(0x133)]();}else _0x5de308[_0x538550(0x129)](_0x2ebf78);}}const _0x58a637=_0x5de308['join']('/');return _0x17d652[_0x538550(0x124)][_0x538550(0x121)]('/')?'/'+_0x58a637:_0x58a637;}export function normalizePath(_0x17460c){const _0x47da0b=a119_0x6005,_0x3b696d=parsePath(_0x17460c),_0x5dc480=[];for(const _0x10bcb7 of _0x3b696d[_0x47da0b(0x12d)]){if(_0x10bcb7==='.')continue;else{if(_0x10bcb7==='..'){if(_0x5dc480[_0x47da0b(0x118)]===0x0){if(_0x3b696d[_0x47da0b(0x11d)])throw new Error(_0x47da0b(0x116));_0x5dc480[_0x47da0b(0x129)]('..');}else _0x5dc480[_0x5dc480['length']-0x1]==='..'?_0x5dc480[_0x47da0b(0x129)]('..'):_0x5dc480['pop']();}else _0x5dc480[_0x47da0b(0x129)](_0x10bcb7);}}if(_0x5dc480['length']===0x0)return _0x3b696d[_0x47da0b(0x11d)]?'/':'.';const _0x57b901=_0x5dc480['join']('/');return _0x3b696d[_0x47da0b(0x124)][_0x47da0b(0x121)]('/')?'/'+_0x57b901:_0x57b901;}export function getParentPath(_0xa565b){const _0x48df27=a119_0x6005,_0x5eac66=parsePath(_0xa565b);if(_0x5eac66[_0x48df27(0x12d)]['length']<=0x1)return'/';const _0x41e7ff=_0x5eac66[_0x48df27(0x12d)][_0x48df27(0x137)](0x0,-0x1)[_0x48df27(0x12c)]('/');return _0x5eac66[_0x48df27(0x124)][_0x48df27(0x121)]('/')?'/'+_0x41e7ff:_0x41e7ff;}export function getBaseName(_0x4efedb){const _0x2e6968=a119_0x6005,_0x31d76c=parsePath(_0x4efedb);return _0x31d76c[_0x2e6968(0x12d)][_0x31d76c[_0x2e6968(0x12d)][_0x2e6968(0x118)]-0x1]||'';}export function isChildPath(_0x390aa6,_0x1d1446){const _0x2aeb35=a119_0x6005,_0x40179a=parsePath(_0x390aa6),_0x4ac085=parsePath(_0x1d1446);if(_0x40179a['segments'][_0x2aeb35(0x118)]<=_0x4ac085[_0x2aeb35(0x12d)][_0x2aeb35(0x118)])return![];for(let _0x9949e4=0x0;_0x9949e4<_0x4ac085[_0x2aeb35(0x12d)][_0x2aeb35(0x118)];_0x9949e4++){if(_0x40179a[_0x2aeb35(0x12d)][_0x9949e4]!==_0x4ac085[_0x2aeb35(0x12d)][_0x9949e4])return![];}return!![];}export function splitPath(_0x20e54a){const _0x566eb0=a119_0x6005,_0x569a80=parsePath(_0x20e54a);if(_0x569a80['segments'][_0x566eb0(0x118)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x569a80[_0x566eb0(0x12d)][_0x566eb0(0x118)]===0x1)return{'parent':_0x569a80[_0x566eb0(0x12d)][0x0]};return{'parent':_0x569a80[_0x566eb0(0x12d)][0x0],'child':_0x569a80[_0x566eb0(0x12d)][_0x566eb0(0x137)](0x1)['join']('/')};}export function isYamlFilePath(_0x31a4ab){const _0x5a408c=a119_0x6005;return _0x31a4ab[_0x5a408c(0x115)]('.yml')||_0x31a4ab['endsWith'](_0x5a408c(0x113));}export async function resolveYamlFilePath(_0x2f03c1,_0x2df255=nodeFileSystem){const _0x1f66a1=a119_0x6005,_0x5a00cf=a119_0x456b12[_0x1f66a1(0x125)](_0x2f03c1);if(!await _0x2df255['exists'](_0x5a00cf))throw new Error('File\x20not\x20found:\x20'+_0x2f03c1);let _0x5b9954=a119_0x456b12[_0x1f66a1(0x119)](_0x5a00cf),_0x456896=null,_0x5b9d49=null;const _0x13a8b5=a119_0x456b12[_0x1f66a1(0x136)](_0x5b9954)['root'];while(_0x5b9954!==_0x13a8b5){const _0x29d7a3=a119_0x456b12[_0x1f66a1(0x12c)](_0x5b9954,_0x1f66a1(0x132));if(await _0x2df255[_0x1f66a1(0x12e)](_0x29d7a3)){_0x456896=_0x29d7a3,_0x5b9d49=_0x5b9954;break;}_0x5b9954=a119_0x456b12[_0x1f66a1(0x119)](_0x5b9954);}if(!_0x456896||!_0x5b9d49)throw new Error(_0x1f66a1(0x126)+_0x2f03c1);const _0xd95b45=await _0x2df255['readFile'](_0x456896),_0x28a1a1=JSON[_0x1f66a1(0x136)](_0xd95b45),_0x436856=_0x28a1a1['parent_segment'];if(!_0x436856)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0xb39154=await _0x2df255['readFile'](_0x5a00cf),_0x17268c=a119_0xac5864(_0xb39154),_0x3aa8be=_0x17268c[_0x1f66a1(0x12a)];if(!_0x3aa8be)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x2f03c1);const _0x2585c2=_0x17268c[_0x1f66a1(0x117)]===_0x1f66a1(0x114)?_0x1f66a1(0x114):'segment',_0x319f78=a119_0x456b12[_0x1f66a1(0x111)](_0x5b9d49,_0x5a00cf),_0x1e05e4=a119_0x456b12['dirname'](_0x319f78),_0x39e093=_0x1e05e4==='.'?'':_0x1e05e4['replace'](/\\/g,'/'),_0x2d13e4=_0x39e093?_0x436856+'/'+_0x39e093+'/'+_0x3aa8be:_0x436856+'/'+_0x3aa8be;return{'parentSegment':_0x436856,'segmentName':_0x3aa8be,'folderPath':_0x39e093,'fullPath':_0x2d13e4,'resourceType':_0x2585c2};}
1
+ (function(_0x426e76,_0x2209bd){const _0x5cde55=a119_0x141c,_0x3280a6=_0x426e76();while(!![]){try{const _0x1dc0c8=parseInt(_0x5cde55(0x102))/0x1*(parseInt(_0x5cde55(0xde))/0x2)+-parseInt(_0x5cde55(0xe6))/0x3*(-parseInt(_0x5cde55(0xee))/0x4)+parseInt(_0x5cde55(0xdf))/0x5*(-parseInt(_0x5cde55(0xda))/0x6)+parseInt(_0x5cde55(0xf1))/0x7*(parseInt(_0x5cde55(0xfb))/0x8)+parseInt(_0x5cde55(0xe7))/0x9*(-parseInt(_0x5cde55(0xdd))/0xa)+parseInt(_0x5cde55(0x103))/0xb+-parseInt(_0x5cde55(0xeb))/0xc*(-parseInt(_0x5cde55(0xed))/0xd);if(_0x1dc0c8===_0x2209bd)break;else _0x3280a6['push'](_0x3280a6['shift']());}catch(_0x241aa8){_0x3280a6['push'](_0x3280a6['shift']());}}}(a119_0x2a05,0x82bd2));import a119_0x23a9bb from'path';import{parse as a119_0x33b1e7}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x318757){const _0x3cd863=a119_0x141c;if(!_0x318757||_0x318757[_0x3cd863(0xe0)]()==='')throw new Error(_0x3cd863(0xec));const _0x3019dd=_0x318757['trim']();if(_0x3019dd==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x318757};const _0x4ab478=_0x3019dd[_0x3cd863(0xfa)]('/')?_0x3019dd['substring'](0x1):_0x3019dd,_0x5cacf1=_0x4ab478[_0x3cd863(0x101)]('/')[_0x3cd863(0xff)](_0x1e00cd=>_0x1e00cd!=='');if(_0x5cacf1[_0x3cd863(0xd6)]===0x0)throw new Error(_0x3cd863(0xdb));const _0x4853ed=_0x3019dd['startsWith']('/')||!isRelativePathSegment(_0x5cacf1[0x0]);for(const _0x445327 of _0x5cacf1){validatePathSegment(_0x445327);}return{'segments':_0x5cacf1,'isAbsolute':_0x4853ed,'raw':_0x318757};}function isRelativePathSegment(_0x14ae03){return _0x14ae03==='.'||_0x14ae03==='..';}function validatePathSegment(_0x885e96){const _0x5d4230=a119_0x141c;if(_0x885e96==='')throw new Error(_0x5d4230(0xf9));if(_0x885e96==='.'||_0x885e96==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x885e96))throw new Error(_0x5d4230(0xd8)+_0x885e96);if(_0x885e96!==_0x885e96[_0x5d4230(0xe0)]()){}}export function validatePath(_0x3478cc){const _0x3a23a7=a119_0x141c;if(_0x3478cc[_0x3a23a7(0xf7)][_0x3a23a7(0xd6)]===0x0&&!_0x3478cc[_0x3a23a7(0xe5)])throw new Error(_0x3a23a7(0xe2));if(_0x3478cc[_0x3a23a7(0xe5)]){if(_0x3478cc[_0x3a23a7(0xf7)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x80f92a=0x0;for(const _0x56d813 of _0x3478cc['segments']){if(_0x56d813==='..'){if(_0x80f92a===0x0)throw new Error(_0x3a23a7(0xe3));_0x80f92a--;}else _0x56d813!=='.'&&_0x80f92a++;}}}export function joinPaths(_0x4f6ec2,_0x21cbcd){const _0x15c9af=a119_0x141c;if(!_0x4f6ec2||_0x4f6ec2==='/')return _0x21cbcd;if(!_0x21cbcd||_0x21cbcd==='.')return _0x4f6ec2;if(_0x21cbcd[_0x15c9af(0xfa)]('/'))return _0x21cbcd;const _0x32f1a5=parsePath(_0x4f6ec2),_0x5a0218=parsePath(_0x21cbcd),_0x4a7e7f=[..._0x32f1a5[_0x15c9af(0xf7)]];for(const _0x168d0d of _0x5a0218[_0x15c9af(0xf7)]){if(_0x168d0d==='.')continue;else{if(_0x168d0d==='..'){if(_0x4a7e7f['length']===0x0)throw new Error(_0x15c9af(0x107));_0x4a7e7f[_0x15c9af(0xea)]();}else _0x4a7e7f[_0x15c9af(0x104)](_0x168d0d);}}const _0x5db7da=_0x4a7e7f['join']('/');return _0x32f1a5['raw']['startsWith']('/')?'/'+_0x5db7da:_0x5db7da;}export function normalizePath(_0x17762c){const _0x5505f3=a119_0x141c,_0x215b33=parsePath(_0x17762c),_0xac318c=[];for(const _0x4d3db1 of _0x215b33[_0x5505f3(0xf7)]){if(_0x4d3db1==='.')continue;else{if(_0x4d3db1==='..'){if(_0xac318c[_0x5505f3(0xd6)]===0x0){if(_0x215b33[_0x5505f3(0xe5)])throw new Error(_0x5505f3(0x107));_0xac318c[_0x5505f3(0x104)]('..');}else _0xac318c[_0xac318c[_0x5505f3(0xd6)]-0x1]==='..'?_0xac318c[_0x5505f3(0x104)]('..'):_0xac318c[_0x5505f3(0xea)]();}else _0xac318c['push'](_0x4d3db1);}}if(_0xac318c[_0x5505f3(0xd6)]===0x0)return _0x215b33['isAbsolute']?'/':'.';const _0x4f2168=_0xac318c[_0x5505f3(0xf5)]('/');return _0x215b33[_0x5505f3(0xe4)][_0x5505f3(0xfa)]('/')?'/'+_0x4f2168:_0x4f2168;}function a119_0x2a05(){const _0x318d24=['length','replace','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','tdx.json','1254GYCGcS','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','name','530XMRZpJ','59510tCfnSw','23910oUXriv','trim','No\x20tdx.json\x20found\x20for\x20file:\x20','Relative\x20path\x20cannot\x20be\x20empty','Path\x20attempts\x20to\x20navigate\x20above\x20root','raw','isAbsolute','69792qFjJsw','162189yOfGNm','Cannot\x20split\x20empty\x20path','relative','pop','221172gruOvk','Path\x20cannot\x20be\x20empty','13hOIeEM','172mDlRbW','slice','parent_segment','3326666SOvNTh','exists','File\x20not\x20found:\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','join','parse','segments','.yml','Path\x20segment\x20cannot\x20be\x20empty','startsWith','16ahwGzQ','readFile','type','.yaml','filter','dirname','split','3naFxDP','4746863EqfEiV','push','journey','endsWith','Cannot\x20navigate\x20above\x20root'];a119_0x2a05=function(){return _0x318d24;};return a119_0x2a05();}export function getParentPath(_0x44be71){const _0x2420a4=a119_0x141c,_0x14a09e=parsePath(_0x44be71);if(_0x14a09e['segments'][_0x2420a4(0xd6)]<=0x1)return'/';const _0x5e6538=_0x14a09e[_0x2420a4(0xf7)]['slice'](0x0,-0x1)[_0x2420a4(0xf5)]('/');return _0x14a09e['raw'][_0x2420a4(0xfa)]('/')?'/'+_0x5e6538:_0x5e6538;}export function getBaseName(_0x436aae){const _0x35428f=a119_0x141c,_0x5e2460=parsePath(_0x436aae);return _0x5e2460[_0x35428f(0xf7)][_0x5e2460[_0x35428f(0xf7)][_0x35428f(0xd6)]-0x1]||'';}function a119_0x141c(_0x1903b8,_0x476066){_0x1903b8=_0x1903b8-0xd6;const _0x2a0519=a119_0x2a05();let _0x141cd9=_0x2a0519[_0x1903b8];return _0x141cd9;}export function isChildPath(_0x1519de,_0x6be6d9){const _0x1e263d=a119_0x141c,_0x52d8d7=parsePath(_0x1519de),_0x1688ca=parsePath(_0x6be6d9);if(_0x52d8d7[_0x1e263d(0xf7)][_0x1e263d(0xd6)]<=_0x1688ca[_0x1e263d(0xf7)][_0x1e263d(0xd6)])return![];for(let _0x1d9483=0x0;_0x1d9483<_0x1688ca[_0x1e263d(0xf7)][_0x1e263d(0xd6)];_0x1d9483++){if(_0x52d8d7[_0x1e263d(0xf7)][_0x1d9483]!==_0x1688ca[_0x1e263d(0xf7)][_0x1d9483])return![];}return!![];}export function splitPath(_0x43dc9f){const _0x3ae951=a119_0x141c,_0x1a1660=parsePath(_0x43dc9f);if(_0x1a1660[_0x3ae951(0xf7)][_0x3ae951(0xd6)]===0x0)throw new Error(_0x3ae951(0xe8));if(_0x1a1660[_0x3ae951(0xf7)][_0x3ae951(0xd6)]===0x1)return{'parent':_0x1a1660['segments'][0x0]};return{'parent':_0x1a1660[_0x3ae951(0xf7)][0x0],'child':_0x1a1660[_0x3ae951(0xf7)][_0x3ae951(0xef)](0x1)[_0x3ae951(0xf5)]('/')};}export function isYamlFilePath(_0x281eed){const _0x1b1de2=a119_0x141c;return _0x281eed['endsWith'](_0x1b1de2(0xf8))||_0x281eed[_0x1b1de2(0x106)](_0x1b1de2(0xfe));}export async function resolveYamlFilePath(_0x400863,_0x1303a1=nodeFileSystem){const _0x5ac827=a119_0x141c,_0x54d3a4=a119_0x23a9bb['resolve'](_0x400863);if(!await _0x1303a1['exists'](_0x54d3a4))throw new Error(_0x5ac827(0xf3)+_0x400863);let _0x46f2e7=a119_0x23a9bb[_0x5ac827(0x100)](_0x54d3a4),_0x1eab96=null,_0x1dc7ab=null;const _0x42ba2a=a119_0x23a9bb['parse'](_0x46f2e7)['root'];while(_0x46f2e7!==_0x42ba2a){const _0x410af4=a119_0x23a9bb[_0x5ac827(0xf5)](_0x46f2e7,_0x5ac827(0xd9));if(await _0x1303a1[_0x5ac827(0xf2)](_0x410af4)){_0x1eab96=_0x410af4,_0x1dc7ab=_0x46f2e7;break;}_0x46f2e7=a119_0x23a9bb[_0x5ac827(0x100)](_0x46f2e7);}if(!_0x1eab96||!_0x1dc7ab)throw new Error(_0x5ac827(0xe1)+_0x400863);const _0xb59ed1=await _0x1303a1[_0x5ac827(0xfc)](_0x1eab96),_0x5e0d86=JSON[_0x5ac827(0xf6)](_0xb59ed1),_0x4c50d2=_0x5e0d86[_0x5ac827(0xf0)];if(!_0x4c50d2)throw new Error(_0x5ac827(0xf4));const _0x29ca06=await _0x1303a1[_0x5ac827(0xfc)](_0x54d3a4),_0x113e82=a119_0x33b1e7(_0x29ca06),_0x5d65dd=_0x113e82[_0x5ac827(0xdc)];if(!_0x5d65dd)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x400863);const _0x2b9f38=_0x113e82[_0x5ac827(0xfd)]===_0x5ac827(0x105)?_0x5ac827(0x105):'segment',_0x245922=a119_0x23a9bb[_0x5ac827(0xe9)](_0x1dc7ab,_0x54d3a4),_0x49bbc5=a119_0x23a9bb['dirname'](_0x245922),_0x57192b=_0x49bbc5==='.'?'':_0x49bbc5[_0x5ac827(0xd7)](/\\/g,'/'),_0xaac759=_0x57192b?_0x4c50d2+'/'+_0x57192b+'/'+_0x5d65dd:_0x4c50d2+'/'+_0x5d65dd;return{'parentSegment':_0x4c50d2,'segmentName':_0x5d65dd,'folderPath':_0x57192b,'fullPath':_0xaac759,'resourceType':_0x2b9f38};}
@@ -1 +1 @@
1
- (function(_0xf78933,_0x349144){const _0x288e3f=a120_0x1b70,_0x3d20a8=_0xf78933();while(!![]){try{const _0x5f0a09=parseInt(_0x288e3f(0x1e8))/0x1*(-parseInt(_0x288e3f(0x1f0))/0x2)+parseInt(_0x288e3f(0x1eb))/0x3+parseInt(_0x288e3f(0x1f2))/0x4+parseInt(_0x288e3f(0x1e5))/0x5*(parseInt(_0x288e3f(0x1e9))/0x6)+parseInt(_0x288e3f(0x1f1))/0x7+parseInt(_0x288e3f(0x1ef))/0x8*(parseInt(_0x288e3f(0x1ee))/0x9)+parseInt(_0x288e3f(0x1ed))/0xa*(-parseInt(_0x288e3f(0x1e4))/0xb);if(_0x5f0a09===_0x349144)break;else _0x3d20a8['push'](_0x3d20a8['shift']());}catch(_0x555177){_0x3d20a8['push'](_0x3d20a8['shift']());}}}(a120_0x3cc0,0xd0c65));export function parseSegmentRef(_0x3fa572){const _0x6842d5=a120_0x1b70,_0x432e97=_0x3fa572[_0x6842d5(0x1e6)]('/');if(_0x432e97===-0x1)return{'parentId':_0x3fa572};if(_0x432e97===0x0)throw new Error(_0x6842d5(0x1ec)+_0x3fa572+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x31deca=_0x3fa572[_0x6842d5(0x1ea)](0x0,_0x432e97),_0x21eb9a=_0x3fa572[_0x6842d5(0x1ea)](_0x432e97+0x1);if(_0x21eb9a==='')throw new Error(_0x6842d5(0x1ec)+_0x3fa572+_0x6842d5(0x1e7));return{'parentId':_0x31deca,'childId':_0x21eb9a};}function a120_0x1b70(_0x473620,_0x56574e){_0x473620=_0x473620-0x1e4;const _0x3cc02f=a120_0x3cc0();let _0x1b7098=_0x3cc02f[_0x473620];return _0x1b7098;}function a120_0x3cc0(){const _0x2edba9=['568xikQwL','1062NpGcjD','7042882uAuvxM','5717476LzwDLz','1444641IwEejP','4280865ewOLsh','indexOf','.\x20Child\x20name\x20cannot\x20be\x20empty','202VIaVbm','6rDYoGt','substring','888954CfuUcE','Invalid\x20segment\x20reference\x20format:\x20','260cypxLA','100017PdewPa'];a120_0x3cc0=function(){return _0x2edba9;};return a120_0x3cc0();}
1
+ (function(_0x4fb40e,_0x4fb9fd){const _0xce8d9=a120_0x573f,_0x247951=_0x4fb40e();while(!![]){try{const _0x4ea81a=parseInt(_0xce8d9(0xa3))/0x1+-parseInt(_0xce8d9(0x9d))/0x2+-parseInt(_0xce8d9(0xa2))/0x3*(-parseInt(_0xce8d9(0x9b))/0x4)+parseInt(_0xce8d9(0xa5))/0x5+-parseInt(_0xce8d9(0xa1))/0x6+parseInt(_0xce8d9(0x9a))/0x7+parseInt(_0xce8d9(0x99))/0x8*(-parseInt(_0xce8d9(0xa4))/0x9);if(_0x4ea81a===_0x4fb9fd)break;else _0x247951['push'](_0x247951['shift']());}catch(_0x186ebc){_0x247951['push'](_0x247951['shift']());}}}(a120_0x47cd,0x2974b));function a120_0x573f(_0x1f811d,_0x451b10){_0x1f811d=_0x1f811d-0x99;const _0x47cdc8=a120_0x47cd();let _0x573f7a=_0x47cdc8[_0x1f811d];return _0x573f7a;}function a120_0x47cd(){const _0x963ba9=['352665sWUczD','1002435ThqyTa','8mxwViU','1543031BeGDzG','46796LWVtNp','.\x20Child\x20name\x20cannot\x20be\x20empty','223190alhcJq','Invalid\x20segment\x20reference\x20format:\x20','indexOf','.\x20Parent\x20name\x20cannot\x20be\x20empty','1861980KZHXxA','3mivUVB','198294vArAaS'];a120_0x47cd=function(){return _0x963ba9;};return a120_0x47cd();}export function parseSegmentRef(_0x54ba8a){const _0x2e9e66=a120_0x573f,_0x59873a=_0x54ba8a[_0x2e9e66(0x9f)]('/');if(_0x59873a===-0x1)return{'parentId':_0x54ba8a};if(_0x59873a===0x0)throw new Error(_0x2e9e66(0x9e)+_0x54ba8a+_0x2e9e66(0xa0));const _0x448c3a=_0x54ba8a['substring'](0x0,_0x59873a),_0x11a8db=_0x54ba8a['substring'](_0x59873a+0x1);if(_0x11a8db==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x54ba8a+_0x2e9e66(0x9c));return{'parentId':_0x448c3a,'childId':_0x11a8db};}
@@ -1 +1 @@
1
- function a121_0x20a4(_0x53cfe0,_0x32ff12){_0x53cfe0=_0x53cfe0-0x1dc;const _0xad15aa=a121_0xad15();let _0x20a468=_0xad15aa[_0x53cfe0];return _0x20a468;}function a121_0xad15(){const _0x5b75c0=['context','733fCpieT','file_not_found','3252srmsvN','29381gnPMQO','scopedFolderPath','basename','260748fGqijO','type','no_parent','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','File\x20not\x20found:\x20','1548267lJqbQZ','readFile','parse','segment','invalid_yaml','resolve','relative','journey','196htmQMB','isScoped','resourceType','Parent\x20segment\x20not\x20specified','directory','string','cwd','No\x20tdx.json\x20found\x20for\x20file:\x20','root','segmentName','parentSegment','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','error','1697552gHDIXE','6grJkpK','No\x20tdx.json\x20found','exists','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','14fMTsZo','stat','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parent_segment','isFile','no_config','folderPath','configDir','match','includes','isDirectory','file','35nProwj','trim','394476RNBuNB','80OmrhOZ','dirname'];a121_0xad15=function(){return _0x5b75c0;};return a121_0xad15();}(function(_0x2b3083,_0x4bd792){const _0x179664=a121_0x20a4,_0x16b2f7=_0x2b3083();while(!![]){try{const _0x129e47=parseInt(_0x179664(0x1fa))/0x1*(-parseInt(_0x179664(0x1e8))/0x2)+parseInt(_0x179664(0x1f6))/0x3+parseInt(_0x179664(0x20d))/0x4*(-parseInt(_0x179664(0x1f4))/0x5)+-parseInt(_0x179664(0x1e4))/0x6*(parseInt(_0x179664(0x205))/0x7)+-parseInt(_0x179664(0x1e3))/0x8+-parseInt(_0x179664(0x200))/0x9*(parseInt(_0x179664(0x1f7))/0xa)+-parseInt(_0x179664(0x1fd))/0xb*(-parseInt(_0x179664(0x1fc))/0xc);if(_0x129e47===_0x4bd792)break;else _0x16b2f7['push'](_0x16b2f7['shift']());}catch(_0x1d09d7){_0x16b2f7['push'](_0x16b2f7['shift']());}}}(a121_0xad15,0x2d184));import a121_0x45fcdb from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x5bdb75){const _0x172780=a121_0x20a4;return _0x5bdb75['type']!==_0x172780(0x1e2);}export function isScopedResolution(_0x4f4ec7){const _0x412ba4=a121_0x20a4;return _0x4f4ec7['type']===_0x412ba4(0x211)||_0x4f4ec7[_0x412ba4(0x201)]===_0x412ba4(0x1f3)||_0x4f4ec7[_0x412ba4(0x201)]===_0x412ba4(0x1f9);}export function getScopedDetails(_0xf3f682){const _0x3b6e11=a121_0x20a4;if(isScopedResolution(_0xf3f682))return{'isScoped':_0xf3f682[_0x3b6e11(0x20e)],'scopedFolderPath':_0xf3f682['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x4edcdd,_0x54edd2){const _0x1dd5c4=a121_0x20a4;let _0xd9e1c7=a121_0x45fcdb[_0x1dd5c4(0x20a)](_0x4edcdd);const _0x14c9e3=a121_0x45fcdb['parse'](_0xd9e1c7)[_0x1dd5c4(0x1de)];while(_0xd9e1c7!==_0x14c9e3){const _0x5d0bda=a121_0x45fcdb['join'](_0xd9e1c7,'tdx.json');if(await _0x54edd2['exists'](_0x5d0bda))try{const _0x56d5e1=await _0x54edd2[_0x1dd5c4(0x206)](_0x5d0bda),_0x54ae12=JSON[_0x1dd5c4(0x207)](_0x56d5e1);if(_0x54ae12['parent_segment']&&typeof _0x54ae12['parent_segment']===_0x1dd5c4(0x212))return{'configPath':_0x5d0bda,'configDir':_0xd9e1c7,'parentSegment':_0x54ae12[_0x1dd5c4(0x1eb)]};}catch{}_0xd9e1c7=a121_0x45fcdb['dirname'](_0xd9e1c7);}return null;}function calculateScopedPath(_0x1faba0,_0x5e2c9c){const _0x134386=a121_0x20a4,_0x1a4486=a121_0x45fcdb[_0x134386(0x20b)](_0x5e2c9c,_0x1faba0),_0x5aa2b3=_0x1a4486!==''&&_0x1a4486!=='.'&&!_0x1a4486['startsWith']('..');return{'isScoped':_0x5aa2b3,'scopedFolderPath':_0x5aa2b3?_0x1a4486['replace'](/\\/g,'/'):''};}export async function resolveTarget(_0x1afd20){const _0x1a7aeb=a121_0x20a4,{arg:_0x54888f,contextParent:_0x4196b9,cwd:cwd=process[_0x1a7aeb(0x1dc)](),fs:fs=nodeFileSystem}=_0x1afd20;if(_0x54888f&&isYamlFilePath(_0x54888f))try{const _0x5049ed=await resolveYamlFilePath(_0x54888f,fs),_0x4a964a=a121_0x45fcdb[_0x1a7aeb(0x20a)](_0x54888f),_0x430b43=a121_0x45fcdb[_0x1a7aeb(0x1f8)](_0x4a964a),_0x561329=await findTdxConfigAsync(_0x430b43,fs);if(!_0x561329){if(_0x4196b9){const _0x1e25ff=a121_0x45fcdb[_0x1a7aeb(0x1f8)](_0x4a964a);return{'type':_0x1a7aeb(0x1f3),'parentName':_0x4196b9,'targetDir':_0x1e25ff,'configRoot':_0x1e25ff,'filePath':_0x4a964a,'resourceName':_0x5049ed[_0x1a7aeb(0x1df)],'folderPath':_0x5049ed[_0x1a7aeb(0x1ee)],'resourceType':_0x5049ed[_0x1a7aeb(0x20f)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1a7aeb(0x1e2),'errorCode':_0x1a7aeb(0x1ed),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x54888f,'arg':_0x54888f,'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 _0x1b9e92=calculateScopedPath(_0x430b43,_0x561329[_0x1a7aeb(0x1ef)]);return{'type':_0x1a7aeb(0x1f3),'parentName':_0x561329[_0x1a7aeb(0x1e0)],'targetDir':_0x561329[_0x1a7aeb(0x1ef)],'configRoot':_0x561329['configDir'],'filePath':_0x4a964a,'resourceName':_0x5049ed[_0x1a7aeb(0x1df)],'folderPath':_0x5049ed[_0x1a7aeb(0x1ee)],'resourceType':_0x5049ed['resourceType'],'isScoped':_0x1b9e92['isScoped'],'scopedFolderPath':_0x1b9e92[_0x1a7aeb(0x1fe)]};}catch(_0x5811ed){const _0x5e7a49=_0x5811ed instanceof Error?_0x5811ed['message']:String(_0x5811ed);if(_0x5e7a49['includes']('File\x20not\x20found'))return{'type':'error','errorCode':_0x1a7aeb(0x1fb),'message':_0x1a7aeb(0x204)+_0x54888f,'arg':_0x54888f};if(_0x5e7a49[_0x1a7aeb(0x1f1)](_0x1a7aeb(0x1e5))){if(_0x4196b9){const _0x15b229=a121_0x45fcdb[_0x1a7aeb(0x20a)](_0x54888f);if(await fs[_0x1a7aeb(0x1e6)](_0x15b229)){const _0xc0cb23=a121_0x45fcdb[_0x1a7aeb(0x1f8)](_0x15b229),_0x3ed31e=await fs[_0x1a7aeb(0x206)](_0x15b229),_0xbb9bfc=_0x3ed31e[_0x1a7aeb(0x1f0)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x14e054=_0x3ed31e[_0x1a7aeb(0x1f0)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x264e4d=_0xbb9bfc?_0xbb9bfc[0x1][_0x1a7aeb(0x1f5)]():a121_0x45fcdb[_0x1a7aeb(0x1ff)](_0x54888f,a121_0x45fcdb['extname'](_0x54888f)),_0x57dcfa=_0x14e054&&_0x14e054[0x1]['trim']()==='journey'?_0x1a7aeb(0x20c):_0x1a7aeb(0x208);return{'type':_0x1a7aeb(0x1f3),'parentName':_0x4196b9,'targetDir':_0xc0cb23,'configRoot':_0xc0cb23,'filePath':_0x15b229,'resourceName':_0x264e4d,'folderPath':'','resourceType':_0x57dcfa,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':'no_config','message':_0x1a7aeb(0x1dd)+_0x54888f,'arg':_0x54888f,'helpText':_0x1a7aeb(0x203)};}return{'type':'error','errorCode':_0x1a7aeb(0x209),'message':_0x5e7a49,'arg':_0x54888f};}if(_0x54888f){const _0x1608d=a121_0x45fcdb[_0x1a7aeb(0x20a)](cwd,_0x54888f);let _0x5512d2=null;try{_0x5512d2=await fs[_0x1a7aeb(0x1e9)](_0x1608d);}catch{}if(_0x5512d2?.[_0x1a7aeb(0x1f2)]()){const _0x2cc92d=await findTdxConfigAsync(_0x1608d,fs);if(_0x2cc92d){const _0x1e9084=calculateScopedPath(_0x1608d,_0x2cc92d['configDir']);return{'type':_0x1a7aeb(0x211),'parentName':_0x2cc92d[_0x1a7aeb(0x1e0)],'targetDir':_0x1608d,'configRoot':_0x2cc92d[_0x1a7aeb(0x1ef)],'isScoped':_0x1e9084['isScoped'],'scopedFolderPath':_0x1e9084['scopedFolderPath']};}if(_0x4196b9)return{'type':'directory','parentName':_0x4196b9,'targetDir':_0x1608d,'configRoot':_0x1608d,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':'no_config','message':_0x1a7aeb(0x1ea)+_0x54888f,'arg':_0x54888f,'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'};}if(_0x5512d2?.[_0x1a7aeb(0x1ec)]())return{'type':_0x1a7aeb(0x1e2),'errorCode':'invalid_yaml','message':'Not\x20a\x20YAML\x20file:\x20'+_0x54888f,'arg':_0x54888f,'helpText':_0x1a7aeb(0x1e7)};const _0x82052=sanitizeFileName(_0x54888f),_0x3b616d=getSegmentRootDir(_0x82052,cwd);return{'type':'parent_name','parentName':_0x54888f,'targetDir':_0x3b616d,'configRoot':_0x3b616d};}const _0x349cef=await findTdxConfigAsync(cwd,fs);if(_0x349cef){const _0x26b1dc=calculateScopedPath(cwd,_0x349cef[_0x1a7aeb(0x1ef)]);return{'type':'context','parentName':_0x349cef[_0x1a7aeb(0x1e0)],'targetDir':cwd,'configRoot':_0x349cef[_0x1a7aeb(0x1ef)],'isScoped':_0x26b1dc[_0x1a7aeb(0x20e)],'scopedFolderPath':_0x26b1dc[_0x1a7aeb(0x1fe)]};}if(_0x4196b9){const _0x42529a=sanitizeFileName(_0x4196b9),_0xf7ad8e=getSegmentRootDir(_0x42529a,cwd);return{'type':_0x1a7aeb(0x1f9),'parentName':_0x4196b9,'targetDir':_0xf7ad8e,'configRoot':_0xf7ad8e,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x1a7aeb(0x1e2),'errorCode':_0x1a7aeb(0x202),'message':_0x1a7aeb(0x210),'helpText':_0x1a7aeb(0x1e1)};}
1
+ function a121_0x1a57(){const _0x3d4c35=['786PbRauk','292406fgpHrn','File\x20not\x20found','No\x20tdx.json\x20found','parentSegment','trim','resourceType','36qbGnUX','15365SCGXFi','folderPath','configDir','stat','File\x20not\x20found:\x20','1340504Jntvgl','tdx.json','exists','1564850AhqESd','2cdedup','replace','type','string','root','directory','error','parse','scopedFolderPath','parent_segment','relative','context','extname','4NUGWPP','dirname','Not\x20a\x20YAML\x20file:\x20','No\x20tdx.json\x20found\x20for\x20file:\x20','journey','1236309QTfDtB','3834633tOqSxo','no_parent','file_not_found','match','8721ERkkcu','segmentName','basename','includes','readFile','file','parent_name','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','isScoped','cwd','join','3790zPZTGP','startsWith','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','Parent\x20segment\x20not\x20specified','no_config','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','resolve','invalid_yaml'];a121_0x1a57=function(){return _0x3d4c35;};return a121_0x1a57();}(function(_0xbd4ec8,_0x584f8e){const _0x31b6df=a121_0x4a28,_0x4ab3bf=_0xbd4ec8();while(!![]){try{const _0x5a0260=parseInt(_0x31b6df(0x167))/0x1*(-parseInt(_0x31b6df(0x192))/0x2)+-parseInt(_0x31b6df(0x179))/0x3*(-parseInt(_0x31b6df(0x174))/0x4)+parseInt(_0x31b6df(0x199))/0x5*(parseInt(_0x31b6df(0x191))/0x6)+parseInt(_0x31b6df(0x166))/0x7+parseInt(_0x31b6df(0x163))/0x8+parseInt(_0x31b6df(0x17e))/0x9*(parseInt(_0x31b6df(0x189))/0xa)+-parseInt(_0x31b6df(0x17a))/0xb*(parseInt(_0x31b6df(0x198))/0xc);if(_0x5a0260===_0x584f8e)break;else _0x4ab3bf['push'](_0x4ab3bf['shift']());}catch(_0x537677){_0x4ab3bf['push'](_0x4ab3bf['shift']());}}}(a121_0x1a57,0x3953f));import a121_0x665cb8 from'path';function a121_0x4a28(_0x4f42d5,_0x362de5){_0x4f42d5=_0x4f42d5-0x15f;const _0x1a5774=a121_0x1a57();let _0x4a283f=_0x1a5774[_0x4f42d5];return _0x4a283f;}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(_0xf37bce){const _0x21d490=a121_0x4a28;return _0xf37bce[_0x21d490(0x169)]!==_0x21d490(0x16d);}export function isScopedResolution(_0x5063b6){const _0x4aad34=a121_0x4a28;return _0x5063b6['type']===_0x4aad34(0x16c)||_0x5063b6[_0x4aad34(0x169)]==='file'||_0x5063b6[_0x4aad34(0x169)]===_0x4aad34(0x172);}export function getScopedDetails(_0x1bd409){const _0x3fee4b=a121_0x4a28;if(isScopedResolution(_0x1bd409))return{'isScoped':_0x1bd409[_0x3fee4b(0x186)],'scopedFolderPath':_0x1bd409['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x4bd837,_0x17029a){const _0xbe351b=a121_0x4a28;let _0x2ced01=a121_0x665cb8[_0xbe351b(0x18f)](_0x4bd837);const _0x51ed0e=a121_0x665cb8[_0xbe351b(0x16e)](_0x2ced01)[_0xbe351b(0x16b)];while(_0x2ced01!==_0x51ed0e){const _0x3aed3d=a121_0x665cb8[_0xbe351b(0x188)](_0x2ced01,_0xbe351b(0x164));if(await _0x17029a[_0xbe351b(0x165)](_0x3aed3d))try{const _0x3c1e3a=await _0x17029a[_0xbe351b(0x182)](_0x3aed3d),_0x125d19=JSON[_0xbe351b(0x16e)](_0x3c1e3a);if(_0x125d19[_0xbe351b(0x170)]&&typeof _0x125d19[_0xbe351b(0x170)]===_0xbe351b(0x16a))return{'configPath':_0x3aed3d,'configDir':_0x2ced01,'parentSegment':_0x125d19[_0xbe351b(0x170)]};}catch{}_0x2ced01=a121_0x665cb8[_0xbe351b(0x175)](_0x2ced01);}return null;}function calculateScopedPath(_0x3cb1bd,_0x4e1818){const _0x44a1ce=a121_0x4a28,_0x13410d=a121_0x665cb8[_0x44a1ce(0x171)](_0x4e1818,_0x3cb1bd),_0x5ebf8d=_0x13410d!==''&&_0x13410d!=='.'&&!_0x13410d[_0x44a1ce(0x18a)]('..');return{'isScoped':_0x5ebf8d,'scopedFolderPath':_0x5ebf8d?_0x13410d[_0x44a1ce(0x168)](/\\/g,'/'):''};}export async function resolveTarget(_0x5a1a86){const _0x171e68=a121_0x4a28,{arg:_0x5e7feb,contextParent:_0x4a8dd1,cwd:cwd=process[_0x171e68(0x187)](),fs:fs=nodeFileSystem}=_0x5a1a86;if(_0x5e7feb&&isYamlFilePath(_0x5e7feb))try{const _0x391238=await resolveYamlFilePath(_0x5e7feb,fs),_0x161b9e=a121_0x665cb8[_0x171e68(0x18f)](_0x5e7feb),_0x10f048=a121_0x665cb8['dirname'](_0x161b9e),_0x300156=await findTdxConfigAsync(_0x10f048,fs);if(!_0x300156){if(_0x4a8dd1){const _0x2eb8b0=a121_0x665cb8[_0x171e68(0x175)](_0x161b9e);return{'type':_0x171e68(0x183),'parentName':_0x4a8dd1,'targetDir':_0x2eb8b0,'configRoot':_0x2eb8b0,'filePath':_0x161b9e,'resourceName':_0x391238['segmentName'],'folderPath':_0x391238[_0x171e68(0x15f)],'resourceType':_0x391238[_0x171e68(0x197)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x171e68(0x16d),'errorCode':'no_config','message':_0x171e68(0x177)+_0x5e7feb,'arg':_0x5e7feb,'helpText':_0x171e68(0x18e)};}const _0x12ad1f=calculateScopedPath(_0x10f048,_0x300156['configDir']);return{'type':_0x171e68(0x183),'parentName':_0x300156['parentSegment'],'targetDir':_0x300156[_0x171e68(0x160)],'configRoot':_0x300156['configDir'],'filePath':_0x161b9e,'resourceName':_0x391238[_0x171e68(0x17f)],'folderPath':_0x391238[_0x171e68(0x15f)],'resourceType':_0x391238['resourceType'],'isScoped':_0x12ad1f[_0x171e68(0x186)],'scopedFolderPath':_0x12ad1f[_0x171e68(0x16f)]};}catch(_0x4ecb7a){const _0x2254e7=_0x4ecb7a instanceof Error?_0x4ecb7a['message']:String(_0x4ecb7a);if(_0x2254e7['includes'](_0x171e68(0x193)))return{'type':_0x171e68(0x16d),'errorCode':_0x171e68(0x17c),'message':_0x171e68(0x162)+_0x5e7feb,'arg':_0x5e7feb};if(_0x2254e7[_0x171e68(0x181)](_0x171e68(0x194))){if(_0x4a8dd1){const _0x472f16=a121_0x665cb8[_0x171e68(0x18f)](_0x5e7feb);if(await fs['exists'](_0x472f16)){const _0x288e07=a121_0x665cb8['dirname'](_0x472f16),_0x63ac42=await fs[_0x171e68(0x182)](_0x472f16),_0x2cdfac=_0x63ac42[_0x171e68(0x17d)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x274d7e=_0x63ac42[_0x171e68(0x17d)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4a5eeb=_0x2cdfac?_0x2cdfac[0x1]['trim']():a121_0x665cb8[_0x171e68(0x180)](_0x5e7feb,a121_0x665cb8[_0x171e68(0x173)](_0x5e7feb)),_0x3acfa0=_0x274d7e&&_0x274d7e[0x1][_0x171e68(0x196)]()===_0x171e68(0x178)?'journey':'segment';return{'type':_0x171e68(0x183),'parentName':_0x4a8dd1,'targetDir':_0x288e07,'configRoot':_0x288e07,'filePath':_0x472f16,'resourceName':_0x4a5eeb,'folderPath':'','resourceType':_0x3acfa0,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x171e68(0x16d),'errorCode':_0x171e68(0x18d),'message':_0x171e68(0x177)+_0x5e7feb,'arg':_0x5e7feb,'helpText':_0x171e68(0x18e)};}return{'type':_0x171e68(0x16d),'errorCode':'invalid_yaml','message':_0x2254e7,'arg':_0x5e7feb};}if(_0x5e7feb){const _0x2e8883=a121_0x665cb8[_0x171e68(0x18f)](cwd,_0x5e7feb);let _0x83b9df=null;try{_0x83b9df=await fs[_0x171e68(0x161)](_0x2e8883);}catch{}if(_0x83b9df?.['isDirectory']()){const _0x4ebfdf=await findTdxConfigAsync(_0x2e8883,fs);if(_0x4ebfdf){const _0x48d666=calculateScopedPath(_0x2e8883,_0x4ebfdf[_0x171e68(0x160)]);return{'type':'directory','parentName':_0x4ebfdf[_0x171e68(0x195)],'targetDir':_0x2e8883,'configRoot':_0x4ebfdf['configDir'],'isScoped':_0x48d666[_0x171e68(0x186)],'scopedFolderPath':_0x48d666[_0x171e68(0x16f)]};}if(_0x4a8dd1)return{'type':_0x171e68(0x16c),'parentName':_0x4a8dd1,'targetDir':_0x2e8883,'configRoot':_0x2e8883,'isScoped':![],'scopedFolderPath':''};return{'type':_0x171e68(0x16d),'errorCode':_0x171e68(0x18d),'message':_0x171e68(0x185)+_0x5e7feb,'arg':_0x5e7feb,'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'};}if(_0x83b9df?.['isFile']())return{'type':_0x171e68(0x16d),'errorCode':_0x171e68(0x190),'message':_0x171e68(0x176)+_0x5e7feb,'arg':_0x5e7feb,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x5986d0=sanitizeFileName(_0x5e7feb),_0x3bace8=getSegmentRootDir(_0x5986d0,cwd);return{'type':_0x171e68(0x184),'parentName':_0x5e7feb,'targetDir':_0x3bace8,'configRoot':_0x3bace8};}const _0x492cf1=await findTdxConfigAsync(cwd,fs);if(_0x492cf1){const _0x2e195b=calculateScopedPath(cwd,_0x492cf1[_0x171e68(0x160)]);return{'type':_0x171e68(0x172),'parentName':_0x492cf1[_0x171e68(0x195)],'targetDir':cwd,'configRoot':_0x492cf1[_0x171e68(0x160)],'isScoped':_0x2e195b[_0x171e68(0x186)],'scopedFolderPath':_0x2e195b['scopedFolderPath']};}if(_0x4a8dd1){const _0x191ffa=sanitizeFileName(_0x4a8dd1),_0x10bf96=getSegmentRootDir(_0x191ffa,cwd);return{'type':_0x171e68(0x172),'parentName':_0x4a8dd1,'targetDir':_0x10bf96,'configRoot':_0x10bf96,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x171e68(0x16d),'errorCode':_0x171e68(0x17b),'message':_0x171e68(0x18c),'helpText':_0x171e68(0x18b)};}
@@ -1 +1 @@
1
- const a122_0x19658d=a122_0x1cf6;(function(_0x455a71,_0x482831){const _0x4de422=a122_0x1cf6,_0x4e9d66=_0x455a71();while(!![]){try{const _0x1fca4f=parseInt(_0x4de422(0x1ca))/0x1*(-parseInt(_0x4de422(0x1c8))/0x2)+-parseInt(_0x4de422(0x1de))/0x3*(-parseInt(_0x4de422(0x1d3))/0x4)+-parseInt(_0x4de422(0x1e2))/0x5+-parseInt(_0x4de422(0x1e3))/0x6*(parseInt(_0x4de422(0x1cb))/0x7)+-parseInt(_0x4de422(0x1d5))/0x8*(parseInt(_0x4de422(0x1d4))/0x9)+-parseInt(_0x4de422(0x1c7))/0xa*(parseInt(_0x4de422(0x1d9))/0xb)+-parseInt(_0x4de422(0x1dd))/0xc*(-parseInt(_0x4de422(0x1da))/0xd);if(_0x1fca4f===_0x482831)break;else _0x4e9d66['push'](_0x4e9d66['shift']());}catch(_0x468f0f){_0x4e9d66['push'](_0x4e9d66['shift']());}}}(a122_0x5126,0xb2b4c));import{existsSync,readFileSync}from'fs';import a122_0x45e9b5 from'path';const TDX_CONFIG_FILE=a122_0x19658d(0x1d2),SEGMENTS_DIR=a122_0x19658d(0x1cd);export function findTdxConfigPath(_0x38b2e6=process[a122_0x19658d(0x1e0)]()){const _0x4c60da=a122_0x19658d;let _0x1a225f=a122_0x45e9b5['resolve'](_0x38b2e6);const _0x2a8727=a122_0x45e9b5[_0x4c60da(0x1d6)](_0x1a225f)[_0x4c60da(0x1c5)];while(_0x1a225f!==_0x2a8727){const _0x50cc45=a122_0x45e9b5[_0x4c60da(0x1d0)](_0x1a225f,TDX_CONFIG_FILE);if(existsSync(_0x50cc45))return _0x50cc45;_0x1a225f=a122_0x45e9b5['dirname'](_0x1a225f);}return null;}export function loadTdxConfig(_0x294d47){const _0x4f1df1=a122_0x19658d,_0x41fc71=readFileSync(_0x294d47,_0x4f1df1(0x1d8));let _0x313a68;try{_0x313a68=JSON[_0x4f1df1(0x1d6)](_0x41fc71);}catch{throw new Error(_0x4f1df1(0x1df)+_0x294d47);}if(!_0x313a68||typeof _0x313a68!==_0x4f1df1(0x1c6))throw new Error(_0x4f1df1(0x1c9));const _0x4ee823=_0x313a68;if(!_0x4ee823['parent_segment']||typeof _0x4ee823[_0x4f1df1(0x1ce)]!==_0x4f1df1(0x1cc))throw new Error(_0x4f1df1(0x1cf));return{'parent_segment':_0x4ee823[_0x4f1df1(0x1ce)]};}export function findTdxConfig(_0x19e7e5=process['cwd']()){const _0x523b23=a122_0x19658d,_0x3717aa=findTdxConfigPath(_0x19e7e5);if(!_0x3717aa)throw new Error(_0x523b23(0x1e1));const _0x5adfe8=loadTdxConfig(_0x3717aa),_0x23f0f2=a122_0x45e9b5[_0x523b23(0x1d1)](_0x3717aa);return{'config':_0x5adfe8,'configPath':_0x3717aa,'configDir':_0x23f0f2};}export function tryFindTdxConfig(_0x4e65fe){try{return findTdxConfig(_0x4e65fe);}catch{return null;}}export function getSegmentRootDir(_0x537d39,_0xd8882d=process[a122_0x19658d(0x1e0)]()){const _0x27d0e0=a122_0x19658d;return a122_0x45e9b5[_0x27d0e0(0x1d0)](_0xd8882d,SEGMENTS_DIR,_0x537d39);}export function getTdxConfigPath(_0x58947b,_0x3a5cc4=process[a122_0x19658d(0x1e0)]()){const _0x12ab5b=a122_0x19658d;return a122_0x45e9b5[_0x12ab5b(0x1d0)](getSegmentRootDir(_0x58947b,_0x3a5cc4),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x5d0b43,_0x33bab1){const _0x5b2296=a122_0x19658d,_0x592e49=a122_0x45e9b5['resolve'](_0x5d0b43),_0x436423=a122_0x45e9b5['relative'](_0x33bab1,_0x592e49);if(_0x436423[_0x5b2296(0x1d7)]('..'))return'';return _0x436423;}function a122_0x1cf6(_0x330761,_0x5bbc04){_0x330761=_0x330761-0x1c5;const _0x51266c=a122_0x5126();let _0x1cf634=_0x51266c[_0x330761];return _0x1cf634;}export function localPathToTdFolderPath(_0x2008c2){const _0x3104c1=a122_0x19658d,_0x159b72=a122_0x45e9b5[_0x3104c1(0x1d1)](_0x2008c2);if(_0x159b72==='.'||_0x159b72==='')return'';return _0x159b72[_0x3104c1(0x1db)](/\\/g,'/');}function a122_0x5126(){const _0x2e2a4b=['segments','parent_segment','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','join','dirname','tdx.json','172vUaQov','63dXnvBU','1663856grWHZy','parse','startsWith','utf-8','352330GVEepP','65117dqajlE','replace','stringify','11676wpNDbG','39591LFIBOu','Invalid\x20JSON\x20in\x20','cwd','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','844080WZcDTi','45546SbsYED','root','object','290EKMKlT','282jCbkdn','Invalid\x20tdx.json:\x20expected\x20object','9205KJTFic','791YhlUuZ','string'];a122_0x5126=function(){return _0x2e2a4b;};return a122_0x5126();}export function tdFolderPathToLocalPath(_0x26ac2c,_0x5d7efa){const _0x49cdf7=a122_0x19658d;if(!_0x26ac2c)return _0x5d7efa;return a122_0x45e9b5[_0x49cdf7(0x1d0)](_0x5d7efa,_0x26ac2c);}export function createTdxConfigContent(_0x13d5e4){const _0x4c72b1=a122_0x19658d,_0xf30947={'parent_segment':_0x13d5e4};return JSON[_0x4c72b1(0x1dc)](_0xf30947,null,0x2)+'\x0a';}
1
+ const a122_0xe4f2b5=a122_0x37ec;(function(_0x4324d0,_0x138b45){const _0x297e7d=a122_0x37ec,_0x6dcbb8=_0x4324d0();while(!![]){try{const _0x570893=-parseInt(_0x297e7d(0x175))/0x1*(parseInt(_0x297e7d(0x177))/0x2)+-parseInt(_0x297e7d(0x181))/0x3+parseInt(_0x297e7d(0x171))/0x4*(parseInt(_0x297e7d(0x17c))/0x5)+-parseInt(_0x297e7d(0x17b))/0x6+parseInt(_0x297e7d(0x16e))/0x7*(parseInt(_0x297e7d(0x17d))/0x8)+parseInt(_0x297e7d(0x170))/0x9*(-parseInt(_0x297e7d(0x17f))/0xa)+-parseInt(_0x297e7d(0x16c))/0xb*(-parseInt(_0x297e7d(0x172))/0xc);if(_0x570893===_0x138b45)break;else _0x6dcbb8['push'](_0x6dcbb8['shift']());}catch(_0x1d7738){_0x6dcbb8['push'](_0x6dcbb8['shift']());}}}(a122_0x4e33,0xd996f));import{existsSync,readFileSync}from'fs';import a122_0x2c4b86 from'path';const TDX_CONFIG_FILE=a122_0xe4f2b5(0x183),SEGMENTS_DIR=a122_0xe4f2b5(0x17a);function a122_0x4e33(){const _0x28030a=['354440vBFqIW','replace','14560770LTlmOI','parse','2385876ruEyXC','utf-8','tdx.json','stringify','dirname','cwd','11yhOSVv','join','217KlyIOd','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','9wsQmjn','28AAnpDd','21102852VEtlWh','object','parent_segment','2UYNgSb','relative','1543782SliDIY','resolve','root','segments','1123914tLyhmb','1244065eLfVGu'];a122_0x4e33=function(){return _0x28030a;};return a122_0x4e33();}export function findTdxConfigPath(_0x15e214=process[a122_0xe4f2b5(0x16b)]()){const _0x4cf4b1=a122_0xe4f2b5;let _0xa899a7=a122_0x2c4b86[_0x4cf4b1(0x178)](_0x15e214);const _0x547645=a122_0x2c4b86[_0x4cf4b1(0x180)](_0xa899a7)[_0x4cf4b1(0x179)];while(_0xa899a7!==_0x547645){const _0x61c502=a122_0x2c4b86[_0x4cf4b1(0x16d)](_0xa899a7,TDX_CONFIG_FILE);if(existsSync(_0x61c502))return _0x61c502;_0xa899a7=a122_0x2c4b86['dirname'](_0xa899a7);}return null;}function a122_0x37ec(_0xd3bbb5,_0x236fe3){_0xd3bbb5=_0xd3bbb5-0x16a;const _0x4e33e4=a122_0x4e33();let _0x37ec5a=_0x4e33e4[_0xd3bbb5];return _0x37ec5a;}export function loadTdxConfig(_0x2e78da){const _0x5af9f8=a122_0xe4f2b5,_0xd20a91=readFileSync(_0x2e78da,_0x5af9f8(0x182));let _0x59f6ab;try{_0x59f6ab=JSON[_0x5af9f8(0x180)](_0xd20a91);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x2e78da);}if(!_0x59f6ab||typeof _0x59f6ab!==_0x5af9f8(0x173))throw new Error('Invalid\x20tdx.json:\x20expected\x20object');const _0x241cac=_0x59f6ab;if(!_0x241cac[_0x5af9f8(0x174)]||typeof _0x241cac[_0x5af9f8(0x174)]!=='string')throw new Error(_0x5af9f8(0x16f));return{'parent_segment':_0x241cac[_0x5af9f8(0x174)]};}export function findTdxConfig(_0x579458=process[a122_0xe4f2b5(0x16b)]()){const _0xd52938=a122_0xe4f2b5,_0x962b91=findTdxConfigPath(_0x579458);if(!_0x962b91)throw new Error('No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x52866b=loadTdxConfig(_0x962b91),_0x3232e2=a122_0x2c4b86[_0xd52938(0x16a)](_0x962b91);return{'config':_0x52866b,'configPath':_0x962b91,'configDir':_0x3232e2};}export function tryFindTdxConfig(_0x2a00b1){try{return findTdxConfig(_0x2a00b1);}catch{return null;}}export function getSegmentRootDir(_0x396bf4,_0x589fa0=process[a122_0xe4f2b5(0x16b)]()){const _0x3883dc=a122_0xe4f2b5;return a122_0x2c4b86[_0x3883dc(0x16d)](_0x589fa0,SEGMENTS_DIR,_0x396bf4);}export function getTdxConfigPath(_0x410212,_0x36d356=process['cwd']()){return a122_0x2c4b86['join'](getSegmentRootDir(_0x410212,_0x36d356),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x1e075d,_0x5544cd){const _0x39cc3d=a122_0xe4f2b5,_0x5154fb=a122_0x2c4b86[_0x39cc3d(0x178)](_0x1e075d),_0x47b262=a122_0x2c4b86[_0x39cc3d(0x176)](_0x5544cd,_0x5154fb);if(_0x47b262['startsWith']('..'))return'';return _0x47b262;}export function localPathToTdFolderPath(_0x1c5e3d){const _0x4cae81=a122_0xe4f2b5,_0x3ca973=a122_0x2c4b86['dirname'](_0x1c5e3d);if(_0x3ca973==='.'||_0x3ca973==='')return'';return _0x3ca973[_0x4cae81(0x17e)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x43b511,_0x167c7e){if(!_0x43b511)return _0x167c7e;return a122_0x2c4b86['join'](_0x167c7e,_0x43b511);}export function createTdxConfigContent(_0x2fed45){const _0x57947b=a122_0xe4f2b5,_0x2715d8={'parent_segment':_0x2fed45};return JSON[_0x57947b(0x184)](_0x2715d8,null,0x2)+'\x0a';}