@treasuredata/tdx 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/context-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/llm-proxy.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.d.ts +73 -3
  43. package/dist/commands/workflow-command.d.ts.map +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/commands/workflow-command.js.map +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/command-output.d.ts +1 -1
  48. package/dist/core/command-output.d.ts.map +1 -1
  49. package/dist/core/command-output.js +1 -1
  50. package/dist/core/config.js +1 -1
  51. package/dist/core/connection-cache.js +1 -1
  52. package/dist/core/constants.js +1 -1
  53. package/dist/core/credential-cache.js +1 -1
  54. package/dist/core/global-context.d.ts +1 -0
  55. package/dist/core/global-context.d.ts.map +1 -1
  56. package/dist/core/global-context.js +1 -1
  57. package/dist/core/global-context.js.map +1 -1
  58. package/dist/core/keychain.js +1 -1
  59. package/dist/core/profile.js +1 -1
  60. package/dist/core/project-config.js +1 -1
  61. package/dist/core/session.d.ts +1 -0
  62. package/dist/core/session.d.ts.map +1 -1
  63. package/dist/core/session.js +1 -1
  64. package/dist/core/session.js.map +1 -1
  65. package/dist/core/user-cache.js +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/proxy/anthropic-adapter.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/context-signature.js +1 -1
  70. package/dist/proxy/conversation-utils.js +1 -1
  71. package/dist/proxy/server.js +1 -1
  72. package/dist/proxy/session-cache.js +1 -1
  73. package/dist/sdk/agent/agent-config.js +1 -1
  74. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  75. package/dist/sdk/agent/agent-yaml.js +1 -1
  76. package/dist/sdk/api.js +1 -1
  77. package/dist/sdk/client/cdp-api-client.js +1 -1
  78. package/dist/sdk/client/endpoints.js +1 -1
  79. package/dist/sdk/client/engage-api-client.js +1 -1
  80. package/dist/sdk/client/http-client.js +1 -1
  81. package/dist/sdk/client/llm-api-client.js +1 -1
  82. package/dist/sdk/client/rate-limiter.js +1 -1
  83. package/dist/sdk/client/td-api-client.js +1 -1
  84. package/dist/sdk/client/trino-api-client.js +1 -1
  85. package/dist/sdk/client/workflow-client.d.ts +32 -4
  86. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  87. package/dist/sdk/client/workflow-client.js +1 -1
  88. package/dist/sdk/client/workflow-client.js.map +1 -1
  89. package/dist/sdk/connection-validator.d.ts +10 -6
  90. package/dist/sdk/connection-validator.d.ts.map +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection-validator.js.map +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/engage.js +1 -1
  95. package/dist/sdk/errors.d.ts +2 -0
  96. package/dist/sdk/errors.d.ts.map +1 -1
  97. package/dist/sdk/errors.js +1 -1
  98. package/dist/sdk/errors.js.map +1 -1
  99. package/dist/sdk/index.js +1 -1
  100. package/dist/sdk/io/index.js +1 -1
  101. package/dist/sdk/io/node-filesystem.js +1 -1
  102. package/dist/sdk/job.js +1 -1
  103. package/dist/sdk/journey.js +1 -1
  104. package/dist/sdk/llm/chat-cache.js +1 -1
  105. package/dist/sdk/llm/index.js +1 -1
  106. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  107. package/dist/sdk/llm/model-aliases.js +1 -1
  108. package/dist/sdk/llm/model-factors.js +1 -1
  109. package/dist/sdk/query/index.js +1 -1
  110. package/dist/sdk/query/sql-parser.js +1 -1
  111. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  112. package/dist/sdk/segment/fields-display.js +1 -1
  113. package/dist/sdk/segment/file-discovery.js +1 -1
  114. package/dist/sdk/segment/journey-utils.js +1 -1
  115. package/dist/sdk/segment/journey-yaml.js +1 -1
  116. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  117. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  118. package/dist/sdk/segment/pull-workflow.js +1 -1
  119. package/dist/sdk/segment/push-workflow.js +1 -1
  120. package/dist/sdk/segment/resolution-context.js +1 -1
  121. package/dist/sdk/segment/segment-path-parser.js +1 -1
  122. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  123. package/dist/sdk/segment/target-resolution.js +1 -1
  124. package/dist/sdk/segment/tdx-config.js +1 -1
  125. package/dist/sdk/segment/validate-files.js +1 -1
  126. package/dist/sdk/segment/yaml-validator.js +1 -1
  127. package/dist/sdk/segment.js +1 -1
  128. package/dist/sdk/types/index.d.ts +1 -0
  129. package/dist/sdk/types/index.d.ts.map +1 -1
  130. package/dist/sdk/types/index.js +1 -1
  131. package/dist/sdk/types/index.js.map +1 -1
  132. package/dist/sdk/types/progress.js +1 -1
  133. package/dist/sdk/user.js +1 -1
  134. package/dist/sdk/util/format-detector.js +1 -1
  135. package/dist/sdk/util/formatters.js +1 -1
  136. package/dist/sdk/util/index.js +1 -1
  137. package/dist/sdk/util/tree-formatter.js +1 -1
  138. package/dist/sdk/workflow/index.d.ts +74 -4
  139. package/dist/sdk/workflow/index.d.ts.map +1 -1
  140. package/dist/sdk/workflow/index.js +1 -1
  141. package/dist/sdk/workflow/index.js.map +1 -1
  142. package/dist/sdk/workflow/workflow-utils.js +1 -1
  143. package/dist/utils/async.js +1 -1
  144. package/dist/utils/colors.js +1 -1
  145. package/dist/utils/diff.js +1 -1
  146. package/dist/utils/file-permissions.js +1 -1
  147. package/dist/utils/json-loader.js +1 -1
  148. package/dist/utils/option-validation.js +1 -1
  149. package/dist/utils/port.js +1 -1
  150. package/dist/utils/process.js +1 -1
  151. package/dist/utils/prompt.js +1 -1
  152. package/dist/utils/spinner.js +1 -1
  153. package/dist/utils/sse-parser.js +1 -1
  154. package/dist/utils/string-utils.js +1 -1
  155. package/dist/utils/table-ref-parser.js +1 -1
  156. package/dist/utils/tdx-logger.js +1 -1
  157. package/dist/utils/version-check.js +1 -1
  158. package/package.json +1 -1
