@treasuredata/tdx 0.26.3 → 0.26.4

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 (169) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-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/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/personalization.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/realtime.js +1 -1
  102. package/dist/sdk/schedule.js +1 -1
  103. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/fields-display.js +1 -1
  105. package/dist/sdk/segment/file-discovery.js +1 -1
  106. package/dist/sdk/segment/journey-utils.js +1 -1
  107. package/dist/sdk/segment/journey-validator.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-recovery.js +1 -1
  113. package/dist/sdk/segment/push-workflow.js +1 -1
  114. package/dist/sdk/segment/resolution-context.js +1 -1
  115. package/dist/sdk/segment/segment-path-parser.js +1 -1
  116. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  117. package/dist/sdk/segment/target-resolution.js +1 -1
  118. package/dist/sdk/segment/tdx-config.js +1 -1
  119. package/dist/sdk/segment/validate-files.js +1 -1
  120. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  121. package/dist/sdk/segment/yaml-validator.js +1 -1
  122. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  123. package/dist/sdk/segment.js +1 -1
  124. package/dist/sdk/types/index.js +1 -1
  125. package/dist/sdk/types/progress.js +1 -1
  126. package/dist/sdk/user.js +1 -1
  127. package/dist/sdk/util/format-detector.js +1 -1
  128. package/dist/sdk/util/formatters.js +1 -1
  129. package/dist/sdk/util/index.js +1 -1
  130. package/dist/sdk/util/tree-formatter.js +1 -1
  131. package/dist/sdk/workflow/archive-validation.js +1 -1
  132. package/dist/sdk/workflow/clone-workflow.js +1 -1
  133. package/dist/sdk/workflow/index.js +1 -1
  134. package/dist/sdk/workflow/pull-workflow.js +1 -1
  135. package/dist/sdk/workflow/push-workflow.js +1 -1
  136. package/dist/sdk/workflow/tdx-config.js +1 -1
  137. package/dist/sdk/workflow/workflow-utils.js +1 -1
  138. package/dist/test-utils/command-runner.js +1 -1
  139. package/dist/test-utils/factories.js +1 -1
  140. package/dist/test-utils/fixtures.js +1 -1
  141. package/dist/test-utils/http-mock.js +1 -1
  142. package/dist/test-utils/index.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/global-cache.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  151. package/dist/utils/logger/formatters/index.js +1 -1
  152. package/dist/utils/logger/handlers/console-handler.js +1 -1
  153. package/dist/utils/logger/handlers/file-handler.js +1 -1
  154. package/dist/utils/logger/handlers/index.js +1 -1
  155. package/dist/utils/logger/handlers/null-handler.js +1 -1
  156. package/dist/utils/logger/index.js +1 -1
  157. package/dist/utils/logger/logger.js +1 -1
  158. package/dist/utils/logger/types.js +1 -1
  159. package/dist/utils/option-validation.js +1 -1
  160. package/dist/utils/port.js +1 -1
  161. package/dist/utils/process.js +1 -1
  162. package/dist/utils/prompt.js +1 -1
  163. package/dist/utils/spinner.js +1 -1
  164. package/dist/utils/sse-parser.js +1 -1
  165. package/dist/utils/string-utils.js +1 -1
  166. package/dist/utils/table-ref-parser.js +1 -1
  167. package/dist/utils/tdx-logger.js +1 -1
  168. package/dist/utils/version-check.js +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- const a114_0x2d62e8=a114_0x2264;(function(_0x4080a2,_0x1c44b7){const _0x335da7=a114_0x2264,_0x446edb=_0x4080a2();while(!![]){try{const _0x273cf7=parseInt(_0x335da7(0x170))/0x1*(parseInt(_0x335da7(0x18e))/0x2)+-parseInt(_0x335da7(0x22b))/0x3*(-parseInt(_0x335da7(0x147))/0x4)+parseInt(_0x335da7(0x193))/0x5*(parseInt(_0x335da7(0x1d3))/0x6)+-parseInt(_0x335da7(0x226))/0x7*(-parseInt(_0x335da7(0x22c))/0x8)+parseInt(_0x335da7(0x19d))/0x9*(-parseInt(_0x335da7(0x16b))/0xa)+parseInt(_0x335da7(0x20a))/0xb*(parseInt(_0x335da7(0x1a5))/0xc)+-parseInt(_0x335da7(0x139))/0xd*(parseInt(_0x335da7(0x167))/0xe);if(_0x273cf7===_0x1c44b7)break;else _0x446edb['push'](_0x446edb['shift']());}catch(_0x56ac95){_0x446edb['push'](_0x446edb['shift']());}}}(a114_0x12ff,0x9b84e));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a114_0x2d62e8(0x151));function a114_0x2264(_0x15c8ea,_0x454a7f){_0x15c8ea=_0x15c8ea-0x127;const _0x12ffc3=a114_0x12ff();let _0x2264a8=_0x12ffc3[_0x15c8ea];return _0x2264a8;}export const PENDING_SEGMENT_PREFIX=a114_0x2d62e8(0x13f);export const PENDING_ACTIVATION_PREFIX=a114_0x2d62e8(0x222);export function createPendingSegmentId(_0x2e2b5f){return''+PENDING_SEGMENT_PREFIX+_0x2e2b5f+'__';}export function isPendingSegmentId(_0x2fdc3d){return _0x2fdc3d['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x2fdc3d['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x2681c6){const _0x15c87f=a114_0x2d62e8;return _0x2681c6[_0x15c87f(0x16e)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x31a14d){return''+PENDING_ACTIVATION_PREFIX+_0x31a14d+'__';}export function isPendingActivationId(_0x925b05){const _0x4fadb6=a114_0x2d62e8;return _0x925b05[_0x4fadb6(0x1e3)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x585546){return _0x585546['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x48a3ba,_0x464525){const _0x448841=a114_0x2d62e8,_0x4c30c2=_0x48a3ba+'::'+(_0x464525[_0x448841(0x143)]()||_0x448841(0x219)),_0x2be93e=createHash(_0x448841(0x130))[_0x448841(0x201)](_0x4c30c2)[_0x448841(0x1aa)](_0x448841(0x1c8))['slice'](0x0,0xc);return _0x448841(0x210)+_0x2be93e;}export function ensureJourneyDefaults(_0x2c3c69){const _0x58df9e=a114_0x2d62e8;!_0x2c3c69['description']&&(_0x2c3c69[_0x58df9e(0x1e1)]=''),!_0x2c3c69[_0x58df9e(0x1a7)]&&(_0x2c3c69[_0x58df9e(0x1a7)]=_0x58df9e(0x233));}export function resolveTDFolderPath(_0x3043f5,_0x43c71f,_0x38505c){const _0x14e7af=a114_0x2d62e8;if(!_0x43c71f)return _0x3043f5;if(_0x3043f5===_0x38505c||_0x3043f5[_0x14e7af(0x1e3)](_0x38505c+'/'))return _0x3043f5;return _0x3043f5?_0x38505c+'/'+_0x3043f5:_0x38505c;}export function addFoldersToCreate(_0x16f3cb,_0x1621b2,_0x1480e7){const _0x3b44d5=a114_0x2d62e8;if(!_0x16f3cb)return;if(_0x1621b2[_0x3b44d5(0x1b2)](_0x16f3cb))return;const _0x22dba9=_0x16f3cb['split']('/');let _0x2d038b='';for(const _0x24ec6e of _0x22dba9){_0x2d038b=_0x2d038b?_0x2d038b+'/'+_0x24ec6e:_0x24ec6e,!_0x1621b2[_0x3b44d5(0x1b2)](_0x2d038b)&&_0x1480e7[_0x3b44d5(0x1d9)](_0x2d038b);}}import*as a114_0x41aa40 from'yaml';import{readFileSync}from'fs';import a114_0x306e1b from'path';import{isJourneyDef,parseYamlString as a114_0x12465b,toYamlString as a114_0x42da57,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{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x2bce9e){const _0x5d83eb=a114_0x2d62e8;if(Array[_0x5d83eb(0x1ea)](_0x2bce9e))return'['+_0x2bce9e[_0x5d83eb(0x1ac)](_0x1cc8f9=>stableStringify(_0x1cc8f9))[_0x5d83eb(0x212)](',')+']';if(_0x2bce9e&&typeof _0x2bce9e===_0x5d83eb(0x21d)){const _0x4c6a02=_0x2bce9e,_0x48e99f=Object[_0x5d83eb(0x1e8)](_0x4c6a02)[_0x5d83eb(0x22f)](),_0x416b66=_0x48e99f[_0x5d83eb(0x1ac)](_0x493cb1=>'\x22'+_0x493cb1+'\x22:'+stableStringify(_0x4c6a02[_0x493cb1]));return'{'+_0x416b66[_0x5d83eb(0x212)](',')+'}';}const _0x495603=JSON[_0x5d83eb(0x1ba)](_0x2bce9e);return _0x495603===undefined?_0x5d83eb(0x230):_0x495603;}function activationSignature(_0x232e2d){const _0x501bbd=a114_0x2d62e8,_0x13ce96={'connection':_0x232e2d[_0x501bbd(0x190)],..._0x232e2d[_0x501bbd(0x15b)]!==undefined&&{'all_columns':_0x232e2d['all_columns']},..._0x232e2d[_0x501bbd(0x1ce)]!==undefined&&{'columns':_0x232e2d[_0x501bbd(0x1ce)]},..._0x232e2d['behavior']!==undefined&&{'behavior':_0x232e2d[_0x501bbd(0x155)]},..._0x232e2d[_0x501bbd(0x21e)]!==undefined&&{'schedule':_0x232e2d[_0x501bbd(0x21e)]},..._0x232e2d[_0x501bbd(0x175)]!==undefined&&{'notification':_0x232e2d[_0x501bbd(0x175)]},..._0x232e2d[_0x501bbd(0x134)]!==undefined&&{'connector_config':_0x232e2d[_0x501bbd(0x134)]},..._0x232e2d[_0x501bbd(0x132)]!==undefined&&{'activation_template_id':_0x232e2d[_0x501bbd(0x132)]}};return stableStringify(_0x13ce96);}async function fetchSegment(_0x5b48a5,_0x252b2b,_0x48579c,_0x3c5344){const _0x1983e5=a114_0x2d62e8,_0x26d839=_0x3c5344?.['find'](_0x19dc2e=>_0x19dc2e['id']===_0x48579c);if(_0x26d839)return _0x26d839;try{return await _0x5b48a5[_0x1983e5(0x219)][_0x1983e5(0x144)](_0x252b2b,_0x48579c);}catch(_0x29f37c){logger[_0x1983e5(0x1f9)](_0x1983e5(0x1d5)+_0x48579c+_0x1983e5(0x189)+_0x29f37c);try{return await _0x5b48a5[_0x1983e5(0x219)][_0x1983e5(0x1cc)](_0x48579c);}catch(_0xa92d21){return logger[_0x1983e5(0x1f9)](_0x1983e5(0x1c5)+_0x48579c+':\x20'+_0xa92d21),null;}}}function recoverSegmentIdsFromPushRecovery(_0x59abbb,_0x200e2b,_0x473ad2){const _0x23c946=a114_0x2d62e8,_0xfaf246=readPushRecovery(_0x59abbb['absolutePath']);if(_0xfaf246?.[_0x23c946(0x196)]===_0x59abbb[_0x23c946(0x12a)][_0x23c946(0x14d)])for(const [_0x5b9518,_0x426a99]of Object[_0x23c946(0x1c7)](_0xfaf246[_0x23c946(0x1ab)])){const _0x4c2ef5=generateDeterministicJourneySegmentName(_0x59abbb[_0x23c946(0x12a)]['name'],_0x5b9518);_0x426a99[_0x23c946(0x152)]===_0x4c2ef5&&(_0x200e2b['set'](_0x5b9518,_0x426a99[_0x23c946(0x184)]),_0x473ad2['set'](_0x5b9518,_0x426a99['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x5ea5ca,_0x24bb66,_0x333d3c,_0xd7b0ee){const _0x278ab2=a114_0x2d62e8;let _0x2e7299;try{_0x2e7299=await _0x5ea5ca[_0x278ab2(0x219)][_0x278ab2(0x1bf)]({'name':_0x333d3c['uniqueSegmentName'],'description':_0x333d3c[_0x278ab2(0x1e1)],'journeyId':_0x333d3c[_0x278ab2(0x153)],'rule':_0xd7b0ee(_0x333d3c[_0x278ab2(0x14c)],!![]),'countPopulation':!![],'parentFolderId':_0x333d3c['folderId'],'audienceId':_0x333d3c['parentId']});}catch(_0x39d2e9){const _0x1bdc97=_0x39d2e9 instanceof Error&&_0x39d2e9[_0x278ab2(0x16a)][_0x278ab2(0x161)]('Name\x20has\x20already\x20been\x20taken');if(_0x1bdc97){const _0x339fe2=readPushRecovery(_0x24bb66[_0x278ab2(0x1b4)]),_0x10a596=_0x339fe2?.[_0x278ab2(0x196)]===_0x24bb66['yamlConfig'][_0x278ab2(0x14d)]?_0x339fe2['segments'][_0x333d3c[_0x278ab2(0x1da)]]:undefined;if(_0x10a596?.[_0x278ab2(0x152)]===_0x333d3c[_0x278ab2(0x176)])await _0x5ea5ca[_0x278ab2(0x219)][_0x278ab2(0x192)](_0x333d3c[_0x278ab2(0x15a)],_0x10a596[_0x278ab2(0x184)],{'description':_0x333d3c[_0x278ab2(0x1e1)],'rule':_0xd7b0ee(_0x333d3c[_0x278ab2(0x14c)],!![]),'countPopulation':!![]}),_0x2e7299=_0x10a596[_0x278ab2(0x184)];else throw new SDKError(ErrorCode[_0x278ab2(0x225)],_0x278ab2(0x1f2)+_0x333d3c[_0x278ab2(0x1da)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x278ab2(0x1ae)+_0x24bb66[_0x278ab2(0x1b4)][_0x278ab2(0x16e)](/([^/]+)$/,_0x278ab2(0x21c))+')\x20')+_0x278ab2(0x16c),_0x39d2e9);}else throw _0x39d2e9;}return saveSegmentToPushRecovery(_0x24bb66['absolutePath'],_0x24bb66['yamlConfig']['name'],_0x333d3c[_0x278ab2(0x1da)],{'segmentId':_0x2e7299,'uniqueServerName':_0x333d3c[_0x278ab2(0x176)],'createdAt':new Date()[_0x278ab2(0x191)]()}),_0x2e7299;}export async function prepareSegmentFiles(_0x4de9c9,_0x2bfa71,_0x15c496,_0x5c3b77,_0x353ddd){const _0x60b325=a114_0x2d62e8,{activationDefToCreateRequest:_0x359a80}=await import(_0x60b325(0x1fb)),_0x428841=[],_0x57ef01=new Set();for(const {yamlConfig:_0x283624,folderPath:_0x1d80cf,sourcePath:_0x41a2bc}of _0x4de9c9){const _0x298f9c=resolveTDFolderPath(_0x1d80cf,_0x5c3b77,_0x353ddd),_0x4f466d=_0x298f9c+':'+_0x283624[_0x60b325(0x14d)],_0x340959=_0x2bfa71[_0x60b325(0x181)][_0x60b325(0x1ad)](_0x4f466d),_0x53660d=_0x340959?_0x2bfa71[_0x60b325(0x203)][_0x60b325(0x1ad)](_0x340959['id'])||[]:[];addFoldersToCreate(_0x298f9c,_0x2bfa71[_0x60b325(0x20c)],_0x57ef01);const _0x536eb4=calculateActivationActions(_0x283624['activations']||[],_0x53660d,_0x2bfa71['idToEmailMap'],_0x2bfa71[_0x60b325(0x146)]);for(const _0x3e868d of _0x536eb4){(_0x3e868d[_0x60b325(0x1bd)]===_0x60b325(0x150)||_0x3e868d[_0x60b325(0x1bd)]===_0x60b325(0x201))&&_0x3e868d['yamlActivation']&&(_0x3e868d[_0x60b325(0x159)]=await _0x359a80(_0x3e868d[_0x60b325(0x197)],_0x15c496));}const _0x252f78=calculateSegmentDiff(_0x283624,_0x340959,_0x53660d,_0x2bfa71['idToEmailMap'],_0x2bfa71[_0x60b325(0x146)]);_0x428841[_0x60b325(0x1dd)]({'relativePath':_0x283624[_0x60b325(0x14d)],'absolutePath':_0x41a2bc,'yamlConfig':_0x283624,'folderPath':_0x298f9c,'existingSegment':_0x340959,'existingActivations':_0x53660d,'isNew':_0x252f78['isNew'],'hasChanges':_0x252f78[_0x60b325(0x12d)],'diff':_0x252f78['diff'],'activationActions':_0x536eb4});}return{'segmentFiles':_0x428841,'foldersToCreate':_0x57ef01};}export async function prepareJourneyFiles(_0x3429e9,_0x3e23ed,_0x35985d,_0x3cb98b){const _0x16948d=a114_0x2d62e8,_0x1434e8=[],_0x3c295f=new Set();for(const {yamlConfig:_0x5f3c9b,folderPath:_0x5acebb,sourcePath:_0x205244}of _0x3429e9){const _0x4f7060=resolveTDFolderPath(_0x5acebb,_0x35985d,_0x3cb98b),_0x18585e=_0x4f7060+':'+_0x5f3c9b[_0x16948d(0x14d)],_0x2c7926=_0x3e23ed[_0x16948d(0x1a1)][_0x16948d(0x1ad)](_0x18585e);let _0x24760b,_0x13832;if(_0x2c7926&&_0x2c7926[_0x16948d(0x19b)]>0x0){const _0x2517a0=buildLocalExpandedRuleMappings(_0x5f3c9b),{createYamlContext:_0x18b488,prefetchJourneySegments:_0x1a5ce7}=createPushYamlContextForBundle(_0x3e23ed[_0x16948d(0x140)],_0x3e23ed[_0x16948d(0x15a)],_0x3e23ed[_0x16948d(0x1c1)],_0x2517a0,_0x3e23ed['idToEmailMap'],_0x3e23ed[_0x16948d(0x146)],_0x3e23ed[_0x16948d(0x19f)],_0x3e23ed['journeyById']);await _0x1a5ce7(_0x2c7926['map'](_0x194701=>_0x194701['id']));const _0x2c5a30=hasMultipleVersions(_0x5f3c9b),_0x44c316=async _0x3a4253=>{const _0x2b2021=_0x16948d,_0x47f3f3=_0x3e23ed[_0x2b2021(0x13e)]?.[_0x2b2021(0x1ad)](_0x3a4253);if(_0x47f3f3)return _0x47f3f3;return _0x3e23ed[_0x2b2021(0x228)]({'journeyId':_0x3a4253,'journeyName':_0x5f3c9b[_0x2b2021(0x14d)],'isMultiVersion':_0x2c7926[_0x2b2021(0x19b)]>0x1});};if(_0x2c5a30&&_0x2c7926['length']>0x1){const _0x50c7d6=[];for(const _0x3ecd5d of _0x2c7926){const _0x31f331=_0x3ecd5d['versionNumber']||0x1;_0x3e23ed[_0x16948d(0x1a0)]?.[_0x16948d(0x201)]('Fetching\x20'+_0x5f3c9b[_0x16948d(0x14d)]+'\x20v'+_0x31f331);const _0x336637=await _0x44c316(_0x3ecd5d['id']),_0xd5ea67=_0x18b488(_0x3ecd5d['id']),_0x1f0e7e=await journeyResponseToDef(_0x336637,_0xd5ea67);_0x50c7d6[_0x16948d(0x1dd)]({'item':_0x3ecd5d,'yaml':_0x1f0e7e});}const _0x4f46b9=buildLocalRuleToNameMappingFromJourney(_0x5f3c9b);_0x13832=buildMergedJourneyDef(_0x50c7d6,_0x4f46b9);const _0x46a67e=Math['max'](..._0x50c7d6[_0x16948d(0x1ac)](_0x51844d=>_0x51844d[_0x16948d(0x183)][_0x16948d(0x19c)]||0x0)),_0x470609=_0x2c7926['find'](_0x15d782=>(_0x15d782[_0x16948d(0x19c)]||0x0)===_0x46a67e);_0x470609&&(_0x3e23ed[_0x16948d(0x1a0)]?.[_0x16948d(0x201)](_0x16948d(0x17b)+_0x5f3c9b['name']+'\x20v'+_0x46a67e),_0x24760b=await _0x44c316(_0x470609['id']));}else{const _0x2a7f0c=_0x2c7926[_0x2c7926[_0x16948d(0x19b)]-0x1];_0x3e23ed[_0x16948d(0x1a0)]?.[_0x16948d(0x201)](_0x16948d(0x17b)+_0x5f3c9b[_0x16948d(0x14d)]),_0x24760b=await _0x44c316(_0x2a7f0c['id']);const _0xa0e68b=_0x18b488(_0x2a7f0c['id']),_0x4cb2d5=await journeyResponseToDef(_0x24760b,_0xa0e68b),_0x5839dd=buildLocalRuleToNameMappingFromJourney(_0x5f3c9b);_0x13832=buildMergedJourneyDef([{'item':_0x2a7f0c,'yaml':_0x4cb2d5}],_0x5839dd);}}addFoldersToCreate(_0x4f7060,_0x3e23ed[_0x16948d(0x20c)],_0x3c295f);const _0x53d9a8=calculateJourneyDiff(_0x5f3c9b,_0x13832);_0x1434e8[_0x16948d(0x1dd)]({'relativePath':_0x5f3c9b[_0x16948d(0x14d)],'absolutePath':_0x205244,'yamlConfig':_0x5f3c9b,'folderPath':_0x4f7060,'existingJourney':_0x24760b,'isNew':_0x53d9a8['isNew'],'hasChanges':_0x53d9a8[_0x16948d(0x12d)],'diff':_0x53d9a8[_0x16948d(0x17a)]});}return{'journeyFiles':_0x1434e8,'foldersToCreate':_0x3c295f};}export function calculateActivationActions(_0x5eaf2c,_0x1d1fa8,_0x2b26e2,_0x2aab46){const _0x5c396d=a114_0x2d62e8,_0x4ca1a9=[],_0x2d2bc3=new Map();for(const _0x281524 of _0x1d1fa8){_0x2d2bc3[_0x5c396d(0x14a)](_0x281524[_0x5c396d(0x14d)],_0x281524);}const _0x537b64=new Map();for(const _0x3823d4 of _0x5eaf2c){_0x537b64[_0x5c396d(0x14a)](_0x3823d4[_0x5c396d(0x14d)],_0x3823d4);}for(const _0x282bae of _0x5eaf2c){const _0x4e1ee7=_0x2d2bc3[_0x5c396d(0x1ad)](_0x282bae['name']);if(!_0x4e1ee7)_0x4ca1a9[_0x5c396d(0x1dd)]({'type':_0x5c396d(0x150),'name':_0x282bae[_0x5c396d(0x14d)],'yamlActivation':_0x282bae});else{const _0x91e0e3=activationResponseToDef(_0x4e1ee7,_0x2b26e2,_0x2aab46),_0x10414f=a114_0x41aa40[_0x5c396d(0x1ba)](_0x91e0e3),_0x2b7a32=a114_0x41aa40[_0x5c396d(0x1ba)](_0x282bae);_0x10414f!==_0x2b7a32&&_0x4ca1a9['push']({'type':_0x5c396d(0x201),'name':_0x282bae[_0x5c396d(0x14d)],'yamlActivation':_0x282bae,'existingActivation':_0x4e1ee7});}}for(const _0x229427 of _0x1d1fa8){!_0x537b64[_0x5c396d(0x1b2)](_0x229427['name'])&&_0x4ca1a9['push']({'type':_0x5c396d(0x1c4),'name':_0x229427[_0x5c396d(0x14d)],'existingActivation':_0x229427});}return _0x4ca1a9;}function calculateYamlDiff(_0x5ca34a,_0x4a14d3){if(_0x4a14d3){const _0x405070=generateDiff(_0x4a14d3,_0x5ca34a),_0x422aff=hasChanges(_0x405070);return{'isNew':![],'hasChanges':_0x422aff,'diff':_0x422aff?formatDiffWithColors(_0x405070):undefined};}const _0x2b8fbd=generateDiff('',_0x5ca34a);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2b8fbd)};}export function calculateSegmentDiff(_0x50fd59,_0x4b389a,_0x326676,_0x394e0b,_0x23d8bf){const _0x38e5d8=segmentToYamlString(_0x50fd59),_0x5e236f=_0x4b389a?segmentToYamlString(segmentWithActivationsToYaml(_0x4b389a,_0x326676,undefined,_0x394e0b,_0x23d8bf)):undefined;return calculateYamlDiff(_0x38e5d8,_0x5e236f);}export function calculateJourneyDiff(_0x338aa8,_0x4adc0d){const _0x1a5cee=normalizeJourneyDef(_0x338aa8,_0x338aa8),_0x433182=a114_0x42da57(_0x1a5cee),_0x5332cb=_0x4adc0d?a114_0x42da57(normalizeJourneyDef(_0x4adc0d,_0x338aa8)):undefined;return calculateYamlDiff(_0x433182,_0x5332cb);}export function findSegmentsToDelete(_0x419b09,_0x5ba481,_0x43b44b,_0x37d7a4,_0x213444){const _0x3bd11e=a114_0x2d62e8,_0x124d3d=new Set();for(const {yamlConfig:_0x29ecfb,folderPath:_0x3dcb22}of _0x5ba481){_0x124d3d[_0x3bd11e(0x1d9)](_0x3dcb22+':'+_0x29ecfb[_0x3bd11e(0x14d)]);}return _0x419b09[_0x3bd11e(0x141)](_0x398dcd=>{const _0x370e00=_0x3bd11e,_0x10bd71=_0x398dcd[_0x370e00(0x1f4)]?_0x43b44b[_0x370e00(0x1ad)](_0x398dcd[_0x370e00(0x1f4)][_0x370e00(0x169)]())||'':'',_0x46cdd9=_0x10bd71+':'+_0x398dcd[_0x370e00(0x14d)];if(_0x124d3d[_0x370e00(0x1b2)](_0x46cdd9))return![];if(_0x213444)return _0x10bd71===_0x37d7a4||_0x10bd71['startsWith'](_0x37d7a4+'/');return!![];});}export function findJourneysToDelete(_0x35feff,_0x16f476,_0x33c84c,_0x9e1891,_0x10b8a4){const _0x5ab94d=a114_0x2d62e8,_0x3f1ebb=new Set();for(const {yamlConfig:_0x5cd609,folderPath:_0x1c96b}of _0x16f476){_0x3f1ebb[_0x5ab94d(0x1d9)](_0x1c96b+':'+_0x5cd609[_0x5ab94d(0x14d)]);}return _0x35feff[_0x5ab94d(0x141)](_0x20504f=>{const _0x2d8f7a=_0x5ab94d,_0x145735=_0x20504f['folderId']?_0x33c84c['get'](_0x20504f[_0x2d8f7a(0x224)])||'':'',_0x1dc25f=_0x145735+':'+_0x20504f[_0x2d8f7a(0x21a)];if(_0x3f1ebb[_0x2d8f7a(0x1b2)](_0x1dc25f))return![];if(_0x10b8a4)return _0x145735===_0x9e1891||_0x145735['startsWith'](_0x9e1891+'/');return!![];});}export function buildSegmentLookupMap(_0x28b57f,_0x44c85b){const _0x6df21e=a114_0x2d62e8,_0x47b9d1=new Map();for(const _0x2beecb of _0x28b57f){const _0x107463=_0x2beecb[_0x6df21e(0x1f4)]?_0x44c85b[_0x6df21e(0x1ad)](_0x2beecb[_0x6df21e(0x1f4)][_0x6df21e(0x169)]())||'':'',_0x261512=_0x107463+':'+_0x2beecb[_0x6df21e(0x14d)];_0x47b9d1[_0x6df21e(0x14a)](_0x261512,_0x2beecb);}return _0x47b9d1;}export function buildSegmentNameToIdMap(_0x1e0b30){const _0x1968e7=a114_0x2d62e8,_0x2fc258=new Map();for(const _0x41f9c8 of _0x1e0b30){_0x2fc258['set'](_0x41f9c8[_0x1968e7(0x14d)],_0x41f9c8['id']);}return _0x2fc258;}export function buildJourneyBundleLookupMap(_0x5e7681,_0x367d5a){const _0x54fe3a=a114_0x2d62e8,_0x16dd6a=new Map();for(const _0xeff505 of _0x5e7681){const _0x3f98db=_0xeff505[_0x54fe3a(0x224)]?_0x367d5a['get'](_0xeff505[_0x54fe3a(0x224)])||'':'',_0x5c0407=_0x3f98db+':'+_0xeff505['journeyBundleName'];!_0x16dd6a['has'](_0x5c0407)&&_0x16dd6a[_0x54fe3a(0x14a)](_0x5c0407,[]),_0x16dd6a[_0x54fe3a(0x1ad)](_0x5c0407)['push'](_0xeff505);}for(const _0x3e642f of _0x16dd6a[_0x54fe3a(0x1d2)]()){_0x3e642f[_0x54fe3a(0x22f)]((_0x87825d,_0x5b43f0)=>(_0x87825d[_0x54fe3a(0x19c)]||0x0)-(_0x5b43f0[_0x54fe3a(0x19c)]||0x0));}return _0x16dd6a;}export function collectFoldersToCreate(_0x5c42da,_0x37a499){const _0x75d2ef=a114_0x2d62e8,_0x1b2c0d=new Set();for(const _0x9fb63a of _0x5c42da){if(!_0x9fb63a)continue;if(_0x37a499[_0x75d2ef(0x1b2)](_0x9fb63a))continue;const _0x4193b7=_0x9fb63a[_0x75d2ef(0x205)]('/');let _0x1c8350='';for(const _0x148e68 of _0x4193b7){_0x1c8350=_0x1c8350?_0x1c8350+'/'+_0x148e68:_0x148e68,!_0x37a499[_0x75d2ef(0x1b2)](_0x1c8350)&&_0x1b2c0d[_0x75d2ef(0x1d9)](_0x1c8350);}}return _0x1b2c0d;}export function parseAndClassifyYamlFiles(_0x4c943a,_0x1113a9,_0x1e2df5){const _0x355262=a114_0x2d62e8,_0x40dcf2=[],_0xf502c5=[];for(const _0x1b297c of _0x4c943a){const _0x4896ff=a114_0x306e1b[_0x355262(0x220)](_0x1113a9,a114_0x306e1b[_0x355262(0x204)](_0x1b297c)),_0x4a0dab=_0x4896ff==='.'?'':_0x4896ff,_0x392c8c=readFileSync(_0x1b297c,'utf-8'),_0xa0f333=a114_0x41aa40[_0x355262(0x1c2)](_0x392c8c);if(isJourneyDef(_0xa0f333)){const _0x31a473=a114_0x12465b(_0x392c8c);_0xf502c5['push']({'yamlConfig':_0x31a473,'folderPath':_0x4a0dab,'sourcePath':_0x1b297c});}else{if(!_0x1e2df5?.[_0x355262(0x17d)]){const _0x1e187f=parseSegmentYamlFile(_0x392c8c),_0x1949fa=normalizeChildSegmentYaml(_0x1e187f);_0x40dcf2['push']({'yamlConfig':_0x1949fa,'folderPath':_0x4a0dab,'sourcePath':_0x1b297c});}}}return{'segments':_0x40dcf2,'journeys':_0xf502c5};}export function validateParsedFiles(_0x15621a,_0x3c3068){const _0x36eb8b=a114_0x2d62e8,_0x2ea03f=[];for(const {yamlConfig:_0x2b5f69,sourcePath:_0x462b2c}of _0x15621a[_0x36eb8b(0x1ab)]){const _0x2a7280=readFileSync(_0x462b2c,'utf-8'),_0x575a0b=a114_0x41aa40[_0x36eb8b(0x163)](_0x2a7280),_0x4f12fe=validateSegmentDef(_0x2b5f69,{'source':_0x2a7280,'document':_0x575a0b});if(!_0x4f12fe['valid']){const _0x1d25ee=a114_0x306e1b[_0x36eb8b(0x220)](_0x3c3068,_0x462b2c);_0x2ea03f[_0x36eb8b(0x1dd)]({'filePath':_0x1d25ee,'source':_0x2a7280,'result':_0x4f12fe,'isJourney':![]});}}for(const {yamlConfig:_0x2d2b8f,sourcePath:_0x12ea2f}of _0x15621a[_0x36eb8b(0x13b)]){const _0x6b6d73=readFileSync(_0x12ea2f,_0x36eb8b(0x1b6)),_0x11fe63=a114_0x41aa40[_0x36eb8b(0x163)](_0x6b6d73),_0x13f39f=validateJourneyDef(_0x2d2b8f,{'source':_0x6b6d73,'document':_0x11fe63});if(!_0x13f39f[_0x36eb8b(0x1b1)]){const _0x387d4a=a114_0x306e1b['relative'](_0x3c3068,_0x12ea2f);_0x2ea03f[_0x36eb8b(0x1dd)]({'filePath':_0x387d4a,'source':_0x6b6d73,'result':_0x13f39f,'isJourney':!![]});}}return _0x2ea03f;}export function formatValidationErrors(_0x15c298){const _0x2a0c4d=a114_0x2d62e8,_0x22d532=[];for(const {filePath:_0x493550,source:_0x48a737,result:_0x195e54,isJourney:_0x30843b}of _0x15c298){const _0x345ad3=_0x30843b?_0x2a0c4d(0x231):'segment';_0x22d532[_0x2a0c4d(0x1dd)]('\x0a'+_0x493550+'\x20('+_0x345ad3+_0x2a0c4d(0x14e)+_0x195e54[_0x2a0c4d(0x12f)][_0x2a0c4d(0x19b)]+_0x2a0c4d(0x145)),_0x22d532['push'](formatValidationResult(_0x195e54,_0x48a737,_0x493550));}return _0x22d532[_0x2a0c4d(0x212)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x153e7a){const _0x1ee06c=a114_0x2d62e8,_0x39fdba=new Set(),_0x1103d6=new Map(),_0xac1896=collectSegmentUsageCounts(_0x153e7a);if(_0x153e7a[_0x1ee06c(0x1ab)])for(const [_0x1e5cc5,_0x4b7688]of Object[_0x1ee06c(0x1c7)](_0x153e7a[_0x1ee06c(0x1ab)])){_0x39fdba['add'](_0x1e5cc5);if(_0x4b7688['rule']){const _0x2c7ef4=yamlRuleToApi(_0x4b7688[_0x1ee06c(0x215)]),_0x445966=apiRuleToYaml(_0x2c7ef4);_0x1103d6[_0x1ee06c(0x14a)](_0x1e5cc5,_0x445966);}}const _0x487e6a=new Map();let _0x1f5bb7=0x0;for(const [_0x20014c,_0x2b11a8]of _0x1103d6){const _0x48e5fb=serializeExpandedRule(_0x2b11a8,_0x1103d6),_0x38dfe2=_0x487e6a['get'](_0x48e5fb)||[];_0x38dfe2[_0x1ee06c(0x1dd)]({'name':_0x20014c,'index':_0x1f5bb7}),_0x487e6a[_0x1ee06c(0x14a)](_0x48e5fb,_0x38dfe2),_0x1f5bb7++;}const _0x3ce6dd=new Map();for(const [_0x21cbd2,_0x531819]of _0x487e6a){const _0x257ccc=_0x531819[_0x1ee06c(0x1ef)]()[_0x1ee06c(0x22f)]((_0x17278e,_0x2efbe0)=>{const _0x4853d3=_0x1ee06c,_0x1b579f=_0xac1896[_0x4853d3(0x1ad)](_0x17278e[_0x4853d3(0x14d)])||0x0,_0x199dc3=_0xac1896['get'](_0x2efbe0[_0x4853d3(0x14d)])||0x0;if(_0x1b579f!==_0x199dc3)return _0x199dc3-_0x1b579f;return _0x17278e[_0x4853d3(0x20b)]-_0x2efbe0[_0x4853d3(0x20b)];})[_0x1ee06c(0x1ac)](_0x1f4661=>_0x1f4661['name']),_0xc98af7=[];for(const _0x188a3a of _0x257ccc){const _0x1201e6=_0xac1896[_0x1ee06c(0x1ad)](_0x188a3a)||0x0,_0x5400b4=Math[_0x1ee06c(0x221)](_0x1201e6,0x1);for(let _0x3020ae=0x0;_0x3020ae<_0x5400b4;_0x3020ae++){_0xc98af7[_0x1ee06c(0x1dd)](_0x188a3a);}}_0x3ce6dd[_0x1ee06c(0x14a)](_0x21cbd2,_0xc98af7);}return{'existingLocalSegmentNames':_0x39fdba,'localSegmentRules':_0x1103d6,'localExpandedRuleToNames':_0x3ce6dd};}export function createSegmentIdResolver(_0x4900b0,_0x4e9af1){return async _0x3de369=>{const _0x406f62=a114_0x2264,_0x18591b=_0x4900b0['get'](_0x3de369);if(!_0x18591b)throw new SDKError(ErrorCode[_0x406f62(0x173)],_0x406f62(0x1ec)+_0x3de369+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x4e9af1+'\x27)');return _0x18591b;};}export function extractRootFolderId(_0xa58067){const _0x134a08=a114_0x2d62e8;return _0xa58067[_0x134a08(0x1c3)]?.[_0x134a08(0x1f3)]?.[_0x134a08(0x179)]?.['id']||_0xa58067['relationships']?.['parentFolder']?.[_0x134a08(0x179)]?.['id'];}export function buildConnectionMaps(_0x289a9c){const _0x100d43=a114_0x2d62e8,_0xea4845=new Map(),_0x5b2de6=new Map(),_0x9c055a=new Map();for(const _0x1a35c5 of _0x289a9c){_0xea4845[_0x100d43(0x14a)](_0x1a35c5[_0x100d43(0x14d)],parseInt(_0x1a35c5['id'],0xa)),_0x5b2de6[_0x100d43(0x14a)](_0x1a35c5['id'],_0x1a35c5[_0x100d43(0x14d)]),_0x9c055a[_0x100d43(0x14a)](_0x1a35c5[_0x100d43(0x14d)],_0x1a35c5[_0x100d43(0x1bd)]);}return{'nameToId':_0xea4845,'idToName':_0x5b2de6,'nameToType':_0x9c055a};}export function calculatePushStats(_0x148849,_0x3244d5,_0x110702,_0x3a24c6,_0x34dc11,_0x5cd816,_0x5104ef){const _0x5bbee7=a114_0x2d62e8,_0x28a4d3=_0x148849[_0x5bbee7(0x141)](_0x336b85=>_0x336b85[_0x5bbee7(0x136)]),_0x440045=_0x148849[_0x5bbee7(0x141)](_0x19df2b=>!_0x19df2b[_0x5bbee7(0x136)]&&_0x19df2b['hasChanges']),_0x390279=_0x148849[_0x5bbee7(0x141)](_0xca41f=>!_0xca41f[_0x5bbee7(0x136)]&&!_0xca41f['hasChanges']),_0x40a3e1=_0x5cd816?_0x3a24c6:[],_0x2271cc=_0x3244d5[_0x5bbee7(0x141)](_0x536908=>_0x536908[_0x5bbee7(0x136)]),_0x8b452c=_0x3244d5[_0x5bbee7(0x141)](_0x2c5f9b=>!_0x2c5f9b['isNew']&&_0x2c5f9b[_0x5bbee7(0x12d)]),_0x45bd5c=_0x3244d5[_0x5bbee7(0x141)](_0x55ec89=>!_0x55ec89[_0x5bbee7(0x136)]&&!_0x55ec89[_0x5bbee7(0x12d)]),_0x11c11d=_0x5cd816?_0x34dc11:[],_0x546a0a=_0x148849[_0x5bbee7(0x1a3)](_0x3c52d6=>_0x3c52d6[_0x5bbee7(0x213)]),_0x38354e=_0x546a0a['filter'](_0x1e4663=>_0x1e4663[_0x5bbee7(0x1bd)]==='create'),_0x149770=_0x546a0a[_0x5bbee7(0x141)](_0x4789de=>_0x4789de[_0x5bbee7(0x1bd)]===_0x5bbee7(0x201)),_0x77a8a3=_0x546a0a[_0x5bbee7(0x141)](_0x4d4918=>_0x4d4918['type']==='delete'),_0x530f87=Array['from'](_0x110702)[_0x5bbee7(0x22f)](),_0x286868=_0x5104ef?![]:_0x28a4d3[_0x5bbee7(0x19b)]>0x0||_0x440045[_0x5bbee7(0x19b)]>0x0||_0x40a3e1[_0x5bbee7(0x19b)]>0x0,_0x3d7d01=_0x2271cc['length']>0x0||_0x8b452c['length']>0x0||_0x11c11d[_0x5bbee7(0x19b)]>0x0,_0x32b3ca=_0x5104ef?![]:_0x546a0a[_0x5bbee7(0x19b)]>0x0,_0x539d8e=_0x530f87['length']>0x0;return{'segments':{'new':_0x28a4d3,'changed':_0x440045,'unchanged':_0x390279,'toDelete':_0x40a3e1},'journeys':{'new':_0x2271cc,'changed':_0x8b452c,'unchanged':_0x45bd5c,'toDelete':_0x11c11d},'activations':{'all':_0x546a0a,'toCreate':_0x38354e,'toUpdate':_0x149770,'toDelete':_0x77a8a3},'folders':{'toCreate':_0x530f87},'counts':{'segments':{'new':_0x28a4d3[_0x5bbee7(0x19b)],'changed':_0x440045[_0x5bbee7(0x19b)],'unchanged':_0x390279[_0x5bbee7(0x19b)],'toDelete':_0x40a3e1[_0x5bbee7(0x19b)]},'journeys':{'new':_0x2271cc[_0x5bbee7(0x19b)],'changed':_0x8b452c['length'],'unchanged':_0x45bd5c['length'],'toDelete':_0x11c11d[_0x5bbee7(0x19b)]},'activations':{'create':_0x38354e[_0x5bbee7(0x19b)],'update':_0x149770[_0x5bbee7(0x19b)],'delete':_0x77a8a3[_0x5bbee7(0x19b)]},'folders':_0x530f87['length']},'hasChanges':_0x286868||_0x3d7d01||_0x32b3ca||_0x539d8e};}export async function buildPushExecutionContext(_0x30a6fd,_0x46ab71,_0x14fafe,_0x149194,_0x26e04a,_0x48079b){const _0x7abc3d=a114_0x2d62e8,_0x17d230=extractRootFolderId(_0x14fafe),{pathToId:_0x2d9e83,idToPath:_0x159377}=buildFolderMaps(_0x26e04a),_0x3eb1e4=buildSegmentNameToIdMap(_0x149194),_0x36de5a=new Map(),{batchAsync:_0x423552}=await import(_0x7abc3d(0x133)),[_0x4e7fbf,_0x36c266]=await Promise[_0x7abc3d(0x1db)]([_0x30a6fd['user']['buildUserMaps'](),_0x30a6fd[_0x7abc3d(0x190)][_0x7abc3d(0x15c)](),((async()=>{const _0x425537=_0x7abc3d;!_0x48079b&&_0x149194[_0x425537(0x19b)]>0x0&&await _0x423552(_0x149194,async _0x1f3d59=>{const _0x1604c8=_0x425537,_0x1422a2=await _0x30a6fd[_0x1604c8(0x219)][_0x1604c8(0x148)](_0x46ab71,_0x1f3d59['id']);_0x36de5a[_0x1604c8(0x14a)](_0x1f3d59['id'],_0x1422a2);});})())]),{emailToId:_0x5420cd,idToEmail:_0x2d02cc}=_0x4e7fbf,_0x6e9b04=buildConnectionMaps(_0x36c266);return{'rootFolderId':_0x17d230,'folderPathToId':_0x2d9e83,'folderIdToPath':_0x159377,'segmentNameToId':_0x3eb1e4,'activationsBySegmentId':_0x36de5a,'emailToIdMap':_0x5420cd,'idToEmailMap':_0x2d02cc,'connectionNameToIdMap':_0x6e9b04[_0x7abc3d(0x13c)],'connectionIdToNameMap':_0x6e9b04[_0x7abc3d(0x18f)],'connectionNameToTypeMap':_0x6e9b04[_0x7abc3d(0x14f)]};}export function createPushYamlContextForBundle(_0x20378e,_0x5e87c3,_0x39196b,_0x228245,_0x1d6a4a,_0x325b21,_0x4b3a8f,_0x2d5098){const {existingLocalSegmentNames:_0x1a8ce1,localExpandedRuleToNames:_0x263794}=_0x228245,_0xa560ca=new Set(),_0x2fe0d4=new Map(),_0x255d1b=new Map(),_0x13bf24=new Map(),_0x1fbb5e=createJumpTargetCache(),_0x4c4779=new Map(),_0x30cf64=new Map(),_0x2cf886=new Set();let _0x59c210;const _0x51fb6c=_0x4ada81=>{const _0x307bb2={'resolveSegment':async _0x4f186b=>{const _0x2c1db7=a114_0x2264,_0x4f88e9=_0x13bf24[_0x2c1db7(0x1ad)](_0x4f186b);if(_0x4f88e9!==undefined)return{'name':_0x4f88e9,'isJourneyLocal':!![]};try{const _0x721108=await fetchSegment(_0x20378e,_0x5e87c3,_0x4f186b,_0x39196b);if(!_0x721108)throw new Error(_0x2c1db7(0x1e4));const _0x48fbb6=generateJourneyLocalName(_0x721108[_0x2c1db7(0x14d)]),_0x1390c3=_0x721108[_0x2c1db7(0x182)]===SEGMENT_KIND_JOURNEY&&_0x48fbb6!==undefined;let _0x335ab3=_0x721108['name'],_0x39395c;if(_0x1390c3&&_0x721108['rule']){const _0x234d88=apiRuleToYaml(_0x721108[_0x2c1db7(0x215)]);_0x30cf64[_0x2c1db7(0x14a)](_0x4f186b,_0x234d88);const _0x395338=async _0x568092=>{const _0x420771=_0x2c1db7,_0x3f1895=collectSegmentRefsFromRule(_0x568092);for(const _0x43dfc2 of _0x3f1895){if(!_0x30cf64[_0x420771(0x1b2)](_0x43dfc2))try{const _0x2d619b=await fetchSegment(_0x20378e,_0x5e87c3,_0x43dfc2,_0x39196b);if(_0x2d619b?.[_0x420771(0x215)]){const _0x98166a=apiRuleToYaml(_0x2d619b[_0x420771(0x215)]);_0x30cf64['set'](_0x43dfc2,_0x98166a),await _0x395338(_0x98166a);}}catch(_0x31e3a1){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x43dfc2+':\x20'+_0x31e3a1);}}};await _0x395338(_0x234d88);const _0x155ee0=serializeExpandedRule(_0x234d88,_0x30cf64),_0x17f57b=_0x263794[_0x2c1db7(0x1ad)](_0x155ee0);if(_0x17f57b&&_0x17f57b['length']>0x0){const _0x5862c4=_0x2fe0d4['get'](_0x155ee0)||0x0,_0x491102=_0x17f57b[_0x5862c4]||_0x17f57b[_0x17f57b[_0x2c1db7(0x19b)]-0x1];_0x2fe0d4[_0x2c1db7(0x14a)](_0x155ee0,_0x5862c4+0x1),_0x335ab3=_0x491102,_0xa560ca[_0x2c1db7(0x1d9)](_0x335ab3),_0x13bf24[_0x2c1db7(0x14a)](_0x4f186b,_0x335ab3);const _0x411e26=await resolveRuleSegmentRefs(_0x234d88,async _0x35db5a=>{const _0x329585=_0x2c1db7,_0x446858=_0x13bf24['get'](_0x35db5a);if(_0x446858)return _0x446858;const _0x1c5d0c=await _0x59c210[_0x329585(0x20d)](_0x35db5a);return _0x1c5d0c[_0x329585(0x14d)];});_0x39395c={'description':_0x721108[_0x2c1db7(0x1e1)],'rule':_0x411e26};}else{const _0xfd50dd=_0x4c4779['get'](_0x155ee0);if(_0xfd50dd)_0x335ab3=_0xfd50dd,_0x13bf24[_0x2c1db7(0x14a)](_0x4f186b,_0x335ab3);else{if(_0x48fbb6){let _0x26bb1e=_0x48fbb6,_0x349f74=0x2;while(_0xa560ca['has'](_0x26bb1e)||_0x1a8ce1[_0x2c1db7(0x1b2)](_0x26bb1e)){_0x26bb1e=_0x48fbb6+'_'+_0x349f74,_0x349f74++;}_0xa560ca['add'](_0x26bb1e),_0x335ab3=_0x26bb1e;}_0x13bf24[_0x2c1db7(0x14a)](_0x4f186b,_0x335ab3),_0x4c4779[_0x2c1db7(0x14a)](_0x155ee0,_0x335ab3);const _0x47641f=await resolveRuleSegmentRefs(_0x234d88,async _0x108eed=>{const _0x5084f9=_0x2c1db7,_0x183a89=_0x13bf24['get'](_0x108eed);if(_0x183a89)return _0x183a89;const _0xf81d29=await _0x59c210['resolveSegment'](_0x108eed);return _0xf81d29[_0x5084f9(0x14d)];});_0x39395c={'description':_0x721108[_0x2c1db7(0x1e1)],'rule':_0x47641f};}}}return{'name':_0x335ab3,'isJourneyLocal':_0x1390c3,'definition':_0x39395c};}catch(_0x51d2de){return logger[_0x2c1db7(0x1f9)]('Failed\x20to\x20resolve\x20segment\x20'+_0x4f186b+':\x20'+_0x51d2de),{'name':_0x4f186b,'isJourneyLocal':![]};}},'resolveActivation':async _0x1894ec=>{const _0x197ea0=a114_0x2264,_0x2cd574=_0x255d1b[_0x197ea0(0x1ad)](_0x1894ec);if(_0x2cd574!==undefined)return{'name':_0x2cd574,'isJourneyLocal':!![]};try{let _0x16ea0f=_0x4b3a8f?.['get'](_0x1894ec);!_0x16ea0f&&(_0x16ea0f=await _0x20378e[_0x197ea0(0x231)][_0x197ea0(0x20e)](_0x4ada81,_0x1894ec));const _0x575655=_0x16ea0f[_0x197ea0(0x12b)]['activationParams'][_0x197ea0(0x14d)]||_0x1894ec,_0x569a4f=sanitizeYamlKey(_0x575655)||_0x197ea0(0x1e6)+_0x1894ec,_0x3e695e=_0x569a4f;_0x255d1b[_0x197ea0(0x14a)](_0x1894ec,_0x3e695e);const _0x1e0a88=journeyActivationStepToYaml(_0x16ea0f,_0x1d6a4a,_0x325b21);return{'name':_0x3e695e,'isJourneyLocal':!![],'definition':_0x1e0a88};}catch(_0x3090cc){return logger['debug']('Failed\x20to\x20resolve\x20activation\x20'+_0x1894ec+':\x20'+_0x3090cc),{'name':_0x1894ec,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x38bd69,_0x1a4c1c)=>resolveJumpTarget(_0x38bd69,_0x1a4c1c,_0x1fbb5e,async _0x13809f=>{const _0x56a175=a114_0x2264,_0x386c65=_0x2d5098?.[_0x56a175(0x1ad)](_0x13809f);if(_0x386c65)return _0x386c65;return _0x20378e['journey'][_0x56a175(0x178)](_0x13809f);})};return _0x59c210=_0x307bb2,_0x307bb2;},_0x52fde1=async _0x3429a7=>{const _0x13c3d4=a114_0x2264,{collectSegmentIdsFromJourneyApi:_0x96ce41}=await import('./journey-yaml.js'),{batchAsync:_0x20ce0f}=await import(_0x13c3d4(0x133)),_0x53de88=new Set();for(const _0x263617 of _0x3429a7){let _0x319a0e=_0x2d5098?.[_0x13c3d4(0x1ad)](_0x263617);!_0x319a0e&&(_0x319a0e=await _0x20378e[_0x13c3d4(0x231)]['getJourney'](_0x263617));const _0x56dfc1=_0x96ce41(_0x319a0e);for(const _0xd7c0b4 of _0x56dfc1){_0x53de88[_0x13c3d4(0x1d9)](_0xd7c0b4);}}let _0x24df72=Array[_0x13c3d4(0x17c)](_0x53de88);while(_0x24df72[_0x13c3d4(0x19b)]>0x0){const _0x6cf50d=_0x24df72[_0x13c3d4(0x141)](_0x1a8cca=>!_0x2cf886[_0x13c3d4(0x1b2)](_0x1a8cca));if(_0x6cf50d[_0x13c3d4(0x19b)]===0x0)break;const _0x4eb10b=await _0x20ce0f(_0x6cf50d,async _0x93567a=>{_0x2cf886['add'](_0x93567a);const _0x3913c6=await fetchSegment(_0x20378e,_0x5e87c3,_0x93567a,_0x39196b);if(!_0x3913c6)return null;return{'segmentId':_0x93567a,'segment':_0x3913c6};},0xa),_0x4149f9=new Set();for(const _0x3a2598 of _0x4eb10b){if(!_0x3a2598?.[_0x13c3d4(0x219)]?.[_0x13c3d4(0x215)])continue;const _0x5c5baa=apiRuleToYaml(_0x3a2598[_0x13c3d4(0x219)][_0x13c3d4(0x215)]);_0x30cf64[_0x13c3d4(0x14a)](_0x3a2598[_0x13c3d4(0x184)],_0x5c5baa);const _0xfac2e4=collectSegmentRefsFromRule(_0x5c5baa);for(const _0x26757e of _0xfac2e4){!_0x2cf886[_0x13c3d4(0x1b2)](_0x26757e)&&_0x4149f9[_0x13c3d4(0x1d9)](_0x26757e);}}_0x24df72=Array[_0x13c3d4(0x17c)](_0x4149f9);}};return{'createYamlContext':_0x51fb6c,'prefetchJourneySegments':_0x52fde1};}export async function executePushSegments(_0x4a1f25,_0x18a6b7,_0x10b572,_0x41ad24,_0x45a8f8){const _0x415c5d=a114_0x2d62e8,{segmentDefToCreateRequest:_0x339fe1,segmentDefToUpdateRequest:_0x1780cf}=await import(_0x415c5d(0x1fb)),_0x123118=_0x10b572['folderPathToId'],_0x59bef9=0x5,_0x36dc2c=async _0x463734=>{const _0x4af209=_0x415c5d,_0x13b702=_0x463734['folderPath']?_0x123118[_0x4af209(0x1ad)](_0x463734[_0x4af209(0x1b9)]):undefined;let _0x582e31;const _0x48d4d7={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x463734[_0x4af209(0x136)]){_0x45a8f8[_0x4af209(0x208)]?.({'type':'segment_creating','name':_0x463734['yamlConfig']['name']});const _0x30b25f=_0x339fe1(_0x463734[_0x4af209(0x12a)],_0x13b702),_0x392419=await _0x45a8f8[_0x4af209(0x1f6)](_0x4af209(0x1e9)+_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)]+'\x27...',()=>_0x4a1f25[_0x4af209(0x219)][_0x4af209(0x156)](_0x41ad24[_0x4af209(0x15a)],_0x30b25f));_0x582e31=_0x392419[_0x4af209(0x179)]['id'],_0x48d4d7['createdSegmentId']={'name':_0x463734['yamlConfig']['name'],'id':_0x582e31},_0x45a8f8[_0x4af209(0x208)]?.({'type':_0x4af209(0x1b8),'name':_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)],'segmentId':_0x582e31}),_0x45a8f8['logSuccess']?.(_0x4af209(0x1f0)+_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)]+'\x27'),_0x48d4d7['created']=0x1;}else{if(_0x463734[_0x4af209(0x12d)]){_0x45a8f8[_0x4af209(0x208)]?.({'type':_0x4af209(0x22e),'name':_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)]});const _0x1182e6=_0x1780cf(_0x463734[_0x4af209(0x12a)]);_0x13b702!==_0x463734['existingSegment']?.[_0x4af209(0x1f4)]&&(_0x1182e6[_0x4af209(0x1f4)]=_0x13b702?parseInt(_0x13b702,0xa):undefined),await _0x45a8f8[_0x4af209(0x1f6)](_0x4af209(0x1e7)+_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)]+_0x4af209(0x199),()=>_0x4a1f25[_0x4af209(0x219)][_0x4af209(0x192)](_0x41ad24['parentId'],_0x463734[_0x4af209(0x128)]['id'],_0x1182e6)),_0x582e31=_0x463734[_0x4af209(0x128)]['id'],_0x45a8f8[_0x4af209(0x208)]?.({'type':'segment_updated','name':_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)]}),_0x45a8f8[_0x4af209(0x127)]?.('Updated\x20segment\x20\x27'+_0x463734[_0x4af209(0x12a)]['name']+'\x27'),_0x48d4d7[_0x4af209(0x1f1)]=0x1;}else _0x582e31=_0x463734[_0x4af209(0x128)]['id'];}}catch(_0x15e934){const _0x295f4d=isHttp400Error(_0x15e934),_0x5a8cff=_0x295f4d?ErrorCode[_0x4af209(0x15e)]:ErrorCode[_0x4af209(0x225)],_0x2478b1=getErrorMessage(_0x15e934);throw new SDKError(_0x5a8cff,'Failed\x20to\x20'+(_0x463734[_0x4af209(0x136)]?_0x4af209(0x150):_0x4af209(0x201))+_0x4af209(0x202)+_0x463734[_0x4af209(0x1b4)]+'\x0a\x20\x20'+_0x2478b1,_0x15e934);}try{const _0x2ada02=await syncActivationsForSegment(_0x4a1f25,_0x41ad24[_0x4af209(0x15a)],_0x582e31,_0x463734[_0x4af209(0x12a)][_0x4af209(0x14d)],_0x463734['activationActions'],_0x45a8f8,_0x463734[_0x4af209(0x1b4)]);_0x48d4d7[_0x4af209(0x1ee)]=_0x2ada02;}catch(_0x4a0f4d){if(_0x4a0f4d instanceof SDKError)throw _0x4a0f4d;throw new SDKError(ErrorCode[_0x4af209(0x1e0)],_0x4af209(0x129)+_0x463734['yamlConfig'][_0x4af209(0x14d)]+'\x27\x20from\x20file:\x20'+_0x463734[_0x4af209(0x1b4)]+_0x4af209(0x1fd)+getErrorMessage(_0x4a0f4d),_0x4a0f4d);}return _0x48d4d7;},_0x520c3f=await batchAsync(_0x18a6b7,_0x36dc2c,_0x59bef9),_0x3fa9e1={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2e20eb of _0x520c3f){_0x3fa9e1[_0x415c5d(0x177)]+=_0x2e20eb['created'],_0x3fa9e1[_0x415c5d(0x1f1)]+=_0x2e20eb[_0x415c5d(0x1f1)],_0x2e20eb[_0x415c5d(0x1d6)]&&_0x3fa9e1[_0x415c5d(0x1a2)][_0x415c5d(0x14a)](_0x2e20eb['createdSegmentId']['name'],_0x2e20eb[_0x415c5d(0x1d6)]['id']),_0x3fa9e1[_0x415c5d(0x1ee)][_0x415c5d(0x177)]+=_0x2e20eb[_0x415c5d(0x1ee)][_0x415c5d(0x177)],_0x3fa9e1[_0x415c5d(0x1ee)][_0x415c5d(0x1f1)]+=_0x2e20eb[_0x415c5d(0x1ee)][_0x415c5d(0x1f1)],_0x3fa9e1[_0x415c5d(0x1ee)][_0x415c5d(0x18a)]+=_0x2e20eb[_0x415c5d(0x1ee)][_0x415c5d(0x18a)];}return _0x3fa9e1;}async function syncActivationsForSegment(_0x1d1552,_0x58222e,_0x341061,_0x49d603,_0x3c9dc7,_0x4e0daf,_0xcd1357){const _0x2651c7=a114_0x2d62e8,_0x19d5a7={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2b1e11 of _0x3c9dc7){try{if(_0x2b1e11[_0x2651c7(0x1bd)]===_0x2651c7(0x150)&&_0x2b1e11[_0x2651c7(0x159)])_0x4e0daf[_0x2651c7(0x208)]?.({'type':'activation_creating','segmentName':_0x49d603,'activationName':_0x2b1e11[_0x2651c7(0x14d)]}),await _0x4e0daf['withProgress'](_0x2651c7(0x1f5)+_0x2b1e11[_0x2651c7(0x14d)]+_0x2651c7(0x199),()=>_0x1d1552['segment']['createActivation'](_0x58222e,_0x341061,_0x2b1e11[_0x2651c7(0x159)])),_0x4e0daf[_0x2651c7(0x208)]?.({'type':'activation_created','segmentName':_0x49d603,'activationName':_0x2b1e11[_0x2651c7(0x14d)]}),_0x4e0daf['logSuccess']?.(_0x2651c7(0x218)+_0x2b1e11['name']+'\x27'),_0x19d5a7[_0x2651c7(0x177)]++;else{if(_0x2b1e11[_0x2651c7(0x1bd)]===_0x2651c7(0x201)&&_0x2b1e11[_0x2651c7(0x159)]&&_0x2b1e11[_0x2651c7(0x166)])_0x4e0daf[_0x2651c7(0x208)]?.({'type':'activation_updating','segmentName':_0x49d603,'activationName':_0x2b1e11['name']}),await _0x4e0daf['withProgress'](_0x2651c7(0x209)+_0x2b1e11['name']+_0x2651c7(0x199),()=>_0x1d1552[_0x2651c7(0x219)]['updateActivation'](_0x58222e,_0x341061,_0x2b1e11[_0x2651c7(0x166)]['id'],_0x2b1e11[_0x2651c7(0x159)])),_0x4e0daf['onProgress']?.({'type':_0x2651c7(0x22a),'segmentName':_0x49d603,'activationName':_0x2b1e11[_0x2651c7(0x14d)]}),_0x4e0daf[_0x2651c7(0x127)]?.(_0x2651c7(0x158)+_0x2b1e11['name']+'\x27'),_0x19d5a7[_0x2651c7(0x1f1)]++;else _0x2b1e11[_0x2651c7(0x1bd)]==='delete'&&_0x2b1e11[_0x2651c7(0x166)]&&(_0x4e0daf[_0x2651c7(0x208)]?.({'type':_0x2651c7(0x186),'segmentName':_0x49d603,'activationName':_0x2b1e11[_0x2651c7(0x14d)]}),await _0x4e0daf[_0x2651c7(0x1f6)](_0x2651c7(0x217)+_0x2b1e11[_0x2651c7(0x14d)]+_0x2651c7(0x199),()=>_0x1d1552[_0x2651c7(0x219)][_0x2651c7(0x1af)](_0x58222e,_0x341061,_0x2b1e11[_0x2651c7(0x166)]['id'])),_0x4e0daf[_0x2651c7(0x208)]?.({'type':_0x2651c7(0x142),'segmentName':_0x49d603,'activationName':_0x2b1e11[_0x2651c7(0x14d)]}),_0x4e0daf[_0x2651c7(0x131)]?.(_0x2651c7(0x160)+_0x2b1e11[_0x2651c7(0x14d)]+'\x27'),_0x19d5a7['deleted']++);}}catch(_0x1a28ed){const _0x1a0f1f=isHttp400Error(_0x1a28ed),_0x2f51dc=_0x1a0f1f?ErrorCode[_0x2651c7(0x135)]:ErrorCode[_0x2651c7(0x1e0)],_0xe41282=getErrorMessage(_0x1a28ed);throw new SDKError(_0x2f51dc,'Failed\x20to\x20'+_0x2b1e11[_0x2651c7(0x1bd)]+_0x2651c7(0x13a)+_0x2b1e11[_0x2651c7(0x14d)]+_0x2651c7(0x1be)+_0xcd1357+'\x0a\x20\x20'+_0xe41282,_0x1a28ed);}}return _0x19d5a7;}export async function executePushFolders(_0x2aec08,_0x1c3956,_0x1e73ca,_0x43735e,_0xbbd393){const _0x458e31=a114_0x2d62e8,_0x701214=new Map(_0x1e73ca);for(const _0x5ceec3 of _0x1c3956){const _0x7110d6=_0x5ceec3[_0x458e31(0x205)]('/'),_0x3f3117=_0x7110d6[_0x7110d6[_0x458e31(0x19b)]-0x1],_0x535440=_0x7110d6[_0x458e31(0x1ef)](0x0,-0x1)[_0x458e31(0x212)]('/'),_0x49a900=_0x701214['get'](_0x535440);_0xbbd393[_0x458e31(0x208)]?.({'type':_0x458e31(0x15d),'folder':_0x5ceec3});const _0x575342={'name':_0x3f3117,'parentFolderId':_0x49a900},_0x2d98c7=await _0xbbd393['withProgress'](_0x458e31(0x1d1)+_0x5ceec3+_0x458e31(0x199),()=>_0x2aec08[_0x458e31(0x219)][_0x458e31(0x137)](_0x43735e[_0x458e31(0x15a)],_0x575342));_0x701214[_0x458e31(0x14a)](_0x5ceec3,_0x2d98c7['data']['id']),_0xbbd393[_0x458e31(0x208)]?.({'type':_0x458e31(0x138),'folder':_0x5ceec3,'folderId':_0x2d98c7[_0x458e31(0x179)]['id']}),_0xbbd393[_0x458e31(0x17f)]?.(_0x458e31(0x1f7)+_0x5ceec3+'\x27');}return _0x701214;}function a114_0x12ff(){const _0x14bdd9=['journeys','nameToId','Activation\x20not\x20found:\x20','journeyById','__pending_','deps','filter','activation_deleted','trim','getSegment','\x20error(s)','connectionIdToNameMap','24ehBxpM','listActivations','find','set','Updated\x20journey\x20\x27','resolvedRule','name','):\x20','nameToType','create','tdx.sdk.push-workflow','uniqueServerName','journeyId','journeyActivationNameToId','behavior','createSegment','steps','Updated\x20activation\x20\x27','validatedRequest','parentId','all_columns','list','folder_creating','SEGMENT_SYNTAX_ERROR','journey_updated','Deleted\x20activation\x20\x27','includes','existingJourney','parseDocument','goal\x20criteria','Entry\x20criteria:\x20','existingActivation','8902586ZyinFr','Failed\x20to\x20','toString','message','10EXQkKT','and\x20the\x20server\x20segment,\x20then\x20retry.','segment_deleted','replace','Activation','94gpEErJ','milestone','resolveJourneyId','SEGMENT_NOT_FOUND','embeddedSegmentNameToId','notification','uniqueSegmentName','created','getJourney','data','diff','Fetching\x20','from','skipSegments','with','logInfo','conditionTimeoutUnit','segmentByFolderAndName','kind','item','segmentId','JOURNEY_UPDATE_ERROR','activation_deleting','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','idToEmailMap',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','deleted','exitCriterias','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','journeyStages','458UdubQl','idToName','connection','toISOString','updateSegmentById','185TCUbJt','waitStepUnit','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','journeyName','yamlActivation','journey_creating','\x27...','embedded_segment_created','length','versionNumber','7458678SSSkRz','WaitStep','activationStepsById','progress','journeyBundlesByFolderAndName','createdSegmentIds','flatMap','stages','12sBjKnr','deleteSegment','state','\x27\x20exit\x20criteria','\x20journey\x20from\x20file:\x20','digest','segments','map','get','Delete\x20the\x20push\x20recovery\x20file\x20(','deleteActivation','decision_point','valid','has','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','absolutePath','entryCriteria','utf-8','stage\x20\x27','segment_created','folderPath','stringify','conditionTimeoutDuration','effectiveFolderId','type','\x27\x20from\x20file:\x20','createJourneySegment','segment_deleting','existingSegments','parse','relationships','delete','getSegmentEntity\x20also\x20failed\x20for\x20','Journey\x20\x27','entries','hex','\x27\x20for\x20','branches','logWarning','getSegmentEntity',').\x20','columns','journeyActivationStepId','waitStep','Creating\x20folder\x20\x27','values','43470bbcEsQ','INTERNAL','getSegment\x20failed\x20for\x20','createdSegmentId','conditionSegmentId','run_after_journey_refresh','add','localName','all','folder','push','waitStepType','day','ACTIVATION_UPDATE_ERROR','description','\x20(referenced\x20in\x20journey\x20','startsWith','Segment\x20not\x20found','goal','activation_','Updating\x20segment\x20\x27','keys','Creating\x20segment\x20\x27','isArray','segmentNameToId','Segment\x20not\x20found:\x20','\x27\x20decision\x20point\x20branch\x20\x27','activations','slice','Created\x20segment\x20\x27','updated','Embedded\x20segment\x20\x27','parentSegmentFolder','segmentFolderId','Creating\x20activation\x20\x27','withProgress','Created\x20folder\x20\x27','entry','debug','action','./child-segment-yaml.js','Condition','\x0a\x20\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','toLowerCase','some','update','\x20segment\x20from\x20file:\x20','activationsBySegmentId','dirname','split','entry_criteria','embedded_activation_creating','onProgress','Updating\x20activation\x20\x27','10773884FtiRXd','index','folderPathToId','resolveSegment','getActivation','NOT_FOUND','journey_entry_criteria_','conditions','join','activationActions','size','rule','\x27\x20entry\x20criteria','Deleting\x20activation\x20\x27','Created\x20activation\x20\x27','segment','journeyBundleName','journey_created','.$1.push-recovery.json','object','schedule','reduce','relative','max','__pending_act_','embedded_segment_creating','folderId','SEGMENT_UPDATE_ERROR','41783IbfYBL','rootFolderId','fetchJourney','\x27\x20milestone','activation_updated','320802wJHPFY','256aoNCrt','Duration','segment_updating','sort','null','journey','DecisionPoint','draft','unchanged','logSuccess','existingSegment','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','yamlConfig','attributes','journey_updating','hasChanges','activationContext','errors','sha1','logDeleted','activation_template_id','../../utils/async.js','connector_config','ACTIVATION_SYNTAX_ERROR','isNew','createFolder','folder_created','13UGiLrE','\x20activation\x20\x27'];a114_0x12ff=function(){return _0x14bdd9;};return a114_0x12ff();}export async function executePushSegmentDeletions(_0x2ea1b9,_0x463f3f,_0xa3764b){const _0x105fb0=a114_0x2d62e8;if(_0x463f3f[_0x105fb0(0x19b)]===0x0)return 0x0;const {batchAsync:_0x4408cf}=await import(_0x105fb0(0x133)),_0x4a6a92=0x5,_0x1ab8a0=await _0x4408cf(_0x463f3f,async _0x1ee32c=>{const _0x362633=_0x105fb0;return _0xa3764b[_0x362633(0x208)]?.({'type':_0x362633(0x1c0),'name':_0x1ee32c[_0x362633(0x14d)]}),await _0x2ea1b9[_0x362633(0x219)][_0x362633(0x1a6)](_0x1ee32c['id']),_0xa3764b[_0x362633(0x208)]?.({'type':_0x362633(0x16d),'name':_0x1ee32c[_0x362633(0x14d)]}),_0xa3764b[_0x362633(0x131)]?.('Deleted\x20segment\x20\x27'+_0x1ee32c['name']+'\x27'),0x1;},_0x4a6a92);return _0x1ab8a0[_0x105fb0(0x21f)]((_0x152970,_0x287225)=>_0x152970+_0x287225,0x0);}export async function executePushJourneys(_0x5476a7,_0x417b13,_0x2981fc,_0x4484b8,_0x46d8ce){const _0x392d74=a114_0x2d62e8,{journeyDefToRequest:_0x257e9f}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x4f6b15,yamlRuleToApi:_0x353612,validateSegmentRule:_0x216cb4}=await import(_0x392d74(0x1fb)),_0x1d53bf={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x529f6f=new Map(_0x2981fc[_0x392d74(0x1eb)]),_0x42e8ca=0x5;for(let _0x1965bf=0x0;_0x1965bf<_0x417b13[_0x392d74(0x19b)];_0x1965bf+=_0x42e8ca){const _0x2e5185=_0x417b13[_0x392d74(0x1ef)](_0x1965bf,_0x1965bf+_0x42e8ca),_0x59e3ed=await Promise['all'](_0x2e5185[_0x392d74(0x1ac)](async _0x2a4b9c=>{const _0x1c79ef=_0x392d74;if(!_0x2a4b9c['isNew']&&!_0x2a4b9c['hasChanges'])return{'action':_0x1c79ef(0x234),'name':_0x2a4b9c[_0x1c79ef(0x12a)][_0x1c79ef(0x14d)],'journeyId':_0x2a4b9c[_0x1c79ef(0x162)]?.['id']};const _0x44293d=_0x2a4b9c[_0x1c79ef(0x1b9)]?_0x2981fc[_0x1c79ef(0x20c)][_0x1c79ef(0x1ad)](_0x2a4b9c[_0x1c79ef(0x1b9)]):undefined;_0x46d8ce[_0x1c79ef(0x208)]?.({'type':_0x2a4b9c[_0x1c79ef(0x136)]?_0x1c79ef(0x198):_0x1c79ef(0x12c),'name':_0x2a4b9c['yamlConfig'][_0x1c79ef(0x14d)]});try{const _0x152140=await executeSingleJourneyPush(_0x5476a7,_0x2a4b9c,{..._0x2981fc,'segmentNameToId':_0x529f6f},{'parentId':_0x4484b8[_0x1c79ef(0x15a)],'rootFolderId':_0x4484b8['rootFolderId'],'folderId':_0x44293d,'verbose':_0x4484b8['verbose']},_0x46d8ce,{'journeyDefToRequest':_0x257e9f,'activationDefToCreateRequest':_0x4f6b15,'yamlRuleToApi':_0x353612,'validateSegmentRule':_0x216cb4});for(const [_0x3e9d50,_0x35ba27]of _0x152140[_0x1c79ef(0x174)]){_0x529f6f[_0x1c79ef(0x14a)](_0x3e9d50,_0x35ba27),_0x1d53bf[_0x1c79ef(0x174)][_0x1c79ef(0x14a)](_0x3e9d50,_0x35ba27);}if(_0x152140[_0x1c79ef(0x1fa)]===_0x1c79ef(0x177))_0x46d8ce['onProgress']?.({'type':_0x1c79ef(0x21b),'name':_0x2a4b9c[_0x1c79ef(0x12a)][_0x1c79ef(0x14d)],'journeyId':_0x152140[_0x1c79ef(0x153)]}),_0x46d8ce[_0x1c79ef(0x127)]?.('Created\x20journey\x20\x27'+_0x2a4b9c['yamlConfig']['name']+'\x27'),_0x1d53bf['created']++;else _0x152140[_0x1c79ef(0x1fa)]==='updated'&&(_0x46d8ce[_0x1c79ef(0x208)]?.({'type':_0x1c79ef(0x15f),'name':_0x2a4b9c[_0x1c79ef(0x12a)]['name']}),_0x46d8ce[_0x1c79ef(0x127)]?.(_0x1c79ef(0x14b)+_0x2a4b9c[_0x1c79ef(0x12a)][_0x1c79ef(0x14d)]+'\x27'),_0x1d53bf['updated']++);return{'action':_0x152140[_0x1c79ef(0x1fa)],'name':_0x2a4b9c[_0x1c79ef(0x12a)][_0x1c79ef(0x14d)],'journeyId':_0x152140[_0x1c79ef(0x153)]};}catch(_0xed7132){const _0x46495e=isHttp400Error(_0xed7132),_0x5a3520=_0x46495e?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x1c79ef(0x185)],_0x3f7b04=getErrorMessage(_0xed7132);throw new SDKError(_0x5a3520,_0x1c79ef(0x168)+(_0x2a4b9c[_0x1c79ef(0x136)]?_0x1c79ef(0x150):_0x1c79ef(0x201))+_0x1c79ef(0x1a9)+_0x2a4b9c[_0x1c79ef(0x1b4)]+_0x1c79ef(0x1fd)+_0x3f7b04,_0xed7132);}}));_0x1d53bf['results'][_0x392d74(0x1dd)](..._0x59e3ed);}return _0x1d53bf;}async function matchExistingJourneySegments(_0x2ccc48,_0x52c9ed,_0x4bc967,_0x11788a,_0x1f5915){const _0x755322=a114_0x2d62e8;if(!_0x52c9ed[_0x755322(0x162)]||!_0x52c9ed[_0x755322(0x12a)]['segments'])return;const _0x4f26b1=new Map();for(const _0x3d17ed of Object[_0x755322(0x1e8)](_0x52c9ed[_0x755322(0x12a)][_0x755322(0x1ab)])){const _0x4b4572=generateDeterministicJourneySegmentName(_0x52c9ed[_0x755322(0x12a)][_0x755322(0x14d)],_0x3d17ed);_0x4f26b1[_0x755322(0x14a)](_0x4b4572,_0x3d17ed);}const _0x1f6281=collectSegmentIdsFromJourneyApi(_0x52c9ed[_0x755322(0x162)]);for(const _0x1c9470 of _0x1f6281){const _0x2f7cf2=await fetchSegment(_0x2ccc48,_0x4bc967,_0x1c9470,_0x11788a);if(!_0x2f7cf2?.['name'])continue;const _0x13f571=_0x4f26b1[_0x755322(0x1ad)](_0x2f7cf2['name']);_0x13f571&&_0x1f5915['set'](_0x13f571,_0x1c9470);}}async function executeSingleJourneyPush(_0x253930,_0x2c724e,_0x1f6293,_0x49e155,_0x19f5db,_0xc79544){const _0x308e72=a114_0x2d62e8,{journeyDefToRequest:_0x1e87cf,activationDefToCreateRequest:_0x950bcb,yamlRuleToApi:_0x1993c0,validateSegmentRule:_0x225df9}=_0xc79544,_0x2ef7b5=new Map(),_0x18539e=new Map();recoverSegmentIdsFromPushRecovery(_0x2c724e,_0x2ef7b5,_0x1f6293[_0x308e72(0x1eb)]);const _0x39398a=new Map(),_0x1c53b8=new Map(),_0x534a17=new Map();let _0x30db4a;const _0x466348=async()=>{const _0x141df4=_0x308e72;if(_0x30db4a)return;_0x30db4a=new Map();if(!_0x2c724e[_0x141df4(0x162)])return;const _0x3a19a7=await _0x253930[_0x141df4(0x231)][_0x141df4(0x148)](_0x2c724e[_0x141df4(0x162)]['id']);for(const _0x2f7e68 of _0x3a19a7){const _0x3a1d43=journeyActivationStepToYaml(_0x2f7e68,_0x1f6293[_0x141df4(0x188)],_0x1f6293[_0x141df4(0x146)]),_0x32da5f=activationSignature(_0x3a1d43);!_0x30db4a[_0x141df4(0x1b2)](_0x32da5f)&&_0x30db4a[_0x141df4(0x14a)](_0x32da5f,_0x2f7e68['id']),_0x3a1d43['name']&&_0x18539e[_0x141df4(0x14a)](_0x3a1d43[_0x141df4(0x14d)],_0x2f7e68['id']);}};await matchExistingJourneySegments(_0x253930,_0x2c724e,_0x49e155[_0x308e72(0x15a)],_0x1f6293[_0x308e72(0x1c1)],_0x1f6293[_0x308e72(0x1eb)]);const _0x5107d1={'resolveSegmentId':async _0x2be65d=>{const _0x872710=_0x308e72,_0x59bd7a=_0x1f6293['segmentNameToId']['get'](_0x2be65d);if(!_0x59bd7a)throw new SDKError(ErrorCode[_0x872710(0x173)],_0x872710(0x1ec)+_0x2be65d+_0x872710(0x1e2)+_0x2c724e[_0x872710(0x12a)][_0x872710(0x14d)]+')');return _0x59bd7a;},'resolveEmbeddedSegmentId':async(_0x3c4e34,_0x2fb219)=>{const _0x4a6acc=_0x308e72,_0x1095bc=_0x1f6293[_0x4a6acc(0x1eb)][_0x4a6acc(0x1ad)](_0x3c4e34);if(_0x1095bc)return _0x1095bc;const _0xd014ca=_0x1f6293['existingSegments'][_0x4a6acc(0x149)](_0x337651=>_0x337651[_0x4a6acc(0x14d)]===_0x3c4e34);if(_0xd014ca)return _0x1f6293['segmentNameToId']['set'](_0x3c4e34,_0xd014ca['id']),_0xd014ca['id'];if(_0x2c724e[_0x4a6acc(0x136)]){const {stageName:_0x31e853,criteriaName:_0x1bdeab}=findSegmentCriteriaLocation(_0x2c724e[_0x4a6acc(0x12a)],_0x3c4e34);return _0x225df9(_0x3c4e34,_0x2fb219[_0x4a6acc(0x215)]),_0x1c53b8[_0x4a6acc(0x14a)](_0x3c4e34,{'definition':_0x2fb219,'stageName':_0x31e853,'criteriaName':_0x1bdeab}),createPendingSegmentId(_0x3c4e34);}const _0x3b256b=_0x2c724e[_0x4a6acc(0x162)]?.['id'];if(!_0x3b256b)throw new SDKError(ErrorCode['INTERNAL'],_0x4a6acc(0x195));const _0x40dbc1=_0x39398a[_0x4a6acc(0x1ad)](_0x3c4e34);if(_0x40dbc1)return _0x40dbc1;const _0x4d102c=((async()=>{const _0x57049d=_0x4a6acc;_0x225df9(_0x3c4e34,_0x2fb219[_0x57049d(0x215)]);const _0x23b1af=generateDeterministicJourneySegmentName(_0x2c724e['yamlConfig'][_0x57049d(0x14d)],_0x3c4e34),_0x1d1e83=_0x1f6293[_0x57049d(0x1c1)][_0x57049d(0x149)](_0x50564a=>_0x50564a[_0x57049d(0x14d)]===_0x23b1af),_0x44701a=createSegmentIdResolver(_0x1f6293[_0x57049d(0x1eb)],_0x3c4e34),_0x4eb6c1=await resolveRuleSegmentIds(_0x2fb219[_0x57049d(0x215)],_0x44701a);let _0x1610de;return _0x1d1e83?(await _0x253930[_0x57049d(0x219)][_0x57049d(0x192)](_0x49e155['parentId'],_0x1d1e83['id'],{'description':_0x2fb219['description']||_0x57049d(0x165)+_0x3c4e34,'rule':_0x1993c0(_0x4eb6c1,!![]),'countPopulation':!![]}),_0x1610de=_0x1d1e83['id'],saveSegmentToPushRecovery(_0x2c724e[_0x57049d(0x1b4)],_0x2c724e[_0x57049d(0x12a)][_0x57049d(0x14d)],_0x3c4e34,{'segmentId':_0x1610de,'uniqueServerName':_0x23b1af,'createdAt':new Date()[_0x57049d(0x191)]()})):_0x1610de=await createOrRecoverEmbeddedSegment(_0x253930,_0x2c724e,{'localName':_0x3c4e34,'uniqueSegmentName':_0x23b1af,'description':_0x2fb219[_0x57049d(0x1e1)]||_0x57049d(0x165)+_0x3c4e34,'journeyId':_0x3b256b,'resolvedRule':_0x4eb6c1,'parentId':_0x49e155[_0x57049d(0x15a)],'folderId':_0x49e155[_0x57049d(0x227)]||''},_0x1993c0),_0x1f6293['segmentNameToId']['set'](_0x3c4e34,_0x1610de),_0x2ef7b5[_0x57049d(0x14a)](_0x3c4e34,_0x1610de),_0x1610de;})());_0x39398a['set'](_0x3c4e34,_0x4d102c);try{return await _0x4d102c;}finally{_0x39398a[_0x4a6acc(0x1c4)](_0x3c4e34);}},'resolveActivationId':async _0x42b315=>{const _0x2dc71a=_0x308e72,_0x1a6fef=_0x18539e[_0x2dc71a(0x1ad)](_0x42b315);if(_0x1a6fef)return _0x1a6fef;if(_0x2c724e[_0x2dc71a(0x162)]){await _0x466348();const _0x4bd76b=_0x18539e[_0x2dc71a(0x1ad)](_0x42b315);if(_0x4bd76b)return _0x4bd76b;}throw new SDKError(ErrorCode[_0x2dc71a(0x20f)],_0x2dc71a(0x13d)+_0x42b315+'\x20(referenced\x20in\x20journey\x20'+_0x2c724e['yamlConfig'][_0x2dc71a(0x14d)]+_0x2dc71a(0x1cd)+_0x2dc71a(0x1fe));},'resolveEmbeddedActivationId':async(_0x3444f6,_0x1f672a)=>{const _0x57d925=_0x308e72,_0x1961f5=_0x18539e[_0x57d925(0x1ad)](_0x3444f6);if(_0x1961f5)return _0x1961f5;if(_0x2c724e[_0x57d925(0x136)])return _0x534a17[_0x57d925(0x14a)](_0x3444f6,_0x1f672a),createPendingActivationId(_0x3444f6);if(_0x2c724e[_0x57d925(0x162)]){await _0x466348();const _0x492667=_0x18539e[_0x57d925(0x1ad)](_0x1f672a['name']);if(_0x492667)return _0x18539e['set'](_0x3444f6,_0x492667),_0x492667;const _0x4873f1=activationSignature(_0x1f672a),_0x4ff9be=_0x30db4a?.[_0x57d925(0x1ad)](_0x4873f1);if(_0x4ff9be)return _0x18539e[_0x57d925(0x14a)](_0x3444f6,_0x4ff9be),_0x4ff9be;const _0x30c7b0=await _0x950bcb(_0x1f672a,_0x1f6293[_0x57d925(0x12e)]),_0x113ea2={..._0x30c7b0,..._0x1f672a[_0x57d925(0x1d8)]!==undefined&&{'runAfterJourneyRefresh':_0x1f672a[_0x57d925(0x1d8)]}},_0x2fb542=await _0x253930['journey']['createActivation'](_0x2c724e[_0x57d925(0x162)]['id'],_0x113ea2);return _0x18539e[_0x57d925(0x14a)](_0x3444f6,_0x2fb542['id']),_0x2fb542['id'];}throw new SDKError(ErrorCode[_0x57d925(0x1d4)],_0x57d925(0x1b3));},'resolveJourneyId':async _0xac0a8=>{const _0x3b2197=_0x308e72;try{return await _0x253930[_0x3b2197(0x231)][_0x3b2197(0x172)](_0x49e155[_0x3b2197(0x15a)],_0xac0a8);}catch(_0x5891eb){throw new SDKError(ErrorCode[_0x3b2197(0x20f)],_0x3b2197(0x1c6)+_0xac0a8+_0x3b2197(0x18c)+_0x2c724e[_0x3b2197(0x12a)][_0x3b2197(0x14d)]+'\x27)',_0x5891eb);}},'resolveStageId':async(_0x1cb02c,_0x11d39b)=>{const _0x121aab=_0x308e72,_0x4048b1=await _0x253930['journey']['getJourney'](_0x1cb02c),_0x265c96=_0x4048b1[_0x121aab(0x12b)][_0x121aab(0x18d)][_0x121aab(0x149)](_0x373ff7=>_0x373ff7[_0x121aab(0x14d)]['toLowerCase']()===_0x11d39b[_0x121aab(0x1ff)]());if(!_0x265c96?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x11d39b+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x4048b1[_0x121aab(0x12b)][_0x121aab(0x21a)]||_0x4048b1['attributes']['name'])+'\x27');return _0x265c96['id'];}},_0x19d9fb=await _0x1e87cf(_0x2c724e[_0x308e72(0x12a)],_0x49e155[_0x308e72(0x15a)],_0x5107d1),_0x281a87=_0x49e155[_0x308e72(0x224)]||_0x49e155[_0x308e72(0x227)];_0x281a87&&(_0x19d9fb[_0x308e72(0x1c3)]={'parentFolder':{'data':{'id':_0x281a87,'type':_0x308e72(0x1dc)}}});if(_0x2c724e[_0x308e72(0x136)]){if(_0x1c53b8[_0x308e72(0x214)]>0x0||_0x534a17[_0x308e72(0x214)]>0x0)return await executeThreeStepJourneyCreate(_0x253930,_0x2c724e,_0x19d9fb,{'pendingEmbeddedSegments':_0x1c53b8,'pendingEmbeddedActivations':_0x534a17,'embeddedSegmentNameToId':_0x2ef7b5,'journeyActivationNameToId':_0x18539e},{..._0x49e155,'effectiveFolderId':_0x281a87},_0x1f6293,_0x19f5db,_0xc79544);else{ensureJourneyDefaults(_0x19d9fb[_0x308e72(0x12b)]);const _0x77e1c=await _0x253930[_0x308e72(0x231)][_0x308e72(0x150)](_0x19d9fb);return deletePushRecovery(_0x2c724e[_0x308e72(0x1b4)]),{'action':_0x308e72(0x177),'journeyId':_0x77e1c['id'],'embeddedSegmentNameToId':_0x2ef7b5};}}else{if(_0x2c724e['hasChanges']&&_0x2c724e['existingJourney'])return ensureJourneyDefaults(_0x19d9fb[_0x308e72(0x12b)]),await _0x253930[_0x308e72(0x231)][_0x308e72(0x201)](_0x2c724e[_0x308e72(0x162)]['id'],_0x19d9fb),deletePushRecovery(_0x2c724e['absolutePath']),{'action':'updated','journeyId':_0x2c724e[_0x308e72(0x162)]['id'],'embeddedSegmentNameToId':_0x2ef7b5};}return deletePushRecovery(_0x2c724e[_0x308e72(0x1b4)]),{'action':_0x308e72(0x234),'journeyId':_0x2c724e[_0x308e72(0x162)]?.['id'],'embeddedSegmentNameToId':_0x2ef7b5};}function findSegmentCriteriaLocation(_0x2158fa,_0x1816a8){const _0x2c081d=a114_0x2d62e8,_0x2c7b56=_0x2158fa[_0x2c081d(0x1a4)]||_0x2158fa[_0x2c081d(0x13b)]?.[0x0]?.[_0x2c081d(0x1a4)]||[];let _0x547460=_0x2c081d(0x1f8),_0x3a3188=_0x1816a8;const _0x526b5c=_0x2158fa['goal']||_0x2158fa['journeys']?.[0x0]?.[_0x2c081d(0x1e5)];if(_0x526b5c?.[_0x2c081d(0x219)]===_0x1816a8)return{'stageName':_0x2c081d(0x1e5),'criteriaName':_0x526b5c[_0x2c081d(0x14d)]||_0x1816a8};_0x28fed7:for(const _0x74bb63 of _0x2c7b56){if(_0x74bb63[_0x2c081d(0x206)]?.[_0x2c081d(0x219)]===_0x1816a8){_0x547460=_0x74bb63[_0x2c081d(0x14d)],_0x3a3188=_0x74bb63[_0x2c081d(0x206)]['name']||_0x1816a8;break;}if(_0x74bb63[_0x2c081d(0x157)])for(const _0x3e55e5 of _0x74bb63[_0x2c081d(0x157)]){if(_0x3e55e5[_0x2c081d(0x1bd)]===_0x2c081d(0x1b0)&&_0x3e55e5[_0x2c081d(0x17e)]?.[_0x2c081d(0x1ca)])for(const _0x4d1f83 of _0x3e55e5[_0x2c081d(0x17e)][_0x2c081d(0x1ca)]){if(_0x4d1f83[_0x2c081d(0x219)]===_0x1816a8){_0x547460=_0x74bb63['name'],_0x3a3188=_0x4d1f83[_0x2c081d(0x14d)]||_0x1816a8;break _0x28fed7;}}}}return{'stageName':_0x547460,'criteriaName':_0x3a3188};}async function executeThreeStepJourneyCreate(_0x3947e7,_0x3cc0fb,_0xbe93ee,_0x1f20e5,_0x23a794,_0x1c59b0,_0x22c4da,_0x563063){const _0x5152d6=a114_0x2d62e8,{activationDefToCreateRequest:_0x133e3d,yamlRuleToApi:_0x7c14a6}=_0x563063,{pendingEmbeddedSegments:_0x359834,pendingEmbeddedActivations:_0xda5ade,embeddedSegmentNameToId:_0x2f1a6a}=_0x1f20e5,_0x192765=JSON[_0x5152d6(0x1c2)](JSON['stringify'](_0xbe93ee));ensureJourneyDefaults(_0x192765[_0x5152d6(0x12b)]),stripPendingIds(_0x192765);const _0x132c62=await _0x3947e7[_0x5152d6(0x231)]['create'](_0x192765),_0x3a2013=_0x132c62['id'],_0x4cbc34=new Map();for(const _0x555e3f of _0x132c62[_0x5152d6(0x12b)][_0x5152d6(0x18d)]){_0x4cbc34[_0x5152d6(0x14a)](_0x555e3f[_0x5152d6(0x14d)][_0x5152d6(0x1ff)](),_0x555e3f['id']);}recoverSegmentIdsFromPushRecovery(_0x3cc0fb,_0x2f1a6a,_0x1c59b0[_0x5152d6(0x1eb)]);for(const [_0x3f4746,{definition:_0x218b47}]of _0x359834){if(_0x2f1a6a[_0x5152d6(0x1b2)](_0x3f4746)){_0x22c4da[_0x5152d6(0x208)]?.({'type':_0x5152d6(0x19a),'journeyName':_0x3cc0fb[_0x5152d6(0x12a)][_0x5152d6(0x14d)],'segmentName':_0x3f4746});continue;}const _0x8d30a8=generateDeterministicJourneySegmentName(_0x3cc0fb[_0x5152d6(0x12a)][_0x5152d6(0x14d)],_0x3f4746);_0x22c4da[_0x5152d6(0x208)]?.({'type':_0x5152d6(0x223),'journeyName':_0x3cc0fb['yamlConfig']['name'],'segmentName':_0x3f4746});const _0x46a832=createSegmentIdResolver(_0x1c59b0[_0x5152d6(0x1eb)],_0x3f4746),_0x1f0d44=await resolveRuleSegmentIds(_0x218b47[_0x5152d6(0x215)],_0x46a832),_0x106d1a=await createOrRecoverEmbeddedSegment(_0x3947e7,_0x3cc0fb,{'localName':_0x3f4746,'uniqueSegmentName':_0x8d30a8,'description':_0x218b47[_0x5152d6(0x1e1)]||_0x5152d6(0x165)+_0x3f4746,'journeyId':_0x3a2013,'resolvedRule':_0x1f0d44,'parentId':_0x23a794[_0x5152d6(0x15a)],'folderId':_0x23a794[_0x5152d6(0x1bc)]||''},_0x7c14a6);_0x2f1a6a[_0x5152d6(0x14a)](_0x3f4746,_0x106d1a),_0x1c59b0['segmentNameToId']['set'](_0x3f4746,_0x106d1a),_0x22c4da[_0x5152d6(0x208)]?.({'type':_0x5152d6(0x19a),'journeyName':_0x3cc0fb['yamlConfig'][_0x5152d6(0x14d)],'segmentName':_0x3f4746});}const _0x225381=new Map();for(const [_0x3a8c93,_0x1c48f2]of _0xda5ade){_0x22c4da['onProgress']?.({'type':_0x5152d6(0x207),'journeyName':_0x3cc0fb['yamlConfig'][_0x5152d6(0x14d)],'activationName':_0x3a8c93});const _0x6e458a=await _0x133e3d(_0x1c48f2,_0x1c59b0['activationContext']),_0x11408b={..._0x6e458a,..._0x1c48f2['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x1c48f2[_0x5152d6(0x1d8)]}},_0x248889=await _0x3947e7[_0x5152d6(0x231)]['createActivation'](_0x3a2013,_0x11408b);_0x225381[_0x5152d6(0x14a)](_0x3a8c93,_0x248889['id']),_0x1f20e5[_0x5152d6(0x154)][_0x5152d6(0x14a)](_0x3a8c93,_0x248889['id']),_0x22c4da['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x3cc0fb[_0x5152d6(0x12a)]['name'],'activationName':_0x3a8c93});}const _0x732483=JSON[_0x5152d6(0x1c2)](JSON[_0x5152d6(0x1ba)](_0xbe93ee));return _0x732483['id']=_0x3a2013,ensureJourneyDefaults(_0x732483['attributes']),resolvePendingIdsInRequest(_0x732483,_0xbe93ee,_0x4cbc34,_0x2f1a6a,_0x225381,_0x22c4da),await _0x3947e7[_0x5152d6(0x231)][_0x5152d6(0x201)](_0x3a2013,_0x732483),deletePushRecovery(_0x3cc0fb['absolutePath']),{'action':'created','journeyId':_0x3a2013,'embeddedSegmentNameToId':_0x2f1a6a};}export function stripWaitStepPendingIds(_0x534a79){const _0x2811a0=a114_0x2d62e8,_0x4a3159=_0x534a79['conditionSegmentId']&&isPendingSegmentId(_0x534a79[_0x2811a0(0x1d7)]),_0x3953cb=_0x534a79[_0x2811a0(0x211)]?.[_0x2811a0(0x200)](_0x30c34a=>_0x30c34a['segmentId']&&isPendingSegmentId(_0x30c34a['segmentId']));(_0x4a3159||_0x3953cb)&&(_0x534a79[_0x2811a0(0x1de)]=_0x2811a0(0x22d),_0x534a79[_0x2811a0(0x1d0)]=0x1,_0x534a79[_0x2811a0(0x194)]=_0x2811a0(0x1df),delete _0x534a79[_0x2811a0(0x1d7)],delete _0x534a79['conditionTimeoutDuration'],delete _0x534a79['conditionTimeoutUnit'],delete _0x534a79[_0x2811a0(0x211)]);}export function resolveWaitStepPendingIds(_0x490022,_0x4ea1e0,_0x2af8f4,_0x591fdd){const _0x83d2c2=a114_0x2d62e8;if(_0x4ea1e0[_0x83d2c2(0x1d7)]&&isPendingSegmentId(_0x4ea1e0[_0x83d2c2(0x1d7)])){const _0x2c6437=_0x2af8f4(_0x4ea1e0[_0x83d2c2(0x1d7)],_0x83d2c2(0x1b7)+_0x591fdd+'\x27\x20wait\x20condition');_0x2c6437&&(_0x490022[_0x83d2c2(0x1de)]=_0x83d2c2(0x1fc),_0x490022[_0x83d2c2(0x1d7)]=_0x2c6437,delete _0x490022[_0x83d2c2(0x1d0)],delete _0x490022[_0x83d2c2(0x194)],_0x4ea1e0[_0x83d2c2(0x1bb)]!==undefined&&(_0x490022[_0x83d2c2(0x1bb)]=_0x4ea1e0[_0x83d2c2(0x1bb)]),_0x4ea1e0[_0x83d2c2(0x180)]&&(_0x490022['conditionTimeoutUnit']=_0x4ea1e0[_0x83d2c2(0x180)]));}if(_0x4ea1e0[_0x83d2c2(0x211)]){const _0x4699d6=_0x4ea1e0[_0x83d2c2(0x211)][_0x83d2c2(0x200)](_0x5e4d17=>_0x5e4d17[_0x83d2c2(0x184)]&&isPendingSegmentId(_0x5e4d17[_0x83d2c2(0x184)]));if(_0x4699d6){const _0x1f0e26=_0x4ea1e0[_0x83d2c2(0x211)][_0x83d2c2(0x1ac)](_0x18c3d6=>{const _0x5f55dd=_0x83d2c2;if(_0x18c3d6[_0x5f55dd(0x184)]&&isPendingSegmentId(_0x18c3d6[_0x5f55dd(0x184)])){const _0x490463=_0x2af8f4(_0x18c3d6['segmentId'],'stage\x20\x27'+_0x591fdd+'\x27\x20wait\x20condition');return{..._0x18c3d6,'segmentId':_0x490463||_0x18c3d6['segmentId']};}return{..._0x18c3d6};});_0x490022[_0x83d2c2(0x1de)]='Condition',_0x490022[_0x83d2c2(0x211)]=_0x1f0e26,delete _0x490022['waitStep'],delete _0x490022['waitStepUnit'],delete _0x490022[_0x83d2c2(0x1d7)],delete _0x490022['conditionTimeoutDuration'],delete _0x490022['conditionTimeoutUnit'];}}}function stripPendingIds(_0x58f956){const _0x5e8ef8=a114_0x2d62e8;_0x58f956[_0x5e8ef8(0x12b)][_0x5e8ef8(0x1e5)]?.[_0x5e8ef8(0x184)]&&isPendingSegmentId(_0x58f956[_0x5e8ef8(0x12b)][_0x5e8ef8(0x1e5)][_0x5e8ef8(0x184)])&&delete _0x58f956[_0x5e8ef8(0x12b)][_0x5e8ef8(0x1e5)];for(const _0x31dec9 of _0x58f956[_0x5e8ef8(0x12b)][_0x5e8ef8(0x18d)]||[]){_0x31dec9[_0x5e8ef8(0x1b5)]?.[_0x5e8ef8(0x184)]&&isPendingSegmentId(_0x31dec9['entryCriteria'][_0x5e8ef8(0x184)])&&delete _0x31dec9[_0x5e8ef8(0x1b5)];_0x31dec9[_0x5e8ef8(0x171)]?.[_0x5e8ef8(0x184)]&&isPendingSegmentId(_0x31dec9['milestone'][_0x5e8ef8(0x184)])&&delete _0x31dec9[_0x5e8ef8(0x171)];_0x31dec9['exitCriterias']&&(_0x31dec9[_0x5e8ef8(0x18b)]=_0x31dec9[_0x5e8ef8(0x18b)]['filter'](_0x81cd15=>!_0x81cd15['segmentId']||!isPendingSegmentId(_0x81cd15[_0x5e8ef8(0x184)])));if(_0x31dec9[_0x5e8ef8(0x157)])for(const _0x2d2ed4 of Object['keys'](_0x31dec9[_0x5e8ef8(0x157)])){const _0x586dd5=_0x31dec9[_0x5e8ef8(0x157)][_0x2d2ed4];_0x586dd5[_0x5e8ef8(0x1bd)]===_0x5e8ef8(0x16f)&&_0x586dd5[_0x5e8ef8(0x1cf)]&&isPendingActivationId(_0x586dd5['journeyActivationStepId'])&&(_0x586dd5[_0x5e8ef8(0x1cf)]='');if(_0x586dd5['type']==='DecisionPoint'&&_0x586dd5[_0x5e8ef8(0x1ca)])for(const _0x2b57b2 of _0x586dd5[_0x5e8ef8(0x1ca)]){_0x2b57b2['segmentId']&&isPendingSegmentId(_0x2b57b2[_0x5e8ef8(0x184)])&&(_0x2b57b2[_0x5e8ef8(0x184)]='');}_0x586dd5[_0x5e8ef8(0x1bd)]===_0x5e8ef8(0x19e)&&stripWaitStepPendingIds(_0x586dd5);}}}function resolvePendingIdsInRequest(_0x421f6f,_0x2f831c,_0x5f1a75,_0x390e36,_0x1f7fb7,_0x430c4f){const _0x116679=a114_0x2d62e8,_0x1284cc=(_0x28eef2,_0x161cc2)=>{const _0x1acaba=a114_0x2264;if(!isPendingSegmentId(_0x28eef2))return _0x28eef2;const _0x5e116a=extractPendingSegmentName(_0x28eef2),_0x574783=_0x390e36['get'](_0x5e116a);return!_0x574783&&_0x430c4f[_0x1acaba(0x1cb)]?.(_0x1acaba(0x187)+_0x5e116a+_0x1acaba(0x1c9)+_0x161cc2),_0x574783;};if(_0x421f6f[_0x116679(0x12b)][_0x116679(0x1e5)]?.[_0x116679(0x184)]&&isPendingSegmentId(_0x421f6f[_0x116679(0x12b)][_0x116679(0x1e5)][_0x116679(0x184)])){const _0x3406e1=_0x1284cc(_0x421f6f[_0x116679(0x12b)]['goal'][_0x116679(0x184)],_0x116679(0x164));_0x3406e1&&(_0x421f6f[_0x116679(0x12b)][_0x116679(0x1e5)][_0x116679(0x184)]=_0x3406e1);}for(const _0x49ae of _0x421f6f[_0x116679(0x12b)]['journeyStages']||[]){const _0x5a51c9=_0x5f1a75[_0x116679(0x1ad)](_0x49ae[_0x116679(0x14d)][_0x116679(0x1ff)]());_0x5a51c9&&(_0x49ae['id']=_0x5a51c9);if(_0x49ae[_0x116679(0x1b5)]?.[_0x116679(0x184)]&&isPendingSegmentId(_0x49ae['entryCriteria'][_0x116679(0x184)])){const _0x483f37=_0x1284cc(_0x49ae[_0x116679(0x1b5)][_0x116679(0x184)],'stage\x20\x27'+_0x49ae[_0x116679(0x14d)]+_0x116679(0x216));_0x483f37&&(_0x49ae['entryCriteria'][_0x116679(0x184)]=_0x483f37);}if(_0x49ae[_0x116679(0x18b)])for(const _0x19bd60 of _0x49ae[_0x116679(0x18b)]){if(_0x19bd60[_0x116679(0x184)]&&isPendingSegmentId(_0x19bd60['segmentId'])){const _0xf13270=_0x1284cc(_0x19bd60[_0x116679(0x184)],_0x116679(0x1b7)+_0x49ae[_0x116679(0x14d)]+_0x116679(0x1a8));_0xf13270&&(_0x19bd60['segmentId']=_0xf13270);}}if(_0x49ae[_0x116679(0x171)]?.[_0x116679(0x184)]&&isPendingSegmentId(_0x49ae['milestone'][_0x116679(0x184)])){const _0x5d855b=_0x1284cc(_0x49ae['milestone']['segmentId'],_0x116679(0x1b7)+_0x49ae['name']+_0x116679(0x229));_0x5d855b&&(_0x49ae[_0x116679(0x171)][_0x116679(0x184)]=_0x5d855b);}if(_0x49ae[_0x116679(0x157)]){const _0x3bbc3e=_0x2cdb81=>_0x2f831c[_0x116679(0x12b)][_0x116679(0x18d)]?.[_0x116679(0x149)](_0x25f8dc=>_0x25f8dc[_0x116679(0x14d)][_0x116679(0x1ff)]()===_0x49ae[_0x116679(0x14d)][_0x116679(0x1ff)]())?.[_0x116679(0x157)]?.[_0x2cdb81];for(const _0x403d37 of Object[_0x116679(0x1e8)](_0x49ae[_0x116679(0x157)])){const _0x21ad8e=_0x49ae[_0x116679(0x157)][_0x403d37],_0x5e5073=_0x3bbc3e(_0x403d37);if(_0x21ad8e[_0x116679(0x1bd)]===_0x116679(0x16f)&&_0x21ad8e[_0x116679(0x1cf)]&&(isPendingActivationId(_0x21ad8e[_0x116679(0x1cf)])||_0x21ad8e[_0x116679(0x1cf)]==='')){if(_0x5e5073?.[_0x116679(0x1cf)]&&isPendingActivationId(_0x5e5073[_0x116679(0x1cf)])){const _0x3664a4=extractPendingActivationName(_0x5e5073[_0x116679(0x1cf)]),_0x3979df=_0x1f7fb7['get'](_0x3664a4);_0x3979df&&(_0x21ad8e['journeyActivationStepId']=_0x3979df);}}if(_0x21ad8e[_0x116679(0x1bd)]===_0x116679(0x232)&&_0x21ad8e[_0x116679(0x1ca)]&&_0x5e5073?.[_0x116679(0x1ca)])for(let _0x15d4b1=0x0;_0x15d4b1<_0x21ad8e[_0x116679(0x1ca)][_0x116679(0x19b)];_0x15d4b1++){const _0x283acd=_0x21ad8e[_0x116679(0x1ca)][_0x15d4b1],_0x15d14e=_0x5e5073[_0x116679(0x1ca)][_0x15d4b1];if(_0x15d14e?.[_0x116679(0x184)]&&isPendingSegmentId(_0x15d14e[_0x116679(0x184)])){const _0x25fd13=_0x1284cc(_0x15d14e[_0x116679(0x184)],'stage\x20\x27'+_0x49ae[_0x116679(0x14d)]+_0x116679(0x1ed)+(_0x283acd[_0x116679(0x14d)]||_0x15d4b1)+'\x27');_0x25fd13&&(_0x283acd[_0x116679(0x184)]=_0x25fd13);}}_0x21ad8e['type']===_0x116679(0x19e)&&_0x5e5073?.['type']===_0x116679(0x19e)&&resolveWaitStepPendingIds(_0x21ad8e,_0x5e5073,_0x1284cc,_0x49ae[_0x116679(0x14d)]);}}}}
1
+ const a114_0x2ffb8c=a114_0x3577;(function(_0x1b6b70,_0x5eda10){const _0x459384=a114_0x3577,_0x497c07=_0x1b6b70();while(!![]){try{const _0x11df13=-parseInt(_0x459384(0x21e))/0x1+-parseInt(_0x459384(0x20d))/0x2+-parseInt(_0x459384(0x1db))/0x3*(parseInt(_0x459384(0x221))/0x4)+parseInt(_0x459384(0x22f))/0x5*(parseInt(_0x459384(0x227))/0x6)+-parseInt(_0x459384(0x1c6))/0x7+parseInt(_0x459384(0x1fe))/0x8+-parseInt(_0x459384(0x1a1))/0x9*(-parseInt(_0x459384(0x1ef))/0xa);if(_0x11df13===_0x5eda10)break;else _0x497c07['push'](_0x497c07['shift']());}catch(_0x1def51){_0x497c07['push'](_0x497c07['shift']());}}}(a114_0xd1dc,0xa48e7));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a114_0x2ffb8c(0x194);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x3bdcf9){return''+PENDING_SEGMENT_PREFIX+_0x3bdcf9+'__';}export function isPendingSegmentId(_0x2a1e06){const _0x121a4a=a114_0x2ffb8c;return _0x2a1e06[_0x121a4a(0x13f)](PENDING_SEGMENT_PREFIX)&&!_0x2a1e06[_0x121a4a(0x13f)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1b116d){return _0x1b116d['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x288b25){return''+PENDING_ACTIVATION_PREFIX+_0x288b25+'__';}export function isPendingActivationId(_0x3e4279){const _0x71c960=a114_0x2ffb8c;return _0x3e4279[_0x71c960(0x13f)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x7112ae){const _0xfb138f=a114_0x2ffb8c;return _0x7112ae[_0xfb138f(0x1e7)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x2cf525,_0x49c1b7){const _0x533d04=a114_0x2ffb8c,_0x5e370e=_0x2cf525+'::'+(_0x49c1b7[_0x533d04(0x204)]()||_0x533d04(0x1a7)),_0x14538d=createHash(_0x533d04(0x145))[_0x533d04(0x149)](_0x5e370e)[_0x533d04(0x1f2)](_0x533d04(0x16e))[_0x533d04(0x21b)](0x0,0xc);return _0x533d04(0x148)+_0x14538d;}export function ensureJourneyDefaults(_0x67ed9d){const _0x5ba845=a114_0x2ffb8c;!_0x67ed9d[_0x5ba845(0x1b7)]&&(_0x67ed9d[_0x5ba845(0x1b7)]=''),!_0x67ed9d[_0x5ba845(0x234)]&&(_0x67ed9d['state']=_0x5ba845(0x1d0));}export function resolveTDFolderPath(_0x1d896f,_0x50a5cd,_0x5d46bd){const _0x4d8f13=a114_0x2ffb8c;if(!_0x50a5cd)return _0x1d896f;if(_0x1d896f===_0x5d46bd||_0x1d896f[_0x4d8f13(0x13f)](_0x5d46bd+'/'))return _0x1d896f;return _0x1d896f?_0x5d46bd+'/'+_0x1d896f:_0x5d46bd;}export function addFoldersToCreate(_0x166e88,_0x5ea4c7,_0x2a437a){const _0xbe344a=a114_0x2ffb8c;if(!_0x166e88)return;if(_0x5ea4c7[_0xbe344a(0x167)](_0x166e88))return;const _0xdbf1da=_0x166e88[_0xbe344a(0x1f9)]('/');let _0x5a3c48='';for(const _0xbe1242 of _0xdbf1da){_0x5a3c48=_0x5a3c48?_0x5a3c48+'/'+_0xbe1242:_0xbe1242,!_0x5ea4c7['has'](_0x5a3c48)&&_0x2a437a[_0xbe344a(0x1c7)](_0x5a3c48);}}import*as a114_0x471e57 from'yaml';import{readFileSync}from'fs';import a114_0x15b4cd from'path';import{isJourneyDef,parseYamlString as a114_0x514321,toYamlString as a114_0x3681a1,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{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x2d13e7){const _0x59bd48=a114_0x2ffb8c;if(Array[_0x59bd48(0x1b3)](_0x2d13e7))return'['+_0x2d13e7['map'](_0x7ca415=>stableStringify(_0x7ca415))['join'](',')+']';if(_0x2d13e7&&typeof _0x2d13e7===_0x59bd48(0x183)){const _0x46322e=_0x2d13e7,_0x4d585c=Object[_0x59bd48(0x192)](_0x46322e)[_0x59bd48(0x1f6)](),_0x2851dc=_0x4d585c[_0x59bd48(0x1f5)](_0x307422=>'\x22'+_0x307422+'\x22:'+stableStringify(_0x46322e[_0x307422]));return'{'+_0x2851dc['join'](',')+'}';}const _0x2acbca=JSON['stringify'](_0x2d13e7);return _0x2acbca===undefined?_0x59bd48(0x1c0):_0x2acbca;}function activationSignature(_0x41dda2){const _0x10c123=a114_0x2ffb8c,_0x5b23cf={'connection':_0x41dda2[_0x10c123(0x1bf)],..._0x41dda2[_0x10c123(0x1c2)]!==undefined&&{'all_columns':_0x41dda2['all_columns']},..._0x41dda2['columns']!==undefined&&{'columns':_0x41dda2[_0x10c123(0x1b1)]},..._0x41dda2[_0x10c123(0x203)]!==undefined&&{'behavior':_0x41dda2['behavior']},..._0x41dda2[_0x10c123(0x19e)]!==undefined&&{'schedule':_0x41dda2[_0x10c123(0x19e)]},..._0x41dda2[_0x10c123(0x177)]!==undefined&&{'notification':_0x41dda2[_0x10c123(0x177)]},..._0x41dda2[_0x10c123(0x232)]!==undefined&&{'connector_config':_0x41dda2[_0x10c123(0x232)]},..._0x41dda2['activation_template_id']!==undefined&&{'activation_template_id':_0x41dda2[_0x10c123(0x162)]}};return stableStringify(_0x5b23cf);}async function fetchSegment(_0x2b7cf0,_0x15a46f,_0x3da32c,_0x130719){const _0x1e2e03=a114_0x2ffb8c,_0x35b091=_0x130719?.['find'](_0x50c6b9=>_0x50c6b9['id']===_0x3da32c);if(_0x35b091)return _0x35b091;try{return await _0x2b7cf0['segment'][_0x1e2e03(0x1e9)](_0x15a46f,_0x3da32c);}catch(_0x1fce57){logger[_0x1e2e03(0x22b)](_0x1e2e03(0x1ee)+_0x3da32c+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x1fce57);try{return await _0x2b7cf0[_0x1e2e03(0x1a7)][_0x1e2e03(0x1f7)](_0x3da32c);}catch(_0x2332af){return logger[_0x1e2e03(0x22b)](_0x1e2e03(0x1af)+_0x3da32c+':\x20'+_0x2332af),null;}}}function recoverSegmentIdsFromPushRecovery(_0x2db2cd,_0x4220f5,_0x491e3c){const _0x3777d1=a114_0x2ffb8c,_0x298ef4=readPushRecovery(_0x2db2cd[_0x3777d1(0x142)]);if(_0x298ef4?.[_0x3777d1(0x1fc)]===_0x2db2cd[_0x3777d1(0x191)][_0x3777d1(0x237)])for(const [_0x12511a,_0x5d3133]of Object[_0x3777d1(0x169)](_0x298ef4[_0x3777d1(0x170)])){const _0x19e02d=generateDeterministicJourneySegmentName(_0x2db2cd['yamlConfig'][_0x3777d1(0x237)],_0x12511a);_0x5d3133[_0x3777d1(0x15b)]===_0x19e02d&&(_0x4220f5['set'](_0x12511a,_0x5d3133[_0x3777d1(0x1e8)]),_0x491e3c[_0x3777d1(0x18c)](_0x12511a,_0x5d3133[_0x3777d1(0x1e8)]));}}async function createOrRecoverEmbeddedSegment(_0x297462,_0x5bba76,_0x2722ec,_0x142659){const _0x58839b=a114_0x2ffb8c;let _0x211ea9;try{_0x211ea9=await _0x297462[_0x58839b(0x1a7)]['createJourneySegment']({'name':_0x2722ec['uniqueSegmentName'],'description':_0x2722ec['description'],'journeyId':_0x2722ec['journeyId'],'rule':_0x142659(_0x2722ec[_0x58839b(0x20e)],!![]),'countPopulation':!![],'parentFolderId':_0x2722ec[_0x58839b(0x182)],'audienceId':_0x2722ec[_0x58839b(0x172)]});}catch(_0x1aa1bc){const _0x4d63df=_0x1aa1bc instanceof Error&&_0x1aa1bc[_0x58839b(0x233)]['includes']('Name\x20has\x20already\x20been\x20taken');if(_0x4d63df){const _0xd7caee=readPushRecovery(_0x5bba76[_0x58839b(0x142)]),_0x5839dd=_0xd7caee?.['journeyName']===_0x5bba76[_0x58839b(0x191)]['name']?_0xd7caee['segments'][_0x2722ec[_0x58839b(0x1b2)]]:undefined;if(_0x5839dd?.[_0x58839b(0x15b)]===_0x2722ec['uniqueSegmentName'])await _0x297462['segment'][_0x58839b(0x1a6)](_0x2722ec['parentId'],_0x5839dd[_0x58839b(0x1e8)],{'description':_0x2722ec[_0x58839b(0x1b7)],'rule':_0x142659(_0x2722ec[_0x58839b(0x20e)],!![]),'countPopulation':!![]}),_0x211ea9=_0x5839dd['segmentId'];else throw new SDKError(ErrorCode[_0x58839b(0x16d)],_0x58839b(0x229)+_0x2722ec[_0x58839b(0x1b2)]+_0x58839b(0x1b5)+(_0x58839b(0x225)+_0x5bba76[_0x58839b(0x142)]['replace'](/([^/]+)$/,_0x58839b(0x13d))+')\x20')+_0x58839b(0x228),_0x1aa1bc);}else throw _0x1aa1bc;}return saveSegmentToPushRecovery(_0x5bba76['absolutePath'],_0x5bba76[_0x58839b(0x191)][_0x58839b(0x237)],_0x2722ec['localName'],{'segmentId':_0x211ea9,'uniqueServerName':_0x2722ec[_0x58839b(0x163)],'createdAt':new Date()['toISOString']()}),_0x211ea9;}export async function prepareSegmentFiles(_0xcd23bc,_0x26d4e7,_0x49411b,_0x3e1da5,_0x47c107){const _0xa3b332=a114_0x2ffb8c,{activationDefToCreateRequest:_0x1dd5fe}=await import(_0xa3b332(0x1cc)),_0x2651d4=[],_0x5eb578=new Set();for(const {yamlConfig:_0x21f4a8,folderPath:_0x18ff61,sourcePath:_0xa49c6}of _0xcd23bc){const _0x46a09e=resolveTDFolderPath(_0x18ff61,_0x3e1da5,_0x47c107),_0x22abd6=_0x46a09e+':'+_0x21f4a8[_0xa3b332(0x237)],_0x5be340=_0x26d4e7['segmentByFolderAndName']['get'](_0x22abd6),_0x392b5e=_0x5be340?_0x26d4e7[_0xa3b332(0x226)][_0xa3b332(0x15a)](_0x5be340['id'])||[]:[];addFoldersToCreate(_0x46a09e,_0x26d4e7[_0xa3b332(0x179)],_0x5eb578);const _0x5a5324=calculateActivationActions(_0x21f4a8[_0xa3b332(0x1ab)]||[],_0x392b5e,_0x26d4e7[_0xa3b332(0x1bd)],_0x26d4e7[_0xa3b332(0x231)]);for(const _0x1db0f9 of _0x5a5324){(_0x1db0f9[_0xa3b332(0x1c3)]==='create'||_0x1db0f9[_0xa3b332(0x1c3)]==='update')&&_0x1db0f9['yamlActivation']&&(_0x1db0f9[_0xa3b332(0x175)]=await _0x1dd5fe(_0x1db0f9[_0xa3b332(0x141)],_0x49411b));}const _0x42bd76=calculateSegmentDiff(_0x21f4a8,_0x5be340,_0x392b5e,_0x26d4e7[_0xa3b332(0x1bd)],_0x26d4e7['connectionIdToNameMap']);_0x2651d4[_0xa3b332(0x139)]({'relativePath':_0x21f4a8[_0xa3b332(0x237)],'absolutePath':_0xa49c6,'yamlConfig':_0x21f4a8,'folderPath':_0x46a09e,'existingSegment':_0x5be340,'existingActivations':_0x392b5e,'isNew':_0x42bd76[_0xa3b332(0x197)],'hasChanges':_0x42bd76[_0xa3b332(0x230)],'diff':_0x42bd76[_0xa3b332(0x209)],'activationActions':_0x5a5324});}return{'segmentFiles':_0x2651d4,'foldersToCreate':_0x5eb578};}export async function prepareJourneyFiles(_0xd04269,_0x1029b6,_0xacf38f,_0x50ce93){const _0x47bc45=a114_0x2ffb8c,_0x5be59e=[],_0x38ef7a=new Set();for(const {yamlConfig:_0x5a75f9,folderPath:_0x3a501b,sourcePath:_0x372860}of _0xd04269){const _0x54bc0e=resolveTDFolderPath(_0x3a501b,_0xacf38f,_0x50ce93),_0x3c0779=_0x54bc0e+':'+_0x5a75f9[_0x47bc45(0x237)],_0x5803d6=_0x1029b6['journeyBundlesByFolderAndName'][_0x47bc45(0x15a)](_0x3c0779);let _0x51f74f,_0xc960f1;if(_0x5803d6&&_0x5803d6['length']>0x0){const _0x74ab83=buildLocalExpandedRuleMappings(_0x5a75f9),{createYamlContext:_0x555e3a,prefetchJourneySegments:_0x14fdcb}=createPushYamlContextForBundle(_0x1029b6[_0x47bc45(0x13e)],_0x1029b6[_0x47bc45(0x172)],_0x1029b6[_0x47bc45(0x18a)],_0x74ab83,_0x1029b6['idToEmailMap'],_0x1029b6['connectionIdToNameMap'],_0x1029b6['activationStepsById'],_0x1029b6[_0x47bc45(0x18e)]);await _0x14fdcb(_0x5803d6[_0x47bc45(0x1f5)](_0x23073c=>_0x23073c['id']));const _0xff39d7=hasMultipleVersions(_0x5a75f9),_0x3f53ae=async _0x456185=>{const _0x57b55b=_0x47bc45,_0x520d17=_0x1029b6[_0x57b55b(0x18e)]?.[_0x57b55b(0x15a)](_0x456185);if(_0x520d17)return _0x520d17;return _0x1029b6['fetchJourney']({'journeyId':_0x456185,'journeyName':_0x5a75f9[_0x57b55b(0x237)],'isMultiVersion':_0x5803d6[_0x57b55b(0x176)]>0x1});};if(_0xff39d7&&_0x5803d6['length']>0x1){const _0xce9365=[];for(const _0x54bb6c of _0x5803d6){const _0x291a3c=_0x54bb6c[_0x47bc45(0x207)]||0x1;_0x1029b6[_0x47bc45(0x19a)]?.[_0x47bc45(0x149)](_0x47bc45(0x13a)+_0x5a75f9[_0x47bc45(0x237)]+'\x20v'+_0x291a3c);const _0x3d775f=await _0x3f53ae(_0x54bb6c['id']),_0xe1e210=_0x555e3a(_0x54bb6c['id']),_0xa2ef84=await journeyResponseToDef(_0x3d775f,_0xe1e210);_0xce9365[_0x47bc45(0x139)]({'item':_0x54bb6c,'yaml':_0xa2ef84});}const _0x2633ee=buildLocalRuleToNameMappingFromJourney(_0x5a75f9);_0xc960f1=buildMergedJourneyDef(_0xce9365,_0x2633ee);const _0x36acf2=Math['max'](..._0xce9365['map'](_0xa38310=>_0xa38310[_0x47bc45(0x160)][_0x47bc45(0x207)]||0x0)),_0x12acba=_0x5803d6['find'](_0x3391d3=>(_0x3391d3[_0x47bc45(0x207)]||0x0)===_0x36acf2);_0x12acba&&(_0x1029b6['progress']?.[_0x47bc45(0x149)]('Fetching\x20'+_0x5a75f9[_0x47bc45(0x237)]+'\x20v'+_0x36acf2),_0x51f74f=await _0x3f53ae(_0x12acba['id']));}else{const _0x2ac21c=_0x5803d6[_0x5803d6[_0x47bc45(0x176)]-0x1];_0x1029b6[_0x47bc45(0x19a)]?.[_0x47bc45(0x149)](_0x47bc45(0x13a)+_0x5a75f9[_0x47bc45(0x237)]),_0x51f74f=await _0x3f53ae(_0x2ac21c['id']);const _0xaa9fd8=_0x555e3a(_0x2ac21c['id']),_0x24b417=await journeyResponseToDef(_0x51f74f,_0xaa9fd8),_0x126803=buildLocalRuleToNameMappingFromJourney(_0x5a75f9);_0xc960f1=buildMergedJourneyDef([{'item':_0x2ac21c,'yaml':_0x24b417}],_0x126803);}}addFoldersToCreate(_0x54bc0e,_0x1029b6[_0x47bc45(0x179)],_0x38ef7a);const _0x5e12ea=calculateJourneyDiff(_0x5a75f9,_0xc960f1);_0x5be59e[_0x47bc45(0x139)]({'relativePath':_0x5a75f9['name'],'absolutePath':_0x372860,'yamlConfig':_0x5a75f9,'folderPath':_0x54bc0e,'existingJourney':_0x51f74f,'isNew':_0x5e12ea[_0x47bc45(0x197)],'hasChanges':_0x5e12ea[_0x47bc45(0x230)],'diff':_0x5e12ea['diff']});}return{'journeyFiles':_0x5be59e,'foldersToCreate':_0x38ef7a};}export function calculateActivationActions(_0x112da4,_0x5b08b3,_0x193f4b,_0xedcd82){const _0x5b309c=a114_0x2ffb8c,_0x2d043b=[],_0x507cc8=new Map();for(const _0x2654ef of _0x5b08b3){_0x507cc8[_0x5b309c(0x18c)](_0x2654ef[_0x5b309c(0x237)],_0x2654ef);}const _0x6a894c=new Map();for(const _0x4c68ad of _0x112da4){_0x6a894c[_0x5b309c(0x18c)](_0x4c68ad[_0x5b309c(0x237)],_0x4c68ad);}for(const _0x9e3479 of _0x112da4){const _0x33f7b3=_0x507cc8[_0x5b309c(0x15a)](_0x9e3479['name']);if(!_0x33f7b3)_0x2d043b[_0x5b309c(0x139)]({'type':_0x5b309c(0x21f),'name':_0x9e3479['name'],'yamlActivation':_0x9e3479});else{const _0xfa8def=activationResponseToDef(_0x33f7b3,_0x193f4b,_0xedcd82),_0x8480f5=a114_0x471e57['stringify'](_0xfa8def),_0x554d0e=a114_0x471e57[_0x5b309c(0x1f8)](_0x9e3479);_0x8480f5!==_0x554d0e&&_0x2d043b[_0x5b309c(0x139)]({'type':_0x5b309c(0x149),'name':_0x9e3479['name'],'yamlActivation':_0x9e3479,'existingActivation':_0x33f7b3});}}for(const _0x14043d of _0x5b08b3){!_0x6a894c['has'](_0x14043d[_0x5b309c(0x237)])&&_0x2d043b[_0x5b309c(0x139)]({'type':_0x5b309c(0x1d9),'name':_0x14043d[_0x5b309c(0x237)],'existingActivation':_0x14043d});}return _0x2d043b;}function calculateYamlDiff(_0x594763,_0x21e0a9){if(_0x21e0a9){const _0x2204d0=generateDiff(_0x21e0a9,_0x594763),_0x12e31b=hasChanges(_0x2204d0);return{'isNew':![],'hasChanges':_0x12e31b,'diff':_0x12e31b?formatDiffWithColors(_0x2204d0):undefined};}const _0x2aabae=generateDiff('',_0x594763);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2aabae)};}export function calculateSegmentDiff(_0x9053e0,_0x5eaf09,_0x3508e8,_0x4b1628,_0x527bf0){const _0x3ec4fe=segmentToYamlString(_0x9053e0),_0x5243ce=_0x5eaf09?segmentToYamlString(segmentWithActivationsToYaml(_0x5eaf09,_0x3508e8,undefined,_0x4b1628,_0x527bf0)):undefined;return calculateYamlDiff(_0x3ec4fe,_0x5243ce);}export function calculateJourneyDiff(_0x56fe43,_0x2c5d6c){const _0x2eb292=normalizeJourneyDef(_0x56fe43,_0x56fe43),_0x4ae7fa=a114_0x3681a1(_0x2eb292),_0x1ea624=_0x2c5d6c?a114_0x3681a1(normalizeJourneyDef(_0x2c5d6c,_0x56fe43)):undefined;return calculateYamlDiff(_0x4ae7fa,_0x1ea624);}export function findSegmentsToDelete(_0x3d3ddc,_0x16bcfa,_0x52c10c,_0x3204f8,_0x1c7593){const _0xb0db18=a114_0x2ffb8c,_0x4c9789=new Set();for(const {yamlConfig:_0x175a65,folderPath:_0x230ac7}of _0x16bcfa){_0x4c9789['add'](_0x230ac7+':'+_0x175a65['name']);}return _0x3d3ddc[_0xb0db18(0x1ea)](_0x7a58f=>{const _0x321d41=_0xb0db18,_0x197aba=_0x7a58f[_0x321d41(0x171)]?_0x52c10c['get'](_0x7a58f[_0x321d41(0x171)][_0x321d41(0x219)]())||'':'',_0x34be77=_0x197aba+':'+_0x7a58f[_0x321d41(0x237)];if(_0x4c9789[_0x321d41(0x167)](_0x34be77))return![];if(_0x1c7593)return _0x197aba===_0x3204f8||_0x197aba[_0x321d41(0x13f)](_0x3204f8+'/');return!![];});}export function findJourneysToDelete(_0x4b9492,_0x2ae81e,_0x2ba6da,_0x5c71a8,_0xa4e69f){const _0x55b1b=a114_0x2ffb8c,_0x4d9484=new Set();for(const {yamlConfig:_0x5558f2,folderPath:_0x4b97b7}of _0x2ae81e){_0x4d9484[_0x55b1b(0x1c7)](_0x4b97b7+':'+_0x5558f2['name']);}return _0x4b9492[_0x55b1b(0x1ea)](_0x57eeeb=>{const _0x31b9bd=_0x55b1b,_0x507880=_0x57eeeb[_0x31b9bd(0x182)]?_0x2ba6da['get'](_0x57eeeb[_0x31b9bd(0x182)])||'':'',_0x25c2f2=_0x507880+':'+_0x57eeeb[_0x31b9bd(0x199)];if(_0x4d9484[_0x31b9bd(0x167)](_0x25c2f2))return![];if(_0xa4e69f)return _0x507880===_0x5c71a8||_0x507880[_0x31b9bd(0x13f)](_0x5c71a8+'/');return!![];});}export function buildSegmentLookupMap(_0x33940a,_0x1f6315){const _0x256c59=a114_0x2ffb8c,_0x4cdf23=new Map();for(const _0x4976eb of _0x33940a){const _0x5a9abc=_0x4976eb['segmentFolderId']?_0x1f6315[_0x256c59(0x15a)](_0x4976eb[_0x256c59(0x171)]['toString']())||'':'',_0x56ade2=_0x5a9abc+':'+_0x4976eb[_0x256c59(0x237)];_0x4cdf23[_0x256c59(0x18c)](_0x56ade2,_0x4976eb);}return _0x4cdf23;}export function buildSegmentNameToIdMap(_0x38f8a8){const _0x2fb762=new Map();for(const _0x3620af of _0x38f8a8){_0x2fb762['set'](_0x3620af['name'],_0x3620af['id']);}return _0x2fb762;}export function buildJourneyBundleLookupMap(_0x3abf87,_0x3b983e){const _0x1c3124=a114_0x2ffb8c,_0x38d34d=new Map();for(const _0x32d290 of _0x3abf87){const _0x176804=_0x32d290[_0x1c3124(0x182)]?_0x3b983e[_0x1c3124(0x15a)](_0x32d290[_0x1c3124(0x182)])||'':'',_0x9b8359=_0x176804+':'+_0x32d290[_0x1c3124(0x199)];!_0x38d34d['has'](_0x9b8359)&&_0x38d34d['set'](_0x9b8359,[]),_0x38d34d['get'](_0x9b8359)['push'](_0x32d290);}for(const _0xfaf82e of _0x38d34d[_0x1c3124(0x22c)]()){_0xfaf82e[_0x1c3124(0x1f6)]((_0x5a30b4,_0x38d9eb)=>(_0x5a30b4[_0x1c3124(0x207)]||0x0)-(_0x38d9eb[_0x1c3124(0x207)]||0x0));}return _0x38d34d;}function a114_0xd1dc(){const _0x25ae10=['Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','\x27\x20decision\x20point\x20branch\x20\x27','WaitStep','activationContext','folderId','object','created','parentFolder','toLowerCase','\x27\x20exit\x20criteria','folderPath','createdSegmentId','existingSegments','max','set','getJourney','journeyById','Created\x20journey\x20\x27','ACTIVATION_SYNTAX_ERROR','yamlConfig','keys','stages','__pending_','flatMap','NOT_FOUND','isNew','activation_deleting','journeyBundleName','progress','nameToType','segment_created','deleteSegment','schedule','Failed\x20to\x20fetch\x20referenced\x20segment\x20','JOURNEY_SYNTAX_ERROR','882FIlWcP','user','size','Creating\x20segment\x20\x27','stage\x20\x27','updateSegmentById','segment','journey_updated','join','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','activations','\x27\x20milestone','activationParams','Creating\x20folder\x20\x27','getSegmentEntity\x20also\x20failed\x20for\x20','Condition','columns','localName','isArray','journey_creating','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Stage\x20\x27','description','deleted','waitStepType','existingSegment','Journey\x20\x27','logSuccess','idToEmailMap','valid','connection','null','run_after_journey_refresh','all_columns','type','onProgress','action','9324518lGtaLw','add','JOURNEY_UPDATE_ERROR','../../utils/async.js','milestone','activation_created','./child-segment-yaml.js','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','createSegment','conditionTimeoutUnit','draft','Deleted\x20segment\x20\x27','):\x20','logInfo','some','journeys','folder_created','Created\x20activation\x20\x27','segment_deleting','delete','\x20(referenced\x20in\x20journey\x20','18597CdTPiy','goal\x20criteria','segment_creating','decision_point','Created\x20segment\x20\x27','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','segment_updated','SEGMENT_SYNTAX_ERROR','Created\x20folder\x20\x27','\x0a\x20\x20','logDeleted','entryCriteria','replace','segmentId','getSegment','filter','journeyActivationStepId','with','conditionTimeoutDuration','getSegment\x20failed\x20for\x20','442070wopvvp','waitStep','INTERNAL','digest','data','Deleted\x20activation\x20\x27','map','sort','getSegmentEntity','stringify','split','updated','Entry\x20criteria:\x20','journeyName','folder','3886672pwrIam','deleteActivation','rootFolderId','index','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','behavior','trim','activation_deleted','rule','versionNumber','relationships','diff','resolveJourneyId','idToName','Updated\x20journey\x20\x27','2599692YSqNoE','resolvedRule','embedded_segment_creating','buildUserMaps','branches','Updated\x20segment\x20\x27','getActivation','all','\x27\x20from\x20file:\x20','activation_updated','utf-8','Updated\x20activation\x20\x27','toString','embeddedSegmentNameToId','slice','journey','logWarning','384863bSegEG','create','\x20error(s)','824ofXbgw','journeyId','from','DecisionPoint','Delete\x20the\x20push\x20recovery\x20file\x20(','activationsBySegmentId','6giosKl','and\x20the\x20server\x20segment,\x20then\x20retry.','Embedded\x20segment\x20\x27','existingActivation','debug','values','./journey-yaml.js','kind','748400VXzgYR','hasChanges','connectionIdToNameMap','connector_config','message','state','\x27\x20entry\x20criteria','createActivation','name','Segment\x20not\x20found','push','Fetching\x20','createFolder','Segment\x20not\x20found:\x20','.$1.push-recovery.json','deps','startsWith','find','yamlActivation','absolutePath','Failed\x20to\x20','journey_updating','sha1','results','embedded_activation_creating','journey_entry_criteria_','update','embedded_segment_created','\x27\x20wait\x20condition','segmentNameToId','\x20activation\x20\x27','entry','resolveSegment','attributes','Activation','conditionSegmentId','verbose','exitCriterias','Deleting\x20activation\x20\x27','\x27...','withProgress','activation_updating','createdSegmentIds','get','uniqueServerName','journeyStages','relative','segment_updating','day','item','journey_created','activation_template_id','uniqueSegmentName','skipSegments','listActivations','parseDocument','has','list','entries','folder_creating','Failed\x20to\x20resolve\x20segment\x20','conditions','SEGMENT_UPDATE_ERROR','hex','existingJourney','segments','segmentFolderId','parentId','waitStepUnit','SEGMENT_NOT_FOUND','validatedRequest','length','notification','activation_creating','folderPathToId','goal','parse','ACTIVATION_UPDATE_ERROR','steps'];a114_0xd1dc=function(){return _0x25ae10;};return a114_0xd1dc();}export function collectFoldersToCreate(_0x2db9bc,_0x1e17b9){const _0x4ec53a=a114_0x2ffb8c,_0x12602f=new Set();for(const _0x292a03 of _0x2db9bc){if(!_0x292a03)continue;if(_0x1e17b9[_0x4ec53a(0x167)](_0x292a03))continue;const _0x417b33=_0x292a03[_0x4ec53a(0x1f9)]('/');let _0x779c6b='';for(const _0x110d3d of _0x417b33){_0x779c6b=_0x779c6b?_0x779c6b+'/'+_0x110d3d:_0x110d3d,!_0x1e17b9[_0x4ec53a(0x167)](_0x779c6b)&&_0x12602f[_0x4ec53a(0x1c7)](_0x779c6b);}}return _0x12602f;}export function parseAndClassifyYamlFiles(_0x559991,_0x51c9cb,_0x4be4de){const _0x46894e=a114_0x2ffb8c,_0x272ca8=[],_0x563bce=[];for(const _0x3cda6f of _0x559991){const _0x5a7237=a114_0x15b4cd[_0x46894e(0x15d)](_0x51c9cb,a114_0x15b4cd['dirname'](_0x3cda6f)),_0xa3b258=_0x5a7237==='.'?'':_0x5a7237,_0x79364e=readFileSync(_0x3cda6f,_0x46894e(0x217)),_0x392a51=a114_0x471e57[_0x46894e(0x17b)](_0x79364e);if(isJourneyDef(_0x392a51)){const _0x57a101=a114_0x514321(_0x79364e);_0x563bce[_0x46894e(0x139)]({'yamlConfig':_0x57a101,'folderPath':_0xa3b258,'sourcePath':_0x3cda6f});}else{if(!_0x4be4de?.[_0x46894e(0x164)]){const _0x261fce=parseSegmentYamlFile(_0x79364e),_0xccc716=normalizeChildSegmentYaml(_0x261fce);_0x272ca8[_0x46894e(0x139)]({'yamlConfig':_0xccc716,'folderPath':_0xa3b258,'sourcePath':_0x3cda6f});}}}return{'segments':_0x272ca8,'journeys':_0x563bce};}export function validateParsedFiles(_0x231206,_0x3bca3b){const _0x17631c=a114_0x2ffb8c,_0xc9bb43=[];for(const {yamlConfig:_0xf1adbe,sourcePath:_0x46742e}of _0x231206[_0x17631c(0x170)]){const _0x11cbfe=readFileSync(_0x46742e,_0x17631c(0x217)),_0x38d106=a114_0x471e57[_0x17631c(0x166)](_0x11cbfe),_0x685e9=validateSegmentDef(_0xf1adbe,{'source':_0x11cbfe,'document':_0x38d106});if(!_0x685e9[_0x17631c(0x1be)]){const _0x45eada=a114_0x15b4cd[_0x17631c(0x15d)](_0x3bca3b,_0x46742e);_0xc9bb43[_0x17631c(0x139)]({'filePath':_0x45eada,'source':_0x11cbfe,'result':_0x685e9,'isJourney':![]});}}for(const {yamlConfig:_0x237bac,sourcePath:_0x597a32}of _0x231206[_0x17631c(0x1d5)]){const _0x397755=readFileSync(_0x597a32,_0x17631c(0x217)),_0x3c4e3a=a114_0x471e57[_0x17631c(0x166)](_0x397755),_0x2f0dcc=validateJourneyDef(_0x237bac,{'source':_0x397755,'document':_0x3c4e3a});if(!_0x2f0dcc[_0x17631c(0x1be)]){const _0x2b9d12=a114_0x15b4cd[_0x17631c(0x15d)](_0x3bca3b,_0x597a32);_0xc9bb43[_0x17631c(0x139)]({'filePath':_0x2b9d12,'source':_0x397755,'result':_0x2f0dcc,'isJourney':!![]});}}return _0xc9bb43;}function a114_0x3577(_0x114411,_0x24c45e){_0x114411=_0x114411-0x138;const _0xd1dc6e=a114_0xd1dc();let _0x35770e=_0xd1dc6e[_0x114411];return _0x35770e;}export function formatValidationErrors(_0x1d9d74){const _0x5a86d0=a114_0x2ffb8c,_0x204b6e=[];for(const {filePath:_0x378d55,source:_0x21ff31,result:_0x2f4e57,isJourney:_0xf5f314}of _0x1d9d74){const _0x169513=_0xf5f314?_0x5a86d0(0x21c):_0x5a86d0(0x1a7);_0x204b6e[_0x5a86d0(0x139)]('\x0a'+_0x378d55+'\x20('+_0x169513+_0x5a86d0(0x1d2)+_0x2f4e57['errors'][_0x5a86d0(0x176)]+_0x5a86d0(0x220)),_0x204b6e[_0x5a86d0(0x139)](formatValidationResult(_0x2f4e57,_0x21ff31,_0x378d55));}return _0x204b6e[_0x5a86d0(0x1a9)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4efaf8){const _0x478c62=a114_0x2ffb8c,_0x3a7517=new Set(),_0x1a7e08=new Map(),_0x1b7102=collectSegmentUsageCounts(_0x4efaf8);if(_0x4efaf8[_0x478c62(0x170)])for(const [_0x491fff,_0x5969aa]of Object[_0x478c62(0x169)](_0x4efaf8[_0x478c62(0x170)])){_0x3a7517[_0x478c62(0x1c7)](_0x491fff);if(_0x5969aa[_0x478c62(0x206)]){const _0xf9c3bd=yamlRuleToApi(_0x5969aa[_0x478c62(0x206)]),_0x4466b2=apiRuleToYaml(_0xf9c3bd);_0x1a7e08[_0x478c62(0x18c)](_0x491fff,_0x4466b2);}}const _0x299a16=new Map();let _0xaa3561=0x0;for(const [_0x2a44ee,_0x5f0eb1]of _0x1a7e08){const _0x26523d=serializeExpandedRule(_0x5f0eb1,_0x1a7e08),_0x51fd92=_0x299a16[_0x478c62(0x15a)](_0x26523d)||[];_0x51fd92[_0x478c62(0x139)]({'name':_0x2a44ee,'index':_0xaa3561}),_0x299a16[_0x478c62(0x18c)](_0x26523d,_0x51fd92),_0xaa3561++;}const _0x2e0c5d=new Map();for(const [_0x3bd49e,_0x4efc64]of _0x299a16){const _0x2e68b8=_0x4efc64[_0x478c62(0x21b)]()[_0x478c62(0x1f6)]((_0x4e13cc,_0x17fdd8)=>{const _0x4008fe=_0x478c62,_0x1584ae=_0x1b7102[_0x4008fe(0x15a)](_0x4e13cc[_0x4008fe(0x237)])||0x0,_0x2377f2=_0x1b7102['get'](_0x17fdd8[_0x4008fe(0x237)])||0x0;if(_0x1584ae!==_0x2377f2)return _0x2377f2-_0x1584ae;return _0x4e13cc[_0x4008fe(0x201)]-_0x17fdd8[_0x4008fe(0x201)];})[_0x478c62(0x1f5)](_0x406e05=>_0x406e05[_0x478c62(0x237)]),_0x2b409a=[];for(const _0x10cf12 of _0x2e68b8){const _0x1d2618=_0x1b7102[_0x478c62(0x15a)](_0x10cf12)||0x0,_0x39d4ab=Math[_0x478c62(0x18b)](_0x1d2618,0x1);for(let _0x449c15=0x0;_0x449c15<_0x39d4ab;_0x449c15++){_0x2b409a[_0x478c62(0x139)](_0x10cf12);}}_0x2e0c5d[_0x478c62(0x18c)](_0x3bd49e,_0x2b409a);}return{'existingLocalSegmentNames':_0x3a7517,'localSegmentRules':_0x1a7e08,'localExpandedRuleToNames':_0x2e0c5d};}export function createSegmentIdResolver(_0x49f8fa,_0x44270d){return async _0x36dca7=>{const _0x418253=a114_0x3577,_0x4402fd=_0x49f8fa[_0x418253(0x15a)](_0x36dca7);if(!_0x4402fd)throw new SDKError(ErrorCode[_0x418253(0x174)],'Segment\x20not\x20found:\x20'+_0x36dca7+_0x418253(0x202)+_0x44270d+'\x27)');return _0x4402fd;};}export function extractRootFolderId(_0x320210){const _0x32cc61=a114_0x2ffb8c;return _0x320210['relationships']?.['parentSegmentFolder']?.[_0x32cc61(0x1f3)]?.['id']||_0x320210[_0x32cc61(0x208)]?.[_0x32cc61(0x185)]?.[_0x32cc61(0x1f3)]?.['id'];}export function buildConnectionMaps(_0x48b6c0){const _0x22acee=a114_0x2ffb8c,_0x388158=new Map(),_0x3098f8=new Map(),_0xed1246=new Map();for(const _0xa5b14a of _0x48b6c0){_0x388158[_0x22acee(0x18c)](_0xa5b14a[_0x22acee(0x237)],parseInt(_0xa5b14a['id'],0xa)),_0x3098f8[_0x22acee(0x18c)](_0xa5b14a['id'],_0xa5b14a[_0x22acee(0x237)]),_0xed1246[_0x22acee(0x18c)](_0xa5b14a[_0x22acee(0x237)],_0xa5b14a[_0x22acee(0x1c3)]);}return{'nameToId':_0x388158,'idToName':_0x3098f8,'nameToType':_0xed1246};}export function calculatePushStats(_0x385e8a,_0x4f4bee,_0x370f9a,_0x5c3fce,_0x308f58,_0x140510,_0x40cdc9){const _0x6357e0=a114_0x2ffb8c,_0x35f208=_0x385e8a[_0x6357e0(0x1ea)](_0x4cc713=>_0x4cc713['isNew']),_0x15ceb6=_0x385e8a[_0x6357e0(0x1ea)](_0x1a121d=>!_0x1a121d[_0x6357e0(0x197)]&&_0x1a121d['hasChanges']),_0x55b7f5=_0x385e8a[_0x6357e0(0x1ea)](_0x54e336=>!_0x54e336[_0x6357e0(0x197)]&&!_0x54e336[_0x6357e0(0x230)]),_0xaa00e3=_0x140510?_0x5c3fce:[],_0x17132f=_0x4f4bee['filter'](_0x5f22a9=>_0x5f22a9[_0x6357e0(0x197)]),_0x4827cd=_0x4f4bee[_0x6357e0(0x1ea)](_0x3b486d=>!_0x3b486d[_0x6357e0(0x197)]&&_0x3b486d[_0x6357e0(0x230)]),_0x217d7c=_0x4f4bee[_0x6357e0(0x1ea)](_0x48504b=>!_0x48504b[_0x6357e0(0x197)]&&!_0x48504b['hasChanges']),_0x659490=_0x140510?_0x308f58:[],_0x8bb77=_0x385e8a[_0x6357e0(0x195)](_0x165dd0=>_0x165dd0['activationActions']),_0x26111e=_0x8bb77['filter'](_0x4ca12d=>_0x4ca12d['type']===_0x6357e0(0x21f)),_0x3debc9=_0x8bb77['filter'](_0x4ba357=>_0x4ba357['type']===_0x6357e0(0x149)),_0x1e5080=_0x8bb77['filter'](_0x4fd0e2=>_0x4fd0e2[_0x6357e0(0x1c3)]==='delete'),_0x475bef=Array[_0x6357e0(0x223)](_0x370f9a)[_0x6357e0(0x1f6)](),_0x573b54=_0x40cdc9?![]:_0x35f208[_0x6357e0(0x176)]>0x0||_0x15ceb6[_0x6357e0(0x176)]>0x0||_0xaa00e3[_0x6357e0(0x176)]>0x0,_0x40fdc4=_0x17132f[_0x6357e0(0x176)]>0x0||_0x4827cd[_0x6357e0(0x176)]>0x0||_0x659490['length']>0x0,_0x2daacb=_0x40cdc9?![]:_0x8bb77[_0x6357e0(0x176)]>0x0,_0x419f18=_0x475bef[_0x6357e0(0x176)]>0x0;return{'segments':{'new':_0x35f208,'changed':_0x15ceb6,'unchanged':_0x55b7f5,'toDelete':_0xaa00e3},'journeys':{'new':_0x17132f,'changed':_0x4827cd,'unchanged':_0x217d7c,'toDelete':_0x659490},'activations':{'all':_0x8bb77,'toCreate':_0x26111e,'toUpdate':_0x3debc9,'toDelete':_0x1e5080},'folders':{'toCreate':_0x475bef},'counts':{'segments':{'new':_0x35f208['length'],'changed':_0x15ceb6[_0x6357e0(0x176)],'unchanged':_0x55b7f5[_0x6357e0(0x176)],'toDelete':_0xaa00e3['length']},'journeys':{'new':_0x17132f[_0x6357e0(0x176)],'changed':_0x4827cd[_0x6357e0(0x176)],'unchanged':_0x217d7c[_0x6357e0(0x176)],'toDelete':_0x659490[_0x6357e0(0x176)]},'activations':{'create':_0x26111e[_0x6357e0(0x176)],'update':_0x3debc9['length'],'delete':_0x1e5080[_0x6357e0(0x176)]},'folders':_0x475bef[_0x6357e0(0x176)]},'hasChanges':_0x573b54||_0x40fdc4||_0x2daacb||_0x419f18};}export async function buildPushExecutionContext(_0x4f1138,_0x7445b5,_0x3a4031,_0x35d43e,_0x1ddc6d,_0x15f39c){const _0x16d9cc=a114_0x2ffb8c,_0x4b2cee=extractRootFolderId(_0x3a4031),{pathToId:_0x3abbec,idToPath:_0x1d44f6}=buildFolderMaps(_0x1ddc6d),_0x83500c=buildSegmentNameToIdMap(_0x35d43e),_0x44b507=new Map(),{batchAsync:_0x114b36}=await import('../../utils/async.js'),[_0x13052e,_0x25c013]=await Promise[_0x16d9cc(0x214)]([_0x4f1138[_0x16d9cc(0x1a2)][_0x16d9cc(0x210)](),_0x4f1138[_0x16d9cc(0x1bf)][_0x16d9cc(0x168)](),((async()=>{const _0x1d6741=_0x16d9cc;!_0x15f39c&&_0x35d43e[_0x1d6741(0x176)]>0x0&&await _0x114b36(_0x35d43e,async _0x3ab8d5=>{const _0x242414=_0x1d6741,_0x43b1e6=await _0x4f1138[_0x242414(0x1a7)]['listActivations'](_0x7445b5,_0x3ab8d5['id']);_0x44b507[_0x242414(0x18c)](_0x3ab8d5['id'],_0x43b1e6);});})())]),{emailToId:_0x4a8b07,idToEmail:_0x4b2506}=_0x13052e,_0x455065=buildConnectionMaps(_0x25c013);return{'rootFolderId':_0x4b2cee,'folderPathToId':_0x3abbec,'folderIdToPath':_0x1d44f6,'segmentNameToId':_0x83500c,'activationsBySegmentId':_0x44b507,'emailToIdMap':_0x4a8b07,'idToEmailMap':_0x4b2506,'connectionNameToIdMap':_0x455065['nameToId'],'connectionIdToNameMap':_0x455065[_0x16d9cc(0x20b)],'connectionNameToTypeMap':_0x455065[_0x16d9cc(0x19b)]};}export function createPushYamlContextForBundle(_0x3d03ac,_0x320046,_0x5e429b,_0x287aea,_0x118338,_0x515535,_0x423a64,_0x6ca0f4){const {existingLocalSegmentNames:_0x449d26,localExpandedRuleToNames:_0x3dd461}=_0x287aea,_0xab936d=new Set(),_0x3b415f=new Map(),_0x505f2e=new Map(),_0x255f26=new Map(),_0x419a1f=createJumpTargetCache(),_0x436ded=new Map(),_0x1f62e4=new Map(),_0x132f55=new Set();let _0xf2f9c6;const _0x1e76bf=_0x1bce27=>{const _0x369ae2={'resolveSegment':async _0x4518de=>{const _0x546ac=a114_0x3577,_0x542d6b=_0x255f26[_0x546ac(0x15a)](_0x4518de);if(_0x542d6b!==undefined)return{'name':_0x542d6b,'isJourneyLocal':!![]};try{const _0x444993=await fetchSegment(_0x3d03ac,_0x320046,_0x4518de,_0x5e429b);if(!_0x444993)throw new Error(_0x546ac(0x138));const _0x4c000c=generateJourneyLocalName(_0x444993[_0x546ac(0x237)]),_0x26d962=_0x444993[_0x546ac(0x22e)]===SEGMENT_KIND_JOURNEY&&_0x4c000c!==undefined;let _0x112be3=_0x444993[_0x546ac(0x237)],_0x815615;if(_0x26d962&&_0x444993[_0x546ac(0x206)]){const _0xd687fe=apiRuleToYaml(_0x444993['rule']);_0x1f62e4[_0x546ac(0x18c)](_0x4518de,_0xd687fe);const _0x363f63=async _0x545992=>{const _0x34b04c=_0x546ac,_0x11a678=collectSegmentRefsFromRule(_0x545992);for(const _0x59e555 of _0x11a678){if(!_0x1f62e4[_0x34b04c(0x167)](_0x59e555))try{const _0x447b84=await fetchSegment(_0x3d03ac,_0x320046,_0x59e555,_0x5e429b);if(_0x447b84?.[_0x34b04c(0x206)]){const _0x4a1c60=apiRuleToYaml(_0x447b84['rule']);_0x1f62e4[_0x34b04c(0x18c)](_0x59e555,_0x4a1c60),await _0x363f63(_0x4a1c60);}}catch(_0x2be332){logger[_0x34b04c(0x22b)](_0x34b04c(0x19f)+_0x59e555+':\x20'+_0x2be332);}}};await _0x363f63(_0xd687fe);const _0x1c386d=serializeExpandedRule(_0xd687fe,_0x1f62e4),_0x25896f=_0x3dd461[_0x546ac(0x15a)](_0x1c386d);if(_0x25896f&&_0x25896f[_0x546ac(0x176)]>0x0){const _0x3c513d=_0x3b415f[_0x546ac(0x15a)](_0x1c386d)||0x0,_0x4fde3f=_0x25896f[_0x3c513d]||_0x25896f[_0x25896f['length']-0x1];_0x3b415f[_0x546ac(0x18c)](_0x1c386d,_0x3c513d+0x1),_0x112be3=_0x4fde3f,_0xab936d[_0x546ac(0x1c7)](_0x112be3),_0x255f26[_0x546ac(0x18c)](_0x4518de,_0x112be3);const _0x509346=await resolveRuleSegmentRefs(_0xd687fe,async _0x292001=>{const _0x249db1=_0x546ac,_0x157b87=_0x255f26[_0x249db1(0x15a)](_0x292001);if(_0x157b87)return _0x157b87;const _0x422884=await _0xf2f9c6[_0x249db1(0x14f)](_0x292001);return _0x422884['name'];});_0x815615={'description':_0x444993[_0x546ac(0x1b7)],'rule':_0x509346};}else{const _0x122f82=_0x436ded[_0x546ac(0x15a)](_0x1c386d);if(_0x122f82)_0x112be3=_0x122f82,_0x255f26[_0x546ac(0x18c)](_0x4518de,_0x112be3);else{if(_0x4c000c){let _0x30cc01=_0x4c000c,_0x1e589b=0x2;while(_0xab936d[_0x546ac(0x167)](_0x30cc01)||_0x449d26['has'](_0x30cc01)){_0x30cc01=_0x4c000c+'_'+_0x1e589b,_0x1e589b++;}_0xab936d[_0x546ac(0x1c7)](_0x30cc01),_0x112be3=_0x30cc01;}_0x255f26['set'](_0x4518de,_0x112be3),_0x436ded['set'](_0x1c386d,_0x112be3);const _0x251f94=await resolveRuleSegmentRefs(_0xd687fe,async _0x2f260c=>{const _0x1b1df1=_0x546ac,_0x431b83=_0x255f26['get'](_0x2f260c);if(_0x431b83)return _0x431b83;const _0x54d199=await _0xf2f9c6[_0x1b1df1(0x14f)](_0x2f260c);return _0x54d199['name'];});_0x815615={'description':_0x444993[_0x546ac(0x1b7)],'rule':_0x251f94};}}}return{'name':_0x112be3,'isJourneyLocal':_0x26d962,'definition':_0x815615};}catch(_0x7eaf51){return logger[_0x546ac(0x22b)](_0x546ac(0x16b)+_0x4518de+':\x20'+_0x7eaf51),{'name':_0x4518de,'isJourneyLocal':![]};}},'resolveActivation':async _0x6a5741=>{const _0x18a7c6=a114_0x3577,_0x59919f=_0x505f2e[_0x18a7c6(0x15a)](_0x6a5741);if(_0x59919f!==undefined)return{'name':_0x59919f,'isJourneyLocal':!![]};try{let _0x5c0f6e=_0x423a64?.[_0x18a7c6(0x15a)](_0x6a5741);!_0x5c0f6e&&(_0x5c0f6e=await _0x3d03ac[_0x18a7c6(0x21c)][_0x18a7c6(0x213)](_0x1bce27,_0x6a5741));const _0x8a7740=_0x5c0f6e['attributes'][_0x18a7c6(0x1ad)][_0x18a7c6(0x237)]||_0x6a5741,_0x4de6c9=sanitizeYamlKey(_0x8a7740)||'activation_'+_0x6a5741,_0x546479=_0x4de6c9;_0x505f2e['set'](_0x6a5741,_0x546479);const _0x345a0f=journeyActivationStepToYaml(_0x5c0f6e,_0x118338,_0x515535);return{'name':_0x546479,'isJourneyLocal':!![],'definition':_0x345a0f};}catch(_0x532333){return logger[_0x18a7c6(0x22b)]('Failed\x20to\x20resolve\x20activation\x20'+_0x6a5741+':\x20'+_0x532333),{'name':_0x6a5741,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x45a230,_0x19291f)=>resolveJumpTarget(_0x45a230,_0x19291f,_0x419a1f,async _0x51bcf0=>{const _0x5ea93b=a114_0x3577,_0x1fe3ab=_0x6ca0f4?.['get'](_0x51bcf0);if(_0x1fe3ab)return _0x1fe3ab;return _0x3d03ac[_0x5ea93b(0x21c)][_0x5ea93b(0x18d)](_0x51bcf0);})};return _0xf2f9c6=_0x369ae2,_0x369ae2;},_0x17b255=async _0x37d5e6=>{const _0x4f372c=a114_0x3577,{collectSegmentIdsFromJourneyApi:_0x12706c}=await import(_0x4f372c(0x22d)),{batchAsync:_0x5d1129}=await import(_0x4f372c(0x1c9)),_0x570d7f=new Set();for(const _0x17aa02 of _0x37d5e6){let _0x49b259=_0x6ca0f4?.['get'](_0x17aa02);!_0x49b259&&(_0x49b259=await _0x3d03ac[_0x4f372c(0x21c)]['getJourney'](_0x17aa02));const _0x25bba7=_0x12706c(_0x49b259);for(const _0x161d1c of _0x25bba7){_0x570d7f['add'](_0x161d1c);}}let _0x158109=Array['from'](_0x570d7f);while(_0x158109['length']>0x0){const _0x147c8a=_0x158109[_0x4f372c(0x1ea)](_0x3af726=>!_0x132f55[_0x4f372c(0x167)](_0x3af726));if(_0x147c8a['length']===0x0)break;const _0x53c838=await _0x5d1129(_0x147c8a,async _0x104001=>{const _0x565eb0=_0x4f372c;_0x132f55[_0x565eb0(0x1c7)](_0x104001);const _0x2834be=await fetchSegment(_0x3d03ac,_0x320046,_0x104001,_0x5e429b);if(!_0x2834be)return null;return{'segmentId':_0x104001,'segment':_0x2834be};},0xa),_0x3be281=new Set();for(const _0x56754f of _0x53c838){if(!_0x56754f?.[_0x4f372c(0x1a7)]?.['rule'])continue;const _0x295058=apiRuleToYaml(_0x56754f[_0x4f372c(0x1a7)]['rule']);_0x1f62e4[_0x4f372c(0x18c)](_0x56754f[_0x4f372c(0x1e8)],_0x295058);const _0x5d30cb=collectSegmentRefsFromRule(_0x295058);for(const _0x5a3ed7 of _0x5d30cb){!_0x132f55['has'](_0x5a3ed7)&&_0x3be281[_0x4f372c(0x1c7)](_0x5a3ed7);}}_0x158109=Array['from'](_0x3be281);}};return{'createYamlContext':_0x1e76bf,'prefetchJourneySegments':_0x17b255};}export async function executePushSegments(_0x33d024,_0x3cd0ff,_0x43d689,_0x49669a,_0x211562){const _0x2db860=a114_0x2ffb8c,{segmentDefToCreateRequest:_0x59442b,segmentDefToUpdateRequest:_0x90a131}=await import(_0x2db860(0x1cc)),_0x246e16=_0x43d689[_0x2db860(0x179)],_0x309f94=0x5,_0x49931a=async _0x5f0ef3=>{const _0x2e397d=_0x2db860,_0x3bd948=_0x5f0ef3[_0x2e397d(0x188)]?_0x246e16['get'](_0x5f0ef3['folderPath']):undefined;let _0x37416e;const _0x54be02={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x5f0ef3['isNew']){_0x211562['onProgress']?.({'type':_0x2e397d(0x1dd),'name':_0x5f0ef3[_0x2e397d(0x191)]['name']});const _0x51a9e1=_0x59442b(_0x5f0ef3[_0x2e397d(0x191)],_0x3bd948),_0x1c2e22=await _0x211562[_0x2e397d(0x157)](_0x2e397d(0x1a4)+_0x5f0ef3['yamlConfig'][_0x2e397d(0x237)]+_0x2e397d(0x156),()=>_0x33d024[_0x2e397d(0x1a7)][_0x2e397d(0x1ce)](_0x49669a[_0x2e397d(0x172)],_0x51a9e1));_0x37416e=_0x1c2e22[_0x2e397d(0x1f3)]['id'],_0x54be02[_0x2e397d(0x189)]={'name':_0x5f0ef3[_0x2e397d(0x191)][_0x2e397d(0x237)],'id':_0x37416e},_0x211562[_0x2e397d(0x1c4)]?.({'type':_0x2e397d(0x19c),'name':_0x5f0ef3[_0x2e397d(0x191)][_0x2e397d(0x237)],'segmentId':_0x37416e}),_0x211562[_0x2e397d(0x1bc)]?.(_0x2e397d(0x1df)+_0x5f0ef3[_0x2e397d(0x191)][_0x2e397d(0x237)]+'\x27'),_0x54be02['created']=0x1;}else{if(_0x5f0ef3[_0x2e397d(0x230)]){_0x211562['onProgress']?.({'type':_0x2e397d(0x15e),'name':_0x5f0ef3[_0x2e397d(0x191)]['name']});const _0x55b4ac=_0x90a131(_0x5f0ef3['yamlConfig']);_0x3bd948!==_0x5f0ef3[_0x2e397d(0x1ba)]?.[_0x2e397d(0x171)]&&(_0x55b4ac[_0x2e397d(0x171)]=_0x3bd948?parseInt(_0x3bd948,0xa):undefined),await _0x211562[_0x2e397d(0x157)]('Updating\x20segment\x20\x27'+_0x5f0ef3[_0x2e397d(0x191)][_0x2e397d(0x237)]+_0x2e397d(0x156),()=>_0x33d024[_0x2e397d(0x1a7)][_0x2e397d(0x1a6)](_0x49669a[_0x2e397d(0x172)],_0x5f0ef3['existingSegment']['id'],_0x55b4ac)),_0x37416e=_0x5f0ef3[_0x2e397d(0x1ba)]['id'],_0x211562[_0x2e397d(0x1c4)]?.({'type':_0x2e397d(0x1e1),'name':_0x5f0ef3[_0x2e397d(0x191)][_0x2e397d(0x237)]}),_0x211562[_0x2e397d(0x1bc)]?.(_0x2e397d(0x212)+_0x5f0ef3['yamlConfig']['name']+'\x27'),_0x54be02[_0x2e397d(0x1fa)]=0x1;}else _0x37416e=_0x5f0ef3['existingSegment']['id'];}}catch(_0x38cb5){const _0x4be805=isHttp400Error(_0x38cb5),_0x1ade3a=_0x4be805?ErrorCode[_0x2e397d(0x1e2)]:ErrorCode[_0x2e397d(0x16d)],_0x5105d4=getErrorMessage(_0x38cb5);throw new SDKError(_0x1ade3a,_0x2e397d(0x143)+(_0x5f0ef3[_0x2e397d(0x197)]?_0x2e397d(0x21f):_0x2e397d(0x149))+'\x20segment\x20from\x20file:\x20'+_0x5f0ef3[_0x2e397d(0x142)]+_0x2e397d(0x1e4)+_0x5105d4,_0x38cb5);}try{const _0x49c4a6=await syncActivationsForSegment(_0x33d024,_0x49669a[_0x2e397d(0x172)],_0x37416e,_0x5f0ef3[_0x2e397d(0x191)][_0x2e397d(0x237)],_0x5f0ef3['activationActions'],_0x211562,_0x5f0ef3[_0x2e397d(0x142)]);_0x54be02[_0x2e397d(0x1ab)]=_0x49c4a6;}catch(_0x84a48){if(_0x84a48 instanceof SDKError)throw _0x84a48;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x5f0ef3[_0x2e397d(0x191)][_0x2e397d(0x237)]+'\x27\x20from\x20file:\x20'+_0x5f0ef3[_0x2e397d(0x142)]+'\x0a\x20\x20'+getErrorMessage(_0x84a48),_0x84a48);}return _0x54be02;},_0x25cb43=await batchAsync(_0x3cd0ff,_0x49931a,_0x309f94),_0x54c77a={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x516609 of _0x25cb43){_0x54c77a['created']+=_0x516609[_0x2db860(0x184)],_0x54c77a[_0x2db860(0x1fa)]+=_0x516609[_0x2db860(0x1fa)],_0x516609[_0x2db860(0x189)]&&_0x54c77a[_0x2db860(0x159)][_0x2db860(0x18c)](_0x516609[_0x2db860(0x189)][_0x2db860(0x237)],_0x516609[_0x2db860(0x189)]['id']),_0x54c77a[_0x2db860(0x1ab)]['created']+=_0x516609[_0x2db860(0x1ab)][_0x2db860(0x184)],_0x54c77a['activations'][_0x2db860(0x1fa)]+=_0x516609[_0x2db860(0x1ab)][_0x2db860(0x1fa)],_0x54c77a[_0x2db860(0x1ab)][_0x2db860(0x1b8)]+=_0x516609['activations'][_0x2db860(0x1b8)];}return _0x54c77a;}async function syncActivationsForSegment(_0x5d2a83,_0x44b1ff,_0x521626,_0x364981,_0x4772b3,_0x107a07,_0x3e124e){const _0x5cbe4a=a114_0x2ffb8c,_0x5d8021={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xb5602b of _0x4772b3){try{if(_0xb5602b[_0x5cbe4a(0x1c3)]===_0x5cbe4a(0x21f)&&_0xb5602b[_0x5cbe4a(0x175)])_0x107a07['onProgress']?.({'type':_0x5cbe4a(0x178),'segmentName':_0x364981,'activationName':_0xb5602b[_0x5cbe4a(0x237)]}),await _0x107a07[_0x5cbe4a(0x157)]('Creating\x20activation\x20\x27'+_0xb5602b[_0x5cbe4a(0x237)]+'\x27...',()=>_0x5d2a83['segment']['createActivation'](_0x44b1ff,_0x521626,_0xb5602b[_0x5cbe4a(0x175)])),_0x107a07[_0x5cbe4a(0x1c4)]?.({'type':_0x5cbe4a(0x1cb),'segmentName':_0x364981,'activationName':_0xb5602b['name']}),_0x107a07[_0x5cbe4a(0x1bc)]?.(_0x5cbe4a(0x1d7)+_0xb5602b['name']+'\x27'),_0x5d8021[_0x5cbe4a(0x184)]++;else{if(_0xb5602b[_0x5cbe4a(0x1c3)]===_0x5cbe4a(0x149)&&_0xb5602b[_0x5cbe4a(0x175)]&&_0xb5602b[_0x5cbe4a(0x22a)])_0x107a07[_0x5cbe4a(0x1c4)]?.({'type':_0x5cbe4a(0x158),'segmentName':_0x364981,'activationName':_0xb5602b[_0x5cbe4a(0x237)]}),await _0x107a07[_0x5cbe4a(0x157)]('Updating\x20activation\x20\x27'+_0xb5602b[_0x5cbe4a(0x237)]+_0x5cbe4a(0x156),()=>_0x5d2a83[_0x5cbe4a(0x1a7)]['updateActivation'](_0x44b1ff,_0x521626,_0xb5602b[_0x5cbe4a(0x22a)]['id'],_0xb5602b['validatedRequest'])),_0x107a07[_0x5cbe4a(0x1c4)]?.({'type':_0x5cbe4a(0x216),'segmentName':_0x364981,'activationName':_0xb5602b[_0x5cbe4a(0x237)]}),_0x107a07[_0x5cbe4a(0x1bc)]?.(_0x5cbe4a(0x218)+_0xb5602b[_0x5cbe4a(0x237)]+'\x27'),_0x5d8021[_0x5cbe4a(0x1fa)]++;else _0xb5602b['type']==='delete'&&_0xb5602b[_0x5cbe4a(0x22a)]&&(_0x107a07['onProgress']?.({'type':_0x5cbe4a(0x198),'segmentName':_0x364981,'activationName':_0xb5602b[_0x5cbe4a(0x237)]}),await _0x107a07[_0x5cbe4a(0x157)](_0x5cbe4a(0x155)+_0xb5602b['name']+_0x5cbe4a(0x156),()=>_0x5d2a83['segment'][_0x5cbe4a(0x1ff)](_0x44b1ff,_0x521626,_0xb5602b[_0x5cbe4a(0x22a)]['id'])),_0x107a07[_0x5cbe4a(0x1c4)]?.({'type':_0x5cbe4a(0x205),'segmentName':_0x364981,'activationName':_0xb5602b[_0x5cbe4a(0x237)]}),_0x107a07['logDeleted']?.(_0x5cbe4a(0x1f4)+_0xb5602b['name']+'\x27'),_0x5d8021['deleted']++);}}catch(_0x47ba08){const _0x27be3f=isHttp400Error(_0x47ba08),_0x36e5b0=_0x27be3f?ErrorCode[_0x5cbe4a(0x190)]:ErrorCode[_0x5cbe4a(0x17c)],_0x33a2c5=getErrorMessage(_0x47ba08);throw new SDKError(_0x36e5b0,_0x5cbe4a(0x143)+_0xb5602b[_0x5cbe4a(0x1c3)]+_0x5cbe4a(0x14d)+_0xb5602b[_0x5cbe4a(0x237)]+_0x5cbe4a(0x215)+_0x3e124e+_0x5cbe4a(0x1e4)+_0x33a2c5,_0x47ba08);}}return _0x5d8021;}export async function executePushFolders(_0x349b37,_0x3d66e5,_0x4752b2,_0x12fd31,_0x2154e4){const _0x105970=a114_0x2ffb8c,_0x7b26ae=new Map(_0x4752b2);for(const _0x35ff36 of _0x3d66e5){const _0x4dcdda=_0x35ff36['split']('/'),_0x8f3de5=_0x4dcdda[_0x4dcdda[_0x105970(0x176)]-0x1],_0x16d533=_0x4dcdda['slice'](0x0,-0x1)['join']('/'),_0x2b84df=_0x7b26ae[_0x105970(0x15a)](_0x16d533);_0x2154e4[_0x105970(0x1c4)]?.({'type':_0x105970(0x16a),'folder':_0x35ff36});const _0x1004f1={'name':_0x8f3de5,'parentFolderId':_0x2b84df},_0x5e63b7=await _0x2154e4['withProgress'](_0x105970(0x1ae)+_0x35ff36+_0x105970(0x156),()=>_0x349b37[_0x105970(0x1a7)][_0x105970(0x13b)](_0x12fd31[_0x105970(0x172)],_0x1004f1));_0x7b26ae['set'](_0x35ff36,_0x5e63b7[_0x105970(0x1f3)]['id']),_0x2154e4[_0x105970(0x1c4)]?.({'type':_0x105970(0x1d6),'folder':_0x35ff36,'folderId':_0x5e63b7[_0x105970(0x1f3)]['id']}),_0x2154e4[_0x105970(0x1d3)]?.(_0x105970(0x1e3)+_0x35ff36+'\x27');}return _0x7b26ae;}export async function executePushSegmentDeletions(_0x4a629a,_0x3ef24d,_0x27adce){if(_0x3ef24d['length']===0x0)return 0x0;const {batchAsync:_0x27c244}=await import('../../utils/async.js'),_0x523e9c=0x5,_0x4c9808=await _0x27c244(_0x3ef24d,async _0x3d8448=>{const _0x2cc88a=a114_0x3577;return _0x27adce[_0x2cc88a(0x1c4)]?.({'type':_0x2cc88a(0x1d8),'name':_0x3d8448[_0x2cc88a(0x237)]}),await _0x4a629a[_0x2cc88a(0x1a7)][_0x2cc88a(0x19d)](_0x3d8448['id']),_0x27adce['onProgress']?.({'type':'segment_deleted','name':_0x3d8448[_0x2cc88a(0x237)]}),_0x27adce[_0x2cc88a(0x1e5)]?.(_0x2cc88a(0x1d1)+_0x3d8448['name']+'\x27'),0x1;},_0x523e9c);return _0x4c9808['reduce']((_0x8f912,_0x309bac)=>_0x8f912+_0x309bac,0x0);}export async function executePushJourneys(_0x29848f,_0x488568,_0x54bc10,_0x2300b1,_0x4e4f4b){const _0x3d7ee2=a114_0x2ffb8c,{journeyDefToRequest:_0x16c4f7}=await import(_0x3d7ee2(0x22d)),{activationDefToCreateRequest:_0xb7924f,yamlRuleToApi:_0xec12b4,validateSegmentRule:_0x2fd1dc}=await import(_0x3d7ee2(0x1cc)),_0x3e4924={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x582de0=new Map(_0x54bc10['segmentNameToId']),_0x5532e9=0x5;for(let _0x3e75c8=0x0;_0x3e75c8<_0x488568[_0x3d7ee2(0x176)];_0x3e75c8+=_0x5532e9){const _0x348bc7=_0x488568[_0x3d7ee2(0x21b)](_0x3e75c8,_0x3e75c8+_0x5532e9),_0x3b5eaf=await Promise[_0x3d7ee2(0x214)](_0x348bc7[_0x3d7ee2(0x1f5)](async _0x217fa2=>{const _0x3d5e99=_0x3d7ee2;if(!_0x217fa2[_0x3d5e99(0x197)]&&!_0x217fa2[_0x3d5e99(0x230)])return{'action':'unchanged','name':_0x217fa2['yamlConfig'][_0x3d5e99(0x237)],'journeyId':_0x217fa2[_0x3d5e99(0x16f)]?.['id']};const _0x1feb23=_0x217fa2[_0x3d5e99(0x188)]?_0x54bc10['folderPathToId'][_0x3d5e99(0x15a)](_0x217fa2[_0x3d5e99(0x188)]):undefined;_0x4e4f4b['onProgress']?.({'type':_0x217fa2[_0x3d5e99(0x197)]?_0x3d5e99(0x1b4):_0x3d5e99(0x144),'name':_0x217fa2[_0x3d5e99(0x191)][_0x3d5e99(0x237)]});try{const _0x1bca72=await executeSingleJourneyPush(_0x29848f,_0x217fa2,{..._0x54bc10,'segmentNameToId':_0x582de0},{'parentId':_0x2300b1['parentId'],'rootFolderId':_0x2300b1[_0x3d5e99(0x200)],'folderId':_0x1feb23,'verbose':_0x2300b1[_0x3d5e99(0x153)]},_0x4e4f4b,{'journeyDefToRequest':_0x16c4f7,'activationDefToCreateRequest':_0xb7924f,'yamlRuleToApi':_0xec12b4,'validateSegmentRule':_0x2fd1dc});for(const [_0xdc83e6,_0x8dd272]of _0x1bca72[_0x3d5e99(0x21a)]){_0x582de0[_0x3d5e99(0x18c)](_0xdc83e6,_0x8dd272),_0x3e4924[_0x3d5e99(0x21a)]['set'](_0xdc83e6,_0x8dd272);}if(_0x1bca72[_0x3d5e99(0x1c5)]===_0x3d5e99(0x184))_0x4e4f4b['onProgress']?.({'type':_0x3d5e99(0x161),'name':_0x217fa2[_0x3d5e99(0x191)][_0x3d5e99(0x237)],'journeyId':_0x1bca72[_0x3d5e99(0x222)]}),_0x4e4f4b[_0x3d5e99(0x1bc)]?.(_0x3d5e99(0x18f)+_0x217fa2[_0x3d5e99(0x191)][_0x3d5e99(0x237)]+'\x27'),_0x3e4924[_0x3d5e99(0x184)]++;else _0x1bca72[_0x3d5e99(0x1c5)]===_0x3d5e99(0x1fa)&&(_0x4e4f4b[_0x3d5e99(0x1c4)]?.({'type':_0x3d5e99(0x1a8),'name':_0x217fa2[_0x3d5e99(0x191)][_0x3d5e99(0x237)]}),_0x4e4f4b[_0x3d5e99(0x1bc)]?.(_0x3d5e99(0x20c)+_0x217fa2['yamlConfig'][_0x3d5e99(0x237)]+'\x27'),_0x3e4924[_0x3d5e99(0x1fa)]++);return{'action':_0x1bca72[_0x3d5e99(0x1c5)],'name':_0x217fa2['yamlConfig']['name'],'journeyId':_0x1bca72[_0x3d5e99(0x222)]};}catch(_0x3490d2){const _0x21b0fc=isHttp400Error(_0x3490d2),_0x428f8f=_0x21b0fc?ErrorCode[_0x3d5e99(0x1a0)]:ErrorCode[_0x3d5e99(0x1c8)],_0x44fdbe=getErrorMessage(_0x3490d2);throw new SDKError(_0x428f8f,_0x3d5e99(0x143)+(_0x217fa2[_0x3d5e99(0x197)]?'create':_0x3d5e99(0x149))+'\x20journey\x20from\x20file:\x20'+_0x217fa2[_0x3d5e99(0x142)]+'\x0a\x20\x20'+_0x44fdbe,_0x3490d2);}}));_0x3e4924[_0x3d7ee2(0x146)][_0x3d7ee2(0x139)](..._0x3b5eaf);}return _0x3e4924;}async function matchExistingJourneySegments(_0x390ae4,_0x4a6146,_0x6c06a3,_0xe7875d,_0x20e180){const _0x43a8d1=a114_0x2ffb8c;if(!_0x4a6146[_0x43a8d1(0x16f)]||!_0x4a6146['yamlConfig'][_0x43a8d1(0x170)])return;const _0x47af3e=new Map();for(const _0x11b7b2 of Object[_0x43a8d1(0x192)](_0x4a6146[_0x43a8d1(0x191)][_0x43a8d1(0x170)])){const _0x47ea5d=generateDeterministicJourneySegmentName(_0x4a6146['yamlConfig'][_0x43a8d1(0x237)],_0x11b7b2);_0x47af3e[_0x43a8d1(0x18c)](_0x47ea5d,_0x11b7b2);}const _0x3da753=collectSegmentIdsFromJourneyApi(_0x4a6146[_0x43a8d1(0x16f)]);for(const _0x178413 of _0x3da753){const _0x1ef1c7=await fetchSegment(_0x390ae4,_0x6c06a3,_0x178413,_0xe7875d);if(!_0x1ef1c7?.[_0x43a8d1(0x237)])continue;const _0x3349e5=_0x47af3e[_0x43a8d1(0x15a)](_0x1ef1c7[_0x43a8d1(0x237)]);_0x3349e5&&_0x20e180[_0x43a8d1(0x18c)](_0x3349e5,_0x178413);}}async function executeSingleJourneyPush(_0x313ca9,_0x38e64b,_0x8bca96,_0x1b3d71,_0x559926,_0x473ff2){const _0x3b6d7d=a114_0x2ffb8c,{journeyDefToRequest:_0x5db2f8,activationDefToCreateRequest:_0x466ecd,yamlRuleToApi:_0x55418a,validateSegmentRule:_0x15bfdc}=_0x473ff2,_0x4696bc=new Map(),_0xb1b21f=new Map();recoverSegmentIdsFromPushRecovery(_0x38e64b,_0x4696bc,_0x8bca96[_0x3b6d7d(0x14c)]);const _0x1a6dd5=new Map(),_0x4a35e3=new Map(),_0x2937d9=new Map();let _0x587cd3;const _0x2c498a=async()=>{const _0x468f6e=_0x3b6d7d;if(_0x587cd3)return;_0x587cd3=new Map();if(!_0x38e64b['existingJourney'])return;const _0x43e88d=await _0x313ca9[_0x468f6e(0x21c)][_0x468f6e(0x165)](_0x38e64b[_0x468f6e(0x16f)]['id']);for(const _0x152e53 of _0x43e88d){const _0x30398b=journeyActivationStepToYaml(_0x152e53,_0x8bca96[_0x468f6e(0x1bd)],_0x8bca96[_0x468f6e(0x231)]),_0xf43d80=activationSignature(_0x30398b);!_0x587cd3[_0x468f6e(0x167)](_0xf43d80)&&_0x587cd3[_0x468f6e(0x18c)](_0xf43d80,_0x152e53['id']),_0x30398b[_0x468f6e(0x237)]&&_0xb1b21f[_0x468f6e(0x18c)](_0x30398b[_0x468f6e(0x237)],_0x152e53['id']);}};await matchExistingJourneySegments(_0x313ca9,_0x38e64b,_0x1b3d71['parentId'],_0x8bca96[_0x3b6d7d(0x18a)],_0x8bca96[_0x3b6d7d(0x14c)]);const _0x1a2169={'resolveSegmentId':async _0x8d0612=>{const _0x4774d7=_0x3b6d7d,_0x5c9e43=_0x8bca96[_0x4774d7(0x14c)]['get'](_0x8d0612);if(!_0x5c9e43)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4774d7(0x13c)+_0x8d0612+'\x20(referenced\x20in\x20journey\x20'+_0x38e64b['yamlConfig']['name']+')');return _0x5c9e43;},'resolveEmbeddedSegmentId':async(_0x18626d,_0x5d1006)=>{const _0x35a2fb=_0x3b6d7d,_0x3f9ee8=_0x8bca96[_0x35a2fb(0x14c)]['get'](_0x18626d);if(_0x3f9ee8)return _0x3f9ee8;const _0x5ba444=_0x8bca96[_0x35a2fb(0x18a)][_0x35a2fb(0x140)](_0x1b942d=>_0x1b942d[_0x35a2fb(0x237)]===_0x18626d);if(_0x5ba444)return _0x8bca96[_0x35a2fb(0x14c)]['set'](_0x18626d,_0x5ba444['id']),_0x5ba444['id'];if(_0x38e64b[_0x35a2fb(0x197)]){const {stageName:_0x1b04c8,criteriaName:_0x3c08a2}=findSegmentCriteriaLocation(_0x38e64b[_0x35a2fb(0x191)],_0x18626d);return _0x15bfdc(_0x18626d,_0x5d1006[_0x35a2fb(0x206)]),_0x4a35e3[_0x35a2fb(0x18c)](_0x18626d,{'definition':_0x5d1006,'stageName':_0x1b04c8,'criteriaName':_0x3c08a2}),createPendingSegmentId(_0x18626d);}const _0xc0ffc8=_0x38e64b[_0x35a2fb(0x16f)]?.['id'];if(!_0xc0ffc8)throw new SDKError(ErrorCode['INTERNAL'],_0x35a2fb(0x1aa));const _0x3e7e4a=_0x1a6dd5[_0x35a2fb(0x15a)](_0x18626d);if(_0x3e7e4a)return _0x3e7e4a;const _0x338f5f=((async()=>{const _0xa9efba=_0x35a2fb;_0x15bfdc(_0x18626d,_0x5d1006[_0xa9efba(0x206)]);const _0x2fbe3d=generateDeterministicJourneySegmentName(_0x38e64b[_0xa9efba(0x191)][_0xa9efba(0x237)],_0x18626d),_0x10075b=_0x8bca96['existingSegments'][_0xa9efba(0x140)](_0x572b79=>_0x572b79['name']===_0x2fbe3d),_0x21a268=createSegmentIdResolver(_0x8bca96[_0xa9efba(0x14c)],_0x18626d),_0x4dd505=await resolveRuleSegmentIds(_0x5d1006[_0xa9efba(0x206)],_0x21a268);let _0x5df4cb;return _0x10075b?(await _0x313ca9['segment'][_0xa9efba(0x1a6)](_0x1b3d71['parentId'],_0x10075b['id'],{'description':_0x5d1006['description']||_0xa9efba(0x1fb)+_0x18626d,'rule':_0x55418a(_0x4dd505,!![]),'countPopulation':!![]}),_0x5df4cb=_0x10075b['id'],saveSegmentToPushRecovery(_0x38e64b['absolutePath'],_0x38e64b[_0xa9efba(0x191)][_0xa9efba(0x237)],_0x18626d,{'segmentId':_0x5df4cb,'uniqueServerName':_0x2fbe3d,'createdAt':new Date()['toISOString']()})):_0x5df4cb=await createOrRecoverEmbeddedSegment(_0x313ca9,_0x38e64b,{'localName':_0x18626d,'uniqueSegmentName':_0x2fbe3d,'description':_0x5d1006[_0xa9efba(0x1b7)]||_0xa9efba(0x1fb)+_0x18626d,'journeyId':_0xc0ffc8,'resolvedRule':_0x4dd505,'parentId':_0x1b3d71[_0xa9efba(0x172)],'folderId':_0x1b3d71[_0xa9efba(0x200)]||''},_0x55418a),_0x8bca96[_0xa9efba(0x14c)][_0xa9efba(0x18c)](_0x18626d,_0x5df4cb),_0x4696bc[_0xa9efba(0x18c)](_0x18626d,_0x5df4cb),_0x5df4cb;})());_0x1a6dd5[_0x35a2fb(0x18c)](_0x18626d,_0x338f5f);try{return await _0x338f5f;}finally{_0x1a6dd5['delete'](_0x18626d);}},'resolveActivationId':async _0x5db86f=>{const _0x1eee4f=_0x3b6d7d,_0x118a43=_0xb1b21f[_0x1eee4f(0x15a)](_0x5db86f);if(_0x118a43)return _0x118a43;if(_0x38e64b['existingJourney']){await _0x2c498a();const _0x3352ee=_0xb1b21f[_0x1eee4f(0x15a)](_0x5db86f);if(_0x3352ee)return _0x3352ee;}throw new SDKError(ErrorCode[_0x1eee4f(0x196)],'Activation\x20not\x20found:\x20'+_0x5db86f+_0x1eee4f(0x1da)+_0x38e64b[_0x1eee4f(0x191)][_0x1eee4f(0x237)]+').\x20'+_0x1eee4f(0x17e));},'resolveEmbeddedActivationId':async(_0x280f88,_0x2b5f37)=>{const _0x1870c4=_0x3b6d7d,_0x3c5916=_0xb1b21f[_0x1870c4(0x15a)](_0x280f88);if(_0x3c5916)return _0x3c5916;if(_0x38e64b['isNew'])return _0x2937d9['set'](_0x280f88,_0x2b5f37),createPendingActivationId(_0x280f88);if(_0x38e64b[_0x1870c4(0x16f)]){await _0x2c498a();const _0x546421=_0xb1b21f['get'](_0x2b5f37[_0x1870c4(0x237)]);if(_0x546421)return _0xb1b21f[_0x1870c4(0x18c)](_0x280f88,_0x546421),_0x546421;const _0x1b5206=activationSignature(_0x2b5f37),_0x568911=_0x587cd3?.[_0x1870c4(0x15a)](_0x1b5206);if(_0x568911)return _0xb1b21f[_0x1870c4(0x18c)](_0x280f88,_0x568911),_0x568911;const _0x124907=await _0x466ecd(_0x2b5f37,_0x8bca96[_0x1870c4(0x181)]),_0x5ce6a3={..._0x124907,..._0x2b5f37[_0x1870c4(0x1c1)]!==undefined&&{'runAfterJourneyRefresh':_0x2b5f37[_0x1870c4(0x1c1)]}},_0x13a21e=await _0x313ca9[_0x1870c4(0x21c)][_0x1870c4(0x236)](_0x38e64b[_0x1870c4(0x16f)]['id'],_0x5ce6a3);return _0xb1b21f[_0x1870c4(0x18c)](_0x280f88,_0x13a21e['id']),_0x13a21e['id'];}throw new SDKError(ErrorCode[_0x1870c4(0x1f1)],_0x1870c4(0x1cd));},'resolveJourneyId':async _0x7593d4=>{const _0xca978c=_0x3b6d7d;try{return await _0x313ca9[_0xca978c(0x21c)][_0xca978c(0x20a)](_0x1b3d71[_0xca978c(0x172)],_0x7593d4);}catch(_0x4d34ba){throw new SDKError(ErrorCode[_0xca978c(0x196)],_0xca978c(0x1bb)+_0x7593d4+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x38e64b['yamlConfig'][_0xca978c(0x237)]+'\x27)',_0x4d34ba);}},'resolveStageId':async(_0x107146,_0x3d732b)=>{const _0x544254=_0x3b6d7d,_0x3edba4=await _0x313ca9[_0x544254(0x21c)][_0x544254(0x18d)](_0x107146),_0x448fc5=_0x3edba4[_0x544254(0x150)][_0x544254(0x15c)][_0x544254(0x140)](_0x10d7dc=>_0x10d7dc[_0x544254(0x237)][_0x544254(0x186)]()===_0x3d732b[_0x544254(0x186)]());if(!_0x448fc5?.['id'])throw new SDKError(ErrorCode[_0x544254(0x196)],_0x544254(0x1b6)+_0x3d732b+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x3edba4[_0x544254(0x150)][_0x544254(0x199)]||_0x3edba4[_0x544254(0x150)][_0x544254(0x237)])+'\x27');return _0x448fc5['id'];}},_0x5295d9=await _0x5db2f8(_0x38e64b[_0x3b6d7d(0x191)],_0x1b3d71[_0x3b6d7d(0x172)],_0x1a2169),_0x2555fe=_0x1b3d71['folderId']||_0x1b3d71['rootFolderId'];_0x2555fe&&(_0x5295d9[_0x3b6d7d(0x208)]={'parentFolder':{'data':{'id':_0x2555fe,'type':_0x3b6d7d(0x1fd)}}});if(_0x38e64b[_0x3b6d7d(0x197)]){if(_0x4a35e3[_0x3b6d7d(0x1a3)]>0x0||_0x2937d9['size']>0x0)return await executeThreeStepJourneyCreate(_0x313ca9,_0x38e64b,_0x5295d9,{'pendingEmbeddedSegments':_0x4a35e3,'pendingEmbeddedActivations':_0x2937d9,'embeddedSegmentNameToId':_0x4696bc,'journeyActivationNameToId':_0xb1b21f},{..._0x1b3d71,'effectiveFolderId':_0x2555fe},_0x8bca96,_0x559926,_0x473ff2);else{ensureJourneyDefaults(_0x5295d9['attributes']);const _0x4e266c=await _0x313ca9['journey'][_0x3b6d7d(0x21f)](_0x5295d9);return deletePushRecovery(_0x38e64b[_0x3b6d7d(0x142)]),{'action':'created','journeyId':_0x4e266c['id'],'embeddedSegmentNameToId':_0x4696bc};}}else{if(_0x38e64b['hasChanges']&&_0x38e64b['existingJourney'])return ensureJourneyDefaults(_0x5295d9[_0x3b6d7d(0x150)]),await _0x313ca9[_0x3b6d7d(0x21c)][_0x3b6d7d(0x149)](_0x38e64b[_0x3b6d7d(0x16f)]['id'],_0x5295d9),deletePushRecovery(_0x38e64b[_0x3b6d7d(0x142)]),{'action':_0x3b6d7d(0x1fa),'journeyId':_0x38e64b[_0x3b6d7d(0x16f)]['id'],'embeddedSegmentNameToId':_0x4696bc};}return deletePushRecovery(_0x38e64b['absolutePath']),{'action':'unchanged','journeyId':_0x38e64b['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x4696bc};}function findSegmentCriteriaLocation(_0x3ca499,_0x4d64a0){const _0x2a8fe1=a114_0x2ffb8c,_0x228d2c=_0x3ca499[_0x2a8fe1(0x193)]||_0x3ca499[_0x2a8fe1(0x1d5)]?.[0x0]?.[_0x2a8fe1(0x193)]||[];let _0x21ceb3=_0x2a8fe1(0x14e),_0x913995=_0x4d64a0;const _0x2b8e74=_0x3ca499[_0x2a8fe1(0x17a)]||_0x3ca499['journeys']?.[0x0]?.[_0x2a8fe1(0x17a)];if(_0x2b8e74?.[_0x2a8fe1(0x1a7)]===_0x4d64a0)return{'stageName':_0x2a8fe1(0x17a),'criteriaName':_0x2b8e74['name']||_0x4d64a0};_0x33bf75:for(const _0x290fda of _0x228d2c){if(_0x290fda['entry_criteria']?.[_0x2a8fe1(0x1a7)]===_0x4d64a0){_0x21ceb3=_0x290fda[_0x2a8fe1(0x237)],_0x913995=_0x290fda['entry_criteria'][_0x2a8fe1(0x237)]||_0x4d64a0;break;}if(_0x290fda[_0x2a8fe1(0x17d)])for(const _0x45a69e of _0x290fda[_0x2a8fe1(0x17d)]){if(_0x45a69e[_0x2a8fe1(0x1c3)]===_0x2a8fe1(0x1de)&&_0x45a69e[_0x2a8fe1(0x1ec)]?.[_0x2a8fe1(0x211)])for(const _0xee3338 of _0x45a69e[_0x2a8fe1(0x1ec)]['branches']){if(_0xee3338[_0x2a8fe1(0x1a7)]===_0x4d64a0){_0x21ceb3=_0x290fda[_0x2a8fe1(0x237)],_0x913995=_0xee3338[_0x2a8fe1(0x237)]||_0x4d64a0;break _0x33bf75;}}}}return{'stageName':_0x21ceb3,'criteriaName':_0x913995};}async function executeThreeStepJourneyCreate(_0x5d4878,_0x179e10,_0x26ca32,_0x39587f,_0x5f3d78,_0x802ed2,_0x2aa56d,_0x442265){const _0x603236=a114_0x2ffb8c,{activationDefToCreateRequest:_0x29237e,yamlRuleToApi:_0x27b7e8}=_0x442265,{pendingEmbeddedSegments:_0x497f54,pendingEmbeddedActivations:_0x27a9f0,embeddedSegmentNameToId:_0x2b26f1}=_0x39587f,_0x3e7d39=JSON[_0x603236(0x17b)](JSON[_0x603236(0x1f8)](_0x26ca32));ensureJourneyDefaults(_0x3e7d39[_0x603236(0x150)]),stripPendingIds(_0x3e7d39);const _0x150bfa=await _0x5d4878['journey']['create'](_0x3e7d39),_0x56e3ea=_0x150bfa['id'],_0x407ff3=new Map();for(const _0x396469 of _0x150bfa['attributes'][_0x603236(0x15c)]){_0x407ff3[_0x603236(0x18c)](_0x396469[_0x603236(0x237)]['toLowerCase'](),_0x396469['id']);}recoverSegmentIdsFromPushRecovery(_0x179e10,_0x2b26f1,_0x802ed2['segmentNameToId']);for(const [_0x464e95,{definition:_0x14812e}]of _0x497f54){if(_0x2b26f1['has'](_0x464e95)){_0x2aa56d[_0x603236(0x1c4)]?.({'type':_0x603236(0x14a),'journeyName':_0x179e10[_0x603236(0x191)][_0x603236(0x237)],'segmentName':_0x464e95});continue;}const _0x86c446=generateDeterministicJourneySegmentName(_0x179e10[_0x603236(0x191)][_0x603236(0x237)],_0x464e95);_0x2aa56d[_0x603236(0x1c4)]?.({'type':_0x603236(0x20f),'journeyName':_0x179e10[_0x603236(0x191)][_0x603236(0x237)],'segmentName':_0x464e95});const _0x4da33a=createSegmentIdResolver(_0x802ed2['segmentNameToId'],_0x464e95),_0x393ee7=await resolveRuleSegmentIds(_0x14812e[_0x603236(0x206)],_0x4da33a),_0x595857=await createOrRecoverEmbeddedSegment(_0x5d4878,_0x179e10,{'localName':_0x464e95,'uniqueSegmentName':_0x86c446,'description':_0x14812e[_0x603236(0x1b7)]||'Entry\x20criteria:\x20'+_0x464e95,'journeyId':_0x56e3ea,'resolvedRule':_0x393ee7,'parentId':_0x5f3d78[_0x603236(0x172)],'folderId':_0x5f3d78['effectiveFolderId']||''},_0x27b7e8);_0x2b26f1['set'](_0x464e95,_0x595857),_0x802ed2[_0x603236(0x14c)]['set'](_0x464e95,_0x595857),_0x2aa56d[_0x603236(0x1c4)]?.({'type':'embedded_segment_created','journeyName':_0x179e10['yamlConfig'][_0x603236(0x237)],'segmentName':_0x464e95});}const _0x5170de=new Map();for(const [_0x2b79e0,_0x355d4d]of _0x27a9f0){_0x2aa56d['onProgress']?.({'type':_0x603236(0x147),'journeyName':_0x179e10[_0x603236(0x191)][_0x603236(0x237)],'activationName':_0x2b79e0});const _0x936cbd=await _0x29237e(_0x355d4d,_0x802ed2[_0x603236(0x181)]),_0x3c250f={..._0x936cbd,..._0x355d4d[_0x603236(0x1c1)]!==undefined&&{'runAfterJourneyRefresh':_0x355d4d['run_after_journey_refresh']}},_0x1936a5=await _0x5d4878[_0x603236(0x21c)][_0x603236(0x236)](_0x56e3ea,_0x3c250f);_0x5170de[_0x603236(0x18c)](_0x2b79e0,_0x1936a5['id']),_0x39587f['journeyActivationNameToId'][_0x603236(0x18c)](_0x2b79e0,_0x1936a5['id']),_0x2aa56d['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x179e10['yamlConfig'][_0x603236(0x237)],'activationName':_0x2b79e0});}const _0x20baf5=JSON[_0x603236(0x17b)](JSON[_0x603236(0x1f8)](_0x26ca32));return _0x20baf5['id']=_0x56e3ea,ensureJourneyDefaults(_0x20baf5[_0x603236(0x150)]),resolvePendingIdsInRequest(_0x20baf5,_0x26ca32,_0x407ff3,_0x2b26f1,_0x5170de,_0x2aa56d),await _0x5d4878[_0x603236(0x21c)][_0x603236(0x149)](_0x56e3ea,_0x20baf5),deletePushRecovery(_0x179e10[_0x603236(0x142)]),{'action':_0x603236(0x184),'journeyId':_0x56e3ea,'embeddedSegmentNameToId':_0x2b26f1};}export function stripWaitStepPendingIds(_0x522bbf){const _0x373c76=a114_0x2ffb8c,_0x55dd3d=_0x522bbf[_0x373c76(0x152)]&&isPendingSegmentId(_0x522bbf[_0x373c76(0x152)]),_0x2c3301=_0x522bbf[_0x373c76(0x16c)]?.['some'](_0x511782=>_0x511782[_0x373c76(0x1e8)]&&isPendingSegmentId(_0x511782[_0x373c76(0x1e8)]));(_0x55dd3d||_0x2c3301)&&(_0x522bbf['waitStepType']='Duration',_0x522bbf['waitStep']=0x1,_0x522bbf['waitStepUnit']=_0x373c76(0x15f),delete _0x522bbf['conditionSegmentId'],delete _0x522bbf[_0x373c76(0x1ed)],delete _0x522bbf['conditionTimeoutUnit'],delete _0x522bbf[_0x373c76(0x16c)]);}export function resolveWaitStepPendingIds(_0x5200b9,_0x3fd251,_0x3ad2ca,_0x8d68d3){const _0x5a5051=a114_0x2ffb8c;if(_0x3fd251[_0x5a5051(0x152)]&&isPendingSegmentId(_0x3fd251[_0x5a5051(0x152)])){const _0x5a3ddd=_0x3ad2ca(_0x3fd251[_0x5a5051(0x152)],'stage\x20\x27'+_0x8d68d3+'\x27\x20wait\x20condition');_0x5a3ddd&&(_0x5200b9[_0x5a5051(0x1b9)]=_0x5a5051(0x1b0),_0x5200b9[_0x5a5051(0x152)]=_0x5a3ddd,delete _0x5200b9['waitStep'],delete _0x5200b9[_0x5a5051(0x173)],_0x3fd251['conditionTimeoutDuration']!==undefined&&(_0x5200b9[_0x5a5051(0x1ed)]=_0x3fd251['conditionTimeoutDuration']),_0x3fd251[_0x5a5051(0x1cf)]&&(_0x5200b9[_0x5a5051(0x1cf)]=_0x3fd251[_0x5a5051(0x1cf)]));}if(_0x3fd251[_0x5a5051(0x16c)]){const _0x2c99bc=_0x3fd251['conditions'][_0x5a5051(0x1d4)](_0x38c4c7=>_0x38c4c7['segmentId']&&isPendingSegmentId(_0x38c4c7['segmentId']));if(_0x2c99bc){const _0x5b47b6=_0x3fd251[_0x5a5051(0x16c)][_0x5a5051(0x1f5)](_0x189d4a=>{const _0x146298=_0x5a5051;if(_0x189d4a['segmentId']&&isPendingSegmentId(_0x189d4a[_0x146298(0x1e8)])){const _0x57936a=_0x3ad2ca(_0x189d4a['segmentId'],_0x146298(0x1a5)+_0x8d68d3+_0x146298(0x14b));return{..._0x189d4a,'segmentId':_0x57936a||_0x189d4a['segmentId']};}return{..._0x189d4a};});_0x5200b9[_0x5a5051(0x1b9)]='Condition',_0x5200b9[_0x5a5051(0x16c)]=_0x5b47b6,delete _0x5200b9[_0x5a5051(0x1f0)],delete _0x5200b9[_0x5a5051(0x173)],delete _0x5200b9[_0x5a5051(0x152)],delete _0x5200b9[_0x5a5051(0x1ed)],delete _0x5200b9['conditionTimeoutUnit'];}}}function stripPendingIds(_0x251ece){const _0x2872c5=a114_0x2ffb8c;_0x251ece[_0x2872c5(0x150)][_0x2872c5(0x17a)]?.[_0x2872c5(0x1e8)]&&isPendingSegmentId(_0x251ece[_0x2872c5(0x150)][_0x2872c5(0x17a)]['segmentId'])&&delete _0x251ece[_0x2872c5(0x150)]['goal'];for(const _0x579786 of _0x251ece[_0x2872c5(0x150)][_0x2872c5(0x15c)]||[]){_0x579786['entryCriteria']?.[_0x2872c5(0x1e8)]&&isPendingSegmentId(_0x579786[_0x2872c5(0x1e6)]['segmentId'])&&delete _0x579786[_0x2872c5(0x1e6)];_0x579786[_0x2872c5(0x1ca)]?.['segmentId']&&isPendingSegmentId(_0x579786[_0x2872c5(0x1ca)][_0x2872c5(0x1e8)])&&delete _0x579786[_0x2872c5(0x1ca)];_0x579786[_0x2872c5(0x154)]&&(_0x579786[_0x2872c5(0x154)]=_0x579786['exitCriterias'][_0x2872c5(0x1ea)](_0x5d7c84=>!_0x5d7c84['segmentId']||!isPendingSegmentId(_0x5d7c84[_0x2872c5(0x1e8)])));if(_0x579786[_0x2872c5(0x17d)])for(const _0x46bf5c of Object[_0x2872c5(0x192)](_0x579786[_0x2872c5(0x17d)])){const _0x5cbff4=_0x579786[_0x2872c5(0x17d)][_0x46bf5c];_0x5cbff4[_0x2872c5(0x1c3)]===_0x2872c5(0x151)&&_0x5cbff4[_0x2872c5(0x1eb)]&&isPendingActivationId(_0x5cbff4[_0x2872c5(0x1eb)])&&(_0x5cbff4[_0x2872c5(0x1eb)]='');if(_0x5cbff4[_0x2872c5(0x1c3)]===_0x2872c5(0x224)&&_0x5cbff4['branches'])for(const _0x47565a of _0x5cbff4[_0x2872c5(0x211)]){_0x47565a['segmentId']&&isPendingSegmentId(_0x47565a[_0x2872c5(0x1e8)])&&(_0x47565a['segmentId']='');}_0x5cbff4[_0x2872c5(0x1c3)]==='WaitStep'&&stripWaitStepPendingIds(_0x5cbff4);}}}function resolvePendingIdsInRequest(_0x2f3616,_0x209c43,_0x561883,_0x2e9078,_0x104023,_0x55b6af){const _0x5a90d3=a114_0x2ffb8c,_0x2d19fb=(_0x5a41b8,_0x1e1b9f)=>{const _0x209830=a114_0x3577;if(!isPendingSegmentId(_0x5a41b8))return _0x5a41b8;const _0x5f1531=extractPendingSegmentName(_0x5a41b8),_0x470709=_0x2e9078['get'](_0x5f1531);return!_0x470709&&_0x55b6af[_0x209830(0x21d)]?.(_0x209830(0x1e0)+_0x5f1531+'\x27\x20for\x20'+_0x1e1b9f),_0x470709;};if(_0x2f3616[_0x5a90d3(0x150)][_0x5a90d3(0x17a)]?.[_0x5a90d3(0x1e8)]&&isPendingSegmentId(_0x2f3616[_0x5a90d3(0x150)]['goal'][_0x5a90d3(0x1e8)])){const _0x4a9fee=_0x2d19fb(_0x2f3616[_0x5a90d3(0x150)][_0x5a90d3(0x17a)]['segmentId'],_0x5a90d3(0x1dc));_0x4a9fee&&(_0x2f3616[_0x5a90d3(0x150)]['goal'][_0x5a90d3(0x1e8)]=_0x4a9fee);}for(const _0x1eec0d of _0x2f3616['attributes'][_0x5a90d3(0x15c)]||[]){const _0x198fec=_0x561883[_0x5a90d3(0x15a)](_0x1eec0d[_0x5a90d3(0x237)][_0x5a90d3(0x186)]());_0x198fec&&(_0x1eec0d['id']=_0x198fec);if(_0x1eec0d[_0x5a90d3(0x1e6)]?.[_0x5a90d3(0x1e8)]&&isPendingSegmentId(_0x1eec0d[_0x5a90d3(0x1e6)]['segmentId'])){const _0x1c929e=_0x2d19fb(_0x1eec0d['entryCriteria'][_0x5a90d3(0x1e8)],_0x5a90d3(0x1a5)+_0x1eec0d[_0x5a90d3(0x237)]+_0x5a90d3(0x235));_0x1c929e&&(_0x1eec0d['entryCriteria'][_0x5a90d3(0x1e8)]=_0x1c929e);}if(_0x1eec0d[_0x5a90d3(0x154)])for(const _0x4e8f23 of _0x1eec0d[_0x5a90d3(0x154)]){if(_0x4e8f23['segmentId']&&isPendingSegmentId(_0x4e8f23['segmentId'])){const _0xa45ef5=_0x2d19fb(_0x4e8f23[_0x5a90d3(0x1e8)],'stage\x20\x27'+_0x1eec0d['name']+_0x5a90d3(0x187));_0xa45ef5&&(_0x4e8f23[_0x5a90d3(0x1e8)]=_0xa45ef5);}}if(_0x1eec0d['milestone']?.[_0x5a90d3(0x1e8)]&&isPendingSegmentId(_0x1eec0d[_0x5a90d3(0x1ca)][_0x5a90d3(0x1e8)])){const _0x4d6bd5=_0x2d19fb(_0x1eec0d[_0x5a90d3(0x1ca)][_0x5a90d3(0x1e8)],_0x5a90d3(0x1a5)+_0x1eec0d[_0x5a90d3(0x237)]+_0x5a90d3(0x1ac));_0x4d6bd5&&(_0x1eec0d[_0x5a90d3(0x1ca)]['segmentId']=_0x4d6bd5);}if(_0x1eec0d[_0x5a90d3(0x17d)]){const _0xec1fc1=_0x4692eb=>_0x209c43[_0x5a90d3(0x150)][_0x5a90d3(0x15c)]?.[_0x5a90d3(0x140)](_0x52726f=>_0x52726f[_0x5a90d3(0x237)]['toLowerCase']()===_0x1eec0d[_0x5a90d3(0x237)][_0x5a90d3(0x186)]())?.[_0x5a90d3(0x17d)]?.[_0x4692eb];for(const _0x1faa7b of Object[_0x5a90d3(0x192)](_0x1eec0d[_0x5a90d3(0x17d)])){const _0x116864=_0x1eec0d[_0x5a90d3(0x17d)][_0x1faa7b],_0x283a69=_0xec1fc1(_0x1faa7b);if(_0x116864[_0x5a90d3(0x1c3)]===_0x5a90d3(0x151)&&_0x116864['journeyActivationStepId']&&(isPendingActivationId(_0x116864[_0x5a90d3(0x1eb)])||_0x116864[_0x5a90d3(0x1eb)]==='')){if(_0x283a69?.[_0x5a90d3(0x1eb)]&&isPendingActivationId(_0x283a69['journeyActivationStepId'])){const _0x2d7d53=extractPendingActivationName(_0x283a69[_0x5a90d3(0x1eb)]),_0x27fa6a=_0x104023[_0x5a90d3(0x15a)](_0x2d7d53);_0x27fa6a&&(_0x116864[_0x5a90d3(0x1eb)]=_0x27fa6a);}}if(_0x116864['type']===_0x5a90d3(0x224)&&_0x116864[_0x5a90d3(0x211)]&&_0x283a69?.[_0x5a90d3(0x211)])for(let _0xc4d2d5=0x0;_0xc4d2d5<_0x116864[_0x5a90d3(0x211)][_0x5a90d3(0x176)];_0xc4d2d5++){const _0x59c930=_0x116864[_0x5a90d3(0x211)][_0xc4d2d5],_0x3d3e95=_0x283a69['branches'][_0xc4d2d5];if(_0x3d3e95?.[_0x5a90d3(0x1e8)]&&isPendingSegmentId(_0x3d3e95[_0x5a90d3(0x1e8)])){const _0x2169d4=_0x2d19fb(_0x3d3e95['segmentId'],_0x5a90d3(0x1a5)+_0x1eec0d[_0x5a90d3(0x237)]+_0x5a90d3(0x17f)+(_0x59c930[_0x5a90d3(0x237)]||_0xc4d2d5)+'\x27');_0x2169d4&&(_0x59c930[_0x5a90d3(0x1e8)]=_0x2169d4);}}_0x116864[_0x5a90d3(0x1c3)]===_0x5a90d3(0x180)&&_0x283a69?.['type']===_0x5a90d3(0x180)&&resolveWaitStepPendingIds(_0x116864,_0x283a69,_0x2d19fb,_0x1eec0d[_0x5a90d3(0x237)]);}}}}
@@ -1 +1 @@
1
- function a115_0x44e3(){const _0x181edb=['parentFolderId','1067494fyyfSC','1636376impwQg','get','30OfkbiJ','2260531ApVVFz','add','name','2588355PajErR','177054cLdrZI','138296nIjmRb','set','has','145278AYidAh','3tfrIxb'];a115_0x44e3=function(){return _0x181edb;};return a115_0x44e3();}(function(_0x52125a,_0x448e64){const _0xb0a4b7=a115_0xb8f8,_0x1694bb=_0x52125a();while(!![]){try{const _0x337fea=parseInt(_0xb0a4b7(0x143))/0x1+-parseInt(_0xb0a4b7(0x13b))/0x2*(parseInt(_0xb0a4b7(0x139))/0x3)+parseInt(_0xb0a4b7(0x144))/0x4+-parseInt(_0xb0a4b7(0x13e))/0x5*(parseInt(_0xb0a4b7(0x138))/0x6)+parseInt(_0xb0a4b7(0x13f))/0x7+parseInt(_0xb0a4b7(0x13c))/0x8+parseInt(_0xb0a4b7(0x142))/0x9;if(_0x337fea===_0x448e64)break;else _0x1694bb['push'](_0x1694bb['shift']());}catch(_0xf2a5a2){_0x1694bb['push'](_0x1694bb['shift']());}}}(a115_0x44e3,0x54e1e));export function buildFolderIdToPathMap(_0x521271){const _0x5dd42b=a115_0xb8f8,_0x64b6cf=new Map(),_0x3a6310=new Map();for(const _0x55f218 of _0x521271){_0x3a6310[_0x5dd42b(0x145)](_0x55f218['id'],_0x55f218);}const _0x279f00=new Set();for(const _0x357d4e of _0x521271){!_0x357d4e[_0x5dd42b(0x13a)]&&_0x279f00[_0x5dd42b(0x140)](_0x357d4e['id']);}function _0x17e0e8(_0x2eb6de){const _0x44587f=_0x5dd42b;if(_0x64b6cf[_0x44587f(0x146)](_0x2eb6de['id']))return _0x64b6cf[_0x44587f(0x13d)](_0x2eb6de['id']);if(_0x279f00[_0x44587f(0x146)](_0x2eb6de['id']))return _0x64b6cf[_0x44587f(0x145)](_0x2eb6de['id'],''),'';if(_0x2eb6de[_0x44587f(0x13a)]){const _0x573446=_0x3a6310[_0x44587f(0x13d)](_0x2eb6de['parentFolderId']);if(_0x573446){const _0x658bc3=_0x17e0e8(_0x573446),_0x2a7453=_0x658bc3?_0x658bc3+'/'+_0x2eb6de['name']:_0x2eb6de[_0x44587f(0x141)];return _0x64b6cf[_0x44587f(0x145)](_0x2eb6de['id'],_0x2a7453),_0x2a7453;}}const _0x1f0622=_0x2eb6de['name'];return _0x64b6cf['set'](_0x2eb6de['id'],_0x1f0622),_0x1f0622;}for(const _0x1b60a0 of _0x521271){_0x17e0e8(_0x1b60a0);}return _0x64b6cf;}export function buildFolderPathToIdMap(_0x4ff6b1){const _0x1269e0=a115_0xb8f8,_0x54935f=new Map(),_0x73b089=new Map();for(const _0x4643bb of _0x4ff6b1){_0x73b089[_0x1269e0(0x145)](_0x4643bb['id'],_0x4643bb);}const _0xcc96c8=new Set();for(const _0x4bef26 of _0x4ff6b1){!_0x4bef26['parentFolderId']&&_0xcc96c8[_0x1269e0(0x140)](_0x4bef26['id']);}function _0x573f77(_0x4fbeb4){const _0x40fd7c=_0x1269e0;if(_0xcc96c8[_0x40fd7c(0x146)](_0x4fbeb4['id']))return'';if(_0x4fbeb4['parentFolderId']){const _0x5f5360=_0x73b089['get'](_0x4fbeb4[_0x40fd7c(0x13a)]);if(_0x5f5360){const _0x40b591=_0x573f77(_0x5f5360);return _0x40b591?_0x40b591+'/'+_0x4fbeb4['name']:_0x4fbeb4[_0x40fd7c(0x141)];}}return _0x4fbeb4[_0x40fd7c(0x141)];}for(const _0xf46698 of _0x4ff6b1){const _0x2ffefa=_0x573f77(_0xf46698);_0x54935f[_0x1269e0(0x145)](_0x2ffefa,_0xf46698['id']);}return _0x54935f;}export function buildFolderMaps(_0x578bf9){const _0x4de7a9=a115_0xb8f8,_0x2524d9=buildFolderIdToPathMap(_0x578bf9),_0x313f85=new Map();for(const [_0x3449b4,_0x5331fc]of _0x2524d9){_0x313f85[_0x4de7a9(0x145)](_0x5331fc,_0x3449b4);}return{'idToPath':_0x2524d9,'pathToId':_0x313f85};}function a115_0xb8f8(_0xd10b4b,_0x1f46f9){_0xd10b4b=_0xd10b4b-0x138;const _0x44e3fc=a115_0x44e3();let _0xb8f813=_0x44e3fc[_0xd10b4b];return _0xb8f813;}export function getFolderPath(_0x5e42b3,_0x47a141){if(!_0x5e42b3)return'';return _0x47a141['get'](_0x5e42b3)??'';}
1
+ (function(_0x5eec75,_0x5526df){const _0x2ef798=a115_0x5961,_0x1efc85=_0x5eec75();while(!![]){try{const _0x59162d=-parseInt(_0x2ef798(0x153))/0x1+-parseInt(_0x2ef798(0x148))/0x2+parseInt(_0x2ef798(0x14b))/0x3+parseInt(_0x2ef798(0x14e))/0x4*(-parseInt(_0x2ef798(0x14d))/0x5)+parseInt(_0x2ef798(0x145))/0x6*(-parseInt(_0x2ef798(0x144))/0x7)+-parseInt(_0x2ef798(0x14f))/0x8+-parseInt(_0x2ef798(0x14a))/0x9*(-parseInt(_0x2ef798(0x149))/0xa);if(_0x59162d===_0x5526df)break;else _0x1efc85['push'](_0x1efc85['shift']());}catch(_0x4eb9d4){_0x1efc85['push'](_0x1efc85['shift']());}}}(a115_0x2656,0x4da76));function a115_0x2656(){const _0x1fc48c=['501734jQolge','21889zwVVhS','894PHTceY','set','get','129598hHFkBp','610MnBLYX','155151OvHaMw','1606200eMNZlj','has','20dHprXV','40408JggiDi','1568360XvzVBA','add','parentFolderId','name'];a115_0x2656=function(){return _0x1fc48c;};return a115_0x2656();}function a115_0x5961(_0x44355e,_0x182504){_0x44355e=_0x44355e-0x144;const _0x265682=a115_0x2656();let _0x5961ae=_0x265682[_0x44355e];return _0x5961ae;}export function buildFolderIdToPathMap(_0x34d209){const _0x131038=a115_0x5961,_0x507a81=new Map(),_0x25379c=new Map();for(const _0x4c8597 of _0x34d209){_0x25379c[_0x131038(0x146)](_0x4c8597['id'],_0x4c8597);}const _0x23b5ee=new Set();for(const _0x530545 of _0x34d209){!_0x530545[_0x131038(0x151)]&&_0x23b5ee['add'](_0x530545['id']);}function _0x2bece4(_0x1a03f5){const _0x250d84=_0x131038;if(_0x507a81[_0x250d84(0x14c)](_0x1a03f5['id']))return _0x507a81['get'](_0x1a03f5['id']);if(_0x23b5ee['has'](_0x1a03f5['id']))return _0x507a81[_0x250d84(0x146)](_0x1a03f5['id'],''),'';if(_0x1a03f5[_0x250d84(0x151)]){const _0x1838f6=_0x25379c[_0x250d84(0x147)](_0x1a03f5[_0x250d84(0x151)]);if(_0x1838f6){const _0x36b3a9=_0x2bece4(_0x1838f6),_0x59d1e8=_0x36b3a9?_0x36b3a9+'/'+_0x1a03f5[_0x250d84(0x152)]:_0x1a03f5['name'];return _0x507a81[_0x250d84(0x146)](_0x1a03f5['id'],_0x59d1e8),_0x59d1e8;}}const _0x27d516=_0x1a03f5['name'];return _0x507a81['set'](_0x1a03f5['id'],_0x27d516),_0x27d516;}for(const _0x16419d of _0x34d209){_0x2bece4(_0x16419d);}return _0x507a81;}export function buildFolderPathToIdMap(_0x2c1bfb){const _0x44cc09=a115_0x5961,_0x4fb967=new Map(),_0x3dc87e=new Map();for(const _0x1bed9a of _0x2c1bfb){_0x3dc87e[_0x44cc09(0x146)](_0x1bed9a['id'],_0x1bed9a);}const _0x514c30=new Set();for(const _0x5edaa7 of _0x2c1bfb){!_0x5edaa7[_0x44cc09(0x151)]&&_0x514c30[_0x44cc09(0x150)](_0x5edaa7['id']);}function _0xc28212(_0x264492){const _0x18eee2=_0x44cc09;if(_0x514c30['has'](_0x264492['id']))return'';if(_0x264492[_0x18eee2(0x151)]){const _0x10c5cb=_0x3dc87e[_0x18eee2(0x147)](_0x264492[_0x18eee2(0x151)]);if(_0x10c5cb){const _0x35a690=_0xc28212(_0x10c5cb);return _0x35a690?_0x35a690+'/'+_0x264492[_0x18eee2(0x152)]:_0x264492[_0x18eee2(0x152)];}}return _0x264492[_0x18eee2(0x152)];}for(const _0x26a4ce of _0x2c1bfb){const _0x8288ed=_0xc28212(_0x26a4ce);_0x4fb967[_0x44cc09(0x146)](_0x8288ed,_0x26a4ce['id']);}return _0x4fb967;}export function buildFolderMaps(_0x321895){const _0xd52aa3=buildFolderIdToPathMap(_0x321895),_0x197c56=new Map();for(const [_0x214c67,_0x505b50]of _0xd52aa3){_0x197c56['set'](_0x505b50,_0x214c67);}return{'idToPath':_0xd52aa3,'pathToId':_0x197c56};}export function getFolderPath(_0x5a38cd,_0x424cce){if(!_0x5a38cd)return'';return _0x424cce['get'](_0x5a38cd)??'';}
@@ -1 +1 @@
1
- (function(_0x38e3a0,_0xf799e0){const _0x482efb=a116_0xb997,_0x395ed4=_0x38e3a0();while(!![]){try{const _0x4539e7=-parseInt(_0x482efb(0x1d7))/0x1*(-parseInt(_0x482efb(0x1f5))/0x2)+parseInt(_0x482efb(0x1f1))/0x3*(parseInt(_0x482efb(0x1d5))/0x4)+-parseInt(_0x482efb(0x1fb))/0x5*(-parseInt(_0x482efb(0x1e1))/0x6)+-parseInt(_0x482efb(0x1f4))/0x7+-parseInt(_0x482efb(0x1e6))/0x8+parseInt(_0x482efb(0x1e4))/0x9+-parseInt(_0x482efb(0x1f0))/0xa;if(_0x4539e7===_0xf799e0)break;else _0x395ed4['push'](_0x395ed4['shift']());}catch(_0xf82e82){_0x395ed4['push'](_0x395ed4['shift']());}}}(a116_0x4600,0x21813));import a116_0x117f48 from'path';function a116_0x4600(){const _0xda457c=['filter','36mPoyTg','name','No\x20tdx.json\x20found\x20for\x20file:\x20','1106343dYFqvW','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','1443896zSAlYi','File\x20not\x20found:\x20','readFile','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','join','parse','Path\x20attempts\x20to\x20navigate\x20above\x20root','Path\x20cannot\x20be\x20empty','test','split','841020lwGlrJ','6qjBugY','Relative\x20path\x20cannot\x20be\x20empty','segments','1564024feonbG','536638RzzrRR','endsWith','Path\x20segment\x20cannot\x20be\x20empty','trim','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','pop','36130ixiVxT','root','slice','segment','tdx.json','Cannot\x20split\x20empty\x20path','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','isAbsolute','dirname','381308DPAgKB','exists','1CedVYQ','Cannot\x20navigate\x20above\x20root','push','.yaml','.yml','length','type','startsWith','raw'];a116_0x4600=function(){return _0xda457c;};return a116_0x4600();}import{parse as a116_0x572462}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x7b4121){const _0x5808f2=a116_0xb997;if(!_0x7b4121||_0x7b4121[_0x5808f2(0x1f8)]()==='')throw new Error(_0x5808f2(0x1ed));const _0x2b9ee4=_0x7b4121[_0x5808f2(0x1f8)]();if(_0x2b9ee4==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x7b4121};const _0x3f5a21=_0x2b9ee4['startsWith']('/')?_0x2b9ee4['substring'](0x1):_0x2b9ee4,_0x49c1ef=_0x3f5a21[_0x5808f2(0x1ef)]('/')[_0x5808f2(0x1e0)](_0x3fc1e8=>_0x3fc1e8!=='');if(_0x49c1ef[_0x5808f2(0x1dc)]===0x0)throw new Error(_0x5808f2(0x1e5));const _0x429b86=_0x2b9ee4[_0x5808f2(0x1de)]('/')||!isRelativePathSegment(_0x49c1ef[0x0]);for(const _0x574a93 of _0x49c1ef){validatePathSegment(_0x574a93);}return{'segments':_0x49c1ef,'isAbsolute':_0x429b86,'raw':_0x7b4121};}function isRelativePathSegment(_0x51af15){return _0x51af15==='.'||_0x51af15==='..';}function validatePathSegment(_0x2ae510){const _0x23677b=a116_0xb997;if(_0x2ae510==='')throw new Error(_0x23677b(0x1f7));if(_0x2ae510==='.'||_0x2ae510==='..')return;if(/[\x00-\x1F\x7F]/[_0x23677b(0x1ee)](_0x2ae510))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x2ae510);if(_0x2ae510!==_0x2ae510[_0x23677b(0x1f8)]()){}}export function validatePath(_0x36ddec){const _0x101895=a116_0xb997;if(_0x36ddec[_0x101895(0x1f3)][_0x101895(0x1dc)]===0x0&&!_0x36ddec[_0x101895(0x1d3)])throw new Error(_0x101895(0x1f2));if(_0x36ddec[_0x101895(0x1d3)]){if(_0x36ddec[_0x101895(0x1f3)][0x0]==='..')throw new Error(_0x101895(0x1d2));let _0x34564d=0x0;for(const _0x39497d of _0x36ddec[_0x101895(0x1f3)]){if(_0x39497d==='..'){if(_0x34564d===0x0)throw new Error(_0x101895(0x1ec));_0x34564d--;}else _0x39497d!=='.'&&_0x34564d++;}}}export function joinPaths(_0x5d053f,_0x2c9f2e){const _0x40bf5e=a116_0xb997;if(!_0x5d053f||_0x5d053f==='/')return _0x2c9f2e;if(!_0x2c9f2e||_0x2c9f2e==='.')return _0x5d053f;if(_0x2c9f2e[_0x40bf5e(0x1de)]('/'))return _0x2c9f2e;const _0x20c771=parsePath(_0x5d053f),_0x114987=parsePath(_0x2c9f2e),_0x5e3950=[..._0x20c771[_0x40bf5e(0x1f3)]];for(const _0x21803a of _0x114987[_0x40bf5e(0x1f3)]){if(_0x21803a==='.')continue;else{if(_0x21803a==='..'){if(_0x5e3950[_0x40bf5e(0x1dc)]===0x0)throw new Error(_0x40bf5e(0x1d8));_0x5e3950[_0x40bf5e(0x1fa)]();}else _0x5e3950[_0x40bf5e(0x1d9)](_0x21803a);}}const _0x1a6d69=_0x5e3950[_0x40bf5e(0x1ea)]('/');return _0x20c771['raw'][_0x40bf5e(0x1de)]('/')?'/'+_0x1a6d69:_0x1a6d69;}function a116_0xb997(_0xdd5b1f,_0x49d84f){_0xdd5b1f=_0xdd5b1f-0x1d1;const _0x4600a5=a116_0x4600();let _0xb997dd=_0x4600a5[_0xdd5b1f];return _0xb997dd;}export function normalizePath(_0x7b9638){const _0x115057=a116_0xb997,_0x2f2073=parsePath(_0x7b9638),_0x20195d=[];for(const _0xdca41a of _0x2f2073[_0x115057(0x1f3)]){if(_0xdca41a==='.')continue;else{if(_0xdca41a==='..'){if(_0x20195d[_0x115057(0x1dc)]===0x0){if(_0x2f2073['isAbsolute'])throw new Error(_0x115057(0x1d8));_0x20195d[_0x115057(0x1d9)]('..');}else _0x20195d[_0x20195d[_0x115057(0x1dc)]-0x1]==='..'?_0x20195d[_0x115057(0x1d9)]('..'):_0x20195d['pop']();}else _0x20195d[_0x115057(0x1d9)](_0xdca41a);}}if(_0x20195d['length']===0x0)return _0x2f2073[_0x115057(0x1d3)]?'/':'.';const _0x42541f=_0x20195d[_0x115057(0x1ea)]('/');return _0x2f2073[_0x115057(0x1df)][_0x115057(0x1de)]('/')?'/'+_0x42541f:_0x42541f;}export function getParentPath(_0x152f2d){const _0x353ad4=a116_0xb997,_0x287adf=parsePath(_0x152f2d);if(_0x287adf['segments'][_0x353ad4(0x1dc)]<=0x1)return'/';const _0x32768d=_0x287adf['segments'][_0x353ad4(0x1fd)](0x0,-0x1)[_0x353ad4(0x1ea)]('/');return _0x287adf[_0x353ad4(0x1df)][_0x353ad4(0x1de)]('/')?'/'+_0x32768d:_0x32768d;}export function getBaseName(_0x15a839){const _0x531064=a116_0xb997,_0x61283b=parsePath(_0x15a839);return _0x61283b[_0x531064(0x1f3)][_0x61283b['segments'][_0x531064(0x1dc)]-0x1]||'';}export function isChildPath(_0xcaf1ff,_0xf70883){const _0x4318f8=a116_0xb997,_0x47801a=parsePath(_0xcaf1ff),_0x57f16e=parsePath(_0xf70883);if(_0x47801a['segments'][_0x4318f8(0x1dc)]<=_0x57f16e['segments'][_0x4318f8(0x1dc)])return![];for(let _0x1fb39a=0x0;_0x1fb39a<_0x57f16e[_0x4318f8(0x1f3)][_0x4318f8(0x1dc)];_0x1fb39a++){if(_0x47801a[_0x4318f8(0x1f3)][_0x1fb39a]!==_0x57f16e[_0x4318f8(0x1f3)][_0x1fb39a])return![];}return!![];}export function splitPath(_0x213f17){const _0x493e03=a116_0xb997,_0x1c944d=parsePath(_0x213f17);if(_0x1c944d[_0x493e03(0x1f3)][_0x493e03(0x1dc)]===0x0)throw new Error(_0x493e03(0x1d1));if(_0x1c944d[_0x493e03(0x1f3)][_0x493e03(0x1dc)]===0x1)return{'parent':_0x1c944d[_0x493e03(0x1f3)][0x0]};return{'parent':_0x1c944d[_0x493e03(0x1f3)][0x0],'child':_0x1c944d[_0x493e03(0x1f3)]['slice'](0x1)[_0x493e03(0x1ea)]('/')};}export function isYamlFilePath(_0x329433){const _0x12d2b3=a116_0xb997;return _0x329433[_0x12d2b3(0x1f6)](_0x12d2b3(0x1db))||_0x329433['endsWith'](_0x12d2b3(0x1da));}export async function resolveYamlFilePath(_0x2a2018,_0x328828=nodeFileSystem){const _0xe0e0f7=a116_0xb997,_0x3d10be=a116_0x117f48['resolve'](_0x2a2018);if(!await _0x328828[_0xe0e0f7(0x1d6)](_0x3d10be))throw new Error(_0xe0e0f7(0x1e7)+_0x2a2018);let _0x40aa16=a116_0x117f48[_0xe0e0f7(0x1d4)](_0x3d10be),_0x4b949a=null,_0x5f3094=null;const _0x3638c9=a116_0x117f48[_0xe0e0f7(0x1eb)](_0x40aa16)[_0xe0e0f7(0x1fc)];while(_0x40aa16!==_0x3638c9){const _0x3468e4=a116_0x117f48['join'](_0x40aa16,_0xe0e0f7(0x1ff));if(await _0x328828[_0xe0e0f7(0x1d6)](_0x3468e4)){_0x4b949a=_0x3468e4,_0x5f3094=_0x40aa16;break;}_0x40aa16=a116_0x117f48['dirname'](_0x40aa16);}if(!_0x4b949a||!_0x5f3094)throw new Error(_0xe0e0f7(0x1e3)+_0x2a2018);const _0x1506f8=await _0x328828[_0xe0e0f7(0x1e8)](_0x4b949a),_0x56a341=JSON[_0xe0e0f7(0x1eb)](_0x1506f8),_0x376f31=_0x56a341['parent_segment'];if(!_0x376f31)throw new Error(_0xe0e0f7(0x1e9));const _0x5ca883=await _0x328828[_0xe0e0f7(0x1e8)](_0x3d10be),_0x263020=a116_0x572462(_0x5ca883),_0x3bf17d=_0x263020[_0xe0e0f7(0x1e2)];if(!_0x3bf17d)throw new Error(_0xe0e0f7(0x1f9)+_0x2a2018);const _0x4835f2=_0x263020[_0xe0e0f7(0x1dd)]==='journey'?'journey':_0xe0e0f7(0x1fe),_0x19099f=a116_0x117f48['relative'](_0x5f3094,_0x3d10be),_0x1cae74=a116_0x117f48['dirname'](_0x19099f),_0x3a58f9=_0x1cae74==='.'?'':_0x1cae74['replace'](/\\/g,'/'),_0x159b5b=_0x3a58f9?_0x376f31+'/'+_0x3a58f9+'/'+_0x3bf17d:_0x376f31+'/'+_0x3bf17d;return{'parentSegment':_0x376f31,'segmentName':_0x3bf17d,'folderPath':_0x3a58f9,'fullPath':_0x159b5b,'resourceType':_0x4835f2};}
1
+ (function(_0x4c2c5f,_0x2c6031){const _0x1f2690=a116_0x26c3,_0x493e51=_0x4c2c5f();while(!![]){try{const _0x57b6e5=-parseInt(_0x1f2690(0x204))/0x1*(parseInt(_0x1f2690(0x20b))/0x2)+parseInt(_0x1f2690(0x205))/0x3+parseInt(_0x1f2690(0x1f4))/0x4*(-parseInt(_0x1f2690(0x1f1))/0x5)+parseInt(_0x1f2690(0x21a))/0x6*(parseInt(_0x1f2690(0x20c))/0x7)+parseInt(_0x1f2690(0x219))/0x8*(parseInt(_0x1f2690(0x201))/0x9)+parseInt(_0x1f2690(0x1ef))/0xa*(-parseInt(_0x1f2690(0x200))/0xb)+-parseInt(_0x1f2690(0x20d))/0xc*(parseInt(_0x1f2690(0x207))/0xd);if(_0x57b6e5===_0x2c6031)break;else _0x493e51['push'](_0x493e51['shift']());}catch(_0x49b2df){_0x493e51['push'](_0x493e51['shift']());}}}(a116_0x4b67,0x476ff));import a116_0x3d9df0 from'path';import{parse as a116_0x492313}from'yaml';function a116_0x4b67(){const _0x34e071=['length','143YUaoRo','startsWith','push','Cannot\x20split\x20empty\x20path','358IIMeFF','988309HMneKm','388908NDdKfH','trim','dirname','test','filter','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','File\x20not\x20found:\x20','join','type','.yaml','journey','Cannot\x20navigate\x20above\x20root','1856056dYYWhb','18MbPTrQ','pop','raw','name','isAbsolute','resolve','split','root','tdx.json','10PLoFgM','readFile','408030Yelnij','parse','No\x20tdx.json\x20found\x20for\x20file:\x20','4RNOjUY','parent_segment','segment','exists','segments','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','endsWith','relative','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','slice','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Path\x20attempts\x20to\x20navigate\x20above\x20root','482383mWcJwB','9bcwkyP','.yml','replace','2317xFUumr','1601220SaXVRc'];a116_0x4b67=function(){return _0x34e071;};return a116_0x4b67();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x539c40){const _0x53bb61=a116_0x26c3;if(!_0x539c40||_0x539c40['trim']()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x240f80=_0x539c40['trim']();if(_0x240f80==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x539c40};const _0x396565=_0x240f80[_0x53bb61(0x208)]('/')?_0x240f80['substring'](0x1):_0x240f80,_0x1d1c64=_0x396565[_0x53bb61(0x1ec)]('/')[_0x53bb61(0x211)](_0x153782=>_0x153782!=='');if(_0x1d1c64['length']===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x5886f6=_0x240f80[_0x53bb61(0x208)]('/')||!isRelativePathSegment(_0x1d1c64[0x0]);for(const _0x2d9bb6 of _0x1d1c64){validatePathSegment(_0x2d9bb6);}return{'segments':_0x1d1c64,'isAbsolute':_0x5886f6,'raw':_0x539c40};}function a116_0x26c3(_0x46bd4d,_0x111e22){_0x46bd4d=_0x46bd4d-0x1ec;const _0x4b6784=a116_0x4b67();let _0x26c30e=_0x4b6784[_0x46bd4d];return _0x26c30e;}function isRelativePathSegment(_0x5c58de){return _0x5c58de==='.'||_0x5c58de==='..';}function validatePathSegment(_0x15dd0f){const _0x202ea5=a116_0x26c3;if(_0x15dd0f==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x15dd0f==='.'||_0x15dd0f==='..')return;if(/[\x00-\x1F\x7F]/[_0x202ea5(0x210)](_0x15dd0f))throw new Error(_0x202ea5(0x212)+_0x15dd0f);if(_0x15dd0f!==_0x15dd0f[_0x202ea5(0x20e)]()){}}export function validatePath(_0xe5d6d7){const _0x40c92b=a116_0x26c3;if(_0xe5d6d7[_0x40c92b(0x1f8)][_0x40c92b(0x206)]===0x0&&!_0xe5d6d7[_0x40c92b(0x21e)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0xe5d6d7['isAbsolute']){if(_0xe5d6d7[_0x40c92b(0x1f8)][0x0]==='..')throw new Error(_0x40c92b(0x1fc));let _0x3b6a7b=0x0;for(const _0x33e5de of _0xe5d6d7[_0x40c92b(0x1f8)]){if(_0x33e5de==='..'){if(_0x3b6a7b===0x0)throw new Error(_0x40c92b(0x1ff));_0x3b6a7b--;}else _0x33e5de!=='.'&&_0x3b6a7b++;}}}export function joinPaths(_0x11a9cf,_0xc2354d){const _0x67c02e=a116_0x26c3;if(!_0x11a9cf||_0x11a9cf==='/')return _0xc2354d;if(!_0xc2354d||_0xc2354d==='.')return _0x11a9cf;if(_0xc2354d[_0x67c02e(0x208)]('/'))return _0xc2354d;const _0x532296=parsePath(_0x11a9cf),_0x58fcb0=parsePath(_0xc2354d),_0x48b23b=[..._0x532296['segments']];for(const _0xb4cfa of _0x58fcb0[_0x67c02e(0x1f8)]){if(_0xb4cfa==='.')continue;else{if(_0xb4cfa==='..'){if(_0x48b23b[_0x67c02e(0x206)]===0x0)throw new Error(_0x67c02e(0x218));_0x48b23b[_0x67c02e(0x21b)]();}else _0x48b23b[_0x67c02e(0x209)](_0xb4cfa);}}const _0x36266d=_0x48b23b[_0x67c02e(0x214)]('/');return _0x532296[_0x67c02e(0x21c)]['startsWith']('/')?'/'+_0x36266d:_0x36266d;}export function normalizePath(_0x3de59d){const _0x32a50d=a116_0x26c3,_0x2209e1=parsePath(_0x3de59d),_0x57316a=[];for(const _0xfbad89 of _0x2209e1[_0x32a50d(0x1f8)]){if(_0xfbad89==='.')continue;else{if(_0xfbad89==='..'){if(_0x57316a[_0x32a50d(0x206)]===0x0){if(_0x2209e1[_0x32a50d(0x21e)])throw new Error(_0x32a50d(0x218));_0x57316a[_0x32a50d(0x209)]('..');}else _0x57316a[_0x57316a[_0x32a50d(0x206)]-0x1]==='..'?_0x57316a[_0x32a50d(0x209)]('..'):_0x57316a['pop']();}else _0x57316a['push'](_0xfbad89);}}if(_0x57316a[_0x32a50d(0x206)]===0x0)return _0x2209e1[_0x32a50d(0x21e)]?'/':'.';const _0x5dbab0=_0x57316a[_0x32a50d(0x214)]('/');return _0x2209e1[_0x32a50d(0x21c)]['startsWith']('/')?'/'+_0x5dbab0:_0x5dbab0;}export function getParentPath(_0x13bcf4){const _0xf64e65=a116_0x26c3,_0x53bb03=parsePath(_0x13bcf4);if(_0x53bb03[_0xf64e65(0x1f8)][_0xf64e65(0x206)]<=0x1)return'/';const _0x1d50c8=_0x53bb03['segments'][_0xf64e65(0x1fd)](0x0,-0x1)[_0xf64e65(0x214)]('/');return _0x53bb03[_0xf64e65(0x21c)][_0xf64e65(0x208)]('/')?'/'+_0x1d50c8:_0x1d50c8;}export function getBaseName(_0x4fc5d9){const _0x4e939e=a116_0x26c3,_0x36454c=parsePath(_0x4fc5d9);return _0x36454c[_0x4e939e(0x1f8)][_0x36454c['segments'][_0x4e939e(0x206)]-0x1]||'';}export function isChildPath(_0x54f13a,_0x10c002){const _0x3c8383=a116_0x26c3,_0x2d4e2d=parsePath(_0x54f13a),_0x2bdeef=parsePath(_0x10c002);if(_0x2d4e2d[_0x3c8383(0x1f8)][_0x3c8383(0x206)]<=_0x2bdeef[_0x3c8383(0x1f8)][_0x3c8383(0x206)])return![];for(let _0x173f53=0x0;_0x173f53<_0x2bdeef[_0x3c8383(0x1f8)][_0x3c8383(0x206)];_0x173f53++){if(_0x2d4e2d[_0x3c8383(0x1f8)][_0x173f53]!==_0x2bdeef['segments'][_0x173f53])return![];}return!![];}export function splitPath(_0x4677bf){const _0x2c320a=a116_0x26c3,_0x34d835=parsePath(_0x4677bf);if(_0x34d835[_0x2c320a(0x1f8)]['length']===0x0)throw new Error(_0x2c320a(0x20a));if(_0x34d835['segments']['length']===0x1)return{'parent':_0x34d835['segments'][0x0]};return{'parent':_0x34d835[_0x2c320a(0x1f8)][0x0],'child':_0x34d835['segments']['slice'](0x1)[_0x2c320a(0x214)]('/')};}export function isYamlFilePath(_0x45e07b){const _0x2f3138=a116_0x26c3;return _0x45e07b[_0x2f3138(0x1fa)](_0x2f3138(0x202))||_0x45e07b['endsWith'](_0x2f3138(0x216));}export async function resolveYamlFilePath(_0x42f99c,_0x313a38=nodeFileSystem){const _0x256307=a116_0x26c3,_0x484ca6=a116_0x3d9df0[_0x256307(0x21f)](_0x42f99c);if(!await _0x313a38[_0x256307(0x1f7)](_0x484ca6))throw new Error(_0x256307(0x213)+_0x42f99c);let _0x31d583=a116_0x3d9df0[_0x256307(0x20f)](_0x484ca6),_0x33e352=null,_0x33883c=null;const _0x83cc39=a116_0x3d9df0['parse'](_0x31d583)[_0x256307(0x1ed)];while(_0x31d583!==_0x83cc39){const _0x2a61f0=a116_0x3d9df0[_0x256307(0x214)](_0x31d583,_0x256307(0x1ee));if(await _0x313a38[_0x256307(0x1f7)](_0x2a61f0)){_0x33e352=_0x2a61f0,_0x33883c=_0x31d583;break;}_0x31d583=a116_0x3d9df0['dirname'](_0x31d583);}if(!_0x33e352||!_0x33883c)throw new Error(_0x256307(0x1f3)+_0x42f99c);const _0x1983f4=await _0x313a38[_0x256307(0x1f0)](_0x33e352),_0x731053=JSON[_0x256307(0x1f2)](_0x1983f4),_0x395537=_0x731053[_0x256307(0x1f5)];if(!_0x395537)throw new Error(_0x256307(0x1fe));const _0x84b8ba=await _0x313a38[_0x256307(0x1f0)](_0x484ca6),_0x1279ed=a116_0x492313(_0x84b8ba),_0x1f2b07=_0x1279ed[_0x256307(0x21d)];if(!_0x1f2b07)throw new Error(_0x256307(0x1f9)+_0x42f99c);const _0x1ac919=_0x1279ed[_0x256307(0x215)]===_0x256307(0x217)?'journey':_0x256307(0x1f6),_0x264e5b=a116_0x3d9df0[_0x256307(0x1fb)](_0x33883c,_0x484ca6),_0x119800=a116_0x3d9df0[_0x256307(0x20f)](_0x264e5b),_0x12c55e=_0x119800==='.'?'':_0x119800[_0x256307(0x203)](/\\/g,'/'),_0x25b030=_0x12c55e?_0x395537+'/'+_0x12c55e+'/'+_0x1f2b07:_0x395537+'/'+_0x1f2b07;return{'parentSegment':_0x395537,'segmentName':_0x1f2b07,'folderPath':_0x12c55e,'fullPath':_0x25b030,'resourceType':_0x1ac919};}
@@ -1 +1 @@
1
- function a117_0x4ab6(_0x4cd1f4,_0x42720a){_0x4cd1f4=_0x4cd1f4-0xef;const _0x4e126a=a117_0x4e12();let _0x4ab66f=_0x4e126a[_0x4cd1f4];return _0x4ab66f;}function a117_0x4e12(){const _0x2cec61=['145HwksQf','504804OIVmtK','5700TeTpEH','319503HmUlHd','17083cymGOg','1123409JESUcw','14YjLmQK','837738bAeYUq','Invalid\x20segment\x20reference\x20format:\x20','8XQKvzd','100UIzYfo','4768872gAtrKS','substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','.\x20Child\x20name\x20cannot\x20be\x20empty','7752YoivXz'];a117_0x4e12=function(){return _0x2cec61;};return a117_0x4e12();}(function(_0x41af1e,_0x37b1ab){const _0x280184=a117_0x4ab6,_0x33798e=_0x41af1e();while(!![]){try{const _0x50bf29=parseInt(_0x280184(0xfb))/0x1+-parseInt(_0x280184(0xf0))/0x2*(-parseInt(_0x280184(0xfd))/0x3)+parseInt(_0x280184(0xf9))/0x4*(parseInt(_0x280184(0xfa))/0x5)+-parseInt(_0x280184(0xf5))/0x6+parseInt(_0x280184(0xef))/0x7*(-parseInt(_0x280184(0xf3))/0x8)+parseInt(_0x280184(0xf1))/0x9*(parseInt(_0x280184(0xf4))/0xa)+-parseInt(_0x280184(0xfe))/0xb*(parseInt(_0x280184(0xfc))/0xc);if(_0x50bf29===_0x37b1ab)break;else _0x33798e['push'](_0x33798e['shift']());}catch(_0x3aed07){_0x33798e['push'](_0x33798e['shift']());}}}(a117_0x4e12,0x84e67));export function parseSegmentRef(_0x2bed76){const _0x3c545d=a117_0x4ab6,_0x55f899=_0x2bed76['indexOf']('/');if(_0x55f899===-0x1)return{'parentId':_0x2bed76};if(_0x55f899===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2bed76+_0x3c545d(0xf7));const _0x163d05=_0x2bed76[_0x3c545d(0xf6)](0x0,_0x55f899),_0x55eddb=_0x2bed76[_0x3c545d(0xf6)](_0x55f899+0x1);if(_0x55eddb==='')throw new Error(_0x3c545d(0xf2)+_0x2bed76+_0x3c545d(0xf8));return{'parentId':_0x163d05,'childId':_0x55eddb};}
1
+ function a117_0x50ce(){const _0x37c8c6=['3782768TMQnsM','10LCJnjx','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring','64490UYGWYx','985769ZWJUUV','Invalid\x20segment\x20reference\x20format:\x20','1413cADiSW','245212yHpEjF','.\x20Child\x20name\x20cannot\x20be\x20empty','9493187MUgeaH','7qowUgp','1678860ArconQ','268594ovAYpl','6mLyewy','indexOf'];a117_0x50ce=function(){return _0x37c8c6;};return a117_0x50ce();}(function(_0x132999,_0x4d9ec3){const _0x179c2f=a117_0x4720,_0x51bbc1=_0x132999();while(!![]){try{const _0x9dd03c=-parseInt(_0x179c2f(0x83))/0x1+parseInt(_0x179c2f(0x8b))/0x2*(-parseInt(_0x179c2f(0x8c))/0x3)+parseInt(_0x179c2f(0x86))/0x4+-parseInt(_0x179c2f(0x8f))/0x5*(parseInt(_0x179c2f(0x8a))/0x6)+-parseInt(_0x179c2f(0x89))/0x7*(-parseInt(_0x179c2f(0x8e))/0x8)+-parseInt(_0x179c2f(0x85))/0x9*(-parseInt(_0x179c2f(0x82))/0xa)+parseInt(_0x179c2f(0x88))/0xb;if(_0x9dd03c===_0x4d9ec3)break;else _0x51bbc1['push'](_0x51bbc1['shift']());}catch(_0x57f1bd){_0x51bbc1['push'](_0x51bbc1['shift']());}}}(a117_0x50ce,0x916dc));function a117_0x4720(_0x438a58,_0x3744d0){_0x438a58=_0x438a58-0x80;const _0x50ce26=a117_0x50ce();let _0x47208e=_0x50ce26[_0x438a58];return _0x47208e;}export function parseSegmentRef(_0x58d0b6){const _0x31594e=a117_0x4720,_0x39d6dc=_0x58d0b6[_0x31594e(0x8d)]('/');if(_0x39d6dc===-0x1)return{'parentId':_0x58d0b6};if(_0x39d6dc===0x0)throw new Error(_0x31594e(0x84)+_0x58d0b6+_0x31594e(0x80));const _0x16866d=_0x58d0b6[_0x31594e(0x81)](0x0,_0x39d6dc),_0x43679d=_0x58d0b6['substring'](_0x39d6dc+0x1);if(_0x43679d==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x58d0b6+_0x31594e(0x87));return{'parentId':_0x16866d,'childId':_0x43679d};}
@@ -1 +1 @@
1
- (function(_0x2d645d,_0x2d6c03){const _0x32e77c=a118_0x11da,_0x1db1d8=_0x2d645d();while(!![]){try{const _0x2cf2d4=parseInt(_0x32e77c(0x1ce))/0x1+-parseInt(_0x32e77c(0x1c0))/0x2*(parseInt(_0x32e77c(0x1bf))/0x3)+parseInt(_0x32e77c(0x1ca))/0x4+-parseInt(_0x32e77c(0x1bd))/0x5+-parseInt(_0x32e77c(0x1a9))/0x6+parseInt(_0x32e77c(0x1c4))/0x7*(parseInt(_0x32e77c(0x1af))/0x8)+parseInt(_0x32e77c(0x1a0))/0x9*(parseInt(_0x32e77c(0x1c5))/0xa);if(_0x2cf2d4===_0x2d6c03)break;else _0x1db1d8['push'](_0x1db1d8['shift']());}catch(_0x2d79ed){_0x1db1d8['push'](_0x1db1d8['shift']());}}}(a118_0x24e8,0x1dca3));import a118_0x567f53 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';function a118_0x24e8(){const _0x4a9f99=['148948BoRrSj','parse','directory','trim','1047564xeCKRs','10JGGGgK','isScoped','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','stat','dirname','503424CAbMEi','cwd','resolve','basename','210805MgIoRC','context','no_parent','scopedFolderPath','1490940qKNvGs','parent_segment','no_config','type','match','No\x20tdx.json\x20found\x20for\x20file:\x20','string','exists','file','1351374GcKrli','No\x20tdx.json\x20found','error','isDirectory','journey','startsWith','8ZuTHoU','folderPath','message','segmentName','join','Parent\x20segment\x20not\x20specified','readFile','file_not_found','isFile','parentSegment','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','File\x20not\x20found','configDir','invalid_yaml','1151255vUMqww','root','3HDSLKd'];a118_0x24e8=function(){return _0x4a9f99;};return a118_0x24e8();}import{nodeFileSystem}from'../io/node-filesystem.js';function a118_0x11da(_0x3e4a3b,_0x4327f9){_0x3e4a3b=_0x3e4a3b-0x1a0;const _0x24e8c6=a118_0x24e8();let _0x11da7f=_0x24e8c6[_0x3e4a3b];return _0x11da7f;}import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0xa7adbd){const _0x3540eb=a118_0x11da;return _0xa7adbd['type']!==_0x3540eb(0x1ab);}export function isScopedResolution(_0x36c11c){const _0x56db5d=a118_0x11da;return _0x36c11c[_0x56db5d(0x1a3)]===_0x56db5d(0x1c2)||_0x36c11c[_0x56db5d(0x1a3)]===_0x56db5d(0x1a8)||_0x36c11c[_0x56db5d(0x1a3)]===_0x56db5d(0x1cf);}export function getScopedDetails(_0x50ff35){const _0x4e1a0c=a118_0x11da;if(isScopedResolution(_0x50ff35))return{'isScoped':_0x50ff35[_0x4e1a0c(0x1c6)],'scopedFolderPath':_0x50ff35[_0x4e1a0c(0x1d1)]};return undefined;}async function findTdxConfigAsync(_0x308d4c,_0x5c0087){const _0x4a7448=a118_0x11da;let _0x44a171=a118_0x567f53[_0x4a7448(0x1cc)](_0x308d4c);const _0x2839ce=a118_0x567f53[_0x4a7448(0x1c1)](_0x44a171)[_0x4a7448(0x1be)];while(_0x44a171!==_0x2839ce){const _0x2a313c=a118_0x567f53[_0x4a7448(0x1b3)](_0x44a171,'tdx.json');if(await _0x5c0087[_0x4a7448(0x1a7)](_0x2a313c))try{const _0x4b6e5c=await _0x5c0087[_0x4a7448(0x1b5)](_0x2a313c),_0x403718=JSON[_0x4a7448(0x1c1)](_0x4b6e5c);if(_0x403718[_0x4a7448(0x1a1)]&&typeof _0x403718[_0x4a7448(0x1a1)]===_0x4a7448(0x1a6))return{'configPath':_0x2a313c,'configDir':_0x44a171,'parentSegment':_0x403718[_0x4a7448(0x1a1)]};}catch{}_0x44a171=a118_0x567f53[_0x4a7448(0x1c9)](_0x44a171);}return null;}function calculateScopedPath(_0xa9b504,_0x39495d){const _0x1310e3=a118_0x11da,_0x4215b9=a118_0x567f53['relative'](_0x39495d,_0xa9b504),_0x4090f0=_0x4215b9!==''&&_0x4215b9!=='.'&&!_0x4215b9[_0x1310e3(0x1ae)]('..');return{'isScoped':_0x4090f0,'scopedFolderPath':_0x4090f0?_0x4215b9['replace'](/\\/g,'/'):''};}export async function resolveTarget(_0x506e43){const _0x312ad1=a118_0x11da,{arg:_0x567caa,contextParent:_0xd29084,cwd:cwd=process[_0x312ad1(0x1cb)](),fs:fs=nodeFileSystem}=_0x506e43;if(_0x567caa&&isYamlFilePath(_0x567caa))try{const _0x32f055=await resolveYamlFilePath(_0x567caa,fs),_0x5e787f=a118_0x567f53[_0x312ad1(0x1cc)](_0x567caa),_0x3b605a=a118_0x567f53[_0x312ad1(0x1c9)](_0x5e787f),_0xaafb4a=await findTdxConfigAsync(_0x3b605a,fs);if(!_0xaafb4a){if(_0xd29084){const _0x3b3876=a118_0x567f53[_0x312ad1(0x1c9)](_0x5e787f);return{'type':_0x312ad1(0x1a8),'parentName':_0xd29084,'targetDir':_0x3b3876,'configRoot':_0x3b3876,'filePath':_0x5e787f,'resourceName':_0x32f055['segmentName'],'folderPath':_0x32f055[_0x312ad1(0x1b0)],'resourceType':_0x32f055['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x312ad1(0x1ab),'errorCode':_0x312ad1(0x1a2),'message':_0x312ad1(0x1a5)+_0x567caa,'arg':_0x567caa,'helpText':_0x312ad1(0x1b9)};}const _0x290b2b=calculateScopedPath(_0x3b605a,_0xaafb4a[_0x312ad1(0x1bb)]);return{'type':'file','parentName':_0xaafb4a[_0x312ad1(0x1b8)],'targetDir':_0xaafb4a[_0x312ad1(0x1bb)],'configRoot':_0xaafb4a['configDir'],'filePath':_0x5e787f,'resourceName':_0x32f055[_0x312ad1(0x1b2)],'folderPath':_0x32f055['folderPath'],'resourceType':_0x32f055['resourceType'],'isScoped':_0x290b2b[_0x312ad1(0x1c6)],'scopedFolderPath':_0x290b2b[_0x312ad1(0x1d1)]};}catch(_0x40c31b){const _0x2e0514=_0x40c31b instanceof Error?_0x40c31b[_0x312ad1(0x1b1)]:String(_0x40c31b);if(_0x2e0514['includes'](_0x312ad1(0x1ba)))return{'type':_0x312ad1(0x1ab),'errorCode':_0x312ad1(0x1b6),'message':'File\x20not\x20found:\x20'+_0x567caa,'arg':_0x567caa};if(_0x2e0514['includes'](_0x312ad1(0x1aa))){if(_0xd29084){const _0x37f2da=a118_0x567f53[_0x312ad1(0x1cc)](_0x567caa);if(await fs[_0x312ad1(0x1a7)](_0x37f2da)){const _0x41f0e9=a118_0x567f53['dirname'](_0x37f2da),_0x7c3f67=await fs['readFile'](_0x37f2da),_0x3bf6cf=_0x7c3f67['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0xf0acac=_0x7c3f67[_0x312ad1(0x1a4)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4a5275=_0x3bf6cf?_0x3bf6cf[0x1][_0x312ad1(0x1c3)]():a118_0x567f53[_0x312ad1(0x1cd)](_0x567caa,a118_0x567f53['extname'](_0x567caa)),_0x57652f=_0xf0acac&&_0xf0acac[0x1]['trim']()===_0x312ad1(0x1ad)?'journey':'segment';return{'type':_0x312ad1(0x1a8),'parentName':_0xd29084,'targetDir':_0x41f0e9,'configRoot':_0x41f0e9,'filePath':_0x37f2da,'resourceName':_0x4a5275,'folderPath':'','resourceType':_0x57652f,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x312ad1(0x1ab),'errorCode':_0x312ad1(0x1a2),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x567caa,'arg':_0x567caa,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}return{'type':'error','errorCode':'invalid_yaml','message':_0x2e0514,'arg':_0x567caa};}if(_0x567caa){const _0x242b6b=a118_0x567f53[_0x312ad1(0x1cc)](cwd,_0x567caa);let _0x5de83e=null;try{_0x5de83e=await fs[_0x312ad1(0x1c8)](_0x242b6b);}catch{}if(_0x5de83e?.[_0x312ad1(0x1ac)]()){const _0x31df29=await findTdxConfigAsync(_0x242b6b,fs);if(_0x31df29){const _0x1aabe2=calculateScopedPath(_0x242b6b,_0x31df29[_0x312ad1(0x1bb)]);return{'type':_0x312ad1(0x1c2),'parentName':_0x31df29[_0x312ad1(0x1b8)],'targetDir':_0x242b6b,'configRoot':_0x31df29['configDir'],'isScoped':_0x1aabe2['isScoped'],'scopedFolderPath':_0x1aabe2[_0x312ad1(0x1d1)]};}if(_0xd29084)return{'type':'directory','parentName':_0xd29084,'targetDir':_0x242b6b,'configRoot':_0x242b6b,'isScoped':![],'scopedFolderPath':''};return{'type':_0x312ad1(0x1ab),'errorCode':'no_config','message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x567caa,'arg':_0x567caa,'helpText':_0x312ad1(0x1b9)};}if(_0x5de83e?.[_0x312ad1(0x1b7)]())return{'type':_0x312ad1(0x1ab),'errorCode':_0x312ad1(0x1bc),'message':'Not\x20a\x20YAML\x20file:\x20'+_0x567caa,'arg':_0x567caa,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x13661c=sanitizeFileName(_0x567caa),_0x330028=getSegmentRootDir(_0x13661c,cwd);return{'type':'parent_name','parentName':_0x567caa,'targetDir':_0x330028,'configRoot':_0x330028};}const _0x23c5bf=await findTdxConfigAsync(cwd,fs);if(_0x23c5bf){const _0x4482e1=calculateScopedPath(cwd,_0x23c5bf[_0x312ad1(0x1bb)]);return{'type':_0x312ad1(0x1cf),'parentName':_0x23c5bf[_0x312ad1(0x1b8)],'targetDir':cwd,'configRoot':_0x23c5bf[_0x312ad1(0x1bb)],'isScoped':_0x4482e1[_0x312ad1(0x1c6)],'scopedFolderPath':_0x4482e1[_0x312ad1(0x1d1)]};}if(_0xd29084){const _0x43d73e=sanitizeFileName(_0xd29084),_0x5231aa=getSegmentRootDir(_0x43d73e,cwd);return{'type':_0x312ad1(0x1cf),'parentName':_0xd29084,'targetDir':_0x5231aa,'configRoot':_0x5231aa,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x312ad1(0x1ab),'errorCode':_0x312ad1(0x1d0),'message':_0x312ad1(0x1b4),'helpText':_0x312ad1(0x1c7)};}
1
+ function a118_0x1334(_0x43264e,_0x3a9d85){_0x43264e=_0x43264e-0xe7;const _0x306c24=a118_0x306c();let _0x1334c1=_0x306c24[_0x43264e];return _0x1334c1;}(function(_0x258779,_0x122907){const _0x3ea5bf=a118_0x1334,_0x133768=_0x258779();while(!![]){try{const _0x3e5b66=-parseInt(_0x3ea5bf(0xec))/0x1*(-parseInt(_0x3ea5bf(0x100))/0x2)+-parseInt(_0x3ea5bf(0x110))/0x3+parseInt(_0x3ea5bf(0x106))/0x4*(-parseInt(_0x3ea5bf(0xf2))/0x5)+-parseInt(_0x3ea5bf(0x10e))/0x6+-parseInt(_0x3ea5bf(0xf7))/0x7+-parseInt(_0x3ea5bf(0x102))/0x8+parseInt(_0x3ea5bf(0xee))/0x9;if(_0x3e5b66===_0x122907)break;else _0x133768['push'](_0x133768['shift']());}catch(_0x53c146){_0x133768['push'](_0x133768['shift']());}}}(a118_0x306c,0x1ce7a));function a118_0x306c(){const _0xb6cb14=['type','1524425BchrQm','join','trim','context','invalid_yaml','Not\x20a\x20YAML\x20file:\x20','scopedFolderPath','basename','file','217254uuOGGc','match','193712wLXOsn','file_not_found','journey','configDir','20372XDiyJa','File\x20not\x20found','resolve','includes','isScoped','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','string','folderPath','37542DzISGP','directory','590673LHaBxG','segmentName','isFile','cwd','parentSegment','dirname','message','segment','no_config','parse','No\x20tdx.json\x20found\x20for\x20file:\x20','stat','error','parent_segment','2ZuHXgj','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','4858299ZfTyvc','no_parent','extname','File\x20not\x20found:\x20','190vKyqSk','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','resourceType','readFile'];a118_0x306c=function(){return _0xb6cb14;};return a118_0x306c();}import a118_0x1effab 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(_0xd9ddd9){const _0x3bb157=a118_0x1334;return _0xd9ddd9[_0x3bb157(0xf6)]!==_0x3bb157(0xea);}export function isScopedResolution(_0x4f6668){const _0x3659d5=a118_0x1334;return _0x4f6668[_0x3659d5(0xf6)]===_0x3659d5(0x10f)||_0x4f6668[_0x3659d5(0xf6)]===_0x3659d5(0xff)||_0x4f6668[_0x3659d5(0xf6)]===_0x3659d5(0xfa);}export function getScopedDetails(_0xa3a8e6){const _0x2578c1=a118_0x1334;if(isScopedResolution(_0xa3a8e6))return{'isScoped':_0xa3a8e6[_0x2578c1(0x10a)],'scopedFolderPath':_0xa3a8e6['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x21ce2e,_0x291cd0){const _0x3a83e9=a118_0x1334;let _0x5e19c3=a118_0x1effab[_0x3a83e9(0x108)](_0x21ce2e);const _0x3d20c9=a118_0x1effab[_0x3a83e9(0xe7)](_0x5e19c3)['root'];while(_0x5e19c3!==_0x3d20c9){const _0x85476a=a118_0x1effab[_0x3a83e9(0xf8)](_0x5e19c3,'tdx.json');if(await _0x291cd0['exists'](_0x85476a))try{const _0x366f0f=await _0x291cd0[_0x3a83e9(0xf5)](_0x85476a),_0x4208d5=JSON['parse'](_0x366f0f);if(_0x4208d5[_0x3a83e9(0xeb)]&&typeof _0x4208d5['parent_segment']===_0x3a83e9(0x10c))return{'configPath':_0x85476a,'configDir':_0x5e19c3,'parentSegment':_0x4208d5[_0x3a83e9(0xeb)]};}catch{}_0x5e19c3=a118_0x1effab[_0x3a83e9(0x115)](_0x5e19c3);}return null;}function calculateScopedPath(_0x1d39ee,_0x1f9492){const _0x19328f=a118_0x1effab['relative'](_0x1f9492,_0x1d39ee),_0x598524=_0x19328f!==''&&_0x19328f!=='.'&&!_0x19328f['startsWith']('..');return{'isScoped':_0x598524,'scopedFolderPath':_0x598524?_0x19328f['replace'](/\\/g,'/'):''};}export async function resolveTarget(_0x41f761){const _0x272eef=a118_0x1334,{arg:_0x4645c2,contextParent:_0x4a55b2,cwd:cwd=process[_0x272eef(0x113)](),fs:fs=nodeFileSystem}=_0x41f761;if(_0x4645c2&&isYamlFilePath(_0x4645c2))try{const _0x213220=await resolveYamlFilePath(_0x4645c2,fs),_0x10e1f4=a118_0x1effab[_0x272eef(0x108)](_0x4645c2),_0x1cc487=a118_0x1effab[_0x272eef(0x115)](_0x10e1f4),_0x18963a=await findTdxConfigAsync(_0x1cc487,fs);if(!_0x18963a){if(_0x4a55b2){const _0x18a598=a118_0x1effab[_0x272eef(0x115)](_0x10e1f4);return{'type':_0x272eef(0xff),'parentName':_0x4a55b2,'targetDir':_0x18a598,'configRoot':_0x18a598,'filePath':_0x10e1f4,'resourceName':_0x213220['segmentName'],'folderPath':_0x213220[_0x272eef(0x10d)],'resourceType':_0x213220[_0x272eef(0xf4)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x272eef(0xea),'errorCode':_0x272eef(0x118),'message':_0x272eef(0xe8)+_0x4645c2,'arg':_0x4645c2,'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 _0x3b305a=calculateScopedPath(_0x1cc487,_0x18963a[_0x272eef(0x105)]);return{'type':_0x272eef(0xff),'parentName':_0x18963a[_0x272eef(0x114)],'targetDir':_0x18963a['configDir'],'configRoot':_0x18963a[_0x272eef(0x105)],'filePath':_0x10e1f4,'resourceName':_0x213220[_0x272eef(0x111)],'folderPath':_0x213220[_0x272eef(0x10d)],'resourceType':_0x213220['resourceType'],'isScoped':_0x3b305a[_0x272eef(0x10a)],'scopedFolderPath':_0x3b305a[_0x272eef(0xfd)]};}catch(_0x322ce4){const _0x12439c=_0x322ce4 instanceof Error?_0x322ce4[_0x272eef(0x116)]:String(_0x322ce4);if(_0x12439c[_0x272eef(0x109)](_0x272eef(0x107)))return{'type':_0x272eef(0xea),'errorCode':_0x272eef(0x103),'message':_0x272eef(0xf1)+_0x4645c2,'arg':_0x4645c2};if(_0x12439c[_0x272eef(0x109)]('No\x20tdx.json\x20found')){if(_0x4a55b2){const _0x5d9a23=a118_0x1effab['resolve'](_0x4645c2);if(await fs['exists'](_0x5d9a23)){const _0x29a364=a118_0x1effab[_0x272eef(0x115)](_0x5d9a23),_0x1b770b=await fs[_0x272eef(0xf5)](_0x5d9a23),_0x55b162=_0x1b770b['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x1c5817=_0x1b770b[_0x272eef(0x101)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x25a801=_0x55b162?_0x55b162[0x1][_0x272eef(0xf9)]():a118_0x1effab[_0x272eef(0xfe)](_0x4645c2,a118_0x1effab[_0x272eef(0xf0)](_0x4645c2)),_0x394534=_0x1c5817&&_0x1c5817[0x1][_0x272eef(0xf9)]()===_0x272eef(0x104)?_0x272eef(0x104):_0x272eef(0x117);return{'type':_0x272eef(0xff),'parentName':_0x4a55b2,'targetDir':_0x29a364,'configRoot':_0x29a364,'filePath':_0x5d9a23,'resourceName':_0x25a801,'folderPath':'','resourceType':_0x394534,'isScoped':![],'scopedFolderPath':''};}}return{'type':'error','errorCode':_0x272eef(0x118),'message':_0x272eef(0xe8)+_0x4645c2,'arg':_0x4645c2,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}return{'type':_0x272eef(0xea),'errorCode':_0x272eef(0xfb),'message':_0x12439c,'arg':_0x4645c2};}if(_0x4645c2){const _0x24ac6c=a118_0x1effab['resolve'](cwd,_0x4645c2);let _0x4d1140=null;try{_0x4d1140=await fs[_0x272eef(0xe9)](_0x24ac6c);}catch{}if(_0x4d1140?.['isDirectory']()){const _0x419cbd=await findTdxConfigAsync(_0x24ac6c,fs);if(_0x419cbd){const _0xba1e1d=calculateScopedPath(_0x24ac6c,_0x419cbd[_0x272eef(0x105)]);return{'type':_0x272eef(0x10f),'parentName':_0x419cbd['parentSegment'],'targetDir':_0x24ac6c,'configRoot':_0x419cbd[_0x272eef(0x105)],'isScoped':_0xba1e1d[_0x272eef(0x10a)],'scopedFolderPath':_0xba1e1d['scopedFolderPath']};}if(_0x4a55b2)return{'type':_0x272eef(0x10f),'parentName':_0x4a55b2,'targetDir':_0x24ac6c,'configRoot':_0x24ac6c,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x272eef(0x118),'message':_0x272eef(0xf3)+_0x4645c2,'arg':_0x4645c2,'helpText':_0x272eef(0x10b)};}if(_0x4d1140?.[_0x272eef(0x112)]())return{'type':_0x272eef(0xea),'errorCode':_0x272eef(0xfb),'message':_0x272eef(0xfc)+_0x4645c2,'arg':_0x4645c2,'helpText':_0x272eef(0xed)};const _0x4ead1f=sanitizeFileName(_0x4645c2),_0xc654bb=getSegmentRootDir(_0x4ead1f,cwd);return{'type':'parent_name','parentName':_0x4645c2,'targetDir':_0xc654bb,'configRoot':_0xc654bb};}const _0x5a2a9b=await findTdxConfigAsync(cwd,fs);if(_0x5a2a9b){const _0x4be30f=calculateScopedPath(cwd,_0x5a2a9b['configDir']);return{'type':'context','parentName':_0x5a2a9b[_0x272eef(0x114)],'targetDir':cwd,'configRoot':_0x5a2a9b[_0x272eef(0x105)],'isScoped':_0x4be30f['isScoped'],'scopedFolderPath':_0x4be30f[_0x272eef(0xfd)]};}if(_0x4a55b2){const _0x464eaf=sanitizeFileName(_0x4a55b2),_0x35860e=getSegmentRootDir(_0x464eaf,cwd);return{'type':'context','parentName':_0x4a55b2,'targetDir':_0x35860e,'configRoot':_0x35860e,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x272eef(0xea),'errorCode':_0x272eef(0xef),'message':'Parent\x20segment\x20not\x20specified','helpText':'Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure'};}