@treasuredata/tdx 2026.3.2 → 2026.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/engage-template-pull-command.js +1 -1
  24. package/dist/commands/engage-template-push-command.js +1 -1
  25. package/dist/commands/engage-template-validate-command.js +1 -1
  26. package/dist/commands/job-command.js +1 -1
  27. package/dist/commands/journey-command.js +1 -1
  28. package/dist/commands/journey-validate-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/mcp-command.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profile-command.js +1 -1
  33. package/dist/commands/profiles-command.js +1 -1
  34. package/dist/commands/query-command.js +1 -1
  35. package/dist/commands/schedule-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pull-command.js +1 -1
  40. package/dist/commands/segment-push-command.js +1 -1
  41. package/dist/commands/segment-update-command.js +1 -1
  42. package/dist/commands/segment-use-command.js +1 -1
  43. package/dist/commands/segment-validate-command.js +1 -1
  44. package/dist/commands/segments.js +1 -1
  45. package/dist/commands/show.js +1 -1
  46. package/dist/commands/status-command.js +1 -1
  47. package/dist/commands/tables.js +1 -1
  48. package/dist/commands/unset-command.js +1 -1
  49. package/dist/commands/upgrade-command.js +1 -1
  50. package/dist/commands/use-command.js +1 -1
  51. package/dist/commands/user-command.js +1 -1
  52. package/dist/commands/workflow-command.js +1 -1
  53. package/dist/core/auth.js +1 -1
  54. package/dist/core/command-output.js +1 -1
  55. package/dist/core/config.js +1 -1
  56. package/dist/core/connection-cache.js +1 -1
  57. package/dist/core/constants.js +1 -1
  58. package/dist/core/credential-cache.js +1 -1
  59. package/dist/core/global-context.js +1 -1
  60. package/dist/core/keychain.js +1 -1
  61. package/dist/core/profile.js +1 -1
  62. package/dist/core/project-config.js +1 -1
  63. package/dist/core/session.js +1 -1
  64. package/dist/core/user-cache.js +1 -1
  65. package/dist/core/version.js +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/mcp/server.js +1 -1
  68. package/dist/mcp/tools/index.js +1 -1
  69. package/dist/mcp/tools/tdx-run.js +1 -1
  70. package/dist/mcp/tools/tdx-search.js +1 -1
  71. package/dist/mcp/utils.js +1 -1
  72. package/dist/proxy/claude-usage-tracker.js +1 -1
  73. package/dist/proxy/passthrough-server.js +1 -1
  74. package/dist/proxy/sse-usage-parser.js +1 -1
  75. package/dist/sdk/agent/agent-config.js +1 -1
  76. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  77. package/dist/sdk/agent/agent-yaml.js +1 -1
  78. package/dist/sdk/agent/test/evaluator.js +1 -1
  79. package/dist/sdk/agent/test/executor.js +1 -1
  80. package/dist/sdk/agent/test/index.js +1 -1
  81. package/dist/sdk/agent/test/output.js +1 -1
  82. package/dist/sdk/agent/test/parser.js +1 -1
  83. package/dist/sdk/agent/tool-target-registry.js +1 -1
  84. package/dist/sdk/api.js +1 -1
  85. package/dist/sdk/client/cdp-api-client.js +1 -1
  86. package/dist/sdk/client/delivery-api-client.js +1 -1
  87. package/dist/sdk/client/endpoints.js +1 -1
  88. package/dist/sdk/client/engage-api-client.js +1 -1
  89. package/dist/sdk/client/http-client.js +1 -1
  90. package/dist/sdk/client/llm-api-client.js +1 -1
  91. package/dist/sdk/client/rate-limiter.js +1 -1
  92. package/dist/sdk/client/td-api-client.js +1 -1
  93. package/dist/sdk/client/trino-api-client.js +1 -1
  94. package/dist/sdk/client/workflow-client.js +1 -1
  95. package/dist/sdk/connection-validator.js +1 -1
  96. package/dist/sdk/connection.js +1 -1
  97. package/dist/sdk/delivery.js +1 -1
  98. package/dist/sdk/engage/campaign-pull.js +1 -1
  99. package/dist/sdk/engage/campaign-push.js +1 -1
  100. package/dist/sdk/engage/campaign-validator.js +1 -1
  101. package/dist/sdk/engage/campaign-yaml.js +1 -1
  102. package/dist/sdk/engage/template-pull.js +1 -1
  103. package/dist/sdk/engage/template-push.js +1 -1
  104. package/dist/sdk/engage/template-validator.js +1 -1
  105. package/dist/sdk/engage/template-yaml.js +1 -1
  106. package/dist/sdk/engage/types/campaign-def.js +1 -1
  107. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  108. package/dist/sdk/engage/types/template-schema.js +1 -1
  109. package/dist/sdk/engage.js +1 -1
  110. package/dist/sdk/errors.js +1 -1
  111. package/dist/sdk/index.js +1 -1
  112. package/dist/sdk/io/index.js +1 -1
  113. package/dist/sdk/io/node-filesystem.js +1 -1
  114. package/dist/sdk/job.js +1 -1
  115. package/dist/sdk/journey.js +1 -1
  116. package/dist/sdk/llm/chat-cache.js +1 -1
  117. package/dist/sdk/llm/index.js +1 -1
  118. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  119. package/dist/sdk/llm/model-factors.js +1 -1
  120. package/dist/sdk/personalization.js +1 -1
  121. package/dist/sdk/query/index.js +1 -1
  122. package/dist/sdk/query/sql-parser.js +1 -1
  123. package/dist/sdk/realtime.js +1 -1
  124. package/dist/sdk/schedule.js +1 -1
  125. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  126. package/dist/sdk/segment/fields-display.js +1 -1
  127. package/dist/sdk/segment/file-discovery.js +1 -1
  128. package/dist/sdk/segment/journey-utils.js +1 -1
  129. package/dist/sdk/segment/journey-validator.js +1 -1
  130. package/dist/sdk/segment/journey-yaml.js +1 -1
  131. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  132. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  133. package/dist/sdk/segment/pull-workflow.js +1 -1
  134. package/dist/sdk/segment/push-recovery.js +1 -1
  135. package/dist/sdk/segment/push-workflow.js +1 -1
  136. package/dist/sdk/segment/resolution-context.js +1 -1
  137. package/dist/sdk/segment/segment-path-parser.js +1 -1
  138. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  139. package/dist/sdk/segment/segment-validator.js +1 -1
  140. package/dist/sdk/segment/target-resolution.js +1 -1
  141. package/dist/sdk/segment/tdx-config.js +1 -1
  142. package/dist/sdk/segment/types/activation-schema.js +1 -1
  143. package/dist/sdk/segment/types/journey-def.js +1 -1
  144. package/dist/sdk/segment/types/journey-schema.js +1 -1
  145. package/dist/sdk/segment/types/segment-def.js +1 -1
  146. package/dist/sdk/segment/types/segment-schema.js +1 -1
  147. package/dist/sdk/segment/validate-files.js +1 -1
  148. package/dist/sdk/segment/yaml-validator.js +1 -1
  149. package/dist/sdk/segment.js +1 -1
  150. package/dist/sdk/types/index.js +1 -1
  151. package/dist/sdk/types/progress.js +1 -1
  152. package/dist/sdk/user.js +1 -1
  153. package/dist/sdk/util/format-detector.js +1 -1
  154. package/dist/sdk/util/formatters.js +1 -1
  155. package/dist/sdk/util/index.js +1 -1
  156. package/dist/sdk/util/paginate.js +1 -1
  157. package/dist/sdk/util/tree-formatter.js +1 -1
  158. package/dist/sdk/workflow/archive-validation.js +1 -1
  159. package/dist/sdk/workflow/clone-workflow.js +1 -1
  160. package/dist/sdk/workflow/index.js +1 -1
  161. package/dist/sdk/workflow/pull-workflow.js +1 -1
  162. package/dist/sdk/workflow/push-workflow.js +1 -1
  163. package/dist/sdk/workflow/tdx-config.js +1 -1
  164. package/dist/sdk/workflow/workflow-utils.js +1 -1
  165. package/dist/test-utils/command-runner.js +1 -1
  166. package/dist/test-utils/factories.js +1 -1
  167. package/dist/test-utils/fixtures.js +1 -1
  168. package/dist/test-utils/http-mock.js +1 -1
  169. package/dist/test-utils/index.js +1 -1
  170. package/dist/utils/async.js +1 -1
  171. package/dist/utils/colors.js +1 -1
  172. package/dist/utils/diff.js +1 -1
  173. package/dist/utils/file-permissions.js +1 -1
  174. package/dist/utils/file-reader.js +1 -1
  175. package/dist/utils/github-releases.js +1 -1
  176. package/dist/utils/global-cache.js +1 -1
  177. package/dist/utils/json-loader.js +1 -1
  178. package/dist/utils/local-cache.js +1 -1
  179. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  180. package/dist/utils/logger/formatters/index.js +1 -1
  181. package/dist/utils/logger/handlers/console-handler.js +1 -1
  182. package/dist/utils/logger/handlers/file-handler.js +1 -1
  183. package/dist/utils/logger/handlers/index.js +1 -1
  184. package/dist/utils/logger/handlers/null-handler.js +1 -1
  185. package/dist/utils/logger/index.js +1 -1
  186. package/dist/utils/logger/logger.js +1 -1
  187. package/dist/utils/logger/types.js +1 -1
  188. package/dist/utils/option-validation.js +1 -1
  189. package/dist/utils/process.js +1 -1
  190. package/dist/utils/prompt.js +1 -1
  191. package/dist/utils/spinner.js +1 -1
  192. package/dist/utils/sse-parser.js +1 -1
  193. package/dist/utils/string-utils.js +1 -1
  194. package/dist/utils/table-ref-parser.js +1 -1
  195. package/dist/utils/tdx-logger.js +1 -1
  196. package/dist/utils/version-check.js +1 -1
  197. package/package.json +1 -1