@@ -1 +1 @@
1
- const a97_0x1ead5a=a97_0x5c6b;(function(_0x43da72,_0x506b8d){const _0x220327=a97_0x5c6b,_0x535949=_0x43da72();while(!![]){try{const _0x554606=parseInt(_0x220327(0x2a0))/0x1+parseInt(_0x220327(0x256))/0x2*(parseInt(_0x220327(0x1df))/0x3)+-parseInt(_0x220327(0x225))/0x4*(parseInt(_0x220327(0x212))/0x5)+parseInt(_0x220327(0x276))/0x6*(-parseInt(_0x220327(0x260))/0x7)+-parseInt(_0x220327(0x22d))/0x8+parseInt(_0x220327(0x1dd))/0x9*(parseInt(_0x220327(0x1f8))/0xa)+parseInt(_0x220327(0x216))/0xb;if(_0x554606===_0x506b8d)break;else _0x535949['push'](_0x535949['shift']());}catch(_0x8c7afd){_0x535949['push'](_0x535949['shift']());}}}(a97_0x526f,0xa9d80));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a97_0x1ead5a(0x207);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x26e76d){return''+PENDING_SEGMENT_PREFIX+_0x26e76d+'__';}export function isPendingSegmentId(_0x2eb297){const _0x43b9a4=a97_0x1ead5a;return _0x2eb297[_0x43b9a4(0x21d)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x497aba){const _0x4cf676=a97_0x1ead5a;return _0x497aba[_0x4cf676(0x261)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1b7cec){return''+PENDING_ACTIVATION_PREFIX+_0x1b7cec+'__';}export function isPendingActivationId(_0x261f3e){const _0x32b5ea=a97_0x1ead5a;return _0x261f3e[_0x32b5ea(0x21d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xc1ea8f){return _0xc1ea8f['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x3d09aa,_0x29bd61){const _0x2c8aba=a97_0x1ead5a,_0x568bf1=_0x3d09aa+'::'+(_0x29bd61['trim']()||_0x2c8aba(0x1f3)),_0x29de96=createHash('sha1')[_0x2c8aba(0x265)](_0x568bf1)[_0x2c8aba(0x264)]('hex')[_0x2c8aba(0x204)](0x0,0xc);return _0x2c8aba(0x1f9)+_0x29de96;}export function ensureJourneyDefaults(_0x1e6344){const _0x66a1ba=a97_0x1ead5a;!_0x1e6344[_0x66a1ba(0x237)]&&(_0x1e6344[_0x66a1ba(0x237)]=''),!_0x1e6344[_0x66a1ba(0x2aa)]&&(_0x1e6344['state']=_0x66a1ba(0x209));}export function resolveTDFolderPath(_0x2cbe0d,_0x4c7d89,_0xa98c47){const _0x3b45b9=a97_0x1ead5a;if(!_0x4c7d89)return _0x2cbe0d;if(_0x2cbe0d===_0xa98c47||_0x2cbe0d[_0x3b45b9(0x21d)](_0xa98c47+'/'))return _0x2cbe0d;return _0x2cbe0d?_0xa98c47+'/'+_0x2cbe0d:_0xa98c47;}export function addFoldersToCreate(_0x4cb9a3,_0xba7354,_0x6ad531){const _0x246de1=a97_0x1ead5a;if(!_0x4cb9a3)return;if(_0xba7354['has'](_0x4cb9a3))return;const _0x492273=_0x4cb9a3[_0x246de1(0x2a7)]('/');let _0x13793e='';for(const _0x469ec5 of _0x492273){_0x13793e=_0x13793e?_0x13793e+'/'+_0x469ec5:_0x469ec5,!_0xba7354['has'](_0x13793e)&&_0x6ad531[_0x246de1(0x29f)](_0x13793e);}}import*as a97_0x168e6b from'yaml';import{readFileSync}from'fs';import a97_0xb8b1c2 from'path';import{isJourneyDef,parseYamlString as a97_0x2d9e1f,toYamlString as a97_0x550ac8,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';function a97_0x5c6b(_0x17552e,_0x487b82){_0x17552e=_0x17552e-0x1cf;const _0x526fbc=a97_0x526f();let _0x5c6b24=_0x526fbc[_0x17552e];return _0x5c6b24;}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(_0x1e2a8f){const _0x30a266=a97_0x1ead5a;if(Array[_0x30a266(0x289)](_0x1e2a8f))return'['+_0x1e2a8f['map'](_0x1ccd98=>stableStringify(_0x1ccd98))[_0x30a266(0x1e8)](',')+']';if(_0x1e2a8f&&typeof _0x1e2a8f===_0x30a266(0x25c)){const _0x566d1b=_0x1e2a8f,_0x1e976c=Object[_0x30a266(0x254)](_0x566d1b)['sort'](),_0xce5f56=_0x1e976c['map'](_0x44e7d5=>'\x22'+_0x44e7d5+'\x22:'+stableStringify(_0x566d1b[_0x44e7d5]));return'{'+_0xce5f56[_0x30a266(0x1e8)](',')+'}';}const _0x20ec4c=JSON['stringify'](_0x1e2a8f);return _0x20ec4c===undefined?_0x30a266(0x26c):_0x20ec4c;}function activationSignature(_0x2537a6){const _0x5b14f7=a97_0x1ead5a,_0x1b8395={'connection':_0x2537a6[_0x5b14f7(0x22e)],..._0x2537a6[_0x5b14f7(0x29d)]!==undefined&&{'all_columns':_0x2537a6[_0x5b14f7(0x29d)]},..._0x2537a6[_0x5b14f7(0x245)]!==undefined&&{'columns':_0x2537a6[_0x5b14f7(0x245)]},..._0x2537a6[_0x5b14f7(0x20c)]!==undefined&&{'behavior':_0x2537a6[_0x5b14f7(0x20c)]},..._0x2537a6[_0x5b14f7(0x297)]!==undefined&&{'schedule':_0x2537a6[_0x5b14f7(0x297)]},..._0x2537a6[_0x5b14f7(0x1ec)]!==undefined&&{'notification':_0x2537a6[_0x5b14f7(0x1ec)]},..._0x2537a6['connector_config']!==undefined&&{'connector_config':_0x2537a6[_0x5b14f7(0x2ab)]},..._0x2537a6['activation_template_id']!==undefined&&{'activation_template_id':_0x2537a6[_0x5b14f7(0x1ee)]}};return stableStringify(_0x1b8395);}export async function prepareSegmentFiles(_0x3ed7ba,_0x2fe715,_0x3d3dba,_0x484415,_0x40c295){const _0x57b13f=a97_0x1ead5a,{activationDefToCreateRequest:_0x2cf873}=await import('./child-segment-yaml.js'),_0x227773=[],_0x5f0da4=new Set();for(const {yamlConfig:_0x447038,folderPath:_0x5e38b1,sourcePath:_0x252d74}of _0x3ed7ba){const _0x325b85=resolveTDFolderPath(_0x5e38b1,_0x484415,_0x40c295),_0x2ef13f=_0x325b85+':'+_0x447038['name'],_0x236bf0=_0x2fe715[_0x57b13f(0x220)]['get'](_0x2ef13f),_0xeab509=_0x236bf0?_0x2fe715[_0x57b13f(0x20d)]['get'](_0x236bf0['id'])||[]:[];addFoldersToCreate(_0x325b85,_0x2fe715[_0x57b13f(0x290)],_0x5f0da4);const _0x5731e0=calculateActivationActions(_0x447038[_0x57b13f(0x201)]||[],_0xeab509,_0x2fe715[_0x57b13f(0x234)],_0x2fe715['connectionIdToNameMap']);for(const _0x4e6091 of _0x5731e0){(_0x4e6091[_0x57b13f(0x20a)]===_0x57b13f(0x282)||_0x4e6091[_0x57b13f(0x20a)]==='update')&&_0x4e6091['yamlActivation']&&(_0x4e6091[_0x57b13f(0x203)]=await _0x2cf873(_0x4e6091[_0x57b13f(0x205)],_0x3d3dba));}const _0x19af32=calculateSegmentDiff(_0x447038,_0x236bf0,_0xeab509,_0x2fe715['idToEmailMap'],_0x2fe715[_0x57b13f(0x1d0)]);_0x227773[_0x57b13f(0x279)]({'relativePath':_0x447038['name'],'absolutePath':_0x252d74,'yamlConfig':_0x447038,'folderPath':_0x325b85,'existingSegment':_0x236bf0,'existingActivations':_0xeab509,'isNew':_0x19af32['isNew'],'hasChanges':_0x19af32[_0x57b13f(0x214)],'diff':_0x19af32[_0x57b13f(0x299)],'activationActions':_0x5731e0});}return{'segmentFiles':_0x227773,'foldersToCreate':_0x5f0da4};}export async function prepareJourneyFiles(_0x46b79a,_0x234353,_0x3c4389,_0x3b705a){const _0x4ce6fd=a97_0x1ead5a,_0x51c133=[],_0x282454=new Set();for(const {yamlConfig:_0x4b3ea9,folderPath:_0x56b48a,sourcePath:_0xbe5913}of _0x46b79a){const _0x5af5b8=resolveTDFolderPath(_0x56b48a,_0x3c4389,_0x3b705a),_0x58ad6d=_0x5af5b8+':'+_0x4b3ea9['name'],_0x188bcf=_0x234353[_0x4ce6fd(0x257)][_0x4ce6fd(0x26f)](_0x58ad6d);let _0xa301e0,_0x585116;if(_0x188bcf&&_0x188bcf['length']>0x0){const _0x26064f=buildLocalExpandedRuleMappings(_0x4b3ea9),{createYamlContext:_0x57cdd3,prefetchJourneySegments:_0x4eb70d}=createPushYamlContextForBundle(_0x234353[_0x4ce6fd(0x298)],_0x234353['parentId'],_0x234353[_0x4ce6fd(0x240)],_0x26064f,_0x234353[_0x4ce6fd(0x234)],_0x234353[_0x4ce6fd(0x1d0)],_0x234353['activationStepsById'],_0x234353['journeyById']);await _0x4eb70d(_0x188bcf[_0x4ce6fd(0x217)](_0x73d1ce=>_0x73d1ce['id']));const _0x37bf89=hasMultipleVersions(_0x4b3ea9),_0x5d6bcf=async _0x11fdf0=>{const _0x71583d=_0x4ce6fd,_0x281d99=_0x234353[_0x71583d(0x222)]?.['get'](_0x11fdf0);if(_0x281d99)return _0x281d99;return _0x234353[_0x71583d(0x1fc)]({'journeyId':_0x11fdf0,'journeyName':_0x4b3ea9['name'],'isMultiVersion':_0x188bcf[_0x71583d(0x284)]>0x1});};if(_0x37bf89&&_0x188bcf[_0x4ce6fd(0x284)]>0x1){const _0x464766=[];for(const _0x4fee4e of _0x188bcf){const _0x3b8dbf=_0x4fee4e['versionNumber']||0x1;_0x234353[_0x4ce6fd(0x1d1)]?.[_0x4ce6fd(0x265)](_0x4ce6fd(0x249)+_0x4b3ea9[_0x4ce6fd(0x2ac)]+'\x20v'+_0x3b8dbf);const _0x4c6947=await _0x5d6bcf(_0x4fee4e['id']),_0x1f4be7=_0x57cdd3(_0x4fee4e['id']),_0x461dc0=await journeyResponseToDef(_0x4c6947,_0x1f4be7);_0x464766[_0x4ce6fd(0x279)]({'item':_0x4fee4e,'yaml':_0x461dc0});}const _0x5511de=buildLocalRuleToNameMappingFromJourney(_0x4b3ea9);_0x585116=buildMergedJourneyDef(_0x464766,_0x5511de);const _0xc595b6=Math[_0x4ce6fd(0x1dc)](..._0x464766[_0x4ce6fd(0x217)](_0xbcceb0=>_0xbcceb0[_0x4ce6fd(0x263)][_0x4ce6fd(0x26b)]||0x0)),_0x11fe0f=_0x188bcf['find'](_0x2df830=>(_0x2df830['versionNumber']||0x0)===_0xc595b6);_0x11fe0f&&(_0x234353['progress']?.['update']('Fetching\x20'+_0x4b3ea9[_0x4ce6fd(0x2ac)]+'\x20v'+_0xc595b6),_0xa301e0=await _0x5d6bcf(_0x11fe0f['id']));}else{const _0x655e27=_0x188bcf[_0x188bcf[_0x4ce6fd(0x284)]-0x1];_0x234353[_0x4ce6fd(0x1d1)]?.[_0x4ce6fd(0x265)]('Fetching\x20'+_0x4b3ea9[_0x4ce6fd(0x2ac)]),_0xa301e0=await _0x5d6bcf(_0x655e27['id']);const _0x478cc4=_0x57cdd3(_0x655e27['id']),_0x19347f=await journeyResponseToDef(_0xa301e0,_0x478cc4),_0x20cb3c=buildLocalRuleToNameMappingFromJourney(_0x4b3ea9);_0x585116=buildMergedJourneyDef([{'item':_0x655e27,'yaml':_0x19347f}],_0x20cb3c);}}addFoldersToCreate(_0x5af5b8,_0x234353['folderPathToId'],_0x282454);const _0x242a0c=calculateJourneyDiff(_0x4b3ea9,_0x585116);_0x51c133[_0x4ce6fd(0x279)]({'relativePath':_0x4b3ea9[_0x4ce6fd(0x2ac)],'absolutePath':_0xbe5913,'yamlConfig':_0x4b3ea9,'folderPath':_0x5af5b8,'existingJourney':_0xa301e0,'isNew':_0x242a0c['isNew'],'hasChanges':_0x242a0c['hasChanges'],'diff':_0x242a0c[_0x4ce6fd(0x299)]});}return{'journeyFiles':_0x51c133,'foldersToCreate':_0x282454};}export function calculateActivationActions(_0x22c0e9,_0x536061,_0x2bbd07,_0x343e2c){const _0x38a259=a97_0x1ead5a,_0x432f9d=[],_0x1153d3=new Map();for(const _0x4e5abe of _0x536061){_0x1153d3['set'](_0x4e5abe['name'],_0x4e5abe);}const _0x3627f5=new Map();for(const _0x5aee6e of _0x22c0e9){_0x3627f5[_0x38a259(0x1e3)](_0x5aee6e[_0x38a259(0x2ac)],_0x5aee6e);}for(const _0x462d3e of _0x22c0e9){const _0x495b11=_0x1153d3[_0x38a259(0x26f)](_0x462d3e[_0x38a259(0x2ac)]);if(!_0x495b11)_0x432f9d[_0x38a259(0x279)]({'type':_0x38a259(0x282),'name':_0x462d3e[_0x38a259(0x2ac)],'yamlActivation':_0x462d3e});else{const _0x1f0f6c=activationResponseToDef(_0x495b11,_0x2bbd07,_0x343e2c),_0x3a45cb=a97_0x168e6b[_0x38a259(0x24d)](_0x1f0f6c),_0x3128cc=a97_0x168e6b[_0x38a259(0x24d)](_0x462d3e);_0x3a45cb!==_0x3128cc&&_0x432f9d['push']({'type':_0x38a259(0x265),'name':_0x462d3e[_0x38a259(0x2ac)],'yamlActivation':_0x462d3e,'existingActivation':_0x495b11});}}for(const _0x21352f of _0x536061){!_0x3627f5['has'](_0x21352f[_0x38a259(0x2ac)])&&_0x432f9d['push']({'type':_0x38a259(0x29e),'name':_0x21352f[_0x38a259(0x2ac)],'existingActivation':_0x21352f});}return _0x432f9d;}export function calculateSegmentDiff(_0x222d7b,_0x3c10ec,_0x115bed,_0x49f43b,_0xa83070){const _0x807709=segmentToYamlString(_0x222d7b);if(_0x3c10ec){const _0x1f3941=segmentWithActivationsToYaml(_0x3c10ec,_0x115bed,undefined,_0x49f43b,_0xa83070),_0x2415d4=segmentToYamlString(_0x1f3941),_0x5756b6=generateDiff(_0x2415d4,_0x807709),_0x3e6d35=hasChanges(_0x5756b6);return{'isNew':![],'hasChanges':_0x3e6d35,'diff':_0x3e6d35?formatDiffWithColors(_0x5756b6):undefined};}const _0x39c910=generateDiff('',_0x807709);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x39c910)};}export function calculateJourneyDiff(_0x29d55e,_0x5a3272){const _0x30c69e=normalizeJourneyDef(_0x29d55e,_0x29d55e),_0xd13af3=a97_0x550ac8(_0x30c69e);if(_0x5a3272){const _0x379fc3=normalizeJourneyDef(_0x5a3272,_0x29d55e),_0x4f1f67=a97_0x550ac8(_0x379fc3),_0x6b8f17=generateDiff(_0x4f1f67,_0xd13af3),_0x1b663e=hasChanges(_0x6b8f17);return{'isNew':![],'hasChanges':_0x1b663e,'diff':_0x1b663e?formatDiffWithColors(_0x6b8f17):undefined};}const _0x35f358=generateDiff('',_0xd13af3);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x35f358)};}export function findSegmentsToDelete(_0x389ec1,_0x4aad93,_0x12878a,_0x5e0180,_0x3d9f40){const _0x5665e6=a97_0x1ead5a,_0x56d013=new Set();for(const {yamlConfig:_0x1a5c39,folderPath:_0x123c40}of _0x4aad93){_0x56d013['add'](_0x123c40+':'+_0x1a5c39[_0x5665e6(0x2ac)]);}return _0x389ec1[_0x5665e6(0x28d)](_0x1c3bf4=>{const _0x8f8fc3=_0x5665e6,_0x3cd39f=_0x1c3bf4[_0x8f8fc3(0x286)]?_0x12878a[_0x8f8fc3(0x26f)](_0x1c3bf4['segmentFolderId'][_0x8f8fc3(0x232)]())||'':'',_0x33c0b6=_0x3cd39f+':'+_0x1c3bf4[_0x8f8fc3(0x2ac)];if(_0x56d013[_0x8f8fc3(0x293)](_0x33c0b6))return![];if(_0x3d9f40)return _0x3cd39f===_0x5e0180||_0x3cd39f['startsWith'](_0x5e0180+'/');return!![];});}export function findJourneysToDelete(_0x5d8e17,_0x1a8f54,_0x264893,_0x39d83b,_0x1f9a67){const _0x5069c3=a97_0x1ead5a,_0x397deb=new Set();for(const {yamlConfig:_0x1c3ddf,folderPath:_0x4a8429}of _0x1a8f54){_0x397deb[_0x5069c3(0x29f)](_0x4a8429+':'+_0x1c3ddf[_0x5069c3(0x2ac)]);}return _0x5d8e17[_0x5069c3(0x28d)](_0x20779b=>{const _0x1925e8=_0x5069c3,_0x2ba5c9=_0x20779b[_0x1925e8(0x267)]?_0x264893[_0x1925e8(0x26f)](_0x20779b[_0x1925e8(0x267)])||'':'',_0x1eaf6f=_0x2ba5c9+':'+_0x20779b[_0x1925e8(0x218)];if(_0x397deb['has'](_0x1eaf6f))return![];if(_0x1f9a67)return _0x2ba5c9===_0x39d83b||_0x2ba5c9['startsWith'](_0x39d83b+'/');return!![];});}export function buildSegmentLookupMap(_0x53170f,_0x25bd7f){const _0x587217=a97_0x1ead5a,_0x23157a=new Map();for(const _0x40fc6b of _0x53170f){const _0x5d8c2b=_0x40fc6b['segmentFolderId']?_0x25bd7f[_0x587217(0x26f)](_0x40fc6b[_0x587217(0x286)][_0x587217(0x232)]())||'':'',_0x1f40c4=_0x5d8c2b+':'+_0x40fc6b[_0x587217(0x2ac)];_0x23157a[_0x587217(0x1e3)](_0x1f40c4,_0x40fc6b);}return _0x23157a;}export function buildSegmentNameToIdMap(_0x3a6fb6){const _0x45e10b=a97_0x1ead5a,_0x1051b6=new Map();for(const _0x266781 of _0x3a6fb6){_0x1051b6[_0x45e10b(0x1e3)](_0x266781[_0x45e10b(0x2ac)],_0x266781['id']);}return _0x1051b6;}export function buildJourneyBundleLookupMap(_0x5edd89,_0x2eff2b){const _0xbaf431=a97_0x1ead5a,_0x502713=new Map();for(const _0x339dbc of _0x5edd89){const _0x505d5f=_0x339dbc['folderId']?_0x2eff2b[_0xbaf431(0x26f)](_0x339dbc[_0xbaf431(0x267)])||'':'',_0x2983c6=_0x505d5f+':'+_0x339dbc[_0xbaf431(0x218)];!_0x502713[_0xbaf431(0x293)](_0x2983c6)&&_0x502713['set'](_0x2983c6,[]),_0x502713[_0xbaf431(0x26f)](_0x2983c6)[_0xbaf431(0x279)](_0x339dbc);}for(const _0x2ef557 of _0x502713[_0xbaf431(0x22f)]()){_0x2ef557['sort']((_0x280056,_0x564901)=>(_0x280056[_0xbaf431(0x26b)]||0x0)-(_0x564901[_0xbaf431(0x26b)]||0x0));}return _0x502713;}export function collectFoldersToCreate(_0x3342f3,_0x4a41c9){const _0x2abaa9=a97_0x1ead5a,_0x304f6c=new Set();for(const _0x11280e of _0x3342f3){if(!_0x11280e)continue;if(_0x4a41c9['has'](_0x11280e))continue;const _0x321ac1=_0x11280e[_0x2abaa9(0x2a7)]('/');let _0x870674='';for(const _0x3e075f of _0x321ac1){_0x870674=_0x870674?_0x870674+'/'+_0x3e075f:_0x3e075f,!_0x4a41c9[_0x2abaa9(0x293)](_0x870674)&&_0x304f6c['add'](_0x870674);}}return _0x304f6c;}export function parseAndClassifyYamlFiles(_0x3c043c,_0x33e099,_0x5cd943){const _0x13b74f=a97_0x1ead5a,_0x17d918=[],_0x45cd8c=[];for(const _0x105faa of _0x3c043c){const _0x2898d2=a97_0xb8b1c2[_0x13b74f(0x287)](_0x33e099,a97_0xb8b1c2[_0x13b74f(0x288)](_0x105faa)),_0x378464=_0x2898d2==='.'?'':_0x2898d2,_0x413f66=readFileSync(_0x105faa,_0x13b74f(0x272)),_0x1d95b1=a97_0x168e6b['parse'](_0x413f66);if(isJourneyDef(_0x1d95b1)){const _0xf5b86a=a97_0x2d9e1f(_0x413f66);_0x45cd8c['push']({'yamlConfig':_0xf5b86a,'folderPath':_0x378464,'sourcePath':_0x105faa});}else{if(!_0x5cd943?.[_0x13b74f(0x22c)]){const _0x292203=parseSegmentYamlFile(_0x413f66),_0x3a570d=normalizeChildSegmentYaml(_0x292203);_0x17d918[_0x13b74f(0x279)]({'yamlConfig':_0x3a570d,'folderPath':_0x378464,'sourcePath':_0x105faa});}}}return{'segments':_0x17d918,'journeys':_0x45cd8c};}export function validateParsedFiles(_0x51ab54,_0x54420e){const _0x467c7e=a97_0x1ead5a,_0x500af8=[];for(const {yamlConfig:_0x5e8dfd,sourcePath:_0x38154f}of _0x51ab54[_0x467c7e(0x224)]){const _0x579f64=readFileSync(_0x38154f,_0x467c7e(0x272)),_0x37225b=a97_0x168e6b['parseDocument'](_0x579f64),_0x5100e9=validateSegmentDef(_0x5e8dfd,{'source':_0x579f64,'document':_0x37225b});if(!_0x5100e9[_0x467c7e(0x27c)]){const _0x2af8bc=a97_0xb8b1c2['relative'](_0x54420e,_0x38154f);_0x500af8[_0x467c7e(0x279)]({'filePath':_0x2af8bc,'source':_0x579f64,'result':_0x5100e9,'isJourney':![]});}}for(const {yamlConfig:_0x2c5c2b,sourcePath:_0xd446a4}of _0x51ab54[_0x467c7e(0x24f)]){const _0x1a8865=readFileSync(_0xd446a4,'utf-8'),_0x54b64e=a97_0x168e6b[_0x467c7e(0x242)](_0x1a8865),_0x5eb20a=validateJourneyDef(_0x2c5c2b,{'source':_0x1a8865,'document':_0x54b64e});if(!_0x5eb20a[_0x467c7e(0x27c)]){const _0x5ed1c5=a97_0xb8b1c2['relative'](_0x54420e,_0xd446a4);_0x500af8[_0x467c7e(0x279)]({'filePath':_0x5ed1c5,'source':_0x1a8865,'result':_0x5eb20a,'isJourney':!![]});}}return _0x500af8;}export function formatValidationErrors(_0x1c5e45){const _0x59b4a7=a97_0x1ead5a,_0x13425e=[];for(const {filePath:_0x164014,source:_0x24bd43,result:_0x362b42,isJourney:_0x3c1520}of _0x1c5e45){const _0x4eb049=_0x3c1520?_0x59b4a7(0x271):'segment';_0x13425e['push']('\x0a'+_0x164014+'\x20('+_0x4eb049+'):\x20'+_0x362b42['errors'][_0x59b4a7(0x284)]+'\x20error(s)'),_0x13425e[_0x59b4a7(0x279)](formatValidationResult(_0x362b42,_0x24bd43,_0x164014));}return _0x13425e[_0x59b4a7(0x1e8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x29a7e7){const _0xfc4889=a97_0x1ead5a,_0x5eeca7=new Set(),_0x442566=new Map(),_0x3ed5cd=collectSegmentUsageCounts(_0x29a7e7);if(_0x29a7e7[_0xfc4889(0x224)])for(const [_0x2f2310,_0x12cc03]of Object[_0xfc4889(0x1fa)](_0x29a7e7['segments'])){_0x5eeca7[_0xfc4889(0x29f)](_0x2f2310);if(_0x12cc03[_0xfc4889(0x28e)]){const _0xa9bbd2=yamlRuleToApi(_0x12cc03['rule']),_0x3ff3bc=apiRuleToYaml(_0xa9bbd2);_0x442566[_0xfc4889(0x1e3)](_0x2f2310,_0x3ff3bc);}}const _0x5ca1e8=new Map();let _0x4ee756=0x0;for(const [_0x3d02f8,_0xa48443]of _0x442566){const _0x2c3446=serializeExpandedRule(_0xa48443,_0x442566),_0x59293d=_0x5ca1e8[_0xfc4889(0x26f)](_0x2c3446)||[];_0x59293d[_0xfc4889(0x279)]({'name':_0x3d02f8,'index':_0x4ee756}),_0x5ca1e8['set'](_0x2c3446,_0x59293d),_0x4ee756++;}const _0x44abc6=new Map();for(const [_0x33c226,_0x2040f9]of _0x5ca1e8){const _0x96648d=_0x2040f9[_0xfc4889(0x204)]()['sort']((_0x208179,_0xb35e30)=>{const _0x3174cc=_0xfc4889,_0x14a064=_0x3ed5cd[_0x3174cc(0x26f)](_0x208179[_0x3174cc(0x2ac)])||0x0,_0x236262=_0x3ed5cd[_0x3174cc(0x26f)](_0xb35e30['name'])||0x0;if(_0x14a064!==_0x236262)return _0x236262-_0x14a064;return _0x208179[_0x3174cc(0x1ef)]-_0xb35e30[_0x3174cc(0x1ef)];})[_0xfc4889(0x217)](_0x54d9af=>_0x54d9af['name']),_0x1edb9d=[];for(const _0x3ffb58 of _0x96648d){const _0x44807a=_0x3ed5cd[_0xfc4889(0x26f)](_0x3ffb58)||0x0,_0x1b8321=Math['max'](_0x44807a,0x1);for(let _0x4bf7b5=0x0;_0x4bf7b5<_0x1b8321;_0x4bf7b5++){_0x1edb9d[_0xfc4889(0x279)](_0x3ffb58);}}_0x44abc6['set'](_0x33c226,_0x1edb9d);}return{'existingLocalSegmentNames':_0x5eeca7,'localSegmentRules':_0x442566,'localExpandedRuleToNames':_0x44abc6};}async function buildServerSegmentRuleMap(_0x333e6,_0x5a81e0,_0x3cac69,_0x1d1db5){const _0x513a4f=new Map(),_0x48029a=new Set(),_0x2bd3f8=async _0x1eb3f1=>{const _0x495d1f=a97_0x5c6b;if(_0x48029a[_0x495d1f(0x293)](_0x1eb3f1))return;_0x48029a[_0x495d1f(0x29f)](_0x1eb3f1);let _0x59f14c=_0x3cac69[_0x495d1f(0x1d3)](_0x324590=>_0x324590['id']===_0x1eb3f1);if(!_0x59f14c)try{_0x59f14c=await _0x333e6[_0x495d1f(0x1f3)][_0x495d1f(0x273)](_0x5a81e0,_0x1eb3f1);}catch{return;}if(!_0x59f14c?.[_0x495d1f(0x28e)])return;const _0x17cc35=apiRuleToYaml(_0x59f14c['rule']);_0x513a4f['set'](_0x1eb3f1,_0x17cc35);const _0x34395d=collectSegmentRefsFromRule(_0x17cc35);for(const _0x16f1a2 of _0x34395d){await _0x2bd3f8(_0x16f1a2);}};for(const _0xba207d of _0x1d1db5){await _0x2bd3f8(_0xba207d);}return _0x513a4f;}export function createSegmentIdResolver(_0x3a76ca,_0x30ec6d){return async _0x2e38f8=>{const _0xd5623d=a97_0x5c6b,_0x4deff3=_0x3a76ca[_0xd5623d(0x26f)](_0x2e38f8);if(!_0x4deff3)throw new SDKError(ErrorCode[_0xd5623d(0x1e5)],_0xd5623d(0x202)+_0x2e38f8+_0xd5623d(0x20f)+_0x30ec6d+'\x27)');return _0x4deff3;};}export function extractRootFolderId(_0x4132b8){const _0x4aac4e=a97_0x1ead5a;return _0x4132b8[_0x4aac4e(0x1d6)]?.[_0x4aac4e(0x1f7)]?.['data']?.['id']||_0x4132b8[_0x4aac4e(0x1d6)]?.[_0x4aac4e(0x22b)]?.[_0x4aac4e(0x23f)]?.['id'];}export function buildConnectionMaps(_0x1fc4bc){const _0x1ab8d7=a97_0x1ead5a,_0x500e31=new Map(),_0xc58a97=new Map(),_0x135075=new Map();for(const _0x3bc2c6 of _0x1fc4bc){_0x500e31[_0x1ab8d7(0x1e3)](_0x3bc2c6[_0x1ab8d7(0x2ac)],parseInt(_0x3bc2c6['id'],0xa)),_0xc58a97[_0x1ab8d7(0x1e3)](_0x3bc2c6['id'],_0x3bc2c6['name']),_0x135075[_0x1ab8d7(0x1e3)](_0x3bc2c6[_0x1ab8d7(0x2ac)],_0x3bc2c6[_0x1ab8d7(0x20a)]);}return{'nameToId':_0x500e31,'idToName':_0xc58a97,'nameToType':_0x135075};}export function calculatePushStats(_0xe606ea,_0xf6f9b,_0x19da9c,_0x52c8eb,_0x42ca50,_0xc9252b,_0x248dae){const _0x3b0546=a97_0x1ead5a,_0xf497be=_0xe606ea[_0x3b0546(0x28d)](_0x36c1b0=>_0x36c1b0[_0x3b0546(0x2a1)]),_0x196e13=_0xe606ea[_0x3b0546(0x28d)](_0x44c8ba=>!_0x44c8ba[_0x3b0546(0x2a1)]&&_0x44c8ba[_0x3b0546(0x214)]),_0x53f059=_0xe606ea[_0x3b0546(0x28d)](_0x2e36f3=>!_0x2e36f3[_0x3b0546(0x2a1)]&&!_0x2e36f3[_0x3b0546(0x214)]),_0x5690f1=_0xc9252b?_0x52c8eb:[],_0x30bce4=_0xf6f9b[_0x3b0546(0x28d)](_0x1fe232=>_0x1fe232[_0x3b0546(0x2a1)]),_0x3ad1d3=_0xf6f9b[_0x3b0546(0x28d)](_0x19035b=>!_0x19035b[_0x3b0546(0x2a1)]&&_0x19035b[_0x3b0546(0x214)]),_0x43a63b=_0xf6f9b[_0x3b0546(0x28d)](_0x3f5a9f=>!_0x3f5a9f['isNew']&&!_0x3f5a9f[_0x3b0546(0x214)]),_0x5509bb=_0xc9252b?_0x42ca50:[],_0x48e799=_0xe606ea[_0x3b0546(0x23c)](_0x51e906=>_0x51e906[_0x3b0546(0x228)]),_0x44352e=_0x48e799[_0x3b0546(0x28d)](_0x119d9e=>_0x119d9e[_0x3b0546(0x20a)]===_0x3b0546(0x282)),_0x470ead=_0x48e799[_0x3b0546(0x28d)](_0x3ef345=>_0x3ef345['type']===_0x3b0546(0x265)),_0x2ce21f=_0x48e799[_0x3b0546(0x28d)](_0x5af7ff=>_0x5af7ff['type']===_0x3b0546(0x29e)),_0x2f7e18=Array[_0x3b0546(0x266)](_0x19da9c)['sort'](),_0x3a3e3f=_0x248dae?![]:_0xf497be[_0x3b0546(0x284)]>0x0||_0x196e13[_0x3b0546(0x284)]>0x0||_0x5690f1[_0x3b0546(0x284)]>0x0,_0x261ca3=_0x30bce4['length']>0x0||_0x3ad1d3[_0x3b0546(0x284)]>0x0||_0x5509bb[_0x3b0546(0x284)]>0x0,_0x35912c=_0x248dae?![]:_0x48e799['length']>0x0,_0x382c0d=_0x2f7e18[_0x3b0546(0x284)]>0x0;return{'segments':{'new':_0xf497be,'changed':_0x196e13,'unchanged':_0x53f059,'toDelete':_0x5690f1},'journeys':{'new':_0x30bce4,'changed':_0x3ad1d3,'unchanged':_0x43a63b,'toDelete':_0x5509bb},'activations':{'all':_0x48e799,'toCreate':_0x44352e,'toUpdate':_0x470ead,'toDelete':_0x2ce21f},'folders':{'toCreate':_0x2f7e18},'counts':{'segments':{'new':_0xf497be[_0x3b0546(0x284)],'changed':_0x196e13['length'],'unchanged':_0x53f059[_0x3b0546(0x284)],'toDelete':_0x5690f1[_0x3b0546(0x284)]},'journeys':{'new':_0x30bce4[_0x3b0546(0x284)],'changed':_0x3ad1d3['length'],'unchanged':_0x43a63b[_0x3b0546(0x284)],'toDelete':_0x5509bb['length']},'activations':{'create':_0x44352e[_0x3b0546(0x284)],'update':_0x470ead[_0x3b0546(0x284)],'delete':_0x2ce21f[_0x3b0546(0x284)]},'folders':_0x2f7e18['length']},'hasChanges':_0x3a3e3f||_0x261ca3||_0x35912c||_0x382c0d};}export async function buildPushExecutionContext(_0x37d2e2,_0x10d5f4,_0x101313,_0x13f566,_0x1a7023,_0x589013){const _0x41ef27=a97_0x1ead5a,_0x228df2=extractRootFolderId(_0x101313),{pathToId:_0x103b58,idToPath:_0x2ebc29}=buildFolderMaps(_0x1a7023),_0x2f06aa=buildSegmentNameToIdMap(_0x13f566),_0x264520=new Map(),{batchAsync:_0x53b081}=await import('../../utils/async.js'),[_0x4849aa,_0x44cae0]=await Promise[_0x41ef27(0x274)]([_0x37d2e2[_0x41ef27(0x253)]['buildUserMaps'](),_0x37d2e2[_0x41ef27(0x22e)]['list'](),((async()=>{const _0x53aa09=_0x41ef27;!_0x589013&&_0x13f566[_0x53aa09(0x284)]>0x0&&await _0x53b081(_0x13f566,async _0x2399f4=>{const _0x3b7ed5=_0x53aa09,_0x20b6d5=await _0x37d2e2[_0x3b7ed5(0x1f3)]['listActivations'](_0x10d5f4,_0x2399f4['id']);_0x264520[_0x3b7ed5(0x1e3)](_0x2399f4['id'],_0x20b6d5);});})())]),{emailToId:_0x18577f,idToEmail:_0x30dacd}=_0x4849aa,_0x47252c=buildConnectionMaps(_0x44cae0);return{'rootFolderId':_0x228df2,'folderPathToId':_0x103b58,'folderIdToPath':_0x2ebc29,'segmentNameToId':_0x2f06aa,'activationsBySegmentId':_0x264520,'emailToIdMap':_0x18577f,'idToEmailMap':_0x30dacd,'connectionNameToIdMap':_0x47252c[_0x41ef27(0x1e7)],'connectionIdToNameMap':_0x47252c[_0x41ef27(0x2a3)],'connectionNameToTypeMap':_0x47252c['nameToType']};}export function createPushYamlContextForBundle(_0x2427e1,_0x2517c6,_0x40112e,_0x27f271,_0xa18c6c,_0x2d9179,_0x44ec34,_0x52de74){const {existingLocalSegmentNames:_0xd2ee1a,localExpandedRuleToNames:_0x532189}=_0x27f271,_0x450e73=new Set(),_0x1adbbd=new Map(),_0x206233=new Set(),_0x3d7909=new Map(),_0x31cf33=new Map(),_0x30a92c=createJumpTargetCache(),_0x112f49=new Map(),_0x5b3ef4=new Map(),_0x1b0b56=new Set();let _0x5573bb;const _0x4f9af1=_0x20fb75=>{const _0x21fdc1={'resolveSegment':async _0x38bb10=>{const _0xf9f97=a97_0x5c6b,_0x16a867=_0x31cf33[_0xf9f97(0x26f)](_0x38bb10);if(_0x16a867!==undefined)return{'name':_0x16a867,'isJourneyLocal':!![]};try{let _0x156648=_0x40112e[_0xf9f97(0x1d3)](_0x2ed4db=>_0x2ed4db['id']===_0x38bb10);!_0x156648&&(_0x156648=await _0x2427e1[_0xf9f97(0x1f3)][_0xf9f97(0x273)](_0x2517c6,_0x38bb10));const _0x211c33=generateJourneyLocalName(_0x156648[_0xf9f97(0x2ac)]),_0xbf2419=_0x156648[_0xf9f97(0x23b)]===SEGMENT_KIND_JOURNEY&&_0x211c33!==undefined;let _0x291ff1=_0x156648[_0xf9f97(0x2ac)],_0x11dc3b;if(_0xbf2419&&_0x156648[_0xf9f97(0x28e)]){const _0x4b07ee=apiRuleToYaml(_0x156648[_0xf9f97(0x28e)]);_0x5b3ef4[_0xf9f97(0x1e3)](_0x38bb10,_0x4b07ee);const _0xcc60c6=async _0x1a3ab0=>{const _0x5c9a7e=_0xf9f97,_0x5185c2=collectSegmentRefsFromRule(_0x1a3ab0);for(const _0x29d396 of _0x5185c2){if(!_0x5b3ef4[_0x5c9a7e(0x293)](_0x29d396))try{const _0x127efc=await _0x2427e1[_0x5c9a7e(0x1f3)][_0x5c9a7e(0x273)](_0x2517c6,_0x29d396);if(_0x127efc?.[_0x5c9a7e(0x28e)]){const _0x1a1640=apiRuleToYaml(_0x127efc[_0x5c9a7e(0x28e)]);_0x5b3ef4[_0x5c9a7e(0x1e3)](_0x29d396,_0x1a1640),await _0xcc60c6(_0x1a1640);}}catch{}}};await _0xcc60c6(_0x4b07ee);const _0x5387ed=serializeExpandedRule(_0x4b07ee,_0x5b3ef4),_0x57c169=_0x532189[_0xf9f97(0x26f)](_0x5387ed);if(_0x57c169&&_0x57c169['length']>0x0){const _0x3dc37f=_0x1adbbd[_0xf9f97(0x26f)](_0x5387ed)||0x0,_0x436dcc=_0x57c169[_0x3dc37f]||_0x57c169[_0x57c169[_0xf9f97(0x284)]-0x1];_0x1adbbd[_0xf9f97(0x1e3)](_0x5387ed,_0x3dc37f+0x1),_0x291ff1=_0x436dcc,_0x450e73[_0xf9f97(0x29f)](_0x291ff1),_0x31cf33[_0xf9f97(0x1e3)](_0x38bb10,_0x291ff1);const _0x164088=await resolveRuleSegmentRefs(_0x4b07ee,async _0x38c22e=>{const _0x2f7448=_0xf9f97,_0x5cd3f1=_0x31cf33[_0x2f7448(0x26f)](_0x38c22e);if(_0x5cd3f1)return _0x5cd3f1;const _0x34f61d=await _0x5573bb['resolveSegment'](_0x38c22e);return _0x34f61d[_0x2f7448(0x2ac)];});_0x11dc3b={'description':_0x156648['description'],'rule':_0x164088};}else{const _0x2b418f=_0x112f49['get'](_0x5387ed);if(_0x2b418f)_0x291ff1=_0x2b418f,_0x31cf33[_0xf9f97(0x1e3)](_0x38bb10,_0x291ff1);else{if(_0x211c33){let _0x3cfab6=_0x211c33,_0x48b4ad=0x2;while(_0x450e73[_0xf9f97(0x293)](_0x3cfab6)||_0xd2ee1a[_0xf9f97(0x293)](_0x3cfab6)){_0x3cfab6=_0x211c33+'_'+_0x48b4ad,_0x48b4ad++;}_0x450e73[_0xf9f97(0x29f)](_0x3cfab6),_0x291ff1=_0x3cfab6;}_0x31cf33[_0xf9f97(0x1e3)](_0x38bb10,_0x291ff1),_0x112f49['set'](_0x5387ed,_0x291ff1);const _0x539cc7=await resolveRuleSegmentRefs(_0x4b07ee,async _0x3796fe=>{const _0x3b9121=_0xf9f97,_0x3af292=_0x31cf33[_0x3b9121(0x26f)](_0x3796fe);if(_0x3af292)return _0x3af292;const _0x6b7d82=await _0x5573bb[_0x3b9121(0x2a2)](_0x3796fe);return _0x6b7d82[_0x3b9121(0x2ac)];});_0x11dc3b={'description':_0x156648[_0xf9f97(0x237)],'rule':_0x539cc7};}}}return{'name':_0x291ff1,'isJourneyLocal':_0xbf2419,'definition':_0x11dc3b};}catch{return{'name':_0x38bb10,'isJourneyLocal':![]};}},'resolveActivation':async _0x14ee7a=>{const _0x3984a5=a97_0x5c6b,_0x9d14a6=_0x3d7909[_0x3984a5(0x26f)](_0x14ee7a);if(_0x9d14a6!==undefined)return{'name':_0x9d14a6,'isJourneyLocal':!![]};try{let _0x300cb4=_0x44ec34?.['get'](_0x14ee7a);!_0x300cb4&&(_0x300cb4=await _0x2427e1[_0x3984a5(0x271)][_0x3984a5(0x28a)](_0x20fb75,_0x14ee7a));const _0x2e7be1=_0x300cb4[_0x3984a5(0x283)]['activationParams'][_0x3984a5(0x2ac)]||_0x14ee7a,_0x25b477=sanitizeYamlKey(_0x2e7be1)||_0x3984a5(0x244)+_0x14ee7a;let _0x9857f9=_0x25b477,_0x199160=0x2;while(_0x206233[_0x3984a5(0x293)](_0x9857f9)){_0x9857f9=_0x25b477+'_'+_0x199160,_0x199160++;}_0x206233[_0x3984a5(0x29f)](_0x9857f9),_0x3d7909['set'](_0x14ee7a,_0x9857f9);const _0x1d90a9=journeyActivationStepToYaml(_0x300cb4,_0xa18c6c,_0x2d9179);return{'name':_0x9857f9,'isJourneyLocal':!![],'definition':_0x1d90a9};}catch{return{'name':_0x14ee7a,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x121b21,_0x182229)=>resolveJumpTarget(_0x121b21,_0x182229,_0x30a92c,async _0x555ea2=>{const _0x3bbbcb=a97_0x5c6b,_0x49459d=_0x52de74?.[_0x3bbbcb(0x26f)](_0x555ea2);if(_0x49459d)return _0x49459d;return _0x2427e1['journey'][_0x3bbbcb(0x27e)](_0x555ea2);})};return _0x5573bb=_0x21fdc1,_0x21fdc1;},_0x509e92=async _0x5baa2b=>{const _0x5e95b1=a97_0x5c6b,{collectSegmentIdsFromJourneyApi:_0x14d6ec}=await import('./journey-yaml.js'),{batchAsync:_0x5c99d2}=await import(_0x5e95b1(0x255)),_0x45806d=new Set();for(const _0x952c2a of _0x5baa2b){let _0xb9a7b=_0x52de74?.['get'](_0x952c2a);!_0xb9a7b&&(_0xb9a7b=await _0x2427e1[_0x5e95b1(0x271)][_0x5e95b1(0x27e)](_0x952c2a));const _0x2625f7=_0x14d6ec(_0xb9a7b);for(const _0x4c60de of _0x2625f7){_0x45806d['add'](_0x4c60de);}}let _0xf628ea=Array[_0x5e95b1(0x266)](_0x45806d);while(_0xf628ea['length']>0x0){const _0x4b60fc=_0xf628ea['filter'](_0x47e75a=>!_0x1b0b56['has'](_0x47e75a));if(_0x4b60fc[_0x5e95b1(0x284)]===0x0)break;const _0x10be14=await _0x5c99d2(_0x4b60fc,async _0x41e528=>{const _0x28b522=_0x5e95b1;_0x1b0b56[_0x28b522(0x29f)](_0x41e528);let _0x4e01ea=_0x40112e[_0x28b522(0x1d3)](_0x53cf67=>_0x53cf67['id']===_0x41e528);if(!_0x4e01ea)try{_0x4e01ea=await _0x2427e1['segment'][_0x28b522(0x273)](_0x2517c6,_0x41e528);}catch{return null;}return{'segmentId':_0x41e528,'segment':_0x4e01ea};},0xa),_0xe1a029=new Set();for(const _0x5fa39a of _0x10be14){if(!_0x5fa39a?.[_0x5e95b1(0x1f3)]?.[_0x5e95b1(0x28e)])continue;const _0x314953=apiRuleToYaml(_0x5fa39a['segment'][_0x5e95b1(0x28e)]);_0x5b3ef4[_0x5e95b1(0x1e3)](_0x5fa39a[_0x5e95b1(0x229)],_0x314953);const _0x27775f=collectSegmentRefsFromRule(_0x314953);for(const _0x1d65a7 of _0x27775f){!_0x1b0b56[_0x5e95b1(0x293)](_0x1d65a7)&&_0xe1a029[_0x5e95b1(0x29f)](_0x1d65a7);}}_0xf628ea=Array[_0x5e95b1(0x266)](_0xe1a029);}};return{'createYamlContext':_0x4f9af1,'prefetchJourneySegments':_0x509e92};}export async function executePushSegments(_0x2d2aa6,_0xa7dd6f,_0x23822d,_0x30b02a,_0x25c82d){const _0x546394=a97_0x1ead5a,{segmentDefToCreateRequest:_0x457b6b,segmentDefToUpdateRequest:_0x3b8c1b}=await import(_0x546394(0x1f4)),_0x1a0736=_0x23822d[_0x546394(0x290)],_0x2ac118=0x5,_0x3e5738=async _0x46f63b=>{const _0x563e8e=_0x546394,_0x2d40be=_0x46f63b['folderPath']?_0x1a0736['get'](_0x46f63b[_0x563e8e(0x247)]):undefined;let _0x4a6949;const _0x54de8e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x46f63b['isNew']){_0x25c82d[_0x563e8e(0x1d5)]?.({'type':_0x563e8e(0x23d),'name':_0x46f63b['yamlConfig'][_0x563e8e(0x2ac)]});const _0x23f83c=_0x457b6b(_0x46f63b[_0x563e8e(0x270)],_0x2d40be),_0x4a95b3=await _0x25c82d[_0x563e8e(0x21f)](_0x563e8e(0x1f0)+_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]+_0x563e8e(0x24e),()=>_0x2d2aa6[_0x563e8e(0x1f3)][_0x563e8e(0x27b)](_0x30b02a['parentId'],_0x23f83c));_0x4a6949=_0x4a95b3[_0x563e8e(0x23f)]['id'],_0x54de8e[_0x563e8e(0x1e1)]={'name':_0x46f63b[_0x563e8e(0x270)]['name'],'id':_0x4a6949},_0x25c82d[_0x563e8e(0x1d5)]?.({'type':'segment_created','name':_0x46f63b[_0x563e8e(0x270)]['name'],'segmentId':_0x4a6949}),_0x25c82d[_0x563e8e(0x236)]?.('Created\x20segment\x20\x27'+_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]+'\x27'),_0x54de8e[_0x563e8e(0x219)]=0x1;}else{if(_0x46f63b[_0x563e8e(0x214)]){_0x25c82d[_0x563e8e(0x1d5)]?.({'type':'segment_updating','name':_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]});const _0x4c97d4=_0x3b8c1b(_0x46f63b[_0x563e8e(0x270)]);_0x2d40be!==_0x46f63b[_0x563e8e(0x1f5)]?.[_0x563e8e(0x286)]&&(_0x4c97d4[_0x563e8e(0x286)]=_0x2d40be?parseInt(_0x2d40be,0xa):undefined),await _0x25c82d['withProgress'](_0x563e8e(0x1d7)+_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]+_0x563e8e(0x24e),()=>_0x2d2aa6[_0x563e8e(0x1f3)]['updateSegmentById'](_0x30b02a[_0x563e8e(0x24c)],_0x46f63b[_0x563e8e(0x1f5)]['id'],_0x4c97d4)),_0x4a6949=_0x46f63b['existingSegment']['id'],_0x25c82d[_0x563e8e(0x1d5)]?.({'type':_0x563e8e(0x206),'name':_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]}),_0x25c82d[_0x563e8e(0x236)]?.(_0x563e8e(0x1e4)+_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]+'\x27'),_0x54de8e[_0x563e8e(0x2af)]=0x1;}else _0x4a6949=_0x46f63b[_0x563e8e(0x1f5)]['id'];}}catch(_0x2262e4){const _0x173c2a=isHttp400Error(_0x2262e4),_0x196cf3=_0x173c2a?ErrorCode[_0x563e8e(0x1fe)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x30abcf=getErrorMessage(_0x2262e4);throw new SDKError(_0x196cf3,'Failed\x20to\x20'+(_0x46f63b[_0x563e8e(0x2a1)]?'create':_0x563e8e(0x265))+_0x563e8e(0x1db)+_0x46f63b['absolutePath']+_0x563e8e(0x294)+_0x30abcf,_0x2262e4);}try{const _0x58ed14=await syncActivationsForSegment(_0x2d2aa6,_0x30b02a[_0x563e8e(0x24c)],_0x4a6949,_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)],_0x46f63b[_0x563e8e(0x228)],_0x25c82d,_0x46f63b['absolutePath']);_0x54de8e[_0x563e8e(0x201)]=_0x58ed14;}catch(_0x16b65d){if(_0x16b65d instanceof SDKError)throw _0x16b65d;throw new SDKError(ErrorCode[_0x563e8e(0x200)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x46f63b['yamlConfig'][_0x563e8e(0x2ac)]+_0x563e8e(0x1eb)+_0x46f63b[_0x563e8e(0x21c)]+_0x563e8e(0x294)+getErrorMessage(_0x16b65d),_0x16b65d);}return _0x54de8e;},_0x36df99=await batchAsync(_0xa7dd6f,_0x3e5738,_0x2ac118),_0x4bbca0={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x588020 of _0x36df99){_0x4bbca0[_0x546394(0x219)]+=_0x588020[_0x546394(0x219)],_0x4bbca0['updated']+=_0x588020[_0x546394(0x2af)],_0x588020['createdSegmentId']&&_0x4bbca0[_0x546394(0x285)][_0x546394(0x1e3)](_0x588020[_0x546394(0x1e1)][_0x546394(0x2ac)],_0x588020[_0x546394(0x1e1)]['id']),_0x4bbca0[_0x546394(0x201)][_0x546394(0x219)]+=_0x588020[_0x546394(0x201)][_0x546394(0x219)],_0x4bbca0[_0x546394(0x201)]['updated']+=_0x588020[_0x546394(0x201)][_0x546394(0x2af)],_0x4bbca0['activations'][_0x546394(0x2a4)]+=_0x588020[_0x546394(0x201)][_0x546394(0x2a4)];}return _0x4bbca0;}async function syncActivationsForSegment(_0x166723,_0x3edeef,_0x1599cb,_0x3ebe72,_0x5ed1f5,_0x364f5d,_0x57de0b){const _0x3d088c=a97_0x1ead5a,_0xd1128b={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5e1725 of _0x5ed1f5){try{if(_0x5e1725[_0x3d088c(0x20a)]==='create'&&_0x5e1725[_0x3d088c(0x203)])_0x364f5d['onProgress']?.({'type':'activation_creating','segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),await _0x364f5d['withProgress']('Creating\x20activation\x20\x27'+_0x5e1725[_0x3d088c(0x2ac)]+_0x3d088c(0x24e),()=>_0x166723[_0x3d088c(0x1f3)]['createActivation'](_0x3edeef,_0x1599cb,_0x5e1725[_0x3d088c(0x203)])),_0x364f5d['onProgress']?.({'type':_0x3d088c(0x1ed),'segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),_0x364f5d[_0x3d088c(0x236)]?.(_0x3d088c(0x26e)+_0x5e1725[_0x3d088c(0x2ac)]+'\x27'),_0xd1128b['created']++;else{if(_0x5e1725['type']===_0x3d088c(0x265)&&_0x5e1725['validatedRequest']&&_0x5e1725['existingActivation'])_0x364f5d[_0x3d088c(0x1d5)]?.({'type':'activation_updating','segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),await _0x364f5d[_0x3d088c(0x21f)](_0x3d088c(0x2a5)+_0x5e1725[_0x3d088c(0x2ac)]+_0x3d088c(0x24e),()=>_0x166723[_0x3d088c(0x1f3)][_0x3d088c(0x1e6)](_0x3edeef,_0x1599cb,_0x5e1725['existingActivation']['id'],_0x5e1725[_0x3d088c(0x203)])),_0x364f5d[_0x3d088c(0x1d5)]?.({'type':_0x3d088c(0x292),'segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),_0x364f5d[_0x3d088c(0x236)]?.('Updated\x20activation\x20\x27'+_0x5e1725['name']+'\x27'),_0xd1128b[_0x3d088c(0x2af)]++;else _0x5e1725[_0x3d088c(0x20a)]==='delete'&&_0x5e1725[_0x3d088c(0x246)]&&(_0x364f5d[_0x3d088c(0x1d5)]?.({'type':_0x3d088c(0x296),'segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),await _0x364f5d[_0x3d088c(0x21f)](_0x3d088c(0x28c)+_0x5e1725[_0x3d088c(0x2ac)]+_0x3d088c(0x24e),()=>_0x166723['segment'][_0x3d088c(0x275)](_0x3edeef,_0x1599cb,_0x5e1725[_0x3d088c(0x246)]['id'])),_0x364f5d[_0x3d088c(0x1d5)]?.({'type':_0x3d088c(0x1e2),'segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),_0x364f5d[_0x3d088c(0x262)]?.('Deleted\x20activation\x20\x27'+_0x5e1725['name']+'\x27'),_0xd1128b['deleted']++);}}catch(_0x3cc70e){const _0x4a0a00=isHttp400Error(_0x3cc70e),_0x31ef83=_0x4a0a00?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x26e2e0=getErrorMessage(_0x3cc70e);throw new SDKError(_0x31ef83,'Failed\x20to\x20'+_0x5e1725[_0x3d088c(0x20a)]+_0x3d088c(0x26d)+_0x5e1725['name']+_0x3d088c(0x1eb)+_0x57de0b+_0x3d088c(0x294)+_0x26e2e0,_0x3cc70e);}}return _0xd1128b;}export async function executePushFolders(_0x26da7d,_0x371be3,_0x3c0e08,_0x4d42c3,_0x5e58a6){const _0x3436b1=a97_0x1ead5a,_0x4a753d=new Map(_0x3c0e08);for(const _0x48b678 of _0x371be3){const _0x1f766f=_0x48b678[_0x3436b1(0x2a7)]('/'),_0x3e57d9=_0x1f766f[_0x1f766f['length']-0x1],_0x154d22=_0x1f766f[_0x3436b1(0x204)](0x0,-0x1)[_0x3436b1(0x1e8)]('/'),_0x5bacd2=_0x4a753d['get'](_0x154d22);_0x5e58a6['onProgress']?.({'type':_0x3436b1(0x1ff),'folder':_0x48b678});const _0x4c9c03={'name':_0x3e57d9,'parentFolderId':_0x5bacd2},_0x389ed0=await _0x5e58a6['withProgress']('Creating\x20folder\x20\x27'+_0x48b678+_0x3436b1(0x24e),()=>_0x26da7d[_0x3436b1(0x1f3)]['createFolder'](_0x4d42c3[_0x3436b1(0x24c)],_0x4c9c03));_0x4a753d[_0x3436b1(0x1e3)](_0x48b678,_0x389ed0[_0x3436b1(0x23f)]['id']),_0x5e58a6[_0x3436b1(0x1d5)]?.({'type':_0x3436b1(0x241),'folder':_0x48b678,'folderId':_0x389ed0[_0x3436b1(0x23f)]['id']}),_0x5e58a6['logInfo']?.(_0x3436b1(0x258)+_0x48b678+'\x27');}return _0x4a753d;}export async function executePushSegmentDeletions(_0x24ce2b,_0x28cbbc,_0x1494d6){const _0x30ab5a=a97_0x1ead5a;if(_0x28cbbc['length']===0x0)return 0x0;const {batchAsync:_0x1bd8d8}=await import(_0x30ab5a(0x255)),_0x37ce92=0x5,_0x3f9e06=await _0x1bd8d8(_0x28cbbc,async _0x1fe85e=>{const _0x2d9809=_0x30ab5a;return _0x1494d6[_0x2d9809(0x1d5)]?.({'type':_0x2d9809(0x1f1),'name':_0x1fe85e[_0x2d9809(0x2ac)]}),await _0x24ce2b[_0x2d9809(0x1f3)][_0x2d9809(0x1de)](_0x1fe85e['id']),_0x1494d6[_0x2d9809(0x1d5)]?.({'type':_0x2d9809(0x1e0),'name':_0x1fe85e[_0x2d9809(0x2ac)]}),_0x1494d6[_0x2d9809(0x262)]?.(_0x2d9809(0x29b)+_0x1fe85e[_0x2d9809(0x2ac)]+'\x27'),0x1;},_0x37ce92);return _0x3f9e06[_0x30ab5a(0x1f6)]((_0x2e0bdf,_0x32f021)=>_0x2e0bdf+_0x32f021,0x0);}function a97_0x526f(){const _0x1d3ef6=['Updating\x20activation\x20\x27','Created\x20journey\x20\x27','split','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','createActivation','state','connector_config','name','journeyActivationStepId','toLowerCase','updated','Journey\x20\x27','connectionIdToNameMap','progress','NOT_FOUND','find','embeddedSegmentNameToId','onProgress','relationships','Updating\x20segment\x20\x27','with','segmentNameToId','journey_creating','\x20segment\x20from\x20file:\x20','max','7761753XAbtjN','deleteSegment','2196FswBHN','segment_deleted','createdSegmentId','activation_deleted','set','Updated\x20segment\x20\x27','SEGMENT_NOT_FOUND','updateActivation','nameToId','join','entryCriteria','effectiveFolderId','\x27\x20from\x20file:\x20','notification','activation_created','activation_template_id','index','Creating\x20segment\x20\x27','segment_deleting','Activation','segment','./child-segment-yaml.js','existingSegment','reduce','parentSegmentFolder','10pUszqN','journey_entry_criteria_','entries','includes','fetchJourney','unchanged','SEGMENT_SYNTAX_ERROR','folder_creating','ACTIVATION_UPDATE_ERROR','activations','Segment\x20not\x20found:\x20','validatedRequest','slice','yamlActivation','segment_updated','__pending_','decision_point','draft','type','listSegments','behavior','activationsBySegmentId','activationContext','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','branches','embedded_activation_created','95KNdwKP','stage\x20\x27','hasChanges','localSegmentRules','12357026IYXMeu','map','journeyBundleName','created','Failed\x20to\x20','INTERNAL','absolutePath','startsWith','resolveJourneyId','withProgress','segmentByFolderAndName','milestone','journeyById','verbose','segments','198784SPoSsU','journeyId','\x20(referenced\x20in\x20journey\x20','activationActions','segmentId','createJourneySegment','parentFolder','skipSegments','7947536ZzQnei','connection','values','folder','\x27\x20for\x20','toString','rootFolderId','idToEmailMap','updateSegmentById','logSuccess','description','exitCriterias','embedded_activation_creating','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','kind','flatMap','segment_creating','JOURNEY_SYNTAX_ERROR','data','existingSegments','folder_created','parseDocument','journeyActivationNameToId','activation_','columns','existingActivation','folderPath','journeyStages','Fetching\x20','\x27\x20milestone','JOURNEY_UPDATE_ERROR','parentId','stringify','\x27...','journeys','action','journey_updated','Entry\x20criteria:\x20','user','keys','../../utils/async.js','2166aAMQdG','journeyBundlesByFolderAndName','Created\x20folder\x20\x27','goal','listActivations','embedded_segment_creating','object','\x20journey\x20from\x20file:\x20','\x27\x20exit\x20criteria','results','43372hyEakw','replace','logDeleted','item','digest','update','from','folderId','message','existingJourney','\x27\x20entry\x20criteria','versionNumber','null','\x20activation\x20\x27','Created\x20activation\x20\x27','get','yamlConfig','journey','utf-8','getSegment','all','deleteActivation','1272cbkkaw','Name\x20has\x20already\x20been\x20taken','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','push','journey_updating','createSegment','valid','DecisionPoint','getJourney','entry_criteria','goal\x20criteria','parse','create','attributes','length','createdSegmentIds','segmentFolderId','relative','dirname','isArray','getActivation','steps','Deleting\x20activation\x20\x27','filter','rule','size','folderPathToId','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','activation_updated','has','\x0a\x20\x20','entry','activation_deleting','schedule','deps','diff','\x27\x20decision\x20point\x20branch\x20\x27','Deleted\x20segment\x20\x27','journey_created','all_columns','delete','add','1168359tdkJbk','isNew','resolveSegment','idToName','deleted'];a97_0x526f=function(){return _0x1d3ef6;};return a97_0x526f();}export async function executePushJourneys(_0x44c5fc,_0x3d6844,_0x5da6ff,_0xb2a523,_0x59087a){const _0x2abc32=a97_0x1ead5a,{journeyDefToRequest:_0xcd252e}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x29833d,yamlRuleToApi:_0x2a60c3,validateSegmentRule:_0xb68c97}=await import(_0x2abc32(0x1f4)),_0x4c5296={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x370bcb=new Map(_0x5da6ff['segmentNameToId']),_0xa5ea9a=0x5;for(let _0x2c7eb4=0x0;_0x2c7eb4<_0x3d6844[_0x2abc32(0x284)];_0x2c7eb4+=_0xa5ea9a){const _0x835734=_0x3d6844[_0x2abc32(0x204)](_0x2c7eb4,_0x2c7eb4+_0xa5ea9a),_0x1d77d7=await Promise[_0x2abc32(0x274)](_0x835734[_0x2abc32(0x217)](async _0x113376=>{const _0x2414cc=_0x2abc32;if(!_0x113376[_0x2414cc(0x2a1)]&&!_0x113376['hasChanges'])return{'action':_0x2414cc(0x1fd),'name':_0x113376[_0x2414cc(0x270)][_0x2414cc(0x2ac)],'journeyId':_0x113376[_0x2414cc(0x269)]?.['id']};const _0x1f2fcc=_0x113376[_0x2414cc(0x247)]?_0x5da6ff[_0x2414cc(0x290)][_0x2414cc(0x26f)](_0x113376[_0x2414cc(0x247)]):undefined;_0x59087a[_0x2414cc(0x1d5)]?.({'type':_0x113376[_0x2414cc(0x2a1)]?_0x2414cc(0x1da):_0x2414cc(0x27a),'name':_0x113376['yamlConfig'][_0x2414cc(0x2ac)]});try{const _0x1f0772=await executeSingleJourneyPush(_0x44c5fc,_0x113376,{..._0x5da6ff,'segmentNameToId':_0x370bcb},{'parentId':_0xb2a523[_0x2414cc(0x24c)],'rootFolderId':_0xb2a523[_0x2414cc(0x233)],'folderId':_0x1f2fcc,'verbose':_0xb2a523[_0x2414cc(0x223)]},_0x59087a,{'journeyDefToRequest':_0xcd252e,'activationDefToCreateRequest':_0x29833d,'yamlRuleToApi':_0x2a60c3,'validateSegmentRule':_0xb68c97});for(const [_0x21c38b,_0x20e638]of _0x1f0772['embeddedSegmentNameToId']){_0x370bcb['set'](_0x21c38b,_0x20e638),_0x4c5296[_0x2414cc(0x1d4)][_0x2414cc(0x1e3)](_0x21c38b,_0x20e638);}if(_0x1f0772['action']===_0x2414cc(0x219))_0x59087a[_0x2414cc(0x1d5)]?.({'type':_0x2414cc(0x29c),'name':_0x113376['yamlConfig'][_0x2414cc(0x2ac)],'journeyId':_0x1f0772[_0x2414cc(0x226)]}),_0x59087a[_0x2414cc(0x236)]?.(_0x2414cc(0x2a6)+_0x113376[_0x2414cc(0x270)][_0x2414cc(0x2ac)]+'\x27'),_0x4c5296[_0x2414cc(0x219)]++;else _0x1f0772[_0x2414cc(0x250)]==='updated'&&(_0x59087a[_0x2414cc(0x1d5)]?.({'type':_0x2414cc(0x251),'name':_0x113376[_0x2414cc(0x270)][_0x2414cc(0x2ac)]}),_0x59087a[_0x2414cc(0x236)]?.('Updated\x20journey\x20\x27'+_0x113376[_0x2414cc(0x270)][_0x2414cc(0x2ac)]+'\x27'),_0x4c5296[_0x2414cc(0x2af)]++);return{'action':_0x1f0772[_0x2414cc(0x250)],'name':_0x113376[_0x2414cc(0x270)]['name'],'journeyId':_0x1f0772['journeyId']};}catch(_0x3ec069){const _0x40bf01=isHttp400Error(_0x3ec069),_0x3c4204=_0x40bf01?ErrorCode[_0x2414cc(0x23e)]:ErrorCode[_0x2414cc(0x24b)],_0xd6868b=getErrorMessage(_0x3ec069);throw new SDKError(_0x3c4204,_0x2414cc(0x21a)+(_0x113376['isNew']?_0x2414cc(0x282):_0x2414cc(0x265))+_0x2414cc(0x25d)+_0x113376[_0x2414cc(0x21c)]+'\x0a\x20\x20'+_0xd6868b,_0x3ec069);}}));_0x4c5296[_0x2abc32(0x25f)][_0x2abc32(0x279)](..._0x1d77d7);}return _0x4c5296;}async function executeSingleJourneyPush(_0x1ae651,_0x1c163f,_0x55e341,_0x32d0da,_0x4e8d2c,_0xec5a15){const _0x55deaa=a97_0x1ead5a,{journeyDefToRequest:_0x25dc70,activationDefToCreateRequest:_0x5667b6,yamlRuleToApi:_0x4f4e6f,validateSegmentRule:_0x28ba31}=_0xec5a15,_0x24e104=new Map(),_0x4d0cec=new Map(),_0x332fae=new Map(),_0x643e8=new Map(),_0x1937d3=new Map();let _0x585e53;const _0x3138a1=async()=>{const _0x5d0a48=a97_0x5c6b;if(_0x585e53)return;_0x585e53=new Map();if(!_0x1c163f['existingJourney'])return;const _0x22538f=await _0x1ae651['journey'][_0x5d0a48(0x25a)](_0x1c163f['existingJourney']['id']);for(const _0x54c973 of _0x22538f){const _0x5aba7e=journeyActivationStepToYaml(_0x54c973,_0x55e341[_0x5d0a48(0x234)],_0x55e341[_0x5d0a48(0x1d0)]),_0xdeb086=activationSignature(_0x5aba7e);!_0x585e53[_0x5d0a48(0x293)](_0xdeb086)&&_0x585e53[_0x5d0a48(0x1e3)](_0xdeb086,_0x54c973['id']),_0x5aba7e[_0x5d0a48(0x2ac)]&&_0x4d0cec[_0x5d0a48(0x1e3)](_0x5aba7e[_0x5d0a48(0x2ac)],_0x54c973['id']);}};if(_0x1c163f['existingJourney']&&_0x1c163f[_0x55deaa(0x270)][_0x55deaa(0x224)]){const _0x5bb817=buildLocalExpandedRuleMappings(_0x1c163f[_0x55deaa(0x270)]),_0x3a40d9=_0x5bb817[_0x55deaa(0x215)];if(_0x3a40d9[_0x55deaa(0x28f)]>0x0){const _0x19ddfc=new Map();for(const [_0x309f3b,_0x2e122d]of _0x3a40d9){const _0x1110d9=serializeExpandedRule(_0x2e122d,_0x3a40d9);_0x19ddfc[_0x55deaa(0x1e3)](_0x309f3b,_0x1110d9);}const _0x41ec7a=collectSegmentIdsFromJourneyApi(_0x1c163f['existingJourney']);if(_0x41ec7a[_0x55deaa(0x28f)]>0x0){const _0x32a765=await buildServerSegmentRuleMap(_0x1ae651,_0x32d0da[_0x55deaa(0x24c)],_0x55e341[_0x55deaa(0x240)],_0x41ec7a);if(_0x32a765[_0x55deaa(0x28f)]>0x0){const _0x3fcc16=new Map();for(const [_0x446aec,_0x293741]of _0x32a765){const _0x5d797a=serializeExpandedRule(_0x293741,_0x32a765);!_0x3fcc16['has'](_0x5d797a)&&_0x3fcc16['set'](_0x5d797a,_0x446aec);}for(const [_0x2e2fbd,_0x398fff]of _0x19ddfc){const _0x10843f=_0x3fcc16[_0x55deaa(0x26f)](_0x398fff);_0x10843f&&(_0x1937d3[_0x55deaa(0x1e3)](_0x2e2fbd,_0x10843f),_0x55e341[_0x55deaa(0x1d9)][_0x55deaa(0x1e3)](_0x2e2fbd,_0x10843f));}}}}}const _0x5df866={'resolveSegmentId':async _0x26440d=>{const _0x508063=_0x55deaa,_0x433850=_0x55e341[_0x508063(0x1d9)][_0x508063(0x26f)](_0x26440d);if(!_0x433850)throw new SDKError(ErrorCode[_0x508063(0x1e5)],_0x508063(0x202)+_0x26440d+'\x20(referenced\x20in\x20journey\x20'+_0x1c163f['yamlConfig'][_0x508063(0x2ac)]+')');return _0x433850;},'resolveEmbeddedSegmentId':async(_0x5b4372,_0x57e8a9)=>{const _0xdbd445=_0x55deaa,_0x19c472=_0x55e341[_0xdbd445(0x1d9)]['get'](_0x5b4372);if(_0x19c472)return _0x19c472;const _0xb35bc2=_0x1937d3['get'](_0x5b4372);if(_0xb35bc2)return _0x55e341['segmentNameToId'][_0xdbd445(0x1e3)](_0x5b4372,_0xb35bc2),_0xb35bc2;const _0x33a323=_0x55e341[_0xdbd445(0x240)][_0xdbd445(0x1d3)](_0x344faf=>_0x344faf['name']===_0x5b4372);if(_0x33a323)return _0x55e341['segmentNameToId'][_0xdbd445(0x1e3)](_0x5b4372,_0x33a323['id']),_0x33a323['id'];if(_0x1c163f[_0xdbd445(0x2a1)]){const {stageName:_0x3e586c,criteriaName:_0x4b8c60}=findSegmentCriteriaLocation(_0x1c163f[_0xdbd445(0x270)],_0x5b4372);return _0x28ba31(_0x5b4372,_0x57e8a9[_0xdbd445(0x28e)]),_0x332fae[_0xdbd445(0x1e3)](_0x5b4372,{'definition':_0x57e8a9,'stageName':_0x3e586c,'criteriaName':_0x4b8c60}),createPendingSegmentId(_0x5b4372);}const _0x116647=_0x1c163f[_0xdbd445(0x269)]?.['id'];if(!_0x116647)throw new SDKError(ErrorCode[_0xdbd445(0x21b)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x28ba31(_0x5b4372,_0x57e8a9['rule']);const _0x189ab8=generateDeterministicJourneySegmentName(_0x1c163f[_0xdbd445(0x270)][_0xdbd445(0x2ac)],_0x5b4372),_0x432463=_0x55e341[_0xdbd445(0x240)][_0xdbd445(0x1d3)](_0x15b468=>_0x15b468[_0xdbd445(0x2ac)]===_0x189ab8),_0x57df72=createSegmentIdResolver(_0x55e341['segmentNameToId'],_0x5b4372),_0x9b27c8=await resolveRuleSegmentIds(_0x57e8a9[_0xdbd445(0x28e)],_0x57df72);let _0x3beb62;if(_0x432463)await _0x1ae651[_0xdbd445(0x1f3)]['updateSegmentById'](_0x32d0da[_0xdbd445(0x24c)],_0x432463['id'],{'description':_0x57e8a9[_0xdbd445(0x237)]||_0xdbd445(0x252)+_0x5b4372,'rule':_0x4f4e6f(_0x9b27c8,!![]),'countPopulation':!![]}),_0x3beb62=_0x432463['id'];else try{_0x3beb62=await _0x1ae651['segment'][_0xdbd445(0x22a)]({'name':_0x189ab8,'description':_0x57e8a9['description']||_0xdbd445(0x252)+_0x5b4372,'journeyId':_0x116647,'rule':_0x4f4e6f(_0x9b27c8,!![]),'countPopulation':!![],'parentFolderId':_0x32d0da[_0xdbd445(0x233)]||'','audienceId':_0x32d0da[_0xdbd445(0x24c)]});}catch(_0x5733e0){const _0x7ce133=_0x5733e0 instanceof Error&&_0x5733e0[_0xdbd445(0x268)][_0xdbd445(0x1fb)](_0xdbd445(0x277));if(_0x7ce133){const _0x3d2d44=await _0x1ae651[_0xdbd445(0x1f3)][_0xdbd445(0x20b)](_0x32d0da[_0xdbd445(0x24c)]),_0x1a67c1=_0x3d2d44['find'](_0x9eb152=>_0x9eb152[_0xdbd445(0x2ac)]===_0x189ab8);if(_0x1a67c1)await _0x1ae651[_0xdbd445(0x1f3)][_0xdbd445(0x235)](_0x32d0da[_0xdbd445(0x24c)],_0x1a67c1['id'],{'description':_0x57e8a9[_0xdbd445(0x237)]||_0xdbd445(0x252)+_0x5b4372,'rule':_0x4f4e6f(_0x9b27c8,!![]),'countPopulation':!![]}),_0x3beb62=_0x1a67c1['id'];else throw _0x5733e0;}else throw _0x5733e0;}return _0x55e341['segmentNameToId'][_0xdbd445(0x1e3)](_0x5b4372,_0x3beb62),_0x24e104[_0xdbd445(0x1e3)](_0x5b4372,_0x3beb62),_0x3beb62;},'resolveActivationId':async _0x100332=>{const _0x384407=_0x55deaa,_0x5a6b1b=_0x4d0cec[_0x384407(0x26f)](_0x100332);if(_0x5a6b1b)return _0x5a6b1b;if(_0x1c163f[_0x384407(0x269)]){await _0x3138a1();const _0x476ea7=_0x4d0cec[_0x384407(0x26f)](_0x100332);if(_0x476ea7)return _0x476ea7;}throw new SDKError(ErrorCode[_0x384407(0x1d2)],'Activation\x20not\x20found:\x20'+_0x100332+_0x384407(0x227)+_0x1c163f[_0x384407(0x270)][_0x384407(0x2ac)]+').\x20'+_0x384407(0x23a));},'resolveEmbeddedActivationId':async(_0x16e08d,_0x599b93)=>{const _0x39a30a=_0x55deaa,_0x25125e=_0x4d0cec[_0x39a30a(0x26f)](_0x16e08d);if(_0x25125e)return _0x25125e;if(_0x1c163f[_0x39a30a(0x2a1)])return _0x643e8[_0x39a30a(0x1e3)](_0x16e08d,_0x599b93),createPendingActivationId(_0x16e08d);if(_0x1c163f[_0x39a30a(0x269)]){await _0x3138a1();const _0x10e723=_0x4d0cec[_0x39a30a(0x26f)](_0x599b93['name']);if(_0x10e723)return _0x4d0cec[_0x39a30a(0x1e3)](_0x16e08d,_0x10e723),_0x10e723;const _0x59de04=activationSignature(_0x599b93),_0xc53e05=_0x585e53?.[_0x39a30a(0x26f)](_0x59de04);if(_0xc53e05)return _0x4d0cec['set'](_0x16e08d,_0xc53e05),_0xc53e05;const _0x58d937=await _0x5667b6(_0x599b93,_0x55e341[_0x39a30a(0x20e)]),_0x38e4b1=await _0x1ae651[_0x39a30a(0x271)][_0x39a30a(0x2a9)](_0x1c163f[_0x39a30a(0x269)]['id'],_0x58d937);return _0x4d0cec['set'](_0x16e08d,_0x38e4b1['id']),_0x38e4b1['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x39a30a(0x291));},'resolveJourneyId':async _0x4259c9=>{const _0x13a11b=_0x55deaa;try{return await _0x1ae651[_0x13a11b(0x271)][_0x13a11b(0x21e)](_0x32d0da['parentId'],_0x4259c9);}catch(_0x54a377){throw new SDKError(ErrorCode[_0x13a11b(0x1d2)],_0x13a11b(0x1cf)+_0x4259c9+_0x13a11b(0x2a8)+_0x1c163f[_0x13a11b(0x270)][_0x13a11b(0x2ac)]+'\x27)',_0x54a377);}},'resolveStageId':async(_0x9a1c6b,_0x2b7911)=>{const _0x570167=_0x55deaa,_0x36c5ad=await _0x1ae651[_0x570167(0x271)][_0x570167(0x27e)](_0x9a1c6b),_0x30a8ad=_0x36c5ad['attributes'][_0x570167(0x248)]['find'](_0x28cd8e=>_0x28cd8e['name'][_0x570167(0x2ae)]()===_0x2b7911[_0x570167(0x2ae)]());if(!_0x30a8ad?.['id'])throw new SDKError(ErrorCode[_0x570167(0x1d2)],'Stage\x20\x27'+_0x2b7911+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x36c5ad[_0x570167(0x283)][_0x570167(0x218)]||_0x36c5ad[_0x570167(0x283)][_0x570167(0x2ac)])+'\x27');return _0x30a8ad['id'];}},_0x348acd=await _0x25dc70(_0x1c163f[_0x55deaa(0x270)],_0x32d0da[_0x55deaa(0x24c)],_0x5df866),_0x1276bc=_0x32d0da[_0x55deaa(0x267)]||_0x32d0da[_0x55deaa(0x233)];_0x1276bc&&(_0x348acd[_0x55deaa(0x1d6)]={'parentFolder':{'data':{'id':_0x1276bc,'type':_0x55deaa(0x230)}}});if(_0x1c163f[_0x55deaa(0x2a1)]){if(_0x332fae['size']>0x0||_0x643e8[_0x55deaa(0x28f)]>0x0)return await executeThreeStepJourneyCreate(_0x1ae651,_0x1c163f,_0x348acd,{'pendingEmbeddedSegments':_0x332fae,'pendingEmbeddedActivations':_0x643e8,'embeddedSegmentNameToId':_0x24e104,'journeyActivationNameToId':_0x4d0cec},{..._0x32d0da,'effectiveFolderId':_0x1276bc},_0x55e341,_0x4e8d2c,_0xec5a15);else{ensureJourneyDefaults(_0x348acd[_0x55deaa(0x283)]);const _0x4bb66b=await _0x1ae651['journey'][_0x55deaa(0x282)](_0x348acd);return{'action':_0x55deaa(0x219),'journeyId':_0x4bb66b['id'],'embeddedSegmentNameToId':_0x24e104};}}else{if(_0x1c163f['hasChanges']&&_0x1c163f[_0x55deaa(0x269)])return ensureJourneyDefaults(_0x348acd[_0x55deaa(0x283)]),await _0x1ae651[_0x55deaa(0x271)][_0x55deaa(0x265)](_0x1c163f[_0x55deaa(0x269)]['id'],_0x348acd),{'action':_0x55deaa(0x2af),'journeyId':_0x1c163f['existingJourney']['id'],'embeddedSegmentNameToId':_0x24e104};}return{'action':_0x55deaa(0x1fd),'journeyId':_0x1c163f[_0x55deaa(0x269)]?.['id'],'embeddedSegmentNameToId':_0x24e104};}function findSegmentCriteriaLocation(_0x354004,_0x57ffc2){const _0x41f1a6=a97_0x1ead5a,_0x4e819d=_0x354004['stages']||_0x354004[_0x41f1a6(0x24f)]?.[0x0]?.['stages']||[];let _0x20726e=_0x41f1a6(0x295),_0x4f81ef=_0x57ffc2;const _0x5438fe=_0x354004[_0x41f1a6(0x259)]||_0x354004[_0x41f1a6(0x24f)]?.[0x0]?.[_0x41f1a6(0x259)];if(_0x5438fe?.[_0x41f1a6(0x1f3)]===_0x57ffc2)return{'stageName':_0x41f1a6(0x259),'criteriaName':_0x5438fe['name']||_0x57ffc2};_0x4728e9:for(const _0x3b86d3 of _0x4e819d){if(_0x3b86d3[_0x41f1a6(0x27f)]?.['segment']===_0x57ffc2){_0x20726e=_0x3b86d3[_0x41f1a6(0x2ac)],_0x4f81ef=_0x3b86d3[_0x41f1a6(0x27f)][_0x41f1a6(0x2ac)]||_0x57ffc2;break;}if(_0x3b86d3[_0x41f1a6(0x28b)])for(const _0x51f4b2 of _0x3b86d3[_0x41f1a6(0x28b)]){if(_0x51f4b2[_0x41f1a6(0x20a)]===_0x41f1a6(0x208)&&_0x51f4b2[_0x41f1a6(0x1d8)]?.['branches'])for(const _0x5d5560 of _0x51f4b2[_0x41f1a6(0x1d8)]['branches']){if(_0x5d5560[_0x41f1a6(0x1f3)]===_0x57ffc2){_0x20726e=_0x3b86d3[_0x41f1a6(0x2ac)],_0x4f81ef=_0x5d5560[_0x41f1a6(0x2ac)]||_0x57ffc2;break _0x4728e9;}}}}return{'stageName':_0x20726e,'criteriaName':_0x4f81ef};}async function executeThreeStepJourneyCreate(_0x5cbec8,_0x5dd5e0,_0x5ccafb,_0x2ed942,_0xddcdf6,_0x2a633e,_0x15f308,_0x1621d9){const _0x1e7629=a97_0x1ead5a,{activationDefToCreateRequest:_0x9a0a74,yamlRuleToApi:_0x4ba149}=_0x1621d9,{pendingEmbeddedSegments:_0x687a5e,pendingEmbeddedActivations:_0x4e2e13,embeddedSegmentNameToId:_0x3505e4}=_0x2ed942,_0x470c27=JSON[_0x1e7629(0x281)](JSON[_0x1e7629(0x24d)](_0x5ccafb));ensureJourneyDefaults(_0x470c27[_0x1e7629(0x283)]),stripPendingIds(_0x470c27);const _0x463067=await _0x5cbec8[_0x1e7629(0x271)]['create'](_0x470c27),_0x547e4e=_0x463067['id'],_0x577a26=new Map();for(const _0x5aa09d of _0x463067[_0x1e7629(0x283)]['journeyStages']){_0x577a26[_0x1e7629(0x1e3)](_0x5aa09d[_0x1e7629(0x2ac)][_0x1e7629(0x2ae)](),_0x5aa09d['id']);}for(const [_0x1d7717,{definition:_0x4274c8}]of _0x687a5e){const _0x443b00=generateDeterministicJourneySegmentName(_0x5dd5e0[_0x1e7629(0x270)][_0x1e7629(0x2ac)],_0x1d7717);_0x15f308[_0x1e7629(0x1d5)]?.({'type':_0x1e7629(0x25b),'journeyName':_0x5dd5e0[_0x1e7629(0x270)][_0x1e7629(0x2ac)],'segmentName':_0x1d7717});const _0x8c6132=createSegmentIdResolver(_0x2a633e['segmentNameToId'],_0x1d7717),_0x314cf7=await resolveRuleSegmentIds(_0x4274c8[_0x1e7629(0x28e)],_0x8c6132),_0x3c3732=await _0x5cbec8[_0x1e7629(0x1f3)][_0x1e7629(0x22a)]({'name':_0x443b00,'description':_0x4274c8[_0x1e7629(0x237)]||_0x1e7629(0x252)+_0x1d7717,'journeyId':_0x547e4e,'rule':_0x4ba149(_0x314cf7,!![]),'countPopulation':!![],'parentFolderId':_0xddcdf6[_0x1e7629(0x1ea)]||'','audienceId':_0xddcdf6[_0x1e7629(0x24c)]});_0x3505e4[_0x1e7629(0x1e3)](_0x1d7717,_0x3c3732),_0x2a633e['segmentNameToId'][_0x1e7629(0x1e3)](_0x1d7717,_0x3c3732),_0x15f308[_0x1e7629(0x1d5)]?.({'type':'embedded_segment_created','journeyName':_0x5dd5e0[_0x1e7629(0x270)]['name'],'segmentName':_0x1d7717});}const _0x37f5d6=new Map();for(const [_0x4f7ac6,_0x3031ee]of _0x4e2e13){_0x15f308['onProgress']?.({'type':_0x1e7629(0x239),'journeyName':_0x5dd5e0[_0x1e7629(0x270)][_0x1e7629(0x2ac)],'activationName':_0x4f7ac6});const _0x3b4f3b=await _0x9a0a74(_0x3031ee,_0x2a633e[_0x1e7629(0x20e)]),_0x2a139f=await _0x5cbec8[_0x1e7629(0x271)]['createActivation'](_0x547e4e,_0x3b4f3b);_0x37f5d6[_0x1e7629(0x1e3)](_0x4f7ac6,_0x2a139f['id']),_0x2ed942[_0x1e7629(0x243)][_0x1e7629(0x1e3)](_0x4f7ac6,_0x2a139f['id']),_0x15f308['onProgress']?.({'type':_0x1e7629(0x211),'journeyName':_0x5dd5e0[_0x1e7629(0x270)][_0x1e7629(0x2ac)],'activationName':_0x4f7ac6});}const _0x47211d=JSON[_0x1e7629(0x281)](JSON['stringify'](_0x5ccafb));return _0x47211d['id']=_0x547e4e,ensureJourneyDefaults(_0x47211d['attributes']),resolvePendingIdsInRequest(_0x47211d,_0x5ccafb,_0x577a26,_0x3505e4,_0x37f5d6,_0x15f308),await _0x5cbec8[_0x1e7629(0x271)][_0x1e7629(0x265)](_0x547e4e,_0x47211d),{'action':'created','journeyId':_0x547e4e,'embeddedSegmentNameToId':_0x3505e4};}function stripPendingIds(_0x532b57){const _0x114880=a97_0x1ead5a;for(const _0x52930a of _0x532b57[_0x114880(0x283)][_0x114880(0x248)]||[]){_0x52930a[_0x114880(0x1e9)]?.[_0x114880(0x229)]&&isPendingSegmentId(_0x52930a[_0x114880(0x1e9)][_0x114880(0x229)])&&delete _0x52930a[_0x114880(0x1e9)];if(_0x52930a[_0x114880(0x28b)])for(const _0x514a18 of Object['keys'](_0x52930a[_0x114880(0x28b)])){const _0x38cfc7=_0x52930a['steps'][_0x514a18];_0x38cfc7['type']===_0x114880(0x1f2)&&_0x38cfc7['journeyActivationStepId']&&isPendingActivationId(_0x38cfc7[_0x114880(0x2ad)])&&(_0x38cfc7[_0x114880(0x2ad)]='');if(_0x38cfc7[_0x114880(0x20a)]===_0x114880(0x27d)&&_0x38cfc7[_0x114880(0x210)])for(const _0xb0d518 of _0x38cfc7[_0x114880(0x210)]){_0xb0d518[_0x114880(0x229)]&&isPendingSegmentId(_0xb0d518[_0x114880(0x229)])&&(_0xb0d518[_0x114880(0x229)]='');}}}}function resolvePendingIdsInRequest(_0x500f4d,_0x49d4c8,_0x8ca504,_0x47bb91,_0x38b772,_0x42cd8){const _0x273d69=a97_0x1ead5a,_0x42db76=(_0x40aa78,_0x2fbcef)=>{const _0x38a0f2=a97_0x5c6b;if(!isPendingSegmentId(_0x40aa78))return _0x40aa78;const _0x24e5e5=extractPendingSegmentName(_0x40aa78),_0xd70e08=_0x47bb91['get'](_0x24e5e5);return!_0xd70e08&&_0x42cd8['logWarning']?.(_0x38a0f2(0x278)+_0x24e5e5+_0x38a0f2(0x231)+_0x2fbcef),_0xd70e08;};if(_0x500f4d[_0x273d69(0x283)][_0x273d69(0x259)]?.[_0x273d69(0x229)]&&isPendingSegmentId(_0x500f4d[_0x273d69(0x283)][_0x273d69(0x259)][_0x273d69(0x229)])){const _0x3275ed=_0x42db76(_0x500f4d[_0x273d69(0x283)]['goal'][_0x273d69(0x229)],_0x273d69(0x280));_0x3275ed&&(_0x500f4d[_0x273d69(0x283)][_0x273d69(0x259)][_0x273d69(0x229)]=_0x3275ed);}for(const _0x3b0164 of _0x500f4d[_0x273d69(0x283)]['journeyStages']||[]){const _0x1a9b88=_0x8ca504[_0x273d69(0x26f)](_0x3b0164[_0x273d69(0x2ac)][_0x273d69(0x2ae)]());_0x1a9b88&&(_0x3b0164['id']=_0x1a9b88);if(_0x3b0164[_0x273d69(0x1e9)]?.[_0x273d69(0x229)]&&isPendingSegmentId(_0x3b0164[_0x273d69(0x1e9)][_0x273d69(0x229)])){const _0x58be8d=_0x42db76(_0x3b0164[_0x273d69(0x1e9)][_0x273d69(0x229)],'stage\x20\x27'+_0x3b0164[_0x273d69(0x2ac)]+_0x273d69(0x26a));_0x58be8d&&(_0x3b0164[_0x273d69(0x1e9)]['segmentId']=_0x58be8d);}if(_0x3b0164[_0x273d69(0x238)])for(const _0x4d9c63 of _0x3b0164[_0x273d69(0x238)]){if(_0x4d9c63[_0x273d69(0x229)]&&isPendingSegmentId(_0x4d9c63[_0x273d69(0x229)])){const _0x459fb0=_0x42db76(_0x4d9c63[_0x273d69(0x229)],_0x273d69(0x213)+_0x3b0164['name']+_0x273d69(0x25e));_0x459fb0&&(_0x4d9c63[_0x273d69(0x229)]=_0x459fb0);}}if(_0x3b0164[_0x273d69(0x221)]?.['segmentId']&&isPendingSegmentId(_0x3b0164[_0x273d69(0x221)][_0x273d69(0x229)])){const _0x2a98ab=_0x42db76(_0x3b0164[_0x273d69(0x221)][_0x273d69(0x229)],_0x273d69(0x213)+_0x3b0164[_0x273d69(0x2ac)]+_0x273d69(0x24a));_0x2a98ab&&(_0x3b0164['milestone'][_0x273d69(0x229)]=_0x2a98ab);}if(_0x3b0164[_0x273d69(0x28b)]){const _0x1f6ac9=_0x5ea69f=>_0x49d4c8['attributes'][_0x273d69(0x248)]['find'](_0x1c78c5=>_0x1c78c5[_0x273d69(0x2ac)]['toLowerCase']()===_0x3b0164[_0x273d69(0x2ac)][_0x273d69(0x2ae)]())?.['steps']?.[_0x5ea69f];for(const _0x9878d2 of Object[_0x273d69(0x254)](_0x3b0164['steps'])){const _0x2c7f7c=_0x3b0164[_0x273d69(0x28b)][_0x9878d2],_0x3437f2=_0x1f6ac9(_0x9878d2);if(_0x2c7f7c[_0x273d69(0x20a)]===_0x273d69(0x1f2)&&_0x2c7f7c[_0x273d69(0x2ad)]&&(isPendingActivationId(_0x2c7f7c[_0x273d69(0x2ad)])||_0x2c7f7c[_0x273d69(0x2ad)]==='')){if(_0x3437f2?.['journeyActivationStepId']&&isPendingActivationId(_0x3437f2[_0x273d69(0x2ad)])){const _0x46bd3c=extractPendingActivationName(_0x3437f2[_0x273d69(0x2ad)]),_0x82b23d=_0x38b772[_0x273d69(0x26f)](_0x46bd3c);_0x82b23d&&(_0x2c7f7c[_0x273d69(0x2ad)]=_0x82b23d);}}if(_0x2c7f7c[_0x273d69(0x20a)]==='DecisionPoint'&&_0x2c7f7c[_0x273d69(0x210)]&&_0x3437f2?.[_0x273d69(0x210)])for(let _0xdca048=0x0;_0xdca048<_0x2c7f7c[_0x273d69(0x210)][_0x273d69(0x284)];_0xdca048++){const _0x5aba59=_0x2c7f7c[_0x273d69(0x210)][_0xdca048],_0x5107af=_0x3437f2['branches'][_0xdca048];if(_0x5107af?.[_0x273d69(0x229)]&&isPendingSegmentId(_0x5107af[_0x273d69(0x229)])){const _0x16d7be=_0x42db76(_0x5107af[_0x273d69(0x229)],_0x273d69(0x213)+_0x3b0164[_0x273d69(0x2ac)]+_0x273d69(0x29a)+(_0x5aba59[_0x273d69(0x2ac)]||_0xdca048)+'\x27');_0x16d7be&&(_0x5aba59[_0x273d69(0x229)]=_0x16d7be);}}}}}}
1
+ const a97_0x560ff4=a97_0x1212;(function(_0x4c1880,_0x587964){const _0x6a83ec=a97_0x1212,_0x4e7ca9=_0x4c1880();while(!![]){try{const _0x1d73f3=-parseInt(_0x6a83ec(0x1f3))/0x1+-parseInt(_0x6a83ec(0x18c))/0x2+-parseInt(_0x6a83ec(0x1ac))/0x3*(parseInt(_0x6a83ec(0x1de))/0x4)+parseInt(_0x6a83ec(0x21e))/0x5*(parseInt(_0x6a83ec(0x20f))/0x6)+-parseInt(_0x6a83ec(0x21c))/0x7+-parseInt(_0x6a83ec(0x1c5))/0x8+parseInt(_0x6a83ec(0x212))/0x9;if(_0x1d73f3===_0x587964)break;else _0x4e7ca9['push'](_0x4e7ca9['shift']());}catch(_0x28c9c9){_0x4e7ca9['push'](_0x4e7ca9['shift']());}}}(a97_0x5250,0x9b75e));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a97_0x560ff4(0x1b1);export function createPendingSegmentId(_0x32db08){return''+PENDING_SEGMENT_PREFIX+_0x32db08+'__';}export function isPendingSegmentId(_0x22bda4){const _0x74343a=a97_0x560ff4;return _0x22bda4[_0x74343a(0x152)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x245202){const _0x3619f0=a97_0x560ff4;return _0x245202[_0x3619f0(0x199)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x231542){return''+PENDING_ACTIVATION_PREFIX+_0x231542+'__';}export function isPendingActivationId(_0x251252){const _0xbbf0fe=a97_0x560ff4;return _0x251252[_0xbbf0fe(0x152)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x39f9ab){const _0x4cbc74=a97_0x560ff4;return _0x39f9ab[_0x4cbc74(0x199)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x50ac73,_0x58939f){const _0x423d33=a97_0x560ff4,_0x30610=_0x50ac73+'::'+(_0x58939f[_0x423d33(0x201)]()||_0x423d33(0x22f)),_0x4b40d7=createHash(_0x423d33(0x19a))[_0x423d33(0x1be)](_0x30610)[_0x423d33(0x1c4)](_0x423d33(0x237))['slice'](0x0,0xc);return _0x423d33(0x1ec)+_0x4b40d7;}export function ensureJourneyDefaults(_0x2f1a6b){const _0xc15899=a97_0x560ff4;!_0x2f1a6b[_0xc15899(0x15a)]&&(_0x2f1a6b['description']=''),!_0x2f1a6b[_0xc15899(0x1bd)]&&(_0x2f1a6b['state']=_0xc15899(0x210));}export function resolveTDFolderPath(_0x35a21a,_0x24a45a,_0x6d87f5){const _0x1d9526=a97_0x560ff4;if(!_0x24a45a)return _0x35a21a;if(_0x35a21a===_0x6d87f5||_0x35a21a[_0x1d9526(0x152)](_0x6d87f5+'/'))return _0x35a21a;return _0x35a21a?_0x6d87f5+'/'+_0x35a21a:_0x6d87f5;}export function addFoldersToCreate(_0x2bef1c,_0x2f512d,_0x1a6b52){const _0x4194c2=a97_0x560ff4;if(!_0x2bef1c)return;if(_0x2f512d['has'](_0x2bef1c))return;const _0x1178e4=_0x2bef1c['split']('/');let _0x1b9638='';for(const _0x1429e1 of _0x1178e4){_0x1b9638=_0x1b9638?_0x1b9638+'/'+_0x1429e1:_0x1429e1,!_0x2f512d[_0x4194c2(0x219)](_0x1b9638)&&_0x1a6b52[_0x4194c2(0x188)](_0x1b9638);}}import*as a97_0xb8392 from'yaml';import{readFileSync}from'fs';import a97_0x2db96c from'path';import{isJourneyDef,parseYamlString as a97_0x549390,toYamlString as a97_0x2102e8,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(_0x4aef2e){const _0x7fa3a3=a97_0x560ff4;if(Array['isArray'](_0x4aef2e))return'['+_0x4aef2e[_0x7fa3a3(0x1b2)](_0x475bd8=>stableStringify(_0x475bd8))[_0x7fa3a3(0x239)](',')+']';if(_0x4aef2e&&typeof _0x4aef2e===_0x7fa3a3(0x1a3)){const _0x2d67ba=_0x4aef2e,_0x535a62=Object['keys'](_0x2d67ba)[_0x7fa3a3(0x1ee)](),_0x29f5dd=_0x535a62['map'](_0x50fb6e=>'\x22'+_0x50fb6e+'\x22:'+stableStringify(_0x2d67ba[_0x50fb6e]));return'{'+_0x29f5dd['join'](',')+'}';}const _0x5dce0a=JSON['stringify'](_0x4aef2e);return _0x5dce0a===undefined?_0x7fa3a3(0x1ea):_0x5dce0a;}function activationSignature(_0x29f343){const _0x1ed725=a97_0x560ff4,_0x50214f={'connection':_0x29f343['connection'],..._0x29f343[_0x1ed725(0x174)]!==undefined&&{'all_columns':_0x29f343['all_columns']},..._0x29f343[_0x1ed725(0x168)]!==undefined&&{'columns':_0x29f343[_0x1ed725(0x168)]},..._0x29f343['behavior']!==undefined&&{'behavior':_0x29f343[_0x1ed725(0x181)]},..._0x29f343[_0x1ed725(0x1b3)]!==undefined&&{'schedule':_0x29f343[_0x1ed725(0x1b3)]},..._0x29f343['notification']!==undefined&&{'notification':_0x29f343[_0x1ed725(0x21b)]},..._0x29f343['connector_config']!==undefined&&{'connector_config':_0x29f343[_0x1ed725(0x213)]},..._0x29f343[_0x1ed725(0x222)]!==undefined&&{'activation_template_id':_0x29f343[_0x1ed725(0x222)]}};return stableStringify(_0x50214f);}export async function prepareSegmentFiles(_0x1415ff,_0x1222e6,_0xf4c7b8,_0x29f32f,_0x464b53){const _0x286a39=a97_0x560ff4,{activationDefToCreateRequest:_0x35b708}=await import(_0x286a39(0x205)),_0x42bd9f=[],_0x494962=new Set();for(const {yamlConfig:_0x3ccf5e,folderPath:_0x3c7ea5,sourcePath:_0x5ea5ec}of _0x1415ff){const _0x5661f7=resolveTDFolderPath(_0x3c7ea5,_0x29f32f,_0x464b53),_0x598750=_0x5661f7+':'+_0x3ccf5e[_0x286a39(0x1eb)],_0x3ea006=_0x1222e6['segmentByFolderAndName'][_0x286a39(0x1e0)](_0x598750),_0x5adfb7=_0x3ea006?_0x1222e6['activationsBySegmentId']['get'](_0x3ea006['id'])||[]:[];addFoldersToCreate(_0x5661f7,_0x1222e6[_0x286a39(0x158)],_0x494962);const _0x96c30c=calculateActivationActions(_0x3ccf5e[_0x286a39(0x218)]||[],_0x5adfb7,_0x1222e6[_0x286a39(0x1ef)],_0x1222e6[_0x286a39(0x1fa)]);for(const _0xbfc212 of _0x96c30c){(_0xbfc212['type']===_0x286a39(0x220)||_0xbfc212[_0x286a39(0x1f7)]===_0x286a39(0x1be))&&_0xbfc212['yamlActivation']&&(_0xbfc212[_0x286a39(0x231)]=await _0x35b708(_0xbfc212[_0x286a39(0x1c8)],_0xf4c7b8));}const _0xd59372=calculateSegmentDiff(_0x3ccf5e,_0x3ea006,_0x5adfb7,_0x1222e6[_0x286a39(0x1ef)],_0x1222e6['connectionIdToNameMap']);_0x42bd9f[_0x286a39(0x1e3)]({'relativePath':_0x3ccf5e[_0x286a39(0x1eb)],'absolutePath':_0x5ea5ec,'yamlConfig':_0x3ccf5e,'folderPath':_0x5661f7,'existingSegment':_0x3ea006,'existingActivations':_0x5adfb7,'isNew':_0xd59372[_0x286a39(0x20b)],'hasChanges':_0xd59372[_0x286a39(0x203)],'diff':_0xd59372['diff'],'activationActions':_0x96c30c});}return{'segmentFiles':_0x42bd9f,'foldersToCreate':_0x494962};}export async function prepareJourneyFiles(_0x3e3b7b,_0x22cd29,_0x230110,_0x1e7562){const _0x586e68=a97_0x560ff4,_0xb6929a=[],_0x501664=new Set();for(const {yamlConfig:_0x1bcab1,folderPath:_0x1c0fd2,sourcePath:_0x211261}of _0x3e3b7b){const _0xd351ed=resolveTDFolderPath(_0x1c0fd2,_0x230110,_0x1e7562),_0x2ebadf=_0xd351ed+':'+_0x1bcab1[_0x586e68(0x1eb)],_0x5a55b8=_0x22cd29[_0x586e68(0x1d9)][_0x586e68(0x1e0)](_0x2ebadf);let _0x4d8c8c,_0x458247;if(_0x5a55b8&&_0x5a55b8[_0x586e68(0x1fc)]>0x0){const _0x19afdb=buildLocalExpandedRuleMappings(_0x1bcab1),{createYamlContext:_0xeed26,prefetchJourneySegments:_0x14bafe}=createPushYamlContextForBundle(_0x22cd29[_0x586e68(0x1c3)],_0x22cd29[_0x586e68(0x226)],_0x22cd29[_0x586e68(0x15f)],_0x19afdb,_0x22cd29[_0x586e68(0x1ef)],_0x22cd29['connectionIdToNameMap'],_0x22cd29['activationStepsById'],_0x22cd29[_0x586e68(0x177)]);await _0x14bafe(_0x5a55b8[_0x586e68(0x1b2)](_0x277c88=>_0x277c88['id']));const _0x385a11=hasMultipleVersions(_0x1bcab1),_0xdeb046=async _0x93f3cd=>{const _0x141f44=_0x586e68,_0x1f8a3b=_0x22cd29[_0x141f44(0x177)]?.['get'](_0x93f3cd);if(_0x1f8a3b)return _0x1f8a3b;return _0x22cd29[_0x141f44(0x159)]({'journeyId':_0x93f3cd,'journeyName':_0x1bcab1['name'],'isMultiVersion':_0x5a55b8['length']>0x1});};if(_0x385a11&&_0x5a55b8[_0x586e68(0x1fc)]>0x1){const _0x1f5bfd=[];for(const _0x1c14b2 of _0x5a55b8){const _0x2e6bd0=_0x1c14b2[_0x586e68(0x238)]||0x1;_0x22cd29[_0x586e68(0x21f)]?.['update'](_0x586e68(0x1f4)+_0x1bcab1['name']+'\x20v'+_0x2e6bd0);const _0x2a8b3c=await _0xdeb046(_0x1c14b2['id']),_0x283746=_0xeed26(_0x1c14b2['id']),_0x52c2d5=await journeyResponseToDef(_0x2a8b3c,_0x283746);_0x1f5bfd['push']({'item':_0x1c14b2,'yaml':_0x52c2d5});}const _0x24707f=buildLocalRuleToNameMappingFromJourney(_0x1bcab1);_0x458247=buildMergedJourneyDef(_0x1f5bfd,_0x24707f);const _0x718147=Math[_0x586e68(0x229)](..._0x1f5bfd[_0x586e68(0x1b2)](_0x6bc99f=>_0x6bc99f[_0x586e68(0x228)][_0x586e68(0x238)]||0x0)),_0x34c782=_0x5a55b8['find'](_0x3d6422=>(_0x3d6422['versionNumber']||0x0)===_0x718147);_0x34c782&&(_0x22cd29[_0x586e68(0x21f)]?.[_0x586e68(0x1be)](_0x586e68(0x1f4)+_0x1bcab1[_0x586e68(0x1eb)]+'\x20v'+_0x718147),_0x4d8c8c=await _0xdeb046(_0x34c782['id']));}else{const _0x2da55a=_0x5a55b8[_0x5a55b8[_0x586e68(0x1fc)]-0x1];_0x22cd29[_0x586e68(0x21f)]?.[_0x586e68(0x1be)](_0x586e68(0x1f4)+_0x1bcab1[_0x586e68(0x1eb)]),_0x4d8c8c=await _0xdeb046(_0x2da55a['id']);const _0x1ec109=_0xeed26(_0x2da55a['id']),_0xb5e8d1=await journeyResponseToDef(_0x4d8c8c,_0x1ec109),_0x450ca0=buildLocalRuleToNameMappingFromJourney(_0x1bcab1);_0x458247=buildMergedJourneyDef([{'item':_0x2da55a,'yaml':_0xb5e8d1}],_0x450ca0);}}addFoldersToCreate(_0xd351ed,_0x22cd29['folderPathToId'],_0x501664);const _0x30d291=calculateJourneyDiff(_0x1bcab1,_0x458247);_0xb6929a[_0x586e68(0x1e3)]({'relativePath':_0x1bcab1['name'],'absolutePath':_0x211261,'yamlConfig':_0x1bcab1,'folderPath':_0xd351ed,'existingJourney':_0x4d8c8c,'isNew':_0x30d291[_0x586e68(0x20b)],'hasChanges':_0x30d291[_0x586e68(0x203)],'diff':_0x30d291[_0x586e68(0x17e)]});}return{'journeyFiles':_0xb6929a,'foldersToCreate':_0x501664};}export function calculateActivationActions(_0x264637,_0x30c090,_0x1a26c1,_0x565f3d){const _0x5bbb72=a97_0x560ff4,_0x3d1f07=[],_0x124970=new Map();for(const _0x4539a8 of _0x30c090){_0x124970[_0x5bbb72(0x1dc)](_0x4539a8[_0x5bbb72(0x1eb)],_0x4539a8);}const _0x3a29e1=new Map();for(const _0x1b0e17 of _0x264637){_0x3a29e1[_0x5bbb72(0x1dc)](_0x1b0e17[_0x5bbb72(0x1eb)],_0x1b0e17);}for(const _0x42eb94 of _0x264637){const _0x416219=_0x124970['get'](_0x42eb94['name']);if(!_0x416219)_0x3d1f07[_0x5bbb72(0x1e3)]({'type':_0x5bbb72(0x220),'name':_0x42eb94[_0x5bbb72(0x1eb)],'yamlActivation':_0x42eb94});else{const _0x6d93ce=activationResponseToDef(_0x416219,_0x1a26c1,_0x565f3d),_0x1559af=a97_0xb8392[_0x5bbb72(0x171)](_0x6d93ce),_0x23a266=a97_0xb8392[_0x5bbb72(0x171)](_0x42eb94);_0x1559af!==_0x23a266&&_0x3d1f07['push']({'type':'update','name':_0x42eb94[_0x5bbb72(0x1eb)],'yamlActivation':_0x42eb94,'existingActivation':_0x416219});}}for(const _0x291943 of _0x30c090){!_0x3a29e1['has'](_0x291943[_0x5bbb72(0x1eb)])&&_0x3d1f07[_0x5bbb72(0x1e3)]({'type':_0x5bbb72(0x1ba),'name':_0x291943[_0x5bbb72(0x1eb)],'existingActivation':_0x291943});}return _0x3d1f07;}export function calculateSegmentDiff(_0x3c43e4,_0x1d0e76,_0x52a5fc,_0x392a36,_0x139e00){const _0x1f83e7=segmentToYamlString(_0x3c43e4);if(_0x1d0e76){const _0x2fac99=segmentWithActivationsToYaml(_0x1d0e76,_0x52a5fc,undefined,_0x392a36,_0x139e00),_0x34361e=segmentToYamlString(_0x2fac99),_0x5b579e=generateDiff(_0x34361e,_0x1f83e7),_0x1d2ae5=hasChanges(_0x5b579e);return{'isNew':![],'hasChanges':_0x1d2ae5,'diff':_0x1d2ae5?formatDiffWithColors(_0x5b579e):undefined};}const _0x21a461=generateDiff('',_0x1f83e7);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x21a461)};}export function calculateJourneyDiff(_0x3c908f,_0x4fcdea){const _0x51ee51=normalizeJourneyDef(_0x3c908f,_0x3c908f),_0x30fa21=a97_0x2102e8(_0x51ee51);if(_0x4fcdea){const _0x2aa852=normalizeJourneyDef(_0x4fcdea,_0x3c908f),_0x45ce8f=a97_0x2102e8(_0x2aa852),_0x2887c4=generateDiff(_0x45ce8f,_0x30fa21),_0x479d95=hasChanges(_0x2887c4);return{'isNew':![],'hasChanges':_0x479d95,'diff':_0x479d95?formatDiffWithColors(_0x2887c4):undefined};}const _0x145415=generateDiff('',_0x30fa21);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x145415)};}export function findSegmentsToDelete(_0x3f0117,_0x339c3e,_0x12286f,_0x3719f4,_0x57d561){const _0x5c7e40=a97_0x560ff4,_0x3aa199=new Set();for(const {yamlConfig:_0x3079c8,folderPath:_0x1d9c1d}of _0x339c3e){_0x3aa199[_0x5c7e40(0x188)](_0x1d9c1d+':'+_0x3079c8[_0x5c7e40(0x1eb)]);}return _0x3f0117[_0x5c7e40(0x207)](_0x25009d=>{const _0x9d821e=_0x5c7e40,_0x5ea117=_0x25009d[_0x9d821e(0x185)]?_0x12286f[_0x9d821e(0x1e0)](_0x25009d['segmentFolderId'][_0x9d821e(0x19d)]())||'':'',_0xe9073f=_0x5ea117+':'+_0x25009d['name'];if(_0x3aa199['has'](_0xe9073f))return![];if(_0x57d561)return _0x5ea117===_0x3719f4||_0x5ea117[_0x9d821e(0x152)](_0x3719f4+'/');return!![];});}export function findJourneysToDelete(_0x5196e3,_0x3fc073,_0x3f266a,_0x3e94c9,_0x3e1925){const _0x2dc3ea=a97_0x560ff4,_0x15f486=new Set();for(const {yamlConfig:_0x1f3f61,folderPath:_0x638c8c}of _0x3fc073){_0x15f486['add'](_0x638c8c+':'+_0x1f3f61[_0x2dc3ea(0x1eb)]);}return _0x5196e3[_0x2dc3ea(0x207)](_0x4ee722=>{const _0x18de69=_0x2dc3ea,_0x50d68d=_0x4ee722[_0x18de69(0x1dd)]?_0x3f266a[_0x18de69(0x1e0)](_0x4ee722[_0x18de69(0x1dd)])||'':'',_0x377177=_0x50d68d+':'+_0x4ee722['journeyBundleName'];if(_0x15f486[_0x18de69(0x219)](_0x377177))return![];if(_0x3e1925)return _0x50d68d===_0x3e94c9||_0x50d68d['startsWith'](_0x3e94c9+'/');return!![];});}export function buildSegmentLookupMap(_0x3ac4bc,_0x169ecd){const _0x41b742=a97_0x560ff4,_0x41d48c=new Map();for(const _0x2cb70e of _0x3ac4bc){const _0x548b92=_0x2cb70e[_0x41b742(0x185)]?_0x169ecd[_0x41b742(0x1e0)](_0x2cb70e[_0x41b742(0x185)][_0x41b742(0x19d)]())||'':'',_0x546a67=_0x548b92+':'+_0x2cb70e['name'];_0x41d48c[_0x41b742(0x1dc)](_0x546a67,_0x2cb70e);}return _0x41d48c;}export function buildSegmentNameToIdMap(_0x5e5264){const _0x3bed8f=a97_0x560ff4,_0x17598a=new Map();for(const _0x42e0ff of _0x5e5264){_0x17598a[_0x3bed8f(0x1dc)](_0x42e0ff['name'],_0x42e0ff['id']);}return _0x17598a;}export function buildJourneyBundleLookupMap(_0x4188d1,_0x2f207){const _0x5e1e2e=a97_0x560ff4,_0x3e2807=new Map();for(const _0x5054ff of _0x4188d1){const _0x9b070d=_0x5054ff[_0x5e1e2e(0x1dd)]?_0x2f207['get'](_0x5054ff[_0x5e1e2e(0x1dd)])||'':'',_0x3535bb=_0x9b070d+':'+_0x5054ff[_0x5e1e2e(0x16b)];!_0x3e2807['has'](_0x3535bb)&&_0x3e2807['set'](_0x3535bb,[]),_0x3e2807['get'](_0x3535bb)[_0x5e1e2e(0x1e3)](_0x5054ff);}for(const _0x219fd7 of _0x3e2807['values']()){_0x219fd7[_0x5e1e2e(0x1ee)]((_0x4aa529,_0x285886)=>(_0x4aa529[_0x5e1e2e(0x238)]||0x0)-(_0x285886[_0x5e1e2e(0x238)]||0x0));}return _0x3e2807;}export function collectFoldersToCreate(_0x2ff323,_0x25a833){const _0x19772d=a97_0x560ff4,_0x318df3=new Set();for(const _0x5c4f38 of _0x2ff323){if(!_0x5c4f38)continue;if(_0x25a833[_0x19772d(0x219)](_0x5c4f38))continue;const _0xe148bd=_0x5c4f38[_0x19772d(0x163)]('/');let _0x2eda42='';for(const _0x189bfd of _0xe148bd){_0x2eda42=_0x2eda42?_0x2eda42+'/'+_0x189bfd:_0x189bfd,!_0x25a833['has'](_0x2eda42)&&_0x318df3[_0x19772d(0x188)](_0x2eda42);}}return _0x318df3;}export function parseAndClassifyYamlFiles(_0x45e547,_0x534690,_0x55863b){const _0x431953=a97_0x560ff4,_0x4705eb=[],_0x260653=[];for(const _0x900b9b of _0x45e547){const _0x65e1b0=a97_0x2db96c['relative'](_0x534690,a97_0x2db96c[_0x431953(0x1cc)](_0x900b9b)),_0x481f1a=_0x65e1b0==='.'?'':_0x65e1b0,_0x5f04cf=readFileSync(_0x900b9b,_0x431953(0x236)),_0x433641=a97_0xb8392[_0x431953(0x1a1)](_0x5f04cf);if(isJourneyDef(_0x433641)){const _0x1c1610=a97_0x549390(_0x5f04cf);_0x260653['push']({'yamlConfig':_0x1c1610,'folderPath':_0x481f1a,'sourcePath':_0x900b9b});}else{if(!_0x55863b?.[_0x431953(0x1e7)]){const _0x846256=parseSegmentYamlFile(_0x5f04cf),_0x5a4ebf=normalizeChildSegmentYaml(_0x846256);_0x4705eb[_0x431953(0x1e3)]({'yamlConfig':_0x5a4ebf,'folderPath':_0x481f1a,'sourcePath':_0x900b9b});}}}return{'segments':_0x4705eb,'journeys':_0x260653};}export function validateParsedFiles(_0x1a9cd3,_0x110447){const _0x3cf9f5=a97_0x560ff4,_0x5bf0ec=[];for(const {yamlConfig:_0x42add8,sourcePath:_0x117609}of _0x1a9cd3[_0x3cf9f5(0x1a6)]){const _0x187280=readFileSync(_0x117609,_0x3cf9f5(0x236)),_0xdfa143=a97_0xb8392[_0x3cf9f5(0x1b9)](_0x187280),_0x39f798=validateSegmentDef(_0x42add8,{'source':_0x187280,'document':_0xdfa143});if(!_0x39f798[_0x3cf9f5(0x216)]){const _0x23b515=a97_0x2db96c[_0x3cf9f5(0x1f2)](_0x110447,_0x117609);_0x5bf0ec[_0x3cf9f5(0x1e3)]({'filePath':_0x23b515,'source':_0x187280,'result':_0x39f798,'isJourney':![]});}}for(const {yamlConfig:_0x22b1bf,sourcePath:_0x42451a}of _0x1a9cd3[_0x3cf9f5(0x1d8)]){const _0x542fb6=readFileSync(_0x42451a,_0x3cf9f5(0x236)),_0x403fd5=a97_0xb8392[_0x3cf9f5(0x1b9)](_0x542fb6),_0x325d42=validateJourneyDef(_0x22b1bf,{'source':_0x542fb6,'document':_0x403fd5});if(!_0x325d42[_0x3cf9f5(0x216)]){const _0x23dab1=a97_0x2db96c[_0x3cf9f5(0x1f2)](_0x110447,_0x42451a);_0x5bf0ec[_0x3cf9f5(0x1e3)]({'filePath':_0x23dab1,'source':_0x542fb6,'result':_0x325d42,'isJourney':!![]});}}return _0x5bf0ec;}export function formatValidationErrors(_0x25a323){const _0x7cfdd6=a97_0x560ff4,_0x5b1c9c=[];for(const {filePath:_0x51161b,source:_0x58eca1,result:_0x30d348,isJourney:_0x27b320}of _0x25a323){const _0x30ee21=_0x27b320?_0x7cfdd6(0x22a):_0x7cfdd6(0x22f);_0x5b1c9c[_0x7cfdd6(0x1e3)]('\x0a'+_0x51161b+'\x20('+_0x30ee21+_0x7cfdd6(0x22d)+_0x30d348[_0x7cfdd6(0x18e)][_0x7cfdd6(0x1fc)]+_0x7cfdd6(0x1f8)),_0x5b1c9c[_0x7cfdd6(0x1e3)](formatValidationResult(_0x30d348,_0x58eca1,_0x51161b));}return _0x5b1c9c['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x2bf80d){const _0x510885=a97_0x560ff4,_0x3c784c=new Set(),_0x10f391=new Map(),_0x440ad0=collectSegmentUsageCounts(_0x2bf80d);if(_0x2bf80d[_0x510885(0x1a6)])for(const [_0xc0fab2,_0x3a75c1]of Object[_0x510885(0x1f0)](_0x2bf80d[_0x510885(0x1a6)])){_0x3c784c[_0x510885(0x188)](_0xc0fab2);if(_0x3a75c1[_0x510885(0x1f1)]){const _0x2b5835=yamlRuleToApi(_0x3a75c1[_0x510885(0x1f1)]),_0x23ec00=apiRuleToYaml(_0x2b5835);_0x10f391[_0x510885(0x1dc)](_0xc0fab2,_0x23ec00);}}const _0x168883=new Map();let _0x17794a=0x0;for(const [_0x4e60c5,_0x373d6c]of _0x10f391){const _0x33e381=serializeExpandedRule(_0x373d6c,_0x10f391),_0x5776c4=_0x168883[_0x510885(0x1e0)](_0x33e381)||[];_0x5776c4[_0x510885(0x1e3)]({'name':_0x4e60c5,'index':_0x17794a}),_0x168883[_0x510885(0x1dc)](_0x33e381,_0x5776c4),_0x17794a++;}const _0x34b5de=new Map();for(const [_0x2eec24,_0x1ebd6c]of _0x168883){const _0x585c9=_0x1ebd6c[_0x510885(0x223)]()['sort']((_0x298cf4,_0x11722f)=>{const _0x5d69ac=_0x510885,_0xc0a177=_0x440ad0[_0x5d69ac(0x1e0)](_0x298cf4[_0x5d69ac(0x1eb)])||0x0,_0x3f72c1=_0x440ad0['get'](_0x11722f[_0x5d69ac(0x1eb)])||0x0;if(_0xc0a177!==_0x3f72c1)return _0x3f72c1-_0xc0a177;return _0x298cf4[_0x5d69ac(0x190)]-_0x11722f[_0x5d69ac(0x190)];})[_0x510885(0x1b2)](_0x231f11=>_0x231f11[_0x510885(0x1eb)]),_0x13c58c=[];for(const _0x2f3ef6 of _0x585c9){const _0x3a18ef=_0x440ad0['get'](_0x2f3ef6)||0x0,_0x539906=Math[_0x510885(0x229)](_0x3a18ef,0x1);for(let _0x4060d6=0x0;_0x4060d6<_0x539906;_0x4060d6++){_0x13c58c[_0x510885(0x1e3)](_0x2f3ef6);}}_0x34b5de[_0x510885(0x1dc)](_0x2eec24,_0x13c58c);}return{'existingLocalSegmentNames':_0x3c784c,'localSegmentRules':_0x10f391,'localExpandedRuleToNames':_0x34b5de};}async function buildServerSegmentRuleMap(_0x534005,_0x58ca4c,_0x119e86,_0x1ad652){const _0x1dd72c=new Map(),_0x3a86d3=new Set(),_0x371b5b=async _0x698588=>{const _0x256dcf=a97_0x1212;if(_0x3a86d3[_0x256dcf(0x219)](_0x698588))return;_0x3a86d3[_0x256dcf(0x188)](_0x698588);let _0x224a4a=_0x119e86['find'](_0x17d6b4=>_0x17d6b4['id']===_0x698588);if(!_0x224a4a)try{_0x224a4a=await _0x534005[_0x256dcf(0x22f)][_0x256dcf(0x1d6)](_0x58ca4c,_0x698588);}catch{return;}if(!_0x224a4a?.['rule'])return;const _0x55324c=apiRuleToYaml(_0x224a4a[_0x256dcf(0x1f1)]);_0x1dd72c['set'](_0x698588,_0x55324c);const _0x25955e=collectSegmentRefsFromRule(_0x55324c);for(const _0x3204fe of _0x25955e){await _0x371b5b(_0x3204fe);}};for(const _0x26e9dc of _0x1ad652){await _0x371b5b(_0x26e9dc);}return _0x1dd72c;}export function createSegmentIdResolver(_0x5aeb48,_0x4b0063){return async _0x4d22b8=>{const _0x51790b=a97_0x1212,_0x3db8cc=_0x5aeb48[_0x51790b(0x1e0)](_0x4d22b8);if(!_0x3db8cc)throw new SDKError(ErrorCode[_0x51790b(0x161)],_0x51790b(0x1a4)+_0x4d22b8+_0x51790b(0x1e5)+_0x4b0063+'\x27)');return _0x3db8cc;};}export function extractRootFolderId(_0x42e494){const _0x130d28=a97_0x560ff4;return _0x42e494['relationships']?.[_0x130d28(0x1fe)]?.[_0x130d28(0x154)]?.['id']||_0x42e494[_0x130d28(0x166)]?.[_0x130d28(0x1b8)]?.['data']?.['id'];}export function buildConnectionMaps(_0x120cc0){const _0x153253=a97_0x560ff4,_0x48f753=new Map(),_0x3a3351=new Map(),_0x197abf=new Map();for(const _0x47f254 of _0x120cc0){_0x48f753[_0x153253(0x1dc)](_0x47f254[_0x153253(0x1eb)],parseInt(_0x47f254['id'],0xa)),_0x3a3351[_0x153253(0x1dc)](_0x47f254['id'],_0x47f254[_0x153253(0x1eb)]),_0x197abf[_0x153253(0x1dc)](_0x47f254[_0x153253(0x1eb)],_0x47f254[_0x153253(0x1f7)]);}return{'nameToId':_0x48f753,'idToName':_0x3a3351,'nameToType':_0x197abf};}export function calculatePushStats(_0x5a0750,_0xdd14d7,_0x2337ed,_0x3c2a32,_0x2b12a7,_0x3888d8,_0x359da8){const _0xd896a8=a97_0x560ff4,_0x4fe4ce=_0x5a0750[_0xd896a8(0x207)](_0x20b319=>_0x20b319[_0xd896a8(0x20b)]),_0x1173c6=_0x5a0750[_0xd896a8(0x207)](_0x27ffee=>!_0x27ffee['isNew']&&_0x27ffee['hasChanges']),_0x32b5f2=_0x5a0750['filter'](_0x43205b=>!_0x43205b[_0xd896a8(0x20b)]&&!_0x43205b['hasChanges']),_0xa67c1e=_0x3888d8?_0x3c2a32:[],_0x5e1675=_0xdd14d7[_0xd896a8(0x207)](_0x356d02=>_0x356d02[_0xd896a8(0x20b)]),_0x23b922=_0xdd14d7[_0xd896a8(0x207)](_0x556d55=>!_0x556d55['isNew']&&_0x556d55[_0xd896a8(0x203)]),_0x3d38f1=_0xdd14d7[_0xd896a8(0x207)](_0x43f00b=>!_0x43f00b[_0xd896a8(0x20b)]&&!_0x43f00b[_0xd896a8(0x203)]),_0xf9e8a5=_0x3888d8?_0x2b12a7:[],_0x223f1a=_0x5a0750[_0xd896a8(0x221)](_0x25f0a7=>_0x25f0a7[_0xd896a8(0x235)]),_0x399abe=_0x223f1a['filter'](_0x5a68ba=>_0x5a68ba[_0xd896a8(0x1f7)]===_0xd896a8(0x220)),_0x18d834=_0x223f1a['filter'](_0x49ea52=>_0x49ea52[_0xd896a8(0x1f7)]===_0xd896a8(0x1be)),_0x3f0c16=_0x223f1a[_0xd896a8(0x207)](_0x5abb68=>_0x5abb68[_0xd896a8(0x1f7)]==='delete'),_0x2c2b88=Array[_0xd896a8(0x178)](_0x2337ed)[_0xd896a8(0x1ee)](),_0x1c6372=_0x359da8?![]:_0x4fe4ce['length']>0x0||_0x1173c6[_0xd896a8(0x1fc)]>0x0||_0xa67c1e[_0xd896a8(0x1fc)]>0x0,_0x16e5b3=_0x5e1675[_0xd896a8(0x1fc)]>0x0||_0x23b922['length']>0x0||_0xf9e8a5[_0xd896a8(0x1fc)]>0x0,_0x10d45f=_0x359da8?![]:_0x223f1a[_0xd896a8(0x1fc)]>0x0,_0x4c5644=_0x2c2b88['length']>0x0;return{'segments':{'new':_0x4fe4ce,'changed':_0x1173c6,'unchanged':_0x32b5f2,'toDelete':_0xa67c1e},'journeys':{'new':_0x5e1675,'changed':_0x23b922,'unchanged':_0x3d38f1,'toDelete':_0xf9e8a5},'activations':{'all':_0x223f1a,'toCreate':_0x399abe,'toUpdate':_0x18d834,'toDelete':_0x3f0c16},'folders':{'toCreate':_0x2c2b88},'counts':{'segments':{'new':_0x4fe4ce[_0xd896a8(0x1fc)],'changed':_0x1173c6['length'],'unchanged':_0x32b5f2['length'],'toDelete':_0xa67c1e[_0xd896a8(0x1fc)]},'journeys':{'new':_0x5e1675['length'],'changed':_0x23b922[_0xd896a8(0x1fc)],'unchanged':_0x3d38f1[_0xd896a8(0x1fc)],'toDelete':_0xf9e8a5[_0xd896a8(0x1fc)]},'activations':{'create':_0x399abe[_0xd896a8(0x1fc)],'update':_0x18d834[_0xd896a8(0x1fc)],'delete':_0x3f0c16['length']},'folders':_0x2c2b88[_0xd896a8(0x1fc)]},'hasChanges':_0x1c6372||_0x16e5b3||_0x10d45f||_0x4c5644};}export async function buildPushExecutionContext(_0x356962,_0x842a40,_0x50d738,_0x11f436,_0x335fe2,_0x1dc97d){const _0x49d8f9=a97_0x560ff4,_0x1c1cdb=extractRootFolderId(_0x50d738),{pathToId:_0x4e2735,idToPath:_0x2afb90}=buildFolderMaps(_0x335fe2),_0x8786d5=buildSegmentNameToIdMap(_0x11f436),_0x378df5=new Map(),{batchAsync:_0xf91aea}=await import(_0x49d8f9(0x1d7)),[_0x1922be,_0x23a06a]=await Promise[_0x49d8f9(0x160)]([_0x356962[_0x49d8f9(0x214)][_0x49d8f9(0x179)](),_0x356962[_0x49d8f9(0x1ae)][_0x49d8f9(0x1c7)](),((async()=>{const _0x5eed9b=_0x49d8f9;!_0x1dc97d&&_0x11f436[_0x5eed9b(0x1fc)]>0x0&&await _0xf91aea(_0x11f436,async _0x387f36=>{const _0x545bda=_0x5eed9b,_0x4379df=await _0x356962[_0x545bda(0x22f)]['listActivations'](_0x842a40,_0x387f36['id']);_0x378df5[_0x545bda(0x1dc)](_0x387f36['id'],_0x4379df);});})())]),{emailToId:_0xf506b4,idToEmail:_0x3d51c2}=_0x1922be,_0x264212=buildConnectionMaps(_0x23a06a);return{'rootFolderId':_0x1c1cdb,'folderPathToId':_0x4e2735,'folderIdToPath':_0x2afb90,'segmentNameToId':_0x8786d5,'activationsBySegmentId':_0x378df5,'emailToIdMap':_0xf506b4,'idToEmailMap':_0x3d51c2,'connectionNameToIdMap':_0x264212[_0x49d8f9(0x1ff)],'connectionIdToNameMap':_0x264212['idToName'],'connectionNameToTypeMap':_0x264212[_0x49d8f9(0x17a)]};}export function createPushYamlContextForBundle(_0x391d43,_0x4ce54e,_0xfda393,_0x3f5064,_0x2ebb4d,_0x4cee59,_0x497795,_0xe1ae82){const {existingLocalSegmentNames:_0x1d9a4e,localExpandedRuleToNames:_0x4c91ca}=_0x3f5064,_0x14d525=new Set(),_0x693b33=new Map(),_0x1cdafc=new Set(),_0x4b6a32=new Map(),_0x1925fa=new Map(),_0x456989=createJumpTargetCache(),_0x4f1525=new Map(),_0x443ba1=new Map(),_0x23c676=new Set();let _0x57ac18;const _0x2a6500=_0x5a85b9=>{const _0x343e15={'resolveSegment':async _0x84207f=>{const _0x68f589=a97_0x1212,_0x4e593f=_0x1925fa[_0x68f589(0x1e0)](_0x84207f);if(_0x4e593f!==undefined)return{'name':_0x4e593f,'isJourneyLocal':!![]};try{let _0x51850a=_0xfda393[_0x68f589(0x16e)](_0x4ec7f2=>_0x4ec7f2['id']===_0x84207f);!_0x51850a&&(_0x51850a=await _0x391d43[_0x68f589(0x22f)][_0x68f589(0x1d6)](_0x4ce54e,_0x84207f));const _0x5c6628=generateJourneyLocalName(_0x51850a[_0x68f589(0x1eb)]),_0x42f01d=_0x51850a[_0x68f589(0x19b)]===SEGMENT_KIND_JOURNEY&&_0x5c6628!==undefined;let _0x26a0b8=_0x51850a[_0x68f589(0x1eb)],_0x486460;if(_0x42f01d&&_0x51850a['rule']){const _0x57b71c=apiRuleToYaml(_0x51850a['rule']);_0x443ba1[_0x68f589(0x1dc)](_0x84207f,_0x57b71c);const _0x4a61cc=async _0x31936a=>{const _0x2916d6=_0x68f589,_0x9bed2d=collectSegmentRefsFromRule(_0x31936a);for(const _0x45ab37 of _0x9bed2d){if(!_0x443ba1['has'](_0x45ab37))try{const _0x5adb5d=await _0x391d43[_0x2916d6(0x22f)][_0x2916d6(0x1d6)](_0x4ce54e,_0x45ab37);if(_0x5adb5d?.['rule']){const _0x4dfc34=apiRuleToYaml(_0x5adb5d[_0x2916d6(0x1f1)]);_0x443ba1[_0x2916d6(0x1dc)](_0x45ab37,_0x4dfc34),await _0x4a61cc(_0x4dfc34);}}catch{}}};await _0x4a61cc(_0x57b71c);const _0x1ee747=serializeExpandedRule(_0x57b71c,_0x443ba1),_0x31c223=_0x4c91ca[_0x68f589(0x1e0)](_0x1ee747);if(_0x31c223&&_0x31c223[_0x68f589(0x1fc)]>0x0){const _0x5c6ef3=_0x693b33[_0x68f589(0x1e0)](_0x1ee747)||0x0,_0x26bfe6=_0x31c223[_0x5c6ef3]||_0x31c223[_0x31c223[_0x68f589(0x1fc)]-0x1];_0x693b33['set'](_0x1ee747,_0x5c6ef3+0x1),_0x26a0b8=_0x26bfe6,_0x14d525[_0x68f589(0x188)](_0x26a0b8),_0x1925fa['set'](_0x84207f,_0x26a0b8);const _0x38a7ff=await resolveRuleSegmentRefs(_0x57b71c,async _0x3c9915=>{const _0x5275a9=_0x68f589,_0x56c3ab=_0x1925fa['get'](_0x3c9915);if(_0x56c3ab)return _0x56c3ab;const _0x4e8e19=await _0x57ac18[_0x5275a9(0x1c0)](_0x3c9915);return _0x4e8e19[_0x5275a9(0x1eb)];});_0x486460={'description':_0x51850a[_0x68f589(0x15a)],'rule':_0x38a7ff};}else{const _0x1ebedb=_0x4f1525['get'](_0x1ee747);if(_0x1ebedb)_0x26a0b8=_0x1ebedb,_0x1925fa[_0x68f589(0x1dc)](_0x84207f,_0x26a0b8);else{if(_0x5c6628){let _0x4b504f=_0x5c6628,_0x777c43=0x2;while(_0x14d525[_0x68f589(0x219)](_0x4b504f)||_0x1d9a4e[_0x68f589(0x219)](_0x4b504f)){_0x4b504f=_0x5c6628+'_'+_0x777c43,_0x777c43++;}_0x14d525[_0x68f589(0x188)](_0x4b504f),_0x26a0b8=_0x4b504f;}_0x1925fa[_0x68f589(0x1dc)](_0x84207f,_0x26a0b8),_0x4f1525['set'](_0x1ee747,_0x26a0b8);const _0x113512=await resolveRuleSegmentRefs(_0x57b71c,async _0x3ef2b9=>{const _0x3caaf0=_0x68f589,_0x17bc2b=_0x1925fa[_0x3caaf0(0x1e0)](_0x3ef2b9);if(_0x17bc2b)return _0x17bc2b;const _0xef1e5=await _0x57ac18[_0x3caaf0(0x1c0)](_0x3ef2b9);return _0xef1e5['name'];});_0x486460={'description':_0x51850a[_0x68f589(0x15a)],'rule':_0x113512};}}}return{'name':_0x26a0b8,'isJourneyLocal':_0x42f01d,'definition':_0x486460};}catch{return{'name':_0x84207f,'isJourneyLocal':![]};}},'resolveActivation':async _0x47235c=>{const _0x1bf3ed=a97_0x1212,_0x44281f=_0x4b6a32[_0x1bf3ed(0x1e0)](_0x47235c);if(_0x44281f!==undefined)return{'name':_0x44281f,'isJourneyLocal':!![]};try{let _0x2f0eb6=_0x497795?.[_0x1bf3ed(0x1e0)](_0x47235c);!_0x2f0eb6&&(_0x2f0eb6=await _0x391d43[_0x1bf3ed(0x22a)]['getActivation'](_0x5a85b9,_0x47235c));const _0x2f5604=_0x2f0eb6[_0x1bf3ed(0x1bc)][_0x1bf3ed(0x184)][_0x1bf3ed(0x1eb)]||_0x47235c,_0x5413d1=sanitizeYamlKey(_0x2f5604)||'activation_'+_0x47235c;let _0x48e01f=_0x5413d1,_0x3e1eb2=0x2;while(_0x1cdafc[_0x1bf3ed(0x219)](_0x48e01f)){_0x48e01f=_0x5413d1+'_'+_0x3e1eb2,_0x3e1eb2++;}_0x1cdafc[_0x1bf3ed(0x188)](_0x48e01f),_0x4b6a32[_0x1bf3ed(0x1dc)](_0x47235c,_0x48e01f);const _0x249bcb=journeyActivationStepToYaml(_0x2f0eb6,_0x2ebb4d,_0x4cee59);return{'name':_0x48e01f,'isJourneyLocal':!![],'definition':_0x249bcb};}catch{return{'name':_0x47235c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x14d32c,_0x3816a4)=>resolveJumpTarget(_0x14d32c,_0x3816a4,_0x456989,async _0x49d576=>{const _0x533449=a97_0x1212,_0x221542=_0xe1ae82?.[_0x533449(0x1e0)](_0x49d576);if(_0x221542)return _0x221542;return _0x391d43[_0x533449(0x22a)][_0x533449(0x172)](_0x49d576);})};return _0x57ac18=_0x343e15,_0x343e15;},_0x3b346d=async _0x74ab31=>{const _0x3a0891=a97_0x1212,{collectSegmentIdsFromJourneyApi:_0x17af12}=await import(_0x3a0891(0x155)),{batchAsync:_0xb3278a}=await import(_0x3a0891(0x1d7)),_0x538fa8=new Set();for(const _0xbeca48 of _0x74ab31){let _0x3c6f4a=_0xe1ae82?.['get'](_0xbeca48);!_0x3c6f4a&&(_0x3c6f4a=await _0x391d43[_0x3a0891(0x22a)][_0x3a0891(0x172)](_0xbeca48));const _0x213919=_0x17af12(_0x3c6f4a);for(const _0x559150 of _0x213919){_0x538fa8[_0x3a0891(0x188)](_0x559150);}}let _0x3e3abd=Array[_0x3a0891(0x178)](_0x538fa8);while(_0x3e3abd[_0x3a0891(0x1fc)]>0x0){const _0x268e8a=_0x3e3abd[_0x3a0891(0x207)](_0x5dc85b=>!_0x23c676['has'](_0x5dc85b));if(_0x268e8a[_0x3a0891(0x1fc)]===0x0)break;const _0x154723=await _0xb3278a(_0x268e8a,async _0x268232=>{const _0x305d1f=_0x3a0891;_0x23c676[_0x305d1f(0x188)](_0x268232);let _0x545c7e=_0xfda393[_0x305d1f(0x16e)](_0x7f695f=>_0x7f695f['id']===_0x268232);if(!_0x545c7e)try{_0x545c7e=await _0x391d43['segment'][_0x305d1f(0x1d6)](_0x4ce54e,_0x268232);}catch{return null;}return{'segmentId':_0x268232,'segment':_0x545c7e};},0xa),_0x1b9388=new Set();for(const _0x2f4ad6 of _0x154723){if(!_0x2f4ad6?.[_0x3a0891(0x22f)]?.['rule'])continue;const _0x4601b8=apiRuleToYaml(_0x2f4ad6[_0x3a0891(0x22f)]['rule']);_0x443ba1[_0x3a0891(0x1dc)](_0x2f4ad6[_0x3a0891(0x17b)],_0x4601b8);const _0x25d35a=collectSegmentRefsFromRule(_0x4601b8);for(const _0x4b50d1 of _0x25d35a){!_0x23c676[_0x3a0891(0x219)](_0x4b50d1)&&_0x1b9388[_0x3a0891(0x188)](_0x4b50d1);}}_0x3e3abd=Array['from'](_0x1b9388);}};return{'createYamlContext':_0x2a6500,'prefetchJourneySegments':_0x3b346d};}export async function executePushSegments(_0x237086,_0x3d8685,_0x10e2a4,_0xe68e60,_0x179af4){const _0x3b3b05=a97_0x560ff4,{segmentDefToCreateRequest:_0x2807c7,segmentDefToUpdateRequest:_0xdf6594}=await import(_0x3b3b05(0x205)),_0x46a043=_0x10e2a4[_0x3b3b05(0x158)],_0x551c41=0x5,_0x5e76ad=async _0x40012a=>{const _0x2f8836=_0x3b3b05,_0x45f2f5=_0x40012a[_0x2f8836(0x194)]?_0x46a043['get'](_0x40012a[_0x2f8836(0x194)]):undefined;let _0x545fb1;const _0x2ea72f={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x40012a[_0x2f8836(0x20b)]){_0x179af4[_0x2f8836(0x15c)]?.({'type':'segment_creating','name':_0x40012a['yamlConfig']['name']});const _0x454752=_0x2807c7(_0x40012a[_0x2f8836(0x1a5)],_0x45f2f5),_0x5b3cd4=await _0x179af4[_0x2f8836(0x18f)](_0x2f8836(0x1cf)+_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)]+_0x2f8836(0x224),()=>_0x237086[_0x2f8836(0x22f)][_0x2f8836(0x208)](_0xe68e60[_0x2f8836(0x226)],_0x454752));_0x545fb1=_0x5b3cd4[_0x2f8836(0x154)]['id'],_0x2ea72f[_0x2f8836(0x164)]={'name':_0x40012a['yamlConfig'][_0x2f8836(0x1eb)],'id':_0x545fb1},_0x179af4[_0x2f8836(0x15c)]?.({'type':_0x2f8836(0x234),'name':_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)],'segmentId':_0x545fb1}),_0x179af4['logSuccess']?.(_0x2f8836(0x1fb)+_0x40012a[_0x2f8836(0x1a5)]['name']+'\x27'),_0x2ea72f[_0x2f8836(0x162)]=0x1;}else{if(_0x40012a[_0x2f8836(0x203)]){_0x179af4['onProgress']?.({'type':_0x2f8836(0x195),'name':_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)]});const _0xfeb70d=_0xdf6594(_0x40012a[_0x2f8836(0x1a5)]);_0x45f2f5!==_0x40012a['existingSegment']?.[_0x2f8836(0x185)]&&(_0xfeb70d[_0x2f8836(0x185)]=_0x45f2f5?parseInt(_0x45f2f5,0xa):undefined),await _0x179af4['withProgress']('Updating\x20segment\x20\x27'+_0x40012a['yamlConfig'][_0x2f8836(0x1eb)]+_0x2f8836(0x224),()=>_0x237086[_0x2f8836(0x22f)][_0x2f8836(0x1d2)](_0xe68e60[_0x2f8836(0x226)],_0x40012a[_0x2f8836(0x16c)]['id'],_0xfeb70d)),_0x545fb1=_0x40012a[_0x2f8836(0x16c)]['id'],_0x179af4['onProgress']?.({'type':_0x2f8836(0x1c1),'name':_0x40012a['yamlConfig'][_0x2f8836(0x1eb)]}),_0x179af4[_0x2f8836(0x1c6)]?.('Updated\x20segment\x20\x27'+_0x40012a[_0x2f8836(0x1a5)]['name']+'\x27'),_0x2ea72f[_0x2f8836(0x1e6)]=0x1;}else _0x545fb1=_0x40012a['existingSegment']['id'];}}catch(_0x29445f){const _0x500320=isHttp400Error(_0x29445f),_0x564ad6=_0x500320?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x2f8836(0x1cb)],_0x11d4d6=getErrorMessage(_0x29445f);throw new SDKError(_0x564ad6,_0x2f8836(0x230)+(_0x40012a[_0x2f8836(0x20b)]?_0x2f8836(0x220):_0x2f8836(0x1be))+'\x20segment\x20from\x20file:\x20'+_0x40012a[_0x2f8836(0x156)]+_0x2f8836(0x1ce)+_0x11d4d6,_0x29445f);}try{const _0x36672b=await syncActivationsForSegment(_0x237086,_0xe68e60[_0x2f8836(0x226)],_0x545fb1,_0x40012a['yamlConfig']['name'],_0x40012a[_0x2f8836(0x235)],_0x179af4,_0x40012a['absolutePath']);_0x2ea72f[_0x2f8836(0x218)]=_0x36672b;}catch(_0x4ad1a3){if(_0x4ad1a3 instanceof SDKError)throw _0x4ad1a3;throw new SDKError(ErrorCode[_0x2f8836(0x22b)],_0x2f8836(0x1a8)+_0x40012a[_0x2f8836(0x1a5)][_0x2f8836(0x1eb)]+_0x2f8836(0x16d)+_0x40012a[_0x2f8836(0x156)]+'\x0a\x20\x20'+getErrorMessage(_0x4ad1a3),_0x4ad1a3);}return _0x2ea72f;},_0x288cd0=await batchAsync(_0x3d8685,_0x5e76ad,_0x551c41),_0x10de56={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x21dfdd of _0x288cd0){_0x10de56[_0x3b3b05(0x162)]+=_0x21dfdd[_0x3b3b05(0x162)],_0x10de56[_0x3b3b05(0x1e6)]+=_0x21dfdd['updated'],_0x21dfdd[_0x3b3b05(0x164)]&&_0x10de56[_0x3b3b05(0x20c)][_0x3b3b05(0x1dc)](_0x21dfdd[_0x3b3b05(0x164)][_0x3b3b05(0x1eb)],_0x21dfdd[_0x3b3b05(0x164)]['id']),_0x10de56[_0x3b3b05(0x218)][_0x3b3b05(0x162)]+=_0x21dfdd[_0x3b3b05(0x218)][_0x3b3b05(0x162)],_0x10de56['activations'][_0x3b3b05(0x1e6)]+=_0x21dfdd[_0x3b3b05(0x218)][_0x3b3b05(0x1e6)],_0x10de56[_0x3b3b05(0x218)][_0x3b3b05(0x1a7)]+=_0x21dfdd[_0x3b3b05(0x218)][_0x3b3b05(0x1a7)];}return _0x10de56;}async function syncActivationsForSegment(_0x51e575,_0x3c5fcc,_0x33bc63,_0x5702d3,_0x2110ed,_0x2d77d3,_0x20e595){const _0x4ceb60=a97_0x560ff4,_0x4881e2={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x26f601 of _0x2110ed){try{if(_0x26f601[_0x4ceb60(0x1f7)]===_0x4ceb60(0x220)&&_0x26f601[_0x4ceb60(0x231)])_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':'activation_creating','segmentName':_0x5702d3,'activationName':_0x26f601['name']}),await _0x2d77d3['withProgress']('Creating\x20activation\x20\x27'+_0x26f601[_0x4ceb60(0x1eb)]+_0x4ceb60(0x224),()=>_0x51e575[_0x4ceb60(0x22f)]['createActivation'](_0x3c5fcc,_0x33bc63,_0x26f601['validatedRequest'])),_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':_0x4ceb60(0x19f),'segmentName':_0x5702d3,'activationName':_0x26f601['name']}),_0x2d77d3[_0x4ceb60(0x1c6)]?.('Created\x20activation\x20\x27'+_0x26f601[_0x4ceb60(0x1eb)]+'\x27'),_0x4881e2[_0x4ceb60(0x162)]++;else{if(_0x26f601[_0x4ceb60(0x1f7)]===_0x4ceb60(0x1be)&&_0x26f601[_0x4ceb60(0x231)]&&_0x26f601['existingActivation'])_0x2d77d3['onProgress']?.({'type':_0x4ceb60(0x202),'segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),await _0x2d77d3[_0x4ceb60(0x18f)](_0x4ceb60(0x232)+_0x26f601['name']+_0x4ceb60(0x224),()=>_0x51e575['segment'][_0x4ceb60(0x1c2)](_0x3c5fcc,_0x33bc63,_0x26f601[_0x4ceb60(0x15b)]['id'],_0x26f601[_0x4ceb60(0x231)])),_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':'activation_updated','segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),_0x2d77d3['logSuccess']?.(_0x4ceb60(0x1ca)+_0x26f601['name']+'\x27'),_0x4881e2[_0x4ceb60(0x1e6)]++;else _0x26f601[_0x4ceb60(0x1f7)]===_0x4ceb60(0x1ba)&&_0x26f601[_0x4ceb60(0x15b)]&&(_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':_0x4ceb60(0x21a),'segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),await _0x2d77d3['withProgress'](_0x4ceb60(0x186)+_0x26f601[_0x4ceb60(0x1eb)]+_0x4ceb60(0x224),()=>_0x51e575[_0x4ceb60(0x22f)][_0x4ceb60(0x21d)](_0x3c5fcc,_0x33bc63,_0x26f601[_0x4ceb60(0x15b)]['id'])),_0x2d77d3[_0x4ceb60(0x15c)]?.({'type':_0x4ceb60(0x151),'segmentName':_0x5702d3,'activationName':_0x26f601[_0x4ceb60(0x1eb)]}),_0x2d77d3['logDeleted']?.(_0x4ceb60(0x197)+_0x26f601['name']+'\x27'),_0x4881e2['deleted']++);}}catch(_0x3b8caf){const _0x3ec439=isHttp400Error(_0x3b8caf),_0x15819c=_0x3ec439?ErrorCode[_0x4ceb60(0x16f)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x531b41=getErrorMessage(_0x3b8caf);throw new SDKError(_0x15819c,_0x4ceb60(0x230)+_0x26f601['type']+_0x4ceb60(0x20d)+_0x26f601[_0x4ceb60(0x1eb)]+_0x4ceb60(0x16d)+_0x20e595+'\x0a\x20\x20'+_0x531b41,_0x3b8caf);}}return _0x4881e2;}export async function executePushFolders(_0x115a22,_0x19ebd2,_0xa28377,_0x1422c9,_0x5ccafb){const _0x3eb588=a97_0x560ff4,_0x3abd6f=new Map(_0xa28377);for(const _0x403b8f of _0x19ebd2){const _0x581f9a=_0x403b8f['split']('/'),_0x2714e2=_0x581f9a[_0x581f9a[_0x3eb588(0x1fc)]-0x1],_0x38f44b=_0x581f9a['slice'](0x0,-0x1)[_0x3eb588(0x239)]('/'),_0x4ec414=_0x3abd6f['get'](_0x38f44b);_0x5ccafb['onProgress']?.({'type':_0x3eb588(0x153),'folder':_0x403b8f});const _0x393e93={'name':_0x2714e2,'parentFolderId':_0x4ec414},_0x58cd15=await _0x5ccafb[_0x3eb588(0x18f)](_0x3eb588(0x169)+_0x403b8f+_0x3eb588(0x224),()=>_0x115a22[_0x3eb588(0x22f)][_0x3eb588(0x1e2)](_0x1422c9[_0x3eb588(0x226)],_0x393e93));_0x3abd6f[_0x3eb588(0x1dc)](_0x403b8f,_0x58cd15[_0x3eb588(0x154)]['id']),_0x5ccafb[_0x3eb588(0x15c)]?.({'type':'folder_created','folder':_0x403b8f,'folderId':_0x58cd15[_0x3eb588(0x154)]['id']}),_0x5ccafb[_0x3eb588(0x1bf)]?.(_0x3eb588(0x1d4)+_0x403b8f+'\x27');}return _0x3abd6f;}export async function executePushSegmentDeletions(_0x18ca53,_0x510fef,_0x1fe888){const _0x40c683=a97_0x560ff4;if(_0x510fef[_0x40c683(0x1fc)]===0x0)return 0x0;const {batchAsync:_0x4b0483}=await import(_0x40c683(0x1d7)),_0x144e23=0x5,_0x140298=await _0x4b0483(_0x510fef,async _0x56686c=>{const _0x2e0ca5=_0x40c683;return _0x1fe888[_0x2e0ca5(0x15c)]?.({'type':_0x2e0ca5(0x17d),'name':_0x56686c[_0x2e0ca5(0x1eb)]}),await _0x18ca53['segment'][_0x2e0ca5(0x1c9)](_0x56686c['id']),_0x1fe888['onProgress']?.({'type':_0x2e0ca5(0x19c),'name':_0x56686c[_0x2e0ca5(0x1eb)]}),_0x1fe888[_0x2e0ca5(0x191)]?.(_0x2e0ca5(0x165)+_0x56686c[_0x2e0ca5(0x1eb)]+'\x27'),0x1;},_0x144e23);return _0x140298[_0x40c683(0x175)]((_0xd1422b,_0x139f26)=>_0xd1422b+_0x139f26,0x0);}function a97_0x5250(){const _0x11ed1e=['__pending_act_','map','schedule','journeyActivationStepId','JOURNEY_UPDATE_ERROR','INTERNAL','\x27\x20milestone','parentFolder','parseDocument','delete','embedded_segment_creating','attributes','state','update','logInfo','resolveSegment','segment_updated','updateActivation','deps','digest','10128168eeGHIj','logSuccess','list','yamlActivation','deleteSegment','Updated\x20activation\x20\x27','SEGMENT_UPDATE_ERROR','dirname','\x20(referenced\x20in\x20journey\x20','\x0a\x20\x20','Creating\x20segment\x20\x27','stages','listActivations','updateSegmentById','activationContext','Created\x20folder\x20\x27','listSegments','getSegment','../../utils/async.js','journeys','journeyBundlesByFolderAndName','\x27\x20decision\x20point\x20branch\x20\x27','verbose','set','folderId','4yiUkaJ','steps','get',').\x20','createFolder','push','results','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','updated','skipSegments','journey_updated','Activation\x20not\x20found:\x20','null','name','journey_entry_criteria_','entryCriteria','sort','idToEmailMap','entries','rule','relative','274768biWlOp','Fetching\x20','journeyStages','toLowerCase','type','\x20error(s)','embedded_activation_creating','connectionIdToNameMap','Created\x20segment\x20\x27','length','createJourneySegment','parentSegmentFolder','nameToId','journey_created','trim','activation_updating','hasChanges','resolveJourneyId','./child-segment-yaml.js','branches','filter','createSegment','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Created\x20journey\x20\x27','isNew','createdSegmentIds','\x20activation\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','1630272jIsyQV','draft','effectiveFolderId','40577823bFJoxo','connector_config','user','folder','valid','goal\x20criteria','activations','has','activation_deleting','notification','8028230SyKSuP','deleteActivation','20RURVYL','progress','create','flatMap','activation_template_id','slice','\x27...','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','parentId','message','item','max','journey','ACTIVATION_UPDATE_ERROR','NOT_FOUND','):\x20','entry_criteria','segment','Failed\x20to\x20','validatedRequest','Updating\x20activation\x20\x27','createActivation','segment_created','activationActions','utf-8','hex','versionNumber','join','activation_deleted','startsWith','folder_creating','data','./journey-yaml.js','absolutePath','segmentNameToId','folderPathToId','fetchJourney','description','existingActivation','onProgress','\x27\x20entry\x20criteria','journeyId','existingSegments','all','SEGMENT_NOT_FOUND','created','split','createdSegmentId','Deleted\x20segment\x20\x27','relationships','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','columns','Creating\x20folder\x20\x27','with','journeyBundleName','existingSegment','\x27\x20from\x20file:\x20','find','ACTIVATION_SYNTAX_ERROR','\x20journey\x20from\x20file:\x20','stringify','getJourney','embeddedSegmentNameToId','all_columns','reduce','exitCriterias','journeyById','from','buildUserMaps','nameToType','segmentId','action','segment_deleting','diff','Activation','decision_point','behavior','entry','Stage\x20\x27','activationParams','segmentFolderId','Deleting\x20activation\x20\x27','stage\x20\x27','add','existingJourney','goal','unchanged','2108568ozSwgV','embedded_segment_created','errors','withProgress','index','logDeleted','milestone','embedded_activation_created','folderPath','segment_updating','DecisionPoint','Deleted\x20activation\x20\x27','Name\x20has\x20already\x20been\x20taken','replace','sha1','kind','segment_deleted','toString','journeyActivationNameToId','activation_created','logWarning','parse','Entry\x20criteria:\x20','object','Segment\x20not\x20found:\x20','yamlConfig','segments','deleted','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','size','JOURNEY_SYNTAX_ERROR','rootFolderId','3650298XtagTw','journey_updating','connection','includes','Updated\x20journey\x20\x27'];a97_0x5250=function(){return _0x11ed1e;};return a97_0x5250();}export async function executePushJourneys(_0x770291,_0x4b9ab2,_0x1b3e27,_0x2e71ed,_0xb432f7){const _0x31591b=a97_0x560ff4,{journeyDefToRequest:_0x45655c}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0xe58d4a,yamlRuleToApi:_0x4e19c8,validateSegmentRule:_0x20bba6}=await import('./child-segment-yaml.js'),_0x34d8fd={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3618de=new Map(_0x1b3e27[_0x31591b(0x157)]),_0x21ef5a=0x5;for(let _0x3da41a=0x0;_0x3da41a<_0x4b9ab2['length'];_0x3da41a+=_0x21ef5a){const _0x346734=_0x4b9ab2[_0x31591b(0x223)](_0x3da41a,_0x3da41a+_0x21ef5a),_0x10a8e0=await Promise[_0x31591b(0x160)](_0x346734[_0x31591b(0x1b2)](async _0x4bc995=>{const _0x2ffbb9=_0x31591b;if(!_0x4bc995[_0x2ffbb9(0x20b)]&&!_0x4bc995[_0x2ffbb9(0x203)])return{'action':_0x2ffbb9(0x18b),'name':_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)],'journeyId':_0x4bc995[_0x2ffbb9(0x189)]?.['id']};const _0x231a3a=_0x4bc995[_0x2ffbb9(0x194)]?_0x1b3e27[_0x2ffbb9(0x158)][_0x2ffbb9(0x1e0)](_0x4bc995['folderPath']):undefined;_0xb432f7[_0x2ffbb9(0x15c)]?.({'type':_0x4bc995[_0x2ffbb9(0x20b)]?'journey_creating':_0x2ffbb9(0x1ad),'name':_0x4bc995[_0x2ffbb9(0x1a5)]['name']});try{const _0x1851b9=await executeSingleJourneyPush(_0x770291,_0x4bc995,{..._0x1b3e27,'segmentNameToId':_0x3618de},{'parentId':_0x2e71ed[_0x2ffbb9(0x226)],'rootFolderId':_0x2e71ed[_0x2ffbb9(0x1ab)],'folderId':_0x231a3a,'verbose':_0x2e71ed[_0x2ffbb9(0x1db)]},_0xb432f7,{'journeyDefToRequest':_0x45655c,'activationDefToCreateRequest':_0xe58d4a,'yamlRuleToApi':_0x4e19c8,'validateSegmentRule':_0x20bba6});for(const [_0x37b6de,_0xe5bf1b]of _0x1851b9[_0x2ffbb9(0x173)]){_0x3618de[_0x2ffbb9(0x1dc)](_0x37b6de,_0xe5bf1b),_0x34d8fd[_0x2ffbb9(0x173)][_0x2ffbb9(0x1dc)](_0x37b6de,_0xe5bf1b);}if(_0x1851b9['action']===_0x2ffbb9(0x162))_0xb432f7[_0x2ffbb9(0x15c)]?.({'type':_0x2ffbb9(0x200),'name':_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)],'journeyId':_0x1851b9[_0x2ffbb9(0x15e)]}),_0xb432f7[_0x2ffbb9(0x1c6)]?.(_0x2ffbb9(0x20a)+_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)]+'\x27'),_0x34d8fd[_0x2ffbb9(0x162)]++;else _0x1851b9[_0x2ffbb9(0x17c)]===_0x2ffbb9(0x1e6)&&(_0xb432f7[_0x2ffbb9(0x15c)]?.({'type':_0x2ffbb9(0x1e8),'name':_0x4bc995[_0x2ffbb9(0x1a5)]['name']}),_0xb432f7[_0x2ffbb9(0x1c6)]?.(_0x2ffbb9(0x1b0)+_0x4bc995[_0x2ffbb9(0x1a5)]['name']+'\x27'),_0x34d8fd[_0x2ffbb9(0x1e6)]++);return{'action':_0x1851b9[_0x2ffbb9(0x17c)],'name':_0x4bc995[_0x2ffbb9(0x1a5)][_0x2ffbb9(0x1eb)],'journeyId':_0x1851b9[_0x2ffbb9(0x15e)]};}catch(_0x1d2410){const _0xcdafa=isHttp400Error(_0x1d2410),_0x3d31f7=_0xcdafa?ErrorCode[_0x2ffbb9(0x1aa)]:ErrorCode[_0x2ffbb9(0x1b5)],_0x4826f8=getErrorMessage(_0x1d2410);throw new SDKError(_0x3d31f7,_0x2ffbb9(0x230)+(_0x4bc995[_0x2ffbb9(0x20b)]?'create':_0x2ffbb9(0x1be))+_0x2ffbb9(0x170)+_0x4bc995['absolutePath']+'\x0a\x20\x20'+_0x4826f8,_0x1d2410);}}));_0x34d8fd[_0x31591b(0x1e4)][_0x31591b(0x1e3)](..._0x10a8e0);}return _0x34d8fd;}async function executeSingleJourneyPush(_0x36392d,_0x1e9664,_0x25c162,_0x4aa9d6,_0x395183,_0x303aa3){const _0x1cab7f=a97_0x560ff4,{journeyDefToRequest:_0x1687c2,activationDefToCreateRequest:_0x3d3318,yamlRuleToApi:_0x44cd90,validateSegmentRule:_0x5bd22b}=_0x303aa3,_0x282f74=new Map(),_0x265d28=new Map(),_0x203e3f=new Map(),_0x174888=new Map(),_0x130828=new Map();let _0x28e735;const _0x4a2786=async()=>{const _0x4d56af=a97_0x1212;if(_0x28e735)return;_0x28e735=new Map();if(!_0x1e9664['existingJourney'])return;const _0x2c7b31=await _0x36392d[_0x4d56af(0x22a)][_0x4d56af(0x1d1)](_0x1e9664[_0x4d56af(0x189)]['id']);for(const _0x53a1c7 of _0x2c7b31){const _0x4c1548=journeyActivationStepToYaml(_0x53a1c7,_0x25c162[_0x4d56af(0x1ef)],_0x25c162['connectionIdToNameMap']),_0x3013dd=activationSignature(_0x4c1548);!_0x28e735['has'](_0x3013dd)&&_0x28e735[_0x4d56af(0x1dc)](_0x3013dd,_0x53a1c7['id']),_0x4c1548[_0x4d56af(0x1eb)]&&_0x265d28[_0x4d56af(0x1dc)](_0x4c1548[_0x4d56af(0x1eb)],_0x53a1c7['id']);}};if(_0x1e9664['existingJourney']&&_0x1e9664['yamlConfig']['segments']){const _0x2a49e0=buildLocalExpandedRuleMappings(_0x1e9664['yamlConfig']),_0xe583ce=_0x2a49e0['localSegmentRules'];if(_0xe583ce[_0x1cab7f(0x1a9)]>0x0){const _0x511129=new Map();for(const [_0x26253d,_0x28924d]of _0xe583ce){const _0x125971=serializeExpandedRule(_0x28924d,_0xe583ce);_0x511129[_0x1cab7f(0x1dc)](_0x26253d,_0x125971);}const _0x468e4b=collectSegmentIdsFromJourneyApi(_0x1e9664[_0x1cab7f(0x189)]);if(_0x468e4b[_0x1cab7f(0x1a9)]>0x0){const _0x36482f=await buildServerSegmentRuleMap(_0x36392d,_0x4aa9d6[_0x1cab7f(0x226)],_0x25c162[_0x1cab7f(0x15f)],_0x468e4b);if(_0x36482f[_0x1cab7f(0x1a9)]>0x0){const _0x1a34d1=new Map();for(const [_0x3640b1,_0x3ff790]of _0x36482f){const _0x2cfc09=serializeExpandedRule(_0x3ff790,_0x36482f);!_0x1a34d1[_0x1cab7f(0x219)](_0x2cfc09)&&_0x1a34d1['set'](_0x2cfc09,_0x3640b1);}for(const [_0x24ac7a,_0x825b3f]of _0x511129){const _0x1eb817=_0x1a34d1[_0x1cab7f(0x1e0)](_0x825b3f);_0x1eb817&&(_0x130828[_0x1cab7f(0x1dc)](_0x24ac7a,_0x1eb817),_0x25c162[_0x1cab7f(0x157)][_0x1cab7f(0x1dc)](_0x24ac7a,_0x1eb817));}}}}}const _0x19edf3={'resolveSegmentId':async _0x277cd9=>{const _0x47110a=_0x1cab7f,_0x2a6a87=_0x25c162[_0x47110a(0x157)][_0x47110a(0x1e0)](_0x277cd9);if(!_0x2a6a87)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x277cd9+_0x47110a(0x1cd)+_0x1e9664[_0x47110a(0x1a5)][_0x47110a(0x1eb)]+')');return _0x2a6a87;},'resolveEmbeddedSegmentId':async(_0x5ab852,_0x5ef114)=>{const _0x5497b8=_0x1cab7f,_0x103e8d=_0x25c162[_0x5497b8(0x157)][_0x5497b8(0x1e0)](_0x5ab852);if(_0x103e8d)return _0x103e8d;const _0x2648f0=_0x130828['get'](_0x5ab852);if(_0x2648f0)return _0x25c162[_0x5497b8(0x157)][_0x5497b8(0x1dc)](_0x5ab852,_0x2648f0),_0x2648f0;const _0x31852f=_0x25c162[_0x5497b8(0x15f)][_0x5497b8(0x16e)](_0x1b3056=>_0x1b3056[_0x5497b8(0x1eb)]===_0x5ab852);if(_0x31852f)return _0x25c162['segmentNameToId']['set'](_0x5ab852,_0x31852f['id']),_0x31852f['id'];if(_0x1e9664['isNew']){const {stageName:_0x5ee4a4,criteriaName:_0x12f1ff}=findSegmentCriteriaLocation(_0x1e9664['yamlConfig'],_0x5ab852);return _0x5bd22b(_0x5ab852,_0x5ef114[_0x5497b8(0x1f1)]),_0x203e3f[_0x5497b8(0x1dc)](_0x5ab852,{'definition':_0x5ef114,'stageName':_0x5ee4a4,'criteriaName':_0x12f1ff}),createPendingSegmentId(_0x5ab852);}const _0x45dc07=_0x1e9664[_0x5497b8(0x189)]?.['id'];if(!_0x45dc07)throw new SDKError(ErrorCode[_0x5497b8(0x1b6)],_0x5497b8(0x20e));_0x5bd22b(_0x5ab852,_0x5ef114['rule']);const _0x991e2c=generateDeterministicJourneySegmentName(_0x1e9664['yamlConfig'][_0x5497b8(0x1eb)],_0x5ab852),_0x2de7a8=_0x25c162[_0x5497b8(0x15f)][_0x5497b8(0x16e)](_0x2cb58f=>_0x2cb58f['name']===_0x991e2c),_0x4e1e27=createSegmentIdResolver(_0x25c162['segmentNameToId'],_0x5ab852),_0x1567a5=await resolveRuleSegmentIds(_0x5ef114[_0x5497b8(0x1f1)],_0x4e1e27);let _0x528a08;if(_0x2de7a8)await _0x36392d['segment'][_0x5497b8(0x1d2)](_0x4aa9d6[_0x5497b8(0x226)],_0x2de7a8['id'],{'description':_0x5ef114[_0x5497b8(0x15a)]||_0x5497b8(0x1a2)+_0x5ab852,'rule':_0x44cd90(_0x1567a5,!![]),'countPopulation':!![]}),_0x528a08=_0x2de7a8['id'];else try{_0x528a08=await _0x36392d['segment']['createJourneySegment']({'name':_0x991e2c,'description':_0x5ef114['description']||_0x5497b8(0x1a2)+_0x5ab852,'journeyId':_0x45dc07,'rule':_0x44cd90(_0x1567a5,!![]),'countPopulation':!![],'parentFolderId':_0x4aa9d6['rootFolderId']||'','audienceId':_0x4aa9d6['parentId']});}catch(_0x37f989){const _0x11599a=_0x37f989 instanceof Error&&_0x37f989[_0x5497b8(0x227)][_0x5497b8(0x1af)](_0x5497b8(0x198));if(_0x11599a){const _0x51da76=await _0x36392d[_0x5497b8(0x22f)][_0x5497b8(0x1d5)](_0x4aa9d6[_0x5497b8(0x226)]),_0x41a757=_0x51da76['find'](_0x225713=>_0x225713[_0x5497b8(0x1eb)]===_0x991e2c);if(_0x41a757)await _0x36392d[_0x5497b8(0x22f)][_0x5497b8(0x1d2)](_0x4aa9d6[_0x5497b8(0x226)],_0x41a757['id'],{'description':_0x5ef114[_0x5497b8(0x15a)]||_0x5497b8(0x1a2)+_0x5ab852,'rule':_0x44cd90(_0x1567a5,!![]),'countPopulation':!![]}),_0x528a08=_0x41a757['id'];else throw _0x37f989;}else throw _0x37f989;}return _0x25c162[_0x5497b8(0x157)][_0x5497b8(0x1dc)](_0x5ab852,_0x528a08),_0x282f74[_0x5497b8(0x1dc)](_0x5ab852,_0x528a08),_0x528a08;},'resolveActivationId':async _0x3a13a5=>{const _0x316208=_0x1cab7f,_0x33b65a=_0x265d28[_0x316208(0x1e0)](_0x3a13a5);if(_0x33b65a)return _0x33b65a;if(_0x1e9664[_0x316208(0x189)]){await _0x4a2786();const _0x13c1ea=_0x265d28['get'](_0x3a13a5);if(_0x13c1ea)return _0x13c1ea;}throw new SDKError(ErrorCode[_0x316208(0x22c)],_0x316208(0x1e9)+_0x3a13a5+_0x316208(0x1cd)+_0x1e9664[_0x316208(0x1a5)][_0x316208(0x1eb)]+_0x316208(0x1e1)+_0x316208(0x209));},'resolveEmbeddedActivationId':async(_0x1622e1,_0x25ee78)=>{const _0xf03413=_0x1cab7f,_0x3849a7=_0x265d28['get'](_0x1622e1);if(_0x3849a7)return _0x3849a7;if(_0x1e9664[_0xf03413(0x20b)])return _0x174888['set'](_0x1622e1,_0x25ee78),createPendingActivationId(_0x1622e1);if(_0x1e9664[_0xf03413(0x189)]){await _0x4a2786();const _0x109463=_0x265d28['get'](_0x25ee78[_0xf03413(0x1eb)]);if(_0x109463)return _0x265d28['set'](_0x1622e1,_0x109463),_0x109463;const _0x47c28d=activationSignature(_0x25ee78),_0x3db397=_0x28e735?.[_0xf03413(0x1e0)](_0x47c28d);if(_0x3db397)return _0x265d28[_0xf03413(0x1dc)](_0x1622e1,_0x3db397),_0x3db397;const _0x306e77=await _0x3d3318(_0x25ee78,_0x25c162[_0xf03413(0x1d3)]),_0x5ee6b2=await _0x36392d[_0xf03413(0x22a)][_0xf03413(0x233)](_0x1e9664[_0xf03413(0x189)]['id'],_0x306e77);return _0x265d28[_0xf03413(0x1dc)](_0x1622e1,_0x5ee6b2['id']),_0x5ee6b2['id'];}throw new SDKError(ErrorCode[_0xf03413(0x1b6)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x1e3528=>{const _0x49e997=_0x1cab7f;try{return await _0x36392d[_0x49e997(0x22a)][_0x49e997(0x204)](_0x4aa9d6['parentId'],_0x1e3528);}catch(_0x3a9f44){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x1e3528+_0x49e997(0x167)+_0x1e9664[_0x49e997(0x1a5)][_0x49e997(0x1eb)]+'\x27)',_0x3a9f44);}},'resolveStageId':async(_0x1902e9,_0x332bc6)=>{const _0x2d74bb=_0x1cab7f,_0x15e5d3=await _0x36392d[_0x2d74bb(0x22a)][_0x2d74bb(0x172)](_0x1902e9),_0x52fec0=_0x15e5d3[_0x2d74bb(0x1bc)]['journeyStages'][_0x2d74bb(0x16e)](_0x51f126=>_0x51f126[_0x2d74bb(0x1eb)][_0x2d74bb(0x1f6)]()===_0x332bc6['toLowerCase']());if(!_0x52fec0?.['id'])throw new SDKError(ErrorCode[_0x2d74bb(0x22c)],_0x2d74bb(0x183)+_0x332bc6+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x15e5d3[_0x2d74bb(0x1bc)][_0x2d74bb(0x16b)]||_0x15e5d3['attributes'][_0x2d74bb(0x1eb)])+'\x27');return _0x52fec0['id'];}},_0x220184=await _0x1687c2(_0x1e9664['yamlConfig'],_0x4aa9d6[_0x1cab7f(0x226)],_0x19edf3),_0xdd3374=_0x4aa9d6[_0x1cab7f(0x1dd)]||_0x4aa9d6['rootFolderId'];_0xdd3374&&(_0x220184['relationships']={'parentFolder':{'data':{'id':_0xdd3374,'type':_0x1cab7f(0x215)}}});if(_0x1e9664[_0x1cab7f(0x20b)]){if(_0x203e3f[_0x1cab7f(0x1a9)]>0x0||_0x174888['size']>0x0)return await executeThreeStepJourneyCreate(_0x36392d,_0x1e9664,_0x220184,{'pendingEmbeddedSegments':_0x203e3f,'pendingEmbeddedActivations':_0x174888,'embeddedSegmentNameToId':_0x282f74,'journeyActivationNameToId':_0x265d28},{..._0x4aa9d6,'effectiveFolderId':_0xdd3374},_0x25c162,_0x395183,_0x303aa3);else{ensureJourneyDefaults(_0x220184['attributes']);const _0xf86542=await _0x36392d[_0x1cab7f(0x22a)][_0x1cab7f(0x220)](_0x220184);return{'action':_0x1cab7f(0x162),'journeyId':_0xf86542['id'],'embeddedSegmentNameToId':_0x282f74};}}else{if(_0x1e9664['hasChanges']&&_0x1e9664['existingJourney'])return ensureJourneyDefaults(_0x220184[_0x1cab7f(0x1bc)]),await _0x36392d[_0x1cab7f(0x22a)][_0x1cab7f(0x1be)](_0x1e9664[_0x1cab7f(0x189)]['id'],_0x220184),{'action':_0x1cab7f(0x1e6),'journeyId':_0x1e9664[_0x1cab7f(0x189)]['id'],'embeddedSegmentNameToId':_0x282f74};}return{'action':'unchanged','journeyId':_0x1e9664[_0x1cab7f(0x189)]?.['id'],'embeddedSegmentNameToId':_0x282f74};}function findSegmentCriteriaLocation(_0x56c2d5,_0x14b79c){const _0x3b835e=a97_0x560ff4,_0x19fb97=_0x56c2d5[_0x3b835e(0x1d0)]||_0x56c2d5['journeys']?.[0x0]?.[_0x3b835e(0x1d0)]||[];let _0x3f9f62=_0x3b835e(0x182),_0x48ae3c=_0x14b79c;const _0x689841=_0x56c2d5[_0x3b835e(0x18a)]||_0x56c2d5[_0x3b835e(0x1d8)]?.[0x0]?.[_0x3b835e(0x18a)];if(_0x689841?.[_0x3b835e(0x22f)]===_0x14b79c)return{'stageName':_0x3b835e(0x18a),'criteriaName':_0x689841[_0x3b835e(0x1eb)]||_0x14b79c};_0x5d1069:for(const _0x572c33 of _0x19fb97){if(_0x572c33[_0x3b835e(0x22e)]?.[_0x3b835e(0x22f)]===_0x14b79c){_0x3f9f62=_0x572c33['name'],_0x48ae3c=_0x572c33[_0x3b835e(0x22e)][_0x3b835e(0x1eb)]||_0x14b79c;break;}if(_0x572c33[_0x3b835e(0x1df)])for(const _0x26c129 of _0x572c33[_0x3b835e(0x1df)]){if(_0x26c129['type']===_0x3b835e(0x180)&&_0x26c129[_0x3b835e(0x16a)]?.['branches'])for(const _0x10ce99 of _0x26c129['with'][_0x3b835e(0x206)]){if(_0x10ce99[_0x3b835e(0x22f)]===_0x14b79c){_0x3f9f62=_0x572c33[_0x3b835e(0x1eb)],_0x48ae3c=_0x10ce99[_0x3b835e(0x1eb)]||_0x14b79c;break _0x5d1069;}}}}return{'stageName':_0x3f9f62,'criteriaName':_0x48ae3c};}function a97_0x1212(_0x505e1f,_0x57162b){_0x505e1f=_0x505e1f-0x151;const _0x52501d=a97_0x5250();let _0x1212d3=_0x52501d[_0x505e1f];return _0x1212d3;}async function executeThreeStepJourneyCreate(_0x28708a,_0xba003e,_0x128636,_0x377d97,_0x2168a7,_0x391ca3,_0x204db2,_0x2fc421){const _0x417c11=a97_0x560ff4,{activationDefToCreateRequest:_0x4a4112,yamlRuleToApi:_0x1b7c0c}=_0x2fc421,{pendingEmbeddedSegments:_0x25aed9,pendingEmbeddedActivations:_0x43f4cc,embeddedSegmentNameToId:_0x31c5f7}=_0x377d97,_0x3bd6e2=JSON['parse'](JSON[_0x417c11(0x171)](_0x128636));ensureJourneyDefaults(_0x3bd6e2[_0x417c11(0x1bc)]),stripPendingIds(_0x3bd6e2);const _0x3067a2=await _0x28708a[_0x417c11(0x22a)]['create'](_0x3bd6e2),_0x370e50=_0x3067a2['id'],_0x3e629a=new Map();for(const _0x159442 of _0x3067a2[_0x417c11(0x1bc)][_0x417c11(0x1f5)]){_0x3e629a[_0x417c11(0x1dc)](_0x159442['name']['toLowerCase'](),_0x159442['id']);}for(const [_0x40e58c,{definition:_0x5545f8}]of _0x25aed9){const _0x19cd6f=generateDeterministicJourneySegmentName(_0xba003e[_0x417c11(0x1a5)][_0x417c11(0x1eb)],_0x40e58c);_0x204db2[_0x417c11(0x15c)]?.({'type':_0x417c11(0x1bb),'journeyName':_0xba003e[_0x417c11(0x1a5)]['name'],'segmentName':_0x40e58c});const _0x2cd6d3=createSegmentIdResolver(_0x391ca3[_0x417c11(0x157)],_0x40e58c),_0x3a2c18=await resolveRuleSegmentIds(_0x5545f8[_0x417c11(0x1f1)],_0x2cd6d3),_0x43d8d4=await _0x28708a[_0x417c11(0x22f)][_0x417c11(0x1fd)]({'name':_0x19cd6f,'description':_0x5545f8[_0x417c11(0x15a)]||_0x417c11(0x1a2)+_0x40e58c,'journeyId':_0x370e50,'rule':_0x1b7c0c(_0x3a2c18,!![]),'countPopulation':!![],'parentFolderId':_0x2168a7[_0x417c11(0x211)]||'','audienceId':_0x2168a7[_0x417c11(0x226)]});_0x31c5f7[_0x417c11(0x1dc)](_0x40e58c,_0x43d8d4),_0x391ca3[_0x417c11(0x157)][_0x417c11(0x1dc)](_0x40e58c,_0x43d8d4),_0x204db2['onProgress']?.({'type':_0x417c11(0x18d),'journeyName':_0xba003e[_0x417c11(0x1a5)][_0x417c11(0x1eb)],'segmentName':_0x40e58c});}const _0x516755=new Map();for(const [_0x1dca31,_0x3b965b]of _0x43f4cc){_0x204db2[_0x417c11(0x15c)]?.({'type':_0x417c11(0x1f9),'journeyName':_0xba003e['yamlConfig'][_0x417c11(0x1eb)],'activationName':_0x1dca31});const _0x44a853=await _0x4a4112(_0x3b965b,_0x391ca3[_0x417c11(0x1d3)]),_0x4a0bd1=await _0x28708a['journey'][_0x417c11(0x233)](_0x370e50,_0x44a853);_0x516755[_0x417c11(0x1dc)](_0x1dca31,_0x4a0bd1['id']),_0x377d97[_0x417c11(0x19e)][_0x417c11(0x1dc)](_0x1dca31,_0x4a0bd1['id']),_0x204db2[_0x417c11(0x15c)]?.({'type':_0x417c11(0x193),'journeyName':_0xba003e[_0x417c11(0x1a5)][_0x417c11(0x1eb)],'activationName':_0x1dca31});}const _0xf3c1ec=JSON[_0x417c11(0x1a1)](JSON[_0x417c11(0x171)](_0x128636));return _0xf3c1ec['id']=_0x370e50,ensureJourneyDefaults(_0xf3c1ec['attributes']),resolvePendingIdsInRequest(_0xf3c1ec,_0x128636,_0x3e629a,_0x31c5f7,_0x516755,_0x204db2),await _0x28708a[_0x417c11(0x22a)]['update'](_0x370e50,_0xf3c1ec),{'action':_0x417c11(0x162),'journeyId':_0x370e50,'embeddedSegmentNameToId':_0x31c5f7};}function stripPendingIds(_0x3411b7){const _0x45998e=a97_0x560ff4;for(const _0x2394d0 of _0x3411b7[_0x45998e(0x1bc)][_0x45998e(0x1f5)]||[]){_0x2394d0[_0x45998e(0x1ed)]?.['segmentId']&&isPendingSegmentId(_0x2394d0['entryCriteria'][_0x45998e(0x17b)])&&delete _0x2394d0[_0x45998e(0x1ed)];if(_0x2394d0[_0x45998e(0x1df)])for(const _0x2072ba of Object['keys'](_0x2394d0[_0x45998e(0x1df)])){const _0x32ddf3=_0x2394d0[_0x45998e(0x1df)][_0x2072ba];_0x32ddf3[_0x45998e(0x1f7)]===_0x45998e(0x17f)&&_0x32ddf3['journeyActivationStepId']&&isPendingActivationId(_0x32ddf3[_0x45998e(0x1b4)])&&(_0x32ddf3['journeyActivationStepId']='');if(_0x32ddf3[_0x45998e(0x1f7)]==='DecisionPoint'&&_0x32ddf3[_0x45998e(0x206)])for(const _0x1a9503 of _0x32ddf3[_0x45998e(0x206)]){_0x1a9503[_0x45998e(0x17b)]&&isPendingSegmentId(_0x1a9503[_0x45998e(0x17b)])&&(_0x1a9503[_0x45998e(0x17b)]='');}}}}function resolvePendingIdsInRequest(_0x3c7fea,_0x2c6a3d,_0x2b3144,_0x4a173e,_0xaaee22,_0x3602a1){const _0x294278=a97_0x560ff4,_0x1c2c5d=(_0x393f9a,_0x3e74a4)=>{const _0xb34eb5=a97_0x1212;if(!isPendingSegmentId(_0x393f9a))return _0x393f9a;const _0x67dd59=extractPendingSegmentName(_0x393f9a),_0x27fd37=_0x4a173e['get'](_0x67dd59);return!_0x27fd37&&_0x3602a1[_0xb34eb5(0x1a0)]?.(_0xb34eb5(0x225)+_0x67dd59+'\x27\x20for\x20'+_0x3e74a4),_0x27fd37;};if(_0x3c7fea[_0x294278(0x1bc)][_0x294278(0x18a)]?.[_0x294278(0x17b)]&&isPendingSegmentId(_0x3c7fea[_0x294278(0x1bc)][_0x294278(0x18a)][_0x294278(0x17b)])){const _0x50b436=_0x1c2c5d(_0x3c7fea[_0x294278(0x1bc)][_0x294278(0x18a)][_0x294278(0x17b)],_0x294278(0x217));_0x50b436&&(_0x3c7fea[_0x294278(0x1bc)]['goal'][_0x294278(0x17b)]=_0x50b436);}for(const _0x45a0b8 of _0x3c7fea[_0x294278(0x1bc)][_0x294278(0x1f5)]||[]){const _0x4c7410=_0x2b3144[_0x294278(0x1e0)](_0x45a0b8[_0x294278(0x1eb)][_0x294278(0x1f6)]());_0x4c7410&&(_0x45a0b8['id']=_0x4c7410);if(_0x45a0b8[_0x294278(0x1ed)]?.[_0x294278(0x17b)]&&isPendingSegmentId(_0x45a0b8[_0x294278(0x1ed)][_0x294278(0x17b)])){const _0x2fb77e=_0x1c2c5d(_0x45a0b8[_0x294278(0x1ed)][_0x294278(0x17b)],'stage\x20\x27'+_0x45a0b8[_0x294278(0x1eb)]+_0x294278(0x15d));_0x2fb77e&&(_0x45a0b8['entryCriteria']['segmentId']=_0x2fb77e);}if(_0x45a0b8[_0x294278(0x176)])for(const _0x83a810 of _0x45a0b8[_0x294278(0x176)]){if(_0x83a810[_0x294278(0x17b)]&&isPendingSegmentId(_0x83a810['segmentId'])){const _0x182900=_0x1c2c5d(_0x83a810[_0x294278(0x17b)],_0x294278(0x187)+_0x45a0b8['name']+'\x27\x20exit\x20criteria');_0x182900&&(_0x83a810[_0x294278(0x17b)]=_0x182900);}}if(_0x45a0b8[_0x294278(0x192)]?.[_0x294278(0x17b)]&&isPendingSegmentId(_0x45a0b8[_0x294278(0x192)][_0x294278(0x17b)])){const _0x503fc7=_0x1c2c5d(_0x45a0b8[_0x294278(0x192)]['segmentId'],_0x294278(0x187)+_0x45a0b8['name']+_0x294278(0x1b7));_0x503fc7&&(_0x45a0b8[_0x294278(0x192)][_0x294278(0x17b)]=_0x503fc7);}if(_0x45a0b8[_0x294278(0x1df)]){const _0x76bc31=_0x7796cd=>_0x2c6a3d['attributes'][_0x294278(0x1f5)][_0x294278(0x16e)](_0x1cb030=>_0x1cb030['name'][_0x294278(0x1f6)]()===_0x45a0b8[_0x294278(0x1eb)]['toLowerCase']())?.[_0x294278(0x1df)]?.[_0x7796cd];for(const _0x3c475d of Object['keys'](_0x45a0b8[_0x294278(0x1df)])){const _0x2f8f19=_0x45a0b8['steps'][_0x3c475d],_0x181723=_0x76bc31(_0x3c475d);if(_0x2f8f19['type']==='Activation'&&_0x2f8f19[_0x294278(0x1b4)]&&(isPendingActivationId(_0x2f8f19[_0x294278(0x1b4)])||_0x2f8f19[_0x294278(0x1b4)]==='')){if(_0x181723?.[_0x294278(0x1b4)]&&isPendingActivationId(_0x181723[_0x294278(0x1b4)])){const _0x14b97c=extractPendingActivationName(_0x181723[_0x294278(0x1b4)]),_0x36febe=_0xaaee22[_0x294278(0x1e0)](_0x14b97c);_0x36febe&&(_0x2f8f19['journeyActivationStepId']=_0x36febe);}}if(_0x2f8f19[_0x294278(0x1f7)]===_0x294278(0x196)&&_0x2f8f19['branches']&&_0x181723?.['branches'])for(let _0x58ba60=0x0;_0x58ba60<_0x2f8f19[_0x294278(0x206)]['length'];_0x58ba60++){const _0xed8109=_0x2f8f19[_0x294278(0x206)][_0x58ba60],_0x5019a0=_0x181723['branches'][_0x58ba60];if(_0x5019a0?.['segmentId']&&isPendingSegmentId(_0x5019a0[_0x294278(0x17b)])){const _0x48ffe6=_0x1c2c5d(_0x5019a0['segmentId'],_0x294278(0x187)+_0x45a0b8[_0x294278(0x1eb)]+_0x294278(0x1da)+(_0xed8109[_0x294278(0x1eb)]||_0x58ba60)+'\x27');_0x48ffe6&&(_0xed8109[_0x294278(0x17b)]=_0x48ffe6);}}}}}}
@@ -1 +1 @@
1
- function a98_0x419f(_0x1be13a,_0x50ae57){_0x1be13a=_0x1be13a-0x1db;const _0x107cdd=a98_0x107c();let _0x419f16=_0x107cdd[_0x1be13a];return _0x419f16;}(function(_0x5c640f,_0x4c72f3){const _0x491007=a98_0x419f,_0x18b068=_0x5c640f();while(!![]){try{const _0x429d81=parseInt(_0x491007(0x1df))/0x1+parseInt(_0x491007(0x1db))/0x2+parseInt(_0x491007(0x1e6))/0x3*(-parseInt(_0x491007(0x1de))/0x4)+parseInt(_0x491007(0x1e9))/0x5+-parseInt(_0x491007(0x1e3))/0x6*(parseInt(_0x491007(0x1dc))/0x7)+-parseInt(_0x491007(0x1e2))/0x8+parseInt(_0x491007(0x1e7))/0x9;if(_0x429d81===_0x4c72f3)break;else _0x18b068['push'](_0x18b068['shift']());}catch(_0x1021e4){_0x18b068['push'](_0x18b068['shift']());}}}(a98_0x107c,0x86674));export function buildFolderIdToPathMap(_0x3b00d8){const _0xa78c74=a98_0x419f,_0x1db150=new Map(),_0x47d289=new Map();for(const _0x354ddc of _0x3b00d8){_0x47d289[_0xa78c74(0x1e1)](_0x354ddc['id'],_0x354ddc);}const _0x44e086=new Set();for(const _0x2c641b of _0x3b00d8){!_0x2c641b[_0xa78c74(0x1e0)]&&_0x44e086[_0xa78c74(0x1e5)](_0x2c641b['id']);}function _0x580014(_0x38dacc){const _0x57d6d6=_0xa78c74;if(_0x1db150[_0x57d6d6(0x1dd)](_0x38dacc['id']))return _0x1db150[_0x57d6d6(0x1e8)](_0x38dacc['id']);if(_0x44e086[_0x57d6d6(0x1dd)](_0x38dacc['id']))return _0x1db150[_0x57d6d6(0x1e1)](_0x38dacc['id'],''),'';if(_0x38dacc[_0x57d6d6(0x1e0)]){const _0x5f5600=_0x47d289['get'](_0x38dacc[_0x57d6d6(0x1e0)]);if(_0x5f5600){const _0x1f7a52=_0x580014(_0x5f5600),_0x1a33dd=_0x1f7a52?_0x1f7a52+'/'+_0x38dacc[_0x57d6d6(0x1e4)]:_0x38dacc[_0x57d6d6(0x1e4)];return _0x1db150[_0x57d6d6(0x1e1)](_0x38dacc['id'],_0x1a33dd),_0x1a33dd;}}const _0x371161=_0x38dacc['name'];return _0x1db150[_0x57d6d6(0x1e1)](_0x38dacc['id'],_0x371161),_0x371161;}for(const _0x3ca8d5 of _0x3b00d8){_0x580014(_0x3ca8d5);}return _0x1db150;}export function buildFolderPathToIdMap(_0x5bafbf){const _0x206f66=a98_0x419f,_0x4c214a=new Map(),_0x5cedfb=new Map();for(const _0x41ded7 of _0x5bafbf){_0x5cedfb[_0x206f66(0x1e1)](_0x41ded7['id'],_0x41ded7);}const _0x101024=new Set();for(const _0x134af7 of _0x5bafbf){!_0x134af7[_0x206f66(0x1e0)]&&_0x101024[_0x206f66(0x1e5)](_0x134af7['id']);}function _0x5a3cf1(_0x313a5d){const _0x4ea052=_0x206f66;if(_0x101024['has'](_0x313a5d['id']))return'';if(_0x313a5d['parentFolderId']){const _0x459749=_0x5cedfb[_0x4ea052(0x1e8)](_0x313a5d[_0x4ea052(0x1e0)]);if(_0x459749){const _0x10c4f3=_0x5a3cf1(_0x459749);return _0x10c4f3?_0x10c4f3+'/'+_0x313a5d['name']:_0x313a5d[_0x4ea052(0x1e4)];}}return _0x313a5d[_0x4ea052(0x1e4)];}for(const _0x1b891c of _0x5bafbf){const _0x1c9a07=_0x5a3cf1(_0x1b891c);_0x4c214a[_0x206f66(0x1e1)](_0x1c9a07,_0x1b891c['id']);}return _0x4c214a;}export function buildFolderMaps(_0x28d52a){const _0x412d31=a98_0x419f,_0x3e2a12=buildFolderIdToPathMap(_0x28d52a),_0x1a0acd=new Map();for(const [_0xf28123,_0x5ee83c]of _0x3e2a12){_0x1a0acd[_0x412d31(0x1e1)](_0x5ee83c,_0xf28123);}return{'idToPath':_0x3e2a12,'pathToId':_0x1a0acd};}export function getFolderPath(_0x28f388,_0x377bb4){const _0x480cc3=a98_0x419f;if(!_0x28f388)return'';return _0x377bb4[_0x480cc3(0x1e8)](_0x28f388)??'';}function a98_0x107c(){const _0x3dc7d8=['8544123zPzqlF','get','1779865QjTGvy','860392KoPLRt','126399lBJbjA','has','235916hHxfnL','627833VUIaZp','parentFolderId','set','4603592kxYraC','78RReqcw','name','add','51rqxUAt'];a98_0x107c=function(){return _0x3dc7d8;};return a98_0x107c();}
1
+ (function(_0x2e3df0,_0x39fbdb){const _0x183306=a98_0x55ea,_0x643359=_0x2e3df0();while(!![]){try{const _0x5f113d=-parseInt(_0x183306(0x10d))/0x1*(-parseInt(_0x183306(0x114))/0x2)+-parseInt(_0x183306(0x106))/0x3+-parseInt(_0x183306(0x113))/0x4+-parseInt(_0x183306(0x10e))/0x5+parseInt(_0x183306(0x108))/0x6+-parseInt(_0x183306(0x10b))/0x7*(parseInt(_0x183306(0x112))/0x8)+-parseInt(_0x183306(0x110))/0x9*(-parseInt(_0x183306(0x109))/0xa);if(_0x5f113d===_0x39fbdb)break;else _0x643359['push'](_0x643359['shift']());}catch(_0x33d23a){_0x643359['push'](_0x643359['shift']());}}}(a98_0x548e,0x5bc11));function a98_0x55ea(_0x678409,_0x3a4bee){_0x678409=_0x678409-0x105;const _0x548e0c=a98_0x548e();let _0x55eaec=_0x548e0c[_0x678409];return _0x55eaec;}export function buildFolderIdToPathMap(_0x29ca4e){const _0x50c9ab=a98_0x55ea,_0x2cd314=new Map(),_0x2840b9=new Map();for(const _0x12adab of _0x29ca4e){_0x2840b9[_0x50c9ab(0x107)](_0x12adab['id'],_0x12adab);}const _0x1413c1=new Set();for(const _0x7a9130 of _0x29ca4e){!_0x7a9130[_0x50c9ab(0x10c)]&&_0x1413c1[_0x50c9ab(0x10f)](_0x7a9130['id']);}function _0x52e20d(_0x4037f3){const _0x1e5a74=_0x50c9ab;if(_0x2cd314['has'](_0x4037f3['id']))return _0x2cd314[_0x1e5a74(0x111)](_0x4037f3['id']);if(_0x1413c1['has'](_0x4037f3['id']))return _0x2cd314[_0x1e5a74(0x107)](_0x4037f3['id'],''),'';if(_0x4037f3[_0x1e5a74(0x10c)]){const _0x350629=_0x2840b9[_0x1e5a74(0x111)](_0x4037f3[_0x1e5a74(0x10c)]);if(_0x350629){const _0x49dad3=_0x52e20d(_0x350629),_0x345783=_0x49dad3?_0x49dad3+'/'+_0x4037f3[_0x1e5a74(0x105)]:_0x4037f3[_0x1e5a74(0x105)];return _0x2cd314[_0x1e5a74(0x107)](_0x4037f3['id'],_0x345783),_0x345783;}}const _0x592f4a=_0x4037f3[_0x1e5a74(0x105)];return _0x2cd314['set'](_0x4037f3['id'],_0x592f4a),_0x592f4a;}for(const _0x4dc23e of _0x29ca4e){_0x52e20d(_0x4dc23e);}return _0x2cd314;}export function buildFolderPathToIdMap(_0x388f26){const _0x1f8b31=a98_0x55ea,_0x455fce=new Map(),_0x4f89a6=new Map();for(const _0x43339b of _0x388f26){_0x4f89a6['set'](_0x43339b['id'],_0x43339b);}const _0x3a8697=new Set();for(const _0x5b3bd1 of _0x388f26){!_0x5b3bd1[_0x1f8b31(0x10c)]&&_0x3a8697[_0x1f8b31(0x10f)](_0x5b3bd1['id']);}function _0x2dac29(_0x578d0c){const _0x4eab11=_0x1f8b31;if(_0x3a8697[_0x4eab11(0x10a)](_0x578d0c['id']))return'';if(_0x578d0c[_0x4eab11(0x10c)]){const _0x3ec604=_0x4f89a6[_0x4eab11(0x111)](_0x578d0c[_0x4eab11(0x10c)]);if(_0x3ec604){const _0x1e5a6c=_0x2dac29(_0x3ec604);return _0x1e5a6c?_0x1e5a6c+'/'+_0x578d0c[_0x4eab11(0x105)]:_0x578d0c[_0x4eab11(0x105)];}}return _0x578d0c[_0x4eab11(0x105)];}for(const _0x16b430 of _0x388f26){const _0x240d78=_0x2dac29(_0x16b430);_0x455fce[_0x1f8b31(0x107)](_0x240d78,_0x16b430['id']);}return _0x455fce;}function a98_0x548e(){const _0xa59638=['add','51228toQquU','get','9528tLSjnN','1289368USVtEg','82UKYheE','name','289779bQbTcj','set','300342VFEAlZ','2420ipzlHL','has','3437HuMsDI','parentFolderId','2671JlGPYF','787455FIOvgD'];a98_0x548e=function(){return _0xa59638;};return a98_0x548e();}export function buildFolderMaps(_0x1e0bc1){const _0x28fe88=a98_0x55ea,_0xae039a=buildFolderIdToPathMap(_0x1e0bc1),_0x343b85=new Map();for(const [_0x333d65,_0xcedf9b]of _0xae039a){_0x343b85[_0x28fe88(0x107)](_0xcedf9b,_0x333d65);}return{'idToPath':_0xae039a,'pathToId':_0x343b85};}export function getFolderPath(_0x300d3b,_0x104d92){const _0xc1eefb=a98_0x55ea;if(!_0x300d3b)return'';return _0x104d92[_0xc1eefb(0x111)](_0x300d3b)??'';}
@@ -1 +1 @@
1
- function a99_0x3d60(_0x13cd91,_0x4a5891){_0x13cd91=_0x13cd91-0xa5;const _0x4267a4=a99_0x4267();let _0x3d6005=_0x4267a4[_0x13cd91];return _0x3d6005;}(function(_0x234134,_0x427a69){const _0x207697=a99_0x3d60,_0x4b7b18=_0x234134();while(!![]){try{const _0x59506d=parseInt(_0x207697(0xc6))/0x1+-parseInt(_0x207697(0xbe))/0x2+-parseInt(_0x207697(0xa8))/0x3*(parseInt(_0x207697(0xad))/0x4)+-parseInt(_0x207697(0xc9))/0x5*(-parseInt(_0x207697(0xa9))/0x6)+-parseInt(_0x207697(0xb3))/0x7+parseInt(_0x207697(0xbb))/0x8+parseInt(_0x207697(0xd0))/0x9*(parseInt(_0x207697(0xcf))/0xa);if(_0x59506d===_0x427a69)break;else _0x4b7b18['push'](_0x4b7b18['shift']());}catch(_0x5c5b06){_0x4b7b18['push'](_0x4b7b18['shift']());}}}(a99_0x4267,0xc0682));import a99_0x49eed7 from'path';import{parse as a99_0x42025c}from'yaml';function a99_0x4267(){const _0x4cfcc1=['relative','2805036UGWfgc','parse','join','filter','Path\x20cannot\x20be\x20empty','readFile','type','push','613241bSmpeM','length','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','785405ezmexT','Path\x20segment\x20cannot\x20be\x20empty','slice','Cannot\x20navigate\x20above\x20root','journey','trim','140JRYTHs','1487682MSkNgE','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','isAbsolute','exists','Cannot\x20split\x20empty\x20path','dirname','9bKNdck','24NwdKZp','startsWith','raw','.yaml','1858112KfyEyd','Path\x20attempts\x20to\x20navigate\x20above\x20root','Relative\x20path\x20cannot\x20be\x20empty','.yml','test','replace','7804790mVixnN','parent_segment','name','split','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','pop','segments','No\x20tdx.json\x20found\x20for\x20file:\x20','9147464xuZjVI','endsWith'];a99_0x4267=function(){return _0x4cfcc1;};return a99_0x4267();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x33f0bf){const _0x4477d3=a99_0x3d60;if(!_0x33f0bf||_0x33f0bf[_0x4477d3(0xce)]()==='')throw new Error(_0x4477d3(0xc2));const _0x477e6d=_0x33f0bf['trim']();if(_0x477e6d==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x33f0bf};const _0x5e69af=_0x477e6d[_0x4477d3(0xaa)]('/')?_0x477e6d['substring'](0x1):_0x477e6d,_0x2545b3=_0x5e69af[_0x4477d3(0xb6)]('/')[_0x4477d3(0xc1)](_0x4a5652=>_0x4a5652!=='');if(_0x2545b3['length']===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x887283=_0x477e6d['startsWith']('/')||!isRelativePathSegment(_0x2545b3[0x0]);for(const _0xaf1405 of _0x2545b3){validatePathSegment(_0xaf1405);}return{'segments':_0x2545b3,'isAbsolute':_0x887283,'raw':_0x33f0bf};}function isRelativePathSegment(_0x1c938f){return _0x1c938f==='.'||_0x1c938f==='..';}function validatePathSegment(_0x5443e9){const _0x19b31c=a99_0x3d60;if(_0x5443e9==='')throw new Error(_0x19b31c(0xca));if(_0x5443e9==='.'||_0x5443e9==='..')return;if(/[\x00-\x1F\x7F]/[_0x19b31c(0xb1)](_0x5443e9))throw new Error(_0x19b31c(0xd1)+_0x5443e9);if(_0x5443e9!==_0x5443e9[_0x19b31c(0xce)]()){}}export function validatePath(_0x23f2bc){const _0x314799=a99_0x3d60;if(_0x23f2bc[_0x314799(0xb9)]['length']===0x0&&!_0x23f2bc[_0x314799(0xd2)])throw new Error(_0x314799(0xaf));if(_0x23f2bc[_0x314799(0xd2)]){if(_0x23f2bc['segments'][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x206184=0x0;for(const _0x1d74be of _0x23f2bc['segments']){if(_0x1d74be==='..'){if(_0x206184===0x0)throw new Error(_0x314799(0xae));_0x206184--;}else _0x1d74be!=='.'&&_0x206184++;}}}export function joinPaths(_0x57ceed,_0x17788b){const _0x3a722b=a99_0x3d60;if(!_0x57ceed||_0x57ceed==='/')return _0x17788b;if(!_0x17788b||_0x17788b==='.')return _0x57ceed;if(_0x17788b[_0x3a722b(0xaa)]('/'))return _0x17788b;const _0x4f194a=parsePath(_0x57ceed),_0xf21ef2=parsePath(_0x17788b),_0x16c313=[..._0x4f194a['segments']];for(const _0x1804fe of _0xf21ef2['segments']){if(_0x1804fe==='.')continue;else{if(_0x1804fe==='..'){if(_0x16c313[_0x3a722b(0xc7)]===0x0)throw new Error(_0x3a722b(0xcc));_0x16c313[_0x3a722b(0xb8)]();}else _0x16c313['push'](_0x1804fe);}}const _0x9069c=_0x16c313[_0x3a722b(0xc0)]('/');return _0x4f194a[_0x3a722b(0xab)][_0x3a722b(0xaa)]('/')?'/'+_0x9069c:_0x9069c;}export function normalizePath(_0xdfe28b){const _0x4bbc8c=a99_0x3d60,_0x1de081=parsePath(_0xdfe28b),_0x2adf51=[];for(const _0x2e1184 of _0x1de081[_0x4bbc8c(0xb9)]){if(_0x2e1184==='.')continue;else{if(_0x2e1184==='..'){if(_0x2adf51[_0x4bbc8c(0xc7)]===0x0){if(_0x1de081[_0x4bbc8c(0xd2)])throw new Error(_0x4bbc8c(0xcc));_0x2adf51[_0x4bbc8c(0xc5)]('..');}else _0x2adf51[_0x2adf51[_0x4bbc8c(0xc7)]-0x1]==='..'?_0x2adf51[_0x4bbc8c(0xc5)]('..'):_0x2adf51[_0x4bbc8c(0xb8)]();}else _0x2adf51[_0x4bbc8c(0xc5)](_0x2e1184);}}if(_0x2adf51['length']===0x0)return _0x1de081[_0x4bbc8c(0xd2)]?'/':'.';const _0x4e8e6c=_0x2adf51['join']('/');return _0x1de081[_0x4bbc8c(0xab)]['startsWith']('/')?'/'+_0x4e8e6c:_0x4e8e6c;}export function getParentPath(_0x3c1b70){const _0x1dcf9b=a99_0x3d60,_0x52b023=parsePath(_0x3c1b70);if(_0x52b023['segments'][_0x1dcf9b(0xc7)]<=0x1)return'/';const _0x558eba=_0x52b023[_0x1dcf9b(0xb9)][_0x1dcf9b(0xcb)](0x0,-0x1)['join']('/');return _0x52b023[_0x1dcf9b(0xab)]['startsWith']('/')?'/'+_0x558eba:_0x558eba;}export function getBaseName(_0x141e60){const _0x13ee16=a99_0x3d60,_0x466606=parsePath(_0x141e60);return _0x466606[_0x13ee16(0xb9)][_0x466606['segments'][_0x13ee16(0xc7)]-0x1]||'';}export function isChildPath(_0x497c89,_0x42cc4c){const _0x53f2fe=a99_0x3d60,_0x417762=parsePath(_0x497c89),_0x42ba0f=parsePath(_0x42cc4c);if(_0x417762['segments'][_0x53f2fe(0xc7)]<=_0x42ba0f['segments'][_0x53f2fe(0xc7)])return![];for(let _0xbe7589=0x0;_0xbe7589<_0x42ba0f[_0x53f2fe(0xb9)][_0x53f2fe(0xc7)];_0xbe7589++){if(_0x417762[_0x53f2fe(0xb9)][_0xbe7589]!==_0x42ba0f[_0x53f2fe(0xb9)][_0xbe7589])return![];}return!![];}export function splitPath(_0x36d74c){const _0x30ae7e=a99_0x3d60,_0x3cd5d0=parsePath(_0x36d74c);if(_0x3cd5d0['segments'][_0x30ae7e(0xc7)]===0x0)throw new Error(_0x30ae7e(0xa6));if(_0x3cd5d0[_0x30ae7e(0xb9)][_0x30ae7e(0xc7)]===0x1)return{'parent':_0x3cd5d0[_0x30ae7e(0xb9)][0x0]};return{'parent':_0x3cd5d0[_0x30ae7e(0xb9)][0x0],'child':_0x3cd5d0['segments'][_0x30ae7e(0xcb)](0x1)[_0x30ae7e(0xc0)]('/')};}export function isYamlFilePath(_0x41ea0c){const _0x20c4ac=a99_0x3d60;return _0x41ea0c[_0x20c4ac(0xbc)](_0x20c4ac(0xb0))||_0x41ea0c[_0x20c4ac(0xbc)](_0x20c4ac(0xac));}export async function resolveYamlFilePath(_0x1491d0,_0x4baaf0=nodeFileSystem){const _0x1d847c=a99_0x3d60,_0x22ea03=a99_0x49eed7['resolve'](_0x1491d0);if(!await _0x4baaf0[_0x1d847c(0xa5)](_0x22ea03))throw new Error('File\x20not\x20found:\x20'+_0x1491d0);let _0x30bfd1=a99_0x49eed7['dirname'](_0x22ea03),_0x18e225=null,_0x42f92b=null;const _0x268619=a99_0x49eed7[_0x1d847c(0xbf)](_0x30bfd1)['root'];while(_0x30bfd1!==_0x268619){const _0x33ddc1=a99_0x49eed7['join'](_0x30bfd1,'tdx.json');if(await _0x4baaf0[_0x1d847c(0xa5)](_0x33ddc1)){_0x18e225=_0x33ddc1,_0x42f92b=_0x30bfd1;break;}_0x30bfd1=a99_0x49eed7[_0x1d847c(0xa7)](_0x30bfd1);}if(!_0x18e225||!_0x42f92b)throw new Error(_0x1d847c(0xba)+_0x1491d0);const _0x5a4c22=await _0x4baaf0[_0x1d847c(0xc3)](_0x18e225),_0x2c99fe=JSON[_0x1d847c(0xbf)](_0x5a4c22),_0x58010=_0x2c99fe[_0x1d847c(0xb4)];if(!_0x58010)throw new Error(_0x1d847c(0xb7));const _0x25400c=await _0x4baaf0[_0x1d847c(0xc3)](_0x22ea03),_0x5da455=a99_0x42025c(_0x25400c),_0x1f42bd=_0x5da455[_0x1d847c(0xb5)];if(!_0x1f42bd)throw new Error(_0x1d847c(0xc8)+_0x1491d0);const _0x2d4e81=_0x5da455[_0x1d847c(0xc4)]===_0x1d847c(0xcd)?_0x1d847c(0xcd):'segment',_0x540774=a99_0x49eed7[_0x1d847c(0xbd)](_0x42f92b,_0x22ea03),_0x3a7639=a99_0x49eed7[_0x1d847c(0xa7)](_0x540774),_0x37d22f=_0x3a7639==='.'?'':_0x3a7639[_0x1d847c(0xb2)](/\\/g,'/'),_0x5f20b9=_0x37d22f?_0x58010+'/'+_0x37d22f+'/'+_0x1f42bd:_0x58010+'/'+_0x1f42bd;return{'parentSegment':_0x58010,'segmentName':_0x1f42bd,'folderPath':_0x37d22f,'fullPath':_0x5f20b9,'resourceType':_0x2d4e81};}
1
+ (function(_0x58f204,_0x363363){const _0x38376f=a99_0x22f5,_0x1e1a38=_0x58f204();while(!![]){try{const _0x130186=-parseInt(_0x38376f(0xe3))/0x1*(-parseInt(_0x38376f(0xfa))/0x2)+parseInt(_0x38376f(0x10d))/0x3*(-parseInt(_0x38376f(0x109))/0x4)+parseInt(_0x38376f(0xe5))/0x5*(parseInt(_0x38376f(0xe7))/0x6)+parseInt(_0x38376f(0xf4))/0x7*(parseInt(_0x38376f(0x102))/0x8)+-parseInt(_0x38376f(0xf9))/0x9+parseInt(_0x38376f(0xea))/0xa+-parseInt(_0x38376f(0x103))/0xb;if(_0x130186===_0x363363)break;else _0x1e1a38['push'](_0x1e1a38['shift']());}catch(_0x34ce11){_0x1e1a38['push'](_0x1e1a38['shift']());}}}(a99_0x35c0,0x68c02));import a99_0x4245c9 from'path';import{parse as a99_0x35b6ed}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x6ecebf){const _0x34090f=a99_0x22f5;if(!_0x6ecebf||_0x6ecebf[_0x34090f(0xee)]()==='')throw new Error(_0x34090f(0xfd));const _0x344ccb=_0x6ecebf[_0x34090f(0xee)]();if(_0x344ccb==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x6ecebf};const _0x421ef5=_0x344ccb['startsWith']('/')?_0x344ccb['substring'](0x1):_0x344ccb,_0xb1ab93=_0x421ef5['split']('/')['filter'](_0x5aca23=>_0x5aca23!=='');if(_0xb1ab93['length']===0x0)throw new Error(_0x34090f(0xf2));const _0x45efa5=_0x344ccb[_0x34090f(0xe6)]('/')||!isRelativePathSegment(_0xb1ab93[0x0]);for(const _0xe7fa11 of _0xb1ab93){validatePathSegment(_0xe7fa11);}return{'segments':_0xb1ab93,'isAbsolute':_0x45efa5,'raw':_0x6ecebf};}function isRelativePathSegment(_0x40f458){return _0x40f458==='.'||_0x40f458==='..';}function validatePathSegment(_0x5d8f53){const _0x302990=a99_0x22f5;if(_0x5d8f53==='')throw new Error(_0x302990(0xf5));if(_0x5d8f53==='.'||_0x5d8f53==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x5d8f53))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x5d8f53);if(_0x5d8f53!==_0x5d8f53['trim']()){}}export function validatePath(_0x1f73e8){const _0x20ffdf=a99_0x22f5;if(_0x1f73e8[_0x20ffdf(0x10e)][_0x20ffdf(0x101)]===0x0&&!_0x1f73e8[_0x20ffdf(0xe9)])throw new Error(_0x20ffdf(0xf7));if(_0x1f73e8[_0x20ffdf(0xe9)]){if(_0x1f73e8[_0x20ffdf(0x10e)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x2d28fb=0x0;for(const _0x52d0b5 of _0x1f73e8['segments']){if(_0x52d0b5==='..'){if(_0x2d28fb===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x2d28fb--;}else _0x52d0b5!=='.'&&_0x2d28fb++;}}}function a99_0x35c0(){const _0xd3b5af=['.yml','Relative\x20path\x20cannot\x20be\x20empty','exists','6725223kCxKXk','44152ZLWmzT','segment','resolve','Path\x20cannot\x20be\x20empty','root','name','raw','length','5577448YlNazg','16430447hiJnAi','replace','endsWith','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','journey','push','351884vQTLjI','.yaml','join','No\x20tdx.json\x20found\x20for\x20file:\x20','3HoSifK','segments','slice','37zkDZCw','parent_segment','2073475NQRaSQ','startsWith','12TheZNm','relative','isAbsolute','4145700uuIrLv','pop','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','parse','trim','dirname','Cannot\x20navigate\x20above\x20root','type','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','File\x20not\x20found:\x20','7vHEvTu','Path\x20segment\x20cannot\x20be\x20empty'];a99_0x35c0=function(){return _0xd3b5af;};return a99_0x35c0();}function a99_0x22f5(_0x2d4f0f,_0x3e2bed){_0x2d4f0f=_0x2d4f0f-0xe2;const _0x35c0db=a99_0x35c0();let _0x22f597=_0x35c0db[_0x2d4f0f];return _0x22f597;}export function joinPaths(_0x58e05a,_0x18350d){const _0x331d0f=a99_0x22f5;if(!_0x58e05a||_0x58e05a==='/')return _0x18350d;if(!_0x18350d||_0x18350d==='.')return _0x58e05a;if(_0x18350d[_0x331d0f(0xe6)]('/'))return _0x18350d;const _0x1e4e5b=parsePath(_0x58e05a),_0x5055f1=parsePath(_0x18350d),_0x53300c=[..._0x1e4e5b[_0x331d0f(0x10e)]];for(const _0x4c16bd of _0x5055f1[_0x331d0f(0x10e)]){if(_0x4c16bd==='.')continue;else{if(_0x4c16bd==='..'){if(_0x53300c[_0x331d0f(0x101)]===0x0)throw new Error(_0x331d0f(0xf0));_0x53300c[_0x331d0f(0xeb)]();}else _0x53300c['push'](_0x4c16bd);}}const _0x5e3d57=_0x53300c[_0x331d0f(0x10b)]('/');return _0x1e4e5b[_0x331d0f(0x100)]['startsWith']('/')?'/'+_0x5e3d57:_0x5e3d57;}export function normalizePath(_0x2be25a){const _0x13f926=a99_0x22f5,_0x21baa5=parsePath(_0x2be25a),_0x590464=[];for(const _0x2e4fff of _0x21baa5['segments']){if(_0x2e4fff==='.')continue;else{if(_0x2e4fff==='..'){if(_0x590464[_0x13f926(0x101)]===0x0){if(_0x21baa5[_0x13f926(0xe9)])throw new Error(_0x13f926(0xf0));_0x590464[_0x13f926(0x108)]('..');}else _0x590464[_0x590464[_0x13f926(0x101)]-0x1]==='..'?_0x590464[_0x13f926(0x108)]('..'):_0x590464[_0x13f926(0xeb)]();}else _0x590464[_0x13f926(0x108)](_0x2e4fff);}}if(_0x590464[_0x13f926(0x101)]===0x0)return _0x21baa5['isAbsolute']?'/':'.';const _0x170400=_0x590464[_0x13f926(0x10b)]('/');return _0x21baa5[_0x13f926(0x100)][_0x13f926(0xe6)]('/')?'/'+_0x170400:_0x170400;}export function getParentPath(_0x56ab38){const _0x4d544c=a99_0x22f5,_0x53a285=parsePath(_0x56ab38);if(_0x53a285['segments'][_0x4d544c(0x101)]<=0x1)return'/';const _0x4081e7=_0x53a285[_0x4d544c(0x10e)][_0x4d544c(0xe2)](0x0,-0x1)['join']('/');return _0x53a285[_0x4d544c(0x100)][_0x4d544c(0xe6)]('/')?'/'+_0x4081e7:_0x4081e7;}export function getBaseName(_0x3198bd){const _0x30e888=a99_0x22f5,_0x21c27e=parsePath(_0x3198bd);return _0x21c27e[_0x30e888(0x10e)][_0x21c27e[_0x30e888(0x10e)][_0x30e888(0x101)]-0x1]||'';}export function isChildPath(_0x5d4614,_0x4e643a){const _0x210d29=a99_0x22f5,_0x532524=parsePath(_0x5d4614),_0x17307d=parsePath(_0x4e643a);if(_0x532524[_0x210d29(0x10e)]['length']<=_0x17307d[_0x210d29(0x10e)][_0x210d29(0x101)])return![];for(let _0x7aa06e=0x0;_0x7aa06e<_0x17307d[_0x210d29(0x10e)][_0x210d29(0x101)];_0x7aa06e++){if(_0x532524[_0x210d29(0x10e)][_0x7aa06e]!==_0x17307d['segments'][_0x7aa06e])return![];}return!![];}export function splitPath(_0xeac1ef){const _0x963254=a99_0x22f5,_0x2fa6f4=parsePath(_0xeac1ef);if(_0x2fa6f4[_0x963254(0x10e)][_0x963254(0x101)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x2fa6f4['segments']['length']===0x1)return{'parent':_0x2fa6f4[_0x963254(0x10e)][0x0]};return{'parent':_0x2fa6f4[_0x963254(0x10e)][0x0],'child':_0x2fa6f4['segments'][_0x963254(0xe2)](0x1)['join']('/')};}export function isYamlFilePath(_0x2de71e){const _0x3d911c=a99_0x22f5;return _0x2de71e[_0x3d911c(0x105)](_0x3d911c(0xf6))||_0x2de71e[_0x3d911c(0x105)](_0x3d911c(0x10a));}export async function resolveYamlFilePath(_0x4e6bba,_0x3dd0e7=nodeFileSystem){const _0x51a4f2=a99_0x22f5,_0x5b1126=a99_0x4245c9[_0x51a4f2(0xfc)](_0x4e6bba);if(!await _0x3dd0e7[_0x51a4f2(0xf8)](_0x5b1126))throw new Error(_0x51a4f2(0xf3)+_0x4e6bba);let _0xef29f1=a99_0x4245c9['dirname'](_0x5b1126),_0xd578eb=null,_0x5b642c=null;const _0x4e43d2=a99_0x4245c9['parse'](_0xef29f1)[_0x51a4f2(0xfe)];while(_0xef29f1!==_0x4e43d2){const _0x167191=a99_0x4245c9['join'](_0xef29f1,'tdx.json');if(await _0x3dd0e7[_0x51a4f2(0xf8)](_0x167191)){_0xd578eb=_0x167191,_0x5b642c=_0xef29f1;break;}_0xef29f1=a99_0x4245c9[_0x51a4f2(0xef)](_0xef29f1);}if(!_0xd578eb||!_0x5b642c)throw new Error(_0x51a4f2(0x10c)+_0x4e6bba);const _0xcc6f76=await _0x3dd0e7['readFile'](_0xd578eb),_0x52ebc3=JSON[_0x51a4f2(0xed)](_0xcc6f76),_0x2ba790=_0x52ebc3[_0x51a4f2(0xe4)];if(!_0x2ba790)throw new Error(_0x51a4f2(0xec));const _0x59edb8=await _0x3dd0e7['readFile'](_0x5b1126),_0x4d25d5=a99_0x35b6ed(_0x59edb8),_0x459e56=_0x4d25d5[_0x51a4f2(0xff)];if(!_0x459e56)throw new Error(_0x51a4f2(0x106)+_0x4e6bba);const _0x551c14=_0x4d25d5[_0x51a4f2(0xf1)]===_0x51a4f2(0x107)?_0x51a4f2(0x107):_0x51a4f2(0xfb),_0x31c280=a99_0x4245c9[_0x51a4f2(0xe8)](_0x5b642c,_0x5b1126),_0x248910=a99_0x4245c9[_0x51a4f2(0xef)](_0x31c280),_0x11c20a=_0x248910==='.'?'':_0x248910[_0x51a4f2(0x104)](/\\/g,'/'),_0xd2aead=_0x11c20a?_0x2ba790+'/'+_0x11c20a+'/'+_0x459e56:_0x2ba790+'/'+_0x459e56;return{'parentSegment':_0x2ba790,'segmentName':_0x459e56,'folderPath':_0x11c20a,'fullPath':_0xd2aead,'resourceType':_0x551c14};}
@@ -1 +1 @@
1
- function a100_0x56d1(_0xa49020,_0x11d41d){_0xa49020=_0xa49020-0x76;const _0x427099=a100_0x4270();let _0x56d177=_0x427099[_0xa49020];return _0x56d177;}(function(_0x2e453b,_0x48687f){const _0x40cc65=a100_0x56d1,_0x1e6980=_0x2e453b();while(!![]){try{const _0x569d39=parseInt(_0x40cc65(0x86))/0x1+-parseInt(_0x40cc65(0x79))/0x2*(parseInt(_0x40cc65(0x7c))/0x3)+parseInt(_0x40cc65(0x7e))/0x4*(parseInt(_0x40cc65(0x82))/0x5)+parseInt(_0x40cc65(0x85))/0x6+-parseInt(_0x40cc65(0x80))/0x7*(-parseInt(_0x40cc65(0x81))/0x8)+parseInt(_0x40cc65(0x7b))/0x9*(parseInt(_0x40cc65(0x84))/0xa)+-parseInt(_0x40cc65(0x77))/0xb*(parseInt(_0x40cc65(0x7d))/0xc);if(_0x569d39===_0x48687f)break;else _0x1e6980['push'](_0x1e6980['shift']());}catch(_0x533d6f){_0x1e6980['push'](_0x1e6980['shift']());}}}(a100_0x4270,0xee676));function a100_0x4270(){const _0x1dd5c9=['.\x20Parent\x20name\x20cannot\x20be\x20empty','160340skIsgf','2184534qNDDwb','1915421zDGqbT','indexOf','1287UqLHST','substring','182228EkDsRS','.\x20Child\x20name\x20cannot\x20be\x20empty','666zFkZSp','24hMbtQG','423228BUpFVk','4895292wxGKyE','Invalid\x20segment\x20reference\x20format:\x20','14aCMRSW','4568152jsYTBk','5epvtEg'];a100_0x4270=function(){return _0x1dd5c9;};return a100_0x4270();}export function parseSegmentRef(_0x4371e7){const _0x3f8155=a100_0x56d1,_0x5ced1d=_0x4371e7[_0x3f8155(0x76)]('/');if(_0x5ced1d===-0x1)return{'parentId':_0x4371e7};if(_0x5ced1d===0x0)throw new Error(_0x3f8155(0x7f)+_0x4371e7+_0x3f8155(0x83));const _0x10c8ed=_0x4371e7[_0x3f8155(0x78)](0x0,_0x5ced1d),_0x393f9f=_0x4371e7[_0x3f8155(0x78)](_0x5ced1d+0x1);if(_0x393f9f==='')throw new Error(_0x3f8155(0x7f)+_0x4371e7+_0x3f8155(0x7a));return{'parentId':_0x10c8ed,'childId':_0x393f9f};}
1
+ (function(_0x364fa9,_0x379a2e){const _0x5a0983=a100_0x5e35,_0x38c23e=_0x364fa9();while(!![]){try{const _0x578e95=-parseInt(_0x5a0983(0xce))/0x1*(-parseInt(_0x5a0983(0xcb))/0x2)+parseInt(_0x5a0983(0xc9))/0x3*(-parseInt(_0x5a0983(0xd2))/0x4)+parseInt(_0x5a0983(0xd4))/0x5+-parseInt(_0x5a0983(0xd5))/0x6*(-parseInt(_0x5a0983(0xd0))/0x7)+parseInt(_0x5a0983(0xd1))/0x8*(parseInt(_0x5a0983(0xcc))/0x9)+parseInt(_0x5a0983(0xc7))/0xa*(-parseInt(_0x5a0983(0xc6))/0xb)+-parseInt(_0x5a0983(0xd3))/0xc;if(_0x578e95===_0x379a2e)break;else _0x38c23e['push'](_0x38c23e['shift']());}catch(_0x410325){_0x38c23e['push'](_0x38c23e['shift']());}}}(a100_0x4416,0x9458a));function a100_0x5e35(_0x3d6ecd,_0x8c8665){_0x3d6ecd=_0x3d6ecd-0xc6;const _0x4416e5=a100_0x4416();let _0x5e3534=_0x4416e5[_0x3d6ecd];return _0x5e3534;}export function parseSegmentRef(_0x22567e){const _0x4ee8fe=a100_0x5e35,_0x23c195=_0x22567e[_0x4ee8fe(0xcd)]('/');if(_0x23c195===-0x1)return{'parentId':_0x22567e};if(_0x23c195===0x0)throw new Error(_0x4ee8fe(0xcf)+_0x22567e+_0x4ee8fe(0xc8));const _0x54f311=_0x22567e['substring'](0x0,_0x23c195),_0x4146aa=_0x22567e['substring'](_0x23c195+0x1);if(_0x4146aa==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x22567e+_0x4ee8fe(0xca));return{'parentId':_0x54f311,'childId':_0x4146aa};}function a100_0x4416(){const _0x28a255=['1149143ZGQXlx','Invalid\x20segment\x20reference\x20format:\x20','26509aBYruj','848IjDbhe','1181004IZADxS','33952836XmIXtP','3721165ZCwotr','1614kQXtiQ','310882LdyETi','30fVaBAt','.\x20Parent\x20name\x20cannot\x20be\x20empty','6HycFTz','.\x20Child\x20name\x20cannot\x20be\x20empty','2SjejRc','101907QoIDlf','indexOf'];a100_0x4416=function(){return _0x28a255;};return a100_0x4416();}
@@ -1 +1 @@
1
- (function(_0x411a16,_0x527f4c){const _0x49c3c5=a101_0x4cb6,_0x1fc023=_0x411a16();while(!![]){try{const _0x390e4a=-parseInt(_0x49c3c5(0x1a2))/0x1*(parseInt(_0x49c3c5(0x1cb))/0x2)+-parseInt(_0x49c3c5(0x1a9))/0x3+parseInt(_0x49c3c5(0x1c2))/0x4+-parseInt(_0x49c3c5(0x1c3))/0x5*(-parseInt(_0x49c3c5(0x198))/0x6)+parseInt(_0x49c3c5(0x1af))/0x7*(parseInt(_0x49c3c5(0x196))/0x8)+parseInt(_0x49c3c5(0x1bf))/0x9*(-parseInt(_0x49c3c5(0x197))/0xa)+parseInt(_0x49c3c5(0x1a0))/0xb*(parseInt(_0x49c3c5(0x195))/0xc);if(_0x390e4a===_0x527f4c)break;else _0x1fc023['push'](_0x1fc023['shift']());}catch(_0x6f833){_0x1fc023['push'](_0x1fc023['shift']());}}}(a101_0x1117,0x1a95f));import a101_0x202399 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(_0x1e6c95){const _0x3d95b2=a101_0x4cb6;return _0x1e6c95[_0x3d95b2(0x1cc)]!==_0x3d95b2(0x1c1);}function a101_0x1117(){const _0x51ad22=['segment','resourceType','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','517spygpo','no_config','4yEsYWl','basename','file','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','root','message','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','631503tEmNqI','string','folderPath','isFile','segmentName','stat','282359aShDfR','trim','isScoped','configDir','dirname','journey','File\x20not\x20found:\x20','parse','file_not_found','relative','includes','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','No\x20tdx.json\x20found\x20for\x20file:\x20','isDirectory','Not\x20a\x20YAML\x20file:\x20','directory','7218tvgAge','readFile','error','341712buowOm','335rNuwIj','startsWith','replace','parentSegment','No\x20tdx.json\x20found','invalid_yaml','exists','File\x20not\x20found','9298xibkjJ','type','44748DOODNp','16dBZbYY','2230bmNsST','15714EdpeQu','context','parent_segment','resolve','scopedFolderPath'];a101_0x1117=function(){return _0x51ad22;};return a101_0x1117();}export function isScopedResolution(_0xae2b4a){const _0x2271f1=a101_0x4cb6;return _0xae2b4a[_0x2271f1(0x1cc)]===_0x2271f1(0x1be)||_0xae2b4a[_0x2271f1(0x1cc)]===_0x2271f1(0x1a4)||_0xae2b4a[_0x2271f1(0x1cc)]===_0x2271f1(0x199);}function a101_0x4cb6(_0x1de822,_0x4e80ab){_0x1de822=_0x1de822-0x195;const _0x11179a=a101_0x1117();let _0x4cb6f9=_0x11179a[_0x1de822];return _0x4cb6f9;}export function getScopedDetails(_0x5f1af2){const _0x461737=a101_0x4cb6;if(isScopedResolution(_0x5f1af2))return{'isScoped':_0x5f1af2[_0x461737(0x1b1)],'scopedFolderPath':_0x5f1af2['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x537fd2,_0x4c74c6){const _0xf1e7c0=a101_0x4cb6;let _0x538bc1=a101_0x202399[_0xf1e7c0(0x19b)](_0x537fd2);const _0x15f962=a101_0x202399[_0xf1e7c0(0x1b6)](_0x538bc1)[_0xf1e7c0(0x1a6)];while(_0x538bc1!==_0x15f962){const _0x44cf58=a101_0x202399['join'](_0x538bc1,'tdx.json');if(await _0x4c74c6['exists'](_0x44cf58))try{const _0x1e0342=await _0x4c74c6[_0xf1e7c0(0x1c0)](_0x44cf58),_0x4b6e06=JSON[_0xf1e7c0(0x1b6)](_0x1e0342);if(_0x4b6e06[_0xf1e7c0(0x19a)]&&typeof _0x4b6e06[_0xf1e7c0(0x19a)]===_0xf1e7c0(0x1aa))return{'configPath':_0x44cf58,'configDir':_0x538bc1,'parentSegment':_0x4b6e06[_0xf1e7c0(0x19a)]};}catch{}_0x538bc1=a101_0x202399['dirname'](_0x538bc1);}return null;}function calculateScopedPath(_0x12594a,_0xa6cbb1){const _0x11aed7=a101_0x4cb6,_0x386e86=a101_0x202399[_0x11aed7(0x1b8)](_0xa6cbb1,_0x12594a),_0x5cb568=_0x386e86!==''&&_0x386e86!=='.'&&!_0x386e86[_0x11aed7(0x1c4)]('..');return{'isScoped':_0x5cb568,'scopedFolderPath':_0x5cb568?_0x386e86[_0x11aed7(0x1c5)](/\\/g,'/'):''};}export async function resolveTarget(_0xf9f508){const _0x2952cf=a101_0x4cb6,{arg:_0x4ad69d,contextParent:_0x1affc1,cwd:cwd=process['cwd'](),fs:fs=nodeFileSystem}=_0xf9f508;if(_0x4ad69d&&isYamlFilePath(_0x4ad69d))try{const _0x5e70a2=await resolveYamlFilePath(_0x4ad69d,fs),_0xf7f9ed=a101_0x202399[_0x2952cf(0x19b)](_0x4ad69d),_0x1be086=a101_0x202399[_0x2952cf(0x1b3)](_0xf7f9ed),_0x2f0c85=await findTdxConfigAsync(_0x1be086,fs);if(!_0x2f0c85){if(_0x1affc1){const _0x240ad8=a101_0x202399['dirname'](_0xf7f9ed);return{'type':_0x2952cf(0x1a4),'parentName':_0x1affc1,'targetDir':_0x240ad8,'configRoot':_0x240ad8,'filePath':_0xf7f9ed,'resourceName':_0x5e70a2[_0x2952cf(0x1ad)],'folderPath':_0x5e70a2[_0x2952cf(0x1ab)],'resourceType':_0x5e70a2[_0x2952cf(0x19e)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x2952cf(0x1c1),'errorCode':'no_config','message':_0x2952cf(0x1bb)+_0x4ad69d,'arg':_0x4ad69d,'helpText':_0x2952cf(0x1ba)};}const _0x581ec8=calculateScopedPath(_0x1be086,_0x2f0c85[_0x2952cf(0x1b2)]);return{'type':_0x2952cf(0x1a4),'parentName':_0x2f0c85['parentSegment'],'targetDir':_0x2f0c85['configDir'],'configRoot':_0x2f0c85[_0x2952cf(0x1b2)],'filePath':_0xf7f9ed,'resourceName':_0x5e70a2[_0x2952cf(0x1ad)],'folderPath':_0x5e70a2[_0x2952cf(0x1ab)],'resourceType':_0x5e70a2[_0x2952cf(0x19e)],'isScoped':_0x581ec8[_0x2952cf(0x1b1)],'scopedFolderPath':_0x581ec8[_0x2952cf(0x19c)]};}catch(_0xd3dc66){const _0x2d232e=_0xd3dc66 instanceof Error?_0xd3dc66[_0x2952cf(0x1a7)]:String(_0xd3dc66);if(_0x2d232e[_0x2952cf(0x1b9)](_0x2952cf(0x1ca)))return{'type':_0x2952cf(0x1c1),'errorCode':_0x2952cf(0x1b7),'message':_0x2952cf(0x1b5)+_0x4ad69d,'arg':_0x4ad69d};if(_0x2d232e[_0x2952cf(0x1b9)](_0x2952cf(0x1c7))){if(_0x1affc1){const _0x5a0743=a101_0x202399['resolve'](_0x4ad69d);if(await fs[_0x2952cf(0x1c9)](_0x5a0743)){const _0x4ed090=a101_0x202399[_0x2952cf(0x1b3)](_0x5a0743),_0x5d4c88=await fs['readFile'](_0x5a0743),_0x53ab85=_0x5d4c88['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x15a460=_0x5d4c88['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x55a364=_0x53ab85?_0x53ab85[0x1][_0x2952cf(0x1b0)]():a101_0x202399[_0x2952cf(0x1a3)](_0x4ad69d,a101_0x202399['extname'](_0x4ad69d)),_0xd78b00=_0x15a460&&_0x15a460[0x1][_0x2952cf(0x1b0)]()===_0x2952cf(0x1b4)?_0x2952cf(0x1b4):_0x2952cf(0x19d);return{'type':'file','parentName':_0x1affc1,'targetDir':_0x4ed090,'configRoot':_0x4ed090,'filePath':_0x5a0743,'resourceName':_0x55a364,'folderPath':'','resourceType':_0xd78b00,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':'no_config','message':_0x2952cf(0x1bb)+_0x4ad69d,'arg':_0x4ad69d,'helpText':_0x2952cf(0x1ba)};}return{'type':_0x2952cf(0x1c1),'errorCode':_0x2952cf(0x1c8),'message':_0x2d232e,'arg':_0x4ad69d};}if(_0x4ad69d){const _0x2f5227=a101_0x202399[_0x2952cf(0x19b)](cwd,_0x4ad69d);let _0x53b54f=null;try{_0x53b54f=await fs[_0x2952cf(0x1ae)](_0x2f5227);}catch{}if(_0x53b54f?.[_0x2952cf(0x1bc)]()){const _0xc9b8d2=await findTdxConfigAsync(_0x2f5227,fs);if(_0xc9b8d2){const _0x111449=calculateScopedPath(_0x2f5227,_0xc9b8d2[_0x2952cf(0x1b2)]);return{'type':_0x2952cf(0x1be),'parentName':_0xc9b8d2[_0x2952cf(0x1c6)],'targetDir':_0x2f5227,'configRoot':_0xc9b8d2[_0x2952cf(0x1b2)],'isScoped':_0x111449['isScoped'],'scopedFolderPath':_0x111449[_0x2952cf(0x19c)]};}if(_0x1affc1)return{'type':_0x2952cf(0x1be),'parentName':_0x1affc1,'targetDir':_0x2f5227,'configRoot':_0x2f5227,'isScoped':![],'scopedFolderPath':''};return{'type':_0x2952cf(0x1c1),'errorCode':_0x2952cf(0x1a1),'message':_0x2952cf(0x19f)+_0x4ad69d,'arg':_0x4ad69d,'helpText':_0x2952cf(0x1ba)};}if(_0x53b54f?.[_0x2952cf(0x1ac)]())return{'type':'error','errorCode':'invalid_yaml','message':_0x2952cf(0x1bd)+_0x4ad69d,'arg':_0x4ad69d,'helpText':_0x2952cf(0x1a8)};const _0xfb4975=sanitizeFileName(_0x4ad69d),_0x5bd50a=getSegmentRootDir(_0xfb4975,cwd);return{'type':'parent_name','parentName':_0x4ad69d,'targetDir':_0x5bd50a,'configRoot':_0x5bd50a};}const _0x57ffcf=await findTdxConfigAsync(cwd,fs);if(_0x57ffcf){const _0x593440=calculateScopedPath(cwd,_0x57ffcf['configDir']);return{'type':'context','parentName':_0x57ffcf['parentSegment'],'targetDir':cwd,'configRoot':_0x57ffcf[_0x2952cf(0x1b2)],'isScoped':_0x593440[_0x2952cf(0x1b1)],'scopedFolderPath':_0x593440[_0x2952cf(0x19c)]};}if(_0x1affc1){const _0x4eb181=sanitizeFileName(_0x1affc1),_0x4de1ed=getSegmentRootDir(_0x4eb181,cwd);return{'type':_0x2952cf(0x199),'parentName':_0x1affc1,'targetDir':_0x4de1ed,'configRoot':_0x4de1ed,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x2952cf(0x1c1),'errorCode':'no_parent','message':'Parent\x20segment\x20not\x20specified','helpText':_0x2952cf(0x1a5)};}
1
+ (function(_0x4c0280,_0x172b6c){const _0x585c40=a101_0x1654,_0x1ee006=_0x4c0280();while(!![]){try{const _0x49ca40=parseInt(_0x585c40(0x11b))/0x1*(-parseInt(_0x585c40(0x10b))/0x2)+parseInt(_0x585c40(0x117))/0x3+-parseInt(_0x585c40(0xf4))/0x4*(parseInt(_0x585c40(0xf9))/0x5)+-parseInt(_0x585c40(0xf3))/0x6+parseInt(_0x585c40(0xf7))/0x7+-parseInt(_0x585c40(0x124))/0x8*(parseInt(_0x585c40(0x10d))/0x9)+parseInt(_0x585c40(0x111))/0xa;if(_0x49ca40===_0x172b6c)break;else _0x1ee006['push'](_0x1ee006['shift']());}catch(_0xcc739f){_0x1ee006['push'](_0x1ee006['shift']());}}}(a101_0xf4f7,0xbba38));function a101_0x1654(_0x4aba9e,_0x501ed5){_0x4aba9e=_0x4aba9e-0xf1;const _0xf4f7ae=a101_0xf4f7();let _0x165433=_0xf4f7ae[_0x4aba9e];return _0x165433;}import a101_0x536d8c 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';function a101_0xf4f7(){const _0x48d914=['message','readFile','stat','cwd','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','No\x20tdx.json\x20found\x20for\x20file:\x20','no_parent','parse','scopedFolderPath','Parent\x20segment\x20not\x20specified','dirname','tdx.json','match','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','journey','140484BcoySN','file','2277gtEcFA','error','isScoped','isFile','30155930GnoDJl','includes','segmentName','parentSegment','root','context','4443717edPpgs','invalid_yaml','File\x20not\x20found','resolve','17IWqQTS','folderPath','startsWith','segment','relative','trim','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','type','directory','33016dJWXFM','Not\x20a\x20YAML\x20file:\x20','exists','no_config','7403094eZwLnC','4RsAnwc','resourceType','isDirectory','4685457kvDGZp','configDir','4627605yvTFKG','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','File\x20not\x20found:\x20'];a101_0xf4f7=function(){return _0x48d914;};return a101_0xf4f7();}export function isSuccessfulResolution(_0x22f99f){const _0x4e52b3=a101_0x1654;return _0x22f99f[_0x4e52b3(0x122)]!==_0x4e52b3(0x10e);}export function isScopedResolution(_0xb596a9){const _0x54e4a8=a101_0x1654;return _0xb596a9[_0x54e4a8(0x122)]==='directory'||_0xb596a9[_0x54e4a8(0x122)]===_0x54e4a8(0x10c)||_0xb596a9[_0x54e4a8(0x122)]===_0x54e4a8(0x116);}export function getScopedDetails(_0x5a3f31){const _0x28aff4=a101_0x1654;if(isScopedResolution(_0x5a3f31))return{'isScoped':_0x5a3f31[_0x28aff4(0x10f)],'scopedFolderPath':_0x5a3f31[_0x28aff4(0x104)]};return undefined;}async function findTdxConfigAsync(_0x31adf0,_0x324360){const _0x5cdf55=a101_0x1654;let _0x527790=a101_0x536d8c[_0x5cdf55(0x11a)](_0x31adf0);const _0x140f16=a101_0x536d8c[_0x5cdf55(0x103)](_0x527790)[_0x5cdf55(0x115)];while(_0x527790!==_0x140f16){const _0x5b99e7=a101_0x536d8c['join'](_0x527790,_0x5cdf55(0x107));if(await _0x324360[_0x5cdf55(0xf1)](_0x5b99e7))try{const _0xbce139=await _0x324360[_0x5cdf55(0xfd)](_0x5b99e7),_0x4f806a=JSON[_0x5cdf55(0x103)](_0xbce139);if(_0x4f806a['parent_segment']&&typeof _0x4f806a['parent_segment']==='string')return{'configPath':_0x5b99e7,'configDir':_0x527790,'parentSegment':_0x4f806a['parent_segment']};}catch{}_0x527790=a101_0x536d8c[_0x5cdf55(0x106)](_0x527790);}return null;}function calculateScopedPath(_0x38144b,_0x31d9f7){const _0x1d3f1d=a101_0x1654,_0x19f6d3=a101_0x536d8c[_0x1d3f1d(0x11f)](_0x31d9f7,_0x38144b),_0x275e82=_0x19f6d3!==''&&_0x19f6d3!=='.'&&!_0x19f6d3[_0x1d3f1d(0x11d)]('..');return{'isScoped':_0x275e82,'scopedFolderPath':_0x275e82?_0x19f6d3['replace'](/\\/g,'/'):''};}export async function resolveTarget(_0x4f16b9){const _0x356101=a101_0x1654,{arg:_0x32321d,contextParent:_0x30b5ef,cwd:cwd=process[_0x356101(0xff)](),fs:fs=nodeFileSystem}=_0x4f16b9;if(_0x32321d&&isYamlFilePath(_0x32321d))try{const _0x48958d=await resolveYamlFilePath(_0x32321d,fs),_0x117dec=a101_0x536d8c['resolve'](_0x32321d),_0x20d1d3=a101_0x536d8c[_0x356101(0x106)](_0x117dec),_0xe2bb69=await findTdxConfigAsync(_0x20d1d3,fs);if(!_0xe2bb69){if(_0x30b5ef){const _0x4346cc=a101_0x536d8c['dirname'](_0x117dec);return{'type':_0x356101(0x10c),'parentName':_0x30b5ef,'targetDir':_0x4346cc,'configRoot':_0x4346cc,'filePath':_0x117dec,'resourceName':_0x48958d[_0x356101(0x113)],'folderPath':_0x48958d[_0x356101(0x11c)],'resourceType':_0x48958d[_0x356101(0xf5)],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x356101(0xf2),'message':_0x356101(0x101)+_0x32321d,'arg':_0x32321d,'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 _0x105d52=calculateScopedPath(_0x20d1d3,_0xe2bb69['configDir']);return{'type':_0x356101(0x10c),'parentName':_0xe2bb69['parentSegment'],'targetDir':_0xe2bb69[_0x356101(0xf8)],'configRoot':_0xe2bb69[_0x356101(0xf8)],'filePath':_0x117dec,'resourceName':_0x48958d[_0x356101(0x113)],'folderPath':_0x48958d[_0x356101(0x11c)],'resourceType':_0x48958d[_0x356101(0xf5)],'isScoped':_0x105d52[_0x356101(0x10f)],'scopedFolderPath':_0x105d52[_0x356101(0x104)]};}catch(_0x545410){const _0x25867a=_0x545410 instanceof Error?_0x545410[_0x356101(0xfc)]:String(_0x545410);if(_0x25867a[_0x356101(0x112)](_0x356101(0x119)))return{'type':_0x356101(0x10e),'errorCode':'file_not_found','message':_0x356101(0xfb)+_0x32321d,'arg':_0x32321d};if(_0x25867a[_0x356101(0x112)]('No\x20tdx.json\x20found')){if(_0x30b5ef){const _0x104134=a101_0x536d8c[_0x356101(0x11a)](_0x32321d);if(await fs[_0x356101(0xf1)](_0x104134)){const _0x516dab=a101_0x536d8c[_0x356101(0x106)](_0x104134),_0x38ea3f=await fs['readFile'](_0x104134),_0x863ab5=_0x38ea3f[_0x356101(0x108)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x3c9671=_0x38ea3f[_0x356101(0x108)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x5187bf=_0x863ab5?_0x863ab5[0x1]['trim']():a101_0x536d8c['basename'](_0x32321d,a101_0x536d8c['extname'](_0x32321d)),_0x36f136=_0x3c9671&&_0x3c9671[0x1][_0x356101(0x120)]()===_0x356101(0x10a)?_0x356101(0x10a):_0x356101(0x11e);return{'type':_0x356101(0x10c),'parentName':_0x30b5ef,'targetDir':_0x516dab,'configRoot':_0x516dab,'filePath':_0x104134,'resourceName':_0x5187bf,'folderPath':'','resourceType':_0x36f136,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x356101(0x10e),'errorCode':_0x356101(0xf2),'message':_0x356101(0x101)+_0x32321d,'arg':_0x32321d,'helpText':_0x356101(0x121)};}return{'type':'error','errorCode':'invalid_yaml','message':_0x25867a,'arg':_0x32321d};}if(_0x32321d){const _0x528373=a101_0x536d8c['resolve'](cwd,_0x32321d);let _0x1f9c4a=null;try{_0x1f9c4a=await fs[_0x356101(0xfe)](_0x528373);}catch{}if(_0x1f9c4a?.[_0x356101(0xf6)]()){const _0x1a0b92=await findTdxConfigAsync(_0x528373,fs);if(_0x1a0b92){const _0xd5dede=calculateScopedPath(_0x528373,_0x1a0b92['configDir']);return{'type':_0x356101(0x123),'parentName':_0x1a0b92[_0x356101(0x114)],'targetDir':_0x528373,'configRoot':_0x1a0b92[_0x356101(0xf8)],'isScoped':_0xd5dede[_0x356101(0x10f)],'scopedFolderPath':_0xd5dede[_0x356101(0x104)]};}if(_0x30b5ef)return{'type':_0x356101(0x123),'parentName':_0x30b5ef,'targetDir':_0x528373,'configRoot':_0x528373,'isScoped':![],'scopedFolderPath':''};return{'type':_0x356101(0x10e),'errorCode':_0x356101(0xf2),'message':_0x356101(0x100)+_0x32321d,'arg':_0x32321d,'helpText':_0x356101(0x121)};}if(_0x1f9c4a?.[_0x356101(0x110)]())return{'type':_0x356101(0x10e),'errorCode':_0x356101(0x118),'message':_0x356101(0x125)+_0x32321d,'arg':_0x32321d,'helpText':_0x356101(0x109)};const _0x4c604f=sanitizeFileName(_0x32321d),_0x1f02e0=getSegmentRootDir(_0x4c604f,cwd);return{'type':'parent_name','parentName':_0x32321d,'targetDir':_0x1f02e0,'configRoot':_0x1f02e0};}const _0x2c4908=await findTdxConfigAsync(cwd,fs);if(_0x2c4908){const _0x5f3260=calculateScopedPath(cwd,_0x2c4908[_0x356101(0xf8)]);return{'type':_0x356101(0x116),'parentName':_0x2c4908['parentSegment'],'targetDir':cwd,'configRoot':_0x2c4908[_0x356101(0xf8)],'isScoped':_0x5f3260[_0x356101(0x10f)],'scopedFolderPath':_0x5f3260[_0x356101(0x104)]};}if(_0x30b5ef){const _0x579e78=sanitizeFileName(_0x30b5ef),_0x134427=getSegmentRootDir(_0x579e78,cwd);return{'type':'context','parentName':_0x30b5ef,'targetDir':_0x134427,'configRoot':_0x134427,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x356101(0x10e),'errorCode':_0x356101(0x102),'message':_0x356101(0x105),'helpText':_0x356101(0xfa)};}
@@ -1 +1 @@
1
- const a102_0x2c3147=a102_0x3588;(function(_0x3fb225,_0x5b66e8){const _0x26d5d9=a102_0x3588,_0x38e9ec=_0x3fb225();while(!![]){try{const _0x12977b=-parseInt(_0x26d5d9(0x89))/0x1+-parseInt(_0x26d5d9(0x7f))/0x2+parseInt(_0x26d5d9(0x7e))/0x3+-parseInt(_0x26d5d9(0x7d))/0x4*(parseInt(_0x26d5d9(0x85))/0x5)+-parseInt(_0x26d5d9(0x90))/0x6+-parseInt(_0x26d5d9(0x82))/0x7*(parseInt(_0x26d5d9(0x81))/0x8)+parseInt(_0x26d5d9(0x7a))/0x9;if(_0x12977b===_0x5b66e8)break;else _0x38e9ec['push'](_0x38e9ec['shift']());}catch(_0x4f86b5){_0x38e9ec['push'](_0x38e9ec['shift']());}}}(a102_0x2f29,0xa999e));import{existsSync,readFileSync}from'fs';import a102_0x18c5e5 from'path';const TDX_CONFIG_FILE=a102_0x2c3147(0x8a),SEGMENTS_DIR=a102_0x2c3147(0x8b);function a102_0x3588(_0x357b12,_0x55e62f){_0x357b12=_0x357b12-0x79;const _0x2f2951=a102_0x2f29();let _0x358836=_0x2f2951[_0x357b12];return _0x358836;}export function findTdxConfigPath(_0x3c2020=process[a102_0x2c3147(0x79)]()){const _0x313baa=a102_0x2c3147;let _0x4e9c24=a102_0x18c5e5['resolve'](_0x3c2020);const _0xedb6df=a102_0x18c5e5['parse'](_0x4e9c24)['root'];while(_0x4e9c24!==_0xedb6df){const _0x112f70=a102_0x18c5e5[_0x313baa(0x8d)](_0x4e9c24,TDX_CONFIG_FILE);if(existsSync(_0x112f70))return _0x112f70;_0x4e9c24=a102_0x18c5e5[_0x313baa(0x91)](_0x4e9c24);}return null;}export function loadTdxConfig(_0xad41c6){const _0x3eba9f=a102_0x2c3147,_0x22ce22=readFileSync(_0xad41c6,_0x3eba9f(0x87));let _0x22eaa5;try{_0x22eaa5=JSON[_0x3eba9f(0x8e)](_0x22ce22);}catch{throw new Error(_0x3eba9f(0x83)+_0xad41c6);}if(!_0x22eaa5||typeof _0x22eaa5!==_0x3eba9f(0x8c))throw new Error(_0x3eba9f(0x84));const _0x74a8a3=_0x22eaa5;if(!_0x74a8a3[_0x3eba9f(0x8f)]||typeof _0x74a8a3['parent_segment']!=='string')throw new Error(_0x3eba9f(0x88));return{'parent_segment':_0x74a8a3['parent_segment']};}export function findTdxConfig(_0x98d9d4=process[a102_0x2c3147(0x79)]()){const _0x477761=a102_0x2c3147,_0x2e507c=findTdxConfigPath(_0x98d9d4);if(!_0x2e507c)throw new Error(_0x477761(0x80));const _0x3fdb72=loadTdxConfig(_0x2e507c),_0x35799a=a102_0x18c5e5[_0x477761(0x91)](_0x2e507c);return{'config':_0x3fdb72,'configPath':_0x2e507c,'configDir':_0x35799a};}export function tryFindTdxConfig(_0x18c293){try{return findTdxConfig(_0x18c293);}catch{return null;}}function a102_0x2f29(){const _0x365be0=['tdx.json','segments','object','join','parse','parent_segment','2541852PhBjsa','dirname','cwd','28756548mXnlpD','replace','stringify','644RpziHe','642870rQJtLl','903196KjjPpT','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','32YcjhIj','17710HkbwKL','Invalid\x20JSON\x20in\x20','Invalid\x20tdx.json:\x20expected\x20object','15920JHrQGp','relative','utf-8','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','1316792UZhwRf'];a102_0x2f29=function(){return _0x365be0;};return a102_0x2f29();}export function getSegmentRootDir(_0xfbc21b,_0x18e0de=process[a102_0x2c3147(0x79)]()){const _0x24be61=a102_0x2c3147;return a102_0x18c5e5[_0x24be61(0x8d)](_0x18e0de,SEGMENTS_DIR,_0xfbc21b);}export function getTdxConfigPath(_0x416d82,_0x29cbb1=process['cwd']()){const _0x50f3b2=a102_0x2c3147;return a102_0x18c5e5[_0x50f3b2(0x8d)](getSegmentRootDir(_0x416d82,_0x29cbb1),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x3ae8f3,_0x4002c0){const _0x332a7d=a102_0x2c3147,_0x36972e=a102_0x18c5e5['resolve'](_0x3ae8f3),_0x325182=a102_0x18c5e5[_0x332a7d(0x86)](_0x4002c0,_0x36972e);if(_0x325182['startsWith']('..'))return'';return _0x325182;}export function localPathToTdFolderPath(_0x531a63){const _0x37b1b0=a102_0x2c3147,_0x227f20=a102_0x18c5e5[_0x37b1b0(0x91)](_0x531a63);if(_0x227f20==='.'||_0x227f20==='')return'';return _0x227f20[_0x37b1b0(0x7b)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0xe4f79d,_0x2fecea){const _0x4067de=a102_0x2c3147;if(!_0xe4f79d)return _0x2fecea;return a102_0x18c5e5[_0x4067de(0x8d)](_0x2fecea,_0xe4f79d);}export function createTdxConfigContent(_0x509349){const _0x6f1392=a102_0x2c3147,_0x5447d1={'parent_segment':_0x509349};return JSON[_0x6f1392(0x7c)](_0x5447d1,null,0x2)+'\x0a';}
1
+ const a102_0x55e3dc=a102_0x2378;(function(_0x5f000c,_0x1ea146){const _0x1e304c=a102_0x2378,_0x3ef7d9=_0x5f000c();while(!![]){try{const _0x3f513b=parseInt(_0x1e304c(0x149))/0x1+parseInt(_0x1e304c(0x157))/0x2+-parseInt(_0x1e304c(0x148))/0x3+parseInt(_0x1e304c(0x152))/0x4*(parseInt(_0x1e304c(0x15b))/0x5)+-parseInt(_0x1e304c(0x154))/0x6*(parseInt(_0x1e304c(0x153))/0x7)+parseInt(_0x1e304c(0x14e))/0x8*(-parseInt(_0x1e304c(0x14f))/0x9)+parseInt(_0x1e304c(0x156))/0xa;if(_0x3f513b===_0x1ea146)break;else _0x3ef7d9['push'](_0x3ef7d9['shift']());}catch(_0x50a7b0){_0x3ef7d9['push'](_0x3ef7d9['shift']());}}}(a102_0x4413,0xa60c6));import{existsSync,readFileSync}from'fs';import a102_0x200278 from'path';const TDX_CONFIG_FILE=a102_0x55e3dc(0x14c),SEGMENTS_DIR=a102_0x55e3dc(0x147);export function findTdxConfigPath(_0x1832a9=process['cwd']()){const _0x2fad5d=a102_0x55e3dc;let _0x2ffd05=a102_0x200278['resolve'](_0x1832a9);const _0x12e615=a102_0x200278[_0x2fad5d(0x14a)](_0x2ffd05)[_0x2fad5d(0x155)];while(_0x2ffd05!==_0x12e615){const _0x1eaf0a=a102_0x200278[_0x2fad5d(0x15d)](_0x2ffd05,TDX_CONFIG_FILE);if(existsSync(_0x1eaf0a))return _0x1eaf0a;_0x2ffd05=a102_0x200278[_0x2fad5d(0x145)](_0x2ffd05);}return null;}export function loadTdxConfig(_0x243c6c){const _0x1e112c=a102_0x55e3dc,_0x39ac70=readFileSync(_0x243c6c,'utf-8');let _0x496ea6;try{_0x496ea6=JSON['parse'](_0x39ac70);}catch{throw new Error(_0x1e112c(0x15a)+_0x243c6c);}if(!_0x496ea6||typeof _0x496ea6!==_0x1e112c(0x14d))throw new Error(_0x1e112c(0x15c));const _0x185c12=_0x496ea6;if(!_0x185c12[_0x1e112c(0x158)]||typeof _0x185c12[_0x1e112c(0x158)]!==_0x1e112c(0x14b))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field');return{'parent_segment':_0x185c12[_0x1e112c(0x158)]};}function a102_0x2378(_0x2a6950,_0x51c3d4){_0x2a6950=_0x2a6950-0x145;const _0x4413ae=a102_0x4413();let _0x2378db=_0x4413ae[_0x2a6950];return _0x2378db;}export function findTdxConfig(_0x3f9251=process[a102_0x55e3dc(0x150)]()){const _0x51e7bd=a102_0x55e3dc,_0x2160d2=findTdxConfigPath(_0x3f9251);if(!_0x2160d2)throw new Error(_0x51e7bd(0x146));const _0x329c19=loadTdxConfig(_0x2160d2),_0x3ff98b=a102_0x200278[_0x51e7bd(0x145)](_0x2160d2);return{'config':_0x329c19,'configPath':_0x2160d2,'configDir':_0x3ff98b};}function a102_0x4413(){const _0x464956=['1446404dtZXCR','parent_segment','startsWith','Invalid\x20JSON\x20in\x20','28755KXLKRK','Invalid\x20tdx.json:\x20expected\x20object','join','dirname','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','segments','1741032pRHowp','134163KYPnEj','parse','string','tdx.json','object','23752enDARW','2304fHgfGI','cwd','replace','288CfcBlb','3245263oeoMZm','12FIdIVH','root','16763230iyqIQg'];a102_0x4413=function(){return _0x464956;};return a102_0x4413();}export function tryFindTdxConfig(_0x50ceff){try{return findTdxConfig(_0x50ceff);}catch{return null;}}export function getSegmentRootDir(_0x3b1efa,_0x1eeef8=process[a102_0x55e3dc(0x150)]()){const _0x3a6205=a102_0x55e3dc;return a102_0x200278[_0x3a6205(0x15d)](_0x1eeef8,SEGMENTS_DIR,_0x3b1efa);}export function getTdxConfigPath(_0x346587,_0x50cdc7=process[a102_0x55e3dc(0x150)]()){return a102_0x200278['join'](getSegmentRootDir(_0x346587,_0x50cdc7),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x2b019e,_0x5baba9){const _0xaa0581=a102_0x55e3dc,_0x2ee369=a102_0x200278['resolve'](_0x2b019e),_0x514981=a102_0x200278['relative'](_0x5baba9,_0x2ee369);if(_0x514981[_0xaa0581(0x159)]('..'))return'';return _0x514981;}export function localPathToTdFolderPath(_0xc573a3){const _0x1a58b6=a102_0x55e3dc,_0x438faf=a102_0x200278[_0x1a58b6(0x145)](_0xc573a3);if(_0x438faf==='.'||_0x438faf==='')return'';return _0x438faf[_0x1a58b6(0x151)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x3ef138,_0x405d1c){const _0x25104f=a102_0x55e3dc;if(!_0x3ef138)return _0x405d1c;return a102_0x200278[_0x25104f(0x15d)](_0x405d1c,_0x3ef138);}export function createTdxConfigContent(_0x329bf9){const _0xda985b={'parent_segment':_0x329bf9};return JSON['stringify'](_0xda985b,null,0x2)+'\x0a';}