@treasuredata/tdx 0.14.7 → 0.14.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/README.md +21 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-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/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/segment-command.js +1 -1
  29. package/dist/commands/segment-create-command.js +1 -1
  30. package/dist/commands/segment-fields-command.js +1 -1
  31. package/dist/commands/segment-pull-command.js +1 -1
  32. package/dist/commands/segment-push-command.js +1 -1
  33. package/dist/commands/segment-update-command.js +1 -1
  34. package/dist/commands/segment-use-command.js +1 -1
  35. package/dist/commands/segment-validate-command.js +1 -1
  36. package/dist/commands/segments.js +1 -1
  37. package/dist/commands/show.js +1 -1
  38. package/dist/commands/tables.js +1 -1
  39. package/dist/commands/unset-command.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.js +1 -1
  43. package/dist/core/auth.js +1 -1
  44. package/dist/core/command-output.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/connection-cache.js +1 -1
  47. package/dist/core/constants.js +1 -1
  48. package/dist/core/credential-cache.js +1 -1
  49. package/dist/core/global-context.js +1 -1
  50. package/dist/core/keychain.js +1 -1
  51. package/dist/core/profile.js +1 -1
  52. package/dist/core/project-config.js +1 -1
  53. package/dist/core/session.js +1 -1
  54. package/dist/core/user-cache.js +1 -1
  55. package/dist/core/version.js +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/proxy/anthropic-adapter.js +1 -1
  58. package/dist/proxy/claude-usage-tracker.js +1 -1
  59. package/dist/proxy/context-signature.js +1 -1
  60. package/dist/proxy/conversation-utils.js +1 -1
  61. package/dist/proxy/passthrough-server.js +1 -1
  62. package/dist/proxy/server.js +1 -1
  63. package/dist/proxy/session-cache.js +1 -1
  64. package/dist/proxy/sse-usage-parser.js +1 -1
  65. package/dist/sdk/agent/agent-config.js +1 -1
  66. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  67. package/dist/sdk/agent/agent-yaml.js +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/client/cdp-api-client.js +1 -1
  70. package/dist/sdk/client/endpoints.js +1 -1
  71. package/dist/sdk/client/engage-api-client.js +1 -1
  72. package/dist/sdk/client/http-client.js +1 -1
  73. package/dist/sdk/client/llm-api-client.js +1 -1
  74. package/dist/sdk/client/rate-limiter.js +1 -1
  75. package/dist/sdk/client/td-api-client.js +1 -1
  76. package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
  77. package/dist/sdk/client/trino-api-client.js +1 -1
  78. package/dist/sdk/client/trino-api-client.js.map +1 -1
  79. package/dist/sdk/client/workflow-client.js +1 -1
  80. package/dist/sdk/connection-validator.js +1 -1
  81. package/dist/sdk/connection.js +1 -1
  82. package/dist/sdk/engage.js +1 -1
  83. package/dist/sdk/errors.js +1 -1
  84. package/dist/sdk/index.js +1 -1
  85. package/dist/sdk/io/index.js +1 -1
  86. package/dist/sdk/io/node-filesystem.js +1 -1
  87. package/dist/sdk/job.js +1 -1
  88. package/dist/sdk/journey.js +1 -1
  89. package/dist/sdk/llm/chat-cache.js +1 -1
  90. package/dist/sdk/llm/index.js +1 -1
  91. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  92. package/dist/sdk/llm/model-aliases.js +1 -1
  93. package/dist/sdk/llm/model-factors.js +1 -1
  94. package/dist/sdk/query/index.js +1 -1
  95. package/dist/sdk/query/sql-parser.js +1 -1
  96. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  97. package/dist/sdk/segment/fields-display.js +1 -1
  98. package/dist/sdk/segment/file-discovery.js +1 -1
  99. package/dist/sdk/segment/journey-utils.js +1 -1
  100. package/dist/sdk/segment/journey-yaml.js +1 -1
  101. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  102. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  103. package/dist/sdk/segment/pull-workflow.js +1 -1
  104. package/dist/sdk/segment/push-workflow.js +1 -1
  105. package/dist/sdk/segment/resolution-context.js +1 -1
  106. package/dist/sdk/segment/segment-path-parser.js +1 -1
  107. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  108. package/dist/sdk/segment/target-resolution.js +1 -1
  109. package/dist/sdk/segment/tdx-config.js +1 -1
  110. package/dist/sdk/segment/validate-files.js +1 -1
  111. package/dist/sdk/segment/yaml-validator.js +1 -1
  112. package/dist/sdk/segment.js +1 -1
  113. package/dist/sdk/types/index.js +1 -1
  114. package/dist/sdk/types/progress.js +1 -1
  115. package/dist/sdk/user.js +1 -1
  116. package/dist/sdk/util/format-detector.js +1 -1
  117. package/dist/sdk/util/formatters.js +1 -1
  118. package/dist/sdk/util/index.js +1 -1
  119. package/dist/sdk/util/tree-formatter.js +1 -1
  120. package/dist/sdk/workflow/clone-workflow.js +1 -1
  121. package/dist/sdk/workflow/index.js +1 -1
  122. package/dist/sdk/workflow/pull-workflow.js +1 -1
  123. package/dist/sdk/workflow/push-workflow.js +1 -1
  124. package/dist/sdk/workflow/tdx-config.js +1 -1
  125. package/dist/sdk/workflow/workflow-utils.js +1 -1
  126. package/dist/tdx +10 -0
  127. package/dist/utils/async.js +1 -1
  128. package/dist/utils/colors.d.ts +2 -1
  129. package/dist/utils/colors.d.ts.map +1 -1
  130. package/dist/utils/colors.js +1 -1
  131. package/dist/utils/colors.js.map +1 -1
  132. package/dist/utils/diff.js +1 -1
  133. package/dist/utils/file-permissions.js +1 -1
  134. package/dist/utils/json-loader.js +1 -1
  135. package/dist/utils/option-validation.js +1 -1
  136. package/dist/utils/port.js +1 -1
  137. package/dist/utils/process.js +1 -1
  138. package/dist/utils/prompt.js +1 -1
  139. package/dist/utils/spinner.js +1 -1
  140. package/dist/utils/sse-parser.js +1 -1
  141. package/dist/utils/string-utils.js +1 -1
  142. package/dist/utils/table-ref-parser.js +1 -1
  143. package/dist/utils/tdx-logger.js +1 -1
  144. package/dist/utils/version-check.js +1 -1
  145. package/package.json +2 -2
