@treasuredata/tdx 2026.4.13 → 2026.4.15

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 (221) hide show
  1. package/README.md +1 -1
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/tools/work-create-item.js +1 -1
  79. package/dist/mcp/utils.js +1 -1
  80. package/dist/proxy/claude-usage-tracker.js +1 -1
  81. package/dist/proxy/passthrough-server.js +1 -1
  82. package/dist/proxy/sse-usage-parser.js +1 -1
  83. package/dist/sdk/agent/agent-config.js +1 -1
  84. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  85. package/dist/sdk/agent/agent-yaml.js +1 -1
  86. package/dist/sdk/agent/test/evaluator.js +1 -1
  87. package/dist/sdk/agent/test/executor.js +1 -1
  88. package/dist/sdk/agent/test/index.js +1 -1
  89. package/dist/sdk/agent/test/output.js +1 -1
  90. package/dist/sdk/agent/test/parser.js +1 -1
  91. package/dist/sdk/agent/tool-target-registry.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/cas/cas-api-client.js +1 -1
  94. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  95. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  96. package/dist/sdk/cas/index.js +1 -1
  97. package/dist/sdk/cas/pull-workflow.js +1 -1
  98. package/dist/sdk/cas/push-workflow.js +1 -1
  99. package/dist/sdk/client/cdp-api-client.js +1 -1
  100. package/dist/sdk/client/delivery-api-client.js +1 -1
  101. package/dist/sdk/client/endpoints.js +1 -1
  102. package/dist/sdk/client/engage-api-client.js +1 -1
  103. package/dist/sdk/client/http-client.js +1 -1
  104. package/dist/sdk/client/llm-api-client.js +1 -1
  105. package/dist/sdk/client/oauth-refresh.js +1 -1
  106. package/dist/sdk/client/rate-limiter.js +1 -1
  107. package/dist/sdk/client/td-api-client.js +1 -1
  108. package/dist/sdk/client/trino-api-client.js +1 -1
  109. package/dist/sdk/client/workflow-client.js +1 -1
  110. package/dist/sdk/connection-validator.js +1 -1
  111. package/dist/sdk/connection.js +1 -1
  112. package/dist/sdk/delivery.js +1 -1
  113. package/dist/sdk/engage/campaign-pull.js +1 -1
  114. package/dist/sdk/engage/campaign-push.js +1 -1
  115. package/dist/sdk/engage/campaign-validator.js +1 -1
  116. package/dist/sdk/engage/campaign-yaml.js +1 -1
  117. package/dist/sdk/engage/template-pull.js +1 -1
  118. package/dist/sdk/engage/template-push.js +1 -1
  119. package/dist/sdk/engage/template-validator.js +1 -1
  120. package/dist/sdk/engage/template-yaml.js +1 -1
  121. package/dist/sdk/engage/types/campaign-def.js +1 -1
  122. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  123. package/dist/sdk/engage/types/template-schema.js +1 -1
  124. package/dist/sdk/engage.js +1 -1
  125. package/dist/sdk/errors.js +1 -1
  126. package/dist/sdk/index.js +1 -1
  127. package/dist/sdk/io/index.js +1 -1
  128. package/dist/sdk/io/node-filesystem.js +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/journey.js +1 -1
  131. package/dist/sdk/llm/chat-cache.js +1 -1
  132. package/dist/sdk/llm/index.js +1 -1
  133. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  134. package/dist/sdk/llm/model-factors.js +1 -1
  135. package/dist/sdk/personalization.js +1 -1
  136. package/dist/sdk/policy.js +1 -1
  137. package/dist/sdk/query/index.js +1 -1
  138. package/dist/sdk/query/sql-parser.js +1 -1
  139. package/dist/sdk/realtime.js +1 -1
  140. package/dist/sdk/schedule.js +1 -1
  141. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  142. package/dist/sdk/segment/fields-display.js +1 -1
  143. package/dist/sdk/segment/file-discovery.js +1 -1
  144. package/dist/sdk/segment/journey-utils.js +1 -1
  145. package/dist/sdk/segment/journey-validator.js +1 -1
  146. package/dist/sdk/segment/journey-yaml.js +1 -1
  147. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  148. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  149. package/dist/sdk/segment/pull-workflow.js +1 -1
  150. package/dist/sdk/segment/push-recovery.js +1 -1
  151. package/dist/sdk/segment/push-workflow.js +1 -1
  152. package/dist/sdk/segment/resolution-context.js +1 -1
  153. package/dist/sdk/segment/segment-path-parser.js +1 -1
  154. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  155. package/dist/sdk/segment/segment-validator.js +1 -1
  156. package/dist/sdk/segment/target-resolution.js +1 -1
  157. package/dist/sdk/segment/tdx-config.js +1 -1
  158. package/dist/sdk/segment/types/activation-schema.js +1 -1
  159. package/dist/sdk/segment/types/journey-def.js +1 -1
  160. package/dist/sdk/segment/types/journey-schema.js +1 -1
  161. package/dist/sdk/segment/types/segment-def.js +1 -1
  162. package/dist/sdk/segment/types/segment-schema.js +1 -1
  163. package/dist/sdk/segment/validate-files.js +1 -1
  164. package/dist/sdk/segment/yaml-validator.js +1 -1
  165. package/dist/sdk/segment.js +1 -1
  166. package/dist/sdk/types/index.js +1 -1
  167. package/dist/sdk/types/progress.js +1 -1
  168. package/dist/sdk/types/workspace.js +1 -1
  169. package/dist/sdk/user.js +1 -1
  170. package/dist/sdk/util/format-detector.js +1 -1
  171. package/dist/sdk/util/formatters.js +1 -1
  172. package/dist/sdk/util/index.js +1 -1
  173. package/dist/sdk/util/paginate.js +1 -1
  174. package/dist/sdk/util/tree-formatter.js +1 -1
  175. package/dist/sdk/workflow/archive-validation.js +1 -1
  176. package/dist/sdk/workflow/clone-workflow.js +1 -1
  177. package/dist/sdk/workflow/index.js +1 -1
  178. package/dist/sdk/workflow/pull-workflow.js +1 -1
  179. package/dist/sdk/workflow/push-workflow.js +1 -1
  180. package/dist/sdk/workflow/tdx-config.js +1 -1
  181. package/dist/sdk/workflow/workflow-utils.js +1 -1
  182. package/dist/sdk/workspace/access-tracker.js +1 -1
  183. package/dist/sdk/workspace/frontmatter.js +1 -1
  184. package/dist/sdk/workspace/git.js +1 -1
  185. package/dist/sdk/workspace/index.js +1 -1
  186. package/dist/sdk/workspace/templates.js +1 -1
  187. package/dist/sdk/workspace/weekly.js +1 -1
  188. package/dist/sdk/workspace/wikilinks.js +1 -1
  189. package/dist/test-utils/command-runner.js +1 -1
  190. package/dist/test-utils/factories.js +1 -1
  191. package/dist/test-utils/fixtures.js +1 -1
  192. package/dist/test-utils/http-mock.js +1 -1
  193. package/dist/test-utils/index.js +1 -1
  194. package/dist/utils/async.js +1 -1
  195. package/dist/utils/colors.js +1 -1
  196. package/dist/utils/diff.js +1 -1
  197. package/dist/utils/file-permissions.js +1 -1
  198. package/dist/utils/file-reader.js +1 -1
  199. package/dist/utils/github-releases.js +1 -1
  200. package/dist/utils/global-cache.js +1 -1
  201. package/dist/utils/json-loader.js +1 -1
  202. package/dist/utils/local-cache.js +1 -1
  203. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  204. package/dist/utils/logger/formatters/index.js +1 -1
  205. package/dist/utils/logger/handlers/console-handler.js +1 -1
  206. package/dist/utils/logger/handlers/file-handler.js +1 -1
  207. package/dist/utils/logger/handlers/index.js +1 -1
  208. package/dist/utils/logger/handlers/null-handler.js +1 -1
  209. package/dist/utils/logger/index.js +1 -1
  210. package/dist/utils/logger/logger.js +1 -1
  211. package/dist/utils/logger/types.js +1 -1
  212. package/dist/utils/option-validation.js +1 -1
  213. package/dist/utils/process.js +1 -1
  214. package/dist/utils/prompt.js +1 -1
  215. package/dist/utils/spinner.js +1 -1
  216. package/dist/utils/sse-parser.js +1 -1
  217. package/dist/utils/string-utils.js +1 -1
  218. package/dist/utils/table-ref-parser.js +1 -1
  219. package/dist/utils/tdx-logger.js +1 -1
  220. package/dist/utils/version-check.js +1 -1
  221. package/package.json +30 -12
