@treasuredata/tdx 2026.3.15 → 2026.3.17

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 (202) hide show
  1. package/README.md +9 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/auth-login-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/query/index.js +1 -1
  127. package/dist/sdk/query/sql-parser.js +1 -1
  128. package/dist/sdk/realtime.js +1 -1
  129. package/dist/sdk/schedule.js +1 -1
  130. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  131. package/dist/sdk/segment/fields-display.js +1 -1
  132. package/dist/sdk/segment/file-discovery.js +1 -1
  133. package/dist/sdk/segment/journey-utils.js +1 -1
  134. package/dist/sdk/segment/journey-validator.js +1 -1
  135. package/dist/sdk/segment/journey-yaml.js +1 -1
  136. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  137. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  138. package/dist/sdk/segment/pull-workflow.js +1 -1
  139. package/dist/sdk/segment/push-recovery.js +1 -1
  140. package/dist/sdk/segment/push-workflow.js +1 -1
  141. package/dist/sdk/segment/resolution-context.js +1 -1
  142. package/dist/sdk/segment/segment-path-parser.js +1 -1
  143. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  144. package/dist/sdk/segment/segment-validator.js +1 -1
  145. package/dist/sdk/segment/target-resolution.js +1 -1
  146. package/dist/sdk/segment/tdx-config.js +1 -1
  147. package/dist/sdk/segment/types/activation-schema.js +1 -1
  148. package/dist/sdk/segment/types/journey-def.js +1 -1
  149. package/dist/sdk/segment/types/journey-schema.js +1 -1
  150. package/dist/sdk/segment/types/segment-def.js +1 -1
  151. package/dist/sdk/segment/types/segment-schema.js +1 -1
  152. package/dist/sdk/segment/validate-files.js +1 -1
  153. package/dist/sdk/segment/yaml-validator.js +1 -1
  154. package/dist/sdk/segment.js +1 -1
  155. package/dist/sdk/types/index.js +1 -1
  156. package/dist/sdk/types/progress.js +1 -1
  157. package/dist/sdk/user.js +1 -1
  158. package/dist/sdk/util/format-detector.js +1 -1
  159. package/dist/sdk/util/formatters.js +1 -1
  160. package/dist/sdk/util/index.js +1 -1
  161. package/dist/sdk/util/paginate.js +1 -1
  162. package/dist/sdk/util/tree-formatter.js +1 -1
  163. package/dist/sdk/workflow/archive-validation.js +1 -1
  164. package/dist/sdk/workflow/clone-workflow.js +1 -1
  165. package/dist/sdk/workflow/index.js +1 -1
  166. package/dist/sdk/workflow/pull-workflow.js +1 -1
  167. package/dist/sdk/workflow/push-workflow.js +1 -1
  168. package/dist/sdk/workflow/tdx-config.js +1 -1
  169. package/dist/sdk/workflow/workflow-utils.js +1 -1
  170. package/dist/test-utils/command-runner.js +1 -1
  171. package/dist/test-utils/factories.js +1 -1
  172. package/dist/test-utils/fixtures.js +1 -1
  173. package/dist/test-utils/http-mock.js +1 -1
  174. package/dist/test-utils/index.js +1 -1
  175. package/dist/utils/async.js +1 -1
  176. package/dist/utils/colors.js +1 -1
  177. package/dist/utils/diff.js +1 -1
  178. package/dist/utils/file-permissions.js +1 -1
  179. package/dist/utils/file-reader.js +1 -1
  180. package/dist/utils/github-releases.js +1 -1
  181. package/dist/utils/global-cache.js +1 -1
  182. package/dist/utils/json-loader.js +1 -1
  183. package/dist/utils/local-cache.js +1 -1
  184. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  185. package/dist/utils/logger/formatters/index.js +1 -1
  186. package/dist/utils/logger/handlers/console-handler.js +1 -1
  187. package/dist/utils/logger/handlers/file-handler.js +1 -1
  188. package/dist/utils/logger/handlers/index.js +1 -1
  189. package/dist/utils/logger/handlers/null-handler.js +1 -1
  190. package/dist/utils/logger/index.js +1 -1
  191. package/dist/utils/logger/logger.js +1 -1
  192. package/dist/utils/logger/types.js +1 -1
  193. package/dist/utils/option-validation.js +1 -1
  194. package/dist/utils/process.js +1 -1
  195. package/dist/utils/prompt.js +1 -1
  196. package/dist/utils/spinner.js +1 -1
  197. package/dist/utils/sse-parser.js +1 -1
  198. package/dist/utils/string-utils.js +1 -1
  199. package/dist/utils/table-ref-parser.js +1 -1
  200. package/dist/utils/tdx-logger.js +1 -1
  201. package/dist/utils/version-check.js +1 -1
  202. package/package.json +3 -3