@@ -1 +1 @@
1
- const a101_0x109af2=a101_0x383a;(function(_0x2bfb5e,_0x145085){const _0x302078=a101_0x383a,_0x29f7d5=_0x2bfb5e();while(!![]){try{const _0x1ee9f9=parseInt(_0x302078(0x1bf))/0x1+-parseInt(_0x302078(0x1fd))/0x2+parseInt(_0x302078(0x1e7))/0x3+parseInt(_0x302078(0x1f7))/0x4*(-parseInt(_0x302078(0x199))/0x5)+parseInt(_0x302078(0x182))/0x6*(parseInt(_0x302078(0x20b))/0x7)+-parseInt(_0x302078(0x1d1))/0x8+-parseInt(_0x302078(0x1d3))/0x9*(-parseInt(_0x302078(0x231))/0xa);if(_0x1ee9f9===_0x145085)break;else _0x29f7d5['push'](_0x29f7d5['shift']());}catch(_0x31b599){_0x29f7d5['push'](_0x29f7d5['shift']());}}}(a101_0x41db,0xa1773));import{createHash}from'crypto';function a101_0x383a(_0x335569,_0x10a914){_0x335569=_0x335569-0x178;const _0x41dbbe=a101_0x41db();let _0x383afd=_0x41dbbe[_0x335569];return _0x383afd;}export const PENDING_SEGMENT_PREFIX=a101_0x109af2(0x1dd);export const PENDING_ACTIVATION_PREFIX=a101_0x109af2(0x1d6);export function createPendingSegmentId(_0x1ca4c8){return''+PENDING_SEGMENT_PREFIX+_0x1ca4c8+'__';}export function isPendingSegmentId(_0x4fecc6){const _0x1384fc=a101_0x109af2;return _0x4fecc6[_0x1384fc(0x21d)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x3d8364){const _0x2817bd=a101_0x109af2;return _0x3d8364[_0x2817bd(0x1c0)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x995da2){return''+PENDING_ACTIVATION_PREFIX+_0x995da2+'__';}export function isPendingActivationId(_0x1f2ca3){const _0x2a994d=a101_0x109af2;return _0x1f2ca3[_0x2a994d(0x21d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x565bec){return _0x565bec['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x2c6f2a,_0x189cd8){const _0x27a27c=a101_0x109af2,_0x2b174a=_0x2c6f2a+'::'+(_0x189cd8['trim']()||_0x27a27c(0x22b)),_0x3d150c=createHash(_0x27a27c(0x1cd))['update'](_0x2b174a)[_0x27a27c(0x1ea)](_0x27a27c(0x185))['slice'](0x0,0xc);return _0x27a27c(0x20f)+_0x3d150c;}export function ensureJourneyDefaults(_0x2f87f6){const _0x4cc7f0=a101_0x109af2;!_0x2f87f6[_0x4cc7f0(0x19c)]&&(_0x2f87f6[_0x4cc7f0(0x19c)]=''),!_0x2f87f6[_0x4cc7f0(0x215)]&&(_0x2f87f6[_0x4cc7f0(0x215)]=_0x4cc7f0(0x23a));}export function resolveTDFolderPath(_0x1de752,_0x29ccc2,_0x50fe3c){if(!_0x29ccc2)return _0x1de752;if(_0x1de752===_0x50fe3c||_0x1de752['startsWith'](_0x50fe3c+'/'))return _0x1de752;return _0x1de752?_0x50fe3c+'/'+_0x1de752:_0x50fe3c;}export function addFoldersToCreate(_0x906fcd,_0x4b91cd,_0x1accc0){const _0x47f57f=a101_0x109af2;if(!_0x906fcd)return;if(_0x4b91cd[_0x47f57f(0x21f)](_0x906fcd))return;const _0x4d05a4=_0x906fcd[_0x47f57f(0x240)]('/');let _0x394ca6='';for(const _0x4f21b8 of _0x4d05a4){_0x394ca6=_0x394ca6?_0x394ca6+'/'+_0x4f21b8:_0x4f21b8,!_0x4b91cd['has'](_0x394ca6)&&_0x1accc0[_0x47f57f(0x238)](_0x394ca6);}}import*as a101_0x373ffc from'yaml';import{readFileSync}from'fs';import a101_0x1034f4 from'path';import{isJourneyDef,parseYamlString as a101_0x402c83,toYamlString as a101_0x5ead0b,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x379ea9){const _0x16bf67=a101_0x109af2;if(Array[_0x16bf67(0x1ad)](_0x379ea9))return'['+_0x379ea9[_0x16bf67(0x1ee)](_0x5b118a=>stableStringify(_0x5b118a))[_0x16bf67(0x1fe)](',')+']';if(_0x379ea9&&typeof _0x379ea9===_0x16bf67(0x251)){const _0x5d2f83=_0x379ea9,_0x4826eb=Object['keys'](_0x5d2f83)[_0x16bf67(0x21e)](),_0x1beb04=_0x4826eb[_0x16bf67(0x1ee)](_0xd8abb3=>'\x22'+_0xd8abb3+'\x22:'+stableStringify(_0x5d2f83[_0xd8abb3]));return'{'+_0x1beb04[_0x16bf67(0x1fe)](',')+'}';}const _0x596419=JSON[_0x16bf67(0x226)](_0x379ea9);return _0x596419===undefined?'null':_0x596419;}function activationSignature(_0x31db59){const _0x5c75fe=a101_0x109af2,_0x5e787a={'connection':_0x31db59[_0x5c75fe(0x1bb)],..._0x31db59[_0x5c75fe(0x1c5)]!==undefined&&{'all_columns':_0x31db59[_0x5c75fe(0x1c5)]},..._0x31db59[_0x5c75fe(0x1b7)]!==undefined&&{'columns':_0x31db59[_0x5c75fe(0x1b7)]},..._0x31db59[_0x5c75fe(0x1c9)]!==undefined&&{'behavior':_0x31db59[_0x5c75fe(0x1c9)]},..._0x31db59['schedule']!==undefined&&{'schedule':_0x31db59['schedule']},..._0x31db59['notification']!==undefined&&{'notification':_0x31db59[_0x5c75fe(0x1ed)]},..._0x31db59[_0x5c75fe(0x22d)]!==undefined&&{'connector_config':_0x31db59[_0x5c75fe(0x22d)]},..._0x31db59[_0x5c75fe(0x217)]!==undefined&&{'activation_template_id':_0x31db59[_0x5c75fe(0x217)]}};return stableStringify(_0x5e787a);}export async function prepareSegmentFiles(_0x4ce8b6,_0x4465b7,_0x502c97,_0x991322,_0x4e12ab){const _0x1457d2=a101_0x109af2,{activationDefToCreateRequest:_0x2cd3bb}=await import(_0x1457d2(0x1d5)),_0x5bf307=[],_0x2c39cc=new Set();for(const {yamlConfig:_0x252fe9,folderPath:_0x35a1f9,sourcePath:_0x583cdc}of _0x4ce8b6){const _0x3800f7=resolveTDFolderPath(_0x35a1f9,_0x991322,_0x4e12ab),_0x5bbb90=_0x3800f7+':'+_0x252fe9[_0x1457d2(0x19e)],_0x50b6c2=_0x4465b7[_0x1457d2(0x244)][_0x1457d2(0x1bd)](_0x5bbb90),_0x4dc54f=_0x50b6c2?_0x4465b7['activationsBySegmentId'][_0x1457d2(0x1bd)](_0x50b6c2['id'])||[]:[];addFoldersToCreate(_0x3800f7,_0x4465b7['folderPathToId'],_0x2c39cc);const _0x51f8ca=calculateActivationActions(_0x252fe9[_0x1457d2(0x1ef)]||[],_0x4dc54f,_0x4465b7['idToEmailMap'],_0x4465b7[_0x1457d2(0x24b)]);for(const _0x4cf593 of _0x51f8ca){(_0x4cf593[_0x1457d2(0x1b0)]==='create'||_0x4cf593['type']===_0x1457d2(0x210))&&_0x4cf593[_0x1457d2(0x191)]&&(_0x4cf593[_0x1457d2(0x1a2)]=await _0x2cd3bb(_0x4cf593[_0x1457d2(0x191)],_0x502c97));}const _0x2d2c55=calculateSegmentDiff(_0x252fe9,_0x50b6c2,_0x4dc54f,_0x4465b7[_0x1457d2(0x193)],_0x4465b7[_0x1457d2(0x24b)]);_0x5bf307[_0x1457d2(0x228)]({'relativePath':_0x252fe9['name'],'absolutePath':_0x583cdc,'yamlConfig':_0x252fe9,'folderPath':_0x3800f7,'existingSegment':_0x50b6c2,'existingActivations':_0x4dc54f,'isNew':_0x2d2c55['isNew'],'hasChanges':_0x2d2c55[_0x1457d2(0x1fa)],'diff':_0x2d2c55['diff'],'activationActions':_0x51f8ca});}return{'segmentFiles':_0x5bf307,'foldersToCreate':_0x2c39cc};}export async function prepareJourneyFiles(_0x32e094,_0x250919,_0x283a78,_0x825f58){const _0x33fb27=a101_0x109af2,_0x1c281a=[],_0x2f9391=new Set();for(const {yamlConfig:_0x454fe2,folderPath:_0x2c0c1c,sourcePath:_0x29917b}of _0x32e094){const _0x49584c=resolveTDFolderPath(_0x2c0c1c,_0x283a78,_0x825f58),_0x181341=_0x49584c+':'+_0x454fe2[_0x33fb27(0x19e)],_0x52a9d0=_0x250919[_0x33fb27(0x209)][_0x33fb27(0x1bd)](_0x181341);let _0x4fa579,_0x38e78a;if(_0x52a9d0&&_0x52a9d0[_0x33fb27(0x242)]>0x0){const _0x23855d=buildLocalExpandedRuleMappings(_0x454fe2),{createYamlContext:_0x2fc2b5,prefetchJourneySegments:_0x14e750}=createPushYamlContextForBundle(_0x250919['deps'],_0x250919[_0x33fb27(0x1ab)],_0x250919[_0x33fb27(0x201)],_0x23855d,_0x250919['idToEmailMap'],_0x250919['connectionIdToNameMap'],_0x250919[_0x33fb27(0x1b8)],_0x250919[_0x33fb27(0x241)]);await _0x14e750(_0x52a9d0[_0x33fb27(0x1ee)](_0x305b65=>_0x305b65['id']));const _0x1f40cd=hasMultipleVersions(_0x454fe2),_0x3b6edb=async _0x429a61=>{const _0x2f8e1d=_0x33fb27,_0x3f571a=_0x250919[_0x2f8e1d(0x241)]?.['get'](_0x429a61);if(_0x3f571a)return _0x3f571a;return _0x250919['fetchJourney']({'journeyId':_0x429a61,'journeyName':_0x454fe2['name'],'isMultiVersion':_0x52a9d0[_0x2f8e1d(0x242)]>0x1});};if(_0x1f40cd&&_0x52a9d0['length']>0x1){const _0x2efa96=[];for(const _0x3c2f12 of _0x52a9d0){const _0x521002=_0x3c2f12[_0x33fb27(0x21a)]||0x1;_0x250919[_0x33fb27(0x183)]?.[_0x33fb27(0x210)](_0x33fb27(0x1f9)+_0x454fe2[_0x33fb27(0x19e)]+'\x20v'+_0x521002);const _0x59f938=await _0x3b6edb(_0x3c2f12['id']),_0x1e2b48=_0x2fc2b5(_0x3c2f12['id']),_0x3ac6d8=await journeyResponseToDef(_0x59f938,_0x1e2b48);_0x2efa96[_0x33fb27(0x228)]({'item':_0x3c2f12,'yaml':_0x3ac6d8});}const _0x18c81b=buildLocalRuleToNameMappingFromJourney(_0x454fe2);_0x38e78a=buildMergedJourneyDef(_0x2efa96,_0x18c81b);const _0x33dbfc=Math[_0x33fb27(0x1e1)](..._0x2efa96['map'](_0x1e3c3d=>_0x1e3c3d[_0x33fb27(0x1eb)][_0x33fb27(0x21a)]||0x0)),_0x4f2343=_0x52a9d0[_0x33fb27(0x17c)](_0x3d51f5=>(_0x3d51f5[_0x33fb27(0x21a)]||0x0)===_0x33dbfc);_0x4f2343&&(_0x250919[_0x33fb27(0x183)]?.[_0x33fb27(0x210)](_0x33fb27(0x1f9)+_0x454fe2[_0x33fb27(0x19e)]+'\x20v'+_0x33dbfc),_0x4fa579=await _0x3b6edb(_0x4f2343['id']));}else{const _0x20dcd8=_0x52a9d0[_0x52a9d0[_0x33fb27(0x242)]-0x1];_0x250919[_0x33fb27(0x183)]?.['update']('Fetching\x20'+_0x454fe2[_0x33fb27(0x19e)]),_0x4fa579=await _0x3b6edb(_0x20dcd8['id']);const _0x2bb43d=_0x2fc2b5(_0x20dcd8['id']),_0x5d5713=await journeyResponseToDef(_0x4fa579,_0x2bb43d),_0x364ab3=buildLocalRuleToNameMappingFromJourney(_0x454fe2);_0x38e78a=buildMergedJourneyDef([{'item':_0x20dcd8,'yaml':_0x5d5713}],_0x364ab3);}}addFoldersToCreate(_0x49584c,_0x250919[_0x33fb27(0x24f)],_0x2f9391);const _0x4a25e5=calculateJourneyDiff(_0x454fe2,_0x38e78a);_0x1c281a[_0x33fb27(0x228)]({'relativePath':_0x454fe2['name'],'absolutePath':_0x29917b,'yamlConfig':_0x454fe2,'folderPath':_0x49584c,'existingJourney':_0x4fa579,'isNew':_0x4a25e5[_0x33fb27(0x225)],'hasChanges':_0x4a25e5[_0x33fb27(0x1fa)],'diff':_0x4a25e5[_0x33fb27(0x23d)]});}return{'journeyFiles':_0x1c281a,'foldersToCreate':_0x2f9391};}export function calculateActivationActions(_0x175470,_0x4b64bf,_0x2e7a52,_0x1065db){const _0x38c0fe=a101_0x109af2,_0x19dfe7=[],_0x263beb=new Map();for(const _0x5da660 of _0x4b64bf){_0x263beb['set'](_0x5da660[_0x38c0fe(0x19e)],_0x5da660);}const _0x369aa6=new Map();for(const _0x53b474 of _0x175470){_0x369aa6[_0x38c0fe(0x1de)](_0x53b474[_0x38c0fe(0x19e)],_0x53b474);}for(const _0x57923f of _0x175470){const _0x2a56aa=_0x263beb['get'](_0x57923f[_0x38c0fe(0x19e)]);if(!_0x2a56aa)_0x19dfe7['push']({'type':_0x38c0fe(0x207),'name':_0x57923f[_0x38c0fe(0x19e)],'yamlActivation':_0x57923f});else{const _0xdc652f=activationResponseToDef(_0x2a56aa,_0x2e7a52,_0x1065db),_0x458900=a101_0x373ffc['stringify'](_0xdc652f),_0x4949a0=a101_0x373ffc[_0x38c0fe(0x226)](_0x57923f);_0x458900!==_0x4949a0&&_0x19dfe7[_0x38c0fe(0x228)]({'type':'update','name':_0x57923f[_0x38c0fe(0x19e)],'yamlActivation':_0x57923f,'existingActivation':_0x2a56aa});}}for(const _0x5abcbb of _0x4b64bf){!_0x369aa6[_0x38c0fe(0x21f)](_0x5abcbb[_0x38c0fe(0x19e)])&&_0x19dfe7[_0x38c0fe(0x228)]({'type':'delete','name':_0x5abcbb[_0x38c0fe(0x19e)],'existingActivation':_0x5abcbb});}return _0x19dfe7;}function a101_0x41db(){const _0x218101=['map','activations','keys','\x27\x20for\x20','WaitStep','Created\x20segment\x20\x27','stages','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','filter','104VgjdnY','\x27...','Fetching\x20','hasChanges','Deleted\x20activation\x20\x27','journeyBundleName','1138928smHUhX','join','errors','journey_created','existingSegments','segment_updated','skipSegments','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Stage\x20\x27','Name\x20has\x20already\x20been\x20taken','create','Activation','journeyBundlesByFolderAndName','embeddedSegmentNameToId','105952YGPZvW','Segment\x20not\x20found:\x20','goal\x20criteria','embedded_segment_creating','journey_entry_criteria_','update','activation_updated','Journey\x20\x27','valid','\x27\x20exit\x20criteria','state','steps','activation_template_id','journey','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','versionNumber','listSegments','stage\x20\x27','startsWith','sort','has','listActivations','updateSegmentById','Created\x20folder\x20\x27','journeyActivationNameToId','journey_creating','isNew','stringify','index','push','folderId','logSuccess','segment','./journey-yaml.js','connector_config','journeyStages','segmentNameToId','attributes','2388530DeGLUs','NOT_FOUND','utf-8','createActivation','ACTIVATION_SYNTAX_ERROR','activation_updating','dirname','add','entryCriteria','draft','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','INTERNAL','diff','journeyActivationStepId','with','split','journeyById','length','segment_created','segmentByFolderAndName','withProgress','branches','results','effectiveFolderId','existingActivation','action','connectionIdToNameMap','journeyId','activation_deleting','segmentId','folderPathToId','parse','object','entry','entry_criteria','onProgress','SEGMENT_SYNTAX_ERROR','activation_','folder_created','find','existingJourney','activationContext','getSegment','goal','yamlConfig','174StrDYF','progress','verbose','hex','journeys','parentFolder','folder','nameToType','buildUserMaps','resolveSegment','logWarning','milestone','JOURNEY_UPDATE_ERROR','Creating\x20activation\x20\x27','\x27\x20wait\x20condition','yamlActivation','resolveJourneyId','idToEmailMap','\x27\x20milestone','ACTIVATION_UPDATE_ERROR','createSegment','all','folder_creating','78035seKhqv','absolutePath','rule','description','toString','name','SEGMENT_NOT_FOUND','user','Creating\x20folder\x20\x27','validatedRequest','updated','createFolder','Updating\x20segment\x20\x27','logInfo','data','deleted','getJourney','segment_creating','parentId','created','isArray','message','):\x20','type','nameToId','../../utils/async.js','DecisionPoint','toLowerCase','slice','Failed\x20to\x20','columns','activationStepsById','delete','from','connection','embedded_segment_created','get','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','1053529cwowCT','replace','size','waitCondition','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','all_columns','exitCriterias','Updated\x20segment\x20\x27','segmentFolderId','behavior','activation_created','\x27\x20decision\x20point\x20branch\x20\x27','includes','sha1','\x20(referenced\x20in\x20journey\x20','\x0a\x20\x20','relationships','10258336erjOof','Deleted\x20segment\x20\x27','9oYmfLy','relative','./child-segment-yaml.js','__pending_act_','segments','folderPath','JOURNEY_SYNTAX_ERROR','createdSegmentId','Entry\x20criteria:\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','__pending_','set','activationParams','existingSegment','max','getActivation','logDeleted','Activation\x20not\x20found:\x20','Creating\x20segment\x20\x27','kind','3562725BAGfqG','activationActions','segment_deleted','digest','item','reduce','notification'];a101_0x41db=function(){return _0x218101;};return a101_0x41db();}export function calculateSegmentDiff(_0x908254,_0x57ffa1,_0xa449c2,_0x13e63f,_0xfebe63){const _0xb737f5=segmentToYamlString(_0x908254);if(_0x57ffa1){const _0x3049f5=segmentWithActivationsToYaml(_0x57ffa1,_0xa449c2,undefined,_0x13e63f,_0xfebe63),_0x536194=segmentToYamlString(_0x3049f5),_0x3ad323=generateDiff(_0x536194,_0xb737f5),_0x2ce6e7=hasChanges(_0x3ad323);return{'isNew':![],'hasChanges':_0x2ce6e7,'diff':_0x2ce6e7?formatDiffWithColors(_0x3ad323):undefined};}const _0xb42ed2=generateDiff('',_0xb737f5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xb42ed2)};}export function calculateJourneyDiff(_0x1703fd,_0x5db44e){const _0xa24688=normalizeJourneyDef(_0x1703fd,_0x1703fd),_0x40ba24=a101_0x5ead0b(_0xa24688);if(_0x5db44e){const _0x5b9d68=normalizeJourneyDef(_0x5db44e,_0x1703fd),_0x5cc81b=a101_0x5ead0b(_0x5b9d68),_0x5e5a31=generateDiff(_0x5cc81b,_0x40ba24),_0x20b20d=hasChanges(_0x5e5a31);return{'isNew':![],'hasChanges':_0x20b20d,'diff':_0x20b20d?formatDiffWithColors(_0x5e5a31):undefined};}const _0x249d53=generateDiff('',_0x40ba24);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x249d53)};}export function findSegmentsToDelete(_0x1e222a,_0x19836e,_0x3cae45,_0x4b6463,_0xdde2f9){const _0x5649b0=a101_0x109af2,_0x4c3af1=new Set();for(const {yamlConfig:_0x32c18b,folderPath:_0x13db5e}of _0x19836e){_0x4c3af1[_0x5649b0(0x238)](_0x13db5e+':'+_0x32c18b[_0x5649b0(0x19e)]);}return _0x1e222a[_0x5649b0(0x1f6)](_0x37e47a=>{const _0x47fb71=_0x5649b0,_0x448bae=_0x37e47a[_0x47fb71(0x1c8)]?_0x3cae45['get'](_0x37e47a[_0x47fb71(0x1c8)][_0x47fb71(0x19d)]())||'':'',_0x1aa918=_0x448bae+':'+_0x37e47a[_0x47fb71(0x19e)];if(_0x4c3af1[_0x47fb71(0x21f)](_0x1aa918))return![];if(_0xdde2f9)return _0x448bae===_0x4b6463||_0x448bae[_0x47fb71(0x21d)](_0x4b6463+'/');return!![];});}export function findJourneysToDelete(_0x4ec16d,_0x1e8f9b,_0x42538b,_0x4eb48f,_0x471449){const _0x1c2697=a101_0x109af2,_0x18e988=new Set();for(const {yamlConfig:_0x2e2b51,folderPath:_0x460afa}of _0x1e8f9b){_0x18e988['add'](_0x460afa+':'+_0x2e2b51['name']);}return _0x4ec16d[_0x1c2697(0x1f6)](_0x2d0e23=>{const _0xa75e0b=_0x1c2697,_0x36d7c3=_0x2d0e23[_0xa75e0b(0x229)]?_0x42538b['get'](_0x2d0e23[_0xa75e0b(0x229)])||'':'',_0x438d37=_0x36d7c3+':'+_0x2d0e23[_0xa75e0b(0x1fc)];if(_0x18e988[_0xa75e0b(0x21f)](_0x438d37))return![];if(_0x471449)return _0x36d7c3===_0x4eb48f||_0x36d7c3['startsWith'](_0x4eb48f+'/');return!![];});}export function buildSegmentLookupMap(_0x3b231c,_0x26efdd){const _0x5960b4=a101_0x109af2,_0x5b8d61=new Map();for(const _0x41f252 of _0x3b231c){const _0x53aa60=_0x41f252[_0x5960b4(0x1c8)]?_0x26efdd[_0x5960b4(0x1bd)](_0x41f252[_0x5960b4(0x1c8)][_0x5960b4(0x19d)]())||'':'',_0x42c99d=_0x53aa60+':'+_0x41f252[_0x5960b4(0x19e)];_0x5b8d61[_0x5960b4(0x1de)](_0x42c99d,_0x41f252);}return _0x5b8d61;}export function buildSegmentNameToIdMap(_0x5d267e){const _0x2ddc5b=a101_0x109af2,_0x561e67=new Map();for(const _0x2db53 of _0x5d267e){_0x561e67[_0x2ddc5b(0x1de)](_0x2db53[_0x2ddc5b(0x19e)],_0x2db53['id']);}return _0x561e67;}export function buildJourneyBundleLookupMap(_0x1644d5,_0x4422b7){const _0x66cccf=a101_0x109af2,_0x4b0b80=new Map();for(const _0x179ac1 of _0x1644d5){const _0x3c3f8d=_0x179ac1[_0x66cccf(0x229)]?_0x4422b7[_0x66cccf(0x1bd)](_0x179ac1[_0x66cccf(0x229)])||'':'',_0x57eda3=_0x3c3f8d+':'+_0x179ac1['journeyBundleName'];!_0x4b0b80['has'](_0x57eda3)&&_0x4b0b80['set'](_0x57eda3,[]),_0x4b0b80[_0x66cccf(0x1bd)](_0x57eda3)[_0x66cccf(0x228)](_0x179ac1);}for(const _0x1caa0a of _0x4b0b80['values']()){_0x1caa0a[_0x66cccf(0x21e)]((_0x207a5a,_0x3a05d9)=>(_0x207a5a['versionNumber']||0x0)-(_0x3a05d9[_0x66cccf(0x21a)]||0x0));}return _0x4b0b80;}export function collectFoldersToCreate(_0x4398c1,_0x3828d2){const _0xc9106=a101_0x109af2,_0x9a25df=new Set();for(const _0x4e8936 of _0x4398c1){if(!_0x4e8936)continue;if(_0x3828d2['has'](_0x4e8936))continue;const _0x59c1d3=_0x4e8936['split']('/');let _0x294709='';for(const _0x23e61e of _0x59c1d3){_0x294709=_0x294709?_0x294709+'/'+_0x23e61e:_0x23e61e,!_0x3828d2[_0xc9106(0x21f)](_0x294709)&&_0x9a25df[_0xc9106(0x238)](_0x294709);}}return _0x9a25df;}export function parseAndClassifyYamlFiles(_0x16139b,_0x429605,_0x21c43e){const _0x595c23=a101_0x109af2,_0x795df=[],_0x35e31e=[];for(const _0x748a02 of _0x16139b){const _0x498d2a=a101_0x1034f4[_0x595c23(0x1d4)](_0x429605,a101_0x1034f4[_0x595c23(0x237)](_0x748a02)),_0x20ed48=_0x498d2a==='.'?'':_0x498d2a,_0x5e61e1=readFileSync(_0x748a02,_0x595c23(0x233)),_0x25af2b=a101_0x373ffc[_0x595c23(0x250)](_0x5e61e1);if(isJourneyDef(_0x25af2b)){const _0x1f43b2=a101_0x402c83(_0x5e61e1);_0x35e31e['push']({'yamlConfig':_0x1f43b2,'folderPath':_0x20ed48,'sourcePath':_0x748a02});}else{if(!_0x21c43e?.[_0x595c23(0x203)]){const _0x256e16=parseSegmentYamlFile(_0x5e61e1),_0x1f7fe3=normalizeChildSegmentYaml(_0x256e16);_0x795df['push']({'yamlConfig':_0x1f7fe3,'folderPath':_0x20ed48,'sourcePath':_0x748a02});}}}return{'segments':_0x795df,'journeys':_0x35e31e};}export function validateParsedFiles(_0x4eb39b,_0x170d18){const _0x3c7609=a101_0x109af2,_0x1fdd1e=[];for(const {yamlConfig:_0x43e0f6,sourcePath:_0x4e6032}of _0x4eb39b['segments']){const _0x576b25=readFileSync(_0x4e6032,_0x3c7609(0x233)),_0xde47dc=a101_0x373ffc['parseDocument'](_0x576b25),_0x23bab1=validateSegmentDef(_0x43e0f6,{'source':_0x576b25,'document':_0xde47dc});if(!_0x23bab1[_0x3c7609(0x213)]){const _0x52b7ce=a101_0x1034f4['relative'](_0x170d18,_0x4e6032);_0x1fdd1e[_0x3c7609(0x228)]({'filePath':_0x52b7ce,'source':_0x576b25,'result':_0x23bab1,'isJourney':![]});}}for(const {yamlConfig:_0x58d53c,sourcePath:_0x509915}of _0x4eb39b['journeys']){const _0x9fbeb6=readFileSync(_0x509915,_0x3c7609(0x233)),_0x5b8bf1=a101_0x373ffc['parseDocument'](_0x9fbeb6),_0x377429=validateJourneyDef(_0x58d53c,{'source':_0x9fbeb6,'document':_0x5b8bf1});if(!_0x377429['valid']){const _0xb38d36=a101_0x1034f4[_0x3c7609(0x1d4)](_0x170d18,_0x509915);_0x1fdd1e['push']({'filePath':_0xb38d36,'source':_0x9fbeb6,'result':_0x377429,'isJourney':!![]});}}return _0x1fdd1e;}export function formatValidationErrors(_0xfd3c7e){const _0x37f6b3=a101_0x109af2,_0x4778d4=[];for(const {filePath:_0xdca4f,source:_0x5e9f71,result:_0x1c0127,isJourney:_0x62f6ca}of _0xfd3c7e){const _0x2a5192=_0x62f6ca?_0x37f6b3(0x218):_0x37f6b3(0x22b);_0x4778d4[_0x37f6b3(0x228)]('\x0a'+_0xdca4f+'\x20('+_0x2a5192+_0x37f6b3(0x1af)+_0x1c0127[_0x37f6b3(0x1ff)]['length']+'\x20error(s)'),_0x4778d4[_0x37f6b3(0x228)](formatValidationResult(_0x1c0127,_0x5e9f71,_0xdca4f));}return _0x4778d4[_0x37f6b3(0x1fe)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2e04b4){const _0xeb604f=a101_0x109af2,_0x321415=new Set(),_0x41a654=new Map(),_0x322893=collectSegmentUsageCounts(_0x2e04b4);if(_0x2e04b4[_0xeb604f(0x1d7)])for(const [_0x3b6bd4,_0x4dfff5]of Object['entries'](_0x2e04b4[_0xeb604f(0x1d7)])){_0x321415[_0xeb604f(0x238)](_0x3b6bd4);if(_0x4dfff5[_0xeb604f(0x19b)]){const _0x127d2f=yamlRuleToApi(_0x4dfff5['rule']),_0x3bbb14=apiRuleToYaml(_0x127d2f);_0x41a654[_0xeb604f(0x1de)](_0x3b6bd4,_0x3bbb14);}}const _0x42d18c=new Map();let _0x54b6a7=0x0;for(const [_0x543908,_0x2cd142]of _0x41a654){const _0x45800e=serializeExpandedRule(_0x2cd142,_0x41a654),_0x35f04f=_0x42d18c[_0xeb604f(0x1bd)](_0x45800e)||[];_0x35f04f[_0xeb604f(0x228)]({'name':_0x543908,'index':_0x54b6a7}),_0x42d18c[_0xeb604f(0x1de)](_0x45800e,_0x35f04f),_0x54b6a7++;}const _0x273511=new Map();for(const [_0xcdb6a4,_0x206531]of _0x42d18c){const _0x339380=_0x206531[_0xeb604f(0x1b5)]()['sort']((_0xdbb9a7,_0x107d4a)=>{const _0x8613d8=_0xeb604f,_0x2508ca=_0x322893[_0x8613d8(0x1bd)](_0xdbb9a7[_0x8613d8(0x19e)])||0x0,_0x211efa=_0x322893[_0x8613d8(0x1bd)](_0x107d4a[_0x8613d8(0x19e)])||0x0;if(_0x2508ca!==_0x211efa)return _0x211efa-_0x2508ca;return _0xdbb9a7[_0x8613d8(0x227)]-_0x107d4a[_0x8613d8(0x227)];})[_0xeb604f(0x1ee)](_0x5dc60f=>_0x5dc60f[_0xeb604f(0x19e)]),_0x33c2db=[];for(const _0x33f6ee of _0x339380){const _0x22026f=_0x322893[_0xeb604f(0x1bd)](_0x33f6ee)||0x0,_0x57389a=Math[_0xeb604f(0x1e1)](_0x22026f,0x1);for(let _0x3e16da=0x0;_0x3e16da<_0x57389a;_0x3e16da++){_0x33c2db[_0xeb604f(0x228)](_0x33f6ee);}}_0x273511['set'](_0xcdb6a4,_0x33c2db);}return{'existingLocalSegmentNames':_0x321415,'localSegmentRules':_0x41a654,'localExpandedRuleToNames':_0x273511};}async function buildServerSegmentRuleMap(_0x56c05b,_0x2845b2,_0x15685e,_0x5a2114){const _0x39e9e6=new Map(),_0x1aaf90=new Set(),_0x3f5f08=async _0x532e49=>{const _0x57ca39=a101_0x383a;if(_0x1aaf90[_0x57ca39(0x21f)](_0x532e49))return;_0x1aaf90[_0x57ca39(0x238)](_0x532e49);let _0x1fe6d3=_0x15685e['find'](_0x37bf03=>_0x37bf03['id']===_0x532e49);if(!_0x1fe6d3)try{_0x1fe6d3=await _0x56c05b['segment']['getSegment'](_0x2845b2,_0x532e49);}catch{return;}if(!_0x1fe6d3?.[_0x57ca39(0x19b)])return;const _0x13071c=apiRuleToYaml(_0x1fe6d3['rule']);_0x39e9e6['set'](_0x532e49,_0x13071c);const _0x4c4053=collectSegmentRefsFromRule(_0x13071c);for(const _0x31a0b2 of _0x4c4053){await _0x3f5f08(_0x31a0b2);}};for(const _0x434fe4 of _0x5a2114){await _0x3f5f08(_0x434fe4);}return _0x39e9e6;}export function createSegmentIdResolver(_0x182dae,_0x16b699){return async _0x10ae37=>{const _0x38a718=a101_0x383a,_0x417eef=_0x182dae[_0x38a718(0x1bd)](_0x10ae37);if(!_0x417eef)throw new SDKError(ErrorCode[_0x38a718(0x19f)],_0x38a718(0x20c)+_0x10ae37+_0x38a718(0x1f5)+_0x16b699+'\x27)');return _0x417eef;};}export function extractRootFolderId(_0x2164d9){const _0x4a0be1=a101_0x109af2;return _0x2164d9[_0x4a0be1(0x1d0)]?.['parentSegmentFolder']?.[_0x4a0be1(0x1a7)]?.['id']||_0x2164d9[_0x4a0be1(0x1d0)]?.[_0x4a0be1(0x187)]?.[_0x4a0be1(0x1a7)]?.['id'];}export function buildConnectionMaps(_0x493144){const _0x175c82=a101_0x109af2,_0x534508=new Map(),_0x2b12b7=new Map(),_0x55bccc=new Map();for(const _0x326d9b of _0x493144){_0x534508[_0x175c82(0x1de)](_0x326d9b[_0x175c82(0x19e)],parseInt(_0x326d9b['id'],0xa)),_0x2b12b7[_0x175c82(0x1de)](_0x326d9b['id'],_0x326d9b[_0x175c82(0x19e)]),_0x55bccc[_0x175c82(0x1de)](_0x326d9b['name'],_0x326d9b['type']);}return{'nameToId':_0x534508,'idToName':_0x2b12b7,'nameToType':_0x55bccc};}export function calculatePushStats(_0x22cdfd,_0x5f5b0b,_0x431af8,_0xca4b70,_0x278ebc,_0x404b76,_0x26ee04){const _0x4cba94=a101_0x109af2,_0x21e87=_0x22cdfd[_0x4cba94(0x1f6)](_0x541629=>_0x541629[_0x4cba94(0x225)]),_0xc86e64=_0x22cdfd[_0x4cba94(0x1f6)](_0x33a485=>!_0x33a485[_0x4cba94(0x225)]&&_0x33a485['hasChanges']),_0x17900e=_0x22cdfd['filter'](_0x26d95a=>!_0x26d95a[_0x4cba94(0x225)]&&!_0x26d95a[_0x4cba94(0x1fa)]),_0x31c16f=_0x404b76?_0xca4b70:[],_0x3fdf88=_0x5f5b0b['filter'](_0x56cee1=>_0x56cee1['isNew']),_0xf6ca6=_0x5f5b0b['filter'](_0x868133=>!_0x868133['isNew']&&_0x868133[_0x4cba94(0x1fa)]),_0xc4dfc4=_0x5f5b0b[_0x4cba94(0x1f6)](_0x45d99e=>!_0x45d99e[_0x4cba94(0x225)]&&!_0x45d99e[_0x4cba94(0x1fa)]),_0x12a2c4=_0x404b76?_0x278ebc:[],_0x46053a=_0x22cdfd['flatMap'](_0xe19004=>_0xe19004[_0x4cba94(0x1e8)]),_0x29e2c3=_0x46053a[_0x4cba94(0x1f6)](_0x490a3f=>_0x490a3f['type']===_0x4cba94(0x207)),_0x50eecd=_0x46053a[_0x4cba94(0x1f6)](_0x48b0e3=>_0x48b0e3['type']===_0x4cba94(0x210)),_0x38cbd6=_0x46053a[_0x4cba94(0x1f6)](_0x2f9f6f=>_0x2f9f6f[_0x4cba94(0x1b0)]===_0x4cba94(0x1b9)),_0x2c549a=Array[_0x4cba94(0x1ba)](_0x431af8)[_0x4cba94(0x21e)](),_0x57ad6d=_0x26ee04?![]:_0x21e87[_0x4cba94(0x242)]>0x0||_0xc86e64[_0x4cba94(0x242)]>0x0||_0x31c16f[_0x4cba94(0x242)]>0x0,_0x61368b=_0x3fdf88[_0x4cba94(0x242)]>0x0||_0xf6ca6['length']>0x0||_0x12a2c4['length']>0x0,_0x5d077c=_0x26ee04?![]:_0x46053a[_0x4cba94(0x242)]>0x0,_0xe6bde1=_0x2c549a[_0x4cba94(0x242)]>0x0;return{'segments':{'new':_0x21e87,'changed':_0xc86e64,'unchanged':_0x17900e,'toDelete':_0x31c16f},'journeys':{'new':_0x3fdf88,'changed':_0xf6ca6,'unchanged':_0xc4dfc4,'toDelete':_0x12a2c4},'activations':{'all':_0x46053a,'toCreate':_0x29e2c3,'toUpdate':_0x50eecd,'toDelete':_0x38cbd6},'folders':{'toCreate':_0x2c549a},'counts':{'segments':{'new':_0x21e87[_0x4cba94(0x242)],'changed':_0xc86e64[_0x4cba94(0x242)],'unchanged':_0x17900e[_0x4cba94(0x242)],'toDelete':_0x31c16f[_0x4cba94(0x242)]},'journeys':{'new':_0x3fdf88['length'],'changed':_0xf6ca6[_0x4cba94(0x242)],'unchanged':_0xc4dfc4['length'],'toDelete':_0x12a2c4[_0x4cba94(0x242)]},'activations':{'create':_0x29e2c3[_0x4cba94(0x242)],'update':_0x50eecd[_0x4cba94(0x242)],'delete':_0x38cbd6['length']},'folders':_0x2c549a[_0x4cba94(0x242)]},'hasChanges':_0x57ad6d||_0x61368b||_0x5d077c||_0xe6bde1};}export async function buildPushExecutionContext(_0x30aff7,_0x342414,_0x16ed84,_0x1882e8,_0x4d1d0b,_0x25b868){const _0x52eef5=a101_0x109af2,_0x521df8=extractRootFolderId(_0x16ed84),{pathToId:_0x5d7327,idToPath:_0x5cfc7e}=buildFolderMaps(_0x4d1d0b),_0x1dd2da=buildSegmentNameToIdMap(_0x1882e8),_0x59a437=new Map(),{batchAsync:_0x5af6f6}=await import(_0x52eef5(0x1b2)),[_0x28b80a,_0x219f4b]=await Promise[_0x52eef5(0x197)]([_0x30aff7[_0x52eef5(0x1a0)][_0x52eef5(0x18a)](),_0x30aff7[_0x52eef5(0x1bb)]['list'](),((async()=>{!_0x25b868&&_0x1882e8['length']>0x0&&await _0x5af6f6(_0x1882e8,async _0x239acf=>{const _0xe762f0=a101_0x383a,_0x477123=await _0x30aff7[_0xe762f0(0x22b)]['listActivations'](_0x342414,_0x239acf['id']);_0x59a437['set'](_0x239acf['id'],_0x477123);});})())]),{emailToId:_0x312b20,idToEmail:_0x2d20b9}=_0x28b80a,_0x23a815=buildConnectionMaps(_0x219f4b);return{'rootFolderId':_0x521df8,'folderPathToId':_0x5d7327,'folderIdToPath':_0x5cfc7e,'segmentNameToId':_0x1dd2da,'activationsBySegmentId':_0x59a437,'emailToIdMap':_0x312b20,'idToEmailMap':_0x2d20b9,'connectionNameToIdMap':_0x23a815[_0x52eef5(0x1b1)],'connectionIdToNameMap':_0x23a815['idToName'],'connectionNameToTypeMap':_0x23a815[_0x52eef5(0x189)]};}export function createPushYamlContextForBundle(_0x9f338f,_0x38c989,_0x1aea91,_0xc993cb,_0x187be7,_0x517299,_0x4390e0,_0x1604cb){const {existingLocalSegmentNames:_0x1ece68,localExpandedRuleToNames:_0x161d6d}=_0xc993cb,_0x84002a=new Set(),_0x232012=new Map(),_0x5ba897=new Map(),_0xd8a7ee=new Map(),_0x2908a4=createJumpTargetCache(),_0x12df9b=new Map(),_0x31521e=new Map(),_0xcb1a01=new Set();let _0x10b374;const _0x2cd521=_0xd584c1=>{const _0xb362c={'resolveSegment':async _0xc19d0b=>{const _0x48dec7=a101_0x383a,_0x4c4499=_0xd8a7ee[_0x48dec7(0x1bd)](_0xc19d0b);if(_0x4c4499!==undefined)return{'name':_0x4c4499,'isJourneyLocal':!![]};try{let _0x4ad80b=_0x1aea91[_0x48dec7(0x17c)](_0x38e27c=>_0x38e27c['id']===_0xc19d0b);!_0x4ad80b&&(_0x4ad80b=await _0x9f338f[_0x48dec7(0x22b)][_0x48dec7(0x17f)](_0x38c989,_0xc19d0b));const _0x26b427=generateJourneyLocalName(_0x4ad80b[_0x48dec7(0x19e)]),_0x3911e9=_0x4ad80b[_0x48dec7(0x1e6)]===SEGMENT_KIND_JOURNEY&&_0x26b427!==undefined;let _0x465006=_0x4ad80b['name'],_0x543cd8;if(_0x3911e9&&_0x4ad80b[_0x48dec7(0x19b)]){const _0x52a1e2=apiRuleToYaml(_0x4ad80b[_0x48dec7(0x19b)]);_0x31521e['set'](_0xc19d0b,_0x52a1e2);const _0x58d8fd=async _0x132ea9=>{const _0xfacf33=_0x48dec7,_0x35cded=collectSegmentRefsFromRule(_0x132ea9);for(const _0x1427ad of _0x35cded){if(!_0x31521e[_0xfacf33(0x21f)](_0x1427ad))try{const _0x2e7433=await _0x9f338f[_0xfacf33(0x22b)][_0xfacf33(0x17f)](_0x38c989,_0x1427ad);if(_0x2e7433?.['rule']){const _0x3a0bb4=apiRuleToYaml(_0x2e7433[_0xfacf33(0x19b)]);_0x31521e[_0xfacf33(0x1de)](_0x1427ad,_0x3a0bb4),await _0x58d8fd(_0x3a0bb4);}}catch{}}};await _0x58d8fd(_0x52a1e2);const _0x488bf1=serializeExpandedRule(_0x52a1e2,_0x31521e),_0x45186c=_0x161d6d[_0x48dec7(0x1bd)](_0x488bf1);if(_0x45186c&&_0x45186c[_0x48dec7(0x242)]>0x0){const _0x5d746e=_0x232012[_0x48dec7(0x1bd)](_0x488bf1)||0x0,_0x20e8b1=_0x45186c[_0x5d746e]||_0x45186c[_0x45186c[_0x48dec7(0x242)]-0x1];_0x232012[_0x48dec7(0x1de)](_0x488bf1,_0x5d746e+0x1),_0x465006=_0x20e8b1,_0x84002a[_0x48dec7(0x238)](_0x465006),_0xd8a7ee[_0x48dec7(0x1de)](_0xc19d0b,_0x465006);const _0x235b62=await resolveRuleSegmentRefs(_0x52a1e2,async _0x5cc22e=>{const _0x34215a=_0x48dec7,_0x1a76a5=_0xd8a7ee[_0x34215a(0x1bd)](_0x5cc22e);if(_0x1a76a5)return _0x1a76a5;const _0x228cdb=await _0x10b374['resolveSegment'](_0x5cc22e);return _0x228cdb['name'];});_0x543cd8={'description':_0x4ad80b['description'],'rule':_0x235b62};}else{const _0x38a05d=_0x12df9b['get'](_0x488bf1);if(_0x38a05d)_0x465006=_0x38a05d,_0xd8a7ee[_0x48dec7(0x1de)](_0xc19d0b,_0x465006);else{if(_0x26b427){let _0x3ab711=_0x26b427,_0x4b167d=0x2;while(_0x84002a[_0x48dec7(0x21f)](_0x3ab711)||_0x1ece68[_0x48dec7(0x21f)](_0x3ab711)){_0x3ab711=_0x26b427+'_'+_0x4b167d,_0x4b167d++;}_0x84002a[_0x48dec7(0x238)](_0x3ab711),_0x465006=_0x3ab711;}_0xd8a7ee[_0x48dec7(0x1de)](_0xc19d0b,_0x465006),_0x12df9b[_0x48dec7(0x1de)](_0x488bf1,_0x465006);const _0x440cf8=await resolveRuleSegmentRefs(_0x52a1e2,async _0x338371=>{const _0x24f586=_0x48dec7,_0x2bf4bc=_0xd8a7ee[_0x24f586(0x1bd)](_0x338371);if(_0x2bf4bc)return _0x2bf4bc;const _0x3f2ad8=await _0x10b374[_0x24f586(0x18b)](_0x338371);return _0x3f2ad8[_0x24f586(0x19e)];});_0x543cd8={'description':_0x4ad80b['description'],'rule':_0x440cf8};}}}return{'name':_0x465006,'isJourneyLocal':_0x3911e9,'definition':_0x543cd8};}catch{return{'name':_0xc19d0b,'isJourneyLocal':![]};}},'resolveActivation':async _0xec0706=>{const _0x1a1626=a101_0x383a,_0x8f67e4=_0x5ba897['get'](_0xec0706);if(_0x8f67e4!==undefined)return{'name':_0x8f67e4,'isJourneyLocal':!![]};try{let _0x5e7a2e=_0x4390e0?.[_0x1a1626(0x1bd)](_0xec0706);!_0x5e7a2e&&(_0x5e7a2e=await _0x9f338f[_0x1a1626(0x218)][_0x1a1626(0x1e2)](_0xd584c1,_0xec0706));const _0x57d696=_0x5e7a2e[_0x1a1626(0x230)][_0x1a1626(0x1df)][_0x1a1626(0x19e)]||_0xec0706,_0x1b469e=sanitizeYamlKey(_0x57d696)||_0x1a1626(0x17a)+_0xec0706,_0x1e265b=_0x1b469e;_0x5ba897[_0x1a1626(0x1de)](_0xec0706,_0x1e265b);const _0x13a404=journeyActivationStepToYaml(_0x5e7a2e,_0x187be7,_0x517299);return{'name':_0x1e265b,'isJourneyLocal':!![],'definition':_0x13a404};}catch{return{'name':_0xec0706,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2f5c75,_0x3b2913)=>resolveJumpTarget(_0x2f5c75,_0x3b2913,_0x2908a4,async _0x4212b2=>{const _0x2508c3=a101_0x383a,_0x212187=_0x1604cb?.['get'](_0x4212b2);if(_0x212187)return _0x212187;return _0x9f338f[_0x2508c3(0x218)][_0x2508c3(0x1a9)](_0x4212b2);})};return _0x10b374=_0xb362c,_0xb362c;},_0x545e8c=async _0x2b076f=>{const _0xa7fb4a=a101_0x383a,{collectSegmentIdsFromJourneyApi:_0x31b1a8}=await import(_0xa7fb4a(0x22c)),{batchAsync:_0x2fd5c1}=await import(_0xa7fb4a(0x1b2)),_0x4191cb=new Set();for(const _0x442826 of _0x2b076f){let _0x2b4f68=_0x1604cb?.['get'](_0x442826);!_0x2b4f68&&(_0x2b4f68=await _0x9f338f[_0xa7fb4a(0x218)][_0xa7fb4a(0x1a9)](_0x442826));const _0x5c9329=_0x31b1a8(_0x2b4f68);for(const _0x4e7f1d of _0x5c9329){_0x4191cb[_0xa7fb4a(0x238)](_0x4e7f1d);}}let _0x4041b1=Array[_0xa7fb4a(0x1ba)](_0x4191cb);while(_0x4041b1['length']>0x0){const _0x4b0f60=_0x4041b1[_0xa7fb4a(0x1f6)](_0x5eb025=>!_0xcb1a01[_0xa7fb4a(0x21f)](_0x5eb025));if(_0x4b0f60[_0xa7fb4a(0x242)]===0x0)break;const _0x1030d8=await _0x2fd5c1(_0x4b0f60,async _0x2a3ead=>{const _0x9c3bce=_0xa7fb4a;_0xcb1a01[_0x9c3bce(0x238)](_0x2a3ead);let _0x20cb0b=_0x1aea91[_0x9c3bce(0x17c)](_0x1cca38=>_0x1cca38['id']===_0x2a3ead);if(!_0x20cb0b)try{_0x20cb0b=await _0x9f338f[_0x9c3bce(0x22b)][_0x9c3bce(0x17f)](_0x38c989,_0x2a3ead);}catch{return null;}return{'segmentId':_0x2a3ead,'segment':_0x20cb0b};},0xa),_0x27e91f=new Set();for(const _0x444d51 of _0x1030d8){if(!_0x444d51?.[_0xa7fb4a(0x22b)]?.['rule'])continue;const _0x50ce3b=apiRuleToYaml(_0x444d51[_0xa7fb4a(0x22b)][_0xa7fb4a(0x19b)]);_0x31521e[_0xa7fb4a(0x1de)](_0x444d51['segmentId'],_0x50ce3b);const _0x147366=collectSegmentRefsFromRule(_0x50ce3b);for(const _0x14b7b2 of _0x147366){!_0xcb1a01['has'](_0x14b7b2)&&_0x27e91f[_0xa7fb4a(0x238)](_0x14b7b2);}}_0x4041b1=Array[_0xa7fb4a(0x1ba)](_0x27e91f);}};return{'createYamlContext':_0x2cd521,'prefetchJourneySegments':_0x545e8c};}export async function executePushSegments(_0x1e7cc8,_0x2dfb7c,_0x297d1a,_0x4e673b,_0x19f17e){const _0x3c12cf=a101_0x109af2,{segmentDefToCreateRequest:_0x173f0c,segmentDefToUpdateRequest:_0x28df62}=await import('./child-segment-yaml.js'),_0x1ec420=_0x297d1a['folderPathToId'],_0x144844=0x5,_0x478426=async _0x60457f=>{const _0xdd4530=a101_0x383a,_0x13f7c2=_0x60457f[_0xdd4530(0x1d8)]?_0x1ec420[_0xdd4530(0x1bd)](_0x60457f[_0xdd4530(0x1d8)]):undefined;let _0x436278;const _0x54f9ad={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x60457f[_0xdd4530(0x225)]){_0x19f17e[_0xdd4530(0x178)]?.({'type':_0xdd4530(0x1aa),'name':_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]});const _0x523d95=_0x173f0c(_0x60457f[_0xdd4530(0x181)],_0x13f7c2),_0x248ab4=await _0x19f17e[_0xdd4530(0x245)](_0xdd4530(0x1e5)+_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]+_0xdd4530(0x1f8),()=>_0x1e7cc8[_0xdd4530(0x22b)][_0xdd4530(0x196)](_0x4e673b[_0xdd4530(0x1ab)],_0x523d95));_0x436278=_0x248ab4['data']['id'],_0x54f9ad[_0xdd4530(0x1da)]={'name':_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)],'id':_0x436278},_0x19f17e[_0xdd4530(0x178)]?.({'type':_0xdd4530(0x243),'name':_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)],'segmentId':_0x436278}),_0x19f17e[_0xdd4530(0x22a)]?.(_0xdd4530(0x1f3)+_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]+'\x27'),_0x54f9ad['created']=0x1;}else{if(_0x60457f[_0xdd4530(0x1fa)]){_0x19f17e[_0xdd4530(0x178)]?.({'type':'segment_updating','name':_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]});const _0x36eaf5=_0x28df62(_0x60457f[_0xdd4530(0x181)]);_0x13f7c2!==_0x60457f[_0xdd4530(0x1e0)]?.['segmentFolderId']&&(_0x36eaf5[_0xdd4530(0x1c8)]=_0x13f7c2?parseInt(_0x13f7c2,0xa):undefined),await _0x19f17e[_0xdd4530(0x245)](_0xdd4530(0x1a5)+_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]+'\x27...',()=>_0x1e7cc8['segment']['updateSegmentById'](_0x4e673b[_0xdd4530(0x1ab)],_0x60457f['existingSegment']['id'],_0x36eaf5)),_0x436278=_0x60457f[_0xdd4530(0x1e0)]['id'],_0x19f17e[_0xdd4530(0x178)]?.({'type':_0xdd4530(0x202),'name':_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]}),_0x19f17e[_0xdd4530(0x22a)]?.(_0xdd4530(0x1c7)+_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]+'\x27'),_0x54f9ad[_0xdd4530(0x1a3)]=0x1;}else _0x436278=_0x60457f[_0xdd4530(0x1e0)]['id'];}}catch(_0x295459){const _0x3516c9=isHttp400Error(_0x295459),_0x2d4afc=_0x3516c9?ErrorCode[_0xdd4530(0x179)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x406ffb=getErrorMessage(_0x295459);throw new SDKError(_0x2d4afc,_0xdd4530(0x1b6)+(_0x60457f[_0xdd4530(0x225)]?'create':'update')+'\x20segment\x20from\x20file:\x20'+_0x60457f['absolutePath']+_0xdd4530(0x1cf)+_0x406ffb,_0x295459);}try{const _0x2ad202=await syncActivationsForSegment(_0x1e7cc8,_0x4e673b[_0xdd4530(0x1ab)],_0x436278,_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)],_0x60457f[_0xdd4530(0x1e8)],_0x19f17e,_0x60457f[_0xdd4530(0x19a)]);_0x54f9ad[_0xdd4530(0x1ef)]=_0x2ad202;}catch(_0x44aa37){if(_0x44aa37 instanceof SDKError)throw _0x44aa37;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xdd4530(0x204)+_0x60457f[_0xdd4530(0x181)][_0xdd4530(0x19e)]+'\x27\x20from\x20file:\x20'+_0x60457f[_0xdd4530(0x19a)]+_0xdd4530(0x1cf)+getErrorMessage(_0x44aa37),_0x44aa37);}return _0x54f9ad;},_0x397a79=await batchAsync(_0x2dfb7c,_0x478426,_0x144844),_0xc10ec9={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3da26b of _0x397a79){_0xc10ec9[_0x3c12cf(0x1ac)]+=_0x3da26b[_0x3c12cf(0x1ac)],_0xc10ec9[_0x3c12cf(0x1a3)]+=_0x3da26b[_0x3c12cf(0x1a3)],_0x3da26b[_0x3c12cf(0x1da)]&&_0xc10ec9['createdSegmentIds'][_0x3c12cf(0x1de)](_0x3da26b[_0x3c12cf(0x1da)][_0x3c12cf(0x19e)],_0x3da26b[_0x3c12cf(0x1da)]['id']),_0xc10ec9[_0x3c12cf(0x1ef)][_0x3c12cf(0x1ac)]+=_0x3da26b[_0x3c12cf(0x1ef)]['created'],_0xc10ec9[_0x3c12cf(0x1ef)]['updated']+=_0x3da26b[_0x3c12cf(0x1ef)][_0x3c12cf(0x1a3)],_0xc10ec9[_0x3c12cf(0x1ef)][_0x3c12cf(0x1a8)]+=_0x3da26b['activations'][_0x3c12cf(0x1a8)];}return _0xc10ec9;}async function syncActivationsForSegment(_0x4d6159,_0x4aa800,_0x153f48,_0x38b844,_0x14ef03,_0x5e639b,_0x3ad70d){const _0x472aa1=a101_0x109af2,_0x2e145b={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3a8ef2 of _0x14ef03){try{if(_0x3a8ef2[_0x472aa1(0x1b0)]===_0x472aa1(0x207)&&_0x3a8ef2[_0x472aa1(0x1a2)])_0x5e639b['onProgress']?.({'type':'activation_creating','segmentName':_0x38b844,'activationName':_0x3a8ef2[_0x472aa1(0x19e)]}),await _0x5e639b[_0x472aa1(0x245)](_0x472aa1(0x18f)+_0x3a8ef2['name']+_0x472aa1(0x1f8),()=>_0x4d6159[_0x472aa1(0x22b)][_0x472aa1(0x234)](_0x4aa800,_0x153f48,_0x3a8ef2[_0x472aa1(0x1a2)])),_0x5e639b['onProgress']?.({'type':_0x472aa1(0x1ca),'segmentName':_0x38b844,'activationName':_0x3a8ef2['name']}),_0x5e639b[_0x472aa1(0x22a)]?.('Created\x20activation\x20\x27'+_0x3a8ef2[_0x472aa1(0x19e)]+'\x27'),_0x2e145b['created']++;else{if(_0x3a8ef2[_0x472aa1(0x1b0)]==='update'&&_0x3a8ef2[_0x472aa1(0x1a2)]&&_0x3a8ef2[_0x472aa1(0x249)])_0x5e639b[_0x472aa1(0x178)]?.({'type':_0x472aa1(0x236),'segmentName':_0x38b844,'activationName':_0x3a8ef2['name']}),await _0x5e639b[_0x472aa1(0x245)]('Updating\x20activation\x20\x27'+_0x3a8ef2[_0x472aa1(0x19e)]+'\x27...',()=>_0x4d6159[_0x472aa1(0x22b)]['updateActivation'](_0x4aa800,_0x153f48,_0x3a8ef2[_0x472aa1(0x249)]['id'],_0x3a8ef2[_0x472aa1(0x1a2)])),_0x5e639b[_0x472aa1(0x178)]?.({'type':_0x472aa1(0x211),'segmentName':_0x38b844,'activationName':_0x3a8ef2[_0x472aa1(0x19e)]}),_0x5e639b['logSuccess']?.('Updated\x20activation\x20\x27'+_0x3a8ef2['name']+'\x27'),_0x2e145b[_0x472aa1(0x1a3)]++;else _0x3a8ef2[_0x472aa1(0x1b0)]===_0x472aa1(0x1b9)&&_0x3a8ef2[_0x472aa1(0x249)]&&(_0x5e639b[_0x472aa1(0x178)]?.({'type':_0x472aa1(0x24d),'segmentName':_0x38b844,'activationName':_0x3a8ef2[_0x472aa1(0x19e)]}),await _0x5e639b[_0x472aa1(0x245)]('Deleting\x20activation\x20\x27'+_0x3a8ef2[_0x472aa1(0x19e)]+_0x472aa1(0x1f8),()=>_0x4d6159['segment']['deleteActivation'](_0x4aa800,_0x153f48,_0x3a8ef2['existingActivation']['id'])),_0x5e639b['onProgress']?.({'type':'activation_deleted','segmentName':_0x38b844,'activationName':_0x3a8ef2[_0x472aa1(0x19e)]}),_0x5e639b[_0x472aa1(0x1e3)]?.(_0x472aa1(0x1fb)+_0x3a8ef2[_0x472aa1(0x19e)]+'\x27'),_0x2e145b['deleted']++);}}catch(_0xe41c9e){const _0x44fd90=isHttp400Error(_0xe41c9e),_0x2125d6=_0x44fd90?ErrorCode[_0x472aa1(0x235)]:ErrorCode[_0x472aa1(0x195)],_0x49a0f3=getErrorMessage(_0xe41c9e);throw new SDKError(_0x2125d6,_0x472aa1(0x1b6)+_0x3a8ef2[_0x472aa1(0x1b0)]+'\x20activation\x20\x27'+_0x3a8ef2[_0x472aa1(0x19e)]+'\x27\x20from\x20file:\x20'+_0x3ad70d+_0x472aa1(0x1cf)+_0x49a0f3,_0xe41c9e);}}return _0x2e145b;}export async function executePushFolders(_0x37aa19,_0x5f1007,_0x44f719,_0x504508,_0x2ea1d5){const _0x56749a=a101_0x109af2,_0x163d4b=new Map(_0x44f719);for(const _0x3d6c1e of _0x5f1007){const _0x273c3c=_0x3d6c1e[_0x56749a(0x240)]('/'),_0x26f81c=_0x273c3c[_0x273c3c['length']-0x1],_0x25f1aa=_0x273c3c[_0x56749a(0x1b5)](0x0,-0x1)['join']('/'),_0x30a1d8=_0x163d4b[_0x56749a(0x1bd)](_0x25f1aa);_0x2ea1d5[_0x56749a(0x178)]?.({'type':_0x56749a(0x198),'folder':_0x3d6c1e});const _0x8dde94={'name':_0x26f81c,'parentFolderId':_0x30a1d8},_0x15baa5=await _0x2ea1d5['withProgress'](_0x56749a(0x1a1)+_0x3d6c1e+_0x56749a(0x1f8),()=>_0x37aa19[_0x56749a(0x22b)][_0x56749a(0x1a4)](_0x504508[_0x56749a(0x1ab)],_0x8dde94));_0x163d4b['set'](_0x3d6c1e,_0x15baa5['data']['id']),_0x2ea1d5[_0x56749a(0x178)]?.({'type':_0x56749a(0x17b),'folder':_0x3d6c1e,'folderId':_0x15baa5[_0x56749a(0x1a7)]['id']}),_0x2ea1d5[_0x56749a(0x1a6)]?.(_0x56749a(0x222)+_0x3d6c1e+'\x27');}return _0x163d4b;}export async function executePushSegmentDeletions(_0x2c9a06,_0x130545,_0x49dd99){const _0x444bbe=a101_0x109af2;if(_0x130545[_0x444bbe(0x242)]===0x0)return 0x0;const {batchAsync:_0x7ecd}=await import(_0x444bbe(0x1b2)),_0x12e3cd=0x5,_0x1dc36b=await _0x7ecd(_0x130545,async _0x425b0f=>{const _0x31ece7=_0x444bbe;return _0x49dd99[_0x31ece7(0x178)]?.({'type':'segment_deleting','name':_0x425b0f[_0x31ece7(0x19e)]}),await _0x2c9a06[_0x31ece7(0x22b)]['deleteSegment'](_0x425b0f['id']),_0x49dd99['onProgress']?.({'type':_0x31ece7(0x1e9),'name':_0x425b0f[_0x31ece7(0x19e)]}),_0x49dd99[_0x31ece7(0x1e3)]?.(_0x31ece7(0x1d2)+_0x425b0f[_0x31ece7(0x19e)]+'\x27'),0x1;},_0x12e3cd);return _0x1dc36b[_0x444bbe(0x1ec)]((_0xe26f2c,_0x52d98d)=>_0xe26f2c+_0x52d98d,0x0);}export async function executePushJourneys(_0x599253,_0x414c84,_0x4335c5,_0x5e22ce,_0x635f29){const _0x41e1d3=a101_0x109af2,{journeyDefToRequest:_0x122b12}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x14f1b4,yamlRuleToApi:_0x2b3c49,validateSegmentRule:_0x543ce3}=await import(_0x41e1d3(0x1d5)),_0x175526={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x53846f=new Map(_0x4335c5[_0x41e1d3(0x22f)]),_0x65e1bb=0x5;for(let _0x127928=0x0;_0x127928<_0x414c84[_0x41e1d3(0x242)];_0x127928+=_0x65e1bb){const _0x41e1e2=_0x414c84[_0x41e1d3(0x1b5)](_0x127928,_0x127928+_0x65e1bb),_0x4fcc0c=await Promise['all'](_0x41e1e2[_0x41e1d3(0x1ee)](async _0x52aaf4=>{const _0x57c0de=_0x41e1d3;if(!_0x52aaf4[_0x57c0de(0x225)]&&!_0x52aaf4[_0x57c0de(0x1fa)])return{'action':'unchanged','name':_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)],'journeyId':_0x52aaf4[_0x57c0de(0x17d)]?.['id']};const _0x5c56c3=_0x52aaf4[_0x57c0de(0x1d8)]?_0x4335c5['folderPathToId'][_0x57c0de(0x1bd)](_0x52aaf4['folderPath']):undefined;_0x635f29[_0x57c0de(0x178)]?.({'type':_0x52aaf4[_0x57c0de(0x225)]?_0x57c0de(0x224):'journey_updating','name':_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)]});try{const _0x120e00=await executeSingleJourneyPush(_0x599253,_0x52aaf4,{..._0x4335c5,'segmentNameToId':_0x53846f},{'parentId':_0x5e22ce[_0x57c0de(0x1ab)],'rootFolderId':_0x5e22ce['rootFolderId'],'folderId':_0x5c56c3,'verbose':_0x5e22ce[_0x57c0de(0x184)]},_0x635f29,{'journeyDefToRequest':_0x122b12,'activationDefToCreateRequest':_0x14f1b4,'yamlRuleToApi':_0x2b3c49,'validateSegmentRule':_0x543ce3});for(const [_0x4bf876,_0xdbb2f7]of _0x120e00[_0x57c0de(0x20a)]){_0x53846f[_0x57c0de(0x1de)](_0x4bf876,_0xdbb2f7),_0x175526[_0x57c0de(0x20a)][_0x57c0de(0x1de)](_0x4bf876,_0xdbb2f7);}if(_0x120e00[_0x57c0de(0x24a)]===_0x57c0de(0x1ac))_0x635f29[_0x57c0de(0x178)]?.({'type':_0x57c0de(0x200),'name':_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)],'journeyId':_0x120e00[_0x57c0de(0x24c)]}),_0x635f29[_0x57c0de(0x22a)]?.('Created\x20journey\x20\x27'+_0x52aaf4[_0x57c0de(0x181)]['name']+'\x27'),_0x175526[_0x57c0de(0x1ac)]++;else _0x120e00[_0x57c0de(0x24a)]===_0x57c0de(0x1a3)&&(_0x635f29['onProgress']?.({'type':'journey_updated','name':_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)]}),_0x635f29[_0x57c0de(0x22a)]?.('Updated\x20journey\x20\x27'+_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)]+'\x27'),_0x175526[_0x57c0de(0x1a3)]++);return{'action':_0x120e00[_0x57c0de(0x24a)],'name':_0x52aaf4[_0x57c0de(0x181)][_0x57c0de(0x19e)],'journeyId':_0x120e00['journeyId']};}catch(_0x3dfb85){const _0x23ff06=isHttp400Error(_0x3dfb85),_0x3dcfa0=_0x23ff06?ErrorCode[_0x57c0de(0x1d9)]:ErrorCode[_0x57c0de(0x18e)],_0x4b4a76=getErrorMessage(_0x3dfb85);throw new SDKError(_0x3dcfa0,_0x57c0de(0x1b6)+(_0x52aaf4[_0x57c0de(0x225)]?_0x57c0de(0x207):_0x57c0de(0x210))+'\x20journey\x20from\x20file:\x20'+_0x52aaf4[_0x57c0de(0x19a)]+_0x57c0de(0x1cf)+_0x4b4a76,_0x3dfb85);}}));_0x175526[_0x41e1d3(0x247)][_0x41e1d3(0x228)](..._0x4fcc0c);}return _0x175526;}async function executeSingleJourneyPush(_0x4bf59d,_0x2fa15a,_0xa73651,_0x40b266,_0x5cf2f3,_0x54b520){const _0x62cfa5=a101_0x109af2,{journeyDefToRequest:_0x2aa6e5,activationDefToCreateRequest:_0x3dba68,yamlRuleToApi:_0xedda1a,validateSegmentRule:_0x5904ce}=_0x54b520,_0x252342=new Map(),_0x231256=new Map(),_0x5b0044=new Map(),_0x28bbc1=new Map(),_0x30c476=new Map();let _0x355293;const _0x37daec=async()=>{const _0x5741f1=a101_0x383a;if(_0x355293)return;_0x355293=new Map();if(!_0x2fa15a['existingJourney'])return;const _0x3fae6f=await _0x4bf59d[_0x5741f1(0x218)][_0x5741f1(0x220)](_0x2fa15a[_0x5741f1(0x17d)]['id']);for(const _0x999eec of _0x3fae6f){const _0x55e5d5=journeyActivationStepToYaml(_0x999eec,_0xa73651['idToEmailMap'],_0xa73651[_0x5741f1(0x24b)]),_0x25a88b=activationSignature(_0x55e5d5);!_0x355293[_0x5741f1(0x21f)](_0x25a88b)&&_0x355293[_0x5741f1(0x1de)](_0x25a88b,_0x999eec['id']),_0x55e5d5[_0x5741f1(0x19e)]&&_0x231256['set'](_0x55e5d5[_0x5741f1(0x19e)],_0x999eec['id']);}};if(_0x2fa15a[_0x62cfa5(0x17d)]&&_0x2fa15a[_0x62cfa5(0x181)]['segments']){const _0x4a8e64=buildLocalExpandedRuleMappings(_0x2fa15a[_0x62cfa5(0x181)]),_0xfe573f=_0x4a8e64['localSegmentRules'];if(_0xfe573f[_0x62cfa5(0x1c1)]>0x0){const _0x381309=new Map();for(const [_0x47857a,_0x17187b]of _0xfe573f){const _0x43f5c7=serializeExpandedRule(_0x17187b,_0xfe573f);_0x381309[_0x62cfa5(0x1de)](_0x47857a,_0x43f5c7);}const _0x494c05=collectSegmentIdsFromJourneyApi(_0x2fa15a[_0x62cfa5(0x17d)]);if(_0x494c05[_0x62cfa5(0x1c1)]>0x0){const _0xcc9bde=await buildServerSegmentRuleMap(_0x4bf59d,_0x40b266['parentId'],_0xa73651[_0x62cfa5(0x201)],_0x494c05);if(_0xcc9bde[_0x62cfa5(0x1c1)]>0x0){const _0x397f39=new Map();for(const [_0x13cfa9,_0xd15338]of _0xcc9bde){const _0x313b05=serializeExpandedRule(_0xd15338,_0xcc9bde);!_0x397f39[_0x62cfa5(0x21f)](_0x313b05)&&_0x397f39[_0x62cfa5(0x1de)](_0x313b05,_0x13cfa9);}for(const [_0x4e6781,_0x5f0c28]of _0x381309){const _0x5375bd=_0x397f39[_0x62cfa5(0x1bd)](_0x5f0c28);_0x5375bd&&(_0x30c476['set'](_0x4e6781,_0x5375bd),_0xa73651[_0x62cfa5(0x22f)][_0x62cfa5(0x1de)](_0x4e6781,_0x5375bd));}}}}}const _0x569414={'resolveSegmentId':async _0x5e192b=>{const _0x489588=_0x62cfa5,_0x5c7b03=_0xa73651['segmentNameToId']['get'](_0x5e192b);if(!_0x5c7b03)throw new SDKError(ErrorCode[_0x489588(0x19f)],_0x489588(0x20c)+_0x5e192b+_0x489588(0x1ce)+_0x2fa15a[_0x489588(0x181)][_0x489588(0x19e)]+')');return _0x5c7b03;},'resolveEmbeddedSegmentId':async(_0x1713f5,_0x1281d8)=>{const _0x3f3d92=_0x62cfa5,_0x1e65f6=_0xa73651[_0x3f3d92(0x22f)][_0x3f3d92(0x1bd)](_0x1713f5);if(_0x1e65f6)return _0x1e65f6;const _0x4b1f89=_0x30c476['get'](_0x1713f5);if(_0x4b1f89)return _0xa73651['segmentNameToId'][_0x3f3d92(0x1de)](_0x1713f5,_0x4b1f89),_0x4b1f89;const _0x3521ed=_0xa73651[_0x3f3d92(0x201)]['find'](_0x351523=>_0x351523[_0x3f3d92(0x19e)]===_0x1713f5);if(_0x3521ed)return _0xa73651[_0x3f3d92(0x22f)]['set'](_0x1713f5,_0x3521ed['id']),_0x3521ed['id'];if(_0x2fa15a[_0x3f3d92(0x225)]){const {stageName:_0x59c5a3,criteriaName:_0x50b527}=findSegmentCriteriaLocation(_0x2fa15a[_0x3f3d92(0x181)],_0x1713f5);return _0x5904ce(_0x1713f5,_0x1281d8[_0x3f3d92(0x19b)]),_0x5b0044[_0x3f3d92(0x1de)](_0x1713f5,{'definition':_0x1281d8,'stageName':_0x59c5a3,'criteriaName':_0x50b527}),createPendingSegmentId(_0x1713f5);}const _0x53ef87=_0x2fa15a['existingJourney']?.['id'];if(!_0x53ef87)throw new SDKError(ErrorCode[_0x3f3d92(0x23c)],_0x3f3d92(0x1be));_0x5904ce(_0x1713f5,_0x1281d8[_0x3f3d92(0x19b)]);const _0x3b908f=generateDeterministicJourneySegmentName(_0x2fa15a[_0x3f3d92(0x181)][_0x3f3d92(0x19e)],_0x1713f5),_0x287b7b=_0xa73651[_0x3f3d92(0x201)][_0x3f3d92(0x17c)](_0x6a458f=>_0x6a458f[_0x3f3d92(0x19e)]===_0x3b908f),_0x288b08=createSegmentIdResolver(_0xa73651[_0x3f3d92(0x22f)],_0x1713f5),_0x178229=await resolveRuleSegmentIds(_0x1281d8[_0x3f3d92(0x19b)],_0x288b08);let _0x55421f;if(_0x287b7b)await _0x4bf59d[_0x3f3d92(0x22b)]['updateSegmentById'](_0x40b266[_0x3f3d92(0x1ab)],_0x287b7b['id'],{'description':_0x1281d8['description']||_0x3f3d92(0x1db)+_0x1713f5,'rule':_0xedda1a(_0x178229,!![]),'countPopulation':!![]}),_0x55421f=_0x287b7b['id'];else try{_0x55421f=await _0x4bf59d['segment']['createJourneySegment']({'name':_0x3b908f,'description':_0x1281d8[_0x3f3d92(0x19c)]||_0x3f3d92(0x1db)+_0x1713f5,'journeyId':_0x53ef87,'rule':_0xedda1a(_0x178229,!![]),'countPopulation':!![],'parentFolderId':_0x40b266['rootFolderId']||'','audienceId':_0x40b266[_0x3f3d92(0x1ab)]});}catch(_0x21a160){const _0x5b4431=_0x21a160 instanceof Error&&_0x21a160[_0x3f3d92(0x1ae)][_0x3f3d92(0x1cc)](_0x3f3d92(0x206));if(_0x5b4431){const _0x242f4c=await _0x4bf59d[_0x3f3d92(0x22b)][_0x3f3d92(0x21b)](_0x40b266[_0x3f3d92(0x1ab)]),_0x2c9bdf=_0x242f4c[_0x3f3d92(0x17c)](_0x543443=>_0x543443[_0x3f3d92(0x19e)]===_0x3b908f);if(_0x2c9bdf)await _0x4bf59d[_0x3f3d92(0x22b)][_0x3f3d92(0x221)](_0x40b266['parentId'],_0x2c9bdf['id'],{'description':_0x1281d8[_0x3f3d92(0x19c)]||_0x3f3d92(0x1db)+_0x1713f5,'rule':_0xedda1a(_0x178229,!![]),'countPopulation':!![]}),_0x55421f=_0x2c9bdf['id'];else throw _0x21a160;}else throw _0x21a160;}return _0xa73651[_0x3f3d92(0x22f)][_0x3f3d92(0x1de)](_0x1713f5,_0x55421f),_0x252342[_0x3f3d92(0x1de)](_0x1713f5,_0x55421f),_0x55421f;},'resolveActivationId':async _0x5469db=>{const _0x5d5e84=_0x62cfa5,_0x2133b8=_0x231256['get'](_0x5469db);if(_0x2133b8)return _0x2133b8;if(_0x2fa15a[_0x5d5e84(0x17d)]){await _0x37daec();const _0x5d2b08=_0x231256[_0x5d5e84(0x1bd)](_0x5469db);if(_0x5d2b08)return _0x5d2b08;}throw new SDKError(ErrorCode[_0x5d5e84(0x232)],_0x5d5e84(0x1e4)+_0x5469db+_0x5d5e84(0x1ce)+_0x2fa15a[_0x5d5e84(0x181)][_0x5d5e84(0x19e)]+').\x20'+_0x5d5e84(0x1c3));},'resolveEmbeddedActivationId':async(_0x4a244d,_0x2bd862)=>{const _0x48df42=_0x62cfa5,_0xbe0339=_0x231256[_0x48df42(0x1bd)](_0x4a244d);if(_0xbe0339)return _0xbe0339;if(_0x2fa15a[_0x48df42(0x225)])return _0x28bbc1[_0x48df42(0x1de)](_0x4a244d,_0x2bd862),createPendingActivationId(_0x4a244d);if(_0x2fa15a['existingJourney']){await _0x37daec();const _0x1405a2=_0x231256[_0x48df42(0x1bd)](_0x2bd862['name']);if(_0x1405a2)return _0x231256[_0x48df42(0x1de)](_0x4a244d,_0x1405a2),_0x1405a2;const _0x316bc1=activationSignature(_0x2bd862),_0x3789c4=_0x355293?.[_0x48df42(0x1bd)](_0x316bc1);if(_0x3789c4)return _0x231256[_0x48df42(0x1de)](_0x4a244d,_0x3789c4),_0x3789c4;const _0x395cbc=await _0x3dba68(_0x2bd862,_0xa73651[_0x48df42(0x17e)]),_0x281bc8=await _0x4bf59d[_0x48df42(0x218)]['createActivation'](_0x2fa15a[_0x48df42(0x17d)]['id'],_0x395cbc);return _0x231256[_0x48df42(0x1de)](_0x4a244d,_0x281bc8['id']),_0x281bc8['id'];}throw new SDKError(ErrorCode[_0x48df42(0x23c)],_0x48df42(0x23b));},'resolveJourneyId':async _0x12ebd0=>{const _0x4d536d=_0x62cfa5;try{return await _0x4bf59d[_0x4d536d(0x218)][_0x4d536d(0x192)](_0x40b266[_0x4d536d(0x1ab)],_0x12ebd0);}catch(_0x4f7310){throw new SDKError(ErrorCode['NOT_FOUND'],_0x4d536d(0x212)+_0x12ebd0+_0x4d536d(0x219)+_0x2fa15a[_0x4d536d(0x181)]['name']+'\x27)',_0x4f7310);}},'resolveStageId':async(_0x17b2f1,_0x33d2ea)=>{const _0x13025b=_0x62cfa5,_0x318745=await _0x4bf59d[_0x13025b(0x218)][_0x13025b(0x1a9)](_0x17b2f1),_0x11e66a=_0x318745[_0x13025b(0x230)][_0x13025b(0x22e)]['find'](_0x4315c4=>_0x4315c4[_0x13025b(0x19e)]['toLowerCase']()===_0x33d2ea[_0x13025b(0x1b4)]());if(!_0x11e66a?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x13025b(0x205)+_0x33d2ea+_0x13025b(0x1dc)+(_0x318745[_0x13025b(0x230)]['journeyBundleName']||_0x318745[_0x13025b(0x230)][_0x13025b(0x19e)])+'\x27');return _0x11e66a['id'];}},_0x103755=await _0x2aa6e5(_0x2fa15a[_0x62cfa5(0x181)],_0x40b266['parentId'],_0x569414),_0x94c81=_0x40b266[_0x62cfa5(0x229)]||_0x40b266['rootFolderId'];_0x94c81&&(_0x103755[_0x62cfa5(0x1d0)]={'parentFolder':{'data':{'id':_0x94c81,'type':_0x62cfa5(0x188)}}});if(_0x2fa15a['isNew']){if(_0x5b0044[_0x62cfa5(0x1c1)]>0x0||_0x28bbc1[_0x62cfa5(0x1c1)]>0x0)return await executeThreeStepJourneyCreate(_0x4bf59d,_0x2fa15a,_0x103755,{'pendingEmbeddedSegments':_0x5b0044,'pendingEmbeddedActivations':_0x28bbc1,'embeddedSegmentNameToId':_0x252342,'journeyActivationNameToId':_0x231256},{..._0x40b266,'effectiveFolderId':_0x94c81},_0xa73651,_0x5cf2f3,_0x54b520);else{ensureJourneyDefaults(_0x103755['attributes']);const _0x13aa00=await _0x4bf59d[_0x62cfa5(0x218)][_0x62cfa5(0x207)](_0x103755);return{'action':_0x62cfa5(0x1ac),'journeyId':_0x13aa00['id'],'embeddedSegmentNameToId':_0x252342};}}else{if(_0x2fa15a[_0x62cfa5(0x1fa)]&&_0x2fa15a['existingJourney'])return ensureJourneyDefaults(_0x103755[_0x62cfa5(0x230)]),await _0x4bf59d[_0x62cfa5(0x218)][_0x62cfa5(0x210)](_0x2fa15a[_0x62cfa5(0x17d)]['id'],_0x103755),{'action':'updated','journeyId':_0x2fa15a[_0x62cfa5(0x17d)]['id'],'embeddedSegmentNameToId':_0x252342};}return{'action':'unchanged','journeyId':_0x2fa15a[_0x62cfa5(0x17d)]?.['id'],'embeddedSegmentNameToId':_0x252342};}function findSegmentCriteriaLocation(_0x23b4cc,_0xf89e6a){const _0x3b6a82=a101_0x109af2,_0x40aee5=_0x23b4cc[_0x3b6a82(0x1f4)]||_0x23b4cc['journeys']?.[0x0]?.[_0x3b6a82(0x1f4)]||[];let _0x1a48cc=_0x3b6a82(0x252),_0x2879cc=_0xf89e6a;const _0x139dfb=_0x23b4cc[_0x3b6a82(0x180)]||_0x23b4cc[_0x3b6a82(0x186)]?.[0x0]?.[_0x3b6a82(0x180)];if(_0x139dfb?.[_0x3b6a82(0x22b)]===_0xf89e6a)return{'stageName':_0x3b6a82(0x180),'criteriaName':_0x139dfb[_0x3b6a82(0x19e)]||_0xf89e6a};_0x4bce79:for(const _0x25dccd of _0x40aee5){if(_0x25dccd[_0x3b6a82(0x253)]?.[_0x3b6a82(0x22b)]===_0xf89e6a){_0x1a48cc=_0x25dccd[_0x3b6a82(0x19e)],_0x2879cc=_0x25dccd[_0x3b6a82(0x253)][_0x3b6a82(0x19e)]||_0xf89e6a;break;}if(_0x25dccd[_0x3b6a82(0x216)])for(const _0x1002f0 of _0x25dccd[_0x3b6a82(0x216)]){if(_0x1002f0[_0x3b6a82(0x1b0)]==='decision_point'&&_0x1002f0[_0x3b6a82(0x23f)]?.['branches'])for(const _0x4ee642 of _0x1002f0[_0x3b6a82(0x23f)][_0x3b6a82(0x246)]){if(_0x4ee642[_0x3b6a82(0x22b)]===_0xf89e6a){_0x1a48cc=_0x25dccd[_0x3b6a82(0x19e)],_0x2879cc=_0x4ee642[_0x3b6a82(0x19e)]||_0xf89e6a;break _0x4bce79;}}}}return{'stageName':_0x1a48cc,'criteriaName':_0x2879cc};}async function executeThreeStepJourneyCreate(_0x4df074,_0x1b3041,_0x175e2a,_0x40d035,_0x5ad487,_0xa29d31,_0x5b4809,_0x11cdfb){const _0x308762=a101_0x109af2,{activationDefToCreateRequest:_0x8cef71,yamlRuleToApi:_0x98d49b}=_0x11cdfb,{pendingEmbeddedSegments:_0x39c123,pendingEmbeddedActivations:_0x56d35a,embeddedSegmentNameToId:_0x394abb}=_0x40d035,_0x4828d9=JSON['parse'](JSON[_0x308762(0x226)](_0x175e2a));ensureJourneyDefaults(_0x4828d9[_0x308762(0x230)]),stripPendingIds(_0x4828d9);const _0x3b807b=await _0x4df074[_0x308762(0x218)][_0x308762(0x207)](_0x4828d9),_0x58917b=_0x3b807b['id'],_0x3cf4ba=new Map();for(const _0x1c494b of _0x3b807b[_0x308762(0x230)][_0x308762(0x22e)]){_0x3cf4ba['set'](_0x1c494b['name'][_0x308762(0x1b4)](),_0x1c494b['id']);}for(const [_0x5b915f,{definition:_0x4161cc}]of _0x39c123){const _0x4a4179=generateDeterministicJourneySegmentName(_0x1b3041[_0x308762(0x181)][_0x308762(0x19e)],_0x5b915f);_0x5b4809[_0x308762(0x178)]?.({'type':_0x308762(0x20e),'journeyName':_0x1b3041['yamlConfig']['name'],'segmentName':_0x5b915f});const _0x7cefc=createSegmentIdResolver(_0xa29d31[_0x308762(0x22f)],_0x5b915f),_0x167499=await resolveRuleSegmentIds(_0x4161cc['rule'],_0x7cefc),_0x5eee43=await _0x4df074[_0x308762(0x22b)]['createJourneySegment']({'name':_0x4a4179,'description':_0x4161cc[_0x308762(0x19c)]||_0x308762(0x1db)+_0x5b915f,'journeyId':_0x58917b,'rule':_0x98d49b(_0x167499,!![]),'countPopulation':!![],'parentFolderId':_0x5ad487[_0x308762(0x248)]||'','audienceId':_0x5ad487[_0x308762(0x1ab)]});_0x394abb[_0x308762(0x1de)](_0x5b915f,_0x5eee43),_0xa29d31['segmentNameToId']['set'](_0x5b915f,_0x5eee43),_0x5b4809[_0x308762(0x178)]?.({'type':_0x308762(0x1bc),'journeyName':_0x1b3041[_0x308762(0x181)][_0x308762(0x19e)],'segmentName':_0x5b915f});}const _0x2f0ad2=new Map();for(const [_0x344c6a,_0xdae58b]of _0x56d35a){_0x5b4809['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x1b3041[_0x308762(0x181)][_0x308762(0x19e)],'activationName':_0x344c6a});const _0x10072d=await _0x8cef71(_0xdae58b,_0xa29d31[_0x308762(0x17e)]),_0xd75cbc=await _0x4df074['journey'][_0x308762(0x234)](_0x58917b,_0x10072d);_0x2f0ad2[_0x308762(0x1de)](_0x344c6a,_0xd75cbc['id']),_0x40d035[_0x308762(0x223)]['set'](_0x344c6a,_0xd75cbc['id']),_0x5b4809[_0x308762(0x178)]?.({'type':'embedded_activation_created','journeyName':_0x1b3041[_0x308762(0x181)]['name'],'activationName':_0x344c6a});}const _0x4b4ebe=JSON[_0x308762(0x250)](JSON['stringify'](_0x175e2a));return _0x4b4ebe['id']=_0x58917b,ensureJourneyDefaults(_0x4b4ebe['attributes']),resolvePendingIdsInRequest(_0x4b4ebe,_0x175e2a,_0x3cf4ba,_0x394abb,_0x2f0ad2,_0x5b4809),await _0x4df074[_0x308762(0x218)][_0x308762(0x210)](_0x58917b,_0x4b4ebe),{'action':'created','journeyId':_0x58917b,'embeddedSegmentNameToId':_0x394abb};}function stripPendingIds(_0x433082){const _0x16687f=a101_0x109af2;for(const _0x5a7539 of _0x433082[_0x16687f(0x230)][_0x16687f(0x22e)]||[]){_0x5a7539['entryCriteria']?.[_0x16687f(0x24e)]&&isPendingSegmentId(_0x5a7539['entryCriteria'][_0x16687f(0x24e)])&&delete _0x5a7539[_0x16687f(0x239)];if(_0x5a7539['steps'])for(const _0x4c642d of Object['keys'](_0x5a7539['steps'])){const _0x455f8f=_0x5a7539[_0x16687f(0x216)][_0x4c642d];_0x455f8f[_0x16687f(0x1b0)]===_0x16687f(0x208)&&_0x455f8f[_0x16687f(0x23e)]&&isPendingActivationId(_0x455f8f[_0x16687f(0x23e)])&&(_0x455f8f[_0x16687f(0x23e)]='');if(_0x455f8f[_0x16687f(0x1b0)]===_0x16687f(0x1b3)&&_0x455f8f['branches'])for(const _0x4ec413 of _0x455f8f[_0x16687f(0x246)]){_0x4ec413[_0x16687f(0x24e)]&&isPendingSegmentId(_0x4ec413[_0x16687f(0x24e)])&&(_0x4ec413[_0x16687f(0x24e)]='');}_0x455f8f[_0x16687f(0x1b0)]===_0x16687f(0x1f2)&&_0x455f8f[_0x16687f(0x1c2)]?.[_0x16687f(0x24e)]&&isPendingSegmentId(_0x455f8f['waitCondition']['segmentId'])&&(_0x455f8f[_0x16687f(0x1c2)][_0x16687f(0x24e)]='');}}}function resolvePendingIdsInRequest(_0x4644f2,_0x425fe5,_0x29f19d,_0x322be1,_0xdaf25,_0x296a89){const _0x4e21b2=a101_0x109af2,_0x4d191a=(_0x24beba,_0x4382fc)=>{const _0x26e97f=a101_0x383a;if(!isPendingSegmentId(_0x24beba))return _0x24beba;const _0x88a564=extractPendingSegmentName(_0x24beba),_0xb30bc8=_0x322be1['get'](_0x88a564);return!_0xb30bc8&&_0x296a89[_0x26e97f(0x18c)]?.(_0x26e97f(0x1c4)+_0x88a564+_0x26e97f(0x1f1)+_0x4382fc),_0xb30bc8;};if(_0x4644f2[_0x4e21b2(0x230)][_0x4e21b2(0x180)]?.[_0x4e21b2(0x24e)]&&isPendingSegmentId(_0x4644f2[_0x4e21b2(0x230)][_0x4e21b2(0x180)][_0x4e21b2(0x24e)])){const _0x3af999=_0x4d191a(_0x4644f2[_0x4e21b2(0x230)][_0x4e21b2(0x180)][_0x4e21b2(0x24e)],_0x4e21b2(0x20d));_0x3af999&&(_0x4644f2['attributes'][_0x4e21b2(0x180)][_0x4e21b2(0x24e)]=_0x3af999);}for(const _0x32dcef of _0x4644f2[_0x4e21b2(0x230)][_0x4e21b2(0x22e)]||[]){const _0x449d99=_0x29f19d[_0x4e21b2(0x1bd)](_0x32dcef[_0x4e21b2(0x19e)][_0x4e21b2(0x1b4)]());_0x449d99&&(_0x32dcef['id']=_0x449d99);if(_0x32dcef[_0x4e21b2(0x239)]?.['segmentId']&&isPendingSegmentId(_0x32dcef['entryCriteria'][_0x4e21b2(0x24e)])){const _0x400fb9=_0x4d191a(_0x32dcef['entryCriteria']['segmentId'],_0x4e21b2(0x21c)+_0x32dcef[_0x4e21b2(0x19e)]+'\x27\x20entry\x20criteria');_0x400fb9&&(_0x32dcef[_0x4e21b2(0x239)]['segmentId']=_0x400fb9);}if(_0x32dcef[_0x4e21b2(0x1c6)])for(const _0x5d8b82 of _0x32dcef['exitCriterias']){if(_0x5d8b82['segmentId']&&isPendingSegmentId(_0x5d8b82['segmentId'])){const _0x55a0b2=_0x4d191a(_0x5d8b82['segmentId'],'stage\x20\x27'+_0x32dcef[_0x4e21b2(0x19e)]+_0x4e21b2(0x214));_0x55a0b2&&(_0x5d8b82[_0x4e21b2(0x24e)]=_0x55a0b2);}}if(_0x32dcef['milestone']?.['segmentId']&&isPendingSegmentId(_0x32dcef[_0x4e21b2(0x18d)][_0x4e21b2(0x24e)])){const _0x1cb915=_0x4d191a(_0x32dcef['milestone'][_0x4e21b2(0x24e)],_0x4e21b2(0x21c)+_0x32dcef[_0x4e21b2(0x19e)]+_0x4e21b2(0x194));_0x1cb915&&(_0x32dcef[_0x4e21b2(0x18d)][_0x4e21b2(0x24e)]=_0x1cb915);}if(_0x32dcef['steps']){const _0x532798=_0x4b3053=>_0x425fe5[_0x4e21b2(0x230)][_0x4e21b2(0x22e)][_0x4e21b2(0x17c)](_0x33959e=>_0x33959e['name']['toLowerCase']()===_0x32dcef[_0x4e21b2(0x19e)][_0x4e21b2(0x1b4)]())?.[_0x4e21b2(0x216)]?.[_0x4b3053];for(const _0x4b2c6e of Object[_0x4e21b2(0x1f0)](_0x32dcef[_0x4e21b2(0x216)])){const _0xa36b1c=_0x32dcef[_0x4e21b2(0x216)][_0x4b2c6e],_0x192130=_0x532798(_0x4b2c6e);if(_0xa36b1c['type']===_0x4e21b2(0x208)&&_0xa36b1c[_0x4e21b2(0x23e)]&&(isPendingActivationId(_0xa36b1c[_0x4e21b2(0x23e)])||_0xa36b1c[_0x4e21b2(0x23e)]==='')){if(_0x192130?.[_0x4e21b2(0x23e)]&&isPendingActivationId(_0x192130[_0x4e21b2(0x23e)])){const _0x5e0317=extractPendingActivationName(_0x192130['journeyActivationStepId']),_0x5c21bb=_0xdaf25[_0x4e21b2(0x1bd)](_0x5e0317);_0x5c21bb&&(_0xa36b1c[_0x4e21b2(0x23e)]=_0x5c21bb);}}if(_0xa36b1c[_0x4e21b2(0x1b0)]===_0x4e21b2(0x1b3)&&_0xa36b1c[_0x4e21b2(0x246)]&&_0x192130?.[_0x4e21b2(0x246)])for(let _0x579a46=0x0;_0x579a46<_0xa36b1c[_0x4e21b2(0x246)][_0x4e21b2(0x242)];_0x579a46++){const _0x3df8ae=_0xa36b1c[_0x4e21b2(0x246)][_0x579a46],_0x3e494e=_0x192130['branches'][_0x579a46];if(_0x3e494e?.[_0x4e21b2(0x24e)]&&isPendingSegmentId(_0x3e494e[_0x4e21b2(0x24e)])){const _0x4887d2=_0x4d191a(_0x3e494e[_0x4e21b2(0x24e)],_0x4e21b2(0x21c)+_0x32dcef[_0x4e21b2(0x19e)]+_0x4e21b2(0x1cb)+(_0x3df8ae[_0x4e21b2(0x19e)]||_0x579a46)+'\x27');_0x4887d2&&(_0x3df8ae[_0x4e21b2(0x24e)]=_0x4887d2);}}if(_0xa36b1c[_0x4e21b2(0x1b0)]==='WaitStep'&&_0xa36b1c[_0x4e21b2(0x1c2)]?.['segmentId']&&_0x192130?.['waitCondition']?.[_0x4e21b2(0x24e)]&&isPendingSegmentId(_0x192130[_0x4e21b2(0x1c2)][_0x4e21b2(0x24e)])){const _0x394f8d=_0x4d191a(_0x192130['waitCondition'][_0x4e21b2(0x24e)],_0x4e21b2(0x21c)+_0x32dcef[_0x4e21b2(0x19e)]+_0x4e21b2(0x190));_0x394f8d&&(_0xa36b1c[_0x4e21b2(0x1c2)][_0x4e21b2(0x24e)]=_0x394f8d);}}}}}
1
+ const a101_0x47621a=a101_0x10f7;(function(_0x307b15,_0x4fd061){const _0x18f3dc=a101_0x10f7,_0x56084c=_0x307b15();while(!![]){try{const _0x49862e=-parseInt(_0x18f3dc(0x24a))/0x1+-parseInt(_0x18f3dc(0x1f0))/0x2+parseInt(_0x18f3dc(0x1c6))/0x3*(-parseInt(_0x18f3dc(0x239))/0x4)+-parseInt(_0x18f3dc(0x291))/0x5+-parseInt(_0x18f3dc(0x1d7))/0x6+parseInt(_0x18f3dc(0x22a))/0x7*(parseInt(_0x18f3dc(0x218))/0x8)+parseInt(_0x18f3dc(0x212))/0x9;if(_0x49862e===_0x4fd061)break;else _0x56084c['push'](_0x56084c['shift']());}catch(_0x9ecd8a){_0x56084c['push'](_0x56084c['shift']());}}}(a101_0x2c95,0x6fd2a));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a101_0x47621a(0x276);export const PENDING_ACTIVATION_PREFIX=a101_0x47621a(0x23d);export function createPendingSegmentId(_0x4dd703){return''+PENDING_SEGMENT_PREFIX+_0x4dd703+'__';}export function isPendingSegmentId(_0x524192){const _0x9a705b=a101_0x47621a;return _0x524192[_0x9a705b(0x283)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x34c174){return _0x34c174['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x46d003){return''+PENDING_ACTIVATION_PREFIX+_0x46d003+'__';}export function isPendingActivationId(_0x75a8d1){const _0x4732be=a101_0x47621a;return _0x75a8d1[_0x4732be(0x283)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x30787c){const _0x24b3d5=a101_0x47621a;return _0x30787c[_0x24b3d5(0x1f3)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x482382,_0x211a8c){const _0x31fe3d=a101_0x47621a,_0x369002=_0x482382+'::'+(_0x211a8c['trim']()||_0x31fe3d(0x236)),_0x2e35cf=createHash(_0x31fe3d(0x1c5))[_0x31fe3d(0x1fb)](_0x369002)[_0x31fe3d(0x1db)](_0x31fe3d(0x22b))[_0x31fe3d(0x27a)](0x0,0xc);return _0x31fe3d(0x222)+_0x2e35cf;}export function ensureJourneyDefaults(_0x3b05df){const _0x12b080=a101_0x47621a;!_0x3b05df[_0x12b080(0x233)]&&(_0x3b05df[_0x12b080(0x233)]=''),!_0x3b05df[_0x12b080(0x1d0)]&&(_0x3b05df[_0x12b080(0x1d0)]='draft');}export function resolveTDFolderPath(_0x1efbfa,_0x45f14f,_0xbb7d){if(!_0x45f14f)return _0x1efbfa;if(_0x1efbfa===_0xbb7d||_0x1efbfa['startsWith'](_0xbb7d+'/'))return _0x1efbfa;return _0x1efbfa?_0xbb7d+'/'+_0x1efbfa:_0xbb7d;}export function addFoldersToCreate(_0x56a208,_0x59844d,_0x3f1d9c){const _0x30dc10=a101_0x47621a;if(!_0x56a208)return;if(_0x59844d['has'](_0x56a208))return;const _0x2d37cf=_0x56a208[_0x30dc10(0x22c)]('/');let _0x3e7a3e='';for(const _0x2d2e70 of _0x2d37cf){_0x3e7a3e=_0x3e7a3e?_0x3e7a3e+'/'+_0x2d2e70:_0x2d2e70,!_0x59844d[_0x30dc10(0x259)](_0x3e7a3e)&&_0x3f1d9c['add'](_0x3e7a3e);}}import*as a101_0x1a5e52 from'yaml';import{readFileSync}from'fs';import a101_0x53dcee from'path';import{isJourneyDef,parseYamlString as a101_0x1e68d0,toYamlString as a101_0x1fd0fa,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';function a101_0x10f7(_0x1e9acb,_0x4cf374){_0x1e9acb=_0x1e9acb-0x1c1;const _0x2c9535=a101_0x2c95();let _0x10f717=_0x2c9535[_0x1e9acb];return _0x10f717;}import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';function a101_0x2c95(){const _0x275f46=['fetchJourney','existingSegment','kind','existingSegments','listActivations','all','entry_criteria','embedded_activation_creating','Activation','branches','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','name','activation_creating','goal','has','list','folderPath','activationContext','columns','Created\x20segment\x20\x27','null','./journey-yaml.js','folderPathToId','resolveSegment','set','behavior','journey_creating','deleteSegment','Creating\x20segment\x20\x27','entry','Updating\x20activation\x20\x27','activation_created','embedded_activation_created','journey_updating','attributes','keys','segmentByFolderAndName','Activation\x20not\x20found:\x20','journeyActivationNameToId','toString','Creating\x20folder\x20\x27','versionNumber','idToEmailMap','__pending_','onProgress','withProgress','steps','slice','segments','Failed\x20to\x20','existingJourney','type','sort','embedded_segment_created','journeyBundleName','data','startsWith','with','yamlActivation','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27',').\x20','message','\x20activation\x20\x27','journeyBundlesByFolderAndName','rootFolderId','valid','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Name\x20has\x20already\x20been\x20taken','push','./child-segment-yaml.js','1216015EnAhRl','max','find','relationships','journey','diff','SEGMENT_NOT_FOUND','DecisionPoint','activations','\x20(referenced\x20in\x20journey\x20','\x27\x20from\x20file:\x20','\x0a\x20\x20','hasChanges','Entry\x20criteria:\x20','waitCondition','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','JOURNEY_SYNTAX_ERROR','ACTIVATION_UPDATE_ERROR','logSuccess','\x27\x20milestone','notification','action','resolveJourneyId','activation_deleting','getSegment','createFolder','get','sha1','9NTsjim','journeyById','createdSegmentId','\x27...','Stage\x20\x27','activationActions','rule','localSegmentRules','yamlConfig','deleteActivation','state','connectionIdToNameMap','join','journeyStages','activation_updated','milestone','decision_point','528216bkjSXx','isNew','INTERNAL','journeyActivationStepId','digest','existingActivation','deps','exitCriterias','folder_creating','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','\x20error(s)','verbose','getJourney','Updated\x20journey\x20\x27','updateSegmentById','segment_created','idToName','map','createdSegmentIds','createSegment','journey_created','SEGMENT_UPDATE_ERROR','Updating\x20segment\x20\x27','reduce','filter','629788UDkWRQ','JOURNEY_UPDATE_ERROR','create','replace','parseDocument','created','logInfo','WaitStep','errors','Created\x20activation\x20\x27','NOT_FOUND','update','activation_template_id','Journey\x20\x27','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','length','Created\x20journey\x20\x27','from','segmentId','activation_updating','journeyId','isArray','nameToType','connection','stage\x20\x27','segment_creating','Fetching\x20','entryCriteria','segment_deleting','SEGMENT_SYNTAX_ERROR','Segment\x20not\x20found:\x20','folder_created','activation_','../../utils/async.js','11178234bMtTCE','values','createJourneySegment','logDeleted','segmentFolderId','object','2640248cgxaTZ','size','utf-8','\x20segment\x20from\x20file:\x20','parse','buildUserMaps','listSegments','parentId','createActivation','Creating\x20activation\x20\x27','journey_entry_criteria_','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','folderId','schedule','journey_updated','progress','updated','updateActivation','14IKeixR','hex','split','embedded_segment_creating','\x27\x20for\x20','parentSegmentFolder','validatedRequest','journeys','deleted','description','stringify','segment_updating','segment','toLowerCase','index','146884wxShPf','activation_deleted','effectiveFolderId','embeddedSegmentNameToId','__pending_act_','add','delete','Deleted\x20segment\x20\x27','Updated\x20segment\x20\x27','goal\x20criteria','relative','segmentNameToId','item','logWarning','unchanged','absolutePath','\x20journey\x20from\x20file:\x20','687766iHVHVf'];a101_0x2c95=function(){return _0x275f46;};return a101_0x2c95();}import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x35b126){const _0x2e66a6=a101_0x47621a;if(Array[_0x2e66a6(0x205)](_0x35b126))return'['+_0x35b126[_0x2e66a6(0x1e8)](_0x3e700b=>stableStringify(_0x3e700b))['join'](',')+']';if(_0x35b126&&typeof _0x35b126===_0x2e66a6(0x217)){const _0x272919=_0x35b126,_0x4a518f=Object['keys'](_0x272919)[_0x2e66a6(0x27f)](),_0x3c109d=_0x4a518f['map'](_0x5dbc9a=>'\x22'+_0x5dbc9a+'\x22:'+stableStringify(_0x272919[_0x5dbc9a]));return'{'+_0x3c109d[_0x2e66a6(0x1d2)](',')+'}';}const _0xa8bbcc=JSON['stringify'](_0x35b126);return _0xa8bbcc===undefined?_0x2e66a6(0x25f):_0xa8bbcc;}function activationSignature(_0x20c467){const _0x4d5279=a101_0x47621a,_0x59e2db={'connection':_0x20c467[_0x4d5279(0x207)],..._0x20c467['all_columns']!==undefined&&{'all_columns':_0x20c467['all_columns']},..._0x20c467[_0x4d5279(0x25d)]!==undefined&&{'columns':_0x20c467[_0x4d5279(0x25d)]},..._0x20c467[_0x4d5279(0x264)]!==undefined&&{'behavior':_0x20c467[_0x4d5279(0x264)]},..._0x20c467[_0x4d5279(0x225)]!==undefined&&{'schedule':_0x20c467[_0x4d5279(0x225)]},..._0x20c467[_0x4d5279(0x2a5)]!==undefined&&{'notification':_0x20c467[_0x4d5279(0x2a5)]},..._0x20c467['connector_config']!==undefined&&{'connector_config':_0x20c467['connector_config']},..._0x20c467[_0x4d5279(0x1fc)]!==undefined&&{'activation_template_id':_0x20c467[_0x4d5279(0x1fc)]}};return stableStringify(_0x59e2db);}export async function prepareSegmentFiles(_0x403aa6,_0x54d903,_0x42f7c1,_0x33624e,_0x11c0d9){const _0x9e4475=a101_0x47621a,{activationDefToCreateRequest:_0x5023c6}=await import(_0x9e4475(0x290)),_0x3ce2aa=[],_0x422aa1=new Set();for(const {yamlConfig:_0x29abd9,folderPath:_0x435b45,sourcePath:_0x2b14f3}of _0x403aa6){const _0x47e187=resolveTDFolderPath(_0x435b45,_0x33624e,_0x11c0d9),_0x2f6bd2=_0x47e187+':'+_0x29abd9['name'],_0x3096d8=_0x54d903[_0x9e4475(0x26f)][_0x9e4475(0x1c4)](_0x2f6bd2),_0x13963e=_0x3096d8?_0x54d903['activationsBySegmentId'][_0x9e4475(0x1c4)](_0x3096d8['id'])||[]:[];addFoldersToCreate(_0x47e187,_0x54d903[_0x9e4475(0x261)],_0x422aa1);const _0x15d0ba=calculateActivationActions(_0x29abd9[_0x9e4475(0x299)]||[],_0x13963e,_0x54d903[_0x9e4475(0x275)],_0x54d903[_0x9e4475(0x1d1)]);for(const _0x5bf50b of _0x15d0ba){(_0x5bf50b['type']===_0x9e4475(0x1f2)||_0x5bf50b['type']===_0x9e4475(0x1fb))&&_0x5bf50b['yamlActivation']&&(_0x5bf50b[_0x9e4475(0x230)]=await _0x5023c6(_0x5bf50b[_0x9e4475(0x285)],_0x42f7c1));}const _0x2687fa=calculateSegmentDiff(_0x29abd9,_0x3096d8,_0x13963e,_0x54d903[_0x9e4475(0x275)],_0x54d903['connectionIdToNameMap']);_0x3ce2aa[_0x9e4475(0x28f)]({'relativePath':_0x29abd9[_0x9e4475(0x256)],'absolutePath':_0x2b14f3,'yamlConfig':_0x29abd9,'folderPath':_0x47e187,'existingSegment':_0x3096d8,'existingActivations':_0x13963e,'isNew':_0x2687fa[_0x9e4475(0x1d8)],'hasChanges':_0x2687fa['hasChanges'],'diff':_0x2687fa['diff'],'activationActions':_0x15d0ba});}return{'segmentFiles':_0x3ce2aa,'foldersToCreate':_0x422aa1};}export async function prepareJourneyFiles(_0x546870,_0x323931,_0x3cea0c,_0x4205da){const _0x4ed670=a101_0x47621a,_0x38151e=[],_0xc88495=new Set();for(const {yamlConfig:_0x476d13,folderPath:_0x2e9d14,sourcePath:_0x1324a1}of _0x546870){const _0x5eb5ea=resolveTDFolderPath(_0x2e9d14,_0x3cea0c,_0x4205da),_0x3d5a57=_0x5eb5ea+':'+_0x476d13[_0x4ed670(0x256)],_0x277374=_0x323931[_0x4ed670(0x28a)]['get'](_0x3d5a57);let _0x23652e,_0x56f5ff;if(_0x277374&&_0x277374[_0x4ed670(0x1ff)]>0x0){const _0x3b75e2=buildLocalExpandedRuleMappings(_0x476d13),{createYamlContext:_0x233fa8,prefetchJourneySegments:_0x2fcdd6}=createPushYamlContextForBundle(_0x323931[_0x4ed670(0x1dd)],_0x323931[_0x4ed670(0x21f)],_0x323931[_0x4ed670(0x24e)],_0x3b75e2,_0x323931[_0x4ed670(0x275)],_0x323931[_0x4ed670(0x1d1)],_0x323931['activationStepsById'],_0x323931['journeyById']);await _0x2fcdd6(_0x277374[_0x4ed670(0x1e8)](_0x424a52=>_0x424a52['id']));const _0x468977=hasMultipleVersions(_0x476d13),_0xe12809=async _0x4bfbf9=>{const _0x4c6336=_0x4ed670,_0x4e09b6=_0x323931[_0x4c6336(0x1c7)]?.[_0x4c6336(0x1c4)](_0x4bfbf9);if(_0x4e09b6)return _0x4e09b6;return _0x323931[_0x4c6336(0x24b)]({'journeyId':_0x4bfbf9,'journeyName':_0x476d13['name'],'isMultiVersion':_0x277374[_0x4c6336(0x1ff)]>0x1});};if(_0x468977&&_0x277374[_0x4ed670(0x1ff)]>0x1){const _0xf1de19=[];for(const _0x3f4d1d of _0x277374){const _0x5392ee=_0x3f4d1d['versionNumber']||0x1;_0x323931[_0x4ed670(0x227)]?.[_0x4ed670(0x1fb)]('Fetching\x20'+_0x476d13[_0x4ed670(0x256)]+'\x20v'+_0x5392ee);const _0x3a94ae=await _0xe12809(_0x3f4d1d['id']),_0x21807c=_0x233fa8(_0x3f4d1d['id']),_0x2bf343=await journeyResponseToDef(_0x3a94ae,_0x21807c);_0xf1de19['push']({'item':_0x3f4d1d,'yaml':_0x2bf343});}const _0x3598cf=buildLocalRuleToNameMappingFromJourney(_0x476d13);_0x56f5ff=buildMergedJourneyDef(_0xf1de19,_0x3598cf);const _0x222f9c=Math['max'](..._0xf1de19['map'](_0x3f5b5e=>_0x3f5b5e[_0x4ed670(0x245)][_0x4ed670(0x274)]||0x0)),_0x42caec=_0x277374[_0x4ed670(0x293)](_0xe31ff8=>(_0xe31ff8[_0x4ed670(0x274)]||0x0)===_0x222f9c);_0x42caec&&(_0x323931[_0x4ed670(0x227)]?.['update']('Fetching\x20'+_0x476d13[_0x4ed670(0x256)]+'\x20v'+_0x222f9c),_0x23652e=await _0xe12809(_0x42caec['id']));}else{const _0x3438b1=_0x277374[_0x277374['length']-0x1];_0x323931[_0x4ed670(0x227)]?.['update'](_0x4ed670(0x20a)+_0x476d13[_0x4ed670(0x256)]),_0x23652e=await _0xe12809(_0x3438b1['id']);const _0x34f92f=_0x233fa8(_0x3438b1['id']),_0x5e99d1=await journeyResponseToDef(_0x23652e,_0x34f92f),_0x23dfa0=buildLocalRuleToNameMappingFromJourney(_0x476d13);_0x56f5ff=buildMergedJourneyDef([{'item':_0x3438b1,'yaml':_0x5e99d1}],_0x23dfa0);}}addFoldersToCreate(_0x5eb5ea,_0x323931[_0x4ed670(0x261)],_0xc88495);const _0x316df8=calculateJourneyDiff(_0x476d13,_0x56f5ff);_0x38151e[_0x4ed670(0x28f)]({'relativePath':_0x476d13[_0x4ed670(0x256)],'absolutePath':_0x1324a1,'yamlConfig':_0x476d13,'folderPath':_0x5eb5ea,'existingJourney':_0x23652e,'isNew':_0x316df8['isNew'],'hasChanges':_0x316df8[_0x4ed670(0x29d)],'diff':_0x316df8[_0x4ed670(0x296)]});}return{'journeyFiles':_0x38151e,'foldersToCreate':_0xc88495};}export function calculateActivationActions(_0x11e3da,_0x28fb9b,_0x2d8452,_0x585cbf){const _0x1e3867=a101_0x47621a,_0x286e69=[],_0x284930=new Map();for(const _0x371a6d of _0x28fb9b){_0x284930[_0x1e3867(0x263)](_0x371a6d['name'],_0x371a6d);}const _0x23db45=new Map();for(const _0x2ad4cf of _0x11e3da){_0x23db45[_0x1e3867(0x263)](_0x2ad4cf[_0x1e3867(0x256)],_0x2ad4cf);}for(const _0x514990 of _0x11e3da){const _0x472c80=_0x284930['get'](_0x514990[_0x1e3867(0x256)]);if(!_0x472c80)_0x286e69[_0x1e3867(0x28f)]({'type':_0x1e3867(0x1f2),'name':_0x514990[_0x1e3867(0x256)],'yamlActivation':_0x514990});else{const _0x36e397=activationResponseToDef(_0x472c80,_0x2d8452,_0x585cbf),_0x14b21d=a101_0x1a5e52[_0x1e3867(0x234)](_0x36e397),_0x9ff307=a101_0x1a5e52[_0x1e3867(0x234)](_0x514990);_0x14b21d!==_0x9ff307&&_0x286e69[_0x1e3867(0x28f)]({'type':'update','name':_0x514990[_0x1e3867(0x256)],'yamlActivation':_0x514990,'existingActivation':_0x472c80});}}for(const _0x5d2d12 of _0x28fb9b){!_0x23db45[_0x1e3867(0x259)](_0x5d2d12[_0x1e3867(0x256)])&&_0x286e69['push']({'type':'delete','name':_0x5d2d12[_0x1e3867(0x256)],'existingActivation':_0x5d2d12});}return _0x286e69;}export function calculateSegmentDiff(_0x307f3e,_0x5556af,_0x4d2a9a,_0x45a720,_0x1da025){const _0x548c4a=segmentToYamlString(_0x307f3e);if(_0x5556af){const _0x1ac725=segmentWithActivationsToYaml(_0x5556af,_0x4d2a9a,undefined,_0x45a720,_0x1da025),_0x4abd49=segmentToYamlString(_0x1ac725),_0x4edfb7=generateDiff(_0x4abd49,_0x548c4a),_0x58ab2e=hasChanges(_0x4edfb7);return{'isNew':![],'hasChanges':_0x58ab2e,'diff':_0x58ab2e?formatDiffWithColors(_0x4edfb7):undefined};}const _0x198cf6=generateDiff('',_0x548c4a);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x198cf6)};}export function calculateJourneyDiff(_0x37e0cf,_0x437ebb){const _0x22c34b=normalizeJourneyDef(_0x37e0cf,_0x37e0cf),_0xdd9608=a101_0x1fd0fa(_0x22c34b);if(_0x437ebb){const _0x2e7a5f=normalizeJourneyDef(_0x437ebb,_0x37e0cf),_0xdd46f5=a101_0x1fd0fa(_0x2e7a5f),_0x3e2b9b=generateDiff(_0xdd46f5,_0xdd9608),_0x237327=hasChanges(_0x3e2b9b);return{'isNew':![],'hasChanges':_0x237327,'diff':_0x237327?formatDiffWithColors(_0x3e2b9b):undefined};}const _0x59e7de=generateDiff('',_0xdd9608);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x59e7de)};}export function findSegmentsToDelete(_0x36d34d,_0x8cd833,_0x1d7e81,_0x284611,_0x4a2c5f){const _0x5beeda=a101_0x47621a,_0x59b796=new Set();for(const {yamlConfig:_0x16d3fd,folderPath:_0x2818b7}of _0x8cd833){_0x59b796[_0x5beeda(0x23e)](_0x2818b7+':'+_0x16d3fd[_0x5beeda(0x256)]);}return _0x36d34d['filter'](_0x41c0af=>{const _0x48a279=_0x5beeda,_0x304ee7=_0x41c0af[_0x48a279(0x216)]?_0x1d7e81['get'](_0x41c0af[_0x48a279(0x216)][_0x48a279(0x272)]())||'':'',_0x19f43f=_0x304ee7+':'+_0x41c0af['name'];if(_0x59b796[_0x48a279(0x259)](_0x19f43f))return![];if(_0x4a2c5f)return _0x304ee7===_0x284611||_0x304ee7['startsWith'](_0x284611+'/');return!![];});}export function findJourneysToDelete(_0x2d18f6,_0x541d4b,_0x3ac2a2,_0x26603d,_0x31834e){const _0x3caecd=a101_0x47621a,_0x575d49=new Set();for(const {yamlConfig:_0x49c85b,folderPath:_0x129507}of _0x541d4b){_0x575d49[_0x3caecd(0x23e)](_0x129507+':'+_0x49c85b[_0x3caecd(0x256)]);}return _0x2d18f6[_0x3caecd(0x1ef)](_0x26ecde=>{const _0x120496=_0x3caecd,_0x2aee5d=_0x26ecde['folderId']?_0x3ac2a2[_0x120496(0x1c4)](_0x26ecde[_0x120496(0x224)])||'':'',_0x217cdd=_0x2aee5d+':'+_0x26ecde[_0x120496(0x281)];if(_0x575d49['has'](_0x217cdd))return![];if(_0x31834e)return _0x2aee5d===_0x26603d||_0x2aee5d[_0x120496(0x283)](_0x26603d+'/');return!![];});}export function buildSegmentLookupMap(_0x1c8c0c,_0x5a0599){const _0x5abce4=a101_0x47621a,_0x4b8534=new Map();for(const _0x4ce91e of _0x1c8c0c){const _0x5c4764=_0x4ce91e[_0x5abce4(0x216)]?_0x5a0599[_0x5abce4(0x1c4)](_0x4ce91e['segmentFolderId']['toString']())||'':'',_0x4c45a3=_0x5c4764+':'+_0x4ce91e[_0x5abce4(0x256)];_0x4b8534[_0x5abce4(0x263)](_0x4c45a3,_0x4ce91e);}return _0x4b8534;}export function buildSegmentNameToIdMap(_0x156e7d){const _0x562e9a=a101_0x47621a,_0x59bcbb=new Map();for(const _0x35d785 of _0x156e7d){_0x59bcbb[_0x562e9a(0x263)](_0x35d785[_0x562e9a(0x256)],_0x35d785['id']);}return _0x59bcbb;}export function buildJourneyBundleLookupMap(_0x4536d3,_0x1047f8){const _0x25c869=a101_0x47621a,_0x5124cc=new Map();for(const _0x4e202f of _0x4536d3){const _0x16d756=_0x4e202f['folderId']?_0x1047f8[_0x25c869(0x1c4)](_0x4e202f[_0x25c869(0x224)])||'':'',_0x5b80dd=_0x16d756+':'+_0x4e202f[_0x25c869(0x281)];!_0x5124cc[_0x25c869(0x259)](_0x5b80dd)&&_0x5124cc[_0x25c869(0x263)](_0x5b80dd,[]),_0x5124cc[_0x25c869(0x1c4)](_0x5b80dd)[_0x25c869(0x28f)](_0x4e202f);}for(const _0x518116 of _0x5124cc[_0x25c869(0x213)]()){_0x518116['sort']((_0x298d47,_0x3c034c)=>(_0x298d47[_0x25c869(0x274)]||0x0)-(_0x3c034c[_0x25c869(0x274)]||0x0));}return _0x5124cc;}export function collectFoldersToCreate(_0x5d2d09,_0x561199){const _0xc7b405=a101_0x47621a,_0x550e50=new Set();for(const _0x97a9ee of _0x5d2d09){if(!_0x97a9ee)continue;if(_0x561199[_0xc7b405(0x259)](_0x97a9ee))continue;const _0x566871=_0x97a9ee[_0xc7b405(0x22c)]('/');let _0x281e66='';for(const _0xdbe21d of _0x566871){_0x281e66=_0x281e66?_0x281e66+'/'+_0xdbe21d:_0xdbe21d,!_0x561199[_0xc7b405(0x259)](_0x281e66)&&_0x550e50[_0xc7b405(0x23e)](_0x281e66);}}return _0x550e50;}export function parseAndClassifyYamlFiles(_0x495fc0,_0x498d4e,_0xb42931){const _0x286c72=a101_0x47621a,_0x4c2f43=[],_0x3c5d7f=[];for(const _0x11c1cf of _0x495fc0){const _0x19156d=a101_0x53dcee['relative'](_0x498d4e,a101_0x53dcee['dirname'](_0x11c1cf)),_0x438b74=_0x19156d==='.'?'':_0x19156d,_0x347220=readFileSync(_0x11c1cf,_0x286c72(0x21a)),_0x4797fe=a101_0x1a5e52[_0x286c72(0x21c)](_0x347220);if(isJourneyDef(_0x4797fe)){const _0x4dc1ba=a101_0x1e68d0(_0x347220);_0x3c5d7f[_0x286c72(0x28f)]({'yamlConfig':_0x4dc1ba,'folderPath':_0x438b74,'sourcePath':_0x11c1cf});}else{if(!_0xb42931?.['skipSegments']){const _0xc12d79=parseSegmentYamlFile(_0x347220),_0x238e02=normalizeChildSegmentYaml(_0xc12d79);_0x4c2f43[_0x286c72(0x28f)]({'yamlConfig':_0x238e02,'folderPath':_0x438b74,'sourcePath':_0x11c1cf});}}}return{'segments':_0x4c2f43,'journeys':_0x3c5d7f};}export function validateParsedFiles(_0x20cc17,_0x5bab0e){const _0x1c2320=a101_0x47621a,_0x3cca2c=[];for(const {yamlConfig:_0x15ec73,sourcePath:_0x4ff3cb}of _0x20cc17[_0x1c2320(0x27b)]){const _0x41cfec=readFileSync(_0x4ff3cb,_0x1c2320(0x21a)),_0x53c7ef=a101_0x1a5e52[_0x1c2320(0x1f4)](_0x41cfec),_0x1ab7d4=validateSegmentDef(_0x15ec73,{'source':_0x41cfec,'document':_0x53c7ef});if(!_0x1ab7d4[_0x1c2320(0x28c)]){const _0x2826b0=a101_0x53dcee[_0x1c2320(0x243)](_0x5bab0e,_0x4ff3cb);_0x3cca2c['push']({'filePath':_0x2826b0,'source':_0x41cfec,'result':_0x1ab7d4,'isJourney':![]});}}for(const {yamlConfig:_0x6e80a3,sourcePath:_0x4330fc}of _0x20cc17[_0x1c2320(0x231)]){const _0x378509=readFileSync(_0x4330fc,_0x1c2320(0x21a)),_0x3881eb=a101_0x1a5e52[_0x1c2320(0x1f4)](_0x378509),_0x595a6b=validateJourneyDef(_0x6e80a3,{'source':_0x378509,'document':_0x3881eb});if(!_0x595a6b[_0x1c2320(0x28c)]){const _0x24ff90=a101_0x53dcee[_0x1c2320(0x243)](_0x5bab0e,_0x4330fc);_0x3cca2c[_0x1c2320(0x28f)]({'filePath':_0x24ff90,'source':_0x378509,'result':_0x595a6b,'isJourney':!![]});}}return _0x3cca2c;}export function formatValidationErrors(_0x3e3afb){const _0x550e67=a101_0x47621a,_0x187c12=[];for(const {filePath:_0x2d608e,source:_0x37091b,result:_0x37dc46,isJourney:_0x5d4765}of _0x3e3afb){const _0x520d74=_0x5d4765?_0x550e67(0x295):_0x550e67(0x236);_0x187c12[_0x550e67(0x28f)]('\x0a'+_0x2d608e+'\x20('+_0x520d74+'):\x20'+_0x37dc46[_0x550e67(0x1f8)][_0x550e67(0x1ff)]+_0x550e67(0x1e1)),_0x187c12[_0x550e67(0x28f)](formatValidationResult(_0x37dc46,_0x37091b,_0x2d608e));}return _0x187c12[_0x550e67(0x1d2)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x5a6244){const _0x469fef=a101_0x47621a,_0x2b285f=new Set(),_0x5cb2e5=new Map(),_0x2753bc=collectSegmentUsageCounts(_0x5a6244);if(_0x5a6244[_0x469fef(0x27b)])for(const [_0x242385,_0xa0aac]of Object['entries'](_0x5a6244['segments'])){_0x2b285f['add'](_0x242385);if(_0xa0aac['rule']){const _0x3f703f=yamlRuleToApi(_0xa0aac[_0x469fef(0x1cc)]),_0x2060b3=apiRuleToYaml(_0x3f703f);_0x5cb2e5['set'](_0x242385,_0x2060b3);}}const _0x19df2b=new Map();let _0x49d878=0x0;for(const [_0x3a799f,_0x23b6f6]of _0x5cb2e5){const _0xfe3b42=serializeExpandedRule(_0x23b6f6,_0x5cb2e5),_0x219108=_0x19df2b['get'](_0xfe3b42)||[];_0x219108[_0x469fef(0x28f)]({'name':_0x3a799f,'index':_0x49d878}),_0x19df2b[_0x469fef(0x263)](_0xfe3b42,_0x219108),_0x49d878++;}const _0xc49a9a=new Map();for(const [_0x525bd5,_0x4ae815]of _0x19df2b){const _0x254776=_0x4ae815['slice']()[_0x469fef(0x27f)]((_0x4863d3,_0x3050c8)=>{const _0x4de006=_0x469fef,_0x1752e0=_0x2753bc[_0x4de006(0x1c4)](_0x4863d3[_0x4de006(0x256)])||0x0,_0x409e6c=_0x2753bc['get'](_0x3050c8[_0x4de006(0x256)])||0x0;if(_0x1752e0!==_0x409e6c)return _0x409e6c-_0x1752e0;return _0x4863d3[_0x4de006(0x238)]-_0x3050c8[_0x4de006(0x238)];})['map'](_0x471093=>_0x471093[_0x469fef(0x256)]),_0x35d912=[];for(const _0x42b172 of _0x254776){const _0x349195=_0x2753bc[_0x469fef(0x1c4)](_0x42b172)||0x0,_0x35d321=Math[_0x469fef(0x292)](_0x349195,0x1);for(let _0x1e2af2=0x0;_0x1e2af2<_0x35d321;_0x1e2af2++){_0x35d912[_0x469fef(0x28f)](_0x42b172);}}_0xc49a9a[_0x469fef(0x263)](_0x525bd5,_0x35d912);}return{'existingLocalSegmentNames':_0x2b285f,'localSegmentRules':_0x5cb2e5,'localExpandedRuleToNames':_0xc49a9a};}async function buildServerSegmentRuleMap(_0x5bb563,_0x50c19f,_0x165846,_0x54afeb){const _0x24c41c=new Map(),_0x2044ad=new Set(),_0x2e131c=async _0x3ad62b=>{const _0x11414b=a101_0x10f7;if(_0x2044ad[_0x11414b(0x259)](_0x3ad62b))return;_0x2044ad[_0x11414b(0x23e)](_0x3ad62b);let _0x91a390=_0x165846[_0x11414b(0x293)](_0x3163b0=>_0x3163b0['id']===_0x3ad62b);if(!_0x91a390)try{_0x91a390=await _0x5bb563[_0x11414b(0x236)]['getSegment'](_0x50c19f,_0x3ad62b);}catch{return;}if(!_0x91a390?.[_0x11414b(0x1cc)])return;const _0x24a14e=apiRuleToYaml(_0x91a390[_0x11414b(0x1cc)]);_0x24c41c['set'](_0x3ad62b,_0x24a14e);const _0x540c97=collectSegmentRefsFromRule(_0x24a14e);for(const _0x4dc242 of _0x540c97){await _0x2e131c(_0x4dc242);}};for(const _0x3553cf of _0x54afeb){await _0x2e131c(_0x3553cf);}return _0x24c41c;}export function createSegmentIdResolver(_0x3e273c,_0x1c3380){return async _0x159cf8=>{const _0x239baa=a101_0x10f7,_0x44084b=_0x3e273c[_0x239baa(0x1c4)](_0x159cf8);if(!_0x44084b)throw new SDKError(ErrorCode[_0x239baa(0x297)],'Segment\x20not\x20found:\x20'+_0x159cf8+_0x239baa(0x28d)+_0x1c3380+'\x27)');return _0x44084b;};}export function extractRootFolderId(_0x49b460){const _0x54281c=a101_0x47621a;return _0x49b460['relationships']?.[_0x54281c(0x22f)]?.[_0x54281c(0x282)]?.['id']||_0x49b460[_0x54281c(0x294)]?.['parentFolder']?.['data']?.['id'];}export function buildConnectionMaps(_0x43638e){const _0x401da4=a101_0x47621a,_0xe34f7b=new Map(),_0x565060=new Map(),_0x4027af=new Map();for(const _0x5b3b32 of _0x43638e){_0xe34f7b[_0x401da4(0x263)](_0x5b3b32[_0x401da4(0x256)],parseInt(_0x5b3b32['id'],0xa)),_0x565060[_0x401da4(0x263)](_0x5b3b32['id'],_0x5b3b32[_0x401da4(0x256)]),_0x4027af[_0x401da4(0x263)](_0x5b3b32[_0x401da4(0x256)],_0x5b3b32[_0x401da4(0x27e)]);}return{'nameToId':_0xe34f7b,'idToName':_0x565060,'nameToType':_0x4027af};}export function calculatePushStats(_0x5e4787,_0x553a50,_0x5a5410,_0x4fcd37,_0x301bdf,_0x34ea0b,_0x145288){const _0x5ff32d=a101_0x47621a,_0x141315=_0x5e4787['filter'](_0x453f8a=>_0x453f8a[_0x5ff32d(0x1d8)]),_0x4ec159=_0x5e4787['filter'](_0x308e70=>!_0x308e70[_0x5ff32d(0x1d8)]&&_0x308e70['hasChanges']),_0x3f7914=_0x5e4787[_0x5ff32d(0x1ef)](_0x1fc48b=>!_0x1fc48b[_0x5ff32d(0x1d8)]&&!_0x1fc48b['hasChanges']),_0x87d00d=_0x34ea0b?_0x4fcd37:[],_0x5c733c=_0x553a50[_0x5ff32d(0x1ef)](_0x419b77=>_0x419b77[_0x5ff32d(0x1d8)]),_0x36ea35=_0x553a50[_0x5ff32d(0x1ef)](_0x4a2f34=>!_0x4a2f34['isNew']&&_0x4a2f34['hasChanges']),_0x84d803=_0x553a50[_0x5ff32d(0x1ef)](_0x543c1e=>!_0x543c1e['isNew']&&!_0x543c1e[_0x5ff32d(0x29d)]),_0x44f009=_0x34ea0b?_0x301bdf:[],_0x369cf2=_0x5e4787['flatMap'](_0x4fb200=>_0x4fb200[_0x5ff32d(0x1cb)]),_0x1d01e4=_0x369cf2[_0x5ff32d(0x1ef)](_0x1b60f9=>_0x1b60f9[_0x5ff32d(0x27e)]===_0x5ff32d(0x1f2)),_0x5495ba=_0x369cf2[_0x5ff32d(0x1ef)](_0x171ea8=>_0x171ea8[_0x5ff32d(0x27e)]===_0x5ff32d(0x1fb)),_0x40d55a=_0x369cf2[_0x5ff32d(0x1ef)](_0x200bae=>_0x200bae[_0x5ff32d(0x27e)]===_0x5ff32d(0x23f)),_0x2bb557=Array[_0x5ff32d(0x201)](_0x5a5410)['sort'](),_0xa72f06=_0x145288?![]:_0x141315['length']>0x0||_0x4ec159[_0x5ff32d(0x1ff)]>0x0||_0x87d00d[_0x5ff32d(0x1ff)]>0x0,_0x51404e=_0x5c733c['length']>0x0||_0x36ea35[_0x5ff32d(0x1ff)]>0x0||_0x44f009['length']>0x0,_0x1bdfa3=_0x145288?![]:_0x369cf2[_0x5ff32d(0x1ff)]>0x0,_0x4519ed=_0x2bb557[_0x5ff32d(0x1ff)]>0x0;return{'segments':{'new':_0x141315,'changed':_0x4ec159,'unchanged':_0x3f7914,'toDelete':_0x87d00d},'journeys':{'new':_0x5c733c,'changed':_0x36ea35,'unchanged':_0x84d803,'toDelete':_0x44f009},'activations':{'all':_0x369cf2,'toCreate':_0x1d01e4,'toUpdate':_0x5495ba,'toDelete':_0x40d55a},'folders':{'toCreate':_0x2bb557},'counts':{'segments':{'new':_0x141315[_0x5ff32d(0x1ff)],'changed':_0x4ec159[_0x5ff32d(0x1ff)],'unchanged':_0x3f7914['length'],'toDelete':_0x87d00d[_0x5ff32d(0x1ff)]},'journeys':{'new':_0x5c733c['length'],'changed':_0x36ea35[_0x5ff32d(0x1ff)],'unchanged':_0x84d803['length'],'toDelete':_0x44f009[_0x5ff32d(0x1ff)]},'activations':{'create':_0x1d01e4[_0x5ff32d(0x1ff)],'update':_0x5495ba['length'],'delete':_0x40d55a[_0x5ff32d(0x1ff)]},'folders':_0x2bb557['length']},'hasChanges':_0xa72f06||_0x51404e||_0x1bdfa3||_0x4519ed};}export async function buildPushExecutionContext(_0x4b5f9f,_0x3dfb0c,_0x4fc20c,_0x383b2a,_0x11035c,_0x240b9e){const _0x374b4f=a101_0x47621a,_0x1422f2=extractRootFolderId(_0x4fc20c),{pathToId:_0x3742f8,idToPath:_0x369b8b}=buildFolderMaps(_0x11035c),_0x416c91=buildSegmentNameToIdMap(_0x383b2a),_0x55a28d=new Map(),{batchAsync:_0x931b66}=await import(_0x374b4f(0x211)),[_0x4f2cf2,_0x4f0dfb]=await Promise[_0x374b4f(0x250)]([_0x4b5f9f['user'][_0x374b4f(0x21d)](),_0x4b5f9f[_0x374b4f(0x207)][_0x374b4f(0x25a)](),((async()=>{const _0x1eb54e=_0x374b4f;!_0x240b9e&&_0x383b2a[_0x1eb54e(0x1ff)]>0x0&&await _0x931b66(_0x383b2a,async _0x22bd5b=>{const _0x43e063=_0x1eb54e,_0x29952b=await _0x4b5f9f[_0x43e063(0x236)][_0x43e063(0x24f)](_0x3dfb0c,_0x22bd5b['id']);_0x55a28d[_0x43e063(0x263)](_0x22bd5b['id'],_0x29952b);});})())]),{emailToId:_0x2befe5,idToEmail:_0x2d7666}=_0x4f2cf2,_0x2f6565=buildConnectionMaps(_0x4f0dfb);return{'rootFolderId':_0x1422f2,'folderPathToId':_0x3742f8,'folderIdToPath':_0x369b8b,'segmentNameToId':_0x416c91,'activationsBySegmentId':_0x55a28d,'emailToIdMap':_0x2befe5,'idToEmailMap':_0x2d7666,'connectionNameToIdMap':_0x2f6565['nameToId'],'connectionIdToNameMap':_0x2f6565[_0x374b4f(0x1e7)],'connectionNameToTypeMap':_0x2f6565[_0x374b4f(0x206)]};}export function createPushYamlContextForBundle(_0x508963,_0xdb382c,_0x1656ec,_0x13c3b4,_0x48abe5,_0x1220c3,_0x2402ae,_0x2e4acf){const {existingLocalSegmentNames:_0x54b568,localExpandedRuleToNames:_0x7fdf99}=_0x13c3b4,_0x2028fe=new Set(),_0x6c249d=new Map(),_0x96082c=new Map(),_0x655d8c=new Map(),_0x1e0e99=createJumpTargetCache(),_0x2e2140=new Map(),_0x28ec4a=new Map(),_0x4ec0a7=new Set();let _0xc13e39;const _0x54aab7=_0xb50dce=>{const _0x1c737f={'resolveSegment':async _0x47d703=>{const _0x29da24=a101_0x10f7,_0x4c473a=_0x655d8c[_0x29da24(0x1c4)](_0x47d703);if(_0x4c473a!==undefined)return{'name':_0x4c473a,'isJourneyLocal':!![]};try{let _0x4082a9=_0x1656ec[_0x29da24(0x293)](_0x2570b6=>_0x2570b6['id']===_0x47d703);!_0x4082a9&&(_0x4082a9=await _0x508963[_0x29da24(0x236)]['getSegment'](_0xdb382c,_0x47d703));const _0x5b2ce4=generateJourneyLocalName(_0x4082a9[_0x29da24(0x256)]),_0x29ff9e=_0x4082a9[_0x29da24(0x24d)]===SEGMENT_KIND_JOURNEY&&_0x5b2ce4!==undefined;let _0x2d47d8=_0x4082a9[_0x29da24(0x256)],_0x259865;if(_0x29ff9e&&_0x4082a9[_0x29da24(0x1cc)]){const _0x5bfcdb=apiRuleToYaml(_0x4082a9['rule']);_0x28ec4a[_0x29da24(0x263)](_0x47d703,_0x5bfcdb);const _0x14b40b=async _0x134c13=>{const _0x933793=_0x29da24,_0x43fe87=collectSegmentRefsFromRule(_0x134c13);for(const _0x33d444 of _0x43fe87){if(!_0x28ec4a[_0x933793(0x259)](_0x33d444))try{const _0x373486=await _0x508963[_0x933793(0x236)][_0x933793(0x1c2)](_0xdb382c,_0x33d444);if(_0x373486?.[_0x933793(0x1cc)]){const _0x286694=apiRuleToYaml(_0x373486[_0x933793(0x1cc)]);_0x28ec4a['set'](_0x33d444,_0x286694),await _0x14b40b(_0x286694);}}catch{}}};await _0x14b40b(_0x5bfcdb);const _0xfadc2f=serializeExpandedRule(_0x5bfcdb,_0x28ec4a),_0x4af75c=_0x7fdf99[_0x29da24(0x1c4)](_0xfadc2f);if(_0x4af75c&&_0x4af75c[_0x29da24(0x1ff)]>0x0){const _0x7d7c39=_0x6c249d[_0x29da24(0x1c4)](_0xfadc2f)||0x0,_0x56e6cd=_0x4af75c[_0x7d7c39]||_0x4af75c[_0x4af75c['length']-0x1];_0x6c249d[_0x29da24(0x263)](_0xfadc2f,_0x7d7c39+0x1),_0x2d47d8=_0x56e6cd,_0x2028fe[_0x29da24(0x23e)](_0x2d47d8),_0x655d8c[_0x29da24(0x263)](_0x47d703,_0x2d47d8);const _0x574896=await resolveRuleSegmentRefs(_0x5bfcdb,async _0xbd0229=>{const _0x66876=_0x29da24,_0x662940=_0x655d8c[_0x66876(0x1c4)](_0xbd0229);if(_0x662940)return _0x662940;const _0xd14451=await _0xc13e39[_0x66876(0x262)](_0xbd0229);return _0xd14451[_0x66876(0x256)];});_0x259865={'description':_0x4082a9[_0x29da24(0x233)],'rule':_0x574896};}else{const _0x48a3ca=_0x2e2140[_0x29da24(0x1c4)](_0xfadc2f);if(_0x48a3ca)_0x2d47d8=_0x48a3ca,_0x655d8c['set'](_0x47d703,_0x2d47d8);else{if(_0x5b2ce4){let _0x4f9e14=_0x5b2ce4,_0x1d96b6=0x2;while(_0x2028fe[_0x29da24(0x259)](_0x4f9e14)||_0x54b568[_0x29da24(0x259)](_0x4f9e14)){_0x4f9e14=_0x5b2ce4+'_'+_0x1d96b6,_0x1d96b6++;}_0x2028fe[_0x29da24(0x23e)](_0x4f9e14),_0x2d47d8=_0x4f9e14;}_0x655d8c[_0x29da24(0x263)](_0x47d703,_0x2d47d8),_0x2e2140[_0x29da24(0x263)](_0xfadc2f,_0x2d47d8);const _0x7508cf=await resolveRuleSegmentRefs(_0x5bfcdb,async _0x453288=>{const _0x47e23a=_0x29da24,_0x5195ea=_0x655d8c[_0x47e23a(0x1c4)](_0x453288);if(_0x5195ea)return _0x5195ea;const _0x4802b0=await _0xc13e39[_0x47e23a(0x262)](_0x453288);return _0x4802b0['name'];});_0x259865={'description':_0x4082a9[_0x29da24(0x233)],'rule':_0x7508cf};}}}return{'name':_0x2d47d8,'isJourneyLocal':_0x29ff9e,'definition':_0x259865};}catch{return{'name':_0x47d703,'isJourneyLocal':![]};}},'resolveActivation':async _0x2e985d=>{const _0x19ab44=a101_0x10f7,_0x376517=_0x96082c['get'](_0x2e985d);if(_0x376517!==undefined)return{'name':_0x376517,'isJourneyLocal':!![]};try{let _0x217513=_0x2402ae?.[_0x19ab44(0x1c4)](_0x2e985d);!_0x217513&&(_0x217513=await _0x508963['journey']['getActivation'](_0xb50dce,_0x2e985d));const _0x1b5f24=_0x217513[_0x19ab44(0x26d)]['activationParams']['name']||_0x2e985d,_0x27bf6f=sanitizeYamlKey(_0x1b5f24)||_0x19ab44(0x210)+_0x2e985d,_0x5e45c0=_0x27bf6f;_0x96082c[_0x19ab44(0x263)](_0x2e985d,_0x5e45c0);const _0x407037=journeyActivationStepToYaml(_0x217513,_0x48abe5,_0x1220c3);return{'name':_0x5e45c0,'isJourneyLocal':!![],'definition':_0x407037};}catch{return{'name':_0x2e985d,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3886b8,_0x55d1e6)=>resolveJumpTarget(_0x3886b8,_0x55d1e6,_0x1e0e99,async _0x43ecbd=>{const _0xafcd85=a101_0x10f7,_0x2405df=_0x2e4acf?.[_0xafcd85(0x1c4)](_0x43ecbd);if(_0x2405df)return _0x2405df;return _0x508963[_0xafcd85(0x295)][_0xafcd85(0x1e3)](_0x43ecbd);})};return _0xc13e39=_0x1c737f,_0x1c737f;},_0x5c063e=async _0x39ed74=>{const _0x17fb73=a101_0x10f7,{collectSegmentIdsFromJourneyApi:_0x39c565}=await import('./journey-yaml.js'),{batchAsync:_0x236943}=await import(_0x17fb73(0x211)),_0xc8c4a1=new Set();for(const _0x4dddb1 of _0x39ed74){let _0x13bcc7=_0x2e4acf?.[_0x17fb73(0x1c4)](_0x4dddb1);!_0x13bcc7&&(_0x13bcc7=await _0x508963[_0x17fb73(0x295)][_0x17fb73(0x1e3)](_0x4dddb1));const _0x1cdcee=_0x39c565(_0x13bcc7);for(const _0x1a3162 of _0x1cdcee){_0xc8c4a1[_0x17fb73(0x23e)](_0x1a3162);}}let _0x1faef5=Array[_0x17fb73(0x201)](_0xc8c4a1);while(_0x1faef5[_0x17fb73(0x1ff)]>0x0){const _0x30e6ac=_0x1faef5['filter'](_0x4c0567=>!_0x4ec0a7[_0x17fb73(0x259)](_0x4c0567));if(_0x30e6ac[_0x17fb73(0x1ff)]===0x0)break;const _0x1f740a=await _0x236943(_0x30e6ac,async _0x9d109b=>{const _0x2f0a37=_0x17fb73;_0x4ec0a7['add'](_0x9d109b);let _0x35b093=_0x1656ec[_0x2f0a37(0x293)](_0x294fff=>_0x294fff['id']===_0x9d109b);if(!_0x35b093)try{_0x35b093=await _0x508963[_0x2f0a37(0x236)]['getSegment'](_0xdb382c,_0x9d109b);}catch{return null;}return{'segmentId':_0x9d109b,'segment':_0x35b093};},0xa),_0xfd4f19=new Set();for(const _0x409485 of _0x1f740a){if(!_0x409485?.[_0x17fb73(0x236)]?.[_0x17fb73(0x1cc)])continue;const _0x3a43b2=apiRuleToYaml(_0x409485[_0x17fb73(0x236)]['rule']);_0x28ec4a[_0x17fb73(0x263)](_0x409485[_0x17fb73(0x202)],_0x3a43b2);const _0x1f1736=collectSegmentRefsFromRule(_0x3a43b2);for(const _0x569ec3 of _0x1f1736){!_0x4ec0a7[_0x17fb73(0x259)](_0x569ec3)&&_0xfd4f19[_0x17fb73(0x23e)](_0x569ec3);}}_0x1faef5=Array[_0x17fb73(0x201)](_0xfd4f19);}};return{'createYamlContext':_0x54aab7,'prefetchJourneySegments':_0x5c063e};}export async function executePushSegments(_0x5032f9,_0x5f4aac,_0x2013d1,_0x553d39,_0xa2d832){const _0x6c2bb7=a101_0x47621a,{segmentDefToCreateRequest:_0x259a10,segmentDefToUpdateRequest:_0x24aaae}=await import('./child-segment-yaml.js'),_0x532470=_0x2013d1[_0x6c2bb7(0x261)],_0x409dd9=0x5,_0x1924dd=async _0x21cf44=>{const _0x5ed9d7=_0x6c2bb7,_0x313b4e=_0x21cf44[_0x5ed9d7(0x25b)]?_0x532470[_0x5ed9d7(0x1c4)](_0x21cf44[_0x5ed9d7(0x25b)]):undefined;let _0x162435;const _0x262e7b={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x21cf44['isNew']){_0xa2d832['onProgress']?.({'type':_0x5ed9d7(0x209),'name':_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)]});const _0x55ff43=_0x259a10(_0x21cf44['yamlConfig'],_0x313b4e),_0x50fe77=await _0xa2d832[_0x5ed9d7(0x278)](_0x5ed9d7(0x267)+_0x21cf44[_0x5ed9d7(0x1ce)]['name']+'\x27...',()=>_0x5032f9['segment'][_0x5ed9d7(0x1ea)](_0x553d39['parentId'],_0x55ff43));_0x162435=_0x50fe77[_0x5ed9d7(0x282)]['id'],_0x262e7b['createdSegmentId']={'name':_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)],'id':_0x162435},_0xa2d832['onProgress']?.({'type':_0x5ed9d7(0x1e6),'name':_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)],'segmentId':_0x162435}),_0xa2d832[_0x5ed9d7(0x2a3)]?.(_0x5ed9d7(0x25e)+_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)]+'\x27'),_0x262e7b[_0x5ed9d7(0x1f5)]=0x1;}else{if(_0x21cf44[_0x5ed9d7(0x29d)]){_0xa2d832[_0x5ed9d7(0x277)]?.({'type':_0x5ed9d7(0x235),'name':_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)]});const _0x32f990=_0x24aaae(_0x21cf44[_0x5ed9d7(0x1ce)]);_0x313b4e!==_0x21cf44[_0x5ed9d7(0x24c)]?.['segmentFolderId']&&(_0x32f990[_0x5ed9d7(0x216)]=_0x313b4e?parseInt(_0x313b4e,0xa):undefined),await _0xa2d832[_0x5ed9d7(0x278)](_0x5ed9d7(0x1ed)+_0x21cf44[_0x5ed9d7(0x1ce)]['name']+'\x27...',()=>_0x5032f9[_0x5ed9d7(0x236)][_0x5ed9d7(0x1e5)](_0x553d39['parentId'],_0x21cf44[_0x5ed9d7(0x24c)]['id'],_0x32f990)),_0x162435=_0x21cf44[_0x5ed9d7(0x24c)]['id'],_0xa2d832['onProgress']?.({'type':'segment_updated','name':_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)]}),_0xa2d832[_0x5ed9d7(0x2a3)]?.(_0x5ed9d7(0x241)+_0x21cf44['yamlConfig']['name']+'\x27'),_0x262e7b[_0x5ed9d7(0x228)]=0x1;}else _0x162435=_0x21cf44[_0x5ed9d7(0x24c)]['id'];}}catch(_0x2da04c){const _0xf0c21f=isHttp400Error(_0x2da04c),_0x51bd80=_0xf0c21f?ErrorCode[_0x5ed9d7(0x20d)]:ErrorCode[_0x5ed9d7(0x1ec)],_0x1abfab=getErrorMessage(_0x2da04c);throw new SDKError(_0x51bd80,'Failed\x20to\x20'+(_0x21cf44[_0x5ed9d7(0x1d8)]?_0x5ed9d7(0x1f2):_0x5ed9d7(0x1fb))+_0x5ed9d7(0x21b)+_0x21cf44[_0x5ed9d7(0x248)]+_0x5ed9d7(0x29c)+_0x1abfab,_0x2da04c);}try{const _0x2a035c=await syncActivationsForSegment(_0x5032f9,_0x553d39[_0x5ed9d7(0x21f)],_0x162435,_0x21cf44[_0x5ed9d7(0x1ce)][_0x5ed9d7(0x256)],_0x21cf44[_0x5ed9d7(0x1cb)],_0xa2d832,_0x21cf44[_0x5ed9d7(0x248)]);_0x262e7b[_0x5ed9d7(0x299)]=_0x2a035c;}catch(_0x1ecb1b){if(_0x1ecb1b instanceof SDKError)throw _0x1ecb1b;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x5ed9d7(0x255)+_0x21cf44[_0x5ed9d7(0x1ce)]['name']+_0x5ed9d7(0x29b)+_0x21cf44[_0x5ed9d7(0x248)]+_0x5ed9d7(0x29c)+getErrorMessage(_0x1ecb1b),_0x1ecb1b);}return _0x262e7b;},_0x4d1d5d=await batchAsync(_0x5f4aac,_0x1924dd,_0x409dd9),_0x1de5f4={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x177a2e of _0x4d1d5d){_0x1de5f4[_0x6c2bb7(0x1f5)]+=_0x177a2e['created'],_0x1de5f4[_0x6c2bb7(0x228)]+=_0x177a2e[_0x6c2bb7(0x228)],_0x177a2e[_0x6c2bb7(0x1c8)]&&_0x1de5f4[_0x6c2bb7(0x1e9)][_0x6c2bb7(0x263)](_0x177a2e['createdSegmentId']['name'],_0x177a2e[_0x6c2bb7(0x1c8)]['id']),_0x1de5f4[_0x6c2bb7(0x299)][_0x6c2bb7(0x1f5)]+=_0x177a2e[_0x6c2bb7(0x299)][_0x6c2bb7(0x1f5)],_0x1de5f4[_0x6c2bb7(0x299)][_0x6c2bb7(0x228)]+=_0x177a2e[_0x6c2bb7(0x299)][_0x6c2bb7(0x228)],_0x1de5f4[_0x6c2bb7(0x299)]['deleted']+=_0x177a2e[_0x6c2bb7(0x299)][_0x6c2bb7(0x232)];}return _0x1de5f4;}async function syncActivationsForSegment(_0x5a36ea,_0x40a97f,_0x1f009f,_0x2f0b33,_0x137195,_0x410092,_0x36a98){const _0x246fcd=a101_0x47621a,_0x2101f9={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x47162a of _0x137195){try{if(_0x47162a[_0x246fcd(0x27e)]===_0x246fcd(0x1f2)&&_0x47162a[_0x246fcd(0x230)])_0x410092[_0x246fcd(0x277)]?.({'type':_0x246fcd(0x257),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),await _0x410092['withProgress'](_0x246fcd(0x221)+_0x47162a[_0x246fcd(0x256)]+'\x27...',()=>_0x5a36ea['segment']['createActivation'](_0x40a97f,_0x1f009f,_0x47162a[_0x246fcd(0x230)])),_0x410092[_0x246fcd(0x277)]?.({'type':_0x246fcd(0x26a),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),_0x410092[_0x246fcd(0x2a3)]?.(_0x246fcd(0x1f9)+_0x47162a[_0x246fcd(0x256)]+'\x27'),_0x2101f9['created']++;else{if(_0x47162a['type']===_0x246fcd(0x1fb)&&_0x47162a[_0x246fcd(0x230)]&&_0x47162a['existingActivation'])_0x410092['onProgress']?.({'type':_0x246fcd(0x203),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),await _0x410092['withProgress'](_0x246fcd(0x269)+_0x47162a[_0x246fcd(0x256)]+'\x27...',()=>_0x5a36ea[_0x246fcd(0x236)][_0x246fcd(0x229)](_0x40a97f,_0x1f009f,_0x47162a['existingActivation']['id'],_0x47162a[_0x246fcd(0x230)])),_0x410092[_0x246fcd(0x277)]?.({'type':_0x246fcd(0x1d4),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),_0x410092[_0x246fcd(0x2a3)]?.('Updated\x20activation\x20\x27'+_0x47162a['name']+'\x27'),_0x2101f9[_0x246fcd(0x228)]++;else _0x47162a[_0x246fcd(0x27e)]===_0x246fcd(0x23f)&&_0x47162a['existingActivation']&&(_0x410092[_0x246fcd(0x277)]?.({'type':_0x246fcd(0x1c1),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),await _0x410092['withProgress']('Deleting\x20activation\x20\x27'+_0x47162a[_0x246fcd(0x256)]+'\x27...',()=>_0x5a36ea[_0x246fcd(0x236)][_0x246fcd(0x1cf)](_0x40a97f,_0x1f009f,_0x47162a[_0x246fcd(0x1dc)]['id'])),_0x410092[_0x246fcd(0x277)]?.({'type':_0x246fcd(0x23a),'segmentName':_0x2f0b33,'activationName':_0x47162a[_0x246fcd(0x256)]}),_0x410092[_0x246fcd(0x215)]?.('Deleted\x20activation\x20\x27'+_0x47162a[_0x246fcd(0x256)]+'\x27'),_0x2101f9['deleted']++);}}catch(_0x269e8c){const _0x271739=isHttp400Error(_0x269e8c),_0x1ea77a=_0x271739?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x246fcd(0x2a2)],_0x406508=getErrorMessage(_0x269e8c);throw new SDKError(_0x1ea77a,_0x246fcd(0x27c)+_0x47162a[_0x246fcd(0x27e)]+_0x246fcd(0x289)+_0x47162a['name']+_0x246fcd(0x29b)+_0x36a98+_0x246fcd(0x29c)+_0x406508,_0x269e8c);}}return _0x2101f9;}export async function executePushFolders(_0xd725ed,_0x103eef,_0x4391eb,_0x3b4d6d,_0x47c696){const _0x44de69=a101_0x47621a,_0x5c6212=new Map(_0x4391eb);for(const _0x38c607 of _0x103eef){const _0x26b048=_0x38c607[_0x44de69(0x22c)]('/'),_0x276156=_0x26b048[_0x26b048['length']-0x1],_0x24c1fd=_0x26b048['slice'](0x0,-0x1)['join']('/'),_0x16985d=_0x5c6212[_0x44de69(0x1c4)](_0x24c1fd);_0x47c696['onProgress']?.({'type':_0x44de69(0x1df),'folder':_0x38c607});const _0xc9c6b8={'name':_0x276156,'parentFolderId':_0x16985d},_0x510cd0=await _0x47c696[_0x44de69(0x278)](_0x44de69(0x273)+_0x38c607+_0x44de69(0x1c9),()=>_0xd725ed['segment'][_0x44de69(0x1c3)](_0x3b4d6d['parentId'],_0xc9c6b8));_0x5c6212[_0x44de69(0x263)](_0x38c607,_0x510cd0[_0x44de69(0x282)]['id']),_0x47c696[_0x44de69(0x277)]?.({'type':_0x44de69(0x20f),'folder':_0x38c607,'folderId':_0x510cd0[_0x44de69(0x282)]['id']}),_0x47c696[_0x44de69(0x1f6)]?.('Created\x20folder\x20\x27'+_0x38c607+'\x27');}return _0x5c6212;}export async function executePushSegmentDeletions(_0x6f8dfd,_0x472e48,_0x3032b8){const _0x2e2f95=a101_0x47621a;if(_0x472e48[_0x2e2f95(0x1ff)]===0x0)return 0x0;const {batchAsync:_0x1bd67c}=await import(_0x2e2f95(0x211)),_0x14da8d=0x5,_0x7d0caa=await _0x1bd67c(_0x472e48,async _0x1596e9=>{const _0x26c9d4=_0x2e2f95;return _0x3032b8[_0x26c9d4(0x277)]?.({'type':_0x26c9d4(0x20c),'name':_0x1596e9[_0x26c9d4(0x256)]}),await _0x6f8dfd[_0x26c9d4(0x236)][_0x26c9d4(0x266)](_0x1596e9['id']),_0x3032b8[_0x26c9d4(0x277)]?.({'type':'segment_deleted','name':_0x1596e9[_0x26c9d4(0x256)]}),_0x3032b8[_0x26c9d4(0x215)]?.(_0x26c9d4(0x240)+_0x1596e9[_0x26c9d4(0x256)]+'\x27'),0x1;},_0x14da8d);return _0x7d0caa[_0x2e2f95(0x1ee)]((_0x1fc201,_0x13e451)=>_0x1fc201+_0x13e451,0x0);}export async function executePushJourneys(_0x628ea,_0x477cdc,_0x10dffd,_0x4c8de3,_0x24c878){const _0x109286=a101_0x47621a,{journeyDefToRequest:_0x3be001}=await import(_0x109286(0x260)),{activationDefToCreateRequest:_0x46c4d7,yamlRuleToApi:_0x458835,validateSegmentRule:_0x39043e}=await import(_0x109286(0x290)),_0xf5f41e={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3db535=new Map(_0x10dffd[_0x109286(0x244)]),_0x37e127=0x5;for(let _0x4f9a96=0x0;_0x4f9a96<_0x477cdc[_0x109286(0x1ff)];_0x4f9a96+=_0x37e127){const _0x140684=_0x477cdc[_0x109286(0x27a)](_0x4f9a96,_0x4f9a96+_0x37e127),_0x111a3d=await Promise['all'](_0x140684['map'](async _0x287da6=>{const _0x3e7dd3=_0x109286;if(!_0x287da6[_0x3e7dd3(0x1d8)]&&!_0x287da6[_0x3e7dd3(0x29d)])return{'action':_0x3e7dd3(0x247),'name':_0x287da6['yamlConfig'][_0x3e7dd3(0x256)],'journeyId':_0x287da6['existingJourney']?.['id']};const _0x38b32a=_0x287da6[_0x3e7dd3(0x25b)]?_0x10dffd[_0x3e7dd3(0x261)][_0x3e7dd3(0x1c4)](_0x287da6[_0x3e7dd3(0x25b)]):undefined;_0x24c878[_0x3e7dd3(0x277)]?.({'type':_0x287da6['isNew']?_0x3e7dd3(0x265):_0x3e7dd3(0x26c),'name':_0x287da6['yamlConfig'][_0x3e7dd3(0x256)]});try{const _0x3921df=await executeSingleJourneyPush(_0x628ea,_0x287da6,{..._0x10dffd,'segmentNameToId':_0x3db535},{'parentId':_0x4c8de3['parentId'],'rootFolderId':_0x4c8de3['rootFolderId'],'folderId':_0x38b32a,'verbose':_0x4c8de3[_0x3e7dd3(0x1e2)]},_0x24c878,{'journeyDefToRequest':_0x3be001,'activationDefToCreateRequest':_0x46c4d7,'yamlRuleToApi':_0x458835,'validateSegmentRule':_0x39043e});for(const [_0x4e96ec,_0x1ccc5a]of _0x3921df[_0x3e7dd3(0x23c)]){_0x3db535[_0x3e7dd3(0x263)](_0x4e96ec,_0x1ccc5a),_0xf5f41e['embeddedSegmentNameToId'][_0x3e7dd3(0x263)](_0x4e96ec,_0x1ccc5a);}if(_0x3921df['action']===_0x3e7dd3(0x1f5))_0x24c878[_0x3e7dd3(0x277)]?.({'type':_0x3e7dd3(0x1eb),'name':_0x287da6[_0x3e7dd3(0x1ce)][_0x3e7dd3(0x256)],'journeyId':_0x3921df[_0x3e7dd3(0x204)]}),_0x24c878[_0x3e7dd3(0x2a3)]?.(_0x3e7dd3(0x200)+_0x287da6[_0x3e7dd3(0x1ce)][_0x3e7dd3(0x256)]+'\x27'),_0xf5f41e[_0x3e7dd3(0x1f5)]++;else _0x3921df[_0x3e7dd3(0x2a6)]===_0x3e7dd3(0x228)&&(_0x24c878[_0x3e7dd3(0x277)]?.({'type':_0x3e7dd3(0x226),'name':_0x287da6['yamlConfig'][_0x3e7dd3(0x256)]}),_0x24c878['logSuccess']?.(_0x3e7dd3(0x1e4)+_0x287da6[_0x3e7dd3(0x1ce)]['name']+'\x27'),_0xf5f41e[_0x3e7dd3(0x228)]++);return{'action':_0x3921df[_0x3e7dd3(0x2a6)],'name':_0x287da6[_0x3e7dd3(0x1ce)][_0x3e7dd3(0x256)],'journeyId':_0x3921df[_0x3e7dd3(0x204)]};}catch(_0x46c655){const _0x55fec3=isHttp400Error(_0x46c655),_0x2868cc=_0x55fec3?ErrorCode[_0x3e7dd3(0x2a1)]:ErrorCode[_0x3e7dd3(0x1f1)],_0x4ce45e=getErrorMessage(_0x46c655);throw new SDKError(_0x2868cc,_0x3e7dd3(0x27c)+(_0x287da6[_0x3e7dd3(0x1d8)]?_0x3e7dd3(0x1f2):_0x3e7dd3(0x1fb))+_0x3e7dd3(0x249)+_0x287da6[_0x3e7dd3(0x248)]+_0x3e7dd3(0x29c)+_0x4ce45e,_0x46c655);}}));_0xf5f41e['results']['push'](..._0x111a3d);}return _0xf5f41e;}async function executeSingleJourneyPush(_0x7a8138,_0xbc19f8,_0x1b32f3,_0x217bf5,_0x52768f,_0x25f60e){const _0x337306=a101_0x47621a,{journeyDefToRequest:_0x143962,activationDefToCreateRequest:_0x1acfe0,yamlRuleToApi:_0xbca547,validateSegmentRule:_0xad73c1}=_0x25f60e,_0x5a5e4c=new Map(),_0xc63018=new Map(),_0x460188=new Map(),_0x954ca6=new Map(),_0x1718c0=new Map();let _0x42e773;const _0x59bc73=async()=>{const _0x33f59b=a101_0x10f7;if(_0x42e773)return;_0x42e773=new Map();if(!_0xbc19f8[_0x33f59b(0x27d)])return;const _0x22d609=await _0x7a8138[_0x33f59b(0x295)][_0x33f59b(0x24f)](_0xbc19f8[_0x33f59b(0x27d)]['id']);for(const _0x38f9e3 of _0x22d609){const _0x19a491=journeyActivationStepToYaml(_0x38f9e3,_0x1b32f3[_0x33f59b(0x275)],_0x1b32f3[_0x33f59b(0x1d1)]),_0x5d3571=activationSignature(_0x19a491);!_0x42e773[_0x33f59b(0x259)](_0x5d3571)&&_0x42e773[_0x33f59b(0x263)](_0x5d3571,_0x38f9e3['id']),_0x19a491['name']&&_0xc63018['set'](_0x19a491['name'],_0x38f9e3['id']);}};if(_0xbc19f8['existingJourney']&&_0xbc19f8[_0x337306(0x1ce)][_0x337306(0x27b)]){const _0x510763=buildLocalExpandedRuleMappings(_0xbc19f8[_0x337306(0x1ce)]),_0x1b1ba2=_0x510763[_0x337306(0x1cd)];if(_0x1b1ba2['size']>0x0){const _0x3aa34f=new Map();for(const [_0x4f0d94,_0x11da59]of _0x1b1ba2){const _0x223ed6=serializeExpandedRule(_0x11da59,_0x1b1ba2);_0x3aa34f['set'](_0x4f0d94,_0x223ed6);}const _0x285d1d=collectSegmentIdsFromJourneyApi(_0xbc19f8['existingJourney']);if(_0x285d1d[_0x337306(0x219)]>0x0){const _0x2b6bca=await buildServerSegmentRuleMap(_0x7a8138,_0x217bf5[_0x337306(0x21f)],_0x1b32f3['existingSegments'],_0x285d1d);if(_0x2b6bca[_0x337306(0x219)]>0x0){const _0x8e77dc=new Map();for(const [_0x2d6f56,_0x2200bd]of _0x2b6bca){const _0x5f3107=serializeExpandedRule(_0x2200bd,_0x2b6bca);!_0x8e77dc[_0x337306(0x259)](_0x5f3107)&&_0x8e77dc[_0x337306(0x263)](_0x5f3107,_0x2d6f56);}for(const [_0x5b2929,_0x594da6]of _0x3aa34f){const _0x45d8a4=_0x8e77dc[_0x337306(0x1c4)](_0x594da6);_0x45d8a4&&(_0x1718c0[_0x337306(0x263)](_0x5b2929,_0x45d8a4),_0x1b32f3[_0x337306(0x244)][_0x337306(0x263)](_0x5b2929,_0x45d8a4));}}}}}const _0x3e3294={'resolveSegmentId':async _0x1ec835=>{const _0x381f63=_0x337306,_0x2d9921=_0x1b32f3[_0x381f63(0x244)]['get'](_0x1ec835);if(!_0x2d9921)throw new SDKError(ErrorCode[_0x381f63(0x297)],_0x381f63(0x20e)+_0x1ec835+'\x20(referenced\x20in\x20journey\x20'+_0xbc19f8['yamlConfig']['name']+')');return _0x2d9921;},'resolveEmbeddedSegmentId':async(_0x5b0b48,_0x5d56a8)=>{const _0x3e88e6=_0x337306,_0x350058=_0x1b32f3['segmentNameToId']['get'](_0x5b0b48);if(_0x350058)return _0x350058;const _0x10b07b=_0x1718c0[_0x3e88e6(0x1c4)](_0x5b0b48);if(_0x10b07b)return _0x1b32f3['segmentNameToId'][_0x3e88e6(0x263)](_0x5b0b48,_0x10b07b),_0x10b07b;const _0x586454=_0x1b32f3[_0x3e88e6(0x24e)][_0x3e88e6(0x293)](_0x942024=>_0x942024[_0x3e88e6(0x256)]===_0x5b0b48);if(_0x586454)return _0x1b32f3[_0x3e88e6(0x244)][_0x3e88e6(0x263)](_0x5b0b48,_0x586454['id']),_0x586454['id'];if(_0xbc19f8[_0x3e88e6(0x1d8)]){const {stageName:_0x3755a9,criteriaName:_0x637fcd}=findSegmentCriteriaLocation(_0xbc19f8[_0x3e88e6(0x1ce)],_0x5b0b48);return _0xad73c1(_0x5b0b48,_0x5d56a8[_0x3e88e6(0x1cc)]),_0x460188[_0x3e88e6(0x263)](_0x5b0b48,{'definition':_0x5d56a8,'stageName':_0x3755a9,'criteriaName':_0x637fcd}),createPendingSegmentId(_0x5b0b48);}const _0x4526d4=_0xbc19f8[_0x3e88e6(0x27d)]?.['id'];if(!_0x4526d4)throw new SDKError(ErrorCode[_0x3e88e6(0x1d9)],_0x3e88e6(0x223));_0xad73c1(_0x5b0b48,_0x5d56a8[_0x3e88e6(0x1cc)]);const _0x1bded3=generateDeterministicJourneySegmentName(_0xbc19f8[_0x3e88e6(0x1ce)][_0x3e88e6(0x256)],_0x5b0b48),_0x473893=_0x1b32f3[_0x3e88e6(0x24e)][_0x3e88e6(0x293)](_0x5d9435=>_0x5d9435[_0x3e88e6(0x256)]===_0x1bded3),_0x25d76e=createSegmentIdResolver(_0x1b32f3[_0x3e88e6(0x244)],_0x5b0b48),_0x41d697=await resolveRuleSegmentIds(_0x5d56a8['rule'],_0x25d76e);let _0x12c5e9;if(_0x473893)await _0x7a8138['segment'][_0x3e88e6(0x1e5)](_0x217bf5[_0x3e88e6(0x21f)],_0x473893['id'],{'description':_0x5d56a8[_0x3e88e6(0x233)]||_0x3e88e6(0x29e)+_0x5b0b48,'rule':_0xbca547(_0x41d697,!![]),'countPopulation':!![]}),_0x12c5e9=_0x473893['id'];else try{_0x12c5e9=await _0x7a8138[_0x3e88e6(0x236)][_0x3e88e6(0x214)]({'name':_0x1bded3,'description':_0x5d56a8['description']||_0x3e88e6(0x29e)+_0x5b0b48,'journeyId':_0x4526d4,'rule':_0xbca547(_0x41d697,!![]),'countPopulation':!![],'parentFolderId':_0x217bf5[_0x3e88e6(0x28b)]||'','audienceId':_0x217bf5[_0x3e88e6(0x21f)]});}catch(_0x13530a){const _0x2f8104=_0x13530a instanceof Error&&_0x13530a[_0x3e88e6(0x288)]['includes'](_0x3e88e6(0x28e));if(_0x2f8104){const _0x2232a5=await _0x7a8138['segment'][_0x3e88e6(0x21e)](_0x217bf5[_0x3e88e6(0x21f)]),_0x58d84d=_0x2232a5[_0x3e88e6(0x293)](_0x3d7849=>_0x3d7849['name']===_0x1bded3);if(_0x58d84d)await _0x7a8138[_0x3e88e6(0x236)][_0x3e88e6(0x1e5)](_0x217bf5[_0x3e88e6(0x21f)],_0x58d84d['id'],{'description':_0x5d56a8[_0x3e88e6(0x233)]||_0x3e88e6(0x29e)+_0x5b0b48,'rule':_0xbca547(_0x41d697,!![]),'countPopulation':!![]}),_0x12c5e9=_0x58d84d['id'];else throw _0x13530a;}else throw _0x13530a;}return _0x1b32f3[_0x3e88e6(0x244)][_0x3e88e6(0x263)](_0x5b0b48,_0x12c5e9),_0x5a5e4c['set'](_0x5b0b48,_0x12c5e9),_0x12c5e9;},'resolveActivationId':async _0x36ae3c=>{const _0x12bada=_0x337306,_0x3e5acb=_0xc63018[_0x12bada(0x1c4)](_0x36ae3c);if(_0x3e5acb)return _0x3e5acb;if(_0xbc19f8[_0x12bada(0x27d)]){await _0x59bc73();const _0x5f2bc9=_0xc63018[_0x12bada(0x1c4)](_0x36ae3c);if(_0x5f2bc9)return _0x5f2bc9;}throw new SDKError(ErrorCode[_0x12bada(0x1fa)],_0x12bada(0x270)+_0x36ae3c+_0x12bada(0x29a)+_0xbc19f8[_0x12bada(0x1ce)][_0x12bada(0x256)]+_0x12bada(0x287)+_0x12bada(0x1fe));},'resolveEmbeddedActivationId':async(_0x11eeb6,_0x3ae96d)=>{const _0x386b2f=_0x337306,_0x5b383c=_0xc63018['get'](_0x11eeb6);if(_0x5b383c)return _0x5b383c;if(_0xbc19f8[_0x386b2f(0x1d8)])return _0x954ca6['set'](_0x11eeb6,_0x3ae96d),createPendingActivationId(_0x11eeb6);if(_0xbc19f8[_0x386b2f(0x27d)]){await _0x59bc73();const _0x3cf0b2=_0xc63018[_0x386b2f(0x1c4)](_0x3ae96d[_0x386b2f(0x256)]);if(_0x3cf0b2)return _0xc63018[_0x386b2f(0x263)](_0x11eeb6,_0x3cf0b2),_0x3cf0b2;const _0x5c517b=activationSignature(_0x3ae96d),_0x589251=_0x42e773?.[_0x386b2f(0x1c4)](_0x5c517b);if(_0x589251)return _0xc63018[_0x386b2f(0x263)](_0x11eeb6,_0x589251),_0x589251;const _0x2a08c4=await _0x1acfe0(_0x3ae96d,_0x1b32f3[_0x386b2f(0x25c)]),_0x227f7f=await _0x7a8138[_0x386b2f(0x295)][_0x386b2f(0x220)](_0xbc19f8[_0x386b2f(0x27d)]['id'],_0x2a08c4);return _0xc63018[_0x386b2f(0x263)](_0x11eeb6,_0x227f7f['id']),_0x227f7f['id'];}throw new SDKError(ErrorCode[_0x386b2f(0x1d9)],_0x386b2f(0x1e0));},'resolveJourneyId':async _0x469ce9=>{const _0x37dfc9=_0x337306;try{return await _0x7a8138[_0x37dfc9(0x295)][_0x37dfc9(0x2a7)](_0x217bf5[_0x37dfc9(0x21f)],_0x469ce9);}catch(_0x500d19){throw new SDKError(ErrorCode[_0x37dfc9(0x1fa)],_0x37dfc9(0x1fd)+_0x469ce9+_0x37dfc9(0x2a0)+_0xbc19f8[_0x37dfc9(0x1ce)][_0x37dfc9(0x256)]+'\x27)',_0x500d19);}},'resolveStageId':async(_0x3a509c,_0x317956)=>{const _0x431ff9=_0x337306,_0x4a478f=await _0x7a8138[_0x431ff9(0x295)][_0x431ff9(0x1e3)](_0x3a509c),_0x483d39=_0x4a478f[_0x431ff9(0x26d)][_0x431ff9(0x1d3)]['find'](_0x423f6c=>_0x423f6c[_0x431ff9(0x256)][_0x431ff9(0x237)]()===_0x317956['toLowerCase']());if(!_0x483d39?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x431ff9(0x1ca)+_0x317956+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x4a478f[_0x431ff9(0x26d)][_0x431ff9(0x281)]||_0x4a478f[_0x431ff9(0x26d)][_0x431ff9(0x256)])+'\x27');return _0x483d39['id'];}},_0xc76dc5=await _0x143962(_0xbc19f8['yamlConfig'],_0x217bf5[_0x337306(0x21f)],_0x3e3294),_0xb127d1=_0x217bf5[_0x337306(0x224)]||_0x217bf5['rootFolderId'];_0xb127d1&&(_0xc76dc5[_0x337306(0x294)]={'parentFolder':{'data':{'id':_0xb127d1,'type':'folder'}}});if(_0xbc19f8[_0x337306(0x1d8)]){if(_0x460188[_0x337306(0x219)]>0x0||_0x954ca6['size']>0x0)return await executeThreeStepJourneyCreate(_0x7a8138,_0xbc19f8,_0xc76dc5,{'pendingEmbeddedSegments':_0x460188,'pendingEmbeddedActivations':_0x954ca6,'embeddedSegmentNameToId':_0x5a5e4c,'journeyActivationNameToId':_0xc63018},{..._0x217bf5,'effectiveFolderId':_0xb127d1},_0x1b32f3,_0x52768f,_0x25f60e);else{ensureJourneyDefaults(_0xc76dc5[_0x337306(0x26d)]);const _0xef61c8=await _0x7a8138['journey']['create'](_0xc76dc5);return{'action':_0x337306(0x1f5),'journeyId':_0xef61c8['id'],'embeddedSegmentNameToId':_0x5a5e4c};}}else{if(_0xbc19f8[_0x337306(0x29d)]&&_0xbc19f8[_0x337306(0x27d)])return ensureJourneyDefaults(_0xc76dc5[_0x337306(0x26d)]),await _0x7a8138['journey'][_0x337306(0x1fb)](_0xbc19f8[_0x337306(0x27d)]['id'],_0xc76dc5),{'action':_0x337306(0x228),'journeyId':_0xbc19f8[_0x337306(0x27d)]['id'],'embeddedSegmentNameToId':_0x5a5e4c};}return{'action':_0x337306(0x247),'journeyId':_0xbc19f8['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x5a5e4c};}function findSegmentCriteriaLocation(_0x33f2ff,_0x2fb577){const _0x3c5de4=a101_0x47621a,_0x9f499c=_0x33f2ff['stages']||_0x33f2ff[_0x3c5de4(0x231)]?.[0x0]?.['stages']||[];let _0x1a48d5=_0x3c5de4(0x268),_0x548146=_0x2fb577;const _0x4a428f=_0x33f2ff['goal']||_0x33f2ff[_0x3c5de4(0x231)]?.[0x0]?.['goal'];if(_0x4a428f?.[_0x3c5de4(0x236)]===_0x2fb577)return{'stageName':_0x3c5de4(0x258),'criteriaName':_0x4a428f[_0x3c5de4(0x256)]||_0x2fb577};_0x2f23f7:for(const _0x159401 of _0x9f499c){if(_0x159401[_0x3c5de4(0x251)]?.[_0x3c5de4(0x236)]===_0x2fb577){_0x1a48d5=_0x159401[_0x3c5de4(0x256)],_0x548146=_0x159401[_0x3c5de4(0x251)]['name']||_0x2fb577;break;}if(_0x159401[_0x3c5de4(0x279)])for(const _0x2a1003 of _0x159401[_0x3c5de4(0x279)]){if(_0x2a1003[_0x3c5de4(0x27e)]===_0x3c5de4(0x1d6)&&_0x2a1003[_0x3c5de4(0x284)]?.[_0x3c5de4(0x254)])for(const _0x189be2 of _0x2a1003['with'][_0x3c5de4(0x254)]){if(_0x189be2[_0x3c5de4(0x236)]===_0x2fb577){_0x1a48d5=_0x159401[_0x3c5de4(0x256)],_0x548146=_0x189be2['name']||_0x2fb577;break _0x2f23f7;}}}}return{'stageName':_0x1a48d5,'criteriaName':_0x548146};}async function executeThreeStepJourneyCreate(_0x36370b,_0x142514,_0x2adedb,_0xc45364,_0x3cc9ff,_0x1328ed,_0x1217aa,_0x492922){const _0x39ff61=a101_0x47621a,{activationDefToCreateRequest:_0x51fdce,yamlRuleToApi:_0x382f76}=_0x492922,{pendingEmbeddedSegments:_0x13169f,pendingEmbeddedActivations:_0x28cf8a,embeddedSegmentNameToId:_0x302d73}=_0xc45364,_0x22d21e=JSON['parse'](JSON[_0x39ff61(0x234)](_0x2adedb));ensureJourneyDefaults(_0x22d21e[_0x39ff61(0x26d)]),stripPendingIds(_0x22d21e);const _0x5a2eed=await _0x36370b[_0x39ff61(0x295)][_0x39ff61(0x1f2)](_0x22d21e),_0x28f270=_0x5a2eed['id'],_0x53392a=new Map();for(const _0x2f5ec6 of _0x5a2eed[_0x39ff61(0x26d)][_0x39ff61(0x1d3)]){_0x53392a[_0x39ff61(0x263)](_0x2f5ec6[_0x39ff61(0x256)][_0x39ff61(0x237)](),_0x2f5ec6['id']);}for(const [_0x51d1f4,{definition:_0x3ec957}]of _0x13169f){const _0x5d7284=generateDeterministicJourneySegmentName(_0x142514['yamlConfig']['name'],_0x51d1f4);_0x1217aa['onProgress']?.({'type':_0x39ff61(0x22d),'journeyName':_0x142514['yamlConfig']['name'],'segmentName':_0x51d1f4});const _0x5d3c91=createSegmentIdResolver(_0x1328ed[_0x39ff61(0x244)],_0x51d1f4),_0x1cc824=await resolveRuleSegmentIds(_0x3ec957['rule'],_0x5d3c91),_0x498d85=await _0x36370b[_0x39ff61(0x236)][_0x39ff61(0x214)]({'name':_0x5d7284,'description':_0x3ec957[_0x39ff61(0x233)]||_0x39ff61(0x29e)+_0x51d1f4,'journeyId':_0x28f270,'rule':_0x382f76(_0x1cc824,!![]),'countPopulation':!![],'parentFolderId':_0x3cc9ff[_0x39ff61(0x23b)]||'','audienceId':_0x3cc9ff[_0x39ff61(0x21f)]});_0x302d73[_0x39ff61(0x263)](_0x51d1f4,_0x498d85),_0x1328ed[_0x39ff61(0x244)][_0x39ff61(0x263)](_0x51d1f4,_0x498d85),_0x1217aa[_0x39ff61(0x277)]?.({'type':_0x39ff61(0x280),'journeyName':_0x142514[_0x39ff61(0x1ce)][_0x39ff61(0x256)],'segmentName':_0x51d1f4});}const _0x4c046b=new Map();for(const [_0x41cc9e,_0x4b1813]of _0x28cf8a){_0x1217aa[_0x39ff61(0x277)]?.({'type':_0x39ff61(0x252),'journeyName':_0x142514[_0x39ff61(0x1ce)][_0x39ff61(0x256)],'activationName':_0x41cc9e});const _0x2c1cfa=await _0x51fdce(_0x4b1813,_0x1328ed[_0x39ff61(0x25c)]),_0x5eb224=await _0x36370b[_0x39ff61(0x295)][_0x39ff61(0x220)](_0x28f270,_0x2c1cfa);_0x4c046b['set'](_0x41cc9e,_0x5eb224['id']),_0xc45364[_0x39ff61(0x271)][_0x39ff61(0x263)](_0x41cc9e,_0x5eb224['id']),_0x1217aa['onProgress']?.({'type':_0x39ff61(0x26b),'journeyName':_0x142514[_0x39ff61(0x1ce)][_0x39ff61(0x256)],'activationName':_0x41cc9e});}const _0x45888f=JSON['parse'](JSON[_0x39ff61(0x234)](_0x2adedb));return _0x45888f['id']=_0x28f270,ensureJourneyDefaults(_0x45888f[_0x39ff61(0x26d)]),resolvePendingIdsInRequest(_0x45888f,_0x2adedb,_0x53392a,_0x302d73,_0x4c046b,_0x1217aa),await _0x36370b[_0x39ff61(0x295)][_0x39ff61(0x1fb)](_0x28f270,_0x45888f),{'action':_0x39ff61(0x1f5),'journeyId':_0x28f270,'embeddedSegmentNameToId':_0x302d73};}function stripPendingIds(_0x3ed4a6){const _0xa0434a=a101_0x47621a;for(const _0x4cb712 of _0x3ed4a6[_0xa0434a(0x26d)][_0xa0434a(0x1d3)]||[]){_0x4cb712[_0xa0434a(0x20b)]?.[_0xa0434a(0x202)]&&isPendingSegmentId(_0x4cb712[_0xa0434a(0x20b)][_0xa0434a(0x202)])&&delete _0x4cb712['entryCriteria'];if(_0x4cb712[_0xa0434a(0x279)])for(const _0x3b3345 of Object[_0xa0434a(0x26e)](_0x4cb712['steps'])){const _0x52e631=_0x4cb712[_0xa0434a(0x279)][_0x3b3345];_0x52e631[_0xa0434a(0x27e)]===_0xa0434a(0x253)&&_0x52e631['journeyActivationStepId']&&isPendingActivationId(_0x52e631[_0xa0434a(0x1da)])&&(_0x52e631[_0xa0434a(0x1da)]='');if(_0x52e631['type']==='DecisionPoint'&&_0x52e631[_0xa0434a(0x254)])for(const _0x2d7af8 of _0x52e631['branches']){_0x2d7af8[_0xa0434a(0x202)]&&isPendingSegmentId(_0x2d7af8[_0xa0434a(0x202)])&&(_0x2d7af8[_0xa0434a(0x202)]='');}_0x52e631['type']===_0xa0434a(0x1f7)&&_0x52e631[_0xa0434a(0x29f)]?.[_0xa0434a(0x202)]&&isPendingSegmentId(_0x52e631[_0xa0434a(0x29f)][_0xa0434a(0x202)])&&(_0x52e631[_0xa0434a(0x29f)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x4fdc6b,_0x5bb552,_0x1916bb,_0x595671,_0x4a4afe,_0x179a7a){const _0x2294b8=a101_0x47621a,_0x5cffbb=(_0x595233,_0x54f77c)=>{const _0xa49377=a101_0x10f7;if(!isPendingSegmentId(_0x595233))return _0x595233;const _0x2137d1=extractPendingSegmentName(_0x595233),_0x515666=_0x595671['get'](_0x2137d1);return!_0x515666&&_0x179a7a[_0xa49377(0x246)]?.(_0xa49377(0x286)+_0x2137d1+_0xa49377(0x22e)+_0x54f77c),_0x515666;};if(_0x4fdc6b[_0x2294b8(0x26d)]['goal']?.[_0x2294b8(0x202)]&&isPendingSegmentId(_0x4fdc6b[_0x2294b8(0x26d)][_0x2294b8(0x258)]['segmentId'])){const _0x4958ac=_0x5cffbb(_0x4fdc6b[_0x2294b8(0x26d)][_0x2294b8(0x258)][_0x2294b8(0x202)],_0x2294b8(0x242));_0x4958ac&&(_0x4fdc6b[_0x2294b8(0x26d)][_0x2294b8(0x258)]['segmentId']=_0x4958ac);}for(const _0x17b064 of _0x4fdc6b['attributes']['journeyStages']||[]){const _0x54da57=_0x1916bb[_0x2294b8(0x1c4)](_0x17b064[_0x2294b8(0x256)][_0x2294b8(0x237)]());_0x54da57&&(_0x17b064['id']=_0x54da57);if(_0x17b064['entryCriteria']?.[_0x2294b8(0x202)]&&isPendingSegmentId(_0x17b064[_0x2294b8(0x20b)][_0x2294b8(0x202)])){const _0x4b50c8=_0x5cffbb(_0x17b064[_0x2294b8(0x20b)][_0x2294b8(0x202)],_0x2294b8(0x208)+_0x17b064[_0x2294b8(0x256)]+'\x27\x20entry\x20criteria');_0x4b50c8&&(_0x17b064[_0x2294b8(0x20b)][_0x2294b8(0x202)]=_0x4b50c8);}if(_0x17b064['exitCriterias'])for(const _0x27cff9 of _0x17b064[_0x2294b8(0x1de)]){if(_0x27cff9[_0x2294b8(0x202)]&&isPendingSegmentId(_0x27cff9[_0x2294b8(0x202)])){const _0x321bd1=_0x5cffbb(_0x27cff9['segmentId'],_0x2294b8(0x208)+_0x17b064[_0x2294b8(0x256)]+'\x27\x20exit\x20criteria');_0x321bd1&&(_0x27cff9[_0x2294b8(0x202)]=_0x321bd1);}}if(_0x17b064[_0x2294b8(0x1d5)]?.['segmentId']&&isPendingSegmentId(_0x17b064[_0x2294b8(0x1d5)][_0x2294b8(0x202)])){const _0x43b07d=_0x5cffbb(_0x17b064[_0x2294b8(0x1d5)][_0x2294b8(0x202)],'stage\x20\x27'+_0x17b064[_0x2294b8(0x256)]+_0x2294b8(0x2a4));_0x43b07d&&(_0x17b064['milestone'][_0x2294b8(0x202)]=_0x43b07d);}if(_0x17b064['steps']){const _0x39222d=_0x318934=>_0x5bb552[_0x2294b8(0x26d)][_0x2294b8(0x1d3)]['find'](_0x2cde5d=>_0x2cde5d['name'][_0x2294b8(0x237)]()===_0x17b064[_0x2294b8(0x256)][_0x2294b8(0x237)]())?.[_0x2294b8(0x279)]?.[_0x318934];for(const _0x57fdf0 of Object[_0x2294b8(0x26e)](_0x17b064[_0x2294b8(0x279)])){const _0xdcde62=_0x17b064['steps'][_0x57fdf0],_0x4aa47d=_0x39222d(_0x57fdf0);if(_0xdcde62['type']==='Activation'&&_0xdcde62['journeyActivationStepId']&&(isPendingActivationId(_0xdcde62[_0x2294b8(0x1da)])||_0xdcde62[_0x2294b8(0x1da)]==='')){if(_0x4aa47d?.['journeyActivationStepId']&&isPendingActivationId(_0x4aa47d[_0x2294b8(0x1da)])){const _0x5ae672=extractPendingActivationName(_0x4aa47d[_0x2294b8(0x1da)]),_0x35c32d=_0x4a4afe['get'](_0x5ae672);_0x35c32d&&(_0xdcde62[_0x2294b8(0x1da)]=_0x35c32d);}}if(_0xdcde62[_0x2294b8(0x27e)]===_0x2294b8(0x298)&&_0xdcde62[_0x2294b8(0x254)]&&_0x4aa47d?.[_0x2294b8(0x254)])for(let _0x352039=0x0;_0x352039<_0xdcde62[_0x2294b8(0x254)]['length'];_0x352039++){const _0x392ef9=_0xdcde62[_0x2294b8(0x254)][_0x352039],_0x56dd14=_0x4aa47d[_0x2294b8(0x254)][_0x352039];if(_0x56dd14?.['segmentId']&&isPendingSegmentId(_0x56dd14[_0x2294b8(0x202)])){const _0x10282d=_0x5cffbb(_0x56dd14[_0x2294b8(0x202)],'stage\x20\x27'+_0x17b064[_0x2294b8(0x256)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x392ef9['name']||_0x352039)+'\x27');_0x10282d&&(_0x392ef9['segmentId']=_0x10282d);}}if(_0xdcde62['type']===_0x2294b8(0x1f7)&&_0xdcde62['waitCondition']?.[_0x2294b8(0x202)]&&_0x4aa47d?.[_0x2294b8(0x29f)]?.[_0x2294b8(0x202)]&&isPendingSegmentId(_0x4aa47d[_0x2294b8(0x29f)][_0x2294b8(0x202)])){const _0x8ddc1c=_0x5cffbb(_0x4aa47d[_0x2294b8(0x29f)][_0x2294b8(0x202)],'stage\x20\x27'+_0x17b064['name']+'\x27\x20wait\x20condition');_0x8ddc1c&&(_0xdcde62[_0x2294b8(0x29f)][_0x2294b8(0x202)]=_0x8ddc1c);}}}}}
@@ -1 +1 @@
1
- (function(_0x14b4db,_0x3029b5){const _0x19e18f=a102_0x4034,_0x3f5aec=_0x14b4db();while(!![]){try{const _0x1ecc99=parseInt(_0x19e18f(0x114))/0x1+-parseInt(_0x19e18f(0x119))/0x2+-parseInt(_0x19e18f(0x118))/0x3+parseInt(_0x19e18f(0x11c))/0x4+-parseInt(_0x19e18f(0x117))/0x5+-parseInt(_0x19e18f(0x116))/0x6*(-parseInt(_0x19e18f(0x11b))/0x7)+-parseInt(_0x19e18f(0x11e))/0x8;if(_0x1ecc99===_0x3029b5)break;else _0x3f5aec['push'](_0x3f5aec['shift']());}catch(_0x44b2b8){_0x3f5aec['push'](_0x3f5aec['shift']());}}}(a102_0x197d,0x1d3cc));export function buildFolderIdToPathMap(_0x30666c){const _0x38f10a=a102_0x4034,_0x39c5b3=new Map(),_0x115d68=new Map();for(const _0x10849b of _0x30666c){_0x115d68[_0x38f10a(0x113)](_0x10849b['id'],_0x10849b);}const _0xbcf4cb=new Set();for(const _0x58f63e of _0x30666c){!_0x58f63e[_0x38f10a(0x11d)]&&_0xbcf4cb[_0x38f10a(0x115)](_0x58f63e['id']);}function _0x1fe282(_0x42b903){const _0x2e4542=_0x38f10a;if(_0x39c5b3[_0x2e4542(0x11f)](_0x42b903['id']))return _0x39c5b3[_0x2e4542(0x11a)](_0x42b903['id']);if(_0xbcf4cb['has'](_0x42b903['id']))return _0x39c5b3[_0x2e4542(0x113)](_0x42b903['id'],''),'';if(_0x42b903[_0x2e4542(0x11d)]){const _0x24a151=_0x115d68[_0x2e4542(0x11a)](_0x42b903[_0x2e4542(0x11d)]);if(_0x24a151){const _0x42f8d3=_0x1fe282(_0x24a151),_0x32af4e=_0x42f8d3?_0x42f8d3+'/'+_0x42b903[_0x2e4542(0x112)]:_0x42b903['name'];return _0x39c5b3[_0x2e4542(0x113)](_0x42b903['id'],_0x32af4e),_0x32af4e;}}const _0x56eea9=_0x42b903[_0x2e4542(0x112)];return _0x39c5b3[_0x2e4542(0x113)](_0x42b903['id'],_0x56eea9),_0x56eea9;}for(const _0x4f539e of _0x30666c){_0x1fe282(_0x4f539e);}return _0x39c5b3;}function a102_0x197d(){const _0x14a9f9=['get','7NbAhSe','679576SOFUpv','parentFolderId','319096YqLRlA','has','name','set','48934kCJzMF','add','1184916ICJpeM','227470YaMImi','53700XiNgbD','386554ppGAYL'];a102_0x197d=function(){return _0x14a9f9;};return a102_0x197d();}export function buildFolderPathToIdMap(_0x3d8655){const _0xa0bea0=a102_0x4034,_0x1a1022=new Map(),_0x4f8fc0=new Map();for(const _0x5cdda3 of _0x3d8655){_0x4f8fc0[_0xa0bea0(0x113)](_0x5cdda3['id'],_0x5cdda3);}const _0x384df1=new Set();for(const _0x2a5047 of _0x3d8655){!_0x2a5047[_0xa0bea0(0x11d)]&&_0x384df1[_0xa0bea0(0x115)](_0x2a5047['id']);}function _0x183160(_0x35d90b){const _0x3a849e=_0xa0bea0;if(_0x384df1[_0x3a849e(0x11f)](_0x35d90b['id']))return'';if(_0x35d90b[_0x3a849e(0x11d)]){const _0x238e07=_0x4f8fc0[_0x3a849e(0x11a)](_0x35d90b[_0x3a849e(0x11d)]);if(_0x238e07){const _0x1dc51e=_0x183160(_0x238e07);return _0x1dc51e?_0x1dc51e+'/'+_0x35d90b[_0x3a849e(0x112)]:_0x35d90b[_0x3a849e(0x112)];}}return _0x35d90b['name'];}for(const _0x516b0a of _0x3d8655){const _0x4b92dc=_0x183160(_0x516b0a);_0x1a1022[_0xa0bea0(0x113)](_0x4b92dc,_0x516b0a['id']);}return _0x1a1022;}function a102_0x4034(_0x36ecfa,_0x41113c){_0x36ecfa=_0x36ecfa-0x112;const _0x197d0b=a102_0x197d();let _0x4034fd=_0x197d0b[_0x36ecfa];return _0x4034fd;}export function buildFolderMaps(_0x327edc){const _0x1ed26e=a102_0x4034,_0x4d9a18=buildFolderIdToPathMap(_0x327edc),_0x4f143c=new Map();for(const [_0x3d40d2,_0x228983]of _0x4d9a18){_0x4f143c[_0x1ed26e(0x113)](_0x228983,_0x3d40d2);}return{'idToPath':_0x4d9a18,'pathToId':_0x4f143c};}export function getFolderPath(_0x59bc91,_0x56d668){const _0x29bfa2=a102_0x4034;if(!_0x59bc91)return'';return _0x56d668[_0x29bfa2(0x11a)](_0x59bc91)??'';}
1
+ (function(_0x592f4b,_0x49c1d2){const _0x2fa4de=a102_0x3152,_0xaccc2c=_0x592f4b();while(!![]){try{const _0x4fcb5b=parseInt(_0x2fa4de(0x1c8))/0x1+-parseInt(_0x2fa4de(0x1d4))/0x2*(parseInt(_0x2fa4de(0x1d5))/0x3)+parseInt(_0x2fa4de(0x1cb))/0x4+parseInt(_0x2fa4de(0x1ca))/0x5+-parseInt(_0x2fa4de(0x1d3))/0x6+-parseInt(_0x2fa4de(0x1cd))/0x7+parseInt(_0x2fa4de(0x1d1))/0x8;if(_0x4fcb5b===_0x49c1d2)break;else _0xaccc2c['push'](_0xaccc2c['shift']());}catch(_0x434bc4){_0xaccc2c['push'](_0xaccc2c['shift']());}}}(a102_0x5ba8,0x69125));export function buildFolderIdToPathMap(_0x3b21fd){const _0x50e054=a102_0x3152,_0x27380c=new Map(),_0xaf63df=new Map();for(const _0xe0559d of _0x3b21fd){_0xaf63df[_0x50e054(0x1cc)](_0xe0559d['id'],_0xe0559d);}const _0x53a917=new Set();for(const _0x7bc68 of _0x3b21fd){!_0x7bc68[_0x50e054(0x1ce)]&&_0x53a917[_0x50e054(0x1cf)](_0x7bc68['id']);}function _0x2e99df(_0x1421bd){const _0x1d4886=_0x50e054;if(_0x27380c[_0x1d4886(0x1c9)](_0x1421bd['id']))return _0x27380c['get'](_0x1421bd['id']);if(_0x53a917['has'](_0x1421bd['id']))return _0x27380c[_0x1d4886(0x1cc)](_0x1421bd['id'],''),'';if(_0x1421bd[_0x1d4886(0x1ce)]){const _0x279740=_0xaf63df['get'](_0x1421bd[_0x1d4886(0x1ce)]);if(_0x279740){const _0x492572=_0x2e99df(_0x279740),_0x26e57d=_0x492572?_0x492572+'/'+_0x1421bd[_0x1d4886(0x1d0)]:_0x1421bd[_0x1d4886(0x1d0)];return _0x27380c[_0x1d4886(0x1cc)](_0x1421bd['id'],_0x26e57d),_0x26e57d;}}const _0x2ae99c=_0x1421bd[_0x1d4886(0x1d0)];return _0x27380c[_0x1d4886(0x1cc)](_0x1421bd['id'],_0x2ae99c),_0x2ae99c;}for(const _0x24c421 of _0x3b21fd){_0x2e99df(_0x24c421);}return _0x27380c;}export function buildFolderPathToIdMap(_0x32acc9){const _0x483df6=a102_0x3152,_0x375851=new Map(),_0x54dbfe=new Map();for(const _0x95f9fd of _0x32acc9){_0x54dbfe['set'](_0x95f9fd['id'],_0x95f9fd);}const _0x1097de=new Set();for(const _0x500ad9 of _0x32acc9){!_0x500ad9[_0x483df6(0x1ce)]&&_0x1097de['add'](_0x500ad9['id']);}function _0x3ac45d(_0x8b3410){const _0x77f509=_0x483df6;if(_0x1097de['has'](_0x8b3410['id']))return'';if(_0x8b3410[_0x77f509(0x1ce)]){const _0x1a2b4b=_0x54dbfe[_0x77f509(0x1d2)](_0x8b3410[_0x77f509(0x1ce)]);if(_0x1a2b4b){const _0x33977a=_0x3ac45d(_0x1a2b4b);return _0x33977a?_0x33977a+'/'+_0x8b3410[_0x77f509(0x1d0)]:_0x8b3410['name'];}}return _0x8b3410[_0x77f509(0x1d0)];}for(const _0x2e2f27 of _0x32acc9){const _0x1bbedc=_0x3ac45d(_0x2e2f27);_0x375851[_0x483df6(0x1cc)](_0x1bbedc,_0x2e2f27['id']);}return _0x375851;}function a102_0x3152(_0x2d3aba,_0x51f0ba){_0x2d3aba=_0x2d3aba-0x1c8;const _0x5ba8ab=a102_0x5ba8();let _0x3152b9=_0x5ba8ab[_0x2d3aba];return _0x3152b9;}export function buildFolderMaps(_0x4a9bbe){const _0x34a0ab=a102_0x3152,_0x895a47=buildFolderIdToPathMap(_0x4a9bbe),_0x3adecb=new Map();for(const [_0xf770c0,_0x5a4b04]of _0x895a47){_0x3adecb[_0x34a0ab(0x1cc)](_0x5a4b04,_0xf770c0);}return{'idToPath':_0x895a47,'pathToId':_0x3adecb};}function a102_0x5ba8(){const _0x1fb875=['name','7515824OSruGz','get','2637900MGRDZt','93670oHwrIt','6tXRscd','494948jzjbAm','has','1369380teQZEM','393188icJFHM','set','5900342BtrYsC','parentFolderId','add'];a102_0x5ba8=function(){return _0x1fb875;};return a102_0x5ba8();}export function getFolderPath(_0xd61e9d,_0x351e92){if(!_0xd61e9d)return'';return _0x351e92['get'](_0xd61e9d)??'';}
@@ -1 +1 @@
1
- (function(_0x2e1dbc,_0x1c9521){const _0x100dc3=a103_0x5be8,_0x552251=_0x2e1dbc();while(!![]){try{const _0x3ff1a2=parseInt(_0x100dc3(0x18f))/0x1*(parseInt(_0x100dc3(0x17b))/0x2)+parseInt(_0x100dc3(0x180))/0x3*(parseInt(_0x100dc3(0x172))/0x4)+-parseInt(_0x100dc3(0x16e))/0x5*(parseInt(_0x100dc3(0x18d))/0x6)+parseInt(_0x100dc3(0x16c))/0x7+parseInt(_0x100dc3(0x170))/0x8*(-parseInt(_0x100dc3(0x182))/0x9)+-parseInt(_0x100dc3(0x16d))/0xa+parseInt(_0x100dc3(0x19f))/0xb*(-parseInt(_0x100dc3(0x17a))/0xc);if(_0x3ff1a2===_0x1c9521)break;else _0x552251['push'](_0x552251['shift']());}catch(_0x108d11){_0x552251['push'](_0x552251['shift']());}}}(a103_0x2c72,0x9543d));import a103_0x3b572e from'path';import{parse as a103_0x5c8ac4}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a103_0x5be8(_0x26bfd4,_0x344bf8){_0x26bfd4=_0x26bfd4-0x16c;const _0x2c720c=a103_0x2c72();let _0x5be8ed=_0x2c720c[_0x26bfd4];return _0x5be8ed;}function a103_0x2c72(){const _0x3b902c=['2476jZHsDa','replace','length','Cannot\x20navigate\x20above\x20root','slice','split','startsWith','Path\x20segment\x20cannot\x20be\x20empty','24OCsjCo','6ScPbxv','endsWith','join','filter','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','4857VXdFCD','resolve','6183666BhUdnd','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Path\x20attempts\x20to\x20navigate\x20above\x20root','type','parse','name','root','relative','segments','push','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','963162xMMppC','No\x20tdx.json\x20found\x20for\x20file:\x20','365683KGpnZW','raw','trim','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','readFile','isAbsolute','Path\x20cannot\x20be\x20empty','pop','tdx.json','substring','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','parent_segment','dirname','test','.yaml','journey','1878547ZNHsCX','exists','6254143quBYpm','2289530QxIEUW','35uNnNuW','segment','8yGgyYM','.yml'];a103_0x2c72=function(){return _0x3b902c;};return a103_0x2c72();}export function parsePath(_0x710e96){const _0x4d99c8=a103_0x5be8;if(!_0x710e96||_0x710e96[_0x4d99c8(0x191)]()==='')throw new Error(_0x4d99c8(0x195));const _0x22b5e7=_0x710e96['trim']();if(_0x22b5e7==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x710e96};const _0x4dcaec=_0x22b5e7['startsWith']('/')?_0x22b5e7[_0x4d99c8(0x198)](0x1):_0x22b5e7,_0x57376a=_0x4dcaec[_0x4d99c8(0x177)]('/')[_0x4d99c8(0x17e)](_0xbc3f0f=>_0xbc3f0f!=='');if(_0x57376a[_0x4d99c8(0x174)]===0x0)throw new Error(_0x4d99c8(0x18c));const _0x10d552=_0x22b5e7[_0x4d99c8(0x178)]('/')||!isRelativePathSegment(_0x57376a[0x0]);for(const _0x37da0b of _0x57376a){validatePathSegment(_0x37da0b);}return{'segments':_0x57376a,'isAbsolute':_0x10d552,'raw':_0x710e96};}function isRelativePathSegment(_0xd4bc8a){return _0xd4bc8a==='.'||_0xd4bc8a==='..';}function validatePathSegment(_0x346a7e){const _0x54ccb5=a103_0x5be8;if(_0x346a7e==='')throw new Error(_0x54ccb5(0x179));if(_0x346a7e==='.'||_0x346a7e==='..')return;if(/[\x00-\x1F\x7F]/[_0x54ccb5(0x19c)](_0x346a7e))throw new Error(_0x54ccb5(0x192)+_0x346a7e);if(_0x346a7e!==_0x346a7e[_0x54ccb5(0x191)]()){}}export function validatePath(_0x66cafe){const _0x223211=a103_0x5be8;if(_0x66cafe['segments'][_0x223211(0x174)]===0x0&&!_0x66cafe[_0x223211(0x194)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x66cafe[_0x223211(0x194)]){if(_0x66cafe[_0x223211(0x18a)][0x0]==='..')throw new Error(_0x223211(0x199));let _0x100a0c=0x0;for(const _0x514b4c of _0x66cafe[_0x223211(0x18a)]){if(_0x514b4c==='..'){if(_0x100a0c===0x0)throw new Error(_0x223211(0x184));_0x100a0c--;}else _0x514b4c!=='.'&&_0x100a0c++;}}}export function joinPaths(_0x186953,_0x1d4098){const _0xb57147=a103_0x5be8;if(!_0x186953||_0x186953==='/')return _0x1d4098;if(!_0x1d4098||_0x1d4098==='.')return _0x186953;if(_0x1d4098[_0xb57147(0x178)]('/'))return _0x1d4098;const _0x462894=parsePath(_0x186953),_0x415066=parsePath(_0x1d4098),_0x59ec68=[..._0x462894[_0xb57147(0x18a)]];for(const _0x3f970d of _0x415066[_0xb57147(0x18a)]){if(_0x3f970d==='.')continue;else{if(_0x3f970d==='..'){if(_0x59ec68[_0xb57147(0x174)]===0x0)throw new Error(_0xb57147(0x175));_0x59ec68[_0xb57147(0x196)]();}else _0x59ec68['push'](_0x3f970d);}}const _0x2bdd18=_0x59ec68[_0xb57147(0x17d)]('/');return _0x462894[_0xb57147(0x190)]['startsWith']('/')?'/'+_0x2bdd18:_0x2bdd18;}export function normalizePath(_0x42b1f2){const _0x2d2119=a103_0x5be8,_0x4165f7=parsePath(_0x42b1f2),_0x5c2e9d=[];for(const _0x3500ea of _0x4165f7[_0x2d2119(0x18a)]){if(_0x3500ea==='.')continue;else{if(_0x3500ea==='..'){if(_0x5c2e9d['length']===0x0){if(_0x4165f7[_0x2d2119(0x194)])throw new Error(_0x2d2119(0x175));_0x5c2e9d[_0x2d2119(0x18b)]('..');}else _0x5c2e9d[_0x5c2e9d[_0x2d2119(0x174)]-0x1]==='..'?_0x5c2e9d[_0x2d2119(0x18b)]('..'):_0x5c2e9d[_0x2d2119(0x196)]();}else _0x5c2e9d[_0x2d2119(0x18b)](_0x3500ea);}}if(_0x5c2e9d[_0x2d2119(0x174)]===0x0)return _0x4165f7[_0x2d2119(0x194)]?'/':'.';const _0x50dd2d=_0x5c2e9d[_0x2d2119(0x17d)]('/');return _0x4165f7[_0x2d2119(0x190)][_0x2d2119(0x178)]('/')?'/'+_0x50dd2d:_0x50dd2d;}export function getParentPath(_0x360fc7){const _0x22db04=a103_0x5be8,_0x4a0499=parsePath(_0x360fc7);if(_0x4a0499[_0x22db04(0x18a)][_0x22db04(0x174)]<=0x1)return'/';const _0x406f83=_0x4a0499[_0x22db04(0x18a)]['slice'](0x0,-0x1)[_0x22db04(0x17d)]('/');return _0x4a0499[_0x22db04(0x190)][_0x22db04(0x178)]('/')?'/'+_0x406f83:_0x406f83;}export function getBaseName(_0x5f4edc){const _0x4d6911=a103_0x5be8,_0x7faf29=parsePath(_0x5f4edc);return _0x7faf29['segments'][_0x7faf29[_0x4d6911(0x18a)][_0x4d6911(0x174)]-0x1]||'';}export function isChildPath(_0x3fb3ef,_0x416f51){const _0x5b98ea=a103_0x5be8,_0x5a59c9=parsePath(_0x3fb3ef),_0x1a4190=parsePath(_0x416f51);if(_0x5a59c9['segments'][_0x5b98ea(0x174)]<=_0x1a4190[_0x5b98ea(0x18a)][_0x5b98ea(0x174)])return![];for(let _0x1d39c9=0x0;_0x1d39c9<_0x1a4190[_0x5b98ea(0x18a)][_0x5b98ea(0x174)];_0x1d39c9++){if(_0x5a59c9[_0x5b98ea(0x18a)][_0x1d39c9]!==_0x1a4190[_0x5b98ea(0x18a)][_0x1d39c9])return![];}return!![];}export function splitPath(_0x137e86){const _0x5f3182=a103_0x5be8,_0x2d862e=parsePath(_0x137e86);if(_0x2d862e[_0x5f3182(0x18a)][_0x5f3182(0x174)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x2d862e[_0x5f3182(0x18a)][_0x5f3182(0x174)]===0x1)return{'parent':_0x2d862e['segments'][0x0]};return{'parent':_0x2d862e[_0x5f3182(0x18a)][0x0],'child':_0x2d862e['segments'][_0x5f3182(0x176)](0x1)[_0x5f3182(0x17d)]('/')};}export function isYamlFilePath(_0x152391){const _0x47fc48=a103_0x5be8;return _0x152391[_0x47fc48(0x17c)](_0x47fc48(0x171))||_0x152391[_0x47fc48(0x17c)](_0x47fc48(0x19d));}export async function resolveYamlFilePath(_0x2de8cd,_0x42914d=nodeFileSystem){const _0x28c5b4=a103_0x5be8,_0x212f8b=a103_0x3b572e[_0x28c5b4(0x181)](_0x2de8cd);if(!await _0x42914d['exists'](_0x212f8b))throw new Error('File\x20not\x20found:\x20'+_0x2de8cd);let _0x1fb575=a103_0x3b572e[_0x28c5b4(0x19b)](_0x212f8b),_0x1cb5ad=null,_0x329bdd=null;const _0x5dbf57=a103_0x3b572e['parse'](_0x1fb575)[_0x28c5b4(0x188)];while(_0x1fb575!==_0x5dbf57){const _0x125234=a103_0x3b572e[_0x28c5b4(0x17d)](_0x1fb575,_0x28c5b4(0x197));if(await _0x42914d[_0x28c5b4(0x1a0)](_0x125234)){_0x1cb5ad=_0x125234,_0x329bdd=_0x1fb575;break;}_0x1fb575=a103_0x3b572e[_0x28c5b4(0x19b)](_0x1fb575);}if(!_0x1cb5ad||!_0x329bdd)throw new Error(_0x28c5b4(0x18e)+_0x2de8cd);const _0x1281aa=await _0x42914d['readFile'](_0x1cb5ad),_0x4328e4=JSON[_0x28c5b4(0x186)](_0x1281aa),_0x55ead4=_0x4328e4[_0x28c5b4(0x19a)];if(!_0x55ead4)throw new Error(_0x28c5b4(0x17f));const _0x25b9ba=await _0x42914d[_0x28c5b4(0x193)](_0x212f8b),_0x416356=a103_0x5c8ac4(_0x25b9ba),_0x35e8d2=_0x416356[_0x28c5b4(0x187)];if(!_0x35e8d2)throw new Error(_0x28c5b4(0x183)+_0x2de8cd);const _0x236833=_0x416356[_0x28c5b4(0x185)]===_0x28c5b4(0x19e)?_0x28c5b4(0x19e):_0x28c5b4(0x16f),_0x525418=a103_0x3b572e[_0x28c5b4(0x189)](_0x329bdd,_0x212f8b),_0x3586ef=a103_0x3b572e[_0x28c5b4(0x19b)](_0x525418),_0x5e20ea=_0x3586ef==='.'?'':_0x3586ef[_0x28c5b4(0x173)](/\\/g,'/'),_0x28f5a0=_0x5e20ea?_0x55ead4+'/'+_0x5e20ea+'/'+_0x35e8d2:_0x55ead4+'/'+_0x35e8d2;return{'parentSegment':_0x55ead4,'segmentName':_0x35e8d2,'folderPath':_0x5e20ea,'fullPath':_0x28f5a0,'resourceType':_0x236833};}
1
+ (function(_0x4090fd,_0x30901d){const _0x18dbba=a103_0x1fa1,_0x438f8f=_0x4090fd();while(!![]){try{const _0x143e85=parseInt(_0x18dbba(0x197))/0x1+-parseInt(_0x18dbba(0x1a8))/0x2+parseInt(_0x18dbba(0x194))/0x3+-parseInt(_0x18dbba(0x1aa))/0x4*(parseInt(_0x18dbba(0x198))/0x5)+-parseInt(_0x18dbba(0x193))/0x6*(parseInt(_0x18dbba(0x19e))/0x7)+-parseInt(_0x18dbba(0x189))/0x8+parseInt(_0x18dbba(0x192))/0x9*(parseInt(_0x18dbba(0x190))/0xa);if(_0x143e85===_0x30901d)break;else _0x438f8f['push'](_0x438f8f['shift']());}catch(_0xab40d2){_0x438f8f['push'](_0x438f8f['shift']());}}}(a103_0x1f67,0xa2ce1));import a103_0x46810a from'path';import{parse as a103_0x4189de}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5823e2){const _0x4d84b0=a103_0x1fa1;if(!_0x5823e2||_0x5823e2['trim']()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0xae815e=_0x5823e2[_0x4d84b0(0x1ac)]();if(_0xae815e==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5823e2};const _0x512d51=_0xae815e[_0x4d84b0(0x18a)]('/')?_0xae815e[_0x4d84b0(0x184)](0x1):_0xae815e,_0x42159d=_0x512d51['split']('/')[_0x4d84b0(0x1a6)](_0x1ed431=>_0x1ed431!=='');if(_0x42159d[_0x4d84b0(0x18b)]===0x0)throw new Error(_0x4d84b0(0x196));const _0x326ec6=_0xae815e[_0x4d84b0(0x18a)]('/')||!isRelativePathSegment(_0x42159d[0x0]);for(const _0x570d9b of _0x42159d){validatePathSegment(_0x570d9b);}return{'segments':_0x42159d,'isAbsolute':_0x326ec6,'raw':_0x5823e2};}function isRelativePathSegment(_0x3d7faa){return _0x3d7faa==='.'||_0x3d7faa==='..';}function validatePathSegment(_0x1c769e){const _0x2d75d5=a103_0x1fa1;if(_0x1c769e==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x1c769e==='.'||_0x1c769e==='..')return;if(/[\x00-\x1F\x7F]/[_0x2d75d5(0x191)](_0x1c769e))throw new Error(_0x2d75d5(0x1ab)+_0x1c769e);if(_0x1c769e!==_0x1c769e[_0x2d75d5(0x1ac)]()){}}export function validatePath(_0xd683aa){const _0x277ccf=a103_0x1fa1;if(_0xd683aa[_0x277ccf(0x1af)][_0x277ccf(0x18b)]===0x0&&!_0xd683aa['isAbsolute'])throw new Error(_0x277ccf(0x1a1));if(_0xd683aa['isAbsolute']){if(_0xd683aa[_0x277ccf(0x1af)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x1fb44f=0x0;for(const _0x5d9eed of _0xd683aa[_0x277ccf(0x1af)]){if(_0x5d9eed==='..'){if(_0x1fb44f===0x0)throw new Error(_0x277ccf(0x19f));_0x1fb44f--;}else _0x5d9eed!=='.'&&_0x1fb44f++;}}}export function joinPaths(_0x38fc8d,_0x3f74a0){const _0x4bb810=a103_0x1fa1;if(!_0x38fc8d||_0x38fc8d==='/')return _0x3f74a0;if(!_0x3f74a0||_0x3f74a0==='.')return _0x38fc8d;if(_0x3f74a0[_0x4bb810(0x18a)]('/'))return _0x3f74a0;const _0x503e0b=parsePath(_0x38fc8d),_0x504d11=parsePath(_0x3f74a0),_0x26d414=[..._0x503e0b[_0x4bb810(0x1af)]];for(const _0x3edf55 of _0x504d11[_0x4bb810(0x1af)]){if(_0x3edf55==='.')continue;else{if(_0x3edf55==='..'){if(_0x26d414[_0x4bb810(0x18b)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x26d414['pop']();}else _0x26d414[_0x4bb810(0x1ad)](_0x3edf55);}}const _0x462c61=_0x26d414[_0x4bb810(0x1a7)]('/');return _0x503e0b[_0x4bb810(0x19b)][_0x4bb810(0x18a)]('/')?'/'+_0x462c61:_0x462c61;}export function normalizePath(_0x3b8437){const _0x30ed44=a103_0x1fa1,_0x2aeb8d=parsePath(_0x3b8437),_0x3974f6=[];for(const _0x203276 of _0x2aeb8d[_0x30ed44(0x1af)]){if(_0x203276==='.')continue;else{if(_0x203276==='..'){if(_0x3974f6[_0x30ed44(0x18b)]===0x0){if(_0x2aeb8d[_0x30ed44(0x1a4)])throw new Error(_0x30ed44(0x1a3));_0x3974f6['push']('..');}else _0x3974f6[_0x3974f6[_0x30ed44(0x18b)]-0x1]==='..'?_0x3974f6['push']('..'):_0x3974f6[_0x30ed44(0x199)]();}else _0x3974f6['push'](_0x203276);}}if(_0x3974f6[_0x30ed44(0x18b)]===0x0)return _0x2aeb8d[_0x30ed44(0x1a4)]?'/':'.';const _0x2fd6b3=_0x3974f6[_0x30ed44(0x1a7)]('/');return _0x2aeb8d[_0x30ed44(0x19b)]['startsWith']('/')?'/'+_0x2fd6b3:_0x2fd6b3;}export function getParentPath(_0x5eebfc){const _0x2134de=a103_0x1fa1,_0x5c1909=parsePath(_0x5eebfc);if(_0x5c1909[_0x2134de(0x1af)][_0x2134de(0x18b)]<=0x1)return'/';const _0x3998b8=_0x5c1909['segments'][_0x2134de(0x18f)](0x0,-0x1)[_0x2134de(0x1a7)]('/');return _0x5c1909[_0x2134de(0x19b)][_0x2134de(0x18a)]('/')?'/'+_0x3998b8:_0x3998b8;}function a103_0x1f67(){const _0x32f09d=['Path\x20attempts\x20to\x20navigate\x20above\x20root','tdx.json','Relative\x20path\x20cannot\x20be\x20empty','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Cannot\x20navigate\x20above\x20root','isAbsolute','exists','filter','join','1437370XjXrcn','root','208kySwdE','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','trim','push','journey','segments','endsWith','dirname','substring','segment','File\x20not\x20found:\x20','No\x20tdx.json\x20found\x20for\x20file:\x20','parent_segment','2026488kvEptA','startsWith','length','name','replace','resolve','slice','5649700PTwrmy','test','27NSJMON','72AmFgOO','665937pcbjjX','type','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','932208uYIhCP','14000fmFgaY','pop','readFile','raw','Cannot\x20split\x20empty\x20path','relative','621047xqWkpQ'];a103_0x1f67=function(){return _0x32f09d;};return a103_0x1f67();}export function getBaseName(_0x36e809){const _0x4cffd5=a103_0x1fa1,_0x14e95a=parsePath(_0x36e809);return _0x14e95a[_0x4cffd5(0x1af)][_0x14e95a[_0x4cffd5(0x1af)][_0x4cffd5(0x18b)]-0x1]||'';}export function isChildPath(_0x15ca7f,_0x470500){const _0x252336=a103_0x1fa1,_0x3c1aac=parsePath(_0x15ca7f),_0x5e7232=parsePath(_0x470500);if(_0x3c1aac[_0x252336(0x1af)][_0x252336(0x18b)]<=_0x5e7232[_0x252336(0x1af)][_0x252336(0x18b)])return![];for(let _0x1da6ee=0x0;_0x1da6ee<_0x5e7232['segments']['length'];_0x1da6ee++){if(_0x3c1aac[_0x252336(0x1af)][_0x1da6ee]!==_0x5e7232[_0x252336(0x1af)][_0x1da6ee])return![];}return!![];}export function splitPath(_0x4ae825){const _0x3fc8c4=a103_0x1fa1,_0xa6eac5=parsePath(_0x4ae825);if(_0xa6eac5[_0x3fc8c4(0x1af)][_0x3fc8c4(0x18b)]===0x0)throw new Error(_0x3fc8c4(0x19c));if(_0xa6eac5[_0x3fc8c4(0x1af)][_0x3fc8c4(0x18b)]===0x1)return{'parent':_0xa6eac5[_0x3fc8c4(0x1af)][0x0]};return{'parent':_0xa6eac5[_0x3fc8c4(0x1af)][0x0],'child':_0xa6eac5['segments']['slice'](0x1)['join']('/')};}function a103_0x1fa1(_0x28a48d,_0x373c84){_0x28a48d=_0x28a48d-0x182;const _0x1f672f=a103_0x1f67();let _0x1fa185=_0x1f672f[_0x28a48d];return _0x1fa185;}export function isYamlFilePath(_0x2df26f){const _0x5743e1=a103_0x1fa1;return _0x2df26f[_0x5743e1(0x182)]('.yml')||_0x2df26f[_0x5743e1(0x182)]('.yaml');}export async function resolveYamlFilePath(_0x20adcb,_0x12cf71=nodeFileSystem){const _0x5c0d05=a103_0x1fa1,_0x1edc53=a103_0x46810a[_0x5c0d05(0x18e)](_0x20adcb);if(!await _0x12cf71[_0x5c0d05(0x1a5)](_0x1edc53))throw new Error(_0x5c0d05(0x186)+_0x20adcb);let _0x5dbaa7=a103_0x46810a[_0x5c0d05(0x183)](_0x1edc53),_0x5ab71d=null,_0x20ac23=null;const _0x1a5efc=a103_0x46810a['parse'](_0x5dbaa7)[_0x5c0d05(0x1a9)];while(_0x5dbaa7!==_0x1a5efc){const _0xf1f08=a103_0x46810a[_0x5c0d05(0x1a7)](_0x5dbaa7,_0x5c0d05(0x1a0));if(await _0x12cf71['exists'](_0xf1f08)){_0x5ab71d=_0xf1f08,_0x20ac23=_0x5dbaa7;break;}_0x5dbaa7=a103_0x46810a['dirname'](_0x5dbaa7);}if(!_0x5ab71d||!_0x20ac23)throw new Error(_0x5c0d05(0x187)+_0x20adcb);const _0x40cd42=await _0x12cf71[_0x5c0d05(0x19a)](_0x5ab71d),_0x1a3ef2=JSON['parse'](_0x40cd42),_0x11521f=_0x1a3ef2[_0x5c0d05(0x188)];if(!_0x11521f)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x188349=await _0x12cf71['readFile'](_0x1edc53),_0x273ce5=a103_0x4189de(_0x188349),_0x2e3cc7=_0x273ce5[_0x5c0d05(0x18c)];if(!_0x2e3cc7)throw new Error(_0x5c0d05(0x1a2)+_0x20adcb);const _0x55b6ee=_0x273ce5[_0x5c0d05(0x195)]===_0x5c0d05(0x1ae)?_0x5c0d05(0x1ae):_0x5c0d05(0x185),_0x23186c=a103_0x46810a[_0x5c0d05(0x19d)](_0x20ac23,_0x1edc53),_0x46f2e1=a103_0x46810a[_0x5c0d05(0x183)](_0x23186c),_0x4f6f27=_0x46f2e1==='.'?'':_0x46f2e1[_0x5c0d05(0x18d)](/\\/g,'/'),_0x5327ae=_0x4f6f27?_0x11521f+'/'+_0x4f6f27+'/'+_0x2e3cc7:_0x11521f+'/'+_0x2e3cc7;return{'parentSegment':_0x11521f,'segmentName':_0x2e3cc7,'folderPath':_0x4f6f27,'fullPath':_0x5327ae,'resourceType':_0x55b6ee};}
@@ -1 +1 @@
1
- (function(_0x40928a,_0x592df8){const _0x34b818=a104_0x4079,_0xdbd12d=_0x40928a();while(!![]){try{const _0x144c0d=-parseInt(_0x34b818(0x13b))/0x1+parseInt(_0x34b818(0x13d))/0x2*(-parseInt(_0x34b818(0x130))/0x3)+-parseInt(_0x34b818(0x137))/0x4+parseInt(_0x34b818(0x131))/0x5*(-parseInt(_0x34b818(0x133))/0x6)+parseInt(_0x34b818(0x135))/0x7+parseInt(_0x34b818(0x13c))/0x8*(parseInt(_0x34b818(0x139))/0x9)+parseInt(_0x34b818(0x134))/0xa*(parseInt(_0x34b818(0x136))/0xb);if(_0x144c0d===_0x592df8)break;else _0xdbd12d['push'](_0xdbd12d['shift']());}catch(_0x3008a0){_0xdbd12d['push'](_0xdbd12d['shift']());}}}(a104_0x2c37,0xb0ebb));function a104_0x2c37(){const _0x4be2c0=['336VpwYzp','790694RWDkHn','Invalid\x20segment\x20reference\x20format:\x20','3bDTsRi','5RIpKFY','.\x20Child\x20name\x20cannot\x20be\x20empty','5494098zIOAYK','13810tiTcwh','3229751ilceTd','12023enSoIS','939344htsUDP','.\x20Parent\x20name\x20cannot\x20be\x20empty','89550AyojfV','substring','118193kbsOng'];a104_0x2c37=function(){return _0x4be2c0;};return a104_0x2c37();}function a104_0x4079(_0x5c5f1e,_0x52d0e2){_0x5c5f1e=_0x5c5f1e-0x130;const _0x2c3793=a104_0x2c37();let _0x4079d2=_0x2c3793[_0x5c5f1e];return _0x4079d2;}export function parseSegmentRef(_0x57c693){const _0x300098=a104_0x4079,_0x684def=_0x57c693['indexOf']('/');if(_0x684def===-0x1)return{'parentId':_0x57c693};if(_0x684def===0x0)throw new Error(_0x300098(0x13e)+_0x57c693+_0x300098(0x138));const _0x37941c=_0x57c693['substring'](0x0,_0x684def),_0x5947b2=_0x57c693[_0x300098(0x13a)](_0x684def+0x1);if(_0x5947b2==='')throw new Error(_0x300098(0x13e)+_0x57c693+_0x300098(0x132));return{'parentId':_0x37941c,'childId':_0x5947b2};}
1
+ function a104_0x50a6(_0x2d0b70,_0x530b21){_0x2d0b70=_0x2d0b70-0x128;const _0x49c828=a104_0x49c8();let _0x50a61f=_0x49c828[_0x2d0b70];return _0x50a61f;}(function(_0x309069,_0x4b9875){const _0x595aea=a104_0x50a6,_0x375d80=_0x309069();while(!![]){try{const _0x136482=-parseInt(_0x595aea(0x135))/0x1*(-parseInt(_0x595aea(0x12a))/0x2)+-parseInt(_0x595aea(0x136))/0x3*(parseInt(_0x595aea(0x133))/0x4)+parseInt(_0x595aea(0x132))/0x5*(parseInt(_0x595aea(0x134))/0x6)+-parseInt(_0x595aea(0x12f))/0x7*(parseInt(_0x595aea(0x12c))/0x8)+-parseInt(_0x595aea(0x129))/0x9*(-parseInt(_0x595aea(0x128))/0xa)+-parseInt(_0x595aea(0x130))/0xb+parseInt(_0x595aea(0x12b))/0xc;if(_0x136482===_0x4b9875)break;else _0x375d80['push'](_0x375d80['shift']());}catch(_0x2995b3){_0x375d80['push'](_0x375d80['shift']());}}}(a104_0x49c8,0x1d772));export function parseSegmentRef(_0x4322e7){const _0x4cdcfa=a104_0x50a6,_0x2446e9=_0x4322e7['indexOf']('/');if(_0x2446e9===-0x1)return{'parentId':_0x4322e7};if(_0x2446e9===0x0)throw new Error(_0x4cdcfa(0x12d)+_0x4322e7+_0x4cdcfa(0x12e));const _0x5de006=_0x4322e7['substring'](0x0,_0x2446e9),_0x47464a=_0x4322e7['substring'](_0x2446e9+0x1);if(_0x47464a==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x4322e7+_0x4cdcfa(0x131));return{'parentId':_0x5de006,'childId':_0x47464a};}function a104_0x49c8(){const _0x4c4e6e=['280685DFbCCw','628bWgaOg','18pOGvRm','1ZhIaqi','879qrCesr','18200lHqewE','18xNsibi','149320WsuuNt','1722036syZgCy','1208IdRpzg','Invalid\x20segment\x20reference\x20format:\x20','.\x20Parent\x20name\x20cannot\x20be\x20empty','840KcLYpA','2259433zCTOqi','.\x20Child\x20name\x20cannot\x20be\x20empty'];a104_0x49c8=function(){return _0x4c4e6e;};return a104_0x49c8();}
@@ -1 +1 @@
1
- (function(_0x39838b,_0x5dca25){const _0x4715fa=a105_0x53aa,_0x41a406=_0x39838b();while(!![]){try{const _0x2c2d75=parseInt(_0x4715fa(0x17f))/0x1+-parseInt(_0x4715fa(0x16b))/0x2+-parseInt(_0x4715fa(0x182))/0x3+-parseInt(_0x4715fa(0x15f))/0x4+-parseInt(_0x4715fa(0x162))/0x5+-parseInt(_0x4715fa(0x178))/0x6*(-parseInt(_0x4715fa(0x169))/0x7)+-parseInt(_0x4715fa(0x163))/0x8*(-parseInt(_0x4715fa(0x177))/0x9);if(_0x2c2d75===_0x5dca25)break;else _0x41a406['push'](_0x41a406['shift']());}catch(_0x534c11){_0x41a406['push'](_0x41a406['shift']());}}}(a105_0x34be,0x7e72a));import a105_0x174a45 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0xd9ded1){const _0x55d4d2=a105_0x53aa;return _0xd9ded1[_0x55d4d2(0x164)]!==_0x55d4d2(0x188);}export function isScopedResolution(_0x6de9f8){const _0x412baa=a105_0x53aa;return _0x6de9f8['type']===_0x412baa(0x170)||_0x6de9f8[_0x412baa(0x164)]===_0x412baa(0x187)||_0x6de9f8[_0x412baa(0x164)]===_0x412baa(0x16d);}export function getScopedDetails(_0x39ae7d){const _0x6e8f01=a105_0x53aa;if(isScopedResolution(_0x39ae7d))return{'isScoped':_0x39ae7d[_0x6e8f01(0x165)],'scopedFolderPath':_0x39ae7d[_0x6e8f01(0x15d)]};return undefined;}function a105_0x34be(){const _0x2e88c9=['Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','message','scopedFolderPath','segmentName','1101332wvxAzD','folderPath','join','3515150PwafVR','121496LaMmNI','type','isScoped','parentSegment','trim','File\x20not\x20found:\x20','973aVgVhj','extname','363724hXnFkk','Parent\x20segment\x20not\x20specified','context','parse','invalid_yaml','directory','segment','tdx.json','resourceType','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parent_segment','basename','486vcYNaq','31716GeAtGZ','configDir','no_config','isFile','dirname','readFile','isDirectory','435217XGTbMa','match','exists','935742falGWq','includes','relative','resolve','replace','file','error','journey','No\x20tdx.json\x20found','startsWith','root','No\x20tdx.json\x20found\x20for\x20file:\x20','parent_name'];a105_0x34be=function(){return _0x2e88c9;};return a105_0x34be();}async function findTdxConfigAsync(_0x206411,_0x2f022c){const _0x48f631=a105_0x53aa;let _0x53b2bd=a105_0x174a45[_0x48f631(0x185)](_0x206411);const _0x35875f=a105_0x174a45[_0x48f631(0x16e)](_0x53b2bd)[_0x48f631(0x158)];while(_0x53b2bd!==_0x35875f){const _0x4aaaa6=a105_0x174a45[_0x48f631(0x161)](_0x53b2bd,_0x48f631(0x172));if(await _0x2f022c[_0x48f631(0x181)](_0x4aaaa6))try{const _0x8d37e0=await _0x2f022c[_0x48f631(0x17d)](_0x4aaaa6),_0x110b1f=JSON[_0x48f631(0x16e)](_0x8d37e0);if(_0x110b1f[_0x48f631(0x175)]&&typeof _0x110b1f[_0x48f631(0x175)]==='string')return{'configPath':_0x4aaaa6,'configDir':_0x53b2bd,'parentSegment':_0x110b1f[_0x48f631(0x175)]};}catch{}_0x53b2bd=a105_0x174a45[_0x48f631(0x17c)](_0x53b2bd);}return null;}function calculateScopedPath(_0x4cf1f8,_0x5d74ce){const _0x428ccb=a105_0x53aa,_0x38e61e=a105_0x174a45[_0x428ccb(0x184)](_0x5d74ce,_0x4cf1f8),_0x23d5b0=_0x38e61e!==''&&_0x38e61e!=='.'&&!_0x38e61e[_0x428ccb(0x157)]('..');return{'isScoped':_0x23d5b0,'scopedFolderPath':_0x23d5b0?_0x38e61e[_0x428ccb(0x186)](/\\/g,'/'):''};}function a105_0x53aa(_0x3e5aa0,_0x552a45){_0x3e5aa0=_0x3e5aa0-0x156;const _0x34be13=a105_0x34be();let _0x53aa48=_0x34be13[_0x3e5aa0];return _0x53aa48;}export async function resolveTarget(_0x1bedc7){const _0x4f350f=a105_0x53aa,{arg:_0xc7c93c,contextParent:_0x402e6c,cwd:cwd=process['cwd'](),fs:fs=nodeFileSystem}=_0x1bedc7;if(_0xc7c93c&&isYamlFilePath(_0xc7c93c))try{const _0x40410f=await resolveYamlFilePath(_0xc7c93c,fs),_0x391db5=a105_0x174a45[_0x4f350f(0x185)](_0xc7c93c),_0x8a1b9d=a105_0x174a45['dirname'](_0x391db5),_0x46c1c1=await findTdxConfigAsync(_0x8a1b9d,fs);if(!_0x46c1c1){if(_0x402e6c){const _0x448849=a105_0x174a45[_0x4f350f(0x17c)](_0x391db5);return{'type':'file','parentName':_0x402e6c,'targetDir':_0x448849,'configRoot':_0x448849,'filePath':_0x391db5,'resourceName':_0x40410f['segmentName'],'folderPath':_0x40410f[_0x4f350f(0x160)],'resourceType':_0x40410f[_0x4f350f(0x173)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x4f350f(0x188),'errorCode':_0x4f350f(0x17a),'message':_0x4f350f(0x159)+_0xc7c93c,'arg':_0xc7c93c,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}const _0x5191a1=calculateScopedPath(_0x8a1b9d,_0x46c1c1[_0x4f350f(0x179)]);return{'type':_0x4f350f(0x187),'parentName':_0x46c1c1[_0x4f350f(0x166)],'targetDir':_0x46c1c1[_0x4f350f(0x179)],'configRoot':_0x46c1c1[_0x4f350f(0x179)],'filePath':_0x391db5,'resourceName':_0x40410f[_0x4f350f(0x15e)],'folderPath':_0x40410f['folderPath'],'resourceType':_0x40410f[_0x4f350f(0x173)],'isScoped':_0x5191a1[_0x4f350f(0x165)],'scopedFolderPath':_0x5191a1[_0x4f350f(0x15d)]};}catch(_0x39c14d){const _0xd10e0d=_0x39c14d instanceof Error?_0x39c14d[_0x4f350f(0x15c)]:String(_0x39c14d);if(_0xd10e0d[_0x4f350f(0x183)]('File\x20not\x20found'))return{'type':_0x4f350f(0x188),'errorCode':'file_not_found','message':_0x4f350f(0x168)+_0xc7c93c,'arg':_0xc7c93c};if(_0xd10e0d[_0x4f350f(0x183)](_0x4f350f(0x156))){if(_0x402e6c){const _0x5167d6=a105_0x174a45['resolve'](_0xc7c93c);if(await fs[_0x4f350f(0x181)](_0x5167d6)){const _0x44a187=a105_0x174a45[_0x4f350f(0x17c)](_0x5167d6),_0xed1d40=await fs[_0x4f350f(0x17d)](_0x5167d6),_0x941b60=_0xed1d40['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x2b49d5=_0xed1d40[_0x4f350f(0x180)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x471f82=_0x941b60?_0x941b60[0x1]['trim']():a105_0x174a45[_0x4f350f(0x176)](_0xc7c93c,a105_0x174a45[_0x4f350f(0x16a)](_0xc7c93c)),_0x4de858=_0x2b49d5&&_0x2b49d5[0x1][_0x4f350f(0x167)]()===_0x4f350f(0x189)?_0x4f350f(0x189):_0x4f350f(0x171);return{'type':'file','parentName':_0x402e6c,'targetDir':_0x44a187,'configRoot':_0x44a187,'filePath':_0x5167d6,'resourceName':_0x471f82,'folderPath':'','resourceType':_0x4de858,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x4f350f(0x188),'errorCode':'no_config','message':_0x4f350f(0x159)+_0xc7c93c,'arg':_0xc7c93c,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}return{'type':_0x4f350f(0x188),'errorCode':_0x4f350f(0x16f),'message':_0xd10e0d,'arg':_0xc7c93c};}if(_0xc7c93c){const _0xbbb8ae=a105_0x174a45[_0x4f350f(0x185)](cwd,_0xc7c93c);let _0x1fcce3=null;try{_0x1fcce3=await fs['stat'](_0xbbb8ae);}catch{}if(_0x1fcce3?.[_0x4f350f(0x17e)]()){const _0x9f96da=await findTdxConfigAsync(_0xbbb8ae,fs);if(_0x9f96da){const _0x134dc7=calculateScopedPath(_0xbbb8ae,_0x9f96da[_0x4f350f(0x179)]);return{'type':_0x4f350f(0x170),'parentName':_0x9f96da[_0x4f350f(0x166)],'targetDir':_0xbbb8ae,'configRoot':_0x9f96da[_0x4f350f(0x179)],'isScoped':_0x134dc7[_0x4f350f(0x165)],'scopedFolderPath':_0x134dc7[_0x4f350f(0x15d)]};}if(_0x402e6c)return{'type':_0x4f350f(0x170),'parentName':_0x402e6c,'targetDir':_0xbbb8ae,'configRoot':_0xbbb8ae,'isScoped':![],'scopedFolderPath':''};return{'type':_0x4f350f(0x188),'errorCode':_0x4f350f(0x17a),'message':_0x4f350f(0x174)+_0xc7c93c,'arg':_0xc7c93c,'helpText':_0x4f350f(0x15b)};}if(_0x1fcce3?.[_0x4f350f(0x17b)]())return{'type':'error','errorCode':_0x4f350f(0x16f),'message':'Not\x20a\x20YAML\x20file:\x20'+_0xc7c93c,'arg':_0xc7c93c,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x4f9085=sanitizeFileName(_0xc7c93c),_0x110496=getSegmentRootDir(_0x4f9085,cwd);return{'type':_0x4f350f(0x15a),'parentName':_0xc7c93c,'targetDir':_0x110496,'configRoot':_0x110496};}const _0x1c2eeb=await findTdxConfigAsync(cwd,fs);if(_0x1c2eeb){const _0x26f360=calculateScopedPath(cwd,_0x1c2eeb[_0x4f350f(0x179)]);return{'type':_0x4f350f(0x16d),'parentName':_0x1c2eeb['parentSegment'],'targetDir':cwd,'configRoot':_0x1c2eeb['configDir'],'isScoped':_0x26f360[_0x4f350f(0x165)],'scopedFolderPath':_0x26f360['scopedFolderPath']};}if(_0x402e6c){const _0x298d94=sanitizeFileName(_0x402e6c),_0x2c830b=getSegmentRootDir(_0x298d94,cwd);return{'type':_0x4f350f(0x16d),'parentName':_0x402e6c,'targetDir':_0x2c830b,'configRoot':_0x2c830b,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x4f350f(0x188),'errorCode':'no_parent','message':_0x4f350f(0x16c),'helpText':'Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure'};}
1
+ (function(_0x334729,_0x39e0e6){const _0x5db974=a105_0x253d,_0x168913=_0x334729();while(!![]){try{const _0x12c35e=-parseInt(_0x5db974(0x144))/0x1*(-parseInt(_0x5db974(0x154))/0x2)+parseInt(_0x5db974(0x146))/0x3+-parseInt(_0x5db974(0x15c))/0x4+-parseInt(_0x5db974(0x12f))/0x5+-parseInt(_0x5db974(0x147))/0x6*(-parseInt(_0x5db974(0x14b))/0x7)+parseInt(_0x5db974(0x12b))/0x8*(parseInt(_0x5db974(0x13b))/0x9)+parseInt(_0x5db974(0x136))/0xa*(-parseInt(_0x5db974(0x151))/0xb);if(_0x12c35e===_0x39e0e6)break;else _0x168913['push'](_0x168913['shift']());}catch(_0x3a95bb){_0x168913['push'](_0x168913['shift']());}}}(a105_0x1219,0x462dc));import a105_0x292b54 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(_0xfd3738){const _0x202546=a105_0x253d;return _0xfd3738[_0x202546(0x138)]!=='error';}export function isScopedResolution(_0x24ab8c){const _0x526241=a105_0x253d;return _0x24ab8c[_0x526241(0x138)]===_0x526241(0x13a)||_0x24ab8c[_0x526241(0x138)]==='file'||_0x24ab8c[_0x526241(0x138)]===_0x526241(0x13d);}export function getScopedDetails(_0x3b89cd){const _0x3fa8fa=a105_0x253d;if(isScopedResolution(_0x3b89cd))return{'isScoped':_0x3b89cd[_0x3fa8fa(0x12d)],'scopedFolderPath':_0x3b89cd[_0x3fa8fa(0x153)]};return undefined;}async function findTdxConfigAsync(_0x84ec10,_0xf9f8bb){const _0x1fc442=a105_0x253d;let _0x480b3e=a105_0x292b54[_0x1fc442(0x14c)](_0x84ec10);const _0x49c758=a105_0x292b54[_0x1fc442(0x132)](_0x480b3e)['root'];while(_0x480b3e!==_0x49c758){const _0x454bc2=a105_0x292b54[_0x1fc442(0x14d)](_0x480b3e,'tdx.json');if(await _0xf9f8bb[_0x1fc442(0x131)](_0x454bc2))try{const _0x5f0bff=await _0xf9f8bb['readFile'](_0x454bc2),_0x3eb86a=JSON[_0x1fc442(0x132)](_0x5f0bff);if(_0x3eb86a[_0x1fc442(0x15b)]&&typeof _0x3eb86a[_0x1fc442(0x15b)]===_0x1fc442(0x150))return{'configPath':_0x454bc2,'configDir':_0x480b3e,'parentSegment':_0x3eb86a[_0x1fc442(0x15b)]};}catch{}_0x480b3e=a105_0x292b54[_0x1fc442(0x13e)](_0x480b3e);}return null;}function a105_0x253d(_0xcf7f0c,_0x5aa37f){_0xcf7f0c=_0xcf7f0c-0x129;const _0x121914=a105_0x1219();let _0x253dad=_0x121914[_0xcf7f0c];return _0x253dad;}function calculateScopedPath(_0xb325d3,_0x18fac3){const _0x517bff=a105_0x253d,_0x56d8d7=a105_0x292b54[_0x517bff(0x152)](_0x18fac3,_0xb325d3),_0x52e2df=_0x56d8d7!==''&&_0x56d8d7!=='.'&&!_0x56d8d7[_0x517bff(0x13c)]('..');return{'isScoped':_0x52e2df,'scopedFolderPath':_0x52e2df?_0x56d8d7['replace'](/\\/g,'/'):''};}export async function resolveTarget(_0x2be774){const _0xbedfbe=a105_0x253d,{arg:_0x3eb97b,contextParent:_0x32ff80,cwd:cwd=process[_0xbedfbe(0x15a)](),fs:fs=nodeFileSystem}=_0x2be774;if(_0x3eb97b&&isYamlFilePath(_0x3eb97b))try{const _0x429c45=await resolveYamlFilePath(_0x3eb97b,fs),_0x50caed=a105_0x292b54[_0xbedfbe(0x14c)](_0x3eb97b),_0x41e64a=a105_0x292b54[_0xbedfbe(0x13e)](_0x50caed),_0x5156a6=await findTdxConfigAsync(_0x41e64a,fs);if(!_0x5156a6){if(_0x32ff80){const _0x631d0e=a105_0x292b54[_0xbedfbe(0x13e)](_0x50caed);return{'type':_0xbedfbe(0x135),'parentName':_0x32ff80,'targetDir':_0x631d0e,'configRoot':_0x631d0e,'filePath':_0x50caed,'resourceName':_0x429c45['segmentName'],'folderPath':_0x429c45[_0xbedfbe(0x141)],'resourceType':_0x429c45[_0xbedfbe(0x149)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0xbedfbe(0x142),'errorCode':_0xbedfbe(0x13f),'message':_0xbedfbe(0x15d)+_0x3eb97b,'arg':_0x3eb97b,'helpText':_0xbedfbe(0x145)};}const _0x123f8d=calculateScopedPath(_0x41e64a,_0x5156a6['configDir']);return{'type':_0xbedfbe(0x135),'parentName':_0x5156a6[_0xbedfbe(0x134)],'targetDir':_0x5156a6[_0xbedfbe(0x12a)],'configRoot':_0x5156a6[_0xbedfbe(0x12a)],'filePath':_0x50caed,'resourceName':_0x429c45[_0xbedfbe(0x137)],'folderPath':_0x429c45[_0xbedfbe(0x141)],'resourceType':_0x429c45['resourceType'],'isScoped':_0x123f8d[_0xbedfbe(0x12d)],'scopedFolderPath':_0x123f8d['scopedFolderPath']};}catch(_0x42acd4){const _0x35954d=_0x42acd4 instanceof Error?_0x42acd4[_0xbedfbe(0x129)]:String(_0x42acd4);if(_0x35954d['includes']('File\x20not\x20found'))return{'type':'error','errorCode':_0xbedfbe(0x157),'message':_0xbedfbe(0x155)+_0x3eb97b,'arg':_0x3eb97b};if(_0x35954d[_0xbedfbe(0x15e)](_0xbedfbe(0x158))){if(_0x32ff80){const _0x4e9507=a105_0x292b54[_0xbedfbe(0x14c)](_0x3eb97b);if(await fs[_0xbedfbe(0x131)](_0x4e9507)){const _0x5e3a87=a105_0x292b54[_0xbedfbe(0x13e)](_0x4e9507),_0x18f730=await fs['readFile'](_0x4e9507),_0x29bf93=_0x18f730[_0xbedfbe(0x143)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x370b88=_0x18f730[_0xbedfbe(0x143)](/^type:\s*["']?([^"'\n]+)["']?/m),_0xbd3590=_0x29bf93?_0x29bf93[0x1][_0xbedfbe(0x140)]():a105_0x292b54[_0xbedfbe(0x156)](_0x3eb97b,a105_0x292b54[_0xbedfbe(0x12e)](_0x3eb97b)),_0x553514=_0x370b88&&_0x370b88[0x1]['trim']()==='journey'?'journey':_0xbedfbe(0x14e);return{'type':_0xbedfbe(0x135),'parentName':_0x32ff80,'targetDir':_0x5e3a87,'configRoot':_0x5e3a87,'filePath':_0x4e9507,'resourceName':_0xbd3590,'folderPath':'','resourceType':_0x553514,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0xbedfbe(0x13f),'message':_0xbedfbe(0x15d)+_0x3eb97b,'arg':_0x3eb97b,'helpText':_0xbedfbe(0x145)};}return{'type':_0xbedfbe(0x142),'errorCode':'invalid_yaml','message':_0x35954d,'arg':_0x3eb97b};}if(_0x3eb97b){const _0x2eb649=a105_0x292b54[_0xbedfbe(0x14c)](cwd,_0x3eb97b);let _0x47d649=null;try{_0x47d649=await fs[_0xbedfbe(0x133)](_0x2eb649);}catch{}if(_0x47d649?.[_0xbedfbe(0x12c)]()){const _0x1653f3=await findTdxConfigAsync(_0x2eb649,fs);if(_0x1653f3){const _0x271019=calculateScopedPath(_0x2eb649,_0x1653f3[_0xbedfbe(0x12a)]);return{'type':'directory','parentName':_0x1653f3[_0xbedfbe(0x134)],'targetDir':_0x2eb649,'configRoot':_0x1653f3['configDir'],'isScoped':_0x271019[_0xbedfbe(0x12d)],'scopedFolderPath':_0x271019[_0xbedfbe(0x153)]};}if(_0x32ff80)return{'type':_0xbedfbe(0x13a),'parentName':_0x32ff80,'targetDir':_0x2eb649,'configRoot':_0x2eb649,'isScoped':![],'scopedFolderPath':''};return{'type':_0xbedfbe(0x142),'errorCode':_0xbedfbe(0x13f),'message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x3eb97b,'arg':_0x3eb97b,'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(_0x47d649?.[_0xbedfbe(0x130)]())return{'type':_0xbedfbe(0x142),'errorCode':_0xbedfbe(0x14a),'message':_0xbedfbe(0x159)+_0x3eb97b,'arg':_0x3eb97b,'helpText':_0xbedfbe(0x148)};const _0x297fad=sanitizeFileName(_0x3eb97b),_0x49a4f8=getSegmentRootDir(_0x297fad,cwd);return{'type':_0xbedfbe(0x139),'parentName':_0x3eb97b,'targetDir':_0x49a4f8,'configRoot':_0x49a4f8};}const _0x18d845=await findTdxConfigAsync(cwd,fs);if(_0x18d845){const _0x425a4e=calculateScopedPath(cwd,_0x18d845[_0xbedfbe(0x12a)]);return{'type':'context','parentName':_0x18d845['parentSegment'],'targetDir':cwd,'configRoot':_0x18d845['configDir'],'isScoped':_0x425a4e[_0xbedfbe(0x12d)],'scopedFolderPath':_0x425a4e[_0xbedfbe(0x153)]};}if(_0x32ff80){const _0x143ab6=sanitizeFileName(_0x32ff80),_0x46ab15=getSegmentRootDir(_0x143ab6,cwd);return{'type':'context','parentName':_0x32ff80,'targetDir':_0x46ab15,'configRoot':_0x46ab15,'isScoped':![],'scopedFolderPath':''};}return{'type':_0xbedfbe(0x142),'errorCode':_0xbedfbe(0x14f),'message':'Parent\x20segment\x20not\x20specified','helpText':'Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure'};}function a105_0x1219(){const _0x29cbe7=['match','2lniohI','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','1641486vVNOAV','6bEbZay','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','resourceType','invalid_yaml','2340583GByLzc','resolve','join','segment','no_parent','string','156376ppsDsx','relative','scopedFolderPath','129440ScnroU','File\x20not\x20found:\x20','basename','file_not_found','No\x20tdx.json\x20found','Not\x20a\x20YAML\x20file:\x20','cwd','parent_segment','1694720WPxcAL','No\x20tdx.json\x20found\x20for\x20file:\x20','includes','message','configDir','160808SVwicn','isDirectory','isScoped','extname','638970iLSVGY','isFile','exists','parse','stat','parentSegment','file','220nkeIAe','segmentName','type','parent_name','directory','63DKaxeu','startsWith','context','dirname','no_config','trim','folderPath','error'];a105_0x1219=function(){return _0x29cbe7;};return a105_0x1219();}
@@ -1 +1 @@
1
- function a106_0x32d7(){const _0x112dcc=['tdx.json','cwd','parent_segment','root','dirname','235XcHiRb','629082WheMtg','join','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','replace','resolve','string','46148QEmtlW','Invalid\x20tdx.json:\x20expected\x20object','2228976hKTOfD','stringify','6449844dHDsdz','7XEnXXG','startsWith','parse','segments','29033847zuyHku','277034TTLFPV','5281401TWYmGn','Invalid\x20JSON\x20in\x20'];a106_0x32d7=function(){return _0x112dcc;};return a106_0x32d7();}function a106_0x4bc8(_0x45a1ec,_0x2cc605){_0x45a1ec=_0x45a1ec-0x1e9;const _0x32d794=a106_0x32d7();let _0x4bc83f=_0x32d794[_0x45a1ec];return _0x4bc83f;}const a106_0x55819c=a106_0x4bc8;(function(_0x579d0d,_0x4d3f99){const _0x3e8cca=a106_0x4bc8,_0xc57f5a=_0x579d0d();while(!![]){try{const _0x20d702=parseInt(_0x3e8cca(0x1fa))/0x1+parseInt(_0x3e8cca(0x1f1))/0x2+-parseInt(_0x3e8cca(0x1f2))/0x3+-parseInt(_0x3e8cca(0x200))/0x4*(parseInt(_0x3e8cca(0x1f9))/0x5)+-parseInt(_0x3e8cca(0x1eb))/0x6*(parseInt(_0x3e8cca(0x1ec))/0x7)+parseInt(_0x3e8cca(0x1e9))/0x8+parseInt(_0x3e8cca(0x1f0))/0x9;if(_0x20d702===_0x4d3f99)break;else _0xc57f5a['push'](_0xc57f5a['shift']());}catch(_0x48081b){_0xc57f5a['push'](_0xc57f5a['shift']());}}}(a106_0x32d7,0xda63c));import{existsSync,readFileSync}from'fs';import a106_0x3342a6 from'path';const TDX_CONFIG_FILE=a106_0x55819c(0x1f4),SEGMENTS_DIR=a106_0x55819c(0x1ef);export function findTdxConfigPath(_0x3ef899=process[a106_0x55819c(0x1f5)]()){const _0x183dfb=a106_0x55819c;let _0x4e4ace=a106_0x3342a6[_0x183dfb(0x1fe)](_0x3ef899);const _0x1a0267=a106_0x3342a6['parse'](_0x4e4ace)[_0x183dfb(0x1f7)];while(_0x4e4ace!==_0x1a0267){const _0x1b6455=a106_0x3342a6[_0x183dfb(0x1fb)](_0x4e4ace,TDX_CONFIG_FILE);if(existsSync(_0x1b6455))return _0x1b6455;_0x4e4ace=a106_0x3342a6[_0x183dfb(0x1f8)](_0x4e4ace);}return null;}export function loadTdxConfig(_0x3784a8){const _0x4f2d02=a106_0x55819c,_0x3b2450=readFileSync(_0x3784a8,'utf-8');let _0x5466d4;try{_0x5466d4=JSON[_0x4f2d02(0x1ee)](_0x3b2450);}catch{throw new Error(_0x4f2d02(0x1f3)+_0x3784a8);}if(!_0x5466d4||typeof _0x5466d4!=='object')throw new Error(_0x4f2d02(0x201));const _0x1cd0e6=_0x5466d4;if(!_0x1cd0e6[_0x4f2d02(0x1f6)]||typeof _0x1cd0e6['parent_segment']!==_0x4f2d02(0x1ff))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field');return{'parent_segment':_0x1cd0e6[_0x4f2d02(0x1f6)]};}export function findTdxConfig(_0xde12a3=process[a106_0x55819c(0x1f5)]()){const _0x3ef1ca=a106_0x55819c,_0x3d60f7=findTdxConfigPath(_0xde12a3);if(!_0x3d60f7)throw new Error(_0x3ef1ca(0x1fc));const _0x5970ab=loadTdxConfig(_0x3d60f7),_0x4ab7ab=a106_0x3342a6[_0x3ef1ca(0x1f8)](_0x3d60f7);return{'config':_0x5970ab,'configPath':_0x3d60f7,'configDir':_0x4ab7ab};}export function tryFindTdxConfig(_0xe34735){try{return findTdxConfig(_0xe34735);}catch{return null;}}export function getSegmentRootDir(_0x20d7c8,_0x273e95=process[a106_0x55819c(0x1f5)]()){return a106_0x3342a6['join'](_0x273e95,SEGMENTS_DIR,_0x20d7c8);}export function getTdxConfigPath(_0x3d3385,_0x8c1602=process['cwd']()){const _0x5762e5=a106_0x55819c;return a106_0x3342a6[_0x5762e5(0x1fb)](getSegmentRootDir(_0x3d3385,_0x8c1602),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0xb55a41,_0x3c8169){const _0x190cb4=a106_0x55819c,_0x4ab5b8=a106_0x3342a6['resolve'](_0xb55a41),_0x5dfeb1=a106_0x3342a6['relative'](_0x3c8169,_0x4ab5b8);if(_0x5dfeb1[_0x190cb4(0x1ed)]('..'))return'';return _0x5dfeb1;}export function localPathToTdFolderPath(_0x330e91){const _0xe14071=a106_0x55819c,_0x51f518=a106_0x3342a6[_0xe14071(0x1f8)](_0x330e91);if(_0x51f518==='.'||_0x51f518==='')return'';return _0x51f518[_0xe14071(0x1fd)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x16a196,_0x309ab9){const _0x21f09d=a106_0x55819c;if(!_0x16a196)return _0x309ab9;return a106_0x3342a6[_0x21f09d(0x1fb)](_0x309ab9,_0x16a196);}export function createTdxConfigContent(_0xfa624e){const _0x253c58=a106_0x55819c,_0x4cd882={'parent_segment':_0xfa624e};return JSON[_0x253c58(0x1ea)](_0x4cd882,null,0x2)+'\x0a';}
1
+ function a106_0x282b(_0x97c6c4,_0x40a8a5){_0x97c6c4=_0x97c6c4-0x7f;const _0x3ab07b=a106_0x3ab0();let _0x282bd3=_0x3ab07b[_0x97c6c4];return _0x282bd3;}const a106_0x118396=a106_0x282b;function a106_0x3ab0(){const _0x38a809=['Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','resolve','join','tdx.json','1323gCyLxw','Invalid\x20JSON\x20in\x20','2727880oTsTef','stringify','Invalid\x20tdx.json:\x20expected\x20object','cwd','63AXBxdJ','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','330408ctkLOq','827800xQVXZh','1730hUGUKl','utf-8','630PsrpiK','dirname','startsWith','parent_segment','43029zzgzac','segments','1093530wPgHyL','2988170GyRYWC','parse','relative'];a106_0x3ab0=function(){return _0x38a809;};return a106_0x3ab0();}(function(_0x410efa,_0x4ad472){const _0x564436=a106_0x282b,_0xf323b5=_0x410efa();while(!![]){try{const _0x3b4fc1=parseInt(_0x564436(0x8e))/0x1+-parseInt(_0x564436(0x90))/0x2*(parseInt(_0x564436(0x86))/0x3)+parseInt(_0x564436(0x88))/0x4+-parseInt(_0x564436(0x7f))/0x5+-parseInt(_0x564436(0x98))/0x6+parseInt(_0x564436(0x8c))/0x7*(parseInt(_0x564436(0x8f))/0x8)+parseInt(_0x564436(0x96))/0x9*(-parseInt(_0x564436(0x92))/0xa);if(_0x3b4fc1===_0x4ad472)break;else _0xf323b5['push'](_0xf323b5['shift']());}catch(_0x116a1b){_0xf323b5['push'](_0xf323b5['shift']());}}}(a106_0x3ab0,0x75748));import{existsSync,readFileSync}from'fs';import a106_0x3dba07 from'path';const TDX_CONFIG_FILE=a106_0x118396(0x85),SEGMENTS_DIR=a106_0x118396(0x97);export function findTdxConfigPath(_0x511a11=process[a106_0x118396(0x8b)]()){const _0x25d100=a106_0x118396;let _0x4983ac=a106_0x3dba07[_0x25d100(0x83)](_0x511a11);const _0x52d327=a106_0x3dba07['parse'](_0x4983ac)['root'];while(_0x4983ac!==_0x52d327){const _0x1169b6=a106_0x3dba07[_0x25d100(0x84)](_0x4983ac,TDX_CONFIG_FILE);if(existsSync(_0x1169b6))return _0x1169b6;_0x4983ac=a106_0x3dba07['dirname'](_0x4983ac);}return null;}export function loadTdxConfig(_0x6398f9){const _0x2867de=a106_0x118396,_0x4c00b3=readFileSync(_0x6398f9,_0x2867de(0x91));let _0x31b959;try{_0x31b959=JSON[_0x2867de(0x80)](_0x4c00b3);}catch{throw new Error(_0x2867de(0x87)+_0x6398f9);}if(!_0x31b959||typeof _0x31b959!=='object')throw new Error(_0x2867de(0x8a));const _0x2dfecb=_0x31b959;if(!_0x2dfecb[_0x2867de(0x95)]||typeof _0x2dfecb[_0x2867de(0x95)]!=='string')throw new Error(_0x2867de(0x82));return{'parent_segment':_0x2dfecb['parent_segment']};}export function findTdxConfig(_0xef54d5=process[a106_0x118396(0x8b)]()){const _0x4d1d4c=a106_0x118396,_0x1ff61e=findTdxConfigPath(_0xef54d5);if(!_0x1ff61e)throw new Error(_0x4d1d4c(0x8d));const _0x211c9a=loadTdxConfig(_0x1ff61e),_0x45ef3e=a106_0x3dba07[_0x4d1d4c(0x93)](_0x1ff61e);return{'config':_0x211c9a,'configPath':_0x1ff61e,'configDir':_0x45ef3e};}export function tryFindTdxConfig(_0x575e20){try{return findTdxConfig(_0x575e20);}catch{return null;}}export function getSegmentRootDir(_0x221a80,_0x3609a6=process[a106_0x118396(0x8b)]()){const _0x24c360=a106_0x118396;return a106_0x3dba07[_0x24c360(0x84)](_0x3609a6,SEGMENTS_DIR,_0x221a80);}export function getTdxConfigPath(_0x3836f3,_0x4cda3a=process[a106_0x118396(0x8b)]()){const _0x5f908d=a106_0x118396;return a106_0x3dba07[_0x5f908d(0x84)](getSegmentRootDir(_0x3836f3,_0x4cda3a),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x181547,_0x36f5ad){const _0x25fc81=a106_0x118396,_0x249633=a106_0x3dba07[_0x25fc81(0x83)](_0x181547),_0x34682d=a106_0x3dba07[_0x25fc81(0x81)](_0x36f5ad,_0x249633);if(_0x34682d[_0x25fc81(0x94)]('..'))return'';return _0x34682d;}export function localPathToTdFolderPath(_0x1a94a0){const _0x40baab=a106_0x118396,_0x32316e=a106_0x3dba07[_0x40baab(0x93)](_0x1a94a0);if(_0x32316e==='.'||_0x32316e==='')return'';return _0x32316e['replace'](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x5b3373,_0x21faed){const _0x105b45=a106_0x118396;if(!_0x5b3373)return _0x21faed;return a106_0x3dba07[_0x105b45(0x84)](_0x21faed,_0x5b3373);}export function createTdxConfigContent(_0x453519){const _0x53c841=a106_0x118396,_0x267149={'parent_segment':_0x453519};return JSON[_0x53c841(0x89)](_0x267149,null,0x2)+'\x0a';}