@@ -1 +1 @@
1
- const a135_0x2375cf=a135_0x4a45;(function(_0x5b0532,_0x269a71){const _0x34b24a=a135_0x4a45,_0x453d4a=_0x5b0532();while(!![]){try{const _0x57f4cf=-parseInt(_0x34b24a(0x11f))/0x1*(-parseInt(_0x34b24a(0x120))/0x2)+-parseInt(_0x34b24a(0x125))/0x3*(-parseInt(_0x34b24a(0x131))/0x4)+parseInt(_0x34b24a(0x11e))/0x5+-parseInt(_0x34b24a(0x12e))/0x6*(parseInt(_0x34b24a(0x12a))/0x7)+parseInt(_0x34b24a(0x132))/0x8*(-parseInt(_0x34b24a(0x124))/0x9)+parseInt(_0x34b24a(0x12d))/0xa*(parseInt(_0x34b24a(0x118))/0xb)+-parseInt(_0x34b24a(0x127))/0xc;if(_0x57f4cf===_0x269a71)break;else _0x453d4a['push'](_0x453d4a['shift']());}catch(_0x1f884d){_0x453d4a['push'](_0x453d4a['shift']());}}}(a135_0x4296,0xc87b9));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a135_0x4bc8d5 from'path';import{Logger}from'../../utils/logger/index.js';function a135_0x4296(){const _0x2813db=['7723540odpUUo','783467oZlHRw','4xscjmK','code','debug','parse','6199623ZnshLg','4613187HcfVfg','toISOString','49037832FaadCD','stringify','journeyName','7igsMev','warn','dirname','1697720ILBMez','428958GFKhPO','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','basename','4xHuOwG','8oqiSOg','.push-recovery.json','66HoyEOr','utf-8','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','join','segments','tdx.sdk.push-recovery'];a135_0x4296=function(){return _0x2813db;};return a135_0x4296();}const logger=Logger['of'](a135_0x2375cf(0x11d));export function getPushRecoveryPath(_0x422ac6){const _0x8d17dd=a135_0x2375cf,_0x3b1b45=a135_0x4bc8d5[_0x8d17dd(0x12c)](_0x422ac6),_0x298a59=a135_0x4bc8d5[_0x8d17dd(0x130)](_0x422ac6);return a135_0x4bc8d5[_0x8d17dd(0x11b)](_0x3b1b45,'.'+_0x298a59+_0x8d17dd(0x117));}export function readPushRecovery(_0x330d1c){const _0x2f5032=a135_0x2375cf,_0x6100f1=getPushRecoveryPath(_0x330d1c);if(!existsSync(_0x6100f1))return undefined;try{const _0x2e5b6a=readFileSync(_0x6100f1,_0x2f5032(0x119)),_0x5f348c=JSON[_0x2f5032(0x123)](_0x2e5b6a);if(_0x5f348c?.['version']!==0x1||typeof _0x5f348c[_0x2f5032(0x129)]!=='string')return undefined;return _0x5f348c;}catch(_0x2cf27a){return _0x2cf27a instanceof SyntaxError?logger[_0x2f5032(0x122)](_0x2f5032(0x11a)+_0x2cf27a):logger[_0x2f5032(0x12b)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x2cf27a),undefined;}}export function writePushRecovery(_0xf88262,_0x78bcf3){const _0xb9581d=a135_0x2375cf,_0xc8a40f=getPushRecoveryPath(_0xf88262),_0x562ce2=_0xc8a40f+'.tmp';writeFileSync(_0x562ce2,JSON[_0xb9581d(0x128)](_0x78bcf3,null,0x2)+'\x0a',_0xb9581d(0x119)),renameSync(_0x562ce2,_0xc8a40f);}export function deletePushRecovery(_0x4cf93a){const _0x316e9f=a135_0x2375cf,_0x1513c8=getPushRecoveryPath(_0x4cf93a);try{unlinkSync(_0x1513c8);}catch(_0x52c2de){_0x52c2de[_0x316e9f(0x121)]!=='ENOENT'&&logger['debug'](_0x316e9f(0x12f)+_0x52c2de);}}function a135_0x4a45(_0x901784,_0x2c71f7){_0x901784=_0x901784-0x117;const _0x429621=a135_0x4296();let _0x4a4528=_0x429621[_0x901784];return _0x4a4528;}export function saveSegmentToPushRecovery(_0x428499,_0x463075,_0x5231ff,_0xf0f5c3){const _0x347e80=a135_0x2375cf,_0x20229c=readPushRecovery(_0x428499),_0x1a597d=_0x20229c?.[_0x347e80(0x129)]===_0x463075?{..._0x20229c,'updatedAt':new Date()[_0x347e80(0x126)]()}:{'version':0x1,'journeyName':_0x463075,'updatedAt':new Date()[_0x347e80(0x126)](),'segments':{}};_0x1a597d[_0x347e80(0x11c)][_0x5231ff]=_0xf0f5c3,writePushRecovery(_0x428499,_0x1a597d);}
1
+ function a135_0x4ed9(){const _0x47d58e=['stringify','dirname','4362714ohFfPD','22576631wfjSLI','parse','utf-8','.tmp','version','14ZjRJvZ','ENOENT','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','736744wfMpty','tdx.sdk.push-recovery','10JbaqCf','journeyName','.push-recovery.json','610UTfVpm','34YPAAMV','code','693678OyBxDH','897786PxRDLB','debug','20404QGlqbe','warn','toISOString','join','basename','string','34837rqWaRN'];a135_0x4ed9=function(){return _0x47d58e;};return a135_0x4ed9();}const a135_0x107fb8=a135_0x1062;(function(_0x339319,_0x2e0f72){const _0x238d46=a135_0x1062,_0x137e2d=_0x339319();while(!![]){try{const _0x454af0=parseInt(_0x238d46(0x111))/0x1*(-parseInt(_0x238d46(0x106))/0x2)+parseInt(_0x238d46(0x109))/0x3+parseInt(_0x238d46(0x10b))/0x4*(-parseInt(_0x238d46(0x105))/0x5)+-parseInt(_0x238d46(0x108))/0x6+parseInt(_0x238d46(0x11a))/0x7*(-parseInt(_0x238d46(0x100))/0x8)+-parseInt(_0x238d46(0x114))/0x9+parseInt(_0x238d46(0x102))/0xa*(parseInt(_0x238d46(0x115))/0xb);if(_0x454af0===_0x2e0f72)break;else _0x137e2d['push'](_0x137e2d['shift']());}catch(_0x12e066){_0x137e2d['push'](_0x137e2d['shift']());}}}(a135_0x4ed9,0x5614b));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a135_0x380334 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a135_0x107fb8(0x101));export function getPushRecoveryPath(_0x132281){const _0x2f83bf=a135_0x107fb8,_0x2e9d2c=a135_0x380334[_0x2f83bf(0x113)](_0x132281),_0x5667d7=a135_0x380334[_0x2f83bf(0x10f)](_0x132281);return a135_0x380334[_0x2f83bf(0x10e)](_0x2e9d2c,'.'+_0x5667d7+_0x2f83bf(0x104));}export function readPushRecovery(_0x39af10){const _0xe5a1e=a135_0x107fb8,_0x5cdb15=getPushRecoveryPath(_0x39af10);if(!existsSync(_0x5cdb15))return undefined;try{const _0x549c82=readFileSync(_0x5cdb15,_0xe5a1e(0x117)),_0x3f2e78=JSON[_0xe5a1e(0x116)](_0x549c82);if(_0x3f2e78?.[_0xe5a1e(0x119)]!==0x1||typeof _0x3f2e78['journeyName']!==_0xe5a1e(0x110))return undefined;return _0x3f2e78;}catch(_0x283971){return _0x283971 instanceof SyntaxError?logger[_0xe5a1e(0x10a)](_0xe5a1e(0xff)+_0x283971):logger[_0xe5a1e(0x10c)](_0xe5a1e(0xfd)+_0x283971),undefined;}}export function writePushRecovery(_0x4d8cbc,_0x39eddc){const _0x32c165=a135_0x107fb8,_0x5e45de=getPushRecoveryPath(_0x4d8cbc),_0xe0a890=_0x5e45de+_0x32c165(0x118);writeFileSync(_0xe0a890,JSON[_0x32c165(0x112)](_0x39eddc,null,0x2)+'\x0a',_0x32c165(0x117)),renameSync(_0xe0a890,_0x5e45de);}function a135_0x1062(_0x51326d,_0x4cf11c){_0x51326d=_0x51326d-0xfc;const _0x4ed9c8=a135_0x4ed9();let _0x1062d7=_0x4ed9c8[_0x51326d];return _0x1062d7;}export function deletePushRecovery(_0x170244){const _0x1631d1=a135_0x107fb8,_0x1662f9=getPushRecoveryPath(_0x170244);try{unlinkSync(_0x1662f9);}catch(_0x1919d3){_0x1919d3[_0x1631d1(0x107)]!==_0x1631d1(0xfc)&&logger[_0x1631d1(0x10a)](_0x1631d1(0xfe)+_0x1919d3);}}export function saveSegmentToPushRecovery(_0x4e7b48,_0x49eb3e,_0x43953d,_0x5ef512){const _0x22df49=a135_0x107fb8,_0x13c272=readPushRecovery(_0x4e7b48),_0x16460f=_0x13c272?.[_0x22df49(0x103)]===_0x49eb3e?{..._0x13c272,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x49eb3e,'updatedAt':new Date()[_0x22df49(0x10d)](),'segments':{}};_0x16460f['segments'][_0x43953d]=_0x5ef512,writePushRecovery(_0x4e7b48,_0x16460f);}
@@ -1 +1 @@
1
- const a136_0x271f24=a136_0x2eaf;(function(_0x18ee5b,_0x3c2038){const _0x57477a=a136_0x2eaf,_0x4fa7ff=_0x18ee5b();while(!![]){try{const _0x109ba=parseInt(_0x57477a(0x15d))/0x1+parseInt(_0x57477a(0x1c1))/0x2*(-parseInt(_0x57477a(0x1f5))/0x3)+parseInt(_0x57477a(0x1a9))/0x4*(parseInt(_0x57477a(0x1a0))/0x5)+parseInt(_0x57477a(0x23f))/0x6+-parseInt(_0x57477a(0x230))/0x7*(parseInt(_0x57477a(0x134))/0x8)+parseInt(_0x57477a(0x232))/0x9+-parseInt(_0x57477a(0x133))/0xa*(parseInt(_0x57477a(0x162))/0xb);if(_0x109ba===_0x3c2038)break;else _0x4fa7ff['push'](_0x4fa7ff['shift']());}catch(_0x525a2f){_0x4fa7ff['push'](_0x4fa7ff['shift']());}}}(a136_0x19f6,0x55df1));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a136_0x271f24(0x214));export const PENDING_SEGMENT_PREFIX=a136_0x271f24(0x17a);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x5419c3){return''+PENDING_SEGMENT_PREFIX+_0x5419c3+'__';}export function isPendingSegmentId(_0x40b69a){const _0x513387=a136_0x271f24;return _0x40b69a[_0x513387(0x1c0)](PENDING_SEGMENT_PREFIX)&&!_0x40b69a[_0x513387(0x1c0)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x51b812){const _0x26f1e7=a136_0x271f24;return _0x51b812[_0x26f1e7(0x137)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3455f1){return''+PENDING_ACTIVATION_PREFIX+_0x3455f1+'__';}export function isPendingActivationId(_0x2acc3b){return _0x2acc3b['startsWith'](PENDING_ACTIVATION_PREFIX);}function a136_0x2eaf(_0x1b6159,_0x2d506f){_0x1b6159=_0x1b6159-0x133;const _0x19f68b=a136_0x19f6();let _0x2eaf45=_0x19f68b[_0x1b6159];return _0x2eaf45;}export function extractPendingActivationName(_0x340ead){const _0x1606bb=a136_0x271f24;return _0x340ead[_0x1606bb(0x137)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x2e5938,_0x5c7733){const _0x411d74=a136_0x271f24,_0x36eb3e=_0x2e5938+'::'+(_0x5c7733[_0x411d74(0x1e2)]()||'segment'),_0x2e3532=createHash(_0x411d74(0x150))[_0x411d74(0x175)](_0x36eb3e)[_0x411d74(0x236)](_0x411d74(0x1eb))[_0x411d74(0x1af)](0x0,0xc);return'journey_entry_criteria_'+_0x2e3532;}export function ensureJourneyDefaults(_0x509173){const _0x1343b4=a136_0x271f24;!_0x509173['description']&&(_0x509173['description']=''),!_0x509173[_0x1343b4(0x210)]&&(_0x509173[_0x1343b4(0x210)]='draft');}export function injectExistingStageIds(_0x414c89,_0x538139){const _0x4581ea=a136_0x271f24,_0x1c37e8=new Map(_0x538139[_0x4581ea(0x21d)](_0x549ad7=>[_0x549ad7['name'],_0x549ad7['id']]));for(const _0x417c4c of _0x414c89){if(!_0x417c4c['id']){const _0x2930f3=_0x1c37e8[_0x4581ea(0x21e)](_0x417c4c[_0x4581ea(0x1db)]);_0x2930f3&&(_0x417c4c['id']=_0x2930f3);}}}export function resolveTDFolderPath(_0x2071cd,_0xd9fef9,_0x5cfc32){const _0x50ab20=a136_0x271f24;if(!_0xd9fef9)return _0x2071cd;if(_0x2071cd===_0x5cfc32||_0x2071cd[_0x50ab20(0x1c0)](_0x5cfc32+'/'))return _0x2071cd;return _0x2071cd?_0x5cfc32+'/'+_0x2071cd:_0x5cfc32;}export function addFoldersToCreate(_0x5265a5,_0x3ee410,_0x1fee55){const _0x11f9ba=a136_0x271f24;if(!_0x5265a5)return;if(_0x3ee410[_0x11f9ba(0x173)](_0x5265a5))return;const _0x4592ca=_0x5265a5[_0x11f9ba(0x1da)]('/');let _0x43778c='';for(const _0x24ac8a of _0x4592ca){_0x43778c=_0x43778c?_0x43778c+'/'+_0x24ac8a:_0x24ac8a,!_0x3ee410[_0x11f9ba(0x173)](_0x43778c)&&_0x1fee55[_0x11f9ba(0x1ed)](_0x43778c);}}export function sortFoldersByDepth(_0x5e73b0){const _0x307d76=a136_0x271f24;return[..._0x5e73b0][_0x307d76(0x17f)]((_0x5dae37,_0x55b041)=>{const _0x3945a9=_0x307d76,_0xdde396=(_0x5dae37[_0x3945a9(0x203)](/\//g)||[])[_0x3945a9(0x23a)],_0x3428e5=(_0x55b041[_0x3945a9(0x203)](/\//g)||[])[_0x3945a9(0x23a)];return _0xdde396-_0x3428e5;});}import*as a136_0x2b758b from'yaml';import{readFileSync}from'fs';import a136_0x55e645 from'path';import{isJourneyDef,parseYamlString as a136_0x110f05,toYamlString as a136_0x4b928d,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(_0x59fb2d){const _0x1331a2=a136_0x271f24;if(Array['isArray'](_0x59fb2d))return'['+_0x59fb2d[_0x1331a2(0x21d)](_0x461bd1=>stableStringify(_0x461bd1))[_0x1331a2(0x1e8)](',')+']';if(_0x59fb2d&&typeof _0x59fb2d===_0x1331a2(0x1b1)){const _0x54534b=_0x59fb2d,_0x141ec4=Object[_0x1331a2(0x193)](_0x54534b)[_0x1331a2(0x17f)](),_0x3ce5a9=_0x141ec4['map'](_0x408a09=>'\x22'+_0x408a09+'\x22:'+stableStringify(_0x54534b[_0x408a09]));return'{'+_0x3ce5a9[_0x1331a2(0x1e8)](',')+'}';}const _0x5e085b=JSON[_0x1331a2(0x1d9)](_0x59fb2d);return _0x5e085b===undefined?_0x1331a2(0x23d):_0x5e085b;}function activationSignature(_0x665dc3){const _0x32dedb=a136_0x271f24,_0x5ed233={'connection':_0x665dc3[_0x32dedb(0x1c6)],..._0x665dc3[_0x32dedb(0x21b)]!==undefined&&{'all_columns':_0x665dc3[_0x32dedb(0x21b)]},..._0x665dc3[_0x32dedb(0x1d3)]!==undefined&&{'columns':_0x665dc3['columns']},..._0x665dc3[_0x32dedb(0x151)]!==undefined&&{'behavior':_0x665dc3['behavior']},..._0x665dc3[_0x32dedb(0x223)]!==undefined&&{'schedule':_0x665dc3[_0x32dedb(0x223)]},..._0x665dc3['notification']!==undefined&&{'notification':_0x665dc3[_0x32dedb(0x194)]},..._0x665dc3[_0x32dedb(0x178)]!==undefined&&{'connector_config':_0x665dc3['connector_config']},..._0x665dc3[_0x32dedb(0x17b)]!==undefined&&{'activation_template_id':_0x665dc3['activation_template_id']}};return stableStringify(_0x5ed233);}async function fetchSegment(_0x54285f,_0x2471c9,_0x475556,_0x3e521a){const _0x494c0d=a136_0x271f24,_0x5b394e=_0x3e521a?.[_0x494c0d(0x23c)](_0x3c601e=>_0x3c601e['id']===_0x475556);if(_0x5b394e)return _0x5b394e;try{return await _0x54285f[_0x494c0d(0x1ab)][_0x494c0d(0x206)](_0x2471c9,_0x475556);}catch(_0x137eb3){logger[_0x494c0d(0x201)](_0x494c0d(0x185)+_0x475556+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x137eb3);try{return await _0x54285f['segment'][_0x494c0d(0x1dc)](_0x475556);}catch(_0x595224){return logger['debug'](_0x494c0d(0x166)+_0x475556+':\x20'+_0x595224),null;}}}function recoverSegmentIdsFromPushRecovery(_0x1a36b1,_0x34779f,_0x595767){const _0x1913c5=a136_0x271f24,_0x56ae22=readPushRecovery(_0x1a36b1[_0x1913c5(0x169)]);if(_0x56ae22?.[_0x1913c5(0x172)]===_0x1a36b1[_0x1913c5(0x1a7)][_0x1913c5(0x1db)])for(const [_0x1aed58,_0x351f66]of Object['entries'](_0x56ae22[_0x1913c5(0x15a)])){const _0x30a8cf=generateDeterministicJourneySegmentName(_0x1a36b1[_0x1913c5(0x1a7)][_0x1913c5(0x1db)],_0x1aed58);_0x351f66[_0x1913c5(0x1fa)]===_0x30a8cf&&(_0x34779f[_0x1913c5(0x1df)](_0x1aed58,_0x351f66[_0x1913c5(0x20e)]),_0x595767[_0x1913c5(0x1df)](_0x1aed58,_0x351f66[_0x1913c5(0x20e)]));}}async function createOrRecoverEmbeddedSegment(_0x5517ec,_0x4a350d,_0xc6c5b,_0x17a641){const _0xae5127=a136_0x271f24;let _0x3bc2fe;try{_0x3bc2fe=await _0x5517ec[_0xae5127(0x1ab)]['createJourneySegment']({'name':_0xc6c5b[_0xae5127(0x199)],'description':_0xc6c5b[_0xae5127(0x1f7)],'journeyId':_0xc6c5b[_0xae5127(0x209)],'rule':_0x17a641(_0xc6c5b['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0xc6c5b['folderId'],'audienceId':_0xc6c5b[_0xae5127(0x184)]});}catch(_0x391b68){const _0x547fb7=_0x391b68 instanceof Error&&_0x391b68[_0xae5127(0x1b0)][_0xae5127(0x1ea)](_0xae5127(0x1b9));if(_0x547fb7){const _0x30991e=readPushRecovery(_0x4a350d[_0xae5127(0x169)]),_0x3af09a=_0x30991e?.[_0xae5127(0x172)]===_0x4a350d[_0xae5127(0x1a7)][_0xae5127(0x1db)]?_0x30991e[_0xae5127(0x15a)][_0xc6c5b['localName']]:undefined;if(_0x3af09a?.['uniqueServerName']===_0xc6c5b[_0xae5127(0x199)])await _0x5517ec[_0xae5127(0x1ab)][_0xae5127(0x164)](_0xc6c5b[_0xae5127(0x184)],_0x3af09a[_0xae5127(0x20e)],{'description':_0xc6c5b[_0xae5127(0x1f7)],'rule':_0x17a641(_0xc6c5b[_0xae5127(0x18a)],!![]),'countPopulation':!![]}),_0x3bc2fe=_0x3af09a[_0xae5127(0x20e)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],'Embedded\x20segment\x20\x27'+_0xc6c5b[_0xae5127(0x219)]+_0xae5127(0x216)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x4a350d[_0xae5127(0x169)]['replace'](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0xae5127(0x1e3),_0x391b68);}else throw _0x391b68;}return saveSegmentToPushRecovery(_0x4a350d['absolutePath'],_0x4a350d[_0xae5127(0x1a7)]['name'],_0xc6c5b['localName'],{'segmentId':_0x3bc2fe,'uniqueServerName':_0xc6c5b[_0xae5127(0x199)],'createdAt':new Date()[_0xae5127(0x1ae)]()}),_0x3bc2fe;}export async function prepareSegmentFiles(_0x2068ae,_0x5736cf,_0x1ff8ec,_0xb7df0c,_0x300bba){const _0xfa017=a136_0x271f24,{activationDefToCreateRequest:_0x4d4a9c}=await import('./child-segment-yaml.js'),_0x173e54=[],_0x1c8df4=new Set();for(const {yamlConfig:_0x197912,folderPath:_0x262303,sourcePath:_0xaab504}of _0x2068ae){const _0x533375=resolveTDFolderPath(_0x262303,_0xb7df0c,_0x300bba),_0x7715b=_0x533375+':'+_0x197912['name'],_0x4591f6=_0x5736cf[_0xfa017(0x19b)]['get'](_0x7715b),_0x1a5bfc=_0x4591f6?_0x5736cf[_0xfa017(0x18f)][_0xfa017(0x21e)](_0x4591f6['id'])||[]:[];addFoldersToCreate(_0x533375,_0x5736cf[_0xfa017(0x196)],_0x1c8df4);const _0x18c1a2=calculateActivationActions(_0x197912[_0xfa017(0x1e0)]||[],_0x1a5bfc,_0x5736cf[_0xfa017(0x13a)],_0x5736cf['connectionIdToNameMap']);for(const _0x30b4c7 of _0x18c1a2){(_0x30b4c7[_0xfa017(0x1f0)]===_0xfa017(0x1be)||_0x30b4c7[_0xfa017(0x1f0)]===_0xfa017(0x175))&&_0x30b4c7[_0xfa017(0x1ef)]&&(_0x30b4c7[_0xfa017(0x22a)]=await _0x4d4a9c(_0x30b4c7[_0xfa017(0x1ef)],_0x1ff8ec));}const _0x69cf63=calculateSegmentDiff(_0x197912,_0x4591f6,_0x1a5bfc,_0x5736cf['idToEmailMap'],_0x5736cf[_0xfa017(0x227)]);_0x173e54[_0xfa017(0x181)]({'relativePath':_0x197912[_0xfa017(0x1db)],'absolutePath':_0xaab504,'yamlConfig':_0x197912,'folderPath':_0x533375,'existingSegment':_0x4591f6,'existingActivations':_0x1a5bfc,'isNew':_0x69cf63['isNew'],'hasChanges':_0x69cf63[_0xfa017(0x212)],'diff':_0x69cf63[_0xfa017(0x1f4)],'activationActions':_0x18c1a2});}return{'segmentFiles':_0x173e54,'foldersToCreate':_0x1c8df4};}export async function prepareJourneyFiles(_0x57d247,_0x290662,_0x5cac0e,_0x35dedc){const _0x146f85=a136_0x271f24,_0x360332=[],_0x88491a=new Set();for(const {yamlConfig:_0x18b310,folderPath:_0x34512d,sourcePath:_0x36b6b7}of _0x57d247){const _0x545648=resolveTDFolderPath(_0x34512d,_0x5cac0e,_0x35dedc),_0x26c23a=_0x545648+':'+_0x18b310['name'],_0x120d34=_0x290662[_0x146f85(0x1f9)]['get'](_0x26c23a);let _0x11870a,_0x446351;if(_0x120d34&&_0x120d34[_0x146f85(0x23a)]>0x0){const _0x1bef01=buildLocalExpandedRuleMappings(_0x18b310),{createYamlContext:_0x189969,prefetchJourneySegments:_0x104395}=createPushYamlContextForBundle(_0x290662[_0x146f85(0x138)],_0x290662[_0x146f85(0x184)],_0x290662[_0x146f85(0x235)],_0x1bef01,_0x290662[_0x146f85(0x13a)],_0x290662['connectionIdToNameMap'],_0x290662[_0x146f85(0x1e6)],_0x290662[_0x146f85(0x1cf)]);await _0x104395(_0x120d34[_0x146f85(0x21d)](_0xa8d3d3=>_0xa8d3d3['id']));const _0x10ea7f=await _0x290662[_0x146f85(0x138)]['journey'][_0x146f85(0x22d)](_0x120d34[0x0][_0x146f85(0x13d)]),_0x42b653=hasMultipleVersions(_0x18b310),_0x2a7514=async _0x48ceb5=>{const _0x522bd2=_0x146f85,_0x161657=_0x290662[_0x522bd2(0x1cf)]?.['get'](_0x48ceb5);if(_0x161657)return _0x161657;return _0x290662[_0x522bd2(0x211)]({'journeyId':_0x48ceb5,'journeyName':_0x18b310['name'],'isMultiVersion':_0x120d34[_0x522bd2(0x23a)]>0x1});};if(_0x42b653&&_0x120d34[_0x146f85(0x23a)]>0x1){const _0x9b5ef0=[];for(const _0x1b1fd9 of _0x120d34){const _0x228d74=_0x1b1fd9[_0x146f85(0x142)]||0x1;_0x290662[_0x146f85(0x195)]?.[_0x146f85(0x175)](_0x146f85(0x14d)+_0x18b310[_0x146f85(0x1db)]+'\x20v'+_0x228d74);const _0x930623=await _0x2a7514(_0x1b1fd9['id']),_0x55bf66=_0x189969(_0x1b1fd9['id']),_0x4c397d=await journeyResponseToDef(_0x930623,_0x55bf66);_0x9b5ef0['push']({'item':_0x1b1fd9,'yaml':_0x4c397d});}const _0x5ad269=buildLocalRuleToNameMappingFromJourney(_0x18b310);_0x446351=buildMergedJourneyDef(_0x9b5ef0,_0x5ad269,_0x10ea7f);const _0x553e92=Math[_0x146f85(0x1ba)](..._0x9b5ef0[_0x146f85(0x21d)](_0x16f9fb=>_0x16f9fb[_0x146f85(0x215)][_0x146f85(0x142)]||0x0)),_0x387f09=_0x120d34[_0x146f85(0x23c)](_0x5e6d88=>(_0x5e6d88[_0x146f85(0x142)]||0x0)===_0x553e92);_0x387f09&&(_0x290662[_0x146f85(0x195)]?.[_0x146f85(0x175)]('Fetching\x20'+_0x18b310[_0x146f85(0x1db)]+'\x20v'+_0x553e92),_0x11870a=await _0x2a7514(_0x387f09['id']));}else{const _0x213ade=_0x120d34[_0x120d34[_0x146f85(0x23a)]-0x1];_0x290662[_0x146f85(0x195)]?.[_0x146f85(0x175)](_0x146f85(0x14d)+_0x18b310[_0x146f85(0x1db)]),_0x11870a=await _0x2a7514(_0x213ade['id']);const _0x1a8b3e=_0x189969(_0x213ade['id']),_0x1f58b6=await journeyResponseToDef(_0x11870a,_0x1a8b3e),_0x36de9d=buildLocalRuleToNameMappingFromJourney(_0x18b310);_0x446351=buildMergedJourneyDef([{'item':_0x213ade,'yaml':_0x1f58b6}],_0x36de9d,_0x10ea7f);}}addFoldersToCreate(_0x545648,_0x290662[_0x146f85(0x196)],_0x88491a);const _0x3f5be1=calculateJourneyDiff(_0x18b310,_0x446351);_0x360332[_0x146f85(0x181)]({'relativePath':_0x18b310[_0x146f85(0x1db)],'absolutePath':_0x36b6b7,'yamlConfig':_0x18b310,'folderPath':_0x545648,'existingJourney':_0x11870a,'isNew':_0x3f5be1[_0x146f85(0x139)],'hasChanges':_0x3f5be1['hasChanges'],'diff':_0x3f5be1['diff']});}return{'journeyFiles':_0x360332,'foldersToCreate':_0x88491a};}export function calculateActivationActions(_0x934083,_0x665b29,_0x14e985,_0x19a139){const _0x159818=a136_0x271f24,_0x44ebc2=[],_0x110f97=new Map();for(const _0x34d0b0 of _0x665b29){_0x110f97[_0x159818(0x1df)](_0x34d0b0[_0x159818(0x1db)],_0x34d0b0);}const _0x55c024=new Map();for(const _0x42100c of _0x934083){_0x55c024[_0x159818(0x1df)](_0x42100c[_0x159818(0x1db)],_0x42100c);}for(const _0x3919ef of _0x934083){const _0x1fbf16=_0x110f97[_0x159818(0x21e)](_0x3919ef[_0x159818(0x1db)]);if(!_0x1fbf16)_0x44ebc2[_0x159818(0x181)]({'type':'create','name':_0x3919ef[_0x159818(0x1db)],'yamlActivation':_0x3919ef});else{const _0x11a444=activationResponseToDef(_0x1fbf16,_0x14e985,_0x19a139),_0x405da3=a136_0x2b758b['stringify'](_0x11a444),_0x51931e=a136_0x2b758b[_0x159818(0x1d9)](_0x3919ef);_0x405da3!==_0x51931e&&_0x44ebc2[_0x159818(0x181)]({'type':_0x159818(0x175),'name':_0x3919ef[_0x159818(0x1db)],'yamlActivation':_0x3919ef,'existingActivation':_0x1fbf16});}}for(const _0x17e0c9 of _0x665b29){!_0x55c024[_0x159818(0x173)](_0x17e0c9[_0x159818(0x1db)])&&_0x44ebc2[_0x159818(0x181)]({'type':_0x159818(0x1a8),'name':_0x17e0c9[_0x159818(0x1db)],'existingActivation':_0x17e0c9});}return _0x44ebc2;}function calculateYamlDiff(_0xfeedb9,_0x5654c2){if(_0x5654c2){const _0x3e6ec9=generateDiff(_0x5654c2,_0xfeedb9),_0xcda031=hasChanges(_0x3e6ec9);return{'isNew':![],'hasChanges':_0xcda031,'diff':_0xcda031?formatDiffWithColors(_0x3e6ec9):undefined};}const _0x4dd766=generateDiff('',_0xfeedb9);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4dd766)};}export function calculateSegmentDiff(_0x430ae3,_0x4cd6d7,_0x1a111a,_0x3db729,_0x321782){const _0x420c9d=segmentToYamlString(_0x430ae3),_0x43cb64=_0x4cd6d7?segmentToYamlString(segmentWithActivationsToYaml(_0x4cd6d7,_0x1a111a,undefined,_0x3db729,_0x321782)):undefined;return calculateYamlDiff(_0x420c9d,_0x43cb64);}export function calculateJourneyDiff(_0x3f68af,_0x1ef5f1){const _0xc6b73d=normalizeJourneyDef(_0x3f68af,_0x3f68af),_0xc7ef80=a136_0x4b928d(_0xc6b73d),_0x56dd33=_0x1ef5f1?a136_0x4b928d(normalizeJourneyDef(_0x1ef5f1,_0x3f68af)):undefined;return calculateYamlDiff(_0xc7ef80,_0x56dd33);}export function findSegmentsToDelete(_0x48352f,_0x20817b,_0x3f5cd6,_0x16cbc1,_0x3282d5){const _0x10d164=a136_0x271f24,_0x2f0c5f=new Set();for(const {yamlConfig:_0x57963d,folderPath:_0x5b8cd6}of _0x20817b){_0x2f0c5f['add'](_0x5b8cd6+':'+_0x57963d[_0x10d164(0x1db)]);}return _0x48352f[_0x10d164(0x180)](_0x1cd326=>{const _0x444ec8=_0x10d164,_0x154d8b=_0x1cd326['segmentFolderId']?_0x3f5cd6[_0x444ec8(0x21e)](_0x1cd326[_0x444ec8(0x182)][_0x444ec8(0x14a)]())||'':'',_0x83929c=_0x154d8b+':'+_0x1cd326[_0x444ec8(0x1db)];if(_0x2f0c5f[_0x444ec8(0x173)](_0x83929c))return![];if(_0x3282d5)return _0x154d8b===_0x16cbc1||_0x154d8b['startsWith'](_0x16cbc1+'/');return!![];});}export function findJourneysToDelete(_0x500795,_0x2b1ed4,_0x3120ee,_0x3149f8,_0x48376b){const _0x147cc3=a136_0x271f24,_0x38eb48=new Set();for(const {yamlConfig:_0x36de84,folderPath:_0x18c9d7}of _0x2b1ed4){_0x38eb48['add'](_0x18c9d7+':'+_0x36de84[_0x147cc3(0x1db)]);}return _0x500795['filter'](_0x3d0b2b=>{const _0x1f0e94=_0x147cc3,_0xa54de7=_0x3d0b2b['folderId']?_0x3120ee[_0x1f0e94(0x21e)](_0x3d0b2b['folderId'])||'':'',_0x566aae=_0xa54de7+':'+_0x3d0b2b[_0x1f0e94(0x1fc)];if(_0x38eb48[_0x1f0e94(0x173)](_0x566aae))return![];if(_0x48376b)return _0xa54de7===_0x3149f8||_0xa54de7[_0x1f0e94(0x1c0)](_0x3149f8+'/');return!![];});}export function buildSegmentLookupMap(_0x2eafbb,_0x53eb33){const _0x24e966=a136_0x271f24,_0x5be207=new Map();for(const _0x3f93fb of _0x2eafbb){const _0xda9639=_0x3f93fb[_0x24e966(0x182)]?_0x53eb33[_0x24e966(0x21e)](_0x3f93fb[_0x24e966(0x182)][_0x24e966(0x14a)]())||'':'',_0x21245c=_0xda9639+':'+_0x3f93fb[_0x24e966(0x1db)];_0x5be207['set'](_0x21245c,_0x3f93fb);}return _0x5be207;}export function buildSegmentNameToIdMap(_0x5f1592){const _0x4ef67e=a136_0x271f24,_0x53da4b=new Map();for(const _0x414cfb of _0x5f1592){_0x53da4b['set'](_0x414cfb[_0x4ef67e(0x1db)],_0x414cfb['id']);}return _0x53da4b;}export function buildJourneyBundleLookupMap(_0x4ef086,_0xfaa650){const _0x536193=a136_0x271f24,_0x35de24=new Map();for(const _0x1c3994 of _0x4ef086){const _0x137347=_0x1c3994[_0x536193(0x1d0)]?_0xfaa650[_0x536193(0x21e)](_0x1c3994[_0x536193(0x1d0)])||'':'',_0xd4f313=_0x137347+':'+_0x1c3994[_0x536193(0x1fc)];!_0x35de24[_0x536193(0x173)](_0xd4f313)&&_0x35de24[_0x536193(0x1df)](_0xd4f313,[]),_0x35de24[_0x536193(0x21e)](_0xd4f313)['push'](_0x1c3994);}for(const _0x72d8c4 of _0x35de24['values']()){_0x72d8c4[_0x536193(0x17f)]((_0x274378,_0x4dddc9)=>(_0x274378[_0x536193(0x142)]||0x0)-(_0x4dddc9['versionNumber']||0x0));}return _0x35de24;}export function collectFoldersToCreate(_0x172825,_0x2e4a36){const _0xc1210f=a136_0x271f24,_0x45512b=new Set();for(const _0x521ab6 of _0x172825){if(!_0x521ab6)continue;if(_0x2e4a36[_0xc1210f(0x173)](_0x521ab6))continue;const _0x5e0133=_0x521ab6[_0xc1210f(0x1da)]('/');let _0x58c335='';for(const _0x4fd538 of _0x5e0133){_0x58c335=_0x58c335?_0x58c335+'/'+_0x4fd538:_0x4fd538,!_0x2e4a36[_0xc1210f(0x173)](_0x58c335)&&_0x45512b[_0xc1210f(0x1ed)](_0x58c335);}}return _0x45512b;}function a136_0x19f6(){const _0x2a8914=['resolveJourneyId','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','conditionTimeoutUnit','create','logInfo','startsWith','1136eGsNRX','\x27...','segment_deleted','action','activationActions','connection','activation_','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','activationParams','SEGMENT_NOT_FOUND','Activation\x20not\x20found:\x20','attributes','createActivation','parentSegmentFolder','journeyById','folderId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','INTERNAL','columns','waitStep','activation_deleted','\x20(referenced\x20in\x20journey\x20','Updated\x20activation\x20\x27','\x27\x20not\x20found\x20in\x20journey\x20\x27','stringify','split','name','getSegmentEntity','):\x20','Updating\x20segment\x20\x27','set','activations','logDeleted','trim','and\x20the\x20server\x20segment,\x20then\x20retry.',').\x20','Failed\x20to\x20','activationStepsById','goal','join','\x20error(s)','includes','hex','Failed\x20to\x20resolve\x20segment\x20','add','./child-segment-yaml.js','yamlActivation','type','Matched\x20server\x20segment\x20\x27','stage\x20\x27','journey_creating','diff','1434icWvQd','Condition','description','decision_point','journeyBundlesByFolderAndName','uniqueServerName','\x27\x20to\x20local\x20\x27','journeyBundleName','\x20journey\x20from\x20file:\x20','exitCriterias','Updating\x20activation\x20\x27','Created\x20folder\x20\x27','debug','entry','match','folder','entryCriteria','getSegment','user','NOT_FOUND','journeyId','Duration','onProgress','updated','Created\x20journey\x20\x27','segmentId','journey_updating','state','fetchJourney','hasChanges','Updated\x20segment\x20\x27','tdx.sdk.push-workflow','item','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','steps','WaitStep','localName','index','all_columns','folder_created','map','get','Journey\x20\x27','stages','waitStepType','run_after_journey_refresh','schedule','size','Entry\x20criteria:\x20','logSuccess','connectionIdToNameMap','segment_updated','activationContext','validatedRequest','with','embedded_activation_creating','getLatestJourneyId','createSegment','../../utils/async.js','7fZYMBm','journeyStages','806283cCANbN','unchanged','parseDocument','existingSegments','digest','entry_criteria','resolveSegment','activation_updating','length','parentFolder','find','null','embeddedSegmentNameToId','1999752hTDISf','10WQvweu','1196920SqmueV','\x27\x20from\x20file:\x20','utf-8','replace','deps','isNew','idToEmailMap','Segment\x20not\x20found:\x20','results','journeyBundleId','segmentNameToId','Failed\x20to\x20resolve\x20activation\x20','Activation','nameToId','versionNumber','embedded_activation_created','Creating\x20folder\x20\x27','SEGMENT_SYNTAX_ERROR','journeyActivationStepId','created','rootFolderId','Segment\x20not\x20found','toString','logWarning','existingJourney','Fetching\x20','journey_updated','withProgress','sha1','behavior','JOURNEY_SYNTAX_ERROR','\x20activation\x20\x27','createdSegmentId','getJourney','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','\x27\x20entry\x20criteria','milestone','conditionSegmentId','segments','valid','existingSegment','538996IAzCIy','errors','existingActivation','activation_creating','conditions','5263038UfqlTX','from','updateSegmentById','embedded_segment_created','getSegmentEntity\x20also\x20failed\x20for\x20','goal\x20criteria','listActivations','absolutePath','some','SEGMENT_UPDATE_ERROR','branches','reduce','activation_deleting','DecisionPoint','Created\x20activation\x20\x27','data','journeyName','has','getActivation','update','Failed\x20to\x20fetch\x20referenced\x20segment\x20','rule','connector_config','folderPath','__pending_','activation_template_id','entries','\x27\x20exit\x20criteria','./journey-yaml.js','sort','filter','push','segmentFolderId','relative','parentId','getSegment\x20failed\x20for\x20','deleteActivation','parse','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','effectiveFolderId','resolvedRule','\x27\x20milestone','Deleting\x20activation\x20\x27','idToName','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','activationsBySegmentId','dirname','journey','JOURNEY_UPDATE_ERROR','keys','notification','progress','folderPathToId','\x0a\x20\x20','activation_created','uniqueSegmentName','day','segmentByFolderAndName','deleted','Created\x20segment\x20\x27','conditionTimeoutDuration','waitStepUnit','15zeBGzr','Updated\x20journey\x20\x27','updateActivation','\x27\x20wait\x20condition','folder_creating','createdSegmentIds','embedded_segment_creating','yamlConfig','delete','385908uSrADF','\x27\x20decision\x20point\x20branch\x20\x27','segment','journeys','relationships','toISOString','slice','message','object','all','buildUserMaps','ACTIVATION_SYNTAX_ERROR','skipSegments','Deleted\x20segment\x20\x27','\x27\x20for\x20','toLowerCase','Name\x20has\x20already\x20been\x20taken','max'];a136_0x19f6=function(){return _0x2a8914;};return a136_0x19f6();}export function parseAndClassifyYamlFiles(_0x28c2f6,_0x33b730,_0x5857c7){const _0x1f13bd=a136_0x271f24,_0x73d640=[],_0x45e72b=[];for(const _0x370a7e of _0x28c2f6){const _0x4d7a8b=a136_0x55e645[_0x1f13bd(0x183)](_0x33b730,a136_0x55e645[_0x1f13bd(0x190)](_0x370a7e)),_0x359080=_0x4d7a8b==='.'?'':_0x4d7a8b,_0x16ad2c=readFileSync(_0x370a7e,_0x1f13bd(0x136)),_0x36349c=a136_0x2b758b[_0x1f13bd(0x187)](_0x16ad2c);if(isJourneyDef(_0x36349c)){const _0x11c84f=a136_0x110f05(_0x16ad2c);_0x45e72b[_0x1f13bd(0x181)]({'yamlConfig':_0x11c84f,'folderPath':_0x359080,'sourcePath':_0x370a7e});}else{if(!_0x5857c7?.[_0x1f13bd(0x1b5)]){const _0xdba79a=parseSegmentYamlFile(_0x16ad2c),_0x3e14e0=normalizeChildSegmentYaml(_0xdba79a);_0x73d640['push']({'yamlConfig':_0x3e14e0,'folderPath':_0x359080,'sourcePath':_0x370a7e});}}}return{'segments':_0x73d640,'journeys':_0x45e72b};}export function validateParsedFiles(_0x4bb418,_0x5cee9d){const _0x286f0a=a136_0x271f24,_0x56d538=[];for(const {yamlConfig:_0x245e77,sourcePath:_0x27f0c0}of _0x4bb418['segments']){const _0x11f60a=readFileSync(_0x27f0c0,_0x286f0a(0x136)),_0x4cbcfe=a136_0x2b758b[_0x286f0a(0x234)](_0x11f60a),_0x3cf39d=validateSegmentDef(_0x245e77,{'source':_0x11f60a,'document':_0x4cbcfe},{'skipSchema':!![]});if(!_0x3cf39d['valid']){const _0x4eab9f=a136_0x55e645[_0x286f0a(0x183)](_0x5cee9d,_0x27f0c0);_0x56d538['push']({'filePath':_0x4eab9f,'source':_0x11f60a,'result':_0x3cf39d,'isJourney':![]});}}for(const {yamlConfig:_0x3edfcd,sourcePath:_0x2f57f4}of _0x4bb418['journeys']){const _0x136445=readFileSync(_0x2f57f4,_0x286f0a(0x136)),_0x109730=a136_0x2b758b[_0x286f0a(0x234)](_0x136445),_0x42fef1=validateJourneyDef(_0x3edfcd,{'source':_0x136445,'document':_0x109730},{'skipSchema':!![]});if(!_0x42fef1[_0x286f0a(0x15b)]){const _0x4cea63=a136_0x55e645[_0x286f0a(0x183)](_0x5cee9d,_0x2f57f4);_0x56d538[_0x286f0a(0x181)]({'filePath':_0x4cea63,'source':_0x136445,'result':_0x42fef1,'isJourney':!![]});}}return _0x56d538;}export function formatValidationErrors(_0x1d42a1){const _0x18cd26=a136_0x271f24,_0x4a181b=[];for(const {filePath:_0x550f57,source:_0x2216c1,result:_0x2f699a,isJourney:_0x58003a}of _0x1d42a1){const _0x6ef8ca=_0x58003a?'journey':_0x18cd26(0x1ab);_0x4a181b['push']('\x0a'+_0x550f57+'\x20('+_0x6ef8ca+_0x18cd26(0x1dd)+_0x2f699a[_0x18cd26(0x15e)][_0x18cd26(0x23a)]+_0x18cd26(0x1e9)),_0x4a181b[_0x18cd26(0x181)](formatValidationResult(_0x2f699a,_0x2216c1,_0x550f57));}return _0x4a181b['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x5d510e){const _0x27725d=a136_0x271f24,_0x5b6ee2=new Set(),_0x45f8fb=new Map(),_0x8b31c1=collectSegmentUsageCounts(_0x5d510e);if(_0x5d510e['segments'])for(const [_0x4c99fb,_0x44a3ca]of Object[_0x27725d(0x17c)](_0x5d510e[_0x27725d(0x15a)])){_0x5b6ee2[_0x27725d(0x1ed)](_0x4c99fb);if(_0x44a3ca[_0x27725d(0x177)]){const _0x3d4b15=yamlRuleToApi(_0x44a3ca['rule']),_0x1475ed=apiRuleToYaml(_0x3d4b15);_0x45f8fb[_0x27725d(0x1df)](_0x4c99fb,_0x1475ed);}}const _0x39148f=new Map();let _0x21d509=0x0;for(const [_0x368d30,_0x34ad71]of _0x45f8fb){const _0x14decd=serializeExpandedRule(_0x34ad71,_0x45f8fb),_0x5ce743=_0x39148f['get'](_0x14decd)||[];_0x5ce743[_0x27725d(0x181)]({'name':_0x368d30,'index':_0x21d509}),_0x39148f[_0x27725d(0x1df)](_0x14decd,_0x5ce743),_0x21d509++;}const _0x3a637d=new Map();for(const [_0x102459,_0x2a6df2]of _0x39148f){const _0x1b4f43=_0x2a6df2[_0x27725d(0x1af)]()[_0x27725d(0x17f)]((_0x1c75f6,_0x356e5b)=>{const _0x5742ea=_0x27725d,_0xe89b90=_0x8b31c1['get'](_0x1c75f6[_0x5742ea(0x1db)])||0x0,_0x58eca0=_0x8b31c1[_0x5742ea(0x21e)](_0x356e5b[_0x5742ea(0x1db)])||0x0;if(_0xe89b90!==_0x58eca0)return _0x58eca0-_0xe89b90;return _0x1c75f6['index']-_0x356e5b[_0x5742ea(0x21a)];})[_0x27725d(0x21d)](_0x25b007=>_0x25b007[_0x27725d(0x1db)]),_0x1a7563=[];for(const _0x40d7b7 of _0x1b4f43){const _0x50590e=_0x8b31c1[_0x27725d(0x21e)](_0x40d7b7)||0x0,_0x46e33b=Math['max'](_0x50590e,0x1);for(let _0x5297c7=0x0;_0x5297c7<_0x46e33b;_0x5297c7++){_0x1a7563[_0x27725d(0x181)](_0x40d7b7);}}_0x3a637d['set'](_0x102459,_0x1a7563);}return{'existingLocalSegmentNames':_0x5b6ee2,'localSegmentRules':_0x45f8fb,'localExpandedRuleToNames':_0x3a637d};}export function createSegmentIdResolver(_0x128604,_0x199c96){return async _0x25d1d1=>{const _0x4d6ede=a136_0x2eaf,_0x52316f=_0x128604[_0x4d6ede(0x21e)](_0x25d1d1);if(!_0x52316f)throw new SDKError(ErrorCode[_0x4d6ede(0x1ca)],_0x4d6ede(0x13b)+_0x25d1d1+_0x4d6ede(0x1d1)+_0x199c96+'\x27)');return _0x52316f;};}export function extractRootFolderId(_0x48ae13){const _0x262b7e=a136_0x271f24;return _0x48ae13[_0x262b7e(0x1ad)]?.[_0x262b7e(0x1ce)]?.[_0x262b7e(0x171)]?.['id']||_0x48ae13[_0x262b7e(0x1ad)]?.[_0x262b7e(0x23b)]?.['data']?.['id'];}export function buildConnectionMaps(_0x23b57e){const _0x3fb9d6=a136_0x271f24,_0x435b59=new Map(),_0x20f974=new Map(),_0x31c83c=new Map();for(const _0x30ed98 of _0x23b57e){_0x435b59[_0x3fb9d6(0x1df)](_0x30ed98['name'],parseInt(_0x30ed98['id'],0xa)),_0x20f974['set'](_0x30ed98['id'],_0x30ed98['name']),_0x31c83c['set'](_0x30ed98['name'],_0x30ed98['type']);}return{'nameToId':_0x435b59,'idToName':_0x20f974,'nameToType':_0x31c83c};}export function calculatePushStats(_0x51b1aa,_0x1ec160,_0x45094e,_0x24ab01,_0x54f89f,_0x4d07d1,_0x2fd851){const _0x13fbdd=a136_0x271f24,_0x1cad4d=_0x51b1aa[_0x13fbdd(0x180)](_0x164692=>_0x164692[_0x13fbdd(0x139)]),_0x18efbe=_0x51b1aa[_0x13fbdd(0x180)](_0x20406b=>!_0x20406b[_0x13fbdd(0x139)]&&_0x20406b[_0x13fbdd(0x212)]),_0x33096f=_0x51b1aa[_0x13fbdd(0x180)](_0x558851=>!_0x558851['isNew']&&!_0x558851[_0x13fbdd(0x212)]),_0x434d45=_0x4d07d1?_0x24ab01:[],_0x372ef2=_0x1ec160[_0x13fbdd(0x180)](_0x4c99af=>_0x4c99af[_0x13fbdd(0x139)]),_0x54cffd=_0x1ec160[_0x13fbdd(0x180)](_0x383fbd=>!_0x383fbd[_0x13fbdd(0x139)]&&_0x383fbd['hasChanges']),_0x13aa8c=_0x1ec160['filter'](_0x578048=>!_0x578048[_0x13fbdd(0x139)]&&!_0x578048['hasChanges']),_0x560be3=_0x4d07d1?_0x54f89f:[],_0x43c2f6=_0x51b1aa['flatMap'](_0x5081e4=>_0x5081e4[_0x13fbdd(0x1c5)]),_0x9a9509=_0x43c2f6[_0x13fbdd(0x180)](_0x2fe03a=>_0x2fe03a['type']===_0x13fbdd(0x1be)),_0x3e536b=_0x43c2f6[_0x13fbdd(0x180)](_0x33b1b0=>_0x33b1b0['type']==='update'),_0x4fcecf=_0x43c2f6[_0x13fbdd(0x180)](_0x163a0b=>_0x163a0b['type']==='delete'),_0x1c103b=Array[_0x13fbdd(0x163)](_0x45094e)[_0x13fbdd(0x17f)](),_0x425573=_0x2fd851?![]:_0x1cad4d[_0x13fbdd(0x23a)]>0x0||_0x18efbe[_0x13fbdd(0x23a)]>0x0||_0x434d45[_0x13fbdd(0x23a)]>0x0,_0x148547=_0x372ef2[_0x13fbdd(0x23a)]>0x0||_0x54cffd[_0x13fbdd(0x23a)]>0x0||_0x560be3[_0x13fbdd(0x23a)]>0x0,_0x294a6a=_0x2fd851?![]:_0x43c2f6[_0x13fbdd(0x23a)]>0x0,_0x44df15=_0x1c103b[_0x13fbdd(0x23a)]>0x0;return{'segments':{'new':_0x1cad4d,'changed':_0x18efbe,'unchanged':_0x33096f,'toDelete':_0x434d45},'journeys':{'new':_0x372ef2,'changed':_0x54cffd,'unchanged':_0x13aa8c,'toDelete':_0x560be3},'activations':{'all':_0x43c2f6,'toCreate':_0x9a9509,'toUpdate':_0x3e536b,'toDelete':_0x4fcecf},'folders':{'toCreate':_0x1c103b},'counts':{'segments':{'new':_0x1cad4d[_0x13fbdd(0x23a)],'changed':_0x18efbe[_0x13fbdd(0x23a)],'unchanged':_0x33096f[_0x13fbdd(0x23a)],'toDelete':_0x434d45[_0x13fbdd(0x23a)]},'journeys':{'new':_0x372ef2[_0x13fbdd(0x23a)],'changed':_0x54cffd[_0x13fbdd(0x23a)],'unchanged':_0x13aa8c[_0x13fbdd(0x23a)],'toDelete':_0x560be3[_0x13fbdd(0x23a)]},'activations':{'create':_0x9a9509[_0x13fbdd(0x23a)],'update':_0x3e536b[_0x13fbdd(0x23a)],'delete':_0x4fcecf[_0x13fbdd(0x23a)]},'folders':_0x1c103b['length']},'hasChanges':_0x425573||_0x148547||_0x294a6a||_0x44df15};}export async function buildPushExecutionContext(_0x355243,_0x277d49,_0x23b871,_0x34af9c,_0x2d1f3d,_0x3098f4){const _0x51bf15=a136_0x271f24,_0x1021f3=extractRootFolderId(_0x23b871),{pathToId:_0x4aded9,idToPath:_0x3100c3}=buildFolderMaps(_0x2d1f3d),_0x39ce2e=buildSegmentNameToIdMap(_0x34af9c),_0x500cd6=new Map(),{batchAsync:_0x5e0ce3}=await import(_0x51bf15(0x22f)),[_0x1aa487,_0xc37659]=await Promise['all']([_0x355243[_0x51bf15(0x207)][_0x51bf15(0x1b3)](),_0x355243[_0x51bf15(0x1c6)]['list'](),((async()=>{const _0x2c78ba=_0x51bf15;!_0x3098f4&&_0x34af9c[_0x2c78ba(0x23a)]>0x0&&await _0x5e0ce3(_0x34af9c,async _0x55588b=>{const _0xdf37e5=_0x2c78ba,_0x16f3df=await _0x355243['segment'][_0xdf37e5(0x168)](_0x277d49,_0x55588b['id']);_0x500cd6['set'](_0x55588b['id'],_0x16f3df);});})())]),{emailToId:_0x253763,idToEmail:_0x6da2cf}=_0x1aa487,_0x348b19=buildConnectionMaps(_0xc37659);return{'rootFolderId':_0x1021f3,'folderPathToId':_0x4aded9,'folderIdToPath':_0x3100c3,'segmentNameToId':_0x39ce2e,'activationsBySegmentId':_0x500cd6,'emailToIdMap':_0x253763,'idToEmailMap':_0x6da2cf,'connectionNameToIdMap':_0x348b19[_0x51bf15(0x141)],'connectionIdToNameMap':_0x348b19[_0x51bf15(0x18d)],'connectionNameToTypeMap':_0x348b19['nameToType']};}export function createPushYamlContextForBundle(_0x435ee9,_0x231db3,_0x47fcaf,_0x1eede7,_0x2eb864,_0x57efe1,_0xb03930,_0x2284ae){const {existingLocalSegmentNames:_0x1be9a9,localExpandedRuleToNames:_0x446f14}=_0x1eede7,_0x162cee=new Set(),_0x523e83=new Map(),_0x7213bd=new Map(),_0x2c7cf5=new Map(),_0xf3aa5c=createJumpTargetCache(),_0x48adb8=new Map(),_0x13e97a=new Map(),_0x150953=new Set();let _0x4d159f;const _0x4de416=_0x3a8e10=>{const _0x9c4f41={'resolveSegment':async _0x5d9426=>{const _0x499127=a136_0x2eaf,_0x3f0eae=_0x2c7cf5[_0x499127(0x21e)](_0x5d9426);if(_0x3f0eae!==undefined)return{'name':_0x3f0eae,'isJourneyLocal':!![]};try{const _0x14926a=await fetchSegment(_0x435ee9,_0x231db3,_0x5d9426,_0x47fcaf);if(!_0x14926a)throw new Error(_0x499127(0x149));const _0x3dca8b=generateJourneyLocalName(_0x14926a[_0x499127(0x1db)]),_0x1ddd01=_0x14926a['kind']===SEGMENT_KIND_JOURNEY&&_0x3dca8b!==undefined;let _0x331f16=_0x14926a['name'],_0x48cfdd;if(_0x1ddd01&&_0x14926a[_0x499127(0x177)]){const _0x4c76cc=apiRuleToYaml(_0x14926a[_0x499127(0x177)]);_0x13e97a[_0x499127(0x1df)](_0x5d9426,_0x4c76cc);const _0x24a146=async _0x56bf2d=>{const _0x41e4ad=_0x499127,_0x30359c=collectSegmentRefsFromRule(_0x56bf2d);for(const _0xdda7d5 of _0x30359c){if(!_0x13e97a[_0x41e4ad(0x173)](_0xdda7d5))try{const _0x43ebbf=await fetchSegment(_0x435ee9,_0x231db3,_0xdda7d5,_0x47fcaf);if(_0x43ebbf?.['rule']){const _0x393405=apiRuleToYaml(_0x43ebbf[_0x41e4ad(0x177)]);_0x13e97a[_0x41e4ad(0x1df)](_0xdda7d5,_0x393405),await _0x24a146(_0x393405);}}catch(_0x13a7a4){logger[_0x41e4ad(0x201)](_0x41e4ad(0x176)+_0xdda7d5+':\x20'+_0x13a7a4);}}};await _0x24a146(_0x4c76cc);const _0x45126a=serializeExpandedRule(_0x4c76cc,_0x13e97a),_0x1769fe=_0x446f14[_0x499127(0x21e)](_0x45126a);if(_0x1769fe&&_0x1769fe[_0x499127(0x23a)]>0x0){const _0x3cb504=_0x523e83['get'](_0x45126a)||0x0,_0x1454c0=_0x1769fe[_0x3cb504]||_0x1769fe[_0x1769fe[_0x499127(0x23a)]-0x1];_0x523e83['set'](_0x45126a,_0x3cb504+0x1),_0x331f16=_0x1454c0,_0x162cee['add'](_0x331f16),_0x2c7cf5[_0x499127(0x1df)](_0x5d9426,_0x331f16);const _0x2962b4=await resolveRuleSegmentRefs(_0x4c76cc,async _0x3caeb3=>{const _0x2e49e8=_0x499127,_0x46b143=_0x2c7cf5[_0x2e49e8(0x21e)](_0x3caeb3);if(_0x46b143)return _0x46b143;const _0x16db00=await _0x4d159f['resolveSegment'](_0x3caeb3);return _0x16db00[_0x2e49e8(0x1db)];});_0x48cfdd={'description':_0x14926a['description'],'rule':_0x2962b4};}else{const _0x34ad62=_0x48adb8['get'](_0x45126a);if(_0x34ad62)_0x331f16=_0x34ad62,_0x2c7cf5['set'](_0x5d9426,_0x331f16);else{if(_0x3dca8b){let _0x27c84a=_0x3dca8b,_0x124046=0x2;while(_0x162cee[_0x499127(0x173)](_0x27c84a)||_0x1be9a9[_0x499127(0x173)](_0x27c84a)){_0x27c84a=_0x3dca8b+'_'+_0x124046,_0x124046++;}_0x162cee[_0x499127(0x1ed)](_0x27c84a),_0x331f16=_0x27c84a;}_0x2c7cf5[_0x499127(0x1df)](_0x5d9426,_0x331f16),_0x48adb8[_0x499127(0x1df)](_0x45126a,_0x331f16);const _0x363882=await resolveRuleSegmentRefs(_0x4c76cc,async _0x157f34=>{const _0x794831=_0x499127,_0x41b26c=_0x2c7cf5['get'](_0x157f34);if(_0x41b26c)return _0x41b26c;const _0x5c79c2=await _0x4d159f[_0x794831(0x238)](_0x157f34);return _0x5c79c2[_0x794831(0x1db)];});_0x48cfdd={'description':_0x14926a[_0x499127(0x1f7)],'rule':_0x363882};}}}return{'name':_0x331f16,'isJourneyLocal':_0x1ddd01,'definition':_0x48cfdd};}catch(_0x244493){return logger[_0x499127(0x201)](_0x499127(0x1ec)+_0x5d9426+':\x20'+_0x244493),{'name':_0x5d9426,'isJourneyLocal':![]};}},'resolveActivation':async _0x21bf41=>{const _0x100709=a136_0x2eaf,_0x5e4e67=_0x7213bd[_0x100709(0x21e)](_0x21bf41);if(_0x5e4e67!==undefined)return{'name':_0x5e4e67,'isJourneyLocal':!![]};try{let _0x215264=_0xb03930?.['get'](_0x21bf41);!_0x215264&&(_0x215264=await _0x435ee9[_0x100709(0x191)][_0x100709(0x174)](_0x3a8e10,_0x21bf41));const _0x54ecb8=_0x215264[_0x100709(0x1cc)][_0x100709(0x1c9)][_0x100709(0x1db)]||_0x21bf41,_0x38771c=sanitizeYamlKey(_0x54ecb8)||_0x100709(0x1c7)+_0x21bf41,_0x5a6c12=_0x38771c;_0x7213bd['set'](_0x21bf41,_0x5a6c12);const _0x4133e8=journeyActivationStepToYaml(_0x215264,_0x2eb864,_0x57efe1);return{'name':_0x5a6c12,'isJourneyLocal':!![],'definition':_0x4133e8};}catch(_0x13b365){return logger['debug'](_0x100709(0x13f)+_0x21bf41+':\x20'+_0x13b365),{'name':_0x21bf41,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2af25f,_0x27882d)=>resolveJumpTarget(_0x2af25f,_0x27882d,_0xf3aa5c,async _0x5455de=>{const _0x35834f=a136_0x2eaf,_0x467141=_0x2284ae?.['get'](_0x5455de);if(_0x467141)return _0x467141;return _0x435ee9['journey'][_0x35834f(0x155)](_0x5455de);})};return _0x4d159f=_0x9c4f41,_0x9c4f41;},_0x27caf4=async _0xaebbbe=>{const _0x54750b=a136_0x2eaf,{collectSegmentIdsFromJourneyApi:_0xa9268}=await import(_0x54750b(0x17e)),{batchAsync:_0x37584e}=await import(_0x54750b(0x22f)),_0x284cdc=new Set();for(const _0xac11d0 of _0xaebbbe){let _0x5377ce=_0x2284ae?.[_0x54750b(0x21e)](_0xac11d0);!_0x5377ce&&(_0x5377ce=await _0x435ee9[_0x54750b(0x191)][_0x54750b(0x155)](_0xac11d0));const _0x18e661=_0xa9268(_0x5377ce);for(const _0x3868ce of _0x18e661){_0x284cdc['add'](_0x3868ce);}}let _0x27f984=Array[_0x54750b(0x163)](_0x284cdc);while(_0x27f984['length']>0x0){const _0x38e47d=_0x27f984[_0x54750b(0x180)](_0x173cd6=>!_0x150953[_0x54750b(0x173)](_0x173cd6));if(_0x38e47d[_0x54750b(0x23a)]===0x0)break;const _0x4e6741=await _0x37584e(_0x38e47d,async _0x2a3fb1=>{const _0x929ae0=_0x54750b;_0x150953[_0x929ae0(0x1ed)](_0x2a3fb1);const _0x40d6de=await fetchSegment(_0x435ee9,_0x231db3,_0x2a3fb1,_0x47fcaf);if(!_0x40d6de)return null;return{'segmentId':_0x2a3fb1,'segment':_0x40d6de};},0xa),_0x47677b=new Set();for(const _0x54d98c of _0x4e6741){if(!_0x54d98c?.[_0x54750b(0x1ab)]?.[_0x54750b(0x177)])continue;const _0x35eb74=apiRuleToYaml(_0x54d98c[_0x54750b(0x1ab)][_0x54750b(0x177)]);_0x13e97a['set'](_0x54d98c[_0x54750b(0x20e)],_0x35eb74);const _0x4d55fc=collectSegmentRefsFromRule(_0x35eb74);for(const _0x1bf93a of _0x4d55fc){!_0x150953['has'](_0x1bf93a)&&_0x47677b[_0x54750b(0x1ed)](_0x1bf93a);}}_0x27f984=Array[_0x54750b(0x163)](_0x47677b);}};return{'createYamlContext':_0x4de416,'prefetchJourneySegments':_0x27caf4};}export async function executePushSegments(_0x548dc4,_0x7562ab,_0x1b24e8,_0x44d65b,_0x4d8c23){const _0xa87c21=a136_0x271f24,{segmentDefToCreateRequest:_0x300951,segmentDefToUpdateRequest:_0x320b1f}=await import(_0xa87c21(0x1ee)),_0x456c6a=_0x1b24e8['folderPathToId'],_0x26ceee=0x5,_0x59805a=async _0x2ccbc2=>{const _0x1d6c07=_0xa87c21,_0x3449c1=_0x2ccbc2[_0x1d6c07(0x179)]?_0x456c6a[_0x1d6c07(0x21e)](_0x2ccbc2['folderPath']):undefined;let _0x54f713;const _0x337618={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x4d7861=_0x2ccbc2['yamlConfig'];if(_0x2ccbc2[_0x1d6c07(0x1a7)]['rule']){const _0x146bd6=createSegmentIdResolver(_0x1b24e8[_0x1d6c07(0x13e)],_0x2ccbc2['yamlConfig'][_0x1d6c07(0x1db)]),_0x3f8c00=await resolveRuleSegmentIds(_0x2ccbc2[_0x1d6c07(0x1a7)][_0x1d6c07(0x177)],_0x146bd6);_0x4d7861={..._0x2ccbc2[_0x1d6c07(0x1a7)],'rule':_0x3f8c00};}try{if(_0x2ccbc2[_0x1d6c07(0x139)]){_0x4d8c23[_0x1d6c07(0x20b)]?.({'type':'segment_creating','name':_0x2ccbc2[_0x1d6c07(0x1a7)][_0x1d6c07(0x1db)]});const _0xa582f6=_0x300951(_0x4d7861,_0x3449c1),_0x1a4008=await _0x4d8c23[_0x1d6c07(0x14f)]('Creating\x20segment\x20\x27'+_0x2ccbc2[_0x1d6c07(0x1a7)][_0x1d6c07(0x1db)]+_0x1d6c07(0x1c2),()=>_0x548dc4['segment'][_0x1d6c07(0x22e)](_0x44d65b[_0x1d6c07(0x184)],_0xa582f6));_0x54f713=_0x1a4008[_0x1d6c07(0x171)]['id'],_0x1b24e8[_0x1d6c07(0x13e)][_0x1d6c07(0x1df)](_0x2ccbc2[_0x1d6c07(0x1a7)]['name'],_0x54f713),_0x337618['createdSegmentId']={'name':_0x2ccbc2[_0x1d6c07(0x1a7)][_0x1d6c07(0x1db)],'id':_0x54f713},_0x4d8c23['onProgress']?.({'type':'segment_created','name':_0x2ccbc2[_0x1d6c07(0x1a7)][_0x1d6c07(0x1db)],'segmentId':_0x54f713}),_0x4d8c23['logSuccess']?.(_0x1d6c07(0x19d)+_0x2ccbc2['yamlConfig']['name']+'\x27'),_0x337618[_0x1d6c07(0x147)]=0x1;}else{if(_0x2ccbc2[_0x1d6c07(0x212)]){_0x4d8c23[_0x1d6c07(0x20b)]?.({'type':'segment_updating','name':_0x2ccbc2['yamlConfig']['name']});const _0xf28a92=_0x320b1f(_0x4d7861);_0x3449c1!==_0x2ccbc2[_0x1d6c07(0x15c)]?.['segmentFolderId']&&(_0xf28a92['segmentFolderId']=_0x3449c1?parseInt(_0x3449c1,0xa):undefined),await _0x4d8c23['withProgress'](_0x1d6c07(0x1de)+_0x2ccbc2[_0x1d6c07(0x1a7)][_0x1d6c07(0x1db)]+_0x1d6c07(0x1c2),()=>_0x548dc4[_0x1d6c07(0x1ab)][_0x1d6c07(0x164)](_0x44d65b[_0x1d6c07(0x184)],_0x2ccbc2[_0x1d6c07(0x15c)]['id'],_0xf28a92)),_0x54f713=_0x2ccbc2[_0x1d6c07(0x15c)]['id'],_0x4d8c23[_0x1d6c07(0x20b)]?.({'type':_0x1d6c07(0x228),'name':_0x2ccbc2[_0x1d6c07(0x1a7)][_0x1d6c07(0x1db)]}),_0x4d8c23['logSuccess']?.(_0x1d6c07(0x213)+_0x2ccbc2['yamlConfig'][_0x1d6c07(0x1db)]+'\x27'),_0x337618['updated']=0x1;}else _0x54f713=_0x2ccbc2[_0x1d6c07(0x15c)]['id'];}}catch(_0x416710){const _0x692bab=isHttp400Error(_0x416710),_0x433ebd=_0x692bab?ErrorCode[_0x1d6c07(0x145)]:ErrorCode[_0x1d6c07(0x16b)],_0x5669c9=getErrorMessage(_0x416710);throw new SDKError(_0x433ebd,_0x1d6c07(0x1e5)+(_0x2ccbc2[_0x1d6c07(0x139)]?'create':_0x1d6c07(0x175))+'\x20segment\x20from\x20file:\x20'+_0x2ccbc2[_0x1d6c07(0x169)]+_0x1d6c07(0x197)+_0x5669c9,_0x416710);}try{const _0xf86e1a=await syncActivationsForSegment(_0x548dc4,_0x44d65b[_0x1d6c07(0x184)],_0x54f713,_0x2ccbc2[_0x1d6c07(0x1a7)][_0x1d6c07(0x1db)],_0x2ccbc2[_0x1d6c07(0x1c5)],_0x4d8c23,_0x2ccbc2['absolutePath']);_0x337618[_0x1d6c07(0x1e0)]=_0xf86e1a;}catch(_0x226efd){if(_0x226efd instanceof SDKError)throw _0x226efd;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x1d6c07(0x156)+_0x2ccbc2['yamlConfig'][_0x1d6c07(0x1db)]+_0x1d6c07(0x135)+_0x2ccbc2['absolutePath']+_0x1d6c07(0x197)+getErrorMessage(_0x226efd),_0x226efd);}return _0x337618;},_0x1e93e4=await batchAsync(_0x7562ab,_0x59805a,_0x26ceee),_0x4b6283={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5f1059 of _0x1e93e4){_0x4b6283[_0xa87c21(0x147)]+=_0x5f1059['created'],_0x4b6283[_0xa87c21(0x20c)]+=_0x5f1059[_0xa87c21(0x20c)],_0x5f1059['createdSegmentId']&&_0x4b6283[_0xa87c21(0x1a5)]['set'](_0x5f1059['createdSegmentId'][_0xa87c21(0x1db)],_0x5f1059[_0xa87c21(0x154)]['id']),_0x4b6283[_0xa87c21(0x1e0)]['created']+=_0x5f1059[_0xa87c21(0x1e0)][_0xa87c21(0x147)],_0x4b6283[_0xa87c21(0x1e0)]['updated']+=_0x5f1059[_0xa87c21(0x1e0)][_0xa87c21(0x20c)],_0x4b6283[_0xa87c21(0x1e0)]['deleted']+=_0x5f1059[_0xa87c21(0x1e0)][_0xa87c21(0x19c)];}return _0x4b6283;}async function syncActivationsForSegment(_0x5923b1,_0x34eaa9,_0x420547,_0x3bbf0e,_0x3422bf,_0x44510f,_0x5180e9){const _0x3968b4=a136_0x271f24,_0x15c33a={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x426e80 of _0x3422bf){try{if(_0x426e80[_0x3968b4(0x1f0)]===_0x3968b4(0x1be)&&_0x426e80[_0x3968b4(0x22a)])_0x44510f[_0x3968b4(0x20b)]?.({'type':_0x3968b4(0x160),'segmentName':_0x3bbf0e,'activationName':_0x426e80[_0x3968b4(0x1db)]}),await _0x44510f['withProgress']('Creating\x20activation\x20\x27'+_0x426e80[_0x3968b4(0x1db)]+'\x27...',()=>_0x5923b1[_0x3968b4(0x1ab)][_0x3968b4(0x1cd)](_0x34eaa9,_0x420547,_0x426e80[_0x3968b4(0x22a)])),_0x44510f[_0x3968b4(0x20b)]?.({'type':_0x3968b4(0x198),'segmentName':_0x3bbf0e,'activationName':_0x426e80[_0x3968b4(0x1db)]}),_0x44510f['logSuccess']?.(_0x3968b4(0x170)+_0x426e80['name']+'\x27'),_0x15c33a[_0x3968b4(0x147)]++;else{if(_0x426e80[_0x3968b4(0x1f0)]===_0x3968b4(0x175)&&_0x426e80[_0x3968b4(0x22a)]&&_0x426e80[_0x3968b4(0x15f)])_0x44510f[_0x3968b4(0x20b)]?.({'type':_0x3968b4(0x239),'segmentName':_0x3bbf0e,'activationName':_0x426e80[_0x3968b4(0x1db)]}),await _0x44510f[_0x3968b4(0x14f)](_0x3968b4(0x1ff)+_0x426e80[_0x3968b4(0x1db)]+'\x27...',()=>_0x5923b1[_0x3968b4(0x1ab)][_0x3968b4(0x1a2)](_0x34eaa9,_0x420547,_0x426e80[_0x3968b4(0x15f)]['id'],_0x426e80['validatedRequest'])),_0x44510f[_0x3968b4(0x20b)]?.({'type':'activation_updated','segmentName':_0x3bbf0e,'activationName':_0x426e80[_0x3968b4(0x1db)]}),_0x44510f[_0x3968b4(0x226)]?.(_0x3968b4(0x1d7)+_0x426e80[_0x3968b4(0x1db)]+'\x27'),_0x15c33a[_0x3968b4(0x20c)]++;else _0x426e80[_0x3968b4(0x1f0)]===_0x3968b4(0x1a8)&&_0x426e80[_0x3968b4(0x15f)]&&(_0x44510f[_0x3968b4(0x20b)]?.({'type':_0x3968b4(0x16e),'segmentName':_0x3bbf0e,'activationName':_0x426e80['name']}),await _0x44510f[_0x3968b4(0x14f)](_0x3968b4(0x18c)+_0x426e80[_0x3968b4(0x1db)]+_0x3968b4(0x1c2),()=>_0x5923b1['segment'][_0x3968b4(0x186)](_0x34eaa9,_0x420547,_0x426e80[_0x3968b4(0x15f)]['id'])),_0x44510f[_0x3968b4(0x20b)]?.({'type':_0x3968b4(0x1d5),'segmentName':_0x3bbf0e,'activationName':_0x426e80[_0x3968b4(0x1db)]}),_0x44510f[_0x3968b4(0x1e1)]?.('Deleted\x20activation\x20\x27'+_0x426e80[_0x3968b4(0x1db)]+'\x27'),_0x15c33a['deleted']++);}}catch(_0x29bdb1){const _0x126e12=isHttp400Error(_0x29bdb1),_0x120857=_0x126e12?ErrorCode[_0x3968b4(0x1b4)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x44d2a7=getErrorMessage(_0x29bdb1);throw new SDKError(_0x120857,'Failed\x20to\x20'+_0x426e80[_0x3968b4(0x1f0)]+_0x3968b4(0x153)+_0x426e80[_0x3968b4(0x1db)]+_0x3968b4(0x135)+_0x5180e9+_0x3968b4(0x197)+_0x44d2a7,_0x29bdb1);}}return _0x15c33a;}export async function executePushFolders(_0x5ee014,_0x3c0150,_0x35b7c4,_0x3e35f9,_0x73ff9b){const _0x3162a1=a136_0x271f24,_0x49ac21=new Map(_0x35b7c4),_0x4478e8=sortFoldersByDepth(_0x3c0150);for(const _0x2e99a5 of _0x4478e8){const _0x425471=_0x2e99a5[_0x3162a1(0x1da)]('/'),_0x507a00=_0x425471[_0x425471[_0x3162a1(0x23a)]-0x1],_0x44f49a=_0x425471[_0x3162a1(0x1af)](0x0,-0x1)[_0x3162a1(0x1e8)]('/'),_0x2ebea9=_0x49ac21[_0x3162a1(0x21e)](_0x44f49a);_0x73ff9b['onProgress']?.({'type':_0x3162a1(0x1a4),'folder':_0x2e99a5});const _0x56dad2={'name':_0x507a00,'parentFolderId':_0x2ebea9},_0x5c3918=await _0x73ff9b[_0x3162a1(0x14f)](_0x3162a1(0x144)+_0x2e99a5+'\x27...',()=>_0x5ee014['segment']['createFolder'](_0x3e35f9[_0x3162a1(0x184)],_0x56dad2));_0x49ac21[_0x3162a1(0x1df)](_0x2e99a5,_0x5c3918[_0x3162a1(0x171)]['id']),_0x73ff9b[_0x3162a1(0x20b)]?.({'type':_0x3162a1(0x21c),'folder':_0x2e99a5,'folderId':_0x5c3918[_0x3162a1(0x171)]['id']}),_0x73ff9b[_0x3162a1(0x1bf)]?.(_0x3162a1(0x200)+_0x2e99a5+'\x27');}return _0x49ac21;}export async function executePushSegmentDeletions(_0x1f9a50,_0x560125,_0x1977d7){const _0x3b9583=a136_0x271f24;if(_0x560125['length']===0x0)return 0x0;const {batchAsync:_0x5aded2}=await import(_0x3b9583(0x22f)),_0x37d75b=0x5,_0x4224fa=await _0x5aded2(_0x560125,async _0xd3a3cd=>{const _0x17bac5=_0x3b9583;return _0x1977d7[_0x17bac5(0x20b)]?.({'type':'segment_deleting','name':_0xd3a3cd['name']}),await _0x1f9a50[_0x17bac5(0x1ab)]['deleteSegment'](_0xd3a3cd['id']),_0x1977d7['onProgress']?.({'type':_0x17bac5(0x1c3),'name':_0xd3a3cd[_0x17bac5(0x1db)]}),_0x1977d7[_0x17bac5(0x1e1)]?.(_0x17bac5(0x1b6)+_0xd3a3cd[_0x17bac5(0x1db)]+'\x27'),0x1;},_0x37d75b);return _0x4224fa[_0x3b9583(0x16d)]((_0x3f6ca8,_0x38bb74)=>_0x3f6ca8+_0x38bb74,0x0);}export async function executePushJourneys(_0x388476,_0x16c4eb,_0x5a3c27,_0xb21456,_0x40ad13){const _0x309c28=a136_0x271f24,{journeyDefToRequest:_0x3222e9}=await import(_0x309c28(0x17e)),{activationDefToCreateRequest:_0x496f37,yamlRuleToApi:_0x5a3c55,validateSegmentRule:_0x189660}=await import(_0x309c28(0x1ee)),_0x1b6c95={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x218b7=new Map(_0x5a3c27[_0x309c28(0x13e)]),_0x3d1cad=0x5;for(let _0x5204fe=0x0;_0x5204fe<_0x16c4eb[_0x309c28(0x23a)];_0x5204fe+=_0x3d1cad){const _0xf83c9e=_0x16c4eb[_0x309c28(0x1af)](_0x5204fe,_0x5204fe+_0x3d1cad),_0x6e964a=await Promise[_0x309c28(0x1b2)](_0xf83c9e[_0x309c28(0x21d)](async _0x156dd5=>{const _0x19e98d=_0x309c28;if(!_0x156dd5[_0x19e98d(0x139)]&&!_0x156dd5[_0x19e98d(0x212)])return{'action':_0x19e98d(0x233),'name':_0x156dd5[_0x19e98d(0x1a7)]['name'],'journeyId':_0x156dd5[_0x19e98d(0x14c)]?.['id']};const _0x343c08=_0x156dd5[_0x19e98d(0x179)]?_0x5a3c27['folderPathToId'][_0x19e98d(0x21e)](_0x156dd5[_0x19e98d(0x179)]):undefined;_0x40ad13[_0x19e98d(0x20b)]?.({'type':_0x156dd5[_0x19e98d(0x139)]?_0x19e98d(0x1f3):_0x19e98d(0x20f),'name':_0x156dd5[_0x19e98d(0x1a7)][_0x19e98d(0x1db)]});try{const _0x5e1289=await executeSingleJourneyPush(_0x388476,_0x156dd5,{..._0x5a3c27,'segmentNameToId':_0x218b7},{'parentId':_0xb21456[_0x19e98d(0x184)],'rootFolderId':_0xb21456[_0x19e98d(0x148)],'folderId':_0x343c08,'verbose':_0xb21456['verbose']},_0x40ad13,{'journeyDefToRequest':_0x3222e9,'activationDefToCreateRequest':_0x496f37,'yamlRuleToApi':_0x5a3c55,'validateSegmentRule':_0x189660});for(const [_0x3d6ce3,_0x10b79a]of _0x5e1289['embeddedSegmentNameToId']){_0x218b7[_0x19e98d(0x1df)](_0x3d6ce3,_0x10b79a),_0x1b6c95[_0x19e98d(0x23e)][_0x19e98d(0x1df)](_0x3d6ce3,_0x10b79a);}if(_0x5e1289[_0x19e98d(0x1c4)]===_0x19e98d(0x147))_0x40ad13[_0x19e98d(0x20b)]?.({'type':'journey_created','name':_0x156dd5[_0x19e98d(0x1a7)][_0x19e98d(0x1db)],'journeyId':_0x5e1289[_0x19e98d(0x209)]}),_0x40ad13['logSuccess']?.(_0x19e98d(0x20d)+_0x156dd5['yamlConfig']['name']+'\x27'),_0x1b6c95[_0x19e98d(0x147)]++;else _0x5e1289[_0x19e98d(0x1c4)]===_0x19e98d(0x20c)&&(_0x40ad13[_0x19e98d(0x20b)]?.({'type':_0x19e98d(0x14e),'name':_0x156dd5[_0x19e98d(0x1a7)][_0x19e98d(0x1db)]}),_0x40ad13[_0x19e98d(0x226)]?.(_0x19e98d(0x1a1)+_0x156dd5[_0x19e98d(0x1a7)][_0x19e98d(0x1db)]+'\x27'),_0x1b6c95['updated']++);return{'action':_0x5e1289[_0x19e98d(0x1c4)],'name':_0x156dd5[_0x19e98d(0x1a7)][_0x19e98d(0x1db)],'journeyId':_0x5e1289[_0x19e98d(0x209)]};}catch(_0x18722f){const _0x11274f=isHttp400Error(_0x18722f),_0x46f5ff=_0x11274f?ErrorCode[_0x19e98d(0x152)]:ErrorCode[_0x19e98d(0x192)],_0x1eca04=getErrorMessage(_0x18722f);throw new SDKError(_0x46f5ff,_0x19e98d(0x1e5)+(_0x156dd5[_0x19e98d(0x139)]?'create':'update')+_0x19e98d(0x1fd)+_0x156dd5[_0x19e98d(0x169)]+_0x19e98d(0x197)+_0x1eca04,_0x18722f);}}));_0x1b6c95[_0x309c28(0x13c)][_0x309c28(0x181)](..._0x6e964a);}return _0x1b6c95;}async function matchExistingJourneySegments(_0x56cd69,_0xd4c166,_0x31b019,_0x2a00c8,_0x409afb){const _0x1161b3=a136_0x271f24;if(!_0xd4c166[_0x1161b3(0x14c)]||!_0xd4c166[_0x1161b3(0x1a7)][_0x1161b3(0x15a)])return;const _0x56b96c=new Map(),_0x1f4a18=new Set();for(const _0x17bef4 of Object[_0x1161b3(0x193)](_0xd4c166[_0x1161b3(0x1a7)][_0x1161b3(0x15a)])){const _0x49b9d4=generateDeterministicJourneySegmentName(_0xd4c166[_0x1161b3(0x1a7)][_0x1161b3(0x1db)],_0x17bef4);_0x56b96c['set'](_0x49b9d4,_0x17bef4),_0x1f4a18[_0x1161b3(0x1ed)](_0x17bef4);}const _0x4a6d00=[],_0x448b5d=collectSegmentIdsFromJourneyApi(_0xd4c166[_0x1161b3(0x14c)]);for(const _0x27fc84 of _0x448b5d){const _0x7c4196=await fetchSegment(_0x56cd69,_0x31b019,_0x27fc84,_0x2a00c8);if(!_0x7c4196?.[_0x1161b3(0x1db)])continue;const _0x98f6b3=_0x56b96c[_0x1161b3(0x21e)](_0x7c4196['name']);_0x98f6b3?(_0x409afb[_0x1161b3(0x1df)](_0x98f6b3,_0x27fc84),_0x1f4a18[_0x1161b3(0x1a8)](_0x98f6b3)):_0x4a6d00[_0x1161b3(0x181)]({'id':_0x27fc84,'seg':_0x7c4196});}if(_0x1f4a18[_0x1161b3(0x224)]>0x0&&_0x4a6d00['length']>0x0){const {localExpandedRuleToNames:_0x44b24f}=buildLocalExpandedRuleMappings(_0xd4c166['yamlConfig']),_0x206eed=new Map();for(const {id:_0x488fbb,seg:_0x37196c}of _0x4a6d00){if(_0x37196c[_0x1161b3(0x177)]){const _0x1f7673=apiRuleToYaml(_0x37196c[_0x1161b3(0x177)]);_0x206eed['set'](_0x488fbb,_0x1f7673);}}for(const {id:_0x3c7cf2,seg:_0x4bb151}of _0x4a6d00){if(!_0x4bb151[_0x1161b3(0x177)])continue;const _0x117bce=_0x206eed[_0x1161b3(0x21e)](_0x3c7cf2);if(!_0x117bce)continue;const _0x2520e8=serializeExpandedRule(_0x117bce,_0x206eed),_0x1360d3=_0x44b24f['get'](_0x2520e8);if(_0x1360d3){const _0x1a4203=_0x1360d3[_0x1161b3(0x23c)](_0x1a674f=>_0x1f4a18[_0x1161b3(0x173)](_0x1a674f));_0x1a4203&&(_0x409afb[_0x1161b3(0x1df)](_0x1a4203,_0x3c7cf2),_0x1f4a18[_0x1161b3(0x1a8)](_0x1a4203),logger[_0x1161b3(0x201)](_0x1161b3(0x1f1)+_0x4bb151[_0x1161b3(0x1db)]+_0x1161b3(0x1fb)+_0x1a4203+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x4420a0,_0x242ba8,_0x228932,_0x55633e,_0x470fef,_0x527cac){const _0x28e9a1=a136_0x271f24,{journeyDefToRequest:_0x278755,activationDefToCreateRequest:_0x5da577,yamlRuleToApi:_0x499cd2,validateSegmentRule:_0x1497ed}=_0x527cac,_0x2d6ae3=new Map(),_0x3f853f=new Map();recoverSegmentIdsFromPushRecovery(_0x242ba8,_0x2d6ae3,_0x228932[_0x28e9a1(0x13e)]);const _0x2e9b15=new Map(),_0x589df3=new Map(),_0x934547=new Map();let _0x1b01ce;const _0x301bb2=async()=>{const _0x34793d=_0x28e9a1;if(_0x1b01ce)return;_0x1b01ce=new Map();if(!_0x242ba8[_0x34793d(0x14c)])return;const _0x3261ff=await _0x4420a0[_0x34793d(0x191)][_0x34793d(0x168)](_0x242ba8['existingJourney']['id']);for(const _0x197bd8 of _0x3261ff){const _0x5dc569=journeyActivationStepToYaml(_0x197bd8,_0x228932['idToEmailMap'],_0x228932[_0x34793d(0x227)]),_0x5e674a=activationSignature(_0x5dc569);!_0x1b01ce[_0x34793d(0x173)](_0x5e674a)&&_0x1b01ce['set'](_0x5e674a,_0x197bd8['id']),_0x5dc569[_0x34793d(0x1db)]&&_0x3f853f[_0x34793d(0x1df)](_0x5dc569['name'],_0x197bd8['id']);}};await matchExistingJourneySegments(_0x4420a0,_0x242ba8,_0x55633e[_0x28e9a1(0x184)],_0x228932[_0x28e9a1(0x235)],_0x228932[_0x28e9a1(0x13e)]);const _0x59f076={'resolveSegmentId':async _0x270347=>{const _0x43717c=_0x28e9a1,_0x3f505a=_0x228932[_0x43717c(0x13e)][_0x43717c(0x21e)](_0x270347);if(!_0x3f505a)throw new SDKError(ErrorCode[_0x43717c(0x1ca)],_0x43717c(0x13b)+_0x270347+_0x43717c(0x1d6)+_0x242ba8[_0x43717c(0x1a7)][_0x43717c(0x1db)]+')');return _0x3f505a;},'resolveEmbeddedSegmentId':async(_0x10b06f,_0x3fb69e)=>{const _0x7c2e59=_0x28e9a1,_0x32fb6e=_0x228932[_0x7c2e59(0x13e)][_0x7c2e59(0x21e)](_0x10b06f);if(_0x32fb6e)return _0x32fb6e;const _0x535ab3=_0x228932['existingSegments'][_0x7c2e59(0x23c)](_0x24c0bb=>_0x24c0bb[_0x7c2e59(0x1db)]===_0x10b06f);if(_0x535ab3)return _0x228932[_0x7c2e59(0x13e)][_0x7c2e59(0x1df)](_0x10b06f,_0x535ab3['id']),_0x535ab3['id'];if(_0x242ba8[_0x7c2e59(0x139)]){const {stageName:_0x58cf77,criteriaName:_0x4adba3}=findSegmentCriteriaLocation(_0x242ba8[_0x7c2e59(0x1a7)],_0x10b06f);return _0x1497ed(_0x10b06f,_0x3fb69e[_0x7c2e59(0x177)]),_0x589df3[_0x7c2e59(0x1df)](_0x10b06f,{'definition':_0x3fb69e,'stageName':_0x58cf77,'criteriaName':_0x4adba3}),createPendingSegmentId(_0x10b06f);}const _0x1123ff=_0x242ba8[_0x7c2e59(0x14c)]?.['id'];if(!_0x1123ff)throw new SDKError(ErrorCode[_0x7c2e59(0x1d2)],_0x7c2e59(0x1c8));const _0x64b919=_0x2e9b15[_0x7c2e59(0x21e)](_0x10b06f);if(_0x64b919)return _0x64b919;const _0x2c83a3=((async()=>{const _0x51c538=_0x7c2e59;_0x1497ed(_0x10b06f,_0x3fb69e[_0x51c538(0x177)]);const _0x2e4541=generateDeterministicJourneySegmentName(_0x242ba8['yamlConfig'][_0x51c538(0x1db)],_0x10b06f),_0x26f92f=_0x228932[_0x51c538(0x235)]['find'](_0x565a1a=>_0x565a1a[_0x51c538(0x1db)]===_0x2e4541),_0xaab1af=createSegmentIdResolver(_0x228932['segmentNameToId'],_0x10b06f),_0xdac124=await resolveRuleSegmentIds(_0x3fb69e[_0x51c538(0x177)],_0xaab1af);let _0x574760;return _0x26f92f?(await _0x4420a0[_0x51c538(0x1ab)][_0x51c538(0x164)](_0x55633e[_0x51c538(0x184)],_0x26f92f['id'],{'description':_0x3fb69e[_0x51c538(0x1f7)]||_0x51c538(0x225)+_0x10b06f,'rule':_0x499cd2(_0xdac124,!![]),'countPopulation':!![]}),_0x574760=_0x26f92f['id'],saveSegmentToPushRecovery(_0x242ba8[_0x51c538(0x169)],_0x242ba8['yamlConfig'][_0x51c538(0x1db)],_0x10b06f,{'segmentId':_0x574760,'uniqueServerName':_0x2e4541,'createdAt':new Date()[_0x51c538(0x1ae)]()})):_0x574760=await createOrRecoverEmbeddedSegment(_0x4420a0,_0x242ba8,{'localName':_0x10b06f,'uniqueSegmentName':_0x2e4541,'description':_0x3fb69e[_0x51c538(0x1f7)]||_0x51c538(0x225)+_0x10b06f,'journeyId':_0x1123ff,'resolvedRule':_0xdac124,'parentId':_0x55633e['parentId'],'folderId':_0x55633e[_0x51c538(0x148)]||''},_0x499cd2),_0x228932[_0x51c538(0x13e)]['set'](_0x10b06f,_0x574760),_0x2d6ae3[_0x51c538(0x1df)](_0x10b06f,_0x574760),_0x574760;})());_0x2e9b15[_0x7c2e59(0x1df)](_0x10b06f,_0x2c83a3);try{return await _0x2c83a3;}finally{_0x2e9b15[_0x7c2e59(0x1a8)](_0x10b06f);}},'resolveActivationId':async _0x327615=>{const _0x46c1f7=_0x28e9a1,_0x156a88=_0x3f853f['get'](_0x327615);if(_0x156a88)return _0x156a88;if(_0x242ba8[_0x46c1f7(0x14c)]){await _0x301bb2();const _0x4e2620=_0x3f853f[_0x46c1f7(0x21e)](_0x327615);if(_0x4e2620)return _0x4e2620;}throw new SDKError(ErrorCode[_0x46c1f7(0x208)],_0x46c1f7(0x1cb)+_0x327615+_0x46c1f7(0x1d6)+_0x242ba8[_0x46c1f7(0x1a7)][_0x46c1f7(0x1db)]+_0x46c1f7(0x1e4)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x180865,_0x16d8f0)=>{const _0x426e09=_0x28e9a1,_0x3a5bc5=_0x3f853f[_0x426e09(0x21e)](_0x180865);if(_0x3a5bc5)return _0x3a5bc5;if(_0x242ba8['isNew'])return _0x934547[_0x426e09(0x1df)](_0x180865,_0x16d8f0),createPendingActivationId(_0x180865);if(_0x242ba8['existingJourney']){await _0x301bb2();const _0x541b07=_0x3f853f['get'](_0x16d8f0[_0x426e09(0x1db)]);if(_0x541b07)return _0x3f853f[_0x426e09(0x1df)](_0x180865,_0x541b07),_0x541b07;const _0x78dda2=activationSignature(_0x16d8f0),_0x524157=_0x1b01ce?.['get'](_0x78dda2);if(_0x524157)return _0x3f853f[_0x426e09(0x1df)](_0x180865,_0x524157),_0x524157;const _0xc2643f=await _0x5da577(_0x16d8f0,_0x228932[_0x426e09(0x229)]),_0x52d301={..._0xc2643f,..._0x16d8f0[_0x426e09(0x222)]!==undefined&&{'runAfterJourneyRefresh':_0x16d8f0['run_after_journey_refresh']}},_0x16573f=await _0x4420a0['journey']['createActivation'](_0x242ba8[_0x426e09(0x14c)]['id'],_0x52d301);return _0x3f853f[_0x426e09(0x1df)](_0x180865,_0x16573f['id']),_0x16573f['id'];}throw new SDKError(ErrorCode[_0x426e09(0x1d2)],_0x426e09(0x1bc));},'resolveJourneyId':async _0x118a4d=>{const _0x5ca3c0=_0x28e9a1;try{return await _0x4420a0[_0x5ca3c0(0x191)][_0x5ca3c0(0x1bb)](_0x55633e[_0x5ca3c0(0x184)],_0x118a4d);}catch(_0x16eec6){throw new SDKError(ErrorCode['NOT_FOUND'],_0x5ca3c0(0x21f)+_0x118a4d+_0x5ca3c0(0x18e)+_0x242ba8[_0x5ca3c0(0x1a7)][_0x5ca3c0(0x1db)]+'\x27)',_0x16eec6);}},'resolveStageId':async(_0x2da465,_0x31eded)=>{const _0x592881=_0x28e9a1,_0xaebd4e=await _0x4420a0[_0x592881(0x191)]['getJourney'](_0x2da465),_0x427bff=_0xaebd4e[_0x592881(0x1cc)]['journeyStages'][_0x592881(0x23c)](_0x3d6eab=>_0x3d6eab['name'][_0x592881(0x1b8)]()===_0x31eded[_0x592881(0x1b8)]());if(!_0x427bff?.['id'])throw new SDKError(ErrorCode[_0x592881(0x208)],'Stage\x20\x27'+_0x31eded+_0x592881(0x1d8)+(_0xaebd4e[_0x592881(0x1cc)][_0x592881(0x1fc)]||_0xaebd4e[_0x592881(0x1cc)][_0x592881(0x1db)])+'\x27');return _0x427bff['id'];}},_0x5c8f40=await _0x278755(_0x242ba8[_0x28e9a1(0x1a7)],_0x55633e[_0x28e9a1(0x184)],_0x59f076),_0x1bda9f=_0x55633e[_0x28e9a1(0x1d0)]||_0x55633e['rootFolderId'];_0x1bda9f&&(_0x5c8f40[_0x28e9a1(0x1ad)]={'parentFolder':{'data':{'id':_0x1bda9f,'type':_0x28e9a1(0x204)}}});if(_0x242ba8['isNew']){if(_0x589df3[_0x28e9a1(0x224)]>0x0||_0x934547[_0x28e9a1(0x224)]>0x0)return await executeThreeStepJourneyCreate(_0x4420a0,_0x242ba8,_0x5c8f40,{'pendingEmbeddedSegments':_0x589df3,'pendingEmbeddedActivations':_0x934547,'embeddedSegmentNameToId':_0x2d6ae3,'journeyActivationNameToId':_0x3f853f},{..._0x55633e,'effectiveFolderId':_0x1bda9f},_0x228932,_0x470fef,_0x527cac);else{ensureJourneyDefaults(_0x5c8f40['attributes']);const _0x3cd1b8=await _0x4420a0[_0x28e9a1(0x191)]['create'](_0x5c8f40);return deletePushRecovery(_0x242ba8[_0x28e9a1(0x169)]),{'action':_0x28e9a1(0x147),'journeyId':_0x3cd1b8['id'],'embeddedSegmentNameToId':_0x2d6ae3};}}else{if(_0x242ba8[_0x28e9a1(0x212)]&&_0x242ba8[_0x28e9a1(0x14c)]){_0x5c8f40['id']=_0x242ba8[_0x28e9a1(0x14c)]['id'];const _0x4f0609=_0x5c8f40[_0x28e9a1(0x1cc)];_0x242ba8[_0x28e9a1(0x14c)]['attributes']?.[_0x28e9a1(0x1fc)]&&(_0x4f0609[_0x28e9a1(0x1fc)]=_0x242ba8[_0x28e9a1(0x14c)]['attributes']['journeyBundleName']);const _0x2717b3=_0x242ba8[_0x28e9a1(0x14c)][_0x28e9a1(0x1cc)]?.['journeyStages'];return _0x2717b3&&_0x5c8f40[_0x28e9a1(0x1cc)][_0x28e9a1(0x231)]&&injectExistingStageIds(_0x5c8f40[_0x28e9a1(0x1cc)]['journeyStages'],_0x2717b3),ensureJourneyDefaults(_0x4f0609),await _0x4420a0[_0x28e9a1(0x191)][_0x28e9a1(0x175)](_0x242ba8[_0x28e9a1(0x14c)]['id'],_0x5c8f40),deletePushRecovery(_0x242ba8['absolutePath']),{'action':_0x28e9a1(0x20c),'journeyId':_0x242ba8[_0x28e9a1(0x14c)]['id'],'embeddedSegmentNameToId':_0x2d6ae3};}}return deletePushRecovery(_0x242ba8[_0x28e9a1(0x169)]),{'action':_0x28e9a1(0x233),'journeyId':_0x242ba8[_0x28e9a1(0x14c)]?.['id'],'embeddedSegmentNameToId':_0x2d6ae3};}function findSegmentCriteriaLocation(_0x39f360,_0x3e38ff){const _0x3a85f8=a136_0x271f24,_0x15a400=_0x39f360[_0x3a85f8(0x220)]||_0x39f360[_0x3a85f8(0x1ac)]?.[0x0]?.[_0x3a85f8(0x220)]||[];let _0x5f4e84=_0x3a85f8(0x202),_0x4f97f2=_0x3e38ff;const _0xfb7e8d=_0x39f360[_0x3a85f8(0x1e7)]||_0x39f360[_0x3a85f8(0x1ac)]?.[0x0]?.[_0x3a85f8(0x1e7)];if(_0xfb7e8d?.[_0x3a85f8(0x1ab)]===_0x3e38ff)return{'stageName':'goal','criteriaName':_0xfb7e8d[_0x3a85f8(0x1db)]||_0x3e38ff};_0x1b941b:for(const _0x514eaf of _0x15a400){if(_0x514eaf[_0x3a85f8(0x237)]?.[_0x3a85f8(0x1ab)]===_0x3e38ff){_0x5f4e84=_0x514eaf[_0x3a85f8(0x1db)],_0x4f97f2=_0x514eaf[_0x3a85f8(0x237)][_0x3a85f8(0x1db)]||_0x3e38ff;break;}if(_0x514eaf['steps'])for(const _0x993c74 of _0x514eaf[_0x3a85f8(0x217)]){if(_0x993c74['type']===_0x3a85f8(0x1f8)&&_0x993c74[_0x3a85f8(0x22b)]?.[_0x3a85f8(0x16c)])for(const _0x3d3f2c of _0x993c74[_0x3a85f8(0x22b)]['branches']){if(_0x3d3f2c[_0x3a85f8(0x1ab)]===_0x3e38ff){_0x5f4e84=_0x514eaf[_0x3a85f8(0x1db)],_0x4f97f2=_0x3d3f2c[_0x3a85f8(0x1db)]||_0x3e38ff;break _0x1b941b;}}}}return{'stageName':_0x5f4e84,'criteriaName':_0x4f97f2};}async function executeThreeStepJourneyCreate(_0x2d767f,_0x3129f7,_0x32303b,_0xdb3e02,_0x2c890c,_0x326298,_0x3a86a3,_0x93f5f9){const _0x4194ac=a136_0x271f24,{activationDefToCreateRequest:_0x3efba5,yamlRuleToApi:_0x36ac8f}=_0x93f5f9,{pendingEmbeddedSegments:_0x18445a,pendingEmbeddedActivations:_0x26de51,embeddedSegmentNameToId:_0x4dfcfd}=_0xdb3e02,_0x5a928b=JSON['parse'](JSON[_0x4194ac(0x1d9)](_0x32303b));ensureJourneyDefaults(_0x5a928b[_0x4194ac(0x1cc)]),stripPendingIds(_0x5a928b);const _0x5989df=await _0x2d767f[_0x4194ac(0x191)][_0x4194ac(0x1be)](_0x5a928b),_0x2e11c0=_0x5989df['id'],_0x3dd346=new Map();for(const _0x41f0e8 of _0x5989df[_0x4194ac(0x1cc)][_0x4194ac(0x231)]){_0x3dd346[_0x4194ac(0x1df)](_0x41f0e8['name'][_0x4194ac(0x1b8)](),_0x41f0e8['id']);}recoverSegmentIdsFromPushRecovery(_0x3129f7,_0x4dfcfd,_0x326298[_0x4194ac(0x13e)]);for(const [_0x1bc1f2,{definition:_0x5c03b9}]of _0x18445a){if(_0x4dfcfd[_0x4194ac(0x173)](_0x1bc1f2)){_0x3a86a3[_0x4194ac(0x20b)]?.({'type':'embedded_segment_created','journeyName':_0x3129f7[_0x4194ac(0x1a7)][_0x4194ac(0x1db)],'segmentName':_0x1bc1f2});continue;}const _0x152097=generateDeterministicJourneySegmentName(_0x3129f7[_0x4194ac(0x1a7)][_0x4194ac(0x1db)],_0x1bc1f2);_0x3a86a3['onProgress']?.({'type':_0x4194ac(0x1a6),'journeyName':_0x3129f7['yamlConfig']['name'],'segmentName':_0x1bc1f2});const _0x25f023=createSegmentIdResolver(_0x326298[_0x4194ac(0x13e)],_0x1bc1f2),_0x94551f=await resolveRuleSegmentIds(_0x5c03b9[_0x4194ac(0x177)],_0x25f023),_0x14265e=await createOrRecoverEmbeddedSegment(_0x2d767f,_0x3129f7,{'localName':_0x1bc1f2,'uniqueSegmentName':_0x152097,'description':_0x5c03b9['description']||'Entry\x20criteria:\x20'+_0x1bc1f2,'journeyId':_0x2e11c0,'resolvedRule':_0x94551f,'parentId':_0x2c890c[_0x4194ac(0x184)],'folderId':_0x2c890c[_0x4194ac(0x189)]||''},_0x36ac8f);_0x4dfcfd[_0x4194ac(0x1df)](_0x1bc1f2,_0x14265e),_0x326298['segmentNameToId'][_0x4194ac(0x1df)](_0x1bc1f2,_0x14265e),_0x3a86a3[_0x4194ac(0x20b)]?.({'type':_0x4194ac(0x165),'journeyName':_0x3129f7[_0x4194ac(0x1a7)][_0x4194ac(0x1db)],'segmentName':_0x1bc1f2});}const _0x56b3f1=new Map();for(const [_0x560ea1,_0x222bb0]of _0x26de51){_0x3a86a3['onProgress']?.({'type':_0x4194ac(0x22c),'journeyName':_0x3129f7['yamlConfig'][_0x4194ac(0x1db)],'activationName':_0x560ea1});const _0x1621ec=await _0x3efba5(_0x222bb0,_0x326298[_0x4194ac(0x229)]),_0x2b718b={..._0x1621ec,..._0x222bb0[_0x4194ac(0x222)]!==undefined&&{'runAfterJourneyRefresh':_0x222bb0[_0x4194ac(0x222)]}},_0x37d44a=await _0x2d767f[_0x4194ac(0x191)]['createActivation'](_0x2e11c0,_0x2b718b);_0x56b3f1[_0x4194ac(0x1df)](_0x560ea1,_0x37d44a['id']),_0xdb3e02['journeyActivationNameToId'][_0x4194ac(0x1df)](_0x560ea1,_0x37d44a['id']),_0x3a86a3[_0x4194ac(0x20b)]?.({'type':_0x4194ac(0x143),'journeyName':_0x3129f7[_0x4194ac(0x1a7)][_0x4194ac(0x1db)],'activationName':_0x560ea1});}const _0x357fa5=JSON[_0x4194ac(0x187)](JSON[_0x4194ac(0x1d9)](_0x32303b));return _0x357fa5['id']=_0x2e11c0,ensureJourneyDefaults(_0x357fa5[_0x4194ac(0x1cc)]),resolvePendingIdsInRequest(_0x357fa5,_0x32303b,_0x3dd346,_0x4dfcfd,_0x56b3f1,_0x3a86a3),await _0x2d767f['journey'][_0x4194ac(0x175)](_0x2e11c0,_0x357fa5),deletePushRecovery(_0x3129f7[_0x4194ac(0x169)]),{'action':_0x4194ac(0x147),'journeyId':_0x2e11c0,'embeddedSegmentNameToId':_0x4dfcfd};}export function stripWaitStepPendingIds(_0x525825){const _0x2e530c=a136_0x271f24,_0x3d1fd6=_0x525825[_0x2e530c(0x159)]&&isPendingSegmentId(_0x525825[_0x2e530c(0x159)]),_0x116e38=_0x525825['conditions']?.['some'](_0x116ab0=>_0x116ab0[_0x2e530c(0x20e)]&&isPendingSegmentId(_0x116ab0[_0x2e530c(0x20e)]));(_0x3d1fd6||_0x116e38)&&(_0x525825[_0x2e530c(0x221)]=_0x2e530c(0x20a),_0x525825[_0x2e530c(0x1d4)]=0x1,_0x525825[_0x2e530c(0x19f)]=_0x2e530c(0x19a),delete _0x525825[_0x2e530c(0x159)],delete _0x525825[_0x2e530c(0x19e)],delete _0x525825[_0x2e530c(0x1bd)],delete _0x525825['conditions']);}export function resolveWaitStepPendingIds(_0x2b8874,_0x34b045,_0x35e4c4,_0x2ced78){const _0x2ed316=a136_0x271f24;if(_0x34b045[_0x2ed316(0x159)]&&isPendingSegmentId(_0x34b045['conditionSegmentId'])){const _0xdc3df2=_0x35e4c4(_0x34b045[_0x2ed316(0x159)],_0x2ed316(0x1f2)+_0x2ced78+'\x27\x20wait\x20condition');_0xdc3df2&&(_0x2b8874[_0x2ed316(0x221)]='Condition',_0x2b8874[_0x2ed316(0x159)]=_0xdc3df2,delete _0x2b8874[_0x2ed316(0x1d4)],delete _0x2b8874[_0x2ed316(0x19f)],_0x34b045['conditionTimeoutDuration']!==undefined&&(_0x2b8874[_0x2ed316(0x19e)]=_0x34b045[_0x2ed316(0x19e)]),_0x34b045[_0x2ed316(0x1bd)]&&(_0x2b8874['conditionTimeoutUnit']=_0x34b045[_0x2ed316(0x1bd)]));}if(_0x34b045['conditions']){const _0xa4193f=_0x34b045[_0x2ed316(0x161)][_0x2ed316(0x16a)](_0x24c3f5=>_0x24c3f5[_0x2ed316(0x20e)]&&isPendingSegmentId(_0x24c3f5[_0x2ed316(0x20e)]));if(_0xa4193f){const _0xe5e574=_0x34b045[_0x2ed316(0x161)]['map'](_0x522739=>{const _0x1dade9=_0x2ed316;if(_0x522739[_0x1dade9(0x20e)]&&isPendingSegmentId(_0x522739['segmentId'])){const _0x391cc5=_0x35e4c4(_0x522739[_0x1dade9(0x20e)],_0x1dade9(0x1f2)+_0x2ced78+_0x1dade9(0x1a3));return{..._0x522739,'segmentId':_0x391cc5||_0x522739[_0x1dade9(0x20e)]};}return{..._0x522739};});_0x2b8874[_0x2ed316(0x221)]=_0x2ed316(0x1f6),_0x2b8874[_0x2ed316(0x161)]=_0xe5e574,delete _0x2b8874[_0x2ed316(0x1d4)],delete _0x2b8874['waitStepUnit'],delete _0x2b8874[_0x2ed316(0x159)],delete _0x2b8874[_0x2ed316(0x19e)],delete _0x2b8874['conditionTimeoutUnit'];}}}function stripPendingIds(_0x4b65be){const _0x12423f=a136_0x271f24;_0x4b65be['attributes'][_0x12423f(0x1e7)]?.[_0x12423f(0x20e)]&&isPendingSegmentId(_0x4b65be[_0x12423f(0x1cc)]['goal'][_0x12423f(0x20e)])&&delete _0x4b65be[_0x12423f(0x1cc)][_0x12423f(0x1e7)];for(const _0x3bf5ff of _0x4b65be[_0x12423f(0x1cc)][_0x12423f(0x231)]||[]){_0x3bf5ff['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x3bf5ff[_0x12423f(0x205)]['segmentId'])&&delete _0x3bf5ff['entryCriteria'];_0x3bf5ff[_0x12423f(0x158)]?.[_0x12423f(0x20e)]&&isPendingSegmentId(_0x3bf5ff[_0x12423f(0x158)][_0x12423f(0x20e)])&&delete _0x3bf5ff[_0x12423f(0x158)];_0x3bf5ff[_0x12423f(0x1fe)]&&(_0x3bf5ff[_0x12423f(0x1fe)]=_0x3bf5ff[_0x12423f(0x1fe)][_0x12423f(0x180)](_0x698139=>!_0x698139[_0x12423f(0x20e)]||!isPendingSegmentId(_0x698139[_0x12423f(0x20e)])));if(_0x3bf5ff['steps'])for(const _0x3be6ed of Object[_0x12423f(0x193)](_0x3bf5ff[_0x12423f(0x217)])){const _0x28acc7=_0x3bf5ff['steps'][_0x3be6ed];_0x28acc7[_0x12423f(0x1f0)]===_0x12423f(0x140)&&_0x28acc7['journeyActivationStepId']&&isPendingActivationId(_0x28acc7[_0x12423f(0x146)])&&(_0x28acc7['journeyActivationStepId']='');if(_0x28acc7[_0x12423f(0x1f0)]==='DecisionPoint'&&_0x28acc7[_0x12423f(0x16c)])for(const _0xa1511e of _0x28acc7[_0x12423f(0x16c)]){_0xa1511e[_0x12423f(0x20e)]&&isPendingSegmentId(_0xa1511e[_0x12423f(0x20e)])&&(_0xa1511e[_0x12423f(0x20e)]='');}_0x28acc7[_0x12423f(0x1f0)]===_0x12423f(0x218)&&stripWaitStepPendingIds(_0x28acc7);}}}function resolvePendingIdsInRequest(_0x541bc8,_0x25d3b6,_0x344fab,_0x4de6de,_0x10776c,_0x538723){const _0x2b692e=a136_0x271f24,_0x407b00=(_0x274827,_0x187c8a)=>{const _0x2e030f=a136_0x2eaf;if(!isPendingSegmentId(_0x274827))return _0x274827;const _0x3292be=extractPendingSegmentName(_0x274827),_0x2c97c7=_0x4de6de[_0x2e030f(0x21e)](_0x3292be);return!_0x2c97c7&&_0x538723[_0x2e030f(0x14b)]?.(_0x2e030f(0x188)+_0x3292be+_0x2e030f(0x1b7)+_0x187c8a),_0x2c97c7;};if(_0x541bc8[_0x2b692e(0x1cc)][_0x2b692e(0x1e7)]?.[_0x2b692e(0x20e)]&&isPendingSegmentId(_0x541bc8[_0x2b692e(0x1cc)]['goal'][_0x2b692e(0x20e)])){const _0x465fa0=_0x407b00(_0x541bc8[_0x2b692e(0x1cc)][_0x2b692e(0x1e7)][_0x2b692e(0x20e)],_0x2b692e(0x167));_0x465fa0&&(_0x541bc8[_0x2b692e(0x1cc)][_0x2b692e(0x1e7)]['segmentId']=_0x465fa0);}for(const _0x55ccf2 of _0x541bc8[_0x2b692e(0x1cc)][_0x2b692e(0x231)]||[]){const _0x11a92a=_0x344fab['get'](_0x55ccf2[_0x2b692e(0x1db)]['toLowerCase']());_0x11a92a&&(_0x55ccf2['id']=_0x11a92a);if(_0x55ccf2[_0x2b692e(0x205)]?.[_0x2b692e(0x20e)]&&isPendingSegmentId(_0x55ccf2[_0x2b692e(0x205)][_0x2b692e(0x20e)])){const _0x311b79=_0x407b00(_0x55ccf2[_0x2b692e(0x205)]['segmentId'],_0x2b692e(0x1f2)+_0x55ccf2[_0x2b692e(0x1db)]+_0x2b692e(0x157));_0x311b79&&(_0x55ccf2[_0x2b692e(0x205)][_0x2b692e(0x20e)]=_0x311b79);}if(_0x55ccf2[_0x2b692e(0x1fe)])for(const _0x43347c of _0x55ccf2[_0x2b692e(0x1fe)]){if(_0x43347c[_0x2b692e(0x20e)]&&isPendingSegmentId(_0x43347c[_0x2b692e(0x20e)])){const _0x1083e9=_0x407b00(_0x43347c[_0x2b692e(0x20e)],_0x2b692e(0x1f2)+_0x55ccf2['name']+_0x2b692e(0x17d));_0x1083e9&&(_0x43347c['segmentId']=_0x1083e9);}}if(_0x55ccf2[_0x2b692e(0x158)]?.[_0x2b692e(0x20e)]&&isPendingSegmentId(_0x55ccf2[_0x2b692e(0x158)][_0x2b692e(0x20e)])){const _0x5d90d8=_0x407b00(_0x55ccf2[_0x2b692e(0x158)][_0x2b692e(0x20e)],_0x2b692e(0x1f2)+_0x55ccf2['name']+_0x2b692e(0x18b));_0x5d90d8&&(_0x55ccf2[_0x2b692e(0x158)][_0x2b692e(0x20e)]=_0x5d90d8);}if(_0x55ccf2['steps']){const _0x2b5d67=_0x51d1ae=>_0x25d3b6[_0x2b692e(0x1cc)]['journeyStages']?.['find'](_0x479ec0=>_0x479ec0[_0x2b692e(0x1db)][_0x2b692e(0x1b8)]()===_0x55ccf2['name'][_0x2b692e(0x1b8)]())?.[_0x2b692e(0x217)]?.[_0x51d1ae];for(const _0x32441b of Object['keys'](_0x55ccf2[_0x2b692e(0x217)])){const _0x18bbbc=_0x55ccf2[_0x2b692e(0x217)][_0x32441b],_0x549a01=_0x2b5d67(_0x32441b);if(_0x18bbbc[_0x2b692e(0x1f0)]==='Activation'&&_0x18bbbc[_0x2b692e(0x146)]&&(isPendingActivationId(_0x18bbbc[_0x2b692e(0x146)])||_0x18bbbc['journeyActivationStepId']==='')){if(_0x549a01?.['journeyActivationStepId']&&isPendingActivationId(_0x549a01[_0x2b692e(0x146)])){const _0x1f602d=extractPendingActivationName(_0x549a01['journeyActivationStepId']),_0x46c251=_0x10776c[_0x2b692e(0x21e)](_0x1f602d);_0x46c251&&(_0x18bbbc[_0x2b692e(0x146)]=_0x46c251);}}if(_0x18bbbc[_0x2b692e(0x1f0)]===_0x2b692e(0x16f)&&_0x18bbbc[_0x2b692e(0x16c)]&&_0x549a01?.[_0x2b692e(0x16c)])for(let _0xb6eb3c=0x0;_0xb6eb3c<_0x18bbbc[_0x2b692e(0x16c)]['length'];_0xb6eb3c++){const _0x2bcffc=_0x18bbbc['branches'][_0xb6eb3c],_0x215700=_0x549a01[_0x2b692e(0x16c)][_0xb6eb3c];if(_0x215700?.[_0x2b692e(0x20e)]&&isPendingSegmentId(_0x215700['segmentId'])){const _0x5058c2=_0x407b00(_0x215700['segmentId'],_0x2b692e(0x1f2)+_0x55ccf2[_0x2b692e(0x1db)]+_0x2b692e(0x1aa)+(_0x2bcffc['name']||_0xb6eb3c)+'\x27');_0x5058c2&&(_0x2bcffc[_0x2b692e(0x20e)]=_0x5058c2);}}_0x18bbbc[_0x2b692e(0x1f0)]===_0x2b692e(0x218)&&_0x549a01?.[_0x2b692e(0x1f0)]==='WaitStep'&&resolveWaitStepPendingIds(_0x18bbbc,_0x549a01,_0x407b00,_0x55ccf2[_0x2b692e(0x1db)]);}}}}
1
+ const a136_0x357cba=a136_0x1e1e;(function(_0x2139af,_0xbca997){const _0x4538ff=a136_0x1e1e,_0x25c650=_0x2139af();while(!![]){try{const _0x29997a=-parseInt(_0x4538ff(0x1f8))/0x1*(parseInt(_0x4538ff(0x2cf))/0x2)+parseInt(_0x4538ff(0x2f1))/0x3+parseInt(_0x4538ff(0x21f))/0x4+parseInt(_0x4538ff(0x1fb))/0x5+-parseInt(_0x4538ff(0x26c))/0x6+parseInt(_0x4538ff(0x2bd))/0x7*(parseInt(_0x4538ff(0x2ef))/0x8)+parseInt(_0x4538ff(0x254))/0x9*(-parseInt(_0x4538ff(0x293))/0xa);if(_0x29997a===_0xbca997)break;else _0x25c650['push'](_0x25c650['shift']());}catch(_0xdbe66c){_0x25c650['push'](_0x25c650['shift']());}}}(a136_0x3ed0,0x5b60e));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a136_0x357cba(0x29a));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a136_0x357cba(0x272);export function createPendingSegmentId(_0x4a307e){return''+PENDING_SEGMENT_PREFIX+_0x4a307e+'__';}export function isPendingSegmentId(_0x45f7ec){return _0x45f7ec['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x45f7ec['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x37b228){const _0x13180d=a136_0x357cba;return _0x37b228[_0x13180d(0x210)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x23a617){return''+PENDING_ACTIVATION_PREFIX+_0x23a617+'__';}export function isPendingActivationId(_0x1b99a9){const _0x4ef38f=a136_0x357cba;return _0x1b99a9[_0x4ef38f(0x204)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x241860){const _0x5050e2=a136_0x357cba;return _0x241860[_0x5050e2(0x210)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x42a0e3,_0x38ee68){const _0x5f0edf=a136_0x357cba,_0x3d0cf9=_0x42a0e3+'::'+(_0x38ee68[_0x5f0edf(0x223)]()||_0x5f0edf(0x27c)),_0x5d505a=createHash(_0x5f0edf(0x29c))['update'](_0x3d0cf9)['digest']('hex')[_0x5f0edf(0x29b)](0x0,0xc);return _0x5f0edf(0x222)+_0x5d505a;}export function ensureJourneyDefaults(_0x4524df){const _0x41d26c=a136_0x357cba;!_0x4524df[_0x41d26c(0x2a7)]&&(_0x4524df['description']=''),!_0x4524df[_0x41d26c(0x27e)]&&(_0x4524df['state']=_0x41d26c(0x28f));}export function injectExistingStageIds(_0x49130e,_0x1bed38){const _0x5c69c4=a136_0x357cba,_0x18a934=new Map(_0x1bed38[_0x5c69c4(0x2d4)](_0x322caa=>[_0x322caa[_0x5c69c4(0x2e8)],_0x322caa['id']]));for(const _0x5a066c of _0x49130e){if(!_0x5a066c['id']){const _0x117833=_0x18a934[_0x5c69c4(0x20a)](_0x5a066c[_0x5c69c4(0x2e8)]);_0x117833&&(_0x5a066c['id']=_0x117833);}}}export function resolveTDFolderPath(_0x542fe7,_0x1f2287,_0x3d4b1d){if(!_0x1f2287)return _0x542fe7;if(_0x542fe7===_0x3d4b1d||_0x542fe7['startsWith'](_0x3d4b1d+'/'))return _0x542fe7;return _0x542fe7?_0x3d4b1d+'/'+_0x542fe7:_0x3d4b1d;}export function addFoldersToCreate(_0x271e11,_0x167973,_0x333ec8){const _0x1c5c0d=a136_0x357cba;if(!_0x271e11)return;if(_0x167973['has'](_0x271e11))return;const _0x2554e7=_0x271e11[_0x1c5c0d(0x206)]('/');let _0x132d56='';for(const _0x2d0a91 of _0x2554e7){_0x132d56=_0x132d56?_0x132d56+'/'+_0x2d0a91:_0x2d0a91,!_0x167973[_0x1c5c0d(0x1f4)](_0x132d56)&&_0x333ec8['add'](_0x132d56);}}export function sortFoldersByDepth(_0x92e148){return[..._0x92e148]['sort']((_0x268490,_0x354809)=>{const _0x313826=a136_0x1e1e,_0x3c9869=(_0x268490[_0x313826(0x2ea)](/\//g)||[])[_0x313826(0x2b3)],_0xf3c4fe=(_0x354809[_0x313826(0x2ea)](/\//g)||[])['length'];return _0x3c9869-_0xf3c4fe;});}import*as a136_0xa17e00 from'yaml';import{readFileSync}from'fs';import a136_0x8d255f from'path';import{isJourneyDef,parseYamlString as a136_0x35b9fb,toYamlString as a136_0x4d3ac1,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 a136_0x1e1e(_0x56647a,_0x5db192){_0x56647a=_0x56647a-0x1f4;const _0x3ed0f8=a136_0x3ed0();let _0x1e1ef7=_0x3ed0f8[_0x56647a];return _0x1e1ef7;}import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x6c5f29){const _0x412cec=a136_0x357cba;if(Array['isArray'](_0x6c5f29))return'['+_0x6c5f29[_0x412cec(0x2d4)](_0x5cbfde=>stableStringify(_0x5cbfde))[_0x412cec(0x290)](',')+']';if(_0x6c5f29&&typeof _0x6c5f29===_0x412cec(0x217)){const _0x59d405=_0x6c5f29,_0xda26aa=Object[_0x412cec(0x212)](_0x59d405)[_0x412cec(0x2dc)](),_0x3c7fe4=_0xda26aa[_0x412cec(0x2d4)](_0x5229a3=>'\x22'+_0x5229a3+'\x22:'+stableStringify(_0x59d405[_0x5229a3]));return'{'+_0x3c7fe4['join'](',')+'}';}const _0x352659=JSON['stringify'](_0x6c5f29);return _0x352659===undefined?'null':_0x352659;}function activationSignature(_0x227c69){const _0x226ade=a136_0x357cba,_0x3a423f={'connection':_0x227c69['connection'],..._0x227c69[_0x226ade(0x20e)]!==undefined&&{'all_columns':_0x227c69[_0x226ade(0x20e)]},..._0x227c69[_0x226ade(0x26a)]!==undefined&&{'columns':_0x227c69[_0x226ade(0x26a)]},..._0x227c69['behavior']!==undefined&&{'behavior':_0x227c69[_0x226ade(0x2ee)]},..._0x227c69[_0x226ade(0x29e)]!==undefined&&{'schedule':_0x227c69[_0x226ade(0x29e)]},..._0x227c69[_0x226ade(0x238)]!==undefined&&{'notification':_0x227c69['notification']},..._0x227c69[_0x226ade(0x202)]!==undefined&&{'connector_config':_0x227c69[_0x226ade(0x202)]},..._0x227c69[_0x226ade(0x22a)]!==undefined&&{'activation_template_id':_0x227c69[_0x226ade(0x22a)]}};return stableStringify(_0x3a423f);}async function fetchSegment(_0x4df899,_0x2a8e1b,_0x4bb5d1,_0x9b58cc){const _0x9b2042=a136_0x357cba,_0x2e0b5e=_0x9b58cc?.[_0x9b2042(0x280)](_0x1346cd=>_0x1346cd['id']===_0x4bb5d1);if(_0x2e0b5e)return _0x2e0b5e;try{return await _0x4df899[_0x9b2042(0x27c)]['getSegment'](_0x2a8e1b,_0x4bb5d1);}catch(_0x2daeeb){logger[_0x9b2042(0x2d3)](_0x9b2042(0x2d7)+_0x4bb5d1+_0x9b2042(0x1f6)+_0x2daeeb);try{return await _0x4df899[_0x9b2042(0x27c)][_0x9b2042(0x215)](_0x4bb5d1);}catch(_0x4a5094){return logger['debug'](_0x9b2042(0x268)+_0x4bb5d1+':\x20'+_0x4a5094),null;}}}function recoverSegmentIdsFromPushRecovery(_0x2ca3fe,_0x2dafc1,_0x13904f){const _0x26ad07=a136_0x357cba,_0x117ba4=readPushRecovery(_0x2ca3fe[_0x26ad07(0x2b5)]);if(_0x117ba4?.[_0x26ad07(0x2ba)]===_0x2ca3fe[_0x26ad07(0x276)][_0x26ad07(0x2e8)])for(const [_0xc46d99,_0x32b77f]of Object[_0x26ad07(0x255)](_0x117ba4[_0x26ad07(0x284)])){const _0x46dd8d=generateDeterministicJourneySegmentName(_0x2ca3fe[_0x26ad07(0x276)][_0x26ad07(0x2e8)],_0xc46d99);_0x32b77f['uniqueServerName']===_0x46dd8d&&(_0x2dafc1[_0x26ad07(0x278)](_0xc46d99,_0x32b77f['segmentId']),_0x13904f[_0x26ad07(0x278)](_0xc46d99,_0x32b77f[_0x26ad07(0x235)]));}}async function createOrRecoverEmbeddedSegment(_0x528464,_0xeae038,_0x51c8be,_0x49ac3a){const _0x4ee978=a136_0x357cba;let _0x4f2f8e;try{_0x4f2f8e=await _0x528464[_0x4ee978(0x27c)][_0x4ee978(0x2ca)]({'name':_0x51c8be[_0x4ee978(0x295)],'description':_0x51c8be['description'],'journeyId':_0x51c8be['journeyId'],'rule':_0x49ac3a(_0x51c8be[_0x4ee978(0x25d)],!![]),'countPopulation':!![],'parentFolderId':_0x51c8be[_0x4ee978(0x279)],'audienceId':_0x51c8be[_0x4ee978(0x25f)]});}catch(_0x5d3d60){const _0x1620d5=_0x5d3d60 instanceof Error&&_0x5d3d60['message']['includes']('Name\x20has\x20already\x20been\x20taken');if(_0x1620d5){const _0x3cb2f7=readPushRecovery(_0xeae038['absolutePath']),_0x1d505b=_0x3cb2f7?.[_0x4ee978(0x2ba)]===_0xeae038['yamlConfig'][_0x4ee978(0x2e8)]?_0x3cb2f7[_0x4ee978(0x284)][_0x51c8be['localName']]:undefined;if(_0x1d505b?.[_0x4ee978(0x299)]===_0x51c8be[_0x4ee978(0x295)])await _0x528464['segment']['updateSegmentById'](_0x51c8be[_0x4ee978(0x25f)],_0x1d505b[_0x4ee978(0x235)],{'description':_0x51c8be[_0x4ee978(0x2a7)],'rule':_0x49ac3a(_0x51c8be[_0x4ee978(0x25d)],!![]),'countPopulation':!![]}),_0x4f2f8e=_0x1d505b['segmentId'];else throw new SDKError(ErrorCode[_0x4ee978(0x1f7)],'Embedded\x20segment\x20\x27'+_0x51c8be['localName']+_0x4ee978(0x21d)+(_0x4ee978(0x24b)+_0xeae038['absolutePath'][_0x4ee978(0x210)](/([^/]+)$/,_0x4ee978(0x240))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x5d3d60);}else throw _0x5d3d60;}return saveSegmentToPushRecovery(_0xeae038['absolutePath'],_0xeae038['yamlConfig'][_0x4ee978(0x2e8)],_0x51c8be['localName'],{'segmentId':_0x4f2f8e,'uniqueServerName':_0x51c8be['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x4f2f8e;}export async function prepareSegmentFiles(_0x45567d,_0x2fd2fa,_0x113dae,_0x499e2a,_0xac32e2){const _0x19be47=a136_0x357cba,{activationDefToCreateRequest:_0x1e03bd}=await import(_0x19be47(0x227)),_0x52af62=[],_0x545330=new Set();for(const {yamlConfig:_0x31c0a9,folderPath:_0x1d4ffe,sourcePath:_0x9bd085}of _0x45567d){const _0x9fd523=resolveTDFolderPath(_0x1d4ffe,_0x499e2a,_0xac32e2),_0x19996a=_0x9fd523+':'+_0x31c0a9['name'],_0x112bca=_0x2fd2fa[_0x19be47(0x270)]['get'](_0x19996a),_0x11dcde=_0x112bca?_0x2fd2fa[_0x19be47(0x2dd)][_0x19be47(0x20a)](_0x112bca['id'])||[]:[];addFoldersToCreate(_0x9fd523,_0x2fd2fa[_0x19be47(0x25c)],_0x545330);const _0x4db40c=calculateActivationActions(_0x31c0a9[_0x19be47(0x1f5)]||[],_0x11dcde,_0x2fd2fa[_0x19be47(0x1fe)],_0x2fd2fa[_0x19be47(0x241)]);for(const _0xdd6d53 of _0x4db40c){(_0xdd6d53[_0x19be47(0x22e)]===_0x19be47(0x277)||_0xdd6d53[_0x19be47(0x22e)]==='update')&&_0xdd6d53[_0x19be47(0x213)]&&(_0xdd6d53['validatedRequest']=await _0x1e03bd(_0xdd6d53[_0x19be47(0x213)],_0x113dae));}const _0x58ddef=calculateSegmentDiff(_0x31c0a9,_0x112bca,_0x11dcde,_0x2fd2fa[_0x19be47(0x1fe)],_0x2fd2fa[_0x19be47(0x241)]);_0x52af62[_0x19be47(0x2b9)]({'relativePath':_0x31c0a9[_0x19be47(0x2e8)],'absolutePath':_0x9bd085,'yamlConfig':_0x31c0a9,'folderPath':_0x9fd523,'existingSegment':_0x112bca,'existingActivations':_0x11dcde,'isNew':_0x58ddef[_0x19be47(0x232)],'hasChanges':_0x58ddef[_0x19be47(0x2ab)],'diff':_0x58ddef[_0x19be47(0x2da)],'activationActions':_0x4db40c});}return{'segmentFiles':_0x52af62,'foldersToCreate':_0x545330};}export async function prepareJourneyFiles(_0x5def8f,_0x539ec4,_0x2c395f,_0x446700){const _0x1cd45f=a136_0x357cba,_0x3d70f3=[],_0x443e22=new Set();for(const {yamlConfig:_0x200d5d,folderPath:_0x274d73,sourcePath:_0x192b7c}of _0x5def8f){const _0x1a17ba=resolveTDFolderPath(_0x274d73,_0x2c395f,_0x446700),_0x5f1a8c=_0x1a17ba+':'+_0x200d5d[_0x1cd45f(0x2e8)],_0x48473=_0x539ec4['journeyBundlesByFolderAndName']['get'](_0x5f1a8c);let _0x51119c,_0x12cbd4;if(_0x48473&&_0x48473[_0x1cd45f(0x2b3)]>0x0){const _0x282000=buildLocalExpandedRuleMappings(_0x200d5d),{createYamlContext:_0x8c8bf,prefetchJourneySegments:_0x15f2d1}=createPushYamlContextForBundle(_0x539ec4[_0x1cd45f(0x2f3)],_0x539ec4['parentId'],_0x539ec4[_0x1cd45f(0x2d8)],_0x282000,_0x539ec4['idToEmailMap'],_0x539ec4[_0x1cd45f(0x241)],_0x539ec4[_0x1cd45f(0x23e)],_0x539ec4[_0x1cd45f(0x2ce)]);await _0x15f2d1(_0x48473[_0x1cd45f(0x2d4)](_0x4bce97=>_0x4bce97['id']));const _0x43ee03=await _0x539ec4[_0x1cd45f(0x2f3)][_0x1cd45f(0x22d)][_0x1cd45f(0x2ec)](_0x48473[0x0][_0x1cd45f(0x205)]),_0x46ac00=hasMultipleVersions(_0x200d5d),_0x398bac=async _0x5e33ad=>{const _0x472c7a=_0x1cd45f,_0x12fa7d=_0x539ec4[_0x472c7a(0x2ce)]?.[_0x472c7a(0x20a)](_0x5e33ad);if(_0x12fa7d)return _0x12fa7d;return _0x539ec4[_0x472c7a(0x24c)]({'journeyId':_0x5e33ad,'journeyName':_0x200d5d[_0x472c7a(0x2e8)],'isMultiVersion':_0x48473[_0x472c7a(0x2b3)]>0x1});};if(_0x46ac00&&_0x48473['length']>0x1){const _0x36a04b=[];for(const _0x3f9b08 of _0x48473){const _0x26e21d=_0x3f9b08[_0x1cd45f(0x2ac)]||0x1;_0x539ec4[_0x1cd45f(0x2a6)]?.[_0x1cd45f(0x23d)](_0x1cd45f(0x2c2)+_0x200d5d[_0x1cd45f(0x2e8)]+'\x20v'+_0x26e21d);const _0x4808a5=await _0x398bac(_0x3f9b08['id']),_0x99964a=_0x8c8bf(_0x3f9b08['id']),_0x17eae0=await journeyResponseToDef(_0x4808a5,_0x99964a);_0x36a04b[_0x1cd45f(0x2b9)]({'item':_0x3f9b08,'yaml':_0x17eae0});}const _0x5b1eaa=buildLocalRuleToNameMappingFromJourney(_0x200d5d);_0x12cbd4=buildMergedJourneyDef(_0x36a04b,_0x5b1eaa,_0x43ee03);const _0x3f9d7e=Math[_0x1cd45f(0x1ff)](..._0x36a04b[_0x1cd45f(0x2d4)](_0x44eb10=>_0x44eb10[_0x1cd45f(0x2f4)]['versionNumber']||0x0)),_0x47925d=_0x48473['find'](_0x3e4c83=>(_0x3e4c83[_0x1cd45f(0x2ac)]||0x0)===_0x3f9d7e);_0x47925d&&(_0x539ec4[_0x1cd45f(0x2a6)]?.[_0x1cd45f(0x23d)]('Fetching\x20'+_0x200d5d[_0x1cd45f(0x2e8)]+'\x20v'+_0x3f9d7e),_0x51119c=await _0x398bac(_0x47925d['id']));}else{const _0x37b454=_0x48473[_0x48473[_0x1cd45f(0x2b3)]-0x1];_0x539ec4[_0x1cd45f(0x2a6)]?.[_0x1cd45f(0x23d)](_0x1cd45f(0x2c2)+_0x200d5d[_0x1cd45f(0x2e8)]),_0x51119c=await _0x398bac(_0x37b454['id']);const _0x219dcb=_0x8c8bf(_0x37b454['id']),_0x3435c5=await journeyResponseToDef(_0x51119c,_0x219dcb),_0xa55eda=buildLocalRuleToNameMappingFromJourney(_0x200d5d);_0x12cbd4=buildMergedJourneyDef([{'item':_0x37b454,'yaml':_0x3435c5}],_0xa55eda,_0x43ee03);}}addFoldersToCreate(_0x1a17ba,_0x539ec4[_0x1cd45f(0x25c)],_0x443e22);const _0x59a34c=calculateJourneyDiff(_0x200d5d,_0x12cbd4);_0x3d70f3[_0x1cd45f(0x2b9)]({'relativePath':_0x200d5d[_0x1cd45f(0x2e8)],'absolutePath':_0x192b7c,'yamlConfig':_0x200d5d,'folderPath':_0x1a17ba,'existingJourney':_0x51119c,'isNew':_0x59a34c[_0x1cd45f(0x232)],'hasChanges':_0x59a34c[_0x1cd45f(0x2ab)],'diff':_0x59a34c[_0x1cd45f(0x2da)]});}return{'journeyFiles':_0x3d70f3,'foldersToCreate':_0x443e22};}export function calculateActivationActions(_0x1b9881,_0x25c8f8,_0x1a3b78,_0x146012){const _0x4a1262=a136_0x357cba,_0x4fc51f=[],_0x5cc1ee=new Map();for(const _0x335c9b of _0x25c8f8){_0x5cc1ee[_0x4a1262(0x278)](_0x335c9b[_0x4a1262(0x2e8)],_0x335c9b);}const _0xf1bbf0=new Map();for(const _0x4d1184 of _0x1b9881){_0xf1bbf0['set'](_0x4d1184[_0x4a1262(0x2e8)],_0x4d1184);}for(const _0x33638b of _0x1b9881){const _0x36a21b=_0x5cc1ee[_0x4a1262(0x20a)](_0x33638b[_0x4a1262(0x2e8)]);if(!_0x36a21b)_0x4fc51f[_0x4a1262(0x2b9)]({'type':_0x4a1262(0x277),'name':_0x33638b[_0x4a1262(0x2e8)],'yamlActivation':_0x33638b});else{const _0x22903e=activationResponseToDef(_0x36a21b,_0x1a3b78,_0x146012),_0x57e41f=a136_0xa17e00['stringify'](_0x22903e),_0x40c6bf=a136_0xa17e00[_0x4a1262(0x287)](_0x33638b);_0x57e41f!==_0x40c6bf&&_0x4fc51f['push']({'type':_0x4a1262(0x23d),'name':_0x33638b[_0x4a1262(0x2e8)],'yamlActivation':_0x33638b,'existingActivation':_0x36a21b});}}for(const _0x3cd5b9 of _0x25c8f8){!_0xf1bbf0['has'](_0x3cd5b9[_0x4a1262(0x2e8)])&&_0x4fc51f[_0x4a1262(0x2b9)]({'type':_0x4a1262(0x291),'name':_0x3cd5b9['name'],'existingActivation':_0x3cd5b9});}return _0x4fc51f;}function calculateYamlDiff(_0x411f3b,_0x3b44a0){if(_0x3b44a0){const _0xbf0683=generateDiff(_0x3b44a0,_0x411f3b),_0x4a2eca=hasChanges(_0xbf0683);return{'isNew':![],'hasChanges':_0x4a2eca,'diff':_0x4a2eca?formatDiffWithColors(_0xbf0683):undefined};}const _0x44ce14=generateDiff('',_0x411f3b);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x44ce14)};}export function calculateSegmentDiff(_0x52aefc,_0x5a9a45,_0x5d89ab,_0x2ce223,_0x37b255){const _0x1ff7e0=segmentToYamlString(_0x52aefc),_0x416b0d=_0x5a9a45?segmentToYamlString(segmentWithActivationsToYaml(_0x5a9a45,_0x5d89ab,undefined,_0x2ce223,_0x37b255)):undefined;return calculateYamlDiff(_0x1ff7e0,_0x416b0d);}export function calculateJourneyDiff(_0x21d527,_0x7844e2){const _0x4ebc2f=normalizeJourneyDef(_0x21d527,_0x21d527),_0x5ed54b=a136_0x4d3ac1(_0x4ebc2f),_0x21dc95=_0x7844e2?a136_0x4d3ac1(normalizeJourneyDef(_0x7844e2,_0x21d527)):undefined;return calculateYamlDiff(_0x5ed54b,_0x21dc95);}export function findSegmentsToDelete(_0xfb1c91,_0x553836,_0x9f0ab6,_0x43fd74,_0x3b24f8){const _0x1abcc0=a136_0x357cba,_0x425b7e=new Set();for(const {yamlConfig:_0x102e64,folderPath:_0x51cec7}of _0x553836){_0x425b7e[_0x1abcc0(0x256)](_0x51cec7+':'+_0x102e64[_0x1abcc0(0x2e8)]);}return _0xfb1c91['filter'](_0x4fb12f=>{const _0x17e0ca=_0x1abcc0,_0x431a7e=_0x4fb12f[_0x17e0ca(0x2e5)]?_0x9f0ab6[_0x17e0ca(0x20a)](_0x4fb12f[_0x17e0ca(0x2e5)]['toString']())||'':'',_0x2636f1=_0x431a7e+':'+_0x4fb12f[_0x17e0ca(0x2e8)];if(_0x425b7e[_0x17e0ca(0x1f4)](_0x2636f1))return![];if(_0x3b24f8)return _0x431a7e===_0x43fd74||_0x431a7e[_0x17e0ca(0x204)](_0x43fd74+'/');return!![];});}export function findJourneysToDelete(_0x58ad2d,_0x188556,_0x4a2a47,_0x35e832,_0x45e0f1){const _0x50557f=a136_0x357cba,_0x1e21f7=new Set();for(const {yamlConfig:_0x5658f4,folderPath:_0x3effa8}of _0x188556){_0x1e21f7[_0x50557f(0x256)](_0x3effa8+':'+_0x5658f4[_0x50557f(0x2e8)]);}return _0x58ad2d[_0x50557f(0x257)](_0x1c6711=>{const _0x285b7c=_0x50557f,_0x10d4f8=_0x1c6711[_0x285b7c(0x279)]?_0x4a2a47[_0x285b7c(0x20a)](_0x1c6711[_0x285b7c(0x279)])||'':'',_0x4b971c=_0x10d4f8+':'+_0x1c6711['journeyBundleName'];if(_0x1e21f7[_0x285b7c(0x1f4)](_0x4b971c))return![];if(_0x45e0f1)return _0x10d4f8===_0x35e832||_0x10d4f8[_0x285b7c(0x204)](_0x35e832+'/');return!![];});}export function buildSegmentLookupMap(_0x26373d,_0x575c09){const _0x51976d=a136_0x357cba,_0x4f737f=new Map();for(const _0xc4542e of _0x26373d){const _0x120a99=_0xc4542e[_0x51976d(0x2e5)]?_0x575c09[_0x51976d(0x20a)](_0xc4542e[_0x51976d(0x2e5)][_0x51976d(0x273)]())||'':'',_0x425bed=_0x120a99+':'+_0xc4542e[_0x51976d(0x2e8)];_0x4f737f['set'](_0x425bed,_0xc4542e);}return _0x4f737f;}export function buildSegmentNameToIdMap(_0x2678e7){const _0xb14f76=a136_0x357cba,_0x41da08=new Map();for(const _0x28ad71 of _0x2678e7){_0x41da08[_0xb14f76(0x278)](_0x28ad71[_0xb14f76(0x2e8)],_0x28ad71['id']);}return _0x41da08;}export function buildJourneyBundleLookupMap(_0x50ac67,_0x259fa0){const _0x32efc4=a136_0x357cba,_0x43ccd2=new Map();for(const _0x396304 of _0x50ac67){const _0x4a3fd0=_0x396304[_0x32efc4(0x279)]?_0x259fa0[_0x32efc4(0x20a)](_0x396304[_0x32efc4(0x279)])||'':'',_0x457823=_0x4a3fd0+':'+_0x396304[_0x32efc4(0x237)];!_0x43ccd2[_0x32efc4(0x1f4)](_0x457823)&&_0x43ccd2[_0x32efc4(0x278)](_0x457823,[]),_0x43ccd2[_0x32efc4(0x20a)](_0x457823)['push'](_0x396304);}for(const _0x1c915a of _0x43ccd2[_0x32efc4(0x2e6)]()){_0x1c915a[_0x32efc4(0x2dc)]((_0x20d960,_0x38e3d6)=>(_0x20d960['versionNumber']||0x0)-(_0x38e3d6[_0x32efc4(0x2ac)]||0x0));}return _0x43ccd2;}export function collectFoldersToCreate(_0x46ee4e,_0x2fe63e){const _0x51907a=a136_0x357cba,_0x5661c7=new Set();for(const _0x51e777 of _0x46ee4e){if(!_0x51e777)continue;if(_0x2fe63e['has'](_0x51e777))continue;const _0x3f4fba=_0x51e777[_0x51907a(0x206)]('/');let _0x3f890d='';for(const _0x200d4d of _0x3f4fba){_0x3f890d=_0x3f890d?_0x3f890d+'/'+_0x200d4d:_0x200d4d,!_0x2fe63e['has'](_0x3f890d)&&_0x5661c7[_0x51907a(0x256)](_0x3f890d);}}return _0x5661c7;}export function parseAndClassifyYamlFiles(_0x29ba9a,_0x4dd884,_0x46d6da){const _0x488b48=a136_0x357cba,_0x5793e4=[],_0x483d22=[];for(const _0x12a994 of _0x29ba9a){const _0x2ad500=a136_0x8d255f[_0x488b48(0x242)](_0x4dd884,a136_0x8d255f['dirname'](_0x12a994)),_0x4d6f27=_0x2ad500==='.'?'':_0x2ad500,_0x193257=readFileSync(_0x12a994,'utf-8'),_0x162828=a136_0xa17e00[_0x488b48(0x201)](_0x193257);if(isJourneyDef(_0x162828)){const _0x1ba771=a136_0x35b9fb(_0x193257);_0x483d22[_0x488b48(0x2b9)]({'yamlConfig':_0x1ba771,'folderPath':_0x4d6f27,'sourcePath':_0x12a994});}else{if(!_0x46d6da?.[_0x488b48(0x2df)]){const _0x1491e8=parseSegmentYamlFile(_0x193257),_0xc6a45f=normalizeChildSegmentYaml(_0x1491e8);_0x5793e4[_0x488b48(0x2b9)]({'yamlConfig':_0xc6a45f,'folderPath':_0x4d6f27,'sourcePath':_0x12a994});}}}return{'segments':_0x5793e4,'journeys':_0x483d22};}export function validateParsedFiles(_0x28292d,_0x2bd1d1){const _0x3f1897=a136_0x357cba,_0xab5727=[];for(const {yamlConfig:_0x1067b3,sourcePath:_0x149e2e}of _0x28292d['segments']){const _0x1e9751=readFileSync(_0x149e2e,'utf-8'),_0x58d4bb=a136_0xa17e00[_0x3f1897(0x245)](_0x1e9751),_0x142379=validateSegmentDef(_0x1067b3,{'source':_0x1e9751,'document':_0x58d4bb},{'skipSchema':!![]});if(!_0x142379[_0x3f1897(0x26e)]){const _0x4c1934=a136_0x8d255f['relative'](_0x2bd1d1,_0x149e2e);_0xab5727['push']({'filePath':_0x4c1934,'source':_0x1e9751,'result':_0x142379,'isJourney':![]});}}for(const {yamlConfig:_0x54dbc5,sourcePath:_0x358df7}of _0x28292d[_0x3f1897(0x27f)]){const _0x426d47=readFileSync(_0x358df7,_0x3f1897(0x2ae)),_0x885da4=a136_0xa17e00[_0x3f1897(0x245)](_0x426d47),_0x317228=validateJourneyDef(_0x54dbc5,{'source':_0x426d47,'document':_0x885da4},{'skipSchema':!![]});if(!_0x317228['valid']){const _0x21e540=a136_0x8d255f[_0x3f1897(0x242)](_0x2bd1d1,_0x358df7);_0xab5727[_0x3f1897(0x2b9)]({'filePath':_0x21e540,'source':_0x426d47,'result':_0x317228,'isJourney':!![]});}}return _0xab5727;}export function formatValidationErrors(_0x2de739){const _0x16d9ef=a136_0x357cba,_0x45666d=[];for(const {filePath:_0x550708,source:_0x12c4b9,result:_0x10edd1,isJourney:_0x27b30c}of _0x2de739){const _0x12fd69=_0x27b30c?_0x16d9ef(0x22d):_0x16d9ef(0x27c);_0x45666d[_0x16d9ef(0x2b9)]('\x0a'+_0x550708+'\x20('+_0x12fd69+_0x16d9ef(0x2b0)+_0x10edd1[_0x16d9ef(0x228)][_0x16d9ef(0x2b3)]+_0x16d9ef(0x1f9)),_0x45666d[_0x16d9ef(0x2b9)](formatValidationResult(_0x10edd1,_0x12c4b9,_0x550708));}return _0x45666d['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x30d749){const _0x4de235=a136_0x357cba,_0x237c8d=new Set(),_0x4d95b1=new Map(),_0x321651=collectSegmentUsageCounts(_0x30d749);if(_0x30d749['segments'])for(const [_0x4d3c4f,_0x3566eb]of Object['entries'](_0x30d749[_0x4de235(0x284)])){_0x237c8d['add'](_0x4d3c4f);if(_0x3566eb[_0x4de235(0x25e)]){const _0x454b72=yamlRuleToApi(_0x3566eb[_0x4de235(0x25e)]),_0x1771c1=apiRuleToYaml(_0x454b72);_0x4d95b1[_0x4de235(0x278)](_0x4d3c4f,_0x1771c1);}}const _0x1e5973=new Map();let _0x515fc0=0x0;for(const [_0x18fed0,_0x32faa2]of _0x4d95b1){const _0x15d8a1=serializeExpandedRule(_0x32faa2,_0x4d95b1),_0x477366=_0x1e5973['get'](_0x15d8a1)||[];_0x477366[_0x4de235(0x2b9)]({'name':_0x18fed0,'index':_0x515fc0}),_0x1e5973['set'](_0x15d8a1,_0x477366),_0x515fc0++;}const _0x5b1f05=new Map();for(const [_0x380af7,_0x27c358]of _0x1e5973){const _0x2823df=_0x27c358[_0x4de235(0x29b)]()['sort']((_0x232cc1,_0x4b16f2)=>{const _0x953a3b=_0x4de235,_0x455aad=_0x321651[_0x953a3b(0x20a)](_0x232cc1['name'])||0x0,_0x516449=_0x321651[_0x953a3b(0x20a)](_0x4b16f2['name'])||0x0;if(_0x455aad!==_0x516449)return _0x516449-_0x455aad;return _0x232cc1[_0x953a3b(0x2e1)]-_0x4b16f2['index'];})['map'](_0x1f9b49=>_0x1f9b49[_0x4de235(0x2e8)]),_0x1caa71=[];for(const _0x5857ef of _0x2823df){const _0x58286f=_0x321651[_0x4de235(0x20a)](_0x5857ef)||0x0,_0x1b91b7=Math[_0x4de235(0x1ff)](_0x58286f,0x1);for(let _0x39d82f=0x0;_0x39d82f<_0x1b91b7;_0x39d82f++){_0x1caa71[_0x4de235(0x2b9)](_0x5857ef);}}_0x5b1f05[_0x4de235(0x278)](_0x380af7,_0x1caa71);}return{'existingLocalSegmentNames':_0x237c8d,'localSegmentRules':_0x4d95b1,'localExpandedRuleToNames':_0x5b1f05};}export function createSegmentIdResolver(_0x506388,_0x46dda0){return async _0x2a2728=>{const _0x84269=a136_0x1e1e,_0x558d54=_0x506388[_0x84269(0x20a)](_0x2a2728);if(!_0x558d54)throw new SDKError(ErrorCode[_0x84269(0x2a1)],_0x84269(0x24e)+_0x2a2728+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x46dda0+'\x27)');return _0x558d54;};}export function extractRootFolderId(_0x445c29){const _0x4e8635=a136_0x357cba;return _0x445c29['relationships']?.[_0x4e8635(0x25b)]?.['data']?.['id']||_0x445c29['relationships']?.['parentFolder']?.[_0x4e8635(0x2cb)]?.['id'];}export function buildConnectionMaps(_0x3c2e5d){const _0x3cd20a=a136_0x357cba,_0x4e3bcd=new Map(),_0x3ce502=new Map(),_0x3f7995=new Map();for(const _0x177e45 of _0x3c2e5d){_0x4e3bcd[_0x3cd20a(0x278)](_0x177e45[_0x3cd20a(0x2e8)],parseInt(_0x177e45['id'],0xa)),_0x3ce502[_0x3cd20a(0x278)](_0x177e45['id'],_0x177e45[_0x3cd20a(0x2e8)]),_0x3f7995[_0x3cd20a(0x278)](_0x177e45[_0x3cd20a(0x2e8)],_0x177e45[_0x3cd20a(0x22e)]);}return{'nameToId':_0x4e3bcd,'idToName':_0x3ce502,'nameToType':_0x3f7995};}export function calculatePushStats(_0x4f517d,_0x2bff1f,_0x19905c,_0x4c4fd6,_0x3016a4,_0x44d7f8,_0x5559ca){const _0x33ca2f=a136_0x357cba,_0x3693c0=_0x4f517d[_0x33ca2f(0x257)](_0x2c97dd=>_0x2c97dd[_0x33ca2f(0x232)]),_0x2bb7e2=_0x4f517d[_0x33ca2f(0x257)](_0x1bf4b6=>!_0x1bf4b6[_0x33ca2f(0x232)]&&_0x1bf4b6['hasChanges']),_0x3edde9=_0x4f517d[_0x33ca2f(0x257)](_0x281f29=>!_0x281f29['isNew']&&!_0x281f29[_0x33ca2f(0x2ab)]),_0x1b92f6=_0x44d7f8?_0x4c4fd6:[],_0x3bc40d=_0x2bff1f[_0x33ca2f(0x257)](_0x12ff0f=>_0x12ff0f[_0x33ca2f(0x232)]),_0x424830=_0x2bff1f[_0x33ca2f(0x257)](_0x3ee8c0=>!_0x3ee8c0[_0x33ca2f(0x232)]&&_0x3ee8c0[_0x33ca2f(0x2ab)]),_0x32dbc8=_0x2bff1f['filter'](_0x29b99c=>!_0x29b99c[_0x33ca2f(0x232)]&&!_0x29b99c[_0x33ca2f(0x2ab)]),_0x4a728b=_0x44d7f8?_0x3016a4:[],_0x26f0a8=_0x4f517d[_0x33ca2f(0x2a2)](_0x2bf3f8=>_0x2bf3f8[_0x33ca2f(0x21b)]),_0x12fed1=_0x26f0a8[_0x33ca2f(0x257)](_0x2d2c91=>_0x2d2c91[_0x33ca2f(0x22e)]===_0x33ca2f(0x277)),_0x287fbd=_0x26f0a8[_0x33ca2f(0x257)](_0x3743b5=>_0x3743b5[_0x33ca2f(0x22e)]==='update'),_0x4674b8=_0x26f0a8[_0x33ca2f(0x257)](_0x27ac75=>_0x27ac75[_0x33ca2f(0x22e)]===_0x33ca2f(0x291)),_0x177fee=Array[_0x33ca2f(0x2de)](_0x19905c)[_0x33ca2f(0x2dc)](),_0x1ed898=_0x5559ca?![]:_0x3693c0['length']>0x0||_0x2bb7e2[_0x33ca2f(0x2b3)]>0x0||_0x1b92f6[_0x33ca2f(0x2b3)]>0x0,_0x2d664d=_0x3bc40d[_0x33ca2f(0x2b3)]>0x0||_0x424830[_0x33ca2f(0x2b3)]>0x0||_0x4a728b[_0x33ca2f(0x2b3)]>0x0,_0x1954de=_0x5559ca?![]:_0x26f0a8[_0x33ca2f(0x2b3)]>0x0,_0x24203c=_0x177fee[_0x33ca2f(0x2b3)]>0x0;return{'segments':{'new':_0x3693c0,'changed':_0x2bb7e2,'unchanged':_0x3edde9,'toDelete':_0x1b92f6},'journeys':{'new':_0x3bc40d,'changed':_0x424830,'unchanged':_0x32dbc8,'toDelete':_0x4a728b},'activations':{'all':_0x26f0a8,'toCreate':_0x12fed1,'toUpdate':_0x287fbd,'toDelete':_0x4674b8},'folders':{'toCreate':_0x177fee},'counts':{'segments':{'new':_0x3693c0[_0x33ca2f(0x2b3)],'changed':_0x2bb7e2[_0x33ca2f(0x2b3)],'unchanged':_0x3edde9[_0x33ca2f(0x2b3)],'toDelete':_0x1b92f6['length']},'journeys':{'new':_0x3bc40d['length'],'changed':_0x424830['length'],'unchanged':_0x32dbc8[_0x33ca2f(0x2b3)],'toDelete':_0x4a728b[_0x33ca2f(0x2b3)]},'activations':{'create':_0x12fed1[_0x33ca2f(0x2b3)],'update':_0x287fbd[_0x33ca2f(0x2b3)],'delete':_0x4674b8[_0x33ca2f(0x2b3)]},'folders':_0x177fee['length']},'hasChanges':_0x1ed898||_0x2d664d||_0x1954de||_0x24203c};}export async function buildPushExecutionContext(_0x3a1673,_0xc3bc86,_0x472dc6,_0x1eeafa,_0x292fae,_0xa061e0){const _0x2461a1=a136_0x357cba,_0xf7e2f7=extractRootFolderId(_0x472dc6),{pathToId:_0x396dfe,idToPath:_0x508a9b}=buildFolderMaps(_0x292fae),_0x40bfe8=buildSegmentNameToIdMap(_0x1eeafa),_0x4f7eda=new Map(),{batchAsync:_0x4c8dfd}=await import(_0x2461a1(0x22c)),[_0x2e5d34,_0xa307ff]=await Promise[_0x2461a1(0x2e2)]([_0x3a1673['user'][_0x2461a1(0x24f)](),_0x3a1673[_0x2461a1(0x2cc)][_0x2461a1(0x21e)](),((async()=>{!_0xa061e0&&_0x1eeafa['length']>0x0&&await _0x4c8dfd(_0x1eeafa,async _0x12d634=>{const _0xedcec4=a136_0x1e1e,_0x31bf9c=await _0x3a1673[_0xedcec4(0x27c)]['listActivations'](_0xc3bc86,_0x12d634['id']);_0x4f7eda['set'](_0x12d634['id'],_0x31bf9c);});})())]),{emailToId:_0x451389,idToEmail:_0x4a9fae}=_0x2e5d34,_0x462fc2=buildConnectionMaps(_0xa307ff);return{'rootFolderId':_0xf7e2f7,'folderPathToId':_0x396dfe,'folderIdToPath':_0x508a9b,'segmentNameToId':_0x40bfe8,'activationsBySegmentId':_0x4f7eda,'emailToIdMap':_0x451389,'idToEmailMap':_0x4a9fae,'connectionNameToIdMap':_0x462fc2['nameToId'],'connectionIdToNameMap':_0x462fc2[_0x2461a1(0x260)],'connectionNameToTypeMap':_0x462fc2[_0x2461a1(0x23b)]};}export function createPushYamlContextForBundle(_0x2f1bb6,_0x22c3de,_0x43d31d,_0x3e943b,_0x2d46d2,_0x42a516,_0x9998ab,_0x3c3a0f){const {existingLocalSegmentNames:_0x31c2e9,localExpandedRuleToNames:_0x1897ed}=_0x3e943b,_0x145a3c=new Set(),_0x56516e=new Map(),_0x2fefda=new Map(),_0x374d0f=new Map(),_0x530029=createJumpTargetCache(),_0x11999c=new Map(),_0x4d43a3=new Map(),_0x1ae375=new Set();let _0xc7398c;const _0x50cca7=_0x40fbfb=>{const _0x51c67d={'resolveSegment':async _0x1dd49c=>{const _0x4b3814=a136_0x1e1e,_0xd2ec19=_0x374d0f[_0x4b3814(0x20a)](_0x1dd49c);if(_0xd2ec19!==undefined)return{'name':_0xd2ec19,'isJourneyLocal':!![]};try{const _0x162e3c=await fetchSegment(_0x2f1bb6,_0x22c3de,_0x1dd49c,_0x43d31d);if(!_0x162e3c)throw new Error(_0x4b3814(0x2f0));const _0xcb443=generateJourneyLocalName(_0x162e3c[_0x4b3814(0x2e8)]),_0x168c20=_0x162e3c[_0x4b3814(0x2d0)]===SEGMENT_KIND_JOURNEY&&_0xcb443!==undefined;let _0x16852e=_0x162e3c[_0x4b3814(0x2e8)],_0x1a2aac;if(_0x168c20&&_0x162e3c[_0x4b3814(0x25e)]){const _0x1e4628=apiRuleToYaml(_0x162e3c[_0x4b3814(0x25e)]);_0x4d43a3[_0x4b3814(0x278)](_0x1dd49c,_0x1e4628);const _0x4f5b0b=async _0x1bbc9e=>{const _0x52dbe1=_0x4b3814,_0x1893fe=collectSegmentRefsFromRule(_0x1bbc9e);for(const _0x4193a5 of _0x1893fe){if(!_0x4d43a3[_0x52dbe1(0x1f4)](_0x4193a5))try{const _0x546903=await fetchSegment(_0x2f1bb6,_0x22c3de,_0x4193a5,_0x43d31d);if(_0x546903?.[_0x52dbe1(0x25e)]){const _0x4a2938=apiRuleToYaml(_0x546903[_0x52dbe1(0x25e)]);_0x4d43a3[_0x52dbe1(0x278)](_0x4193a5,_0x4a2938),await _0x4f5b0b(_0x4a2938);}}catch(_0x189212){logger[_0x52dbe1(0x2d3)](_0x52dbe1(0x220)+_0x4193a5+':\x20'+_0x189212);}}};await _0x4f5b0b(_0x1e4628);const _0x281ce8=serializeExpandedRule(_0x1e4628,_0x4d43a3),_0x37f874=_0x1897ed[_0x4b3814(0x20a)](_0x281ce8);if(_0x37f874&&_0x37f874[_0x4b3814(0x2b3)]>0x0){const _0x478a6f=_0x56516e[_0x4b3814(0x20a)](_0x281ce8)||0x0,_0x40a817=_0x37f874[_0x478a6f]||_0x37f874[_0x37f874['length']-0x1];_0x56516e[_0x4b3814(0x278)](_0x281ce8,_0x478a6f+0x1),_0x16852e=_0x40a817,_0x145a3c[_0x4b3814(0x256)](_0x16852e),_0x374d0f[_0x4b3814(0x278)](_0x1dd49c,_0x16852e);const _0x1d9834=await resolveRuleSegmentRefs(_0x1e4628,async _0x18a746=>{const _0x28b5b2=_0x4b3814,_0x39a4ad=_0x374d0f['get'](_0x18a746);if(_0x39a4ad)return _0x39a4ad;const _0x811f85=await _0xc7398c[_0x28b5b2(0x21a)](_0x18a746);return _0x811f85[_0x28b5b2(0x2e8)];});_0x1a2aac={'description':_0x162e3c[_0x4b3814(0x2a7)],'rule':_0x1d9834};}else{const _0x5b26fe=_0x11999c['get'](_0x281ce8);if(_0x5b26fe)_0x16852e=_0x5b26fe,_0x374d0f[_0x4b3814(0x278)](_0x1dd49c,_0x16852e);else{if(_0xcb443){let _0x5cd35a=_0xcb443,_0x56b69e=0x2;while(_0x145a3c[_0x4b3814(0x1f4)](_0x5cd35a)||_0x31c2e9[_0x4b3814(0x1f4)](_0x5cd35a)){_0x5cd35a=_0xcb443+'_'+_0x56b69e,_0x56b69e++;}_0x145a3c[_0x4b3814(0x256)](_0x5cd35a),_0x16852e=_0x5cd35a;}_0x374d0f[_0x4b3814(0x278)](_0x1dd49c,_0x16852e),_0x11999c[_0x4b3814(0x278)](_0x281ce8,_0x16852e);const _0x2bdc86=await resolveRuleSegmentRefs(_0x1e4628,async _0x2345f7=>{const _0x4b12db=_0x374d0f['get'](_0x2345f7);if(_0x4b12db)return _0x4b12db;const _0x5ba4e7=await _0xc7398c['resolveSegment'](_0x2345f7);return _0x5ba4e7['name'];});_0x1a2aac={'description':_0x162e3c[_0x4b3814(0x2a7)],'rule':_0x2bdc86};}}}return{'name':_0x16852e,'isJourneyLocal':_0x168c20,'definition':_0x1a2aac};}catch(_0x281904){return logger[_0x4b3814(0x2d3)](_0x4b3814(0x251)+_0x1dd49c+':\x20'+_0x281904),{'name':_0x1dd49c,'isJourneyLocal':![]};}},'resolveActivation':async _0x1bcc61=>{const _0x4ea7bf=a136_0x1e1e,_0x1972c1=_0x2fefda[_0x4ea7bf(0x20a)](_0x1bcc61);if(_0x1972c1!==undefined)return{'name':_0x1972c1,'isJourneyLocal':!![]};try{let _0xe3a7c1=_0x9998ab?.[_0x4ea7bf(0x20a)](_0x1bcc61);!_0xe3a7c1&&(_0xe3a7c1=await _0x2f1bb6[_0x4ea7bf(0x22d)][_0x4ea7bf(0x2a9)](_0x40fbfb,_0x1bcc61));const _0x1c5a67=_0xe3a7c1[_0x4ea7bf(0x2c8)][_0x4ea7bf(0x24a)][_0x4ea7bf(0x2e8)]||_0x1bcc61,_0x52f8be=sanitizeYamlKey(_0x1c5a67)||_0x4ea7bf(0x26f)+_0x1bcc61,_0x4f72e7=_0x52f8be;_0x2fefda[_0x4ea7bf(0x278)](_0x1bcc61,_0x4f72e7);const _0x39dc17=journeyActivationStepToYaml(_0xe3a7c1,_0x2d46d2,_0x42a516);return{'name':_0x4f72e7,'isJourneyLocal':!![],'definition':_0x39dc17};}catch(_0x7be0f0){return logger[_0x4ea7bf(0x2d3)](_0x4ea7bf(0x259)+_0x1bcc61+':\x20'+_0x7be0f0),{'name':_0x1bcc61,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2c4b5b,_0x3eee0f)=>resolveJumpTarget(_0x2c4b5b,_0x3eee0f,_0x530029,async _0x50cf08=>{const _0x14b5d=a136_0x1e1e,_0x1f3ab0=_0x3c3a0f?.['get'](_0x50cf08);if(_0x1f3ab0)return _0x1f3ab0;return _0x2f1bb6[_0x14b5d(0x22d)][_0x14b5d(0x2b2)](_0x50cf08);})};return _0xc7398c=_0x51c67d,_0x51c67d;},_0x104c72=async _0x5df58c=>{const _0x12b3d7=a136_0x1e1e,{collectSegmentIdsFromJourneyApi:_0x3c324d}=await import(_0x12b3d7(0x200)),{batchAsync:_0x130bd1}=await import(_0x12b3d7(0x22c)),_0x5a5c34=new Set();for(const _0x31180c of _0x5df58c){let _0x1f9f58=_0x3c3a0f?.[_0x12b3d7(0x20a)](_0x31180c);!_0x1f9f58&&(_0x1f9f58=await _0x2f1bb6[_0x12b3d7(0x22d)][_0x12b3d7(0x2b2)](_0x31180c));const _0xf84256=_0x3c324d(_0x1f9f58);for(const _0x219c4e of _0xf84256){_0x5a5c34[_0x12b3d7(0x256)](_0x219c4e);}}let _0x39ed93=Array['from'](_0x5a5c34);while(_0x39ed93[_0x12b3d7(0x2b3)]>0x0){const _0x435c35=_0x39ed93[_0x12b3d7(0x257)](_0x410f2d=>!_0x1ae375[_0x12b3d7(0x1f4)](_0x410f2d));if(_0x435c35[_0x12b3d7(0x2b3)]===0x0)break;const _0x201761=await _0x130bd1(_0x435c35,async _0x5c3dc9=>{_0x1ae375['add'](_0x5c3dc9);const _0x2a87a5=await fetchSegment(_0x2f1bb6,_0x22c3de,_0x5c3dc9,_0x43d31d);if(!_0x2a87a5)return null;return{'segmentId':_0x5c3dc9,'segment':_0x2a87a5};},0xa),_0x1ee317=new Set();for(const _0x421e45 of _0x201761){if(!_0x421e45?.[_0x12b3d7(0x27c)]?.[_0x12b3d7(0x25e)])continue;const _0x49dbcc=apiRuleToYaml(_0x421e45[_0x12b3d7(0x27c)][_0x12b3d7(0x25e)]);_0x4d43a3[_0x12b3d7(0x278)](_0x421e45[_0x12b3d7(0x235)],_0x49dbcc);const _0x1f6798=collectSegmentRefsFromRule(_0x49dbcc);for(const _0x227fa2 of _0x1f6798){!_0x1ae375[_0x12b3d7(0x1f4)](_0x227fa2)&&_0x1ee317['add'](_0x227fa2);}}_0x39ed93=Array[_0x12b3d7(0x2de)](_0x1ee317);}};return{'createYamlContext':_0x50cca7,'prefetchJourneySegments':_0x104c72};}export async function executePushSegments(_0x50f05a,_0x189d11,_0x26a95a,_0x243de9,_0x4f89a1){const _0x563034=a136_0x357cba,{segmentDefToCreateRequest:_0x1fadae,segmentDefToUpdateRequest:_0x2b1863}=await import(_0x563034(0x227)),_0x10f424=_0x26a95a[_0x563034(0x25c)],_0x1cb70b=0x5,_0x2a9e03=async _0x5b16aa=>{const _0x2ac060=_0x563034,_0xb55e94=_0x5b16aa['folderPath']?_0x10f424[_0x2ac060(0x20a)](_0x5b16aa[_0x2ac060(0x29d)]):undefined;let _0x338ea1;const _0x2ab97c={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x381d41=_0x5b16aa['yamlConfig'];if(_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x25e)]){const _0x5f0c71=createSegmentIdResolver(_0x26a95a['segmentNameToId'],_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]),_0xd62583=await resolveRuleSegmentIds(_0x5b16aa[_0x2ac060(0x276)]['rule'],_0x5f0c71);_0x381d41={..._0x5b16aa['yamlConfig'],'rule':_0xd62583};}try{if(_0x5b16aa['isNew']){_0x4f89a1['onProgress']?.({'type':_0x2ac060(0x296),'name':_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]});const _0x866aa7=_0x1fadae(_0x381d41,_0xb55e94),_0x4f875d=await _0x4f89a1[_0x2ac060(0x2e7)](_0x2ac060(0x288)+_0x5b16aa['yamlConfig'][_0x2ac060(0x2e8)]+_0x2ac060(0x292),()=>_0x50f05a[_0x2ac060(0x27c)][_0x2ac060(0x27d)](_0x243de9[_0x2ac060(0x25f)],_0x866aa7));_0x338ea1=_0x4f875d[_0x2ac060(0x2cb)]['id'],_0x26a95a[_0x2ac060(0x20f)][_0x2ac060(0x278)](_0x5b16aa['yamlConfig']['name'],_0x338ea1),_0x2ab97c[_0x2ac060(0x1fa)]={'name':_0x5b16aa['yamlConfig'][_0x2ac060(0x2e8)],'id':_0x338ea1},_0x4f89a1[_0x2ac060(0x275)]?.({'type':_0x2ac060(0x285),'name':_0x5b16aa['yamlConfig'][_0x2ac060(0x2e8)],'segmentId':_0x338ea1}),_0x4f89a1[_0x2ac060(0x289)]?.('Created\x20segment\x20\x27'+_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]+'\x27'),_0x2ab97c[_0x2ac060(0x28c)]=0x1;}else{if(_0x5b16aa[_0x2ac060(0x2ab)]){_0x4f89a1[_0x2ac060(0x275)]?.({'type':_0x2ac060(0x23f),'name':_0x5b16aa['yamlConfig'][_0x2ac060(0x2e8)]});const _0x5f3b3f=_0x2b1863(_0x381d41);_0xb55e94!==_0x5b16aa[_0x2ac060(0x271)]?.[_0x2ac060(0x2e5)]&&(_0x5f3b3f['segmentFolderId']=_0xb55e94?parseInt(_0xb55e94,0xa):undefined),await _0x4f89a1[_0x2ac060(0x2e7)](_0x2ac060(0x224)+_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]+_0x2ac060(0x292),()=>_0x50f05a[_0x2ac060(0x27c)]['updateSegmentById'](_0x243de9[_0x2ac060(0x25f)],_0x5b16aa[_0x2ac060(0x271)]['id'],_0x5f3b3f)),_0x338ea1=_0x5b16aa['existingSegment']['id'],_0x4f89a1[_0x2ac060(0x275)]?.({'type':_0x2ac060(0x2c6),'name':_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]}),_0x4f89a1['logSuccess']?.(_0x2ac060(0x2a8)+_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]+'\x27'),_0x2ab97c[_0x2ac060(0x22b)]=0x1;}else _0x338ea1=_0x5b16aa[_0x2ac060(0x271)]['id'];}}catch(_0x565252){const _0x6d5d2b=isHttp400Error(_0x565252),_0x302d35=_0x6d5d2b?ErrorCode[_0x2ac060(0x234)]:ErrorCode[_0x2ac060(0x1f7)],_0x5e5928=getErrorMessage(_0x565252);throw new SDKError(_0x302d35,_0x2ac060(0x2af)+(_0x5b16aa[_0x2ac060(0x232)]?_0x2ac060(0x277):_0x2ac060(0x23d))+_0x2ac060(0x261)+_0x5b16aa[_0x2ac060(0x2b5)]+'\x0a\x20\x20'+_0x5e5928,_0x565252);}try{const _0x59280c=await syncActivationsForSegment(_0x50f05a,_0x243de9[_0x2ac060(0x25f)],_0x338ea1,_0x5b16aa['yamlConfig'][_0x2ac060(0x2e8)],_0x5b16aa['activationActions'],_0x4f89a1,_0x5b16aa[_0x2ac060(0x2b5)]);_0x2ab97c['activations']=_0x59280c;}catch(_0x130fda){if(_0x130fda instanceof SDKError)throw _0x130fda;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2ac060(0x248)+_0x5b16aa[_0x2ac060(0x276)]['name']+_0x2ac060(0x229)+_0x5b16aa[_0x2ac060(0x2b5)]+_0x2ac060(0x21c)+getErrorMessage(_0x130fda),_0x130fda);}return _0x2ab97c;},_0x25cde6=await batchAsync(_0x189d11,_0x2a9e03,_0x1cb70b),_0x4f00ad={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1e8a07 of _0x25cde6){_0x4f00ad['created']+=_0x1e8a07[_0x563034(0x28c)],_0x4f00ad[_0x563034(0x22b)]+=_0x1e8a07['updated'],_0x1e8a07['createdSegmentId']&&_0x4f00ad['createdSegmentIds'][_0x563034(0x278)](_0x1e8a07['createdSegmentId'][_0x563034(0x2e8)],_0x1e8a07[_0x563034(0x1fa)]['id']),_0x4f00ad[_0x563034(0x1f5)]['created']+=_0x1e8a07[_0x563034(0x1f5)][_0x563034(0x28c)],_0x4f00ad['activations'][_0x563034(0x22b)]+=_0x1e8a07[_0x563034(0x1f5)][_0x563034(0x22b)],_0x4f00ad[_0x563034(0x1f5)][_0x563034(0x2d6)]+=_0x1e8a07['activations'][_0x563034(0x2d6)];}return _0x4f00ad;}async function syncActivationsForSegment(_0x45e2e8,_0x1ec732,_0x426de3,_0xb3080f,_0x44ee6c,_0x4a65a3,_0x2226c8){const _0x3e2b6d=a136_0x357cba,_0x2da6b7={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4532a0 of _0x44ee6c){try{if(_0x4532a0[_0x3e2b6d(0x22e)]===_0x3e2b6d(0x277)&&_0x4532a0[_0x3e2b6d(0x2b1)])_0x4a65a3['onProgress']?.({'type':_0x3e2b6d(0x2c9),'segmentName':_0xb3080f,'activationName':_0x4532a0[_0x3e2b6d(0x2e8)]}),await _0x4a65a3[_0x3e2b6d(0x2e7)](_0x3e2b6d(0x2a3)+_0x4532a0[_0x3e2b6d(0x2e8)]+_0x3e2b6d(0x292),()=>_0x45e2e8['segment'][_0x3e2b6d(0x216)](_0x1ec732,_0x426de3,_0x4532a0[_0x3e2b6d(0x2b1)])),_0x4a65a3[_0x3e2b6d(0x275)]?.({'type':_0x3e2b6d(0x239),'segmentName':_0xb3080f,'activationName':_0x4532a0[_0x3e2b6d(0x2e8)]}),_0x4a65a3[_0x3e2b6d(0x289)]?.(_0x3e2b6d(0x2bb)+_0x4532a0[_0x3e2b6d(0x2e8)]+'\x27'),_0x2da6b7[_0x3e2b6d(0x28c)]++;else{if(_0x4532a0[_0x3e2b6d(0x22e)]==='update'&&_0x4532a0[_0x3e2b6d(0x2b1)]&&_0x4532a0[_0x3e2b6d(0x27b)])_0x4a65a3[_0x3e2b6d(0x275)]?.({'type':_0x3e2b6d(0x2f2),'segmentName':_0xb3080f,'activationName':_0x4532a0[_0x3e2b6d(0x2e8)]}),await _0x4a65a3[_0x3e2b6d(0x2e7)](_0x3e2b6d(0x264)+_0x4532a0['name']+'\x27...',()=>_0x45e2e8['segment'][_0x3e2b6d(0x28d)](_0x1ec732,_0x426de3,_0x4532a0['existingActivation']['id'],_0x4532a0['validatedRequest'])),_0x4a65a3['onProgress']?.({'type':_0x3e2b6d(0x23c),'segmentName':_0xb3080f,'activationName':_0x4532a0['name']}),_0x4a65a3[_0x3e2b6d(0x289)]?.(_0x3e2b6d(0x203)+_0x4532a0[_0x3e2b6d(0x2e8)]+'\x27'),_0x2da6b7[_0x3e2b6d(0x22b)]++;else _0x4532a0[_0x3e2b6d(0x22e)]===_0x3e2b6d(0x291)&&_0x4532a0[_0x3e2b6d(0x27b)]&&(_0x4a65a3[_0x3e2b6d(0x275)]?.({'type':'activation_deleting','segmentName':_0xb3080f,'activationName':_0x4532a0[_0x3e2b6d(0x2e8)]}),await _0x4a65a3['withProgress'](_0x3e2b6d(0x2aa)+_0x4532a0[_0x3e2b6d(0x2e8)]+_0x3e2b6d(0x292),()=>_0x45e2e8[_0x3e2b6d(0x27c)][_0x3e2b6d(0x2e3)](_0x1ec732,_0x426de3,_0x4532a0[_0x3e2b6d(0x27b)]['id'])),_0x4a65a3['onProgress']?.({'type':_0x3e2b6d(0x2c0),'segmentName':_0xb3080f,'activationName':_0x4532a0['name']}),_0x4a65a3[_0x3e2b6d(0x2ed)]?.(_0x3e2b6d(0x246)+_0x4532a0['name']+'\x27'),_0x2da6b7['deleted']++);}}catch(_0x13bb19){const _0x1fd21c=isHttp400Error(_0x13bb19),_0x3bf603=_0x1fd21c?ErrorCode[_0x3e2b6d(0x207)]:ErrorCode[_0x3e2b6d(0x263)],_0x56cad2=getErrorMessage(_0x13bb19);throw new SDKError(_0x3bf603,'Failed\x20to\x20'+_0x4532a0[_0x3e2b6d(0x22e)]+_0x3e2b6d(0x28e)+_0x4532a0[_0x3e2b6d(0x2e8)]+_0x3e2b6d(0x229)+_0x2226c8+_0x3e2b6d(0x21c)+_0x56cad2,_0x13bb19);}}return _0x2da6b7;}export async function executePushFolders(_0x533952,_0x5ababa,_0x79c06b,_0x33be98,_0x1621a2){const _0x5b38b8=a136_0x357cba,_0x45e02a=new Map(_0x79c06b),_0x591fb5=sortFoldersByDepth(_0x5ababa);for(const _0x142bb0 of _0x591fb5){const _0x2c972c=_0x142bb0[_0x5b38b8(0x206)]('/'),_0x76860d=_0x2c972c[_0x2c972c[_0x5b38b8(0x2b3)]-0x1],_0x20262e=_0x2c972c[_0x5b38b8(0x29b)](0x0,-0x1)[_0x5b38b8(0x290)]('/'),_0xeef736=_0x45e02a[_0x5b38b8(0x20a)](_0x20262e);_0x1621a2[_0x5b38b8(0x275)]?.({'type':'folder_creating','folder':_0x142bb0});const _0x58a486={'name':_0x76860d,'parentFolderId':_0xeef736},_0x543041=await _0x1621a2[_0x5b38b8(0x2e7)](_0x5b38b8(0x27a)+_0x142bb0+_0x5b38b8(0x292),()=>_0x533952[_0x5b38b8(0x27c)][_0x5b38b8(0x20c)](_0x33be98[_0x5b38b8(0x25f)],_0x58a486));_0x45e02a['set'](_0x142bb0,_0x543041[_0x5b38b8(0x2cb)]['id']),_0x1621a2[_0x5b38b8(0x275)]?.({'type':_0x5b38b8(0x236),'folder':_0x142bb0,'folderId':_0x543041[_0x5b38b8(0x2cb)]['id']}),_0x1621a2[_0x5b38b8(0x26b)]?.(_0x5b38b8(0x2f6)+_0x142bb0+'\x27');}return _0x45e02a;}function a136_0x3ed0(){const _0x4d9629=['created','updateActivation','\x20activation\x20\x27','draft','join','delete','\x27...','188570twaieq','journeyActivationNameToId','uniqueSegmentName','segment_creating','with','journey_updating','uniqueServerName','tdx.sdk.push-workflow','slice','sha1','folderPath','schedule','journeyId','embeddedSegmentNameToId','SEGMENT_NOT_FOUND','flatMap','Creating\x20activation\x20\x27','conditions','updateSegmentById','progress','description','Updated\x20segment\x20\x27','getActivation','Deleting\x20activation\x20\x27','hasChanges','versionNumber','\x27\x20for\x20','utf-8','Failed\x20to\x20','):\x20','validatedRequest','getJourney','length','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','absolutePath','\x27\x20milestone','journeyStages','\x27\x20wait\x20condition','push','journeyName','Created\x20activation\x20\x27','\x27\x20entry\x20criteria','77QifsxD','decision_point','stage\x20\x27','activation_deleted','branches','Fetching\x20','embedded_activation_creating','Entry\x20criteria:\x20','Stage\x20\x27','segment_updated','waitStep','attributes','activation_creating','createJourneySegment','data','connection','effectiveFolderId','journeyById','812002JFxABx','kind','journey_creating','action','debug','map','folder','deleted','getSegment\x20failed\x20for\x20','existingSegments','existingJourney','diff','conditionTimeoutUnit','sort','activationsBySegmentId','from','skipSegments','size','index','all','deleteActivation','entry_criteria','segmentFolderId','values','withProgress','name','stages','match','run_after_journey_refresh','getLatestJourneyId','logDeleted','behavior','271368VxuBqP','Segment\x20not\x20found','1707990MIHGsL','activation_updating','deps','item','exitCriterias','Created\x20folder\x20\x27','has','activations',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','SEGMENT_UPDATE_ERROR','1lUKufs','\x20error(s)','createdSegmentId','3503065XZInUd','journey_created','toLowerCase','idToEmailMap','max','./journey-yaml.js','parse','connector_config','Updated\x20activation\x20\x27','startsWith','journeyBundleId','split','ACTIVATION_SYNTAX_ERROR','activationContext','\x27\x20decision\x20point\x20branch\x20\x27','get','Deleted\x20segment\x20\x27','createFolder','rootFolderId','all_columns','segmentNameToId','replace','Matched\x20server\x20segment\x20\x27','keys','yamlActivation','entryCriteria','getSegmentEntity','createActivation','object','Activation','Created\x20journey\x20\x27','resolveSegment','activationActions','\x0a\x20\x20','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','list','355280AfTxFi','Failed\x20to\x20fetch\x20referenced\x20segment\x20','NOT_FOUND','journey_entry_criteria_','trim','Updating\x20segment\x20\x27','\x20journey\x20from\x20file:\x20','Journey\x20\x27','./child-segment-yaml.js','errors','\x27\x20from\x20file:\x20','activation_template_id','updated','../../utils/async.js','journey','type','goal\x20criteria','reduce','Activation\x20not\x20found:\x20','isNew','segment_deleted','SEGMENT_SYNTAX_ERROR','segmentId','folder_created','journeyBundleName','notification','activation_created','steps','nameToType','activation_updated','update','activationStepsById','segment_updating','.$1.push-recovery.json','connectionIdToNameMap','relative','goal','toISOString','parseDocument','Deleted\x20activation\x20\x27','milestone','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','JOURNEY_UPDATE_ERROR','activationParams','Delete\x20the\x20push\x20recovery\x20file\x20(','fetchJourney','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Segment\x20not\x20found:\x20','buildUserMaps','some','Failed\x20to\x20resolve\x20segment\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','embedded_segment_created','333JXnkem','entries','add','filter','day','Failed\x20to\x20resolve\x20activation\x20','embedded_activation_created','parentSegmentFolder','folderPathToId','resolvedRule','rule','parentId','idToName','\x20segment\x20from\x20file:\x20','conditionTimeoutDuration','ACTIVATION_UPDATE_ERROR','Updating\x20activation\x20\x27','WaitStep','logWarning','waitStepUnit','getSegmentEntity\x20also\x20failed\x20for\x20','conditionSegmentId','columns','logInfo','1523388WadKEB','journeyActivationStepId','valid','activation_','segmentByFolderAndName','existingSegment','__pending_act_','toString','journey_updated','onProgress','yamlConfig','create','set','folderId','Creating\x20folder\x20\x27','existingActivation','segment','createSegment','state','journeys','find','INTERNAL','listActivations','DecisionPoint','segments','segment_created','\x20(referenced\x20in\x20journey\x20','stringify','Creating\x20segment\x20\x27','logSuccess','\x27\x20exit\x20criteria','waitStepType'];a136_0x3ed0=function(){return _0x4d9629;};return a136_0x3ed0();}export async function executePushSegmentDeletions(_0x23d8c6,_0x181b2d,_0x174392){const _0x3f63fa=a136_0x357cba;if(_0x181b2d[_0x3f63fa(0x2b3)]===0x0)return 0x0;const {batchAsync:_0x8f167b}=await import(_0x3f63fa(0x22c)),_0x5219bd=0x5,_0x1fbe59=await _0x8f167b(_0x181b2d,async _0x246094=>{const _0x22cfc6=_0x3f63fa;return _0x174392[_0x22cfc6(0x275)]?.({'type':'segment_deleting','name':_0x246094[_0x22cfc6(0x2e8)]}),await _0x23d8c6[_0x22cfc6(0x27c)]['deleteSegment'](_0x246094['id']),_0x174392[_0x22cfc6(0x275)]?.({'type':_0x22cfc6(0x233),'name':_0x246094['name']}),_0x174392[_0x22cfc6(0x2ed)]?.(_0x22cfc6(0x20b)+_0x246094[_0x22cfc6(0x2e8)]+'\x27'),0x1;},_0x5219bd);return _0x1fbe59[_0x3f63fa(0x230)]((_0x189325,_0x40523e)=>_0x189325+_0x40523e,0x0);}export async function executePushJourneys(_0x571193,_0xfd2ca9,_0x1a237b,_0x6d0a12,_0x55a10c){const _0x5b74d3=a136_0x357cba,{journeyDefToRequest:_0x1c2578}=await import(_0x5b74d3(0x200)),{activationDefToCreateRequest:_0x208b6b,yamlRuleToApi:_0x319d18,validateSegmentRule:_0x342be}=await import(_0x5b74d3(0x227)),_0x4151a5={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x49798e=new Map(_0x1a237b[_0x5b74d3(0x20f)]),_0x38f6c8=0x5;for(let _0x2f73b2=0x0;_0x2f73b2<_0xfd2ca9[_0x5b74d3(0x2b3)];_0x2f73b2+=_0x38f6c8){const _0x102e12=_0xfd2ca9[_0x5b74d3(0x29b)](_0x2f73b2,_0x2f73b2+_0x38f6c8),_0x25f1a9=await Promise['all'](_0x102e12['map'](async _0x4e6227=>{const _0x29bd6b=_0x5b74d3;if(!_0x4e6227[_0x29bd6b(0x232)]&&!_0x4e6227[_0x29bd6b(0x2ab)])return{'action':'unchanged','name':_0x4e6227[_0x29bd6b(0x276)][_0x29bd6b(0x2e8)],'journeyId':_0x4e6227[_0x29bd6b(0x2d9)]?.['id']};const _0x2b119f=_0x4e6227[_0x29bd6b(0x29d)]?_0x1a237b[_0x29bd6b(0x25c)][_0x29bd6b(0x20a)](_0x4e6227[_0x29bd6b(0x29d)]):undefined;_0x55a10c[_0x29bd6b(0x275)]?.({'type':_0x4e6227[_0x29bd6b(0x232)]?_0x29bd6b(0x2d1):_0x29bd6b(0x298),'name':_0x4e6227[_0x29bd6b(0x276)][_0x29bd6b(0x2e8)]});try{const _0x257fd8=await executeSingleJourneyPush(_0x571193,_0x4e6227,{..._0x1a237b,'segmentNameToId':_0x49798e},{'parentId':_0x6d0a12[_0x29bd6b(0x25f)],'rootFolderId':_0x6d0a12[_0x29bd6b(0x20d)],'folderId':_0x2b119f,'verbose':_0x6d0a12['verbose']},_0x55a10c,{'journeyDefToRequest':_0x1c2578,'activationDefToCreateRequest':_0x208b6b,'yamlRuleToApi':_0x319d18,'validateSegmentRule':_0x342be});for(const [_0x3442d6,_0x31e941]of _0x257fd8[_0x29bd6b(0x2a0)]){_0x49798e[_0x29bd6b(0x278)](_0x3442d6,_0x31e941),_0x4151a5[_0x29bd6b(0x2a0)][_0x29bd6b(0x278)](_0x3442d6,_0x31e941);}if(_0x257fd8['action']===_0x29bd6b(0x28c))_0x55a10c['onProgress']?.({'type':_0x29bd6b(0x1fc),'name':_0x4e6227['yamlConfig'][_0x29bd6b(0x2e8)],'journeyId':_0x257fd8[_0x29bd6b(0x29f)]}),_0x55a10c[_0x29bd6b(0x289)]?.(_0x29bd6b(0x219)+_0x4e6227['yamlConfig'][_0x29bd6b(0x2e8)]+'\x27'),_0x4151a5['created']++;else _0x257fd8[_0x29bd6b(0x2d2)]===_0x29bd6b(0x22b)&&(_0x55a10c[_0x29bd6b(0x275)]?.({'type':_0x29bd6b(0x274),'name':_0x4e6227[_0x29bd6b(0x276)][_0x29bd6b(0x2e8)]}),_0x55a10c[_0x29bd6b(0x289)]?.('Updated\x20journey\x20\x27'+_0x4e6227[_0x29bd6b(0x276)][_0x29bd6b(0x2e8)]+'\x27'),_0x4151a5[_0x29bd6b(0x22b)]++);return{'action':_0x257fd8[_0x29bd6b(0x2d2)],'name':_0x4e6227[_0x29bd6b(0x276)][_0x29bd6b(0x2e8)],'journeyId':_0x257fd8[_0x29bd6b(0x29f)]};}catch(_0x20755b){const _0x54437b=isHttp400Error(_0x20755b),_0x34ffad=_0x54437b?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x29bd6b(0x249)],_0x1d2723=getErrorMessage(_0x20755b);throw new SDKError(_0x34ffad,_0x29bd6b(0x2af)+(_0x4e6227[_0x29bd6b(0x232)]?_0x29bd6b(0x277):'update')+_0x29bd6b(0x225)+_0x4e6227[_0x29bd6b(0x2b5)]+_0x29bd6b(0x21c)+_0x1d2723,_0x20755b);}}));_0x4151a5['results'][_0x5b74d3(0x2b9)](..._0x25f1a9);}return _0x4151a5;}async function matchExistingJourneySegments(_0x1769cf,_0x2ddc94,_0x240ae3,_0x2cd3b1,_0xa964ed){const _0x1b9541=a136_0x357cba;if(!_0x2ddc94[_0x1b9541(0x2d9)]||!_0x2ddc94[_0x1b9541(0x276)]['segments'])return;const _0x44de4d=new Map(),_0x5f0bde=new Set();for(const _0x2a2c15 of Object[_0x1b9541(0x212)](_0x2ddc94['yamlConfig'][_0x1b9541(0x284)])){const _0x70f3a5=generateDeterministicJourneySegmentName(_0x2ddc94[_0x1b9541(0x276)][_0x1b9541(0x2e8)],_0x2a2c15);_0x44de4d[_0x1b9541(0x278)](_0x70f3a5,_0x2a2c15),_0x5f0bde[_0x1b9541(0x256)](_0x2a2c15);}const _0x1fbe3d=[],_0x7b8520=collectSegmentIdsFromJourneyApi(_0x2ddc94[_0x1b9541(0x2d9)]);for(const _0x3b4e7a of _0x7b8520){const _0x447bbf=await fetchSegment(_0x1769cf,_0x240ae3,_0x3b4e7a,_0x2cd3b1);if(!_0x447bbf?.['name'])continue;const _0x4f8734=_0x44de4d[_0x1b9541(0x20a)](_0x447bbf[_0x1b9541(0x2e8)]);_0x4f8734?(_0xa964ed[_0x1b9541(0x278)](_0x4f8734,_0x3b4e7a),_0x5f0bde[_0x1b9541(0x291)](_0x4f8734)):_0x1fbe3d['push']({'id':_0x3b4e7a,'seg':_0x447bbf});}if(_0x5f0bde[_0x1b9541(0x2e0)]>0x0&&_0x1fbe3d[_0x1b9541(0x2b3)]>0x0){const {localExpandedRuleToNames:_0x2ca58c}=buildLocalExpandedRuleMappings(_0x2ddc94[_0x1b9541(0x276)]),_0x7149ee=new Map();for(const {id:_0x2e3930,seg:_0x22e719}of _0x1fbe3d){if(_0x22e719[_0x1b9541(0x25e)]){const _0x2b17bb=apiRuleToYaml(_0x22e719[_0x1b9541(0x25e)]);_0x7149ee[_0x1b9541(0x278)](_0x2e3930,_0x2b17bb);}}for(const {id:_0x491491,seg:_0x3fcedf}of _0x1fbe3d){if(!_0x3fcedf['rule'])continue;const _0x457d9f=_0x7149ee[_0x1b9541(0x20a)](_0x491491);if(!_0x457d9f)continue;const _0x5a2cd0=serializeExpandedRule(_0x457d9f,_0x7149ee),_0x141f1=_0x2ca58c[_0x1b9541(0x20a)](_0x5a2cd0);if(_0x141f1){const _0x4fff46=_0x141f1[_0x1b9541(0x280)](_0x1d27ed=>_0x5f0bde[_0x1b9541(0x1f4)](_0x1d27ed));_0x4fff46&&(_0xa964ed[_0x1b9541(0x278)](_0x4fff46,_0x491491),_0x5f0bde[_0x1b9541(0x291)](_0x4fff46),logger['debug'](_0x1b9541(0x211)+_0x3fcedf[_0x1b9541(0x2e8)]+'\x27\x20to\x20local\x20\x27'+_0x4fff46+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x5659e7,_0x51c86b,_0x400b80,_0xf469b7,_0x2d9e67,_0x96003){const _0x11d149=a136_0x357cba,{journeyDefToRequest:_0x420c1f,activationDefToCreateRequest:_0x3d8bb6,yamlRuleToApi:_0x138e65,validateSegmentRule:_0x3ca05b}=_0x96003,_0x5b4c84=new Map(),_0x10473b=new Map();recoverSegmentIdsFromPushRecovery(_0x51c86b,_0x5b4c84,_0x400b80[_0x11d149(0x20f)]);const _0x694cd2=new Map(),_0x448c64=new Map(),_0x133f4d=new Map();let _0x10777f;const _0x2f8981=async()=>{const _0x4a00f8=_0x11d149;if(_0x10777f)return;_0x10777f=new Map();if(!_0x51c86b[_0x4a00f8(0x2d9)])return;const _0x3d3bd9=await _0x5659e7['journey'][_0x4a00f8(0x282)](_0x51c86b[_0x4a00f8(0x2d9)]['id']);for(const _0x12f520 of _0x3d3bd9){const _0x3b377c=journeyActivationStepToYaml(_0x12f520,_0x400b80[_0x4a00f8(0x1fe)],_0x400b80[_0x4a00f8(0x241)]),_0x38a43c=activationSignature(_0x3b377c);!_0x10777f['has'](_0x38a43c)&&_0x10777f[_0x4a00f8(0x278)](_0x38a43c,_0x12f520['id']),_0x3b377c[_0x4a00f8(0x2e8)]&&_0x10473b[_0x4a00f8(0x278)](_0x3b377c[_0x4a00f8(0x2e8)],_0x12f520['id']);}};await matchExistingJourneySegments(_0x5659e7,_0x51c86b,_0xf469b7[_0x11d149(0x25f)],_0x400b80[_0x11d149(0x2d8)],_0x400b80['segmentNameToId']);const _0x323372={'resolveSegmentId':async _0x2d908a=>{const _0x493ea3=_0x11d149,_0xd90142=_0x400b80['segmentNameToId'][_0x493ea3(0x20a)](_0x2d908a);if(!_0xd90142)throw new SDKError(ErrorCode[_0x493ea3(0x2a1)],_0x493ea3(0x24e)+_0x2d908a+_0x493ea3(0x286)+_0x51c86b['yamlConfig'][_0x493ea3(0x2e8)]+')');return _0xd90142;},'resolveEmbeddedSegmentId':async(_0x1a8b4c,_0x1b015d)=>{const _0x3ab9e6=_0x11d149,_0x1a52c4=_0x400b80[_0x3ab9e6(0x20f)][_0x3ab9e6(0x20a)](_0x1a8b4c);if(_0x1a52c4)return _0x1a52c4;const _0x747c90=_0x400b80[_0x3ab9e6(0x2d8)][_0x3ab9e6(0x280)](_0x32df10=>_0x32df10[_0x3ab9e6(0x2e8)]===_0x1a8b4c);if(_0x747c90)return _0x400b80[_0x3ab9e6(0x20f)][_0x3ab9e6(0x278)](_0x1a8b4c,_0x747c90['id']),_0x747c90['id'];if(_0x51c86b[_0x3ab9e6(0x232)]){const {stageName:_0x4b5103,criteriaName:_0x2f1c31}=findSegmentCriteriaLocation(_0x51c86b[_0x3ab9e6(0x276)],_0x1a8b4c);return _0x3ca05b(_0x1a8b4c,_0x1b015d[_0x3ab9e6(0x25e)]),_0x448c64[_0x3ab9e6(0x278)](_0x1a8b4c,{'definition':_0x1b015d,'stageName':_0x4b5103,'criteriaName':_0x2f1c31}),createPendingSegmentId(_0x1a8b4c);}const _0xb4dece=_0x51c86b[_0x3ab9e6(0x2d9)]?.['id'];if(!_0xb4dece)throw new SDKError(ErrorCode[_0x3ab9e6(0x281)],_0x3ab9e6(0x2b4));const _0x56af47=_0x694cd2[_0x3ab9e6(0x20a)](_0x1a8b4c);if(_0x56af47)return _0x56af47;const _0x2c0dfb=((async()=>{const _0x1aa12c=_0x3ab9e6;_0x3ca05b(_0x1a8b4c,_0x1b015d[_0x1aa12c(0x25e)]);const _0x13d424=generateDeterministicJourneySegmentName(_0x51c86b['yamlConfig'][_0x1aa12c(0x2e8)],_0x1a8b4c),_0x1d5322=_0x400b80['existingSegments'][_0x1aa12c(0x280)](_0x57802e=>_0x57802e['name']===_0x13d424),_0x16169c=createSegmentIdResolver(_0x400b80[_0x1aa12c(0x20f)],_0x1a8b4c),_0x1f6c3a=await resolveRuleSegmentIds(_0x1b015d['rule'],_0x16169c);let _0x39e9ff;return _0x1d5322?(await _0x5659e7[_0x1aa12c(0x27c)][_0x1aa12c(0x2a5)](_0xf469b7[_0x1aa12c(0x25f)],_0x1d5322['id'],{'description':_0x1b015d[_0x1aa12c(0x2a7)]||'Entry\x20criteria:\x20'+_0x1a8b4c,'rule':_0x138e65(_0x1f6c3a,!![]),'countPopulation':!![]}),_0x39e9ff=_0x1d5322['id'],saveSegmentToPushRecovery(_0x51c86b[_0x1aa12c(0x2b5)],_0x51c86b[_0x1aa12c(0x276)][_0x1aa12c(0x2e8)],_0x1a8b4c,{'segmentId':_0x39e9ff,'uniqueServerName':_0x13d424,'createdAt':new Date()[_0x1aa12c(0x244)]()})):_0x39e9ff=await createOrRecoverEmbeddedSegment(_0x5659e7,_0x51c86b,{'localName':_0x1a8b4c,'uniqueSegmentName':_0x13d424,'description':_0x1b015d['description']||_0x1aa12c(0x2c4)+_0x1a8b4c,'journeyId':_0xb4dece,'resolvedRule':_0x1f6c3a,'parentId':_0xf469b7[_0x1aa12c(0x25f)],'folderId':_0xf469b7[_0x1aa12c(0x20d)]||''},_0x138e65),_0x400b80[_0x1aa12c(0x20f)]['set'](_0x1a8b4c,_0x39e9ff),_0x5b4c84[_0x1aa12c(0x278)](_0x1a8b4c,_0x39e9ff),_0x39e9ff;})());_0x694cd2[_0x3ab9e6(0x278)](_0x1a8b4c,_0x2c0dfb);try{return await _0x2c0dfb;}finally{_0x694cd2[_0x3ab9e6(0x291)](_0x1a8b4c);}},'resolveActivationId':async _0x486cdc=>{const _0x3efab9=_0x11d149,_0x1fb970=_0x10473b[_0x3efab9(0x20a)](_0x486cdc);if(_0x1fb970)return _0x1fb970;if(_0x51c86b[_0x3efab9(0x2d9)]){await _0x2f8981();const _0x6cc5ba=_0x10473b[_0x3efab9(0x20a)](_0x486cdc);if(_0x6cc5ba)return _0x6cc5ba;}throw new SDKError(ErrorCode[_0x3efab9(0x221)],_0x3efab9(0x231)+_0x486cdc+'\x20(referenced\x20in\x20journey\x20'+_0x51c86b[_0x3efab9(0x276)][_0x3efab9(0x2e8)]+').\x20'+_0x3efab9(0x252));},'resolveEmbeddedActivationId':async(_0x130cb9,_0x4129b4)=>{const _0x115490=_0x11d149,_0x1fca22=_0x10473b[_0x115490(0x20a)](_0x130cb9);if(_0x1fca22)return _0x1fca22;if(_0x51c86b[_0x115490(0x232)])return _0x133f4d[_0x115490(0x278)](_0x130cb9,_0x4129b4),createPendingActivationId(_0x130cb9);if(_0x51c86b[_0x115490(0x2d9)]){await _0x2f8981();const _0x57f50a=_0x10473b[_0x115490(0x20a)](_0x4129b4[_0x115490(0x2e8)]);if(_0x57f50a)return _0x10473b['set'](_0x130cb9,_0x57f50a),_0x57f50a;const _0x1539f2=activationSignature(_0x4129b4),_0x2218e7=_0x10777f?.[_0x115490(0x20a)](_0x1539f2);if(_0x2218e7)return _0x10473b[_0x115490(0x278)](_0x130cb9,_0x2218e7),_0x2218e7;const _0x3d73f5=await _0x3d8bb6(_0x4129b4,_0x400b80[_0x115490(0x208)]),_0x114762={..._0x3d73f5,..._0x4129b4[_0x115490(0x2eb)]!==undefined&&{'runAfterJourneyRefresh':_0x4129b4[_0x115490(0x2eb)]}},_0x5b5847=await _0x5659e7[_0x115490(0x22d)][_0x115490(0x216)](_0x51c86b[_0x115490(0x2d9)]['id'],_0x114762);return _0x10473b['set'](_0x130cb9,_0x5b5847['id']),_0x5b5847['id'];}throw new SDKError(ErrorCode[_0x115490(0x281)],_0x115490(0x24d));},'resolveJourneyId':async _0x4031fd=>{const _0x48854a=_0x11d149;try{return await _0x5659e7[_0x48854a(0x22d)]['resolveJourneyId'](_0xf469b7[_0x48854a(0x25f)],_0x4031fd);}catch(_0x537abc){throw new SDKError(ErrorCode['NOT_FOUND'],_0x48854a(0x226)+_0x4031fd+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x51c86b[_0x48854a(0x276)]['name']+'\x27)',_0x537abc);}},'resolveStageId':async(_0x3f6a64,_0x28ab39)=>{const _0x243ead=_0x11d149,_0x4a914e=await _0x5659e7[_0x243ead(0x22d)]['getJourney'](_0x3f6a64),_0xe2929c=_0x4a914e[_0x243ead(0x2c8)][_0x243ead(0x2b7)]['find'](_0x1d43ef=>_0x1d43ef[_0x243ead(0x2e8)][_0x243ead(0x1fd)]()===_0x28ab39[_0x243ead(0x1fd)]());if(!_0xe2929c?.['id'])throw new SDKError(ErrorCode[_0x243ead(0x221)],_0x243ead(0x2c5)+_0x28ab39+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x4a914e['attributes'][_0x243ead(0x237)]||_0x4a914e[_0x243ead(0x2c8)]['name'])+'\x27');return _0xe2929c['id'];}},_0xf3c417=await _0x420c1f(_0x51c86b[_0x11d149(0x276)],_0xf469b7[_0x11d149(0x25f)],_0x323372),_0xab7f9a=_0xf469b7['folderId']||_0xf469b7['rootFolderId'];_0xab7f9a&&(_0xf3c417['relationships']={'parentFolder':{'data':{'id':_0xab7f9a,'type':_0x11d149(0x2d5)}}});if(_0x51c86b[_0x11d149(0x232)]){if(_0x448c64[_0x11d149(0x2e0)]>0x0||_0x133f4d[_0x11d149(0x2e0)]>0x0)return await executeThreeStepJourneyCreate(_0x5659e7,_0x51c86b,_0xf3c417,{'pendingEmbeddedSegments':_0x448c64,'pendingEmbeddedActivations':_0x133f4d,'embeddedSegmentNameToId':_0x5b4c84,'journeyActivationNameToId':_0x10473b},{..._0xf469b7,'effectiveFolderId':_0xab7f9a},_0x400b80,_0x2d9e67,_0x96003);else{ensureJourneyDefaults(_0xf3c417[_0x11d149(0x2c8)]);const _0x4afd8f=await _0x5659e7[_0x11d149(0x22d)][_0x11d149(0x277)](_0xf3c417);return deletePushRecovery(_0x51c86b[_0x11d149(0x2b5)]),{'action':_0x11d149(0x28c),'journeyId':_0x4afd8f['id'],'embeddedSegmentNameToId':_0x5b4c84};}}else{if(_0x51c86b[_0x11d149(0x2ab)]&&_0x51c86b[_0x11d149(0x2d9)]){_0xf3c417['id']=_0x51c86b[_0x11d149(0x2d9)]['id'];const _0x28b475=_0xf3c417[_0x11d149(0x2c8)];_0x51c86b[_0x11d149(0x2d9)][_0x11d149(0x2c8)]?.[_0x11d149(0x237)]&&(_0x28b475['journeyBundleName']=_0x51c86b['existingJourney'][_0x11d149(0x2c8)][_0x11d149(0x237)]);const _0x49feaf=_0x51c86b[_0x11d149(0x2d9)]['attributes']?.['journeyStages'];return _0x49feaf&&_0xf3c417[_0x11d149(0x2c8)][_0x11d149(0x2b7)]&&injectExistingStageIds(_0xf3c417[_0x11d149(0x2c8)][_0x11d149(0x2b7)],_0x49feaf),ensureJourneyDefaults(_0x28b475),await _0x5659e7[_0x11d149(0x22d)][_0x11d149(0x23d)](_0x51c86b[_0x11d149(0x2d9)]['id'],_0xf3c417),deletePushRecovery(_0x51c86b[_0x11d149(0x2b5)]),{'action':_0x11d149(0x22b),'journeyId':_0x51c86b[_0x11d149(0x2d9)]['id'],'embeddedSegmentNameToId':_0x5b4c84};}}return deletePushRecovery(_0x51c86b['absolutePath']),{'action':'unchanged','journeyId':_0x51c86b[_0x11d149(0x2d9)]?.['id'],'embeddedSegmentNameToId':_0x5b4c84};}function findSegmentCriteriaLocation(_0x12b31c,_0x554d05){const _0x4fd2f4=a136_0x357cba,_0x548391=_0x12b31c[_0x4fd2f4(0x2e9)]||_0x12b31c[_0x4fd2f4(0x27f)]?.[0x0]?.[_0x4fd2f4(0x2e9)]||[];let _0x58f209='entry',_0x2d5aa6=_0x554d05;const _0x4f9618=_0x12b31c[_0x4fd2f4(0x243)]||_0x12b31c[_0x4fd2f4(0x27f)]?.[0x0]?.[_0x4fd2f4(0x243)];if(_0x4f9618?.[_0x4fd2f4(0x27c)]===_0x554d05)return{'stageName':'goal','criteriaName':_0x4f9618[_0x4fd2f4(0x2e8)]||_0x554d05};_0x411b94:for(const _0x458c32 of _0x548391){if(_0x458c32[_0x4fd2f4(0x2e4)]?.['segment']===_0x554d05){_0x58f209=_0x458c32['name'],_0x2d5aa6=_0x458c32[_0x4fd2f4(0x2e4)]['name']||_0x554d05;break;}if(_0x458c32[_0x4fd2f4(0x23a)])for(const _0x16978b of _0x458c32[_0x4fd2f4(0x23a)]){if(_0x16978b[_0x4fd2f4(0x22e)]===_0x4fd2f4(0x2be)&&_0x16978b[_0x4fd2f4(0x297)]?.[_0x4fd2f4(0x2c1)])for(const _0xbf468d of _0x16978b[_0x4fd2f4(0x297)][_0x4fd2f4(0x2c1)]){if(_0xbf468d['segment']===_0x554d05){_0x58f209=_0x458c32['name'],_0x2d5aa6=_0xbf468d['name']||_0x554d05;break _0x411b94;}}}}return{'stageName':_0x58f209,'criteriaName':_0x2d5aa6};}async function executeThreeStepJourneyCreate(_0x2cdf02,_0x2e5055,_0x520e13,_0x2d9f97,_0x454dab,_0xa55d22,_0x509397,_0x2deb42){const _0x215707=a136_0x357cba,{activationDefToCreateRequest:_0x2ef6ea,yamlRuleToApi:_0x58da24}=_0x2deb42,{pendingEmbeddedSegments:_0x41e1f4,pendingEmbeddedActivations:_0xde01de,embeddedSegmentNameToId:_0x1c4a09}=_0x2d9f97,_0x3cf802=JSON[_0x215707(0x201)](JSON['stringify'](_0x520e13));ensureJourneyDefaults(_0x3cf802[_0x215707(0x2c8)]),stripPendingIds(_0x3cf802);const _0x56e07c=await _0x2cdf02[_0x215707(0x22d)][_0x215707(0x277)](_0x3cf802),_0x28f3c2=_0x56e07c['id'],_0x1ba680=new Map();for(const _0x4a118b of _0x56e07c[_0x215707(0x2c8)]['journeyStages']){_0x1ba680[_0x215707(0x278)](_0x4a118b[_0x215707(0x2e8)][_0x215707(0x1fd)](),_0x4a118b['id']);}recoverSegmentIdsFromPushRecovery(_0x2e5055,_0x1c4a09,_0xa55d22[_0x215707(0x20f)]);for(const [_0x2b831b,{definition:_0xd2dfc6}]of _0x41e1f4){if(_0x1c4a09[_0x215707(0x1f4)](_0x2b831b)){_0x509397[_0x215707(0x275)]?.({'type':_0x215707(0x253),'journeyName':_0x2e5055[_0x215707(0x276)][_0x215707(0x2e8)],'segmentName':_0x2b831b});continue;}const _0x1c117a=generateDeterministicJourneySegmentName(_0x2e5055['yamlConfig'][_0x215707(0x2e8)],_0x2b831b);_0x509397[_0x215707(0x275)]?.({'type':'embedded_segment_creating','journeyName':_0x2e5055[_0x215707(0x276)][_0x215707(0x2e8)],'segmentName':_0x2b831b});const _0x230c10=createSegmentIdResolver(_0xa55d22[_0x215707(0x20f)],_0x2b831b),_0x31b25d=await resolveRuleSegmentIds(_0xd2dfc6[_0x215707(0x25e)],_0x230c10),_0x48ce8b=await createOrRecoverEmbeddedSegment(_0x2cdf02,_0x2e5055,{'localName':_0x2b831b,'uniqueSegmentName':_0x1c117a,'description':_0xd2dfc6['description']||'Entry\x20criteria:\x20'+_0x2b831b,'journeyId':_0x28f3c2,'resolvedRule':_0x31b25d,'parentId':_0x454dab['parentId'],'folderId':_0x454dab[_0x215707(0x2cd)]||''},_0x58da24);_0x1c4a09[_0x215707(0x278)](_0x2b831b,_0x48ce8b),_0xa55d22[_0x215707(0x20f)][_0x215707(0x278)](_0x2b831b,_0x48ce8b),_0x509397[_0x215707(0x275)]?.({'type':'embedded_segment_created','journeyName':_0x2e5055['yamlConfig']['name'],'segmentName':_0x2b831b});}const _0x35523b=new Map();for(const [_0xa815be,_0x3a110c]of _0xde01de){_0x509397[_0x215707(0x275)]?.({'type':_0x215707(0x2c3),'journeyName':_0x2e5055[_0x215707(0x276)][_0x215707(0x2e8)],'activationName':_0xa815be});const _0x1172b1=await _0x2ef6ea(_0x3a110c,_0xa55d22[_0x215707(0x208)]),_0x3d7814={..._0x1172b1,..._0x3a110c[_0x215707(0x2eb)]!==undefined&&{'runAfterJourneyRefresh':_0x3a110c['run_after_journey_refresh']}},_0x24afb0=await _0x2cdf02[_0x215707(0x22d)][_0x215707(0x216)](_0x28f3c2,_0x3d7814);_0x35523b['set'](_0xa815be,_0x24afb0['id']),_0x2d9f97[_0x215707(0x294)][_0x215707(0x278)](_0xa815be,_0x24afb0['id']),_0x509397['onProgress']?.({'type':_0x215707(0x25a),'journeyName':_0x2e5055[_0x215707(0x276)]['name'],'activationName':_0xa815be});}const _0x532aac=JSON['parse'](JSON['stringify'](_0x520e13));return _0x532aac['id']=_0x28f3c2,ensureJourneyDefaults(_0x532aac[_0x215707(0x2c8)]),resolvePendingIdsInRequest(_0x532aac,_0x520e13,_0x1ba680,_0x1c4a09,_0x35523b,_0x509397),await _0x2cdf02['journey'][_0x215707(0x23d)](_0x28f3c2,_0x532aac),deletePushRecovery(_0x2e5055['absolutePath']),{'action':'created','journeyId':_0x28f3c2,'embeddedSegmentNameToId':_0x1c4a09};}export function stripWaitStepPendingIds(_0xef56bc){const _0x17e040=a136_0x357cba,_0x5d8ff5=_0xef56bc[_0x17e040(0x269)]&&isPendingSegmentId(_0xef56bc[_0x17e040(0x269)]),_0x412cc3=_0xef56bc['conditions']?.['some'](_0x5edc28=>_0x5edc28['segmentId']&&isPendingSegmentId(_0x5edc28[_0x17e040(0x235)]));(_0x5d8ff5||_0x412cc3)&&(_0xef56bc[_0x17e040(0x28b)]='Duration',_0xef56bc[_0x17e040(0x2c7)]=0x1,_0xef56bc[_0x17e040(0x267)]=_0x17e040(0x258),delete _0xef56bc[_0x17e040(0x269)],delete _0xef56bc[_0x17e040(0x262)],delete _0xef56bc[_0x17e040(0x2db)],delete _0xef56bc[_0x17e040(0x2a4)]);}export function resolveWaitStepPendingIds(_0x130a28,_0x5c55c7,_0x580aa2,_0x42d91b){const _0x454bfc=a136_0x357cba;if(_0x5c55c7[_0x454bfc(0x269)]&&isPendingSegmentId(_0x5c55c7[_0x454bfc(0x269)])){const _0x50eea5=_0x580aa2(_0x5c55c7[_0x454bfc(0x269)],_0x454bfc(0x2bf)+_0x42d91b+'\x27\x20wait\x20condition');_0x50eea5&&(_0x130a28[_0x454bfc(0x28b)]='Condition',_0x130a28[_0x454bfc(0x269)]=_0x50eea5,delete _0x130a28['waitStep'],delete _0x130a28[_0x454bfc(0x267)],_0x5c55c7[_0x454bfc(0x262)]!==undefined&&(_0x130a28[_0x454bfc(0x262)]=_0x5c55c7['conditionTimeoutDuration']),_0x5c55c7[_0x454bfc(0x2db)]&&(_0x130a28[_0x454bfc(0x2db)]=_0x5c55c7[_0x454bfc(0x2db)]));}if(_0x5c55c7[_0x454bfc(0x2a4)]){const _0x5aebe8=_0x5c55c7[_0x454bfc(0x2a4)][_0x454bfc(0x250)](_0xba90f4=>_0xba90f4[_0x454bfc(0x235)]&&isPendingSegmentId(_0xba90f4[_0x454bfc(0x235)]));if(_0x5aebe8){const _0x409ac9=_0x5c55c7[_0x454bfc(0x2a4)]['map'](_0x783f3d=>{const _0x425acd=_0x454bfc;if(_0x783f3d[_0x425acd(0x235)]&&isPendingSegmentId(_0x783f3d[_0x425acd(0x235)])){const _0x2860f8=_0x580aa2(_0x783f3d[_0x425acd(0x235)],'stage\x20\x27'+_0x42d91b+_0x425acd(0x2b8));return{..._0x783f3d,'segmentId':_0x2860f8||_0x783f3d['segmentId']};}return{..._0x783f3d};});_0x130a28[_0x454bfc(0x28b)]='Condition',_0x130a28['conditions']=_0x409ac9,delete _0x130a28[_0x454bfc(0x2c7)],delete _0x130a28[_0x454bfc(0x267)],delete _0x130a28[_0x454bfc(0x269)],delete _0x130a28[_0x454bfc(0x262)],delete _0x130a28['conditionTimeoutUnit'];}}}function stripPendingIds(_0x4f21b4){const _0x12efc5=a136_0x357cba;_0x4f21b4[_0x12efc5(0x2c8)]['goal']?.[_0x12efc5(0x235)]&&isPendingSegmentId(_0x4f21b4['attributes'][_0x12efc5(0x243)][_0x12efc5(0x235)])&&delete _0x4f21b4[_0x12efc5(0x2c8)][_0x12efc5(0x243)];for(const _0x38ab35 of _0x4f21b4['attributes']['journeyStages']||[]){_0x38ab35['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x38ab35[_0x12efc5(0x214)][_0x12efc5(0x235)])&&delete _0x38ab35[_0x12efc5(0x214)];_0x38ab35[_0x12efc5(0x247)]?.[_0x12efc5(0x235)]&&isPendingSegmentId(_0x38ab35['milestone'][_0x12efc5(0x235)])&&delete _0x38ab35[_0x12efc5(0x247)];_0x38ab35[_0x12efc5(0x2f5)]&&(_0x38ab35[_0x12efc5(0x2f5)]=_0x38ab35[_0x12efc5(0x2f5)][_0x12efc5(0x257)](_0x22ba77=>!_0x22ba77[_0x12efc5(0x235)]||!isPendingSegmentId(_0x22ba77[_0x12efc5(0x235)])));if(_0x38ab35['steps'])for(const _0x1131d6 of Object[_0x12efc5(0x212)](_0x38ab35[_0x12efc5(0x23a)])){const _0x589bf8=_0x38ab35[_0x12efc5(0x23a)][_0x1131d6];_0x589bf8[_0x12efc5(0x22e)]===_0x12efc5(0x218)&&_0x589bf8[_0x12efc5(0x26d)]&&isPendingActivationId(_0x589bf8['journeyActivationStepId'])&&(_0x589bf8[_0x12efc5(0x26d)]='');if(_0x589bf8[_0x12efc5(0x22e)]===_0x12efc5(0x283)&&_0x589bf8['branches'])for(const _0x2791f9 of _0x589bf8[_0x12efc5(0x2c1)]){_0x2791f9[_0x12efc5(0x235)]&&isPendingSegmentId(_0x2791f9['segmentId'])&&(_0x2791f9[_0x12efc5(0x235)]='');}_0x589bf8[_0x12efc5(0x22e)]==='WaitStep'&&stripWaitStepPendingIds(_0x589bf8);}}}function resolvePendingIdsInRequest(_0x56b79f,_0x590914,_0x4c3b66,_0x3c2d7d,_0x35b2ee,_0x440f6c){const _0x78b3d5=a136_0x357cba,_0x5801cf=(_0x222240,_0x189e83)=>{const _0x210dae=a136_0x1e1e;if(!isPendingSegmentId(_0x222240))return _0x222240;const _0x30a0c1=extractPendingSegmentName(_0x222240),_0xf4c150=_0x3c2d7d[_0x210dae(0x20a)](_0x30a0c1);return!_0xf4c150&&_0x440f6c[_0x210dae(0x266)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x30a0c1+_0x210dae(0x2ad)+_0x189e83),_0xf4c150;};if(_0x56b79f[_0x78b3d5(0x2c8)]['goal']?.[_0x78b3d5(0x235)]&&isPendingSegmentId(_0x56b79f['attributes'][_0x78b3d5(0x243)]['segmentId'])){const _0x2a37eb=_0x5801cf(_0x56b79f[_0x78b3d5(0x2c8)]['goal'][_0x78b3d5(0x235)],_0x78b3d5(0x22f));_0x2a37eb&&(_0x56b79f[_0x78b3d5(0x2c8)][_0x78b3d5(0x243)][_0x78b3d5(0x235)]=_0x2a37eb);}for(const _0xce16de of _0x56b79f['attributes'][_0x78b3d5(0x2b7)]||[]){const _0x202ac2=_0x4c3b66['get'](_0xce16de['name']['toLowerCase']());_0x202ac2&&(_0xce16de['id']=_0x202ac2);if(_0xce16de['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0xce16de['entryCriteria'][_0x78b3d5(0x235)])){const _0x57c233=_0x5801cf(_0xce16de[_0x78b3d5(0x214)][_0x78b3d5(0x235)],_0x78b3d5(0x2bf)+_0xce16de['name']+_0x78b3d5(0x2bc));_0x57c233&&(_0xce16de[_0x78b3d5(0x214)][_0x78b3d5(0x235)]=_0x57c233);}if(_0xce16de['exitCriterias'])for(const _0x57be8c of _0xce16de[_0x78b3d5(0x2f5)]){if(_0x57be8c['segmentId']&&isPendingSegmentId(_0x57be8c[_0x78b3d5(0x235)])){const _0x469661=_0x5801cf(_0x57be8c[_0x78b3d5(0x235)],'stage\x20\x27'+_0xce16de['name']+_0x78b3d5(0x28a));_0x469661&&(_0x57be8c[_0x78b3d5(0x235)]=_0x469661);}}if(_0xce16de[_0x78b3d5(0x247)]?.['segmentId']&&isPendingSegmentId(_0xce16de[_0x78b3d5(0x247)][_0x78b3d5(0x235)])){const _0x397bfd=_0x5801cf(_0xce16de[_0x78b3d5(0x247)][_0x78b3d5(0x235)],_0x78b3d5(0x2bf)+_0xce16de[_0x78b3d5(0x2e8)]+_0x78b3d5(0x2b6));_0x397bfd&&(_0xce16de[_0x78b3d5(0x247)]['segmentId']=_0x397bfd);}if(_0xce16de['steps']){const _0x55da2c=_0x4f2f80=>_0x590914[_0x78b3d5(0x2c8)]['journeyStages']?.[_0x78b3d5(0x280)](_0x184459=>_0x184459[_0x78b3d5(0x2e8)][_0x78b3d5(0x1fd)]()===_0xce16de['name'][_0x78b3d5(0x1fd)]())?.[_0x78b3d5(0x23a)]?.[_0x4f2f80];for(const _0x17dcde of Object['keys'](_0xce16de[_0x78b3d5(0x23a)])){const _0xc3f047=_0xce16de[_0x78b3d5(0x23a)][_0x17dcde],_0x59c21f=_0x55da2c(_0x17dcde);if(_0xc3f047['type']===_0x78b3d5(0x218)&&_0xc3f047[_0x78b3d5(0x26d)]&&(isPendingActivationId(_0xc3f047[_0x78b3d5(0x26d)])||_0xc3f047[_0x78b3d5(0x26d)]==='')){if(_0x59c21f?.['journeyActivationStepId']&&isPendingActivationId(_0x59c21f[_0x78b3d5(0x26d)])){const _0x4c72b4=extractPendingActivationName(_0x59c21f['journeyActivationStepId']),_0x57fde2=_0x35b2ee['get'](_0x4c72b4);_0x57fde2&&(_0xc3f047[_0x78b3d5(0x26d)]=_0x57fde2);}}if(_0xc3f047[_0x78b3d5(0x22e)]===_0x78b3d5(0x283)&&_0xc3f047[_0x78b3d5(0x2c1)]&&_0x59c21f?.[_0x78b3d5(0x2c1)])for(let _0x16c2f7=0x0;_0x16c2f7<_0xc3f047[_0x78b3d5(0x2c1)][_0x78b3d5(0x2b3)];_0x16c2f7++){const _0x825e74=_0xc3f047[_0x78b3d5(0x2c1)][_0x16c2f7],_0x1c5139=_0x59c21f[_0x78b3d5(0x2c1)][_0x16c2f7];if(_0x1c5139?.['segmentId']&&isPendingSegmentId(_0x1c5139[_0x78b3d5(0x235)])){const _0x457efe=_0x5801cf(_0x1c5139[_0x78b3d5(0x235)],_0x78b3d5(0x2bf)+_0xce16de[_0x78b3d5(0x2e8)]+_0x78b3d5(0x209)+(_0x825e74[_0x78b3d5(0x2e8)]||_0x16c2f7)+'\x27');_0x457efe&&(_0x825e74[_0x78b3d5(0x235)]=_0x457efe);}}_0xc3f047['type']==='WaitStep'&&_0x59c21f?.[_0x78b3d5(0x22e)]===_0x78b3d5(0x265)&&resolveWaitStepPendingIds(_0xc3f047,_0x59c21f,_0x5801cf,_0xce16de[_0x78b3d5(0x2e8)]);}}}}
@@ -1 +1 @@
1
- (function(_0x2fdb67,_0x43234c){const _0x8db63a=a137_0x1e2c,_0x45d1c5=_0x2fdb67();while(!![]){try{const _0x5ac817=-parseInt(_0x8db63a(0xdd))/0x1*(parseInt(_0x8db63a(0xd5))/0x2)+-parseInt(_0x8db63a(0xda))/0x3+parseInt(_0x8db63a(0xd6))/0x4*(parseInt(_0x8db63a(0xd2))/0x5)+parseInt(_0x8db63a(0xde))/0x6+-parseInt(_0x8db63a(0xdb))/0x7+-parseInt(_0x8db63a(0xd3))/0x8*(-parseInt(_0x8db63a(0xd1))/0x9)+parseInt(_0x8db63a(0xd8))/0xa;if(_0x5ac817===_0x43234c)break;else _0x45d1c5['push'](_0x45d1c5['shift']());}catch(_0x5064e9){_0x45d1c5['push'](_0x45d1c5['shift']());}}}(a137_0x4deb,0x6234b));export function buildFolderIdToPathMap(_0x42ac0c){const _0x1365d1=a137_0x1e2c,_0x4d38db=new Map(),_0x404776=new Map();for(const _0x5065b9 of _0x42ac0c){_0x404776[_0x1365d1(0xdc)](_0x5065b9['id'],_0x5065b9);}const _0xb46754=new Set();for(const _0x5f4d31 of _0x42ac0c){!_0x5f4d31[_0x1365d1(0xe0)]&&_0xb46754['add'](_0x5f4d31['id']);}function _0x5b5c1d(_0x2d4aca){const _0x12cac4=_0x1365d1;if(_0x4d38db[_0x12cac4(0xdf)](_0x2d4aca['id']))return _0x4d38db['get'](_0x2d4aca['id']);if(_0xb46754[_0x12cac4(0xdf)](_0x2d4aca['id']))return _0x4d38db[_0x12cac4(0xdc)](_0x2d4aca['id'],''),'';if(_0x2d4aca['parentFolderId']){const _0x8f8ea4=_0x404776['get'](_0x2d4aca[_0x12cac4(0xe0)]);if(_0x8f8ea4){const _0x193d49=_0x5b5c1d(_0x8f8ea4),_0x435e6e=_0x193d49?_0x193d49+'/'+_0x2d4aca[_0x12cac4(0xd7)]:_0x2d4aca['name'];return _0x4d38db[_0x12cac4(0xdc)](_0x2d4aca['id'],_0x435e6e),_0x435e6e;}}const _0x226c99=_0x2d4aca[_0x12cac4(0xd7)];return _0x4d38db['set'](_0x2d4aca['id'],_0x226c99),_0x226c99;}for(const _0x2d93f1 of _0x42ac0c){_0x5b5c1d(_0x2d93f1);}return _0x4d38db;}export function buildFolderPathToIdMap(_0x35c6fd){const _0x21e278=a137_0x1e2c,_0x47c990=new Map(),_0xdc2a8=new Map();for(const _0x55043a of _0x35c6fd){_0xdc2a8[_0x21e278(0xdc)](_0x55043a['id'],_0x55043a);}const _0x411cc9=new Set();for(const _0x4e8df8 of _0x35c6fd){!_0x4e8df8['parentFolderId']&&_0x411cc9[_0x21e278(0xd4)](_0x4e8df8['id']);}function _0x1c0586(_0x55c61b){const _0x4cc414=_0x21e278;if(_0x411cc9[_0x4cc414(0xdf)](_0x55c61b['id']))return'';if(_0x55c61b['parentFolderId']){const _0x63be2=_0xdc2a8[_0x4cc414(0xd9)](_0x55c61b['parentFolderId']);if(_0x63be2){const _0xc4955e=_0x1c0586(_0x63be2);return _0xc4955e?_0xc4955e+'/'+_0x55c61b[_0x4cc414(0xd7)]:_0x55c61b[_0x4cc414(0xd7)];}}return _0x55c61b[_0x4cc414(0xd7)];}for(const _0x435d6b of _0x35c6fd){const _0x2b9ea5=_0x1c0586(_0x435d6b);_0x47c990[_0x21e278(0xdc)](_0x2b9ea5,_0x435d6b['id']);}return _0x47c990;}export function buildFolderMaps(_0x240b8b){const _0x57a748=a137_0x1e2c,_0x11fd77=buildFolderIdToPathMap(_0x240b8b),_0x528356=new Map();for(const [_0x28714b,_0x382ff5]of _0x11fd77){_0x528356[_0x57a748(0xdc)](_0x382ff5,_0x28714b);}return{'idToPath':_0x11fd77,'pathToId':_0x528356};}function a137_0x1e2c(_0x5084a8,_0x5d630e){_0x5084a8=_0x5084a8-0xd1;const _0x4debeb=a137_0x4deb();let _0x1e2c47=_0x4debeb[_0x5084a8];return _0x1e2c47;}export function getFolderPath(_0x324bee,_0x32f9a0){const _0x258fc0=a137_0x1e2c;if(!_0x324bee)return'';return _0x32f9a0[_0x258fc0(0xd9)](_0x324bee)??'';}function a137_0x4deb(){const _0x53dc6a=['1389304gcDSPC','set','287iqIFIX','3691890tJtJRA','has','parentFolderId','2780622njBxKU','2454175sluloc','16LCffEa','add','4542rQZThg','4KXzCSc','name','3077490mCrpvr','get','2337945GVWaPt'];a137_0x4deb=function(){return _0x53dc6a;};return a137_0x4deb();}
1
+ (function(_0x4edaa7,_0x1abe07){const _0x3ebb1f=a137_0x5d84,_0xc54bed=_0x4edaa7();while(!![]){try{const _0xfea0e4=-parseInt(_0x3ebb1f(0xa9))/0x1+parseInt(_0x3ebb1f(0xa6))/0x2*(parseInt(_0x3ebb1f(0xac))/0x3)+parseInt(_0x3ebb1f(0xb1))/0x4+-parseInt(_0x3ebb1f(0xa7))/0x5*(-parseInt(_0x3ebb1f(0xb2))/0x6)+parseInt(_0x3ebb1f(0xb6))/0x7+-parseInt(_0x3ebb1f(0xaa))/0x8*(-parseInt(_0x3ebb1f(0xb4))/0x9)+-parseInt(_0x3ebb1f(0xb3))/0xa*(parseInt(_0x3ebb1f(0xaf))/0xb);if(_0xfea0e4===_0x1abe07)break;else _0xc54bed['push'](_0xc54bed['shift']());}catch(_0x123ea4){_0xc54bed['push'](_0xc54bed['shift']());}}}(a137_0x5b22,0xcb362));function a137_0x5d84(_0x2e00a7,_0x223a30){_0x2e00a7=_0x2e00a7-0xa6;const _0x5b22dc=a137_0x5b22();let _0x5d8444=_0x5b22dc[_0x2e00a7];return _0x5d8444;}export function buildFolderIdToPathMap(_0x34e5ae){const _0x4268f8=a137_0x5d84,_0x3fae09=new Map(),_0x3e1c89=new Map();for(const _0x855326 of _0x34e5ae){_0x3e1c89[_0x4268f8(0xb0)](_0x855326['id'],_0x855326);}const _0x3fb93a=new Set();for(const _0x547c55 of _0x34e5ae){!_0x547c55['parentFolderId']&&_0x3fb93a[_0x4268f8(0xab)](_0x547c55['id']);}function _0x16ab81(_0x1c738f){const _0x5ae622=_0x4268f8;if(_0x3fae09[_0x5ae622(0xa8)](_0x1c738f['id']))return _0x3fae09[_0x5ae622(0xb5)](_0x1c738f['id']);if(_0x3fb93a[_0x5ae622(0xa8)](_0x1c738f['id']))return _0x3fae09[_0x5ae622(0xb0)](_0x1c738f['id'],''),'';if(_0x1c738f[_0x5ae622(0xae)]){const _0x4ece9a=_0x3e1c89[_0x5ae622(0xb5)](_0x1c738f[_0x5ae622(0xae)]);if(_0x4ece9a){const _0x2d8804=_0x16ab81(_0x4ece9a),_0x5e2555=_0x2d8804?_0x2d8804+'/'+_0x1c738f[_0x5ae622(0xad)]:_0x1c738f[_0x5ae622(0xad)];return _0x3fae09[_0x5ae622(0xb0)](_0x1c738f['id'],_0x5e2555),_0x5e2555;}}const _0x36bf8e=_0x1c738f[_0x5ae622(0xad)];return _0x3fae09[_0x5ae622(0xb0)](_0x1c738f['id'],_0x36bf8e),_0x36bf8e;}for(const _0x1ab2cd of _0x34e5ae){_0x16ab81(_0x1ab2cd);}return _0x3fae09;}export function buildFolderPathToIdMap(_0x22bf37){const _0x4d91b6=a137_0x5d84,_0x79d52e=new Map(),_0xb108b=new Map();for(const _0x1477c2 of _0x22bf37){_0xb108b['set'](_0x1477c2['id'],_0x1477c2);}const _0x599a68=new Set();for(const _0x2d6740 of _0x22bf37){!_0x2d6740[_0x4d91b6(0xae)]&&_0x599a68[_0x4d91b6(0xab)](_0x2d6740['id']);}function _0x93219b(_0x4b9050){const _0xdff5ea=_0x4d91b6;if(_0x599a68['has'](_0x4b9050['id']))return'';if(_0x4b9050[_0xdff5ea(0xae)]){const _0x1b42d2=_0xb108b[_0xdff5ea(0xb5)](_0x4b9050[_0xdff5ea(0xae)]);if(_0x1b42d2){const _0x16d7d1=_0x93219b(_0x1b42d2);return _0x16d7d1?_0x16d7d1+'/'+_0x4b9050['name']:_0x4b9050[_0xdff5ea(0xad)];}}return _0x4b9050[_0xdff5ea(0xad)];}for(const _0x5e521c of _0x22bf37){const _0x37bc52=_0x93219b(_0x5e521c);_0x79d52e[_0x4d91b6(0xb0)](_0x37bc52,_0x5e521c['id']);}return _0x79d52e;}export function buildFolderMaps(_0x1b7145){const _0xfae380=a137_0x5d84,_0x3a634e=buildFolderIdToPathMap(_0x1b7145),_0x302ac7=new Map();for(const [_0xb243f1,_0x21c28a]of _0x3a634e){_0x302ac7[_0xfae380(0xb0)](_0x21c28a,_0xb243f1);}return{'idToPath':_0x3a634e,'pathToId':_0x302ac7};}export function getFolderPath(_0x3a0530,_0xf144b4){if(!_0x3a0530)return'';return _0xf144b4['get'](_0x3a0530)??'';}function a137_0x5b22(){const _0x54eb85=['has','1497939latgWz','3369624tenTMM','add','3048TKQwKU','name','parentFolderId','59939uWTEMN','set','2517976WzBEKy','6mDXRQu','5210vHuOjq','9Zaenyc','get','10896956rpdbve','3018wfcara','5143365djoOdT'];a137_0x5b22=function(){return _0x54eb85;};return a137_0x5b22();}
@@ -1 +1 @@
1
- (function(_0x207068,_0x51a5aa){const _0x24a061=a138_0x2d94,_0x55beb9=_0x207068();while(!![]){try{const _0x39a62d=-parseInt(_0x24a061(0xbd))/0x1+-parseInt(_0x24a061(0xb5))/0x2*(parseInt(_0x24a061(0xc9))/0x3)+parseInt(_0x24a061(0xb7))/0x4+-parseInt(_0x24a061(0xd9))/0x5+parseInt(_0x24a061(0xcf))/0x6+parseInt(_0x24a061(0xbe))/0x7+parseInt(_0x24a061(0xc4))/0x8*(parseInt(_0x24a061(0xcd))/0x9);if(_0x39a62d===_0x51a5aa)break;else _0x55beb9['push'](_0x55beb9['shift']());}catch(_0x5e0736){_0x55beb9['push'](_0x55beb9['shift']());}}}(a138_0x54f8,0xd27ce));import a138_0x5ba3b5 from'path';import{parse as a138_0x6f8865}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x2c813e){const _0xdb799=a138_0x2d94;if(!_0x2c813e||_0x2c813e[_0xdb799(0xc3)]()==='')throw new Error(_0xdb799(0xd8));const _0x2cf05a=_0x2c813e[_0xdb799(0xc3)]();if(_0x2cf05a==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x2c813e};const _0x391de9=_0x2cf05a[_0xdb799(0xb6)]('/')?_0x2cf05a['substring'](0x1):_0x2cf05a,_0x17fee3=_0x391de9[_0xdb799(0xdd)]('/')[_0xdb799(0xcc)](_0x2876e2=>_0x2876e2!=='');if(_0x17fee3[_0xdb799(0xce)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x435b2d=_0x2cf05a['startsWith']('/')||!isRelativePathSegment(_0x17fee3[0x0]);for(const _0x222841 of _0x17fee3){validatePathSegment(_0x222841);}return{'segments':_0x17fee3,'isAbsolute':_0x435b2d,'raw':_0x2c813e};}function isRelativePathSegment(_0x5722c2){return _0x5722c2==='.'||_0x5722c2==='..';}function validatePathSegment(_0x1e385b){const _0x431dcc=a138_0x2d94;if(_0x1e385b==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x1e385b==='.'||_0x1e385b==='..')return;if(/[\x00-\x1F\x7F]/[_0x431dcc(0xc0)](_0x1e385b))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x1e385b);if(_0x1e385b!==_0x1e385b[_0x431dcc(0xc3)]()){}}export function validatePath(_0x1bbf61){const _0x3186b6=a138_0x2d94;if(_0x1bbf61[_0x3186b6(0xd6)]['length']===0x0&&!_0x1bbf61[_0x3186b6(0xd5)])throw new Error(_0x3186b6(0xb4));if(_0x1bbf61[_0x3186b6(0xd5)]){if(_0x1bbf61['segments'][0x0]==='..')throw new Error(_0x3186b6(0xc1));let _0x156444=0x0;for(const _0x142394 of _0x1bbf61['segments']){if(_0x142394==='..'){if(_0x156444===0x0)throw new Error(_0x3186b6(0xc7));_0x156444--;}else _0x142394!=='.'&&_0x156444++;}}}export function joinPaths(_0x3550a9,_0x109e3b){const _0x23a4d3=a138_0x2d94;if(!_0x3550a9||_0x3550a9==='/')return _0x109e3b;if(!_0x109e3b||_0x109e3b==='.')return _0x3550a9;if(_0x109e3b[_0x23a4d3(0xb6)]('/'))return _0x109e3b;const _0x1456b5=parsePath(_0x3550a9),_0x55d674=parsePath(_0x109e3b),_0x5f22a2=[..._0x1456b5['segments']];for(const _0x4d9c5c of _0x55d674[_0x23a4d3(0xd6)]){if(_0x4d9c5c==='.')continue;else{if(_0x4d9c5c==='..'){if(_0x5f22a2[_0x23a4d3(0xce)]===0x0)throw new Error(_0x23a4d3(0xb2));_0x5f22a2[_0x23a4d3(0xdb)]();}else _0x5f22a2['push'](_0x4d9c5c);}}const _0x13d674=_0x5f22a2[_0x23a4d3(0xb9)]('/');return _0x1456b5['raw'][_0x23a4d3(0xb6)]('/')?'/'+_0x13d674:_0x13d674;}export function normalizePath(_0x4e1103){const _0x3ccc9c=a138_0x2d94,_0x2f83ea=parsePath(_0x4e1103),_0x3e1860=[];for(const _0x2c7812 of _0x2f83ea[_0x3ccc9c(0xd6)]){if(_0x2c7812==='.')continue;else{if(_0x2c7812==='..'){if(_0x3e1860[_0x3ccc9c(0xce)]===0x0){if(_0x2f83ea[_0x3ccc9c(0xd5)])throw new Error(_0x3ccc9c(0xb2));_0x3e1860[_0x3ccc9c(0xbf)]('..');}else _0x3e1860[_0x3e1860[_0x3ccc9c(0xce)]-0x1]==='..'?_0x3e1860[_0x3ccc9c(0xbf)]('..'):_0x3e1860['pop']();}else _0x3e1860['push'](_0x2c7812);}}if(_0x3e1860[_0x3ccc9c(0xce)]===0x0)return _0x2f83ea['isAbsolute']?'/':'.';const _0x3f6f73=_0x3e1860[_0x3ccc9c(0xb9)]('/');return _0x2f83ea[_0x3ccc9c(0xc6)]['startsWith']('/')?'/'+_0x3f6f73:_0x3f6f73;}function a138_0x2d94(_0x3c0ed0,_0x4db742){_0x3c0ed0=_0x3c0ed0-0xb2;const _0x54f886=a138_0x54f8();let _0x2d94ca=_0x54f886[_0x3c0ed0];return _0x2d94ca;}export function getParentPath(_0x28753a){const _0x26ccf9=a138_0x2d94,_0x1c7eb2=parsePath(_0x28753a);if(_0x1c7eb2[_0x26ccf9(0xd6)]['length']<=0x1)return'/';const _0x5cfe99=_0x1c7eb2[_0x26ccf9(0xd6)][_0x26ccf9(0xd4)](0x0,-0x1)[_0x26ccf9(0xb9)]('/');return _0x1c7eb2[_0x26ccf9(0xc6)]['startsWith']('/')?'/'+_0x5cfe99:_0x5cfe99;}export function getBaseName(_0x28a844){const _0xd0a44f=a138_0x2d94,_0x3d9837=parsePath(_0x28a844);return _0x3d9837[_0xd0a44f(0xd6)][_0x3d9837[_0xd0a44f(0xd6)][_0xd0a44f(0xce)]-0x1]||'';}export function isChildPath(_0x2959cf,_0x42d49f){const _0x283436=a138_0x2d94,_0x4bb718=parsePath(_0x2959cf),_0x5b3af6=parsePath(_0x42d49f);if(_0x4bb718[_0x283436(0xd6)]['length']<=_0x5b3af6['segments'][_0x283436(0xce)])return![];for(let _0x25b947=0x0;_0x25b947<_0x5b3af6['segments'][_0x283436(0xce)];_0x25b947++){if(_0x4bb718[_0x283436(0xd6)][_0x25b947]!==_0x5b3af6[_0x283436(0xd6)][_0x25b947])return![];}return!![];}export function splitPath(_0x1908ad){const _0x2f2fcb=a138_0x2d94,_0x51e356=parsePath(_0x1908ad);if(_0x51e356['segments']['length']===0x0)throw new Error(_0x2f2fcb(0xbc));if(_0x51e356['segments']['length']===0x1)return{'parent':_0x51e356['segments'][0x0]};return{'parent':_0x51e356[_0x2f2fcb(0xd6)][0x0],'child':_0x51e356[_0x2f2fcb(0xd6)]['slice'](0x1)[_0x2f2fcb(0xb9)]('/')};}export function isYamlFilePath(_0x38d6f4){const _0x31e2a8=a138_0x2d94;return _0x38d6f4['endsWith'](_0x31e2a8(0xd0))||_0x38d6f4[_0x31e2a8(0xcb)](_0x31e2a8(0xda));}export async function resolveYamlFilePath(_0x388e43,_0x1e5c71=nodeFileSystem){const _0x2f9657=a138_0x2d94,_0x1fb65d=a138_0x5ba3b5[_0x2f9657(0xd7)](_0x388e43);if(!await _0x1e5c71[_0x2f9657(0xb8)](_0x1fb65d))throw new Error(_0x2f9657(0xdc)+_0x388e43);let _0x58c51a=a138_0x5ba3b5[_0x2f9657(0xc5)](_0x1fb65d),_0x73ec61=null,_0x5024be=null;const _0xc993fe=a138_0x5ba3b5[_0x2f9657(0xca)](_0x58c51a)[_0x2f9657(0xc8)];while(_0x58c51a!==_0xc993fe){const _0x1fae1d=a138_0x5ba3b5[_0x2f9657(0xb9)](_0x58c51a,_0x2f9657(0xd2));if(await _0x1e5c71[_0x2f9657(0xb8)](_0x1fae1d)){_0x73ec61=_0x1fae1d,_0x5024be=_0x58c51a;break;}_0x58c51a=a138_0x5ba3b5[_0x2f9657(0xc5)](_0x58c51a);}if(!_0x73ec61||!_0x5024be)throw new Error(_0x2f9657(0xd3)+_0x388e43+'\x0a'+_0x2f9657(0xdf));const _0x10fe0e=await _0x1e5c71[_0x2f9657(0xba)](_0x73ec61),_0x35d655=JSON['parse'](_0x10fe0e),_0x2204a7=_0x35d655[_0x2f9657(0xbb)];if(!_0x2204a7)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x1d10ea=await _0x1e5c71[_0x2f9657(0xba)](_0x1fb65d),_0xc40a2b=a138_0x6f8865(_0x1d10ea),_0x21e67f=_0xc40a2b[_0x2f9657(0xb3)];if(!_0x21e67f)throw new Error(_0x2f9657(0xd1)+_0x388e43);const _0x5a7462=_0xc40a2b[_0x2f9657(0xe0)]===_0x2f9657(0xc2)?_0x2f9657(0xc2):_0x2f9657(0xde),_0x2652fb=a138_0x5ba3b5['relative'](_0x5024be,_0x1fb65d),_0x312294=a138_0x5ba3b5[_0x2f9657(0xc5)](_0x2652fb),_0x770b54=_0x312294==='.'?'':_0x312294['replace'](/\\/g,'/'),_0x592269=_0x770b54?_0x2204a7+'/'+_0x770b54+'/'+_0x21e67f:_0x2204a7+'/'+_0x21e67f;return{'parentSegment':_0x2204a7,'segmentName':_0x21e67f,'folderPath':_0x770b54,'fullPath':_0x592269,'resourceType':_0x5a7462,'content':_0x1d10ea};}function a138_0x54f8(){const _0x4eceee=['startsWith','3245800RUJEVf','exists','join','readFile','parent_segment','Cannot\x20split\x20empty\x20path','1568341ILDMru','5014842PmGMlr','push','test','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','journey','trim','9808384eQJkQg','dirname','raw','Path\x20attempts\x20to\x20navigate\x20above\x20root','root','18UJmoZf','parse','endsWith','filter','9iwgcuS','length','9800688ZWEEde','.yml','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','tdx.json','No\x20tdx.json\x20found\x20for\x20file:\x20','slice','isAbsolute','segments','resolve','Path\x20cannot\x20be\x20empty','8599175mZvhjP','.yaml','pop','File\x20not\x20found:\x20','split','segment','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','type','Cannot\x20navigate\x20above\x20root','name','Relative\x20path\x20cannot\x20be\x20empty','79006TMgCpR'];a138_0x54f8=function(){return _0x4eceee;};return a138_0x54f8();}
1
+ (function(_0x470484,_0x2cae06){const _0xd866a=a138_0x35fd,_0x3584e7=_0x470484();while(!![]){try{const _0x3228d2=parseInt(_0xd866a(0xd5))/0x1*(-parseInt(_0xd866a(0xe6))/0x2)+-parseInt(_0xd866a(0xdb))/0x3*(-parseInt(_0xd866a(0xd0))/0x4)+-parseInt(_0xd866a(0xc2))/0x5+parseInt(_0xd866a(0xcf))/0x6+-parseInt(_0xd866a(0xd7))/0x7+parseInt(_0xd866a(0xdf))/0x8+-parseInt(_0xd866a(0xe7))/0x9*(-parseInt(_0xd866a(0xc7))/0xa);if(_0x3228d2===_0x2cae06)break;else _0x3584e7['push'](_0x3584e7['shift']());}catch(_0x147767){_0x3584e7['push'](_0x3584e7['shift']());}}}(a138_0x68c7,0xc2176));import a138_0x8832f7 from'path';function a138_0x35fd(_0x26a5f6,_0x44853c){_0x26a5f6=_0x26a5f6-0xbb;const _0x68c7e5=a138_0x68c7();let _0x35fd4c=_0x68c7e5[_0x26a5f6];return _0x35fd4c;}import{parse as a138_0x24828}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x2e36e3){const _0x16fa81=a138_0x35fd;if(!_0x2e36e3||_0x2e36e3['trim']()==='')throw new Error(_0x16fa81(0xd1));const _0x490e12=_0x2e36e3[_0x16fa81(0xd3)]();if(_0x490e12==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x2e36e3};const _0x49cc79=_0x490e12[_0x16fa81(0xe5)]('/')?_0x490e12[_0x16fa81(0xbc)](0x1):_0x490e12,_0x4a9848=_0x49cc79['split']('/')['filter'](_0x330a8c=>_0x330a8c!=='');if(_0x4a9848[_0x16fa81(0xca)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x272e11=_0x490e12[_0x16fa81(0xe5)]('/')||!isRelativePathSegment(_0x4a9848[0x0]);for(const _0x50d67d of _0x4a9848){validatePathSegment(_0x50d67d);}return{'segments':_0x4a9848,'isAbsolute':_0x272e11,'raw':_0x2e36e3};}function isRelativePathSegment(_0x337a12){return _0x337a12==='.'||_0x337a12==='..';}function a138_0x68c7(){const _0x120526=['Path\x20attempts\x20to\x20navigate\x20above\x20root','type','raw','name','6392255eQNaKT','No\x20tdx.json\x20found\x20for\x20file:\x20','parse','resolve','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','349630DlIpcs','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','parent_segment','length','relative','test','segments','push','51528yiKmEd','82112huyigk','Path\x20cannot\x20be\x20empty','File\x20not\x20found:\x20','trim','.yml','1367tBMkqE','join','4540676mTYkrQ','.yaml','readFile','isAbsolute','3PeKDTe','dirname','Cannot\x20navigate\x20above\x20root','root','513336cHKzDK','journey','Cannot\x20split\x20empty\x20path','exists','tdx.json','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','startsWith','1218KTdwNa','891AnWFKH','slice','replace','endsWith','substring','Path\x20segment\x20cannot\x20be\x20empty'];a138_0x68c7=function(){return _0x120526;};return a138_0x68c7();}function validatePathSegment(_0x16b638){const _0x4824b8=a138_0x35fd;if(_0x16b638==='')throw new Error(_0x4824b8(0xbd));if(_0x16b638==='.'||_0x16b638==='..')return;if(/[\x00-\x1F\x7F]/[_0x4824b8(0xcc)](_0x16b638))throw new Error(_0x4824b8(0xc8)+_0x16b638);if(_0x16b638!==_0x16b638['trim']()){}}export function validatePath(_0x43f1d0){const _0x4338c2=a138_0x35fd;if(_0x43f1d0['segments'][_0x4338c2(0xca)]===0x0&&!_0x43f1d0[_0x4338c2(0xda)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x43f1d0[_0x4338c2(0xda)]){if(_0x43f1d0[_0x4338c2(0xcd)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x59a963=0x0;for(const _0x147d79 of _0x43f1d0[_0x4338c2(0xcd)]){if(_0x147d79==='..'){if(_0x59a963===0x0)throw new Error(_0x4338c2(0xbe));_0x59a963--;}else _0x147d79!=='.'&&_0x59a963++;}}}export function joinPaths(_0x462083,_0x1054b4){const _0x67c9d8=a138_0x35fd;if(!_0x462083||_0x462083==='/')return _0x1054b4;if(!_0x1054b4||_0x1054b4==='.')return _0x462083;if(_0x1054b4[_0x67c9d8(0xe5)]('/'))return _0x1054b4;const _0x1e5f94=parsePath(_0x462083),_0x57bc85=parsePath(_0x1054b4),_0x534b27=[..._0x1e5f94[_0x67c9d8(0xcd)]];for(const _0x3210f7 of _0x57bc85[_0x67c9d8(0xcd)]){if(_0x3210f7==='.')continue;else{if(_0x3210f7==='..'){if(_0x534b27[_0x67c9d8(0xca)]===0x0)throw new Error(_0x67c9d8(0xdd));_0x534b27['pop']();}else _0x534b27[_0x67c9d8(0xce)](_0x3210f7);}}const _0x39b1c2=_0x534b27[_0x67c9d8(0xd6)]('/');return _0x1e5f94[_0x67c9d8(0xc0)][_0x67c9d8(0xe5)]('/')?'/'+_0x39b1c2:_0x39b1c2;}export function normalizePath(_0xfa2816){const _0x295621=a138_0x35fd,_0x466624=parsePath(_0xfa2816),_0x5d9f9d=[];for(const _0x281e4e of _0x466624['segments']){if(_0x281e4e==='.')continue;else{if(_0x281e4e==='..'){if(_0x5d9f9d[_0x295621(0xca)]===0x0){if(_0x466624[_0x295621(0xda)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x5d9f9d['push']('..');}else _0x5d9f9d[_0x5d9f9d[_0x295621(0xca)]-0x1]==='..'?_0x5d9f9d[_0x295621(0xce)]('..'):_0x5d9f9d['pop']();}else _0x5d9f9d[_0x295621(0xce)](_0x281e4e);}}if(_0x5d9f9d[_0x295621(0xca)]===0x0)return _0x466624[_0x295621(0xda)]?'/':'.';const _0x53bc13=_0x5d9f9d[_0x295621(0xd6)]('/');return _0x466624[_0x295621(0xc0)][_0x295621(0xe5)]('/')?'/'+_0x53bc13:_0x53bc13;}export function getParentPath(_0x49aa67){const _0xe1f817=a138_0x35fd,_0x25808f=parsePath(_0x49aa67);if(_0x25808f[_0xe1f817(0xcd)][_0xe1f817(0xca)]<=0x1)return'/';const _0x4f640f=_0x25808f[_0xe1f817(0xcd)]['slice'](0x0,-0x1)[_0xe1f817(0xd6)]('/');return _0x25808f[_0xe1f817(0xc0)][_0xe1f817(0xe5)]('/')?'/'+_0x4f640f:_0x4f640f;}export function getBaseName(_0x2fe28b){const _0x4ce976=a138_0x35fd,_0x369d29=parsePath(_0x2fe28b);return _0x369d29[_0x4ce976(0xcd)][_0x369d29[_0x4ce976(0xcd)]['length']-0x1]||'';}export function isChildPath(_0x47f8db,_0xacc7fd){const _0x5a9eef=a138_0x35fd,_0x4bf096=parsePath(_0x47f8db),_0x45084a=parsePath(_0xacc7fd);if(_0x4bf096[_0x5a9eef(0xcd)][_0x5a9eef(0xca)]<=_0x45084a[_0x5a9eef(0xcd)]['length'])return![];for(let _0x3dce32=0x0;_0x3dce32<_0x45084a['segments'][_0x5a9eef(0xca)];_0x3dce32++){if(_0x4bf096[_0x5a9eef(0xcd)][_0x3dce32]!==_0x45084a[_0x5a9eef(0xcd)][_0x3dce32])return![];}return!![];}export function splitPath(_0x48cefd){const _0x354acd=a138_0x35fd,_0x5a1a37=parsePath(_0x48cefd);if(_0x5a1a37['segments'][_0x354acd(0xca)]===0x0)throw new Error(_0x354acd(0xe1));if(_0x5a1a37[_0x354acd(0xcd)][_0x354acd(0xca)]===0x1)return{'parent':_0x5a1a37[_0x354acd(0xcd)][0x0]};return{'parent':_0x5a1a37[_0x354acd(0xcd)][0x0],'child':_0x5a1a37[_0x354acd(0xcd)][_0x354acd(0xe8)](0x1)['join']('/')};}export function isYamlFilePath(_0xde7e5c){const _0x46f7fe=a138_0x35fd;return _0xde7e5c[_0x46f7fe(0xbb)](_0x46f7fe(0xd4))||_0xde7e5c['endsWith'](_0x46f7fe(0xd8));}export async function resolveYamlFilePath(_0x3e43f7,_0x45402c=nodeFileSystem){const _0x257cb9=a138_0x35fd,_0x1cfcb9=a138_0x8832f7[_0x257cb9(0xc5)](_0x3e43f7);if(!await _0x45402c[_0x257cb9(0xe2)](_0x1cfcb9))throw new Error(_0x257cb9(0xd2)+_0x3e43f7);let _0x5139a2=a138_0x8832f7[_0x257cb9(0xdc)](_0x1cfcb9),_0x166aa6=null,_0x49065b=null;const _0x5d88a7=a138_0x8832f7[_0x257cb9(0xc4)](_0x5139a2)[_0x257cb9(0xde)];while(_0x5139a2!==_0x5d88a7){const _0x139abd=a138_0x8832f7['join'](_0x5139a2,_0x257cb9(0xe3));if(await _0x45402c['exists'](_0x139abd)){_0x166aa6=_0x139abd,_0x49065b=_0x5139a2;break;}_0x5139a2=a138_0x8832f7['dirname'](_0x5139a2);}if(!_0x166aa6||!_0x49065b)throw new Error(_0x257cb9(0xc3)+_0x3e43f7+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x53ef9d=await _0x45402c['readFile'](_0x166aa6),_0x42ec88=JSON[_0x257cb9(0xc4)](_0x53ef9d),_0x52e2f7=_0x42ec88[_0x257cb9(0xc9)];if(!_0x52e2f7)throw new Error(_0x257cb9(0xc6));const _0x24191d=await _0x45402c[_0x257cb9(0xd9)](_0x1cfcb9),_0xebc092=a138_0x24828(_0x24191d),_0x1c235a=_0xebc092[_0x257cb9(0xc1)];if(!_0x1c235a)throw new Error(_0x257cb9(0xe4)+_0x3e43f7);const _0x5526d7=_0xebc092[_0x257cb9(0xbf)]===_0x257cb9(0xe0)?_0x257cb9(0xe0):'segment',_0xa831f2=a138_0x8832f7[_0x257cb9(0xcb)](_0x49065b,_0x1cfcb9),_0x32cbbc=a138_0x8832f7[_0x257cb9(0xdc)](_0xa831f2),_0x4b8c64=_0x32cbbc==='.'?'':_0x32cbbc[_0x257cb9(0xe9)](/\\/g,'/'),_0x546614=_0x4b8c64?_0x52e2f7+'/'+_0x4b8c64+'/'+_0x1c235a:_0x52e2f7+'/'+_0x1c235a;return{'parentSegment':_0x52e2f7,'segmentName':_0x1c235a,'folderPath':_0x4b8c64,'fullPath':_0x546614,'resourceType':_0x5526d7,'content':_0x24191d};}
@@ -1 +1 @@
1
- function a139_0x4793(_0x3bef43,_0x21760c){_0x3bef43=_0x3bef43-0x10c;const _0x1257b9=a139_0x1257();let _0x47930b=_0x1257b9[_0x3bef43];return _0x47930b;}(function(_0x12d93a,_0x14f391){const _0xa2cef=a139_0x4793,_0x32eeb8=_0x12d93a();while(!![]){try{const _0x1ee246=parseInt(_0xa2cef(0x119))/0x1+-parseInt(_0xa2cef(0x11a))/0x2*(parseInt(_0xa2cef(0x10c))/0x3)+-parseInt(_0xa2cef(0x110))/0x4+parseInt(_0xa2cef(0x114))/0x5+parseInt(_0xa2cef(0x10e))/0x6+parseInt(_0xa2cef(0x111))/0x7*(parseInt(_0xa2cef(0x116))/0x8)+-parseInt(_0xa2cef(0x115))/0x9*(-parseInt(_0xa2cef(0x113))/0xa);if(_0x1ee246===_0x14f391)break;else _0x32eeb8['push'](_0x32eeb8['shift']());}catch(_0x19cfe5){_0x32eeb8['push'](_0x32eeb8['shift']());}}}(a139_0x1257,0xf081a));export function parseSegmentRef(_0x1a5ce0){const _0x2a92b0=a139_0x4793,_0x3ce808=_0x1a5ce0[_0x2a92b0(0x118)]('/');if(_0x3ce808===-0x1)return{'parentId':_0x1a5ce0};if(_0x3ce808===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1a5ce0+_0x2a92b0(0x10d));const _0x4f2414=_0x1a5ce0[_0x2a92b0(0x112)](0x0,_0x3ce808),_0x706dd3=_0x1a5ce0[_0x2a92b0(0x112)](_0x3ce808+0x1);if(_0x706dd3==='')throw new Error(_0x2a92b0(0x117)+_0x1a5ce0+_0x2a92b0(0x10f));return{'parentId':_0x4f2414,'childId':_0x706dd3};}function a139_0x1257(){const _0x17ab2b=['2122192NCzKpz','3clfRxI','.\x20Parent\x20name\x20cannot\x20be\x20empty','5752338jqXkbr','.\x20Child\x20name\x20cannot\x20be\x20empty','4972064gsyiry','7kfUuyc','substring','1911370kqKCBS','3576775tdnIKf','27jiqQnE','1009544lMXNlo','Invalid\x20segment\x20reference\x20format:\x20','indexOf','915544MkBqRQ'];a139_0x1257=function(){return _0x17ab2b;};return a139_0x1257();}
1
+ (function(_0x4aef94,_0x1f6d8e){const _0xe52744=a139_0x2838,_0x24743b=_0x4aef94();while(!![]){try{const _0x4296da=parseInt(_0xe52744(0x9a))/0x1+parseInt(_0xe52744(0xa1))/0x2+parseInt(_0xe52744(0xa6))/0x3*(parseInt(_0xe52744(0xa3))/0x4)+-parseInt(_0xe52744(0x9c))/0x5*(parseInt(_0xe52744(0x9f))/0x6)+-parseInt(_0xe52744(0x9b))/0x7*(-parseInt(_0xe52744(0xa4))/0x8)+-parseInt(_0xe52744(0xa5))/0x9+-parseInt(_0xe52744(0x9d))/0xa*(parseInt(_0xe52744(0x99))/0xb);if(_0x4296da===_0x1f6d8e)break;else _0x24743b['push'](_0x24743b['shift']());}catch(_0xb28e54){_0x24743b['push'](_0x24743b['shift']());}}}(a139_0x4f03,0x964d7));function a139_0x2838(_0x12da74,_0x2a5c27){_0x12da74=_0x12da74-0x99;const _0x4f03e3=a139_0x4f03();let _0x28381c=_0x4f03e3[_0x12da74];return _0x28381c;}export function parseSegmentRef(_0x3f8937){const _0x5ad98c=a139_0x2838,_0x46fe92=_0x3f8937[_0x5ad98c(0xa2)]('/');if(_0x46fe92===-0x1)return{'parentId':_0x3f8937};if(_0x46fe92===0x0)throw new Error(_0x5ad98c(0x9e)+_0x3f8937+_0x5ad98c(0xa7));const _0x4339d0=_0x3f8937[_0x5ad98c(0xa0)](0x0,_0x46fe92),_0x3fe39b=_0x3f8937[_0x5ad98c(0xa0)](_0x46fe92+0x1);if(_0x3fe39b==='')throw new Error(_0x5ad98c(0x9e)+_0x3f8937+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x4339d0,'childId':_0x3fe39b};}function a139_0x4f03(){const _0x106762=['Invalid\x20segment\x20reference\x20format:\x20','445338pNyRVV','substring','2373260LUmxes','indexOf','3613436xbelnm','7577048VDVsCQ','9286776bhDkQb','3jhtwbr','.\x20Parent\x20name\x20cannot\x20be\x20empty','5654ssmvnH','223629swXfVq','7XBhqfx','20rCzgev','25610hgOpCi'];a139_0x4f03=function(){return _0x106762;};return a139_0x4f03();}