@@ -1 +1 @@
1
- (function(_0x55ffdb,_0xb63f1c){const _0x3267f0=a139_0x270e,_0x33e946=_0x55ffdb();while(!![]){try{const _0x532393=-parseInt(_0x3267f0(0x1ed))/0x1*(parseInt(_0x3267f0(0x1e8))/0x2)+-parseInt(_0x3267f0(0x1f7))/0x3+parseInt(_0x3267f0(0x1f0))/0x4+parseInt(_0x3267f0(0x1e4))/0x5+parseInt(_0x3267f0(0x1f8))/0x6+-parseInt(_0x3267f0(0x1e7))/0x7+parseInt(_0x3267f0(0x1f5))/0x8;if(_0x532393===_0xb63f1c)break;else _0x33e946['push'](_0x33e946['shift']());}catch(_0x147f87){_0x33e946['push'](_0x33e946['shift']());}}}(a139_0x21c2,0x7efb5));function a139_0x21c2(){const _0x5c1b8e=['toISOString','5609737OGQpAx','8pdPbvC','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','.tmp','utf-8','ENOENT','23431yxUrix','stringify','version','1072868SXYpjN','string','basename','warn','journeyName','5222120JBvQBa','debug','2175678foOmxx','1167690nzmSvi','join','.push-recovery.json','dirname','5124305iULtsp','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'];a139_0x21c2=function(){return _0x5c1b8e;};return a139_0x21c2();}import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a139_0x3de3c9 from'path';function a139_0x270e(_0x2bddb8,_0x1645eb){_0x2bddb8=_0x2bddb8-0x1e4;const _0x21c280=a139_0x21c2();let _0x270e6e=_0x21c280[_0x2bddb8];return _0x270e6e;}import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x1c071d){const _0x3b0825=a139_0x270e,_0x3cde6f=a139_0x3de3c9[_0x3b0825(0x1fb)](_0x1c071d),_0x21ae18=a139_0x3de3c9[_0x3b0825(0x1f2)](_0x1c071d);return a139_0x3de3c9[_0x3b0825(0x1f9)](_0x3cde6f,'.'+_0x21ae18+_0x3b0825(0x1fa));}export function readPushRecovery(_0x4854a3){const _0x3a6b73=a139_0x270e,_0x4dbdc0=getPushRecoveryPath(_0x4854a3);if(!existsSync(_0x4dbdc0))return undefined;try{const _0x2ed927=readFileSync(_0x4dbdc0,_0x3a6b73(0x1eb)),_0x33e74c=JSON['parse'](_0x2ed927);if(_0x33e74c?.[_0x3a6b73(0x1ef)]!==0x1||typeof _0x33e74c[_0x3a6b73(0x1f4)]!==_0x3a6b73(0x1f1))return undefined;return _0x33e74c;}catch(_0x477c6f){return _0x477c6f instanceof SyntaxError?logger[_0x3a6b73(0x1f6)](_0x3a6b73(0x1e9)+_0x477c6f):logger[_0x3a6b73(0x1f3)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x477c6f),undefined;}}export function writePushRecovery(_0x28dd5e,_0x3dfcab){const _0x5eb314=a139_0x270e,_0x258f2f=getPushRecoveryPath(_0x28dd5e),_0x5a6fc2=_0x258f2f+_0x5eb314(0x1ea);writeFileSync(_0x5a6fc2,JSON[_0x5eb314(0x1ee)](_0x3dfcab,null,0x2)+'\x0a',_0x5eb314(0x1eb)),renameSync(_0x5a6fc2,_0x258f2f);}export function deletePushRecovery(_0x3d0ddb){const _0x3d167f=a139_0x270e,_0x207757=getPushRecoveryPath(_0x3d0ddb);try{unlinkSync(_0x207757);}catch(_0x1b2cc7){_0x1b2cc7['code']!==_0x3d167f(0x1ec)&&logger[_0x3d167f(0x1f6)](_0x3d167f(0x1e5)+_0x1b2cc7);}}export function saveSegmentToPushRecovery(_0xd25763,_0xe3455e,_0x19d2a0,_0x4510c7){const _0x9173f9=a139_0x270e,_0x5f38a1=readPushRecovery(_0xd25763),_0x277f9a=_0x5f38a1?.[_0x9173f9(0x1f4)]===_0xe3455e?{..._0x5f38a1,'updatedAt':new Date()[_0x9173f9(0x1e6)]()}:{'version':0x1,'journeyName':_0xe3455e,'updatedAt':new Date()[_0x9173f9(0x1e6)](),'segments':{}};_0x277f9a['segments'][_0x19d2a0]=_0x4510c7,writePushRecovery(_0xd25763,_0x277f9a);}
1
+ (function(_0xdbb04e,_0xab39cc){const _0xb74309=a139_0xc707,_0x2aba9d=_0xdbb04e();while(!![]){try{const _0x484e04=-parseInt(_0xb74309(0x136))/0x1+-parseInt(_0xb74309(0x12c))/0x2+parseInt(_0xb74309(0x13d))/0x3+-parseInt(_0xb74309(0x12f))/0x4*(-parseInt(_0xb74309(0x13e))/0x5)+parseInt(_0xb74309(0x134))/0x6*(parseInt(_0xb74309(0x13a))/0x7)+-parseInt(_0xb74309(0x131))/0x8+parseInt(_0xb74309(0x12e))/0x9;if(_0x484e04===_0xab39cc)break;else _0x2aba9d['push'](_0x2aba9d['shift']());}catch(_0x29db3f){_0x2aba9d['push'](_0x2aba9d['shift']());}}}(a139_0x3669,0xaf120));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a139_0x1f78e9 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x4951bb){const _0x38a951=a139_0xc707,_0x1b1cdd=a139_0x1f78e9['dirname'](_0x4951bb),_0x54e2b0=a139_0x1f78e9[_0x38a951(0x127)](_0x4951bb);return a139_0x1f78e9['join'](_0x1b1cdd,'.'+_0x54e2b0+_0x38a951(0x129));}function a139_0x3669(){const _0xbef6a=['1645851CQknuJ','10ANAUAN','segments','basename','.tmp','.push-recovery.json','debug','utf-8','2401574ozARdD','warn','4116177oVhboU','1315568zpLIfU','string','8171784AbFzvi','ENOENT','toISOString','402570OfWlbx','code','66306ykkoZu','stringify','version','parse','140YxDXLx','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'];a139_0x3669=function(){return _0xbef6a;};return a139_0x3669();}export function readPushRecovery(_0x3005c9){const _0x368f9b=a139_0xc707,_0x167095=getPushRecoveryPath(_0x3005c9);if(!existsSync(_0x167095))return undefined;try{const _0x28092e=readFileSync(_0x167095,'utf-8'),_0x4f0f98=JSON[_0x368f9b(0x139)](_0x28092e);if(_0x4f0f98?.[_0x368f9b(0x138)]!==0x1||typeof _0x4f0f98['journeyName']!==_0x368f9b(0x130))return undefined;return _0x4f0f98;}catch(_0xbb3e2d){return _0xbb3e2d instanceof SyntaxError?logger['debug']('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0xbb3e2d):logger[_0x368f9b(0x12d)](_0x368f9b(0x13c)+_0xbb3e2d),undefined;}}function a139_0xc707(_0x543313,_0x8ded4b){_0x543313=_0x543313-0x126;const _0x36694b=a139_0x3669();let _0xc7077f=_0x36694b[_0x543313];return _0xc7077f;}export function writePushRecovery(_0x2d4140,_0x3342f6){const _0x2b3cec=a139_0xc707,_0x5dafc8=getPushRecoveryPath(_0x2d4140),_0x5a5c9f=_0x5dafc8+_0x2b3cec(0x128);writeFileSync(_0x5a5c9f,JSON[_0x2b3cec(0x137)](_0x3342f6,null,0x2)+'\x0a',_0x2b3cec(0x12b)),renameSync(_0x5a5c9f,_0x5dafc8);}export function deletePushRecovery(_0x21052a){const _0x4a4098=a139_0xc707,_0x221a8d=getPushRecoveryPath(_0x21052a);try{unlinkSync(_0x221a8d);}catch(_0x411763){_0x411763[_0x4a4098(0x135)]!==_0x4a4098(0x132)&&logger[_0x4a4098(0x12a)](_0x4a4098(0x13b)+_0x411763);}}export function saveSegmentToPushRecovery(_0x5c25d1,_0x510d3a,_0x2635d8,_0x3c2d0a){const _0x4ec6aa=a139_0xc707,_0x4defbb=readPushRecovery(_0x5c25d1),_0x125109=_0x4defbb?.['journeyName']===_0x510d3a?{..._0x4defbb,'updatedAt':new Date()[_0x4ec6aa(0x133)]()}:{'version':0x1,'journeyName':_0x510d3a,'updatedAt':new Date()[_0x4ec6aa(0x133)](),'segments':{}};_0x125109[_0x4ec6aa(0x126)][_0x2635d8]=_0x3c2d0a,writePushRecovery(_0x5c25d1,_0x125109);}
@@ -1 +1 @@
1
- const a140_0x374048=a140_0x2c7d;(function(_0x21e175,_0x5865a2){const _0x2e2ffb=a140_0x2c7d,_0x2bd042=_0x21e175();while(!![]){try{const _0x5aef74=-parseInt(_0x2e2ffb(0x1d8))/0x1+parseInt(_0x2e2ffb(0x164))/0x2+-parseInt(_0x2e2ffb(0x1de))/0x3+-parseInt(_0x2e2ffb(0x230))/0x4*(-parseInt(_0x2e2ffb(0x21a))/0x5)+-parseInt(_0x2e2ffb(0x233))/0x6+parseInt(_0x2e2ffb(0x221))/0x7+-parseInt(_0x2e2ffb(0x200))/0x8*(parseInt(_0x2e2ffb(0x154))/0x9);if(_0x5aef74===_0x5865a2)break;else _0x2bd042['push'](_0x2bd042['shift']());}catch(_0x3ab103){_0x2bd042['push'](_0x2bd042['shift']());}}}(a140_0x2544,0x56698));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a140_0x374048(0x1cb));export const PENDING_SEGMENT_PREFIX=a140_0x374048(0x1a8);export const PENDING_ACTIVATION_PREFIX=a140_0x374048(0x190);export function createPendingSegmentId(_0x3adffd){return''+PENDING_SEGMENT_PREFIX+_0x3adffd+'__';}export function isPendingSegmentId(_0xa0b652){const _0x333615=a140_0x374048;return _0xa0b652[_0x333615(0x234)](PENDING_SEGMENT_PREFIX)&&!_0xa0b652['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1a50be){const _0x27be2f=a140_0x374048;return _0x1a50be[_0x27be2f(0x202)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x50c777){return''+PENDING_ACTIVATION_PREFIX+_0x50c777+'__';}export function isPendingActivationId(_0x3f0cc6){const _0x484d7f=a140_0x374048;return _0x3f0cc6[_0x484d7f(0x234)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4f4870){const _0xb9b8e2=a140_0x374048;return _0x4f4870[_0xb9b8e2(0x202)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x54ed6c,_0x5f5c4a){const _0x3a6f2e=a140_0x374048,_0x1d77c9=_0x54ed6c+'::'+(_0x5f5c4a[_0x3a6f2e(0x170)]()||_0x3a6f2e(0x1aa)),_0x357cdb=createHash(_0x3a6f2e(0x191))[_0x3a6f2e(0x177)](_0x1d77c9)['digest'](_0x3a6f2e(0x22b))[_0x3a6f2e(0x189)](0x0,0xc);return _0x3a6f2e(0x1dd)+_0x357cdb;}export function ensureJourneyDefaults(_0x41c742){const _0x31e8a9=a140_0x374048;!_0x41c742[_0x31e8a9(0x1f9)]&&(_0x41c742[_0x31e8a9(0x1f9)]=''),!_0x41c742['state']&&(_0x41c742[_0x31e8a9(0x1ba)]=_0x31e8a9(0x167));}export function injectExistingStageIds(_0x1b51a0,_0x5bb971){const _0x33b647=a140_0x374048,_0x4b3bdc=new Map(_0x5bb971[_0x33b647(0x197)](_0x36038b=>[_0x36038b[_0x33b647(0x1f7)],_0x36038b['id']]));for(const _0x1f97b9 of _0x1b51a0){if(!_0x1f97b9['id']){const _0x2fcd36=_0x4b3bdc['get'](_0x1f97b9[_0x33b647(0x1f7)]);_0x2fcd36&&(_0x1f97b9['id']=_0x2fcd36);}}}export function resolveTDFolderPath(_0x2e9770,_0x3b6591,_0xa41fe){if(!_0x3b6591)return _0x2e9770;if(_0x2e9770===_0xa41fe||_0x2e9770['startsWith'](_0xa41fe+'/'))return _0x2e9770;return _0x2e9770?_0xa41fe+'/'+_0x2e9770:_0xa41fe;}export function addFoldersToCreate(_0x5816,_0x5efbf3,_0x4390db){const _0x100dd3=a140_0x374048;if(!_0x5816)return;if(_0x5efbf3['has'](_0x5816))return;const _0x3dd886=_0x5816[_0x100dd3(0x1a4)]('/');let _0x52f2e1='';for(const _0x3fd2e1 of _0x3dd886){_0x52f2e1=_0x52f2e1?_0x52f2e1+'/'+_0x3fd2e1:_0x3fd2e1,!_0x5efbf3[_0x100dd3(0x204)](_0x52f2e1)&&_0x4390db[_0x100dd3(0x231)](_0x52f2e1);}}export function sortFoldersByDepth(_0x5b50ea){const _0x4a4845=a140_0x374048;return[..._0x5b50ea][_0x4a4845(0x19c)]((_0x1a40b3,_0x2c97d8)=>{const _0x2d9789=_0x4a4845,_0x97c6e4=(_0x1a40b3[_0x2d9789(0x192)](/\//g)||[])[_0x2d9789(0x175)],_0x886e71=(_0x2c97d8[_0x2d9789(0x192)](/\//g)||[])[_0x2d9789(0x175)];return _0x97c6e4-_0x886e71;});}import*as a140_0x3d0ce6 from'yaml';import{readFileSync}from'fs';import a140_0x20c889 from'path';import{isJourneyDef,parseYamlString as a140_0x5503f4,toYamlString as a140_0x4660f1,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a140_0x2544(){const _0x15be30=['\x27...','741160ieXJRO','existingActivation','create','index','stringify','segment_updating','Created\x20journey\x20\x27','1641444JfkhGB','exitCriterias','embeddedSegmentNameToId','getSegmentEntity','entries','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','toLowerCase','yamlActivation','buildUserMaps','withProgress','hex','SEGMENT_NOT_FOUND','folder_creating','entry','\x0a\x20\x20','16ZuhbGu','add','connection','3487848xyVEBB','startsWith','object','getSegment\x20failed\x20for\x20','yamlConfig','Delete\x20the\x20push\x20recovery\x20file\x20(','journeyBundleName','listActivations','segmentId','notification','getSegment','activation_deleting','createSegment','parseDocument','segmentNameToId','versionNumber','./child-segment-yaml.js','null','logWarning','segmentByFolderAndName','columns','debug','createdSegmentIds','from','waitStepType','list','Journey\x20\x27','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','segment_deleting','SEGMENT_UPDATE_ERROR','deleted','all_columns','parentId','\x20journey\x20from\x20file:\x20','Created\x20segment\x20\x27','\x27\x20entry\x20criteria','createdSegmentId','Segment\x20not\x20found:\x20','3897sRkYAu','Creating\x20segment\x20\x27','Updated\x20activation\x20\x27','deleteSegment','ACTIVATION_UPDATE_ERROR','unchanged','valid','dirname','getLatestJourneyId','segmentFolderId','journeyId','logInfo','Failed\x20to\x20','uniqueServerName','relationships','idToEmailMap','1106046GtlTEA','conditionTimeoutDuration','Matched\x20server\x20segment\x20\x27','draft','filter','connectionIdToNameMap','activation_creating','createActivation','activationStepsById','folder','reduce','\x20segment\x20from\x20file:\x20','trim','journeyById','idToName','stages','activationsBySegmentId','length','user','update','existingSegments','journey_created','rule','\x27\x20by\x20rule\x20content','updateActivation','behavior','resolveSegment','segment_creating','segment_created','updated','embedded_activation_creating','NOT_FOUND','journeyActivationStepId','\x27\x20exit\x20criteria','embedded_segment_created','folderPathToId','segment_updated','slice','goal\x20criteria','activationContext','values','\x27\x20wait\x20condition','parentFolder','journeyBundleId','__pending_act_','sha1','match','nameToId','createJourneySegment','hasChanges','\x27\x20to\x20local\x20\x27','map','journeyBundlesByFolderAndName','updateSegmentById','):\x20','Updating\x20activation\x20\x27','sort','journeyName','stage\x20\x27','getSegmentEntity\x20also\x20failed\x20for\x20','rootFolderId','toString','parse','size','split','folderId','activations','find','__pending_','conditionSegmentId','segment','\x20(referenced\x20in\x20journey\x20','Fetching\x20','attributes','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','push','isNew','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Failed\x20to\x20resolve\x20activation\x20','toISOString','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','max','keys','folder_created','and\x20the\x20server\x20segment,\x20then\x20retry.','state','verbose','nameToType','journey_updated','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Failed\x20to\x20resolve\x20segment\x20','steps','journey_updating','DecisionPoint','delete','INTERNAL','journey_creating','set','conditionTimeoutUnit','journeyStages','journeys','validatedRequest','tdx.sdk.push-workflow','logDeleted','run_after_journey_refresh','Segment\x20not\x20found','activationActions','onProgress','relative','entryCriteria','Deleted\x20activation\x20\x27','message','createFolder','Creating\x20folder\x20\x27','./journey-yaml.js','228494bMbrPa','join','Created\x20activation\x20\x27','waitStepUnit','schedule','journey_entry_criteria_','147378hiemgS','data','activation_','existingJourney','\x27\x20for\x20','segment_deleted','Created\x20folder\x20\x27','segments','Updated\x20journey\x20\x27','../../utils/async.js','utf-8',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','getJourney','Stage\x20\x27','isArray','uniqueSegmentName','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','activationParams','type','WaitStep','deps','Deleting\x20activation\x20\x27','Condition','conditions','item','name',').\x20','description','deleteActivation','action','Activation','activation_created','Creating\x20activation\x20\x27','journey','3096waTiwR','Entry\x20criteria:\x20','replace','get','has','entry_criteria','Embedded\x20segment\x20\x27','\x20error(s)','folderPath','resolvedRule','goal','branches','created','Activation\x20not\x20found:\x20','\x27\x20decision\x20point\x20branch\x20\x27','logSuccess','some','absolutePath','journeyActivationNameToId','embedded_segment_creating','progress','milestone','existingSegment','waitStep','localName'];a140_0x2544=function(){return _0x15be30;};return a140_0x2544();}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(_0x3d7fd6){const _0x13ae6e=a140_0x374048;if(Array[_0x13ae6e(0x1ec)](_0x3d7fd6))return'['+_0x3d7fd6[_0x13ae6e(0x197)](_0xf0080d=>stableStringify(_0xf0080d))['join'](',')+']';if(_0x3d7fd6&&typeof _0x3d7fd6===_0x13ae6e(0x235)){const _0x4a8719=_0x3d7fd6,_0x105c64=Object[_0x13ae6e(0x1b7)](_0x4a8719)[_0x13ae6e(0x19c)](),_0x4fabd9=_0x105c64[_0x13ae6e(0x197)](_0x270dba=>'\x22'+_0x270dba+'\x22:'+stableStringify(_0x4a8719[_0x270dba]));return'{'+_0x4fabd9[_0x13ae6e(0x1d9)](',')+'}';}const _0x3d9d10=JSON['stringify'](_0x3d7fd6);return _0x3d9d10===undefined?_0x13ae6e(0x13f):_0x3d9d10;}function activationSignature(_0x2cf556){const _0x4ec948=a140_0x374048,_0x29483a={'connection':_0x2cf556[_0x4ec948(0x232)],..._0x2cf556[_0x4ec948(0x14d)]!==undefined&&{'all_columns':_0x2cf556[_0x4ec948(0x14d)]},..._0x2cf556[_0x4ec948(0x142)]!==undefined&&{'columns':_0x2cf556['columns']},..._0x2cf556[_0x4ec948(0x17d)]!==undefined&&{'behavior':_0x2cf556[_0x4ec948(0x17d)]},..._0x2cf556[_0x4ec948(0x1dc)]!==undefined&&{'schedule':_0x2cf556['schedule']},..._0x2cf556[_0x4ec948(0x23c)]!==undefined&&{'notification':_0x2cf556[_0x4ec948(0x23c)]},..._0x2cf556['connector_config']!==undefined&&{'connector_config':_0x2cf556['connector_config']},..._0x2cf556['activation_template_id']!==undefined&&{'activation_template_id':_0x2cf556['activation_template_id']}};return stableStringify(_0x29483a);}async function fetchSegment(_0x2f1d15,_0x4e99db,_0x438651,_0x56366f){const _0x68aafe=a140_0x374048,_0x316e0b=_0x56366f?.[_0x68aafe(0x1a7)](_0x597340=>_0x597340['id']===_0x438651);if(_0x316e0b)return _0x316e0b;try{return await _0x2f1d15[_0x68aafe(0x1aa)][_0x68aafe(0x23d)](_0x4e99db,_0x438651);}catch(_0x491351){logger[_0x68aafe(0x143)](_0x68aafe(0x236)+_0x438651+_0x68aafe(0x1e9)+_0x491351);try{return await _0x2f1d15[_0x68aafe(0x1aa)][_0x68aafe(0x224)](_0x438651);}catch(_0x4186e0){return logger[_0x68aafe(0x143)](_0x68aafe(0x19f)+_0x438651+':\x20'+_0x4186e0),null;}}}function recoverSegmentIdsFromPushRecovery(_0x5a9ced,_0x360254,_0x3c8349){const _0x43fd89=a140_0x374048,_0x47b5e1=readPushRecovery(_0x5a9ced[_0x43fd89(0x211)]);if(_0x47b5e1?.['journeyName']===_0x5a9ced['yamlConfig']['name'])for(const [_0x2bff25,_0x96f308]of Object[_0x43fd89(0x225)](_0x47b5e1['segments'])){const _0x8dc3a7=generateDeterministicJourneySegmentName(_0x5a9ced[_0x43fd89(0x237)][_0x43fd89(0x1f7)],_0x2bff25);_0x96f308[_0x43fd89(0x161)]===_0x8dc3a7&&(_0x360254[_0x43fd89(0x1c6)](_0x2bff25,_0x96f308[_0x43fd89(0x23b)]),_0x3c8349['set'](_0x2bff25,_0x96f308[_0x43fd89(0x23b)]));}}async function createOrRecoverEmbeddedSegment(_0x3fb5cd,_0x5ccd87,_0x3b1e19,_0x19f341){const _0x23f721=a140_0x374048;let _0x30bb6b;try{_0x30bb6b=await _0x3fb5cd[_0x23f721(0x1aa)][_0x23f721(0x194)]({'name':_0x3b1e19[_0x23f721(0x1ed)],'description':_0x3b1e19[_0x23f721(0x1f9)],'journeyId':_0x3b1e19[_0x23f721(0x15e)],'rule':_0x19f341(_0x3b1e19['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x3b1e19[_0x23f721(0x1a5)],'audienceId':_0x3b1e19[_0x23f721(0x14e)]});}catch(_0x29675f){const _0x18d8a0=_0x29675f instanceof Error&&_0x29675f[_0x23f721(0x1d4)]['includes']('Name\x20has\x20already\x20been\x20taken');if(_0x18d8a0){const _0x5040d6=readPushRecovery(_0x5ccd87[_0x23f721(0x211)]),_0x534797=_0x5040d6?.[_0x23f721(0x19d)]===_0x5ccd87[_0x23f721(0x237)][_0x23f721(0x1f7)]?_0x5040d6[_0x23f721(0x1e5)][_0x3b1e19[_0x23f721(0x218)]]:undefined;if(_0x534797?.[_0x23f721(0x161)]===_0x3b1e19['uniqueSegmentName'])await _0x3fb5cd[_0x23f721(0x1aa)][_0x23f721(0x199)](_0x3b1e19['parentId'],_0x534797[_0x23f721(0x23b)],{'description':_0x3b1e19[_0x23f721(0x1f9)],'rule':_0x19f341(_0x3b1e19[_0x23f721(0x209)],!![]),'countPopulation':!![]}),_0x30bb6b=_0x534797[_0x23f721(0x23b)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x23f721(0x206)+_0x3b1e19[_0x23f721(0x218)]+_0x23f721(0x1be)+(_0x23f721(0x238)+_0x5ccd87[_0x23f721(0x211)]['replace'](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x23f721(0x1b9),_0x29675f);}else throw _0x29675f;}return saveSegmentToPushRecovery(_0x5ccd87[_0x23f721(0x211)],_0x5ccd87['yamlConfig'][_0x23f721(0x1f7)],_0x3b1e19[_0x23f721(0x218)],{'segmentId':_0x30bb6b,'uniqueServerName':_0x3b1e19[_0x23f721(0x1ed)],'createdAt':new Date()[_0x23f721(0x1b4)]()}),_0x30bb6b;}export async function prepareSegmentFiles(_0x426204,_0x3ff695,_0x29c521,_0x422133,_0x32e543){const _0x5b1ae0=a140_0x374048,{activationDefToCreateRequest:_0x21be86}=await import(_0x5b1ae0(0x13e)),_0x609745=[],_0x9d4d9=new Set();for(const {yamlConfig:_0x21ddf3,folderPath:_0x305803,sourcePath:_0x180bc8}of _0x426204){const _0x1cebdf=resolveTDFolderPath(_0x305803,_0x422133,_0x32e543),_0xc93fbe=_0x1cebdf+':'+_0x21ddf3[_0x5b1ae0(0x1f7)],_0x4846f7=_0x3ff695[_0x5b1ae0(0x141)]['get'](_0xc93fbe),_0x8f360b=_0x4846f7?_0x3ff695[_0x5b1ae0(0x174)][_0x5b1ae0(0x203)](_0x4846f7['id'])||[]:[];addFoldersToCreate(_0x1cebdf,_0x3ff695['folderPathToId'],_0x9d4d9);const _0x2513d8=calculateActivationActions(_0x21ddf3[_0x5b1ae0(0x1a6)]||[],_0x8f360b,_0x3ff695['idToEmailMap'],_0x3ff695[_0x5b1ae0(0x169)]);for(const _0x2bde9c of _0x2513d8){(_0x2bde9c[_0x5b1ae0(0x1f0)]===_0x5b1ae0(0x21c)||_0x2bde9c[_0x5b1ae0(0x1f0)]==='update')&&_0x2bde9c['yamlActivation']&&(_0x2bde9c['validatedRequest']=await _0x21be86(_0x2bde9c[_0x5b1ae0(0x228)],_0x29c521));}const _0x339d40=calculateSegmentDiff(_0x21ddf3,_0x4846f7,_0x8f360b,_0x3ff695[_0x5b1ae0(0x163)],_0x3ff695['connectionIdToNameMap']);_0x609745[_0x5b1ae0(0x1b0)]({'relativePath':_0x21ddf3['name'],'absolutePath':_0x180bc8,'yamlConfig':_0x21ddf3,'folderPath':_0x1cebdf,'existingSegment':_0x4846f7,'existingActivations':_0x8f360b,'isNew':_0x339d40[_0x5b1ae0(0x1b1)],'hasChanges':_0x339d40[_0x5b1ae0(0x195)],'diff':_0x339d40['diff'],'activationActions':_0x2513d8});}return{'segmentFiles':_0x609745,'foldersToCreate':_0x9d4d9};}export async function prepareJourneyFiles(_0x5ec2e9,_0x18ebb0,_0x252a93,_0x1f6625){const _0x23918c=a140_0x374048,_0x56cc95=[],_0x5cf9ff=new Set();for(const {yamlConfig:_0x3137f5,folderPath:_0x2fbf89,sourcePath:_0x526fb2}of _0x5ec2e9){const _0x4057db=resolveTDFolderPath(_0x2fbf89,_0x252a93,_0x1f6625),_0x117d96=_0x4057db+':'+_0x3137f5[_0x23918c(0x1f7)],_0x32f84e=_0x18ebb0[_0x23918c(0x198)][_0x23918c(0x203)](_0x117d96);let _0x3f2b82,_0x1f0617;if(_0x32f84e&&_0x32f84e['length']>0x0){const _0x119789=buildLocalExpandedRuleMappings(_0x3137f5),{createYamlContext:_0x2b1a07,prefetchJourneySegments:_0x1e94e1}=createPushYamlContextForBundle(_0x18ebb0[_0x23918c(0x1f2)],_0x18ebb0['parentId'],_0x18ebb0[_0x23918c(0x178)],_0x119789,_0x18ebb0[_0x23918c(0x163)],_0x18ebb0[_0x23918c(0x169)],_0x18ebb0[_0x23918c(0x16c)],_0x18ebb0[_0x23918c(0x171)]);await _0x1e94e1(_0x32f84e[_0x23918c(0x197)](_0x194d3a=>_0x194d3a['id']));const _0x5ef035=await _0x18ebb0[_0x23918c(0x1f2)][_0x23918c(0x1ff)][_0x23918c(0x15c)](_0x32f84e[0x0][_0x23918c(0x18f)]),_0x4af39e=hasMultipleVersions(_0x3137f5),_0x300952=async _0xf2ca1c=>{const _0x3a722e=_0x23918c,_0x1e9f33=_0x18ebb0[_0x3a722e(0x171)]?.[_0x3a722e(0x203)](_0xf2ca1c);if(_0x1e9f33)return _0x1e9f33;return _0x18ebb0['fetchJourney']({'journeyId':_0xf2ca1c,'journeyName':_0x3137f5[_0x3a722e(0x1f7)],'isMultiVersion':_0x32f84e[_0x3a722e(0x175)]>0x1});};if(_0x4af39e&&_0x32f84e[_0x23918c(0x175)]>0x1){const _0x43c293=[];for(const _0x3ef09e of _0x32f84e){const _0x337fff=_0x3ef09e[_0x23918c(0x13d)]||0x1;_0x18ebb0[_0x23918c(0x214)]?.[_0x23918c(0x177)](_0x23918c(0x1ac)+_0x3137f5[_0x23918c(0x1f7)]+'\x20v'+_0x337fff);const _0xd3df68=await _0x300952(_0x3ef09e['id']),_0x11623b=_0x2b1a07(_0x3ef09e['id']),_0x447d21=await journeyResponseToDef(_0xd3df68,_0x11623b);_0x43c293[_0x23918c(0x1b0)]({'item':_0x3ef09e,'yaml':_0x447d21});}const _0x338a2a=buildLocalRuleToNameMappingFromJourney(_0x3137f5);_0x1f0617=buildMergedJourneyDef(_0x43c293,_0x338a2a,_0x5ef035);const _0x5d09e3=Math['max'](..._0x43c293[_0x23918c(0x197)](_0x4bca72=>_0x4bca72[_0x23918c(0x1f6)][_0x23918c(0x13d)]||0x0)),_0x2abc5d=_0x32f84e['find'](_0x419c93=>(_0x419c93[_0x23918c(0x13d)]||0x0)===_0x5d09e3);_0x2abc5d&&(_0x18ebb0[_0x23918c(0x214)]?.[_0x23918c(0x177)](_0x23918c(0x1ac)+_0x3137f5['name']+'\x20v'+_0x5d09e3),_0x3f2b82=await _0x300952(_0x2abc5d['id']));}else{const _0x3765dc=_0x32f84e[_0x32f84e[_0x23918c(0x175)]-0x1];_0x18ebb0[_0x23918c(0x214)]?.[_0x23918c(0x177)]('Fetching\x20'+_0x3137f5[_0x23918c(0x1f7)]),_0x3f2b82=await _0x300952(_0x3765dc['id']);const _0x37837=_0x2b1a07(_0x3765dc['id']),_0x12b4d7=await journeyResponseToDef(_0x3f2b82,_0x37837),_0x1eb122=buildLocalRuleToNameMappingFromJourney(_0x3137f5);_0x1f0617=buildMergedJourneyDef([{'item':_0x3765dc,'yaml':_0x12b4d7}],_0x1eb122,_0x5ef035);}}addFoldersToCreate(_0x4057db,_0x18ebb0[_0x23918c(0x187)],_0x5cf9ff);const _0x2f6399=calculateJourneyDiff(_0x3137f5,_0x1f0617);_0x56cc95['push']({'relativePath':_0x3137f5[_0x23918c(0x1f7)],'absolutePath':_0x526fb2,'yamlConfig':_0x3137f5,'folderPath':_0x4057db,'existingJourney':_0x3f2b82,'isNew':_0x2f6399[_0x23918c(0x1b1)],'hasChanges':_0x2f6399[_0x23918c(0x195)],'diff':_0x2f6399['diff']});}return{'journeyFiles':_0x56cc95,'foldersToCreate':_0x5cf9ff};}export function calculateActivationActions(_0x261fe6,_0x3d590c,_0x801d5d,_0xced7f6){const _0x33e477=a140_0x374048,_0x218da9=[],_0x482fa7=new Map();for(const _0x49745f of _0x3d590c){_0x482fa7[_0x33e477(0x1c6)](_0x49745f[_0x33e477(0x1f7)],_0x49745f);}const _0x9ede6a=new Map();for(const _0x6626d of _0x261fe6){_0x9ede6a[_0x33e477(0x1c6)](_0x6626d[_0x33e477(0x1f7)],_0x6626d);}for(const _0x597e81 of _0x261fe6){const _0x2028a4=_0x482fa7['get'](_0x597e81[_0x33e477(0x1f7)]);if(!_0x2028a4)_0x218da9[_0x33e477(0x1b0)]({'type':'create','name':_0x597e81[_0x33e477(0x1f7)],'yamlActivation':_0x597e81});else{const _0x12a2e4=activationResponseToDef(_0x2028a4,_0x801d5d,_0xced7f6),_0x5131d1=a140_0x3d0ce6['stringify'](_0x12a2e4),_0x556926=a140_0x3d0ce6[_0x33e477(0x21e)](_0x597e81);_0x5131d1!==_0x556926&&_0x218da9[_0x33e477(0x1b0)]({'type':_0x33e477(0x177),'name':_0x597e81[_0x33e477(0x1f7)],'yamlActivation':_0x597e81,'existingActivation':_0x2028a4});}}for(const _0x21ea94 of _0x3d590c){!_0x9ede6a[_0x33e477(0x204)](_0x21ea94[_0x33e477(0x1f7)])&&_0x218da9[_0x33e477(0x1b0)]({'type':_0x33e477(0x1c3),'name':_0x21ea94['name'],'existingActivation':_0x21ea94});}return _0x218da9;}function calculateYamlDiff(_0x4b29c2,_0x2f06b1){if(_0x2f06b1){const _0x2a01ef=generateDiff(_0x2f06b1,_0x4b29c2),_0x163c37=hasChanges(_0x2a01ef);return{'isNew':![],'hasChanges':_0x163c37,'diff':_0x163c37?formatDiffWithColors(_0x2a01ef):undefined};}const _0xb7125b=generateDiff('',_0x4b29c2);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xb7125b)};}export function calculateSegmentDiff(_0x37154e,_0x50deca,_0x3cf8b4,_0x16948b,_0x25f23e){const _0x40d361=segmentToYamlString(_0x37154e),_0x3929af=_0x50deca?segmentToYamlString(segmentWithActivationsToYaml(_0x50deca,_0x3cf8b4,undefined,_0x16948b,_0x25f23e)):undefined;return calculateYamlDiff(_0x40d361,_0x3929af);}export function calculateJourneyDiff(_0x1da856,_0x1bb35c){const _0x226337=normalizeJourneyDef(_0x1da856,_0x1da856),_0x47e156=a140_0x4660f1(_0x226337),_0x943a63=_0x1bb35c?a140_0x4660f1(normalizeJourneyDef(_0x1bb35c,_0x1da856)):undefined;return calculateYamlDiff(_0x47e156,_0x943a63);}export function findSegmentsToDelete(_0x4a7395,_0x3162b6,_0x341e42,_0x241e51,_0xd9540d){const _0x39a78d=a140_0x374048,_0x503918=new Set();for(const {yamlConfig:_0x54fefe,folderPath:_0x2985c1}of _0x3162b6){_0x503918[_0x39a78d(0x231)](_0x2985c1+':'+_0x54fefe[_0x39a78d(0x1f7)]);}return _0x4a7395['filter'](_0x5ee197=>{const _0x120749=_0x39a78d,_0x4e006b=_0x5ee197[_0x120749(0x15d)]?_0x341e42[_0x120749(0x203)](_0x5ee197[_0x120749(0x15d)]['toString']())||'':'',_0x329ed7=_0x4e006b+':'+_0x5ee197[_0x120749(0x1f7)];if(_0x503918[_0x120749(0x204)](_0x329ed7))return![];if(_0xd9540d)return _0x4e006b===_0x241e51||_0x4e006b[_0x120749(0x234)](_0x241e51+'/');return!![];});}export function findJourneysToDelete(_0x434026,_0x557aee,_0x48714a,_0x252120,_0x5ec023){const _0x46a7e7=a140_0x374048,_0x4926fb=new Set();for(const {yamlConfig:_0x1af39c,folderPath:_0x13595c}of _0x557aee){_0x4926fb[_0x46a7e7(0x231)](_0x13595c+':'+_0x1af39c[_0x46a7e7(0x1f7)]);}return _0x434026[_0x46a7e7(0x168)](_0x54671a=>{const _0x14682c=_0x46a7e7,_0x59b2f1=_0x54671a[_0x14682c(0x1a5)]?_0x48714a[_0x14682c(0x203)](_0x54671a['folderId'])||'':'',_0x2a5fb0=_0x59b2f1+':'+_0x54671a[_0x14682c(0x239)];if(_0x4926fb['has'](_0x2a5fb0))return![];if(_0x5ec023)return _0x59b2f1===_0x252120||_0x59b2f1[_0x14682c(0x234)](_0x252120+'/');return!![];});}export function buildSegmentLookupMap(_0x49f75d,_0x77fe91){const _0xc243fc=a140_0x374048,_0x2f243d=new Map();for(const _0x1ff315 of _0x49f75d){const _0x210050=_0x1ff315[_0xc243fc(0x15d)]?_0x77fe91[_0xc243fc(0x203)](_0x1ff315[_0xc243fc(0x15d)][_0xc243fc(0x1a1)]())||'':'',_0x4906d7=_0x210050+':'+_0x1ff315[_0xc243fc(0x1f7)];_0x2f243d['set'](_0x4906d7,_0x1ff315);}return _0x2f243d;}export function buildSegmentNameToIdMap(_0x1d7cfe){const _0x214d0b=a140_0x374048,_0x2a4fee=new Map();for(const _0x13d42f of _0x1d7cfe){_0x2a4fee[_0x214d0b(0x1c6)](_0x13d42f[_0x214d0b(0x1f7)],_0x13d42f['id']);}return _0x2a4fee;}export function buildJourneyBundleLookupMap(_0x3c52de,_0x25f5f8){const _0xf193cb=a140_0x374048,_0x616b5f=new Map();for(const _0x5cbde8 of _0x3c52de){const _0x214b26=_0x5cbde8[_0xf193cb(0x1a5)]?_0x25f5f8['get'](_0x5cbde8[_0xf193cb(0x1a5)])||'':'',_0x54c0c3=_0x214b26+':'+_0x5cbde8[_0xf193cb(0x239)];!_0x616b5f['has'](_0x54c0c3)&&_0x616b5f[_0xf193cb(0x1c6)](_0x54c0c3,[]),_0x616b5f[_0xf193cb(0x203)](_0x54c0c3)[_0xf193cb(0x1b0)](_0x5cbde8);}for(const _0x36a8b4 of _0x616b5f[_0xf193cb(0x18c)]()){_0x36a8b4[_0xf193cb(0x19c)]((_0x3609ca,_0x40b118)=>(_0x3609ca[_0xf193cb(0x13d)]||0x0)-(_0x40b118[_0xf193cb(0x13d)]||0x0));}return _0x616b5f;}export function collectFoldersToCreate(_0x39de9b,_0x636136){const _0x495be3=a140_0x374048,_0x19fc88=new Set();for(const _0x24f6e8 of _0x39de9b){if(!_0x24f6e8)continue;if(_0x636136[_0x495be3(0x204)](_0x24f6e8))continue;const _0x4cd2c5=_0x24f6e8['split']('/');let _0x2ef937='';for(const _0x3d42a9 of _0x4cd2c5){_0x2ef937=_0x2ef937?_0x2ef937+'/'+_0x3d42a9:_0x3d42a9,!_0x636136['has'](_0x2ef937)&&_0x19fc88['add'](_0x2ef937);}}return _0x19fc88;}export function parseAndClassifyYamlFiles(_0x684455,_0x25a548,_0xf510d){const _0x282121=a140_0x374048,_0x2a1366=[],_0x26cffc=[];for(const _0x30855a of _0x684455){const _0x427efc=a140_0x20c889[_0x282121(0x1d1)](_0x25a548,a140_0x20c889[_0x282121(0x15b)](_0x30855a)),_0x521104=_0x427efc==='.'?'':_0x427efc,_0x271a8d=readFileSync(_0x30855a,_0x282121(0x1e8)),_0x3ec4c7=a140_0x3d0ce6['parse'](_0x271a8d);if(isJourneyDef(_0x3ec4c7)){const _0x51f8a8=a140_0x5503f4(_0x271a8d);_0x26cffc['push']({'yamlConfig':_0x51f8a8,'folderPath':_0x521104,'sourcePath':_0x30855a});}else{if(!_0xf510d?.['skipSegments']){const _0x44f387=parseSegmentYamlFile(_0x271a8d),_0x394629=normalizeChildSegmentYaml(_0x44f387);_0x2a1366[_0x282121(0x1b0)]({'yamlConfig':_0x394629,'folderPath':_0x521104,'sourcePath':_0x30855a});}}}return{'segments':_0x2a1366,'journeys':_0x26cffc};}export function validateParsedFiles(_0x282a56,_0x5785dc){const _0x4e5e34=a140_0x374048,_0x176a31=[];for(const {yamlConfig:_0x120e0f,sourcePath:_0x4b15bf}of _0x282a56[_0x4e5e34(0x1e5)]){const _0x524edf=readFileSync(_0x4b15bf,'utf-8'),_0x42540d=a140_0x3d0ce6[_0x4e5e34(0x13b)](_0x524edf),_0x1d369a=validateSegmentDef(_0x120e0f,{'source':_0x524edf,'document':_0x42540d},{'skipSchema':!![]});if(!_0x1d369a[_0x4e5e34(0x15a)]){const _0x4b05b0=a140_0x20c889[_0x4e5e34(0x1d1)](_0x5785dc,_0x4b15bf);_0x176a31[_0x4e5e34(0x1b0)]({'filePath':_0x4b05b0,'source':_0x524edf,'result':_0x1d369a,'isJourney':![]});}}for(const {yamlConfig:_0x43e49a,sourcePath:_0x2fe883}of _0x282a56[_0x4e5e34(0x1c9)]){const _0x32477c=readFileSync(_0x2fe883,_0x4e5e34(0x1e8)),_0x5cb7dd=a140_0x3d0ce6[_0x4e5e34(0x13b)](_0x32477c),_0x467b27=validateJourneyDef(_0x43e49a,{'source':_0x32477c,'document':_0x5cb7dd},{'skipSchema':!![]});if(!_0x467b27[_0x4e5e34(0x15a)]){const _0x274954=a140_0x20c889[_0x4e5e34(0x1d1)](_0x5785dc,_0x2fe883);_0x176a31[_0x4e5e34(0x1b0)]({'filePath':_0x274954,'source':_0x32477c,'result':_0x467b27,'isJourney':!![]});}}return _0x176a31;}export function formatValidationErrors(_0x235193){const _0x581eac=a140_0x374048,_0x5cc7e6=[];for(const {filePath:_0x35aa31,source:_0x5b8516,result:_0x3f0be2,isJourney:_0x14a17c}of _0x235193){const _0x7b5444=_0x14a17c?_0x581eac(0x1ff):_0x581eac(0x1aa);_0x5cc7e6['push']('\x0a'+_0x35aa31+'\x20('+_0x7b5444+_0x581eac(0x19a)+_0x3f0be2['errors'][_0x581eac(0x175)]+_0x581eac(0x207)),_0x5cc7e6[_0x581eac(0x1b0)](formatValidationResult(_0x3f0be2,_0x5b8516,_0x35aa31));}return _0x5cc7e6[_0x581eac(0x1d9)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2443ff){const _0x49f5bd=a140_0x374048,_0x3bcf4f=new Set(),_0x3227f5=new Map(),_0x439ff4=collectSegmentUsageCounts(_0x2443ff);if(_0x2443ff[_0x49f5bd(0x1e5)])for(const [_0x252379,_0x357ab5]of Object[_0x49f5bd(0x225)](_0x2443ff[_0x49f5bd(0x1e5)])){_0x3bcf4f[_0x49f5bd(0x231)](_0x252379);if(_0x357ab5[_0x49f5bd(0x17a)]){const _0x3bd080=yamlRuleToApi(_0x357ab5[_0x49f5bd(0x17a)]),_0x3cd8aa=apiRuleToYaml(_0x3bd080);_0x3227f5[_0x49f5bd(0x1c6)](_0x252379,_0x3cd8aa);}}const _0x27d197=new Map();let _0x23d5b3=0x0;for(const [_0x234b1f,_0x55aa7e]of _0x3227f5){const _0x155b6a=serializeExpandedRule(_0x55aa7e,_0x3227f5),_0x3dd754=_0x27d197['get'](_0x155b6a)||[];_0x3dd754[_0x49f5bd(0x1b0)]({'name':_0x234b1f,'index':_0x23d5b3}),_0x27d197[_0x49f5bd(0x1c6)](_0x155b6a,_0x3dd754),_0x23d5b3++;}const _0x4eb854=new Map();for(const [_0x9c3a7b,_0x22780c]of _0x27d197){const _0x30a00a=_0x22780c[_0x49f5bd(0x189)]()[_0x49f5bd(0x19c)]((_0x1fadd6,_0x520729)=>{const _0x1f2e67=_0x49f5bd,_0x486c53=_0x439ff4[_0x1f2e67(0x203)](_0x1fadd6[_0x1f2e67(0x1f7)])||0x0,_0x2395d0=_0x439ff4[_0x1f2e67(0x203)](_0x520729[_0x1f2e67(0x1f7)])||0x0;if(_0x486c53!==_0x2395d0)return _0x2395d0-_0x486c53;return _0x1fadd6[_0x1f2e67(0x21d)]-_0x520729[_0x1f2e67(0x21d)];})[_0x49f5bd(0x197)](_0x2520e4=>_0x2520e4[_0x49f5bd(0x1f7)]),_0x3046ff=[];for(const _0xc81f2b of _0x30a00a){const _0x323f70=_0x439ff4[_0x49f5bd(0x203)](_0xc81f2b)||0x0,_0x44292e=Math[_0x49f5bd(0x1b6)](_0x323f70,0x1);for(let _0x36ca50=0x0;_0x36ca50<_0x44292e;_0x36ca50++){_0x3046ff['push'](_0xc81f2b);}}_0x4eb854[_0x49f5bd(0x1c6)](_0x9c3a7b,_0x3046ff);}return{'existingLocalSegmentNames':_0x3bcf4f,'localSegmentRules':_0x3227f5,'localExpandedRuleToNames':_0x4eb854};}export function createSegmentIdResolver(_0x200979,_0x383f0a){return async _0x3afa24=>{const _0x2aa8d5=a140_0x2c7d,_0x2cbfe6=_0x200979[_0x2aa8d5(0x203)](_0x3afa24);if(!_0x2cbfe6)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x3afa24+_0x2aa8d5(0x149)+_0x383f0a+'\x27)');return _0x2cbfe6;};}export function extractRootFolderId(_0x20d8e2){const _0x3669b3=a140_0x374048;return _0x20d8e2[_0x3669b3(0x162)]?.['parentSegmentFolder']?.[_0x3669b3(0x1df)]?.['id']||_0x20d8e2['relationships']?.[_0x3669b3(0x18e)]?.[_0x3669b3(0x1df)]?.['id'];}export function buildConnectionMaps(_0x3ea5f2){const _0x645c54=a140_0x374048,_0x29485e=new Map(),_0x5ec770=new Map(),_0x212b1c=new Map();for(const _0x420b49 of _0x3ea5f2){_0x29485e[_0x645c54(0x1c6)](_0x420b49[_0x645c54(0x1f7)],parseInt(_0x420b49['id'],0xa)),_0x5ec770['set'](_0x420b49['id'],_0x420b49[_0x645c54(0x1f7)]),_0x212b1c['set'](_0x420b49[_0x645c54(0x1f7)],_0x420b49[_0x645c54(0x1f0)]);}return{'nameToId':_0x29485e,'idToName':_0x5ec770,'nameToType':_0x212b1c};}export function calculatePushStats(_0x1a8a66,_0xee56cf,_0x56c361,_0x31bf29,_0x1ba9d6,_0x51939d,_0x206189){const _0x1c805b=a140_0x374048,_0x1374a6=_0x1a8a66['filter'](_0x1e3087=>_0x1e3087[_0x1c805b(0x1b1)]),_0x333697=_0x1a8a66['filter'](_0x439022=>!_0x439022[_0x1c805b(0x1b1)]&&_0x439022[_0x1c805b(0x195)]),_0x29eb00=_0x1a8a66[_0x1c805b(0x168)](_0x22a325=>!_0x22a325['isNew']&&!_0x22a325[_0x1c805b(0x195)]),_0x53178b=_0x51939d?_0x31bf29:[],_0x284ea2=_0xee56cf[_0x1c805b(0x168)](_0x3d7323=>_0x3d7323[_0x1c805b(0x1b1)]),_0x4680a6=_0xee56cf[_0x1c805b(0x168)](_0x12b254=>!_0x12b254[_0x1c805b(0x1b1)]&&_0x12b254['hasChanges']),_0x56a3c5=_0xee56cf[_0x1c805b(0x168)](_0x4fda2c=>!_0x4fda2c[_0x1c805b(0x1b1)]&&!_0x4fda2c[_0x1c805b(0x195)]),_0x2ea624=_0x51939d?_0x1ba9d6:[],_0x4e128a=_0x1a8a66['flatMap'](_0xa0d89b=>_0xa0d89b[_0x1c805b(0x1cf)]),_0x4833bb=_0x4e128a[_0x1c805b(0x168)](_0xe999cd=>_0xe999cd[_0x1c805b(0x1f0)]===_0x1c805b(0x21c)),_0x38b8f7=_0x4e128a[_0x1c805b(0x168)](_0xdb5229=>_0xdb5229[_0x1c805b(0x1f0)]===_0x1c805b(0x177)),_0x38f169=_0x4e128a['filter'](_0x3bc38b=>_0x3bc38b[_0x1c805b(0x1f0)]===_0x1c805b(0x1c3)),_0x3bedc5=Array[_0x1c805b(0x145)](_0x56c361)['sort'](),_0x40ecfe=_0x206189?![]:_0x1374a6[_0x1c805b(0x175)]>0x0||_0x333697[_0x1c805b(0x175)]>0x0||_0x53178b[_0x1c805b(0x175)]>0x0,_0x1be1c2=_0x284ea2[_0x1c805b(0x175)]>0x0||_0x4680a6[_0x1c805b(0x175)]>0x0||_0x2ea624[_0x1c805b(0x175)]>0x0,_0x43822b=_0x206189?![]:_0x4e128a[_0x1c805b(0x175)]>0x0,_0x4fbc64=_0x3bedc5[_0x1c805b(0x175)]>0x0;return{'segments':{'new':_0x1374a6,'changed':_0x333697,'unchanged':_0x29eb00,'toDelete':_0x53178b},'journeys':{'new':_0x284ea2,'changed':_0x4680a6,'unchanged':_0x56a3c5,'toDelete':_0x2ea624},'activations':{'all':_0x4e128a,'toCreate':_0x4833bb,'toUpdate':_0x38b8f7,'toDelete':_0x38f169},'folders':{'toCreate':_0x3bedc5},'counts':{'segments':{'new':_0x1374a6['length'],'changed':_0x333697[_0x1c805b(0x175)],'unchanged':_0x29eb00[_0x1c805b(0x175)],'toDelete':_0x53178b[_0x1c805b(0x175)]},'journeys':{'new':_0x284ea2[_0x1c805b(0x175)],'changed':_0x4680a6[_0x1c805b(0x175)],'unchanged':_0x56a3c5[_0x1c805b(0x175)],'toDelete':_0x2ea624[_0x1c805b(0x175)]},'activations':{'create':_0x4833bb[_0x1c805b(0x175)],'update':_0x38b8f7[_0x1c805b(0x175)],'delete':_0x38f169[_0x1c805b(0x175)]},'folders':_0x3bedc5[_0x1c805b(0x175)]},'hasChanges':_0x40ecfe||_0x1be1c2||_0x43822b||_0x4fbc64};}export async function buildPushExecutionContext(_0x52a34e,_0x364fe4,_0x525bd0,_0xe017c4,_0x352403,_0x4faa33){const _0x59b332=a140_0x374048,_0x5dbed5=extractRootFolderId(_0x525bd0),{pathToId:_0x11eddc,idToPath:_0x448951}=buildFolderMaps(_0x352403),_0x3b770e=buildSegmentNameToIdMap(_0xe017c4),_0x4d9902=new Map(),{batchAsync:_0x59e9a2}=await import('../../utils/async.js'),[_0x1d9c9a,_0x1743ad]=await Promise['all']([_0x52a34e[_0x59b332(0x176)][_0x59b332(0x229)](),_0x52a34e['connection'][_0x59b332(0x147)](),((async()=>{const _0x179482=_0x59b332;!_0x4faa33&&_0xe017c4[_0x179482(0x175)]>0x0&&await _0x59e9a2(_0xe017c4,async _0x12e7cd=>{const _0x268fd5=_0x179482,_0x23a5e1=await _0x52a34e['segment'][_0x268fd5(0x23a)](_0x364fe4,_0x12e7cd['id']);_0x4d9902[_0x268fd5(0x1c6)](_0x12e7cd['id'],_0x23a5e1);});})())]),{emailToId:_0x2d0a79,idToEmail:_0x41baef}=_0x1d9c9a,_0x52a755=buildConnectionMaps(_0x1743ad);return{'rootFolderId':_0x5dbed5,'folderPathToId':_0x11eddc,'folderIdToPath':_0x448951,'segmentNameToId':_0x3b770e,'activationsBySegmentId':_0x4d9902,'emailToIdMap':_0x2d0a79,'idToEmailMap':_0x41baef,'connectionNameToIdMap':_0x52a755[_0x59b332(0x193)],'connectionIdToNameMap':_0x52a755[_0x59b332(0x172)],'connectionNameToTypeMap':_0x52a755[_0x59b332(0x1bc)]};}export function createPushYamlContextForBundle(_0x117cb2,_0x25ec05,_0x1c6f76,_0x5416a4,_0x223c27,_0x362c25,_0x47e3b4,_0xbe639a){const {existingLocalSegmentNames:_0x51fc5e,localExpandedRuleToNames:_0x1b17b2}=_0x5416a4,_0x54734d=new Set(),_0x5bdaa9=new Map(),_0x4cdc01=new Map(),_0x2406a2=new Map(),_0x4677d7=createJumpTargetCache(),_0x58abd0=new Map(),_0x57a262=new Map(),_0x1fa78f=new Set();let _0x511ac8;const _0x32f504=_0x3a0d96=>{const _0x5c1e88={'resolveSegment':async _0x2ac73b=>{const _0x3c7b01=a140_0x2c7d,_0x40853b=_0x2406a2['get'](_0x2ac73b);if(_0x40853b!==undefined)return{'name':_0x40853b,'isJourneyLocal':!![]};try{const _0x371439=await fetchSegment(_0x117cb2,_0x25ec05,_0x2ac73b,_0x1c6f76);if(!_0x371439)throw new Error(_0x3c7b01(0x1ce));const _0x73cc59=generateJourneyLocalName(_0x371439['name']),_0xbbac38=_0x371439['kind']===SEGMENT_KIND_JOURNEY&&_0x73cc59!==undefined;let _0x59b56b=_0x371439[_0x3c7b01(0x1f7)],_0x5a3264;if(_0xbbac38&&_0x371439[_0x3c7b01(0x17a)]){const _0x145a79=apiRuleToYaml(_0x371439[_0x3c7b01(0x17a)]);_0x57a262[_0x3c7b01(0x1c6)](_0x2ac73b,_0x145a79);const _0x4e9d48=async _0x30fdcf=>{const _0x9383a7=_0x3c7b01,_0x541c11=collectSegmentRefsFromRule(_0x30fdcf);for(const _0x1db131 of _0x541c11){if(!_0x57a262[_0x9383a7(0x204)](_0x1db131))try{const _0x18a633=await fetchSegment(_0x117cb2,_0x25ec05,_0x1db131,_0x1c6f76);if(_0x18a633?.[_0x9383a7(0x17a)]){const _0x35ac0a=apiRuleToYaml(_0x18a633[_0x9383a7(0x17a)]);_0x57a262[_0x9383a7(0x1c6)](_0x1db131,_0x35ac0a),await _0x4e9d48(_0x35ac0a);}}catch(_0x15a334){logger[_0x9383a7(0x143)](_0x9383a7(0x1ae)+_0x1db131+':\x20'+_0x15a334);}}};await _0x4e9d48(_0x145a79);const _0x2993df=serializeExpandedRule(_0x145a79,_0x57a262),_0x585849=_0x1b17b2[_0x3c7b01(0x203)](_0x2993df);if(_0x585849&&_0x585849[_0x3c7b01(0x175)]>0x0){const _0x46049e=_0x5bdaa9['get'](_0x2993df)||0x0,_0x3db60a=_0x585849[_0x46049e]||_0x585849[_0x585849[_0x3c7b01(0x175)]-0x1];_0x5bdaa9[_0x3c7b01(0x1c6)](_0x2993df,_0x46049e+0x1),_0x59b56b=_0x3db60a,_0x54734d[_0x3c7b01(0x231)](_0x59b56b),_0x2406a2['set'](_0x2ac73b,_0x59b56b);const _0x59ea56=await resolveRuleSegmentRefs(_0x145a79,async _0x33d4cb=>{const _0x148061=_0x3c7b01,_0x417f15=_0x2406a2[_0x148061(0x203)](_0x33d4cb);if(_0x417f15)return _0x417f15;const _0x33ff9f=await _0x511ac8['resolveSegment'](_0x33d4cb);return _0x33ff9f[_0x148061(0x1f7)];});_0x5a3264={'description':_0x371439[_0x3c7b01(0x1f9)],'rule':_0x59ea56};}else{const _0x4d7a2e=_0x58abd0[_0x3c7b01(0x203)](_0x2993df);if(_0x4d7a2e)_0x59b56b=_0x4d7a2e,_0x2406a2[_0x3c7b01(0x1c6)](_0x2ac73b,_0x59b56b);else{if(_0x73cc59){let _0x320d42=_0x73cc59,_0x9f3089=0x2;while(_0x54734d['has'](_0x320d42)||_0x51fc5e['has'](_0x320d42)){_0x320d42=_0x73cc59+'_'+_0x9f3089,_0x9f3089++;}_0x54734d[_0x3c7b01(0x231)](_0x320d42),_0x59b56b=_0x320d42;}_0x2406a2[_0x3c7b01(0x1c6)](_0x2ac73b,_0x59b56b),_0x58abd0[_0x3c7b01(0x1c6)](_0x2993df,_0x59b56b);const _0x5ba6a3=await resolveRuleSegmentRefs(_0x145a79,async _0xe5d6e8=>{const _0x521ceb=_0x3c7b01,_0x5ab73c=_0x2406a2[_0x521ceb(0x203)](_0xe5d6e8);if(_0x5ab73c)return _0x5ab73c;const _0x1b69e7=await _0x511ac8[_0x521ceb(0x17e)](_0xe5d6e8);return _0x1b69e7[_0x521ceb(0x1f7)];});_0x5a3264={'description':_0x371439['description'],'rule':_0x5ba6a3};}}}return{'name':_0x59b56b,'isJourneyLocal':_0xbbac38,'definition':_0x5a3264};}catch(_0x78fec8){return logger[_0x3c7b01(0x143)](_0x3c7b01(0x1bf)+_0x2ac73b+':\x20'+_0x78fec8),{'name':_0x2ac73b,'isJourneyLocal':![]};}},'resolveActivation':async _0x2dafd2=>{const _0xa48519=a140_0x2c7d,_0x4cd42b=_0x4cdc01[_0xa48519(0x203)](_0x2dafd2);if(_0x4cd42b!==undefined)return{'name':_0x4cd42b,'isJourneyLocal':!![]};try{let _0x5c155f=_0x47e3b4?.[_0xa48519(0x203)](_0x2dafd2);!_0x5c155f&&(_0x5c155f=await _0x117cb2[_0xa48519(0x1ff)]['getActivation'](_0x3a0d96,_0x2dafd2));const _0xde9547=_0x5c155f[_0xa48519(0x1ad)][_0xa48519(0x1ef)][_0xa48519(0x1f7)]||_0x2dafd2,_0x4b448c=sanitizeYamlKey(_0xde9547)||_0xa48519(0x1e0)+_0x2dafd2,_0x113deb=_0x4b448c;_0x4cdc01[_0xa48519(0x1c6)](_0x2dafd2,_0x113deb);const _0xf45495=journeyActivationStepToYaml(_0x5c155f,_0x223c27,_0x362c25);return{'name':_0x113deb,'isJourneyLocal':!![],'definition':_0xf45495};}catch(_0x4f872d){return logger[_0xa48519(0x143)](_0xa48519(0x1b3)+_0x2dafd2+':\x20'+_0x4f872d),{'name':_0x2dafd2,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x59c2ee,_0x41db34)=>resolveJumpTarget(_0x59c2ee,_0x41db34,_0x4677d7,async _0x140b47=>{const _0x2103f2=a140_0x2c7d,_0xd4a605=_0xbe639a?.[_0x2103f2(0x203)](_0x140b47);if(_0xd4a605)return _0xd4a605;return _0x117cb2['journey'][_0x2103f2(0x1ea)](_0x140b47);})};return _0x511ac8=_0x5c1e88,_0x5c1e88;},_0x36a665=async _0x379d1a=>{const _0x30e0be=a140_0x2c7d,{collectSegmentIdsFromJourneyApi:_0x3a8b7b}=await import(_0x30e0be(0x1d7)),{batchAsync:_0x3817ad}=await import(_0x30e0be(0x1e7)),_0x1d2181=new Set();for(const _0x2a53ac of _0x379d1a){let _0x3dad95=_0xbe639a?.[_0x30e0be(0x203)](_0x2a53ac);!_0x3dad95&&(_0x3dad95=await _0x117cb2[_0x30e0be(0x1ff)]['getJourney'](_0x2a53ac));const _0x1c85af=_0x3a8b7b(_0x3dad95);for(const _0x1ce4f8 of _0x1c85af){_0x1d2181[_0x30e0be(0x231)](_0x1ce4f8);}}let _0xbbe421=Array[_0x30e0be(0x145)](_0x1d2181);while(_0xbbe421[_0x30e0be(0x175)]>0x0){const _0x5f3f9a=_0xbbe421[_0x30e0be(0x168)](_0x724418=>!_0x1fa78f[_0x30e0be(0x204)](_0x724418));if(_0x5f3f9a['length']===0x0)break;const _0x41a00d=await _0x3817ad(_0x5f3f9a,async _0x148925=>{const _0x2b5304=_0x30e0be;_0x1fa78f[_0x2b5304(0x231)](_0x148925);const _0x148eeb=await fetchSegment(_0x117cb2,_0x25ec05,_0x148925,_0x1c6f76);if(!_0x148eeb)return null;return{'segmentId':_0x148925,'segment':_0x148eeb};},0xa),_0x19d6bb=new Set();for(const _0x6cee2b of _0x41a00d){if(!_0x6cee2b?.['segment']?.[_0x30e0be(0x17a)])continue;const _0x424e0a=apiRuleToYaml(_0x6cee2b[_0x30e0be(0x1aa)]['rule']);_0x57a262[_0x30e0be(0x1c6)](_0x6cee2b['segmentId'],_0x424e0a);const _0x52fda6=collectSegmentRefsFromRule(_0x424e0a);for(const _0x948cd4 of _0x52fda6){!_0x1fa78f['has'](_0x948cd4)&&_0x19d6bb[_0x30e0be(0x231)](_0x948cd4);}}_0xbbe421=Array[_0x30e0be(0x145)](_0x19d6bb);}};return{'createYamlContext':_0x32f504,'prefetchJourneySegments':_0x36a665};}export async function executePushSegments(_0x480cb4,_0x2c5a25,_0x590af8,_0x42b847,_0x1194c5){const _0x90b380=a140_0x374048,{segmentDefToCreateRequest:_0x49bce6,segmentDefToUpdateRequest:_0x199acc}=await import(_0x90b380(0x13e)),_0x35609b=_0x590af8[_0x90b380(0x187)],_0x15c104=0x5,_0x44876f=async _0x485e45=>{const _0x1a327f=_0x90b380,_0x56f5e2=_0x485e45[_0x1a327f(0x208)]?_0x35609b[_0x1a327f(0x203)](_0x485e45[_0x1a327f(0x208)]):undefined;let _0xa2f7f6;const _0x439ef2={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x45978f=_0x485e45['yamlConfig'];if(_0x485e45[_0x1a327f(0x237)]['rule']){const _0x33447e=createSegmentIdResolver(_0x590af8[_0x1a327f(0x13c)],_0x485e45[_0x1a327f(0x237)]['name']),_0x2632fe=await resolveRuleSegmentIds(_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x17a)],_0x33447e);_0x45978f={..._0x485e45[_0x1a327f(0x237)],'rule':_0x2632fe};}try{if(_0x485e45[_0x1a327f(0x1b1)]){_0x1194c5[_0x1a327f(0x1d0)]?.({'type':_0x1a327f(0x17f),'name':_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)]});const _0x32add1=_0x49bce6(_0x45978f,_0x56f5e2),_0x2a7a6e=await _0x1194c5[_0x1a327f(0x22a)](_0x1a327f(0x155)+_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)]+_0x1a327f(0x219),()=>_0x480cb4['segment'][_0x1a327f(0x13a)](_0x42b847['parentId'],_0x32add1));_0xa2f7f6=_0x2a7a6e['data']['id'],_0x590af8[_0x1a327f(0x13c)][_0x1a327f(0x1c6)](_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)],_0xa2f7f6),_0x439ef2['createdSegmentId']={'name':_0x485e45[_0x1a327f(0x237)]['name'],'id':_0xa2f7f6},_0x1194c5['onProgress']?.({'type':_0x1a327f(0x180),'name':_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)],'segmentId':_0xa2f7f6}),_0x1194c5['logSuccess']?.(_0x1a327f(0x150)+_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)]+'\x27'),_0x439ef2[_0x1a327f(0x20c)]=0x1;}else{if(_0x485e45['hasChanges']){_0x1194c5[_0x1a327f(0x1d0)]?.({'type':_0x1a327f(0x21f),'name':_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)]});const _0x12273d=_0x199acc(_0x45978f);_0x56f5e2!==_0x485e45[_0x1a327f(0x216)]?.[_0x1a327f(0x15d)]&&(_0x12273d['segmentFolderId']=_0x56f5e2?parseInt(_0x56f5e2,0xa):undefined),await _0x1194c5[_0x1a327f(0x22a)]('Updating\x20segment\x20\x27'+_0x485e45[_0x1a327f(0x237)]['name']+_0x1a327f(0x219),()=>_0x480cb4[_0x1a327f(0x1aa)][_0x1a327f(0x199)](_0x42b847[_0x1a327f(0x14e)],_0x485e45[_0x1a327f(0x216)]['id'],_0x12273d)),_0xa2f7f6=_0x485e45[_0x1a327f(0x216)]['id'],_0x1194c5[_0x1a327f(0x1d0)]?.({'type':_0x1a327f(0x188),'name':_0x485e45[_0x1a327f(0x237)]['name']}),_0x1194c5[_0x1a327f(0x20f)]?.('Updated\x20segment\x20\x27'+_0x485e45['yamlConfig'][_0x1a327f(0x1f7)]+'\x27'),_0x439ef2[_0x1a327f(0x181)]=0x1;}else _0xa2f7f6=_0x485e45[_0x1a327f(0x216)]['id'];}}catch(_0x511676){const _0x1deed5=isHttp400Error(_0x511676),_0xccf91f=_0x1deed5?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1a327f(0x14b)],_0x16fea5=getErrorMessage(_0x511676);throw new SDKError(_0xccf91f,'Failed\x20to\x20'+(_0x485e45['isNew']?_0x1a327f(0x21c):_0x1a327f(0x177))+_0x1a327f(0x16f)+_0x485e45[_0x1a327f(0x211)]+_0x1a327f(0x22f)+_0x16fea5,_0x511676);}try{const _0x4cc573=await syncActivationsForSegment(_0x480cb4,_0x42b847[_0x1a327f(0x14e)],_0xa2f7f6,_0x485e45[_0x1a327f(0x237)]['name'],_0x485e45[_0x1a327f(0x1cf)],_0x1194c5,_0x485e45[_0x1a327f(0x211)]);_0x439ef2[_0x1a327f(0x1a6)]=_0x4cc573;}catch(_0xee44da){if(_0xee44da instanceof SDKError)throw _0xee44da;throw new SDKError(ErrorCode[_0x1a327f(0x158)],_0x1a327f(0x1b5)+_0x485e45[_0x1a327f(0x237)]['name']+'\x27\x20from\x20file:\x20'+_0x485e45[_0x1a327f(0x211)]+_0x1a327f(0x22f)+getErrorMessage(_0xee44da),_0xee44da);}return _0x439ef2;},_0x6e26e4=await batchAsync(_0x2c5a25,_0x44876f,_0x15c104),_0x343bc6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x540989 of _0x6e26e4){_0x343bc6[_0x90b380(0x20c)]+=_0x540989['created'],_0x343bc6[_0x90b380(0x181)]+=_0x540989[_0x90b380(0x181)],_0x540989[_0x90b380(0x152)]&&_0x343bc6[_0x90b380(0x144)]['set'](_0x540989[_0x90b380(0x152)][_0x90b380(0x1f7)],_0x540989['createdSegmentId']['id']),_0x343bc6[_0x90b380(0x1a6)][_0x90b380(0x20c)]+=_0x540989[_0x90b380(0x1a6)][_0x90b380(0x20c)],_0x343bc6['activations'][_0x90b380(0x181)]+=_0x540989[_0x90b380(0x1a6)][_0x90b380(0x181)],_0x343bc6[_0x90b380(0x1a6)][_0x90b380(0x14c)]+=_0x540989[_0x90b380(0x1a6)][_0x90b380(0x14c)];}return _0x343bc6;}async function syncActivationsForSegment(_0x50a653,_0x11462e,_0x4dd2ef,_0x2b5049,_0x5ecaab,_0x5a5071,_0x6ec8ed){const _0x4859e4=a140_0x374048,_0x431535={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x24f70e of _0x5ecaab){try{if(_0x24f70e['type']==='create'&&_0x24f70e['validatedRequest'])_0x5a5071['onProgress']?.({'type':_0x4859e4(0x16a),'segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),await _0x5a5071[_0x4859e4(0x22a)](_0x4859e4(0x1fe)+_0x24f70e['name']+_0x4859e4(0x219),()=>_0x50a653['segment'][_0x4859e4(0x16b)](_0x11462e,_0x4dd2ef,_0x24f70e['validatedRequest'])),_0x5a5071[_0x4859e4(0x1d0)]?.({'type':_0x4859e4(0x1fd),'segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),_0x5a5071[_0x4859e4(0x20f)]?.(_0x4859e4(0x1da)+_0x24f70e['name']+'\x27'),_0x431535['created']++;else{if(_0x24f70e['type']===_0x4859e4(0x177)&&_0x24f70e[_0x4859e4(0x1ca)]&&_0x24f70e['existingActivation'])_0x5a5071['onProgress']?.({'type':'activation_updating','segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),await _0x5a5071[_0x4859e4(0x22a)](_0x4859e4(0x19b)+_0x24f70e[_0x4859e4(0x1f7)]+'\x27...',()=>_0x50a653['segment'][_0x4859e4(0x17c)](_0x11462e,_0x4dd2ef,_0x24f70e[_0x4859e4(0x21b)]['id'],_0x24f70e['validatedRequest'])),_0x5a5071[_0x4859e4(0x1d0)]?.({'type':'activation_updated','segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),_0x5a5071[_0x4859e4(0x20f)]?.(_0x4859e4(0x156)+_0x24f70e[_0x4859e4(0x1f7)]+'\x27'),_0x431535[_0x4859e4(0x181)]++;else _0x24f70e[_0x4859e4(0x1f0)]===_0x4859e4(0x1c3)&&_0x24f70e['existingActivation']&&(_0x5a5071[_0x4859e4(0x1d0)]?.({'type':_0x4859e4(0x23e),'segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),await _0x5a5071['withProgress'](_0x4859e4(0x1f3)+_0x24f70e[_0x4859e4(0x1f7)]+_0x4859e4(0x219),()=>_0x50a653['segment'][_0x4859e4(0x1fa)](_0x11462e,_0x4dd2ef,_0x24f70e[_0x4859e4(0x21b)]['id'])),_0x5a5071['onProgress']?.({'type':'activation_deleted','segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),_0x5a5071[_0x4859e4(0x1cc)]?.(_0x4859e4(0x1d3)+_0x24f70e[_0x4859e4(0x1f7)]+'\x27'),_0x431535['deleted']++);}}catch(_0x161076){const _0x875aaf=isHttp400Error(_0x161076),_0x2ab60c=_0x875aaf?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x28eb34=getErrorMessage(_0x161076);throw new SDKError(_0x2ab60c,_0x4859e4(0x160)+_0x24f70e[_0x4859e4(0x1f0)]+'\x20activation\x20\x27'+_0x24f70e[_0x4859e4(0x1f7)]+'\x27\x20from\x20file:\x20'+_0x6ec8ed+'\x0a\x20\x20'+_0x28eb34,_0x161076);}}return _0x431535;}export async function executePushFolders(_0x1bbf63,_0x130a38,_0xd9120b,_0x3bf1b6,_0x1005fd){const _0x264621=a140_0x374048,_0x35e8e5=new Map(_0xd9120b),_0x5cdee3=sortFoldersByDepth(_0x130a38);for(const _0x5de327 of _0x5cdee3){const _0x196bcd=_0x5de327[_0x264621(0x1a4)]('/'),_0x53e6d4=_0x196bcd[_0x196bcd[_0x264621(0x175)]-0x1],_0x461068=_0x196bcd[_0x264621(0x189)](0x0,-0x1)[_0x264621(0x1d9)]('/'),_0x31d79b=_0x35e8e5[_0x264621(0x203)](_0x461068);_0x1005fd[_0x264621(0x1d0)]?.({'type':_0x264621(0x22d),'folder':_0x5de327});const _0x40a2da={'name':_0x53e6d4,'parentFolderId':_0x31d79b},_0xb30d02=await _0x1005fd[_0x264621(0x22a)](_0x264621(0x1d6)+_0x5de327+_0x264621(0x219),()=>_0x1bbf63[_0x264621(0x1aa)][_0x264621(0x1d5)](_0x3bf1b6['parentId'],_0x40a2da));_0x35e8e5[_0x264621(0x1c6)](_0x5de327,_0xb30d02['data']['id']),_0x1005fd[_0x264621(0x1d0)]?.({'type':_0x264621(0x1b8),'folder':_0x5de327,'folderId':_0xb30d02[_0x264621(0x1df)]['id']}),_0x1005fd[_0x264621(0x15f)]?.(_0x264621(0x1e4)+_0x5de327+'\x27');}return _0x35e8e5;}export async function executePushSegmentDeletions(_0x5097aa,_0x40ff21,_0x2271b5){const _0x29f2db=a140_0x374048;if(_0x40ff21[_0x29f2db(0x175)]===0x0)return 0x0;const {batchAsync:_0x13d21c}=await import('../../utils/async.js'),_0x108353=0x5,_0x487d0d=await _0x13d21c(_0x40ff21,async _0x5bd455=>{const _0x40cba4=_0x29f2db;return _0x2271b5[_0x40cba4(0x1d0)]?.({'type':_0x40cba4(0x14a),'name':_0x5bd455[_0x40cba4(0x1f7)]}),await _0x5097aa[_0x40cba4(0x1aa)][_0x40cba4(0x157)](_0x5bd455['id']),_0x2271b5[_0x40cba4(0x1d0)]?.({'type':_0x40cba4(0x1e3),'name':_0x5bd455[_0x40cba4(0x1f7)]}),_0x2271b5[_0x40cba4(0x1cc)]?.('Deleted\x20segment\x20\x27'+_0x5bd455['name']+'\x27'),0x1;},_0x108353);return _0x487d0d[_0x29f2db(0x16e)]((_0x571668,_0xf4c39b)=>_0x571668+_0xf4c39b,0x0);}export async function executePushJourneys(_0x3cca25,_0x29df09,_0x514b91,_0x7b5b20,_0x430d87){const _0x4a90c7=a140_0x374048,{journeyDefToRequest:_0x51587e}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x453151,yamlRuleToApi:_0x35e9d1,validateSegmentRule:_0x55b58d}=await import(_0x4a90c7(0x13e)),_0x1d88dd={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x52c6c0=new Map(_0x514b91[_0x4a90c7(0x13c)]),_0x195c0f=0x5;for(let _0x33bf7e=0x0;_0x33bf7e<_0x29df09[_0x4a90c7(0x175)];_0x33bf7e+=_0x195c0f){const _0x144412=_0x29df09['slice'](_0x33bf7e,_0x33bf7e+_0x195c0f),_0x43be00=await Promise['all'](_0x144412[_0x4a90c7(0x197)](async _0x27102b=>{const _0x2c30fb=_0x4a90c7;if(!_0x27102b[_0x2c30fb(0x1b1)]&&!_0x27102b[_0x2c30fb(0x195)])return{'action':_0x2c30fb(0x159),'name':_0x27102b[_0x2c30fb(0x237)][_0x2c30fb(0x1f7)],'journeyId':_0x27102b[_0x2c30fb(0x1e1)]?.['id']};const _0x3bec50=_0x27102b[_0x2c30fb(0x208)]?_0x514b91[_0x2c30fb(0x187)][_0x2c30fb(0x203)](_0x27102b[_0x2c30fb(0x208)]):undefined;_0x430d87['onProgress']?.({'type':_0x27102b[_0x2c30fb(0x1b1)]?_0x2c30fb(0x1c5):_0x2c30fb(0x1c1),'name':_0x27102b[_0x2c30fb(0x237)][_0x2c30fb(0x1f7)]});try{const _0x3a218b=await executeSingleJourneyPush(_0x3cca25,_0x27102b,{..._0x514b91,'segmentNameToId':_0x52c6c0},{'parentId':_0x7b5b20['parentId'],'rootFolderId':_0x7b5b20[_0x2c30fb(0x1a0)],'folderId':_0x3bec50,'verbose':_0x7b5b20[_0x2c30fb(0x1bb)]},_0x430d87,{'journeyDefToRequest':_0x51587e,'activationDefToCreateRequest':_0x453151,'yamlRuleToApi':_0x35e9d1,'validateSegmentRule':_0x55b58d});for(const [_0x287951,_0x4b9148]of _0x3a218b[_0x2c30fb(0x223)]){_0x52c6c0[_0x2c30fb(0x1c6)](_0x287951,_0x4b9148),_0x1d88dd[_0x2c30fb(0x223)]['set'](_0x287951,_0x4b9148);}if(_0x3a218b['action']===_0x2c30fb(0x20c))_0x430d87[_0x2c30fb(0x1d0)]?.({'type':_0x2c30fb(0x179),'name':_0x27102b[_0x2c30fb(0x237)][_0x2c30fb(0x1f7)],'journeyId':_0x3a218b[_0x2c30fb(0x15e)]}),_0x430d87[_0x2c30fb(0x20f)]?.(_0x2c30fb(0x220)+_0x27102b['yamlConfig'][_0x2c30fb(0x1f7)]+'\x27'),_0x1d88dd['created']++;else _0x3a218b[_0x2c30fb(0x1fb)]===_0x2c30fb(0x181)&&(_0x430d87[_0x2c30fb(0x1d0)]?.({'type':_0x2c30fb(0x1bd),'name':_0x27102b[_0x2c30fb(0x237)][_0x2c30fb(0x1f7)]}),_0x430d87[_0x2c30fb(0x20f)]?.(_0x2c30fb(0x1e6)+_0x27102b['yamlConfig'][_0x2c30fb(0x1f7)]+'\x27'),_0x1d88dd[_0x2c30fb(0x181)]++);return{'action':_0x3a218b[_0x2c30fb(0x1fb)],'name':_0x27102b[_0x2c30fb(0x237)]['name'],'journeyId':_0x3a218b[_0x2c30fb(0x15e)]};}catch(_0x27daae){const _0x41505f=isHttp400Error(_0x27daae),_0x45218f=_0x41505f?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x323830=getErrorMessage(_0x27daae);throw new SDKError(_0x45218f,_0x2c30fb(0x160)+(_0x27102b[_0x2c30fb(0x1b1)]?_0x2c30fb(0x21c):_0x2c30fb(0x177))+_0x2c30fb(0x14f)+_0x27102b[_0x2c30fb(0x211)]+'\x0a\x20\x20'+_0x323830,_0x27daae);}}));_0x1d88dd['results']['push'](..._0x43be00);}return _0x1d88dd;}async function matchExistingJourneySegments(_0x59311d,_0x2193ae,_0x154883,_0x3c2ce9,_0x12ae4a){const _0x2e5540=a140_0x374048;if(!_0x2193ae[_0x2e5540(0x1e1)]||!_0x2193ae[_0x2e5540(0x237)][_0x2e5540(0x1e5)])return;const _0x11781d=new Map(),_0x49dea9=new Set();for(const _0x393fed of Object[_0x2e5540(0x1b7)](_0x2193ae['yamlConfig'][_0x2e5540(0x1e5)])){const _0x2ebf3e=generateDeterministicJourneySegmentName(_0x2193ae[_0x2e5540(0x237)][_0x2e5540(0x1f7)],_0x393fed);_0x11781d[_0x2e5540(0x1c6)](_0x2ebf3e,_0x393fed),_0x49dea9[_0x2e5540(0x231)](_0x393fed);}const _0x3c6445=[],_0x339f4a=collectSegmentIdsFromJourneyApi(_0x2193ae[_0x2e5540(0x1e1)]);for(const _0x16bb6d of _0x339f4a){const _0xb71a60=await fetchSegment(_0x59311d,_0x154883,_0x16bb6d,_0x3c2ce9);if(!_0xb71a60?.[_0x2e5540(0x1f7)])continue;const _0x513ec8=_0x11781d[_0x2e5540(0x203)](_0xb71a60[_0x2e5540(0x1f7)]);_0x513ec8?(_0x12ae4a['set'](_0x513ec8,_0x16bb6d),_0x49dea9[_0x2e5540(0x1c3)](_0x513ec8)):_0x3c6445['push']({'id':_0x16bb6d,'seg':_0xb71a60});}if(_0x49dea9[_0x2e5540(0x1a3)]>0x0&&_0x3c6445[_0x2e5540(0x175)]>0x0){const {localExpandedRuleToNames:_0xf70652}=buildLocalExpandedRuleMappings(_0x2193ae[_0x2e5540(0x237)]),_0x109c0d=new Map();for(const {id:_0x428bbe,seg:_0x18b3d3}of _0x3c6445){if(_0x18b3d3['rule']){const _0x516b08=apiRuleToYaml(_0x18b3d3[_0x2e5540(0x17a)]);_0x109c0d[_0x2e5540(0x1c6)](_0x428bbe,_0x516b08);}}for(const {id:_0x25654e,seg:_0xc08d64}of _0x3c6445){if(!_0xc08d64['rule'])continue;const _0x54bab2=_0x109c0d[_0x2e5540(0x203)](_0x25654e);if(!_0x54bab2)continue;const _0x13c0e2=serializeExpandedRule(_0x54bab2,_0x109c0d),_0x3a3ec7=_0xf70652[_0x2e5540(0x203)](_0x13c0e2);if(_0x3a3ec7){const _0xa440a6=_0x3a3ec7[_0x2e5540(0x1a7)](_0x170033=>_0x49dea9[_0x2e5540(0x204)](_0x170033));_0xa440a6&&(_0x12ae4a[_0x2e5540(0x1c6)](_0xa440a6,_0x25654e),_0x49dea9[_0x2e5540(0x1c3)](_0xa440a6),logger[_0x2e5540(0x143)](_0x2e5540(0x166)+_0xc08d64['name']+_0x2e5540(0x196)+_0xa440a6+_0x2e5540(0x17b)));}}}}function a140_0x2c7d(_0x4c11ac,_0x4ec5dd){_0x4c11ac=_0x4c11ac-0x13a;const _0x254443=a140_0x2544();let _0x2c7da2=_0x254443[_0x4c11ac];return _0x2c7da2;}async function executeSingleJourneyPush(_0x13cc12,_0x160d39,_0x16f2d4,_0x295221,_0x22f807,_0x5377bc){const _0x230af2=a140_0x374048,{journeyDefToRequest:_0x229b6b,activationDefToCreateRequest:_0x5f59bf,yamlRuleToApi:_0x132c37,validateSegmentRule:_0x3aa75d}=_0x5377bc,_0x30c5a9=new Map(),_0x358f8c=new Map();recoverSegmentIdsFromPushRecovery(_0x160d39,_0x30c5a9,_0x16f2d4[_0x230af2(0x13c)]);const _0xcd23cd=new Map(),_0x1d747e=new Map(),_0x28e330=new Map();let _0x505a0f;const _0x36bc7c=async()=>{const _0x54b9b6=_0x230af2;if(_0x505a0f)return;_0x505a0f=new Map();if(!_0x160d39['existingJourney'])return;const _0x565160=await _0x13cc12[_0x54b9b6(0x1ff)][_0x54b9b6(0x23a)](_0x160d39['existingJourney']['id']);for(const _0x10dcba of _0x565160){const _0x19d0ee=journeyActivationStepToYaml(_0x10dcba,_0x16f2d4[_0x54b9b6(0x163)],_0x16f2d4[_0x54b9b6(0x169)]),_0x111c4b=activationSignature(_0x19d0ee);!_0x505a0f[_0x54b9b6(0x204)](_0x111c4b)&&_0x505a0f[_0x54b9b6(0x1c6)](_0x111c4b,_0x10dcba['id']),_0x19d0ee[_0x54b9b6(0x1f7)]&&_0x358f8c[_0x54b9b6(0x1c6)](_0x19d0ee[_0x54b9b6(0x1f7)],_0x10dcba['id']);}};await matchExistingJourneySegments(_0x13cc12,_0x160d39,_0x295221[_0x230af2(0x14e)],_0x16f2d4['existingSegments'],_0x16f2d4[_0x230af2(0x13c)]);const _0x554675={'resolveSegmentId':async _0x195fce=>{const _0x3946d1=_0x230af2,_0x47b611=_0x16f2d4[_0x3946d1(0x13c)][_0x3946d1(0x203)](_0x195fce);if(!_0x47b611)throw new SDKError(ErrorCode[_0x3946d1(0x22c)],_0x3946d1(0x153)+_0x195fce+_0x3946d1(0x1ab)+_0x160d39['yamlConfig'][_0x3946d1(0x1f7)]+')');return _0x47b611;},'resolveEmbeddedSegmentId':async(_0x179009,_0x4addb5)=>{const _0x26aa9a=_0x230af2,_0xa49b3d=_0x16f2d4['segmentNameToId'][_0x26aa9a(0x203)](_0x179009);if(_0xa49b3d)return _0xa49b3d;const _0x2dc68c=_0x16f2d4[_0x26aa9a(0x178)][_0x26aa9a(0x1a7)](_0x16d44f=>_0x16d44f[_0x26aa9a(0x1f7)]===_0x179009);if(_0x2dc68c)return _0x16f2d4[_0x26aa9a(0x13c)][_0x26aa9a(0x1c6)](_0x179009,_0x2dc68c['id']),_0x2dc68c['id'];if(_0x160d39[_0x26aa9a(0x1b1)]){const {stageName:_0x1ed8a1,criteriaName:_0x4f0f8a}=findSegmentCriteriaLocation(_0x160d39[_0x26aa9a(0x237)],_0x179009);return _0x3aa75d(_0x179009,_0x4addb5[_0x26aa9a(0x17a)]),_0x1d747e[_0x26aa9a(0x1c6)](_0x179009,{'definition':_0x4addb5,'stageName':_0x1ed8a1,'criteriaName':_0x4f0f8a}),createPendingSegmentId(_0x179009);}const _0x26a7ff=_0x160d39[_0x26aa9a(0x1e1)]?.['id'];if(!_0x26a7ff)throw new SDKError(ErrorCode['INTERNAL'],_0x26aa9a(0x1b2));const _0x3b9716=_0xcd23cd[_0x26aa9a(0x203)](_0x179009);if(_0x3b9716)return _0x3b9716;const _0x313732=((async()=>{const _0x10713d=_0x26aa9a;_0x3aa75d(_0x179009,_0x4addb5[_0x10713d(0x17a)]);const _0x1fd6e0=generateDeterministicJourneySegmentName(_0x160d39[_0x10713d(0x237)][_0x10713d(0x1f7)],_0x179009),_0x39e2d5=_0x16f2d4[_0x10713d(0x178)]['find'](_0x4cd5e1=>_0x4cd5e1[_0x10713d(0x1f7)]===_0x1fd6e0),_0x155694=createSegmentIdResolver(_0x16f2d4[_0x10713d(0x13c)],_0x179009),_0x3c5c65=await resolveRuleSegmentIds(_0x4addb5[_0x10713d(0x17a)],_0x155694);let _0x56aefe;return _0x39e2d5?(await _0x13cc12['segment']['updateSegmentById'](_0x295221[_0x10713d(0x14e)],_0x39e2d5['id'],{'description':_0x4addb5['description']||'Entry\x20criteria:\x20'+_0x179009,'rule':_0x132c37(_0x3c5c65,!![]),'countPopulation':!![]}),_0x56aefe=_0x39e2d5['id'],saveSegmentToPushRecovery(_0x160d39['absolutePath'],_0x160d39[_0x10713d(0x237)][_0x10713d(0x1f7)],_0x179009,{'segmentId':_0x56aefe,'uniqueServerName':_0x1fd6e0,'createdAt':new Date()[_0x10713d(0x1b4)]()})):_0x56aefe=await createOrRecoverEmbeddedSegment(_0x13cc12,_0x160d39,{'localName':_0x179009,'uniqueSegmentName':_0x1fd6e0,'description':_0x4addb5['description']||'Entry\x20criteria:\x20'+_0x179009,'journeyId':_0x26a7ff,'resolvedRule':_0x3c5c65,'parentId':_0x295221[_0x10713d(0x14e)],'folderId':_0x295221[_0x10713d(0x1a0)]||''},_0x132c37),_0x16f2d4['segmentNameToId']['set'](_0x179009,_0x56aefe),_0x30c5a9[_0x10713d(0x1c6)](_0x179009,_0x56aefe),_0x56aefe;})());_0xcd23cd[_0x26aa9a(0x1c6)](_0x179009,_0x313732);try{return await _0x313732;}finally{_0xcd23cd['delete'](_0x179009);}},'resolveActivationId':async _0x2e28cb=>{const _0x2c0824=_0x230af2,_0x3cbaf2=_0x358f8c['get'](_0x2e28cb);if(_0x3cbaf2)return _0x3cbaf2;if(_0x160d39[_0x2c0824(0x1e1)]){await _0x36bc7c();const _0x50749c=_0x358f8c[_0x2c0824(0x203)](_0x2e28cb);if(_0x50749c)return _0x50749c;}throw new SDKError(ErrorCode[_0x2c0824(0x183)],_0x2c0824(0x20d)+_0x2e28cb+_0x2c0824(0x1ab)+_0x160d39[_0x2c0824(0x237)][_0x2c0824(0x1f7)]+_0x2c0824(0x1f8)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x21979,_0x28e9c3)=>{const _0x1e1f3b=_0x230af2,_0x445175=_0x358f8c['get'](_0x21979);if(_0x445175)return _0x445175;if(_0x160d39[_0x1e1f3b(0x1b1)])return _0x28e330['set'](_0x21979,_0x28e9c3),createPendingActivationId(_0x21979);if(_0x160d39[_0x1e1f3b(0x1e1)]){await _0x36bc7c();const _0x3279e4=_0x358f8c['get'](_0x28e9c3[_0x1e1f3b(0x1f7)]);if(_0x3279e4)return _0x358f8c['set'](_0x21979,_0x3279e4),_0x3279e4;const _0x56a279=activationSignature(_0x28e9c3),_0x6d275f=_0x505a0f?.[_0x1e1f3b(0x203)](_0x56a279);if(_0x6d275f)return _0x358f8c[_0x1e1f3b(0x1c6)](_0x21979,_0x6d275f),_0x6d275f;const _0xf8fd6d=await _0x5f59bf(_0x28e9c3,_0x16f2d4['activationContext']),_0x547380={..._0xf8fd6d,..._0x28e9c3['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x28e9c3[_0x1e1f3b(0x1cd)]}},_0x1027e5=await _0x13cc12[_0x1e1f3b(0x1ff)]['createActivation'](_0x160d39['existingJourney']['id'],_0x547380);return _0x358f8c[_0x1e1f3b(0x1c6)](_0x21979,_0x1027e5['id']),_0x1027e5['id'];}throw new SDKError(ErrorCode[_0x1e1f3b(0x1c4)],_0x1e1f3b(0x226));},'resolveJourneyId':async _0x5a22df=>{const _0x5da779=_0x230af2;try{return await _0x13cc12['journey']['resolveJourneyId'](_0x295221[_0x5da779(0x14e)],_0x5a22df);}catch(_0x8bbb3){throw new SDKError(ErrorCode[_0x5da779(0x183)],_0x5da779(0x148)+_0x5a22df+_0x5da779(0x1ee)+_0x160d39[_0x5da779(0x237)][_0x5da779(0x1f7)]+'\x27)',_0x8bbb3);}},'resolveStageId':async(_0x684a4f,_0x12be0f)=>{const _0x4d9865=_0x230af2,_0x2da047=await _0x13cc12[_0x4d9865(0x1ff)][_0x4d9865(0x1ea)](_0x684a4f),_0x2d7b29=_0x2da047['attributes'][_0x4d9865(0x1c8)][_0x4d9865(0x1a7)](_0x48f0c1=>_0x48f0c1[_0x4d9865(0x1f7)][_0x4d9865(0x227)]()===_0x12be0f[_0x4d9865(0x227)]());if(!_0x2d7b29?.['id'])throw new SDKError(ErrorCode[_0x4d9865(0x183)],_0x4d9865(0x1eb)+_0x12be0f+_0x4d9865(0x1af)+(_0x2da047[_0x4d9865(0x1ad)][_0x4d9865(0x239)]||_0x2da047['attributes'][_0x4d9865(0x1f7)])+'\x27');return _0x2d7b29['id'];}},_0x4e167a=await _0x229b6b(_0x160d39[_0x230af2(0x237)],_0x295221['parentId'],_0x554675),_0x275c0c=_0x295221[_0x230af2(0x1a5)]||_0x295221[_0x230af2(0x1a0)];_0x275c0c&&(_0x4e167a[_0x230af2(0x162)]={'parentFolder':{'data':{'id':_0x275c0c,'type':_0x230af2(0x16d)}}});if(_0x160d39[_0x230af2(0x1b1)]){if(_0x1d747e[_0x230af2(0x1a3)]>0x0||_0x28e330[_0x230af2(0x1a3)]>0x0)return await executeThreeStepJourneyCreate(_0x13cc12,_0x160d39,_0x4e167a,{'pendingEmbeddedSegments':_0x1d747e,'pendingEmbeddedActivations':_0x28e330,'embeddedSegmentNameToId':_0x30c5a9,'journeyActivationNameToId':_0x358f8c},{..._0x295221,'effectiveFolderId':_0x275c0c},_0x16f2d4,_0x22f807,_0x5377bc);else{ensureJourneyDefaults(_0x4e167a['attributes']);const _0xe675dd=await _0x13cc12[_0x230af2(0x1ff)][_0x230af2(0x21c)](_0x4e167a);return deletePushRecovery(_0x160d39[_0x230af2(0x211)]),{'action':'created','journeyId':_0xe675dd['id'],'embeddedSegmentNameToId':_0x30c5a9};}}else{if(_0x160d39['hasChanges']&&_0x160d39[_0x230af2(0x1e1)]){_0x4e167a['id']=_0x160d39['existingJourney']['id'];const _0x4c1697=_0x4e167a[_0x230af2(0x1ad)];_0x160d39['existingJourney'][_0x230af2(0x1ad)]?.['journeyBundleName']&&(_0x4c1697[_0x230af2(0x239)]=_0x160d39[_0x230af2(0x1e1)][_0x230af2(0x1ad)][_0x230af2(0x239)]);const _0x4aa795=_0x160d39[_0x230af2(0x1e1)][_0x230af2(0x1ad)]?.['journeyStages'];return _0x4aa795&&_0x4e167a[_0x230af2(0x1ad)][_0x230af2(0x1c8)]&&injectExistingStageIds(_0x4e167a[_0x230af2(0x1ad)]['journeyStages'],_0x4aa795),ensureJourneyDefaults(_0x4c1697),await _0x13cc12['journey']['update'](_0x160d39[_0x230af2(0x1e1)]['id'],_0x4e167a),deletePushRecovery(_0x160d39['absolutePath']),{'action':_0x230af2(0x181),'journeyId':_0x160d39[_0x230af2(0x1e1)]['id'],'embeddedSegmentNameToId':_0x30c5a9};}}return deletePushRecovery(_0x160d39['absolutePath']),{'action':'unchanged','journeyId':_0x160d39[_0x230af2(0x1e1)]?.['id'],'embeddedSegmentNameToId':_0x30c5a9};}function findSegmentCriteriaLocation(_0x1028cc,_0x18367f){const _0x5184f9=a140_0x374048,_0x13efdd=_0x1028cc[_0x5184f9(0x173)]||_0x1028cc['journeys']?.[0x0]?.[_0x5184f9(0x173)]||[];let _0x2662a4=_0x5184f9(0x22e),_0x3eb3c9=_0x18367f;const _0x2eba3d=_0x1028cc[_0x5184f9(0x20a)]||_0x1028cc['journeys']?.[0x0]?.[_0x5184f9(0x20a)];if(_0x2eba3d?.[_0x5184f9(0x1aa)]===_0x18367f)return{'stageName':_0x5184f9(0x20a),'criteriaName':_0x2eba3d[_0x5184f9(0x1f7)]||_0x18367f};_0x4afe44:for(const _0xceba9e of _0x13efdd){if(_0xceba9e[_0x5184f9(0x205)]?.[_0x5184f9(0x1aa)]===_0x18367f){_0x2662a4=_0xceba9e[_0x5184f9(0x1f7)],_0x3eb3c9=_0xceba9e[_0x5184f9(0x205)][_0x5184f9(0x1f7)]||_0x18367f;break;}if(_0xceba9e['steps'])for(const _0x1626bf of _0xceba9e['steps']){if(_0x1626bf[_0x5184f9(0x1f0)]==='decision_point'&&_0x1626bf['with']?.['branches'])for(const _0x136c28 of _0x1626bf['with'][_0x5184f9(0x20b)]){if(_0x136c28[_0x5184f9(0x1aa)]===_0x18367f){_0x2662a4=_0xceba9e[_0x5184f9(0x1f7)],_0x3eb3c9=_0x136c28[_0x5184f9(0x1f7)]||_0x18367f;break _0x4afe44;}}}}return{'stageName':_0x2662a4,'criteriaName':_0x3eb3c9};}async function executeThreeStepJourneyCreate(_0x3eb271,_0x15792b,_0x582a4f,_0x411df8,_0x4cb216,_0x42b3a4,_0x592693,_0x474b2a){const _0x3f4621=a140_0x374048,{activationDefToCreateRequest:_0x1338d6,yamlRuleToApi:_0xd70d07}=_0x474b2a,{pendingEmbeddedSegments:_0x43a538,pendingEmbeddedActivations:_0x23d37c,embeddedSegmentNameToId:_0x4f2ef0}=_0x411df8,_0x51b9a5=JSON[_0x3f4621(0x1a2)](JSON['stringify'](_0x582a4f));ensureJourneyDefaults(_0x51b9a5[_0x3f4621(0x1ad)]),stripPendingIds(_0x51b9a5);const _0x538ae7=await _0x3eb271[_0x3f4621(0x1ff)][_0x3f4621(0x21c)](_0x51b9a5),_0x456423=_0x538ae7['id'],_0x83766b=new Map();for(const _0x56659a of _0x538ae7[_0x3f4621(0x1ad)][_0x3f4621(0x1c8)]){_0x83766b[_0x3f4621(0x1c6)](_0x56659a[_0x3f4621(0x1f7)][_0x3f4621(0x227)](),_0x56659a['id']);}recoverSegmentIdsFromPushRecovery(_0x15792b,_0x4f2ef0,_0x42b3a4[_0x3f4621(0x13c)]);for(const [_0x2aab1e,{definition:_0x46955c}]of _0x43a538){if(_0x4f2ef0[_0x3f4621(0x204)](_0x2aab1e)){_0x592693[_0x3f4621(0x1d0)]?.({'type':_0x3f4621(0x186),'journeyName':_0x15792b['yamlConfig']['name'],'segmentName':_0x2aab1e});continue;}const _0x4b9c63=generateDeterministicJourneySegmentName(_0x15792b['yamlConfig'][_0x3f4621(0x1f7)],_0x2aab1e);_0x592693['onProgress']?.({'type':_0x3f4621(0x213),'journeyName':_0x15792b[_0x3f4621(0x237)][_0x3f4621(0x1f7)],'segmentName':_0x2aab1e});const _0x13681e=createSegmentIdResolver(_0x42b3a4[_0x3f4621(0x13c)],_0x2aab1e),_0x1e8013=await resolveRuleSegmentIds(_0x46955c[_0x3f4621(0x17a)],_0x13681e),_0x12df92=await createOrRecoverEmbeddedSegment(_0x3eb271,_0x15792b,{'localName':_0x2aab1e,'uniqueSegmentName':_0x4b9c63,'description':_0x46955c[_0x3f4621(0x1f9)]||_0x3f4621(0x201)+_0x2aab1e,'journeyId':_0x456423,'resolvedRule':_0x1e8013,'parentId':_0x4cb216[_0x3f4621(0x14e)],'folderId':_0x4cb216['effectiveFolderId']||''},_0xd70d07);_0x4f2ef0[_0x3f4621(0x1c6)](_0x2aab1e,_0x12df92),_0x42b3a4['segmentNameToId'][_0x3f4621(0x1c6)](_0x2aab1e,_0x12df92),_0x592693['onProgress']?.({'type':_0x3f4621(0x186),'journeyName':_0x15792b['yamlConfig'][_0x3f4621(0x1f7)],'segmentName':_0x2aab1e});}const _0x2dd3df=new Map();for(const [_0x2cdc4a,_0x2e6e1a]of _0x23d37c){_0x592693[_0x3f4621(0x1d0)]?.({'type':_0x3f4621(0x182),'journeyName':_0x15792b[_0x3f4621(0x237)][_0x3f4621(0x1f7)],'activationName':_0x2cdc4a});const _0x527b48=await _0x1338d6(_0x2e6e1a,_0x42b3a4[_0x3f4621(0x18b)]),_0x1789b7={..._0x527b48,..._0x2e6e1a['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x2e6e1a[_0x3f4621(0x1cd)]}},_0x1e54b2=await _0x3eb271[_0x3f4621(0x1ff)]['createActivation'](_0x456423,_0x1789b7);_0x2dd3df[_0x3f4621(0x1c6)](_0x2cdc4a,_0x1e54b2['id']),_0x411df8[_0x3f4621(0x212)]['set'](_0x2cdc4a,_0x1e54b2['id']),_0x592693[_0x3f4621(0x1d0)]?.({'type':'embedded_activation_created','journeyName':_0x15792b[_0x3f4621(0x237)][_0x3f4621(0x1f7)],'activationName':_0x2cdc4a});}const _0x579d13=JSON['parse'](JSON[_0x3f4621(0x21e)](_0x582a4f));return _0x579d13['id']=_0x456423,ensureJourneyDefaults(_0x579d13[_0x3f4621(0x1ad)]),resolvePendingIdsInRequest(_0x579d13,_0x582a4f,_0x83766b,_0x4f2ef0,_0x2dd3df,_0x592693),await _0x3eb271[_0x3f4621(0x1ff)][_0x3f4621(0x177)](_0x456423,_0x579d13),deletePushRecovery(_0x15792b['absolutePath']),{'action':_0x3f4621(0x20c),'journeyId':_0x456423,'embeddedSegmentNameToId':_0x4f2ef0};}export function stripWaitStepPendingIds(_0xb8d5aa){const _0x37b63e=a140_0x374048,_0x25c368=_0xb8d5aa[_0x37b63e(0x1a9)]&&isPendingSegmentId(_0xb8d5aa['conditionSegmentId']),_0x612f3f=_0xb8d5aa[_0x37b63e(0x1f5)]?.[_0x37b63e(0x210)](_0x2216b2=>_0x2216b2[_0x37b63e(0x23b)]&&isPendingSegmentId(_0x2216b2[_0x37b63e(0x23b)]));(_0x25c368||_0x612f3f)&&(_0xb8d5aa[_0x37b63e(0x146)]='Duration',_0xb8d5aa['waitStep']=0x1,_0xb8d5aa[_0x37b63e(0x1db)]='day',delete _0xb8d5aa['conditionSegmentId'],delete _0xb8d5aa[_0x37b63e(0x165)],delete _0xb8d5aa[_0x37b63e(0x1c7)],delete _0xb8d5aa[_0x37b63e(0x1f5)]);}export function resolveWaitStepPendingIds(_0xfbed7f,_0x94821e,_0x58d4ec,_0x68c26a){const _0x52114f=a140_0x374048;if(_0x94821e[_0x52114f(0x1a9)]&&isPendingSegmentId(_0x94821e[_0x52114f(0x1a9)])){const _0x5178f9=_0x58d4ec(_0x94821e[_0x52114f(0x1a9)],_0x52114f(0x19e)+_0x68c26a+_0x52114f(0x18d));_0x5178f9&&(_0xfbed7f['waitStepType']=_0x52114f(0x1f4),_0xfbed7f[_0x52114f(0x1a9)]=_0x5178f9,delete _0xfbed7f[_0x52114f(0x217)],delete _0xfbed7f[_0x52114f(0x1db)],_0x94821e['conditionTimeoutDuration']!==undefined&&(_0xfbed7f['conditionTimeoutDuration']=_0x94821e['conditionTimeoutDuration']),_0x94821e[_0x52114f(0x1c7)]&&(_0xfbed7f[_0x52114f(0x1c7)]=_0x94821e[_0x52114f(0x1c7)]));}if(_0x94821e['conditions']){const _0x42dfaf=_0x94821e[_0x52114f(0x1f5)][_0x52114f(0x210)](_0x157e22=>_0x157e22[_0x52114f(0x23b)]&&isPendingSegmentId(_0x157e22[_0x52114f(0x23b)]));if(_0x42dfaf){const _0x1d2935=_0x94821e['conditions']['map'](_0x5d3f10=>{const _0xef9ed=_0x52114f;if(_0x5d3f10[_0xef9ed(0x23b)]&&isPendingSegmentId(_0x5d3f10['segmentId'])){const _0x3551e5=_0x58d4ec(_0x5d3f10['segmentId'],_0xef9ed(0x19e)+_0x68c26a+'\x27\x20wait\x20condition');return{..._0x5d3f10,'segmentId':_0x3551e5||_0x5d3f10[_0xef9ed(0x23b)]};}return{..._0x5d3f10};});_0xfbed7f['waitStepType']=_0x52114f(0x1f4),_0xfbed7f[_0x52114f(0x1f5)]=_0x1d2935,delete _0xfbed7f[_0x52114f(0x217)],delete _0xfbed7f[_0x52114f(0x1db)],delete _0xfbed7f[_0x52114f(0x1a9)],delete _0xfbed7f[_0x52114f(0x165)],delete _0xfbed7f[_0x52114f(0x1c7)];}}}function stripPendingIds(_0x300f13){const _0x3a81a3=a140_0x374048;_0x300f13[_0x3a81a3(0x1ad)][_0x3a81a3(0x20a)]?.['segmentId']&&isPendingSegmentId(_0x300f13[_0x3a81a3(0x1ad)][_0x3a81a3(0x20a)][_0x3a81a3(0x23b)])&&delete _0x300f13[_0x3a81a3(0x1ad)]['goal'];for(const _0x36f7a6 of _0x300f13[_0x3a81a3(0x1ad)][_0x3a81a3(0x1c8)]||[]){_0x36f7a6[_0x3a81a3(0x1d2)]?.[_0x3a81a3(0x23b)]&&isPendingSegmentId(_0x36f7a6[_0x3a81a3(0x1d2)][_0x3a81a3(0x23b)])&&delete _0x36f7a6[_0x3a81a3(0x1d2)];_0x36f7a6[_0x3a81a3(0x215)]?.[_0x3a81a3(0x23b)]&&isPendingSegmentId(_0x36f7a6['milestone'][_0x3a81a3(0x23b)])&&delete _0x36f7a6[_0x3a81a3(0x215)];_0x36f7a6['exitCriterias']&&(_0x36f7a6[_0x3a81a3(0x222)]=_0x36f7a6[_0x3a81a3(0x222)][_0x3a81a3(0x168)](_0x5989d4=>!_0x5989d4[_0x3a81a3(0x23b)]||!isPendingSegmentId(_0x5989d4[_0x3a81a3(0x23b)])));if(_0x36f7a6[_0x3a81a3(0x1c0)])for(const _0x77e731 of Object['keys'](_0x36f7a6[_0x3a81a3(0x1c0)])){const _0x579a82=_0x36f7a6['steps'][_0x77e731];_0x579a82[_0x3a81a3(0x1f0)]===_0x3a81a3(0x1fc)&&_0x579a82[_0x3a81a3(0x184)]&&isPendingActivationId(_0x579a82['journeyActivationStepId'])&&(_0x579a82['journeyActivationStepId']='');if(_0x579a82['type']===_0x3a81a3(0x1c2)&&_0x579a82[_0x3a81a3(0x20b)])for(const _0xbff252 of _0x579a82[_0x3a81a3(0x20b)]){_0xbff252[_0x3a81a3(0x23b)]&&isPendingSegmentId(_0xbff252[_0x3a81a3(0x23b)])&&(_0xbff252[_0x3a81a3(0x23b)]='');}_0x579a82[_0x3a81a3(0x1f0)]===_0x3a81a3(0x1f1)&&stripWaitStepPendingIds(_0x579a82);}}}function resolvePendingIdsInRequest(_0x5f4014,_0x30ea3a,_0x219b0a,_0x22c71d,_0x1236cf,_0x4119ba){const _0x1f500a=a140_0x374048,_0x2e2518=(_0x2e722d,_0x2a2ee0)=>{const _0x5a91a1=a140_0x2c7d;if(!isPendingSegmentId(_0x2e722d))return _0x2e722d;const _0x2d7255=extractPendingSegmentName(_0x2e722d),_0x178c42=_0x22c71d[_0x5a91a1(0x203)](_0x2d7255);return!_0x178c42&&_0x4119ba[_0x5a91a1(0x140)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x2d7255+_0x5a91a1(0x1e2)+_0x2a2ee0),_0x178c42;};if(_0x5f4014[_0x1f500a(0x1ad)][_0x1f500a(0x20a)]?.[_0x1f500a(0x23b)]&&isPendingSegmentId(_0x5f4014['attributes']['goal'][_0x1f500a(0x23b)])){const _0xe8d8ea=_0x2e2518(_0x5f4014[_0x1f500a(0x1ad)]['goal']['segmentId'],_0x1f500a(0x18a));_0xe8d8ea&&(_0x5f4014[_0x1f500a(0x1ad)][_0x1f500a(0x20a)][_0x1f500a(0x23b)]=_0xe8d8ea);}for(const _0x5c5e2e of _0x5f4014[_0x1f500a(0x1ad)][_0x1f500a(0x1c8)]||[]){const _0x344242=_0x219b0a['get'](_0x5c5e2e[_0x1f500a(0x1f7)]['toLowerCase']());_0x344242&&(_0x5c5e2e['id']=_0x344242);if(_0x5c5e2e[_0x1f500a(0x1d2)]?.[_0x1f500a(0x23b)]&&isPendingSegmentId(_0x5c5e2e['entryCriteria'][_0x1f500a(0x23b)])){const _0x159536=_0x2e2518(_0x5c5e2e[_0x1f500a(0x1d2)][_0x1f500a(0x23b)],'stage\x20\x27'+_0x5c5e2e[_0x1f500a(0x1f7)]+_0x1f500a(0x151));_0x159536&&(_0x5c5e2e['entryCriteria'][_0x1f500a(0x23b)]=_0x159536);}if(_0x5c5e2e[_0x1f500a(0x222)])for(const _0x1e36ff of _0x5c5e2e['exitCriterias']){if(_0x1e36ff[_0x1f500a(0x23b)]&&isPendingSegmentId(_0x1e36ff[_0x1f500a(0x23b)])){const _0x542324=_0x2e2518(_0x1e36ff[_0x1f500a(0x23b)],_0x1f500a(0x19e)+_0x5c5e2e['name']+_0x1f500a(0x185));_0x542324&&(_0x1e36ff[_0x1f500a(0x23b)]=_0x542324);}}if(_0x5c5e2e['milestone']?.[_0x1f500a(0x23b)]&&isPendingSegmentId(_0x5c5e2e['milestone'][_0x1f500a(0x23b)])){const _0x32a225=_0x2e2518(_0x5c5e2e[_0x1f500a(0x215)][_0x1f500a(0x23b)],_0x1f500a(0x19e)+_0x5c5e2e[_0x1f500a(0x1f7)]+'\x27\x20milestone');_0x32a225&&(_0x5c5e2e[_0x1f500a(0x215)]['segmentId']=_0x32a225);}if(_0x5c5e2e['steps']){const _0x48a940=_0x209bbf=>_0x30ea3a[_0x1f500a(0x1ad)][_0x1f500a(0x1c8)]?.[_0x1f500a(0x1a7)](_0x526d08=>_0x526d08[_0x1f500a(0x1f7)][_0x1f500a(0x227)]()===_0x5c5e2e[_0x1f500a(0x1f7)][_0x1f500a(0x227)]())?.[_0x1f500a(0x1c0)]?.[_0x209bbf];for(const _0x2c76cf of Object[_0x1f500a(0x1b7)](_0x5c5e2e[_0x1f500a(0x1c0)])){const _0x1fa260=_0x5c5e2e[_0x1f500a(0x1c0)][_0x2c76cf],_0x41c1c1=_0x48a940(_0x2c76cf);if(_0x1fa260[_0x1f500a(0x1f0)]===_0x1f500a(0x1fc)&&_0x1fa260[_0x1f500a(0x184)]&&(isPendingActivationId(_0x1fa260[_0x1f500a(0x184)])||_0x1fa260['journeyActivationStepId']==='')){if(_0x41c1c1?.[_0x1f500a(0x184)]&&isPendingActivationId(_0x41c1c1[_0x1f500a(0x184)])){const _0x187b74=extractPendingActivationName(_0x41c1c1[_0x1f500a(0x184)]),_0x2d1290=_0x1236cf[_0x1f500a(0x203)](_0x187b74);_0x2d1290&&(_0x1fa260['journeyActivationStepId']=_0x2d1290);}}if(_0x1fa260[_0x1f500a(0x1f0)]==='DecisionPoint'&&_0x1fa260[_0x1f500a(0x20b)]&&_0x41c1c1?.[_0x1f500a(0x20b)])for(let _0x47ce7d=0x0;_0x47ce7d<_0x1fa260[_0x1f500a(0x20b)][_0x1f500a(0x175)];_0x47ce7d++){const _0x48f7bd=_0x1fa260[_0x1f500a(0x20b)][_0x47ce7d],_0x28fdae=_0x41c1c1[_0x1f500a(0x20b)][_0x47ce7d];if(_0x28fdae?.['segmentId']&&isPendingSegmentId(_0x28fdae[_0x1f500a(0x23b)])){const _0x5b14e5=_0x2e2518(_0x28fdae[_0x1f500a(0x23b)],_0x1f500a(0x19e)+_0x5c5e2e['name']+_0x1f500a(0x20e)+(_0x48f7bd[_0x1f500a(0x1f7)]||_0x47ce7d)+'\x27');_0x5b14e5&&(_0x48f7bd['segmentId']=_0x5b14e5);}}_0x1fa260[_0x1f500a(0x1f0)]===_0x1f500a(0x1f1)&&_0x41c1c1?.['type']==='WaitStep'&&resolveWaitStepPendingIds(_0x1fa260,_0x41c1c1,_0x2e2518,_0x5c5e2e['name']);}}}}
1
+ const a140_0x31484a=a140_0x3d70;(function(_0x3cf753,_0xd8e3e0){const _0x29e1d5=a140_0x3d70,_0x825a70=_0x3cf753();while(!![]){try{const _0xbe43c=parseInt(_0x29e1d5(0x1b4))/0x1*(parseInt(_0x29e1d5(0x1bc))/0x2)+-parseInt(_0x29e1d5(0x149))/0x3*(-parseInt(_0x29e1d5(0x20b))/0x4)+parseInt(_0x29e1d5(0x15a))/0x5*(parseInt(_0x29e1d5(0x1d2))/0x6)+-parseInt(_0x29e1d5(0x1ad))/0x7*(-parseInt(_0x29e1d5(0x147))/0x8)+parseInt(_0x29e1d5(0x1b2))/0x9*(-parseInt(_0x29e1d5(0x1c5))/0xa)+parseInt(_0x29e1d5(0x210))/0xb+-parseInt(_0x29e1d5(0x13f))/0xc;if(_0xbe43c===_0xd8e3e0)break;else _0x825a70['push'](_0x825a70['shift']());}catch(_0x3bcef5){_0x825a70['push'](_0x825a70['shift']());}}}(a140_0x43e9,0x740cf));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a140_0x31484a(0x125));export const PENDING_SEGMENT_PREFIX=a140_0x31484a(0x156);export const PENDING_ACTIVATION_PREFIX=a140_0x31484a(0x184);export function createPendingSegmentId(_0x512e2b){return''+PENDING_SEGMENT_PREFIX+_0x512e2b+'__';}export function isPendingSegmentId(_0x277276){const _0x2823be=a140_0x31484a;return _0x277276[_0x2823be(0x21b)](PENDING_SEGMENT_PREFIX)&&!_0x277276[_0x2823be(0x21b)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1f0948){return _0x1f0948['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x8b5748){return''+PENDING_ACTIVATION_PREFIX+_0x8b5748+'__';}export function isPendingActivationId(_0x297196){return _0x297196['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x57fa21){const _0x3e1841=a140_0x31484a;return _0x57fa21[_0x3e1841(0x199)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x475bd7,_0xae7385){const _0x30383=a140_0x31484a,_0x4298fd=_0x475bd7+'::'+(_0xae7385[_0x30383(0x12d)]()||_0x30383(0x1fc)),_0x5cc681=createHash(_0x30383(0x196))['update'](_0x4298fd)['digest'](_0x30383(0x22b))[_0x30383(0x1d0)](0x0,0xc);return _0x30383(0x168)+_0x5cc681;}export function ensureJourneyDefaults(_0x45a405){const _0x2aa3f4=a140_0x31484a;!_0x45a405[_0x2aa3f4(0x144)]&&(_0x45a405[_0x2aa3f4(0x144)]=''),!_0x45a405[_0x2aa3f4(0x138)]&&(_0x45a405['state']='draft');}export function injectExistingStageIds(_0x556b4d,_0x5b409e){const _0x4ef871=a140_0x31484a,_0x471e51=new Map(_0x5b409e[_0x4ef871(0x1ee)](_0x43b2c8=>[_0x43b2c8[_0x4ef871(0x1cd)],_0x43b2c8['id']]));for(const _0x98963 of _0x556b4d){if(!_0x98963['id']){const _0x4fc098=_0x471e51[_0x4ef871(0x163)](_0x98963[_0x4ef871(0x1cd)]);_0x4fc098&&(_0x98963['id']=_0x4fc098);}}}export function resolveTDFolderPath(_0x40be0b,_0x313ede,_0x5cc12f){const _0x4ef8ab=a140_0x31484a;if(!_0x313ede)return _0x40be0b;if(_0x40be0b===_0x5cc12f||_0x40be0b[_0x4ef8ab(0x21b)](_0x5cc12f+'/'))return _0x40be0b;return _0x40be0b?_0x5cc12f+'/'+_0x40be0b:_0x5cc12f;}export function addFoldersToCreate(_0xb7cf81,_0x2eff6f,_0x12f94b){const _0x5c150c=a140_0x31484a;if(!_0xb7cf81)return;if(_0x2eff6f[_0x5c150c(0x1f3)](_0xb7cf81))return;const _0x51c579=_0xb7cf81['split']('/');let _0x40d3a0='';for(const _0x1610a8 of _0x51c579){_0x40d3a0=_0x40d3a0?_0x40d3a0+'/'+_0x1610a8:_0x1610a8,!_0x2eff6f['has'](_0x40d3a0)&&_0x12f94b[_0x5c150c(0x1de)](_0x40d3a0);}}export function sortFoldersByDepth(_0x385ee0){const _0x2f8774=a140_0x31484a;return[..._0x385ee0][_0x2f8774(0x173)]((_0x2e3b84,_0x136c81)=>{const _0x24bec3=_0x2f8774,_0x4f7452=(_0x2e3b84['match'](/\//g)||[])[_0x24bec3(0x16e)],_0x2e241f=(_0x136c81[_0x24bec3(0x13e)](/\//g)||[])[_0x24bec3(0x16e)];return _0x4f7452-_0x2e241f;});}import*as a140_0x1fda5b from'yaml';import{readFileSync}from'fs';import a140_0x3e8eeb from'path';import{isJourneyDef,parseYamlString as a140_0x5664c6,toYamlString as a140_0x34a350,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';function a140_0x3d70(_0x57831d,_0x1bb3d3){_0x57831d=_0x57831d-0x11e;const _0x43e97a=a140_0x43e9();let _0x3d7011=_0x43e97a[_0x57831d];return _0x3d7011;}import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x4fb5c7){const _0x4daafb=a140_0x31484a;if(Array['isArray'](_0x4fb5c7))return'['+_0x4fb5c7[_0x4daafb(0x1ee)](_0xde789f=>stableStringify(_0xde789f))[_0x4daafb(0x13b)](',')+']';if(_0x4fb5c7&&typeof _0x4fb5c7==='object'){const _0x1f574a=_0x4fb5c7,_0x2cf438=Object[_0x4daafb(0x1ea)](_0x1f574a)[_0x4daafb(0x173)](),_0x4907ee=_0x2cf438[_0x4daafb(0x1ee)](_0x596174=>'\x22'+_0x596174+'\x22:'+stableStringify(_0x1f574a[_0x596174]));return'{'+_0x4907ee[_0x4daafb(0x13b)](',')+'}';}const _0x307eed=JSON['stringify'](_0x4fb5c7);return _0x307eed===undefined?_0x4daafb(0x1cf):_0x307eed;}function activationSignature(_0x3d9c07){const _0x59161d=a140_0x31484a,_0x8c66dd={'connection':_0x3d9c07['connection'],..._0x3d9c07['all_columns']!==undefined&&{'all_columns':_0x3d9c07[_0x59161d(0x17b)]},..._0x3d9c07[_0x59161d(0x1cb)]!==undefined&&{'columns':_0x3d9c07['columns']},..._0x3d9c07[_0x59161d(0x1e1)]!==undefined&&{'behavior':_0x3d9c07['behavior']},..._0x3d9c07[_0x59161d(0x20a)]!==undefined&&{'schedule':_0x3d9c07[_0x59161d(0x20a)]},..._0x3d9c07[_0x59161d(0x16a)]!==undefined&&{'notification':_0x3d9c07[_0x59161d(0x16a)]},..._0x3d9c07[_0x59161d(0x206)]!==undefined&&{'connector_config':_0x3d9c07['connector_config']},..._0x3d9c07['activation_template_id']!==undefined&&{'activation_template_id':_0x3d9c07[_0x59161d(0x1c0)]}};return stableStringify(_0x8c66dd);}async function fetchSegment(_0x2e1321,_0x2dbeeb,_0x1b9de5,_0x4c8767){const _0x3b2702=a140_0x31484a,_0x28928a=_0x4c8767?.['find'](_0x48dd90=>_0x48dd90['id']===_0x1b9de5);if(_0x28928a)return _0x28928a;try{return await _0x2e1321[_0x3b2702(0x1fc)][_0x3b2702(0x153)](_0x2dbeeb,_0x1b9de5);}catch(_0x214421){logger[_0x3b2702(0x19a)](_0x3b2702(0x219)+_0x1b9de5+_0x3b2702(0x18b)+_0x214421);try{return await _0x2e1321[_0x3b2702(0x1fc)]['getSegmentEntity'](_0x1b9de5);}catch(_0x1fd13b){return logger[_0x3b2702(0x19a)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x1b9de5+':\x20'+_0x1fd13b),null;}}}function recoverSegmentIdsFromPushRecovery(_0xee8a9b,_0x198aa0,_0xe4b2c7){const _0x5afef4=a140_0x31484a,_0x29c6ad=readPushRecovery(_0xee8a9b['absolutePath']);if(_0x29c6ad?.['journeyName']===_0xee8a9b[_0x5afef4(0x15d)]['name'])for(const [_0xccc4a2,_0x495055]of Object[_0x5afef4(0x12a)](_0x29c6ad[_0x5afef4(0x1bd)])){const _0x108c69=generateDeterministicJourneySegmentName(_0xee8a9b['yamlConfig'][_0x5afef4(0x1cd)],_0xccc4a2);_0x495055['uniqueServerName']===_0x108c69&&(_0x198aa0[_0x5afef4(0x1f9)](_0xccc4a2,_0x495055['segmentId']),_0xe4b2c7['set'](_0xccc4a2,_0x495055[_0x5afef4(0x1a0)]));}}async function createOrRecoverEmbeddedSegment(_0x346e94,_0xcb83f4,_0x30c314,_0x38008f){const _0x54ea09=a140_0x31484a;let _0x3e2cab;try{_0x3e2cab=await _0x346e94[_0x54ea09(0x1fc)]['createJourneySegment']({'name':_0x30c314[_0x54ea09(0x1c9)],'description':_0x30c314[_0x54ea09(0x144)],'journeyId':_0x30c314['journeyId'],'rule':_0x38008f(_0x30c314[_0x54ea09(0x20f)],!![]),'countPopulation':!![],'parentFolderId':_0x30c314[_0x54ea09(0x1a2)],'audienceId':_0x30c314[_0x54ea09(0x185)]});}catch(_0x2b29db){const _0x48b88a=_0x2b29db instanceof Error&&_0x2b29db[_0x54ea09(0x1eb)]['includes'](_0x54ea09(0x181));if(_0x48b88a){const _0x3f81ab=readPushRecovery(_0xcb83f4[_0x54ea09(0x1e5)]),_0x315b58=_0x3f81ab?.[_0x54ea09(0x1d1)]===_0xcb83f4[_0x54ea09(0x15d)][_0x54ea09(0x1cd)]?_0x3f81ab[_0x54ea09(0x1bd)][_0x30c314[_0x54ea09(0x1c2)]]:undefined;if(_0x315b58?.[_0x54ea09(0x187)]===_0x30c314[_0x54ea09(0x1c9)])await _0x346e94['segment'][_0x54ea09(0x14e)](_0x30c314[_0x54ea09(0x185)],_0x315b58['segmentId'],{'description':_0x30c314[_0x54ea09(0x144)],'rule':_0x38008f(_0x30c314[_0x54ea09(0x20f)],!![]),'countPopulation':!![]}),_0x3e2cab=_0x315b58[_0x54ea09(0x1a0)];else throw new SDKError(ErrorCode[_0x54ea09(0x15f)],'Embedded\x20segment\x20\x27'+_0x30c314[_0x54ea09(0x1c2)]+_0x54ea09(0x159)+(_0x54ea09(0x21f)+_0xcb83f4['absolutePath']['replace'](/([^/]+)$/,_0x54ea09(0x1da))+')\x20')+_0x54ea09(0x198),_0x2b29db);}else throw _0x2b29db;}return saveSegmentToPushRecovery(_0xcb83f4[_0x54ea09(0x1e5)],_0xcb83f4[_0x54ea09(0x15d)]['name'],_0x30c314[_0x54ea09(0x1c2)],{'segmentId':_0x3e2cab,'uniqueServerName':_0x30c314[_0x54ea09(0x1c9)],'createdAt':new Date()[_0x54ea09(0x1fa)]()}),_0x3e2cab;}export async function prepareSegmentFiles(_0x58cc86,_0x2354b9,_0x4cb178,_0x157b3a,_0x34df8e){const _0x2399fb=a140_0x31484a,{activationDefToCreateRequest:_0x6a241b}=await import('./child-segment-yaml.js'),_0x2f1d5a=[],_0x11bc85=new Set();for(const {yamlConfig:_0x49902a,folderPath:_0x4ed702,sourcePath:_0x150df4}of _0x58cc86){const _0x1084a9=resolveTDFolderPath(_0x4ed702,_0x157b3a,_0x34df8e),_0x103117=_0x1084a9+':'+_0x49902a['name'],_0x327255=_0x2354b9[_0x2399fb(0x227)][_0x2399fb(0x163)](_0x103117),_0x16b122=_0x327255?_0x2354b9[_0x2399fb(0x17c)]['get'](_0x327255['id'])||[]:[];addFoldersToCreate(_0x1084a9,_0x2354b9[_0x2399fb(0x225)],_0x11bc85);const _0xb139e4=calculateActivationActions(_0x49902a[_0x2399fb(0x170)]||[],_0x16b122,_0x2354b9[_0x2399fb(0x139)],_0x2354b9[_0x2399fb(0x175)]);for(const _0x38e8d9 of _0xb139e4){(_0x38e8d9['type']===_0x2399fb(0x172)||_0x38e8d9['type']===_0x2399fb(0x17f))&&_0x38e8d9['yamlActivation']&&(_0x38e8d9['validatedRequest']=await _0x6a241b(_0x38e8d9[_0x2399fb(0x208)],_0x4cb178));}const _0x1650f1=calculateSegmentDiff(_0x49902a,_0x327255,_0x16b122,_0x2354b9['idToEmailMap'],_0x2354b9[_0x2399fb(0x175)]);_0x2f1d5a[_0x2399fb(0x122)]({'relativePath':_0x49902a[_0x2399fb(0x1cd)],'absolutePath':_0x150df4,'yamlConfig':_0x49902a,'folderPath':_0x1084a9,'existingSegment':_0x327255,'existingActivations':_0x16b122,'isNew':_0x1650f1[_0x2399fb(0x193)],'hasChanges':_0x1650f1[_0x2399fb(0x21c)],'diff':_0x1650f1[_0x2399fb(0x19d)],'activationActions':_0xb139e4});}return{'segmentFiles':_0x2f1d5a,'foldersToCreate':_0x11bc85};}export async function prepareJourneyFiles(_0x4ac9a7,_0x514d94,_0x234030,_0x5a7600){const _0x3ff303=a140_0x31484a,_0x59f081=[],_0x1c1618=new Set();for(const {yamlConfig:_0x31186b,folderPath:_0x4f91a7,sourcePath:_0x4b899e}of _0x4ac9a7){const _0x46a983=resolveTDFolderPath(_0x4f91a7,_0x234030,_0x5a7600),_0x249b35=_0x46a983+':'+_0x31186b['name'],_0x1f08a4=_0x514d94[_0x3ff303(0x11f)]['get'](_0x249b35);let _0x5a0ff7,_0xbc6596;if(_0x1f08a4&&_0x1f08a4[_0x3ff303(0x16e)]>0x0){const _0x3485c8=buildLocalExpandedRuleMappings(_0x31186b),{createYamlContext:_0x23321f,prefetchJourneySegments:_0x45fd53}=createPushYamlContextForBundle(_0x514d94['deps'],_0x514d94[_0x3ff303(0x185)],_0x514d94['existingSegments'],_0x3485c8,_0x514d94[_0x3ff303(0x139)],_0x514d94[_0x3ff303(0x175)],_0x514d94[_0x3ff303(0x1ef)],_0x514d94[_0x3ff303(0x164)]);await _0x45fd53(_0x1f08a4[_0x3ff303(0x1ee)](_0x5ba77b=>_0x5ba77b['id']));const _0x530e21=await _0x514d94['deps'][_0x3ff303(0x1c3)]['getLatestJourneyId'](_0x1f08a4[0x0][_0x3ff303(0x155)]),_0x220199=hasMultipleVersions(_0x31186b),_0x726e67=async _0x31424b=>{const _0x45e142=_0x3ff303,_0x332af7=_0x514d94[_0x45e142(0x164)]?.[_0x45e142(0x163)](_0x31424b);if(_0x332af7)return _0x332af7;return _0x514d94[_0x45e142(0x1e6)]({'journeyId':_0x31424b,'journeyName':_0x31186b['name'],'isMultiVersion':_0x1f08a4['length']>0x1});};if(_0x220199&&_0x1f08a4[_0x3ff303(0x16e)]>0x1){const _0x4edffd=[];for(const _0x5d82d0 of _0x1f08a4){const _0x411a09=_0x5d82d0[_0x3ff303(0x16c)]||0x1;_0x514d94[_0x3ff303(0x142)]?.['update']('Fetching\x20'+_0x31186b[_0x3ff303(0x1cd)]+'\x20v'+_0x411a09);const _0x9ad75a=await _0x726e67(_0x5d82d0['id']),_0x30e442=_0x23321f(_0x5d82d0['id']),_0xa7272a=await journeyResponseToDef(_0x9ad75a,_0x30e442);_0x4edffd[_0x3ff303(0x122)]({'item':_0x5d82d0,'yaml':_0xa7272a});}const _0x3c2a91=buildLocalRuleToNameMappingFromJourney(_0x31186b);_0xbc6596=buildMergedJourneyDef(_0x4edffd,_0x3c2a91,_0x530e21);const _0x2b8cb0=Math[_0x3ff303(0x180)](..._0x4edffd[_0x3ff303(0x1ee)](_0x14bf3e=>_0x14bf3e[_0x3ff303(0x1c6)][_0x3ff303(0x16c)]||0x0)),_0x5dd5d7=_0x1f08a4['find'](_0x5a3980=>(_0x5a3980[_0x3ff303(0x16c)]||0x0)===_0x2b8cb0);_0x5dd5d7&&(_0x514d94['progress']?.['update']('Fetching\x20'+_0x31186b['name']+'\x20v'+_0x2b8cb0),_0x5a0ff7=await _0x726e67(_0x5dd5d7['id']));}else{const _0x145459=_0x1f08a4[_0x1f08a4['length']-0x1];_0x514d94[_0x3ff303(0x142)]?.[_0x3ff303(0x17f)](_0x3ff303(0x132)+_0x31186b[_0x3ff303(0x1cd)]),_0x5a0ff7=await _0x726e67(_0x145459['id']);const _0x4fd51e=_0x23321f(_0x145459['id']),_0x460e90=await journeyResponseToDef(_0x5a0ff7,_0x4fd51e),_0x17a400=buildLocalRuleToNameMappingFromJourney(_0x31186b);_0xbc6596=buildMergedJourneyDef([{'item':_0x145459,'yaml':_0x460e90}],_0x17a400,_0x530e21);}}addFoldersToCreate(_0x46a983,_0x514d94[_0x3ff303(0x225)],_0x1c1618);const _0x54817c=calculateJourneyDiff(_0x31186b,_0xbc6596);_0x59f081[_0x3ff303(0x122)]({'relativePath':_0x31186b[_0x3ff303(0x1cd)],'absolutePath':_0x4b899e,'yamlConfig':_0x31186b,'folderPath':_0x46a983,'existingJourney':_0x5a0ff7,'isNew':_0x54817c[_0x3ff303(0x193)],'hasChanges':_0x54817c[_0x3ff303(0x21c)],'diff':_0x54817c[_0x3ff303(0x19d)]});}return{'journeyFiles':_0x59f081,'foldersToCreate':_0x1c1618};}export function calculateActivationActions(_0x158941,_0x22f6c4,_0x3bed22,_0x49320c){const _0x52975b=a140_0x31484a,_0x53d563=[],_0x415d29=new Map();for(const _0xe2a423 of _0x22f6c4){_0x415d29[_0x52975b(0x1f9)](_0xe2a423[_0x52975b(0x1cd)],_0xe2a423);}const _0xd296e0=new Map();for(const _0x4c2bab of _0x158941){_0xd296e0['set'](_0x4c2bab[_0x52975b(0x1cd)],_0x4c2bab);}for(const _0xfb4dee of _0x158941){const _0x1dff8b=_0x415d29[_0x52975b(0x163)](_0xfb4dee[_0x52975b(0x1cd)]);if(!_0x1dff8b)_0x53d563[_0x52975b(0x122)]({'type':_0x52975b(0x172),'name':_0xfb4dee[_0x52975b(0x1cd)],'yamlActivation':_0xfb4dee});else{const _0x4ce0cd=activationResponseToDef(_0x1dff8b,_0x3bed22,_0x49320c),_0x507556=a140_0x1fda5b['stringify'](_0x4ce0cd),_0x583c86=a140_0x1fda5b['stringify'](_0xfb4dee);_0x507556!==_0x583c86&&_0x53d563[_0x52975b(0x122)]({'type':_0x52975b(0x17f),'name':_0xfb4dee[_0x52975b(0x1cd)],'yamlActivation':_0xfb4dee,'existingActivation':_0x1dff8b});}}for(const _0x621e01 of _0x22f6c4){!_0xd296e0[_0x52975b(0x1f3)](_0x621e01[_0x52975b(0x1cd)])&&_0x53d563[_0x52975b(0x122)]({'type':'delete','name':_0x621e01[_0x52975b(0x1cd)],'existingActivation':_0x621e01});}return _0x53d563;}function calculateYamlDiff(_0x3119c1,_0x7ad6be){if(_0x7ad6be){const _0x17a944=generateDiff(_0x7ad6be,_0x3119c1),_0x599fe7=hasChanges(_0x17a944);return{'isNew':![],'hasChanges':_0x599fe7,'diff':_0x599fe7?formatDiffWithColors(_0x17a944):undefined};}const _0x1b300d=generateDiff('',_0x3119c1);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1b300d)};}export function calculateSegmentDiff(_0x504396,_0x469501,_0x36062e,_0x1f331a,_0x34e6af){const _0x4861a9=segmentToYamlString(_0x504396),_0x26e2d0=_0x469501?segmentToYamlString(segmentWithActivationsToYaml(_0x469501,_0x36062e,undefined,_0x1f331a,_0x34e6af)):undefined;return calculateYamlDiff(_0x4861a9,_0x26e2d0);}export function calculateJourneyDiff(_0x4218ba,_0x484748){const _0x378724=normalizeJourneyDef(_0x4218ba,_0x4218ba),_0x5b6214=a140_0x34a350(_0x378724),_0xcc10e2=_0x484748?a140_0x34a350(normalizeJourneyDef(_0x484748,_0x4218ba)):undefined;return calculateYamlDiff(_0x5b6214,_0xcc10e2);}export function findSegmentsToDelete(_0x58c3ca,_0x12d37c,_0x1454fe,_0x977632,_0x2d5da3){const _0x53e452=a140_0x31484a,_0x2c6bd2=new Set();for(const {yamlConfig:_0x3dfd5b,folderPath:_0x27fab1}of _0x12d37c){_0x2c6bd2[_0x53e452(0x1de)](_0x27fab1+':'+_0x3dfd5b[_0x53e452(0x1cd)]);}return _0x58c3ca[_0x53e452(0x1f4)](_0x58e59d=>{const _0x3abb65=_0x53e452,_0x4e6879=_0x58e59d['segmentFolderId']?_0x1454fe[_0x3abb65(0x163)](_0x58e59d[_0x3abb65(0x131)][_0x3abb65(0x1d3)]())||'':'',_0x3ac68f=_0x4e6879+':'+_0x58e59d[_0x3abb65(0x1cd)];if(_0x2c6bd2['has'](_0x3ac68f))return![];if(_0x2d5da3)return _0x4e6879===_0x977632||_0x4e6879[_0x3abb65(0x21b)](_0x977632+'/');return!![];});}export function findJourneysToDelete(_0x59758c,_0x410802,_0x385cd2,_0x2dd563,_0x3e1159){const _0x4f5063=a140_0x31484a,_0x43cf99=new Set();for(const {yamlConfig:_0x17c21f,folderPath:_0x2dcc1a}of _0x410802){_0x43cf99['add'](_0x2dcc1a+':'+_0x17c21f[_0x4f5063(0x1cd)]);}return _0x59758c[_0x4f5063(0x1f4)](_0x3548b4=>{const _0x4d67b0=_0x4f5063,_0x370fd9=_0x3548b4[_0x4d67b0(0x1a2)]?_0x385cd2[_0x4d67b0(0x163)](_0x3548b4[_0x4d67b0(0x1a2)])||'':'',_0x28f29b=_0x370fd9+':'+_0x3548b4[_0x4d67b0(0x1b6)];if(_0x43cf99[_0x4d67b0(0x1f3)](_0x28f29b))return![];if(_0x3e1159)return _0x370fd9===_0x2dd563||_0x370fd9[_0x4d67b0(0x21b)](_0x2dd563+'/');return!![];});}export function buildSegmentLookupMap(_0x418d14,_0xf24221){const _0x10a3ee=a140_0x31484a,_0x464af5=new Map();for(const _0x3bbb67 of _0x418d14){const _0x8e03e5=_0x3bbb67[_0x10a3ee(0x131)]?_0xf24221[_0x10a3ee(0x163)](_0x3bbb67[_0x10a3ee(0x131)]['toString']())||'':'',_0x1215cd=_0x8e03e5+':'+_0x3bbb67[_0x10a3ee(0x1cd)];_0x464af5['set'](_0x1215cd,_0x3bbb67);}return _0x464af5;}function a140_0x43e9(){const _0x51082b=['createdSegmentIds','entries','stringify','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','trim','goal\x20criteria','journeys','ACTIVATION_UPDATE_ERROR','segmentFolderId','Fetching\x20','folder','idToName','withProgress','ACTIVATION_SYNTAX_ERROR','find','state','idToEmailMap','journey_created','join','getJourney','goal','match','25523592ghxAyA','with','Matched\x20server\x20segment\x20\x27','progress','Deleting\x20activation\x20\x27','description','segment_created','Created\x20journey\x20\x27','992376Lfvond','activation_created','277854vCrPII','rule','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Entry\x20criteria:\x20','parseDocument','updateSegmentById','embeddedSegmentNameToId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','list','\x20error(s)','getSegment','updateActivation','journeyBundleId','__pending_','\x27...','conditions','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','5KhZAbX','Deleted\x20activation\x20\x27','Segment\x20not\x20found','yamlConfig','journeyStages','SEGMENT_UPDATE_ERROR','\x27\x20exit\x20criteria','conditionTimeoutDuration','all','get','journeyById',').\x20','parse','createActivation','journey_entry_criteria_','effectiveFolderId','notification','Segment\x20not\x20found:\x20','versionNumber','Created\x20segment\x20\x27','length','conditionSegmentId','activations','logSuccess','create','sort','parentFolder','connectionIdToNameMap','SEGMENT_NOT_FOUND','Failed\x20to\x20','updated','journey_creating','size','all_columns','activationsBySegmentId','parentSegmentFolder','folder_creating','update','max','Name\x20has\x20already\x20been\x20taken','logDeleted','branches','__pending_act_','parentId','Activation','uniqueServerName','NOT_FOUND','\x20activation\x20\x27','./journey-yaml.js',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','Updating\x20segment\x20\x27','INTERNAL','folderPath','activationParams','Creating\x20segment\x20\x27','segmentNameToId','Failed\x20to\x20fetch\x20referenced\x20segment\x20','isNew','Updated\x20journey\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','sha1','createdSegmentId','and\x20the\x20server\x20segment,\x20then\x20retry.','replace','debug','activation_updated','\x27\x20milestone','diff','activation_updating','nameToType','segmentId','createFolder','folderId','errors','stages','journey_updated','valid','journeyActivationNameToId','day','./child-segment-yaml.js','data','from','Updating\x20activation\x20\x27','21lqWyvN','deleteActivation','journeyActivationStepId','index','\x20(referenced\x20in\x20journey\x20','189cDZpDp','createSegment','51dGyFWI','exitCriterias','journeyBundleName','Failed\x20to\x20resolve\x20activation\x20','waitStepType','dirname','rootFolderId','milestone','37174WfzKIQ','segments','kind','buildUserMaps','activation_template_id','resolveSegment','localName','journey','steps','169450GSRtSx','item','getActivation','embedded_segment_created','uniqueSegmentName','attributes','columns','Activation\x20not\x20found:\x20','name','Failed\x20to\x20resolve\x20segment\x20','null','slice','journeyName','15474HxyHaf','toString','WaitStep','run_after_journey_refresh','\x27\x20entry\x20criteria','split','existingSegments','delete','.$1.push-recovery.json','resolveJourneyId','Creating\x20activation\x20\x27','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','add','activationActions','some','behavior','validatedRequest','journeyId','embedded_segment_creating','absolutePath','fetchJourney','entry','waitStepUnit','activation_deleting','keys','message','journey_updating','\x20segment\x20from\x20file:\x20','map','activationStepsById','listActivations','deleted','\x20journey\x20from\x20file:\x20','has','filter','nameToId','values','\x27\x20decision\x20point\x20branch\x20\x27','segment_updating','set','toISOString','segment_deleted','segment','existingSegment','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Duration','folder_created','onProgress','\x0a\x20\x20','logWarning','DecisionPoint','activation_deleted','connector_config','type','yamlActivation','segment_deleting','schedule','36Jwgmrh','Journey\x20\x27','created','relationships','resolvedRule','8821285BWhPWI','flatMap','\x27\x20wait\x20condition','stage\x20\x27','segment_updated','toLowerCase','results','activationContext','):\x20','getSegment\x20failed\x20for\x20','activation_','startsWith','hasChanges','Created\x20activation\x20\x27','conditionTimeoutUnit','Delete\x20the\x20push\x20recovery\x20file\x20(','unchanged','JOURNEY_UPDATE_ERROR','utf-8','existingJourney','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','folderPathToId','activation_creating','segmentByFolderAndName','Creating\x20folder\x20\x27','../../utils/async.js','entryCriteria','hex','Updated\x20activation\x20\x27','journeyBundlesByFolderAndName','Condition','existingActivation','push','action','embedded_activation_creating','tdx.sdk.push-workflow','Created\x20folder\x20\x27','entry_criteria','relative'];a140_0x43e9=function(){return _0x51082b;};return a140_0x43e9();}export function buildSegmentNameToIdMap(_0xcb4467){const _0x4c66da=a140_0x31484a,_0x30eb11=new Map();for(const _0x427e71 of _0xcb4467){_0x30eb11['set'](_0x427e71[_0x4c66da(0x1cd)],_0x427e71['id']);}return _0x30eb11;}export function buildJourneyBundleLookupMap(_0x4d6ecf,_0x5376c4){const _0x366eeb=a140_0x31484a,_0x3688d8=new Map();for(const _0x117699 of _0x4d6ecf){const _0xb3277c=_0x117699['folderId']?_0x5376c4[_0x366eeb(0x163)](_0x117699[_0x366eeb(0x1a2)])||'':'',_0x272ea2=_0xb3277c+':'+_0x117699['journeyBundleName'];!_0x3688d8[_0x366eeb(0x1f3)](_0x272ea2)&&_0x3688d8[_0x366eeb(0x1f9)](_0x272ea2,[]),_0x3688d8[_0x366eeb(0x163)](_0x272ea2)[_0x366eeb(0x122)](_0x117699);}for(const _0x15dd67 of _0x3688d8[_0x366eeb(0x1f6)]()){_0x15dd67[_0x366eeb(0x173)]((_0x4a4056,_0x92c9c5)=>(_0x4a4056[_0x366eeb(0x16c)]||0x0)-(_0x92c9c5[_0x366eeb(0x16c)]||0x0));}return _0x3688d8;}export function collectFoldersToCreate(_0x288beb,_0x260f30){const _0x2b5700=a140_0x31484a,_0x4db6fc=new Set();for(const _0x7e0555 of _0x288beb){if(!_0x7e0555)continue;if(_0x260f30[_0x2b5700(0x1f3)](_0x7e0555))continue;const _0xec3586=_0x7e0555[_0x2b5700(0x1d7)]('/');let _0x54f06e='';for(const _0x474e27 of _0xec3586){_0x54f06e=_0x54f06e?_0x54f06e+'/'+_0x474e27:_0x474e27,!_0x260f30[_0x2b5700(0x1f3)](_0x54f06e)&&_0x4db6fc[_0x2b5700(0x1de)](_0x54f06e);}}return _0x4db6fc;}export function parseAndClassifyYamlFiles(_0x3aff7e,_0xb942bb,_0x281f75){const _0x2d4d93=a140_0x31484a,_0x22f52f=[],_0x3fa125=[];for(const _0x18b9a1 of _0x3aff7e){const _0x39ab50=a140_0x3e8eeb[_0x2d4d93(0x128)](_0xb942bb,a140_0x3e8eeb[_0x2d4d93(0x1b9)](_0x18b9a1)),_0xd90b1d=_0x39ab50==='.'?'':_0x39ab50,_0x51172c=readFileSync(_0x18b9a1,_0x2d4d93(0x222)),_0x25eef0=a140_0x1fda5b['parse'](_0x51172c);if(isJourneyDef(_0x25eef0)){const _0x4ef888=a140_0x5664c6(_0x51172c);_0x3fa125[_0x2d4d93(0x122)]({'yamlConfig':_0x4ef888,'folderPath':_0xd90b1d,'sourcePath':_0x18b9a1});}else{if(!_0x281f75?.['skipSegments']){const _0x35c660=parseSegmentYamlFile(_0x51172c),_0x501b60=normalizeChildSegmentYaml(_0x35c660);_0x22f52f[_0x2d4d93(0x122)]({'yamlConfig':_0x501b60,'folderPath':_0xd90b1d,'sourcePath':_0x18b9a1});}}}return{'segments':_0x22f52f,'journeys':_0x3fa125};}export function validateParsedFiles(_0x95f212,_0x51f3f4){const _0x306a6f=a140_0x31484a,_0x2d0bfe=[];for(const {yamlConfig:_0x346365,sourcePath:_0x16f58d}of _0x95f212[_0x306a6f(0x1bd)]){const _0x5397fd=readFileSync(_0x16f58d,'utf-8'),_0xe082cf=a140_0x1fda5b[_0x306a6f(0x14d)](_0x5397fd),_0x27d133=validateSegmentDef(_0x346365,{'source':_0x5397fd,'document':_0xe082cf},{'skipSchema':!![]});if(!_0x27d133[_0x306a6f(0x1a6)]){const _0x2cf404=a140_0x3e8eeb[_0x306a6f(0x128)](_0x51f3f4,_0x16f58d);_0x2d0bfe[_0x306a6f(0x122)]({'filePath':_0x2cf404,'source':_0x5397fd,'result':_0x27d133,'isJourney':![]});}}for(const {yamlConfig:_0x400642,sourcePath:_0x48c06d}of _0x95f212['journeys']){const _0x3464c4=readFileSync(_0x48c06d,_0x306a6f(0x222)),_0x431294=a140_0x1fda5b[_0x306a6f(0x14d)](_0x3464c4),_0x12f13e=validateJourneyDef(_0x400642,{'source':_0x3464c4,'document':_0x431294},{'skipSchema':!![]});if(!_0x12f13e['valid']){const _0x1f2b16=a140_0x3e8eeb[_0x306a6f(0x128)](_0x51f3f4,_0x48c06d);_0x2d0bfe[_0x306a6f(0x122)]({'filePath':_0x1f2b16,'source':_0x3464c4,'result':_0x12f13e,'isJourney':!![]});}}return _0x2d0bfe;}export function formatValidationErrors(_0x153ff4){const _0xc6c42=a140_0x31484a,_0x236b3f=[];for(const {filePath:_0x43c10d,source:_0x512921,result:_0x326576,isJourney:_0x1a2f6c}of _0x153ff4){const _0x3db75c=_0x1a2f6c?_0xc6c42(0x1c3):_0xc6c42(0x1fc);_0x236b3f['push']('\x0a'+_0x43c10d+'\x20('+_0x3db75c+_0xc6c42(0x218)+_0x326576[_0xc6c42(0x1a3)]['length']+_0xc6c42(0x152)),_0x236b3f[_0xc6c42(0x122)](formatValidationResult(_0x326576,_0x512921,_0x43c10d));}return _0x236b3f['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x270052){const _0x22f4a6=a140_0x31484a,_0x317243=new Set(),_0x13ae5e=new Map(),_0x3b8ca7=collectSegmentUsageCounts(_0x270052);if(_0x270052[_0x22f4a6(0x1bd)])for(const [_0x29a485,_0x983b3f]of Object[_0x22f4a6(0x12a)](_0x270052[_0x22f4a6(0x1bd)])){_0x317243['add'](_0x29a485);if(_0x983b3f['rule']){const _0x15dc14=yamlRuleToApi(_0x983b3f[_0x22f4a6(0x14a)]),_0x34158d=apiRuleToYaml(_0x15dc14);_0x13ae5e['set'](_0x29a485,_0x34158d);}}const _0x4ee25f=new Map();let _0x3a54b5=0x0;for(const [_0x56d426,_0x26ff54]of _0x13ae5e){const _0x3fc5f8=serializeExpandedRule(_0x26ff54,_0x13ae5e),_0x5e08c5=_0x4ee25f[_0x22f4a6(0x163)](_0x3fc5f8)||[];_0x5e08c5['push']({'name':_0x56d426,'index':_0x3a54b5}),_0x4ee25f['set'](_0x3fc5f8,_0x5e08c5),_0x3a54b5++;}const _0x264e2c=new Map();for(const [_0x63b192,_0x4d0c5b]of _0x4ee25f){const _0x3f10a5=_0x4d0c5b[_0x22f4a6(0x1d0)]()[_0x22f4a6(0x173)]((_0x5b84e6,_0x20c282)=>{const _0x69a7d=_0x22f4a6,_0x3c9af8=_0x3b8ca7['get'](_0x5b84e6[_0x69a7d(0x1cd)])||0x0,_0x2825f7=_0x3b8ca7['get'](_0x20c282[_0x69a7d(0x1cd)])||0x0;if(_0x3c9af8!==_0x2825f7)return _0x2825f7-_0x3c9af8;return _0x5b84e6[_0x69a7d(0x1b0)]-_0x20c282['index'];})[_0x22f4a6(0x1ee)](_0x493e65=>_0x493e65[_0x22f4a6(0x1cd)]),_0x57776a=[];for(const _0x407e81 of _0x3f10a5){const _0x2d9567=_0x3b8ca7[_0x22f4a6(0x163)](_0x407e81)||0x0,_0x5e8f31=Math[_0x22f4a6(0x180)](_0x2d9567,0x1);for(let _0x3fe7c9=0x0;_0x3fe7c9<_0x5e8f31;_0x3fe7c9++){_0x57776a['push'](_0x407e81);}}_0x264e2c[_0x22f4a6(0x1f9)](_0x63b192,_0x57776a);}return{'existingLocalSegmentNames':_0x317243,'localSegmentRules':_0x13ae5e,'localExpandedRuleToNames':_0x264e2c};}export function createSegmentIdResolver(_0x44b274,_0x2a41cb){return async _0x3a5c7d=>{const _0x338cc0=a140_0x3d70,_0x160176=_0x44b274[_0x338cc0(0x163)](_0x3a5c7d);if(!_0x160176)throw new SDKError(ErrorCode[_0x338cc0(0x176)],_0x338cc0(0x16b)+_0x3a5c7d+_0x338cc0(0x1dd)+_0x2a41cb+'\x27)');return _0x160176;};}export function extractRootFolderId(_0x35f2ea){const _0x97b0f6=a140_0x31484a;return _0x35f2ea[_0x97b0f6(0x20e)]?.[_0x97b0f6(0x17d)]?.['data']?.['id']||_0x35f2ea[_0x97b0f6(0x20e)]?.[_0x97b0f6(0x174)]?.['data']?.['id'];}export function buildConnectionMaps(_0xa21829){const _0x2bf50f=a140_0x31484a,_0x95fec9=new Map(),_0x4ae654=new Map(),_0x19d92e=new Map();for(const _0x21220c of _0xa21829){_0x95fec9[_0x2bf50f(0x1f9)](_0x21220c[_0x2bf50f(0x1cd)],parseInt(_0x21220c['id'],0xa)),_0x4ae654[_0x2bf50f(0x1f9)](_0x21220c['id'],_0x21220c['name']),_0x19d92e[_0x2bf50f(0x1f9)](_0x21220c[_0x2bf50f(0x1cd)],_0x21220c[_0x2bf50f(0x207)]);}return{'nameToId':_0x95fec9,'idToName':_0x4ae654,'nameToType':_0x19d92e};}export function calculatePushStats(_0x742761,_0x5d85e6,_0x3e43ab,_0x3273d8,_0x4beb9c,_0xa87c7e,_0x1f202c){const _0xdda099=a140_0x31484a,_0x5b6895=_0x742761[_0xdda099(0x1f4)](_0x441fde=>_0x441fde[_0xdda099(0x193)]),_0x2e5e70=_0x742761['filter'](_0x2a0a04=>!_0x2a0a04[_0xdda099(0x193)]&&_0x2a0a04[_0xdda099(0x21c)]),_0x36f816=_0x742761[_0xdda099(0x1f4)](_0x593891=>!_0x593891[_0xdda099(0x193)]&&!_0x593891[_0xdda099(0x21c)]),_0x1e87b2=_0xa87c7e?_0x3273d8:[],_0x7436c5=_0x5d85e6[_0xdda099(0x1f4)](_0x410ed7=>_0x410ed7[_0xdda099(0x193)]),_0x409e69=_0x5d85e6[_0xdda099(0x1f4)](_0xbcf0f0=>!_0xbcf0f0[_0xdda099(0x193)]&&_0xbcf0f0['hasChanges']),_0x2a1035=_0x5d85e6['filter'](_0x24fe51=>!_0x24fe51[_0xdda099(0x193)]&&!_0x24fe51[_0xdda099(0x21c)]),_0x2ef32e=_0xa87c7e?_0x4beb9c:[],_0x1de56d=_0x742761[_0xdda099(0x211)](_0x39c7cd=>_0x39c7cd[_0xdda099(0x1df)]),_0x1eb38d=_0x1de56d[_0xdda099(0x1f4)](_0x2016e3=>_0x2016e3[_0xdda099(0x207)]==='create'),_0x3915a9=_0x1de56d[_0xdda099(0x1f4)](_0x3b6e8a=>_0x3b6e8a[_0xdda099(0x207)]===_0xdda099(0x17f)),_0x49878e=_0x1de56d[_0xdda099(0x1f4)](_0x585b1d=>_0x585b1d[_0xdda099(0x207)]===_0xdda099(0x1d9)),_0xf038b3=Array[_0xdda099(0x1ab)](_0x3e43ab)['sort'](),_0x1fefc4=_0x1f202c?![]:_0x5b6895['length']>0x0||_0x2e5e70['length']>0x0||_0x1e87b2[_0xdda099(0x16e)]>0x0,_0x2196db=_0x7436c5[_0xdda099(0x16e)]>0x0||_0x409e69[_0xdda099(0x16e)]>0x0||_0x2ef32e[_0xdda099(0x16e)]>0x0,_0x219dd0=_0x1f202c?![]:_0x1de56d[_0xdda099(0x16e)]>0x0,_0x115f34=_0xf038b3[_0xdda099(0x16e)]>0x0;return{'segments':{'new':_0x5b6895,'changed':_0x2e5e70,'unchanged':_0x36f816,'toDelete':_0x1e87b2},'journeys':{'new':_0x7436c5,'changed':_0x409e69,'unchanged':_0x2a1035,'toDelete':_0x2ef32e},'activations':{'all':_0x1de56d,'toCreate':_0x1eb38d,'toUpdate':_0x3915a9,'toDelete':_0x49878e},'folders':{'toCreate':_0xf038b3},'counts':{'segments':{'new':_0x5b6895[_0xdda099(0x16e)],'changed':_0x2e5e70['length'],'unchanged':_0x36f816[_0xdda099(0x16e)],'toDelete':_0x1e87b2[_0xdda099(0x16e)]},'journeys':{'new':_0x7436c5[_0xdda099(0x16e)],'changed':_0x409e69[_0xdda099(0x16e)],'unchanged':_0x2a1035[_0xdda099(0x16e)],'toDelete':_0x2ef32e[_0xdda099(0x16e)]},'activations':{'create':_0x1eb38d[_0xdda099(0x16e)],'update':_0x3915a9[_0xdda099(0x16e)],'delete':_0x49878e[_0xdda099(0x16e)]},'folders':_0xf038b3[_0xdda099(0x16e)]},'hasChanges':_0x1fefc4||_0x2196db||_0x219dd0||_0x115f34};}export async function buildPushExecutionContext(_0x20eaf4,_0xada1d8,_0x45843b,_0x413e92,_0x2a0c4f,_0x23a0d2){const _0x512852=a140_0x31484a,_0x19a855=extractRootFolderId(_0x45843b),{pathToId:_0x2f4923,idToPath:_0x2855fe}=buildFolderMaps(_0x2a0c4f),_0x45ff5b=buildSegmentNameToIdMap(_0x413e92),_0x273941=new Map(),{batchAsync:_0x28dc01}=await import(_0x512852(0x229)),[_0x5565e0,_0x5403a0]=await Promise[_0x512852(0x162)]([_0x20eaf4['user'][_0x512852(0x1bf)](),_0x20eaf4['connection'][_0x512852(0x151)](),((async()=>{const _0x64b813=_0x512852;!_0x23a0d2&&_0x413e92[_0x64b813(0x16e)]>0x0&&await _0x28dc01(_0x413e92,async _0x94490=>{const _0x2a6943=_0x64b813,_0xaf5640=await _0x20eaf4[_0x2a6943(0x1fc)][_0x2a6943(0x1f0)](_0xada1d8,_0x94490['id']);_0x273941['set'](_0x94490['id'],_0xaf5640);});})())]),{emailToId:_0x5a47a4,idToEmail:_0x557da0}=_0x5565e0,_0x1e2647=buildConnectionMaps(_0x5403a0);return{'rootFolderId':_0x19a855,'folderPathToId':_0x2f4923,'folderIdToPath':_0x2855fe,'segmentNameToId':_0x45ff5b,'activationsBySegmentId':_0x273941,'emailToIdMap':_0x5a47a4,'idToEmailMap':_0x557da0,'connectionNameToIdMap':_0x1e2647[_0x512852(0x1f5)],'connectionIdToNameMap':_0x1e2647[_0x512852(0x134)],'connectionNameToTypeMap':_0x1e2647[_0x512852(0x19f)]};}export function createPushYamlContextForBundle(_0x5c8c7d,_0x3a5e31,_0x5cff55,_0x5c95de,_0x29f800,_0x107811,_0xb83be0,_0x45a298){const {existingLocalSegmentNames:_0xa0759f,localExpandedRuleToNames:_0x4c52f5}=_0x5c95de,_0x3f45a4=new Set(),_0x49b4cd=new Map(),_0x1689db=new Map(),_0x3d7fec=new Map(),_0x920422=createJumpTargetCache(),_0x1b2461=new Map(),_0x2c9744=new Map(),_0x40a316=new Set();let _0x4e697a;const _0x3e0cfa=_0x51b52d=>{const _0x2f8194={'resolveSegment':async _0x482d20=>{const _0x3205d5=a140_0x3d70,_0x33f4a0=_0x3d7fec[_0x3205d5(0x163)](_0x482d20);if(_0x33f4a0!==undefined)return{'name':_0x33f4a0,'isJourneyLocal':!![]};try{const _0x5dc6f3=await fetchSegment(_0x5c8c7d,_0x3a5e31,_0x482d20,_0x5cff55);if(!_0x5dc6f3)throw new Error(_0x3205d5(0x15c));const _0x5ee9b=generateJourneyLocalName(_0x5dc6f3['name']),_0x13a451=_0x5dc6f3[_0x3205d5(0x1be)]===SEGMENT_KIND_JOURNEY&&_0x5ee9b!==undefined;let _0xdd1109=_0x5dc6f3[_0x3205d5(0x1cd)],_0xa10fd8;if(_0x13a451&&_0x5dc6f3[_0x3205d5(0x14a)]){const _0x3724f9=apiRuleToYaml(_0x5dc6f3[_0x3205d5(0x14a)]);_0x2c9744[_0x3205d5(0x1f9)](_0x482d20,_0x3724f9);const _0x40c934=async _0x4da092=>{const _0x281e53=_0x3205d5,_0x13e82c=collectSegmentRefsFromRule(_0x4da092);for(const _0x2a216e of _0x13e82c){if(!_0x2c9744['has'](_0x2a216e))try{const _0x574b4f=await fetchSegment(_0x5c8c7d,_0x3a5e31,_0x2a216e,_0x5cff55);if(_0x574b4f?.['rule']){const _0x1b6527=apiRuleToYaml(_0x574b4f[_0x281e53(0x14a)]);_0x2c9744[_0x281e53(0x1f9)](_0x2a216e,_0x1b6527),await _0x40c934(_0x1b6527);}}catch(_0x1cd4ff){logger[_0x281e53(0x19a)](_0x281e53(0x192)+_0x2a216e+':\x20'+_0x1cd4ff);}}};await _0x40c934(_0x3724f9);const _0x1f9625=serializeExpandedRule(_0x3724f9,_0x2c9744),_0x33e0a0=_0x4c52f5[_0x3205d5(0x163)](_0x1f9625);if(_0x33e0a0&&_0x33e0a0['length']>0x0){const _0x2bb7f1=_0x49b4cd[_0x3205d5(0x163)](_0x1f9625)||0x0,_0x3ff937=_0x33e0a0[_0x2bb7f1]||_0x33e0a0[_0x33e0a0[_0x3205d5(0x16e)]-0x1];_0x49b4cd[_0x3205d5(0x1f9)](_0x1f9625,_0x2bb7f1+0x1),_0xdd1109=_0x3ff937,_0x3f45a4['add'](_0xdd1109),_0x3d7fec[_0x3205d5(0x1f9)](_0x482d20,_0xdd1109);const _0x2788de=await resolveRuleSegmentRefs(_0x3724f9,async _0x310634=>{const _0x21f2d1=_0x3205d5,_0x50e7b4=_0x3d7fec[_0x21f2d1(0x163)](_0x310634);if(_0x50e7b4)return _0x50e7b4;const _0x1ab403=await _0x4e697a[_0x21f2d1(0x1c1)](_0x310634);return _0x1ab403[_0x21f2d1(0x1cd)];});_0xa10fd8={'description':_0x5dc6f3[_0x3205d5(0x144)],'rule':_0x2788de};}else{const _0x4c2952=_0x1b2461[_0x3205d5(0x163)](_0x1f9625);if(_0x4c2952)_0xdd1109=_0x4c2952,_0x3d7fec[_0x3205d5(0x1f9)](_0x482d20,_0xdd1109);else{if(_0x5ee9b){let _0x589116=_0x5ee9b,_0x406c54=0x2;while(_0x3f45a4[_0x3205d5(0x1f3)](_0x589116)||_0xa0759f[_0x3205d5(0x1f3)](_0x589116)){_0x589116=_0x5ee9b+'_'+_0x406c54,_0x406c54++;}_0x3f45a4[_0x3205d5(0x1de)](_0x589116),_0xdd1109=_0x589116;}_0x3d7fec[_0x3205d5(0x1f9)](_0x482d20,_0xdd1109),_0x1b2461['set'](_0x1f9625,_0xdd1109);const _0x222516=await resolveRuleSegmentRefs(_0x3724f9,async _0x262ccd=>{const _0x24f03d=_0x3205d5,_0x5668cb=_0x3d7fec[_0x24f03d(0x163)](_0x262ccd);if(_0x5668cb)return _0x5668cb;const _0x3aff66=await _0x4e697a[_0x24f03d(0x1c1)](_0x262ccd);return _0x3aff66[_0x24f03d(0x1cd)];});_0xa10fd8={'description':_0x5dc6f3[_0x3205d5(0x144)],'rule':_0x222516};}}}return{'name':_0xdd1109,'isJourneyLocal':_0x13a451,'definition':_0xa10fd8};}catch(_0x4c5e91){return logger['debug'](_0x3205d5(0x1ce)+_0x482d20+':\x20'+_0x4c5e91),{'name':_0x482d20,'isJourneyLocal':![]};}},'resolveActivation':async _0x5c73b1=>{const _0x40f9c4=a140_0x3d70,_0x111604=_0x1689db[_0x40f9c4(0x163)](_0x5c73b1);if(_0x111604!==undefined)return{'name':_0x111604,'isJourneyLocal':!![]};try{let _0x60cf62=_0xb83be0?.[_0x40f9c4(0x163)](_0x5c73b1);!_0x60cf62&&(_0x60cf62=await _0x5c8c7d['journey'][_0x40f9c4(0x1c7)](_0x51b52d,_0x5c73b1));const _0x467b8a=_0x60cf62[_0x40f9c4(0x1ca)][_0x40f9c4(0x18f)][_0x40f9c4(0x1cd)]||_0x5c73b1,_0x365197=sanitizeYamlKey(_0x467b8a)||_0x40f9c4(0x21a)+_0x5c73b1,_0x500905=_0x365197;_0x1689db[_0x40f9c4(0x1f9)](_0x5c73b1,_0x500905);const _0x532e99=journeyActivationStepToYaml(_0x60cf62,_0x29f800,_0x107811);return{'name':_0x500905,'isJourneyLocal':!![],'definition':_0x532e99};}catch(_0xc52db9){return logger[_0x40f9c4(0x19a)](_0x40f9c4(0x1b7)+_0x5c73b1+':\x20'+_0xc52db9),{'name':_0x5c73b1,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x36510e,_0x3c62c5)=>resolveJumpTarget(_0x36510e,_0x3c62c5,_0x920422,async _0x30e80f=>{const _0x4d49f7=a140_0x3d70,_0x1a63ba=_0x45a298?.['get'](_0x30e80f);if(_0x1a63ba)return _0x1a63ba;return _0x5c8c7d[_0x4d49f7(0x1c3)][_0x4d49f7(0x13c)](_0x30e80f);})};return _0x4e697a=_0x2f8194,_0x2f8194;},_0x3bfa78=async _0x480881=>{const _0x13992a=a140_0x3d70,{collectSegmentIdsFromJourneyApi:_0x8891e1}=await import(_0x13992a(0x18a)),{batchAsync:_0x588e1b}=await import(_0x13992a(0x229)),_0x55dbec=new Set();for(const _0x33ee8e of _0x480881){let _0x5a782b=_0x45a298?.['get'](_0x33ee8e);!_0x5a782b&&(_0x5a782b=await _0x5c8c7d['journey']['getJourney'](_0x33ee8e));const _0x34392c=_0x8891e1(_0x5a782b);for(const _0x4ba9ce of _0x34392c){_0x55dbec[_0x13992a(0x1de)](_0x4ba9ce);}}let _0x3b9928=Array[_0x13992a(0x1ab)](_0x55dbec);while(_0x3b9928[_0x13992a(0x16e)]>0x0){const _0x3a9c9f=_0x3b9928[_0x13992a(0x1f4)](_0x453699=>!_0x40a316[_0x13992a(0x1f3)](_0x453699));if(_0x3a9c9f[_0x13992a(0x16e)]===0x0)break;const _0xd7a4f2=await _0x588e1b(_0x3a9c9f,async _0x45e5b8=>{const _0x25acc9=_0x13992a;_0x40a316[_0x25acc9(0x1de)](_0x45e5b8);const _0x1c0d8c=await fetchSegment(_0x5c8c7d,_0x3a5e31,_0x45e5b8,_0x5cff55);if(!_0x1c0d8c)return null;return{'segmentId':_0x45e5b8,'segment':_0x1c0d8c};},0xa),_0x13121a=new Set();for(const _0x1d99bf of _0xd7a4f2){if(!_0x1d99bf?.[_0x13992a(0x1fc)]?.[_0x13992a(0x14a)])continue;const _0x17fb39=apiRuleToYaml(_0x1d99bf[_0x13992a(0x1fc)][_0x13992a(0x14a)]);_0x2c9744[_0x13992a(0x1f9)](_0x1d99bf[_0x13992a(0x1a0)],_0x17fb39);const _0x465a16=collectSegmentRefsFromRule(_0x17fb39);for(const _0x1a34aa of _0x465a16){!_0x40a316['has'](_0x1a34aa)&&_0x13121a[_0x13992a(0x1de)](_0x1a34aa);}}_0x3b9928=Array['from'](_0x13121a);}};return{'createYamlContext':_0x3e0cfa,'prefetchJourneySegments':_0x3bfa78};}export async function executePushSegments(_0x490086,_0x3b51ee,_0x5c654d,_0x2a3461,_0x19aa0d){const _0x22d3ed=a140_0x31484a,{segmentDefToCreateRequest:_0x6332f0,segmentDefToUpdateRequest:_0x536ea0}=await import(_0x22d3ed(0x1a9)),_0x4050db=_0x5c654d[_0x22d3ed(0x225)],_0x3306f3=0x5,_0xb33837=async _0x30c78f=>{const _0x19734b=_0x22d3ed,_0x30d36e=_0x30c78f[_0x19734b(0x18e)]?_0x4050db['get'](_0x30c78f[_0x19734b(0x18e)]):undefined;let _0x473eeb;const _0x5e5966={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x1ec1ce=_0x30c78f[_0x19734b(0x15d)];if(_0x30c78f[_0x19734b(0x15d)][_0x19734b(0x14a)]){const _0x17487c=createSegmentIdResolver(_0x5c654d[_0x19734b(0x191)],_0x30c78f[_0x19734b(0x15d)][_0x19734b(0x1cd)]),_0x4036c1=await resolveRuleSegmentIds(_0x30c78f['yamlConfig'][_0x19734b(0x14a)],_0x17487c);_0x1ec1ce={..._0x30c78f[_0x19734b(0x15d)],'rule':_0x4036c1};}try{if(_0x30c78f[_0x19734b(0x193)]){_0x19aa0d['onProgress']?.({'type':'segment_creating','name':_0x30c78f['yamlConfig'][_0x19734b(0x1cd)]});const _0x2ed5ff=_0x6332f0(_0x1ec1ce,_0x30d36e),_0x3469d2=await _0x19aa0d[_0x19734b(0x135)](_0x19734b(0x190)+_0x30c78f[_0x19734b(0x15d)][_0x19734b(0x1cd)]+_0x19734b(0x157),()=>_0x490086[_0x19734b(0x1fc)][_0x19734b(0x1b3)](_0x2a3461['parentId'],_0x2ed5ff));_0x473eeb=_0x3469d2['data']['id'],_0x5c654d['segmentNameToId'][_0x19734b(0x1f9)](_0x30c78f[_0x19734b(0x15d)][_0x19734b(0x1cd)],_0x473eeb),_0x5e5966[_0x19734b(0x197)]={'name':_0x30c78f[_0x19734b(0x15d)][_0x19734b(0x1cd)],'id':_0x473eeb},_0x19aa0d[_0x19734b(0x201)]?.({'type':_0x19734b(0x145),'name':_0x30c78f[_0x19734b(0x15d)][_0x19734b(0x1cd)],'segmentId':_0x473eeb}),_0x19aa0d['logSuccess']?.(_0x19734b(0x16d)+_0x30c78f[_0x19734b(0x15d)]['name']+'\x27'),_0x5e5966[_0x19734b(0x20d)]=0x1;}else{if(_0x30c78f[_0x19734b(0x21c)]){_0x19aa0d[_0x19734b(0x201)]?.({'type':_0x19734b(0x1f8),'name':_0x30c78f['yamlConfig'][_0x19734b(0x1cd)]});const _0x470e7a=_0x536ea0(_0x1ec1ce);_0x30d36e!==_0x30c78f[_0x19734b(0x1fd)]?.[_0x19734b(0x131)]&&(_0x470e7a[_0x19734b(0x131)]=_0x30d36e?parseInt(_0x30d36e,0xa):undefined),await _0x19aa0d['withProgress'](_0x19734b(0x18c)+_0x30c78f['yamlConfig'][_0x19734b(0x1cd)]+_0x19734b(0x157),()=>_0x490086['segment'][_0x19734b(0x14e)](_0x2a3461[_0x19734b(0x185)],_0x30c78f[_0x19734b(0x1fd)]['id'],_0x470e7a)),_0x473eeb=_0x30c78f[_0x19734b(0x1fd)]['id'],_0x19aa0d[_0x19734b(0x201)]?.({'type':_0x19734b(0x214),'name':_0x30c78f['yamlConfig'][_0x19734b(0x1cd)]}),_0x19aa0d[_0x19734b(0x171)]?.('Updated\x20segment\x20\x27'+_0x30c78f[_0x19734b(0x15d)][_0x19734b(0x1cd)]+'\x27'),_0x5e5966[_0x19734b(0x178)]=0x1;}else _0x473eeb=_0x30c78f[_0x19734b(0x1fd)]['id'];}}catch(_0x272d6e){const _0x449db2=isHttp400Error(_0x272d6e),_0x4a9840=_0x449db2?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x19734b(0x15f)],_0x4cec42=getErrorMessage(_0x272d6e);throw new SDKError(_0x4a9840,_0x19734b(0x177)+(_0x30c78f['isNew']?_0x19734b(0x172):_0x19734b(0x17f))+_0x19734b(0x1ed)+_0x30c78f[_0x19734b(0x1e5)]+_0x19734b(0x202)+_0x4cec42,_0x272d6e);}try{const _0x504d1e=await syncActivationsForSegment(_0x490086,_0x2a3461[_0x19734b(0x185)],_0x473eeb,_0x30c78f[_0x19734b(0x15d)][_0x19734b(0x1cd)],_0x30c78f['activationActions'],_0x19aa0d,_0x30c78f[_0x19734b(0x1e5)]);_0x5e5966['activations']=_0x504d1e;}catch(_0x124181){if(_0x124181 instanceof SDKError)throw _0x124181;throw new SDKError(ErrorCode[_0x19734b(0x130)],_0x19734b(0x195)+_0x30c78f[_0x19734b(0x15d)][_0x19734b(0x1cd)]+'\x27\x20from\x20file:\x20'+_0x30c78f[_0x19734b(0x1e5)]+_0x19734b(0x202)+getErrorMessage(_0x124181),_0x124181);}return _0x5e5966;},_0x11dd58=await batchAsync(_0x3b51ee,_0xb33837,_0x3306f3),_0x5c1328={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3835df of _0x11dd58){_0x5c1328[_0x22d3ed(0x20d)]+=_0x3835df[_0x22d3ed(0x20d)],_0x5c1328['updated']+=_0x3835df[_0x22d3ed(0x178)],_0x3835df[_0x22d3ed(0x197)]&&_0x5c1328[_0x22d3ed(0x129)][_0x22d3ed(0x1f9)](_0x3835df[_0x22d3ed(0x197)]['name'],_0x3835df[_0x22d3ed(0x197)]['id']),_0x5c1328[_0x22d3ed(0x170)][_0x22d3ed(0x20d)]+=_0x3835df[_0x22d3ed(0x170)]['created'],_0x5c1328['activations'][_0x22d3ed(0x178)]+=_0x3835df[_0x22d3ed(0x170)][_0x22d3ed(0x178)],_0x5c1328['activations'][_0x22d3ed(0x1f1)]+=_0x3835df[_0x22d3ed(0x170)][_0x22d3ed(0x1f1)];}return _0x5c1328;}async function syncActivationsForSegment(_0xdac28,_0x4d6e56,_0x5d883d,_0x336a65,_0xc14672,_0x5dad9f,_0x7e7c69){const _0x3bcd2f=a140_0x31484a,_0x467e9d={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1c911f of _0xc14672){try{if(_0x1c911f['type']===_0x3bcd2f(0x172)&&_0x1c911f['validatedRequest'])_0x5dad9f[_0x3bcd2f(0x201)]?.({'type':_0x3bcd2f(0x226),'segmentName':_0x336a65,'activationName':_0x1c911f[_0x3bcd2f(0x1cd)]}),await _0x5dad9f['withProgress'](_0x3bcd2f(0x1dc)+_0x1c911f[_0x3bcd2f(0x1cd)]+'\x27...',()=>_0xdac28['segment'][_0x3bcd2f(0x167)](_0x4d6e56,_0x5d883d,_0x1c911f[_0x3bcd2f(0x1e2)])),_0x5dad9f[_0x3bcd2f(0x201)]?.({'type':_0x3bcd2f(0x148),'segmentName':_0x336a65,'activationName':_0x1c911f[_0x3bcd2f(0x1cd)]}),_0x5dad9f[_0x3bcd2f(0x171)]?.(_0x3bcd2f(0x21d)+_0x1c911f['name']+'\x27'),_0x467e9d[_0x3bcd2f(0x20d)]++;else{if(_0x1c911f['type']==='update'&&_0x1c911f[_0x3bcd2f(0x1e2)]&&_0x1c911f[_0x3bcd2f(0x121)])_0x5dad9f[_0x3bcd2f(0x201)]?.({'type':_0x3bcd2f(0x19e),'segmentName':_0x336a65,'activationName':_0x1c911f[_0x3bcd2f(0x1cd)]}),await _0x5dad9f['withProgress'](_0x3bcd2f(0x1ac)+_0x1c911f[_0x3bcd2f(0x1cd)]+_0x3bcd2f(0x157),()=>_0xdac28[_0x3bcd2f(0x1fc)][_0x3bcd2f(0x154)](_0x4d6e56,_0x5d883d,_0x1c911f['existingActivation']['id'],_0x1c911f[_0x3bcd2f(0x1e2)])),_0x5dad9f['onProgress']?.({'type':_0x3bcd2f(0x19b),'segmentName':_0x336a65,'activationName':_0x1c911f[_0x3bcd2f(0x1cd)]}),_0x5dad9f['logSuccess']?.(_0x3bcd2f(0x11e)+_0x1c911f[_0x3bcd2f(0x1cd)]+'\x27'),_0x467e9d[_0x3bcd2f(0x178)]++;else _0x1c911f[_0x3bcd2f(0x207)]===_0x3bcd2f(0x1d9)&&_0x1c911f[_0x3bcd2f(0x121)]&&(_0x5dad9f[_0x3bcd2f(0x201)]?.({'type':_0x3bcd2f(0x1e9),'segmentName':_0x336a65,'activationName':_0x1c911f[_0x3bcd2f(0x1cd)]}),await _0x5dad9f[_0x3bcd2f(0x135)](_0x3bcd2f(0x143)+_0x1c911f[_0x3bcd2f(0x1cd)]+_0x3bcd2f(0x157),()=>_0xdac28['segment'][_0x3bcd2f(0x1ae)](_0x4d6e56,_0x5d883d,_0x1c911f['existingActivation']['id'])),_0x5dad9f[_0x3bcd2f(0x201)]?.({'type':_0x3bcd2f(0x205),'segmentName':_0x336a65,'activationName':_0x1c911f['name']}),_0x5dad9f[_0x3bcd2f(0x182)]?.(_0x3bcd2f(0x15b)+_0x1c911f[_0x3bcd2f(0x1cd)]+'\x27'),_0x467e9d[_0x3bcd2f(0x1f1)]++);}}catch(_0x305a02){const _0x4467ac=isHttp400Error(_0x305a02),_0x37a656=_0x4467ac?ErrorCode[_0x3bcd2f(0x136)]:ErrorCode[_0x3bcd2f(0x130)],_0x47c4b2=getErrorMessage(_0x305a02);throw new SDKError(_0x37a656,_0x3bcd2f(0x177)+_0x1c911f[_0x3bcd2f(0x207)]+_0x3bcd2f(0x189)+_0x1c911f['name']+'\x27\x20from\x20file:\x20'+_0x7e7c69+_0x3bcd2f(0x202)+_0x47c4b2,_0x305a02);}}return _0x467e9d;}export async function executePushFolders(_0x138aa1,_0x42c689,_0x2607ef,_0x2ac014,_0x2043ca){const _0xdfa461=a140_0x31484a,_0x38043c=new Map(_0x2607ef),_0x12299d=sortFoldersByDepth(_0x42c689);for(const _0x17a4a1 of _0x12299d){const _0x44ba56=_0x17a4a1[_0xdfa461(0x1d7)]('/'),_0x3616b4=_0x44ba56[_0x44ba56[_0xdfa461(0x16e)]-0x1],_0x447a78=_0x44ba56[_0xdfa461(0x1d0)](0x0,-0x1)[_0xdfa461(0x13b)]('/'),_0x216db2=_0x38043c['get'](_0x447a78);_0x2043ca[_0xdfa461(0x201)]?.({'type':_0xdfa461(0x17e),'folder':_0x17a4a1});const _0x245b11={'name':_0x3616b4,'parentFolderId':_0x216db2},_0x475ac5=await _0x2043ca[_0xdfa461(0x135)](_0xdfa461(0x228)+_0x17a4a1+_0xdfa461(0x157),()=>_0x138aa1['segment'][_0xdfa461(0x1a1)](_0x2ac014[_0xdfa461(0x185)],_0x245b11));_0x38043c[_0xdfa461(0x1f9)](_0x17a4a1,_0x475ac5[_0xdfa461(0x1aa)]['id']),_0x2043ca[_0xdfa461(0x201)]?.({'type':_0xdfa461(0x200),'folder':_0x17a4a1,'folderId':_0x475ac5[_0xdfa461(0x1aa)]['id']}),_0x2043ca['logInfo']?.(_0xdfa461(0x126)+_0x17a4a1+'\x27');}return _0x38043c;}export async function executePushSegmentDeletions(_0x18b595,_0x88b0be,_0x11ca4b){const _0x1fbab3=a140_0x31484a;if(_0x88b0be['length']===0x0)return 0x0;const {batchAsync:_0x187488}=await import(_0x1fbab3(0x229)),_0x3503a8=0x5,_0x5b8ee8=await _0x187488(_0x88b0be,async _0x12d1eb=>{const _0x44136c=_0x1fbab3;return _0x11ca4b['onProgress']?.({'type':_0x44136c(0x209),'name':_0x12d1eb[_0x44136c(0x1cd)]}),await _0x18b595[_0x44136c(0x1fc)]['deleteSegment'](_0x12d1eb['id']),_0x11ca4b[_0x44136c(0x201)]?.({'type':_0x44136c(0x1fb),'name':_0x12d1eb[_0x44136c(0x1cd)]}),_0x11ca4b[_0x44136c(0x182)]?.('Deleted\x20segment\x20\x27'+_0x12d1eb['name']+'\x27'),0x1;},_0x3503a8);return _0x5b8ee8['reduce']((_0x3f4e7b,_0x4831ae)=>_0x3f4e7b+_0x4831ae,0x0);}export async function executePushJourneys(_0x2968fa,_0x47140f,_0x280f8e,_0x5f5575,_0x595058){const _0x3442fa=a140_0x31484a,{journeyDefToRequest:_0x1459db}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x4d0035,yamlRuleToApi:_0x8bca79,validateSegmentRule:_0x4e254b}=await import(_0x3442fa(0x1a9)),_0x24817b={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0xcab6a4=new Map(_0x280f8e[_0x3442fa(0x191)]),_0x22d615=0x5;for(let _0x33c516=0x0;_0x33c516<_0x47140f[_0x3442fa(0x16e)];_0x33c516+=_0x22d615){const _0x25a70c=_0x47140f[_0x3442fa(0x1d0)](_0x33c516,_0x33c516+_0x22d615),_0xc57ee9=await Promise[_0x3442fa(0x162)](_0x25a70c[_0x3442fa(0x1ee)](async _0x3e179b=>{const _0x3f76a7=_0x3442fa;if(!_0x3e179b[_0x3f76a7(0x193)]&&!_0x3e179b[_0x3f76a7(0x21c)])return{'action':_0x3f76a7(0x220),'name':_0x3e179b['yamlConfig'][_0x3f76a7(0x1cd)],'journeyId':_0x3e179b[_0x3f76a7(0x223)]?.['id']};const _0x1e6fc6=_0x3e179b['folderPath']?_0x280f8e[_0x3f76a7(0x225)]['get'](_0x3e179b[_0x3f76a7(0x18e)]):undefined;_0x595058[_0x3f76a7(0x201)]?.({'type':_0x3e179b[_0x3f76a7(0x193)]?_0x3f76a7(0x179):_0x3f76a7(0x1ec),'name':_0x3e179b[_0x3f76a7(0x15d)]['name']});try{const _0x295f74=await executeSingleJourneyPush(_0x2968fa,_0x3e179b,{..._0x280f8e,'segmentNameToId':_0xcab6a4},{'parentId':_0x5f5575[_0x3f76a7(0x185)],'rootFolderId':_0x5f5575[_0x3f76a7(0x1ba)],'folderId':_0x1e6fc6,'verbose':_0x5f5575['verbose']},_0x595058,{'journeyDefToRequest':_0x1459db,'activationDefToCreateRequest':_0x4d0035,'yamlRuleToApi':_0x8bca79,'validateSegmentRule':_0x4e254b});for(const [_0x245ce6,_0xd60c87]of _0x295f74[_0x3f76a7(0x14f)]){_0xcab6a4[_0x3f76a7(0x1f9)](_0x245ce6,_0xd60c87),_0x24817b['embeddedSegmentNameToId'][_0x3f76a7(0x1f9)](_0x245ce6,_0xd60c87);}if(_0x295f74['action']===_0x3f76a7(0x20d))_0x595058[_0x3f76a7(0x201)]?.({'type':_0x3f76a7(0x13a),'name':_0x3e179b[_0x3f76a7(0x15d)][_0x3f76a7(0x1cd)],'journeyId':_0x295f74[_0x3f76a7(0x1e3)]}),_0x595058[_0x3f76a7(0x171)]?.(_0x3f76a7(0x146)+_0x3e179b[_0x3f76a7(0x15d)]['name']+'\x27'),_0x24817b['created']++;else _0x295f74['action']==='updated'&&(_0x595058[_0x3f76a7(0x201)]?.({'type':_0x3f76a7(0x1a5),'name':_0x3e179b['yamlConfig'][_0x3f76a7(0x1cd)]}),_0x595058[_0x3f76a7(0x171)]?.(_0x3f76a7(0x194)+_0x3e179b['yamlConfig']['name']+'\x27'),_0x24817b[_0x3f76a7(0x178)]++);return{'action':_0x295f74[_0x3f76a7(0x123)],'name':_0x3e179b[_0x3f76a7(0x15d)]['name'],'journeyId':_0x295f74['journeyId']};}catch(_0x17e3fa){const _0x3b1a00=isHttp400Error(_0x17e3fa),_0x3bc020=_0x3b1a00?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x3f76a7(0x221)],_0x39ac25=getErrorMessage(_0x17e3fa);throw new SDKError(_0x3bc020,_0x3f76a7(0x177)+(_0x3e179b[_0x3f76a7(0x193)]?_0x3f76a7(0x172):_0x3f76a7(0x17f))+_0x3f76a7(0x1f2)+_0x3e179b[_0x3f76a7(0x1e5)]+_0x3f76a7(0x202)+_0x39ac25,_0x17e3fa);}}));_0x24817b[_0x3442fa(0x216)]['push'](..._0xc57ee9);}return _0x24817b;}async function matchExistingJourneySegments(_0x333ed4,_0x14972a,_0x6ddb17,_0x3c2ab1,_0x1cd4f5){const _0x3a6fb7=a140_0x31484a;if(!_0x14972a[_0x3a6fb7(0x223)]||!_0x14972a[_0x3a6fb7(0x15d)]['segments'])return;const _0x45948b=new Map(),_0x5e68a5=new Set();for(const _0x465e8c of Object[_0x3a6fb7(0x1ea)](_0x14972a[_0x3a6fb7(0x15d)][_0x3a6fb7(0x1bd)])){const _0x27389=generateDeterministicJourneySegmentName(_0x14972a['yamlConfig']['name'],_0x465e8c);_0x45948b[_0x3a6fb7(0x1f9)](_0x27389,_0x465e8c),_0x5e68a5[_0x3a6fb7(0x1de)](_0x465e8c);}const _0x439b8d=[],_0xcb2ec5=collectSegmentIdsFromJourneyApi(_0x14972a[_0x3a6fb7(0x223)]);for(const _0x2aac97 of _0xcb2ec5){const _0x20800c=await fetchSegment(_0x333ed4,_0x6ddb17,_0x2aac97,_0x3c2ab1);if(!_0x20800c?.['name'])continue;const _0xcf43df=_0x45948b[_0x3a6fb7(0x163)](_0x20800c[_0x3a6fb7(0x1cd)]);_0xcf43df?(_0x1cd4f5[_0x3a6fb7(0x1f9)](_0xcf43df,_0x2aac97),_0x5e68a5[_0x3a6fb7(0x1d9)](_0xcf43df)):_0x439b8d[_0x3a6fb7(0x122)]({'id':_0x2aac97,'seg':_0x20800c});}if(_0x5e68a5['size']>0x0&&_0x439b8d[_0x3a6fb7(0x16e)]>0x0){const {localExpandedRuleToNames:_0x4170cd}=buildLocalExpandedRuleMappings(_0x14972a[_0x3a6fb7(0x15d)]),_0x2c6d9a=new Map();for(const {id:_0x495a8b,seg:_0x15e4cb}of _0x439b8d){if(_0x15e4cb['rule']){const _0x44ad6a=apiRuleToYaml(_0x15e4cb[_0x3a6fb7(0x14a)]);_0x2c6d9a[_0x3a6fb7(0x1f9)](_0x495a8b,_0x44ad6a);}}for(const {id:_0x29a631,seg:_0x4c0edd}of _0x439b8d){if(!_0x4c0edd['rule'])continue;const _0x4aa7a3=_0x2c6d9a[_0x3a6fb7(0x163)](_0x29a631);if(!_0x4aa7a3)continue;const _0x51d7e5=serializeExpandedRule(_0x4aa7a3,_0x2c6d9a),_0x3e2b5a=_0x4170cd[_0x3a6fb7(0x163)](_0x51d7e5);if(_0x3e2b5a){const _0x5d2cdb=_0x3e2b5a['find'](_0x35e1fc=>_0x5e68a5[_0x3a6fb7(0x1f3)](_0x35e1fc));_0x5d2cdb&&(_0x1cd4f5[_0x3a6fb7(0x1f9)](_0x5d2cdb,_0x29a631),_0x5e68a5[_0x3a6fb7(0x1d9)](_0x5d2cdb),logger[_0x3a6fb7(0x19a)](_0x3a6fb7(0x141)+_0x4c0edd[_0x3a6fb7(0x1cd)]+'\x27\x20to\x20local\x20\x27'+_0x5d2cdb+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x35f3b9,_0x4904bc,_0x3119e9,_0x3ffedb,_0x20f27d,_0xd9c425){const _0x3fbbb0=a140_0x31484a,{journeyDefToRequest:_0x2f3124,activationDefToCreateRequest:_0x116f14,yamlRuleToApi:_0xcdac0,validateSegmentRule:_0x475a7f}=_0xd9c425,_0x15d981=new Map(),_0x142c98=new Map();recoverSegmentIdsFromPushRecovery(_0x4904bc,_0x15d981,_0x3119e9[_0x3fbbb0(0x191)]);const _0x5d25e0=new Map(),_0x9d793=new Map(),_0x468abf=new Map();let _0x41966d;const _0x1d4e1e=async()=>{const _0x5421ec=_0x3fbbb0;if(_0x41966d)return;_0x41966d=new Map();if(!_0x4904bc[_0x5421ec(0x223)])return;const _0x252e18=await _0x35f3b9['journey'][_0x5421ec(0x1f0)](_0x4904bc['existingJourney']['id']);for(const _0xa8d847 of _0x252e18){const _0x2a8599=journeyActivationStepToYaml(_0xa8d847,_0x3119e9[_0x5421ec(0x139)],_0x3119e9[_0x5421ec(0x175)]),_0x3f70ac=activationSignature(_0x2a8599);!_0x41966d[_0x5421ec(0x1f3)](_0x3f70ac)&&_0x41966d[_0x5421ec(0x1f9)](_0x3f70ac,_0xa8d847['id']),_0x2a8599[_0x5421ec(0x1cd)]&&_0x142c98[_0x5421ec(0x1f9)](_0x2a8599[_0x5421ec(0x1cd)],_0xa8d847['id']);}};await matchExistingJourneySegments(_0x35f3b9,_0x4904bc,_0x3ffedb[_0x3fbbb0(0x185)],_0x3119e9[_0x3fbbb0(0x1d8)],_0x3119e9['segmentNameToId']);const _0x38da87={'resolveSegmentId':async _0x1dd019=>{const _0x4d2a41=_0x3fbbb0,_0x33dc80=_0x3119e9[_0x4d2a41(0x191)]['get'](_0x1dd019);if(!_0x33dc80)throw new SDKError(ErrorCode[_0x4d2a41(0x176)],'Segment\x20not\x20found:\x20'+_0x1dd019+'\x20(referenced\x20in\x20journey\x20'+_0x4904bc[_0x4d2a41(0x15d)]['name']+')');return _0x33dc80;},'resolveEmbeddedSegmentId':async(_0x12d4d3,_0xcd8714)=>{const _0x119de0=_0x3fbbb0,_0x2caffb=_0x3119e9[_0x119de0(0x191)][_0x119de0(0x163)](_0x12d4d3);if(_0x2caffb)return _0x2caffb;const _0x37a680=_0x3119e9[_0x119de0(0x1d8)][_0x119de0(0x137)](_0x583c75=>_0x583c75[_0x119de0(0x1cd)]===_0x12d4d3);if(_0x37a680)return _0x3119e9[_0x119de0(0x191)][_0x119de0(0x1f9)](_0x12d4d3,_0x37a680['id']),_0x37a680['id'];if(_0x4904bc[_0x119de0(0x193)]){const {stageName:_0x5edc18,criteriaName:_0x44433c}=findSegmentCriteriaLocation(_0x4904bc['yamlConfig'],_0x12d4d3);return _0x475a7f(_0x12d4d3,_0xcd8714[_0x119de0(0x14a)]),_0x9d793[_0x119de0(0x1f9)](_0x12d4d3,{'definition':_0xcd8714,'stageName':_0x5edc18,'criteriaName':_0x44433c}),createPendingSegmentId(_0x12d4d3);}const _0x3c99cf=_0x4904bc[_0x119de0(0x223)]?.['id'];if(!_0x3c99cf)throw new SDKError(ErrorCode['INTERNAL'],_0x119de0(0x224));const _0x1351f1=_0x5d25e0[_0x119de0(0x163)](_0x12d4d3);if(_0x1351f1)return _0x1351f1;const _0x4d7563=((async()=>{const _0x3fe512=_0x119de0;_0x475a7f(_0x12d4d3,_0xcd8714[_0x3fe512(0x14a)]);const _0x188a3a=generateDeterministicJourneySegmentName(_0x4904bc[_0x3fe512(0x15d)]['name'],_0x12d4d3),_0x43f3ea=_0x3119e9[_0x3fe512(0x1d8)][_0x3fe512(0x137)](_0x3738a8=>_0x3738a8[_0x3fe512(0x1cd)]===_0x188a3a),_0x20e354=createSegmentIdResolver(_0x3119e9[_0x3fe512(0x191)],_0x12d4d3),_0x3f5447=await resolveRuleSegmentIds(_0xcd8714['rule'],_0x20e354);let _0x156fd6;return _0x43f3ea?(await _0x35f3b9[_0x3fe512(0x1fc)]['updateSegmentById'](_0x3ffedb['parentId'],_0x43f3ea['id'],{'description':_0xcd8714[_0x3fe512(0x144)]||_0x3fe512(0x14c)+_0x12d4d3,'rule':_0xcdac0(_0x3f5447,!![]),'countPopulation':!![]}),_0x156fd6=_0x43f3ea['id'],saveSegmentToPushRecovery(_0x4904bc[_0x3fe512(0x1e5)],_0x4904bc['yamlConfig']['name'],_0x12d4d3,{'segmentId':_0x156fd6,'uniqueServerName':_0x188a3a,'createdAt':new Date()[_0x3fe512(0x1fa)]()})):_0x156fd6=await createOrRecoverEmbeddedSegment(_0x35f3b9,_0x4904bc,{'localName':_0x12d4d3,'uniqueSegmentName':_0x188a3a,'description':_0xcd8714[_0x3fe512(0x144)]||_0x3fe512(0x14c)+_0x12d4d3,'journeyId':_0x3c99cf,'resolvedRule':_0x3f5447,'parentId':_0x3ffedb[_0x3fe512(0x185)],'folderId':_0x3ffedb[_0x3fe512(0x1ba)]||''},_0xcdac0),_0x3119e9[_0x3fe512(0x191)][_0x3fe512(0x1f9)](_0x12d4d3,_0x156fd6),_0x15d981[_0x3fe512(0x1f9)](_0x12d4d3,_0x156fd6),_0x156fd6;})());_0x5d25e0['set'](_0x12d4d3,_0x4d7563);try{return await _0x4d7563;}finally{_0x5d25e0[_0x119de0(0x1d9)](_0x12d4d3);}},'resolveActivationId':async _0x1adce5=>{const _0xf062ec=_0x3fbbb0,_0x1796e9=_0x142c98[_0xf062ec(0x163)](_0x1adce5);if(_0x1796e9)return _0x1796e9;if(_0x4904bc[_0xf062ec(0x223)]){await _0x1d4e1e();const _0x1279cf=_0x142c98[_0xf062ec(0x163)](_0x1adce5);if(_0x1279cf)return _0x1279cf;}throw new SDKError(ErrorCode['NOT_FOUND'],_0xf062ec(0x1cc)+_0x1adce5+_0xf062ec(0x1b1)+_0x4904bc[_0xf062ec(0x15d)][_0xf062ec(0x1cd)]+_0xf062ec(0x165)+_0xf062ec(0x12c));},'resolveEmbeddedActivationId':async(_0x337f74,_0x588d85)=>{const _0x24ffa2=_0x3fbbb0,_0x4b6101=_0x142c98[_0x24ffa2(0x163)](_0x337f74);if(_0x4b6101)return _0x4b6101;if(_0x4904bc['isNew'])return _0x468abf['set'](_0x337f74,_0x588d85),createPendingActivationId(_0x337f74);if(_0x4904bc[_0x24ffa2(0x223)]){await _0x1d4e1e();const _0x1f178b=_0x142c98['get'](_0x588d85[_0x24ffa2(0x1cd)]);if(_0x1f178b)return _0x142c98['set'](_0x337f74,_0x1f178b),_0x1f178b;const _0x3a9560=activationSignature(_0x588d85),_0x437e58=_0x41966d?.[_0x24ffa2(0x163)](_0x3a9560);if(_0x437e58)return _0x142c98[_0x24ffa2(0x1f9)](_0x337f74,_0x437e58),_0x437e58;const _0x3d5f75=await _0x116f14(_0x588d85,_0x3119e9[_0x24ffa2(0x217)]),_0x510b08={..._0x3d5f75,..._0x588d85['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x588d85[_0x24ffa2(0x1d5)]}},_0x553682=await _0x35f3b9[_0x24ffa2(0x1c3)]['createActivation'](_0x4904bc['existingJourney']['id'],_0x510b08);return _0x142c98[_0x24ffa2(0x1f9)](_0x337f74,_0x553682['id']),_0x553682['id'];}throw new SDKError(ErrorCode[_0x24ffa2(0x18d)],_0x24ffa2(0x14b));},'resolveJourneyId':async _0x51a3d4=>{const _0xe15a11=_0x3fbbb0;try{return await _0x35f3b9[_0xe15a11(0x1c3)][_0xe15a11(0x1db)](_0x3ffedb[_0xe15a11(0x185)],_0x51a3d4);}catch(_0x2519eb){throw new SDKError(ErrorCode[_0xe15a11(0x188)],_0xe15a11(0x20c)+_0x51a3d4+_0xe15a11(0x1fe)+_0x4904bc[_0xe15a11(0x15d)][_0xe15a11(0x1cd)]+'\x27)',_0x2519eb);}},'resolveStageId':async(_0x546d82,_0x503af7)=>{const _0x5e6cca=_0x3fbbb0,_0x29a8db=await _0x35f3b9['journey'][_0x5e6cca(0x13c)](_0x546d82),_0x235cf9=_0x29a8db[_0x5e6cca(0x1ca)]['journeyStages'][_0x5e6cca(0x137)](_0x35cdcc=>_0x35cdcc[_0x5e6cca(0x1cd)][_0x5e6cca(0x215)]()===_0x503af7[_0x5e6cca(0x215)]());if(!_0x235cf9?.['id'])throw new SDKError(ErrorCode[_0x5e6cca(0x188)],'Stage\x20\x27'+_0x503af7+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x29a8db[_0x5e6cca(0x1ca)][_0x5e6cca(0x1b6)]||_0x29a8db[_0x5e6cca(0x1ca)][_0x5e6cca(0x1cd)])+'\x27');return _0x235cf9['id'];}},_0x54edde=await _0x2f3124(_0x4904bc['yamlConfig'],_0x3ffedb[_0x3fbbb0(0x185)],_0x38da87),_0x42cb53=_0x3ffedb[_0x3fbbb0(0x1a2)]||_0x3ffedb['rootFolderId'];_0x42cb53&&(_0x54edde[_0x3fbbb0(0x20e)]={'parentFolder':{'data':{'id':_0x42cb53,'type':_0x3fbbb0(0x133)}}});if(_0x4904bc[_0x3fbbb0(0x193)]){if(_0x9d793['size']>0x0||_0x468abf[_0x3fbbb0(0x17a)]>0x0)return await executeThreeStepJourneyCreate(_0x35f3b9,_0x4904bc,_0x54edde,{'pendingEmbeddedSegments':_0x9d793,'pendingEmbeddedActivations':_0x468abf,'embeddedSegmentNameToId':_0x15d981,'journeyActivationNameToId':_0x142c98},{..._0x3ffedb,'effectiveFolderId':_0x42cb53},_0x3119e9,_0x20f27d,_0xd9c425);else{ensureJourneyDefaults(_0x54edde[_0x3fbbb0(0x1ca)]);const _0x17ea5e=await _0x35f3b9[_0x3fbbb0(0x1c3)][_0x3fbbb0(0x172)](_0x54edde);return deletePushRecovery(_0x4904bc[_0x3fbbb0(0x1e5)]),{'action':'created','journeyId':_0x17ea5e['id'],'embeddedSegmentNameToId':_0x15d981};}}else{if(_0x4904bc['hasChanges']&&_0x4904bc[_0x3fbbb0(0x223)]){_0x54edde['id']=_0x4904bc[_0x3fbbb0(0x223)]['id'];const _0x1f4a64=_0x54edde[_0x3fbbb0(0x1ca)];_0x4904bc['existingJourney']['attributes']?.[_0x3fbbb0(0x1b6)]&&(_0x1f4a64['journeyBundleName']=_0x4904bc[_0x3fbbb0(0x223)][_0x3fbbb0(0x1ca)][_0x3fbbb0(0x1b6)]);const _0x5afe15=_0x4904bc[_0x3fbbb0(0x223)][_0x3fbbb0(0x1ca)]?.[_0x3fbbb0(0x15e)];return _0x5afe15&&_0x54edde[_0x3fbbb0(0x1ca)][_0x3fbbb0(0x15e)]&&injectExistingStageIds(_0x54edde[_0x3fbbb0(0x1ca)][_0x3fbbb0(0x15e)],_0x5afe15),ensureJourneyDefaults(_0x1f4a64),await _0x35f3b9[_0x3fbbb0(0x1c3)][_0x3fbbb0(0x17f)](_0x4904bc[_0x3fbbb0(0x223)]['id'],_0x54edde),deletePushRecovery(_0x4904bc[_0x3fbbb0(0x1e5)]),{'action':_0x3fbbb0(0x178),'journeyId':_0x4904bc[_0x3fbbb0(0x223)]['id'],'embeddedSegmentNameToId':_0x15d981};}}return deletePushRecovery(_0x4904bc[_0x3fbbb0(0x1e5)]),{'action':_0x3fbbb0(0x220),'journeyId':_0x4904bc['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x15d981};}function findSegmentCriteriaLocation(_0x530f98,_0x55070a){const _0x478d27=a140_0x31484a,_0xb88508=_0x530f98['stages']||_0x530f98[_0x478d27(0x12f)]?.[0x0]?.[_0x478d27(0x1a4)]||[];let _0x181145=_0x478d27(0x1e7),_0x2e9e0b=_0x55070a;const _0x4167af=_0x530f98[_0x478d27(0x13d)]||_0x530f98[_0x478d27(0x12f)]?.[0x0]?.[_0x478d27(0x13d)];if(_0x4167af?.[_0x478d27(0x1fc)]===_0x55070a)return{'stageName':_0x478d27(0x13d),'criteriaName':_0x4167af[_0x478d27(0x1cd)]||_0x55070a};_0x1a1a67:for(const _0x584a36 of _0xb88508){if(_0x584a36[_0x478d27(0x127)]?.[_0x478d27(0x1fc)]===_0x55070a){_0x181145=_0x584a36[_0x478d27(0x1cd)],_0x2e9e0b=_0x584a36['entry_criteria'][_0x478d27(0x1cd)]||_0x55070a;break;}if(_0x584a36['steps'])for(const _0x1d17a5 of _0x584a36[_0x478d27(0x1c4)]){if(_0x1d17a5[_0x478d27(0x207)]==='decision_point'&&_0x1d17a5[_0x478d27(0x140)]?.[_0x478d27(0x183)])for(const _0x43a873 of _0x1d17a5[_0x478d27(0x140)][_0x478d27(0x183)]){if(_0x43a873[_0x478d27(0x1fc)]===_0x55070a){_0x181145=_0x584a36[_0x478d27(0x1cd)],_0x2e9e0b=_0x43a873[_0x478d27(0x1cd)]||_0x55070a;break _0x1a1a67;}}}}return{'stageName':_0x181145,'criteriaName':_0x2e9e0b};}async function executeThreeStepJourneyCreate(_0x224e2c,_0x41400b,_0x43eb56,_0x3cfd5a,_0x407acc,_0x3813d2,_0x5b39c1,_0x39ce6c){const _0x7adbb2=a140_0x31484a,{activationDefToCreateRequest:_0x257608,yamlRuleToApi:_0x5e17d9}=_0x39ce6c,{pendingEmbeddedSegments:_0x1251a3,pendingEmbeddedActivations:_0x32d6e5,embeddedSegmentNameToId:_0x169491}=_0x3cfd5a,_0xb43e1d=JSON[_0x7adbb2(0x166)](JSON[_0x7adbb2(0x12b)](_0x43eb56));ensureJourneyDefaults(_0xb43e1d[_0x7adbb2(0x1ca)]),stripPendingIds(_0xb43e1d);const _0x1dc618=await _0x224e2c[_0x7adbb2(0x1c3)][_0x7adbb2(0x172)](_0xb43e1d),_0x51c845=_0x1dc618['id'],_0x903bf8=new Map();for(const _0x211a8a of _0x1dc618[_0x7adbb2(0x1ca)][_0x7adbb2(0x15e)]){_0x903bf8[_0x7adbb2(0x1f9)](_0x211a8a[_0x7adbb2(0x1cd)][_0x7adbb2(0x215)](),_0x211a8a['id']);}recoverSegmentIdsFromPushRecovery(_0x41400b,_0x169491,_0x3813d2[_0x7adbb2(0x191)]);for(const [_0x1cbfce,{definition:_0xbed3c2}]of _0x1251a3){if(_0x169491[_0x7adbb2(0x1f3)](_0x1cbfce)){_0x5b39c1[_0x7adbb2(0x201)]?.({'type':_0x7adbb2(0x1c8),'journeyName':_0x41400b['yamlConfig'][_0x7adbb2(0x1cd)],'segmentName':_0x1cbfce});continue;}const _0xd54db6=generateDeterministicJourneySegmentName(_0x41400b[_0x7adbb2(0x15d)][_0x7adbb2(0x1cd)],_0x1cbfce);_0x5b39c1[_0x7adbb2(0x201)]?.({'type':_0x7adbb2(0x1e4),'journeyName':_0x41400b[_0x7adbb2(0x15d)][_0x7adbb2(0x1cd)],'segmentName':_0x1cbfce});const _0x5eb7f7=createSegmentIdResolver(_0x3813d2[_0x7adbb2(0x191)],_0x1cbfce),_0x52d130=await resolveRuleSegmentIds(_0xbed3c2[_0x7adbb2(0x14a)],_0x5eb7f7),_0xc3ca4b=await createOrRecoverEmbeddedSegment(_0x224e2c,_0x41400b,{'localName':_0x1cbfce,'uniqueSegmentName':_0xd54db6,'description':_0xbed3c2['description']||_0x7adbb2(0x14c)+_0x1cbfce,'journeyId':_0x51c845,'resolvedRule':_0x52d130,'parentId':_0x407acc[_0x7adbb2(0x185)],'folderId':_0x407acc[_0x7adbb2(0x169)]||''},_0x5e17d9);_0x169491[_0x7adbb2(0x1f9)](_0x1cbfce,_0xc3ca4b),_0x3813d2['segmentNameToId'][_0x7adbb2(0x1f9)](_0x1cbfce,_0xc3ca4b),_0x5b39c1[_0x7adbb2(0x201)]?.({'type':_0x7adbb2(0x1c8),'journeyName':_0x41400b[_0x7adbb2(0x15d)]['name'],'segmentName':_0x1cbfce});}const _0x20f349=new Map();for(const [_0xbebbfd,_0x5a27bb]of _0x32d6e5){_0x5b39c1[_0x7adbb2(0x201)]?.({'type':_0x7adbb2(0x124),'journeyName':_0x41400b[_0x7adbb2(0x15d)]['name'],'activationName':_0xbebbfd});const _0x2ca8bc=await _0x257608(_0x5a27bb,_0x3813d2[_0x7adbb2(0x217)]),_0x4cb876={..._0x2ca8bc,..._0x5a27bb[_0x7adbb2(0x1d5)]!==undefined&&{'runAfterJourneyRefresh':_0x5a27bb[_0x7adbb2(0x1d5)]}},_0x48387e=await _0x224e2c[_0x7adbb2(0x1c3)][_0x7adbb2(0x167)](_0x51c845,_0x4cb876);_0x20f349[_0x7adbb2(0x1f9)](_0xbebbfd,_0x48387e['id']),_0x3cfd5a[_0x7adbb2(0x1a7)]['set'](_0xbebbfd,_0x48387e['id']),_0x5b39c1[_0x7adbb2(0x201)]?.({'type':'embedded_activation_created','journeyName':_0x41400b[_0x7adbb2(0x15d)][_0x7adbb2(0x1cd)],'activationName':_0xbebbfd});}const _0x86034c=JSON['parse'](JSON[_0x7adbb2(0x12b)](_0x43eb56));return _0x86034c['id']=_0x51c845,ensureJourneyDefaults(_0x86034c[_0x7adbb2(0x1ca)]),resolvePendingIdsInRequest(_0x86034c,_0x43eb56,_0x903bf8,_0x169491,_0x20f349,_0x5b39c1),await _0x224e2c['journey'][_0x7adbb2(0x17f)](_0x51c845,_0x86034c),deletePushRecovery(_0x41400b['absolutePath']),{'action':_0x7adbb2(0x20d),'journeyId':_0x51c845,'embeddedSegmentNameToId':_0x169491};}export function stripWaitStepPendingIds(_0x1d6e33){const _0x92856e=a140_0x31484a,_0x184fa9=_0x1d6e33['conditionSegmentId']&&isPendingSegmentId(_0x1d6e33['conditionSegmentId']),_0x3e41ff=_0x1d6e33['conditions']?.[_0x92856e(0x1e0)](_0x5b4ba9=>_0x5b4ba9[_0x92856e(0x1a0)]&&isPendingSegmentId(_0x5b4ba9[_0x92856e(0x1a0)]));(_0x184fa9||_0x3e41ff)&&(_0x1d6e33[_0x92856e(0x1b8)]=_0x92856e(0x1ff),_0x1d6e33['waitStep']=0x1,_0x1d6e33[_0x92856e(0x1e8)]=_0x92856e(0x1a8),delete _0x1d6e33[_0x92856e(0x16f)],delete _0x1d6e33[_0x92856e(0x161)],delete _0x1d6e33['conditionTimeoutUnit'],delete _0x1d6e33[_0x92856e(0x158)]);}export function resolveWaitStepPendingIds(_0x19edd6,_0x691c31,_0x296f46,_0x55932f){const _0xac5b25=a140_0x31484a;if(_0x691c31[_0xac5b25(0x16f)]&&isPendingSegmentId(_0x691c31[_0xac5b25(0x16f)])){const _0xc34a07=_0x296f46(_0x691c31[_0xac5b25(0x16f)],'stage\x20\x27'+_0x55932f+_0xac5b25(0x212));_0xc34a07&&(_0x19edd6[_0xac5b25(0x1b8)]='Condition',_0x19edd6['conditionSegmentId']=_0xc34a07,delete _0x19edd6['waitStep'],delete _0x19edd6[_0xac5b25(0x1e8)],_0x691c31[_0xac5b25(0x161)]!==undefined&&(_0x19edd6[_0xac5b25(0x161)]=_0x691c31['conditionTimeoutDuration']),_0x691c31['conditionTimeoutUnit']&&(_0x19edd6[_0xac5b25(0x21e)]=_0x691c31[_0xac5b25(0x21e)]));}if(_0x691c31['conditions']){const _0x25d161=_0x691c31[_0xac5b25(0x158)][_0xac5b25(0x1e0)](_0x47890b=>_0x47890b[_0xac5b25(0x1a0)]&&isPendingSegmentId(_0x47890b[_0xac5b25(0x1a0)]));if(_0x25d161){const _0x1fe383=_0x691c31['conditions'][_0xac5b25(0x1ee)](_0xd2255b=>{const _0x47ec30=_0xac5b25;if(_0xd2255b[_0x47ec30(0x1a0)]&&isPendingSegmentId(_0xd2255b['segmentId'])){const _0x139af4=_0x296f46(_0xd2255b[_0x47ec30(0x1a0)],_0x47ec30(0x213)+_0x55932f+'\x27\x20wait\x20condition');return{..._0xd2255b,'segmentId':_0x139af4||_0xd2255b['segmentId']};}return{..._0xd2255b};});_0x19edd6[_0xac5b25(0x1b8)]=_0xac5b25(0x120),_0x19edd6[_0xac5b25(0x158)]=_0x1fe383,delete _0x19edd6['waitStep'],delete _0x19edd6[_0xac5b25(0x1e8)],delete _0x19edd6[_0xac5b25(0x16f)],delete _0x19edd6[_0xac5b25(0x161)],delete _0x19edd6['conditionTimeoutUnit'];}}}function stripPendingIds(_0x37a097){const _0x58d0b9=a140_0x31484a;_0x37a097[_0x58d0b9(0x1ca)][_0x58d0b9(0x13d)]?.[_0x58d0b9(0x1a0)]&&isPendingSegmentId(_0x37a097[_0x58d0b9(0x1ca)][_0x58d0b9(0x13d)][_0x58d0b9(0x1a0)])&&delete _0x37a097['attributes'][_0x58d0b9(0x13d)];for(const _0x568b0e of _0x37a097['attributes'][_0x58d0b9(0x15e)]||[]){_0x568b0e[_0x58d0b9(0x22a)]?.[_0x58d0b9(0x1a0)]&&isPendingSegmentId(_0x568b0e[_0x58d0b9(0x22a)][_0x58d0b9(0x1a0)])&&delete _0x568b0e[_0x58d0b9(0x22a)];_0x568b0e[_0x58d0b9(0x1bb)]?.[_0x58d0b9(0x1a0)]&&isPendingSegmentId(_0x568b0e[_0x58d0b9(0x1bb)][_0x58d0b9(0x1a0)])&&delete _0x568b0e[_0x58d0b9(0x1bb)];_0x568b0e[_0x58d0b9(0x1b5)]&&(_0x568b0e[_0x58d0b9(0x1b5)]=_0x568b0e['exitCriterias'][_0x58d0b9(0x1f4)](_0x5b5c27=>!_0x5b5c27[_0x58d0b9(0x1a0)]||!isPendingSegmentId(_0x5b5c27[_0x58d0b9(0x1a0)])));if(_0x568b0e[_0x58d0b9(0x1c4)])for(const _0x301085 of Object[_0x58d0b9(0x1ea)](_0x568b0e[_0x58d0b9(0x1c4)])){const _0x4a67a6=_0x568b0e[_0x58d0b9(0x1c4)][_0x301085];_0x4a67a6['type']===_0x58d0b9(0x186)&&_0x4a67a6['journeyActivationStepId']&&isPendingActivationId(_0x4a67a6[_0x58d0b9(0x1af)])&&(_0x4a67a6[_0x58d0b9(0x1af)]='');if(_0x4a67a6[_0x58d0b9(0x207)]===_0x58d0b9(0x204)&&_0x4a67a6[_0x58d0b9(0x183)])for(const _0x1f23c8 of _0x4a67a6[_0x58d0b9(0x183)]){_0x1f23c8[_0x58d0b9(0x1a0)]&&isPendingSegmentId(_0x1f23c8[_0x58d0b9(0x1a0)])&&(_0x1f23c8[_0x58d0b9(0x1a0)]='');}_0x4a67a6['type']==='WaitStep'&&stripWaitStepPendingIds(_0x4a67a6);}}}function resolvePendingIdsInRequest(_0x40c124,_0x29ba98,_0x24bc24,_0x3a939a,_0x3a62ef,_0x205f3e){const _0x1fd28c=a140_0x31484a,_0x34f6ec=(_0x21ea8b,_0x195490)=>{const _0x47d027=a140_0x3d70;if(!isPendingSegmentId(_0x21ea8b))return _0x21ea8b;const _0x33ffb0=extractPendingSegmentName(_0x21ea8b),_0x56c984=_0x3a939a['get'](_0x33ffb0);return!_0x56c984&&_0x205f3e[_0x47d027(0x203)]?.(_0x47d027(0x150)+_0x33ffb0+'\x27\x20for\x20'+_0x195490),_0x56c984;};if(_0x40c124[_0x1fd28c(0x1ca)][_0x1fd28c(0x13d)]?.[_0x1fd28c(0x1a0)]&&isPendingSegmentId(_0x40c124[_0x1fd28c(0x1ca)][_0x1fd28c(0x13d)][_0x1fd28c(0x1a0)])){const _0x37b91f=_0x34f6ec(_0x40c124[_0x1fd28c(0x1ca)]['goal']['segmentId'],_0x1fd28c(0x12e));_0x37b91f&&(_0x40c124[_0x1fd28c(0x1ca)][_0x1fd28c(0x13d)]['segmentId']=_0x37b91f);}for(const _0x29f737 of _0x40c124[_0x1fd28c(0x1ca)][_0x1fd28c(0x15e)]||[]){const _0x4ade72=_0x24bc24['get'](_0x29f737['name'][_0x1fd28c(0x215)]());_0x4ade72&&(_0x29f737['id']=_0x4ade72);if(_0x29f737[_0x1fd28c(0x22a)]?.[_0x1fd28c(0x1a0)]&&isPendingSegmentId(_0x29f737[_0x1fd28c(0x22a)][_0x1fd28c(0x1a0)])){const _0x31b37e=_0x34f6ec(_0x29f737['entryCriteria'][_0x1fd28c(0x1a0)],_0x1fd28c(0x213)+_0x29f737['name']+_0x1fd28c(0x1d6));_0x31b37e&&(_0x29f737[_0x1fd28c(0x22a)][_0x1fd28c(0x1a0)]=_0x31b37e);}if(_0x29f737['exitCriterias'])for(const _0x2c668b of _0x29f737[_0x1fd28c(0x1b5)]){if(_0x2c668b[_0x1fd28c(0x1a0)]&&isPendingSegmentId(_0x2c668b[_0x1fd28c(0x1a0)])){const _0x2ae694=_0x34f6ec(_0x2c668b['segmentId'],_0x1fd28c(0x213)+_0x29f737[_0x1fd28c(0x1cd)]+_0x1fd28c(0x160));_0x2ae694&&(_0x2c668b['segmentId']=_0x2ae694);}}if(_0x29f737[_0x1fd28c(0x1bb)]?.[_0x1fd28c(0x1a0)]&&isPendingSegmentId(_0x29f737[_0x1fd28c(0x1bb)]['segmentId'])){const _0xe2e8e6=_0x34f6ec(_0x29f737[_0x1fd28c(0x1bb)]['segmentId'],_0x1fd28c(0x213)+_0x29f737[_0x1fd28c(0x1cd)]+_0x1fd28c(0x19c));_0xe2e8e6&&(_0x29f737[_0x1fd28c(0x1bb)][_0x1fd28c(0x1a0)]=_0xe2e8e6);}if(_0x29f737[_0x1fd28c(0x1c4)]){const _0x81565b=_0x2a52d2=>_0x29ba98[_0x1fd28c(0x1ca)][_0x1fd28c(0x15e)]?.[_0x1fd28c(0x137)](_0x129868=>_0x129868[_0x1fd28c(0x1cd)][_0x1fd28c(0x215)]()===_0x29f737[_0x1fd28c(0x1cd)][_0x1fd28c(0x215)]())?.['steps']?.[_0x2a52d2];for(const _0x2dd87e of Object[_0x1fd28c(0x1ea)](_0x29f737[_0x1fd28c(0x1c4)])){const _0xeae0b=_0x29f737['steps'][_0x2dd87e],_0x4f97ab=_0x81565b(_0x2dd87e);if(_0xeae0b[_0x1fd28c(0x207)]===_0x1fd28c(0x186)&&_0xeae0b[_0x1fd28c(0x1af)]&&(isPendingActivationId(_0xeae0b[_0x1fd28c(0x1af)])||_0xeae0b[_0x1fd28c(0x1af)]==='')){if(_0x4f97ab?.[_0x1fd28c(0x1af)]&&isPendingActivationId(_0x4f97ab[_0x1fd28c(0x1af)])){const _0x41b5dc=extractPendingActivationName(_0x4f97ab[_0x1fd28c(0x1af)]),_0xf77233=_0x3a62ef[_0x1fd28c(0x163)](_0x41b5dc);_0xf77233&&(_0xeae0b[_0x1fd28c(0x1af)]=_0xf77233);}}if(_0xeae0b['type']==='DecisionPoint'&&_0xeae0b[_0x1fd28c(0x183)]&&_0x4f97ab?.['branches'])for(let _0x5b02e2=0x0;_0x5b02e2<_0xeae0b[_0x1fd28c(0x183)]['length'];_0x5b02e2++){const _0x7690b=_0xeae0b[_0x1fd28c(0x183)][_0x5b02e2],_0x3d0420=_0x4f97ab[_0x1fd28c(0x183)][_0x5b02e2];if(_0x3d0420?.[_0x1fd28c(0x1a0)]&&isPendingSegmentId(_0x3d0420[_0x1fd28c(0x1a0)])){const _0x4abf7c=_0x34f6ec(_0x3d0420['segmentId'],_0x1fd28c(0x213)+_0x29f737[_0x1fd28c(0x1cd)]+_0x1fd28c(0x1f7)+(_0x7690b[_0x1fd28c(0x1cd)]||_0x5b02e2)+'\x27');_0x4abf7c&&(_0x7690b[_0x1fd28c(0x1a0)]=_0x4abf7c);}}_0xeae0b[_0x1fd28c(0x207)]===_0x1fd28c(0x1d4)&&_0x4f97ab?.['type']===_0x1fd28c(0x1d4)&&resolveWaitStepPendingIds(_0xeae0b,_0x4f97ab,_0x34f6ec,_0x29f737[_0x1fd28c(0x1cd)]);}}}}
@@ -1 +1 @@
1
- (function(_0xa121f0,_0x5dfd03){const _0xc7ee7d=a141_0x2f40,_0x4f6df2=_0xa121f0();while(!![]){try{const _0x5189f4=-parseInt(_0xc7ee7d(0xd2))/0x1*(parseInt(_0xc7ee7d(0xd7))/0x2)+parseInt(_0xc7ee7d(0xd4))/0x3*(-parseInt(_0xc7ee7d(0xce))/0x4)+parseInt(_0xc7ee7d(0xda))/0x5+-parseInt(_0xc7ee7d(0xd0))/0x6+-parseInt(_0xc7ee7d(0xd1))/0x7*(parseInt(_0xc7ee7d(0xd8))/0x8)+-parseInt(_0xc7ee7d(0xd6))/0x9*(parseInt(_0xc7ee7d(0xdc))/0xa)+parseInt(_0xc7ee7d(0xcd))/0xb;if(_0x5189f4===_0x5dfd03)break;else _0x4f6df2['push'](_0x4f6df2['shift']());}catch(_0x1e931e){_0x4f6df2['push'](_0x4f6df2['shift']());}}}(a141_0x4960,0x7613f));export function buildFolderIdToPathMap(_0x4e7481){const _0x14058e=a141_0x2f40,_0x38a855=new Map(),_0x5a4cb7=new Map();for(const _0x2d0b85 of _0x4e7481){_0x5a4cb7[_0x14058e(0xdb)](_0x2d0b85['id'],_0x2d0b85);}const _0x5087a2=new Set();for(const _0x368e35 of _0x4e7481){!_0x368e35[_0x14058e(0xd9)]&&_0x5087a2[_0x14058e(0xcc)](_0x368e35['id']);}function _0x10673a(_0x221ced){const _0x261567=_0x14058e;if(_0x38a855[_0x261567(0xd3)](_0x221ced['id']))return _0x38a855['get'](_0x221ced['id']);if(_0x5087a2[_0x261567(0xd3)](_0x221ced['id']))return _0x38a855[_0x261567(0xdb)](_0x221ced['id'],''),'';if(_0x221ced[_0x261567(0xd9)]){const _0x469faf=_0x5a4cb7['get'](_0x221ced['parentFolderId']);if(_0x469faf){const _0x158c07=_0x10673a(_0x469faf),_0x30b5dc=_0x158c07?_0x158c07+'/'+_0x221ced[_0x261567(0xd5)]:_0x221ced[_0x261567(0xd5)];return _0x38a855[_0x261567(0xdb)](_0x221ced['id'],_0x30b5dc),_0x30b5dc;}}const _0x447042=_0x221ced[_0x261567(0xd5)];return _0x38a855[_0x261567(0xdb)](_0x221ced['id'],_0x447042),_0x447042;}for(const _0x305b10 of _0x4e7481){_0x10673a(_0x305b10);}return _0x38a855;}export function buildFolderPathToIdMap(_0x238b66){const _0xa7d0d8=a141_0x2f40,_0x323307=new Map(),_0x26156d=new Map();for(const _0x9077e of _0x238b66){_0x26156d[_0xa7d0d8(0xdb)](_0x9077e['id'],_0x9077e);}const _0x47da3b=new Set();for(const _0xdeeac6 of _0x238b66){!_0xdeeac6[_0xa7d0d8(0xd9)]&&_0x47da3b['add'](_0xdeeac6['id']);}function _0x5d31b4(_0x1c156b){const _0x1e24f1=_0xa7d0d8;if(_0x47da3b['has'](_0x1c156b['id']))return'';if(_0x1c156b[_0x1e24f1(0xd9)]){const _0x29f103=_0x26156d['get'](_0x1c156b[_0x1e24f1(0xd9)]);if(_0x29f103){const _0x48f6b5=_0x5d31b4(_0x29f103);return _0x48f6b5?_0x48f6b5+'/'+_0x1c156b[_0x1e24f1(0xd5)]:_0x1c156b[_0x1e24f1(0xd5)];}}return _0x1c156b[_0x1e24f1(0xd5)];}for(const _0x15ed44 of _0x238b66){const _0x5d11a6=_0x5d31b4(_0x15ed44);_0x323307['set'](_0x5d11a6,_0x15ed44['id']);}return _0x323307;}function a141_0x2f40(_0x139372,_0x37a776){_0x139372=_0x139372-0xcc;const _0x496025=a141_0x4960();let _0x2f40f2=_0x496025[_0x139372];return _0x2f40f2;}export function buildFolderMaps(_0x993516){const _0x25c795=a141_0x2f40,_0x3e5ca2=buildFolderIdToPathMap(_0x993516),_0x4cd6f1=new Map();for(const [_0x44c578,_0x15ed0e]of _0x3e5ca2){_0x4cd6f1[_0x25c795(0xdb)](_0x15ed0e,_0x44c578);}return{'idToPath':_0x3e5ca2,'pathToId':_0x4cd6f1};}export function getFolderPath(_0x1d8a1d,_0x462b45){const _0x25ddb1=a141_0x2f40;if(!_0x1d8a1d)return'';return _0x462b45[_0x25ddb1(0xcf)](_0x1d8a1d)??'';}function a141_0x4960(){const _0x3c4f69=['3647960JzzMse','set','4870gXeCfm','add','28212492rtXULM','922788iCmLLn','get','2624898cGKyCP','29771XlaFMc','1699JjlWxJ','has','6HjQNgN','name','17118SRSECF','254eHRGVz','1448WniNge','parentFolderId'];a141_0x4960=function(){return _0x3c4f69;};return a141_0x4960();}
1
+ (function(_0x31ce95,_0x450b2d){const _0x182a46=a141_0x19c6,_0x23373e=_0x31ce95();while(!![]){try{const _0x288ce3=-parseInt(_0x182a46(0x7d))/0x1*(parseInt(_0x182a46(0x7c))/0x2)+parseInt(_0x182a46(0x79))/0x3*(-parseInt(_0x182a46(0x85))/0x4)+parseInt(_0x182a46(0x83))/0x5+-parseInt(_0x182a46(0x82))/0x6*(-parseInt(_0x182a46(0x89))/0x7)+-parseInt(_0x182a46(0x81))/0x8+-parseInt(_0x182a46(0x7a))/0x9*(-parseInt(_0x182a46(0x87))/0xa)+parseInt(_0x182a46(0x80))/0xb;if(_0x288ce3===_0x450b2d)break;else _0x23373e['push'](_0x23373e['shift']());}catch(_0x1142d7){_0x23373e['push'](_0x23373e['shift']());}}}(a141_0x32c1,0x3a346));function a141_0x32c1(){const _0x9c19d0=['1904504EtTePA','12SKnueS','60440ZtutST','parentFolderId','232244cpKuTS','set','8710JJHero','get','1399776UuucaX','12moBcoe','3303icGIHY','has','1022YbkcrF','574UpBnZj','name','add','2973806wmpiON'];a141_0x32c1=function(){return _0x9c19d0;};return a141_0x32c1();}function a141_0x19c6(_0x2cc4af,_0x53f235){_0x2cc4af=_0x2cc4af-0x79;const _0x32c1a5=a141_0x32c1();let _0x19c6f6=_0x32c1a5[_0x2cc4af];return _0x19c6f6;}export function buildFolderIdToPathMap(_0x5ad717){const _0x35ec10=a141_0x19c6,_0xd8305f=new Map(),_0x26f0de=new Map();for(const _0x19483d of _0x5ad717){_0x26f0de[_0x35ec10(0x86)](_0x19483d['id'],_0x19483d);}const _0x406bd2=new Set();for(const _0x17f4c4 of _0x5ad717){!_0x17f4c4['parentFolderId']&&_0x406bd2[_0x35ec10(0x7f)](_0x17f4c4['id']);}function _0x4e7c00(_0x2fe199){const _0x54a03e=_0x35ec10;if(_0xd8305f[_0x54a03e(0x7b)](_0x2fe199['id']))return _0xd8305f[_0x54a03e(0x88)](_0x2fe199['id']);if(_0x406bd2[_0x54a03e(0x7b)](_0x2fe199['id']))return _0xd8305f[_0x54a03e(0x86)](_0x2fe199['id'],''),'';if(_0x2fe199[_0x54a03e(0x84)]){const _0x5a71e0=_0x26f0de[_0x54a03e(0x88)](_0x2fe199['parentFolderId']);if(_0x5a71e0){const _0x257cb5=_0x4e7c00(_0x5a71e0),_0xf8ae84=_0x257cb5?_0x257cb5+'/'+_0x2fe199[_0x54a03e(0x7e)]:_0x2fe199[_0x54a03e(0x7e)];return _0xd8305f['set'](_0x2fe199['id'],_0xf8ae84),_0xf8ae84;}}const _0x4a68af=_0x2fe199[_0x54a03e(0x7e)];return _0xd8305f[_0x54a03e(0x86)](_0x2fe199['id'],_0x4a68af),_0x4a68af;}for(const _0x3519c5 of _0x5ad717){_0x4e7c00(_0x3519c5);}return _0xd8305f;}export function buildFolderPathToIdMap(_0x1cec4d){const _0x47c13e=a141_0x19c6,_0xd89b8=new Map(),_0x58764d=new Map();for(const _0x1a6ca6 of _0x1cec4d){_0x58764d[_0x47c13e(0x86)](_0x1a6ca6['id'],_0x1a6ca6);}const _0x3a64be=new Set();for(const _0x5fb291 of _0x1cec4d){!_0x5fb291[_0x47c13e(0x84)]&&_0x3a64be[_0x47c13e(0x7f)](_0x5fb291['id']);}function _0x1e4d7c(_0x25ab11){const _0x287c46=_0x47c13e;if(_0x3a64be[_0x287c46(0x7b)](_0x25ab11['id']))return'';if(_0x25ab11[_0x287c46(0x84)]){const _0x231d6b=_0x58764d['get'](_0x25ab11[_0x287c46(0x84)]);if(_0x231d6b){const _0x1f7bb5=_0x1e4d7c(_0x231d6b);return _0x1f7bb5?_0x1f7bb5+'/'+_0x25ab11[_0x287c46(0x7e)]:_0x25ab11[_0x287c46(0x7e)];}}return _0x25ab11[_0x287c46(0x7e)];}for(const _0xb45e73 of _0x1cec4d){const _0x4033f3=_0x1e4d7c(_0xb45e73);_0xd89b8['set'](_0x4033f3,_0xb45e73['id']);}return _0xd89b8;}export function buildFolderMaps(_0x586e19){const _0x59f68a=a141_0x19c6,_0x14442c=buildFolderIdToPathMap(_0x586e19),_0x45d055=new Map();for(const [_0x17d95b,_0x114869]of _0x14442c){_0x45d055[_0x59f68a(0x86)](_0x114869,_0x17d95b);}return{'idToPath':_0x14442c,'pathToId':_0x45d055};}export function getFolderPath(_0x39bb63,_0x179fff){const _0x4f6f11=a141_0x19c6;if(!_0x39bb63)return'';return _0x179fff[_0x4f6f11(0x88)](_0x39bb63)??'';}
@@ -1 +1 @@
1
- (function(_0x22fd64,_0xd05e54){const _0x38506c=a142_0x1808,_0x31e788=_0x22fd64();while(!![]){try{const _0x101b23=-parseInt(_0x38506c(0x19e))/0x1*(parseInt(_0x38506c(0x19a))/0x2)+parseInt(_0x38506c(0x198))/0x3+-parseInt(_0x38506c(0x1b1))/0x4*(parseInt(_0x38506c(0x1c1))/0x5)+parseInt(_0x38506c(0x192))/0x6+parseInt(_0x38506c(0x1b8))/0x7+parseInt(_0x38506c(0x1b7))/0x8+parseInt(_0x38506c(0x19c))/0x9*(-parseInt(_0x38506c(0x191))/0xa);if(_0x101b23===_0xd05e54)break;else _0x31e788['push'](_0x31e788['shift']());}catch(_0x33891a){_0x31e788['push'](_0x31e788['shift']());}}}(a142_0x22b5,0x18750));import a142_0x337b63 from'path';import{parse as a142_0x3280b8}from'yaml';function a142_0x1808(_0x65d2f1,_0x148815){_0x65d2f1=_0x65d2f1-0x18f;const _0x22b50b=a142_0x22b5();let _0x180866=_0x22b50b[_0x65d2f1];return _0x180866;}function a142_0x22b5(){const _0x108eee=['Cannot\x20split\x20empty\x20path','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','4gCcqYl','slice','name','relative','parent_segment','.yaml','1441416iWAEJt','876001PQGNZY','isAbsolute','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Path\x20segment\x20cannot\x20be\x20empty','pop','No\x20tdx.json\x20found\x20for\x20file:\x20','journey','exists','type','888715VKjpOS','Cannot\x20navigate\x20above\x20root','trim','length','3370pOgawh','468354Zgayyt','filter','Relative\x20path\x20cannot\x20be\x20empty','Path\x20attempts\x20to\x20navigate\x20above\x20root','endsWith','.yml','532806ISFbqY','parse','1726xRNtNH','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','6822LWCCGd','segments','32rmJNxC','substring','segment','root','startsWith','replace','dirname','test','split','Path\x20cannot\x20be\x20empty','raw','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','readFile','push','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','join','resolve'];a142_0x22b5=function(){return _0x108eee;};return a142_0x22b5();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x17477c){const _0x180a31=a142_0x1808;if(!_0x17477c||_0x17477c[_0x180a31(0x18f)]()==='')throw new Error(_0x180a31(0x1a7));const _0x39e5db=_0x17477c[_0x180a31(0x18f)]();if(_0x39e5db==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x17477c};const _0x496f0f=_0x39e5db[_0x180a31(0x1a2)]('/')?_0x39e5db[_0x180a31(0x19f)](0x1):_0x39e5db,_0x2896e0=_0x496f0f[_0x180a31(0x1a6)]('/')[_0x180a31(0x193)](_0x334cf6=>_0x334cf6!=='');if(_0x2896e0[_0x180a31(0x190)]===0x0)throw new Error(_0x180a31(0x1b0));const _0x267e98=_0x39e5db[_0x180a31(0x1a2)]('/')||!isRelativePathSegment(_0x2896e0[0x0]);for(const _0xf49390 of _0x2896e0){validatePathSegment(_0xf49390);}return{'segments':_0x2896e0,'isAbsolute':_0x267e98,'raw':_0x17477c};}function isRelativePathSegment(_0x4f62ad){return _0x4f62ad==='.'||_0x4f62ad==='..';}function validatePathSegment(_0x1ba178){const _0x4f0817=a142_0x1808;if(_0x1ba178==='')throw new Error(_0x4f0817(0x1bb));if(_0x1ba178==='.'||_0x1ba178==='..')return;if(/[\x00-\x1F\x7F]/[_0x4f0817(0x1a5)](_0x1ba178))throw new Error(_0x4f0817(0x1a9)+_0x1ba178);if(_0x1ba178!==_0x1ba178[_0x4f0817(0x18f)]()){}}export function validatePath(_0x5298e1){const _0x3ed34b=a142_0x1808;if(_0x5298e1[_0x3ed34b(0x19d)][_0x3ed34b(0x190)]===0x0&&!_0x5298e1[_0x3ed34b(0x1b9)])throw new Error(_0x3ed34b(0x194));if(_0x5298e1[_0x3ed34b(0x1b9)]){if(_0x5298e1['segments'][0x0]==='..')throw new Error(_0x3ed34b(0x1ba));let _0x302a01=0x0;for(const _0x56f7c4 of _0x5298e1[_0x3ed34b(0x19d)]){if(_0x56f7c4==='..'){if(_0x302a01===0x0)throw new Error(_0x3ed34b(0x195));_0x302a01--;}else _0x56f7c4!=='.'&&_0x302a01++;}}}export function joinPaths(_0x486dce,_0x3163c4){const _0x413fb3=a142_0x1808;if(!_0x486dce||_0x486dce==='/')return _0x3163c4;if(!_0x3163c4||_0x3163c4==='.')return _0x486dce;if(_0x3163c4['startsWith']('/'))return _0x3163c4;const _0x2fae59=parsePath(_0x486dce),_0x1c079c=parsePath(_0x3163c4),_0x3a2bc1=[..._0x2fae59[_0x413fb3(0x19d)]];for(const _0x417611 of _0x1c079c[_0x413fb3(0x19d)]){if(_0x417611==='.')continue;else{if(_0x417611==='..'){if(_0x3a2bc1[_0x413fb3(0x190)]===0x0)throw new Error(_0x413fb3(0x1c2));_0x3a2bc1[_0x413fb3(0x1bc)]();}else _0x3a2bc1[_0x413fb3(0x1ab)](_0x417611);}}const _0x54d538=_0x3a2bc1[_0x413fb3(0x1ad)]('/');return _0x2fae59[_0x413fb3(0x1a8)][_0x413fb3(0x1a2)]('/')?'/'+_0x54d538:_0x54d538;}export function normalizePath(_0x31802d){const _0x469dd9=a142_0x1808,_0x240043=parsePath(_0x31802d),_0x2d86b2=[];for(const _0x471ea7 of _0x240043[_0x469dd9(0x19d)]){if(_0x471ea7==='.')continue;else{if(_0x471ea7==='..'){if(_0x2d86b2['length']===0x0){if(_0x240043['isAbsolute'])throw new Error(_0x469dd9(0x1c2));_0x2d86b2[_0x469dd9(0x1ab)]('..');}else _0x2d86b2[_0x2d86b2[_0x469dd9(0x190)]-0x1]==='..'?_0x2d86b2[_0x469dd9(0x1ab)]('..'):_0x2d86b2[_0x469dd9(0x1bc)]();}else _0x2d86b2[_0x469dd9(0x1ab)](_0x471ea7);}}if(_0x2d86b2[_0x469dd9(0x190)]===0x0)return _0x240043[_0x469dd9(0x1b9)]?'/':'.';const _0x23be90=_0x2d86b2['join']('/');return _0x240043['raw']['startsWith']('/')?'/'+_0x23be90:_0x23be90;}export function getParentPath(_0x11e61a){const _0x3f7ae=a142_0x1808,_0x373ead=parsePath(_0x11e61a);if(_0x373ead['segments'][_0x3f7ae(0x190)]<=0x1)return'/';const _0x451b9f=_0x373ead[_0x3f7ae(0x19d)]['slice'](0x0,-0x1)[_0x3f7ae(0x1ad)]('/');return _0x373ead[_0x3f7ae(0x1a8)]['startsWith']('/')?'/'+_0x451b9f:_0x451b9f;}export function getBaseName(_0x425a12){const _0x1cb479=a142_0x1808,_0x14d305=parsePath(_0x425a12);return _0x14d305[_0x1cb479(0x19d)][_0x14d305['segments'][_0x1cb479(0x190)]-0x1]||'';}export function isChildPath(_0x390db7,_0x5b38ea){const _0x378262=a142_0x1808,_0x252690=parsePath(_0x390db7),_0x39b6bf=parsePath(_0x5b38ea);if(_0x252690[_0x378262(0x19d)][_0x378262(0x190)]<=_0x39b6bf[_0x378262(0x19d)][_0x378262(0x190)])return![];for(let _0x43e4ed=0x0;_0x43e4ed<_0x39b6bf[_0x378262(0x19d)][_0x378262(0x190)];_0x43e4ed++){if(_0x252690[_0x378262(0x19d)][_0x43e4ed]!==_0x39b6bf[_0x378262(0x19d)][_0x43e4ed])return![];}return!![];}export function splitPath(_0x131afc){const _0x9e6c4e=a142_0x1808,_0x35df23=parsePath(_0x131afc);if(_0x35df23[_0x9e6c4e(0x19d)][_0x9e6c4e(0x190)]===0x0)throw new Error(_0x9e6c4e(0x1af));if(_0x35df23[_0x9e6c4e(0x19d)][_0x9e6c4e(0x190)]===0x1)return{'parent':_0x35df23[_0x9e6c4e(0x19d)][0x0]};return{'parent':_0x35df23[_0x9e6c4e(0x19d)][0x0],'child':_0x35df23[_0x9e6c4e(0x19d)][_0x9e6c4e(0x1b2)](0x1)[_0x9e6c4e(0x1ad)]('/')};}export function isYamlFilePath(_0x267788){const _0x58a566=a142_0x1808;return _0x267788[_0x58a566(0x196)](_0x58a566(0x197))||_0x267788[_0x58a566(0x196)](_0x58a566(0x1b6));}export async function resolveYamlFilePath(_0x19538c,_0x59c889=nodeFileSystem){const _0x1f80b4=a142_0x1808,_0x2dec04=a142_0x337b63[_0x1f80b4(0x1ae)](_0x19538c);if(!await _0x59c889[_0x1f80b4(0x1bf)](_0x2dec04))throw new Error('File\x20not\x20found:\x20'+_0x19538c);let _0x2952db=a142_0x337b63[_0x1f80b4(0x1a4)](_0x2dec04),_0x487574=null,_0x40fcdf=null;const _0x49f4c6=a142_0x337b63[_0x1f80b4(0x199)](_0x2952db)[_0x1f80b4(0x1a1)];while(_0x2952db!==_0x49f4c6){const _0x23ad63=a142_0x337b63[_0x1f80b4(0x1ad)](_0x2952db,'tdx.json');if(await _0x59c889[_0x1f80b4(0x1bf)](_0x23ad63)){_0x487574=_0x23ad63,_0x40fcdf=_0x2952db;break;}_0x2952db=a142_0x337b63[_0x1f80b4(0x1a4)](_0x2952db);}if(!_0x487574||!_0x40fcdf)throw new Error(_0x1f80b4(0x1bd)+_0x19538c+'\x0a'+_0x1f80b4(0x1ac));const _0x3e5732=await _0x59c889[_0x1f80b4(0x1aa)](_0x487574),_0x25891e=JSON[_0x1f80b4(0x199)](_0x3e5732),_0x182feb=_0x25891e[_0x1f80b4(0x1b5)];if(!_0x182feb)throw new Error(_0x1f80b4(0x19b));const _0x8a4308=await _0x59c889[_0x1f80b4(0x1aa)](_0x2dec04),_0x4ea419=a142_0x3280b8(_0x8a4308),_0x44b992=_0x4ea419[_0x1f80b4(0x1b3)];if(!_0x44b992)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x19538c);const _0x53b23b=_0x4ea419[_0x1f80b4(0x1c0)]==='journey'?_0x1f80b4(0x1be):_0x1f80b4(0x1a0),_0x2dde04=a142_0x337b63[_0x1f80b4(0x1b4)](_0x40fcdf,_0x2dec04),_0x5cec1a=a142_0x337b63[_0x1f80b4(0x1a4)](_0x2dde04),_0x5d53c7=_0x5cec1a==='.'?'':_0x5cec1a[_0x1f80b4(0x1a3)](/\\/g,'/'),_0x2d1db5=_0x5d53c7?_0x182feb+'/'+_0x5d53c7+'/'+_0x44b992:_0x182feb+'/'+_0x44b992;return{'parentSegment':_0x182feb,'segmentName':_0x44b992,'folderPath':_0x5d53c7,'fullPath':_0x2d1db5,'resourceType':_0x53b23b,'content':_0x8a4308};}
1
+ (function(_0x55c70d,_0x1a5aba){const _0x1e3503=a142_0x581e,_0x19b447=_0x55c70d();while(!![]){try{const _0x44afa0=parseInt(_0x1e3503(0x158))/0x1+parseInt(_0x1e3503(0x16f))/0x2*(-parseInt(_0x1e3503(0x156))/0x3)+-parseInt(_0x1e3503(0x14b))/0x4+parseInt(_0x1e3503(0x170))/0x5+-parseInt(_0x1e3503(0x14c))/0x6*(parseInt(_0x1e3503(0x16c))/0x7)+parseInt(_0x1e3503(0x15b))/0x8*(-parseInt(_0x1e3503(0x14e))/0x9)+parseInt(_0x1e3503(0x166))/0xa;if(_0x44afa0===_0x1a5aba)break;else _0x19b447['push'](_0x19b447['shift']());}catch(_0x5556c0){_0x19b447['push'](_0x19b447['shift']());}}}(a142_0x133f,0xa9bcb));import a142_0x57a055 from'path';import{parse as a142_0x2b28f4}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x42f306){const _0x52dfac=a142_0x581e;if(!_0x42f306||_0x42f306[_0x52dfac(0x14a)]()==='')throw new Error(_0x52dfac(0x175));const _0x3606eb=_0x42f306[_0x52dfac(0x14a)]();if(_0x3606eb==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x42f306};const _0x5a10f0=_0x3606eb[_0x52dfac(0x147)]('/')?_0x3606eb[_0x52dfac(0x174)](0x1):_0x3606eb,_0x11bf61=_0x5a10f0[_0x52dfac(0x15f)]('/')[_0x52dfac(0x157)](_0x55c2f4=>_0x55c2f4!=='');if(_0x11bf61[_0x52dfac(0x154)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x493d33=_0x3606eb['startsWith']('/')||!isRelativePathSegment(_0x11bf61[0x0]);for(const _0x508124 of _0x11bf61){validatePathSegment(_0x508124);}return{'segments':_0x11bf61,'isAbsolute':_0x493d33,'raw':_0x42f306};}function isRelativePathSegment(_0x5e5125){return _0x5e5125==='.'||_0x5e5125==='..';}function a142_0x581e(_0x451a25,_0x5c8360){_0x451a25=_0x451a25-0x145;const _0x133fa5=a142_0x133f();let _0x581e3d=_0x133fa5[_0x451a25];return _0x581e3d;}function validatePathSegment(_0x3f9744){const _0x1b2890=a142_0x581e;if(_0x3f9744==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x3f9744==='.'||_0x3f9744==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x3f9744))throw new Error(_0x1b2890(0x164)+_0x3f9744);if(_0x3f9744!==_0x3f9744['trim']()){}}export function validatePath(_0x433a02){const _0x12435d=a142_0x581e;if(_0x433a02[_0x12435d(0x145)][_0x12435d(0x154)]===0x0&&!_0x433a02[_0x12435d(0x14d)])throw new Error(_0x12435d(0x152));if(_0x433a02[_0x12435d(0x14d)]){if(_0x433a02[_0x12435d(0x145)][0x0]==='..')throw new Error(_0x12435d(0x15d));let _0x5efb03=0x0;for(const _0x41a863 of _0x433a02['segments']){if(_0x41a863==='..'){if(_0x5efb03===0x0)throw new Error(_0x12435d(0x153));_0x5efb03--;}else _0x41a863!=='.'&&_0x5efb03++;}}}export function joinPaths(_0x1c65b5,_0xe91866){const _0x5e639e=a142_0x581e;if(!_0x1c65b5||_0x1c65b5==='/')return _0xe91866;if(!_0xe91866||_0xe91866==='.')return _0x1c65b5;if(_0xe91866['startsWith']('/'))return _0xe91866;const _0x7cb736=parsePath(_0x1c65b5),_0x2e8fe2=parsePath(_0xe91866),_0x52d12e=[..._0x7cb736[_0x5e639e(0x145)]];for(const _0x2d2b0b of _0x2e8fe2[_0x5e639e(0x145)]){if(_0x2d2b0b==='.')continue;else{if(_0x2d2b0b==='..'){if(_0x52d12e[_0x5e639e(0x154)]===0x0)throw new Error(_0x5e639e(0x15c));_0x52d12e[_0x5e639e(0x171)]();}else _0x52d12e[_0x5e639e(0x16b)](_0x2d2b0b);}}const _0x245a70=_0x52d12e[_0x5e639e(0x151)]('/');return _0x7cb736[_0x5e639e(0x162)][_0x5e639e(0x147)]('/')?'/'+_0x245a70:_0x245a70;}export function normalizePath(_0x156fca){const _0x50aa7a=a142_0x581e,_0x15cfa6=parsePath(_0x156fca),_0x48a439=[];for(const _0x299e49 of _0x15cfa6['segments']){if(_0x299e49==='.')continue;else{if(_0x299e49==='..'){if(_0x48a439[_0x50aa7a(0x154)]===0x0){if(_0x15cfa6[_0x50aa7a(0x14d)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x48a439[_0x50aa7a(0x16b)]('..');}else _0x48a439[_0x48a439[_0x50aa7a(0x154)]-0x1]==='..'?_0x48a439[_0x50aa7a(0x16b)]('..'):_0x48a439[_0x50aa7a(0x171)]();}else _0x48a439[_0x50aa7a(0x16b)](_0x299e49);}}if(_0x48a439['length']===0x0)return _0x15cfa6[_0x50aa7a(0x14d)]?'/':'.';const _0x38095d=_0x48a439[_0x50aa7a(0x151)]('/');return _0x15cfa6[_0x50aa7a(0x162)]['startsWith']('/')?'/'+_0x38095d:_0x38095d;}export function getParentPath(_0x4d404d){const _0x532548=a142_0x581e,_0x184562=parsePath(_0x4d404d);if(_0x184562[_0x532548(0x145)]['length']<=0x1)return'/';const _0x5aae63=_0x184562[_0x532548(0x145)][_0x532548(0x160)](0x0,-0x1)[_0x532548(0x151)]('/');return _0x184562[_0x532548(0x162)][_0x532548(0x147)]('/')?'/'+_0x5aae63:_0x5aae63;}export function getBaseName(_0xbe5892){const _0x15c957=a142_0x581e,_0x4d4b42=parsePath(_0xbe5892);return _0x4d4b42['segments'][_0x4d4b42[_0x15c957(0x145)]['length']-0x1]||'';}export function isChildPath(_0x1ea870,_0x5c57e7){const _0x488881=a142_0x581e,_0x2f9c02=parsePath(_0x1ea870),_0x1596b0=parsePath(_0x5c57e7);if(_0x2f9c02['segments']['length']<=_0x1596b0[_0x488881(0x145)][_0x488881(0x154)])return![];for(let _0x5ac8b6=0x0;_0x5ac8b6<_0x1596b0[_0x488881(0x145)]['length'];_0x5ac8b6++){if(_0x2f9c02['segments'][_0x5ac8b6]!==_0x1596b0[_0x488881(0x145)][_0x5ac8b6])return![];}return!![];}function a142_0x133f(){const _0x39c7ec=['dirname','push','2256233sOkQhn','readFile','name','92AmQZMX','5981900DQRokW','pop','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','segment','substring','Path\x20cannot\x20be\x20empty','segments','parse','startsWith','journey','No\x20tdx.json\x20found\x20for\x20file:\x20','trim','1670588FEeBwu','6XRqaGi','isAbsolute','4365qVvzVU','relative','root','join','Relative\x20path\x20cannot\x20be\x20empty','Path\x20attempts\x20to\x20navigate\x20above\x20root','length','Cannot\x20split\x20empty\x20path','36327wlbzPY','filter','597873YFpvZr','replace','parent_segment','18976bMXWyZ','Cannot\x20navigate\x20above\x20root','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','resolve','split','slice','exists','raw','tdx.json','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','endsWith','13483900kiPuny','File\x20not\x20found:\x20','.yaml','.yml'];a142_0x133f=function(){return _0x39c7ec;};return a142_0x133f();}export function splitPath(_0x5bba64){const _0x234324=a142_0x581e,_0x5d72c8=parsePath(_0x5bba64);if(_0x5d72c8[_0x234324(0x145)][_0x234324(0x154)]===0x0)throw new Error(_0x234324(0x155));if(_0x5d72c8['segments']['length']===0x1)return{'parent':_0x5d72c8[_0x234324(0x145)][0x0]};return{'parent':_0x5d72c8['segments'][0x0],'child':_0x5d72c8[_0x234324(0x145)]['slice'](0x1)[_0x234324(0x151)]('/')};}export function isYamlFilePath(_0x4397e6){const _0x2ec8ff=a142_0x581e;return _0x4397e6[_0x2ec8ff(0x165)](_0x2ec8ff(0x169))||_0x4397e6['endsWith'](_0x2ec8ff(0x168));}export async function resolveYamlFilePath(_0xdff65c,_0x1cd87a=nodeFileSystem){const _0x57f0ee=a142_0x581e,_0x1b4518=a142_0x57a055[_0x57f0ee(0x15e)](_0xdff65c);if(!await _0x1cd87a[_0x57f0ee(0x161)](_0x1b4518))throw new Error(_0x57f0ee(0x167)+_0xdff65c);let _0x510bbd=a142_0x57a055[_0x57f0ee(0x16a)](_0x1b4518),_0x1da5cb=null,_0x23b287=null;const _0xc5a34a=a142_0x57a055[_0x57f0ee(0x146)](_0x510bbd)[_0x57f0ee(0x150)];while(_0x510bbd!==_0xc5a34a){const _0x4000f1=a142_0x57a055[_0x57f0ee(0x151)](_0x510bbd,_0x57f0ee(0x163));if(await _0x1cd87a['exists'](_0x4000f1)){_0x1da5cb=_0x4000f1,_0x23b287=_0x510bbd;break;}_0x510bbd=a142_0x57a055[_0x57f0ee(0x16a)](_0x510bbd);}if(!_0x1da5cb||!_0x23b287)throw new Error(_0x57f0ee(0x149)+_0xdff65c+'\x0a'+_0x57f0ee(0x172));const _0x3305a5=await _0x1cd87a[_0x57f0ee(0x16d)](_0x1da5cb),_0xc82e3b=JSON[_0x57f0ee(0x146)](_0x3305a5),_0x1b86ff=_0xc82e3b[_0x57f0ee(0x15a)];if(!_0x1b86ff)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x542098=await _0x1cd87a[_0x57f0ee(0x16d)](_0x1b4518),_0x5d356f=a142_0x2b28f4(_0x542098),_0x1426e7=_0x5d356f[_0x57f0ee(0x16e)];if(!_0x1426e7)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0xdff65c);const _0x56c58b=_0x5d356f['type']==='journey'?_0x57f0ee(0x148):_0x57f0ee(0x173),_0x5c9d4d=a142_0x57a055[_0x57f0ee(0x14f)](_0x23b287,_0x1b4518),_0x16afb5=a142_0x57a055[_0x57f0ee(0x16a)](_0x5c9d4d),_0x3f07d1=_0x16afb5==='.'?'':_0x16afb5[_0x57f0ee(0x159)](/\\/g,'/'),_0x45d6f9=_0x3f07d1?_0x1b86ff+'/'+_0x3f07d1+'/'+_0x1426e7:_0x1b86ff+'/'+_0x1426e7;return{'parentSegment':_0x1b86ff,'segmentName':_0x1426e7,'folderPath':_0x3f07d1,'fullPath':_0x45d6f9,'resourceType':_0x56c58b,'content':_0x542098};}
@@ -1 +1 @@
1
- (function(_0x158f85,_0x21858a){const _0x406cda=a143_0x41ec,_0x2d060b=_0x158f85();while(!![]){try{const _0x219f6d=-parseInt(_0x406cda(0x91))/0x1*(parseInt(_0x406cda(0x90))/0x2)+-parseInt(_0x406cda(0x87))/0x3*(-parseInt(_0x406cda(0x8e))/0x4)+parseInt(_0x406cda(0x86))/0x5+-parseInt(_0x406cda(0x83))/0x6*(-parseInt(_0x406cda(0x85))/0x7)+-parseInt(_0x406cda(0x89))/0x8*(parseInt(_0x406cda(0x8a))/0x9)+-parseInt(_0x406cda(0x8b))/0xa+-parseInt(_0x406cda(0x88))/0xb;if(_0x219f6d===_0x21858a)break;else _0x2d060b['push'](_0x2d060b['shift']());}catch(_0x274006){_0x2d060b['push'](_0x2d060b['shift']());}}}(a143_0x4570,0xf3805));export function parseSegmentRef(_0x1a3865){const _0x372dd0=a143_0x41ec,_0x598a63=_0x1a3865[_0x372dd0(0x84)]('/');if(_0x598a63===-0x1)return{'parentId':_0x1a3865};if(_0x598a63===0x0)throw new Error(_0x372dd0(0x8d)+_0x1a3865+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x33ec34=_0x1a3865[_0x372dd0(0x8c)](0x0,_0x598a63),_0x478d32=_0x1a3865[_0x372dd0(0x8c)](_0x598a63+0x1);if(_0x478d32==='')throw new Error(_0x372dd0(0x8d)+_0x1a3865+_0x372dd0(0x8f));return{'parentId':_0x33ec34,'childId':_0x478d32};}function a143_0x41ec(_0x249fc3,_0x58acfd){_0x249fc3=_0x249fc3-0x83;const _0x45700b=a143_0x4570();let _0x41ecf2=_0x45700b[_0x249fc3];return _0x41ecf2;}function a143_0x4570(){const _0x451c46=['6738460TkjiUe','3RYjaLD','382371tZhlHy','15592sJNFMZ','5373LjGhXL','1732930UampuY','substring','Invalid\x20segment\x20reference\x20format:\x20','5467556KVaIGS','.\x20Child\x20name\x20cannot\x20be\x20empty','710164ruMedy','2zsbUUH','6tELiUt','indexOf','2551997jGpZJD'];a143_0x4570=function(){return _0x451c46;};return a143_0x4570();}
1
+ (function(_0x12eccb,_0x2a453e){const _0x18e925=a143_0x59d3,_0x34744b=_0x12eccb();while(!![]){try{const _0x40f1c2=parseInt(_0x18e925(0xbc))/0x1*(-parseInt(_0x18e925(0xc0))/0x2)+-parseInt(_0x18e925(0xbd))/0x3*(-parseInt(_0x18e925(0xbb))/0x4)+-parseInt(_0x18e925(0xba))/0x5+-parseInt(_0x18e925(0xc1))/0x6+parseInt(_0x18e925(0xc3))/0x7+parseInt(_0x18e925(0xbe))/0x8*(parseInt(_0x18e925(0xc5))/0x9)+-parseInt(_0x18e925(0xbf))/0xa*(-parseInt(_0x18e925(0xb9))/0xb);if(_0x40f1c2===_0x2a453e)break;else _0x34744b['push'](_0x34744b['shift']());}catch(_0x2c9e60){_0x34744b['push'](_0x34744b['shift']());}}}(a143_0x1f07,0xa502b));function a143_0x59d3(_0x1e745f,_0x5dc1d4){_0x1e745f=_0x1e745f-0xb9;const _0x1f07d6=a143_0x1f07();let _0x59d3fa=_0x1f07d6[_0x1e745f];return _0x59d3fa;}function a143_0x1f07(){const _0x19d238=['873zSiZki','indexOf','Invalid\x20segment\x20reference\x20format:\x20','.\x20Parent\x20name\x20cannot\x20be\x20empty','385MSPnOu','1871940puFHiH','582716WGaPWM','51jIhSyw','3wqHzTY','108208aVRaQV','85600jrCfSa','8206aDTgrh','4574868kndcUw','substring','1852907gDqCPk','.\x20Child\x20name\x20cannot\x20be\x20empty'];a143_0x1f07=function(){return _0x19d238;};return a143_0x1f07();}export function parseSegmentRef(_0x1e4aa9){const _0x3df5f4=a143_0x59d3,_0x561247=_0x1e4aa9[_0x3df5f4(0xc6)]('/');if(_0x561247===-0x1)return{'parentId':_0x1e4aa9};if(_0x561247===0x0)throw new Error(_0x3df5f4(0xc7)+_0x1e4aa9+_0x3df5f4(0xc8));const _0x198d50=_0x1e4aa9['substring'](0x0,_0x561247),_0x2ff2ce=_0x1e4aa9[_0x3df5f4(0xc2)](_0x561247+0x1);if(_0x2ff2ce==='')throw new Error(_0x3df5f4(0xc7)+_0x1e4aa9+_0x3df5f4(0xc4));return{'parentId':_0x198d50,'childId':_0x2ff2ce};}