@@ -1 +1 @@
1
- const a152_0xfcf5ee=a152_0x558f;(function(_0x4fc1cb,_0x3c68dc){const _0x6f1454=a152_0x558f,_0x448e39=_0x4fc1cb();while(!![]){try{const _0x38dc77=parseInt(_0x6f1454(0x204))/0x1*(parseInt(_0x6f1454(0x205))/0x2)+-parseInt(_0x6f1454(0x2ae))/0x3*(-parseInt(_0x6f1454(0x290))/0x4)+parseInt(_0x6f1454(0x254))/0x5+parseInt(_0x6f1454(0x2c8))/0x6*(parseInt(_0x6f1454(0x298))/0x7)+parseInt(_0x6f1454(0x275))/0x8*(parseInt(_0x6f1454(0x2a8))/0x9)+-parseInt(_0x6f1454(0x273))/0xa+-parseInt(_0x6f1454(0x2b0))/0xb*(parseInt(_0x6f1454(0x243))/0xc);if(_0x38dc77===_0x3c68dc)break;else _0x448e39['push'](_0x448e39['shift']());}catch(_0x577f9b){_0x448e39['push'](_0x448e39['shift']());}}}(a152_0x2821,0xf2b74));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a152_0xfcf5ee(0x288);export function createPendingSegmentId(_0x152b60){return''+PENDING_SEGMENT_PREFIX+_0x152b60+'__';}export function isPendingSegmentId(_0x5b31d4){const _0x3b29b0=a152_0xfcf5ee;return _0x5b31d4[_0x3b29b0(0x257)](PENDING_SEGMENT_PREFIX)&&!_0x5b31d4['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x46a1db){const _0x1f1a8f=a152_0xfcf5ee;return _0x46a1db[_0x1f1a8f(0x2c1)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x24ebb){return''+PENDING_ACTIVATION_PREFIX+_0x24ebb+'__';}export function isPendingActivationId(_0x40d39b){return _0x40d39b['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4ddaa8){const _0x5b3f25=a152_0xfcf5ee;return _0x4ddaa8[_0x5b3f25(0x2c1)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x585794,_0x454eca){const _0x19089c=a152_0xfcf5ee,_0x603307=_0x585794+'::'+(_0x454eca['trim']()||_0x19089c(0x210)),_0x1743ef=createHash(_0x19089c(0x21c))[_0x19089c(0x238)](_0x603307)['digest'](_0x19089c(0x28f))['slice'](0x0,0xc);return _0x19089c(0x260)+_0x1743ef;}export function ensureJourneyDefaults(_0x561190){const _0x755f48=a152_0xfcf5ee;!_0x561190[_0x755f48(0x224)]&&(_0x561190[_0x755f48(0x224)]=''),!_0x561190[_0x755f48(0x289)]&&(_0x561190[_0x755f48(0x289)]=_0x755f48(0x2cf));}export function injectExistingStageIds(_0x4eb5e9,_0x537158){const _0x34f91c=a152_0xfcf5ee,_0x444626=new Map(_0x537158['map'](_0x19b3ae=>[_0x19b3ae['name'],_0x19b3ae['id']]));for(const _0x41f3c8 of _0x4eb5e9){if(!_0x41f3c8['id']){const _0xb159af=_0x444626[_0x34f91c(0x29d)](_0x41f3c8[_0x34f91c(0x228)]);_0xb159af&&(_0x41f3c8['id']=_0xb159af);}}}export function resolveTDFolderPath(_0x272ccd,_0x4ee817,_0x73fa24){if(!_0x4ee817)return _0x272ccd;if(_0x272ccd===_0x73fa24||_0x272ccd['startsWith'](_0x73fa24+'/'))return _0x272ccd;return _0x272ccd?_0x73fa24+'/'+_0x272ccd:_0x73fa24;}export function addFoldersToCreate(_0x41afcd,_0x13afeb,_0x446382){const _0x49ed13=a152_0xfcf5ee;if(!_0x41afcd)return;if(_0x13afeb['has'](_0x41afcd))return;const _0x30ec17=_0x41afcd[_0x49ed13(0x208)]('/');let _0x1710ed='';for(const _0x5dd0a1 of _0x30ec17){_0x1710ed=_0x1710ed?_0x1710ed+'/'+_0x5dd0a1:_0x5dd0a1,!_0x13afeb['has'](_0x1710ed)&&_0x446382[_0x49ed13(0x231)](_0x1710ed);}}export function sortFoldersByDepth(_0x315be7){const _0x3e9de3=a152_0xfcf5ee;return[..._0x315be7][_0x3e9de3(0x26f)]((_0x465405,_0x2398f3)=>{const _0x1470f3=_0x3e9de3,_0x4475c6=(_0x465405[_0x1470f3(0x20f)](/\//g)||[])[_0x1470f3(0x221)],_0x409d5e=(_0x2398f3[_0x1470f3(0x20f)](/\//g)||[])['length'];return _0x4475c6-_0x409d5e;});}import*as a152_0x13ed94 from'yaml';import{readFileSync}from'fs';import a152_0x4085cb from'path';import{isJourneyDef,parseYamlString as a152_0x1dedcf,toYamlString as a152_0x3cd3f6,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';function a152_0x558f(_0x3e1da6,_0x4dd0af){_0x3e1da6=_0x3e1da6-0x1d8;const _0x28215b=a152_0x2821();let _0x558f25=_0x28215b[_0x3e1da6];return _0x558f25;}import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x313c53){const _0x2bc93a=a152_0xfcf5ee;if(Array[_0x2bc93a(0x213)](_0x313c53))return'['+_0x313c53[_0x2bc93a(0x232)](_0x1be040=>stableStringify(_0x1be040))['join'](',')+']';if(_0x313c53&&typeof _0x313c53===_0x2bc93a(0x1f9)){const _0x736836=_0x313c53,_0x2f1073=Object[_0x2bc93a(0x259)](_0x736836)[_0x2bc93a(0x26f)](),_0x56f6d0=_0x2f1073[_0x2bc93a(0x232)](_0x1b7f7b=>'\x22'+_0x1b7f7b+'\x22:'+stableStringify(_0x736836[_0x1b7f7b]));return'{'+_0x56f6d0[_0x2bc93a(0x1fb)](',')+'}';}const _0x47ee70=JSON[_0x2bc93a(0x1f7)](_0x313c53);return _0x47ee70===undefined?_0x2bc93a(0x248):_0x47ee70;}function activationSignature(_0x2f5d67){const _0xe2dddd=a152_0xfcf5ee,_0x21137f={'connection':_0x2f5d67[_0xe2dddd(0x2b3)],..._0x2f5d67['all_columns']!==undefined&&{'all_columns':_0x2f5d67[_0xe2dddd(0x271)]},..._0x2f5d67[_0xe2dddd(0x2d9)]!==undefined&&{'columns':_0x2f5d67[_0xe2dddd(0x2d9)]},..._0x2f5d67[_0xe2dddd(0x2c3)]!==undefined&&{'behavior':_0x2f5d67[_0xe2dddd(0x2c3)]},..._0x2f5d67[_0xe2dddd(0x1d9)]!==undefined&&{'schedule':_0x2f5d67['schedule']},..._0x2f5d67['notification']!==undefined&&{'notification':_0x2f5d67['notification']},..._0x2f5d67[_0xe2dddd(0x1ec)]!==undefined&&{'connector_config':_0x2f5d67[_0xe2dddd(0x1ec)]},..._0x2f5d67[_0xe2dddd(0x1f4)]!==undefined&&{'activation_template_id':_0x2f5d67['activation_template_id']}};return stableStringify(_0x21137f);}async function fetchSegment(_0x4f9c4e,_0xb5ddfd,_0xd1d1a0,_0x4193a5){const _0x272cec=a152_0xfcf5ee,_0x54e4f0=_0x4193a5?.['find'](_0x9a418e=>_0x9a418e['id']===_0xd1d1a0);if(_0x54e4f0)return _0x54e4f0;try{return await _0x4f9c4e[_0x272cec(0x210)]['getSegment'](_0xb5ddfd,_0xd1d1a0);}catch(_0x10b69c){logger['debug'](_0x272cec(0x268)+_0xd1d1a0+_0x272cec(0x2d1)+_0x10b69c);try{return await _0x4f9c4e[_0x272cec(0x210)][_0x272cec(0x217)](_0xd1d1a0);}catch(_0x22272d){return logger[_0x272cec(0x2cc)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0xd1d1a0+':\x20'+_0x22272d),null;}}}function recoverSegmentIdsFromPushRecovery(_0x1598c0,_0x53cf17,_0x24563e){const _0x45bd76=a152_0xfcf5ee,_0x2d0e88=readPushRecovery(_0x1598c0['absolutePath']);if(_0x2d0e88?.[_0x45bd76(0x29f)]===_0x1598c0[_0x45bd76(0x29e)][_0x45bd76(0x228)])for(const [_0x488acb,_0x2e31ae]of Object['entries'](_0x2d0e88['segments'])){const _0x417164=generateDeterministicJourneySegmentName(_0x1598c0['yamlConfig']['name'],_0x488acb);_0x2e31ae[_0x45bd76(0x23a)]===_0x417164&&(_0x53cf17[_0x45bd76(0x25b)](_0x488acb,_0x2e31ae[_0x45bd76(0x1eb)]),_0x24563e['set'](_0x488acb,_0x2e31ae[_0x45bd76(0x1eb)]));}}async function createOrRecoverEmbeddedSegment(_0x37386b,_0xf4c6f8,_0x2daf10,_0x5610bc){const _0x31866b=a152_0xfcf5ee;let _0x501808;try{_0x501808=await _0x37386b[_0x31866b(0x210)][_0x31866b(0x28c)]({'name':_0x2daf10['uniqueSegmentName'],'description':_0x2daf10[_0x31866b(0x224)],'journeyId':_0x2daf10['journeyId'],'rule':_0x5610bc(_0x2daf10[_0x31866b(0x2aa)],!![]),'countPopulation':!![],'parentFolderId':_0x2daf10[_0x31866b(0x234)],'audienceId':_0x2daf10[_0x31866b(0x2bc)]});}catch(_0x1997d4){const _0x268d2a=_0x1997d4 instanceof Error&&_0x1997d4[_0x31866b(0x2a3)][_0x31866b(0x1e8)]('Name\x20has\x20already\x20been\x20taken');if(_0x268d2a){const _0x509df6=readPushRecovery(_0xf4c6f8[_0x31866b(0x2b8)]),_0x341c39=_0x509df6?.[_0x31866b(0x29f)]===_0xf4c6f8[_0x31866b(0x29e)][_0x31866b(0x228)]?_0x509df6[_0x31866b(0x21b)][_0x2daf10[_0x31866b(0x237)]]:undefined;if(_0x341c39?.[_0x31866b(0x23a)]===_0x2daf10['uniqueSegmentName'])await _0x37386b[_0x31866b(0x210)][_0x31866b(0x2da)](_0x2daf10[_0x31866b(0x2bc)],_0x341c39[_0x31866b(0x1eb)],{'description':_0x2daf10[_0x31866b(0x224)],'rule':_0x5610bc(_0x2daf10[_0x31866b(0x2aa)],!![]),'countPopulation':!![]}),_0x501808=_0x341c39[_0x31866b(0x1eb)];else throw new SDKError(ErrorCode[_0x31866b(0x1e5)],'Embedded\x20segment\x20\x27'+_0x2daf10['localName']+_0x31866b(0x2a0)+(_0x31866b(0x2d0)+_0xf4c6f8['absolutePath']['replace'](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x1997d4);}else throw _0x1997d4;}return saveSegmentToPushRecovery(_0xf4c6f8['absolutePath'],_0xf4c6f8['yamlConfig'][_0x31866b(0x228)],_0x2daf10['localName'],{'segmentId':_0x501808,'uniqueServerName':_0x2daf10[_0x31866b(0x253)],'createdAt':new Date()[_0x31866b(0x218)]()}),_0x501808;}export async function prepareSegmentFiles(_0x427ab6,_0x5b5065,_0x3c6e4b,_0x437e3b,_0x590e04){const _0x2cdf7a=a152_0xfcf5ee,{activationDefToCreateRequest:_0x5420fb}=await import(_0x2cdf7a(0x29c)),_0x45a86d=[],_0x4395c7=new Set();for(const {yamlConfig:_0x35488a,folderPath:_0x4533b4,sourcePath:_0x2a672c}of _0x427ab6){const _0x293ebb=resolveTDFolderPath(_0x4533b4,_0x437e3b,_0x590e04),_0x412253=_0x293ebb+':'+_0x35488a[_0x2cdf7a(0x228)],_0x26e433=_0x5b5065['segmentByFolderAndName'][_0x2cdf7a(0x29d)](_0x412253),_0x3ef61f=_0x26e433?_0x5b5065[_0x2cdf7a(0x1dd)][_0x2cdf7a(0x29d)](_0x26e433['id'])||[]:[];addFoldersToCreate(_0x293ebb,_0x5b5065[_0x2cdf7a(0x216)],_0x4395c7);const _0x2876bb=calculateActivationActions(_0x35488a[_0x2cdf7a(0x2c2)]||[],_0x3ef61f,_0x5b5065[_0x2cdf7a(0x239)],_0x5b5065[_0x2cdf7a(0x2bf)]);for(const _0x231332 of _0x2876bb){(_0x231332['type']===_0x2cdf7a(0x2ba)||_0x231332[_0x2cdf7a(0x287)]===_0x2cdf7a(0x238))&&_0x231332[_0x2cdf7a(0x295)]&&(_0x231332['validatedRequest']=await _0x5420fb(_0x231332[_0x2cdf7a(0x295)],_0x3c6e4b));}const _0x28a514=calculateSegmentDiff(_0x35488a,_0x26e433,_0x3ef61f,_0x5b5065[_0x2cdf7a(0x239)],_0x5b5065[_0x2cdf7a(0x2bf)]);_0x45a86d['push']({'relativePath':_0x35488a['name'],'absolutePath':_0x2a672c,'yamlConfig':_0x35488a,'folderPath':_0x293ebb,'existingSegment':_0x26e433,'existingActivations':_0x3ef61f,'isNew':_0x28a514['isNew'],'hasChanges':_0x28a514[_0x2cdf7a(0x2c6)],'diff':_0x28a514[_0x2cdf7a(0x2d5)],'activationActions':_0x2876bb});}return{'segmentFiles':_0x45a86d,'foldersToCreate':_0x4395c7};}export async function prepareJourneyFiles(_0x5cf0cf,_0x134df1,_0x347990,_0x24181e){const _0x381769=a152_0xfcf5ee,_0x33acb9=[],_0x643a04=new Set();for(const {yamlConfig:_0x2fb261,folderPath:_0x335091,sourcePath:_0x5daf0a}of _0x5cf0cf){const _0x32a67c=resolveTDFolderPath(_0x335091,_0x347990,_0x24181e),_0x56b33d=_0x32a67c+':'+_0x2fb261['name'],_0x583f0c=_0x134df1[_0x381769(0x206)][_0x381769(0x29d)](_0x56b33d);let _0x29ec97,_0x3ca754;if(_0x583f0c&&_0x583f0c[_0x381769(0x221)]>0x0){const _0x1c872d=buildLocalExpandedRuleMappings(_0x2fb261),{createYamlContext:_0x392f80,prefetchJourneySegments:_0x416fa1}=createPushYamlContextForBundle(_0x134df1['deps'],_0x134df1[_0x381769(0x2bc)],_0x134df1[_0x381769(0x2d6)],_0x1c872d,_0x134df1[_0x381769(0x239)],_0x134df1['connectionIdToNameMap'],_0x134df1[_0x381769(0x27e)],_0x134df1['journeyById']);await _0x416fa1(_0x583f0c['map'](_0x54b9c6=>_0x54b9c6['id']));const _0x5b87a3=await _0x134df1[_0x381769(0x245)][_0x381769(0x1ef)][_0x381769(0x1fa)](_0x583f0c[0x0][_0x381769(0x25c)]),_0xcb2d62=hasMultipleVersions(_0x2fb261),_0x3db100=async _0x22cd37=>{const _0x2d04cc=_0x381769,_0x2138e9=_0x134df1[_0x2d04cc(0x297)]?.['get'](_0x22cd37);if(_0x2138e9)return _0x2138e9;return _0x134df1[_0x2d04cc(0x26c)]({'journeyId':_0x22cd37,'journeyName':_0x2fb261[_0x2d04cc(0x228)],'isMultiVersion':_0x583f0c[_0x2d04cc(0x221)]>0x1});};if(_0xcb2d62&&_0x583f0c[_0x381769(0x221)]>0x1){const _0x23c70e=[];for(const _0x45c72d of _0x583f0c){const _0x1034b7=_0x45c72d[_0x381769(0x22a)]||0x1;_0x134df1[_0x381769(0x256)]?.[_0x381769(0x238)](_0x381769(0x20b)+_0x2fb261[_0x381769(0x228)]+'\x20v'+_0x1034b7);const _0x2917a5=await _0x3db100(_0x45c72d['id']),_0x1d2dee=_0x392f80(_0x45c72d['id']),_0x1f5611=await journeyResponseToDef(_0x2917a5,_0x1d2dee);_0x23c70e[_0x381769(0x272)]({'item':_0x45c72d,'yaml':_0x1f5611});}const _0x311cee=buildLocalRuleToNameMappingFromJourney(_0x2fb261);_0x3ca754=buildMergedJourneyDef(_0x23c70e,_0x311cee,_0x5b87a3);const _0x3d9aac=Math[_0x381769(0x1e7)](..._0x23c70e['map'](_0x496bd8=>_0x496bd8['item'][_0x381769(0x22a)]||0x0)),_0x4718d1=_0x583f0c[_0x381769(0x240)](_0x3710b9=>(_0x3710b9[_0x381769(0x22a)]||0x0)===_0x3d9aac);_0x4718d1&&(_0x134df1[_0x381769(0x256)]?.[_0x381769(0x238)](_0x381769(0x20b)+_0x2fb261[_0x381769(0x228)]+'\x20v'+_0x3d9aac),_0x29ec97=await _0x3db100(_0x4718d1['id']));}else{const _0x38cec6=_0x583f0c[_0x583f0c['length']-0x1];_0x134df1[_0x381769(0x256)]?.[_0x381769(0x238)](_0x381769(0x20b)+_0x2fb261[_0x381769(0x228)]),_0x29ec97=await _0x3db100(_0x38cec6['id']);const _0x46362f=_0x392f80(_0x38cec6['id']),_0x5d5cfb=await journeyResponseToDef(_0x29ec97,_0x46362f),_0x5c2f32=buildLocalRuleToNameMappingFromJourney(_0x2fb261);_0x3ca754=buildMergedJourneyDef([{'item':_0x38cec6,'yaml':_0x5d5cfb}],_0x5c2f32,_0x5b87a3);}}addFoldersToCreate(_0x32a67c,_0x134df1[_0x381769(0x216)],_0x643a04);const _0x1d7c76=calculateJourneyDiff(_0x2fb261,_0x3ca754);_0x33acb9[_0x381769(0x272)]({'relativePath':_0x2fb261[_0x381769(0x228)],'absolutePath':_0x5daf0a,'yamlConfig':_0x2fb261,'folderPath':_0x32a67c,'existingJourney':_0x29ec97,'isNew':_0x1d7c76['isNew'],'hasChanges':_0x1d7c76['hasChanges'],'diff':_0x1d7c76['diff']});}return{'journeyFiles':_0x33acb9,'foldersToCreate':_0x643a04};}export function calculateActivationActions(_0x2f45b9,_0x253529,_0x306d53,_0x2577dd){const _0x11f0ae=a152_0xfcf5ee,_0x5df51f=[],_0x1f78c7=new Map();for(const _0xd5ff3e of _0x253529){_0x1f78c7[_0x11f0ae(0x25b)](_0xd5ff3e['name'],_0xd5ff3e);}const _0x32be90=new Map();for(const _0x6b04fc of _0x2f45b9){_0x32be90[_0x11f0ae(0x25b)](_0x6b04fc[_0x11f0ae(0x228)],_0x6b04fc);}for(const _0x14e49b of _0x2f45b9){const _0x2e216d=_0x1f78c7['get'](_0x14e49b[_0x11f0ae(0x228)]);if(!_0x2e216d)_0x5df51f[_0x11f0ae(0x272)]({'type':'create','name':_0x14e49b[_0x11f0ae(0x228)],'yamlActivation':_0x14e49b});else{const _0x3f8cc4=activationResponseToDef(_0x2e216d,_0x306d53,_0x2577dd),_0x45de60=a152_0x13ed94[_0x11f0ae(0x1f7)](_0x3f8cc4),_0x37bf18=a152_0x13ed94[_0x11f0ae(0x1f7)](_0x14e49b);_0x45de60!==_0x37bf18&&_0x5df51f[_0x11f0ae(0x272)]({'type':_0x11f0ae(0x238),'name':_0x14e49b['name'],'yamlActivation':_0x14e49b,'existingActivation':_0x2e216d});}}for(const _0x4df1e9 of _0x253529){!_0x32be90[_0x11f0ae(0x283)](_0x4df1e9[_0x11f0ae(0x228)])&&_0x5df51f[_0x11f0ae(0x272)]({'type':_0x11f0ae(0x2c7),'name':_0x4df1e9[_0x11f0ae(0x228)],'existingActivation':_0x4df1e9});}return _0x5df51f;}function calculateYamlDiff(_0x19e942,_0x2fd6be){if(_0x2fd6be){const _0x3ad9de=generateDiff(_0x2fd6be,_0x19e942),_0x8eba1c=hasChanges(_0x3ad9de);return{'isNew':![],'hasChanges':_0x8eba1c,'diff':_0x8eba1c?formatDiffWithColors(_0x3ad9de):undefined};}const _0x2ecd53=generateDiff('',_0x19e942);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2ecd53)};}export function calculateSegmentDiff(_0x261032,_0x578733,_0x2cc445,_0x4b7b26,_0x1a8e06){const _0x576fb7=segmentToYamlString(_0x261032),_0x59b546=_0x578733?segmentToYamlString(segmentWithActivationsToYaml(_0x578733,_0x2cc445,undefined,_0x4b7b26,_0x1a8e06)):undefined;return calculateYamlDiff(_0x576fb7,_0x59b546);}export function calculateJourneyDiff(_0x2e7301,_0x554805){const _0x2b800c=normalizeJourneyDef(_0x2e7301,_0x2e7301),_0x46cb0f=a152_0x3cd3f6(_0x2b800c),_0x10ccb8=_0x554805?a152_0x3cd3f6(normalizeJourneyDef(_0x554805,_0x2e7301)):undefined;return calculateYamlDiff(_0x46cb0f,_0x10ccb8);}export function findSegmentsToDelete(_0x3469be,_0xb6ceee,_0x13eff8,_0x826213,_0x3cf05e){const _0x619fe8=a152_0xfcf5ee,_0x11eaf4=new Set();for(const {yamlConfig:_0x279a0a,folderPath:_0x558bca}of _0xb6ceee){_0x11eaf4['add'](_0x558bca+':'+_0x279a0a['name']);}return _0x3469be[_0x619fe8(0x263)](_0x352782=>{const _0x5c9ebb=_0x619fe8,_0x183b14=_0x352782[_0x5c9ebb(0x22f)]?_0x13eff8[_0x5c9ebb(0x29d)](_0x352782[_0x5c9ebb(0x22f)]['toString']())||'':'',_0x5ccdc1=_0x183b14+':'+_0x352782[_0x5c9ebb(0x228)];if(_0x11eaf4[_0x5c9ebb(0x283)](_0x5ccdc1))return![];if(_0x3cf05e)return _0x183b14===_0x826213||_0x183b14[_0x5c9ebb(0x257)](_0x826213+'/');return!![];});}export function findJourneysToDelete(_0x3a2e62,_0x1d76dc,_0x3e8a37,_0x26caff,_0xd0967a){const _0x2f3d96=a152_0xfcf5ee,_0x32e445=new Set();for(const {yamlConfig:_0x25aaa1,folderPath:_0x28d01c}of _0x1d76dc){_0x32e445[_0x2f3d96(0x231)](_0x28d01c+':'+_0x25aaa1[_0x2f3d96(0x228)]);}return _0x3a2e62['filter'](_0x524766=>{const _0x38ed68=_0x2f3d96,_0x4f8ecc=_0x524766[_0x38ed68(0x234)]?_0x3e8a37[_0x38ed68(0x29d)](_0x524766[_0x38ed68(0x234)])||'':'',_0x5c7e5d=_0x4f8ecc+':'+_0x524766[_0x38ed68(0x2d4)];if(_0x32e445[_0x38ed68(0x283)](_0x5c7e5d))return![];if(_0xd0967a)return _0x4f8ecc===_0x26caff||_0x4f8ecc[_0x38ed68(0x257)](_0x26caff+'/');return!![];});}export function buildSegmentLookupMap(_0x2feafb,_0x32f196){const _0x290d0f=a152_0xfcf5ee,_0x485c79=new Map();for(const _0x5e6d9e of _0x2feafb){const _0x2a5b8d=_0x5e6d9e[_0x290d0f(0x22f)]?_0x32f196['get'](_0x5e6d9e[_0x290d0f(0x22f)][_0x290d0f(0x249)]())||'':'',_0x2a5b76=_0x2a5b8d+':'+_0x5e6d9e[_0x290d0f(0x228)];_0x485c79['set'](_0x2a5b76,_0x5e6d9e);}return _0x485c79;}export function buildSegmentNameToIdMap(_0x124a87){const _0x25451b=a152_0xfcf5ee,_0x1501fb=new Map();for(const _0x2c28d5 of _0x124a87){_0x1501fb['set'](_0x2c28d5[_0x25451b(0x228)],_0x2c28d5['id']);}return _0x1501fb;}export function buildJourneyBundleLookupMap(_0x2c9eb7,_0x1742eb){const _0xa0ad86=a152_0xfcf5ee,_0x5c4687=new Map();for(const _0x278762 of _0x2c9eb7){const _0x5b1434=_0x278762[_0xa0ad86(0x234)]?_0x1742eb[_0xa0ad86(0x29d)](_0x278762[_0xa0ad86(0x234)])||'':'',_0x2f73d0=_0x5b1434+':'+_0x278762[_0xa0ad86(0x2d4)];!_0x5c4687[_0xa0ad86(0x283)](_0x2f73d0)&&_0x5c4687[_0xa0ad86(0x25b)](_0x2f73d0,[]),_0x5c4687[_0xa0ad86(0x29d)](_0x2f73d0)[_0xa0ad86(0x272)](_0x278762);}for(const _0x334b8f of _0x5c4687[_0xa0ad86(0x2ab)]()){_0x334b8f[_0xa0ad86(0x26f)]((_0x5ec7c3,_0x312bf0)=>(_0x5ec7c3[_0xa0ad86(0x22a)]||0x0)-(_0x312bf0[_0xa0ad86(0x22a)]||0x0));}return _0x5c4687;}export function collectFoldersToCreate(_0x4908bf,_0x1a28c9){const _0x2d5bac=a152_0xfcf5ee,_0x50dde2=new Set();for(const _0x380137 of _0x4908bf){if(!_0x380137)continue;if(_0x1a28c9[_0x2d5bac(0x283)](_0x380137))continue;const _0x5a2b74=_0x380137[_0x2d5bac(0x208)]('/');let _0x48f8cc='';for(const _0x26aada of _0x5a2b74){_0x48f8cc=_0x48f8cc?_0x48f8cc+'/'+_0x26aada:_0x26aada,!_0x1a28c9[_0x2d5bac(0x283)](_0x48f8cc)&&_0x50dde2[_0x2d5bac(0x231)](_0x48f8cc);}}return _0x50dde2;}export function parseAndClassifyYamlFiles(_0x169163,_0x585ec1,_0x812b5a){const _0x235632=a152_0xfcf5ee,_0x21236c=[],_0x62dd25=[];for(const _0x251bb7 of _0x169163){const _0x1ab21e=a152_0x4085cb[_0x235632(0x264)](_0x585ec1,a152_0x4085cb[_0x235632(0x2b2)](_0x251bb7)),_0x5538eb=_0x1ab21e==='.'?'':_0x1ab21e[_0x235632(0x2c1)](/\\/g,'/'),_0x48bd84=readFileSync(_0x251bb7,_0x235632(0x2ac)),_0x42a30d=a152_0x13ed94['parse'](_0x48bd84);if(isJourneyDef(_0x42a30d)){const _0x1a7d64=a152_0x1dedcf(_0x48bd84);_0x62dd25[_0x235632(0x272)]({'yamlConfig':_0x1a7d64,'folderPath':_0x5538eb,'sourcePath':_0x251bb7});}else{if(!_0x812b5a?.[_0x235632(0x2b4)]){const _0x28d770=parseSegmentYamlFile(_0x48bd84),_0x2e13c8=normalizeChildSegmentYaml(_0x28d770);_0x21236c[_0x235632(0x272)]({'yamlConfig':_0x2e13c8,'folderPath':_0x5538eb,'sourcePath':_0x251bb7});}}}return{'segments':_0x21236c,'journeys':_0x62dd25};}export function validateParsedFiles(_0x42f6ac,_0x5b8038){const _0x182d75=a152_0xfcf5ee,_0x363df7=[];for(const {yamlConfig:_0x66b281,sourcePath:_0x56c402}of _0x42f6ac['segments']){const _0x225f02=readFileSync(_0x56c402,_0x182d75(0x2ac)),_0x2ad7a0=a152_0x13ed94['parseDocument'](_0x225f02),_0x517482=validateSegmentDef(_0x66b281,{'source':_0x225f02,'document':_0x2ad7a0},{'skipSchema':!![]});if(!_0x517482[_0x182d75(0x2a6)]){const _0x566f5b=a152_0x4085cb[_0x182d75(0x264)](_0x5b8038,_0x56c402);_0x363df7[_0x182d75(0x272)]({'filePath':_0x566f5b,'source':_0x225f02,'result':_0x517482,'isJourney':![]});}}for(const {yamlConfig:_0xe64be8,sourcePath:_0x49ecbc}of _0x42f6ac[_0x182d75(0x230)]){const _0xc6d832=readFileSync(_0x49ecbc,'utf-8'),_0xe532e9=a152_0x13ed94[_0x182d75(0x1d8)](_0xc6d832),_0x471b0b=validateJourneyDef(_0xe64be8,{'source':_0xc6d832,'document':_0xe532e9},{'skipSchema':!![]});if(!_0x471b0b[_0x182d75(0x2a6)]){const _0xdd21b0=a152_0x4085cb[_0x182d75(0x264)](_0x5b8038,_0x49ecbc);_0x363df7[_0x182d75(0x272)]({'filePath':_0xdd21b0,'source':_0xc6d832,'result':_0x471b0b,'isJourney':!![]});}}return _0x363df7;}export function formatValidationErrors(_0x673f05){const _0x32a567=a152_0xfcf5ee,_0x411784=[];for(const {filePath:_0x23e038,source:_0xb2969e,result:_0x48a000,isJourney:_0x152332}of _0x673f05){const _0xa017a9=_0x152332?_0x32a567(0x1ef):_0x32a567(0x210);_0x411784[_0x32a567(0x272)]('\x0a'+_0x23e038+'\x20('+_0xa017a9+_0x32a567(0x200)+_0x48a000[_0x32a567(0x2be)][_0x32a567(0x221)]+_0x32a567(0x209)),_0x411784[_0x32a567(0x272)](formatValidationResult(_0x48a000,_0xb2969e,_0x23e038));}return _0x411784[_0x32a567(0x1fb)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2184c8){const _0x21ea13=a152_0xfcf5ee,_0x56f80c=new Set(),_0x1a4211=new Map(),_0x1c30ee=collectSegmentUsageCounts(_0x2184c8);if(_0x2184c8[_0x21ea13(0x21b)])for(const [_0x4fb848,_0x29235e]of Object[_0x21ea13(0x27f)](_0x2184c8[_0x21ea13(0x21b)])){_0x56f80c['add'](_0x4fb848);if(_0x29235e[_0x21ea13(0x278)]){const _0x4e53ec=yamlRuleToApi(_0x29235e[_0x21ea13(0x278)]),_0x1dec25=apiRuleToYaml(_0x4e53ec);_0x1a4211[_0x21ea13(0x25b)](_0x4fb848,_0x1dec25);}}const _0x43f8c4=new Map();let _0x1ff054=0x0;for(const [_0x5ba4dc,_0x250fbc]of _0x1a4211){const _0xb5c1e7=serializeExpandedRule(_0x250fbc,_0x1a4211),_0x4e0ea6=_0x43f8c4[_0x21ea13(0x29d)](_0xb5c1e7)||[];_0x4e0ea6[_0x21ea13(0x272)]({'name':_0x5ba4dc,'index':_0x1ff054}),_0x43f8c4[_0x21ea13(0x25b)](_0xb5c1e7,_0x4e0ea6),_0x1ff054++;}const _0x4e2688=new Map();for(const [_0x570bf5,_0x1c7204]of _0x43f8c4){const _0x5c21c5=_0x1c7204[_0x21ea13(0x299)]()['sort']((_0x101f6a,_0x1f5385)=>{const _0x1a3a31=_0x21ea13,_0x4cdcba=_0x1c30ee[_0x1a3a31(0x29d)](_0x101f6a['name'])||0x0,_0x4f3ddd=_0x1c30ee['get'](_0x1f5385['name'])||0x0;if(_0x4cdcba!==_0x4f3ddd)return _0x4f3ddd-_0x4cdcba;return _0x101f6a['index']-_0x1f5385['index'];})[_0x21ea13(0x232)](_0x152dd4=>_0x152dd4[_0x21ea13(0x228)]),_0xe25c9e=[];for(const _0x3ddae9 of _0x5c21c5){const _0x325573=_0x1c30ee['get'](_0x3ddae9)||0x0,_0x563132=Math[_0x21ea13(0x1e7)](_0x325573,0x1);for(let _0x4e7256=0x0;_0x4e7256<_0x563132;_0x4e7256++){_0xe25c9e[_0x21ea13(0x272)](_0x3ddae9);}}_0x4e2688[_0x21ea13(0x25b)](_0x570bf5,_0xe25c9e);}return{'existingLocalSegmentNames':_0x56f80c,'localSegmentRules':_0x1a4211,'localExpandedRuleToNames':_0x4e2688};}export function createSegmentIdResolver(_0x3f9d28,_0x1368cf){return async _0xfecc62=>{const _0x335c3c=a152_0x558f,_0x7b8243=_0x3f9d28[_0x335c3c(0x29d)](_0xfecc62);if(!_0x7b8243)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x335c3c(0x21e)+_0xfecc62+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x1368cf+'\x27)');return _0x7b8243;};}export function extractRootFolderId(_0x172c32){const _0x3c572e=a152_0xfcf5ee;return _0x172c32['relationships']?.[_0x3c572e(0x22b)]?.[_0x3c572e(0x227)]?.['id']||_0x172c32[_0x3c572e(0x1df)]?.[_0x3c572e(0x2ad)]?.[_0x3c572e(0x227)]?.['id'];}export function buildConnectionMaps(_0x5e1df3){const _0x1f94ce=a152_0xfcf5ee,_0x1272b2=new Map(),_0x131f3e=new Map(),_0x1529e5=new Map();for(const _0x2d7848 of _0x5e1df3){_0x1272b2[_0x1f94ce(0x25b)](_0x2d7848[_0x1f94ce(0x228)],parseInt(_0x2d7848['id'],0xa)),_0x131f3e[_0x1f94ce(0x25b)](_0x2d7848['id'],_0x2d7848[_0x1f94ce(0x228)]),_0x1529e5[_0x1f94ce(0x25b)](_0x2d7848[_0x1f94ce(0x228)],_0x2d7848[_0x1f94ce(0x287)]);}return{'nameToId':_0x1272b2,'idToName':_0x131f3e,'nameToType':_0x1529e5};}export function calculatePushStats(_0x5f2926,_0x3738cc,_0x51695e,_0x266a33,_0x2deb70,_0x3ccc97,_0x1d4794){const _0x5ed940=a152_0xfcf5ee,_0x1d43d9=_0x5f2926[_0x5ed940(0x263)](_0x5993b5=>_0x5993b5[_0x5ed940(0x201)]),_0x39c507=_0x5f2926[_0x5ed940(0x263)](_0x4d5575=>!_0x4d5575[_0x5ed940(0x201)]&&_0x4d5575[_0x5ed940(0x2c6)]),_0x55a56b=_0x5f2926[_0x5ed940(0x263)](_0x7fe8b2=>!_0x7fe8b2[_0x5ed940(0x201)]&&!_0x7fe8b2[_0x5ed940(0x2c6)]),_0x27ebaa=_0x3ccc97?_0x266a33:[],_0x368ff4=_0x3738cc['filter'](_0x280e37=>_0x280e37[_0x5ed940(0x201)]),_0x1a81f8=_0x3738cc[_0x5ed940(0x263)](_0x28ee87=>!_0x28ee87['isNew']&&_0x28ee87['hasChanges']),_0x2f4f1a=_0x3738cc[_0x5ed940(0x263)](_0x44dec4=>!_0x44dec4[_0x5ed940(0x201)]&&!_0x44dec4[_0x5ed940(0x2c6)]),_0x43f815=_0x3ccc97?_0x2deb70:[],_0x583620=_0x5f2926['flatMap'](_0x3e16ad=>_0x3e16ad['activationActions']),_0x274900=_0x583620[_0x5ed940(0x263)](_0x1919a8=>_0x1919a8[_0x5ed940(0x287)]===_0x5ed940(0x2ba)),_0x2d33a3=_0x583620[_0x5ed940(0x263)](_0x1875aa=>_0x1875aa[_0x5ed940(0x287)]===_0x5ed940(0x238)),_0x47606d=_0x583620[_0x5ed940(0x263)](_0x2b3188=>_0x2b3188[_0x5ed940(0x287)]===_0x5ed940(0x2c7)),_0x27d32d=Array[_0x5ed940(0x1fc)](_0x51695e)[_0x5ed940(0x26f)](),_0xb21e39=_0x1d4794?![]:_0x1d43d9['length']>0x0||_0x39c507[_0x5ed940(0x221)]>0x0||_0x27ebaa[_0x5ed940(0x221)]>0x0,_0x2b7396=_0x368ff4['length']>0x0||_0x1a81f8[_0x5ed940(0x221)]>0x0||_0x43f815[_0x5ed940(0x221)]>0x0,_0x2a86b7=_0x1d4794?![]:_0x583620['length']>0x0,_0x54ebd8=_0x27d32d[_0x5ed940(0x221)]>0x0;return{'segments':{'new':_0x1d43d9,'changed':_0x39c507,'unchanged':_0x55a56b,'toDelete':_0x27ebaa},'journeys':{'new':_0x368ff4,'changed':_0x1a81f8,'unchanged':_0x2f4f1a,'toDelete':_0x43f815},'activations':{'all':_0x583620,'toCreate':_0x274900,'toUpdate':_0x2d33a3,'toDelete':_0x47606d},'folders':{'toCreate':_0x27d32d},'counts':{'segments':{'new':_0x1d43d9['length'],'changed':_0x39c507[_0x5ed940(0x221)],'unchanged':_0x55a56b[_0x5ed940(0x221)],'toDelete':_0x27ebaa[_0x5ed940(0x221)]},'journeys':{'new':_0x368ff4['length'],'changed':_0x1a81f8[_0x5ed940(0x221)],'unchanged':_0x2f4f1a[_0x5ed940(0x221)],'toDelete':_0x43f815[_0x5ed940(0x221)]},'activations':{'create':_0x274900['length'],'update':_0x2d33a3['length'],'delete':_0x47606d['length']},'folders':_0x27d32d[_0x5ed940(0x221)]},'hasChanges':_0xb21e39||_0x2b7396||_0x2a86b7||_0x54ebd8};}export async function buildPushExecutionContext(_0x3688a7,_0x31c91f,_0x512f26,_0x21aff8,_0x1b83b7,_0x39dccc){const _0x2ca59d=a152_0xfcf5ee,_0x36ef80=extractRootFolderId(_0x512f26),{pathToId:_0xc67e3d,idToPath:_0xbbbb79}=buildFolderMaps(_0x1b83b7),_0x2160b5=buildSegmentNameToIdMap(_0x21aff8),_0x510f74=new Map(),{batchAsync:_0x2fc373}=await import(_0x2ca59d(0x23d)),[_0x550161,_0x391c62]=await Promise[_0x2ca59d(0x26d)]([_0x3688a7['user']['buildUserMaps'](),_0x3688a7['connection'][_0x2ca59d(0x203)](),((async()=>{const _0x1153c2=_0x2ca59d;!_0x39dccc&&_0x21aff8[_0x1153c2(0x221)]>0x0&&await _0x2fc373(_0x21aff8,async _0x2acc92=>{const _0x22214a=_0x1153c2,_0x23563b=await _0x3688a7[_0x22214a(0x210)][_0x22214a(0x21f)](_0x31c91f,_0x2acc92['id']);_0x510f74[_0x22214a(0x25b)](_0x2acc92['id'],_0x23563b);});})())]),{emailToId:_0xf25753,idToEmail:_0xbaf910}=_0x550161,_0x530e98=buildConnectionMaps(_0x391c62);return{'rootFolderId':_0x36ef80,'folderPathToId':_0xc67e3d,'folderIdToPath':_0xbbbb79,'segmentNameToId':_0x2160b5,'activationsBySegmentId':_0x510f74,'emailToIdMap':_0xf25753,'idToEmailMap':_0xbaf910,'connectionNameToIdMap':_0x530e98[_0x2ca59d(0x2c9)],'connectionIdToNameMap':_0x530e98[_0x2ca59d(0x296)],'connectionNameToTypeMap':_0x530e98[_0x2ca59d(0x1da)]};}export function createPushYamlContextForBundle(_0x196406,_0x4abf85,_0x22d25a,_0x6881d5,_0x2e531f,_0x36fe95,_0x261f56,_0x320a29){const {existingLocalSegmentNames:_0x595d1b,localExpandedRuleToNames:_0x17bf99}=_0x6881d5,_0x3ba238=new Set(),_0x2c31e3=new Map(),_0x1ba6c1=new Map(),_0x3392c9=new Map(),_0x15a1a6=createJumpTargetCache(),_0x59a389=new Map(),_0x33109a=new Map(),_0x14e1ed=new Set();let _0x3d4576;const _0x3e7ca2=_0x14b0b8=>{const _0x4f4fda={'resolveSegment':async _0x5c2663=>{const _0x4703ec=a152_0x558f,_0x4b15fa=_0x3392c9[_0x4703ec(0x29d)](_0x5c2663);if(_0x4b15fa!==undefined)return{'name':_0x4b15fa,'isJourneyLocal':!![]};try{const _0x49bd62=await fetchSegment(_0x196406,_0x4abf85,_0x5c2663,_0x22d25a);if(!_0x49bd62)throw new Error(_0x4703ec(0x1f6));const _0x35569a=generateJourneyLocalName(_0x49bd62[_0x4703ec(0x228)]),_0x4758e2=_0x49bd62[_0x4703ec(0x1ed)]===SEGMENT_KIND_JOURNEY&&_0x35569a!==undefined;let _0x4da4a4=_0x49bd62[_0x4703ec(0x228)],_0xaa1ea1;if(_0x4758e2&&_0x49bd62['rule']){const _0x436a7d=apiRuleToYaml(_0x49bd62[_0x4703ec(0x278)]);_0x33109a['set'](_0x5c2663,_0x436a7d);const _0xa1b56=async _0x4f30e7=>{const _0x2ed6a0=_0x4703ec,_0x55a409=collectSegmentRefsFromRule(_0x4f30e7);for(const _0x5e48a7 of _0x55a409){if(!_0x33109a[_0x2ed6a0(0x283)](_0x5e48a7))try{const _0x3a8b29=await fetchSegment(_0x196406,_0x4abf85,_0x5e48a7,_0x22d25a);if(_0x3a8b29?.[_0x2ed6a0(0x278)]){const _0x3beb10=apiRuleToYaml(_0x3a8b29[_0x2ed6a0(0x278)]);_0x33109a[_0x2ed6a0(0x25b)](_0x5e48a7,_0x3beb10),await _0xa1b56(_0x3beb10);}}catch(_0x3bf49a){logger[_0x2ed6a0(0x2cc)](_0x2ed6a0(0x266)+_0x5e48a7+':\x20'+_0x3bf49a);}}};await _0xa1b56(_0x436a7d);const _0x3a4a9c=serializeExpandedRule(_0x436a7d,_0x33109a),_0xfda448=_0x17bf99[_0x4703ec(0x29d)](_0x3a4a9c);if(_0xfda448&&_0xfda448[_0x4703ec(0x221)]>0x0){const _0x230b19=_0x2c31e3[_0x4703ec(0x29d)](_0x3a4a9c)||0x0,_0x188368=_0xfda448[_0x230b19]||_0xfda448[_0xfda448[_0x4703ec(0x221)]-0x1];_0x2c31e3[_0x4703ec(0x25b)](_0x3a4a9c,_0x230b19+0x1),_0x4da4a4=_0x188368,_0x3ba238[_0x4703ec(0x231)](_0x4da4a4),_0x3392c9['set'](_0x5c2663,_0x4da4a4);const _0x2a0e21=await resolveRuleSegmentRefs(_0x436a7d,async _0x170e0a=>{const _0x43cd9b=_0x4703ec,_0x3d19fe=_0x3392c9[_0x43cd9b(0x29d)](_0x170e0a);if(_0x3d19fe)return _0x3d19fe;const _0x11b3d4=await _0x3d4576[_0x43cd9b(0x242)](_0x170e0a);return _0x11b3d4[_0x43cd9b(0x228)];});_0xaa1ea1={'description':_0x49bd62[_0x4703ec(0x224)],'rule':_0x2a0e21};}else{const _0x48df4d=_0x59a389['get'](_0x3a4a9c);if(_0x48df4d)_0x4da4a4=_0x48df4d,_0x3392c9[_0x4703ec(0x25b)](_0x5c2663,_0x4da4a4);else{if(_0x35569a){let _0x4c4b4d=_0x35569a,_0x513ff4=0x2;while(_0x3ba238[_0x4703ec(0x283)](_0x4c4b4d)||_0x595d1b[_0x4703ec(0x283)](_0x4c4b4d)){_0x4c4b4d=_0x35569a+'_'+_0x513ff4,_0x513ff4++;}_0x3ba238[_0x4703ec(0x231)](_0x4c4b4d),_0x4da4a4=_0x4c4b4d;}_0x3392c9['set'](_0x5c2663,_0x4da4a4),_0x59a389[_0x4703ec(0x25b)](_0x3a4a9c,_0x4da4a4);const _0x13a7b3=await resolveRuleSegmentRefs(_0x436a7d,async _0x395b69=>{const _0x179d26=_0x4703ec,_0x3841af=_0x3392c9['get'](_0x395b69);if(_0x3841af)return _0x3841af;const _0x163b62=await _0x3d4576['resolveSegment'](_0x395b69);return _0x163b62[_0x179d26(0x228)];});_0xaa1ea1={'description':_0x49bd62[_0x4703ec(0x224)],'rule':_0x13a7b3};}}}return{'name':_0x4da4a4,'isJourneyLocal':_0x4758e2,'definition':_0xaa1ea1};}catch(_0x1734c5){return logger[_0x4703ec(0x2cc)]('Failed\x20to\x20resolve\x20segment\x20'+_0x5c2663+':\x20'+_0x1734c5),{'name':_0x5c2663,'isJourneyLocal':![]};}},'resolveActivation':async _0x3848e4=>{const _0x125de8=a152_0x558f,_0x354b99=_0x1ba6c1['get'](_0x3848e4);if(_0x354b99!==undefined)return{'name':_0x354b99,'isJourneyLocal':!![]};try{let _0x481cc8=_0x261f56?.[_0x125de8(0x29d)](_0x3848e4);!_0x481cc8&&(_0x481cc8=await _0x196406[_0x125de8(0x1ef)]['getActivation'](_0x14b0b8,_0x3848e4));const _0x43b748=_0x481cc8['attributes'][_0x125de8(0x1f1)][_0x125de8(0x228)]||_0x3848e4,_0x4e2181=sanitizeYamlKey(_0x43b748)||_0x125de8(0x284)+_0x3848e4,_0x731368=_0x4e2181;_0x1ba6c1[_0x125de8(0x25b)](_0x3848e4,_0x731368);const _0x20591f=journeyActivationStepToYaml(_0x481cc8,_0x2e531f,_0x36fe95);return{'name':_0x731368,'isJourneyLocal':!![],'definition':_0x20591f};}catch(_0x133440){return logger[_0x125de8(0x2cc)](_0x125de8(0x212)+_0x3848e4+':\x20'+_0x133440),{'name':_0x3848e4,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3d212d,_0x5805e)=>resolveJumpTarget(_0x3d212d,_0x5805e,_0x15a1a6,async _0x6c8d24=>{const _0x39adc3=a152_0x558f,_0x4cd3cc=_0x320a29?.[_0x39adc3(0x29d)](_0x6c8d24);if(_0x4cd3cc)return _0x4cd3cc;return _0x196406[_0x39adc3(0x1ef)]['getJourney'](_0x6c8d24);})};return _0x3d4576=_0x4f4fda,_0x4f4fda;},_0x20e878=async _0x200e01=>{const _0x7d0637=a152_0x558f,{collectSegmentIdsFromJourneyApi:_0x4b2036}=await import(_0x7d0637(0x25a)),{batchAsync:_0x27ca03}=await import('../../utils/async.js'),_0x10ba78=new Set();for(const _0x4e9c78 of _0x200e01){let _0x430bc2=_0x320a29?.[_0x7d0637(0x29d)](_0x4e9c78);!_0x430bc2&&(_0x430bc2=await _0x196406[_0x7d0637(0x1ef)]['getJourney'](_0x4e9c78));const _0x1a14a1=_0x4b2036(_0x430bc2);for(const _0x238983 of _0x1a14a1){_0x10ba78[_0x7d0637(0x231)](_0x238983);}}let _0x5d4c61=Array[_0x7d0637(0x1fc)](_0x10ba78);while(_0x5d4c61[_0x7d0637(0x221)]>0x0){const _0x13242c=_0x5d4c61['filter'](_0xd9bb37=>!_0x14e1ed[_0x7d0637(0x283)](_0xd9bb37));if(_0x13242c[_0x7d0637(0x221)]===0x0)break;const _0x158834=await _0x27ca03(_0x13242c,async _0xed6103=>{const _0x46a287=_0x7d0637;_0x14e1ed[_0x46a287(0x231)](_0xed6103);const _0x2bacff=await fetchSegment(_0x196406,_0x4abf85,_0xed6103,_0x22d25a);if(!_0x2bacff)return null;return{'segmentId':_0xed6103,'segment':_0x2bacff};},0xa),_0x3a03e2=new Set();for(const _0x3a2c9e of _0x158834){if(!_0x3a2c9e?.[_0x7d0637(0x210)]?.[_0x7d0637(0x278)])continue;const _0x66dade=apiRuleToYaml(_0x3a2c9e[_0x7d0637(0x210)][_0x7d0637(0x278)]);_0x33109a['set'](_0x3a2c9e[_0x7d0637(0x1eb)],_0x66dade);const _0x3499ab=collectSegmentRefsFromRule(_0x66dade);for(const _0x40a33b of _0x3499ab){!_0x14e1ed[_0x7d0637(0x283)](_0x40a33b)&&_0x3a03e2[_0x7d0637(0x231)](_0x40a33b);}}_0x5d4c61=Array[_0x7d0637(0x1fc)](_0x3a03e2);}};return{'createYamlContext':_0x3e7ca2,'prefetchJourneySegments':_0x20e878};}export async function executePushSegments(_0x48098e,_0x5ec59e,_0x5bac55,_0x2e4799,_0x3c4791){const _0x11ef36=a152_0xfcf5ee,{segmentDefToCreateRequest:_0x46660d,segmentDefToUpdateRequest:_0x4a23f8}=await import(_0x11ef36(0x29c)),_0x5b1292=_0x5bac55[_0x11ef36(0x216)],_0x236eaa=0x5,_0x995bfd=async _0x299db7=>{const _0x19890b=_0x11ef36,_0x275751=_0x299db7[_0x19890b(0x294)]?_0x5b1292['get'](_0x299db7[_0x19890b(0x294)]):undefined;let _0x1505aa;const _0x2d9a01={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x10b864=_0x299db7[_0x19890b(0x29e)];if(_0x299db7['yamlConfig'][_0x19890b(0x278)]){const _0x2b66b4=createSegmentIdResolver(_0x5bac55[_0x19890b(0x1e0)],_0x299db7['yamlConfig'][_0x19890b(0x228)]),_0x2636bf=await resolveRuleSegmentIds(_0x299db7[_0x19890b(0x29e)][_0x19890b(0x278)],_0x2b66b4);_0x10b864={..._0x299db7[_0x19890b(0x29e)],'rule':_0x2636bf};}try{if(_0x299db7[_0x19890b(0x201)]){_0x3c4791[_0x19890b(0x20e)]?.({'type':_0x19890b(0x25d),'name':_0x299db7['yamlConfig'][_0x19890b(0x228)]});const _0xec16c8=_0x46660d(_0x10b864,_0x275751),_0x4e8c59=await _0x3c4791[_0x19890b(0x2c5)](_0x19890b(0x2c0)+_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)]+_0x19890b(0x2ca),()=>_0x48098e[_0x19890b(0x210)][_0x19890b(0x247)](_0x2e4799['parentId'],_0xec16c8));_0x1505aa=_0x4e8c59[_0x19890b(0x227)]['id'],_0x5bac55[_0x19890b(0x1e0)][_0x19890b(0x25b)](_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)],_0x1505aa),_0x2d9a01[_0x19890b(0x255)]={'name':_0x299db7['yamlConfig'][_0x19890b(0x228)],'id':_0x1505aa},_0x3c4791[_0x19890b(0x20e)]?.({'type':_0x19890b(0x25e),'name':_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)],'segmentId':_0x1505aa}),_0x3c4791[_0x19890b(0x250)]?.(_0x19890b(0x1de)+_0x299db7[_0x19890b(0x29e)]['name']+'\x27'),_0x2d9a01[_0x19890b(0x28e)]=0x1;}else{if(_0x299db7[_0x19890b(0x2c6)]){_0x3c4791[_0x19890b(0x20e)]?.({'type':_0x19890b(0x23c),'name':_0x299db7[_0x19890b(0x29e)]['name']});const _0x47c9e0=_0x4a23f8(_0x10b864);_0x275751!==_0x299db7[_0x19890b(0x2af)]?.['segmentFolderId']&&(_0x47c9e0[_0x19890b(0x22f)]=_0x275751?parseInt(_0x275751,0xa):undefined),await _0x3c4791[_0x19890b(0x2c5)](_0x19890b(0x236)+_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)]+_0x19890b(0x2ca),()=>_0x48098e[_0x19890b(0x210)][_0x19890b(0x2da)](_0x2e4799[_0x19890b(0x2bc)],_0x299db7[_0x19890b(0x2af)]['id'],_0x47c9e0)),_0x1505aa=_0x299db7[_0x19890b(0x2af)]['id'],_0x3c4791[_0x19890b(0x20e)]?.({'type':'segment_updated','name':_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)]}),_0x3c4791[_0x19890b(0x250)]?.(_0x19890b(0x2a2)+_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)]+'\x27'),_0x2d9a01[_0x19890b(0x2dc)]=0x1;}else _0x1505aa=_0x299db7[_0x19890b(0x2af)]['id'];}}catch(_0x1268b7){const _0x3e1315=isHttp400Error(_0x1268b7),_0x56bb8f=_0x3e1315?ErrorCode[_0x19890b(0x267)]:ErrorCode[_0x19890b(0x1e5)],_0x47972d=getErrorMessage(_0x1268b7);throw new SDKError(_0x56bb8f,_0x19890b(0x281)+(_0x299db7['isNew']?_0x19890b(0x2ba):_0x19890b(0x238))+_0x19890b(0x293)+_0x299db7[_0x19890b(0x2b8)]+_0x19890b(0x1db)+_0x47972d,_0x1268b7);}try{const _0xb792e5=await syncActivationsForSegment(_0x48098e,_0x2e4799['parentId'],_0x1505aa,_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)],_0x299db7[_0x19890b(0x22e)],_0x3c4791,_0x299db7[_0x19890b(0x2b8)]);_0x2d9a01[_0x19890b(0x2c2)]=_0xb792e5;}catch(_0x9df35a){if(_0x9df35a instanceof SDKError)throw _0x9df35a;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x19890b(0x225)+_0x299db7[_0x19890b(0x29e)][_0x19890b(0x228)]+'\x27\x20from\x20file:\x20'+_0x299db7[_0x19890b(0x2b8)]+_0x19890b(0x1db)+getErrorMessage(_0x9df35a),_0x9df35a);}return _0x2d9a01;},_0xa17a55=await batchAsync(_0x5ec59e,_0x995bfd,_0x236eaa),_0x59d42d={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x21cdea of _0xa17a55){_0x59d42d['created']+=_0x21cdea[_0x11ef36(0x28e)],_0x59d42d[_0x11ef36(0x2dc)]+=_0x21cdea[_0x11ef36(0x2dc)],_0x21cdea[_0x11ef36(0x255)]&&_0x59d42d[_0x11ef36(0x252)][_0x11ef36(0x25b)](_0x21cdea[_0x11ef36(0x255)][_0x11ef36(0x228)],_0x21cdea[_0x11ef36(0x255)]['id']),_0x59d42d[_0x11ef36(0x2c2)]['created']+=_0x21cdea[_0x11ef36(0x2c2)][_0x11ef36(0x28e)],_0x59d42d[_0x11ef36(0x2c2)][_0x11ef36(0x2dc)]+=_0x21cdea[_0x11ef36(0x2c2)][_0x11ef36(0x2dc)],_0x59d42d[_0x11ef36(0x2c2)]['deleted']+=_0x21cdea['activations'][_0x11ef36(0x26b)];}return _0x59d42d;}async function syncActivationsForSegment(_0x1005cb,_0x33e7ce,_0x9c531c,_0x3c884e,_0x734894,_0x425042,_0x366124){const _0x404ee5=a152_0xfcf5ee,_0x227f2d={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x232b14 of _0x734894){try{if(_0x232b14[_0x404ee5(0x287)]==='create'&&_0x232b14[_0x404ee5(0x2cd)])_0x425042[_0x404ee5(0x20e)]?.({'type':_0x404ee5(0x20c),'segmentName':_0x3c884e,'activationName':_0x232b14['name']}),await _0x425042['withProgress'](_0x404ee5(0x1e9)+_0x232b14[_0x404ee5(0x228)]+_0x404ee5(0x2ca),()=>_0x1005cb[_0x404ee5(0x210)]['createActivation'](_0x33e7ce,_0x9c531c,_0x232b14[_0x404ee5(0x2cd)])),_0x425042[_0x404ee5(0x20e)]?.({'type':_0x404ee5(0x286),'segmentName':_0x3c884e,'activationName':_0x232b14[_0x404ee5(0x228)]}),_0x425042[_0x404ee5(0x250)]?.('Created\x20activation\x20\x27'+_0x232b14['name']+'\x27'),_0x227f2d[_0x404ee5(0x28e)]++;else{if(_0x232b14[_0x404ee5(0x287)]===_0x404ee5(0x238)&&_0x232b14[_0x404ee5(0x2cd)]&&_0x232b14[_0x404ee5(0x220)])_0x425042['onProgress']?.({'type':'activation_updating','segmentName':_0x3c884e,'activationName':_0x232b14[_0x404ee5(0x228)]}),await _0x425042[_0x404ee5(0x2c5)](_0x404ee5(0x274)+_0x232b14[_0x404ee5(0x228)]+_0x404ee5(0x2ca),()=>_0x1005cb['segment'][_0x404ee5(0x20a)](_0x33e7ce,_0x9c531c,_0x232b14[_0x404ee5(0x220)]['id'],_0x232b14[_0x404ee5(0x2cd)])),_0x425042[_0x404ee5(0x20e)]?.({'type':_0x404ee5(0x277),'segmentName':_0x3c884e,'activationName':_0x232b14[_0x404ee5(0x228)]}),_0x425042[_0x404ee5(0x250)]?.('Updated\x20activation\x20\x27'+_0x232b14[_0x404ee5(0x228)]+'\x27'),_0x227f2d['updated']++;else _0x232b14['type']===_0x404ee5(0x2c7)&&_0x232b14[_0x404ee5(0x220)]&&(_0x425042[_0x404ee5(0x20e)]?.({'type':_0x404ee5(0x26e),'segmentName':_0x3c884e,'activationName':_0x232b14[_0x404ee5(0x228)]}),await _0x425042[_0x404ee5(0x2c5)]('Deleting\x20activation\x20\x27'+_0x232b14[_0x404ee5(0x228)]+_0x404ee5(0x2ca),()=>_0x1005cb['segment'][_0x404ee5(0x2de)](_0x33e7ce,_0x9c531c,_0x232b14[_0x404ee5(0x220)]['id'])),_0x425042['onProgress']?.({'type':'activation_deleted','segmentName':_0x3c884e,'activationName':_0x232b14[_0x404ee5(0x228)]}),_0x425042[_0x404ee5(0x2d2)]?.(_0x404ee5(0x292)+_0x232b14['name']+'\x27'),_0x227f2d[_0x404ee5(0x26b)]++);}}catch(_0x1df12d){const _0x243f72=isHttp400Error(_0x1df12d),_0x58883c=_0x243f72?ErrorCode[_0x404ee5(0x1e3)]:ErrorCode[_0x404ee5(0x1ea)],_0x2484ce=getErrorMessage(_0x1df12d);throw new SDKError(_0x58883c,'Failed\x20to\x20'+_0x232b14[_0x404ee5(0x287)]+_0x404ee5(0x233)+_0x232b14[_0x404ee5(0x228)]+_0x404ee5(0x214)+_0x366124+'\x0a\x20\x20'+_0x2484ce,_0x1df12d);}}return _0x227f2d;}export async function executePushFolders(_0xaf549f,_0x19f8c9,_0x5c4385,_0x19b89e,_0x41cfa0){const _0x47ecf3=a152_0xfcf5ee,_0xe2ce3f=new Map(_0x5c4385),_0xfafd8b=sortFoldersByDepth(_0x19f8c9);for(const _0xcc6967 of _0xfafd8b){const _0xedc532=_0xcc6967[_0x47ecf3(0x208)]('/'),_0x5d85ce=_0xedc532[_0xedc532[_0x47ecf3(0x221)]-0x1],_0xc6c405=_0xedc532[_0x47ecf3(0x299)](0x0,-0x1)[_0x47ecf3(0x1fb)]('/'),_0x4dd107=_0xe2ce3f['get'](_0xc6c405);_0x41cfa0[_0x47ecf3(0x20e)]?.({'type':_0x47ecf3(0x1f2),'folder':_0xcc6967});const _0x151338={'name':_0x5d85ce,'parentFolderId':_0x4dd107},_0x319ab3=await _0x41cfa0[_0x47ecf3(0x2c5)](_0x47ecf3(0x2a9)+_0xcc6967+_0x47ecf3(0x2ca),()=>_0xaf549f['segment']['createFolder'](_0x19b89e['parentId'],_0x151338));_0xe2ce3f[_0x47ecf3(0x25b)](_0xcc6967,_0x319ab3[_0x47ecf3(0x227)]['id']),_0x41cfa0[_0x47ecf3(0x20e)]?.({'type':'folder_created','folder':_0xcc6967,'folderId':_0x319ab3[_0x47ecf3(0x227)]['id']}),_0x41cfa0[_0x47ecf3(0x258)]?.(_0x47ecf3(0x1e2)+_0xcc6967+'\x27');}return _0xe2ce3f;}export async function executePushSegmentDeletions(_0x2956a9,_0x243c7c,_0x47e8a0){const _0x566bee=a152_0xfcf5ee;if(_0x243c7c['length']===0x0)return 0x0;const {batchAsync:_0x3a68d2}=await import(_0x566bee(0x23d)),_0x5f1e5e=0x5,_0xc46570=await _0x3a68d2(_0x243c7c,async _0x28763b=>{const _0x5ac78e=_0x566bee;return _0x47e8a0[_0x5ac78e(0x20e)]?.({'type':_0x5ac78e(0x2a1),'name':_0x28763b[_0x5ac78e(0x228)]}),await _0x2956a9['segment'][_0x5ac78e(0x22c)](_0x28763b['id']),_0x47e8a0[_0x5ac78e(0x20e)]?.({'type':_0x5ac78e(0x2bd),'name':_0x28763b[_0x5ac78e(0x228)]}),_0x47e8a0['logDeleted']?.(_0x5ac78e(0x2a5)+_0x28763b['name']+'\x27'),0x1;},_0x5f1e5e);return _0xc46570[_0x566bee(0x27a)]((_0x2f889a,_0x3f33f3)=>_0x2f889a+_0x3f33f3,0x0);}export async function executePushJourneys(_0x3c3388,_0x1a7832,_0x4a64f4,_0x36f317,_0x184109){const _0x5cf60e=a152_0xfcf5ee,{journeyDefToRequest:_0x39b388}=await import(_0x5cf60e(0x25a)),{activationDefToCreateRequest:_0x42ab69,yamlRuleToApi:_0x44d394,validateSegmentRule:_0x3218a4}=await import(_0x5cf60e(0x29c)),_0x4c8d2b={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1b086e=new Map(_0x4a64f4[_0x5cf60e(0x1e0)]),_0x3da2b1=0x5;for(let _0x15bd8e=0x0;_0x15bd8e<_0x1a7832[_0x5cf60e(0x221)];_0x15bd8e+=_0x3da2b1){const _0x173e79=_0x1a7832[_0x5cf60e(0x299)](_0x15bd8e,_0x15bd8e+_0x3da2b1),_0x4e918c=await Promise[_0x5cf60e(0x26d)](_0x173e79['map'](async _0x299fa1=>{const _0x44a907=_0x5cf60e;if(!_0x299fa1[_0x44a907(0x201)]&&!_0x299fa1[_0x44a907(0x2c6)])return{'action':_0x44a907(0x1fd),'name':_0x299fa1[_0x44a907(0x29e)][_0x44a907(0x228)],'journeyId':_0x299fa1[_0x44a907(0x2d8)]?.['id']};const _0x271167=_0x299fa1[_0x44a907(0x294)]?_0x4a64f4['folderPathToId'][_0x44a907(0x29d)](_0x299fa1[_0x44a907(0x294)]):undefined;_0x184109[_0x44a907(0x20e)]?.({'type':_0x299fa1['isNew']?_0x44a907(0x1ff):_0x44a907(0x2a4),'name':_0x299fa1[_0x44a907(0x29e)][_0x44a907(0x228)]});try{const _0xf3d0c8=await executeSingleJourneyPush(_0x3c3388,_0x299fa1,{..._0x4a64f4,'segmentNameToId':_0x1b086e},{'parentId':_0x36f317[_0x44a907(0x2bc)],'rootFolderId':_0x36f317[_0x44a907(0x207)],'folderId':_0x271167,'verbose':_0x36f317[_0x44a907(0x22d)]},_0x184109,{'journeyDefToRequest':_0x39b388,'activationDefToCreateRequest':_0x42ab69,'yamlRuleToApi':_0x44d394,'validateSegmentRule':_0x3218a4});for(const [_0x52c47a,_0x1c2fe5]of _0xf3d0c8[_0x44a907(0x219)]){_0x1b086e[_0x44a907(0x25b)](_0x52c47a,_0x1c2fe5),_0x4c8d2b[_0x44a907(0x219)][_0x44a907(0x25b)](_0x52c47a,_0x1c2fe5);}if(_0xf3d0c8[_0x44a907(0x25f)]===_0x44a907(0x28e))_0x184109['onProgress']?.({'type':_0x44a907(0x1e6),'name':_0x299fa1['yamlConfig'][_0x44a907(0x228)],'journeyId':_0xf3d0c8['journeyId']}),_0x184109[_0x44a907(0x250)]?.('Created\x20journey\x20\x27'+_0x299fa1[_0x44a907(0x29e)][_0x44a907(0x228)]+'\x27'),_0x4c8d2b[_0x44a907(0x28e)]++;else _0xf3d0c8['action']==='updated'&&(_0x184109['onProgress']?.({'type':'journey_updated','name':_0x299fa1[_0x44a907(0x29e)][_0x44a907(0x228)]}),_0x184109['logSuccess']?.(_0x44a907(0x2cb)+_0x299fa1[_0x44a907(0x29e)][_0x44a907(0x228)]+'\x27'),_0x4c8d2b[_0x44a907(0x2dc)]++);return{'action':_0xf3d0c8[_0x44a907(0x25f)],'name':_0x299fa1['yamlConfig']['name'],'journeyId':_0xf3d0c8[_0x44a907(0x280)]};}catch(_0x17c59b){const _0x18da2d=isHttp400Error(_0x17c59b),_0x4b3a22=_0x18da2d?ErrorCode[_0x44a907(0x2b1)]:ErrorCode[_0x44a907(0x2b6)],_0xdb04e8=getErrorMessage(_0x17c59b);throw new SDKError(_0x4b3a22,_0x44a907(0x281)+(_0x299fa1[_0x44a907(0x201)]?_0x44a907(0x2ba):_0x44a907(0x238))+_0x44a907(0x223)+_0x299fa1[_0x44a907(0x2b8)]+_0x44a907(0x1db)+_0xdb04e8,_0x17c59b);}}));_0x4c8d2b[_0x5cf60e(0x2b5)]['push'](..._0x4e918c);}return _0x4c8d2b;}function a152_0x2821(){const _0x5a33a5=['startsWith','logInfo','keys','./journey-yaml.js','set','journeyBundleId','segment_creating','segment_created','action','journey_entry_criteria_','embedded_activation_creating','logWarning','filter','relative','folder','Failed\x20to\x20fetch\x20referenced\x20segment\x20','SEGMENT_SYNTAX_ERROR','getSegment\x20failed\x20for\x20','stage\x20\x27','goal','deleted','fetchJourney','all','activation_deleting','sort','\x20(referenced\x20in\x20journey\x20','all_columns','push','12521570oSHSFg','Updating\x20activation\x20\x27','104rGlIOc','\x27\x20for\x20','activation_updated','rule','WaitStep','reduce','\x27\x20decision\x20point\x20branch\x20\x27',').\x20','Condition','activationStepsById','entries','journeyId','Failed\x20to\x20','entry','has','activation_','waitStepUnit','activation_created','type','__pending_act_','state','\x27\x20wait\x20condition','run_after_journey_refresh','createJourneySegment','Journey\x20\x27','created','hex','4lZrETA','Stage\x20\x27','Deleted\x20activation\x20\x27','\x20segment\x20from\x20file:\x20','folderPath','yamlActivation','idToName','journeyById','10003oxAyxZ','slice','some','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','./child-segment-yaml.js','get','yamlConfig','journeyName','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','segment_deleting','Updated\x20segment\x20\x27','message','journey_updating','Deleted\x20segment\x20\x27','valid','exitCriterias','708678ihOYwn','Creating\x20folder\x20\x27','resolvedRule','values','utf-8','parentFolder','376302TWorwo','existingSegment','1629122oRiTny','JOURNEY_SYNTAX_ERROR','dirname','connection','skipSegments','results','JOURNEY_UPDATE_ERROR','journeyStages','absolutePath','entryCriteria','create','attributes','parentId','segment_deleted','errors','connectionIdToNameMap','Creating\x20segment\x20\x27','replace','activations','behavior','effectiveFolderId','withProgress','hasChanges','delete','3954zPcJwy','nameToId','\x27...','Updated\x20journey\x20\x27','debug','validatedRequest','activationContext','draft','Delete\x20the\x20push\x20recovery\x20file\x20(',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','logDeleted','\x27\x20by\x20rule\x20content','journeyBundleName','diff','existingSegments','steps','existingJourney','columns','updateSegmentById','conditionTimeoutDuration','updated','conditions','deleteActivation','parseDocument','schedule','nameToType','\x0a\x20\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','activationsBySegmentId','Created\x20segment\x20\x27','relationships','segmentNameToId','waitStepType','Created\x20folder\x20\x27','ACTIVATION_SYNTAX_ERROR','Matched\x20server\x20segment\x20\x27','SEGMENT_UPDATE_ERROR','journey_created','max','includes','Creating\x20activation\x20\x27','ACTIVATION_UPDATE_ERROR','segmentId','connector_config','kind','parse','journey','journeyActivationNameToId','activationParams','folder_creating','decision_point','activation_template_id','entry_criteria','Segment\x20not\x20found','stringify','Entry\x20criteria:\x20','object','getLatestJourneyId','join','from','unchanged','INTERNAL','journey_creating','):\x20','isNew','\x27\x20entry\x20criteria','list','593CMAptw','142htcWtE','journeyBundlesByFolderAndName','rootFolderId','split','\x20error(s)','updateActivation','Fetching\x20','activation_creating','toLowerCase','onProgress','match','segment','size','Failed\x20to\x20resolve\x20activation\x20','isArray','\x27\x20from\x20file:\x20','journeyActivationStepId','folderPathToId','getSegmentEntity','toISOString','embeddedSegmentNameToId','Activation','segments','sha1','NOT_FOUND','Segment\x20not\x20found:\x20','listActivations','existingActivation','length','embedded_segment_created','\x20journey\x20from\x20file:\x20','description','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','conditionTimeoutUnit','data','name','waitStep','versionNumber','parentSegmentFolder','deleteSegment','verbose','activationActions','segmentFolderId','journeys','add','map','\x20activation\x20\x27','folderId','\x27\x20to\x20local\x20\x27','Updating\x20segment\x20\x27','localName','update','idToEmailMap','uniqueServerName','getJourney','segment_updating','../../utils/async.js','branches','DecisionPoint','find','Activation\x20not\x20found:\x20','resolveSegment','132FSisfZ','SEGMENT_NOT_FOUND','deps','conditionSegmentId','createSegment','null','toString','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','createActivation','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Duration','milestone','stages','logSuccess','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','createdSegmentIds','uniqueSegmentName','8712745HfpQMg','createdSegmentId','progress'];a152_0x2821=function(){return _0x5a33a5;};return a152_0x2821();}async function matchExistingJourneySegments(_0x2f8670,_0x1dc256,_0x15154f,_0x2da0ae,_0x36c25a){const _0x1c3d70=a152_0xfcf5ee;if(!_0x1dc256[_0x1c3d70(0x2d8)]||!_0x1dc256[_0x1c3d70(0x29e)][_0x1c3d70(0x21b)])return;const _0xafaa2f=new Map(),_0x2f16a0=new Set();for(const _0x479073 of Object[_0x1c3d70(0x259)](_0x1dc256[_0x1c3d70(0x29e)][_0x1c3d70(0x21b)])){const _0xb3646b=generateDeterministicJourneySegmentName(_0x1dc256[_0x1c3d70(0x29e)][_0x1c3d70(0x228)],_0x479073);_0xafaa2f['set'](_0xb3646b,_0x479073),_0x2f16a0[_0x1c3d70(0x231)](_0x479073);}const _0x535d51=[],_0x1cd723=collectSegmentIdsFromJourneyApi(_0x1dc256[_0x1c3d70(0x2d8)]);for(const _0x2fa81c of _0x1cd723){const _0x13e7ed=await fetchSegment(_0x2f8670,_0x15154f,_0x2fa81c,_0x2da0ae);if(!_0x13e7ed?.[_0x1c3d70(0x228)])continue;const _0x1a5f56=_0xafaa2f['get'](_0x13e7ed[_0x1c3d70(0x228)]);_0x1a5f56?(_0x36c25a[_0x1c3d70(0x25b)](_0x1a5f56,_0x2fa81c),_0x2f16a0[_0x1c3d70(0x2c7)](_0x1a5f56)):_0x535d51[_0x1c3d70(0x272)]({'id':_0x2fa81c,'seg':_0x13e7ed});}if(_0x2f16a0[_0x1c3d70(0x211)]>0x0&&_0x535d51['length']>0x0){const {localExpandedRuleToNames:_0x569b22}=buildLocalExpandedRuleMappings(_0x1dc256[_0x1c3d70(0x29e)]),_0x47c591=new Map();for(const {id:_0x429907,seg:_0x5c75d7}of _0x535d51){if(_0x5c75d7[_0x1c3d70(0x278)]){const _0x3313c7=apiRuleToYaml(_0x5c75d7[_0x1c3d70(0x278)]);_0x47c591[_0x1c3d70(0x25b)](_0x429907,_0x3313c7);}}for(const {id:_0x4d9041,seg:_0x49c0c0}of _0x535d51){if(!_0x49c0c0[_0x1c3d70(0x278)])continue;const _0x24cfa2=_0x47c591[_0x1c3d70(0x29d)](_0x4d9041);if(!_0x24cfa2)continue;const _0x5714e4=serializeExpandedRule(_0x24cfa2,_0x47c591),_0x379cfd=_0x569b22['get'](_0x5714e4);if(_0x379cfd){const _0x45adfe=_0x379cfd[_0x1c3d70(0x240)](_0x158214=>_0x2f16a0[_0x1c3d70(0x283)](_0x158214));_0x45adfe&&(_0x36c25a[_0x1c3d70(0x25b)](_0x45adfe,_0x4d9041),_0x2f16a0['delete'](_0x45adfe),logger[_0x1c3d70(0x2cc)](_0x1c3d70(0x1e4)+_0x49c0c0[_0x1c3d70(0x228)]+_0x1c3d70(0x235)+_0x45adfe+_0x1c3d70(0x2d3)));}}}}async function executeSingleJourneyPush(_0x3d63e2,_0x4b7f73,_0x34fdc0,_0xebc06f,_0x3964cc,_0x548429){const _0x5b6ca1=a152_0xfcf5ee,{journeyDefToRequest:_0x1c9166,activationDefToCreateRequest:_0x322b6c,yamlRuleToApi:_0x14473a,validateSegmentRule:_0x25b43e}=_0x548429,_0x4efa2f=new Map(),_0x10df48=new Map();recoverSegmentIdsFromPushRecovery(_0x4b7f73,_0x4efa2f,_0x34fdc0[_0x5b6ca1(0x1e0)]);const _0xc50bf5=new Map(),_0x2fb2b4=new Map(),_0x3767b6=new Map();let _0x3afbed;const _0x2b1b07=async()=>{const _0x1bf767=_0x5b6ca1;if(_0x3afbed)return;_0x3afbed=new Map();if(!_0x4b7f73['existingJourney'])return;const _0x42d193=await _0x3d63e2[_0x1bf767(0x1ef)][_0x1bf767(0x21f)](_0x4b7f73[_0x1bf767(0x2d8)]['id']);for(const _0x462cd0 of _0x42d193){const _0x3854c0=journeyActivationStepToYaml(_0x462cd0,_0x34fdc0[_0x1bf767(0x239)],_0x34fdc0['connectionIdToNameMap']),_0x48826b=activationSignature(_0x3854c0);!_0x3afbed[_0x1bf767(0x283)](_0x48826b)&&_0x3afbed[_0x1bf767(0x25b)](_0x48826b,_0x462cd0['id']),_0x3854c0[_0x1bf767(0x228)]&&_0x10df48[_0x1bf767(0x25b)](_0x3854c0[_0x1bf767(0x228)],_0x462cd0['id']);}};await matchExistingJourneySegments(_0x3d63e2,_0x4b7f73,_0xebc06f[_0x5b6ca1(0x2bc)],_0x34fdc0['existingSegments'],_0x34fdc0[_0x5b6ca1(0x1e0)]);const _0x59f123={'resolveSegmentId':async _0x2979a8=>{const _0xd94c62=_0x5b6ca1,_0x16df86=_0x34fdc0[_0xd94c62(0x1e0)][_0xd94c62(0x29d)](_0x2979a8);if(!_0x16df86)throw new SDKError(ErrorCode[_0xd94c62(0x244)],_0xd94c62(0x21e)+_0x2979a8+_0xd94c62(0x270)+_0x4b7f73[_0xd94c62(0x29e)][_0xd94c62(0x228)]+')');return _0x16df86;},'resolveEmbeddedSegmentId':async(_0x173571,_0x4ec2be)=>{const _0x599d87=_0x5b6ca1,_0x5181be=_0x34fdc0[_0x599d87(0x1e0)][_0x599d87(0x29d)](_0x173571);if(_0x5181be)return _0x5181be;const _0xd26448=_0x34fdc0[_0x599d87(0x2d6)][_0x599d87(0x240)](_0x5d58dd=>_0x5d58dd[_0x599d87(0x228)]===_0x173571);if(_0xd26448)return _0x34fdc0[_0x599d87(0x1e0)][_0x599d87(0x25b)](_0x173571,_0xd26448['id']),_0xd26448['id'];if(_0x4b7f73[_0x599d87(0x201)]){const {stageName:_0x4071b7,criteriaName:_0x1848aa}=findSegmentCriteriaLocation(_0x4b7f73[_0x599d87(0x29e)],_0x173571);return _0x25b43e(_0x173571,_0x4ec2be[_0x599d87(0x278)]),_0x2fb2b4[_0x599d87(0x25b)](_0x173571,{'definition':_0x4ec2be,'stageName':_0x4071b7,'criteriaName':_0x1848aa}),createPendingSegmentId(_0x173571);}const _0x4bb6e3=_0x4b7f73[_0x599d87(0x2d8)]?.['id'];if(!_0x4bb6e3)throw new SDKError(ErrorCode[_0x599d87(0x1fe)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0xf9adb0=_0xc50bf5[_0x599d87(0x29d)](_0x173571);if(_0xf9adb0)return _0xf9adb0;const _0x101a44=((async()=>{const _0x46aa15=_0x599d87;_0x25b43e(_0x173571,_0x4ec2be[_0x46aa15(0x278)]);const _0x14544d=generateDeterministicJourneySegmentName(_0x4b7f73['yamlConfig'][_0x46aa15(0x228)],_0x173571),_0xd812b0=_0x34fdc0[_0x46aa15(0x2d6)][_0x46aa15(0x240)](_0x28dc79=>_0x28dc79['name']===_0x14544d),_0x53b5d9=createSegmentIdResolver(_0x34fdc0[_0x46aa15(0x1e0)],_0x173571),_0x155028=await resolveRuleSegmentIds(_0x4ec2be[_0x46aa15(0x278)],_0x53b5d9);let _0x592ba4;return _0xd812b0?(await _0x3d63e2[_0x46aa15(0x210)]['updateSegmentById'](_0xebc06f[_0x46aa15(0x2bc)],_0xd812b0['id'],{'description':_0x4ec2be[_0x46aa15(0x224)]||_0x46aa15(0x1f8)+_0x173571,'rule':_0x14473a(_0x155028),'countPopulation':!![]}),_0x592ba4=_0xd812b0['id'],saveSegmentToPushRecovery(_0x4b7f73[_0x46aa15(0x2b8)],_0x4b7f73['yamlConfig'][_0x46aa15(0x228)],_0x173571,{'segmentId':_0x592ba4,'uniqueServerName':_0x14544d,'createdAt':new Date()[_0x46aa15(0x218)]()})):_0x592ba4=await createOrRecoverEmbeddedSegment(_0x3d63e2,_0x4b7f73,{'localName':_0x173571,'uniqueSegmentName':_0x14544d,'description':_0x4ec2be[_0x46aa15(0x224)]||'Entry\x20criteria:\x20'+_0x173571,'journeyId':_0x4bb6e3,'resolvedRule':_0x155028,'parentId':_0xebc06f['parentId'],'folderId':_0xebc06f[_0x46aa15(0x207)]||''},_0x14473a),_0x34fdc0[_0x46aa15(0x1e0)][_0x46aa15(0x25b)](_0x173571,_0x592ba4),_0x4efa2f[_0x46aa15(0x25b)](_0x173571,_0x592ba4),_0x592ba4;})());_0xc50bf5[_0x599d87(0x25b)](_0x173571,_0x101a44);try{return await _0x101a44;}finally{_0xc50bf5[_0x599d87(0x2c7)](_0x173571);}},'resolveActivationId':async _0x839431=>{const _0x28890c=_0x5b6ca1,_0x476b01=_0x10df48[_0x28890c(0x29d)](_0x839431);if(_0x476b01)return _0x476b01;if(_0x4b7f73[_0x28890c(0x2d8)]){await _0x2b1b07();const _0x42fffd=_0x10df48[_0x28890c(0x29d)](_0x839431);if(_0x42fffd)return _0x42fffd;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x28890c(0x241)+_0x839431+'\x20(referenced\x20in\x20journey\x20'+_0x4b7f73[_0x28890c(0x29e)][_0x28890c(0x228)]+_0x28890c(0x27c)+_0x28890c(0x251));},'resolveEmbeddedActivationId':async(_0x3d77b8,_0x5e64f6)=>{const _0x2a674c=_0x5b6ca1,_0x130ad0=_0x10df48['get'](_0x3d77b8);if(_0x130ad0)return _0x130ad0;if(_0x4b7f73[_0x2a674c(0x201)])return _0x3767b6['set'](_0x3d77b8,_0x5e64f6),createPendingActivationId(_0x3d77b8);if(_0x4b7f73[_0x2a674c(0x2d8)]){await _0x2b1b07();const _0x2e181d=_0x10df48[_0x2a674c(0x29d)](_0x5e64f6[_0x2a674c(0x228)]);if(_0x2e181d)return _0x10df48['set'](_0x3d77b8,_0x2e181d),_0x2e181d;const _0x118e65=activationSignature(_0x5e64f6),_0x1d2386=_0x3afbed?.[_0x2a674c(0x29d)](_0x118e65);if(_0x1d2386)return _0x10df48[_0x2a674c(0x25b)](_0x3d77b8,_0x1d2386),_0x1d2386;const _0x357359=await _0x322b6c(_0x5e64f6,_0x34fdc0[_0x2a674c(0x2ce)]),_0x441893={..._0x357359,..._0x5e64f6[_0x2a674c(0x28b)]!==undefined&&{'runAfterJourneyRefresh':_0x5e64f6['run_after_journey_refresh']}},_0x24628d=await _0x3d63e2[_0x2a674c(0x1ef)][_0x2a674c(0x24b)](_0x4b7f73[_0x2a674c(0x2d8)]['id'],_0x441893);return _0x10df48[_0x2a674c(0x25b)](_0x3d77b8,_0x24628d['id']),_0x24628d['id'];}throw new SDKError(ErrorCode[_0x2a674c(0x1fe)],_0x2a674c(0x24a));},'resolveJourneyId':async _0xe6adc1=>{const _0xe5db8e=_0x5b6ca1;try{return await _0x3d63e2['journey']['resolveJourneyId'](_0xebc06f[_0xe5db8e(0x2bc)],_0xe6adc1);}catch(_0x570757){throw new SDKError(ErrorCode['NOT_FOUND'],_0xe5db8e(0x28d)+_0xe6adc1+_0xe5db8e(0x24c)+_0x4b7f73['yamlConfig'][_0xe5db8e(0x228)]+'\x27)',_0x570757);}},'resolveStageId':async(_0x4cd150,_0x448a98)=>{const _0x25ecc0=_0x5b6ca1,_0x27f783=await _0x3d63e2[_0x25ecc0(0x1ef)][_0x25ecc0(0x23b)](_0x4cd150),_0x493870=_0x27f783[_0x25ecc0(0x2bb)][_0x25ecc0(0x2b7)][_0x25ecc0(0x240)](_0x3c6e5f=>_0x3c6e5f[_0x25ecc0(0x228)][_0x25ecc0(0x20d)]()===_0x448a98[_0x25ecc0(0x20d)]());if(!_0x493870?.['id'])throw new SDKError(ErrorCode[_0x25ecc0(0x21d)],_0x25ecc0(0x291)+_0x448a98+_0x25ecc0(0x1dc)+(_0x27f783['attributes'][_0x25ecc0(0x2d4)]||_0x27f783[_0x25ecc0(0x2bb)][_0x25ecc0(0x228)])+'\x27');return _0x493870['id'];}},_0xa930b8=await _0x1c9166(_0x4b7f73[_0x5b6ca1(0x29e)],_0xebc06f[_0x5b6ca1(0x2bc)],_0x59f123),_0x3c51ef=_0xebc06f[_0x5b6ca1(0x234)]||_0xebc06f[_0x5b6ca1(0x207)];_0x3c51ef&&(_0xa930b8[_0x5b6ca1(0x1df)]={'parentFolder':{'data':{'id':_0x3c51ef,'type':_0x5b6ca1(0x265)}}});if(_0x4b7f73['isNew']){if(_0x2fb2b4['size']>0x0||_0x3767b6['size']>0x0)return await executeThreeStepJourneyCreate(_0x3d63e2,_0x4b7f73,_0xa930b8,{'pendingEmbeddedSegments':_0x2fb2b4,'pendingEmbeddedActivations':_0x3767b6,'embeddedSegmentNameToId':_0x4efa2f,'journeyActivationNameToId':_0x10df48},{..._0xebc06f,'effectiveFolderId':_0x3c51ef},_0x34fdc0,_0x3964cc,_0x548429);else{ensureJourneyDefaults(_0xa930b8[_0x5b6ca1(0x2bb)]);const _0x1c301a=await _0x3d63e2['journey'][_0x5b6ca1(0x2ba)](_0xa930b8);return deletePushRecovery(_0x4b7f73[_0x5b6ca1(0x2b8)]),{'action':_0x5b6ca1(0x28e),'journeyId':_0x1c301a['id'],'embeddedSegmentNameToId':_0x4efa2f};}}else{if(_0x4b7f73[_0x5b6ca1(0x2c6)]&&_0x4b7f73['existingJourney']){_0xa930b8['id']=_0x4b7f73['existingJourney']['id'];const _0x45fd9b=_0xa930b8[_0x5b6ca1(0x2bb)];_0x4b7f73['existingJourney'][_0x5b6ca1(0x2bb)]?.[_0x5b6ca1(0x2d4)]&&(_0x45fd9b[_0x5b6ca1(0x2d4)]=_0x4b7f73['existingJourney']['attributes'][_0x5b6ca1(0x2d4)]);const _0x588001=_0x4b7f73[_0x5b6ca1(0x2d8)][_0x5b6ca1(0x2bb)]?.['journeyStages'];return _0x588001&&_0xa930b8[_0x5b6ca1(0x2bb)][_0x5b6ca1(0x2b7)]&&injectExistingStageIds(_0xa930b8[_0x5b6ca1(0x2bb)][_0x5b6ca1(0x2b7)],_0x588001),ensureJourneyDefaults(_0x45fd9b),await _0x3d63e2['journey']['update'](_0x4b7f73[_0x5b6ca1(0x2d8)]['id'],_0xa930b8),deletePushRecovery(_0x4b7f73['absolutePath']),{'action':'updated','journeyId':_0x4b7f73[_0x5b6ca1(0x2d8)]['id'],'embeddedSegmentNameToId':_0x4efa2f};}}return deletePushRecovery(_0x4b7f73[_0x5b6ca1(0x2b8)]),{'action':_0x5b6ca1(0x1fd),'journeyId':_0x4b7f73[_0x5b6ca1(0x2d8)]?.['id'],'embeddedSegmentNameToId':_0x4efa2f};}function findSegmentCriteriaLocation(_0x2d2279,_0x16e83b){const _0x30be87=a152_0xfcf5ee,_0xca94bf=_0x2d2279[_0x30be87(0x24f)]||_0x2d2279['journeys']?.[0x0]?.[_0x30be87(0x24f)]||[];let _0x5d364d=_0x30be87(0x282),_0x595545=_0x16e83b;const _0x4496b1=_0x2d2279[_0x30be87(0x26a)]||_0x2d2279[_0x30be87(0x230)]?.[0x0]?.[_0x30be87(0x26a)];if(_0x4496b1?.[_0x30be87(0x210)]===_0x16e83b)return{'stageName':_0x30be87(0x26a),'criteriaName':_0x4496b1['name']||_0x16e83b};_0x4cadb8:for(const _0x3a7d9b of _0xca94bf){if(_0x3a7d9b[_0x30be87(0x1f5)]?.[_0x30be87(0x210)]===_0x16e83b){_0x5d364d=_0x3a7d9b[_0x30be87(0x228)],_0x595545=_0x3a7d9b[_0x30be87(0x1f5)]['name']||_0x16e83b;break;}if(_0x3a7d9b[_0x30be87(0x2d7)])for(const _0x3f12bb of _0x3a7d9b[_0x30be87(0x2d7)]){if(_0x3f12bb[_0x30be87(0x287)]===_0x30be87(0x1f3)&&_0x3f12bb['with']?.[_0x30be87(0x23e)])for(const _0x18f54c of _0x3f12bb['with'][_0x30be87(0x23e)]){if(_0x18f54c[_0x30be87(0x210)]===_0x16e83b){_0x5d364d=_0x3a7d9b[_0x30be87(0x228)],_0x595545=_0x18f54c[_0x30be87(0x228)]||_0x16e83b;break _0x4cadb8;}}}}return{'stageName':_0x5d364d,'criteriaName':_0x595545};}async function executeThreeStepJourneyCreate(_0x200019,_0x3600a2,_0x31e2db,_0x572c6c,_0x4894d5,_0x45e2fc,_0x2b3b8b,_0x2f40e7){const _0x1a36b2=a152_0xfcf5ee,{activationDefToCreateRequest:_0x97caaf,yamlRuleToApi:_0x17bc8b}=_0x2f40e7,{pendingEmbeddedSegments:_0x33e35a,pendingEmbeddedActivations:_0x119dcb,embeddedSegmentNameToId:_0x39a764}=_0x572c6c,_0x348be7=JSON[_0x1a36b2(0x1ee)](JSON['stringify'](_0x31e2db));ensureJourneyDefaults(_0x348be7['attributes']),stripPendingIds(_0x348be7);const _0x16c674=await _0x200019[_0x1a36b2(0x1ef)][_0x1a36b2(0x2ba)](_0x348be7),_0x480225=_0x16c674['id'],_0x4773e4=new Map();for(const _0x129d2a of _0x16c674[_0x1a36b2(0x2bb)][_0x1a36b2(0x2b7)]){_0x4773e4['set'](_0x129d2a[_0x1a36b2(0x228)][_0x1a36b2(0x20d)](),_0x129d2a['id']);}recoverSegmentIdsFromPushRecovery(_0x3600a2,_0x39a764,_0x45e2fc['segmentNameToId']);for(const [_0x1275de,{definition:_0x1422e4}]of _0x33e35a){if(_0x39a764['has'](_0x1275de)){_0x2b3b8b[_0x1a36b2(0x20e)]?.({'type':_0x1a36b2(0x222),'journeyName':_0x3600a2[_0x1a36b2(0x29e)][_0x1a36b2(0x228)],'segmentName':_0x1275de});continue;}const _0x419829=generateDeterministicJourneySegmentName(_0x3600a2[_0x1a36b2(0x29e)][_0x1a36b2(0x228)],_0x1275de);_0x2b3b8b[_0x1a36b2(0x20e)]?.({'type':'embedded_segment_creating','journeyName':_0x3600a2[_0x1a36b2(0x29e)][_0x1a36b2(0x228)],'segmentName':_0x1275de});const _0x1ab0d5=createSegmentIdResolver(_0x45e2fc[_0x1a36b2(0x1e0)],_0x1275de),_0x2e1578=await resolveRuleSegmentIds(_0x1422e4[_0x1a36b2(0x278)],_0x1ab0d5),_0x3e50ec=await createOrRecoverEmbeddedSegment(_0x200019,_0x3600a2,{'localName':_0x1275de,'uniqueSegmentName':_0x419829,'description':_0x1422e4['description']||'Entry\x20criteria:\x20'+_0x1275de,'journeyId':_0x480225,'resolvedRule':_0x2e1578,'parentId':_0x4894d5[_0x1a36b2(0x2bc)],'folderId':_0x4894d5[_0x1a36b2(0x2c4)]||''},_0x17bc8b);_0x39a764[_0x1a36b2(0x25b)](_0x1275de,_0x3e50ec),_0x45e2fc[_0x1a36b2(0x1e0)][_0x1a36b2(0x25b)](_0x1275de,_0x3e50ec),_0x2b3b8b[_0x1a36b2(0x20e)]?.({'type':_0x1a36b2(0x222),'journeyName':_0x3600a2[_0x1a36b2(0x29e)][_0x1a36b2(0x228)],'segmentName':_0x1275de});}const _0x14a126=new Map();for(const [_0x215c20,_0x557f17]of _0x119dcb){_0x2b3b8b[_0x1a36b2(0x20e)]?.({'type':_0x1a36b2(0x261),'journeyName':_0x3600a2[_0x1a36b2(0x29e)]['name'],'activationName':_0x215c20});const _0x37e59c=await _0x97caaf(_0x557f17,_0x45e2fc[_0x1a36b2(0x2ce)]),_0x29c954={..._0x37e59c,..._0x557f17[_0x1a36b2(0x28b)]!==undefined&&{'runAfterJourneyRefresh':_0x557f17[_0x1a36b2(0x28b)]}},_0x481dbd=await _0x200019['journey'][_0x1a36b2(0x24b)](_0x480225,_0x29c954);_0x14a126[_0x1a36b2(0x25b)](_0x215c20,_0x481dbd['id']),_0x572c6c[_0x1a36b2(0x1f0)][_0x1a36b2(0x25b)](_0x215c20,_0x481dbd['id']),_0x2b3b8b['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x3600a2[_0x1a36b2(0x29e)][_0x1a36b2(0x228)],'activationName':_0x215c20});}const _0x51c08a=JSON[_0x1a36b2(0x1ee)](JSON['stringify'](_0x31e2db));return _0x51c08a['id']=_0x480225,ensureJourneyDefaults(_0x51c08a[_0x1a36b2(0x2bb)]),resolvePendingIdsInRequest(_0x51c08a,_0x31e2db,_0x4773e4,_0x39a764,_0x14a126,_0x2b3b8b),await _0x200019['journey'][_0x1a36b2(0x238)](_0x480225,_0x51c08a),deletePushRecovery(_0x3600a2['absolutePath']),{'action':_0x1a36b2(0x28e),'journeyId':_0x480225,'embeddedSegmentNameToId':_0x39a764};}export function stripWaitStepPendingIds(_0x920cc){const _0x2bf0fc=a152_0xfcf5ee,_0x5e28f5=_0x920cc[_0x2bf0fc(0x246)]&&isPendingSegmentId(_0x920cc['conditionSegmentId']),_0x1e49f9=_0x920cc[_0x2bf0fc(0x2dd)]?.[_0x2bf0fc(0x29a)](_0x12e913=>_0x12e913['segmentId']&&isPendingSegmentId(_0x12e913[_0x2bf0fc(0x1eb)]));(_0x5e28f5||_0x1e49f9)&&(_0x920cc[_0x2bf0fc(0x1e1)]=_0x2bf0fc(0x24d),_0x920cc['waitStep']=0x1,_0x920cc[_0x2bf0fc(0x285)]='day',delete _0x920cc[_0x2bf0fc(0x246)],delete _0x920cc[_0x2bf0fc(0x2db)],delete _0x920cc[_0x2bf0fc(0x226)],delete _0x920cc[_0x2bf0fc(0x2dd)]);}export function resolveWaitStepPendingIds(_0x39ecdb,_0x17a2d1,_0x438afa,_0x183951){const _0x541c10=a152_0xfcf5ee;if(_0x17a2d1[_0x541c10(0x246)]&&isPendingSegmentId(_0x17a2d1['conditionSegmentId'])){const _0x417657=_0x438afa(_0x17a2d1[_0x541c10(0x246)],_0x541c10(0x269)+_0x183951+'\x27\x20wait\x20condition');_0x417657&&(_0x39ecdb[_0x541c10(0x1e1)]=_0x541c10(0x27d),_0x39ecdb[_0x541c10(0x246)]=_0x417657,delete _0x39ecdb['waitStep'],delete _0x39ecdb[_0x541c10(0x285)],_0x17a2d1[_0x541c10(0x2db)]!==undefined&&(_0x39ecdb[_0x541c10(0x2db)]=_0x17a2d1[_0x541c10(0x2db)]),_0x17a2d1[_0x541c10(0x226)]&&(_0x39ecdb[_0x541c10(0x226)]=_0x17a2d1['conditionTimeoutUnit']));}if(_0x17a2d1[_0x541c10(0x2dd)]){const _0xc24851=_0x17a2d1[_0x541c10(0x2dd)][_0x541c10(0x29a)](_0x4cb1a6=>_0x4cb1a6[_0x541c10(0x1eb)]&&isPendingSegmentId(_0x4cb1a6[_0x541c10(0x1eb)]));if(_0xc24851){const _0x1f1e36=_0x17a2d1[_0x541c10(0x2dd)][_0x541c10(0x232)](_0x1be101=>{const _0x1a2d04=_0x541c10;if(_0x1be101[_0x1a2d04(0x1eb)]&&isPendingSegmentId(_0x1be101[_0x1a2d04(0x1eb)])){const _0x4485aa=_0x438afa(_0x1be101[_0x1a2d04(0x1eb)],'stage\x20\x27'+_0x183951+_0x1a2d04(0x28a));return{..._0x1be101,'segmentId':_0x4485aa||_0x1be101[_0x1a2d04(0x1eb)]};}return{..._0x1be101};});_0x39ecdb[_0x541c10(0x1e1)]=_0x541c10(0x27d),_0x39ecdb[_0x541c10(0x2dd)]=_0x1f1e36,delete _0x39ecdb[_0x541c10(0x229)],delete _0x39ecdb['waitStepUnit'],delete _0x39ecdb['conditionSegmentId'],delete _0x39ecdb[_0x541c10(0x2db)],delete _0x39ecdb['conditionTimeoutUnit'];}}}function stripPendingIds(_0x20eb0c){const _0x3692cd=a152_0xfcf5ee;_0x20eb0c[_0x3692cd(0x2bb)]['goal']?.[_0x3692cd(0x1eb)]&&isPendingSegmentId(_0x20eb0c['attributes'][_0x3692cd(0x26a)][_0x3692cd(0x1eb)])&&delete _0x20eb0c['attributes'][_0x3692cd(0x26a)];for(const _0x3d9121 of _0x20eb0c[_0x3692cd(0x2bb)][_0x3692cd(0x2b7)]||[]){_0x3d9121[_0x3692cd(0x2b9)]?.['segmentId']&&isPendingSegmentId(_0x3d9121[_0x3692cd(0x2b9)]['segmentId'])&&delete _0x3d9121[_0x3692cd(0x2b9)];_0x3d9121[_0x3692cd(0x24e)]?.[_0x3692cd(0x1eb)]&&isPendingSegmentId(_0x3d9121['milestone'][_0x3692cd(0x1eb)])&&delete _0x3d9121['milestone'];_0x3d9121[_0x3692cd(0x2a7)]&&(_0x3d9121['exitCriterias']=_0x3d9121[_0x3692cd(0x2a7)][_0x3692cd(0x263)](_0x9d6aae=>!_0x9d6aae[_0x3692cd(0x1eb)]||!isPendingSegmentId(_0x9d6aae[_0x3692cd(0x1eb)])));if(_0x3d9121[_0x3692cd(0x2d7)])for(const _0xa33cb6 of Object[_0x3692cd(0x259)](_0x3d9121[_0x3692cd(0x2d7)])){const _0x4aee00=_0x3d9121['steps'][_0xa33cb6];_0x4aee00['type']===_0x3692cd(0x21a)&&_0x4aee00[_0x3692cd(0x215)]&&isPendingActivationId(_0x4aee00[_0x3692cd(0x215)])&&(_0x4aee00[_0x3692cd(0x215)]='');if(_0x4aee00[_0x3692cd(0x287)]===_0x3692cd(0x23f)&&_0x4aee00[_0x3692cd(0x23e)])for(const _0x27488b of _0x4aee00[_0x3692cd(0x23e)]){_0x27488b[_0x3692cd(0x1eb)]&&isPendingSegmentId(_0x27488b[_0x3692cd(0x1eb)])&&(_0x27488b['segmentId']='');}_0x4aee00[_0x3692cd(0x287)]===_0x3692cd(0x279)&&stripWaitStepPendingIds(_0x4aee00);}}}function resolvePendingIdsInRequest(_0x1193e9,_0x3d5f99,_0x4d26bd,_0x17b037,_0x3919a4,_0x136d04){const _0x215e12=a152_0xfcf5ee,_0x5dc05c=(_0x49588d,_0x4d61d6)=>{const _0x46827d=a152_0x558f;if(!isPendingSegmentId(_0x49588d))return _0x49588d;const _0x2c6e6c=extractPendingSegmentName(_0x49588d),_0x252609=_0x17b037['get'](_0x2c6e6c);return!_0x252609&&_0x136d04[_0x46827d(0x262)]?.(_0x46827d(0x29b)+_0x2c6e6c+_0x46827d(0x276)+_0x4d61d6),_0x252609;};if(_0x1193e9[_0x215e12(0x2bb)][_0x215e12(0x26a)]?.['segmentId']&&isPendingSegmentId(_0x1193e9[_0x215e12(0x2bb)][_0x215e12(0x26a)][_0x215e12(0x1eb)])){const _0x51e42c=_0x5dc05c(_0x1193e9[_0x215e12(0x2bb)][_0x215e12(0x26a)][_0x215e12(0x1eb)],'goal\x20criteria');_0x51e42c&&(_0x1193e9[_0x215e12(0x2bb)][_0x215e12(0x26a)][_0x215e12(0x1eb)]=_0x51e42c);}for(const _0x2315f1 of _0x1193e9['attributes'][_0x215e12(0x2b7)]||[]){const _0x23d671=_0x4d26bd[_0x215e12(0x29d)](_0x2315f1[_0x215e12(0x228)]['toLowerCase']());_0x23d671&&(_0x2315f1['id']=_0x23d671);if(_0x2315f1[_0x215e12(0x2b9)]?.[_0x215e12(0x1eb)]&&isPendingSegmentId(_0x2315f1[_0x215e12(0x2b9)][_0x215e12(0x1eb)])){const _0x4d2e1c=_0x5dc05c(_0x2315f1['entryCriteria'][_0x215e12(0x1eb)],_0x215e12(0x269)+_0x2315f1[_0x215e12(0x228)]+_0x215e12(0x202));_0x4d2e1c&&(_0x2315f1[_0x215e12(0x2b9)][_0x215e12(0x1eb)]=_0x4d2e1c);}if(_0x2315f1[_0x215e12(0x2a7)])for(const _0x49cc03 of _0x2315f1[_0x215e12(0x2a7)]){if(_0x49cc03['segmentId']&&isPendingSegmentId(_0x49cc03[_0x215e12(0x1eb)])){const _0xba5da4=_0x5dc05c(_0x49cc03['segmentId'],_0x215e12(0x269)+_0x2315f1['name']+'\x27\x20exit\x20criteria');_0xba5da4&&(_0x49cc03[_0x215e12(0x1eb)]=_0xba5da4);}}if(_0x2315f1[_0x215e12(0x24e)]?.[_0x215e12(0x1eb)]&&isPendingSegmentId(_0x2315f1[_0x215e12(0x24e)][_0x215e12(0x1eb)])){const _0x3e43d9=_0x5dc05c(_0x2315f1[_0x215e12(0x24e)][_0x215e12(0x1eb)],_0x215e12(0x269)+_0x2315f1['name']+'\x27\x20milestone');_0x3e43d9&&(_0x2315f1['milestone']['segmentId']=_0x3e43d9);}if(_0x2315f1[_0x215e12(0x2d7)]){const _0x36451f=_0x251f27=>_0x3d5f99[_0x215e12(0x2bb)]['journeyStages']?.[_0x215e12(0x240)](_0x4a0eea=>_0x4a0eea[_0x215e12(0x228)][_0x215e12(0x20d)]()===_0x2315f1[_0x215e12(0x228)]['toLowerCase']())?.[_0x215e12(0x2d7)]?.[_0x251f27];for(const _0x2ba0d8 of Object[_0x215e12(0x259)](_0x2315f1['steps'])){const _0xbfa900=_0x2315f1[_0x215e12(0x2d7)][_0x2ba0d8],_0x1358a7=_0x36451f(_0x2ba0d8);if(_0xbfa900[_0x215e12(0x287)]===_0x215e12(0x21a)&&_0xbfa900['journeyActivationStepId']&&(isPendingActivationId(_0xbfa900['journeyActivationStepId'])||_0xbfa900['journeyActivationStepId']==='')){if(_0x1358a7?.['journeyActivationStepId']&&isPendingActivationId(_0x1358a7[_0x215e12(0x215)])){const _0x4b1cd8=extractPendingActivationName(_0x1358a7[_0x215e12(0x215)]),_0x406f00=_0x3919a4[_0x215e12(0x29d)](_0x4b1cd8);_0x406f00&&(_0xbfa900['journeyActivationStepId']=_0x406f00);}}if(_0xbfa900[_0x215e12(0x287)]==='DecisionPoint'&&_0xbfa900[_0x215e12(0x23e)]&&_0x1358a7?.[_0x215e12(0x23e)])for(let _0x16b9c5=0x0;_0x16b9c5<_0xbfa900[_0x215e12(0x23e)][_0x215e12(0x221)];_0x16b9c5++){const _0x12b3e1=_0xbfa900[_0x215e12(0x23e)][_0x16b9c5],_0xbcfc1c=_0x1358a7[_0x215e12(0x23e)][_0x16b9c5];if(_0xbcfc1c?.['segmentId']&&isPendingSegmentId(_0xbcfc1c[_0x215e12(0x1eb)])){const _0x1f71bd=_0x5dc05c(_0xbcfc1c['segmentId'],'stage\x20\x27'+_0x2315f1['name']+_0x215e12(0x27b)+(_0x12b3e1[_0x215e12(0x228)]||_0x16b9c5)+'\x27');_0x1f71bd&&(_0x12b3e1[_0x215e12(0x1eb)]=_0x1f71bd);}}_0xbfa900[_0x215e12(0x287)]===_0x215e12(0x279)&&_0x1358a7?.[_0x215e12(0x287)]===_0x215e12(0x279)&&resolveWaitStepPendingIds(_0xbfa900,_0x1358a7,_0x5dc05c,_0x2315f1[_0x215e12(0x228)]);}}}}
1
+ const a152_0x17e28a=a152_0x2b62;(function(_0x404b16,_0x558802){const _0x206a0e=a152_0x2b62,_0xf283d5=_0x404b16();while(!![]){try{const _0x5d039c=-parseInt(_0x206a0e(0x1dd))/0x1*(parseInt(_0x206a0e(0x217))/0x2)+-parseInt(_0x206a0e(0x25e))/0x3*(-parseInt(_0x206a0e(0x22f))/0x4)+-parseInt(_0x206a0e(0x26d))/0x5*(-parseInt(_0x206a0e(0x1e5))/0x6)+parseInt(_0x206a0e(0x219))/0x7*(parseInt(_0x206a0e(0x1e2))/0x8)+-parseInt(_0x206a0e(0x23a))/0x9*(-parseInt(_0x206a0e(0x1e4))/0xa)+-parseInt(_0x206a0e(0x24d))/0xb*(-parseInt(_0x206a0e(0x224))/0xc)+parseInt(_0x206a0e(0x290))/0xd*(-parseInt(_0x206a0e(0x1f0))/0xe);if(_0x5d039c===_0x558802)break;else _0xf283d5['push'](_0xf283d5['shift']());}catch(_0x4d44ef){_0xf283d5['push'](_0xf283d5['shift']());}}}(a152_0x429e,0xa84f9));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x17e28a(0x230));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a152_0x17e28a(0x21b);export function createPendingSegmentId(_0x5607d8){return''+PENDING_SEGMENT_PREFIX+_0x5607d8+'__';}export function isPendingSegmentId(_0x4e3171){const _0x8fdd14=a152_0x17e28a;return _0x4e3171[_0x8fdd14(0x264)](PENDING_SEGMENT_PREFIX)&&!_0x4e3171['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x47fed8){const _0x41e6e5=a152_0x17e28a;return _0x47fed8[_0x41e6e5(0x240)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1dc9f2){return''+PENDING_ACTIVATION_PREFIX+_0x1dc9f2+'__';}export function isPendingActivationId(_0x48833f){const _0x408162=a152_0x17e28a;return _0x48833f[_0x408162(0x264)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1268b3){const _0x1ec05c=a152_0x17e28a;return _0x1268b3[_0x1ec05c(0x240)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4dc32b,_0xe0d28d){const _0x26b180=a152_0x17e28a,_0x599583=_0x4dc32b+'::'+(_0xe0d28d['trim']()||_0x26b180(0x1ae)),_0x45186b=createHash(_0x26b180(0x28b))[_0x26b180(0x271)](_0x599583)[_0x26b180(0x222)](_0x26b180(0x25d))[_0x26b180(0x241)](0x0,0xc);return'journey_entry_criteria_'+_0x45186b;}export function ensureJourneyDefaults(_0x1863af){const _0x29ec21=a152_0x17e28a;!_0x1863af[_0x29ec21(0x1a2)]&&(_0x1863af[_0x29ec21(0x1a2)]=''),!_0x1863af[_0x29ec21(0x23e)]&&(_0x1863af[_0x29ec21(0x23e)]='draft');}export function injectExistingStageIds(_0x13e8f6,_0x16e13e){const _0x37160c=a152_0x17e28a,_0x4a26c7=new Map(_0x16e13e['map'](_0x4df0ed=>[_0x4df0ed[_0x37160c(0x255)],_0x4df0ed['id']]));for(const _0xee26a4 of _0x13e8f6){if(!_0xee26a4['id']){const _0x21b811=_0x4a26c7[_0x37160c(0x252)](_0xee26a4[_0x37160c(0x255)]);_0x21b811&&(_0xee26a4['id']=_0x21b811);}}}export function resolveTDFolderPath(_0x5709ae,_0x361ee8,_0xc3aba3){const _0x57d8f3=a152_0x17e28a;if(!_0x361ee8)return _0x5709ae;if(_0x5709ae===_0xc3aba3||_0x5709ae[_0x57d8f3(0x264)](_0xc3aba3+'/'))return _0x5709ae;return _0x5709ae?_0xc3aba3+'/'+_0x5709ae:_0xc3aba3;}export function addFoldersToCreate(_0x1df7cd,_0x1a698f,_0x2e2150){const _0x21ddeb=a152_0x17e28a;if(!_0x1df7cd)return;if(_0x1a698f[_0x21ddeb(0x1f1)](_0x1df7cd))return;const _0x3232f8=_0x1df7cd[_0x21ddeb(0x260)]('/');let _0x54894e='';for(const _0x233f21 of _0x3232f8){_0x54894e=_0x54894e?_0x54894e+'/'+_0x233f21:_0x233f21,!_0x1a698f[_0x21ddeb(0x1f1)](_0x54894e)&&_0x2e2150[_0x21ddeb(0x275)](_0x54894e);}}export function sortFoldersByDepth(_0x1c6106){const _0x45733f=a152_0x17e28a;return[..._0x1c6106][_0x45733f(0x1b6)]((_0x491457,_0x29ee61)=>{const _0x4796ad=_0x45733f,_0x3027b0=(_0x491457['match'](/\//g)||[])['length'],_0x256d56=(_0x29ee61[_0x4796ad(0x277)](/\//g)||[])[_0x4796ad(0x27c)];return _0x3027b0-_0x256d56;});}import*as a152_0x46608f from'yaml';import{readFileSync}from'fs';import a152_0x3df059 from'path';import{isJourneyDef,parseYamlString as a152_0x4227b9,toYamlString as a152_0x29accb,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(_0x2570da){const _0x597a73=a152_0x17e28a;if(Array['isArray'](_0x2570da))return'['+_0x2570da[_0x597a73(0x21e)](_0x1ccf5=>stableStringify(_0x1ccf5))['join'](',')+']';if(_0x2570da&&typeof _0x2570da===_0x597a73(0x1ad)){const _0x58c6ef=_0x2570da,_0x1fc0dd=Object[_0x597a73(0x19d)](_0x58c6ef)[_0x597a73(0x1b6)](),_0x4f5b07=_0x1fc0dd[_0x597a73(0x21e)](_0x81a438=>'\x22'+_0x81a438+'\x22:'+stableStringify(_0x58c6ef[_0x81a438]));return'{'+_0x4f5b07[_0x597a73(0x1cb)](',')+'}';}const _0x4437a9=JSON[_0x597a73(0x20c)](_0x2570da);return _0x4437a9===undefined?_0x597a73(0x258):_0x4437a9;}function a152_0x429e(){const _0x1da185=['deleteSegment','getSegmentEntity\x20also\x20failed\x20for\x20','730505tjpfhA','journeyBundlesByFolderAndName','notification','.$1.push-recovery.json','Matched\x20server\x20segment\x20\x27','679480rUBpBK','Fetching\x20','169610CuzBGJ','2789196zfGzyz','\x27\x20by\x20rule\x20content','behavior','size','from','folderPathToId','Updating\x20segment\x20\x27','entry_criteria','createActivation','onProgress','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','14bnqTEq','has','\x27\x20decision\x20point\x20branch\x20\x27','conditionTimeoutUnit','\x0a\x20\x20','\x20(referenced\x20in\x20journey\x20','parseDocument','logSuccess','Created\x20segment\x20\x27','conditionSegmentId','\x27\x20entry\x20criteria','Stage\x20\x27','\x27\x20wait\x20condition','segmentByFolderAndName','filter','Activation\x20not\x20found:\x20','embedded_segment_created','branches','index','activations','Deleted\x20segment\x20\x27','includes','values','journey_updated','INTERNAL','Creating\x20folder\x20\x27','yamlActivation','create','stringify','attributes','Failed\x20to\x20fetch\x20referenced\x20segment\x20','entries','\x27\x20for\x20','activationContext','idToEmailMap','stage\x20\x27','segment_updated','relative','entryCriteria','2GIFQGG','embedded_segment_creating','98rgiYkT','segmentFolderId','__pending_act_','existingJourney','activation_','map','reduce','valid','activationParams','digest','SEGMENT_NOT_FOUND','12xCRdnE','type','createdSegmentIds','message','Entry\x20criteria:\x20','journeys','conditions','updated','created','connection','run_after_journey_refresh','3946780ictuWa','tdx.sdk.push-workflow','schedule','resolvedRule','waitStepType','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','getLatestJourneyId','ACTIVATION_UPDATE_ERROR','Updated\x20segment\x20\x27','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','updateSegmentById','18fmGiJl','parentId','all','embeddedSegmentNameToId','state','toLowerCase','replace','slice','nameToId','Duration','Condition','getSegmentEntity','max','folderPath','Segment\x20not\x20found','and\x20the\x20server\x20segment,\x20then\x20retry.','activation_deleting','user','./child-segment-yaml.js','12553585PXsIBl','Updating\x20activation\x20\x27','rule','folder_creating','item','get','activation_deleted',').\x20','name','NOT_FOUND','journeyActivationStepId','null','createdSegmentId','segment_deleted','\x27\x20from\x20file:\x20','find','hex','3ZypDca','logWarning','split','milestone','withProgress','Failed\x20to\x20','startsWith','JOURNEY_UPDATE_ERROR','journeyBundleId','journey_updating','activation_updating','data','conditionTimeoutDuration','segments','journeyName','5zZNejm','existingActivation','activationsBySegmentId','utf-8','update','columns','journeyById','absolutePath','add','rootFolderId','match','buildUserMaps','folder','activation_template_id',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','length','toISOString','logInfo','Creating\x20activation\x20\x27','waitStep','progress','folderId','parentSegmentFolder','DecisionPoint','deleted','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','resolveSegment','getActivation','\x27...','Updated\x20activation\x20\x27','sha1','\x20activation\x20\x27','steps','logDeleted','versionNumber','31146726ESlczT','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','unchanged','goal','Creating\x20segment\x20\x27','journey','uniqueServerName','connectionIdToNameMap','Deleting\x20activation\x20\x27','segmentId','Delete\x20the\x20push\x20recovery\x20file\x20(','keys','deps','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','existingSegment','yamlConfig','description','entry','WaitStep','set','skipSegments','existingSegments','\x27\x20milestone','./journey-yaml.js','../../utils/async.js','listActivations','\x20journey\x20from\x20file:\x20','object','segment','Failed\x20to\x20resolve\x20segment\x20','action','localName','segment_updating','\x20error(s)','diff','journeyId','sort','parse','with','all_columns','day','activation_created','waitStepUnit','segment_created','validatedRequest','delete','Activation','push','journeyBundleName','journeyStages','\x20segment\x20from\x20file:\x20','SEGMENT_UPDATE_ERROR','journey_created','createSegment','Failed\x20to\x20resolve\x20activation\x20','errors','segmentNameToId','join','debug','exitCriterias','isNew','goal\x20criteria','idToName','Segment\x20not\x20found:\x20','relationships','resolveJourneyId','list','connector_config','getJourney','hasChanges','\x27\x20exit\x20criteria','kind','Embedded\x20segment\x20\x27'];a152_0x429e=function(){return _0x1da185;};return a152_0x429e();}function activationSignature(_0x2f394c){const _0x16ff60=a152_0x17e28a,_0x1bea12={'connection':_0x2f394c[_0x16ff60(0x22d)],..._0x2f394c[_0x16ff60(0x1b9)]!==undefined&&{'all_columns':_0x2f394c[_0x16ff60(0x1b9)]},..._0x2f394c['columns']!==undefined&&{'columns':_0x2f394c[_0x16ff60(0x272)]},..._0x2f394c[_0x16ff60(0x1e7)]!==undefined&&{'behavior':_0x2f394c[_0x16ff60(0x1e7)]},..._0x2f394c[_0x16ff60(0x231)]!==undefined&&{'schedule':_0x2f394c[_0x16ff60(0x231)]},..._0x2f394c[_0x16ff60(0x1df)]!==undefined&&{'notification':_0x2f394c[_0x16ff60(0x1df)]},..._0x2f394c['connector_config']!==undefined&&{'connector_config':_0x2f394c[_0x16ff60(0x1d5)]},..._0x2f394c['activation_template_id']!==undefined&&{'activation_template_id':_0x2f394c[_0x16ff60(0x27a)]}};return stableStringify(_0x1bea12);}async function fetchSegment(_0x537789,_0x533dd3,_0x10b6b4,_0x563078){const _0x1e7f05=a152_0x17e28a,_0x149112=_0x563078?.[_0x1e7f05(0x25c)](_0x1fca13=>_0x1fca13['id']===_0x10b6b4);if(_0x149112)return _0x149112;try{return await _0x537789[_0x1e7f05(0x1ae)]['getSegment'](_0x533dd3,_0x10b6b4);}catch(_0x52cfe6){logger['debug']('getSegment\x20failed\x20for\x20'+_0x10b6b4+_0x1e7f05(0x27b)+_0x52cfe6);try{return await _0x537789[_0x1e7f05(0x1ae)][_0x1e7f05(0x245)](_0x10b6b4);}catch(_0x5497e9){return logger[_0x1e7f05(0x1cc)](_0x1e7f05(0x1dc)+_0x10b6b4+':\x20'+_0x5497e9),null;}}}function recoverSegmentIdsFromPushRecovery(_0x502118,_0x557999,_0x1404d0){const _0x1c30ab=a152_0x17e28a,_0x11de57=readPushRecovery(_0x502118[_0x1c30ab(0x274)]);if(_0x11de57?.['journeyName']===_0x502118[_0x1c30ab(0x1a1)][_0x1c30ab(0x255)])for(const [_0x14ace4,_0xa6178e]of Object['entries'](_0x11de57[_0x1c30ab(0x26b)])){const _0x106e12=generateDeterministicJourneySegmentName(_0x502118['yamlConfig']['name'],_0x14ace4);_0xa6178e['uniqueServerName']===_0x106e12&&(_0x557999[_0x1c30ab(0x1a5)](_0x14ace4,_0xa6178e[_0x1c30ab(0x19b)]),_0x1404d0['set'](_0x14ace4,_0xa6178e['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x46d30c,_0x28560c,_0x2514b8,_0xc8395){const _0x2272fc=a152_0x17e28a;let _0x2fbc8a;try{_0x2fbc8a=await _0x46d30c[_0x2272fc(0x1ae)]['createJourneySegment']({'name':_0x2514b8['uniqueSegmentName'],'description':_0x2514b8[_0x2272fc(0x1a2)],'journeyId':_0x2514b8['journeyId'],'rule':_0xc8395(_0x2514b8[_0x2272fc(0x232)],!![]),'countPopulation':!![],'parentFolderId':_0x2514b8[_0x2272fc(0x282)],'audienceId':_0x2514b8[_0x2272fc(0x23b)]});}catch(_0x3f53e1){const _0x29d2b5=_0x3f53e1 instanceof Error&&_0x3f53e1[_0x2272fc(0x227)][_0x2272fc(0x205)]('Name\x20has\x20already\x20been\x20taken');if(_0x29d2b5){const _0xf275f1=readPushRecovery(_0x28560c[_0x2272fc(0x274)]),_0x272d72=_0xf275f1?.[_0x2272fc(0x26c)]===_0x28560c[_0x2272fc(0x1a1)][_0x2272fc(0x255)]?_0xf275f1[_0x2272fc(0x26b)][_0x2514b8[_0x2272fc(0x1b1)]]:undefined;if(_0x272d72?.[_0x2272fc(0x198)]===_0x2514b8['uniqueSegmentName'])await _0x46d30c[_0x2272fc(0x1ae)][_0x2272fc(0x239)](_0x2514b8[_0x2272fc(0x23b)],_0x272d72[_0x2272fc(0x19b)],{'description':_0x2514b8[_0x2272fc(0x1a2)],'rule':_0xc8395(_0x2514b8[_0x2272fc(0x232)],!![]),'countPopulation':!![]}),_0x2fbc8a=_0x272d72[_0x2272fc(0x19b)];else throw new SDKError(ErrorCode[_0x2272fc(0x1c5)],_0x2272fc(0x1da)+_0x2514b8['localName']+_0x2272fc(0x238)+(_0x2272fc(0x19c)+_0x28560c[_0x2272fc(0x274)]['replace'](/([^/]+)$/,_0x2272fc(0x1e0))+')\x20')+_0x2272fc(0x249),_0x3f53e1);}else throw _0x3f53e1;}return saveSegmentToPushRecovery(_0x28560c['absolutePath'],_0x28560c[_0x2272fc(0x1a1)][_0x2272fc(0x255)],_0x2514b8[_0x2272fc(0x1b1)],{'segmentId':_0x2fbc8a,'uniqueServerName':_0x2514b8['uniqueSegmentName'],'createdAt':new Date()[_0x2272fc(0x27d)]()}),_0x2fbc8a;}export async function prepareSegmentFiles(_0x4cdb46,_0x5beef2,_0x1d1b46,_0x847b23,_0xc40e6e){const _0x8db653=a152_0x17e28a,{activationDefToCreateRequest:_0x330329}=await import(_0x8db653(0x24c)),_0x3e5dd9=[],_0xa79865=new Set();for(const {yamlConfig:_0x2c8868,folderPath:_0x75e95e,sourcePath:_0x50d3f1}of _0x4cdb46){const _0x37bb76=resolveTDFolderPath(_0x75e95e,_0x847b23,_0xc40e6e),_0x587ffe=_0x37bb76+':'+_0x2c8868[_0x8db653(0x255)],_0x8f4154=_0x5beef2[_0x8db653(0x1fd)][_0x8db653(0x252)](_0x587ffe),_0x5caef1=_0x8f4154?_0x5beef2[_0x8db653(0x26f)]['get'](_0x8f4154['id'])||[]:[];addFoldersToCreate(_0x37bb76,_0x5beef2[_0x8db653(0x1ea)],_0xa79865);const _0x344b32=calculateActivationActions(_0x2c8868[_0x8db653(0x203)]||[],_0x5caef1,_0x5beef2[_0x8db653(0x212)],_0x5beef2['connectionIdToNameMap']);for(const _0x379615 of _0x344b32){(_0x379615[_0x8db653(0x225)]==='create'||_0x379615[_0x8db653(0x225)]===_0x8db653(0x271))&&_0x379615[_0x8db653(0x20a)]&&(_0x379615[_0x8db653(0x1be)]=await _0x330329(_0x379615[_0x8db653(0x20a)],_0x1d1b46));}const _0x2ea6d4=calculateSegmentDiff(_0x2c8868,_0x8f4154,_0x5caef1,_0x5beef2[_0x8db653(0x212)],_0x5beef2[_0x8db653(0x199)]);_0x3e5dd9[_0x8db653(0x1c1)]({'relativePath':_0x2c8868[_0x8db653(0x255)],'absolutePath':_0x50d3f1,'yamlConfig':_0x2c8868,'folderPath':_0x37bb76,'existingSegment':_0x8f4154,'existingActivations':_0x5caef1,'isNew':_0x2ea6d4[_0x8db653(0x1ce)],'hasChanges':_0x2ea6d4['hasChanges'],'diff':_0x2ea6d4[_0x8db653(0x1b4)],'activationActions':_0x344b32});}return{'segmentFiles':_0x3e5dd9,'foldersToCreate':_0xa79865};}export async function prepareJourneyFiles(_0x108b37,_0x5db8df,_0x4e5df8,_0x225d8e){const _0x50aabd=a152_0x17e28a,_0x112052=[],_0x5db03e=new Set();for(const {yamlConfig:_0x1d2580,folderPath:_0x2813fb,sourcePath:_0x56b1cf}of _0x108b37){const _0x5a1db5=resolveTDFolderPath(_0x2813fb,_0x4e5df8,_0x225d8e),_0x353c38=_0x5a1db5+':'+_0x1d2580['name'],_0x4bd3cb=_0x5db8df[_0x50aabd(0x1de)][_0x50aabd(0x252)](_0x353c38);let _0x4b50e4,_0x6e9cb3;if(_0x4bd3cb&&_0x4bd3cb[_0x50aabd(0x27c)]>0x0){const _0x5aa416=buildLocalExpandedRuleMappings(_0x1d2580),{createYamlContext:_0x11a9b4,prefetchJourneySegments:_0x1b676c}=createPushYamlContextForBundle(_0x5db8df[_0x50aabd(0x19e)],_0x5db8df['parentId'],_0x5db8df['existingSegments'],_0x5aa416,_0x5db8df[_0x50aabd(0x212)],_0x5db8df[_0x50aabd(0x199)],_0x5db8df['activationStepsById'],_0x5db8df[_0x50aabd(0x273)]);await _0x1b676c(_0x4bd3cb['map'](_0x4d38f7=>_0x4d38f7['id']));const _0x109944=await _0x5db8df[_0x50aabd(0x19e)]['journey'][_0x50aabd(0x235)](_0x4bd3cb[0x0][_0x50aabd(0x266)]),_0x44308a=hasMultipleVersions(_0x1d2580),_0x273e21=async _0x3606d1=>{const _0x2cc82d=_0x50aabd,_0x302ecf=_0x5db8df[_0x2cc82d(0x273)]?.[_0x2cc82d(0x252)](_0x3606d1);if(_0x302ecf)return _0x302ecf;return _0x5db8df['fetchJourney']({'journeyId':_0x3606d1,'journeyName':_0x1d2580[_0x2cc82d(0x255)],'isMultiVersion':_0x4bd3cb[_0x2cc82d(0x27c)]>0x1});};if(_0x44308a&&_0x4bd3cb['length']>0x1){const _0x1e5fcf=[];for(const _0x539d61 of _0x4bd3cb){const _0x26a7ac=_0x539d61['versionNumber']||0x1;_0x5db8df['progress']?.[_0x50aabd(0x271)](_0x50aabd(0x1e3)+_0x1d2580['name']+'\x20v'+_0x26a7ac);const _0x459fa4=await _0x273e21(_0x539d61['id']),_0x288c30=_0x11a9b4(_0x539d61['id']),_0x438e4b=await journeyResponseToDef(_0x459fa4,_0x288c30);_0x1e5fcf[_0x50aabd(0x1c1)]({'item':_0x539d61,'yaml':_0x438e4b});}const _0x2f39c0=buildLocalRuleToNameMappingFromJourney(_0x1d2580);_0x6e9cb3=buildMergedJourneyDef(_0x1e5fcf,_0x2f39c0,_0x109944);const _0x327239=Math[_0x50aabd(0x246)](..._0x1e5fcf['map'](_0x451434=>_0x451434[_0x50aabd(0x251)][_0x50aabd(0x28f)]||0x0)),_0x11ab48=_0x4bd3cb[_0x50aabd(0x25c)](_0x408d83=>(_0x408d83[_0x50aabd(0x28f)]||0x0)===_0x327239);_0x11ab48&&(_0x5db8df[_0x50aabd(0x281)]?.[_0x50aabd(0x271)]('Fetching\x20'+_0x1d2580[_0x50aabd(0x255)]+'\x20v'+_0x327239),_0x4b50e4=await _0x273e21(_0x11ab48['id']));}else{const _0x2d9599=_0x4bd3cb[_0x4bd3cb['length']-0x1];_0x5db8df[_0x50aabd(0x281)]?.['update'](_0x50aabd(0x1e3)+_0x1d2580['name']),_0x4b50e4=await _0x273e21(_0x2d9599['id']);const _0x44a8df=_0x11a9b4(_0x2d9599['id']),_0x59165c=await journeyResponseToDef(_0x4b50e4,_0x44a8df),_0x4000c1=buildLocalRuleToNameMappingFromJourney(_0x1d2580);_0x6e9cb3=buildMergedJourneyDef([{'item':_0x2d9599,'yaml':_0x59165c}],_0x4000c1,_0x109944);}}addFoldersToCreate(_0x5a1db5,_0x5db8df[_0x50aabd(0x1ea)],_0x5db03e);const _0x1eb7cf=calculateJourneyDiff(_0x1d2580,_0x6e9cb3);_0x112052[_0x50aabd(0x1c1)]({'relativePath':_0x1d2580[_0x50aabd(0x255)],'absolutePath':_0x56b1cf,'yamlConfig':_0x1d2580,'folderPath':_0x5a1db5,'existingJourney':_0x4b50e4,'isNew':_0x1eb7cf['isNew'],'hasChanges':_0x1eb7cf[_0x50aabd(0x1d7)],'diff':_0x1eb7cf[_0x50aabd(0x1b4)]});}return{'journeyFiles':_0x112052,'foldersToCreate':_0x5db03e};}export function calculateActivationActions(_0x180aa8,_0x3074a4,_0x5e688c,_0x4966da){const _0x9f2f09=a152_0x17e28a,_0x3ab617=[],_0x124bcb=new Map();for(const _0x298ffc of _0x3074a4){_0x124bcb['set'](_0x298ffc[_0x9f2f09(0x255)],_0x298ffc);}const _0x2e07ce=new Map();for(const _0x3f42a2 of _0x180aa8){_0x2e07ce['set'](_0x3f42a2[_0x9f2f09(0x255)],_0x3f42a2);}for(const _0x3fce76 of _0x180aa8){const _0x249aad=_0x124bcb[_0x9f2f09(0x252)](_0x3fce76[_0x9f2f09(0x255)]);if(!_0x249aad)_0x3ab617[_0x9f2f09(0x1c1)]({'type':_0x9f2f09(0x20b),'name':_0x3fce76[_0x9f2f09(0x255)],'yamlActivation':_0x3fce76});else{const _0x5b9315=activationResponseToDef(_0x249aad,_0x5e688c,_0x4966da),_0x309255=a152_0x46608f[_0x9f2f09(0x20c)](_0x5b9315),_0x270606=a152_0x46608f[_0x9f2f09(0x20c)](_0x3fce76);_0x309255!==_0x270606&&_0x3ab617[_0x9f2f09(0x1c1)]({'type':_0x9f2f09(0x271),'name':_0x3fce76[_0x9f2f09(0x255)],'yamlActivation':_0x3fce76,'existingActivation':_0x249aad});}}for(const _0x175763 of _0x3074a4){!_0x2e07ce[_0x9f2f09(0x1f1)](_0x175763[_0x9f2f09(0x255)])&&_0x3ab617['push']({'type':_0x9f2f09(0x1bf),'name':_0x175763[_0x9f2f09(0x255)],'existingActivation':_0x175763});}return _0x3ab617;}function calculateYamlDiff(_0x28080d,_0x44fb2e){if(_0x44fb2e){const _0x27a43f=generateDiff(_0x44fb2e,_0x28080d),_0x240365=hasChanges(_0x27a43f);return{'isNew':![],'hasChanges':_0x240365,'diff':_0x240365?formatDiffWithColors(_0x27a43f):undefined};}const _0x127f00=generateDiff('',_0x28080d);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x127f00)};}export function calculateSegmentDiff(_0x32237b,_0xc7d27f,_0x450f71,_0x44da24,_0xa69455){const _0x444a32=segmentToYamlString(_0x32237b),_0x49f622=_0xc7d27f?segmentToYamlString(segmentWithActivationsToYaml(_0xc7d27f,_0x450f71,undefined,_0x44da24,_0xa69455)):undefined;return calculateYamlDiff(_0x444a32,_0x49f622);}export function calculateJourneyDiff(_0x2117ae,_0x57530c){const _0x436ac6=normalizeJourneyDef(_0x2117ae,_0x2117ae),_0x29782a=a152_0x29accb(_0x436ac6),_0x358593=_0x57530c?a152_0x29accb(normalizeJourneyDef(_0x57530c,_0x2117ae)):undefined;return calculateYamlDiff(_0x29782a,_0x358593);}export function findSegmentsToDelete(_0x4fae4c,_0x3251dc,_0x7eeeae,_0x20f40e,_0x46fad3){const _0x558b40=a152_0x17e28a,_0x2cfaa6=new Set();for(const {yamlConfig:_0x36cadc,folderPath:_0x31ce6f}of _0x3251dc){_0x2cfaa6[_0x558b40(0x275)](_0x31ce6f+':'+_0x36cadc[_0x558b40(0x255)]);}return _0x4fae4c[_0x558b40(0x1fe)](_0x5b4d48=>{const _0x4f955e=_0x558b40,_0x464576=_0x5b4d48[_0x4f955e(0x21a)]?_0x7eeeae[_0x4f955e(0x252)](_0x5b4d48['segmentFolderId']['toString']())||'':'',_0x3998cf=_0x464576+':'+_0x5b4d48[_0x4f955e(0x255)];if(_0x2cfaa6[_0x4f955e(0x1f1)](_0x3998cf))return![];if(_0x46fad3)return _0x464576===_0x20f40e||_0x464576['startsWith'](_0x20f40e+'/');return!![];});}export function findJourneysToDelete(_0x267f2b,_0x322591,_0x473b88,_0x12d7ac,_0x338b68){const _0x2fab9d=a152_0x17e28a,_0x8c3883=new Set();for(const {yamlConfig:_0xfb7940,folderPath:_0x734fe2}of _0x322591){_0x8c3883[_0x2fab9d(0x275)](_0x734fe2+':'+_0xfb7940['name']);}return _0x267f2b[_0x2fab9d(0x1fe)](_0x2aa823=>{const _0x44a7d9=_0x2fab9d,_0x2d8528=_0x2aa823[_0x44a7d9(0x282)]?_0x473b88[_0x44a7d9(0x252)](_0x2aa823[_0x44a7d9(0x282)])||'':'',_0x16221b=_0x2d8528+':'+_0x2aa823[_0x44a7d9(0x1c2)];if(_0x8c3883[_0x44a7d9(0x1f1)](_0x16221b))return![];if(_0x338b68)return _0x2d8528===_0x12d7ac||_0x2d8528[_0x44a7d9(0x264)](_0x12d7ac+'/');return!![];});}export function buildSegmentLookupMap(_0x3492a8,_0x493a53){const _0x561031=a152_0x17e28a,_0x3a953d=new Map();for(const _0x2c17a9 of _0x3492a8){const _0xfb734f=_0x2c17a9[_0x561031(0x21a)]?_0x493a53[_0x561031(0x252)](_0x2c17a9[_0x561031(0x21a)]['toString']())||'':'',_0x10ac04=_0xfb734f+':'+_0x2c17a9[_0x561031(0x255)];_0x3a953d['set'](_0x10ac04,_0x2c17a9);}return _0x3a953d;}export function buildSegmentNameToIdMap(_0x17791b){const _0x1a9506=a152_0x17e28a,_0x3e7bb5=new Map();for(const _0x1887bf of _0x17791b){_0x3e7bb5['set'](_0x1887bf[_0x1a9506(0x255)],_0x1887bf['id']);}return _0x3e7bb5;}export function buildJourneyBundleLookupMap(_0x30dea8,_0x5630a4){const _0x56ee2c=a152_0x17e28a,_0x361cd4=new Map();for(const _0x163dc6 of _0x30dea8){const _0xe24d70=_0x163dc6[_0x56ee2c(0x282)]?_0x5630a4[_0x56ee2c(0x252)](_0x163dc6[_0x56ee2c(0x282)])||'':'',_0x29bfba=_0xe24d70+':'+_0x163dc6[_0x56ee2c(0x1c2)];!_0x361cd4[_0x56ee2c(0x1f1)](_0x29bfba)&&_0x361cd4[_0x56ee2c(0x1a5)](_0x29bfba,[]),_0x361cd4[_0x56ee2c(0x252)](_0x29bfba)[_0x56ee2c(0x1c1)](_0x163dc6);}for(const _0x3fc121 of _0x361cd4[_0x56ee2c(0x206)]()){_0x3fc121['sort']((_0x37b7ab,_0x162756)=>(_0x37b7ab[_0x56ee2c(0x28f)]||0x0)-(_0x162756[_0x56ee2c(0x28f)]||0x0));}return _0x361cd4;}export function collectFoldersToCreate(_0x303fed,_0x5d2aee){const _0x448975=a152_0x17e28a,_0x532e9a=new Set();for(const _0x5aed78 of _0x303fed){if(!_0x5aed78)continue;if(_0x5d2aee[_0x448975(0x1f1)](_0x5aed78))continue;const _0x44dc83=_0x5aed78[_0x448975(0x260)]('/');let _0x33e1b1='';for(const _0x456504 of _0x44dc83){_0x33e1b1=_0x33e1b1?_0x33e1b1+'/'+_0x456504:_0x456504,!_0x5d2aee[_0x448975(0x1f1)](_0x33e1b1)&&_0x532e9a[_0x448975(0x275)](_0x33e1b1);}}return _0x532e9a;}export function parseAndClassifyYamlFiles(_0x4f25c0,_0x104262,_0x107340){const _0x154095=a152_0x17e28a,_0x36d0ce=[],_0x41528a=[];for(const _0x31a8d6 of _0x4f25c0){const _0x3ac1a3=a152_0x3df059[_0x154095(0x215)](_0x104262,a152_0x3df059['dirname'](_0x31a8d6)),_0x292909=_0x3ac1a3==='.'?'':_0x3ac1a3[_0x154095(0x240)](/\\/g,'/'),_0x216c47=readFileSync(_0x31a8d6,_0x154095(0x270)),_0x2c4ee5=a152_0x46608f[_0x154095(0x1b7)](_0x216c47);if(isJourneyDef(_0x2c4ee5)){const _0x43d52b=a152_0x4227b9(_0x216c47);_0x41528a['push']({'yamlConfig':_0x43d52b,'folderPath':_0x292909,'sourcePath':_0x31a8d6});}else{if(!_0x107340?.[_0x154095(0x1a6)]){const _0x318a40=parseSegmentYamlFile(_0x216c47),_0xfc0d30=normalizeChildSegmentYaml(_0x318a40);_0x36d0ce[_0x154095(0x1c1)]({'yamlConfig':_0xfc0d30,'folderPath':_0x292909,'sourcePath':_0x31a8d6});}}}return{'segments':_0x36d0ce,'journeys':_0x41528a};}export function validateParsedFiles(_0x37a4d1,_0x19b9b6){const _0x15b42e=a152_0x17e28a,_0x1f51dd=[];for(const {yamlConfig:_0x95b3c,sourcePath:_0x4771d9}of _0x37a4d1[_0x15b42e(0x26b)]){const _0x1dabd9=readFileSync(_0x4771d9,_0x15b42e(0x270)),_0x458e95=a152_0x46608f[_0x15b42e(0x1f6)](_0x1dabd9),_0x46a9c0=validateSegmentDef(_0x95b3c,{'source':_0x1dabd9,'document':_0x458e95},{'skipSchema':!![]});if(!_0x46a9c0[_0x15b42e(0x220)]){const _0x1d82bb=a152_0x3df059['relative'](_0x19b9b6,_0x4771d9);_0x1f51dd[_0x15b42e(0x1c1)]({'filePath':_0x1d82bb,'source':_0x1dabd9,'result':_0x46a9c0,'isJourney':![]});}}for(const {yamlConfig:_0x44b139,sourcePath:_0x438c58}of _0x37a4d1['journeys']){const _0x3eb7b2=readFileSync(_0x438c58,'utf-8'),_0x420a56=a152_0x46608f[_0x15b42e(0x1f6)](_0x3eb7b2),_0x43b096=validateJourneyDef(_0x44b139,{'source':_0x3eb7b2,'document':_0x420a56},{'skipSchema':!![]});if(!_0x43b096[_0x15b42e(0x220)]){const _0x42eee7=a152_0x3df059['relative'](_0x19b9b6,_0x438c58);_0x1f51dd[_0x15b42e(0x1c1)]({'filePath':_0x42eee7,'source':_0x3eb7b2,'result':_0x43b096,'isJourney':!![]});}}return _0x1f51dd;}export function formatValidationErrors(_0x408c5b){const _0x3c83ea=a152_0x17e28a,_0x25ca0b=[];for(const {filePath:_0x34e445,source:_0x5c3241,result:_0x447724,isJourney:_0x27694b}of _0x408c5b){const _0x5cd5a8=_0x27694b?_0x3c83ea(0x197):_0x3c83ea(0x1ae);_0x25ca0b[_0x3c83ea(0x1c1)]('\x0a'+_0x34e445+'\x20('+_0x5cd5a8+'):\x20'+_0x447724[_0x3c83ea(0x1c9)][_0x3c83ea(0x27c)]+_0x3c83ea(0x1b3)),_0x25ca0b[_0x3c83ea(0x1c1)](formatValidationResult(_0x447724,_0x5c3241,_0x34e445));}return _0x25ca0b['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x2fc8d7){const _0x411e94=a152_0x17e28a,_0x17eb24=new Set(),_0x3ddb40=new Map(),_0x105c8a=collectSegmentUsageCounts(_0x2fc8d7);if(_0x2fc8d7[_0x411e94(0x26b)])for(const [_0x14cdc8,_0x4492d9]of Object[_0x411e94(0x20f)](_0x2fc8d7[_0x411e94(0x26b)])){_0x17eb24['add'](_0x14cdc8);if(_0x4492d9[_0x411e94(0x24f)]){const _0x308094=yamlRuleToApi(_0x4492d9[_0x411e94(0x24f)]),_0x3007dc=apiRuleToYaml(_0x308094);_0x3ddb40[_0x411e94(0x1a5)](_0x14cdc8,_0x3007dc);}}const _0x2e8d81=new Map();let _0x444933=0x0;for(const [_0x3bc39a,_0x3f0519]of _0x3ddb40){const _0x2f5d0a=serializeExpandedRule(_0x3f0519,_0x3ddb40),_0x4a7bd5=_0x2e8d81['get'](_0x2f5d0a)||[];_0x4a7bd5[_0x411e94(0x1c1)]({'name':_0x3bc39a,'index':_0x444933}),_0x2e8d81[_0x411e94(0x1a5)](_0x2f5d0a,_0x4a7bd5),_0x444933++;}const _0x10257e=new Map();for(const [_0x38ddef,_0x16caf3]of _0x2e8d81){const _0x3ffeb6=_0x16caf3[_0x411e94(0x241)]()[_0x411e94(0x1b6)]((_0x43bed1,_0x50cbfd)=>{const _0x431d3b=_0x411e94,_0x411812=_0x105c8a['get'](_0x43bed1[_0x431d3b(0x255)])||0x0,_0x1f0286=_0x105c8a['get'](_0x50cbfd[_0x431d3b(0x255)])||0x0;if(_0x411812!==_0x1f0286)return _0x1f0286-_0x411812;return _0x43bed1[_0x431d3b(0x202)]-_0x50cbfd[_0x431d3b(0x202)];})['map'](_0x439bd8=>_0x439bd8[_0x411e94(0x255)]),_0x2dd79e=[];for(const _0x168149 of _0x3ffeb6){const _0x472a80=_0x105c8a[_0x411e94(0x252)](_0x168149)||0x0,_0x224378=Math[_0x411e94(0x246)](_0x472a80,0x1);for(let _0x527b52=0x0;_0x527b52<_0x224378;_0x527b52++){_0x2dd79e[_0x411e94(0x1c1)](_0x168149);}}_0x10257e[_0x411e94(0x1a5)](_0x38ddef,_0x2dd79e);}return{'existingLocalSegmentNames':_0x17eb24,'localSegmentRules':_0x3ddb40,'localExpandedRuleToNames':_0x10257e};}export function createSegmentIdResolver(_0x542353,_0xcf8ab0){return async _0x1652df=>{const _0x55a8e5=a152_0x2b62,_0x46cb98=_0x542353[_0x55a8e5(0x252)](_0x1652df);if(!_0x46cb98)throw new SDKError(ErrorCode[_0x55a8e5(0x223)],'Segment\x20not\x20found:\x20'+_0x1652df+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0xcf8ab0+'\x27)');return _0x46cb98;};}export function extractRootFolderId(_0x194251){const _0x42d5de=a152_0x17e28a;return _0x194251[_0x42d5de(0x1d2)]?.[_0x42d5de(0x283)]?.[_0x42d5de(0x269)]?.['id']||_0x194251[_0x42d5de(0x1d2)]?.['parentFolder']?.[_0x42d5de(0x269)]?.['id'];}export function buildConnectionMaps(_0x432b92){const _0x4e2add=a152_0x17e28a,_0x3a023b=new Map(),_0x190adb=new Map(),_0x3613ce=new Map();for(const _0x239cca of _0x432b92){_0x3a023b[_0x4e2add(0x1a5)](_0x239cca['name'],parseInt(_0x239cca['id'],0xa)),_0x190adb[_0x4e2add(0x1a5)](_0x239cca['id'],_0x239cca['name']),_0x3613ce['set'](_0x239cca[_0x4e2add(0x255)],_0x239cca['type']);}return{'nameToId':_0x3a023b,'idToName':_0x190adb,'nameToType':_0x3613ce};}export function calculatePushStats(_0x3b5d61,_0x4087d0,_0x2daac9,_0x37c0a7,_0x1fc22b,_0x5f495a,_0x16641f){const _0xfbb1ed=a152_0x17e28a,_0x33e2e6=_0x3b5d61['filter'](_0x3dc41f=>_0x3dc41f[_0xfbb1ed(0x1ce)]),_0x53c473=_0x3b5d61['filter'](_0x2d431a=>!_0x2d431a[_0xfbb1ed(0x1ce)]&&_0x2d431a[_0xfbb1ed(0x1d7)]),_0x1e24f6=_0x3b5d61[_0xfbb1ed(0x1fe)](_0x275c8b=>!_0x275c8b[_0xfbb1ed(0x1ce)]&&!_0x275c8b[_0xfbb1ed(0x1d7)]),_0x1707bc=_0x5f495a?_0x37c0a7:[],_0x413b27=_0x4087d0[_0xfbb1ed(0x1fe)](_0x45ebfb=>_0x45ebfb[_0xfbb1ed(0x1ce)]),_0x1edea0=_0x4087d0[_0xfbb1ed(0x1fe)](_0x4154fb=>!_0x4154fb[_0xfbb1ed(0x1ce)]&&_0x4154fb['hasChanges']),_0x3434f0=_0x4087d0[_0xfbb1ed(0x1fe)](_0xc0be51=>!_0xc0be51[_0xfbb1ed(0x1ce)]&&!_0xc0be51[_0xfbb1ed(0x1d7)]),_0x1689a4=_0x5f495a?_0x1fc22b:[],_0x98857d=_0x3b5d61['flatMap'](_0x37cb32=>_0x37cb32['activationActions']),_0x56d897=_0x98857d['filter'](_0x3f0a0b=>_0x3f0a0b['type']==='create'),_0x48d3d0=_0x98857d['filter'](_0x5294e2=>_0x5294e2['type']===_0xfbb1ed(0x271)),_0x5b71f7=_0x98857d['filter'](_0x1f5e1a=>_0x1f5e1a[_0xfbb1ed(0x225)]===_0xfbb1ed(0x1bf)),_0x1572a1=Array[_0xfbb1ed(0x1e9)](_0x2daac9)[_0xfbb1ed(0x1b6)](),_0x1a6594=_0x16641f?![]:_0x33e2e6[_0xfbb1ed(0x27c)]>0x0||_0x53c473[_0xfbb1ed(0x27c)]>0x0||_0x1707bc[_0xfbb1ed(0x27c)]>0x0,_0x2a094a=_0x413b27['length']>0x0||_0x1edea0[_0xfbb1ed(0x27c)]>0x0||_0x1689a4[_0xfbb1ed(0x27c)]>0x0,_0x6a14e0=_0x16641f?![]:_0x98857d[_0xfbb1ed(0x27c)]>0x0,_0x46f941=_0x1572a1['length']>0x0;return{'segments':{'new':_0x33e2e6,'changed':_0x53c473,'unchanged':_0x1e24f6,'toDelete':_0x1707bc},'journeys':{'new':_0x413b27,'changed':_0x1edea0,'unchanged':_0x3434f0,'toDelete':_0x1689a4},'activations':{'all':_0x98857d,'toCreate':_0x56d897,'toUpdate':_0x48d3d0,'toDelete':_0x5b71f7},'folders':{'toCreate':_0x1572a1},'counts':{'segments':{'new':_0x33e2e6[_0xfbb1ed(0x27c)],'changed':_0x53c473['length'],'unchanged':_0x1e24f6[_0xfbb1ed(0x27c)],'toDelete':_0x1707bc['length']},'journeys':{'new':_0x413b27['length'],'changed':_0x1edea0[_0xfbb1ed(0x27c)],'unchanged':_0x3434f0['length'],'toDelete':_0x1689a4[_0xfbb1ed(0x27c)]},'activations':{'create':_0x56d897['length'],'update':_0x48d3d0['length'],'delete':_0x5b71f7[_0xfbb1ed(0x27c)]},'folders':_0x1572a1[_0xfbb1ed(0x27c)]},'hasChanges':_0x1a6594||_0x2a094a||_0x6a14e0||_0x46f941};}export async function buildPushExecutionContext(_0x4396af,_0x4e3fb4,_0x1c1521,_0x49b595,_0x1bd7cf,_0x192369){const _0x1454f8=a152_0x17e28a,_0x5753d7=extractRootFolderId(_0x1c1521),{pathToId:_0x154f0c,idToPath:_0x4762d7}=buildFolderMaps(_0x1bd7cf),_0x228ccf=buildSegmentNameToIdMap(_0x49b595),_0x799d7e=new Map(),{batchAsync:_0x1e4f95}=await import('../../utils/async.js'),[_0x1b0886,_0x570d93]=await Promise[_0x1454f8(0x23c)]([_0x4396af[_0x1454f8(0x24b)][_0x1454f8(0x278)](),_0x4396af[_0x1454f8(0x22d)][_0x1454f8(0x1d4)](),((async()=>{const _0x1568f8=_0x1454f8;!_0x192369&&_0x49b595[_0x1568f8(0x27c)]>0x0&&await _0x1e4f95(_0x49b595,async _0x2b956c=>{const _0x43ecba=_0x1568f8,_0x2ca572=await _0x4396af[_0x43ecba(0x1ae)][_0x43ecba(0x1ab)](_0x4e3fb4,_0x2b956c['id']);_0x799d7e[_0x43ecba(0x1a5)](_0x2b956c['id'],_0x2ca572);});})())]),{emailToId:_0x1ac535,idToEmail:_0x5e5d70}=_0x1b0886,_0x543b0e=buildConnectionMaps(_0x570d93);return{'rootFolderId':_0x5753d7,'folderPathToId':_0x154f0c,'folderIdToPath':_0x4762d7,'segmentNameToId':_0x228ccf,'activationsBySegmentId':_0x799d7e,'emailToIdMap':_0x1ac535,'idToEmailMap':_0x5e5d70,'connectionNameToIdMap':_0x543b0e[_0x1454f8(0x242)],'connectionIdToNameMap':_0x543b0e[_0x1454f8(0x1d0)],'connectionNameToTypeMap':_0x543b0e['nameToType']};}export function createPushYamlContextForBundle(_0x235694,_0x57b142,_0x553e7d,_0x3f0216,_0x32e472,_0x32a303,_0x2d98f0,_0x1b5111){const {existingLocalSegmentNames:_0xfb622,localExpandedRuleToNames:_0x99201f}=_0x3f0216,_0x58da08=new Set(),_0x560984=new Map(),_0x8b0670=new Map(),_0x40012e=new Map(),_0x34c1b5=createJumpTargetCache(),_0x17a84e=new Map(),_0x5633b9=new Map(),_0x11ff6a=new Set();let _0x2bd2b3;const _0x3d03a4=_0x221104=>{const _0x128856={'resolveSegment':async _0x3aeb06=>{const _0x4f9bc6=a152_0x2b62,_0x2bd99b=_0x40012e[_0x4f9bc6(0x252)](_0x3aeb06);if(_0x2bd99b!==undefined)return{'name':_0x2bd99b,'isJourneyLocal':!![]};try{const _0xf2aa=await fetchSegment(_0x235694,_0x57b142,_0x3aeb06,_0x553e7d);if(!_0xf2aa)throw new Error(_0x4f9bc6(0x248));const _0x1c269a=generateJourneyLocalName(_0xf2aa[_0x4f9bc6(0x255)]),_0x2d769d=_0xf2aa[_0x4f9bc6(0x1d9)]===SEGMENT_KIND_JOURNEY&&_0x1c269a!==undefined;let _0x3f7b14=_0xf2aa[_0x4f9bc6(0x255)],_0x9dbbdf;if(_0x2d769d&&_0xf2aa[_0x4f9bc6(0x24f)]){const _0xffc110=apiRuleToYaml(_0xf2aa[_0x4f9bc6(0x24f)]);_0x5633b9['set'](_0x3aeb06,_0xffc110);const _0x145c24=async _0x525f90=>{const _0x274196=_0x4f9bc6,_0xf0c64=collectSegmentRefsFromRule(_0x525f90);for(const _0x3716f7 of _0xf0c64){if(!_0x5633b9[_0x274196(0x1f1)](_0x3716f7))try{const _0xa7fac1=await fetchSegment(_0x235694,_0x57b142,_0x3716f7,_0x553e7d);if(_0xa7fac1?.['rule']){const _0x26fa6f=apiRuleToYaml(_0xa7fac1[_0x274196(0x24f)]);_0x5633b9[_0x274196(0x1a5)](_0x3716f7,_0x26fa6f),await _0x145c24(_0x26fa6f);}}catch(_0x14b3be){logger[_0x274196(0x1cc)](_0x274196(0x20e)+_0x3716f7+':\x20'+_0x14b3be);}}};await _0x145c24(_0xffc110);const _0x3ce996=serializeExpandedRule(_0xffc110,_0x5633b9),_0x37af90=_0x99201f[_0x4f9bc6(0x252)](_0x3ce996);if(_0x37af90&&_0x37af90['length']>0x0){const _0x574268=_0x560984[_0x4f9bc6(0x252)](_0x3ce996)||0x0,_0x5d4bd7=_0x37af90[_0x574268]||_0x37af90[_0x37af90[_0x4f9bc6(0x27c)]-0x1];_0x560984[_0x4f9bc6(0x1a5)](_0x3ce996,_0x574268+0x1),_0x3f7b14=_0x5d4bd7,_0x58da08[_0x4f9bc6(0x275)](_0x3f7b14),_0x40012e[_0x4f9bc6(0x1a5)](_0x3aeb06,_0x3f7b14);const _0x552fa9=await resolveRuleSegmentRefs(_0xffc110,async _0x1be401=>{const _0x46d38d=_0x4f9bc6,_0x1eb12f=_0x40012e['get'](_0x1be401);if(_0x1eb12f)return _0x1eb12f;const _0x4a0432=await _0x2bd2b3[_0x46d38d(0x287)](_0x1be401);return _0x4a0432[_0x46d38d(0x255)];});_0x9dbbdf={'description':_0xf2aa['description'],'rule':_0x552fa9};}else{const _0x5998fd=_0x17a84e[_0x4f9bc6(0x252)](_0x3ce996);if(_0x5998fd)_0x3f7b14=_0x5998fd,_0x40012e['set'](_0x3aeb06,_0x3f7b14);else{if(_0x1c269a){let _0x192bea=_0x1c269a,_0x55caa1=0x2;while(_0x58da08['has'](_0x192bea)||_0xfb622[_0x4f9bc6(0x1f1)](_0x192bea)){_0x192bea=_0x1c269a+'_'+_0x55caa1,_0x55caa1++;}_0x58da08[_0x4f9bc6(0x275)](_0x192bea),_0x3f7b14=_0x192bea;}_0x40012e[_0x4f9bc6(0x1a5)](_0x3aeb06,_0x3f7b14),_0x17a84e[_0x4f9bc6(0x1a5)](_0x3ce996,_0x3f7b14);const _0xef2ea0=await resolveRuleSegmentRefs(_0xffc110,async _0x6cd642=>{const _0x1f53ff=_0x4f9bc6,_0x3641f5=_0x40012e[_0x1f53ff(0x252)](_0x6cd642);if(_0x3641f5)return _0x3641f5;const _0x56283c=await _0x2bd2b3[_0x1f53ff(0x287)](_0x6cd642);return _0x56283c['name'];});_0x9dbbdf={'description':_0xf2aa[_0x4f9bc6(0x1a2)],'rule':_0xef2ea0};}}}return{'name':_0x3f7b14,'isJourneyLocal':_0x2d769d,'definition':_0x9dbbdf};}catch(_0x5db64d){return logger[_0x4f9bc6(0x1cc)](_0x4f9bc6(0x1af)+_0x3aeb06+':\x20'+_0x5db64d),{'name':_0x3aeb06,'isJourneyLocal':![]};}},'resolveActivation':async _0x146cd1=>{const _0x530119=a152_0x2b62,_0x30e44e=_0x8b0670[_0x530119(0x252)](_0x146cd1);if(_0x30e44e!==undefined)return{'name':_0x30e44e,'isJourneyLocal':!![]};try{let _0x287583=_0x2d98f0?.[_0x530119(0x252)](_0x146cd1);!_0x287583&&(_0x287583=await _0x235694[_0x530119(0x197)][_0x530119(0x288)](_0x221104,_0x146cd1));const _0x3c4700=_0x287583[_0x530119(0x20d)][_0x530119(0x221)][_0x530119(0x255)]||_0x146cd1,_0x34b57c=sanitizeYamlKey(_0x3c4700)||_0x530119(0x21d)+_0x146cd1,_0x3dec17=_0x34b57c;_0x8b0670[_0x530119(0x1a5)](_0x146cd1,_0x3dec17);const _0x36b306=journeyActivationStepToYaml(_0x287583,_0x32e472,_0x32a303);return{'name':_0x3dec17,'isJourneyLocal':!![],'definition':_0x36b306};}catch(_0x507b80){return logger['debug'](_0x530119(0x1c8)+_0x146cd1+':\x20'+_0x507b80),{'name':_0x146cd1,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x127a66,_0x1cdb55)=>resolveJumpTarget(_0x127a66,_0x1cdb55,_0x34c1b5,async _0x465594=>{const _0x1239e6=a152_0x2b62,_0x45888a=_0x1b5111?.[_0x1239e6(0x252)](_0x465594);if(_0x45888a)return _0x45888a;return _0x235694[_0x1239e6(0x197)]['getJourney'](_0x465594);})};return _0x2bd2b3=_0x128856,_0x128856;},_0x5ced7a=async _0x50bae2=>{const _0x390004=a152_0x2b62,{collectSegmentIdsFromJourneyApi:_0x596e7e}=await import(_0x390004(0x1a9)),{batchAsync:_0x1513f7}=await import(_0x390004(0x1aa)),_0x397432=new Set();for(const _0x146f74 of _0x50bae2){let _0x13b672=_0x1b5111?.['get'](_0x146f74);!_0x13b672&&(_0x13b672=await _0x235694[_0x390004(0x197)][_0x390004(0x1d6)](_0x146f74));const _0x3c5ad0=_0x596e7e(_0x13b672);for(const _0x2a5494 of _0x3c5ad0){_0x397432[_0x390004(0x275)](_0x2a5494);}}let _0x3cb2a9=Array[_0x390004(0x1e9)](_0x397432);while(_0x3cb2a9[_0x390004(0x27c)]>0x0){const _0x1d7087=_0x3cb2a9[_0x390004(0x1fe)](_0x53e7a5=>!_0x11ff6a[_0x390004(0x1f1)](_0x53e7a5));if(_0x1d7087[_0x390004(0x27c)]===0x0)break;const _0x301bc7=await _0x1513f7(_0x1d7087,async _0x2899d0=>{const _0x1919c8=_0x390004;_0x11ff6a[_0x1919c8(0x275)](_0x2899d0);const _0x2bf023=await fetchSegment(_0x235694,_0x57b142,_0x2899d0,_0x553e7d);if(!_0x2bf023)return null;return{'segmentId':_0x2899d0,'segment':_0x2bf023};},0xa),_0x1a92f7=new Set();for(const _0x7e0146 of _0x301bc7){if(!_0x7e0146?.[_0x390004(0x1ae)]?.[_0x390004(0x24f)])continue;const _0x40ef55=apiRuleToYaml(_0x7e0146[_0x390004(0x1ae)]['rule']);_0x5633b9[_0x390004(0x1a5)](_0x7e0146['segmentId'],_0x40ef55);const _0x8b1f96=collectSegmentRefsFromRule(_0x40ef55);for(const _0x2667ea of _0x8b1f96){!_0x11ff6a['has'](_0x2667ea)&&_0x1a92f7[_0x390004(0x275)](_0x2667ea);}}_0x3cb2a9=Array[_0x390004(0x1e9)](_0x1a92f7);}};return{'createYamlContext':_0x3d03a4,'prefetchJourneySegments':_0x5ced7a};}export async function executePushSegments(_0x1a4295,_0x185250,_0x5e26fa,_0x13b3ad,_0x42cafd){const _0x15a636=a152_0x17e28a,{segmentDefToCreateRequest:_0x499aeb,segmentDefToUpdateRequest:_0x2a8a8b}=await import(_0x15a636(0x24c)),_0x171d7f=_0x5e26fa[_0x15a636(0x1ea)],_0x98e70b=0x5,_0x13df31=async _0x1a3a87=>{const _0x58329e=_0x15a636,_0x59907f=_0x1a3a87[_0x58329e(0x247)]?_0x171d7f[_0x58329e(0x252)](_0x1a3a87[_0x58329e(0x247)]):undefined;let _0x362e31;const _0xbcd886={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x150b55=_0x1a3a87[_0x58329e(0x1a1)];if(_0x1a3a87['yamlConfig'][_0x58329e(0x24f)]){const _0x55bdaf=createSegmentIdResolver(_0x5e26fa[_0x58329e(0x1ca)],_0x1a3a87[_0x58329e(0x1a1)]['name']),_0x2ec8fe=await resolveRuleSegmentIds(_0x1a3a87[_0x58329e(0x1a1)][_0x58329e(0x24f)],_0x55bdaf);_0x150b55={..._0x1a3a87[_0x58329e(0x1a1)],'rule':_0x2ec8fe};}try{if(_0x1a3a87[_0x58329e(0x1ce)]){_0x42cafd['onProgress']?.({'type':'segment_creating','name':_0x1a3a87[_0x58329e(0x1a1)][_0x58329e(0x255)]});const _0xb9ab32=_0x499aeb(_0x150b55,_0x59907f),_0x1e633e=await _0x42cafd[_0x58329e(0x262)](_0x58329e(0x196)+_0x1a3a87[_0x58329e(0x1a1)]['name']+_0x58329e(0x289),()=>_0x1a4295[_0x58329e(0x1ae)][_0x58329e(0x1c7)](_0x13b3ad[_0x58329e(0x23b)],_0xb9ab32));_0x362e31=_0x1e633e[_0x58329e(0x269)]['id'],_0x5e26fa['segmentNameToId'][_0x58329e(0x1a5)](_0x1a3a87[_0x58329e(0x1a1)][_0x58329e(0x255)],_0x362e31),_0xbcd886[_0x58329e(0x259)]={'name':_0x1a3a87[_0x58329e(0x1a1)][_0x58329e(0x255)],'id':_0x362e31},_0x42cafd[_0x58329e(0x1ee)]?.({'type':_0x58329e(0x1bd),'name':_0x1a3a87['yamlConfig'][_0x58329e(0x255)],'segmentId':_0x362e31}),_0x42cafd[_0x58329e(0x1f7)]?.(_0x58329e(0x1f8)+_0x1a3a87[_0x58329e(0x1a1)][_0x58329e(0x255)]+'\x27'),_0xbcd886[_0x58329e(0x22c)]=0x1;}else{if(_0x1a3a87[_0x58329e(0x1d7)]){_0x42cafd['onProgress']?.({'type':_0x58329e(0x1b2),'name':_0x1a3a87[_0x58329e(0x1a1)][_0x58329e(0x255)]});const _0x3416ff=_0x2a8a8b(_0x150b55);_0x59907f!==_0x1a3a87['existingSegment']?.[_0x58329e(0x21a)]&&(_0x3416ff[_0x58329e(0x21a)]=_0x59907f?parseInt(_0x59907f,0xa):undefined),await _0x42cafd[_0x58329e(0x262)](_0x58329e(0x1eb)+_0x1a3a87[_0x58329e(0x1a1)][_0x58329e(0x255)]+_0x58329e(0x289),()=>_0x1a4295[_0x58329e(0x1ae)][_0x58329e(0x239)](_0x13b3ad[_0x58329e(0x23b)],_0x1a3a87['existingSegment']['id'],_0x3416ff)),_0x362e31=_0x1a3a87[_0x58329e(0x1a0)]['id'],_0x42cafd[_0x58329e(0x1ee)]?.({'type':_0x58329e(0x214),'name':_0x1a3a87['yamlConfig']['name']}),_0x42cafd[_0x58329e(0x1f7)]?.(_0x58329e(0x237)+_0x1a3a87[_0x58329e(0x1a1)][_0x58329e(0x255)]+'\x27'),_0xbcd886[_0x58329e(0x22b)]=0x1;}else _0x362e31=_0x1a3a87['existingSegment']['id'];}}catch(_0x40d155){const _0x2f90ec=isHttp400Error(_0x40d155),_0x53f5b5=_0x2f90ec?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x58329e(0x1c5)],_0xdbdd4=getErrorMessage(_0x40d155);throw new SDKError(_0x53f5b5,'Failed\x20to\x20'+(_0x1a3a87[_0x58329e(0x1ce)]?'create':_0x58329e(0x271))+_0x58329e(0x1c4)+_0x1a3a87[_0x58329e(0x274)]+'\x0a\x20\x20'+_0xdbdd4,_0x40d155);}try{const _0x191dc3=await syncActivationsForSegment(_0x1a4295,_0x13b3ad['parentId'],_0x362e31,_0x1a3a87[_0x58329e(0x1a1)][_0x58329e(0x255)],_0x1a3a87['activationActions'],_0x42cafd,_0x1a3a87[_0x58329e(0x274)]);_0xbcd886[_0x58329e(0x203)]=_0x191dc3;}catch(_0x4bddc0){if(_0x4bddc0 instanceof SDKError)throw _0x4bddc0;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x58329e(0x1ef)+_0x1a3a87[_0x58329e(0x1a1)]['name']+_0x58329e(0x25b)+_0x1a3a87[_0x58329e(0x274)]+_0x58329e(0x1f4)+getErrorMessage(_0x4bddc0),_0x4bddc0);}return _0xbcd886;},_0x9056d0=await batchAsync(_0x185250,_0x13df31,_0x98e70b),_0x481fbd={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4fd0a0 of _0x9056d0){_0x481fbd[_0x15a636(0x22c)]+=_0x4fd0a0[_0x15a636(0x22c)],_0x481fbd['updated']+=_0x4fd0a0[_0x15a636(0x22b)],_0x4fd0a0[_0x15a636(0x259)]&&_0x481fbd[_0x15a636(0x226)][_0x15a636(0x1a5)](_0x4fd0a0[_0x15a636(0x259)][_0x15a636(0x255)],_0x4fd0a0[_0x15a636(0x259)]['id']),_0x481fbd[_0x15a636(0x203)][_0x15a636(0x22c)]+=_0x4fd0a0['activations'][_0x15a636(0x22c)],_0x481fbd[_0x15a636(0x203)][_0x15a636(0x22b)]+=_0x4fd0a0[_0x15a636(0x203)][_0x15a636(0x22b)],_0x481fbd[_0x15a636(0x203)][_0x15a636(0x285)]+=_0x4fd0a0[_0x15a636(0x203)]['deleted'];}return _0x481fbd;}async function syncActivationsForSegment(_0x28d0e1,_0x3f1996,_0x31be77,_0x3b45e3,_0x108b48,_0x5a8d91,_0x4369e5){const _0x13cc8e=a152_0x17e28a,_0x1ca91a={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x217874 of _0x108b48){try{if(_0x217874[_0x13cc8e(0x225)]===_0x13cc8e(0x20b)&&_0x217874[_0x13cc8e(0x1be)])_0x5a8d91[_0x13cc8e(0x1ee)]?.({'type':'activation_creating','segmentName':_0x3b45e3,'activationName':_0x217874[_0x13cc8e(0x255)]}),await _0x5a8d91['withProgress'](_0x13cc8e(0x27f)+_0x217874[_0x13cc8e(0x255)]+_0x13cc8e(0x289),()=>_0x28d0e1[_0x13cc8e(0x1ae)][_0x13cc8e(0x1ed)](_0x3f1996,_0x31be77,_0x217874['validatedRequest'])),_0x5a8d91[_0x13cc8e(0x1ee)]?.({'type':_0x13cc8e(0x1bb),'segmentName':_0x3b45e3,'activationName':_0x217874['name']}),_0x5a8d91[_0x13cc8e(0x1f7)]?.('Created\x20activation\x20\x27'+_0x217874[_0x13cc8e(0x255)]+'\x27'),_0x1ca91a['created']++;else{if(_0x217874[_0x13cc8e(0x225)]===_0x13cc8e(0x271)&&_0x217874['validatedRequest']&&_0x217874[_0x13cc8e(0x26e)])_0x5a8d91['onProgress']?.({'type':_0x13cc8e(0x268),'segmentName':_0x3b45e3,'activationName':_0x217874['name']}),await _0x5a8d91['withProgress'](_0x13cc8e(0x24e)+_0x217874[_0x13cc8e(0x255)]+'\x27...',()=>_0x28d0e1['segment']['updateActivation'](_0x3f1996,_0x31be77,_0x217874[_0x13cc8e(0x26e)]['id'],_0x217874[_0x13cc8e(0x1be)])),_0x5a8d91['onProgress']?.({'type':'activation_updated','segmentName':_0x3b45e3,'activationName':_0x217874[_0x13cc8e(0x255)]}),_0x5a8d91[_0x13cc8e(0x1f7)]?.(_0x13cc8e(0x28a)+_0x217874[_0x13cc8e(0x255)]+'\x27'),_0x1ca91a[_0x13cc8e(0x22b)]++;else _0x217874[_0x13cc8e(0x225)]===_0x13cc8e(0x1bf)&&_0x217874[_0x13cc8e(0x26e)]&&(_0x5a8d91[_0x13cc8e(0x1ee)]?.({'type':_0x13cc8e(0x24a),'segmentName':_0x3b45e3,'activationName':_0x217874['name']}),await _0x5a8d91['withProgress'](_0x13cc8e(0x19a)+_0x217874['name']+_0x13cc8e(0x289),()=>_0x28d0e1[_0x13cc8e(0x1ae)]['deleteActivation'](_0x3f1996,_0x31be77,_0x217874[_0x13cc8e(0x26e)]['id'])),_0x5a8d91[_0x13cc8e(0x1ee)]?.({'type':_0x13cc8e(0x253),'segmentName':_0x3b45e3,'activationName':_0x217874[_0x13cc8e(0x255)]}),_0x5a8d91[_0x13cc8e(0x28e)]?.('Deleted\x20activation\x20\x27'+_0x217874[_0x13cc8e(0x255)]+'\x27'),_0x1ca91a[_0x13cc8e(0x285)]++);}}catch(_0x4de98f){const _0x2d4862=isHttp400Error(_0x4de98f),_0x2515fc=_0x2d4862?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x13cc8e(0x236)],_0x596067=getErrorMessage(_0x4de98f);throw new SDKError(_0x2515fc,'Failed\x20to\x20'+_0x217874[_0x13cc8e(0x225)]+_0x13cc8e(0x28c)+_0x217874[_0x13cc8e(0x255)]+_0x13cc8e(0x25b)+_0x4369e5+_0x13cc8e(0x1f4)+_0x596067,_0x4de98f);}}return _0x1ca91a;}export async function executePushFolders(_0x7d93e2,_0x2e35ff,_0x488d42,_0x2c837b,_0x58e680){const _0x43b748=a152_0x17e28a,_0x884fd5=new Map(_0x488d42),_0x311d1c=sortFoldersByDepth(_0x2e35ff);for(const _0x3bd0e8 of _0x311d1c){const _0x4cc31b=_0x3bd0e8[_0x43b748(0x260)]('/'),_0x3950a3=_0x4cc31b[_0x4cc31b['length']-0x1],_0x5e6b7e=_0x4cc31b[_0x43b748(0x241)](0x0,-0x1)[_0x43b748(0x1cb)]('/'),_0x1b9d45=_0x884fd5[_0x43b748(0x252)](_0x5e6b7e);_0x58e680[_0x43b748(0x1ee)]?.({'type':_0x43b748(0x250),'folder':_0x3bd0e8});const _0x41658c={'name':_0x3950a3,'parentFolderId':_0x1b9d45},_0x489913=await _0x58e680['withProgress'](_0x43b748(0x209)+_0x3bd0e8+_0x43b748(0x289),()=>_0x7d93e2[_0x43b748(0x1ae)]['createFolder'](_0x2c837b[_0x43b748(0x23b)],_0x41658c));_0x884fd5[_0x43b748(0x1a5)](_0x3bd0e8,_0x489913[_0x43b748(0x269)]['id']),_0x58e680[_0x43b748(0x1ee)]?.({'type':'folder_created','folder':_0x3bd0e8,'folderId':_0x489913[_0x43b748(0x269)]['id']}),_0x58e680[_0x43b748(0x27e)]?.('Created\x20folder\x20\x27'+_0x3bd0e8+'\x27');}return _0x884fd5;}export async function executePushSegmentDeletions(_0x5467e1,_0x38352f,_0x290bf6){const _0x221468=a152_0x17e28a;if(_0x38352f['length']===0x0)return 0x0;const {batchAsync:_0x3d87e5}=await import(_0x221468(0x1aa)),_0x30c508=0x5,_0x2f5c4a=await _0x3d87e5(_0x38352f,async _0x1caccf=>{const _0x2021d0=_0x221468;return _0x290bf6['onProgress']?.({'type':'segment_deleting','name':_0x1caccf['name']}),await _0x5467e1['segment'][_0x2021d0(0x1db)](_0x1caccf['id']),_0x290bf6[_0x2021d0(0x1ee)]?.({'type':_0x2021d0(0x25a),'name':_0x1caccf['name']}),_0x290bf6['logDeleted']?.(_0x2021d0(0x204)+_0x1caccf[_0x2021d0(0x255)]+'\x27'),0x1;},_0x30c508);return _0x2f5c4a[_0x221468(0x21f)]((_0x41e3cd,_0x129f98)=>_0x41e3cd+_0x129f98,0x0);}export async function executePushJourneys(_0x3d9a83,_0xd6e3cb,_0x1b6a95,_0x1a896f,_0x3a8c83){const _0x17d9a9=a152_0x17e28a,{journeyDefToRequest:_0x45eb65}=await import(_0x17d9a9(0x1a9)),{activationDefToCreateRequest:_0x22502b,yamlRuleToApi:_0x575c78,validateSegmentRule:_0x5b3b21}=await import('./child-segment-yaml.js'),_0x17af9a={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x142b87=new Map(_0x1b6a95[_0x17d9a9(0x1ca)]),_0x5ee306=0x5;for(let _0x4cfbcc=0x0;_0x4cfbcc<_0xd6e3cb[_0x17d9a9(0x27c)];_0x4cfbcc+=_0x5ee306){const _0x3535b1=_0xd6e3cb[_0x17d9a9(0x241)](_0x4cfbcc,_0x4cfbcc+_0x5ee306),_0x5b17fc=await Promise[_0x17d9a9(0x23c)](_0x3535b1[_0x17d9a9(0x21e)](async _0x48ce2c=>{const _0x4a1472=_0x17d9a9;if(!_0x48ce2c[_0x4a1472(0x1ce)]&&!_0x48ce2c['hasChanges'])return{'action':_0x4a1472(0x292),'name':_0x48ce2c[_0x4a1472(0x1a1)]['name'],'journeyId':_0x48ce2c[_0x4a1472(0x21c)]?.['id']};const _0xe3c43f=_0x48ce2c['folderPath']?_0x1b6a95['folderPathToId']['get'](_0x48ce2c['folderPath']):undefined;_0x3a8c83[_0x4a1472(0x1ee)]?.({'type':_0x48ce2c[_0x4a1472(0x1ce)]?'journey_creating':_0x4a1472(0x267),'name':_0x48ce2c[_0x4a1472(0x1a1)]['name']});try{const _0xd48dd8=await executeSingleJourneyPush(_0x3d9a83,_0x48ce2c,{..._0x1b6a95,'segmentNameToId':_0x142b87},{'parentId':_0x1a896f[_0x4a1472(0x23b)],'rootFolderId':_0x1a896f[_0x4a1472(0x276)],'folderId':_0xe3c43f,'verbose':_0x1a896f['verbose']},_0x3a8c83,{'journeyDefToRequest':_0x45eb65,'activationDefToCreateRequest':_0x22502b,'yamlRuleToApi':_0x575c78,'validateSegmentRule':_0x5b3b21});for(const [_0x166f6f,_0x7cad31]of _0xd48dd8['embeddedSegmentNameToId']){_0x142b87[_0x4a1472(0x1a5)](_0x166f6f,_0x7cad31),_0x17af9a[_0x4a1472(0x23d)][_0x4a1472(0x1a5)](_0x166f6f,_0x7cad31);}if(_0xd48dd8[_0x4a1472(0x1b0)]==='created')_0x3a8c83['onProgress']?.({'type':_0x4a1472(0x1c6),'name':_0x48ce2c[_0x4a1472(0x1a1)]['name'],'journeyId':_0xd48dd8['journeyId']}),_0x3a8c83[_0x4a1472(0x1f7)]?.('Created\x20journey\x20\x27'+_0x48ce2c[_0x4a1472(0x1a1)][_0x4a1472(0x255)]+'\x27'),_0x17af9a[_0x4a1472(0x22c)]++;else _0xd48dd8[_0x4a1472(0x1b0)]===_0x4a1472(0x22b)&&(_0x3a8c83[_0x4a1472(0x1ee)]?.({'type':_0x4a1472(0x207),'name':_0x48ce2c['yamlConfig']['name']}),_0x3a8c83[_0x4a1472(0x1f7)]?.('Updated\x20journey\x20\x27'+_0x48ce2c[_0x4a1472(0x1a1)][_0x4a1472(0x255)]+'\x27'),_0x17af9a[_0x4a1472(0x22b)]++);return{'action':_0xd48dd8[_0x4a1472(0x1b0)],'name':_0x48ce2c[_0x4a1472(0x1a1)][_0x4a1472(0x255)],'journeyId':_0xd48dd8[_0x4a1472(0x1b5)]};}catch(_0xdb80e7){const _0x48aa11=isHttp400Error(_0xdb80e7),_0x4167b2=_0x48aa11?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x4a1472(0x265)],_0x350c45=getErrorMessage(_0xdb80e7);throw new SDKError(_0x4167b2,_0x4a1472(0x263)+(_0x48ce2c[_0x4a1472(0x1ce)]?'create':_0x4a1472(0x271))+_0x4a1472(0x1ac)+_0x48ce2c[_0x4a1472(0x274)]+_0x4a1472(0x1f4)+_0x350c45,_0xdb80e7);}}));_0x17af9a['results']['push'](..._0x5b17fc);}return _0x17af9a;}async function matchExistingJourneySegments(_0x2da5ed,_0x47ec84,_0x25a85c,_0x1e1274,_0x2cc2a2){const _0x26cf99=a152_0x17e28a;if(!_0x47ec84['existingJourney']||!_0x47ec84[_0x26cf99(0x1a1)][_0x26cf99(0x26b)])return;const _0x2d3dab=new Map(),_0x454d61=new Set();for(const _0x4e57f5 of Object[_0x26cf99(0x19d)](_0x47ec84[_0x26cf99(0x1a1)][_0x26cf99(0x26b)])){const _0x12b96e=generateDeterministicJourneySegmentName(_0x47ec84[_0x26cf99(0x1a1)][_0x26cf99(0x255)],_0x4e57f5);_0x2d3dab[_0x26cf99(0x1a5)](_0x12b96e,_0x4e57f5),_0x454d61[_0x26cf99(0x275)](_0x4e57f5);}const _0x14a601=[],_0x2fe112=collectSegmentIdsFromJourneyApi(_0x47ec84[_0x26cf99(0x21c)]);for(const _0x5677db of _0x2fe112){const _0x5d9700=await fetchSegment(_0x2da5ed,_0x25a85c,_0x5677db,_0x1e1274);if(!_0x5d9700?.['name'])continue;const _0x4e602c=_0x2d3dab[_0x26cf99(0x252)](_0x5d9700[_0x26cf99(0x255)]);_0x4e602c?(_0x2cc2a2[_0x26cf99(0x1a5)](_0x4e602c,_0x5677db),_0x454d61[_0x26cf99(0x1bf)](_0x4e602c)):_0x14a601[_0x26cf99(0x1c1)]({'id':_0x5677db,'seg':_0x5d9700});}if(_0x454d61[_0x26cf99(0x1e8)]>0x0&&_0x14a601[_0x26cf99(0x27c)]>0x0){const {localExpandedRuleToNames:_0x4a4a79}=buildLocalExpandedRuleMappings(_0x47ec84[_0x26cf99(0x1a1)]),_0x5cc3fb=new Map();for(const {id:_0x880aed,seg:_0x3b6954}of _0x14a601){if(_0x3b6954[_0x26cf99(0x24f)]){const _0x293e24=apiRuleToYaml(_0x3b6954[_0x26cf99(0x24f)]);_0x5cc3fb['set'](_0x880aed,_0x293e24);}}for(const {id:_0x4e2157,seg:_0x44fb6d}of _0x14a601){if(!_0x44fb6d[_0x26cf99(0x24f)])continue;const _0x2f5f6b=_0x5cc3fb['get'](_0x4e2157);if(!_0x2f5f6b)continue;const _0x4c9def=serializeExpandedRule(_0x2f5f6b,_0x5cc3fb),_0x385005=_0x4a4a79[_0x26cf99(0x252)](_0x4c9def);if(_0x385005){const _0x4c5255=_0x385005[_0x26cf99(0x25c)](_0x54010f=>_0x454d61['has'](_0x54010f));_0x4c5255&&(_0x2cc2a2[_0x26cf99(0x1a5)](_0x4c5255,_0x4e2157),_0x454d61[_0x26cf99(0x1bf)](_0x4c5255),logger['debug'](_0x26cf99(0x1e1)+_0x44fb6d['name']+'\x27\x20to\x20local\x20\x27'+_0x4c5255+_0x26cf99(0x1e6)));}}}}function a152_0x2b62(_0x45dde7,_0x41669b){_0x45dde7=_0x45dde7-0x195;const _0x429efc=a152_0x429e();let _0x2b62ff=_0x429efc[_0x45dde7];return _0x2b62ff;}async function executeSingleJourneyPush(_0x18a68a,_0x36235a,_0x29a5f4,_0x58e97c,_0x94913c,_0x1978eb){const _0x570268=a152_0x17e28a,{journeyDefToRequest:_0xeec273,activationDefToCreateRequest:_0x56a754,yamlRuleToApi:_0x1ab9e2,validateSegmentRule:_0xb5768e}=_0x1978eb,_0x3e3fe3=new Map(),_0x379d5e=new Map();recoverSegmentIdsFromPushRecovery(_0x36235a,_0x3e3fe3,_0x29a5f4[_0x570268(0x1ca)]);const _0x57b293=new Map(),_0x4b9bb4=new Map(),_0x17e27c=new Map();let _0x2066f2;const _0x4f691f=async()=>{const _0x154a12=_0x570268;if(_0x2066f2)return;_0x2066f2=new Map();if(!_0x36235a[_0x154a12(0x21c)])return;const _0x393850=await _0x18a68a[_0x154a12(0x197)]['listActivations'](_0x36235a[_0x154a12(0x21c)]['id']);for(const _0x534de0 of _0x393850){const _0x8c9f33=journeyActivationStepToYaml(_0x534de0,_0x29a5f4[_0x154a12(0x212)],_0x29a5f4[_0x154a12(0x199)]),_0x6816d3=activationSignature(_0x8c9f33);!_0x2066f2[_0x154a12(0x1f1)](_0x6816d3)&&_0x2066f2[_0x154a12(0x1a5)](_0x6816d3,_0x534de0['id']),_0x8c9f33[_0x154a12(0x255)]&&_0x379d5e[_0x154a12(0x1a5)](_0x8c9f33['name'],_0x534de0['id']);}};await matchExistingJourneySegments(_0x18a68a,_0x36235a,_0x58e97c[_0x570268(0x23b)],_0x29a5f4[_0x570268(0x1a7)],_0x29a5f4[_0x570268(0x1ca)]);const _0x4e5c83={'resolveSegmentId':async _0xb6e545=>{const _0xbc6a3=_0x570268,_0x5bd8b6=_0x29a5f4['segmentNameToId'][_0xbc6a3(0x252)](_0xb6e545);if(!_0x5bd8b6)throw new SDKError(ErrorCode[_0xbc6a3(0x223)],_0xbc6a3(0x1d1)+_0xb6e545+'\x20(referenced\x20in\x20journey\x20'+_0x36235a[_0xbc6a3(0x1a1)]['name']+')');return _0x5bd8b6;},'resolveEmbeddedSegmentId':async(_0x59549d,_0x11c945)=>{const _0x2284cb=_0x570268,_0x5a5917=_0x29a5f4[_0x2284cb(0x1ca)][_0x2284cb(0x252)](_0x59549d);if(_0x5a5917)return _0x5a5917;const _0x51b1be=_0x29a5f4['existingSegments'][_0x2284cb(0x25c)](_0x5a6082=>_0x5a6082['name']===_0x59549d);if(_0x51b1be)return _0x29a5f4[_0x2284cb(0x1ca)]['set'](_0x59549d,_0x51b1be['id']),_0x51b1be['id'];if(_0x36235a[_0x2284cb(0x1ce)]){const {stageName:_0x2d67b9,criteriaName:_0x2002e7}=findSegmentCriteriaLocation(_0x36235a[_0x2284cb(0x1a1)],_0x59549d);return _0xb5768e(_0x59549d,_0x11c945[_0x2284cb(0x24f)]),_0x4b9bb4[_0x2284cb(0x1a5)](_0x59549d,{'definition':_0x11c945,'stageName':_0x2d67b9,'criteriaName':_0x2002e7}),createPendingSegmentId(_0x59549d);}const _0x41a187=_0x36235a[_0x2284cb(0x21c)]?.['id'];if(!_0x41a187)throw new SDKError(ErrorCode[_0x2284cb(0x208)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x3e58b0=_0x57b293[_0x2284cb(0x252)](_0x59549d);if(_0x3e58b0)return _0x3e58b0;const _0x183829=((async()=>{const _0x4b0da8=_0x2284cb;_0xb5768e(_0x59549d,_0x11c945[_0x4b0da8(0x24f)]);const _0x51ea13=generateDeterministicJourneySegmentName(_0x36235a[_0x4b0da8(0x1a1)]['name'],_0x59549d),_0x30b627=_0x29a5f4[_0x4b0da8(0x1a7)][_0x4b0da8(0x25c)](_0x2a5e08=>_0x2a5e08[_0x4b0da8(0x255)]===_0x51ea13),_0x5c5c9d=createSegmentIdResolver(_0x29a5f4['segmentNameToId'],_0x59549d),_0x30c5fc=await resolveRuleSegmentIds(_0x11c945[_0x4b0da8(0x24f)],_0x5c5c9d);let _0x59f751;return _0x30b627?(await _0x18a68a['segment'][_0x4b0da8(0x239)](_0x58e97c[_0x4b0da8(0x23b)],_0x30b627['id'],{'description':_0x11c945[_0x4b0da8(0x1a2)]||'Entry\x20criteria:\x20'+_0x59549d,'rule':_0x1ab9e2(_0x30c5fc),'countPopulation':!![]}),_0x59f751=_0x30b627['id'],saveSegmentToPushRecovery(_0x36235a[_0x4b0da8(0x274)],_0x36235a['yamlConfig'][_0x4b0da8(0x255)],_0x59549d,{'segmentId':_0x59f751,'uniqueServerName':_0x51ea13,'createdAt':new Date()['toISOString']()})):_0x59f751=await createOrRecoverEmbeddedSegment(_0x18a68a,_0x36235a,{'localName':_0x59549d,'uniqueSegmentName':_0x51ea13,'description':_0x11c945[_0x4b0da8(0x1a2)]||_0x4b0da8(0x228)+_0x59549d,'journeyId':_0x41a187,'resolvedRule':_0x30c5fc,'parentId':_0x58e97c['parentId'],'folderId':_0x58e97c['rootFolderId']||''},_0x1ab9e2),_0x29a5f4['segmentNameToId']['set'](_0x59549d,_0x59f751),_0x3e3fe3[_0x4b0da8(0x1a5)](_0x59549d,_0x59f751),_0x59f751;})());_0x57b293['set'](_0x59549d,_0x183829);try{return await _0x183829;}finally{_0x57b293[_0x2284cb(0x1bf)](_0x59549d);}},'resolveActivationId':async _0x42ec18=>{const _0x22f8dc=_0x570268,_0x367bb7=_0x379d5e[_0x22f8dc(0x252)](_0x42ec18);if(_0x367bb7)return _0x367bb7;if(_0x36235a[_0x22f8dc(0x21c)]){await _0x4f691f();const _0x5de93e=_0x379d5e[_0x22f8dc(0x252)](_0x42ec18);if(_0x5de93e)return _0x5de93e;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x22f8dc(0x1ff)+_0x42ec18+_0x22f8dc(0x1f5)+_0x36235a[_0x22f8dc(0x1a1)][_0x22f8dc(0x255)]+_0x22f8dc(0x254)+_0x22f8dc(0x234));},'resolveEmbeddedActivationId':async(_0x3ca916,_0x2940a9)=>{const _0x3d73c1=_0x570268,_0x2b3dac=_0x379d5e[_0x3d73c1(0x252)](_0x3ca916);if(_0x2b3dac)return _0x2b3dac;if(_0x36235a[_0x3d73c1(0x1ce)])return _0x17e27c[_0x3d73c1(0x1a5)](_0x3ca916,_0x2940a9),createPendingActivationId(_0x3ca916);if(_0x36235a[_0x3d73c1(0x21c)]){await _0x4f691f();const _0x3aa29e=_0x379d5e[_0x3d73c1(0x252)](_0x2940a9[_0x3d73c1(0x255)]);if(_0x3aa29e)return _0x379d5e[_0x3d73c1(0x1a5)](_0x3ca916,_0x3aa29e),_0x3aa29e;const _0x2f82cc=activationSignature(_0x2940a9),_0x3ee645=_0x2066f2?.[_0x3d73c1(0x252)](_0x2f82cc);if(_0x3ee645)return _0x379d5e[_0x3d73c1(0x1a5)](_0x3ca916,_0x3ee645),_0x3ee645;const _0x26824=await _0x56a754(_0x2940a9,_0x29a5f4[_0x3d73c1(0x211)]),_0x597915={..._0x26824,..._0x2940a9[_0x3d73c1(0x22e)]!==undefined&&{'runAfterJourneyRefresh':_0x2940a9[_0x3d73c1(0x22e)]}},_0x3cdf64=await _0x18a68a['journey'][_0x3d73c1(0x1ed)](_0x36235a[_0x3d73c1(0x21c)]['id'],_0x597915);return _0x379d5e[_0x3d73c1(0x1a5)](_0x3ca916,_0x3cdf64['id']),_0x3cdf64['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x3d73c1(0x286));},'resolveJourneyId':async _0x8cd6ae=>{const _0x2bd853=_0x570268;try{return await _0x18a68a[_0x2bd853(0x197)][_0x2bd853(0x1d3)](_0x58e97c['parentId'],_0x8cd6ae);}catch(_0x33a081){throw new SDKError(ErrorCode[_0x2bd853(0x256)],'Journey\x20\x27'+_0x8cd6ae+_0x2bd853(0x291)+_0x36235a[_0x2bd853(0x1a1)][_0x2bd853(0x255)]+'\x27)',_0x33a081);}},'resolveStageId':async(_0x252a95,_0x35eb3c)=>{const _0x33e45e=_0x570268,_0x15574c=await _0x18a68a[_0x33e45e(0x197)][_0x33e45e(0x1d6)](_0x252a95),_0x3c12b8=_0x15574c[_0x33e45e(0x20d)][_0x33e45e(0x1c3)][_0x33e45e(0x25c)](_0x59416e=>_0x59416e[_0x33e45e(0x255)][_0x33e45e(0x23f)]()===_0x35eb3c[_0x33e45e(0x23f)]());if(!_0x3c12b8?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x33e45e(0x1fb)+_0x35eb3c+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x15574c[_0x33e45e(0x20d)]['journeyBundleName']||_0x15574c[_0x33e45e(0x20d)][_0x33e45e(0x255)])+'\x27');return _0x3c12b8['id'];}},_0x233d37=await _0xeec273(_0x36235a[_0x570268(0x1a1)],_0x58e97c[_0x570268(0x23b)],_0x4e5c83),_0x4e96ea=_0x58e97c[_0x570268(0x282)]||_0x58e97c[_0x570268(0x276)];_0x4e96ea&&(_0x233d37[_0x570268(0x1d2)]={'parentFolder':{'data':{'id':_0x4e96ea,'type':_0x570268(0x279)}}});if(_0x36235a[_0x570268(0x1ce)]){if(_0x4b9bb4[_0x570268(0x1e8)]>0x0||_0x17e27c[_0x570268(0x1e8)]>0x0)return await executeThreeStepJourneyCreate(_0x18a68a,_0x36235a,_0x233d37,{'pendingEmbeddedSegments':_0x4b9bb4,'pendingEmbeddedActivations':_0x17e27c,'embeddedSegmentNameToId':_0x3e3fe3,'journeyActivationNameToId':_0x379d5e},{..._0x58e97c,'effectiveFolderId':_0x4e96ea},_0x29a5f4,_0x94913c,_0x1978eb);else{ensureJourneyDefaults(_0x233d37[_0x570268(0x20d)]);const _0x301eff=await _0x18a68a[_0x570268(0x197)][_0x570268(0x20b)](_0x233d37);return deletePushRecovery(_0x36235a[_0x570268(0x274)]),{'action':'created','journeyId':_0x301eff['id'],'embeddedSegmentNameToId':_0x3e3fe3};}}else{if(_0x36235a[_0x570268(0x1d7)]&&_0x36235a['existingJourney']){_0x233d37['id']=_0x36235a[_0x570268(0x21c)]['id'];const _0x48a559=_0x233d37[_0x570268(0x20d)];_0x36235a['existingJourney'][_0x570268(0x20d)]?.[_0x570268(0x1c2)]&&(_0x48a559[_0x570268(0x1c2)]=_0x36235a['existingJourney'][_0x570268(0x20d)][_0x570268(0x1c2)]);const _0x158056=_0x36235a['existingJourney'][_0x570268(0x20d)]?.[_0x570268(0x1c3)];return _0x158056&&_0x233d37[_0x570268(0x20d)][_0x570268(0x1c3)]&&injectExistingStageIds(_0x233d37['attributes'][_0x570268(0x1c3)],_0x158056),ensureJourneyDefaults(_0x48a559),await _0x18a68a[_0x570268(0x197)][_0x570268(0x271)](_0x36235a[_0x570268(0x21c)]['id'],_0x233d37),deletePushRecovery(_0x36235a['absolutePath']),{'action':_0x570268(0x22b),'journeyId':_0x36235a[_0x570268(0x21c)]['id'],'embeddedSegmentNameToId':_0x3e3fe3};}}return deletePushRecovery(_0x36235a['absolutePath']),{'action':_0x570268(0x292),'journeyId':_0x36235a[_0x570268(0x21c)]?.['id'],'embeddedSegmentNameToId':_0x3e3fe3};}function findSegmentCriteriaLocation(_0x4ca252,_0x21d779){const _0x5ea1d0=a152_0x17e28a,_0x2a8795=_0x4ca252['stages']||_0x4ca252[_0x5ea1d0(0x229)]?.[0x0]?.['stages']||[];let _0x486b67=_0x5ea1d0(0x1a3),_0x37cc12=_0x21d779;const _0x5905bf=_0x4ca252[_0x5ea1d0(0x195)]||_0x4ca252[_0x5ea1d0(0x229)]?.[0x0]?.[_0x5ea1d0(0x195)];if(_0x5905bf?.[_0x5ea1d0(0x1ae)]===_0x21d779)return{'stageName':'goal','criteriaName':_0x5905bf[_0x5ea1d0(0x255)]||_0x21d779};_0xa11619:for(const _0x52160d of _0x2a8795){if(_0x52160d[_0x5ea1d0(0x1ec)]?.['segment']===_0x21d779){_0x486b67=_0x52160d[_0x5ea1d0(0x255)],_0x37cc12=_0x52160d[_0x5ea1d0(0x1ec)][_0x5ea1d0(0x255)]||_0x21d779;break;}if(_0x52160d[_0x5ea1d0(0x28d)])for(const _0x4fe1d3 of _0x52160d[_0x5ea1d0(0x28d)]){if(_0x4fe1d3[_0x5ea1d0(0x225)]==='decision_point'&&_0x4fe1d3['with']?.[_0x5ea1d0(0x201)])for(const _0x2683a3 of _0x4fe1d3[_0x5ea1d0(0x1b8)][_0x5ea1d0(0x201)]){if(_0x2683a3['segment']===_0x21d779){_0x486b67=_0x52160d['name'],_0x37cc12=_0x2683a3[_0x5ea1d0(0x255)]||_0x21d779;break _0xa11619;}}}}return{'stageName':_0x486b67,'criteriaName':_0x37cc12};}async function executeThreeStepJourneyCreate(_0x4388de,_0x835997,_0x236c93,_0x4b6d41,_0x2bfd6c,_0x400906,_0x263d3f,_0x46b109){const _0x28335d=a152_0x17e28a,{activationDefToCreateRequest:_0x2df998,yamlRuleToApi:_0x32f232}=_0x46b109,{pendingEmbeddedSegments:_0x32fa1a,pendingEmbeddedActivations:_0x28f4f5,embeddedSegmentNameToId:_0x45d2cb}=_0x4b6d41,_0x2aa79b=JSON['parse'](JSON['stringify'](_0x236c93));ensureJourneyDefaults(_0x2aa79b[_0x28335d(0x20d)]),stripPendingIds(_0x2aa79b);const _0x6a8eb6=await _0x4388de[_0x28335d(0x197)]['create'](_0x2aa79b),_0x258478=_0x6a8eb6['id'],_0x5a9bf2=new Map();for(const _0x298dcb of _0x6a8eb6[_0x28335d(0x20d)][_0x28335d(0x1c3)]){_0x5a9bf2[_0x28335d(0x1a5)](_0x298dcb[_0x28335d(0x255)][_0x28335d(0x23f)](),_0x298dcb['id']);}recoverSegmentIdsFromPushRecovery(_0x835997,_0x45d2cb,_0x400906[_0x28335d(0x1ca)]);for(const [_0x3ddeb5,{definition:_0x2c2a0d}]of _0x32fa1a){if(_0x45d2cb[_0x28335d(0x1f1)](_0x3ddeb5)){_0x263d3f[_0x28335d(0x1ee)]?.({'type':'embedded_segment_created','journeyName':_0x835997['yamlConfig'][_0x28335d(0x255)],'segmentName':_0x3ddeb5});continue;}const _0x1c9718=generateDeterministicJourneySegmentName(_0x835997[_0x28335d(0x1a1)]['name'],_0x3ddeb5);_0x263d3f[_0x28335d(0x1ee)]?.({'type':_0x28335d(0x218),'journeyName':_0x835997[_0x28335d(0x1a1)][_0x28335d(0x255)],'segmentName':_0x3ddeb5});const _0x48f672=createSegmentIdResolver(_0x400906[_0x28335d(0x1ca)],_0x3ddeb5),_0x567197=await resolveRuleSegmentIds(_0x2c2a0d[_0x28335d(0x24f)],_0x48f672),_0x2dbfd8=await createOrRecoverEmbeddedSegment(_0x4388de,_0x835997,{'localName':_0x3ddeb5,'uniqueSegmentName':_0x1c9718,'description':_0x2c2a0d[_0x28335d(0x1a2)]||_0x28335d(0x228)+_0x3ddeb5,'journeyId':_0x258478,'resolvedRule':_0x567197,'parentId':_0x2bfd6c[_0x28335d(0x23b)],'folderId':_0x2bfd6c['effectiveFolderId']||''},_0x32f232);_0x45d2cb[_0x28335d(0x1a5)](_0x3ddeb5,_0x2dbfd8),_0x400906[_0x28335d(0x1ca)]['set'](_0x3ddeb5,_0x2dbfd8),_0x263d3f[_0x28335d(0x1ee)]?.({'type':_0x28335d(0x200),'journeyName':_0x835997[_0x28335d(0x1a1)][_0x28335d(0x255)],'segmentName':_0x3ddeb5});}const _0x140805=new Map();for(const [_0x5a8659,_0x3c9e2f]of _0x28f4f5){_0x263d3f[_0x28335d(0x1ee)]?.({'type':'embedded_activation_creating','journeyName':_0x835997['yamlConfig'][_0x28335d(0x255)],'activationName':_0x5a8659});const _0x54f615=await _0x2df998(_0x3c9e2f,_0x400906['activationContext']),_0x1ce324={..._0x54f615,..._0x3c9e2f[_0x28335d(0x22e)]!==undefined&&{'runAfterJourneyRefresh':_0x3c9e2f[_0x28335d(0x22e)]}},_0x219ffa=await _0x4388de[_0x28335d(0x197)][_0x28335d(0x1ed)](_0x258478,_0x1ce324);_0x140805[_0x28335d(0x1a5)](_0x5a8659,_0x219ffa['id']),_0x4b6d41['journeyActivationNameToId'][_0x28335d(0x1a5)](_0x5a8659,_0x219ffa['id']),_0x263d3f[_0x28335d(0x1ee)]?.({'type':'embedded_activation_created','journeyName':_0x835997[_0x28335d(0x1a1)][_0x28335d(0x255)],'activationName':_0x5a8659});}const _0x4471e5=JSON[_0x28335d(0x1b7)](JSON[_0x28335d(0x20c)](_0x236c93));return _0x4471e5['id']=_0x258478,ensureJourneyDefaults(_0x4471e5['attributes']),resolvePendingIdsInRequest(_0x4471e5,_0x236c93,_0x5a9bf2,_0x45d2cb,_0x140805,_0x263d3f),await _0x4388de['journey'][_0x28335d(0x271)](_0x258478,_0x4471e5),deletePushRecovery(_0x835997[_0x28335d(0x274)]),{'action':'created','journeyId':_0x258478,'embeddedSegmentNameToId':_0x45d2cb};}export function stripWaitStepPendingIds(_0x1b8a85){const _0x4cc7e0=a152_0x17e28a,_0x1f8f32=_0x1b8a85[_0x4cc7e0(0x1f9)]&&isPendingSegmentId(_0x1b8a85[_0x4cc7e0(0x1f9)]),_0x233e09=_0x1b8a85[_0x4cc7e0(0x22a)]?.['some'](_0x16cd30=>_0x16cd30[_0x4cc7e0(0x19b)]&&isPendingSegmentId(_0x16cd30[_0x4cc7e0(0x19b)]));(_0x1f8f32||_0x233e09)&&(_0x1b8a85[_0x4cc7e0(0x233)]=_0x4cc7e0(0x243),_0x1b8a85['waitStep']=0x1,_0x1b8a85[_0x4cc7e0(0x1bc)]=_0x4cc7e0(0x1ba),delete _0x1b8a85[_0x4cc7e0(0x1f9)],delete _0x1b8a85['conditionTimeoutDuration'],delete _0x1b8a85[_0x4cc7e0(0x1f3)],delete _0x1b8a85[_0x4cc7e0(0x22a)]);}export function resolveWaitStepPendingIds(_0xe18169,_0x1d508b,_0x240ccb,_0x4625fc){const _0x7e2b46=a152_0x17e28a;if(_0x1d508b['conditionSegmentId']&&isPendingSegmentId(_0x1d508b['conditionSegmentId'])){const _0x59e21b=_0x240ccb(_0x1d508b[_0x7e2b46(0x1f9)],_0x7e2b46(0x213)+_0x4625fc+_0x7e2b46(0x1fc));_0x59e21b&&(_0xe18169[_0x7e2b46(0x233)]=_0x7e2b46(0x244),_0xe18169['conditionSegmentId']=_0x59e21b,delete _0xe18169[_0x7e2b46(0x280)],delete _0xe18169[_0x7e2b46(0x1bc)],_0x1d508b[_0x7e2b46(0x26a)]!==undefined&&(_0xe18169[_0x7e2b46(0x26a)]=_0x1d508b[_0x7e2b46(0x26a)]),_0x1d508b[_0x7e2b46(0x1f3)]&&(_0xe18169[_0x7e2b46(0x1f3)]=_0x1d508b[_0x7e2b46(0x1f3)]));}if(_0x1d508b[_0x7e2b46(0x22a)]){const _0xb54e0=_0x1d508b[_0x7e2b46(0x22a)]['some'](_0x2304b6=>_0x2304b6['segmentId']&&isPendingSegmentId(_0x2304b6[_0x7e2b46(0x19b)]));if(_0xb54e0){const _0x73b76f=_0x1d508b[_0x7e2b46(0x22a)][_0x7e2b46(0x21e)](_0x5e316b=>{const _0x39a087=_0x7e2b46;if(_0x5e316b[_0x39a087(0x19b)]&&isPendingSegmentId(_0x5e316b[_0x39a087(0x19b)])){const _0x1898b6=_0x240ccb(_0x5e316b[_0x39a087(0x19b)],_0x39a087(0x213)+_0x4625fc+'\x27\x20wait\x20condition');return{..._0x5e316b,'segmentId':_0x1898b6||_0x5e316b['segmentId']};}return{..._0x5e316b};});_0xe18169['waitStepType']='Condition',_0xe18169['conditions']=_0x73b76f,delete _0xe18169[_0x7e2b46(0x280)],delete _0xe18169['waitStepUnit'],delete _0xe18169['conditionSegmentId'],delete _0xe18169[_0x7e2b46(0x26a)],delete _0xe18169[_0x7e2b46(0x1f3)];}}}function stripPendingIds(_0x3babb0){const _0x2da600=a152_0x17e28a;_0x3babb0[_0x2da600(0x20d)]['goal']?.['segmentId']&&isPendingSegmentId(_0x3babb0[_0x2da600(0x20d)]['goal']['segmentId'])&&delete _0x3babb0[_0x2da600(0x20d)][_0x2da600(0x195)];for(const _0x3608de of _0x3babb0[_0x2da600(0x20d)][_0x2da600(0x1c3)]||[]){_0x3608de['entryCriteria']?.[_0x2da600(0x19b)]&&isPendingSegmentId(_0x3608de[_0x2da600(0x216)][_0x2da600(0x19b)])&&delete _0x3608de[_0x2da600(0x216)];_0x3608de[_0x2da600(0x261)]?.[_0x2da600(0x19b)]&&isPendingSegmentId(_0x3608de[_0x2da600(0x261)][_0x2da600(0x19b)])&&delete _0x3608de[_0x2da600(0x261)];_0x3608de[_0x2da600(0x1cd)]&&(_0x3608de['exitCriterias']=_0x3608de[_0x2da600(0x1cd)][_0x2da600(0x1fe)](_0x38c919=>!_0x38c919[_0x2da600(0x19b)]||!isPendingSegmentId(_0x38c919[_0x2da600(0x19b)])));if(_0x3608de[_0x2da600(0x28d)])for(const _0x455c74 of Object[_0x2da600(0x19d)](_0x3608de[_0x2da600(0x28d)])){const _0x2e0b6f=_0x3608de['steps'][_0x455c74];_0x2e0b6f[_0x2da600(0x225)]===_0x2da600(0x1c0)&&_0x2e0b6f[_0x2da600(0x257)]&&isPendingActivationId(_0x2e0b6f['journeyActivationStepId'])&&(_0x2e0b6f['journeyActivationStepId']='');if(_0x2e0b6f[_0x2da600(0x225)]==='DecisionPoint'&&_0x2e0b6f['branches'])for(const _0x4499e7 of _0x2e0b6f['branches']){_0x4499e7[_0x2da600(0x19b)]&&isPendingSegmentId(_0x4499e7[_0x2da600(0x19b)])&&(_0x4499e7[_0x2da600(0x19b)]='');}_0x2e0b6f[_0x2da600(0x225)]===_0x2da600(0x1a4)&&stripWaitStepPendingIds(_0x2e0b6f);}}}function resolvePendingIdsInRequest(_0x5d7fe8,_0xf89adf,_0x37ba32,_0x4b94f8,_0xa0e47a,_0x5ba0eb){const _0xad1aad=a152_0x17e28a,_0x4a5291=(_0x1b0902,_0x38754f)=>{const _0x2e712b=a152_0x2b62;if(!isPendingSegmentId(_0x1b0902))return _0x1b0902;const _0x3a32b4=extractPendingSegmentName(_0x1b0902),_0x1b3a24=_0x4b94f8[_0x2e712b(0x252)](_0x3a32b4);return!_0x1b3a24&&_0x5ba0eb[_0x2e712b(0x25f)]?.(_0x2e712b(0x19f)+_0x3a32b4+_0x2e712b(0x210)+_0x38754f),_0x1b3a24;};if(_0x5d7fe8['attributes']['goal']?.[_0xad1aad(0x19b)]&&isPendingSegmentId(_0x5d7fe8[_0xad1aad(0x20d)][_0xad1aad(0x195)][_0xad1aad(0x19b)])){const _0x52a891=_0x4a5291(_0x5d7fe8['attributes'][_0xad1aad(0x195)][_0xad1aad(0x19b)],_0xad1aad(0x1cf));_0x52a891&&(_0x5d7fe8[_0xad1aad(0x20d)][_0xad1aad(0x195)]['segmentId']=_0x52a891);}for(const _0x2536a9 of _0x5d7fe8['attributes'][_0xad1aad(0x1c3)]||[]){const _0x157dbd=_0x37ba32['get'](_0x2536a9[_0xad1aad(0x255)][_0xad1aad(0x23f)]());_0x157dbd&&(_0x2536a9['id']=_0x157dbd);if(_0x2536a9['entryCriteria']?.[_0xad1aad(0x19b)]&&isPendingSegmentId(_0x2536a9['entryCriteria'][_0xad1aad(0x19b)])){const _0x1729d6=_0x4a5291(_0x2536a9[_0xad1aad(0x216)][_0xad1aad(0x19b)],_0xad1aad(0x213)+_0x2536a9[_0xad1aad(0x255)]+_0xad1aad(0x1fa));_0x1729d6&&(_0x2536a9[_0xad1aad(0x216)][_0xad1aad(0x19b)]=_0x1729d6);}if(_0x2536a9[_0xad1aad(0x1cd)])for(const _0x1735f1 of _0x2536a9[_0xad1aad(0x1cd)]){if(_0x1735f1[_0xad1aad(0x19b)]&&isPendingSegmentId(_0x1735f1['segmentId'])){const _0x25de4a=_0x4a5291(_0x1735f1[_0xad1aad(0x19b)],_0xad1aad(0x213)+_0x2536a9['name']+_0xad1aad(0x1d8));_0x25de4a&&(_0x1735f1[_0xad1aad(0x19b)]=_0x25de4a);}}if(_0x2536a9[_0xad1aad(0x261)]?.[_0xad1aad(0x19b)]&&isPendingSegmentId(_0x2536a9[_0xad1aad(0x261)][_0xad1aad(0x19b)])){const _0x2011be=_0x4a5291(_0x2536a9['milestone'][_0xad1aad(0x19b)],_0xad1aad(0x213)+_0x2536a9[_0xad1aad(0x255)]+_0xad1aad(0x1a8));_0x2011be&&(_0x2536a9['milestone'][_0xad1aad(0x19b)]=_0x2011be);}if(_0x2536a9['steps']){const _0x5a8dc5=_0x4dce6c=>_0xf89adf['attributes'][_0xad1aad(0x1c3)]?.['find'](_0x5038eb=>_0x5038eb[_0xad1aad(0x255)]['toLowerCase']()===_0x2536a9[_0xad1aad(0x255)]['toLowerCase']())?.[_0xad1aad(0x28d)]?.[_0x4dce6c];for(const _0x219ebe of Object[_0xad1aad(0x19d)](_0x2536a9[_0xad1aad(0x28d)])){const _0x3cbbbe=_0x2536a9['steps'][_0x219ebe],_0x23293a=_0x5a8dc5(_0x219ebe);if(_0x3cbbbe[_0xad1aad(0x225)]===_0xad1aad(0x1c0)&&_0x3cbbbe[_0xad1aad(0x257)]&&(isPendingActivationId(_0x3cbbbe[_0xad1aad(0x257)])||_0x3cbbbe[_0xad1aad(0x257)]==='')){if(_0x23293a?.['journeyActivationStepId']&&isPendingActivationId(_0x23293a['journeyActivationStepId'])){const _0x488753=extractPendingActivationName(_0x23293a[_0xad1aad(0x257)]),_0x1bff81=_0xa0e47a[_0xad1aad(0x252)](_0x488753);_0x1bff81&&(_0x3cbbbe[_0xad1aad(0x257)]=_0x1bff81);}}if(_0x3cbbbe[_0xad1aad(0x225)]===_0xad1aad(0x284)&&_0x3cbbbe['branches']&&_0x23293a?.[_0xad1aad(0x201)])for(let _0x1a0a89=0x0;_0x1a0a89<_0x3cbbbe[_0xad1aad(0x201)][_0xad1aad(0x27c)];_0x1a0a89++){const _0x2708b9=_0x3cbbbe[_0xad1aad(0x201)][_0x1a0a89],_0x5a6aea=_0x23293a[_0xad1aad(0x201)][_0x1a0a89];if(_0x5a6aea?.[_0xad1aad(0x19b)]&&isPendingSegmentId(_0x5a6aea[_0xad1aad(0x19b)])){const _0x2de1d6=_0x4a5291(_0x5a6aea[_0xad1aad(0x19b)],'stage\x20\x27'+_0x2536a9['name']+_0xad1aad(0x1f2)+(_0x2708b9[_0xad1aad(0x255)]||_0x1a0a89)+'\x27');_0x2de1d6&&(_0x2708b9[_0xad1aad(0x19b)]=_0x2de1d6);}}_0x3cbbbe[_0xad1aad(0x225)]===_0xad1aad(0x1a4)&&_0x23293a?.['type']===_0xad1aad(0x1a4)&&resolveWaitStepPendingIds(_0x3cbbbe,_0x23293a,_0x4a5291,_0x2536a9['name']);}}}}
@@ -1 +1 @@
1
- (function(_0x1ca830,_0x2c353d){const _0x19076e=a153_0x2a48,_0x33712d=_0x1ca830();while(!![]){try{const _0x4000d7=-parseInt(_0x19076e(0xff))/0x1+-parseInt(_0x19076e(0xfb))/0x2*(parseInt(_0x19076e(0x101))/0x3)+-parseInt(_0x19076e(0xf9))/0x4+-parseInt(_0x19076e(0xf7))/0x5+-parseInt(_0x19076e(0xf8))/0x6+parseInt(_0x19076e(0xfa))/0x7*(parseInt(_0x19076e(0x102))/0x8)+parseInt(_0x19076e(0xf4))/0x9*(parseInt(_0x19076e(0xf5))/0xa);if(_0x4000d7===_0x2c353d)break;else _0x33712d['push'](_0x33712d['shift']());}catch(_0x5dea87){_0x33712d['push'](_0x33712d['shift']());}}}(a153_0x1839,0xcda16));export function buildFolderIdToPathMap(_0x236fe1){const _0x564728=a153_0x2a48,_0x12e8eb=new Map(),_0x577b32=new Map();for(const _0xf936ff of _0x236fe1){_0x577b32['set'](_0xf936ff['id'],_0xf936ff);}const _0x3d8b22=new Set();for(const _0x572a00 of _0x236fe1){!_0x572a00[_0x564728(0xfc)]&&_0x3d8b22['add'](_0x572a00['id']);}function _0x380556(_0x27ac4d){const _0x44a40b=_0x564728;if(_0x12e8eb[_0x44a40b(0x100)](_0x27ac4d['id']))return _0x12e8eb[_0x44a40b(0xfe)](_0x27ac4d['id']);if(_0x3d8b22[_0x44a40b(0x100)](_0x27ac4d['id']))return _0x12e8eb[_0x44a40b(0x103)](_0x27ac4d['id'],''),'';if(_0x27ac4d[_0x44a40b(0xfc)]){const _0x168721=_0x577b32['get'](_0x27ac4d[_0x44a40b(0xfc)]);if(_0x168721){const _0xe0f32a=_0x380556(_0x168721),_0x3513ec=_0xe0f32a?_0xe0f32a+'/'+_0x27ac4d[_0x44a40b(0xf6)]:_0x27ac4d[_0x44a40b(0xf6)];return _0x12e8eb[_0x44a40b(0x103)](_0x27ac4d['id'],_0x3513ec),_0x3513ec;}}const _0x2d0984=_0x27ac4d[_0x44a40b(0xf6)];return _0x12e8eb['set'](_0x27ac4d['id'],_0x2d0984),_0x2d0984;}for(const _0x3fe089 of _0x236fe1){_0x380556(_0x3fe089);}return _0x12e8eb;}export function buildFolderPathToIdMap(_0x2f4d45){const _0x32ea16=a153_0x2a48,_0xac19d4=new Map(),_0x168718=new Map();for(const _0x38f300 of _0x2f4d45){_0x168718[_0x32ea16(0x103)](_0x38f300['id'],_0x38f300);}const _0xef6796=new Set();for(const _0x33e0ae of _0x2f4d45){!_0x33e0ae[_0x32ea16(0xfc)]&&_0xef6796[_0x32ea16(0xfd)](_0x33e0ae['id']);}function _0x20f703(_0x5b8fc0){const _0xe8c840=_0x32ea16;if(_0xef6796[_0xe8c840(0x100)](_0x5b8fc0['id']))return'';if(_0x5b8fc0[_0xe8c840(0xfc)]){const _0x37bd2c=_0x168718['get'](_0x5b8fc0['parentFolderId']);if(_0x37bd2c){const _0x110e73=_0x20f703(_0x37bd2c);return _0x110e73?_0x110e73+'/'+_0x5b8fc0[_0xe8c840(0xf6)]:_0x5b8fc0[_0xe8c840(0xf6)];}}return _0x5b8fc0[_0xe8c840(0xf6)];}for(const _0x18a3ac of _0x2f4d45){const _0x4d9300=_0x20f703(_0x18a3ac);_0xac19d4['set'](_0x4d9300,_0x18a3ac['id']);}return _0xac19d4;}export function buildFolderMaps(_0x2db34f){const _0x481864=a153_0x2a48,_0x52d192=buildFolderIdToPathMap(_0x2db34f),_0x4985c2=new Map();for(const [_0x94aa88,_0xf8babe]of _0x52d192){_0x4985c2[_0x481864(0x103)](_0xf8babe,_0x94aa88);}return{'idToPath':_0x52d192,'pathToId':_0x4985c2};}function a153_0x2a48(_0x1b7f81,_0x366335){_0x1b7f81=_0x1b7f81-0xf4;const _0x18392b=a153_0x1839();let _0x2a4838=_0x18392b[_0x1b7f81];return _0x2a4838;}function a153_0x1839(){const _0x2bb67d=['2mwQWOp','parentFolderId','add','get','1151384oMJONu','has','2184303YjcSON','72TJesPW','set','163431ZyXcpG','1910jiGSxI','name','1190155dncpLN','1531080sgUIHs','1313416HnUQoe','58289GWhvSo'];a153_0x1839=function(){return _0x2bb67d;};return a153_0x1839();}export function getFolderPath(_0x6657af,_0x4b4826){if(!_0x6657af)return'';return _0x4b4826['get'](_0x6657af)??'';}
1
+ function a153_0x1b05(_0x524db6,_0x511b31){_0x524db6=_0x524db6-0x16b;const _0x43dc7e=a153_0x43dc();let _0x1b0540=_0x43dc7e[_0x524db6];return _0x1b0540;}(function(_0x4959e8,_0x260d1b){const _0x5416ae=a153_0x1b05,_0x40da8f=_0x4959e8();while(!![]){try{const _0x215693=parseInt(_0x5416ae(0x16d))/0x1+parseInt(_0x5416ae(0x177))/0x2*(parseInt(_0x5416ae(0x173))/0x3)+parseInt(_0x5416ae(0x16b))/0x4+parseInt(_0x5416ae(0x16c))/0x5+-parseInt(_0x5416ae(0x170))/0x6*(parseInt(_0x5416ae(0x16e))/0x7)+parseInt(_0x5416ae(0x178))/0x8+-parseInt(_0x5416ae(0x179))/0x9*(parseInt(_0x5416ae(0x175))/0xa);if(_0x215693===_0x260d1b)break;else _0x40da8f['push'](_0x40da8f['shift']());}catch(_0x17808e){_0x40da8f['push'](_0x40da8f['shift']());}}}(a153_0x43dc,0xd8bf6));export function buildFolderIdToPathMap(_0x5b9f85){const _0x38feed=a153_0x1b05,_0x4804eb=new Map(),_0x303e21=new Map();for(const _0x513f18 of _0x5b9f85){_0x303e21[_0x38feed(0x176)](_0x513f18['id'],_0x513f18);}const _0x1e757a=new Set();for(const _0x324539 of _0x5b9f85){!_0x324539[_0x38feed(0x17a)]&&_0x1e757a['add'](_0x324539['id']);}function _0x45d8e0(_0x193645){const _0xa9e065=_0x38feed;if(_0x4804eb[_0xa9e065(0x174)](_0x193645['id']))return _0x4804eb[_0xa9e065(0x171)](_0x193645['id']);if(_0x1e757a[_0xa9e065(0x174)](_0x193645['id']))return _0x4804eb['set'](_0x193645['id'],''),'';if(_0x193645['parentFolderId']){const _0x52ba86=_0x303e21[_0xa9e065(0x171)](_0x193645[_0xa9e065(0x17a)]);if(_0x52ba86){const _0x1c2f48=_0x45d8e0(_0x52ba86),_0x2c375c=_0x1c2f48?_0x1c2f48+'/'+_0x193645[_0xa9e065(0x172)]:_0x193645['name'];return _0x4804eb[_0xa9e065(0x176)](_0x193645['id'],_0x2c375c),_0x2c375c;}}const _0x856a58=_0x193645['name'];return _0x4804eb[_0xa9e065(0x176)](_0x193645['id'],_0x856a58),_0x856a58;}for(const _0x80a67e of _0x5b9f85){_0x45d8e0(_0x80a67e);}return _0x4804eb;}export function buildFolderPathToIdMap(_0x306f53){const _0xa61e0=a153_0x1b05,_0x1f9428=new Map(),_0x5adeac=new Map();for(const _0x298d83 of _0x306f53){_0x5adeac[_0xa61e0(0x176)](_0x298d83['id'],_0x298d83);}const _0x4686c8=new Set();for(const _0x3f294b of _0x306f53){!_0x3f294b[_0xa61e0(0x17a)]&&_0x4686c8[_0xa61e0(0x16f)](_0x3f294b['id']);}function _0x361007(_0x3db485){const _0xafb208=_0xa61e0;if(_0x4686c8['has'](_0x3db485['id']))return'';if(_0x3db485[_0xafb208(0x17a)]){const _0x34989f=_0x5adeac[_0xafb208(0x171)](_0x3db485[_0xafb208(0x17a)]);if(_0x34989f){const _0x524af0=_0x361007(_0x34989f);return _0x524af0?_0x524af0+'/'+_0x3db485['name']:_0x3db485[_0xafb208(0x172)];}}return _0x3db485['name'];}for(const _0x486558 of _0x306f53){const _0x1eca64=_0x361007(_0x486558);_0x1f9428[_0xa61e0(0x176)](_0x1eca64,_0x486558['id']);}return _0x1f9428;}function a153_0x43dc(){const _0x211af1=['679ELNsfx','add','81282WXsYsL','get','name','3aSRqPf','has','90ojZaeX','set','2939446wwXFke','11914464AFjLxk','3250773sLCCCb','parentFolderId','4643460dwavHv','5939345oBfsfw','144865SbXWCY'];a153_0x43dc=function(){return _0x211af1;};return a153_0x43dc();}export function buildFolderMaps(_0x297173){const _0x4780f9=a153_0x1b05,_0x52fece=buildFolderIdToPathMap(_0x297173),_0x20b3e4=new Map();for(const [_0x1ec1dd,_0x10cb48]of _0x52fece){_0x20b3e4[_0x4780f9(0x176)](_0x10cb48,_0x1ec1dd);}return{'idToPath':_0x52fece,'pathToId':_0x20b3e4};}export function getFolderPath(_0x347be7,_0x16a6bd){const _0x38a096=a153_0x1b05;if(!_0x347be7)return'';return _0x16a6bd[_0x38a096(0x171)](_0x347be7)??'';}
@@ -1 +1 @@
1
- (function(_0x2b0c4f,_0x14f2ce){const _0x5d412a=a154_0x2f9d,_0x56b587=_0x2b0c4f();while(!![]){try{const _0x1bba6e=-parseInt(_0x5d412a(0x16a))/0x1*(-parseInt(_0x5d412a(0x159))/0x2)+parseInt(_0x5d412a(0x14b))/0x3+parseInt(_0x5d412a(0x14a))/0x4+-parseInt(_0x5d412a(0x147))/0x5+-parseInt(_0x5d412a(0x171))/0x6+parseInt(_0x5d412a(0x144))/0x7+-parseInt(_0x5d412a(0x148))/0x8;if(_0x1bba6e===_0x14f2ce)break;else _0x56b587['push'](_0x56b587['shift']());}catch(_0x2d5dc7){_0x56b587['push'](_0x56b587['shift']());}}}(a154_0x4707,0xee461));import a154_0x523f68 from'path';import{parse as a154_0x4291b7}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a154_0x2f9d(_0x1691a1,_0x4620d6){_0x1691a1=_0x1691a1-0x144;const _0x470704=a154_0x4707();let _0x2f9dbe=_0x470704[_0x1691a1];return _0x2f9dbe;}export function parsePath(_0x48d4aa){const _0x267601=a154_0x2f9d;if(!_0x48d4aa||_0x48d4aa[_0x267601(0x149)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0xbe83d2=_0x48d4aa[_0x267601(0x149)]();if(_0xbe83d2==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x48d4aa};const _0x15d936=_0xbe83d2[_0x267601(0x15c)]('/')?_0xbe83d2[_0x267601(0x14e)](0x1):_0xbe83d2,_0x424938=_0x15d936[_0x267601(0x15b)]('/')[_0x267601(0x173)](_0x48bc9e=>_0x48bc9e!=='');if(_0x424938['length']===0x0)throw new Error(_0x267601(0x154));const _0x426378=_0xbe83d2[_0x267601(0x15c)]('/')||!isRelativePathSegment(_0x424938[0x0]);for(const _0x4d4a7e of _0x424938){validatePathSegment(_0x4d4a7e);}return{'segments':_0x424938,'isAbsolute':_0x426378,'raw':_0x48d4aa};}function isRelativePathSegment(_0x2b7d9c){return _0x2b7d9c==='.'||_0x2b7d9c==='..';}function validatePathSegment(_0x2bafc1){const _0x8dfe77=a154_0x2f9d;if(_0x2bafc1==='')throw new Error(_0x8dfe77(0x174));if(_0x2bafc1==='.'||_0x2bafc1==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x2bafc1))throw new Error(_0x8dfe77(0x14c)+_0x2bafc1);if(_0x2bafc1!==_0x2bafc1['trim']()){}}export function validatePath(_0x1c3399){const _0x246a87=a154_0x2f9d;if(_0x1c3399[_0x246a87(0x160)]['length']===0x0&&!_0x1c3399['isAbsolute'])throw new Error(_0x246a87(0x157));if(_0x1c3399[_0x246a87(0x145)]){if(_0x1c3399[_0x246a87(0x160)][0x0]==='..')throw new Error(_0x246a87(0x158));let _0x20a5d9=0x0;for(const _0x1be556 of _0x1c3399[_0x246a87(0x160)]){if(_0x1be556==='..'){if(_0x20a5d9===0x0)throw new Error(_0x246a87(0x14d));_0x20a5d9--;}else _0x1be556!=='.'&&_0x20a5d9++;}}}export function joinPaths(_0x58beab,_0x3a3cfe){const _0xcf628c=a154_0x2f9d;if(!_0x58beab||_0x58beab==='/')return _0x3a3cfe;if(!_0x3a3cfe||_0x3a3cfe==='.')return _0x58beab;if(_0x3a3cfe[_0xcf628c(0x15c)]('/'))return _0x3a3cfe;const _0x12bb0b=parsePath(_0x58beab),_0x528432=parsePath(_0x3a3cfe),_0xc08347=[..._0x12bb0b[_0xcf628c(0x160)]];for(const _0x409fd8 of _0x528432['segments']){if(_0x409fd8==='.')continue;else{if(_0x409fd8==='..'){if(_0xc08347['length']===0x0)throw new Error(_0xcf628c(0x16f));_0xc08347['pop']();}else _0xc08347[_0xcf628c(0x15a)](_0x409fd8);}}const _0x54c4d4=_0xc08347[_0xcf628c(0x164)]('/');return _0x12bb0b[_0xcf628c(0x152)][_0xcf628c(0x15c)]('/')?'/'+_0x54c4d4:_0x54c4d4;}export function normalizePath(_0x42394e){const _0x2f589f=a154_0x2f9d,_0x36bb7a=parsePath(_0x42394e),_0x5390c4=[];for(const _0x1c4332 of _0x36bb7a[_0x2f589f(0x160)]){if(_0x1c4332==='.')continue;else{if(_0x1c4332==='..'){if(_0x5390c4[_0x2f589f(0x167)]===0x0){if(_0x36bb7a[_0x2f589f(0x145)])throw new Error(_0x2f589f(0x16f));_0x5390c4[_0x2f589f(0x15a)]('..');}else _0x5390c4[_0x5390c4['length']-0x1]==='..'?_0x5390c4[_0x2f589f(0x15a)]('..'):_0x5390c4[_0x2f589f(0x146)]();}else _0x5390c4['push'](_0x1c4332);}}if(_0x5390c4[_0x2f589f(0x167)]===0x0)return _0x36bb7a[_0x2f589f(0x145)]?'/':'.';const _0x23fd50=_0x5390c4[_0x2f589f(0x164)]('/');return _0x36bb7a[_0x2f589f(0x152)][_0x2f589f(0x15c)]('/')?'/'+_0x23fd50:_0x23fd50;}function a154_0x4707(){const _0x40a77b=['segment','Cannot\x20navigate\x20above\x20root','File\x20not\x20found:\x20','9271110QredUt','parent_segment','filter','Path\x20segment\x20cannot\x20be\x20empty','12663910scHbnA','isAbsolute','pop','4645235HXRvjX','3885032Inhkmx','trim','1818044HweMxg','253254wexgpg','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Path\x20attempts\x20to\x20navigate\x20above\x20root','substring','relative','No\x20tdx.json\x20found\x20for\x20file:\x20','type','raw','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','replace','name','Relative\x20path\x20cannot\x20be\x20empty','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','2YBWCie','push','split','startsWith','journey','readFile','.yaml','segments','.yml','exists','slice','join','root','Cannot\x20split\x20empty\x20path','length','parse','endsWith','1587771NkGhdY','tdx.json','dirname','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.'];a154_0x4707=function(){return _0x40a77b;};return a154_0x4707();}export function getParentPath(_0x611d85){const _0xa1447d=a154_0x2f9d,_0x218ccb=parsePath(_0x611d85);if(_0x218ccb[_0xa1447d(0x160)]['length']<=0x1)return'/';const _0x1b78cc=_0x218ccb[_0xa1447d(0x160)]['slice'](0x0,-0x1)[_0xa1447d(0x164)]('/');return _0x218ccb[_0xa1447d(0x152)][_0xa1447d(0x15c)]('/')?'/'+_0x1b78cc:_0x1b78cc;}export function getBaseName(_0x31eee1){const _0x45a032=a154_0x2f9d,_0x9f070b=parsePath(_0x31eee1);return _0x9f070b[_0x45a032(0x160)][_0x9f070b['segments'][_0x45a032(0x167)]-0x1]||'';}export function isChildPath(_0x4dae19,_0x523f79){const _0x8a6646=a154_0x2f9d,_0x314bc7=parsePath(_0x4dae19),_0x415e67=parsePath(_0x523f79);if(_0x314bc7[_0x8a6646(0x160)]['length']<=_0x415e67['segments'][_0x8a6646(0x167)])return![];for(let _0x2f5418=0x0;_0x2f5418<_0x415e67[_0x8a6646(0x160)][_0x8a6646(0x167)];_0x2f5418++){if(_0x314bc7[_0x8a6646(0x160)][_0x2f5418]!==_0x415e67[_0x8a6646(0x160)][_0x2f5418])return![];}return!![];}export function splitPath(_0x5a2bba){const _0x4e4ca8=a154_0x2f9d,_0x1357c8=parsePath(_0x5a2bba);if(_0x1357c8[_0x4e4ca8(0x160)][_0x4e4ca8(0x167)]===0x0)throw new Error(_0x4e4ca8(0x166));if(_0x1357c8[_0x4e4ca8(0x160)][_0x4e4ca8(0x167)]===0x1)return{'parent':_0x1357c8[_0x4e4ca8(0x160)][0x0]};return{'parent':_0x1357c8[_0x4e4ca8(0x160)][0x0],'child':_0x1357c8[_0x4e4ca8(0x160)][_0x4e4ca8(0x163)](0x1)[_0x4e4ca8(0x164)]('/')};}export function isYamlFilePath(_0x57bdb9){const _0x4db794=a154_0x2f9d;return _0x57bdb9['endsWith'](_0x4db794(0x161))||_0x57bdb9[_0x4db794(0x169)](_0x4db794(0x15f));}export async function resolveYamlFilePath(_0x1927ae,_0x7409b1=nodeFileSystem){const _0x47e382=a154_0x2f9d,_0x211837=a154_0x523f68['resolve'](_0x1927ae);if(!await _0x7409b1[_0x47e382(0x162)](_0x211837))throw new Error(_0x47e382(0x170)+_0x1927ae);let _0x56ad31=a154_0x523f68[_0x47e382(0x16c)](_0x211837),_0x426427=null,_0x4aacd3=null;const _0x4cda30=a154_0x523f68[_0x47e382(0x168)](_0x56ad31)[_0x47e382(0x165)];while(_0x56ad31!==_0x4cda30){const _0x58950f=a154_0x523f68['join'](_0x56ad31,_0x47e382(0x16b));if(await _0x7409b1[_0x47e382(0x162)](_0x58950f)){_0x426427=_0x58950f,_0x4aacd3=_0x56ad31;break;}_0x56ad31=a154_0x523f68[_0x47e382(0x16c)](_0x56ad31);}if(!_0x426427||!_0x4aacd3)throw new Error(_0x47e382(0x150)+_0x1927ae+'\x0a'+_0x47e382(0x16d));const _0x9609b6=await _0x7409b1['readFile'](_0x426427),_0x352bd5=JSON[_0x47e382(0x168)](_0x9609b6),_0x5d264a=_0x352bd5[_0x47e382(0x172)];if(!_0x5d264a)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x3693ba=await _0x7409b1[_0x47e382(0x15e)](_0x211837),_0x5db8cc=a154_0x4291b7(_0x3693ba),_0x35c57b=_0x5db8cc[_0x47e382(0x156)];if(!_0x35c57b)throw new Error(_0x47e382(0x153)+_0x1927ae);const _0x4b4b2f=_0x5db8cc[_0x47e382(0x151)]===_0x47e382(0x15d)?_0x47e382(0x15d):_0x47e382(0x16e),_0x281319=a154_0x523f68[_0x47e382(0x14f)](_0x4aacd3,_0x211837),_0x17457f=a154_0x523f68[_0x47e382(0x16c)](_0x281319),_0x62611c=_0x17457f==='.'?'':_0x17457f[_0x47e382(0x155)](/\\/g,'/'),_0x410429=_0x62611c?_0x5d264a+'/'+_0x62611c+'/'+_0x35c57b:_0x5d264a+'/'+_0x35c57b;return{'parentSegment':_0x5d264a,'segmentName':_0x35c57b,'folderPath':_0x62611c,'fullPath':_0x410429,'resourceType':_0x4b4b2f,'content':_0x3693ba};}
1
+ (function(_0x17e315,_0x13b2d2){const _0x24d08a=a154_0x3953,_0x18a16b=_0x17e315();while(!![]){try{const _0x1d4a51=parseInt(_0x24d08a(0x189))/0x1+-parseInt(_0x24d08a(0x183))/0x2*(-parseInt(_0x24d08a(0x178))/0x3)+parseInt(_0x24d08a(0x166))/0x4+-parseInt(_0x24d08a(0x164))/0x5*(parseInt(_0x24d08a(0x18a))/0x6)+-parseInt(_0x24d08a(0x16a))/0x7*(parseInt(_0x24d08a(0x185))/0x8)+parseInt(_0x24d08a(0x162))/0x9+-parseInt(_0x24d08a(0x184))/0xa*(parseInt(_0x24d08a(0x171))/0xb);if(_0x1d4a51===_0x13b2d2)break;else _0x18a16b['push'](_0x18a16b['shift']());}catch(_0x3490dd){_0x18a16b['push'](_0x18a16b['shift']());}}}(a154_0x51a3,0xee9d5));import a154_0x1c0d97 from'path';import{parse as a154_0x35291c}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x3122dc){const _0x2f5c0c=a154_0x3953;if(!_0x3122dc||_0x3122dc[_0x2f5c0c(0x18c)]()==='')throw new Error(_0x2f5c0c(0x187));const _0x217f03=_0x3122dc['trim']();if(_0x217f03==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x3122dc};const _0x218285=_0x217f03[_0x2f5c0c(0x165)]('/')?_0x217f03[_0x2f5c0c(0x17f)](0x1):_0x217f03,_0x28be1e=_0x218285[_0x2f5c0c(0x170)]('/')[_0x2f5c0c(0x17b)](_0x4b2e4f=>_0x4b2e4f!=='');if(_0x28be1e[_0x2f5c0c(0x168)]===0x0)throw new Error(_0x2f5c0c(0x16b));const _0x2ea516=_0x217f03['startsWith']('/')||!isRelativePathSegment(_0x28be1e[0x0]);for(const _0x5e1659 of _0x28be1e){validatePathSegment(_0x5e1659);}return{'segments':_0x28be1e,'isAbsolute':_0x2ea516,'raw':_0x3122dc};}function isRelativePathSegment(_0x335641){return _0x335641==='.'||_0x335641==='..';}function validatePathSegment(_0x4d4b8c){const _0x2dbafa=a154_0x3953;if(_0x4d4b8c==='')throw new Error(_0x2dbafa(0x190));if(_0x4d4b8c==='.'||_0x4d4b8c==='..')return;if(/[\x00-\x1F\x7F]/[_0x2dbafa(0x167)](_0x4d4b8c))throw new Error(_0x2dbafa(0x188)+_0x4d4b8c);if(_0x4d4b8c!==_0x4d4b8c[_0x2dbafa(0x18c)]()){}}export function validatePath(_0x10b6a9){const _0x521832=a154_0x3953;if(_0x10b6a9['segments'][_0x521832(0x168)]===0x0&&!_0x10b6a9[_0x521832(0x174)])throw new Error(_0x521832(0x172));if(_0x10b6a9[_0x521832(0x174)]){if(_0x10b6a9[_0x521832(0x17d)][0x0]==='..')throw new Error(_0x521832(0x180));let _0x57948b=0x0;for(const _0x876ebf of _0x10b6a9[_0x521832(0x17d)]){if(_0x876ebf==='..'){if(_0x57948b===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x57948b--;}else _0x876ebf!=='.'&&_0x57948b++;}}}export function joinPaths(_0x458841,_0x1e1788){const _0xee18a4=a154_0x3953;if(!_0x458841||_0x458841==='/')return _0x1e1788;if(!_0x1e1788||_0x1e1788==='.')return _0x458841;if(_0x1e1788[_0xee18a4(0x165)]('/'))return _0x1e1788;const _0xe49bf1=parsePath(_0x458841),_0x276746=parsePath(_0x1e1788),_0x16c836=[..._0xe49bf1[_0xee18a4(0x17d)]];for(const _0x4706e9 of _0x276746[_0xee18a4(0x17d)]){if(_0x4706e9==='.')continue;else{if(_0x4706e9==='..'){if(_0x16c836['length']===0x0)throw new Error(_0xee18a4(0x179));_0x16c836[_0xee18a4(0x191)]();}else _0x16c836[_0xee18a4(0x163)](_0x4706e9);}}const _0x27c54c=_0x16c836[_0xee18a4(0x169)]('/');return _0xe49bf1[_0xee18a4(0x193)][_0xee18a4(0x165)]('/')?'/'+_0x27c54c:_0x27c54c;}function a154_0x51a3(){const _0x62f9d3=['126nlrWTj','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','exists','slice','No\x20tdx.json\x20found\x20for\x20file:\x20','resolve','split','825eRqFYO','Relative\x20path\x20cannot\x20be\x20empty','tdx.json','isAbsolute','parent_segment','dirname','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','6pdrBFN','Cannot\x20navigate\x20above\x20root','File\x20not\x20found:\x20','filter','.yml','segments','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','substring','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','parse','journey','454BtGeUH','77950uxtSPg','193152QllPlc','Cannot\x20split\x20empty\x20path','Path\x20cannot\x20be\x20empty','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','1205383mXwiAS','12HNYgYj','type','trim','relative','endsWith','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Path\x20segment\x20cannot\x20be\x20empty','pop','root','raw','8853084bnooAc','push','3154735kiseqG','startsWith','4275852VQQsCv','test','length','join'];a154_0x51a3=function(){return _0x62f9d3;};return a154_0x51a3();}export function normalizePath(_0x5238aa){const _0x31e5a4=a154_0x3953,_0x498f8c=parsePath(_0x5238aa),_0x5734c3=[];for(const _0x34285d of _0x498f8c[_0x31e5a4(0x17d)]){if(_0x34285d==='.')continue;else{if(_0x34285d==='..'){if(_0x5734c3[_0x31e5a4(0x168)]===0x0){if(_0x498f8c[_0x31e5a4(0x174)])throw new Error(_0x31e5a4(0x179));_0x5734c3[_0x31e5a4(0x163)]('..');}else _0x5734c3[_0x5734c3[_0x31e5a4(0x168)]-0x1]==='..'?_0x5734c3['push']('..'):_0x5734c3[_0x31e5a4(0x191)]();}else _0x5734c3[_0x31e5a4(0x163)](_0x34285d);}}if(_0x5734c3['length']===0x0)return _0x498f8c[_0x31e5a4(0x174)]?'/':'.';const _0x323214=_0x5734c3[_0x31e5a4(0x169)]('/');return _0x498f8c['raw'][_0x31e5a4(0x165)]('/')?'/'+_0x323214:_0x323214;}export function getParentPath(_0x3fcc8f){const _0x157ea5=a154_0x3953,_0x272626=parsePath(_0x3fcc8f);if(_0x272626[_0x157ea5(0x17d)][_0x157ea5(0x168)]<=0x1)return'/';const _0x1a1ec3=_0x272626[_0x157ea5(0x17d)]['slice'](0x0,-0x1)['join']('/');return _0x272626[_0x157ea5(0x193)][_0x157ea5(0x165)]('/')?'/'+_0x1a1ec3:_0x1a1ec3;}export function getBaseName(_0x2c4817){const _0x55e594=a154_0x3953,_0x36ad4f=parsePath(_0x2c4817);return _0x36ad4f[_0x55e594(0x17d)][_0x36ad4f[_0x55e594(0x17d)][_0x55e594(0x168)]-0x1]||'';}function a154_0x3953(_0x369677,_0x3b23e1){_0x369677=_0x369677-0x162;const _0x51a345=a154_0x51a3();let _0x3953b6=_0x51a345[_0x369677];return _0x3953b6;}export function isChildPath(_0x1e0856,_0x17c4c9){const _0x36e9ec=a154_0x3953,_0x248991=parsePath(_0x1e0856),_0x1004d4=parsePath(_0x17c4c9);if(_0x248991[_0x36e9ec(0x17d)][_0x36e9ec(0x168)]<=_0x1004d4[_0x36e9ec(0x17d)][_0x36e9ec(0x168)])return![];for(let _0x104b6f=0x0;_0x104b6f<_0x1004d4['segments']['length'];_0x104b6f++){if(_0x248991['segments'][_0x104b6f]!==_0x1004d4[_0x36e9ec(0x17d)][_0x104b6f])return![];}return!![];}export function splitPath(_0x174b16){const _0x472eb1=a154_0x3953,_0x1c2bc3=parsePath(_0x174b16);if(_0x1c2bc3['segments'][_0x472eb1(0x168)]===0x0)throw new Error(_0x472eb1(0x186));if(_0x1c2bc3[_0x472eb1(0x17d)][_0x472eb1(0x168)]===0x1)return{'parent':_0x1c2bc3[_0x472eb1(0x17d)][0x0]};return{'parent':_0x1c2bc3[_0x472eb1(0x17d)][0x0],'child':_0x1c2bc3[_0x472eb1(0x17d)][_0x472eb1(0x16d)](0x1)['join']('/')};}export function isYamlFilePath(_0x5cf04e){const _0xd0e740=a154_0x3953;return _0x5cf04e[_0xd0e740(0x18e)](_0xd0e740(0x17c))||_0x5cf04e[_0xd0e740(0x18e)]('.yaml');}export async function resolveYamlFilePath(_0x1eca0e,_0x281401=nodeFileSystem){const _0x125233=a154_0x3953,_0x295b11=a154_0x1c0d97[_0x125233(0x16f)](_0x1eca0e);if(!await _0x281401['exists'](_0x295b11))throw new Error(_0x125233(0x17a)+_0x1eca0e);let _0x2be102=a154_0x1c0d97[_0x125233(0x176)](_0x295b11),_0x5ed022=null,_0x642a7=null;const _0x457241=a154_0x1c0d97[_0x125233(0x181)](_0x2be102)[_0x125233(0x192)];while(_0x2be102!==_0x457241){const _0x353a3a=a154_0x1c0d97[_0x125233(0x169)](_0x2be102,_0x125233(0x173));if(await _0x281401[_0x125233(0x16c)](_0x353a3a)){_0x5ed022=_0x353a3a,_0x642a7=_0x2be102;break;}_0x2be102=a154_0x1c0d97['dirname'](_0x2be102);}if(!_0x5ed022||!_0x642a7)throw new Error(_0x125233(0x16e)+_0x1eca0e+'\x0a'+_0x125233(0x177));const _0xb982d1=await _0x281401['readFile'](_0x5ed022),_0x517587=JSON[_0x125233(0x181)](_0xb982d1),_0x13e851=_0x517587[_0x125233(0x175)];if(!_0x13e851)throw new Error(_0x125233(0x17e));const _0x9dbae1=await _0x281401['readFile'](_0x295b11),_0xe56397=a154_0x35291c(_0x9dbae1),_0x1722a7=_0xe56397['name'];if(!_0x1722a7)throw new Error(_0x125233(0x18f)+_0x1eca0e);const _0x5700e7=_0xe56397[_0x125233(0x18b)]===_0x125233(0x182)?'journey':'segment',_0x15f6ec=a154_0x1c0d97[_0x125233(0x18d)](_0x642a7,_0x295b11),_0x4c9ab1=a154_0x1c0d97[_0x125233(0x176)](_0x15f6ec),_0x38a67b=_0x4c9ab1==='.'?'':_0x4c9ab1['replace'](/\\/g,'/'),_0x46060b=_0x38a67b?_0x13e851+'/'+_0x38a67b+'/'+_0x1722a7:_0x13e851+'/'+_0x1722a7;return{'parentSegment':_0x13e851,'segmentName':_0x1722a7,'folderPath':_0x38a67b,'fullPath':_0x46060b,'resourceType':_0x5700e7,'content':_0x9dbae1};}
@@ -1 +1 @@
1
- (function(_0x2f7095,_0x16b2bf){const _0x582cba=a155_0x1bdc,_0x1d2910=_0x2f7095();while(!![]){try{const _0x16359b=parseInt(_0x582cba(0xea))/0x1*(parseInt(_0x582cba(0xf0))/0x2)+-parseInt(_0x582cba(0xf7))/0x3+parseInt(_0x582cba(0xf5))/0x4*(-parseInt(_0x582cba(0xeb))/0x5)+-parseInt(_0x582cba(0xf3))/0x6*(-parseInt(_0x582cba(0xf8))/0x7)+parseInt(_0x582cba(0xec))/0x8*(parseInt(_0x582cba(0xf4))/0x9)+parseInt(_0x582cba(0xee))/0xa+-parseInt(_0x582cba(0xf2))/0xb;if(_0x16359b===_0x16b2bf)break;else _0x1d2910['push'](_0x1d2910['shift']());}catch(_0x352b93){_0x1d2910['push'](_0x1d2910['shift']());}}}(a155_0xe30e,0xdc638));function a155_0x1bdc(_0x50670d,_0x2a9f8e){_0x50670d=_0x50670d-0xea;const _0xe30e7b=a155_0xe30e();let _0x1bdce3=_0xe30e7b[_0x50670d];return _0x1bdce3;}function a155_0xe30e(){const _0x20bc10=['36GHLvSW','Invalid\x20segment\x20reference\x20format:\x20','5347276aVUkmz','1118094RTeZOL','27yIWrVU','617380dudptd','indexOf','3185436HAoUMc','49OZuUEV','13290hbzvNd','30dEHVaY','3372784nzORwW','substring','5682530dKMItX','.\x20Child\x20name\x20cannot\x20be\x20empty'];a155_0xe30e=function(){return _0x20bc10;};return a155_0xe30e();}export function parseSegmentRef(_0x3711df){const _0x31f310=a155_0x1bdc,_0x512287=_0x3711df[_0x31f310(0xf6)]('/');if(_0x512287===-0x1)return{'parentId':_0x3711df};if(_0x512287===0x0)throw new Error(_0x31f310(0xf1)+_0x3711df+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x4ececf=_0x3711df[_0x31f310(0xed)](0x0,_0x512287),_0x9d7f09=_0x3711df['substring'](_0x512287+0x1);if(_0x9d7f09==='')throw new Error(_0x31f310(0xf1)+_0x3711df+_0x31f310(0xef));return{'parentId':_0x4ececf,'childId':_0x9d7f09};}
1
+ (function(_0x4e43bd,_0x29054f){const _0x5970d5=a155_0xcab5,_0x512177=_0x4e43bd();while(!![]){try{const _0x1d3956=-parseInt(_0x5970d5(0x156))/0x1*(parseInt(_0x5970d5(0x15a))/0x2)+parseInt(_0x5970d5(0x153))/0x3+parseInt(_0x5970d5(0x150))/0x4+-parseInt(_0x5970d5(0x159))/0x5*(-parseInt(_0x5970d5(0x14d))/0x6)+parseInt(_0x5970d5(0x14e))/0x7*(-parseInt(_0x5970d5(0x155))/0x8)+parseInt(_0x5970d5(0x151))/0x9*(parseInt(_0x5970d5(0x157))/0xa)+-parseInt(_0x5970d5(0x15c))/0xb*(parseInt(_0x5970d5(0x152))/0xc);if(_0x1d3956===_0x29054f)break;else _0x512177['push'](_0x512177['shift']());}catch(_0x45e8a1){_0x512177['push'](_0x512177['shift']());}}}(a155_0x480a,0x890dd));function a155_0xcab5(_0x3789a3,_0x8fb8e8){_0x3789a3=_0x3789a3-0x14d;const _0x480a08=a155_0x480a();let _0xcab553=_0x480a08[_0x3789a3];return _0xcab553;}function a155_0x480a(){const _0x1b6e29=['285KCpPGd','4SDeiUX','.\x20Parent\x20name\x20cannot\x20be\x20empty','22oTxzGA','indexOf','67692utVcmi','112gJiKIL','Invalid\x20segment\x20reference\x20format:\x20','1521448naHEJZ','414LBNvlI','6486408vjqQfl','1768545voSsCA','.\x20Child\x20name\x20cannot\x20be\x20empty','61208BmrpvT','148389eqkTDI','97540tyNApZ','substring'];a155_0x480a=function(){return _0x1b6e29;};return a155_0x480a();}export function parseSegmentRef(_0x351af8){const _0x333fb4=a155_0xcab5,_0x54fa60=_0x351af8[_0x333fb4(0x15d)]('/');if(_0x54fa60===-0x1)return{'parentId':_0x351af8};if(_0x54fa60===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x351af8+_0x333fb4(0x15b));const _0x2aea83=_0x351af8['substring'](0x0,_0x54fa60),_0xefa05e=_0x351af8[_0x333fb4(0x158)](_0x54fa60+0x1);if(_0xefa05e==='')throw new Error(_0x333fb4(0x14f)+_0x351af8+_0x333fb4(0x154));return{'parentId':_0x2aea83,'childId':_0xefa05e};}